@wordpress/edit-post 7.14.0 → 7.16.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 (113) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/build/components/device-preview/index.js +6 -6
  3. package/build/components/device-preview/index.js.map +1 -1
  4. package/build/components/header/{document-title → document-actions}/index.js +10 -11
  5. package/build/components/header/document-actions/index.js.map +1 -0
  6. package/build/components/header/header-toolbar/index.js +7 -6
  7. package/build/components/header/header-toolbar/index.js.map +1 -1
  8. package/build/components/header/header-toolbar/index.native.js +92 -49
  9. package/build/components/header/header-toolbar/index.native.js.map +1 -1
  10. package/build/components/header/index.js +4 -9
  11. package/build/components/header/index.js.map +1 -1
  12. package/build/components/header/mode-switcher/index.js +23 -4
  13. package/build/components/header/mode-switcher/index.js.map +1 -1
  14. package/build/components/header/post-publish-button-or-toggle.js +0 -2
  15. package/build/components/header/post-publish-button-or-toggle.js.map +1 -1
  16. package/build/components/layout/actions-panel.js +5 -10
  17. package/build/components/layout/actions-panel.js.map +1 -1
  18. package/build/components/layout/index.js +36 -13
  19. package/build/components/layout/index.js.map +1 -1
  20. package/build/components/secondary-sidebar/list-view-sidebar.js +2 -2
  21. package/build/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
  22. package/build/components/sidebar/discussion-panel/index.js +20 -20
  23. package/build/components/sidebar/discussion-panel/index.js.map +1 -1
  24. package/build/components/text-editor/index.js +1 -1
  25. package/build/components/text-editor/index.js.map +1 -1
  26. package/build/components/visual-editor/header.native.js +1 -13
  27. package/build/components/visual-editor/header.native.js.map +1 -1
  28. package/build/components/visual-editor/index.js +1 -1
  29. package/build/components/visual-editor/index.js.map +1 -1
  30. package/build/editor.js +2 -39
  31. package/build/editor.js.map +1 -1
  32. package/build/hooks/commands/use-common-commands.js +61 -4
  33. package/build/hooks/commands/use-common-commands.js.map +1 -1
  34. package/build/index.js +2 -1
  35. package/build/index.js.map +1 -1
  36. package/build/plugins/index.js +35 -6
  37. package/build/plugins/index.js.map +1 -1
  38. package/build/store/actions.js +12 -14
  39. package/build/store/actions.js.map +1 -1
  40. package/build-module/components/device-preview/index.js +6 -6
  41. package/build-module/components/device-preview/index.js.map +1 -1
  42. package/build-module/components/header/{document-title → document-actions}/index.js +10 -11
  43. package/build-module/components/header/document-actions/index.js.map +1 -0
  44. package/build-module/components/header/header-toolbar/index.js +7 -6
  45. package/build-module/components/header/header-toolbar/index.js.map +1 -1
  46. package/build-module/components/header/header-toolbar/index.native.js +93 -53
  47. package/build-module/components/header/header-toolbar/index.native.js.map +1 -1
  48. package/build-module/components/header/index.js +4 -9
  49. package/build-module/components/header/index.js.map +1 -1
  50. package/build-module/components/header/mode-switcher/index.js +23 -4
  51. package/build-module/components/header/mode-switcher/index.js.map +1 -1
  52. package/build-module/components/header/post-publish-button-or-toggle.js +0 -2
  53. package/build-module/components/header/post-publish-button-or-toggle.js.map +1 -1
  54. package/build-module/components/layout/actions-panel.js +5 -10
  55. package/build-module/components/layout/actions-panel.js.map +1 -1
  56. package/build-module/components/layout/index.js +37 -14
  57. package/build-module/components/layout/index.js.map +1 -1
  58. package/build-module/components/secondary-sidebar/list-view-sidebar.js +3 -3
  59. package/build-module/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
  60. package/build-module/components/sidebar/discussion-panel/index.js +21 -19
  61. package/build-module/components/sidebar/discussion-panel/index.js.map +1 -1
  62. package/build-module/components/text-editor/index.js +2 -2
  63. package/build-module/components/text-editor/index.js.map +1 -1
  64. package/build-module/components/visual-editor/header.native.js +1 -10
  65. package/build-module/components/visual-editor/header.native.js.map +1 -1
  66. package/build-module/components/visual-editor/index.js +2 -2
  67. package/build-module/components/visual-editor/index.js.map +1 -1
  68. package/build-module/editor.js +2 -38
  69. package/build-module/editor.js.map +1 -1
  70. package/build-module/hooks/commands/use-common-commands.js +60 -5
  71. package/build-module/hooks/commands/use-common-commands.js.map +1 -1
  72. package/build-module/index.js +2 -1
  73. package/build-module/index.js.map +1 -1
  74. package/build-module/plugins/index.js +33 -6
  75. package/build-module/plugins/index.js.map +1 -1
  76. package/build-module/store/actions.js +11 -14
  77. package/build-module/store/actions.js.map +1 -1
  78. package/build-style/style-rtl.css +30 -31
  79. package/build-style/style.css +30 -31
  80. package/package.json +32 -32
  81. package/src/components/device-preview/index.js +35 -39
  82. package/src/components/header/{document-title → document-actions}/index.js +22 -23
  83. package/src/components/header/{document-title → document-actions}/style.scss +25 -22
  84. package/src/components/header/header-toolbar/index.js +3 -2
  85. package/src/components/header/header-toolbar/index.native.js +125 -68
  86. package/src/components/header/header-toolbar/style.native.scss +23 -4
  87. package/src/components/header/header-toolbar/style.scss +4 -0
  88. package/src/components/header/index.js +15 -25
  89. package/src/components/header/mode-switcher/index.js +23 -4
  90. package/src/components/header/post-publish-button-or-toggle.js +0 -2
  91. package/src/components/header/style.scss +1 -1
  92. package/src/components/layout/actions-panel.js +5 -7
  93. package/src/components/layout/index.js +45 -9
  94. package/src/components/layout/style.native.scss +1 -1
  95. package/src/components/preferences-modal/test/__snapshots__/index.js.snap +16 -5
  96. package/src/components/preferences-modal/test/index.js +4 -4
  97. package/src/components/secondary-sidebar/list-view-sidebar.js +3 -3
  98. package/src/components/sidebar/discussion-panel/index.js +15 -20
  99. package/src/components/text-editor/index.js +0 -2
  100. package/src/components/visual-editor/header.native.js +1 -17
  101. package/src/components/visual-editor/index.js +1 -6
  102. package/src/components/visual-editor/test/__snapshots__/index.native.js.snap +15 -0
  103. package/src/components/visual-editor/test/index.native.js +118 -1
  104. package/src/editor.js +2 -47
  105. package/src/hooks/commands/use-common-commands.js +81 -15
  106. package/src/index.js +5 -1
  107. package/src/plugins/index.js +32 -8
  108. package/src/store/actions.js +18 -27
  109. package/src/style.scss +2 -8
  110. package/src/test/editor.native.js +4 -3
  111. package/build/components/header/document-title/index.js.map +0 -1
  112. package/build-module/components/header/document-title/index.js.map +0 -1
  113. package/src/components/visual-editor/style.native.scss +0 -18
@@ -62,12 +62,31 @@ function ModeSwitcher() {
62
62
  return null;
63
63
  }
64
64
 
65
- if (!isRichEditingEnabled || !isCodeEditingEnabled) {
66
- return null;
65
+ let selectedMode = mode;
66
+
67
+ if (!isRichEditingEnabled && mode === 'visual') {
68
+ selectedMode = 'text';
69
+ }
70
+
71
+ if (!isCodeEditingEnabled && mode === 'text') {
72
+ selectedMode = 'visual';
67
73
  }
68
74
 
69
75
  const choices = MODES.map(choice => {
70
- if (choice.value !== mode) {
76
+ if (!isCodeEditingEnabled && choice.value === 'text') {
77
+ choice = { ...choice,
78
+ disabled: true
79
+ };
80
+ }
81
+
82
+ if (!isRichEditingEnabled && choice.value === 'visual') {
83
+ choice = { ...choice,
84
+ disabled: true,
85
+ info: (0, _i18n.__)('You can enable the visual editor in your profile settings.')
86
+ };
87
+ }
88
+
89
+ if (choice.value !== selectedMode && !choice.disabled) {
71
90
  return { ...choice,
72
91
  shortcut
73
92
  };
@@ -79,7 +98,7 @@ function ModeSwitcher() {
79
98
  label: (0, _i18n.__)('Editor')
80
99
  }, (0, _element.createElement)(_components.MenuItemsChoice, {
81
100
  choices: choices,
82
- value: mode,
101
+ value: selectedMode,
83
102
  onSelect: switchEditorMode
84
103
  }));
85
104
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-post/src/components/header/mode-switcher/index.js"],"names":["MODES","value","label","ModeSwitcher","shortcut","isRichEditingEnabled","isCodeEditingEnabled","isEditingTemplate","mode","select","keyboardShortcutsStore","getShortcutRepresentation","editorStore","getEditorSettings","richEditingEnabled","codeEditingEnabled","editPostStore","getEditorMode","switchEditorMode","choices","map","choice"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AAZA;AACA;AACA;;AAOA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA,MAAMA,KAAK,GAAG,CACb;AACCC,EAAAA,KAAK,EAAE,QADR;AAECC,EAAAA,KAAK,EAAE,cAAI,eAAJ;AAFR,CADa,EAKb;AACCD,E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A,KAAK,EAAGX,IAFT;AAGC,IAAA,QAAQ,EAAGU;AAHZ,IADD,CADD;AASA;;eAEcf,Y","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: select( editPostStore ).isEditingTemplate(),\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\tif ( ! isRichEditingEnabled || ! isCodeEditingEnabled ) {\n\t\treturn null;\n\t}\n\n\tconst choices = MODES.map( ( choice ) => {\n\t\tif ( choice.value !== mode ) {\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={ mode }\n\t\t\t\tonSelect={ switchEditorMode }\n\t\t\t/>\n\t\t</MenuGroup>\n\t);\n}\n\nexport default ModeSwitcher;\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-post/src/components/header/mode-switcher/index.js"],"names":["MODES","value","label","ModeSwitcher","shortcut","isRichEditingEnabled","isCodeEditingEnabled","isEditingTemplate","mode","select","keyboardShortcutsStore","getShortcutRepresentation","editorStore","getEditorSettings","richEditingEnabled","codeEditingEnabled","editPostStore","getEditorMode","switchEditorMode","selectedMode","choices","map","choice","disabled","info"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AAZA;AACA;AACA;;AAOA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA,MAAMA,KAAK,GAAG,CACb;AACCC,EAAAA,KAAK,EAAE,QADR;AAECC,EAAAA,KAAK,EAAE,cAAI,eAAJ;AAFR,CADa,EAKb;AACCD,EAAAA,KAAK,EAAE,MADR;AAECC,EAAAA,KAAK,EAAE,cAAI,aAAJ;AAFR,CALa,CAAd;;AAWA,SAASC,YAAT,GAAwB;AACvB,QAAM;AACLC,IAAAA,QADK;AAELC,IAAAA,oBAFK;AAGLC,IAAAA,oBAHK;AAILC,IAAAA,iBAJK;AAKLC,IAAAA;AALK,MAMF,qBACDC,MAAF,KAAgB;AACfL,IAAAA,QAAQ,EAAEK,MAAM,CACfC,wBADe,CAAN,CAERC,yBAFQ,CAEmB,4BAFnB,CADK;AAIfN,IAAAA,oBAAoB,EACnBI,MAAM,CAAEG,aAAF,CAAN,CAAsBC,iBAAtB,GAA0CC,kBAL5B;AAMfR,IAAAA,oBAAoB,EACnBG,MAAM,CAAEG,aAAF,CAAN,CAAsBC,iBAAtB,GAA0CE,kBAP5B;AAQfR,IAAAA,iBAAiB,EAAEE,MAAM,CAAEO,YAAF,CAAN,CAAwBT,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K,EAAGD,YAFT;AAGC,IAAA,QAAQ,EAAGD;AAHZ,IADD,CADD;AASA;;eAEcf,Y","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: select( editPostStore ).isEditingTemplate(),\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={ selectedMode }\n\t\t\t\tonSelect={ switchEditorMode }\n\t\t\t/>\n\t\t</MenuGroup>\n\t);\n}\n\nexport default ModeSwitcher;\n"]}
@@ -25,7 +25,6 @@ var _store = require("../../store");
25
25
  */
26
26
  function PostPublishButtonOrToggle({
27
27
  forceIsDirty,
28
- forceIsSaving,
29
28
  hasPublishAction,
30
29
  isBeingScheduled,
31
30
  isPending,
@@ -75,7 +74,6 @@ function PostPublishButtonOrToggle({
75
74
 
76
75
  return (0, _element.createElement)(_editor.PostPublishButton, {
77
76
  forceIsDirty: forceIsDirty,
78
- forceIsSaving: forceIsSaving,
79
77
  isOpen: isPublishSidebarOpened,
80
78
  isToggle: component === IS_TOGGLE,
81
79
  onToggle: togglePublishSidebar,
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-post/src/components/header/post-publish-button-or-toggle.js"],"names":["PostPublishButtonOrToggle","forceIsDirty","forceIsSaving","hasPublishAction","isBeingScheduled","isPending","isPublished","isPublishSidebarEnabled","isPublishSidebarOpened","isScheduled","togglePublishSidebar","setEntitiesSavedStatesCallback","IS_TOGGLE","IS_BUTTON","isSmallerThanMediumViewport","component","select","editorStore","getCurrentPost","_links","isEditedPostBeingScheduled","isCurrentPostP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AA8B,EAAGC;AANlC,IADD;AAUA;;eAEc,sBACd,sBAAcK,MAAF;AAAA;;AAAA,SAAgB;AAC3Bb,IAAAA,gBAAgB,2BACfa,MAAM,CAAEC,aAAF,CAAN,CAAsBC,cAAtB,IAAwCC,MAAxC,GACC,mBADD,CADe,yEAGV,KAJqB;AAK3Bf,IAAAA,gBAAgB,EAAEY,MAAM,CAAEC,aAAF,CAAN,CAAsBG,0BAAtB,EALS;AAM3Bf,IAAAA,SAAS,EAAEW,MAAM,CAAEC,aAAF,CAAN,CAAsBI,oBAAtB,EANgB;AAO3Bf,IAAAA,WAAW,EAAEU,MAAM,CAAEC,aAAF,CAAN,CAAsBK,sBAAtB,EAPc;AAQ3Bf,IAAAA,uBAAuB,EACtBS,MAAM,CAAEC,aAAF,CAAN,CAAsBV,uBAAtB,EAT0B;AAU3BC,IAAAA,sBAAsB,EACrBQ,MAAM,CAAEO,YAAF,CAAN,CAAwBf,sBAAxB,EAX0B;AAY3BC,IAAAA,WAAW,EAAEO,MAAM,CAAEC,aAAF,CAAN,CAAsBO,sBAAtB;AAZc,GAAhB;AAAA,CAAZ,CADc,EAed,wBAAgBC,QAAF,IAAgB;AAC7B,QAAM;AAAEf,IAAAA;AAAF,MAA2Be,QAAQ,CAAEF,YAAF,CAAzC;AACA,SAAO;AACNb,IAAAA;AADM,GAAP;AAGA,CALD,CAfc,EAqBZV,yBArBY,C","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useViewportMatch, compose } from '@wordpress/compose';\nimport { withDispatch, withSelect } from '@wordpress/data';\nimport { PostPublishButton, store as editorStore } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../store';\n\nexport function PostPublishButtonOrToggle( {\n\tforceIsDirty,\n\tforceIsSaving,\n\thasPublishAction,\n\tisBeingScheduled,\n\tisPending,\n\tisPublished,\n\tisPublishSidebarEnabled,\n\tisPublishSidebarOpened,\n\tisScheduled,\n\ttogglePublishSidebar,\n\tsetEntitiesSavedStatesCallback,\n} ) {\n\tconst IS_TOGGLE = 'toggle';\n\tconst IS_BUTTON = 'button';\n\tconst isSmallerThanMediumViewport = useViewportMatch( 'medium', '<' );\n\tlet component;\n\n\t/**\n\t * Conditions to show a BUTTON (publish directly) or a TOGGLE (open publish sidebar):\n\t *\n\t * 1) We want to show a BUTTON when the post status is at the _final stage_\n\t * for a particular role (see https://wordpress.org/documentation/article/post-status/):\n\t *\n\t * - is published\n\t * - is scheduled to be published\n\t * - is pending and can't be published (but only for viewports >= medium).\n\t * \t Originally, we considered showing a button for pending posts that couldn't be published\n\t * \t (for example, for an author with the contributor role). Some languages can have\n\t * \t long translations for \"Submit for review\", so given the lack of UI real estate available\n\t * \t we decided to take into account the viewport in that case.\n\t * \t See: https://github.com/WordPress/gutenberg/issues/10475\n\t *\n\t * 2) Then, in small viewports, we'll show a TOGGLE.\n\t *\n\t * 3) Finally, we'll use the publish sidebar status to decide:\n\t *\n\t * - if it is enabled, we show a TOGGLE\n\t * - if it is disabled, we show a BUTTON\n\t */\n\tif (\n\t\tisPublished ||\n\t\t( isScheduled && isBeingScheduled ) ||\n\t\t( isPending && ! hasPublishAction && ! isSmallerThanMediumViewport )\n\t) {\n\t\tcomponent = IS_BUTTON;\n\t} else if ( isSmallerThanMediumViewport ) {\n\t\tcomponent = IS_TOGGLE;\n\t} else if ( isPublishSidebarEnabled ) {\n\t\tcomponent = IS_TOGGLE;\n\t} else {\n\t\tcomponent = IS_BUTTON;\n\t}\n\n\treturn (\n\t\t<PostPublishButton\n\t\t\tforceIsDirty={ forceIsDirty }\n\t\t\tforceIsSaving={ forceIsSaving }\n\t\t\tisOpen={ isPublishSidebarOpened }\n\t\t\tisToggle={ component === IS_TOGGLE }\n\t\t\tonToggle={ togglePublishSidebar }\n\t\t\tsetEntitiesSavedStatesCallback={ setEntitiesSavedStatesCallback }\n\t\t/>\n\t);\n}\n\nexport default compose(\n\twithSelect( ( select ) => ( {\n\t\thasPublishAction:\n\t\t\tselect( editorStore ).getCurrentPost()?._links?.[\n\t\t\t\t'wp:action-publish'\n\t\t\t] ?? false,\n\t\tisBeingScheduled: select( editorStore ).isEditedPostBeingScheduled(),\n\t\tisPending: select( editorStore ).isCurrentPostPending(),\n\t\tisPublished: select( editorStore ).isCurrentPostPublished(),\n\t\tisPublishSidebarEnabled:\n\t\t\tselect( editorStore ).isPublishSidebarEnabled(),\n\t\tisPublishSidebarOpened:\n\t\t\tselect( editPostStore ).isPublishSidebarOpened(),\n\t\tisScheduled: select( editorStore ).isCurrentPostScheduled(),\n\t} ) ),\n\twithDispatch( ( dispatch ) => {\n\t\tconst { togglePublishSidebar } = dispatch( editPostStore );\n\t\treturn {\n\t\t\ttogglePublishSidebar,\n\t\t};\n\t} )\n)( PostPublishButtonOrToggle );\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-post/src/components/header/post-publish-button-or-toggle.js"],"names":["PostPublishButtonOrToggle","forceIsDirty","hasPublishAction","isBeingScheduled","isPending","isPublished","isPublishSidebarEnabled","isPublishSidebarOpened","isScheduled","togglePublishSidebar","setEntitiesSavedStatesCallback","IS_TOGGLE","IS_BUTTON","isSmallerThanMediumViewport","component","select","editorStore","getCurrentPost","_links","isEditedPostBeingScheduled","isCurrentPostPending","isCurrentPostPublished","editPostStore","isCurrentPostScheduled","dispatch"],"mappings":";;;;;;;;;;AAGA;;AACA;;AACA;;AAKA;;AAVA;AACA;AACA;;AAKA;AACA;AACA;AAGO,SAASA,yBAAT,CAAoC;AAC1CC,EAAAA,YAD0C;AAE1CC,EAAAA,gBAF0C;AAG1CC,EAAAA,gBAH0C;AAI1CC,EAAAA,SAJ0C;AAK1CC,EAAAA,WAL0C;AAM1CC,EAAAA,uBAN0C;AAO1CC,EAAAA,sBAP0C;AAQ1CC,EAAAA,WAR0C;AAS1CC,EAAAA,oBAT0C;AAU1CC,EAAAA;AAV0C,CAApC,EAWH;AACH,QAAMC,SAAS,GAAG,QAAlB;AACA,QAAMC,SAAS,GAAG,QAAlB;AACA,QAA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AAAA,sBAAsB,EACrBQ,MAAM,CAAEO,YAAF,CAAN,CAAwBf,sBAAxB,EAX0B;AAY3BC,IAAAA,WAAW,EAAEO,MAAM,CAAEC,aAAF,CAAN,CAAsBO,sBAAtB;AAZc,GAAhB;AAAA,CAAZ,CADc,EAed,wBAAgBC,QAAF,IAAgB;AAC7B,QAAM;AAAEf,IAAAA;AAAF,MAA2Be,QAAQ,CAAEF,YAAF,CAAzC;AACA,SAAO;AACNb,IAAAA;AADM,GAAP;AAGA,CALD,CAfc,EAqBZT,yBArBY,C","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useViewportMatch, compose } from '@wordpress/compose';\nimport { withDispatch, withSelect } from '@wordpress/data';\nimport { PostPublishButton, store as editorStore } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../store';\n\nexport function PostPublishButtonOrToggle( {\n\tforceIsDirty,\n\thasPublishAction,\n\tisBeingScheduled,\n\tisPending,\n\tisPublished,\n\tisPublishSidebarEnabled,\n\tisPublishSidebarOpened,\n\tisScheduled,\n\ttogglePublishSidebar,\n\tsetEntitiesSavedStatesCallback,\n} ) {\n\tconst IS_TOGGLE = 'toggle';\n\tconst IS_BUTTON = 'button';\n\tconst isSmallerThanMediumViewport = useViewportMatch( 'medium', '<' );\n\tlet component;\n\n\t/**\n\t * Conditions to show a BUTTON (publish directly) or a TOGGLE (open publish sidebar):\n\t *\n\t * 1) We want to show a BUTTON when the post status is at the _final stage_\n\t * for a particular role (see https://wordpress.org/documentation/article/post-status/):\n\t *\n\t * - is published\n\t * - is scheduled to be published\n\t * - is pending and can't be published (but only for viewports >= medium).\n\t * \t Originally, we considered showing a button for pending posts that couldn't be published\n\t * \t (for example, for an author with the contributor role). Some languages can have\n\t * \t long translations for \"Submit for review\", so given the lack of UI real estate available\n\t * \t we decided to take into account the viewport in that case.\n\t * \t See: https://github.com/WordPress/gutenberg/issues/10475\n\t *\n\t * 2) Then, in small viewports, we'll show a TOGGLE.\n\t *\n\t * 3) Finally, we'll use the publish sidebar status to decide:\n\t *\n\t * - if it is enabled, we show a TOGGLE\n\t * - if it is disabled, we show a BUTTON\n\t */\n\tif (\n\t\tisPublished ||\n\t\t( isScheduled && isBeingScheduled ) ||\n\t\t( isPending && ! hasPublishAction && ! isSmallerThanMediumViewport )\n\t) {\n\t\tcomponent = IS_BUTTON;\n\t} else if ( isSmallerThanMediumViewport ) {\n\t\tcomponent = IS_TOGGLE;\n\t} else if ( isPublishSidebarEnabled ) {\n\t\tcomponent = IS_TOGGLE;\n\t} else {\n\t\tcomponent = IS_BUTTON;\n\t}\n\n\treturn (\n\t\t<PostPublishButton\n\t\t\tforceIsDirty={ forceIsDirty }\n\t\t\tisOpen={ isPublishSidebarOpened }\n\t\t\tisToggle={ component === IS_TOGGLE }\n\t\t\tonToggle={ togglePublishSidebar }\n\t\t\tsetEntitiesSavedStatesCallback={ setEntitiesSavedStatesCallback }\n\t\t/>\n\t);\n}\n\nexport default compose(\n\twithSelect( ( select ) => ( {\n\t\thasPublishAction:\n\t\t\tselect( editorStore ).getCurrentPost()?._links?.[\n\t\t\t\t'wp:action-publish'\n\t\t\t] ?? false,\n\t\tisBeingScheduled: select( editorStore ).isEditedPostBeingScheduled(),\n\t\tisPending: select( editorStore ).isCurrentPostPending(),\n\t\tisPublished: select( editorStore ).isCurrentPostPublished(),\n\t\tisPublishSidebarEnabled:\n\t\t\tselect( editorStore ).isPublishSidebarEnabled(),\n\t\tisPublishSidebarOpened:\n\t\t\tselect( editPostStore ).isPublishSidebarOpened(),\n\t\tisScheduled: select( editorStore ).isCurrentPostScheduled(),\n\t} ) ),\n\twithDispatch( ( dispatch ) => {\n\t\tconst { togglePublishSidebar } = dispatch( editPostStore );\n\t\treturn {\n\t\t\ttogglePublishSidebar,\n\t\t};\n\t} )\n)( PostPublishButtonOrToggle );\n"]}
@@ -50,16 +50,12 @@ function ActionsPanel({
50
50
  const {
51
51
  publishSidebarOpened,
52
52
  hasActiveMetaboxes,
53
- isSavingMetaBoxes,
54
53
  hasNonPostEntityChanges
55
- } = (0, _data.useSelect)(select => {
56
- return {
57
- publishSidebarOpened: select(_store.store).isPublishSidebarOpened(),
58
- hasActiveMetaboxes: select(_store.store).hasMetaBoxes(),
59
- isSavingMetaBoxes: select(_store.store).isSavingMetaBoxes(),
60
- hasNonPostEntityChanges: select(_editor.store).hasNonPostEntityChanges()
61
- };
62
- }, []);
54
+ } = (0, _data.useSelect)(select => ({
55
+ publishSidebarOpened: select(_store.store).isPublishSidebarOpened(),
56
+ hasActiveMetaboxes: select(_store.store).hasMetaBoxes(),
57
+ hasNonPostEntityChanges: select(_editor.store).hasNonPostEntityChanges()
58
+ }), []);
63
59
  const openEntitiesSavedStates = (0, _element.useCallback)(() => setEntitiesSavedStatesCallback(true), []); // It is ok for these components to be unmounted when not in visual use.
64
60
  // We don't want more than one present at a time, decide which to render.
65
61
 
@@ -69,7 +65,6 @@ function ActionsPanel({
69
65
  unmountableContent = (0, _element.createElement)(_editor.PostPublishPanel, {
70
66
  onClose: closePublishSidebar,
71
67
  forceIsDirty: hasActiveMetaboxes,
72
- forceIsSaving: isSavingMetaBoxes,
73
68
  PrePublishExtension: _pluginPrePublishPanel.default.Slot,
74
69
  PostPublishExtension: _pluginPostPublishPanel.default.Slot
75
70
  });
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-post/src/components/layout/actions-panel.js"],"names":["Fill","Slot","ActionsPanelFill","ActionsPanel","setEntitiesSavedStatesCallback","closeEntitiesSavedStates","isEntitiesSavedStatesOpen","closePublishSidebar","togglePublishSidebar","editPostStore","publishSidebarOpened","hasActiveMetaboxes","isSavingMetaBoxes","hasNonPostEntityChanges","select","isPublishSidebarOpened","hasMetaBoxes","editorStore","openEntitiesSavedStates","unmountableContent","PluginPrePublishPanel","PluginPostPublishPanel"],"mappings":";;;;;;;;;;AAWA;;AARA;;AAKA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AAjBA;AACA;AACA;;AAUA;AACA;AACA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CM,IAAAA,kBAAkB,GACjB;AAAK,MAAA,SAAS,EAAC;AAAf,OACC,4BAAC,kBAAD;AACC,MAAA,OAAO,EAAC,WADT;AAEC,MAAA,SAAS,EAAC,6DAFX;AAGC,MAAA,OAAO,EAAGD,uBAHX;AAIC,uBAAgB;AAJjB,OAMG,cAAI,iBAAJ,CANH,CADD,CADD;AAYA,GAbM,MAaA;AACNC,IAAAA,kBAAkB,GACjB;AAAK,MAAA,SAAS,EAAC;AAAf,OACC,4BAAC,kBAAD;AACC,MAAA,OAAO,EAAC,WADT;AAEC,MAAA,SAAS,EAAC,+CAFX;AAGC,MAAA,OAAO,EAAGX,oBAHX;AAIC,uBAAgB;AAJjB,OAMG,cAAI,oBAAJ,CANH,CADD,CADD;AAYA,GA/DE,CAiEH;AACA;;;AACA,SACC,qDACGF,yBAAyB,IAC1B,4BAAC,2BAAD;AAAqB,IAAA,KAAK,EAAGD;AAA7B,IAFF,EAIC,4BAAC,IAAD;AAAM,IAAA,gBAAgB;AAAtB,IAJD,EAKG,CAAEC,yBAAF,IAA+Ba,kBALlC,CADD;AASA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tEntitiesSavedStates,\n\tPostPublishPanel,\n\tstore as editorStore,\n} from '@wordpress/editor';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { Button, createSlotFill } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useCallback } from '@wordpress/element';\n/**\n * Internal dependencies\n */\nimport PluginPostPublishPanel from '../sidebar/plugin-post-publish-panel';\nimport PluginPrePublishPanel from '../sidebar/plugin-pre-publish-panel';\nimport { store as editPostStore } from '../../store';\n\nconst { Fill, Slot } = createSlotFill( 'ActionsPanel' );\n\nexport const ActionsPanelFill = Fill;\n\nexport default function ActionsPanel( {\n\tsetEntitiesSavedStatesCallback,\n\tcloseEntitiesSavedStates,\n\tisEntitiesSavedStatesOpen,\n} ) {\n\tconst { closePublishSidebar, togglePublishSidebar } =\n\t\tuseDispatch( editPostStore );\n\tconst {\n\t\tpublishSidebarOpened,\n\t\thasActiveMetaboxes,\n\t\tisSavingMetaBoxes,\n\t\thasNonPostEntityChanges,\n\t} = useSelect( ( select ) => {\n\t\treturn {\n\t\t\tpublishSidebarOpened:\n\t\t\t\tselect( editPostStore ).isPublishSidebarOpened(),\n\t\t\thasActiveMetaboxes: select( editPostStore ).hasMetaBoxes(),\n\t\t\tisSavingMetaBoxes: select( editPostStore ).isSavingMetaBoxes(),\n\t\t\thasNonPostEntityChanges:\n\t\t\t\tselect( editorStore ).hasNonPostEntityChanges(),\n\t\t};\n\t}, [] );\n\n\tconst openEntitiesSavedStates = useCallback(\n\t\t() => setEntitiesSavedStatesCallback( true ),\n\t\t[]\n\t);\n\n\t// It is ok for these components to be unmounted when not in visual use.\n\t// We don't want more than one present at a time, decide which to render.\n\tlet unmountableContent;\n\tif ( publishSidebarOpened ) {\n\t\tunmountableContent = (\n\t\t\t<PostPublishPanel\n\t\t\t\tonClose={ closePublishSidebar }\n\t\t\t\tforceIsDirty={ hasActiveMetaboxes }\n\t\t\t\tforceIsSaving={ isSavingMetaBoxes }\n\t\t\t\tPrePublishExtension={ PluginPrePublishPanel.Slot }\n\t\t\t\tPostPublishExtension={ PluginPostPublishPanel.Slot }\n\t\t\t/>\n\t\t);\n\t} else if ( hasNonPostEntityChanges ) {\n\t\tunmountableContent = (\n\t\t\t<div className=\"edit-post-layout__toggle-entities-saved-states-panel\">\n\t\t\t\t<Button\n\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\tclassName=\"edit-post-layout__toggle-entities-saved-states-panel-button\"\n\t\t\t\t\tonClick={ openEntitiesSavedStates }\n\t\t\t\t\taria-expanded={ false }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Open save panel' ) }\n\t\t\t\t</Button>\n\t\t\t</div>\n\t\t);\n\t} else {\n\t\tunmountableContent = (\n\t\t\t<div className=\"edit-post-layout__toggle-publish-panel\">\n\t\t\t\t<Button\n\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\tclassName=\"edit-post-layout__toggle-publish-panel-button\"\n\t\t\t\t\tonClick={ togglePublishSidebar }\n\t\t\t\t\taria-expanded={ false }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Open publish panel' ) }\n\t\t\t\t</Button>\n\t\t\t</div>\n\t\t);\n\t}\n\n\t// Since EntitiesSavedStates controls its own panel, we can keep it\n\t// always mounted to retain its own component state (such as checkboxes).\n\treturn (\n\t\t<>\n\t\t\t{ isEntitiesSavedStatesOpen && (\n\t\t\t\t<EntitiesSavedStates close={ closeEntitiesSavedStates } />\n\t\t\t) }\n\t\t\t<Slot bubblesVirtually />\n\t\t\t{ ! isEntitiesSavedStatesOpen && unmountableContent }\n\t\t</>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-post/src/components/layout/actions-panel.js"],"names":["Fill","Slot","ActionsPanelFill","ActionsPanel","setEntitiesSavedStatesCallback","closeEntitiesSavedStates","isEntitiesSavedStatesOpen","closePublishSidebar","togglePublishSidebar","editPostStore","publishSidebarOpened","hasActiveMetaboxes","hasNonPostEntityChanges","select","isPublishSidebarOpened","hasMetaBoxes","editorStore","openEntitiesSavedStates","unmountableContent","PluginPrePublishPanel","PluginPostPublishPanel"],"mappings":";;;;;;;;;;AAWA;;AARA;;AAKA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AAjBA;AACA;AACA;;AAUA;AACA;AACA;AAKA,MAAM;AAAEA,EAAAA,IAAF;AAAQC,EAAAA;AAAR,IAAiB,gCAAgB,cAAhB,CAAvB;AAEO,MAAMC,gBAAgB,GAAGF,IAAzB;;;AAEQ,SAASG,YAAT,CAAuB;AACrCC,EAAAA,8BADqC;AAErCC,EAAAA,wBAFqC;AAGrCC,EAAAA;AAHqC,CAAvB,EAIX;AACH,QAAM;AAAEC,IAAAA,mBAAF;AAAuBC,IAAAA;AAAvB,MACL,uBAAaC,YAAb,CADD;AAEA,QAAM;AACLC,IAAAA,oBADK;AAELC,IAAAA,kB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GF,yBAAyB,IAC1B,4BAAC,2BAAD;AAAqB,IAAA,KAAK,EAAGD;AAA7B,IAFF,EAIC,4BAAC,IAAD;AAAM,IAAA,gBAAgB;AAAtB,IAJD,EAKG,CAAEC,yBAAF,IAA+BY,kBALlC,CADD;AASA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tEntitiesSavedStates,\n\tPostPublishPanel,\n\tstore as editorStore,\n} from '@wordpress/editor';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { Button, createSlotFill } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useCallback } from '@wordpress/element';\n/**\n * Internal dependencies\n */\nimport PluginPostPublishPanel from '../sidebar/plugin-post-publish-panel';\nimport PluginPrePublishPanel from '../sidebar/plugin-pre-publish-panel';\nimport { store as editPostStore } from '../../store';\n\nconst { Fill, Slot } = createSlotFill( 'ActionsPanel' );\n\nexport const ActionsPanelFill = Fill;\n\nexport default function ActionsPanel( {\n\tsetEntitiesSavedStatesCallback,\n\tcloseEntitiesSavedStates,\n\tisEntitiesSavedStatesOpen,\n} ) {\n\tconst { closePublishSidebar, togglePublishSidebar } =\n\t\tuseDispatch( editPostStore );\n\tconst {\n\t\tpublishSidebarOpened,\n\t\thasActiveMetaboxes,\n\t\thasNonPostEntityChanges,\n\t} = useSelect(\n\t\t( select ) => ( {\n\t\t\tpublishSidebarOpened:\n\t\t\t\tselect( editPostStore ).isPublishSidebarOpened(),\n\t\t\thasActiveMetaboxes: select( editPostStore ).hasMetaBoxes(),\n\t\t\thasNonPostEntityChanges:\n\t\t\t\tselect( editorStore ).hasNonPostEntityChanges(),\n\t\t} ),\n\t\t[]\n\t);\n\n\tconst openEntitiesSavedStates = useCallback(\n\t\t() => setEntitiesSavedStatesCallback( true ),\n\t\t[]\n\t);\n\n\t// It is ok for these components to be unmounted when not in visual use.\n\t// We don't want more than one present at a time, decide which to render.\n\tlet unmountableContent;\n\tif ( publishSidebarOpened ) {\n\t\tunmountableContent = (\n\t\t\t<PostPublishPanel\n\t\t\t\tonClose={ closePublishSidebar }\n\t\t\t\tforceIsDirty={ hasActiveMetaboxes }\n\t\t\t\tPrePublishExtension={ PluginPrePublishPanel.Slot }\n\t\t\t\tPostPublishExtension={ PluginPostPublishPanel.Slot }\n\t\t\t/>\n\t\t);\n\t} else if ( hasNonPostEntityChanges ) {\n\t\tunmountableContent = (\n\t\t\t<div className=\"edit-post-layout__toggle-entities-saved-states-panel\">\n\t\t\t\t<Button\n\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\tclassName=\"edit-post-layout__toggle-entities-saved-states-panel-button\"\n\t\t\t\t\tonClick={ openEntitiesSavedStates }\n\t\t\t\t\taria-expanded={ false }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Open save panel' ) }\n\t\t\t\t</Button>\n\t\t\t</div>\n\t\t);\n\t} else {\n\t\tunmountableContent = (\n\t\t\t<div className=\"edit-post-layout__toggle-publish-panel\">\n\t\t\t\t<Button\n\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\tclassName=\"edit-post-layout__toggle-publish-panel-button\"\n\t\t\t\t\tonClick={ togglePublishSidebar }\n\t\t\t\t\taria-expanded={ false }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Open publish panel' ) }\n\t\t\t\t</Button>\n\t\t\t</div>\n\t\t);\n\t}\n\n\t// Since EntitiesSavedStates controls its own panel, we can keep it\n\t// always mounted to retain its own component state (such as checkboxes).\n\treturn (\n\t\t<>\n\t\t\t{ isEntitiesSavedStatesOpen && (\n\t\t\t\t<EntitiesSavedStates close={ closeEntitiesSavedStates } />\n\t\t\t) }\n\t\t\t<Slot bubblesVirtually />\n\t\t\t{ ! isEntitiesSavedStatesOpen && unmountableContent }\n\t\t</>\n\t);\n}\n"]}
@@ -75,7 +75,7 @@ var _lockUnlock = require("../../lock-unlock");
75
75
  * Internal dependencies
76
76
  */
77
77
  const {
78
- BlockRemovalWarningModal
78
+ getLayoutStyles
79
79
  } = (0, _lockUnlock.unlock)(_blockEditor.privateApis);
80
80
  const interfaceLabels = {
81
81
  /* translators: accessibility text for the editor top bar landmark region. */
@@ -93,13 +93,8 @@ const interfaceLabels = {
93
93
  /* translators: accessibility text for the editor footer landmark region. */
94
94
  footer: (0, _i18n.__)('Editor footer')
95
95
  };
96
- const blockRemovalRules = {
97
- 'core/footnotes': (0, _i18n.__)('The Footnotes block displays all footnotes found in the content. Note that any footnotes in the content will persist after removing this block.')
98
- };
99
96
 
100
- function Layout({
101
- styles
102
- }) {
97
+ function Layout() {
103
98
  const isMobileViewport = (0, _compose.useViewportMatch)('medium', '<');
104
99
  const isHugeViewport = (0, _compose.useViewportMatch)('huge', '>=');
105
100
  const isLargeViewport = (0, _compose.useViewportMatch)('large');
@@ -127,14 +122,43 @@ function Layout({
127
122
  isDistractionFree,
128
123
  showBlockBreadcrumbs,
129
124
  isTemplateMode,
130
- documentLabel
125
+ documentLabel,
126
+ styles
131
127
  } = (0, _data.useSelect)(select => {
132
128
  const {
133
129
  getEditorSettings,
134
130
  getPostTypeLabel
135
131
  } = select(_editor.store);
132
+ const {
133
+ isFeatureActive
134
+ } = select(_store.store);
136
135
  const editorSettings = getEditorSettings();
137
136
  const postTypeLabel = getPostTypeLabel();
137
+ const hasThemeStyles = isFeatureActive('themeStyles');
138
+ const themeStyles = [];
139
+ const presetStyles = [];
140
+ editorSettings.styles?.forEach(style => {
141
+ if (!style.__unstableType || style.__unstableType === 'theme') {
142
+ themeStyles.push(style);
143
+ } else {
144
+ presetStyles.push(style);
145
+ }
146
+ });
147
+ const defaultEditorStyles = [...editorSettings.defaultEditorStyles, ...presetStyles]; // If theme styles are not present or displayed, ensure that
148
+ // base layout styles are still present in the editor.
149
+
150
+ if (!editorSettings.disableLayoutStyles && !(hasThemeStyles && themeStyles.length)) {
151
+ defaultEditorStyles.push({
152
+ css: getLayoutStyles({
153
+ style: {},
154
+ selector: 'body',
155
+ hasBlockGapSupport: false,
156
+ hasFallbackGapSupport: true,
157
+ fallbackGapValue: '0.5em'
158
+ })
159
+ });
160
+ }
161
+
138
162
  return {
139
163
  isTemplateMode: select(_store.store).isEditingTemplate(),
140
164
  hasFixedToolbar: select(_store.store).isFeatureActive('fixedToolbar'),
@@ -151,7 +175,8 @@ function Layout({
151
175
  isDistractionFree: select(_store.store).isFeatureActive('distractionFree'),
152
176
  showBlockBreadcrumbs: select(_store.store).isFeatureActive('showBlockBreadcrumbs'),
153
177
  // translators: Default label for the Document in the Block Breadcrumb.
154
- documentLabel: postTypeLabel || (0, _i18n._x)('Document', 'noun')
178
+ documentLabel: postTypeLabel || (0, _i18n._x)('Document', 'noun'),
179
+ styles: hasThemeStyles && themeStyles.length ? editorSettings.styles : defaultEditorStyles
155
180
  };
156
181
  }, []);
157
182
 
@@ -208,9 +233,7 @@ function Layout({
208
233
 
209
234
  return (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(_interface.FullscreenMode, {
210
235
  isActive: isFullscreenActive
211
- }), (0, _element.createElement)(_browserUrl.default, null), (0, _element.createElement)(_editor.UnsavedChangesWarning, null), (0, _element.createElement)(_editor.AutosaveMonitor, null), (0, _element.createElement)(_editor.LocalAutosaveMonitor, null), (0, _element.createElement)(_keyboardShortcuts2.default, null), (0, _element.createElement)(_editor.EditorKeyboardShortcutsRegister, null), (0, _element.createElement)(BlockRemovalWarningModal, {
212
- rules: blockRemovalRules
213
- }), (0, _element.createElement)(_settingsSidebar.default, null), (0, _element.createElement)(_interface.InterfaceSkeleton, {
236
+ }), (0, _element.createElement)(_browserUrl.default, null), (0, _element.createElement)(_editor.UnsavedChangesWarning, null), (0, _element.createElement)(_editor.AutosaveMonitor, null), (0, _element.createElement)(_editor.LocalAutosaveMonitor, null), (0, _element.createElement)(_keyboardShortcuts2.default, null), (0, _element.createElement)(_editor.EditorKeyboardShortcutsRegister, null), (0, _element.createElement)(_editor.EditorKeyboardShortcuts, null), (0, _element.createElement)(_settingsSidebar.default, null), (0, _element.createElement)(_interface.InterfaceSkeleton, {
214
237
  isDistractionFree: isDistractionFree && isLargeViewport,
215
238
  className: className,
216
239
  labels: { ...interfaceLabels,
@@ -255,7 +278,7 @@ function Layout({
255
278
  previous: previousShortcut,
256
279
  next: nextShortcut
257
280
  }
258
- }), (0, _element.createElement)(_preferencesModal.default, null), (0, _element.createElement)(_keyboardShortcutHelpModal.default, null), (0, _element.createElement)(_welcomeGuide.default, null), (0, _element.createElement)(_startPageOptions.default, null), (0, _element.createElement)(_components.Popover.Slot, null), (0, _element.createElement)(_plugins.PluginArea, {
281
+ }), (0, _element.createElement)(_preferencesModal.default, null), (0, _element.createElement)(_keyboardShortcutHelpModal.default, null), (0, _element.createElement)(_welcomeGuide.default, null), (0, _element.createElement)(_editor.PostSyncStatusModal, null), (0, _element.createElement)(_startPageOptions.default, null), (0, _element.createElement)(_components.Popover.Slot, null), (0, _element.createElement)(_plugins.PluginArea, {
259
282
  onError: onPluginAreaError
260
283
  }));
261
284
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-post/src/components/layout/index.js"],"names":["BlockRemovalWarningModal","blockEditorPrivateApis","interfaceLabels","header","body","sidebar","actions","footer","blockRemovalRules","Layout","styles","isMobileViewport","isHugeViewport","isLargeViewport","openGeneralSidebar","closeGeneralSidebar","setIsInserterOpened","editPostStore","createErrorNotice","noticesStore","mode","isFullscreenActive","isRichEditingEnabled","sidebarIsOpened","hasActiveMetaboxes","hasFixedToolbar","previousShortcut","nextShortcut","hasBlockSelected","isInserterOpened","isListViewOpened","showIconLabels","isDistractionFree","showBlockBreadcrumbs","isTemplateMode","documentLabel","select","getEditorSettings","getPostTypeLabel","editorStore","editorSettings","postTypeLabel","isEditingTemplate","isFeatureActive","interfaceStore","getActiveComplementaryArea","name","isPublishSidebarOpened","getEditorMode","richEditingEnabled","hasMetaBoxes","keyboardShortcutsStore","getAllShortcutKeyCombinations","openSidebarPanel","entitiesSavedStatesCallback","setEntitiesSavedStatesCallback","closeEntitiesSavedStates","arg","className","secondarySidebarLabel","secondarySidebar","onPlugin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ApB,IACD,4BAAC,sBAAD,OAfF,CAvCF;AA0DC,IAAA,MAAM,EACL,CAAES,iBAAF,IACA,CAAErB,gBADF,IAEAsB,oBAFA,IAGAX,oBAHA,IAIAF,IAAI,KAAK,QAJT,IAKC;AAAK,MAAA,SAAS,EAAC;AAAf,OACC,4BAAC,4BAAD;AAAiB,MAAA,aAAa,EAAGe;AAAjC,MADD,CAhEH;AAqEC,IAAA,OAAO,EACN,4BAAC,qBAAD;AACC,MAAA,wBAAwB,EAAGqB,wBAD5B;AAEC,MAAA,yBAAyB,EACxBF,2BAHF;AAKC,MAAA,8BAA8B,EAC7BC;AANF,MAtEF;AAgFC,IAAA,SAAS,EAAG;AACXO,MAAAA,QAAQ,EAAEpC,gBADC;AAEXqC,MAAAA,IAAI,EAAEpC;AAFK;AAhFb,IAVD,EA+FC,4BAAC,yBAAD,OA/FD,EAgGC,4BAAC,kCAAD,OAhGD,EAiGC,4BAAC,qBAAD,OAjGD,EAkGC,4BAAC,yBAAD,OAlGD,EAmGC,4BAAC,mBAAD,CAAS,IAAT,OAnGD,EAoGC,4BAAC,mBAAD;AAAY,IAAA,OAAO,EAAGkC;AAAtB,IApGD,CADD;AAwGA;;eAEcpD,M","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tAutosaveMonitor,\n\tLocalAutosaveMonitor,\n\tUnsavedChangesWarning,\n\tEditorNotices,\n\tEditorKeyboardShortcutsRegister,\n\tEditorSnackbars,\n\tstore as editorStore,\n} from '@wordpress/editor';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tBlockBreadcrumb,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\nimport { Button, ScrollLock, Popover } from '@wordpress/components';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { PluginArea } from '@wordpress/plugins';\nimport { __, _x, sprintf } from '@wordpress/i18n';\nimport {\n\tComplementaryArea,\n\tFullscreenMode,\n\tInterfaceSkeleton,\n\tstore as interfaceStore,\n} from '@wordpress/interface';\nimport { useState, useEffect, useCallback } from '@wordpress/element';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\nimport { store as noticesStore } from '@wordpress/notices';\n\n/**\n * Internal dependencies\n */\nimport TextEditor from '../text-editor';\nimport VisualEditor from '../visual-editor';\nimport EditPostKeyboardShortcuts from '../keyboard-shortcuts';\nimport KeyboardShortcutHelpModal from '../keyboard-shortcut-help-modal';\nimport EditPostPreferencesModal from '../preferences-modal';\nimport BrowserURL from '../browser-url';\nimport Header from '../header';\nimport InserterSidebar from '../secondary-sidebar/inserter-sidebar';\nimport ListViewSidebar from '../secondary-sidebar/list-view-sidebar';\nimport SettingsSidebar from '../sidebar/settings-sidebar';\nimport MetaBoxes from '../meta-boxes';\nimport WelcomeGuide from '../welcome-guide';\nimport ActionsPanel from './actions-panel';\nimport StartPageOptions from '../start-page-options';\nimport { store as editPostStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nconst { BlockRemovalWarningModal } = unlock( blockEditorPrivateApis );\n\nconst interfaceLabels = {\n\t/* translators: accessibility text for the editor top bar landmark region. */\n\theader: __( 'Editor top bar' ),\n\t/* translators: accessibility text for the editor content landmark region. */\n\tbody: __( 'Editor content' ),\n\t/* translators: accessibility text for the editor settings landmark region. */\n\tsidebar: __( 'Editor settings' ),\n\t/* translators: accessibility text for the editor publish landmark region. */\n\tactions: __( 'Editor publish' ),\n\t/* translators: accessibility text for the editor footer landmark region. */\n\tfooter: __( 'Editor footer' ),\n};\n\nconst blockRemovalRules = {\n\t'core/footnotes': __(\n\t\t'The Footnotes block displays all footnotes found in the content. Note that any footnotes in the content will persist after removing this block.'\n\t),\n};\n\nfunction Layout( { styles } ) {\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\tconst isHugeViewport = useViewportMatch( 'huge', '>=' );\n\tconst isLargeViewport = useViewportMatch( 'large' );\n\tconst { openGeneralSidebar, closeGeneralSidebar, setIsInserterOpened } =\n\t\tuseDispatch( editPostStore );\n\tconst { createErrorNotice } = useDispatch( noticesStore );\n\tconst {\n\t\tmode,\n\t\tisFullscreenActive,\n\t\tisRichEditingEnabled,\n\t\tsidebarIsOpened,\n\t\thasActiveMetaboxes,\n\t\thasFixedToolbar,\n\t\tpreviousShortcut,\n\t\tnextShortcut,\n\t\thasBlockSelected,\n\t\tisInserterOpened,\n\t\tisListViewOpened,\n\t\tshowIconLabels,\n\t\tisDistractionFree,\n\t\tshowBlockBreadcrumbs,\n\t\tisTemplateMode,\n\t\tdocumentLabel,\n\t} = useSelect( ( select ) => {\n\t\tconst { getEditorSettings, getPostTypeLabel } = select( editorStore );\n\t\tconst editorSettings = getEditorSettings();\n\t\tconst postTypeLabel = getPostTypeLabel();\n\n\t\treturn {\n\t\t\tisTemplateMode: select( editPostStore ).isEditingTemplate(),\n\t\t\thasFixedToolbar:\n\t\t\t\tselect( editPostStore ).isFeatureActive( 'fixedToolbar' ),\n\t\t\tsidebarIsOpened: !! (\n\t\t\t\tselect( interfaceStore ).getActiveComplementaryArea(\n\t\t\t\t\teditPostStore.name\n\t\t\t\t) || select( editPostStore ).isPublishSidebarOpened()\n\t\t\t),\n\t\t\tisFullscreenActive:\n\t\t\t\tselect( editPostStore ).isFeatureActive( 'fullscreenMode' ),\n\t\t\tisInserterOpened: select( editPostStore ).isInserterOpened(),\n\t\t\tisListViewOpened: select( editPostStore ).isListViewOpened(),\n\t\t\tmode: select( editPostStore ).getEditorMode(),\n\t\t\tisRichEditingEnabled: editorSettings.richEditingEnabled,\n\t\t\thasActiveMetaboxes: select( editPostStore ).hasMetaBoxes(),\n\t\t\tpreviousShortcut: select(\n\t\t\t\tkeyboardShortcutsStore\n\t\t\t).getAllShortcutKeyCombinations( 'core/edit-post/previous-region' ),\n\t\t\tnextShortcut: select(\n\t\t\t\tkeyboardShortcutsStore\n\t\t\t).getAllShortcutKeyCombinations( 'core/edit-post/next-region' ),\n\t\t\tshowIconLabels:\n\t\t\t\tselect( editPostStore ).isFeatureActive( 'showIconLabels' ),\n\t\t\tisDistractionFree:\n\t\t\t\tselect( editPostStore ).isFeatureActive( 'distractionFree' ),\n\t\t\tshowBlockBreadcrumbs: select( editPostStore ).isFeatureActive(\n\t\t\t\t'showBlockBreadcrumbs'\n\t\t\t),\n\t\t\t// translators: Default label for the Document in the Block Breadcrumb.\n\t\t\tdocumentLabel: postTypeLabel || _x( 'Document', 'noun' ),\n\t\t};\n\t}, [] );\n\n\tconst openSidebarPanel = () =>\n\t\topenGeneralSidebar(\n\t\t\thasBlockSelected ? 'edit-post/block' : 'edit-post/document'\n\t\t);\n\n\t// Inserter and Sidebars are mutually exclusive\n\tuseEffect( () => {\n\t\tif ( sidebarIsOpened && ! isHugeViewport ) {\n\t\t\tsetIsInserterOpened( false );\n\t\t}\n\t}, [ sidebarIsOpened, isHugeViewport ] );\n\tuseEffect( () => {\n\t\tif ( isInserterOpened && ! isHugeViewport ) {\n\t\t\tcloseGeneralSidebar();\n\t\t}\n\t}, [ isInserterOpened, isHugeViewport ] );\n\n\t// Local state for save panel.\n\t// Note 'truthy' callback implies an open panel.\n\tconst [ entitiesSavedStatesCallback, setEntitiesSavedStatesCallback ] =\n\t\tuseState( false );\n\tconst closeEntitiesSavedStates = useCallback(\n\t\t( arg ) => {\n\t\t\tif ( typeof entitiesSavedStatesCallback === 'function' ) {\n\t\t\t\tentitiesSavedStatesCallback( arg );\n\t\t\t}\n\t\t\tsetEntitiesSavedStatesCallback( false );\n\t\t},\n\t\t[ entitiesSavedStatesCallback ]\n\t);\n\n\tconst className = classnames( 'edit-post-layout', 'is-mode-' + mode, {\n\t\t'is-sidebar-opened': sidebarIsOpened,\n\t\t'has-fixed-toolbar': hasFixedToolbar,\n\t\t'has-metaboxes': hasActiveMetaboxes,\n\t\t'show-icon-labels': showIconLabels,\n\t\t'is-distraction-free': isDistractionFree && isLargeViewport,\n\t\t'is-entity-save-view-open': !! entitiesSavedStatesCallback,\n\t} );\n\n\tconst secondarySidebarLabel = isListViewOpened\n\t\t? __( 'Document Overview' )\n\t\t: __( 'Block Library' );\n\n\tconst secondarySidebar = () => {\n\t\tif ( mode === 'visual' && isInserterOpened ) {\n\t\t\treturn <InserterSidebar />;\n\t\t}\n\t\tif ( mode === 'visual' && isListViewOpened ) {\n\t\t\treturn <ListViewSidebar />;\n\t\t}\n\n\t\treturn null;\n\t};\n\n\tfunction onPluginAreaError( name ) {\n\t\tcreateErrorNotice(\n\t\t\tsprintf(\n\t\t\t\t/* translators: %s: plugin name */\n\t\t\t\t__(\n\t\t\t\t\t'The \"%s\" plugin has encountered an error and cannot be rendered.'\n\t\t\t\t),\n\t\t\t\tname\n\t\t\t)\n\t\t);\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<FullscreenMode isActive={ isFullscreenActive } />\n\t\t\t<BrowserURL />\n\t\t\t<UnsavedChangesWarning />\n\t\t\t<AutosaveMonitor />\n\t\t\t<LocalAutosaveMonitor />\n\t\t\t<EditPostKeyboardShortcuts />\n\t\t\t<EditorKeyboardShortcutsRegister />\n\t\t\t<BlockRemovalWarningModal rules={ blockRemovalRules } />\n\t\t\t<SettingsSidebar />\n\t\t\t<InterfaceSkeleton\n\t\t\t\tisDistractionFree={ isDistractionFree && isLargeViewport }\n\t\t\t\tclassName={ className }\n\t\t\t\tlabels={ {\n\t\t\t\t\t...interfaceLabels,\n\t\t\t\t\tsecondarySidebar: secondarySidebarLabel,\n\t\t\t\t} }\n\t\t\t\theader={\n\t\t\t\t\t<Header\n\t\t\t\t\t\tsetEntitiesSavedStatesCallback={\n\t\t\t\t\t\t\tsetEntitiesSavedStatesCallback\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t}\n\t\t\t\teditorNotices={ <EditorNotices /> }\n\t\t\t\tsecondarySidebar={ secondarySidebar() }\n\t\t\t\tsidebar={\n\t\t\t\t\t( ! isMobileViewport || sidebarIsOpened ) && (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t{ ! isMobileViewport && ! sidebarIsOpened && (\n\t\t\t\t\t\t\t\t<div className=\"edit-post-layout__toggle-sidebar-panel\">\n\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\t\t\t\t\tclassName=\"edit-post-layout__toggle-sidebar-panel-button\"\n\t\t\t\t\t\t\t\t\t\tonClick={ openSidebarPanel }\n\t\t\t\t\t\t\t\t\t\taria-expanded={ false }\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{ hasBlockSelected\n\t\t\t\t\t\t\t\t\t\t\t? __( 'Open block settings' )\n\t\t\t\t\t\t\t\t\t\t\t: __( 'Open document settings' ) }\n\t\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t<ComplementaryArea.Slot scope=\"core/edit-post\" />\n\t\t\t\t\t\t</>\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t\tnotices={ <EditorSnackbars /> }\n\t\t\t\tcontent={\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ ! isDistractionFree && <EditorNotices /> }\n\t\t\t\t\t\t{ ( mode === 'text' || ! isRichEditingEnabled ) && (\n\t\t\t\t\t\t\t<TextEditor />\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ isRichEditingEnabled && mode === 'visual' && (\n\t\t\t\t\t\t\t<VisualEditor styles={ styles } />\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ ! isDistractionFree && ! isTemplateMode && (\n\t\t\t\t\t\t\t<div className=\"edit-post-layout__metaboxes\">\n\t\t\t\t\t\t\t\t<MetaBoxes location=\"normal\" />\n\t\t\t\t\t\t\t\t<MetaBoxes location=\"advanced\" />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ isMobileViewport && sidebarIsOpened && (\n\t\t\t\t\t\t\t<ScrollLock />\n\t\t\t\t\t\t) }\n\t\t\t\t\t</>\n\t\t\t\t}\n\t\t\t\tfooter={\n\t\t\t\t\t! isDistractionFree &&\n\t\t\t\t\t! isMobileViewport &&\n\t\t\t\t\tshowBlockBreadcrumbs &&\n\t\t\t\t\tisRichEditingEnabled &&\n\t\t\t\t\tmode === 'visual' && (\n\t\t\t\t\t\t<div className=\"edit-post-layout__footer\">\n\t\t\t\t\t\t\t<BlockBreadcrumb rootLabelText={ documentLabel } />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t\tactions={\n\t\t\t\t\t<ActionsPanel\n\t\t\t\t\t\tcloseEntitiesSavedStates={ closeEntitiesSavedStates }\n\t\t\t\t\t\tisEntitiesSavedStatesOpen={\n\t\t\t\t\t\t\tentitiesSavedStatesCallback\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsetEntitiesSavedStatesCallback={\n\t\t\t\t\t\t\tsetEntitiesSavedStatesCallback\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t}\n\t\t\t\tshortcuts={ {\n\t\t\t\t\tprevious: previousShortcut,\n\t\t\t\t\tnext: nextShortcut,\n\t\t\t\t} }\n\t\t\t/>\n\t\t\t<EditPostPreferencesModal />\n\t\t\t<KeyboardShortcutHelpModal />\n\t\t\t<WelcomeGuide />\n\t\t\t<StartPageOptions />\n\t\t\t<Popover.Slot />\n\t\t\t<PluginArea onError={ onPluginAreaError } />\n\t\t</>\n\t);\n}\n\nexport default Layout;\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-post/src/components/layout/index.js"],"names":["getLayoutStyles","blockEditorPrivateApis","interfaceLabels","header","body","sidebar","actions","footer","Layout","isMobileViewport","isHugeViewport","isLargeViewport","openGeneralSidebar","closeGeneralSidebar","setIsInserterOpened","editPostStore","createErrorNotice","noticesStore","mode","isFullscreenActive","isRichEditingEnabled","sidebarIsOpened","hasActiveMetaboxes","hasFixedToolbar","previousShortcut","nextShortcut","hasBlockSelected","isInserterOpened","isListViewOpened","showIconLabels","isDistractionFree","showBlockBreadcrumbs","isTemplateMode","documentLabel","styles","select","getEditorSettings","getPostTypeLabel","editorStore","isFeatureActive","editorSettings","postTypeLabel","hasThemeStyles","themeStyles","presetStyles","forEach","style","__unstableType","push","defaultEditorStyles","disableLayoutStyles","length","css","selector","hasBlockGapSupport","hasFallbackGapSupport","fallbackGapValue","isEditingTemplate","interfaceStore","getActiveComplementaryArea","name","isPublishSidebarOpened","getEditorMode","richEditingEnabled","hasMetaBoxes","keyboardShortcutsStore","getAllShortcutKeyCombinations","openSidebarPanel","entitiesSavedStatesCallback","setEntitiesSavedStatesCallback","closeEntitiesSavedStates","arg","className","secondarySidebarLabel","secondarySidebar","onPluginAreaError","previous","next"],"mappings":";;;;;;;;;AAkCA;;AA/BA;;AAKA;;AAWA;;AACA;;AAIA;;AACA;;AACA;;AACA;;AACA;;AAOA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAxDA;AACA;AACA;;AAGA;AACA;AACA;;AA+BA;AACA;AACA;AAkBA,MAAM;AAAEA,EAAAA;AAAF,IAAsB,wBAAQC,wBAAR,CAA5B;AAEA,MAAMC,eAAe,GAAG;AACvB;AACAC,EAAAA,MAAM,EAAE,cAAI,gBAAJ,CAFe;;AAGvB;AACAC,EAAAA,IAAI,EAAE,cAAI,gBAAJ,CAJiB;;AAKvB;AACAC,EAAAA,OAAO,EAAE,cAAI,iBAAJ,CANc;;AAOvB;AACAC,EAAAA,OAAO,EAAE,cAAI,gBAAJ,CARc;;AASvB;AACAC,EAAAA,MAAM,EAAE,cAAI,eAAJ;AAVe,CAAxB;;AAaA,SAASC,MAAT,GAAkB;AACjB,QAAMC,gBAAgB,GAAG,+BAAkB,QAAlB,EAA4B,GAA5B,CAAzB;AACA,QAAMC,cAAc,GAAG,+BAAkB,MAAlB,EAA0B,IAA1B,CAAvB;AACA,QAAMC,eAAe,GAAG,+BA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EAAC;AAAf,OACC,4BAAC,kBAAD;AAAW,MAAA,QAAQ,EAAC;AAApB,MADD,EAEC,4BAAC,kBAAD;AAAW,MAAA,QAAQ,EAAC;AAApB,MAFD,CATF,EAcGvB,gBAAgB,IAAIY,eAApB,IACD,4BAAC,sBAAD,OAfF,CAvCF;AA0DC,IAAA,MAAM,EACL,CAAES,iBAAF,IACA,CAAErB,gBADF,IAEAsB,oBAFA,IAGAX,oBAHA,IAIAF,IAAI,KAAK,QAJT,IAKC;AAAK,MAAA,SAAS,EAAC;AAAf,OACC,4BAAC,4BAAD;AAAiB,MAAA,aAAa,EAAGe;AAAjC,MADD,CAhEH;AAqEC,IAAA,OAAO,EACN,4BAAC,qBAAD;AACC,MAAA,wBAAwB,EAAGqC,wBAD5B;AAEC,MAAA,yBAAyB,EACxBF,2BAHF;AAKC,MAAA,8BAA8B,EAC7BC;AANF,MAtEF;AAgFC,IAAA,SAAS,EAAG;AACXO,MAAAA,QAAQ,EAAEpD,gBADC;AAEXqD,MAAAA,IAAI,EAAEpD;AAFK;AAhFb,IAVD,EA+FC,4BAAC,yBAAD,OA/FD,EAgGC,4BAAC,kCAAD,OAhGD,EAiGC,4BAAC,qBAAD,OAjGD,EAkGC,4BAAC,2BAAD,OAlGD,EAmGC,4BAAC,yBAAD,OAnGD,EAoGC,4BAAC,mBAAD,CAAS,IAAT,OApGD,EAqGC,4BAAC,mBAAD;AAAY,IAAA,OAAO,EAAGkD;AAAtB,IArGD,CADD;AAyGA;;eAEcnE,M","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tAutosaveMonitor,\n\tLocalAutosaveMonitor,\n\tUnsavedChangesWarning,\n\tEditorNotices,\n\tEditorKeyboardShortcutsRegister,\n\tEditorKeyboardShortcuts,\n\tEditorSnackbars,\n\tPostSyncStatusModal,\n\tstore as editorStore,\n} from '@wordpress/editor';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tBlockBreadcrumb,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\nimport { Button, ScrollLock, Popover } from '@wordpress/components';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { PluginArea } from '@wordpress/plugins';\nimport { __, _x, sprintf } from '@wordpress/i18n';\nimport {\n\tComplementaryArea,\n\tFullscreenMode,\n\tInterfaceSkeleton,\n\tstore as interfaceStore,\n} from '@wordpress/interface';\nimport { useState, useEffect, useCallback } from '@wordpress/element';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\nimport { store as noticesStore } from '@wordpress/notices';\n\n/**\n * Internal dependencies\n */\nimport TextEditor from '../text-editor';\nimport VisualEditor from '../visual-editor';\nimport EditPostKeyboardShortcuts from '../keyboard-shortcuts';\nimport KeyboardShortcutHelpModal from '../keyboard-shortcut-help-modal';\nimport EditPostPreferencesModal from '../preferences-modal';\nimport BrowserURL from '../browser-url';\nimport Header from '../header';\nimport InserterSidebar from '../secondary-sidebar/inserter-sidebar';\nimport ListViewSidebar from '../secondary-sidebar/list-view-sidebar';\nimport SettingsSidebar from '../sidebar/settings-sidebar';\nimport MetaBoxes from '../meta-boxes';\nimport WelcomeGuide from '../welcome-guide';\nimport ActionsPanel from './actions-panel';\nimport StartPageOptions from '../start-page-options';\nimport { store as editPostStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nconst { getLayoutStyles } = unlock( blockEditorPrivateApis );\n\nconst interfaceLabels = {\n\t/* translators: accessibility text for the editor top bar landmark region. */\n\theader: __( 'Editor top bar' ),\n\t/* translators: accessibility text for the editor content landmark region. */\n\tbody: __( 'Editor content' ),\n\t/* translators: accessibility text for the editor settings landmark region. */\n\tsidebar: __( 'Editor settings' ),\n\t/* translators: accessibility text for the editor publish landmark region. */\n\tactions: __( 'Editor publish' ),\n\t/* translators: accessibility text for the editor footer landmark region. */\n\tfooter: __( 'Editor footer' ),\n};\n\nfunction Layout() {\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\tconst isHugeViewport = useViewportMatch( 'huge', '>=' );\n\tconst isLargeViewport = useViewportMatch( 'large' );\n\tconst { openGeneralSidebar, closeGeneralSidebar, setIsInserterOpened } =\n\t\tuseDispatch( editPostStore );\n\tconst { createErrorNotice } = useDispatch( noticesStore );\n\tconst {\n\t\tmode,\n\t\tisFullscreenActive,\n\t\tisRichEditingEnabled,\n\t\tsidebarIsOpened,\n\t\thasActiveMetaboxes,\n\t\thasFixedToolbar,\n\t\tpreviousShortcut,\n\t\tnextShortcut,\n\t\thasBlockSelected,\n\t\tisInserterOpened,\n\t\tisListViewOpened,\n\t\tshowIconLabels,\n\t\tisDistractionFree,\n\t\tshowBlockBreadcrumbs,\n\t\tisTemplateMode,\n\t\tdocumentLabel,\n\t\tstyles,\n\t} = useSelect( ( select ) => {\n\t\tconst { getEditorSettings, getPostTypeLabel } = select( editorStore );\n\t\tconst { isFeatureActive } = select( editPostStore );\n\t\tconst editorSettings = getEditorSettings();\n\t\tconst postTypeLabel = getPostTypeLabel();\n\t\tconst hasThemeStyles = isFeatureActive( 'themeStyles' );\n\n\t\tconst themeStyles = [];\n\t\tconst presetStyles = [];\n\t\teditorSettings.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...editorSettings.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! editorSettings.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 {\n\t\t\tisTemplateMode: select( editPostStore ).isEditingTemplate(),\n\t\t\thasFixedToolbar:\n\t\t\t\tselect( editPostStore ).isFeatureActive( 'fixedToolbar' ),\n\t\t\tsidebarIsOpened: !! (\n\t\t\t\tselect( interfaceStore ).getActiveComplementaryArea(\n\t\t\t\t\teditPostStore.name\n\t\t\t\t) || select( editPostStore ).isPublishSidebarOpened()\n\t\t\t),\n\t\t\tisFullscreenActive:\n\t\t\t\tselect( editPostStore ).isFeatureActive( 'fullscreenMode' ),\n\t\t\tisInserterOpened: select( editPostStore ).isInserterOpened(),\n\t\t\tisListViewOpened: select( editPostStore ).isListViewOpened(),\n\t\t\tmode: select( editPostStore ).getEditorMode(),\n\t\t\tisRichEditingEnabled: editorSettings.richEditingEnabled,\n\t\t\thasActiveMetaboxes: select( editPostStore ).hasMetaBoxes(),\n\t\t\tpreviousShortcut: select(\n\t\t\t\tkeyboardShortcutsStore\n\t\t\t).getAllShortcutKeyCombinations( 'core/edit-post/previous-region' ),\n\t\t\tnextShortcut: select(\n\t\t\t\tkeyboardShortcutsStore\n\t\t\t).getAllShortcutKeyCombinations( 'core/edit-post/next-region' ),\n\t\t\tshowIconLabels:\n\t\t\t\tselect( editPostStore ).isFeatureActive( 'showIconLabels' ),\n\t\t\tisDistractionFree:\n\t\t\t\tselect( editPostStore ).isFeatureActive( 'distractionFree' ),\n\t\t\tshowBlockBreadcrumbs: select( editPostStore ).isFeatureActive(\n\t\t\t\t'showBlockBreadcrumbs'\n\t\t\t),\n\t\t\t// translators: Default label for the Document in the Block Breadcrumb.\n\t\t\tdocumentLabel: postTypeLabel || _x( 'Document', 'noun' ),\n\t\t\tstyles:\n\t\t\t\thasThemeStyles && themeStyles.length\n\t\t\t\t\t? editorSettings.styles\n\t\t\t\t\t: defaultEditorStyles,\n\t\t};\n\t}, [] );\n\n\tconst openSidebarPanel = () =>\n\t\topenGeneralSidebar(\n\t\t\thasBlockSelected ? 'edit-post/block' : 'edit-post/document'\n\t\t);\n\n\t// Inserter and Sidebars are mutually exclusive\n\tuseEffect( () => {\n\t\tif ( sidebarIsOpened && ! isHugeViewport ) {\n\t\t\tsetIsInserterOpened( false );\n\t\t}\n\t}, [ sidebarIsOpened, isHugeViewport ] );\n\tuseEffect( () => {\n\t\tif ( isInserterOpened && ! isHugeViewport ) {\n\t\t\tcloseGeneralSidebar();\n\t\t}\n\t}, [ isInserterOpened, isHugeViewport ] );\n\n\t// Local state for save panel.\n\t// Note 'truthy' callback implies an open panel.\n\tconst [ entitiesSavedStatesCallback, setEntitiesSavedStatesCallback ] =\n\t\tuseState( false );\n\tconst closeEntitiesSavedStates = useCallback(\n\t\t( arg ) => {\n\t\t\tif ( typeof entitiesSavedStatesCallback === 'function' ) {\n\t\t\t\tentitiesSavedStatesCallback( arg );\n\t\t\t}\n\t\t\tsetEntitiesSavedStatesCallback( false );\n\t\t},\n\t\t[ entitiesSavedStatesCallback ]\n\t);\n\n\tconst className = classnames( 'edit-post-layout', 'is-mode-' + mode, {\n\t\t'is-sidebar-opened': sidebarIsOpened,\n\t\t'has-fixed-toolbar': hasFixedToolbar,\n\t\t'has-metaboxes': hasActiveMetaboxes,\n\t\t'show-icon-labels': showIconLabels,\n\t\t'is-distraction-free': isDistractionFree && isLargeViewport,\n\t\t'is-entity-save-view-open': !! entitiesSavedStatesCallback,\n\t} );\n\n\tconst secondarySidebarLabel = isListViewOpened\n\t\t? __( 'Document Overview' )\n\t\t: __( 'Block Library' );\n\n\tconst secondarySidebar = () => {\n\t\tif ( mode === 'visual' && isInserterOpened ) {\n\t\t\treturn <InserterSidebar />;\n\t\t}\n\t\tif ( mode === 'visual' && isListViewOpened ) {\n\t\t\treturn <ListViewSidebar />;\n\t\t}\n\n\t\treturn null;\n\t};\n\n\tfunction onPluginAreaError( name ) {\n\t\tcreateErrorNotice(\n\t\t\tsprintf(\n\t\t\t\t/* translators: %s: plugin name */\n\t\t\t\t__(\n\t\t\t\t\t'The \"%s\" plugin has encountered an error and cannot be rendered.'\n\t\t\t\t),\n\t\t\t\tname\n\t\t\t)\n\t\t);\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<FullscreenMode isActive={ isFullscreenActive } />\n\t\t\t<BrowserURL />\n\t\t\t<UnsavedChangesWarning />\n\t\t\t<AutosaveMonitor />\n\t\t\t<LocalAutosaveMonitor />\n\t\t\t<EditPostKeyboardShortcuts />\n\t\t\t<EditorKeyboardShortcutsRegister />\n\t\t\t<EditorKeyboardShortcuts />\n\t\t\t<SettingsSidebar />\n\t\t\t<InterfaceSkeleton\n\t\t\t\tisDistractionFree={ isDistractionFree && isLargeViewport }\n\t\t\t\tclassName={ className }\n\t\t\t\tlabels={ {\n\t\t\t\t\t...interfaceLabels,\n\t\t\t\t\tsecondarySidebar: secondarySidebarLabel,\n\t\t\t\t} }\n\t\t\t\theader={\n\t\t\t\t\t<Header\n\t\t\t\t\t\tsetEntitiesSavedStatesCallback={\n\t\t\t\t\t\t\tsetEntitiesSavedStatesCallback\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t}\n\t\t\t\teditorNotices={ <EditorNotices /> }\n\t\t\t\tsecondarySidebar={ secondarySidebar() }\n\t\t\t\tsidebar={\n\t\t\t\t\t( ! isMobileViewport || sidebarIsOpened ) && (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t{ ! isMobileViewport && ! sidebarIsOpened && (\n\t\t\t\t\t\t\t\t<div className=\"edit-post-layout__toggle-sidebar-panel\">\n\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\t\t\t\t\tclassName=\"edit-post-layout__toggle-sidebar-panel-button\"\n\t\t\t\t\t\t\t\t\t\tonClick={ openSidebarPanel }\n\t\t\t\t\t\t\t\t\t\taria-expanded={ false }\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{ hasBlockSelected\n\t\t\t\t\t\t\t\t\t\t\t? __( 'Open block settings' )\n\t\t\t\t\t\t\t\t\t\t\t: __( 'Open document settings' ) }\n\t\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t<ComplementaryArea.Slot scope=\"core/edit-post\" />\n\t\t\t\t\t\t</>\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t\tnotices={ <EditorSnackbars /> }\n\t\t\t\tcontent={\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ ! isDistractionFree && <EditorNotices /> }\n\t\t\t\t\t\t{ ( mode === 'text' || ! isRichEditingEnabled ) && (\n\t\t\t\t\t\t\t<TextEditor />\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ isRichEditingEnabled && mode === 'visual' && (\n\t\t\t\t\t\t\t<VisualEditor styles={ styles } />\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ ! isDistractionFree && ! isTemplateMode && (\n\t\t\t\t\t\t\t<div className=\"edit-post-layout__metaboxes\">\n\t\t\t\t\t\t\t\t<MetaBoxes location=\"normal\" />\n\t\t\t\t\t\t\t\t<MetaBoxes location=\"advanced\" />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ isMobileViewport && sidebarIsOpened && (\n\t\t\t\t\t\t\t<ScrollLock />\n\t\t\t\t\t\t) }\n\t\t\t\t\t</>\n\t\t\t\t}\n\t\t\t\tfooter={\n\t\t\t\t\t! isDistractionFree &&\n\t\t\t\t\t! isMobileViewport &&\n\t\t\t\t\tshowBlockBreadcrumbs &&\n\t\t\t\t\tisRichEditingEnabled &&\n\t\t\t\t\tmode === 'visual' && (\n\t\t\t\t\t\t<div className=\"edit-post-layout__footer\">\n\t\t\t\t\t\t\t<BlockBreadcrumb rootLabelText={ documentLabel } />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t\tactions={\n\t\t\t\t\t<ActionsPanel\n\t\t\t\t\t\tcloseEntitiesSavedStates={ closeEntitiesSavedStates }\n\t\t\t\t\t\tisEntitiesSavedStatesOpen={\n\t\t\t\t\t\t\tentitiesSavedStatesCallback\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsetEntitiesSavedStatesCallback={\n\t\t\t\t\t\t\tsetEntitiesSavedStatesCallback\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t}\n\t\t\t\tshortcuts={ {\n\t\t\t\t\tprevious: previousShortcut,\n\t\t\t\t\tnext: nextShortcut,\n\t\t\t\t} }\n\t\t\t/>\n\t\t\t<EditPostPreferencesModal />\n\t\t\t<KeyboardShortcutHelpModal />\n\t\t\t<WelcomeGuide />\n\t\t\t<PostSyncStatusModal />\n\t\t\t<StartPageOptions />\n\t\t\t<Popover.Slot />\n\t\t\t<PluginArea onError={ onPluginAreaError } />\n\t\t</>\n\t);\n}\n\nexport default Layout;\n"]}
@@ -137,11 +137,11 @@ function ListViewSidebar() {
137
137
  selectOnMove: false,
138
138
  tabs: [{
139
139
  name: 'list-view',
140
- title: 'List View',
140
+ title: (0, _i18n._x)('List View', 'Post overview'),
141
141
  className: 'edit-post-sidebar__panel-tab'
142
142
  }, {
143
143
  name: 'outline',
144
- title: 'Outline',
144
+ title: (0, _i18n._x)('Outline', 'Post overview'),
145
145
  className: 'edit-post-sidebar__panel-tab'
146
146
  }]
147
147
  }, currentTab => (0, _element.createElement)("div", {
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-post/src/components/secondary-sidebar/list-view-sidebar.js"],"names":["ListViewSidebar","setIsListViewOpened","editPostStore","focusOnMountRef","headerFocusReturnRef","contentFocusReturnRef","closeOnEscape","event","keyCode","ESCAPE","defaultPrevented","preventDefault","dropZoneElement","setDropZoneElement","tab","setTab","sidebarRef","tabPanelRef","listViewRef","listViewContainerRef","handleSidebarFocus","currentTab","tabPanelFocus","focus","tabbable","find","current","listViewApplicationFocus","listViewFocusArea","contains","ownerDocument","activeElement","renderTabContent","tabName","closeSmall","name","title","className"],"mappings":";;;;;;;;;AAYA;;AATA;;AACA;;AACA;;AAKA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AAtBA;AACA;AACA;;AAgBA;AACA;AACA;AAIe,SAASA,eAAT,GAA2B;AACzC,QAAM;AAAEC,IAAAA;AAAF,MAA0B,uBAAaC,YAAb,CAAhC,CADyC,CAGzC;;AACA,QAAMC,eAAe,GAAG,8BAAiB,cAAjB,CAAxB,CAJyC,CAKzC;;AACA,QAAMC,oBAAoB,GAAG,8BAA7B;AACA,QAAMC,qBAAqB,GAAG,8BAA9B;;AAEA,WAASC,aAAT,CAAwBC,KAAxB,EAAgC;AAC/B,QAAKA,KAAK,CAACC,OAAN,KAAkBC,gBAAlB,IAA4B,CAAEF,KAAK,CAACG,gBAAzC,EAA4D;AAC3DH,MAAAA,KAAK,CAACI,cAAN;AACAV,MAAAA,mBAAmB,CAAE,KAAF,CAAnB;AACA;AACD,GAdwC,CAgBzC;AACA;;;AACA,QAAM,CAAEW,eAAF,EAAmBC,kBAAnB,IAA0C,uBAAU,IAAV,CAAhD,CAlByC,CAmBzC;;AACA,QAAM,CAAEC,GAAF,EAAOC,MAAP,IAAkB,uBAAU,WAAV,CAAxB,CApByC,CAsBzC;;AACA,QAAMC,UAAU,GAAG,sBAAnB,CAvByC,CAwBzC;;AACA,QAAMC,WAAW,GAAG,sBAApB,CAzByC,CA0BzC;;AACA,QAAMC,WAAW,GAAG,sBAApB,CA3ByC,CA6BzC;;AACA,QAAMC,oBAAoB,GAAG,2BAAc,CAC1Cd,qBAD0C,EAE1CF,eAF0C,EAG1Ce,WAH0C,EAI1CL,kBAJ0C,CAAd,CAA7B;AAOA;AACD;AACA;AACA;AACA;AACA;AACA;;AACC,WAASO,kBAAT,CAA6BC,UAA7B,EAA0C;AACzC;AACA,UAAMC,aAAa,GAAGC,WAAMC,Q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,KAAK,EAAG,cAAI,OAAJ,CAJT;AAKC,MAAA,OAAO,EAAG,MAAMjC,mBAAmB,CAAE,KAAF;AALpC,MALD,EAYC,4BAAC,oBAAD;AACC,MAAA,SAAS,EAAC,sDADX;AAEC,MAAA,GAAG,EAAGgB,WAFP;AAGC,MAAA,QAAQ,EAAKgB,OAAF,IAAelB,MAAM,CAAEkB,OAAF,CAHjC;AAIC,MAAA,YAAY,EAAG,KAJhB;AAKC,MAAA,IAAI,EAAG,CACN;AACCE,QAAAA,IAAI,EAAE,WADP;AAECC,QAAAA,KAAK,EAAE,WAFR;AAGCC,QAAAA,SAAS,EAAE;AAHZ,OADM,EAMN;AACCF,QAAAA,IAAI,EAAE,SADP;AAECC,QAAAA,KAAK,EAAE,SAFR;AAGCC,QAAAA,SAAS,EAAE;AAHZ,OANM;AALR,OAkBKhB,UAAF,IACD;AACC,MAAA,SAAS,EAAC,uCADX;AAEC,MAAA,GAAG,EAAGF;AAFP,OAIGa,gBAAgB,CAAEX,UAAU,CAACc,IAAb,CAJnB,CAnBF,CAZD;AAFD;AA2CA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __experimentalListView as ListView } from '@wordpress/block-editor';\nimport { Button, TabPanel } from '@wordpress/components';\nimport {\n\tuseFocusOnMount,\n\tuseFocusReturn,\n\tuseMergeRefs,\n} from '@wordpress/compose';\nimport { useDispatch } from '@wordpress/data';\nimport { focus } from '@wordpress/dom';\nimport { useRef, useState } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { closeSmall } from '@wordpress/icons';\nimport { useShortcut } from '@wordpress/keyboard-shortcuts';\nimport { ESCAPE } from '@wordpress/keycodes';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../store';\nimport ListViewOutline from './list-view-outline';\n\nexport default function ListViewSidebar() {\n\tconst { setIsListViewOpened } = useDispatch( editPostStore );\n\n\t// This hook handles focus when the sidebar first renders.\n\tconst focusOnMountRef = useFocusOnMount( 'firstElement' );\n\t// The next 2 hooks handle focus for when the sidebar closes and returning focus to the element that had focus before sidebar opened.\n\tconst headerFocusReturnRef = useFocusReturn();\n\tconst contentFocusReturnRef = useFocusReturn();\n\n\tfunction closeOnEscape( event ) {\n\t\tif ( event.keyCode === ESCAPE && ! event.defaultPrevented ) {\n\t\t\tevent.preventDefault();\n\t\t\tsetIsListViewOpened( false );\n\t\t}\n\t}\n\n\t// Use internal state instead of a ref to make sure that the component\n\t// re-renders when the dropZoneElement updates.\n\tconst [ dropZoneElement, setDropZoneElement ] = useState( null );\n\t// Tracks our current tab.\n\tconst [ tab, setTab ] = useState( 'list-view' );\n\n\t// This ref refers to the sidebar as a whole.\n\tconst sidebarRef = useRef();\n\t// This ref refers to the tab panel.\n\tconst tabPanelRef = useRef();\n\t// This ref refers to the list view application area.\n\tconst listViewRef = useRef();\n\n\t// Must merge the refs together so focus can be handled properly in the next function.\n\tconst listViewContainerRef = useMergeRefs( [\n\t\tcontentFocusReturnRef,\n\t\tfocusOnMountRef,\n\t\tlistViewRef,\n\t\tsetDropZoneElement,\n\t] );\n\n\t/*\n\t * Callback function to handle list view or outline focus.\n\t *\n\t * @param {string} currentTab The current tab. Either list view or outline.\n\t *\n\t * @return void\n\t */\n\tfunction handleSidebarFocus( currentTab ) {\n\t\t// Tab panel focus.\n\t\tconst tabPanelFocus = focus.tabbable.find( tabPanelRef.current )[ 0 ];\n\t\t// List view tab is selected.\n\t\tif ( currentTab === 'list-view' ) {\n\t\t\t// Either focus the list view or the tab panel. Must have a fallback because the list view does not render when there are no blocks.\n\t\t\tconst listViewApplicationFocus = focus.tabbable.find(\n\t\t\t\tlistViewRef.current\n\t\t\t)[ 0 ];\n\t\t\tconst listViewFocusArea = sidebarRef.current.contains(\n\t\t\t\tlistViewApplicationFocus\n\t\t\t)\n\t\t\t\t? listViewApplicationFocus\n\t\t\t\t: tabPanelFocus;\n\t\t\tlistViewFocusArea.focus();\n\t\t\t// Outline tab is selected.\n\t\t} else {\n\t\t\ttabPanelFocus.focus();\n\t\t}\n\t}\n\n\t// This only fires when the sidebar is open because of the conditional rendering. It is the same shortcut to open but that is defined as a global shortcut and only fires when the sidebar is closed.\n\tuseShortcut( 'core/edit-post/toggle-list-view', () => {\n\t\t// If the sidebar has focus, it is safe to close.\n\t\tif (\n\t\t\tsidebarRef.current.contains(\n\t\t\t\tsidebarRef.current.ownerDocument.activeElement\n\t\t\t)\n\t\t) {\n\t\t\tsetIsListViewOpened( false );\n\t\t\t// If the list view or outline does not have focus, focus should be moved to it.\n\t\t} else {\n\t\t\thandleSidebarFocus( tab );\n\t\t}\n\t} );\n\n\t/**\n\t * Render tab content for a given tab name.\n\t *\n\t * @param {string} tabName The name of the tab to render.\n\t */\n\tfunction renderTabContent( tabName ) {\n\t\tif ( tabName === 'list-view' ) {\n\t\t\treturn (\n\t\t\t\t<div className=\"edit-post-editor__list-view-panel-content\">\n\t\t\t\t\t<ListView dropZoneElement={ dropZoneElement } />\n\t\t\t\t</div>\n\t\t\t);\n\t\t}\n\t\treturn <ListViewOutline />;\n\t}\n\n\treturn (\n\t\t// eslint-disable-next-line jsx-a11y/no-static-element-interactions\n\t\t<div\n\t\t\tclassName=\"edit-post-editor__document-overview-panel\"\n\t\t\tonKeyDown={ closeOnEscape }\n\t\t\tref={ sidebarRef }\n\t\t>\n\t\t\t<Button\n\t\t\t\tclassName=\"edit-post-editor__document-overview-panel__close-button\"\n\t\t\t\tref={ headerFocusReturnRef }\n\t\t\t\ticon={ closeSmall }\n\t\t\t\tlabel={ __( 'Close' ) }\n\t\t\t\tonClick={ () => setIsListViewOpened( false ) }\n\t\t\t/>\n\t\t\t<TabPanel\n\t\t\t\tclassName=\"edit-post-editor__document-overview-panel__tab-panel\"\n\t\t\t\tref={ tabPanelRef }\n\t\t\t\tonSelect={ ( tabName ) => setTab( tabName ) }\n\t\t\t\tselectOnMove={ false }\n\t\t\t\ttabs={ [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'list-view',\n\t\t\t\t\t\ttitle: 'List View',\n\t\t\t\t\t\tclassName: 'edit-post-sidebar__panel-tab',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'outline',\n\t\t\t\t\t\ttitle: 'Outline',\n\t\t\t\t\t\tclassName: 'edit-post-sidebar__panel-tab',\n\t\t\t\t\t},\n\t\t\t\t] }\n\t\t\t>\n\t\t\t\t{ ( currentTab ) => (\n\t\t\t\t\t<div\n\t\t\t\t\t\tclassName=\"edit-post-editor__list-view-container\"\n\t\t\t\t\t\tref={ listViewContainerRef }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ renderTabContent( currentTab.name ) }\n\t\t\t\t\t</div>\n\t\t\t\t) }\n\t\t\t</TabPanel>\n\t\t</div>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-post/src/components/secondary-sidebar/list-view-sidebar.js"],"names":["ListViewSidebar","setIsListViewOpened","editPostStore","focusOnMountRef","headerFocusReturnRef","contentFocusReturnRef","closeOnEscape","event","keyCode","ESCAPE","defaultPrevented","preventDefault","dropZoneElement","setDropZoneElement","tab","setTab","sidebarRef","tabPanelRef","listViewRef","listViewContainerRef","handleSidebarFocus","currentTab","tabPanelFocus","focus","tabbable","find","current","listViewApplicationFocus","listViewFocusArea","contains","ownerDocument","activeElement","renderTabContent","tabName","closeSmall","name","title","className"],"mappings":";;;;;;;;;AAYA;;AATA;;AACA;;AACA;;AAKA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AAtBA;AACA;AACA;;AAgBA;AACA;AACA;AAIe,SAASA,eAAT,GAA2B;AACzC,QAAM;AAAEC,IAAAA;AAAF,MAA0B,uBAAaC,YAAb,CAAhC,CADyC,CAGzC;;AACA,QAAMC,eAAe,GAAG,8BAAiB,cAAjB,CAAxB,CAJyC,CAKzC;;AACA,QAAMC,oBAAoB,GAAG,8BAA7B;AACA,QAAMC,qBAAqB,GAAG,8BAA9B;;AAEA,WAASC,aAAT,CAAwBC,KAAxB,EAAgC;AAC/B,QA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AI,SAAJ,EAAe,eAAf,CAFR;AAGCC,QAAAA,SAAS,EAAE;AAHZ,OANM;AALR,OAkBKhB,UAAF,IACD;AACC,MAAA,SAAS,EAAC,uCADX;AAEC,MAAA,GAAG,EAAGF;AAFP,OAIGa,gBAAgB,CAAEX,UAAU,CAACc,IAAb,CAJnB,CAnBF,CAZD;AAFD;AA2CA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __experimentalListView as ListView } from '@wordpress/block-editor';\nimport { Button, TabPanel } from '@wordpress/components';\nimport {\n\tuseFocusOnMount,\n\tuseFocusReturn,\n\tuseMergeRefs,\n} from '@wordpress/compose';\nimport { useDispatch } from '@wordpress/data';\nimport { focus } from '@wordpress/dom';\nimport { useRef, useState } from '@wordpress/element';\nimport { __, _x } from '@wordpress/i18n';\nimport { closeSmall } from '@wordpress/icons';\nimport { useShortcut } from '@wordpress/keyboard-shortcuts';\nimport { ESCAPE } from '@wordpress/keycodes';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../store';\nimport ListViewOutline from './list-view-outline';\n\nexport default function ListViewSidebar() {\n\tconst { setIsListViewOpened } = useDispatch( editPostStore );\n\n\t// This hook handles focus when the sidebar first renders.\n\tconst focusOnMountRef = useFocusOnMount( 'firstElement' );\n\t// The next 2 hooks handle focus for when the sidebar closes and returning focus to the element that had focus before sidebar opened.\n\tconst headerFocusReturnRef = useFocusReturn();\n\tconst contentFocusReturnRef = useFocusReturn();\n\n\tfunction closeOnEscape( event ) {\n\t\tif ( event.keyCode === ESCAPE && ! event.defaultPrevented ) {\n\t\t\tevent.preventDefault();\n\t\t\tsetIsListViewOpened( false );\n\t\t}\n\t}\n\n\t// Use internal state instead of a ref to make sure that the component\n\t// re-renders when the dropZoneElement updates.\n\tconst [ dropZoneElement, setDropZoneElement ] = useState( null );\n\t// Tracks our current tab.\n\tconst [ tab, setTab ] = useState( 'list-view' );\n\n\t// This ref refers to the sidebar as a whole.\n\tconst sidebarRef = useRef();\n\t// This ref refers to the tab panel.\n\tconst tabPanelRef = useRef();\n\t// This ref refers to the list view application area.\n\tconst listViewRef = useRef();\n\n\t// Must merge the refs together so focus can be handled properly in the next function.\n\tconst listViewContainerRef = useMergeRefs( [\n\t\tcontentFocusReturnRef,\n\t\tfocusOnMountRef,\n\t\tlistViewRef,\n\t\tsetDropZoneElement,\n\t] );\n\n\t/*\n\t * Callback function to handle list view or outline focus.\n\t *\n\t * @param {string} currentTab The current tab. Either list view or outline.\n\t *\n\t * @return void\n\t */\n\tfunction handleSidebarFocus( currentTab ) {\n\t\t// Tab panel focus.\n\t\tconst tabPanelFocus = focus.tabbable.find( tabPanelRef.current )[ 0 ];\n\t\t// List view tab is selected.\n\t\tif ( currentTab === 'list-view' ) {\n\t\t\t// Either focus the list view or the tab panel. Must have a fallback because the list view does not render when there are no blocks.\n\t\t\tconst listViewApplicationFocus = focus.tabbable.find(\n\t\t\t\tlistViewRef.current\n\t\t\t)[ 0 ];\n\t\t\tconst listViewFocusArea = sidebarRef.current.contains(\n\t\t\t\tlistViewApplicationFocus\n\t\t\t)\n\t\t\t\t? listViewApplicationFocus\n\t\t\t\t: tabPanelFocus;\n\t\t\tlistViewFocusArea.focus();\n\t\t\t// Outline tab is selected.\n\t\t} else {\n\t\t\ttabPanelFocus.focus();\n\t\t}\n\t}\n\n\t// This only fires when the sidebar is open because of the conditional rendering. It is the same shortcut to open but that is defined as a global shortcut and only fires when the sidebar is closed.\n\tuseShortcut( 'core/edit-post/toggle-list-view', () => {\n\t\t// If the sidebar has focus, it is safe to close.\n\t\tif (\n\t\t\tsidebarRef.current.contains(\n\t\t\t\tsidebarRef.current.ownerDocument.activeElement\n\t\t\t)\n\t\t) {\n\t\t\tsetIsListViewOpened( false );\n\t\t\t// If the list view or outline does not have focus, focus should be moved to it.\n\t\t} else {\n\t\t\thandleSidebarFocus( tab );\n\t\t}\n\t} );\n\n\t/**\n\t * Render tab content for a given tab name.\n\t *\n\t * @param {string} tabName The name of the tab to render.\n\t */\n\tfunction renderTabContent( tabName ) {\n\t\tif ( tabName === 'list-view' ) {\n\t\t\treturn (\n\t\t\t\t<div className=\"edit-post-editor__list-view-panel-content\">\n\t\t\t\t\t<ListView dropZoneElement={ dropZoneElement } />\n\t\t\t\t</div>\n\t\t\t);\n\t\t}\n\t\treturn <ListViewOutline />;\n\t}\n\n\treturn (\n\t\t// eslint-disable-next-line jsx-a11y/no-static-element-interactions\n\t\t<div\n\t\t\tclassName=\"edit-post-editor__document-overview-panel\"\n\t\t\tonKeyDown={ closeOnEscape }\n\t\t\tref={ sidebarRef }\n\t\t>\n\t\t\t<Button\n\t\t\t\tclassName=\"edit-post-editor__document-overview-panel__close-button\"\n\t\t\t\tref={ headerFocusReturnRef }\n\t\t\t\ticon={ closeSmall }\n\t\t\t\tlabel={ __( 'Close' ) }\n\t\t\t\tonClick={ () => setIsListViewOpened( false ) }\n\t\t\t/>\n\t\t\t<TabPanel\n\t\t\t\tclassName=\"edit-post-editor__document-overview-panel__tab-panel\"\n\t\t\t\tref={ tabPanelRef }\n\t\t\t\tonSelect={ ( tabName ) => setTab( tabName ) }\n\t\t\t\tselectOnMove={ false }\n\t\t\t\ttabs={ [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'list-view',\n\t\t\t\t\t\ttitle: _x( 'List View', 'Post overview' ),\n\t\t\t\t\t\tclassName: 'edit-post-sidebar__panel-tab',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'outline',\n\t\t\t\t\t\ttitle: _x( 'Outline', 'Post overview' ),\n\t\t\t\t\t\tclassName: 'edit-post-sidebar__panel-tab',\n\t\t\t\t\t},\n\t\t\t\t] }\n\t\t\t>\n\t\t\t\t{ ( currentTab ) => (\n\t\t\t\t\t<div\n\t\t\t\t\t\tclassName=\"edit-post-editor__list-view-container\"\n\t\t\t\t\t\tref={ listViewContainerRef }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ renderTabContent( currentTab.name ) }\n\t\t\t\t\t</div>\n\t\t\t\t) }\n\t\t\t</TabPanel>\n\t\t</div>\n\t);\n}\n"]}
@@ -13,8 +13,6 @@ var _components = require("@wordpress/components");
13
13
 
14
14
  var _editor = require("@wordpress/editor");
15
15
 
16
- var _compose = require("@wordpress/compose");
17
-
18
16
  var _data = require("@wordpress/data");
19
17
 
20
18
  var _store = require("../../../store");
@@ -32,11 +30,24 @@ var _store = require("../../../store");
32
30
  */
33
31
  const PANEL_NAME = 'discussion-panel';
34
32
 
35
- function DiscussionPanel({
36
- isEnabled,
37
- isOpened,
38
- onTogglePanel
39
- }) {
33
+ function DiscussionPanel() {
34
+ const {
35
+ isEnabled,
36
+ isOpened
37
+ } = (0, _data.useSelect)(select => {
38
+ const {
39
+ isEditorPanelEnabled,
40
+ isEditorPanelOpened
41
+ } = select(_store.store);
42
+ return {
43
+ isEnabled: isEditorPanelEnabled(PANEL_NAME),
44
+ isOpened: isEditorPanelOpened(PANEL_NAME)
45
+ };
46
+ }, []);
47
+ const {
48
+ toggleEditorPanelOpened
49
+ } = (0, _data.useDispatch)(_store.store);
50
+
40
51
  if (!isEnabled) {
41
52
  return null;
42
53
  }
@@ -46,7 +57,7 @@ function DiscussionPanel({
46
57
  }, (0, _element.createElement)(_components.PanelBody, {
47
58
  title: (0, _i18n.__)('Discussion'),
48
59
  opened: isOpened,
49
- onToggle: onTogglePanel
60
+ onToggle: () => toggleEditorPanelOpened(PANEL_NAME)
50
61
  }, (0, _element.createElement)(_editor.PostTypeSupportCheck, {
51
62
  supportKeys: "comments"
52
63
  }, (0, _element.createElement)(_components.PanelRow, null, (0, _element.createElement)(_editor.PostComments, null))), (0, _element.createElement)(_editor.PostTypeSupportCheck, {
@@ -54,17 +65,6 @@ function DiscussionPanel({
54
65
  }, (0, _element.createElement)(_components.PanelRow, null, (0, _element.createElement)(_editor.PostPingbacks, null)))));
55
66
  }
56
67
 
57
- var _default = (0, _compose.compose)([(0, _data.withSelect)(select => {
58
- return {
59
- isEnabled: select(_store.store).isEditorPanelEnabled(PANEL_NAME),
60
- isOpened: select(_store.store).isEditorPanelOpened(PANEL_NAME)
61
- };
62
- }), (0, _data.withDispatch)(dispatch => ({
63
- onTogglePanel() {
64
- return dispatch(_store.store).toggleEditorPanelOpened(PANEL_NAME);
65
- }
66
-
67
- }))])(DiscussionPanel);
68
-
68
+ var _default = DiscussionPanel;
69
69
  exports.default = _default;
70
70
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-post/src/components/sidebar/discussion-panel/index.js"],"names":["PANEL_NAME","DiscussionPanel","isEnabled","isOpened","onTogglePanel","select","editPostStore","isEditorPanelEnabled","isEditorPanelOpened","dispatch","toggleEditorPanelOpened"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AAKA;;AACA;;AAKA;;AAhBA;AACA;AACA;;AAWA;AACA;AACA;;AAGA;AACA;AACA;AACA,MAAMA,UAAU,GAAG,kBAAnB;;AAEA,SAASC,eAAT,CAA0B;AAAEC,EAAAA,SAAF;AAAaC,EAAAA,QAAb;AAAuBC,EAAAA;AAAvB,CAA1B,EAAmE;AAClE,MAAK,CAAEF,SAAP,EAAmB;AAClB,WAAO,IAAP;AACA;;AAED,SACC,4BAAC,4BAAD;AAAsB,IAAA,WAAW,EAAG,CAAE,UAAF,EAAc,YAAd;AAApC,KACC,4BAAC,qBAAD;AACC,IAAA,KAAK,EAAG,cAAI,YAAJ,CADT;AAEC,IAAA,MAAM,EAAGC,QAFV;AAGC,IAAA,QAAQ,EAAGC;AAHZ,KAKC,4BAAC,4BAAD;AAAsB,IAAA,WAAW,EAAC;AAAlC,KACC,4BAAC,oBAAD,QACC,4BAAC,oBAAD,OADD,CADD,CALD,EAWC,4BAAC,4BAAD;AAAsB,IAAA,WAAW,EAAC;AAAlC,KACC,4BAAC,oBAAD,QACC,4BAAC,qBAAD,OADD,CADD,CAXD,CADD,CADD;AAqBA;;eAEc,sBAAS,CACvB,sBAAcC,MAAF,IAAc;AACzB,SAAO;AACNH,IAAAA,SAAS,EACRG,MAAM,CAAEC,YAAF,CAAN,CAAwBC,oBAAxB,CAA8CP,UAA9C,CAFK;AAGNG,IAAAA,QAAQ,EAAEE,MAAM,CAAEC,YAAF,CAAN,CAAwBE,mBAAxB,CAA6CR,UAA7C;AAHJ,GAAP;AAKA,CAND,CADuB,EAQvB,wBAAgBS,QAAF,KAAkB;AAC/BL,EAAAA,aAAa,GAAG;AACf,WAAOK,QAAQ,CAAEH,YAAF,CAAR,CAA0BI,uBAA1B,CACNV,UADM,CAAP;AAGA;;AAL8B,CAAlB,CAAd,CARuB,CAAT,EAeVC,eAfU,C","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { PanelBody, PanelRow } from '@wordpress/components';\nimport {\n\tPostComments,\n\tPostPingbacks,\n\tPostTypeSupportCheck,\n} from '@wordpress/editor';\nimport { compose } from '@wordpress/compose';\nimport { withSelect, withDispatch } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../../store';\n\n/**\n * Module Constants\n */\nconst PANEL_NAME = 'discussion-panel';\n\nfunction DiscussionPanel( { isEnabled, isOpened, onTogglePanel } ) {\n\tif ( ! isEnabled ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PostTypeSupportCheck supportKeys={ [ 'comments', 'trackbacks' ] }>\n\t\t\t<PanelBody\n\t\t\t\ttitle={ __( 'Discussion' ) }\n\t\t\t\topened={ isOpened }\n\t\t\t\tonToggle={ onTogglePanel }\n\t\t\t>\n\t\t\t\t<PostTypeSupportCheck supportKeys=\"comments\">\n\t\t\t\t\t<PanelRow>\n\t\t\t\t\t\t<PostComments />\n\t\t\t\t\t</PanelRow>\n\t\t\t\t</PostTypeSupportCheck>\n\n\t\t\t\t<PostTypeSupportCheck supportKeys=\"trackbacks\">\n\t\t\t\t\t<PanelRow>\n\t\t\t\t\t\t<PostPingbacks />\n\t\t\t\t\t</PanelRow>\n\t\t\t\t</PostTypeSupportCheck>\n\t\t\t</PanelBody>\n\t\t</PostTypeSupportCheck>\n\t);\n}\n\nexport default compose( [\n\twithSelect( ( select ) => {\n\t\treturn {\n\t\t\tisEnabled:\n\t\t\t\tselect( editPostStore ).isEditorPanelEnabled( PANEL_NAME ),\n\t\t\tisOpened: select( editPostStore ).isEditorPanelOpened( PANEL_NAME ),\n\t\t};\n\t} ),\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] )( DiscussionPanel );\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-post/src/components/sidebar/discussion-panel/index.js"],"names":["PANEL_NAME","DiscussionPanel","isEnabled","isOpened","select","isEditorPanelEnabled","isEditorPanelOpened","editPostStore","toggleEditorPanelOpened"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AAKA;;AAKA;;AAfA;AACA;AACA;;AAUA;AACA;AACA;;AAGA;AACA;AACA;AACA,MAAMA,UAAU,GAAG,kBAAnB;;AAEA,SAASC,eAAT,GAA2B;AAC1B,QAAM;AAAEC,IAAAA,SAAF;AAAaC,IAAAA;AAAb,MAA0B,qBAAaC,MAAF,IAAc;AACxD,UAAM;AAAEC,MAAAA,oBAAF;AAAwBC,MAAAA;AAAxB,QACLF,MAAM,CAAEG,YAAF,CADP;AAEA,WAAO;AACNL,MAAAA,SAAS,EAAEG,oBAAoB,CAAEL,UAAF,CADzB;AAENG,MAAAA,QAAQ,EAAEG,mBAAmB,CAAEN,UAAF;AAFvB,KAAP;AAIA,GAP+B,EAO7B,EAP6B,CAAhC;AASA,QAAM;AAAEQ,IAAAA;AAAF,MAA8B,uBAAaD,YAAb,CAApC;;AAEA,MAAK,CAAEL,SAAP,EAAmB;AAClB,WAAO,IAAP;AACA;;AAED,SACC,4BAAC,4BAAD;AAAsB,IAAA,WAAW,EAAG,CAAE,UAAF,EAAc,YAAd;AAApC,KACC,4BAAC,qBAAD;AACC,IAAA,KAAK,EAAG,cAAI,YAAJ,CADT;AAEC,IAAA,MAAM,EAAGC,QAFV;AAGC,IAAA,QAAQ,EAAG,MAAMK,uBAAuB,CAAER,UAAF;AAHzC,KAKC,4BAAC,4BAAD;AAAsB,IAAA,WAAW,EAAC;AAAlC,KACC,4BAAC,oBAAD,QACC,4BAAC,oBAAD,OADD,CADD,CALD,EAWC,4BAAC,4BAAD;AAAsB,IAAA,WAAW,EAAC;AAAlC,KACC,4BAAC,oBAAD,QACC,4BAAC,qBAAD,OADD,CADD,CAXD,CADD,CADD;AAqBA;;eAEcC,e","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { PanelBody, PanelRow } from '@wordpress/components';\nimport {\n\tPostComments,\n\tPostPingbacks,\n\tPostTypeSupportCheck,\n} from '@wordpress/editor';\nimport { useDispatch, useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../../store';\n\n/**\n * Module Constants\n */\nconst PANEL_NAME = 'discussion-panel';\n\nfunction DiscussionPanel() {\n\tconst { isEnabled, isOpened } = useSelect( ( select ) => {\n\t\tconst { isEditorPanelEnabled, isEditorPanelOpened } =\n\t\t\tselect( editPostStore );\n\t\treturn {\n\t\t\tisEnabled: isEditorPanelEnabled( PANEL_NAME ),\n\t\t\tisOpened: isEditorPanelOpened( PANEL_NAME ),\n\t\t};\n\t}, [] );\n\n\tconst { toggleEditorPanelOpened } = useDispatch( editPostStore );\n\n\tif ( ! isEnabled ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PostTypeSupportCheck supportKeys={ [ 'comments', 'trackbacks' ] }>\n\t\t\t<PanelBody\n\t\t\t\ttitle={ __( 'Discussion' ) }\n\t\t\t\topened={ isOpened }\n\t\t\t\tonToggle={ () => toggleEditorPanelOpened( PANEL_NAME ) }\n\t\t\t>\n\t\t\t\t<PostTypeSupportCheck supportKeys=\"comments\">\n\t\t\t\t\t<PanelRow>\n\t\t\t\t\t\t<PostComments />\n\t\t\t\t\t</PanelRow>\n\t\t\t\t</PostTypeSupportCheck>\n\n\t\t\t\t<PostTypeSupportCheck supportKeys=\"trackbacks\">\n\t\t\t\t\t<PanelRow>\n\t\t\t\t\t\t<PostPingbacks />\n\t\t\t\t\t</PanelRow>\n\t\t\t\t</PostTypeSupportCheck>\n\t\t\t</PanelBody>\n\t\t</PostTypeSupportCheck>\n\t);\n}\n\nexport default DiscussionPanel;\n"]}
@@ -35,7 +35,7 @@ function TextEditor() {
35
35
  } = (0, _data.useDispatch)(_store.store);
36
36
  return (0, _element.createElement)("div", {
37
37
  className: "edit-post-text-editor"
38
- }, (0, _element.createElement)(_editor.TextEditorGlobalKeyboardShortcuts, null), isRichEditingEnabled && (0, _element.createElement)("div", {
38
+ }, isRichEditingEnabled && (0, _element.createElement)("div", {
39
39
  className: "edit-post-text-editor__toolbar"
40
40
  }, (0, _element.createElement)("h2", null, (0, _i18n.__)('Editing code')), (0, _element.createElement)(_components.Button, {
41
41
  variant: "tertiary",
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-post/src/components/text-editor/index.js"],"names":["TextEditor","isRichEditingEnabled","select","editorStore","getEditorSettings","richEditingEnabled","switchEditorMode","editPostStore","displayShortcut","secondary"],"mappings":";;;;;;;;;AAGA;;AAMA;;AACA;;AACA;;AACA;;AAKA;;AAjBA;AACA;AACA;;AAYA;AACA;AACA;AAGe,SAASA,UAAT,GAAsB;AACpC,QAAMC,oBAAoB,GAAG,qBAAaC,MAAF,IAAc;AACrD,WAAOA,MAAM,CAAEC,aAAF,CAAN,CAAsBC,iBAAtB,GAA0CC,kBAAjD;AACA,GAF4B,EAE1B,EAF0B,CAA7B;AAGA,QAAM;AAAEC,IAAAA;AAAF,MAAuB,uBAAaC,YAAb,CAA7B;AAEA,SACC;AAAK,IAAA,SAAS,EAAC;AAAf,KACC,4BAAC,yCAAD,OADD,EAEGN,oBAAoB,IACrB;AAAK,IAAA,SAAS,EAAC;AAAf,KACC,wCAAM,cAAI,cAAJ,CAAN,CADD,EAEC,4BAAC,kBAAD;AACC,IAAA,OAAO,EAAC,UADT;AAEC,IAAA,OAAO,EAAG,MAAMK,gBAAgB,CAAE,QAAF,CAFjC;AAGC,IAAA,QAAQ,EAAGE,0BAAgBC,SAAhB,CAA2B,GAA3B;AAHZ,KAKG,cAAI,kBAAJ,CALH,CAFD,CAHF,EAcC;AAAK,IAAA,SAAS,EAAC;AAAf,KACC,4BAAC,iBAAD,OADD,EAEC,4BAAC,sBAAD,OAFD,CAdD,CADD;AAqBA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tPostTextEditor,\n\tPostTitle,\n\tTextEditorGlobalKeyboardShortcuts,\n\tstore as editorStore,\n} from '@wordpress/editor';\nimport { Button } from '@wordpress/components';\nimport { useDispatch, useSelect } 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 default function TextEditor() {\n\tconst isRichEditingEnabled = useSelect( ( select ) => {\n\t\treturn select( editorStore ).getEditorSettings().richEditingEnabled;\n\t}, [] );\n\tconst { switchEditorMode } = useDispatch( editPostStore );\n\n\treturn (\n\t\t<div className=\"edit-post-text-editor\">\n\t\t\t<TextEditorGlobalKeyboardShortcuts />\n\t\t\t{ isRichEditingEnabled && (\n\t\t\t\t<div className=\"edit-post-text-editor__toolbar\">\n\t\t\t\t\t<h2>{ __( 'Editing code' ) }</h2>\n\t\t\t\t\t<Button\n\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\tonClick={ () => switchEditorMode( 'visual' ) }\n\t\t\t\t\t\tshortcut={ displayShortcut.secondary( 'm' ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Exit code editor' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t</div>\n\t\t\t) }\n\t\t\t<div className=\"edit-post-text-editor__body\">\n\t\t\t\t<PostTitle />\n\t\t\t\t<PostTextEditor />\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-post/src/components/text-editor/index.js"],"names":["TextEditor","isRichEditingEnabled","select","editorStore","getEditorSettings","richEditingEnabled","switchEditorMode","editPostStore","displayShortcut","secondary"],"mappings":";;;;;;;;;AAGA;;AAKA;;AACA;;AACA;;AACA;;AAKA;;AAhBA;AACA;AACA;;AAWA;AACA;AACA;AAGe,SAASA,UAAT,GAAsB;AACpC,QAAMC,oBAAoB,GAAG,qBAAaC,MAAF,IAAc;AACrD,WAAOA,MAAM,CAAEC,aAAF,CAAN,CAAsBC,iBAAtB,GAA0CC,kBAAjD;AACA,GAF4B,EAE1B,EAF0B,CAA7B;AAGA,QAAM;AAAEC,IAAAA;AAAF,MAAuB,uBAAaC,YAAb,CAA7B;AAEA,SACC;AAAK,IAAA,SAAS,EAAC;AAAf,KACGN,oBAAoB,IACrB;AAAK,IAAA,SAAS,EAAC;AAAf,KACC,wCAAM,cAAI,cAAJ,CAAN,CADD,EAEC,4BAAC,kBAAD;AACC,IAAA,OAAO,EAAC,UADT;AAEC,IAAA,OAAO,EAAG,MAAMK,gBAAgB,CAAE,QAAF,CAFjC;AAGC,IAAA,QAAQ,EAAGE,0BAAgBC,SAAhB,CAA2B,GAA3B;AAHZ,KAKG,cAAI,kBAAJ,CALH,CAFD,CAFF,EAaC;AAAK,IAAA,SAAS,EAAC;AAAf,KACC,4BAAC,iBAAD,OADD,EAEC,4BAAC,sBAAD,OAFD,CAbD,CADD;AAoBA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tPostTextEditor,\n\tPostTitle,\n\tstore as editorStore,\n} from '@wordpress/editor';\nimport { Button } from '@wordpress/components';\nimport { useDispatch, useSelect } 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 default function TextEditor() {\n\tconst isRichEditingEnabled = useSelect( ( select ) => {\n\t\treturn select( editorStore ).getEditorSettings().richEditingEnabled;\n\t}, [] );\n\tconst { switchEditorMode } = useDispatch( editPostStore );\n\n\treturn (\n\t\t<div className=\"edit-post-text-editor\">\n\t\t\t{ isRichEditingEnabled && (\n\t\t\t\t<div className=\"edit-post-text-editor__toolbar\">\n\t\t\t\t\t<h2>{ __( 'Editing code' ) }</h2>\n\t\t\t\t\t<Button\n\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\tonClick={ () => switchEditorMode( 'visual' ) }\n\t\t\t\t\t\tshortcut={ displayShortcut.secondary( 'm' ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Exit code editor' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t</div>\n\t\t\t) }\n\t\t\t<div className=\"edit-post-text-editor__body\">\n\t\t\t\t<PostTitle />\n\t\t\t\t<PostTextEditor />\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n"]}
@@ -1,7 +1,5 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
3
  Object.defineProperty(exports, "__esModule", {
6
4
  value: true
7
5
  });
@@ -21,8 +19,6 @@ var _editor = require("@wordpress/editor");
21
19
 
22
20
  var _blockEditor = require("@wordpress/block-editor");
23
21
 
24
- var _style = _interopRequireDefault(require("./style.scss"));
25
-
26
22
  /**
27
23
  * External dependencies
28
24
  */
@@ -30,18 +26,12 @@ var _style = _interopRequireDefault(require("./style.scss"));
30
26
  /**
31
27
  * WordPress dependencies
32
28
  */
33
-
34
- /**
35
- * Internal dependencies
36
- */
37
29
  const Header = (0, _element.memo)(function EditorHeader({
38
30
  editTitle,
39
31
  setTitleRef,
40
- title,
41
- getStylesFromColorScheme
32
+ title
42
33
  }) {
43
34
  const [wrapperStyles] = (0, _blockEditor.useEditorWrapperStyles)();
44
- const blockHolderFocusedStyle = getStylesFromColorScheme(_style.default.blockHolderFocused, _style.default.blockHolderFocusedDark);
45
35
  return (0, _element.createElement)(_reactNative.View, {
46
36
  style: wrapperStyles
47
37
  }, (0, _element.createElement)(_editor.PostTitle, {
@@ -49,8 +39,6 @@ const Header = (0, _element.memo)(function EditorHeader({
49
39
  title: title,
50
40
  onUpdate: editTitle,
51
41
  placeholder: (0, _i18n.__)('Add title'),
52
- borderStyle: _style.default.blockHolderFullBordered,
53
- focusedBorderColor: blockHolderFocusedStyle.borderColor,
54
42
  accessibilityLabel: "post-title"
55
43
  }));
56
44
  }, (prevProps, nextProps) => prevProps.title === nextProps.title);