@wordpress/edit-post 8.34.0 → 8.34.1-next.2f1c7c01b.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 +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 +7 -5
- package/build/components/layout/index.js.map +1 -1
- package/build/components/layout/use-padding-appender.js +5 -3
- package/build/components/layout/use-padding-appender.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 +6 -5
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/layout/use-padding-appender.js +4 -3
- package/build-module/components/layout/use-padding-appender.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/use-padding-appender.js +2 -2
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
// packages/edit-post/src/store/actions.js
|
|
1
2
|
import apiFetch from "@wordpress/api-fetch";
|
|
2
3
|
import { store as preferencesStore } from "@wordpress/preferences";
|
|
3
4
|
import {
|
|
@@ -11,76 +12,76 @@ import { store as noticesStore } from "@wordpress/notices";
|
|
|
11
12
|
import { __ } from "@wordpress/i18n";
|
|
12
13
|
import { getMetaBoxContainer } from "../utils/meta-boxes";
|
|
13
14
|
import { unlock } from "../lock-unlock";
|
|
14
|
-
|
|
15
|
-
|
|
15
|
+
var { interfaceStore } = unlock(editorPrivateApis);
|
|
16
|
+
var openGeneralSidebar = (name) => ({ registry }) => {
|
|
16
17
|
registry.dispatch(interfaceStore).enableComplementaryArea("core", name);
|
|
17
18
|
};
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
var closeGeneralSidebar = () => ({ registry }) => registry.dispatch(interfaceStore).disableComplementaryArea("core");
|
|
20
|
+
var openModal = (name) => ({ registry }) => {
|
|
20
21
|
deprecated("select( 'core/edit-post' ).openModal( name )", {
|
|
21
22
|
since: "6.3",
|
|
22
23
|
alternative: "select( 'core/interface').openModal( name )"
|
|
23
24
|
});
|
|
24
25
|
return registry.dispatch(interfaceStore).openModal(name);
|
|
25
26
|
};
|
|
26
|
-
|
|
27
|
+
var closeModal = () => ({ registry }) => {
|
|
27
28
|
deprecated("select( 'core/edit-post' ).closeModal()", {
|
|
28
29
|
since: "6.3",
|
|
29
30
|
alternative: "select( 'core/interface').closeModal()"
|
|
30
31
|
});
|
|
31
32
|
return registry.dispatch(interfaceStore).closeModal();
|
|
32
33
|
};
|
|
33
|
-
|
|
34
|
+
var openPublishSidebar = () => ({ registry }) => {
|
|
34
35
|
deprecated("dispatch( 'core/edit-post' ).openPublishSidebar", {
|
|
35
36
|
since: "6.6",
|
|
36
37
|
alternative: "dispatch( 'core/editor').openPublishSidebar"
|
|
37
38
|
});
|
|
38
39
|
registry.dispatch(editorStore).openPublishSidebar();
|
|
39
40
|
};
|
|
40
|
-
|
|
41
|
+
var closePublishSidebar = () => ({ registry }) => {
|
|
41
42
|
deprecated("dispatch( 'core/edit-post' ).closePublishSidebar", {
|
|
42
43
|
since: "6.6",
|
|
43
44
|
alternative: "dispatch( 'core/editor').closePublishSidebar"
|
|
44
45
|
});
|
|
45
46
|
registry.dispatch(editorStore).closePublishSidebar();
|
|
46
47
|
};
|
|
47
|
-
|
|
48
|
+
var togglePublishSidebar = () => ({ registry }) => {
|
|
48
49
|
deprecated("dispatch( 'core/edit-post' ).togglePublishSidebar", {
|
|
49
50
|
since: "6.6",
|
|
50
51
|
alternative: "dispatch( 'core/editor').togglePublishSidebar"
|
|
51
52
|
});
|
|
52
53
|
registry.dispatch(editorStore).togglePublishSidebar();
|
|
53
54
|
};
|
|
54
|
-
|
|
55
|
+
var toggleEditorPanelEnabled = (panelName) => ({ registry }) => {
|
|
55
56
|
deprecated("dispatch( 'core/edit-post' ).toggleEditorPanelEnabled", {
|
|
56
57
|
since: "6.5",
|
|
57
58
|
alternative: "dispatch( 'core/editor').toggleEditorPanelEnabled"
|
|
58
59
|
});
|
|
59
60
|
registry.dispatch(editorStore).toggleEditorPanelEnabled(panelName);
|
|
60
61
|
};
|
|
61
|
-
|
|
62
|
+
var toggleEditorPanelOpened = (panelName) => ({ registry }) => {
|
|
62
63
|
deprecated("dispatch( 'core/edit-post' ).toggleEditorPanelOpened", {
|
|
63
64
|
since: "6.5",
|
|
64
65
|
alternative: "dispatch( 'core/editor').toggleEditorPanelOpened"
|
|
65
66
|
});
|
|
66
67
|
registry.dispatch(editorStore).toggleEditorPanelOpened(panelName);
|
|
67
68
|
};
|
|
68
|
-
|
|
69
|
+
var removeEditorPanel = (panelName) => ({ registry }) => {
|
|
69
70
|
deprecated("dispatch( 'core/edit-post' ).removeEditorPanel", {
|
|
70
71
|
since: "6.5",
|
|
71
72
|
alternative: "dispatch( 'core/editor').removeEditorPanel"
|
|
72
73
|
});
|
|
73
74
|
registry.dispatch(editorStore).removeEditorPanel(panelName);
|
|
74
75
|
};
|
|
75
|
-
|
|
76
|
-
|
|
76
|
+
var toggleFeature = (feature) => ({ registry }) => registry.dispatch(preferencesStore).toggle("core/edit-post", feature);
|
|
77
|
+
var switchEditorMode = (mode) => ({ registry }) => {
|
|
77
78
|
deprecated("dispatch( 'core/edit-post' ).switchEditorMode", {
|
|
78
79
|
since: "6.6",
|
|
79
80
|
alternative: "dispatch( 'core/editor').switchEditorMode"
|
|
80
81
|
});
|
|
81
82
|
registry.dispatch(editorStore).switchEditorMode(mode);
|
|
82
83
|
};
|
|
83
|
-
|
|
84
|
+
var togglePinnedPluginItem = (pluginName) => ({ registry }) => {
|
|
84
85
|
const isPinned = registry.select(interfaceStore).isItemPinned("core", pluginName);
|
|
85
86
|
registry.dispatch(interfaceStore)[isPinned ? "unpinItem" : "pinItem"]("core", pluginName);
|
|
86
87
|
};
|
|
@@ -91,10 +92,10 @@ function updatePreferredStyleVariations() {
|
|
|
91
92
|
});
|
|
92
93
|
return { type: "NOTHING" };
|
|
93
94
|
}
|
|
94
|
-
|
|
95
|
+
var showBlockTypes = (blockNames) => ({ registry }) => {
|
|
95
96
|
unlock(registry.dispatch(editorStore)).showBlockTypes(blockNames);
|
|
96
97
|
};
|
|
97
|
-
|
|
98
|
+
var hideBlockTypes = (blockNames) => ({ registry }) => {
|
|
98
99
|
unlock(registry.dispatch(editorStore)).hideBlockTypes(blockNames);
|
|
99
100
|
};
|
|
100
101
|
function setAvailableMetaBoxesPerLocation(metaBoxesPerLocation) {
|
|
@@ -103,7 +104,7 @@ function setAvailableMetaBoxesPerLocation(metaBoxesPerLocation) {
|
|
|
103
104
|
metaBoxesPerLocation
|
|
104
105
|
};
|
|
105
106
|
}
|
|
106
|
-
|
|
107
|
+
var requestMetaBoxUpdates = () => async ({ registry, select, dispatch }) => {
|
|
107
108
|
dispatch({
|
|
108
109
|
type: "REQUEST_META_BOX_UPDATES"
|
|
109
110
|
});
|
|
@@ -160,7 +161,7 @@ function metaBoxUpdatesFailure() {
|
|
|
160
161
|
type: "META_BOX_UPDATES_FAILURE"
|
|
161
162
|
};
|
|
162
163
|
}
|
|
163
|
-
|
|
164
|
+
var __experimentalSetPreviewDeviceType = (deviceType) => ({ registry }) => {
|
|
164
165
|
deprecated(
|
|
165
166
|
"dispatch( 'core/edit-post' ).__experimentalSetPreviewDeviceType",
|
|
166
167
|
{
|
|
@@ -171,14 +172,14 @@ const __experimentalSetPreviewDeviceType = (deviceType) => ({ registry }) => {
|
|
|
171
172
|
);
|
|
172
173
|
registry.dispatch(editorStore).setDeviceType(deviceType);
|
|
173
174
|
};
|
|
174
|
-
|
|
175
|
+
var setIsInserterOpened = (value) => ({ registry }) => {
|
|
175
176
|
deprecated("dispatch( 'core/edit-post' ).setIsInserterOpened", {
|
|
176
177
|
since: "6.5",
|
|
177
178
|
alternative: "dispatch( 'core/editor').setIsInserterOpened"
|
|
178
179
|
});
|
|
179
180
|
registry.dispatch(editorStore).setIsInserterOpened(value);
|
|
180
181
|
};
|
|
181
|
-
|
|
182
|
+
var setIsListViewOpened = (isOpen) => ({ registry }) => {
|
|
182
183
|
deprecated("dispatch( 'core/edit-post' ).setIsListViewOpened", {
|
|
183
184
|
since: "6.5",
|
|
184
185
|
alternative: "dispatch( 'core/editor').setIsListViewOpened"
|
|
@@ -198,8 +199,8 @@ function __unstableCreateTemplate() {
|
|
|
198
199
|
});
|
|
199
200
|
return { type: "NOTHING" };
|
|
200
201
|
}
|
|
201
|
-
|
|
202
|
-
|
|
202
|
+
var metaBoxesInitialized = false;
|
|
203
|
+
var initializeMetaBoxes = () => ({ registry, select, dispatch }) => {
|
|
203
204
|
const isEditorReady = registry.select(editorStore).__unstableIsEditorReady();
|
|
204
205
|
if (!isEditorReady) {
|
|
205
206
|
return;
|
|
@@ -225,14 +226,14 @@ const initializeMetaBoxes = () => ({ registry, select, dispatch }) => {
|
|
|
225
226
|
type: "META_BOXES_INITIALIZED"
|
|
226
227
|
});
|
|
227
228
|
};
|
|
228
|
-
|
|
229
|
+
var toggleDistractionFree = () => ({ registry }) => {
|
|
229
230
|
deprecated("dispatch( 'core/edit-post' ).toggleDistractionFree", {
|
|
230
231
|
since: "6.6",
|
|
231
232
|
alternative: "dispatch( 'core/editor').toggleDistractionFree"
|
|
232
233
|
});
|
|
233
234
|
registry.dispatch(editorStore).toggleDistractionFree();
|
|
234
235
|
};
|
|
235
|
-
|
|
236
|
+
var toggleFullscreenMode = () => ({ registry }) => {
|
|
236
237
|
const isFullscreen = registry.select(preferencesStore).get("core/edit-post", "fullscreenMode");
|
|
237
238
|
registry.dispatch(preferencesStore).toggle("core/edit-post", "fullscreenMode");
|
|
238
239
|
registry.dispatch(noticesStore).createInfoNotice(
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/store/actions.js"],
|
|
4
4
|
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport apiFetch from '@wordpress/api-fetch';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport {\n\tstore as editorStore,\n\tprivateApis as editorPrivateApis,\n} from '@wordpress/editor';\nimport deprecated from '@wordpress/deprecated';\nimport { addAction } from '@wordpress/hooks';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { getMetaBoxContainer } from '../utils/meta-boxes';\nimport { unlock } from '../lock-unlock';\n\nconst { interfaceStore } = unlock( editorPrivateApis );\n\n/**\n * Returns an action object used in signalling that the user opened an editor sidebar.\n *\n * @param {?string} name Sidebar name to be opened.\n */\nexport const openGeneralSidebar =\n\t( name ) =>\n\t( { registry } ) => {\n\t\tregistry\n\t\t\t.dispatch( interfaceStore )\n\t\t\t.enableComplementaryArea( 'core', name );\n\t};\n\n/**\n * Returns an action object signalling that the user closed the sidebar.\n */\nexport const closeGeneralSidebar =\n\t() =>\n\t( { registry } ) =>\n\t\tregistry.dispatch( interfaceStore ).disableComplementaryArea( 'core' );\n\n/**\n * Returns an action object used in signalling that the user opened a modal.\n *\n * @deprecated since WP 6.3 use `core/interface` store's action with the same name instead.\n *\n *\n * @param {string} name A string that uniquely identifies the modal.\n *\n * @return {Object} Action object.\n */\nexport const openModal =\n\t( name ) =>\n\t( { registry } ) => {\n\t\tdeprecated( \"select( 'core/edit-post' ).openModal( name )\", {\n\t\t\tsince: '6.3',\n\t\t\talternative: \"select( 'core/interface').openModal( name )\",\n\t\t} );\n\t\treturn registry.dispatch( interfaceStore ).openModal( name );\n\t};\n\n/**\n * Returns an action object signalling that the user closed a modal.\n *\n * @deprecated since WP 6.3 use `core/interface` store's action with the same name instead.\n *\n * @return {Object} Action object.\n */\nexport const closeModal =\n\t() =>\n\t( { registry } ) => {\n\t\tdeprecated( \"select( 'core/edit-post' ).closeModal()\", {\n\t\t\tsince: '6.3',\n\t\t\talternative: \"select( 'core/interface').closeModal()\",\n\t\t} );\n\t\treturn registry.dispatch( interfaceStore ).closeModal();\n\t};\n\n/**\n * Returns an action object used in signalling that the user opened the publish\n * sidebar.\n * @deprecated\n *\n * @return {Object} Action object\n */\nexport const openPublishSidebar =\n\t() =>\n\t( { registry } ) => {\n\t\tdeprecated( \"dispatch( 'core/edit-post' ).openPublishSidebar\", {\n\t\t\tsince: '6.6',\n\t\t\talternative: \"dispatch( 'core/editor').openPublishSidebar\",\n\t\t} );\n\t\tregistry.dispatch( editorStore ).openPublishSidebar();\n\t};\n\n/**\n * Returns an action object used in signalling that the user closed the\n * publish sidebar.\n * @deprecated\n *\n * @return {Object} Action object.\n */\nexport const closePublishSidebar =\n\t() =>\n\t( { registry } ) => {\n\t\tdeprecated( \"dispatch( 'core/edit-post' ).closePublishSidebar\", {\n\t\t\tsince: '6.6',\n\t\t\talternative: \"dispatch( 'core/editor').closePublishSidebar\",\n\t\t} );\n\t\tregistry.dispatch( editorStore ).closePublishSidebar();\n\t};\n\n/**\n * Returns an action object used in signalling that the user toggles the publish sidebar.\n * @deprecated\n *\n * @return {Object} Action object\n */\nexport const togglePublishSidebar =\n\t() =>\n\t( { registry } ) => {\n\t\tdeprecated( \"dispatch( 'core/edit-post' ).togglePublishSidebar\", {\n\t\t\tsince: '6.6',\n\t\t\talternative: \"dispatch( 'core/editor').togglePublishSidebar\",\n\t\t} );\n\t\tregistry.dispatch( editorStore ).togglePublishSidebar();\n\t};\n\n/**\n * Returns an action object used to enable or disable a panel in the editor.\n *\n * @deprecated\n *\n * @param {string} panelName A string that identifies the panel to enable or disable.\n *\n * @return {Object} Action object.\n */\nexport const toggleEditorPanelEnabled =\n\t( panelName ) =>\n\t( { registry } ) => {\n\t\tdeprecated( \"dispatch( 'core/edit-post' ).toggleEditorPanelEnabled\", {\n\t\t\tsince: '6.5',\n\t\t\talternative: \"dispatch( 'core/editor').toggleEditorPanelEnabled\",\n\t\t} );\n\t\tregistry.dispatch( editorStore ).toggleEditorPanelEnabled( panelName );\n\t};\n\n/**\n * Opens a closed panel and closes an open panel.\n *\n * @deprecated\n *\n * @param {string} panelName A string that identifies the panel to open or close.\n */\nexport const toggleEditorPanelOpened =\n\t( panelName ) =>\n\t( { registry } ) => {\n\t\tdeprecated( \"dispatch( 'core/edit-post' ).toggleEditorPanelOpened\", {\n\t\t\tsince: '6.5',\n\t\t\talternative: \"dispatch( 'core/editor').toggleEditorPanelOpened\",\n\t\t} );\n\t\tregistry.dispatch( editorStore ).toggleEditorPanelOpened( panelName );\n\t};\n\n/**\n * Returns an action object used to remove a panel from the editor.\n *\n * @deprecated\n *\n * @param {string} panelName A string that identifies the panel to remove.\n *\n * @return {Object} Action object.\n */\nexport const removeEditorPanel =\n\t( panelName ) =>\n\t( { registry } ) => {\n\t\tdeprecated( \"dispatch( 'core/edit-post' ).removeEditorPanel\", {\n\t\t\tsince: '6.5',\n\t\t\talternative: \"dispatch( 'core/editor').removeEditorPanel\",\n\t\t} );\n\t\tregistry.dispatch( editorStore ).removeEditorPanel( panelName );\n\t};\n\n/**\n * Triggers an action used to toggle a feature flag.\n *\n * @param {string} feature Feature name.\n */\nexport const toggleFeature =\n\t( feature ) =>\n\t( { registry } ) =>\n\t\tregistry\n\t\t\t.dispatch( preferencesStore )\n\t\t\t.toggle( 'core/edit-post', feature );\n\n/**\n * Triggers an action used to switch editor mode.\n *\n * @deprecated\n *\n * @param {string} mode The editor mode.\n */\nexport const switchEditorMode =\n\t( mode ) =>\n\t( { registry } ) => {\n\t\tdeprecated( \"dispatch( 'core/edit-post' ).switchEditorMode\", {\n\t\t\tsince: '6.6',\n\t\t\talternative: \"dispatch( 'core/editor').switchEditorMode\",\n\t\t} );\n\t\tregistry.dispatch( editorStore ).switchEditorMode( mode );\n\t};\n\n/**\n * Triggers an action object used to toggle a plugin name flag.\n *\n * @param {string} pluginName Plugin name.\n */\nexport const togglePinnedPluginItem =\n\t( pluginName ) =>\n\t( { registry } ) => {\n\t\tconst isPinned = registry\n\t\t\t.select( interfaceStore )\n\t\t\t.isItemPinned( 'core', pluginName );\n\n\t\tregistry\n\t\t\t.dispatch( interfaceStore )\n\t\t\t[ isPinned ? 'unpinItem' : 'pinItem' ]( 'core', pluginName );\n\t};\n\n/**\n * Returns an action object used in signaling that a style should be auto-applied when a block is created.\n *\n * @deprecated\n */\nexport function updatePreferredStyleVariations() {\n\tdeprecated( \"dispatch( 'core/edit-post' ).updatePreferredStyleVariations\", {\n\t\tsince: '6.6',\n\t\thint: 'Preferred Style Variations are not supported anymore.',\n\t} );\n\treturn { type: 'NOTHING' };\n}\n\n/**\n * Update the provided block types to be visible.\n *\n * @param {string[]} blockNames Names of block types to show.\n */\nexport const showBlockTypes =\n\t( blockNames ) =>\n\t( { registry } ) => {\n\t\tunlock( registry.dispatch( editorStore ) ).showBlockTypes( blockNames );\n\t};\n\n/**\n * Update the provided block types to be hidden.\n *\n * @param {string[]} blockNames Names of block types to hide.\n */\nexport const hideBlockTypes =\n\t( blockNames ) =>\n\t( { registry } ) => {\n\t\tunlock( registry.dispatch( editorStore ) ).hideBlockTypes( blockNames );\n\t};\n\n/**\n * Stores info about which Meta boxes are available in which location.\n *\n * @param {Object} metaBoxesPerLocation Meta boxes per location.\n */\nexport function setAvailableMetaBoxesPerLocation( metaBoxesPerLocation ) {\n\treturn {\n\t\ttype: 'SET_META_BOXES_PER_LOCATIONS',\n\t\tmetaBoxesPerLocation,\n\t};\n}\n\n/**\n * Update a metabox.\n */\nexport const requestMetaBoxUpdates =\n\t() =>\n\tasync ( { registry, select, dispatch } ) => {\n\t\tdispatch( {\n\t\t\ttype: 'REQUEST_META_BOX_UPDATES',\n\t\t} );\n\n\t\t// Saves the wp_editor fields.\n\t\tif ( window.tinyMCE ) {\n\t\t\twindow.tinyMCE.triggerSave();\n\t\t}\n\n\t\t// We gather the base form data.\n\t\tconst baseFormData = new window.FormData(\n\t\t\tdocument.querySelector( '.metabox-base-form' )\n\t\t);\n\n\t\tconst postId = baseFormData.get( 'post_ID' );\n\t\tconst postType = baseFormData.get( 'post_type' );\n\n\t\t// Additional data needed for backward compatibility.\n\t\t// If we do not provide this data, the post will be overridden with the default values.\n\t\t// We cannot rely on getCurrentPost because right now on the editor we may be editing a pattern or a template.\n\t\t// We need to retrieve the post that the base form data is referring to.\n\t\tconst post = registry\n\t\t\t.select( coreStore )\n\t\t\t.getEditedEntityRecord( 'postType', postType, postId );\n\t\tconst additionalData = [\n\t\t\tpost.comment_status\n\t\t\t\t? [ 'comment_status', post.comment_status ]\n\t\t\t\t: false,\n\t\t\tpost.ping_status ? [ 'ping_status', post.ping_status ] : false,\n\t\t\tpost.sticky ? [ 'sticky', post.sticky ] : false,\n\t\t\tpost.author ? [ 'post_author', post.author ] : false,\n\t\t].filter( Boolean );\n\n\t\t// We gather all the metaboxes locations.\n\t\tconst activeMetaBoxLocations = select.getActiveMetaBoxLocations();\n\t\tconst formDataToMerge = [\n\t\t\tbaseFormData,\n\t\t\t...activeMetaBoxLocations.map(\n\t\t\t\t( location ) =>\n\t\t\t\t\tnew window.FormData( getMetaBoxContainer( location ) )\n\t\t\t),\n\t\t];\n\n\t\t// Merge all form data objects into a single one.\n\t\tconst formData = formDataToMerge.reduce( ( memo, currentFormData ) => {\n\t\t\tfor ( const [ key, value ] of currentFormData ) {\n\t\t\t\tmemo.append( key, value );\n\t\t\t}\n\t\t\treturn memo;\n\t\t}, new window.FormData() );\n\t\tadditionalData.forEach( ( [ key, value ] ) =>\n\t\t\tformData.append( key, value )\n\t\t);\n\n\t\ttry {\n\t\t\t// Save the metaboxes.\n\t\t\tawait apiFetch( {\n\t\t\t\turl: window._wpMetaBoxUrl,\n\t\t\t\tmethod: 'POST',\n\t\t\t\tbody: formData,\n\t\t\t\tparse: false,\n\t\t\t} );\n\t\t\tdispatch.metaBoxUpdatesSuccess();\n\t\t} catch {\n\t\t\tdispatch.metaBoxUpdatesFailure();\n\t\t}\n\t};\n\n/**\n * Returns an action object used to signal a successful meta box update.\n *\n * @return {Object} Action object.\n */\nexport function metaBoxUpdatesSuccess() {\n\treturn {\n\t\ttype: 'META_BOX_UPDATES_SUCCESS',\n\t};\n}\n\n/**\n * Returns an action object used to signal a failed meta box update.\n *\n * @return {Object} Action object.\n */\nexport function metaBoxUpdatesFailure() {\n\treturn {\n\t\ttype: 'META_BOX_UPDATES_FAILURE',\n\t};\n}\n\n/**\n * Action that changes the width of the editing canvas.\n *\n * @deprecated\n *\n * @param {string} deviceType\n */\nexport const __experimentalSetPreviewDeviceType =\n\t( deviceType ) =>\n\t( { registry } ) => {\n\t\tdeprecated(\n\t\t\t\"dispatch( 'core/edit-post' ).__experimentalSetPreviewDeviceType\",\n\t\t\t{\n\t\t\t\tsince: '6.5',\n\t\t\t\tversion: '6.7',\n\t\t\t\thint: 'registry.dispatch( editorStore ).setDeviceType',\n\t\t\t}\n\t\t);\n\t\tregistry.dispatch( editorStore ).setDeviceType( deviceType );\n\t};\n\n/**\n * Returns an action object used to open/close the inserter.\n *\n * @deprecated\n *\n * @param {boolean|Object} value Whether the inserter should be opened (true) or closed (false).\n */\nexport const setIsInserterOpened =\n\t( value ) =>\n\t( { registry } ) => {\n\t\tdeprecated( \"dispatch( 'core/edit-post' ).setIsInserterOpened\", {\n\t\t\tsince: '6.5',\n\t\t\talternative: \"dispatch( 'core/editor').setIsInserterOpened\",\n\t\t} );\n\t\tregistry.dispatch( editorStore ).setIsInserterOpened( value );\n\t};\n\n/**\n * Returns an action object used to open/close the list view.\n *\n * @deprecated\n *\n * @param {boolean} isOpen A boolean representing whether the list view should be opened or closed.\n */\nexport const setIsListViewOpened =\n\t( isOpen ) =>\n\t( { registry } ) => {\n\t\tdeprecated( \"dispatch( 'core/edit-post' ).setIsListViewOpened\", {\n\t\t\tsince: '6.5',\n\t\t\talternative: \"dispatch( 'core/editor').setIsListViewOpened\",\n\t\t} );\n\t\tregistry.dispatch( editorStore ).setIsListViewOpened( isOpen );\n\t};\n\n/**\n * Returns an action object used to switch to template editing.\n *\n * @deprecated\n */\nexport function setIsEditingTemplate() {\n\tdeprecated( \"dispatch( 'core/edit-post' ).setIsEditingTemplate\", {\n\t\tsince: '6.5',\n\t\talternative: \"dispatch( 'core/editor').setRenderingMode\",\n\t} );\n\treturn { type: 'NOTHING' };\n}\n\n/**\n * Create a block based template.\n *\n * @deprecated\n */\nexport function __unstableCreateTemplate() {\n\tdeprecated( \"dispatch( 'core/edit-post' ).__unstableCreateTemplate\", {\n\t\tsince: '6.5',\n\t} );\n\treturn { type: 'NOTHING' };\n}\n\nlet metaBoxesInitialized = false;\n\n/**\n * Initializes WordPress `postboxes` script and the logic for saving meta boxes.\n */\nexport const initializeMetaBoxes =\n\t() =>\n\t( { registry, select, dispatch } ) => {\n\t\tconst isEditorReady = registry\n\t\t\t.select( editorStore )\n\t\t\t.__unstableIsEditorReady();\n\n\t\tif ( ! isEditorReady ) {\n\t\t\treturn;\n\t\t}\n\t\t// Only initialize once.\n\t\tif ( metaBoxesInitialized ) {\n\t\t\treturn;\n\t\t}\n\t\tconst postType = registry.select( editorStore ).getCurrentPostType();\n\t\tif ( window.postboxes.page !== postType ) {\n\t\t\twindow.postboxes.add_postbox_toggles( postType );\n\t\t}\n\n\t\tmetaBoxesInitialized = true;\n\n\t\t// Save metaboxes on save completion, except for autosaves.\n\t\taddAction(\n\t\t\t'editor.savePost',\n\t\t\t'core/edit-post/save-metaboxes',\n\t\t\tasync ( post, options ) => {\n\t\t\t\tif ( ! options.isAutosave && select.hasMetaBoxes() ) {\n\t\t\t\t\tawait dispatch.requestMetaBoxUpdates();\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\n\t\tdispatch( {\n\t\t\ttype: 'META_BOXES_INITIALIZED',\n\t\t} );\n\t};\n\n/**\n * Action that toggles Distraction free mode.\n * Distraction free mode expects there are no sidebars, as due to the\n * z-index values set, you can't close sidebars.\n *\n * @deprecated\n */\nexport const toggleDistractionFree =\n\t() =>\n\t( { registry } ) => {\n\t\tdeprecated( \"dispatch( 'core/edit-post' ).toggleDistractionFree\", {\n\t\t\tsince: '6.6',\n\t\t\talternative: \"dispatch( 'core/editor').toggleDistractionFree\",\n\t\t} );\n\t\tregistry.dispatch( editorStore ).toggleDistractionFree();\n\t};\n\n/**\n * Action that toggles the Fullscreen Mode view option.\n */\nexport const toggleFullscreenMode =\n\t() =>\n\t( { registry } ) => {\n\t\tconst isFullscreen = registry\n\t\t\t.select( preferencesStore )\n\t\t\t.get( 'core/edit-post', 'fullscreenMode' );\n\n\t\tregistry\n\t\t\t.dispatch( preferencesStore )\n\t\t\t.toggle( 'core/edit-post', 'fullscreenMode' );\n\n\t\tregistry\n\t\t\t.dispatch( noticesStore )\n\t\t\t.createInfoNotice(\n\t\t\t\tisFullscreen\n\t\t\t\t\t? __( 'Fullscreen mode deactivated.' )\n\t\t\t\t\t: __( 'Fullscreen mode activated.' ),\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\n\t\t\t\t\t\t\tonClick: () => {\n\t\t\t\t\t\t\t\tregistry\n\t\t\t\t\t\t\t\t\t.dispatch( preferencesStore )\n\t\t\t\t\t\t\t\t\t.toggle(\n\t\t\t\t\t\t\t\t\t\t'core/edit-post',\n\t\t\t\t\t\t\t\t\t\t'fullscreenMode'\n\t\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}\n\t\t\t);\n\t};\n"],
|
|
5
|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,IAAK,kBAAkB,gBAAiB;AAE1C,WACE,SAAU,gBAAiB,EAC3B,OAAQ,kBAAkB,gBAAiB;AAE7C,WACE,SAAU,YAAa,EACvB;AAAA,IACA,eACG,GAAI,8BAA+B,IACnC,GAAI,4BAA6B;AAAA,IACpC;AAAA,MACC,IAAI;AAAA,MACJ,MAAM;AAAA,MACN,SAAS;AAAA,QACR;AAAA,UACC,OAAO,GAAI,MAAO;AAAA,UAElB,SAAS,MAAM;AACd,qBACE,SAAU,gBAAiB,EAC3B;AAAA,cACA;AAAA,cACA;AAAA,YACD;AAAA,UACF;AAAA,QACD;AAAA,MACD;AAAA,IACD;AAAA,EACD;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
// packages/edit-post/src/store/constants.js
|
|
2
|
+
var STORE_NAME = "core/edit-post";
|
|
3
|
+
var VIEW_AS_LINK_SELECTOR = "#wp-admin-bar-view a";
|
|
4
|
+
var VIEW_AS_PREVIEW_LINK_SELECTOR = "#wp-admin-bar-preview a";
|
|
4
5
|
export {
|
|
5
6
|
STORE_NAME,
|
|
6
7
|
VIEW_AS_LINK_SELECTOR,
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/store/constants.js"],
|
|
4
4
|
"sourcesContent": ["/**\n * The identifier for the data store.\n *\n * @type {string}\n */\nexport const STORE_NAME = 'core/edit-post';\n\n/**\n * CSS selector string for the admin bar view post link anchor tag.\n *\n * @type {string}\n */\nexport const VIEW_AS_LINK_SELECTOR = '#wp-admin-bar-view a';\n\n/**\n * CSS selector string for the admin bar preview post link anchor tag.\n *\n * @type {string}\n */\nexport const VIEW_AS_PREVIEW_LINK_SELECTOR = '#wp-admin-bar-preview a';\n"],
|
|
5
|
-
"mappings": "AAKO,
|
|
5
|
+
"mappings": ";AAKO,IAAM,aAAa;AAOnB,IAAM,wBAAwB;AAO9B,IAAM,gCAAgC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
// packages/edit-post/src/store/index.js
|
|
1
2
|
import { createReduxStore, register } from "@wordpress/data";
|
|
2
3
|
import reducer from "./reducer";
|
|
3
4
|
import * as actions from "./actions";
|
|
4
5
|
import * as selectors from "./selectors";
|
|
5
6
|
import { STORE_NAME } from "./constants";
|
|
6
|
-
|
|
7
|
+
var store = createReduxStore(STORE_NAME, {
|
|
7
8
|
reducer,
|
|
8
9
|
actions,
|
|
9
10
|
selectors
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/store/index.js"],
|
|
4
4
|
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { createReduxStore, register } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport reducer from './reducer';\nimport * as actions from './actions';\nimport * as selectors from './selectors';\nimport { STORE_NAME } from './constants';\n\n/**\n * Store definition for the edit post namespace.\n *\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore\n *\n * @type {Object}\n */\nexport const store = createReduxStore( STORE_NAME, {\n\treducer,\n\tactions,\n\tselectors,\n} );\nregister( store );\n"],
|
|
5
|
-
"mappings": "AAGA,SAAS,kBAAkB,gBAAgB;AAK3C,OAAO,aAAa;AACpB,YAAY,aAAa;AACzB,YAAY,eAAe;AAC3B,SAAS,kBAAkB;AASpB,
|
|
5
|
+
"mappings": ";AAGA,SAAS,kBAAkB,gBAAgB;AAK3C,OAAO,aAAa;AACpB,YAAY,aAAa;AACzB,YAAY,eAAe;AAC3B,SAAS,kBAAkB;AASpB,IAAM,QAAQ,iBAAkB,YAAY;AAAA,EAClD;AAAA,EACA;AAAA,EACA;AACD,CAAE;AACF,SAAU,KAAM;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
// packages/edit-post/src/store/reducer.js
|
|
1
2
|
import { combineReducers } from "@wordpress/data";
|
|
2
3
|
function isSavingMetaBoxes(state = false, action) {
|
|
3
4
|
switch (action.type) {
|
|
@@ -48,7 +49,7 @@ function metaBoxesInitialized(state = false, action) {
|
|
|
48
49
|
}
|
|
49
50
|
return state;
|
|
50
51
|
}
|
|
51
|
-
|
|
52
|
+
var metaBoxes = combineReducers({
|
|
52
53
|
isSaving: isSavingMetaBoxes,
|
|
53
54
|
locations: metaBoxLocations,
|
|
54
55
|
initialized: metaBoxesInitialized
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/store/reducer.js"],
|
|
4
4
|
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { combineReducers } from '@wordpress/data';\n\n/**\n * Reducer keeping track of the meta boxes isSaving state.\n * A \"true\" value means the meta boxes saving request is in-flight.\n *\n *\n * @param {boolean} state Previous state.\n * @param {Object} action Action Object.\n *\n * @return {Object} Updated state.\n */\nexport function isSavingMetaBoxes( state = false, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'REQUEST_META_BOX_UPDATES':\n\t\t\treturn true;\n\t\tcase 'META_BOX_UPDATES_SUCCESS':\n\t\tcase 'META_BOX_UPDATES_FAILURE':\n\t\t\treturn false;\n\t\tdefault:\n\t\t\treturn state;\n\t}\n}\n\nfunction mergeMetaboxes( metaboxes = [], newMetaboxes ) {\n\tconst mergedMetaboxes = [ ...metaboxes ];\n\tfor ( const metabox of newMetaboxes ) {\n\t\tconst existing = mergedMetaboxes.findIndex(\n\t\t\t( box ) => box.id === metabox.id\n\t\t);\n\t\tif ( existing !== -1 ) {\n\t\t\tmergedMetaboxes[ existing ] = metabox;\n\t\t} else {\n\t\t\tmergedMetaboxes.push( metabox );\n\t\t}\n\t}\n\treturn mergedMetaboxes;\n}\n\n/**\n * Reducer keeping track of the meta boxes per location.\n *\n * @param {boolean} state Previous state.\n * @param {Object} action Action Object.\n *\n * @return {Object} Updated state.\n */\nexport function metaBoxLocations( state = {}, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_META_BOXES_PER_LOCATIONS': {\n\t\t\tconst newState = { ...state };\n\t\t\tfor ( const [ location, metaboxes ] of Object.entries(\n\t\t\t\taction.metaBoxesPerLocation\n\t\t\t) ) {\n\t\t\t\tnewState[ location ] = mergeMetaboxes(\n\t\t\t\t\tnewState[ location ],\n\t\t\t\t\tmetaboxes\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn newState;\n\t\t}\n\t}\n\n\treturn state;\n}\n\n/**\n * Reducer tracking whether meta boxes are initialized.\n *\n * @param {boolean} state\n * @param {Object} action\n *\n * @return {boolean} Updated state.\n */\nfunction metaBoxesInitialized( state = false, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'META_BOXES_INITIALIZED':\n\t\t\treturn true;\n\t}\n\treturn state;\n}\n\nconst metaBoxes = combineReducers( {\n\tisSaving: isSavingMetaBoxes,\n\tlocations: metaBoxLocations,\n\tinitialized: metaBoxesInitialized,\n} );\n\nexport default combineReducers( {\n\tmetaBoxes,\n} );\n"],
|
|
5
|
-
"mappings": "AAGA,SAAS,uBAAuB;AAYzB,SAAS,kBAAmB,QAAQ,OAAO,QAAS;AAC1D,UAAS,OAAO,MAAO;AAAA,IACtB,KAAK;AACJ,aAAO;AAAA,IACR,KAAK;AAAA,IACL,KAAK;AACJ,aAAO;AAAA,IACR;AACC,aAAO;AAAA,EACT;AACD;AAEA,SAAS,eAAgB,YAAY,CAAC,GAAG,cAAe;AACvD,QAAM,kBAAkB,CAAE,GAAG,SAAU;AACvC,aAAY,WAAW,cAAe;AACrC,UAAM,WAAW,gBAAgB;AAAA,MAChC,CAAE,QAAS,IAAI,OAAO,QAAQ;AAAA,IAC/B;AACA,QAAK,aAAa,IAAK;AACtB,sBAAiB,QAAS,IAAI;AAAA,IAC/B,OAAO;AACN,sBAAgB,KAAM,OAAQ;AAAA,IAC/B;AAAA,EACD;AACA,SAAO;AACR;AAUO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AU,QAAS,IAAI;AAAA,UACtB,SAAU,QAAS;AAAA,UACnB;AAAA,QACD;AAAA,MACD;AACA,aAAO;AAAA,IACR;AAAA,EACD;AAEA,SAAO;AACR;AAUA,SAAS,qBAAsB,QAAQ,OAAO,QAAS;AACtD,UAAS,OAAO,MAAO;AAAA,IACtB,KAAK;AACJ,aAAO;AAAA,EACT;AACA,SAAO;AACR;AAEA,IAAM,YAAY,gBAAiB;AAAA,EAClC,UAAU;AAAA,EACV,WAAW;AAAA,EACX,aAAa;AACd,CAAE;AAEF,IAAO,kBAAQ,gBAAiB;AAAA,EAC/B;AACD,CAAE;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
// packages/edit-post/src/store/selectors.js
|
|
1
2
|
import { createSelector, createRegistrySelector } from "@wordpress/data";
|
|
2
3
|
import { store as preferencesStore } from "@wordpress/preferences";
|
|
3
4
|
import { store as coreStore } from "@wordpress/core-data";
|
|
@@ -7,13 +8,13 @@ import {
|
|
|
7
8
|
} from "@wordpress/editor";
|
|
8
9
|
import deprecated from "@wordpress/deprecated";
|
|
9
10
|
import { unlock } from "../lock-unlock";
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
var { interfaceStore } = unlock(editorPrivateApis);
|
|
12
|
+
var EMPTY_ARRAY = [];
|
|
13
|
+
var EMPTY_OBJECT = {};
|
|
14
|
+
var getEditorMode = createRegistrySelector(
|
|
14
15
|
(select) => () => select(preferencesStore).get("core", "editorMode") ?? "visual"
|
|
15
16
|
);
|
|
16
|
-
|
|
17
|
+
var isEditorSidebarOpened = createRegistrySelector(
|
|
17
18
|
(select) => () => {
|
|
18
19
|
const activeGeneralSidebar = select(interfaceStore).getActiveComplementaryArea("core");
|
|
19
20
|
return ["edit-post/document", "edit-post/block"].includes(
|
|
@@ -21,7 +22,7 @@ const isEditorSidebarOpened = createRegistrySelector(
|
|
|
21
22
|
);
|
|
22
23
|
}
|
|
23
24
|
);
|
|
24
|
-
|
|
25
|
+
var isPluginSidebarOpened = createRegistrySelector(
|
|
25
26
|
(select) => () => {
|
|
26
27
|
const activeGeneralSidebar = select(interfaceStore).getActiveComplementaryArea("core");
|
|
27
28
|
return !!activeGeneralSidebar && !["edit-post/document", "edit-post/block"].includes(
|
|
@@ -29,7 +30,7 @@ const isPluginSidebarOpened = createRegistrySelector(
|
|
|
29
30
|
);
|
|
30
31
|
}
|
|
31
32
|
);
|
|
32
|
-
|
|
33
|
+
var getActiveGeneralSidebarName = createRegistrySelector(
|
|
33
34
|
(select) => () => {
|
|
34
35
|
return select(interfaceStore).getActiveComplementaryArea("core");
|
|
35
36
|
}
|
|
@@ -56,7 +57,7 @@ function convertPanelsToOldFormat(inactivePanels, openPanels) {
|
|
|
56
57
|
}, panelsWithEnabledState ?? {});
|
|
57
58
|
return panels ?? panelsWithEnabledState ?? EMPTY_OBJECT;
|
|
58
59
|
}
|
|
59
|
-
|
|
60
|
+
var getPreferences = createRegistrySelector((select) => () => {
|
|
60
61
|
deprecated(`select( 'core/edit-post' ).getPreferences`, {
|
|
61
62
|
since: "6.0",
|
|
62
63
|
alternative: `select( 'core/preferences' ).get`
|
|
@@ -94,10 +95,10 @@ function getPreference(state, preferenceKey, defaultValue) {
|
|
|
94
95
|
const value = preferences[preferenceKey];
|
|
95
96
|
return value === void 0 ? defaultValue : value;
|
|
96
97
|
}
|
|
97
|
-
|
|
98
|
+
var getHiddenBlockTypes = createRegistrySelector((select) => () => {
|
|
98
99
|
return select(preferencesStore).get("core", "hiddenBlockTypes") ?? EMPTY_ARRAY;
|
|
99
100
|
});
|
|
100
|
-
|
|
101
|
+
var isPublishSidebarOpened = createRegistrySelector(
|
|
101
102
|
(select) => () => {
|
|
102
103
|
deprecated(`select( 'core/edit-post' ).isPublishSidebarOpened`, {
|
|
103
104
|
since: "6.6",
|
|
@@ -106,7 +107,7 @@ const isPublishSidebarOpened = createRegistrySelector(
|
|
|
106
107
|
return select(editorStore).isPublishSidebarOpened();
|
|
107
108
|
}
|
|
108
109
|
);
|
|
109
|
-
|
|
110
|
+
var isEditorPanelRemoved = createRegistrySelector(
|
|
110
111
|
(select) => (state, panelName) => {
|
|
111
112
|
deprecated(`select( 'core/edit-post' ).isEditorPanelRemoved`, {
|
|
112
113
|
since: "6.5",
|
|
@@ -115,7 +116,7 @@ const isEditorPanelRemoved = createRegistrySelector(
|
|
|
115
116
|
return select(editorStore).isEditorPanelRemoved(panelName);
|
|
116
117
|
}
|
|
117
118
|
);
|
|
118
|
-
|
|
119
|
+
var isEditorPanelEnabled = createRegistrySelector(
|
|
119
120
|
(select) => (state, panelName) => {
|
|
120
121
|
deprecated(`select( 'core/edit-post' ).isEditorPanelEnabled`, {
|
|
121
122
|
since: "6.5",
|
|
@@ -124,7 +125,7 @@ const isEditorPanelEnabled = createRegistrySelector(
|
|
|
124
125
|
return select(editorStore).isEditorPanelEnabled(panelName);
|
|
125
126
|
}
|
|
126
127
|
);
|
|
127
|
-
|
|
128
|
+
var isEditorPanelOpened = createRegistrySelector(
|
|
128
129
|
(select) => (state, panelName) => {
|
|
129
130
|
deprecated(`select( 'core/edit-post' ).isEditorPanelOpened`, {
|
|
130
131
|
since: "6.5",
|
|
@@ -133,7 +134,7 @@ const isEditorPanelOpened = createRegistrySelector(
|
|
|
133
134
|
return select(editorStore).isEditorPanelOpened(panelName);
|
|
134
135
|
}
|
|
135
136
|
);
|
|
136
|
-
|
|
137
|
+
var isModalActive = createRegistrySelector(
|
|
137
138
|
(select) => (state, modalName) => {
|
|
138
139
|
deprecated(`select( 'core/edit-post' ).isModalActive`, {
|
|
139
140
|
since: "6.3",
|
|
@@ -142,17 +143,17 @@ const isModalActive = createRegistrySelector(
|
|
|
142
143
|
return !!select(interfaceStore).isModalActive(modalName);
|
|
143
144
|
}
|
|
144
145
|
);
|
|
145
|
-
|
|
146
|
+
var isFeatureActive = createRegistrySelector(
|
|
146
147
|
(select) => (state, feature) => {
|
|
147
148
|
return !!select(preferencesStore).get("core/edit-post", feature);
|
|
148
149
|
}
|
|
149
150
|
);
|
|
150
|
-
|
|
151
|
+
var isPluginItemPinned = createRegistrySelector(
|
|
151
152
|
(select) => (state, pluginName) => {
|
|
152
153
|
return select(interfaceStore).isItemPinned("core", pluginName);
|
|
153
154
|
}
|
|
154
155
|
);
|
|
155
|
-
|
|
156
|
+
var getActiveMetaBoxLocations = createSelector(
|
|
156
157
|
(state) => {
|
|
157
158
|
return Object.keys(state.metaBoxes.locations).filter(
|
|
158
159
|
(location) => isMetaBoxLocationActive(state, location)
|
|
@@ -160,7 +161,7 @@ const getActiveMetaBoxLocations = createSelector(
|
|
|
160
161
|
},
|
|
161
162
|
(state) => [state.metaBoxes.locations]
|
|
162
163
|
);
|
|
163
|
-
|
|
164
|
+
var isMetaBoxLocationVisible = createRegistrySelector(
|
|
164
165
|
(select) => (state, location) => {
|
|
165
166
|
return isMetaBoxLocationActive(state, location) && getMetaBoxesPerLocation(state, location)?.some(({ id }) => {
|
|
166
167
|
return select(editorStore).isEditorPanelEnabled(
|
|
@@ -176,7 +177,7 @@ function isMetaBoxLocationActive(state, location) {
|
|
|
176
177
|
function getMetaBoxesPerLocation(state, location) {
|
|
177
178
|
return state.metaBoxes.locations[location];
|
|
178
179
|
}
|
|
179
|
-
|
|
180
|
+
var getAllMetaBoxes = createSelector(
|
|
180
181
|
(state) => {
|
|
181
182
|
return Object.values(state.metaBoxes.locations).flat();
|
|
182
183
|
},
|
|
@@ -188,7 +189,7 @@ function hasMetaBoxes(state) {
|
|
|
188
189
|
function isSavingMetaBoxes(state) {
|
|
189
190
|
return state.metaBoxes.isSaving;
|
|
190
191
|
}
|
|
191
|
-
|
|
192
|
+
var __experimentalGetPreviewDeviceType = createRegistrySelector(
|
|
192
193
|
(select) => () => {
|
|
193
194
|
deprecated(
|
|
194
195
|
`select( 'core/edit-site' ).__experimentalGetPreviewDeviceType`,
|
|
@@ -201,14 +202,14 @@ const __experimentalGetPreviewDeviceType = createRegistrySelector(
|
|
|
201
202
|
return select(editorStore).getDeviceType();
|
|
202
203
|
}
|
|
203
204
|
);
|
|
204
|
-
|
|
205
|
+
var isInserterOpened = createRegistrySelector((select) => () => {
|
|
205
206
|
deprecated(`select( 'core/edit-post' ).isInserterOpened`, {
|
|
206
207
|
since: "6.5",
|
|
207
208
|
alternative: `select( 'core/editor' ).isInserterOpened`
|
|
208
209
|
});
|
|
209
210
|
return select(editorStore).isInserterOpened();
|
|
210
211
|
});
|
|
211
|
-
|
|
212
|
+
var __experimentalGetInsertionPoint = createRegistrySelector(
|
|
212
213
|
(select) => () => {
|
|
213
214
|
deprecated(
|
|
214
215
|
`select( 'core/edit-post' ).__experimentalGetInsertionPoint`,
|
|
@@ -220,14 +221,14 @@ const __experimentalGetInsertionPoint = createRegistrySelector(
|
|
|
220
221
|
return unlock(select(editorStore)).getInserter();
|
|
221
222
|
}
|
|
222
223
|
);
|
|
223
|
-
|
|
224
|
+
var isListViewOpened = createRegistrySelector((select) => () => {
|
|
224
225
|
deprecated(`select( 'core/edit-post' ).isListViewOpened`, {
|
|
225
226
|
since: "6.5",
|
|
226
227
|
alternative: `select( 'core/editor' ).isListViewOpened`
|
|
227
228
|
});
|
|
228
229
|
return select(editorStore).isListViewOpened();
|
|
229
230
|
});
|
|
230
|
-
|
|
231
|
+
var isEditingTemplate = createRegistrySelector((select) => () => {
|
|
231
232
|
deprecated(`select( 'core/edit-post' ).isEditingTemplate`, {
|
|
232
233
|
since: "6.5",
|
|
233
234
|
alternative: `select( 'core/editor' ).getRenderingMode`
|
|
@@ -237,7 +238,7 @@ const isEditingTemplate = createRegistrySelector((select) => () => {
|
|
|
237
238
|
function areMetaBoxesInitialized(state) {
|
|
238
239
|
return state.metaBoxes.initialized;
|
|
239
240
|
}
|
|
240
|
-
|
|
241
|
+
var getEditedPostTemplate = createRegistrySelector(
|
|
241
242
|
(select) => () => {
|
|
242
243
|
const { id: postId, type: postType } = select(editorStore).getCurrentPost();
|
|
243
244
|
const templateId = unlock(select(coreStore)).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": "AAGA,SAAS,gBAAgB,8BAA8B;AACvD,SAAS,SAAS,wBAAwB;AAC1C,SAAS,SAAS,iBAAiB;AACnC;AAAA,EACC,SAAS;AAAA,EACT,eAAe;AAAA,OACT;AACP,OAAO,gBAAgB;AAKvB,SAAS,cAAc;AACvB,
|
|
5
|
+
"mappings": ";AAGA,SAAS,gBAAgB,8BAA8B;AACvD,SAAS,SAAS,wBAAwB;AAC1C,SAAS,SAAS,iBAAiB;AACnC;AAAA,EACC,SAAS;AAAA,EACT,eAAe;AAAA,OACT;AACP,OAAO,gBAAgB;AAKvB,SAAS,cAAc;AACvB,IAAM,EAAE,eAAe,IAAI,OAAQ,iBAAkB;AACrD,IAAM,cAAc,CAAC;AACrB,IAAM,eAAe,CAAC;AASf,IAAM,gBAAgB;AAAA,EAC5B,CAAE,WAAY,MACb,OAAQ,gBAAiB,EAAE,IAAK,QAAQ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iB;AAC/C,CAAE;AAOK,IAAM,oBAAoB,uBAAwB,CAAE,WAAY,MAAM;AAC5E,aAAY,gDAAgD;AAAA,IAC3D,OAAO;AAAA,IACP,aAAa;AAAA,EACd,CAAE;AACF,SAAO,OAAQ,WAAY,EAAE,mBAAmB,MAAM;AACvD,CAAE;AASK,SAAS,wBAAyB,OAAQ;AAChD,SAAO,MAAM,UAAU;AACxB;AAOO,IAAM,wBAAwB;AAAA,EACpC,CAAE,WAAY,MAAM;AACnB,UAAM,EAAE,IAAI,QAAQ,MAAM,SAAS,IAClC,OAAQ,WAAY,EAAE,eAAe;AACtC,UAAM,aAAa,OAAQ,OAAQ,SAAU,CAAE,EAAE;AAAA,MAChD;AAAA,MACA;AAAA,IACD;AACA,QAAK,CAAE,YAAa;AACnB,aAAO;AAAA,IACR;AACA,WAAO,OAAQ,SAAU,EAAE;AAAA,MAC1B;AAAA,MACA;AAAA,MACA;AAAA,IACD;AAAA,EACD;AACD;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -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": "AASO,
|
|
5
|
+
"mappings": ";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
|
}
|