@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/actions.js
CHANGED
|
@@ -1,349 +1,203 @@
|
|
|
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 actions_exports = {};
|
|
29
|
+
__export(actions_exports, {
|
|
30
|
+
__experimentalSetPreviewDeviceType: () => __experimentalSetPreviewDeviceType,
|
|
31
|
+
__unstableCreateTemplate: () => __unstableCreateTemplate,
|
|
32
|
+
closeGeneralSidebar: () => closeGeneralSidebar,
|
|
33
|
+
closeModal: () => closeModal,
|
|
34
|
+
closePublishSidebar: () => closePublishSidebar,
|
|
35
|
+
hideBlockTypes: () => hideBlockTypes,
|
|
36
|
+
initializeMetaBoxes: () => initializeMetaBoxes,
|
|
37
|
+
metaBoxUpdatesFailure: () => metaBoxUpdatesFailure,
|
|
38
|
+
metaBoxUpdatesSuccess: () => metaBoxUpdatesSuccess,
|
|
39
|
+
openGeneralSidebar: () => openGeneralSidebar,
|
|
40
|
+
openModal: () => openModal,
|
|
41
|
+
openPublishSidebar: () => openPublishSidebar,
|
|
42
|
+
removeEditorPanel: () => removeEditorPanel,
|
|
43
|
+
requestMetaBoxUpdates: () => requestMetaBoxUpdates,
|
|
44
|
+
setAvailableMetaBoxesPerLocation: () => setAvailableMetaBoxesPerLocation,
|
|
45
|
+
setIsEditingTemplate: () => setIsEditingTemplate,
|
|
46
|
+
setIsInserterOpened: () => setIsInserterOpened,
|
|
47
|
+
setIsListViewOpened: () => setIsListViewOpened,
|
|
48
|
+
showBlockTypes: () => showBlockTypes,
|
|
49
|
+
switchEditorMode: () => switchEditorMode,
|
|
50
|
+
toggleDistractionFree: () => toggleDistractionFree,
|
|
51
|
+
toggleEditorPanelEnabled: () => toggleEditorPanelEnabled,
|
|
52
|
+
toggleEditorPanelOpened: () => toggleEditorPanelOpened,
|
|
53
|
+
toggleFeature: () => toggleFeature,
|
|
54
|
+
toggleFullscreenMode: () => toggleFullscreenMode,
|
|
55
|
+
togglePinnedPluginItem: () => togglePinnedPluginItem,
|
|
56
|
+
togglePublishSidebar: () => togglePublishSidebar,
|
|
57
|
+
updatePreferredStyleVariations: () => updatePreferredStyleVariations
|
|
6
58
|
});
|
|
7
|
-
exports
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
var
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
var _hooks = require("@wordpress/hooks");
|
|
22
|
-
var _coreData = require("@wordpress/core-data");
|
|
23
|
-
var _notices = require("@wordpress/notices");
|
|
24
|
-
var _i18n = require("@wordpress/i18n");
|
|
25
|
-
var _metaBoxes = require("../utils/meta-boxes");
|
|
26
|
-
var _lockUnlock = require("../lock-unlock");
|
|
27
|
-
/**
|
|
28
|
-
* WordPress dependencies
|
|
29
|
-
*/
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* Internal dependencies
|
|
33
|
-
*/
|
|
34
|
-
|
|
35
|
-
const {
|
|
36
|
-
interfaceStore
|
|
37
|
-
} = (0, _lockUnlock.unlock)(_editor.privateApis);
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* Returns an action object used in signalling that the user opened an editor sidebar.
|
|
41
|
-
*
|
|
42
|
-
* @param {?string} name Sidebar name to be opened.
|
|
43
|
-
*/
|
|
44
|
-
const openGeneralSidebar = name => ({
|
|
45
|
-
registry
|
|
46
|
-
}) => {
|
|
47
|
-
registry.dispatch(interfaceStore).enableComplementaryArea('core', name);
|
|
59
|
+
module.exports = __toCommonJS(actions_exports);
|
|
60
|
+
var import_api_fetch = __toESM(require("@wordpress/api-fetch"));
|
|
61
|
+
var import_preferences = require("@wordpress/preferences");
|
|
62
|
+
var import_editor = require("@wordpress/editor");
|
|
63
|
+
var import_deprecated = __toESM(require("@wordpress/deprecated"));
|
|
64
|
+
var import_hooks = require("@wordpress/hooks");
|
|
65
|
+
var import_core_data = require("@wordpress/core-data");
|
|
66
|
+
var import_notices = require("@wordpress/notices");
|
|
67
|
+
var import_i18n = require("@wordpress/i18n");
|
|
68
|
+
var import_meta_boxes = require("../utils/meta-boxes");
|
|
69
|
+
var import_lock_unlock = require("../lock-unlock");
|
|
70
|
+
const { interfaceStore } = (0, import_lock_unlock.unlock)(import_editor.privateApis);
|
|
71
|
+
const openGeneralSidebar = (name) => ({ registry }) => {
|
|
72
|
+
registry.dispatch(interfaceStore).enableComplementaryArea("core", name);
|
|
48
73
|
};
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
exports.openGeneralSidebar = openGeneralSidebar;
|
|
54
|
-
const closeGeneralSidebar = () => ({
|
|
55
|
-
registry
|
|
56
|
-
}) => registry.dispatch(interfaceStore).disableComplementaryArea('core');
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* Returns an action object used in signalling that the user opened a modal.
|
|
60
|
-
*
|
|
61
|
-
* @deprecated since WP 6.3 use `core/interface` store's action with the same name instead.
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
* @param {string} name A string that uniquely identifies the modal.
|
|
65
|
-
*
|
|
66
|
-
* @return {Object} Action object.
|
|
67
|
-
*/
|
|
68
|
-
exports.closeGeneralSidebar = closeGeneralSidebar;
|
|
69
|
-
const openModal = name => ({
|
|
70
|
-
registry
|
|
71
|
-
}) => {
|
|
72
|
-
(0, _deprecated.default)("select( 'core/edit-post' ).openModal( name )", {
|
|
73
|
-
since: '6.3',
|
|
74
|
+
const closeGeneralSidebar = () => ({ registry }) => registry.dispatch(interfaceStore).disableComplementaryArea("core");
|
|
75
|
+
const openModal = (name) => ({ registry }) => {
|
|
76
|
+
(0, import_deprecated.default)("select( 'core/edit-post' ).openModal( name )", {
|
|
77
|
+
since: "6.3",
|
|
74
78
|
alternative: "select( 'core/interface').openModal( name )"
|
|
75
79
|
});
|
|
76
80
|
return registry.dispatch(interfaceStore).openModal(name);
|
|
77
81
|
};
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
*
|
|
82
|
-
* @deprecated since WP 6.3 use `core/interface` store's action with the same name instead.
|
|
83
|
-
*
|
|
84
|
-
* @return {Object} Action object.
|
|
85
|
-
*/
|
|
86
|
-
exports.openModal = openModal;
|
|
87
|
-
const closeModal = () => ({
|
|
88
|
-
registry
|
|
89
|
-
}) => {
|
|
90
|
-
(0, _deprecated.default)("select( 'core/edit-post' ).closeModal()", {
|
|
91
|
-
since: '6.3',
|
|
82
|
+
const closeModal = () => ({ registry }) => {
|
|
83
|
+
(0, import_deprecated.default)("select( 'core/edit-post' ).closeModal()", {
|
|
84
|
+
since: "6.3",
|
|
92
85
|
alternative: "select( 'core/interface').closeModal()"
|
|
93
86
|
});
|
|
94
87
|
return registry.dispatch(interfaceStore).closeModal();
|
|
95
88
|
};
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
* sidebar.
|
|
100
|
-
* @deprecated
|
|
101
|
-
*
|
|
102
|
-
* @return {Object} Action object
|
|
103
|
-
*/
|
|
104
|
-
exports.closeModal = closeModal;
|
|
105
|
-
const openPublishSidebar = () => ({
|
|
106
|
-
registry
|
|
107
|
-
}) => {
|
|
108
|
-
(0, _deprecated.default)("dispatch( 'core/edit-post' ).openPublishSidebar", {
|
|
109
|
-
since: '6.6',
|
|
89
|
+
const openPublishSidebar = () => ({ registry }) => {
|
|
90
|
+
(0, import_deprecated.default)("dispatch( 'core/edit-post' ).openPublishSidebar", {
|
|
91
|
+
since: "6.6",
|
|
110
92
|
alternative: "dispatch( 'core/editor').openPublishSidebar"
|
|
111
93
|
});
|
|
112
|
-
registry.dispatch(
|
|
94
|
+
registry.dispatch(import_editor.store).openPublishSidebar();
|
|
113
95
|
};
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
* publish sidebar.
|
|
118
|
-
* @deprecated
|
|
119
|
-
*
|
|
120
|
-
* @return {Object} Action object.
|
|
121
|
-
*/
|
|
122
|
-
exports.openPublishSidebar = openPublishSidebar;
|
|
123
|
-
const closePublishSidebar = () => ({
|
|
124
|
-
registry
|
|
125
|
-
}) => {
|
|
126
|
-
(0, _deprecated.default)("dispatch( 'core/edit-post' ).closePublishSidebar", {
|
|
127
|
-
since: '6.6',
|
|
96
|
+
const closePublishSidebar = () => ({ registry }) => {
|
|
97
|
+
(0, import_deprecated.default)("dispatch( 'core/edit-post' ).closePublishSidebar", {
|
|
98
|
+
since: "6.6",
|
|
128
99
|
alternative: "dispatch( 'core/editor').closePublishSidebar"
|
|
129
100
|
});
|
|
130
|
-
registry.dispatch(
|
|
101
|
+
registry.dispatch(import_editor.store).closePublishSidebar();
|
|
131
102
|
};
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
* @deprecated
|
|
136
|
-
*
|
|
137
|
-
* @return {Object} Action object
|
|
138
|
-
*/
|
|
139
|
-
exports.closePublishSidebar = closePublishSidebar;
|
|
140
|
-
const togglePublishSidebar = () => ({
|
|
141
|
-
registry
|
|
142
|
-
}) => {
|
|
143
|
-
(0, _deprecated.default)("dispatch( 'core/edit-post' ).togglePublishSidebar", {
|
|
144
|
-
since: '6.6',
|
|
103
|
+
const togglePublishSidebar = () => ({ registry }) => {
|
|
104
|
+
(0, import_deprecated.default)("dispatch( 'core/edit-post' ).togglePublishSidebar", {
|
|
105
|
+
since: "6.6",
|
|
145
106
|
alternative: "dispatch( 'core/editor').togglePublishSidebar"
|
|
146
107
|
});
|
|
147
|
-
registry.dispatch(
|
|
108
|
+
registry.dispatch(import_editor.store).togglePublishSidebar();
|
|
148
109
|
};
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
*
|
|
153
|
-
* @deprecated
|
|
154
|
-
*
|
|
155
|
-
* @param {string} panelName A string that identifies the panel to enable or disable.
|
|
156
|
-
*
|
|
157
|
-
* @return {Object} Action object.
|
|
158
|
-
*/
|
|
159
|
-
exports.togglePublishSidebar = togglePublishSidebar;
|
|
160
|
-
const toggleEditorPanelEnabled = panelName => ({
|
|
161
|
-
registry
|
|
162
|
-
}) => {
|
|
163
|
-
(0, _deprecated.default)("dispatch( 'core/edit-post' ).toggleEditorPanelEnabled", {
|
|
164
|
-
since: '6.5',
|
|
110
|
+
const toggleEditorPanelEnabled = (panelName) => ({ registry }) => {
|
|
111
|
+
(0, import_deprecated.default)("dispatch( 'core/edit-post' ).toggleEditorPanelEnabled", {
|
|
112
|
+
since: "6.5",
|
|
165
113
|
alternative: "dispatch( 'core/editor').toggleEditorPanelEnabled"
|
|
166
114
|
});
|
|
167
|
-
registry.dispatch(
|
|
115
|
+
registry.dispatch(import_editor.store).toggleEditorPanelEnabled(panelName);
|
|
168
116
|
};
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
*
|
|
173
|
-
* @deprecated
|
|
174
|
-
*
|
|
175
|
-
* @param {string} panelName A string that identifies the panel to open or close.
|
|
176
|
-
*/
|
|
177
|
-
exports.toggleEditorPanelEnabled = toggleEditorPanelEnabled;
|
|
178
|
-
const toggleEditorPanelOpened = panelName => ({
|
|
179
|
-
registry
|
|
180
|
-
}) => {
|
|
181
|
-
(0, _deprecated.default)("dispatch( 'core/edit-post' ).toggleEditorPanelOpened", {
|
|
182
|
-
since: '6.5',
|
|
117
|
+
const toggleEditorPanelOpened = (panelName) => ({ registry }) => {
|
|
118
|
+
(0, import_deprecated.default)("dispatch( 'core/edit-post' ).toggleEditorPanelOpened", {
|
|
119
|
+
since: "6.5",
|
|
183
120
|
alternative: "dispatch( 'core/editor').toggleEditorPanelOpened"
|
|
184
121
|
});
|
|
185
|
-
registry.dispatch(
|
|
122
|
+
registry.dispatch(import_editor.store).toggleEditorPanelOpened(panelName);
|
|
186
123
|
};
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
*
|
|
191
|
-
* @deprecated
|
|
192
|
-
*
|
|
193
|
-
* @param {string} panelName A string that identifies the panel to remove.
|
|
194
|
-
*
|
|
195
|
-
* @return {Object} Action object.
|
|
196
|
-
*/
|
|
197
|
-
exports.toggleEditorPanelOpened = toggleEditorPanelOpened;
|
|
198
|
-
const removeEditorPanel = panelName => ({
|
|
199
|
-
registry
|
|
200
|
-
}) => {
|
|
201
|
-
(0, _deprecated.default)("dispatch( 'core/edit-post' ).removeEditorPanel", {
|
|
202
|
-
since: '6.5',
|
|
124
|
+
const removeEditorPanel = (panelName) => ({ registry }) => {
|
|
125
|
+
(0, import_deprecated.default)("dispatch( 'core/edit-post' ).removeEditorPanel", {
|
|
126
|
+
since: "6.5",
|
|
203
127
|
alternative: "dispatch( 'core/editor').removeEditorPanel"
|
|
204
128
|
});
|
|
205
|
-
registry.dispatch(
|
|
129
|
+
registry.dispatch(import_editor.store).removeEditorPanel(panelName);
|
|
206
130
|
};
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
* @param {string} feature Feature name.
|
|
212
|
-
*/
|
|
213
|
-
exports.removeEditorPanel = removeEditorPanel;
|
|
214
|
-
const toggleFeature = feature => ({
|
|
215
|
-
registry
|
|
216
|
-
}) => registry.dispatch(_preferences.store).toggle('core/edit-post', feature);
|
|
217
|
-
|
|
218
|
-
/**
|
|
219
|
-
* Triggers an action used to switch editor mode.
|
|
220
|
-
*
|
|
221
|
-
* @deprecated
|
|
222
|
-
*
|
|
223
|
-
* @param {string} mode The editor mode.
|
|
224
|
-
*/
|
|
225
|
-
exports.toggleFeature = toggleFeature;
|
|
226
|
-
const switchEditorMode = mode => ({
|
|
227
|
-
registry
|
|
228
|
-
}) => {
|
|
229
|
-
(0, _deprecated.default)("dispatch( 'core/edit-post' ).switchEditorMode", {
|
|
230
|
-
since: '6.6',
|
|
131
|
+
const toggleFeature = (feature) => ({ registry }) => registry.dispatch(import_preferences.store).toggle("core/edit-post", feature);
|
|
132
|
+
const switchEditorMode = (mode) => ({ registry }) => {
|
|
133
|
+
(0, import_deprecated.default)("dispatch( 'core/edit-post' ).switchEditorMode", {
|
|
134
|
+
since: "6.6",
|
|
231
135
|
alternative: "dispatch( 'core/editor').switchEditorMode"
|
|
232
136
|
});
|
|
233
|
-
registry.dispatch(
|
|
137
|
+
registry.dispatch(import_editor.store).switchEditorMode(mode);
|
|
234
138
|
};
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
*
|
|
239
|
-
* @param {string} pluginName Plugin name.
|
|
240
|
-
*/
|
|
241
|
-
exports.switchEditorMode = switchEditorMode;
|
|
242
|
-
const togglePinnedPluginItem = pluginName => ({
|
|
243
|
-
registry
|
|
244
|
-
}) => {
|
|
245
|
-
const isPinned = registry.select(interfaceStore).isItemPinned('core', pluginName);
|
|
246
|
-
registry.dispatch(interfaceStore)[isPinned ? 'unpinItem' : 'pinItem']('core', pluginName);
|
|
139
|
+
const togglePinnedPluginItem = (pluginName) => ({ registry }) => {
|
|
140
|
+
const isPinned = registry.select(interfaceStore).isItemPinned("core", pluginName);
|
|
141
|
+
registry.dispatch(interfaceStore)[isPinned ? "unpinItem" : "pinItem"]("core", pluginName);
|
|
247
142
|
};
|
|
248
|
-
|
|
249
|
-
/**
|
|
250
|
-
* Returns an action object used in signaling that a style should be auto-applied when a block is created.
|
|
251
|
-
*
|
|
252
|
-
* @deprecated
|
|
253
|
-
*/
|
|
254
|
-
exports.togglePinnedPluginItem = togglePinnedPluginItem;
|
|
255
143
|
function updatePreferredStyleVariations() {
|
|
256
|
-
(0,
|
|
257
|
-
since:
|
|
258
|
-
hint:
|
|
144
|
+
(0, import_deprecated.default)("dispatch( 'core/edit-post' ).updatePreferredStyleVariations", {
|
|
145
|
+
since: "6.6",
|
|
146
|
+
hint: "Preferred Style Variations are not supported anymore."
|
|
259
147
|
});
|
|
260
|
-
return {
|
|
261
|
-
type: 'NOTHING'
|
|
262
|
-
};
|
|
148
|
+
return { type: "NOTHING" };
|
|
263
149
|
}
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
* Update the provided block types to be visible.
|
|
267
|
-
*
|
|
268
|
-
* @param {string[]} blockNames Names of block types to show.
|
|
269
|
-
*/
|
|
270
|
-
const showBlockTypes = blockNames => ({
|
|
271
|
-
registry
|
|
272
|
-
}) => {
|
|
273
|
-
(0, _lockUnlock.unlock)(registry.dispatch(_editor.store)).showBlockTypes(blockNames);
|
|
150
|
+
const showBlockTypes = (blockNames) => ({ registry }) => {
|
|
151
|
+
(0, import_lock_unlock.unlock)(registry.dispatch(import_editor.store)).showBlockTypes(blockNames);
|
|
274
152
|
};
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
* Update the provided block types to be hidden.
|
|
278
|
-
*
|
|
279
|
-
* @param {string[]} blockNames Names of block types to hide.
|
|
280
|
-
*/
|
|
281
|
-
exports.showBlockTypes = showBlockTypes;
|
|
282
|
-
const hideBlockTypes = blockNames => ({
|
|
283
|
-
registry
|
|
284
|
-
}) => {
|
|
285
|
-
(0, _lockUnlock.unlock)(registry.dispatch(_editor.store)).hideBlockTypes(blockNames);
|
|
153
|
+
const hideBlockTypes = (blockNames) => ({ registry }) => {
|
|
154
|
+
(0, import_lock_unlock.unlock)(registry.dispatch(import_editor.store)).hideBlockTypes(blockNames);
|
|
286
155
|
};
|
|
287
|
-
|
|
288
|
-
/**
|
|
289
|
-
* Stores info about which Meta boxes are available in which location.
|
|
290
|
-
*
|
|
291
|
-
* @param {Object} metaBoxesPerLocation Meta boxes per location.
|
|
292
|
-
*/
|
|
293
|
-
exports.hideBlockTypes = hideBlockTypes;
|
|
294
156
|
function setAvailableMetaBoxesPerLocation(metaBoxesPerLocation) {
|
|
295
157
|
return {
|
|
296
|
-
type:
|
|
158
|
+
type: "SET_META_BOXES_PER_LOCATIONS",
|
|
297
159
|
metaBoxesPerLocation
|
|
298
160
|
};
|
|
299
161
|
}
|
|
300
|
-
|
|
301
|
-
/**
|
|
302
|
-
* Update a metabox.
|
|
303
|
-
*/
|
|
304
|
-
const requestMetaBoxUpdates = () => async ({
|
|
305
|
-
registry,
|
|
306
|
-
select,
|
|
307
|
-
dispatch
|
|
308
|
-
}) => {
|
|
162
|
+
const requestMetaBoxUpdates = () => async ({ registry, select, dispatch }) => {
|
|
309
163
|
dispatch({
|
|
310
|
-
type:
|
|
164
|
+
type: "REQUEST_META_BOX_UPDATES"
|
|
311
165
|
});
|
|
312
|
-
|
|
313
|
-
// Saves the wp_editor fields.
|
|
314
166
|
if (window.tinyMCE) {
|
|
315
167
|
window.tinyMCE.triggerSave();
|
|
316
168
|
}
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
const postId = baseFormData.get(
|
|
321
|
-
const postType = baseFormData.get(
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
// We gather all the metaboxes locations.
|
|
169
|
+
const baseFormData = new window.FormData(
|
|
170
|
+
document.querySelector(".metabox-base-form")
|
|
171
|
+
);
|
|
172
|
+
const postId = baseFormData.get("post_ID");
|
|
173
|
+
const postType = baseFormData.get("post_type");
|
|
174
|
+
const post = registry.select(import_core_data.store).getEditedEntityRecord("postType", postType, postId);
|
|
175
|
+
const additionalData = [
|
|
176
|
+
post.comment_status ? ["comment_status", post.comment_status] : false,
|
|
177
|
+
post.ping_status ? ["ping_status", post.ping_status] : false,
|
|
178
|
+
post.sticky ? ["sticky", post.sticky] : false,
|
|
179
|
+
post.author ? ["post_author", post.author] : false
|
|
180
|
+
].filter(Boolean);
|
|
331
181
|
const activeMetaBoxLocations = select.getActiveMetaBoxLocations();
|
|
332
|
-
const formDataToMerge = [
|
|
333
|
-
|
|
334
|
-
|
|
182
|
+
const formDataToMerge = [
|
|
183
|
+
baseFormData,
|
|
184
|
+
...activeMetaBoxLocations.map(
|
|
185
|
+
(location) => new window.FormData((0, import_meta_boxes.getMetaBoxContainer)(location))
|
|
186
|
+
)
|
|
187
|
+
];
|
|
335
188
|
const formData = formDataToMerge.reduce((memo, currentFormData) => {
|
|
336
189
|
for (const [key, value] of currentFormData) {
|
|
337
190
|
memo.append(key, value);
|
|
338
191
|
}
|
|
339
192
|
return memo;
|
|
340
193
|
}, new window.FormData());
|
|
341
|
-
additionalData.forEach(
|
|
194
|
+
additionalData.forEach(
|
|
195
|
+
([key, value]) => formData.append(key, value)
|
|
196
|
+
);
|
|
342
197
|
try {
|
|
343
|
-
|
|
344
|
-
await (0, _apiFetch.default)({
|
|
198
|
+
await (0, import_api_fetch.default)({
|
|
345
199
|
url: window._wpMetaBoxUrl,
|
|
346
|
-
method:
|
|
200
|
+
method: "POST",
|
|
347
201
|
body: formData,
|
|
348
202
|
parse: false
|
|
349
203
|
});
|
|
@@ -352,185 +206,139 @@ const requestMetaBoxUpdates = () => async ({
|
|
|
352
206
|
dispatch.metaBoxUpdatesFailure();
|
|
353
207
|
}
|
|
354
208
|
};
|
|
355
|
-
|
|
356
|
-
/**
|
|
357
|
-
* Returns an action object used to signal a successful meta box update.
|
|
358
|
-
*
|
|
359
|
-
* @return {Object} Action object.
|
|
360
|
-
*/
|
|
361
|
-
exports.requestMetaBoxUpdates = requestMetaBoxUpdates;
|
|
362
209
|
function metaBoxUpdatesSuccess() {
|
|
363
210
|
return {
|
|
364
|
-
type:
|
|
211
|
+
type: "META_BOX_UPDATES_SUCCESS"
|
|
365
212
|
};
|
|
366
213
|
}
|
|
367
|
-
|
|
368
|
-
/**
|
|
369
|
-
* Returns an action object used to signal a failed meta box update.
|
|
370
|
-
*
|
|
371
|
-
* @return {Object} Action object.
|
|
372
|
-
*/
|
|
373
214
|
function metaBoxUpdatesFailure() {
|
|
374
215
|
return {
|
|
375
|
-
type:
|
|
216
|
+
type: "META_BOX_UPDATES_FAILURE"
|
|
376
217
|
};
|
|
377
218
|
}
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
registry
|
|
388
|
-
}) => {
|
|
389
|
-
(0, _deprecated.default)("dispatch( 'core/edit-post' ).__experimentalSetPreviewDeviceType", {
|
|
390
|
-
since: '6.5',
|
|
391
|
-
version: '6.7',
|
|
392
|
-
hint: 'registry.dispatch( editorStore ).setDeviceType'
|
|
393
|
-
});
|
|
394
|
-
registry.dispatch(_editor.store).setDeviceType(deviceType);
|
|
219
|
+
const __experimentalSetPreviewDeviceType = (deviceType) => ({ registry }) => {
|
|
220
|
+
(0, import_deprecated.default)(
|
|
221
|
+
"dispatch( 'core/edit-post' ).__experimentalSetPreviewDeviceType",
|
|
222
|
+
{
|
|
223
|
+
since: "6.5",
|
|
224
|
+
version: "6.7",
|
|
225
|
+
hint: "registry.dispatch( editorStore ).setDeviceType"
|
|
226
|
+
}
|
|
227
|
+
);
|
|
228
|
+
registry.dispatch(import_editor.store).setDeviceType(deviceType);
|
|
395
229
|
};
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
*
|
|
400
|
-
* @deprecated
|
|
401
|
-
*
|
|
402
|
-
* @param {boolean|Object} value Whether the inserter should be opened (true) or closed (false).
|
|
403
|
-
*/
|
|
404
|
-
exports.__experimentalSetPreviewDeviceType = __experimentalSetPreviewDeviceType;
|
|
405
|
-
const setIsInserterOpened = value => ({
|
|
406
|
-
registry
|
|
407
|
-
}) => {
|
|
408
|
-
(0, _deprecated.default)("dispatch( 'core/edit-post' ).setIsInserterOpened", {
|
|
409
|
-
since: '6.5',
|
|
230
|
+
const setIsInserterOpened = (value) => ({ registry }) => {
|
|
231
|
+
(0, import_deprecated.default)("dispatch( 'core/edit-post' ).setIsInserterOpened", {
|
|
232
|
+
since: "6.5",
|
|
410
233
|
alternative: "dispatch( 'core/editor').setIsInserterOpened"
|
|
411
234
|
});
|
|
412
|
-
registry.dispatch(
|
|
235
|
+
registry.dispatch(import_editor.store).setIsInserterOpened(value);
|
|
413
236
|
};
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
*
|
|
418
|
-
* @deprecated
|
|
419
|
-
*
|
|
420
|
-
* @param {boolean} isOpen A boolean representing whether the list view should be opened or closed.
|
|
421
|
-
*/
|
|
422
|
-
exports.setIsInserterOpened = setIsInserterOpened;
|
|
423
|
-
const setIsListViewOpened = isOpen => ({
|
|
424
|
-
registry
|
|
425
|
-
}) => {
|
|
426
|
-
(0, _deprecated.default)("dispatch( 'core/edit-post' ).setIsListViewOpened", {
|
|
427
|
-
since: '6.5',
|
|
237
|
+
const setIsListViewOpened = (isOpen) => ({ registry }) => {
|
|
238
|
+
(0, import_deprecated.default)("dispatch( 'core/edit-post' ).setIsListViewOpened", {
|
|
239
|
+
since: "6.5",
|
|
428
240
|
alternative: "dispatch( 'core/editor').setIsListViewOpened"
|
|
429
241
|
});
|
|
430
|
-
registry.dispatch(
|
|
242
|
+
registry.dispatch(import_editor.store).setIsListViewOpened(isOpen);
|
|
431
243
|
};
|
|
432
|
-
|
|
433
|
-
/**
|
|
434
|
-
* Returns an action object used to switch to template editing.
|
|
435
|
-
*
|
|
436
|
-
* @deprecated
|
|
437
|
-
*/
|
|
438
|
-
exports.setIsListViewOpened = setIsListViewOpened;
|
|
439
244
|
function setIsEditingTemplate() {
|
|
440
|
-
(0,
|
|
441
|
-
since:
|
|
245
|
+
(0, import_deprecated.default)("dispatch( 'core/edit-post' ).setIsEditingTemplate", {
|
|
246
|
+
since: "6.5",
|
|
442
247
|
alternative: "dispatch( 'core/editor').setRenderingMode"
|
|
443
248
|
});
|
|
444
|
-
return {
|
|
445
|
-
type: 'NOTHING'
|
|
446
|
-
};
|
|
249
|
+
return { type: "NOTHING" };
|
|
447
250
|
}
|
|
448
|
-
|
|
449
|
-
/**
|
|
450
|
-
* Create a block based template.
|
|
451
|
-
*
|
|
452
|
-
* @deprecated
|
|
453
|
-
*/
|
|
454
251
|
function __unstableCreateTemplate() {
|
|
455
|
-
(0,
|
|
456
|
-
since:
|
|
252
|
+
(0, import_deprecated.default)("dispatch( 'core/edit-post' ).__unstableCreateTemplate", {
|
|
253
|
+
since: "6.5"
|
|
457
254
|
});
|
|
458
|
-
return {
|
|
459
|
-
type: 'NOTHING'
|
|
460
|
-
};
|
|
255
|
+
return { type: "NOTHING" };
|
|
461
256
|
}
|
|
462
257
|
let metaBoxesInitialized = false;
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
* Initializes WordPress `postboxes` script and the logic for saving meta boxes.
|
|
466
|
-
*/
|
|
467
|
-
const initializeMetaBoxes = () => ({
|
|
468
|
-
registry,
|
|
469
|
-
select,
|
|
470
|
-
dispatch
|
|
471
|
-
}) => {
|
|
472
|
-
const isEditorReady = registry.select(_editor.store).__unstableIsEditorReady();
|
|
258
|
+
const initializeMetaBoxes = () => ({ registry, select, dispatch }) => {
|
|
259
|
+
const isEditorReady = registry.select(import_editor.store).__unstableIsEditorReady();
|
|
473
260
|
if (!isEditorReady) {
|
|
474
261
|
return;
|
|
475
262
|
}
|
|
476
|
-
// Only initialize once.
|
|
477
263
|
if (metaBoxesInitialized) {
|
|
478
264
|
return;
|
|
479
265
|
}
|
|
480
|
-
const postType = registry.select(
|
|
266
|
+
const postType = registry.select(import_editor.store).getCurrentPostType();
|
|
481
267
|
if (window.postboxes.page !== postType) {
|
|
482
268
|
window.postboxes.add_postbox_toggles(postType);
|
|
483
269
|
}
|
|
484
270
|
metaBoxesInitialized = true;
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
271
|
+
(0, import_hooks.addAction)(
|
|
272
|
+
"editor.savePost",
|
|
273
|
+
"core/edit-post/save-metaboxes",
|
|
274
|
+
async (post, options) => {
|
|
275
|
+
if (!options.isAutosave && select.hasMetaBoxes()) {
|
|
276
|
+
await dispatch.requestMetaBoxUpdates();
|
|
277
|
+
}
|
|
490
278
|
}
|
|
491
|
-
|
|
279
|
+
);
|
|
492
280
|
dispatch({
|
|
493
|
-
type:
|
|
281
|
+
type: "META_BOXES_INITIALIZED"
|
|
494
282
|
});
|
|
495
283
|
};
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
* Distraction free mode expects there are no sidebars, as due to the
|
|
500
|
-
* z-index values set, you can't close sidebars.
|
|
501
|
-
*
|
|
502
|
-
* @deprecated
|
|
503
|
-
*/
|
|
504
|
-
exports.initializeMetaBoxes = initializeMetaBoxes;
|
|
505
|
-
const toggleDistractionFree = () => ({
|
|
506
|
-
registry
|
|
507
|
-
}) => {
|
|
508
|
-
(0, _deprecated.default)("dispatch( 'core/edit-post' ).toggleDistractionFree", {
|
|
509
|
-
since: '6.6',
|
|
284
|
+
const toggleDistractionFree = () => ({ registry }) => {
|
|
285
|
+
(0, import_deprecated.default)("dispatch( 'core/edit-post' ).toggleDistractionFree", {
|
|
286
|
+
since: "6.6",
|
|
510
287
|
alternative: "dispatch( 'core/editor').toggleDistractionFree"
|
|
511
288
|
});
|
|
512
|
-
registry.dispatch(
|
|
289
|
+
registry.dispatch(import_editor.store).toggleDistractionFree();
|
|
513
290
|
};
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
291
|
+
const toggleFullscreenMode = () => ({ registry }) => {
|
|
292
|
+
const isFullscreen = registry.select(import_preferences.store).get("core/edit-post", "fullscreenMode");
|
|
293
|
+
registry.dispatch(import_preferences.store).toggle("core/edit-post", "fullscreenMode");
|
|
294
|
+
registry.dispatch(import_notices.store).createInfoNotice(
|
|
295
|
+
isFullscreen ? (0, import_i18n.__)("Fullscreen mode deactivated.") : (0, import_i18n.__)("Fullscreen mode activated."),
|
|
296
|
+
{
|
|
297
|
+
id: "core/edit-post/toggle-fullscreen-mode/notice",
|
|
298
|
+
type: "snackbar",
|
|
299
|
+
actions: [
|
|
300
|
+
{
|
|
301
|
+
label: (0, import_i18n.__)("Undo"),
|
|
302
|
+
onClick: () => {
|
|
303
|
+
registry.dispatch(import_preferences.store).toggle(
|
|
304
|
+
"core/edit-post",
|
|
305
|
+
"fullscreenMode"
|
|
306
|
+
);
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
]
|
|
310
|
+
}
|
|
311
|
+
);
|
|
534
312
|
};
|
|
535
|
-
|
|
536
|
-
|
|
313
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
314
|
+
0 && (module.exports = {
|
|
315
|
+
__experimentalSetPreviewDeviceType,
|
|
316
|
+
__unstableCreateTemplate,
|
|
317
|
+
closeGeneralSidebar,
|
|
318
|
+
closeModal,
|
|
319
|
+
closePublishSidebar,
|
|
320
|
+
hideBlockTypes,
|
|
321
|
+
initializeMetaBoxes,
|
|
322
|
+
metaBoxUpdatesFailure,
|
|
323
|
+
metaBoxUpdatesSuccess,
|
|
324
|
+
openGeneralSidebar,
|
|
325
|
+
openModal,
|
|
326
|
+
openPublishSidebar,
|
|
327
|
+
removeEditorPanel,
|
|
328
|
+
requestMetaBoxUpdates,
|
|
329
|
+
setAvailableMetaBoxesPerLocation,
|
|
330
|
+
setIsEditingTemplate,
|
|
331
|
+
setIsInserterOpened,
|
|
332
|
+
setIsListViewOpened,
|
|
333
|
+
showBlockTypes,
|
|
334
|
+
switchEditorMode,
|
|
335
|
+
toggleDistractionFree,
|
|
336
|
+
toggleEditorPanelEnabled,
|
|
337
|
+
toggleEditorPanelOpened,
|
|
338
|
+
toggleFeature,
|
|
339
|
+
toggleFullscreenMode,
|
|
340
|
+
togglePinnedPluginItem,
|
|
341
|
+
togglePublishSidebar,
|
|
342
|
+
updatePreferredStyleVariations
|
|
343
|
+
});
|
|
344
|
+
//# sourceMappingURL=actions.js.map
|