diff -r 7b1b88e27a20 -r 48c4eec2b7e6 wp/wp-includes/js/dist/block-directory.js --- a/wp/wp-includes/js/dist/block-directory.js Thu Sep 29 08:06:27 2022 +0200 +++ b/wp/wp-includes/js/dist/block-directory.js Fri Sep 05 18:40:08 2025 +0200 @@ -1,48 +1,48 @@ -/******/ (function() { // webpackBootstrap +/******/ (() => { // webpackBootstrap /******/ "use strict"; /******/ // The require scope /******/ var __webpack_require__ = {}; /******/ /************************************************************************/ /******/ /* webpack/runtime/compat get default export */ -/******/ !function() { +/******/ (() => { /******/ // getDefaultExport function for compatibility with non-harmony modules -/******/ __webpack_require__.n = function(module) { +/******/ __webpack_require__.n = (module) => { /******/ var getter = module && module.__esModule ? -/******/ function() { return module['default']; } : -/******/ function() { return module; }; +/******/ () => (module['default']) : +/******/ () => (module); /******/ __webpack_require__.d(getter, { a: getter }); /******/ return getter; /******/ }; -/******/ }(); +/******/ })(); /******/ /******/ /* webpack/runtime/define property getters */ -/******/ !function() { +/******/ (() => { /******/ // define getter functions for harmony exports -/******/ __webpack_require__.d = function(exports, definition) { +/******/ __webpack_require__.d = (exports, definition) => { /******/ for(var key in definition) { /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); /******/ } /******/ } /******/ }; -/******/ }(); +/******/ })(); /******/ /******/ /* webpack/runtime/hasOwnProperty shorthand */ -/******/ !function() { -/******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); } -/******/ }(); +/******/ (() => { +/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) +/******/ })(); /******/ /******/ /* webpack/runtime/make namespace object */ -/******/ !function() { +/******/ (() => { /******/ // define __esModule on exports -/******/ __webpack_require__.r = function(exports) { +/******/ __webpack_require__.r = (exports) => { /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); /******/ } /******/ Object.defineProperty(exports, '__esModule', { value: true }); /******/ }; -/******/ }(); +/******/ })(); /******/ /************************************************************************/ var __webpack_exports__ = {}; @@ -51,65 +51,59 @@ // EXPORTS __webpack_require__.d(__webpack_exports__, { - "store": function() { return /* reexport */ store; } + store: () => (/* reexport */ store) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-directory/build-module/store/selectors.js var selectors_namespaceObject = {}; __webpack_require__.r(selectors_namespaceObject); __webpack_require__.d(selectors_namespaceObject, { - "getDownloadableBlocks": function() { return getDownloadableBlocks; }, - "getErrorNoticeForBlock": function() { return getErrorNoticeForBlock; }, - "getErrorNotices": function() { return getErrorNotices; }, - "getInstalledBlockTypes": function() { return getInstalledBlockTypes; }, - "getNewBlockTypes": function() { return getNewBlockTypes; }, - "getUnusedBlockTypes": function() { return getUnusedBlockTypes; }, - "isInstalling": function() { return isInstalling; }, - "isRequestingDownloadableBlocks": function() { return isRequestingDownloadableBlocks; } + getDownloadableBlocks: () => (getDownloadableBlocks), + getErrorNoticeForBlock: () => (getErrorNoticeForBlock), + getErrorNotices: () => (getErrorNotices), + getInstalledBlockTypes: () => (getInstalledBlockTypes), + getNewBlockTypes: () => (getNewBlockTypes), + getUnusedBlockTypes: () => (getUnusedBlockTypes), + isInstalling: () => (isInstalling), + isRequestingDownloadableBlocks: () => (isRequestingDownloadableBlocks) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-directory/build-module/store/actions.js var actions_namespaceObject = {}; __webpack_require__.r(actions_namespaceObject); __webpack_require__.d(actions_namespaceObject, { - "addInstalledBlockType": function() { return addInstalledBlockType; }, - "clearErrorNotice": function() { return clearErrorNotice; }, - "fetchDownloadableBlocks": function() { return fetchDownloadableBlocks; }, - "installBlockType": function() { return installBlockType; }, - "receiveDownloadableBlocks": function() { return receiveDownloadableBlocks; }, - "removeInstalledBlockType": function() { return removeInstalledBlockType; }, - "setErrorNotice": function() { return setErrorNotice; }, - "setIsInstalling": function() { return setIsInstalling; }, - "uninstallBlockType": function() { return uninstallBlockType; } + addInstalledBlockType: () => (addInstalledBlockType), + clearErrorNotice: () => (clearErrorNotice), + fetchDownloadableBlocks: () => (fetchDownloadableBlocks), + installBlockType: () => (installBlockType), + receiveDownloadableBlocks: () => (receiveDownloadableBlocks), + removeInstalledBlockType: () => (removeInstalledBlockType), + setErrorNotice: () => (setErrorNotice), + setIsInstalling: () => (setIsInstalling), + uninstallBlockType: () => (uninstallBlockType) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-directory/build-module/store/resolvers.js var resolvers_namespaceObject = {}; __webpack_require__.r(resolvers_namespaceObject); __webpack_require__.d(resolvers_namespaceObject, { - "getDownloadableBlocks": function() { return resolvers_getDownloadableBlocks; } + getDownloadableBlocks: () => (resolvers_getDownloadableBlocks) }); -;// CONCATENATED MODULE: external ["wp","element"] -var external_wp_element_namespaceObject = window["wp"]["element"]; ;// CONCATENATED MODULE: external ["wp","plugins"] -var external_wp_plugins_namespaceObject = window["wp"]["plugins"]; +const external_wp_plugins_namespaceObject = window["wp"]["plugins"]; ;// CONCATENATED MODULE: external ["wp","hooks"] -var external_wp_hooks_namespaceObject = window["wp"]["hooks"]; +const external_wp_hooks_namespaceObject = window["wp"]["hooks"]; ;// CONCATENATED MODULE: external ["wp","blocks"] -var external_wp_blocks_namespaceObject = window["wp"]["blocks"]; +const external_wp_blocks_namespaceObject = window["wp"]["blocks"]; ;// CONCATENATED MODULE: external ["wp","data"] -var external_wp_data_namespaceObject = window["wp"]["data"]; +const external_wp_data_namespaceObject = window["wp"]["data"]; +;// CONCATENATED MODULE: external ["wp","element"] +const external_wp_element_namespaceObject = window["wp"]["element"]; ;// CONCATENATED MODULE: external ["wp","editor"] -var external_wp_editor_namespaceObject = window["wp"]["editor"]; -;// CONCATENATED MODULE: external "lodash" -var external_lodash_namespaceObject = window["lodash"]; +const external_wp_editor_namespaceObject = window["wp"]["editor"]; ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/store/reducer.js /** - * External dependencies - */ - -/** * WordPress dependencies */ @@ -122,30 +116,27 @@ * * @return {Object} Updated state. */ - -const downloadableBlocks = function () { - let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - let action = arguments.length > 1 ? arguments[1] : undefined; - +const downloadableBlocks = (state = {}, action) => { switch (action.type) { case 'FETCH_DOWNLOADABLE_BLOCKS': - return { ...state, + return { + ...state, [action.filterValue]: { isRequesting: true } }; - case 'RECEIVE_DOWNLOADABLE_BLOCKS': - return { ...state, + return { + ...state, [action.filterValue]: { results: action.downloadableBlocks, isRequesting: false } }; } - return state; }; + /** * Reducer managing the installation and deletion of blocks. * @@ -154,35 +145,33 @@ * * @return {Object} Updated state. */ - -const blockManagement = function () { - let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : { - installedBlockTypes: [], - isInstalling: {} - }; - let action = arguments.length > 1 ? arguments[1] : undefined; - +const blockManagement = (state = { + installedBlockTypes: [], + isInstalling: {} +}, action) => { switch (action.type) { case 'ADD_INSTALLED_BLOCK_TYPE': - return { ...state, + return { + ...state, installedBlockTypes: [...state.installedBlockTypes, action.item] }; - case 'REMOVE_INSTALLED_BLOCK_TYPE': - return { ...state, + return { + ...state, installedBlockTypes: state.installedBlockTypes.filter(blockType => blockType.name !== action.item.name) }; - case 'SET_INSTALLING_BLOCK': - return { ...state, - isInstalling: { ...state.isInstalling, + return { + ...state, + isInstalling: { + ...state.isInstalling, [action.blockId]: action.isInstalling } }; } - return state; }; + /** * Reducer returning an object of error notices. * @@ -191,34 +180,33 @@ * * @return {Object} Updated state. */ - -const errorNotices = function () { - let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - let action = arguments.length > 1 ? arguments[1] : undefined; - +const errorNotices = (state = {}, action) => { switch (action.type) { case 'SET_ERROR_NOTICE': - return { ...state, + return { + ...state, [action.blockId]: { message: action.message, isFatal: action.isFatal } }; - case 'CLEAR_ERROR_NOTICE': - return (0,external_lodash_namespaceObject.omit)(state, action.blockId); + const { + [action.blockId]: blockId, + ...restState + } = state; + return restState; } - return state; }; -/* harmony default export */ var reducer = ((0,external_wp_data_namespaceObject.combineReducers)({ +/* harmony default export */ const reducer = ((0,external_wp_data_namespaceObject.combineReducers)({ downloadableBlocks, blockManagement, errorNotices })); ;// CONCATENATED MODULE: external ["wp","blockEditor"] -var external_wp_blockEditor_namespaceObject = window["wp"]["blockEditor"]; +const external_wp_blockEditor_namespaceObject = window["wp"]["blockEditor"]; ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/store/utils/has-block-type.js /** * Check if a block list contains a specific block type. Recursively searches @@ -229,28 +217,20 @@ * * @return {boolean} Whether the blockType is found. */ -function hasBlockType(blockType) { - let blocks = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; - +function hasBlockType(blockType, blocks = []) { if (!blocks.length) { return false; } - - if (blocks.some(_ref => { - let { - name - } = _ref; - return name === blockType.name; - })) { + if (blocks.some(({ + name + }) => name === blockType.name)) { return true; } - for (let i = 0; i < blocks.length; i++) { if (hasBlockType(blockType, blocks[i].innerBlocks)) { return true; } } - return false; } @@ -260,6 +240,7 @@ */ + /** * Internal dependencies */ @@ -273,12 +254,11 @@ * * @return {boolean} Whether a request is in progress for the blocks list. */ +function isRequestingDownloadableBlocks(state, filterValue) { + var _state$downloadableBl; + return (_state$downloadableBl = state.downloadableBlocks[filterValue]?.isRequesting) !== null && _state$downloadableBl !== void 0 ? _state$downloadableBl : false; +} -function isRequestingDownloadableBlocks(state, filterValue) { - var _state$downloadableBl, _state$downloadableBl2; - - return (_state$downloadableBl = (_state$downloadableBl2 = state.downloadableBlocks[filterValue]) === null || _state$downloadableBl2 === void 0 ? void 0 : _state$downloadableBl2.isRequesting) !== null && _state$downloadableBl !== void 0 ? _state$downloadableBl : false; -} /** * Returns the available uninstalled blocks. * @@ -287,12 +267,11 @@ * * @return {Array} Downloadable blocks. */ +function getDownloadableBlocks(state, filterValue) { + var _state$downloadableBl2; + return (_state$downloadableBl2 = state.downloadableBlocks[filterValue]?.results) !== null && _state$downloadableBl2 !== void 0 ? _state$downloadableBl2 : []; +} -function getDownloadableBlocks(state, filterValue) { - var _state$downloadableBl3, _state$downloadableBl4; - - return (_state$downloadableBl3 = (_state$downloadableBl4 = state.downloadableBlocks[filterValue]) === null || _state$downloadableBl4 === void 0 ? void 0 : _state$downloadableBl4.results) !== null && _state$downloadableBl3 !== void 0 ? _state$downloadableBl3 : []; -} /** * Returns the block types that have been installed on the server in this * session. @@ -301,10 +280,10 @@ * * @return {Array} Block type items */ - function getInstalledBlockTypes(state) { return state.blockManagement.installedBlockTypes; } + /** * Returns block types that have been installed on the server and used in the * current post. @@ -313,12 +292,12 @@ * * @return {Array} Block type items. */ - const getNewBlockTypes = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => state => { const usedBlockTree = select(external_wp_blockEditor_namespaceObject.store).getBlocks(); const installedBlockTypes = getInstalledBlockTypes(state); return installedBlockTypes.filter(blockType => hasBlockType(blockType, usedBlockTree)); }); + /** * Returns the block types that have been installed on the server but are not * used in the current post. @@ -327,12 +306,12 @@ * * @return {Array} Block type items. */ - const getUnusedBlockTypes = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => state => { const usedBlockTree = select(external_wp_blockEditor_namespaceObject.store).getBlocks(); const installedBlockTypes = getInstalledBlockTypes(state); return installedBlockTypes.filter(blockType => !hasBlockType(blockType, usedBlockTree)); }); + /** * Returns true if a block plugin install is in progress. * @@ -341,10 +320,10 @@ * * @return {boolean} Whether this block is currently being installed. */ - function isInstalling(state, blockId) { return state.blockManagement.isInstalling[blockId] || false; } + /** * Returns all block error notices. * @@ -352,10 +331,10 @@ * * @return {Object} Object with error notices. */ - function getErrorNotices(state) { return state.errorNotices; } + /** * Returns the error notice for a given block. * @@ -364,25 +343,25 @@ * * @return {string|boolean} The error text, or false if no error. */ - function getErrorNoticeForBlock(state, blockId) { return state.errorNotices[blockId]; } ;// CONCATENATED MODULE: external ["wp","i18n"] -var external_wp_i18n_namespaceObject = window["wp"]["i18n"]; +const external_wp_i18n_namespaceObject = window["wp"]["i18n"]; ;// CONCATENATED MODULE: external ["wp","apiFetch"] -var external_wp_apiFetch_namespaceObject = window["wp"]["apiFetch"]; +const external_wp_apiFetch_namespaceObject = window["wp"]["apiFetch"]; var external_wp_apiFetch_default = /*#__PURE__*/__webpack_require__.n(external_wp_apiFetch_namespaceObject); ;// CONCATENATED MODULE: external ["wp","notices"] -var external_wp_notices_namespaceObject = window["wp"]["notices"]; +const external_wp_notices_namespaceObject = window["wp"]["notices"]; ;// CONCATENATED MODULE: external ["wp","url"] -var external_wp_url_namespaceObject = window["wp"]["url"]; +const external_wp_url_namespaceObject = window["wp"]["url"]; ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/store/load-assets.js /** * WordPress dependencies */ + /** * Load an asset for a block. * @@ -393,7 +372,6 @@ * * @return {Promise} Promise which will resolve when the asset is loaded. */ - const loadAsset = el => { return new Promise((resolve, reject) => { /* @@ -405,27 +383,26 @@ if (el[attr]) { newNode[attr] = el[attr]; } - }); // Append inline