@wordpress/block-library 9.45.0 → 9.45.1-next.v.202605131006.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.
Files changed (84) hide show
  1. package/build/breadcrumbs/edit.cjs +1 -1
  2. package/build/breadcrumbs/edit.cjs.map +1 -1
  3. package/build/buttons/edit.cjs +0 -13
  4. package/build/buttons/edit.cjs.map +3 -3
  5. package/build/comment-reply-link/edit.cjs +2 -1
  6. package/build/comment-reply-link/edit.cjs.map +2 -2
  7. package/build/comments/edit/placeholder.cjs +2 -1
  8. package/build/comments/edit/placeholder.cjs.map +2 -2
  9. package/build/embed/transforms.cjs +24 -1
  10. package/build/embed/transforms.cjs.map +2 -2
  11. package/build/freeform/convert-to-blocks-button.cjs +2 -14
  12. package/build/freeform/convert-to-blocks-button.cjs.map +3 -3
  13. package/build/freeform/edit.cjs +43 -15
  14. package/build/freeform/edit.cjs.map +3 -3
  15. package/build/freeform/index.cjs +7 -1
  16. package/build/freeform/index.cjs.map +3 -3
  17. package/build/freeform/migration-notice.cjs +58 -0
  18. package/build/freeform/migration-notice.cjs.map +7 -0
  19. package/build/image/image.cjs +16 -52
  20. package/build/image/image.cjs.map +3 -3
  21. package/build/image/use-open-image-media-editor-modal.cjs +239 -0
  22. package/build/image/use-open-image-media-editor-modal.cjs.map +7 -0
  23. package/build/index.cjs +1 -5
  24. package/build/index.cjs.map +2 -2
  25. package/build/shortcode/transforms.cjs +27 -1
  26. package/build/shortcode/transforms.cjs.map +2 -2
  27. package/build/site-logo/edit.cjs +1 -0
  28. package/build/site-logo/edit.cjs.map +2 -2
  29. package/build/table/edit.cjs +2 -2
  30. package/build/table/edit.cjs.map +2 -2
  31. package/build-module/breadcrumbs/edit.mjs +1 -1
  32. package/build-module/breadcrumbs/edit.mjs.map +1 -1
  33. package/build-module/buttons/edit.mjs +0 -13
  34. package/build-module/buttons/edit.mjs.map +2 -2
  35. package/build-module/comment-reply-link/edit.mjs +3 -2
  36. package/build-module/comment-reply-link/edit.mjs.map +2 -2
  37. package/build-module/comments/edit/placeholder.mjs +3 -2
  38. package/build-module/comments/edit/placeholder.mjs.map +2 -2
  39. package/build-module/embed/transforms.mjs +24 -1
  40. package/build-module/embed/transforms.mjs.map +2 -2
  41. package/build-module/freeform/convert-to-blocks-button.mjs +3 -15
  42. package/build-module/freeform/convert-to-blocks-button.mjs.map +2 -2
  43. package/build-module/freeform/edit.mjs +44 -16
  44. package/build-module/freeform/edit.mjs.map +2 -2
  45. package/build-module/freeform/index.mjs +7 -1
  46. package/build-module/freeform/index.mjs.map +2 -2
  47. package/build-module/freeform/migration-notice.mjs +37 -0
  48. package/build-module/freeform/migration-notice.mjs.map +7 -0
  49. package/build-module/image/image.mjs +16 -52
  50. package/build-module/image/image.mjs.map +3 -3
  51. package/build-module/image/use-open-image-media-editor-modal.mjs +215 -0
  52. package/build-module/image/use-open-image-media-editor-modal.mjs.map +7 -0
  53. package/build-module/index.mjs +1 -5
  54. package/build-module/index.mjs.map +2 -2
  55. package/build-module/shortcode/transforms.mjs +27 -1
  56. package/build-module/shortcode/transforms.mjs.map +2 -2
  57. package/build-module/site-logo/edit.mjs +1 -0
  58. package/build-module/site-logo/edit.mjs.map +2 -2
  59. package/build-module/table/edit.mjs +3 -3
  60. package/build-module/table/edit.mjs.map +2 -2
  61. package/build-types/table-of-contents/list.d.ts +1 -1
  62. package/build-types/table-of-contents/list.d.ts.map +1 -1
  63. package/package.json +41 -40
  64. package/src/breadcrumbs/edit.js +1 -1
  65. package/src/buttons/edit.js +0 -13
  66. package/src/comment-reply-link/edit.js +5 -2
  67. package/src/comments/edit/placeholder.js +5 -2
  68. package/src/cover/editor.scss +2 -2
  69. package/src/cover/style.scss +10 -6
  70. package/src/embed/transforms.js +30 -4
  71. package/src/freeform/convert-to-blocks-button.js +3 -18
  72. package/src/freeform/edit.js +40 -7
  73. package/src/freeform/index.js +9 -1
  74. package/src/freeform/migration-notice.js +51 -0
  75. package/src/image/image.js +14 -63
  76. package/src/image/test/use-open-image-media-editor-modal.js +791 -0
  77. package/src/image/use-open-image-media-editor-modal.js +337 -0
  78. package/src/index.js +3 -16
  79. package/src/navigation/index.php +11 -1
  80. package/src/query/editor.scss +1 -2
  81. package/src/shortcode/transforms.js +37 -0
  82. package/src/site-logo/edit.js +5 -0
  83. package/src/table/edit.js +3 -3
  84. package/src/template-part/editor.scss +1 -1
@@ -0,0 +1,239 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // packages/block-library/src/image/use-open-image-media-editor-modal.js
21
+ var use_open_image_media_editor_modal_exports = {};
22
+ __export(use_open_image_media_editor_modal_exports, {
23
+ getImageBlockMetadataFromAttachment: () => getImageBlockMetadataFromAttachment,
24
+ getSyncedImageBlockAttributes: () => getSyncedImageBlockAttributes,
25
+ useOpenImageMediaEditorModal: () => useOpenImageMediaEditorModal
26
+ });
27
+ module.exports = __toCommonJS(use_open_image_media_editor_modal_exports);
28
+ var import_core_data = require("@wordpress/core-data");
29
+ var import_block_editor = require("@wordpress/block-editor");
30
+ var import_dom = require("@wordpress/dom");
31
+ var import_data = require("@wordpress/data");
32
+ var import_element = require("@wordpress/element");
33
+ var import_lock_unlock = require("../lock-unlock.cjs");
34
+ function normalizeImageBlockCaption(caption) {
35
+ if (typeof caption !== "string") {
36
+ return "";
37
+ }
38
+ const textContent = (0, import_dom.__unstableStripHTML)(caption).trim();
39
+ if (!textContent) {
40
+ return "";
41
+ }
42
+ return caption.replace(/\n/g, "<br>");
43
+ }
44
+ function getAttachmentCaption(attachment) {
45
+ const caption = attachment?.caption;
46
+ if (typeof caption === "string") {
47
+ return normalizeImageBlockCaption(caption);
48
+ }
49
+ if (caption && typeof caption === "object" && Object.hasOwn(caption, "raw")) {
50
+ return normalizeImageBlockCaption(caption.raw);
51
+ }
52
+ return void 0;
53
+ }
54
+ function getImageBlockMetadataFromAttachment(attachment) {
55
+ return {
56
+ alt: typeof attachment?.alt_text === "string" ? attachment.alt_text : attachment?.alt || "",
57
+ caption: getAttachmentCaption(attachment)
58
+ };
59
+ }
60
+ function normalizeMetadataAttribute(value) {
61
+ return value || "";
62
+ }
63
+ function getSyncedImageBlockAttributes(currentAttributes, originalAttachment, updatedAttachment) {
64
+ if (!originalAttachment || !updatedAttachment) {
65
+ return {};
66
+ }
67
+ const originalMetadata = getImageBlockMetadataFromAttachment(originalAttachment);
68
+ const updatedMetadata = getImageBlockMetadataFromAttachment(updatedAttachment);
69
+ const syncedAttributes = {};
70
+ const normalizedCurrentAlt = normalizeMetadataAttribute(
71
+ currentAttributes.alt
72
+ );
73
+ if (originalMetadata.alt !== updatedMetadata.alt && (normalizedCurrentAlt === originalMetadata.alt || !normalizedCurrentAlt)) {
74
+ syncedAttributes.alt = updatedMetadata.alt;
75
+ }
76
+ const normalizedCurrentCaption = normalizeMetadataAttribute(
77
+ currentAttributes.caption
78
+ );
79
+ if (originalMetadata.caption !== void 0 && updatedMetadata.caption !== void 0 && originalMetadata.caption !== updatedMetadata.caption && (normalizedCurrentCaption === originalMetadata.caption || !normalizedCurrentCaption)) {
80
+ syncedAttributes.caption = updatedMetadata.caption || void 0;
81
+ }
82
+ return syncedAttributes;
83
+ }
84
+ var { openMediaEditorModalKey } = (0, import_lock_unlock.unlock)(import_block_editor.privateApis);
85
+ var ATTACHMENT_EDIT_QUERY = { context: "edit" };
86
+ function getAttachmentFallbackForEmptyBlockMetadata({ alt, caption }) {
87
+ const attachment = {};
88
+ if (!alt) {
89
+ attachment.alt_text = "";
90
+ }
91
+ if (!caption?.toString()) {
92
+ attachment.caption = "";
93
+ }
94
+ return Object.keys(attachment).length ? attachment : void 0;
95
+ }
96
+ function hasKnownAttachmentMetadata(attachment) {
97
+ if (!attachment) {
98
+ return false;
99
+ }
100
+ const hasKnownAlt = typeof attachment.alt_text === "string" || typeof attachment.alt === "string";
101
+ const hasKnownCaption = getImageBlockMetadataFromAttachment(attachment).caption !== void 0;
102
+ return hasKnownAlt && hasKnownCaption;
103
+ }
104
+ function useOpenImageMediaEditorModal({ attributes, setAttributes }) {
105
+ const { id, url, alt, caption } = attributes;
106
+ const registry = (0, import_data.useRegistry)();
107
+ const openMediaEditorModal = (0, import_data.useSelect)(
108
+ (select) => select(import_block_editor.store).getSettings()[openMediaEditorModalKey],
109
+ []
110
+ );
111
+ const blockMetadataRef = (0, import_element.useRef)({ alt, caption: caption?.toString() });
112
+ const mediaEditorMetadataBaselineRef = (0, import_element.useRef)();
113
+ const mediaEditorMetadataSyncRequestRef = (0, import_element.useRef)(0);
114
+ (0, import_element.useEffect)(() => {
115
+ blockMetadataRef.current = { alt, caption: caption?.toString() };
116
+ }, [alt, caption]);
117
+ const getCachedAttachmentRecord = (0, import_element.useCallback)(
118
+ (attachmentId) => {
119
+ const { getEditedEntityRecord, getEntityRecord } = registry.select(import_core_data.store);
120
+ return getEditedEntityRecord(
121
+ "postType",
122
+ "attachment",
123
+ attachmentId
124
+ ) || getEntityRecord(
125
+ "postType",
126
+ "attachment",
127
+ attachmentId,
128
+ ATTACHMENT_EDIT_QUERY
129
+ ) || getEntityRecord("postType", "attachment", attachmentId);
130
+ },
131
+ [registry]
132
+ );
133
+ const resolveAttachmentRecord = (0, import_element.useCallback)(
134
+ async (attachmentId) => {
135
+ const resolveSelect = registry.resolveSelect(import_core_data.store);
136
+ try {
137
+ return await resolveSelect.getEntityRecord(
138
+ "postType",
139
+ "attachment",
140
+ attachmentId,
141
+ ATTACHMENT_EDIT_QUERY
142
+ ) || await resolveSelect.getEntityRecord(
143
+ "postType",
144
+ "attachment",
145
+ attachmentId
146
+ );
147
+ } catch {
148
+ return void 0;
149
+ }
150
+ },
151
+ [registry]
152
+ );
153
+ const resolveFreshAttachmentRecord = (0, import_element.useCallback)(
154
+ async (attachmentId) => {
155
+ const { invalidateResolution } = registry.dispatch(import_core_data.store);
156
+ invalidateResolution("getEntityRecord", [
157
+ "postType",
158
+ "attachment",
159
+ attachmentId
160
+ ]);
161
+ invalidateResolution("getEntityRecord", [
162
+ "postType",
163
+ "attachment",
164
+ attachmentId,
165
+ ATTACHMENT_EDIT_QUERY
166
+ ]);
167
+ return resolveAttachmentRecord(attachmentId);
168
+ },
169
+ [registry, resolveAttachmentRecord]
170
+ );
171
+ const handleMediaUpdate = (0, import_element.useCallback)(
172
+ async ({ id: newId, url: newUrl }) => {
173
+ if (typeof newId !== "number") {
174
+ return;
175
+ }
176
+ const originalAttachment = mediaEditorMetadataBaselineRef.current;
177
+ mediaEditorMetadataBaselineRef.current = void 0;
178
+ const syncRequest = ++mediaEditorMetadataSyncRequestRef.current;
179
+ const nextAttributes = {};
180
+ if (newId !== id) {
181
+ nextAttributes.id = newId;
182
+ nextAttributes.url = newUrl ?? url;
183
+ }
184
+ if (originalAttachment) {
185
+ const resolvedAttachment = await resolveFreshAttachmentRecord(newId);
186
+ if (syncRequest !== mediaEditorMetadataSyncRequestRef.current) {
187
+ return;
188
+ }
189
+ const resolvedMetadataAttributes = getSyncedImageBlockAttributes(
190
+ blockMetadataRef.current,
191
+ originalAttachment,
192
+ resolvedAttachment
193
+ );
194
+ if (Object.keys(resolvedMetadataAttributes).length) {
195
+ Object.assign(nextAttributes, resolvedMetadataAttributes);
196
+ blockMetadataRef.current = {
197
+ ...blockMetadataRef.current,
198
+ ...resolvedMetadataAttributes
199
+ };
200
+ }
201
+ }
202
+ if (Object.keys(nextAttributes).length) {
203
+ setAttributes(nextAttributes);
204
+ }
205
+ },
206
+ [id, resolveFreshAttachmentRecord, setAttributes, url]
207
+ );
208
+ const openImageMediaEditorModal = (0, import_element.useCallback)(async () => {
209
+ if (!id || !openMediaEditorModal) {
210
+ return;
211
+ }
212
+ const cachedAttachmentRecord = getCachedAttachmentRecord(id);
213
+ const fallbackAttachmentRecord = getAttachmentFallbackForEmptyBlockMetadata(
214
+ blockMetadataRef.current
215
+ );
216
+ const resolvedAttachmentRecord = hasKnownAttachmentMetadata(
217
+ cachedAttachmentRecord
218
+ ) ? void 0 : await resolveAttachmentRecord(id);
219
+ mediaEditorMetadataBaselineRef.current = resolvedAttachmentRecord || (hasKnownAttachmentMetadata(cachedAttachmentRecord) ? cachedAttachmentRecord : fallbackAttachmentRecord) || cachedAttachmentRecord;
220
+ openMediaEditorModal({
221
+ id,
222
+ onUpdate: handleMediaUpdate
223
+ });
224
+ }, [
225
+ getCachedAttachmentRecord,
226
+ handleMediaUpdate,
227
+ id,
228
+ openMediaEditorModal,
229
+ resolveAttachmentRecord
230
+ ]);
231
+ return id && openMediaEditorModal ? openImageMediaEditorModal : void 0;
232
+ }
233
+ // Annotate the CommonJS export names for ESM import in node:
234
+ 0 && (module.exports = {
235
+ getImageBlockMetadataFromAttachment,
236
+ getSyncedImageBlockAttributes,
237
+ useOpenImageMediaEditorModal
238
+ });
239
+ //# sourceMappingURL=use-open-image-media-editor-modal.cjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/image/use-open-image-media-editor-modal.js"],
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { store as coreStore } from '@wordpress/core-data';\nimport {\n\tprivateApis as blockEditorPrivateApis,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { __unstableStripHTML as stripHTML } from '@wordpress/dom';\nimport { useRegistry, useSelect } from '@wordpress/data';\nimport { useCallback, useEffect, useRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../lock-unlock';\n\nfunction normalizeImageBlockCaption( caption ) {\n\tif ( typeof caption !== 'string' ) {\n\t\treturn '';\n\t}\n\n\tconst textContent = stripHTML( caption ).trim();\n\n\tif ( ! textContent ) {\n\t\treturn '';\n\t}\n\n\treturn caption.replace( /\\n/g, '<br>' );\n}\n\nfunction getAttachmentCaption( attachment ) {\n\tconst caption = attachment?.caption;\n\n\tif ( typeof caption === 'string' ) {\n\t\treturn normalizeImageBlockCaption( caption );\n\t}\n\n\tif (\n\t\tcaption &&\n\t\ttypeof caption === 'object' &&\n\t\tObject.hasOwn( caption, 'raw' )\n\t) {\n\t\treturn normalizeImageBlockCaption( caption.raw );\n\t}\n\n\treturn undefined;\n}\n\nexport function getImageBlockMetadataFromAttachment( attachment ) {\n\treturn {\n\t\talt:\n\t\t\ttypeof attachment?.alt_text === 'string'\n\t\t\t\t? attachment.alt_text\n\t\t\t\t: attachment?.alt || '',\n\t\tcaption: getAttachmentCaption( attachment ),\n\t};\n}\n\nfunction normalizeMetadataAttribute( value ) {\n\treturn value || '';\n}\n\nexport function getSyncedImageBlockAttributes(\n\tcurrentAttributes,\n\toriginalAttachment,\n\tupdatedAttachment\n) {\n\tif ( ! originalAttachment || ! updatedAttachment ) {\n\t\treturn {};\n\t}\n\n\tconst originalMetadata =\n\t\tgetImageBlockMetadataFromAttachment( originalAttachment );\n\tconst updatedMetadata =\n\t\tgetImageBlockMetadataFromAttachment( updatedAttachment );\n\tconst syncedAttributes = {};\n\n\tconst normalizedCurrentAlt = normalizeMetadataAttribute(\n\t\tcurrentAttributes.alt\n\t);\n\tif (\n\t\toriginalMetadata.alt !== updatedMetadata.alt &&\n\t\t( normalizedCurrentAlt === originalMetadata.alt ||\n\t\t\t! normalizedCurrentAlt )\n\t) {\n\t\tsyncedAttributes.alt = updatedMetadata.alt;\n\t}\n\n\tconst normalizedCurrentCaption = normalizeMetadataAttribute(\n\t\tcurrentAttributes.caption\n\t);\n\tif (\n\t\toriginalMetadata.caption !== undefined &&\n\t\tupdatedMetadata.caption !== undefined &&\n\t\toriginalMetadata.caption !== updatedMetadata.caption &&\n\t\t( normalizedCurrentCaption === originalMetadata.caption ||\n\t\t\t! normalizedCurrentCaption )\n\t) {\n\t\tsyncedAttributes.caption = updatedMetadata.caption || undefined;\n\t}\n\n\treturn syncedAttributes;\n}\n\nconst { openMediaEditorModalKey } = unlock( blockEditorPrivateApis );\n// Caption sync needs `caption.raw`; view/default attachment records can contain\n// only rendered caption data or be tied to an in-flight stale resolution.\nconst ATTACHMENT_EDIT_QUERY = { context: 'edit' };\n\nfunction getAttachmentFallbackForEmptyBlockMetadata( { alt, caption } ) {\n\tconst attachment = {};\n\n\tif ( ! alt ) {\n\t\tattachment.alt_text = '';\n\t}\n\n\tif ( ! caption?.toString() ) {\n\t\tattachment.caption = '';\n\t}\n\n\treturn Object.keys( attachment ).length ? attachment : undefined;\n}\n\nfunction hasKnownAttachmentMetadata( attachment ) {\n\tif ( ! attachment ) {\n\t\treturn false;\n\t}\n\n\tconst hasKnownAlt =\n\t\ttypeof attachment.alt_text === 'string' ||\n\t\ttypeof attachment.alt === 'string';\n\tconst hasKnownCaption =\n\t\tgetImageBlockMetadataFromAttachment( attachment ).caption !== undefined;\n\n\treturn hasKnownAlt && hasKnownCaption;\n}\n\nexport function useOpenImageMediaEditorModal( { attributes, setAttributes } ) {\n\t// Keep this hook private to the Image block and pass the block attributes\n\t// object so the callsite stays compact. Destructure only the attributes\n\t// currently used for metadata sync; add more here if the sync policy grows.\n\tconst { id, url, alt, caption } = attributes;\n\tconst registry = useRegistry();\n\tconst openMediaEditorModal = useSelect(\n\t\t( select ) =>\n\t\t\tselect( blockEditorStore ).getSettings()[ openMediaEditorModalKey ],\n\t\t[]\n\t);\n\t// Track the block's current alt and caption in a ref so handleMediaUpdate\n\t// can read the latest values without being listed as a dependency (which\n\t// would recreate the callback and re-register the onUpdate handler on every\n\t// keystroke while the modal is open).\n\tconst blockMetadataRef = useRef( { alt, caption: caption?.toString() } );\n\t// Snapshot of the attachment's metadata taken just before the modal opens,\n\t// used as the baseline for detecting what changed during the editing session.\n\tconst mediaEditorMetadataBaselineRef = useRef();\n\t// Incremented on every handleMediaUpdate call; stale async continuations\n\t// check against this to bail out if a newer update has since started.\n\tconst mediaEditorMetadataSyncRequestRef = useRef( 0 );\n\n\tuseEffect( () => {\n\t\tblockMetadataRef.current = { alt, caption: caption?.toString() };\n\t}, [ alt, caption ] );\n\n\tconst getCachedAttachmentRecord = useCallback(\n\t\t( attachmentId ) => {\n\t\t\tconst { getEditedEntityRecord, getEntityRecord } =\n\t\t\t\tregistry.select( coreStore );\n\t\t\treturn (\n\t\t\t\tgetEditedEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\t'attachment',\n\t\t\t\t\tattachmentId\n\t\t\t\t) ||\n\t\t\t\tgetEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\t'attachment',\n\t\t\t\t\tattachmentId,\n\t\t\t\t\tATTACHMENT_EDIT_QUERY\n\t\t\t\t) ||\n\t\t\t\tgetEntityRecord( 'postType', 'attachment', attachmentId )\n\t\t\t);\n\t\t},\n\t\t[ registry ]\n\t);\n\n\tconst resolveAttachmentRecord = useCallback(\n\t\tasync ( attachmentId ) => {\n\t\t\tconst resolveSelect = registry.resolveSelect( coreStore );\n\n\t\t\ttry {\n\t\t\t\treturn (\n\t\t\t\t\t( await resolveSelect.getEntityRecord(\n\t\t\t\t\t\t'postType',\n\t\t\t\t\t\t'attachment',\n\t\t\t\t\t\tattachmentId,\n\t\t\t\t\t\tATTACHMENT_EDIT_QUERY\n\t\t\t\t\t) ) ||\n\t\t\t\t\t( await resolveSelect.getEntityRecord(\n\t\t\t\t\t\t'postType',\n\t\t\t\t\t\t'attachment',\n\t\t\t\t\t\tattachmentId\n\t\t\t\t\t) )\n\t\t\t\t);\n\t\t\t} catch {\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t},\n\t\t[ registry ]\n\t);\n\n\tconst resolveFreshAttachmentRecord = useCallback(\n\t\tasync ( attachmentId ) => {\n\t\t\t// Bust cached records so resolveAttachmentRecord fetches the\n\t\t\t// server state that reflects the media editor's saved changes.\n\t\t\tconst { invalidateResolution } = registry.dispatch( coreStore );\n\n\t\t\tinvalidateResolution( 'getEntityRecord', [\n\t\t\t\t'postType',\n\t\t\t\t'attachment',\n\t\t\t\tattachmentId,\n\t\t\t] );\n\t\t\tinvalidateResolution( 'getEntityRecord', [\n\t\t\t\t'postType',\n\t\t\t\t'attachment',\n\t\t\t\tattachmentId,\n\t\t\t\tATTACHMENT_EDIT_QUERY,\n\t\t\t] );\n\t\t\treturn resolveAttachmentRecord( attachmentId );\n\t\t},\n\t\t[ registry, resolveAttachmentRecord ]\n\t);\n\n\tconst handleMediaUpdate = useCallback(\n\t\tasync ( { id: newId, url: newUrl } ) => {\n\t\t\tif ( typeof newId !== 'number' ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Capture and clear the baseline so a rapid second save doesn't\n\t\t\t// reuse a stale snapshot.\n\t\t\tconst originalAttachment = mediaEditorMetadataBaselineRef.current;\n\t\t\tmediaEditorMetadataBaselineRef.current = undefined;\n\t\t\tconst syncRequest = ++mediaEditorMetadataSyncRequestRef.current;\n\t\t\tconst nextAttributes = {};\n\n\t\t\tif ( newId !== id ) {\n\t\t\t\tnextAttributes.id = newId;\n\t\t\t\tnextAttributes.url = newUrl ?? url;\n\t\t\t}\n\n\t\t\tif ( originalAttachment ) {\n\t\t\t\t// Fetch fresh server state so the comparison reflects what\n\t\t\t\t// the media editor actually saved, not a potentially stale\n\t\t\t\t// cache.\n\t\t\t\tconst resolvedAttachment =\n\t\t\t\t\tawait resolveFreshAttachmentRecord( newId );\n\n\t\t\t\t// A newer update started while we were awaiting; discard\n\t\t\t\t// this one.\n\t\t\t\tif (\n\t\t\t\t\tsyncRequest !== mediaEditorMetadataSyncRequestRef.current\n\t\t\t\t) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Sync alt text and caption back to the block only when\n\t\t\t\t// they were changed in the media editor. Fields the user\n\t\t\t\t// has independently customised on the block (i.e. values\n\t\t\t\t// that don't match the pre-session attachment metadata)\n\t\t\t\t// are left untouched.\n\t\t\t\tconst resolvedMetadataAttributes =\n\t\t\t\t\tgetSyncedImageBlockAttributes(\n\t\t\t\t\t\tblockMetadataRef.current,\n\t\t\t\t\t\toriginalAttachment,\n\t\t\t\t\t\tresolvedAttachment\n\t\t\t\t\t);\n\n\t\t\t\tif ( Object.keys( resolvedMetadataAttributes ).length ) {\n\t\t\t\t\tObject.assign( nextAttributes, resolvedMetadataAttributes );\n\t\t\t\t\tblockMetadataRef.current = {\n\t\t\t\t\t\t...blockMetadataRef.current,\n\t\t\t\t\t\t...resolvedMetadataAttributes,\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( Object.keys( nextAttributes ).length ) {\n\t\t\t\tsetAttributes( nextAttributes );\n\t\t\t}\n\t\t},\n\t\t[ id, resolveFreshAttachmentRecord, setAttributes, url ]\n\t);\n\n\tconst openImageMediaEditorModal = useCallback( async () => {\n\t\tif ( ! id || ! openMediaEditorModal ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Snapshot the attachment's current metadata before the user makes\n\t\t// any changes so handleMediaUpdate can compare against it later.\n\t\t// Prefer a freshly resolved edit-context record for accuracy; fall\n\t\t// back to whatever is in the cache, or a minimal object derived from\n\t\t// the block's own attributes when nothing is cached yet.\n\t\tconst cachedAttachmentRecord = getCachedAttachmentRecord( id );\n\t\tconst fallbackAttachmentRecord =\n\t\t\tgetAttachmentFallbackForEmptyBlockMetadata(\n\t\t\t\tblockMetadataRef.current\n\t\t\t);\n\t\tconst resolvedAttachmentRecord = hasKnownAttachmentMetadata(\n\t\t\tcachedAttachmentRecord\n\t\t)\n\t\t\t? undefined\n\t\t\t: await resolveAttachmentRecord( id );\n\n\t\tmediaEditorMetadataBaselineRef.current =\n\t\t\tresolvedAttachmentRecord ||\n\t\t\t( hasKnownAttachmentMetadata( cachedAttachmentRecord )\n\t\t\t\t? cachedAttachmentRecord\n\t\t\t\t: fallbackAttachmentRecord ) ||\n\t\t\tcachedAttachmentRecord;\n\n\t\topenMediaEditorModal( {\n\t\t\tid,\n\t\t\tonUpdate: handleMediaUpdate,\n\t\t} );\n\t}, [\n\t\tgetCachedAttachmentRecord,\n\t\thandleMediaUpdate,\n\t\tid,\n\t\topenMediaEditorModal,\n\t\tresolveAttachmentRecord,\n\t] );\n\n\treturn id && openMediaEditorModal ? openImageMediaEditorModal : undefined;\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,uBAAmC;AACnC,0BAGO;AACP,iBAAiD;AACjD,kBAAuC;AACvC,qBAA+C;AAK/C,yBAAuB;AAEvB,SAAS,2BAA4B,SAAU;AAC9C,MAAK,OAAO,YAAY,UAAW;AAClC,WAAO;AAAA,EACR;AAEA,QAAM,kBAAc,WAAAA,qBAAW,OAAQ,EAAE,KAAK;AAE9C,MAAK,CAAE,aAAc;AACpB,WAAO;AAAA,EACR;AAEA,SAAO,QAAQ,QAAS,OAAO,MAAO;AACvC;AAEA,SAAS,qBAAsB,YAAa;AAC3C,QAAM,UAAU,YAAY;AAE5B,MAAK,OAAO,YAAY,UAAW;AAClC,WAAO,2BAA4B,OAAQ;AAAA,EAC5C;AAEA,MACC,WACA,OAAO,YAAY,YACnB,OAAO,OAAQ,SAAS,KAAM,GAC7B;AACD,WAAO,2BAA4B,QAAQ,GAAI;AAAA,EAChD;AAEA,SAAO;AACR;AAEO,SAAS,oCAAqC,YAAa;AACjE,SAAO;AAAA,IACN,KACC,OAAO,YAAY,aAAa,WAC7B,WAAW,WACX,YAAY,OAAO;AAAA,IACvB,SAAS,qBAAsB,UAAW;AAAA,EAC3C;AACD;AAEA,SAAS,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BAA2B;AAAA,MAChC;AAAA,IACD,IACG,SACA,MAAM,wBAAyB,EAAG;AAErC,mCAA+B,UAC9B,6BACE,2BAA4B,sBAAuB,IAClD,yBACA,6BACH;AAED,yBAAsB;AAAA,MACrB;AAAA,MACA,UAAU;AAAA,IACX,CAAE;AAAA,EACH,GAAG;AAAA,IACF;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD,CAAE;AAEF,SAAO,MAAM,uBAAuB,4BAA4B;AACjE;",
6
+ "names": ["stripHTML", "blockEditorPrivateApis", "blockEditorStore", "coreStore"]
7
+ }
package/build/index.cjs CHANGED
@@ -299,11 +299,7 @@ var getAllBlocks = () => {
299
299
  blocks.push(playlist);
300
300
  blocks.push(playlistTrack);
301
301
  }
302
- if (window?.wp?.oldEditor && (window?.wp?.needsClassicBlock || !window?.__experimentalDisableTinymce || !!new URLSearchParams(window?.location?.search).get(
303
- "requiresTinymce"
304
- ))) {
305
- blocks.push(classic);
306
- }
302
+ blocks.push(classic);
307
303
  return blocks.filter(Boolean);
308
304
  };
309
305
  var __experimentalGetCoreBlocks = () => getAllBlocks().filter(
@@ -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 { useDisabled } from '@wordpress/compose';\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 */\nimport HtmlRenderer from './utils/html-renderer';\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 icon from './icon';\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 playlist from './playlist';\nimport * as playlistTrack from './playlist-track';\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 tabPanel from './tab-panel';\nimport * as tabPanels from './tab-panels';\nimport * as table from './table';\nimport * as tableOfContents from './table-of-contents';\nimport * as tabList from './tab-list';\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\ticon,\n\t\tlogInOut,\n\t\tnavigationOverlayClose,\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?.__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?.__experimentalEnableBlockExperiments ) {\n\t\tblocks.push( tab );\n\t\tblocks.push( tabList );\n\t\tblocks.push( tabs );\n\t\tblocks.push( tabPanel );\n\t\tblocks.push( tabPanels );\n\t\tblocks.push( playlist );\n\t\tblocks.push( playlistTrack );\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\t// Inspector controls are rendered by the auto-register hook in block-editor\n\t\t\t\tedit: function Edit( { attributes } ) {\n\t\t\t\t\tconst disabledRef = useDisabled();\n\t\t\t\t\tconst blockProps = useBlockProps( { ref: disabledRef } );\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<HtmlRenderer\n\t\t\t\t\t\t\twrapperProps={ blockProps }\n\t\t\t\t\t\t\thtml={ content }\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": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,oBAOO;AACP,qBAA4B;AAC5B,kBAAuB;AACvB,0BAA8B;AAC9B,gCAAoC;AACpC,kBAA4B;AAK5B,2BAAyB;AAczB,gBAA2B;AAC3B,oBAA+B;AAC/B,uBAAkC;AAClC,qBAAgC;AAChC,eAA0B;AAC1B,aAAwB;AACxB,YAAuB;AACvB,kBAA6B;AAC7B,aAAwB;AACxB,cAAyB;AACzB,eAA0B;AAC1B,iBAA4B;AAC5B,cAAyB;AACzB,WAAsB;AACtB,aAAwB;AACxB,cAAyB;AACzB,eAA0B;AAC1B,0BAAqC;AACrC,wBAAmC;AACnC,qBAAgC;AAChC,kBAA6B;AAC7B,sBAAiC;AACjC,uBAAkC;AAClC,sBAAiC;AACjC,iCAA4C;AAC5C,yBAAoC;AACpC,6BAAwC;AACxC,gCAA2C;AAC3C,oBAA+B;AAC/B,YAAuB;AACvB,cAAyB;AACzB,YAAuB;AACvB,WAAsB;AACtB,WAAsB;AACtB,gBAA2B;AAC3B,uBAAkC;AAClC,iCAA4C;AAC5C,cAAyB;AACzB,YAAuB;AACvB,cAAyB;AAC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;AAxNP,IAAM,eAAe,MAAM;AAC1B,QAAM,SAAS;AAAA;AAAA;AAAA,IAGd;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA;AAAA,IAGA;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;AAAA,IAGA;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,IACA;AAAA,IACA;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,gBAAM,iBAAa,mCAAe,EAAE,KAAK,YAAY,CAAE;AACvD,gBAAM,EAAE,SAAS,QAAQ,MAAM,QAAI,+CAAqB;AAAA,YACvD,OAAO;AAAA,YACP;AAAA,UACD,CAAE;AAEF,cAAK,WAAW,WAAY;AAC3B,mBACC,4CAAC,SAAM,GAAG,YAAe,8BAAI,eAAW,GAAG;AAAA,UAE7C;AAEA,cAAK,WAAW,SAAU;AACzB,mBACC,4CAAC,SAAM,GAAG,YACP;AAAA;AAAA,kBAED,gBAAI,yBAA0B;AAAA,cAC9B;AAAA,YACD,GACD;AAAA,UAEF;AAEA,iBACC;AAAA,YAAC,qBAAAC;AAAA,YAAA;AAAA,cACA,cAAe;AAAA,cACf,MAAO;AAAA;AAAA,UACR;AAAA,QAEF;AAAA,QACA,MAAM,MAAM;AAAA,MACb,CAAE;AAAA,IACH,CAAE;AAAA,EACH;AAEA,yCAA+B,cAAK;AACpC,MACC,OAAO,MACP,OAAO,GAAG,aACV,OAAO,KAAM,CAAE,EAAE,MAAAC,MAAK,MAAOA,UAAiB,YAAK,GAClD;AACD,qDAAuC,YAAK;AAAA,EAC7C;AACA,oDAAwC,YAAK;AAC7C,0CAA4B,UAAK;AAClC;AAaO,IAAM,+CACZ,WAAW,sBACR,CAAE,EAAE,gBAAgB,IAAI,CAAC,MAAO;AAChC,QAAM,qBAAqB,CAAE,kBAAkB,QAAQ,IAAK;AAC5D,eAAa,EACX;AAAA,IAAQ,CAAE,EAAE,SAAS,UACrB,sCAAAH,SAA6B,QAAS;AAAA,EACvC,EACC;AAAA,IACA,CAAE,EAAE,UAAU,EAAE,eAAe,EAAE,MAChC,mBAAmB,QACnB,mBAAmB,SAAU,cAAe;AAAA,EAC9C,EACC,QAAS,CAAE,EAAE,KAAK,MAAO,KAAK,CAAE;AAClC,IACA;",
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 { useDisabled } from '@wordpress/compose';\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 */\nimport HtmlRenderer from './utils/html-renderer';\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 icon from './icon';\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 playlist from './playlist';\nimport * as playlistTrack from './playlist-track';\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 tabPanel from './tab-panel';\nimport * as tabPanels from './tab-panels';\nimport * as table from './table';\nimport * as tableOfContents from './table-of-contents';\nimport * as tabList from './tab-list';\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\ticon,\n\t\tlogInOut,\n\t\tnavigationOverlayClose,\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?.__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?.__experimentalEnableBlockExperiments ) {\n\t\tblocks.push( tab );\n\t\tblocks.push( tabList );\n\t\tblocks.push( tabs );\n\t\tblocks.push( tabPanel );\n\t\tblocks.push( tabPanels );\n\t\tblocks.push( playlist );\n\t\tblocks.push( playlistTrack );\n\t}\n\n\t// Always register the classic block. Inserter availability is controlled\n\t// by the block's `supports.inserter` value in `freeform/init`.\n\tblocks.push( classic );\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\t// Inspector controls are rendered by the auto-register hook in block-editor\n\t\t\t\tedit: function Edit( { attributes } ) {\n\t\t\t\t\tconst disabledRef = useDisabled();\n\t\t\t\t\tconst blockProps = useBlockProps( { ref: disabledRef } );\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<HtmlRenderer\n\t\t\t\t\t\t\twrapperProps={ blockProps }\n\t\t\t\t\t\t\thtml={ content }\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": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,oBAOO;AACP,qBAA4B;AAC5B,kBAAuB;AACvB,0BAA8B;AAC9B,gCAAoC;AACpC,kBAA4B;AAK5B,2BAAyB;AAczB,gBAA2B;AAC3B,oBAA+B;AAC/B,uBAAkC;AAClC,qBAAgC;AAChC,eAA0B;AAC1B,aAAwB;AACxB,YAAuB;AACvB,kBAA6B;AAC7B,aAAwB;AACxB,cAAyB;AACzB,eAA0B;AAC1B,iBAA4B;AAC5B,cAAyB;AACzB,WAAsB;AACtB,aAAwB;AACxB,cAAyB;AACzB,eAA0B;AAC1B,0BAAqC;AACrC,wBAAmC;AACnC,qBAAgC;AAChC,kBAA6B;AAC7B,sBAAiC;AACjC,uBAAkC;AAClC,sBAAiC;AACjC,iCAA4C;AAC5C,yBAAoC;AACpC,6BAAwC;AACxC,gCAA2C;AAC3C,oBAA+B;AAC/B,YAAuB;AACvB,cAAyB;AACzB,YAAuB;AACvB,WAAsB;A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M,EAAE,SAAS,QAAQ,MAAM,QAAI,+CAAqB;AAAA,YACvD,OAAO;AAAA,YACP;AAAA,UACD,CAAE;AAEF,cAAK,WAAW,WAAY;AAC3B,mBACC,4CAAC,SAAM,GAAG,YAAe,8BAAI,eAAW,GAAG;AAAA,UAE7C;AAEA,cAAK,WAAW,SAAU;AACzB,mBACC,4CAAC,SAAM,GAAG,YACP;AAAA;AAAA,kBAED,gBAAI,yBAA0B;AAAA,cAC9B;AAAA,YACD,GACD;AAAA,UAEF;AAEA,iBACC;AAAA,YAAC,qBAAAC;AAAA,YAAA;AAAA,cACA,cAAe;AAAA,cACf,MAAO;AAAA;AAAA,UACR;AAAA,QAEF;AAAA,QACA,MAAM,MAAM;AAAA,MACb,CAAE;AAAA,IACH,CAAE;AAAA,EACH;AAEA,yCAA+B,cAAK;AACpC,MACC,OAAO,MACP,OAAO,GAAG,aACV,OAAO,KAAM,CAAE,EAAE,MAAAC,MAAK,MAAOA,UAAiB,YAAK,GAClD;AACD,qDAAuC,YAAK;AAAA,EAC7C;AACA,oDAAwC,YAAK;AAC7C,0CAA4B,UAAK;AAClC;AAaO,IAAM,+CACZ,WAAW,sBACR,CAAE,EAAE,gBAAgB,IAAI,CAAC,MAAO;AAChC,QAAM,qBAAqB,CAAE,kBAAkB,QAAQ,IAAK;AAC5D,eAAa,EACX;AAAA,IAAQ,CAAE,EAAE,SAAS,UACrB,sCAAAH,SAA6B,QAAS;AAAA,EACvC,EACC;AAAA,IACA,CAAE,EAAE,UAAU,EAAE,eAAe,EAAE,MAChC,mBAAmB,QACnB,mBAAmB,SAAU,cAAe;AAAA,EAC9C,EACC,QAAS,CAAE,EAAE,KAAK,MAAO,KAAK,CAAE;AAClC,IACA;",
6
6
  "names": ["isBlockMetadataExperimental", "blocksStore", "HtmlRenderer", "name"]
7
7
  }
@@ -24,6 +24,16 @@ __export(transforms_exports, {
24
24
  });
25
25
  module.exports = __toCommonJS(transforms_exports);
26
26
  var import_autop = require("@wordpress/autop");
27
+ var import_blocks = require("@wordpress/blocks");
28
+ var import_shortcode = require("@wordpress/shortcode");
29
+ var getShortcodeFromTransforms = () => (0, import_blocks.getBlockTransforms)("from").filter(
30
+ (transform) => transform.type === "shortcode" && transform.blockName !== "core/shortcode"
31
+ );
32
+ var isSingleShortcode = (text, tag) => {
33
+ const trimmed = text.trim();
34
+ const match = (0, import_shortcode.next)(tag, trimmed);
35
+ return !!match && match.index === 0 && match.content.length === trimmed.length;
36
+ };
27
37
  var transforms = {
28
38
  from: [
29
39
  {
@@ -46,7 +56,23 @@ var transforms = {
46
56
  },
47
57
  priority: 20
48
58
  }
49
- ]
59
+ ],
60
+ // One `to` transform per registered shortcode-from block. A single transform
61
+ // with a dynamic `blocks` list won't work: `isMatch` runs once per
62
+ // transform, so all targets would surface (or none) regardless of which
63
+ // shortcode tag the block actually contains.
64
+ get to() {
65
+ return getShortcodeFromTransforms().map((fromTransform) => ({
66
+ type: "block",
67
+ blocks: [fromTransform.blockName],
68
+ isMatch: ({ text }) => {
69
+ return [].concat(fromTransform.tag).some((tag) => isSingleShortcode(text, tag));
70
+ },
71
+ transform: ({ text }) => {
72
+ return (0, import_blocks.rawHandler)({ HTML: `<p>${text.trim()}</p>` });
73
+ }
74
+ }));
75
+ }
50
76
  };
51
77
  var transforms_default = transforms;
52
78
  //# sourceMappingURL=transforms.cjs.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/shortcode/transforms.js"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { removep, autop } from '@wordpress/autop';\n\nconst transforms = {\n\tfrom: [\n\t\t{\n\t\t\ttype: 'shortcode',\n\t\t\t// Per \"Shortcode names should be all lowercase and use all\n\t\t\t// letters, but numbers and underscores should work fine too.\n\t\t\t// Be wary of using hyphens (dashes), you'll be better off not\n\t\t\t// using them.\" in https://codex.wordpress.org/Shortcode_API\n\t\t\t// Require that the first character be a letter. This notably\n\t\t\t// prevents footnote markings ([1]) from being caught as\n\t\t\t// shortcodes.\n\t\t\ttag: '[a-z][a-z0-9_-]*',\n\t\t\tattributes: {\n\t\t\t\ttext: {\n\t\t\t\t\ttype: 'string',\n\t\t\t\t\tshortcode: ( attrs, { content } ) => {\n\t\t\t\t\t\treturn removep( autop( content ) );\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\tpriority: 20,\n\t\t},\n\t],\n};\n\nexport default transforms;\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,mBAA+B;AAE/B,IAAM,aAAa;AAAA,EAClB,MAAM;AAAA,IACL;AAAA,MACC,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAQN,KAAK;AAAA,MACL,YAAY;AAAA,QACX,MAAM;AAAA,UACL,MAAM;AAAA,UACN,WAAW,CAAE,OAAO,EAAE,QAAQ,MAAO;AACpC,uBAAO,0BAAS,oBAAO,OAAQ,CAAE;AAAA,UAClC;AAAA,QACD;AAAA,MACD;AAAA,MACA,UAAU;AAAA,IACX;AAAA,EACD;AACD;AAEA,IAAO,qBAAQ;",
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { removep, autop } from '@wordpress/autop';\nimport { getBlockTransforms, rawHandler } from '@wordpress/blocks';\nimport { next } from '@wordpress/shortcode';\n\nconst getShortcodeFromTransforms = () =>\n\tgetBlockTransforms( 'from' ).filter(\n\t\t( transform ) =>\n\t\t\ttransform.type === 'shortcode' &&\n\t\t\ttransform.blockName !== 'core/shortcode'\n\t);\n\n// Single-shortcode only: keeps the transform menu honest (one block in, one\n// block out) and avoids unmatched shortcodes silently falling back to freeform.\nconst isSingleShortcode = ( text, tag ) => {\n\tconst trimmed = text.trim();\n\tconst match = next( tag, trimmed );\n\treturn (\n\t\t!! match && match.index === 0 && match.content.length === trimmed.length\n\t);\n};\n\nconst transforms = {\n\tfrom: [\n\t\t{\n\t\t\ttype: 'shortcode',\n\t\t\t// Per \"Shortcode names should be all lowercase and use all\n\t\t\t// letters, but numbers and underscores should work fine too.\n\t\t\t// Be wary of using hyphens (dashes), you'll be better off not\n\t\t\t// using them.\" in https://codex.wordpress.org/Shortcode_API\n\t\t\t// Require that the first character be a letter. This notably\n\t\t\t// prevents footnote markings ([1]) from being caught as\n\t\t\t// shortcodes.\n\t\t\ttag: '[a-z][a-z0-9_-]*',\n\t\t\tattributes: {\n\t\t\t\ttext: {\n\t\t\t\t\ttype: 'string',\n\t\t\t\t\tshortcode: ( attrs, { content } ) => {\n\t\t\t\t\t\treturn removep( autop( content ) );\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\tpriority: 20,\n\t\t},\n\t],\n\t// One `to` transform per registered shortcode-from block. A single transform\n\t// with a dynamic `blocks` list won't work: `isMatch` runs once per\n\t// transform, so all targets would surface (or none) regardless of which\n\t// shortcode tag the block actually contains.\n\tget to() {\n\t\treturn getShortcodeFromTransforms().map( ( fromTransform ) => ( {\n\t\t\ttype: 'block',\n\t\t\tblocks: [ fromTransform.blockName ],\n\t\t\tisMatch: ( { text } ) => {\n\t\t\t\treturn []\n\t\t\t\t\t.concat( fromTransform.tag )\n\t\t\t\t\t.some( ( tag ) => isSingleShortcode( text, tag ) );\n\t\t\t},\n\t\t\ttransform: ( { text } ) => {\n\t\t\t\treturn rawHandler( { HTML: `<p>${ text.trim() }</p>` } );\n\t\t\t},\n\t\t} ) );\n\t},\n};\n\nexport default transforms;\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,mBAA+B;AAC/B,oBAA+C;AAC/C,uBAAqB;AAErB,IAAM,6BAA6B,UAClC,kCAAoB,MAAO,EAAE;AAAA,EAC5B,CAAE,cACD,UAAU,SAAS,eACnB,UAAU,cAAc;AAC1B;AAID,IAAM,oBAAoB,CAAE,MAAM,QAAS;AAC1C,QAAM,UAAU,KAAK,KAAK;AAC1B,QAAM,YAAQ,uBAAM,KAAK,OAAQ;AACjC,SACC,CAAC,CAAE,SAAS,MAAM,UAAU,KAAK,MAAM,QAAQ,WAAW,QAAQ;AAEpE;AAEA,IAAM,aAAa;AAAA,EAClB,MAAM;AAAA,IACL;AAAA,MACC,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAQN,KAAK;AAAA,MACL,YAAY;AAAA,QACX,MAAM;AAAA,UACL,MAAM;AAAA,UACN,WAAW,CAAE,OAAO,EAAE,QAAQ,MAAO;AACpC,uBAAO,0BAAS,oBAAO,OAAQ,CAAE;AAAA,UAClC;AAAA,QACD;AAAA,MACD;AAAA,MACA,UAAU;AAAA,IACX;AAAA,EACD;AAAA;AAAA;AAAA;AAAA;AAAA,EAKA,IAAI,KAAK;AACR,WAAO,2BAA2B,EAAE,IAAK,CAAE,mBAAqB;AAAA,MAC/D,MAAM;AAAA,MACN,QAAQ,CAAE,cAAc,SAAU;AAAA,MAClC,SAAS,CAAE,EAAE,KAAK,MAAO;AACxB,eAAO,CAAC,EACN,OAAQ,cAAc,GAAI,EAC1B,KAAM,CAAE,QAAS,kBAAmB,MAAM,GAAI,CAAE;AAAA,MACnD;AAAA,MACA,WAAW,CAAE,EAAE,KAAK,MAAO;AAC1B,mBAAO,0BAAY,EAAE,MAAM,MAAO,KAAK,KAAK,CAAE,OAAO,CAAE;AAAA,MACxD;AAAA,IACD,EAAI;AAAA,EACL;AACD;AAEA,IAAO,qBAAQ;",
6
6
  "names": []
7
7
  }
@@ -350,6 +350,7 @@ var SiteLogo = ({
350
350
  id: logoId,
351
351
  onUpdate: handleMediaUpdate
352
352
  }) : () => setIsEditingImage(true),
353
+ "aria-haspopup": openMediaEditorModal && logoId ? "dialog" : void 0,
353
354
  icon: import_icons.crop,
354
355
  label: (0, import_i18n.__)("Crop")
355
356
  }