@wordpress/edit-post 6.1.1 → 6.3.1
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 +4 -0
- package/build/components/header/plugin-more-menu-item/index.js +5 -0
- package/build/components/header/plugin-more-menu-item/index.js.map +1 -1
- package/build/components/header/template-title/delete-template.js +3 -1
- package/build/components/header/template-title/delete-template.js.map +1 -1
- package/build/components/layout/index.js +3 -1
- package/build/components/layout/index.js.map +1 -1
- package/build/components/sidebar/post-link/index.js +1 -1
- package/build/components/sidebar/post-link/index.js.map +1 -1
- package/build/components/start-page-options/index.js +116 -0
- package/build/components/start-page-options/index.js.map +1 -0
- package/build/components/visual-editor/index.js +3 -3
- package/build/components/visual-editor/index.js.map +1 -1
- package/build/editor.js +4 -6
- package/build/editor.js.map +1 -1
- package/build/index.js +5 -0
- package/build/index.js.map +1 -1
- package/build/index.native.js +15 -0
- package/build/index.native.js.map +1 -1
- package/build/store/actions.js +99 -74
- package/build/store/actions.js.map +1 -1
- package/build/store/index.js +7 -10
- package/build/store/index.js.map +1 -1
- package/build/store/reducer.js +0 -118
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +95 -34
- package/build/store/selectors.js.map +1 -1
- package/build-module/components/header/plugin-more-menu-item/index.js +4 -0
- package/build-module/components/header/plugin-more-menu-item/index.js.map +1 -1
- package/build-module/components/header/template-title/delete-template.js +3 -1
- package/build-module/components/header/template-title/delete-template.js.map +1 -1
- package/build-module/components/layout/index.js +2 -1
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/sidebar/post-link/index.js +1 -1
- package/build-module/components/sidebar/post-link/index.js.map +1 -1
- package/build-module/components/start-page-options/index.js +103 -0
- package/build-module/components/start-page-options/index.js.map +1 -0
- package/build-module/components/visual-editor/index.js +3 -3
- package/build-module/components/visual-editor/index.js.map +1 -1
- package/build-module/editor.js +3 -6
- package/build-module/editor.js.map +1 -1
- package/build-module/index.js +5 -0
- package/build-module/index.js.map +1 -1
- package/build-module/index.native.js +13 -0
- package/build-module/index.native.js.map +1 -1
- package/build-module/store/actions.js +92 -68
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/index.js +7 -10
- package/build-module/store/index.js.map +1 -1
- package/build-module/store/reducer.js +1 -115
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +89 -28
- package/build-module/store/selectors.js.map +1 -1
- package/build-style/style-rtl.css +39 -4
- package/build-style/style.css +39 -4
- package/package.json +27 -26
- package/src/components/header/plugin-more-menu-item/index.js +2 -0
- package/src/components/header/template-title/delete-template.js +3 -1
- package/src/components/layout/index.js +2 -0
- package/src/components/sidebar/post-link/index.js +1 -1
- package/src/components/start-page-options/index.js +121 -0
- package/src/components/start-page-options/style.scss +42 -0
- package/src/components/visual-editor/index.js +5 -3
- package/src/editor.js +3 -8
- package/src/index.js +5 -0
- package/src/index.native.js +14 -0
- package/src/store/actions.js +87 -42
- package/src/store/index.js +7 -11
- package/src/store/reducer.js +1 -106
- package/src/store/selectors.js +124 -50
- package/src/store/test/actions.js +89 -46
- package/src/store/test/reducer.js +0 -135
- package/src/store/test/selectors.js +0 -174
- package/src/style.scss +1 -4
- package/build/store/defaults.js +0 -19
- package/build/store/defaults.js.map +0 -1
- package/build-module/store/defaults.js +0 -12
- package/build-module/store/defaults.js.map +0 -1
- package/src/store/defaults.js +0 -11
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-post/src/index.js"],"names":["store","blocksStore","registerCoreBlocks","__experimentalRegisterExperimentalCoreBlocks","render","unmountComponentAtNode","dispatch","select","addFilter","preferencesStore","Editor","editPostStore","reinitializeEditor","postType","postId","target","settings","initialEdits","reboot","bind","initializeEditor","id","can","blockType","isEditingTemplate","name","document","getElementById","setDefaults","fixedToolbar","fullscreenMode","hiddenBlockTypes","showBlockBreadcrumbs","showIconLabels","themeStyles","welcomeGuide","welcomeGuideTemplate","__experimentalReapplyBlockTypeFilters","process","env","IS_GUTENBERG_PLUGIN","enableFSEBlocks","__unstableEnableFullSiteEditingBlocks","documentMode","compatMode","console","warn","isIphone","window","navigator","userAgent","indexOf","addEventListener","event","editorScrollContainer","getElementsByClassName","scrollY","scrollTop","scrollTo","default","PluginBlockSettingsMenuItem","PluginDocumentSettingPanel","PluginMoreMenuItem","PluginPostPublishPanel","PluginPostStatusInfo","PluginPrePublishPanel","PluginSidebar","PluginSidebarMoreMenuItem","__experimentalFullscreenModeClose","__experimentalMainDashboardButton"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,KAAK,IAAIC,WAAlB,QAAqC,mBAArC;AACA,SACCC,kBADD,EAECC,4CAFD,QAGO,0BAHP;AAIA,SAASC,MAAT,EAAiBC,sBAAjB,QAA+C,oBAA/C;AACA,SAASC,QAAT,EAAmBC,MAAnB,QAAiC,iBAAjC;AACA,SAASC,SAAT,QAA0B,kBAA1B;AACA,SAASR,KAAK,IAAIS,gBAAlB,QAA0C,wBAA1C;AAEA;AACA;AACA;;AACA,OAAO,SAAP;AACA,OAAO,WAAP;AACA,OAAOC,MAAP,MAAmB,UAAnB;AACA,SAASV,KAAK,IAAIW,aAAlB,QAAuC,SAAvC;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASC,kBAAT,CACNC,QADM,EAENC,MAFM,EAGNC,MAHM,EAINC,QAJM,EAKNC,YALM,EAML;AACDZ,EAAAA,sBAAsB,CAAEU,MAAF,CAAtB;AACA,QAAMG,MAAM,GAAGN,kBAAkB,CAACO,IAAnB,CACd,IADc,EAEdN,QAFc,EAGdC,MAHc,EAIdC,MAJc,EAKdC,QALc,EAMdC,YANc,CAAf;AASAb,EAAAA,MAAM,CACL,cAAC,MAAD;AACC,IAAA,QAAQ,EAAGY,QADZ;AAEC,IAAA,OAAO,EAAGE,MAFX;AAGC,IAAA,MAAM,EAAGJ,MAHV;AAIC,IAAA,QAAQ,EAAGD,QAJZ;AAKC,IA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ED,SAAS4C,OAAO,IAAIC,2BAApB,QAAuD,kEAAvD;AACA,SAASD,OAAO,IAAIE,0BAApB,QAAsD,oDAAtD;AACA,SAASF,OAAO,IAAIG,kBAApB,QAA8C,2CAA9C;AACA,SAASH,OAAO,IAAII,sBAApB,QAAkD,gDAAlD;AACA,SAASJ,OAAO,IAAIK,oBAApB,QAAgD,8CAAhD;AACA,SAASL,OAAO,IAAIM,qBAApB,QAAiD,+CAAjD;AACA,SAASN,OAAO,IAAIO,aAApB,QAAyC,qCAAzC;AACA,SAASP,OAAO,IAAIQ,yBAApB,QAAqD,mDAArD;AACA,SAASR,OAAO,IAAIS,iCAApB,QAA6D,2CAA7D;AACA,SAAST,OAAO,IAAIU,iCAApB,QAA6D,2CAA7D;AACA,SAASrE,KAAT,QAAsB,SAAtB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blocksStore } from '@wordpress/blocks';\nimport {\n\tregisterCoreBlocks,\n\t__experimentalRegisterExperimentalCoreBlocks,\n} from '@wordpress/block-library';\nimport { render, unmountComponentAtNode } from '@wordpress/element';\nimport { dispatch, select } from '@wordpress/data';\nimport { addFilter } from '@wordpress/hooks';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport './hooks';\nimport './plugins';\nimport Editor from './editor';\nimport { store as editPostStore } from './store';\n\n/**\n * Reinitializes the editor after the user chooses to reboot the editor after\n * an unhandled error occurs, replacing previously mounted editor element using\n * an initial state from prior to the crash.\n *\n * @param {Object} postType Post type of the post to edit.\n * @param {Object} postId ID of the post to edit.\n * @param {Element} target DOM node in which editor is rendered.\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 reinitializeEditor(\n\tpostType,\n\tpostId,\n\ttarget,\n\tsettings,\n\tinitialEdits\n) {\n\tunmountComponentAtNode( target );\n\tconst reboot = reinitializeEditor.bind(\n\t\tnull,\n\t\tpostType,\n\t\tpostId,\n\t\ttarget,\n\t\tsettings,\n\t\tinitialEdits\n\t);\n\n\trender(\n\t\t<Editor\n\t\t\tsettings={ settings }\n\t\t\tonError={ reboot }\n\t\t\tpostId={ postId }\n\t\t\tpostType={ postType }\n\t\t\tinitialEdits={ initialEdits }\n\t\t\trecovery\n\t\t/>,\n\t\ttarget\n\t);\n}\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\t// Prevent adding template part in the post editor.\n\t// Only add the filter when the post editor is initialized, not imported.\n\taddFilter(\n\t\t'blockEditor.__unstableCanInsertBlockType',\n\t\t'removeTemplatePartsFromInserter',\n\t\t( can, blockType ) => {\n\t\t\tif (\n\t\t\t\t! select( editPostStore ).isEditingTemplate() &&\n\t\t\t\tblockType.name === 'core/template-part'\n\t\t\t) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn can;\n\t\t}\n\t);\n\n\tconst target = document.getElementById( id );\n\tconst reboot = reinitializeEditor.bind(\n\t\tnull,\n\t\tpostType,\n\t\tpostId,\n\t\ttarget,\n\t\tsettings,\n\t\tinitialEdits\n\t);\n\n\tdispatch( preferencesStore ).setDefaults( 'core/edit-post', {\n\t\tfixedToolbar: false,\n\t\tfullscreenMode: true,\n\t\thiddenBlockTypes: [],\n\t\tshowBlockBreadcrumbs: true,\n\t\tshowIconLabels: false,\n\t\tthemeStyles: true,\n\t\twelcomeGuide: true,\n\t\twelcomeGuideTemplate: true,\n\t} );\n\n\tdispatch( blocksStore ).__experimentalReapplyBlockTypeFilters();\n\tregisterCoreBlocks();\n\tif ( process.env.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\trender(\n\t\t<Editor\n\t\t\tsettings={ settings }\n\t\t\tonError={ reboot }\n\t\t\tpostId={ postId }\n\t\t\tpostType={ postType }\n\t\t\tinitialEdits={ initialEdits }\n\t\t/>,\n\t\ttarget\n\t);\n}\n\nexport { default as PluginBlockSettingsMenuItem } from './components/block-settings-menu/plugin-block-settings-menu-item';\nexport { default as PluginDocumentSettingPanel } from './components/sidebar/plugin-document-setting-panel';\nexport { default as PluginMoreMenuItem } from './components/header/plugin-more-menu-item';\nexport { default as PluginPostPublishPanel } from './components/sidebar/plugin-post-publish-panel';\nexport { default as PluginPostStatusInfo } from './components/sidebar/plugin-post-status-info';\nexport { default as PluginPrePublishPanel } from './components/sidebar/plugin-pre-publish-panel';\nexport { default as PluginSidebar } from './components/sidebar/plugin-sidebar';\nexport { default as PluginSidebarMoreMenuItem } from './components/header/plugin-sidebar-more-menu-item';\nexport { default as __experimentalFullscreenModeClose } from './components/header/fullscreen-mode-close';\nexport { default as __experimentalMainDashboardButton } from './components/header/main-dashboard-button';\nexport { store } from './store';\n"]}
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-post/src/index.js"],"names":["store","blocksStore","registerCoreBlocks","__experimentalRegisterExperimentalCoreBlocks","render","unmountComponentAtNode","dispatch","select","addFilter","preferencesStore","Editor","editPostStore","reinitializeEditor","postType","postId","target","settings","initialEdits","reboot","bind","initializeEditor","id","can","blockType","isEditingTemplate","name","document","getElementById","setDefaults","editorMode","fixedToolbar","fullscreenMode","hiddenBlockTypes","inactivePanels","isPublishSidebarEnabled","openPanels","preferredStyleVariations","showBlockBreadcrumbs","showIconLabels","themeStyles","welcomeGuide","welcomeGuideTemplate","__experimentalReapplyBlockTypeFilters","process","env","IS_GUTENBERG_PLUGIN","enableFSEBlocks","__unstableEnableFullSiteEditingBlocks","documentMode","compatMode","console","warn","isIphone","window","navigator","userAgent","indexOf","addEventListener","event","editorScrollContainer","getElementsByClassName","scrollY","scrollTop","scrollTo","default","PluginBlockSettingsMenuItem","PluginDocumentSettingPanel","PluginMoreMenuItem","PluginPostPublishPanel","PluginPostStatusInfo","PluginPrePublishPanel","PluginSidebar","PluginSidebarMoreMenuItem","__experimentalFullscreenModeClose","__experimentalMainDashboardButton"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,KAAK,IAAIC,WAAlB,QAAqC,mBAArC;AACA,SACCC,kBADD,EAECC,4CAFD,QAGO,0BAHP;AAIA,SAASC,MAAT,EAAiBC,sBAAjB,QAA+C,oBAA/C;AACA,SAASC,QAAT,EAAmBC,MAAnB,QAAiC,iBAAjC;AACA,SAASC,SAAT,QAA0B,kBAA1B;AACA,SAASR,KAAK,IAAIS,gBAAlB,QAA0C,wBAA1C;AAEA;AACA;AACA;;AACA,OAAO,SAAP;AACA,OAAO,WAAP;AACA,OAAOC,MAAP,MAAmB,UAAnB;AACA,SAASV,KAAK,IAAIW,aAAlB,QAAuC,SAAvC;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASC,kBAAT,CACNC,QADM,EAENC,MAFM,EAGNC,MAHM,EAINC,QAJM,EAKNC,YALM,EAML;AACDZ,EAAAA,sBAAsB,CAAEU,MAAF,CAAtB;AACA,QAAMG,MAAM,GAAGN,kBAAkB,CAACO,IAAnB,CACd,IADc,EAEdN,QAFc,EAGdC,MAHc,EAIdC,MAJc,EAKdC,QALc,EAMdC,YANc,CAAf;AASAb,EAAAA,MAAM,CACL,cAAC,MAAD;AACC,IAAA,QAAQ,EAAGY,QADZ;AAEC,IAAA,OAAO,EAAGE,MAFX;AAGC,IAAA,MAAM,EAAGJ,MAHV;AAIC,IAAA,QAAQ,EAAGD,QAJZ;AAKC,IAAA,YAAY,EAAGI,YALhB;AAMC,IAAA,QAAQ;AANT,IADK,EASLF,MATK,CAAN;AAWA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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AGD,QAJZ;AAKC,IAAA,YAAY,EAAGI;AALhB,IADK,EAQLF,MARK,CAAN;AAUA;AAED,SAASiD,OAAO,IAAIC,2BAApB,QAAuD,kEAAvD;AACA,SAASD,OAAO,IAAIE,0BAApB,QAAsD,oDAAtD;AACA,SAASF,OAAO,IAAIG,kBAApB,QAA8C,2CAA9C;AACA,SAASH,OAAO,IAAII,sBAApB,QAAkD,gDAAlD;AACA,SAASJ,OAAO,IAAIK,oBAApB,QAAgD,8CAAhD;AACA,SAASL,OAAO,IAAIM,qBAApB,QAAiD,+CAAjD;AACA,SAASN,OAAO,IAAIO,aAApB,QAAyC,qCAAzC;AACA,SAASP,OAAO,IAAIQ,yBAApB,QAAqD,mDAArD;AACA,SAASR,OAAO,IAAIS,iCAApB,QAA6D,2CAA7D;AACA,SAAST,OAAO,IAAIU,iCAApB,QAA6D,2CAA7D;AACA,SAAS1E,KAAT,QAAsB,SAAtB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blocksStore } from '@wordpress/blocks';\nimport {\n\tregisterCoreBlocks,\n\t__experimentalRegisterExperimentalCoreBlocks,\n} from '@wordpress/block-library';\nimport { render, unmountComponentAtNode } from '@wordpress/element';\nimport { dispatch, select } from '@wordpress/data';\nimport { addFilter } from '@wordpress/hooks';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport './hooks';\nimport './plugins';\nimport Editor from './editor';\nimport { store as editPostStore } from './store';\n\n/**\n * Reinitializes the editor after the user chooses to reboot the editor after\n * an unhandled error occurs, replacing previously mounted editor element using\n * an initial state from prior to the crash.\n *\n * @param {Object} postType Post type of the post to edit.\n * @param {Object} postId ID of the post to edit.\n * @param {Element} target DOM node in which editor is rendered.\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 reinitializeEditor(\n\tpostType,\n\tpostId,\n\ttarget,\n\tsettings,\n\tinitialEdits\n) {\n\tunmountComponentAtNode( target );\n\tconst reboot = reinitializeEditor.bind(\n\t\tnull,\n\t\tpostType,\n\t\tpostId,\n\t\ttarget,\n\t\tsettings,\n\t\tinitialEdits\n\t);\n\n\trender(\n\t\t<Editor\n\t\t\tsettings={ settings }\n\t\t\tonError={ reboot }\n\t\t\tpostId={ postId }\n\t\t\tpostType={ postType }\n\t\t\tinitialEdits={ initialEdits }\n\t\t\trecovery\n\t\t/>,\n\t\ttarget\n\t);\n}\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\t// Prevent adding template part in the post editor.\n\t// Only add the filter when the post editor is initialized, not imported.\n\taddFilter(\n\t\t'blockEditor.__unstableCanInsertBlockType',\n\t\t'removeTemplatePartsFromInserter',\n\t\t( can, blockType ) => {\n\t\t\tif (\n\t\t\t\t! select( editPostStore ).isEditingTemplate() &&\n\t\t\t\tblockType.name === 'core/template-part'\n\t\t\t) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn can;\n\t\t}\n\t);\n\n\tconst target = document.getElementById( id );\n\tconst reboot = reinitializeEditor.bind(\n\t\tnull,\n\t\tpostType,\n\t\tpostId,\n\t\ttarget,\n\t\tsettings,\n\t\tinitialEdits\n\t);\n\n\tdispatch( preferencesStore ).setDefaults( 'core/edit-post', {\n\t\teditorMode: 'visual',\n\t\tfixedToolbar: false,\n\t\tfullscreenMode: true,\n\t\thiddenBlockTypes: [],\n\t\tinactivePanels: [],\n\t\tisPublishSidebarEnabled: true,\n\t\topenPanels: [ 'post-status' ],\n\t\tpreferredStyleVariations: {},\n\t\tshowBlockBreadcrumbs: true,\n\t\tshowIconLabels: false,\n\t\tthemeStyles: true,\n\t\twelcomeGuide: true,\n\t\twelcomeGuideTemplate: true,\n\t} );\n\n\tdispatch( blocksStore ).__experimentalReapplyBlockTypeFilters();\n\tregisterCoreBlocks();\n\tif ( process.env.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\trender(\n\t\t<Editor\n\t\t\tsettings={ settings }\n\t\t\tonError={ reboot }\n\t\t\tpostId={ postId }\n\t\t\tpostType={ postType }\n\t\t\tinitialEdits={ initialEdits }\n\t\t/>,\n\t\ttarget\n\t);\n}\n\nexport { default as PluginBlockSettingsMenuItem } from './components/block-settings-menu/plugin-block-settings-menu-item';\nexport { default as PluginDocumentSettingPanel } from './components/sidebar/plugin-document-setting-panel';\nexport { default as PluginMoreMenuItem } from './components/header/plugin-more-menu-item';\nexport { default as PluginPostPublishPanel } from './components/sidebar/plugin-post-publish-panel';\nexport { default as PluginPostStatusInfo } from './components/sidebar/plugin-post-status-info';\nexport { default as PluginPrePublishPanel } from './components/sidebar/plugin-pre-publish-panel';\nexport { default as PluginSidebar } from './components/sidebar/plugin-sidebar';\nexport { default as PluginSidebarMoreMenuItem } from './components/header/plugin-sidebar-more-menu-item';\nexport { default as __experimentalFullscreenModeClose } from './components/header/fullscreen-mode-close';\nexport { default as __experimentalMainDashboardButton } from './components/header/main-dashboard-button';\nexport { store } from './store';\n"]}
|
|
@@ -5,6 +5,8 @@ import { createElement } from "@wordpress/element";
|
|
|
5
5
|
*/
|
|
6
6
|
import '@wordpress/core-data';
|
|
7
7
|
import '@wordpress/format-library';
|
|
8
|
+
import { dispatch } from '@wordpress/data';
|
|
9
|
+
import { store as preferencesStore } from '@wordpress/preferences';
|
|
8
10
|
/**
|
|
9
11
|
* Internal dependencies
|
|
10
12
|
*/
|
|
@@ -21,6 +23,17 @@ import Editor from './editor';
|
|
|
21
23
|
*/
|
|
22
24
|
|
|
23
25
|
export function initializeEditor(id, postType, postId) {
|
|
26
|
+
dispatch(preferencesStore).setDefaults('core/edit-post', {
|
|
27
|
+
editorMode: 'visual',
|
|
28
|
+
fixedToolbar: false,
|
|
29
|
+
fullscreenMode: true,
|
|
30
|
+
hiddenBlockTypes: [],
|
|
31
|
+
inactivePanels: [],
|
|
32
|
+
isPublishSidebarEnabled: true,
|
|
33
|
+
openPanels: ['post-status'],
|
|
34
|
+
preferredStyleVariations: {},
|
|
35
|
+
welcomeGuide: true
|
|
36
|
+
});
|
|
24
37
|
return createElement(Editor, {
|
|
25
38
|
postId: postId,
|
|
26
39
|
postType: postType
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-post/src/index.native.js"],"names":["store","Editor","initializeEditor","id","postType","postId"],"mappings":";;AAAA;AACA;AACA;AACA,OAAO,sBAAP;AACA,OAAO,2BAAP;AAEA;AACA;AACA;;AACA,
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-post/src/index.native.js"],"names":["dispatch","store","preferencesStore","Editor","initializeEditor","id","postType","postId","setDefaults","editorMode","fixedToolbar","fullscreenMode","hiddenBlockTypes","inactivePanels","isPublishSidebarEnabled","openPanels","preferredStyleVariations","welcomeGuide"],"mappings":";;AAAA;AACA;AACA;AACA,OAAO,sBAAP;AACA,OAAO,2BAAP;AACA,SAASA,QAAT,QAAyB,iBAAzB;AACA,SAASC,KAAK,IAAIC,gBAAlB,QAA0C,wBAA1C;AAEA;AACA;AACA;;AACA,SAASD,KAAT,QAAsB,SAAtB;AACA,OAAOE,MAAP,MAAmB,UAAnB;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASC,gBAAT,CAA2BC,EAA3B,EAA+BC,QAA/B,EAAyCC,MAAzC,EAAkD;AACxDP,EAAAA,QAAQ,CAAEE,gBAAF,CAAR,CAA6BM,WAA7B,CAA0C,gBAA1C,EAA4D;AAC3DC,IAAAA,UAAU,EAAE,QAD+C;AAE3DC,IAAAA,YAAY,EAAE,KAF6C;AAG3DC,IAAAA,cAAc,EAAE,IAH2C;AAI3DC,IAAAA,gBAAgB,EAAE,EAJyC;AAK3DC,IAAAA,cAAc,EAAE,EAL2C;AAM3DC,IAAAA,uBAAuB,EAAE,IANkC;AAO3DC,IAAAA,UAAU,EAAE,CAAE,aAAF,CAP+C;AAQ3DC,IAAAA,wBAAwB,EAAE,EARiC;AAS3DC,IAAAA,YAAY,EAAE;AAT6C,GAA5D;AAYA,SAAO,cAAC,MAAD;AAAQ,IAAA,MAAM,EAAGV,MAAjB;AAA0B,IAAA,QAAQ,EAAGD;AAArC,IAAP;AACA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport '@wordpress/core-data';\nimport '@wordpress/format-library';\nimport { dispatch } from '@wordpress/data';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nexport { store } from './store';\nimport Editor from './editor';\n\n/**\n * Initializes the Editor and returns a componentProvider\n * that can be registered with `AppRegistry.registerComponent`\n *\n * @param {string} id Unique identifier for editor instance.\n * @param {Object} postType Post type of the post to edit.\n * @param {Object} postId ID of the post to edit (unused right now)\n */\nexport function initializeEditor( id, postType, postId ) {\n\tdispatch( preferencesStore ).setDefaults( 'core/edit-post', {\n\t\teditorMode: 'visual',\n\t\tfixedToolbar: false,\n\t\tfullscreenMode: true,\n\t\thiddenBlockTypes: [],\n\t\tinactivePanels: [],\n\t\tisPublishSidebarEnabled: true,\n\t\topenPanels: [ 'post-status' ],\n\t\tpreferredStyleVariations: {},\n\t\twelcomeGuide: true,\n\t} );\n\n\treturn <Editor postId={ postId } postType={ postType } />;\n}\n"]}
|
|
@@ -111,26 +111,52 @@ export function togglePublishSidebar() {
|
|
|
111
111
|
* @return {Object} Action object.
|
|
112
112
|
*/
|
|
113
113
|
|
|
114
|
-
export
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
}
|
|
114
|
+
export const toggleEditorPanelEnabled = panelName => _ref3 => {
|
|
115
|
+
var _registry$select$get;
|
|
116
|
+
|
|
117
|
+
let {
|
|
118
|
+
registry
|
|
119
|
+
} = _ref3;
|
|
120
|
+
const inactivePanels = (_registry$select$get = registry.select(preferencesStore).get('core/edit-post', 'inactivePanels')) !== null && _registry$select$get !== void 0 ? _registry$select$get : [];
|
|
121
|
+
const isPanelInactive = !!(inactivePanels !== null && inactivePanels !== void 0 && inactivePanels.includes(panelName)); // If the panel is inactive, remove it to enable it, else add it to
|
|
122
|
+
// make it inactive.
|
|
123
|
+
|
|
124
|
+
let updatedInactivePanels;
|
|
125
|
+
|
|
126
|
+
if (isPanelInactive) {
|
|
127
|
+
updatedInactivePanels = inactivePanels.filter(invactivePanelName => invactivePanelName !== panelName);
|
|
128
|
+
} else {
|
|
129
|
+
updatedInactivePanels = [...inactivePanels, panelName];
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
registry.dispatch(preferencesStore).set('core/edit-post', 'inactivePanels', updatedInactivePanels);
|
|
133
|
+
};
|
|
120
134
|
/**
|
|
121
|
-
*
|
|
135
|
+
* Opens a closed panel and closes an open panel.
|
|
122
136
|
*
|
|
123
137
|
* @param {string} panelName A string that identifies the panel to open or close.
|
|
124
|
-
*
|
|
125
|
-
* @return {Object} Action object.
|
|
126
138
|
*/
|
|
127
139
|
|
|
128
|
-
export
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
}
|
|
140
|
+
export const toggleEditorPanelOpened = panelName => _ref4 => {
|
|
141
|
+
var _registry$select$get2;
|
|
142
|
+
|
|
143
|
+
let {
|
|
144
|
+
registry
|
|
145
|
+
} = _ref4;
|
|
146
|
+
const openPanels = (_registry$select$get2 = registry.select(preferencesStore).get('core/edit-post', 'openPanels')) !== null && _registry$select$get2 !== void 0 ? _registry$select$get2 : [];
|
|
147
|
+
const isPanelOpen = !!(openPanels !== null && openPanels !== void 0 && openPanels.includes(panelName)); // If the panel is open, remove it to close it, else add it to
|
|
148
|
+
// make it open.
|
|
149
|
+
|
|
150
|
+
let updatedOpenPanels;
|
|
151
|
+
|
|
152
|
+
if (isPanelOpen) {
|
|
153
|
+
updatedOpenPanels = openPanels.filter(openPanelName => openPanelName !== panelName);
|
|
154
|
+
} else {
|
|
155
|
+
updatedOpenPanels = [...openPanels, panelName];
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
registry.dispatch(preferencesStore).set('core/edit-post', 'openPanels', updatedOpenPanels);
|
|
159
|
+
};
|
|
134
160
|
/**
|
|
135
161
|
* Returns an action object used to remove a panel from the editor.
|
|
136
162
|
*
|
|
@@ -151,10 +177,10 @@ export function removeEditorPanel(panelName) {
|
|
|
151
177
|
* @param {string} feature Feature name.
|
|
152
178
|
*/
|
|
153
179
|
|
|
154
|
-
export const toggleFeature = feature =>
|
|
180
|
+
export const toggleFeature = feature => _ref5 => {
|
|
155
181
|
let {
|
|
156
182
|
registry
|
|
157
|
-
} =
|
|
183
|
+
} = _ref5;
|
|
158
184
|
return registry.dispatch(preferencesStore).toggle('core/edit-post', feature);
|
|
159
185
|
};
|
|
160
186
|
/**
|
|
@@ -163,15 +189,11 @@ export const toggleFeature = feature => _ref3 => {
|
|
|
163
189
|
* @param {string} mode The editor mode.
|
|
164
190
|
*/
|
|
165
191
|
|
|
166
|
-
export const switchEditorMode = mode =>
|
|
192
|
+
export const switchEditorMode = mode => _ref6 => {
|
|
167
193
|
let {
|
|
168
|
-
dispatch,
|
|
169
194
|
registry
|
|
170
|
-
} =
|
|
171
|
-
dispatch(
|
|
172
|
-
type: 'SWITCH_MODE',
|
|
173
|
-
mode
|
|
174
|
-
}); // Unselect blocks when we switch to the code editor.
|
|
195
|
+
} = _ref6;
|
|
196
|
+
registry.dispatch(preferencesStore).set('core/edit-post', 'editorMode', mode); // Unselect blocks when we switch to the code editor.
|
|
175
197
|
|
|
176
198
|
if (mode !== 'visual') {
|
|
177
199
|
registry.dispatch(blockEditorStore).clearSelectedBlock();
|
|
@@ -186,10 +208,10 @@ export const switchEditorMode = mode => _ref4 => {
|
|
|
186
208
|
* @param {string} pluginName Plugin name.
|
|
187
209
|
*/
|
|
188
210
|
|
|
189
|
-
export const togglePinnedPluginItem = pluginName =>
|
|
211
|
+
export const togglePinnedPluginItem = pluginName => _ref7 => {
|
|
190
212
|
let {
|
|
191
213
|
registry
|
|
192
|
-
} =
|
|
214
|
+
} = _ref7;
|
|
193
215
|
const isPinned = registry.select(interfaceStore).isItemPinned('core/edit-post', pluginName);
|
|
194
216
|
registry.dispatch(interfaceStore)[isPinned ? 'unpinItem' : 'pinItem']('core/edit-post', pluginName);
|
|
195
217
|
};
|
|
@@ -198,44 +220,46 @@ export const togglePinnedPluginItem = pluginName => _ref5 => {
|
|
|
198
220
|
*
|
|
199
221
|
* @param {string} blockName Name of the block.
|
|
200
222
|
* @param {?string} blockStyle Name of the style that should be auto applied. If undefined, the "auto apply" setting of the block is removed.
|
|
201
|
-
*
|
|
202
|
-
* @return {Object} Action object.
|
|
203
223
|
*/
|
|
204
224
|
|
|
205
|
-
export
|
|
206
|
-
|
|
207
|
-
type: 'UPDATE_PREFERRED_STYLE_VARIATIONS',
|
|
208
|
-
blockName,
|
|
209
|
-
blockStyle
|
|
210
|
-
};
|
|
211
|
-
}
|
|
212
|
-
/**
|
|
213
|
-
* Returns an action object used in signalling that the editor should attempt
|
|
214
|
-
* to locally autosave the current post every `interval` seconds.
|
|
215
|
-
*
|
|
216
|
-
* @param {number} interval The new interval, in seconds.
|
|
217
|
-
* @return {Object} Action object.
|
|
218
|
-
*/
|
|
225
|
+
export const updatePreferredStyleVariations = (blockName, blockStyle) => _ref8 => {
|
|
226
|
+
var _registry$select$get3;
|
|
219
227
|
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
228
|
+
let {
|
|
229
|
+
registry
|
|
230
|
+
} = _ref8;
|
|
231
|
+
|
|
232
|
+
if (!blockName) {
|
|
233
|
+
return;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
const existingVariations = (_registry$select$get3 = registry.select(preferencesStore).get('core/edit-post', 'preferredStyleVariations')) !== null && _registry$select$get3 !== void 0 ? _registry$select$get3 : {}; // When the blockStyle is omitted, remove the block's preferred variation.
|
|
237
|
+
|
|
238
|
+
if (!blockStyle) {
|
|
239
|
+
const updatedVariations = { ...existingVariations
|
|
240
|
+
};
|
|
241
|
+
delete updatedVariations[blockName];
|
|
242
|
+
registry.dispatch(preferencesStore).set('core/edit-post', 'preferredStyleVariations', updatedVariations);
|
|
243
|
+
} else {
|
|
244
|
+
// Else add the variation.
|
|
245
|
+
registry.dispatch(preferencesStore).set('core/edit-post', 'preferredStyleVariations', { ...existingVariations,
|
|
246
|
+
[blockName]: blockStyle
|
|
247
|
+
});
|
|
248
|
+
}
|
|
249
|
+
};
|
|
226
250
|
/**
|
|
227
251
|
* Update the provided block types to be visible.
|
|
228
252
|
*
|
|
229
253
|
* @param {string[]} blockNames Names of block types to show.
|
|
230
254
|
*/
|
|
231
255
|
|
|
232
|
-
export const showBlockTypes = blockNames =>
|
|
233
|
-
var _registry$select$
|
|
256
|
+
export const showBlockTypes = blockNames => _ref9 => {
|
|
257
|
+
var _registry$select$get4;
|
|
234
258
|
|
|
235
259
|
let {
|
|
236
260
|
registry
|
|
237
|
-
} =
|
|
238
|
-
const existingBlockNames = (_registry$select$
|
|
261
|
+
} = _ref9;
|
|
262
|
+
const existingBlockNames = (_registry$select$get4 = registry.select(preferencesStore).get('core/edit-post', 'hiddenBlockTypes')) !== null && _registry$select$get4 !== void 0 ? _registry$select$get4 : [];
|
|
239
263
|
const newBlockNames = without(existingBlockNames, ...castArray(blockNames));
|
|
240
264
|
registry.dispatch(preferencesStore).set('core/edit-post', 'hiddenBlockTypes', newBlockNames);
|
|
241
265
|
};
|
|
@@ -245,13 +269,13 @@ export const showBlockTypes = blockNames => _ref6 => {
|
|
|
245
269
|
* @param {string[]} blockNames Names of block types to hide.
|
|
246
270
|
*/
|
|
247
271
|
|
|
248
|
-
export const hideBlockTypes = blockNames =>
|
|
249
|
-
var _registry$select$
|
|
272
|
+
export const hideBlockTypes = blockNames => _ref10 => {
|
|
273
|
+
var _registry$select$get5;
|
|
250
274
|
|
|
251
275
|
let {
|
|
252
276
|
registry
|
|
253
|
-
} =
|
|
254
|
-
const existingBlockNames = (_registry$select$
|
|
277
|
+
} = _ref10;
|
|
278
|
+
const existingBlockNames = (_registry$select$get5 = registry.select(preferencesStore).get('core/edit-post', 'hiddenBlockTypes')) !== null && _registry$select$get5 !== void 0 ? _registry$select$get5 : [];
|
|
255
279
|
const mergedBlockNames = new Set([...existingBlockNames, ...castArray(blockNames)]);
|
|
256
280
|
registry.dispatch(preferencesStore).set('core/edit-post', 'hiddenBlockTypes', [...mergedBlockNames]);
|
|
257
281
|
};
|
|
@@ -262,10 +286,10 @@ export const hideBlockTypes = blockNames => _ref7 => {
|
|
|
262
286
|
* @param {Object} metaBoxesPerLocation Meta boxes per location.
|
|
263
287
|
*/
|
|
264
288
|
|
|
265
|
-
export const setAvailableMetaBoxesPerLocation = metaBoxesPerLocation =>
|
|
289
|
+
export const setAvailableMetaBoxesPerLocation = metaBoxesPerLocation => _ref11 => {
|
|
266
290
|
let {
|
|
267
291
|
dispatch
|
|
268
|
-
} =
|
|
292
|
+
} = _ref11;
|
|
269
293
|
return dispatch({
|
|
270
294
|
type: 'SET_META_BOXES_PER_LOCATIONS',
|
|
271
295
|
metaBoxesPerLocation
|
|
@@ -275,12 +299,12 @@ export const setAvailableMetaBoxesPerLocation = metaBoxesPerLocation => _ref8 =>
|
|
|
275
299
|
* Update a metabox.
|
|
276
300
|
*/
|
|
277
301
|
|
|
278
|
-
export const requestMetaBoxUpdates = () => async
|
|
302
|
+
export const requestMetaBoxUpdates = () => async _ref12 => {
|
|
279
303
|
let {
|
|
280
304
|
registry,
|
|
281
305
|
select,
|
|
282
306
|
dispatch
|
|
283
|
-
} =
|
|
307
|
+
} = _ref12;
|
|
284
308
|
dispatch({
|
|
285
309
|
type: 'REQUEST_META_BOX_UPDATES'
|
|
286
310
|
}); // Saves the wp_editor fields.
|
|
@@ -305,8 +329,8 @@ export const requestMetaBoxUpdates = () => async _ref9 => {
|
|
|
305
329
|
|
|
306
330
|
return memo;
|
|
307
331
|
}, new window.FormData());
|
|
308
|
-
additionalData.forEach(
|
|
309
|
-
let [key, value] =
|
|
332
|
+
additionalData.forEach(_ref13 => {
|
|
333
|
+
let [key, value] = _ref13;
|
|
310
334
|
return formData.append(key, value);
|
|
311
335
|
});
|
|
312
336
|
|
|
@@ -412,12 +436,12 @@ export function setIsEditingTemplate(value) {
|
|
|
412
436
|
|
|
413
437
|
export const __unstableSwitchToTemplateMode = function () {
|
|
414
438
|
let newTemplate = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
415
|
-
return
|
|
439
|
+
return _ref14 => {
|
|
416
440
|
let {
|
|
417
441
|
registry,
|
|
418
442
|
select,
|
|
419
443
|
dispatch
|
|
420
|
-
} =
|
|
444
|
+
} = _ref14;
|
|
421
445
|
dispatch(setIsEditingTemplate(true));
|
|
422
446
|
const isWelcomeGuideActive = select.isFeatureActive('welcomeGuideTemplate');
|
|
423
447
|
|
|
@@ -435,10 +459,10 @@ export const __unstableSwitchToTemplateMode = function () {
|
|
|
435
459
|
* @param {Object?} template Template to create and assign.
|
|
436
460
|
*/
|
|
437
461
|
|
|
438
|
-
export const __unstableCreateTemplate = template => async
|
|
462
|
+
export const __unstableCreateTemplate = template => async _ref15 => {
|
|
439
463
|
let {
|
|
440
464
|
registry
|
|
441
|
-
} =
|
|
465
|
+
} = _ref15;
|
|
442
466
|
const savedTemplate = await registry.dispatch(coreStore).saveEntityRecord('postType', 'wp_template', template);
|
|
443
467
|
const post = registry.select(editorStore).getCurrentPost();
|
|
444
468
|
registry.dispatch(coreStore).editEntityRecord('postType', post.type, post.id, {
|
|
@@ -450,12 +474,12 @@ let metaBoxesInitialized = false;
|
|
|
450
474
|
* Initializes WordPress `postboxes` script and the logic for saving meta boxes.
|
|
451
475
|
*/
|
|
452
476
|
|
|
453
|
-
export const initializeMetaBoxes = () =>
|
|
477
|
+
export const initializeMetaBoxes = () => _ref16 => {
|
|
454
478
|
let {
|
|
455
479
|
registry,
|
|
456
480
|
select,
|
|
457
481
|
dispatch
|
|
458
|
-
} =
|
|
482
|
+
} = _ref16;
|
|
459
483
|
|
|
460
484
|
const isEditorReady = registry.select(editorStore).__unstableIsEditorReady();
|
|
461
485
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-post/src/store/actions.js"],"names":["castArray","reduce","without","__","apiFetch","store","interfaceStore","preferencesStore","speak","noticesStore","coreStore","blockEditorStore","editorStore","getMetaBoxContainer","editPostStore","openGeneralSidebar","name","registry","dispatch","enableComplementaryArea","closeGeneralSidebar","disableComplementaryArea","openModal","type","closeModal","openPublishSidebar","closePublishSidebar","togglePublishSidebar","toggleEditorPanelEnabled","panelName","toggleEditorPanelOpened","removeEditorPanel","toggleFeature","feature","toggle","switchEditorMode","mode","clearSelectedBlock","message","togglePinnedPluginItem","pluginName","isPinned","select","isItemPinned","updatePreferredStyleVariations","blockName","blockStyle","__experimentalUpdateLocalAutosaveInterval","interval","showBlockTypes","blockNames","existingBlockNames","get","newBlockNames","set","hideBlockTypes","mergedBlockNames","Set","setAvailableMetaBoxesPerLocation","metaBoxesPerLocation","requestMetaBoxUpdates","window","tinyMCE","triggerSave","post","getCurrentPost","additionalData","comment_status","ping_status","sticky","author","filter","Boolean","baseFormData","FormData","document","querySelector","activeMetaBoxLocations","getActiveMetaBoxLocations","formDataToMerge","map","location","formData","memo","currentFormData","key","value","append","forEach","url","_wpMetaBoxUrl","method","body","parse","metaBoxUpdatesSuccess","metaBoxUpdatesFailure","__experimentalSetPreviewDeviceType","deviceType","setIsInserterOpened","setIsListViewOpened","isOpen","setIsEditingTemplate","__unstableSwitchToTemplateMode","newTemplate","isWelcomeGuideActive","isFeatureActive","createSuccessNotice","__unstableCreateTemplate","template","savedTemplate","saveEntityRecord","editEntityRecord","id","slug","metaBoxesInitialized","initializeMetaBoxes","isEditorReady","__unstableIsEditorReady","postType","getCurrentPostType","postboxes","page","add_postbox_toggles","wasSavingPost","isSavingPost","wasAutosavingPost","isAutosavingPost","hasMetaBoxes","subscribe","shouldTriggerMetaboxesSave"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAT,EAAoBC,MAApB,EAA4BC,OAA5B,QAA2C,QAA3C;AAEA;AACA;AACA;;AACA,SAASC,EAAT,QAAmB,iBAAnB;AACA,OAAOC,QAAP,MAAqB,sBAArB;AACA,SAASC,KAAK,IAAIC,cAAlB,QAAwC,sBAAxC;AACA,SAASD,KAAK,IAAIE,gBAAlB,QAA0C,wBAA1C;AACA,SAASC,KAAT,QAAsB,iBAAtB;AACA,SAASH,KAAK,IAAII,YAAlB,QAAsC,oBAAtC;AACA,SAASJ,KAAK,IAAIK,SAAlB,QAAmC,sBAAnC;AACA,SAASL,KAAK,IAAIM,gBAAlB,QAA0C,yBAA1C;AACA,SAASN,KAAK,IAAIO,WAAlB,QAAqC,mBAArC;AAEA;AACA;AACA;;AACA,SAASC,mBAAT,QAAoC,qBAApC;AACA,SAASR,KAAK,IAAIS,aAAlB,QAAuC,GAAvC;AAEA;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAMC,kBAAkB,GAAKC,IAAF,IAAY;AAAA,MAAE;AAAEC,IAAAA;AAAF,GAAF;AAAA,SAC7CA,QAAQ,CACNC,QADF,CACYZ,cADZ,EAEEa,uBAFF,CAE2BL,aAAa,CAACE,IAFzC,EAE+CA,IAF/C,CAD6C;AAAA,CAAvC;AAKP;AACA;AACA;;AACA,OAAO,MAAMI,mBAAmB,GAAG,MAAM;AAAA,MAAE;AAAEH,IAAAA;AAAF,GAAF;AAAA,SACxCA,QAAQ,CACNC,QADF,CACYZ,cADZ,EAEEe,wBAFF,CAE4BP,aAAa,CAACE,IAF1C,CADwC;AAAA,CAAlC;AAKP;AACA;AACA;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A,MAAIC,iBAAiB,GAAG5G,QAAQ,CAACyB,MAAT,CAAiB9B,WAAjB,EAA+BkH,gBAA/B,EAAxB;AACA,QAAMC,YAAY,GAAGrF,MAAM,CAACqF,YAAP,EAArB,CArB8E,CAuB9E;;AACA9G,EAAAA,QAAQ,CAAC+G,SAAT,CAAoB,YAAY;AAC/B,UAAMJ,YAAY,GAAG3G,QAAQ,CAACyB,MAAT,CAAiB9B,WAAjB,EAA+BgH,YAA/B,EAArB;AACA,UAAME,gBAAgB,GAAG7G,QAAQ,CAC/ByB,MADuB,CACf9B,WADe,EAEvBkH,gBAFuB,EAAzB,CAF+B,CAM/B;AACA;AACA;AACA;AACA;AACA;;AACA,UAAMG,0BAA0B,GAC/BF,YAAY,IACZJ,aADA,IAEA,CAAEC,YAFF,IAGA,CAAEC,iBAJH,CAZ+B,CAkB/B;;AACAF,IAAAA,aAAa,GAAGC,YAAhB;AACAC,IAAAA,iBAAiB,GAAGC,gBAApB;;AAEA,QAAKG,0BAAL,EAAkC;AACjC,YAAM/G,QAAQ,CAAC0C,qBAAT,EAAN;AACA;AACD,GAzBD;AA2BA1C,EAAAA,QAAQ,CAAE;AACTK,IAAAA,IAAI,EAAE;AADG,GAAF,CAAR;AAGA,CAtDM","sourcesContent":["/**\n * External dependencies\n */\nimport { castArray, reduce, without } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport apiFetch from '@wordpress/api-fetch';\nimport { store as interfaceStore } from '@wordpress/interface';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { speak } from '@wordpress/a11y';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { getMetaBoxContainer } from '../utils/meta-boxes';\nimport { store as editPostStore } from '.';\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 = ( name ) => ( { registry } ) =>\n\tregistry\n\t\t.dispatch( interfaceStore )\n\t\t.enableComplementaryArea( editPostStore.name, name );\n\n/**\n * Returns an action object signalling that the user closed the sidebar.\n */\nexport const closeGeneralSidebar = () => ( { registry } ) =>\n\tregistry\n\t\t.dispatch( interfaceStore )\n\t\t.disableComplementaryArea( editPostStore.name );\n\n/**\n * Returns an action object used in signalling that the user opened a modal.\n *\n * @param {string} name A string that uniquely identifies the modal.\n *\n * @return {Object} Action object.\n */\nexport function openModal( name ) {\n\treturn {\n\t\ttype: 'OPEN_MODAL',\n\t\tname,\n\t};\n}\n\n/**\n * Returns an action object signalling that the user closed a modal.\n *\n * @return {Object} Action object.\n */\nexport function closeModal() {\n\treturn {\n\t\ttype: 'CLOSE_MODAL',\n\t};\n}\n\n/**\n * Returns an action object used in signalling that the user opened the publish\n * sidebar.\n *\n * @return {Object} Action object\n */\nexport function openPublishSidebar() {\n\treturn {\n\t\ttype: 'OPEN_PUBLISH_SIDEBAR',\n\t};\n}\n\n/**\n * Returns an action object used in signalling that the user closed the\n * publish sidebar.\n *\n * @return {Object} Action object.\n */\nexport function closePublishSidebar() {\n\treturn {\n\t\ttype: 'CLOSE_PUBLISH_SIDEBAR',\n\t};\n}\n\n/**\n * Returns an action object used in signalling that the user toggles the publish sidebar.\n *\n * @return {Object} Action object\n */\nexport function togglePublishSidebar() {\n\treturn {\n\t\ttype: 'TOGGLE_PUBLISH_SIDEBAR',\n\t};\n}\n\n/**\n * Returns an action object used to enable or disable a panel in the editor.\n *\n * @param {string} panelName A string that identifies the panel to enable or disable.\n *\n * @return {Object} Action object.\n */\nexport function toggleEditorPanelEnabled( panelName ) {\n\treturn {\n\t\ttype: 'TOGGLE_PANEL_ENABLED',\n\t\tpanelName,\n\t};\n}\n\n/**\n * Returns an action object used to open or close a panel in the editor.\n *\n * @param {string} panelName A string that identifies the panel to open or close.\n *\n * @return {Object} Action object.\n */\nexport function toggleEditorPanelOpened( panelName ) {\n\treturn {\n\t\ttype: 'TOGGLE_PANEL_OPENED',\n\t\tpanelName,\n\t};\n}\n\n/**\n * Returns an action object used to remove a panel from the editor.\n *\n * @param {string} panelName A string that identifies the panel to remove.\n *\n * @return {Object} Action object.\n */\nexport function removeEditorPanel( panelName ) {\n\treturn {\n\t\ttype: 'REMOVE_PANEL',\n\t\tpanelName,\n\t};\n}\n\n/**\n * Triggers an action used to toggle a feature flag.\n *\n * @param {string} feature Feature name.\n */\nexport const toggleFeature = ( feature ) => ( { registry } ) =>\n\tregistry.dispatch( preferencesStore ).toggle( 'core/edit-post', feature );\n\n/**\n * Triggers an action used to switch editor mode.\n *\n * @param {string} mode The editor mode.\n */\nexport const switchEditorMode = ( mode ) => ( { dispatch, registry } ) => {\n\tdispatch( {\n\t\ttype: 'SWITCH_MODE',\n\t\tmode,\n\t} );\n\n\t// Unselect blocks when we switch to the code editor.\n\tif ( mode !== 'visual' ) {\n\t\tregistry.dispatch( blockEditorStore ).clearSelectedBlock();\n\t}\n\n\tconst message =\n\t\tmode === 'visual'\n\t\t\t? __( 'Visual editor selected' )\n\t\t\t: __( 'Code editor selected' );\n\tspeak( message, 'assertive' );\n};\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 = ( pluginName ) => ( { registry } ) => {\n\tconst isPinned = registry\n\t\t.select( interfaceStore )\n\t\t.isItemPinned( 'core/edit-post', pluginName );\n\n\tregistry\n\t\t.dispatch( interfaceStore )\n\t\t[ isPinned ? 'unpinItem' : 'pinItem' ]( 'core/edit-post', pluginName );\n};\n\n/**\n * Returns an action object used in signaling that a style should be auto-applied when a block is created.\n *\n * @param {string} blockName Name of the block.\n * @param {?string} blockStyle Name of the style that should be auto applied. If undefined, the \"auto apply\" setting of the block is removed.\n *\n * @return {Object} Action object.\n */\nexport function updatePreferredStyleVariations( blockName, blockStyle ) {\n\treturn {\n\t\ttype: 'UPDATE_PREFERRED_STYLE_VARIATIONS',\n\t\tblockName,\n\t\tblockStyle,\n\t};\n}\n\n/**\n * Returns an action object used in signalling that the editor should attempt\n * to locally autosave the current post every `interval` seconds.\n *\n * @param {number} interval The new interval, in seconds.\n * @return {Object} Action object.\n */\nexport function __experimentalUpdateLocalAutosaveInterval( interval ) {\n\treturn {\n\t\ttype: 'UPDATE_LOCAL_AUTOSAVE_INTERVAL',\n\t\tinterval,\n\t};\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 = ( blockNames ) => ( { registry } ) => {\n\tconst existingBlockNames =\n\t\tregistry\n\t\t\t.select( preferencesStore )\n\t\t\t.get( 'core/edit-post', 'hiddenBlockTypes' ) ?? [];\n\n\tconst newBlockNames = without(\n\t\texistingBlockNames,\n\t\t...castArray( blockNames )\n\t);\n\n\tregistry\n\t\t.dispatch( preferencesStore )\n\t\t.set( 'core/edit-post', 'hiddenBlockTypes', newBlockNames );\n};\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 = ( blockNames ) => ( { registry } ) => {\n\tconst existingBlockNames =\n\t\tregistry\n\t\t\t.select( preferencesStore )\n\t\t\t.get( 'core/edit-post', 'hiddenBlockTypes' ) ?? [];\n\n\tconst mergedBlockNames = new Set( [\n\t\t...existingBlockNames,\n\t\t...castArray( blockNames ),\n\t] );\n\n\tregistry\n\t\t.dispatch( preferencesStore )\n\t\t.set( 'core/edit-post', 'hiddenBlockTypes', [ ...mergedBlockNames ] );\n};\n\n/**\n * Returns an action object used in signaling\n * what Meta boxes are available in which location.\n *\n * @param {Object} metaBoxesPerLocation Meta boxes per location.\n */\nexport const setAvailableMetaBoxesPerLocation = ( metaBoxesPerLocation ) => ( {\n\tdispatch,\n} ) =>\n\tdispatch( {\n\t\ttype: 'SET_META_BOXES_PER_LOCATIONS',\n\t\tmetaBoxesPerLocation,\n\t} );\n\n/**\n * Update a metabox.\n */\nexport const requestMetaBoxUpdates = () => async ( {\n\tregistry,\n\tselect,\n\tdispatch,\n} ) => {\n\tdispatch( {\n\t\ttype: 'REQUEST_META_BOX_UPDATES',\n\t} );\n\n\t// Saves the wp_editor fields.\n\tif ( window.tinyMCE ) {\n\t\twindow.tinyMCE.triggerSave();\n\t}\n\n\t// Additional data needed for backward compatibility.\n\t// If we do not provide this data, the post will be overridden with the default values.\n\tconst post = registry.select( editorStore ).getCurrentPost();\n\tconst additionalData = [\n\t\tpost.comment_status ? [ 'comment_status', post.comment_status ] : false,\n\t\tpost.ping_status ? [ 'ping_status', post.ping_status ] : false,\n\t\tpost.sticky ? [ 'sticky', post.sticky ] : false,\n\t\tpost.author ? [ 'post_author', post.author ] : false,\n\t].filter( Boolean );\n\n\t// We gather all the metaboxes locations data and the base form data.\n\tconst baseFormData = new window.FormData(\n\t\tdocument.querySelector( '.metabox-base-form' )\n\t);\n\tconst activeMetaBoxLocations = select.getActiveMetaBoxLocations();\n\tconst formDataToMerge = [\n\t\tbaseFormData,\n\t\t...activeMetaBoxLocations.map(\n\t\t\t( location ) =>\n\t\t\t\tnew window.FormData( getMetaBoxContainer( location ) )\n\t\t),\n\t];\n\n\t// Merge all form data objects into a single one.\n\tconst formData = reduce(\n\t\tformDataToMerge,\n\t\t( 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},\n\t\tnew window.FormData()\n\t);\n\tadditionalData.forEach( ( [ key, value ] ) =>\n\t\tformData.append( key, value )\n\t);\n\n\ttry {\n\t\t// Save the metaboxes.\n\t\tawait apiFetch( {\n\t\t\turl: window._wpMetaBoxUrl,\n\t\t\tmethod: 'POST',\n\t\t\tbody: formData,\n\t\t\tparse: false,\n\t\t} );\n\t\tdispatch.metaBoxUpdatesSuccess();\n\t} catch {\n\t\tdispatch.metaBoxUpdatesFailure();\n\t}\n};\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 * Returns an action object used to toggle the width of the editing canvas.\n *\n * @param {string} deviceType\n *\n * @return {Object} Action object.\n */\nexport function __experimentalSetPreviewDeviceType( deviceType ) {\n\treturn {\n\t\ttype: 'SET_PREVIEW_DEVICE_TYPE',\n\t\tdeviceType,\n\t};\n}\n\n/**\n * Returns an action object used to open/close the inserter.\n *\n * @param {boolean|Object} value Whether the inserter should be\n * opened (true) or closed (false).\n * To specify an insertion point,\n * use an object.\n * @param {string} value.rootClientId The root client ID to insert at.\n * @param {number} value.insertionIndex The index to insert at.\n *\n * @return {Object} Action object.\n */\nexport function setIsInserterOpened( value ) {\n\treturn {\n\t\ttype: 'SET_IS_INSERTER_OPENED',\n\t\tvalue,\n\t};\n}\n\n/**\n * Returns an action object used to open/close the list view.\n *\n * @param {boolean} isOpen A boolean representing whether the list view should be opened or closed.\n * @return {Object} Action object.\n */\nexport function setIsListViewOpened( isOpen ) {\n\treturn {\n\t\ttype: 'SET_IS_LIST_VIEW_OPENED',\n\t\tisOpen,\n\t};\n}\n\n/**\n * Returns an action object used to switch to template editing.\n *\n * @param {boolean} value Is editing template.\n * @return {Object} Action object.\n */\nexport function setIsEditingTemplate( value ) {\n\treturn {\n\t\ttype: 'SET_IS_EDITING_TEMPLATE',\n\t\tvalue,\n\t};\n}\n\n/**\n * Switches to the template mode.\n *\n * @param {boolean} newTemplate Is new template.\n */\nexport const __unstableSwitchToTemplateMode = ( newTemplate = false ) => ( {\n\tregistry,\n\tselect,\n\tdispatch,\n} ) => {\n\tdispatch( setIsEditingTemplate( true ) );\n\tconst isWelcomeGuideActive = select.isFeatureActive(\n\t\t'welcomeGuideTemplate'\n\t);\n\tif ( ! isWelcomeGuideActive ) {\n\t\tconst message = newTemplate\n\t\t\t? __( \"Custom template created. You're in template mode now.\" )\n\t\t\t: __(\n\t\t\t\t\t'Editing template. Changes made here affect all posts and pages that use the template.'\n\t\t\t );\n\t\tregistry.dispatch( noticesStore ).createSuccessNotice( message, {\n\t\t\ttype: 'snackbar',\n\t\t} );\n\t}\n};\n\n/**\n * Create a block based template.\n *\n * @param {Object?} template Template to create and assign.\n */\nexport const __unstableCreateTemplate = ( template ) => async ( {\n\tregistry,\n} ) => {\n\tconst savedTemplate = await registry\n\t\t.dispatch( coreStore )\n\t\t.saveEntityRecord( 'postType', 'wp_template', template );\n\tconst post = registry.select( editorStore ).getCurrentPost();\n\tregistry\n\t\t.dispatch( coreStore )\n\t\t.editEntityRecord( 'postType', post.type, post.id, {\n\t\t\ttemplate: savedTemplate.slug,\n\t\t} );\n};\n\nlet metaBoxesInitialized = false;\n\n/**\n * Initializes WordPress `postboxes` script and the logic for saving meta boxes.\n */\nexport const initializeMetaBoxes = () => ( { registry, select, dispatch } ) => {\n\tconst isEditorReady = registry\n\t\t.select( editorStore )\n\t\t.__unstableIsEditorReady();\n\n\tif ( ! isEditorReady ) {\n\t\treturn;\n\t}\n\t// Only initialize once.\n\tif ( metaBoxesInitialized ) {\n\t\treturn;\n\t}\n\tconst postType = registry.select( editorStore ).getCurrentPostType();\n\tif ( window.postboxes.page !== postType ) {\n\t\twindow.postboxes.add_postbox_toggles( postType );\n\t}\n\n\tmetaBoxesInitialized = true;\n\n\tlet wasSavingPost = registry.select( editorStore ).isSavingPost();\n\tlet wasAutosavingPost = registry.select( editorStore ).isAutosavingPost();\n\tconst hasMetaBoxes = select.hasMetaBoxes();\n\n\t// Save metaboxes when performing a full save on the post.\n\tregistry.subscribe( async () => {\n\t\tconst isSavingPost = registry.select( editorStore ).isSavingPost();\n\t\tconst isAutosavingPost = registry\n\t\t\t.select( editorStore )\n\t\t\t.isAutosavingPost();\n\n\t\t// Save metaboxes on save completion, except for autosaves that are not a post preview.\n\t\t//\n\t\t// Meta boxes are initialized once at page load. It is not necessary to\n\t\t// account for updates on each state change.\n\t\t//\n\t\t// See: https://github.com/WordPress/WordPress/blob/5.1.1/wp-admin/includes/post.php#L2307-L2309.\n\t\tconst shouldTriggerMetaboxesSave =\n\t\t\thasMetaBoxes &&\n\t\t\twasSavingPost &&\n\t\t\t! isSavingPost &&\n\t\t\t! wasAutosavingPost;\n\n\t\t// Save current state for next inspection.\n\t\twasSavingPost = isSavingPost;\n\t\twasAutosavingPost = isAutosavingPost;\n\n\t\tif ( shouldTriggerMetaboxesSave ) {\n\t\t\tawait dispatch.requestMetaBoxUpdates();\n\t\t}\n\t} );\n\n\tdispatch( {\n\t\ttype: 'META_BOXES_INITIALIZED',\n\t} );\n};\n"]}
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-post/src/store/actions.js"],"names":["castArray","reduce","without","__","apiFetch","store","interfaceStore","preferencesStore","speak","noticesStore","coreStore","blockEditorStore","editorStore","getMetaBoxContainer","editPostStore","openGeneralSidebar","name","registry","dispatch","enableComplementaryArea","closeGeneralSidebar","disableComplementaryArea","openModal","type","closeModal","openPublishSidebar","closePublishSidebar","togglePublishSidebar","toggleEditorPanelEnabled","panelName","inactivePanels","select","get","isPanelInactive","includes","updatedInactivePanels","filter","invactivePanelName","set","toggleEditorPanelOpened","openPanels","isPanelOpen","updatedOpenPanels","openPanelName","removeEditorPanel","toggleFeature","feature","toggle","switchEditorMode","mode","clearSelectedBlock","message","togglePinnedPluginItem","pluginName","isPinned","isItemPinned","updatePreferredStyleVariations","blockName","blockStyle","existingVariations","updatedVariations","showBlockTypes","blockNames","existingBlockNames","newBlockNames","hideBlockTypes","mergedBlockNames","Set","setAvailableMetaBoxesPerLocation","metaBoxesPerLocation","requestMetaBoxUpdates","window","tinyMCE","triggerSave","post","getCurrentPost","additionalData","comment_status","ping_status","sticky","author","Boolean","baseFormData","FormData","document","querySelector","activeMetaBoxLocations","getActiveMetaBoxLocations","formDataToMerge","map","location","formData","memo","currentFormData","key","value","append","forEach","url","_wpMetaBoxUrl","method","body","parse","metaBoxUpdatesSuccess","metaBoxUpdatesFailure","__experimentalSetPreviewDeviceType","deviceType","setIsInserterOpened","setIsListViewOpened","isOpen","setIsEditingTemplate","__unstableSwitchToTemplateMode","newTemplate","isWelcomeGuideActive","isFeatureActive","createSuccessNotice","__unstableCreateTemplate","template","savedTemplate","saveEntityRecord","editEntityRecord","id","slug","metaBoxesInitialized","initializeMetaBoxes","isEditorReady","__unstableIsEditorReady","postType","getCurrentPostType","postboxes","page","add_postbox_toggles","wasSavingPost","isSavingPost","wasAutosavingPost","isAutosavingPost","hasMetaBoxes","subscribe","shouldTriggerMetaboxesSave"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAT,EAAoBC,MAApB,EAA4BC,OAA5B,QAA2C,QAA3C;AAEA;AACA;AACA;;AACA,SAASC,EAAT,QAAmB,iBAAnB;AACA,OAAOC,QAAP,MAAqB,sBAArB;AACA,SAASC,KAAK,IAAIC,cAAlB,QAAwC,sBAAxC;AACA,SAASD,KAAK,IAAIE,gBAAlB,QAA0C,wBAA1C;AACA,SAASC,KAAT,QAAsB,iBAAtB;AACA,SAASH,KAAK,IAAII,YAAlB,QAAsC,oBAAtC;AACA,SAASJ,KAAK,IAAIK,SAAlB,QAAmC,sBAAnC;AACA,SAASL,KAAK,IAAIM,gBAAlB,QAA0C,yBAA1C;AACA,SAASN,KAAK,IAAIO,WAAlB,QAAqC,mBAArC;AAEA;AACA;AACA;;AACA,SAASC,mBAAT,QAAoC,qBAApC;AACA,SAASR,KAAK,IAAIS,aAAlB,QAAuC,GAAvC;AAEA;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAMC,kBAAkB,GAAKC,IAAF,IAAY;AAAA,MAAE;AAAEC,IAAAA;AAAF,GAAF;AAAA,SAC7CA,QAAQ,CACNC,QADF,CACYZ,cADZ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iBAAiB,GAAGC,gBAApB;;AAEA,QAAKG,0BAAL,EAAkC;AACjC,YAAMxH,QAAQ,CAACoD,qBAAT,EAAN;AACA;AACD,GAzBD;AA2BApD,EAAAA,QAAQ,CAAE;AACTK,IAAAA,IAAI,EAAE;AADG,GAAF,CAAR;AAGA,CAtDM","sourcesContent":["/**\n * External dependencies\n */\nimport { castArray, reduce, without } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport apiFetch from '@wordpress/api-fetch';\nimport { store as interfaceStore } from '@wordpress/interface';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { speak } from '@wordpress/a11y';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { getMetaBoxContainer } from '../utils/meta-boxes';\nimport { store as editPostStore } from '.';\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 = ( name ) => ( { registry } ) =>\n\tregistry\n\t\t.dispatch( interfaceStore )\n\t\t.enableComplementaryArea( editPostStore.name, name );\n\n/**\n * Returns an action object signalling that the user closed the sidebar.\n */\nexport const closeGeneralSidebar = () => ( { registry } ) =>\n\tregistry\n\t\t.dispatch( interfaceStore )\n\t\t.disableComplementaryArea( editPostStore.name );\n\n/**\n * Returns an action object used in signalling that the user opened a modal.\n *\n * @param {string} name A string that uniquely identifies the modal.\n *\n * @return {Object} Action object.\n */\nexport function openModal( name ) {\n\treturn {\n\t\ttype: 'OPEN_MODAL',\n\t\tname,\n\t};\n}\n\n/**\n * Returns an action object signalling that the user closed a modal.\n *\n * @return {Object} Action object.\n */\nexport function closeModal() {\n\treturn {\n\t\ttype: 'CLOSE_MODAL',\n\t};\n}\n\n/**\n * Returns an action object used in signalling that the user opened the publish\n * sidebar.\n *\n * @return {Object} Action object\n */\nexport function openPublishSidebar() {\n\treturn {\n\t\ttype: 'OPEN_PUBLISH_SIDEBAR',\n\t};\n}\n\n/**\n * Returns an action object used in signalling that the user closed the\n * publish sidebar.\n *\n * @return {Object} Action object.\n */\nexport function closePublishSidebar() {\n\treturn {\n\t\ttype: 'CLOSE_PUBLISH_SIDEBAR',\n\t};\n}\n\n/**\n * Returns an action object used in signalling that the user toggles the publish sidebar.\n *\n * @return {Object} Action object\n */\nexport function togglePublishSidebar() {\n\treturn {\n\t\ttype: 'TOGGLE_PUBLISH_SIDEBAR',\n\t};\n}\n\n/**\n * Returns an action object used to enable or disable a panel in the editor.\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 = ( panelName ) => ( { registry } ) => {\n\tconst inactivePanels =\n\t\tregistry\n\t\t\t.select( preferencesStore )\n\t\t\t.get( 'core/edit-post', 'inactivePanels' ) ?? [];\n\n\tconst isPanelInactive = !! inactivePanels?.includes( panelName );\n\n\t// If the panel is inactive, remove it to enable it, else add it to\n\t// make it inactive.\n\tlet updatedInactivePanels;\n\tif ( isPanelInactive ) {\n\t\tupdatedInactivePanels = inactivePanels.filter(\n\t\t\t( invactivePanelName ) => invactivePanelName !== panelName\n\t\t);\n\t} else {\n\t\tupdatedInactivePanels = [ ...inactivePanels, panelName ];\n\t}\n\n\tregistry\n\t\t.dispatch( preferencesStore )\n\t\t.set( 'core/edit-post', 'inactivePanels', updatedInactivePanels );\n};\n\n/**\n * Opens a closed panel and closes an open panel.\n *\n * @param {string} panelName A string that identifies the panel to open or close.\n */\nexport const toggleEditorPanelOpened = ( panelName ) => ( { registry } ) => {\n\tconst openPanels =\n\t\tregistry\n\t\t\t.select( preferencesStore )\n\t\t\t.get( 'core/edit-post', 'openPanels' ) ?? [];\n\n\tconst isPanelOpen = !! openPanels?.includes( panelName );\n\n\t// If the panel is open, remove it to close it, else add it to\n\t// make it open.\n\tlet updatedOpenPanels;\n\tif ( isPanelOpen ) {\n\t\tupdatedOpenPanels = openPanels.filter(\n\t\t\t( openPanelName ) => openPanelName !== panelName\n\t\t);\n\t} else {\n\t\tupdatedOpenPanels = [ ...openPanels, panelName ];\n\t}\n\n\tregistry\n\t\t.dispatch( preferencesStore )\n\t\t.set( 'core/edit-post', 'openPanels', updatedOpenPanels );\n};\n\n/**\n * Returns an action object used to remove a panel from the editor.\n *\n * @param {string} panelName A string that identifies the panel to remove.\n *\n * @return {Object} Action object.\n */\nexport function removeEditorPanel( panelName ) {\n\treturn {\n\t\ttype: 'REMOVE_PANEL',\n\t\tpanelName,\n\t};\n}\n\n/**\n * Triggers an action used to toggle a feature flag.\n *\n * @param {string} feature Feature name.\n */\nexport const toggleFeature = ( feature ) => ( { registry } ) =>\n\tregistry.dispatch( preferencesStore ).toggle( 'core/edit-post', feature );\n\n/**\n * Triggers an action used to switch editor mode.\n *\n * @param {string} mode The editor mode.\n */\nexport const switchEditorMode = ( mode ) => ( { registry } ) => {\n\tregistry\n\t\t.dispatch( preferencesStore )\n\t\t.set( 'core/edit-post', 'editorMode', mode );\n\n\t// Unselect blocks when we switch to the code editor.\n\tif ( mode !== 'visual' ) {\n\t\tregistry.dispatch( blockEditorStore ).clearSelectedBlock();\n\t}\n\n\tconst message =\n\t\tmode === 'visual'\n\t\t\t? __( 'Visual editor selected' )\n\t\t\t: __( 'Code editor selected' );\n\tspeak( message, 'assertive' );\n};\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 = ( pluginName ) => ( { registry } ) => {\n\tconst isPinned = registry\n\t\t.select( interfaceStore )\n\t\t.isItemPinned( 'core/edit-post', pluginName );\n\n\tregistry\n\t\t.dispatch( interfaceStore )\n\t\t[ isPinned ? 'unpinItem' : 'pinItem' ]( 'core/edit-post', pluginName );\n};\n\n/**\n * Returns an action object used in signaling that a style should be auto-applied when a block is created.\n *\n * @param {string} blockName Name of the block.\n * @param {?string} blockStyle Name of the style that should be auto applied. If undefined, the \"auto apply\" setting of the block is removed.\n */\nexport const updatePreferredStyleVariations = ( blockName, blockStyle ) => ( {\n\tregistry,\n} ) => {\n\tif ( ! blockName ) {\n\t\treturn;\n\t}\n\n\tconst existingVariations =\n\t\tregistry\n\t\t\t.select( preferencesStore )\n\t\t\t.get( 'core/edit-post', 'preferredStyleVariations' ) ?? {};\n\n\t// When the blockStyle is omitted, remove the block's preferred variation.\n\tif ( ! blockStyle ) {\n\t\tconst updatedVariations = {\n\t\t\t...existingVariations,\n\t\t};\n\n\t\tdelete updatedVariations[ blockName ];\n\n\t\tregistry\n\t\t\t.dispatch( preferencesStore )\n\t\t\t.set(\n\t\t\t\t'core/edit-post',\n\t\t\t\t'preferredStyleVariations',\n\t\t\t\tupdatedVariations\n\t\t\t);\n\t} else {\n\t\t// Else add the variation.\n\t\tregistry\n\t\t\t.dispatch( preferencesStore )\n\t\t\t.set( 'core/edit-post', 'preferredStyleVariations', {\n\t\t\t\t...existingVariations,\n\t\t\t\t[ blockName ]: blockStyle,\n\t\t\t} );\n\t}\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 = ( blockNames ) => ( { registry } ) => {\n\tconst existingBlockNames =\n\t\tregistry\n\t\t\t.select( preferencesStore )\n\t\t\t.get( 'core/edit-post', 'hiddenBlockTypes' ) ?? [];\n\n\tconst newBlockNames = without(\n\t\texistingBlockNames,\n\t\t...castArray( blockNames )\n\t);\n\n\tregistry\n\t\t.dispatch( preferencesStore )\n\t\t.set( 'core/edit-post', 'hiddenBlockTypes', newBlockNames );\n};\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 = ( blockNames ) => ( { registry } ) => {\n\tconst existingBlockNames =\n\t\tregistry\n\t\t\t.select( preferencesStore )\n\t\t\t.get( 'core/edit-post', 'hiddenBlockTypes' ) ?? [];\n\n\tconst mergedBlockNames = new Set( [\n\t\t...existingBlockNames,\n\t\t...castArray( blockNames ),\n\t] );\n\n\tregistry\n\t\t.dispatch( preferencesStore )\n\t\t.set( 'core/edit-post', 'hiddenBlockTypes', [ ...mergedBlockNames ] );\n};\n\n/**\n * Returns an action object used in signaling\n * what Meta boxes are available in which location.\n *\n * @param {Object} metaBoxesPerLocation Meta boxes per location.\n */\nexport const setAvailableMetaBoxesPerLocation = ( metaBoxesPerLocation ) => ( {\n\tdispatch,\n} ) =>\n\tdispatch( {\n\t\ttype: 'SET_META_BOXES_PER_LOCATIONS',\n\t\tmetaBoxesPerLocation,\n\t} );\n\n/**\n * Update a metabox.\n */\nexport const requestMetaBoxUpdates = () => async ( {\n\tregistry,\n\tselect,\n\tdispatch,\n} ) => {\n\tdispatch( {\n\t\ttype: 'REQUEST_META_BOX_UPDATES',\n\t} );\n\n\t// Saves the wp_editor fields.\n\tif ( window.tinyMCE ) {\n\t\twindow.tinyMCE.triggerSave();\n\t}\n\n\t// Additional data needed for backward compatibility.\n\t// If we do not provide this data, the post will be overridden with the default values.\n\tconst post = registry.select( editorStore ).getCurrentPost();\n\tconst additionalData = [\n\t\tpost.comment_status ? [ 'comment_status', post.comment_status ] : false,\n\t\tpost.ping_status ? [ 'ping_status', post.ping_status ] : false,\n\t\tpost.sticky ? [ 'sticky', post.sticky ] : false,\n\t\tpost.author ? [ 'post_author', post.author ] : false,\n\t].filter( Boolean );\n\n\t// We gather all the metaboxes locations data and the base form data.\n\tconst baseFormData = new window.FormData(\n\t\tdocument.querySelector( '.metabox-base-form' )\n\t);\n\tconst activeMetaBoxLocations = select.getActiveMetaBoxLocations();\n\tconst formDataToMerge = [\n\t\tbaseFormData,\n\t\t...activeMetaBoxLocations.map(\n\t\t\t( location ) =>\n\t\t\t\tnew window.FormData( getMetaBoxContainer( location ) )\n\t\t),\n\t];\n\n\t// Merge all form data objects into a single one.\n\tconst formData = reduce(\n\t\tformDataToMerge,\n\t\t( 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},\n\t\tnew window.FormData()\n\t);\n\tadditionalData.forEach( ( [ key, value ] ) =>\n\t\tformData.append( key, value )\n\t);\n\n\ttry {\n\t\t// Save the metaboxes.\n\t\tawait apiFetch( {\n\t\t\turl: window._wpMetaBoxUrl,\n\t\t\tmethod: 'POST',\n\t\t\tbody: formData,\n\t\t\tparse: false,\n\t\t} );\n\t\tdispatch.metaBoxUpdatesSuccess();\n\t} catch {\n\t\tdispatch.metaBoxUpdatesFailure();\n\t}\n};\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 * Returns an action object used to toggle the width of the editing canvas.\n *\n * @param {string} deviceType\n *\n * @return {Object} Action object.\n */\nexport function __experimentalSetPreviewDeviceType( deviceType ) {\n\treturn {\n\t\ttype: 'SET_PREVIEW_DEVICE_TYPE',\n\t\tdeviceType,\n\t};\n}\n\n/**\n * Returns an action object used to open/close the inserter.\n *\n * @param {boolean|Object} value Whether the inserter should be\n * opened (true) or closed (false).\n * To specify an insertion point,\n * use an object.\n * @param {string} value.rootClientId The root client ID to insert at.\n * @param {number} value.insertionIndex The index to insert at.\n *\n * @return {Object} Action object.\n */\nexport function setIsInserterOpened( value ) {\n\treturn {\n\t\ttype: 'SET_IS_INSERTER_OPENED',\n\t\tvalue,\n\t};\n}\n\n/**\n * Returns an action object used to open/close the list view.\n *\n * @param {boolean} isOpen A boolean representing whether the list view should be opened or closed.\n * @return {Object} Action object.\n */\nexport function setIsListViewOpened( isOpen ) {\n\treturn {\n\t\ttype: 'SET_IS_LIST_VIEW_OPENED',\n\t\tisOpen,\n\t};\n}\n\n/**\n * Returns an action object used to switch to template editing.\n *\n * @param {boolean} value Is editing template.\n * @return {Object} Action object.\n */\nexport function setIsEditingTemplate( value ) {\n\treturn {\n\t\ttype: 'SET_IS_EDITING_TEMPLATE',\n\t\tvalue,\n\t};\n}\n\n/**\n * Switches to the template mode.\n *\n * @param {boolean} newTemplate Is new template.\n */\nexport const __unstableSwitchToTemplateMode = ( newTemplate = false ) => ( {\n\tregistry,\n\tselect,\n\tdispatch,\n} ) => {\n\tdispatch( setIsEditingTemplate( true ) );\n\tconst isWelcomeGuideActive = select.isFeatureActive(\n\t\t'welcomeGuideTemplate'\n\t);\n\tif ( ! isWelcomeGuideActive ) {\n\t\tconst message = newTemplate\n\t\t\t? __( \"Custom template created. You're in template mode now.\" )\n\t\t\t: __(\n\t\t\t\t\t'Editing template. Changes made here affect all posts and pages that use the template.'\n\t\t\t );\n\t\tregistry.dispatch( noticesStore ).createSuccessNotice( message, {\n\t\t\ttype: 'snackbar',\n\t\t} );\n\t}\n};\n\n/**\n * Create a block based template.\n *\n * @param {Object?} template Template to create and assign.\n */\nexport const __unstableCreateTemplate = ( template ) => async ( {\n\tregistry,\n} ) => {\n\tconst savedTemplate = await registry\n\t\t.dispatch( coreStore )\n\t\t.saveEntityRecord( 'postType', 'wp_template', template );\n\tconst post = registry.select( editorStore ).getCurrentPost();\n\tregistry\n\t\t.dispatch( coreStore )\n\t\t.editEntityRecord( 'postType', post.type, post.id, {\n\t\t\ttemplate: savedTemplate.slug,\n\t\t} );\n};\n\nlet metaBoxesInitialized = false;\n\n/**\n * Initializes WordPress `postboxes` script and the logic for saving meta boxes.\n */\nexport const initializeMetaBoxes = () => ( { registry, select, dispatch } ) => {\n\tconst isEditorReady = registry\n\t\t.select( editorStore )\n\t\t.__unstableIsEditorReady();\n\n\tif ( ! isEditorReady ) {\n\t\treturn;\n\t}\n\t// Only initialize once.\n\tif ( metaBoxesInitialized ) {\n\t\treturn;\n\t}\n\tconst postType = registry.select( editorStore ).getCurrentPostType();\n\tif ( window.postboxes.page !== postType ) {\n\t\twindow.postboxes.add_postbox_toggles( postType );\n\t}\n\n\tmetaBoxesInitialized = true;\n\n\tlet wasSavingPost = registry.select( editorStore ).isSavingPost();\n\tlet wasAutosavingPost = registry.select( editorStore ).isAutosavingPost();\n\tconst hasMetaBoxes = select.hasMetaBoxes();\n\n\t// Save metaboxes when performing a full save on the post.\n\tregistry.subscribe( async () => {\n\t\tconst isSavingPost = registry.select( editorStore ).isSavingPost();\n\t\tconst isAutosavingPost = registry\n\t\t\t.select( editorStore )\n\t\t\t.isAutosavingPost();\n\n\t\t// Save metaboxes on save completion, except for autosaves that are not a post preview.\n\t\t//\n\t\t// Meta boxes are initialized once at page load. It is not necessary to\n\t\t// account for updates on each state change.\n\t\t//\n\t\t// See: https://github.com/WordPress/WordPress/blob/5.1.1/wp-admin/includes/post.php#L2307-L2309.\n\t\tconst shouldTriggerMetaboxesSave =\n\t\t\thasMetaBoxes &&\n\t\t\twasSavingPost &&\n\t\t\t! isSavingPost &&\n\t\t\t! wasAutosavingPost;\n\n\t\t// Save current state for next inspection.\n\t\twasSavingPost = isSavingPost;\n\t\twasAutosavingPost = isAutosavingPost;\n\n\t\tif ( shouldTriggerMetaboxesSave ) {\n\t\t\tawait dispatch.requestMetaBoxUpdates();\n\t\t}\n\t} );\n\n\tdispatch( {\n\t\ttype: 'META_BOXES_INITIALIZED',\n\t} );\n};\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
|
-
import { createReduxStore,
|
|
4
|
+
import { createReduxStore, register } from '@wordpress/data';
|
|
5
5
|
/**
|
|
6
6
|
* Internal dependencies
|
|
7
7
|
*/
|
|
@@ -10,12 +10,6 @@ import reducer from './reducer';
|
|
|
10
10
|
import * as actions from './actions';
|
|
11
11
|
import * as selectors from './selectors';
|
|
12
12
|
import { STORE_NAME } from './constants';
|
|
13
|
-
const storeConfig = {
|
|
14
|
-
reducer,
|
|
15
|
-
actions,
|
|
16
|
-
selectors,
|
|
17
|
-
persist: ['preferences']
|
|
18
|
-
};
|
|
19
13
|
/**
|
|
20
14
|
* Store definition for the edit post namespace.
|
|
21
15
|
*
|
|
@@ -24,7 +18,10 @@ const storeConfig = {
|
|
|
24
18
|
* @type {Object}
|
|
25
19
|
*/
|
|
26
20
|
|
|
27
|
-
export const store = createReduxStore(STORE_NAME,
|
|
28
|
-
|
|
29
|
-
|
|
21
|
+
export const store = createReduxStore(STORE_NAME, {
|
|
22
|
+
reducer,
|
|
23
|
+
actions,
|
|
24
|
+
selectors
|
|
25
|
+
});
|
|
26
|
+
register(store);
|
|
30
27
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-post/src/store/index.js"],"names":["createReduxStore","
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-post/src/store/index.js"],"names":["createReduxStore","register","reducer","actions","selectors","STORE_NAME","store"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,gBAAT,EAA2BC,QAA3B,QAA2C,iBAA3C;AAEA;AACA;AACA;;AACA,OAAOC,OAAP,MAAoB,WAApB;AACA,OAAO,KAAKC,OAAZ,MAAyB,WAAzB;AACA,OAAO,KAAKC,SAAZ,MAA2B,aAA3B;AACA,SAASC,UAAT,QAA2B,aAA3B;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAMC,KAAK,GAAGN,gBAAgB,CAAEK,UAAF,EAAc;AAClDH,EAAAA,OADkD;AAElDC,EAAAA,OAFkD;AAGlDC,EAAAA;AAHkD,CAAd,CAA9B;AAMPH,QAAQ,CAAEK,KAAF,CAAR","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} );\n\nregister( store );\n"]}
|