@wordpress/editor 14.38.0 → 14.39.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 +2 -0
- package/build/components/document-bar/useEditedSectionDetails.cjs +0 -3
- package/build/components/document-bar/useEditedSectionDetails.cjs.map +2 -2
- package/build/components/editor-interface/index.cjs +33 -9
- package/build/components/editor-interface/index.cjs.map +2 -2
- package/build/components/header/header-skeleton.cjs +100 -0
- package/build/components/header/header-skeleton.cjs.map +7 -0
- package/build/components/header/index.cjs +63 -106
- package/build/components/header/index.cjs.map +3 -3
- package/build/components/media/index.cjs +44 -0
- package/build/components/media/index.cjs.map +7 -0
- package/build/components/media/metadata-panel.cjs +96 -0
- package/build/components/media/metadata-panel.cjs.map +7 -0
- package/build/components/media/preview.cjs +39 -0
- package/build/components/media/preview.cjs.map +7 -0
- package/build/components/more-menu/index.cjs +3 -2
- package/build/components/more-menu/index.cjs.map +2 -2
- package/build/components/post-card-panel/index.cjs +33 -4
- package/build/components/post-card-panel/index.cjs.map +3 -3
- package/build/components/post-content-information/index.cjs +9 -0
- package/build/components/post-content-information/index.cjs.map +2 -2
- package/build/components/post-last-edited-panel/index.cjs +5 -6
- package/build/components/post-last-edited-panel/index.cjs.map +2 -2
- package/build/components/post-last-revision/index.cjs +5 -7
- package/build/components/post-last-revision/index.cjs.map +2 -2
- package/build/components/post-publish-button/label.cjs +6 -1
- package/build/components/post-publish-button/label.cjs.map +2 -2
- package/build/components/post-publish-button/post-publish-button-or-toggle.cjs +8 -3
- package/build/components/post-publish-button/post-publish-button-or-toggle.cjs.map +2 -2
- package/build/components/post-revisions-preview/index.cjs +44 -0
- package/build/components/post-revisions-preview/index.cjs.map +7 -0
- package/build/components/post-revisions-preview/revisions-canvas.cjs +82 -0
- package/build/components/post-revisions-preview/revisions-canvas.cjs.map +7 -0
- package/build/components/post-revisions-preview/revisions-header.cjs +119 -0
- package/build/components/post-revisions-preview/revisions-header.cjs.map +7 -0
- package/build/components/post-revisions-preview/revisions-slider.cjs +110 -0
- package/build/components/post-revisions-preview/revisions-slider.cjs.map +7 -0
- package/build/components/post-saved-state/index.cjs +8 -2
- package/build/components/post-saved-state/index.cjs.map +2 -2
- package/build/components/post-title/index.cjs +5 -4
- package/build/components/post-title/index.cjs.map +2 -2
- package/build/components/provider/index.cjs +19 -0
- package/build/components/provider/index.cjs.map +3 -3
- package/build/components/provider/use-block-editor-settings.cjs +2 -1
- package/build/components/provider/use-block-editor-settings.cjs.map +2 -2
- package/build/components/revision-author-panel/index.cjs +59 -0
- package/build/components/revision-author-panel/index.cjs.map +7 -0
- package/build/components/revision-created-panel/index.cjs +47 -0
- package/build/components/revision-created-panel/index.cjs.map +7 -0
- package/build/components/sidebar/header.cjs +27 -12
- package/build/components/sidebar/header.cjs.map +3 -3
- package/build/components/sidebar/index.cjs +36 -15
- package/build/components/sidebar/index.cjs.map +3 -3
- package/build/components/sidebar/post-summary.cjs +44 -19
- package/build/components/sidebar/post-summary.cjs.map +3 -3
- package/build/components/start-page-options/index.cjs +1 -1
- package/build/components/start-page-options/index.cjs.map +2 -2
- package/build/dataviews/store/private-actions.cjs +47 -26
- package/build/dataviews/store/private-actions.cjs.map +3 -3
- package/build/store/constants.cjs +3 -0
- package/build/store/constants.cjs.map +2 -2
- package/build/store/private-actions.cjs +40 -0
- package/build/store/private-actions.cjs.map +2 -2
- package/build/store/private-selectors.cjs +33 -2
- package/build/store/private-selectors.cjs.map +2 -2
- package/build/store/reducer.cjs +10 -0
- package/build/store/reducer.cjs.map +2 -2
- package/build/store/selectors.cjs +3 -0
- package/build/store/selectors.cjs.map +2 -2
- package/build/store/utils/notice-builder.cjs +4 -0
- package/build/store/utils/notice-builder.cjs.map +2 -2
- package/build-module/components/document-bar/useEditedSectionDetails.mjs +0 -3
- package/build-module/components/document-bar/useEditedSectionDetails.mjs.map +2 -2
- package/build-module/components/editor-interface/index.mjs +33 -9
- package/build-module/components/editor-interface/index.mjs.map +2 -2
- package/build-module/components/header/header-skeleton.mjs +69 -0
- package/build-module/components/header/header-skeleton.mjs.map +7 -0
- package/build-module/components/header/index.mjs +65 -107
- package/build-module/components/header/index.mjs.map +2 -2
- package/build-module/components/media/index.mjs +8 -0
- package/build-module/components/media/index.mjs.map +7 -0
- package/build-module/components/media/metadata-panel.mjs +65 -0
- package/build-module/components/media/metadata-panel.mjs.map +7 -0
- package/build-module/components/media/preview.mjs +21 -0
- package/build-module/components/media/preview.mjs.map +7 -0
- package/build-module/components/more-menu/index.mjs +3 -2
- package/build-module/components/more-menu/index.mjs.map +2 -2
- package/build-module/components/post-card-panel/index.mjs +35 -5
- package/build-module/components/post-card-panel/index.mjs.map +3 -3
- package/build-module/components/post-content-information/index.mjs +9 -0
- package/build-module/components/post-content-information/index.mjs.map +2 -2
- package/build-module/components/post-last-edited-panel/index.mjs +5 -6
- package/build-module/components/post-last-edited-panel/index.mjs.map +2 -2
- package/build-module/components/post-last-revision/index.mjs +6 -8
- package/build-module/components/post-last-revision/index.mjs.map +2 -2
- package/build-module/components/post-publish-button/label.mjs +6 -1
- package/build-module/components/post-publish-button/label.mjs.map +2 -2
- package/build-module/components/post-publish-button/post-publish-button-or-toggle.mjs +8 -3
- package/build-module/components/post-publish-button/post-publish-button-or-toggle.mjs.map +2 -2
- package/build-module/components/post-revisions-preview/index.mjs +8 -0
- package/build-module/components/post-revisions-preview/index.mjs.map +7 -0
- package/build-module/components/post-revisions-preview/revisions-canvas.mjs +54 -0
- package/build-module/components/post-revisions-preview/revisions-canvas.mjs.map +7 -0
- package/build-module/components/post-revisions-preview/revisions-header.mjs +92 -0
- package/build-module/components/post-revisions-preview/revisions-header.mjs.map +7 -0
- package/build-module/components/post-revisions-preview/revisions-slider.mjs +89 -0
- package/build-module/components/post-revisions-preview/revisions-slider.mjs.map +7 -0
- package/build-module/components/post-saved-state/index.mjs +8 -2
- package/build-module/components/post-saved-state/index.mjs.map +2 -2
- package/build-module/components/post-title/index.mjs +5 -4
- package/build-module/components/post-title/index.mjs.map +2 -2
- package/build-module/components/provider/index.mjs +19 -0
- package/build-module/components/provider/index.mjs.map +2 -2
- package/build-module/components/provider/use-block-editor-settings.mjs +2 -1
- package/build-module/components/provider/use-block-editor-settings.mjs.map +2 -2
- package/build-module/components/revision-author-panel/index.mjs +28 -0
- package/build-module/components/revision-author-panel/index.mjs.map +7 -0
- package/build-module/components/revision-created-panel/index.mjs +26 -0
- package/build-module/components/revision-created-panel/index.mjs.map +7 -0
- package/build-module/components/sidebar/header.mjs +22 -7
- package/build-module/components/sidebar/header.mjs.map +2 -2
- package/build-module/components/sidebar/index.mjs +38 -16
- package/build-module/components/sidebar/index.mjs.map +2 -2
- package/build-module/components/sidebar/post-summary.mjs +48 -20
- package/build-module/components/sidebar/post-summary.mjs.map +2 -2
- package/build-module/components/start-page-options/index.mjs +2 -1
- package/build-module/components/start-page-options/index.mjs.map +2 -2
- package/build-module/dataviews/store/private-actions.mjs +59 -27
- package/build-module/dataviews/store/private-actions.mjs.map +2 -2
- package/build-module/store/constants.mjs +2 -0
- package/build-module/store/constants.mjs.map +2 -2
- package/build-module/store/private-actions.mjs +38 -0
- package/build-module/store/private-actions.mjs.map +2 -2
- package/build-module/store/private-selectors.mjs +29 -1
- package/build-module/store/private-selectors.mjs.map +2 -2
- package/build-module/store/reducer.mjs +9 -0
- package/build-module/store/reducer.mjs.map +2 -2
- package/build-module/store/selectors.mjs +4 -0
- package/build-module/store/selectors.mjs.map +2 -2
- package/build-module/store/utils/notice-builder.mjs +4 -0
- package/build-module/store/utils/notice-builder.mjs.map +2 -2
- package/build-style/style-rtl.css +182 -16
- package/build-style/style.css +182 -16
- package/build-types/components/document-bar/useEditedSectionDetails.d.ts.map +1 -1
- package/build-types/components/editor-interface/index.d.ts.map +1 -1
- package/build-types/components/header/header-skeleton.d.ts +17 -0
- package/build-types/components/header/header-skeleton.d.ts.map +1 -0
- package/build-types/components/header/index.d.ts.map +1 -1
- package/build-types/components/media/index.d.ts +3 -0
- package/build-types/components/media/index.d.ts.map +1 -0
- package/build-types/components/media/metadata-panel.d.ts +12 -0
- package/build-types/components/media/metadata-panel.d.ts.map +1 -0
- package/build-types/components/media/preview.d.ts +9 -0
- package/build-types/components/media/preview.d.ts.map +1 -0
- package/build-types/components/more-menu/index.d.ts +3 -1
- package/build-types/components/more-menu/index.d.ts.map +1 -1
- package/build-types/components/post-card-panel/index.d.ts.map +1 -1
- package/build-types/components/post-content-information/index.d.ts.map +1 -1
- package/build-types/components/post-last-edited-panel/index.d.ts.map +1 -1
- package/build-types/components/post-last-revision/index.d.ts.map +1 -1
- package/build-types/components/post-publish-button/label.d.ts.map +1 -1
- package/build-types/components/post-publish-button/post-publish-button-or-toggle.d.ts.map +1 -1
- package/build-types/components/post-revisions-preview/index.d.ts +3 -0
- package/build-types/components/post-revisions-preview/index.d.ts.map +1 -0
- package/build-types/components/post-revisions-preview/revisions-canvas.d.ts +7 -0
- package/build-types/components/post-revisions-preview/revisions-canvas.d.ts.map +1 -0
- package/build-types/components/post-revisions-preview/revisions-header.d.ts +8 -0
- package/build-types/components/post-revisions-preview/revisions-header.d.ts.map +1 -0
- package/build-types/components/post-revisions-preview/revisions-slider.d.ts +8 -0
- package/build-types/components/post-revisions-preview/revisions-slider.d.ts.map +1 -0
- package/build-types/components/post-saved-state/index.d.ts.map +1 -1
- package/build-types/components/provider/index.d.ts.map +1 -1
- package/build-types/components/provider/use-block-editor-settings.d.ts.map +1 -1
- package/build-types/components/revision-author-panel/index.d.ts +2 -0
- package/build-types/components/revision-author-panel/index.d.ts.map +1 -0
- package/build-types/components/revision-created-panel/index.d.ts +2 -0
- package/build-types/components/revision-created-panel/index.d.ts.map +1 -0
- package/build-types/components/sidebar/index.d.ts.map +1 -1
- package/build-types/components/sidebar/post-summary.d.ts.map +1 -1
- package/build-types/components/start-page-options/index.d.ts.map +1 -1
- package/build-types/dataviews/store/private-actions.d.ts +1 -0
- package/build-types/dataviews/store/private-actions.d.ts.map +1 -1
- package/build-types/store/constants.d.ts +1 -0
- package/build-types/store/constants.d.ts.map +1 -1
- package/build-types/store/private-actions.d.ts +13 -0
- package/build-types/store/private-actions.d.ts.map +1 -1
- package/build-types/store/private-selectors.d.ts +25 -0
- package/build-types/store/private-selectors.d.ts.map +1 -1
- package/build-types/store/reducer.d.ts +11 -0
- package/build-types/store/reducer.d.ts.map +1 -1
- package/build-types/store/selectors.d.ts.map +1 -1
- package/build-types/store/utils/notice-builder.d.ts.map +1 -1
- package/package.json +42 -40
- package/src/components/document-bar/useEditedSectionDetails.js +0 -5
- package/src/components/editor-interface/index.js +39 -9
- package/src/components/header/header-skeleton.js +90 -0
- package/src/components/header/index.js +69 -102
- package/src/components/header/style.scss +4 -0
- package/src/components/media/index.js +2 -0
- package/src/components/media/metadata-panel.js +77 -0
- package/src/components/media/preview.js +35 -0
- package/src/components/more-menu/index.js +2 -1
- package/src/components/post-card-panel/index.js +43 -7
- package/src/components/post-content-information/index.js +11 -0
- package/src/components/post-last-edited-panel/index.js +8 -9
- package/src/components/post-last-revision/index.js +7 -8
- package/src/components/post-publish-button/label.js +9 -0
- package/src/components/post-publish-button/post-publish-button-or-toggle.js +13 -5
- package/src/components/post-revisions-preview/index.js +2 -0
- package/src/components/post-revisions-preview/revisions-canvas.js +73 -0
- package/src/components/post-revisions-preview/revisions-header.js +108 -0
- package/src/components/post-revisions-preview/revisions-slider.js +123 -0
- package/src/components/post-revisions-preview/style.scss +22 -0
- package/src/components/post-saved-state/index.js +8 -0
- package/src/components/post-title/index.js +4 -3
- package/src/components/provider/index.js +26 -0
- package/src/components/provider/use-block-editor-settings.js +2 -3
- package/src/components/revision-author-panel/index.js +36 -0
- package/src/components/revision-created-panel/index.js +36 -0
- package/src/components/sidebar/header.js +35 -14
- package/src/components/sidebar/index.js +40 -13
- package/src/components/sidebar/post-summary.js +45 -11
- package/src/components/sidebar/style.scss +7 -0
- package/src/components/start-page-options/index.js +2 -0
- package/src/dataviews/store/private-actions.ts +79 -33
- package/src/store/constants.ts +1 -0
- package/src/store/private-actions.js +70 -0
- package/src/store/private-selectors.js +54 -0
- package/src/store/reducer.js +17 -0
- package/src/store/selectors.js +6 -0
- package/src/store/test/selectors.js +7 -0
- package/src/store/utils/notice-builder.js +9 -0
- package/src/style.scss +2 -0
|
@@ -50,6 +50,7 @@ var import_post_transform_panel = __toESM(require("../post-transform-panel/index
|
|
|
50
50
|
var import_header = __toESM(require("./header.cjs"));
|
|
51
51
|
var import_template_content_panel = __toESM(require("../template-content-panel/index.cjs"));
|
|
52
52
|
var import_template_part_content_panel = __toESM(require("../template-part-content-panel/index.cjs"));
|
|
53
|
+
var import_media = require("../media/index.cjs");
|
|
53
54
|
var import_use_auto_switch_editor_sidebars = __toESM(require("../provider/use-auto-switch-editor-sidebars.cjs"));
|
|
54
55
|
var import_constants = require("./constants.cjs");
|
|
55
56
|
var import_lock_unlock = require("../../lock-unlock.cjs");
|
|
@@ -65,10 +66,15 @@ var SidebarContent = ({
|
|
|
65
66
|
tabName,
|
|
66
67
|
keyboardShortcut,
|
|
67
68
|
onActionPerformed,
|
|
68
|
-
extraPanels
|
|
69
|
+
extraPanels,
|
|
70
|
+
postType
|
|
69
71
|
}) => {
|
|
70
72
|
const tabListRef = (0, import_element.useRef)(null);
|
|
71
73
|
const tabsContextValue = (0, import_element.useContext)(Tabs.Context);
|
|
74
|
+
const isAttachment = postType === import_constants2.ATTACHMENT_POST_TYPE;
|
|
75
|
+
const isRevisionsMode = (0, import_data.useSelect)((select) => {
|
|
76
|
+
return (0, import_lock_unlock.unlock)(select(import_store.store)).isRevisionsMode();
|
|
77
|
+
});
|
|
72
78
|
(0, import_element.useEffect)(() => {
|
|
73
79
|
const tabsElements = Array.from(
|
|
74
80
|
tabListRef.current?.querySelectorAll('[role="tab"]') || []
|
|
@@ -103,24 +109,36 @@ var SidebarContent = ({
|
|
|
103
109
|
icon: (0, import_i18n.isRTL)() ? import_icons.drawerLeft : import_icons.drawerRight,
|
|
104
110
|
isActiveByDefault: SIDEBAR_ACTIVE_BY_DEFAULT,
|
|
105
111
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Tabs.Context.Provider, { value: tabsContextValue, children: [
|
|
106
|
-
/* @__PURE__ */ (0, import_jsx_runtime.
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
112
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Tabs.TabPanel, { tabId: import_constants.sidebars.document, focusable: false, children: isAttachment ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
113
|
+
import_media.MediaMetadataPanel,
|
|
114
|
+
{
|
|
115
|
+
onActionPerformed
|
|
116
|
+
}
|
|
117
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
118
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
119
|
+
import_post_summary.default,
|
|
120
|
+
{
|
|
121
|
+
onActionPerformed
|
|
122
|
+
}
|
|
123
|
+
),
|
|
124
|
+
!isRevisionsMode && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
125
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_plugin_document_setting_panel.default.Slot, {}),
|
|
126
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_template_content_panel.default, {}),
|
|
127
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_template_part_content_panel.default, {}),
|
|
128
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_post_transform_panel.default, {}),
|
|
129
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_panel.default, {}),
|
|
130
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_pattern_overrides_panel.default, {}),
|
|
131
|
+
extraPanels
|
|
132
|
+
] })
|
|
133
|
+
] }) }),
|
|
134
|
+
!isAttachment && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Tabs.TabPanel, { tabId: import_constants.sidebars.block, focusable: false, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_block_editor.BlockInspector, {}) })
|
|
117
135
|
] })
|
|
118
136
|
}
|
|
119
137
|
);
|
|
120
138
|
};
|
|
121
139
|
var Sidebar = ({ extraPanels, onActionPerformed }) => {
|
|
122
140
|
(0, import_use_auto_switch_editor_sidebars.default)();
|
|
123
|
-
const { tabName, keyboardShortcut, showSummary } = (0, import_data.useSelect)(
|
|
141
|
+
const { tabName, keyboardShortcut, showSummary, postType } = (0, import_data.useSelect)(
|
|
124
142
|
(select) => {
|
|
125
143
|
const shortcut = select(
|
|
126
144
|
import_keyboard_shortcuts.store
|
|
@@ -136,6 +154,7 @@ var Sidebar = ({ extraPanels, onActionPerformed }) => {
|
|
|
136
154
|
import_block_editor.store
|
|
137
155
|
).getBlockSelectionStart() ? import_constants.sidebars.block : import_constants.sidebars.document;
|
|
138
156
|
}
|
|
157
|
+
const _postType = select(import_store.store).getCurrentPostType();
|
|
139
158
|
return {
|
|
140
159
|
tabName: _tabName,
|
|
141
160
|
keyboardShortcut: shortcut,
|
|
@@ -143,7 +162,8 @@ var Sidebar = ({ extraPanels, onActionPerformed }) => {
|
|
|
143
162
|
import_constants2.TEMPLATE_POST_TYPE,
|
|
144
163
|
import_constants2.TEMPLATE_PART_POST_TYPE,
|
|
145
164
|
import_constants2.NAVIGATION_POST_TYPE
|
|
146
|
-
].includes(
|
|
165
|
+
].includes(_postType),
|
|
166
|
+
postType: _postType
|
|
147
167
|
};
|
|
148
168
|
},
|
|
149
169
|
[]
|
|
@@ -170,7 +190,8 @@ var Sidebar = ({ extraPanels, onActionPerformed }) => {
|
|
|
170
190
|
keyboardShortcut,
|
|
171
191
|
showSummary,
|
|
172
192
|
onActionPerformed,
|
|
173
|
-
extraPanels
|
|
193
|
+
extraPanels,
|
|
194
|
+
postType
|
|
174
195
|
}
|
|
175
196
|
)
|
|
176
197
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/sidebar/index.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport {\n\tBlockInspector,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tPlatform,\n\tuseCallback,\n\tuseContext,\n\tuseEffect,\n\tuseRef,\n} from '@wordpress/element';\nimport { isRTL, __, _x } from '@wordpress/i18n';\nimport { drawerLeft, drawerRight } from '@wordpress/icons';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\nimport { privateApis as componentsPrivateApis } from '@wordpress/components';\nimport { store as interfaceStore } from '@wordpress/interface';\n\n/**\n * Internal dependencies\n */\nimport PatternOverridesPanel from '../pattern-overrides-panel';\nimport PluginDocumentSettingPanel from '../plugin-document-setting-panel';\nimport PluginSidebar from '../plugin-sidebar';\nimport PostSummary from './post-summary';\nimport PostTaxonomiesPanel from '../post-taxonomies/panel';\nimport PostTransformPanel from '../post-transform-panel';\nimport SidebarHeader from './header';\nimport TemplateContentPanel from '../template-content-panel';\nimport TemplatePartContentPanel from '../template-part-content-panel';\nimport useAutoSwitchEditorSidebars from '../provider/use-auto-switch-editor-sidebars';\nimport { sidebars } from './constants';\nimport { unlock } from '../../lock-unlock';\nimport { store as editorStore } from '../../store';\nimport {\n\tNAVIGATION_POST_TYPE,\n\tTEMPLATE_PART_POST_TYPE,\n\tTEMPLATE_POST_TYPE,\n} from '../../store/constants';\n\nconst { Tabs } = unlock( componentsPrivateApis );\n\nconst SIDEBAR_ACTIVE_BY_DEFAULT = Platform.select( {\n\tweb: true,\n\tnative: false,\n} );\n\nconst SidebarContent = ( {\n\ttabName,\n\tkeyboardShortcut,\n\tonActionPerformed,\n\textraPanels,\n} ) => {\n\tconst tabListRef = useRef( null );\n\t// Because `PluginSidebar` renders a `ComplementaryArea`, we\n\t// need to forward the `Tabs` context so it can be passed through the\n\t// underlying slot/fill.\n\tconst tabsContextValue = useContext( Tabs.Context );\n\n\t// This effect addresses a race condition caused by tabbing from the last\n\t// block in the editor into the settings sidebar. Without this effect, the\n\t// selected tab and browser focus can become separated in an unexpected way\n\t// (e.g the \"block\" tab is focused, but the \"post\" tab is selected).\n\tuseEffect( () => {\n\t\tconst tabsElements = Array.from(\n\t\t\ttabListRef.current?.querySelectorAll( '[role=\"tab\"]' ) || []\n\t\t);\n\t\tconst selectedTabElement = tabsElements.find(\n\t\t\t// We are purposefully using a custom `data-tab-id` attribute here\n\t\t\t// because we don't want rely on any assumptions about `Tabs`\n\t\t\t// component internals.\n\t\t\t( element ) => element.getAttribute( 'data-tab-id' ) === tabName\n\t\t);\n\t\tconst activeElement = selectedTabElement?.ownerDocument.activeElement;\n\t\tconst tabsHasFocus = tabsElements.some( ( element ) => {\n\t\t\treturn activeElement && activeElement.id === element.id;\n\t\t} );\n\t\tif (\n\t\t\ttabsHasFocus &&\n\t\t\tselectedTabElement &&\n\t\t\tselectedTabElement.id !== activeElement?.id\n\t\t) {\n\t\t\tselectedTabElement?.focus();\n\t\t}\n\t}, [ tabName ] );\n\n\treturn (\n\t\t<PluginSidebar\n\t\t\tidentifier={ tabName }\n\t\t\theader={\n\t\t\t\t<Tabs.Context.Provider value={ tabsContextValue }>\n\t\t\t\t\t<SidebarHeader ref={ tabListRef } />\n\t\t\t\t</Tabs.Context.Provider>\n\t\t\t}\n\t\t\tcloseLabel={ __( 'Close Settings' ) }\n\t\t\t// This classname is added so we can apply a corrective negative\n\t\t\t// margin to the panel.\n\t\t\t// see https://github.com/WordPress/gutenberg/pull/55360#pullrequestreview-1737671049\n\t\t\tclassName=\"editor-sidebar__panel\"\n\t\t\theaderClassName=\"editor-sidebar__panel-tabs\"\n\t\t\ttitle={\n\t\t\t\t/* translators: button label text should, if possible, be under 16 characters. */\n\t\t\t\t_x( 'Settings', 'panel button label' )\n\t\t\t}\n\t\t\ttoggleShortcut={ keyboardShortcut }\n\t\t\ticon={ isRTL() ? drawerLeft : drawerRight }\n\t\t\tisActiveByDefault={ SIDEBAR_ACTIVE_BY_DEFAULT }\n\t\t>\n\t\t\t<Tabs.Context.Provider value={ tabsContextValue }>\n\t\t\t\t<Tabs.TabPanel tabId={ sidebars.document } focusable={ false }>\n\t\t\t\t\t<
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,0BAGO;AACP,kBAAuC;AACvC,qBAMO;AACP,kBAA8B;AAC9B,mBAAwC;AACxC,gCAAgD;AAChD,wBAAqD;AACrD,uBAAwC;AAKxC,qCAAkC;AAClC,2CAAuC;AACvC,4BAA0B;AAC1B,0BAAwB;AACxB,mBAAgC;AAChC,kCAA+B;AAC/B,oBAA0B;AAC1B,oCAAiC;AACjC,yCAAqC;AACrC,6CAAwC;AACxC,uBAAyB;AACzB,yBAAuB;AACvB,mBAAqC;AACrC,IAAAA,
|
|
6
|
-
"names": ["import_constants", "componentsPrivateApis", "PluginSidebar", "SidebarHeader", "PostSummary", "PluginDocumentSettingPanel", "TemplateContentPanel", "TemplatePartContentPanel", "PostTransformPanel", "PostTaxonomiesPanel", "PatternOverridesPanel", "useAutoSwitchEditorSidebars", "keyboardShortcutsStore", "interfaceStore", "blockEditorStore"
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport {\n\tBlockInspector,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tPlatform,\n\tuseCallback,\n\tuseContext,\n\tuseEffect,\n\tuseRef,\n} from '@wordpress/element';\nimport { isRTL, __, _x } from '@wordpress/i18n';\nimport { drawerLeft, drawerRight } from '@wordpress/icons';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\nimport { privateApis as componentsPrivateApis } from '@wordpress/components';\nimport { store as interfaceStore } from '@wordpress/interface';\n\n/**\n * Internal dependencies\n */\nimport PatternOverridesPanel from '../pattern-overrides-panel';\nimport PluginDocumentSettingPanel from '../plugin-document-setting-panel';\nimport PluginSidebar from '../plugin-sidebar';\nimport PostSummary from './post-summary';\nimport PostTaxonomiesPanel from '../post-taxonomies/panel';\nimport PostTransformPanel from '../post-transform-panel';\nimport SidebarHeader from './header';\nimport TemplateContentPanel from '../template-content-panel';\nimport TemplatePartContentPanel from '../template-part-content-panel';\nimport { MediaMetadataPanel } from '../media';\nimport useAutoSwitchEditorSidebars from '../provider/use-auto-switch-editor-sidebars';\nimport { sidebars } from './constants';\nimport { unlock } from '../../lock-unlock';\nimport { store as editorStore } from '../../store';\nimport {\n\tATTACHMENT_POST_TYPE,\n\tNAVIGATION_POST_TYPE,\n\tTEMPLATE_PART_POST_TYPE,\n\tTEMPLATE_POST_TYPE,\n} from '../../store/constants';\n\nconst { Tabs } = unlock( componentsPrivateApis );\n\nconst SIDEBAR_ACTIVE_BY_DEFAULT = Platform.select( {\n\tweb: true,\n\tnative: false,\n} );\n\nconst SidebarContent = ( {\n\ttabName,\n\tkeyboardShortcut,\n\tonActionPerformed,\n\textraPanels,\n\tpostType,\n} ) => {\n\tconst tabListRef = useRef( null );\n\t// Because `PluginSidebar` renders a `ComplementaryArea`, we\n\t// need to forward the `Tabs` context so it can be passed through the\n\t// underlying slot/fill.\n\tconst tabsContextValue = useContext( Tabs.Context );\n\tconst isAttachment = postType === ATTACHMENT_POST_TYPE;\n\tconst isRevisionsMode = useSelect( ( select ) => {\n\t\treturn unlock( select( editorStore ) ).isRevisionsMode();\n\t} );\n\n\t// This effect addresses a race condition caused by tabbing from the last\n\t// block in the editor into the settings sidebar. Without this effect, the\n\t// selected tab and browser focus can become separated in an unexpected way\n\t// (e.g the \"block\" tab is focused, but the \"post\" tab is selected).\n\tuseEffect( () => {\n\t\tconst tabsElements = Array.from(\n\t\t\ttabListRef.current?.querySelectorAll( '[role=\"tab\"]' ) || []\n\t\t);\n\t\tconst selectedTabElement = tabsElements.find(\n\t\t\t// We are purposefully using a custom `data-tab-id` attribute here\n\t\t\t// because we don't want rely on any assumptions about `Tabs`\n\t\t\t// component internals.\n\t\t\t( element ) => element.getAttribute( 'data-tab-id' ) === tabName\n\t\t);\n\t\tconst activeElement = selectedTabElement?.ownerDocument.activeElement;\n\t\tconst tabsHasFocus = tabsElements.some( ( element ) => {\n\t\t\treturn activeElement && activeElement.id === element.id;\n\t\t} );\n\t\tif (\n\t\t\ttabsHasFocus &&\n\t\t\tselectedTabElement &&\n\t\t\tselectedTabElement.id !== activeElement?.id\n\t\t) {\n\t\t\tselectedTabElement?.focus();\n\t\t}\n\t}, [ tabName ] );\n\n\treturn (\n\t\t<PluginSidebar\n\t\t\tidentifier={ tabName }\n\t\t\theader={\n\t\t\t\t<Tabs.Context.Provider value={ tabsContextValue }>\n\t\t\t\t\t<SidebarHeader ref={ tabListRef } />\n\t\t\t\t</Tabs.Context.Provider>\n\t\t\t}\n\t\t\tcloseLabel={ __( 'Close Settings' ) }\n\t\t\t// This classname is added so we can apply a corrective negative\n\t\t\t// margin to the panel.\n\t\t\t// see https://github.com/WordPress/gutenberg/pull/55360#pullrequestreview-1737671049\n\t\t\tclassName=\"editor-sidebar__panel\"\n\t\t\theaderClassName=\"editor-sidebar__panel-tabs\"\n\t\t\ttitle={\n\t\t\t\t/* translators: button label text should, if possible, be under 16 characters. */\n\t\t\t\t_x( 'Settings', 'panel button label' )\n\t\t\t}\n\t\t\ttoggleShortcut={ keyboardShortcut }\n\t\t\ticon={ isRTL() ? drawerLeft : drawerRight }\n\t\t\tisActiveByDefault={ SIDEBAR_ACTIVE_BY_DEFAULT }\n\t\t>\n\t\t\t<Tabs.Context.Provider value={ tabsContextValue }>\n\t\t\t\t<Tabs.TabPanel tabId={ sidebars.document } focusable={ false }>\n\t\t\t\t\t{ isAttachment ? (\n\t\t\t\t\t\t<MediaMetadataPanel\n\t\t\t\t\t\t\tonActionPerformed={ onActionPerformed }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<PostSummary\n\t\t\t\t\t\t\t\tonActionPerformed={ onActionPerformed }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t{ ! isRevisionsMode && (\n\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t<PluginDocumentSettingPanel.Slot />\n\t\t\t\t\t\t\t\t\t<TemplateContentPanel />\n\t\t\t\t\t\t\t\t\t<TemplatePartContentPanel />\n\t\t\t\t\t\t\t\t\t<PostTransformPanel />\n\t\t\t\t\t\t\t\t\t<PostTaxonomiesPanel />\n\t\t\t\t\t\t\t\t\t<PatternOverridesPanel />\n\t\t\t\t\t\t\t\t\t{ extraPanels }\n\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</>\n\t\t\t\t\t) }\n\t\t\t\t</Tabs.TabPanel>\n\t\t\t\t{ ! isAttachment && (\n\t\t\t\t\t<Tabs.TabPanel tabId={ sidebars.block } focusable={ false }>\n\t\t\t\t\t\t<BlockInspector />\n\t\t\t\t\t</Tabs.TabPanel>\n\t\t\t\t) }\n\t\t\t</Tabs.Context.Provider>\n\t\t</PluginSidebar>\n\t);\n};\n\nconst Sidebar = ( { extraPanels, onActionPerformed } ) => {\n\tuseAutoSwitchEditorSidebars();\n\tconst { tabName, keyboardShortcut, showSummary, postType } = useSelect(\n\t\t( select ) => {\n\t\t\tconst shortcut = select(\n\t\t\t\tkeyboardShortcutsStore\n\t\t\t).getShortcutRepresentation( 'core/editor/toggle-sidebar' );\n\n\t\t\tconst sidebar =\n\t\t\t\tselect( interfaceStore ).getActiveComplementaryArea( 'core' );\n\t\t\tconst _isEditorSidebarOpened = [\n\t\t\t\tsidebars.block,\n\t\t\t\tsidebars.document,\n\t\t\t].includes( sidebar );\n\t\t\tlet _tabName = sidebar;\n\t\t\tif ( ! _isEditorSidebarOpened ) {\n\t\t\t\t_tabName = !! select(\n\t\t\t\t\tblockEditorStore\n\t\t\t\t).getBlockSelectionStart()\n\t\t\t\t\t? sidebars.block\n\t\t\t\t\t: sidebars.document;\n\t\t\t}\n\n\t\t\tconst _postType = select( editorStore ).getCurrentPostType();\n\n\t\t\treturn {\n\t\t\t\ttabName: _tabName,\n\t\t\t\tkeyboardShortcut: shortcut,\n\t\t\t\tshowSummary: ! [\n\t\t\t\t\tTEMPLATE_POST_TYPE,\n\t\t\t\t\tTEMPLATE_PART_POST_TYPE,\n\t\t\t\t\tNAVIGATION_POST_TYPE,\n\t\t\t\t].includes( _postType ),\n\t\t\t\tpostType: _postType,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\n\tconst { enableComplementaryArea } = useDispatch( interfaceStore );\n\n\tconst onTabSelect = useCallback(\n\t\t( newSelectedTabId ) => {\n\t\t\tif ( !! newSelectedTabId ) {\n\t\t\t\tenableComplementaryArea( 'core', newSelectedTabId );\n\t\t\t}\n\t\t},\n\t\t[ enableComplementaryArea ]\n\t);\n\n\treturn (\n\t\t<Tabs\n\t\t\tselectedTabId={ tabName }\n\t\t\tonSelect={ onTabSelect }\n\t\t\tselectOnMove={ false }\n\t\t>\n\t\t\t<SidebarContent\n\t\t\t\ttabName={ tabName }\n\t\t\t\tkeyboardShortcut={ keyboardShortcut }\n\t\t\t\tshowSummary={ showSummary }\n\t\t\t\tonActionPerformed={ onActionPerformed }\n\t\t\t\textraPanels={ extraPanels }\n\t\t\t\tpostType={ postType }\n\t\t\t/>\n\t\t</Tabs>\n\t);\n};\n\nexport default Sidebar;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,0BAGO;AACP,kBAAuC;AACvC,qBAMO;AACP,kBAA8B;AAC9B,mBAAwC;AACxC,gCAAgD;AAChD,wBAAqD;AACrD,uBAAwC;A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1D,YAAM,UACL,OAAQ,iBAAAC,KAAe,EAAE,2BAA4B,MAAO;AAC7D,YAAM,yBAAyB;AAAA,QAC9B,0BAAS;AAAA,QACT,0BAAS;AAAA,MACV,EAAE,SAAU,OAAQ;AACpB,UAAI,WAAW;AACf,UAAK,CAAE,wBAAyB;AAC/B,mBAAW,CAAC,CAAE;AAAA,UACb,oBAAAC;AAAA,QACD,EAAE,uBAAuB,IACtB,0BAAS,QACT,0BAAS;AAAA,MACb;AAEA,YAAM,YAAY,OAAQ,aAAAb,KAAY,EAAE,mBAAmB;AAE3D,aAAO;AAAA,QACN,SAAS;AAAA,QACT,kBAAkB;AAAA,QAClB,aAAa,CAAE;AAAA,UACd;AAAA,UACA;AAAA,UACA;AAAA,QACD,EAAE,SAAU,SAAU;AAAA,QACtB,UAAU;AAAA,MACX;AAAA,IACD;AAAA,IACA,CAAC;AAAA,EACF;AAEA,QAAM,EAAE,wBAAwB,QAAI,yBAAa,iBAAAY,KAAe;AAEhE,QAAM,kBAAc;AAAA,IACnB,CAAE,qBAAsB;AACvB,UAAK,CAAC,CAAE,kBAAmB;AAC1B,gCAAyB,QAAQ,gBAAiB;AAAA,MACnD;AAAA,IACD;AAAA,IACA,CAAE,uBAAwB;AAAA,EAC3B;AAEA,SACC;AAAA,IAAC;AAAA;AAAA,MACA,eAAgB;AAAA,MAChB,UAAW;AAAA,MACX,cAAe;AAAA,MAEf;AAAA,QAAC;AAAA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA;AAAA,MACD;AAAA;AAAA,EACD;AAEF;AAEA,IAAO,kBAAQ;",
|
|
6
|
+
"names": ["import_constants", "componentsPrivateApis", "editorStore", "PluginSidebar", "SidebarHeader", "PostSummary", "PluginDocumentSettingPanel", "TemplateContentPanel", "TemplatePartContentPanel", "PostTransformPanel", "PostTaxonomiesPanel", "PatternOverridesPanel", "useAutoSwitchEditorSidebars", "keyboardShortcutsStore", "interfaceStore", "blockEditorStore"]
|
|
7
7
|
}
|
|
@@ -35,6 +35,8 @@ __export(post_summary_exports, {
|
|
|
35
35
|
module.exports = __toCommonJS(post_summary_exports);
|
|
36
36
|
var import_components = require("@wordpress/components");
|
|
37
37
|
var import_data = require("@wordpress/data");
|
|
38
|
+
var import_i18n = require("@wordpress/i18n");
|
|
39
|
+
var import_url = require("@wordpress/url");
|
|
38
40
|
var import_plugin_post_status_info = __toESM(require("../plugin-post-status-info/index.cjs"));
|
|
39
41
|
var import_panel = __toESM(require("../post-author/panel.cjs"));
|
|
40
42
|
var import_post_card_panel = __toESM(require("../post-card-panel/index.cjs"));
|
|
@@ -45,6 +47,7 @@ var import_panel4 = require("../post-excerpt/panel.cjs");
|
|
|
45
47
|
var import_panel5 = __toESM(require("../post-featured-image/panel.cjs"));
|
|
46
48
|
var import_panel6 = __toESM(require("../post-format/panel.cjs"));
|
|
47
49
|
var import_post_last_edited_panel = __toESM(require("../post-last-edited-panel/index.cjs"));
|
|
50
|
+
var import_revision_created_panel = __toESM(require("../revision-created-panel/index.cjs"));
|
|
48
51
|
var import_post_panel_section = __toESM(require("../post-panel-section/index.cjs"));
|
|
49
52
|
var import_panel7 = __toESM(require("../post-schedule/panel.cjs"));
|
|
50
53
|
var import_post_status = __toESM(require("../post-status/index.cjs"));
|
|
@@ -57,24 +60,27 @@ var import_site_discussion = __toESM(require("../site-discussion/index.cjs"));
|
|
|
57
60
|
var import_store = require("../../store/index.cjs");
|
|
58
61
|
var import_post_last_revision = require("../post-last-revision/index.cjs");
|
|
59
62
|
var import_post_trash = __toESM(require("../post-trash/index.cjs"));
|
|
63
|
+
var import_revision_author_panel = __toESM(require("../revision-author-panel/index.cjs"));
|
|
64
|
+
var import_lock_unlock = require("../../lock-unlock.cjs");
|
|
60
65
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
61
66
|
var PANEL_NAME = "post-status";
|
|
62
67
|
function PostSummary({ onActionPerformed }) {
|
|
63
|
-
const { isRemovedPostStatusPanel, postType, postId } = (0, import_data.useSelect)(
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
|
|
68
|
+
const { isRemovedPostStatusPanel, postType, postId, revisionId } = (0, import_data.useSelect)((select) => {
|
|
69
|
+
const {
|
|
70
|
+
isEditorPanelRemoved,
|
|
71
|
+
getCurrentPostType,
|
|
72
|
+
getCurrentPostId,
|
|
73
|
+
getCurrentRevisionId
|
|
74
|
+
} = (0, import_lock_unlock.unlock)(select(import_store.store));
|
|
75
|
+
return {
|
|
76
|
+
isRemovedPostStatusPanel: isEditorPanelRemoved(PANEL_NAME),
|
|
77
|
+
postType: getCurrentPostType(),
|
|
78
|
+
postId: getCurrentPostId(),
|
|
79
|
+
revisionId: getCurrentRevisionId()
|
|
80
|
+
};
|
|
81
|
+
}, []);
|
|
82
|
+
const isRevisionsMode = !!revisionId;
|
|
83
|
+
const shouldShowPostStatusPanel = !isRemovedPostStatusPanel && !isRevisionsMode;
|
|
78
84
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_post_panel_section.default, { className: "editor-post-summary", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_plugin_post_status_info.default.Slot, { children: (fills) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_components.__experimentalVStack, { spacing: 4, children: [
|
|
79
85
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
80
86
|
import_post_card_panel.default,
|
|
@@ -84,13 +90,32 @@ function PostSummary({ onActionPerformed }) {
|
|
|
84
90
|
onActionPerformed
|
|
85
91
|
}
|
|
86
92
|
),
|
|
87
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
88
|
-
|
|
93
|
+
!isRevisionsMode && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
94
|
+
import_panel5.default,
|
|
95
|
+
{
|
|
96
|
+
withPanelBody: false
|
|
97
|
+
}
|
|
98
|
+
),
|
|
99
|
+
!isRevisionsMode && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_panel4.PrivatePostExcerptPanel, {}),
|
|
89
100
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_components.__experimentalVStack, { spacing: 1, children: [
|
|
90
101
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_post_content_information.default, {}),
|
|
91
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_post_last_edited_panel.default, {})
|
|
102
|
+
isRevisionsMode ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_revision_created_panel.default, {}) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_post_last_edited_panel.default, {})
|
|
103
|
+
] }),
|
|
104
|
+
isRevisionsMode && revisionId && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
105
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
106
|
+
import_components.ExternalLink,
|
|
107
|
+
{
|
|
108
|
+
href: (0, import_url.addQueryArgs)("revision.php", {
|
|
109
|
+
revision: revisionId
|
|
110
|
+
}),
|
|
111
|
+
children: (0, import_i18n.__)(
|
|
112
|
+
"Open classic revisions screen"
|
|
113
|
+
)
|
|
114
|
+
}
|
|
115
|
+
),
|
|
116
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_revision_author_panel.default, {})
|
|
92
117
|
] }),
|
|
93
|
-
|
|
118
|
+
shouldShowPostStatusPanel && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_components.__experimentalVStack, { spacing: 4, children: [
|
|
94
119
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_components.__experimentalVStack, { spacing: 1, children: [
|
|
95
120
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_post_status.default, {}),
|
|
96
121
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_panel7.default, {}),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/sidebar/post-summary.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport {
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,
|
|
6
|
-
"names": ["import_panel", "editorStore", "PostPanelSection", "PluginPostStatusInfo", "VStack", "PostCardPanel", "PostFeaturedImagePanel", "PostExcerptPanel", "PostContentInformation", "PostLastEditedPanel", "PostStatusPanel", "PostSchedulePanel", "PostURLPanel", "PostAuthorPanel", "PostTemplatePanel", "PostDiscussionPanel", "PageAttributesPanel", "PostSyncStatus", "BlogTitle", "PostsPerPage", "SiteDiscussion", "PostFormatPanel", "PostTrash"]
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalVStack as VStack,\n\tExternalLink,\n} from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { addQueryArgs } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport PluginPostStatusInfo from '../plugin-post-status-info';\nimport PostAuthorPanel from '../post-author/panel';\nimport PostCardPanel from '../post-card-panel';\nimport PostContentInformation from '../post-content-information';\nimport PageAttributesPanel from '../page-attributes/panel';\nimport PostDiscussionPanel from '../post-discussion/panel';\nimport { PrivatePostExcerptPanel as PostExcerptPanel } from '../post-excerpt/panel';\nimport PostFeaturedImagePanel from '../post-featured-image/panel';\nimport PostFormatPanel from '../post-format/panel';\nimport PostLastEditedPanel from '../post-last-edited-panel';\nimport RevisionCreatedPanel from '../revision-created-panel';\nimport PostPanelSection from '../post-panel-section';\nimport PostSchedulePanel from '../post-schedule/panel';\nimport PostStatusPanel from '../post-status';\nimport PostSyncStatus from '../post-sync-status';\nimport PostTemplatePanel from '../post-template/panel';\nimport PostURLPanel from '../post-url/panel';\nimport BlogTitle from '../blog-title';\nimport PostsPerPage from '../posts-per-page';\nimport SiteDiscussion from '../site-discussion';\nimport { store as editorStore } from '../../store';\nimport { PrivatePostLastRevision } from '../post-last-revision';\nimport PostTrash from '../post-trash';\nimport RevisionAuthorPanel from '../revision-author-panel';\nimport { unlock } from '../../lock-unlock';\n\n/**\n * Module Constants\n */\nconst PANEL_NAME = 'post-status';\n\nexport default function PostSummary( { onActionPerformed } ) {\n\tconst { isRemovedPostStatusPanel, postType, postId, revisionId } =\n\t\tuseSelect( ( select ) => {\n\t\t\t// We use isEditorPanelRemoved to hide the panel if it was programmatically removed. We do\n\t\t\t// not use isEditorPanelEnabled since this panel should not be disabled through the UI.\n\t\t\tconst {\n\t\t\t\tisEditorPanelRemoved,\n\t\t\t\tgetCurrentPostType,\n\t\t\t\tgetCurrentPostId,\n\t\t\t\tgetCurrentRevisionId,\n\t\t\t} = unlock( select( editorStore ) );\n\t\t\treturn {\n\t\t\t\tisRemovedPostStatusPanel: isEditorPanelRemoved( PANEL_NAME ),\n\t\t\t\tpostType: getCurrentPostType(),\n\t\t\t\tpostId: getCurrentPostId(),\n\t\t\t\trevisionId: getCurrentRevisionId(),\n\t\t\t};\n\t\t}, [] );\n\n\tconst isRevisionsMode = !! revisionId;\n\tconst shouldShowPostStatusPanel =\n\t\t! isRemovedPostStatusPanel && ! isRevisionsMode;\n\n\treturn (\n\t\t<PostPanelSection className=\"editor-post-summary\">\n\t\t\t<PluginPostStatusInfo.Slot>\n\t\t\t\t{ ( fills ) => (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<VStack spacing={ 4 }>\n\t\t\t\t\t\t\t<PostCardPanel\n\t\t\t\t\t\t\t\tpostType={ postType }\n\t\t\t\t\t\t\t\tpostId={ postId }\n\t\t\t\t\t\t\t\tonActionPerformed={ onActionPerformed }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t{ ! isRevisionsMode && (\n\t\t\t\t\t\t\t\t<PostFeaturedImagePanel\n\t\t\t\t\t\t\t\t\twithPanelBody={ false }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t{ ! isRevisionsMode && <PostExcerptPanel /> }\n\t\t\t\t\t\t\t<VStack spacing={ 1 }>\n\t\t\t\t\t\t\t\t<PostContentInformation />\n\t\t\t\t\t\t\t\t{ isRevisionsMode ? (\n\t\t\t\t\t\t\t\t\t<RevisionCreatedPanel />\n\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t<PostLastEditedPanel />\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</VStack>\n\t\t\t\t\t\t\t{ isRevisionsMode && revisionId && (\n\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t<ExternalLink\n\t\t\t\t\t\t\t\t\t\thref={ addQueryArgs( 'revision.php', {\n\t\t\t\t\t\t\t\t\t\t\trevision: revisionId,\n\t\t\t\t\t\t\t\t\t\t} ) }\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t\t\t'Open classic revisions screen'\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t</ExternalLink>\n\t\t\t\t\t\t\t\t\t<RevisionAuthorPanel />\n\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t{ shouldShowPostStatusPanel && (\n\t\t\t\t\t\t\t\t<VStack spacing={ 4 }>\n\t\t\t\t\t\t\t\t\t<VStack spacing={ 1 }>\n\t\t\t\t\t\t\t\t\t\t<PostStatusPanel />\n\t\t\t\t\t\t\t\t\t\t<PostSchedulePanel />\n\t\t\t\t\t\t\t\t\t\t<PostURLPanel />\n\t\t\t\t\t\t\t\t\t\t<PostAuthorPanel />\n\t\t\t\t\t\t\t\t\t\t<PostTemplatePanel />\n\t\t\t\t\t\t\t\t\t\t<PostDiscussionPanel />\n\t\t\t\t\t\t\t\t\t\t<PrivatePostLastRevision />\n\t\t\t\t\t\t\t\t\t\t<PageAttributesPanel />\n\t\t\t\t\t\t\t\t\t\t<PostSyncStatus />\n\t\t\t\t\t\t\t\t\t\t<BlogTitle />\n\t\t\t\t\t\t\t\t\t\t<PostsPerPage />\n\t\t\t\t\t\t\t\t\t\t<SiteDiscussion />\n\t\t\t\t\t\t\t\t\t\t<PostFormatPanel />\n\t\t\t\t\t\t\t\t\t\t{ fills }\n\t\t\t\t\t\t\t\t\t</VStack>\n\t\t\t\t\t\t\t\t\t<PostTrash\n\t\t\t\t\t\t\t\t\t\tonActionPerformed={ onActionPerformed }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</VStack>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</VStack>\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t</PluginPostStatusInfo.Slot>\n\t\t</PostPanelSection>\n\t);\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,wBAGO;AACP,kBAA0B;AAC1B,kBAAmB;AACnB,iBAA6B;AAK7B,qCAAiC;AACjC,mBAA4B;AAC5B,6BAA0B;AAC1B,sCAAmC;AACnC,IAAAA,gBAAgC;AAChC,IAAAA,gBAAgC;AAChC,IAAAA,gBAA4D;AAC5D,IAAAA,gBAAmC;AACnC,IAAAA,gBAA4B;AAC5B,oCAAgC;AAChC,oCAAiC;AACjC,gCAA6B;AAC7B,IAAAA,gBAA8B;AAC9B,yBAA4B;AAC5B,8BAA2B;AAC3B,IAAAA,gBAA8B;AAC9B,IAAAA,gBAAyB;AACzB,wBAAsB;AACtB,4BAAyB;AACzB,6BAA2B;AAC3B,mBAAqC;AACrC,gCAAwC;AACxC,wBAAsB;AACtB,mCAAgC;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AAAA,MACD;AAAA,MACA,4CAAC,6BAAAC,SAAA,EAAoB;AAAA,OACtB;AAAA,IAEC,6BACD,6CAAC,kBAAAP,sBAAA,EAAO,SAAU,GACjB;AAAA,mDAAC,kBAAAA,sBAAA,EAAO,SAAU,GACjB;AAAA,oDAAC,mBAAAQ,SAAA,EAAgB;AAAA,QACjB,4CAAC,cAAAC,SAAA,EAAkB;AAAA,QACnB,4CAAC,cAAAC,SAAA,EAAa;AAAA,QACd,4CAAC,aAAAC,SAAA,EAAgB;AAAA,QACjB,4CAAC,cAAAC,SAAA,EAAkB;AAAA,QACnB,4CAAC,cAAAC,SAAA,EAAoB;AAAA,QACrB,4CAAC,qDAAwB;AAAA,QACzB,4CAAC,cAAAC,SAAA,EAAoB;AAAA,QACrB,4CAAC,wBAAAC,SAAA,EAAe;AAAA,QAChB,4CAAC,kBAAAC,SAAA,EAAU;AAAA,QACX,4CAAC,sBAAAC,SAAA,EAAa;AAAA,QACd,4CAAC,uBAAAC,SAAA,EAAe;AAAA,QAChB,4CAAC,cAAAC,SAAA,EAAgB;AAAA,QACf;AAAA,SACH;AAAA,MACA;AAAA,QAAC,kBAAAC;AAAA,QAAA;AAAA,UACA;AAAA;AAAA,MACD;AAAA,OACD;AAAA,KAEF,GACD,GAEF,GACD;AAEF;",
|
|
6
|
+
"names": ["import_panel", "editorStore", "PostPanelSection", "PluginPostStatusInfo", "VStack", "PostCardPanel", "PostFeaturedImagePanel", "PostExcerptPanel", "PostContentInformation", "RevisionCreatedPanel", "PostLastEditedPanel", "RevisionAuthorPanel", "PostStatusPanel", "PostSchedulePanel", "PostURLPanel", "PostAuthorPanel", "PostTemplatePanel", "PostDiscussionPanel", "PageAttributesPanel", "PostSyncStatus", "BlogTitle", "PostsPerPage", "SiteDiscussion", "PostFormatPanel", "PostTrash"]
|
|
7
7
|
}
|
|
@@ -148,7 +148,7 @@ function StartPageOptions() {
|
|
|
148
148
|
const currentPostType = getCurrentPostType();
|
|
149
149
|
return {
|
|
150
150
|
postId: getCurrentPostId(),
|
|
151
|
-
enabled: choosePatternModalEnabled && import_constants.TEMPLATE_POST_TYPE !== currentPostType && import_constants.TEMPLATE_PART_POST_TYPE !== currentPostType
|
|
151
|
+
enabled: choosePatternModalEnabled && import_constants.ATTACHMENT_POST_TYPE !== currentPostType && import_constants.TEMPLATE_POST_TYPE !== currentPostType && import_constants.TEMPLATE_PART_POST_TYPE !== currentPostType
|
|
152
152
|
};
|
|
153
153
|
}, []);
|
|
154
154
|
(0, import_element.useEffect)(() => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/start-page-options/index.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { Flex, FlexItem, Modal, CheckboxControl } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useState, useMemo, useEffect } 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 { store as coreStore } from '@wordpress/core-data';\nimport { __unstableSerializeAndClean } from '@wordpress/blocks';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { store as interfaceStore } from '@wordpress/interface';\n\n/**\n * Internal dependencies\n */\nimport {\n\tTEMPLATE_POST_TYPE,\n\tTEMPLATE_PART_POST_TYPE,\n} from '../../store/constants';\nimport { store as editorStore } from '../../store';\n\nexport function 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 declared 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, getBlocksByName } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\tconst { getCurrentPostType, getRenderingMode } =\n\t\t\t\tselect( editorStore );\n\t\t\tconst rootClientId =\n\t\t\t\tgetRenderingMode() === 'post-only'\n\t\t\t\t\t? ''\n\t\t\t\t\t: getBlocksByName( 'core/post-content' )?.[ 0 ];\n\t\t\treturn {\n\t\t\t\tblockPatternsWithPostContentBlockType: getPatternsByBlockTypes(\n\t\t\t\t\t'core/post-content',\n\t\t\t\t\trootClientId\n\t\t\t\t),\n\t\t\t\tpostType: getCurrentPostType(),\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\n\treturn useMemo( () => {\n\t\tif ( ! blockPatternsWithPostContentBlockType?.length ) {\n\t\t\treturn [];\n\t\t}\n\n\t\t/*\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\t */\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( { blockPatterns, onChoosePattern } ) {\n\tconst { editEntityRecord } = useDispatch( coreStore );\n\tconst { postType, postId } = useSelect( ( select ) => {\n\t\tconst { getCurrentPostType, getCurrentPostId } = select( editorStore );\n\n\t\treturn {\n\t\t\tpostType: getCurrentPostType(),\n\t\t\tpostId: getCurrentPostId(),\n\t\t};\n\t}, [] );\n\treturn (\n\t\t<BlockPatternsList\n\t\t\tblockPatterns={ blockPatterns }\n\t\t\tonClickPattern={ ( _pattern, blocks ) => {\n\t\t\t\teditEntityRecord( 'postType', postType, postId, {\n\t\t\t\t\tblocks,\n\t\t\t\t\tcontent: ( { blocks: blocksForSerialization = [] } ) =>\n\t\t\t\t\t\t__unstableSerializeAndClean( blocksForSerialization ),\n\t\t\t\t} );\n\t\t\t\tonChoosePattern();\n\t\t\t} }\n\t\t/>\n\t);\n}\n\nfunction StartPageOptionsModal( { onClose } ) {\n\tconst [ showStartPatterns, setShowStartPatterns ] = useState( true );\n\tconst { set: setPreference } = useDispatch( preferencesStore );\n\tconst startPatterns = useStartPatterns();\n\tconst hasStartPattern = startPatterns.length > 0;\n\n\tif ( ! hasStartPattern ) {\n\t\treturn null;\n\t}\n\n\tfunction handleClose() {\n\t\tonClose();\n\t\tsetPreference( 'core', 'enableChoosePatternModal', showStartPatterns );\n\t}\n\n\treturn (\n\t\t<Modal\n\t\t\tclassName=\"editor-start-page-options__modal\"\n\t\t\ttitle={ __( 'Choose a pattern' ) }\n\t\t\tisFullScreen\n\t\t\tonRequestClose={ handleClose }\n\t\t>\n\t\t\t<div className=\"editor-start-page-options__modal-content\">\n\t\t\t\t<PatternSelection\n\t\t\t\t\tblockPatterns={ startPatterns }\n\t\t\t\t\tonChoosePattern={ handleClose }\n\t\t\t\t/>\n\t\t\t</div>\n\t\t\t<Flex\n\t\t\t\tclassName=\"editor-start-page-options__modal__actions\"\n\t\t\t\tjustify=\"flex-start\"\n\t\t\t\texpanded={ false }\n\t\t\t>\n\t\t\t\t<FlexItem>\n\t\t\t\t\t<CheckboxControl\n\t\t\t\t\t\tchecked={ showStartPatterns }\n\t\t\t\t\t\tlabel={ __(\n\t\t\t\t\t\t\t'Always show starter patterns for new pages'\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tonChange={ ( newValue ) => {\n\t\t\t\t\t\t\tsetShowStartPatterns( newValue );\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t</FlexItem>\n\t\t\t</Flex>\n\t\t</Modal>\n\t);\n}\n\nexport default function StartPageOptions() {\n\tconst [ isOpen, setIsOpen ] = useState( false );\n\tconst { isEditedPostDirty, isEditedPostEmpty } = useSelect( editorStore );\n\tconst { isModalActive } = useSelect( interfaceStore );\n\tconst { enabled, postId } = useSelect( ( select ) => {\n\t\tconst { getCurrentPostId, getCurrentPostType } = select( editorStore );\n\t\tconst choosePatternModalEnabled = select( preferencesStore ).get(\n\t\t\t'core',\n\t\t\t'enableChoosePatternModal'\n\t\t);\n\t\tconst currentPostType = getCurrentPostType();\n\t\treturn {\n\t\t\tpostId: getCurrentPostId(),\n\t\t\tenabled:\n\t\t\t\tchoosePatternModalEnabled &&\n\t\t\t\tTEMPLATE_POST_TYPE !== currentPostType &&\n\t\t\t\tTEMPLATE_PART_POST_TYPE !== currentPostType,\n\t\t};\n\t}, [] );\n\n\t// Note: The `postId` ensures the effect re-runs when pages are switched without remounting the component.\n\t// Examples: changing pages in the List View, creating a new page via Command Palette.\n\tuseEffect( () => {\n\t\tconst isFreshPage = ! isEditedPostDirty() && isEditedPostEmpty();\n\t\t// Prevents immediately opening when features is enabled via preferences modal.\n\t\tconst isPreferencesModalActive = isModalActive( 'editor/preferences' );\n\t\tif ( ! enabled || ! isFreshPage || isPreferencesModalActive ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Open the modal after the initial render for a new page.\n\t\tsetIsOpen( true );\n\t}, [\n\t\tenabled,\n\t\tpostId,\n\t\tisEditedPostDirty,\n\t\tisEditedPostEmpty,\n\t\tisModalActive,\n\t] );\n\n\tif ( ! isOpen ) {\n\t\treturn null;\n\t}\n\n\treturn <StartPageOptionsModal onClose={ () => setIsOpen( false ) } />;\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,wBAAuD;AACvD,kBAAmB;AACnB,qBAA6C;AAC7C,0BAGO;AACP,kBAAuC;AACvC,uBAAmC;AACnC,oBAA4C;AAC5C,yBAA0C;AAC1C,uBAAwC;AAKxC,
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { Flex, FlexItem, Modal, CheckboxControl } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useState, useMemo, useEffect } 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 { store as coreStore } from '@wordpress/core-data';\nimport { __unstableSerializeAndClean } from '@wordpress/blocks';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { store as interfaceStore } from '@wordpress/interface';\n\n/**\n * Internal dependencies\n */\nimport {\n\tATTACHMENT_POST_TYPE,\n\tTEMPLATE_POST_TYPE,\n\tTEMPLATE_PART_POST_TYPE,\n} from '../../store/constants';\nimport { store as editorStore } from '../../store';\n\nexport function 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 declared 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, getBlocksByName } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\tconst { getCurrentPostType, getRenderingMode } =\n\t\t\t\tselect( editorStore );\n\t\t\tconst rootClientId =\n\t\t\t\tgetRenderingMode() === 'post-only'\n\t\t\t\t\t? ''\n\t\t\t\t\t: getBlocksByName( 'core/post-content' )?.[ 0 ];\n\t\t\treturn {\n\t\t\t\tblockPatternsWithPostContentBlockType: getPatternsByBlockTypes(\n\t\t\t\t\t'core/post-content',\n\t\t\t\t\trootClientId\n\t\t\t\t),\n\t\t\t\tpostType: getCurrentPostType(),\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\n\treturn useMemo( () => {\n\t\tif ( ! blockPatternsWithPostContentBlockType?.length ) {\n\t\t\treturn [];\n\t\t}\n\n\t\t/*\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\t */\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( { blockPatterns, onChoosePattern } ) {\n\tconst { editEntityRecord } = useDispatch( coreStore );\n\tconst { postType, postId } = useSelect( ( select ) => {\n\t\tconst { getCurrentPostType, getCurrentPostId } = select( editorStore );\n\n\t\treturn {\n\t\t\tpostType: getCurrentPostType(),\n\t\t\tpostId: getCurrentPostId(),\n\t\t};\n\t}, [] );\n\treturn (\n\t\t<BlockPatternsList\n\t\t\tblockPatterns={ blockPatterns }\n\t\t\tonClickPattern={ ( _pattern, blocks ) => {\n\t\t\t\teditEntityRecord( 'postType', postType, postId, {\n\t\t\t\t\tblocks,\n\t\t\t\t\tcontent: ( { blocks: blocksForSerialization = [] } ) =>\n\t\t\t\t\t\t__unstableSerializeAndClean( blocksForSerialization ),\n\t\t\t\t} );\n\t\t\t\tonChoosePattern();\n\t\t\t} }\n\t\t/>\n\t);\n}\n\nfunction StartPageOptionsModal( { onClose } ) {\n\tconst [ showStartPatterns, setShowStartPatterns ] = useState( true );\n\tconst { set: setPreference } = useDispatch( preferencesStore );\n\tconst startPatterns = useStartPatterns();\n\tconst hasStartPattern = startPatterns.length > 0;\n\n\tif ( ! hasStartPattern ) {\n\t\treturn null;\n\t}\n\n\tfunction handleClose() {\n\t\tonClose();\n\t\tsetPreference( 'core', 'enableChoosePatternModal', showStartPatterns );\n\t}\n\n\treturn (\n\t\t<Modal\n\t\t\tclassName=\"editor-start-page-options__modal\"\n\t\t\ttitle={ __( 'Choose a pattern' ) }\n\t\t\tisFullScreen\n\t\t\tonRequestClose={ handleClose }\n\t\t>\n\t\t\t<div className=\"editor-start-page-options__modal-content\">\n\t\t\t\t<PatternSelection\n\t\t\t\t\tblockPatterns={ startPatterns }\n\t\t\t\t\tonChoosePattern={ handleClose }\n\t\t\t\t/>\n\t\t\t</div>\n\t\t\t<Flex\n\t\t\t\tclassName=\"editor-start-page-options__modal__actions\"\n\t\t\t\tjustify=\"flex-start\"\n\t\t\t\texpanded={ false }\n\t\t\t>\n\t\t\t\t<FlexItem>\n\t\t\t\t\t<CheckboxControl\n\t\t\t\t\t\tchecked={ showStartPatterns }\n\t\t\t\t\t\tlabel={ __(\n\t\t\t\t\t\t\t'Always show starter patterns for new pages'\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tonChange={ ( newValue ) => {\n\t\t\t\t\t\t\tsetShowStartPatterns( newValue );\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t</FlexItem>\n\t\t\t</Flex>\n\t\t</Modal>\n\t);\n}\n\nexport default function StartPageOptions() {\n\tconst [ isOpen, setIsOpen ] = useState( false );\n\tconst { isEditedPostDirty, isEditedPostEmpty } = useSelect( editorStore );\n\tconst { isModalActive } = useSelect( interfaceStore );\n\tconst { enabled, postId } = useSelect( ( select ) => {\n\t\tconst { getCurrentPostId, getCurrentPostType } = select( editorStore );\n\t\tconst choosePatternModalEnabled = select( preferencesStore ).get(\n\t\t\t'core',\n\t\t\t'enableChoosePatternModal'\n\t\t);\n\t\tconst currentPostType = getCurrentPostType();\n\t\treturn {\n\t\t\tpostId: getCurrentPostId(),\n\t\t\tenabled:\n\t\t\t\tchoosePatternModalEnabled &&\n\t\t\t\tATTACHMENT_POST_TYPE !== currentPostType &&\n\t\t\t\tTEMPLATE_POST_TYPE !== currentPostType &&\n\t\t\t\tTEMPLATE_PART_POST_TYPE !== currentPostType,\n\t\t};\n\t}, [] );\n\n\t// Note: The `postId` ensures the effect re-runs when pages are switched without remounting the component.\n\t// Examples: changing pages in the List View, creating a new page via Command Palette.\n\tuseEffect( () => {\n\t\tconst isFreshPage = ! isEditedPostDirty() && isEditedPostEmpty();\n\t\t// Prevents immediately opening when features is enabled via preferences modal.\n\t\tconst isPreferencesModalActive = isModalActive( 'editor/preferences' );\n\t\tif ( ! enabled || ! isFreshPage || isPreferencesModalActive ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Open the modal after the initial render for a new page.\n\t\tsetIsOpen( true );\n\t}, [\n\t\tenabled,\n\t\tpostId,\n\t\tisEditedPostDirty,\n\t\tisEditedPostEmpty,\n\t\tisModalActive,\n\t] );\n\n\tif ( ! isOpen ) {\n\t\treturn null;\n\t}\n\n\treturn <StartPageOptionsModal onClose={ () => setIsOpen( false ) } />;\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,wBAAuD;AACvD,kBAAmB;AACnB,qBAA6C;AAC7C,0BAGO;AACP,kBAAuC;AACvC,uBAAmC;AACnC,oBAA4C;AAC5C,yBAA0C;AAC1C,uBAAwC;AAKxC,uBAIO;AACP,mBAAqC;AAyDnC;AAvDK,SAAS,mBAAmB;AAIlC,QAAM,EAAE,uCAAuC,SAAS,QAAI;AAAA,IAC3D,CAAE,WAAY;AACb,YAAM,EAAE,yBAAyB,gBAAgB,IAChD,OAAQ,oBAAAA,KAAiB;AAC1B,YAAM,EAAE,oBAAoB,iBAAiB,IAC5C,OAAQ,aAAAC,KAAY;AACrB,YAAM,eACL,iBAAiB,MAAM,cACpB,KACA,gBAAiB,mBAAoB,IAAK,CAAE;AAChD,aAAO;AAAA,QACN,uCAAuC;AAAA,UACtC;AAAA,UACA;AAAA,QACD;AAAA,QACA,UAAU,mBAAmB;AAAA,MAC9B;AAAA,IACD;AAAA,IACA,CAAC;AAAA,EACF;AAEA,aAAO,wBAAS,MAAM;AACrB,QAAK,CAAE,uCAAuC,QAAS;AACtD,aAAO,CAAC;AAAA,IACT;AAMA,WAAO,sCAAsC,OAAQ,CAAE,YAAa;AACnE,aACG,aAAa,UAAU,CAAE,QAAQ,aACjC,MAAM,QAAS,QAAQ,SAAU,KAClC,QAAQ,UAAU,SAAU,QAAS;AAAA,IAExC,CAAE;AAAA,EACH,GAAG,CAAE,UAAU,qCAAsC,CAAE;AACxD;AAEA,SAAS,iBAAkB,EAAE,eAAe,gBAAgB,GAAI;AAC/D,QAAM,EAAE,iBAAiB,QAAI,yBAAa,iBAAAC,KAA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6 +41,7 @@ module.exports = __toCommonJS(private_actions_exports);
|
|
|
41
41
|
var import_core_data = require("@wordpress/core-data");
|
|
42
42
|
var import_hooks = require("@wordpress/hooks");
|
|
43
43
|
var import_fields = require("@wordpress/fields");
|
|
44
|
+
var import_media_fields = require("@wordpress/media-fields");
|
|
44
45
|
var import_store = require("../../store/index.cjs");
|
|
45
46
|
var import_constants = require("../../store/constants.cjs");
|
|
46
47
|
var import_content_preview = __toESM(require("../fields/content-preview/index.cjs"));
|
|
@@ -91,6 +92,21 @@ function setIsReady(kind, name) {
|
|
|
91
92
|
name
|
|
92
93
|
};
|
|
93
94
|
}
|
|
95
|
+
var ORDERED_MEDIA_FIELDS = [
|
|
96
|
+
// Metadata in panels (collapsed by default).
|
|
97
|
+
import_media_fields.dateAddedField,
|
|
98
|
+
import_media_fields.authorField,
|
|
99
|
+
import_media_fields.filenameField,
|
|
100
|
+
import_media_fields.mimeTypeField,
|
|
101
|
+
import_media_fields.filesizeField,
|
|
102
|
+
import_media_fields.mediaDimensionsField,
|
|
103
|
+
import_media_fields.attachedToField,
|
|
104
|
+
// Regular layout fields (always visible).
|
|
105
|
+
import_fields.titleField,
|
|
106
|
+
import_media_fields.altTextField,
|
|
107
|
+
import_media_fields.captionField,
|
|
108
|
+
import_media_fields.descriptionField
|
|
109
|
+
];
|
|
94
110
|
var registerPostTypeSchema = (postType) => async ({ registry }) => {
|
|
95
111
|
const isReady = (0, import_lock_unlock.unlock)(registry.select(import_store.store)).isEntityReady(
|
|
96
112
|
"postType",
|
|
@@ -136,33 +152,38 @@ var registerPostTypeSchema = (postType) => async ({ registry }) => {
|
|
|
136
152
|
import_fields.trashPost,
|
|
137
153
|
import_fields.permanentlyDeletePost
|
|
138
154
|
].filter(Boolean);
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
_titleField
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
155
|
+
let fields;
|
|
156
|
+
if (postType === import_constants.ATTACHMENT_POST_TYPE) {
|
|
157
|
+
fields = ORDERED_MEDIA_FIELDS;
|
|
158
|
+
} else {
|
|
159
|
+
fields = [
|
|
160
|
+
postTypeConfig.supports?.thumbnail && currentTheme?.theme_supports?.["post-thumbnails"] && import_fields.featuredImageField,
|
|
161
|
+
postTypeConfig.supports?.author && import_fields.authorField,
|
|
162
|
+
import_fields.statusField,
|
|
163
|
+
!import_constants.DESIGN_POST_TYPES.includes(postTypeConfig.slug) && import_fields.dateField,
|
|
164
|
+
import_fields.slugField,
|
|
165
|
+
postTypeConfig.supports?.["page-attributes"] && import_fields.parentField,
|
|
166
|
+
postTypeConfig.supports?.comments && import_fields.commentStatusField,
|
|
167
|
+
postTypeConfig.supports?.trackbacks && import_fields.pingStatusField,
|
|
168
|
+
(postTypeConfig.supports?.comments || postTypeConfig.supports?.trackbacks) && import_fields.discussionField,
|
|
169
|
+
import_fields.templateField,
|
|
170
|
+
import_fields.passwordField,
|
|
171
|
+
postTypeConfig.supports?.editor && postTypeConfig.viewable && import_content_preview.default,
|
|
172
|
+
hasEditorNotesSupport(postTypeConfig.supports) && import_fields.notesField
|
|
173
|
+
].filter(Boolean);
|
|
174
|
+
if (postTypeConfig.supports?.title) {
|
|
175
|
+
let _titleField;
|
|
176
|
+
if (postType === "page") {
|
|
177
|
+
_titleField = import_fields.pageTitleField;
|
|
178
|
+
} else if (postType === "wp_template") {
|
|
179
|
+
_titleField = import_fields.templateTitleField;
|
|
180
|
+
} else if (postType === "wp_block") {
|
|
181
|
+
_titleField = import_fields.patternTitleField;
|
|
182
|
+
} else {
|
|
183
|
+
_titleField = import_fields.titleField;
|
|
184
|
+
}
|
|
185
|
+
fields.push(_titleField);
|
|
164
186
|
}
|
|
165
|
-
fields.push(_titleField);
|
|
166
187
|
}
|
|
167
188
|
registry.batch(() => {
|
|
168
189
|
actions.forEach((action) => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/dataviews/store/private-actions.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { store as coreStore } from '@wordpress/core-data';\nimport type { Action, Field } from '@wordpress/dataviews';\nimport { doAction } from '@wordpress/hooks';\nimport type { PostType } from '@wordpress/fields';\nimport {\n\tviewPost,\n\tviewPostRevisions,\n\tduplicatePost,\n\tduplicatePattern,\n\treorderPage,\n\texportPattern,\n\tpermanentlyDeletePost,\n\trestorePost,\n\ttrashPost,\n\trenamePost,\n\tresetPost,\n\tdeletePost,\n\tduplicateTemplatePart,\n\tfeaturedImageField,\n\tdateField,\n\tparentField,\n\tpasswordField,\n\tcommentStatusField,\n\tpingStatusField,\n\tdiscussionField,\n\tslugField,\n\tstatusField,\n\tauthorField,\n\ttitleField,\n\ttemplateField,\n\ttemplateTitleField,\n\tpageTitleField,\n\tpatternTitleField,\n\tnotesField,\n} from '@wordpress/fields';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport { DESIGN_POST_TYPES } from '../../store/constants';\nimport postPreviewField from '../fields/content-preview';\nimport { unlock } from '../../lock-unlock';\n\ndeclare global {\n\tinterface Window {\n\t\t__experimentalTemplateActivate?: boolean;\n\t}\n}\n\n/**\n * Check if a post type supports editor notes.\n *\n * @param supports The post type supports object.\n * @return Whether editor notes are supported.\n */\nfunction hasEditorNotesSupport( supports?: PostType[ 'supports' ] ): boolean {\n\tconst editor = supports?.editor;\n\tif ( Array.isArray( editor ) ) {\n\t\treturn !! editor[ 0 ]?.notes;\n\t}\n\treturn false;\n}\n\nexport function registerEntityAction< Item >(\n\tkind: string,\n\tname: string,\n\tconfig: Action< Item >\n) {\n\treturn {\n\t\ttype: 'REGISTER_ENTITY_ACTION' as const,\n\t\tkind,\n\t\tname,\n\t\tconfig,\n\t};\n}\n\nexport function unregisterEntityAction(\n\tkind: string,\n\tname: string,\n\tactionId: string\n) {\n\treturn {\n\t\ttype: 'UNREGISTER_ENTITY_ACTION' as const,\n\t\tkind,\n\t\tname,\n\t\tactionId,\n\t};\n}\n\nexport function registerEntityField< Item >(\n\tkind: string,\n\tname: string,\n\tconfig: Field< Item >\n) {\n\treturn {\n\t\ttype: 'REGISTER_ENTITY_FIELD' as const,\n\t\tkind,\n\t\tname,\n\t\tconfig,\n\t};\n}\n\nexport function unregisterEntityField(\n\tkind: string,\n\tname: string,\n\tfieldId: string\n) {\n\treturn {\n\t\ttype: 'UNREGISTER_ENTITY_FIELD' as const,\n\t\tkind,\n\t\tname,\n\t\tfieldId,\n\t};\n}\n\nexport function setIsReady( kind: string, name: string ) {\n\treturn {\n\t\ttype: 'SET_IS_READY' as const,\n\t\tkind,\n\t\tname,\n\t};\n}\n\nexport const registerPostTypeSchema =\n\t( postType: string ) =>\n\tasync ( { registry }: { registry: any } ) => {\n\t\tconst isReady = unlock( registry.select( editorStore ) ).isEntityReady(\n\t\t\t'postType',\n\t\t\tpostType\n\t\t);\n\t\tif ( isReady ) {\n\t\t\treturn;\n\t\t}\n\n\t\tunlock( registry.dispatch( editorStore ) ).setIsReady(\n\t\t\t'postType',\n\t\t\tpostType\n\t\t);\n\n\t\tconst postTypeConfig = ( await registry\n\t\t\t.resolveSelect( coreStore )\n\t\t\t.getPostType( postType ) ) as PostType;\n\n\t\tconst canCreate = await registry\n\t\t\t.resolveSelect( coreStore )\n\t\t\t.canUser( 'create', {\n\t\t\t\tkind: 'postType',\n\t\t\t\tname: postType,\n\t\t\t} );\n\t\tconst currentTheme = await registry\n\t\t\t.resolveSelect( coreStore )\n\t\t\t.getCurrentTheme();\n\n\t\tlet canDuplicate =\n\t\t\t! [ 'wp_block', 'wp_template_part' ].includes(\n\t\t\t\tpostTypeConfig.slug\n\t\t\t) &&\n\t\t\tcanCreate &&\n\t\t\tduplicatePost;\n\n\t\t// @ts-ignore\n\t\tif ( ! globalThis.IS_GUTENBERG_PLUGIN ) {\n\t\t\t// Outside Gutenberg, disable duplication except for wp_template.\n\t\t\tif ( 'wp_template' !== postTypeConfig.slug ) {\n\t\t\t\tcanDuplicate = undefined;\n\t\t\t}\n\t\t}\n\n\t\t// When template activation experiment is disabled, templates cannot be duplicated.\n\t\t// @ts-ignore\n\t\tif (\n\t\t\tpostTypeConfig.slug === 'wp_template' &&\n\t\t\t! window?.__experimentalTemplateActivate\n\t\t) {\n\t\t\tcanDuplicate = undefined;\n\t\t}\n\n\t\tconst actions = [\n\t\t\tpostTypeConfig.viewable ? viewPost : undefined,\n\t\t\t!! postTypeConfig.supports?.revisions\n\t\t\t\t? viewPostRevisions\n\t\t\t\t: undefined,\n\t\t\t// @ts-ignore\n\t\t\tcanDuplicate,\n\t\t\tpostTypeConfig.slug === 'wp_template_part' &&\n\t\t\tcanCreate &&\n\t\t\tcurrentTheme?.is_block_theme\n\t\t\t\t? duplicateTemplatePart\n\t\t\t\t: undefined,\n\t\t\tcanCreate && postTypeConfig.slug === 'wp_block'\n\t\t\t\t? duplicatePattern\n\t\t\t\t: undefined,\n\t\t\tpostTypeConfig.supports?.title ? renamePost : undefined,\n\t\t\tpostTypeConfig.supports?.[ 'page-attributes' ]\n\t\t\t\t? reorderPage\n\t\t\t\t: undefined,\n\t\t\tpostTypeConfig.slug === 'wp_block' ? exportPattern : undefined,\n\t\t\trestorePost,\n\t\t\tresetPost,\n\t\t\tdeletePost,\n\t\t\ttrashPost,\n\t\t\tpermanentlyDeletePost,\n\t\t].filter( Boolean );\n\n\t\
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,uBAAmC;AAEnC,mBAAyB;AAEzB,oBA8BO;AAKP,mBAAqC;AACrC,
|
|
6
|
-
"names": ["editorStore", "coreStore", "postPreviewField"]
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { store as coreStore } from '@wordpress/core-data';\nimport type { Action, Field } from '@wordpress/dataviews';\nimport { doAction } from '@wordpress/hooks';\nimport type { PostType } from '@wordpress/fields';\nimport {\n\tviewPost,\n\tviewPostRevisions,\n\tduplicatePost,\n\tduplicatePattern,\n\treorderPage,\n\texportPattern,\n\tpermanentlyDeletePost,\n\trestorePost,\n\ttrashPost,\n\trenamePost,\n\tresetPost,\n\tdeletePost,\n\tduplicateTemplatePart,\n\tfeaturedImageField,\n\tdateField,\n\tparentField,\n\tpasswordField,\n\tcommentStatusField,\n\tpingStatusField,\n\tdiscussionField,\n\tslugField,\n\tstatusField,\n\tauthorField,\n\ttitleField,\n\ttemplateField,\n\ttemplateTitleField,\n\tpageTitleField,\n\tpatternTitleField,\n\tnotesField,\n} from '@wordpress/fields';\nimport {\n\taltTextField,\n\tattachedToField,\n\tauthorField as mediaAuthorField,\n\tcaptionField,\n\tdateAddedField,\n\tdescriptionField,\n\tfilenameField,\n\tfilesizeField,\n\tmediaDimensionsField,\n\tmimeTypeField,\n} from '@wordpress/media-fields';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport { ATTACHMENT_POST_TYPE, DESIGN_POST_TYPES } from '../../store/constants';\nimport postPreviewField from '../fields/content-preview';\nimport { unlock } from '../../lock-unlock';\n\ndeclare global {\n\tinterface Window {\n\t\t__experimentalTemplateActivate?: boolean;\n\t\t__experimentalMediaEditor?: boolean;\n\t}\n}\n\n/**\n * Check if a post type supports editor notes.\n *\n * @param supports The post type supports object.\n * @return Whether editor notes are supported.\n */\nfunction hasEditorNotesSupport( supports?: PostType[ 'supports' ] ): boolean {\n\tconst editor = supports?.editor;\n\tif ( Array.isArray( editor ) ) {\n\t\treturn !! editor[ 0 ]?.notes;\n\t}\n\treturn false;\n}\n\nexport function registerEntityAction< Item >(\n\tkind: string,\n\tname: string,\n\tconfig: Action< Item >\n) {\n\treturn {\n\t\ttype: 'REGISTER_ENTITY_ACTION' as const,\n\t\tkind,\n\t\tname,\n\t\tconfig,\n\t};\n}\n\nexport function unregisterEntityAction(\n\tkind: string,\n\tname: string,\n\tactionId: string\n) {\n\treturn {\n\t\ttype: 'UNREGISTER_ENTITY_ACTION' as const,\n\t\tkind,\n\t\tname,\n\t\tactionId,\n\t};\n}\n\nexport function registerEntityField< Item >(\n\tkind: string,\n\tname: string,\n\tconfig: Field< Item >\n) {\n\treturn {\n\t\ttype: 'REGISTER_ENTITY_FIELD' as const,\n\t\tkind,\n\t\tname,\n\t\tconfig,\n\t};\n}\n\nexport function unregisterEntityField(\n\tkind: string,\n\tname: string,\n\tfieldId: string\n) {\n\treturn {\n\t\ttype: 'UNREGISTER_ENTITY_FIELD' as const,\n\t\tkind,\n\t\tname,\n\t\tfieldId,\n\t};\n}\n\nexport function setIsReady( kind: string, name: string ) {\n\treturn {\n\t\ttype: 'SET_IS_READY' as const,\n\t\tkind,\n\t\tname,\n\t};\n}\n\n/*\n * Media fields for the attachment post type.\n *\n * Field order follows a logical grouping:\n * 1. Metadata fields in panels (date, author, file info)\n * 2. Core editable fields (title, alt text, caption, description)\n *\n * Note: media_thumbnail is not included as it's shown in the canvas preview\n */\nconst ORDERED_MEDIA_FIELDS = [\n\t// Metadata in panels (collapsed by default).\n\tdateAddedField,\n\tmediaAuthorField,\n\tfilenameField,\n\tmimeTypeField,\n\tfilesizeField,\n\tmediaDimensionsField,\n\tattachedToField,\n\t// Regular layout fields (always visible).\n\ttitleField,\n\taltTextField,\n\tcaptionField,\n\tdescriptionField,\n];\n\nexport const registerPostTypeSchema =\n\t( postType: string ) =>\n\tasync ( { registry }: { registry: any } ) => {\n\t\tconst isReady = unlock( registry.select( editorStore ) ).isEntityReady(\n\t\t\t'postType',\n\t\t\tpostType\n\t\t);\n\t\tif ( isReady ) {\n\t\t\treturn;\n\t\t}\n\n\t\tunlock( registry.dispatch( editorStore ) ).setIsReady(\n\t\t\t'postType',\n\t\t\tpostType\n\t\t);\n\n\t\tconst postTypeConfig = ( await registry\n\t\t\t.resolveSelect( coreStore )\n\t\t\t.getPostType( postType ) ) as PostType;\n\n\t\tconst canCreate = await registry\n\t\t\t.resolveSelect( coreStore )\n\t\t\t.canUser( 'create', {\n\t\t\t\tkind: 'postType',\n\t\t\t\tname: postType,\n\t\t\t} );\n\t\tconst currentTheme = await registry\n\t\t\t.resolveSelect( coreStore )\n\t\t\t.getCurrentTheme();\n\n\t\tlet canDuplicate =\n\t\t\t! [ 'wp_block', 'wp_template_part' ].includes(\n\t\t\t\tpostTypeConfig.slug\n\t\t\t) &&\n\t\t\tcanCreate &&\n\t\t\tduplicatePost;\n\n\t\t// @ts-ignore\n\t\tif ( ! globalThis.IS_GUTENBERG_PLUGIN ) {\n\t\t\t// Outside Gutenberg, disable duplication except for wp_template.\n\t\t\tif ( 'wp_template' !== postTypeConfig.slug ) {\n\t\t\t\tcanDuplicate = undefined;\n\t\t\t}\n\t\t}\n\n\t\t// When template activation experiment is disabled, templates cannot be duplicated.\n\t\t// @ts-ignore\n\t\tif (\n\t\t\tpostTypeConfig.slug === 'wp_template' &&\n\t\t\t! window?.__experimentalTemplateActivate\n\t\t) {\n\t\t\tcanDuplicate = undefined;\n\t\t}\n\n\t\tconst actions = [\n\t\t\tpostTypeConfig.viewable ? viewPost : undefined,\n\t\t\t!! postTypeConfig.supports?.revisions\n\t\t\t\t? viewPostRevisions\n\t\t\t\t: undefined,\n\t\t\t// @ts-ignore\n\t\t\tcanDuplicate,\n\t\t\tpostTypeConfig.slug === 'wp_template_part' &&\n\t\t\tcanCreate &&\n\t\t\tcurrentTheme?.is_block_theme\n\t\t\t\t? duplicateTemplatePart\n\t\t\t\t: undefined,\n\t\t\tcanCreate && postTypeConfig.slug === 'wp_block'\n\t\t\t\t? duplicatePattern\n\t\t\t\t: undefined,\n\t\t\tpostTypeConfig.supports?.title ? renamePost : undefined,\n\t\t\tpostTypeConfig.supports?.[ 'page-attributes' ]\n\t\t\t\t? reorderPage\n\t\t\t\t: undefined,\n\t\t\tpostTypeConfig.slug === 'wp_block' ? exportPattern : undefined,\n\t\t\trestorePost,\n\t\t\tresetPost,\n\t\t\tdeletePost,\n\t\t\ttrashPost,\n\t\t\tpermanentlyDeletePost,\n\t\t].filter( Boolean );\n\n\t\t// Handle attachment post type separately with media-specific fields\n\t\tlet fields;\n\n\t\tif ( postType === ATTACHMENT_POST_TYPE ) {\n\t\t\tfields = ORDERED_MEDIA_FIELDS;\n\t\t} else {\n\t\t\tfields = [\n\t\t\t\tpostTypeConfig.supports?.thumbnail &&\n\t\t\t\t\tcurrentTheme?.theme_supports?.[ 'post-thumbnails' ] &&\n\t\t\t\t\tfeaturedImageField,\n\t\t\t\tpostTypeConfig.supports?.author && authorField,\n\t\t\t\tstatusField,\n\t\t\t\t! DESIGN_POST_TYPES.includes( postTypeConfig.slug ) &&\n\t\t\t\t\tdateField,\n\t\t\t\tslugField,\n\t\t\t\tpostTypeConfig.supports?.[ 'page-attributes' ] && parentField,\n\t\t\t\tpostTypeConfig.supports?.comments && commentStatusField,\n\t\t\t\tpostTypeConfig.supports?.trackbacks && pingStatusField,\n\t\t\t\t( postTypeConfig.supports?.comments ||\n\t\t\t\t\tpostTypeConfig.supports?.trackbacks ) &&\n\t\t\t\t\tdiscussionField,\n\t\t\t\ttemplateField,\n\t\t\t\tpasswordField,\n\t\t\t\tpostTypeConfig.supports?.editor &&\n\t\t\t\t\tpostTypeConfig.viewable &&\n\t\t\t\t\tpostPreviewField,\n\t\t\t\thasEditorNotesSupport( postTypeConfig.supports ) && notesField,\n\t\t\t].filter( Boolean );\n\t\t\tif ( postTypeConfig.supports?.title ) {\n\t\t\t\tlet _titleField;\n\t\t\t\tif ( postType === 'page' ) {\n\t\t\t\t\t_titleField = pageTitleField;\n\t\t\t\t} else if ( postType === 'wp_template' ) {\n\t\t\t\t\t_titleField = templateTitleField;\n\t\t\t\t} else if ( postType === 'wp_block' ) {\n\t\t\t\t\t_titleField = patternTitleField;\n\t\t\t\t} else {\n\t\t\t\t\t_titleField = titleField;\n\t\t\t\t}\n\t\t\t\tfields.push( _titleField );\n\t\t\t}\n\t\t}\n\n\t\tregistry.batch( () => {\n\t\t\tactions.forEach( ( action ) => {\n\t\t\t\tunlock( registry.dispatch( editorStore ) ).registerEntityAction(\n\t\t\t\t\t'postType',\n\t\t\t\t\tpostType,\n\t\t\t\t\taction\n\t\t\t\t);\n\t\t\t} );\n\t\t\tfields.forEach( ( field ) => {\n\t\t\t\tunlock( registry.dispatch( editorStore ) ).registerEntityField(\n\t\t\t\t\t'postType',\n\t\t\t\t\tpostType,\n\t\t\t\t\tfield\n\t\t\t\t);\n\t\t\t} );\n\t\t} );\n\n\t\tdoAction( 'core.registerPostTypeSchema', postType );\n\t};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,uBAAmC;AAEnC,mBAAyB;AAEzB,oBA8BO;AACP,0BAWO;AAKP,mBAAqC;AACrC,uBAAwD;AACxD,6BAA6B;AAC7B,yBAAuB;AAevB,SAAS,sBAAuB,UAA6C;AAC5E,QAAM,SAAS,UAAU;AACzB,MAAK,MAAM,QAAS,MAAO,GAAI;AAC9B,WAAO,CAAC,CAAE,OAAQ,CAAE,GAAG;AAAA,EACxB;AACA,SAAO;AACR;AAEO,SAAS,qBACf,MACA,MACA,QACC;AACD,SAAO;AAAA,IACN,MAAM;AAAA,IACN;AAAA,IACA;AAAA,IACA;AAAA,EACD;AACD;AAEO,SAAS,uBACf,MACA,MACA,UACC;AACD,SAAO;AAAA,IACN,MAAM;AAAA,IACN;AAAA,IACA;AAAA,IACA;AAAA,EACD;AACD;AAEO,SAAS,oBACf,MACA,MACA,QACC;AACD,SAAO;AAAA,IACN,MAAM;AAAA,IACN;AAAA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AAQ,SAAS,SAAU,aAAAF,KAAY,CAAE,EAAE;AAAA,QAC1C;AAAA,QACA;AAAA,QACA;AAAA,MACD;AAAA,IACD,CAAE;AACF,WAAO,QAAS,CAAE,UAAW;AAC5B,qCAAQ,SAAS,SAAU,aAAAA,KAAY,CAAE,EAAE;AAAA,QAC1C;AAAA,QACA;AAAA,QACA;AAAA,MACD;AAAA,IACD,CAAE;AAAA,EACH,CAAE;AAEF,6BAAU,+BAA+B,QAAS;AACnD;",
|
|
6
|
+
"names": ["mediaAuthorField", "editorStore", "coreStore", "postPreviewField"]
|
|
7
7
|
}
|
|
@@ -20,6 +20,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
20
20
|
// packages/editor/src/store/constants.ts
|
|
21
21
|
var constants_exports = {};
|
|
22
22
|
__export(constants_exports, {
|
|
23
|
+
ATTACHMENT_POST_TYPE: () => ATTACHMENT_POST_TYPE,
|
|
23
24
|
AUTOSAVE_PROPERTIES: () => AUTOSAVE_PROPERTIES,
|
|
24
25
|
DESIGN_POST_TYPES: () => DESIGN_POST_TYPES,
|
|
25
26
|
EDIT_MERGE_PROPERTIES: () => EDIT_MERGE_PROPERTIES,
|
|
@@ -46,6 +47,7 @@ var TEMPLATE_POST_TYPE = "wp_template";
|
|
|
46
47
|
var TEMPLATE_PART_POST_TYPE = "wp_template_part";
|
|
47
48
|
var PATTERN_POST_TYPE = "wp_block";
|
|
48
49
|
var NAVIGATION_POST_TYPE = "wp_navigation";
|
|
50
|
+
var ATTACHMENT_POST_TYPE = "attachment";
|
|
49
51
|
var TEMPLATE_ORIGINS = {
|
|
50
52
|
custom: "custom",
|
|
51
53
|
theme: "theme",
|
|
@@ -65,6 +67,7 @@ var DESIGN_POST_TYPES = [
|
|
|
65
67
|
];
|
|
66
68
|
// Annotate the CommonJS export names for ESM import in node:
|
|
67
69
|
0 && (module.exports = {
|
|
70
|
+
ATTACHMENT_POST_TYPE,
|
|
68
71
|
AUTOSAVE_PROPERTIES,
|
|
69
72
|
DESIGN_POST_TYPES,
|
|
70
73
|
EDIT_MERGE_PROPERTIES,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/store/constants.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * Set of post properties for which edits should assume a merging behavior,\n * assuming an object value.\n *\n * @type {Set}\n */\nexport const EDIT_MERGE_PROPERTIES = new Set( [ 'meta' ] );\n\n/**\n * Constant for the store module (or reducer) key.\n */\nexport const STORE_NAME = 'core/editor';\n\nexport const PERMALINK_POSTNAME_REGEX = /%(?:postname|pagename)%/;\nexport const ONE_MINUTE_IN_MS = 60 * 1000;\nexport const AUTOSAVE_PROPERTIES = [ 'title', 'excerpt', 'content' ];\nexport const TEMPLATE_PART_AREA_DEFAULT_CATEGORY = 'uncategorized';\nexport const TEMPLATE_POST_TYPE = 'wp_template';\nexport const TEMPLATE_PART_POST_TYPE = 'wp_template_part';\nexport const PATTERN_POST_TYPE = 'wp_block';\nexport const NAVIGATION_POST_TYPE = 'wp_navigation';\nexport const TEMPLATE_ORIGINS = {\n\tcustom: 'custom',\n\ttheme: 'theme',\n\tplugin: 'plugin',\n};\nexport const TEMPLATE_POST_TYPES = [ 'wp_template', 'wp_template_part' ];\nexport const GLOBAL_POST_TYPES = [\n\t...TEMPLATE_POST_TYPES,\n\t'wp_block',\n\t'wp_navigation',\n];\nexport const DESIGN_POST_TYPES = [\n\tTEMPLATE_POST_TYPE,\n\tTEMPLATE_PART_POST_TYPE,\n\tPATTERN_POST_TYPE,\n\tNAVIGATION_POST_TYPE,\n];\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMO,IAAM,wBAAwB,oBAAI,IAAK,CAAE,MAAO,CAAE;AAKlD,IAAM,aAAa;AAEnB,IAAM,2BAA2B;AACjC,IAAM,mBAAmB,KAAK;AAC9B,IAAM,sBAAsB,CAAE,SAAS,WAAW,SAAU;AAC5D,IAAM,sCAAsC;AAC5C,IAAM,qBAAqB;AAC3B,IAAM,0BAA0B;AAChC,IAAM,oBAAoB;AAC1B,IAAM,uBAAuB;AAC7B,IAAM,mBAAmB;AAAA,EAC/B,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,QAAQ;AACT;AACO,IAAM,sBAAsB,CAAE,eAAe,kBAAmB;AAChE,IAAM,oBAAoB;AAAA,EAChC,GAAG;AAAA,EACH;AAAA,EACA;AACD;AACO,IAAM,oBAAoB;AAAA,EAChC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD;",
|
|
4
|
+
"sourcesContent": ["/**\n * Set of post properties for which edits should assume a merging behavior,\n * assuming an object value.\n *\n * @type {Set}\n */\nexport const EDIT_MERGE_PROPERTIES = new Set( [ 'meta' ] );\n\n/**\n * Constant for the store module (or reducer) key.\n */\nexport const STORE_NAME = 'core/editor';\n\nexport const PERMALINK_POSTNAME_REGEX = /%(?:postname|pagename)%/;\nexport const ONE_MINUTE_IN_MS = 60 * 1000;\nexport const AUTOSAVE_PROPERTIES = [ 'title', 'excerpt', 'content' ];\nexport const TEMPLATE_PART_AREA_DEFAULT_CATEGORY = 'uncategorized';\nexport const TEMPLATE_POST_TYPE = 'wp_template';\nexport const TEMPLATE_PART_POST_TYPE = 'wp_template_part';\nexport const PATTERN_POST_TYPE = 'wp_block';\nexport const NAVIGATION_POST_TYPE = 'wp_navigation';\nexport const ATTACHMENT_POST_TYPE = 'attachment';\nexport const TEMPLATE_ORIGINS = {\n\tcustom: 'custom',\n\ttheme: 'theme',\n\tplugin: 'plugin',\n};\nexport const TEMPLATE_POST_TYPES = [ 'wp_template', 'wp_template_part' ];\nexport const GLOBAL_POST_TYPES = [\n\t...TEMPLATE_POST_TYPES,\n\t'wp_block',\n\t'wp_navigation',\n];\nexport const DESIGN_POST_TYPES = [\n\tTEMPLATE_POST_TYPE,\n\tTEMPLATE_PART_POST_TYPE,\n\tPATTERN_POST_TYPE,\n\tNAVIGATION_POST_TYPE,\n];\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMO,IAAM,wBAAwB,oBAAI,IAAK,CAAE,MAAO,CAAE;AAKlD,IAAM,aAAa;AAEnB,IAAM,2BAA2B;AACjC,IAAM,mBAAmB,KAAK;AAC9B,IAAM,sBAAsB,CAAE,SAAS,WAAW,SAAU;AAC5D,IAAM,sCAAsC;AAC5C,IAAM,qBAAqB;AAC3B,IAAM,0BAA0B;AAChC,IAAM,oBAAoB;AAC1B,IAAM,uBAAuB;AAC7B,IAAM,uBAAuB;AAC7B,IAAM,mBAAmB;AAAA,EAC/B,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,QAAQ;AACT;AACO,IAAM,sBAAsB,CAAE,eAAe,kBAAmB;AAChE,IAAM,oBAAoB;AAAA,EAChC,GAAG;AAAA,EACH;AAAA,EACA;AACD;AACO,IAAM,oBAAoB;AAAA,EAChC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|