@wordpress/edit-post 8.34.0 → 8.35.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/commands/use-commands.js +2 -0
- package/build/commands/use-commands.js.map +1 -1
- package/build/components/back-button/fullscreen-mode-close.js +5 -3
- package/build/components/back-button/fullscreen-mode-close.js.map +1 -1
- package/build/components/back-button/index.js +5 -3
- package/build/components/back-button/index.js.map +1 -1
- package/build/components/browser-url/index.js +2 -0
- package/build/components/browser-url/index.js.map +1 -1
- package/build/components/editor-initialization/index.js +2 -0
- package/build/components/editor-initialization/index.js.map +1 -1
- package/build/components/editor-initialization/listener-hooks.js +3 -1
- package/build/components/editor-initialization/listener-hooks.js.map +1 -1
- package/build/components/init-pattern-modal/index.js +3 -1
- package/build/components/init-pattern-modal/index.js.map +1 -1
- package/build/components/keyboard-shortcuts/index.js +2 -0
- package/build/components/keyboard-shortcuts/index.js.map +1 -1
- package/build/components/layout/index.js +12 -29
- package/build/components/layout/index.js.map +2 -2
- package/build/components/layout/use-should-iframe.js +3 -1
- package/build/components/layout/use-should-iframe.js.map +1 -1
- package/build/components/meta-boxes/index.js +3 -1
- package/build/components/meta-boxes/index.js.map +1 -1
- package/build/components/meta-boxes/meta-box-visibility.js +2 -0
- package/build/components/meta-boxes/meta-box-visibility.js.map +1 -1
- package/build/components/meta-boxes/meta-boxes-area/index.js +3 -1
- package/build/components/meta-boxes/meta-boxes-area/index.js.map +1 -1
- package/build/components/meta-boxes/use-meta-box-initialization.js +3 -1
- package/build/components/meta-boxes/use-meta-box-initialization.js.map +1 -1
- package/build/components/more-menu/index.js +5 -3
- package/build/components/more-menu/index.js.map +1 -1
- package/build/components/more-menu/manage-patterns-menu-item.js +3 -1
- package/build/components/more-menu/manage-patterns-menu-item.js.map +1 -1
- package/build/components/more-menu/welcome-guide-menu-item.js +3 -1
- package/build/components/more-menu/welcome-guide-menu-item.js.map +1 -1
- package/build/components/preferences-modal/enable-custom-fields.js +4 -2
- package/build/components/preferences-modal/enable-custom-fields.js.map +1 -1
- package/build/components/preferences-modal/enable-panel.js +4 -2
- package/build/components/preferences-modal/enable-panel.js.map +1 -1
- package/build/components/preferences-modal/index.js +5 -3
- package/build/components/preferences-modal/index.js.map +1 -1
- package/build/components/preferences-modal/meta-boxes-section.js +4 -2
- package/build/components/preferences-modal/meta-boxes-section.js.map +1 -1
- package/build/components/welcome-guide/default.js +3 -1
- package/build/components/welcome-guide/default.js.map +1 -1
- package/build/components/welcome-guide/image.js +2 -0
- package/build/components/welcome-guide/image.js.map +1 -1
- package/build/components/welcome-guide/index.js +3 -1
- package/build/components/welcome-guide/index.js.map +1 -1
- package/build/components/welcome-guide/template.js +3 -1
- package/build/components/welcome-guide/template.js.map +1 -1
- package/build/deprecated.js +6 -4
- package/build/deprecated.js.map +1 -1
- package/build/hooks/use-navigate-to-entity-record.js +2 -0
- package/build/hooks/use-navigate-to-entity-record.js.map +1 -1
- package/build/index.js +4 -2
- package/build/index.js.map +1 -1
- package/build/lock-unlock.js +3 -1
- package/build/lock-unlock.js.map +1 -1
- package/build/store/actions.js +26 -24
- package/build/store/actions.js.map +1 -1
- package/build/store/constants.js +5 -3
- package/build/store/constants.js.map +1 -1
- package/build/store/index.js +3 -1
- package/build/store/index.js.map +1 -1
- package/build/store/reducer.js +3 -1
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +27 -25
- package/build/store/selectors.js.map +1 -1
- package/build/utils/meta-boxes.js +3 -1
- package/build/utils/meta-boxes.js.map +1 -1
- package/build-module/commands/use-commands.js +1 -0
- package/build-module/commands/use-commands.js.map +1 -1
- package/build-module/components/back-button/fullscreen-mode-close.js +4 -3
- package/build-module/components/back-button/fullscreen-mode-close.js.map +1 -1
- package/build-module/components/back-button/index.js +4 -3
- package/build-module/components/back-button/index.js.map +1 -1
- package/build-module/components/browser-url/index.js +1 -0
- package/build-module/components/browser-url/index.js.map +1 -1
- package/build-module/components/editor-initialization/index.js +1 -0
- package/build-module/components/editor-initialization/index.js.map +1 -1
- package/build-module/components/editor-initialization/listener-hooks.js +2 -1
- package/build-module/components/editor-initialization/listener-hooks.js.map +1 -1
- package/build-module/components/init-pattern-modal/index.js +2 -1
- package/build-module/components/init-pattern-modal/index.js.map +1 -1
- package/build-module/components/keyboard-shortcuts/index.js +1 -0
- package/build-module/components/keyboard-shortcuts/index.js.map +1 -1
- package/build-module/components/layout/index.js +11 -29
- package/build-module/components/layout/index.js.map +2 -2
- package/build-module/components/layout/use-should-iframe.js +2 -1
- package/build-module/components/layout/use-should-iframe.js.map +1 -1
- package/build-module/components/meta-boxes/index.js +2 -1
- package/build-module/components/meta-boxes/index.js.map +1 -1
- package/build-module/components/meta-boxes/meta-box-visibility.js +1 -0
- package/build-module/components/meta-boxes/meta-box-visibility.js.map +1 -1
- package/build-module/components/meta-boxes/meta-boxes-area/index.js +2 -1
- package/build-module/components/meta-boxes/meta-boxes-area/index.js.map +1 -1
- package/build-module/components/meta-boxes/use-meta-box-initialization.js +2 -1
- package/build-module/components/meta-boxes/use-meta-box-initialization.js.map +1 -1
- package/build-module/components/more-menu/index.js +4 -3
- package/build-module/components/more-menu/index.js.map +1 -1
- package/build-module/components/more-menu/manage-patterns-menu-item.js +2 -1
- package/build-module/components/more-menu/manage-patterns-menu-item.js.map +1 -1
- package/build-module/components/more-menu/welcome-guide-menu-item.js +2 -1
- package/build-module/components/more-menu/welcome-guide-menu-item.js.map +1 -1
- package/build-module/components/preferences-modal/enable-custom-fields.js +3 -2
- package/build-module/components/preferences-modal/enable-custom-fields.js.map +1 -1
- package/build-module/components/preferences-modal/enable-panel.js +3 -2
- package/build-module/components/preferences-modal/enable-panel.js.map +1 -1
- package/build-module/components/preferences-modal/index.js +4 -3
- package/build-module/components/preferences-modal/index.js.map +1 -1
- package/build-module/components/preferences-modal/meta-boxes-section.js +3 -2
- package/build-module/components/preferences-modal/meta-boxes-section.js.map +1 -1
- package/build-module/components/welcome-guide/default.js +2 -1
- package/build-module/components/welcome-guide/default.js.map +1 -1
- package/build-module/components/welcome-guide/image.js +1 -0
- package/build-module/components/welcome-guide/image.js.map +1 -1
- package/build-module/components/welcome-guide/index.js +2 -1
- package/build-module/components/welcome-guide/index.js.map +1 -1
- package/build-module/components/welcome-guide/template.js +2 -1
- package/build-module/components/welcome-guide/template.js.map +1 -1
- package/build-module/deprecated.js +5 -4
- package/build-module/deprecated.js.map +1 -1
- package/build-module/hooks/use-navigate-to-entity-record.js +1 -0
- package/build-module/hooks/use-navigate-to-entity-record.js.map +1 -1
- package/build-module/index.js +6 -5
- package/build-module/index.js.map +1 -1
- package/build-module/lock-unlock.js +2 -1
- package/build-module/lock-unlock.js.map +1 -1
- package/build-module/store/actions.js +25 -24
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/constants.js +4 -3
- package/build-module/store/constants.js.map +1 -1
- package/build-module/store/index.js +2 -1
- package/build-module/store/index.js.map +1 -1
- package/build-module/store/reducer.js +2 -1
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +26 -25
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/utils/meta-boxes.js +2 -1
- package/build-module/utils/meta-boxes.js.map +1 -1
- package/package.json +33 -33
- package/src/components/layout/index.js +5 -30
- package/build/components/layout/use-padding-appender.js +0 -72
- package/build/components/layout/use-padding-appender.js.map +0 -7
- package/build-module/components/layout/use-padding-appender.js +0 -49
- package/build-module/components/layout/use-padding-appender.js.map +0 -7
- package/src/components/layout/use-padding-appender.js +0 -70
package/build/store/selectors.js
CHANGED
|
@@ -25,6 +25,8 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
25
25
|
mod
|
|
26
26
|
));
|
|
27
27
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// packages/edit-post/src/store/selectors.js
|
|
28
30
|
var selectors_exports = {};
|
|
29
31
|
__export(selectors_exports, {
|
|
30
32
|
__experimentalGetInsertionPoint: () => __experimentalGetInsertionPoint,
|
|
@@ -63,13 +65,13 @@ var import_core_data = require("@wordpress/core-data");
|
|
|
63
65
|
var import_editor = require("@wordpress/editor");
|
|
64
66
|
var import_deprecated = __toESM(require("@wordpress/deprecated"));
|
|
65
67
|
var import_lock_unlock = require("../lock-unlock");
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
68
|
+
var { interfaceStore } = (0, import_lock_unlock.unlock)(import_editor.privateApis);
|
|
69
|
+
var EMPTY_ARRAY = [];
|
|
70
|
+
var EMPTY_OBJECT = {};
|
|
71
|
+
var getEditorMode = (0, import_data.createRegistrySelector)(
|
|
70
72
|
(select) => () => select(import_preferences.store).get("core", "editorMode") ?? "visual"
|
|
71
73
|
);
|
|
72
|
-
|
|
74
|
+
var isEditorSidebarOpened = (0, import_data.createRegistrySelector)(
|
|
73
75
|
(select) => () => {
|
|
74
76
|
const activeGeneralSidebar = select(interfaceStore).getActiveComplementaryArea("core");
|
|
75
77
|
return ["edit-post/document", "edit-post/block"].includes(
|
|
@@ -77,7 +79,7 @@ const isEditorSidebarOpened = (0, import_data.createRegistrySelector)(
|
|
|
77
79
|
);
|
|
78
80
|
}
|
|
79
81
|
);
|
|
80
|
-
|
|
82
|
+
var isPluginSidebarOpened = (0, import_data.createRegistrySelector)(
|
|
81
83
|
(select) => () => {
|
|
82
84
|
const activeGeneralSidebar = select(interfaceStore).getActiveComplementaryArea("core");
|
|
83
85
|
return !!activeGeneralSidebar && !["edit-post/document", "edit-post/block"].includes(
|
|
@@ -85,7 +87,7 @@ const isPluginSidebarOpened = (0, import_data.createRegistrySelector)(
|
|
|
85
87
|
);
|
|
86
88
|
}
|
|
87
89
|
);
|
|
88
|
-
|
|
90
|
+
var getActiveGeneralSidebarName = (0, import_data.createRegistrySelector)(
|
|
89
91
|
(select) => () => {
|
|
90
92
|
return select(interfaceStore).getActiveComplementaryArea("core");
|
|
91
93
|
}
|
|
@@ -112,7 +114,7 @@ function convertPanelsToOldFormat(inactivePanels, openPanels) {
|
|
|
112
114
|
}, panelsWithEnabledState ?? {});
|
|
113
115
|
return panels ?? panelsWithEnabledState ?? EMPTY_OBJECT;
|
|
114
116
|
}
|
|
115
|
-
|
|
117
|
+
var getPreferences = (0, import_data.createRegistrySelector)((select) => () => {
|
|
116
118
|
(0, import_deprecated.default)(`select( 'core/edit-post' ).getPreferences`, {
|
|
117
119
|
since: "6.0",
|
|
118
120
|
alternative: `select( 'core/preferences' ).get`
|
|
@@ -150,10 +152,10 @@ function getPreference(state, preferenceKey, defaultValue) {
|
|
|
150
152
|
const value = preferences[preferenceKey];
|
|
151
153
|
return value === void 0 ? defaultValue : value;
|
|
152
154
|
}
|
|
153
|
-
|
|
155
|
+
var getHiddenBlockTypes = (0, import_data.createRegistrySelector)((select) => () => {
|
|
154
156
|
return select(import_preferences.store).get("core", "hiddenBlockTypes") ?? EMPTY_ARRAY;
|
|
155
157
|
});
|
|
156
|
-
|
|
158
|
+
var isPublishSidebarOpened = (0, import_data.createRegistrySelector)(
|
|
157
159
|
(select) => () => {
|
|
158
160
|
(0, import_deprecated.default)(`select( 'core/edit-post' ).isPublishSidebarOpened`, {
|
|
159
161
|
since: "6.6",
|
|
@@ -162,7 +164,7 @@ const isPublishSidebarOpened = (0, import_data.createRegistrySelector)(
|
|
|
162
164
|
return select(import_editor.store).isPublishSidebarOpened();
|
|
163
165
|
}
|
|
164
166
|
);
|
|
165
|
-
|
|
167
|
+
var isEditorPanelRemoved = (0, import_data.createRegistrySelector)(
|
|
166
168
|
(select) => (state, panelName) => {
|
|
167
169
|
(0, import_deprecated.default)(`select( 'core/edit-post' ).isEditorPanelRemoved`, {
|
|
168
170
|
since: "6.5",
|
|
@@ -171,7 +173,7 @@ const isEditorPanelRemoved = (0, import_data.createRegistrySelector)(
|
|
|
171
173
|
return select(import_editor.store).isEditorPanelRemoved(panelName);
|
|
172
174
|
}
|
|
173
175
|
);
|
|
174
|
-
|
|
176
|
+
var isEditorPanelEnabled = (0, import_data.createRegistrySelector)(
|
|
175
177
|
(select) => (state, panelName) => {
|
|
176
178
|
(0, import_deprecated.default)(`select( 'core/edit-post' ).isEditorPanelEnabled`, {
|
|
177
179
|
since: "6.5",
|
|
@@ -180,7 +182,7 @@ const isEditorPanelEnabled = (0, import_data.createRegistrySelector)(
|
|
|
180
182
|
return select(import_editor.store).isEditorPanelEnabled(panelName);
|
|
181
183
|
}
|
|
182
184
|
);
|
|
183
|
-
|
|
185
|
+
var isEditorPanelOpened = (0, import_data.createRegistrySelector)(
|
|
184
186
|
(select) => (state, panelName) => {
|
|
185
187
|
(0, import_deprecated.default)(`select( 'core/edit-post' ).isEditorPanelOpened`, {
|
|
186
188
|
since: "6.5",
|
|
@@ -189,7 +191,7 @@ const isEditorPanelOpened = (0, import_data.createRegistrySelector)(
|
|
|
189
191
|
return select(import_editor.store).isEditorPanelOpened(panelName);
|
|
190
192
|
}
|
|
191
193
|
);
|
|
192
|
-
|
|
194
|
+
var isModalActive = (0, import_data.createRegistrySelector)(
|
|
193
195
|
(select) => (state, modalName) => {
|
|
194
196
|
(0, import_deprecated.default)(`select( 'core/edit-post' ).isModalActive`, {
|
|
195
197
|
since: "6.3",
|
|
@@ -198,17 +200,17 @@ const isModalActive = (0, import_data.createRegistrySelector)(
|
|
|
198
200
|
return !!select(interfaceStore).isModalActive(modalName);
|
|
199
201
|
}
|
|
200
202
|
);
|
|
201
|
-
|
|
203
|
+
var isFeatureActive = (0, import_data.createRegistrySelector)(
|
|
202
204
|
(select) => (state, feature) => {
|
|
203
205
|
return !!select(import_preferences.store).get("core/edit-post", feature);
|
|
204
206
|
}
|
|
205
207
|
);
|
|
206
|
-
|
|
208
|
+
var isPluginItemPinned = (0, import_data.createRegistrySelector)(
|
|
207
209
|
(select) => (state, pluginName) => {
|
|
208
210
|
return select(interfaceStore).isItemPinned("core", pluginName);
|
|
209
211
|
}
|
|
210
212
|
);
|
|
211
|
-
|
|
213
|
+
var getActiveMetaBoxLocations = (0, import_data.createSelector)(
|
|
212
214
|
(state) => {
|
|
213
215
|
return Object.keys(state.metaBoxes.locations).filter(
|
|
214
216
|
(location) => isMetaBoxLocationActive(state, location)
|
|
@@ -216,7 +218,7 @@ const getActiveMetaBoxLocations = (0, import_data.createSelector)(
|
|
|
216
218
|
},
|
|
217
219
|
(state) => [state.metaBoxes.locations]
|
|
218
220
|
);
|
|
219
|
-
|
|
221
|
+
var isMetaBoxLocationVisible = (0, import_data.createRegistrySelector)(
|
|
220
222
|
(select) => (state, location) => {
|
|
221
223
|
return isMetaBoxLocationActive(state, location) && getMetaBoxesPerLocation(state, location)?.some(({ id }) => {
|
|
222
224
|
return select(import_editor.store).isEditorPanelEnabled(
|
|
@@ -232,7 +234,7 @@ function isMetaBoxLocationActive(state, location) {
|
|
|
232
234
|
function getMetaBoxesPerLocation(state, location) {
|
|
233
235
|
return state.metaBoxes.locations[location];
|
|
234
236
|
}
|
|
235
|
-
|
|
237
|
+
var getAllMetaBoxes = (0, import_data.createSelector)(
|
|
236
238
|
(state) => {
|
|
237
239
|
return Object.values(state.metaBoxes.locations).flat();
|
|
238
240
|
},
|
|
@@ -244,7 +246,7 @@ function hasMetaBoxes(state) {
|
|
|
244
246
|
function isSavingMetaBoxes(state) {
|
|
245
247
|
return state.metaBoxes.isSaving;
|
|
246
248
|
}
|
|
247
|
-
|
|
249
|
+
var __experimentalGetPreviewDeviceType = (0, import_data.createRegistrySelector)(
|
|
248
250
|
(select) => () => {
|
|
249
251
|
(0, import_deprecated.default)(
|
|
250
252
|
`select( 'core/edit-site' ).__experimentalGetPreviewDeviceType`,
|
|
@@ -257,14 +259,14 @@ const __experimentalGetPreviewDeviceType = (0, import_data.createRegistrySelecto
|
|
|
257
259
|
return select(import_editor.store).getDeviceType();
|
|
258
260
|
}
|
|
259
261
|
);
|
|
260
|
-
|
|
262
|
+
var isInserterOpened = (0, import_data.createRegistrySelector)((select) => () => {
|
|
261
263
|
(0, import_deprecated.default)(`select( 'core/edit-post' ).isInserterOpened`, {
|
|
262
264
|
since: "6.5",
|
|
263
265
|
alternative: `select( 'core/editor' ).isInserterOpened`
|
|
264
266
|
});
|
|
265
267
|
return select(import_editor.store).isInserterOpened();
|
|
266
268
|
});
|
|
267
|
-
|
|
269
|
+
var __experimentalGetInsertionPoint = (0, import_data.createRegistrySelector)(
|
|
268
270
|
(select) => () => {
|
|
269
271
|
(0, import_deprecated.default)(
|
|
270
272
|
`select( 'core/edit-post' ).__experimentalGetInsertionPoint`,
|
|
@@ -276,14 +278,14 @@ const __experimentalGetInsertionPoint = (0, import_data.createRegistrySelector)(
|
|
|
276
278
|
return (0, import_lock_unlock.unlock)(select(import_editor.store)).getInserter();
|
|
277
279
|
}
|
|
278
280
|
);
|
|
279
|
-
|
|
281
|
+
var isListViewOpened = (0, import_data.createRegistrySelector)((select) => () => {
|
|
280
282
|
(0, import_deprecated.default)(`select( 'core/edit-post' ).isListViewOpened`, {
|
|
281
283
|
since: "6.5",
|
|
282
284
|
alternative: `select( 'core/editor' ).isListViewOpened`
|
|
283
285
|
});
|
|
284
286
|
return select(import_editor.store).isListViewOpened();
|
|
285
287
|
});
|
|
286
|
-
|
|
288
|
+
var isEditingTemplate = (0, import_data.createRegistrySelector)((select) => () => {
|
|
287
289
|
(0, import_deprecated.default)(`select( 'core/edit-post' ).isEditingTemplate`, {
|
|
288
290
|
since: "6.5",
|
|
289
291
|
alternative: `select( 'core/editor' ).getRenderingMode`
|
|
@@ -293,7 +295,7 @@ const isEditingTemplate = (0, import_data.createRegistrySelector)((select) => ()
|
|
|
293
295
|
function areMetaBoxesInitialized(state) {
|
|
294
296
|
return state.metaBoxes.initialized;
|
|
295
297
|
}
|
|
296
|
-
|
|
298
|
+
var getEditedPostTemplate = (0, import_data.createRegistrySelector)(
|
|
297
299
|
(select) => () => {
|
|
298
300
|
const { id: postId, type: postType } = select(import_editor.store).getCurrentPost();
|
|
299
301
|
const templateId = (0, import_lock_unlock.unlock)(select(import_core_data.store)).getTemplateId(
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/store/selectors.js"],
|
|
4
4
|
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { createSelector, createRegistrySelector } from '@wordpress/data';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { store as coreStore } from '@wordpress/core-data';\nimport {\n\tstore as editorStore,\n\tprivateApis as editorPrivateApis,\n} from '@wordpress/editor';\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../lock-unlock';\nconst { interfaceStore } = unlock( editorPrivateApis );\nconst EMPTY_ARRAY = [];\nconst EMPTY_OBJECT = {};\n\n/**\n * Returns the current editing mode.\n *\n * @param {Object} state Global application state.\n *\n * @return {string} Editing mode.\n */\nexport const getEditorMode = createRegistrySelector(\n\t( select ) => () =>\n\t\tselect( preferencesStore ).get( 'core', 'editorMode' ) ?? 'visual'\n);\n\n/**\n * Returns true if the editor sidebar is opened.\n *\n * @param {Object} state Global application state\n *\n * @return {boolean} Whether the editor sidebar is opened.\n */\nexport const isEditorSidebarOpened = createRegistrySelector(\n\t( select ) => () => {\n\t\tconst activeGeneralSidebar =\n\t\t\tselect( interfaceStore ).getActiveComplementaryArea( 'core' );\n\t\treturn [ 'edit-post/document', 'edit-post/block' ].includes(\n\t\t\tactiveGeneralSidebar\n\t\t);\n\t}\n);\n\n/**\n * Returns true if the plugin sidebar is opened.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether the plugin sidebar is opened.\n */\nexport const isPluginSidebarOpened = createRegistrySelector(\n\t( select ) => () => {\n\t\tconst activeGeneralSidebar =\n\t\t\tselect( interfaceStore ).getActiveComplementaryArea( 'core' );\n\t\treturn (\n\t\t\t!! activeGeneralSidebar &&\n\t\t\t! [ 'edit-post/document', 'edit-post/block' ].includes(\n\t\t\t\tactiveGeneralSidebar\n\t\t\t)\n\t\t);\n\t}\n);\n\n/**\n * Returns the current active general sidebar name, or null if there is no\n * general sidebar active. The active general sidebar is a unique name to\n * identify either an editor or plugin sidebar.\n *\n * Examples:\n *\n * - `edit-post/document`\n * - `my-plugin/insert-image-sidebar`\n *\n * @param {Object} state Global application state.\n *\n * @return {?string} Active general sidebar name.\n */\nexport const getActiveGeneralSidebarName = createRegistrySelector(\n\t( select ) => () => {\n\t\treturn select( interfaceStore ).getActiveComplementaryArea( 'core' );\n\t}\n);\n\n/**\n * Converts panels from the new preferences store format to the old format\n * that the post editor previously used.\n *\n * The resultant converted data should look like this:\n * {\n * panelName: {\n * enabled: false,\n * opened: true,\n * },\n * anotherPanelName: {\n * opened: true\n * },\n * }\n *\n * @param {string[] | undefined} inactivePanels An array of inactive panel names.\n * @param {string[] | undefined} openPanels An array of open panel names.\n *\n * @return {Object} The converted panel data.\n */\nfunction convertPanelsToOldFormat( inactivePanels, openPanels ) {\n\t// First reduce the inactive panels.\n\tconst panelsWithEnabledState = inactivePanels?.reduce(\n\t\t( accumulatedPanels, panelName ) => ( {\n\t\t\t...accumulatedPanels,\n\t\t\t[ panelName ]: {\n\t\t\t\tenabled: false,\n\t\t\t},\n\t\t} ),\n\t\t{}\n\t);\n\n\t// Then reduce the open panels, passing in the result of the previous\n\t// reduction as the initial value so that both open and inactive\n\t// panel state is combined.\n\tconst panels = openPanels?.reduce( ( accumulatedPanels, panelName ) => {\n\t\tconst currentPanelState = accumulatedPanels?.[ panelName ];\n\t\treturn {\n\t\t\t...accumulatedPanels,\n\t\t\t[ panelName ]: {\n\t\t\t\t...currentPanelState,\n\t\t\t\topened: true,\n\t\t\t},\n\t\t};\n\t}, panelsWithEnabledState ?? {} );\n\n\t// The panels variable will only be set if openPanels wasn't `undefined`.\n\t// If it isn't set just return `panelsWithEnabledState`, and if that isn't\n\t// set return an empty object.\n\treturn panels ?? panelsWithEnabledState ?? EMPTY_OBJECT;\n}\n\n/**\n * Returns the preferences (these preferences are persisted locally).\n *\n * @param {Object} state Global application state.\n *\n * @return {Object} Preferences Object.\n */\nexport const getPreferences = createRegistrySelector( ( select ) => () => {\n\tdeprecated( `select( 'core/edit-post' ).getPreferences`, {\n\t\tsince: '6.0',\n\t\talternative: `select( 'core/preferences' ).get`,\n\t} );\n\n\tconst corePreferences = [ 'editorMode', 'hiddenBlockTypes' ].reduce(\n\t\t( accumulatedPrefs, preferenceKey ) => {\n\t\t\tconst value = select( preferencesStore ).get(\n\t\t\t\t'core',\n\t\t\t\tpreferenceKey\n\t\t\t);\n\n\t\t\treturn {\n\t\t\t\t...accumulatedPrefs,\n\t\t\t\t[ preferenceKey ]: value,\n\t\t\t};\n\t\t},\n\t\t{}\n\t);\n\n\t// Panels were a preference, but the data structure changed when the state\n\t// was migrated to the preferences store. They need to be converted from\n\t// the new preferences store format to old format to ensure no breaking\n\t// changes for plugins.\n\tconst inactivePanels = select( preferencesStore ).get(\n\t\t'core',\n\t\t'inactivePanels'\n\t);\n\tconst openPanels = select( preferencesStore ).get( 'core', 'openPanels' );\n\tconst panels = convertPanelsToOldFormat( inactivePanels, openPanels );\n\n\treturn {\n\t\t...corePreferences,\n\t\tpanels,\n\t};\n} );\n\n/**\n *\n * @param {Object} state Global application state.\n * @param {string} preferenceKey Preference Key.\n * @param {*} defaultValue Default Value.\n *\n * @return {*} Preference Value.\n */\nexport function getPreference( state, preferenceKey, defaultValue ) {\n\tdeprecated( `select( 'core/edit-post' ).getPreference`, {\n\t\tsince: '6.0',\n\t\talternative: `select( 'core/preferences' ).get`,\n\t} );\n\n\t// Avoid using the `getPreferences` registry selector where possible.\n\tconst preferences = getPreferences( state );\n\tconst value = preferences[ preferenceKey ];\n\treturn value === undefined ? defaultValue : value;\n}\n\n/**\n * Returns an array of blocks that are hidden.\n *\n * @return {Array} A list of the hidden block types\n */\nexport const getHiddenBlockTypes = createRegistrySelector( ( select ) => () => {\n\treturn (\n\t\tselect( preferencesStore ).get( 'core', 'hiddenBlockTypes' ) ??\n\t\tEMPTY_ARRAY\n\t);\n} );\n\n/**\n * Returns true if the publish sidebar is opened.\n *\n * @deprecated\n *\n * @param {Object} state Global application state\n *\n * @return {boolean} Whether the publish sidebar is open.\n */\nexport const isPublishSidebarOpened = createRegistrySelector(\n\t( select ) => () => {\n\t\tdeprecated( `select( 'core/edit-post' ).isPublishSidebarOpened`, {\n\t\t\tsince: '6.6',\n\t\t\talternative: `select( 'core/editor' ).isPublishSidebarOpened`,\n\t\t} );\n\t\treturn select( editorStore ).isPublishSidebarOpened();\n\t}\n);\n\n/**\n * Returns true if the given panel was programmatically removed, or false otherwise.\n * All panels are not removed by default.\n *\n * @deprecated\n *\n * @param {Object} state Global application state.\n * @param {string} panelName A string that identifies the panel.\n *\n * @return {boolean} Whether or not the panel is removed.\n */\nexport const isEditorPanelRemoved = createRegistrySelector(\n\t( select ) => ( state, panelName ) => {\n\t\tdeprecated( `select( 'core/edit-post' ).isEditorPanelRemoved`, {\n\t\t\tsince: '6.5',\n\t\t\talternative: `select( 'core/editor' ).isEditorPanelRemoved`,\n\t\t} );\n\t\treturn select( editorStore ).isEditorPanelRemoved( panelName );\n\t}\n);\n\n/**\n * Returns true if the given panel is enabled, or false otherwise. Panels are\n * enabled by default.\n *\n * @deprecated\n *\n * @param {Object} state Global application state.\n * @param {string} panelName A string that identifies the panel.\n *\n * @return {boolean} Whether or not the panel is enabled.\n */\nexport const isEditorPanelEnabled = createRegistrySelector(\n\t( select ) => ( state, panelName ) => {\n\t\tdeprecated( `select( 'core/edit-post' ).isEditorPanelEnabled`, {\n\t\t\tsince: '6.5',\n\t\t\talternative: `select( 'core/editor' ).isEditorPanelEnabled`,\n\t\t} );\n\t\treturn select( editorStore ).isEditorPanelEnabled( panelName );\n\t}\n);\n\n/**\n * Returns true if the given panel is open, or false otherwise. Panels are\n * closed by default.\n *\n * @deprecated\n *\n * @param {Object} state Global application state.\n * @param {string} panelName A string that identifies the panel.\n *\n * @return {boolean} Whether or not the panel is open.\n */\nexport const isEditorPanelOpened = createRegistrySelector(\n\t( select ) => ( state, panelName ) => {\n\t\tdeprecated( `select( 'core/edit-post' ).isEditorPanelOpened`, {\n\t\t\tsince: '6.5',\n\t\t\talternative: `select( 'core/editor' ).isEditorPanelOpened`,\n\t\t} );\n\t\treturn select( editorStore ).isEditorPanelOpened( panelName );\n\t}\n);\n\n/**\n * Returns true if a modal is active, or false otherwise.\n *\n * @deprecated since WP 6.3 use `core/interface` store's selector with the same name instead.\n *\n * @param {Object} state Global application state.\n * @param {string} modalName A string that uniquely identifies the modal.\n *\n * @return {boolean} Whether the modal is active.\n */\nexport const isModalActive = createRegistrySelector(\n\t( select ) => ( state, modalName ) => {\n\t\tdeprecated( `select( 'core/edit-post' ).isModalActive`, {\n\t\t\tsince: '6.3',\n\t\t\talternative: `select( 'core/interface' ).isModalActive`,\n\t\t} );\n\t\treturn !! select( interfaceStore ).isModalActive( modalName );\n\t}\n);\n\n/**\n * Returns whether the given feature is enabled or not.\n *\n * @param {Object} state Global application state.\n * @param {string} feature Feature slug.\n *\n * @return {boolean} Is active.\n */\nexport const isFeatureActive = createRegistrySelector(\n\t( select ) => ( state, feature ) => {\n\t\treturn !! select( preferencesStore ).get( 'core/edit-post', feature );\n\t}\n);\n\n/**\n * Returns true if the plugin item is pinned to the header.\n * When the value is not set it defaults to true.\n *\n * @param {Object} state Global application state.\n * @param {string} pluginName Plugin item name.\n *\n * @return {boolean} Whether the plugin item is pinned.\n */\nexport const isPluginItemPinned = createRegistrySelector(\n\t( select ) => ( state, pluginName ) => {\n\t\treturn select( interfaceStore ).isItemPinned( 'core', pluginName );\n\t}\n);\n\n/**\n * Returns an array of active meta box locations.\n *\n * @param {Object} state Post editor state.\n *\n * @return {string[]} Active meta box locations.\n */\nexport const getActiveMetaBoxLocations = createSelector(\n\t( state ) => {\n\t\treturn Object.keys( state.metaBoxes.locations ).filter( ( location ) =>\n\t\t\tisMetaBoxLocationActive( state, location )\n\t\t);\n\t},\n\t( state ) => [ state.metaBoxes.locations ]\n);\n\n/**\n * Returns true if a metabox location is active and visible\n *\n * @param {Object} state Post editor state.\n * @param {string} location Meta box location to test.\n *\n * @return {boolean} Whether the meta box location is active and visible.\n */\nexport const isMetaBoxLocationVisible = createRegistrySelector(\n\t( select ) => ( state, location ) => {\n\t\treturn (\n\t\t\tisMetaBoxLocationActive( state, location ) &&\n\t\t\tgetMetaBoxesPerLocation( state, location )?.some( ( { id } ) => {\n\t\t\t\treturn select( editorStore ).isEditorPanelEnabled(\n\t\t\t\t\t`meta-box-${ id }`\n\t\t\t\t);\n\t\t\t} )\n\t\t);\n\t}\n);\n\n/**\n * Returns true if there is an active meta box in the given location, or false\n * otherwise.\n *\n * @param {Object} state Post editor state.\n * @param {string} location Meta box location to test.\n *\n * @return {boolean} Whether the meta box location is active.\n */\nexport function isMetaBoxLocationActive( state, location ) {\n\tconst metaBoxes = getMetaBoxesPerLocation( state, location );\n\treturn !! metaBoxes && metaBoxes.length !== 0;\n}\n\n/**\n * Returns the list of all the available meta boxes for a given location.\n *\n * @param {Object} state Global application state.\n * @param {string} location Meta box location to test.\n *\n * @return {?Array} List of meta boxes.\n */\nexport function getMetaBoxesPerLocation( state, location ) {\n\treturn state.metaBoxes.locations[ location ];\n}\n\n/**\n * Returns the list of all the available meta boxes.\n *\n * @param {Object} state Global application state.\n *\n * @return {Array} List of meta boxes.\n */\nexport const getAllMetaBoxes = createSelector(\n\t( state ) => {\n\t\treturn Object.values( state.metaBoxes.locations ).flat();\n\t},\n\t( state ) => [ state.metaBoxes.locations ]\n);\n\n/**\n * Returns true if the post is using Meta Boxes\n *\n * @param {Object} state Global application state\n *\n * @return {boolean} Whether there are metaboxes or not.\n */\nexport function hasMetaBoxes( state ) {\n\treturn getActiveMetaBoxLocations( state ).length > 0;\n}\n\n/**\n * Returns true if the Meta Boxes are being saved.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether the metaboxes are being saved.\n */\nexport function isSavingMetaBoxes( state ) {\n\treturn state.metaBoxes.isSaving;\n}\n\n/**\n * Returns the current editing canvas device type.\n *\n * @deprecated\n *\n * @param {Object} state Global application state.\n *\n * @return {string} Device type.\n */\nexport const __experimentalGetPreviewDeviceType = createRegistrySelector(\n\t( select ) => () => {\n\t\tdeprecated(\n\t\t\t`select( 'core/edit-site' ).__experimentalGetPreviewDeviceType`,\n\t\t\t{\n\t\t\t\tsince: '6.5',\n\t\t\t\tversion: '6.7',\n\t\t\t\talternative: `select( 'core/editor' ).getDeviceType`,\n\t\t\t}\n\t\t);\n\t\treturn select( editorStore ).getDeviceType();\n\t}\n);\n\n/**\n * Returns true if the inserter is opened.\n *\n * @deprecated\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether the inserter is opened.\n */\nexport const isInserterOpened = createRegistrySelector( ( select ) => () => {\n\tdeprecated( `select( 'core/edit-post' ).isInserterOpened`, {\n\t\tsince: '6.5',\n\t\talternative: `select( 'core/editor' ).isInserterOpened`,\n\t} );\n\treturn select( editorStore ).isInserterOpened();\n} );\n\n/**\n * Get the insertion point for the inserter.\n *\n * @deprecated\n *\n * @param {Object} state Global application state.\n *\n * @return {Object} The root client ID, index to insert at and starting filter value.\n */\nexport const __experimentalGetInsertionPoint = createRegistrySelector(\n\t( select ) => () => {\n\t\tdeprecated(\n\t\t\t`select( 'core/edit-post' ).__experimentalGetInsertionPoint`,\n\t\t\t{\n\t\t\t\tsince: '6.5',\n\t\t\t\tversion: '6.7',\n\t\t\t}\n\t\t);\n\t\treturn unlock( select( editorStore ) ).getInserter();\n\t}\n);\n\n/**\n * Returns true if the list view is opened.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether the list view is opened.\n */\nexport const isListViewOpened = createRegistrySelector( ( select ) => () => {\n\tdeprecated( `select( 'core/edit-post' ).isListViewOpened`, {\n\t\tsince: '6.5',\n\t\talternative: `select( 'core/editor' ).isListViewOpened`,\n\t} );\n\treturn select( editorStore ).isListViewOpened();\n} );\n\n/**\n * Returns true if the template editing mode is enabled.\n *\n * @deprecated\n */\nexport const isEditingTemplate = createRegistrySelector( ( select ) => () => {\n\tdeprecated( `select( 'core/edit-post' ).isEditingTemplate`, {\n\t\tsince: '6.5',\n\t\talternative: `select( 'core/editor' ).getRenderingMode`,\n\t} );\n\treturn select( editorStore ).getCurrentPostType() === 'wp_template';\n} );\n\n/**\n * Returns true if meta boxes are initialized.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether meta boxes are initialized.\n */\nexport function areMetaBoxesInitialized( state ) {\n\treturn state.metaBoxes.initialized;\n}\n\n/**\n * Retrieves the template of the currently edited post.\n *\n * @return {?Object} Post Template.\n */\nexport const getEditedPostTemplate = createRegistrySelector(\n\t( select ) => () => {\n\t\tconst { id: postId, type: postType } =\n\t\t\tselect( editorStore ).getCurrentPost();\n\t\tconst templateId = unlock( select( coreStore ) ).getTemplateId(\n\t\t\tpostType,\n\t\t\tpostId\n\t\t);\n\t\tif ( ! templateId ) {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn select( coreStore ).getEditedEntityRecord(\n\t\t\t'postType',\n\t\t\t'wp_template',\n\t\t\ttemplateId\n\t\t);\n\t}\n);\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAuD;AACvD,yBAA0C;AAC1C,uBAAmC;AACnC,oBAGO;AACP,wBAAuB;AAKvB,yBAAuB;AACvB,IAAM,EAAE,eAAe,QAAI,2BAAQ,cAAAA,WAAkB;AACrD,IAAM,cAAc,CAAC;AACrB,IAAM,eAAe,CAAC;AASf,IAAM,oBAAgB;AAAA,EAC5B,CAAE,WAAY,MACb,OAAQ,mBAAAC,KAAiB,EAAE,IAAK,QAAQ,YAAa,KAAK;AAC5D;AASO,IAAM,4BA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BAAmB,oCAAwB,CAAE,WAAY,MAAM;AAC3E,wBAAAD,SAAY,+CAA+C;AAAA,IAC1D,OAAO;AAAA,IACP,aAAa;AAAA,EACd,CAAE;AACF,SAAO,OAAQ,cAAAC,KAAY,EAAE,iBAAiB;AAC/C,CAAE;AAOK,IAAM,wBAAoB,oCAAwB,CAAE,WAAY,MAAM;AAC5E,wBAAAD,SAAY,gDAAgD;AAAA,IAC3D,OAAO;AAAA,IACP,aAAa;AAAA,EACd,CAAE;AACF,SAAO,OAAQ,cAAAC,KAAY,EAAE,mBAAmB,MAAM;AACvD,CAAE;AASK,SAAS,wBAAyB,OAAQ;AAChD,SAAO,MAAM,UAAU;AACxB;AAOO,IAAM,4BAAwB;AAAA,EACpC,CAAE,WAAY,MAAM;AACnB,UAAM,EAAE,IAAI,QAAQ,MAAM,SAAS,IAClC,OAAQ,cAAAA,KAAY,EAAE,eAAe;AACtC,UAAM,iBAAa,2BAAQ,OAAQ,iBAAAC,KAAU,CAAE,EAAE;AAAA,MAChD;AAAA,MACA;AAAA,IACD;AACA,QAAK,CAAE,YAAa;AACnB,aAAO;AAAA,IACR;AACA,WAAO,OAAQ,iBAAAA,KAAU,EAAE;AAAA,MAC1B;AAAA,MACA;AAAA,MACA;AAAA,IACD;AAAA,EACD;AACD;",
|
|
6
6
|
"names": ["editorPrivateApis", "preferencesStore", "deprecated", "editorStore", "coreStore"]
|
|
7
7
|
}
|
|
@@ -15,12 +15,14 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
15
15
|
return to;
|
|
16
16
|
};
|
|
17
17
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// packages/edit-post/src/utils/meta-boxes.js
|
|
18
20
|
var meta_boxes_exports = {};
|
|
19
21
|
__export(meta_boxes_exports, {
|
|
20
22
|
getMetaBoxContainer: () => getMetaBoxContainer
|
|
21
23
|
});
|
|
22
24
|
module.exports = __toCommonJS(meta_boxes_exports);
|
|
23
|
-
|
|
25
|
+
var getMetaBoxContainer = (location) => {
|
|
24
26
|
const area = document.querySelector(
|
|
25
27
|
`.edit-post-meta-boxes-area.is-${location} .metabox-location-${location}`
|
|
26
28
|
);
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/utils/meta-boxes.js"],
|
|
4
4
|
"sourcesContent": ["/**\n * Function returning the current Meta Boxes DOM Node in the editor\n * whether the meta box area is opened or not.\n * If the MetaBox Area is visible returns it, and returns the original container instead.\n *\n * @param {string} location Meta Box location.\n *\n * @return {string} HTML content.\n */\nexport const getMetaBoxContainer = ( location ) => {\n\tconst area = document.querySelector(\n\t\t`.edit-post-meta-boxes-area.is-${ location } .metabox-location-${ location }`\n\t);\n\tif ( area ) {\n\t\treturn area;\n\t}\n\n\treturn document.querySelector( '#metaboxes .metabox-location-' + location );\n};\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AASO,IAAM,sBAAsB,CAAE,aAAc;AAClD,QAAM,OAAO,SAAS;AAAA,IACrB,iCAAkC,QAAS,sBAAuB,QAAS;AAAA,EAC5E;AACA,MAAK,MAAO;AACX,WAAO;AAAA,EACR;AAEA,SAAO,SAAS,cAAe,kCAAkC,QAAS;AAC3E;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/commands/use-commands.js"],
|
|
4
4
|
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { fullscreen } from '@wordpress/icons';\nimport { useCommand } from '@wordpress/commands';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { store as noticesStore } from '@wordpress/notices';\n\nexport default function useCommands() {\n\tconst { isFullscreen } = useSelect( ( select ) => {\n\t\tconst { get } = select( preferencesStore );\n\n\t\treturn {\n\t\t\tisFullscreen: get( 'core/edit-post', 'fullscreenMode' ),\n\t\t};\n\t}, [] );\n\tconst { toggle } = useDispatch( preferencesStore );\n\tconst { createInfoNotice } = useDispatch( noticesStore );\n\n\tuseCommand( {\n\t\tname: 'core/toggle-fullscreen-mode',\n\t\tlabel: isFullscreen\n\t\t\t? __( 'Exit fullscreen' )\n\t\t\t: __( 'Enter fullscreen' ),\n\t\ticon: fullscreen,\n\t\tcallback: ( { close } ) => {\n\t\t\ttoggle( 'core/edit-post', 'fullscreenMode' );\n\t\t\tclose();\n\t\t\tcreateInfoNotice(\n\t\t\t\tisFullscreen ? __( 'Fullscreen off.' ) : __( 'Fullscreen on.' ),\n\t\t\t\t{\n\t\t\t\t\tid: 'core/edit-post/toggle-fullscreen-mode/notice',\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\tactions: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: __( 'Undo' ),\n\t\t\t\t\t\t\tonClick: () => {\n\t\t\t\t\t\t\t\ttoggle( 'core/edit-post', 'fullscreenMode' );\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t}\n\t\t\t);\n\t\t},\n\t} );\n}\n"],
|
|
5
|
-
"mappings": "AAGA,SAAS,WAAW,mBAAmB;AACvC,SAAS,UAAU;AACnB,SAAS,kBAAkB;AAC3B,SAAS,kBAAkB;AAC3B,SAAS,SAAS,wBAAwB;AAC1C,SAAS,SAAS,oBAAoB;AAEvB,SAAR,cAA+B;AACrC,QAAM,EAAE,aAAa,IAAI,UAAW,CAAE,WAAY;AACjD,UAAM,EAAE,IAAI,IAAI,OAAQ,gBAAiB;AAEzC,WAAO;AAAA,MACN,cAAc,IAAK,kBAAkB,gBAAiB;AAAA,IACvD;AAAA,EACD,GAAG,CAAC,CAAE;AACN,QAAM,EAAE,OAAO,IAAI,YAAa,gBAAiB;AACjD,QAAM,EAAE,i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AAAA,QAC9D;AAAA,UACC,IAAI;AAAA,UACJ,MAAM;AAAA,UACN,SAAS;AAAA,YACR;AAAA,cACC,OAAO,GAAI,MAAO;AAAA,cAClB,SAAS,MAAM;AACd,uBAAQ,kBAAkB,gBAAiB;AAAA,cAC5C;AAAA,YACD;AAAA,UACD;AAAA,QACD;AAAA,MACD;AAAA,IACD;AAAA,EACD,CAAE;AACH;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// packages/edit-post/src/components/back-button/fullscreen-mode-close.js
|
|
2
2
|
import clsx from "clsx";
|
|
3
3
|
import { useSelect } from "@wordpress/data";
|
|
4
4
|
import {
|
|
@@ -12,7 +12,8 @@ import { wordpress, arrowUpLeft } from "@wordpress/icons";
|
|
|
12
12
|
import { store as editorStore } from "@wordpress/editor";
|
|
13
13
|
import { store as coreStore } from "@wordpress/core-data";
|
|
14
14
|
import { useReducedMotion } from "@wordpress/compose";
|
|
15
|
-
|
|
15
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
16
|
+
var siteIconVariants = {
|
|
16
17
|
edit: {
|
|
17
18
|
clipPath: "inset(0% round 0px)"
|
|
18
19
|
},
|
|
@@ -23,7 +24,7 @@ const siteIconVariants = {
|
|
|
23
24
|
clipPath: "inset(0% round 0px)"
|
|
24
25
|
}
|
|
25
26
|
};
|
|
26
|
-
|
|
27
|
+
var toggleHomeIconVariants = {
|
|
27
28
|
edit: {
|
|
28
29
|
opacity: 0,
|
|
29
30
|
scale: 0.2
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/back-button/fullscreen-mode-close.js"],
|
|
4
4
|
"sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport {\n\tButton,\n\tIcon,\n\t__unstableMotion as motion,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { addQueryArgs } from '@wordpress/url';\nimport { wordpress, arrowUpLeft } from '@wordpress/icons';\nimport { store as editorStore } from '@wordpress/editor';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useReducedMotion } from '@wordpress/compose';\n\nconst siteIconVariants = {\n\tedit: {\n\t\tclipPath: 'inset(0% round 0px)',\n\t},\n\thover: {\n\t\tclipPath: 'inset( 22% round 2px )',\n\t},\n\ttap: {\n\t\tclipPath: 'inset(0% round 0px)',\n\t},\n};\n\nconst toggleHomeIconVariants = {\n\tedit: {\n\t\topacity: 0,\n\t\tscale: 0.2,\n\t},\n\thover: {\n\t\topacity: 1,\n\t\tscale: 1,\n\t\tclipPath: 'inset( 22% round 2px )',\n\t},\n};\n\nfunction FullscreenModeClose( { showTooltip, icon, href, initialPost } ) {\n\tconst { isRequestingSiteIcon, postType, siteIconUrl } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getCurrentPostType } = select( editorStore );\n\t\t\tconst { getEntityRecord, getPostType, isResolving } =\n\t\t\t\tselect( coreStore );\n\t\t\tconst siteData =\n\t\t\t\tgetEntityRecord( 'root', '__unstableBase', undefined ) || {};\n\t\t\tconst _postType = initialPost?.type || getCurrentPostType();\n\t\t\treturn {\n\t\t\t\tisRequestingSiteIcon: isResolving( 'getEntityRecord', [\n\t\t\t\t\t'root',\n\t\t\t\t\t'__unstableBase',\n\t\t\t\t\tundefined,\n\t\t\t\t] ),\n\t\t\t\tpostType: getPostType( _postType ),\n\t\t\t\tsiteIconUrl: siteData.site_icon_url,\n\t\t\t};\n\t\t},\n\t\t[ initialPost?.type ]\n\t);\n\n\tconst disableMotion = useReducedMotion();\n\tconst transition = {\n\t\tduration: disableMotion ? 0 : 0.2,\n\t};\n\n\tif ( ! postType ) {\n\t\treturn null;\n\t}\n\n\t// Create SiteIcon equivalent structure exactly like edit-site\n\tlet siteIconContent;\n\tif ( isRequestingSiteIcon && ! siteIconUrl ) {\n\t\tsiteIconContent = (\n\t\t\t<div className=\"edit-post-fullscreen-mode-close-site-icon__image\" />\n\t\t);\n\t} else if ( siteIconUrl ) {\n\t\tsiteIconContent = (\n\t\t\t<img\n\t\t\t\tclassName=\"edit-post-fullscreen-mode-close-site-icon__image\"\n\t\t\t\talt={ __( 'Site Icon' ) }\n\t\t\t\tsrc={ siteIconUrl }\n\t\t\t/>\n\t\t);\n\t} else {\n\t\tsiteIconContent = (\n\t\t\t<Icon\n\t\t\t\tclassName=\"edit-post-fullscreen-mode-close-site-icon__icon\"\n\t\t\t\ticon={ wordpress }\n\t\t\t\tsize={ 48 }\n\t\t\t/>\n\t\t);\n\t}\n\n\t// Override default icon if custom icon is provided via props.\n\tconst buttonIcon = icon ? (\n\t\t<Icon size=\"36px\" icon={ icon } />\n\t) : (\n\t\t<div className=\"edit-post-fullscreen-mode-close-site-icon\">\n\t\t\t{ siteIconContent }\n\t\t</div>\n\t);\n\n\tconst classes = clsx( 'edit-post-fullscreen-mode-close', {\n\t\t'has-icon': siteIconUrl,\n\t} );\n\n\tconst buttonHref =\n\t\thref ??\n\t\taddQueryArgs( 'edit.php', {\n\t\t\tpost_type: postType.slug,\n\t\t} );\n\n\tconst buttonLabel = postType?.labels?.view_items ?? __( 'Back' );\n\n\treturn (\n\t\t<motion.div\n\t\t\tclassName=\"edit-post-fullscreen-mode-close__view-mode-toggle\"\n\t\t\tanimate=\"edit\"\n\t\t\tinitial=\"edit\"\n\t\t\twhileHover=\"hover\"\n\t\t\twhileTap=\"tap\"\n\t\t\ttransition={ transition }\n\t\t>\n\t\t\t<Button\n\t\t\t\t__next40pxDefaultSize\n\t\t\t\tclassName={ classes }\n\t\t\t\thref={ buttonHref }\n\t\t\t\tlabel={ buttonLabel }\n\t\t\t\tshowTooltip={ showTooltip }\n\t\t\t\ttooltipPosition=\"middle right\"\n\t\t\t>\n\t\t\t\t<motion.div variants={ ! disableMotion && siteIconVariants }>\n\t\t\t\t\t<div className=\"edit-post-fullscreen-mode-close__view-mode-toggle-icon\">\n\t\t\t\t\t\t{ buttonIcon }\n\t\t\t\t\t</div>\n\t\t\t\t</motion.div>\n\t\t\t</Button>\n\t\t\t<motion.div\n\t\t\t\tclassName={ clsx(\n\t\t\t\t\t'edit-post-fullscreen-mode-close__back-icon',\n\t\t\t\t\t{\n\t\t\t\t\t\t'has-site-icon': siteIconUrl,\n\t\t\t\t\t}\n\t\t\t\t) }\n\t\t\t\tvariants={ ! disableMotion && toggleHomeIconVariants }\n\t\t\t>\n\t\t\t\t<Icon icon={ arrowUpLeft } />\n\t\t\t</motion.div>\n\t\t</motion.div>\n\t);\n}\n\nexport default FullscreenModeClose;\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";AAGA,OAAO,UAAU;AAKjB,SAAS,iBAAiB;AAC1B;AAAA,EACC;AAAA,EACA;AAAA,EACA,oBAAoB;AAAA,OACd;AACP,SAAS,UAAU;AACnB,SAAS,oBAAoB;AAC7B,SAAS,WAAW,mBAAmB;AACvC,SAAS,SAAS,mBAAmB;AACrC,SAAS,SAAS,iBAAiB;AACnC,SAAS,wBAAwB;AA6D9B,cA0CD,YA1CC;AA3DH,IAAM,mBAAmB;AAAA,EACxB,MAAM;AAAA,IACL,UAAU;AAAA,EACX;AAAA,EACA,OAAO;AAAA,IACN,UAAU;AAAA,EACX;AAAA,EACA,KAAK;AAAA,IACJ,UAAU;AAAA,EACX;AACD;AAEA,IAAM,yBAAyB;AAAA,EAC9B,MAAM;AAAA,IACL,SAAS;AAAA,IACT,OAAO;AAAA,EACR;AAAA,EACA,OAAO;AAAA,IACN,SAAS;AAAA,IACT,OAAO;AAAA,IACP,UAAU;AAAA,EACX;AACD;AAEA,SAAS,oBAAqB,EAAE,aAAa,MAAM,MAAM,YAAY,GAAI;AACxE,QAAM,EAAE,sBAAsB,UAAU,YAAY,IAAI;AAAA,IACvD,CAAE,WAAY;AACb,YAAM,EAAE,mBAAmB,IAAI,OAAQ,WAAY;AACnD,YAAM,EAAE,iBAAiB,aAAa,YA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X,UAAS;AAAA,MACT;AAAA,MAEA;AAAA;AAAA,UAAC;AAAA;AAAA,YACA,uBAAqB;AAAA,YACrB,WAAY;AAAA,YACZ,MAAO;AAAA,YACP,OAAQ;AAAA,YACR;AAAA,YACA,iBAAgB;AAAA,YAEhB,8BAAC,OAAO,KAAP,EAAW,UAAW,CAAE,iBAAiB,kBACzC,8BAAC,SAAI,WAAU,0DACZ,sBACH,GACD;AAAA;AAAA,QACD;AAAA,QACA;AAAA,UAAC,OAAO;AAAA,UAAP;AAAA,YACA,WAAY;AAAA,cACX;AAAA,cACA;AAAA,gBACC,iBAAiB;AAAA,cAClB;AAAA,YACD;AAAA,YACA,UAAW,CAAE,iBAAiB;AAAA,YAE9B,8BAAC,QAAK,MAAO,aAAc;AAAA;AAAA,QAC5B;AAAA;AAAA;AAAA,EACD;AAEF;AAEA,IAAO,gCAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
// packages/edit-post/src/components/back-button/index.js
|
|
2
2
|
import { privateApis as editorPrivateApis } from "@wordpress/editor";
|
|
3
3
|
import { __unstableMotion as motion } from "@wordpress/components";
|
|
4
4
|
import FullscreenModeClose from "./fullscreen-mode-close";
|
|
5
5
|
import { unlock } from "../../lock-unlock";
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
var { BackButton: BackButtonFill } = unlock(editorPrivateApis);
|
|
8
|
+
var slideX = {
|
|
8
9
|
hidden: { x: "-100%" },
|
|
9
10
|
distractionFreeInactive: { x: 0 },
|
|
10
11
|
hover: { x: 0, transition: { type: "tween", delay: 0.2 } }
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/back-button/index.js"],
|
|
4
4
|
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { privateApis as editorPrivateApis } from '@wordpress/editor';\nimport { __unstableMotion as motion } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport FullscreenModeClose from './fullscreen-mode-close';\nimport { unlock } from '../../lock-unlock';\n\nconst { BackButton: BackButtonFill } = unlock( editorPrivateApis );\n\nconst slideX = {\n\thidden: { x: '-100%' },\n\tdistractionFreeInactive: { x: 0 },\n\thover: { x: 0, transition: { type: 'tween', delay: 0.2 } },\n};\n\nfunction BackButton( { initialPost } ) {\n\treturn (\n\t\t<BackButtonFill>\n\t\t\t{ ( { length } ) =>\n\t\t\t\tlength <= 1 && (\n\t\t\t\t\t<motion.div\n\t\t\t\t\t\tvariants={ slideX }\n\t\t\t\t\t\ttransition={ { type: 'tween', delay: 0.8 } }\n\t\t\t\t\t>\n\t\t\t\t\t\t<FullscreenModeClose\n\t\t\t\t\t\t\tshowTooltip\n\t\t\t\t\t\t\tinitialPost={ initialPost }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</motion.div>\n\t\t\t\t)\n\t\t\t}\n\t\t</BackButtonFill>\n\t);\n}\n\nexport default BackButton;\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";AAGA,SAAS,eAAe,yBAAyB;AACjD,SAAS,oBAAoB,cAAc;AAK3C,OAAO,yBAAyB;AAChC,SAAS,cAAc;AAmBjB;AAjBN,IAAM,EAAE,YAAY,eAAe,IAAI,OAAQ,iBAAkB;AAEjE,IAAM,SAAS;AAAA,EACd,QAAQ,EAAE,GAAG,QAAQ;AAAA,EACrB,yBAAyB,EAAE,GAAG,EAAE;AAAA,EAChC,OAAO,EAAE,GAAG,GAAG,YAAY,EAAE,MAAM,SAAS,OAAO,IAAI,EAAE;AAC1D;AAEA,SAAS,WAAY,EAAE,YAAY,GAAI;AACtC,SACC,oBAAC,kBACE,WAAE,EAAE,OAAO,MACZ,UAAU,KACT;AAAA,IAAC,OAAO;AAAA,IAAP;AAAA,MACA,UAAW;AAAA,MACX,YAAa,EAAE,MAAM,SAAS,OAAO,IAAI;AAAA,MAEzC;AAAA,QAAC;AAAA;AAAA,UACA,aAAW;AAAA,UACX;AAAA;AAAA,MACD;AAAA;AAAA,EACD,GAGH;AAEF;AAEA,IAAO,sBAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/browser-url/index.js"],
|
|
4
4
|
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useEffect, useState } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport { addQueryArgs } from '@wordpress/url';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Returns the Post's Edit URL.\n *\n * @param {number} postId Post ID.\n *\n * @return {string} Post edit URL.\n */\nexport function getPostEditURL( postId ) {\n\treturn addQueryArgs( 'post.php', { post: postId, action: 'edit' } );\n}\n\nexport default function BrowserURL() {\n\tconst [ historyId, setHistoryId ] = useState( null );\n\tconst { postId, postStatus } = useSelect( ( select ) => {\n\t\tconst { getCurrentPost } = select( editorStore );\n\t\tconst post = getCurrentPost();\n\t\tlet { id, status, type } = post;\n\t\tconst isTemplate = [ 'wp_template', 'wp_template_part' ].includes(\n\t\t\ttype\n\t\t);\n\t\tif ( isTemplate ) {\n\t\t\tid = post.wp_id;\n\t\t}\n\n\t\treturn {\n\t\t\tpostId: id,\n\t\t\tpostStatus: status,\n\t\t};\n\t}, [] );\n\n\tuseEffect( () => {\n\t\tif ( postId && postId !== historyId && postStatus !== 'auto-draft' ) {\n\t\t\twindow.history.replaceState(\n\t\t\t\t{ id: postId },\n\t\t\t\t'Post ' + postId,\n\t\t\t\tgetPostEditURL( postId )\n\t\t\t);\n\t\t\tsetHistoryId( postId );\n\t\t}\n\t}, [ postId, postStatus, historyId ] );\n\n\treturn null;\n}\n"],
|
|
5
|
-
"mappings": "AAGA,SAAS,WAAW,gBAAgB;AACpC,SAAS,iBAAiB;AAC1B,SAAS,oBAAoB;AAC7B,SAAS,SAAS,mBAAmB;AAS9B,SAAS,e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AAM,aAAa,CAAE,eAAe,kBAAmB,EAAE;AAAA,MACxD;AAAA,IACD;AACA,QAAK,YAAa;AACjB,WAAK,KAAK;AAAA,IACX;AAEA,WAAO;AAAA,MACN,QAAQ;AAAA,MACR,YAAY;AAAA,IACb;AAAA,EACD,GAAG,CAAC,CAAE;AAEN,YAAW,MAAM;AAChB,QAAK,UAAU,WAAW,aAAa,eAAe,cAAe;AACpE,aAAO,QAAQ;AAAA,QACd,EAAE,IAAI,OAAO;AAAA,QACb,UAAU;AAAA,QACV,eAAgB,MAAO;AAAA,MACxB;AACA,mBAAc,MAAO;AAAA,IACtB;AAAA,EACD,GAAG,CAAE,QAAQ,YAAY,SAAU,CAAE;AAErC,SAAO;AACR;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/editor-initialization/index.js"],
|
|
4
4
|
"sourcesContent": ["/**\n * Internal dependencies\n */\nimport { useUpdatePostLinkListener } from './listener-hooks';\n\n/**\n * Data component used for initializing the editor and re-initializes\n * when postId changes or on unmount.\n *\n * @return {null} This is a data component so does not render any ui.\n */\nexport default function EditorInitialization() {\n\tuseUpdatePostLinkListener();\n\treturn null;\n}\n"],
|
|
5
|
-
"mappings": "AAGA,SAAS,iCAAiC;AAQ3B,SAAR,uBAAwC;AAC9C,4BAA0B;AAC1B,SAAO;AACR;",
|
|
5
|
+
"mappings": ";AAGA,SAAS,iCAAiC;AAQ3B,SAAR,uBAAwC;AAC9C,4BAA0B;AAC1B,SAAO;AACR;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
// packages/edit-post/src/components/editor-initialization/listener-hooks.js
|
|
1
2
|
import { useSelect } from "@wordpress/data";
|
|
2
3
|
import { useEffect, useRef } from "@wordpress/element";
|
|
3
4
|
import { store as editorStore } from "@wordpress/editor";
|
|
@@ -6,7 +7,7 @@ import {
|
|
|
6
7
|
VIEW_AS_LINK_SELECTOR,
|
|
7
8
|
VIEW_AS_PREVIEW_LINK_SELECTOR
|
|
8
9
|
} from "../../store/constants";
|
|
9
|
-
|
|
10
|
+
var useUpdatePostLinkListener = () => {
|
|
10
11
|
const { isViewable, newPermalink } = useSelect((select) => {
|
|
11
12
|
const { getPostType } = select(coreStore);
|
|
12
13
|
const { getCurrentPost, getEditedPostAttribute } = select(editorStore);
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/editor-initialization/listener-hooks.js"],
|
|
4
4
|
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { useEffect, useRef } from '@wordpress/element';\nimport { store as editorStore } from '@wordpress/editor';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport {\n\tVIEW_AS_LINK_SELECTOR,\n\tVIEW_AS_PREVIEW_LINK_SELECTOR,\n} from '../../store/constants';\n\n/**\n * This listener hook monitors any change in permalink and updates the view\n * post link in the admin bar.\n */\nexport const useUpdatePostLinkListener = () => {\n\tconst { isViewable, newPermalink } = useSelect( ( select ) => {\n\t\tconst { getPostType } = select( coreStore );\n\t\tconst { getCurrentPost, getEditedPostAttribute } =\n\t\t\tselect( editorStore );\n\t\tconst postType = getPostType( getEditedPostAttribute( 'type' ) );\n\t\treturn {\n\t\t\tisViewable: postType?.viewable,\n\t\t\tnewPermalink: getCurrentPost().link,\n\t\t};\n\t}, [] );\n\n\tconst nodeToUpdateRef = useRef();\n\n\tuseEffect( () => {\n\t\tnodeToUpdateRef.current =\n\t\t\tdocument.querySelector( VIEW_AS_PREVIEW_LINK_SELECTOR ) ||\n\t\t\tdocument.querySelector( VIEW_AS_LINK_SELECTOR );\n\t}, [] );\n\n\tuseEffect( () => {\n\t\tif ( ! newPermalink || ! nodeToUpdateRef.current ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( ! isViewable ) {\n\t\t\tnodeToUpdateRef.current.style.display = 'none';\n\t\t\treturn;\n\t\t}\n\n\t\tnodeToUpdateRef.current.style.display = '';\n\t\tnodeToUpdateRef.current.setAttribute( 'href', newPermalink );\n\t}, [ newPermalink, isViewable ] );\n};\n"],
|
|
5
|
-
"mappings": "AAGA,SAAS,iBAAiB;AAC1B,SAAS,WAAW,cAAc;AAClC,SAAS,SAAS,mBAAmB;AACrC,SAAS,SAAS,iBAAiB;AAKnC;AAAA,EACC;AAAA,EACA;AAAA,OACM;AAMA,
|
|
5
|
+
"mappings": ";AAGA,SAAS,iBAAiB;AAC1B,SAAS,WAAW,cAAc;AAClC,SAAS,SAAS,mBAAmB;AACrC,SAAS,SAAS,iBAAiB;AAKnC;AAAA,EACC;AAAA,EACA;AAAA,OACM;AAMA,IAAM,4BAA4B,MAAM;AAC9C,QAAM,EAAE,YAAY,aAAa,IAAI,UAAW,CAAE,WAAY;AAC7D,UAAM,EAAE,YAAY,IAAI,OAAQ,SAAU;AAC1C,UAAM,EAAE,gBAAgB,uBAAuB,IAC9C,OAAQ,WAAY;AACrB,UAAM,WAAW,YAAa,uBAAwB,MAAO,CAAE;AAC/D,WAAO;AAAA,MACN,YAAY,UAAU;AAAA,MACtB,cAAc,eAAe,EAAE;AAAA,IAChC;AAAA,EACD,GAAG,CAAC,CAAE;AAEN,QAAM,kBAAkB,OAAO;AAE/B,YAAW,MAAM;AAChB,oBAAgB,UACf,SAAS,cAAe,6BAA8B,KACtD,SAAS,cAAe,qBAAsB;AAAA,EAChD,GAAG,CAAC,CAAE;AAEN,YAAW,MAAM;AAChB,QAAK,CAAE,gBAAgB,CAAE,gBAAgB,SAAU;AAClD;AAAA,IACD;AAEA,QAAK,CAAE,YAAa;AACnB,sBAAgB,QAAQ,MAAM,UAAU;AACxC;AAAA,IACD;AAEA,oBAAgB,QAAQ,MAAM,UAAU;AACxC,oBAAgB,QAAQ,aAAc,QAAQ,YAAa;AAAA,EAC5D,GAAG,CAAE,cAAc,UAAW,CAAE;AACjC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// packages/edit-post/src/components/init-pattern-modal/index.js
|
|
2
2
|
import { useSelect, useDispatch } from "@wordpress/data";
|
|
3
3
|
import { __, _x } from "@wordpress/i18n";
|
|
4
4
|
import {
|
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
} from "@wordpress/components";
|
|
12
12
|
import { useState } from "@wordpress/element";
|
|
13
13
|
import { store as editorStore } from "@wordpress/editor";
|
|
14
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
14
15
|
function InitPatternModal() {
|
|
15
16
|
const { editPost } = useDispatch(editorStore);
|
|
16
17
|
const [syncType, setSyncType] = useState(void 0);
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/init-pattern-modal/index.js"],
|
|
4
4
|
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { __, _x } from '@wordpress/i18n';\nimport {\n\tModal,\n\tButton,\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\tToggleControl,\n\tTextControl,\n} from '@wordpress/components';\nimport { useState } from '@wordpress/element';\nimport { store as editorStore } from '@wordpress/editor';\n\nexport default function InitPatternModal() {\n\tconst { editPost } = useDispatch( editorStore );\n\tconst [ syncType, setSyncType ] = useState( undefined );\n\tconst [ title, setTitle ] = useState( '' );\n\n\tconst { postType, isNewPost } = useSelect( ( select ) => {\n\t\tconst { getEditedPostAttribute, isCleanNewPost } =\n\t\t\tselect( editorStore );\n\t\treturn {\n\t\t\tpostType: getEditedPostAttribute( 'type' ),\n\t\t\tisNewPost: isCleanNewPost(),\n\t\t};\n\t}, [] );\n\tconst [ isModalOpen, setIsModalOpen ] = useState(\n\t\t() => isNewPost && postType === 'wp_block'\n\t);\n\n\tif ( postType !== 'wp_block' || ! isNewPost ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t{ isModalOpen && (\n\t\t\t\t<Modal\n\t\t\t\t\ttitle={ __( 'Create pattern' ) }\n\t\t\t\t\tonRequestClose={ () => {\n\t\t\t\t\t\tsetIsModalOpen( false );\n\t\t\t\t\t} }\n\t\t\t\t\toverlayClassName=\"reusable-blocks-menu-items__convert-modal\"\n\t\t\t\t>\n\t\t\t\t\t<form\n\t\t\t\t\t\tonSubmit={ ( event ) => {\n\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\tsetIsModalOpen( false );\n\t\t\t\t\t\t\teditPost( {\n\t\t\t\t\t\t\t\ttitle,\n\t\t\t\t\t\t\t\tmeta: {\n\t\t\t\t\t\t\t\t\twp_pattern_sync_status: syncType,\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\t\t<VStack spacing=\"5\">\n\t\t\t\t\t\t\t<TextControl\n\t\t\t\t\t\t\t\tlabel={ __( 'Name' ) }\n\t\t\t\t\t\t\t\tvalue={ title }\n\t\t\t\t\t\t\t\tonChange={ setTitle }\n\t\t\t\t\t\t\t\tplaceholder={ __( 'My pattern' ) }\n\t\t\t\t\t\t\t\tclassName=\"patterns-create-modal__name-input\"\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\tlabel={ _x( 'Synced', 'pattern (singular)' ) }\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Sync this pattern across multiple locations.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tchecked={ ! syncType }\n\t\t\t\t\t\t\t\tonChange={ () => {\n\t\t\t\t\t\t\t\t\tsetSyncType(\n\t\t\t\t\t\t\t\t\t\t! syncType ? 'unsynced' : undefined\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<HStack justify=\"right\">\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\t\t\ttype=\"submit\"\n\t\t\t\t\t\t\t\t\tdisabled={ ! title }\n\t\t\t\t\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ __( 'Create' ) }\n\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t</HStack>\n\t\t\t\t\t\t</VStack>\n\t\t\t\t\t</form>\n\t\t\t\t</Modal>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";AAGA,SAAS,WAAW,mBAAmB;AACvC,SAAS,IAAI,UAAU;AACvB;AAAA,EACC;AAAA,EACA;AAAA,EACA,wBAAwB;AAAA,EACxB,wBAAwB;AAAA,EACxB;AAAA,EACA;AAAA,OACM;AACP,SAAS,gBAAgB;AACzB,SAAS,SAAS,mBAAmB;AAwBnC,mBAsBK,KADD,YArBJ;AAtBa,SAAR,mBAAoC;AAC1C,QAAM,EAAE,SAAS,IAAI,YAAa,WAAY;AAC9C,QAAM,CAAE,UAAU,WAAY,IAAI,SAAU,MAAU;AACtD,QAAM,CAAE,OAAO,QAAS,IAAI,SAAU,EAAG;AAEzC,QAAM,EAAE,UAAU,UAAU,IAAI,UAAW,CAAE,WAAY;AACxD,UAAM,EAAE,wBAAwB,eAAe,IAC9C,OAAQ,WAAY;AACrB,WAAO;AAAA,MACN,UAAU,uBAAwB,MAAO;AAAA,MACzC,WAAW,eAAe;AAAA,IAC3B;AAAA,EACD,GAAG,CAAC,CAAE;AACN,QAAM,CAAE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GAEF;AAEF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/keyboard-shortcuts/index.js"],
|
|
4
4
|
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useEffect } from '@wordpress/element';\nimport { useDispatch } from '@wordpress/data';\nimport {\n\tuseShortcut,\n\tstore as keyboardShortcutsStore,\n} from '@wordpress/keyboard-shortcuts';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../store';\n\nfunction KeyboardShortcuts() {\n\tconst { toggleFullscreenMode } = useDispatch( editPostStore );\n\tconst { registerShortcut } = useDispatch( keyboardShortcutsStore );\n\n\tuseEffect( () => {\n\t\tregisterShortcut( {\n\t\t\tname: 'core/edit-post/toggle-fullscreen',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Enable or disable fullscreen mode.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'secondary',\n\t\t\t\tcharacter: 'f',\n\t\t\t},\n\t\t} );\n\t}, [] );\n\n\tuseShortcut( 'core/edit-post/toggle-fullscreen', () => {\n\t\ttoggleFullscreenMode();\n\t} );\n\n\treturn null;\n}\n\nexport default KeyboardShortcuts;\n"],
|
|
5
|
-
"mappings": "AAGA,SAAS,iBAAiB;AAC1B,SAAS,mBAAmB;AAC5B;AAAA,EACC;AAAA,EACA,SAAS;AAAA,OACH;AACP,SAAS,UAAU;AAKnB,SAAS,SAAS,qBAAqB;AAEvC,SAAS,oBAAoB;AAC5B,QAAM,EAAE,qBAAqB,IAAI,YAAa,aAAc;AAC5D,QAAM,EAAE,iBAAiB,IAAI,YAAa,sBAAuB;AAEjE,YAAW,MAAM;AAChB,qBAAkB;AAAA,MACjB,MAAM;AAAA,MACN,UAAU;AAAA,MACV,aAAa,GAAI,oCAAqC;AAAA,MACtD,gBAAgB;AAAA,QACf,UAAU;AAAA,QACV,W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