@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/index.js
CHANGED
|
@@ -1,99 +1,76 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
Object.
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
var
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
__experimentalMainDashboardButton: true,
|
|
11
|
-
__experimentalFullscreenModeClose: true,
|
|
12
|
-
store: true
|
|
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 });
|
|
13
10
|
};
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
});
|
|
20
|
-
exports.__experimentalMainDashboardButton = void 0;
|
|
21
|
-
exports.initializeEditor = initializeEditor;
|
|
22
|
-
exports.reinitializeEditor = reinitializeEditor;
|
|
23
|
-
Object.defineProperty(exports, "store", {
|
|
24
|
-
enumerable: true,
|
|
25
|
-
get: function () {
|
|
26
|
-
return _store.store;
|
|
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 });
|
|
27
16
|
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var index_exports = {};
|
|
30
|
+
__export(index_exports, {
|
|
31
|
+
__experimentalFullscreenModeClose: () => import_fullscreen_mode_close.default,
|
|
32
|
+
__experimentalMainDashboardButton: () => __experimentalMainDashboardButton,
|
|
33
|
+
initializeEditor: () => initializeEditor,
|
|
34
|
+
reinitializeEditor: () => reinitializeEditor,
|
|
35
|
+
store: () => import_store.store
|
|
28
36
|
});
|
|
29
|
-
|
|
30
|
-
var
|
|
31
|
-
var
|
|
32
|
-
var
|
|
33
|
-
var
|
|
34
|
-
var
|
|
35
|
-
var
|
|
36
|
-
var
|
|
37
|
-
var
|
|
38
|
-
var
|
|
39
|
-
var
|
|
40
|
-
var
|
|
41
|
-
var
|
|
42
|
-
var
|
|
43
|
-
|
|
44
|
-
if (key === "default" || key === "__esModule") return;
|
|
45
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
46
|
-
if (key in exports && exports[key] === _deprecated2[key]) return;
|
|
47
|
-
Object.defineProperty(exports, key, {
|
|
48
|
-
enumerable: true,
|
|
49
|
-
get: function () {
|
|
50
|
-
return _deprecated2[key];
|
|
51
|
-
}
|
|
52
|
-
});
|
|
53
|
-
});
|
|
54
|
-
/**
|
|
55
|
-
* WordPress dependencies
|
|
56
|
-
*/
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* Internal dependencies
|
|
60
|
-
*/
|
|
61
|
-
|
|
37
|
+
module.exports = __toCommonJS(index_exports);
|
|
38
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
39
|
+
var import_blocks = require("@wordpress/blocks");
|
|
40
|
+
var import_block_library = require("@wordpress/block-library");
|
|
41
|
+
var import_deprecated = __toESM(require("@wordpress/deprecated"));
|
|
42
|
+
var import_element = require("@wordpress/element");
|
|
43
|
+
var import_data = require("@wordpress/data");
|
|
44
|
+
var import_preferences = require("@wordpress/preferences");
|
|
45
|
+
var import_widgets = require("@wordpress/widgets");
|
|
46
|
+
var import_editor = require("@wordpress/editor");
|
|
47
|
+
var import_layout = __toESM(require("./components/layout"));
|
|
48
|
+
var import_lock_unlock = require("./lock-unlock");
|
|
49
|
+
var import_fullscreen_mode_close = __toESM(require("./components/back-button/fullscreen-mode-close"));
|
|
50
|
+
var import_store = require("./store");
|
|
51
|
+
__reExport(index_exports, require("./deprecated"), module.exports);
|
|
62
52
|
const {
|
|
63
53
|
BackButton: __experimentalMainDashboardButton,
|
|
64
54
|
registerCoreBlockBindingsSources
|
|
65
|
-
} = (0,
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
* Initializes and returns an instance of Editor.
|
|
69
|
-
*
|
|
70
|
-
* @param {string} id Unique identifier for editor instance.
|
|
71
|
-
* @param {string} postType Post type of the post to edit.
|
|
72
|
-
* @param {Object} postId ID of the post to edit.
|
|
73
|
-
* @param {?Object} settings Editor settings object.
|
|
74
|
-
* @param {Object} initialEdits Programmatic edits to apply initially, to be
|
|
75
|
-
* considered as non-user-initiated (bypass for
|
|
76
|
-
* unsaved changes prompt).
|
|
77
|
-
*/
|
|
78
|
-
exports.__experimentalMainDashboardButton = __experimentalMainDashboardButton;
|
|
55
|
+
} = (0, import_lock_unlock.unlock)(import_editor.privateApis);
|
|
79
56
|
function initializeEditor(id, postType, postId, settings, initialEdits) {
|
|
80
|
-
const isMediumOrBigger = window.matchMedia(
|
|
57
|
+
const isMediumOrBigger = window.matchMedia("(min-width: 782px)").matches;
|
|
81
58
|
const target = document.getElementById(id);
|
|
82
|
-
const root = (0,
|
|
83
|
-
(0,
|
|
59
|
+
const root = (0, import_element.createRoot)(target);
|
|
60
|
+
(0, import_data.dispatch)(import_preferences.store).setDefaults("core/edit-post", {
|
|
84
61
|
fullscreenMode: true,
|
|
85
62
|
themeStyles: true,
|
|
86
63
|
welcomeGuide: true,
|
|
87
64
|
welcomeGuideTemplate: true
|
|
88
65
|
});
|
|
89
|
-
(0,
|
|
66
|
+
(0, import_data.dispatch)(import_preferences.store).setDefaults("core", {
|
|
90
67
|
allowRightClickOverrides: true,
|
|
91
|
-
editorMode:
|
|
92
|
-
editorTool:
|
|
68
|
+
editorMode: "visual",
|
|
69
|
+
editorTool: "edit",
|
|
93
70
|
fixedToolbar: false,
|
|
94
71
|
hiddenBlockTypes: [],
|
|
95
72
|
inactivePanels: [],
|
|
96
|
-
openPanels: [
|
|
73
|
+
openPanels: ["post-status"],
|
|
97
74
|
showBlockBreadcrumbs: true,
|
|
98
75
|
showIconLabels: false,
|
|
99
76
|
showListViewByDefault: false,
|
|
@@ -101,86 +78,74 @@ function initializeEditor(id, postType, postId, settings, initialEdits) {
|
|
|
101
78
|
isPublishSidebarEnabled: true
|
|
102
79
|
});
|
|
103
80
|
if (window.__experimentalMediaProcessing) {
|
|
104
|
-
(0,
|
|
81
|
+
(0, import_data.dispatch)(import_preferences.store).setDefaults("core/media", {
|
|
105
82
|
requireApproval: true,
|
|
106
83
|
optimizeOnUpload: true
|
|
107
84
|
});
|
|
108
85
|
}
|
|
109
|
-
(0,
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
// If `distractionFree` mode is enabled, the block list view should not be open.
|
|
113
|
-
// This behavior is disabled for small viewports.
|
|
114
|
-
if (isMediumOrBigger && (0, _data.select)(_preferences.store).get('core', 'showListViewByDefault') && !(0, _data.select)(_preferences.store).get('core', 'distractionFree')) {
|
|
115
|
-
(0, _data.dispatch)(_editor.store).setIsListViewOpened(true);
|
|
86
|
+
(0, import_data.dispatch)(import_blocks.store).reapplyBlockTypeFilters();
|
|
87
|
+
if (isMediumOrBigger && (0, import_data.select)(import_preferences.store).get("core", "showListViewByDefault") && !(0, import_data.select)(import_preferences.store).get("core", "distractionFree")) {
|
|
88
|
+
(0, import_data.dispatch)(import_editor.store).setIsListViewOpened(true);
|
|
116
89
|
}
|
|
117
|
-
(0,
|
|
90
|
+
(0, import_block_library.registerCoreBlocks)();
|
|
118
91
|
registerCoreBlockBindingsSources();
|
|
119
|
-
(0,
|
|
120
|
-
|
|
121
|
-
});
|
|
122
|
-
(0, _widgets.registerWidgetGroupBlock)({
|
|
123
|
-
inserter: false
|
|
124
|
-
});
|
|
92
|
+
(0, import_widgets.registerLegacyWidgetBlock)({ inserter: false });
|
|
93
|
+
(0, import_widgets.registerWidgetGroupBlock)({ inserter: false });
|
|
125
94
|
if (globalThis.IS_GUTENBERG_PLUGIN) {
|
|
126
|
-
(0,
|
|
95
|
+
(0, import_block_library.__experimentalRegisterExperimentalCoreBlocks)({
|
|
127
96
|
enableFSEBlocks: settings.__unstableEnableFullSiteEditingBlocks
|
|
128
97
|
});
|
|
129
98
|
}
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
console.warn("Your browser is using Quirks Mode. \nThis can cause rendering issues such as blocks overlaying meta boxes in the editor. Quirks Mode can be triggered by PHP errors or HTML code appearing before the opening <!DOCTYPE html>. Try checking the raw page source or your site's PHP error log and resolving errors there, removing any HTML before the doctype, or disabling plugins.");
|
|
99
|
+
const documentMode = document.compatMode === "CSS1Compat" ? "Standards" : "Quirks";
|
|
100
|
+
if (documentMode !== "Standards") {
|
|
101
|
+
console.warn(
|
|
102
|
+
"Your browser is using Quirks Mode. \nThis can cause rendering issues such as blocks overlaying meta boxes in the editor. Quirks Mode can be triggered by PHP errors or HTML code appearing before the opening <!DOCTYPE html>. Try checking the raw page source or your site's PHP error log and resolving errors there, removing any HTML before the doctype, or disabling plugins."
|
|
103
|
+
);
|
|
136
104
|
}
|
|
137
|
-
|
|
138
|
-
// This is a temporary fix for a couple of issues specific to Webkit on iOS.
|
|
139
|
-
// Without this hack the browser scrolls the mobile toolbar off-screen.
|
|
140
|
-
// Once supported in Safari we can replace this in favor of preventScroll.
|
|
141
|
-
// For details see issue #18632 and PR #18686
|
|
142
|
-
// Specifically, we scroll `interface-interface-skeleton__body` to enable a fixed top toolbar.
|
|
143
|
-
// But Mobile Safari forces the `html` element to scroll upwards, hiding the toolbar.
|
|
144
|
-
|
|
145
|
-
const isIphone = window.navigator.userAgent.indexOf('iPhone') !== -1;
|
|
105
|
+
const isIphone = window.navigator.userAgent.indexOf("iPhone") !== -1;
|
|
146
106
|
if (isIphone) {
|
|
147
|
-
window.addEventListener(
|
|
148
|
-
const editorScrollContainer = document.getElementsByClassName(
|
|
107
|
+
window.addEventListener("scroll", (event) => {
|
|
108
|
+
const editorScrollContainer = document.getElementsByClassName(
|
|
109
|
+
"interface-interface-skeleton__body"
|
|
110
|
+
)[0];
|
|
149
111
|
if (event.target === document) {
|
|
150
|
-
// Scroll element into view by scrolling the editor container by the same amount
|
|
151
|
-
// that Mobile Safari tried to scroll the html element upwards.
|
|
152
112
|
if (window.scrollY > 100) {
|
|
153
113
|
editorScrollContainer.scrollTop = editorScrollContainer.scrollTop + window.scrollY;
|
|
154
114
|
}
|
|
155
|
-
|
|
156
|
-
if (document.getElementsByClassName('is-mode-visual')[0]) {
|
|
115
|
+
if (document.getElementsByClassName("is-mode-visual")[0]) {
|
|
157
116
|
window.scrollTo(0, 0);
|
|
158
117
|
}
|
|
159
118
|
}
|
|
160
119
|
});
|
|
161
120
|
}
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
121
|
+
window.addEventListener("dragover", (e) => e.preventDefault(), false);
|
|
122
|
+
window.addEventListener("drop", (e) => e.preventDefault(), false);
|
|
123
|
+
root.render(
|
|
124
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_element.StrictMode, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
125
|
+
import_layout.default,
|
|
126
|
+
{
|
|
127
|
+
settings,
|
|
128
|
+
postId,
|
|
129
|
+
postType,
|
|
130
|
+
initialEdits
|
|
131
|
+
}
|
|
132
|
+
) })
|
|
133
|
+
);
|
|
174
134
|
return root;
|
|
175
135
|
}
|
|
176
|
-
|
|
177
|
-
/**
|
|
178
|
-
* Used to reinitialize the editor after an error. Now it's a deprecated noop function.
|
|
179
|
-
*/
|
|
180
136
|
function reinitializeEditor() {
|
|
181
|
-
(0,
|
|
182
|
-
since:
|
|
183
|
-
version:
|
|
137
|
+
(0, import_deprecated.default)("wp.editPost.reinitializeEditor", {
|
|
138
|
+
since: "6.2",
|
|
139
|
+
version: "6.3"
|
|
184
140
|
});
|
|
185
141
|
}
|
|
186
|
-
|
|
142
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
143
|
+
0 && (module.exports = {
|
|
144
|
+
__experimentalFullscreenModeClose,
|
|
145
|
+
__experimentalMainDashboardButton,
|
|
146
|
+
initializeEditor,
|
|
147
|
+
reinitializeEditor,
|
|
148
|
+
store,
|
|
149
|
+
...require("./deprecated")
|
|
150
|
+
});
|
|
151
|
+
//# sourceMappingURL=index.js.map
|
package/build/index.js.map
CHANGED
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{"version":3,"names":["_blocks","require","_blockLibrary","_deprecated","_interopRequireDefault","_element","_data","_preferences","_widgets","_editor","_layout","_lockUnlock","_jsxRuntime","_fullscreenModeClose","_store","_deprecated2","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","BackButton","__experimentalMainDashboardButton","registerCoreBlockBindingsSources","unlock","editorPrivateApis","initializeEditor","id","postType","postId","settings","initialEdits","isMediumOrBigger","window","matchMedia","matches","target","document","getElementById","root","createRoot","dispatch","preferencesStore","setDefaults","fullscreenMode","themeStyles","welcomeGuide","welcomeGuideTemplate","allowRightClickOverrides","editorMode","editorTool","fixedToolbar","hiddenBlockTypes","inactivePanels","openPanels","showBlockBreadcrumbs","showIconLabels","showListViewByDefault","enableChoosePatternModal","isPublishSidebarEnabled","__experimentalMediaProcessing","requireApproval","optimizeOnUpload","blocksStore","reapplyBlockTypeFilters","select","editorStore","setIsListViewOpened","registerCoreBlocks","registerLegacyWidgetBlock","inserter","registerWidgetGroupBlock","globalThis","IS_GUTENBERG_PLUGIN","__experimentalRegisterExperimentalCoreBlocks","enableFSEBlocks","__unstableEnableFullSiteEditingBlocks","documentMode","compatMode","console","warn","isIphone","navigator","userAgent","indexOf","addEventListener","event","editorScrollContainer","getElementsByClassName","scrollY","scrollTop","scrollTo","e","preventDefault","render","jsx","StrictMode","children","default","reinitializeEditor","deprecated","since","version"],"sources":["@wordpress/edit-post/src/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blocksStore } from '@wordpress/blocks';\nimport {\n\tregisterCoreBlocks,\n\t__experimentalRegisterExperimentalCoreBlocks,\n} from '@wordpress/block-library';\nimport deprecated from '@wordpress/deprecated';\nimport { createRoot, StrictMode } from '@wordpress/element';\nimport { dispatch, select } from '@wordpress/data';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport {\n\tregisterLegacyWidgetBlock,\n\tregisterWidgetGroupBlock,\n} from '@wordpress/widgets';\nimport {\n\tstore as editorStore,\n\tprivateApis as editorPrivateApis,\n} from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport Layout from './components/layout';\nimport { unlock } from './lock-unlock';\n\nconst {\n\tBackButton: __experimentalMainDashboardButton,\n\tregisterCoreBlockBindingsSources,\n} = unlock( editorPrivateApis );\n\n/**\n * Initializes and returns an instance of Editor.\n *\n * @param {string} id Unique identifier for editor instance.\n * @param {string} postType Post type of the post to edit.\n * @param {Object} postId ID of the post to edit.\n * @param {?Object} settings Editor settings object.\n * @param {Object} initialEdits Programmatic edits to apply initially, to be\n * considered as non-user-initiated (bypass for\n * unsaved changes prompt).\n */\nexport function initializeEditor(\n\tid,\n\tpostType,\n\tpostId,\n\tsettings,\n\tinitialEdits\n) {\n\tconst isMediumOrBigger = window.matchMedia( '(min-width: 782px)' ).matches;\n\tconst target = document.getElementById( id );\n\tconst root = createRoot( target );\n\n\tdispatch( preferencesStore ).setDefaults( 'core/edit-post', {\n\t\tfullscreenMode: true,\n\t\tthemeStyles: true,\n\t\twelcomeGuide: true,\n\t\twelcomeGuideTemplate: true,\n\t} );\n\n\tdispatch( preferencesStore ).setDefaults( 'core', {\n\t\tallowRightClickOverrides: true,\n\t\teditorMode: 'visual',\n\t\teditorTool: 'edit',\n\t\tfixedToolbar: false,\n\t\thiddenBlockTypes: [],\n\t\tinactivePanels: [],\n\t\topenPanels: [ 'post-status' ],\n\t\tshowBlockBreadcrumbs: true,\n\t\tshowIconLabels: false,\n\t\tshowListViewByDefault: false,\n\t\tenableChoosePatternModal: true,\n\t\tisPublishSidebarEnabled: true,\n\t} );\n\n\tif ( window.__experimentalMediaProcessing ) {\n\t\tdispatch( preferencesStore ).setDefaults( 'core/media', {\n\t\t\trequireApproval: true,\n\t\t\toptimizeOnUpload: true,\n\t\t} );\n\t}\n\n\tdispatch( blocksStore ).reapplyBlockTypeFilters();\n\n\t// Check if the block list view should be open by default.\n\t// If `distractionFree` mode is enabled, the block list view should not be open.\n\t// This behavior is disabled for small viewports.\n\tif (\n\t\tisMediumOrBigger &&\n\t\tselect( preferencesStore ).get( 'core', 'showListViewByDefault' ) &&\n\t\t! select( preferencesStore ).get( 'core', 'distractionFree' )\n\t) {\n\t\tdispatch( editorStore ).setIsListViewOpened( true );\n\t}\n\n\tregisterCoreBlocks();\n\tregisterCoreBlockBindingsSources();\n\tregisterLegacyWidgetBlock( { inserter: false } );\n\tregisterWidgetGroupBlock( { inserter: false } );\n\tif ( globalThis.IS_GUTENBERG_PLUGIN ) {\n\t\t__experimentalRegisterExperimentalCoreBlocks( {\n\t\t\tenableFSEBlocks: settings.__unstableEnableFullSiteEditingBlocks,\n\t\t} );\n\t}\n\n\t// Show a console log warning if the browser is not in Standards rendering mode.\n\tconst documentMode =\n\t\tdocument.compatMode === 'CSS1Compat' ? 'Standards' : 'Quirks';\n\tif ( documentMode !== 'Standards' ) {\n\t\t// eslint-disable-next-line no-console\n\t\tconsole.warn(\n\t\t\t\"Your browser is using Quirks Mode. \\nThis can cause rendering issues such as blocks overlaying meta boxes in the editor. Quirks Mode can be triggered by PHP errors or HTML code appearing before the opening <!DOCTYPE html>. Try checking the raw page source or your site's PHP error log and resolving errors there, removing any HTML before the doctype, or disabling plugins.\"\n\t\t);\n\t}\n\n\t// This is a temporary fix for a couple of issues specific to Webkit on iOS.\n\t// Without this hack the browser scrolls the mobile toolbar off-screen.\n\t// Once supported in Safari we can replace this in favor of preventScroll.\n\t// For details see issue #18632 and PR #18686\n\t// Specifically, we scroll `interface-interface-skeleton__body` to enable a fixed top toolbar.\n\t// But Mobile Safari forces the `html` element to scroll upwards, hiding the toolbar.\n\n\tconst isIphone = window.navigator.userAgent.indexOf( 'iPhone' ) !== -1;\n\tif ( isIphone ) {\n\t\twindow.addEventListener( 'scroll', ( event ) => {\n\t\t\tconst editorScrollContainer = document.getElementsByClassName(\n\t\t\t\t'interface-interface-skeleton__body'\n\t\t\t)[ 0 ];\n\t\t\tif ( event.target === document ) {\n\t\t\t\t// Scroll element into view by scrolling the editor container by the same amount\n\t\t\t\t// that Mobile Safari tried to scroll the html element upwards.\n\t\t\t\tif ( window.scrollY > 100 ) {\n\t\t\t\t\teditorScrollContainer.scrollTop =\n\t\t\t\t\t\teditorScrollContainer.scrollTop + window.scrollY;\n\t\t\t\t}\n\t\t\t\t// Undo unwanted scroll on html element, but only in the visual editor.\n\t\t\t\tif (\n\t\t\t\t\tdocument.getElementsByClassName( 'is-mode-visual' )[ 0 ]\n\t\t\t\t) {\n\t\t\t\t\twindow.scrollTo( 0, 0 );\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\t}\n\n\t// Prevent the default browser action for files dropped outside of dropzones.\n\twindow.addEventListener( 'dragover', ( e ) => e.preventDefault(), false );\n\twindow.addEventListener( 'drop', ( e ) => e.preventDefault(), false );\n\n\troot.render(\n\t\t<StrictMode>\n\t\t\t<Layout\n\t\t\t\tsettings={ settings }\n\t\t\t\tpostId={ postId }\n\t\t\t\tpostType={ postType }\n\t\t\t\tinitialEdits={ initialEdits }\n\t\t\t/>\n\t\t</StrictMode>\n\t);\n\n\treturn root;\n}\n\n/**\n * Used to reinitialize the editor after an error. Now it's a deprecated noop function.\n */\nexport function reinitializeEditor() {\n\tdeprecated( 'wp.editPost.reinitializeEditor', {\n\t\tsince: '6.2',\n\t\tversion: '6.3',\n\t} );\n}\n\nexport { default as __experimentalFullscreenModeClose } from './components/back-button/fullscreen-mode-close';\nexport { __experimentalMainDashboardButton };\nexport { store } from './store';\nexport * from './deprecated';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AAIA,IAAAE,WAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,YAAA,GAAAN,OAAA;AACA,IAAAO,QAAA,GAAAP,OAAA;AAIA,IAAAQ,OAAA,GAAAR,OAAA;AAQA,IAAAS,OAAA,GAAAN,sBAAA,CAAAH,OAAA;AACA,IAAAU,WAAA,GAAAV,OAAA;AAAuC,IAAAW,WAAA,GAAAX,OAAA;AAqJvC,IAAAY,oBAAA,GAAAT,sBAAA,CAAAH,OAAA;AAEA,IAAAa,MAAA,GAAAb,OAAA;AACA,IAAAc,YAAA,GAAAd,OAAA;AAAAe,MAAA,CAAAC,IAAA,CAAAF,YAAA,EAAAG,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAJ,YAAA,CAAAI,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAZ,YAAA,CAAAI,GAAA;IAAA;EAAA;AAAA;AAjLA;AACA;AACA;;AAmBA;AACA;AACA;;AAIA,MAAM;EACLS,UAAU,EAAEC,iCAAiC;EAC7CC;AACD,CAAC,GAAG,IAAAC,kBAAM,EAAEC,mBAAkB,CAAC;;AAE/B;AACA;AACA;AACA;AAC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ACwD,OAAO,GAAG,GAAG,EAAG;UAC3BF,qBAAqB,CAACG,SAAS,GAC9BH,qBAAqB,CAACG,SAAS,GAAGzD,MAAM,CAACwD,OAAO;QAClD;QACA;QACA,IACCpD,QAAQ,CAACmD,sBAAsB,CAAE,gBAAiB,CAAC,CAAE,CAAC,CAAE,EACvD;UACDvD,MAAM,CAAC0D,QAAQ,CAAE,CAAC,EAAE,CAAE,CAAC;QACxB;MACD;IACD,CAAE,CAAC;EACJ;;EAEA;EACA1D,MAAM,CAACoD,gBAAgB,CAAE,UAAU,EAAIO,CAAC,IAAMA,CAAC,CAACC,cAAc,CAAC,CAAC,EAAE,KAAM,CAAC;EACzE5D,MAAM,CAACoD,gBAAgB,CAAE,MAAM,EAAIO,CAAC,IAAMA,CAAC,CAACC,cAAc,CAAC,CAAC,EAAE,KAAM,CAAC;EAErEtD,IAAI,CAACuD,MAAM,cACV,IAAAzF,WAAA,CAAA0F,GAAA,EAACjG,QAAA,CAAAkG,UAAU;IAAAC,QAAA,eACV,IAAA5F,WAAA,CAAA0F,GAAA,EAAC5F,OAAA,CAAA+F,OAAM;MACNpE,QAAQ,EAAGA,QAAU;MACrBD,MAAM,EAAGA,MAAQ;MACjBD,QAAQ,EAAGA,QAAU;MACrBG,YAAY,EAAGA;IAAc,CAC7B;EAAC,CACS,CACb,CAAC;EAED,OAAOQ,IAAI;AACZ;;AAEA;AACA;AACA;AACO,SAAS4D,kBAAkBA,CAAA,EAAG;EACpC,IAAAC,mBAAU,EAAE,gCAAgC,EAAE;IAC7CC,KAAK,EAAE,KAAK;IACZC,OAAO,EAAE;EACV,CAAE,CAAC;AACJ","ignoreList":[]}
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/index.js"],
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { store as blocksStore } from '@wordpress/blocks';\nimport {\n\tregisterCoreBlocks,\n\t__experimentalRegisterExperimentalCoreBlocks,\n} from '@wordpress/block-library';\nimport deprecated from '@wordpress/deprecated';\nimport { createRoot, StrictMode } from '@wordpress/element';\nimport { dispatch, select } from '@wordpress/data';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport {\n\tregisterLegacyWidgetBlock,\n\tregisterWidgetGroupBlock,\n} from '@wordpress/widgets';\nimport {\n\tstore as editorStore,\n\tprivateApis as editorPrivateApis,\n} from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport Layout from './components/layout';\nimport { unlock } from './lock-unlock';\n\nconst {\n\tBackButton: __experimentalMainDashboardButton,\n\tregisterCoreBlockBindingsSources,\n} = unlock( editorPrivateApis );\n\n/**\n * Initializes and returns an instance of Editor.\n *\n * @param {string} id Unique identifier for editor instance.\n * @param {string} postType Post type of the post to edit.\n * @param {Object} postId ID of the post to edit.\n * @param {?Object} settings Editor settings object.\n * @param {Object} initialEdits Programmatic edits to apply initially, to be\n * considered as non-user-initiated (bypass for\n * unsaved changes prompt).\n */\nexport function initializeEditor(\n\tid,\n\tpostType,\n\tpostId,\n\tsettings,\n\tinitialEdits\n) {\n\tconst isMediumOrBigger = window.matchMedia( '(min-width: 782px)' ).matches;\n\tconst target = document.getElementById( id );\n\tconst root = createRoot( target );\n\n\tdispatch( preferencesStore ).setDefaults( 'core/edit-post', {\n\t\tfullscreenMode: true,\n\t\tthemeStyles: true,\n\t\twelcomeGuide: true,\n\t\twelcomeGuideTemplate: true,\n\t} );\n\n\tdispatch( preferencesStore ).setDefaults( 'core', {\n\t\tallowRightClickOverrides: true,\n\t\teditorMode: 'visual',\n\t\teditorTool: 'edit',\n\t\tfixedToolbar: false,\n\t\thiddenBlockTypes: [],\n\t\tinactivePanels: [],\n\t\topenPanels: [ 'post-status' ],\n\t\tshowBlockBreadcrumbs: true,\n\t\tshowIconLabels: false,\n\t\tshowListViewByDefault: false,\n\t\tenableChoosePatternModal: true,\n\t\tisPublishSidebarEnabled: true,\n\t} );\n\n\tif ( window.__experimentalMediaProcessing ) {\n\t\tdispatch( preferencesStore ).setDefaults( 'core/media', {\n\t\t\trequireApproval: true,\n\t\t\toptimizeOnUpload: true,\n\t\t} );\n\t}\n\n\tdispatch( blocksStore ).reapplyBlockTypeFilters();\n\n\t// Check if the block list view should be open by default.\n\t// If `distractionFree` mode is enabled, the block list view should not be open.\n\t// This behavior is disabled for small viewports.\n\tif (\n\t\tisMediumOrBigger &&\n\t\tselect( preferencesStore ).get( 'core', 'showListViewByDefault' ) &&\n\t\t! select( preferencesStore ).get( 'core', 'distractionFree' )\n\t) {\n\t\tdispatch( editorStore ).setIsListViewOpened( true );\n\t}\n\n\tregisterCoreBlocks();\n\tregisterCoreBlockBindingsSources();\n\tregisterLegacyWidgetBlock( { inserter: false } );\n\tregisterWidgetGroupBlock( { inserter: false } );\n\tif ( globalThis.IS_GUTENBERG_PLUGIN ) {\n\t\t__experimentalRegisterExperimentalCoreBlocks( {\n\t\t\tenableFSEBlocks: settings.__unstableEnableFullSiteEditingBlocks,\n\t\t} );\n\t}\n\n\t// Show a console log warning if the browser is not in Standards rendering mode.\n\tconst documentMode =\n\t\tdocument.compatMode === 'CSS1Compat' ? 'Standards' : 'Quirks';\n\tif ( documentMode !== 'Standards' ) {\n\t\t// eslint-disable-next-line no-console\n\t\tconsole.warn(\n\t\t\t\"Your browser is using Quirks Mode. \\nThis can cause rendering issues such as blocks overlaying meta boxes in the editor. Quirks Mode can be triggered by PHP errors or HTML code appearing before the opening <!DOCTYPE html>. Try checking the raw page source or your site's PHP error log and resolving errors there, removing any HTML before the doctype, or disabling plugins.\"\n\t\t);\n\t}\n\n\t// This is a temporary fix for a couple of issues specific to Webkit on iOS.\n\t// Without this hack the browser scrolls the mobile toolbar off-screen.\n\t// Once supported in Safari we can replace this in favor of preventScroll.\n\t// For details see issue #18632 and PR #18686\n\t// Specifically, we scroll `interface-interface-skeleton__body` to enable a fixed top toolbar.\n\t// But Mobile Safari forces the `html` element to scroll upwards, hiding the toolbar.\n\n\tconst isIphone = window.navigator.userAgent.indexOf( 'iPhone' ) !== -1;\n\tif ( isIphone ) {\n\t\twindow.addEventListener( 'scroll', ( event ) => {\n\t\t\tconst editorScrollContainer = document.getElementsByClassName(\n\t\t\t\t'interface-interface-skeleton__body'\n\t\t\t)[ 0 ];\n\t\t\tif ( event.target === document ) {\n\t\t\t\t// Scroll element into view by scrolling the editor container by the same amount\n\t\t\t\t// that Mobile Safari tried to scroll the html element upwards.\n\t\t\t\tif ( window.scrollY > 100 ) {\n\t\t\t\t\teditorScrollContainer.scrollTop =\n\t\t\t\t\t\teditorScrollContainer.scrollTop + window.scrollY;\n\t\t\t\t}\n\t\t\t\t// Undo unwanted scroll on html element, but only in the visual editor.\n\t\t\t\tif (\n\t\t\t\t\tdocument.getElementsByClassName( 'is-mode-visual' )[ 0 ]\n\t\t\t\t) {\n\t\t\t\t\twindow.scrollTo( 0, 0 );\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\t}\n\n\t// Prevent the default browser action for files dropped outside of dropzones.\n\twindow.addEventListener( 'dragover', ( e ) => e.preventDefault(), false );\n\twindow.addEventListener( 'drop', ( e ) => e.preventDefault(), false );\n\n\troot.render(\n\t\t<StrictMode>\n\t\t\t<Layout\n\t\t\t\tsettings={ settings }\n\t\t\t\tpostId={ postId }\n\t\t\t\tpostType={ postType }\n\t\t\t\tinitialEdits={ initialEdits }\n\t\t\t/>\n\t\t</StrictMode>\n\t);\n\n\treturn root;\n}\n\n/**\n * Used to reinitialize the editor after an error. Now it's a deprecated noop function.\n */\nexport function reinitializeEditor() {\n\tdeprecated( 'wp.editPost.reinitializeEditor', {\n\t\tsince: '6.2',\n\t\tversion: '6.3',\n\t} );\n}\n\nexport { default as __experimentalFullscreenModeClose } from './components/back-button/fullscreen-mode-close';\nexport { __experimentalMainDashboardButton };\nexport { store } from './store';\nexport * from './deprecated';\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAwJG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blocksStore", "editorStore", "Layout", "deprecated"]
|
|
7
|
+
}
|
package/build/lock-unlock.js
CHANGED
|
@@ -1,18 +1,34 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.
|
|
4
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var lock_unlock_exports = {};
|
|
19
|
+
__export(lock_unlock_exports, {
|
|
20
|
+
lock: () => lock,
|
|
21
|
+
unlock: () => unlock
|
|
5
22
|
});
|
|
6
|
-
|
|
7
|
-
var
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
23
|
+
module.exports = __toCommonJS(lock_unlock_exports);
|
|
24
|
+
var import_private_apis = require("@wordpress/private-apis");
|
|
25
|
+
const { lock, unlock } = (0, import_private_apis.__dangerousOptInToUnstableAPIsOnlyForCoreModules)(
|
|
26
|
+
"I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.",
|
|
27
|
+
"@wordpress/edit-post"
|
|
28
|
+
);
|
|
29
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
30
|
+
0 && (module.exports = {
|
|
13
31
|
lock,
|
|
14
32
|
unlock
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
exports.lock = lock;
|
|
18
|
-
//# sourceMappingURL=lock-unlock.js.map
|
|
33
|
+
});
|
|
34
|
+
//# sourceMappingURL=lock-unlock.js.map
|
package/build/lock-unlock.js.map
CHANGED
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/lock-unlock.js"],
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/private-apis';\n\nexport const { lock, unlock } =\n\t__dangerousOptInToUnstableAPIsOnlyForCoreModules(\n\t\t'I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.',\n\t\t'@wordpress/edit-post'\n\t);\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,0BAAiE;AAE1D,MAAM,EAAE,MAAM,OAAO,QAC3B;AAAA,EACC;AAAA,EACA;AACD;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|