@wordpress/edit-post 8.32.0 → 8.32.1-next.ff1cebbba.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/build/commands/use-commands.js +54 -47
- package/build/commands/use-commands.js.map +7 -1
- package/build/components/back-button/fullscreen-mode-close.js +127 -118
- package/build/components/back-button/fullscreen-mode-close.js.map +7 -1
- package/build/components/back-button/index.js +56 -54
- package/build/components/back-button/index.js.map +7 -1
- package/build/components/browser-url/index.js +45 -44
- package/build/components/browser-url/index.js.map +7 -1
- package/build/components/editor-initialization/index.js +24 -18
- package/build/components/editor-initialization/index.js.map +7 -1
- package/build/components/editor-initialization/listener-hooks.js +42 -43
- package/build/components/editor-initialization/listener-hooks.js.map +7 -1
- package/build/components/init-pattern-modal/index.js +100 -79
- package/build/components/init-pattern-modal/index.js.map +7 -1
- package/build/components/keyboard-shortcuts/index.js +37 -33
- package/build/components/keyboard-shortcuts/index.js.map +7 -1
- package/build/components/layout/index.js +447 -467
- package/build/components/layout/index.js.map +7 -1
- package/build/components/layout/use-padding-appender.js +66 -59
- package/build/components/layout/use-padding-appender.js.map +7 -1
- package/build/components/layout/use-should-iframe.js +36 -30
- package/build/components/layout/use-should-iframe.js.map +7 -1
- package/build/components/meta-boxes/index.js +46 -33
- package/build/components/meta-boxes/index.js.map +7 -1
- package/build/components/meta-boxes/meta-box-visibility.js +37 -22
- package/build/components/meta-boxes/meta-box-visibility.js.map +7 -1
- package/build/components/meta-boxes/meta-boxes-area/index.js +62 -53
- package/build/components/meta-boxes/meta-boxes-area/index.js.map +7 -1
- package/build/components/meta-boxes/use-meta-box-initialization.js +37 -32
- package/build/components/meta-boxes/use-meta-box-initialization.js.map +7 -1
- package/build/components/more-menu/index.js +64 -44
- package/build/components/more-menu/index.js.map +7 -1
- package/build/components/more-menu/manage-patterns-menu-item.js +39 -37
- package/build/components/more-menu/manage-patterns-menu-item.js.map +7 -1
- package/build/components/more-menu/welcome-guide-menu-item.js +39 -21
- package/build/components/more-menu/welcome-guide-menu-item.js.map +7 -1
- package/build/components/preferences-modal/enable-custom-fields.js +76 -66
- package/build/components/preferences-modal/enable-custom-fields.js.map +7 -1
- package/build/components/preferences-modal/enable-panel.js +47 -43
- package/build/components/preferences-modal/enable-panel.js.map +7 -1
- package/build/components/preferences-modal/index.js +51 -39
- package/build/components/preferences-modal/index.js.map +7 -1
- package/build/components/preferences-modal/meta-boxes-section.js +65 -52
- package/build/components/preferences-modal/meta-boxes-section.js.map +7 -1
- package/build/components/welcome-guide/default.js +134 -97
- package/build/components/welcome-guide/default.js.map +7 -1
- package/build/components/welcome-guide/image.js +34 -23
- package/build/components/welcome-guide/image.js.map +7 -1
- package/build/components/welcome-guide/index.js +51 -38
- package/build/components/welcome-guide/index.js.map +7 -1
- package/build/components/welcome-guide/template.js +65 -45
- package/build/components/welcome-guide/template.js.map +7 -1
- package/build/deprecated.js +84 -110
- package/build/deprecated.js.map +7 -1
- package/build/hooks/use-navigate-to-entity-record.js +60 -78
- package/build/hooks/use-navigate-to-entity-record.js.map +7 -1
- package/build/index.js +101 -136
- package/build/index.js.map +7 -1
- package/build/lock-unlock.js +31 -15
- package/build/lock-unlock.js.map +7 -1
- package/build/store/actions.js +239 -431
- package/build/store/actions.js.map +7 -1
- package/build/store/constants.js +33 -26
- package/build/store/constants.js.map +7 -1
- package/build/store/index.js +44 -32
- package/build/store/index.js.map +7 -1
- package/build/store/reducer.js +50 -57
- package/build/store/reducer.js.map +7 -1
- package/build/store/selectors.js +288 -459
- package/build/store/selectors.js.map +7 -1
- package/build/utils/meta-boxes.js +31 -19
- package/build/utils/meta-boxes.js.map +7 -1
- package/build-module/commands/use-commands.js +35 -40
- package/build-module/commands/use-commands.js.map +7 -1
- package/build-module/components/back-button/fullscreen-mode-close.js +102 -110
- package/build-module/components/back-button/fullscreen-mode-close.js.map +7 -1
- package/build-module/components/back-button/index.js +28 -47
- package/build-module/components/back-button/index.js.map +7 -1
- package/build-module/components/browser-url/index.js +23 -38
- package/build-module/components/browser-url/index.js.map +7 -1
- package/build-module/components/editor-initialization/index.js +6 -13
- package/build-module/components/editor-initialization/index.js.map +7 -1
- package/build-module/components/editor-initialization/listener-hooks.js +20 -34
- package/build-module/components/editor-initialization/listener-hooks.js.map +7 -1
- package/build-module/components/init-pattern-modal/index.js +90 -74
- package/build-module/components/init-pattern-modal/index.js.map +7 -1
- package/build-module/components/keyboard-shortcuts/index.js +21 -26
- package/build-module/components/keyboard-shortcuts/index.js.map +7 -1
- package/build-module/components/layout/index.js +439 -448
- package/build-module/components/layout/index.js.map +7 -1
- package/build-module/components/layout/use-padding-appender.js +44 -54
- package/build-module/components/layout/use-padding-appender.js.map +7 -1
- package/build-module/components/layout/use-should-iframe.js +15 -25
- package/build-module/components/layout/use-should-iframe.js.map +7 -1
- package/build-module/components/meta-boxes/index.js +18 -26
- package/build-module/components/meta-boxes/index.js.map +7 -1
- package/build-module/components/meta-boxes/meta-box-visibility.js +18 -15
- package/build-module/components/meta-boxes/meta-box-visibility.js.map +7 -1
- package/build-module/components/meta-boxes/meta-boxes-area/index.js +30 -44
- package/build-module/components/meta-boxes/meta-boxes-area/index.js.map +7 -1
- package/build-module/components/meta-boxes/use-meta-box-initialization.js +14 -25
- package/build-module/components/meta-boxes/use-meta-box-initialization.js.map +7 -1
- package/build-module/components/more-menu/index.js +36 -37
- package/build-module/components/more-menu/index.js.map +7 -1
- package/build-module/components/more-menu/manage-patterns-menu-item.js +21 -31
- package/build-module/components/more-menu/manage-patterns-menu-item.js.map +7 -1
- package/build-module/components/more-menu/welcome-guide-menu-item.js +22 -16
- package/build-module/components/more-menu/welcome-guide-menu-item.js.map +7 -1
- package/build-module/components/preferences-modal/enable-custom-fields.js +51 -56
- package/build-module/components/preferences-modal/enable-custom-fields.js.map +7 -1
- package/build-module/components/preferences-modal/enable-panel.js +30 -38
- package/build-module/components/preferences-modal/enable-panel.js.map +7 -1
- package/build-module/components/preferences-modal/index.js +24 -34
- package/build-module/components/preferences-modal/index.js.map +7 -1
- package/build-module/components/preferences-modal/meta-boxes-section.js +34 -45
- package/build-module/components/preferences-modal/meta-boxes-section.js.map +7 -1
- package/build-module/components/welcome-guide/default.js +107 -91
- package/build-module/components/welcome-guide/default.js.map +7 -1
- package/build-module/components/welcome-guide/image.js +16 -18
- package/build-module/components/welcome-guide/image.js.map +7 -1
- package/build-module/components/welcome-guide/index.js +23 -31
- package/build-module/components/welcome-guide/index.js.map +7 -1
- package/build-module/components/welcome-guide/template.js +38 -39
- package/build-module/components/welcome-guide/template.js.map +7 -1
- package/build-module/deprecated.js +62 -103
- package/build-module/deprecated.js.map +7 -1
- package/build-module/hooks/use-navigate-to-entity-record.js +42 -73
- package/build-module/hooks/use-navigate-to-entity-record.js.map +7 -1
- package/build-module/index.js +70 -95
- package/build-module/index.js.map +7 -1
- package/build-module/lock-unlock.js +8 -7
- package/build-module/lock-unlock.js.map +7 -1
- package/build-module/store/actions.js +158 -368
- package/build-module/store/actions.js.map +7 -1
- package/build-module/store/constants.js +9 -21
- package/build-module/store/constants.js.map +7 -1
- package/build-module/store/index.js +10 -22
- package/build-module/store/index.js.map +7 -1
- package/build-module/store/reducer.js +28 -51
- package/build-module/store/reducer.js.map +7 -1
- package/build-module/store/selectors.js +232 -442
- package/build-module/store/selectors.js.map +7 -1
- package/build-module/utils/meta-boxes.js +9 -13
- package/build-module/utils/meta-boxes.js.map +7 -1
- package/build-style/classic-rtl.css +0 -154
- package/build-style/classic.css +0 -154
- package/build-style/style-rtl.css +135 -110
- package/build-style/style.css +135 -110
- package/package.json +39 -31
- package/src/classic.scss +3 -0
- package/src/components/back-button/style.scss +3 -0
- package/src/components/layout/index.js +3 -2
- package/src/components/layout/style.scss +4 -0
- package/src/components/meta-boxes/meta-boxes-area/style.scss +3 -0
- package/src/components/welcome-guide/style.scss +3 -0
- package/src/style.scss +8 -4
- package/build/components/header/header-toolbar/index.native.js +0 -204
- package/build/components/header/header-toolbar/index.native.js.map +0 -1
- package/build/components/header/index.native.js +0 -59
- package/build/components/header/index.native.js.map +0 -1
- package/build/components/layout/index.native.js +0 -166
- package/build/components/layout/index.native.js.map +0 -1
- package/build/components/visual-editor/header.native.js +0 -63
- package/build/components/visual-editor/header.native.js.map +0 -1
- package/build/components/visual-editor/index.native.js +0 -44
- package/build/components/visual-editor/index.native.js.map +0 -1
- package/build/editor.native.js +0 -157
- package/build/editor.native.js.map +0 -1
- package/build/index.native.js +0 -58
- package/build/index.native.js.map +0 -1
- package/build-module/components/header/header-toolbar/index.native.js +0 -196
- package/build-module/components/header/header-toolbar/index.native.js.map +0 -1
- package/build-module/components/header/index.native.js +0 -50
- package/build-module/components/header/index.native.js.map +0 -1
- package/build-module/components/layout/index.native.js +0 -158
- package/build-module/components/layout/index.native.js.map +0 -1
- package/build-module/components/visual-editor/header.native.js +0 -56
- package/build-module/components/visual-editor/header.native.js.map +0 -1
- package/build-module/components/visual-editor/index.native.js +0 -35
- package/build-module/components/visual-editor/index.native.js.map +0 -1
- package/build-module/editor.native.js +0 -149
- package/build-module/editor.native.js.map +0 -1
- package/build-module/index.native.js +0 -45
- package/build-module/index.native.js.map +0 -1
package/build/store/selectors.js
CHANGED
|
@@ -1,127 +1,105 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
Object.
|
|
5
|
-
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
var selectors_exports = {};
|
|
29
|
+
__export(selectors_exports, {
|
|
30
|
+
__experimentalGetInsertionPoint: () => __experimentalGetInsertionPoint,
|
|
31
|
+
__experimentalGetPreviewDeviceType: () => __experimentalGetPreviewDeviceType,
|
|
32
|
+
areMetaBoxesInitialized: () => areMetaBoxesInitialized,
|
|
33
|
+
getActiveGeneralSidebarName: () => getActiveGeneralSidebarName,
|
|
34
|
+
getActiveMetaBoxLocations: () => getActiveMetaBoxLocations,
|
|
35
|
+
getAllMetaBoxes: () => getAllMetaBoxes,
|
|
36
|
+
getEditedPostTemplate: () => getEditedPostTemplate,
|
|
37
|
+
getEditorMode: () => getEditorMode,
|
|
38
|
+
getHiddenBlockTypes: () => getHiddenBlockTypes,
|
|
39
|
+
getMetaBoxesPerLocation: () => getMetaBoxesPerLocation,
|
|
40
|
+
getPreference: () => getPreference,
|
|
41
|
+
getPreferences: () => getPreferences,
|
|
42
|
+
hasMetaBoxes: () => hasMetaBoxes,
|
|
43
|
+
isEditingTemplate: () => isEditingTemplate,
|
|
44
|
+
isEditorPanelEnabled: () => isEditorPanelEnabled,
|
|
45
|
+
isEditorPanelOpened: () => isEditorPanelOpened,
|
|
46
|
+
isEditorPanelRemoved: () => isEditorPanelRemoved,
|
|
47
|
+
isEditorSidebarOpened: () => isEditorSidebarOpened,
|
|
48
|
+
isFeatureActive: () => isFeatureActive,
|
|
49
|
+
isInserterOpened: () => isInserterOpened,
|
|
50
|
+
isListViewOpened: () => isListViewOpened,
|
|
51
|
+
isMetaBoxLocationActive: () => isMetaBoxLocationActive,
|
|
52
|
+
isMetaBoxLocationVisible: () => isMetaBoxLocationVisible,
|
|
53
|
+
isModalActive: () => isModalActive,
|
|
54
|
+
isPluginItemPinned: () => isPluginItemPinned,
|
|
55
|
+
isPluginSidebarOpened: () => isPluginSidebarOpened,
|
|
56
|
+
isPublishSidebarOpened: () => isPublishSidebarOpened,
|
|
57
|
+
isSavingMetaBoxes: () => isSavingMetaBoxes
|
|
6
58
|
});
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
exports.isMetaBoxLocationActive = isMetaBoxLocationActive;
|
|
16
|
-
exports.isPublishSidebarOpened = exports.isPluginSidebarOpened = exports.isPluginItemPinned = exports.isModalActive = exports.isMetaBoxLocationVisible = void 0;
|
|
17
|
-
exports.isSavingMetaBoxes = isSavingMetaBoxes;
|
|
18
|
-
var _data = require("@wordpress/data");
|
|
19
|
-
var _preferences = require("@wordpress/preferences");
|
|
20
|
-
var _coreData = require("@wordpress/core-data");
|
|
21
|
-
var _editor = require("@wordpress/editor");
|
|
22
|
-
var _deprecated = _interopRequireDefault(require("@wordpress/deprecated"));
|
|
23
|
-
var _lockUnlock = require("../lock-unlock");
|
|
24
|
-
/**
|
|
25
|
-
* WordPress dependencies
|
|
26
|
-
*/
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* Internal dependencies
|
|
30
|
-
*/
|
|
31
|
-
|
|
32
|
-
const {
|
|
33
|
-
interfaceStore
|
|
34
|
-
} = (0, _lockUnlock.unlock)(_editor.privateApis);
|
|
59
|
+
module.exports = __toCommonJS(selectors_exports);
|
|
60
|
+
var import_data = require("@wordpress/data");
|
|
61
|
+
var import_preferences = require("@wordpress/preferences");
|
|
62
|
+
var import_core_data = require("@wordpress/core-data");
|
|
63
|
+
var import_editor = require("@wordpress/editor");
|
|
64
|
+
var import_deprecated = __toESM(require("@wordpress/deprecated"));
|
|
65
|
+
var import_lock_unlock = require("../lock-unlock");
|
|
66
|
+
const { interfaceStore } = (0, import_lock_unlock.unlock)(import_editor.privateApis);
|
|
35
67
|
const EMPTY_ARRAY = [];
|
|
36
68
|
const EMPTY_OBJECT = {};
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* Returns true if the plugin sidebar is opened.
|
|
64
|
-
*
|
|
65
|
-
* @param {Object} state Global application state.
|
|
66
|
-
*
|
|
67
|
-
* @return {boolean} Whether the plugin sidebar is opened.
|
|
68
|
-
*/
|
|
69
|
-
const isPluginSidebarOpened = exports.isPluginSidebarOpened = (0, _data.createRegistrySelector)(select => () => {
|
|
70
|
-
const activeGeneralSidebar = select(interfaceStore).getActiveComplementaryArea('core');
|
|
71
|
-
return !!activeGeneralSidebar && !['edit-post/document', 'edit-post/block'].includes(activeGeneralSidebar);
|
|
72
|
-
});
|
|
73
|
-
|
|
74
|
-
/**
|
|
75
|
-
* Returns the current active general sidebar name, or null if there is no
|
|
76
|
-
* general sidebar active. The active general sidebar is a unique name to
|
|
77
|
-
* identify either an editor or plugin sidebar.
|
|
78
|
-
*
|
|
79
|
-
* Examples:
|
|
80
|
-
*
|
|
81
|
-
* - `edit-post/document`
|
|
82
|
-
* - `my-plugin/insert-image-sidebar`
|
|
83
|
-
*
|
|
84
|
-
* @param {Object} state Global application state.
|
|
85
|
-
*
|
|
86
|
-
* @return {?string} Active general sidebar name.
|
|
87
|
-
*/
|
|
88
|
-
const getActiveGeneralSidebarName = exports.getActiveGeneralSidebarName = (0, _data.createRegistrySelector)(select => () => {
|
|
89
|
-
return select(interfaceStore).getActiveComplementaryArea('core');
|
|
90
|
-
});
|
|
91
|
-
|
|
92
|
-
/**
|
|
93
|
-
* Converts panels from the new preferences store format to the old format
|
|
94
|
-
* that the post editor previously used.
|
|
95
|
-
*
|
|
96
|
-
* The resultant converted data should look like this:
|
|
97
|
-
* {
|
|
98
|
-
* panelName: {
|
|
99
|
-
* enabled: false,
|
|
100
|
-
* opened: true,
|
|
101
|
-
* },
|
|
102
|
-
* anotherPanelName: {
|
|
103
|
-
* opened: true
|
|
104
|
-
* },
|
|
105
|
-
* }
|
|
106
|
-
*
|
|
107
|
-
* @param {string[] | undefined} inactivePanels An array of inactive panel names.
|
|
108
|
-
* @param {string[] | undefined} openPanels An array of open panel names.
|
|
109
|
-
*
|
|
110
|
-
* @return {Object} The converted panel data.
|
|
111
|
-
*/
|
|
69
|
+
const getEditorMode = (0, import_data.createRegistrySelector)(
|
|
70
|
+
(select) => () => select(import_preferences.store).get("core", "editorMode") ?? "visual"
|
|
71
|
+
);
|
|
72
|
+
const isEditorSidebarOpened = (0, import_data.createRegistrySelector)(
|
|
73
|
+
(select) => () => {
|
|
74
|
+
const activeGeneralSidebar = select(interfaceStore).getActiveComplementaryArea("core");
|
|
75
|
+
return ["edit-post/document", "edit-post/block"].includes(
|
|
76
|
+
activeGeneralSidebar
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
);
|
|
80
|
+
const isPluginSidebarOpened = (0, import_data.createRegistrySelector)(
|
|
81
|
+
(select) => () => {
|
|
82
|
+
const activeGeneralSidebar = select(interfaceStore).getActiveComplementaryArea("core");
|
|
83
|
+
return !!activeGeneralSidebar && !["edit-post/document", "edit-post/block"].includes(
|
|
84
|
+
activeGeneralSidebar
|
|
85
|
+
);
|
|
86
|
+
}
|
|
87
|
+
);
|
|
88
|
+
const getActiveGeneralSidebarName = (0, import_data.createRegistrySelector)(
|
|
89
|
+
(select) => () => {
|
|
90
|
+
return select(interfaceStore).getActiveComplementaryArea("core");
|
|
91
|
+
}
|
|
92
|
+
);
|
|
112
93
|
function convertPanelsToOldFormat(inactivePanels, openPanels) {
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
// Then reduce the open panels, passing in the result of the previous
|
|
123
|
-
// reduction as the initial value so that both open and inactive
|
|
124
|
-
// panel state is combined.
|
|
94
|
+
const panelsWithEnabledState = inactivePanels?.reduce(
|
|
95
|
+
(accumulatedPanels, panelName) => ({
|
|
96
|
+
...accumulatedPanels,
|
|
97
|
+
[panelName]: {
|
|
98
|
+
enabled: false
|
|
99
|
+
}
|
|
100
|
+
}),
|
|
101
|
+
{}
|
|
102
|
+
);
|
|
125
103
|
const panels = openPanels?.reduce((accumulatedPanels, panelName) => {
|
|
126
104
|
const currentPanelState = accumulatedPanels?.[panelName];
|
|
127
105
|
return {
|
|
@@ -131,385 +109,236 @@ function convertPanelsToOldFormat(inactivePanels, openPanels) {
|
|
|
131
109
|
opened: true
|
|
132
110
|
}
|
|
133
111
|
};
|
|
134
|
-
}, panelsWithEnabledState
|
|
135
|
-
|
|
136
|
-
// The panels variable will only be set if openPanels wasn't `undefined`.
|
|
137
|
-
// If it isn't set just return `panelsWithEnabledState`, and if that isn't
|
|
138
|
-
// set return an empty object.
|
|
139
|
-
return (_ref = panels !== null && panels !== void 0 ? panels : panelsWithEnabledState) !== null && _ref !== void 0 ? _ref : EMPTY_OBJECT;
|
|
112
|
+
}, panelsWithEnabledState ?? {});
|
|
113
|
+
return panels ?? panelsWithEnabledState ?? EMPTY_OBJECT;
|
|
140
114
|
}
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
*
|
|
145
|
-
* @param {Object} state Global application state.
|
|
146
|
-
*
|
|
147
|
-
* @return {Object} Preferences Object.
|
|
148
|
-
*/
|
|
149
|
-
const getPreferences = exports.getPreferences = (0, _data.createRegistrySelector)(select => () => {
|
|
150
|
-
(0, _deprecated.default)(`select( 'core/edit-post' ).getPreferences`, {
|
|
151
|
-
since: '6.0',
|
|
115
|
+
const getPreferences = (0, import_data.createRegistrySelector)((select) => () => {
|
|
116
|
+
(0, import_deprecated.default)(`select( 'core/edit-post' ).getPreferences`, {
|
|
117
|
+
since: "6.0",
|
|
152
118
|
alternative: `select( 'core/preferences' ).get`
|
|
153
119
|
});
|
|
154
|
-
const corePreferences = [
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
const
|
|
120
|
+
const corePreferences = ["editorMode", "hiddenBlockTypes"].reduce(
|
|
121
|
+
(accumulatedPrefs, preferenceKey) => {
|
|
122
|
+
const value = select(import_preferences.store).get(
|
|
123
|
+
"core",
|
|
124
|
+
preferenceKey
|
|
125
|
+
);
|
|
126
|
+
return {
|
|
127
|
+
...accumulatedPrefs,
|
|
128
|
+
[preferenceKey]: value
|
|
129
|
+
};
|
|
130
|
+
},
|
|
131
|
+
{}
|
|
132
|
+
);
|
|
133
|
+
const inactivePanels = select(import_preferences.store).get(
|
|
134
|
+
"core",
|
|
135
|
+
"inactivePanels"
|
|
136
|
+
);
|
|
137
|
+
const openPanels = select(import_preferences.store).get("core", "openPanels");
|
|
168
138
|
const panels = convertPanelsToOldFormat(inactivePanels, openPanels);
|
|
169
139
|
return {
|
|
170
140
|
...corePreferences,
|
|
171
141
|
panels
|
|
172
142
|
};
|
|
173
143
|
});
|
|
174
|
-
|
|
175
|
-
/**
|
|
176
|
-
*
|
|
177
|
-
* @param {Object} state Global application state.
|
|
178
|
-
* @param {string} preferenceKey Preference Key.
|
|
179
|
-
* @param {*} defaultValue Default Value.
|
|
180
|
-
*
|
|
181
|
-
* @return {*} Preference Value.
|
|
182
|
-
*/
|
|
183
144
|
function getPreference(state, preferenceKey, defaultValue) {
|
|
184
|
-
(0,
|
|
185
|
-
since:
|
|
145
|
+
(0, import_deprecated.default)(`select( 'core/edit-post' ).getPreference`, {
|
|
146
|
+
since: "6.0",
|
|
186
147
|
alternative: `select( 'core/preferences' ).get`
|
|
187
148
|
});
|
|
188
|
-
|
|
189
|
-
// Avoid using the `getPreferences` registry selector where possible.
|
|
190
149
|
const preferences = getPreferences(state);
|
|
191
150
|
const value = preferences[preferenceKey];
|
|
192
|
-
return value ===
|
|
151
|
+
return value === void 0 ? defaultValue : value;
|
|
193
152
|
}
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
* Returns an array of blocks that are hidden.
|
|
197
|
-
*
|
|
198
|
-
* @return {Array} A list of the hidden block types
|
|
199
|
-
*/
|
|
200
|
-
const getHiddenBlockTypes = exports.getHiddenBlockTypes = (0, _data.createRegistrySelector)(select => () => {
|
|
201
|
-
var _select$get2;
|
|
202
|
-
return (_select$get2 = select(_preferences.store).get('core', 'hiddenBlockTypes')) !== null && _select$get2 !== void 0 ? _select$get2 : EMPTY_ARRAY;
|
|
203
|
-
});
|
|
204
|
-
|
|
205
|
-
/**
|
|
206
|
-
* Returns true if the publish sidebar is opened.
|
|
207
|
-
*
|
|
208
|
-
* @deprecated
|
|
209
|
-
*
|
|
210
|
-
* @param {Object} state Global application state
|
|
211
|
-
*
|
|
212
|
-
* @return {boolean} Whether the publish sidebar is open.
|
|
213
|
-
*/
|
|
214
|
-
const isPublishSidebarOpened = exports.isPublishSidebarOpened = (0, _data.createRegistrySelector)(select => () => {
|
|
215
|
-
(0, _deprecated.default)(`select( 'core/edit-post' ).isPublishSidebarOpened`, {
|
|
216
|
-
since: '6.6',
|
|
217
|
-
alternative: `select( 'core/editor' ).isPublishSidebarOpened`
|
|
218
|
-
});
|
|
219
|
-
return select(_editor.store).isPublishSidebarOpened();
|
|
220
|
-
});
|
|
221
|
-
|
|
222
|
-
/**
|
|
223
|
-
* Returns true if the given panel was programmatically removed, or false otherwise.
|
|
224
|
-
* All panels are not removed by default.
|
|
225
|
-
*
|
|
226
|
-
* @deprecated
|
|
227
|
-
*
|
|
228
|
-
* @param {Object} state Global application state.
|
|
229
|
-
* @param {string} panelName A string that identifies the panel.
|
|
230
|
-
*
|
|
231
|
-
* @return {boolean} Whether or not the panel is removed.
|
|
232
|
-
*/
|
|
233
|
-
const isEditorPanelRemoved = exports.isEditorPanelRemoved = (0, _data.createRegistrySelector)(select => (state, panelName) => {
|
|
234
|
-
(0, _deprecated.default)(`select( 'core/edit-post' ).isEditorPanelRemoved`, {
|
|
235
|
-
since: '6.5',
|
|
236
|
-
alternative: `select( 'core/editor' ).isEditorPanelRemoved`
|
|
237
|
-
});
|
|
238
|
-
return select(_editor.store).isEditorPanelRemoved(panelName);
|
|
153
|
+
const getHiddenBlockTypes = (0, import_data.createRegistrySelector)((select) => () => {
|
|
154
|
+
return select(import_preferences.store).get("core", "hiddenBlockTypes") ?? EMPTY_ARRAY;
|
|
239
155
|
});
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
}
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
*
|
|
313
|
-
* @param {Object} state Global application state.
|
|
314
|
-
* @param {string} pluginName Plugin item name.
|
|
315
|
-
*
|
|
316
|
-
* @return {boolean} Whether the plugin item is pinned.
|
|
317
|
-
*/
|
|
318
|
-
const isPluginItemPinned = exports.isPluginItemPinned = (0, _data.createRegistrySelector)(select => (state, pluginName) => {
|
|
319
|
-
return select(interfaceStore).isItemPinned('core', pluginName);
|
|
320
|
-
});
|
|
321
|
-
|
|
322
|
-
/**
|
|
323
|
-
* Returns an array of active meta box locations.
|
|
324
|
-
*
|
|
325
|
-
* @param {Object} state Post editor state.
|
|
326
|
-
*
|
|
327
|
-
* @return {string[]} Active meta box locations.
|
|
328
|
-
*/
|
|
329
|
-
const getActiveMetaBoxLocations = exports.getActiveMetaBoxLocations = (0, _data.createSelector)(state => {
|
|
330
|
-
return Object.keys(state.metaBoxes.locations).filter(location => isMetaBoxLocationActive(state, location));
|
|
331
|
-
}, state => [state.metaBoxes.locations]);
|
|
332
|
-
|
|
333
|
-
/**
|
|
334
|
-
* Returns true if a metabox location is active and visible
|
|
335
|
-
*
|
|
336
|
-
* @param {Object} state Post editor state.
|
|
337
|
-
* @param {string} location Meta box location to test.
|
|
338
|
-
*
|
|
339
|
-
* @return {boolean} Whether the meta box location is active and visible.
|
|
340
|
-
*/
|
|
341
|
-
const isMetaBoxLocationVisible = exports.isMetaBoxLocationVisible = (0, _data.createRegistrySelector)(select => (state, location) => {
|
|
342
|
-
return isMetaBoxLocationActive(state, location) && getMetaBoxesPerLocation(state, location)?.some(({
|
|
343
|
-
id
|
|
344
|
-
}) => {
|
|
345
|
-
return select(_editor.store).isEditorPanelEnabled(`meta-box-${id}`);
|
|
346
|
-
});
|
|
347
|
-
});
|
|
348
|
-
|
|
349
|
-
/**
|
|
350
|
-
* Returns true if there is an active meta box in the given location, or false
|
|
351
|
-
* otherwise.
|
|
352
|
-
*
|
|
353
|
-
* @param {Object} state Post editor state.
|
|
354
|
-
* @param {string} location Meta box location to test.
|
|
355
|
-
*
|
|
356
|
-
* @return {boolean} Whether the meta box location is active.
|
|
357
|
-
*/
|
|
156
|
+
const isPublishSidebarOpened = (0, import_data.createRegistrySelector)(
|
|
157
|
+
(select) => () => {
|
|
158
|
+
(0, import_deprecated.default)(`select( 'core/edit-post' ).isPublishSidebarOpened`, {
|
|
159
|
+
since: "6.6",
|
|
160
|
+
alternative: `select( 'core/editor' ).isPublishSidebarOpened`
|
|
161
|
+
});
|
|
162
|
+
return select(import_editor.store).isPublishSidebarOpened();
|
|
163
|
+
}
|
|
164
|
+
);
|
|
165
|
+
const isEditorPanelRemoved = (0, import_data.createRegistrySelector)(
|
|
166
|
+
(select) => (state, panelName) => {
|
|
167
|
+
(0, import_deprecated.default)(`select( 'core/edit-post' ).isEditorPanelRemoved`, {
|
|
168
|
+
since: "6.5",
|
|
169
|
+
alternative: `select( 'core/editor' ).isEditorPanelRemoved`
|
|
170
|
+
});
|
|
171
|
+
return select(import_editor.store).isEditorPanelRemoved(panelName);
|
|
172
|
+
}
|
|
173
|
+
);
|
|
174
|
+
const isEditorPanelEnabled = (0, import_data.createRegistrySelector)(
|
|
175
|
+
(select) => (state, panelName) => {
|
|
176
|
+
(0, import_deprecated.default)(`select( 'core/edit-post' ).isEditorPanelEnabled`, {
|
|
177
|
+
since: "6.5",
|
|
178
|
+
alternative: `select( 'core/editor' ).isEditorPanelEnabled`
|
|
179
|
+
});
|
|
180
|
+
return select(import_editor.store).isEditorPanelEnabled(panelName);
|
|
181
|
+
}
|
|
182
|
+
);
|
|
183
|
+
const isEditorPanelOpened = (0, import_data.createRegistrySelector)(
|
|
184
|
+
(select) => (state, panelName) => {
|
|
185
|
+
(0, import_deprecated.default)(`select( 'core/edit-post' ).isEditorPanelOpened`, {
|
|
186
|
+
since: "6.5",
|
|
187
|
+
alternative: `select( 'core/editor' ).isEditorPanelOpened`
|
|
188
|
+
});
|
|
189
|
+
return select(import_editor.store).isEditorPanelOpened(panelName);
|
|
190
|
+
}
|
|
191
|
+
);
|
|
192
|
+
const isModalActive = (0, import_data.createRegistrySelector)(
|
|
193
|
+
(select) => (state, modalName) => {
|
|
194
|
+
(0, import_deprecated.default)(`select( 'core/edit-post' ).isModalActive`, {
|
|
195
|
+
since: "6.3",
|
|
196
|
+
alternative: `select( 'core/interface' ).isModalActive`
|
|
197
|
+
});
|
|
198
|
+
return !!select(interfaceStore).isModalActive(modalName);
|
|
199
|
+
}
|
|
200
|
+
);
|
|
201
|
+
const isFeatureActive = (0, import_data.createRegistrySelector)(
|
|
202
|
+
(select) => (state, feature) => {
|
|
203
|
+
return !!select(import_preferences.store).get("core/edit-post", feature);
|
|
204
|
+
}
|
|
205
|
+
);
|
|
206
|
+
const isPluginItemPinned = (0, import_data.createRegistrySelector)(
|
|
207
|
+
(select) => (state, pluginName) => {
|
|
208
|
+
return select(interfaceStore).isItemPinned("core", pluginName);
|
|
209
|
+
}
|
|
210
|
+
);
|
|
211
|
+
const getActiveMetaBoxLocations = (0, import_data.createSelector)(
|
|
212
|
+
(state) => {
|
|
213
|
+
return Object.keys(state.metaBoxes.locations).filter(
|
|
214
|
+
(location) => isMetaBoxLocationActive(state, location)
|
|
215
|
+
);
|
|
216
|
+
},
|
|
217
|
+
(state) => [state.metaBoxes.locations]
|
|
218
|
+
);
|
|
219
|
+
const isMetaBoxLocationVisible = (0, import_data.createRegistrySelector)(
|
|
220
|
+
(select) => (state, location) => {
|
|
221
|
+
return isMetaBoxLocationActive(state, location) && getMetaBoxesPerLocation(state, location)?.some(({ id }) => {
|
|
222
|
+
return select(import_editor.store).isEditorPanelEnabled(
|
|
223
|
+
`meta-box-${id}`
|
|
224
|
+
);
|
|
225
|
+
});
|
|
226
|
+
}
|
|
227
|
+
);
|
|
358
228
|
function isMetaBoxLocationActive(state, location) {
|
|
359
229
|
const metaBoxes = getMetaBoxesPerLocation(state, location);
|
|
360
230
|
return !!metaBoxes && metaBoxes.length !== 0;
|
|
361
231
|
}
|
|
362
|
-
|
|
363
|
-
/**
|
|
364
|
-
* Returns the list of all the available meta boxes for a given location.
|
|
365
|
-
*
|
|
366
|
-
* @param {Object} state Global application state.
|
|
367
|
-
* @param {string} location Meta box location to test.
|
|
368
|
-
*
|
|
369
|
-
* @return {?Array} List of meta boxes.
|
|
370
|
-
*/
|
|
371
232
|
function getMetaBoxesPerLocation(state, location) {
|
|
372
233
|
return state.metaBoxes.locations[location];
|
|
373
234
|
}
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
* @return {Array} List of meta boxes.
|
|
381
|
-
*/
|
|
382
|
-
const getAllMetaBoxes = exports.getAllMetaBoxes = (0, _data.createSelector)(state => {
|
|
383
|
-
return Object.values(state.metaBoxes.locations).flat();
|
|
384
|
-
}, state => [state.metaBoxes.locations]);
|
|
385
|
-
|
|
386
|
-
/**
|
|
387
|
-
* Returns true if the post is using Meta Boxes
|
|
388
|
-
*
|
|
389
|
-
* @param {Object} state Global application state
|
|
390
|
-
*
|
|
391
|
-
* @return {boolean} Whether there are metaboxes or not.
|
|
392
|
-
*/
|
|
235
|
+
const getAllMetaBoxes = (0, import_data.createSelector)(
|
|
236
|
+
(state) => {
|
|
237
|
+
return Object.values(state.metaBoxes.locations).flat();
|
|
238
|
+
},
|
|
239
|
+
(state) => [state.metaBoxes.locations]
|
|
240
|
+
);
|
|
393
241
|
function hasMetaBoxes(state) {
|
|
394
242
|
return getActiveMetaBoxLocations(state).length > 0;
|
|
395
243
|
}
|
|
396
|
-
|
|
397
|
-
/**
|
|
398
|
-
* Returns true if the Meta Boxes are being saved.
|
|
399
|
-
*
|
|
400
|
-
* @param {Object} state Global application state.
|
|
401
|
-
*
|
|
402
|
-
* @return {boolean} Whether the metaboxes are being saved.
|
|
403
|
-
*/
|
|
404
244
|
function isSavingMetaBoxes(state) {
|
|
405
245
|
return state.metaBoxes.isSaving;
|
|
406
246
|
}
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
return select(_editor.store).getDeviceType();
|
|
424
|
-
});
|
|
425
|
-
|
|
426
|
-
/**
|
|
427
|
-
* Returns true if the inserter is opened.
|
|
428
|
-
*
|
|
429
|
-
* @deprecated
|
|
430
|
-
*
|
|
431
|
-
* @param {Object} state Global application state.
|
|
432
|
-
*
|
|
433
|
-
* @return {boolean} Whether the inserter is opened.
|
|
434
|
-
*/
|
|
435
|
-
const isInserterOpened = exports.isInserterOpened = (0, _data.createRegistrySelector)(select => () => {
|
|
436
|
-
(0, _deprecated.default)(`select( 'core/edit-post' ).isInserterOpened`, {
|
|
437
|
-
since: '6.5',
|
|
247
|
+
const __experimentalGetPreviewDeviceType = (0, import_data.createRegistrySelector)(
|
|
248
|
+
(select) => () => {
|
|
249
|
+
(0, import_deprecated.default)(
|
|
250
|
+
`select( 'core/edit-site' ).__experimentalGetPreviewDeviceType`,
|
|
251
|
+
{
|
|
252
|
+
since: "6.5",
|
|
253
|
+
version: "6.7",
|
|
254
|
+
alternative: `select( 'core/editor' ).getDeviceType`
|
|
255
|
+
}
|
|
256
|
+
);
|
|
257
|
+
return select(import_editor.store).getDeviceType();
|
|
258
|
+
}
|
|
259
|
+
);
|
|
260
|
+
const isInserterOpened = (0, import_data.createRegistrySelector)((select) => () => {
|
|
261
|
+
(0, import_deprecated.default)(`select( 'core/edit-post' ).isInserterOpened`, {
|
|
262
|
+
since: "6.5",
|
|
438
263
|
alternative: `select( 'core/editor' ).isInserterOpened`
|
|
439
264
|
});
|
|
440
|
-
return select(
|
|
265
|
+
return select(import_editor.store).isInserterOpened();
|
|
441
266
|
});
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
return (0, _lockUnlock.unlock)(select(_editor.store)).getInserter();
|
|
458
|
-
});
|
|
459
|
-
|
|
460
|
-
/**
|
|
461
|
-
* Returns true if the list view is opened.
|
|
462
|
-
*
|
|
463
|
-
* @param {Object} state Global application state.
|
|
464
|
-
*
|
|
465
|
-
* @return {boolean} Whether the list view is opened.
|
|
466
|
-
*/
|
|
467
|
-
const isListViewOpened = exports.isListViewOpened = (0, _data.createRegistrySelector)(select => () => {
|
|
468
|
-
(0, _deprecated.default)(`select( 'core/edit-post' ).isListViewOpened`, {
|
|
469
|
-
since: '6.5',
|
|
267
|
+
const __experimentalGetInsertionPoint = (0, import_data.createRegistrySelector)(
|
|
268
|
+
(select) => () => {
|
|
269
|
+
(0, import_deprecated.default)(
|
|
270
|
+
`select( 'core/edit-post' ).__experimentalGetInsertionPoint`,
|
|
271
|
+
{
|
|
272
|
+
since: "6.5",
|
|
273
|
+
version: "6.7"
|
|
274
|
+
}
|
|
275
|
+
);
|
|
276
|
+
return (0, import_lock_unlock.unlock)(select(import_editor.store)).getInserter();
|
|
277
|
+
}
|
|
278
|
+
);
|
|
279
|
+
const isListViewOpened = (0, import_data.createRegistrySelector)((select) => () => {
|
|
280
|
+
(0, import_deprecated.default)(`select( 'core/edit-post' ).isListViewOpened`, {
|
|
281
|
+
since: "6.5",
|
|
470
282
|
alternative: `select( 'core/editor' ).isListViewOpened`
|
|
471
283
|
});
|
|
472
|
-
return select(
|
|
284
|
+
return select(import_editor.store).isListViewOpened();
|
|
473
285
|
});
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
*
|
|
478
|
-
* @deprecated
|
|
479
|
-
*/
|
|
480
|
-
const isEditingTemplate = exports.isEditingTemplate = (0, _data.createRegistrySelector)(select => () => {
|
|
481
|
-
(0, _deprecated.default)(`select( 'core/edit-post' ).isEditingTemplate`, {
|
|
482
|
-
since: '6.5',
|
|
286
|
+
const isEditingTemplate = (0, import_data.createRegistrySelector)((select) => () => {
|
|
287
|
+
(0, import_deprecated.default)(`select( 'core/edit-post' ).isEditingTemplate`, {
|
|
288
|
+
since: "6.5",
|
|
483
289
|
alternative: `select( 'core/editor' ).getRenderingMode`
|
|
484
290
|
});
|
|
485
|
-
return select(
|
|
291
|
+
return select(import_editor.store).getCurrentPostType() === "wp_template";
|
|
486
292
|
});
|
|
487
|
-
|
|
488
|
-
/**
|
|
489
|
-
* Returns true if meta boxes are initialized.
|
|
490
|
-
*
|
|
491
|
-
* @param {Object} state Global application state.
|
|
492
|
-
*
|
|
493
|
-
* @return {boolean} Whether meta boxes are initialized.
|
|
494
|
-
*/
|
|
495
293
|
function areMetaBoxesInitialized(state) {
|
|
496
294
|
return state.metaBoxes.initialized;
|
|
497
295
|
}
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
296
|
+
const getEditedPostTemplate = (0, import_data.createRegistrySelector)(
|
|
297
|
+
(select) => () => {
|
|
298
|
+
const { id: postId, type: postType } = select(import_editor.store).getCurrentPost();
|
|
299
|
+
const templateId = (0, import_lock_unlock.unlock)(select(import_core_data.store)).getTemplateId(
|
|
300
|
+
postType,
|
|
301
|
+
postId
|
|
302
|
+
);
|
|
303
|
+
if (!templateId) {
|
|
304
|
+
return void 0;
|
|
305
|
+
}
|
|
306
|
+
return select(import_core_data.store).getEditedEntityRecord(
|
|
307
|
+
"postType",
|
|
308
|
+
"wp_template",
|
|
309
|
+
templateId
|
|
310
|
+
);
|
|
512
311
|
}
|
|
513
|
-
|
|
312
|
+
);
|
|
313
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
314
|
+
0 && (module.exports = {
|
|
315
|
+
__experimentalGetInsertionPoint,
|
|
316
|
+
__experimentalGetPreviewDeviceType,
|
|
317
|
+
areMetaBoxesInitialized,
|
|
318
|
+
getActiveGeneralSidebarName,
|
|
319
|
+
getActiveMetaBoxLocations,
|
|
320
|
+
getAllMetaBoxes,
|
|
321
|
+
getEditedPostTemplate,
|
|
322
|
+
getEditorMode,
|
|
323
|
+
getHiddenBlockTypes,
|
|
324
|
+
getMetaBoxesPerLocation,
|
|
325
|
+
getPreference,
|
|
326
|
+
getPreferences,
|
|
327
|
+
hasMetaBoxes,
|
|
328
|
+
isEditingTemplate,
|
|
329
|
+
isEditorPanelEnabled,
|
|
330
|
+
isEditorPanelOpened,
|
|
331
|
+
isEditorPanelRemoved,
|
|
332
|
+
isEditorSidebarOpened,
|
|
333
|
+
isFeatureActive,
|
|
334
|
+
isInserterOpened,
|
|
335
|
+
isListViewOpened,
|
|
336
|
+
isMetaBoxLocationActive,
|
|
337
|
+
isMetaBoxLocationVisible,
|
|
338
|
+
isModalActive,
|
|
339
|
+
isPluginItemPinned,
|
|
340
|
+
isPluginSidebarOpened,
|
|
341
|
+
isPublishSidebarOpened,
|
|
342
|
+
isSavingMetaBoxes
|
|
514
343
|
});
|
|
515
|
-
//# sourceMappingURL=selectors.js.map
|
|
344
|
+
//# sourceMappingURL=selectors.js.map
|