@wordpress/edit-post 7.10.0 → 7.12.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.
- package/CHANGELOG.md +4 -0
- package/build/components/block-manager/category.js +14 -22
- package/build/components/block-manager/category.js.map +1 -1
- package/build/components/block-manager/checklist.js +6 -13
- package/build/components/block-manager/checklist.js.map +1 -1
- package/build/components/block-manager/index.js +10 -14
- package/build/components/block-manager/index.js.map +1 -1
- package/build/components/block-settings-menu/plugin-block-settings-menu-item.js +21 -26
- package/build/components/block-settings-menu/plugin-block-settings-menu-item.js.map +1 -1
- package/build/components/device-preview/index.js +1 -1
- package/build/components/device-preview/index.js.map +1 -1
- package/build/components/editor-initialization/index.js +3 -4
- package/build/components/editor-initialization/index.js.map +1 -1
- package/build/components/header/document-title/index.js +103 -0
- package/build/components/header/document-title/index.js.map +1 -0
- package/build/components/header/fullscreen-mode-close/index.js +8 -9
- package/build/components/header/fullscreen-mode-close/index.js.map +1 -1
- package/build/components/header/header-toolbar/index.js +4 -3
- package/build/components/header/header-toolbar/index.js.map +1 -1
- package/build/components/header/header-toolbar/index.native.js +12 -13
- package/build/components/header/header-toolbar/index.native.js.map +1 -1
- package/build/components/header/index.js +7 -6
- package/build/components/header/index.js.map +1 -1
- package/build/components/header/main-dashboard-button/index.js +3 -4
- package/build/components/header/main-dashboard-button/index.js.map +1 -1
- package/build/components/header/more-menu/index.js +19 -23
- package/build/components/header/more-menu/index.js.map +1 -1
- package/build/components/header/post-publish-button-or-toggle.js +15 -16
- package/build/components/header/post-publish-button-or-toggle.js.map +1 -1
- package/build/components/header/tools-more-menu-group/index.js +7 -10
- package/build/components/header/tools-more-menu-group/index.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +3 -4
- package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/index.js +44 -54
- package/build/components/keyboard-shortcut-help-modal/index.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/shortcut.js +10 -12
- package/build/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
- package/build/components/layout/actions-panel.js +5 -6
- package/build/components/layout/actions-panel.js.map +1 -1
- package/build/components/layout/index.js +3 -4
- package/build/components/layout/index.js.map +1 -1
- package/build/components/layout/index.native.js +3 -7
- package/build/components/layout/index.native.js.map +1 -1
- package/build/components/meta-boxes/index.js +9 -13
- package/build/components/meta-boxes/index.js.map +1 -1
- package/build/components/meta-boxes/meta-box-visibility.js +5 -8
- package/build/components/meta-boxes/meta-box-visibility.js.map +1 -1
- package/build/components/meta-boxes/meta-boxes-area/index.js +3 -4
- package/build/components/meta-boxes/meta-boxes-area/index.js.map +1 -1
- package/build/components/preferences-modal/meta-boxes-section.js +16 -23
- package/build/components/preferences-modal/meta-boxes-section.js.map +1 -1
- package/build/components/preferences-modal/options/enable-custom-fields.js +7 -9
- package/build/components/preferences-modal/options/enable-custom-fields.js.map +1 -1
- package/build/components/preferences-modal/options/enable-feature.js +12 -16
- package/build/components/preferences-modal/options/enable-feature.js.map +1 -1
- package/build/components/preferences-modal/options/enable-panel.js +10 -17
- package/build/components/preferences-modal/options/enable-panel.js.map +1 -1
- package/build/components/preferences-modal/options/enable-plugin-document-setting-panel.js +7 -10
- package/build/components/preferences-modal/options/enable-plugin-document-setting-panel.js.map +1 -1
- package/build/components/secondary-sidebar/list-view-sidebar.js +58 -44
- package/build/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
- package/build/components/sidebar/discussion-panel/index.js +5 -7
- package/build/components/sidebar/discussion-panel/index.js.map +1 -1
- package/build/components/sidebar/featured-image/index.js +9 -17
- package/build/components/sidebar/featured-image/index.js.map +1 -1
- package/build/components/sidebar/page-attributes/index.js +3 -9
- package/build/components/sidebar/page-attributes/index.js.map +1 -1
- package/build/components/sidebar/plugin-document-setting-panel/index.js +20 -25
- package/build/components/sidebar/plugin-document-setting-panel/index.js.map +1 -1
- package/build/components/sidebar/plugin-post-publish-panel/index.js +12 -15
- package/build/components/sidebar/plugin-post-publish-panel/index.js.map +1 -1
- package/build/components/sidebar/plugin-post-status-info/index.js +6 -9
- package/build/components/sidebar/plugin-post-status-info/index.js.map +1 -1
- package/build/components/sidebar/plugin-pre-publish-panel/index.js +12 -15
- package/build/components/sidebar/plugin-pre-publish-panel/index.js.map +1 -1
- package/build/components/sidebar/plugin-sidebar/index.js +4 -5
- package/build/components/sidebar/plugin-sidebar/index.js.map +1 -1
- package/build/components/sidebar/post-excerpt/index.js +5 -7
- package/build/components/sidebar/post-excerpt/index.js.map +1 -1
- package/build/components/sidebar/post-schedule/index.js +16 -23
- package/build/components/sidebar/post-schedule/index.js.map +1 -1
- package/build/components/sidebar/post-status/index.js +7 -11
- package/build/components/sidebar/post-status/index.js.map +1 -1
- package/build/components/sidebar/post-taxonomies/taxonomy-panel.js +9 -15
- package/build/components/sidebar/post-taxonomies/taxonomy-panel.js.map +1 -1
- package/build/components/sidebar/post-template/create-modal.js +3 -4
- package/build/components/sidebar/post-template/create-modal.js.map +1 -1
- package/build/components/sidebar/post-template/form.js +13 -20
- package/build/components/sidebar/post-template/form.js.map +1 -1
- package/build/components/sidebar/post-template/index.js +18 -25
- package/build/components/sidebar/post-template/index.js.map +1 -1
- package/build/components/sidebar/post-url/index.js +16 -23
- package/build/components/sidebar/post-url/index.js.map +1 -1
- package/build/components/sidebar/post-visibility/index.js +26 -36
- package/build/components/sidebar/post-visibility/index.js.map +1 -1
- package/build/components/sidebar/settings-header/index.js +3 -4
- package/build/components/sidebar/settings-header/index.js.map +1 -1
- package/build/components/sidebar/template-summary/index.js +1 -1
- package/build/components/sidebar/template-summary/index.js.map +1 -1
- package/build/components/start-page-options/index.js +3 -4
- package/build/components/start-page-options/index.js.map +1 -1
- package/build/components/view-link/index.js +1 -1
- package/build/components/view-link/index.js.map +1 -1
- package/build/components/visual-editor/block-inspector-button.js +4 -5
- package/build/components/visual-editor/block-inspector-button.js.map +1 -1
- package/build/components/visual-editor/header.native.js +6 -7
- package/build/components/visual-editor/header.native.js.map +1 -1
- package/build/components/visual-editor/index.js +32 -48
- package/build/components/visual-editor/index.js.map +1 -1
- package/build/components/welcome-guide/image.js +4 -5
- package/build/components/welcome-guide/image.js.map +1 -1
- package/build/editor.js +15 -23
- package/build/editor.js.map +1 -1
- package/build/editor.native.js +3 -6
- package/build/editor.native.js.map +1 -1
- package/build/hooks/validate-multiple-use/index.js +18 -29
- package/build/hooks/validate-multiple-use/index.js.map +1 -1
- package/build/index.js +2 -2
- package/build/index.js.map +1 -1
- package/build/plugins/index.js +20 -23
- package/build/plugins/index.js.map +1 -1
- package/build/plugins/keyboard-shortcuts-help-menu-item/index.js +3 -4
- package/build/plugins/keyboard-shortcuts-help-menu-item/index.js.map +1 -1
- package/build/store/actions.js +60 -88
- package/build/store/actions.js.map +1 -1
- package/build/store/reducer.js +11 -43
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +11 -16
- package/build/store/selectors.js.map +1 -1
- package/build-module/components/block-manager/category.js +14 -22
- package/build-module/components/block-manager/category.js.map +1 -1
- package/build-module/components/block-manager/checklist.js +6 -13
- package/build-module/components/block-manager/checklist.js.map +1 -1
- package/build-module/components/block-manager/index.js +10 -14
- package/build-module/components/block-manager/index.js.map +1 -1
- package/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js +21 -26
- package/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js.map +1 -1
- package/build-module/components/device-preview/index.js +1 -1
- package/build-module/components/device-preview/index.js.map +1 -1
- package/build-module/components/editor-initialization/index.js +3 -4
- package/build-module/components/editor-initialization/index.js.map +1 -1
- package/build-module/components/header/document-title/index.js +88 -0
- package/build-module/components/header/document-title/index.js.map +1 -0
- package/build-module/components/header/fullscreen-mode-close/index.js +7 -8
- package/build-module/components/header/fullscreen-mode-close/index.js.map +1 -1
- package/build-module/components/header/header-toolbar/index.js +3 -3
- package/build-module/components/header/header-toolbar/index.js.map +1 -1
- package/build-module/components/header/header-toolbar/index.native.js +12 -13
- package/build-module/components/header/header-toolbar/index.native.js.map +1 -1
- package/build-module/components/header/index.js +7 -6
- package/build-module/components/header/index.js.map +1 -1
- package/build-module/components/header/main-dashboard-button/index.js +3 -4
- package/build-module/components/header/main-dashboard-button/index.js.map +1 -1
- package/build-module/components/header/more-menu/index.js +19 -23
- package/build-module/components/header/more-menu/index.js.map +1 -1
- package/build-module/components/header/post-publish-button-or-toggle.js +15 -16
- package/build-module/components/header/post-publish-button-or-toggle.js.map +1 -1
- package/build-module/components/header/tools-more-menu-group/index.js +7 -10
- 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 +3 -4
- package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/index.js +42 -52
- package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/shortcut.js +10 -12
- package/build-module/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
- package/build-module/components/layout/actions-panel.js +5 -6
- package/build-module/components/layout/actions-panel.js.map +1 -1
- package/build-module/components/layout/index.js +3 -4
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/layout/index.native.js +3 -7
- package/build-module/components/layout/index.native.js.map +1 -1
- package/build-module/components/meta-boxes/index.js +9 -13
- package/build-module/components/meta-boxes/index.js.map +1 -1
- package/build-module/components/meta-boxes/meta-box-visibility.js +5 -8
- package/build-module/components/meta-boxes/meta-box-visibility.js.map +1 -1
- package/build-module/components/meta-boxes/meta-boxes-area/index.js +3 -4
- package/build-module/components/meta-boxes/meta-boxes-area/index.js.map +1 -1
- package/build-module/components/preferences-modal/meta-boxes-section.js +16 -23
- package/build-module/components/preferences-modal/meta-boxes-section.js.map +1 -1
- package/build-module/components/preferences-modal/options/enable-custom-fields.js +7 -9
- 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 -16
- package/build-module/components/preferences-modal/options/enable-feature.js.map +1 -1
- package/build-module/components/preferences-modal/options/enable-panel.js +10 -17
- 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 +7 -10
- package/build-module/components/preferences-modal/options/enable-plugin-document-setting-panel.js.map +1 -1
- package/build-module/components/secondary-sidebar/list-view-sidebar.js +58 -44
- package/build-module/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
- package/build-module/components/sidebar/discussion-panel/index.js +5 -7
- package/build-module/components/sidebar/discussion-panel/index.js.map +1 -1
- package/build-module/components/sidebar/featured-image/index.js +9 -17
- package/build-module/components/sidebar/featured-image/index.js.map +1 -1
- package/build-module/components/sidebar/page-attributes/index.js +3 -9
- package/build-module/components/sidebar/page-attributes/index.js.map +1 -1
- package/build-module/components/sidebar/plugin-document-setting-panel/index.js +20 -25
- 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 +12 -15
- 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 +6 -9
- 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 +12 -15
- package/build-module/components/sidebar/plugin-pre-publish-panel/index.js.map +1 -1
- package/build-module/components/sidebar/plugin-sidebar/index.js +4 -5
- package/build-module/components/sidebar/plugin-sidebar/index.js.map +1 -1
- package/build-module/components/sidebar/post-excerpt/index.js +5 -7
- package/build-module/components/sidebar/post-excerpt/index.js.map +1 -1
- package/build-module/components/sidebar/post-schedule/index.js +16 -23
- package/build-module/components/sidebar/post-schedule/index.js.map +1 -1
- package/build-module/components/sidebar/post-status/index.js +7 -11
- package/build-module/components/sidebar/post-status/index.js.map +1 -1
- package/build-module/components/sidebar/post-taxonomies/taxonomy-panel.js +9 -15
- package/build-module/components/sidebar/post-taxonomies/taxonomy-panel.js.map +1 -1
- package/build-module/components/sidebar/post-template/create-modal.js +3 -4
- package/build-module/components/sidebar/post-template/create-modal.js.map +1 -1
- package/build-module/components/sidebar/post-template/form.js +13 -20
- package/build-module/components/sidebar/post-template/form.js.map +1 -1
- package/build-module/components/sidebar/post-template/index.js +18 -25
- package/build-module/components/sidebar/post-template/index.js.map +1 -1
- package/build-module/components/sidebar/post-url/index.js +16 -23
- package/build-module/components/sidebar/post-url/index.js.map +1 -1
- package/build-module/components/sidebar/post-visibility/index.js +26 -36
- package/build-module/components/sidebar/post-visibility/index.js.map +1 -1
- package/build-module/components/sidebar/settings-header/index.js +3 -4
- package/build-module/components/sidebar/settings-header/index.js.map +1 -1
- package/build-module/components/sidebar/template-summary/index.js +1 -1
- package/build-module/components/sidebar/template-summary/index.js.map +1 -1
- package/build-module/components/start-page-options/index.js +3 -4
- package/build-module/components/start-page-options/index.js.map +1 -1
- package/build-module/components/view-link/index.js +1 -1
- package/build-module/components/view-link/index.js.map +1 -1
- package/build-module/components/visual-editor/block-inspector-button.js +4 -5
- package/build-module/components/visual-editor/block-inspector-button.js.map +1 -1
- package/build-module/components/visual-editor/header.native.js +6 -7
- package/build-module/components/visual-editor/header.native.js.map +1 -1
- package/build-module/components/visual-editor/index.js +35 -49
- package/build-module/components/visual-editor/index.js.map +1 -1
- package/build-module/components/welcome-guide/image.js +4 -5
- package/build-module/components/welcome-guide/image.js.map +1 -1
- package/build-module/editor.js +15 -23
- package/build-module/editor.js.map +1 -1
- package/build-module/editor.native.js +3 -6
- package/build-module/editor.native.js.map +1 -1
- package/build-module/hooks/validate-multiple-use/index.js +18 -29
- package/build-module/hooks/validate-multiple-use/index.js.map +1 -1
- package/build-module/index.js +2 -2
- package/build-module/index.js.map +1 -1
- package/build-module/plugins/index.js +20 -23
- package/build-module/plugins/index.js.map +1 -1
- package/build-module/plugins/keyboard-shortcuts-help-menu-item/index.js +3 -4
- package/build-module/plugins/keyboard-shortcuts-help-menu-item/index.js.map +1 -1
- package/build-module/store/actions.js +60 -88
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/reducer.js +11 -43
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +11 -16
- package/build-module/store/selectors.js.map +1 -1
- package/build-style/classic-rtl.css +1 -1
- package/build-style/classic.css +1 -1
- package/build-style/style-rtl.css +74 -114
- package/build-style/style.css +74 -114
- package/package.json +33 -33
- package/src/components/header/document-title/index.js +86 -0
- package/src/components/header/document-title/style.scss +61 -0
- package/src/components/header/header-toolbar/index.js +2 -2
- package/src/components/header/header-toolbar/style.scss +0 -1
- package/src/components/header/index.js +4 -2
- package/src/components/header/style.scss +6 -0
- package/src/components/keyboard-shortcut-help-modal/test/__snapshots__/index.js.snap +1 -3
- package/src/components/preferences-modal/test/__snapshots__/index.js.snap +2 -6
- package/src/components/secondary-sidebar/list-view-sidebar.js +68 -66
- package/src/components/secondary-sidebar/style.scss +28 -31
- package/src/components/visual-editor/index.js +10 -21
- package/src/components/visual-editor/style.scss +0 -13
- package/src/editor.js +1 -3
- package/src/index.js +3 -2
- package/src/style.scss +1 -1
- package/build/components/header/template-title/delete-template.js +0 -117
- package/build/components/header/template-title/delete-template.js.map +0 -1
- package/build/components/header/template-title/edit-template-title.js +0 -95
- package/build/components/header/template-title/edit-template-title.js.map +0 -1
- package/build/components/header/template-title/index.js +0 -124
- package/build/components/header/template-title/index.js.map +0 -1
- package/build/components/header/template-title/template-description.js +0 -55
- package/build/components/header/template-title/template-description.js.map +0 -1
- package/build-module/components/header/template-title/delete-template.js +0 -104
- package/build-module/components/header/template-title/delete-template.js.map +0 -1
- package/build-module/components/header/template-title/edit-template-title.js +0 -83
- package/build-module/components/header/template-title/edit-template-title.js.map +0 -1
- package/build-module/components/header/template-title/index.js +0 -105
- package/build-module/components/header/template-title/index.js.map +0 -1
- package/build-module/components/header/template-title/template-description.js +0 -45
- package/build-module/components/header/template-title/template-description.js.map +0 -1
- package/src/components/header/template-title/delete-template.js +0 -106
- package/src/components/header/template-title/edit-template-title.js +0 -78
- package/src/components/header/template-title/index.js +0 -115
- package/src/components/header/template-title/style.scss +0 -94
- package/src/components/header/template-title/template-description.js +0 -42
|
@@ -45,7 +45,7 @@ function PostTemplate() {
|
|
|
45
45
|
const postTypeSlug = select(_editor.store).getCurrentPostType();
|
|
46
46
|
const postType = select(_coreData.store).getPostType(postTypeSlug);
|
|
47
47
|
|
|
48
|
-
if (!
|
|
48
|
+
if (!postType?.viewable) {
|
|
49
49
|
return false;
|
|
50
50
|
}
|
|
51
51
|
|
|
@@ -76,32 +76,25 @@ function PostTemplate() {
|
|
|
76
76
|
className: "edit-post-post-template__dropdown",
|
|
77
77
|
contentClassName: "edit-post-post-template__dialog",
|
|
78
78
|
focusOnMount: true,
|
|
79
|
-
renderToggle:
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
},
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
onClose
|
|
92
|
-
} = _ref2;
|
|
93
|
-
return (0, _element.createElement)(_form.default, {
|
|
94
|
-
onClose: onClose
|
|
95
|
-
});
|
|
96
|
-
}
|
|
79
|
+
renderToggle: ({
|
|
80
|
+
isOpen,
|
|
81
|
+
onToggle
|
|
82
|
+
}) => (0, _element.createElement)(PostTemplateToggle, {
|
|
83
|
+
isOpen: isOpen,
|
|
84
|
+
onClick: onToggle
|
|
85
|
+
}),
|
|
86
|
+
renderContent: ({
|
|
87
|
+
onClose
|
|
88
|
+
}) => (0, _element.createElement)(_form.default, {
|
|
89
|
+
onClose: onClose
|
|
90
|
+
})
|
|
97
91
|
}));
|
|
98
92
|
}
|
|
99
93
|
|
|
100
|
-
function PostTemplateToggle(
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
} = _ref3;
|
|
94
|
+
function PostTemplateToggle({
|
|
95
|
+
isOpen,
|
|
96
|
+
onClick
|
|
97
|
+
}) {
|
|
105
98
|
const templateTitle = (0, _data.useSelect)(select => {
|
|
106
99
|
const templateSlug = select(_editor.store).getEditedPostAttribute('template');
|
|
107
100
|
const {
|
|
@@ -114,7 +107,7 @@ function PostTemplateToggle(_ref3) {
|
|
|
114
107
|
}
|
|
115
108
|
|
|
116
109
|
const template = select(_coreData.store).canUser('create', 'templates') && select(_store.store).getEditedPostTemplate();
|
|
117
|
-
return
|
|
110
|
+
return template?.title || template?.slug || availableTemplates?.[templateSlug];
|
|
118
111
|
}, []);
|
|
119
112
|
return (0, _element.createElement)(_components.Button, {
|
|
120
113
|
className: "edit-post-post-template__toggle",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-post/src/components/sidebar/post-template/index.js"],"names":["PostTemplate","popoverAnchor","setPopoverAnchor","popoverProps","anchor","placement","isVisible","select","postTypeSlug","editorStore","getCurrentPostType","postType","coreStore","getPostType","viewable","settings","getEditorSettings","hasTemplates","availableTemplates","Object","keys","length","supportsTemplateMode","canCreateTemplates","canUser","isOpen","onToggle","onClose","PostTemplateToggle","onClick","templateTitle","templateSlug","getEditedPostAttribute","template","editPostStore","getEditedPostTemplate","title","slug"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AAdA;AACA;AACA;;AAQA;AACA;AACA;AAIe,SAASA,YAAT,GAAwB;AACtC;AACA;AACA,QAAM,CAAEC,aAAF,EAAiBC,gBAAjB,IAAsC,uBAAU,IAAV,CAA5C,CAHsC,CAItC;;AACA,QAAMC,YAAY,GAAG,sBACpB,OAAQ;AAAEC,IAAAA,MAAM,EAAEH,aAAV;AAAyBI,IAAAA,SAAS,EAAE;AAApC,GAAR,CADoB,EAEpB,CAAEJ,aAAF,CAFoB,CAArB;AAKA,QAAMK,SAAS,GAAG,qBAAaC,MAAF,IAAc;AAAA;;AAC1C,UAAMC,YAAY,GAAGD,MAAM,CAAEE,aAAF,CAAN,CAAsBC,kBAAtB,EAArB;AACA,UAAMC,QAAQ,GAAGJ,MAAM,CAAEK,eAAF,CAAN,CAAoBC,WAApB,CAAiCL,YAAjC,CAAjB;;AACA,QAAK,
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-post/src/components/sidebar/post-template/index.js"],"names":["PostTemplate","popoverAnchor","setPopoverAnchor","popoverProps","anchor","placement","isVisible","select","postTypeSlug","editorStore","getCurrentPostType","postType","coreStore","getPostType","viewable","settings","getEditorSettings","hasTemplates","availableTemplates","Object","keys","length","supportsTemplateMode","canCreateTemplates","canUser","isOpen","onToggle","onClose","PostTemplateToggle","onClick","templateTitle","templateSlug","getEditedPostAttribute","template","editPostStore","getEditedPostTemplate","title","slug"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AAdA;AACA;AACA;;AAQA;AACA;AACA;AAIe,SAASA,YAAT,GAAwB;AACtC;AACA;AACA,QAAM,CAAEC,aAAF,EAAiBC,gBAAjB,IAAsC,uBAAU,IAAV,CAA5C,CAHsC,CAItC;;AACA,QAAMC,YAAY,GAAG,sBACpB,OAAQ;AAAEC,IAAAA,MAAM,EAAEH,aAAV;AAAyBI,IAAAA,SAAS,EAAE;AAApC,GAAR,CADoB,EAEpB,CAAEJ,aAAF,CAFoB,CAArB;AAKA,QAAMK,SAAS,GAAG,qBAAaC,MAAF,IAAc;AAAA;;AAC1C,UAAMC,YAAY,GAAGD,MAAM,CAAEE,aAAF,CAAN,CAAsBC,kBAAtB,EAArB;AACA,UAAMC,QAAQ,GAAGJ,MAAM,CAAEK,eAAF,CAAN,CAAoBC,WAApB,CAAiCL,YAAjC,CAAjB;;AACA,QAAK,CAAEG,QAAQ,EAAEG,QAAjB,EAA4B;AAC3B,aAAO,KAAP;AACA;;AAED,UAAMC,QAAQ,GAAGR,MAAM,CAAEE,aAAF,CAAN,CAAsBO,iBAAtB,EAAjB;AACA,UAAMC,YAAY,GACjB,CAAC,CAAEF,QAAQ,CAACG,kBAAZ,IACAC,MAAM,CAACC,IAAP,CAAaL,QAAQ,CAACG,kBAAtB,EAA2CG,MAA3C,GAAoD,CAFrD;;AAGA,QAAKJ,YAAL,EAAoB;AACnB,aAAO,IAAP;AACA;;AAED,QAAK,CAAEF,QAAQ,CAACO,oBAAhB,EAAuC;AACtC,aAAO,KAAP;AACA;;AAED,UAAMC,kBAAkB,sBACvBhB,MAAM,CAAEK,eAAF,CAAN,CAAoBY,OAApB,CAA6B,QAA7B,EAAuC,WAAvC,CADuB,6DACiC,KADzD;AAEA,WAAOD,kBAAP;AACA,GAtBiB,EAsBf,EAtBe,CAAlB;;AAwBA,MAAK,CAAEjB,SAAP,EAAmB;AAClB,WAAO,IAAP;AACA;;AAED,SACC,4BAAC,oBAAD;AAAU,IAAA,SAAS,EAAC,yBAApB;AAA8C,IAAA,GAAG,EAAGJ;AAApD,KACC,0CAAQ,cAAI,UAAJ,CAAR,CADD,EAEC,4BAAC,oBAAD;AACC,IAAA,YAAY,EAAGC,YADhB;AAEC,IAAA,SAAS,EAAC,mCAFX;AAGC,IAAA,gBAAgB,EAAC,iCAHlB;AAIC,IAAA,YAAY,MAJb;AAKC,IAAA,YAAY,EAAG,CAAE;AAAEsB,MAAAA,MAAF;AAAUC,MAAAA;AAAV,KAAF,KACd,4BAAC,kBAAD;AACC,MAAA,MAAM,EAAGD,MADV;AAEC,MAAA,OAAO,EAAGC;AAFX,MANF;AAWC,IAAA,aAAa,EAAG,CAAE;AAAEC,MAAAA;AAAF,KAAF,KACf,4BAAC,aAAD;AAAkB,MAAA,OAAO,EAAGA;AAA5B;AAZF,IAFD,CADD;AAoBA;;AAED,SAASC,kBAAT,CAA6B;AAAEH,EAAAA,MAAF;AAAUI,EAAAA;AAAV,CAA7B,EAAmD;AAClD,QAAMC,aAAa,GAAG,qBAAavB,MAAF,IAAc;AAC9C,UAAMwB,YAAY,GACjBxB,MAAM,CAAEE,aAAF,CAAN,CAAsBuB,sBAAtB,CAA8C,UAA9C,CADD;AAGA,UAAM;AAAEV,MAAAA,oBAAF;AAAwBJ,MAAAA;AAAxB,QACLX,MAAM,CAAEE,aAAF,CAAN,CAAsBO,iBAAtB,EADD;;AAEA,QAAK,CAAEM,oBAAF,IAA0BJ,kBAAkB,CAAEa,YAAF,CAAjD,EAAoE;AACnE,aAAOb,kBAAkB,CAAEa,YAAF,CAAzB;AACA;;AACD,UAAME,QAAQ,GACb1B,MAAM,CAAEK,eAAF,CAAN,CAAoBY,OAApB,CAA6B,QAA7B,EAAuC,WAAvC,KACAjB,MAAM,CAAE2B,YAAF,CAAN,CAAwBC,qBAAxB,EAFD;AAGA,WACCF,QAAQ,EAAEG,KAAV,IACAH,QAAQ,EAAEI,IADV,IAEAnB,kBAAkB,GAAIa,YAAJ,CAHnB;AAKA,GAjBqB,EAiBnB,EAjBmB,CAAtB;AAmBA,SACC,4BAAC,kBAAD;AACC,IAAA,SAAS,EAAC,iCADX;AAEC,IAAA,OAAO,EAAC,UAFT;AAGC,qBAAgBN,MAHjB;AAIC,kBACCK,aAAa,GACV,oBACA;AACA,kBAAI,qBAAJ,CAFA,EAGAA,aAHA,CADU,GAMV,cAAI,iBAAJ,CAXL;AAaC,IAAA,OAAO,EAAGD;AAbX,KAeGC,aAfH,aAeGA,aAfH,cAeGA,aAfH,GAeoB,cAAI,kBAAJ,CAfpB,CADD;AAmBA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useState, useMemo } from '@wordpress/element';\nimport { PanelRow, Dropdown, Button } from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { store as editorStore } from '@wordpress/editor';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport PostTemplateForm from './form';\nimport { store as editPostStore } from '../../../store';\n\nexport default function PostTemplate() {\n\t// Use internal state instead of a ref to make sure that the component\n\t// re-renders when the popover's anchor updates.\n\tconst [ popoverAnchor, setPopoverAnchor ] = useState( null );\n\t// Memoize popoverProps to avoid returning a new object every time.\n\tconst popoverProps = useMemo(\n\t\t() => ( { anchor: popoverAnchor, placement: 'bottom-end' } ),\n\t\t[ popoverAnchor ]\n\t);\n\n\tconst isVisible = useSelect( ( select ) => {\n\t\tconst postTypeSlug = select( editorStore ).getCurrentPostType();\n\t\tconst postType = select( coreStore ).getPostType( postTypeSlug );\n\t\tif ( ! postType?.viewable ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst settings = select( editorStore ).getEditorSettings();\n\t\tconst hasTemplates =\n\t\t\t!! settings.availableTemplates &&\n\t\t\tObject.keys( settings.availableTemplates ).length > 0;\n\t\tif ( hasTemplates ) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif ( ! settings.supportsTemplateMode ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst canCreateTemplates =\n\t\t\tselect( coreStore ).canUser( 'create', 'templates' ) ?? false;\n\t\treturn canCreateTemplates;\n\t}, [] );\n\n\tif ( ! isVisible ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PanelRow className=\"edit-post-post-template\" ref={ setPopoverAnchor }>\n\t\t\t<span>{ __( 'Template' ) }</span>\n\t\t\t<Dropdown\n\t\t\t\tpopoverProps={ popoverProps }\n\t\t\t\tclassName=\"edit-post-post-template__dropdown\"\n\t\t\t\tcontentClassName=\"edit-post-post-template__dialog\"\n\t\t\t\tfocusOnMount\n\t\t\t\trenderToggle={ ( { isOpen, onToggle } ) => (\n\t\t\t\t\t<PostTemplateToggle\n\t\t\t\t\t\tisOpen={ isOpen }\n\t\t\t\t\t\tonClick={ onToggle }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\trenderContent={ ( { onClose } ) => (\n\t\t\t\t\t<PostTemplateForm onClose={ onClose } />\n\t\t\t\t) }\n\t\t\t/>\n\t\t</PanelRow>\n\t);\n}\n\nfunction PostTemplateToggle( { isOpen, onClick } ) {\n\tconst templateTitle = useSelect( ( select ) => {\n\t\tconst templateSlug =\n\t\t\tselect( editorStore ).getEditedPostAttribute( 'template' );\n\n\t\tconst { supportsTemplateMode, availableTemplates } =\n\t\t\tselect( editorStore ).getEditorSettings();\n\t\tif ( ! supportsTemplateMode && availableTemplates[ templateSlug ] ) {\n\t\t\treturn availableTemplates[ templateSlug ];\n\t\t}\n\t\tconst template =\n\t\t\tselect( coreStore ).canUser( 'create', 'templates' ) &&\n\t\t\tselect( editPostStore ).getEditedPostTemplate();\n\t\treturn (\n\t\t\ttemplate?.title ||\n\t\t\ttemplate?.slug ||\n\t\t\tavailableTemplates?.[ templateSlug ]\n\t\t);\n\t}, [] );\n\n\treturn (\n\t\t<Button\n\t\t\tclassName=\"edit-post-post-template__toggle\"\n\t\t\tvariant=\"tertiary\"\n\t\t\taria-expanded={ isOpen }\n\t\t\taria-label={\n\t\t\t\ttemplateTitle\n\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t// translators: %s: Name of the currently selected template.\n\t\t\t\t\t\t\t__( 'Select template: %s' ),\n\t\t\t\t\t\t\ttemplateTitle\n\t\t\t\t\t )\n\t\t\t\t\t: __( 'Select template' )\n\t\t\t}\n\t\t\tonClick={ onClick }\n\t\t>\n\t\t\t{ templateTitle ?? __( 'Default template' ) }\n\t\t</Button>\n\t);\n}\n"]}
|
|
@@ -33,32 +33,25 @@ function PostURL() {
|
|
|
33
33
|
className: "edit-post-post-url__dropdown",
|
|
34
34
|
contentClassName: "edit-post-post-url__dialog",
|
|
35
35
|
focusOnMount: true,
|
|
36
|
-
renderToggle:
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
},
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
onClose
|
|
49
|
-
} = _ref2;
|
|
50
|
-
return (0, _element.createElement)(_editor.PostURL, {
|
|
51
|
-
onClose: onClose
|
|
52
|
-
});
|
|
53
|
-
}
|
|
36
|
+
renderToggle: ({
|
|
37
|
+
isOpen,
|
|
38
|
+
onToggle
|
|
39
|
+
}) => (0, _element.createElement)(PostURLToggle, {
|
|
40
|
+
isOpen: isOpen,
|
|
41
|
+
onClick: onToggle
|
|
42
|
+
}),
|
|
43
|
+
renderContent: ({
|
|
44
|
+
onClose
|
|
45
|
+
}) => (0, _element.createElement)(_editor.PostURL, {
|
|
46
|
+
onClose: onClose
|
|
47
|
+
})
|
|
54
48
|
})));
|
|
55
49
|
}
|
|
56
50
|
|
|
57
|
-
function PostURLToggle(
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
} = _ref3;
|
|
51
|
+
function PostURLToggle({
|
|
52
|
+
isOpen,
|
|
53
|
+
onClick
|
|
54
|
+
}) {
|
|
62
55
|
const label = (0, _editor.usePostURLLabel)();
|
|
63
56
|
return (0, _element.createElement)(_components.Button, {
|
|
64
57
|
className: "edit-post-post-url__toggle",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-post/src/components/sidebar/post-url/index.js"],"names":["PostURL","popoverAnchor","setPopoverAnchor","popoverProps","anchor","placement","isOpen","onToggle","onClose","PostURLToggle","onClick","label"],"mappings":";;;;;;;AAGA;;AACA;;AACA;;AACA;;AANA;AACA;AACA;AAUe,SAASA,OAAT,GAAmB;AACjC;AACA;AACA,QAAM,CAAEC,aAAF,EAAiBC,gBAAjB,IAAsC,uBAAU,IAAV,CAA5C,CAHiC,CAIjC;;AACA,QAAMC,YAAY,GAAG,sBACpB,OAAQ;AAAEC,IAAAA,MAAM,EAAEH,aAAV;AAAyBI,IAAAA,SAAS,EAAE;AAApC,GAAR,CADoB,EAEpB,CAAEJ,aAAF,CAFoB,CAArB;AAKA,SACC,4BAAC,oBAAD,QACC,4BAAC,oBAAD;AAAU,IAAA,SAAS,EAAC,oBAApB;AAAyC,IAAA,GAAG,EAAGC;AAA/C,KACC,0CAAQ,cAAI,KAAJ,CAAR,CADD,EAEC,4BAAC,oBAAD;AACC,IAAA,YAAY,EAAGC,YADhB;AAEC,IAAA,SAAS,EAAC,8BAFX;AAGC,IAAA,gBAAgB,EAAC,4BAHlB;AAIC,IAAA,YAAY,MAJb;AAKC,IAAA,YAAY,EAAG
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-post/src/components/sidebar/post-url/index.js"],"names":["PostURL","popoverAnchor","setPopoverAnchor","popoverProps","anchor","placement","isOpen","onToggle","onClose","PostURLToggle","onClick","label"],"mappings":";;;;;;;AAGA;;AACA;;AACA;;AACA;;AANA;AACA;AACA;AAUe,SAASA,OAAT,GAAmB;AACjC;AACA;AACA,QAAM,CAAEC,aAAF,EAAiBC,gBAAjB,IAAsC,uBAAU,IAAV,CAA5C,CAHiC,CAIjC;;AACA,QAAMC,YAAY,GAAG,sBACpB,OAAQ;AAAEC,IAAAA,MAAM,EAAEH,aAAV;AAAyBI,IAAAA,SAAS,EAAE;AAApC,GAAR,CADoB,EAEpB,CAAEJ,aAAF,CAFoB,CAArB;AAKA,SACC,4BAAC,oBAAD,QACC,4BAAC,oBAAD;AAAU,IAAA,SAAS,EAAC,oBAApB;AAAyC,IAAA,GAAG,EAAGC;AAA/C,KACC,0CAAQ,cAAI,KAAJ,CAAR,CADD,EAEC,4BAAC,oBAAD;AACC,IAAA,YAAY,EAAGC,YADhB;AAEC,IAAA,SAAS,EAAC,8BAFX;AAGC,IAAA,gBAAgB,EAAC,4BAHlB;AAIC,IAAA,YAAY,MAJb;AAKC,IAAA,YAAY,EAAG,CAAE;AAAEG,MAAAA,MAAF;AAAUC,MAAAA;AAAV,KAAF,KACd,4BAAC,aAAD;AAAe,MAAA,MAAM,EAAGD,MAAxB;AAAiC,MAAA,OAAO,EAAGC;AAA3C,MANF;AAQC,IAAA,aAAa,EAAG,CAAE;AAAEC,MAAAA;AAAF,KAAF,KACf,4BAAC,eAAD;AAAa,MAAA,OAAO,EAAGA;AAAvB;AATF,IAFD,CADD,CADD;AAmBA;;AAED,SAASC,aAAT,CAAwB;AAAEH,EAAAA,MAAF;AAAUI,EAAAA;AAAV,CAAxB,EAA8C;AAC7C,QAAMC,KAAK,GAAG,8BAAd;AACA,SACC,4BAAC,kBAAD;AACC,IAAA,SAAS,EAAC,4BADX;AAEC,IAAA,OAAO,EAAC,UAFT;AAGC,qBAAgBL,MAHjB,CAIC;AAJD;AAKC,kBAAa,mBAAS,cAAI,gBAAJ,CAAT,EAAiCK,KAAjC,CALd;AAMC,IAAA,OAAO,EAAGD;AANX,KAQGC,KARH,CADD;AAYA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo, useState } from '@wordpress/element';\nimport { PanelRow, Dropdown, Button } from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\nimport {\n\tPostURLCheck,\n\tPostURL as PostURLForm,\n\tusePostURLLabel,\n} from '@wordpress/editor';\n\nexport default function PostURL() {\n\t// Use internal state instead of a ref to make sure that the component\n\t// re-renders when the popover's anchor updates.\n\tconst [ popoverAnchor, setPopoverAnchor ] = useState( null );\n\t// Memoize popoverProps to avoid returning a new object every time.\n\tconst popoverProps = useMemo(\n\t\t() => ( { anchor: popoverAnchor, placement: 'bottom-end' } ),\n\t\t[ popoverAnchor ]\n\t);\n\n\treturn (\n\t\t<PostURLCheck>\n\t\t\t<PanelRow className=\"edit-post-post-url\" ref={ setPopoverAnchor }>\n\t\t\t\t<span>{ __( 'URL' ) }</span>\n\t\t\t\t<Dropdown\n\t\t\t\t\tpopoverProps={ popoverProps }\n\t\t\t\t\tclassName=\"edit-post-post-url__dropdown\"\n\t\t\t\t\tcontentClassName=\"edit-post-post-url__dialog\"\n\t\t\t\t\tfocusOnMount\n\t\t\t\t\trenderToggle={ ( { isOpen, onToggle } ) => (\n\t\t\t\t\t\t<PostURLToggle isOpen={ isOpen } onClick={ onToggle } />\n\t\t\t\t\t) }\n\t\t\t\t\trenderContent={ ( { onClose } ) => (\n\t\t\t\t\t\t<PostURLForm onClose={ onClose } />\n\t\t\t\t\t) }\n\t\t\t\t/>\n\t\t\t</PanelRow>\n\t\t</PostURLCheck>\n\t);\n}\n\nfunction PostURLToggle( { isOpen, onClick } ) {\n\tconst label = usePostURLLabel();\n\treturn (\n\t\t<Button\n\t\t\tclassName=\"edit-post-post-url__toggle\"\n\t\t\tvariant=\"tertiary\"\n\t\t\taria-expanded={ isOpen }\n\t\t\t// translators: %s: Current post URL.\n\t\t\taria-label={ sprintf( __( 'Change URL: %s' ), label ) }\n\t\t\tonClick={ onClick }\n\t\t>\n\t\t\t{ label }\n\t\t</Button>\n\t);\n}\n"]}
|
|
@@ -29,45 +29,35 @@ function PostVisibility() {
|
|
|
29
29
|
placement: 'bottom-end'
|
|
30
30
|
}), [popoverAnchor]);
|
|
31
31
|
return (0, _element.createElement)(_editor.PostVisibilityCheck, {
|
|
32
|
-
render:
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
let {
|
|
55
|
-
onClose
|
|
56
|
-
} = _ref3;
|
|
57
|
-
return (0, _element.createElement)(_editor.PostVisibility, {
|
|
58
|
-
onClose: onClose
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
}));
|
|
62
|
-
}
|
|
32
|
+
render: ({
|
|
33
|
+
canEdit
|
|
34
|
+
}) => (0, _element.createElement)(_components.PanelRow, {
|
|
35
|
+
ref: setPopoverAnchor,
|
|
36
|
+
className: "edit-post-post-visibility"
|
|
37
|
+
}, (0, _element.createElement)("span", null, (0, _i18n.__)('Visibility')), !canEdit && (0, _element.createElement)("span", null, (0, _element.createElement)(_editor.PostVisibilityLabel, null)), canEdit && (0, _element.createElement)(_components.Dropdown, {
|
|
38
|
+
contentClassName: "edit-post-post-visibility__dialog",
|
|
39
|
+
popoverProps: popoverProps,
|
|
40
|
+
focusOnMount: true,
|
|
41
|
+
renderToggle: ({
|
|
42
|
+
isOpen,
|
|
43
|
+
onToggle
|
|
44
|
+
}) => (0, _element.createElement)(PostVisibilityToggle, {
|
|
45
|
+
isOpen: isOpen,
|
|
46
|
+
onClick: onToggle
|
|
47
|
+
}),
|
|
48
|
+
renderContent: ({
|
|
49
|
+
onClose
|
|
50
|
+
}) => (0, _element.createElement)(_editor.PostVisibility, {
|
|
51
|
+
onClose: onClose
|
|
52
|
+
})
|
|
53
|
+
}))
|
|
63
54
|
});
|
|
64
55
|
}
|
|
65
56
|
|
|
66
|
-
function PostVisibilityToggle(
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
} = _ref4;
|
|
57
|
+
function PostVisibilityToggle({
|
|
58
|
+
isOpen,
|
|
59
|
+
onClick
|
|
60
|
+
}) {
|
|
71
61
|
const label = (0, _editor.usePostVisibilityLabel)();
|
|
72
62
|
return (0, _element.createElement)(_components.Button, {
|
|
73
63
|
className: "edit-post-post-visibility__toggle",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-post/src/components/sidebar/post-visibility/index.js"],"names":["PostVisibility","popoverAnchor","setPopoverAnchor","popoverProps","anchor","placement","canEdit","isOpen","onToggle","onClose","PostVisibilityToggle","onClick","label"],"mappings":";;;;;;;;AAWA;;AARA;;AACA;;AACA;;AALA;AACA;AACA;AAWO,SAASA,cAAT,GAA0B;AAChC;AACA;AACA,QAAM,CAAEC,aAAF,EAAiBC,gBAAjB,IAAsC,uBAAU,IAAV,CAA5C,CAHgC,CAIhC;;AACA,QAAMC,YAAY,GAAG,sBACpB,OAAQ;AACP;AACA;AACAC,IAAAA,MAAM,EAAEH,aAHD;AAIPI,IAAAA,SAAS,EAAE;AAJJ,GAAR,CADoB,EAOpB,CAAEJ,aAAF,CAPoB,CAArB;AAUA,SACC,4BAAC,2BAAD;AACC,IAAA,MAAM,EAAG
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-post/src/components/sidebar/post-visibility/index.js"],"names":["PostVisibility","popoverAnchor","setPopoverAnchor","popoverProps","anchor","placement","canEdit","isOpen","onToggle","onClose","PostVisibilityToggle","onClick","label"],"mappings":";;;;;;;;AAWA;;AARA;;AACA;;AACA;;AALA;AACA;AACA;AAWO,SAASA,cAAT,GAA0B;AAChC;AACA;AACA,QAAM,CAAEC,aAAF,EAAiBC,gBAAjB,IAAsC,uBAAU,IAAV,CAA5C,CAHgC,CAIhC;;AACA,QAAMC,YAAY,GAAG,sBACpB,OAAQ;AACP;AACA;AACAC,IAAAA,MAAM,EAAEH,aAHD;AAIPI,IAAAA,SAAS,EAAE;AAJJ,GAAR,CADoB,EAOpB,CAAEJ,aAAF,CAPoB,CAArB;AAUA,SACC,4BAAC,2BAAD;AACC,IAAA,MAAM,EAAG,CAAE;AAAEK,MAAAA;AAAF,KAAF,KACR,4BAAC,oBAAD;AACC,MAAA,GAAG,EAAGJ,gBADP;AAEC,MAAA,SAAS,EAAC;AAFX,OAIC,0CAAQ,cAAI,YAAJ,CAAR,CAJD,EAKG,CAAEI,OAAF,IACD,0CACC,4BAAC,2BAAD,OADD,CANF,EAUGA,OAAO,IACR,4BAAC,oBAAD;AACC,MAAA,gBAAgB,EAAC,mCADlB;AAEC,MAAA,YAAY,EAAGH,YAFhB;AAGC,MAAA,YAAY,MAHb;AAIC,MAAA,YAAY,EAAG,CAAE;AAAEI,QAAAA,MAAF;AAAUC,QAAAA;AAAV,OAAF,KACd,4BAAC,oBAAD;AACC,QAAA,MAAM,EAAGD,MADV;AAEC,QAAA,OAAO,EAAGC;AAFX,QALF;AAUC,MAAA,aAAa,EAAG,CAAE;AAAEC,QAAAA;AAAF,OAAF,KACf,4BAAC,sBAAD;AAAoB,QAAA,OAAO,EAAGA;AAA9B;AAXF,MAXF;AAFF,IADD;AAiCA;;AAED,SAASC,oBAAT,CAA+B;AAAEH,EAAAA,MAAF;AAAUI,EAAAA;AAAV,CAA/B,EAAqD;AACpD,QAAMC,KAAK,GAAG,qCAAd;AACA,SACC,4BAAC,kBAAD;AACC,IAAA,SAAS,EAAC,mCADX;AAEC,IAAA,OAAO,EAAC,UAFT;AAGC,qBAAgBL,MAHjB,CAIC;AAJD;AAKC,kBAAa,mBAAS,cAAI,uBAAJ,CAAT,EAAwCK,KAAxC,CALd;AAMC,IAAA,OAAO,EAAGD;AANX,KAQGC,KARH,CADD;AAYA;;eAEcZ,c","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { PanelRow, Dropdown, Button } from '@wordpress/components';\nimport {\n\tPostVisibility as PostVisibilityForm,\n\tPostVisibilityLabel,\n\tPostVisibilityCheck,\n\tusePostVisibilityLabel,\n} from '@wordpress/editor';\nimport { useMemo, useState } from '@wordpress/element';\n\nexport function PostVisibility() {\n\t// Use internal state instead of a ref to make sure that the component\n\t// re-renders when the popover's anchor updates.\n\tconst [ popoverAnchor, setPopoverAnchor ] = useState( null );\n\t// Memoize popoverProps to avoid returning a new object every time.\n\tconst popoverProps = useMemo(\n\t\t() => ( {\n\t\t\t// Anchor the popover to the middle of the entire row so that it doesn't\n\t\t\t// move around when the label changes.\n\t\t\tanchor: popoverAnchor,\n\t\t\tplacement: 'bottom-end',\n\t\t} ),\n\t\t[ popoverAnchor ]\n\t);\n\n\treturn (\n\t\t<PostVisibilityCheck\n\t\t\trender={ ( { canEdit } ) => (\n\t\t\t\t<PanelRow\n\t\t\t\t\tref={ setPopoverAnchor }\n\t\t\t\t\tclassName=\"edit-post-post-visibility\"\n\t\t\t\t>\n\t\t\t\t\t<span>{ __( 'Visibility' ) }</span>\n\t\t\t\t\t{ ! canEdit && (\n\t\t\t\t\t\t<span>\n\t\t\t\t\t\t\t<PostVisibilityLabel />\n\t\t\t\t\t\t</span>\n\t\t\t\t\t) }\n\t\t\t\t\t{ canEdit && (\n\t\t\t\t\t\t<Dropdown\n\t\t\t\t\t\t\tcontentClassName=\"edit-post-post-visibility__dialog\"\n\t\t\t\t\t\t\tpopoverProps={ popoverProps }\n\t\t\t\t\t\t\tfocusOnMount\n\t\t\t\t\t\t\trenderToggle={ ( { isOpen, onToggle } ) => (\n\t\t\t\t\t\t\t\t<PostVisibilityToggle\n\t\t\t\t\t\t\t\t\tisOpen={ isOpen }\n\t\t\t\t\t\t\t\t\tonClick={ onToggle }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\trenderContent={ ( { onClose } ) => (\n\t\t\t\t\t\t\t\t<PostVisibilityForm onClose={ onClose } />\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</PanelRow>\n\t\t\t) }\n\t\t/>\n\t);\n}\n\nfunction PostVisibilityToggle( { isOpen, onClick } ) {\n\tconst label = usePostVisibilityLabel();\n\treturn (\n\t\t<Button\n\t\t\tclassName=\"edit-post-post-visibility__toggle\"\n\t\t\tvariant=\"tertiary\"\n\t\t\taria-expanded={ isOpen }\n\t\t\t// translators: %s: Current post visibility.\n\t\t\taria-label={ sprintf( __( 'Select visibility: %s' ), label ) }\n\t\t\tonClick={ onClick }\n\t\t>\n\t\t\t{ label }\n\t\t</Button>\n\t);\n}\n\nexport default PostVisibility;\n"]}
|
|
@@ -24,10 +24,9 @@ var _store = require("../../../store");
|
|
|
24
24
|
/**
|
|
25
25
|
* Internal dependencies
|
|
26
26
|
*/
|
|
27
|
-
const SettingsHeader =
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
} = _ref;
|
|
27
|
+
const SettingsHeader = ({
|
|
28
|
+
sidebarName
|
|
29
|
+
}) => {
|
|
31
30
|
const {
|
|
32
31
|
openGeneralSidebar
|
|
33
32
|
} = (0, _data.useDispatch)(_store.store);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-post/src/components/sidebar/settings-header/index.js"],"names":["SettingsHeader","sidebarName","openGeneralSidebar","editPostStore","openDocumentSettings","openBlockSettings","documentLabel","isTemplateMode","select","postTypeLabel","editorStore","getPostTypeLabel","isEditingTemplate","documentAriaLabel","documentActiveClass","blockAriaLabel","blockActiveClass","templateAriaLabel","templateActiveClass"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AAKA;;AAXA;AACA;AACA;;AAMA;AACA;AACA;AAGA,MAAMA,cAAc,GAAG,
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-post/src/components/sidebar/settings-header/index.js"],"names":["SettingsHeader","sidebarName","openGeneralSidebar","editPostStore","openDocumentSettings","openBlockSettings","documentLabel","isTemplateMode","select","postTypeLabel","editorStore","getPostTypeLabel","isEditingTemplate","documentAriaLabel","documentActiveClass","blockAriaLabel","blockActiveClass","templateAriaLabel","templateActiveClass"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AAKA;;AAXA;AACA;AACA;;AAMA;AACA;AACA;AAGA,MAAMA,cAAc,GAAG,CAAE;AAAEC,EAAAA;AAAF,CAAF,KAAuB;AAC7C,QAAM;AAAEC,IAAAA;AAAF,MAAyB,uBAAaC,YAAb,CAA/B;;AACA,QAAMC,oBAAoB,GAAG,MAC5BF,kBAAkB,CAAE,oBAAF,CADnB;;AAEA,QAAMG,iBAAiB,GAAG,MAAMH,kBAAkB,CAAE,iBAAF,CAAlD;;AAEA,QAAM;AAAEI,IAAAA,aAAF;AAAiBC,IAAAA;AAAjB,MAAoC,qBAAaC,MAAF,IAAc;AAClE,UAAMC,aAAa,GAAGD,MAAM,CAAEE,aAAF,CAAN,CAAsBC,gBAAtB,EAAtB;AAEA,WAAO;AACN;AACAL,MAAAA,aAAa,EAAEG,aAAa,IAAI,cAAI,UAAJ,EAAgB,MAAhB,CAF1B;AAGNF,MAAAA,cAAc,EAAEC,MAAM,CAAEL,YAAF,CAAN,CAAwBS,iBAAxB;AAHV,KAAP;AAKA,GARyC,EAQvC,EARuC,CAA1C;AAUA,QAAM,CAAEC,iBAAF,EAAqBC,mBAArB,IACLb,WAAW,KAAK,oBAAhB,GACG;AACA,GAAE,mBAAS,cAAI,eAAJ,CAAT,EAAgCK,aAAhC,CAAF,EAAmD,WAAnD,CAFH,GAGG,CAAEA,aAAF,EAAiB,EAAjB,CAJJ;AAMA,QAAM,CAAES,cAAF,EAAkBC,gBAAlB,IACLf,WAAW,KAAK,iBAAhB,GACG;AACA,GAAE,cAAI,kBAAJ,CAAF,EAA4B,WAA5B,CAFH,GAGG;AACA,GAAE,cAAI,OAAJ,CAAF,EAAiB,EAAjB,CALJ;AAOA,QAAM,CAAEgB,iBAAF,EAAqBC,mBAArB,IACLjB,WAAW,KAAK,oBAAhB,GACG,CAAE,cAAI,qBAAJ,CAAF,EAA+B,WAA/B,CADH,GAEG,CAAE,cAAI,UAAJ,CAAF,EAAoB,EAApB,CAHJ;AAKA;;AACA,SACC,wCACG,CAAEM,cAAF,IACD,wCACC,4BAAC,kBAAD;AACC,IAAA,OAAO,EAAGH,oBADX;AAEC,IAAA,SAAS,EAAI,gCAAgCU,mBAAqB,EAFnE;AAGC,kBAAaD,iBAHd;AAIC,kBAAaP;AAJd,KAMGA,aANH,CADD,CAFF,EAaGC,cAAc,IACf,wCACC,4BAAC,kBAAD;AACC,IAAA,OAAO,EAAGH,oBADX;AAEC,IAAA,SAAS,EAAI,gCAAgCc,mBAAqB,EAFnE;AAGC,kBAAaD,iBAHd;AAIC,kBAAa,cAAI,UAAJ;AAJd,KAMG,cAAI,UAAJ,CANH,CADD,CAdF,EAyBC,wCACC,4BAAC,kBAAD;AACC,IAAA,OAAO,EAAGZ,iBADX;AAEC,IAAA,SAAS,EAAI,gCAAgCW,gBAAkB,EAFhE;AAGC,kBAAaD,cAHd,CAIC;AAJD;AAKC,kBAAa,cAAI,OAAJ;AALd,KAQE;AACA,gBAAI,OAAJ,CATF,CADD,CAzBD,CADD;AA0CA,CA7ED;;eA+Eef,c","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Button } from '@wordpress/components';\nimport { __, _x, sprintf } from '@wordpress/i18n';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../../store';\n\nconst SettingsHeader = ( { sidebarName } ) => {\n\tconst { openGeneralSidebar } = useDispatch( editPostStore );\n\tconst openDocumentSettings = () =>\n\t\topenGeneralSidebar( 'edit-post/document' );\n\tconst openBlockSettings = () => openGeneralSidebar( 'edit-post/block' );\n\n\tconst { documentLabel, isTemplateMode } = useSelect( ( select ) => {\n\t\tconst postTypeLabel = select( editorStore ).getPostTypeLabel();\n\n\t\treturn {\n\t\t\t// translators: Default label for the Document sidebar tab, not selected.\n\t\t\tdocumentLabel: postTypeLabel || _x( 'Document', 'noun' ),\n\t\t\tisTemplateMode: select( editPostStore ).isEditingTemplate(),\n\t\t};\n\t}, [] );\n\n\tconst [ documentAriaLabel, documentActiveClass ] =\n\t\tsidebarName === 'edit-post/document'\n\t\t\t? // translators: ARIA label for the Document sidebar tab, selected. %s: Document label.\n\t\t\t [ sprintf( __( '%s (selected)' ), documentLabel ), 'is-active' ]\n\t\t\t: [ documentLabel, '' ];\n\n\tconst [ blockAriaLabel, blockActiveClass ] =\n\t\tsidebarName === 'edit-post/block'\n\t\t\t? // translators: ARIA label for the Block Settings Sidebar tab, selected.\n\t\t\t [ __( 'Block (selected)' ), 'is-active' ]\n\t\t\t: // translators: ARIA label for the Block Settings Sidebar tab, not selected.\n\t\t\t [ __( 'Block' ), '' ];\n\n\tconst [ templateAriaLabel, templateActiveClass ] =\n\t\tsidebarName === 'edit-post/document'\n\t\t\t? [ __( 'Template (selected)' ), 'is-active' ]\n\t\t\t: [ __( 'Template' ), '' ];\n\n\t/* Use a list so screen readers will announce how many tabs there are. */\n\treturn (\n\t\t<ul>\n\t\t\t{ ! isTemplateMode && (\n\t\t\t\t<li>\n\t\t\t\t\t<Button\n\t\t\t\t\t\tonClick={ openDocumentSettings }\n\t\t\t\t\t\tclassName={ `edit-post-sidebar__panel-tab ${ documentActiveClass }` }\n\t\t\t\t\t\taria-label={ documentAriaLabel }\n\t\t\t\t\t\tdata-label={ documentLabel }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ documentLabel }\n\t\t\t\t\t</Button>\n\t\t\t\t</li>\n\t\t\t) }\n\t\t\t{ isTemplateMode && (\n\t\t\t\t<li>\n\t\t\t\t\t<Button\n\t\t\t\t\t\tonClick={ openDocumentSettings }\n\t\t\t\t\t\tclassName={ `edit-post-sidebar__panel-tab ${ templateActiveClass }` }\n\t\t\t\t\t\taria-label={ templateAriaLabel }\n\t\t\t\t\t\tdata-label={ __( 'Template' ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Template' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t</li>\n\t\t\t) }\n\t\t\t<li>\n\t\t\t\t<Button\n\t\t\t\t\tonClick={ openBlockSettings }\n\t\t\t\t\tclassName={ `edit-post-sidebar__panel-tab ${ blockActiveClass }` }\n\t\t\t\t\taria-label={ blockAriaLabel }\n\t\t\t\t\t// translators: Data label for the Block Settings Sidebar tab.\n\t\t\t\t\tdata-label={ __( 'Block' ) }\n\t\t\t\t>\n\t\t\t\t\t{\n\t\t\t\t\t\t// translators: Text label for the Block Settings Sidebar tab.\n\t\t\t\t\t\t__( 'Block' )\n\t\t\t\t\t}\n\t\t\t\t</Button>\n\t\t\t</li>\n\t\t</ul>\n\t);\n};\n\nexport default SettingsHeader;\n"]}
|
|
@@ -41,7 +41,7 @@ function TemplateSummary() {
|
|
|
41
41
|
icon: _icons.layout
|
|
42
42
|
})), (0, _element.createElement)(_components.FlexBlock, null, (0, _element.createElement)("h2", {
|
|
43
43
|
className: "edit-post-template-summary__title"
|
|
44
|
-
},
|
|
44
|
+
}, template?.title || template?.slug), (0, _element.createElement)("p", null, template?.description))));
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
var _default = TemplateSummary;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-post/src/components/sidebar/template-summary/index.js"],"names":["TemplateSummary","template","select","getEditedPostTemplate","editPostStore","layout","title","slug","description"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AAKA;;AAVA;AACA;AACA;;AAKA;AACA;AACA;AAGA,SAASA,eAAT,GAA2B;AAC1B,QAAMC,QAAQ,GAAG,qBAAaC,MAAF,IAAc;AACzC,UAAM;AAAEC,MAAAA;AAAF,QAA4BD,MAAM,CAAEE,YAAF,CAAxC;AACA,WAAOD,qBAAqB,EAA5B;AACA,GAHgB,EAGd,EAHc,CAAjB;;AAKA,MAAK,CAAEF,QAAP,EAAkB;AACjB,WAAO,IAAP;AACA;;AAED,SACC,4BAAC,qBAAD,QACC,4BAAC,gBAAD;AAAM,IAAA,KAAK,EAAC,YAAZ;AAAyB,IAAA,GAAG,EAAC;AAA7B,KACC,4BAAC,oBAAD,QACC,4BAAC,WAAD;AAAM,IAAA,IAAI,EAAGI;AAAb,IADD,CADD,EAKC,4BAAC,qBAAD,QACC;AAAI,IAAA,SAAS,EAAC;AAAd,
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-post/src/components/sidebar/template-summary/index.js"],"names":["TemplateSummary","template","select","getEditedPostTemplate","editPostStore","layout","title","slug","description"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AAKA;;AAVA;AACA;AACA;;AAKA;AACA;AACA;AAGA,SAASA,eAAT,GAA2B;AAC1B,QAAMC,QAAQ,GAAG,qBAAaC,MAAF,IAAc;AACzC,UAAM;AAAEC,MAAAA;AAAF,QAA4BD,MAAM,CAAEE,YAAF,CAAxC;AACA,WAAOD,qBAAqB,EAA5B;AACA,GAHgB,EAGd,EAHc,CAAjB;;AAKA,MAAK,CAAEF,QAAP,EAAkB;AACjB,WAAO,IAAP;AACA;;AAED,SACC,4BAAC,qBAAD,QACC,4BAAC,gBAAD;AAAM,IAAA,KAAK,EAAC,YAAZ;AAAyB,IAAA,GAAG,EAAC;AAA7B,KACC,4BAAC,oBAAD,QACC,4BAAC,WAAD;AAAM,IAAA,IAAI,EAAGI;AAAb,IADD,CADD,EAKC,4BAAC,qBAAD,QACC;AAAI,IAAA,SAAS,EAAC;AAAd,KACGJ,QAAQ,EAAEK,KAAV,IAAmBL,QAAQ,EAAEM,IADhC,CADD,EAIC,uCAAKN,QAAQ,EAAEO,WAAf,CAJD,CALD,CADD,CADD;AAgBA;;eAEcR,e","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Icon, layout } from '@wordpress/icons';\nimport { useSelect } from '@wordpress/data';\nimport { Flex, FlexItem, FlexBlock, PanelBody } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../../store';\n\nfunction TemplateSummary() {\n\tconst template = useSelect( ( select ) => {\n\t\tconst { getEditedPostTemplate } = select( editPostStore );\n\t\treturn getEditedPostTemplate();\n\t}, [] );\n\n\tif ( ! template ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PanelBody>\n\t\t\t<Flex align=\"flex-start\" gap=\"3\">\n\t\t\t\t<FlexItem>\n\t\t\t\t\t<Icon icon={ layout } />\n\t\t\t\t</FlexItem>\n\n\t\t\t\t<FlexBlock>\n\t\t\t\t\t<h2 className=\"edit-post-template-summary__title\">\n\t\t\t\t\t\t{ template?.title || template?.slug }\n\t\t\t\t\t</h2>\n\t\t\t\t\t<p>{ template?.description }</p>\n\t\t\t\t</FlexBlock>\n\t\t\t</Flex>\n\t\t</PanelBody>\n\t);\n}\n\nexport default TemplateSummary;\n"]}
|
|
@@ -56,10 +56,9 @@ function useStartPatterns() {
|
|
|
56
56
|
}, [postType, blockPatternsWithPostContentBlockType]);
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
-
function PatternSelection(
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
} = _ref;
|
|
59
|
+
function PatternSelection({
|
|
60
|
+
onChoosePattern
|
|
61
|
+
}) {
|
|
63
62
|
const blockPatterns = useStartPatterns();
|
|
64
63
|
const shownBlockPatterns = (0, _compose.useAsyncList)(blockPatterns);
|
|
65
64
|
const {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-post/src/components/start-page-options/index.js"],"names":["useStartPatterns","blockPatternsWithPostContentBlockType","postType","select","getPatternsByBlockTypes","blockEditorStore","getCurrentPostType","editorStore","filter","pattern","postTypes","Array","isArray","includes","PatternSelection","onChoosePattern","blockPatterns","shownBlockPatterns","resetEditorBlocks","_pattern","blocks","START_PAGE_MODAL_STATES","INITIAL","PATTERN","CLOSED","StartPageOptions","modalState","setModalState","hasStartPattern","length","shouldOpenModel","getEditedPostContent","isEditedPostSaveable","isEditingTemplate","isFeatureActive","editPostStore"],"mappings":";;;;;;;AAKA;;AAFA;;AACA;;AAEA;;AAIA;;AACA;;AACA;;AAKA;;AAjBA;AACA;AACA;;AAYA;AACA;AACA;AAGA,SAASA,gBAAT,GAA4B;AAC3B;AACA;AACA;AACA,QAAM;AAAEC,IAAAA,qCAAF;AAAyCC,IAAAA;AAAzC,MAAsD,qBACzDC,MAAF,IAAc;AACb,UAAM;AAAEC,MAAAA;AAAF,QAA8BD,MAAM,CAAEE,kBAAF,CAA1C;AACA,UAAM;AAAEC,MAAAA;AAAF,QAAyBH,MAAM,CAAEI,aAAF,CAArC;AACA,WAAO;AACNN,MAAAA,qCAAqC,EACpCG,uBAAuB,CAAE,mBAAF,CAFlB;AAGNF,MAAAA,QAAQ,EAAEI,kBAAkB;AAHtB,KAAP;AAKA,GAT0D,EAU3D,EAV2D,CAA5D;AAaA,SAAO,sBAAS,MAAM;AACrB;AACA;AACA,WAAOL,qCAAqC,CAACO,MAAtC,CAAgDC,OAAF,IAAe;AACnE,aACGP,QAAQ,KAAK,MAAb,IAAuB,CAAEO,OAAO,CAACC,SAAnC,IACEC,KAAK,CAACC,OAAN,CAAeH,OAAO,CAACC,SAAvB,KACDD,OAAO,CAACC,SAAR,CAAkBG,QAAlB,CAA4BX,QAA5B,CAHF;AAKA,KANM,CAAP;AAOA,GAVM,EAUJ,CAAEA,QAAF,EAAYD,qCAAZ,CAVI,CAAP;AAWA;;AAED,SAASa,gBAAT,
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-post/src/components/start-page-options/index.js"],"names":["useStartPatterns","blockPatternsWithPostContentBlockType","postType","select","getPatternsByBlockTypes","blockEditorStore","getCurrentPostType","editorStore","filter","pattern","postTypes","Array","isArray","includes","PatternSelection","onChoosePattern","blockPatterns","shownBlockPatterns","resetEditorBlocks","_pattern","blocks","START_PAGE_MODAL_STATES","INITIAL","PATTERN","CLOSED","StartPageOptions","modalState","setModalState","hasStartPattern","length","shouldOpenModel","getEditedPostContent","isEditedPostSaveable","isEditingTemplate","isFeatureActive","editPostStore"],"mappings":"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","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Modal } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useState, useEffect, useMemo } from '@wordpress/element';\nimport {\n\tstore as blockEditorStore,\n\t__experimentalBlockPatternsList as BlockPatternsList,\n} from '@wordpress/block-editor';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useAsyncList } from '@wordpress/compose';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../store';\n\nfunction useStartPatterns() {\n\t// A pattern is a start pattern if it includes 'core/post-content' in its blockTypes,\n\t// and it has no postTypes declares and the current post type is page or if\n\t// the current post type is part of the postTypes declared.\n\tconst { blockPatternsWithPostContentBlockType, postType } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getPatternsByBlockTypes } = select( blockEditorStore );\n\t\t\tconst { getCurrentPostType } = select( editorStore );\n\t\t\treturn {\n\t\t\t\tblockPatternsWithPostContentBlockType:\n\t\t\t\t\tgetPatternsByBlockTypes( 'core/post-content' ),\n\t\t\t\tpostType: getCurrentPostType(),\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\n\treturn useMemo( () => {\n\t\t// filter patterns without postTypes declared if the current postType is page\n\t\t// or patterns that declare the current postType in its post type array.\n\t\treturn blockPatternsWithPostContentBlockType.filter( ( pattern ) => {\n\t\t\treturn (\n\t\t\t\t( postType === 'page' && ! pattern.postTypes ) ||\n\t\t\t\t( Array.isArray( pattern.postTypes ) &&\n\t\t\t\t\tpattern.postTypes.includes( postType ) )\n\t\t\t);\n\t\t} );\n\t}, [ postType, blockPatternsWithPostContentBlockType ] );\n}\n\nfunction PatternSelection( { onChoosePattern } ) {\n\tconst blockPatterns = useStartPatterns();\n\tconst shownBlockPatterns = useAsyncList( blockPatterns );\n\tconst { resetEditorBlocks } = useDispatch( editorStore );\n\treturn (\n\t\t<BlockPatternsList\n\t\t\tblockPatterns={ blockPatterns }\n\t\t\tshownPatterns={ shownBlockPatterns }\n\t\t\tonClickPattern={ ( _pattern, blocks ) => {\n\t\t\t\tresetEditorBlocks( blocks );\n\t\t\t\tonChoosePattern();\n\t\t\t} }\n\t\t/>\n\t);\n}\n\nconst START_PAGE_MODAL_STATES = {\n\tINITIAL: 'INITIAL',\n\tPATTERN: 'PATTERN',\n\tCLOSED: 'CLOSED',\n};\n\nexport default function StartPageOptions() {\n\tconst [ modalState, setModalState ] = useState(\n\t\tSTART_PAGE_MODAL_STATES.INITIAL\n\t);\n\tconst blockPatterns = useStartPatterns();\n\tconst hasStartPattern = blockPatterns.length > 0;\n\tconst shouldOpenModel = useSelect(\n\t\t( select ) => {\n\t\t\tif (\n\t\t\t\t! hasStartPattern ||\n\t\t\t\tmodalState !== START_PAGE_MODAL_STATES.INITIAL\n\t\t\t) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tconst { getEditedPostContent, isEditedPostSaveable } =\n\t\t\t\tselect( editorStore );\n\t\t\tconst { isEditingTemplate, isFeatureActive } =\n\t\t\t\tselect( editPostStore );\n\t\t\treturn (\n\t\t\t\t! isEditedPostSaveable() &&\n\t\t\t\t'' === getEditedPostContent() &&\n\t\t\t\t! isEditingTemplate() &&\n\t\t\t\t! isFeatureActive( 'welcomeGuide' )\n\t\t\t);\n\t\t},\n\t\t[ modalState, hasStartPattern ]\n\t);\n\n\tuseEffect( () => {\n\t\tif ( shouldOpenModel ) {\n\t\t\tsetModalState( START_PAGE_MODAL_STATES.PATTERN );\n\t\t}\n\t}, [ shouldOpenModel ] );\n\n\tif (\n\t\tmodalState === START_PAGE_MODAL_STATES.INITIAL ||\n\t\tmodalState === START_PAGE_MODAL_STATES.CLOSED\n\t) {\n\t\treturn null;\n\t}\n\treturn (\n\t\t<Modal\n\t\t\tclassName=\"edit-post-start-page-options__modal\"\n\t\t\ttitle={ __( 'Choose a pattern' ) }\n\t\t\tisFullScreen={ true }\n\t\t\tonRequestClose={ () => {\n\t\t\t\tsetModalState( START_PAGE_MODAL_STATES.CLOSED );\n\t\t\t} }\n\t\t>\n\t\t\t<div className=\"edit-post-start-page-options__modal-content\">\n\t\t\t\t{ modalState === START_PAGE_MODAL_STATES.PATTERN && (\n\t\t\t\t\t<PatternSelection\n\t\t\t\t\t\tonChoosePattern={ () => {\n\t\t\t\t\t\t\tsetModalState( START_PAGE_MODAL_STATES.CLOSED );\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</div>\n\t\t</Modal>\n\t);\n}\n"]}
|
|
@@ -34,7 +34,7 @@ function ViewLink() {
|
|
|
34
34
|
return {
|
|
35
35
|
permalink: select(_editor.store).getPermalink(),
|
|
36
36
|
isPublished: select(_editor.store).isCurrentPostPublished(),
|
|
37
|
-
label: postType
|
|
37
|
+
label: postType?.labels.view_item
|
|
38
38
|
};
|
|
39
39
|
}, []); // Only render the view button if the post is published and has a permalink.
|
|
40
40
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-post/src/components/view-link/index.js"],"names":["ViewLink","permalink","isPublished","label","select","postTypeSlug","editorStore","getCurrentPostType","postType","coreStore","getPostType","getPermalink","isCurrentPostPublished","labels","view_item","external"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AACA;;AACA;;AARA;AACA;AACA;AAQe,SAASA,QAAT,GAAoB;AAClC,QAAM;AAAEC,IAAAA,SAAF;AAAaC,IAAAA,WAAb;AAA0BC,IAAAA;AAA1B,MAAoC,qBAAaC,MAAF,IAAc;AAClE;AACA,UAAMC,YAAY,GAAGD,MAAM,CAAEE,aAAF,CAAN,CAAsBC,kBAAtB,EAArB;AACA,UAAMC,QAAQ,GAAGJ,MAAM,CAAEK,eAAF,CAAN,CAAoBC,WAApB,CAAiCL,YAAjC,CAAjB;AAEA,WAAO;AACNJ,MAAAA,SAAS,EAAEG,MAAM,CAAEE,aAAF,CAAN,CAAsBK,YAAtB,EADL;AAENT,MAAAA,WAAW,EAAEE,MAAM,CAAEE,aAAF,CAAN,CAAsBM,sBAAtB,EAFP;AAGNT,MAAAA,KAAK,EAAEK,
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-post/src/components/view-link/index.js"],"names":["ViewLink","permalink","isPublished","label","select","postTypeSlug","editorStore","getCurrentPostType","postType","coreStore","getPostType","getPermalink","isCurrentPostPublished","labels","view_item","external"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AACA;;AACA;;AARA;AACA;AACA;AAQe,SAASA,QAAT,GAAoB;AAClC,QAAM;AAAEC,IAAAA,SAAF;AAAaC,IAAAA,WAAb;AAA0BC,IAAAA;AAA1B,MAAoC,qBAAaC,MAAF,IAAc;AAClE;AACA,UAAMC,YAAY,GAAGD,MAAM,CAAEE,aAAF,CAAN,CAAsBC,kBAAtB,EAArB;AACA,UAAMC,QAAQ,GAAGJ,MAAM,CAAEK,eAAF,CAAN,CAAoBC,WAApB,CAAiCL,YAAjC,CAAjB;AAEA,WAAO;AACNJ,MAAAA,SAAS,EAAEG,MAAM,CAAEE,aAAF,CAAN,CAAsBK,YAAtB,EADL;AAENT,MAAAA,WAAW,EAAEE,MAAM,CAAEE,aAAF,CAAN,CAAsBM,sBAAtB,EAFP;AAGNT,MAAAA,KAAK,EAAEK,QAAQ,EAAEK,MAAV,CAAiBC;AAHlB,KAAP;AAKA,GAVyC,EAUvC,EAVuC,CAA1C,CADkC,CAalC;;AACA,MAAK,CAAEZ,WAAF,IAAiB,CAAED,SAAxB,EAAoC;AACnC,WAAO,IAAP;AACA;;AAED,SACC,4BAAC,kBAAD;AACC,IAAA,IAAI,EAAGc,eADR;AAEC,IAAA,KAAK,EAAGZ,KAAK,IAAI,cAAI,WAAJ,CAFlB;AAGC,IAAA,IAAI,EAAGF,SAHR;AAIC,IAAA,MAAM,EAAC;AAJR,IADD;AAQA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { Button } from '@wordpress/components';\nimport { external } from '@wordpress/icons';\nimport { store as editorStore } from '@wordpress/editor';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\n\nexport default function ViewLink() {\n\tconst { permalink, isPublished, label } = useSelect( ( select ) => {\n\t\t// Grab post type to retrieve the view_item label.\n\t\tconst postTypeSlug = select( editorStore ).getCurrentPostType();\n\t\tconst postType = select( coreStore ).getPostType( postTypeSlug );\n\n\t\treturn {\n\t\t\tpermalink: select( editorStore ).getPermalink(),\n\t\t\tisPublished: select( editorStore ).isCurrentPostPublished(),\n\t\t\tlabel: postType?.labels.view_item,\n\t\t};\n\t}, [] );\n\n\t// Only render the view button if the post is published and has a permalink.\n\tif ( ! isPublished || ! permalink ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<Button\n\t\t\ticon={ external }\n\t\t\tlabel={ label || __( 'View post' ) }\n\t\t\thref={ permalink }\n\t\t\ttarget=\"_blank\"\n\t\t/>\n\t);\n}\n"]}
|
|
@@ -29,11 +29,10 @@ var _store = require("../../store");
|
|
|
29
29
|
*/
|
|
30
30
|
const noop = () => {};
|
|
31
31
|
|
|
32
|
-
function BlockInspectorButton(
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
} = _ref;
|
|
32
|
+
function BlockInspectorButton({
|
|
33
|
+
onClick = noop,
|
|
34
|
+
small = false
|
|
35
|
+
}) {
|
|
37
36
|
const {
|
|
38
37
|
shortcut,
|
|
39
38
|
areAdvancedSettingsOpened
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-post/src/components/visual-editor/block-inspector-button.js"],"names":["noop","BlockInspectorButton","onClick","small","shortcut","areAdvancedSettingsOpened","select","keyboardShortcutsStore","getShortcutRepresentation","editPostStore","getActiveGeneralSidebarName","openGeneralSidebar","closeGeneralSidebar","label"],"mappings":";;;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AAZA;AACA;AACA;;AAOA;AACA;AACA;AAGA,MAAMA,IAAI,GAAG,MAAM,CAAE,CAArB;;AAEO,SAASC,oBAAT,
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-post/src/components/visual-editor/block-inspector-button.js"],"names":["noop","BlockInspectorButton","onClick","small","shortcut","areAdvancedSettingsOpened","select","keyboardShortcutsStore","getShortcutRepresentation","editPostStore","getActiveGeneralSidebarName","openGeneralSidebar","closeGeneralSidebar","label"],"mappings":";;;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AAZA;AACA;AACA;;AAOA;AACA;AACA;AAGA,MAAMA,IAAI,GAAG,MAAM,CAAE,CAArB;;AAEO,SAASC,oBAAT,CAA+B;AAAEC,EAAAA,OAAO,GAAGF,IAAZ;AAAkBG,EAAAA,KAAK,GAAG;AAA1B,CAA/B,EAAmE;AACzE,QAAM;AAAEC,IAAAA,QAAF;AAAYC,IAAAA;AAAZ,MAA0C,qBAC7CC,MAAF,KAAgB;AACfF,IAAAA,QAAQ,EAAEE,MAAM,CACfC,wBADe,CAAN,CAERC,yBAFQ,CAEmB,+BAFnB,CADK;AAIfH,IAAAA,yBAAyB,EACxBC,MAAM,CAAEG,YAAF,CAAN,CAAwBC,2BAAxB,OACA;AANc,GAAhB,CAD+C,EAS/C,EAT+C,CAAhD;AAWA,QAAM;AAAEC,IAAAA,kBAAF;AAAsBC,IAAAA;AAAtB,MACL,uBAAaH,YAAb,CADD;AAGA,QAAMI,KAAK,GAAGR,yBAAyB,GACpC,cAAI,oBAAJ,CADoC,GAEpC,cAAI,oBAAJ,CAFH;AAIA,SACC,4BAAC,oBAAD;AACC,IAAA,OAAO,EAAG,MAAM;AACf,UAAKA,yBAAL,EAAiC;AAChCO,QAAAA,mBAAmB;AACnB,yBAAO,cAAI,uBAAJ,CAAP;AACA,OAHD,MAGO;AACND,QAAAA,kBAAkB,CAAE,iBAAF,CAAlB;AACA,yBACC,cACC,4EADD,CADD;AAKA;;AACDT,MAAAA,OAAO;AACP,KAdF;AAeC,IAAA,QAAQ,EAAGE;AAfZ,KAiBG,CAAED,KAAF,IAAWU,KAjBd,CADD;AAqBA;;eAEcZ,oB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { MenuItem } from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { speak } from '@wordpress/a11y';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../store';\n\nconst noop = () => {};\n\nexport function BlockInspectorButton( { onClick = noop, small = false } ) {\n\tconst { shortcut, areAdvancedSettingsOpened } = useSelect(\n\t\t( select ) => ( {\n\t\t\tshortcut: select(\n\t\t\t\tkeyboardShortcutsStore\n\t\t\t).getShortcutRepresentation( 'core/edit-post/toggle-sidebar' ),\n\t\t\tareAdvancedSettingsOpened:\n\t\t\t\tselect( editPostStore ).getActiveGeneralSidebarName() ===\n\t\t\t\t'edit-post/block',\n\t\t} ),\n\t\t[]\n\t);\n\tconst { openGeneralSidebar, closeGeneralSidebar } =\n\t\tuseDispatch( editPostStore );\n\n\tconst label = areAdvancedSettingsOpened\n\t\t? __( 'Hide more settings' )\n\t\t: __( 'Show more settings' );\n\n\treturn (\n\t\t<MenuItem\n\t\t\tonClick={ () => {\n\t\t\t\tif ( areAdvancedSettingsOpened ) {\n\t\t\t\t\tcloseGeneralSidebar();\n\t\t\t\t\tspeak( __( 'Block settings closed' ) );\n\t\t\t\t} else {\n\t\t\t\t\topenGeneralSidebar( 'edit-post/block' );\n\t\t\t\t\tspeak(\n\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t'Additional settings are now available in the Editor block settings sidebar'\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tonClick();\n\t\t\t} }\n\t\t\tshortcut={ shortcut }\n\t\t>\n\t\t\t{ ! small && label }\n\t\t</MenuItem>\n\t);\n}\n\nexport default BlockInspectorButton;\n"]}
|
|
@@ -34,13 +34,12 @@ var _style = _interopRequireDefault(require("./style.scss"));
|
|
|
34
34
|
/**
|
|
35
35
|
* Internal dependencies
|
|
36
36
|
*/
|
|
37
|
-
const Header = (0, _element.memo)(function EditorHeader(
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
} = _ref;
|
|
37
|
+
const Header = (0, _element.memo)(function EditorHeader({
|
|
38
|
+
editTitle,
|
|
39
|
+
setTitleRef,
|
|
40
|
+
title,
|
|
41
|
+
getStylesFromColorScheme
|
|
42
|
+
}) {
|
|
44
43
|
const [wrapperStyles] = (0, _blockEditor.useEditorWrapperStyles)();
|
|
45
44
|
const blockHolderFocusedStyle = getStylesFromColorScheme(_style.default.blockHolderFocused, _style.default.blockHolderFocusedDark);
|
|
46
45
|
return (0, _element.createElement)(_reactNative.View, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-post/src/components/visual-editor/header.native.js"],"names":["Header","EditorHeader","editTitle","setTitleRef","title","getStylesFromColorScheme","wrapperStyles","blockHolderFocusedStyle","styles","blockHolderFocused","blockHolderFocusedDark","blockHolderFullBordered","borderColor","prevProps","nextProps","select","getEditedPostAttribute","dispatch","editPost","clearSelectedBlock","blockEditorStore","withPreferredColorScheme"],"mappings":";;;;;;;;;AAQA;;AALA;;AAMA;;AACA;;AACA;;AACA;;AACA;;AAQA;;AArBA;AACA;AACA;;AAGA;AACA;AACA;;AAWA;AACA;AACA;AAGA,MAAMA,MAAM,GAAG,mBACd,SAASC,YAAT,
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-post/src/components/visual-editor/header.native.js"],"names":["Header","EditorHeader","editTitle","setTitleRef","title","getStylesFromColorScheme","wrapperStyles","blockHolderFocusedStyle","styles","blockHolderFocused","blockHolderFocusedDark","blockHolderFullBordered","borderColor","prevProps","nextProps","select","getEditedPostAttribute","dispatch","editPost","clearSelectedBlock","blockEditorStore","withPreferredColorScheme"],"mappings":";;;;;;;;;AAQA;;AALA;;AAMA;;AACA;;AACA;;AACA;;AACA;;AAQA;;AArBA;AACA;AACA;;AAGA;AACA;AACA;;AAWA;AACA;AACA;AAGA,MAAMA,MAAM,GAAG,mBACd,SAASC,YAAT,CAAuB;AACtBC,EAAAA,SADsB;AAEtBC,EAAAA,WAFsB;AAGtBC,EAAAA,KAHsB;AAItBC,EAAAA;AAJsB,CAAvB,EAKI;AACH,QAAM,CAAEC,aAAF,IAAoB,0CAA1B;AACA,QAAMC,uBAAuB,GAAGF,wBAAwB,CACvDG,eAAOC,kBADgD,EAEvDD,eAAOE,sBAFgD,CAAxD;AAIA,SACC,4BAAC,iBAAD;AAAM,IAAA,KAAK,EAAGJ;AAAd,KACC,4BAAC,iBAAD;AACC,IAAA,QAAQ,EAAGH,WADZ;AAEC,IAAA,KAAK,EAAGC,KAFT;AAGC,IAAA,QAAQ,EAAGF,SAHZ;AAIC,IAAA,WAAW,EAAG,cAAI,WAAJ,CAJf;AAKC,IAAA,WAAW,EAAGM,eAAOG,uBALtB;AAMC,IAAA,kBAAkB,EAAGJ,uBAAuB,CAACK,WAN9C;AAOC,IAAA,kBAAkB,EAAC;AAPpB,IADD,CADD;AAaA,CAzBa,EA0Bd,CAAEC,SAAF,EAAaC,SAAb,KAA4BD,SAAS,CAACT,KAAV,KAAoBU,SAAS,CAACV,KA1B5C,CAAf;;eA6Be,sBAAS,CACvB,sBAAcW,MAAF,IAAc;AACzB,QAAM;AAAEC,IAAAA;AAAF,MAA6BD,MAAM,CAAE,aAAF,CAAzC;AAEA,SAAO;AACNX,IAAAA,KAAK,EAAEY,sBAAsB,CAAE,OAAF;AADvB,GAAP;AAGA,CAND,CADuB,EAQvB,wBAAgBC,QAAF,IAAgB;AAC7B,QAAM;AAAEC,IAAAA;AAAF,MAAeD,QAAQ,CAAE,aAAF,CAA7B;AAEA,QAAM;AAAEE,IAAAA;AAAF,MAAyBF,QAAQ,CAAEG,kBAAF,CAAvC;AAEA,SAAO;AACND,IAAAA,kBADM;;AAENjB,IAAAA,SAAS,CAAEE,KAAF,EAAU;AAClBc,MAAAA,QAAQ,CAAE;AAAEd,QAAAA;AAAF,OAAF,CAAR;AACA;;AAJK,GAAP;AAMA,CAXD,CARuB,EAoBvBiB,iCApBuB,CAAT,EAqBVrB,MArBU,C","sourcesContent":["/**\n * External dependencies\n */\nimport { View } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { memo } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { withDispatch, withSelect } from '@wordpress/data';\nimport { compose, withPreferredColorScheme } from '@wordpress/compose';\nimport { PostTitle } from '@wordpress/editor';\nimport {\n\tstore as blockEditorStore,\n\tuseEditorWrapperStyles,\n} from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport styles from './style.scss';\n\nconst Header = memo(\n\tfunction EditorHeader( {\n\t\teditTitle,\n\t\tsetTitleRef,\n\t\ttitle,\n\t\tgetStylesFromColorScheme,\n\t} ) {\n\t\tconst [ wrapperStyles ] = useEditorWrapperStyles();\n\t\tconst blockHolderFocusedStyle = getStylesFromColorScheme(\n\t\t\tstyles.blockHolderFocused,\n\t\t\tstyles.blockHolderFocusedDark\n\t\t);\n\t\treturn (\n\t\t\t<View style={ wrapperStyles }>\n\t\t\t\t<PostTitle\n\t\t\t\t\tinnerRef={ setTitleRef }\n\t\t\t\t\ttitle={ title }\n\t\t\t\t\tonUpdate={ editTitle }\n\t\t\t\t\tplaceholder={ __( 'Add title' ) }\n\t\t\t\t\tborderStyle={ styles.blockHolderFullBordered }\n\t\t\t\t\tfocusedBorderColor={ blockHolderFocusedStyle.borderColor }\n\t\t\t\t\taccessibilityLabel=\"post-title\"\n\t\t\t\t/>\n\t\t\t</View>\n\t\t);\n\t},\n\t( prevProps, nextProps ) => prevProps.title === nextProps.title\n);\n\nexport default compose( [\n\twithSelect( ( select ) => {\n\t\tconst { getEditedPostAttribute } = select( 'core/editor' );\n\n\t\treturn {\n\t\t\ttitle: getEditedPostAttribute( 'title' ),\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch ) => {\n\t\tconst { editPost } = dispatch( 'core/editor' );\n\n\t\tconst { clearSelectedBlock } = dispatch( blockEditorStore );\n\n\t\treturn {\n\t\t\tclearSelectedBlock,\n\t\t\teditTitle( title ) {\n\t\t\t\teditPost( { title } );\n\t\t\t},\n\t\t};\n\t} ),\n\twithPreferredColorScheme,\n] )( Header );\n"]}
|