WordPress/wp-includes/js/dist/url.js

1533 lines
45 KiB
JavaScript
Raw Normal View History

this["wp"] = this["wp"] || {}; this["wp"]["url"] =
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ }
/******/ };
/******/
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 8|1: behave like require
/******/ __webpack_require__.t = function(value, mode) {
/******/ if(mode & 1) value = __webpack_require__(value);
/******/ if(mode & 8) return value;
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ var ns = Object.create(null);
/******/ __webpack_require__.r(ns);
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ return ns;
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 467);
/******/ })
/************************************************************************/
/******/ ({
/***/ 118:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var stringify = __webpack_require__(456);
var parse = __webpack_require__(457);
var formats = __webpack_require__(272);
module.exports = {
formats: formats,
parse: parse,
stringify: stringify
};
/***/ }),
Block Editor: Update WordPress Packages. The following package versions were changed: @wordpress/a11y: 2.6.0 -> 2.7.0 @wordpress/annotations: 1.10.0 -> 1.11.0 @wordpress/api-fetch: 3.9.0 -> 3.10.0 @wordpress/autop: 2.5.1 -> 2.6.0 @wordpress/blob: 2.6.0 -> 2.7.0 @wordpress/block-directory: 1.3.0 -> 1.4.0 @wordpress/block-editor: 3.5.0 -> 3.6.0 @wordpress/block-library: 2.12.0 -> 2.13.0 @wordpress/block-serialization-default-parser: 3.4.1 -> 3.5.0 @wordpress/blocks: 6.10.0 -> 6.11.0 @wordpress/components: 9.0.0 -> 9.1.0 @wordpress/compose: 3.10.0 -> 3.11.0 @wordpress/core-data: 2.10.0 -> 2.11.0 @wordpress/custom-templated-path-webpack-plugin: 1.5.0 -> 1.6.0 @wordpress/data: 4.12.0 -> 4.13.0 @wordpress/data-controls: 1.6.0 -> 1.7.0 @wordpress/date: 3.7.0 -> 3.8.0 @wordpress/dependency-extraction-webpack-plugin: 2.1.0 -> 2.2.0 @wordpress/deprecated: 2.6.1 -> 2.7.0 @wordpress/dom: 2.7.0 -> 2.8.0 @wordpress/dom-ready: 2.6.0 -> 2.7.0 @wordpress/e2e-test-utils: 4.1.0 -> 4.2.0 @wordpress/edit-post: 3.11.0 -> 3.12.0 @wordpress/editor: 9.10.0 -> 9.11.0 @wordpress/element: 2.10.0 -> 2.11.0 @wordpress/escape-html: 1.6.0 -> 1.7.0 @wordpress/format-library: 1.12.0 -> 1.13.0 @wordpress/hooks: 2.6.0 -> 2.7.0 @wordpress/html-entities: 2.5.0 -> 2.6.0 @wordpress/i18n: 3.8.0 -> 3.9.0 @wordpress/is-shallow-equal: 1.7.0 -> 1.8.0 @wordpress/keyboard-shortcuts: 0.2.0 -> 1.0.0 @wordpress/keycodes: 2.8.0 -> 2.9.0 @wordpress/library-export-default-webpack-plugin: 1.5.0 -> 1.6.0 @wordpress/list-reusable-blocks: 1.11.0 -> 1.12.0 @wordpress/media-utils: 1.5.0 -> 1.6.0 @wordpress/notices: 1.11.0 -> 1.12.0 @wordpress/nux: 3.10.0 -> 3.11.0 @wordpress/plugins: 2.10.0 -> 2.11.0 @wordpress/priority-queue: 1.4.0 -> 1.5.0 @wordpress/redux-routine: 3.6.2 -> 3.7.0 @wordpress/rich-text: 3.10.0 -> 3.11.0 @wordpress/scripts: 6.2.0 -> 7.0.0 @wordpress/server-side-render: 1.6.0 -> 1.7.0 @wordpress/shortcode: 2.5.0 -> 2.6.0 @wordpress/token-list: 1.8.0 -> 1.9.0 @wordpress/url: 2.9.0 -> 2.10.0 @wordpress/viewport: 2.11.0 -> 2.12.0 @wordpress/wordcount: 2.6.2 -> 2.7.0 Added these new packages: @wordpress/warning @wordpress/primitives @wordpress/icons Re-added keyboard-shortcuts to script loader removed by mistake on revision 47198. Props gziolo, itsjonq, youknowriad, mcsf, andraganescu. Fixes #49358. Built from https://develop.svn.wordpress.org/trunk@47199 git-svn-id: http://core.svn.wordpress.org/trunk@46999 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-02-06 16:03:31 -05:00
/***/ 2:
/***/ (function(module, exports) {
(function() { module.exports = this["lodash"]; }());
/***/ }),
/***/ 271:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var has = Object.prototype.hasOwnProperty;
var isArray = Array.isArray;
var hexTable = (function () {
var array = [];
for (var i = 0; i < 256; ++i) {
array.push('%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase());
}
return array;
}());
var compactQueue = function compactQueue(queue) {
while (queue.length > 1) {
var item = queue.pop();
var obj = item.obj[item.prop];
if (isArray(obj)) {
var compacted = [];
for (var j = 0; j < obj.length; ++j) {
if (typeof obj[j] !== 'undefined') {
compacted.push(obj[j]);
}
}
item.obj[item.prop] = compacted;
}
}
};
var arrayToObject = function arrayToObject(source, options) {
var obj = options && options.plainObjects ? Object.create(null) : {};
for (var i = 0; i < source.length; ++i) {
if (typeof source[i] !== 'undefined') {
obj[i] = source[i];
}
}
return obj;
};
var merge = function merge(target, source, options) {
if (!source) {
return target;
}
if (typeof source !== 'object') {
if (isArray(target)) {
target.push(source);
} else if (target && typeof target === 'object') {
if ((options && (options.plainObjects || options.allowPrototypes)) || !has.call(Object.prototype, source)) {
target[source] = true;
}
} else {
return [target, source];
}
return target;
}
if (!target || typeof target !== 'object') {
return [target].concat(source);
}
var mergeTarget = target;
if (isArray(target) && !isArray(source)) {
mergeTarget = arrayToObject(target, options);
}
if (isArray(target) && isArray(source)) {
source.forEach(function (item, i) {
if (has.call(target, i)) {
var targetItem = target[i];
if (targetItem && typeof targetItem === 'object' && item && typeof item === 'object') {
target[i] = merge(targetItem, item, options);
} else {
target.push(item);
}
} else {
target[i] = item;
}
});
return target;
}
return Object.keys(source).reduce(function (acc, key) {
var value = source[key];
if (has.call(acc, key)) {
acc[key] = merge(acc[key], value, options);
} else {
acc[key] = value;
}
return acc;
}, mergeTarget);
};
var assign = function assignSingleSource(target, source) {
return Object.keys(source).reduce(function (acc, key) {
acc[key] = source[key];
return acc;
}, target);
};
var decode = function (str, decoder, charset) {
var strWithoutPlus = str.replace(/\+/g, ' ');
if (charset === 'iso-8859-1') {
// unescape never throws, no try...catch needed:
return strWithoutPlus.replace(/%[0-9a-f]{2}/gi, unescape);
}
// utf-8
try {
return decodeURIComponent(strWithoutPlus);
} catch (e) {
return strWithoutPlus;
}
};
var encode = function encode(str, defaultEncoder, charset) {
// This code was originally written by Brian White (mscdex) for the io.js core querystring library.
// It has been adapted here for stricter adherence to RFC 3986
if (str.length === 0) {
return str;
}
var string = typeof str === 'string' ? str : String(str);
if (charset === 'iso-8859-1') {
return escape(string).replace(/%u[0-9a-f]{4}/gi, function ($0) {
return '%26%23' + parseInt($0.slice(2), 16) + '%3B';
});
}
var out = '';
for (var i = 0; i < string.length; ++i) {
var c = string.charCodeAt(i);
if (
c === 0x2D // -
|| c === 0x2E // .
|| c === 0x5F // _
|| c === 0x7E // ~
|| (c >= 0x30 && c <= 0x39) // 0-9
|| (c >= 0x41 && c <= 0x5A) // a-z
|| (c >= 0x61 && c <= 0x7A) // A-Z
) {
out += string.charAt(i);
continue;
}
if (c < 0x80) {
out = out + hexTable[c];
continue;
}
if (c < 0x800) {
out = out + (hexTable[0xC0 | (c >> 6)] + hexTable[0x80 | (c & 0x3F)]);
continue;
}
if (c < 0xD800 || c >= 0xE000) {
out = out + (hexTable[0xE0 | (c >> 12)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)]);
continue;
}
i += 1;
c = 0x10000 + (((c & 0x3FF) << 10) | (string.charCodeAt(i) & 0x3FF));
out += hexTable[0xF0 | (c >> 18)]
+ hexTable[0x80 | ((c >> 12) & 0x3F)]
+ hexTable[0x80 | ((c >> 6) & 0x3F)]
+ hexTable[0x80 | (c & 0x3F)];
}
return out;
};
var compact = function compact(value) {
var queue = [{ obj: { o: value }, prop: 'o' }];
var refs = [];
for (var i = 0; i < queue.length; ++i) {
var item = queue[i];
var obj = item.obj[item.prop];
var keys = Object.keys(obj);
for (var j = 0; j < keys.length; ++j) {
var key = keys[j];
var val = obj[key];
if (typeof val === 'object' && val !== null && refs.indexOf(val) === -1) {
queue.push({ obj: obj, prop: key });
refs.push(val);
}
}
}
compactQueue(queue);
return value;
};
var isRegExp = function isRegExp(obj) {
return Object.prototype.toString.call(obj) === '[object RegExp]';
};
var isBuffer = function isBuffer(obj) {
if (!obj || typeof obj !== 'object') {
return false;
}
return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj));
};
var combine = function combine(a, b) {
return [].concat(a, b);
};
module.exports = {
arrayToObject: arrayToObject,
assign: assign,
combine: combine,
compact: compact,
decode: decode,
encode: encode,
isBuffer: isBuffer,
isRegExp: isRegExp,
merge: merge
};
/***/ }),
/***/ 272:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var replace = String.prototype.replace;
var percentTwenties = /%20/g;
module.exports = {
'default': 'RFC3986',
formatters: {
RFC1738: function (value) {
return replace.call(value, percentTwenties, '+');
},
RFC3986: function (value) {
return value;
}
},
RFC1738: 'RFC1738',
RFC3986: 'RFC3986'
};
/***/ }),
/***/ 456:
2020-01-08 06:57:23 -05:00
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Block Editor: Update the WordPress Packages to the ones used in the Gutenberg 6.5 release Updated Packages: In version 6.2: @wordpress/a11y@2.5.0 @wordpress/annotations@1.5.0 @wordpress/api-fetch@3.4.0 @wordpress/autop@2.4.0 @wordpress/babel-plugin-import-jsx-pragma@2.3.0 @wordpress/babel-plugin-makepot@3.2.0 @wordpress/babel-preset-default@4.4.0 @wordpress/blob@2.5.0 @wordpress/block-editor@3.0.0 @wordpress/block-library@2.7.0 @wordpress/block-serialization-default-parser@3.3.0 @wordpress/block-serialization-spec-parser@3.2.0 @wordpress/blocks@6.5.0 @wordpress/browserslist-config@2.6.0 @wordpress/components@8.1.0 @wordpress/compose@3.5.0 @wordpress/core-data@2.5.0 @wordpress/custom-templated-path-webpack-plugin@1.5.0 @wordpress/data-controls@1.1.0 @wordpress/data@4.7.0 @wordpress/date@3.4.0 @wordpress/dependency-extraction-webpack-plugin@1.1.0 @wordpress/deprecated@2.5.0 @wordpress/docgen@1.3.0 @wordpress/dom-ready@2.5.0 @wordpress/dom@2.4.0 @wordpress/e2e-test-utils@2.2.0 @wordpress/e2e-tests@1.4.0 @wordpress/edit-post@3.6.0 @wordpress/editor@9.5.0 @wordpress/element@2.6.0 @wordpress/escape-html@1.5.0 @wordpress/eslint-plugin@2.4.0 @wordpress/format-library@1.7.0 @wordpress/hooks@2.5.0 @wordpress/html-entities@2.5.0 @wordpress/i18n@3.6.0 @wordpress/is-shallow-equal@1.5.0 @wordpress/jest-console@3.2.0 @wordpress/jest-preset-default@4.3.0 @wordpress/jest-puppeteer-axe@1.2.0 @wordpress/keycodes@2.5.0 @wordpress/library-export-default-webpack-plugin@1.4.0 @wordpress/list-reusable-blocks@1.6.0 @wordpress/media-utils@1.0.0 @wordpress/notices@1.6.0 @wordpress/npm-package-json-lint-config@2.1.0 @wordpress/nux@3.5.0 @wordpress/plugins@2.5.0 @wordpress/postcss-themes@2.2.0 @wordpress/priority-queue@1.3.0 @wordpress/redux-routine@3.5.0 @wordpress/rich-text@3.5.0 @wordpress/scripts@3.4.0 @wordpress/server-side-render@1.1.0 @wordpress/shortcode@2.4.0 @wordpress/token-list@1.5.0 @wordpress/url@2.7.0 @wordpress/viewport@2.6.0 @wordpress/wordcount@2.5.0 In version 6.4: @wordpress/annotations@1.6.0 @wordpress/api-fetch@3.5.0 @wordpress/autop@2.5.0 @wordpress/babel-preset-default@4.5.0 @wordpress/block-editor@3.1.0 @wordpress/block-library@2.8.0 @wordpress/block-serialization-default-parser@3.4.0 @wordpress/block-serialization-spec-parser@3.3.0 @wordpress/blocks@6.6.0 @wordpress/components@8.2.0 @wordpress/compose@3.6.0 @wordpress/core-data@2.6.0 @wordpress/data-controls@1.2.0 @wordpress/data@4.8.0 @wordpress/date@3.5.0 @wordpress/dependency-extraction-webpack-plugin@1.2.0 @wordpress/deprecated@2.6.0 @wordpress/docgen@1.4.0 @wordpress/dom@2.5.0 @wordpress/e2e-test-utils@2.3.0 @wordpress/e2e-tests@1.5.0 @wordpress/edit-post@3.7.0 @wordpress/editor@9.6.0 @wordpress/element@2.7.0 @wordpress/eslint-plugin@3.0.0 @wordpress/format-library@1.8.0 @wordpress/hooks@2.6.0 @wordpress/is-shallow-equal@1.6.0 @wordpress/jest-console@3.3.0 @wordpress/jest-preset-default@5.0.0 @wordpress/jest-puppeteer-axe@1.3.0 @wordpress/keycodes@2.6.0 @wordpress/list-reusable-blocks@1.7.0 @wordpress/media-utils@1.1.0 @wordpress/notices@1.7.0 @wordpress/nux@3.6.0 @wordpress/plugins@2.6.0 @wordpress/project-management-automation@1.0.0 @wordpress/redux-routine@3.6.0 @wordpress/rich-text@3.6.0 @wordpress/scripts@4.0.0 @wordpress/server-side-render@1.2.0 @wordpress/token-list@1.6.0 @wordpress/viewport@2.7.0 @wordpress/wordcount@2.6.0 In version 6.5: @wordpress/annotations@1.7.0 @wordpress/api-fetch@3.6.0 @wordpress/babel-preset-default@4.6.0 @wordpress/block-directory@1.0.0 @wordpress/block-editor@3.2.0 @wordpress/block-library@2.9.0 @wordpress/blocks@6.7.0 @wordpress/components@8.3.0 @wordpress/compose@3.7.0 @wordpress/core-data@2.7.0 @wordpress/data-controls@1.3.0 @wordpress/data@4.9.0 @wordpress/dependency-extraction-webpack-plugin@2.0.0 @wordpress/e2e-test-utils@2.4.0 @wordpress/e2e-tests@1.7.0 @wordpress/edit-post@3.8.0 @wordpress/editor@9.7.0 @wordpress/element@2.8.0 @wordpress/eslint-plugin@3.1.0 @wordpress/format-library@1.9.0 @wordpress/list-reusable-blocks@1.8.0 @wordpress/media-utils@1.2.0 @wordpress/notices@1.8.0 @wordpress/nux@3.7.0 @wordpress/plugins@2.7.0 @wordpress/rich-text@3.7.0 @wordpress/scripts@5.0.0 @wordpress/server-side-render@1.3.0 @wordpress/url@2.8.0 @wordpress/viewport@2.8.0 Props youknowriad desrosj noisysocks pento jorgefilipecosta iseulde Fixes: #47843 Built from https://develop.svn.wordpress.org/trunk@46189 git-svn-id: http://core.svn.wordpress.org/trunk@46001 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-19 11:19:18 -04:00
var utils = __webpack_require__(271);
var formats = __webpack_require__(272);
2020-01-08 06:57:23 -05:00
var has = Object.prototype.hasOwnProperty;
2020-01-08 06:57:23 -05:00
var arrayPrefixGenerators = {
brackets: function brackets(prefix) { // eslint-disable-line func-name-matching
return prefix + '[]';
},
comma: 'comma',
indices: function indices(prefix, key) { // eslint-disable-line func-name-matching
return prefix + '[' + key + ']';
},
repeat: function repeat(prefix) { // eslint-disable-line func-name-matching
return prefix;
}
};
Block Editor: Update the WordPress Packages to the ones used in the Gutenberg 6.5 release Updated Packages: In version 6.2: @wordpress/a11y@2.5.0 @wordpress/annotations@1.5.0 @wordpress/api-fetch@3.4.0 @wordpress/autop@2.4.0 @wordpress/babel-plugin-import-jsx-pragma@2.3.0 @wordpress/babel-plugin-makepot@3.2.0 @wordpress/babel-preset-default@4.4.0 @wordpress/blob@2.5.0 @wordpress/block-editor@3.0.0 @wordpress/block-library@2.7.0 @wordpress/block-serialization-default-parser@3.3.0 @wordpress/block-serialization-spec-parser@3.2.0 @wordpress/blocks@6.5.0 @wordpress/browserslist-config@2.6.0 @wordpress/components@8.1.0 @wordpress/compose@3.5.0 @wordpress/core-data@2.5.0 @wordpress/custom-templated-path-webpack-plugin@1.5.0 @wordpress/data-controls@1.1.0 @wordpress/data@4.7.0 @wordpress/date@3.4.0 @wordpress/dependency-extraction-webpack-plugin@1.1.0 @wordpress/deprecated@2.5.0 @wordpress/docgen@1.3.0 @wordpress/dom-ready@2.5.0 @wordpress/dom@2.4.0 @wordpress/e2e-test-utils@2.2.0 @wordpress/e2e-tests@1.4.0 @wordpress/edit-post@3.6.0 @wordpress/editor@9.5.0 @wordpress/element@2.6.0 @wordpress/escape-html@1.5.0 @wordpress/eslint-plugin@2.4.0 @wordpress/format-library@1.7.0 @wordpress/hooks@2.5.0 @wordpress/html-entities@2.5.0 @wordpress/i18n@3.6.0 @wordpress/is-shallow-equal@1.5.0 @wordpress/jest-console@3.2.0 @wordpress/jest-preset-default@4.3.0 @wordpress/jest-puppeteer-axe@1.2.0 @wordpress/keycodes@2.5.0 @wordpress/library-export-default-webpack-plugin@1.4.0 @wordpress/list-reusable-blocks@1.6.0 @wordpress/media-utils@1.0.0 @wordpress/notices@1.6.0 @wordpress/npm-package-json-lint-config@2.1.0 @wordpress/nux@3.5.0 @wordpress/plugins@2.5.0 @wordpress/postcss-themes@2.2.0 @wordpress/priority-queue@1.3.0 @wordpress/redux-routine@3.5.0 @wordpress/rich-text@3.5.0 @wordpress/scripts@3.4.0 @wordpress/server-side-render@1.1.0 @wordpress/shortcode@2.4.0 @wordpress/token-list@1.5.0 @wordpress/url@2.7.0 @wordpress/viewport@2.6.0 @wordpress/wordcount@2.5.0 In version 6.4: @wordpress/annotations@1.6.0 @wordpress/api-fetch@3.5.0 @wordpress/autop@2.5.0 @wordpress/babel-preset-default@4.5.0 @wordpress/block-editor@3.1.0 @wordpress/block-library@2.8.0 @wordpress/block-serialization-default-parser@3.4.0 @wordpress/block-serialization-spec-parser@3.3.0 @wordpress/blocks@6.6.0 @wordpress/components@8.2.0 @wordpress/compose@3.6.0 @wordpress/core-data@2.6.0 @wordpress/data-controls@1.2.0 @wordpress/data@4.8.0 @wordpress/date@3.5.0 @wordpress/dependency-extraction-webpack-plugin@1.2.0 @wordpress/deprecated@2.6.0 @wordpress/docgen@1.4.0 @wordpress/dom@2.5.0 @wordpress/e2e-test-utils@2.3.0 @wordpress/e2e-tests@1.5.0 @wordpress/edit-post@3.7.0 @wordpress/editor@9.6.0 @wordpress/element@2.7.0 @wordpress/eslint-plugin@3.0.0 @wordpress/format-library@1.8.0 @wordpress/hooks@2.6.0 @wordpress/is-shallow-equal@1.6.0 @wordpress/jest-console@3.3.0 @wordpress/jest-preset-default@5.0.0 @wordpress/jest-puppeteer-axe@1.3.0 @wordpress/keycodes@2.6.0 @wordpress/list-reusable-blocks@1.7.0 @wordpress/media-utils@1.1.0 @wordpress/notices@1.7.0 @wordpress/nux@3.6.0 @wordpress/plugins@2.6.0 @wordpress/project-management-automation@1.0.0 @wordpress/redux-routine@3.6.0 @wordpress/rich-text@3.6.0 @wordpress/scripts@4.0.0 @wordpress/server-side-render@1.2.0 @wordpress/token-list@1.6.0 @wordpress/viewport@2.7.0 @wordpress/wordcount@2.6.0 In version 6.5: @wordpress/annotations@1.7.0 @wordpress/api-fetch@3.6.0 @wordpress/babel-preset-default@4.6.0 @wordpress/block-directory@1.0.0 @wordpress/block-editor@3.2.0 @wordpress/block-library@2.9.0 @wordpress/blocks@6.7.0 @wordpress/components@8.3.0 @wordpress/compose@3.7.0 @wordpress/core-data@2.7.0 @wordpress/data-controls@1.3.0 @wordpress/data@4.9.0 @wordpress/dependency-extraction-webpack-plugin@2.0.0 @wordpress/e2e-test-utils@2.4.0 @wordpress/e2e-tests@1.7.0 @wordpress/edit-post@3.8.0 @wordpress/editor@9.7.0 @wordpress/element@2.8.0 @wordpress/eslint-plugin@3.1.0 @wordpress/format-library@1.9.0 @wordpress/list-reusable-blocks@1.8.0 @wordpress/media-utils@1.2.0 @wordpress/notices@1.8.0 @wordpress/nux@3.7.0 @wordpress/plugins@2.7.0 @wordpress/rich-text@3.7.0 @wordpress/scripts@5.0.0 @wordpress/server-side-render@1.3.0 @wordpress/url@2.8.0 @wordpress/viewport@2.8.0 Props youknowriad desrosj noisysocks pento jorgefilipecosta iseulde Fixes: #47843 Built from https://develop.svn.wordpress.org/trunk@46189 git-svn-id: http://core.svn.wordpress.org/trunk@46001 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-19 11:19:18 -04:00
2020-01-08 06:57:23 -05:00
var isArray = Array.isArray;
var push = Array.prototype.push;
var pushToArray = function (arr, valueOrArray) {
push.apply(arr, isArray(valueOrArray) ? valueOrArray : [valueOrArray]);
};
2020-01-08 06:57:23 -05:00
var toISO = Date.prototype.toISOString;
2020-01-08 06:57:23 -05:00
var defaults = {
addQueryPrefix: false,
allowDots: false,
charset: 'utf-8',
charsetSentinel: false,
delimiter: '&',
encode: true,
encoder: utils.encode,
encodeValuesOnly: false,
formatter: formats.formatters[formats['default']],
// deprecated
indices: false,
serializeDate: function serializeDate(date) { // eslint-disable-line func-name-matching
return toISO.call(date);
},
skipNulls: false,
strictNullHandling: false
};
2020-01-08 06:57:23 -05:00
var stringify = function stringify( // eslint-disable-line func-name-matching
object,
prefix,
generateArrayPrefix,
strictNullHandling,
skipNulls,
encoder,
filter,
sort,
allowDots,
serializeDate,
formatter,
encodeValuesOnly,
charset
) {
var obj = object;
if (typeof filter === 'function') {
obj = filter(prefix, obj);
} else if (obj instanceof Date) {
obj = serializeDate(obj);
} else if (generateArrayPrefix === 'comma' && isArray(obj)) {
obj = obj.join(',');
}
2020-01-08 06:57:23 -05:00
if (obj === null) {
if (strictNullHandling) {
return encoder && !encodeValuesOnly ? encoder(prefix, defaults.encoder, charset) : prefix;
}
2020-01-08 06:57:23 -05:00
obj = '';
}
2020-01-08 06:57:23 -05:00
if (typeof obj === 'string' || typeof obj === 'number' || typeof obj === 'boolean' || utils.isBuffer(obj)) {
if (encoder) {
var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder, charset);
return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults.encoder, charset))];
}
return [formatter(prefix) + '=' + formatter(String(obj))];
}
2020-01-08 06:57:23 -05:00
var values = [];
2020-01-08 06:57:23 -05:00
if (typeof obj === 'undefined') {
return values;
}
2020-01-08 06:57:23 -05:00
var objKeys;
if (isArray(filter)) {
objKeys = filter;
} else {
var keys = Object.keys(obj);
objKeys = sort ? keys.sort(sort) : keys;
}
2020-01-08 06:57:23 -05:00
for (var i = 0; i < objKeys.length; ++i) {
var key = objKeys[i];
2020-01-08 06:57:23 -05:00
if (skipNulls && obj[key] === null) {
continue;
}
2020-01-08 06:57:23 -05:00
if (isArray(obj)) {
pushToArray(values, stringify(
obj[key],
typeof generateArrayPrefix === 'function' ? generateArrayPrefix(prefix, key) : prefix,
generateArrayPrefix,
strictNullHandling,
skipNulls,
encoder,
filter,
sort,
allowDots,
serializeDate,
formatter,
encodeValuesOnly,
charset
));
} else {
pushToArray(values, stringify(
obj[key],
prefix + (allowDots ? '.' + key : '[' + key + ']'),
generateArrayPrefix,
strictNullHandling,
skipNulls,
encoder,
filter,
sort,
allowDots,
serializeDate,
formatter,
encodeValuesOnly,
charset
));
}
}
Block Editor: Update the WordPress Packages from Gutenberg 5.2. Updated Packages: - @wordpress/a11y@2.1.0 - @wordpress/annotations@1.1.0 - @wordpress/api-fetch@3.0.0 - @wordpress/autop@2.1.0 - @wordpress/babel-plugin-import-jsx-pragma@2.0.0 - @wordpress/babel-plugin-makepot@3.0.0 - @wordpress/babel-preset-default@4.0.0 - @wordpress/blob@2.2.0 - @wordpress/block-editor@1.0.0 - @wordpress/block-library@2.3.0 - @wordpress/block-serialization-default-parser@3.0.0 - @wordpress/block-serialization-spec-parser@3.0.0 - @wordpress/blocks@6.1.0 - @wordpress/browserslist-config@2.3.0 - @wordpress/components@7.1.0 - @wordpress/compose@3.1.0 - @wordpress/core-data@2.1.0 - @wordpress/custom-templated-path-webpack-plugin@1.2.0 - @wordpress/data@4.3.0 - @wordpress/date@3.1.0 - @wordpress/deprecated@2.1.0 - @wordpress/docgen@1.0.0 - @wordpress/dom-ready@2.1.0 - @wordpress/dom@2.1.0 - @wordpress/e2e-test-utils@1.0.0 - @wordpress/e2e-tests@1.0.0 - @wordpress/edit-post@3.2.0 - @wordpress/editor@9.1.0 - @wordpress/element@2.2.0 - @wordpress/escape-html@1.1.0 - @wordpress/eslint-plugin@2.0.0 - @wordpress/format-library@1.3.0 - @wordpress/hooks@2.1.0 - @wordpress/html-entities@2.1.0 - @wordpress/i18n@3.2.0 - @wordpress/is-shallow-equal@1.2.0 - @wordpress/jest-console@3.0.0 - @wordpress/jest-preset-default@4.0.0 - @wordpress/jest-puppeteer-axe@1.0.0 - @wordpress/keycodes@2.1.0 - @wordpress/library-export-default-webpack-plugin@1.1.0 - @wordpress/list-reusable-blocks@1.2.0 - @wordpress/notices@1.2.0 - @wordpress/npm-package-json-lint-config@1.2.0 - @wordpress/nux@3.1.0 - @wordpress/plugins@2.1.0 - @wordpress/postcss-themes@2.0.0 - @wordpress/priority-queue@1.0.0 - @wordpress/redux-routine@3.1.0 - @wordpress/rich-text@3.1.0 - @wordpress/scripts@3.0.0 - @wordpress/shortcode@2.1.0 - @wordpress/token-list@1.2.0 - @wordpress/url@2.4.0 - @wordpress/viewport@2.2.0 - @wordpress/wordcount@2.1.0 This also includes the update to the scripts dependencies and the new widgets php files. Props iseulde. Fixes #46429. Built from https://develop.svn.wordpress.org/trunk@44808 git-svn-id: http://core.svn.wordpress.org/trunk@44640 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-03-07 04:09:59 -05:00
2020-01-08 06:57:23 -05:00
return values;
};
Block Editor: Update the WordPress Packages from Gutenberg 5.2. Updated Packages: - @wordpress/a11y@2.1.0 - @wordpress/annotations@1.1.0 - @wordpress/api-fetch@3.0.0 - @wordpress/autop@2.1.0 - @wordpress/babel-plugin-import-jsx-pragma@2.0.0 - @wordpress/babel-plugin-makepot@3.0.0 - @wordpress/babel-preset-default@4.0.0 - @wordpress/blob@2.2.0 - @wordpress/block-editor@1.0.0 - @wordpress/block-library@2.3.0 - @wordpress/block-serialization-default-parser@3.0.0 - @wordpress/block-serialization-spec-parser@3.0.0 - @wordpress/blocks@6.1.0 - @wordpress/browserslist-config@2.3.0 - @wordpress/components@7.1.0 - @wordpress/compose@3.1.0 - @wordpress/core-data@2.1.0 - @wordpress/custom-templated-path-webpack-plugin@1.2.0 - @wordpress/data@4.3.0 - @wordpress/date@3.1.0 - @wordpress/deprecated@2.1.0 - @wordpress/docgen@1.0.0 - @wordpress/dom-ready@2.1.0 - @wordpress/dom@2.1.0 - @wordpress/e2e-test-utils@1.0.0 - @wordpress/e2e-tests@1.0.0 - @wordpress/edit-post@3.2.0 - @wordpress/editor@9.1.0 - @wordpress/element@2.2.0 - @wordpress/escape-html@1.1.0 - @wordpress/eslint-plugin@2.0.0 - @wordpress/format-library@1.3.0 - @wordpress/hooks@2.1.0 - @wordpress/html-entities@2.1.0 - @wordpress/i18n@3.2.0 - @wordpress/is-shallow-equal@1.2.0 - @wordpress/jest-console@3.0.0 - @wordpress/jest-preset-default@4.0.0 - @wordpress/jest-puppeteer-axe@1.0.0 - @wordpress/keycodes@2.1.0 - @wordpress/library-export-default-webpack-plugin@1.1.0 - @wordpress/list-reusable-blocks@1.2.0 - @wordpress/notices@1.2.0 - @wordpress/npm-package-json-lint-config@1.2.0 - @wordpress/nux@3.1.0 - @wordpress/plugins@2.1.0 - @wordpress/postcss-themes@2.0.0 - @wordpress/priority-queue@1.0.0 - @wordpress/redux-routine@3.1.0 - @wordpress/rich-text@3.1.0 - @wordpress/scripts@3.0.0 - @wordpress/shortcode@2.1.0 - @wordpress/token-list@1.2.0 - @wordpress/url@2.4.0 - @wordpress/viewport@2.2.0 - @wordpress/wordcount@2.1.0 This also includes the update to the scripts dependencies and the new widgets php files. Props iseulde. Fixes #46429. Built from https://develop.svn.wordpress.org/trunk@44808 git-svn-id: http://core.svn.wordpress.org/trunk@44640 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-03-07 04:09:59 -05:00
2020-01-08 06:57:23 -05:00
var normalizeStringifyOptions = function normalizeStringifyOptions(opts) {
if (!opts) {
return defaults;
}
2020-01-08 06:57:23 -05:00
if (opts.encoder !== null && opts.encoder !== undefined && typeof opts.encoder !== 'function') {
throw new TypeError('Encoder has to be a function.');
}
2020-01-08 06:57:23 -05:00
var charset = opts.charset || defaults.charset;
if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {
throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');
}
2020-01-08 06:57:23 -05:00
var format = formats['default'];
if (typeof opts.format !== 'undefined') {
if (!has.call(formats.formatters, opts.format)) {
throw new TypeError('Unknown format option provided.');
}
format = opts.format;
}
var formatter = formats.formatters[format];
2020-01-08 06:57:23 -05:00
var filter = defaults.filter;
if (typeof opts.filter === 'function' || isArray(opts.filter)) {
filter = opts.filter;
}
2020-01-08 06:57:23 -05:00
return {
addQueryPrefix: typeof opts.addQueryPrefix === 'boolean' ? opts.addQueryPrefix : defaults.addQueryPrefix,
allowDots: typeof opts.allowDots === 'undefined' ? defaults.allowDots : !!opts.allowDots,
charset: charset,
charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel,
delimiter: typeof opts.delimiter === 'undefined' ? defaults.delimiter : opts.delimiter,
encode: typeof opts.encode === 'boolean' ? opts.encode : defaults.encode,
encoder: typeof opts.encoder === 'function' ? opts.encoder : defaults.encoder,
encodeValuesOnly: typeof opts.encodeValuesOnly === 'boolean' ? opts.encodeValuesOnly : defaults.encodeValuesOnly,
filter: filter,
formatter: formatter,
serializeDate: typeof opts.serializeDate === 'function' ? opts.serializeDate : defaults.serializeDate,
skipNulls: typeof opts.skipNulls === 'boolean' ? opts.skipNulls : defaults.skipNulls,
sort: typeof opts.sort === 'function' ? opts.sort : null,
strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling
};
};
2020-01-08 06:57:23 -05:00
module.exports = function (object, opts) {
var obj = object;
var options = normalizeStringifyOptions(opts);
2020-01-08 06:57:23 -05:00
var objKeys;
var filter;
2020-01-08 06:57:23 -05:00
if (typeof options.filter === 'function') {
filter = options.filter;
obj = filter('', obj);
} else if (isArray(options.filter)) {
filter = options.filter;
objKeys = filter;
}
2020-01-08 06:57:23 -05:00
var keys = [];
2020-01-08 06:57:23 -05:00
if (typeof obj !== 'object' || obj === null) {
return '';
}
2020-01-08 06:57:23 -05:00
var arrayFormat;
if (opts && opts.arrayFormat in arrayPrefixGenerators) {
arrayFormat = opts.arrayFormat;
} else if (opts && 'indices' in opts) {
arrayFormat = opts.indices ? 'indices' : 'repeat';
} else {
arrayFormat = 'indices';
}
Block Editor: Update the WordPress Packages to the ones used in the Gutenberg 6.5 release Updated Packages: In version 6.2: @wordpress/a11y@2.5.0 @wordpress/annotations@1.5.0 @wordpress/api-fetch@3.4.0 @wordpress/autop@2.4.0 @wordpress/babel-plugin-import-jsx-pragma@2.3.0 @wordpress/babel-plugin-makepot@3.2.0 @wordpress/babel-preset-default@4.4.0 @wordpress/blob@2.5.0 @wordpress/block-editor@3.0.0 @wordpress/block-library@2.7.0 @wordpress/block-serialization-default-parser@3.3.0 @wordpress/block-serialization-spec-parser@3.2.0 @wordpress/blocks@6.5.0 @wordpress/browserslist-config@2.6.0 @wordpress/components@8.1.0 @wordpress/compose@3.5.0 @wordpress/core-data@2.5.0 @wordpress/custom-templated-path-webpack-plugin@1.5.0 @wordpress/data-controls@1.1.0 @wordpress/data@4.7.0 @wordpress/date@3.4.0 @wordpress/dependency-extraction-webpack-plugin@1.1.0 @wordpress/deprecated@2.5.0 @wordpress/docgen@1.3.0 @wordpress/dom-ready@2.5.0 @wordpress/dom@2.4.0 @wordpress/e2e-test-utils@2.2.0 @wordpress/e2e-tests@1.4.0 @wordpress/edit-post@3.6.0 @wordpress/editor@9.5.0 @wordpress/element@2.6.0 @wordpress/escape-html@1.5.0 @wordpress/eslint-plugin@2.4.0 @wordpress/format-library@1.7.0 @wordpress/hooks@2.5.0 @wordpress/html-entities@2.5.0 @wordpress/i18n@3.6.0 @wordpress/is-shallow-equal@1.5.0 @wordpress/jest-console@3.2.0 @wordpress/jest-preset-default@4.3.0 @wordpress/jest-puppeteer-axe@1.2.0 @wordpress/keycodes@2.5.0 @wordpress/library-export-default-webpack-plugin@1.4.0 @wordpress/list-reusable-blocks@1.6.0 @wordpress/media-utils@1.0.0 @wordpress/notices@1.6.0 @wordpress/npm-package-json-lint-config@2.1.0 @wordpress/nux@3.5.0 @wordpress/plugins@2.5.0 @wordpress/postcss-themes@2.2.0 @wordpress/priority-queue@1.3.0 @wordpress/redux-routine@3.5.0 @wordpress/rich-text@3.5.0 @wordpress/scripts@3.4.0 @wordpress/server-side-render@1.1.0 @wordpress/shortcode@2.4.0 @wordpress/token-list@1.5.0 @wordpress/url@2.7.0 @wordpress/viewport@2.6.0 @wordpress/wordcount@2.5.0 In version 6.4: @wordpress/annotations@1.6.0 @wordpress/api-fetch@3.5.0 @wordpress/autop@2.5.0 @wordpress/babel-preset-default@4.5.0 @wordpress/block-editor@3.1.0 @wordpress/block-library@2.8.0 @wordpress/block-serialization-default-parser@3.4.0 @wordpress/block-serialization-spec-parser@3.3.0 @wordpress/blocks@6.6.0 @wordpress/components@8.2.0 @wordpress/compose@3.6.0 @wordpress/core-data@2.6.0 @wordpress/data-controls@1.2.0 @wordpress/data@4.8.0 @wordpress/date@3.5.0 @wordpress/dependency-extraction-webpack-plugin@1.2.0 @wordpress/deprecated@2.6.0 @wordpress/docgen@1.4.0 @wordpress/dom@2.5.0 @wordpress/e2e-test-utils@2.3.0 @wordpress/e2e-tests@1.5.0 @wordpress/edit-post@3.7.0 @wordpress/editor@9.6.0 @wordpress/element@2.7.0 @wordpress/eslint-plugin@3.0.0 @wordpress/format-library@1.8.0 @wordpress/hooks@2.6.0 @wordpress/is-shallow-equal@1.6.0 @wordpress/jest-console@3.3.0 @wordpress/jest-preset-default@5.0.0 @wordpress/jest-puppeteer-axe@1.3.0 @wordpress/keycodes@2.6.0 @wordpress/list-reusable-blocks@1.7.0 @wordpress/media-utils@1.1.0 @wordpress/notices@1.7.0 @wordpress/nux@3.6.0 @wordpress/plugins@2.6.0 @wordpress/project-management-automation@1.0.0 @wordpress/redux-routine@3.6.0 @wordpress/rich-text@3.6.0 @wordpress/scripts@4.0.0 @wordpress/server-side-render@1.2.0 @wordpress/token-list@1.6.0 @wordpress/viewport@2.7.0 @wordpress/wordcount@2.6.0 In version 6.5: @wordpress/annotations@1.7.0 @wordpress/api-fetch@3.6.0 @wordpress/babel-preset-default@4.6.0 @wordpress/block-directory@1.0.0 @wordpress/block-editor@3.2.0 @wordpress/block-library@2.9.0 @wordpress/blocks@6.7.0 @wordpress/components@8.3.0 @wordpress/compose@3.7.0 @wordpress/core-data@2.7.0 @wordpress/data-controls@1.3.0 @wordpress/data@4.9.0 @wordpress/dependency-extraction-webpack-plugin@2.0.0 @wordpress/e2e-test-utils@2.4.0 @wordpress/e2e-tests@1.7.0 @wordpress/edit-post@3.8.0 @wordpress/editor@9.7.0 @wordpress/element@2.8.0 @wordpress/eslint-plugin@3.1.0 @wordpress/format-library@1.9.0 @wordpress/list-reusable-blocks@1.8.0 @wordpress/media-utils@1.2.0 @wordpress/notices@1.8.0 @wordpress/nux@3.7.0 @wordpress/plugins@2.7.0 @wordpress/rich-text@3.7.0 @wordpress/scripts@5.0.0 @wordpress/server-side-render@1.3.0 @wordpress/url@2.8.0 @wordpress/viewport@2.8.0 Props youknowriad desrosj noisysocks pento jorgefilipecosta iseulde Fixes: #47843 Built from https://develop.svn.wordpress.org/trunk@46189 git-svn-id: http://core.svn.wordpress.org/trunk@46001 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-19 11:19:18 -04:00
2020-01-08 06:57:23 -05:00
var generateArrayPrefix = arrayPrefixGenerators[arrayFormat];
2020-01-08 06:57:23 -05:00
if (!objKeys) {
objKeys = Object.keys(obj);
}
2020-01-08 06:57:23 -05:00
if (options.sort) {
objKeys.sort(options.sort);
}
2020-01-08 06:57:23 -05:00
for (var i = 0; i < objKeys.length; ++i) {
var key = objKeys[i];
2020-01-08 06:57:23 -05:00
if (options.skipNulls && obj[key] === null) {
continue;
}
pushToArray(keys, stringify(
obj[key],
key,
generateArrayPrefix,
options.strictNullHandling,
options.skipNulls,
options.encode ? options.encoder : null,
options.filter,
options.sort,
options.allowDots,
options.serializeDate,
options.formatter,
options.encodeValuesOnly,
options.charset
));
}
2020-01-08 06:57:23 -05:00
var joined = keys.join(options.delimiter);
var prefix = options.addQueryPrefix === true ? '?' : '';
Block Editor: Update the WordPress Packages from Gutenberg 5.2. Updated Packages: - @wordpress/a11y@2.1.0 - @wordpress/annotations@1.1.0 - @wordpress/api-fetch@3.0.0 - @wordpress/autop@2.1.0 - @wordpress/babel-plugin-import-jsx-pragma@2.0.0 - @wordpress/babel-plugin-makepot@3.0.0 - @wordpress/babel-preset-default@4.0.0 - @wordpress/blob@2.2.0 - @wordpress/block-editor@1.0.0 - @wordpress/block-library@2.3.0 - @wordpress/block-serialization-default-parser@3.0.0 - @wordpress/block-serialization-spec-parser@3.0.0 - @wordpress/blocks@6.1.0 - @wordpress/browserslist-config@2.3.0 - @wordpress/components@7.1.0 - @wordpress/compose@3.1.0 - @wordpress/core-data@2.1.0 - @wordpress/custom-templated-path-webpack-plugin@1.2.0 - @wordpress/data@4.3.0 - @wordpress/date@3.1.0 - @wordpress/deprecated@2.1.0 - @wordpress/docgen@1.0.0 - @wordpress/dom-ready@2.1.0 - @wordpress/dom@2.1.0 - @wordpress/e2e-test-utils@1.0.0 - @wordpress/e2e-tests@1.0.0 - @wordpress/edit-post@3.2.0 - @wordpress/editor@9.1.0 - @wordpress/element@2.2.0 - @wordpress/escape-html@1.1.0 - @wordpress/eslint-plugin@2.0.0 - @wordpress/format-library@1.3.0 - @wordpress/hooks@2.1.0 - @wordpress/html-entities@2.1.0 - @wordpress/i18n@3.2.0 - @wordpress/is-shallow-equal@1.2.0 - @wordpress/jest-console@3.0.0 - @wordpress/jest-preset-default@4.0.0 - @wordpress/jest-puppeteer-axe@1.0.0 - @wordpress/keycodes@2.1.0 - @wordpress/library-export-default-webpack-plugin@1.1.0 - @wordpress/list-reusable-blocks@1.2.0 - @wordpress/notices@1.2.0 - @wordpress/npm-package-json-lint-config@1.2.0 - @wordpress/nux@3.1.0 - @wordpress/plugins@2.1.0 - @wordpress/postcss-themes@2.0.0 - @wordpress/priority-queue@1.0.0 - @wordpress/redux-routine@3.1.0 - @wordpress/rich-text@3.1.0 - @wordpress/scripts@3.0.0 - @wordpress/shortcode@2.1.0 - @wordpress/token-list@1.2.0 - @wordpress/url@2.4.0 - @wordpress/viewport@2.2.0 - @wordpress/wordcount@2.1.0 This also includes the update to the scripts dependencies and the new widgets php files. Props iseulde. Fixes #46429. Built from https://develop.svn.wordpress.org/trunk@44808 git-svn-id: http://core.svn.wordpress.org/trunk@44640 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-03-07 04:09:59 -05:00
2020-01-08 06:57:23 -05:00
if (options.charsetSentinel) {
if (options.charset === 'iso-8859-1') {
// encodeURIComponent('&#10003;'), the "numeric entity" representation of a checkmark
prefix += 'utf8=%26%2310003%3B&';
} else {
// encodeURIComponent('✓')
prefix += 'utf8=%E2%9C%93&';
}
}
return joined.length > 0 ? prefix + joined : '';
};
/***/ }),
/***/ 457:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var utils = __webpack_require__(271);
2020-01-08 06:57:23 -05:00
var has = Object.prototype.hasOwnProperty;
var defaults = {
allowDots: false,
2020-01-08 06:57:23 -05:00
allowPrototypes: false,
arrayLimit: 20,
charset: 'utf-8',
charsetSentinel: false,
2020-01-08 06:57:23 -05:00
comma: false,
decoder: utils.decode,
delimiter: '&',
2020-01-08 06:57:23 -05:00
depth: 5,
ignoreQueryPrefix: false,
interpretNumericEntities: false,
parameterLimit: 1000,
parseArrays: true,
plainObjects: false,
strictNullHandling: false
};
2020-01-08 06:57:23 -05:00
var interpretNumericEntities = function (str) {
return str.replace(/&#(\d+);/g, function ($0, numberStr) {
return String.fromCharCode(parseInt(numberStr, 10));
});
};
// This is what browsers will submit when the ✓ character occurs in an
// application/x-www-form-urlencoded body and the encoding of the page containing
// the form is iso-8859-1, or when the submitted form has an accept-charset
// attribute of iso-8859-1. Presumably also with other charsets that do not contain
// the ✓ character, such as us-ascii.
var isoSentinel = 'utf8=%26%2310003%3B'; // encodeURIComponent('&#10003;')
// These are the percent-encoded utf-8 octets representing a checkmark, indicating that the request actually is utf-8 encoded.
var charsetSentinel = 'utf8=%E2%9C%93'; // encodeURIComponent('✓')
var parseValues = function parseQueryStringValues(str, options) {
var obj = {};
var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, '') : str;
var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit;
var parts = cleanStr.split(options.delimiter, limit);
var skipIndex = -1; // Keep track of where the utf8 sentinel was found
var i;
var charset = options.charset;
if (options.charsetSentinel) {
for (i = 0; i < parts.length; ++i) {
if (parts[i].indexOf('utf8=') === 0) {
if (parts[i] === charsetSentinel) {
charset = 'utf-8';
} else if (parts[i] === isoSentinel) {
charset = 'iso-8859-1';
}
skipIndex = i;
i = parts.length; // The eslint settings do not allow break;
}
}
}
2020-01-08 06:57:23 -05:00
for (i = 0; i < parts.length; ++i) {
if (i === skipIndex) {
continue;
}
2020-01-08 06:57:23 -05:00
var part = parts[i];
2020-01-08 06:57:23 -05:00
var bracketEqualsPos = part.indexOf(']=');
var pos = bracketEqualsPos === -1 ? part.indexOf('=') : bracketEqualsPos + 1;
2020-01-08 06:57:23 -05:00
var key, val;
if (pos === -1) {
key = options.decoder(part, defaults.decoder, charset);
val = options.strictNullHandling ? null : '';
} else {
key = options.decoder(part.slice(0, pos), defaults.decoder, charset);
val = options.decoder(part.slice(pos + 1), defaults.decoder, charset);
}
if (val && options.interpretNumericEntities && charset === 'iso-8859-1') {
val = interpretNumericEntities(val);
}
if (val && options.comma && val.indexOf(',') > -1) {
val = val.split(',');
}
if (has.call(obj, key)) {
obj[key] = utils.combine(obj[key], val);
} else {
obj[key] = val;
}
}
2020-01-08 06:57:23 -05:00
return obj;
};
2020-01-08 06:57:23 -05:00
var parseObject = function (chain, val, options) {
var leaf = val;
for (var i = chain.length - 1; i >= 0; --i) {
var obj;
var root = chain[i];
if (root === '[]' && options.parseArrays) {
obj = [].concat(leaf);
} else {
obj = options.plainObjects ? Object.create(null) : {};
var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root;
var index = parseInt(cleanRoot, 10);
if (!options.parseArrays && cleanRoot === '') {
obj = { 0: leaf };
} else if (
!isNaN(index)
&& root !== cleanRoot
&& String(index) === cleanRoot
&& index >= 0
&& (options.parseArrays && index <= options.arrayLimit)
) {
obj = [];
obj[index] = leaf;
} else {
obj[cleanRoot] = leaf;
}
}
leaf = obj;
}
2020-01-08 06:57:23 -05:00
return leaf;
};
var parseKeys = function parseQueryStringKeys(givenKey, val, options) {
if (!givenKey) {
return;
}
2020-01-08 06:57:23 -05:00
// Transform dot notation to bracket notation
var key = options.allowDots ? givenKey.replace(/\.([^.[]+)/g, '[$1]') : givenKey;
2020-01-08 06:57:23 -05:00
// The regex chunks
var brackets = /(\[[^[\]]*])/;
var child = /(\[[^[\]]*])/g;
// Get the parent
var segment = brackets.exec(key);
var parent = segment ? key.slice(0, segment.index) : key;
// Stash the parent if it exists
var keys = [];
if (parent) {
// If we aren't using plain objects, optionally prefix keys that would overwrite object prototype properties
if (!options.plainObjects && has.call(Object.prototype, parent)) {
if (!options.allowPrototypes) {
return;
}
}
2020-01-08 06:57:23 -05:00
keys.push(parent);
}
// Loop through children appending to the array until we hit depth
var i = 0;
while ((segment = child.exec(key)) !== null && i < options.depth) {
i += 1;
if (!options.plainObjects && has.call(Object.prototype, segment[1].slice(1, -1))) {
if (!options.allowPrototypes) {
return;
}
}
2020-01-08 06:57:23 -05:00
keys.push(segment[1]);
}
2020-01-08 06:57:23 -05:00
// If there's a remainder, just add whatever is left
if (segment) {
keys.push('[' + key.slice(segment.index) + ']');
}
return parseObject(keys, val, options);
};
2020-01-08 06:57:23 -05:00
var normalizeParseOptions = function normalizeParseOptions(opts) {
if (!opts) {
return defaults;
}
2020-01-08 06:57:23 -05:00
if (opts.decoder !== null && opts.decoder !== undefined && typeof opts.decoder !== 'function') {
throw new TypeError('Decoder has to be a function.');
}
if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {
2020-01-08 06:57:23 -05:00
throw new Error('The charset option must be either utf-8, iso-8859-1, or undefined');
}
2020-01-08 06:57:23 -05:00
var charset = typeof opts.charset === 'undefined' ? defaults.charset : opts.charset;
return {
allowDots: typeof opts.allowDots === 'undefined' ? defaults.allowDots : !!opts.allowDots,
2020-01-08 06:57:23 -05:00
allowPrototypes: typeof opts.allowPrototypes === 'boolean' ? opts.allowPrototypes : defaults.allowPrototypes,
arrayLimit: typeof opts.arrayLimit === 'number' ? opts.arrayLimit : defaults.arrayLimit,
charset: charset,
charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel,
2020-01-08 06:57:23 -05:00
comma: typeof opts.comma === 'boolean' ? opts.comma : defaults.comma,
decoder: typeof opts.decoder === 'function' ? opts.decoder : defaults.decoder,
delimiter: typeof opts.delimiter === 'string' || utils.isRegExp(opts.delimiter) ? opts.delimiter : defaults.delimiter,
depth: typeof opts.depth === 'number' ? opts.depth : defaults.depth,
ignoreQueryPrefix: opts.ignoreQueryPrefix === true,
interpretNumericEntities: typeof opts.interpretNumericEntities === 'boolean' ? opts.interpretNumericEntities : defaults.interpretNumericEntities,
parameterLimit: typeof opts.parameterLimit === 'number' ? opts.parameterLimit : defaults.parameterLimit,
parseArrays: opts.parseArrays !== false,
plainObjects: typeof opts.plainObjects === 'boolean' ? opts.plainObjects : defaults.plainObjects,
strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling
};
};
2020-01-08 06:57:23 -05:00
module.exports = function (str, opts) {
var options = normalizeParseOptions(opts);
2020-01-08 06:57:23 -05:00
if (str === '' || str === null || typeof str === 'undefined') {
return options.plainObjects ? Object.create(null) : {};
}
2020-01-08 06:57:23 -05:00
var tempObj = typeof str === 'string' ? parseValues(str, options) : str;
var obj = options.plainObjects ? Object.create(null) : {};
// Iterate over the keys and setup the new object
var keys = Object.keys(tempObj);
for (var i = 0; i < keys.length; ++i) {
var key = keys[i];
var newObj = parseKeys(key, tempObj[key], options);
obj = utils.merge(obj, newObj, options);
}
2020-01-08 06:57:23 -05:00
return utils.compact(obj);
};
/***/ }),
/***/ 467:
2020-01-08 06:57:23 -05:00
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
// ESM COMPAT FLAG
2020-01-08 06:57:23 -05:00
__webpack_require__.r(__webpack_exports__);
// EXPORTS
__webpack_require__.d(__webpack_exports__, "isURL", function() { return /* reexport */ isURL; });
__webpack_require__.d(__webpack_exports__, "isEmail", function() { return /* reexport */ isEmail; });
__webpack_require__.d(__webpack_exports__, "getProtocol", function() { return /* reexport */ getProtocol; });
__webpack_require__.d(__webpack_exports__, "isValidProtocol", function() { return /* reexport */ isValidProtocol; });
__webpack_require__.d(__webpack_exports__, "getAuthority", function() { return /* reexport */ getAuthority; });
__webpack_require__.d(__webpack_exports__, "isValidAuthority", function() { return /* reexport */ isValidAuthority; });
__webpack_require__.d(__webpack_exports__, "getPath", function() { return /* reexport */ getPath; });
__webpack_require__.d(__webpack_exports__, "isValidPath", function() { return /* reexport */ isValidPath; });
__webpack_require__.d(__webpack_exports__, "getQueryString", function() { return /* reexport */ getQueryString; });
__webpack_require__.d(__webpack_exports__, "isValidQueryString", function() { return /* reexport */ isValidQueryString; });
__webpack_require__.d(__webpack_exports__, "getPathAndQueryString", function() { return /* reexport */ getPathAndQueryString; });
__webpack_require__.d(__webpack_exports__, "getFragment", function() { return /* reexport */ getFragment; });
__webpack_require__.d(__webpack_exports__, "isValidFragment", function() { return /* reexport */ isValidFragment; });
__webpack_require__.d(__webpack_exports__, "addQueryArgs", function() { return /* reexport */ addQueryArgs; });
__webpack_require__.d(__webpack_exports__, "getQueryArg", function() { return /* reexport */ getQueryArg; });
__webpack_require__.d(__webpack_exports__, "hasQueryArg", function() { return /* reexport */ hasQueryArg; });
__webpack_require__.d(__webpack_exports__, "removeQueryArgs", function() { return /* reexport */ removeQueryArgs; });
__webpack_require__.d(__webpack_exports__, "prependHTTP", function() { return /* reexport */ prependHTTP; });
__webpack_require__.d(__webpack_exports__, "safeDecodeURI", function() { return /* reexport */ safeDecodeURI; });
__webpack_require__.d(__webpack_exports__, "safeDecodeURIComponent", function() { return /* reexport */ safeDecodeURIComponent; });
__webpack_require__.d(__webpack_exports__, "filterURLForDisplay", function() { return /* reexport */ filterURLForDisplay; });
__webpack_require__.d(__webpack_exports__, "cleanForSlug", function() { return /* reexport */ cleanForSlug; });
2020-01-08 06:57:23 -05:00
// CONCATENATED MODULE: ./node_modules/@wordpress/url/build-module/is-url.js
/**
* Determines whether the given string looks like a URL.
*
* @param {string} url The string to scrutinise.
*
* @example
* ```js
* const isURL = isURL( 'https://wordpress.org' ); // true
* ```
*
* @see https://url.spec.whatwg.org/
* @see https://url.spec.whatwg.org/#valid-url-string
*
2020-01-08 06:57:23 -05:00
* @return {boolean} Whether or not it looks like a URL.
*/
function isURL(url) {
// A URL can be considered value if the `URL` constructor is able to parse
// it. The constructor throws an error for an invalid URL.
try {
new URL(url);
return true;
} catch (_unused) {
return false;
}
2020-01-08 06:57:23 -05:00
}
// CONCATENATED MODULE: ./node_modules/@wordpress/url/build-module/is-email.js
var EMAIL_REGEXP = /^(mailto:)?[a-z0-9._%+-]+@[a-z0-9][a-z0-9.-]*\.[a-z]{2,63}$/i;
/**
* Determines whether the given string looks like an email.
*
* @param {string} email The string to scrutinise.
*
* @example
* ```js
* const isEmail = isEmail( 'hello@wordpress.org' ); // true
* ```
*
* @return {boolean} Whether or not it looks like an email.
*/
function isEmail(email) {
return EMAIL_REGEXP.test(email);
}
// CONCATENATED MODULE: ./node_modules/@wordpress/url/build-module/get-protocol.js
/**
* Returns the protocol part of the URL.
*
* @param {string} url The full URL.
*
* @example
* ```js
* const protocol1 = getProtocol( 'tel:012345678' ); // 'tel:'
* const protocol2 = getProtocol( 'https://wordpress.org' ); // 'https:'
* ```
*
* @return {string|void} The protocol part of the URL.
*/
function getProtocol(url) {
var matches = /^([^\s:]+:)/.exec(url);
if (matches) {
return matches[1];
}
}
// CONCATENATED MODULE: ./node_modules/@wordpress/url/build-module/is-valid-protocol.js
/**
* Tests if a url protocol is valid.
*
* @param {string} protocol The url protocol.
*
* @example
* ```js
* const isValid = isValidProtocol( 'https:' ); // true
* const isNotValid = isValidProtocol( 'https :' ); // false
* ```
*
* @return {boolean} True if the argument is a valid protocol (e.g. http:, tel:).
*/
function isValidProtocol(protocol) {
if (!protocol) {
return false;
}
return /^[a-z\-.\+]+[0-9]*:$/i.test(protocol);
}
// CONCATENATED MODULE: ./node_modules/@wordpress/url/build-module/get-authority.js
/**
* Returns the authority part of the URL.
*
* @param {string} url The full URL.
*
* @example
* ```js
* const authority1 = getAuthority( 'https://wordpress.org/help/' ); // 'wordpress.org'
* const authority2 = getAuthority( 'https://localhost:8080/test/' ); // 'localhost:8080'
* ```
*
* @return {string|void} The authority part of the URL.
*/
function getAuthority(url) {
var matches = /^[^\/\s:]+:(?:\/\/)?\/?([^\/\s#?]+)[\/#?]{0,1}\S*$/.exec(url);
if (matches) {
return matches[1];
}
}
// CONCATENATED MODULE: ./node_modules/@wordpress/url/build-module/is-valid-authority.js
/**
* Checks for invalid characters within the provided authority.
*
* @param {string} authority A string containing the URL authority.
*
* @example
* ```js
* const isValid = isValidAuthority( 'wordpress.org' ); // true
* const isNotValid = isValidAuthority( 'wordpress#org' ); // false
* ```
*
* @return {boolean} True if the argument contains a valid authority.
*/
function isValidAuthority(authority) {
if (!authority) {
return false;
}
return /^[^\s#?]+$/.test(authority);
}
// CONCATENATED MODULE: ./node_modules/@wordpress/url/build-module/get-path.js
/**
* Returns the path part of the URL.
*
* @param {string} url The full URL.
*
* @example
* ```js
* const path1 = getPath( 'http://localhost:8080/this/is/a/test?query=true' ); // 'this/is/a/test'
* const path2 = getPath( 'https://wordpress.org/help/faq/' ); // 'help/faq'
* ```
*
* @return {string|void} The path part of the URL.
*/
function getPath(url) {
var matches = /^[^\/\s:]+:(?:\/\/)?[^\/\s#?]+[\/]([^\s#?]+)[#?]{0,1}\S*$/.exec(url);
if (matches) {
return matches[1];
}
}
// CONCATENATED MODULE: ./node_modules/@wordpress/url/build-module/is-valid-path.js
/**
* Checks for invalid characters within the provided path.
*
* @param {string} path The URL path.
*
* @example
* ```js
* const isValid = isValidPath( 'test/path/' ); // true
* const isNotValid = isValidPath( '/invalid?test/path/' ); // false
* ```
*
* @return {boolean} True if the argument contains a valid path
*/
function isValidPath(path) {
if (!path) {
return false;
}
return /^[^\s#?]+$/.test(path);
}
// CONCATENATED MODULE: ./node_modules/@wordpress/url/build-module/get-query-string.js
/**
* Returns the query string part of the URL.
*
* @param {string} url The full URL.
*
* @example
* ```js
* const queryString = getQueryString( 'http://localhost:8080/this/is/a/test?query=true#fragment' ); // 'query=true'
2020-01-08 06:57:23 -05:00
* ```
*
* @return {string|void} The query string part of the URL.
*/
function getQueryString(url) {
var query;
2020-01-08 06:57:23 -05:00
try {
query = new URL(url).search.substring(1);
} catch (error) {}
if (query) {
return query;
2020-01-08 06:57:23 -05:00
}
}
2020-01-08 06:57:23 -05:00
// CONCATENATED MODULE: ./node_modules/@wordpress/url/build-module/is-valid-query-string.js
/**
* Checks for invalid characters within the provided query string.
*
* @param {string} queryString The query string.
*
* @example
* ```js
* const isValid = isValidQueryString( 'query=true&another=false' ); // true
* const isNotValid = isValidQueryString( 'query=true?another=false' ); // false
* ```
*
* @return {boolean} True if the argument contains a valid query string.
*/
function isValidQueryString(queryString) {
if (!queryString) {
return false;
}
2020-01-08 06:57:23 -05:00
return /^[^\s#?\/]+$/.test(queryString);
}
// CONCATENATED MODULE: ./node_modules/@wordpress/url/build-module/get-path-and-query-string.js
/**
* Internal dependencies
*/
/**
* Returns the path part and query string part of the URL.
*
* @param {string} url The full URL.
*
* @example
* ```js
* const pathAndQueryString1 = getPathAndQueryString( 'http://localhost:8080/this/is/a/test?query=true' ); // '/this/is/a/test?query=true'
* const pathAndQueryString2 = getPathAndQueryString( 'https://wordpress.org/help/faq/' ); // '/help/faq'
* ```
*
* @return {string} The path part and query string part of the URL.
*/
function getPathAndQueryString(url) {
var path = getPath(url);
var queryString = getQueryString(url);
var value = '/';
if (path) value += path;
if (queryString) value += "?".concat(queryString);
return value;
}
2020-01-08 06:57:23 -05:00
// CONCATENATED MODULE: ./node_modules/@wordpress/url/build-module/get-fragment.js
/**
* Returns the fragment part of the URL.
*
* @param {string} url The full URL
*
* @example
* ```js
* const fragment1 = getFragment( 'http://localhost:8080/this/is/a/test?query=true#fragment' ); // '#fragment'
* const fragment2 = getFragment( 'https://wordpress.org#another-fragment?query=true' ); // '#another-fragment'
* ```
*
* @return {string|void} The fragment part of the URL.
*/
function getFragment(url) {
var matches = /^\S+?(#[^\s\?]*)/.exec(url);
2020-01-08 06:57:23 -05:00
if (matches) {
return matches[1];
}
}
2020-01-08 06:57:23 -05:00
// CONCATENATED MODULE: ./node_modules/@wordpress/url/build-module/is-valid-fragment.js
/**
* Checks for invalid characters within the provided fragment.
*
* @param {string} fragment The url fragment.
*
* @example
* ```js
* const isValid = isValidFragment( '#valid-fragment' ); // true
* const isNotValid = isValidFragment( '#invalid-#fragment' ); // false
* ```
*
* @return {boolean} True if the argument contains a valid fragment.
*/
function isValidFragment(fragment) {
if (!fragment) {
return false;
}
2020-01-08 06:57:23 -05:00
return /^#[^\s#?\/]*$/.test(fragment);
}
2020-01-08 06:57:23 -05:00
// EXTERNAL MODULE: ./node_modules/qs/lib/index.js
var lib = __webpack_require__(118);
2020-01-08 06:57:23 -05:00
// CONCATENATED MODULE: ./node_modules/@wordpress/url/build-module/add-query-args.js
/**
* External dependencies
*/
2020-01-08 06:57:23 -05:00
/**
* Appends arguments as querystring to the provided URL. If the URL already
* includes query arguments, the arguments are merged with (and take precedent
* over) the existing set.
*
* @param {string} [url=''] URL to which arguments should be appended. If omitted,
* only the resulting querystring is returned.
* @param {Object} [args] Query arguments to apply to URL.
2020-01-08 06:57:23 -05:00
*
* @example
* ```js
* const newURL = addQueryArgs( 'https://google.com', { q: 'test' } ); // https://google.com/?q=test
* ```
*
* @return {string} URL with arguments applied.
*/
2020-01-08 06:57:23 -05:00
function addQueryArgs() {
var url = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
var args = arguments.length > 1 ? arguments[1] : undefined;
2020-01-08 06:57:23 -05:00
// If no arguments are to be appended, return original URL.
if (!args || !Object.keys(args).length) {
return url;
}
2020-01-08 06:57:23 -05:00
var baseUrl = url; // Determine whether URL already had query arguments.
2020-01-08 06:57:23 -05:00
var queryStringIndex = url.indexOf('?');
2020-01-08 06:57:23 -05:00
if (queryStringIndex !== -1) {
// Merge into existing query arguments.
args = Object.assign(Object(lib["parse"])(url.substr(queryStringIndex + 1)), args); // Change working base URL to omit previous query arguments.
2020-01-08 06:57:23 -05:00
baseUrl = baseUrl.substr(0, queryStringIndex);
}
2020-01-08 06:57:23 -05:00
return baseUrl + '?' + Object(lib["stringify"])(args);
}
2020-01-08 06:57:23 -05:00
// CONCATENATED MODULE: ./node_modules/@wordpress/url/build-module/get-query-arg.js
/**
* External dependencies
*/
/* eslint-disable jsdoc/valid-types */
2020-01-08 06:57:23 -05:00
/**
* @typedef {{[key: string]: QueryArgParsed}} QueryArgObject
*/
/* eslint-enable */
2020-01-08 06:57:23 -05:00
/**
* @typedef {string|string[]|QueryArgObject} QueryArgParsed
*/
2020-01-08 06:57:23 -05:00
/**
* Returns a single query argument of the url
*
* @param {string} url URL.
* @param {string} arg Query arg name.
*
* @example
* ```js
* const foo = getQueryArg( 'https://wordpress.org?foo=bar&bar=baz', 'foo' ); // bar
* ```
*
* @return {QueryArgParsed|undefined} Query arg value.
*/
2020-01-08 06:57:23 -05:00
function getQueryArg(url, arg) {
var queryStringIndex = url.indexOf('?');
var query = queryStringIndex !== -1 ? Object(lib["parse"])(url.substr(queryStringIndex + 1)) : {};
return query[arg];
}
2020-01-08 06:57:23 -05:00
// CONCATENATED MODULE: ./node_modules/@wordpress/url/build-module/has-query-arg.js
/**
* Internal dependencies
*/
2020-01-08 06:57:23 -05:00
/**
* Determines whether the URL contains a given query arg.
*
* @param {string} url URL.
* @param {string} arg Query arg name.
*
* @example
* ```js
* const hasBar = hasQueryArg( 'https://wordpress.org?foo=bar&bar=baz', 'bar' ); // true
* ```
*
* @return {boolean} Whether or not the URL contains the query arg.
*/
2020-01-08 06:57:23 -05:00
function hasQueryArg(url, arg) {
return getQueryArg(url, arg) !== undefined;
}
2020-01-08 06:57:23 -05:00
// CONCATENATED MODULE: ./node_modules/@wordpress/url/build-module/remove-query-args.js
/**
* External dependencies
*/
2020-01-08 06:57:23 -05:00
/**
* Removes arguments from the query string of the url
*
* @param {string} url URL.
* @param {...string} args Query Args.
*
* @example
* ```js
* const newUrl = removeQueryArgs( 'https://wordpress.org?foo=bar&bar=baz&baz=foobar', 'foo', 'bar' ); // https://wordpress.org?baz=foobar
* ```
*
* @return {string} Updated URL.
*/
2020-01-08 06:57:23 -05:00
function removeQueryArgs(url) {
var queryStringIndex = url.indexOf('?');
var query = queryStringIndex !== -1 ? Object(lib["parse"])(url.substr(queryStringIndex + 1)) : {};
var baseUrl = queryStringIndex !== -1 ? url.substr(0, queryStringIndex) : url;
2020-01-08 06:57:23 -05:00
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
args[_key - 1] = arguments[_key];
}
2020-01-08 06:57:23 -05:00
args.forEach(function (arg) {
return delete query[arg];
});
return baseUrl + '?' + Object(lib["stringify"])(query);
}
2020-01-08 06:57:23 -05:00
// CONCATENATED MODULE: ./node_modules/@wordpress/url/build-module/prepend-http.js
/**
* Internal dependencies
*/
2020-01-08 06:57:23 -05:00
var USABLE_HREF_REGEXP = /^(?:[a-z]+:|#|\?|\.|\/)/i;
/**
* Prepends "http://" to a url, if it looks like something that is meant to be a TLD.
*
* @param {string} url The URL to test.
*
* @example
* ```js
* const actualURL = prependHTTP( 'wordpress.org' ); // http://wordpress.org
* ```
*
* @return {string} The updated URL.
*/
2020-01-08 06:57:23 -05:00
function prependHTTP(url) {
if (!url) {
return url;
}
2020-01-08 06:57:23 -05:00
url = url.trim();
2020-01-08 06:57:23 -05:00
if (!USABLE_HREF_REGEXP.test(url) && !isEmail(url)) {
return 'http://' + url;
}
2020-01-08 06:57:23 -05:00
return url;
}
2020-01-08 06:57:23 -05:00
// CONCATENATED MODULE: ./node_modules/@wordpress/url/build-module/safe-decode-uri.js
/**
* Safely decodes a URI with `decodeURI`. Returns the URI unmodified if
* `decodeURI` throws an error.
*
* @param {string} uri URI to decode.
*
* @example
* ```js
* const badUri = safeDecodeURI( '%z' ); // does not throw an Error, simply returns '%z'
* ```
*
* @return {string} Decoded URI if possible.
*/
function safeDecodeURI(uri) {
try {
return decodeURI(uri);
} catch (uriError) {
return uri;
}
}
2020-01-08 06:57:23 -05:00
// CONCATENATED MODULE: ./node_modules/@wordpress/url/build-module/safe-decode-uri-component.js
/**
* Safely decodes a URI component with `decodeURIComponent`. Returns the URI component unmodified if
* `decodeURIComponent` throws an error.
*
* @param {string} uriComponent URI component to decode.
*
* @return {string} Decoded URI component if possible.
*/
function safeDecodeURIComponent(uriComponent) {
try {
return decodeURIComponent(uriComponent);
} catch (uriComponentError) {
return uriComponent;
}
}
2020-01-08 06:57:23 -05:00
// CONCATENATED MODULE: ./node_modules/@wordpress/url/build-module/filter-url-for-display.js
/**
* Returns a URL for display.
*
* @param {string} url Original URL.
*
* @example
* ```js
* const displayUrl = filterURLForDisplay( 'https://www.wordpress.org/gutenberg/' ); // wordpress.org/gutenberg
* ```
*
* @return {string} Displayed URL.
*/
function filterURLForDisplay(url) {
// Remove protocol and www prefixes.
var filteredURL = url.replace(/^(?:https?:)\/\/(?:www\.)?/, ''); // Ends with / and only has that single slash, strip it.
2020-01-08 06:57:23 -05:00
if (filteredURL.match(/^[^\/]+\/$/)) {
return filteredURL.replace('/', '');
}
return filteredURL;
}
Block Editor: Update WordPress Packages. The following package versions were changed: @wordpress/a11y: 2.6.0 -> 2.7.0 @wordpress/annotations: 1.10.0 -> 1.11.0 @wordpress/api-fetch: 3.9.0 -> 3.10.0 @wordpress/autop: 2.5.1 -> 2.6.0 @wordpress/blob: 2.6.0 -> 2.7.0 @wordpress/block-directory: 1.3.0 -> 1.4.0 @wordpress/block-editor: 3.5.0 -> 3.6.0 @wordpress/block-library: 2.12.0 -> 2.13.0 @wordpress/block-serialization-default-parser: 3.4.1 -> 3.5.0 @wordpress/blocks: 6.10.0 -> 6.11.0 @wordpress/components: 9.0.0 -> 9.1.0 @wordpress/compose: 3.10.0 -> 3.11.0 @wordpress/core-data: 2.10.0 -> 2.11.0 @wordpress/custom-templated-path-webpack-plugin: 1.5.0 -> 1.6.0 @wordpress/data: 4.12.0 -> 4.13.0 @wordpress/data-controls: 1.6.0 -> 1.7.0 @wordpress/date: 3.7.0 -> 3.8.0 @wordpress/dependency-extraction-webpack-plugin: 2.1.0 -> 2.2.0 @wordpress/deprecated: 2.6.1 -> 2.7.0 @wordpress/dom: 2.7.0 -> 2.8.0 @wordpress/dom-ready: 2.6.0 -> 2.7.0 @wordpress/e2e-test-utils: 4.1.0 -> 4.2.0 @wordpress/edit-post: 3.11.0 -> 3.12.0 @wordpress/editor: 9.10.0 -> 9.11.0 @wordpress/element: 2.10.0 -> 2.11.0 @wordpress/escape-html: 1.6.0 -> 1.7.0 @wordpress/format-library: 1.12.0 -> 1.13.0 @wordpress/hooks: 2.6.0 -> 2.7.0 @wordpress/html-entities: 2.5.0 -> 2.6.0 @wordpress/i18n: 3.8.0 -> 3.9.0 @wordpress/is-shallow-equal: 1.7.0 -> 1.8.0 @wordpress/keyboard-shortcuts: 0.2.0 -> 1.0.0 @wordpress/keycodes: 2.8.0 -> 2.9.0 @wordpress/library-export-default-webpack-plugin: 1.5.0 -> 1.6.0 @wordpress/list-reusable-blocks: 1.11.0 -> 1.12.0 @wordpress/media-utils: 1.5.0 -> 1.6.0 @wordpress/notices: 1.11.0 -> 1.12.0 @wordpress/nux: 3.10.0 -> 3.11.0 @wordpress/plugins: 2.10.0 -> 2.11.0 @wordpress/priority-queue: 1.4.0 -> 1.5.0 @wordpress/redux-routine: 3.6.2 -> 3.7.0 @wordpress/rich-text: 3.10.0 -> 3.11.0 @wordpress/scripts: 6.2.0 -> 7.0.0 @wordpress/server-side-render: 1.6.0 -> 1.7.0 @wordpress/shortcode: 2.5.0 -> 2.6.0 @wordpress/token-list: 1.8.0 -> 1.9.0 @wordpress/url: 2.9.0 -> 2.10.0 @wordpress/viewport: 2.11.0 -> 2.12.0 @wordpress/wordcount: 2.6.2 -> 2.7.0 Added these new packages: @wordpress/warning @wordpress/primitives @wordpress/icons Re-added keyboard-shortcuts to script loader removed by mistake on revision 47198. Props gziolo, itsjonq, youknowriad, mcsf, andraganescu. Fixes #49358. Built from https://develop.svn.wordpress.org/trunk@47199 git-svn-id: http://core.svn.wordpress.org/trunk@46999 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-02-06 16:03:31 -05:00
// EXTERNAL MODULE: external {"this":"lodash"}
var external_this_lodash_ = __webpack_require__(2);
// CONCATENATED MODULE: ./node_modules/@wordpress/url/build-module/clean-for-slug.js
/**
* External dependencies
*/
/**
* Performs some basic cleanup of a string for use as a post slug.
*
* This replicates some of what `sanitize_title()` does in WordPress core, but
* is only designed to approximate what the slug will be.
*
* Converts Latin-1 Supplement and Latin Extended-A letters to basic Latin
* letters. Removes combining diacritical marks. Converts whitespace, periods,
* and forward slashes to hyphens. Removes any remaining non-word characters
* except hyphens. Converts remaining string to lowercase. It does not account
* for octets, HTML entities, or other encoded characters.
Block Editor: Update WordPress Packages. The following package versions were changed: @wordpress/a11y: 2.6.0 -> 2.7.0 @wordpress/annotations: 1.10.0 -> 1.11.0 @wordpress/api-fetch: 3.9.0 -> 3.10.0 @wordpress/autop: 2.5.1 -> 2.6.0 @wordpress/blob: 2.6.0 -> 2.7.0 @wordpress/block-directory: 1.3.0 -> 1.4.0 @wordpress/block-editor: 3.5.0 -> 3.6.0 @wordpress/block-library: 2.12.0 -> 2.13.0 @wordpress/block-serialization-default-parser: 3.4.1 -> 3.5.0 @wordpress/blocks: 6.10.0 -> 6.11.0 @wordpress/components: 9.0.0 -> 9.1.0 @wordpress/compose: 3.10.0 -> 3.11.0 @wordpress/core-data: 2.10.0 -> 2.11.0 @wordpress/custom-templated-path-webpack-plugin: 1.5.0 -> 1.6.0 @wordpress/data: 4.12.0 -> 4.13.0 @wordpress/data-controls: 1.6.0 -> 1.7.0 @wordpress/date: 3.7.0 -> 3.8.0 @wordpress/dependency-extraction-webpack-plugin: 2.1.0 -> 2.2.0 @wordpress/deprecated: 2.6.1 -> 2.7.0 @wordpress/dom: 2.7.0 -> 2.8.0 @wordpress/dom-ready: 2.6.0 -> 2.7.0 @wordpress/e2e-test-utils: 4.1.0 -> 4.2.0 @wordpress/edit-post: 3.11.0 -> 3.12.0 @wordpress/editor: 9.10.0 -> 9.11.0 @wordpress/element: 2.10.0 -> 2.11.0 @wordpress/escape-html: 1.6.0 -> 1.7.0 @wordpress/format-library: 1.12.0 -> 1.13.0 @wordpress/hooks: 2.6.0 -> 2.7.0 @wordpress/html-entities: 2.5.0 -> 2.6.0 @wordpress/i18n: 3.8.0 -> 3.9.0 @wordpress/is-shallow-equal: 1.7.0 -> 1.8.0 @wordpress/keyboard-shortcuts: 0.2.0 -> 1.0.0 @wordpress/keycodes: 2.8.0 -> 2.9.0 @wordpress/library-export-default-webpack-plugin: 1.5.0 -> 1.6.0 @wordpress/list-reusable-blocks: 1.11.0 -> 1.12.0 @wordpress/media-utils: 1.5.0 -> 1.6.0 @wordpress/notices: 1.11.0 -> 1.12.0 @wordpress/nux: 3.10.0 -> 3.11.0 @wordpress/plugins: 2.10.0 -> 2.11.0 @wordpress/priority-queue: 1.4.0 -> 1.5.0 @wordpress/redux-routine: 3.6.2 -> 3.7.0 @wordpress/rich-text: 3.10.0 -> 3.11.0 @wordpress/scripts: 6.2.0 -> 7.0.0 @wordpress/server-side-render: 1.6.0 -> 1.7.0 @wordpress/shortcode: 2.5.0 -> 2.6.0 @wordpress/token-list: 1.8.0 -> 1.9.0 @wordpress/url: 2.9.0 -> 2.10.0 @wordpress/viewport: 2.11.0 -> 2.12.0 @wordpress/wordcount: 2.6.2 -> 2.7.0 Added these new packages: @wordpress/warning @wordpress/primitives @wordpress/icons Re-added keyboard-shortcuts to script loader removed by mistake on revision 47198. Props gziolo, itsjonq, youknowriad, mcsf, andraganescu. Fixes #49358. Built from https://develop.svn.wordpress.org/trunk@47199 git-svn-id: http://core.svn.wordpress.org/trunk@46999 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-02-06 16:03:31 -05:00
*
* @param {string} string Title or slug to be processed.
*
* @return {string} Processed string.
*/
function cleanForSlug(string) {
if (!string) {
return '';
}
return Object(external_this_lodash_["trim"])(Object(external_this_lodash_["deburr"])(string).replace(/[\s\./]+/g, '-').replace(/[^\w-]+/g, '').toLowerCase(), '-');
Block Editor: Update WordPress Packages. The following package versions were changed: @wordpress/a11y: 2.6.0 -> 2.7.0 @wordpress/annotations: 1.10.0 -> 1.11.0 @wordpress/api-fetch: 3.9.0 -> 3.10.0 @wordpress/autop: 2.5.1 -> 2.6.0 @wordpress/blob: 2.6.0 -> 2.7.0 @wordpress/block-directory: 1.3.0 -> 1.4.0 @wordpress/block-editor: 3.5.0 -> 3.6.0 @wordpress/block-library: 2.12.0 -> 2.13.0 @wordpress/block-serialization-default-parser: 3.4.1 -> 3.5.0 @wordpress/blocks: 6.10.0 -> 6.11.0 @wordpress/components: 9.0.0 -> 9.1.0 @wordpress/compose: 3.10.0 -> 3.11.0 @wordpress/core-data: 2.10.0 -> 2.11.0 @wordpress/custom-templated-path-webpack-plugin: 1.5.0 -> 1.6.0 @wordpress/data: 4.12.0 -> 4.13.0 @wordpress/data-controls: 1.6.0 -> 1.7.0 @wordpress/date: 3.7.0 -> 3.8.0 @wordpress/dependency-extraction-webpack-plugin: 2.1.0 -> 2.2.0 @wordpress/deprecated: 2.6.1 -> 2.7.0 @wordpress/dom: 2.7.0 -> 2.8.0 @wordpress/dom-ready: 2.6.0 -> 2.7.0 @wordpress/e2e-test-utils: 4.1.0 -> 4.2.0 @wordpress/edit-post: 3.11.0 -> 3.12.0 @wordpress/editor: 9.10.0 -> 9.11.0 @wordpress/element: 2.10.0 -> 2.11.0 @wordpress/escape-html: 1.6.0 -> 1.7.0 @wordpress/format-library: 1.12.0 -> 1.13.0 @wordpress/hooks: 2.6.0 -> 2.7.0 @wordpress/html-entities: 2.5.0 -> 2.6.0 @wordpress/i18n: 3.8.0 -> 3.9.0 @wordpress/is-shallow-equal: 1.7.0 -> 1.8.0 @wordpress/keyboard-shortcuts: 0.2.0 -> 1.0.0 @wordpress/keycodes: 2.8.0 -> 2.9.0 @wordpress/library-export-default-webpack-plugin: 1.5.0 -> 1.6.0 @wordpress/list-reusable-blocks: 1.11.0 -> 1.12.0 @wordpress/media-utils: 1.5.0 -> 1.6.0 @wordpress/notices: 1.11.0 -> 1.12.0 @wordpress/nux: 3.10.0 -> 3.11.0 @wordpress/plugins: 2.10.0 -> 2.11.0 @wordpress/priority-queue: 1.4.0 -> 1.5.0 @wordpress/redux-routine: 3.6.2 -> 3.7.0 @wordpress/rich-text: 3.10.0 -> 3.11.0 @wordpress/scripts: 6.2.0 -> 7.0.0 @wordpress/server-side-render: 1.6.0 -> 1.7.0 @wordpress/shortcode: 2.5.0 -> 2.6.0 @wordpress/token-list: 1.8.0 -> 1.9.0 @wordpress/url: 2.9.0 -> 2.10.0 @wordpress/viewport: 2.11.0 -> 2.12.0 @wordpress/wordcount: 2.6.2 -> 2.7.0 Added these new packages: @wordpress/warning @wordpress/primitives @wordpress/icons Re-added keyboard-shortcuts to script loader removed by mistake on revision 47198. Props gziolo, itsjonq, youknowriad, mcsf, andraganescu. Fixes #49358. Built from https://develop.svn.wordpress.org/trunk@47199 git-svn-id: http://core.svn.wordpress.org/trunk@46999 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-02-06 16:03:31 -05:00
}
2020-01-08 06:57:23 -05:00
// CONCATENATED MODULE: ./node_modules/@wordpress/url/build-module/index.js
Block Editor: Update WordPress Packages. The following package versions were changed: @wordpress/a11y: 2.6.0 -> 2.7.0 @wordpress/annotations: 1.10.0 -> 1.11.0 @wordpress/api-fetch: 3.9.0 -> 3.10.0 @wordpress/autop: 2.5.1 -> 2.6.0 @wordpress/blob: 2.6.0 -> 2.7.0 @wordpress/block-directory: 1.3.0 -> 1.4.0 @wordpress/block-editor: 3.5.0 -> 3.6.0 @wordpress/block-library: 2.12.0 -> 2.13.0 @wordpress/block-serialization-default-parser: 3.4.1 -> 3.5.0 @wordpress/blocks: 6.10.0 -> 6.11.0 @wordpress/components: 9.0.0 -> 9.1.0 @wordpress/compose: 3.10.0 -> 3.11.0 @wordpress/core-data: 2.10.0 -> 2.11.0 @wordpress/custom-templated-path-webpack-plugin: 1.5.0 -> 1.6.0 @wordpress/data: 4.12.0 -> 4.13.0 @wordpress/data-controls: 1.6.0 -> 1.7.0 @wordpress/date: 3.7.0 -> 3.8.0 @wordpress/dependency-extraction-webpack-plugin: 2.1.0 -> 2.2.0 @wordpress/deprecated: 2.6.1 -> 2.7.0 @wordpress/dom: 2.7.0 -> 2.8.0 @wordpress/dom-ready: 2.6.0 -> 2.7.0 @wordpress/e2e-test-utils: 4.1.0 -> 4.2.0 @wordpress/edit-post: 3.11.0 -> 3.12.0 @wordpress/editor: 9.10.0 -> 9.11.0 @wordpress/element: 2.10.0 -> 2.11.0 @wordpress/escape-html: 1.6.0 -> 1.7.0 @wordpress/format-library: 1.12.0 -> 1.13.0 @wordpress/hooks: 2.6.0 -> 2.7.0 @wordpress/html-entities: 2.5.0 -> 2.6.0 @wordpress/i18n: 3.8.0 -> 3.9.0 @wordpress/is-shallow-equal: 1.7.0 -> 1.8.0 @wordpress/keyboard-shortcuts: 0.2.0 -> 1.0.0 @wordpress/keycodes: 2.8.0 -> 2.9.0 @wordpress/library-export-default-webpack-plugin: 1.5.0 -> 1.6.0 @wordpress/list-reusable-blocks: 1.11.0 -> 1.12.0 @wordpress/media-utils: 1.5.0 -> 1.6.0 @wordpress/notices: 1.11.0 -> 1.12.0 @wordpress/nux: 3.10.0 -> 3.11.0 @wordpress/plugins: 2.10.0 -> 2.11.0 @wordpress/priority-queue: 1.4.0 -> 1.5.0 @wordpress/redux-routine: 3.6.2 -> 3.7.0 @wordpress/rich-text: 3.10.0 -> 3.11.0 @wordpress/scripts: 6.2.0 -> 7.0.0 @wordpress/server-side-render: 1.6.0 -> 1.7.0 @wordpress/shortcode: 2.5.0 -> 2.6.0 @wordpress/token-list: 1.8.0 -> 1.9.0 @wordpress/url: 2.9.0 -> 2.10.0 @wordpress/viewport: 2.11.0 -> 2.12.0 @wordpress/wordcount: 2.6.2 -> 2.7.0 Added these new packages: @wordpress/warning @wordpress/primitives @wordpress/icons Re-added keyboard-shortcuts to script loader removed by mistake on revision 47198. Props gziolo, itsjonq, youknowriad, mcsf, andraganescu. Fixes #49358. Built from https://develop.svn.wordpress.org/trunk@47199 git-svn-id: http://core.svn.wordpress.org/trunk@46999 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-02-06 16:03:31 -05:00
/***/ })
/******/ });