@wordpress/editor 14.14.0 → 14.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/LICENSE.md +1 -1
- package/README.md +1 -0
- package/build/components/commands/index.js +28 -0
- package/build/components/commands/index.js.map +1 -1
- package/build/components/document-bar/index.js +2 -1
- package/build/components/document-bar/index.js.map +1 -1
- package/build/components/document-tools/index.js +3 -6
- package/build/components/document-tools/index.js.map +1 -1
- package/build/components/editor-help/intro-to-blocks.native.js +1 -1
- package/build/components/editor-help/intro-to-blocks.native.js.map +1 -1
- package/build/components/entities-saved-states/index.js +2 -1
- package/build/components/entities-saved-states/index.js.map +1 -1
- package/build/components/error-boundary/index.native.js +1 -1
- package/build/components/error-boundary/index.native.js.map +1 -1
- package/build/components/more-menu/index.js +0 -1
- package/build/components/more-menu/index.js.map +1 -1
- package/build/components/post-actions/actions.js +9 -4
- package/build/components/post-actions/actions.js.map +1 -1
- package/build/components/post-actions/index.js +17 -14
- package/build/components/post-actions/index.js.map +1 -1
- package/build/components/post-actions/set-as-homepage.js +23 -34
- package/build/components/post-actions/set-as-homepage.js.map +1 -1
- package/build/components/post-actions/set-as-posts-page.js +154 -0
- package/build/components/post-actions/set-as-posts-page.js.map +1 -0
- package/build/components/post-card-panel/index.js +12 -5
- package/build/components/post-card-panel/index.js.map +1 -1
- package/build/components/post-publish-panel/maybe-upload-media.js +1 -1
- package/build/components/post-publish-panel/maybe-upload-media.js.map +1 -1
- package/build/components/preferences-modal/index.js +2 -4
- package/build/components/preferences-modal/index.js.map +1 -1
- package/build/components/preview-dropdown/index.js +0 -1
- package/build/components/preview-dropdown/index.js.map +1 -1
- package/build/components/provider/disable-non-page-content-blocks.js +65 -13
- package/build/components/provider/disable-non-page-content-blocks.js.map +1 -1
- package/build/components/provider/index.js +9 -13
- package/build/components/provider/index.js.map +1 -1
- package/build/components/provider/use-block-editor-settings.js +3 -1
- package/build/components/provider/use-block-editor-settings.js.map +1 -1
- package/build/components/start-page-options/index.js +20 -107
- package/build/components/start-page-options/index.js.map +1 -1
- package/build/components/template-part-menu-items/index.js +2 -10
- package/build/components/template-part-menu-items/index.js.map +1 -1
- package/build/store/actions.js +0 -2
- package/build/store/actions.js.map +1 -1
- package/build/store/constants.js +1 -3
- package/build/store/constants.js.map +1 -1
- package/build/store/private-actions.js +1 -1
- package/build/store/private-actions.js.map +1 -1
- package/build/store/utils/notice-builder.js +3 -8
- package/build/store/utils/notice-builder.js.map +1 -1
- package/build/utils/get-item-title.js +32 -0
- package/build/utils/get-item-title.js.map +1 -0
- package/build/utils/media-sideload/index.js +21 -0
- package/build/utils/media-sideload/index.js.map +1 -0
- package/build/utils/media-sideload/index.native.js +8 -0
- package/build/utils/media-sideload/index.native.js.map +1 -0
- package/build/utils/media-upload/index.js +5 -2
- package/build/utils/media-upload/index.js.map +1 -1
- package/build-module/components/commands/index.js +28 -0
- package/build-module/components/commands/index.js.map +1 -1
- package/build-module/components/document-bar/index.js +2 -1
- package/build-module/components/document-bar/index.js.map +1 -1
- package/build-module/components/document-tools/index.js +4 -7
- package/build-module/components/document-tools/index.js.map +1 -1
- package/build-module/components/editor-help/intro-to-blocks.native.js +1 -1
- package/build-module/components/editor-help/intro-to-blocks.native.js.map +1 -1
- package/build-module/components/entities-saved-states/index.js +2 -1
- package/build-module/components/entities-saved-states/index.js.map +1 -1
- package/build-module/components/error-boundary/index.native.js +2 -2
- package/build-module/components/error-boundary/index.native.js.map +1 -1
- package/build-module/components/more-menu/index.js +0 -1
- package/build-module/components/more-menu/index.js.map +1 -1
- package/build-module/components/post-actions/actions.js +9 -4
- package/build-module/components/post-actions/actions.js.map +1 -1
- package/build-module/components/post-actions/index.js +18 -15
- package/build-module/components/post-actions/index.js.map +1 -1
- package/build-module/components/post-actions/set-as-homepage.js +22 -33
- package/build-module/components/post-actions/set-as-homepage.js.map +1 -1
- package/build-module/components/post-actions/set-as-posts-page.js +146 -0
- package/build-module/components/post-actions/set-as-posts-page.js.map +1 -0
- package/build-module/components/post-card-panel/index.js +11 -6
- package/build-module/components/post-card-panel/index.js.map +1 -1
- package/build-module/components/post-publish-panel/maybe-upload-media.js +2 -2
- package/build-module/components/post-publish-panel/maybe-upload-media.js.map +1 -1
- package/build-module/components/preferences-modal/index.js +2 -4
- package/build-module/components/preferences-modal/index.js.map +1 -1
- package/build-module/components/preview-dropdown/index.js +0 -1
- package/build-module/components/preview-dropdown/index.js.map +1 -1
- package/build-module/components/provider/disable-non-page-content-blocks.js +65 -13
- package/build-module/components/provider/disable-non-page-content-blocks.js.map +1 -1
- package/build-module/components/provider/index.js +10 -14
- package/build-module/components/provider/index.js.map +1 -1
- package/build-module/components/provider/use-block-editor-settings.js +3 -1
- package/build-module/components/provider/use-block-editor-settings.js.map +1 -1
- package/build-module/components/start-page-options/index.js +21 -107
- package/build-module/components/start-page-options/index.js.map +1 -1
- package/build-module/components/template-part-menu-items/index.js +2 -10
- package/build-module/components/template-part-menu-items/index.js.map +1 -1
- package/build-module/store/actions.js +0 -2
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/constants.js +0 -2
- package/build-module/store/constants.js.map +1 -1
- package/build-module/store/private-actions.js +1 -1
- package/build-module/store/private-actions.js.map +1 -1
- package/build-module/store/utils/notice-builder.js +3 -8
- package/build-module/store/utils/notice-builder.js.map +1 -1
- package/build-module/utils/get-item-title.js +26 -0
- package/build-module/utils/get-item-title.js.map +1 -0
- package/build-module/utils/media-sideload/index.js +14 -0
- package/build-module/utils/media-sideload/index.js.map +1 -0
- package/build-module/utils/media-sideload/index.native.js +2 -0
- package/build-module/utils/media-sideload/index.native.js.map +1 -0
- package/build-module/utils/media-upload/index.js +5 -2
- package/build-module/utils/media-upload/index.js.map +1 -1
- package/build-style/style-rtl.css +5 -25
- package/build-style/style.css +5 -25
- package/build-types/components/commands/index.d.ts.map +1 -1
- package/build-types/components/document-bar/index.d.ts.map +1 -1
- package/build-types/components/document-tools/index.d.ts.map +1 -1
- package/build-types/components/entities-saved-states/index.d.ts.map +1 -1
- package/build-types/components/more-menu/index.d.ts.map +1 -1
- package/build-types/components/post-actions/actions.d.ts.map +1 -1
- package/build-types/components/post-actions/index.d.ts.map +1 -1
- package/build-types/components/post-actions/set-as-homepage.d.ts.map +1 -1
- package/build-types/components/post-actions/set-as-posts-page.d.ts +10 -0
- package/build-types/components/post-actions/set-as-posts-page.d.ts.map +1 -0
- package/build-types/components/post-card-panel/index.d.ts.map +1 -1
- package/build-types/components/preferences-modal/index.d.ts.map +1 -1
- package/build-types/components/preview-dropdown/index.d.ts.map +1 -1
- package/build-types/components/provider/disable-non-page-content-blocks.d.ts.map +1 -1
- package/build-types/components/provider/index.d.ts.map +1 -1
- package/build-types/components/provider/use-block-editor-settings.d.ts.map +1 -1
- package/build-types/components/start-page-options/index.d.ts +1 -2
- package/build-types/components/start-page-options/index.d.ts.map +1 -1
- package/build-types/store/actions.d.ts.map +1 -1
- package/build-types/store/constants.d.ts +0 -2
- package/build-types/store/constants.d.ts.map +1 -1
- package/build-types/store/private-actions.d.ts.map +1 -1
- package/build-types/store/utils/notice-builder.d.ts.map +1 -1
- package/build-types/utils/get-item-title.d.ts +10 -0
- package/build-types/utils/get-item-title.d.ts.map +1 -0
- package/build-types/utils/media-sideload/index.d.ts +3 -0
- package/build-types/utils/media-sideload/index.d.ts.map +1 -0
- package/build-types/utils/media-upload/index.d.ts +3 -1
- package/build-types/utils/media-upload/index.d.ts.map +1 -1
- package/package.json +37 -37
- package/src/components/commands/index.js +29 -0
- package/src/components/document-bar/index.js +2 -1
- package/src/components/document-tools/index.js +3 -6
- package/src/components/document-tools/style.scss +0 -6
- package/src/components/editor-help/intro-to-blocks.native.js +1 -1
- package/src/components/entities-saved-states/index.js +5 -1
- package/src/components/error-boundary/index.native.js +2 -2
- package/src/components/more-menu/index.js +0 -1
- package/src/components/post-actions/actions.js +12 -4
- package/src/components/post-actions/index.js +19 -17
- package/src/components/post-actions/set-as-homepage.js +29 -45
- package/src/components/post-actions/set-as-posts-page.js +164 -0
- package/src/components/post-card-panel/index.js +8 -6
- package/src/components/post-card-panel/style.scss +4 -13
- package/src/components/post-publish-panel/maybe-upload-media.js +2 -2
- package/src/components/preferences-modal/index.js +8 -13
- package/src/components/preview-dropdown/index.js +0 -1
- package/src/components/provider/disable-non-page-content-blocks.js +64 -13
- package/src/components/provider/index.js +13 -27
- package/src/components/provider/use-block-editor-settings.js +3 -0
- package/src/components/start-page-options/index.js +28 -119
- package/src/components/template-part-menu-items/index.js +2 -11
- package/src/store/actions.js +0 -2
- package/src/store/constants.ts +0 -2
- package/src/store/private-actions.js +1 -1
- package/src/store/utils/notice-builder.js +3 -8
- package/src/store/utils/test/notice-builder.js +3 -4
- package/src/utils/get-item-title.js +25 -0
- package/src/utils/media-sideload/index.js +13 -0
- package/src/utils/media-sideload/index.native.js +1 -0
- package/src/utils/media-upload/index.js +4 -1
- package/tsconfig.json +1 -4
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -24,11 +24,18 @@ var _usePostContentBlocks = _interopRequireDefault(require("./use-post-content-b
|
|
|
24
24
|
*/
|
|
25
25
|
function DisableNonPageContentBlocks() {
|
|
26
26
|
const contentOnlyIds = (0, _usePostContentBlocks.default)();
|
|
27
|
-
const
|
|
27
|
+
const {
|
|
28
|
+
templateParts,
|
|
29
|
+
isNavigationMode
|
|
30
|
+
} = (0, _data.useSelect)(select => {
|
|
28
31
|
const {
|
|
29
|
-
getBlocksByName
|
|
32
|
+
getBlocksByName,
|
|
33
|
+
isNavigationMode: _isNavigationMode
|
|
30
34
|
} = select(_blockEditor.store);
|
|
31
|
-
return
|
|
35
|
+
return {
|
|
36
|
+
templateParts: getBlocksByName('core/template-part'),
|
|
37
|
+
isNavigationMode: _isNavigationMode()
|
|
38
|
+
};
|
|
32
39
|
}, []);
|
|
33
40
|
const disabledIds = (0, _data.useSelect)(select => {
|
|
34
41
|
const {
|
|
@@ -37,38 +44,83 @@ function DisableNonPageContentBlocks() {
|
|
|
37
44
|
return templateParts.flatMap(clientId => getBlockOrder(clientId));
|
|
38
45
|
}, [templateParts]);
|
|
39
46
|
const registry = (0, _data.useRegistry)();
|
|
47
|
+
|
|
48
|
+
// The code here is split into multiple `useEffects` calls.
|
|
49
|
+
// This is done to avoid setting/unsetting block editing modes multiple times unnecessarily.
|
|
50
|
+
//
|
|
51
|
+
// For example, the block editing mode of the root block (clientId: '') only
|
|
52
|
+
// needs to be set once, not when `contentOnlyIds` or `disabledIds` change.
|
|
53
|
+
//
|
|
54
|
+
// It's also unlikely that these different types of blocks are being inserted
|
|
55
|
+
// or removed at the same time, so using different effects reflects that.
|
|
56
|
+
(0, _element.useEffect)(() => {
|
|
57
|
+
const {
|
|
58
|
+
setBlockEditingMode,
|
|
59
|
+
unsetBlockEditingMode
|
|
60
|
+
} = registry.dispatch(_blockEditor.store);
|
|
61
|
+
setBlockEditingMode('', 'disabled');
|
|
62
|
+
return () => {
|
|
63
|
+
unsetBlockEditingMode('');
|
|
64
|
+
};
|
|
65
|
+
}, [registry]);
|
|
40
66
|
(0, _element.useEffect)(() => {
|
|
41
67
|
const {
|
|
42
68
|
setBlockEditingMode,
|
|
43
69
|
unsetBlockEditingMode
|
|
44
70
|
} = registry.dispatch(_blockEditor.store);
|
|
45
71
|
registry.batch(() => {
|
|
46
|
-
setBlockEditingMode('', 'disabled');
|
|
47
72
|
for (const clientId of contentOnlyIds) {
|
|
48
73
|
setBlockEditingMode(clientId, 'contentOnly');
|
|
49
74
|
}
|
|
50
|
-
for (const clientId of templateParts) {
|
|
51
|
-
setBlockEditingMode(clientId, 'contentOnly');
|
|
52
|
-
}
|
|
53
|
-
for (const clientId of disabledIds) {
|
|
54
|
-
setBlockEditingMode(clientId, 'disabled');
|
|
55
|
-
}
|
|
56
75
|
});
|
|
57
76
|
return () => {
|
|
58
77
|
registry.batch(() => {
|
|
59
|
-
unsetBlockEditingMode('');
|
|
60
78
|
for (const clientId of contentOnlyIds) {
|
|
61
79
|
unsetBlockEditingMode(clientId);
|
|
62
80
|
}
|
|
81
|
+
});
|
|
82
|
+
};
|
|
83
|
+
}, [contentOnlyIds, registry]);
|
|
84
|
+
(0, _element.useEffect)(() => {
|
|
85
|
+
const {
|
|
86
|
+
setBlockEditingMode,
|
|
87
|
+
unsetBlockEditingMode
|
|
88
|
+
} = registry.dispatch(_blockEditor.store);
|
|
89
|
+
registry.batch(() => {
|
|
90
|
+
if (!isNavigationMode) {
|
|
63
91
|
for (const clientId of templateParts) {
|
|
64
|
-
|
|
92
|
+
setBlockEditingMode(clientId, 'contentOnly');
|
|
65
93
|
}
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
return () => {
|
|
97
|
+
registry.batch(() => {
|
|
98
|
+
if (!isNavigationMode) {
|
|
99
|
+
for (const clientId of templateParts) {
|
|
100
|
+
unsetBlockEditingMode(clientId);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
};
|
|
105
|
+
}, [templateParts, isNavigationMode, registry]);
|
|
106
|
+
(0, _element.useEffect)(() => {
|
|
107
|
+
const {
|
|
108
|
+
setBlockEditingMode,
|
|
109
|
+
unsetBlockEditingMode
|
|
110
|
+
} = registry.dispatch(_blockEditor.store);
|
|
111
|
+
registry.batch(() => {
|
|
112
|
+
for (const clientId of disabledIds) {
|
|
113
|
+
setBlockEditingMode(clientId, 'disabled');
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
return () => {
|
|
117
|
+
registry.batch(() => {
|
|
66
118
|
for (const clientId of disabledIds) {
|
|
67
119
|
unsetBlockEditingMode(clientId);
|
|
68
120
|
}
|
|
69
121
|
});
|
|
70
122
|
};
|
|
71
|
-
}, [
|
|
123
|
+
}, [disabledIds, registry]);
|
|
72
124
|
return null;
|
|
73
125
|
}
|
|
74
126
|
//# sourceMappingURL=disable-non-page-content-blocks.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_data","require","_blockEditor","_element","_usePostContentBlocks","_interopRequireDefault","DisableNonPageContentBlocks","contentOnlyIds","usePostContentBlocks","templateParts","useSelect","select","getBlocksByName","blockEditorStore","disabledIds","getBlockOrder","flatMap","clientId","registry","useRegistry","useEffect","setBlockEditingMode","unsetBlockEditingMode","dispatch","batch"],"sources":["@wordpress/editor/src/components/provider/disable-non-page-content-blocks.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useRegistry } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { useEffect } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport usePostContentBlocks from './use-post-content-blocks';\n\n/**\n * Component that when rendered, makes it so that the site editor allows only\n * page content to be edited.\n */\nexport default function DisableNonPageContentBlocks() {\n\tconst contentOnlyIds = usePostContentBlocks();\n\tconst templateParts = useSelect( ( select ) => {\n\t\tconst { getBlocksByName }
|
|
1
|
+
{"version":3,"names":["_data","require","_blockEditor","_element","_usePostContentBlocks","_interopRequireDefault","DisableNonPageContentBlocks","contentOnlyIds","usePostContentBlocks","templateParts","isNavigationMode","useSelect","select","getBlocksByName","_isNavigationMode","blockEditorStore","disabledIds","getBlockOrder","flatMap","clientId","registry","useRegistry","useEffect","setBlockEditingMode","unsetBlockEditingMode","dispatch","batch"],"sources":["@wordpress/editor/src/components/provider/disable-non-page-content-blocks.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useRegistry } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { useEffect } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport usePostContentBlocks from './use-post-content-blocks';\n\n/**\n * Component that when rendered, makes it so that the site editor allows only\n * page content to be edited.\n */\nexport default function DisableNonPageContentBlocks() {\n\tconst contentOnlyIds = usePostContentBlocks();\n\tconst { templateParts, isNavigationMode } = useSelect( ( select ) => {\n\t\tconst { getBlocksByName, isNavigationMode: _isNavigationMode } =\n\t\t\tselect( blockEditorStore );\n\t\treturn {\n\t\t\ttemplateParts: getBlocksByName( 'core/template-part' ),\n\t\t\tisNavigationMode: _isNavigationMode(),\n\t\t};\n\t}, [] );\n\tconst disabledIds = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlockOrder } = select( blockEditorStore );\n\t\t\treturn templateParts.flatMap( ( clientId ) =>\n\t\t\t\tgetBlockOrder( clientId )\n\t\t\t);\n\t\t},\n\t\t[ templateParts ]\n\t);\n\n\tconst registry = useRegistry();\n\n\t// The code here is split into multiple `useEffects` calls.\n\t// This is done to avoid setting/unsetting block editing modes multiple times unnecessarily.\n\t//\n\t// For example, the block editing mode of the root block (clientId: '') only\n\t// needs to be set once, not when `contentOnlyIds` or `disabledIds` change.\n\t//\n\t// It's also unlikely that these different types of blocks are being inserted\n\t// or removed at the same time, so using different effects reflects that.\n\tuseEffect( () => {\n\t\tconst { setBlockEditingMode, unsetBlockEditingMode } =\n\t\t\tregistry.dispatch( blockEditorStore );\n\n\t\tsetBlockEditingMode( '', 'disabled' );\n\n\t\treturn () => {\n\t\t\tunsetBlockEditingMode( '' );\n\t\t};\n\t}, [ registry ] );\n\n\tuseEffect( () => {\n\t\tconst { setBlockEditingMode, unsetBlockEditingMode } =\n\t\t\tregistry.dispatch( blockEditorStore );\n\n\t\tregistry.batch( () => {\n\t\t\tfor ( const clientId of contentOnlyIds ) {\n\t\t\t\tsetBlockEditingMode( clientId, 'contentOnly' );\n\t\t\t}\n\t\t} );\n\n\t\treturn () => {\n\t\t\tregistry.batch( () => {\n\t\t\t\tfor ( const clientId of contentOnlyIds ) {\n\t\t\t\t\tunsetBlockEditingMode( clientId );\n\t\t\t\t}\n\t\t\t} );\n\t\t};\n\t}, [ contentOnlyIds, registry ] );\n\n\tuseEffect( () => {\n\t\tconst { setBlockEditingMode, unsetBlockEditingMode } =\n\t\t\tregistry.dispatch( blockEditorStore );\n\n\t\tregistry.batch( () => {\n\t\t\tif ( ! isNavigationMode ) {\n\t\t\t\tfor ( const clientId of templateParts ) {\n\t\t\t\t\tsetBlockEditingMode( clientId, 'contentOnly' );\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\n\t\treturn () => {\n\t\t\tregistry.batch( () => {\n\t\t\t\tif ( ! isNavigationMode ) {\n\t\t\t\t\tfor ( const clientId of templateParts ) {\n\t\t\t\t\t\tunsetBlockEditingMode( clientId );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} );\n\t\t};\n\t}, [ templateParts, isNavigationMode, registry ] );\n\n\tuseEffect( () => {\n\t\tconst { setBlockEditingMode, unsetBlockEditingMode } =\n\t\t\tregistry.dispatch( blockEditorStore );\n\n\t\tregistry.batch( () => {\n\t\t\tfor ( const clientId of disabledIds ) {\n\t\t\t\tsetBlockEditingMode( clientId, 'disabled' );\n\t\t\t}\n\t\t} );\n\n\t\treturn () => {\n\t\t\tregistry.batch( () => {\n\t\t\t\tfor ( const clientId of disabledIds ) {\n\t\t\t\t\tunsetBlockEditingMode( clientId );\n\t\t\t\t}\n\t\t\t} );\n\t\t};\n\t}, [ disabledIds, registry ] );\n\n\treturn null;\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AAKA,IAAAG,qBAAA,GAAAC,sBAAA,CAAAJ,OAAA;AAVA;AACA;AACA;;AAKA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACe,SAASK,2BAA2BA,CAAA,EAAG;EACrD,MAAMC,cAAc,GAAG,IAAAC,6BAAoB,EAAC,CAAC;EAC7C,MAAM;IAAEC,aAAa;IAAEC;EAAiB,CAAC,GAAG,IAAAC,eAAS,EAAIC,MAAM,IAAM;IACpE,MAAM;MAAEC,eAAe;MAAEH,gBAAgB,EAAEI;IAAkB,CAAC,GAC7DF,MAAM,CAAEG,kBAAiB,CAAC;IAC3B,OAAO;MACNN,aAAa,EAAEI,eAAe,CAAE,oBAAqB,CAAC;MACtDH,gBAAgB,EAAEI,iBAAiB,CAAC;IACrC,CA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orProvider,
|
|
149
149
|
__unstableTemplate: template
|
|
150
150
|
}) => {
|
|
151
|
+
const hasTemplate = !!template;
|
|
151
152
|
const {
|
|
152
153
|
editorSettings,
|
|
153
154
|
selection,
|
|
@@ -157,7 +158,6 @@ const ExperimentalEditorProvider = exports.ExperimentalEditorProvider = (0, _wit
|
|
|
157
158
|
postTypeEntities,
|
|
158
159
|
hasLoadedPostObject
|
|
159
160
|
} = (0, _data.useSelect)(select => {
|
|
160
|
-
var _postTypeObject$defau;
|
|
161
161
|
const {
|
|
162
162
|
getEditorSettings,
|
|
163
163
|
getEditorSelection,
|
|
@@ -174,17 +174,11 @@ const ExperimentalEditorProvider = exports.ExperimentalEditorProvider = (0, _wit
|
|
|
174
174
|
editorSettings: getEditorSettings(),
|
|
175
175
|
isReady: __unstableIsEditorReady(),
|
|
176
176
|
mode: getRenderingMode(),
|
|
177
|
-
defaultMode:
|
|
177
|
+
defaultMode: hasTemplate && postTypeObject?.default_rendering_mode ? postTypeObject?.default_rendering_mode : 'post-only',
|
|
178
178
|
selection: getEditorSelection(),
|
|
179
179
|
postTypeEntities: post.type === 'wp_template' ? getEntitiesConfig('postType') : null
|
|
180
180
|
};
|
|
181
|
-
}, [post.type]);
|
|
182
|
-
const isZoomOut = (0, _data.useSelect)(select => {
|
|
183
|
-
const {
|
|
184
|
-
isZoomOut: _isZoomOut
|
|
185
|
-
} = (0, _lockUnlock.unlock)(select(_blockEditor.store));
|
|
186
|
-
return _isZoomOut();
|
|
187
|
-
});
|
|
181
|
+
}, [post.type, hasTemplate]);
|
|
188
182
|
const shouldRenderTemplate = !!template && mode !== 'post-only';
|
|
189
183
|
const rootLevelPost = shouldRenderTemplate ? template : post;
|
|
190
184
|
const defaultBlockContext = (0, _element.useMemo)(() => {
|
|
@@ -247,7 +241,11 @@ const ExperimentalEditorProvider = exports.ExperimentalEditorProvider = (0, _wit
|
|
|
247
241
|
}]
|
|
248
242
|
});
|
|
249
243
|
}
|
|
250
|
-
|
|
244
|
+
|
|
245
|
+
// The dependencies of the hook are omitted deliberately
|
|
246
|
+
// We only want to run setupEditor (with initialEdits) only once per post.
|
|
247
|
+
// A better solution in the future would be to split this effect into multiple ones.
|
|
248
|
+
}, []);
|
|
251
249
|
|
|
252
250
|
// Synchronizes the active post with the state
|
|
253
251
|
(0, _element.useEffect)(() => {
|
|
@@ -292,9 +290,7 @@ const ExperimentalEditorProvider = exports.ExperimentalEditorProvider = (0, _wit
|
|
|
292
290
|
settings: blockEditorSettings,
|
|
293
291
|
useSubRegistry: false,
|
|
294
292
|
children: [children, !settings.isPreviewMode && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
295
|
-
children: [
|
|
296
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(PatternsMenuItems, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_templatePartMenuItems.default, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_contentOnlySettingsMenu.default, {})]
|
|
297
|
-
}), mode === 'template-locked' && /*#__PURE__*/(0, _jsxRuntime.jsx)(_disableNonPageContentBlocks.default, {}), type === 'wp_navigation' && /*#__PURE__*/(0, _jsxRuntime.jsx)(_navigationBlockEditingMode.default, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_globalKeyboardShortcuts.default, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_keyboardShortcutHelpModal.default, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_blockRemovalWarnings.default, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_startPageOptions.default, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_startTemplateOptions.default, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_patternRenameModal.default, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_patternDuplicateModal.default, {})]
|
|
293
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(PatternsMenuItems, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_templatePartMenuItems.default, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_contentOnlySettingsMenu.default, {}), mode === 'template-locked' && /*#__PURE__*/(0, _jsxRuntime.jsx)(_disableNonPageContentBlocks.default, {}), type === 'wp_navigation' && /*#__PURE__*/(0, _jsxRuntime.jsx)(_navigationBlockEditingMode.default, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_globalKeyboardShortcuts.default, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_keyboardShortcutHelpModal.default, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_blockRemovalWarnings.default, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_startPageOptions.default, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_startTemplateOptions.default, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_patternRenameModal.default, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_patternDuplicateModal.default, {})]
|
|
298
294
|
})]
|
|
299
295
|
})
|
|
300
296
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_element","require","_data","_i18n","_coreData","_blockEditor","_notices","_patterns","_blocks","_withRegistryProvider","_interopRequireDefault","_store","_useBlockEditorSettings","_lockUnlock","_disableNonPageContentBlocks","_navigationBlockEditingMode","_useHideBlocksFromInserter","_commands","_blockRemovalWarnings","_startPageOptions","_keyboardShortcutHelpModal","_contentOnlySettingsMenu","_startTemplateOptions","_globalKeyboardShortcuts","_patternRenameModal","_patternDuplicateModal","_templatePartMenuItems","_jsxRuntime","ExperimentalBlockEditorProvider","unlock","blockEditorPrivateApis","PatternsMenuItems","editPatternsPrivateApis","noop","NON_CONTEXTUAL_POST_TYPES","useBlockEditorProps","post","template","mode","rootLevelPost","postBlocks","onInput","onChange","useEntityBlockEditor","type","id","templateBlocks","onInputTemplate","onChangeTemplate","maybeNavigationBlocks","useMemo","createBlock","ref","templateLock","blocks","disableRootLevelChanges","ExperimentalEditorProvider","exports","withRegistryProvider","settings","recovery","initialEdits","children","BlockEditorProviderComponent","__unstableTemplate","editorSettings","selection","isReady","defaultMode","postTypeEntities","hasLoadedPostObject","useSelect","select","_postTypeObject$defau","getEditorSettings","getEditorSelection","getRenderingMode","__unstableIsEditorReady","editorStore","getEntitiesConfig","coreStore","postTypeObject","getPostType","_hasLoadedPostObject","hasFinishedResolution","default_rendering_mode","isZoomOut","_isZoomOut","blockEditorStore","shouldRenderTemplate","defaultBlockContext","postContext","slug","postType","split","postTypeNames","map","entity","name","match","join","includes","postId","templateSlug","undefined","blockEditorSettings","useBlockEditorSettings","updatePostLock","setupEditor","updateEditorSettings","setCurrentTemplateId","setEditedPost","setRenderingMode","useDispatch","createWarningNotice","noticesStore","useLayoutEffect","postLock","autosave","__","actions","label","url","editLink","useEffect","useHideBlocksFromInserter","useCommands","jsx","EntityProvider","kind","BlockContextProvider","value","jsxs","useSubRegistry","isPreviewMode","Fragment","default","EditorProvider","props","BlockEditorProvider","_default"],"sources":["@wordpress/editor/src/components/provider/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect, useLayoutEffect, useMemo } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tEntityProvider,\n\tuseEntityBlockEditor,\n\tstore as coreStore,\n} from '@wordpress/core-data';\nimport {\n\tBlockEditorProvider,\n\tBlockContextProvider,\n\tprivateApis as blockEditorPrivateApis,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { privateApis as editPatternsPrivateApis } from '@wordpress/patterns';\nimport { createBlock } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport withRegistryProvider from './with-registry-provider';\nimport { store as editorStore } from '../../store';\nimport useBlockEditorSettings from './use-block-editor-settings';\nimport { unlock } from '../../lock-unlock';\nimport DisableNonPageContentBlocks from './disable-non-page-content-blocks';\nimport NavigationBlockEditingMode from './navigation-block-editing-mode';\nimport { useHideBlocksFromInserter } from './use-hide-blocks-from-inserter';\nimport useCommands from '../commands';\nimport BlockRemovalWarnings from '../block-removal-warnings';\nimport StartPageOptions from '../start-page-options';\nimport KeyboardShortcutHelpModal from '../keyboard-shortcut-help-modal';\nimport ContentOnlySettingsMenu from '../block-settings-menu/content-only-settings-menu';\nimport StartTemplateOptions from '../start-template-options';\nimport EditorKeyboardShortcuts from '../global-keyboard-shortcuts';\nimport PatternRenameModal from '../pattern-rename-modal';\nimport PatternDuplicateModal from '../pattern-duplicate-modal';\nimport TemplatePartMenuItems from '../template-part-menu-items';\n\nconst { ExperimentalBlockEditorProvider } = unlock( blockEditorPrivateApis );\nconst { PatternsMenuItems } = unlock( editPatternsPrivateApis );\n\nconst noop = () => {};\n\n/**\n * These are global entities that are only there to split blocks into logical units\n * They don't provide a \"context\" for the current post/page being rendered.\n * So we should not use their ids as post context. This is important to allow post blocks\n * (post content, post title) to be used within them without issues.\n */\nconst NON_CONTEXTUAL_POST_TYPES = [\n\t'wp_block',\n\t'wp_navigation',\n\t'wp_template_part',\n];\n\n/**\n * Depending on the post, template and template mode,\n * returns the appropriate blocks and change handlers for the block editor provider.\n *\n * @param {Array} post Block list.\n * @param {boolean} template Whether the page content has focus (and the surrounding template is inert). If `true` return page content blocks. Default `false`.\n * @param {string} mode Rendering mode.\n *\n * @example\n * ```jsx\n * const [ blocks, onInput, onChange ] = useBlockEditorProps( post, template, mode );\n * ```\n *\n * @return {Array} Block editor props.\n */\nfunction useBlockEditorProps( post, template, mode ) {\n\tconst rootLevelPost = mode === 'template-locked' ? 'template' : 'post';\n\tconst [ postBlocks, onInput, onChange ] = useEntityBlockEditor(\n\t\t'postType',\n\t\tpost.type,\n\t\t{ id: post.id }\n\t);\n\tconst [ templateBlocks, onInputTemplate, onChangeTemplate ] =\n\t\tuseEntityBlockEditor( 'postType', template?.type, {\n\t\t\tid: template?.id,\n\t\t} );\n\tconst maybeNavigationBlocks = useMemo( () => {\n\t\tif ( post.type === 'wp_navigation' ) {\n\t\t\treturn [\n\t\t\t\tcreateBlock( 'core/navigation', {\n\t\t\t\t\tref: post.id,\n\t\t\t\t\t// As the parent editor is locked with `templateLock`, the template locking\n\t\t\t\t\t// must be explicitly \"unset\" on the block itself to allow the user to modify\n\t\t\t\t\t// the block's content.\n\t\t\t\t\ttemplateLock: false,\n\t\t\t\t} ),\n\t\t\t];\n\t\t}\n\t}, [ post.type, post.id ] );\n\n\t// It is important that we don't create a new instance of blocks on every change\n\t// We should only create a new instance if the blocks them selves change, not a dependency of them.\n\tconst blocks = useMemo( () => {\n\t\tif ( maybeNavigationBlocks ) {\n\t\t\treturn maybeNavigationBlocks;\n\t\t}\n\n\t\tif ( rootLevelPost === 'template' ) {\n\t\t\treturn templateBlocks;\n\t\t}\n\n\t\treturn postBlocks;\n\t}, [ maybeNavigationBlocks, rootLevelPost, templateBlocks, postBlocks ] );\n\n\t// Handle fallback to postBlocks outside of the above useMemo, to ensure\n\t// that constructed block templates that call `createBlock` are not generated\n\t// too frequently. This ensures that clientIds are stable.\n\tconst disableRootLevelChanges =\n\t\t( !! template && mode === 'template-locked' ) ||\n\t\tpost.type === 'wp_navigation';\n\tif ( disableRootLevelChanges ) {\n\t\treturn [ blocks, noop, noop ];\n\t}\n\n\treturn [\n\t\tblocks,\n\t\trootLevelPost === 'post' ? onInput : onInputTemplate,\n\t\trootLevelPost === 'post' ? onChange : onChangeTemplate,\n\t];\n}\n\n/**\n * This component provides the editor context and manages the state of the block editor.\n *\n * @param {Object} props The component props.\n * @param {Object} props.post The post object.\n * @param {Object} props.settings The editor settings.\n * @param {boolean} props.recovery Indicates if the editor is in recovery mode.\n * @param {Array} props.initialEdits The initial edits for the editor.\n * @param {Object} props.children The child components.\n * @param {Object} [props.BlockEditorProviderComponent] The block editor provider component to use. Defaults to ExperimentalBlockEditorProvider.\n * @param {Object} [props.__unstableTemplate] The template object.\n *\n * @example\n * ```jsx\n * <ExperimentalEditorProvider\n * post={ post }\n * settings={ settings }\n * recovery={ recovery }\n * initialEdits={ initialEdits }\n * __unstableTemplate={ template }\n * >\n * { children }\n * </ExperimentalEditorProvider>\n *\n * @return {Object} The rendered ExperimentalEditorProvider component.\n */\nexport const ExperimentalEditorProvider = withRegistryProvider(\n\t( {\n\t\tpost,\n\t\tsettings,\n\t\trecovery,\n\t\tinitialEdits,\n\t\tchildren,\n\t\tBlockEditorProviderComponent = ExperimentalBlockEditorProvider,\n\t\t__unstableTemplate: template,\n\t} ) => {\n\t\tconst {\n\t\t\teditorSettings,\n\t\t\tselection,\n\t\t\tisReady,\n\t\t\tmode,\n\t\t\tdefaultMode,\n\t\t\tpostTypeEntities,\n\t\t\thasLoadedPostObject,\n\t\t} = useSelect(\n\t\t\t( select ) => {\n\t\t\t\tconst {\n\t\t\t\t\tgetEditorSettings,\n\t\t\t\t\tgetEditorSelection,\n\t\t\t\t\tgetRenderingMode,\n\t\t\t\t\t__unstableIsEditorReady,\n\t\t\t\t} = select( editorStore );\n\t\t\t\tconst { getEntitiesConfig } = select( coreStore );\n\n\t\t\t\tconst postTypeObject = select( coreStore ).getPostType(\n\t\t\t\t\tpost.type\n\t\t\t\t);\n\n\t\t\t\tconst _hasLoadedPostObject = select(\n\t\t\t\t\tcoreStore\n\t\t\t\t).hasFinishedResolution( 'getPostType', [ post.type ] );\n\n\t\t\t\treturn {\n\t\t\t\t\thasLoadedPostObject: _hasLoadedPostObject,\n\t\t\t\t\teditorSettings: getEditorSettings(),\n\t\t\t\t\tisReady: __unstableIsEditorReady(),\n\t\t\t\t\tmode: getRenderingMode(),\n\t\t\t\t\tdefaultMode:\n\t\t\t\t\t\tpostTypeObject?.default_rendering_mode ?? 'post-only',\n\t\t\t\t\tselection: getEditorSelection(),\n\t\t\t\t\tpostTypeEntities:\n\t\t\t\t\t\tpost.type === 'wp_template'\n\t\t\t\t\t\t\t? getEntitiesConfig( 'postType' )\n\t\t\t\t\t\t\t: null,\n\t\t\t\t};\n\t\t\t},\n\t\t\t[ post.type ]\n\t\t);\n\n\t\tconst isZoomOut = useSelect( ( select ) => {\n\t\t\tconst { isZoomOut: _isZoomOut } = unlock(\n\t\t\t\tselect( blockEditorStore )\n\t\t\t);\n\n\t\t\treturn _isZoomOut();\n\t\t} );\n\n\t\tconst shouldRenderTemplate = !! template && mode !== 'post-only';\n\t\tconst rootLevelPost = shouldRenderTemplate ? template : post;\n\t\tconst defaultBlockContext = useMemo( () => {\n\t\t\tconst postContext = {};\n\t\t\t// If it is a template, try to inherit the post type from the name.\n\t\t\tif ( post.type === 'wp_template' ) {\n\t\t\t\tif ( post.slug === 'page' ) {\n\t\t\t\t\tpostContext.postType = 'page';\n\t\t\t\t} else if ( post.slug === 'single' ) {\n\t\t\t\t\tpostContext.postType = 'post';\n\t\t\t\t} else if ( post.slug.split( '-' )[ 0 ] === 'single' ) {\n\t\t\t\t\t// If the slug is single-{postType}, infer the post type from the name.\n\t\t\t\t\tconst postTypeNames =\n\t\t\t\t\t\tpostTypeEntities?.map( ( entity ) => entity.name ) ||\n\t\t\t\t\t\t[];\n\t\t\t\t\tconst match = post.slug.match(\n\t\t\t\t\t\t`^single-(${ postTypeNames.join( '|' ) })(?:-.+)?$`\n\t\t\t\t\t);\n\t\t\t\t\tif ( match ) {\n\t\t\t\t\t\tpostContext.postType = match[ 1 ];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (\n\t\t\t\t! NON_CONTEXTUAL_POST_TYPES.includes( rootLevelPost.type ) ||\n\t\t\t\tshouldRenderTemplate\n\t\t\t) {\n\t\t\t\tpostContext.postId = post.id;\n\t\t\t\tpostContext.postType = post.type;\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\t...postContext,\n\t\t\t\ttemplateSlug:\n\t\t\t\t\trootLevelPost.type === 'wp_template'\n\t\t\t\t\t\t? rootLevelPost.slug\n\t\t\t\t\t\t: undefined,\n\t\t\t};\n\t\t}, [\n\t\t\tshouldRenderTemplate,\n\t\t\tpost.id,\n\t\t\tpost.type,\n\t\t\tpost.slug,\n\t\t\trootLevelPost.type,\n\t\t\trootLevelPost.slug,\n\t\t\tpostTypeEntities,\n\t\t] );\n\t\tconst { id, type } = rootLevelPost;\n\t\tconst blockEditorSettings = useBlockEditorSettings(\n\t\t\teditorSettings,\n\t\t\ttype,\n\t\t\tid,\n\t\t\tmode\n\t\t);\n\t\tconst [ blocks, onInput, onChange ] = useBlockEditorProps(\n\t\t\tpost,\n\t\t\ttemplate,\n\t\t\tmode\n\t\t);\n\n\t\tconst {\n\t\t\tupdatePostLock,\n\t\t\tsetupEditor,\n\t\t\tupdateEditorSettings,\n\t\t\tsetCurrentTemplateId,\n\t\t\tsetEditedPost,\n\t\t\tsetRenderingMode,\n\t\t} = unlock( useDispatch( editorStore ) );\n\t\tconst { createWarningNotice } = useDispatch( noticesStore );\n\n\t\t// Ideally this should be synced on each change and not just something you do once.\n\t\tuseLayoutEffect( () => {\n\t\t\t// Assume that we don't need to initialize in the case of an error recovery.\n\t\t\tif ( recovery ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tupdatePostLock( settings.postLock );\n\t\t\tsetupEditor( post, initialEdits, settings.template );\n\t\t\tif ( settings.autosave ) {\n\t\t\t\tcreateWarningNotice(\n\t\t\t\t\t__(\n\t\t\t\t\t\t'There is an autosave of this post that is more recent than the version below.'\n\t\t\t\t\t),\n\t\t\t\t\t{\n\t\t\t\t\t\tid: 'autosave-exists',\n\t\t\t\t\t\tactions: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlabel: __( 'View the autosave' ),\n\t\t\t\t\t\t\t\turl: settings.autosave.editLink,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t}\n\t\t}, [\n\t\t\tcreateWarningNotice,\n\t\t\tinitialEdits,\n\t\t\tsettings,\n\t\t\tpost,\n\t\t\trecovery,\n\t\t\tsetupEditor,\n\t\t\tupdatePostLock,\n\t\t] );\n\n\t\t// Synchronizes the active post with the state\n\t\tuseEffect( () => {\n\t\t\tsetEditedPost( post.type, post.id );\n\t\t}, [ post.type, post.id, setEditedPost ] );\n\n\t\t// Synchronize the editor settings as they change.\n\t\tuseEffect( () => {\n\t\t\tupdateEditorSettings( settings );\n\t\t}, [ settings, updateEditorSettings ] );\n\n\t\t// Synchronizes the active template with the state.\n\t\tuseEffect( () => {\n\t\t\tsetCurrentTemplateId( template?.id );\n\t\t}, [ template?.id, setCurrentTemplateId ] );\n\n\t\t// Sets the right rendering mode when loading the editor.\n\t\tuseEffect( () => {\n\t\t\tsetRenderingMode( defaultMode );\n\t\t}, [ defaultMode, setRenderingMode ] );\n\n\t\tuseHideBlocksFromInserter( post.type, mode );\n\n\t\t// Register the editor commands.\n\t\tuseCommands();\n\n\t\tif ( ! isReady || ! mode || ! hasLoadedPostObject ) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn (\n\t\t\t<EntityProvider kind=\"root\" type=\"site\">\n\t\t\t\t<EntityProvider\n\t\t\t\t\tkind=\"postType\"\n\t\t\t\t\ttype={ post.type }\n\t\t\t\t\tid={ post.id }\n\t\t\t\t>\n\t\t\t\t\t<BlockContextProvider value={ defaultBlockContext }>\n\t\t\t\t\t\t<BlockEditorProviderComponent\n\t\t\t\t\t\t\tvalue={ blocks }\n\t\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t\t\tonInput={ onInput }\n\t\t\t\t\t\t\tselection={ selection }\n\t\t\t\t\t\t\tsettings={ blockEditorSettings }\n\t\t\t\t\t\t\tuseSubRegistry={ false }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ children }\n\t\t\t\t\t\t\t{ ! settings.isPreviewMode && (\n\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t{ ! isZoomOut && (\n\t\t\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t\t\t<PatternsMenuItems />\n\t\t\t\t\t\t\t\t\t\t\t<TemplatePartMenuItems />\n\t\t\t\t\t\t\t\t\t\t\t<ContentOnlySettingsMenu />\n\t\t\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t{ mode === 'template-locked' && (\n\t\t\t\t\t\t\t\t\t\t<DisableNonPageContentBlocks />\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t{ type === 'wp_navigation' && (\n\t\t\t\t\t\t\t\t\t\t<NavigationBlockEditingMode />\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t<EditorKeyboardShortcuts />\n\t\t\t\t\t\t\t\t\t<KeyboardShortcutHelpModal />\n\t\t\t\t\t\t\t\t\t<BlockRemovalWarnings />\n\t\t\t\t\t\t\t\t\t<StartPageOptions />\n\t\t\t\t\t\t\t\t\t<StartTemplateOptions />\n\t\t\t\t\t\t\t\t\t<PatternRenameModal />\n\t\t\t\t\t\t\t\t\t<PatternDuplicateModal />\n\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</BlockEditorProviderComponent>\n\t\t\t\t\t</BlockContextProvider>\n\t\t\t\t</EntityProvider>\n\t\t\t</EntityProvider>\n\t\t);\n\t}\n);\n\n/**\n * This component establishes a new post editing context, and serves as the entry point for a new post editor (or post with template editor).\n *\n * It supports a large number of post types, including post, page, templates,\n * custom post types, patterns, template parts.\n *\n * All modification and changes are performed to the `@wordpress/core-data` store.\n *\n * @param {Object} props The component props.\n * @param {Object} [props.post] The post object to edit. This is required.\n * @param {Object} [props.__unstableTemplate] The template object wrapper the edited post.\n * This is optional and can only be used when the post type supports templates (like posts and pages).\n * @param {Object} [props.settings] The settings object to use for the editor.\n * This is optional and can be used to override the default settings.\n * @param {Element} [props.children] Children elements for which the BlockEditorProvider context should apply.\n * This is optional.\n *\n * @example\n * ```jsx\n * <EditorProvider\n * post={ post }\n * settings={ settings }\n * __unstableTemplate={ template }\n * >\n * { children }\n * </EditorProvider>\n * ```\n *\n * @return {React.ReactNode} The rendered EditorProvider component.\n */\nexport function EditorProvider( props ) {\n\treturn (\n\t\t<ExperimentalEditorProvider\n\t\t\t{ ...props }\n\t\t\tBlockEditorProviderComponent={ BlockEditorProvider }\n\t\t>\n\t\t\t{ props.children }\n\t\t</ExperimentalEditorProvider>\n\t);\n}\n\nexport default EditorProvider;\n"],"mappings":";;;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AAKA,IAAAI,YAAA,GAAAJ,OAAA;AAMA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,SAAA,GAAAN,OAAA;AACA,IAAAO,OAAA,GAAAP,OAAA;AAKA,IAAAQ,qBAAA,GAAAC,sBAAA,CAAAT,OAAA;AACA,IAAAU,MAAA,GAAAV,OAAA;AACA,IAAAW,uBAAA,GAAAF,sBAAA,CAAAT,OAAA;AACA,IAAAY,WAAA,GAAAZ,OAAA;AACA,IAAAa,4BAAA,GAAAJ,sBAAA,CAAAT,OAAA;AACA,IAAAc,2BAAA,GAAAL,sBAAA,CAAAT,OAAA;AACA,IAAAe,0BAAA,GAAAf,OAAA;AACA,IAAAgB,SAAA,GAAAP,sBAAA,CAAAT,OAAA;AACA,IAAAiB,qBAAA,GAAAR,sBAAA,CAAAT,OAAA;AACA,IAAAkB,iBAAA,GAAAT,sBAAA,CAAAT,OAAA;AACA,IAAAmB,0BAAA,GAAAV,sBAAA,CAAAT,OAAA;AACA,IAAAoB,wBAAA,GAAAX,sBAAA,CAAAT,OAAA;AACA,IAAAqB,qBAAA,GAAAZ,sBAAA,CAAAT,OAAA;AACA,IAAAsB,wBAAA,GAAAb,sBAAA,CAAAT,OAAA;AACA,IAAAuB,mBAAA,GAAAd,sBAAA,CAAAT,OAAA;AACA,IAAAwB,sBAAA,GAAAf,sBAAA,CAAAT,OAAA;AACA,IAAAyB,sBAAA,GAAAhB,sBAAA,CAAAT,OAAA;AAAgE,IAAA0B,WAAA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,IAAA7G,WAAA,CAAAoG,GAAA,EAACzG,qBAAA,CAAAkH,OAAoB,IAAE,CAAC,eACxB,IAAA7G,WAAA,CAAAoG,GAAA,EAACvG,mBAAA,CAAAgH,OAAkB,IAAE,CAAC,eACtB,IAAA7G,WAAA,CAAAoG,GAAA,EAACtG,sBAAA,CAAA+G,OAAqB,IAAE,CAAC;UAAA,CACxB,CACF;QAAA,CAC4B;MAAC,CACV;IAAC,CACR;EAAC,CACF,CAAC;AAEnB,CACD,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,cAAcA,CAAEC,KAAK,EAAG;EACvC,oBACC,IAAA/G,WAAA,CAAAoG,GAAA,EAACvE,0BAA0B;IAAA,GACrBkF,KAAK;IACV3E,4BAA4B,EAAG4E,gCAAqB;IAAA7E,QAAA,EAElD4E,KAAK,CAAC5E;EAAQ,CACW,CAAC;AAE/B;AAAC,IAAA8E,QAAA,GAAAnF,OAAA,CAAA+E,OAAA,GAEcC,cAAc","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_element","require","_data","_i18n","_coreData","_blockEditor","_notices","_patterns","_blocks","_withRegistryProvider","_interopRequireDefault","_store","_useBlockEditorSettings","_lockUnlock","_disableNonPageContentBlocks","_navigationBlockEditingMode","_useHideBlocksFromInserter","_commands","_blockRemovalWarnings","_startPageOptions","_keyboardShortcutHelpModal","_contentOnlySettingsMenu","_startTemplateOptions","_globalKeyboardShortcuts","_patternRenameModal","_patternDuplicateModal","_templatePartMenuItems","_jsxRuntime","ExperimentalBlockEditorProvider","unlock","blockEditorPrivateApis","PatternsMenuItems","editPatternsPrivateApis","noop","NON_CONTEXTUAL_POST_TYPES","useBlockEditorProps","post","template","mode","rootLevelPost","postBlocks","onInput","onChange","useEntityBlockEditor","type","id","templateBlocks","onInputTemplate","onChangeTemplate","maybeNavigationBlocks","useMemo","createBlock","ref","templateLock","blocks","disableRootLevelChanges","ExperimentalEditorProvider","exports","withRegistryProvider","settings","recovery","initialEdits","children","BlockEditorProviderComponent","__unstableTemplate","hasTemplate","editorSettings","selection","isReady","defaultMode","postTypeEntities","hasLoadedPostObject","useSelect","select","getEditorSettings","getEditorSelection","getRenderingMode","__unstableIsEditorReady","editorStore","getEntitiesConfig","coreStore","postTypeObject","getPostType","_hasLoadedPostObject","hasFinishedResolution","default_rendering_mode","shouldRenderTemplate","defaultBlockContext","postContext","slug","postType","split","postTypeNames","map","entity","name","match","join","includes","postId","templateSlug","undefined","blockEditorSettings","useBlockEditorSettings","updatePostLock","setupEditor","updateEditorSettings","setCurrentTemplateId","setEditedPost","setRenderingMode","useDispatch","createWarningNotice","noticesStore","useLayoutEffect","postLock","autosave","__","actions","label","url","editLink","useEffect","useHideBlocksFromInserter","useCommands","jsx","EntityProvider","kind","BlockContextProvider","value","jsxs","useSubRegistry","isPreviewMode","Fragment","default","EditorProvider","props","BlockEditorProvider","_default"],"sources":["@wordpress/editor/src/components/provider/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect, useLayoutEffect, useMemo } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tEntityProvider,\n\tuseEntityBlockEditor,\n\tstore as coreStore,\n} from '@wordpress/core-data';\nimport {\n\tBlockEditorProvider,\n\tBlockContextProvider,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { privateApis as editPatternsPrivateApis } from '@wordpress/patterns';\nimport { createBlock } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport withRegistryProvider from './with-registry-provider';\nimport { store as editorStore } from '../../store';\nimport useBlockEditorSettings from './use-block-editor-settings';\nimport { unlock } from '../../lock-unlock';\nimport DisableNonPageContentBlocks from './disable-non-page-content-blocks';\nimport NavigationBlockEditingMode from './navigation-block-editing-mode';\nimport { useHideBlocksFromInserter } from './use-hide-blocks-from-inserter';\nimport useCommands from '../commands';\nimport BlockRemovalWarnings from '../block-removal-warnings';\nimport StartPageOptions from '../start-page-options';\nimport KeyboardShortcutHelpModal from '../keyboard-shortcut-help-modal';\nimport ContentOnlySettingsMenu from '../block-settings-menu/content-only-settings-menu';\nimport StartTemplateOptions from '../start-template-options';\nimport EditorKeyboardShortcuts from '../global-keyboard-shortcuts';\nimport PatternRenameModal from '../pattern-rename-modal';\nimport PatternDuplicateModal from '../pattern-duplicate-modal';\nimport TemplatePartMenuItems from '../template-part-menu-items';\n\nconst { ExperimentalBlockEditorProvider } = unlock( blockEditorPrivateApis );\nconst { PatternsMenuItems } = unlock( editPatternsPrivateApis );\n\nconst noop = () => {};\n\n/**\n * These are global entities that are only there to split blocks into logical units\n * They don't provide a \"context\" for the current post/page being rendered.\n * So we should not use their ids as post context. This is important to allow post blocks\n * (post content, post title) to be used within them without issues.\n */\nconst NON_CONTEXTUAL_POST_TYPES = [\n\t'wp_block',\n\t'wp_navigation',\n\t'wp_template_part',\n];\n\n/**\n * Depending on the post, template and template mode,\n * returns the appropriate blocks and change handlers for the block editor provider.\n *\n * @param {Array} post Block list.\n * @param {boolean} template Whether the page content has focus (and the surrounding template is inert). If `true` return page content blocks. Default `false`.\n * @param {string} mode Rendering mode.\n *\n * @example\n * ```jsx\n * const [ blocks, onInput, onChange ] = useBlockEditorProps( post, template, mode );\n * ```\n *\n * @return {Array} Block editor props.\n */\nfunction useBlockEditorProps( post, template, mode ) {\n\tconst rootLevelPost = mode === 'template-locked' ? 'template' : 'post';\n\tconst [ postBlocks, onInput, onChange ] = useEntityBlockEditor(\n\t\t'postType',\n\t\tpost.type,\n\t\t{ id: post.id }\n\t);\n\tconst [ templateBlocks, onInputTemplate, onChangeTemplate ] =\n\t\tuseEntityBlockEditor( 'postType', template?.type, {\n\t\t\tid: template?.id,\n\t\t} );\n\tconst maybeNavigationBlocks = useMemo( () => {\n\t\tif ( post.type === 'wp_navigation' ) {\n\t\t\treturn [\n\t\t\t\tcreateBlock( 'core/navigation', {\n\t\t\t\t\tref: post.id,\n\t\t\t\t\t// As the parent editor is locked with `templateLock`, the template locking\n\t\t\t\t\t// must be explicitly \"unset\" on the block itself to allow the user to modify\n\t\t\t\t\t// the block's content.\n\t\t\t\t\ttemplateLock: false,\n\t\t\t\t} ),\n\t\t\t];\n\t\t}\n\t}, [ post.type, post.id ] );\n\n\t// It is important that we don't create a new instance of blocks on every change\n\t// We should only create a new instance if the blocks them selves change, not a dependency of them.\n\tconst blocks = useMemo( () => {\n\t\tif ( maybeNavigationBlocks ) {\n\t\t\treturn maybeNavigationBlocks;\n\t\t}\n\n\t\tif ( rootLevelPost === 'template' ) {\n\t\t\treturn templateBlocks;\n\t\t}\n\n\t\treturn postBlocks;\n\t}, [ maybeNavigationBlocks, rootLevelPost, templateBlocks, postBlocks ] );\n\n\t// Handle fallback to postBlocks outside of the above useMemo, to ensure\n\t// that constructed block templates that call `createBlock` are not generated\n\t// too frequently. This ensures that clientIds are stable.\n\tconst disableRootLevelChanges =\n\t\t( !! template && mode === 'template-locked' ) ||\n\t\tpost.type === 'wp_navigation';\n\tif ( disableRootLevelChanges ) {\n\t\treturn [ blocks, noop, noop ];\n\t}\n\n\treturn [\n\t\tblocks,\n\t\trootLevelPost === 'post' ? onInput : onInputTemplate,\n\t\trootLevelPost === 'post' ? onChange : onChangeTemplate,\n\t];\n}\n\n/**\n * This component provides the editor context and manages the state of the block editor.\n *\n * @param {Object} props The component props.\n * @param {Object} props.post The post object.\n * @param {Object} props.settings The editor settings.\n * @param {boolean} props.recovery Indicates if the editor is in recovery mode.\n * @param {Array} props.initialEdits The initial edits for the editor.\n * @param {Object} props.children The child components.\n * @param {Object} [props.BlockEditorProviderComponent] The block editor provider component to use. Defaults to ExperimentalBlockEditorProvider.\n * @param {Object} [props.__unstableTemplate] The template object.\n *\n * @example\n * ```jsx\n * <ExperimentalEditorProvider\n * post={ post }\n * settings={ settings }\n * recovery={ recovery }\n * initialEdits={ initialEdits }\n * __unstableTemplate={ template }\n * >\n * { children }\n * </ExperimentalEditorProvider>\n *\n * @return {Object} The rendered ExperimentalEditorProvider component.\n */\nexport const ExperimentalEditorProvider = withRegistryProvider(\n\t( {\n\t\tpost,\n\t\tsettings,\n\t\trecovery,\n\t\tinitialEdits,\n\t\tchildren,\n\t\tBlockEditorProviderComponent = ExperimentalBlockEditorProvider,\n\t\t__unstableTemplate: template,\n\t} ) => {\n\t\tconst hasTemplate = !! template;\n\t\tconst {\n\t\t\teditorSettings,\n\t\t\tselection,\n\t\t\tisReady,\n\t\t\tmode,\n\t\t\tdefaultMode,\n\t\t\tpostTypeEntities,\n\t\t\thasLoadedPostObject,\n\t\t} = useSelect(\n\t\t\t( select ) => {\n\t\t\t\tconst {\n\t\t\t\t\tgetEditorSettings,\n\t\t\t\t\tgetEditorSelection,\n\t\t\t\t\tgetRenderingMode,\n\t\t\t\t\t__unstableIsEditorReady,\n\t\t\t\t} = select( editorStore );\n\t\t\t\tconst { getEntitiesConfig } = select( coreStore );\n\n\t\t\t\tconst postTypeObject = select( coreStore ).getPostType(\n\t\t\t\t\tpost.type\n\t\t\t\t);\n\n\t\t\t\tconst _hasLoadedPostObject = select(\n\t\t\t\t\tcoreStore\n\t\t\t\t).hasFinishedResolution( 'getPostType', [ post.type ] );\n\n\t\t\t\treturn {\n\t\t\t\t\thasLoadedPostObject: _hasLoadedPostObject,\n\t\t\t\t\teditorSettings: getEditorSettings(),\n\t\t\t\t\tisReady: __unstableIsEditorReady(),\n\t\t\t\t\tmode: getRenderingMode(),\n\t\t\t\t\tdefaultMode:\n\t\t\t\t\t\thasTemplate && postTypeObject?.default_rendering_mode\n\t\t\t\t\t\t\t? postTypeObject?.default_rendering_mode\n\t\t\t\t\t\t\t: 'post-only',\n\t\t\t\t\tselection: getEditorSelection(),\n\t\t\t\t\tpostTypeEntities:\n\t\t\t\t\t\tpost.type === 'wp_template'\n\t\t\t\t\t\t\t? getEntitiesConfig( 'postType' )\n\t\t\t\t\t\t\t: null,\n\t\t\t\t};\n\t\t\t},\n\t\t\t[ post.type, hasTemplate ]\n\t\t);\n\n\t\tconst shouldRenderTemplate = !! template && mode !== 'post-only';\n\t\tconst rootLevelPost = shouldRenderTemplate ? template : post;\n\t\tconst defaultBlockContext = useMemo( () => {\n\t\t\tconst postContext = {};\n\t\t\t// If it is a template, try to inherit the post type from the name.\n\t\t\tif ( post.type === 'wp_template' ) {\n\t\t\t\tif ( post.slug === 'page' ) {\n\t\t\t\t\tpostContext.postType = 'page';\n\t\t\t\t} else if ( post.slug === 'single' ) {\n\t\t\t\t\tpostContext.postType = 'post';\n\t\t\t\t} else if ( post.slug.split( '-' )[ 0 ] === 'single' ) {\n\t\t\t\t\t// If the slug is single-{postType}, infer the post type from the name.\n\t\t\t\t\tconst postTypeNames =\n\t\t\t\t\t\tpostTypeEntities?.map( ( entity ) => entity.name ) ||\n\t\t\t\t\t\t[];\n\t\t\t\t\tconst match = post.slug.match(\n\t\t\t\t\t\t`^single-(${ postTypeNames.join( '|' ) })(?:-.+)?$`\n\t\t\t\t\t);\n\t\t\t\t\tif ( match ) {\n\t\t\t\t\t\tpostContext.postType = match[ 1 ];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (\n\t\t\t\t! NON_CONTEXTUAL_POST_TYPES.includes( rootLevelPost.type ) ||\n\t\t\t\tshouldRenderTemplate\n\t\t\t) {\n\t\t\t\tpostContext.postId = post.id;\n\t\t\t\tpostContext.postType = post.type;\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\t...postContext,\n\t\t\t\ttemplateSlug:\n\t\t\t\t\trootLevelPost.type === 'wp_template'\n\t\t\t\t\t\t? rootLevelPost.slug\n\t\t\t\t\t\t: undefined,\n\t\t\t};\n\t\t}, [\n\t\t\tshouldRenderTemplate,\n\t\t\tpost.id,\n\t\t\tpost.type,\n\t\t\tpost.slug,\n\t\t\trootLevelPost.type,\n\t\t\trootLevelPost.slug,\n\t\t\tpostTypeEntities,\n\t\t] );\n\t\tconst { id, type } = rootLevelPost;\n\t\tconst blockEditorSettings = useBlockEditorSettings(\n\t\t\teditorSettings,\n\t\t\ttype,\n\t\t\tid,\n\t\t\tmode\n\t\t);\n\t\tconst [ blocks, onInput, onChange ] = useBlockEditorProps(\n\t\t\tpost,\n\t\t\ttemplate,\n\t\t\tmode\n\t\t);\n\n\t\tconst {\n\t\t\tupdatePostLock,\n\t\t\tsetupEditor,\n\t\t\tupdateEditorSettings,\n\t\t\tsetCurrentTemplateId,\n\t\t\tsetEditedPost,\n\t\t\tsetRenderingMode,\n\t\t} = unlock( useDispatch( editorStore ) );\n\t\tconst { createWarningNotice } = useDispatch( noticesStore );\n\n\t\t// Ideally this should be synced on each change and not just something you do once.\n\t\tuseLayoutEffect( () => {\n\t\t\t// Assume that we don't need to initialize in the case of an error recovery.\n\t\t\tif ( recovery ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tupdatePostLock( settings.postLock );\n\t\t\tsetupEditor( post, initialEdits, settings.template );\n\t\t\tif ( settings.autosave ) {\n\t\t\t\tcreateWarningNotice(\n\t\t\t\t\t__(\n\t\t\t\t\t\t'There is an autosave of this post that is more recent than the version below.'\n\t\t\t\t\t),\n\t\t\t\t\t{\n\t\t\t\t\t\tid: 'autosave-exists',\n\t\t\t\t\t\tactions: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlabel: __( 'View the autosave' ),\n\t\t\t\t\t\t\t\turl: settings.autosave.editLink,\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\n\t\t\t// The dependencies of the hook are omitted deliberately\n\t\t\t// We only want to run setupEditor (with initialEdits) only once per post.\n\t\t\t// A better solution in the future would be to split this effect into multiple ones.\n\t\t}, [] );\n\n\t\t// Synchronizes the active post with the state\n\t\tuseEffect( () => {\n\t\t\tsetEditedPost( post.type, post.id );\n\t\t}, [ post.type, post.id, setEditedPost ] );\n\n\t\t// Synchronize the editor settings as they change.\n\t\tuseEffect( () => {\n\t\t\tupdateEditorSettings( settings );\n\t\t}, [ settings, updateEditorSettings ] );\n\n\t\t// Synchronizes the active template with the state.\n\t\tuseEffect( () => {\n\t\t\tsetCurrentTemplateId( template?.id );\n\t\t}, [ template?.id, setCurrentTemplateId ] );\n\n\t\t// Sets the right rendering mode when loading the editor.\n\t\tuseEffect( () => {\n\t\t\tsetRenderingMode( defaultMode );\n\t\t}, [ defaultMode, setRenderingMode ] );\n\n\t\tuseHideBlocksFromInserter( post.type, mode );\n\n\t\t// Register the editor commands.\n\t\tuseCommands();\n\n\t\tif ( ! isReady || ! mode || ! hasLoadedPostObject ) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn (\n\t\t\t<EntityProvider kind=\"root\" type=\"site\">\n\t\t\t\t<EntityProvider\n\t\t\t\t\tkind=\"postType\"\n\t\t\t\t\ttype={ post.type }\n\t\t\t\t\tid={ post.id }\n\t\t\t\t>\n\t\t\t\t\t<BlockContextProvider value={ defaultBlockContext }>\n\t\t\t\t\t\t<BlockEditorProviderComponent\n\t\t\t\t\t\t\tvalue={ blocks }\n\t\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t\t\tonInput={ onInput }\n\t\t\t\t\t\t\tselection={ selection }\n\t\t\t\t\t\t\tsettings={ blockEditorSettings }\n\t\t\t\t\t\t\tuseSubRegistry={ false }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ children }\n\t\t\t\t\t\t\t{ ! settings.isPreviewMode && (\n\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t<PatternsMenuItems />\n\t\t\t\t\t\t\t\t\t<TemplatePartMenuItems />\n\t\t\t\t\t\t\t\t\t<ContentOnlySettingsMenu />\n\t\t\t\t\t\t\t\t\t{ mode === 'template-locked' && (\n\t\t\t\t\t\t\t\t\t\t<DisableNonPageContentBlocks />\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t{ type === 'wp_navigation' && (\n\t\t\t\t\t\t\t\t\t\t<NavigationBlockEditingMode />\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t<EditorKeyboardShortcuts />\n\t\t\t\t\t\t\t\t\t<KeyboardShortcutHelpModal />\n\t\t\t\t\t\t\t\t\t<BlockRemovalWarnings />\n\t\t\t\t\t\t\t\t\t<StartPageOptions />\n\t\t\t\t\t\t\t\t\t<StartTemplateOptions />\n\t\t\t\t\t\t\t\t\t<PatternRenameModal />\n\t\t\t\t\t\t\t\t\t<PatternDuplicateModal />\n\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</BlockEditorProviderComponent>\n\t\t\t\t\t</BlockContextProvider>\n\t\t\t\t</EntityProvider>\n\t\t\t</EntityProvider>\n\t\t);\n\t}\n);\n\n/**\n * This component establishes a new post editing context, and serves as the entry point for a new post editor (or post with template editor).\n *\n * It supports a large number of post types, including post, page, templates,\n * custom post types, patterns, template parts.\n *\n * All modification and changes are performed to the `@wordpress/core-data` store.\n *\n * @param {Object} props The component props.\n * @param {Object} [props.post] The post object to edit. This is required.\n * @param {Object} [props.__unstableTemplate] The template object wrapper the edited post.\n * This is optional and can only be used when the post type supports templates (like posts and pages).\n * @param {Object} [props.settings] The settings object to use for the editor.\n * This is optional and can be used to override the default settings.\n * @param {Element} [props.children] Children elements for which the BlockEditorProvider context should apply.\n * This is optional.\n *\n * @example\n * ```jsx\n * <EditorProvider\n * post={ post }\n * settings={ settings }\n * __unstableTemplate={ template }\n * >\n * { children }\n * </EditorProvider>\n * ```\n *\n * @return {React.ReactNode} The rendered EditorProvider component.\n */\nexport function EditorProvider( props ) {\n\treturn (\n\t\t<ExperimentalEditorProvider\n\t\t\t{ ...props }\n\t\t\tBlockEditorProviderComponent={ BlockEditorProvider }\n\t\t>\n\t\t\t{ props.children }\n\t\t</ExperimentalEditorProvider>\n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AA,CAAAiG,GAAA,EAACpE,0BAA0B;IAAA,GACrB+E,KAAK;IACVxE,4BAA4B,EAAGyE,gCAAqB;IAAA1E,QAAA,EAElDyE,KAAK,CAACzE;EAAQ,CACW,CAAC;AAE/B;AAAC,IAAA2E,QAAA,GAAAhF,OAAA,CAAA4E,OAAA,GAEcC,cAAc","ignoreList":[]}
|
|
@@ -16,6 +16,7 @@ var _blocks = require("@wordpress/blocks");
|
|
|
16
16
|
var _blockEditor = require("@wordpress/block-editor");
|
|
17
17
|
var _mediaCategories = _interopRequireDefault(require("../media-categories"));
|
|
18
18
|
var _utils = require("../../utils");
|
|
19
|
+
var _mediaSideload = _interopRequireDefault(require("../../utils/media-sideload"));
|
|
19
20
|
var _store = require("../../store");
|
|
20
21
|
var _lockUnlock = require("../../lock-unlock");
|
|
21
22
|
var _globalStylesProvider = require("../global-styles-provider");
|
|
@@ -40,7 +41,7 @@ function __experimentalReusableBlocksSelect(select) {
|
|
|
40
41
|
[RECEIVE_INTERMEDIATE_RESULTS]: true
|
|
41
42
|
});
|
|
42
43
|
}
|
|
43
|
-
const BLOCK_EDITOR_SETTINGS = ['__experimentalBlockDirectory', '__experimentalDiscussionSettings', '__experimentalFeatures', '__experimentalGlobalStylesBaseStyles', 'alignWide', 'blockInspectorTabs', 'allowedMimeTypes', 'bodyPlaceholder', 'canLockBlocks', 'canUpdateBlockBindings', 'capabilities', 'clearBlockSelection', 'codeEditingEnabled', 'colors', 'disableCustomColors', 'disableCustomFontSizes', 'disableCustomSpacingSizes', 'disableCustomGradients', 'disableLayoutStyles', 'enableCustomLineHeight', 'enableCustomSpacing', 'enableCustomUnits', 'enableOpenverseMediaCategory', 'fontSizes', 'gradients', 'generateAnchors', 'onNavigateToEntityRecord', 'imageDefaultSize', 'imageDimensions', 'imageEditing', 'imageSizes', 'isPreviewMode', 'isRTL', 'locale', 'maxWidth', 'postContentAttributes', 'postsPerPage', 'readOnly', 'styles', 'titlePlaceholder', 'supportsLayout', 'widgetTypesToHideFromLegacyWidgetBlock', '__unstableHasCustomAppender', '__unstableResolvedAssets', '__unstableIsBlockBasedTheme'];
|
|
44
|
+
const BLOCK_EDITOR_SETTINGS = ['__experimentalBlockDirectory', '__experimentalDiscussionSettings', '__experimentalFeatures', '__experimentalGlobalStylesBaseStyles', 'alignWide', 'blockInspectorTabs', 'maxUploadFileSize', 'allowedMimeTypes', 'bodyPlaceholder', 'canLockBlocks', 'canUpdateBlockBindings', 'capabilities', 'clearBlockSelection', 'codeEditingEnabled', 'colors', 'disableCustomColors', 'disableCustomFontSizes', 'disableCustomSpacingSizes', 'disableCustomGradients', 'disableLayoutStyles', 'enableCustomLineHeight', 'enableCustomSpacing', 'enableCustomUnits', 'enableOpenverseMediaCategory', 'fontSizes', 'gradients', 'generateAnchors', 'onNavigateToEntityRecord', 'imageDefaultSize', 'imageDimensions', 'imageEditing', 'imageSizes', 'isPreviewMode', 'isRTL', 'locale', 'maxWidth', 'postContentAttributes', 'postsPerPage', 'readOnly', 'styles', 'titlePlaceholder', 'supportsLayout', 'widgetTypesToHideFromLegacyWidgetBlock', '__unstableHasCustomAppender', '__unstableResolvedAssets', '__unstableIsBlockBasedTheme'];
|
|
44
45
|
const {
|
|
45
46
|
globalStylesDataKey,
|
|
46
47
|
globalStylesLinksDataKey,
|
|
@@ -200,6 +201,7 @@ function useBlockEditorSettings(settings, postType, postId, renderingMode) {
|
|
|
200
201
|
isDistractionFree,
|
|
201
202
|
keepCaretInsideBlock,
|
|
202
203
|
mediaUpload: hasUploadPermissions ? _utils.mediaUpload : undefined,
|
|
204
|
+
mediaSideload: hasUploadPermissions ? _mediaSideload.default : undefined,
|
|
203
205
|
__experimentalBlockPatterns: blockPatterns,
|
|
204
206
|
[selectBlockPatternsKey]: select => {
|
|
205
207
|
const {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_element","require","_data","_coreData","_i18n","_preferences","_compose","_blocks","_blockEditor","_mediaCategories","_interopRequireDefault","_utils","_store","_lockUnlock","_globalStylesProvider","EMPTY_OBJECT","__experimentalReusableBlocksSelect","select","RECEIVE_INTERMEDIATE_RESULTS","unlock","coreDataPrivateApis","getEntityRecords","coreStore","per_page","BLOCK_EDITOR_SETTINGS","globalStylesDataKey","globalStylesLinksDataKey","selectBlockPatternsKey","reusableBlocksSelectKey","sectionRootClientIdKey","privateApis","useBlockEditorSettings","settings","postType","postId","renderingMode","_mergedGlobalStyles$s","_mergedGlobalStyles$_","_settings$__experimen","_settings$__experimen2","isLargeViewport","useViewportMatch","allowRightClickOverrides","blockTypes","focusMode","hasFixedToolbar","isDistractionFree","keepCaretInsideBlock","hasUploadPermissions","hiddenBlockTypes","canUseUnfilteredHTML","userCanCreatePages","pageOnFront","pageForPosts","userPatternCategories","restBlockPatternCategories","sectionRootClientId","useSelect","_canUser","canUser","getRawEntityRecord","getEntityRecord","getUserPatternCategories","getBlockPatternCategories","get","preferencesStore","getBlockTypes","blocksStore","getBlocksByName","getBlockAttributes","blockEditorStore","siteSettings","kind","name","undefined","getSectionRootBlock","_getBlocksByName$find","_getBlocksByName$","find","clientId","tagName","_links","hasOwnProperty","page_on_front","page_for_posts","merged","mergedGlobalStyles","useGlobalStylesContext","globalStylesData","styles","globalStylesLinksData","settingsBlockPatterns","__experimentalAdditionalBlockPatterns","__experimentalBlockPatterns","settingsBlockPatternCategories","__experimentalAdditionalBlockPatternCategories","__experimentalBlockPatternCategories","blockPatterns","useMemo","filter","postTypes","Array","isArray","includes","blockPatternCategories","x","index","arr","findIndex","y","undo","setIsInserterOpened","useDispatch","editorStore","saveEntityRecord","createPageEntity","useCallback","options","Promise","reject","message","__","allowedBlockTypes","length","defaultAllowedBlockTypes","map","type","forceDisableFocusMode","blockEditorSettings","Object","fromEntries","entries","key","mediaUpload","hasFinishedResolution","getBlockPatternsForPostType","patterns","__experimentalUserPatternCategories","__experimentalFetchLinkSuggestions","search","searchOptions","fetchLinkSuggestions","inserterMediaCategories","__experimentalFetchRichUrlData","fetchUrlData","__experimentalCanUserUseUnfilteredHTML","__experimentalUndo","outlineMode","__experimentalCreatePageEntity","__experimentalUserCanCreatePages","__experimentalPreferPatternsOnRoot","templateLock","template","__experimentalSetIsInserterOpened","editorTool","_default","exports","default"],"sources":["@wordpress/editor/src/components/provider/use-block-editor-settings.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo, useCallback } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport {\n\tstore as coreStore,\n\t__experimentalFetchLinkSuggestions as fetchLinkSuggestions,\n\t__experimentalFetchUrlData as fetchUrlData,\n\tprivateApis as coreDataPrivateApis,\n} from '@wordpress/core-data';\nimport { __ } from '@wordpress/i18n';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { store as blocksStore } from '@wordpress/blocks';\nimport {\n\tprivateApis,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport inserterMediaCategories from '../media-categories';\nimport { mediaUpload } from '../../utils';\nimport { store as editorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\nimport { useGlobalStylesContext } from '../global-styles-provider';\n\nconst EMPTY_OBJECT = {};\n\nfunction __experimentalReusableBlocksSelect( select ) {\n\tconst { RECEIVE_INTERMEDIATE_RESULTS } = unlock( coreDataPrivateApis );\n\tconst { getEntityRecords } = select( coreStore );\n\treturn getEntityRecords( 'postType', 'wp_block', {\n\t\tper_page: -1,\n\t\t[ RECEIVE_INTERMEDIATE_RESULTS ]: true,\n\t} );\n}\n\nconst BLOCK_EDITOR_SETTINGS = [\n\t'__experimentalBlockDirectory',\n\t'__experimentalDiscussionSettings',\n\t'__experimentalFeatures',\n\t'__experimentalGlobalStylesBaseStyles',\n\t'alignWide',\n\t'blockInspectorTabs',\n\t'allowedMimeTypes',\n\t'bodyPlaceholder',\n\t'canLockBlocks',\n\t'canUpdateBlockBindings',\n\t'capabilities',\n\t'clearBlockSelection',\n\t'codeEditingEnabled',\n\t'colors',\n\t'disableCustomColors',\n\t'disableCustomFontSizes',\n\t'disableCustomSpacingSizes',\n\t'disableCustomGradients',\n\t'disableLayoutStyles',\n\t'enableCustomLineHeight',\n\t'enableCustomSpacing',\n\t'enableCustomUnits',\n\t'enableOpenverseMediaCategory',\n\t'fontSizes',\n\t'gradients',\n\t'generateAnchors',\n\t'onNavigateToEntityRecord',\n\t'imageDefaultSize',\n\t'imageDimensions',\n\t'imageEditing',\n\t'imageSizes',\n\t'isPreviewMode',\n\t'isRTL',\n\t'locale',\n\t'maxWidth',\n\t'postContentAttributes',\n\t'postsPerPage',\n\t'readOnly',\n\t'styles',\n\t'titlePlaceholder',\n\t'supportsLayout',\n\t'widgetTypesToHideFromLegacyWidgetBlock',\n\t'__unstableHasCustomAppender',\n\t'__unstableResolvedAssets',\n\t'__unstableIsBlockBasedTheme',\n];\n\nconst {\n\tglobalStylesDataKey,\n\tglobalStylesLinksDataKey,\n\tselectBlockPatternsKey,\n\treusableBlocksSelectKey,\n\tsectionRootClientIdKey,\n} = unlock( privateApis );\n\n/**\n * React hook used to compute the block editor settings to use for the post editor.\n *\n * @param {Object} settings EditorProvider settings prop.\n * @param {string} postType Editor root level post type.\n * @param {string} postId Editor root level post ID.\n * @param {string} renderingMode Editor rendering mode.\n *\n * @return {Object} Block Editor Settings.\n */\nfunction useBlockEditorSettings( settings, postType, postId, renderingMode ) {\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst {\n\t\tallowRightClickOverrides,\n\t\tblockTypes,\n\t\tfocusMode,\n\t\thasFixedToolbar,\n\t\tisDistractionFree,\n\t\tkeepCaretInsideBlock,\n\t\thasUploadPermissions,\n\t\thiddenBlockTypes,\n\t\tcanUseUnfilteredHTML,\n\t\tuserCanCreatePages,\n\t\tpageOnFront,\n\t\tpageForPosts,\n\t\tuserPatternCategories,\n\t\trestBlockPatternCategories,\n\t\tsectionRootClientId,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tcanUser,\n\t\t\t\tgetRawEntityRecord,\n\t\t\t\tgetEntityRecord,\n\t\t\t\tgetUserPatternCategories,\n\t\t\t\tgetBlockPatternCategories,\n\t\t\t} = select( coreStore );\n\t\t\tconst { get } = select( preferencesStore );\n\t\t\tconst { getBlockTypes } = select( blocksStore );\n\t\t\tconst { getBlocksByName, getBlockAttributes } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\tconst siteSettings = canUser( 'read', {\n\t\t\t\tkind: 'root',\n\t\t\t\tname: 'site',\n\t\t\t} )\n\t\t\t\t? getEntityRecord( 'root', 'site' )\n\t\t\t\t: undefined;\n\n\t\t\tfunction getSectionRootBlock() {\n\t\t\t\tif ( renderingMode === 'template-locked' ) {\n\t\t\t\t\treturn getBlocksByName( 'core/post-content' )?.[ 0 ] ?? '';\n\t\t\t\t}\n\n\t\t\t\treturn (\n\t\t\t\t\tgetBlocksByName( 'core/group' ).find(\n\t\t\t\t\t\t( clientId ) =>\n\t\t\t\t\t\t\tgetBlockAttributes( clientId )?.tagName === 'main'\n\t\t\t\t\t) ?? ''\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tallowRightClickOverrides: get(\n\t\t\t\t\t'core',\n\t\t\t\t\t'allowRightClickOverrides'\n\t\t\t\t),\n\t\t\t\tblockTypes: getBlockTypes(),\n\t\t\t\tcanUseUnfilteredHTML: getRawEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\tpostType,\n\t\t\t\t\tpostId\n\t\t\t\t)?._links?.hasOwnProperty( 'wp:action-unfiltered-html' ),\n\t\t\t\tfocusMode: get( 'core', 'focusMode' ),\n\t\t\t\thasFixedToolbar:\n\t\t\t\t\tget( 'core', 'fixedToolbar' ) || ! isLargeViewport,\n\t\t\t\thiddenBlockTypes: get( 'core', 'hiddenBlockTypes' ),\n\t\t\t\tisDistractionFree: get( 'core', 'distractionFree' ),\n\t\t\t\tkeepCaretInsideBlock: get( 'core', 'keepCaretInsideBlock' ),\n\t\t\t\thasUploadPermissions:\n\t\t\t\t\tcanUser( 'create', {\n\t\t\t\t\t\tkind: 'root',\n\t\t\t\t\t\tname: 'media',\n\t\t\t\t\t} ) ?? true,\n\t\t\t\tuserCanCreatePages: canUser( 'create', {\n\t\t\t\t\tkind: 'postType',\n\t\t\t\t\tname: 'page',\n\t\t\t\t} ),\n\t\t\t\tpageOnFront: siteSettings?.page_on_front,\n\t\t\t\tpageForPosts: siteSettings?.page_for_posts,\n\t\t\t\tuserPatternCategories: getUserPatternCategories(),\n\t\t\t\trestBlockPatternCategories: getBlockPatternCategories(),\n\t\t\t\tsectionRootClientId: getSectionRootBlock(),\n\t\t\t};\n\t\t},\n\t\t[ postType, postId, isLargeViewport, renderingMode ]\n\t);\n\n\tconst { merged: mergedGlobalStyles } = useGlobalStylesContext();\n\tconst globalStylesData = mergedGlobalStyles.styles ?? EMPTY_OBJECT;\n\tconst globalStylesLinksData = mergedGlobalStyles._links ?? EMPTY_OBJECT;\n\n\tconst settingsBlockPatterns =\n\t\tsettings.__experimentalAdditionalBlockPatterns ?? // WP 6.0\n\t\tsettings.__experimentalBlockPatterns; // WP 5.9\n\tconst settingsBlockPatternCategories =\n\t\tsettings.__experimentalAdditionalBlockPatternCategories ?? // WP 6.0\n\t\tsettings.__experimentalBlockPatternCategories; // WP 5.9\n\n\tconst blockPatterns = useMemo(\n\t\t() =>\n\t\t\t[ ...( settingsBlockPatterns || [] ) ].filter(\n\t\t\t\t( { postTypes } ) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t! postTypes ||\n\t\t\t\t\t\t( Array.isArray( postTypes ) &&\n\t\t\t\t\t\t\tpostTypes.includes( postType ) )\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t),\n\t\t[ settingsBlockPatterns, postType ]\n\t);\n\n\tconst blockPatternCategories = useMemo(\n\t\t() =>\n\t\t\t[\n\t\t\t\t...( settingsBlockPatternCategories || [] ),\n\t\t\t\t...( restBlockPatternCategories || [] ),\n\t\t\t].filter(\n\t\t\t\t( x, index, arr ) =>\n\t\t\t\t\tindex === arr.findIndex( ( y ) => x.name === y.name )\n\t\t\t),\n\t\t[ settingsBlockPatternCategories, restBlockPatternCategories ]\n\t);\n\n\tconst { undo, setIsInserterOpened } = useDispatch( editorStore );\n\n\tconst { saveEntityRecord } = useDispatch( coreStore );\n\n\t/**\n\t * Creates a Post entity.\n\t * This is utilised by the Link UI to allow for on-the-fly creation of Posts/Pages.\n\t *\n\t * @param {Object} options parameters for the post being created. These mirror those used on 3rd param of saveEntityRecord.\n\t * @return {Object} the post type object that was created.\n\t */\n\tconst createPageEntity = useCallback(\n\t\t( options ) => {\n\t\t\tif ( ! userCanCreatePages ) {\n\t\t\t\treturn Promise.reject( {\n\t\t\t\t\tmessage: __(\n\t\t\t\t\t\t'You do not have permission to create Pages.'\n\t\t\t\t\t),\n\t\t\t\t} );\n\t\t\t}\n\t\t\treturn saveEntityRecord( 'postType', 'page', options );\n\t\t},\n\t\t[ saveEntityRecord, userCanCreatePages ]\n\t);\n\n\tconst allowedBlockTypes = useMemo( () => {\n\t\t// Omit hidden block types if exists and non-empty.\n\t\tif ( hiddenBlockTypes && hiddenBlockTypes.length > 0 ) {\n\t\t\t// Defer to passed setting for `allowedBlockTypes` if provided as\n\t\t\t// anything other than `true` (where `true` is equivalent to allow\n\t\t\t// all block types).\n\t\t\tconst defaultAllowedBlockTypes =\n\t\t\t\ttrue === settings.allowedBlockTypes\n\t\t\t\t\t? blockTypes.map( ( { name } ) => name )\n\t\t\t\t\t: settings.allowedBlockTypes || [];\n\n\t\t\treturn defaultAllowedBlockTypes.filter(\n\t\t\t\t( type ) => ! hiddenBlockTypes.includes( type )\n\t\t\t);\n\t\t}\n\n\t\treturn settings.allowedBlockTypes;\n\t}, [ settings.allowedBlockTypes, hiddenBlockTypes, blockTypes ] );\n\n\tconst forceDisableFocusMode = settings.focusMode === false;\n\n\treturn useMemo( () => {\n\t\tconst blockEditorSettings = {\n\t\t\t...Object.fromEntries(\n\t\t\t\tObject.entries( settings ).filter( ( [ key ] ) =>\n\t\t\t\t\tBLOCK_EDITOR_SETTINGS.includes( key )\n\t\t\t\t)\n\t\t\t),\n\t\t\t[ globalStylesDataKey ]: globalStylesData,\n\t\t\t[ globalStylesLinksDataKey ]: globalStylesLinksData,\n\t\t\tallowedBlockTypes,\n\t\t\tallowRightClickOverrides,\n\t\t\tfocusMode: focusMode && ! forceDisableFocusMode,\n\t\t\thasFixedToolbar,\n\t\t\tisDistractionFree,\n\t\t\tkeepCaretInsideBlock,\n\t\t\tmediaUpload: hasUploadPermissions ? mediaUpload : undefined,\n\t\t\t__experimentalBlockPatterns: blockPatterns,\n\t\t\t[ selectBlockPatternsKey ]: ( select ) => {\n\t\t\t\tconst { hasFinishedResolution, getBlockPatternsForPostType } =\n\t\t\t\t\tunlock( select( coreStore ) );\n\t\t\t\tconst patterns = getBlockPatternsForPostType( postType );\n\t\t\t\treturn hasFinishedResolution( 'getBlockPatterns' )\n\t\t\t\t\t? patterns\n\t\t\t\t\t: undefined;\n\t\t\t},\n\t\t\t[ reusableBlocksSelectKey ]: __experimentalReusableBlocksSelect,\n\t\t\t__experimentalBlockPatternCategories: blockPatternCategories,\n\t\t\t__experimentalUserPatternCategories: userPatternCategories,\n\t\t\t__experimentalFetchLinkSuggestions: ( search, searchOptions ) =>\n\t\t\t\tfetchLinkSuggestions( search, searchOptions, settings ),\n\t\t\tinserterMediaCategories,\n\t\t\t__experimentalFetchRichUrlData: fetchUrlData,\n\t\t\t// Todo: This only checks the top level post, not the post within a template or any other entity that can be edited.\n\t\t\t// This might be better as a generic \"canUser\" selector.\n\t\t\t__experimentalCanUserUseUnfilteredHTML: canUseUnfilteredHTML,\n\t\t\t//Todo: this is only needed for native and should probably be removed.\n\t\t\t__experimentalUndo: undo,\n\t\t\t// Check whether we want all site editor frames to have outlines\n\t\t\t// including the navigation / pattern / parts editors.\n\t\t\toutlineMode: ! isDistractionFree && postType === 'wp_template',\n\t\t\t// Check these two properties: they were not present in the site editor.\n\t\t\t__experimentalCreatePageEntity: createPageEntity,\n\t\t\t__experimentalUserCanCreatePages: userCanCreatePages,\n\t\t\tpageOnFront,\n\t\t\tpageForPosts,\n\t\t\t__experimentalPreferPatternsOnRoot: postType === 'wp_template',\n\t\t\ttemplateLock:\n\t\t\t\tpostType === 'wp_navigation' ? 'insert' : settings.templateLock,\n\t\t\ttemplate:\n\t\t\t\tpostType === 'wp_navigation'\n\t\t\t\t\t? [ [ 'core/navigation', {}, [] ] ]\n\t\t\t\t\t: settings.template,\n\t\t\t__experimentalSetIsInserterOpened: setIsInserterOpened,\n\t\t\t[ sectionRootClientIdKey ]: sectionRootClientId,\n\t\t\teditorTool:\n\t\t\t\trenderingMode === 'post-only' && postType !== 'wp_template'\n\t\t\t\t\t? 'edit'\n\t\t\t\t\t: undefined,\n\t\t};\n\n\t\treturn blockEditorSettings;\n\t}, [\n\t\tallowedBlockTypes,\n\t\tallowRightClickOverrides,\n\t\tfocusMode,\n\t\tforceDisableFocusMode,\n\t\thasFixedToolbar,\n\t\tisDistractionFree,\n\t\tkeepCaretInsideBlock,\n\t\tsettings,\n\t\thasUploadPermissions,\n\t\tuserPatternCategories,\n\t\tblockPatterns,\n\t\tblockPatternCategories,\n\t\tcanUseUnfilteredHTML,\n\t\tundo,\n\t\tcreatePageEntity,\n\t\tuserCanCreatePages,\n\t\tpageOnFront,\n\t\tpageForPosts,\n\t\tpostType,\n\t\tsetIsInserterOpened,\n\t\tsectionRootClientId,\n\t\tglobalStylesData,\n\t\tglobalStylesLinksData,\n\t\trenderingMode,\n\t] );\n}\n\nexport default useBlockEditorSettings;\n"],"mappings":";;;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AAMA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN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ACZpB,QAAQ,EACR8E,mBAAmB,EACnBvD,mBAAmB,EACnBgC,gBAAgB,EAChBE,qBAAqB,EACrBvD,aAAa,CACZ,CAAC;AACJ;AAAC,IAAAwH,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEc9H,sBAAsB","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_element","require","_data","_coreData","_i18n","_preferences","_compose","_blocks","_blockEditor","_mediaCategories","_interopRequireDefault","_utils","_mediaSideload","_store","_lockUnlock","_globalStylesProvider","EMPTY_OBJECT","__experimentalReusableBlocksSelect","select","RECEIVE_INTERMEDIATE_RESULTS","unlock","coreDataPrivateApis","getEntityRecords","coreStore","per_page","BLOCK_EDITOR_SETTINGS","globalStylesDataKey","globalStylesLinksDataKey","selectBlockPatternsKey","reusableBlocksSelectKey","sectionRootClientIdKey","privateApis","useBlockEditorSettings","settings","postType","postId","renderingMode","_mergedGlobalStyles$s","_mergedGlobalStyles$_","_settings$__experimen","_settings$__experimen2","isLargeViewport","useViewportMatch","allowRightClickOverrides","blockTypes","focusMode","hasFixedToolbar","isDistractionFree","keepCaretInsideBlock","hasUploadPermissions","hiddenBlockTypes","canUseUnfilteredHTML","userCanCreatePages","pageOnFront","pageForPosts","userPatternCategories","restBlockPatternCategories","sectionRootClientId","useSelect","_canUser","canUser","getRawEntityRecord","getEntityRecord","getUserPatternCategories","getBlockPatternCategories","get","preferencesStore","getBlockTypes","blocksStore","getBlocksByName","getBlockAttributes","blockEditorStore","siteSettings","kind","name","undefined","getSectionRootBlock","_getBlocksByName$find","_getBlocksByName$","find","clientId","tagName","_links","hasOwnProperty","page_on_front","page_for_posts","merged","mergedGlobalStyles","useGlobalStylesContext","globalStylesData","styles","globalStylesLinksData","settingsBlockPatterns","__experimentalAdditionalBlockPatterns","__experimentalBlockPatterns","settingsBlockPatternCategories","__experimentalAdditionalBlockPatternCategories","__experimentalBlockPatternCategories","blockPatterns","useMemo","filter","postTypes","Array","isArray","includes","blockPatternCategories","x","index","arr","findIndex","y","undo","setIsInserterOpened","useDispatch","editorStore","saveEntityRecord","createPageEntity","useCallback","options","Promise","reject","message","__","allowedBlockTypes","length","defaultAllowedBlockTypes","map","type","forceDisableFocusMode","blockEditorSettings","Object","fromEntries","entries","key","mediaUpload","mediaSideload","hasFinishedResolution","getBlockPatternsForPostType","patterns","__experimentalUserPatternCategories","__experimentalFetchLinkSuggestions","search","searchOptions","fetchLinkSuggestions","inserterMediaCategories","__experimentalFetchRichUrlData","fetchUrlData","__experimentalCanUserUseUnfilteredHTML","__experimentalUndo","outlineMode","__experimentalCreatePageEntity","__experimentalUserCanCreatePages","__experimentalPreferPatternsOnRoot","templateLock","template","__experimentalSetIsInserterOpened","editorTool","_default","exports","default"],"sources":["@wordpress/editor/src/components/provider/use-block-editor-settings.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo, useCallback } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport {\n\tstore as coreStore,\n\t__experimentalFetchLinkSuggestions as fetchLinkSuggestions,\n\t__experimentalFetchUrlData as fetchUrlData,\n\tprivateApis as coreDataPrivateApis,\n} from '@wordpress/core-data';\nimport { __ } from '@wordpress/i18n';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { store as blocksStore } from '@wordpress/blocks';\nimport {\n\tprivateApis,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport inserterMediaCategories from '../media-categories';\nimport { mediaUpload } from '../../utils';\nimport { default as mediaSideload } from '../../utils/media-sideload';\nimport { store as editorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\nimport { useGlobalStylesContext } from '../global-styles-provider';\n\nconst EMPTY_OBJECT = {};\n\nfunction __experimentalReusableBlocksSelect( select ) {\n\tconst { RECEIVE_INTERMEDIATE_RESULTS } = unlock( coreDataPrivateApis );\n\tconst { getEntityRecords } = select( coreStore );\n\treturn getEntityRecords( 'postType', 'wp_block', {\n\t\tper_page: -1,\n\t\t[ RECEIVE_INTERMEDIATE_RESULTS ]: true,\n\t} );\n}\n\nconst BLOCK_EDITOR_SETTINGS = [\n\t'__experimentalBlockDirectory',\n\t'__experimentalDiscussionSettings',\n\t'__experimentalFeatures',\n\t'__experimentalGlobalStylesBaseStyles',\n\t'alignWide',\n\t'blockInspectorTabs',\n\t'maxUploadFileSize',\n\t'allowedMimeTypes',\n\t'bodyPlaceholder',\n\t'canLockBlocks',\n\t'canUpdateBlockBindings',\n\t'capabilities',\n\t'clearBlockSelection',\n\t'codeEditingEnabled',\n\t'colors',\n\t'disableCustomColors',\n\t'disableCustomFontSizes',\n\t'disableCustomSpacingSizes',\n\t'disableCustomGradients',\n\t'disableLayoutStyles',\n\t'enableCustomLineHeight',\n\t'enableCustomSpacing',\n\t'enableCustomUnits',\n\t'enableOpenverseMediaCategory',\n\t'fontSizes',\n\t'gradients',\n\t'generateAnchors',\n\t'onNavigateToEntityRecord',\n\t'imageDefaultSize',\n\t'imageDimensions',\n\t'imageEditing',\n\t'imageSizes',\n\t'isPreviewMode',\n\t'isRTL',\n\t'locale',\n\t'maxWidth',\n\t'postContentAttributes',\n\t'postsPerPage',\n\t'readOnly',\n\t'styles',\n\t'titlePlaceholder',\n\t'supportsLayout',\n\t'widgetTypesToHideFromLegacyWidgetBlock',\n\t'__unstableHasCustomAppender',\n\t'__unstableResolvedAssets',\n\t'__unstableIsBlockBasedTheme',\n];\n\nconst {\n\tglobalStylesDataKey,\n\tglobalStylesLinksDataKey,\n\tselectBlockPatternsKey,\n\treusableBlocksSelectKey,\n\tsectionRootClientIdKey,\n} = unlock( privateApis );\n\n/**\n * React hook used to compute the block editor settings to use for the post editor.\n *\n * @param {Object} settings EditorProvider settings prop.\n * @param {string} postType Editor root level post type.\n * @param {string} postId Editor root level post ID.\n * @param {string} renderingMode Editor rendering mode.\n *\n * @return {Object} Block Editor Settings.\n */\nfunction useBlockEditorSettings( settings, postType, postId, renderingMode ) {\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst {\n\t\tallowRightClickOverrides,\n\t\tblockTypes,\n\t\tfocusMode,\n\t\thasFixedToolbar,\n\t\tisDistractionFree,\n\t\tkeepCaretInsideBlock,\n\t\thasUploadPermissions,\n\t\thiddenBlockTypes,\n\t\tcanUseUnfilteredHTML,\n\t\tuserCanCreatePages,\n\t\tpageOnFront,\n\t\tpageForPosts,\n\t\tuserPatternCategories,\n\t\trestBlockPatternCategories,\n\t\tsectionRootClientId,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tcanUser,\n\t\t\t\tgetRawEntityRecord,\n\t\t\t\tgetEntityRecord,\n\t\t\t\tgetUserPatternCategories,\n\t\t\t\tgetBlockPatternCategories,\n\t\t\t} = select( coreStore );\n\t\t\tconst { get } = select( preferencesStore );\n\t\t\tconst { getBlockTypes } = select( blocksStore );\n\t\t\tconst { getBlocksByName, getBlockAttributes } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\tconst siteSettings = canUser( 'read', {\n\t\t\t\tkind: 'root',\n\t\t\t\tname: 'site',\n\t\t\t} )\n\t\t\t\t? getEntityRecord( 'root', 'site' )\n\t\t\t\t: undefined;\n\n\t\t\tfunction getSectionRootBlock() {\n\t\t\t\tif ( renderingMode === 'template-locked' ) {\n\t\t\t\t\treturn getBlocksByName( 'core/post-content' )?.[ 0 ] ?? '';\n\t\t\t\t}\n\n\t\t\t\treturn (\n\t\t\t\t\tgetBlocksByName( 'core/group' ).find(\n\t\t\t\t\t\t( clientId ) =>\n\t\t\t\t\t\t\tgetBlockAttributes( clientId )?.tagName === 'main'\n\t\t\t\t\t) ?? ''\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tallowRightClickOverrides: get(\n\t\t\t\t\t'core',\n\t\t\t\t\t'allowRightClickOverrides'\n\t\t\t\t),\n\t\t\t\tblockTypes: getBlockTypes(),\n\t\t\t\tcanUseUnfilteredHTML: getRawEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\tpostType,\n\t\t\t\t\tpostId\n\t\t\t\t)?._links?.hasOwnProperty( 'wp:action-unfiltered-html' ),\n\t\t\t\tfocusMode: get( 'core', 'focusMode' ),\n\t\t\t\thasFixedToolbar:\n\t\t\t\t\tget( 'core', 'fixedToolbar' ) || ! isLargeViewport,\n\t\t\t\thiddenBlockTypes: get( 'core', 'hiddenBlockTypes' ),\n\t\t\t\tisDistractionFree: get( 'core', 'distractionFree' ),\n\t\t\t\tkeepCaretInsideBlock: get( 'core', 'keepCaretInsideBlock' ),\n\t\t\t\thasUploadPermissions:\n\t\t\t\t\tcanUser( 'create', {\n\t\t\t\t\t\tkind: 'root',\n\t\t\t\t\t\tname: 'media',\n\t\t\t\t\t} ) ?? true,\n\t\t\t\tuserCanCreatePages: canUser( 'create', {\n\t\t\t\t\tkind: 'postType',\n\t\t\t\t\tname: 'page',\n\t\t\t\t} ),\n\t\t\t\tpageOnFront: siteSettings?.page_on_front,\n\t\t\t\tpageForPosts: siteSettings?.page_for_posts,\n\t\t\t\tuserPatternCategories: getUserPatternCategories(),\n\t\t\t\trestBlockPatternCategories: getBlockPatternCategories(),\n\t\t\t\tsectionRootClientId: getSectionRootBlock(),\n\t\t\t};\n\t\t},\n\t\t[ postType, postId, isLargeViewport, renderingMode ]\n\t);\n\n\tconst { merged: mergedGlobalStyles } = useGlobalStylesContext();\n\tconst globalStylesData = mergedGlobalStyles.styles ?? EMPTY_OBJECT;\n\tconst globalStylesLinksData = mergedGlobalStyles._links ?? EMPTY_OBJECT;\n\n\tconst settingsBlockPatterns =\n\t\tsettings.__experimentalAdditionalBlockPatterns ?? // WP 6.0\n\t\tsettings.__experimentalBlockPatterns; // WP 5.9\n\tconst settingsBlockPatternCategories =\n\t\tsettings.__experimentalAdditionalBlockPatternCategories ?? // WP 6.0\n\t\tsettings.__experimentalBlockPatternCategories; // WP 5.9\n\n\tconst blockPatterns = useMemo(\n\t\t() =>\n\t\t\t[ ...( settingsBlockPatterns || [] ) ].filter(\n\t\t\t\t( { postTypes } ) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t! postTypes ||\n\t\t\t\t\t\t( Array.isArray( postTypes ) &&\n\t\t\t\t\t\t\tpostTypes.includes( postType ) )\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t),\n\t\t[ settingsBlockPatterns, postType ]\n\t);\n\n\tconst blockPatternCategories = useMemo(\n\t\t() =>\n\t\t\t[\n\t\t\t\t...( settingsBlockPatternCategories || [] ),\n\t\t\t\t...( restBlockPatternCategories || [] ),\n\t\t\t].filter(\n\t\t\t\t( x, index, arr ) =>\n\t\t\t\t\tindex === arr.findIndex( ( y ) => x.name === y.name )\n\t\t\t),\n\t\t[ settingsBlockPatternCategories, restBlockPatternCategories ]\n\t);\n\n\tconst { undo, setIsInserterOpened } = useDispatch( editorStore );\n\n\tconst { saveEntityRecord } = useDispatch( coreStore );\n\n\t/**\n\t * Creates a Post entity.\n\t * This is utilised by the Link UI to allow for on-the-fly creation of Posts/Pages.\n\t *\n\t * @param {Object} options parameters for the post being created. These mirror those used on 3rd param of saveEntityRecord.\n\t * @return {Object} the post type object that was created.\n\t */\n\tconst createPageEntity = useCallback(\n\t\t( options ) => {\n\t\t\tif ( ! userCanCreatePages ) {\n\t\t\t\treturn Promise.reject( {\n\t\t\t\t\tmessage: __(\n\t\t\t\t\t\t'You do not have permission to create Pages.'\n\t\t\t\t\t),\n\t\t\t\t} );\n\t\t\t}\n\t\t\treturn saveEntityRecord( 'postType', 'page', options );\n\t\t},\n\t\t[ saveEntityRecord, userCanCreatePages ]\n\t);\n\n\tconst allowedBlockTypes = useMemo( () => {\n\t\t// Omit hidden block types if exists and non-empty.\n\t\tif ( hiddenBlockTypes && hiddenBlockTypes.length > 0 ) {\n\t\t\t// Defer to passed setting for `allowedBlockTypes` if provided as\n\t\t\t// anything other than `true` (where `true` is equivalent to allow\n\t\t\t// all block types).\n\t\t\tconst defaultAllowedBlockTypes =\n\t\t\t\ttrue === settings.allowedBlockTypes\n\t\t\t\t\t? blockTypes.map( ( { name } ) => name )\n\t\t\t\t\t: settings.allowedBlockTypes || [];\n\n\t\t\treturn defaultAllowedBlockTypes.filter(\n\t\t\t\t( type ) => ! hiddenBlockTypes.includes( type )\n\t\t\t);\n\t\t}\n\n\t\treturn settings.allowedBlockTypes;\n\t}, [ settings.allowedBlockTypes, hiddenBlockTypes, blockTypes ] );\n\n\tconst forceDisableFocusMode = settings.focusMode === false;\n\n\treturn useMemo( () => {\n\t\tconst blockEditorSettings = {\n\t\t\t...Object.fromEntries(\n\t\t\t\tObject.entries( settings ).filter( ( [ key ] ) =>\n\t\t\t\t\tBLOCK_EDITOR_SETTINGS.includes( key )\n\t\t\t\t)\n\t\t\t),\n\t\t\t[ globalStylesDataKey ]: globalStylesData,\n\t\t\t[ globalStylesLinksDataKey ]: globalStylesLinksData,\n\t\t\tallowedBlockTypes,\n\t\t\tallowRightClickOverrides,\n\t\t\tfocusMode: focusMode && ! forceDisableFocusMode,\n\t\t\thasFixedToolbar,\n\t\t\tisDistractionFree,\n\t\t\tkeepCaretInsideBlock,\n\t\t\tmediaUpload: hasUploadPermissions ? mediaUpload : undefined,\n\t\t\tmediaSideload: hasUploadPermissions ? mediaSideload : undefined,\n\t\t\t__experimentalBlockPatterns: blockPatterns,\n\t\t\t[ selectBlockPatternsKey ]: ( select ) => {\n\t\t\t\tconst { hasFinishedResolution, getBlockPatternsForPostType } =\n\t\t\t\t\tunlock( select( coreStore ) );\n\t\t\t\tconst patterns = getBlockPatternsForPostType( postType );\n\t\t\t\treturn hasFinishedResolution( 'getBlockPatterns' )\n\t\t\t\t\t? patterns\n\t\t\t\t\t: undefined;\n\t\t\t},\n\t\t\t[ reusableBlocksSelectKey ]: __experimentalReusableBlocksSelect,\n\t\t\t__experimentalBlockPatternCategories: blockPatternCategories,\n\t\t\t__experimentalUserPatternCategories: userPatternCategories,\n\t\t\t__experimentalFetchLinkSuggestions: ( search, searchOptions ) =>\n\t\t\t\tfetchLinkSuggestions( search, searchOptions, settings ),\n\t\t\tinserterMediaCategories,\n\t\t\t__experimentalFetchRichUrlData: fetchUrlData,\n\t\t\t// Todo: This only checks the top level post, not the post within a template or any other entity that can be edited.\n\t\t\t// This might be better as a generic \"canUser\" selector.\n\t\t\t__experimentalCanUserUseUnfilteredHTML: canUseUnfilteredHTML,\n\t\t\t//Todo: this is only needed for native and should probably be removed.\n\t\t\t__experimentalUndo: undo,\n\t\t\t// Check whether we want all site editor frames to have outlines\n\t\t\t// including the navigation / pattern / parts editors.\n\t\t\toutlineMode: ! isDistractionFree && postType === 'wp_template',\n\t\t\t// Check these two properties: they were not present in the site editor.\n\t\t\t__experimentalCreatePageEntity: createPageEntity,\n\t\t\t__experimentalUserCanCreatePages: userCanCreatePages,\n\t\t\tpageOnFront,\n\t\t\tpageForPosts,\n\t\t\t__experimentalPreferPatternsOnRoot: postType === 'wp_template',\n\t\t\ttemplateLock:\n\t\t\t\tpostType === 'wp_navigation' ? 'insert' : settings.templateLock,\n\t\t\ttemplate:\n\t\t\t\tpostType === 'wp_navigation'\n\t\t\t\t\t? [ [ 'core/navigation', {}, [] ] ]\n\t\t\t\t\t: settings.template,\n\t\t\t__experimentalSetIsInserterOpened: setIsInserterOpened,\n\t\t\t[ sectionRootClientIdKey ]: sectionRootClientId,\n\t\t\teditorTool:\n\t\t\t\trenderingMode === 'post-only' && postType !== 'wp_template'\n\t\t\t\t\t? 'edit'\n\t\t\t\t\t: undefined,\n\t\t};\n\n\t\treturn blockEditorSettings;\n\t}, [\n\t\tallowedBlockTypes,\n\t\tallowRightClickOverrides,\n\t\tfocusMode,\n\t\tforceDisableFocusMode,\n\t\thasFixedToolbar,\n\t\tisDistractionFree,\n\t\tkeepCaretInsideBlock,\n\t\tsettings,\n\t\thasUploadPermissions,\n\t\tuserPatternCategories,\n\t\tblockPatterns,\n\t\tblockPatternCategories,\n\t\tcanUseUnfilteredHTML,\n\t\tundo,\n\t\tcreatePageEntity,\n\t\tuserCanCreatePages,\n\t\tpageOnFront,\n\t\tpageForPosts,\n\t\tpostType,\n\t\tsetIsInserterOpened,\n\t\tsectionRootClientId,\n\t\tglobalStylesData,\n\t\tglobalStylesLinksData,\n\t\trenderingMode,\n\t] );\n}\n\nexport default useBlockEditorSettings;\n"],"mappings":";;;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AAMA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AACA,IAAAO,YAAA,GAAAP,OAAA;AAQA,IAAAQ,gBAAA,GAAAC,sBAAA,CAAAT,OAAA;AACA,IAAAU,MAAA,GAAAV,OAAA;AACA,IAAAW,cAAA,GAAAF,sBAAA,CAAAT,OAAA;AACA,IAAAY,MAAA,GAAAZ,OAAA;AACA,IAAAa,WAAA,GAAAb,OAAA;AACA,IAAAc,qBAAA,GAAAd,OAAA;AA5BA;AACA;AACA;;AAkBA;AACA;AACA;;AAQA,MAAMe,YAAY,GAAG,CAAC,CAAC;AAEvB,SAASC,kCAAkCA,CAAEC,MAAM,EAAG;EACrD,MAAM;IAAEC;EAA6B,CAAC,GAAG,IAAAC,kBAAM,EAAEC,qBAAoB,CAAC;EACtE,MAAM;IAAEC;EAAiB,CAAC,GAAGJ,MAAM,CAAEK,eAAU,CAAC;EAChD,OAAOD,gBAAgB,CAAE,UAAU,EAAE,UAAU,EAAE;IAChDE,QAAQ,EAAE,CAAC,CAAC;IACZ,CAAEL,4BAA4B,GAAI;EACnC,CAAE,CAAC;AACJ;AAEA,MAAMM,qBAAqB,GAAG,CAC7B,8BAA8B,EAC9B,kCAAkC,EAClC,wBAAwB,EACxB,sCAAsC,EACtC,WAAW,EACX,oBAAoB,EACpB,mBAAmB,EACnB,kBAAkB,EAClB,iBAAiB,EACjB,eAAe,E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