@wordpress/edit-post 8.34.0 → 8.35.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/build/commands/use-commands.js +2 -0
- package/build/commands/use-commands.js.map +1 -1
- package/build/components/back-button/fullscreen-mode-close.js +5 -3
- package/build/components/back-button/fullscreen-mode-close.js.map +1 -1
- package/build/components/back-button/index.js +5 -3
- package/build/components/back-button/index.js.map +1 -1
- package/build/components/browser-url/index.js +2 -0
- package/build/components/browser-url/index.js.map +1 -1
- package/build/components/editor-initialization/index.js +2 -0
- package/build/components/editor-initialization/index.js.map +1 -1
- package/build/components/editor-initialization/listener-hooks.js +3 -1
- package/build/components/editor-initialization/listener-hooks.js.map +1 -1
- package/build/components/init-pattern-modal/index.js +3 -1
- package/build/components/init-pattern-modal/index.js.map +1 -1
- package/build/components/keyboard-shortcuts/index.js +2 -0
- package/build/components/keyboard-shortcuts/index.js.map +1 -1
- package/build/components/layout/index.js +12 -29
- package/build/components/layout/index.js.map +2 -2
- package/build/components/layout/use-should-iframe.js +3 -1
- package/build/components/layout/use-should-iframe.js.map +1 -1
- package/build/components/meta-boxes/index.js +3 -1
- package/build/components/meta-boxes/index.js.map +1 -1
- package/build/components/meta-boxes/meta-box-visibility.js +2 -0
- package/build/components/meta-boxes/meta-box-visibility.js.map +1 -1
- package/build/components/meta-boxes/meta-boxes-area/index.js +3 -1
- package/build/components/meta-boxes/meta-boxes-area/index.js.map +1 -1
- package/build/components/meta-boxes/use-meta-box-initialization.js +3 -1
- package/build/components/meta-boxes/use-meta-box-initialization.js.map +1 -1
- package/build/components/more-menu/index.js +5 -3
- package/build/components/more-menu/index.js.map +1 -1
- package/build/components/more-menu/manage-patterns-menu-item.js +3 -1
- package/build/components/more-menu/manage-patterns-menu-item.js.map +1 -1
- package/build/components/more-menu/welcome-guide-menu-item.js +3 -1
- package/build/components/more-menu/welcome-guide-menu-item.js.map +1 -1
- package/build/components/preferences-modal/enable-custom-fields.js +4 -2
- package/build/components/preferences-modal/enable-custom-fields.js.map +1 -1
- package/build/components/preferences-modal/enable-panel.js +4 -2
- package/build/components/preferences-modal/enable-panel.js.map +1 -1
- package/build/components/preferences-modal/index.js +5 -3
- package/build/components/preferences-modal/index.js.map +1 -1
- package/build/components/preferences-modal/meta-boxes-section.js +4 -2
- package/build/components/preferences-modal/meta-boxes-section.js.map +1 -1
- package/build/components/welcome-guide/default.js +3 -1
- package/build/components/welcome-guide/default.js.map +1 -1
- package/build/components/welcome-guide/image.js +2 -0
- package/build/components/welcome-guide/image.js.map +1 -1
- package/build/components/welcome-guide/index.js +3 -1
- package/build/components/welcome-guide/index.js.map +1 -1
- package/build/components/welcome-guide/template.js +3 -1
- package/build/components/welcome-guide/template.js.map +1 -1
- package/build/deprecated.js +6 -4
- package/build/deprecated.js.map +1 -1
- package/build/hooks/use-navigate-to-entity-record.js +2 -0
- package/build/hooks/use-navigate-to-entity-record.js.map +1 -1
- package/build/index.js +4 -2
- package/build/index.js.map +1 -1
- package/build/lock-unlock.js +3 -1
- package/build/lock-unlock.js.map +1 -1
- package/build/store/actions.js +26 -24
- package/build/store/actions.js.map +1 -1
- package/build/store/constants.js +5 -3
- package/build/store/constants.js.map +1 -1
- package/build/store/index.js +3 -1
- package/build/store/index.js.map +1 -1
- package/build/store/reducer.js +3 -1
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +27 -25
- package/build/store/selectors.js.map +1 -1
- package/build/utils/meta-boxes.js +3 -1
- package/build/utils/meta-boxes.js.map +1 -1
- package/build-module/commands/use-commands.js +1 -0
- package/build-module/commands/use-commands.js.map +1 -1
- package/build-module/components/back-button/fullscreen-mode-close.js +4 -3
- package/build-module/components/back-button/fullscreen-mode-close.js.map +1 -1
- package/build-module/components/back-button/index.js +4 -3
- package/build-module/components/back-button/index.js.map +1 -1
- package/build-module/components/browser-url/index.js +1 -0
- package/build-module/components/browser-url/index.js.map +1 -1
- package/build-module/components/editor-initialization/index.js +1 -0
- package/build-module/components/editor-initialization/index.js.map +1 -1
- package/build-module/components/editor-initialization/listener-hooks.js +2 -1
- package/build-module/components/editor-initialization/listener-hooks.js.map +1 -1
- package/build-module/components/init-pattern-modal/index.js +2 -1
- package/build-module/components/init-pattern-modal/index.js.map +1 -1
- package/build-module/components/keyboard-shortcuts/index.js +1 -0
- package/build-module/components/keyboard-shortcuts/index.js.map +1 -1
- package/build-module/components/layout/index.js +11 -29
- package/build-module/components/layout/index.js.map +2 -2
- package/build-module/components/layout/use-should-iframe.js +2 -1
- package/build-module/components/layout/use-should-iframe.js.map +1 -1
- package/build-module/components/meta-boxes/index.js +2 -1
- package/build-module/components/meta-boxes/index.js.map +1 -1
- package/build-module/components/meta-boxes/meta-box-visibility.js +1 -0
- package/build-module/components/meta-boxes/meta-box-visibility.js.map +1 -1
- package/build-module/components/meta-boxes/meta-boxes-area/index.js +2 -1
- package/build-module/components/meta-boxes/meta-boxes-area/index.js.map +1 -1
- package/build-module/components/meta-boxes/use-meta-box-initialization.js +2 -1
- package/build-module/components/meta-boxes/use-meta-box-initialization.js.map +1 -1
- package/build-module/components/more-menu/index.js +4 -3
- package/build-module/components/more-menu/index.js.map +1 -1
- package/build-module/components/more-menu/manage-patterns-menu-item.js +2 -1
- package/build-module/components/more-menu/manage-patterns-menu-item.js.map +1 -1
- package/build-module/components/more-menu/welcome-guide-menu-item.js +2 -1
- package/build-module/components/more-menu/welcome-guide-menu-item.js.map +1 -1
- package/build-module/components/preferences-modal/enable-custom-fields.js +3 -2
- package/build-module/components/preferences-modal/enable-custom-fields.js.map +1 -1
- package/build-module/components/preferences-modal/enable-panel.js +3 -2
- package/build-module/components/preferences-modal/enable-panel.js.map +1 -1
- package/build-module/components/preferences-modal/index.js +4 -3
- package/build-module/components/preferences-modal/index.js.map +1 -1
- package/build-module/components/preferences-modal/meta-boxes-section.js +3 -2
- package/build-module/components/preferences-modal/meta-boxes-section.js.map +1 -1
- package/build-module/components/welcome-guide/default.js +2 -1
- package/build-module/components/welcome-guide/default.js.map +1 -1
- package/build-module/components/welcome-guide/image.js +1 -0
- package/build-module/components/welcome-guide/image.js.map +1 -1
- package/build-module/components/welcome-guide/index.js +2 -1
- package/build-module/components/welcome-guide/index.js.map +1 -1
- package/build-module/components/welcome-guide/template.js +2 -1
- package/build-module/components/welcome-guide/template.js.map +1 -1
- package/build-module/deprecated.js +5 -4
- package/build-module/deprecated.js.map +1 -1
- package/build-module/hooks/use-navigate-to-entity-record.js +1 -0
- package/build-module/hooks/use-navigate-to-entity-record.js.map +1 -1
- package/build-module/index.js +6 -5
- package/build-module/index.js.map +1 -1
- package/build-module/lock-unlock.js +2 -1
- package/build-module/lock-unlock.js.map +1 -1
- package/build-module/store/actions.js +25 -24
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/constants.js +4 -3
- package/build-module/store/constants.js.map +1 -1
- package/build-module/store/index.js +2 -1
- package/build-module/store/index.js.map +1 -1
- package/build-module/store/reducer.js +2 -1
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +26 -25
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/utils/meta-boxes.js +2 -1
- package/build-module/utils/meta-boxes.js.map +1 -1
- package/package.json +33 -33
- package/src/components/layout/index.js +5 -30
- package/build/components/layout/use-padding-appender.js +0 -72
- package/build/components/layout/use-padding-appender.js.map +0 -7
- package/build-module/components/layout/use-padding-appender.js +0 -49
- package/build-module/components/layout/use-padding-appender.js.map +0 -7
- package/src/components/layout/use-padding-appender.js +0 -70
|
@@ -15,6 +15,8 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
15
15
|
return to;
|
|
16
16
|
};
|
|
17
17
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// packages/edit-post/src/hooks/use-navigate-to-entity-record.js
|
|
18
20
|
var use_navigate_to_entity_record_exports = {};
|
|
19
21
|
__export(use_navigate_to_entity_record_exports, {
|
|
20
22
|
default: () => useNavigateToEntityRecord
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/hooks/use-navigate-to-entity-record.js"],
|
|
4
4
|
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useCallback, useReducer } from '@wordpress/element';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * A hook that records the 'entity' history in the post editor as a user\n * navigates between editing a post and editing the post template or patterns.\n *\n * Implemented as a stack, so a little similar to the browser history API.\n *\n * Used to control displaying UI elements like the back button.\n *\n * @param {number} initialPostId The post id of the post when the editor loaded.\n * @param {string} initialPostType The post type of the post when the editor loaded.\n * @param {string} defaultRenderingMode The rendering mode to switch to when navigating.\n *\n * @return {Object} An object containing the `currentPost` variable and\n * `onNavigateToEntityRecord` and `onNavigateToPreviousEntityRecord` functions.\n */\nexport default function useNavigateToEntityRecord(\n\tinitialPostId,\n\tinitialPostType,\n\tdefaultRenderingMode\n) {\n\tconst [ postHistory, dispatch ] = useReducer(\n\t\t( historyState, { type, post, previousRenderingMode } ) => {\n\t\t\tif ( type === 'push' ) {\n\t\t\t\treturn [ ...historyState, { post, previousRenderingMode } ];\n\t\t\t}\n\t\t\tif ( type === 'pop' ) {\n\t\t\t\t// Try to leave one item in the history.\n\t\t\t\tif ( historyState.length > 1 ) {\n\t\t\t\t\treturn historyState.slice( 0, -1 );\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn historyState;\n\t\t},\n\t\t[\n\t\t\t{\n\t\t\t\tpost: { postId: initialPostId, postType: initialPostType },\n\t\t\t},\n\t\t]\n\t);\n\n\tconst { post, previousRenderingMode } =\n\t\tpostHistory[ postHistory.length - 1 ];\n\n\tconst { getRenderingMode } = useSelect( editorStore );\n\tconst { setRenderingMode } = useDispatch( editorStore );\n\n\tconst onNavigateToEntityRecord = useCallback(\n\t\t( params ) => {\n\t\t\tdispatch( {\n\t\t\t\ttype: 'push',\n\t\t\t\tpost: { postId: params.postId, postType: params.postType },\n\t\t\t\t// Save the current rendering mode so we can restore it when navigating back.\n\t\t\t\tpreviousRenderingMode: getRenderingMode(),\n\t\t\t} );\n\t\t\tsetRenderingMode( defaultRenderingMode );\n\t\t},\n\t\t[ getRenderingMode, setRenderingMode, defaultRenderingMode ]\n\t);\n\n\tconst onNavigateToPreviousEntityRecord = useCallback( () => {\n\t\tdispatch( { type: 'pop' } );\n\t\tif ( previousRenderingMode ) {\n\t\t\tsetRenderingMode( previousRenderingMode );\n\t\t}\n\t}, [ setRenderingMode, previousRenderingMode ] );\n\n\treturn {\n\t\tcurrentPost: post,\n\t\tonNavigateToEntityRecord,\n\t\tonNavigateToPreviousEntityRecord:\n\t\t\tpostHistory.length > 1\n\t\t\t\t? onNavigateToPreviousEntityRecord\n\t\t\t\t: undefined,\n\t};\n}\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,qBAAwC;AACxC,kBAAuC;AACvC,oBAAqC;AAiBtB,SAAR,0BACN,eACA,iBACA,sBACC;AACD,QAAM,CAAE,aAAa,QAAS,QAAI;AAAA,IACjC,CAAE,cAAc,EAAE,MAAM,MAAAA,OAAM,uBAAAC,uBAAsB,MAAO;AAC1D,UAAK,SAAS,QAAS;AACtB,eAAO,CAAE,GAAG,cAAc,EAAE,MAAAD,OAAM,uBAAAC,uBAAsB,CAAE;AAAA,MAC3D;AACA,UAAK,SAAS,OAAQ;AAErB,YAAK,aAAa,SAAS,GAAI;AAC9B,iBAAO,aAAa,MAAO,GAAG,EAAG;AAAA,QAClC;AAAA,MACD;AACA,aAAO;AAAA,IACR;AAAA,IACA;AAAA,MACC;AAAA,QACC,MAAM,EAAE,QAAQ,eAAe,UAAU,gBAAgB;AAAA,MAC1D;AAAA,IACD;AAAA,EACD;AAEA,QAAM,EAAE,MAAM,sBAAsB,IACnC,YAAa,YAAY,SAAS,CAAE;AAErC,QAAM,EAAE,iBAAiB,QAAI,uBAAW,cAAAC,KAAY;AACpD,QAAM,EAAE,iBAAiB,QAAI,yBAAa,cAAAA,KAAY;AAEtD,QAAM,+BAA2B;AAAA,IAChC,CAAE,WAAY;AACb,eAAU;AAAA,QACT,MAAM;AAAA,QACN,MAAM,EAAE,QAAQ,OAAO,QAAQ,UAAU,OAAO,SAAS;AAAA;AAAA,QAEzD,uBAAuB,iBAAiB;AAAA,MACzC,CAAE;AACF,uBAAkB,oBAAqB;AAAA,IACxC;AAAA,IACA,CAAE,kBAAkB,kBAAkB,oBAAqB;AAAA,EAC5D;AAEA,QAAM,uCAAmC,4BAAa,MAAM;AAC3D,aAAU,EAAE,MAAM,MAAM,CAAE;AAC1B,QAAK,uBAAwB;AAC5B,uBAAkB,qBAAsB;AAAA,IACzC;AAAA,EACD,GAAG,CAAE,kBAAkB,qBAAsB,CAAE;AAE/C,SAAO;AAAA,IACN,aAAa;AAAA,IACb;AAAA,IACA,kCACC,YAAY,SAAS,IAClB,mCACA;AAAA,EACL;AACD;",
|
|
6
6
|
"names": ["post", "previousRenderingMode", "editorStore"]
|
|
7
7
|
}
|
package/build/index.js
CHANGED
|
@@ -26,6 +26,8 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
26
|
mod
|
|
27
27
|
));
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// packages/edit-post/src/index.js
|
|
29
31
|
var index_exports = {};
|
|
30
32
|
__export(index_exports, {
|
|
31
33
|
__experimentalFullscreenModeClose: () => import_fullscreen_mode_close.default,
|
|
@@ -35,7 +37,6 @@ __export(index_exports, {
|
|
|
35
37
|
store: () => import_store.store
|
|
36
38
|
});
|
|
37
39
|
module.exports = __toCommonJS(index_exports);
|
|
38
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
39
40
|
var import_blocks = require("@wordpress/blocks");
|
|
40
41
|
var import_block_library = require("@wordpress/block-library");
|
|
41
42
|
var import_deprecated = __toESM(require("@wordpress/deprecated"));
|
|
@@ -49,7 +50,8 @@ var import_lock_unlock = require("./lock-unlock");
|
|
|
49
50
|
var import_fullscreen_mode_close = __toESM(require("./components/back-button/fullscreen-mode-close"));
|
|
50
51
|
var import_store = require("./store");
|
|
51
52
|
__reExport(index_exports, require("./deprecated"), module.exports);
|
|
52
|
-
|
|
53
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
54
|
+
var {
|
|
53
55
|
BackButton: __experimentalMainDashboardButton,
|
|
54
56
|
registerCoreBlockBindingsSources
|
|
55
57
|
} = (0, import_lock_unlock.unlock)(import_editor.privateApis);
|
package/build/index.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/index.js"],
|
|
4
4
|
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { store as blocksStore } from '@wordpress/blocks';\nimport {\n\tregisterCoreBlocks,\n\t__experimentalRegisterExperimentalCoreBlocks,\n} from '@wordpress/block-library';\nimport deprecated from '@wordpress/deprecated';\nimport { createRoot, StrictMode } from '@wordpress/element';\nimport { dispatch, select } from '@wordpress/data';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport {\n\tregisterLegacyWidgetBlock,\n\tregisterWidgetGroupBlock,\n} from '@wordpress/widgets';\nimport {\n\tstore as editorStore,\n\tprivateApis as editorPrivateApis,\n} from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport Layout from './components/layout';\nimport { unlock } from './lock-unlock';\n\nconst {\n\tBackButton: __experimentalMainDashboardButton,\n\tregisterCoreBlockBindingsSources,\n} = unlock( editorPrivateApis );\n\n/**\n * Initializes and returns an instance of Editor.\n *\n * @param {string} id Unique identifier for editor instance.\n * @param {string} postType Post type of the post to edit.\n * @param {Object} postId ID of the post to edit.\n * @param {?Object} settings Editor settings object.\n * @param {Object} initialEdits Programmatic edits to apply initially, to be\n * considered as non-user-initiated (bypass for\n * unsaved changes prompt).\n */\nexport function initializeEditor(\n\tid,\n\tpostType,\n\tpostId,\n\tsettings,\n\tinitialEdits\n) {\n\tconst isMediumOrBigger = window.matchMedia( '(min-width: 782px)' ).matches;\n\tconst target = document.getElementById( id );\n\tconst root = createRoot( target );\n\n\tdispatch( preferencesStore ).setDefaults( 'core/edit-post', {\n\t\tfullscreenMode: true,\n\t\tthemeStyles: true,\n\t\twelcomeGuide: true,\n\t\twelcomeGuideTemplate: true,\n\t} );\n\n\tdispatch( preferencesStore ).setDefaults( 'core', {\n\t\tallowRightClickOverrides: true,\n\t\teditorMode: 'visual',\n\t\teditorTool: 'edit',\n\t\tfixedToolbar: false,\n\t\thiddenBlockTypes: [],\n\t\tinactivePanels: [],\n\t\topenPanels: [ 'post-status' ],\n\t\tshowBlockBreadcrumbs: true,\n\t\tshowIconLabels: false,\n\t\tshowListViewByDefault: false,\n\t\tenableChoosePatternModal: true,\n\t\tisPublishSidebarEnabled: true,\n\t} );\n\n\tif ( window.__experimentalMediaProcessing ) {\n\t\tdispatch( preferencesStore ).setDefaults( 'core/media', {\n\t\t\trequireApproval: true,\n\t\t\toptimizeOnUpload: true,\n\t\t} );\n\t}\n\n\tdispatch( blocksStore ).reapplyBlockTypeFilters();\n\n\t// Check if the block list view should be open by default.\n\t// If `distractionFree` mode is enabled, the block list view should not be open.\n\t// This behavior is disabled for small viewports.\n\tif (\n\t\tisMediumOrBigger &&\n\t\tselect( preferencesStore ).get( 'core', 'showListViewByDefault' ) &&\n\t\t! select( preferencesStore ).get( 'core', 'distractionFree' )\n\t) {\n\t\tdispatch( editorStore ).setIsListViewOpened( true );\n\t}\n\n\tregisterCoreBlocks();\n\tregisterCoreBlockBindingsSources();\n\tregisterLegacyWidgetBlock( { inserter: false } );\n\tregisterWidgetGroupBlock( { inserter: false } );\n\tif ( globalThis.IS_GUTENBERG_PLUGIN ) {\n\t\t__experimentalRegisterExperimentalCoreBlocks( {\n\t\t\tenableFSEBlocks: settings.__unstableEnableFullSiteEditingBlocks,\n\t\t} );\n\t}\n\n\t// Show a console log warning if the browser is not in Standards rendering mode.\n\tconst documentMode =\n\t\tdocument.compatMode === 'CSS1Compat' ? 'Standards' : 'Quirks';\n\tif ( documentMode !== 'Standards' ) {\n\t\t// eslint-disable-next-line no-console\n\t\tconsole.warn(\n\t\t\t\"Your browser is using Quirks Mode. \\nThis can cause rendering issues such as blocks overlaying meta boxes in the editor. Quirks Mode can be triggered by PHP errors or HTML code appearing before the opening <!DOCTYPE html>. Try checking the raw page source or your site's PHP error log and resolving errors there, removing any HTML before the doctype, or disabling plugins.\"\n\t\t);\n\t}\n\n\t// This is a temporary fix for a couple of issues specific to Webkit on iOS.\n\t// Without this hack the browser scrolls the mobile toolbar off-screen.\n\t// Once supported in Safari we can replace this in favor of preventScroll.\n\t// For details see issue #18632 and PR #18686\n\t// Specifically, we scroll `interface-interface-skeleton__body` to enable a fixed top toolbar.\n\t// But Mobile Safari forces the `html` element to scroll upwards, hiding the toolbar.\n\n\tconst isIphone = window.navigator.userAgent.indexOf( 'iPhone' ) !== -1;\n\tif ( isIphone ) {\n\t\twindow.addEventListener( 'scroll', ( event ) => {\n\t\t\tconst editorScrollContainer = document.getElementsByClassName(\n\t\t\t\t'interface-interface-skeleton__body'\n\t\t\t)[ 0 ];\n\t\t\tif ( event.target === document ) {\n\t\t\t\t// Scroll element into view by scrolling the editor container by the same amount\n\t\t\t\t// that Mobile Safari tried to scroll the html element upwards.\n\t\t\t\tif ( window.scrollY > 100 ) {\n\t\t\t\t\teditorScrollContainer.scrollTop =\n\t\t\t\t\t\teditorScrollContainer.scrollTop + window.scrollY;\n\t\t\t\t}\n\t\t\t\t// Undo unwanted scroll on html element, but only in the visual editor.\n\t\t\t\tif (\n\t\t\t\t\tdocument.getElementsByClassName( 'is-mode-visual' )[ 0 ]\n\t\t\t\t) {\n\t\t\t\t\twindow.scrollTo( 0, 0 );\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\t}\n\n\t// Prevent the default browser action for files dropped outside of dropzones.\n\twindow.addEventListener( 'dragover', ( e ) => e.preventDefault(), false );\n\twindow.addEventListener( 'drop', ( e ) => e.preventDefault(), false );\n\n\troot.render(\n\t\t<StrictMode>\n\t\t\t<Layout\n\t\t\t\tsettings={ settings }\n\t\t\t\tpostId={ postId }\n\t\t\t\tpostType={ postType }\n\t\t\t\tinitialEdits={ initialEdits }\n\t\t\t/>\n\t\t</StrictMode>\n\t);\n\n\treturn root;\n}\n\n/**\n * Used to reinitialize the editor after an error. Now it's a deprecated noop function.\n */\nexport function reinitializeEditor() {\n\tdeprecated( 'wp.editPost.reinitializeEditor', {\n\t\tsince: '6.2',\n\t\tversion: '6.3',\n\t} );\n}\n\nexport { default as __experimentalFullscreenModeClose } from './components/back-button/fullscreen-mode-close';\nexport { __experimentalMainDashboardButton };\nexport { store } from './store';\nexport * from './deprecated';\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,oBAAqC;AACrC,2BAGO;AACP,wBAAuB;AACvB,qBAAuC;AACvC,kBAAiC;AACjC,yBAA0C;AAC1C,qBAGO;AACP,oBAGO;AAKP,oBAAmB;AACnB,yBAAuB;AAqJvB,mCAA6D;AAE7D,mBAAsB;AACtB,0BAAc,yBAjLd;AAwJG;AA7HH,IAAM;AAAA,EACL,YAAY;AAAA,EACZ;AACD,QAAI,2BAAQ,cAAAA,WAAkB;AAavB,SAAS,iBACf,IACA,UACA,QACA,UACA,cACC;AACD,QAAM,mBAAmB,OAAO,WAAY,oBAAqB,EAAE;AACnE,QAAM,SAAS,SAAS,eAAgB,EAAG;AAC3C,QAAM,WAAO,2BAAY,MAAO;AAEhC,4BAAU,mBAAAC,KAAiB,EAAE,YAAa,kBAAkB;AAAA,IAC3D,gBAAgB;AAAA,IAChB,aAAa;AAAA,IACb,cA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D,EAAG,CAAE;AACL,UAAK,MAAM,WAAW,UAAW;AAGhC,YAAK,OAAO,UAAU,KAAM;AAC3B,gCAAsB,YACrB,sBAAsB,YAAY,OAAO;AAAA,QAC3C;AAEA,YACC,SAAS,uBAAwB,gBAAiB,EAAG,CAAE,GACtD;AACD,iBAAO,SAAU,GAAG,CAAE;AAAA,QACvB;AAAA,MACD;AAAA,IACD,CAAE;AAAA,EACH;AAGA,SAAO,iBAAkB,YAAY,CAAE,MAAO,EAAE,eAAe,GAAG,KAAM;AACxE,SAAO,iBAAkB,QAAQ,CAAE,MAAO,EAAE,eAAe,GAAG,KAAM;AAEpE,OAAK;AAAA,IACJ,4CAAC,6BACA;AAAA,MAAC,cAAAC;AAAA,MAAA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA;AAAA,IACD,GACD;AAAA,EACD;AAEA,SAAO;AACR;AAKO,SAAS,qBAAqB;AACpC,wBAAAC,SAAY,kCAAkC;AAAA,IAC7C,OAAO;AAAA,IACP,SAAS;AAAA,EACV,CAAE;AACH;",
|
|
6
6
|
"names": ["editorPrivateApis", "preferencesStore", "blocksStore", "editorStore", "Layout", "deprecated"]
|
|
7
7
|
}
|
package/build/lock-unlock.js
CHANGED
|
@@ -15,6 +15,8 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
15
15
|
return to;
|
|
16
16
|
};
|
|
17
17
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// packages/edit-post/src/lock-unlock.js
|
|
18
20
|
var lock_unlock_exports = {};
|
|
19
21
|
__export(lock_unlock_exports, {
|
|
20
22
|
lock: () => lock,
|
|
@@ -22,7 +24,7 @@ __export(lock_unlock_exports, {
|
|
|
22
24
|
});
|
|
23
25
|
module.exports = __toCommonJS(lock_unlock_exports);
|
|
24
26
|
var import_private_apis = require("@wordpress/private-apis");
|
|
25
|
-
|
|
27
|
+
var { lock, unlock } = (0, import_private_apis.__dangerousOptInToUnstableAPIsOnlyForCoreModules)(
|
|
26
28
|
"I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.",
|
|
27
29
|
"@wordpress/edit-post"
|
|
28
30
|
);
|
package/build/lock-unlock.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/lock-unlock.js"],
|
|
4
4
|
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/private-apis';\n\nexport const { lock, unlock } =\n\t__dangerousOptInToUnstableAPIsOnlyForCoreModules(\n\t\t'I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.',\n\t\t'@wordpress/edit-post'\n\t);\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,0BAAiE;AAE1D,IAAM,EAAE,MAAM,OAAO,QAC3B;AAAA,EACC;AAAA,EACA;AACD;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/build/store/actions.js
CHANGED
|
@@ -25,6 +25,8 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
25
25
|
mod
|
|
26
26
|
));
|
|
27
27
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// packages/edit-post/src/store/actions.js
|
|
28
30
|
var actions_exports = {};
|
|
29
31
|
__export(actions_exports, {
|
|
30
32
|
__experimentalSetPreviewDeviceType: () => __experimentalSetPreviewDeviceType,
|
|
@@ -67,76 +69,76 @@ var import_notices = require("@wordpress/notices");
|
|
|
67
69
|
var import_i18n = require("@wordpress/i18n");
|
|
68
70
|
var import_meta_boxes = require("../utils/meta-boxes");
|
|
69
71
|
var import_lock_unlock = require("../lock-unlock");
|
|
70
|
-
|
|
71
|
-
|
|
72
|
+
var { interfaceStore } = (0, import_lock_unlock.unlock)(import_editor.privateApis);
|
|
73
|
+
var openGeneralSidebar = (name) => ({ registry }) => {
|
|
72
74
|
registry.dispatch(interfaceStore).enableComplementaryArea("core", name);
|
|
73
75
|
};
|
|
74
|
-
|
|
75
|
-
|
|
76
|
+
var closeGeneralSidebar = () => ({ registry }) => registry.dispatch(interfaceStore).disableComplementaryArea("core");
|
|
77
|
+
var openModal = (name) => ({ registry }) => {
|
|
76
78
|
(0, import_deprecated.default)("select( 'core/edit-post' ).openModal( name )", {
|
|
77
79
|
since: "6.3",
|
|
78
80
|
alternative: "select( 'core/interface').openModal( name )"
|
|
79
81
|
});
|
|
80
82
|
return registry.dispatch(interfaceStore).openModal(name);
|
|
81
83
|
};
|
|
82
|
-
|
|
84
|
+
var closeModal = () => ({ registry }) => {
|
|
83
85
|
(0, import_deprecated.default)("select( 'core/edit-post' ).closeModal()", {
|
|
84
86
|
since: "6.3",
|
|
85
87
|
alternative: "select( 'core/interface').closeModal()"
|
|
86
88
|
});
|
|
87
89
|
return registry.dispatch(interfaceStore).closeModal();
|
|
88
90
|
};
|
|
89
|
-
|
|
91
|
+
var openPublishSidebar = () => ({ registry }) => {
|
|
90
92
|
(0, import_deprecated.default)("dispatch( 'core/edit-post' ).openPublishSidebar", {
|
|
91
93
|
since: "6.6",
|
|
92
94
|
alternative: "dispatch( 'core/editor').openPublishSidebar"
|
|
93
95
|
});
|
|
94
96
|
registry.dispatch(import_editor.store).openPublishSidebar();
|
|
95
97
|
};
|
|
96
|
-
|
|
98
|
+
var closePublishSidebar = () => ({ registry }) => {
|
|
97
99
|
(0, import_deprecated.default)("dispatch( 'core/edit-post' ).closePublishSidebar", {
|
|
98
100
|
since: "6.6",
|
|
99
101
|
alternative: "dispatch( 'core/editor').closePublishSidebar"
|
|
100
102
|
});
|
|
101
103
|
registry.dispatch(import_editor.store).closePublishSidebar();
|
|
102
104
|
};
|
|
103
|
-
|
|
105
|
+
var togglePublishSidebar = () => ({ registry }) => {
|
|
104
106
|
(0, import_deprecated.default)("dispatch( 'core/edit-post' ).togglePublishSidebar", {
|
|
105
107
|
since: "6.6",
|
|
106
108
|
alternative: "dispatch( 'core/editor').togglePublishSidebar"
|
|
107
109
|
});
|
|
108
110
|
registry.dispatch(import_editor.store).togglePublishSidebar();
|
|
109
111
|
};
|
|
110
|
-
|
|
112
|
+
var toggleEditorPanelEnabled = (panelName) => ({ registry }) => {
|
|
111
113
|
(0, import_deprecated.default)("dispatch( 'core/edit-post' ).toggleEditorPanelEnabled", {
|
|
112
114
|
since: "6.5",
|
|
113
115
|
alternative: "dispatch( 'core/editor').toggleEditorPanelEnabled"
|
|
114
116
|
});
|
|
115
117
|
registry.dispatch(import_editor.store).toggleEditorPanelEnabled(panelName);
|
|
116
118
|
};
|
|
117
|
-
|
|
119
|
+
var toggleEditorPanelOpened = (panelName) => ({ registry }) => {
|
|
118
120
|
(0, import_deprecated.default)("dispatch( 'core/edit-post' ).toggleEditorPanelOpened", {
|
|
119
121
|
since: "6.5",
|
|
120
122
|
alternative: "dispatch( 'core/editor').toggleEditorPanelOpened"
|
|
121
123
|
});
|
|
122
124
|
registry.dispatch(import_editor.store).toggleEditorPanelOpened(panelName);
|
|
123
125
|
};
|
|
124
|
-
|
|
126
|
+
var removeEditorPanel = (panelName) => ({ registry }) => {
|
|
125
127
|
(0, import_deprecated.default)("dispatch( 'core/edit-post' ).removeEditorPanel", {
|
|
126
128
|
since: "6.5",
|
|
127
129
|
alternative: "dispatch( 'core/editor').removeEditorPanel"
|
|
128
130
|
});
|
|
129
131
|
registry.dispatch(import_editor.store).removeEditorPanel(panelName);
|
|
130
132
|
};
|
|
131
|
-
|
|
132
|
-
|
|
133
|
+
var toggleFeature = (feature) => ({ registry }) => registry.dispatch(import_preferences.store).toggle("core/edit-post", feature);
|
|
134
|
+
var switchEditorMode = (mode) => ({ registry }) => {
|
|
133
135
|
(0, import_deprecated.default)("dispatch( 'core/edit-post' ).switchEditorMode", {
|
|
134
136
|
since: "6.6",
|
|
135
137
|
alternative: "dispatch( 'core/editor').switchEditorMode"
|
|
136
138
|
});
|
|
137
139
|
registry.dispatch(import_editor.store).switchEditorMode(mode);
|
|
138
140
|
};
|
|
139
|
-
|
|
141
|
+
var togglePinnedPluginItem = (pluginName) => ({ registry }) => {
|
|
140
142
|
const isPinned = registry.select(interfaceStore).isItemPinned("core", pluginName);
|
|
141
143
|
registry.dispatch(interfaceStore)[isPinned ? "unpinItem" : "pinItem"]("core", pluginName);
|
|
142
144
|
};
|
|
@@ -147,10 +149,10 @@ function updatePreferredStyleVariations() {
|
|
|
147
149
|
});
|
|
148
150
|
return { type: "NOTHING" };
|
|
149
151
|
}
|
|
150
|
-
|
|
152
|
+
var showBlockTypes = (blockNames) => ({ registry }) => {
|
|
151
153
|
(0, import_lock_unlock.unlock)(registry.dispatch(import_editor.store)).showBlockTypes(blockNames);
|
|
152
154
|
};
|
|
153
|
-
|
|
155
|
+
var hideBlockTypes = (blockNames) => ({ registry }) => {
|
|
154
156
|
(0, import_lock_unlock.unlock)(registry.dispatch(import_editor.store)).hideBlockTypes(blockNames);
|
|
155
157
|
};
|
|
156
158
|
function setAvailableMetaBoxesPerLocation(metaBoxesPerLocation) {
|
|
@@ -159,7 +161,7 @@ function setAvailableMetaBoxesPerLocation(metaBoxesPerLocation) {
|
|
|
159
161
|
metaBoxesPerLocation
|
|
160
162
|
};
|
|
161
163
|
}
|
|
162
|
-
|
|
164
|
+
var requestMetaBoxUpdates = () => async ({ registry, select, dispatch }) => {
|
|
163
165
|
dispatch({
|
|
164
166
|
type: "REQUEST_META_BOX_UPDATES"
|
|
165
167
|
});
|
|
@@ -216,7 +218,7 @@ function metaBoxUpdatesFailure() {
|
|
|
216
218
|
type: "META_BOX_UPDATES_FAILURE"
|
|
217
219
|
};
|
|
218
220
|
}
|
|
219
|
-
|
|
221
|
+
var __experimentalSetPreviewDeviceType = (deviceType) => ({ registry }) => {
|
|
220
222
|
(0, import_deprecated.default)(
|
|
221
223
|
"dispatch( 'core/edit-post' ).__experimentalSetPreviewDeviceType",
|
|
222
224
|
{
|
|
@@ -227,14 +229,14 @@ const __experimentalSetPreviewDeviceType = (deviceType) => ({ registry }) => {
|
|
|
227
229
|
);
|
|
228
230
|
registry.dispatch(import_editor.store).setDeviceType(deviceType);
|
|
229
231
|
};
|
|
230
|
-
|
|
232
|
+
var setIsInserterOpened = (value) => ({ registry }) => {
|
|
231
233
|
(0, import_deprecated.default)("dispatch( 'core/edit-post' ).setIsInserterOpened", {
|
|
232
234
|
since: "6.5",
|
|
233
235
|
alternative: "dispatch( 'core/editor').setIsInserterOpened"
|
|
234
236
|
});
|
|
235
237
|
registry.dispatch(import_editor.store).setIsInserterOpened(value);
|
|
236
238
|
};
|
|
237
|
-
|
|
239
|
+
var setIsListViewOpened = (isOpen) => ({ registry }) => {
|
|
238
240
|
(0, import_deprecated.default)("dispatch( 'core/edit-post' ).setIsListViewOpened", {
|
|
239
241
|
since: "6.5",
|
|
240
242
|
alternative: "dispatch( 'core/editor').setIsListViewOpened"
|
|
@@ -254,8 +256,8 @@ function __unstableCreateTemplate() {
|
|
|
254
256
|
});
|
|
255
257
|
return { type: "NOTHING" };
|
|
256
258
|
}
|
|
257
|
-
|
|
258
|
-
|
|
259
|
+
var metaBoxesInitialized = false;
|
|
260
|
+
var initializeMetaBoxes = () => ({ registry, select, dispatch }) => {
|
|
259
261
|
const isEditorReady = registry.select(import_editor.store).__unstableIsEditorReady();
|
|
260
262
|
if (!isEditorReady) {
|
|
261
263
|
return;
|
|
@@ -281,14 +283,14 @@ const initializeMetaBoxes = () => ({ registry, select, dispatch }) => {
|
|
|
281
283
|
type: "META_BOXES_INITIALIZED"
|
|
282
284
|
});
|
|
283
285
|
};
|
|
284
|
-
|
|
286
|
+
var toggleDistractionFree = () => ({ registry }) => {
|
|
285
287
|
(0, import_deprecated.default)("dispatch( 'core/edit-post' ).toggleDistractionFree", {
|
|
286
288
|
since: "6.6",
|
|
287
289
|
alternative: "dispatch( 'core/editor').toggleDistractionFree"
|
|
288
290
|
});
|
|
289
291
|
registry.dispatch(import_editor.store).toggleDistractionFree();
|
|
290
292
|
};
|
|
291
|
-
|
|
293
|
+
var toggleFullscreenMode = () => ({ registry }) => {
|
|
292
294
|
const isFullscreen = registry.select(import_preferences.store).get("core/edit-post", "fullscreenMode");
|
|
293
295
|
registry.dispatch(import_preferences.store).toggle("core/edit-post", "fullscreenMode");
|
|
294
296
|
registry.dispatch(import_notices.store).createInfoNotice(
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/store/actions.js"],
|
|
4
4
|
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport apiFetch from '@wordpress/api-fetch';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport {\n\tstore as editorStore,\n\tprivateApis as editorPrivateApis,\n} from '@wordpress/editor';\nimport deprecated from '@wordpress/deprecated';\nimport { addAction } from '@wordpress/hooks';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { getMetaBoxContainer } from '../utils/meta-boxes';\nimport { unlock } from '../lock-unlock';\n\nconst { interfaceStore } = unlock( editorPrivateApis );\n\n/**\n * Returns an action object used in signalling that the user opened an editor sidebar.\n *\n * @param {?string} name Sidebar name to be opened.\n */\nexport const openGeneralSidebar =\n\t( name ) =>\n\t( { registry } ) => {\n\t\tregistry\n\t\t\t.dispatch( interfaceStore )\n\t\t\t.enableComplementaryArea( 'core', name );\n\t};\n\n/**\n * Returns an action object signalling that the user closed the sidebar.\n */\nexport const closeGeneralSidebar =\n\t() =>\n\t( { registry } ) =>\n\t\tregistry.dispatch( interfaceStore ).disableComplementaryArea( 'core' );\n\n/**\n * Returns an action object used in signalling that the user opened a modal.\n *\n * @deprecated since WP 6.3 use `core/interface` store's action with the same name instead.\n *\n *\n * @param {string} name A string that uniquely identifies the modal.\n *\n * @return {Object} Action object.\n */\nexport const openModal =\n\t( name ) =>\n\t( { registry } ) => {\n\t\tdeprecated( \"select( 'core/edit-post' ).openModal( name )\", {\n\t\t\tsince: '6.3',\n\t\t\talternative: \"select( 'core/interface').openModal( name )\",\n\t\t} );\n\t\treturn registry.dispatch( interfaceStore ).openModal( name );\n\t};\n\n/**\n * Returns an action object signalling that the user closed a modal.\n *\n * @deprecated since WP 6.3 use `core/interface` store's action with the same name instead.\n *\n * @return {Object} Action object.\n */\nexport const closeModal =\n\t() =>\n\t( { registry } ) => {\n\t\tdeprecated( \"select( 'core/edit-post' ).closeModal()\", {\n\t\t\tsince: '6.3',\n\t\t\talternative: \"select( 'core/interface').closeModal()\",\n\t\t} );\n\t\treturn registry.dispatch( interfaceStore ).closeModal();\n\t};\n\n/**\n * Returns an action object used in signalling that the user opened the publish\n * sidebar.\n * @deprecated\n *\n * @return {Object} Action object\n */\nexport const openPublishSidebar =\n\t() =>\n\t( { registry } ) => {\n\t\tdeprecated( \"dispatch( 'core/edit-post' ).openPublishSidebar\", {\n\t\t\tsince: '6.6',\n\t\t\talternative: \"dispatch( 'core/editor').openPublishSidebar\",\n\t\t} );\n\t\tregistry.dispatch( editorStore ).openPublishSidebar();\n\t};\n\n/**\n * Returns an action object used in signalling that the user closed the\n * publish sidebar.\n * @deprecated\n *\n * @return {Object} Action object.\n */\nexport const closePublishSidebar =\n\t() =>\n\t( { registry } ) => {\n\t\tdeprecated( \"dispatch( 'core/edit-post' ).closePublishSidebar\", {\n\t\t\tsince: '6.6',\n\t\t\talternative: \"dispatch( 'core/editor').closePublishSidebar\",\n\t\t} );\n\t\tregistry.dispatch( editorStore ).closePublishSidebar();\n\t};\n\n/**\n * Returns an action object used in signalling that the user toggles the publish sidebar.\n * @deprecated\n *\n * @return {Object} Action object\n */\nexport const togglePublishSidebar =\n\t() =>\n\t( { registry } ) => {\n\t\tdeprecated( \"dispatch( 'core/edit-post' ).togglePublishSidebar\", {\n\t\t\tsince: '6.6',\n\t\t\talternative: \"dispatch( 'core/editor').togglePublishSidebar\",\n\t\t} );\n\t\tregistry.dispatch( editorStore ).togglePublishSidebar();\n\t};\n\n/**\n * Returns an action object used to enable or disable a panel in the editor.\n *\n * @deprecated\n *\n * @param {string} panelName A string that identifies the panel to enable or disable.\n *\n * @return {Object} Action object.\n */\nexport const toggleEditorPanelEnabled =\n\t( panelName ) =>\n\t( { registry } ) => {\n\t\tdeprecated( \"dispatch( 'core/edit-post' ).toggleEditorPanelEnabled\", {\n\t\t\tsince: '6.5',\n\t\t\talternative: \"dispatch( 'core/editor').toggleEditorPanelEnabled\",\n\t\t} );\n\t\tregistry.dispatch( editorStore ).toggleEditorPanelEnabled( panelName );\n\t};\n\n/**\n * Opens a closed panel and closes an open panel.\n *\n * @deprecated\n *\n * @param {string} panelName A string that identifies the panel to open or close.\n */\nexport const toggleEditorPanelOpened =\n\t( panelName ) =>\n\t( { registry } ) => {\n\t\tdeprecated( \"dispatch( 'core/edit-post' ).toggleEditorPanelOpened\", {\n\t\t\tsince: '6.5',\n\t\t\talternative: \"dispatch( 'core/editor').toggleEditorPanelOpened\",\n\t\t} );\n\t\tregistry.dispatch( editorStore ).toggleEditorPanelOpened( panelName );\n\t};\n\n/**\n * Returns an action object used to remove a panel from the editor.\n *\n * @deprecated\n *\n * @param {string} panelName A string that identifies the panel to remove.\n *\n * @return {Object} Action object.\n */\nexport const removeEditorPanel =\n\t( panelName ) =>\n\t( { registry } ) => {\n\t\tdeprecated( \"dispatch( 'core/edit-post' ).removeEditorPanel\", {\n\t\t\tsince: '6.5',\n\t\t\talternative: \"dispatch( 'core/editor').removeEditorPanel\",\n\t\t} );\n\t\tregistry.dispatch( editorStore ).removeEditorPanel( panelName );\n\t};\n\n/**\n * Triggers an action used to toggle a feature flag.\n *\n * @param {string} feature Feature name.\n */\nexport const toggleFeature =\n\t( feature ) =>\n\t( { registry } ) =>\n\t\tregistry\n\t\t\t.dispatch( preferencesStore )\n\t\t\t.toggle( 'core/edit-post', feature );\n\n/**\n * Triggers an action used to switch editor mode.\n *\n * @deprecated\n *\n * @param {string} mode The editor mode.\n */\nexport const switchEditorMode =\n\t( mode ) =>\n\t( { registry } ) => {\n\t\tdeprecated( \"dispatch( 'core/edit-post' ).switchEditorMode\", {\n\t\t\tsince: '6.6',\n\t\t\talternative: \"dispatch( 'core/editor').switchEditorMode\",\n\t\t} );\n\t\tregistry.dispatch( editorStore ).switchEditorMode( mode );\n\t};\n\n/**\n * Triggers an action object used to toggle a plugin name flag.\n *\n * @param {string} pluginName Plugin name.\n */\nexport const togglePinnedPluginItem =\n\t( pluginName ) =>\n\t( { registry } ) => {\n\t\tconst isPinned = registry\n\t\t\t.select( interfaceStore )\n\t\t\t.isItemPinned( 'core', pluginName );\n\n\t\tregistry\n\t\t\t.dispatch( interfaceStore )\n\t\t\t[ isPinned ? 'unpinItem' : 'pinItem' ]( 'core', pluginName );\n\t};\n\n/**\n * Returns an action object used in signaling that a style should be auto-applied when a block is created.\n *\n * @deprecated\n */\nexport function updatePreferredStyleVariations() {\n\tdeprecated( \"dispatch( 'core/edit-post' ).updatePreferredStyleVariations\", {\n\t\tsince: '6.6',\n\t\thint: 'Preferred Style Variations are not supported anymore.',\n\t} );\n\treturn { type: 'NOTHING' };\n}\n\n/**\n * Update the provided block types to be visible.\n *\n * @param {string[]} blockNames Names of block types to show.\n */\nexport const showBlockTypes =\n\t( blockNames ) =>\n\t( { registry } ) => {\n\t\tunlock( registry.dispatch( editorStore ) ).showBlockTypes( blockNames );\n\t};\n\n/**\n * Update the provided block types to be hidden.\n *\n * @param {string[]} blockNames Names of block types to hide.\n */\nexport const hideBlockTypes =\n\t( blockNames ) =>\n\t( { registry } ) => {\n\t\tunlock( registry.dispatch( editorStore ) ).hideBlockTypes( blockNames );\n\t};\n\n/**\n * Stores info about which Meta boxes are available in which location.\n *\n * @param {Object} metaBoxesPerLocation Meta boxes per location.\n */\nexport function setAvailableMetaBoxesPerLocation( metaBoxesPerLocation ) {\n\treturn {\n\t\ttype: 'SET_META_BOXES_PER_LOCATIONS',\n\t\tmetaBoxesPerLocation,\n\t};\n}\n\n/**\n * Update a metabox.\n */\nexport const requestMetaBoxUpdates =\n\t() =>\n\tasync ( { registry, select, dispatch } ) => {\n\t\tdispatch( {\n\t\t\ttype: 'REQUEST_META_BOX_UPDATES',\n\t\t} );\n\n\t\t// Saves the wp_editor fields.\n\t\tif ( window.tinyMCE ) {\n\t\t\twindow.tinyMCE.triggerSave();\n\t\t}\n\n\t\t// We gather the base form data.\n\t\tconst baseFormData = new window.FormData(\n\t\t\tdocument.querySelector( '.metabox-base-form' )\n\t\t);\n\n\t\tconst postId = baseFormData.get( 'post_ID' );\n\t\tconst postType = baseFormData.get( 'post_type' );\n\n\t\t// Additional data needed for backward compatibility.\n\t\t// If we do not provide this data, the post will be overridden with the default values.\n\t\t// We cannot rely on getCurrentPost because right now on the editor we may be editing a pattern or a template.\n\t\t// We need to retrieve the post that the base form data is referring to.\n\t\tconst post = registry\n\t\t\t.select( coreStore )\n\t\t\t.getEditedEntityRecord( 'postType', postType, postId );\n\t\tconst additionalData = [\n\t\t\tpost.comment_status\n\t\t\t\t? [ 'comment_status', post.comment_status ]\n\t\t\t\t: false,\n\t\t\tpost.ping_status ? [ 'ping_status', post.ping_status ] : false,\n\t\t\tpost.sticky ? [ 'sticky', post.sticky ] : false,\n\t\t\tpost.author ? [ 'post_author', post.author ] : false,\n\t\t].filter( Boolean );\n\n\t\t// We gather all the metaboxes locations.\n\t\tconst activeMetaBoxLocations = select.getActiveMetaBoxLocations();\n\t\tconst formDataToMerge = [\n\t\t\tbaseFormData,\n\t\t\t...activeMetaBoxLocations.map(\n\t\t\t\t( location ) =>\n\t\t\t\t\tnew window.FormData( getMetaBoxContainer( location ) )\n\t\t\t),\n\t\t];\n\n\t\t// Merge all form data objects into a single one.\n\t\tconst formData = formDataToMerge.reduce( ( memo, currentFormData ) => {\n\t\t\tfor ( const [ key, value ] of currentFormData ) {\n\t\t\t\tmemo.append( key, value );\n\t\t\t}\n\t\t\treturn memo;\n\t\t}, new window.FormData() );\n\t\tadditionalData.forEach( ( [ key, value ] ) =>\n\t\t\tformData.append( key, value )\n\t\t);\n\n\t\ttry {\n\t\t\t// Save the metaboxes.\n\t\t\tawait apiFetch( {\n\t\t\t\turl: window._wpMetaBoxUrl,\n\t\t\t\tmethod: 'POST',\n\t\t\t\tbody: formData,\n\t\t\t\tparse: false,\n\t\t\t} );\n\t\t\tdispatch.metaBoxUpdatesSuccess();\n\t\t} catch {\n\t\t\tdispatch.metaBoxUpdatesFailure();\n\t\t}\n\t};\n\n/**\n * Returns an action object used to signal a successful meta box update.\n *\n * @return {Object} Action object.\n */\nexport function metaBoxUpdatesSuccess() {\n\treturn {\n\t\ttype: 'META_BOX_UPDATES_SUCCESS',\n\t};\n}\n\n/**\n * Returns an action object used to signal a failed meta box update.\n *\n * @return {Object} Action object.\n */\nexport function metaBoxUpdatesFailure() {\n\treturn {\n\t\ttype: 'META_BOX_UPDATES_FAILURE',\n\t};\n}\n\n/**\n * Action that changes the width of the editing canvas.\n *\n * @deprecated\n *\n * @param {string} deviceType\n */\nexport const __experimentalSetPreviewDeviceType =\n\t( deviceType ) =>\n\t( { registry } ) => {\n\t\tdeprecated(\n\t\t\t\"dispatch( 'core/edit-post' ).__experimentalSetPreviewDeviceType\",\n\t\t\t{\n\t\t\t\tsince: '6.5',\n\t\t\t\tversion: '6.7',\n\t\t\t\thint: 'registry.dispatch( editorStore ).setDeviceType',\n\t\t\t}\n\t\t);\n\t\tregistry.dispatch( editorStore ).setDeviceType( deviceType );\n\t};\n\n/**\n * Returns an action object used to open/close the inserter.\n *\n * @deprecated\n *\n * @param {boolean|Object} value Whether the inserter should be opened (true) or closed (false).\n */\nexport const setIsInserterOpened =\n\t( value ) =>\n\t( { registry } ) => {\n\t\tdeprecated( \"dispatch( 'core/edit-post' ).setIsInserterOpened\", {\n\t\t\tsince: '6.5',\n\t\t\talternative: \"dispatch( 'core/editor').setIsInserterOpened\",\n\t\t} );\n\t\tregistry.dispatch( editorStore ).setIsInserterOpened( value );\n\t};\n\n/**\n * Returns an action object used to open/close the list view.\n *\n * @deprecated\n *\n * @param {boolean} isOpen A boolean representing whether the list view should be opened or closed.\n */\nexport const setIsListViewOpened =\n\t( isOpen ) =>\n\t( { registry } ) => {\n\t\tdeprecated( \"dispatch( 'core/edit-post' ).setIsListViewOpened\", {\n\t\t\tsince: '6.5',\n\t\t\talternative: \"dispatch( 'core/editor').setIsListViewOpened\",\n\t\t} );\n\t\tregistry.dispatch( editorStore ).setIsListViewOpened( isOpen );\n\t};\n\n/**\n * Returns an action object used to switch to template editing.\n *\n * @deprecated\n */\nexport function setIsEditingTemplate() {\n\tdeprecated( \"dispatch( 'core/edit-post' ).setIsEditingTemplate\", {\n\t\tsince: '6.5',\n\t\talternative: \"dispatch( 'core/editor').setRenderingMode\",\n\t} );\n\treturn { type: 'NOTHING' };\n}\n\n/**\n * Create a block based template.\n *\n * @deprecated\n */\nexport function __unstableCreateTemplate() {\n\tdeprecated( \"dispatch( 'core/edit-post' ).__unstableCreateTemplate\", {\n\t\tsince: '6.5',\n\t} );\n\treturn { type: 'NOTHING' };\n}\n\nlet metaBoxesInitialized = false;\n\n/**\n * Initializes WordPress `postboxes` script and the logic for saving meta boxes.\n */\nexport const initializeMetaBoxes =\n\t() =>\n\t( { registry, select, dispatch } ) => {\n\t\tconst isEditorReady = registry\n\t\t\t.select( editorStore )\n\t\t\t.__unstableIsEditorReady();\n\n\t\tif ( ! isEditorReady ) {\n\t\t\treturn;\n\t\t}\n\t\t// Only initialize once.\n\t\tif ( metaBoxesInitialized ) {\n\t\t\treturn;\n\t\t}\n\t\tconst postType = registry.select( editorStore ).getCurrentPostType();\n\t\tif ( window.postboxes.page !== postType ) {\n\t\t\twindow.postboxes.add_postbox_toggles( postType );\n\t\t}\n\n\t\tmetaBoxesInitialized = true;\n\n\t\t// Save metaboxes on save completion, except for autosaves.\n\t\taddAction(\n\t\t\t'editor.savePost',\n\t\t\t'core/edit-post/save-metaboxes',\n\t\t\tasync ( post, options ) => {\n\t\t\t\tif ( ! options.isAutosave && select.hasMetaBoxes() ) {\n\t\t\t\t\tawait dispatch.requestMetaBoxUpdates();\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\n\t\tdispatch( {\n\t\t\ttype: 'META_BOXES_INITIALIZED',\n\t\t} );\n\t};\n\n/**\n * Action that toggles Distraction free mode.\n * Distraction free mode expects there are no sidebars, as due to the\n * z-index values set, you can't close sidebars.\n *\n * @deprecated\n */\nexport const toggleDistractionFree =\n\t() =>\n\t( { registry } ) => {\n\t\tdeprecated( \"dispatch( 'core/edit-post' ).toggleDistractionFree\", {\n\t\t\tsince: '6.6',\n\t\t\talternative: \"dispatch( 'core/editor').toggleDistractionFree\",\n\t\t} );\n\t\tregistry.dispatch( editorStore ).toggleDistractionFree();\n\t};\n\n/**\n * Action that toggles the Fullscreen Mode view option.\n */\nexport const toggleFullscreenMode =\n\t() =>\n\t( { registry } ) => {\n\t\tconst isFullscreen = registry\n\t\t\t.select( preferencesStore )\n\t\t\t.get( 'core/edit-post', 'fullscreenMode' );\n\n\t\tregistry\n\t\t\t.dispatch( preferencesStore )\n\t\t\t.toggle( 'core/edit-post', 'fullscreenMode' );\n\n\t\tregistry\n\t\t\t.dispatch( noticesStore )\n\t\t\t.createInfoNotice(\n\t\t\t\tisFullscreen\n\t\t\t\t\t? __( 'Fullscreen mode deactivated.' )\n\t\t\t\t\t: __( 'Fullscreen mode activated.' ),\n\t\t\t\t{\n\t\t\t\t\tid: 'core/edit-post/toggle-fullscreen-mode/notice',\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\tactions: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: __( 'Undo' ),\n\n\t\t\t\t\t\t\tonClick: () => {\n\t\t\t\t\t\t\t\tregistry\n\t\t\t\t\t\t\t\t\t.dispatch( preferencesStore )\n\t\t\t\t\t\t\t\t\t.toggle(\n\t\t\t\t\t\t\t\t\t\t'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,WAAU;AAAA,IACT,MAAM;AAAA,EACP,CAAE;AACH;AASM,IAAM,wBACZ,MACA,CAAE,EAAE,SAAS,MAAO;AACnB,wBAAAD,SAAY,sDAAsD;AAAA,IACjE,OAAO;AAAA,IACP,aAAa;AAAA,EACd,CAAE;AACF,WAAS,SAAU,cAAAC,KAAY,EAAE,sBAAsB;AACxD;AAKM,IAAM,uBACZ,MACA,CAAE,EAAE,SAAS,MAAO;AACnB,QAAM,eAAe,SACnB,OAAQ,mBAAAC,KAAiB,EACzB,IAAK,kBAAkB,gBAAiB;AAE1C,WACE,SAAU,mBAAAA,KAAiB,EAC3B,OAAQ,kBAAkB,gBAAiB;AAE7C,WACE,SAAU,eAAAG,KAAa,EACvB;AAAA,IACA,mBACG,gBAAI,8BAA+B,QACnC,gBAAI,4BAA6B;AAAA,IACpC;AAAA,MACC,IAAI;AAAA,MACJ,MAAM;AAAA,MACN,SAAS;AAAA,QACR;AAAA,UACC,WAAO,gBAAI,MAAO;AAAA,UAElB,SAAS,MAAM;AACd,qBACE,SAAU,mBAAAH,KAAiB,EAC3B;AAAA,cACA;AAAA,cACA;AAAA,YACD;AAAA,UACF;AAAA,QACD;AAAA,MACD;AAAA,IACD;AAAA,EACD;AACF;",
|
|
6
6
|
"names": ["editorPrivateApis", "deprecated", "editorStore", "preferencesStore", "coreStore", "apiFetch", "noticesStore"]
|
|
7
7
|
}
|
package/build/store/constants.js
CHANGED
|
@@ -15,6 +15,8 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
15
15
|
return to;
|
|
16
16
|
};
|
|
17
17
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// packages/edit-post/src/store/constants.js
|
|
18
20
|
var constants_exports = {};
|
|
19
21
|
__export(constants_exports, {
|
|
20
22
|
STORE_NAME: () => STORE_NAME,
|
|
@@ -22,9 +24,9 @@ __export(constants_exports, {
|
|
|
22
24
|
VIEW_AS_PREVIEW_LINK_SELECTOR: () => VIEW_AS_PREVIEW_LINK_SELECTOR
|
|
23
25
|
});
|
|
24
26
|
module.exports = __toCommonJS(constants_exports);
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
27
|
+
var STORE_NAME = "core/edit-post";
|
|
28
|
+
var VIEW_AS_LINK_SELECTOR = "#wp-admin-bar-view a";
|
|
29
|
+
var VIEW_AS_PREVIEW_LINK_SELECTOR = "#wp-admin-bar-preview a";
|
|
28
30
|
// Annotate the CommonJS export names for ESM import in node:
|
|
29
31
|
0 && (module.exports = {
|
|
30
32
|
STORE_NAME,
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/store/constants.js"],
|
|
4
4
|
"sourcesContent": ["/**\n * The identifier for the data store.\n *\n * @type {string}\n */\nexport const STORE_NAME = 'core/edit-post';\n\n/**\n * CSS selector string for the admin bar view post link anchor tag.\n *\n * @type {string}\n */\nexport const VIEW_AS_LINK_SELECTOR = '#wp-admin-bar-view a';\n\n/**\n * CSS selector string for the admin bar preview post link anchor tag.\n *\n * @type {string}\n */\nexport const VIEW_AS_PREVIEW_LINK_SELECTOR = '#wp-admin-bar-preview a';\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAKO,IAAM,aAAa;AAOnB,IAAM,wBAAwB;AAO9B,IAAM,gCAAgC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/build/store/index.js
CHANGED
|
@@ -25,6 +25,8 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
25
25
|
mod
|
|
26
26
|
));
|
|
27
27
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// packages/edit-post/src/store/index.js
|
|
28
30
|
var store_exports = {};
|
|
29
31
|
__export(store_exports, {
|
|
30
32
|
store: () => store
|
|
@@ -35,7 +37,7 @@ var import_reducer = __toESM(require("./reducer"));
|
|
|
35
37
|
var actions = __toESM(require("./actions"));
|
|
36
38
|
var selectors = __toESM(require("./selectors"));
|
|
37
39
|
var import_constants = require("./constants");
|
|
38
|
-
|
|
40
|
+
var store = (0, import_data.createReduxStore)(import_constants.STORE_NAME, {
|
|
39
41
|
reducer: import_reducer.default,
|
|
40
42
|
actions,
|
|
41
43
|
selectors
|
package/build/store/index.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/store/index.js"],
|
|
4
4
|
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { createReduxStore, register } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport reducer from './reducer';\nimport * as actions from './actions';\nimport * as selectors from './selectors';\nimport { STORE_NAME } from './constants';\n\n/**\n * Store definition for the edit post namespace.\n *\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore\n *\n * @type {Object}\n */\nexport const store = createReduxStore( STORE_NAME, {\n\treducer,\n\tactions,\n\tselectors,\n} );\nregister( store );\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAA2C;AAK3C,qBAAoB;AACpB,cAAyB;AACzB,gBAA2B;AAC3B,uBAA2B;AASpB,IAAM,YAAQ,8BAAkB,6BAAY;AAAA,EAClD,wBAAAA;AAAA,EACA;AAAA,EACA;AACD,CAAE;AAAA,IACF,sBAAU,KAAM;",
|
|
6
6
|
"names": ["reducer"]
|
|
7
7
|
}
|
package/build/store/reducer.js
CHANGED
|
@@ -15,6 +15,8 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
15
15
|
return to;
|
|
16
16
|
};
|
|
17
17
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// packages/edit-post/src/store/reducer.js
|
|
18
20
|
var reducer_exports = {};
|
|
19
21
|
__export(reducer_exports, {
|
|
20
22
|
default: () => reducer_default,
|
|
@@ -72,7 +74,7 @@ function metaBoxesInitialized(state = false, action) {
|
|
|
72
74
|
}
|
|
73
75
|
return state;
|
|
74
76
|
}
|
|
75
|
-
|
|
77
|
+
var metaBoxes = (0, import_data.combineReducers)({
|
|
76
78
|
isSaving: isSavingMetaBoxes,
|
|
77
79
|
locations: metaBoxLocations,
|
|
78
80
|
initialized: metaBoxesInitialized
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/store/reducer.js"],
|
|
4
4
|
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { combineReducers } from '@wordpress/data';\n\n/**\n * Reducer keeping track of the meta boxes isSaving state.\n * A \"true\" value means the meta boxes saving request is in-flight.\n *\n *\n * @param {boolean} state Previous state.\n * @param {Object} action Action Object.\n *\n * @return {Object} Updated state.\n */\nexport function isSavingMetaBoxes( state = false, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'REQUEST_META_BOX_UPDATES':\n\t\t\treturn true;\n\t\tcase 'META_BOX_UPDATES_SUCCESS':\n\t\tcase 'META_BOX_UPDATES_FAILURE':\n\t\t\treturn false;\n\t\tdefault:\n\t\t\treturn state;\n\t}\n}\n\nfunction mergeMetaboxes( metaboxes = [], newMetaboxes ) {\n\tconst mergedMetaboxes = [ ...metaboxes ];\n\tfor ( const metabox of newMetaboxes ) {\n\t\tconst existing = mergedMetaboxes.findIndex(\n\t\t\t( box ) => box.id === metabox.id\n\t\t);\n\t\tif ( existing !== -1 ) {\n\t\t\tmergedMetaboxes[ existing ] = metabox;\n\t\t} else {\n\t\t\tmergedMetaboxes.push( metabox );\n\t\t}\n\t}\n\treturn mergedMetaboxes;\n}\n\n/**\n * Reducer keeping track of the meta boxes per location.\n *\n * @param {boolean} state Previous state.\n * @param {Object} action Action Object.\n *\n * @return {Object} Updated state.\n */\nexport function metaBoxLocations( state = {}, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_META_BOXES_PER_LOCATIONS': {\n\t\t\tconst newState = { ...state };\n\t\t\tfor ( const [ location, metaboxes ] of Object.entries(\n\t\t\t\taction.metaBoxesPerLocation\n\t\t\t) ) {\n\t\t\t\tnewState[ location ] = mergeMetaboxes(\n\t\t\t\t\tnewState[ location ],\n\t\t\t\t\tmetaboxes\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn newState;\n\t\t}\n\t}\n\n\treturn state;\n}\n\n/**\n * Reducer tracking whether meta boxes are initialized.\n *\n * @param {boolean} state\n * @param {Object} action\n *\n * @return {boolean} Updated state.\n */\nfunction metaBoxesInitialized( state = false, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'META_BOXES_INITIALIZED':\n\t\t\treturn true;\n\t}\n\treturn state;\n}\n\nconst metaBoxes = combineReducers( {\n\tisSaving: isSavingMetaBoxes,\n\tlocations: metaBoxLocations,\n\tinitialized: metaBoxesInitialized,\n} );\n\nexport default combineReducers( {\n\tmetaBoxes,\n} );\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAgC;AAYzB,SAAS,kBAAmB,QAAQ,OAAO,QAAS;AAC1D,UAAS,OAAO,MAAO;AAAA,IACtB,KAAK;AACJ,aAAO;AAAA,IACR,KAAK;AAAA,IACL,KAAK;AACJ,aAAO;AAAA,IACR;AACC,aAAO;AAAA,EACT;AACD;AAEA,SAAS,eAAgB,YAAY,CAAC,GAAG,cAAe;AACvD,QAAM,kBAAkB,CAAE,GAAG,SAAU;AACvC,aAAY,WAAW,cAAe;AACrC,UAAM,WAAW,gBAAgB;AAAA,MAChC,CAAE,QAAS,IAAI,OAAO,QAAQ;AAAA,IAC/B;AACA,QAAK,aAAa,IAAK;AACtB,sBAAiB,QAAS,I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