@wordpress/block-library 9.36.1-next.738bb1424.0 → 9.36.2-next.8fd3f8831.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 +4 -0
- package/build/accordion-heading/deprecated.cjs +120 -1
- package/build/accordion-heading/deprecated.cjs.map +2 -2
- package/build/accordion-heading/edit.cjs +9 -1
- package/build/accordion-heading/edit.cjs.map +3 -3
- package/build/accordion-heading/save.cjs +1 -0
- package/build/accordion-heading/save.cjs.map +2 -2
- package/build/accordion-item/block.json +3 -0
- package/build/accordion-item/edit.cjs +3 -37
- package/build/accordion-item/edit.cjs.map +2 -2
- package/build/accordion-panel/block.json +1 -4
- package/build/accordion-panel/edit.cjs +3 -2
- package/build/accordion-panel/edit.cjs.map +2 -2
- package/build/breadcrumbs/block.json +1 -2
- package/build/breadcrumbs/edit.cjs +2 -1
- package/build/breadcrumbs/edit.cjs.map +2 -2
- package/build/button/index.cjs +9 -1
- package/build/button/index.cjs.map +2 -2
- package/build/buttons/block.json +1 -0
- package/build/comment-author-name/block.json +1 -3
- package/build/comment-author-name/deprecated.cjs +57 -1
- package/build/comment-author-name/deprecated.cjs.map +3 -3
- package/build/comment-author-name/edit.cjs +9 -19
- package/build/comment-author-name/edit.cjs.map +3 -3
- package/build/freeform/edit.cjs +48 -174
- package/build/freeform/edit.cjs.map +2 -2
- package/build/freeform/modal.cjs +51 -67
- package/build/freeform/modal.cjs.map +2 -2
- package/build/index.cjs +2 -2
- package/build/index.cjs.map +2 -2
- package/build/list/block.json +2 -1
- package/build/query/edit/query-content.cjs +4 -3
- package/build/query/edit/query-content.cjs.map +2 -2
- package/build/query/edit/query-placeholder.cjs +4 -3
- package/build/query/edit/query-placeholder.cjs.map +2 -2
- package/build/query/edit/query-toolbar.cjs +19 -7
- package/build/query/edit/query-toolbar.cjs.map +3 -3
- package/build/social-links/block.json +2 -1
- package/build-module/accordion-heading/deprecated.js +122 -2
- package/build-module/accordion-heading/deprecated.js.map +2 -2
- package/build-module/accordion-heading/edit.js +11 -2
- package/build-module/accordion-heading/edit.js.map +2 -2
- package/build-module/accordion-heading/save.js +1 -0
- package/build-module/accordion-heading/save.js.map +2 -2
- package/build-module/accordion-item/block.json +3 -0
- package/build-module/accordion-item/edit.js +3 -37
- package/build-module/accordion-item/edit.js.map +2 -2
- package/build-module/accordion-panel/block.json +1 -4
- package/build-module/accordion-panel/edit.js +3 -2
- package/build-module/accordion-panel/edit.js.map +2 -2
- package/build-module/breadcrumbs/block.json +1 -2
- package/build-module/breadcrumbs/edit.js +2 -1
- package/build-module/breadcrumbs/edit.js.map +2 -2
- package/build-module/button/index.js +9 -1
- package/build-module/button/index.js.map +2 -2
- package/build-module/buttons/block.json +1 -0
- package/build-module/comment-author-name/block.json +1 -3
- package/build-module/comment-author-name/deprecated.js +57 -1
- package/build-module/comment-author-name/deprecated.js.map +2 -2
- package/build-module/comment-author-name/edit.js +10 -25
- package/build-module/comment-author-name/edit.js.map +2 -2
- package/build-module/freeform/edit.js +56 -176
- package/build-module/freeform/edit.js.map +2 -2
- package/build-module/freeform/modal.js +55 -78
- package/build-module/freeform/modal.js.map +2 -2
- package/build-module/index.js +2 -2
- package/build-module/index.js.map +2 -2
- package/build-module/list/block.json +2 -1
- package/build-module/query/edit/query-content.js +5 -5
- package/build-module/query/edit/query-content.js.map +2 -2
- package/build-module/query/edit/query-placeholder.js +4 -4
- package/build-module/query/edit/query-placeholder.js.map +2 -2
- package/build-module/query/edit/query-toolbar.js +22 -7
- package/build-module/query/edit/query-toolbar.js.map +2 -2
- package/build-module/social-links/block.json +2 -1
- package/build-style/audio/style-rtl.css +4 -0
- package/build-style/audio/style.css +4 -0
- package/build-style/audio/theme-rtl.css +4 -0
- package/build-style/audio/theme.css +4 -0
- package/build-style/columns/style-rtl.css +4 -0
- package/build-style/columns/style.css +4 -0
- package/build-style/common-rtl.css +4 -0
- package/build-style/common.css +4 -0
- package/build-style/editor-rtl.css +9 -324
- package/build-style/editor.css +9 -328
- package/build-style/embed/style-rtl.css +4 -0
- package/build-style/embed/style.css +4 -0
- package/build-style/embed/theme-rtl.css +4 -0
- package/build-style/embed/theme.css +4 -0
- package/build-style/freeform/editor-rtl.css +10 -330
- package/build-style/freeform/editor.css +10 -334
- package/build-style/gallery/editor-rtl.css +4 -0
- package/build-style/gallery/editor.css +4 -0
- package/build-style/gallery/style-rtl.css +4 -0
- package/build-style/gallery/style.css +4 -0
- package/build-style/gallery/theme-rtl.css +4 -0
- package/build-style/gallery/theme.css +4 -0
- package/build-style/html/editor-rtl.css +4 -0
- package/build-style/html/editor.css +4 -0
- package/build-style/image/editor-rtl.css +4 -0
- package/build-style/image/editor.css +4 -0
- package/build-style/image/style-rtl.css +4 -0
- package/build-style/image/style.css +4 -0
- package/build-style/image/theme-rtl.css +4 -0
- package/build-style/image/theme.css +4 -0
- package/build-style/latest-posts/style-rtl.css +4 -0
- package/build-style/latest-posts/style.css +4 -0
- package/build-style/navigation/editor-rtl.css +4 -0
- package/build-style/navigation/editor.css +4 -0
- package/build-style/navigation/style-rtl.css +4 -0
- package/build-style/navigation/style.css +4 -0
- package/build-style/navigation-submenu/editor-rtl.css +4 -0
- package/build-style/navigation-submenu/editor.css +4 -0
- package/build-style/page-list/editor-rtl.css +4 -0
- package/build-style/page-list/editor.css +4 -0
- package/build-style/paragraph/editor-rtl.css +5 -0
- package/build-style/paragraph/editor.css +5 -0
- package/build-style/post-template/style-rtl.css +4 -0
- package/build-style/post-template/style.css +4 -0
- package/build-style/query/editor-rtl.css +4 -0
- package/build-style/query/editor.css +4 -0
- package/build-style/rss/style-rtl.css +4 -0
- package/build-style/rss/style.css +4 -0
- package/build-style/shortcode/editor-rtl.css +4 -0
- package/build-style/shortcode/editor.css +4 -0
- package/build-style/style-rtl.css +4 -0
- package/build-style/style.css +4 -0
- package/build-style/table/editor-rtl.css +4 -0
- package/build-style/table/editor.css +4 -0
- package/build-style/table/theme-rtl.css +4 -0
- package/build-style/table/theme.css +4 -0
- package/build-style/template-part/editor-rtl.css +4 -0
- package/build-style/template-part/editor.css +4 -0
- package/build-style/theme-rtl.css +4 -0
- package/build-style/theme.css +4 -0
- package/build-style/video/style-rtl.css +4 -0
- package/build-style/video/style.css +4 -0
- package/build-style/video/theme-rtl.css +4 -0
- package/build-style/video/theme.css +4 -0
- package/package.json +37 -37
- package/src/accordion-heading/deprecated.js +122 -1
- package/src/accordion-heading/edit.js +11 -1
- package/src/accordion-heading/save.js +1 -0
- package/src/accordion-item/block.json +3 -0
- package/src/accordion-item/edit.js +4 -38
- package/src/accordion-panel/block.json +1 -4
- package/src/accordion-panel/edit.js +3 -4
- package/src/breadcrumbs/block.json +1 -2
- package/src/breadcrumbs/edit.js +2 -1
- package/src/breadcrumbs/index.php +23 -1
- package/src/button/index.js +12 -0
- package/src/button/test/get-experimental-label.js +50 -0
- package/src/buttons/block.json +1 -0
- package/src/comment-author-name/block.json +1 -3
- package/src/comment-author-name/deprecated.js +61 -1
- package/src/comment-author-name/edit.js +10 -34
- package/src/freeform/edit.js +60 -245
- package/src/freeform/editor.scss +1 -382
- package/src/freeform/modal.js +47 -80
- package/src/index.js +1 -1
- package/src/list/block.json +2 -1
- package/src/paragraph/editor.scss +8 -0
- package/src/post-date/index.php +4 -7
- package/src/query/edit/query-content.js +3 -3
- package/src/query/edit/query-placeholder.js +3 -3
- package/src/query/edit/query-toolbar.js +47 -31
- package/src/social-links/block.json +2 -1
- package/src/term-template/index.php +1 -1
|
@@ -1,200 +1,80 @@
|
|
|
1
1
|
// packages/block-library/src/freeform/edit.js
|
|
2
2
|
import {
|
|
3
3
|
BlockControls,
|
|
4
|
+
BlockIcon,
|
|
4
5
|
useBlockProps,
|
|
5
6
|
store as blockEditorStore
|
|
6
7
|
} from "@wordpress/block-editor";
|
|
7
|
-
import { debounce, useRefEffect } from "@wordpress/compose";
|
|
8
8
|
import { useSelect } from "@wordpress/data";
|
|
9
|
-
import {
|
|
10
|
-
|
|
9
|
+
import {
|
|
10
|
+
Button,
|
|
11
|
+
Placeholder,
|
|
12
|
+
ToolbarGroup,
|
|
13
|
+
ToolbarButton
|
|
14
|
+
} from "@wordpress/components";
|
|
15
|
+
import { useState, useRef, RawHTML } from "@wordpress/element";
|
|
11
16
|
import { __ } from "@wordpress/i18n";
|
|
12
|
-
import {
|
|
17
|
+
import { classic } from "@wordpress/icons";
|
|
13
18
|
import ConvertToBlocksButton from "./convert-to-blocks-button.js";
|
|
14
19
|
import ModalEdit from "./modal.js";
|
|
15
20
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
if (body.childNodes[0].childNodes.length > 1) {
|
|
25
|
-
return false;
|
|
26
|
-
}
|
|
27
|
-
return /^\n?$/.test(body.innerText || body.textContent);
|
|
28
|
-
}
|
|
29
|
-
function FreeformEdit(props) {
|
|
30
|
-
const { clientId } = props;
|
|
21
|
+
function FreeformEdit({
|
|
22
|
+
attributes,
|
|
23
|
+
setAttributes,
|
|
24
|
+
clientId
|
|
25
|
+
}) {
|
|
26
|
+
const { content } = attributes;
|
|
27
|
+
const [isOpen, setOpen] = useState(false);
|
|
28
|
+
const editButtonRef = useRef(null);
|
|
31
29
|
const canRemove = useSelect(
|
|
32
30
|
(select) => select(blockEditorStore).canRemoveBlock(clientId),
|
|
33
31
|
[clientId]
|
|
34
32
|
);
|
|
35
|
-
const [isIframed, setIsIframed] = useState(false);
|
|
36
|
-
const ref = useRefEffect((element) => {
|
|
37
|
-
setIsIframed(element.ownerDocument !== document);
|
|
38
|
-
}, []);
|
|
39
33
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
40
34
|
canRemove && /* @__PURE__ */ jsx(BlockControls, { children: /* @__PURE__ */ jsx(ToolbarGroup, { children: /* @__PURE__ */ jsx(ConvertToBlocksButton, { clientId }) }) }),
|
|
41
|
-
/* @__PURE__ */ jsx(
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
setAttributes,
|
|
48
|
-
onReplace
|
|
49
|
-
}) {
|
|
50
|
-
const { getMultiSelectedBlockClientIds } = useSelect(blockEditorStore);
|
|
51
|
-
const didMountRef = useRef(false);
|
|
52
|
-
useEffect(() => {
|
|
53
|
-
if (!didMountRef.current) {
|
|
54
|
-
return;
|
|
55
|
-
}
|
|
56
|
-
const editor = window.tinymce.get(`editor-${clientId}`);
|
|
57
|
-
if (!editor) {
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
|
-
const currentContent = editor.getContent();
|
|
61
|
-
if (currentContent !== content) {
|
|
62
|
-
editor.setContent(content || "");
|
|
63
|
-
}
|
|
64
|
-
}, [clientId, content]);
|
|
65
|
-
useEffect(() => {
|
|
66
|
-
const { baseURL, suffix } = window.wpEditorL10n.tinymce;
|
|
67
|
-
didMountRef.current = true;
|
|
68
|
-
window.tinymce.EditorManager.overrideDefaults({
|
|
69
|
-
base_url: baseURL,
|
|
70
|
-
suffix
|
|
71
|
-
});
|
|
72
|
-
function onSetup(editor) {
|
|
73
|
-
let bookmark;
|
|
74
|
-
if (content) {
|
|
75
|
-
editor.on("loadContent", () => editor.setContent(content));
|
|
35
|
+
/* @__PURE__ */ jsx(BlockControls, { children: /* @__PURE__ */ jsx(ToolbarGroup, { children: /* @__PURE__ */ jsx(
|
|
36
|
+
ToolbarButton,
|
|
37
|
+
{
|
|
38
|
+
ref: editButtonRef,
|
|
39
|
+
onClick: () => setOpen(true),
|
|
40
|
+
children: __("Edit")
|
|
76
41
|
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
42
|
+
) }) }),
|
|
43
|
+
/* @__PURE__ */ jsxs("div", { ...useBlockProps(), children: [
|
|
44
|
+
content ? /* @__PURE__ */ jsx(RawHTML, { children: content }) : /* @__PURE__ */ jsx(
|
|
45
|
+
Placeholder,
|
|
46
|
+
{
|
|
47
|
+
icon: /* @__PURE__ */ jsx(BlockIcon, { icon: classic }),
|
|
48
|
+
label: __("Classic"),
|
|
49
|
+
instructions: __(
|
|
50
|
+
"Use the classic editor to add content."
|
|
51
|
+
),
|
|
52
|
+
children: /* @__PURE__ */ jsx(
|
|
53
|
+
Button,
|
|
54
|
+
{
|
|
55
|
+
__next40pxDefaultSize: true,
|
|
56
|
+
variant: "primary",
|
|
57
|
+
onClick: () => setOpen(true),
|
|
58
|
+
children: __("Edit contents")
|
|
93
59
|
}
|
|
94
|
-
|
|
95
|
-
});
|
|
96
|
-
return false;
|
|
97
|
-
});
|
|
98
|
-
editor.on("mousedown touchstart", () => {
|
|
99
|
-
bookmark = null;
|
|
100
|
-
});
|
|
101
|
-
const debouncedOnChange = debounce(() => {
|
|
102
|
-
const value = editor.getContent();
|
|
103
|
-
if (value !== editor._lastChange) {
|
|
104
|
-
editor._lastChange = value;
|
|
105
|
-
setAttributes({
|
|
106
|
-
content: value
|
|
107
|
-
});
|
|
60
|
+
)
|
|
108
61
|
}
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
if (altKey && event.keyCode === F10) {
|
|
123
|
-
event.stopPropagation();
|
|
124
|
-
}
|
|
125
|
-
});
|
|
126
|
-
editor.on("paste", (event) => {
|
|
127
|
-
event.stopPropagation();
|
|
128
|
-
});
|
|
129
|
-
editor.on("init", () => {
|
|
130
|
-
const rootNode = editor.getBody();
|
|
131
|
-
if (rootNode.ownerDocument.activeElement === rootNode) {
|
|
132
|
-
rootNode.blur();
|
|
133
|
-
editor.focus();
|
|
134
|
-
}
|
|
135
|
-
});
|
|
136
|
-
}
|
|
137
|
-
function initialize() {
|
|
138
|
-
const { settings } = window.wpEditorL10n.tinymce;
|
|
139
|
-
wp.oldEditor.initialize(`editor-${clientId}`, {
|
|
140
|
-
tinymce: {
|
|
141
|
-
...settings,
|
|
142
|
-
inline: true,
|
|
143
|
-
content_css: false,
|
|
144
|
-
fixed_toolbar_container: `#toolbar-${clientId}`,
|
|
145
|
-
setup: onSetup
|
|
62
|
+
),
|
|
63
|
+
isOpen && /* @__PURE__ */ jsx(
|
|
64
|
+
ModalEdit,
|
|
65
|
+
{
|
|
66
|
+
clientId,
|
|
67
|
+
content,
|
|
68
|
+
onClose: () => {
|
|
69
|
+
setOpen(false);
|
|
70
|
+
if (editButtonRef.current) {
|
|
71
|
+
editButtonRef.current.focus();
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
onChange: (newContent) => setAttributes({ content: newContent })
|
|
146
75
|
}
|
|
147
|
-
|
|
148
|
-
}
|
|
149
|
-
function onReadyStateChange() {
|
|
150
|
-
if (document.readyState === "complete") {
|
|
151
|
-
initialize();
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
if (document.readyState === "complete") {
|
|
155
|
-
initialize();
|
|
156
|
-
} else {
|
|
157
|
-
document.addEventListener("readystatechange", onReadyStateChange);
|
|
158
|
-
}
|
|
159
|
-
return () => {
|
|
160
|
-
document.removeEventListener(
|
|
161
|
-
"readystatechange",
|
|
162
|
-
onReadyStateChange
|
|
163
|
-
);
|
|
164
|
-
wp.oldEditor.remove(`editor-${clientId}`);
|
|
165
|
-
didMountRef.current = false;
|
|
166
|
-
};
|
|
167
|
-
}, []);
|
|
168
|
-
function focus() {
|
|
169
|
-
const editor = window.tinymce.get(`editor-${clientId}`);
|
|
170
|
-
if (editor) {
|
|
171
|
-
editor.focus();
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
function onToolbarKeyDown(event) {
|
|
175
|
-
event.stopPropagation();
|
|
176
|
-
event.nativeEvent.stopImmediatePropagation();
|
|
177
|
-
}
|
|
178
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
179
|
-
/* @__PURE__ */ jsx(
|
|
180
|
-
"div",
|
|
181
|
-
{
|
|
182
|
-
id: `toolbar-${clientId}`,
|
|
183
|
-
className: "block-library-classic__toolbar",
|
|
184
|
-
onClick: focus,
|
|
185
|
-
"data-placeholder": __("Classic"),
|
|
186
|
-
onKeyDown: onToolbarKeyDown
|
|
187
|
-
},
|
|
188
|
-
"toolbar"
|
|
189
|
-
),
|
|
190
|
-
/* @__PURE__ */ jsx(
|
|
191
|
-
"div",
|
|
192
|
-
{
|
|
193
|
-
id: `editor-${clientId}`,
|
|
194
|
-
className: "wp-block-freeform block-library-rich-text__tinymce"
|
|
195
|
-
},
|
|
196
|
-
"editor"
|
|
197
|
-
)
|
|
76
|
+
)
|
|
77
|
+
] })
|
|
198
78
|
] });
|
|
199
79
|
}
|
|
200
80
|
export {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/freeform/edit.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport {\n\tBlockControls,\n\tuseBlockProps,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport {
|
|
5
|
-
"mappings": ";AAGA;AAAA,EACC;AAAA,EACA;AAAA,EACA,SAAS;AAAA,OACH;AACP,SAAS,
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport {\n\tBlockControls,\n\tBlockIcon,\n\tuseBlockProps,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { useSelect } from '@wordpress/data';\nimport {\n\tButton,\n\tPlaceholder,\n\tToolbarGroup,\n\tToolbarButton,\n} from '@wordpress/components';\nimport { useState, useRef, RawHTML } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { classic } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport ConvertToBlocksButton from './convert-to-blocks-button';\nimport ModalEdit from './modal';\n\nexport default function FreeformEdit( {\n\tattributes,\n\tsetAttributes,\n\tclientId,\n} ) {\n\tconst { content } = attributes;\n\tconst [ isOpen, setOpen ] = useState( false );\n\tconst editButtonRef = useRef( null );\n\n\tconst canRemove = useSelect(\n\t\t( select ) => select( blockEditorStore ).canRemoveBlock( clientId ),\n\t\t[ clientId ]\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t{ canRemove && (\n\t\t\t\t<BlockControls>\n\t\t\t\t\t<ToolbarGroup>\n\t\t\t\t\t\t<ConvertToBlocksButton clientId={ clientId } />\n\t\t\t\t\t</ToolbarGroup>\n\t\t\t\t</BlockControls>\n\t\t\t) }\n\t\t\t<BlockControls>\n\t\t\t\t<ToolbarGroup>\n\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\tref={ editButtonRef }\n\t\t\t\t\t\tonClick={ () => setOpen( true ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Edit' ) }\n\t\t\t\t\t</ToolbarButton>\n\t\t\t\t</ToolbarGroup>\n\t\t\t</BlockControls>\n\t\t\t<div { ...useBlockProps() }>\n\t\t\t\t{ content ? (\n\t\t\t\t\t<RawHTML>{ content }</RawHTML>\n\t\t\t\t) : (\n\t\t\t\t\t<Placeholder\n\t\t\t\t\t\ticon={ <BlockIcon icon={ classic } /> }\n\t\t\t\t\t\tlabel={ __( 'Classic' ) }\n\t\t\t\t\t\tinstructions={ __(\n\t\t\t\t\t\t\t'Use the classic editor to add content.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\tonClick={ () => setOpen( true ) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Edit contents' ) }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</Placeholder>\n\t\t\t\t) }\n\t\t\t\t{ isOpen && (\n\t\t\t\t\t<ModalEdit\n\t\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t\tcontent={ content }\n\t\t\t\t\t\tonClose={ () => {\n\t\t\t\t\t\t\tsetOpen( false );\n\t\t\t\t\t\t\tif ( editButtonRef.current ) {\n\t\t\t\t\t\t\t\teditButtonRef.current.focus();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tonChange={ ( newContent ) =>\n\t\t\t\t\t\t\tsetAttributes( { content: newContent } )\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</div>\n\t\t</>\n\t);\n}\n"],
|
|
5
|
+
"mappings": ";AAGA;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA,SAAS;AAAA,OACH;AACP,SAAS,iBAAiB;AAC1B;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACM;AACP,SAAS,UAAU,QAAQ,eAAe;AAC1C,SAAS,UAAU;AACnB,SAAS,eAAe;AAKxB,OAAO,2BAA2B;AAClC,OAAO,eAAe;AAiBpB,mBAII,KAcH,YAlBD;AAfa,SAAR,aAA+B;AAAA,EACrC;AAAA,EACA;AAAA,EACA;AACD,GAAI;AACH,QAAM,EAAE,QAAQ,IAAI;AACpB,QAAM,CAAE,QAAQ,OAAQ,IAAI,SAAU,KAAM;AAC5C,QAAM,gBAAgB,OAAQ,IAAK;AAEnC,QAAM,YAAY;AAAA,IACjB,CAAE,WAAY,OAAQ,gBAAiB,EAAE,eAAgB,QAAS;AAAA,IAClE,CAAE,QAAS;AAAA,EACZ;AAEA,SACC,iCACG;AAAA,iBACD,oBAAC,iBACA,8BAAC,gBACA,8BAAC,yBAAsB,UAAsB,GAC9C,GACD;AAAA,IAED,oBAAC,iBACA,8BAAC,gBACA;AAAA,MAAC;AAAA;AAAA,QACA,KAAM;AAAA,QACN,SAAU,MAAM,QAAS,IAAK;AAAA,QAE5B,aAAI,MAAO;AAAA;AAAA,IACd,GACD,GACD;AAAA,IACA,qBAAC,SAAM,GAAG,cAAc,GACrB;AAAA,gBACD,oBAAC,WAAU,mBAAS,IAEpB;AAAA,QAAC;AAAA;AAAA,UACA,MAAO,oBAAC,aAAU,MAAO,SAAU;AAAA,UACnC,OAAQ,GAAI,SAAU;AAAA,UACtB,cAAe;AAAA,YACd;AAAA,UACD;AAAA,UAEA;AAAA,YAAC;AAAA;AAAA,cACA,uBAAqB;AAAA,cACrB,SAAQ;AAAA,cACR,SAAU,MAAM,QAAS,IAAK;AAAA,cAE5B,aAAI,eAAgB;AAAA;AAAA,UACvB;AAAA;AAAA,MACD;AAAA,MAEC,UACD;AAAA,QAAC;AAAA;AAAA,UACA;AAAA,UACA;AAAA,UACA,SAAU,MAAM;AACf,oBAAS,KAAM;AACf,gBAAK,cAAc,SAAU;AAC5B,4BAAc,QAAQ,MAAM;AAAA,YAC7B;AAAA,UACD;AAAA,UACA,UAAW,CAAE,eACZ,cAAe,EAAE,SAAS,WAAW,CAAE;AAAA;AAAA,MAEzC;AAAA,OAEF;AAAA,KACD;AAEF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,19 +1,12 @@
|
|
|
1
1
|
// packages/block-library/src/freeform/modal.js
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
ToolbarButton,
|
|
6
|
-
Modal,
|
|
7
|
-
Button,
|
|
8
|
-
Flex,
|
|
9
|
-
FlexItem
|
|
10
|
-
} from "@wordpress/components";
|
|
11
|
-
import { useEffect, useState, RawHTML } from "@wordpress/element";
|
|
2
|
+
import { store } from "@wordpress/block-editor";
|
|
3
|
+
import { Modal, Button, Flex, FlexItem } from "@wordpress/components";
|
|
4
|
+
import { useEffect, useState } from "@wordpress/element";
|
|
12
5
|
import { __ } from "@wordpress/i18n";
|
|
13
6
|
import { useSelect } from "@wordpress/data";
|
|
14
7
|
import { fullscreen } from "@wordpress/icons";
|
|
15
8
|
import { useViewportMatch } from "@wordpress/compose";
|
|
16
|
-
import {
|
|
9
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
17
10
|
function ModalAuxiliaryActions({ onClick, isModalFullScreen }) {
|
|
18
11
|
const isMobileViewport = useViewportMatch("small", "<");
|
|
19
12
|
if (isMobileViewport) {
|
|
@@ -61,77 +54,61 @@ function ClassicEdit(props) {
|
|
|
61
54
|
}, []);
|
|
62
55
|
return /* @__PURE__ */ jsx("textarea", { ...props });
|
|
63
56
|
}
|
|
64
|
-
function ModalEdit(
|
|
65
|
-
const {
|
|
66
|
-
clientId,
|
|
67
|
-
attributes: { content },
|
|
68
|
-
setAttributes,
|
|
69
|
-
onReplace
|
|
70
|
-
} = props;
|
|
71
|
-
const [isOpen, setOpen] = useState(false);
|
|
57
|
+
function ModalEdit({ clientId, content, onClose, onChange }) {
|
|
72
58
|
const [isModalFullScreen, setIsModalFullScreen] = useState(false);
|
|
73
59
|
const id = `editor-${clientId}`;
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
60
|
+
return /* @__PURE__ */ jsxs(
|
|
61
|
+
Modal,
|
|
62
|
+
{
|
|
63
|
+
title: __("Classic Editor"),
|
|
64
|
+
onRequestClose: onClose,
|
|
65
|
+
shouldCloseOnClickOutside: false,
|
|
66
|
+
overlayClassName: "block-editor-freeform-modal",
|
|
67
|
+
isFullScreen: isModalFullScreen,
|
|
68
|
+
className: "block-editor-freeform-modal__content",
|
|
69
|
+
headerActions: /* @__PURE__ */ jsx(
|
|
70
|
+
ModalAuxiliaryActions,
|
|
71
|
+
{
|
|
72
|
+
onClick: () => setIsModalFullScreen(!isModalFullScreen),
|
|
73
|
+
isModalFullScreen
|
|
74
|
+
}
|
|
75
|
+
),
|
|
76
|
+
children: [
|
|
77
|
+
/* @__PURE__ */ jsx(ClassicEdit, { id, defaultValue: content }),
|
|
78
|
+
/* @__PURE__ */ jsxs(
|
|
79
|
+
Flex,
|
|
89
80
|
{
|
|
90
|
-
|
|
91
|
-
|
|
81
|
+
className: "block-editor-freeform-modal__actions",
|
|
82
|
+
justify: "flex-end",
|
|
83
|
+
expanded: false,
|
|
84
|
+
children: [
|
|
85
|
+
/* @__PURE__ */ jsx(FlexItem, { children: /* @__PURE__ */ jsx(
|
|
86
|
+
Button,
|
|
87
|
+
{
|
|
88
|
+
__next40pxDefaultSize: true,
|
|
89
|
+
variant: "tertiary",
|
|
90
|
+
onClick: onClose,
|
|
91
|
+
children: __("Cancel")
|
|
92
|
+
}
|
|
93
|
+
) }),
|
|
94
|
+
/* @__PURE__ */ jsx(FlexItem, { children: /* @__PURE__ */ jsx(
|
|
95
|
+
Button,
|
|
96
|
+
{
|
|
97
|
+
__next40pxDefaultSize: true,
|
|
98
|
+
variant: "primary",
|
|
99
|
+
onClick: () => {
|
|
100
|
+
onChange(window.wp.oldEditor.getContent(id));
|
|
101
|
+
onClose();
|
|
102
|
+
},
|
|
103
|
+
children: __("Save")
|
|
104
|
+
}
|
|
105
|
+
) })
|
|
106
|
+
]
|
|
92
107
|
}
|
|
93
|
-
)
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
Flex,
|
|
98
|
-
{
|
|
99
|
-
className: "block-editor-freeform-modal__actions",
|
|
100
|
-
justify: "flex-end",
|
|
101
|
-
expanded: false,
|
|
102
|
-
children: [
|
|
103
|
-
/* @__PURE__ */ jsx(FlexItem, { children: /* @__PURE__ */ jsx(
|
|
104
|
-
Button,
|
|
105
|
-
{
|
|
106
|
-
__next40pxDefaultSize: true,
|
|
107
|
-
variant: "tertiary",
|
|
108
|
-
onClick: onClose,
|
|
109
|
-
children: __("Cancel")
|
|
110
|
-
}
|
|
111
|
-
) }),
|
|
112
|
-
/* @__PURE__ */ jsx(FlexItem, { children: /* @__PURE__ */ jsx(
|
|
113
|
-
Button,
|
|
114
|
-
{
|
|
115
|
-
__next40pxDefaultSize: true,
|
|
116
|
-
variant: "primary",
|
|
117
|
-
onClick: () => {
|
|
118
|
-
setAttributes({
|
|
119
|
-
content: window.wp.oldEditor.getContent(
|
|
120
|
-
id
|
|
121
|
-
)
|
|
122
|
-
});
|
|
123
|
-
setOpen(false);
|
|
124
|
-
},
|
|
125
|
-
children: __("Save")
|
|
126
|
-
}
|
|
127
|
-
) })
|
|
128
|
-
]
|
|
129
|
-
}
|
|
130
|
-
)
|
|
131
|
-
]
|
|
132
|
-
}
|
|
133
|
-
)
|
|
134
|
-
] });
|
|
108
|
+
)
|
|
109
|
+
]
|
|
110
|
+
}
|
|
111
|
+
);
|
|
135
112
|
}
|
|
136
113
|
export {
|
|
137
114
|
ModalEdit as default
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/freeform/modal.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport {
|
|
5
|
-
"mappings": ";AAGA,SAAS,
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { store } from '@wordpress/block-editor';\nimport { Modal, Button, Flex, FlexItem } from '@wordpress/components';\nimport { useEffect, useState } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { fullscreen } from '@wordpress/icons';\nimport { useViewportMatch } from '@wordpress/compose';\n\nfunction ModalAuxiliaryActions( { onClick, isModalFullScreen } ) {\n\t// 'small' to match the rules in editor.scss.\n\tconst isMobileViewport = useViewportMatch( 'small', '<' );\n\tif ( isMobileViewport ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<Button\n\t\t\tsize=\"compact\"\n\t\t\tonClick={ onClick }\n\t\t\ticon={ fullscreen }\n\t\t\tisPressed={ isModalFullScreen }\n\t\t\tlabel={\n\t\t\t\tisModalFullScreen\n\t\t\t\t\t? __( 'Exit fullscreen' )\n\t\t\t\t\t: __( 'Enter fullscreen' )\n\t\t\t}\n\t\t/>\n\t);\n}\n\nfunction ClassicEdit( props ) {\n\tconst styles = useSelect(\n\t\t( select ) => select( store ).getSettings().styles\n\t);\n\tuseEffect( () => {\n\t\tconst { baseURL, suffix, settings } = window.wpEditorL10n.tinymce;\n\n\t\twindow.tinymce.EditorManager.overrideDefaults( {\n\t\t\tbase_url: baseURL,\n\t\t\tsuffix,\n\t\t} );\n\n\t\twindow.wp.oldEditor.initialize( props.id, {\n\t\t\ttinymce: {\n\t\t\t\t...settings,\n\t\t\t\tsetup( editor ) {\n\t\t\t\t\teditor.on( 'init', () => {\n\t\t\t\t\t\tconst doc = editor.getDoc();\n\t\t\t\t\t\tstyles.forEach( ( { css } ) => {\n\t\t\t\t\t\t\tconst styleEl = doc.createElement( 'style' );\n\t\t\t\t\t\t\tstyleEl.innerHTML = css;\n\t\t\t\t\t\t\tdoc.head.appendChild( styleEl );\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\n\t\treturn () => {\n\t\t\twindow.wp.oldEditor.remove( props.id );\n\t\t};\n\t}, [] );\n\n\treturn <textarea { ...props } />;\n}\n\nexport default function ModalEdit( { clientId, content, onClose, onChange } ) {\n\tconst [ isModalFullScreen, setIsModalFullScreen ] = useState( false );\n\tconst id = `editor-${ clientId }`;\n\n\treturn (\n\t\t<Modal\n\t\t\ttitle={ __( 'Classic Editor' ) }\n\t\t\tonRequestClose={ onClose }\n\t\t\tshouldCloseOnClickOutside={ false }\n\t\t\toverlayClassName=\"block-editor-freeform-modal\"\n\t\t\tisFullScreen={ isModalFullScreen }\n\t\t\tclassName=\"block-editor-freeform-modal__content\"\n\t\t\theaderActions={\n\t\t\t\t<ModalAuxiliaryActions\n\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\tsetIsModalFullScreen( ! isModalFullScreen )\n\t\t\t\t\t}\n\t\t\t\t\tisModalFullScreen={ isModalFullScreen }\n\t\t\t\t/>\n\t\t\t}\n\t\t>\n\t\t\t<ClassicEdit id={ id } defaultValue={ content } />\n\t\t\t<Flex\n\t\t\t\tclassName=\"block-editor-freeform-modal__actions\"\n\t\t\t\tjustify=\"flex-end\"\n\t\t\t\texpanded={ false }\n\t\t\t>\n\t\t\t\t<FlexItem>\n\t\t\t\t\t<Button\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\tonClick={ onClose }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Cancel' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t</FlexItem>\n\t\t\t\t<FlexItem>\n\t\t\t\t\t<Button\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\tonChange( window.wp.oldEditor.getContent( id ) );\n\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t} }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Save' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t</FlexItem>\n\t\t\t</Flex>\n\t\t</Modal>\n\t);\n}\n"],
|
|
5
|
+
"mappings": ";AAGA,SAAS,aAAa;AACtB,SAAS,OAAO,QAAQ,MAAM,gBAAgB;AAC9C,SAAS,WAAW,gBAAgB;AACpC,SAAS,UAAU;AACnB,SAAS,iBAAiB;AAC1B,SAAS,kBAAkB;AAC3B,SAAS,wBAAwB;AAU/B,cAwEC,YAxED;AARF,SAAS,sBAAuB,EAAE,SAAS,kBAAkB,GAAI;AAEhE,QAAM,mBAAmB,iBAAkB,SAAS,GAAI;AACxD,MAAK,kBAAmB;AACvB,WAAO;AAAA,EACR;AAEA,SACC;AAAA,IAAC;AAAA;AAAA,MACA,MAAK;AAAA,MACL;AAAA,MACA,MAAO;AAAA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AU,MACT,qBAAsB,CAAE,iBAAkB;AAAA,UAE3C;AAAA;AAAA,MACD;AAAA,MAGD;AAAA,4BAAC,eAAY,IAAU,cAAe,SAAU;AAAA,QAChD;AAAA,UAAC;AAAA;AAAA,YACA,WAAU;AAAA,YACV,SAAQ;AAAA,YACR,UAAW;AAAA,YAEX;AAAA,kCAAC,YACA;AAAA,gBAAC;AAAA;AAAA,kBACA,uBAAqB;AAAA,kBACrB,SAAQ;AAAA,kBACR,SAAU;AAAA,kBAER,aAAI,QAAS;AAAA;AAAA,cAChB,GACD;AAAA,cACA,oBAAC,YACA;AAAA,gBAAC;AAAA;AAAA,kBACA,uBAAqB;AAAA,kBACrB,SAAQ;AAAA,kBACR,SAAU,MAAM;AACf,6BAAU,OAAO,GAAG,UAAU,WAAY,EAAG,CAAE;AAC/C,4BAAQ;AAAA,kBACT;AAAA,kBAEE,aAAI,MAAO;AAAA;AAAA,cACd,GACD;AAAA;AAAA;AAAA,QACD;AAAA;AAAA;AAAA,EACD;AAEF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/build-module/index.js
CHANGED
|
@@ -241,10 +241,10 @@ var getAllBlocks = () => {
|
|
|
241
241
|
termsQuery,
|
|
242
242
|
termTemplate,
|
|
243
243
|
queryTitle,
|
|
244
|
-
postAuthorBiography
|
|
244
|
+
postAuthorBiography,
|
|
245
|
+
breadcrumbs
|
|
245
246
|
];
|
|
246
247
|
if (window?.__experimentalEnableBlockExperiments) {
|
|
247
|
-
blocks.push(breadcrumbs);
|
|
248
248
|
blocks.push(tab);
|
|
249
249
|
blocks.push(tabs);
|
|
250
250
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/index.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport {\n\tsetDefaultBlockName,\n\tsetFreeformContentHandlerName,\n\tsetUnregisteredTypeHandlerName,\n\tsetGroupingBlockName,\n\tregisterBlockType,\n\tstore as blocksStore,\n} from '@wordpress/blocks';\nimport { select } from '@wordpress/data';\nimport { useBlockProps } from '@wordpress/block-editor';\nimport { useServerSideRender } from '@wordpress/server-side-render';\nimport { __, sprintf } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\n// When IS_GUTENBERG_PLUGIN is set to false, imports of experimental blocks\n// are transformed by packages/block-library/src/index.js as follows:\n// import * as experimentalBlock from './experimental-block'\n// becomes\n// const experimentalBlock = null;\n// This enables webpack to eliminate the experimental blocks code from the\n// production build to make the final bundle smaller.\n//\n// See https://github.com/WordPress/gutenberg/pull/40655 for more context.\nimport * as accordion from './accordion';\nimport * as accordionItem from './accordion-item';\nimport * as accordionHeading from './accordion-heading';\nimport * as accordionPanel from './accordion-panel';\nimport * as archives from './archives';\nimport * as avatar from './avatar';\nimport * as audio from './audio';\nimport * as breadcrumbs from './breadcrumbs';\nimport * as button from './button';\nimport * as buttons from './buttons';\nimport * as calendar from './calendar';\nimport * as categories from './categories';\nimport * as classic from './freeform';\nimport * as code from './code';\nimport * as column from './column';\nimport * as columns from './columns';\nimport * as comments from './comments';\nimport * as commentAuthorAvatar from './comment-author-avatar';\nimport * as commentAuthorName from './comment-author-name';\nimport * as commentContent from './comment-content';\nimport * as commentDate from './comment-date';\nimport * as commentEditLink from './comment-edit-link';\nimport * as commentReplyLink from './comment-reply-link';\nimport * as commentTemplate from './comment-template';\nimport * as commentsPaginationPrevious from './comments-pagination-previous';\nimport * as commentsPagination from './comments-pagination';\nimport * as commentsPaginationNext from './comments-pagination-next';\nimport * as commentsPaginationNumbers from './comments-pagination-numbers';\nimport * as commentsTitle from './comments-title';\nimport * as cover from './cover';\nimport * as details from './details';\nimport * as embed from './embed';\nimport * as file from './file';\nimport * as form from './form';\nimport * as formInput from './form-input';\nimport * as formSubmitButton from './form-submit-button';\nimport * as formSubmissionNotification from './form-submission-notification';\nimport * as gallery from './gallery';\nimport * as group from './group';\nimport * as heading from './heading';\nimport * as homeLink from './home-link';\nimport * as html from './html';\nimport * as image from './image';\nimport * as latestComments from './latest-comments';\nimport * as latestPosts from './latest-posts';\nimport * as list from './list';\nimport * as math from './math';\nimport * as listItem from './list-item';\nimport * as logInOut from './loginout';\nimport * as mediaText from './media-text';\nimport * as missing from './missing';\nimport * as more from './more';\nimport * as navigation from './navigation';\nimport * as navigationLink from './navigation-link';\nimport * as navigationSubmenu from './navigation-submenu';\nimport * as nextpage from './nextpage';\nimport * as navigationOverlayClose from './navigation-overlay-close';\nimport * as pattern from './pattern';\nimport * as pageList from './page-list';\nimport * as pageListItem from './page-list-item';\nimport * as paragraph from './paragraph';\nimport * as postAuthor from './post-author';\nimport * as postAuthorName from './post-author-name';\nimport * as postAuthorBiography from './post-author-biography';\nimport * as postComment from './post-comment';\nimport * as postCommentsCount from './post-comments-count';\nimport * as postCommentsForm from './post-comments-form';\nimport * as postCommentsLink from './post-comments-link';\nimport * as postContent from './post-content';\nimport * as postDate from './post-date';\nimport * as postExcerpt from './post-excerpt';\nimport * as postFeaturedImage from './post-featured-image';\nimport * as postNavigationLink from './post-navigation-link';\nimport * as postTemplate from './post-template';\nimport * as postTerms from './post-terms';\nimport * as postTimeToRead from './post-time-to-read';\nimport * as postTitle from './post-title';\nimport * as preformatted from './preformatted';\nimport * as pullquote from './pullquote';\nimport * as query from './query';\nimport * as queryNoResults from './query-no-results';\nimport * as queryPagination from './query-pagination';\nimport * as queryPaginationNext from './query-pagination-next';\nimport * as queryPaginationNumbers from './query-pagination-numbers';\nimport * as queryPaginationPrevious from './query-pagination-previous';\nimport * as queryTitle from './query-title';\nimport * as queryTotal from './query-total';\nimport * as quote from './quote';\nimport * as reusableBlock from './block';\nimport * as readMore from './read-more';\nimport * as rss from './rss';\nimport * as search from './search';\nimport * as separator from './separator';\nimport * as shortcode from './shortcode';\nimport * as siteLogo from './site-logo';\nimport * as siteTagline from './site-tagline';\nimport * as siteTitle from './site-title';\nimport * as socialLink from './social-link';\nimport * as socialLinks from './social-links';\nimport * as spacer from './spacer';\nimport * as tab from './tab';\nimport * as table from './table';\nimport * as tableOfContents from './table-of-contents';\nimport * as tabs from './tabs';\nimport * as tagCloud from './tag-cloud';\nimport * as templatePart from './template-part';\nimport * as termCount from './term-count';\nimport * as termDescription from './term-description';\nimport * as termName from './term-name';\nimport * as termsQuery from './terms-query';\nimport * as termTemplate from './term-template';\nimport * as textColumns from './text-columns';\nimport * as verse from './verse';\nimport * as video from './video';\nimport * as footnotes from './footnotes';\n\nimport isBlockMetadataExperimental from './utils/is-block-metadata-experimental';\nimport { unlock } from './lock-unlock';\n\n/**\n * Function to get all the block-library blocks in an array\n */\nconst getAllBlocks = () => {\n\tconst blocks = [\n\t\t// Common blocks are grouped at the top to prioritize their display\n\t\t// in various contexts \u2014 like the inserter and auto-complete components.\n\t\tparagraph,\n\t\timage,\n\t\theading,\n\t\tgallery,\n\t\tlist,\n\t\tlistItem,\n\t\tquote,\n\n\t\t// Register all remaining core blocks.\n\t\taccordion,\n\t\taccordionItem,\n\t\taccordionHeading,\n\t\taccordionPanel,\n\t\tarchives,\n\t\taudio,\n\t\tbutton,\n\t\tbuttons,\n\t\tcalendar,\n\t\tcategories,\n\t\tcode,\n\t\tcolumn,\n\t\tcolumns,\n\t\tcommentAuthorAvatar,\n\t\tcover,\n\t\tdetails,\n\t\tembed,\n\t\tfile,\n\t\tgroup,\n\t\thtml,\n\t\tmath,\n\t\tlatestComments,\n\t\tlatestPosts,\n\t\tmediaText,\n\t\tmissing,\n\t\tmore,\n\t\tnextpage,\n\t\tpageList,\n\t\tpageListItem,\n\t\tpattern,\n\t\tpreformatted,\n\t\tpullquote,\n\t\treusableBlock,\n\t\trss,\n\t\tsearch,\n\t\tseparator,\n\t\tshortcode,\n\t\tsocialLink,\n\t\tsocialLinks,\n\t\tspacer,\n\t\ttable,\n\t\ttagCloud,\n\t\ttextColumns,\n\t\tverse,\n\t\tvideo,\n\t\tfootnotes,\n\n\t\t// theme blocks\n\t\tnavigation,\n\t\tnavigationLink,\n\t\tnavigationSubmenu,\n\t\tsiteLogo,\n\t\tsiteTitle,\n\t\tsiteTagline,\n\t\tquery,\n\t\ttemplatePart,\n\t\tavatar,\n\t\tpostTitle,\n\t\tpostExcerpt,\n\t\tpostFeaturedImage,\n\t\tpostContent,\n\t\tpostAuthor,\n\t\tpostAuthorName,\n\t\tpostComment,\n\t\tpostCommentsCount,\n\t\tpostCommentsLink,\n\t\tpostDate,\n\t\tpostTerms,\n\t\tpostNavigationLink,\n\t\tpostTemplate,\n\t\tpostTimeToRead,\n\t\tqueryPagination,\n\t\tqueryPaginationNext,\n\t\tqueryPaginationNumbers,\n\t\tqueryPaginationPrevious,\n\t\tqueryNoResults,\n\t\tqueryTotal,\n\t\treadMore,\n\t\tcomments,\n\t\tcommentAuthorName,\n\t\tcommentContent,\n\t\tcommentDate,\n\t\tcommentEditLink,\n\t\tcommentReplyLink,\n\t\tcommentTemplate,\n\t\tcommentsTitle,\n\t\tcommentsPagination,\n\t\tcommentsPaginationNext,\n\t\tcommentsPaginationNumbers,\n\t\tcommentsPaginationPrevious,\n\t\tpostCommentsForm,\n\t\ttableOfContents,\n\t\thomeLink,\n\t\tlogInOut,\n\t\ttermCount,\n\t\ttermDescription,\n\t\ttermName,\n\t\ttermsQuery,\n\t\ttermTemplate,\n\t\tqueryTitle,\n\t\tpostAuthorBiography,\n\t];\n\n\tif ( window?.__experimentalEnableBlockExperiments ) {\n\t\tblocks.push( breadcrumbs );\n\t\tblocks.push( tab );\n\t\tblocks.push( tabs );\n\t}\n\n\tif ( window?.__experimentalEnableFormBlocks ) {\n\t\tblocks.push( form );\n\t\tblocks.push( formInput );\n\t\tblocks.push( formSubmitButton );\n\t\tblocks.push( formSubmissionNotification );\n\t}\n\n\tif ( window?.__experimentalNavigationOverlays ) {\n\t\tblocks.push( navigationOverlayClose );\n\t}\n\n\t// When in a WordPress context, conditionally\n\t// add the classic block and TinyMCE editor\n\t// under any of the following conditions:\n\t// - the current post contains a classic block\n\t// - the experiment to disable TinyMCE isn't active.\n\t// - a query argument specifies that TinyMCE should be loaded\n\tif (\n\t\twindow?.wp?.oldEditor &&\n\t\t( window?.wp?.needsClassicBlock ||\n\t\t\t! window?.__experimentalDisableTinymce ||\n\t\t\t!! new URLSearchParams( window?.location?.search ).get(\n\t\t\t\t'requiresTinymce'\n\t\t\t) )\n\t) {\n\t\tblocks.push( classic );\n\t}\n\n\treturn blocks.filter( Boolean );\n};\n\n/**\n * Function to get all the core blocks in an array.\n *\n * @example\n * ```js\n * import { __experimentalGetCoreBlocks } from '@wordpress/block-library';\n *\n * const coreBlocks = __experimentalGetCoreBlocks();\n * ```\n */\nexport const __experimentalGetCoreBlocks = () =>\n\tgetAllBlocks().filter(\n\t\t( { metadata } ) => ! isBlockMetadataExperimental( metadata )\n\t);\n\n/**\n * Function to register core blocks provided by the block editor.\n *\n * @param {Array} blocks An optional array of the core blocks being registered.\n *\n * @example\n * ```js\n * import { registerCoreBlocks } from '@wordpress/block-library';\n *\n * registerCoreBlocks();\n * ```\n */\nexport const registerCoreBlocks = (\n\tblocks = __experimentalGetCoreBlocks()\n) => {\n\tblocks.forEach( ( { init } ) => init() );\n\n\t// Auto-register PHP-only blocks with ServerSideRender\n\tif ( window.__unstableAutoRegisterBlocks ) {\n\t\twindow.__unstableAutoRegisterBlocks.forEach( ( blockName ) => {\n\t\t\tconst bootstrappedBlockType = unlock(\n\t\t\t\tselect( blocksStore )\n\t\t\t).getBootstrappedBlockType( blockName );\n\n\t\t\tregisterBlockType( blockName, {\n\t\t\t\t// Use all metadata from PHP registration,\n\t\t\t\t// but fall back title to block name if not provided,\n\t\t\t\t// ensure minimum apiVersion 3 for block wrapper support,\n\t\t\t\t// and override with a ServerSideRender-based edit function.\n\t\t\t\t...bootstrappedBlockType,\n\t\t\t\ttitle: bootstrappedBlockType?.title || blockName,\n\t\t\t\t...( ( bootstrappedBlockType?.apiVersion ?? 0 ) < 3 && {\n\t\t\t\t\tapiVersion: 3,\n\t\t\t\t} ),\n\t\t\t\tedit: function Edit( { attributes } ) {\n\t\t\t\t\tconst blockProps = useBlockProps();\n\t\t\t\t\tconst { content, status, error } = useServerSideRender( {\n\t\t\t\t\t\tblock: blockName,\n\t\t\t\t\t\tattributes,\n\t\t\t\t\t} );\n\n\t\t\t\t\tif ( status === 'loading' ) {\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<div { ...blockProps }>{ __( 'Loading\u2026' ) }</div>\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( status === 'error' ) {\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<div { ...blockProps }>\n\t\t\t\t\t\t\t\t{ sprintf(\n\t\t\t\t\t\t\t\t\t/* translators: %s: error message describing the problem */\n\t\t\t\t\t\t\t\t\t__( 'Error loading block: %s' ),\n\t\t\t\t\t\t\t\t\terror\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t{ ...blockProps }\n\t\t\t\t\t\t\tdangerouslySetInnerHTML={ {\n\t\t\t\t\t\t\t\t__html: content || '',\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\tsave: () => null,\n\t\t\t} );\n\t\t} );\n\t}\n\n\tsetDefaultBlockName( paragraph.name );\n\tif (\n\t\twindow.wp &&\n\t\twindow.wp.oldEditor &&\n\t\tblocks.some( ( { name } ) => name === classic.name )\n\t) {\n\t\tsetFreeformContentHandlerName( classic.name );\n\t}\n\tsetUnregisteredTypeHandlerName( missing.name );\n\tsetGroupingBlockName( group.name );\n};\n\n/**\n * Function to register experimental core blocks depending on editor settings.\n *\n * @param {boolean} enableFSEBlocks Whether to enable the full site editing blocks.\n * @example\n * ```js\n * import { __experimentalRegisterExperimentalCoreBlocks } from '@wordpress/block-library';\n *\n * __experimentalRegisterExperimentalCoreBlocks( settings );\n * ```\n */\nexport const __experimentalRegisterExperimentalCoreBlocks =\n\tglobalThis.IS_GUTENBERG_PLUGIN\n\t\t? ( { enableFSEBlocks } = {} ) => {\n\t\t\t\tconst enabledExperiments = [ enableFSEBlocks ? 'fse' : null ];\n\t\t\t\tgetAllBlocks()\n\t\t\t\t\t.filter( ( { metadata } ) =>\n\t\t\t\t\t\tisBlockMetadataExperimental( metadata )\n\t\t\t\t\t)\n\t\t\t\t\t.filter(\n\t\t\t\t\t\t( { metadata: { __experimental } } ) =>\n\t\t\t\t\t\t\t__experimental === true ||\n\t\t\t\t\t\t\tenabledExperiments.includes( __experimental )\n\t\t\t\t\t)\n\t\t\t\t\t.forEach( ( { init } ) => init() );\n\t\t }\n\t\t: undefined;\n\nexport { privateApis } from './private-apis';\n"],
|
|
5
|
-
"mappings": ";AAGA;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,SAAS;AAAA,OACH;AACP,SAAS,cAAc;AACvB,SAAS,qBAAqB;AAC9B,SAAS,2BAA2B;AACpC,SAAS,IAAI,eAAe;AAc5B,YAAY,eAAe;AAC3B,YAAY,mBAAmB;AAC/B,YAAY,sBAAsB;AAClC,YAAY,oBAAoB;AAChC,YAAY,cAAc;AAC1B,YAAY,YAAY;AACxB,YAAY,WAAW;AACvB,YAAY,iBAAiB;AAC7B,YAAY,YAAY;AACxB,YAAY,aAAa;AACzB,YAAY,cAAc;AAC1B,YAAY,gBAAgB;AAC5B,YAAY,aAAa;AACzB,YAAY,UAAU;AACtB,YAAY,YAAY;AACxB,YAAY,aAAa;AACzB,YAAY,cAAc;AAC1B,YAAY,yBAAyB;AACrC,YAAY,uBAAuB;AACnC,YAAY,oBAAoB;AAChC,YAAY,iBAAiB;AAC7B,YAAY,qBAAqB;AACjC,YAAY,sBAAsB;AAClC,YAAY,qBAAqB;AACjC,YAAY,gCAAgC;AAC5C,YAAY,wBAAwB;AACpC,YAAY,4BAA4B;AACxC,Y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,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD;AAEA,MAAK,QAAQ,sCAAuC;AACnD,WAAO,KAAM,
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport {\n\tsetDefaultBlockName,\n\tsetFreeformContentHandlerName,\n\tsetUnregisteredTypeHandlerName,\n\tsetGroupingBlockName,\n\tregisterBlockType,\n\tstore as blocksStore,\n} from '@wordpress/blocks';\nimport { select } from '@wordpress/data';\nimport { useBlockProps } from '@wordpress/block-editor';\nimport { useServerSideRender } from '@wordpress/server-side-render';\nimport { __, sprintf } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\n// When IS_GUTENBERG_PLUGIN is set to false, imports of experimental blocks\n// are transformed by packages/block-library/src/index.js as follows:\n// import * as experimentalBlock from './experimental-block'\n// becomes\n// const experimentalBlock = null;\n// This enables webpack to eliminate the experimental blocks code from the\n// production build to make the final bundle smaller.\n//\n// See https://github.com/WordPress/gutenberg/pull/40655 for more context.\nimport * as accordion from './accordion';\nimport * as accordionItem from './accordion-item';\nimport * as accordionHeading from './accordion-heading';\nimport * as accordionPanel from './accordion-panel';\nimport * as archives from './archives';\nimport * as avatar from './avatar';\nimport * as audio from './audio';\nimport * as breadcrumbs from './breadcrumbs';\nimport * as button from './button';\nimport * as buttons from './buttons';\nimport * as calendar from './calendar';\nimport * as categories from './categories';\nimport * as classic from './freeform';\nimport * as code from './code';\nimport * as column from './column';\nimport * as columns from './columns';\nimport * as comments from './comments';\nimport * as commentAuthorAvatar from './comment-author-avatar';\nimport * as commentAuthorName from './comment-author-name';\nimport * as commentContent from './comment-content';\nimport * as commentDate from './comment-date';\nimport * as commentEditLink from './comment-edit-link';\nimport * as commentReplyLink from './comment-reply-link';\nimport * as commentTemplate from './comment-template';\nimport * as commentsPaginationPrevious from './comments-pagination-previous';\nimport * as commentsPagination from './comments-pagination';\nimport * as commentsPaginationNext from './comments-pagination-next';\nimport * as commentsPaginationNumbers from './comments-pagination-numbers';\nimport * as commentsTitle from './comments-title';\nimport * as cover from './cover';\nimport * as details from './details';\nimport * as embed from './embed';\nimport * as file from './file';\nimport * as form from './form';\nimport * as formInput from './form-input';\nimport * as formSubmitButton from './form-submit-button';\nimport * as formSubmissionNotification from './form-submission-notification';\nimport * as gallery from './gallery';\nimport * as group from './group';\nimport * as heading from './heading';\nimport * as homeLink from './home-link';\nimport * as html from './html';\nimport * as image from './image';\nimport * as latestComments from './latest-comments';\nimport * as latestPosts from './latest-posts';\nimport * as list from './list';\nimport * as math from './math';\nimport * as listItem from './list-item';\nimport * as logInOut from './loginout';\nimport * as mediaText from './media-text';\nimport * as missing from './missing';\nimport * as more from './more';\nimport * as navigation from './navigation';\nimport * as navigationLink from './navigation-link';\nimport * as navigationSubmenu from './navigation-submenu';\nimport * as nextpage from './nextpage';\nimport * as navigationOverlayClose from './navigation-overlay-close';\nimport * as pattern from './pattern';\nimport * as pageList from './page-list';\nimport * as pageListItem from './page-list-item';\nimport * as paragraph from './paragraph';\nimport * as postAuthor from './post-author';\nimport * as postAuthorName from './post-author-name';\nimport * as postAuthorBiography from './post-author-biography';\nimport * as postComment from './post-comment';\nimport * as postCommentsCount from './post-comments-count';\nimport * as postCommentsForm from './post-comments-form';\nimport * as postCommentsLink from './post-comments-link';\nimport * as postContent from './post-content';\nimport * as postDate from './post-date';\nimport * as postExcerpt from './post-excerpt';\nimport * as postFeaturedImage from './post-featured-image';\nimport * as postNavigationLink from './post-navigation-link';\nimport * as postTemplate from './post-template';\nimport * as postTerms from './post-terms';\nimport * as postTimeToRead from './post-time-to-read';\nimport * as postTitle from './post-title';\nimport * as preformatted from './preformatted';\nimport * as pullquote from './pullquote';\nimport * as query from './query';\nimport * as queryNoResults from './query-no-results';\nimport * as queryPagination from './query-pagination';\nimport * as queryPaginationNext from './query-pagination-next';\nimport * as queryPaginationNumbers from './query-pagination-numbers';\nimport * as queryPaginationPrevious from './query-pagination-previous';\nimport * as queryTitle from './query-title';\nimport * as queryTotal from './query-total';\nimport * as quote from './quote';\nimport * as reusableBlock from './block';\nimport * as readMore from './read-more';\nimport * as rss from './rss';\nimport * as search from './search';\nimport * as separator from './separator';\nimport * as shortcode from './shortcode';\nimport * as siteLogo from './site-logo';\nimport * as siteTagline from './site-tagline';\nimport * as siteTitle from './site-title';\nimport * as socialLink from './social-link';\nimport * as socialLinks from './social-links';\nimport * as spacer from './spacer';\nimport * as tab from './tab';\nimport * as table from './table';\nimport * as tableOfContents from './table-of-contents';\nimport * as tabs from './tabs';\nimport * as tagCloud from './tag-cloud';\nimport * as templatePart from './template-part';\nimport * as termCount from './term-count';\nimport * as termDescription from './term-description';\nimport * as termName from './term-name';\nimport * as termsQuery from './terms-query';\nimport * as termTemplate from './term-template';\nimport * as textColumns from './text-columns';\nimport * as verse from './verse';\nimport * as video from './video';\nimport * as footnotes from './footnotes';\n\nimport isBlockMetadataExperimental from './utils/is-block-metadata-experimental';\nimport { unlock } from './lock-unlock';\n\n/**\n * Function to get all the block-library blocks in an array\n */\nconst getAllBlocks = () => {\n\tconst blocks = [\n\t\t// Common blocks are grouped at the top to prioritize their display\n\t\t// in various contexts \u2014 like the inserter and auto-complete components.\n\t\tparagraph,\n\t\timage,\n\t\theading,\n\t\tgallery,\n\t\tlist,\n\t\tlistItem,\n\t\tquote,\n\n\t\t// Register all remaining core blocks.\n\t\taccordion,\n\t\taccordionItem,\n\t\taccordionHeading,\n\t\taccordionPanel,\n\t\tarchives,\n\t\taudio,\n\t\tbutton,\n\t\tbuttons,\n\t\tcalendar,\n\t\tcategories,\n\t\tcode,\n\t\tcolumn,\n\t\tcolumns,\n\t\tcommentAuthorAvatar,\n\t\tcover,\n\t\tdetails,\n\t\tembed,\n\t\tfile,\n\t\tgroup,\n\t\thtml,\n\t\tmath,\n\t\tlatestComments,\n\t\tlatestPosts,\n\t\tmediaText,\n\t\tmissing,\n\t\tmore,\n\t\tnextpage,\n\t\tpageList,\n\t\tpageListItem,\n\t\tpattern,\n\t\tpreformatted,\n\t\tpullquote,\n\t\treusableBlock,\n\t\trss,\n\t\tsearch,\n\t\tseparator,\n\t\tshortcode,\n\t\tsocialLink,\n\t\tsocialLinks,\n\t\tspacer,\n\t\ttable,\n\t\ttagCloud,\n\t\ttextColumns,\n\t\tverse,\n\t\tvideo,\n\t\tfootnotes,\n\n\t\t// theme blocks\n\t\tnavigation,\n\t\tnavigationLink,\n\t\tnavigationSubmenu,\n\t\tsiteLogo,\n\t\tsiteTitle,\n\t\tsiteTagline,\n\t\tquery,\n\t\ttemplatePart,\n\t\tavatar,\n\t\tpostTitle,\n\t\tpostExcerpt,\n\t\tpostFeaturedImage,\n\t\tpostContent,\n\t\tpostAuthor,\n\t\tpostAuthorName,\n\t\tpostComment,\n\t\tpostCommentsCount,\n\t\tpostCommentsLink,\n\t\tpostDate,\n\t\tpostTerms,\n\t\tpostNavigationLink,\n\t\tpostTemplate,\n\t\tpostTimeToRead,\n\t\tqueryPagination,\n\t\tqueryPaginationNext,\n\t\tqueryPaginationNumbers,\n\t\tqueryPaginationPrevious,\n\t\tqueryNoResults,\n\t\tqueryTotal,\n\t\treadMore,\n\t\tcomments,\n\t\tcommentAuthorName,\n\t\tcommentContent,\n\t\tcommentDate,\n\t\tcommentEditLink,\n\t\tcommentReplyLink,\n\t\tcommentTemplate,\n\t\tcommentsTitle,\n\t\tcommentsPagination,\n\t\tcommentsPaginationNext,\n\t\tcommentsPaginationNumbers,\n\t\tcommentsPaginationPrevious,\n\t\tpostCommentsForm,\n\t\ttableOfContents,\n\t\thomeLink,\n\t\tlogInOut,\n\t\ttermCount,\n\t\ttermDescription,\n\t\ttermName,\n\t\ttermsQuery,\n\t\ttermTemplate,\n\t\tqueryTitle,\n\t\tpostAuthorBiography,\n\t\tbreadcrumbs,\n\t];\n\n\tif ( window?.__experimentalEnableBlockExperiments ) {\n\t\tblocks.push( tab );\n\t\tblocks.push( tabs );\n\t}\n\n\tif ( window?.__experimentalEnableFormBlocks ) {\n\t\tblocks.push( form );\n\t\tblocks.push( formInput );\n\t\tblocks.push( formSubmitButton );\n\t\tblocks.push( formSubmissionNotification );\n\t}\n\n\tif ( window?.__experimentalNavigationOverlays ) {\n\t\tblocks.push( navigationOverlayClose );\n\t}\n\n\t// When in a WordPress context, conditionally\n\t// add the classic block and TinyMCE editor\n\t// under any of the following conditions:\n\t// - the current post contains a classic block\n\t// - the experiment to disable TinyMCE isn't active.\n\t// - a query argument specifies that TinyMCE should be loaded\n\tif (\n\t\twindow?.wp?.oldEditor &&\n\t\t( window?.wp?.needsClassicBlock ||\n\t\t\t! window?.__experimentalDisableTinymce ||\n\t\t\t!! new URLSearchParams( window?.location?.search ).get(\n\t\t\t\t'requiresTinymce'\n\t\t\t) )\n\t) {\n\t\tblocks.push( classic );\n\t}\n\n\treturn blocks.filter( Boolean );\n};\n\n/**\n * Function to get all the core blocks in an array.\n *\n * @example\n * ```js\n * import { __experimentalGetCoreBlocks } from '@wordpress/block-library';\n *\n * const coreBlocks = __experimentalGetCoreBlocks();\n * ```\n */\nexport const __experimentalGetCoreBlocks = () =>\n\tgetAllBlocks().filter(\n\t\t( { metadata } ) => ! isBlockMetadataExperimental( metadata )\n\t);\n\n/**\n * Function to register core blocks provided by the block editor.\n *\n * @param {Array} blocks An optional array of the core blocks being registered.\n *\n * @example\n * ```js\n * import { registerCoreBlocks } from '@wordpress/block-library';\n *\n * registerCoreBlocks();\n * ```\n */\nexport const registerCoreBlocks = (\n\tblocks = __experimentalGetCoreBlocks()\n) => {\n\tblocks.forEach( ( { init } ) => init() );\n\n\t// Auto-register PHP-only blocks with ServerSideRender\n\tif ( window.__unstableAutoRegisterBlocks ) {\n\t\twindow.__unstableAutoRegisterBlocks.forEach( ( blockName ) => {\n\t\t\tconst bootstrappedBlockType = unlock(\n\t\t\t\tselect( blocksStore )\n\t\t\t).getBootstrappedBlockType( blockName );\n\n\t\t\tregisterBlockType( blockName, {\n\t\t\t\t// Use all metadata from PHP registration,\n\t\t\t\t// but fall back title to block name if not provided,\n\t\t\t\t// ensure minimum apiVersion 3 for block wrapper support,\n\t\t\t\t// and override with a ServerSideRender-based edit function.\n\t\t\t\t...bootstrappedBlockType,\n\t\t\t\ttitle: bootstrappedBlockType?.title || blockName,\n\t\t\t\t...( ( bootstrappedBlockType?.apiVersion ?? 0 ) < 3 && {\n\t\t\t\t\tapiVersion: 3,\n\t\t\t\t} ),\n\t\t\t\tedit: function Edit( { attributes } ) {\n\t\t\t\t\tconst blockProps = useBlockProps();\n\t\t\t\t\tconst { content, status, error } = useServerSideRender( {\n\t\t\t\t\t\tblock: blockName,\n\t\t\t\t\t\tattributes,\n\t\t\t\t\t} );\n\n\t\t\t\t\tif ( status === 'loading' ) {\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<div { ...blockProps }>{ __( 'Loading\u2026' ) }</div>\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( status === 'error' ) {\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<div { ...blockProps }>\n\t\t\t\t\t\t\t\t{ sprintf(\n\t\t\t\t\t\t\t\t\t/* translators: %s: error message describing the problem */\n\t\t\t\t\t\t\t\t\t__( 'Error loading block: %s' ),\n\t\t\t\t\t\t\t\t\terror\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t{ ...blockProps }\n\t\t\t\t\t\t\tdangerouslySetInnerHTML={ {\n\t\t\t\t\t\t\t\t__html: content || '',\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\tsave: () => null,\n\t\t\t} );\n\t\t} );\n\t}\n\n\tsetDefaultBlockName( paragraph.name );\n\tif (\n\t\twindow.wp &&\n\t\twindow.wp.oldEditor &&\n\t\tblocks.some( ( { name } ) => name === classic.name )\n\t) {\n\t\tsetFreeformContentHandlerName( classic.name );\n\t}\n\tsetUnregisteredTypeHandlerName( missing.name );\n\tsetGroupingBlockName( group.name );\n};\n\n/**\n * Function to register experimental core blocks depending on editor settings.\n *\n * @param {boolean} enableFSEBlocks Whether to enable the full site editing blocks.\n * @example\n * ```js\n * import { __experimentalRegisterExperimentalCoreBlocks } from '@wordpress/block-library';\n *\n * __experimentalRegisterExperimentalCoreBlocks( settings );\n * ```\n */\nexport const __experimentalRegisterExperimentalCoreBlocks =\n\tglobalThis.IS_GUTENBERG_PLUGIN\n\t\t? ( { enableFSEBlocks } = {} ) => {\n\t\t\t\tconst enabledExperiments = [ enableFSEBlocks ? 'fse' : null ];\n\t\t\t\tgetAllBlocks()\n\t\t\t\t\t.filter( ( { metadata } ) =>\n\t\t\t\t\t\tisBlockMetadataExperimental( metadata )\n\t\t\t\t\t)\n\t\t\t\t\t.filter(\n\t\t\t\t\t\t( { metadata: { __experimental } } ) =>\n\t\t\t\t\t\t\t__experimental === true ||\n\t\t\t\t\t\t\tenabledExperiments.includes( __experimental )\n\t\t\t\t\t)\n\t\t\t\t\t.forEach( ( { init } ) => init() );\n\t\t }\n\t\t: undefined;\n\nexport { privateApis } from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