@wordpress/edit-post 7.27.1 → 7.27.2

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.
Files changed (56) hide show
  1. package/build/components/header/index.js +2 -4
  2. package/build/components/header/index.js.map +1 -1
  3. package/build/components/header/mode-switcher/index.js +0 -5
  4. package/build/components/header/mode-switcher/index.js.map +1 -1
  5. package/build/components/sidebar/settings-header/index.js +4 -7
  6. package/build/components/sidebar/settings-header/index.js.map +1 -1
  7. package/build/components/sidebar/settings-sidebar/index.js +6 -6
  8. package/build/components/sidebar/settings-sidebar/index.js.map +1 -1
  9. package/build/components/sidebar/template-summary/index.js +4 -8
  10. package/build/components/sidebar/template-summary/index.js.map +1 -1
  11. package/build/components/visual-editor/index.js +5 -4
  12. package/build/components/visual-editor/index.js.map +1 -1
  13. package/build/components/welcome-guide/index.js +6 -6
  14. package/build/components/welcome-guide/index.js.map +1 -1
  15. package/build/editor.js +5 -15
  16. package/build/editor.js.map +1 -1
  17. package/build/hooks/use-post-history.js +1 -1
  18. package/build/hooks/use-post-history.js.map +1 -1
  19. package/build/plugins/welcome-guide-menu-item/index.js +2 -2
  20. package/build/plugins/welcome-guide-menu-item/index.js.map +1 -1
  21. package/build/store/actions.js +1 -11
  22. package/build/store/actions.js.map +1 -1
  23. package/build-module/components/header/index.js +2 -4
  24. package/build-module/components/header/index.js.map +1 -1
  25. package/build-module/components/header/mode-switcher/index.js +0 -5
  26. package/build-module/components/header/mode-switcher/index.js.map +1 -1
  27. package/build-module/components/sidebar/settings-header/index.js +4 -7
  28. package/build-module/components/sidebar/settings-header/index.js.map +1 -1
  29. package/build-module/components/sidebar/settings-sidebar/index.js +6 -6
  30. package/build-module/components/sidebar/settings-sidebar/index.js.map +1 -1
  31. package/build-module/components/sidebar/template-summary/index.js +4 -8
  32. package/build-module/components/sidebar/template-summary/index.js.map +1 -1
  33. package/build-module/components/visual-editor/index.js +5 -4
  34. package/build-module/components/visual-editor/index.js.map +1 -1
  35. package/build-module/components/welcome-guide/index.js +6 -6
  36. package/build-module/components/welcome-guide/index.js.map +1 -1
  37. package/build-module/editor.js +5 -15
  38. package/build-module/editor.js.map +1 -1
  39. package/build-module/hooks/use-post-history.js +1 -1
  40. package/build-module/hooks/use-post-history.js.map +1 -1
  41. package/build-module/plugins/welcome-guide-menu-item/index.js +2 -2
  42. package/build-module/plugins/welcome-guide-menu-item/index.js.map +1 -1
  43. package/build-module/store/actions.js +0 -9
  44. package/build-module/store/actions.js.map +1 -1
  45. package/package.json +8 -8
  46. package/src/components/header/index.js +2 -5
  47. package/src/components/header/mode-switcher/index.js +16 -25
  48. package/src/components/sidebar/settings-header/index.js +3 -6
  49. package/src/components/sidebar/settings-sidebar/index.js +7 -7
  50. package/src/components/sidebar/template-summary/index.js +3 -7
  51. package/src/components/visual-editor/index.js +4 -2
  52. package/src/components/welcome-guide/index.js +11 -6
  53. package/src/editor.js +17 -30
  54. package/src/hooks/use-post-history.js +1 -1
  55. package/src/plugins/welcome-guide-menu-item/index.js +3 -3
  56. package/src/store/actions.js +0 -9
@@ -1 +1 @@
1
- {"version":3,"names":["_element","require","_url","usePostHistory","initialPostId","initialPostType","postHistory","dispatch","useReducer","historyState","type","post","length","slice","postId","postType","getPostLinkProps","useCallback","params","currentArgs","getQueryArgs","window","location","href","currentUrlWithoutArgs","removeQueryArgs","Object","keys","newUrl","addQueryArgs","action","onClick","event","preventDefault","goBack","currentPost","undefined"],"sources":["@wordpress/edit-post/src/hooks/use-post-history.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useCallback, useReducer } from '@wordpress/element';\nimport { addQueryArgs, getQueryArgs, removeQueryArgs } from '@wordpress/url';\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 *\n * @return {Object} An object containing the `currentPost` variable and\n * `getPostLinkProps` and `goBack` functions.\n */\nexport default function usePostHistory( initialPostId, initialPostType ) {\n\tconst [ postHistory, dispatch ] = useReducer(\n\t\t( historyState, { type, post } ) => {\n\t\t\tif ( type === 'push' ) {\n\t\t\t\treturn [ ...historyState, post ];\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[ { postId: initialPostId, postType: initialPostType } ]\n\t);\n\n\tconst getPostLinkProps = useCallback( ( params ) => {\n\t\tconst currentArgs = getQueryArgs( window.location.href );\n\t\tconst currentUrlWithoutArgs = removeQueryArgs(\n\t\t\twindow.location.href,\n\t\t\t...Object.keys( currentArgs )\n\t\t);\n\n\t\tconst newUrl = addQueryArgs( currentUrlWithoutArgs, {\n\t\t\tpost: params.postId,\n\t\t\taction: 'edit',\n\t\t} );\n\n\t\treturn {\n\t\t\thref: newUrl,\n\t\t\tonClick: ( event ) => {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tdispatch( {\n\t\t\t\t\ttype: 'push',\n\t\t\t\t\tpost: { postId: params.postId, postType: params.postType },\n\t\t\t\t} );\n\t\t\t},\n\t\t};\n\t}, [] );\n\n\tconst goBack = useCallback( () => {\n\t\tdispatch( { type: 'pop' } );\n\t}, [] );\n\n\tconst currentPost = postHistory[ postHistory.length - 1 ];\n\n\treturn {\n\t\tcurrentPost,\n\t\tgetPostLinkProps,\n\t\tgoBack: postHistory.length > 1 ? goBack : undefined,\n\t};\n}\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,IAAA,GAAAD,OAAA;AAJA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,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,CAAE,CAAC;MACJ;IACD,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EAEP,MAAMmB,MAAM,GAAG,IAAAjB,oBAAW,EAAE,MAAM;IACjCV,QAAQ,CAAE;MAAEG,IAAI,EAAE;IAAM,CAAE,CAAC;EAC5B,CAAC,EAAE,EAAG,CAAC;EAEP,MAAMyB,WAAW,GAAG7B,WAAW,CAAEA,WAAW,CAACM,MAAM,GAAG,CAAC,CAAE;EAEzD,OAAO;IACNuB,WAAW;IACXnB,gBAAgB;IAChBkB,MAAM,EAAE5B,WAAW,CAACM,MAAM,GAAG,CAAC,GAAGsB,MAAM,GAAGE;EAC3C,CAAC;AACF"}
1
+ {"version":3,"names":["_element","require","_url","usePostHistory","initialPostId","initialPostType","postHistory","dispatch","useReducer","historyState","type","post","length","slice","postId","postType","getPostLinkProps","useCallback","params","currentArgs","getQueryArgs","window","location","href","currentUrlWithoutArgs","removeQueryArgs","Object","keys","newUrl","addQueryArgs","action","onClick","event","preventDefault","goBack","currentPost","undefined"],"sources":["@wordpress/edit-post/src/hooks/use-post-history.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useCallback, useReducer } from '@wordpress/element';\nimport { addQueryArgs, getQueryArgs, removeQueryArgs } from '@wordpress/url';\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 *\n * @return {Object} An object containing the `currentPost` variable and\n * `getPostLinkProps` and `goBack` functions.\n */\nexport default function usePostHistory( initialPostId, initialPostType ) {\n\tconst [ postHistory, dispatch ] = useReducer(\n\t\t( historyState, { type, post } ) => {\n\t\t\tif ( type === 'push' ) {\n\t\t\t\treturn [ ...historyState, post ];\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[ { postId: initialPostId, postType: initialPostType } ]\n\t);\n\n\tconst getPostLinkProps = useCallback( ( params ) => {\n\t\tconst currentArgs = getQueryArgs( window.location.href );\n\t\tconst currentUrlWithoutArgs = removeQueryArgs(\n\t\t\twindow.location.href,\n\t\t\t...Object.keys( currentArgs )\n\t\t);\n\n\t\tconst newUrl = addQueryArgs( currentUrlWithoutArgs, {\n\t\t\tpost: params.postId,\n\t\t\taction: 'edit',\n\t\t} );\n\n\t\treturn {\n\t\t\thref: newUrl,\n\t\t\tonClick: ( event ) => {\n\t\t\t\tevent?.preventDefault();\n\t\t\t\tdispatch( {\n\t\t\t\t\ttype: 'push',\n\t\t\t\t\tpost: { postId: params.postId, postType: params.postType },\n\t\t\t\t} );\n\t\t\t},\n\t\t};\n\t}, [] );\n\n\tconst goBack = useCallback( () => {\n\t\tdispatch( { type: 'pop' } );\n\t}, [] );\n\n\tconst currentPost = postHistory[ postHistory.length - 1 ];\n\n\treturn {\n\t\tcurrentPost,\n\t\tgetPostLinkProps,\n\t\tgoBack: postHistory.length > 1 ? goBack : undefined,\n\t};\n}\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,IAAA,GAAAD,OAAA;AAJA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASE,cAAcA,CAAEC,aAAa,EAAEC,eAAe,EAAG;EACxE,MAAM,CAAEC,WAAW,EAAEC,QAAQ,CAAE,GAAG,IAAAC,mBAAU,EAC3C,CAAEC,YAAY,EAAE;IAAEC,IAAI;IAAEC;EAAK,CAAC,KAAM;IACnC,IAAKD,IAAI,KAAK,MAAM,EAAG;MACtB,OAAO,CAAE,GAAGD,YAAY,EAAEE,IAAI,CAAE;I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AG,CAAC,CAAE;EAEzD,OAAO;IACNuB,WAAW;IACXnB,gBAAgB;IAChBkB,MAAM,EAAE5B,WAAW,CAACM,MAAM,GAAG,CAAC,GAAGsB,MAAM,GAAGE;EAC3C,CAAC;AACF"}
@@ -14,10 +14,10 @@ var _editor = require("@wordpress/editor");
14
14
  */
15
15
 
16
16
  function WelcomeGuideMenuItem() {
17
- const isTemplateMode = (0, _data.useSelect)(select => select(_editor.store).getRenderingMode() === 'template-only', []);
17
+ const isEditingTemplate = (0, _data.useSelect)(select => select(_editor.store).getCurrentPostType() === 'wp_template', []);
18
18
  return (0, _react.createElement)(_preferences.PreferenceToggleMenuItem, {
19
19
  scope: "core/edit-post",
20
- name: isTemplateMode ? 'welcomeGuideTemplate' : 'welcomeGuide',
20
+ name: isEditingTemplate ? 'welcomeGuideTemplate' : 'welcomeGuide',
21
21
  label: (0, _i18n.__)('Welcome Guide')
22
22
  });
23
23
  }
@@ -1 +1 @@
1
- {"version":3,"names":["_data","require","_preferences","_i18n","_editor","WelcomeGuideMenuItem","isTemplateMode","useSelect","select","editorStore","getRenderingMode","_react","createElement","PreferenceToggleMenuItem","scope","name","label","__"],"sources":["@wordpress/edit-post/src/plugins/welcome-guide-menu-item/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { PreferenceToggleMenuItem } from '@wordpress/preferences';\nimport { __ } from '@wordpress/i18n';\nimport { store as editorStore } from '@wordpress/editor';\n\nexport default function WelcomeGuideMenuItem() {\n\tconst isTemplateMode = useSelect(\n\t\t( select ) =>\n\t\t\tselect( editorStore ).getRenderingMode() === 'template-only',\n\t\t[]\n\t);\n\n\treturn (\n\t\t<PreferenceToggleMenuItem\n\t\t\tscope=\"core/edit-post\"\n\t\t\tname={ isTemplateMode ? 'welcomeGuideTemplate' : 'welcomeGuide' }\n\t\t\tlabel={ __( 'Welcome Guide' ) }\n\t\t/>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AANA;AACA;AACA;;AAMe,SAASI,oBAAoBA,CAAA,EAAG;EAC9C,MAAMC,cAAc,GAAG,IAAAC,eAAS,EAC7BC,MAAM,IACPA,MAAM,CAAEC,aAAY,CAAC,CAACC,gBAAgB,CAAC,CAAC,KAAK,eAAe,EAC7D,EACD,CAAC;EAED,OACC,IAAAC,MAAA,CAAAC,aAAA,EAACV,YAAA,CAAAW,wBAAwB;IACxBC,KAAK,EAAC,gBAAgB;IACtBC,IAAI,EAAGT,cAAc,GAAG,sBAAsB,GAAG,cAAgB;IACjEU,KAAK,EAAG,IAAAC,QAAE,EAAE,eAAgB;EAAG,CAC/B,CAAC;AAEJ"}
1
+ {"version":3,"names":["_data","require","_preferences","_i18n","_editor","WelcomeGuideMenuItem","isEditingTemplate","useSelect","select","editorStore","getCurrentPostType","_react","createElement","PreferenceToggleMenuItem","scope","name","label","__"],"sources":["@wordpress/edit-post/src/plugins/welcome-guide-menu-item/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { PreferenceToggleMenuItem } from '@wordpress/preferences';\nimport { __ } from '@wordpress/i18n';\nimport { store as editorStore } from '@wordpress/editor';\n\nexport default function WelcomeGuideMenuItem() {\n\tconst isEditingTemplate = useSelect(\n\t\t( select ) =>\n\t\t\tselect( editorStore ).getCurrentPostType() === 'wp_template',\n\t\t[]\n\t);\n\n\treturn (\n\t\t<PreferenceToggleMenuItem\n\t\t\tscope=\"core/edit-post\"\n\t\t\tname={ isEditingTemplate ? 'welcomeGuideTemplate' : 'welcomeGuide' }\n\t\t\tlabel={ __( 'Welcome Guide' ) }\n\t\t/>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AANA;AACA;AACA;;AAMe,SAASI,oBAAoBA,CAAA,EAAG;EAC9C,MAAMC,iBAAiB,GAAG,IAAAC,eAAS,EAChCC,MAAM,IACPA,MAAM,CAAEC,aAAY,CAAC,CAACC,kBAAkB,CAAC,CAAC,KAAK,aAAa,EAC7D,EACD,CAAC;EAED,OACC,IAAAC,MAAA,CAAAC,aAAA,EAACV,YAAA,CAAAW,wBAAwB;IACxBC,KAAK,EAAC,gBAAgB;IACtBC,IAAI,EAAGT,iBAAiB,GAAG,sBAAsB,GAAG,cAAgB;IACpEU,KAAK,EAAG,IAAAC,QAAE,EAAE,eAAgB;EAAG,CAC/B,CAAC;AAEJ"}
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.__experimentalSetPreviewDeviceType = void 0;
8
8
  exports.__unstableCreateTemplate = __unstableCreateTemplate;
9
- exports.closeModal = exports.closeGeneralSidebar = exports.__unstableSwitchToTemplateMode = void 0;
9
+ exports.closeModal = exports.closeGeneralSidebar = void 0;
10
10
  exports.closePublishSidebar = closePublishSidebar;
11
11
  exports.initializeMetaBoxes = exports.hideBlockTypes = void 0;
12
12
  exports.metaBoxUpdatesFailure = metaBoxUpdatesFailure;
@@ -453,21 +453,11 @@ function setIsEditingTemplate() {
453
453
  };
454
454
  }
455
455
 
456
- /**
457
- * Switches to the template mode.
458
- */
459
- const __unstableSwitchToTemplateMode = () => ({
460
- registry
461
- }) => {
462
- registry.dispatch(_editor.store).setRenderingMode('template-only');
463
- };
464
-
465
456
  /**
466
457
  * Create a block based template.
467
458
  *
468
459
  * @deprecated
469
460
  */
470
- exports.__unstableSwitchToTemplateMode = __unstableSwitchToTemplateMode;
471
461
  function __unstableCreateTemplate() {
472
462
  (0, _deprecated.default)("dispatch( 'core/edit-post' ).__unstableCreateTemplate", {
473
463
  since: '6.5'
@@ -1 +1 @@
1
- {"version":3,"names":["_i18n","require","_apiFetch","_interopRequireDefault","_interface","_preferences","_a11y","_notices","_blockEditor","_editor","_deprecated","_hooks","_metaBoxes","_","_lockUnlock","openGeneralSidebar","name","dispatch","registry","isDistractionFree","select","preferencesStore","get","toggleDistractionFree","interfaceStore","enableComplementaryArea","editPostStore","exports","closeGeneralSidebar","disableComplementaryArea","openModal","deprecated","since","alternative","closeModal","openPublishSidebar","type","closePublishSidebar","togglePublishSidebar","toggleEditorPanelEnabled","panelName","editorStore","toggleEditorPanelOpened","removeEditorPanel","toggleFeature","feature","toggle","switchEditorMode","mode","set","blockEditorStore","clearSelectedBlock","message","__","speak","togglePinnedPluginItem","pluginName","isPinned","isItemPinned","updatePreferredStyleVariations","blockName","blockStyle","_registry$select$get","existingVariations","updatedVariations","showBlockTypes","blockNames","unlock","hideBlockTypes","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","getMetaBoxContainer","formData","reduce","memo","currentFormData","key","value","append","forEach","apiFetch","url","_wpMetaBoxUrl","method","body","parse","metaBoxUpdatesSuccess","metaBoxUpdatesFailure","__experimentalSetPreviewDeviceType","deviceType","version","hint","setDeviceType","setIsInserterOpened","setIsListViewOpened","isOpen","setIsEditingTemplate","__unstableSwitchToTemplateMode","setRenderingMode","__unstableCreateTemplate","metaBoxesInitialized","initializeMetaBoxes","isEditorReady","__unstableIsEditorReady","postType","getCurrentPostType","postboxes","page","add_postbox_toggles","addFilter","previous","options","then","isAutosave","hasMetaBoxes","batch","noticesStore","createInfoNotice","id","actions","label","onClick"],"sources":["@wordpress/edit-post/src/store/actions.js"],"sourcesContent":["/**\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 blockEditorStore } from '@wordpress/block-editor';\nimport { store as editorStore } from '@wordpress/editor';\nimport deprecated from '@wordpress/deprecated';\nimport { addFilter } from '@wordpress/hooks';\n\n/**\n * Internal dependencies\n */\nimport { getMetaBoxContainer } from '../utils/meta-boxes';\nimport { store as editPostStore } from '.';\nimport { unlock } from '../lock-unlock';\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( { dispatch, registry } ) => {\n\t\tconst isDistractionFree = registry\n\t\t\t.select( preferencesStore )\n\t\t\t.get( 'core', 'distractionFree' );\n\t\tif ( isDistractionFree ) {\n\t\t\tdispatch.toggleDistractionFree();\n\t\t}\n\t\tregistry\n\t\t\t.dispatch( interfaceStore )\n\t\t\t.enableComplementaryArea( editPostStore.name, 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\n\t\t\t.dispatch( interfaceStore )\n\t\t\t.disableComplementaryArea( editPostStore.name );\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 *\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 * @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 * @param {string} mode The editor mode.\n */\nexport const switchEditorMode =\n\t( mode ) =>\n\t( { dispatch, registry } ) => {\n\t\tregistry.dispatch( preferencesStore ).set( 'core', 'editorMode', mode );\n\n\t\t// Unselect blocks when we switch to the code editor.\n\t\tif ( mode !== 'visual' ) {\n\t\t\tregistry.dispatch( blockEditorStore ).clearSelectedBlock();\n\t\t}\n\n\t\tif (\n\t\t\tmode === 'text' &&\n\t\t\tregistry.select( preferencesStore ).get( 'core', 'distractionFree' )\n\t\t) {\n\t\t\tdispatch.toggleDistractionFree();\n\t\t}\n\n\t\tconst message =\n\t\t\tmode === 'visual'\n\t\t\t\t? __( 'Visual editor selected' )\n\t\t\t\t: __( 'Code editor selected' );\n\t\tspeak( message, 'assertive' );\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/edit-post', pluginName );\n\n\t\tregistry\n\t\t\t.dispatch( interfaceStore )\n\t\t\t[ isPinned ? 'unpinItem' : 'pinItem' ](\n\t\t\t\t'core/edit-post',\n\t\t\t\tpluginName\n\t\t\t);\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 * @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 =\n\t( blockName, blockStyle ) =>\n\t( { registry } ) => {\n\t\tif ( ! blockName ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst existingVariations =\n\t\t\tregistry\n\t\t\t\t.select( preferencesStore )\n\t\t\t\t.get( 'core/edit-post', 'preferredStyleVariations' ) ?? {};\n\n\t\t// When the blockStyle is omitted, remove the block's preferred variation.\n\t\tif ( ! blockStyle ) {\n\t\t\tconst updatedVariations = {\n\t\t\t\t...existingVariations,\n\t\t\t};\n\n\t\t\tdelete updatedVariations[ blockName ];\n\n\t\t\tregistry\n\t\t\t\t.dispatch( preferencesStore )\n\t\t\t\t.set(\n\t\t\t\t\t'core/edit-post',\n\t\t\t\t\t'preferredStyleVariations',\n\t\t\t\t\tupdatedVariations\n\t\t\t\t);\n\t\t} else {\n\t\t\t// Else add the variation.\n\t\t\tregistry\n\t\t\t\t.dispatch( preferencesStore )\n\t\t\t\t.set( 'core/edit-post', 'preferredStyleVariations', {\n\t\t\t\t\t...existingVariations,\n\t\t\t\t\t[ blockName ]: blockStyle,\n\t\t\t\t} );\n\t\t}\n\t};\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// 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\tconst post = registry.select( editorStore ).getCurrentPost();\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 data and the base form data.\n\t\tconst baseFormData = new window.FormData(\n\t\t\tdocument.querySelector( '.metabox-base-form' )\n\t\t);\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 * Switches to the template mode.\n */\nexport const __unstableSwitchToTemplateMode =\n\t() =>\n\t( { registry } ) => {\n\t\tregistry.dispatch( editorStore ).setRenderingMode( 'template-only' );\n\t};\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\taddFilter(\n\t\t\t'editor.__unstableSavePost',\n\t\t\t'core/edit-post/save-metaboxes',\n\t\t\t( previous, options ) =>\n\t\t\t\tprevious.then( () => {\n\t\t\t\t\tif ( options.isAutosave ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( ! select.hasMetaBoxes() ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn dispatch.requestMetaBoxUpdates();\n\t\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 */\nexport const toggleDistractionFree =\n\t() =>\n\t( { dispatch, registry } ) => {\n\t\tconst isDistractionFree = registry\n\t\t\t.select( preferencesStore )\n\t\t\t.get( 'core', 'distractionFree' );\n\t\tif ( ! isDistractionFree ) {\n\t\t\tregistry.batch( () => {\n\t\t\t\tregistry\n\t\t\t\t\t.dispatch( preferencesStore )\n\t\t\t\t\t.set( 'core', 'fixedToolbar', true );\n\t\t\t\tregistry.dispatch( editorStore ).setIsInserterOpened( false );\n\t\t\t\tregistry.dispatch( editorStore ).setIsListViewOpened( false );\n\t\t\t\tdispatch.closeGeneralSidebar();\n\t\t\t} );\n\t\t}\n\t\tregistry.batch( () => {\n\t\t\tregistry\n\t\t\t\t.dispatch( preferencesStore )\n\t\t\t\t.set( 'core', 'distractionFree', ! isDistractionFree );\n\t\t\tregistry\n\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t.createInfoNotice(\n\t\t\t\t\tisDistractionFree\n\t\t\t\t\t\t? __( 'Distraction free off.' )\n\t\t\t\t\t\t: __( 'Distraction free on.' ),\n\t\t\t\t\t{\n\t\t\t\t\t\tid: 'core/edit-post/distraction-free-mode/notice',\n\t\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\t\tactions: [\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IAAAA,QAAE,EAAE,sBAAuB,CAAC,EAC/B;MACCuF,EAAE,EAAE,6CAA6C;MACjDxG,IAAI,EAAE,UAAU;MAChByG,OAAO,EAAE,CACR;QACCC,KAAK,EAAE,IAAAzF,QAAE,EAAE,MAAO,CAAC;QACnB0F,OAAO,EAAEA,CAAA,KAAM;UACd7H,QAAQ,CACND,QAAQ,CAAEI,kBAAiB,CAAC,CAC5ByB,MAAM,CAAE,MAAM,EAAE,iBAAkB,CAAC;QACtC;MACD,CAAC;IAEH,CACD,CAAC;EACH,CAAE,CAAC;AACJ,CAAC;AAACnB,OAAA,CAAAJ,qBAAA,GAAAA,qBAAA"}
1
+ {"version":3,"names":["_i18n","require","_apiFetch","_interopRequireDefault","_interface","_preferences","_a11y","_notices","_blockEditor","_editor","_deprecated","_hooks","_metaBoxes","_","_lockUnlock","openGeneralSidebar","name","dispatch","registry","isDistractionFree","select","preferencesStore","get","toggleDistractionFree","interfaceStore","enableComplementaryArea","editPostStore","exports","closeGeneralSidebar","disableComplementaryArea","openModal","deprecated","since","alternative","closeModal","openPublishSidebar","type","closePublishSidebar","togglePublishSidebar","toggleEditorPanelEnabled","panelName","editorStore","toggleEditorPanelOpened","removeEditorPanel","toggleFeature","feature","toggle","switchEditorMode","mode","set","blockEditorStore","clearSelectedBlock","message","__","speak","togglePinnedPluginItem","pluginName","isPinned","isItemPinned","updatePreferredStyleVariations","blockName","blockStyle","_registry$select$get","existingVariations","updatedVariations","showBlockTypes","blockNames","unlock","hideBlockTypes","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","getMetaBoxContainer","formData","reduce","memo","currentFormData","key","value","append","forEach","apiFetch","url","_wpMetaBoxUrl","method","body","parse","metaBoxUpdatesSuccess","metaBoxUpdatesFailure","__experimentalSetPreviewDeviceType","deviceType","version","hint","setDeviceType","setIsInserterOpened","setIsListViewOpened","isOpen","setIsEditingTemplate","__unstableCreateTemplate","metaBoxesInitialized","initializeMetaBoxes","isEditorReady","__unstableIsEditorReady","postType","getCurrentPostType","postboxes","page","add_postbox_toggles","addFilter","previous","options","then","isAutosave","hasMetaBoxes","batch","noticesStore","createInfoNotice","id","actions","label","onClick"],"sources":["@wordpress/edit-post/src/store/actions.js"],"sourcesContent":["/**\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 blockEditorStore } from '@wordpress/block-editor';\nimport { store as editorStore } from '@wordpress/editor';\nimport deprecated from '@wordpress/deprecated';\nimport { addFilter } from '@wordpress/hooks';\n\n/**\n * Internal dependencies\n */\nimport { getMetaBoxContainer } from '../utils/meta-boxes';\nimport { store as editPostStore } from '.';\nimport { unlock } from '../lock-unlock';\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( { dispatch, registry } ) => {\n\t\tconst isDistractionFree = registry\n\t\t\t.select( preferencesStore )\n\t\t\t.get( 'core', 'distractionFree' );\n\t\tif ( isDistractionFree ) {\n\t\t\tdispatch.toggleDistractionFree();\n\t\t}\n\t\tregistry\n\t\t\t.dispatch( interfaceStore )\n\t\t\t.enableComplementaryArea( editPostStore.name, 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\n\t\t\t.dispatch( interfaceStore )\n\t\t\t.disableComplementaryArea( editPostStore.name );\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 *\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 * @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 * @param {string} mode The editor mode.\n */\nexport const switchEditorMode =\n\t( mode ) =>\n\t( { dispatch, registry } ) => {\n\t\tregistry.dispatch( preferencesStore ).set( 'core', 'editorMode', mode );\n\n\t\t// Unselect blocks when we switch to the code editor.\n\t\tif ( mode !== 'visual' ) {\n\t\t\tregistry.dispatch( blockEditorStore ).clearSelectedBlock();\n\t\t}\n\n\t\tif (\n\t\t\tmode === 'text' &&\n\t\t\tregistry.select( preferencesStore ).get( 'core', 'distractionFree' )\n\t\t) {\n\t\t\tdispatch.toggleDistractionFree();\n\t\t}\n\n\t\tconst message =\n\t\t\tmode === 'visual'\n\t\t\t\t? __( 'Visual editor selected' )\n\t\t\t\t: __( 'Code editor selected' );\n\t\tspeak( message, 'assertive' );\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/edit-post', pluginName );\n\n\t\tregistry\n\t\t\t.dispatch( interfaceStore )\n\t\t\t[ isPinned ? 'unpinItem' : 'pinItem' ](\n\t\t\t\t'core/edit-post',\n\t\t\t\tpluginName\n\t\t\t);\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 * @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 =\n\t( blockName, blockStyle ) =>\n\t( { registry } ) => {\n\t\tif ( ! blockName ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst existingVariations =\n\t\t\tregistry\n\t\t\t\t.select( preferencesStore )\n\t\t\t\t.get( 'core/edit-post', 'preferredStyleVariations' ) ?? {};\n\n\t\t// When the blockStyle is omitted, remove the block's preferred variation.\n\t\tif ( ! blockStyle ) {\n\t\t\tconst updatedVariations = {\n\t\t\t\t...existingVariations,\n\t\t\t};\n\n\t\t\tdelete updatedVariations[ blockName ];\n\n\t\t\tregistry\n\t\t\t\t.dispatch( preferencesStore )\n\t\t\t\t.set(\n\t\t\t\t\t'core/edit-post',\n\t\t\t\t\t'preferredStyleVariations',\n\t\t\t\t\tupdatedVariations\n\t\t\t\t);\n\t\t} else {\n\t\t\t// Else add the variation.\n\t\t\tregistry\n\t\t\t\t.dispatch( preferencesStore )\n\t\t\t\t.set( 'core/edit-post', 'preferredStyleVariations', {\n\t\t\t\t\t...existingVariations,\n\t\t\t\t\t[ blockName ]: blockStyle,\n\t\t\t\t} );\n\t\t}\n\t};\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// 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\tconst post = registry.select( editorStore ).getCurrentPost();\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 data and the base form data.\n\t\tconst baseFormData = new window.FormData(\n\t\t\tdocument.querySelector( '.metabox-base-form' )\n\t\t);\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\taddFilter(\n\t\t\t'editor.__unstableSavePost',\n\t\t\t'core/edit-post/save-metaboxes',\n\t\t\t( previous, options ) =>\n\t\t\t\tprevious.then( () => {\n\t\t\t\t\tif ( options.isAutosave ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( ! select.hasMetaBoxes() ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn dispatch.requestMetaBoxUpdates();\n\t\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 */\nexport const toggleDistractionFree =\n\t() =>\n\t( { dispatch, registry } ) => {\n\t\tconst isDistractionFree = registry\n\t\t\t.select( preferencesStore )\n\t\t\t.get( 'core', 'distractionFree' );\n\t\tif ( ! isDistractionFree ) {\n\t\t\tregistry.batch( () => {\n\t\t\t\tregistry\n\t\t\t\t\t.dispatch( preferencesStore )\n\t\t\t\t\t.set( 'core', 'fixedToolbar', true );\n\t\t\t\tregistry.dispatch( editorStore ).setIsInserterOpened( false );\n\t\t\t\tregistry.dispatch( editorStore ).setIsListViewOpened( false );\n\t\t\t\tdispatch.closeGeneralSidebar();\n\t\t\t} );\n\t\t}\n\t\tregistry.batch( () => {\n\t\t\tregistry\n\t\t\t\t.dispatch( preferencesStore )\n\t\t\t\t.set( 'core', 'distractionFree', ! isDistractionFree );\n\t\t\tregistry\n\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t.createInfoNotice(\n\t\t\t\t\tisDistractionFree\n\t\t\t\t\t\t? __( 'Distraction free off.' )\n\t\t\t\t\t\t: __( 'Distraction free on.' ),\n\t\t\t\t\t{\n\t\t\t\t\t\tid: 'core/edit-post/distraction-free-mode/notice',\n\t\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\t\tactions: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlabel: __( 'Undo' ),\n\t\t\t\t\t\t\t\tonClick: () => {\n\t\t\t\t\t\t\t\t\tregistry\n\t\t\t\t\t\t\t\t\t\t.dispatch( preferencesStore )\n\t\t\t\t\t\t\t\t\t\t.toggle( 'core', 'distractionFree' );\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t} );\n\t};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,UAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AACA,IAAAO,YAAA,GAAAP,OAAA;AACA,IAAAQ,OAAA,GAAAR,OAAA;AACA,IAAAS,WAAA,GAAAP,sBAAA,CAAAF,OAAA;AACA,IAAAU,MAAA,GAAAV,OAAA;AAKA,IAAAW,UAAA,GAAAX,OAAA;AACA,IAAAY,CAAA,GAAAZ,OAAA;AACA,IAAAa,WAAA,GAAAb,OAAA;AAnBA;AACA;AACA;;AAYA;AACA;AACA;;AAKA;AACA;AACA;AACA;AACA;AACO,MAAMc,kBAAkB,GAC5BC,IAAI,IACN,CAAE;EAAEC,QAAQ;EAAEC;AAAS,CAAC,KAAM;EAC7B,MAAMC,i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AiB,GACd,IAAAkC,QAAE,EAAE,uBAAwB,CAAC,GAC7B,IAAAA,QAAE,EAAE,sBAAuB,CAAC,EAC/B;MACCqF,EAAE,EAAE,6CAA6C;MACjDtG,IAAI,EAAE,UAAU;MAChBuG,OAAO,EAAE,CACR;QACCC,KAAK,EAAE,IAAAvF,QAAE,EAAE,MAAO,CAAC;QACnBwF,OAAO,EAAEA,CAAA,KAAM;UACd3H,QAAQ,CACND,QAAQ,CAAEI,kBAAiB,CAAC,CAC5ByB,MAAM,CAAE,MAAM,EAAE,iBAAkB,CAAC;QACtC;MACD,CAAC;IAEH,CACD,CAAC;EACH,CAAE,CAAC;AACJ,CAAC;AAACnB,OAAA,CAAAJ,qBAAA,GAAAA,qBAAA"}
@@ -73,7 +73,6 @@ function Header({
73
73
  hasBlockSelection,
74
74
  hasActiveMetaboxes,
75
75
  hasFixedToolbar,
76
- isEditingTemplate,
77
76
  isPublishSidebarOpened,
78
77
  showIconLabels,
79
78
  hasHistory
@@ -89,7 +88,6 @@ function Header({
89
88
  hasBlockSelection: !!select(blockEditorStore).getBlockSelectionStart(),
90
89
  hasActiveMetaboxes: select(editPostStore).hasMetaBoxes(),
91
90
  hasHistory: !!select(editorStore).getEditorSettings().goBack,
92
- isEditingTemplate: select(editorStore).getRenderingMode() === 'template-only',
93
91
  isPublishSidebarOpened: select(editPostStore).isPublishSidebarOpened(),
94
92
  hasFixedToolbar: getPreference('core', 'fixedToolbar'),
95
93
  showIconLabels: getPreference('core', 'showIconLabels')
@@ -139,9 +137,9 @@ function Header({
139
137
  label: isBlockToolsCollapsed ? __('Show block tools') : __('Hide block tools')
140
138
  })), createElement("div", {
141
139
  className: classnames('edit-post-header__center', {
142
- 'is-collapsed': isEditingTemplate && hasBlockSelection && !isBlockToolsCollapsed && hasFixedToolbar && isLargeViewport
140
+ 'is-collapsed': hasHistory && hasBlockSelection && !isBlockToolsCollapsed && hasFixedToolbar && isLargeViewport
143
141
  })
144
- }, (isEditingTemplate || hasHistory) && createElement(DocumentBar, null))), createElement(motion.div, {
142
+ }, hasHistory && createElement(DocumentBar, null))), createElement(motion.div, {
145
143
  variants: slideY,
146
144
  transition: {
147
145
  type: 'tween',
@@ -1 +1 @@
1
- {"version":3,"names":["classnames","BlockToolbar","store","blockEditorStore","PostSavedState","PostPreviewButton","editorStore","DocumentBar","privateApis","editorPrivateApis","useEffect","useRef","useState","useSelect","__","next","previous","PinnedItems","useViewportMatch","Button","__unstableMotion","motion","Popover","preferencesStore","FullscreenModeClose","MoreMenu","PostPublishButtonOrToggle","MainDashboardButton","editPostStore","unlock","DocumentTools","PostViewLink","PreviewDropdown","slideY","hidden","y","distractionFreeInactive","hover","transition","type","delay","slideX","x","Header","setEntitiesSavedStatesCallback","isWideViewport","isLargeViewport","blockToolbarRef","isTextEditor","hasBlockSelection","hasActiveMetaboxes","hasFixedToolbar","isEditingTemplate","isPublishSidebarOpened","showIconLabels","hasHistory","select","get","getPreference","getEditorMode","getBlockSelectionStart","hasMetaBoxes","getEditorSettings","goBack","getRenderingMode","isBlockToolsCollapsed","setIsBlockToolsCollapsed","createElement","className","Slot","div","variants","showTooltip","disableBlockTools","Fragment","hideDragHandle","ref","name","icon","onClick","collapsed","label","forceIsDirty","forceIsAutosaveable","scope"],"sources":["@wordpress/edit-post/src/components/header/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tBlockToolbar,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport {\n\tPostSavedState,\n\tPostPreviewButton,\n\tstore as editorStore,\n\tDocumentBar,\n\tprivateApis as editorPrivateApis,\n} from '@wordpress/editor';\nimport { useEffect, useRef, useState } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { next, previous } from '@wordpress/icons';\nimport { PinnedItems } from '@wordpress/interface';\nimport { useViewportMatch } from '@wordpress/compose';\nimport {\n\tButton,\n\t__unstableMotion as motion,\n\tPopover,\n} from '@wordpress/components';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport FullscreenModeClose from './fullscreen-mode-close';\nimport MoreMenu from './more-menu';\nimport PostPublishButtonOrToggle from './post-publish-button-or-toggle';\nimport MainDashboardButton from './main-dashboard-button';\nimport { store as editPostStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nconst { DocumentTools, PostViewLink, PreviewDropdown } =\n\tunlock( editorPrivateApis );\n\nconst slideY = {\n\thidden: { y: '-50px' },\n\tdistractionFreeInactive: { y: 0 },\n\thover: { y: 0, transition: { type: 'tween', delay: 0.2 } },\n};\n\nconst slideX = {\n\thidden: { x: '-100%' },\n\tdistractionFreeInactive: { x: 0 },\n\thover: { x: 0, transition: { type: 'tween', delay: 0.2 } },\n};\n\nfunction Header( { setEntitiesSavedStatesCallback } ) {\n\tconst isWideViewport = useViewportMatch( 'large' );\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst blockToolbarRef = useRef();\n\tconst {\n\t\tisTextEditor,\n\t\thasBlockSelection,\n\t\thasActiveMetaboxes,\n\t\thasFixedToolbar,\n\t\tisEditingTemplate,\n\t\tisPublishSidebarOpened,\n\t\tshowIconLabels,\n\t\thasHistory,\n\t} = useSelect( ( select ) => {\n\t\tconst { get: getPreference } = select( preferencesStore );\n\t\tconst { getEditorMode } = select( editPostStore );\n\n\t\treturn {\n\t\t\tisTextEditor: getEditorMode() === 'text',\n\t\t\thasBlockSelection:\n\t\t\t\t!! select( blockEditorStore ).getBlockSelectionStart(),\n\t\t\thasActiveMetaboxes: select( editPostStore ).hasMetaBoxes(),\n\t\t\thasHistory: !! select( editorStore ).getEditorSettings().goBack,\n\t\t\tisEditingTemplate:\n\t\t\t\tselect( editorStore ).getRenderingMode() === 'template-only',\n\t\t\tisPublishSidebarOpened:\n\t\t\t\tselect( editPostStore ).isPublishSidebarOpened(),\n\t\t\thasFixedToolbar: getPreference( 'core', 'fixedToolbar' ),\n\t\t\tshowIconLabels: getPreference( 'core', 'showIconLabels' ),\n\t\t};\n\t}, [] );\n\n\tconst [ isBlockToolsCollapsed, setIsBlockToolsCollapsed ] =\n\t\tuseState( true );\n\n\tuseEffect( () => {\n\t\t// If we have a new block selection, show the block tools\n\t\tif ( hasBlockSelection ) {\n\t\t\tsetIsBlockToolsCollapsed( false );\n\t\t}\n\t}, [ hasBlockSelection ] );\n\n\treturn (\n\t\t<div className=\"edit-post-header\">\n\t\t\t<MainDashboardButton.Slot>\n\t\t\t\t<motion.div\n\t\t\t\t\tvariants={ slideX }\n\t\t\t\t\ttransition={ { type: 'tween', delay: 0.8 } }\n\t\t\t\t>\n\t\t\t\t\t<FullscreenModeClose showTooltip />\n\t\t\t\t</motion.div>\n\t\t\t</MainDashboardButton.Slot>\n\t\t\t<motion.div\n\t\t\t\tvariants={ slideY }\n\t\t\t\ttransition={ { type: 'tween', delay: 0.8 } }\n\t\t\t\tclassName=\"edit-post-header__toolbar\"\n\t\t\t>\n\t\t\t\t<DocumentTools disableBlockTools={ isTextEditor } />\n\t\t\t\t{ hasFixedToolbar && isLargeViewport && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t\t\t'selected-block-tools-wrapper',\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t'is-collapsed': isBlockToolsCollapsed,\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<BlockToolbar hideDragHandle />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<Popover.Slot\n\t\t\t\t\t\t\tref={ blockToolbarRef }\n\t\t\t\t\t\t\tname=\"block-toolbar\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t{ hasBlockSelection && (\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\tclassName=\"edit-post-header__block-tools-toggle\"\n\t\t\t\t\t\t\t\ticon={ isBlockToolsCollapsed ? next : previous }\n\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\tsetIsBlockToolsCollapsed(\n\t\t\t\t\t\t\t\t\t\t( collapsed ) => ! collapsed\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\tlabel={\n\t\t\t\t\t\t\t\t\tisBlockToolsCollapsed\n\t\t\t\t\t\t\t\t\t\t? __( 'Show block tools' )\n\t\t\t\t\t\t\t\t\t\t: __( 'Hide block tools' )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t\t<div\n\t\t\t\t\tclassName={ classnames( 'edit-post-header__center', {\n\t\t\t\t\t\t'is-collapsed':\n\t\t\t\t\t\t\tisEditingTemplate &&\n\t\t\t\t\t\t\thasBlockSelection &&\n\t\t\t\t\t\t\t! isBlockToolsCollapsed &&\n\t\t\t\t\t\t\thasFixedToolbar &&\n\t\t\t\t\t\t\tisLargeViewport,\n\t\t\t\t\t} ) }\n\t\t\t\t>\n\t\t\t\t\t{ ( isEditingTemplate || hasHistory ) && <DocumentBar /> }\n\t\t\t\t</div>\n\t\t\t</motion.div>\n\t\t\t<motion.div\n\t\t\t\tvariants={ slideY }\n\t\t\t\ttransition={ { type: 'tween', delay: 0.8 } }\n\t\t\t\tclassName=\"edit-post-header__settings\"\n\t\t\t>\n\t\t\t\t{ ! isPublishSidebarOpened && (\n\t\t\t\t\t// This button isn't completely hidden by the publish sidebar.\n\t\t\t\t\t// We can't hide the whole toolbar when the publish sidebar is open because\n\t\t\t\t\t// we want to prevent mounting/unmounting the PostPublishButtonOrToggle DOM node.\n\t\t\t\t\t// We track that DOM node to return focus to the PostPublishButtonOrToggle\n\t\t\t\t\t// when the publish sidebar has been closed.\n\t\t\t\t\t<PostSavedState forceIsDirty={ hasActiveMetaboxes } />\n\t\t\t\t) }\n\t\t\t\t<PreviewDropdown forceIsAutosaveable={ hasActiveMetaboxes } />\n\t\t\t\t<PostPreviewButton\n\t\t\t\t\tclassName=\"edit-post-header__post-preview-button\"\n\t\t\t\t\tforceIsAutosaveable={ hasActiveMetaboxes }\n\t\t\t\t/>\n\t\t\t\t<PostViewLink />\n\t\t\t\t<PostPublishButtonOrToggle\n\t\t\t\t\tforceIsDirty={ hasActiveMetaboxes }\n\t\t\t\t\tsetEntitiesSavedStatesCallback={\n\t\t\t\t\t\tsetEntitiesSavedStatesCallback\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t\t{ ( isWideViewport || ! showIconLabels ) && (\n\t\t\t\t\t<PinnedItems.Slot scope=\"core/edit-post\" />\n\t\t\t\t) }\n\t\t\t\t<MoreMenu showIconLabels={ showIconLabels } />\n\t\t\t</motion.div>\n\t\t</div>\n\t);\n}\n\nexport default Header;\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SACCC,YAAY,EACZC,KAAK,IAAIC,gBAAgB,QACnB,yBAAyB;AAChC,SACCC,cAAc,EACdC,iBAAiB,EACjBH,KAAK,IAAII,WAAW,EACpBC,WAAW,EACXC,WAAW,IAAIC,iBAAiB,QAC1B,mBAAmB;AAC1B,SAASC,SAAS,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,oBAAoB;AAChE,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,IAAI,EAAEC,QAAQ,QAAQ,kBAAkB;AACjD,SAASC,WAAW,QAAQ,sBAAsB;AAClD,SAASC,gBAAgB,QAAQ,oBAAoB;AACrD,SACCC,MAAM,EACNC,gBAAgB,IAAIC,MAAM,EAC1BC,OAAO,QACD,uBAAuB;AAC9B,SAASpB,KAAK,IAAIqB,gBAAgB,QAAQ,wBAAwB;;AAElE;AACA;AACA;AACA,OAAOC,mBAAmB,MAAM,yBAAyB;AACzD,OAAO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G;IACVC,QAAQ,EAAGtC,MAAQ;IACnBK,UAAU,EAAG;MAAEC,IAAI,EAAE,OAAO;MAAEC,KAAK,EAAE;IAAI,CAAG;IAC5C4B,SAAS,EAAC;EAA4B,GAEpC,CAAEf,sBAAsB;EACzB;EACA;EACA;EACA;EACA;EACAc,aAAA,CAAC/D,cAAc;IAAC8E,YAAY,EAAGhC;EAAoB,CAAE,CACrD,EACDiB,aAAA,CAACnC,eAAe;IAACmD,mBAAmB,EAAGjC;EAAoB,CAAE,CAAC,EAC9DiB,aAAA,CAAC9D,iBAAiB;IACjB+D,SAAS,EAAC,uCAAuC;IACjDe,mBAAmB,EAAGjC;EAAoB,CAC1C,CAAC,EACFiB,aAAA,CAACpC,YAAY,MAAE,CAAC,EAChBoC,aAAA,CAACzC,yBAAyB;IACzBwD,YAAY,EAAGhC,kBAAoB;IACnCN,8BAA8B,EAC7BA;EACA,CACD,CAAC,EACA,CAAEC,cAAc,IAAI,CAAES,cAAc,KACrCa,aAAA,CAAClD,WAAW,CAACoD,IAAI;IAACe,KAAK,EAAC;EAAgB,CAAE,CAC1C,EACDjB,aAAA,CAAC1C,QAAQ;IAAC6B,cAAc,EAAGA;EAAgB,CAAE,CAClC,CACR,CAAC;AAER;AAEA,eAAeX,MAAM"}
1
+ {"version":3,"names":["classnames","BlockToolbar","store","blockEditorStore","PostSavedState","PostPreviewButton","editorStore","DocumentBar","privateApis","editorPrivateApis","useEffect","useRef","useState","useSelect","__","next","previous","PinnedItems","useViewportMatch","Button","__unstableMotion","motion","Popover","preferencesStore","FullscreenModeClose","MoreMenu","PostPublishButtonOrToggle","MainDashboardButton","editPostStore","unlock","DocumentTools","PostViewLink","PreviewDropdown","slideY","hidden","y","distractionFreeInactive","hover","transition","type","delay","slideX","x","Header","setEntitiesSavedStatesCallback","isWideViewport","isLargeViewport","blockToolbarRef","isTextEditor","hasBlockSelection","hasActiveMetaboxes","hasFixedToolbar","isPublishSidebarOpened","showIconLabels","hasHistory","select","get","getPreference","getEditorMode","getBlockSelectionStart","hasMetaBoxes","getEditorSettings","goBack","isBlockToolsCollapsed","setIsBlockToolsCollapsed","createElement","className","Slot","div","variants","showTooltip","disableBlockTools","Fragment","hideDragHandle","ref","name","icon","onClick","collapsed","label","forceIsDirty","forceIsAutosaveable","scope"],"sources":["@wordpress/edit-post/src/components/header/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tBlockToolbar,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport {\n\tPostSavedState,\n\tPostPreviewButton,\n\tstore as editorStore,\n\tDocumentBar,\n\tprivateApis as editorPrivateApis,\n} from '@wordpress/editor';\nimport { useEffect, useRef, useState } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { next, previous } from '@wordpress/icons';\nimport { PinnedItems } from '@wordpress/interface';\nimport { useViewportMatch } from '@wordpress/compose';\nimport {\n\tButton,\n\t__unstableMotion as motion,\n\tPopover,\n} from '@wordpress/components';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport FullscreenModeClose from './fullscreen-mode-close';\nimport MoreMenu from './more-menu';\nimport PostPublishButtonOrToggle from './post-publish-button-or-toggle';\nimport MainDashboardButton from './main-dashboard-button';\nimport { store as editPostStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nconst { DocumentTools, PostViewLink, PreviewDropdown } =\n\tunlock( editorPrivateApis );\n\nconst slideY = {\n\thidden: { y: '-50px' },\n\tdistractionFreeInactive: { y: 0 },\n\thover: { y: 0, transition: { type: 'tween', delay: 0.2 } },\n};\n\nconst slideX = {\n\thidden: { x: '-100%' },\n\tdistractionFreeInactive: { x: 0 },\n\thover: { x: 0, transition: { type: 'tween', delay: 0.2 } },\n};\n\nfunction Header( { setEntitiesSavedStatesCallback } ) {\n\tconst isWideViewport = useViewportMatch( 'large' );\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst blockToolbarRef = useRef();\n\tconst {\n\t\tisTextEditor,\n\t\thasBlockSelection,\n\t\thasActiveMetaboxes,\n\t\thasFixedToolbar,\n\t\tisPublishSidebarOpened,\n\t\tshowIconLabels,\n\t\thasHistory,\n\t} = useSelect( ( select ) => {\n\t\tconst { get: getPreference } = select( preferencesStore );\n\t\tconst { getEditorMode } = select( editPostStore );\n\n\t\treturn {\n\t\t\tisTextEditor: getEditorMode() === 'text',\n\t\t\thasBlockSelection:\n\t\t\t\t!! select( blockEditorStore ).getBlockSelectionStart(),\n\t\t\thasActiveMetaboxes: select( editPostStore ).hasMetaBoxes(),\n\t\t\thasHistory: !! select( editorStore ).getEditorSettings().goBack,\n\t\t\tisPublishSidebarOpened:\n\t\t\t\tselect( editPostStore ).isPublishSidebarOpened(),\n\t\t\thasFixedToolbar: getPreference( 'core', 'fixedToolbar' ),\n\t\t\tshowIconLabels: getPreference( 'core', 'showIconLabels' ),\n\t\t};\n\t}, [] );\n\n\tconst [ isBlockToolsCollapsed, setIsBlockToolsCollapsed ] =\n\t\tuseState( true );\n\n\tuseEffect( () => {\n\t\t// If we have a new block selection, show the block tools\n\t\tif ( hasBlockSelection ) {\n\t\t\tsetIsBlockToolsCollapsed( false );\n\t\t}\n\t}, [ hasBlockSelection ] );\n\n\treturn (\n\t\t<div className=\"edit-post-header\">\n\t\t\t<MainDashboardButton.Slot>\n\t\t\t\t<motion.div\n\t\t\t\t\tvariants={ slideX }\n\t\t\t\t\ttransition={ { type: 'tween', delay: 0.8 } }\n\t\t\t\t>\n\t\t\t\t\t<FullscreenModeClose showTooltip />\n\t\t\t\t</motion.div>\n\t\t\t</MainDashboardButton.Slot>\n\t\t\t<motion.div\n\t\t\t\tvariants={ slideY }\n\t\t\t\ttransition={ { type: 'tween', delay: 0.8 } }\n\t\t\t\tclassName=\"edit-post-header__toolbar\"\n\t\t\t>\n\t\t\t\t<DocumentTools disableBlockTools={ isTextEditor } />\n\t\t\t\t{ hasFixedToolbar && isLargeViewport && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t\t\t'selected-block-tools-wrapper',\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t'is-collapsed': isBlockToolsCollapsed,\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<BlockToolbar hideDragHandle />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<Popover.Slot\n\t\t\t\t\t\t\tref={ blockToolbarRef }\n\t\t\t\t\t\t\tname=\"block-toolbar\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t{ hasBlockSelection && (\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\tclassName=\"edit-post-header__block-tools-toggle\"\n\t\t\t\t\t\t\t\ticon={ isBlockToolsCollapsed ? next : previous }\n\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\tsetIsBlockToolsCollapsed(\n\t\t\t\t\t\t\t\t\t\t( collapsed ) => ! collapsed\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\tlabel={\n\t\t\t\t\t\t\t\t\tisBlockToolsCollapsed\n\t\t\t\t\t\t\t\t\t\t? __( 'Show block tools' )\n\t\t\t\t\t\t\t\t\t\t: __( 'Hide block tools' )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t\t<div\n\t\t\t\t\tclassName={ classnames( 'edit-post-header__center', {\n\t\t\t\t\t\t'is-collapsed':\n\t\t\t\t\t\t\thasHistory &&\n\t\t\t\t\t\t\thasBlockSelection &&\n\t\t\t\t\t\t\t! isBlockToolsCollapsed &&\n\t\t\t\t\t\t\thasFixedToolbar &&\n\t\t\t\t\t\t\tisLargeViewport,\n\t\t\t\t\t} ) }\n\t\t\t\t>\n\t\t\t\t\t{ hasHistory && <DocumentBar /> }\n\t\t\t\t</div>\n\t\t\t</motion.div>\n\t\t\t<motion.div\n\t\t\t\tvariants={ slideY }\n\t\t\t\ttransition={ { type: 'tween', delay: 0.8 } }\n\t\t\t\tclassName=\"edit-post-header__settings\"\n\t\t\t>\n\t\t\t\t{ ! isPublishSidebarOpened && (\n\t\t\t\t\t// This button isn't completely hidden by the publish sidebar.\n\t\t\t\t\t// We can't hide the whole toolbar when the publish sidebar is open because\n\t\t\t\t\t// we want to prevent mounting/unmounting the PostPublishButtonOrToggle DOM node.\n\t\t\t\t\t// We track that DOM node to return focus to the PostPublishButtonOrToggle\n\t\t\t\t\t// when the publish sidebar has been closed.\n\t\t\t\t\t<PostSavedState forceIsDirty={ hasActiveMetaboxes } />\n\t\t\t\t) }\n\t\t\t\t<PreviewDropdown forceIsAutosaveable={ hasActiveMetaboxes } />\n\t\t\t\t<PostPreviewButton\n\t\t\t\t\tclassName=\"edit-post-header__post-preview-button\"\n\t\t\t\t\tforceIsAutosaveable={ hasActiveMetaboxes }\n\t\t\t\t/>\n\t\t\t\t<PostViewLink />\n\t\t\t\t<PostPublishButtonOrToggle\n\t\t\t\t\tforceIsDirty={ hasActiveMetaboxes }\n\t\t\t\t\tsetEntitiesSavedStatesCallback={\n\t\t\t\t\t\tsetEntitiesSavedStatesCallback\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t\t{ ( isWideViewport || ! showIconLabels ) && (\n\t\t\t\t\t<PinnedItems.Slot scope=\"core/edit-post\" />\n\t\t\t\t) }\n\t\t\t\t<MoreMenu showIconLabels={ showIconLabels } />\n\t\t\t</motion.div>\n\t\t</div>\n\t);\n}\n\nexport default Header;\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SACCC,YAAY,EACZC,KAAK,IAAIC,gBAAgB,QACnB,yBAAyB;AAChC,SACCC,cA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
30
  shortcut,
31
31
  isRichEditingEnabled,
32
32
  isCodeEditingEnabled,
33
- isEditingTemplate,
34
33
  mode
35
34
  } = useSelect(select => ({
36
35
  shortcut: select(keyboardShortcutsStore).getShortcutRepresentation('core/edit-post/toggle-mode'),
37
36
  isRichEditingEnabled: select(editorStore).getEditorSettings().richEditingEnabled,
38
37
  isCodeEditingEnabled: select(editorStore).getEditorSettings().codeEditingEnabled,
39
- isEditingTemplate: select(editorStore).getRenderingMode() === 'template-only',
40
38
  mode: select(editPostStore).getEditorMode()
41
39
  }), []);
42
40
  const {
43
41
  switchEditorMode
44
42
  } = useDispatch(editPostStore);
45
- if (isEditingTemplate) {
46
- return null;
47
- }
48
43
  let selectedMode = mode;
49
44
  if (!isRichEditingEnabled && mode === 'visual') {
50
45
  selectedMode = 'text';
@@ -1 +1 @@
1
- {"version":3,"names":["__","MenuItemsChoice","MenuGroup","useSelect","useDispatch","store","keyboardShortcutsStore","editorStore","editPostStore","MODES","value","label","ModeSwitcher","shortcut","isRichEditingEnabled","isCodeEditingEnabled","isEditingTemplate","mode","select","getShortcutRepresentation","getEditorSettings","richEditingEnabled","codeEditingEnabled","getRenderingMode","getEditorMode","switchEditorMode","selectedMode","choices","map","choice","disabled","info","createElement","onSelect"],"sources":["@wordpress/edit-post/src/components/header/mode-switcher/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { MenuItemsChoice, MenuGroup } from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../../store';\n\n/**\n * Set of available mode options.\n *\n * @type {Array}\n */\nconst MODES = [\n\t{\n\t\tvalue: 'visual',\n\t\tlabel: __( 'Visual editor' ),\n\t},\n\t{\n\t\tvalue: 'text',\n\t\tlabel: __( 'Code editor' ),\n\t},\n];\n\nfunction ModeSwitcher() {\n\tconst {\n\t\tshortcut,\n\t\tisRichEditingEnabled,\n\t\tisCodeEditingEnabled,\n\t\tisEditingTemplate,\n\t\tmode,\n\t} = useSelect(\n\t\t( select ) => ( {\n\t\t\tshortcut: select(\n\t\t\t\tkeyboardShortcutsStore\n\t\t\t).getShortcutRepresentation( 'core/edit-post/toggle-mode' ),\n\t\t\tisRichEditingEnabled:\n\t\t\t\tselect( editorStore ).getEditorSettings().richEditingEnabled,\n\t\t\tisCodeEditingEnabled:\n\t\t\t\tselect( editorStore ).getEditorSettings().codeEditingEnabled,\n\t\t\tisEditingTemplate:\n\t\t\t\tselect( editorStore ).getRenderingMode() === 'template-only',\n\t\t\tmode: select( editPostStore ).getEditorMode(),\n\t\t} ),\n\t\t[]\n\t);\n\tconst { switchEditorMode } = useDispatch( editPostStore );\n\n\tif ( isEditingTemplate ) {\n\t\treturn null;\n\t}\n\n\tlet selectedMode = mode;\n\tif ( ! isRichEditingEnabled && mode === 'visual' ) {\n\t\tselectedMode = 'text';\n\t}\n\tif ( ! isCodeEditingEnabled && mode === 'text' ) {\n\t\tselectedMode = 'visual';\n\t}\n\n\tconst choices = MODES.map( ( choice ) => {\n\t\tif ( ! isCodeEditingEnabled && choice.value === 'text' ) {\n\t\t\tchoice = {\n\t\t\t\t...choice,\n\t\t\t\tdisabled: true,\n\t\t\t};\n\t\t}\n\t\tif ( ! isRichEditingEnabled && choice.value === 'visual' ) {\n\t\t\tchoice = {\n\t\t\t\t...choice,\n\t\t\t\tdisabled: true,\n\t\t\t\tinfo: __(\n\t\t\t\t\t'You can enable the visual editor in your profile settings.'\n\t\t\t\t),\n\t\t\t};\n\t\t}\n\t\tif ( choice.value !== selectedMode && ! choice.disabled ) {\n\t\t\treturn { ...choice, shortcut };\n\t\t}\n\t\treturn choice;\n\t} );\n\n\treturn (\n\t\t<MenuGroup label={ __( 'Editor' ) }>\n\t\t\t<MenuItemsChoice\n\t\t\t\tchoices={ choices }\n\t\t\t\tvalue={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D,MAAM;IAAEC;EAAiB,CAAC,GAAGrB,WAAW,CAAEI,aAAc,CAAC;EAEzD,IAAKQ,iBAAiB,EAAG;IACxB,OAAO,IAAI;EACZ;EAEA,IAAIU,YAAY,GAAGT,IAAI;EACvB,IAAK,CAAEH,oBAAoB,IAAIG,IAAI,KAAK,QAAQ,EAAG;IAClDS,YAAY,GAAG,MAAM;EACtB;EACA,IAAK,CAAEX,oBAAoB,IAAIE,IAAI,KAAK,MAAM,EAAG;IAChDS,YAAY,GAAG,QAAQ;EACxB;EAEA,MAAMC,OAAO,GAAGlB,KAAK,CAACmB,GAAG,CAAIC,MAAM,IAAM;IACxC,IAAK,CAAEd,oBAAoB,IAAIc,MAAM,CAACnB,KAAK,KAAK,MAAM,EAAG;MACxDmB,MAAM,GAAG;QACR,GAAGA,MAAM;QACTC,QAAQ,EAAE;MACX,CAAC;IACF;IACA,IAAK,CAAEhB,oBAAoB,IAAIe,MAAM,CAACnB,KAAK,KAAK,QAAQ,EAAG;MAC1DmB,MAAM,GAAG;QACR,GAAGA,MAAM;QACTC,QAAQ,EAAE,IAAI;QACdC,IAAI,EAAE/B,EAAE,CACP,4DACD;MACD,CAAC;IACF;IACA,IAAK6B,MAAM,CAACnB,KAAK,KAAKgB,YAAY,IAAI,CAAEG,MAAM,CAACC,QAAQ,EAAG;MACzD,OAAO;QAAE,GAAGD,MAAM;QAAEhB;MAAS,CAAC;IAC/B;IACA,OAAOgB,MAAM;EACd,CAAE,CAAC;EAEH,OACCG,aAAA,CAAC9B,SAAS;IAACS,KAAK,EAAGX,EAAE,CAAE,QAAS;EAAG,GAClCgC,aAAA,CAAC/B,eAAe;IACf0B,OAAO,EAAGA,OAAS;IACnBjB,KAAK,EAAGgB,YAAc;IACtBO,QAAQ,EAAGR;EAAkB,CAC7B,CACS,CAAC;AAEd;AAEA,eAAeb,YAAY"}
1
+ {"version":3,"names":["__","MenuItemsChoice","MenuGroup","useSelect","useDispatch","store","keyboardShortcutsStore","editorStore","editPostStore","MODES","value","label","ModeSwitcher","shortcut","isRichEditingEnabled","isCodeEditingEnabled","mode","select","getShortcutRepresentation","getEditorSettings","richEditingEnabled","codeEditingEnabled","getEditorMode","switchEditorMode","selectedMode","choices","map","choice","disabled","info","createElement","onSelect"],"sources":["@wordpress/edit-post/src/components/header/mode-switcher/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { MenuItemsChoice, MenuGroup } from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../../store';\n\n/**\n * Set of available mode options.\n *\n * @type {Array}\n */\nconst MODES = [\n\t{\n\t\tvalue: 'visual',\n\t\tlabel: __( 'Visual editor' ),\n\t},\n\t{\n\t\tvalue: 'text',\n\t\tlabel: __( 'Code editor' ),\n\t},\n];\n\nfunction ModeSwitcher() {\n\tconst { shortcut, isRichEditingEnabled, isCodeEditingEnabled, mode } =\n\t\tuseSelect(\n\t\t\t( select ) => ( {\n\t\t\t\tshortcut: select(\n\t\t\t\t\tkeyboardShortcutsStore\n\t\t\t\t).getShortcutRepresentation( 'core/edit-post/toggle-mode' ),\n\t\t\t\tisRichEditingEnabled:\n\t\t\t\t\tselect( editorStore ).getEditorSettings()\n\t\t\t\t\t\t.richEditingEnabled,\n\t\t\t\tisCodeEditingEnabled:\n\t\t\t\t\tselect( editorStore ).getEditorSettings()\n\t\t\t\t\t\t.codeEditingEnabled,\n\t\t\t\tmode: select( editPostStore ).getEditorMode(),\n\t\t\t} ),\n\t\t\t[]\n\t\t);\n\tconst { switchEditorMode } = useDispatch( editPostStore );\n\n\tlet selectedMode = mode;\n\tif ( ! isRichEditingEnabled && mode === 'visual' ) {\n\t\tselectedMode = 'text';\n\t}\n\tif ( ! isCodeEditingEnabled && mode === 'text' ) {\n\t\tselectedMode = 'visual';\n\t}\n\n\tconst choices = MODES.map( ( choice ) => {\n\t\tif ( ! isCodeEditingEnabled && choice.value === 'text' ) {\n\t\t\tchoice = {\n\t\t\t\t...choice,\n\t\t\t\tdisabled: true,\n\t\t\t};\n\t\t}\n\t\tif ( ! isRichEditingEnabled && choice.value === 'visual' ) {\n\t\t\tchoice = {\n\t\t\t\t...choice,\n\t\t\t\tdisabled: true,\n\t\t\t\tinfo: __(\n\t\t\t\t\t'You can enable the visual editor in your profile settings.'\n\t\t\t\t),\n\t\t\t};\n\t\t}\n\t\tif ( choice.value !== selectedMode && ! choice.disabled ) {\n\t\t\treturn { ...choice, shortcut };\n\t\t}\n\t\treturn choice;\n\t} );\n\n\treturn (\n\t\t<MenuGroup label={ __( 'Editor' ) }>\n\t\t\t<MenuItemsChoice\n\t\t\t\tchoices={ choices }\n\t\t\t\tvalue={ selectedMode }\n\t\t\t\tonSelect={ switchEditorMode }\n\t\t\t/>\n\t\t</MenuGroup>\n\t);\n}\n\nexport default ModeSwitcher;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,eAAe,EAAEC,SAAS,QAAQ,uBAAuB;AAClE,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,KAAK,IAAIC,sBAAsB,QAAQ,+BAA+B;AAC/E,SAASD,KAAK,IAAIE,WAAW,QAAQ,mBAAmB;;AAExD;AACA;AACA;AACA,SAASF,KAAK,IAAIG,aAAa,QAAQ,gBAAgB;;AAEvD;AACA;AACA;AACA;AACA;AACA,MAAMC,KAAK,GAAG,CACb;EACCC,KAAK,EAAE,QAAQ;EACfC,KAAK,EAAEX,EAAE,CAAE,eAAgB;AAC5B,CAAC,EACD;EACCU,KAAK,EAAE,MAAM;EACbC,KAAK,EAAEX,EAAE,CAAE,aAAc;AAC1B,CAAC,CACD;AAED,SAASY,YAAYA,CAAA,EAAG;EACvB,MAAM;IAAEC,QAAQ;IAAEC,oBAAoB;IA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d;MAAS,CAAC;IAC/B;IACA,OAAOc,MAAM;EACd,CAAE,CAAC;EAEH,OACCG,aAAA,CAAC5B,SAAS;IAACS,KAAK,EAAGX,EAAE,CAAE,QAAS;EAAG,GAClC8B,aAAA,CAAC7B,eAAe;IACfwB,OAAO,EAAGA,OAAS;IACnBf,KAAK,EAAGc,YAAc;IACtBO,QAAQ,EAAGR;EAAkB,CAC7B,CACS,CAAC;AAEd;AAEA,eAAeX,YAAY"}
@@ -17,22 +17,19 @@ const {
17
17
  } = unlock(componentsPrivateApis);
18
18
  const SettingsHeader = () => {
19
19
  const {
20
- documentLabel,
21
- isTemplateMode
20
+ documentLabel
22
21
  } = useSelect(select => {
23
22
  const {
24
- getPostTypeLabel,
25
- getRenderingMode
23
+ getPostTypeLabel
26
24
  } = select(editorStore);
27
25
  return {
28
26
  // translators: Default label for the Document sidebar tab, not selected.
29
- documentLabel: getPostTypeLabel() || _x('Document', 'noun'),
30
- isTemplateMode: getRenderingMode() === 'template-only'
27
+ documentLabel: getPostTypeLabel() || _x('Document', 'noun')
31
28
  };
32
29
  }, []);
33
30
  return createElement(Tabs.TabList, null, createElement(Tabs.Tab, {
34
31
  tabId: sidebars.document
35
- }, isTemplateMode ? __('Template') : documentLabel), createElement(Tabs.Tab, {
32
+ }, documentLabel), createElement(Tabs.Tab, {
36
33
  tabId: sidebars.block
37
34
  }, __('Block')));
38
35
  };
@@ -1 +1 @@
1
- {"version":3,"names":["privateApis","componentsPrivateApis","__","_x","useSelect","store","editorStore","unlock","sidebars","Tabs","SettingsHeader","documentLabel","isTemplateMode","select","getPostTypeLabel","getRenderingMode","createElement","TabList","Tab","tabId","document","block"],"sources":["@wordpress/edit-post/src/components/sidebar/settings-header/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { privateApis as componentsPrivateApis } from '@wordpress/components';\nimport { __, _x } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../../lock-unlock';\nimport { sidebars } from '../settings-sidebar';\n\nconst { Tabs } = unlock( componentsPrivateApis );\n\nconst SettingsHeader = () => {\n\tconst { documentLabel, isTemplateMode } = useSelect( ( select ) => {\n\t\tconst { getPostTypeLabel, getRenderingMode } = select( editorStore );\n\n\t\treturn {\n\t\t\t// translators: Default label for the Document sidebar tab, not selected.\n\t\t\tdocumentLabel: getPostTypeLabel() || _x( 'Document', 'noun' ),\n\t\t\tisTemplateMode: getRenderingMode() === 'template-only',\n\t\t};\n\t}, [] );\n\n\treturn (\n\t\t<Tabs.TabList>\n\t\t\t<Tabs.Tab tabId={ sidebars.document }>\n\t\t\t\t{ isTemplateMode ? __( 'Template' ) : documentLabel }\n\t\t\t</Tabs.Tab>\n\t\t\t<Tabs.Tab tabId={ sidebars.block }>\n\t\t\t\t{ /* translators: Text label for the Block Settings Sidebar tab. */ }\n\t\t\t\t{ __( 'Block' ) }\n\t\t\t</Tabs.Tab>\n\t\t</Tabs.TabList>\n\t);\n};\n\nexport default SettingsHeader;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,WAAW,IAAIC,qBAAqB,QAAQ,uBAAuB;AAC5E,SAASC,EAAE,EAAEC,EAAE,QAAQ,iBAAiB;AACxC,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,KAAK,IAAIC,WAAW,QAAQ,mBAAmB;;AAExD;AACA;AACA;AACA,SAASC,MAAM,QAAQ,sBAAsB;AAC7C,SAASC,QAAQ,QAAQ,qBAAqB;AAE9C,MAAM;EAAEC;AAAK,CAAC,GAAGF,MAAM,CAAEN,qBAAsB,CAAC;AAEhD,MAAMS,cAAc,GAAGA,CAAA,KAAM;EAC5B,MAAM;IAAEC,aAAa;IAAEC;EAAe,CAAC,GAAGR,SAAS,CAAIS,MAAM,IAAM;IAClE,MAAM;MAAEC,gBAAgB;MAAEC;IAAiB,CAAC,GAAGF,MAAM,CAAEP,WAAY,CAAC;IAEpE,OAAO;MACN;MACAK,aAAa,EAAEG,gBAAgB,CAAC,CAAC,IAAIX,EAAE,CAAE,UAAU,EAAE,MAAO,CAAC;MAC7DS,cAAc,EAAEG,gBAAgB,CAAC,CAAC,KAAK;IACxC,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EAEP,OACCC,aAAA,CAACP,IAAI,CAACQ,OAAO,QACZD,aAAA,CAACP,IAAI,CAACS,GAAG;IAACC,KAAK,EAAGX,QAAQ,CAACY;EAAU,GAClCR,cAAc,GAAGV,EAAE,CAAE,UAAW,CAAC,GAAGS,aAC7B,CAAC,EACXK,aAAA,CAACP,IAAI,CAACS,GAAG;IAACC,KAAK,EAAGX,QAAQ,CAACa;EAAO,GAE/BnB,EAAE,CAAE,OAAQ,CACL,CACG,CAAC;AAEjB,CAAC;AAED,eAAeQ,cAAc"}
1
+ {"version":3,"names":["privateApis","componentsPrivateApis","__","_x","useSelect","store","editorStore","unlock","sidebars","Tabs","SettingsHeader","documentLabel","select","getPostTypeLabel","createElement","TabList","Tab","tabId","document","block"],"sources":["@wordpress/edit-post/src/components/sidebar/settings-header/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { privateApis as componentsPrivateApis } from '@wordpress/components';\nimport { __, _x } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../../lock-unlock';\nimport { sidebars } from '../settings-sidebar';\n\nconst { Tabs } = unlock( componentsPrivateApis );\n\nconst SettingsHeader = () => {\n\tconst { documentLabel } = useSelect( ( select ) => {\n\t\tconst { getPostTypeLabel } = select( editorStore );\n\n\t\treturn {\n\t\t\t// translators: Default label for the Document sidebar tab, not selected.\n\t\t\tdocumentLabel: getPostTypeLabel() || _x( 'Document', 'noun' ),\n\t\t};\n\t}, [] );\n\n\treturn (\n\t\t<Tabs.TabList>\n\t\t\t<Tabs.Tab tabId={ sidebars.document }>{ documentLabel }</Tabs.Tab>\n\t\t\t<Tabs.Tab tabId={ sidebars.block }>\n\t\t\t\t{ /* translators: Text label for the Block Settings Sidebar tab. */ }\n\t\t\t\t{ __( 'Block' ) }\n\t\t\t</Tabs.Tab>\n\t\t</Tabs.TabList>\n\t);\n};\n\nexport default SettingsHeader;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,WAAW,IAAIC,qBAAqB,QAAQ,uBAAuB;AAC5E,SAASC,EAAE,EAAEC,EAAE,QAAQ,iBAAiB;AACxC,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,KAAK,IAAIC,WAAW,QAAQ,mBAAmB;;AAExD;AACA;AACA;AACA,SAASC,MAAM,QAAQ,sBAAsB;AAC7C,SAASC,QAAQ,QAAQ,qBAAqB;AAE9C,MAAM;EAAEC;AAAK,CAAC,GAAGF,MAAM,CAAEN,qBAAsB,CAAC;AAEhD,MAAMS,cAAc,GAAGA,CAAA,KAAM;EAC5B,MAAM;IAAEC;EAAc,CAAC,GAAGP,SAAS,CAAIQ,MAAM,IAAM;IAClD,MAAM;MAAEC;IAAiB,CAAC,GAAGD,MAAM,CAAEN,WAAY,CAAC;IAElD,OAAO;MACN;MACAK,aAAa,EAAEE,gBAAgB,CAAC,CAAC,IAAIV,EAAE,CAAE,UAAU,EAAE,MAAO;IAC7D,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EAEP,OACCW,aAAA,CAACL,IAAI,CAACM,OAAO,QACZD,aAAA,CAACL,IAAI,CAACO,GAAG;IAACC,KAAK,EAAGT,QAAQ,CAACU;EAAU,GAAGP,aAAyB,CAAC,EAClEG,aAAA,CAACL,IAAI,CAACO,GAAG;IAACC,KAAK,EAAGT,QAAQ,CAACW;EAAO,GAE/BjB,EAAE,CAAE,OAAQ,CACL,CACG,CAAC;AAEjB,CAAC;AAED,eAAeQ,cAAc"}
@@ -37,7 +37,7 @@ export const sidebars = {
37
37
  const SidebarContent = ({
38
38
  sidebarName,
39
39
  keyboardShortcut,
40
- isTemplateMode
40
+ isEditingTemplate
41
41
  }) => {
42
42
  // Because `PluginSidebarEditPost` renders a `ComplementaryArea`, we
43
43
  // need to forward the `Tabs` context so it can be passed through the
@@ -65,9 +65,9 @@ const SidebarContent = ({
65
65
  }, createElement(Tabs.TabPanel, {
66
66
  tabId: sidebars.document,
67
67
  focusable: false
68
- }, !isTemplateMode && createElement(Fragment, null, createElement(PostStatus, null), createElement(PluginDocumentSettingPanel.Slot, null), createElement(PostLastRevisionPanel, null), createElement(PostTaxonomiesPanel, null), createElement(PostFeaturedImagePanel, null), createElement(PostExcerptPanel, null), createElement(PostDiscussionPanel, null), createElement(PageAttributesPanel, null), createElement(MetaBoxes, {
68
+ }, !isEditingTemplate && createElement(Fragment, null, createElement(PostStatus, null), createElement(PluginDocumentSettingPanel.Slot, null), createElement(PostLastRevisionPanel, null), createElement(PostTaxonomiesPanel, null), createElement(PostFeaturedImagePanel, null), createElement(PostExcerptPanel, null), createElement(PostDiscussionPanel, null), createElement(PageAttributesPanel, null), createElement(MetaBoxes, {
69
69
  location: "side"
70
- })), isTemplateMode && createElement(TemplateSummary, null)), createElement(Tabs.TabPanel, {
70
+ })), isEditingTemplate && createElement(TemplateSummary, null)), createElement(Tabs.TabPanel, {
71
71
  tabId: sidebars.block,
72
72
  focusable: false
73
73
  }, createElement(BlockInspector, null))));
@@ -77,7 +77,7 @@ const SettingsSidebar = () => {
77
77
  sidebarName,
78
78
  isSettingsSidebarActive,
79
79
  keyboardShortcut,
80
- isTemplateMode
80
+ isEditingTemplate
81
81
  } = useSelect(select => {
82
82
  // The settings sidebar is used by the edit-post/document and edit-post/block sidebars.
83
83
  // sidebarName represents the sidebar that is active or that should be active when the SettingsSidebar toggle button is pressed.
@@ -100,7 +100,7 @@ const SettingsSidebar = () => {
100
100
  sidebarName: sidebar,
101
101
  isSettingsSidebarActive: isSettingsSidebar,
102
102
  keyboardShortcut: shortcut,
103
- isTemplateMode: select(editorStore).getRenderingMode() === 'template-only'
103
+ isEditingTemplate: select(editorStore).getCurrentPostType() === 'wp_template'
104
104
  };
105
105
  }, []);
106
106
  const {
@@ -123,7 +123,7 @@ const SettingsSidebar = () => {
123
123
  }, createElement(SidebarContent, {
124
124
  sidebarName: sidebarName,
125
125
  keyboardShortcut: keyboardShortcut,
126
- isTemplateMode: isTemplateMode
126
+ isEditingTemplate: isEditingTemplate
127
127
  }));
128
128
  };
129
129
  export default SettingsSidebar;
@@ -1 +1 @@
1
- {"version":3,"names":["BlockInspector","store","blockEditorStore","useSelect","useDispatch","Platform","useCallback","useContext","isRTL","__","drawerLeft","drawerRight","interfaceStore","keyboardShortcutsStore","editorStore","PageAttributesPanel","PostDiscussionPanel","PostExcerptPanel","PostFeaturedImagePanel","PostLastRevisionPanel","PostTaxonomiesPanel","SettingsHeader","PostStatus","MetaBoxes","PluginDocumentSettingPanel","PluginSidebarEditPost","TemplateSummary","editPostStore","privateApis","componentsPrivateApis","unlock","Tabs","SIDEBAR_ACTIVE_BY_DEFAULT","select","web","native","sidebars","document","block","SidebarContent","sidebarName","keyboardShortcut","isTemplateMode","tabsContextValue","Context","createElement","identifier","header","Provider","value","closeLabel","className","headerClassName","title","toggleShortcut","icon","isActiveByDefault","TabPanel","tabId","focusable","Fragment","Slot","location","SettingsSidebar","isSettingsSidebarActive","sidebar","getActiveComplementaryArea","name","isSettingsSidebar","includes","getBlockSelectionStart","shortcut","getShortcutRepresentation","getRenderingMode","openGeneralSidebar","onTabSelect","newSelectedTabId","selectedTabId","onSelect"],"sources":["@wordpress/edit-post/src/components/sidebar/settings-sidebar/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tBlockInspector,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { Platform, useCallback, useContext } from '@wordpress/element';\nimport { isRTL, __ } from '@wordpress/i18n';\nimport { drawerLeft, drawerRight } from '@wordpress/icons';\nimport { store as interfaceStore } from '@wordpress/interface';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\nimport {\n\tstore as editorStore,\n\tPageAttributesPanel,\n\tPostDiscussionPanel,\n\tPostExcerptPanel,\n\tPostFeaturedImagePanel,\n\tPostLastRevisionPanel,\n\tPostTaxonomiesPanel,\n} from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport SettingsHeader from '../settings-header';\nimport PostStatus from '../post-status';\nimport MetaBoxes from '../../meta-boxes';\nimport PluginDocumentSettingPanel from '../plugin-document-setting-panel';\nimport PluginSidebarEditPost from '../plugin-sidebar';\nimport TemplateSummary from '../template-summary';\nimport { store as editPostStore } from '../../../store';\nimport { privateApis as componentsPrivateApis } from '@wordpress/components';\nimport { unlock } from '../../../lock-unlock';\n\nconst { Tabs } = unlock( componentsPrivateApis );\n\nconst SIDEBAR_ACTIVE_BY_DEFAULT = Platform.select( {\n\tweb: true,\n\tnative: false,\n} );\nexport const sidebars = {\n\tdocument: 'edit-post/document',\n\tblock: 'edit-post/block',\n};\n\nconst SidebarContent = ( {\n\tsidebarName,\n\tkeyboardShortcut,\n\tisTemplateMode,\n} ) => {\n\t// Because `PluginSidebarEditPost` renders a `ComplementaryArea`, we\n\t// need to forward the `Tabs` context so it can be passed through the\n\t// underlying slot/fill.\n\tconst tabsContextValue = useContext( Tabs.Context );\n\n\treturn (\n\t\t<PluginSidebarEditPost\n\t\t\tidentifier={ sidebarName }\n\t\t\theader={\n\t\t\t\t<Tabs.Context.Provider value={ tabsContextValue }>\n\t\t\t\t\t<SettingsHeader />\n\t\t\t\t</Tabs.Context.Provider>\n\t\t\t}\n\t\t\tcloseLabel={ __( 'Close Settings' ) }\n\t\t\t// This classname is added so we can apply a corrective negative\n\t\t\t// margin to the panel.\n\t\t\t// see https://github.com/WordPress/gutenberg/pull/55360#pullrequestreview-1737671049\n\t\t\tclassName=\"edit-post-sidebar__panel\"\n\t\t\theaderClassName=\"edit-post-sidebar__panel-tabs\"\n\t\t\t/* translators: button label text should, if possible, be under 16 characters. */\n\t\t\ttitle={ __( 'Settings' ) }\n\t\t\ttoggleShortcut={ keyboardShortcut }\n\t\t\ticon={ isRTL() ? drawerLeft : drawerRight }\n\t\t\tisActiveByDefault={ SIDEBAR_ACTIVE_BY_DEFAULT }\n\t\t>\n\t\t\t<Tabs.Context.Provider value={ tabsContextValue }>\n\t\t\t\t<Tabs.TabPanel tabId={ sidebars.document } focusable={ false }>\n\t\t\t\t\t{ ! isTemplateMode && (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<PostStatus />\n\t\t\t\t\t\t\t<PluginDocumentSettingPanel.Slot />\n\t\t\t\t\t\t\t<PostLastRevisionPanel />\n\t\t\t\t\t\t\t<PostTaxonomiesPanel />\n\t\t\t\t\t\t\t<PostFeaturedImagePanel />\n\t\t\t\t\t\t\t<PostExcerptPanel />\n\t\t\t\t\t\t\t<PostDiscussionPanel />\n\t\t\t\t\t\t\t<PageAttributesPanel />\n\t\t\t\t\t\t\t<MetaBoxes location=\"side\" />\n\t\t\t\t\t\t</>\n\t\t\t\t\t) }\n\t\t\t\t\t{ isTemplateMode && <TemplateSummary /> }\n\t\t\t\t</Tabs.TabPanel>\n\t\t\t\t<Tabs.TabPanel tabId={ sidebars.block } focusable={ false }>\n\t\t\t\t\t<BlockInspector />\n\t\t\t\t</Tabs.TabPanel>\n\t\t\t</Tabs.Context.Provider>\n\t\t</PluginSidebarEditPost>\n\t);\n};\n\nconst SettingsSidebar = () => {\n\tconst {\n\t\tsidebarName,\n\t\tisSettingsSidebarActive,\n\t\tkeyboardShortcut,\n\t\tisTemplateMode,\n\t} = useSelect( ( select ) => {\n\t\t// The settings sidebar is used by the edit-post/document and edit-post/block sidebars.\n\t\t// sidebarName represents the sidebar that is active or that should be active when the SettingsSidebar toggle button is pressed.\n\t\t// If one of the two sidebars is active the component will contain the content of that sidebar.\n\t\t// When neither of the two sidebars is active we can not simply return null, because the PluginSidebarEditPost\n\t\t// component, besides being used to render the sidebar, also renders the toggle button. In that case sidebarName\n\t\t// should contain the sidebar that will be active when the toggle button is pressed. If a block\n\t\t// is selected, that should be edit-post/block otherwise it's edit-post/document.\n\t\tlet sidebar = select( interfaceStore ).getActiveComplementaryArea(\n\t\t\teditPostStore.name\n\t\t);\n\t\tlet isSettingsSidebar = true;\n\t\tif ( ! [ sidebars.document, sidebars.block ].includes( sidebar ) ) {\n\t\t\tisSettingsSidebar = false;\n\t\t\tif ( select( blockEditorStore ).getBlockSelectionStart() ) {\n\t\t\t\tsidebar = sidebars.block;\n\t\t\t}\n\t\t\tsidebar = sidebars.document;\n\t\t}\n\t\tconst shortcut = select(\n\t\t\tkeyboardShortcutsStore\n\t\t).getShortcutRepresentation( 'core/edit-post/toggle-sidebar' );\n\t\treturn {\n\t\t\tsidebarName: sidebar,\n\t\t\tisSettingsSidebarActive: isSettingsSidebar,\n\t\t\tkeyboardShortcut: shortcut,\n\t\t\tisTemplateMode:\n\t\t\t\tselect( editorStore ).getRenderingMode() === 'template-only',\n\t\t};\n\t}, [] );\n\n\tconst { openGeneralSidebar } = useDispatch( editPostStore );\n\n\tconst onTabSelect = useCallback(\n\t\t( newSelectedTabId ) => {\n\t\t\tif ( !! newSelectedTabId ) {\n\t\t\t\topenGeneralSidebar( newSelectedTabId );\n\t\t\t}\n\t\t},\n\t\t[ openGeneralSidebar ]\n\t);\n\n\treturn (\n\t\t<Tabs\n\t\t\t// Due to how this component is controlled (via a value from the\n\t\t\t// `interfaceStore`), when the sidebar closes the currently selected\n\t\t\t// tab can't be found. This causes the component to continuously reset\n\t\t\t// the selection to `null` in an infinite loop.Proactively setting\n\t\t\t// the selected tab to `null` avoids that.\n\t\t\tselectedTabId={ isSettingsSidebarActive ? sidebarName : null }\n\t\t\tonSelect={ onTabSelect }\n\t\t>\n\t\t\t<SidebarContent\n\t\t\t\tsidebarName={ sidebarName }\n\t\t\t\tkeyboardShortcut={ keyboardShortcut }\n\t\t\t\tisTemplateMode={ isTemplateMode }\n\t\t\t/>\n\t\t</Tabs>\n\t);\n};\n\nexport default SettingsSidebar;\n"],"mappings":";A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AAGtE,WAAW,CAAEuB,aAAc,CAAC;EAE3D,MAAMgD,WAAW,GAAGrE,WAAW,CAC5BsE,gBAAgB,IAAM;IACvB,IAAK,CAAC,CAAEA,gBAAgB,EAAG;MAC1BF,kBAAkB,CAAEE,gBAAiB,CAAC;IACvC;EACD,CAAC,EACD,CAAEF,kBAAkB,CACrB,CAAC;EAED,OACC7B,aAAA,CAACd;EACA;EACA;EACA;EACA;EACA;EAAA;IACA8C,aAAa,EAAGb,uBAAuB,GAAGxB,WAAW,GAAG,IAAM;IAC9DsC,QAAQ,EAAGH;EAAa,GAExB9B,aAAA,CAACN,cAAc;IACdC,WAAW,EAAGA,WAAa;IAC3BC,gBAAgB,EAAGA,gBAAkB;IACrCC,cAAc,EAAGA;EAAgB,CACjC,CACI,CAAC;AAET,CAAC;AAED,eAAeqB,eAAe"}
1
+ {"version":3,"names":["BlockInspector","store","blockEditorStore","useSelect","useDispatch","Platform","useCallback","useContext","isRTL","__","drawerLeft","drawerRight","interfaceStore","keyboardShortcutsStore","editorStore","PageAttributesPanel","PostDiscussionPanel","PostExcerptPanel","PostFeaturedImagePanel","PostLastRevisionPanel","PostTaxonomiesPanel","SettingsHeader","PostStatus","MetaBoxes","PluginDocumentSettingPanel","PluginSidebarEditPost","TemplateSummary","editPostStore","privateApis","componentsPrivateApis","unlock","Tabs","SIDEBAR_ACTIVE_BY_DEFAULT","select","web","native","sidebars","document","block","SidebarContent","sidebarName","keyboardShortcut","isEditingTemplate","tabsContextValue","Context","createElement","identifier","header","Provider","value","closeLabel","className","headerClassName","title","toggleShortcut","icon","isActiveByDefault","TabPanel","tabId","focusable","Fragment","Slot","location","SettingsSidebar","isSettingsSidebarActive","sidebar","getActiveComplementaryArea","name","isSettingsSidebar","includes","getBlockSelectionStart","shortcut","getShortcutRepresentation","getCurrentPostType","openGeneralSidebar","onTabSelect","newSelectedTabId","selectedTabId","onSelect"],"sources":["@wordpress/edit-post/src/components/sidebar/settings-sidebar/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tBlockInspector,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { Platform, useCallback, useContext } from '@wordpress/element';\nimport { isRTL, __ } from '@wordpress/i18n';\nimport { drawerLeft, drawerRight } from '@wordpress/icons';\nimport { store as interfaceStore } from '@wordpress/interface';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\nimport {\n\tstore as editorStore,\n\tPageAttributesPanel,\n\tPostDiscussionPanel,\n\tPostExcerptPanel,\n\tPostFeaturedImagePanel,\n\tPostLastRevisionPanel,\n\tPostTaxonomiesPanel,\n} from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport SettingsHeader from '../settings-header';\nimport PostStatus from '../post-status';\nimport MetaBoxes from '../../meta-boxes';\nimport PluginDocumentSettingPanel from '../plugin-document-setting-panel';\nimport PluginSidebarEditPost from '../plugin-sidebar';\nimport TemplateSummary from '../template-summary';\nimport { store as editPostStore } from '../../../store';\nimport { privateApis as componentsPrivateApis } from '@wordpress/components';\nimport { unlock } from '../../../lock-unlock';\n\nconst { Tabs } = unlock( componentsPrivateApis );\n\nconst SIDEBAR_ACTIVE_BY_DEFAULT = Platform.select( {\n\tweb: true,\n\tnative: false,\n} );\nexport const sidebars = {\n\tdocument: 'edit-post/document',\n\tblock: 'edit-post/block',\n};\n\nconst SidebarContent = ( {\n\tsidebarName,\n\tkeyboardShortcut,\n\tisEditingTemplate,\n} ) => {\n\t// Because `PluginSidebarEditPost` renders a `ComplementaryArea`, we\n\t// need to forward the `Tabs` context so it can be passed through the\n\t// underlying slot/fill.\n\tconst tabsContextValue = useContext( Tabs.Context );\n\n\treturn (\n\t\t<PluginSidebarEditPost\n\t\t\tidentifier={ sidebarName }\n\t\t\theader={\n\t\t\t\t<Tabs.Context.Provider value={ tabsContextValue }>\n\t\t\t\t\t<SettingsHeader />\n\t\t\t\t</Tabs.Context.Provider>\n\t\t\t}\n\t\t\tcloseLabel={ __( 'Close Settings' ) }\n\t\t\t// This classname is added so we can apply a corrective negative\n\t\t\t// margin to the panel.\n\t\t\t// see https://github.com/WordPress/gutenberg/pull/55360#pullrequestreview-1737671049\n\t\t\tclassName=\"edit-post-sidebar__panel\"\n\t\t\theaderClassName=\"edit-post-sidebar__panel-tabs\"\n\t\t\t/* translators: button label text should, if possible, be under 16 characters. */\n\t\t\ttitle={ __( 'Settings' ) }\n\t\t\ttoggleShortcut={ keyboardShortcut }\n\t\t\ticon={ isRTL() ? drawerLeft : drawerRight }\n\t\t\tisActiveByDefault={ SIDEBAR_ACTIVE_BY_DEFAULT }\n\t\t>\n\t\t\t<Tabs.Context.Provider value={ tabsContextValue }>\n\t\t\t\t<Tabs.TabPanel tabId={ sidebars.document } focusable={ false }>\n\t\t\t\t\t{ ! isEditingTemplate && (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<PostStatus />\n\t\t\t\t\t\t\t<PluginDocumentSettingPanel.Slot />\n\t\t\t\t\t\t\t<PostLastRevisionPanel />\n\t\t\t\t\t\t\t<PostTaxonomiesPanel />\n\t\t\t\t\t\t\t<PostFeaturedImagePanel />\n\t\t\t\t\t\t\t<PostExcerptPanel />\n\t\t\t\t\t\t\t<PostDiscussionPanel />\n\t\t\t\t\t\t\t<PageAttributesPanel />\n\t\t\t\t\t\t\t<MetaBoxes location=\"side\" />\n\t\t\t\t\t\t</>\n\t\t\t\t\t) }\n\t\t\t\t\t{ isEditingTemplate && <TemplateSummary /> }\n\t\t\t\t</Tabs.TabPanel>\n\t\t\t\t<Tabs.TabPanel tabId={ sidebars.block } focusable={ false }>\n\t\t\t\t\t<BlockInspector />\n\t\t\t\t</Tabs.TabPanel>\n\t\t\t</Tabs.Context.Provider>\n\t\t</PluginSidebarEditPost>\n\t);\n};\n\nconst SettingsSidebar = () => {\n\tconst {\n\t\tsidebarName,\n\t\tisSettingsSidebarActive,\n\t\tkeyboardShortcut,\n\t\tisEditingTemplate,\n\t} = useSelect( ( select ) => {\n\t\t// The settings sidebar is used by the edit-post/document and edit-post/block sidebars.\n\t\t// sidebarName represents the sidebar that is active or that should be active when the SettingsSidebar toggle button is pressed.\n\t\t// If one of the two sidebars is active the component will contain the content of that sidebar.\n\t\t// When neither of the two sidebars is active we can not simply return null, because the PluginSidebarEditPost\n\t\t// component, besides being used to render the sidebar, also renders the toggle button. In that case sidebarName\n\t\t// should contain the sidebar that will be active when the toggle button is pressed. If a block\n\t\t// is selected, that should be edit-post/block otherwise it's edit-post/document.\n\t\tlet sidebar = select( interfaceStore ).getActiveComplementaryArea(\n\t\t\teditPostStore.name\n\t\t);\n\t\tlet isSettingsSidebar = true;\n\t\tif ( ! [ sidebars.document, sidebars.block ].includes( sidebar ) ) {\n\t\t\tisSettingsSidebar = false;\n\t\t\tif ( select( blockEditorStore ).getBlockSelectionStart() ) {\n\t\t\t\tsidebar = sidebars.block;\n\t\t\t}\n\t\t\tsidebar = sidebars.document;\n\t\t}\n\t\tconst shortcut = select(\n\t\t\tkeyboardShortcutsStore\n\t\t).getShortcutRepresentation( 'core/edit-post/toggle-sidebar' );\n\t\treturn {\n\t\t\tsidebarName: sidebar,\n\t\t\tisSettingsSidebarActive: isSettingsSidebar,\n\t\t\tkeyboardShortcut: shortcut,\n\t\t\tisEditingTemplate:\n\t\t\t\tselect( editorStore ).getCurrentPostType() === 'wp_template',\n\t\t};\n\t}, [] );\n\n\tconst { openGeneralSidebar } = useDispatch( editPostStore );\n\n\tconst onTabSelect = useCallback(\n\t\t( newSelectedTabId ) => {\n\t\t\tif ( !! newSelectedTabId ) {\n\t\t\t\topenGeneralSidebar( newSelectedTabId );\n\t\t\t}\n\t\t},\n\t\t[ openGeneralSidebar ]\n\t);\n\n\treturn (\n\t\t<Tabs\n\t\t\t// Due to how this component is controlled (via a value from the\n\t\t\t// `interfaceStore`), when the sidebar closes the currently selected\n\t\t\t// tab can't be found. This causes the component to continuously reset\n\t\t\t// the selection to `null` in an infinite loop.Proactively setting\n\t\t\t// the selected tab to `null` avoids that.\n\t\t\tselectedTabId={ isSettingsSidebarActive ? sidebarName : null }\n\t\t\tonSelect={ onTabSelect }\n\t\t>\n\t\t\t<SidebarContent\n\t\t\t\tsidebarName={ sidebarName }\n\t\t\t\tkeyboardShortcut={ keyboardShortcut }\n\t\t\t\tisEditingTemplate={ isEditingTemplate }\n\t\t\t/>\n\t\t</Tabs>\n\t);\n};\n\nexport default SettingsSidebar;\n"],"mappings":";AAAA;AACA;AACA;AACA,SACCA,cAAc,EACdC,KAAK,IAAIC,gBAAgB,QACnB,yBAAyB;AAChC,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,QAAQ,EAAEC,WAAW,EAAEC,UAAU,QAAQ,oBAAoB;AACtE,SAASC,KAAK,EAAEC,EAAE,QAAQ,iBAAiB;AAC3C,SAASC,UAAU,EAAEC,WAAW,QAAQ,kBAAkB;AAC1D,SAASV,KAAK,IAAIW,cAAc,QAAQ,sBAAsB;AAC9D,SAASX,KAAK,IAAIY,sBAAsB,QAAQ,+BAA+B;AAC/E,SACCZ,KAAK,IAAIa,WAAW,EACpBC,mBAAmB,EACnBC,mBAAmB,EACnBC,gBAAgB,EAChBC,sBAAsB,EACtBC,qBAAqB,EACrBC,mBAAmB,QACb,mBAAmB;;AAE1B;AACA;AACA;AACA,OAAOC,cAAc,MAAM,oBAAoB;AAC/C,OAAOC,UAAU,MAAM,gBAAgB;AACvC,OAAOC,SAAS,MAAM,kBAAkB;AACxC,OAAOC,0BAA0B,MAAM,kCAAkC;AACzE,OAAOC,qBAAqB,MAAM,mBAAmB;AACrD,OAAOC,eAAe,MAAM,qBAAqB;AACjD,SAASzB,KAAK,IAAI0B,aAAa,QAAQ,gBAAgB;AACvD,SAASC,WAAW,IAAIC,qBAAqB,QAAQ,uBAAuB;AAC5E,SAASC,MAAM,QAAQ,sBAAsB;AAE7C,MAAM;EAAEC;AAAK,CAAC,GAAGD,MAAM,CAAED,qBAAsB,CAAC;AAEhD,M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yB,CAAE,+BAAgC,CAAC;IAC9D,OAAO;MACNhC,WAAW,EAAEyB,OAAO;MACpBD,uBAAuB,EAAEI,iBAAiB;MAC1C3B,gBAAgB,EAAE8B,QAAQ;MAC1B7B,iBAAiB,EAChBT,MAAM,CAAEnB,WAAY,CAAC,CAAC2D,kBAAkB,CAAC,CAAC,KAAK;IACjD,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EAEP,MAAM;IAAEC;EAAmB,CAAC,GAAGtE,WAAW,CAAEuB,aAAc,CAAC;EAE3D,MAAMgD,WAAW,GAAGrE,WAAW,CAC5BsE,gBAAgB,IAAM;IACvB,IAAK,CAAC,CAAEA,gBAAgB,EAAG;MAC1BF,kBAAkB,CAAEE,gBAAiB,CAAC;IACvC;EACD,CAAC,EACD,CAAEF,kBAAkB,CACrB,CAAC;EAED,OACC7B,aAAA,CAACd;EACA;EACA;EACA;EACA;EACA;EAAA;IACA8C,aAAa,EAAGb,uBAAuB,GAAGxB,WAAW,GAAG,IAAM;IAC9DsC,QAAQ,EAAGH;EAAa,GAExB9B,aAAA,CAACN,cAAc;IACdC,WAAW,EAAGA,WAAa;IAC3BC,gBAAgB,EAAGA,gBAAkB;IACrCC,iBAAiB,EAAGA;EAAmB,CACvC,CACI,CAAC;AAET,CAAC;AAED,eAAeqB,eAAe"}
@@ -5,17 +5,13 @@ import { createElement } from "react";
5
5
  import { Icon, layout } from '@wordpress/icons';
6
6
  import { useSelect } from '@wordpress/data';
7
7
  import { Flex, FlexItem, FlexBlock, PanelBody } from '@wordpress/components';
8
-
9
- /**
10
- * Internal dependencies
11
- */
12
- import { store as editPostStore } from '../../../store';
8
+ import { store as editorStore } from '@wordpress/editor';
13
9
  function TemplateSummary() {
14
10
  const template = useSelect(select => {
15
11
  const {
16
- getEditedPostTemplate
17
- } = select(editPostStore);
18
- return getEditedPostTemplate();
12
+ getCurrentPost
13
+ } = select(editorStore);
14
+ return getCurrentPost();
19
15
  }, []);
20
16
  if (!template) {
21
17
  return null;
@@ -1 +1 @@
1
- {"version":3,"names":["Icon","layout","useSelect","Flex","FlexItem","FlexBlock","PanelBody","store","editPostStore","TemplateSummary","template","select","getEditedPostTemplate","createElement","align","gap","icon","className","title","slug","description"],"sources":["@wordpress/edit-post/src/components/sidebar/template-summary/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Icon, layout } from '@wordpress/icons';\nimport { useSelect } from '@wordpress/data';\nimport { Flex, FlexItem, FlexBlock, PanelBody } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../../store';\n\nfunction TemplateSummary() {\n\tconst template = useSelect( ( select ) => {\n\t\tconst { getEditedPostTemplate } = select( editPostStore );\n\t\treturn getEditedPostTemplate();\n\t}, [] );\n\n\tif ( ! template ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PanelBody>\n\t\t\t<Flex align=\"flex-start\" gap=\"3\">\n\t\t\t\t<FlexItem>\n\t\t\t\t\t<Icon icon={ layout } />\n\t\t\t\t</FlexItem>\n\n\t\t\t\t<FlexBlock>\n\t\t\t\t\t<h2 className=\"edit-post-template-summary__title\">\n\t\t\t\t\t\t{ template?.title || template?.slug }\n\t\t\t\t\t</h2>\n\t\t\t\t\t<p>{ template?.description }</p>\n\t\t\t\t</FlexBlock>\n\t\t\t</Flex>\n\t\t</PanelBody>\n\t);\n}\n\nexport default TemplateSummary;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,IAAI,EAAEC,MAAM,QAAQ,kBAAkB;AAC/C,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,IAAI,EAAEC,QAAQ,EAAEC,SAAS,EAAEC,SAAS,QAAQ,uBAAuB;;AAE5E;AACA;AACA;AACA,SAASC,KAAK,IAAIC,aAAa,QAAQ,gBAAgB;AAEvD,SAASC,eAAeA,CAAA,EAAG;EAC1B,MAAMC,QAAQ,GAAGR,SAAS,CAAIS,MAAM,IAAM;IACzC,MAAM;MAAEC;IAAsB,CAAC,GAAGD,MAAM,CAAEH,aAAc,CAAC;IACzD,OAAOI,qBAAqB,CAAC,CAAC;EAC/B,CAAC,EAAE,EAAG,CAAC;EAEP,IAAK,CAAEF,QAAQ,EAAG;IACjB,OAAO,IAAI;EACZ;EAEA,OACCG,aAAA,CAACP,SAAS,QACTO,aAAA,CAACV,IAAI;IAACW,KAAK,EAAC,YAAY;IAACC,GAAG,EAAC;EAAG,GAC/BF,aAAA,CAACT,QAAQ,QACRS,aAAA,CAACb,IAAI;IAACgB,IAAI,EAAGf;EAAQ,CAAE,CACd,CAAC,EAEXY,aAAA,CAACR,SAAS,QACTQ,aAAA;IAAII,SAAS,EAAC;EAAmC,GAC9CP,QAAQ,EAAEQ,KAAK,IAAIR,QAAQ,EAAES,IAC5B,CAAC,EACLN,aAAA,YAAKH,QAAQ,EAAEU,WAAgB,CACrB,CACN,CACI,CAAC;AAEd;AAEA,eAAeX,eAAe"}
1
+ {"version":3,"names":["Icon","layout","useSelect","Flex","FlexItem","FlexBlock","PanelBody","store","editorStore","TemplateSummary","template","select","getCurrentPost","createElement","align","gap","icon","className","title","slug","description"],"sources":["@wordpress/edit-post/src/components/sidebar/template-summary/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Icon, layout } from '@wordpress/icons';\nimport { useSelect } from '@wordpress/data';\nimport { Flex, FlexItem, FlexBlock, PanelBody } from '@wordpress/components';\nimport { store as editorStore } from '@wordpress/editor';\n\nfunction TemplateSummary() {\n\tconst template = useSelect( ( select ) => {\n\t\tconst { getCurrentPost } = select( editorStore );\n\t\treturn getCurrentPost();\n\t}, [] );\n\n\tif ( ! template ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PanelBody>\n\t\t\t<Flex align=\"flex-start\" gap=\"3\">\n\t\t\t\t<FlexItem>\n\t\t\t\t\t<Icon icon={ layout } />\n\t\t\t\t</FlexItem>\n\n\t\t\t\t<FlexBlock>\n\t\t\t\t\t<h2 className=\"edit-post-template-summary__title\">\n\t\t\t\t\t\t{ template?.title || template?.slug }\n\t\t\t\t\t</h2>\n\t\t\t\t\t<p>{ template?.description }</p>\n\t\t\t\t</FlexBlock>\n\t\t\t</Flex>\n\t\t</PanelBody>\n\t);\n}\n\nexport default TemplateSummary;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,IAAI,EAAEC,MAAM,QAAQ,kBAAkB;AAC/C,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,IAAI,EAAEC,QAAQ,EAAEC,SAAS,EAAEC,SAAS,QAAQ,uBAAuB;AAC5E,SAASC,KAAK,IAAIC,WAAW,QAAQ,mBAAmB;AAExD,SAASC,eAAeA,CAAA,EAAG;EAC1B,MAAMC,QAAQ,GAAGR,SAAS,CAAIS,MAAM,IAAM;IACzC,MAAM;MAAEC;IAAe,CAAC,GAAGD,MAAM,CAAEH,WAAY,CAAC;IAChD,OAAOI,cAAc,CAAC,CAAC;EACxB,CAAC,EAAE,EAAG,CAAC;EAEP,IAAK,CAAEF,QAAQ,EAAG;IACjB,OAAO,IAAI;EACZ;EAEA,OACCG,aAAA,CAACP,SAAS,QACTO,aAAA,CAACV,IAAI;IAACW,KAAK,EAAC,YAAY;IAACC,GAAG,EAAC;EAAG,GAC/BF,aAAA,CAACT,QAAQ,QACRS,aAAA,CAACb,IAAI;IAACgB,IAAI,EAAGf;EAAQ,CAAE,CACd,CAAC,EAEXY,aAAA,CAACR,SAAS,QACTQ,aAAA;IAAII,SAAS,EAAC;EAAmC,GAC9CP,QAAQ,EAAEQ,KAAK,IAAIR,QAAQ,EAAES,IAC5B,CAAC,EACLN,aAAA,YAAKH,QAAQ,EAAEU,WAAgB,CACrB,CACN,CACI,CAAC;AAEd;AAEA,eAAeX,eAAe"}