@wordpress/edit-post 5.0.5 → 5.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/components/block-manager/category.js +13 -11
- package/build/components/block-manager/category.js.map +1 -1
- package/build/components/block-manager/checklist.js +6 -5
- package/build/components/block-manager/checklist.js.map +1 -1
- package/build/components/block-manager/index.js +14 -10
- package/build/components/block-manager/index.js.map +1 -1
- package/build/components/block-manager/show-all.js +5 -4
- package/build/components/block-manager/show-all.js.map +1 -1
- package/build/components/block-settings-menu/plugin-block-settings-menu-item.js +26 -21
- package/build/components/block-settings-menu/plugin-block-settings-menu-item.js.map +1 -1
- package/build/components/browser-url/index.js +1 -1
- package/build/components/editor-initialization/index.js +4 -3
- package/build/components/editor-initialization/index.js.map +1 -1
- package/build/components/editor-initialization/utils.js +2 -1
- package/build/components/editor-initialization/utils.js.map +1 -1
- package/build/components/header/fullscreen-mode-close/index.js +6 -5
- package/build/components/header/fullscreen-mode-close/index.js.map +1 -1
- package/build/components/header/header-toolbar/index.native.js +12 -11
- package/build/components/header/header-toolbar/index.native.js.map +1 -1
- package/build/components/header/index.js +4 -3
- package/build/components/header/index.js.map +1 -1
- package/build/components/header/main-dashboard-button/index.js +4 -3
- package/build/components/header/main-dashboard-button/index.js.map +1 -1
- package/build/components/header/more-menu/index.js +23 -19
- package/build/components/header/more-menu/index.js.map +1 -1
- package/build/components/header/post-publish-button-or-toggle.js +14 -13
- package/build/components/header/post-publish-button-or-toggle.js.map +1 -1
- package/build/components/header/template-title/index.js +13 -10
- package/build/components/header/template-title/index.js.map +1 -1
- package/build/components/header/tools-more-menu-group/index.js +10 -7
- package/build/components/header/tools-more-menu-group/index.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +4 -3
- package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/index.js +54 -44
- package/build/components/keyboard-shortcut-help-modal/index.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/shortcut.js +12 -10
- package/build/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
- package/build/components/layout/actions-panel.js +7 -6
- package/build/components/layout/actions-panel.js.map +1 -1
- package/build/components/layout/index.js +4 -3
- package/build/components/layout/index.js.map +1 -1
- package/build/components/meta-boxes/index.js +13 -9
- package/build/components/meta-boxes/index.js.map +1 -1
- package/build/components/meta-boxes/meta-box-visibility.js +8 -5
- package/build/components/meta-boxes/meta-box-visibility.js.map +1 -1
- package/build/components/meta-boxes/meta-boxes-area/index.js +4 -3
- package/build/components/meta-boxes/meta-boxes-area/index.js.map +1 -1
- package/build/components/preferences-modal/index.js +13 -11
- package/build/components/preferences-modal/index.js.map +1 -1
- package/build/components/preferences-modal/meta-boxes-section.js +23 -16
- package/build/components/preferences-modal/meta-boxes-section.js.map +1 -1
- package/build/components/preferences-modal/options/base.js +8 -7
- package/build/components/preferences-modal/options/base.js.map +1 -1
- package/build/components/preferences-modal/options/enable-custom-fields.js +9 -7
- package/build/components/preferences-modal/options/enable-custom-fields.js.map +1 -1
- package/build/components/preferences-modal/options/enable-feature.js +12 -8
- package/build/components/preferences-modal/options/enable-feature.js.map +1 -1
- package/build/components/preferences-modal/options/enable-panel.js +17 -10
- package/build/components/preferences-modal/options/enable-panel.js.map +1 -1
- package/build/components/preferences-modal/options/enable-plugin-document-setting-panel.js +10 -7
- package/build/components/preferences-modal/options/enable-plugin-document-setting-panel.js.map +1 -1
- package/build/components/preferences-modal/options/index.js +6 -6
- package/build/components/preferences-modal/section.js +14 -11
- package/build/components/preferences-modal/section.js.map +1 -1
- package/build/components/sidebar/discussion-panel/index.js +7 -5
- package/build/components/sidebar/discussion-panel/index.js.map +1 -1
- package/build/components/sidebar/featured-image/index.js +8 -6
- package/build/components/sidebar/featured-image/index.js.map +1 -1
- package/build/components/sidebar/plugin-document-setting-panel/index.js +25 -20
- package/build/components/sidebar/plugin-document-setting-panel/index.js.map +1 -1
- package/build/components/sidebar/plugin-post-publish-panel/index.js +15 -12
- package/build/components/sidebar/plugin-post-publish-panel/index.js.map +1 -1
- package/build/components/sidebar/plugin-post-status-info/index.js +9 -6
- package/build/components/sidebar/plugin-post-status-info/index.js.map +1 -1
- package/build/components/sidebar/plugin-pre-publish-panel/index.js +15 -12
- package/build/components/sidebar/plugin-pre-publish-panel/index.js.map +1 -1
- package/build/components/sidebar/plugin-sidebar/index.js +5 -4
- package/build/components/sidebar/plugin-sidebar/index.js.map +1 -1
- package/build/components/sidebar/post-excerpt/index.js +7 -5
- package/build/components/sidebar/post-excerpt/index.js.map +1 -1
- package/build/components/sidebar/post-link/index.js +19 -17
- package/build/components/sidebar/post-link/index.js.map +1 -1
- package/build/components/sidebar/post-schedule/index.js +12 -9
- package/build/components/sidebar/post-schedule/index.js.map +1 -1
- package/build/components/sidebar/post-status/index.js +11 -7
- package/build/components/sidebar/post-status/index.js.map +1 -1
- package/build/components/sidebar/post-taxonomies/taxonomy-panel.js +9 -7
- package/build/components/sidebar/post-taxonomies/taxonomy-panel.js.map +1 -1
- package/build/components/sidebar/post-visibility/index.js +24 -18
- package/build/components/sidebar/post-visibility/index.js.map +1 -1
- package/build/components/sidebar/settings-header/index.js +4 -3
- package/build/components/sidebar/settings-header/index.js.map +1 -1
- package/build/components/sidebar/template/index.js +7 -4
- package/build/components/sidebar/template/index.js.map +1 -1
- package/build/components/text-editor/index.js +5 -4
- package/build/components/text-editor/index.js.map +1 -1
- package/build/components/visual-editor/block-inspector-button.js +5 -4
- package/build/components/visual-editor/block-inspector-button.js.map +1 -1
- package/build/components/visual-editor/header.native.js +7 -6
- package/build/components/visual-editor/header.native.js.map +1 -1
- package/build/components/visual-editor/index.js +20 -15
- package/build/components/visual-editor/index.js.map +1 -1
- package/build/components/welcome-guide/image.js +5 -4
- package/build/components/welcome-guide/image.js.map +1 -1
- package/build/editor.js +9 -8
- package/build/editor.js.map +1 -1
- package/build/hooks/validate-multiple-use/index.js +28 -17
- package/build/hooks/validate-multiple-use/index.js.map +1 -1
- package/build/index.js +2 -2
- package/build/plugins/index.js +23 -20
- package/build/plugins/index.js.map +1 -1
- package/build/plugins/keyboard-shortcuts-help-menu-item/index.js +4 -3
- package/build/plugins/keyboard-shortcuts-help-menu-item/index.js.map +1 -1
- package/build/store/actions.js +26 -22
- package/build/store/actions.js.map +1 -1
- package/build/store/index.js +4 -2
- package/build/store/index.js.map +1 -1
- package/build/store/reducer.js +52 -17
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +20 -17
- package/build/store/selectors.js.map +1 -1
- package/build-module/components/block-manager/category.js +13 -11
- package/build-module/components/block-manager/category.js.map +1 -1
- package/build-module/components/block-manager/checklist.js +6 -5
- package/build-module/components/block-manager/checklist.js.map +1 -1
- package/build-module/components/block-manager/index.js +14 -10
- package/build-module/components/block-manager/index.js.map +1 -1
- package/build-module/components/block-manager/show-all.js +5 -4
- package/build-module/components/block-manager/show-all.js.map +1 -1
- package/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js +26 -21
- package/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js.map +1 -1
- package/build-module/components/editor-initialization/index.js +4 -3
- package/build-module/components/editor-initialization/index.js.map +1 -1
- package/build-module/components/editor-initialization/utils.js +2 -1
- package/build-module/components/editor-initialization/utils.js.map +1 -1
- package/build-module/components/header/fullscreen-mode-close/index.js +6 -5
- package/build-module/components/header/fullscreen-mode-close/index.js.map +1 -1
- package/build-module/components/header/header-toolbar/index.native.js +12 -11
- package/build-module/components/header/header-toolbar/index.native.js.map +1 -1
- package/build-module/components/header/index.js +4 -3
- package/build-module/components/header/index.js.map +1 -1
- package/build-module/components/header/main-dashboard-button/index.js +4 -3
- package/build-module/components/header/main-dashboard-button/index.js.map +1 -1
- package/build-module/components/header/more-menu/index.js +23 -19
- package/build-module/components/header/more-menu/index.js.map +1 -1
- package/build-module/components/header/post-publish-button-or-toggle.js +14 -13
- package/build-module/components/header/post-publish-button-or-toggle.js.map +1 -1
- package/build-module/components/header/template-title/index.js +13 -10
- package/build-module/components/header/template-title/index.js.map +1 -1
- package/build-module/components/header/tools-more-menu-group/index.js +10 -7
- package/build-module/components/header/tools-more-menu-group/index.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +4 -3
- package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/index.js +52 -42
- package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/shortcut.js +12 -10
- package/build-module/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
- package/build-module/components/layout/actions-panel.js +6 -5
- package/build-module/components/layout/actions-panel.js.map +1 -1
- package/build-module/components/layout/index.js +4 -3
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/meta-boxes/index.js +13 -9
- package/build-module/components/meta-boxes/index.js.map +1 -1
- package/build-module/components/meta-boxes/meta-box-visibility.js +8 -5
- package/build-module/components/meta-boxes/meta-box-visibility.js.map +1 -1
- package/build-module/components/meta-boxes/meta-boxes-area/index.js +4 -3
- package/build-module/components/meta-boxes/meta-boxes-area/index.js.map +1 -1
- package/build-module/components/preferences-modal/index.js +13 -11
- package/build-module/components/preferences-modal/index.js.map +1 -1
- package/build-module/components/preferences-modal/meta-boxes-section.js +23 -16
- package/build-module/components/preferences-modal/meta-boxes-section.js.map +1 -1
- package/build-module/components/preferences-modal/options/base.js +8 -7
- package/build-module/components/preferences-modal/options/base.js.map +1 -1
- package/build-module/components/preferences-modal/options/enable-custom-fields.js +9 -7
- package/build-module/components/preferences-modal/options/enable-custom-fields.js.map +1 -1
- package/build-module/components/preferences-modal/options/enable-feature.js +12 -8
- package/build-module/components/preferences-modal/options/enable-feature.js.map +1 -1
- package/build-module/components/preferences-modal/options/enable-panel.js +17 -10
- package/build-module/components/preferences-modal/options/enable-panel.js.map +1 -1
- package/build-module/components/preferences-modal/options/enable-plugin-document-setting-panel.js +10 -7
- package/build-module/components/preferences-modal/options/enable-plugin-document-setting-panel.js.map +1 -1
- package/build-module/components/preferences-modal/section.js +14 -11
- package/build-module/components/preferences-modal/section.js.map +1 -1
- package/build-module/components/sidebar/discussion-panel/index.js +7 -5
- package/build-module/components/sidebar/discussion-panel/index.js.map +1 -1
- package/build-module/components/sidebar/featured-image/index.js +8 -6
- package/build-module/components/sidebar/featured-image/index.js.map +1 -1
- package/build-module/components/sidebar/plugin-document-setting-panel/index.js +25 -20
- package/build-module/components/sidebar/plugin-document-setting-panel/index.js.map +1 -1
- package/build-module/components/sidebar/plugin-post-publish-panel/index.js +15 -12
- package/build-module/components/sidebar/plugin-post-publish-panel/index.js.map +1 -1
- package/build-module/components/sidebar/plugin-post-status-info/index.js +9 -6
- package/build-module/components/sidebar/plugin-post-status-info/index.js.map +1 -1
- package/build-module/components/sidebar/plugin-pre-publish-panel/index.js +15 -12
- package/build-module/components/sidebar/plugin-pre-publish-panel/index.js.map +1 -1
- package/build-module/components/sidebar/plugin-sidebar/index.js +5 -4
- package/build-module/components/sidebar/plugin-sidebar/index.js.map +1 -1
- package/build-module/components/sidebar/post-excerpt/index.js +7 -5
- package/build-module/components/sidebar/post-excerpt/index.js.map +1 -1
- package/build-module/components/sidebar/post-link/index.js +19 -17
- package/build-module/components/sidebar/post-link/index.js.map +1 -1
- package/build-module/components/sidebar/post-schedule/index.js +12 -9
- package/build-module/components/sidebar/post-schedule/index.js.map +1 -1
- package/build-module/components/sidebar/post-status/index.js +11 -7
- package/build-module/components/sidebar/post-status/index.js.map +1 -1
- package/build-module/components/sidebar/post-taxonomies/taxonomy-panel.js +9 -7
- package/build-module/components/sidebar/post-taxonomies/taxonomy-panel.js.map +1 -1
- package/build-module/components/sidebar/post-visibility/index.js +24 -18
- package/build-module/components/sidebar/post-visibility/index.js.map +1 -1
- package/build-module/components/sidebar/settings-header/index.js +4 -3
- package/build-module/components/sidebar/settings-header/index.js.map +1 -1
- package/build-module/components/sidebar/template/index.js +7 -4
- package/build-module/components/sidebar/template/index.js.map +1 -1
- package/build-module/components/text-editor/index.js +5 -4
- package/build-module/components/text-editor/index.js.map +1 -1
- package/build-module/components/visual-editor/block-inspector-button.js +5 -4
- package/build-module/components/visual-editor/block-inspector-button.js.map +1 -1
- package/build-module/components/visual-editor/header.native.js +7 -6
- package/build-module/components/visual-editor/header.native.js.map +1 -1
- package/build-module/components/visual-editor/index.js +20 -15
- package/build-module/components/visual-editor/index.js.map +1 -1
- package/build-module/components/welcome-guide/image.js +5 -4
- package/build-module/components/welcome-guide/image.js.map +1 -1
- package/build-module/editor.js +9 -8
- package/build-module/editor.js.map +1 -1
- package/build-module/hooks/validate-multiple-use/index.js +28 -17
- package/build-module/hooks/validate-multiple-use/index.js.map +1 -1
- package/build-module/plugins/index.js +23 -20
- package/build-module/plugins/index.js.map +1 -1
- package/build-module/plugins/keyboard-shortcuts-help-menu-item/index.js +4 -3
- package/build-module/plugins/keyboard-shortcuts-help-menu-item/index.js.map +1 -1
- package/build-module/store/actions.js +6 -2
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/reducer.js +45 -11
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +4 -3
- package/build-module/store/selectors.js.map +1 -1
- package/build-style/style-rtl.css +6 -11
- package/build-style/style.css +6 -11
- package/package.json +27 -27
- package/src/components/layout/style.scss +0 -8
- package/src/components/meta-boxes/meta-boxes-area/style.scss +7 -3
|
@@ -84,28 +84,33 @@ const shouldRenderItem = (selectedBlocks, allowedBlocks) => !Array.isArray(allow
|
|
|
84
84
|
*/
|
|
85
85
|
|
|
86
86
|
|
|
87
|
-
const PluginBlockSettingsMenuItem =
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
87
|
+
const PluginBlockSettingsMenuItem = _ref => {
|
|
88
|
+
let {
|
|
89
|
+
allowedBlocks,
|
|
90
|
+
icon,
|
|
91
|
+
label,
|
|
92
|
+
onClick,
|
|
93
|
+
small,
|
|
94
|
+
role
|
|
95
|
+
} = _ref;
|
|
96
|
+
return createElement(BlockSettingsMenuControls, null, _ref2 => {
|
|
97
|
+
let {
|
|
98
|
+
selectedBlocks,
|
|
99
|
+
onClose
|
|
100
|
+
} = _ref2;
|
|
101
101
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
102
|
+
if (!shouldRenderItem(selectedBlocks, allowedBlocks)) {
|
|
103
|
+
return null;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
return createElement(MenuItem, {
|
|
107
|
+
onClick: compose(onClick, onClose),
|
|
108
|
+
icon: icon,
|
|
109
|
+
label: small ? label : undefined,
|
|
110
|
+
role: role
|
|
111
|
+
}, !small && label);
|
|
112
|
+
});
|
|
113
|
+
};
|
|
109
114
|
|
|
110
115
|
export default PluginBlockSettingsMenuItem;
|
|
111
116
|
//# sourceMappingURL=plugin-block-settings-menu-item.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-post/src/components/block-settings-menu/plugin-block-settings-menu-item.js"],"names":["difference","BlockSettingsMenuControls","MenuItem","compose","isEverySelectedBlockAllowed","selected","allowed","length","shouldRenderItem","selectedBlocks","allowedBlocks","Array","isArray","PluginBlockSettingsMenuItem","icon","label","onClick","small","role","onClose","undefined"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,UAAT,QAA2B,QAA3B;AAEA;AACA;AACA;;AACA,SAASC,yBAAT,QAA0C,yBAA1C;AACA,SAASC,QAAT,QAAyB,uBAAzB;AACA,SAASC,OAAT,QAAwB,oBAAxB;;AAEA,MAAMC,2BAA2B,GAAG,CAAEC,QAAF,EAAYC,OAAZ,KACnCN,UAAU,CAAEK,QAAF,EAAYC,OAAZ,CAAV,CAAgCC,MAAhC,KAA2C,CAD5C;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,MAAMC,gBAAgB,GAAG,CAAEC,cAAF,EAAkBC,aAAlB,KACxB,CAAEC,KAAK,CAACC,OAAN,CAAeF,aAAf,CAAF,IACAN,2BAA2B,CAAEK,cAAF,EAAkBC,aAAlB,CAF5B;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,MAAMG,2BAA2B,GAAG,
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-post/src/components/block-settings-menu/plugin-block-settings-menu-item.js"],"names":["difference","BlockSettingsMenuControls","MenuItem","compose","isEverySelectedBlockAllowed","selected","allowed","length","shouldRenderItem","selectedBlocks","allowedBlocks","Array","isArray","PluginBlockSettingsMenuItem","icon","label","onClick","small","role","onClose","undefined"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,UAAT,QAA2B,QAA3B;AAEA;AACA;AACA;;AACA,SAASC,yBAAT,QAA0C,yBAA1C;AACA,SAASC,QAAT,QAAyB,uBAAzB;AACA,SAASC,OAAT,QAAwB,oBAAxB;;AAEA,MAAMC,2BAA2B,GAAG,CAAEC,QAAF,EAAYC,OAAZ,KACnCN,UAAU,CAAEK,QAAF,EAAYC,OAAZ,CAAV,CAAgCC,MAAhC,KAA2C,CAD5C;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,MAAMC,gBAAgB,GAAG,CAAEC,cAAF,EAAkBC,aAAlB,KACxB,CAAEC,KAAK,CAACC,OAAN,CAAeF,aAAf,CAAF,IACAN,2BAA2B,CAAEK,cAAF,EAAkBC,aAAlB,CAF5B;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,MAAMG,2BAA2B,GAAG;AAAA,MAAE;AACrCH,IAAAA,aADqC;AAErCI,IAAAA,IAFqC;AAGrCC,IAAAA,KAHqC;AAIrCC,IAAAA,OAJqC;AAKrCC,IAAAA,KALqC;AAMrCC,IAAAA;AANqC,GAAF;AAAA,SAQnC,cAAC,yBAAD,QACG,SAAmC;AAAA,QAAjC;AAAET,MAAAA,cAAF;AAAkBU,MAAAA;AAAlB,KAAiC;;AACpC,QAAK,CAAEX,gBAAgB,CAAEC,cAAF,EAAkBC,aAAlB,CAAvB,EAA2D;AAC1D,aAAO,IAAP;AACA;;AACD,WACC,cAAC,QAAD;AACC,MAAA,OAAO,EAAGP,OAAO,CAAEa,OAAF,EAAWG,OAAX,CADlB;AAEC,MAAA,IAAI,EAAGL,IAFR;AAGC,MAAA,KAAK,EAAGG,KAAK,GAAGF,KAAH,GAAWK,SAHzB;AAIC,MAAA,IAAI,EAAGF;AAJR,OAMG,CAAED,KAAF,IAAWF,KANd,CADD;AAUA,GAfF,CARmC;AAAA,CAApC;;AA2BA,eAAeF,2BAAf","sourcesContent":["/**\n * External dependencies\n */\nimport { difference } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { BlockSettingsMenuControls } from '@wordpress/block-editor';\nimport { MenuItem } from '@wordpress/components';\nimport { compose } from '@wordpress/compose';\n\nconst isEverySelectedBlockAllowed = ( selected, allowed ) =>\n\tdifference( selected, allowed ).length === 0;\n\n/**\n * Plugins may want to add an item to the menu either for every block\n * or only for the specific ones provided in the `allowedBlocks` component property.\n *\n * If there are multiple blocks selected the item will be rendered if every block\n * is of one allowed type (not necessarily the same).\n *\n * @param {string[]} selectedBlocks Array containing the names of the blocks selected\n * @param {string[]} allowedBlocks Array containing the names of the blocks allowed\n * @return {boolean} Whether the item will be rendered or not.\n */\nconst shouldRenderItem = ( selectedBlocks, allowedBlocks ) =>\n\t! Array.isArray( allowedBlocks ) ||\n\tisEverySelectedBlockAllowed( selectedBlocks, allowedBlocks );\n\n/**\n * Renders a new item in the block settings menu.\n *\n * @param {Object} props Component props.\n * @param {Array} [props.allowedBlocks] An array containing a list of block names for which the item should be shown. If not present, it'll be rendered for any block. If multiple blocks are selected, it'll be shown if and only if all of them are in the allowed list.\n * @param {WPBlockTypeIconRender} [props.icon] The [Dashicon](https://developer.wordpress.org/resource/dashicons/) icon slug string, or an SVG WP element.\n * @param {string} props.label The menu item text.\n * @param {Function} props.onClick Callback function to be executed when the user click the menu item.\n * @param {boolean} [props.small] Whether to render the label or not.\n * @param {string} [props.role] The ARIA role for the menu item.\n *\n * @example\n * ```js\n * // Using ES5 syntax\n * var __ = wp.i18n.__;\n * var PluginBlockSettingsMenuItem = wp.editPost.PluginBlockSettingsMenuItem;\n *\n * function doOnClick(){\n * \t// To be called when the user clicks the menu item.\n * }\n *\n * function MyPluginBlockSettingsMenuItem() {\n * \treturn wp.element.createElement(\n * \t\tPluginBlockSettingsMenuItem,\n * \t\t{\n * \t\t\tallowedBlocks: [ 'core/paragraph' ],\n * \t\t\ticon: 'dashicon-name',\n * \t\t\tlabel: __( 'Menu item text' ),\n * \t\t\tonClick: doOnClick,\n * \t\t}\n * \t);\n * }\n * ```\n *\n * @example\n * ```jsx\n * // Using ESNext syntax\n * import { __ } from '@wordpress/i18n';\n * import { PluginBlockSettingsMenuItem } from '@wordpress/edit-post';\n *\n * const doOnClick = ( ) => {\n * // To be called when the user clicks the menu item.\n * };\n *\n * const MyPluginBlockSettingsMenuItem = () => (\n * <PluginBlockSettingsMenuItem\n * \t\tallowedBlocks={ [ 'core/paragraph' ] }\n * \t\ticon='dashicon-name'\n * \t\tlabel={ __( 'Menu item text' ) }\n * \t\tonClick={ doOnClick } />\n * );\n * ```\n *\n * @return {WPComponent} The component to be rendered.\n */\nconst PluginBlockSettingsMenuItem = ( {\n\tallowedBlocks,\n\ticon,\n\tlabel,\n\tonClick,\n\tsmall,\n\trole,\n} ) => (\n\t<BlockSettingsMenuControls>\n\t\t{ ( { selectedBlocks, onClose } ) => {\n\t\t\tif ( ! shouldRenderItem( selectedBlocks, allowedBlocks ) ) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\treturn (\n\t\t\t\t<MenuItem\n\t\t\t\t\tonClick={ compose( onClick, onClose ) }\n\t\t\t\t\ticon={ icon }\n\t\t\t\t\tlabel={ small ? label : undefined }\n\t\t\t\t\trole={ role }\n\t\t\t\t>\n\t\t\t\t\t{ ! small && label }\n\t\t\t\t</MenuItem>\n\t\t\t);\n\t\t} }\n\t</BlockSettingsMenuControls>\n);\n\nexport default PluginBlockSettingsMenuItem;\n"]}
|
|
@@ -10,9 +10,10 @@ import { useBlockSelectionListener, useUpdatePostLinkListener } from './listener
|
|
|
10
10
|
* @return {null} This is a data component so does not render any ui.
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
export default function EditorInitialization({
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
export default function EditorInitialization(_ref) {
|
|
14
|
+
let {
|
|
15
|
+
postId
|
|
16
|
+
} = _ref;
|
|
16
17
|
useBlockSelectionListener(postId);
|
|
17
18
|
useUpdatePostLinkListener(postId);
|
|
18
19
|
return null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-post/src/components/editor-initialization/index.js"],"names":["useBlockSelectionListener","useUpdatePostLinkListener","EditorInitialization","postId"],"mappings":"AAAA;AACA;AACA;AACA,SACCA,yBADD,EAECC,yBAFD,QAGO,kBAHP;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,eAAe,SAASC,oBAAT,
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-post/src/components/editor-initialization/index.js"],"names":["useBlockSelectionListener","useUpdatePostLinkListener","EditorInitialization","postId"],"mappings":"AAAA;AACA;AACA;AACA,SACCA,yBADD,EAECC,yBAFD,QAGO,kBAHP;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,eAAe,SAASC,oBAAT,OAA4C;AAAA,MAAb;AAAEC,IAAAA;AAAF,GAAa;AAC1DH,EAAAA,yBAAyB,CAAEG,MAAF,CAAzB;AACAF,EAAAA,yBAAyB,CAAEE,MAAF,CAAzB;AACA,SAAO,IAAP;AACA","sourcesContent":["/**\n * Internal dependencies\n */\nimport {\n\tuseBlockSelectionListener,\n\tuseUpdatePostLinkListener,\n} from './listener-hooks';\n\n/**\n * Data component used for initializing the editor and re-initializes\n * when postId changes or on unmount.\n *\n * @param {number} postId The id of the post.\n * @return {null} This is a data component so does not render any ui.\n */\nexport default function EditorInitialization( { postId } ) {\n\tuseBlockSelectionListener( postId );\n\tuseUpdatePostLinkListener( postId );\n\treturn null;\n}\n"]}
|
|
@@ -9,7 +9,8 @@
|
|
|
9
9
|
*
|
|
10
10
|
* @return {Function} Listener creator.
|
|
11
11
|
*/
|
|
12
|
-
export const onChangeListener = (selector, listener
|
|
12
|
+
export const onChangeListener = function (selector, listener) {
|
|
13
|
+
let initial = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
13
14
|
let previousValue = selector();
|
|
14
15
|
|
|
15
16
|
if (initial) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-post/src/components/editor-initialization/utils.js"],"names":["onChangeListener","selector","listener","initial","previousValue","selectedValue"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMA,gBAAgB,GAAG,
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-post/src/components/editor-initialization/utils.js"],"names":["onChangeListener","selector","listener","initial","previousValue","selectedValue"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMA,gBAAgB,GAAG,UAAEC,QAAF,EAAYC,QAAZ,EAA2C;AAAA,MAArBC,OAAqB,uEAAX,KAAW;AAC1E,MAAIC,aAAa,GAAGH,QAAQ,EAA5B;;AACA,MAAKE,OAAL,EAAe;AACdD,IAAAA,QAAQ,CAAED,QAAQ,EAAV,CAAR;AACA;;AACD,SAAO,MAAM;AACZ,UAAMI,aAAa,GAAGJ,QAAQ,EAA9B;;AACA,QAAKI,aAAa,KAAKD,aAAvB,EAAuC;AACtCA,MAAAA,aAAa,GAAGC,aAAhB;AACAH,MAAAA,QAAQ,CAAEG,aAAF,CAAR;AACA;AACD,GAND;AAOA,CAZM","sourcesContent":["/**\n * Given a selector returns a functions that returns the listener only\n * if the returned value from the selector changes.\n *\n * @param {Function} selector Selector.\n * @param {Function} listener Listener.\n * @param {boolean} initial Flags whether listener should be invoked on\n * initial call.\n *\n * @return {Function} Listener creator.\n */\nexport const onChangeListener = ( selector, listener, initial = false ) => {\n\tlet previousValue = selector();\n\tif ( initial ) {\n\t\tlistener( selector() );\n\t}\n\treturn () => {\n\t\tconst selectedValue = selector();\n\t\tif ( selectedValue !== previousValue ) {\n\t\t\tpreviousValue = selectedValue;\n\t\t\tlistener( selectedValue );\n\t\t}\n\t};\n};\n"]}
|
|
@@ -22,11 +22,12 @@ import { useReducedMotion } from '@wordpress/compose';
|
|
|
22
22
|
|
|
23
23
|
import { store as editPostStore } from '../../../store';
|
|
24
24
|
|
|
25
|
-
function FullscreenModeClose({
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
25
|
+
function FullscreenModeClose(_ref) {
|
|
26
|
+
let {
|
|
27
|
+
showTooltip,
|
|
28
|
+
icon,
|
|
29
|
+
href
|
|
30
|
+
} = _ref;
|
|
30
31
|
const {
|
|
31
32
|
isActive,
|
|
32
33
|
isRequestingSiteIcon,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-post/src/components/header/fullscreen-mode-close/index.js"],"names":["get","useSelect","Button","Icon","__unstableMotion","motion","__","addQueryArgs","wordpress","store","editorStore","coreStore","useReducedMotion","editPostStore","FullscreenModeClose","showTooltip","icon","href","isActive","isRequestingSiteIcon","postType","siteIconUrl","select","getCurrentPostType","isFeatureActive","getEntityRecord","getPostType","isResolving","siteData","undefined","site_icon_url","disableMotion","buttonIcon","effect","expand","scale","borderRadius","transition","type","duration","post_type","slug"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,GAAT,QAAoB,QAApB;AAEA;AACA;AACA;;AACA,SAASC,SAAT,QAA0B,iBAA1B;AACA,SACCC,MADD,EAECC,IAFD,EAGCC,gBAAgB,IAAIC,MAHrB,QAIO,uBAJP;AAKA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,YAAT,QAA6B,gBAA7B;AACA,SAASC,SAAT,QAA0B,kBAA1B;AACA,SAASC,KAAK,IAAIC,WAAlB,QAAqC,mBAArC;AACA,SAASD,KAAK,IAAIE,SAAlB,QAAmC,sBAAnC;AACA,SAASC,gBAAT,QAAiC,oBAAjC;AAEA;AACA;AACA;;AACA,SAASH,KAAK,IAAII,aAAlB,QAAuC,gBAAvC;;AAEA,SAASC,mBAAT,
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-post/src/components/header/fullscreen-mode-close/index.js"],"names":["get","useSelect","Button","Icon","__unstableMotion","motion","__","addQueryArgs","wordpress","store","editorStore","coreStore","useReducedMotion","editPostStore","FullscreenModeClose","showTooltip","icon","href","isActive","isRequestingSiteIcon","postType","siteIconUrl","select","getCurrentPostType","isFeatureActive","getEntityRecord","getPostType","isResolving","siteData","undefined","site_icon_url","disableMotion","buttonIcon","effect","expand","scale","borderRadius","transition","type","duration","post_type","slug"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,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UAAF,EAAc;AACzBiC,MAAAA,SAAS,EAAEpB,QAAQ,CAACqB;AADK,KAAd,CAJd;AAQC,IAAA,KAAK,EAAGzC,GAAG,CACVoB,QADU,EAEV,CAAE,QAAF,EAAY,YAAZ,CAFU,EAGVd,EAAE,CAAE,MAAF,CAHQ,CARZ;AAaC,IAAA,WAAW,EAAGS;AAbf,KAeGiB,UAfH,CADD,CADD;AAqBA;;AAED,eAAelB,mBAAf","sourcesContent":["/**\n * External dependencies\n */\nimport { get } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport {\n\tButton,\n\tIcon,\n\t__unstableMotion as motion,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { addQueryArgs } from '@wordpress/url';\nimport { wordpress } from '@wordpress/icons';\nimport { store as editorStore } from '@wordpress/editor';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useReducedMotion } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../../store';\n\nfunction FullscreenModeClose( { showTooltip, icon, href } ) {\n\tconst { isActive, isRequestingSiteIcon, postType, siteIconUrl } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getCurrentPostType } = select( editorStore );\n\t\t\tconst { isFeatureActive } = select( editPostStore );\n\t\t\tconst { getEntityRecord, getPostType, isResolving } = select(\n\t\t\t\tcoreStore\n\t\t\t);\n\t\t\tconst siteData =\n\t\t\t\tgetEntityRecord( 'root', '__unstableBase', undefined ) || {};\n\n\t\t\treturn {\n\t\t\t\tisActive: isFeatureActive( 'fullscreenMode' ),\n\t\t\t\tisRequestingSiteIcon: isResolving( 'getEntityRecord', [\n\t\t\t\t\t'root',\n\t\t\t\t\t'__unstableBase',\n\t\t\t\t\tundefined,\n\t\t\t\t] ),\n\t\t\t\tpostType: getPostType( getCurrentPostType() ),\n\t\t\t\tsiteIconUrl: siteData.site_icon_url,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\n\tconst disableMotion = useReducedMotion();\n\n\tif ( ! isActive || ! postType ) {\n\t\treturn null;\n\t}\n\n\tlet buttonIcon = <Icon size=\"36px\" icon={ wordpress } />;\n\n\tconst effect = {\n\t\texpand: {\n\t\t\tscale: 1.7,\n\t\t\tborderRadius: 0,\n\t\t\ttransition: { type: 'tween', duration: '0.2' },\n\t\t},\n\t};\n\n\tif ( siteIconUrl ) {\n\t\tbuttonIcon = (\n\t\t\t<motion.img\n\t\t\t\tvariants={ ! disableMotion && effect }\n\t\t\t\talt={ __( 'Site Icon' ) }\n\t\t\t\tclassName=\"edit-post-fullscreen-mode-close_site-icon\"\n\t\t\t\tsrc={ siteIconUrl }\n\t\t\t/>\n\t\t);\n\t}\n\n\tif ( isRequestingSiteIcon ) {\n\t\tbuttonIcon = null;\n\t}\n\n\t// Override default icon if custom icon is provided via props.\n\tif ( icon ) {\n\t\tbuttonIcon = <Icon size=\"36px\" icon={ icon } />;\n\t}\n\n\treturn (\n\t\t<motion.div whileHover=\"expand\">\n\t\t\t<Button\n\t\t\t\tclassName=\"edit-post-fullscreen-mode-close has-icon\"\n\t\t\t\thref={\n\t\t\t\t\thref ??\n\t\t\t\t\taddQueryArgs( 'edit.php', {\n\t\t\t\t\t\tpost_type: postType.slug,\n\t\t\t\t\t} )\n\t\t\t\t}\n\t\t\t\tlabel={ get(\n\t\t\t\t\tpostType,\n\t\t\t\t\t[ 'labels', 'view_items' ],\n\t\t\t\t\t__( 'Back' )\n\t\t\t\t) }\n\t\t\t\tshowTooltip={ showTooltip }\n\t\t\t>\n\t\t\t\t{ buttonIcon }\n\t\t\t</Button>\n\t\t</motion.div>\n\t);\n}\n\nexport default FullscreenModeClose;\n"]}
|
|
@@ -24,17 +24,18 @@ import { store as editorStore } from '@wordpress/editor';
|
|
|
24
24
|
import styles from './style.scss';
|
|
25
25
|
import { store as editPostStore } from '../../../store';
|
|
26
26
|
|
|
27
|
-
function HeaderToolbar({
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
27
|
+
function HeaderToolbar(_ref) {
|
|
28
|
+
let {
|
|
29
|
+
hasRedo,
|
|
30
|
+
hasUndo,
|
|
31
|
+
redo,
|
|
32
|
+
undo,
|
|
33
|
+
showInserter,
|
|
34
|
+
showKeyboardHideButton,
|
|
35
|
+
getStylesFromColorScheme,
|
|
36
|
+
onHideKeyboard,
|
|
37
|
+
isRTL
|
|
38
|
+
} = _ref;
|
|
38
39
|
const scrollViewRef = useRef(null);
|
|
39
40
|
|
|
40
41
|
const scrollToStart = () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-post/src/components/header/header-toolbar/index.native.js"],"names":["Platform","ScrollView","View","useRef","compose","withPreferredColorScheme","withSelect","withDispatch","withViewportMatch","__","Inserter","BlockToolbar","store","blockEditorStore","ToolbarGroup","ToolbarButton","keyboardClose","undo","undoIcon","redo","redoIcon","editorStore","styles","editPostStore","HeaderToolbar","hasRedo","hasUndo","showInserter","showKeyboardHideButton","getStylesFromColorScheme","onHideKeyboard","isRTL","scrollViewRef","scrollToStart","isAndroid","OS","current","scrollToEnd","scrollTo","x","renderHistoryButtons","buttons","hint","reverse","container","containerDark","scrollableContent","keyboardHideContainer","select","getBlockRootClientId","getBlockSelectionEnd","hasInserterItems","getEditorSettings","hasEditorRedo","hasEditorUndo","getEditorMode","richEditingEnabled","isTextModeEnabled","getSettings","dispatch","clearSelectedBlock","togglePostTitleSelection","isLargeViewport"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,QAAT,EAAmBC,UAAnB,EAA+BC,IAA/B,QAA2C,cAA3C;AAEA;AACA;AACA;;AACA,SAASC,MAAT,QAAuB,oBAAvB;AACA,SAASC,OAAT,EAAkBC,wBAAlB,QAAkD,oBAAlD;AACA,SAASC,UAAT,EAAqBC,YAArB,QAAyC,iBAAzC;AACA,SAASC,iBAAT,QAAkC,qBAAlC;AACA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SACCC,QADD,EAECC,YAFD,EAGCC,KAAK,IAAIC,gBAHV,QAIO,yBAJP;AAKA,SAASC,YAAT,EAAuBC,aAAvB,QAA4C,uBAA5C;AACA,SACCC,aADD,EAECC,IAAI,IAAIC,QAFT,EAGCC,IAAI,IAAIC,QAHT,QAIO,kBAJP;AAKA,SAASR,KAAK,IAAIS,WAAlB,QAAqC,mBAArC;AAEA;AACA;AACA;;AACA,OAAOC,MAAP,MAAmB,cAAnB;AACA,SAASV,KAAK,IAAIW,aAAlB,QAAuC,gBAAvC;;AAEA,SAASC,aAAT,
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-post/src/components/header/header-toolbar/index.native.js"],"names":["Platform","ScrollView","View","useRef","compose","withPreferredColorScheme","withSelect","withDispatch","withViewportMatch","__","Inserter","BlockToolbar","store","blockEditorStore","ToolbarGroup","ToolbarButton","keyboardClose","undo","undoIcon","redo","redoIcon","editorStore","styles","editPostStore","HeaderToolbar","hasRedo","hasUndo","showInserter","showKeyboardHideButton","getStylesFromColorScheme","onHideKeyboard","isRTL","scrollViewRef","scrollToStart","isAndroid","OS","current","scrollToEnd","scrollTo","x","renderHistoryButtons","buttons","hint","reverse","container","containerDark","scrollableContent","keyboardHideContainer","select","getBlockRootClientId","getBlockSelectionEnd","hasInserterItems","getEditorSettings","hasEditorRedo","hasEditorUndo","getEditorMode","richEditingEnabled","isTextModeEnabled","getSettings","dispatch","clearSelectedBlock","togglePostTitleSelection","isLargeViewport"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,QAAT,EAAmBC,UAAnB,EAA+BC,IAA/B,QAA2C,cAA3C;AAEA;AACA;AACA;;AACA,SAASC,MAAT,QAAuB,oBAAvB;AACA,SAASC,OAAT,EAAkBC,wBAAlB,QAAkD,oBAAlD;AACA,SAASC,UAAT,EAAqBC,YAArB,QAAyC,iBAAzC;AACA,SAASC,iBAAT,QAAkC,qBAAlC;AAC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AwBJ,IAFxB;;AAGNa,IAAAA,cAAc,GAAG;AAChB8B,MAAAA,kBAAkB;AAClBC,MAAAA,wBAAwB,CAAE,KAAF,CAAxB;AACA;;AANK,GAAP;AAQA,CAZW,CAvBW,EAoCvBrD,iBAAiB,CAAE;AAAEsD,EAAAA,eAAe,EAAE;AAAnB,CAAF,CApCM,EAqCvBzD,wBArCuB,CAAF,CAAP,CAsCVmB,aAtCU,CAAf","sourcesContent":["/**\n * External dependencies\n */\nimport { Platform, ScrollView, View } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { useRef } from '@wordpress/element';\nimport { compose, withPreferredColorScheme } from '@wordpress/compose';\nimport { withSelect, withDispatch } from '@wordpress/data';\nimport { withViewportMatch } from '@wordpress/viewport';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tInserter,\n\tBlockToolbar,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { ToolbarGroup, ToolbarButton } from '@wordpress/components';\nimport {\n\tkeyboardClose,\n\tundo as undoIcon,\n\tredo as redoIcon,\n} from '@wordpress/icons';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport styles from './style.scss';\nimport { store as editPostStore } from '../../../store';\n\nfunction HeaderToolbar( {\n\thasRedo,\n\thasUndo,\n\tredo,\n\tundo,\n\tshowInserter,\n\tshowKeyboardHideButton,\n\tgetStylesFromColorScheme,\n\tonHideKeyboard,\n\tisRTL,\n} ) {\n\tconst scrollViewRef = useRef( null );\n\tconst scrollToStart = () => {\n\t\t// scrollview doesn't seem to automatically adjust to RTL on Android so, scroll to end when Android\n\t\tconst isAndroid = Platform.OS === 'android';\n\t\tif ( isAndroid && isRTL ) {\n\t\t\tscrollViewRef.current.scrollToEnd();\n\t\t} else {\n\t\t\tscrollViewRef.current.scrollTo( { x: 0 } );\n\t\t}\n\t};\n\tconst renderHistoryButtons = () => {\n\t\tconst buttons = [\n\t\t\t/* TODO: replace with EditorHistoryRedo and EditorHistoryUndo */\n\t\t\t<ToolbarButton\n\t\t\t\tkey=\"undoButton\"\n\t\t\t\ttitle={ __( 'Undo' ) }\n\t\t\t\ticon={ ! isRTL ? undoIcon : redoIcon }\n\t\t\t\tisDisabled={ ! hasUndo }\n\t\t\t\tonClick={ undo }\n\t\t\t\textraProps={ {\n\t\t\t\t\thint: __( 'Double tap to undo last change' ),\n\t\t\t\t} }\n\t\t\t/>,\n\t\t\t<ToolbarButton\n\t\t\t\tkey=\"redoButton\"\n\t\t\t\ttitle={ __( 'Redo' ) }\n\t\t\t\ticon={ ! isRTL ? redoIcon : undoIcon }\n\t\t\t\tisDisabled={ ! hasRedo }\n\t\t\t\tonClick={ redo }\n\t\t\t\textraProps={ {\n\t\t\t\t\thint: __( 'Double tap to redo last change' ),\n\t\t\t\t} }\n\t\t\t/>,\n\t\t];\n\n\t\treturn isRTL ? buttons.reverse() : buttons;\n\t};\n\n\treturn (\n\t\t<View\n\t\t\tstyle={ getStylesFromColorScheme(\n\t\t\t\tstyles.container,\n\t\t\t\tstyles.containerDark\n\t\t\t) }\n\t\t>\n\t\t\t<ScrollView\n\t\t\t\tref={ scrollViewRef }\n\t\t\t\tonContentSizeChange={ scrollToStart }\n\t\t\t\thorizontal={ true }\n\t\t\t\tshowsHorizontalScrollIndicator={ false }\n\t\t\t\tkeyboardShouldPersistTaps=\"always\"\n\t\t\t\talwaysBounceHorizontal={ false }\n\t\t\t\tcontentContainerStyle={ styles.scrollableContent }\n\t\t\t>\n\t\t\t\t<Inserter disabled={ ! showInserter } />\n\t\t\t\t{ renderHistoryButtons() }\n\t\t\t\t<BlockToolbar />\n\t\t\t</ScrollView>\n\t\t\t{ showKeyboardHideButton && (\n\t\t\t\t<ToolbarGroup passedStyle={ styles.keyboardHideContainer }>\n\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\ttitle={ __( 'Hide keyboard' ) }\n\t\t\t\t\t\ticon={ keyboardClose }\n\t\t\t\t\t\tonClick={ onHideKeyboard }\n\t\t\t\t\t\textraProps={ {\n\t\t\t\t\t\t\thint: __( 'Tap to hide the keyboard' ),\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t</ToolbarGroup>\n\t\t\t) }\n\t\t</View>\n\t);\n}\n\nexport default compose( [\n\twithSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetBlockRootClientId,\n\t\t\tgetBlockSelectionEnd,\n\t\t\thasInserterItems,\n\t\t} = select( blockEditorStore );\n\t\tconst { getEditorSettings } = select( editorStore );\n\t\treturn {\n\t\t\thasRedo: select( editorStore ).hasEditorRedo(),\n\t\t\thasUndo: select( editorStore ).hasEditorUndo(),\n\t\t\t// This setting (richEditingEnabled) should not live in the block editor's setting.\n\t\t\tshowInserter:\n\t\t\t\tselect( editPostStore ).getEditorMode() === 'visual' &&\n\t\t\t\tgetEditorSettings().richEditingEnabled &&\n\t\t\t\thasInserterItems(\n\t\t\t\t\tgetBlockRootClientId( getBlockSelectionEnd() )\n\t\t\t\t),\n\t\t\tisTextModeEnabled:\n\t\t\t\tselect( editPostStore ).getEditorMode() === 'text',\n\t\t\tisRTL: select( blockEditorStore ).getSettings().isRTL,\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch ) => {\n\t\tconst { clearSelectedBlock } = dispatch( blockEditorStore );\n\t\tconst { togglePostTitleSelection } = dispatch( editorStore );\n\n\t\treturn {\n\t\t\tredo: dispatch( editorStore ).redo,\n\t\t\tundo: dispatch( editorStore ).undo,\n\t\t\tonHideKeyboard() {\n\t\t\t\tclearSelectedBlock();\n\t\t\t\ttogglePostTitleSelection( false );\n\t\t\t},\n\t\t};\n\t} ),\n\twithViewportMatch( { isLargeViewport: 'medium' } ),\n\twithPreferredColorScheme,\n] )( HeaderToolbar );\n"]}
|
|
@@ -25,9 +25,10 @@ import MainDashboardButton from './main-dashboard-button';
|
|
|
25
25
|
import { store as editPostStore } from '../../store';
|
|
26
26
|
import TemplateTitle from './template-title';
|
|
27
27
|
|
|
28
|
-
function Header({
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
function Header(_ref) {
|
|
29
|
+
let {
|
|
30
|
+
setEntitiesSavedStatesCallback
|
|
31
|
+
} = _ref;
|
|
31
32
|
const {
|
|
32
33
|
hasActiveMetaboxes,
|
|
33
34
|
isPublishSidebarOpened,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-post/src/components/header/index.js"],"names":["classnames","PostSavedState","PostPreviewButton","useSelect","PinnedItems","useViewportMatch","FullscreenModeClose","HeaderToolbar","MoreMenu","PostPublishButtonOrToggle","default","DevicePreview","MainDashboardButton","store","editPostStore","TemplateTitle","Header","setEntitiesSavedStatesCallback","hasActiveMetaboxes","isPublishSidebarOpened","isSaving","showIconLabels","hasReducedUI","select","hasMetaBoxes","isSavingMetaBoxes","isFeatureActive","isLargeViewport","classes","undefined"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AAEA;AACA;AACA;;AACA,SAASC,cAAT,EAAyBC,iBAAzB,QAAkD,mBAAlD;AACA,SAASC,SAAT,QAA0B,iBAA1B;AACA,SAASC,WAAT,QAA4B,sBAA5B;AACA,SAASC,gBAAT,QAAiC,oBAAjC;AAEA;AACA;AACA;;AACA,OAAOC,mBAAP,MAAgC,yBAAhC;AACA,OAAOC,aAAP,MAA0B,kBAA1B;AACA,OAAOC,QAAP,MAAqB,aAArB;AACA,OAAOC,yBAAP,MAAsC,iCAAtC;AACA,SAASC,OAAO,IAAIC,aAApB,QAAyC,mBAAzC;AACA,OAAOC,mBAAP,MAAgC,yBAAhC;AACA,SAASC,KAAK,IAAIC,aAAlB,QAAuC,aAAvC;AACA,OAAOC,aAAP,MAA0B,kBAA1B;;AAEA,SAASC,MAAT,
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-post/src/components/header/index.js"],"names":["classnames","PostSavedState","PostPreviewButton","useSelect","PinnedItems","useViewportMatch","FullscreenModeClose","HeaderToolbar","MoreMenu","PostPublishButtonOrToggle","default","DevicePreview","MainDashboardButton","store","editPostStore","TemplateTitle","Header","setEntitiesSavedStatesCallback","hasActiveMetaboxes","isPublishSidebarOpened","isSaving","showIconLabels","hasReducedUI","select","hasMetaBoxes","isSavingMetaBoxes","isFeatureActive","isLargeViewport","classes","undefined"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AAEA;AACA;AACA;;AACA,SAASC,cAAT,EAAyBC,iBAAzB,QAAkD,mBAAlD;AACA,SAASC,SAAT,QAA0B,iBAA1B;AACA,SAASC,WAAT,QAA4B,sBAA5B;AACA,SAASC,gBAAT,QAAiC,oBAAjC;AAEA;AACA;AACA;;AACA,OAAOC,mBAAP,MAAgC,yBAAhC;AACA,OAAOC,aAAP,MAA0B,kBAA1B;AACA,OAAOC,QAAP,MAAqB,aAArB;AACA,OAAOC,yBAAP,MAAsC,iCAAtC;AACA,SAASC,OAAO,IAAIC,aAApB,QAAyC,mBAAzC;AACA,OAAOC,mBAAP,MAAgC,yBAAhC;AACA,SAASC,KAAK,IAAIC,aAAlB,QAAuC,aAAvC;AACA,OAAOC,aAAP,MAA0B,kBAA1B;;AAEA,SAASC,MAAT,OAAsD;AAAA,MAArC;AAAEC,IAAAA;AAAF,GAAqC;AACrD,QAAM;AACLC,IAAAA,kBADK;AAELC,IAAAA,sBAFK;AAGLC,IAAAA,QAHK;AAILC,IAAAA,cAJK;AAKLC,IAAAA;AALK,MAMFnB,SAAS,CACVoB,MAAF,KAAgB;AACfL,IAAAA,kBAAkB,EAAEK,MAAM,CAAET,aAAF,CAAN,CAAwBU,YAAxB,EADL;AAEfL,IAAAA,sBAAsB,EAAEI,MAAM,CAC7BT,aAD6B,CAAN,CAEtBK,sBAFsB,EAFT;AAKfC,IAAAA,QAAQ,EAAEG,MAAM,CAAET,aAAF,CAAN,CAAwBW,iBAAxB,EALK;AAMfJ,IAAAA,cAAc,EAAEE,MAAM,CAAET,aAAF,CAAN,CAAwBY,eAAxB,CACf,gBADe,CAND;AASfJ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**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { PostSavedState, PostPreviewButton } from '@wordpress/editor';\nimport { useSelect } from '@wordpress/data';\nimport { PinnedItems } from '@wordpress/interface';\nimport { useViewportMatch } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport FullscreenModeClose from './fullscreen-mode-close';\nimport HeaderToolbar from './header-toolbar';\nimport MoreMenu from './more-menu';\nimport PostPublishButtonOrToggle from './post-publish-button-or-toggle';\nimport { default as DevicePreview } from '../device-preview';\nimport MainDashboardButton from './main-dashboard-button';\nimport { store as editPostStore } from '../../store';\nimport TemplateTitle from './template-title';\n\nfunction Header( { setEntitiesSavedStatesCallback } ) {\n\tconst {\n\t\thasActiveMetaboxes,\n\t\tisPublishSidebarOpened,\n\t\tisSaving,\n\t\tshowIconLabels,\n\t\thasReducedUI,\n\t} = useSelect(\n\t\t( select ) => ( {\n\t\t\thasActiveMetaboxes: select( editPostStore ).hasMetaBoxes(),\n\t\t\tisPublishSidebarOpened: select(\n\t\t\t\teditPostStore\n\t\t\t).isPublishSidebarOpened(),\n\t\t\tisSaving: select( editPostStore ).isSavingMetaBoxes(),\n\t\t\tshowIconLabels: select( editPostStore ).isFeatureActive(\n\t\t\t\t'showIconLabels'\n\t\t\t),\n\t\t\thasReducedUI: select( editPostStore ).isFeatureActive(\n\t\t\t\t'reducedUI'\n\t\t\t),\n\t\t} ),\n\t\t[]\n\t);\n\n\tconst isLargeViewport = useViewportMatch( 'large' );\n\n\tconst classes = classnames( 'edit-post-header', {\n\t\t'has-reduced-ui': hasReducedUI,\n\t} );\n\n\treturn (\n\t\t<div className={ classes }>\n\t\t\t<MainDashboardButton.Slot>\n\t\t\t\t<FullscreenModeClose />\n\t\t\t</MainDashboardButton.Slot>\n\t\t\t<div className=\"edit-post-header__toolbar\">\n\t\t\t\t<HeaderToolbar />\n\t\t\t\t<TemplateTitle />\n\t\t\t</div>\n\t\t\t<div className=\"edit-post-header__settings\">\n\t\t\t\t{ ! isPublishSidebarOpened && (\n\t\t\t\t\t// This button isn't completely hidden by the publish sidebar.\n\t\t\t\t\t// We can't hide the whole toolbar when the publish sidebar is open because\n\t\t\t\t\t// we want to prevent mounting/unmounting the PostPublishButtonOrToggle DOM node.\n\t\t\t\t\t// We track that DOM node to return focus to the PostPublishButtonOrToggle\n\t\t\t\t\t// when the publish sidebar has been closed.\n\t\t\t\t\t<PostSavedState\n\t\t\t\t\t\tforceIsDirty={ hasActiveMetaboxes }\n\t\t\t\t\t\tforceIsSaving={ isSaving }\n\t\t\t\t\t\tshowIconLabels={ showIconLabels }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t<DevicePreview />\n\t\t\t\t<PostPreviewButton\n\t\t\t\t\tforceIsAutosaveable={ hasActiveMetaboxes }\n\t\t\t\t\tforcePreviewLink={ isSaving ? null : undefined }\n\t\t\t\t/>\n\t\t\t\t<PostPublishButtonOrToggle\n\t\t\t\t\tforceIsDirty={ hasActiveMetaboxes }\n\t\t\t\t\tforceIsSaving={ isSaving }\n\t\t\t\t\tsetEntitiesSavedStatesCallback={\n\t\t\t\t\t\tsetEntitiesSavedStatesCallback\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t\t{ ( isLargeViewport || ! showIconLabels ) && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<PinnedItems.Slot scope=\"core/edit-post\" />\n\t\t\t\t\t\t<MoreMenu showIconLabels={ showIconLabels } />\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t\t{ showIconLabels && ! isLargeViewport && (\n\t\t\t\t\t<MoreMenu showIconLabels={ showIconLabels } />\n\t\t\t\t) }\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n\nexport default Header;\n"]}
|
|
@@ -11,9 +11,10 @@ const {
|
|
|
11
11
|
} = createSlotFill(slotName);
|
|
12
12
|
const MainDashboardButton = Fill;
|
|
13
13
|
|
|
14
|
-
const Slot =
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
const Slot = _ref => {
|
|
15
|
+
let {
|
|
16
|
+
children
|
|
17
|
+
} = _ref;
|
|
17
18
|
const slot = useSlot(slotName);
|
|
18
19
|
const hasFills = Boolean(slot.fills && slot.fills.length);
|
|
19
20
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-post/src/components/header/main-dashboard-button/index.js"],"names":["__experimentalUseSlot","useSlot","createSlotFill","slotName","Fill","Slot","MainDashboardButtonSlot","MainDashboardButton","children","slot","hasFills","Boolean","fills","length"],"mappings":";;AAAA;AACA;AACA;AACA,SACCA,qBAAqB,IAAIC,OAD1B,EAECC,cAFD,QAGO,uBAHP;AAKA,MAAMC,QAAQ,GAAG,mCAAjB;AAEA,MAAM;AAAEC,EAAAA,IAAF;AAAQC,EAAAA,IAAI,EAAEC;AAAd,IAA0CJ,cAAc,CAAEC,QAAF,CAA9D;AAEA,MAAMI,mBAAmB,GAAGH,IAA5B;;AAEA,MAAMC,IAAI,GAAG,
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-post/src/components/header/main-dashboard-button/index.js"],"names":["__experimentalUseSlot","useSlot","createSlotFill","slotName","Fill","Slot","MainDashboardButtonSlot","MainDashboardButton","children","slot","hasFills","Boolean","fills","length"],"mappings":";;AAAA;AACA;AACA;AACA,SACCA,qBAAqB,IAAIC,OAD1B,EAECC,cAFD,QAGO,uBAHP;AAKA,MAAMC,QAAQ,GAAG,mCAAjB;AAEA,MAAM;AAAEC,EAAAA,IAAF;AAAQC,EAAAA,IAAI,EAAEC;AAAd,IAA0CJ,cAAc,CAAEC,QAAF,CAA9D;AAEA,MAAMI,mBAAmB,GAAGH,IAA5B;;AAEA,MAAMC,IAAI,GAAG,QAAoB;AAAA,MAAlB;AAAEG,IAAAA;AAAF,GAAkB;AAChC,QAAMC,IAAI,GAAGR,OAAO,CAAEE,QAAF,CAApB;AACA,QAAMO,QAAQ,GAAGC,OAAO,CAAEF,IAAI,CAACG,KAAL,IAAcH,IAAI,CAACG,KAAL,CAAWC,MAA3B,CAAxB;;AAEA,MAAK,CAAEH,QAAP,EAAkB;AACjB,WAAOF,QAAP;AACA;;AAED,SAAO,cAAC,uBAAD;AAAyB,IAAA,gBAAgB;AAAzC,IAAP;AACA,CATD;;AAWAD,mBAAmB,CAACF,IAApB,GAA2BA,IAA3B;AAEA,eAAeE,mBAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalUseSlot as useSlot,\n\tcreateSlotFill,\n} from '@wordpress/components';\n\nconst slotName = '__experimentalMainDashboardButton';\n\nconst { Fill, Slot: MainDashboardButtonSlot } = createSlotFill( slotName );\n\nconst MainDashboardButton = Fill;\n\nconst Slot = ( { children } ) => {\n\tconst slot = useSlot( slotName );\n\tconst hasFills = Boolean( slot.fills && slot.fills.length );\n\n\tif ( ! hasFills ) {\n\t\treturn children;\n\t}\n\n\treturn <MainDashboardButtonSlot bubblesVirtually />;\n};\n\nMainDashboardButton.Slot = Slot;\n\nexport default MainDashboardButton;\n"]}
|
|
@@ -19,9 +19,10 @@ const POPOVER_PROPS = {
|
|
|
19
19
|
className: 'edit-post-more-menu__content'
|
|
20
20
|
};
|
|
21
21
|
|
|
22
|
-
const MoreMenu =
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
const MoreMenu = _ref => {
|
|
23
|
+
let {
|
|
24
|
+
showIconLabels
|
|
25
|
+
} = _ref;
|
|
25
26
|
const isLargeViewport = useViewportMatch('large');
|
|
26
27
|
return createElement(MoreMenuDropdown, {
|
|
27
28
|
className: "edit-post-more-menu",
|
|
@@ -32,23 +33,26 @@ const MoreMenu = ({
|
|
|
32
33
|
variant: 'tertiary'
|
|
33
34
|
})
|
|
34
35
|
}
|
|
35
|
-
},
|
|
36
|
-
|
|
37
|
-
}) => createElement(Fragment, null, showIconLabels && !isLargeViewport && createElement(PinnedItems.Slot, {
|
|
38
|
-
className: showIconLabels && 'show-icon-labels',
|
|
39
|
-
scope: "core/edit-post"
|
|
40
|
-
}), createElement(WritingMenu, null), createElement(ModeSwitcher, null), createElement(ActionItem.Slot, {
|
|
41
|
-
name: "core/edit-post/plugin-more-menu",
|
|
42
|
-
label: __('Plugins'),
|
|
43
|
-
as: MenuGroup,
|
|
44
|
-
fillProps: {
|
|
45
|
-
onClick: onClose
|
|
46
|
-
}
|
|
47
|
-
}), createElement(ToolsMoreMenuGroup.Slot, {
|
|
48
|
-
fillProps: {
|
|
36
|
+
}, _ref2 => {
|
|
37
|
+
let {
|
|
49
38
|
onClose
|
|
50
|
-
}
|
|
51
|
-
|
|
39
|
+
} = _ref2;
|
|
40
|
+
return createElement(Fragment, null, showIconLabels && !isLargeViewport && createElement(PinnedItems.Slot, {
|
|
41
|
+
className: showIconLabels && 'show-icon-labels',
|
|
42
|
+
scope: "core/edit-post"
|
|
43
|
+
}), createElement(WritingMenu, null), createElement(ModeSwitcher, null), createElement(ActionItem.Slot, {
|
|
44
|
+
name: "core/edit-post/plugin-more-menu",
|
|
45
|
+
label: __('Plugins'),
|
|
46
|
+
as: MenuGroup,
|
|
47
|
+
fillProps: {
|
|
48
|
+
onClick: onClose
|
|
49
|
+
}
|
|
50
|
+
}), createElement(ToolsMoreMenuGroup.Slot, {
|
|
51
|
+
fillProps: {
|
|
52
|
+
onClose
|
|
53
|
+
}
|
|
54
|
+
}), createElement(MenuGroup, null, createElement(PreferencesMenuItem, null)));
|
|
55
|
+
});
|
|
52
56
|
};
|
|
53
57
|
|
|
54
58
|
export default MoreMenu;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-post/src/components/header/more-menu/index.js"],"names":["__","MenuGroup","ActionItem","MoreMenuDropdown","PinnedItems","useViewportMatch","ModeSwitcher","PreferencesMenuItem","ToolsMoreMenuGroup","WritingMenu","POPOVER_PROPS","className","MoreMenu","showIconLabels","isLargeViewport","showTooltip","variant","onClose","onClick"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,EAAT,QAAmB,iBAAnB;AACA,SAASC,SAAT,QAA0B,uBAA1B;AACA,SACCC,UADD,EAECC,gBAFD,EAGCC,WAHD,QAIO,sBAJP;AAKA,SAASC,gBAAT,QAAiC,oBAAjC;AAEA;AACA;AACA;;AACA,OAAOC,YAAP,MAAyB,kBAAzB;AACA,OAAOC,mBAAP,MAAgC,0BAAhC;AACA,OAAOC,kBAAP,MAA+B,0BAA/B;AACA,OAAOC,WAAP,MAAwB,iBAAxB;AAEA,MAAMC,aAAa,GAAG;AACrBC,EAAAA,SAAS,EAAE;AADU,CAAtB;;AAIA,MAAMC,QAAQ,GAAG,
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-post/src/components/header/more-menu/index.js"],"names":["__","MenuGroup","ActionItem","MoreMenuDropdown","PinnedItems","useViewportMatch","ModeSwitcher","PreferencesMenuItem","ToolsMoreMenuGroup","WritingMenu","POPOVER_PROPS","className","MoreMenu","showIconLabels","isLargeViewport","showTooltip","variant","onClose","onClick"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,EAAT,QAAmB,iBAAnB;AACA,SAASC,SAAT,QAA0B,uBAA1B;AACA,SACCC,UADD,EAECC,gBAFD,EAGCC,WAHD,QAIO,sBAJP;AAKA,SAASC,gBAAT,QAAiC,oBAAjC;AAEA;AACA;AACA;;AACA,OAAOC,YAAP,MAAyB,kBAAzB;AACA,OAAOC,mBAAP,MAAgC,0BAAhC;AACA,OAAOC,kBAAP,MAA+B,0BAA/B;AACA,OAAOC,WAAP,MAAwB,iBAAxB;AAEA,MAAMC,aAAa,GAAG;AACrBC,EAAAA,SAAS,EAAE;AADU,CAAtB;;AAIA,MAAMC,QAAQ,GAAG,QAA0B;AAAA,MAAxB;AAAEC,IAAAA;AAAF,GAAwB;AAC1C,QAAMC,eAAe,GAAGT,gBAAgB,CAAE,OAAF,CAAxC;AAEA,SACC,cAAC,gBAAD;AACC,IAAA,SAAS,EAAC,qBADX;AAEC,IAAA,YAAY,EAAGK,aAFhB;AAGC,IAAA,WAAW,EAAG;AACbK,MAAAA,WAAW,EAAE,CAAEF,cADF;AAEb,UAAKA,cAAc,IAAI;AAAEG,QAAAA,OAAO,EAAE;AAAX,OAAvB;AAFa;AAHf,KAQG;AAAA,QAAE;AAAEC,MAAAA;AAAF,KAAF;AAAA,WACD,8BACGJ,cAAc,IAAI,CAAEC,eAApB,IACD,cAAC,WAAD,CAAa,IAAb;AACC,MAAA,SAAS,EAAGD,cAAc,IAAI,kBAD/B;AAEC,MAAA,KAAK,EAAC;AAFP,MAFF,EAOC,cAAC,WAAD,OAPD,EAQC,cAAC,YAAD,OARD,EASC,cAAC,UAAD,CAAY,IAAZ;AACC,MAAA,IAAI,EAAC,iCADN;AAEC,MAAA,KAAK,EAAGb,EAAE,CAAE,SAAF,CAFX;AAGC,MAAA,EAAE,EAAGC,SAHN;AAIC,MAAA,SAAS,EAAG;AAAEiB,QAAAA,OAAO,EAAED;AAAX;AAJb,MATD,EAeC,cAAC,kBAAD,CAAoB,IAApB;AAAyB,MAAA,SAAS,EAAG;AAAEA,QAAAA;AAAF;AAArC,MAfD,EAgBC,cAAC,SAAD,QACC,cAAC,mBAAD,OADD,CAhBD,CADC;AAAA,GARH,CADD;AAiCA,CApCD;;AAsCA,eAAeL,QAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { MenuGroup } from '@wordpress/components';\nimport {\n\tActionItem,\n\tMoreMenuDropdown,\n\tPinnedItems,\n} from '@wordpress/interface';\nimport { useViewportMatch } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport ModeSwitcher from '../mode-switcher';\nimport PreferencesMenuItem from '../preferences-menu-item';\nimport ToolsMoreMenuGroup from '../tools-more-menu-group';\nimport WritingMenu from '../writing-menu';\n\nconst POPOVER_PROPS = {\n\tclassName: 'edit-post-more-menu__content',\n};\n\nconst MoreMenu = ( { showIconLabels } ) => {\n\tconst isLargeViewport = useViewportMatch( 'large' );\n\n\treturn (\n\t\t<MoreMenuDropdown\n\t\t\tclassName=\"edit-post-more-menu\"\n\t\t\tpopoverProps={ POPOVER_PROPS }\n\t\t\ttoggleProps={ {\n\t\t\t\tshowTooltip: ! showIconLabels,\n\t\t\t\t...( showIconLabels && { variant: 'tertiary' } ),\n\t\t\t} }\n\t\t>\n\t\t\t{ ( { onClose } ) => (\n\t\t\t\t<>\n\t\t\t\t\t{ showIconLabels && ! isLargeViewport && (\n\t\t\t\t\t\t<PinnedItems.Slot\n\t\t\t\t\t\t\tclassName={ showIconLabels && 'show-icon-labels' }\n\t\t\t\t\t\t\tscope=\"core/edit-post\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t<WritingMenu />\n\t\t\t\t\t<ModeSwitcher />\n\t\t\t\t\t<ActionItem.Slot\n\t\t\t\t\t\tname=\"core/edit-post/plugin-more-menu\"\n\t\t\t\t\t\tlabel={ __( 'Plugins' ) }\n\t\t\t\t\t\tas={ MenuGroup }\n\t\t\t\t\t\tfillProps={ { onClick: onClose } }\n\t\t\t\t\t/>\n\t\t\t\t\t<ToolsMoreMenuGroup.Slot fillProps={ { onClose } } />\n\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t<PreferencesMenuItem />\n\t\t\t\t\t</MenuGroup>\n\t\t\t\t</>\n\t\t\t) }\n\t\t</MoreMenuDropdown>\n\t);\n};\n\nexport default MoreMenu;\n"]}
|
|
@@ -16,19 +16,20 @@ import { PostPublishButton, store as editorStore } from '@wordpress/editor';
|
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
18
|
import { store as editPostStore } from '../../store';
|
|
19
|
-
export function PostPublishButtonOrToggle({
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
19
|
+
export function PostPublishButtonOrToggle(_ref) {
|
|
20
|
+
let {
|
|
21
|
+
forceIsDirty,
|
|
22
|
+
forceIsSaving,
|
|
23
|
+
hasPublishAction,
|
|
24
|
+
isBeingScheduled,
|
|
25
|
+
isPending,
|
|
26
|
+
isPublished,
|
|
27
|
+
isPublishSidebarEnabled,
|
|
28
|
+
isPublishSidebarOpened,
|
|
29
|
+
isScheduled,
|
|
30
|
+
togglePublishSidebar,
|
|
31
|
+
setEntitiesSavedStatesCallback
|
|
32
|
+
} = _ref;
|
|
32
33
|
const IS_TOGGLE = 'toggle';
|
|
33
34
|
const IS_BUTTON = 'button';
|
|
34
35
|
const isSmallerThanMediumViewport = useViewportMatch('medium', '<');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-post/src/components/header/post-publish-button-or-toggle.js"],"names":["get","useViewportMatch","compose","withDispatch","withSelect","PostPublishButton","store","editorStore","editPostStore","PostPublishButtonOrToggle","forceIsDirty","forceIsSaving","hasPublishAction","isBeingScheduled","isPending","isPublished","isPublishSidebarEnabled","isPublishSidebarOpened","isScheduled","togglePublishSidebar","setEntitiesSavedStatesCallback","IS_TOGGLE","IS_BUTTON","isSmallerThanMediumViewport","component","select","getCurrentPost","isEditedPostBeingScheduled","isCurrentPostPending","isCurrentPostPublished","isCurrentPostScheduled","dispatch"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,GAAT,QAAoB,QAApB;AAEA;AACA;AACA;;AACA,SAASC,gBAAT,EAA2BC,OAA3B,QAA0C,oBAA1C;AACA,SAASC,YAAT,EAAuBC,UAAvB,QAAyC,iBAAzC;AACA,SAASC,iBAAT,EAA4BC,KAAK,IAAIC,WAArC,QAAwD,mBAAxD;AAEA;AACA;AACA;;AACA,SAASD,KAAK,IAAIE,aAAlB,QAAuC,aAAvC;AAEA,OAAO,SAASC,yBAAT,
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-post/src/components/header/post-publish-button-or-toggle.js"],"names":["get","useViewportMatch","compose","withDispatch","withSelect","PostPublishButton","store","editorStore","editPostStore","PostPublishButtonOrToggle","forceIsDirty","forceIsSaving","hasPublishAction","isBeingScheduled","isPending","isPublished","isPublishSidebarEnabled","isPublishSidebarOpened","isScheduled","togglePublishSidebar","setEntitiesSavedStatesCallback","IS_TOGGLE","IS_BUTTON","isSmallerThanMediumViewport","component","select","getCurrentPost","isEditedPostBeingScheduled","isCurrentPostPending","isCurrentPostPublished","isCurrentPostScheduled","dispatch"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,GAAT,QAAoB,QAApB;AAEA;AACA;AACA;;AACA,SAASC,gBAAT,EAA2BC,OAA3B,QAA0C,oBAA1C;AACA,SAASC,YAAT,EAAuBC,UAAvB,QAAyC,iBAAzC;AACA,SAASC,iBAAT,EAA4BC,KAAK,IAAIC,WAArC,QAAwD,mBAAxD;AAEA;AACA;AACA;;AACA,SAASD,KAAK,IAAIE,aAAlB,QAAuC,aAAvC;AAEA,OAAO,SAASC,yBAAT,OAYH;AAAA,MAZuC;AAC1CC,IAAAA,YAD0C;AAE1CC,IAAAA,aAF0C;AAG1CC,IAAAA,gBAH0C;AAI1CC,IAAAA,gBAJ0C;AAK1CC,IAAAA,SAL0C;AAM1CC,IAAAA,WAN0C;AAO1CC,IAAAA,uBAP0C;AAQ1CC,IAAAA,sBAR0C;AAS1CC,IAAAA,WAT0C;AAU1CC,IAAAA,oBAV0C;AAW1CC,IAAAA;AAX0C,GAYvC;AACH,QAAMC,SAAS,GAAG,QAAlB;AACA,QAAMC,SAAS,GAAG,QAAlB;AACA,QAAMC,2BAA2B,GAAGtB,gBAAgB,CAAE,QAAF,EAAY,GAAZ,CAApD;AACA,MAAIuB,SAAJ;AAEA;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACC,MACCT,WAAW,IACTG,WAAW,IAAIL,gBADjB,IAEEC,SAAS,IAAI,CAAEF,gBAAf,IAAmC,CAAEW,2BAHxC,EAIE;AACDC,IAAAA,SAAS,GAAGF,SAAZ;AACA,GAND,MAMO,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,CAAEvB,aAAF,CAAzC;AACA,SAAO;AACNW,IAAAA;AADM,GAAP;AAGA,CALW,CAlBS,CAAP,CAwBZV,yBAxBY,CAAf","sourcesContent":["/**\n * External dependencies\n */\nimport { get } from 'lodash';\n\n/**\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/support/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: get(\n\t\t\tselect( editorStore ).getCurrentPost(),\n\t\t\t[ '_links', 'wp:action-publish' ],\n\t\t\tfalse\n\t\t),\n\t\tisBeingScheduled: select( editorStore ).isEditedPostBeingScheduled(),\n\t\tisPending: select( editorStore ).isCurrentPostPending(),\n\t\tisPublished: select( editorStore ).isCurrentPostPublished(),\n\t\tisPublishSidebarEnabled: select(\n\t\t\teditorStore\n\t\t).isPublishSidebarEnabled(),\n\t\tisPublishSidebarOpened: select(\n\t\t\teditPostStore\n\t\t).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"]}
|
|
@@ -75,16 +75,19 @@ function TemplateTitle() {
|
|
|
75
75
|
}, title), createElement(Dropdown, {
|
|
76
76
|
position: "bottom center",
|
|
77
77
|
contentClassName: "edit-post-template-top-area__popover",
|
|
78
|
-
renderToggle:
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
78
|
+
renderToggle: _ref => {
|
|
79
|
+
let {
|
|
80
|
+
onToggle
|
|
81
|
+
} = _ref;
|
|
82
|
+
return createElement(Button, {
|
|
83
|
+
className: "edit-post-template-title",
|
|
84
|
+
isLink: true,
|
|
85
|
+
icon: chevronDown,
|
|
86
|
+
showTooltip: true,
|
|
87
|
+
onClick: onToggle,
|
|
88
|
+
label: __('Template Options')
|
|
89
|
+
}, templateTitle);
|
|
90
|
+
},
|
|
88
91
|
renderContent: () => createElement(Fragment, null, template.has_theme_file ? createElement(TemplateDescription, null) : createElement(EditTemplateTitle, null), createElement(DeleteTemplate, null))
|
|
89
92
|
}));
|
|
90
93
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-post/src/components/header/template-title/index.js"],"names":["__","sprintf","useSelect","useDispatch","Dropdown","Button","chevronDown","store","editPostStore","blockEditorStore","editorStore","DeleteTemplate","EditTemplateTitle","TemplateDescription","TemplateTitle","template","isEditing","title","select","isEditingTemplate","getEditedPostTemplate","getEditedPostAttribute","_isEditing","clearSelectedBlock","setIsEditingTemplate","templateTitle","slug","onToggle","has_theme_file"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,EAAT,EAAaC,OAAb,QAA4B,iBAA5B;AACA,SAASC,SAAT,EAAoBC,WAApB,QAAuC,iBAAvC;AACA,SAASC,QAAT,EAAmBC,MAAnB,QAAiC,uBAAjC;AACA,SAASC,WAAT,QAA4B,kBAA5B;AAEA;AACA;AACA;;AACA,SAASC,KAAK,IAAIC,aAAlB,QAAuC,gBAAvC;AACA,SAASD,KAAK,IAAIE,gBAAlB,QAA0C,yBAA1C;AACA,SAASF,KAAK,IAAIG,WAAlB,QAAqC,mBAArC;AACA,OAAOC,cAAP,MAA2B,mBAA3B;AACA,OAAOC,iBAAP,MAA8B,uBAA9B;AACA,OAAOC,mBAAP,MAAgC,wBAAhC;;AAEA,SAASC,aAAT,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AAA,KAAK,EAAGzB,OAAO;AACd;AACAD,IAAAA,EAAE,CAAE,SAAF,CAFY,EAGdiB,KAHc,CAJhB;AASC,IAAA,OAAO,EAAG,MAAM;AACfM,MAAAA,kBAAkB;AAClBC,MAAAA,oBAAoB,CAAE,KAAF,CAApB;AACA;AAZF,KAcGP,KAdH,CADD,EAiBC,cAAC,QAAD;AACC,IAAA,QAAQ,EAAC,eADV;AAEC,IAAA,gBAAgB,EAAC,sCAFlB;AAGC,IAAA,YAAY,EAAG,
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-post/src/components/header/template-title/index.js"],"names":["__","sprintf","useSelect","useDispatch","Dropdown","Button","chevronDown","store","editPostStore","blockEditorStore","editorStore","DeleteTemplate","EditTemplateTitle","TemplateDescription","TemplateTitle","template","isEditing","title","select","isEditingTemplate","getEditedPostTemplate","getEditedPostAttribute","_isEditing","clearSelectedBlock","setIsEditingTemplate","templateTitle","slug","onToggle","has_theme_file"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,EAAT,EAAaC,OAAb,QAA4B,iBAA5B;AACA,SAASC,SAAT,EAAoBC,WAApB,QAAuC,iBAAvC;AACA,SAASC,QAAT,EAAmBC,MAAnB,QAAiC,uBAAjC;AACA,SAASC,WAAT,QAA4B,kBAA5B;AAEA;AACA;AACA;;AACA,SAASC,KAAK,IAAIC,aAAlB,QAAuC,gBAAvC;AACA,SAASD,KAAK,IAAIE,gBAAlB,QAA0C,yBAA1C;AACA,SAASF,KAAK,IAAIG,WAAlB,QAAqC,mBAArC;AACA,OAAOC,cAAP,MAA2B,mBAA3B;AACA,OAAOC,iBAAP,MAA8B,uBAA9B;AACA,OAAOC,mBAAP,MAAgC,wBAAhC;;AAEA,SAASC,aAAT,GAAyB;AACxB,QAAM;AAAEC,IAAAA,QAAF;AAAYC,IAAAA,SAAZ;AAAuBC,IAAAA;AAAvB,MAAiCf,SAAS,CAAIgB,MAAF,IAAc;AAC/D,UAAM;AAAEC,MAAAA,iBAAF;AAAq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oB,CAAE,KAAF,CAApB;AACA;AAZF,KAcGP,KAdH,CADD,EAiBC,cAAC,QAAD;AACC,IAAA,QAAQ,EAAC,eADV;AAEC,IAAA,gBAAgB,EAAC,sCAFlB;AAGC,IAAA,YAAY,EAAG;AAAA,UAAE;AAAEU,QAAAA;AAAF,OAAF;AAAA,aACd,cAAC,MAAD;AACC,QAAA,SAAS,EAAC,0BADX;AAEC,QAAA,MAAM,MAFP;AAGC,QAAA,IAAI,EAAGrB,WAHR;AAIC,QAAA,WAAW,MAJZ;AAKC,QAAA,OAAO,EAAGqB,QALX;AAMC,QAAA,KAAK,EAAG3B,EAAE,CAAE,kBAAF;AANX,SAQGyB,aARH,CADc;AAAA,KAHhB;AAeC,IAAA,aAAa,EAAG,MACf,8BACGV,QAAQ,CAACa,cAAT,GACD,cAAC,mBAAD,OADC,GAGD,cAAC,iBAAD,OAJF,EAMC,cAAC,cAAD,OAND;AAhBF,IAjBD,CADD;AA8CA;;AAED,eAAed,aAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { Dropdown, Button } from '@wordpress/components';\nimport { chevronDown } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../../store';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { store as editorStore } from '@wordpress/editor';\nimport DeleteTemplate from './delete-template';\nimport EditTemplateTitle from './edit-template-title';\nimport TemplateDescription from './template-description';\n\nfunction TemplateTitle() {\n\tconst { template, isEditing, title } = useSelect( ( select ) => {\n\t\tconst { isEditingTemplate, getEditedPostTemplate } = select(\n\t\t\teditPostStore\n\t\t);\n\t\tconst { getEditedPostAttribute } = select( editorStore );\n\n\t\tconst _isEditing = isEditingTemplate();\n\n\t\treturn {\n\t\t\ttemplate: _isEditing ? getEditedPostTemplate() : null,\n\t\t\tisEditing: _isEditing,\n\t\t\ttitle: getEditedPostAttribute( 'title' )\n\t\t\t\t? getEditedPostAttribute( 'title' )\n\t\t\t\t: __( 'Untitled' ),\n\t\t};\n\t}, [] );\n\n\tconst { clearSelectedBlock } = useDispatch( blockEditorStore );\n\tconst { setIsEditingTemplate } = useDispatch( editPostStore );\n\n\tif ( ! isEditing || ! template ) {\n\t\treturn null;\n\t}\n\n\tlet templateTitle = __( 'Default' );\n\tif ( template?.title ) {\n\t\ttemplateTitle = template.title;\n\t} else if ( !! template ) {\n\t\ttemplateTitle = template.slug;\n\t}\n\n\treturn (\n\t\t<div className=\"edit-post-template-top-area\">\n\t\t\t<Button\n\t\t\t\tclassName=\"edit-post-template-post-title\"\n\t\t\t\tisLink\n\t\t\t\tshowTooltip\n\t\t\t\tlabel={ sprintf(\n\t\t\t\t\t/* translators: %s: Title of the referring post, e.g: \"Hello World!\" */\n\t\t\t\t\t__( 'Edit %s' ),\n\t\t\t\t\ttitle\n\t\t\t\t) }\n\t\t\t\tonClick={ () => {\n\t\t\t\t\tclearSelectedBlock();\n\t\t\t\t\tsetIsEditingTemplate( false );\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t{ title }\n\t\t\t</Button>\n\t\t\t<Dropdown\n\t\t\t\tposition=\"bottom center\"\n\t\t\t\tcontentClassName=\"edit-post-template-top-area__popover\"\n\t\t\t\trenderToggle={ ( { onToggle } ) => (\n\t\t\t\t\t<Button\n\t\t\t\t\t\tclassName=\"edit-post-template-title\"\n\t\t\t\t\t\tisLink\n\t\t\t\t\t\ticon={ chevronDown }\n\t\t\t\t\t\tshowTooltip\n\t\t\t\t\t\tonClick={ onToggle }\n\t\t\t\t\t\tlabel={ __( 'Template Options' ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ templateTitle }\n\t\t\t\t\t</Button>\n\t\t\t\t) }\n\t\t\t\trenderContent={ () => (\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ template.has_theme_file ? (\n\t\t\t\t\t\t\t<TemplateDescription />\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<EditTemplateTitle />\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<DeleteTemplate />\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t/>\n\t\t</div>\n\t);\n}\n\nexport default TemplateTitle;\n"]}
|
|
@@ -15,13 +15,16 @@ const {
|
|
|
15
15
|
Slot
|
|
16
16
|
} = createSlotFill('ToolsMoreMenuGroup');
|
|
17
17
|
|
|
18
|
-
ToolsMoreMenuGroup.Slot =
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}, fills)
|
|
18
|
+
ToolsMoreMenuGroup.Slot = _ref => {
|
|
19
|
+
let {
|
|
20
|
+
fillProps
|
|
21
|
+
} = _ref;
|
|
22
|
+
return createElement(Slot, {
|
|
23
|
+
fillProps: fillProps
|
|
24
|
+
}, fills => !isEmpty(fills) && createElement(MenuGroup, {
|
|
25
|
+
label: __('Tools')
|
|
26
|
+
}, fills));
|
|
27
|
+
};
|
|
25
28
|
|
|
26
29
|
export default ToolsMoreMenuGroup;
|
|
27
30
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-post/src/components/header/tools-more-menu-group/index.js"],"names":["isEmpty","createSlotFill","MenuGroup","__","Fill","ToolsMoreMenuGroup","Slot","fillProps","fills"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,OAAT,QAAwB,QAAxB;AAEA;AACA;AACA;;AACA,SAASC,cAAT,EAAyBC,SAAzB,QAA0C,uBAA1C;AACA,SAASC,EAAT,QAAmB,iBAAnB;AAEA,MAAM;AAAEC,EAAAA,IAAI,EAAEC,kBAAR;AAA4BC,EAAAA;AAA5B,IAAqCL,cAAc,CACxD,oBADwD,CAAzD;;AAIAI,kBAAkB,CAACC,IAAnB,GAA0B,
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-post/src/components/header/tools-more-menu-group/index.js"],"names":["isEmpty","createSlotFill","MenuGroup","__","Fill","ToolsMoreMenuGroup","Slot","fillProps","fills"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,OAAT,QAAwB,QAAxB;AAEA;AACA;AACA;;AACA,SAASC,cAAT,EAAyBC,SAAzB,QAA0C,uBAA1C;AACA,SAASC,EAAT,QAAmB,iBAAnB;AAEA,MAAM;AAAEC,EAAAA,IAAI,EAAEC,kBAAR;AAA4BC,EAAAA;AAA5B,IAAqCL,cAAc,CACxD,oBADwD,CAAzD;;AAIAI,kBAAkB,CAACC,IAAnB,GAA0B;AAAA,MAAE;AAAEC,IAAAA;AAAF,GAAF;AAAA,SACzB,cAAC,IAAD;AAAM,IAAA,SAAS,EAAGA;AAAlB,KACKC,KAAF,IACD,CAAER,OAAO,CAAEQ,KAAF,CAAT,IACC,cAAC,SAAD;AAAW,IAAA,KAAK,EAAGL,EAAE,CAAE,OAAF;AAArB,KAAqCK,KAArC,CAHH,CADyB;AAAA,CAA1B;;AAUA,eAAeH,kBAAf","sourcesContent":["/**\n * External dependencies\n */\nimport { isEmpty } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { createSlotFill, MenuGroup } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\nconst { Fill: ToolsMoreMenuGroup, Slot } = createSlotFill(\n\t'ToolsMoreMenuGroup'\n);\n\nToolsMoreMenuGroup.Slot = ( { fillProps } ) => (\n\t<Slot fillProps={ fillProps }>\n\t\t{ ( fills ) =>\n\t\t\t! isEmpty( fills ) && (\n\t\t\t\t<MenuGroup label={ __( 'Tools' ) }>{ fills }</MenuGroup>\n\t\t\t)\n\t\t}\n\t</Slot>\n);\n\nexport default ToolsMoreMenuGroup;\n"]}
|
|
@@ -11,9 +11,10 @@ import { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';
|
|
|
11
11
|
|
|
12
12
|
import Shortcut from './shortcut';
|
|
13
13
|
|
|
14
|
-
function DynamicShortcut({
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
function DynamicShortcut(_ref) {
|
|
15
|
+
let {
|
|
16
|
+
name
|
|
17
|
+
} = _ref;
|
|
17
18
|
const {
|
|
18
19
|
keyCombination,
|
|
19
20
|
description,
|