@wordpress/edit-post 7.13.0 → 7.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/components/header/header-toolbar/index.js +7 -1
  3. package/build/components/header/header-toolbar/index.js.map +1 -1
  4. package/build/components/header/index.js +25 -24
  5. package/build/components/header/index.js.map +1 -1
  6. package/build/components/header/preferences-menu-item/index.js +5 -3
  7. package/build/components/header/preferences-menu-item/index.js.map +1 -1
  8. package/build/components/keyboard-shortcut-help-modal/index.js +8 -6
  9. package/build/components/keyboard-shortcut-help-modal/index.js.map +1 -1
  10. package/build/components/keyboard-shortcuts/index.js +0 -2
  11. package/build/components/keyboard-shortcuts/index.js.map +1 -1
  12. package/build/components/layout/index.js +11 -1
  13. package/build/components/layout/index.js.map +1 -1
  14. package/build/components/preferences-modal/index.js +5 -3
  15. package/build/components/preferences-modal/index.js.map +1 -1
  16. package/build/components/sidebar/post-status/index.js +2 -1
  17. package/build/components/sidebar/post-status/index.js.map +1 -1
  18. package/build/components/sidebar/post-trash/index.js +1 -5
  19. package/build/components/sidebar/post-trash/index.js.map +1 -1
  20. package/build/editor.js +3 -0
  21. package/build/editor.js.map +1 -1
  22. package/build/hooks/commands/use-common-commands.js +176 -0
  23. package/build/hooks/commands/use-common-commands.js.map +1 -0
  24. package/build/plugins/keyboard-shortcuts-help-menu-item/index.js +5 -3
  25. package/build/plugins/keyboard-shortcuts-help-menu-item/index.js.map +1 -1
  26. package/build/store/actions.js +31 -15
  27. package/build/store/actions.js.map +1 -1
  28. package/build/store/reducer.js +0 -23
  29. package/build/store/reducer.js.map +1 -1
  30. package/build/store/selectors.js +11 -7
  31. package/build/store/selectors.js.map +1 -1
  32. package/build-module/components/header/header-toolbar/index.js +6 -1
  33. package/build-module/components/header/header-toolbar/index.js.map +1 -1
  34. package/build-module/components/header/index.js +24 -24
  35. package/build-module/components/header/index.js.map +1 -1
  36. package/build-module/components/header/preferences-menu-item/index.js +4 -3
  37. package/build-module/components/header/preferences-menu-item/index.js.map +1 -1
  38. package/build-module/components/keyboard-shortcut-help-modal/index.js +5 -5
  39. package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -1
  40. package/build-module/components/keyboard-shortcuts/index.js +0 -2
  41. package/build-module/components/keyboard-shortcuts/index.js.map +1 -1
  42. package/build-module/components/layout/index.js +11 -2
  43. package/build-module/components/layout/index.js.map +1 -1
  44. package/build-module/components/preferences-modal/index.js +4 -4
  45. package/build-module/components/preferences-modal/index.js.map +1 -1
  46. package/build-module/components/sidebar/post-status/index.js +2 -1
  47. package/build-module/components/sidebar/post-status/index.js.map +1 -1
  48. package/build-module/components/sidebar/post-trash/index.js +1 -4
  49. package/build-module/components/sidebar/post-trash/index.js.map +1 -1
  50. package/build-module/editor.js +2 -0
  51. package/build-module/editor.js.map +1 -1
  52. package/build-module/hooks/commands/use-common-commands.js +160 -0
  53. package/build-module/hooks/commands/use-common-commands.js.map +1 -0
  54. package/build-module/plugins/keyboard-shortcuts-help-menu-item/index.js +4 -3
  55. package/build-module/plugins/keyboard-shortcuts-help-menu-item/index.js.map +1 -1
  56. package/build-module/store/actions.js +24 -11
  57. package/build-module/store/actions.js.map +1 -1
  58. package/build-module/store/reducer.js +0 -21
  59. package/build-module/store/reducer.js.map +1 -1
  60. package/build-module/store/selectors.js +9 -3
  61. package/build-module/store/selectors.js.map +1 -1
  62. package/build-style/style-rtl.css +1 -2
  63. package/build-style/style.css +1 -2
  64. package/package.json +32 -32
  65. package/src/components/block-manager/style.scss +1 -1
  66. package/src/components/header/header-toolbar/index.js +4 -1
  67. package/src/components/header/index.js +10 -10
  68. package/src/components/header/preferences-menu-item/index.js +4 -3
  69. package/src/components/keyboard-shortcut-help-modal/index.js +10 -5
  70. package/src/components/keyboard-shortcuts/index.js +0 -2
  71. package/src/components/layout/index.js +14 -1
  72. package/src/components/preferences-modal/index.js +6 -4
  73. package/src/components/preferences-modal/test/__snapshots__/index.js.snap +1 -1
  74. package/src/components/sidebar/post-status/index.js +1 -0
  75. package/src/components/sidebar/post-trash/index.js +1 -4
  76. package/src/components/start-page-options/style.scss +0 -3
  77. package/src/editor.js +2 -0
  78. package/src/hooks/commands/use-common-commands.js +155 -0
  79. package/src/plugins/keyboard-shortcuts-help-menu-item/index.js +4 -3
  80. package/src/store/actions.js +22 -9
  81. package/src/store/reducer.js +0 -20
  82. package/src/store/selectors.js +11 -3
  83. package/src/store/test/reducer.js +0 -25
  84. package/src/store/test/selectors.js +0 -27
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-post/src/components/preferences-modal/index.js"],"names":["MODAL_NAME","EditPostPreferencesModal","isLargeViewport","closeModal","editPostStore","isModalActive","showBlockBreadcrumbsOption","select","getEditorSettings","editorStore","getEditorMode","isFeatureActive","modalActive","mode","isRichEditingEnabled","richEditingEnabled","isDistractionFreeEnabled","closeGeneralSidebar","setIsListViewOpened","setIsInserterOpened","set","setPreference","preferencesStore","toggleDistractionFree","sections","name","tabLabel","content","taxonomy","labels","menu_name","slug"],"mappings":";;;;;;;;;AAOA;;AAHA;;AACA;;AACA;;AAEA;;AAQA;;AAKA;;AAMA;;AAMA;;AACA;;AACA;;AAnCA;AACA;AACA;;AAqBA;AACA;AACA;AAYA,MAAMA,UAAU,GAAG,uBAAnB;;AAEe,SAASC,wBAAT,GAAoC;AAClD,QAAMC,eAAe,GAAG,+BAAkB,QAAlB,CAAxB;AACA,QAAM;AAAEC,IAAAA;AAAF,MAAiB,uBAAaC,YAAb,CAAvB;AACA,QAAM,CAAEC,aAAF,EAAiBC,0BAAjB,IAAgD,qBACnDC,MAAF,IAAc;AACb,UAAM;AAAEC,MAAAA;AAAF,QAAwBD,MAAM,CAAEE,aAAF,CAApC;AACA,UAAM;AAAEC,MAAAA,aAAF;AAAiBC,MAAAA;AAAjB,QAAqCJ,MAAM,CAAEH,YAAF,CAAjD;AACA,UAAMQ,WAAW,GAChBL,MAAM,CAAE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4BAAC,2BAAD,QACC,4BAAC,0BAAD;AACC,MAAA,KAAK,EAAG,cAAI,iBAAJ,CADT;AAEC,MAAA,SAAS,EAAC;AAFX,MADD,CAnCD,CADD,EA2CC,4BAAC,yBAAD;AACC,MAAA,KAAK,EAAG,cAAI,YAAJ,CADT;AAEC,MAAA,WAAW,EAAG,cACb,gCADa;AAFf,MA3CD;AAJF,GAtHK,CADU,EAgLhB,CAAE7B,eAAF,EAAmBI,0BAAnB,CAhLgB,CAAjB;;AAmLA,MAAK,CAAED,aAAP,EAAuB;AACtB,WAAO,IAAP;AACA;;AAED,SACC,4BAAC,2BAAD;AAAkB,IAAA,UAAU,EAAGF;AAA/B,KACC,4BAAC,+BAAD;AAAsB,IAAA,QAAQ,EAAGqB;AAAjC,IADD,CADD;AAKA","sourcesContent":["/**\n * WordPress dependencies\n */\n\nimport { __ } from '@wordpress/i18n';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useMemo } from '@wordpress/element';\nimport {\n\tPostTaxonomies,\n\tPostExcerptCheck,\n\tPageAttributesCheck,\n\tPostFeaturedImageCheck,\n\tPostTypeSupportCheck,\n\tstore as editorStore,\n} from '@wordpress/editor';\nimport {\n\tPreferencesModal,\n\tPreferencesModalTabs,\n\tPreferencesModalSection,\n} from '@wordpress/interface';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\n\nimport {\n\tEnablePluginDocumentSettingPanelOption,\n\tEnablePublishSidebarOption,\n\tEnablePanelOption,\n\tEnableFeature,\n} from './options';\nimport MetaBoxesSection from './meta-boxes-section';\nimport { store as editPostStore } from '../../store';\nimport BlockManager from '../block-manager';\n\nconst MODAL_NAME = 'edit-post/preferences';\n\nexport default function EditPostPreferencesModal() {\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst { closeModal } = useDispatch( editPostStore );\n\tconst [ isModalActive, showBlockBreadcrumbsOption ] = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEditorSettings } = select( editorStore );\n\t\t\tconst { getEditorMode, isFeatureActive } = select( editPostStore );\n\t\t\tconst modalActive =\n\t\t\t\tselect( editPostStore ).isModalActive( MODAL_NAME );\n\t\t\tconst mode = getEditorMode();\n\t\t\tconst isRichEditingEnabled = getEditorSettings().richEditingEnabled;\n\t\t\tconst isDistractionFreeEnabled =\n\t\t\t\tisFeatureActive( 'distractionFree' );\n\t\t\treturn [\n\t\t\t\tmodalActive,\n\t\t\t\t! isDistractionFreeEnabled &&\n\t\t\t\t\tisLargeViewport &&\n\t\t\t\t\tisRichEditingEnabled &&\n\t\t\t\t\tmode === 'visual',\n\t\t\t\tisDistractionFreeEnabled,\n\t\t\t];\n\t\t},\n\t\t[ isLargeViewport ]\n\t);\n\n\tconst { closeGeneralSidebar, setIsListViewOpened, setIsInserterOpened } =\n\t\tuseDispatch( editPostStore );\n\n\tconst { set: setPreference } = useDispatch( preferencesStore );\n\n\tconst toggleDistractionFree = () => {\n\t\tsetPreference( 'core/edit-post', 'fixedToolbar', false );\n\t\tsetIsInserterOpened( false );\n\t\tsetIsListViewOpened( false );\n\t\tcloseGeneralSidebar();\n\t};\n\n\tconst sections = useMemo(\n\t\t() => [\n\t\t\t{\n\t\t\t\tname: 'general',\n\t\t\t\ttabLabel: __( 'General' ),\n\t\t\t\tcontent: (\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ isLargeViewport && (\n\t\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\t\ttitle={ __( 'Publishing' ) }\n\t\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t\t'Change options related to publishing.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<EnablePublishSidebarOption\n\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t'Review settings, such as visibility and tags.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tlabel={ __(\n\t\t\t\t\t\t\t\t\t\t'Include pre-publish checklist'\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</PreferencesModalSection>\n\t\t\t\t\t\t) }\n\n\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\ttitle={ __( 'Appearance' ) }\n\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t'Customize options related to the block editor interface and editing flow.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\tfeatureName=\"distractionFree\"\n\t\t\t\t\t\t\t\tonToggle={ toggleDistractionFree }\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Reduce visual distractions by hiding the toolbar and other elements to focus on writing.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __( 'Distraction free' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\tfeatureName=\"focusMode\"\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Highlights the current block and fades other content.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __( 'Spotlight mode' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\tfeatureName=\"showIconLabels\"\n\t\t\t\t\t\t\t\tlabel={ __( 'Show button text labels' ) }\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Show text instead of icons on buttons.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\tfeatureName=\"showListViewByDefault\"\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Opens the block list view sidebar by default.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __( 'Always open list view' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\tfeatureName=\"themeStyles\"\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Make the editor look like your theme.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __( 'Use theme styles' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t{ showBlockBreadcrumbsOption && (\n\t\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\t\tfeatureName=\"showBlockBreadcrumbs\"\n\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t'Shows block breadcrumbs at the bottom of the editor.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Display block breadcrumbs' ) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t</>\n\t\t\t\t),\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'blocks',\n\t\t\t\ttabLabel: __( 'Blocks' ),\n\t\t\t\tcontent: (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\ttitle={ __( 'Block interactions' ) }\n\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t'Customize how you interact with blocks in the block library and editing canvas.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\tfeatureName=\"mostUsedBlocks\"\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Places the most frequent blocks in the block library.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __( 'Show most used blocks' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\tfeatureName=\"keepCaretInsideBlock\"\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Aids screen readers by stopping text caret from leaving blocks.'\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\t'Contain text cursor inside block'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\ttitle={ __( 'Visible blocks' ) }\n\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t\"Disable blocks that you don't want to appear in the inserter. They can always be toggled back on later.\"\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<BlockManager />\n\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t</>\n\t\t\t\t),\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'panels',\n\t\t\t\ttabLabel: __( 'Panels' ),\n\t\t\t\tcontent: (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\ttitle={ __( 'Document settings' ) }\n\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t'Choose what displays in the panel.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<EnablePluginDocumentSettingPanelOption.Slot />\n\t\t\t\t\t\t\t<PostTaxonomies\n\t\t\t\t\t\t\t\ttaxonomyWrapper={ ( content, taxonomy ) => (\n\t\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\t\tlabel={ taxonomy.labels.menu_name }\n\t\t\t\t\t\t\t\t\t\tpanelName={ `taxonomy-panel-${ taxonomy.slug }` }\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/>\n\t\t\t\t\t\t\t<PostFeaturedImageCheck>\n\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Featured image' ) }\n\t\t\t\t\t\t\t\t\tpanelName=\"featured-image\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PostFeaturedImageCheck>\n\t\t\t\t\t\t\t<PostExcerptCheck>\n\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Excerpt' ) }\n\t\t\t\t\t\t\t\t\tpanelName=\"post-excerpt\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PostExcerptCheck>\n\t\t\t\t\t\t\t<PostTypeSupportCheck\n\t\t\t\t\t\t\t\tsupportKeys={ [ 'comments', 'trackbacks' ] }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Discussion' ) }\n\t\t\t\t\t\t\t\t\tpanelName=\"discussion-panel\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PostTypeSupportCheck>\n\t\t\t\t\t\t\t<PageAttributesCheck>\n\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Page attributes' ) }\n\t\t\t\t\t\t\t\t\tpanelName=\"page-attributes\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PageAttributesCheck>\n\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t\t<MetaBoxesSection\n\t\t\t\t\t\t\ttitle={ __( 'Additional' ) }\n\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t'Add extra areas to the editor.'\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},\n\t\t],\n\t\t[ isLargeViewport, showBlockBreadcrumbsOption ]\n\t);\n\n\tif ( ! isModalActive ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PreferencesModal closeModal={ closeModal }>\n\t\t\t<PreferencesModalTabs sections={ sections } />\n\t\t</PreferencesModal>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-post/src/components/preferences-modal/index.js"],"names":["PREFERENCES_MODAL_NAME","EditPostPreferencesModal","isLargeViewport","closeModal","interfaceStore","isModalActive","showBlockBreadcrumbsOption","select","getEditorSettings","editorStore","getEditorMode","isFeatureActive","editPostStore","modalActive","mode","isRichEditingEnabled","richEditingEnabled","isDistractionFreeEnabled","closeGeneralSidebar","setIsListViewOpened","setIsInserterOpened","set","setPreference","preferencesStore","toggleDistractionFree","sections","name","tabLabel","content","taxonomy","labels","menu_name","slug"],"mappings":";;;;;;;;;;AAOA;;AAHA;;AACA;;AACA;;AAEA;;AAQA;;AAMA;;AAMA;;AAMA;;AACA;;AACA;;AApCA;AACA;AACA;;AAsBA;AACA;AACA;AAYO,MAAMA,sBAAsB,GAAG,uBAA/B;;;AAEQ,SAASC,wBAAT,GAAoC;AAClD,QAAMC,eAAe,GAAG,+BAAkB,QAAlB,CAAxB;AACA,QAAM;AAAEC,IAAAA;AAAF,MAAiB,uBAAaC,gBAAb,CAAvB;AACA,QAAM,CAAEC,aAAF,EAAiBC,0BAAjB,IAAgD,qBACnDC,MAAF,IAAc;AACb,UAAM;AAAEC,MAAAA;AAAF,QAAwBD,MAAM,CAAEE,aAAF,CAApC;AACA,UAAM;AAAEC,MAAAA,aAAF;AAAiBC,MAAAA;AAAjB,QAAqCJ,MAAM,CAAEK,YAAF,CAAjD;AACA,UAAMC,WAAW,GAAGN,MAAM,CAAEH,gBAAF,CAAN,CAAyBC,aAAzB,CACnBL,sBADmB,CAApB;AAGA,UAAMc,IAAI,GAAGJ,aAAa,EAA1B;AACA,UAAMK,oBAAoB,GAAGP,iBAAiB,GAAGQ,kBAAjD;AACA,UAAMC,wBAAwB,GAC7BN,eAAe,CAAE,iBAAF,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AAA,WAAW,EAAG,cACb,gCADa;AAFf,MA3CD;AAJF,GAtHK,CADU,EAgLhB,CAAE9B,eAAF,EAAmBI,0BAAnB,CAhLgB,CAAjB;;AAmLA,MAAK,CAAED,aAAP,EAAuB;AACtB,WAAO,IAAP;AACA;;AAED,SACC,4BAAC,2BAAD;AAAkB,IAAA,UAAU,EAAGF;AAA/B,KACC,4BAAC,+BAAD;AAAsB,IAAA,QAAQ,EAAGsB;AAAjC,IADD,CADD;AAKA","sourcesContent":["/**\n * WordPress dependencies\n */\n\nimport { __ } from '@wordpress/i18n';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useMemo } from '@wordpress/element';\nimport {\n\tPostTaxonomies,\n\tPostExcerptCheck,\n\tPageAttributesCheck,\n\tPostFeaturedImageCheck,\n\tPostTypeSupportCheck,\n\tstore as editorStore,\n} from '@wordpress/editor';\nimport {\n\tPreferencesModal,\n\tPreferencesModalTabs,\n\tPreferencesModalSection,\n\tstore as interfaceStore,\n} from '@wordpress/interface';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\n\nimport {\n\tEnablePluginDocumentSettingPanelOption,\n\tEnablePublishSidebarOption,\n\tEnablePanelOption,\n\tEnableFeature,\n} from './options';\nimport MetaBoxesSection from './meta-boxes-section';\nimport { store as editPostStore } from '../../store';\nimport BlockManager from '../block-manager';\n\nexport const PREFERENCES_MODAL_NAME = 'edit-post/preferences';\n\nexport default function EditPostPreferencesModal() {\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst { closeModal } = useDispatch( interfaceStore );\n\tconst [ isModalActive, showBlockBreadcrumbsOption ] = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEditorSettings } = select( editorStore );\n\t\t\tconst { getEditorMode, isFeatureActive } = select( editPostStore );\n\t\t\tconst modalActive = select( interfaceStore ).isModalActive(\n\t\t\t\tPREFERENCES_MODAL_NAME\n\t\t\t);\n\t\t\tconst mode = getEditorMode();\n\t\t\tconst isRichEditingEnabled = getEditorSettings().richEditingEnabled;\n\t\t\tconst isDistractionFreeEnabled =\n\t\t\t\tisFeatureActive( 'distractionFree' );\n\t\t\treturn [\n\t\t\t\tmodalActive,\n\t\t\t\t! isDistractionFreeEnabled &&\n\t\t\t\t\tisLargeViewport &&\n\t\t\t\t\tisRichEditingEnabled &&\n\t\t\t\t\tmode === 'visual',\n\t\t\t\tisDistractionFreeEnabled,\n\t\t\t];\n\t\t},\n\t\t[ isLargeViewport ]\n\t);\n\n\tconst { closeGeneralSidebar, setIsListViewOpened, setIsInserterOpened } =\n\t\tuseDispatch( editPostStore );\n\n\tconst { set: setPreference } = useDispatch( preferencesStore );\n\n\tconst toggleDistractionFree = () => {\n\t\tsetPreference( 'core/edit-post', 'fixedToolbar', false );\n\t\tsetIsInserterOpened( false );\n\t\tsetIsListViewOpened( false );\n\t\tcloseGeneralSidebar();\n\t};\n\n\tconst sections = useMemo(\n\t\t() => [\n\t\t\t{\n\t\t\t\tname: 'general',\n\t\t\t\ttabLabel: __( 'General' ),\n\t\t\t\tcontent: (\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ isLargeViewport && (\n\t\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\t\ttitle={ __( 'Publishing' ) }\n\t\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t\t'Change options related to publishing.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<EnablePublishSidebarOption\n\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t'Review settings, such as visibility and tags.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tlabel={ __(\n\t\t\t\t\t\t\t\t\t\t'Include pre-publish checklist'\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</PreferencesModalSection>\n\t\t\t\t\t\t) }\n\n\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\ttitle={ __( 'Appearance' ) }\n\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t'Customize options related to the block editor interface and editing flow.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\tfeatureName=\"distractionFree\"\n\t\t\t\t\t\t\t\tonToggle={ toggleDistractionFree }\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Reduce visual distractions by hiding the toolbar and other elements to focus on writing.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __( 'Distraction free' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\tfeatureName=\"focusMode\"\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Highlights the current block and fades other content.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __( 'Spotlight mode' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\tfeatureName=\"showIconLabels\"\n\t\t\t\t\t\t\t\tlabel={ __( 'Show button text labels' ) }\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Show text instead of icons on buttons.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\tfeatureName=\"showListViewByDefault\"\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Opens the block list view sidebar by default.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __( 'Always open list view' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\tfeatureName=\"themeStyles\"\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Make the editor look like your theme.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __( 'Use theme styles' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t{ showBlockBreadcrumbsOption && (\n\t\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\t\tfeatureName=\"showBlockBreadcrumbs\"\n\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t'Shows block breadcrumbs at the bottom of the editor.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Display block breadcrumbs' ) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t</>\n\t\t\t\t),\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'blocks',\n\t\t\t\ttabLabel: __( 'Blocks' ),\n\t\t\t\tcontent: (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\ttitle={ __( 'Block interactions' ) }\n\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t'Customize how you interact with blocks in the block library and editing canvas.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\tfeatureName=\"mostUsedBlocks\"\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Places the most frequent blocks in the block library.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __( 'Show most used blocks' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\tfeatureName=\"keepCaretInsideBlock\"\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Aids screen readers by stopping text caret from leaving blocks.'\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\t'Contain text cursor inside block'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\ttitle={ __( 'Visible blocks' ) }\n\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t\"Disable blocks that you don't want to appear in the inserter. They can always be toggled back on later.\"\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<BlockManager />\n\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t</>\n\t\t\t\t),\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'panels',\n\t\t\t\ttabLabel: __( 'Panels' ),\n\t\t\t\tcontent: (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\ttitle={ __( 'Document settings' ) }\n\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t'Choose what displays in the panel.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<EnablePluginDocumentSettingPanelOption.Slot />\n\t\t\t\t\t\t\t<PostTaxonomies\n\t\t\t\t\t\t\t\ttaxonomyWrapper={ ( content, taxonomy ) => (\n\t\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\t\tlabel={ taxonomy.labels.menu_name }\n\t\t\t\t\t\t\t\t\t\tpanelName={ `taxonomy-panel-${ taxonomy.slug }` }\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/>\n\t\t\t\t\t\t\t<PostFeaturedImageCheck>\n\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Featured image' ) }\n\t\t\t\t\t\t\t\t\tpanelName=\"featured-image\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PostFeaturedImageCheck>\n\t\t\t\t\t\t\t<PostExcerptCheck>\n\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Excerpt' ) }\n\t\t\t\t\t\t\t\t\tpanelName=\"post-excerpt\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PostExcerptCheck>\n\t\t\t\t\t\t\t<PostTypeSupportCheck\n\t\t\t\t\t\t\t\tsupportKeys={ [ 'comments', 'trackbacks' ] }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Discussion' ) }\n\t\t\t\t\t\t\t\t\tpanelName=\"discussion-panel\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PostTypeSupportCheck>\n\t\t\t\t\t\t\t<PageAttributesCheck>\n\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Page attributes' ) }\n\t\t\t\t\t\t\t\t\tpanelName=\"page-attributes\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PageAttributesCheck>\n\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t\t<MetaBoxesSection\n\t\t\t\t\t\t\ttitle={ __( 'Additional' ) }\n\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t'Add extra areas to the editor.'\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},\n\t\t],\n\t\t[ isLargeViewport, showBlockBreadcrumbsOption ]\n\t);\n\n\tif ( ! isModalActive ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PreferencesModal closeModal={ closeModal }>\n\t\t\t<PreferencesModalTabs sections={ sections } />\n\t\t</PreferencesModal>\n\t);\n}\n"]}
@@ -69,7 +69,8 @@ function PostStatus({
69
69
  style: {
70
70
  marginTop: '16px'
71
71
  },
72
- spacing: 4
72
+ spacing: 4,
73
+ wrap: true
73
74
  }, (0, _element.createElement)(_editor.PostSwitchToDraftButton, null), (0, _element.createElement)(_postTrash.default, null)))));
74
75
  }
75
76
 
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-post/src/components/sidebar/post-status/index.js"],"names":["PANEL_NAME","PostStatus","isOpened","onTogglePanel","fills","marginTop","select","isEditorPanelRemoved","isEditorPanelOpened","editPostStore","isRemoved","dispatch","toggleEditorPanelOpened"],"mappings":";;;;;;;;;;;AAGA;;AACA;;AAIA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AA1BA;AACA;AACA;;AAUA;AACA;AACA;;AAcA;AACA;AACA;AACA,MAAMA,UAAU,GAAG,aAAnB;;AAEA,SAASC,UAAT,CAAqB;AAAEC,EAAAA,QAAF;AAAYC,EAAAA;AAAZ,CAArB,EAAmD;AAClD,SACC,4BAAC,qBAAD;AACC,IAAA,SAAS,EAAC,uBADX;AAEC,IAAA,KAAK,EAAG,cAAI,SAAJ,CAFT;AAGC,IAAA,MAAM,EAAGD,QAHV;AAIC,IAAA,QAAQ,EAAGC;AAJZ,KAMC,4BAAC,6BAAD,CAAsB,IAAtB,QACKC,KAAF,IACD,qDACC,4BAAC,uBAAD,OADD,EAEC,4BAAC,qBAAD,OAFD,EAGC,4BAAC,qBAAD,OAHD,EAIC,4BAAC,gBAAD,OAJD,EAKC,4BAAC,mBAAD,OALD,EAMC,4BAAC,0BAAD,OAND,EAOC,4BAAC,mBAAD,OAPD,EAQC,4BAAC,iBAAD,OARD,EASC,4BAAC,mBAAD,OATD,EAUC,4BAAC,sBAAD,OAVD,EAWGA,KAXH,EAYC,4BAAC,gCAAD;AACC,IAAA,KAAK,EAAG;AACPC,MAAAA,SAAS,EAAE;AADJ,KADT;AAIC,IAAA,OAAO,EAAG;AAJX,KAMC,4BAAC,+BAAD,OAND,EAOC,4BAAC,kBAAD,OAPD,CAZD,CAFF,CAND,CADD;AAmCA;;eAEc,sBAAS,CACvB,sBAAcC,MAAF,IAAc;AACzB;AACA;AACA,QAAM;AAAEC,IAAAA,oBAAF;AAAwBC,IAAAA;AAAxB,MACLF,MAAM,CAAEG,YAAF,CADP;AAEA,SAAO;AACNC,IAAAA,SAAS,EAAEH,oBAAoB,CAAEP,UAAF,CADzB;AAENE,IAAAA,QAAQ,EAAEM,mBAAmB,CAAER,UAAF;AAFvB,GAAP;AAIA,CATD,CADuB,EAWvB,0BAAa,CAAE;AAAEU,EAAAA;AAAF,CAAF,KAAqB,CAAEA,SAApC,CAXuB,EAYvB,wBAAgBC,QAAF,KAAkB;AAC/BR,EAAAA,aAAa,GAAG;AACf,WAAOQ,QAAQ,CAAEF,YAAF,CAAR,CAA0BG,uBAA1B,CACNZ,UADM,CAAP;AAGA;;AAL8B,CAAlB,CAAd,CAZuB,CAAT,EAmBVC,UAnBU,C","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\t__experimentalHStack as HStack,\n\tPanelBody,\n} from '@wordpress/components';\nimport { withSelect, withDispatch } from '@wordpress/data';\nimport { compose, ifCondition } from '@wordpress/compose';\nimport { PostSwitchToDraftButton, PostSyncStatus } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport PostVisibility from '../post-visibility';\nimport PostTrash from '../post-trash';\nimport PostSchedule from '../post-schedule';\nimport PostSticky from '../post-sticky';\nimport PostAuthor from '../post-author';\nimport PostSlug from '../post-slug';\nimport PostFormat from '../post-format';\nimport PostPendingStatus from '../post-pending-status';\nimport PluginPostStatusInfo from '../plugin-post-status-info';\nimport { store as editPostStore } from '../../../store';\nimport PostTemplate from '../post-template';\nimport PostURL from '../post-url';\n\n/**\n * Module Constants\n */\nconst PANEL_NAME = 'post-status';\n\nfunction PostStatus( { isOpened, onTogglePanel } ) {\n\treturn (\n\t\t<PanelBody\n\t\t\tclassName=\"edit-post-post-status\"\n\t\t\ttitle={ __( 'Summary' ) }\n\t\t\topened={ isOpened }\n\t\t\tonToggle={ onTogglePanel }\n\t\t>\n\t\t\t<PluginPostStatusInfo.Slot>\n\t\t\t\t{ ( fills ) => (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<PostVisibility />\n\t\t\t\t\t\t<PostSchedule />\n\t\t\t\t\t\t<PostTemplate />\n\t\t\t\t\t\t<PostURL />\n\t\t\t\t\t\t<PostSticky />\n\t\t\t\t\t\t<PostPendingStatus />\n\t\t\t\t\t\t<PostFormat />\n\t\t\t\t\t\t<PostSlug />\n\t\t\t\t\t\t<PostAuthor />\n\t\t\t\t\t\t<PostSyncStatus />\n\t\t\t\t\t\t{ fills }\n\t\t\t\t\t\t<HStack\n\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\tmarginTop: '16px',\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tspacing={ 4 }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<PostSwitchToDraftButton />\n\t\t\t\t\t\t\t<PostTrash />\n\t\t\t\t\t\t</HStack>\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t</PluginPostStatusInfo.Slot>\n\t\t</PanelBody>\n\t);\n}\n\nexport default compose( [\n\twithSelect( ( select ) => {\n\t\t// We use isEditorPanelRemoved to hide the panel if it was programatically removed. We do\n\t\t// not use isEditorPanelEnabled since this panel should not be disabled through the UI.\n\t\tconst { isEditorPanelRemoved, isEditorPanelOpened } =\n\t\t\tselect( editPostStore );\n\t\treturn {\n\t\t\tisRemoved: isEditorPanelRemoved( PANEL_NAME ),\n\t\t\tisOpened: isEditorPanelOpened( PANEL_NAME ),\n\t\t};\n\t} ),\n\tifCondition( ( { isRemoved } ) => ! isRemoved ),\n\twithDispatch( ( dispatch ) => ( {\n\t\tonTogglePanel() {\n\t\t\treturn dispatch( editPostStore ).toggleEditorPanelOpened(\n\t\t\t\tPANEL_NAME\n\t\t\t);\n\t\t},\n\t} ) ),\n] )( PostStatus );\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-post/src/components/sidebar/post-status/index.js"],"names":["PANEL_NAME","PostStatus","isOpened","onTogglePanel","fills","marginTop","select","isEditorPanelRemoved","isEditorPanelOpened","editPostStore","isRemoved","dispatch","toggleEditorPanelOpened"],"mappings":";;;;;;;;;;;AAGA;;AACA;;AAIA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AA1BA;AACA;AACA;;AAUA;AACA;AACA;;AAcA;AACA;AACA;AACA,MAAMA,UAAU,GAAG,aAAnB;;AAEA,SAASC,UAAT,CAAqB;AAAEC,EAAAA,QAAF;AAAYC,EAAAA;AAAZ,CAArB,EAAmD;AAClD,SACC,4BAAC,qBAAD;AACC,IAAA,SAAS,EAAC,uBADX;AAEC,IAAA,KAAK,EAAG,cAAI,SAAJ,CAFT;AAGC,IAAA,MAAM,EAAGD,QAHV;AAIC,IAAA,QAAQ,EAAGC;AAJZ,KAMC,4BAAC,6BAAD,CAAsB,IAAtB,QACKC,KAAF,IACD,qDACC,4BAAC,uBAAD,OADD,EAEC,4BAAC,qBAAD,OAFD,EAGC,4BAAC,qBAAD,OAHD,EAIC,4BAAC,gBAAD,OAJD,EAKC,4BAAC,mBAAD,OALD,EAMC,4BAAC,0BAAD,OAND,EAOC,4BAAC,mBAAD,OAPD,EAQC,4BAAC,iBAAD,OARD,EASC,4BAAC,mBAAD,OATD,EAUC,4BAAC,sBAAD,OAVD,EAWGA,KAXH,EAYC,4BAAC,gCAAD;AACC,IAAA,KAAK,EAAG;AACPC,MAAAA,SAAS,EAAE;AADJ,KADT;AAIC,IAAA,OAAO,EAAG,CAJX;AAKC,IAAA,IAAI;AALL,KAOC,4BAAC,+BAAD,OAPD,EAQC,4BAAC,kBAAD,OARD,CAZD,CAFF,CAND,CADD;AAoCA;;eAEc,sBAAS,CACvB,sBAAcC,MAAF,IAAc;AACzB;AACA;AACA,QAAM;AAAEC,IAAAA,oBAAF;AAAwBC,IAAAA;AAAxB,MACLF,MAAM,CAAEG,YAAF,CADP;AAEA,SAAO;AACNC,IAAAA,SAAS,EAAEH,oBAAoB,CAAEP,UAAF,CADzB;AAENE,IAAAA,QAAQ,EAAEM,mBAAmB,CAAER,UAAF;AAFvB,GAAP;AAIA,CATD,CADuB,EAWvB,0BAAa,CAAE;AAAEU,EAAAA;AAAF,CAAF,KAAqB,CAAEA,SAApC,CAXuB,EAYvB,wBAAgBC,QAAF,KAAkB;AAC/BR,EAAAA,aAAa,GAAG;AACf,WAAOQ,QAAQ,CAAEF,YAAF,CAAR,CAA0BG,uBAA1B,CACNZ,UADM,CAAP;AAGA;;AAL8B,CAAlB,CAAd,CAZuB,CAAT,EAmBVC,UAnBU,C","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\t__experimentalHStack as HStack,\n\tPanelBody,\n} from '@wordpress/components';\nimport { withSelect, withDispatch } from '@wordpress/data';\nimport { compose, ifCondition } from '@wordpress/compose';\nimport { PostSwitchToDraftButton, PostSyncStatus } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport PostVisibility from '../post-visibility';\nimport PostTrash from '../post-trash';\nimport PostSchedule from '../post-schedule';\nimport PostSticky from '../post-sticky';\nimport PostAuthor from '../post-author';\nimport PostSlug from '../post-slug';\nimport PostFormat from '../post-format';\nimport PostPendingStatus from '../post-pending-status';\nimport PluginPostStatusInfo from '../plugin-post-status-info';\nimport { store as editPostStore } from '../../../store';\nimport PostTemplate from '../post-template';\nimport PostURL from '../post-url';\n\n/**\n * Module Constants\n */\nconst PANEL_NAME = 'post-status';\n\nfunction PostStatus( { isOpened, onTogglePanel } ) {\n\treturn (\n\t\t<PanelBody\n\t\t\tclassName=\"edit-post-post-status\"\n\t\t\ttitle={ __( 'Summary' ) }\n\t\t\topened={ isOpened }\n\t\t\tonToggle={ onTogglePanel }\n\t\t>\n\t\t\t<PluginPostStatusInfo.Slot>\n\t\t\t\t{ ( fills ) => (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<PostVisibility />\n\t\t\t\t\t\t<PostSchedule />\n\t\t\t\t\t\t<PostTemplate />\n\t\t\t\t\t\t<PostURL />\n\t\t\t\t\t\t<PostSticky />\n\t\t\t\t\t\t<PostPendingStatus />\n\t\t\t\t\t\t<PostFormat />\n\t\t\t\t\t\t<PostSlug />\n\t\t\t\t\t\t<PostAuthor />\n\t\t\t\t\t\t<PostSyncStatus />\n\t\t\t\t\t\t{ fills }\n\t\t\t\t\t\t<HStack\n\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\tmarginTop: '16px',\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tspacing={ 4 }\n\t\t\t\t\t\t\twrap\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<PostSwitchToDraftButton />\n\t\t\t\t\t\t\t<PostTrash />\n\t\t\t\t\t\t</HStack>\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t</PluginPostStatusInfo.Slot>\n\t\t</PanelBody>\n\t);\n}\n\nexport default compose( [\n\twithSelect( ( select ) => {\n\t\t// We use isEditorPanelRemoved to hide the panel if it was programatically removed. We do\n\t\t// not use isEditorPanelEnabled since this panel should not be disabled through the UI.\n\t\tconst { isEditorPanelRemoved, isEditorPanelOpened } =\n\t\t\tselect( editPostStore );\n\t\treturn {\n\t\t\tisRemoved: isEditorPanelRemoved( PANEL_NAME ),\n\t\t\tisOpened: isEditorPanelOpened( PANEL_NAME ),\n\t\t};\n\t} ),\n\tifCondition( ( { isRemoved } ) => ! isRemoved ),\n\twithDispatch( ( dispatch ) => ( {\n\t\tonTogglePanel() {\n\t\t\treturn dispatch( editPostStore ).toggleEditorPanelOpened(\n\t\t\t\tPANEL_NAME\n\t\t\t);\n\t\t},\n\t} ) ),\n] )( PostStatus );\n"]}
@@ -9,14 +9,10 @@ var _element = require("@wordpress/element");
9
9
 
10
10
  var _editor = require("@wordpress/editor");
11
11
 
12
- var _components = require("@wordpress/components");
13
-
14
12
  /**
15
13
  * WordPress dependencies
16
14
  */
17
15
  function PostTrash() {
18
- return (0, _element.createElement)(_editor.PostTrashCheck, null, (0, _element.createElement)(_components.FlexItem, {
19
- isBlock: true
20
- }, (0, _element.createElement)(_editor.PostTrash, null)));
16
+ return (0, _element.createElement)(_editor.PostTrashCheck, null, (0, _element.createElement)(_editor.PostTrash, null));
21
17
  }
22
18
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-post/src/components/sidebar/post-trash/index.js"],"names":["PostTrash"],"mappings":";;;;;;;;;AAGA;;AACA;;AAJA;AACA;AACA;AAIe,SAASA,SAAT,GAAqB;AACnC,SACC,4BAAC,sBAAD,QACC,4BAAC,oBAAD;AAAU,IAAA,OAAO;AAAjB,KACC,4BAAC,iBAAD,OADD,CADD,CADD;AAOA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { PostTrash as PostTrashLink, PostTrashCheck } from '@wordpress/editor';\nimport { FlexItem } from '@wordpress/components';\n\nexport default function PostTrash() {\n\treturn (\n\t\t<PostTrashCheck>\n\t\t\t<FlexItem isBlock>\n\t\t\t\t<PostTrashLink />\n\t\t\t</FlexItem>\n\t\t</PostTrashCheck>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-post/src/components/sidebar/post-trash/index.js"],"names":["PostTrash"],"mappings":";;;;;;;;;AAGA;;AAHA;AACA;AACA;AAGe,SAASA,SAAT,GAAqB;AACnC,SACC,4BAAC,sBAAD,QACC,4BAAC,iBAAD,OADD,CADD;AAKA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { PostTrash as PostTrashLink, PostTrashCheck } from '@wordpress/editor';\n\nexport default function PostTrash() {\n\treturn (\n\t\t<PostTrashCheck>\n\t\t\t<PostTrashLink />\n\t\t</PostTrashCheck>\n\t);\n}\n"]}
package/build/editor.js CHANGED
@@ -37,6 +37,8 @@ var _store = require("./store");
37
37
 
38
38
  var _lockUnlock = require("./lock-unlock");
39
39
 
40
+ var _useCommonCommands = _interopRequireDefault(require("./hooks/commands/use-common-commands"));
41
+
40
42
  /**
41
43
  * WordPress dependencies
42
44
  */
@@ -62,6 +64,7 @@ function Editor({
62
64
  ...props
63
65
  }) {
64
66
  useCommands();
67
+ (0, _useCommonCommands.default)();
65
68
  const {
66
69
  hasFixedToolbar,
67
70
  focusMode,
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-post/src/editor.js"],"names":["ExperimentalEditorProvider","editorPrivateApis","getLayoutStyles","blockEditorPrivateApis","useCommands","coreCommandsPrivateApis","Editor","postId","postType","settings","initialEdits","props","hasFixedToolbar","focusMode","isDistractionFree","hasInlineToolbar","hasThemeStyles","post","preferredStyleVariations","hiddenBlockTypes","blockTypes","keepCaretInsideBlock","isTemplateMode","template","select","isFeatureActive","__experimentalGetPreviewDeviceType","isEditingTemplate","getEditedPostTemplate","getHiddenBlockTypes","editPostStore","getEntityRecord","getPostType","getEntityRecords","canUser","coreStore","getEditorSettings","editorStore","getBlockTypes","blocksStore","isTemplate","includes","postObject","posts","wp_id","supportsTemplateMode","isViewable","viewable","canEditTemplate","preferencesStore","get","updatePreferredStyleVariations","setIsInserterOpened","editorSettings","result","__experimentalPreferredStyleVariations","value","onChange","__experimentalSetIsInserterOpened","defaultAllowedBlockTypes","allowedBlockTypes","length","map","name","filter","type","styles","themeStyles","presetStyles","forEach","style","__unstableType","push","defaultEditorStyles","disableLayoutStyles","css","selector","hasBlockGapSupport","hasFallbackGapSupport","fallbackGapValue","undefined"],"mappings":";;;;;;;;;AAYA;;AATA;;AACA;;AACA;;AAMA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AA1BA;AACA;AACA;;AAkBA;AACA;AACA;AAMA,MAAM;AAAEA,EAAAA;AAAF,IAAiC,wB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N,KAQC,4BAAC,qBAAD,QACC,4BAAC,qBAAD,OADD,EAEC,4BAAC,6BAAD;AAAsB,IAAA,MAAM,EAAGJ;AAA/B,IAFD,EAGC,4BAAC,eAAD;AAAQ,IAAA,MAAM,EAAG2D;AAAjB,IAHD,CARD,EAaC,4BAAC,uBAAD,OAbD,CADD,CADD,CADD;AAqBA;;eAEc5D,M","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blocksStore } from '@wordpress/blocks';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tErrorBoundary,\n\tPostLockedModal,\n\tstore as editorStore,\n\tprivateApis as editorPrivateApis,\n} from '@wordpress/editor';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\nimport { useMemo } from '@wordpress/element';\nimport { SlotFillProvider } from '@wordpress/components';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { ShortcutProvider } from '@wordpress/keyboard-shortcuts';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { CommandMenu } from '@wordpress/commands';\nimport { privateApis as coreCommandsPrivateApis } from '@wordpress/core-commands';\n\n/**\n * Internal dependencies\n */\nimport Layout from './components/layout';\nimport EditorInitialization from './components/editor-initialization';\nimport { store as editPostStore } from './store';\nimport { unlock } from './lock-unlock';\n\nconst { ExperimentalEditorProvider } = unlock( editorPrivateApis );\nconst { getLayoutStyles } = unlock( blockEditorPrivateApis );\nconst { useCommands } = unlock( coreCommandsPrivateApis );\n\nfunction Editor( { postId, postType, settings, initialEdits, ...props } ) {\n\tuseCommands();\n\tconst {\n\t\thasFixedToolbar,\n\t\tfocusMode,\n\t\tisDistractionFree,\n\t\thasInlineToolbar,\n\t\thasThemeStyles,\n\t\tpost,\n\t\tpreferredStyleVariations,\n\t\thiddenBlockTypes,\n\t\tblockTypes,\n\t\tkeepCaretInsideBlock,\n\t\tisTemplateMode,\n\t\ttemplate,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tisFeatureActive,\n\t\t\t\t__experimentalGetPreviewDeviceType,\n\t\t\t\tisEditingTemplate,\n\t\t\t\tgetEditedPostTemplate,\n\t\t\t\tgetHiddenBlockTypes,\n\t\t\t} = select( editPostStore );\n\t\t\tconst { getEntityRecord, getPostType, getEntityRecords, canUser } =\n\t\t\t\tselect( coreStore );\n\t\t\tconst { getEditorSettings } = select( editorStore );\n\t\t\tconst { getBlockTypes } = select( blocksStore );\n\t\t\tconst isTemplate = [ 'wp_template', 'wp_template_part' ].includes(\n\t\t\t\tpostType\n\t\t\t);\n\t\t\t// Ideally the initializeEditor function should be called using the ID of the REST endpoint.\n\t\t\t// to avoid the special case.\n\t\t\tlet postObject;\n\t\t\tif ( isTemplate ) {\n\t\t\t\tconst posts = getEntityRecords( 'postType', postType, {\n\t\t\t\t\twp_id: postId,\n\t\t\t\t} );\n\t\t\t\tpostObject = posts?.[ 0 ];\n\t\t\t} else {\n\t\t\t\tpostObject = getEntityRecord( 'postType', postType, postId );\n\t\t\t}\n\t\t\tconst supportsTemplateMode =\n\t\t\t\tgetEditorSettings().supportsTemplateMode;\n\t\t\tconst isViewable = getPostType( postType )?.viewable ?? false;\n\t\t\tconst canEditTemplate = canUser( 'create', 'templates' );\n\n\t\t\treturn {\n\t\t\t\thasFixedToolbar:\n\t\t\t\t\tisFeatureActive( 'fixedToolbar' ) ||\n\t\t\t\t\t__experimentalGetPreviewDeviceType() !== 'Desktop',\n\t\t\t\tfocusMode: isFeatureActive( 'focusMode' ),\n\t\t\t\tisDistractionFree: isFeatureActive( 'distractionFree' ),\n\t\t\t\thasInlineToolbar: isFeatureActive( 'inlineToolbar' ),\n\t\t\t\thasThemeStyles: isFeatureActive( 'themeStyles' ),\n\t\t\t\tpreferredStyleVariations: select( preferencesStore ).get(\n\t\t\t\t\t'core/edit-post',\n\t\t\t\t\t'preferredStyleVariations'\n\t\t\t\t),\n\t\t\t\thiddenBlockTypes: getHiddenBlockTypes(),\n\t\t\t\tblockTypes: getBlockTypes(),\n\t\t\t\tkeepCaretInsideBlock: isFeatureActive( 'keepCaretInsideBlock' ),\n\t\t\t\tisTemplateMode: isEditingTemplate(),\n\t\t\t\ttemplate:\n\t\t\t\t\tsupportsTemplateMode && isViewable && canEditTemplate\n\t\t\t\t\t\t? getEditedPostTemplate()\n\t\t\t\t\t\t: null,\n\t\t\t\tpost: postObject,\n\t\t\t};\n\t\t},\n\t\t[ postType, postId ]\n\t);\n\n\tconst { updatePreferredStyleVariations, setIsInserterOpened } =\n\t\tuseDispatch( editPostStore );\n\n\tconst editorSettings = useMemo( () => {\n\t\tconst result = {\n\t\t\t...settings,\n\t\t\t__experimentalPreferredStyleVariations: {\n\t\t\t\tvalue: preferredStyleVariations,\n\t\t\t\tonChange: updatePreferredStyleVariations,\n\t\t\t},\n\t\t\thasFixedToolbar,\n\t\t\tfocusMode,\n\t\t\tisDistractionFree,\n\t\t\thasInlineToolbar,\n\n\t\t\t// This is marked as experimental to give time for the quick inserter to mature.\n\t\t\t__experimentalSetIsInserterOpened: setIsInserterOpened,\n\t\t\tkeepCaretInsideBlock,\n\t\t\t// Keep a reference of the `allowedBlockTypes` from the server to handle use cases\n\t\t\t// where we need to differentiate if a block is disabled by the user or some plugin.\n\t\t\tdefaultAllowedBlockTypes: settings.allowedBlockTypes,\n\t\t};\n\n\t\t// Omit hidden block types if exists and non-empty.\n\t\tif ( hiddenBlockTypes.length > 0 ) {\n\t\t\t// Defer to passed setting for `allowedBlockTypes` if provided as\n\t\t\t// anything other than `true` (where `true` is equivalent to allow\n\t\t\t// all block types).\n\t\t\tconst defaultAllowedBlockTypes =\n\t\t\t\ttrue === settings.allowedBlockTypes\n\t\t\t\t\t? blockTypes.map( ( { name } ) => name )\n\t\t\t\t\t: settings.allowedBlockTypes || [];\n\n\t\t\tresult.allowedBlockTypes = defaultAllowedBlockTypes.filter(\n\t\t\t\t( type ) => ! hiddenBlockTypes.includes( type )\n\t\t\t);\n\t\t}\n\n\t\treturn result;\n\t}, [\n\t\tsettings,\n\t\thasFixedToolbar,\n\t\thasInlineToolbar,\n\t\tfocusMode,\n\t\tisDistractionFree,\n\t\thiddenBlockTypes,\n\t\tblockTypes,\n\t\tpreferredStyleVariations,\n\t\tsetIsInserterOpened,\n\t\tupdatePreferredStyleVariations,\n\t\tkeepCaretInsideBlock,\n\t] );\n\n\tconst styles = useMemo( () => {\n\t\tconst themeStyles = [];\n\t\tconst presetStyles = [];\n\t\tsettings.styles?.forEach( ( style ) => {\n\t\t\tif ( ! style.__unstableType || style.__unstableType === 'theme' ) {\n\t\t\t\tthemeStyles.push( style );\n\t\t\t} else {\n\t\t\t\tpresetStyles.push( style );\n\t\t\t}\n\t\t} );\n\n\t\tconst defaultEditorStyles = [\n\t\t\t...settings.defaultEditorStyles,\n\t\t\t...presetStyles,\n\t\t];\n\n\t\t// If theme styles are not present or displayed, ensure that\n\t\t// base layout styles are still present in the editor.\n\t\tif (\n\t\t\t! settings.disableLayoutStyles &&\n\t\t\t! ( hasThemeStyles && themeStyles.length )\n\t\t) {\n\t\t\tdefaultEditorStyles.push( {\n\t\t\t\tcss: getLayoutStyles( {\n\t\t\t\t\tstyle: {},\n\t\t\t\t\tselector: 'body',\n\t\t\t\t\thasBlockGapSupport: false,\n\t\t\t\t\thasFallbackGapSupport: true,\n\t\t\t\t\tfallbackGapValue: '0.5em',\n\t\t\t\t} ),\n\t\t\t} );\n\t\t}\n\n\t\treturn hasThemeStyles && themeStyles.length\n\t\t\t? settings.styles\n\t\t\t: defaultEditorStyles;\n\t}, [ settings, hasThemeStyles ] );\n\n\tif ( ! post ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<ShortcutProvider>\n\t\t\t<SlotFillProvider>\n\t\t\t\t<ExperimentalEditorProvider\n\t\t\t\t\tsettings={ editorSettings }\n\t\t\t\t\tpost={ post }\n\t\t\t\t\tinitialEdits={ initialEdits }\n\t\t\t\t\tuseSubRegistry={ false }\n\t\t\t\t\t__unstableTemplate={ isTemplateMode ? template : undefined }\n\t\t\t\t\t{ ...props }\n\t\t\t\t>\n\t\t\t\t\t<ErrorBoundary>\n\t\t\t\t\t\t<CommandMenu />\n\t\t\t\t\t\t<EditorInitialization postId={ postId } />\n\t\t\t\t\t\t<Layout styles={ styles } />\n\t\t\t\t\t</ErrorBoundary>\n\t\t\t\t\t<PostLockedModal />\n\t\t\t\t</ExperimentalEditorProvider>\n\t\t\t</SlotFillProvider>\n\t\t</ShortcutProvider>\n\t);\n}\n\nexport default Editor;\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-post/src/editor.js"],"names":["ExperimentalEditorProvider","editorPrivateApis","getLayoutStyles","blockEditorPrivateApis","useCommands","coreCommandsPrivateApis","Editor","postId","postType","settings","initialEdits","props","hasFixedToolbar","focusMode","isDistractionFree","hasInlineToolbar","hasThemeStyles","post","preferredStyleVariations","hiddenBlockTypes","blockTypes","keepCaretInsideBlock","isTemplateMode","template","select","isFeatureActive","__experimentalGetPreviewDeviceType","isEditingTemplate","getEditedPostTemplate","getHiddenBlockTypes","editPostStore","getEntityRecord","getPostType","getEntityRecords","canUser","coreStore","getEditorSettings","editorStore","getBlockTypes","blocksStore","isTemplate","includes","postObject","posts","wp_id","supportsTemplateMode","isViewable","viewable","canEditTemplate","preferencesStore","get","updatePreferredStyleVariations","setIsInserterOpened","editorSettings","result","__experimentalPreferredStyleVariations","value","onChange","__experimentalSetIsInserterOpened","defaultAllowedBlockTypes","allowedBlockTypes","length","map","name","filter","type","styles","themeStyles","presetStyles","forEach","style","__unstableType","push","defaultEditorStyles","disableLayoutStyles","css","selector","hasBlockGapSupport","hasFallbackGapSupport","fallbackGapValue","undefined"],"mappings":";;;;;;;;;AAYA;;AATA;;AACA;;AACA;;AAMA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AA3BA;AACA;AACA;;AAkBA;AACA;AACA;AAOA,MAAM;AAAEA,EAAAA;AAAF,IAAiC,wBAAQC,mBAAR,CAAvC;AACA,MAAM;AAAEC,EAAAA;AA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ADD,EAEC,4BAAC,6BAAD;AAAsB,IAAA,MAAM,EAAGJ;AAA/B,IAFD,EAGC,4BAAC,eAAD;AAAQ,IAAA,MAAM,EAAG2D;AAAjB,IAHD,CARD,EAaC,4BAAC,uBAAD,OAbD,CADD,CADD,CADD;AAqBA;;eAEc5D,M","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blocksStore } from '@wordpress/blocks';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tErrorBoundary,\n\tPostLockedModal,\n\tstore as editorStore,\n\tprivateApis as editorPrivateApis,\n} from '@wordpress/editor';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\nimport { useMemo } from '@wordpress/element';\nimport { SlotFillProvider } from '@wordpress/components';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { ShortcutProvider } from '@wordpress/keyboard-shortcuts';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { CommandMenu } from '@wordpress/commands';\nimport { privateApis as coreCommandsPrivateApis } from '@wordpress/core-commands';\n\n/**\n * Internal dependencies\n */\nimport Layout from './components/layout';\nimport EditorInitialization from './components/editor-initialization';\nimport { store as editPostStore } from './store';\nimport { unlock } from './lock-unlock';\nimport useCommonCommands from './hooks/commands/use-common-commands';\n\nconst { ExperimentalEditorProvider } = unlock( editorPrivateApis );\nconst { getLayoutStyles } = unlock( blockEditorPrivateApis );\nconst { useCommands } = unlock( coreCommandsPrivateApis );\n\nfunction Editor( { postId, postType, settings, initialEdits, ...props } ) {\n\tuseCommands();\n\tuseCommonCommands();\n\tconst {\n\t\thasFixedToolbar,\n\t\tfocusMode,\n\t\tisDistractionFree,\n\t\thasInlineToolbar,\n\t\thasThemeStyles,\n\t\tpost,\n\t\tpreferredStyleVariations,\n\t\thiddenBlockTypes,\n\t\tblockTypes,\n\t\tkeepCaretInsideBlock,\n\t\tisTemplateMode,\n\t\ttemplate,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tisFeatureActive,\n\t\t\t\t__experimentalGetPreviewDeviceType,\n\t\t\t\tisEditingTemplate,\n\t\t\t\tgetEditedPostTemplate,\n\t\t\t\tgetHiddenBlockTypes,\n\t\t\t} = select( editPostStore );\n\t\t\tconst { getEntityRecord, getPostType, getEntityRecords, canUser } =\n\t\t\t\tselect( coreStore );\n\t\t\tconst { getEditorSettings } = select( editorStore );\n\t\t\tconst { getBlockTypes } = select( blocksStore );\n\t\t\tconst isTemplate = [ 'wp_template', 'wp_template_part' ].includes(\n\t\t\t\tpostType\n\t\t\t);\n\t\t\t// Ideally the initializeEditor function should be called using the ID of the REST endpoint.\n\t\t\t// to avoid the special case.\n\t\t\tlet postObject;\n\t\t\tif ( isTemplate ) {\n\t\t\t\tconst posts = getEntityRecords( 'postType', postType, {\n\t\t\t\t\twp_id: postId,\n\t\t\t\t} );\n\t\t\t\tpostObject = posts?.[ 0 ];\n\t\t\t} else {\n\t\t\t\tpostObject = getEntityRecord( 'postType', postType, postId );\n\t\t\t}\n\t\t\tconst supportsTemplateMode =\n\t\t\t\tgetEditorSettings().supportsTemplateMode;\n\t\t\tconst isViewable = getPostType( postType )?.viewable ?? false;\n\t\t\tconst canEditTemplate = canUser( 'create', 'templates' );\n\n\t\t\treturn {\n\t\t\t\thasFixedToolbar:\n\t\t\t\t\tisFeatureActive( 'fixedToolbar' ) ||\n\t\t\t\t\t__experimentalGetPreviewDeviceType() !== 'Desktop',\n\t\t\t\tfocusMode: isFeatureActive( 'focusMode' ),\n\t\t\t\tisDistractionFree: isFeatureActive( 'distractionFree' ),\n\t\t\t\thasInlineToolbar: isFeatureActive( 'inlineToolbar' ),\n\t\t\t\thasThemeStyles: isFeatureActive( 'themeStyles' ),\n\t\t\t\tpreferredStyleVariations: select( preferencesStore ).get(\n\t\t\t\t\t'core/edit-post',\n\t\t\t\t\t'preferredStyleVariations'\n\t\t\t\t),\n\t\t\t\thiddenBlockTypes: getHiddenBlockTypes(),\n\t\t\t\tblockTypes: getBlockTypes(),\n\t\t\t\tkeepCaretInsideBlock: isFeatureActive( 'keepCaretInsideBlock' ),\n\t\t\t\tisTemplateMode: isEditingTemplate(),\n\t\t\t\ttemplate:\n\t\t\t\t\tsupportsTemplateMode && isViewable && canEditTemplate\n\t\t\t\t\t\t? getEditedPostTemplate()\n\t\t\t\t\t\t: null,\n\t\t\t\tpost: postObject,\n\t\t\t};\n\t\t},\n\t\t[ postType, postId ]\n\t);\n\n\tconst { updatePreferredStyleVariations, setIsInserterOpened } =\n\t\tuseDispatch( editPostStore );\n\n\tconst editorSettings = useMemo( () => {\n\t\tconst result = {\n\t\t\t...settings,\n\t\t\t__experimentalPreferredStyleVariations: {\n\t\t\t\tvalue: preferredStyleVariations,\n\t\t\t\tonChange: updatePreferredStyleVariations,\n\t\t\t},\n\t\t\thasFixedToolbar,\n\t\t\tfocusMode,\n\t\t\tisDistractionFree,\n\t\t\thasInlineToolbar,\n\n\t\t\t// This is marked as experimental to give time for the quick inserter to mature.\n\t\t\t__experimentalSetIsInserterOpened: setIsInserterOpened,\n\t\t\tkeepCaretInsideBlock,\n\t\t\t// Keep a reference of the `allowedBlockTypes` from the server to handle use cases\n\t\t\t// where we need to differentiate if a block is disabled by the user or some plugin.\n\t\t\tdefaultAllowedBlockTypes: settings.allowedBlockTypes,\n\t\t};\n\n\t\t// Omit hidden block types if exists and non-empty.\n\t\tif ( hiddenBlockTypes.length > 0 ) {\n\t\t\t// Defer to passed setting for `allowedBlockTypes` if provided as\n\t\t\t// anything other than `true` (where `true` is equivalent to allow\n\t\t\t// all block types).\n\t\t\tconst defaultAllowedBlockTypes =\n\t\t\t\ttrue === settings.allowedBlockTypes\n\t\t\t\t\t? blockTypes.map( ( { name } ) => name )\n\t\t\t\t\t: settings.allowedBlockTypes || [];\n\n\t\t\tresult.allowedBlockTypes = defaultAllowedBlockTypes.filter(\n\t\t\t\t( type ) => ! hiddenBlockTypes.includes( type )\n\t\t\t);\n\t\t}\n\n\t\treturn result;\n\t}, [\n\t\tsettings,\n\t\thasFixedToolbar,\n\t\thasInlineToolbar,\n\t\tfocusMode,\n\t\tisDistractionFree,\n\t\thiddenBlockTypes,\n\t\tblockTypes,\n\t\tpreferredStyleVariations,\n\t\tsetIsInserterOpened,\n\t\tupdatePreferredStyleVariations,\n\t\tkeepCaretInsideBlock,\n\t] );\n\n\tconst styles = useMemo( () => {\n\t\tconst themeStyles = [];\n\t\tconst presetStyles = [];\n\t\tsettings.styles?.forEach( ( style ) => {\n\t\t\tif ( ! style.__unstableType || style.__unstableType === 'theme' ) {\n\t\t\t\tthemeStyles.push( style );\n\t\t\t} else {\n\t\t\t\tpresetStyles.push( style );\n\t\t\t}\n\t\t} );\n\n\t\tconst defaultEditorStyles = [\n\t\t\t...settings.defaultEditorStyles,\n\t\t\t...presetStyles,\n\t\t];\n\n\t\t// If theme styles are not present or displayed, ensure that\n\t\t// base layout styles are still present in the editor.\n\t\tif (\n\t\t\t! settings.disableLayoutStyles &&\n\t\t\t! ( hasThemeStyles && themeStyles.length )\n\t\t) {\n\t\t\tdefaultEditorStyles.push( {\n\t\t\t\tcss: getLayoutStyles( {\n\t\t\t\t\tstyle: {},\n\t\t\t\t\tselector: 'body',\n\t\t\t\t\thasBlockGapSupport: false,\n\t\t\t\t\thasFallbackGapSupport: true,\n\t\t\t\t\tfallbackGapValue: '0.5em',\n\t\t\t\t} ),\n\t\t\t} );\n\t\t}\n\n\t\treturn hasThemeStyles && themeStyles.length\n\t\t\t? settings.styles\n\t\t\t: defaultEditorStyles;\n\t}, [ settings, hasThemeStyles ] );\n\n\tif ( ! post ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<ShortcutProvider>\n\t\t\t<SlotFillProvider>\n\t\t\t\t<ExperimentalEditorProvider\n\t\t\t\t\tsettings={ editorSettings }\n\t\t\t\t\tpost={ post }\n\t\t\t\t\tinitialEdits={ initialEdits }\n\t\t\t\t\tuseSubRegistry={ false }\n\t\t\t\t\t__unstableTemplate={ isTemplateMode ? template : undefined }\n\t\t\t\t\t{ ...props }\n\t\t\t\t>\n\t\t\t\t\t<ErrorBoundary>\n\t\t\t\t\t\t<CommandMenu />\n\t\t\t\t\t\t<EditorInitialization postId={ postId } />\n\t\t\t\t\t\t<Layout styles={ styles } />\n\t\t\t\t\t</ErrorBoundary>\n\t\t\t\t\t<PostLockedModal />\n\t\t\t\t</ExperimentalEditorProvider>\n\t\t\t</SlotFillProvider>\n\t\t</ShortcutProvider>\n\t);\n}\n\nexport default Editor;\n"]}
@@ -0,0 +1,176 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = useCommonCommands;
7
+
8
+ var _data = require("@wordpress/data");
9
+
10
+ var _i18n = require("@wordpress/i18n");
11
+
12
+ var _icons = require("@wordpress/icons");
13
+
14
+ var _commands = require("@wordpress/commands");
15
+
16
+ var _preferences = require("@wordpress/preferences");
17
+
18
+ var _interface = require("@wordpress/interface");
19
+
20
+ var _keyboardShortcutHelpModal = require("../../components/keyboard-shortcut-help-modal");
21
+
22
+ var _preferencesModal = require("../../components/preferences-modal");
23
+
24
+ var _store = require("../../store");
25
+
26
+ /**
27
+ * WordPress dependencies
28
+ */
29
+
30
+ /**
31
+ * Internal dependencies
32
+ */
33
+ function useCommonCommands() {
34
+ const {
35
+ openGeneralSidebar,
36
+ closeGeneralSidebar,
37
+ switchEditorMode,
38
+ setIsListViewOpened
39
+ } = (0, _data.useDispatch)(_store.store);
40
+ const {
41
+ openModal
42
+ } = (0, _data.useDispatch)(_interface.store);
43
+ const {
44
+ editorMode,
45
+ activeSidebar,
46
+ isListViewOpen
47
+ } = (0, _data.useSelect)(select => {
48
+ const {
49
+ getEditorMode,
50
+ isListViewOpened
51
+ } = select(_store.store);
52
+ return {
53
+ activeSidebar: select(_interface.store).getActiveComplementaryArea(_store.store.name),
54
+ editorMode: getEditorMode(),
55
+ isListViewOpen: isListViewOpened()
56
+ };
57
+ }, []);
58
+ const {
59
+ toggle
60
+ } = (0, _data.useDispatch)(_preferences.store);
61
+ (0, _commands.useCommand)({
62
+ name: 'core/open-settings-sidebar',
63
+ label: (0, _i18n.__)('Toggle settings sidebar'),
64
+ icon: (0, _i18n.isRTL)() ? _icons.drawerLeft : _icons.drawerRight,
65
+ callback: ({
66
+ close
67
+ }) => {
68
+ close();
69
+
70
+ if (activeSidebar === 'edit-post/document') {
71
+ closeGeneralSidebar();
72
+ } else {
73
+ openGeneralSidebar('edit-post/document');
74
+ }
75
+ }
76
+ });
77
+ (0, _commands.useCommand)({
78
+ name: 'core/open-block-inspector',
79
+ label: (0, _i18n.__)('Toggle block inspector'),
80
+ icon: _icons.blockDefault,
81
+ callback: ({
82
+ close
83
+ }) => {
84
+ close();
85
+
86
+ if (activeSidebar === 'edit-post/block') {
87
+ closeGeneralSidebar();
88
+ } else {
89
+ openGeneralSidebar('edit-post/block');
90
+ }
91
+ }
92
+ });
93
+ (0, _commands.useCommand)({
94
+ name: 'core/toggle-distraction-free',
95
+ label: (0, _i18n.__)('Toggle distraction free'),
96
+ icon: _icons.cog,
97
+ callback: ({
98
+ close
99
+ }) => {
100
+ toggle('core/edit-post', 'distractionFree');
101
+ close();
102
+ }
103
+ });
104
+ (0, _commands.useCommand)({
105
+ name: 'core/toggle-spotlight-mode',
106
+ label: (0, _i18n.__)('Toggle spotlight mode'),
107
+ icon: _icons.cog,
108
+ callback: ({
109
+ close
110
+ }) => {
111
+ toggle('core/edit-post', 'focusMode');
112
+ close();
113
+ }
114
+ });
115
+ (0, _commands.useCommand)({
116
+ name: 'core/toggle-fullscreen-mode',
117
+ label: (0, _i18n.__)('Toggle fullscreen mode'),
118
+ icon: _icons.desktop,
119
+ callback: ({
120
+ close
121
+ }) => {
122
+ toggle('core/edit-post', 'fullscreenMode');
123
+ close();
124
+ }
125
+ });
126
+ (0, _commands.useCommand)({
127
+ name: 'core/toggle-list-view',
128
+ label: (0, _i18n.__)('Toggle list view'),
129
+ icon: _icons.listView,
130
+ callback: ({
131
+ close
132
+ }) => {
133
+ setIsListViewOpened(!isListViewOpen);
134
+ close();
135
+ }
136
+ });
137
+ (0, _commands.useCommand)({
138
+ name: 'core/toggle-top-toolbar',
139
+ label: (0, _i18n.__)('Toggle top toolbar'),
140
+ icon: _icons.cog,
141
+ callback: ({
142
+ close
143
+ }) => {
144
+ toggle('core/edit-post', 'fixedToolbar');
145
+ close();
146
+ }
147
+ });
148
+ (0, _commands.useCommand)({
149
+ name: 'core/toggle-code-editor',
150
+ label: (0, _i18n.__)('Toggle code editor'),
151
+ icon: _icons.code,
152
+ callback: ({
153
+ close
154
+ }) => {
155
+ switchEditorMode(editorMode === 'visual' ? 'text' : 'visual');
156
+ close();
157
+ }
158
+ });
159
+ (0, _commands.useCommand)({
160
+ name: 'core/open-preferences',
161
+ label: (0, _i18n.__)('Open editor preferences'),
162
+ icon: _icons.cog,
163
+ callback: () => {
164
+ openModal(_preferencesModal.PREFERENCES_MODAL_NAME);
165
+ }
166
+ });
167
+ (0, _commands.useCommand)({
168
+ name: 'core/open-shortcut-help',
169
+ label: (0, _i18n.__)('Open keyboard shortcuts'),
170
+ icon: _icons.keyboardClose,
171
+ callback: () => {
172
+ openModal(_keyboardShortcutHelpModal.KEYBOARD_SHORTCUT_HELP_MODAL_NAME);
173
+ }
174
+ });
175
+ }
176
+ //# sourceMappingURL=use-common-commands.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["@wordpress/edit-post/src/hooks/commands/use-common-commands.js"],"names":["useCommonCommands","openGeneralSidebar","closeGeneralSidebar","switchEditorMode","setIsListViewOpened","editPostStore","openModal","interfaceStore","editorMode","activeSidebar","isListViewOpen","select","getEditorMode","isListViewOpened","getActiveComplementaryArea","name","toggle","preferencesStore","label","icon","drawerLeft","drawerRight","callback","close","blockDefault","cog","desktop","listView","code","PREFERENCES_MODAL_NAME","keyboardClose","KEYBOARD_SHORTCUT_HELP_MODAL_NAME"],"mappings":";;;;;;;AAGA;;AACA;;AACA;;AAUA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AAx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ch } from '@wordpress/data';\nimport { __, isRTL } from '@wordpress/i18n';\nimport {\n\tcode,\n\tcog,\n\tdrawerLeft,\n\tdrawerRight,\n\tblockDefault,\n\tkeyboardClose,\n\tdesktop,\n\tlistView,\n} from '@wordpress/icons';\nimport { useCommand } from '@wordpress/commands';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { store as interfaceStore } from '@wordpress/interface';\n\n/**\n * Internal dependencies\n */\nimport { KEYBOARD_SHORTCUT_HELP_MODAL_NAME } from '../../components/keyboard-shortcut-help-modal';\nimport { PREFERENCES_MODAL_NAME } from '../../components/preferences-modal';\nimport { store as editPostStore } from '../../store';\n\nexport default function useCommonCommands() {\n\tconst {\n\t\topenGeneralSidebar,\n\t\tcloseGeneralSidebar,\n\t\tswitchEditorMode,\n\t\tsetIsListViewOpened,\n\t} = useDispatch( editPostStore );\n\tconst { openModal } = useDispatch( interfaceStore );\n\tconst { editorMode, activeSidebar, isListViewOpen } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEditorMode, isListViewOpened } = select( editPostStore );\n\t\t\treturn {\n\t\t\t\tactiveSidebar: select(\n\t\t\t\t\tinterfaceStore\n\t\t\t\t).getActiveComplementaryArea( editPostStore.name ),\n\t\t\t\teditorMode: getEditorMode(),\n\t\t\t\tisListViewOpen: isListViewOpened(),\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\tconst { toggle } = useDispatch( preferencesStore );\n\n\tuseCommand( {\n\t\tname: 'core/open-settings-sidebar',\n\t\tlabel: __( 'Toggle settings sidebar' ),\n\t\ticon: isRTL() ? drawerLeft : drawerRight,\n\t\tcallback: ( { close } ) => {\n\t\t\tclose();\n\t\t\tif ( activeSidebar === 'edit-post/document' ) {\n\t\t\t\tcloseGeneralSidebar();\n\t\t\t} else {\n\t\t\t\topenGeneralSidebar( 'edit-post/document' );\n\t\t\t}\n\t\t},\n\t} );\n\n\tuseCommand( {\n\t\tname: 'core/open-block-inspector',\n\t\tlabel: __( 'Toggle block inspector' ),\n\t\ticon: blockDefault,\n\t\tcallback: ( { close } ) => {\n\t\t\tclose();\n\t\t\tif ( activeSidebar === 'edit-post/block' ) {\n\t\t\t\tcloseGeneralSidebar();\n\t\t\t} else {\n\t\t\t\topenGeneralSidebar( 'edit-post/block' );\n\t\t\t}\n\t\t},\n\t} );\n\n\tuseCommand( {\n\t\tname: 'core/toggle-distraction-free',\n\t\tlabel: __( 'Toggle distraction free' ),\n\t\ticon: cog,\n\t\tcallback: ( { close } ) => {\n\t\t\ttoggle( 'core/edit-post', 'distractionFree' );\n\t\t\tclose();\n\t\t},\n\t} );\n\n\tuseCommand( {\n\t\tname: 'core/toggle-spotlight-mode',\n\t\tlabel: __( 'Toggle spotlight mode' ),\n\t\ticon: cog,\n\t\tcallback: ( { close } ) => {\n\t\t\ttoggle( 'core/edit-post', 'focusMode' );\n\t\t\tclose();\n\t\t},\n\t} );\n\n\tuseCommand( {\n\t\tname: 'core/toggle-fullscreen-mode',\n\t\tlabel: __( 'Toggle fullscreen mode' ),\n\t\ticon: desktop,\n\t\tcallback: ( { close } ) => {\n\t\t\ttoggle( 'core/edit-post', 'fullscreenMode' );\n\t\t\tclose();\n\t\t},\n\t} );\n\n\tuseCommand( {\n\t\tname: 'core/toggle-list-view',\n\t\tlabel: __( 'Toggle list view' ),\n\t\ticon: listView,\n\t\tcallback: ( { close } ) => {\n\t\t\tsetIsListViewOpened( ! isListViewOpen );\n\t\t\tclose();\n\t\t},\n\t} );\n\n\tuseCommand( {\n\t\tname: 'core/toggle-top-toolbar',\n\t\tlabel: __( 'Toggle top toolbar' ),\n\t\ticon: cog,\n\t\tcallback: ( { close } ) => {\n\t\t\ttoggle( 'core/edit-post', 'fixedToolbar' );\n\t\t\tclose();\n\t\t},\n\t} );\n\n\tuseCommand( {\n\t\tname: 'core/toggle-code-editor',\n\t\tlabel: __( 'Toggle code editor' ),\n\t\ticon: code,\n\t\tcallback: ( { close } ) => {\n\t\t\tswitchEditorMode( editorMode === 'visual' ? 'text' : 'visual' );\n\t\t\tclose();\n\t\t},\n\t} );\n\n\tuseCommand( {\n\t\tname: 'core/open-preferences',\n\t\tlabel: __( 'Open editor preferences' ),\n\t\ticon: cog,\n\t\tcallback: () => {\n\t\t\topenModal( PREFERENCES_MODAL_NAME );\n\t\t},\n\t} );\n\n\tuseCommand( {\n\t\tname: 'core/open-shortcut-help',\n\t\tlabel: __( 'Open keyboard shortcuts' ),\n\t\ticon: keyboardClose,\n\t\tcallback: () => {\n\t\t\topenModal( KEYBOARD_SHORTCUT_HELP_MODAL_NAME );\n\t\t},\n\t} );\n}\n"]}
@@ -16,7 +16,9 @@ var _i18n = require("@wordpress/i18n");
16
16
 
17
17
  var _keycodes = require("@wordpress/keycodes");
18
18
 
19
- var _store = require("../../store");
19
+ var _interface = require("@wordpress/interface");
20
+
21
+ var _keyboardShortcutHelpModal = require("../../components/keyboard-shortcut-help-modal");
20
22
 
21
23
  /**
22
24
  * WordPress dependencies
@@ -30,7 +32,7 @@ function KeyboardShortcutsHelpMenuItem({
30
32
  }) {
31
33
  return (0, _element.createElement)(_components.MenuItem, {
32
34
  onClick: () => {
33
- openModal('edit-post/keyboard-shortcut-help');
35
+ openModal(_keyboardShortcutHelpModal.KEYBOARD_SHORTCUT_HELP_MODAL_NAME);
34
36
  },
35
37
  shortcut: _keycodes.displayShortcut.access('h')
36
38
  }, (0, _i18n.__)('Keyboard shortcuts'));
@@ -39,7 +41,7 @@ function KeyboardShortcutsHelpMenuItem({
39
41
  var _default = (0, _data.withDispatch)(dispatch => {
40
42
  const {
41
43
  openModal
42
- } = dispatch(_store.store);
44
+ } = dispatch(_interface.store);
43
45
  return {
44
46
  openModal
45
47
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-post/src/plugins/keyboard-shortcuts-help-menu-item/index.js"],"names":["KeyboardShortcutsHelpMenuItem","openModal","displayShortcut","access","dispatch","editPostStore"],"mappings":";;;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AAKA;;AAXA;AACA;AACA;;AAMA;AACA;AACA;AAGO,SAASA,6BAAT,CAAwC;AAAEC,EAAAA;AAAF,CAAxC,EAAwD;AAC9D,SACC,4BAAC,oBAAD;AACC,IAAA,OAAO,EAAG,MAAM;AACfA,MAAAA,SAAS,CAAE,kCAAF,CAAT;AACA,KAHF;AAIC,IAAA,QAAQ,EAAGC,0BAAgBC,MAAhB,CAAwB,GAAxB;AAJZ,KAMG,cAAI,oBAAJ,CANH,CADD;AAUA;;eAEc,wBAAgBC,QAAF,IAAgB;AAC5C,QAAM;AAAEH,IAAAA;AAAF,MAAgBG,QAAQ,CAAEC,YAAF,CAA9B;AAEA,SAAO;AACNJ,IAAAA;AADM,GAAP;AAGA,CANc,EAMVD,6BANU,C","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { MenuItem } from '@wordpress/components';\nimport { withDispatch } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { displayShortcut } from '@wordpress/keycodes';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../store';\n\nexport function KeyboardShortcutsHelpMenuItem( { openModal } ) {\n\treturn (\n\t\t<MenuItem\n\t\t\tonClick={ () => {\n\t\t\t\topenModal( 'edit-post/keyboard-shortcut-help' );\n\t\t\t} }\n\t\t\tshortcut={ displayShortcut.access( 'h' ) }\n\t\t>\n\t\t\t{ __( 'Keyboard shortcuts' ) }\n\t\t</MenuItem>\n\t);\n}\n\nexport default withDispatch( ( dispatch ) => {\n\tconst { openModal } = dispatch( editPostStore );\n\n\treturn {\n\t\topenModal,\n\t};\n} )( KeyboardShortcutsHelpMenuItem );\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-post/src/plugins/keyboard-shortcuts-help-menu-item/index.js"],"names":["KeyboardShortcutsHelpMenuItem","openModal","KEYBOARD_SHORTCUT_HELP_MODAL_NAME","displayShortcut","access","dispatch","interfaceStore"],"mappings":";;;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AAZA;AACA;AACA;;AAOA;AACA;AACA;AAGO,SAASA,6BAAT,CAAwC;AAAEC,EAAAA;AAAF,CAAxC,EAAwD;AAC9D,SACC,4BAAC,oBAAD;AACC,IAAA,OAAO,EAAG,MAAM;AACfA,MAAAA,SAAS,CAAEC,4DAAF,CAAT;AACA,KAHF;AAIC,IAAA,QAAQ,EAAGC,0BAAgBC,MAAhB,CAAwB,GAAxB;AAJZ,KAMG,cAAI,oBAAJ,CANH,CADD;AAUA;;eAEc,wBAAgBC,QAAF,IAAgB;AAC5C,QAAM;AAAEJ,IAAAA;AAAF,MAAgBI,QAAQ,CAAEC,gBAAF,CAA9B;AAEA,SAAO;AACNL,IAAAA;AADM,GAAP;AAGA,CANc,EAMVD,6BANU,C","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { MenuItem } from '@wordpress/components';\nimport { withDispatch } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { displayShortcut } from '@wordpress/keycodes';\nimport { store as interfaceStore } from '@wordpress/interface';\n\n/**\n * Internal dependencies\n */\nimport { KEYBOARD_SHORTCUT_HELP_MODAL_NAME } from '../../components/keyboard-shortcut-help-modal';\n\nexport function KeyboardShortcutsHelpMenuItem( { openModal } ) {\n\treturn (\n\t\t<MenuItem\n\t\t\tonClick={ () => {\n\t\t\t\topenModal( KEYBOARD_SHORTCUT_HELP_MODAL_NAME );\n\t\t\t} }\n\t\t\tshortcut={ displayShortcut.access( 'h' ) }\n\t\t>\n\t\t\t{ __( 'Keyboard shortcuts' ) }\n\t\t</MenuItem>\n\t);\n}\n\nexport default withDispatch( ( dispatch ) => {\n\tconst { openModal } = dispatch( interfaceStore );\n\n\treturn {\n\t\topenModal,\n\t};\n} )( KeyboardShortcutsHelpMenuItem );\n"]}
@@ -6,14 +6,12 @@ Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
8
  exports.__experimentalSetPreviewDeviceType = __experimentalSetPreviewDeviceType;
9
- exports.closeGeneralSidebar = exports.__unstableSwitchToTemplateMode = exports.__unstableCreateTemplate = void 0;
10
- exports.closeModal = closeModal;
9
+ exports.closeModal = exports.closeGeneralSidebar = exports.__unstableSwitchToTemplateMode = exports.__unstableCreateTemplate = void 0;
11
10
  exports.closePublishSidebar = closePublishSidebar;
12
11
  exports.initializeMetaBoxes = exports.hideBlockTypes = void 0;
13
12
  exports.metaBoxUpdatesFailure = metaBoxUpdatesFailure;
14
13
  exports.metaBoxUpdatesSuccess = metaBoxUpdatesSuccess;
15
- exports.openGeneralSidebar = void 0;
16
- exports.openModal = openModal;
14
+ exports.openModal = exports.openGeneralSidebar = void 0;
17
15
  exports.openPublishSidebar = openPublishSidebar;
18
16
  exports.removeEditorPanel = removeEditorPanel;
19
17
  exports.requestMetaBoxUpdates = void 0;
@@ -43,6 +41,8 @@ var _blockEditor = require("@wordpress/block-editor");
43
41
 
44
42
  var _editor = require("@wordpress/editor");
45
43
 
44
+ var _deprecated = _interopRequireDefault(require("@wordpress/deprecated"));
45
+
46
46
  var _metaBoxes = require("../utils/meta-boxes");
47
47
 
48
48
  var _ = require(".");
@@ -76,6 +76,9 @@ const closeGeneralSidebar = () => ({
76
76
  /**
77
77
  * Returns an action object used in signalling that the user opened a modal.
78
78
  *
79
+ * @deprecated since WP 6.3 use `core/interface` store's action with the same name instead.
80
+ *
81
+ *
79
82
  * @param {string} name A string that uniquely identifies the modal.
80
83
  *
81
84
  * @return {Object} Action object.
@@ -84,24 +87,35 @@ const closeGeneralSidebar = () => ({
84
87
 
85
88
  exports.closeGeneralSidebar = closeGeneralSidebar;
86
89
 
87
- function openModal(name) {
88
- return {
89
- type: 'OPEN_MODAL',
90
- name
91
- };
92
- }
90
+ const openModal = name => ({
91
+ registry
92
+ }) => {
93
+ (0, _deprecated.default)("select( 'core/edit-post' ).openModal( name )", {
94
+ since: '6.3',
95
+ alternative: "select( 'core/interface').openModal( name )"
96
+ });
97
+ return registry.dispatch(_interface.store).openModal(name);
98
+ };
93
99
  /**
94
100
  * Returns an action object signalling that the user closed a modal.
95
101
  *
102
+ * @deprecated since WP 6.3 use `core/interface` store's action with the same name instead.
103
+ *
96
104
  * @return {Object} Action object.
97
105
  */
98
106
 
99
107
 
100
- function closeModal() {
101
- return {
102
- type: 'CLOSE_MODAL'
103
- };
104
- }
108
+ exports.openModal = openModal;
109
+
110
+ const closeModal = () => ({
111
+ registry
112
+ }) => {
113
+ (0, _deprecated.default)("select( 'core/edit-post' ).closeModal()", {
114
+ since: '6.3',
115
+ alternative: "select( 'core/interface').closeModal()"
116
+ });
117
+ return registry.dispatch(_interface.store).closeModal();
118
+ };
105
119
  /**
106
120
  * Returns an action object used in signalling that the user opened the publish
107
121
  * sidebar.
@@ -110,6 +124,8 @@ function closeModal() {
110
124
  */
111
125
 
112
126
 
127
+ exports.closeModal = closeModal;
128
+
113
129
  function openPublishSidebar() {
114
130
  return {
115
131
  type: 'OPEN_PUBLISH_SIDEBAR'