From b93a84709dd6ba69a3474c75a4b2d8f85430f235 Mon Sep 17 00:00:00 2001 From: Gary Pendergast Date: Thu, 22 Nov 2018 02:05:47 +0000 Subject: [PATCH] Build Tools: Don't include `.map` files in the build. These files are fairly large, and while they're useful in development, they're not needed in the final build. Props pento, mcsf. See #45201. Built from https://develop.svn.wordpress.org/branches/5.0@43931 git-svn-id: http://core.svn.wordpress.org/branches/5.0@43763 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- .../themes/twentynineteen/style.css.map | 1 - wp-includes/js/dist/a11y.js | 131 +- wp-includes/js/dist/a11y.js.map | 1 - wp-includes/js/dist/annotations.js | 1226 +- wp-includes/js/dist/annotations.js.map | 1 - wp-includes/js/dist/api-fetch.js | 703 +- wp-includes/js/dist/api-fetch.js.map | 1 - wp-includes/js/dist/autop.js | 439 +- wp-includes/js/dist/autop.js.map | 1 - wp-includes/js/dist/blob.js | 71 +- wp-includes/js/dist/blob.js.map | 1 - wp-includes/js/dist/block-library.js | 15573 +----- wp-includes/js/dist/block-library.js.map | 1 - .../block-serialization-default-parser.js | 317 +- .../block-serialization-default-parser.js.map | 1 - wp-includes/js/dist/blocks.js | 12733 +---- wp-includes/js/dist/blocks.js.map | 1 - wp-includes/js/dist/components.js | 39556 +--------------- wp-includes/js/dist/components.js.map | 1 - wp-includes/js/dist/compose.js | 803 +- wp-includes/js/dist/compose.js.map | 1 - wp-includes/js/dist/core-data.js | 3333 +- wp-includes/js/dist/core-data.js.map | 1 - wp-includes/js/dist/data.js | 3020 +- wp-includes/js/dist/data.js.map | 1 - wp-includes/js/dist/date.js | 1372 +- wp-includes/js/dist/date.js.map | 1 - wp-includes/js/dist/deprecated.js | 72 +- wp-includes/js/dist/deprecated.js.map | 1 - wp-includes/js/dist/dom-ready.js | 25 +- wp-includes/js/dist/dom-ready.js.map | 1 - wp-includes/js/dist/dom.js | 935 +- wp-includes/js/dist/dom.js.map | 1 - wp-includes/js/dist/edit-post.js | 6857 +-- wp-includes/js/dist/edit-post.js.map | 1 - wp-includes/js/dist/editor.js | 36526 +------------- wp-includes/js/dist/editor.js.map | 1 - wp-includes/js/dist/element.js | 942 +- wp-includes/js/dist/element.js.map | 1 - wp-includes/js/dist/escape-html.js | 107 +- wp-includes/js/dist/escape-html.js.map | 1 - wp-includes/js/dist/format-library.js | 1311 +- wp-includes/js/dist/format-library.js.map | 1 - wp-includes/js/dist/hooks.js | 535 +- wp-includes/js/dist/hooks.js.map | 1 - wp-includes/js/dist/html-entities.js | 29 +- wp-includes/js/dist/html-entities.js.map | 1 - wp-includes/js/dist/i18n.js | 1007 +- wp-includes/js/dist/i18n.js.map | 1 - wp-includes/js/dist/is-shallow-equal.js | 113 +- wp-includes/js/dist/is-shallow-equal.js.map | 1 - wp-includes/js/dist/keycodes.js | 296 +- wp-includes/js/dist/keycodes.js.map | 1 - wp-includes/js/dist/list-reusable-blocks.js | 662 +- .../js/dist/list-reusable-blocks.js.map | 1 - wp-includes/js/dist/notices.js | 578 +- wp-includes/js/dist/notices.js.map | 1 - wp-includes/js/dist/nux.js | 826 +- wp-includes/js/dist/nux.js.map | 1 - wp-includes/js/dist/plugins.js | 494 +- wp-includes/js/dist/plugins.js.map | 1 - wp-includes/js/dist/redux-routine.js | 826 +- wp-includes/js/dist/redux-routine.js.map | 1 - wp-includes/js/dist/rich-text.js | 3255 +- wp-includes/js/dist/rich-text.js.map | 1 - wp-includes/js/dist/shortcode.js | 482 +- wp-includes/js/dist/shortcode.js.map | 1 - wp-includes/js/dist/token-list.js | 297 +- wp-includes/js/dist/token-list.js.map | 1 - wp-includes/js/dist/url.js | 986 +- wp-includes/js/dist/url.js.map | 1 - .../js/dist/vendor/wp-polyfill-ecmascript.js | 6568 --- wp-includes/js/dist/viewport.js | 315 +- wp-includes/js/dist/viewport.js.map | 1 - wp-includes/js/dist/wordcount.js | 335 +- wp-includes/js/dist/wordcount.js.map | 1 - wp-includes/version.php | 2 +- 77 files changed, 1473 insertions(+), 142223 deletions(-) delete mode 100644 wp-content/themes/twentynineteen/style.css.map delete mode 100644 wp-includes/js/dist/a11y.js.map delete mode 100644 wp-includes/js/dist/annotations.js.map delete mode 100644 wp-includes/js/dist/api-fetch.js.map delete mode 100644 wp-includes/js/dist/autop.js.map delete mode 100644 wp-includes/js/dist/blob.js.map delete mode 100644 wp-includes/js/dist/block-library.js.map delete mode 100644 wp-includes/js/dist/block-serialization-default-parser.js.map delete mode 100644 wp-includes/js/dist/blocks.js.map delete mode 100644 wp-includes/js/dist/components.js.map delete mode 100644 wp-includes/js/dist/compose.js.map delete mode 100644 wp-includes/js/dist/core-data.js.map delete mode 100644 wp-includes/js/dist/data.js.map delete mode 100644 wp-includes/js/dist/date.js.map delete mode 100644 wp-includes/js/dist/deprecated.js.map delete mode 100644 wp-includes/js/dist/dom-ready.js.map delete mode 100644 wp-includes/js/dist/dom.js.map delete mode 100644 wp-includes/js/dist/edit-post.js.map delete mode 100644 wp-includes/js/dist/editor.js.map delete mode 100644 wp-includes/js/dist/element.js.map delete mode 100644 wp-includes/js/dist/escape-html.js.map delete mode 100644 wp-includes/js/dist/format-library.js.map delete mode 100644 wp-includes/js/dist/hooks.js.map delete mode 100644 wp-includes/js/dist/html-entities.js.map delete mode 100644 wp-includes/js/dist/i18n.js.map delete mode 100644 wp-includes/js/dist/is-shallow-equal.js.map delete mode 100644 wp-includes/js/dist/keycodes.js.map delete mode 100644 wp-includes/js/dist/list-reusable-blocks.js.map delete mode 100644 wp-includes/js/dist/notices.js.map delete mode 100644 wp-includes/js/dist/nux.js.map delete mode 100644 wp-includes/js/dist/plugins.js.map delete mode 100644 wp-includes/js/dist/redux-routine.js.map delete mode 100644 wp-includes/js/dist/rich-text.js.map delete mode 100644 wp-includes/js/dist/shortcode.js.map delete mode 100644 wp-includes/js/dist/token-list.js.map delete mode 100644 wp-includes/js/dist/url.js.map delete mode 100644 wp-includes/js/dist/vendor/wp-polyfill-ecmascript.js delete mode 100644 wp-includes/js/dist/viewport.js.map delete mode 100644 wp-includes/js/dist/wordcount.js.map diff --git a/wp-content/themes/twentynineteen/style.css.map b/wp-content/themes/twentynineteen/style.css.map deleted file mode 100644 index ae5cbd5154..0000000000 --- a/wp-content/themes/twentynineteen/style.css.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sourceRoot":"","sources":["style.scss","sass/mixins/_mixins-master.scss","sass/_normalize.scss","sass/typography/_typography.scss","sass/variables-site/_fonts.scss","sass/variables-site/_colors.scss","sass/typography/_headings.scss","sass/mixins/_utilities.scss","sass/typography/_copy.scss","sass/elements/_elements.scss","sass/elements/_lists.scss","sass/elements/_tables.scss","sass/forms/_buttons.scss","sass/forms/_fields.scss","sass/navigation/_navigation.scss","sass/navigation/_links.scss","sass/navigation/_menus.scss","sass/variables-site/_structure.scss","sass/navigation/_next-previous.scss","sass/modules/_accessibility.scss","sass/modules/_alignments.scss","sass/modules/_clearings.scss","sass/layout/_layout.scss","sass/site/_site.scss","sass/site/header/_site-header.scss","sass/site/header/_site-featured-image.scss","sass/site/primary/_posts-and-pages.scss","sass/site/primary/_comments.scss","sass/site/primary/_archives.scss","sass/site/footer/_site-footer.scss","sass/site/secondary/_widgets.scss","sass/blocks/_blocks.scss","sass/media/_media.scss","sass/media/_captions.scss","sass/media/_galleries.scss"],"names":[],"mappings":";AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAAA;AAAA;;AAAA;AAAA;AAAA;AAuBA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACuDA;AAAA;AAAA;ADpBA;AE1DA;AAEA;AAAA;AAGA;AAAA;AAAA;AAAA;AAKA;EACC;AAAmB;EACnB;AAAgC;;;AAGjC;AAAA;AAGA;AAAA;AAAA;AAIA;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XuB;E8BYvB;EACA;;;AAGD;EACC;EACA;EAGA;;AAEA;EACC","file":"style.css"} \ No newline at end of file diff --git a/wp-includes/js/dist/a11y.js b/wp-includes/js/dist/a11y.js index ec2c6fc17b..ec76be4930 100644 --- a/wp-includes/js/dist/a11y.js +++ b/wp-includes/js/dist/a11y.js @@ -95,29 +95,7 @@ this["wp"] = this["wp"] || {}; this["wp"]["a11y"] = /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -__webpack_require__.r(__webpack_exports__); -/** - * Build the live regions markup. - * - * @param {string} ariaLive Optional. Value for the 'aria-live' attribute, default 'polite'. - * - * @return {Object} $container The ARIA live region jQuery object. - */ -var addContainer = function addContainer(ariaLive) { - ariaLive = ariaLive || 'polite'; - var container = document.createElement('div'); - container.id = 'a11y-speak-' + ariaLive; - container.className = 'a11y-speak-region'; - container.setAttribute('style', 'position: absolute;' + 'margin: -1px;' + 'padding: 0;' + 'height: 1px;' + 'width: 1px;' + 'overflow: hidden;' + 'clip: rect(1px, 1px, 1px, 1px);' + '-webkit-clip-path: inset(50%);' + 'clip-path: inset(50%);' + 'border: 0;' + 'word-wrap: normal !important;'); - container.setAttribute('aria-live', ariaLive); - container.setAttribute('aria-relevant', 'additions text'); - container.setAttribute('aria-atomic', 'true'); - document.querySelector('body').appendChild(container); - return container; -}; - -/* harmony default export */ __webpack_exports__["default"] = (addContainer); - +eval("__webpack_require__.r(__webpack_exports__);\n/**\n * Build the live regions markup.\n *\n * @param {string} ariaLive Optional. Value for the 'aria-live' attribute, default 'polite'.\n *\n * @return {Object} $container The ARIA live region jQuery object.\n */\nvar addContainer = function addContainer(ariaLive) {\n ariaLive = ariaLive || 'polite';\n var container = document.createElement('div');\n container.id = 'a11y-speak-' + ariaLive;\n container.className = 'a11y-speak-region';\n container.setAttribute('style', 'position: absolute;' + 'margin: -1px;' + 'padding: 0;' + 'height: 1px;' + 'width: 1px;' + 'overflow: hidden;' + 'clip: rect(1px, 1px, 1px, 1px);' + '-webkit-clip-path: inset(50%);' + 'clip-path: inset(50%);' + 'border: 0;' + 'word-wrap: normal !important;');\n container.setAttribute('aria-live', ariaLive);\n container.setAttribute('aria-relevant', 'additions text');\n container.setAttribute('aria-atomic', 'true');\n document.querySelector('body').appendChild(container);\n return container;\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (addContainer);\n\n\n//# sourceURL=webpack://wp.%5Bname%5D/./node_modules/@wordpress/a11y/build-module/addContainer.js?"); /***/ }), @@ -129,20 +107,7 @@ var addContainer = function addContainer(ariaLive) { /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -__webpack_require__.r(__webpack_exports__); -/** - * Clear the a11y-speak-region elements. - */ -var clear = function clear() { - var regions = document.querySelectorAll('.a11y-speak-region'); - - for (var i = 0; i < regions.length; i++) { - regions[i].textContent = ''; - } -}; - -/* harmony default export */ __webpack_exports__["default"] = (clear); - +eval("__webpack_require__.r(__webpack_exports__);\n/**\n * Clear the a11y-speak-region elements.\n */\nvar clear = function clear() {\n var regions = document.querySelectorAll('.a11y-speak-region');\n\n for (var i = 0; i < regions.length; i++) {\n regions[i].textContent = '';\n }\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (clear);\n\n\n//# sourceURL=webpack://wp.%5Bname%5D/./node_modules/@wordpress/a11y/build-module/clear.js?"); /***/ }), @@ -154,36 +119,7 @@ var clear = function clear() { /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -__webpack_require__.r(__webpack_exports__); -var previousMessage = ''; -/** - * Filter the message to be announced to the screenreader. - * - * @param {string} message The message to be announced. - * - * @return {string} The filtered message. - */ - -var filterMessage = function filterMessage(message) { - /* - * Strip HTML tags (if any) from the message string. Ideally, messages should - * be simple strings, carefully crafted for specific use with A11ySpeak. - * When re-using already existing strings this will ensure simple HTML to be - * stripped out and replaced with a space. Browsers will collapse multiple - * spaces natively. - */ - message = message.replace(/<[^<>]+>/g, ' '); - - if (previousMessage === message) { - message += "\xA0"; - } - - previousMessage = message; - return message; -}; - -/* harmony default export */ __webpack_exports__["default"] = (filterMessage); - +eval("__webpack_require__.r(__webpack_exports__);\nvar previousMessage = '';\n/**\n * Filter the message to be announced to the screenreader.\n *\n * @param {string} message The message to be announced.\n *\n * @return {string} The filtered message.\n */\n\nvar filterMessage = function filterMessage(message) {\n /*\n * Strip HTML tags (if any) from the message string. Ideally, messages should\n * be simple strings, carefully crafted for specific use with A11ySpeak.\n * When re-using already existing strings this will ensure simple HTML to be\n * stripped out and replaced with a space. Browsers will collapse multiple\n * spaces natively.\n */\n message = message.replace(/<[^<>]+>/g, ' ');\n\n if (previousMessage === message) {\n message += \"\\xA0\";\n }\n\n previousMessage = message;\n return message;\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (filterMessage);\n\n\n//# sourceURL=webpack://wp.%5Bname%5D/./node_modules/@wordpress/a11y/build-module/filterMessage.js?"); /***/ }), @@ -195,61 +131,7 @@ var filterMessage = function filterMessage(message) { /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setup", function() { return setup; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "speak", function() { return speak; }); -/* harmony import */ var _addContainer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./addContainer */ "./node_modules/@wordpress/a11y/build-module/addContainer.js"); -/* harmony import */ var _clear__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./clear */ "./node_modules/@wordpress/a11y/build-module/clear.js"); -/* harmony import */ var _wordpress_dom_ready__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/dom-ready */ "@wordpress/dom-ready"); -/* harmony import */ var _wordpress_dom_ready__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_dom_ready__WEBPACK_IMPORTED_MODULE_2__); -/* harmony import */ var _filterMessage__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./filterMessage */ "./node_modules/@wordpress/a11y/build-module/filterMessage.js"); - - - - -/** - * Create the live regions. - */ - -var setup = function setup() { - var containerPolite = document.getElementById('a11y-speak-polite'); - var containerAssertive = document.getElementById('a11y-speak-assertive'); - - if (containerPolite === null) { - containerPolite = Object(_addContainer__WEBPACK_IMPORTED_MODULE_0__["default"])('polite'); - } - - if (containerAssertive === null) { - containerAssertive = Object(_addContainer__WEBPACK_IMPORTED_MODULE_0__["default"])('assertive'); - } -}; -/** - * Run setup on domReady. - */ - -_wordpress_dom_ready__WEBPACK_IMPORTED_MODULE_2___default()(setup); -/** - * Update the ARIA live notification area text node. - * - * @param {string} message The message to be announced by Assistive Technologies. - * @param {string} ariaLive Optional. The politeness level for aria-live. Possible values: - * polite or assertive. Default polite. - */ - -var speak = function speak(message, ariaLive) { - // Clear previous messages to allow repeated strings being read out. - Object(_clear__WEBPACK_IMPORTED_MODULE_1__["default"])(); - message = Object(_filterMessage__WEBPACK_IMPORTED_MODULE_3__["default"])(message); - var containerPolite = document.getElementById('a11y-speak-polite'); - var containerAssertive = document.getElementById('a11y-speak-assertive'); - - if (containerAssertive && 'assertive' === ariaLive) { - containerAssertive.textContent = message; - } else if (containerPolite) { - containerPolite.textContent = message; - } -}; - +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"setup\", function() { return setup; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"speak\", function() { return speak; });\n/* harmony import */ var _addContainer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./addContainer */ \"./node_modules/@wordpress/a11y/build-module/addContainer.js\");\n/* harmony import */ var _clear__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./clear */ \"./node_modules/@wordpress/a11y/build-module/clear.js\");\n/* harmony import */ var _wordpress_dom_ready__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/dom-ready */ \"@wordpress/dom-ready\");\n/* harmony import */ var _wordpress_dom_ready__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_dom_ready__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _filterMessage__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./filterMessage */ \"./node_modules/@wordpress/a11y/build-module/filterMessage.js\");\n\n\n\n\n/**\n * Create the live regions.\n */\n\nvar setup = function setup() {\n var containerPolite = document.getElementById('a11y-speak-polite');\n var containerAssertive = document.getElementById('a11y-speak-assertive');\n\n if (containerPolite === null) {\n containerPolite = Object(_addContainer__WEBPACK_IMPORTED_MODULE_0__[\"default\"])('polite');\n }\n\n if (containerAssertive === null) {\n containerAssertive = Object(_addContainer__WEBPACK_IMPORTED_MODULE_0__[\"default\"])('assertive');\n }\n};\n/**\n * Run setup on domReady.\n */\n\n_wordpress_dom_ready__WEBPACK_IMPORTED_MODULE_2___default()(setup);\n/**\n * Update the ARIA live notification area text node.\n *\n * @param {string} message The message to be announced by Assistive Technologies.\n * @param {string} ariaLive Optional. The politeness level for aria-live. Possible values:\n * polite or assertive. Default polite.\n */\n\nvar speak = function speak(message, ariaLive) {\n // Clear previous messages to allow repeated strings being read out.\n Object(_clear__WEBPACK_IMPORTED_MODULE_1__[\"default\"])();\n message = Object(_filterMessage__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(message);\n var containerPolite = document.getElementById('a11y-speak-polite');\n var containerAssertive = document.getElementById('a11y-speak-assertive');\n\n if (containerAssertive && 'assertive' === ariaLive) {\n containerAssertive.textContent = message;\n } else if (containerPolite) {\n containerPolite.textContent = message;\n }\n};\n\n\n//# sourceURL=webpack://wp.%5Bname%5D/./node_modules/@wordpress/a11y/build-module/index.js?"); /***/ }), @@ -260,9 +142,8 @@ var speak = function speak(message, ariaLive) { /*! no static exports found */ /***/ (function(module, exports) { -(function() { module.exports = this["wp"]["domReady"]; }()); +eval("(function() { module.exports = this[\"wp\"][\"domReady\"]; }());\n\n//# sourceURL=webpack://wp.%5Bname%5D/external_%7B%22this%22:%5B%22wp%22,%22domReady%22%5D%7D?"); /***/ }) -/******/ }); -//# sourceMappingURL=a11y.js.map \ No newline at end of file +/******/ }); \ No newline at end of file diff --git a/wp-includes/js/dist/a11y.js.map b/wp-includes/js/dist/a11y.js.map deleted file mode 100644 index ce406a96fa..0000000000 --- a/wp-includes/js/dist/a11y.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["webpack://wp.[name]/webpack/bootstrap","webpack://wp.[name]//Users/gziolo/PhpstormProjects/gutenberg/packages/a11y/src/addContainer.js","webpack://wp.[name]//Users/gziolo/PhpstormProjects/gutenberg/packages/a11y/src/clear.js","webpack://wp.[name]//Users/gziolo/PhpstormProjects/gutenberg/packages/a11y/src/filterMessage.js","webpack://wp.[name]//Users/gziolo/PhpstormProjects/gutenberg/packages/a11y/src/index.js","webpack://wp.[name]/external {\"this\":[\"wp\",\"domReady\"]}"],"names":["addContainer","ariaLive","container","document","createElement","id","className","setAttribute","querySelector","appendChild","clear","regions","querySelectorAll","i","length","textContent","previousMessage","filterMessage","message","replace","setup","containerPolite","getElementById","containerAssertive","domReady","speak"],"mappings":";;AAAA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,kDAA0C,gCAAgC;AAC1E;AACA;;AAEA;AACA;AACA;AACA,gEAAwD,kBAAkB;AAC1E;AACA,yDAAiD,cAAc;AAC/D;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAyC,iCAAiC;AAC1E,wHAAgH,mBAAmB,EAAE;AACrI;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH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B,GAA8BG,OAA9B;AACA;AACD,CAdM;;;;;;;;;;;;AChCP,aAAa,yCAAyC,EAAE,I","file":"a11y.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./node_modules/@wordpress/a11y/build-module/index.js\");\n","/**\n * Build the live regions markup.\n *\n * @param {string} ariaLive Optional. Value for the 'aria-live' attribute, default 'polite'.\n *\n * @return {Object} $container The ARIA live region jQuery object.\n */\nconst addContainer = function( ariaLive ) {\n\tariaLive = ariaLive || 'polite';\n\n\tconst container = document.createElement( 'div' );\n\tcontainer.id = 'a11y-speak-' + ariaLive;\n\tcontainer.className = 'a11y-speak-region';\n\n\tcontainer.setAttribute( 'style', (\n\t\t'position: absolute;' +\n\t\t'margin: -1px;' +\n\t\t'padding: 0;' +\n\t\t'height: 1px;' +\n\t\t'width: 1px;' +\n\t\t'overflow: hidden;' +\n\t\t'clip: rect(1px, 1px, 1px, 1px);' +\n\t\t'-webkit-clip-path: inset(50%);' +\n\t\t'clip-path: inset(50%);' +\n\t\t'border: 0;' +\n\t\t'word-wrap: normal !important;'\n\t) );\n\tcontainer.setAttribute( 'aria-live', ariaLive );\n\tcontainer.setAttribute( 'aria-relevant', 'additions text' );\n\tcontainer.setAttribute( 'aria-atomic', 'true' );\n\n\tdocument.querySelector( 'body' ).appendChild( container );\n\treturn container;\n};\n\nexport default addContainer;\n","/**\n * Clear the a11y-speak-region elements.\n */\nconst clear = function() {\n\tconst regions = document.querySelectorAll( '.a11y-speak-region' );\n\tfor ( let i = 0; i < regions.length; i++ ) {\n\t\tregions[ i ].textContent = '';\n\t}\n};\n\nexport default clear;\n","let previousMessage = '';\n\n/**\n * Filter the message to be announced to the screenreader.\n *\n * @param {string} message The message to be announced.\n *\n * @return {string} The filtered message.\n */\nconst filterMessage = function( message ) {\n\t/*\n\t * Strip HTML tags (if any) from the message string. Ideally, messages should\n\t * be simple strings, carefully crafted for specific use with A11ySpeak.\n\t * When re-using already existing strings this will ensure simple HTML to be\n\t * stripped out and replaced with a space. Browsers will collapse multiple\n\t * spaces natively.\n\t */\n\tmessage = message.replace( /<[^<>]+>/g, ' ' );\n\n\tif ( previousMessage === message ) {\n\t\tmessage += '\\u00A0';\n\t}\n\n\tpreviousMessage = message;\n\n\treturn message;\n};\n\nexport default filterMessage;\n","import addContainer from './addContainer';\nimport clear from './clear';\nimport domReady from '@wordpress/dom-ready';\nimport filterMessage from './filterMessage';\n\n/**\n * Create the live regions.\n */\nexport const setup = function() {\n\tlet containerPolite = document.getElementById( 'a11y-speak-polite' );\n\tlet containerAssertive = document.getElementById( 'a11y-speak-assertive' );\n\n\tif ( containerPolite === null ) {\n\t\tcontainerPolite = addContainer( 'polite' );\n\t}\n\tif ( containerAssertive === null ) {\n\t\tcontainerAssertive = addContainer( 'assertive' );\n\t}\n};\n\n/**\n * Run setup on domReady.\n */\ndomReady( setup );\n\n/**\n * Update the ARIA live notification area text node.\n *\n * @param {string} message The message to be announced by Assistive Technologies.\n * @param {string} ariaLive Optional. The politeness level for aria-live. Possible values:\n * polite or assertive. Default polite.\n */\nexport const speak = function( message, ariaLive ) {\n\t// Clear previous messages to allow repeated strings being read out.\n\tclear();\n\n\tmessage = filterMessage( message );\n\n\tconst containerPolite = document.getElementById( 'a11y-speak-polite' );\n\tconst containerAssertive = document.getElementById( 'a11y-speak-assertive' );\n\n\tif ( containerAssertive && 'assertive' === ariaLive ) {\n\t\tcontainerAssertive.textContent = message;\n\t} else if ( containerPolite ) {\n\t\tcontainerPolite.textContent = message;\n\t}\n};\n","(function() { module.exports = this[\"wp\"][\"domReady\"]; }());"],"sourceRoot":""} \ No newline at end of file diff --git a/wp-includes/js/dist/annotations.js b/wp-includes/js/dist/annotations.js index f790d1e0d6..12db744c6e 100644 --- a/wp-includes/js/dist/annotations.js +++ b/wp-includes/js/dist/annotations.js @@ -95,17 +95,7 @@ this["wp"] = this["wp"] || {}; this["wp"]["annotations"] = /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _arrayWithoutHoles; }); -function _arrayWithoutHoles(arr) { - if (Array.isArray(arr)) { - for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { - arr2[i] = arr[i]; - } - - return arr2; - } -} +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return _arrayWithoutHoles; });\nfunction _arrayWithoutHoles(arr) {\n if (Array.isArray(arr)) {\n for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) {\n arr2[i] = arr[i];\n }\n\n return arr2;\n }\n}\n\n//# sourceURL=webpack://wp.%5Bname%5D/./node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js?"); /***/ }), @@ -117,22 +107,7 @@ function _arrayWithoutHoles(arr) { /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _defineProperty; }); -function _defineProperty(obj, key, value) { - if (key in obj) { - Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true - }); - } else { - obj[key] = value; - } - - return obj; -} +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return _defineProperty; });\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\n//# sourceURL=webpack://wp.%5Bname%5D/./node_modules/@babel/runtime/helpers/esm/defineProperty.js?"); /***/ }), @@ -144,11 +119,7 @@ function _defineProperty(obj, key, value) { /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _iterableToArray; }); -function _iterableToArray(iter) { - if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); -} +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return _iterableToArray; });\nfunction _iterableToArray(iter) {\n if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === \"[object Arguments]\") return Array.from(iter);\n}\n\n//# sourceURL=webpack://wp.%5Bname%5D/./node_modules/@babel/runtime/helpers/esm/iterableToArray.js?"); /***/ }), @@ -160,11 +131,7 @@ function _iterableToArray(iter) { /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _nonIterableSpread; }); -function _nonIterableSpread() { - throw new TypeError("Invalid attempt to spread non-iterable instance"); -} +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return _nonIterableSpread; });\nfunction _nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance\");\n}\n\n//# sourceURL=webpack://wp.%5Bname%5D/./node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js?"); /***/ }), @@ -176,28 +143,7 @@ function _nonIterableSpread() { /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _objectSpread; }); -/* harmony import */ var _defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./defineProperty */ "./node_modules/@babel/runtime/helpers/esm/defineProperty.js"); - -function _objectSpread(target) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i] != null ? arguments[i] : {}; - var ownKeys = Object.keys(source); - - if (typeof Object.getOwnPropertySymbols === 'function') { - ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { - return Object.getOwnPropertyDescriptor(source, sym).enumerable; - })); - } - - ownKeys.forEach(function (key) { - Object(_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])(target, key, source[key]); - }); - } - - return target; -} +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return _objectSpread; });\n/* harmony import */ var _defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./defineProperty */ \"./node_modules/@babel/runtime/helpers/esm/defineProperty.js\");\n\nfunction _objectSpread(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n var ownKeys = Object.keys(source);\n\n if (typeof Object.getOwnPropertySymbols === 'function') {\n ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {\n return Object.getOwnPropertyDescriptor(source, sym).enumerable;\n }));\n }\n\n ownKeys.forEach(function (key) {\n Object(_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(target, key, source[key]);\n });\n }\n\n return target;\n}\n\n//# sourceURL=webpack://wp.%5Bname%5D/./node_modules/@babel/runtime/helpers/esm/objectSpread.js?"); /***/ }), @@ -209,28 +155,7 @@ function _objectSpread(target) { /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _objectWithoutProperties; }); -/* harmony import */ var _objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js"); - -function _objectWithoutProperties(source, excluded) { - if (source == null) return {}; - var target = Object(_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_0__["default"])(source, excluded); - var key, i; - - if (Object.getOwnPropertySymbols) { - var sourceSymbolKeys = Object.getOwnPropertySymbols(source); - - for (i = 0; i < sourceSymbolKeys.length; i++) { - key = sourceSymbolKeys[i]; - if (excluded.indexOf(key) >= 0) continue; - if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; - target[key] = source[key]; - } - } - - return target; -} +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return _objectWithoutProperties; });\n/* harmony import */ var _objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./objectWithoutPropertiesLoose */ \"./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js\");\n\nfunction _objectWithoutProperties(source, excluded) {\n if (source == null) return {};\n var target = Object(_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(source, excluded);\n var key, i;\n\n if (Object.getOwnPropertySymbols) {\n var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n\n for (i = 0; i < sourceSymbolKeys.length; i++) {\n key = sourceSymbolKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n target[key] = source[key];\n }\n }\n\n return target;\n}\n\n//# sourceURL=webpack://wp.%5Bname%5D/./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js?"); /***/ }), @@ -242,22 +167,7 @@ function _objectWithoutProperties(source, excluded) { /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _objectWithoutPropertiesLoose; }); -function _objectWithoutPropertiesLoose(source, excluded) { - if (source == null) return {}; - var target = {}; - var sourceKeys = Object.keys(source); - var key, i; - - for (i = 0; i < sourceKeys.length; i++) { - key = sourceKeys[i]; - if (excluded.indexOf(key) >= 0) continue; - target[key] = source[key]; - } - - return target; -} +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return _objectWithoutPropertiesLoose; });\nfunction _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}\n\n//# sourceURL=webpack://wp.%5Bname%5D/./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js?"); /***/ }), @@ -269,17 +179,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _toConsumableArray; }); -/* harmony import */ var _arrayWithoutHoles__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./arrayWithoutHoles */ "./node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js"); -/* harmony import */ var _iterableToArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./iterableToArray */ "./node_modules/@babel/runtime/helpers/esm/iterableToArray.js"); -/* harmony import */ var _nonIterableSpread__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./nonIterableSpread */ "./node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js"); - - - -function _toConsumableArray(arr) { - return Object(_arrayWithoutHoles__WEBPACK_IMPORTED_MODULE_0__["default"])(arr) || Object(_iterableToArray__WEBPACK_IMPORTED_MODULE_1__["default"])(arr) || Object(_nonIterableSpread__WEBPACK_IMPORTED_MODULE_2__["default"])(); -} +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return _toConsumableArray; });\n/* harmony import */ var _arrayWithoutHoles__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./arrayWithoutHoles */ \"./node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js\");\n/* harmony import */ var _iterableToArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./iterableToArray */ \"./node_modules/@babel/runtime/helpers/esm/iterableToArray.js\");\n/* harmony import */ var _nonIterableSpread__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./nonIterableSpread */ \"./node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js\");\n\n\n\nfunction _toConsumableArray(arr) {\n return Object(_arrayWithoutHoles__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(arr) || Object(_iterableToArray__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(arr) || Object(_nonIterableSpread__WEBPACK_IMPORTED_MODULE_2__[\"default\"])();\n}\n\n//# sourceURL=webpack://wp.%5Bname%5D/./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js?"); /***/ }), @@ -291,39 +191,7 @@ function _toConsumableArray(arr) { /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _wordpress_hooks__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/hooks */ "@wordpress/hooks"); -/* harmony import */ var _wordpress_hooks__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); -/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_1__); -/** - * WordPress dependencies - */ - - -/** - * Adds annotation className to the block-list-block component. - * - * @param {Object} OriginalComponent The original BlockListBlock component. - * @return {Object} The enhanced component. - */ - -var addAnnotationClassName = function addAnnotationClassName(OriginalComponent) { - return Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_1__["withSelect"])(function (select, _ref) { - var clientId = _ref.clientId; - - var annotations = select('core/annotations').__experimentalGetAnnotationsForBlock(clientId); - - return { - className: annotations.map(function (annotation) { - return 'is-annotated-by-' + annotation.source; - }) - }; - })(OriginalComponent); -}; - -Object(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_0__["addFilter"])('editor.BlockListBlock', 'core/annotations', addAnnotationClassName); - +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _wordpress_hooks__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/hooks */ \"@wordpress/hooks\");\n/* harmony import */ var _wordpress_hooks__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/data */ \"@wordpress/data\");\n/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_1__);\n/**\n * WordPress dependencies\n */\n\n\n/**\n * Adds annotation className to the block-list-block component.\n *\n * @param {Object} OriginalComponent The original BlockListBlock component.\n * @return {Object} The enhanced component.\n */\n\nvar addAnnotationClassName = function addAnnotationClassName(OriginalComponent) {\n return Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_1__[\"withSelect\"])(function (select, _ref) {\n var clientId = _ref.clientId;\n\n var annotations = select('core/annotations').__experimentalGetAnnotationsForBlock(clientId);\n\n return {\n className: annotations.map(function (annotation) {\n return 'is-annotated-by-' + annotation.source;\n })\n };\n })(OriginalComponent);\n};\n\nObject(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_0__[\"addFilter\"])('editor.BlockListBlock', 'core/annotations', addAnnotationClassName);\n\n\n//# sourceURL=webpack://wp.%5Bname%5D/./node_modules/@wordpress/annotations/build-module/block/index.js?"); /***/ }), @@ -335,211 +203,7 @@ Object(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_0__["addFilter"])('editor.Block /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "applyAnnotations", function() { return applyAnnotations; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "removeAnnotations", function() { return removeAnnotations; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "annotation", function() { return annotation; }); -/* harmony import */ var memize__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! memize */ "./node_modules/memize/index.js"); -/* harmony import */ var memize__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(memize__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); -/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var _wordpress_rich_text__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/rich-text */ "@wordpress/rich-text"); -/* harmony import */ var _wordpress_rich_text__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_2__); -/** - * External dependencies - */ - -/** - * WordPress dependencies - */ - - - -var FORMAT_NAME = 'core/annotation'; -var ANNOTATION_ATTRIBUTE_PREFIX = 'annotation-text-'; -var STORE_KEY = 'core/annotations'; -/** - * Applies given annotations to the given record. - * - * @param {Object} record The record to apply annotations to. - * @param {Array} annotations The annotation to apply. - * @return {Object} A record with the annotations applied. - */ - -function applyAnnotations(record) { - var annotations = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; - annotations.forEach(function (annotation) { - var start = annotation.start, - end = annotation.end; - - if (start > record.text.length) { - start = record.text.length; - } - - if (end > record.text.length) { - end = record.text.length; - } - - var className = ANNOTATION_ATTRIBUTE_PREFIX + annotation.source; - var id = ANNOTATION_ATTRIBUTE_PREFIX + annotation.id; - record = Object(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_2__["applyFormat"])(record, { - type: FORMAT_NAME, - attributes: { - className: className, - id: id - } - }, start, end); - }); - return record; -} -/** - * Removes annotations from the given record. - * - * @param {Object} record Record to remove annotations from. - * @return {Object} The cleaned record. - */ - -function removeAnnotations(record) { - return Object(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_2__["removeFormat"])(record, 'core/annotation', 0, record.text.length); -} -/** - * Retrieves the positions of annotations inside an array of formats. - * - * @param {Array} formats Formats with annotations in there. - * @return {Object} ID keyed positions of annotations. - */ - -function retrieveAnnotationPositions(formats) { - var positions = {}; - formats.forEach(function (characterFormats, i) { - characterFormats = characterFormats || []; - characterFormats = characterFormats.filter(function (format) { - return format.type === FORMAT_NAME; - }); - characterFormats.forEach(function (format) { - var id = format.attributes.id; - id = id.replace(ANNOTATION_ATTRIBUTE_PREFIX, ''); - - if (!positions.hasOwnProperty(id)) { - positions[id] = { - start: i - }; - } // Annotations refer to positions between characters. - // Formats refer to the character themselves. - // So we need to adjust for that here. - - - positions[id].end = i + 1; - }); - }); - return positions; -} -/** - * Updates annotations in the state based on positions retrieved from RichText. - * - * @param {Array} annotations The annotations that are currently applied. - * @param {Array} positions The current positions of the given annotations. - * @param {Function} removeAnnotation Function to remove an annotation from the state. - * @param {Function} updateAnnotationRange Function to update an annotation range in the state. - */ - - -function updateAnnotationsWithPositions(annotations, positions, _ref) { - var removeAnnotation = _ref.removeAnnotation, - updateAnnotationRange = _ref.updateAnnotationRange; - annotations.forEach(function (currentAnnotation) { - var position = positions[currentAnnotation.id]; // If we cannot find an annotation, delete it. - - if (!position) { - // Apparently the annotation has been removed, so remove it from the state: - // Remove... - removeAnnotation(currentAnnotation.id); - return; - } - - var start = currentAnnotation.start, - end = currentAnnotation.end; - - if (start !== position.start || end !== position.end) { - updateAnnotationRange(currentAnnotation.id, position.start, position.end); - } - }); -} -/** - * Create prepareEditableTree memoized based on the annotation props. - * - * @param {Object} The props with annotations in them. - * - * @return {Function} The prepareEditableTree. - */ - - -var createPrepareEditableTree = memize__WEBPACK_IMPORTED_MODULE_0___default()(function (props) { - var annotations = props.annotations; - return function (formats, text) { - if (annotations.length === 0) { - return formats; - } - - var record = { - formats: formats, - text: text - }; - record = applyAnnotations(record, annotations); - return record.formats; - }; -}); -/** - * Returns the annotations as a props object. Memoized to prevent re-renders. - * - * @param {Array} The annotations to put in the object. - * - * @return {Object} The annotations props object. - */ - -var getAnnotationObject = memize__WEBPACK_IMPORTED_MODULE_0___default()(function (annotations) { - return { - annotations: annotations - }; -}); -var annotation = { - name: FORMAT_NAME, - title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__["__"])('Annotation'), - tagName: 'mark', - className: 'annotation-text', - attributes: { - className: 'class', - id: 'id' - }, - edit: function edit() { - return null; - }, - __experimentalGetPropsForEditableTreePreparation: function __experimentalGetPropsForEditableTreePreparation(select, _ref2) { - var richTextIdentifier = _ref2.richTextIdentifier, - blockClientId = _ref2.blockClientId; - return getAnnotationObject(select(STORE_KEY).__experimentalGetAnnotationsForRichText(blockClientId, richTextIdentifier)); - }, - __experimentalCreatePrepareEditableTree: createPrepareEditableTree, - __experimentalGetPropsForEditableTreeChangeHandler: function __experimentalGetPropsForEditableTreeChangeHandler(dispatch) { - return { - removeAnnotation: dispatch(STORE_KEY).__experimentalRemoveAnnotation, - updateAnnotationRange: dispatch(STORE_KEY).__experimentalUpdateAnnotationRange - }; - }, - __experimentalCreateOnChangeEditableValue: function __experimentalCreateOnChangeEditableValue(props) { - return function (formats) { - var positions = retrieveAnnotationPositions(formats); - var removeAnnotation = props.removeAnnotation, - updateAnnotationRange = props.updateAnnotationRange, - annotations = props.annotations; - updateAnnotationsWithPositions(annotations, positions, { - removeAnnotation: removeAnnotation, - updateAnnotationRange: updateAnnotationRange - }); - }; - } -}; - +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"applyAnnotations\", function() { return applyAnnotations; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"removeAnnotations\", function() { return removeAnnotations; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"annotation\", function() { return annotation; });\n/* harmony import */ var memize__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! memize */ \"./node_modules/memize/index.js\");\n/* harmony import */ var memize__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(memize__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ \"@wordpress/i18n\");\n/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _wordpress_rich_text__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/rich-text */ \"@wordpress/rich-text\");\n/* harmony import */ var _wordpress_rich_text__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_2__);\n/**\n * External dependencies\n */\n\n/**\n * WordPress dependencies\n */\n\n\n\nvar FORMAT_NAME = 'core/annotation';\nvar ANNOTATION_ATTRIBUTE_PREFIX = 'annotation-text-';\nvar STORE_KEY = 'core/annotations';\n/**\n * Applies given annotations to the given record.\n *\n * @param {Object} record The record to apply annotations to.\n * @param {Array} annotations The annotation to apply.\n * @return {Object} A record with the annotations applied.\n */\n\nfunction applyAnnotations(record) {\n var annotations = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];\n annotations.forEach(function (annotation) {\n var start = annotation.start,\n end = annotation.end;\n\n if (start > record.text.length) {\n start = record.text.length;\n }\n\n if (end > record.text.length) {\n end = record.text.length;\n }\n\n var className = ANNOTATION_ATTRIBUTE_PREFIX + annotation.source;\n var id = ANNOTATION_ATTRIBUTE_PREFIX + annotation.id;\n record = Object(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_2__[\"applyFormat\"])(record, {\n type: FORMAT_NAME,\n attributes: {\n className: className,\n id: id\n }\n }, start, end);\n });\n return record;\n}\n/**\n * Removes annotations from the given record.\n *\n * @param {Object} record Record to remove annotations from.\n * @return {Object} The cleaned record.\n */\n\nfunction removeAnnotations(record) {\n return Object(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_2__[\"removeFormat\"])(record, 'core/annotation', 0, record.text.length);\n}\n/**\n * Retrieves the positions of annotations inside an array of formats.\n *\n * @param {Array} formats Formats with annotations in there.\n * @return {Object} ID keyed positions of annotations.\n */\n\nfunction retrieveAnnotationPositions(formats) {\n var positions = {};\n formats.forEach(function (characterFormats, i) {\n characterFormats = characterFormats || [];\n characterFormats = characterFormats.filter(function (format) {\n return format.type === FORMAT_NAME;\n });\n characterFormats.forEach(function (format) {\n var id = format.attributes.id;\n id = id.replace(ANNOTATION_ATTRIBUTE_PREFIX, '');\n\n if (!positions.hasOwnProperty(id)) {\n positions[id] = {\n start: i\n };\n } // Annotations refer to positions between characters.\n // Formats refer to the character themselves.\n // So we need to adjust for that here.\n\n\n positions[id].end = i + 1;\n });\n });\n return positions;\n}\n/**\n * Updates annotations in the state based on positions retrieved from RichText.\n *\n * @param {Array} annotations The annotations that are currently applied.\n * @param {Array} positions The current positions of the given annotations.\n * @param {Function} removeAnnotation Function to remove an annotation from the state.\n * @param {Function} updateAnnotationRange Function to update an annotation range in the state.\n */\n\n\nfunction updateAnnotationsWithPositions(annotations, positions, _ref) {\n var removeAnnotation = _ref.removeAnnotation,\n updateAnnotationRange = _ref.updateAnnotationRange;\n annotations.forEach(function (currentAnnotation) {\n var position = positions[currentAnnotation.id]; // If we cannot find an annotation, delete it.\n\n if (!position) {\n // Apparently the annotation has been removed, so remove it from the state:\n // Remove...\n removeAnnotation(currentAnnotation.id);\n return;\n }\n\n var start = currentAnnotation.start,\n end = currentAnnotation.end;\n\n if (start !== position.start || end !== position.end) {\n updateAnnotationRange(currentAnnotation.id, position.start, position.end);\n }\n });\n}\n/**\n * Create prepareEditableTree memoized based on the annotation props.\n *\n * @param {Object} The props with annotations in them.\n *\n * @return {Function} The prepareEditableTree.\n */\n\n\nvar createPrepareEditableTree = memize__WEBPACK_IMPORTED_MODULE_0___default()(function (props) {\n var annotations = props.annotations;\n return function (formats, text) {\n if (annotations.length === 0) {\n return formats;\n }\n\n var record = {\n formats: formats,\n text: text\n };\n record = applyAnnotations(record, annotations);\n return record.formats;\n };\n});\n/**\n * Returns the annotations as a props object. Memoized to prevent re-renders.\n *\n * @param {Array} The annotations to put in the object.\n *\n * @return {Object} The annotations props object.\n */\n\nvar getAnnotationObject = memize__WEBPACK_IMPORTED_MODULE_0___default()(function (annotations) {\n return {\n annotations: annotations\n };\n});\nvar annotation = {\n name: FORMAT_NAME,\n title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__[\"__\"])('Annotation'),\n tagName: 'mark',\n className: 'annotation-text',\n attributes: {\n className: 'class',\n id: 'id'\n },\n edit: function edit() {\n return null;\n },\n __experimentalGetPropsForEditableTreePreparation: function __experimentalGetPropsForEditableTreePreparation(select, _ref2) {\n var richTextIdentifier = _ref2.richTextIdentifier,\n blockClientId = _ref2.blockClientId;\n return getAnnotationObject(select(STORE_KEY).__experimentalGetAnnotationsForRichText(blockClientId, richTextIdentifier));\n },\n __experimentalCreatePrepareEditableTree: createPrepareEditableTree,\n __experimentalGetPropsForEditableTreeChangeHandler: function __experimentalGetPropsForEditableTreeChangeHandler(dispatch) {\n return {\n removeAnnotation: dispatch(STORE_KEY).__experimentalRemoveAnnotation,\n updateAnnotationRange: dispatch(STORE_KEY).__experimentalUpdateAnnotationRange\n };\n },\n __experimentalCreateOnChangeEditableValue: function __experimentalCreateOnChangeEditableValue(props) {\n return function (formats) {\n var positions = retrieveAnnotationPositions(formats);\n var removeAnnotation = props.removeAnnotation,\n updateAnnotationRange = props.updateAnnotationRange,\n annotations = props.annotations;\n updateAnnotationsWithPositions(annotations, positions, {\n removeAnnotation: removeAnnotation,\n updateAnnotationRange: updateAnnotationRange\n });\n };\n }\n};\n\n\n//# sourceURL=webpack://wp.%5Bname%5D/./node_modules/@wordpress/annotations/build-module/format/annotation.js?"); /***/ }), @@ -551,28 +215,7 @@ var annotation = { /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutProperties */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js"); -/* harmony import */ var _wordpress_rich_text__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/rich-text */ "@wordpress/rich-text"); -/* harmony import */ var _wordpress_rich_text__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var _annotation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./annotation */ "./node_modules/@wordpress/annotations/build-module/format/annotation.js"); - - -/** - * WordPress dependencies - */ - -/** - * Internal dependencies - */ - - - -var name = _annotation__WEBPACK_IMPORTED_MODULE_2__["annotation"].name, - settings = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_0__["default"])(_annotation__WEBPACK_IMPORTED_MODULE_2__["annotation"], ["name"]); - -Object(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_1__["registerFormatType"])(name, settings); - +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutProperties */ \"./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js\");\n/* harmony import */ var _wordpress_rich_text__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/rich-text */ \"@wordpress/rich-text\");\n/* harmony import */ var _wordpress_rich_text__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _annotation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./annotation */ \"./node_modules/@wordpress/annotations/build-module/format/annotation.js\");\n\n\n/**\n * WordPress dependencies\n */\n\n/**\n * Internal dependencies\n */\n\n\n\nvar name = _annotation__WEBPACK_IMPORTED_MODULE_2__[\"annotation\"].name,\n settings = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(_annotation__WEBPACK_IMPORTED_MODULE_2__[\"annotation\"], [\"name\"]);\n\nObject(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_1__[\"registerFormatType\"])(name, settings);\n\n\n//# sourceURL=webpack://wp.%5Bname%5D/./node_modules/@wordpress/annotations/build-module/format/index.js?"); /***/ }), @@ -584,17 +227,7 @@ Object(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_1__["registerFormatType"])( /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _store__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./store */ "./node_modules/@wordpress/annotations/build-module/store/index.js"); -/* harmony import */ var _format__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./format */ "./node_modules/@wordpress/annotations/build-module/format/index.js"); -/* harmony import */ var _block__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./block */ "./node_modules/@wordpress/annotations/build-module/block/index.js"); -/** - * Internal dependencies - */ - - - - +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _store__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./store */ \"./node_modules/@wordpress/annotations/build-module/store/index.js\");\n/* harmony import */ var _format__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./format */ \"./node_modules/@wordpress/annotations/build-module/format/index.js\");\n/* harmony import */ var _block__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./block */ \"./node_modules/@wordpress/annotations/build-module/block/index.js\");\n/**\n * Internal dependencies\n */\n\n\n\n\n\n//# sourceURL=webpack://wp.%5Bname%5D/./node_modules/@wordpress/annotations/build-module/index.js?"); /***/ }), @@ -606,115 +239,7 @@ __webpack_require__.r(__webpack_exports__); /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__experimentalAddAnnotation", function() { return __experimentalAddAnnotation; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__experimentalRemoveAnnotation", function() { return __experimentalRemoveAnnotation; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__experimentalUpdateAnnotationRange", function() { return __experimentalUpdateAnnotationRange; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__experimentalRemoveAnnotationsBySource", function() { return __experimentalRemoveAnnotationsBySource; }); -/* harmony import */ var uuid_v4__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! uuid/v4 */ "./node_modules/uuid/v4.js"); -/* harmony import */ var uuid_v4__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(uuid_v4__WEBPACK_IMPORTED_MODULE_0__); -/** - * External dependencies - */ - -/** - * Adds an annotation to a block. - * - * The `block` attribute refers to a block ID that needs to be annotated. - * `isBlockAnnotation` controls whether or not the annotation is a block - * annotation. The `source` is the source of the annotation, this will be used - * to identity groups of annotations. - * - * The `range` property is only relevant if the selector is 'range'. - * - * @param {Object} annotation The annotation to add. - * @param {string} blockClientId The blockClientId to add the annotation to. - * @param {string} richTextIdentifier Identifier for the RichText instance the annotation applies to. - * @param {Object} range The range at which to apply this annotation. - * @param {number} range.start The offset where the annotation should start. - * @param {number} range.end The offset where the annotation should end. - * @param {string} [selector="range"] The way to apply this annotation. - * @param {string} [source="default"] The source that added the annotation. - * @param {string} [id=uuid()] The ID the annotation should have. - * Generates a UUID by default. - * - * @return {Object} Action object. - */ - -function __experimentalAddAnnotation(_ref) { - var blockClientId = _ref.blockClientId, - _ref$richTextIdentifi = _ref.richTextIdentifier, - richTextIdentifier = _ref$richTextIdentifi === void 0 ? null : _ref$richTextIdentifi, - _ref$range = _ref.range, - range = _ref$range === void 0 ? null : _ref$range, - _ref$selector = _ref.selector, - selector = _ref$selector === void 0 ? 'range' : _ref$selector, - _ref$source = _ref.source, - source = _ref$source === void 0 ? 'default' : _ref$source, - _ref$id = _ref.id, - id = _ref$id === void 0 ? uuid_v4__WEBPACK_IMPORTED_MODULE_0___default()() : _ref$id; - var action = { - type: 'ANNOTATION_ADD', - id: id, - blockClientId: blockClientId, - richTextIdentifier: richTextIdentifier, - source: source, - selector: selector - }; - - if (selector === 'range') { - action.range = range; - } - - return action; -} -/** - * Removes an annotation with a specific ID. - * - * @param {string} annotationId The annotation to remove. - * - * @return {Object} Action object. - */ - -function __experimentalRemoveAnnotation(annotationId) { - return { - type: 'ANNOTATION_REMOVE', - annotationId: annotationId - }; -} -/** - * Updates the range of an annotation. - * - * @param {string} annotationId ID of the annotation to update. - * @param {number} start The start of the new range. - * @param {number} end The end of the new range. - * - * @return {Object} Action object. - */ - -function __experimentalUpdateAnnotationRange(annotationId, start, end) { - return { - type: 'ANNOTATION_UPDATE_RANGE', - annotationId: annotationId, - start: start, - end: end - }; -} -/** - * Removes all annotations of a specific source. - * - * @param {string} source The source to remove. - * - * @return {Object} Action object. - */ - -function __experimentalRemoveAnnotationsBySource(source) { - return { - type: 'ANNOTATION_REMOVE_SOURCE', - source: source - }; -} - +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__experimentalAddAnnotation\", function() { return __experimentalAddAnnotation; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__experimentalRemoveAnnotation\", function() { return __experimentalRemoveAnnotation; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__experimentalUpdateAnnotationRange\", function() { return __experimentalUpdateAnnotationRange; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__experimentalRemoveAnnotationsBySource\", function() { return __experimentalRemoveAnnotationsBySource; });\n/* harmony import */ var uuid_v4__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! uuid/v4 */ \"./node_modules/uuid/v4.js\");\n/* harmony import */ var uuid_v4__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(uuid_v4__WEBPACK_IMPORTED_MODULE_0__);\n/**\n * External dependencies\n */\n\n/**\n * Adds an annotation to a block.\n *\n * The `block` attribute refers to a block ID that needs to be annotated.\n * `isBlockAnnotation` controls whether or not the annotation is a block\n * annotation. The `source` is the source of the annotation, this will be used\n * to identity groups of annotations.\n *\n * The `range` property is only relevant if the selector is 'range'.\n *\n * @param {Object} annotation The annotation to add.\n * @param {string} blockClientId The blockClientId to add the annotation to.\n * @param {string} richTextIdentifier Identifier for the RichText instance the annotation applies to.\n * @param {Object} range The range at which to apply this annotation.\n * @param {number} range.start The offset where the annotation should start.\n * @param {number} range.end The offset where the annotation should end.\n * @param {string} [selector=\"range\"] The way to apply this annotation.\n * @param {string} [source=\"default\"] The source that added the annotation.\n * @param {string} [id=uuid()] The ID the annotation should have.\n * Generates a UUID by default.\n *\n * @return {Object} Action object.\n */\n\nfunction __experimentalAddAnnotation(_ref) {\n var blockClientId = _ref.blockClientId,\n _ref$richTextIdentifi = _ref.richTextIdentifier,\n richTextIdentifier = _ref$richTextIdentifi === void 0 ? null : _ref$richTextIdentifi,\n _ref$range = _ref.range,\n range = _ref$range === void 0 ? null : _ref$range,\n _ref$selector = _ref.selector,\n selector = _ref$selector === void 0 ? 'range' : _ref$selector,\n _ref$source = _ref.source,\n source = _ref$source === void 0 ? 'default' : _ref$source,\n _ref$id = _ref.id,\n id = _ref$id === void 0 ? uuid_v4__WEBPACK_IMPORTED_MODULE_0___default()() : _ref$id;\n var action = {\n type: 'ANNOTATION_ADD',\n id: id,\n blockClientId: blockClientId,\n richTextIdentifier: richTextIdentifier,\n source: source,\n selector: selector\n };\n\n if (selector === 'range') {\n action.range = range;\n }\n\n return action;\n}\n/**\n * Removes an annotation with a specific ID.\n *\n * @param {string} annotationId The annotation to remove.\n *\n * @return {Object} Action object.\n */\n\nfunction __experimentalRemoveAnnotation(annotationId) {\n return {\n type: 'ANNOTATION_REMOVE',\n annotationId: annotationId\n };\n}\n/**\n * Updates the range of an annotation.\n *\n * @param {string} annotationId ID of the annotation to update.\n * @param {number} start The start of the new range.\n * @param {number} end The end of the new range.\n *\n * @return {Object} Action object.\n */\n\nfunction __experimentalUpdateAnnotationRange(annotationId, start, end) {\n return {\n type: 'ANNOTATION_UPDATE_RANGE',\n annotationId: annotationId,\n start: start,\n end: end\n };\n}\n/**\n * Removes all annotations of a specific source.\n *\n * @param {string} source The source to remove.\n *\n * @return {Object} Action object.\n */\n\nfunction __experimentalRemoveAnnotationsBySource(source) {\n return {\n type: 'ANNOTATION_REMOVE_SOURCE',\n source: source\n };\n}\n\n\n//# sourceURL=webpack://wp.%5Bname%5D/./node_modules/@wordpress/annotations/build-module/store/actions.js?"); /***/ }), @@ -726,35 +251,7 @@ function __experimentalRemoveAnnotationsBySource(source) { /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); -/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _reducer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./reducer */ "./node_modules/@wordpress/annotations/build-module/store/reducer.js"); -/* harmony import */ var _selectors__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./selectors */ "./node_modules/@wordpress/annotations/build-module/store/selectors.js"); -/* harmony import */ var _actions__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./actions */ "./node_modules/@wordpress/annotations/build-module/store/actions.js"); -/** - * WordPress Dependencies - */ - -/** - * Internal dependencies - */ - - - - -/** - * Module Constants - */ - -var MODULE_KEY = 'core/annotations'; -var store = Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__["registerStore"])(MODULE_KEY, { - reducer: _reducer__WEBPACK_IMPORTED_MODULE_1__["default"], - selectors: _selectors__WEBPACK_IMPORTED_MODULE_2__, - actions: _actions__WEBPACK_IMPORTED_MODULE_3__ -}); -/* harmony default export */ __webpack_exports__["default"] = (store); - +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/data */ \"@wordpress/data\");\n/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _reducer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./reducer */ \"./node_modules/@wordpress/annotations/build-module/store/reducer.js\");\n/* harmony import */ var _selectors__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./selectors */ \"./node_modules/@wordpress/annotations/build-module/store/selectors.js\");\n/* harmony import */ var _actions__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./actions */ \"./node_modules/@wordpress/annotations/build-module/store/actions.js\");\n/**\n * WordPress Dependencies\n */\n\n/**\n * Internal dependencies\n */\n\n\n\n\n/**\n * Module Constants\n */\n\nvar MODULE_KEY = 'core/annotations';\nvar store = Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__[\"registerStore\"])(MODULE_KEY, {\n reducer: _reducer__WEBPACK_IMPORTED_MODULE_1__[\"default\"],\n selectors: _selectors__WEBPACK_IMPORTED_MODULE_2__,\n actions: _actions__WEBPACK_IMPORTED_MODULE_3__\n});\n/* harmony default export */ __webpack_exports__[\"default\"] = (store);\n\n\n//# sourceURL=webpack://wp.%5Bname%5D/./node_modules/@wordpress/annotations/build-module/store/index.js?"); /***/ }), @@ -766,117 +263,7 @@ var store = Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__["registerStore"] /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "annotations", function() { return annotations; }); -/* harmony import */ var _babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/defineProperty */ "./node_modules/@babel/runtime/helpers/esm/defineProperty.js"); -/* harmony import */ var _babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/toConsumableArray */ "./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js"); -/* harmony import */ var _babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectSpread */ "./node_modules/@babel/runtime/helpers/esm/objectSpread.js"); -/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! lodash */ "lodash"); -/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_3__); - - - - -/** - * External dependencies - */ - -/** - * Filters an array based on the predicate, but keeps the reference the same if - * the array hasn't changed. - * - * @param {Array} collection The collection to filter. - * @param {Function} predicate Function that determines if the item should stay - * in the array. - * @return {Array} Filtered array. - */ - -function filterWithReference(collection, predicate) { - var filteredCollection = collection.filter(predicate); - return collection.length === filteredCollection.length ? collection : filteredCollection; -} -/** - * Verifies whether the given annotations is a valid annotation. - * - * @param {Object} annotation The annotation to verify. - * @return {boolean} Whether the given annotation is valid. - */ - - -function isValidAnnotationRange(annotation) { - return Object(lodash__WEBPACK_IMPORTED_MODULE_3__["isNumber"])(annotation.start) && Object(lodash__WEBPACK_IMPORTED_MODULE_3__["isNumber"])(annotation.end) && annotation.start <= annotation.end; -} -/** - * Reducer managing annotations. - * - * @param {Array} state The annotations currently shown in the editor. - * @param {Object} action Dispatched action. - * - * @return {Array} Updated state. - */ - - -function annotations() { - var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - var action = arguments.length > 1 ? arguments[1] : undefined; - - switch (action.type) { - case 'ANNOTATION_ADD': - var blockClientId = action.blockClientId; - var newAnnotation = { - id: action.id, - blockClientId: blockClientId, - richTextIdentifier: action.richTextIdentifier, - source: action.source, - selector: action.selector, - range: action.range - }; - - if (newAnnotation.selector === 'range' && !isValidAnnotationRange(newAnnotation.range)) { - return state; - } - - var previousAnnotationsForBlock = Object(lodash__WEBPACK_IMPORTED_MODULE_3__["get"])(state, blockClientId, []); - return Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_2__["default"])({}, state, Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])({}, blockClientId, Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__["default"])(previousAnnotationsForBlock).concat([newAnnotation]))); - - case 'ANNOTATION_REMOVE': - return Object(lodash__WEBPACK_IMPORTED_MODULE_3__["mapValues"])(state, function (annotationsForBlock) { - return filterWithReference(annotationsForBlock, function (annotation) { - return annotation.id !== action.annotationId; - }); - }); - - case 'ANNOTATION_UPDATE_RANGE': - return Object(lodash__WEBPACK_IMPORTED_MODULE_3__["mapValues"])(state, function (annotationsForBlock) { - var hasChangedRange = false; - var newAnnotations = annotationsForBlock.map(function (annotation) { - if (annotation.id === action.annotationId) { - hasChangedRange = true; - return Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_2__["default"])({}, annotation, { - range: { - start: action.start, - end: action.end - } - }); - } - - return annotation; - }); - return hasChangedRange ? newAnnotations : annotationsForBlock; - }); - - case 'ANNOTATION_REMOVE_SOURCE': - return Object(lodash__WEBPACK_IMPORTED_MODULE_3__["mapValues"])(state, function (annotationsForBlock) { - return filterWithReference(annotationsForBlock, function (annotation) { - return annotation.source !== action.source; - }); - }); - } - - return state; -} -/* harmony default export */ __webpack_exports__["default"] = (annotations); - +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"annotations\", function() { return annotations; });\n/* harmony import */ var _babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/defineProperty */ \"./node_modules/@babel/runtime/helpers/esm/defineProperty.js\");\n/* harmony import */ var _babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/toConsumableArray */ \"./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js\");\n/* harmony import */ var _babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectSpread */ \"./node_modules/@babel/runtime/helpers/esm/objectSpread.js\");\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! lodash */ \"lodash\");\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_3__);\n\n\n\n\n/**\n * External dependencies\n */\n\n/**\n * Filters an array based on the predicate, but keeps the reference the same if\n * the array hasn't changed.\n *\n * @param {Array} collection The collection to filter.\n * @param {Function} predicate Function that determines if the item should stay\n * in the array.\n * @return {Array} Filtered array.\n */\n\nfunction filterWithReference(collection, predicate) {\n var filteredCollection = collection.filter(predicate);\n return collection.length === filteredCollection.length ? collection : filteredCollection;\n}\n/**\n * Verifies whether the given annotations is a valid annotation.\n *\n * @param {Object} annotation The annotation to verify.\n * @return {boolean} Whether the given annotation is valid.\n */\n\n\nfunction isValidAnnotationRange(annotation) {\n return Object(lodash__WEBPACK_IMPORTED_MODULE_3__[\"isNumber\"])(annotation.start) && Object(lodash__WEBPACK_IMPORTED_MODULE_3__[\"isNumber\"])(annotation.end) && annotation.start <= annotation.end;\n}\n/**\n * Reducer managing annotations.\n *\n * @param {Array} state The annotations currently shown in the editor.\n * @param {Object} action Dispatched action.\n *\n * @return {Array} Updated state.\n */\n\n\nfunction annotations() {\n var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var action = arguments.length > 1 ? arguments[1] : undefined;\n\n switch (action.type) {\n case 'ANNOTATION_ADD':\n var blockClientId = action.blockClientId;\n var newAnnotation = {\n id: action.id,\n blockClientId: blockClientId,\n richTextIdentifier: action.richTextIdentifier,\n source: action.source,\n selector: action.selector,\n range: action.range\n };\n\n if (newAnnotation.selector === 'range' && !isValidAnnotationRange(newAnnotation.range)) {\n return state;\n }\n\n var previousAnnotationsForBlock = Object(lodash__WEBPACK_IMPORTED_MODULE_3__[\"get\"])(state, blockClientId, []);\n return Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_2__[\"default\"])({}, state, Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])({}, blockClientId, Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(previousAnnotationsForBlock).concat([newAnnotation])));\n\n case 'ANNOTATION_REMOVE':\n return Object(lodash__WEBPACK_IMPORTED_MODULE_3__[\"mapValues\"])(state, function (annotationsForBlock) {\n return filterWithReference(annotationsForBlock, function (annotation) {\n return annotation.id !== action.annotationId;\n });\n });\n\n case 'ANNOTATION_UPDATE_RANGE':\n return Object(lodash__WEBPACK_IMPORTED_MODULE_3__[\"mapValues\"])(state, function (annotationsForBlock) {\n var hasChangedRange = false;\n var newAnnotations = annotationsForBlock.map(function (annotation) {\n if (annotation.id === action.annotationId) {\n hasChangedRange = true;\n return Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_2__[\"default\"])({}, annotation, {\n range: {\n start: action.start,\n end: action.end\n }\n });\n }\n\n return annotation;\n });\n return hasChangedRange ? newAnnotations : annotationsForBlock;\n });\n\n case 'ANNOTATION_REMOVE_SOURCE':\n return Object(lodash__WEBPACK_IMPORTED_MODULE_3__[\"mapValues\"])(state, function (annotationsForBlock) {\n return filterWithReference(annotationsForBlock, function (annotation) {\n return annotation.source !== action.source;\n });\n });\n }\n\n return state;\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (annotations);\n\n\n//# sourceURL=webpack://wp.%5Bname%5D/./node_modules/@wordpress/annotations/build-module/store/reducer.js?"); /***/ }), @@ -888,92 +275,7 @@ function annotations() { /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__experimentalGetAnnotationsForBlock", function() { return __experimentalGetAnnotationsForBlock; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__experimentalGetAllAnnotationsForBlock", function() { return __experimentalGetAllAnnotationsForBlock; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__experimentalGetAnnotationsForRichText", function() { return __experimentalGetAnnotationsForRichText; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__experimentalGetAnnotations", function() { return __experimentalGetAnnotations; }); -/* harmony import */ var _babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectSpread */ "./node_modules/@babel/runtime/helpers/esm/objectSpread.js"); -/* harmony import */ var _babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutProperties */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js"); -/* harmony import */ var rememo__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! rememo */ "./node_modules/rememo/es/rememo.js"); -/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! lodash */ "lodash"); -/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_3__); - - - -/** - * External dependencies - */ - - -/** - * Shared reference to an empty array for cases where it is important to avoid - * returning a new array reference on every invocation, as in a connected or - * other pure component which performs `shouldComponentUpdate` check on props. - * This should be used as a last resort, since the normalized data should be - * maintained by the reducer result in state. - * - * @type {Array} - */ - -var EMPTY_ARRAY = []; -/** - * Returns the annotations for a specific client ID. - * - * @param {Object} state Editor state. - * @param {string} clientId The ID of the block to get the annotations for. - * - * @return {Array} The annotations applicable to this block. - */ - -var __experimentalGetAnnotationsForBlock = Object(rememo__WEBPACK_IMPORTED_MODULE_2__["default"])(function (state, blockClientId) { - return Object(lodash__WEBPACK_IMPORTED_MODULE_3__["get"])(state, blockClientId, []).filter(function (annotation) { - return annotation.selector === 'block'; - }); -}, function (state, blockClientId) { - return [Object(lodash__WEBPACK_IMPORTED_MODULE_3__["get"])(state, blockClientId, EMPTY_ARRAY)]; -}); -var __experimentalGetAllAnnotationsForBlock = function __experimentalGetAllAnnotationsForBlock(state, blockClientId) { - return Object(lodash__WEBPACK_IMPORTED_MODULE_3__["get"])(state, blockClientId, EMPTY_ARRAY); -}; -/** - * Returns the annotations that apply to the given RichText instance. - * - * Both a blockClientId and a richTextIdentifier are required. This is because - * a block might have multiple `RichText` components. This does mean that every - * block needs to implement annotations itself. - * - * @param {Object} state Editor state. - * @param {string} blockClientId The client ID for the block. - * @param {string} richTextIdentifier Unique identifier that identifies the given RichText. - * @return {Array} All the annotations relevant for the `RichText`. - */ - -var __experimentalGetAnnotationsForRichText = Object(rememo__WEBPACK_IMPORTED_MODULE_2__["default"])(function (state, blockClientId, richTextIdentifier) { - return Object(lodash__WEBPACK_IMPORTED_MODULE_3__["get"])(state, blockClientId, []).filter(function (annotation) { - return annotation.selector === 'range' && richTextIdentifier === annotation.richTextIdentifier; - }).map(function (annotation) { - var range = annotation.range, - other = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__["default"])(annotation, ["range"]); - - return Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__["default"])({}, range, other); - }); -}, function (state, blockClientId) { - return [Object(lodash__WEBPACK_IMPORTED_MODULE_3__["get"])(state, blockClientId, EMPTY_ARRAY)]; -}); -/** - * Returns all annotations in the editor state. - * - * @param {Object} state Editor state. - * @return {Array} All annotations currently applied. - */ - -function __experimentalGetAnnotations(state) { - return Object(lodash__WEBPACK_IMPORTED_MODULE_3__["flatMap"])(state, function (annotations) { - return annotations; - }); -} - +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__experimentalGetAnnotationsForBlock\", function() { return __experimentalGetAnnotationsForBlock; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__experimentalGetAllAnnotationsForBlock\", function() { return __experimentalGetAllAnnotationsForBlock; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__experimentalGetAnnotationsForRichText\", function() { return __experimentalGetAnnotationsForRichText; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__experimentalGetAnnotations\", function() { return __experimentalGetAnnotations; });\n/* harmony import */ var _babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectSpread */ \"./node_modules/@babel/runtime/helpers/esm/objectSpread.js\");\n/* harmony import */ var _babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutProperties */ \"./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js\");\n/* harmony import */ var rememo__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! rememo */ \"./node_modules/rememo/es/rememo.js\");\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! lodash */ \"lodash\");\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_3__);\n\n\n\n/**\n * External dependencies\n */\n\n\n/**\n * Shared reference to an empty array for cases where it is important to avoid\n * returning a new array reference on every invocation, as in a connected or\n * other pure component which performs `shouldComponentUpdate` check on props.\n * This should be used as a last resort, since the normalized data should be\n * maintained by the reducer result in state.\n *\n * @type {Array}\n */\n\nvar EMPTY_ARRAY = [];\n/**\n * Returns the annotations for a specific client ID.\n *\n * @param {Object} state Editor state.\n * @param {string} clientId The ID of the block to get the annotations for.\n *\n * @return {Array} The annotations applicable to this block.\n */\n\nvar __experimentalGetAnnotationsForBlock = Object(rememo__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(function (state, blockClientId) {\n return Object(lodash__WEBPACK_IMPORTED_MODULE_3__[\"get\"])(state, blockClientId, []).filter(function (annotation) {\n return annotation.selector === 'block';\n });\n}, function (state, blockClientId) {\n return [Object(lodash__WEBPACK_IMPORTED_MODULE_3__[\"get\"])(state, blockClientId, EMPTY_ARRAY)];\n});\nvar __experimentalGetAllAnnotationsForBlock = function __experimentalGetAllAnnotationsForBlock(state, blockClientId) {\n return Object(lodash__WEBPACK_IMPORTED_MODULE_3__[\"get\"])(state, blockClientId, EMPTY_ARRAY);\n};\n/**\n * Returns the annotations that apply to the given RichText instance.\n *\n * Both a blockClientId and a richTextIdentifier are required. This is because\n * a block might have multiple `RichText` components. This does mean that every\n * block needs to implement annotations itself.\n *\n * @param {Object} state Editor state.\n * @param {string} blockClientId The client ID for the block.\n * @param {string} richTextIdentifier Unique identifier that identifies the given RichText.\n * @return {Array} All the annotations relevant for the `RichText`.\n */\n\nvar __experimentalGetAnnotationsForRichText = Object(rememo__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(function (state, blockClientId, richTextIdentifier) {\n return Object(lodash__WEBPACK_IMPORTED_MODULE_3__[\"get\"])(state, blockClientId, []).filter(function (annotation) {\n return annotation.selector === 'range' && richTextIdentifier === annotation.richTextIdentifier;\n }).map(function (annotation) {\n var range = annotation.range,\n other = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(annotation, [\"range\"]);\n\n return Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__[\"default\"])({}, range, other);\n });\n}, function (state, blockClientId) {\n return [Object(lodash__WEBPACK_IMPORTED_MODULE_3__[\"get\"])(state, blockClientId, EMPTY_ARRAY)];\n});\n/**\n * Returns all annotations in the editor state.\n *\n * @param {Object} state Editor state.\n * @return {Array} All annotations currently applied.\n */\n\nfunction __experimentalGetAnnotations(state) {\n return Object(lodash__WEBPACK_IMPORTED_MODULE_3__[\"flatMap\"])(state, function (annotations) {\n return annotations;\n });\n}\n\n\n//# sourceURL=webpack://wp.%5Bname%5D/./node_modules/@wordpress/annotations/build-module/store/selectors.js?"); /***/ }), @@ -984,118 +286,7 @@ function __experimentalGetAnnotations(state) { /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { -module.exports = function memize( fn, options ) { - var size = 0, - maxSize, head, tail; - - if ( options && options.maxSize ) { - maxSize = options.maxSize; - } - - function memoized( /* ...args */ ) { - var node = head, - len = arguments.length, - args, i; - - searchCache: while ( node ) { - // Perform a shallow equality test to confirm that whether the node - // under test is a candidate for the arguments passed. Two arrays - // are shallowly equal if their length matches and each entry is - // strictly equal between the two sets. Avoid abstracting to a - // function which could incur an arguments leaking deoptimization. - - // Check whether node arguments match arguments length - if ( node.args.length !== arguments.length ) { - node = node.next; - continue; - } - - // Check whether node arguments match arguments values - for ( i = 0; i < len; i++ ) { - if ( node.args[ i ] !== arguments[ i ] ) { - node = node.next; - continue searchCache; - } - } - - // At this point we can assume we've found a match - - // Surface matched node to head if not already - if ( node !== head ) { - // As tail, shift to previous. Must only shift if not also - // head, since if both head and tail, there is no previous. - if ( node === tail ) { - tail = node.prev; - } - - // Adjust siblings to point to each other. If node was tail, - // this also handles new tail's empty `next` assignment. - node.prev.next = node.next; - if ( node.next ) { - node.next.prev = node.prev; - } - - node.next = head; - node.prev = null; - head.prev = node; - head = node; - } - - // Return immediately - return node.val; - } - - // No cached value found. Continue to insertion phase: - - // Create a copy of arguments (avoid leaking deoptimization) - args = new Array( len ); - for ( i = 0; i < len; i++ ) { - args[ i ] = arguments[ i ]; - } - - node = { - args: args, - - // Generate the result from original function - val: fn.apply( null, args ) - }; - - // Don't need to check whether node is already head, since it would - // have been returned above already if it was - - // Shift existing head down list - if ( head ) { - head.prev = node; - node.next = head; - } else { - // If no head, follows that there's no tail (at initial or reset) - tail = node; - } - - // Trim tail if we're reached max size and are pending cache insertion - if ( size === maxSize ) { - tail = tail.prev; - tail.next = null; - } else { - size++; - } - - head = node; - - return node.val; - } - - memoized.clear = function() { - head = null; - tail = null; - size = 0; - }; - - if ( false ) {} - - return memoized; -}; - +eval("module.exports = function memize( fn, options ) {\n\tvar size = 0,\n\t\tmaxSize, head, tail;\n\n\tif ( options && options.maxSize ) {\n\t\tmaxSize = options.maxSize;\n\t}\n\n\tfunction memoized( /* ...args */ ) {\n\t\tvar node = head,\n\t\t\tlen = arguments.length,\n\t\t\targs, i;\n\n\t\tsearchCache: while ( node ) {\n\t\t\t// Perform a shallow equality test to confirm that whether the node\n\t\t\t// under test is a candidate for the arguments passed. Two arrays\n\t\t\t// are shallowly equal if their length matches and each entry is\n\t\t\t// strictly equal between the two sets. Avoid abstracting to a\n\t\t\t// function which could incur an arguments leaking deoptimization.\n\n\t\t\t// Check whether node arguments match arguments length\n\t\t\tif ( node.args.length !== arguments.length ) {\n\t\t\t\tnode = node.next;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Check whether node arguments match arguments values\n\t\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\t\tif ( node.args[ i ] !== arguments[ i ] ) {\n\t\t\t\t\tnode = node.next;\n\t\t\t\t\tcontinue searchCache;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// At this point we can assume we've found a match\n\n\t\t\t// Surface matched node to head if not already\n\t\t\tif ( node !== head ) {\n\t\t\t\t// As tail, shift to previous. Must only shift if not also\n\t\t\t\t// head, since if both head and tail, there is no previous.\n\t\t\t\tif ( node === tail ) {\n\t\t\t\t\ttail = node.prev;\n\t\t\t\t}\n\n\t\t\t\t// Adjust siblings to point to each other. If node was tail,\n\t\t\t\t// this also handles new tail's empty `next` assignment.\n\t\t\t\tnode.prev.next = node.next;\n\t\t\t\tif ( node.next ) {\n\t\t\t\t\tnode.next.prev = node.prev;\n\t\t\t\t}\n\n\t\t\t\tnode.next = head;\n\t\t\t\tnode.prev = null;\n\t\t\t\thead.prev = node;\n\t\t\t\thead = node;\n\t\t\t}\n\n\t\t\t// Return immediately\n\t\t\treturn node.val;\n\t\t}\n\n\t\t// No cached value found. Continue to insertion phase:\n\n\t\t// Create a copy of arguments (avoid leaking deoptimization)\n\t\targs = new Array( len );\n\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\targs[ i ] = arguments[ i ];\n\t\t}\n\n\t\tnode = {\n\t\t\targs: args,\n\n\t\t\t// Generate the result from original function\n\t\t\tval: fn.apply( null, args )\n\t\t};\n\n\t\t// Don't need to check whether node is already head, since it would\n\t\t// have been returned above already if it was\n\n\t\t// Shift existing head down list\n\t\tif ( head ) {\n\t\t\thead.prev = node;\n\t\t\tnode.next = head;\n\t\t} else {\n\t\t\t// If no head, follows that there's no tail (at initial or reset)\n\t\t\ttail = node;\n\t\t}\n\n\t\t// Trim tail if we're reached max size and are pending cache insertion\n\t\tif ( size === maxSize ) {\n\t\t\ttail = tail.prev;\n\t\t\ttail.next = null;\n\t\t} else {\n\t\t\tsize++;\n\t\t}\n\n\t\thead = node;\n\n\t\treturn node.val;\n\t}\n\n\tmemoized.clear = function() {\n\t\thead = null;\n\t\ttail = null;\n\t\tsize = 0;\n\t};\n\n\tif ( false ) {}\n\n\treturn memoized;\n};\n\n\n//# sourceURL=webpack://wp.%5Bname%5D/./node_modules/memize/index.js?"); /***/ }), @@ -1107,282 +298,7 @@ module.exports = function memize( fn, options ) { /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -__webpack_require__.r(__webpack_exports__); - - -var LEAF_KEY, hasWeakMap; - -/** - * Arbitrary value used as key for referencing cache object in WeakMap tree. - * - * @type {Object} - */ -LEAF_KEY = {}; - -/** - * Whether environment supports WeakMap. - * - * @type {boolean} - */ -hasWeakMap = typeof WeakMap !== 'undefined'; - -/** - * Returns the first argument as the sole entry in an array. - * - * @param {*} value Value to return. - * - * @return {Array} Value returned as entry in array. - */ -function arrayOf( value ) { - return [ value ]; -} - -/** - * Returns true if the value passed is object-like, or false otherwise. A value - * is object-like if it can support property assignment, e.g. object or array. - * - * @param {*} value Value to test. - * - * @return {boolean} Whether value is object-like. - */ -function isObjectLike( value ) { - return !! value && 'object' === typeof value; -} - -/** - * Creates and returns a new cache object. - * - * @return {Object} Cache object. - */ -function createCache() { - var cache = { - clear: function() { - cache.head = null; - }, - }; - - return cache; -} - -/** - * Returns true if entries within the two arrays are strictly equal by - * reference from a starting index. - * - * @param {Array} a First array. - * @param {Array} b Second array. - * @param {number} fromIndex Index from which to start comparison. - * - * @return {boolean} Whether arrays are shallowly equal. - */ -function isShallowEqual( a, b, fromIndex ) { - var i; - - if ( a.length !== b.length ) { - return false; - } - - for ( i = fromIndex; i < a.length; i++ ) { - if ( a[ i ] !== b[ i ] ) { - return false; - } - } - - return true; -} - -/** - * Returns a memoized selector function. The getDependants function argument is - * called before the memoized selector and is expected to return an immutable - * reference or array of references on which the selector depends for computing - * its own return value. The memoize cache is preserved only as long as those - * dependant references remain the same. If getDependants returns a different - * reference(s), the cache is cleared and the selector value regenerated. - * - * @param {Function} selector Selector function. - * @param {Function} getDependants Dependant getter returning an immutable - * reference or array of reference used in - * cache bust consideration. - * - * @return {Function} Memoized selector. - */ -/* harmony default export */ __webpack_exports__["default"] = (function( selector, getDependants ) { - var rootCache, getCache; - - // Use object source as dependant if getter not provided - if ( ! getDependants ) { - getDependants = arrayOf; - } - - /** - * Returns the root cache. If WeakMap is supported, this is assigned to the - * root WeakMap cache set, otherwise it is a shared instance of the default - * cache object. - * - * @return {(WeakMap|Object)} Root cache object. - */ - function getRootCache() { - return rootCache; - } - - /** - * Returns the cache for a given dependants array. When possible, a WeakMap - * will be used to create a unique cache for each set of dependants. This - * is feasible due to the nature of WeakMap in allowing garbage collection - * to occur on entries where the key object is no longer referenced. Since - * WeakMap requires the key to be an object, this is only possible when the - * dependant is object-like. The root cache is created as a hierarchy where - * each top-level key is the first entry in a dependants set, the value a - * WeakMap where each key is the next dependant, and so on. This continues - * so long as the dependants are object-like. If no dependants are object- - * like, then the cache is shared across all invocations. - * - * @see isObjectLike - * - * @param {Array} dependants Selector dependants. - * - * @return {Object} Cache object. - */ - function getWeakMapCache( dependants ) { - var caches = rootCache, - isUniqueByDependants = true, - i, dependant, map, cache; - - for ( i = 0; i < dependants.length; i++ ) { - dependant = dependants[ i ]; - - // Can only compose WeakMap from object-like key. - if ( ! isObjectLike( dependant ) ) { - isUniqueByDependants = false; - break; - } - - // Does current segment of cache already have a WeakMap? - if ( caches.has( dependant ) ) { - // Traverse into nested WeakMap. - caches = caches.get( dependant ); - } else { - // Create, set, and traverse into a new one. - map = new WeakMap(); - caches.set( dependant, map ); - caches = map; - } - } - - // We use an arbitrary (but consistent) object as key for the last item - // in the WeakMap to serve as our running cache. - if ( ! caches.has( LEAF_KEY ) ) { - cache = createCache(); - cache.isUniqueByDependants = isUniqueByDependants; - caches.set( LEAF_KEY, cache ); - } - - return caches.get( LEAF_KEY ); - } - - // Assign cache handler by availability of WeakMap - getCache = hasWeakMap ? getWeakMapCache : getRootCache; - - /** - * Resets root memoization cache. - */ - function clear() { - rootCache = hasWeakMap ? new WeakMap() : createCache(); - } - - // eslint-disable-next-line jsdoc/check-param-names - /** - * The augmented selector call, considering first whether dependants have - * changed before passing it to underlying memoize function. - * - * @param {Object} source Source object for derivation. - * @param {...*} extraArgs Additional arguments to pass to selector. - * - * @return {*} Selector result. - */ - function callSelector( /* source, ...extraArgs */ ) { - var len = arguments.length, - cache, node, i, args, dependants; - - // Create copy of arguments (avoid leaking deoptimization). - args = new Array( len ); - for ( i = 0; i < len; i++ ) { - args[ i ] = arguments[ i ]; - } - - dependants = getDependants.apply( null, args ); - cache = getCache( dependants ); - - // If not guaranteed uniqueness by dependants (primitive type or lack - // of WeakMap support), shallow compare against last dependants and, if - // references have changed, destroy cache to recalculate result. - if ( ! cache.isUniqueByDependants ) { - if ( cache.lastDependants && ! isShallowEqual( dependants, cache.lastDependants, 0 ) ) { - cache.clear(); - } - - cache.lastDependants = dependants; - } - - node = cache.head; - while ( node ) { - // Check whether node arguments match arguments - if ( ! isShallowEqual( node.args, args, 1 ) ) { - node = node.next; - continue; - } - - // At this point we can assume we've found a match - - // Surface matched node to head if not already - if ( node !== cache.head ) { - // Adjust siblings to point to each other. - node.prev.next = node.next; - if ( node.next ) { - node.next.prev = node.prev; - } - - node.next = cache.head; - node.prev = null; - cache.head.prev = node; - cache.head = node; - } - - // Return immediately - return node.val; - } - - // No cached value found. Continue to insertion phase: - - node = { - // Generate the result from original function - val: selector.apply( null, args ), - }; - - // Avoid including the source object in the cache. - args[ 0 ] = null; - node.args = args; - - // Don't need to check whether node is already head, since it would - // have been returned above already if it was - - // Shift existing head down list - if ( cache.head ) { - cache.head.prev = node; - node.next = cache.head; - } - - cache.head = node; - - return node.val; - } - - callSelector.getDependants = getDependants; - callSelector.clear = clear; - clear(); - - return callSelector; -}); - +eval("__webpack_require__.r(__webpack_exports__);\n\n\nvar LEAF_KEY, hasWeakMap;\n\n/**\n * Arbitrary value used as key for referencing cache object in WeakMap tree.\n *\n * @type {Object}\n */\nLEAF_KEY = {};\n\n/**\n * Whether environment supports WeakMap.\n *\n * @type {boolean}\n */\nhasWeakMap = typeof WeakMap !== 'undefined';\n\n/**\n * Returns the first argument as the sole entry in an array.\n *\n * @param {*} value Value to return.\n *\n * @return {Array} Value returned as entry in array.\n */\nfunction arrayOf( value ) {\n\treturn [ value ];\n}\n\n/**\n * Returns true if the value passed is object-like, or false otherwise. A value\n * is object-like if it can support property assignment, e.g. object or array.\n *\n * @param {*} value Value to test.\n *\n * @return {boolean} Whether value is object-like.\n */\nfunction isObjectLike( value ) {\n\treturn !! value && 'object' === typeof value;\n}\n\n/**\n * Creates and returns a new cache object.\n *\n * @return {Object} Cache object.\n */\nfunction createCache() {\n\tvar cache = {\n\t\tclear: function() {\n\t\t\tcache.head = null;\n\t\t},\n\t};\n\n\treturn cache;\n}\n\n/**\n * Returns true if entries within the two arrays are strictly equal by\n * reference from a starting index.\n *\n * @param {Array} a First array.\n * @param {Array} b Second array.\n * @param {number} fromIndex Index from which to start comparison.\n *\n * @return {boolean} Whether arrays are shallowly equal.\n */\nfunction isShallowEqual( a, b, fromIndex ) {\n\tvar i;\n\n\tif ( a.length !== b.length ) {\n\t\treturn false;\n\t}\n\n\tfor ( i = fromIndex; i < a.length; i++ ) {\n\t\tif ( a[ i ] !== b[ i ] ) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\treturn true;\n}\n\n/**\n * Returns a memoized selector function. The getDependants function argument is\n * called before the memoized selector and is expected to return an immutable\n * reference or array of references on which the selector depends for computing\n * its own return value. The memoize cache is preserved only as long as those\n * dependant references remain the same. If getDependants returns a different\n * reference(s), the cache is cleared and the selector value regenerated.\n *\n * @param {Function} selector Selector function.\n * @param {Function} getDependants Dependant getter returning an immutable\n * reference or array of reference used in\n * cache bust consideration.\n *\n * @return {Function} Memoized selector.\n */\n/* harmony default export */ __webpack_exports__[\"default\"] = (function( selector, getDependants ) {\n\tvar rootCache, getCache;\n\n\t// Use object source as dependant if getter not provided\n\tif ( ! getDependants ) {\n\t\tgetDependants = arrayOf;\n\t}\n\n\t/**\n\t * Returns the root cache. If WeakMap is supported, this is assigned to the\n\t * root WeakMap cache set, otherwise it is a shared instance of the default\n\t * cache object.\n\t *\n\t * @return {(WeakMap|Object)} Root cache object.\n\t */\n\tfunction getRootCache() {\n\t\treturn rootCache;\n\t}\n\n\t/**\n\t * Returns the cache for a given dependants array. When possible, a WeakMap\n\t * will be used to create a unique cache for each set of dependants. This\n\t * is feasible due to the nature of WeakMap in allowing garbage collection\n\t * to occur on entries where the key object is no longer referenced. Since\n\t * WeakMap requires the key to be an object, this is only possible when the\n\t * dependant is object-like. The root cache is created as a hierarchy where\n\t * each top-level key is the first entry in a dependants set, the value a\n\t * WeakMap where each key is the next dependant, and so on. This continues\n\t * so long as the dependants are object-like. If no dependants are object-\n\t * like, then the cache is shared across all invocations.\n\t *\n\t * @see isObjectLike\n\t *\n\t * @param {Array} dependants Selector dependants.\n\t *\n\t * @return {Object} Cache object.\n\t */\n\tfunction getWeakMapCache( dependants ) {\n\t\tvar caches = rootCache,\n\t\t\tisUniqueByDependants = true,\n\t\t\ti, dependant, map, cache;\n\n\t\tfor ( i = 0; i < dependants.length; i++ ) {\n\t\t\tdependant = dependants[ i ];\n\n\t\t\t// Can only compose WeakMap from object-like key.\n\t\t\tif ( ! isObjectLike( dependant ) ) {\n\t\t\t\tisUniqueByDependants = false;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t// Does current segment of cache already have a WeakMap?\n\t\t\tif ( caches.has( dependant ) ) {\n\t\t\t\t// Traverse into nested WeakMap.\n\t\t\t\tcaches = caches.get( dependant );\n\t\t\t} else {\n\t\t\t\t// Create, set, and traverse into a new one.\n\t\t\t\tmap = new WeakMap();\n\t\t\t\tcaches.set( dependant, map );\n\t\t\t\tcaches = map;\n\t\t\t}\n\t\t}\n\n\t\t// We use an arbitrary (but consistent) object as key for the last item\n\t\t// in the WeakMap to serve as our running cache.\n\t\tif ( ! caches.has( LEAF_KEY ) ) {\n\t\t\tcache = createCache();\n\t\t\tcache.isUniqueByDependants = isUniqueByDependants;\n\t\t\tcaches.set( LEAF_KEY, cache );\n\t\t}\n\n\t\treturn caches.get( LEAF_KEY );\n\t}\n\n\t// Assign cache handler by availability of WeakMap\n\tgetCache = hasWeakMap ? getWeakMapCache : getRootCache;\n\n\t/**\n\t * Resets root memoization cache.\n\t */\n\tfunction clear() {\n\t\trootCache = hasWeakMap ? new WeakMap() : createCache();\n\t}\n\n\t// eslint-disable-next-line jsdoc/check-param-names\n\t/**\n\t * The augmented selector call, considering first whether dependants have\n\t * changed before passing it to underlying memoize function.\n\t *\n\t * @param {Object} source Source object for derivation.\n\t * @param {...*} extraArgs Additional arguments to pass to selector.\n\t *\n\t * @return {*} Selector result.\n\t */\n\tfunction callSelector( /* source, ...extraArgs */ ) {\n\t\tvar len = arguments.length,\n\t\t\tcache, node, i, args, dependants;\n\n\t\t// Create copy of arguments (avoid leaking deoptimization).\n\t\targs = new Array( len );\n\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\targs[ i ] = arguments[ i ];\n\t\t}\n\n\t\tdependants = getDependants.apply( null, args );\n\t\tcache = getCache( dependants );\n\n\t\t// If not guaranteed uniqueness by dependants (primitive type or lack\n\t\t// of WeakMap support), shallow compare against last dependants and, if\n\t\t// references have changed, destroy cache to recalculate result.\n\t\tif ( ! cache.isUniqueByDependants ) {\n\t\t\tif ( cache.lastDependants && ! isShallowEqual( dependants, cache.lastDependants, 0 ) ) {\n\t\t\t\tcache.clear();\n\t\t\t}\n\n\t\t\tcache.lastDependants = dependants;\n\t\t}\n\n\t\tnode = cache.head;\n\t\twhile ( node ) {\n\t\t\t// Check whether node arguments match arguments\n\t\t\tif ( ! isShallowEqual( node.args, args, 1 ) ) {\n\t\t\t\tnode = node.next;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// At this point we can assume we've found a match\n\n\t\t\t// Surface matched node to head if not already\n\t\t\tif ( node !== cache.head ) {\n\t\t\t\t// Adjust siblings to point to each other.\n\t\t\t\tnode.prev.next = node.next;\n\t\t\t\tif ( node.next ) {\n\t\t\t\t\tnode.next.prev = node.prev;\n\t\t\t\t}\n\n\t\t\t\tnode.next = cache.head;\n\t\t\t\tnode.prev = null;\n\t\t\t\tcache.head.prev = node;\n\t\t\t\tcache.head = node;\n\t\t\t}\n\n\t\t\t// Return immediately\n\t\t\treturn node.val;\n\t\t}\n\n\t\t// No cached value found. Continue to insertion phase:\n\n\t\tnode = {\n\t\t\t// Generate the result from original function\n\t\t\tval: selector.apply( null, args ),\n\t\t};\n\n\t\t// Avoid including the source object in the cache.\n\t\targs[ 0 ] = null;\n\t\tnode.args = args;\n\n\t\t// Don't need to check whether node is already head, since it would\n\t\t// have been returned above already if it was\n\n\t\t// Shift existing head down list\n\t\tif ( cache.head ) {\n\t\t\tcache.head.prev = node;\n\t\t\tnode.next = cache.head;\n\t\t}\n\n\t\tcache.head = node;\n\n\t\treturn node.val;\n\t}\n\n\tcallSelector.getDependants = getDependants;\n\tcallSelector.clear = clear;\n\tclear();\n\n\treturn callSelector;\n});\n\n\n//# sourceURL=webpack://wp.%5Bname%5D/./node_modules/rememo/es/rememo.js?"); /***/ }), @@ -1393,31 +309,7 @@ function isShallowEqual( a, b, fromIndex ) { /*! no static exports found */ /***/ (function(module, exports) { -/** - * Convert array of 16 byte values to UUID string format of the form: - * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX - */ -var byteToHex = []; -for (var i = 0; i < 256; ++i) { - byteToHex[i] = (i + 0x100).toString(16).substr(1); -} - -function bytesToUuid(buf, offset) { - var i = offset || 0; - var bth = byteToHex; - // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4 - return ([bth[buf[i++]], bth[buf[i++]], - bth[buf[i++]], bth[buf[i++]], '-', - bth[buf[i++]], bth[buf[i++]], '-', - bth[buf[i++]], bth[buf[i++]], '-', - bth[buf[i++]], bth[buf[i++]], '-', - bth[buf[i++]], bth[buf[i++]], - bth[buf[i++]], bth[buf[i++]], - bth[buf[i++]], bth[buf[i++]]]).join(''); -} - -module.exports = bytesToUuid; - +eval("/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\nvar byteToHex = [];\nfor (var i = 0; i < 256; ++i) {\n byteToHex[i] = (i + 0x100).toString(16).substr(1);\n}\n\nfunction bytesToUuid(buf, offset) {\n var i = offset || 0;\n var bth = byteToHex;\n // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4\n return ([bth[buf[i++]], bth[buf[i++]], \n\tbth[buf[i++]], bth[buf[i++]], '-',\n\tbth[buf[i++]], bth[buf[i++]], '-',\n\tbth[buf[i++]], bth[buf[i++]], '-',\n\tbth[buf[i++]], bth[buf[i++]], '-',\n\tbth[buf[i++]], bth[buf[i++]],\n\tbth[buf[i++]], bth[buf[i++]],\n\tbth[buf[i++]], bth[buf[i++]]]).join('');\n}\n\nmodule.exports = bytesToUuid;\n\n\n//# sourceURL=webpack://wp.%5Bname%5D/./node_modules/uuid/lib/bytesToUuid.js?"); /***/ }), @@ -1428,41 +320,7 @@ module.exports = bytesToUuid; /*! no static exports found */ /***/ (function(module, exports) { -// Unique ID creation requires a high quality random # generator. In the -// browser this is a little complicated due to unknown quality of Math.random() -// and inconsistent support for the `crypto` API. We do the best we can via -// feature-detection - -// getRandomValues needs to be invoked in a context where "this" is a Crypto -// implementation. Also, find the complete implementation of crypto on IE11. -var getRandomValues = (typeof(crypto) != 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto)) || - (typeof(msCrypto) != 'undefined' && typeof window.msCrypto.getRandomValues == 'function' && msCrypto.getRandomValues.bind(msCrypto)); - -if (getRandomValues) { - // WHATWG crypto RNG - http://wiki.whatwg.org/wiki/Crypto - var rnds8 = new Uint8Array(16); // eslint-disable-line no-undef - - module.exports = function whatwgRNG() { - getRandomValues(rnds8); - return rnds8; - }; -} else { - // Math.random()-based (RNG) - // - // If all else fails, use Math.random(). It's fast, but is of unspecified - // quality. - var rnds = new Array(16); - - module.exports = function mathRNG() { - for (var i = 0, r; i < 16; i++) { - if ((i & 0x03) === 0) r = Math.random() * 0x100000000; - rnds[i] = r >>> ((i & 0x03) << 3) & 0xff; - } - - return rnds; - }; -} - +eval("// Unique ID creation requires a high quality random # generator. In the\n// browser this is a little complicated due to unknown quality of Math.random()\n// and inconsistent support for the `crypto` API. We do the best we can via\n// feature-detection\n\n// getRandomValues needs to be invoked in a context where \"this\" is a Crypto\n// implementation. Also, find the complete implementation of crypto on IE11.\nvar getRandomValues = (typeof(crypto) != 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto)) ||\n (typeof(msCrypto) != 'undefined' && typeof window.msCrypto.getRandomValues == 'function' && msCrypto.getRandomValues.bind(msCrypto));\n\nif (getRandomValues) {\n // WHATWG crypto RNG - http://wiki.whatwg.org/wiki/Crypto\n var rnds8 = new Uint8Array(16); // eslint-disable-line no-undef\n\n module.exports = function whatwgRNG() {\n getRandomValues(rnds8);\n return rnds8;\n };\n} else {\n // Math.random()-based (RNG)\n //\n // If all else fails, use Math.random(). It's fast, but is of unspecified\n // quality.\n var rnds = new Array(16);\n\n module.exports = function mathRNG() {\n for (var i = 0, r; i < 16; i++) {\n if ((i & 0x03) === 0) r = Math.random() * 0x100000000;\n rnds[i] = r >>> ((i & 0x03) << 3) & 0xff;\n }\n\n return rnds;\n };\n}\n\n\n//# sourceURL=webpack://wp.%5Bname%5D/./node_modules/uuid/lib/rng-browser.js?"); /***/ }), @@ -1473,36 +331,7 @@ if (getRandomValues) { /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { -var rng = __webpack_require__(/*! ./lib/rng */ "./node_modules/uuid/lib/rng-browser.js"); -var bytesToUuid = __webpack_require__(/*! ./lib/bytesToUuid */ "./node_modules/uuid/lib/bytesToUuid.js"); - -function v4(options, buf, offset) { - var i = buf && offset || 0; - - if (typeof(options) == 'string') { - buf = options === 'binary' ? new Array(16) : null; - options = null; - } - options = options || {}; - - var rnds = options.random || (options.rng || rng)(); - - // Per 4.4, set bits for version and `clock_seq_hi_and_reserved` - rnds[6] = (rnds[6] & 0x0f) | 0x40; - rnds[8] = (rnds[8] & 0x3f) | 0x80; - - // Copy bytes to buffer, if provided - if (buf) { - for (var ii = 0; ii < 16; ++ii) { - buf[i + ii] = rnds[ii]; - } - } - - return buf || bytesToUuid(rnds); -} - -module.exports = v4; - +eval("var rng = __webpack_require__(/*! ./lib/rng */ \"./node_modules/uuid/lib/rng-browser.js\");\nvar bytesToUuid = __webpack_require__(/*! ./lib/bytesToUuid */ \"./node_modules/uuid/lib/bytesToUuid.js\");\n\nfunction v4(options, buf, offset) {\n var i = buf && offset || 0;\n\n if (typeof(options) == 'string') {\n buf = options === 'binary' ? new Array(16) : null;\n options = null;\n }\n options = options || {};\n\n var rnds = options.random || (options.rng || rng)();\n\n // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n rnds[6] = (rnds[6] & 0x0f) | 0x40;\n rnds[8] = (rnds[8] & 0x3f) | 0x80;\n\n // Copy bytes to buffer, if provided\n if (buf) {\n for (var ii = 0; ii < 16; ++ii) {\n buf[i + ii] = rnds[ii];\n }\n }\n\n return buf || bytesToUuid(rnds);\n}\n\nmodule.exports = v4;\n\n\n//# sourceURL=webpack://wp.%5Bname%5D/./node_modules/uuid/v4.js?"); /***/ }), @@ -1513,7 +342,7 @@ module.exports = v4; /*! no static exports found */ /***/ (function(module, exports) { -(function() { module.exports = this["wp"]["data"]; }()); +eval("(function() { module.exports = this[\"wp\"][\"data\"]; }());\n\n//# sourceURL=webpack://wp.%5Bname%5D/external_%7B%22this%22:%5B%22wp%22,%22data%22%5D%7D?"); /***/ }), @@ -1524,7 +353,7 @@ module.exports = v4; /*! no static exports found */ /***/ (function(module, exports) { -(function() { module.exports = this["wp"]["hooks"]; }()); +eval("(function() { module.exports = this[\"wp\"][\"hooks\"]; }());\n\n//# sourceURL=webpack://wp.%5Bname%5D/external_%7B%22this%22:%5B%22wp%22,%22hooks%22%5D%7D?"); /***/ }), @@ -1535,7 +364,7 @@ module.exports = v4; /*! no static exports found */ /***/ (function(module, exports) { -(function() { module.exports = this["wp"]["i18n"]; }()); +eval("(function() { module.exports = this[\"wp\"][\"i18n\"]; }());\n\n//# sourceURL=webpack://wp.%5Bname%5D/external_%7B%22this%22:%5B%22wp%22,%22i18n%22%5D%7D?"); /***/ }), @@ -1546,7 +375,7 @@ module.exports = v4; /*! no static exports found */ /***/ (function(module, exports) { -(function() { module.exports = this["wp"]["richText"]; }()); +eval("(function() { module.exports = this[\"wp\"][\"richText\"]; }());\n\n//# sourceURL=webpack://wp.%5Bname%5D/external_%7B%22this%22:%5B%22wp%22,%22richText%22%5D%7D?"); /***/ }), @@ -1557,9 +386,8 @@ module.exports = v4; /*! no static exports found */ /***/ (function(module, exports) { -(function() { module.exports = this["lodash"]; }()); +eval("(function() { module.exports = this[\"lodash\"]; }());\n\n//# sourceURL=webpack://wp.%5Bname%5D/external_%22lodash%22?"); /***/ }) -/******/ }); -//# sourceMappingURL=annotations.js.map \ No newline at end of file +/******/ }); \ No newline at end of file diff --git a/wp-includes/js/dist/annotations.js.map b/wp-includes/js/dist/annotations.js.map deleted file mode 100644 index 6fd996b720..0000000000 --- a/wp-includes/js/dist/annotations.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["webpack://wp.[name]/webpack/bootstrap","webpack://wp.[name]/./node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js","webpack://wp.[name]/./node_modules/@babel/runtime/helpers/esm/defineProperty.js","webpack://wp.[name]/./node_modules/@babel/runtime/helpers/esm/iterableToArray.js","webpack://wp.[name]/./node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js","webpack://wp.[name]/./node_modules/@babel/runtime/helpers/esm/objectSpread.js","webpack://wp.[name]/./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js","webpack://wp.[name]/./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js","webpack://wp.[name]/./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js","webpack://wp.[name]//Users/gziolo/PhpstormProjects/gutenberg/packages/annotations/src/block/index.js","webpack://wp.[name]//Users/gziolo/PhpstormProjects/gutenberg/packages/annotations/src/format/annotation.js","webpack://wp.[name]//Users/gziolo/PhpstormProjects/gutenberg/packages/annotations/src/format/index.js","webpack://wp.[name]//Users/gziolo/PhpstormProjects/gutenberg/packages/annotations/src/index.js","webpack://wp.[name]//Users/gziolo/PhpstormProjects/gutenberg/packages/annotations/src/store/actions.js","webpack://wp.[name]//Users/gziolo/PhpstormProjects/gutenberg/packages/annotations/src/store/index.js","webpack://wp.[name]//Users/gziolo/PhpstormProjects/gutenberg/packages/annotations/src/store/reducer.js","webpack://wp.[name]//Users/gziolo/PhpstormProjects/gutenberg/packages/annotations/src/store/selectors.js","webpack://wp.[name]/./node_modules/memize/index.js","webpack://wp.[name]/./node_modules/rememo/es/rememo.js","webpack://wp.[name]/./node_modules/uuid/lib/bytesToUuid.js","webpack://wp.[name]/./node_modules/uuid/lib/rng-browser.js","webpack://wp.[name]/./node_modules/uuid/v4.js","webpack://wp.[name]/external {\"this\":[\"wp\",\"data\"]}","webpack://wp.[name]/external {\"this\":[\"wp\",\"hooks\"]}","webpack://wp.[name]/external {\"this\":[\"wp\",\"i18n\"]}","webpack://wp.[name]/external {\"this\":[\"wp\",\"richText\"]}","webpack://wp.[name]/external \"lodash\""],"names":["addAnnotationClassName","OriginalComponent","withSelect","select","clientId","annotations","__experimentalGetAnnotationsForBlock","className","map","annotation","source","addFilter","FORMAT_NAME","ANNOTATION_ATTRIBUTE_PREFIX","STORE_KEY","applyAnnotations","record","forEach","start","end","text","length","id","applyFormat","type","attributes","removeAnnotations","removeFormat","retrieveAnnotationPositions","formats","positions","characterFormats","i","filter","format","replace","hasOwnProperty","updateAnnotationsWithPositions","removeAnnotation","updateAnnotationRange","currentAnnotation","position","createPrepareEditableTree","memize","props","getAnnotationObject","name","title","__","tagName","edit","__experimentalGetPropsForEditableTreePreparation","richTextIdentifier","blockClientId","__experimentalGetAnnotationsForRichText","__experimentalCreatePrepareEditableTree","__experimentalGetPropsForEditableTreeChangeHandler","dispatch","__experimentalRemoveAnnotation","__experimentalUpdateAnnotationRange","__experimentalCreateOnChangeEditableValue","settings","registerFormatType","__experimentalAddAnnotation","range","selector","uuid","action","annotationId","__experimentalRemoveAnnotationsBySource","MODULE_KEY","store","registerStore","reducer","selectors","actions","filterWithReference","collection","predicate","filteredCollection","isValidAnnotationRange","isNumber","state","newAnnotation","previousAnnotationsForBlock","get","mapValues","annotationsForBlock","hasChangedRange","newAnnotations","EMPTY_ARRAY","createSelector","__experimentalGetAllAnnotationsForBlock","other","__experimentalGetAnnotations","flatMap"],"mappings":";;AAAA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;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A;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,cAAc,SAAS;AACvB;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,MAAM,KAA+B,GAAG,EAMtC;;AAEF;AACA;;;;;;;;;;;;;ACpHA;AAAa;;AAEb;;AAEA;AACA;AACA;AACA,UAAU;AACV;AACA;;AAEA;AACA;AACA;AACA,UAAU;AACV;AACA;;AAEA;AACA;AACA;AACA,WAAW,EAAE;AACb;AACA,YAAY,MAAM;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,EAAE;AACb;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,MAAM;AACjB,WAAW,OAAO;AAClB;AACA,YAAY,QAAQ;AACpB;AACA;AACA;;AAEA;AACA;AACA;;AAEA,qBAAqB,cAAc;AACnC;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,SAAS;AACpB,WAAW,SAAS;AACpB;AACA;AACA;AACA,YAAY,SAAS;AACrB;AACe;AACf;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAa,iBAAiB;AAC9B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,MAAM;AAClB;AACA,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;;AAEA,cAAc,uBAAuB;AACrC;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,YAAY,OAAO;AACnB,YAAY,KAAK;AACjB;AACA,aAAa,EAAE;AACf;AACA;AACA;AACA;;AAEA;AACA;AACA,cAAc,SAAS;AACvB;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,CAAC;;;;;;;;;;;;ACjRD;AACA;AACA;AACA;AACA;AACA,eAAe,SAAS;AACxB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACvBA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,iCAAiC;;AAEjC;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;;AAEA;AACA,sBAAsB,QAAQ;AAC9B;AACA;AACA;;AAEA;AACA;AACA;;;;;;;;;;;;ACjCA,UAAU,mBAAO,CAAC,yDAAW;AAC7B,kBAAkB,mBAAO,CAAC,iEAAmB;;AAE7C;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,oBAAoB,SAAS;AAC7B;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;AC5BA,aAAa,qCAAqC,EAAE,I;;;;;;;;;;;ACApD,aAAa,sCAAsC,EAAE,I;;;;;;;;;;;ACArD,aAAa,qCAAqC,EAAE,I;;;;;;;;;;;ACApD,aAAa,yCAAyC,EAAE,I;;;;;;;;;;;ACAxD,aAAa,iCAAiC,EAAE,I","file":"annotations.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./node_modules/@wordpress/annotations/build-module/index.js\");\n","export default function _arrayWithoutHoles(arr) {\n if (Array.isArray(arr)) {\n for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) {\n arr2[i] = arr[i];\n }\n\n return arr2;\n }\n}","export default function _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}","export default function _iterableToArray(iter) {\n if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === \"[object Arguments]\") return Array.from(iter);\n}","export default function _nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance\");\n}","import defineProperty from \"./defineProperty\";\nexport default function _objectSpread(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n var ownKeys = Object.keys(source);\n\n if (typeof Object.getOwnPropertySymbols === 'function') {\n ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {\n return Object.getOwnPropertyDescriptor(source, sym).enumerable;\n }));\n }\n\n ownKeys.forEach(function (key) {\n defineProperty(target, key, source[key]);\n });\n }\n\n return target;\n}","import objectWithoutPropertiesLoose from \"./objectWithoutPropertiesLoose\";\nexport default function _objectWithoutProperties(source, excluded) {\n if (source == null) return {};\n var target = objectWithoutPropertiesLoose(source, excluded);\n var key, i;\n\n if (Object.getOwnPropertySymbols) {\n var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n\n for (i = 0; i < sourceSymbolKeys.length; i++) {\n key = sourceSymbolKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n target[key] = source[key];\n }\n }\n\n return target;\n}","export default function _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}","import arrayWithoutHoles from \"./arrayWithoutHoles\";\nimport iterableToArray from \"./iterableToArray\";\nimport nonIterableSpread from \"./nonIterableSpread\";\nexport default function _toConsumableArray(arr) {\n return arrayWithoutHoles(arr) || iterableToArray(arr) || nonIterableSpread();\n}","/**\n * WordPress dependencies\n */\nimport { addFilter } from '@wordpress/hooks';\nimport { withSelect } from '@wordpress/data';\n\n/**\n * Adds annotation className to the block-list-block component.\n *\n * @param {Object} OriginalComponent The original BlockListBlock component.\n * @return {Object} The enhanced component.\n */\nconst addAnnotationClassName = ( OriginalComponent ) => {\n\treturn withSelect( ( select, { clientId } ) => {\n\t\tconst annotations = select( 'core/annotations' ).__experimentalGetAnnotationsForBlock( clientId );\n\n\t\treturn {\n\t\t\tclassName: annotations.map( ( annotation ) => {\n\t\t\t\treturn 'is-annotated-by-' + annotation.source;\n\t\t\t} ),\n\t\t};\n\t} )( OriginalComponent );\n};\n\naddFilter( 'editor.BlockListBlock', 'core/annotations', addAnnotationClassName );\n","/**\n * External dependencies\n */\nimport memize from 'memize';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { applyFormat, removeFormat } from '@wordpress/rich-text';\n\nconst FORMAT_NAME = 'core/annotation';\n\nconst ANNOTATION_ATTRIBUTE_PREFIX = 'annotation-text-';\nconst STORE_KEY = 'core/annotations';\n\n/**\n * Applies given annotations to the given record.\n *\n * @param {Object} record The record to apply annotations to.\n * @param {Array} annotations The annotation to apply.\n * @return {Object} A record with the annotations applied.\n */\nexport function applyAnnotations( record, annotations = [] ) {\n\tannotations.forEach( ( annotation ) => {\n\t\tlet { start, end } = annotation;\n\n\t\tif ( start > record.text.length ) {\n\t\t\tstart = record.text.length;\n\t\t}\n\n\t\tif ( end > record.text.length ) {\n\t\t\tend = record.text.length;\n\t\t}\n\n\t\tconst className = ANNOTATION_ATTRIBUTE_PREFIX + annotation.source;\n\t\tconst id = ANNOTATION_ATTRIBUTE_PREFIX + annotation.id;\n\n\t\trecord = applyFormat(\n\t\t\trecord,\n\t\t\t{\n\t\t\t\ttype: FORMAT_NAME, attributes: {\n\t\t\t\t\tclassName,\n\t\t\t\t\tid,\n\t\t\t\t},\n\t\t\t},\n\t\t\tstart,\n\t\t\tend\n\t\t);\n\t} );\n\n\treturn record;\n}\n\n/**\n * Removes annotations from the given record.\n *\n * @param {Object} record Record to remove annotations from.\n * @return {Object} The cleaned record.\n */\nexport function removeAnnotations( record ) {\n\treturn removeFormat( record, 'core/annotation', 0, record.text.length );\n}\n\n/**\n * Retrieves the positions of annotations inside an array of formats.\n *\n * @param {Array} formats Formats with annotations in there.\n * @return {Object} ID keyed positions of annotations.\n */\nfunction retrieveAnnotationPositions( formats ) {\n\tconst positions = {};\n\n\tformats.forEach( ( characterFormats, i ) => {\n\t\tcharacterFormats = characterFormats || [];\n\t\tcharacterFormats = characterFormats.filter( ( format ) => format.type === FORMAT_NAME );\n\t\tcharacterFormats.forEach( ( format ) => {\n\t\t\tlet { id } = format.attributes;\n\t\t\tid = id.replace( ANNOTATION_ATTRIBUTE_PREFIX, '' );\n\n\t\t\tif ( ! positions.hasOwnProperty( id ) ) {\n\t\t\t\tpositions[ id ] = {\n\t\t\t\t\tstart: i,\n\t\t\t\t};\n\t\t\t}\n\n\t\t\t// Annotations refer to positions between characters.\n\t\t\t// Formats refer to the character themselves.\n\t\t\t// So we need to adjust for that here.\n\t\t\tpositions[ id ].end = i + 1;\n\t\t} );\n\t} );\n\n\treturn positions;\n}\n\n/**\n * Updates annotations in the state based on positions retrieved from RichText.\n *\n * @param {Array} annotations The annotations that are currently applied.\n * @param {Array} positions The current positions of the given annotations.\n * @param {Function} removeAnnotation Function to remove an annotation from the state.\n * @param {Function} updateAnnotationRange Function to update an annotation range in the state.\n */\nfunction updateAnnotationsWithPositions( annotations, positions, { removeAnnotation, updateAnnotationRange } ) {\n\tannotations.forEach( ( currentAnnotation ) => {\n\t\tconst position = positions[ currentAnnotation.id ];\n\t\t// If we cannot find an annotation, delete it.\n\t\tif ( ! position ) {\n\t\t\t// Apparently the annotation has been removed, so remove it from the state:\n\t\t\t// Remove...\n\t\t\tremoveAnnotation( currentAnnotation.id );\n\t\t\treturn;\n\t\t}\n\n\t\tconst { start, end } = currentAnnotation;\n\t\tif ( start !== position.start || end !== position.end ) {\n\t\t\tupdateAnnotationRange( currentAnnotation.id, position.start, position.end );\n\t\t}\n\t} );\n}\n\n/**\n * Create prepareEditableTree memoized based on the annotation props.\n *\n * @param {Object} The props with annotations in them.\n *\n * @return {Function} The prepareEditableTree.\n */\nconst createPrepareEditableTree = memize( ( props ) => {\n\tconst { annotations } = props;\n\n\treturn ( formats, text ) => {\n\t\tif ( annotations.length === 0 ) {\n\t\t\treturn formats;\n\t\t}\n\n\t\tlet record = { formats, text };\n\t\trecord = applyAnnotations( record, annotations );\n\t\treturn record.formats;\n\t};\n} );\n\n/**\n * Returns the annotations as a props object. Memoized to prevent re-renders.\n *\n * @param {Array} The annotations to put in the object.\n *\n * @return {Object} The annotations props object.\n */\nconst getAnnotationObject = memize( ( annotations ) => {\n\treturn {\n\t\tannotations,\n\t};\n} );\n\nexport const annotation = {\n\tname: FORMAT_NAME,\n\ttitle: __( 'Annotation' ),\n\ttagName: 'mark',\n\tclassName: 'annotation-text',\n\tattributes: {\n\t\tclassName: 'class',\n\t\tid: 'id',\n\t},\n\tedit() {\n\t\treturn null;\n\t},\n\t__experimentalGetPropsForEditableTreePreparation( select, { richTextIdentifier, blockClientId } ) {\n\t\treturn getAnnotationObject( select( STORE_KEY ).__experimentalGetAnnotationsForRichText( blockClientId, richTextIdentifier ) );\n\t},\n\t__experimentalCreatePrepareEditableTree: createPrepareEditableTree,\n\t__experimentalGetPropsForEditableTreeChangeHandler( dispatch ) {\n\t\treturn {\n\t\t\tremoveAnnotation: dispatch( STORE_KEY ).__experimentalRemoveAnnotation,\n\t\t\tupdateAnnotationRange: dispatch( STORE_KEY ).__experimentalUpdateAnnotationRange,\n\t\t};\n\t},\n\t__experimentalCreateOnChangeEditableValue( props ) {\n\t\treturn ( formats ) => {\n\t\t\tconst positions = retrieveAnnotationPositions( formats );\n\t\t\tconst { removeAnnotation, updateAnnotationRange, annotations } = props;\n\n\t\t\tupdateAnnotationsWithPositions( annotations, positions, { removeAnnotation, updateAnnotationRange } );\n\t\t};\n\t},\n};\n","/**\n * WordPress dependencies\n */\nimport {\n\tregisterFormatType,\n} from '@wordpress/rich-text';\n\n/**\n * Internal dependencies\n */\nimport { annotation } from './annotation';\n\nconst { name, ...settings } = annotation;\n\nregisterFormatType( name, settings );\n","/**\n * Internal dependencies\n */\nimport './store';\nimport './format';\nimport './block';\n\n","/**\n * External dependencies\n */\nimport uuid from 'uuid/v4';\n\n/**\n * Adds an annotation to a block.\n *\n * The `block` attribute refers to a block ID that needs to be annotated.\n * `isBlockAnnotation` controls whether or not the annotation is a block\n * annotation. The `source` is the source of the annotation, this will be used\n * to identity groups of annotations.\n *\n * The `range` property is only relevant if the selector is 'range'.\n *\n * @param {Object} annotation The annotation to add.\n * @param {string} blockClientId The blockClientId to add the annotation to.\n * @param {string} richTextIdentifier Identifier for the RichText instance the annotation applies to.\n * @param {Object} range The range at which to apply this annotation.\n * @param {number} range.start The offset where the annotation should start.\n * @param {number} range.end The offset where the annotation should end.\n * @param {string} [selector=\"range\"] The way to apply this annotation.\n * @param {string} [source=\"default\"] The source that added the annotation.\n * @param {string} [id=uuid()] The ID the annotation should have.\n * Generates a UUID by default.\n *\n * @return {Object} Action object.\n */\nexport function __experimentalAddAnnotation( { blockClientId, richTextIdentifier = null, range = null, selector = 'range', source = 'default', id = uuid() } ) {\n\tconst action = {\n\t\ttype: 'ANNOTATION_ADD',\n\t\tid,\n\t\tblockClientId,\n\t\trichTextIdentifier,\n\t\tsource,\n\t\tselector,\n\t};\n\n\tif ( selector === 'range' ) {\n\t\taction.range = range;\n\t}\n\n\treturn action;\n}\n\n/**\n * Removes an annotation with a specific ID.\n *\n * @param {string} annotationId The annotation to remove.\n *\n * @return {Object} Action object.\n */\nexport function __experimentalRemoveAnnotation( annotationId ) {\n\treturn {\n\t\ttype: 'ANNOTATION_REMOVE',\n\t\tannotationId,\n\t};\n}\n\n/**\n * Updates the range of an annotation.\n *\n * @param {string} annotationId ID of the annotation to update.\n * @param {number} start The start of the new range.\n * @param {number} end The end of the new range.\n *\n * @return {Object} Action object.\n */\nexport function __experimentalUpdateAnnotationRange( annotationId, start, end ) {\n\treturn {\n\t\ttype: 'ANNOTATION_UPDATE_RANGE',\n\t\tannotationId,\n\t\tstart,\n\t\tend,\n\t};\n}\n\n/**\n * Removes all annotations of a specific source.\n *\n * @param {string} source The source to remove.\n *\n * @return {Object} Action object.\n */\nexport function __experimentalRemoveAnnotationsBySource( source ) {\n\treturn {\n\t\ttype: 'ANNOTATION_REMOVE_SOURCE',\n\t\tsource,\n\t};\n}\n","/**\n * WordPress Dependencies\n */\nimport { registerStore } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport reducer from './reducer';\nimport * as selectors from './selectors';\nimport * as actions from './actions';\n\n/**\n * Module Constants\n */\nconst MODULE_KEY = 'core/annotations';\n\nconst store = registerStore( MODULE_KEY, {\n\treducer,\n\tselectors,\n\tactions,\n} );\n\nexport default store;\n","/**\n * External dependencies\n */\nimport { get, isNumber, mapValues } from 'lodash';\n\n/**\n * Filters an array based on the predicate, but keeps the reference the same if\n * the array hasn't changed.\n *\n * @param {Array} collection The collection to filter.\n * @param {Function} predicate Function that determines if the item should stay\n * in the array.\n * @return {Array} Filtered array.\n */\nfunction filterWithReference( collection, predicate ) {\n\tconst filteredCollection = collection.filter( predicate );\n\n\treturn collection.length === filteredCollection.length ? collection : filteredCollection;\n}\n\n/**\n * Verifies whether the given annotations is a valid annotation.\n *\n * @param {Object} annotation The annotation to verify.\n * @return {boolean} Whether the given annotation is valid.\n */\nfunction isValidAnnotationRange( annotation ) {\n\treturn isNumber( annotation.start ) &&\n\t\tisNumber( annotation.end ) &&\n\t\tannotation.start <= annotation.end;\n}\n\n/**\n * Reducer managing annotations.\n *\n * @param {Array} state The annotations currently shown in the editor.\n * @param {Object} action Dispatched action.\n *\n * @return {Array} Updated state.\n */\nexport function annotations( state = {}, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'ANNOTATION_ADD':\n\t\t\tconst blockClientId = action.blockClientId;\n\t\t\tconst newAnnotation = {\n\t\t\t\tid: action.id,\n\t\t\t\tblockClientId,\n\t\t\t\trichTextIdentifier: action.richTextIdentifier,\n\t\t\t\tsource: action.source,\n\t\t\t\tselector: action.selector,\n\t\t\t\trange: action.range,\n\t\t\t};\n\n\t\t\tif ( newAnnotation.selector === 'range' && ! isValidAnnotationRange( newAnnotation.range ) ) {\n\t\t\t\treturn state;\n\t\t\t}\n\n\t\t\tconst previousAnnotationsForBlock = get( state, blockClientId, [] );\n\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\t[ blockClientId ]: [ ...previousAnnotationsForBlock, newAnnotation ],\n\t\t\t};\n\n\t\tcase 'ANNOTATION_REMOVE':\n\t\t\treturn mapValues( state, ( annotationsForBlock ) => {\n\t\t\t\treturn filterWithReference( annotationsForBlock, ( annotation ) => {\n\t\t\t\t\treturn annotation.id !== action.annotationId;\n\t\t\t\t} );\n\t\t\t} );\n\n\t\tcase 'ANNOTATION_UPDATE_RANGE':\n\t\t\treturn mapValues( state, ( annotationsForBlock ) => {\n\t\t\t\tlet hasChangedRange = false;\n\n\t\t\t\tconst newAnnotations = annotationsForBlock.map( ( annotation ) => {\n\t\t\t\t\tif ( annotation.id === action.annotationId ) {\n\t\t\t\t\t\thasChangedRange = true;\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t...annotation,\n\t\t\t\t\t\t\trange: {\n\t\t\t\t\t\t\t\tstart: action.start,\n\t\t\t\t\t\t\t\tend: action.end,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\n\t\t\t\t\treturn annotation;\n\t\t\t\t} );\n\n\t\t\t\treturn hasChangedRange ? newAnnotations : annotationsForBlock;\n\t\t\t} );\n\n\t\tcase 'ANNOTATION_REMOVE_SOURCE':\n\t\t\treturn mapValues( state, ( annotationsForBlock ) => {\n\t\t\t\treturn filterWithReference( annotationsForBlock, ( annotation ) => {\n\t\t\t\t\treturn annotation.source !== action.source;\n\t\t\t\t} );\n\t\t\t} );\n\t}\n\n\treturn state;\n}\n\nexport default annotations;\n","/**\n * External dependencies\n */\nimport createSelector from 'rememo';\nimport { get, flatMap } from 'lodash';\n\n/**\n * Shared reference to an empty array for cases where it is important to avoid\n * returning a new array reference on every invocation, as in a connected or\n * other pure component which performs `shouldComponentUpdate` check on props.\n * This should be used as a last resort, since the normalized data should be\n * maintained by the reducer result in state.\n *\n * @type {Array}\n */\nconst EMPTY_ARRAY = [];\n\n/**\n * Returns the annotations for a specific client ID.\n *\n * @param {Object} state Editor state.\n * @param {string} clientId The ID of the block to get the annotations for.\n *\n * @return {Array} The annotations applicable to this block.\n */\nexport const __experimentalGetAnnotationsForBlock = createSelector(\n\t( state, blockClientId ) => {\n\t\treturn get( state, blockClientId, [] ).filter( ( annotation ) => {\n\t\t\treturn annotation.selector === 'block';\n\t\t} );\n\t},\n\t( state, blockClientId ) => [\n\t\tget( state, blockClientId, EMPTY_ARRAY ),\n\t]\n);\n\nexport const __experimentalGetAllAnnotationsForBlock = function( state, blockClientId ) {\n\treturn get( state, blockClientId, EMPTY_ARRAY );\n};\n\n/**\n * Returns the annotations that apply to the given RichText instance.\n *\n * Both a blockClientId and a richTextIdentifier are required. This is because\n * a block might have multiple `RichText` components. This does mean that every\n * block needs to implement annotations itself.\n *\n * @param {Object} state Editor state.\n * @param {string} blockClientId The client ID for the block.\n * @param {string} richTextIdentifier Unique identifier that identifies the given RichText.\n * @return {Array} All the annotations relevant for the `RichText`.\n */\nexport const __experimentalGetAnnotationsForRichText = createSelector(\n\t( state, blockClientId, richTextIdentifier ) => {\n\t\treturn get( state, blockClientId, [] ).filter( ( annotation ) => {\n\t\t\treturn annotation.selector === 'range' &&\n\t\t\t\trichTextIdentifier === annotation.richTextIdentifier;\n\t\t} ).map( ( annotation ) => {\n\t\t\tconst { range, ...other } = annotation;\n\n\t\t\treturn {\n\t\t\t\t...range,\n\t\t\t\t...other,\n\t\t\t};\n\t\t} );\n\t},\n\t( state, blockClientId ) => [\n\t\tget( state, blockClientId, EMPTY_ARRAY ),\n\t]\n);\n\n/**\n * Returns all annotations in the editor state.\n *\n * @param {Object} state Editor state.\n * @return {Array} All annotations currently applied.\n */\nexport function __experimentalGetAnnotations( state ) {\n\treturn flatMap( state, ( annotations ) => {\n\t\treturn annotations;\n\t} );\n}\n","module.exports = function memize( fn, options ) {\n\tvar size = 0,\n\t\tmaxSize, head, tail;\n\n\tif ( options && options.maxSize ) {\n\t\tmaxSize = options.maxSize;\n\t}\n\n\tfunction memoized( /* ...args */ ) {\n\t\tvar node = head,\n\t\t\tlen = arguments.length,\n\t\t\targs, i;\n\n\t\tsearchCache: while ( node ) {\n\t\t\t// Perform a shallow equality test to confirm that whether the node\n\t\t\t// under test is a candidate for the arguments passed. Two arrays\n\t\t\t// are shallowly equal if their length matches and each entry is\n\t\t\t// strictly equal between the two sets. Avoid abstracting to a\n\t\t\t// function which could incur an arguments leaking deoptimization.\n\n\t\t\t// Check whether node arguments match arguments length\n\t\t\tif ( node.args.length !== arguments.length ) {\n\t\t\t\tnode = node.next;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Check whether node arguments match arguments values\n\t\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\t\tif ( node.args[ i ] !== arguments[ i ] ) {\n\t\t\t\t\tnode = node.next;\n\t\t\t\t\tcontinue searchCache;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// At this point we can assume we've found a match\n\n\t\t\t// Surface matched node to head if not already\n\t\t\tif ( node !== head ) {\n\t\t\t\t// As tail, shift to previous. Must only shift if not also\n\t\t\t\t// head, since if both head and tail, there is no previous.\n\t\t\t\tif ( node === tail ) {\n\t\t\t\t\ttail = node.prev;\n\t\t\t\t}\n\n\t\t\t\t// Adjust siblings to point to each other. If node was tail,\n\t\t\t\t// this also handles new tail's empty `next` assignment.\n\t\t\t\tnode.prev.next = node.next;\n\t\t\t\tif ( node.next ) {\n\t\t\t\t\tnode.next.prev = node.prev;\n\t\t\t\t}\n\n\t\t\t\tnode.next = head;\n\t\t\t\tnode.prev = null;\n\t\t\t\thead.prev = node;\n\t\t\t\thead = node;\n\t\t\t}\n\n\t\t\t// Return immediately\n\t\t\treturn node.val;\n\t\t}\n\n\t\t// No cached value found. Continue to insertion phase:\n\n\t\t// Create a copy of arguments (avoid leaking deoptimization)\n\t\targs = new Array( len );\n\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\targs[ i ] = arguments[ i ];\n\t\t}\n\n\t\tnode = {\n\t\t\targs: args,\n\n\t\t\t// Generate the result from original function\n\t\t\tval: fn.apply( null, args )\n\t\t};\n\n\t\t// Don't need to check whether node is already head, since it would\n\t\t// have been returned above already if it was\n\n\t\t// Shift existing head down list\n\t\tif ( head ) {\n\t\t\thead.prev = node;\n\t\t\tnode.next = head;\n\t\t} else {\n\t\t\t// If no head, follows that there's no tail (at initial or reset)\n\t\t\ttail = node;\n\t\t}\n\n\t\t// Trim tail if we're reached max size and are pending cache insertion\n\t\tif ( size === maxSize ) {\n\t\t\ttail = tail.prev;\n\t\t\ttail.next = null;\n\t\t} else {\n\t\t\tsize++;\n\t\t}\n\n\t\thead = node;\n\n\t\treturn node.val;\n\t}\n\n\tmemoized.clear = function() {\n\t\thead = null;\n\t\ttail = null;\n\t\tsize = 0;\n\t};\n\n\tif ( process.env.NODE_ENV === 'test' ) {\n\t\t// Cache is not exposed in the public API, but used in tests to ensure\n\t\t// expected list progression\n\t\tmemoized.getCache = function() {\n\t\t\treturn [ head, tail, size ];\n\t\t};\n\t}\n\n\treturn memoized;\n};\n","'use strict';\n\nvar LEAF_KEY, hasWeakMap;\n\n/**\n * Arbitrary value used as key for referencing cache object in WeakMap tree.\n *\n * @type {Object}\n */\nLEAF_KEY = {};\n\n/**\n * Whether environment supports WeakMap.\n *\n * @type {boolean}\n */\nhasWeakMap = typeof WeakMap !== 'undefined';\n\n/**\n * Returns the first argument as the sole entry in an array.\n *\n * @param {*} value Value to return.\n *\n * @return {Array} Value returned as entry in array.\n */\nfunction arrayOf( value ) {\n\treturn [ value ];\n}\n\n/**\n * Returns true if the value passed is object-like, or false otherwise. A value\n * is object-like if it can support property assignment, e.g. object or array.\n *\n * @param {*} value Value to test.\n *\n * @return {boolean} Whether value is object-like.\n */\nfunction isObjectLike( value ) {\n\treturn !! value && 'object' === typeof value;\n}\n\n/**\n * Creates and returns a new cache object.\n *\n * @return {Object} Cache object.\n */\nfunction createCache() {\n\tvar cache = {\n\t\tclear: function() {\n\t\t\tcache.head = null;\n\t\t},\n\t};\n\n\treturn cache;\n}\n\n/**\n * Returns true if entries within the two arrays are strictly equal by\n * reference from a starting index.\n *\n * @param {Array} a First array.\n * @param {Array} b Second array.\n * @param {number} fromIndex Index from which to start comparison.\n *\n * @return {boolean} Whether arrays are shallowly equal.\n */\nfunction isShallowEqual( a, b, fromIndex ) {\n\tvar i;\n\n\tif ( a.length !== b.length ) {\n\t\treturn false;\n\t}\n\n\tfor ( i = fromIndex; i < a.length; i++ ) {\n\t\tif ( a[ i ] !== b[ i ] ) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\treturn true;\n}\n\n/**\n * Returns a memoized selector function. The getDependants function argument is\n * called before the memoized selector and is expected to return an immutable\n * reference or array of references on which the selector depends for computing\n * its own return value. The memoize cache is preserved only as long as those\n * dependant references remain the same. If getDependants returns a different\n * reference(s), the cache is cleared and the selector value regenerated.\n *\n * @param {Function} selector Selector function.\n * @param {Function} getDependants Dependant getter returning an immutable\n * reference or array of reference used in\n * cache bust consideration.\n *\n * @return {Function} Memoized selector.\n */\nexport default function( selector, getDependants ) {\n\tvar rootCache, getCache;\n\n\t// Use object source as dependant if getter not provided\n\tif ( ! getDependants ) {\n\t\tgetDependants = arrayOf;\n\t}\n\n\t/**\n\t * Returns the root cache. If WeakMap is supported, this is assigned to the\n\t * root WeakMap cache set, otherwise it is a shared instance of the default\n\t * cache object.\n\t *\n\t * @return {(WeakMap|Object)} Root cache object.\n\t */\n\tfunction getRootCache() {\n\t\treturn rootCache;\n\t}\n\n\t/**\n\t * Returns the cache for a given dependants array. When possible, a WeakMap\n\t * will be used to create a unique cache for each set of dependants. This\n\t * is feasible due to the nature of WeakMap in allowing garbage collection\n\t * to occur on entries where the key object is no longer referenced. Since\n\t * WeakMap requires the key to be an object, this is only possible when the\n\t * dependant is object-like. The root cache is created as a hierarchy where\n\t * each top-level key is the first entry in a dependants set, the value a\n\t * WeakMap where each key is the next dependant, and so on. This continues\n\t * so long as the dependants are object-like. If no dependants are object-\n\t * like, then the cache is shared across all invocations.\n\t *\n\t * @see isObjectLike\n\t *\n\t * @param {Array} dependants Selector dependants.\n\t *\n\t * @return {Object} Cache object.\n\t */\n\tfunction getWeakMapCache( dependants ) {\n\t\tvar caches = rootCache,\n\t\t\tisUniqueByDependants = true,\n\t\t\ti, dependant, map, cache;\n\n\t\tfor ( i = 0; i < dependants.length; i++ ) {\n\t\t\tdependant = dependants[ i ];\n\n\t\t\t// Can only compose WeakMap from object-like key.\n\t\t\tif ( ! isObjectLike( dependant ) ) {\n\t\t\t\tisUniqueByDependants = false;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t// Does current segment of cache already have a WeakMap?\n\t\t\tif ( caches.has( dependant ) ) {\n\t\t\t\t// Traverse into nested WeakMap.\n\t\t\t\tcaches = caches.get( dependant );\n\t\t\t} else {\n\t\t\t\t// Create, set, and traverse into a new one.\n\t\t\t\tmap = new WeakMap();\n\t\t\t\tcaches.set( dependant, map );\n\t\t\t\tcaches = map;\n\t\t\t}\n\t\t}\n\n\t\t// We use an arbitrary (but consistent) object as key for the last item\n\t\t// in the WeakMap to serve as our running cache.\n\t\tif ( ! caches.has( LEAF_KEY ) ) {\n\t\t\tcache = createCache();\n\t\t\tcache.isUniqueByDependants = isUniqueByDependants;\n\t\t\tcaches.set( LEAF_KEY, cache );\n\t\t}\n\n\t\treturn caches.get( LEAF_KEY );\n\t}\n\n\t// Assign cache handler by availability of WeakMap\n\tgetCache = hasWeakMap ? getWeakMapCache : getRootCache;\n\n\t/**\n\t * Resets root memoization cache.\n\t */\n\tfunction clear() {\n\t\trootCache = hasWeakMap ? new WeakMap() : createCache();\n\t}\n\n\t// eslint-disable-next-line jsdoc/check-param-names\n\t/**\n\t * The augmented selector call, considering first whether dependants have\n\t * changed before passing it to underlying memoize function.\n\t *\n\t * @param {Object} source Source object for derivation.\n\t * @param {...*} extraArgs Additional arguments to pass to selector.\n\t *\n\t * @return {*} Selector result.\n\t */\n\tfunction callSelector( /* source, ...extraArgs */ ) {\n\t\tvar len = arguments.length,\n\t\t\tcache, node, i, args, dependants;\n\n\t\t// Create copy of arguments (avoid leaking deoptimization).\n\t\targs = new Array( len );\n\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\targs[ i ] = arguments[ i ];\n\t\t}\n\n\t\tdependants = getDependants.apply( null, args );\n\t\tcache = getCache( dependants );\n\n\t\t// If not guaranteed uniqueness by dependants (primitive type or lack\n\t\t// of WeakMap support), shallow compare against last dependants and, if\n\t\t// references have changed, destroy cache to recalculate result.\n\t\tif ( ! cache.isUniqueByDependants ) {\n\t\t\tif ( cache.lastDependants && ! isShallowEqual( dependants, cache.lastDependants, 0 ) ) {\n\t\t\t\tcache.clear();\n\t\t\t}\n\n\t\t\tcache.lastDependants = dependants;\n\t\t}\n\n\t\tnode = cache.head;\n\t\twhile ( node ) {\n\t\t\t// Check whether node arguments match arguments\n\t\t\tif ( ! isShallowEqual( node.args, args, 1 ) ) {\n\t\t\t\tnode = node.next;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// At this point we can assume we've found a match\n\n\t\t\t// Surface matched node to head if not already\n\t\t\tif ( node !== cache.head ) {\n\t\t\t\t// Adjust siblings to point to each other.\n\t\t\t\tnode.prev.next = node.next;\n\t\t\t\tif ( node.next ) {\n\t\t\t\t\tnode.next.prev = node.prev;\n\t\t\t\t}\n\n\t\t\t\tnode.next = cache.head;\n\t\t\t\tnode.prev = null;\n\t\t\t\tcache.head.prev = node;\n\t\t\t\tcache.head = node;\n\t\t\t}\n\n\t\t\t// Return immediately\n\t\t\treturn node.val;\n\t\t}\n\n\t\t// No cached value found. Continue to insertion phase:\n\n\t\tnode = {\n\t\t\t// Generate the result from original function\n\t\t\tval: selector.apply( null, args ),\n\t\t};\n\n\t\t// Avoid including the source object in the cache.\n\t\targs[ 0 ] = null;\n\t\tnode.args = args;\n\n\t\t// Don't need to check whether node is already head, since it would\n\t\t// have been returned above already if it was\n\n\t\t// Shift existing head down list\n\t\tif ( cache.head ) {\n\t\t\tcache.head.prev = node;\n\t\t\tnode.next = cache.head;\n\t\t}\n\n\t\tcache.head = node;\n\n\t\treturn node.val;\n\t}\n\n\tcallSelector.getDependants = getDependants;\n\tcallSelector.clear = clear;\n\tclear();\n\n\treturn callSelector;\n}\n","/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\nvar byteToHex = [];\nfor (var i = 0; i < 256; ++i) {\n byteToHex[i] = (i + 0x100).toString(16).substr(1);\n}\n\nfunction bytesToUuid(buf, offset) {\n var i = offset || 0;\n var bth = byteToHex;\n // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4\n return ([bth[buf[i++]], bth[buf[i++]], \n\tbth[buf[i++]], bth[buf[i++]], '-',\n\tbth[buf[i++]], bth[buf[i++]], '-',\n\tbth[buf[i++]], bth[buf[i++]], '-',\n\tbth[buf[i++]], bth[buf[i++]], '-',\n\tbth[buf[i++]], bth[buf[i++]],\n\tbth[buf[i++]], bth[buf[i++]],\n\tbth[buf[i++]], bth[buf[i++]]]).join('');\n}\n\nmodule.exports = bytesToUuid;\n","// Unique ID creation requires a high quality random # generator. In the\n// browser this is a little complicated due to unknown quality of Math.random()\n// and inconsistent support for the `crypto` API. We do the best we can via\n// feature-detection\n\n// getRandomValues needs to be invoked in a context where \"this\" is a Crypto\n// implementation. Also, find the complete implementation of crypto on IE11.\nvar getRandomValues = (typeof(crypto) != 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto)) ||\n (typeof(msCrypto) != 'undefined' && typeof window.msCrypto.getRandomValues == 'function' && msCrypto.getRandomValues.bind(msCrypto));\n\nif (getRandomValues) {\n // WHATWG crypto RNG - http://wiki.whatwg.org/wiki/Crypto\n var rnds8 = new Uint8Array(16); // eslint-disable-line no-undef\n\n module.exports = function whatwgRNG() {\n getRandomValues(rnds8);\n return rnds8;\n };\n} else {\n // Math.random()-based (RNG)\n //\n // If all else fails, use Math.random(). It's fast, but is of unspecified\n // quality.\n var rnds = new Array(16);\n\n module.exports = function mathRNG() {\n for (var i = 0, r; i < 16; i++) {\n if ((i & 0x03) === 0) r = Math.random() * 0x100000000;\n rnds[i] = r >>> ((i & 0x03) << 3) & 0xff;\n }\n\n return rnds;\n };\n}\n","var rng = require('./lib/rng');\nvar bytesToUuid = require('./lib/bytesToUuid');\n\nfunction v4(options, buf, offset) {\n var i = buf && offset || 0;\n\n if (typeof(options) == 'string') {\n buf = options === 'binary' ? new Array(16) : null;\n options = null;\n }\n options = options || {};\n\n var rnds = options.random || (options.rng || rng)();\n\n // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n rnds[6] = (rnds[6] & 0x0f) | 0x40;\n rnds[8] = (rnds[8] & 0x3f) | 0x80;\n\n // Copy bytes to buffer, if provided\n if (buf) {\n for (var ii = 0; ii < 16; ++ii) {\n buf[i + ii] = rnds[ii];\n }\n }\n\n return buf || bytesToUuid(rnds);\n}\n\nmodule.exports = v4;\n","(function() { module.exports = this[\"wp\"][\"data\"]; }());","(function() { module.exports = this[\"wp\"][\"hooks\"]; }());","(function() { module.exports = this[\"wp\"][\"i18n\"]; }());","(function() { module.exports = this[\"wp\"][\"richText\"]; }());","(function() { module.exports = this[\"lodash\"]; }());"],"sourceRoot":""} \ No newline at end of file diff --git a/wp-includes/js/dist/api-fetch.js b/wp-includes/js/dist/api-fetch.js index 8035a75f28..3c6b29e987 100644 --- a/wp-includes/js/dist/api-fetch.js +++ b/wp-includes/js/dist/api-fetch.js @@ -95,43 +95,7 @@ this["wp"] = this["wp"] || {}; this["wp"]["apiFetch"] = /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _asyncToGenerator; }); -function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { - try { - var info = gen[key](arg); - var value = info.value; - } catch (error) { - reject(error); - return; - } - - if (info.done) { - resolve(value); - } else { - Promise.resolve(value).then(_next, _throw); - } -} - -function _asyncToGenerator(fn) { - return function () { - var self = this, - args = arguments; - return new Promise(function (resolve, reject) { - var gen = fn.apply(self, args); - - function _next(value) { - asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); - } - - function _throw(err) { - asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); - } - - _next(undefined); - }); - }; -} +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return _asyncToGenerator; });\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {\n try {\n var info = gen[key](arg);\n var value = info.value;\n } catch (error) {\n reject(error);\n return;\n }\n\n if (info.done) {\n resolve(value);\n } else {\n Promise.resolve(value).then(_next, _throw);\n }\n}\n\nfunction _asyncToGenerator(fn) {\n return function () {\n var self = this,\n args = arguments;\n return new Promise(function (resolve, reject) {\n var gen = fn.apply(self, args);\n\n function _next(value) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value);\n }\n\n function _throw(err) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err);\n }\n\n _next(undefined);\n });\n };\n}\n\n//# sourceURL=webpack://wp.%5Bname%5D/./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js?"); /***/ }), @@ -143,22 +107,7 @@ function _asyncToGenerator(fn) { /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _defineProperty; }); -function _defineProperty(obj, key, value) { - if (key in obj) { - Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true - }); - } else { - obj[key] = value; - } - - return obj; -} +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return _defineProperty; });\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\n//# sourceURL=webpack://wp.%5Bname%5D/./node_modules/@babel/runtime/helpers/esm/defineProperty.js?"); /***/ }), @@ -170,28 +119,7 @@ function _defineProperty(obj, key, value) { /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _objectSpread; }); -/* harmony import */ var _defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./defineProperty */ "./node_modules/@babel/runtime/helpers/esm/defineProperty.js"); - -function _objectSpread(target) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i] != null ? arguments[i] : {}; - var ownKeys = Object.keys(source); - - if (typeof Object.getOwnPropertySymbols === 'function') { - ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { - return Object.getOwnPropertyDescriptor(source, sym).enumerable; - })); - } - - ownKeys.forEach(function (key) { - Object(_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])(target, key, source[key]); - }); - } - - return target; -} +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return _objectSpread; });\n/* harmony import */ var _defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./defineProperty */ \"./node_modules/@babel/runtime/helpers/esm/defineProperty.js\");\n\nfunction _objectSpread(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n var ownKeys = Object.keys(source);\n\n if (typeof Object.getOwnPropertySymbols === 'function') {\n ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {\n return Object.getOwnPropertyDescriptor(source, sym).enumerable;\n }));\n }\n\n ownKeys.forEach(function (key) {\n Object(_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(target, key, source[key]);\n });\n }\n\n return target;\n}\n\n//# sourceURL=webpack://wp.%5Bname%5D/./node_modules/@babel/runtime/helpers/esm/objectSpread.js?"); /***/ }), @@ -203,28 +131,7 @@ function _objectSpread(target) { /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _objectWithoutProperties; }); -/* harmony import */ var _objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js"); - -function _objectWithoutProperties(source, excluded) { - if (source == null) return {}; - var target = Object(_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_0__["default"])(source, excluded); - var key, i; - - if (Object.getOwnPropertySymbols) { - var sourceSymbolKeys = Object.getOwnPropertySymbols(source); - - for (i = 0; i < sourceSymbolKeys.length; i++) { - key = sourceSymbolKeys[i]; - if (excluded.indexOf(key) >= 0) continue; - if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; - target[key] = source[key]; - } - } - - return target; -} +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return _objectWithoutProperties; });\n/* harmony import */ var _objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./objectWithoutPropertiesLoose */ \"./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js\");\n\nfunction _objectWithoutProperties(source, excluded) {\n if (source == null) return {};\n var target = Object(_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(source, excluded);\n var key, i;\n\n if (Object.getOwnPropertySymbols) {\n var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n\n for (i = 0; i < sourceSymbolKeys.length; i++) {\n key = sourceSymbolKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n target[key] = source[key];\n }\n }\n\n return target;\n}\n\n//# sourceURL=webpack://wp.%5Bname%5D/./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js?"); /***/ }), @@ -236,22 +143,7 @@ function _objectWithoutProperties(source, excluded) { /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _objectWithoutPropertiesLoose; }); -function _objectWithoutPropertiesLoose(source, excluded) { - if (source == null) return {}; - var target = {}; - var sourceKeys = Object.keys(source); - var key, i; - - for (i = 0; i < sourceKeys.length; i++) { - key = sourceKeys[i]; - if (excluded.indexOf(key) >= 0) continue; - target[key] = source[key]; - } - - return target; -} +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return _objectWithoutPropertiesLoose; });\nfunction _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}\n\n//# sourceURL=webpack://wp.%5Bname%5D/./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js?"); /***/ }), @@ -263,156 +155,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectSpread */ "./node_modules/@babel/runtime/helpers/esm/objectSpread.js"); -/* harmony import */ var _babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutProperties */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js"); -/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); -/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__); -/* harmony import */ var _middlewares_nonce__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./middlewares/nonce */ "./node_modules/@wordpress/api-fetch/build-module/middlewares/nonce.js"); -/* harmony import */ var _middlewares_root_url__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./middlewares/root-url */ "./node_modules/@wordpress/api-fetch/build-module/middlewares/root-url.js"); -/* harmony import */ var _middlewares_preloading__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./middlewares/preloading */ "./node_modules/@wordpress/api-fetch/build-module/middlewares/preloading.js"); -/* harmony import */ var _middlewares_fetch_all_middleware__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./middlewares/fetch-all-middleware */ "./node_modules/@wordpress/api-fetch/build-module/middlewares/fetch-all-middleware.js"); -/* harmony import */ var _middlewares_namespace_endpoint__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./middlewares/namespace-endpoint */ "./node_modules/@wordpress/api-fetch/build-module/middlewares/namespace-endpoint.js"); -/* harmony import */ var _middlewares_http_v1__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./middlewares/http-v1 */ "./node_modules/@wordpress/api-fetch/build-module/middlewares/http-v1.js"); -/* harmony import */ var _middlewares_user_locale__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./middlewares/user-locale */ "./node_modules/@wordpress/api-fetch/build-module/middlewares/user-locale.js"); - - - -/** - * WordPress dependencies - */ - -/** - * Internal dependencies - */ - - - - - - - - -/** - * Default set of header values which should be sent with every request unless - * explicitly provided through apiFetch options. - * - * @type {Object} - */ - -var DEFAULT_HEADERS = { - // The backend uses the Accept header as a condition for considering an - // incoming request as a REST request. - // - // See: https://core.trac.wordpress.org/ticket/44534 - Accept: 'application/json, */*;q=0.1' -}; -/** - * Default set of fetch option values which should be sent with every request - * unless explicitly provided through apiFetch options. - * - * @type {Object} - */ - -var DEFAULT_OPTIONS = { - credentials: 'include' -}; -var middlewares = []; - -function registerMiddleware(middleware) { - middlewares.push(middleware); -} - -function apiFetch(options) { - var raw = function raw(nextOptions) { - var url = nextOptions.url, - path = nextOptions.path, - data = nextOptions.data, - _nextOptions$parse = nextOptions.parse, - parse = _nextOptions$parse === void 0 ? true : _nextOptions$parse, - remainingOptions = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__["default"])(nextOptions, ["url", "path", "data", "parse"]); - - var body = nextOptions.body, - headers = nextOptions.headers; // Merge explicitly-provided headers with default values. - - headers = Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__["default"])({}, DEFAULT_HEADERS, headers); // The `data` property is a shorthand for sending a JSON body. - - if (data) { - body = JSON.stringify(data); - headers['Content-Type'] = 'application/json'; - } - - var responsePromise = window.fetch(url || path, Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__["default"])({}, DEFAULT_OPTIONS, remainingOptions, { - body: body, - headers: headers - })); - - var checkStatus = function checkStatus(response) { - if (response.status >= 200 && response.status < 300) { - return response; - } - - throw response; - }; - - var parseResponse = function parseResponse(response) { - if (parse) { - if (response.status === 204) { - return null; - } - - return response.json ? response.json() : Promise.reject(response); - } - - return response; - }; - - return responsePromise.then(checkStatus).then(parseResponse).catch(function (response) { - if (!parse) { - throw response; - } - - var invalidJsonError = { - code: 'invalid_json', - message: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('The response is not a valid JSON response.') - }; - - if (!response || !response.json) { - throw invalidJsonError; - } - - return response.json().catch(function () { - throw invalidJsonError; - }).then(function (error) { - var unknownError = { - code: 'unknown_error', - message: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('An unknown error occurred.') - }; - throw error || unknownError; - }); - }); - }; - - var steps = [raw, _middlewares_fetch_all_middleware__WEBPACK_IMPORTED_MODULE_6__["default"], _middlewares_http_v1__WEBPACK_IMPORTED_MODULE_8__["default"], _middlewares_namespace_endpoint__WEBPACK_IMPORTED_MODULE_7__["default"], _middlewares_user_locale__WEBPACK_IMPORTED_MODULE_9__["default"]].concat(middlewares).reverse(); - - var runMiddleware = function runMiddleware(index) { - return function (nextOptions) { - var nextMiddleware = steps[index]; - var next = runMiddleware(index + 1); - return nextMiddleware(nextOptions, next); - }; - }; - - return runMiddleware(0)(options); -} - -apiFetch.use = registerMiddleware; -apiFetch.createNonceMiddleware = _middlewares_nonce__WEBPACK_IMPORTED_MODULE_3__["default"]; -apiFetch.createPreloadingMiddleware = _middlewares_preloading__WEBPACK_IMPORTED_MODULE_5__["default"]; -apiFetch.createRootURLMiddleware = _middlewares_root_url__WEBPACK_IMPORTED_MODULE_4__["default"]; -apiFetch.fetchAllMiddleware = _middlewares_fetch_all_middleware__WEBPACK_IMPORTED_MODULE_6__["default"]; -/* harmony default export */ __webpack_exports__["default"] = (apiFetch); - +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectSpread */ \"./node_modules/@babel/runtime/helpers/esm/objectSpread.js\");\n/* harmony import */ var _babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutProperties */ \"./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js\");\n/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ \"@wordpress/i18n\");\n/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _middlewares_nonce__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./middlewares/nonce */ \"./node_modules/@wordpress/api-fetch/build-module/middlewares/nonce.js\");\n/* harmony import */ var _middlewares_root_url__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./middlewares/root-url */ \"./node_modules/@wordpress/api-fetch/build-module/middlewares/root-url.js\");\n/* harmony import */ var _middlewares_preloading__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./middlewares/preloading */ \"./node_modules/@wordpress/api-fetch/build-module/middlewares/preloading.js\");\n/* harmony import */ var _middlewares_fetch_all_middleware__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./middlewares/fetch-all-middleware */ \"./node_modules/@wordpress/api-fetch/build-module/middlewares/fetch-all-middleware.js\");\n/* harmony import */ var _middlewares_namespace_endpoint__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./middlewares/namespace-endpoint */ \"./node_modules/@wordpress/api-fetch/build-module/middlewares/namespace-endpoint.js\");\n/* harmony import */ var _middlewares_http_v1__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./middlewares/http-v1 */ \"./node_modules/@wordpress/api-fetch/build-module/middlewares/http-v1.js\");\n/* harmony import */ var _middlewares_user_locale__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./middlewares/user-locale */ \"./node_modules/@wordpress/api-fetch/build-module/middlewares/user-locale.js\");\n\n\n\n/**\n * WordPress dependencies\n */\n\n/**\n * Internal dependencies\n */\n\n\n\n\n\n\n\n\n/**\n * Default set of header values which should be sent with every request unless\n * explicitly provided through apiFetch options.\n *\n * @type {Object}\n */\n\nvar DEFAULT_HEADERS = {\n // The backend uses the Accept header as a condition for considering an\n // incoming request as a REST request.\n //\n // See: https://core.trac.wordpress.org/ticket/44534\n Accept: 'application/json, */*;q=0.1'\n};\n/**\n * Default set of fetch option values which should be sent with every request\n * unless explicitly provided through apiFetch options.\n *\n * @type {Object}\n */\n\nvar DEFAULT_OPTIONS = {\n credentials: 'include'\n};\nvar middlewares = [];\n\nfunction registerMiddleware(middleware) {\n middlewares.push(middleware);\n}\n\nfunction apiFetch(options) {\n var raw = function raw(nextOptions) {\n var url = nextOptions.url,\n path = nextOptions.path,\n data = nextOptions.data,\n _nextOptions$parse = nextOptions.parse,\n parse = _nextOptions$parse === void 0 ? true : _nextOptions$parse,\n remainingOptions = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(nextOptions, [\"url\", \"path\", \"data\", \"parse\"]);\n\n var body = nextOptions.body,\n headers = nextOptions.headers; // Merge explicitly-provided headers with default values.\n\n headers = Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__[\"default\"])({}, DEFAULT_HEADERS, headers); // The `data` property is a shorthand for sending a JSON body.\n\n if (data) {\n body = JSON.stringify(data);\n headers['Content-Type'] = 'application/json';\n }\n\n var responsePromise = window.fetch(url || path, Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__[\"default\"])({}, DEFAULT_OPTIONS, remainingOptions, {\n body: body,\n headers: headers\n }));\n\n var checkStatus = function checkStatus(response) {\n if (response.status >= 200 && response.status < 300) {\n return response;\n }\n\n throw response;\n };\n\n var parseResponse = function parseResponse(response) {\n if (parse) {\n if (response.status === 204) {\n return null;\n }\n\n return response.json ? response.json() : Promise.reject(response);\n }\n\n return response;\n };\n\n return responsePromise.then(checkStatus).then(parseResponse).catch(function (response) {\n if (!parse) {\n throw response;\n }\n\n var invalidJsonError = {\n code: 'invalid_json',\n message: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__[\"__\"])('The response is not a valid JSON response.')\n };\n\n if (!response || !response.json) {\n throw invalidJsonError;\n }\n\n return response.json().catch(function () {\n throw invalidJsonError;\n }).then(function (error) {\n var unknownError = {\n code: 'unknown_error',\n message: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__[\"__\"])('An unknown error occurred.')\n };\n throw error || unknownError;\n });\n });\n };\n\n var steps = [raw, _middlewares_fetch_all_middleware__WEBPACK_IMPORTED_MODULE_6__[\"default\"], _middlewares_http_v1__WEBPACK_IMPORTED_MODULE_8__[\"default\"], _middlewares_namespace_endpoint__WEBPACK_IMPORTED_MODULE_7__[\"default\"], _middlewares_user_locale__WEBPACK_IMPORTED_MODULE_9__[\"default\"]].concat(middlewares).reverse();\n\n var runMiddleware = function runMiddleware(index) {\n return function (nextOptions) {\n var nextMiddleware = steps[index];\n var next = runMiddleware(index + 1);\n return nextMiddleware(nextOptions, next);\n };\n };\n\n return runMiddleware(0)(options);\n}\n\napiFetch.use = registerMiddleware;\napiFetch.createNonceMiddleware = _middlewares_nonce__WEBPACK_IMPORTED_MODULE_3__[\"default\"];\napiFetch.createPreloadingMiddleware = _middlewares_preloading__WEBPACK_IMPORTED_MODULE_5__[\"default\"];\napiFetch.createRootURLMiddleware = _middlewares_root_url__WEBPACK_IMPORTED_MODULE_4__[\"default\"];\napiFetch.fetchAllMiddleware = _middlewares_fetch_all_middleware__WEBPACK_IMPORTED_MODULE_6__[\"default\"];\n/* harmony default export */ __webpack_exports__[\"default\"] = (apiFetch);\n\n\n//# sourceURL=webpack://wp.%5Bname%5D/./node_modules/@wordpress/api-fetch/build-module/index.js?"); /***/ }), @@ -424,173 +167,7 @@ apiFetch.fetchAllMiddleware = _middlewares_fetch_all_middleware__WEBPACK_IMPORTE /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/asyncToGenerator */ "./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js"); -/* harmony import */ var _babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectSpread */ "./node_modules/@babel/runtime/helpers/esm/objectSpread.js"); -/* harmony import */ var _babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutProperties */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js"); -/* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/url */ "@wordpress/url"); -/* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_url__WEBPACK_IMPORTED_MODULE_3__); - - - - -/** - * WordPress dependencies - */ - // Apply query arguments to both URL and Path, whichever is present. - -var modifyQuery = function modifyQuery(_ref, queryArgs) { - var path = _ref.path, - url = _ref.url, - options = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_2__["default"])(_ref, ["path", "url"]); - - return Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__["default"])({}, options, { - url: url && Object(_wordpress_url__WEBPACK_IMPORTED_MODULE_3__["addQueryArgs"])(url, queryArgs), - path: path && Object(_wordpress_url__WEBPACK_IMPORTED_MODULE_3__["addQueryArgs"])(path, queryArgs) - }); -}; // Duplicates parsing functionality from apiFetch. - - -var parseResponse = function parseResponse(response) { - return response.json ? response.json() : Promise.reject(response); -}; - -var parseLinkHeader = function parseLinkHeader(linkHeader) { - if (!linkHeader) { - return {}; - } - - var match = linkHeader.match(/<([^>]+)>; rel="next"/); - return match ? { - next: match[1] - } : {}; -}; - -var getNextPageUrl = function getNextPageUrl(response) { - var _parseLinkHeader = parseLinkHeader(response.headers.get('link')), - next = _parseLinkHeader.next; - - return next; -}; - -var requestContainsUnboundedQuery = function requestContainsUnboundedQuery(options) { - var pathIsUnbounded = options.path && options.path.indexOf('per_page=-1') !== -1; - var urlIsUnbounded = options.url && options.url.indexOf('per_page=-1') !== -1; - return pathIsUnbounded || urlIsUnbounded; -}; // The REST API enforces an upper limit on the per_page option. To handle large -// collections, apiFetch consumers can pass `per_page=-1`; this middleware will -// then recursively assemble a full response array from all available pages. - - -var fetchAllMiddleware = -/*#__PURE__*/ -function () { - var _ref2 = Object(_babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__["default"])( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee(options, next) { - var response, results, nextPage, mergedResults, nextResponse, nextResults; - return regeneratorRuntime.wrap(function _callee$(_context) { - while (1) { - switch (_context.prev = _context.next) { - case 0: - if (!(options.parse === false)) { - _context.next = 2; - break; - } - - return _context.abrupt("return", next(options)); - - case 2: - if (requestContainsUnboundedQuery(options)) { - _context.next = 4; - break; - } - - return _context.abrupt("return", next(options)); - - case 4: - _context.next = 6; - return next(Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__["default"])({}, modifyQuery(options, { - per_page: 100 - }), { - // Ensure headers are returned for page 1. - parse: false - })); - - case 6: - response = _context.sent; - _context.next = 9; - return parseResponse(response); - - case 9: - results = _context.sent; - - if (Array.isArray(results)) { - _context.next = 12; - break; - } - - return _context.abrupt("return", results); - - case 12: - nextPage = getNextPageUrl(response); - - if (nextPage) { - _context.next = 15; - break; - } - - return _context.abrupt("return", results); - - case 15: - // Iteratively fetch all remaining pages until no "next" header is found. - mergedResults = [].concat(results); - - case 16: - if (!nextPage) { - _context.next = 27; - break; - } - - _context.next = 19; - return next(Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__["default"])({}, options, { - // Ensure the URL for the next page is used instead of any provided path. - path: undefined, - url: nextPage, - // Ensure we still get headers so we can identify the next page. - parse: false - })); - - case 19: - nextResponse = _context.sent; - _context.next = 22; - return parseResponse(nextResponse); - - case 22: - nextResults = _context.sent; - mergedResults = mergedResults.concat(nextResults); - nextPage = getNextPageUrl(nextResponse); - _context.next = 16; - break; - - case 27: - return _context.abrupt("return", mergedResults); - - case 28: - case "end": - return _context.stop(); - } - } - }, _callee, this); - })); - - return function fetchAllMiddleware(_x, _x2) { - return _ref2.apply(this, arguments); - }; -}(); - -/* harmony default export */ __webpack_exports__["default"] = (fetchAllMiddleware); - +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/asyncToGenerator */ \"./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectSpread */ \"./node_modules/@babel/runtime/helpers/esm/objectSpread.js\");\n/* harmony import */ var _babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutProperties */ \"./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js\");\n/* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/url */ \"@wordpress/url\");\n/* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_url__WEBPACK_IMPORTED_MODULE_3__);\n\n\n\n\n/**\n * WordPress dependencies\n */\n // Apply query arguments to both URL and Path, whichever is present.\n\nvar modifyQuery = function modifyQuery(_ref, queryArgs) {\n var path = _ref.path,\n url = _ref.url,\n options = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(_ref, [\"path\", \"url\"]);\n\n return Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__[\"default\"])({}, options, {\n url: url && Object(_wordpress_url__WEBPACK_IMPORTED_MODULE_3__[\"addQueryArgs\"])(url, queryArgs),\n path: path && Object(_wordpress_url__WEBPACK_IMPORTED_MODULE_3__[\"addQueryArgs\"])(path, queryArgs)\n });\n}; // Duplicates parsing functionality from apiFetch.\n\n\nvar parseResponse = function parseResponse(response) {\n return response.json ? response.json() : Promise.reject(response);\n};\n\nvar parseLinkHeader = function parseLinkHeader(linkHeader) {\n if (!linkHeader) {\n return {};\n }\n\n var match = linkHeader.match(/<([^>]+)>; rel=\"next\"/);\n return match ? {\n next: match[1]\n } : {};\n};\n\nvar getNextPageUrl = function getNextPageUrl(response) {\n var _parseLinkHeader = parseLinkHeader(response.headers.get('link')),\n next = _parseLinkHeader.next;\n\n return next;\n};\n\nvar requestContainsUnboundedQuery = function requestContainsUnboundedQuery(options) {\n var pathIsUnbounded = options.path && options.path.indexOf('per_page=-1') !== -1;\n var urlIsUnbounded = options.url && options.url.indexOf('per_page=-1') !== -1;\n return pathIsUnbounded || urlIsUnbounded;\n}; // The REST API enforces an upper limit on the per_page option. To handle large\n// collections, apiFetch consumers can pass `per_page=-1`; this middleware will\n// then recursively assemble a full response array from all available pages.\n\n\nvar fetchAllMiddleware =\n/*#__PURE__*/\nfunction () {\n var _ref2 = Object(_babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(\n /*#__PURE__*/\n regeneratorRuntime.mark(function _callee(options, next) {\n var response, results, nextPage, mergedResults, nextResponse, nextResults;\n return regeneratorRuntime.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n if (!(options.parse === false)) {\n _context.next = 2;\n break;\n }\n\n return _context.abrupt(\"return\", next(options));\n\n case 2:\n if (requestContainsUnboundedQuery(options)) {\n _context.next = 4;\n break;\n }\n\n return _context.abrupt(\"return\", next(options));\n\n case 4:\n _context.next = 6;\n return next(Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__[\"default\"])({}, modifyQuery(options, {\n per_page: 100\n }), {\n // Ensure headers are returned for page 1.\n parse: false\n }));\n\n case 6:\n response = _context.sent;\n _context.next = 9;\n return parseResponse(response);\n\n case 9:\n results = _context.sent;\n\n if (Array.isArray(results)) {\n _context.next = 12;\n break;\n }\n\n return _context.abrupt(\"return\", results);\n\n case 12:\n nextPage = getNextPageUrl(response);\n\n if (nextPage) {\n _context.next = 15;\n break;\n }\n\n return _context.abrupt(\"return\", results);\n\n case 15:\n // Iteratively fetch all remaining pages until no \"next\" header is found.\n mergedResults = [].concat(results);\n\n case 16:\n if (!nextPage) {\n _context.next = 27;\n break;\n }\n\n _context.next = 19;\n return next(Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__[\"default\"])({}, options, {\n // Ensure the URL for the next page is used instead of any provided path.\n path: undefined,\n url: nextPage,\n // Ensure we still get headers so we can identify the next page.\n parse: false\n }));\n\n case 19:\n nextResponse = _context.sent;\n _context.next = 22;\n return parseResponse(nextResponse);\n\n case 22:\n nextResults = _context.sent;\n mergedResults = mergedResults.concat(nextResults);\n nextPage = getNextPageUrl(nextResponse);\n _context.next = 16;\n break;\n\n case 27:\n return _context.abrupt(\"return\", mergedResults);\n\n case 28:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee, this);\n }));\n\n return function fetchAllMiddleware(_x, _x2) {\n return _ref2.apply(this, arguments);\n };\n}();\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (fetchAllMiddleware);\n\n\n//# sourceURL=webpack://wp.%5Bname%5D/./node_modules/@wordpress/api-fetch/build-module/middlewares/fetch-all-middleware.js?"); /***/ }), @@ -602,58 +179,7 @@ function () { /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectSpread */ "./node_modules/@babel/runtime/helpers/esm/objectSpread.js"); - - -/** - * Set of HTTP methods which are eligible to be overridden. - * - * @type {Set} - */ -var OVERRIDE_METHODS = new Set(['PATCH', 'PUT', 'DELETE']); -/** - * Default request method. - * - * "A request has an associated method (a method). Unless stated otherwise it - * is `GET`." - * - * @see https://fetch.spec.whatwg.org/#requests - * - * @type {string} - */ - -var DEFAULT_METHOD = 'GET'; -/** - * API Fetch middleware which overrides the request method for HTTP v1 - * compatibility leveraging the REST API X-HTTP-Method-Override header. - * - * @param {Object} options Fetch options. - * @param {Function} next [description] - * - * @return {*} The evaluated result of the remaining middleware chain. - */ - -function httpV1Middleware(options, next) { - var _options = options, - _options$method = _options.method, - method = _options$method === void 0 ? DEFAULT_METHOD : _options$method; - - if (OVERRIDE_METHODS.has(method.toUpperCase())) { - options = Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__["default"])({}, options, { - headers: Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__["default"])({}, options.headers, { - 'X-HTTP-Method-Override': method, - 'Content-Type': 'application/json' - }), - method: 'POST' - }); - } - - return next(options, next); -} - -/* harmony default export */ __webpack_exports__["default"] = (httpV1Middleware); - +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectSpread */ \"./node_modules/@babel/runtime/helpers/esm/objectSpread.js\");\n\n\n/**\n * Set of HTTP methods which are eligible to be overridden.\n *\n * @type {Set}\n */\nvar OVERRIDE_METHODS = new Set(['PATCH', 'PUT', 'DELETE']);\n/**\n * Default request method.\n *\n * \"A request has an associated method (a method). Unless stated otherwise it\n * is `GET`.\"\n *\n * @see https://fetch.spec.whatwg.org/#requests\n *\n * @type {string}\n */\n\nvar DEFAULT_METHOD = 'GET';\n/**\n * API Fetch middleware which overrides the request method for HTTP v1\n * compatibility leveraging the REST API X-HTTP-Method-Override header.\n *\n * @param {Object} options Fetch options.\n * @param {Function} next [description]\n *\n * @return {*} The evaluated result of the remaining middleware chain.\n */\n\nfunction httpV1Middleware(options, next) {\n var _options = options,\n _options$method = _options.method,\n method = _options$method === void 0 ? DEFAULT_METHOD : _options$method;\n\n if (OVERRIDE_METHODS.has(method.toUpperCase())) {\n options = Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__[\"default\"])({}, options, {\n headers: Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__[\"default\"])({}, options.headers, {\n 'X-HTTP-Method-Override': method,\n 'Content-Type': 'application/json'\n }),\n method: 'POST'\n });\n }\n\n return next(options, next);\n}\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (httpV1Middleware);\n\n\n//# sourceURL=webpack://wp.%5Bname%5D/./node_modules/@wordpress/api-fetch/build-module/middlewares/http-v1.js?"); /***/ }), @@ -665,34 +191,7 @@ function httpV1Middleware(options, next) { /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectSpread */ "./node_modules/@babel/runtime/helpers/esm/objectSpread.js"); - - -var namespaceAndEndpointMiddleware = function namespaceAndEndpointMiddleware(options, next) { - var path = options.path; - var namespaceTrimmed, endpointTrimmed; - - if (typeof options.namespace === 'string' && typeof options.endpoint === 'string') { - namespaceTrimmed = options.namespace.replace(/^\/|\/$/g, ''); - endpointTrimmed = options.endpoint.replace(/^\//, ''); - - if (endpointTrimmed) { - path = namespaceTrimmed + '/' + endpointTrimmed; - } else { - path = namespaceTrimmed; - } - } - - delete options.namespace; - delete options.endpoint; - return next(Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__["default"])({}, options, { - path: path - })); -}; - -/* harmony default export */ __webpack_exports__["default"] = (namespaceAndEndpointMiddleware); - +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectSpread */ \"./node_modules/@babel/runtime/helpers/esm/objectSpread.js\");\n\n\nvar namespaceAndEndpointMiddleware = function namespaceAndEndpointMiddleware(options, next) {\n var path = options.path;\n var namespaceTrimmed, endpointTrimmed;\n\n if (typeof options.namespace === 'string' && typeof options.endpoint === 'string') {\n namespaceTrimmed = options.namespace.replace(/^\\/|\\/$/g, '');\n endpointTrimmed = options.endpoint.replace(/^\\//, '');\n\n if (endpointTrimmed) {\n path = namespaceTrimmed + '/' + endpointTrimmed;\n } else {\n path = namespaceTrimmed;\n }\n }\n\n delete options.namespace;\n delete options.endpoint;\n return next(Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__[\"default\"])({}, options, {\n path: path\n }));\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (namespaceAndEndpointMiddleware);\n\n\n//# sourceURL=webpack://wp.%5Bname%5D/./node_modules/@wordpress/api-fetch/build-module/middlewares/namespace-endpoint.js?"); /***/ }), @@ -704,61 +203,7 @@ var namespaceAndEndpointMiddleware = function namespaceAndEndpointMiddleware(opt /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectSpread */ "./node_modules/@babel/runtime/helpers/esm/objectSpread.js"); -/* harmony import */ var _wordpress_hooks__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/hooks */ "@wordpress/hooks"); -/* harmony import */ var _wordpress_hooks__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_1__); - - -/** - * External dependencies - */ - - -var createNonceMiddleware = function createNonceMiddleware(nonce) { - var usedNonce = nonce; - /** - * This is not ideal but it's fine for now. - * - * Configure heartbeat to refresh the wp-api nonce, keeping the editor - * authorization intact. - */ - - Object(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_1__["addAction"])('heartbeat.tick', 'core/api-fetch/create-nonce-middleware', function (response) { - if (response['rest-nonce']) { - usedNonce = response['rest-nonce']; - } - }); - return function (options, next) { - var headers = options.headers || {}; // If an 'X-WP-Nonce' header (or any case-insensitive variation - // thereof) was specified, no need to add a nonce header. - - var addNonceHeader = true; - - for (var headerName in headers) { - if (headers.hasOwnProperty(headerName)) { - if (headerName.toLowerCase() === 'x-wp-nonce') { - addNonceHeader = false; - break; - } - } - } - - if (addNonceHeader) { - // Do not mutate the original headers object, if any. - headers = Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__["default"])({}, headers, { - 'X-WP-Nonce': usedNonce - }); - } - - return next(Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__["default"])({}, options, { - headers: headers - })); - }; -}; - -/* harmony default export */ __webpack_exports__["default"] = (createNonceMiddleware); - +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectSpread */ \"./node_modules/@babel/runtime/helpers/esm/objectSpread.js\");\n/* harmony import */ var _wordpress_hooks__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/hooks */ \"@wordpress/hooks\");\n/* harmony import */ var _wordpress_hooks__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_1__);\n\n\n/**\n * External dependencies\n */\n\n\nvar createNonceMiddleware = function createNonceMiddleware(nonce) {\n var usedNonce = nonce;\n /**\n * This is not ideal but it's fine for now.\n *\n * Configure heartbeat to refresh the wp-api nonce, keeping the editor\n * authorization intact.\n */\n\n Object(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_1__[\"addAction\"])('heartbeat.tick', 'core/api-fetch/create-nonce-middleware', function (response) {\n if (response['rest-nonce']) {\n usedNonce = response['rest-nonce'];\n }\n });\n return function (options, next) {\n var headers = options.headers || {}; // If an 'X-WP-Nonce' header (or any case-insensitive variation\n // thereof) was specified, no need to add a nonce header.\n\n var addNonceHeader = true;\n\n for (var headerName in headers) {\n if (headers.hasOwnProperty(headerName)) {\n if (headerName.toLowerCase() === 'x-wp-nonce') {\n addNonceHeader = false;\n break;\n }\n }\n }\n\n if (addNonceHeader) {\n // Do not mutate the original headers object, if any.\n headers = Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__[\"default\"])({}, headers, {\n 'X-WP-Nonce': usedNonce\n });\n }\n\n return next(Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__[\"default\"])({}, options, {\n headers: headers\n }));\n };\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (createNonceMiddleware);\n\n\n//# sourceURL=webpack://wp.%5Bname%5D/./node_modules/@wordpress/api-fetch/build-module/middlewares/nonce.js?"); /***/ }), @@ -770,53 +215,7 @@ var createNonceMiddleware = function createNonceMiddleware(nonce) { /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -__webpack_require__.r(__webpack_exports__); -var createPreloadingMiddleware = function createPreloadingMiddleware(preloadedData) { - return function (options, next) { - function getStablePath(path) { - var splitted = path.split('?'); - var query = splitted[1]; - var base = splitted[0]; - - if (!query) { - return base; - } // 'b=1&c=2&a=5' - - - return base + '?' + query // [ 'b=1', 'c=2', 'a=5' ] - .split('&') // [ [ 'b, '1' ], [ 'c', '2' ], [ 'a', '5' ] ] - .map(function (entry) { - return entry.split('='); - }) // [ [ 'a', '5' ], [ 'b, '1' ], [ 'c', '2' ] ] - .sort(function (a, b) { - return a[0].localeCompare(b[0]); - }) // [ 'a=5', 'b=1', 'c=2' ] - .map(function (pair) { - return pair.join('='); - }) // 'a=5&b=1&c=2' - .join('&'); - } - - var _options$parse = options.parse, - parse = _options$parse === void 0 ? true : _options$parse; - - if (typeof options.path === 'string') { - var method = options.method || 'GET'; - var path = getStablePath(options.path); - - if (parse && 'GET' === method && preloadedData[path]) { - return Promise.resolve(preloadedData[path].body); - } else if ('OPTIONS' === method && preloadedData[method][path]) { - return Promise.resolve(preloadedData[method][path]); - } - } - - return next(options); - }; -}; - -/* harmony default export */ __webpack_exports__["default"] = (createPreloadingMiddleware); - +eval("__webpack_require__.r(__webpack_exports__);\nvar createPreloadingMiddleware = function createPreloadingMiddleware(preloadedData) {\n return function (options, next) {\n function getStablePath(path) {\n var splitted = path.split('?');\n var query = splitted[1];\n var base = splitted[0];\n\n if (!query) {\n return base;\n } // 'b=1&c=2&a=5'\n\n\n return base + '?' + query // [ 'b=1', 'c=2', 'a=5' ]\n .split('&') // [ [ 'b, '1' ], [ 'c', '2' ], [ 'a', '5' ] ]\n .map(function (entry) {\n return entry.split('=');\n }) // [ [ 'a', '5' ], [ 'b, '1' ], [ 'c', '2' ] ]\n .sort(function (a, b) {\n return a[0].localeCompare(b[0]);\n }) // [ 'a=5', 'b=1', 'c=2' ]\n .map(function (pair) {\n return pair.join('=');\n }) // 'a=5&b=1&c=2'\n .join('&');\n }\n\n var _options$parse = options.parse,\n parse = _options$parse === void 0 ? true : _options$parse;\n\n if (typeof options.path === 'string') {\n var method = options.method || 'GET';\n var path = getStablePath(options.path);\n\n if (parse && 'GET' === method && preloadedData[path]) {\n return Promise.resolve(preloadedData[path].body);\n } else if ('OPTIONS' === method && preloadedData[method][path]) {\n return Promise.resolve(preloadedData[method][path]);\n }\n }\n\n return next(options);\n };\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (createPreloadingMiddleware);\n\n\n//# sourceURL=webpack://wp.%5Bname%5D/./node_modules/@wordpress/api-fetch/build-module/middlewares/preloading.js?"); /***/ }), @@ -828,49 +227,7 @@ var createPreloadingMiddleware = function createPreloadingMiddleware(preloadedDa /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectSpread */ "./node_modules/@babel/runtime/helpers/esm/objectSpread.js"); -/* harmony import */ var _namespace_endpoint__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./namespace-endpoint */ "./node_modules/@wordpress/api-fetch/build-module/middlewares/namespace-endpoint.js"); - - -/** - * Internal dependencies - */ - - -var createRootURLMiddleware = function createRootURLMiddleware(rootURL) { - return function (options, next) { - return Object(_namespace_endpoint__WEBPACK_IMPORTED_MODULE_1__["default"])(options, function (optionsWithPath) { - var url = optionsWithPath.url; - var path = optionsWithPath.path; - var apiRoot; - - if (typeof path === 'string') { - apiRoot = rootURL; - - if (-1 !== rootURL.indexOf('?')) { - path = path.replace('?', '&'); - } - - path = path.replace(/^\//, ''); // API root may already include query parameter prefix if site is - // configured to use plain permalinks. - - if ('string' === typeof apiRoot && -1 !== apiRoot.indexOf('?')) { - path = path.replace('?', '&'); - } - - url = apiRoot + path; - } - - return next(Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__["default"])({}, optionsWithPath, { - url: url - })); - }); - }; -}; - -/* harmony default export */ __webpack_exports__["default"] = (createRootURLMiddleware); - +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectSpread */ \"./node_modules/@babel/runtime/helpers/esm/objectSpread.js\");\n/* harmony import */ var _namespace_endpoint__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./namespace-endpoint */ \"./node_modules/@wordpress/api-fetch/build-module/middlewares/namespace-endpoint.js\");\n\n\n/**\n * Internal dependencies\n */\n\n\nvar createRootURLMiddleware = function createRootURLMiddleware(rootURL) {\n return function (options, next) {\n return Object(_namespace_endpoint__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(options, function (optionsWithPath) {\n var url = optionsWithPath.url;\n var path = optionsWithPath.path;\n var apiRoot;\n\n if (typeof path === 'string') {\n apiRoot = rootURL;\n\n if (-1 !== rootURL.indexOf('?')) {\n path = path.replace('?', '&');\n }\n\n path = path.replace(/^\\//, ''); // API root may already include query parameter prefix if site is\n // configured to use plain permalinks.\n\n if ('string' === typeof apiRoot && -1 !== apiRoot.indexOf('?')) {\n path = path.replace('?', '&');\n }\n\n url = apiRoot + path;\n }\n\n return next(Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__[\"default\"])({}, optionsWithPath, {\n url: url\n }));\n });\n };\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (createRootURLMiddleware);\n\n\n//# sourceURL=webpack://wp.%5Bname%5D/./node_modules/@wordpress/api-fetch/build-module/middlewares/root-url.js?"); /***/ }), @@ -882,32 +239,7 @@ var createRootURLMiddleware = function createRootURLMiddleware(rootURL) { /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/url */ "@wordpress/url"); -/* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_url__WEBPACK_IMPORTED_MODULE_0__); -/** - * WordPress dependencies - */ - - -function userLocaleMiddleware(options, next) { - if (typeof options.url === 'string' && !Object(_wordpress_url__WEBPACK_IMPORTED_MODULE_0__["hasQueryArg"])(options.url, '_locale')) { - options.url = Object(_wordpress_url__WEBPACK_IMPORTED_MODULE_0__["addQueryArgs"])(options.url, { - _locale: 'user' - }); - } - - if (typeof options.path === 'string' && !Object(_wordpress_url__WEBPACK_IMPORTED_MODULE_0__["hasQueryArg"])(options.path, '_locale')) { - options.path = Object(_wordpress_url__WEBPACK_IMPORTED_MODULE_0__["addQueryArgs"])(options.path, { - _locale: 'user' - }); - } - - return next(options, next); -} - -/* harmony default export */ __webpack_exports__["default"] = (userLocaleMiddleware); - +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/url */ \"@wordpress/url\");\n/* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_url__WEBPACK_IMPORTED_MODULE_0__);\n/**\n * WordPress dependencies\n */\n\n\nfunction userLocaleMiddleware(options, next) {\n if (typeof options.url === 'string' && !Object(_wordpress_url__WEBPACK_IMPORTED_MODULE_0__[\"hasQueryArg\"])(options.url, '_locale')) {\n options.url = Object(_wordpress_url__WEBPACK_IMPORTED_MODULE_0__[\"addQueryArgs\"])(options.url, {\n _locale: 'user'\n });\n }\n\n if (typeof options.path === 'string' && !Object(_wordpress_url__WEBPACK_IMPORTED_MODULE_0__[\"hasQueryArg\"])(options.path, '_locale')) {\n options.path = Object(_wordpress_url__WEBPACK_IMPORTED_MODULE_0__[\"addQueryArgs\"])(options.path, {\n _locale: 'user'\n });\n }\n\n return next(options, next);\n}\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (userLocaleMiddleware);\n\n\n//# sourceURL=webpack://wp.%5Bname%5D/./node_modules/@wordpress/api-fetch/build-module/middlewares/user-locale.js?"); /***/ }), @@ -918,7 +250,7 @@ function userLocaleMiddleware(options, next) { /*! no static exports found */ /***/ (function(module, exports) { -(function() { module.exports = this["wp"]["hooks"]; }()); +eval("(function() { module.exports = this[\"wp\"][\"hooks\"]; }());\n\n//# sourceURL=webpack://wp.%5Bname%5D/external_%7B%22this%22:%5B%22wp%22,%22hooks%22%5D%7D?"); /***/ }), @@ -929,7 +261,7 @@ function userLocaleMiddleware(options, next) { /*! no static exports found */ /***/ (function(module, exports) { -(function() { module.exports = this["wp"]["i18n"]; }()); +eval("(function() { module.exports = this[\"wp\"][\"i18n\"]; }());\n\n//# sourceURL=webpack://wp.%5Bname%5D/external_%7B%22this%22:%5B%22wp%22,%22i18n%22%5D%7D?"); /***/ }), @@ -940,9 +272,8 @@ function userLocaleMiddleware(options, next) { /*! no static exports found */ /***/ (function(module, exports) { -(function() { module.exports = this["wp"]["url"]; }()); +eval("(function() { module.exports = this[\"wp\"][\"url\"]; }());\n\n//# sourceURL=webpack://wp.%5Bname%5D/external_%7B%22this%22:%5B%22wp%22,%22url%22%5D%7D?"); /***/ }) -/******/ })["default"]; -//# sourceMappingURL=api-fetch.js.map \ No newline at end of file +/******/ })["default"]; \ No newline at end of file diff --git a/wp-includes/js/dist/api-fetch.js.map b/wp-includes/js/dist/api-fetch.js.map deleted file mode 100644 index 819b67e05a..0000000000 --- a/wp-includes/js/dist/api-fetch.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["webpack://wp.[name]/webpack/bootstrap","webpack://wp.[name]/./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js","webpack://wp.[name]/./node_modules/@babel/runtime/helpers/esm/defineProperty.js","webpack://wp.[name]/./node_modules/@babel/runtime/helpers/esm/objectSpread.js","webpack://wp.[name]/./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js","webpack://wp.[name]/./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js","webpack://wp.[name]//Users/riad/Workspace/a8c/gutenberg/packages/api-fetch/src/index.js","webpack://wp.[name]//Users/riad/Workspace/a8c/gutenberg/packages/api-fetch/src/middlewares/fetch-all-middleware.js","webpack://wp.[name]//Users/riad/Workspace/a8c/gutenberg/packages/api-fetch/src/middlewares/http-v1.js","webpack://wp.[name]//Users/riad/Workspace/a8c/gutenberg/packages/api-fetch/src/middlewares/namespace-endpoint.js","webpack://wp.[name]//Users/riad/Workspace/a8c/gutenberg/packages/api-fetch/src/middlewares/nonce.js","webpack://wp.[name]//Users/riad/Workspace/a8c/gutenberg/packages/api-fetch/src/middlewares/preloading.js","webpack://wp.[name]//Users/riad/Workspace/a8c/gutenberg/packages/api-fetch/src/middlewares/root-url.js","webpack://wp.[name]//Users/riad/Workspace/a8c/gutenberg/packages/api-fetch/src/middlewares/user-locale.js","webpack://wp.[name]/external {\"this\":[\"wp\",\"hooks\"]}","webpack://wp.[name]/external {\"this\":[\"wp\",\"i18n\"]}","webpack://wp.[name]/external {\"this\":[\"wp\",\"url\"]}"],"names":["DEFAULT_HEADERS","Accept","DEFAULT_OPTIONS","credentials","middlewares","registerMiddleware","middleware","push","apiFetch","options","raw","nextOptions","url","path","data","parse","remainingOptions","body","headers","JSON","stringify","responsePromise","window","fetch","checkStatus","response","status","parseResponse","json","Promise","reject","then","catch","invalidJsonError","code","message","__","error","unknownError","steps","fetchAllMiddleware","httpV1Middleware","namespaceEndpointMiddleware","userLocaleMiddleware","reverse","runMiddleware","index","nextMiddleware","next","use","createNonceMiddleware","createPreloadingMiddleware","createRootURLMiddleware","modifyQuery","queryArgs","addQueryArgs","parseLinkHeader","linkHeader","match","getNextPageUrl","get","requestContainsUnboundedQuery","pathIsUnbounded","indexOf","urlIsUnbounded","per_page","results","Array","isArray","nextPage","mergedResults","concat","undefined","nextResponse","nextResults","OVERRIDE_METHODS","Set","DEFAULT_METHOD","method","has","toUpperCase","namespaceAndEndpointMiddleware","namespaceTrimmed","endpointTrimmed","namespace","endpoint","replace","nonce","usedNonce","addAction","addNonceHeader","headerName","hasOwnProperty","toLowerCase","preloadedData","getStablePath","splitted","split","query","base","map","entry","sort","a","b","localeCompare","pair","join","resolve","rootURL","optionsWithPath","apiRoot","hasQueryArg","_locale"],"mappings":";;AAAA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,kDAA0C,gCAAgC;AAC1E;AACA;;AAEA;AACA;AACA;AACA,gEAAwD,kBAAkB;AAC1E;AACA,yDAAiD,cAAc;AAC/D;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAyC,iCAAiC;AAC1E,wHAAgH,mBAAmB,EAAE;AACrI;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;;AAGA;AACA;;;;;;;;;;;;;AClFA;AAAA;AAAA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEe;AACf;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;AACL;AACA,C;;;;;;;;;;;;AClCA;AAAA;AAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;;AAEA;AACA,C;;;;;;;;;;;;ACbA;AAAA;AAAA;AAA8C;AAC/B;AACf,iBAAiB,sBAAsB;AACvC;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA,MAAM,+DAAc;AACpB,KAAK;AACL;;AAEA;AACA,C;;;;;;;;;;;;AClBA;AAAA;AAAA;AAA0E;AAC3D;AACf;AACA,eAAe,6EAA4B;AAC3C;;AAEA;AACA;;AAEA,eAAe,6BAA6B;AAC5C;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,C;;;;;;;;;;;;AClBA;AAAA;AAAe;AACf;AACA;AACA;AACA;;AAEA,aAAa,uBAAuB;AACpC;AACA;AACA;AACA;;AAEA;AACA,C;;;;;;;;;;;;;;;;;;;;;;;;;;;ACbA;;;AAGA;AAEA;;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;;;;;;;AAMA,IAAMA,eAAe,GAAG;AACvB;AACA;AACA;AACA;AACAC,QAAM,EAAE;AALe,CAAxB;AAQA;;;;;;;AAM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AxC,EAA+C;AAC9C,MAAK,OAAOvC,OAAO,CAACG,GAAf,KAAuB,QAAvB,IAAmC,CAAEoG,kEAAW,CAAEvG,OAAO,CAACG,GAAV,EAAe,SAAf,CAArD,EAAkF;AACjFH,WAAO,CAACG,GAAR,GAAc2C,mEAAY,CAAE9C,OAAO,CAACG,GAAV,EAAe;AAAEqG,aAAO,EAAE;AAAX,KAAf,CAA1B;AACA;;AAED,MAAK,OAAOxG,OAAO,CAACI,IAAf,KAAwB,QAAxB,IAAoC,CAAEmG,kEAAW,CAAEvG,OAAO,CAACI,IAAV,EAAgB,SAAhB,CAAtD,EAAoF;AACnFJ,WAAO,CAACI,IAAR,GAAe0C,mEAAY,CAAE9C,OAAO,CAACI,IAAV,EAAgB;AAAEoG,aAAO,EAAE;AAAX,KAAhB,CAA3B;AACA;;AAED,SAAOjE,IAAI,CAAEvC,OAAF,EAAWuC,IAAX,CAAX;AACA;;AAEcL,mFAAf;;;;;;;;;;;;ACjBA,aAAa,sCAAsC,EAAE,I;;;;;;;;;;;ACArD,aAAa,qCAAqC,EAAE,I;;;;;;;;;;;ACApD,aAAa,oCAAoC,EAAE,I","file":"api-fetch.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./node_modules/@wordpress/api-fetch/build-module/index.js\");\n","function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {\n try {\n var info = gen[key](arg);\n var value = info.value;\n } catch (error) {\n reject(error);\n return;\n }\n\n if (info.done) {\n resolve(value);\n } else {\n Promise.resolve(value).then(_next, _throw);\n }\n}\n\nexport default function _asyncToGenerator(fn) {\n return function () {\n var self = this,\n args = arguments;\n return new Promise(function (resolve, reject) {\n var gen = fn.apply(self, args);\n\n function _next(value) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value);\n }\n\n function _throw(err) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err);\n }\n\n _next(undefined);\n });\n };\n}","export default function _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}","import defineProperty from \"./defineProperty\";\nexport default function _objectSpread(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n var ownKeys = Object.keys(source);\n\n if (typeof Object.getOwnPropertySymbols === 'function') {\n ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {\n return Object.getOwnPropertyDescriptor(source, sym).enumerable;\n }));\n }\n\n ownKeys.forEach(function (key) {\n defineProperty(target, key, source[key]);\n });\n }\n\n return target;\n}","import objectWithoutPropertiesLoose from \"./objectWithoutPropertiesLoose\";\nexport default function _objectWithoutProperties(source, excluded) {\n if (source == null) return {};\n var target = objectWithoutPropertiesLoose(source, excluded);\n var key, i;\n\n if (Object.getOwnPropertySymbols) {\n var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n\n for (i = 0; i < sourceSymbolKeys.length; i++) {\n key = sourceSymbolKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n target[key] = source[key];\n }\n }\n\n return target;\n}","export default function _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}","/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport createNonceMiddleware from './middlewares/nonce';\nimport createRootURLMiddleware from './middlewares/root-url';\nimport createPreloadingMiddleware from './middlewares/preloading';\nimport fetchAllMiddleware from './middlewares/fetch-all-middleware';\nimport namespaceEndpointMiddleware from './middlewares/namespace-endpoint';\nimport httpV1Middleware from './middlewares/http-v1';\nimport userLocaleMiddleware from './middlewares/user-locale';\n\n/**\n * Default set of header values which should be sent with every request unless\n * explicitly provided through apiFetch options.\n *\n * @type {Object}\n */\nconst DEFAULT_HEADERS = {\n\t// The backend uses the Accept header as a condition for considering an\n\t// incoming request as a REST request.\n\t//\n\t// See: https://core.trac.wordpress.org/ticket/44534\n\tAccept: 'application/json, */*;q=0.1',\n};\n\n/**\n * Default set of fetch option values which should be sent with every request\n * unless explicitly provided through apiFetch options.\n *\n * @type {Object}\n */\nconst DEFAULT_OPTIONS = {\n\tcredentials: 'include',\n};\n\nconst middlewares = [];\n\nfunction registerMiddleware( middleware ) {\n\tmiddlewares.push( middleware );\n}\n\nfunction apiFetch( options ) {\n\tconst raw = ( nextOptions ) => {\n\t\tconst { url, path, data, parse = true, ...remainingOptions } = nextOptions;\n\t\tlet { body, headers } = nextOptions;\n\n\t\t// Merge explicitly-provided headers with default values.\n\t\theaders = { ...DEFAULT_HEADERS, ...headers };\n\n\t\t// The `data` property is a shorthand for sending a JSON body.\n\t\tif ( data ) {\n\t\t\tbody = JSON.stringify( data );\n\t\t\theaders[ 'Content-Type' ] = 'application/json';\n\t\t}\n\n\t\tconst responsePromise = window.fetch(\n\t\t\turl || path,\n\t\t\t{\n\t\t\t\t...DEFAULT_OPTIONS,\n\t\t\t\t...remainingOptions,\n\t\t\t\tbody,\n\t\t\t\theaders,\n\t\t\t}\n\t\t);\n\t\tconst checkStatus = ( response ) => {\n\t\t\tif ( response.status >= 200 && response.status < 300 ) {\n\t\t\t\treturn response;\n\t\t\t}\n\n\t\t\tthrow response;\n\t\t};\n\n\t\tconst parseResponse = ( response ) => {\n\t\t\tif ( parse ) {\n\t\t\t\tif ( response.status === 204 ) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\treturn response.json ? response.json() : Promise.reject( response );\n\t\t\t}\n\n\t\t\treturn response;\n\t\t};\n\n\t\treturn responsePromise\n\t\t\t.then( checkStatus )\n\t\t\t.then( parseResponse )\n\t\t\t.catch( ( response ) => {\n\t\t\t\tif ( ! parse ) {\n\t\t\t\t\tthrow response;\n\t\t\t\t}\n\n\t\t\t\tconst invalidJsonError = {\n\t\t\t\t\tcode: 'invalid_json',\n\t\t\t\t\tmessage: __( 'The response is not a valid JSON response.' ),\n\t\t\t\t};\n\n\t\t\t\tif ( ! response || ! response.json ) {\n\t\t\t\t\tthrow invalidJsonError;\n\t\t\t\t}\n\n\t\t\t\treturn response.json()\n\t\t\t\t\t.catch( () => {\n\t\t\t\t\t\tthrow invalidJsonError;\n\t\t\t\t\t} )\n\t\t\t\t\t.then( ( error ) => {\n\t\t\t\t\t\tconst unknownError = {\n\t\t\t\t\t\t\tcode: 'unknown_error',\n\t\t\t\t\t\t\tmessage: __( 'An unknown error occurred.' ),\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\tthrow error || unknownError;\n\t\t\t\t\t} );\n\t\t\t} );\n\t};\n\n\tconst steps = [\n\t\traw,\n\t\tfetchAllMiddleware,\n\t\thttpV1Middleware,\n\t\tnamespaceEndpointMiddleware,\n\t\tuserLocaleMiddleware,\n\t\t...middlewares,\n\t].reverse();\n\n\tconst runMiddleware = ( index ) => ( nextOptions ) => {\n\t\tconst nextMiddleware = steps[ index ];\n\t\tconst next = runMiddleware( index + 1 );\n\t\treturn nextMiddleware( nextOptions, next );\n\t};\n\n\treturn runMiddleware( 0 )( options );\n}\n\napiFetch.use = registerMiddleware;\n\napiFetch.createNonceMiddleware = createNonceMiddleware;\napiFetch.createPreloadingMiddleware = createPreloadingMiddleware;\napiFetch.createRootURLMiddleware = createRootURLMiddleware;\napiFetch.fetchAllMiddleware = fetchAllMiddleware;\n\nexport default apiFetch;\n","/**\n * WordPress dependencies\n */\nimport { addQueryArgs } from '@wordpress/url';\n\n// Apply query arguments to both URL and Path, whichever is present.\nconst modifyQuery = ( { path, url, ...options }, queryArgs ) => ( {\n\t...options,\n\turl: url && addQueryArgs( url, queryArgs ),\n\tpath: path && addQueryArgs( path, queryArgs ),\n} );\n\n// Duplicates parsing functionality from apiFetch.\nconst parseResponse = ( response ) => response.json ?\n\tresponse.json() :\n\tPromise.reject( response );\n\nconst parseLinkHeader = ( linkHeader ) => {\n\tif ( ! linkHeader ) {\n\t\treturn {};\n\t}\n\tconst match = linkHeader.match( /<([^>]+)>; rel=\"next\"/ );\n\treturn match ? {\n\t\tnext: match[ 1 ],\n\t} : {};\n};\n\nconst getNextPageUrl = ( response ) => {\n\tconst { next } = parseLinkHeader( response.headers.get( 'link' ) );\n\treturn next;\n};\n\nconst requestContainsUnboundedQuery = ( options ) => {\n\tconst pathIsUnbounded = options.path && options.path.indexOf( 'per_page=-1' ) !== -1;\n\tconst urlIsUnbounded = options.url && options.url.indexOf( 'per_page=-1' ) !== -1;\n\treturn pathIsUnbounded || urlIsUnbounded;\n};\n\n// The REST API enforces an upper limit on the per_page option. To handle large\n// collections, apiFetch consumers can pass `per_page=-1`; this middleware will\n// then recursively assemble a full response array from all available pages.\nconst fetchAllMiddleware = async ( options, next ) => {\n\tif ( options.parse === false ) {\n\t\t// If a consumer has opted out of parsing, do not apply middleware.\n\t\treturn next( options );\n\t}\n\tif ( ! requestContainsUnboundedQuery( options ) ) {\n\t\t// If neither url nor path is requesting all items, do not apply middleware.\n\t\treturn next( options );\n\t}\n\n\t// Retrieve requested page of results.\n\tconst response = await next( {\n\t\t...modifyQuery( options, {\n\t\t\tper_page: 100,\n\t\t} ),\n\t\t// Ensure headers are returned for page 1.\n\t\tparse: false,\n\t} );\n\n\tconst results = await parseResponse( response );\n\n\tif ( ! Array.isArray( results ) ) {\n\t\t// We have no reliable way of merging non-array results.\n\t\treturn results;\n\t}\n\n\tlet nextPage = getNextPageUrl( response );\n\n\tif ( ! nextPage ) {\n\t\t// There are no further pages to request.\n\t\treturn results;\n\t}\n\n\t// Iteratively fetch all remaining pages until no \"next\" header is found.\n\tlet mergedResults = [].concat( results );\n\twhile ( nextPage ) {\n\t\tconst nextResponse = await next( {\n\t\t\t...options,\n\t\t\t// Ensure the URL for the next page is used instead of any provided path.\n\t\t\tpath: undefined,\n\t\t\turl: nextPage,\n\t\t\t// Ensure we still get headers so we can identify the next page.\n\t\t\tparse: false,\n\t\t} );\n\t\tconst nextResults = await parseResponse( nextResponse );\n\t\tmergedResults = mergedResults.concat( nextResults );\n\t\tnextPage = getNextPageUrl( nextResponse );\n\t}\n\treturn mergedResults;\n};\n\nexport default fetchAllMiddleware;\n","/**\n * Set of HTTP methods which are eligible to be overridden.\n *\n * @type {Set}\n */\nconst OVERRIDE_METHODS = new Set( [\n\t'PATCH',\n\t'PUT',\n\t'DELETE',\n] );\n\n/**\n * Default request method.\n *\n * \"A request has an associated method (a method). Unless stated otherwise it\n * is `GET`.\"\n *\n * @see https://fetch.spec.whatwg.org/#requests\n *\n * @type {string}\n */\nconst DEFAULT_METHOD = 'GET';\n\n/**\n * API Fetch middleware which overrides the request method for HTTP v1\n * compatibility leveraging the REST API X-HTTP-Method-Override header.\n *\n * @param {Object} options Fetch options.\n * @param {Function} next [description]\n *\n * @return {*} The evaluated result of the remaining middleware chain.\n */\nfunction httpV1Middleware( options, next ) {\n\tconst { method = DEFAULT_METHOD } = options;\n\tif ( OVERRIDE_METHODS.has( method.toUpperCase() ) ) {\n\t\toptions = {\n\t\t\t...options,\n\t\t\theaders: {\n\t\t\t\t...options.headers,\n\t\t\t\t'X-HTTP-Method-Override': method,\n\t\t\t\t'Content-Type': 'application/json',\n\t\t\t},\n\t\t\tmethod: 'POST',\n\t\t};\n\t}\n\n\treturn next( options, next );\n}\n\nexport default httpV1Middleware;\n","const namespaceAndEndpointMiddleware = ( options, next ) => {\n\tlet path = options.path;\n\tlet namespaceTrimmed, endpointTrimmed;\n\n\tif (\n\t\ttypeof options.namespace === 'string' &&\n\t\t\ttypeof options.endpoint === 'string'\n\t) {\n\t\tnamespaceTrimmed = options.namespace.replace( /^\\/|\\/$/g, '' );\n\t\tendpointTrimmed = options.endpoint.replace( /^\\//, '' );\n\t\tif ( endpointTrimmed ) {\n\t\t\tpath = namespaceTrimmed + '/' + endpointTrimmed;\n\t\t} else {\n\t\t\tpath = namespaceTrimmed;\n\t\t}\n\t}\n\n\tdelete options.namespace;\n\tdelete options.endpoint;\n\n\treturn next( {\n\t\t...options,\n\t\tpath,\n\t} );\n};\n\nexport default namespaceAndEndpointMiddleware;\n","/**\n * External dependencies\n */\nimport { addAction } from '@wordpress/hooks';\n\nconst createNonceMiddleware = ( nonce ) => {\n\tlet usedNonce = nonce;\n\n\t/**\n\t * This is not ideal but it's fine for now.\n\t *\n\t * Configure heartbeat to refresh the wp-api nonce, keeping the editor\n\t * authorization intact.\n\t */\n\taddAction( 'heartbeat.tick', 'core/api-fetch/create-nonce-middleware', ( response ) => {\n\t\tif ( response[ 'rest-nonce' ] ) {\n\t\t\tusedNonce = response[ 'rest-nonce' ];\n\t\t}\n\t} );\n\n\treturn function( options, next ) {\n\t\tlet headers = options.headers || {};\n\t\t// If an 'X-WP-Nonce' header (or any case-insensitive variation\n\t\t// thereof) was specified, no need to add a nonce header.\n\t\tlet addNonceHeader = true;\n\t\tfor ( const headerName in headers ) {\n\t\t\tif ( headers.hasOwnProperty( headerName ) ) {\n\t\t\t\tif ( headerName.toLowerCase() === 'x-wp-nonce' ) {\n\t\t\t\t\taddNonceHeader = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( addNonceHeader ) {\n\t\t\t// Do not mutate the original headers object, if any.\n\t\t\theaders = {\n\t\t\t\t...headers,\n\t\t\t\t'X-WP-Nonce': usedNonce,\n\t\t\t};\n\t\t}\n\n\t\treturn next( {\n\t\t\t...options,\n\t\t\theaders,\n\t\t} );\n\t};\n};\n\nexport default createNonceMiddleware;\n","const createPreloadingMiddleware = ( preloadedData ) => ( options, next ) => {\n\tfunction getStablePath( path ) {\n\t\tconst splitted = path.split( '?' );\n\t\tconst query = splitted[ 1 ];\n\t\tconst base = splitted[ 0 ];\n\t\tif ( ! query ) {\n\t\t\treturn base;\n\t\t}\n\n\t\t// 'b=1&c=2&a=5'\n\t\treturn base + '?' + query\n\t\t\t// [ 'b=1', 'c=2', 'a=5' ]\n\t\t\t.split( '&' )\n\t\t\t// [ [ 'b, '1' ], [ 'c', '2' ], [ 'a', '5' ] ]\n\t\t\t.map( function( entry ) {\n\t\t\t\treturn entry.split( '=' );\n\t\t\t} )\n\t\t\t// [ [ 'a', '5' ], [ 'b, '1' ], [ 'c', '2' ] ]\n\t\t\t.sort( function( a, b ) {\n\t\t\t\treturn a[ 0 ].localeCompare( b[ 0 ] );\n\t\t\t} )\n\t\t\t// [ 'a=5', 'b=1', 'c=2' ]\n\t\t\t.map( function( pair ) {\n\t\t\t\treturn pair.join( '=' );\n\t\t\t} )\n\t\t\t// 'a=5&b=1&c=2'\n\t\t\t.join( '&' );\n\t}\n\n\tconst { parse = true } = options;\n\tif ( typeof options.path === 'string' ) {\n\t\tconst method = options.method || 'GET';\n\t\tconst path = getStablePath( options.path );\n\n\t\tif ( parse && 'GET' === method && preloadedData[ path ] ) {\n\t\t\treturn Promise.resolve( preloadedData[ path ].body );\n\t\t} else if ( 'OPTIONS' === method && preloadedData[ method ][ path ] ) {\n\t\t\treturn Promise.resolve( preloadedData[ method ][ path ] );\n\t\t}\n\t}\n\n\treturn next( options );\n};\n\nexport default createPreloadingMiddleware;\n","/**\n * Internal dependencies\n */\nimport namespaceAndEndpointMiddleware from './namespace-endpoint';\n\nconst createRootURLMiddleware = ( rootURL ) => ( options, next ) => {\n\treturn namespaceAndEndpointMiddleware( options, ( optionsWithPath ) => {\n\t\tlet url = optionsWithPath.url;\n\t\tlet path = optionsWithPath.path;\n\t\tlet apiRoot;\n\n\t\tif ( typeof path === 'string' ) {\n\t\t\tapiRoot = rootURL;\n\n\t\t\tif ( -1 !== rootURL.indexOf( '?' ) ) {\n\t\t\t\tpath = path.replace( '?', '&' );\n\t\t\t}\n\n\t\t\tpath = path.replace( /^\\//, '' );\n\n\t\t\t// API root may already include query parameter prefix if site is\n\t\t\t// configured to use plain permalinks.\n\t\t\tif ( 'string' === typeof apiRoot && -1 !== apiRoot.indexOf( '?' ) ) {\n\t\t\t\tpath = path.replace( '?', '&' );\n\t\t\t}\n\n\t\t\turl = apiRoot + path;\n\t\t}\n\n\t\treturn next( {\n\t\t\t...optionsWithPath,\n\t\t\turl,\n\t\t} );\n\t} );\n};\n\nexport default createRootURLMiddleware;\n","/**\n * WordPress dependencies\n */\nimport { addQueryArgs, hasQueryArg } from '@wordpress/url';\n\nfunction userLocaleMiddleware( options, next ) {\n\tif ( typeof options.url === 'string' && ! hasQueryArg( options.url, '_locale' ) ) {\n\t\toptions.url = addQueryArgs( options.url, { _locale: 'user' } );\n\t}\n\n\tif ( typeof options.path === 'string' && ! hasQueryArg( options.path, '_locale' ) ) {\n\t\toptions.path = addQueryArgs( options.path, { _locale: 'user' } );\n\t}\n\n\treturn next( options, next );\n}\n\nexport default userLocaleMiddleware;\n","(function() { module.exports = this[\"wp\"][\"hooks\"]; }());","(function() { module.exports = this[\"wp\"][\"i18n\"]; }());","(function() { module.exports = this[\"wp\"][\"url\"]; }());"],"sourceRoot":""} \ No newline at end of file diff --git a/wp-includes/js/dist/autop.js b/wp-includes/js/dist/autop.js index 38e2e5f09d..1f27e4bbf2 100644 --- a/wp-includes/js/dist/autop.js +++ b/wp-includes/js/dist/autop.js @@ -95,11 +95,7 @@ this["wp"] = this["wp"] || {}; this["wp"]["autop"] = /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _arrayWithHoles; }); -function _arrayWithHoles(arr) { - if (Array.isArray(arr)) return arr; -} +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return _arrayWithHoles; });\nfunction _arrayWithHoles(arr) {\n if (Array.isArray(arr)) return arr;\n}\n\n//# sourceURL=webpack://wp.%5Bname%5D/./node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js?"); /***/ }), @@ -111,33 +107,7 @@ function _arrayWithHoles(arr) { /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _iterableToArrayLimit; }); -function _iterableToArrayLimit(arr, i) { - var _arr = []; - var _n = true; - var _d = false; - var _e = undefined; - - try { - for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { - _arr.push(_s.value); - - if (i && _arr.length === i) break; - } - } catch (err) { - _d = true; - _e = err; - } finally { - try { - if (!_n && _i["return"] != null) _i["return"](); - } finally { - if (_d) throw _e; - } - } - - return _arr; -} +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return _iterableToArrayLimit; });\nfunction _iterableToArrayLimit(arr, i) {\n var _arr = [];\n var _n = true;\n var _d = false;\n var _e = undefined;\n\n try {\n for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {\n _arr.push(_s.value);\n\n if (i && _arr.length === i) break;\n }\n } catch (err) {\n _d = true;\n _e = err;\n } finally {\n try {\n if (!_n && _i[\"return\"] != null) _i[\"return\"]();\n } finally {\n if (_d) throw _e;\n }\n }\n\n return _arr;\n}\n\n//# sourceURL=webpack://wp.%5Bname%5D/./node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js?"); /***/ }), @@ -149,11 +119,7 @@ function _iterableToArrayLimit(arr, i) { /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _nonIterableRest; }); -function _nonIterableRest() { - throw new TypeError("Invalid attempt to destructure non-iterable instance"); -} +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return _nonIterableRest; });\nfunction _nonIterableRest() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance\");\n}\n\n//# sourceURL=webpack://wp.%5Bname%5D/./node_modules/@babel/runtime/helpers/esm/nonIterableRest.js?"); /***/ }), @@ -165,17 +131,7 @@ function _nonIterableRest() { /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _slicedToArray; }); -/* harmony import */ var _arrayWithHoles__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./arrayWithHoles */ "./node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js"); -/* harmony import */ var _iterableToArrayLimit__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./iterableToArrayLimit */ "./node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js"); -/* harmony import */ var _nonIterableRest__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./nonIterableRest */ "./node_modules/@babel/runtime/helpers/esm/nonIterableRest.js"); - - - -function _slicedToArray(arr, i) { - return Object(_arrayWithHoles__WEBPACK_IMPORTED_MODULE_0__["default"])(arr) || Object(_iterableToArrayLimit__WEBPACK_IMPORTED_MODULE_1__["default"])(arr, i) || Object(_nonIterableRest__WEBPACK_IMPORTED_MODULE_2__["default"])(); -} +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return _slicedToArray; });\n/* harmony import */ var _arrayWithHoles__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./arrayWithHoles */ \"./node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js\");\n/* harmony import */ var _iterableToArrayLimit__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./iterableToArrayLimit */ \"./node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js\");\n/* harmony import */ var _nonIterableRest__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./nonIterableRest */ \"./node_modules/@babel/runtime/helpers/esm/nonIterableRest.js\");\n\n\n\nfunction _slicedToArray(arr, i) {\n return Object(_arrayWithHoles__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(arr) || Object(_iterableToArrayLimit__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(arr, i) || Object(_nonIterableRest__WEBPACK_IMPORTED_MODULE_2__[\"default\"])();\n}\n\n//# sourceURL=webpack://wp.%5Bname%5D/./node_modules/@babel/runtime/helpers/esm/slicedToArray.js?"); /***/ }), @@ -187,391 +143,8 @@ function _slicedToArray(arr, i) { /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "autop", function() { return autop; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "removep", function() { return removep; }); -/* harmony import */ var _babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/slicedToArray */ "./node_modules/@babel/runtime/helpers/esm/slicedToArray.js"); - - -/** - * The regular expression for an HTML element. - * - * @type {String} - */ -var htmlSplitRegex = function () { - /* eslint-disable no-multi-spaces */ - var comments = '!' + // Start of comment, after the <. - '(?:' + // Unroll the loop: Consume everything until --> is found. - '-(?!->)' + // Dash not followed by end of comment. - '[^\\-]*' + // Consume non-dashes. - ')*' + // Loop possessively. - '(?:-->)?'; // End of comment. If not found, match all input. - - var cdata = '!\\[CDATA\\[' + // Start of comment, after the <. - '[^\\]]*' + // Consume non-]. - '(?:' + // Unroll the loop: Consume everything until ]]> is found. - '](?!]>)' + // One ] not followed by end of comment. - '[^\\]]*' + // Consume non-]. - ')*?' + // Loop possessively. - '(?:]]>)?'; // End of comment. If not found, match all input. - - var escaped = '(?=' + // Is the element escaped? - '!--' + '|' + '!\\[CDATA\\[' + ')' + '((?=!-)' + // If yes, which type? - comments + '|' + cdata + ')'; - var regex = '(' + // Capture the entire match. - '<' + // Find start of element. - '(' + // Conditional expression follows. - escaped + // Find end of escaped element. - '|' + // ... else ... - '[^>]*>?' + // Find end of normal element. - ')' + ')'; - return new RegExp(regex); - /* eslint-enable no-multi-spaces */ -}(); -/** - * Separate HTML elements and comments from the text. - * - * @param {string} input The text which has to be formatted. - * @return {Array} The formatted text. - */ - - -function htmlSplit(input) { - var parts = []; - var workingInput = input; - var match; - - while (match = workingInput.match(htmlSplitRegex)) { - parts.push(workingInput.slice(0, match.index)); - parts.push(match[0]); - workingInput = workingInput.slice(match.index + match[0].length); - } - - if (workingInput.length) { - parts.push(workingInput); - } - - return parts; -} -/** - * Replace characters or phrases within HTML elements only. - * - * @param {string} haystack The text which has to be formatted. - * @param {Object} replacePairs In the form {from: 'to', ...}. - * @return {string} The formatted text. - */ - - -function replaceInHtmlTags(haystack, replacePairs) { - // Find all elements. - var textArr = htmlSplit(haystack); - var changed = false; // Extract all needles. - - var needles = Object.keys(replacePairs); // Loop through delimiters (elements) only. - - for (var i = 1; i < textArr.length; i += 2) { - for (var j = 0; j < needles.length; j++) { - var needle = needles[j]; - - if (-1 !== textArr[i].indexOf(needle)) { - textArr[i] = textArr[i].replace(new RegExp(needle, 'g'), replacePairs[needle]); - changed = true; // After one strtr() break out of the foreach loop and look at next element. - - break; - } - } - } - - if (changed) { - haystack = textArr.join(''); - } - - return haystack; -} -/** - * Replaces double line-breaks with paragraph elements. - * - * A group of regex replaces used to identify text formatted with newlines and - * replace double line-breaks with HTML paragraph tags. The remaining line- - * breaks after conversion become <
> tags, unless br is set to 'false'. - * - * @param {string} text The text which has to be formatted. - * @param {boolean} br Optional. If set, will convert all remaining line- - * breaks after paragraphing. Default true. - * @return {string} Text which has been converted into paragraph tags. - */ - - -function autop(text) { - var br = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; - var preTags = []; - - if (text.trim() === '') { - return ''; - } // Just to make things a little easier, pad the end. - - - text = text + '\n'; - /* - * Pre tags shouldn't be touched by autop. - * Replace pre tags with placeholders and bring them back after autop. - */ - - if (text.indexOf(''); - var lastText = textParts.pop(); - text = ''; - - for (var i = 0; i < textParts.length; i++) { - var textPart = textParts[i]; - var start = textPart.indexOf(''; - preTags.push([name, textPart.substr(start) + '']); - text += textPart.substr(0, start) + name; - } - - text += lastText; - } // Change multiple
s into two line breaks, which will turn into paragraphs. - - - text = text.replace(/\s*/g, '\n\n'); - var allBlocks = '(?:table|thead|tfoot|caption|col|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|form|map|area|blockquote|address|math|style|p|h[1-6]|hr|fieldset|legend|section|article|aside|hgroup|header|footer|nav|figure|figcaption|details|menu|summary)'; // Add a double line break above block-level opening tags. - - text = text.replace(new RegExp('(<' + allBlocks + '[\s\/>])', 'g'), '\n\n$1'); // Add a double line break below block-level closing tags. - - text = text.replace(new RegExp('(<\/' + allBlocks + '>)', 'g'), '$1\n\n'); // Standardize newline characters to "\n". - - text = text.replace(/\r\n|\r/g, '\n'); // Find newlines in all elements and add placeholders. - - text = replaceInHtmlTags(text, { - '\n': ' ' - }); // Collapse line breaks before and after '); - } - /* - * Collapse line breaks inside elements, before and elements - * so they don't get autop'd. - */ - - - if (text.indexOf('') !== -1) { - text = text.replace(/(]*>)\s*/g, '$1'); - text = text.replace(/\s*<\/object>/g, ''); - text = text.replace(/\s*(<\/?(?:param|embed)[^>]*>)\s*/g, '$1'); - } - /* - * Collapse line breaks inside