PluginProbe
Gutenberg / 22.7.0
Gutenberg v22.7.0
24.0.0 23.9.1 23.9.0 23.8.0 23.7.2 23.7.1 23.7.0 23.6.1 23.6.2 23.6.0 23.5.3 23.5.2 23.5.1 23.5.0 23.4.0 23.3.2 23.3.1 23.3.0 23.2.0 23.2.1 23.2.2 23.1.1 23.1.0 23.0.1 12.6.0 All 403 releases
← All changes | build/scripts/reusable-blocks/index.js +3 -68 23.6.2 → 22.7.0 View file →
@@ -58,15 +58,8 @@
58 58 module.exports = window.wp.i18n;
59 59 }
60 60 });
61 61
62 - // package-external:@wordpress/deprecated
63 - var require_deprecated = __commonJS({
64 - "package-external:@wordpress/deprecated"(exports, module) {
65 - module.exports = window.wp.deprecated;
66 - }
67 - });
68 -
69 62 // package-external:@wordpress/element
70 63 var require_element = __commonJS({
71 64 "package-external:@wordpress/element"(exports, module) {
72 65 module.exports = window.wp.element;
@@ -135,16 +128,9 @@
135 128 });
136 129 var import_block_editor = __toESM(require_block_editor(), 1);
137 130 var import_blocks = __toESM(require_blocks(), 1);
138 131 var import_i18n = __toESM(require_i18n(), 1);
139 - var import_deprecated = __toESM(require_deprecated(), 1);
140 132 var __experimentalConvertBlockToStatic = (clientId) => ({ registry }) => {
141 - (0, import_deprecated.default)(
142 - "wp.data.dispatch( 'core/reusable-blocks' ).__experimentalConvertBlockToStatic",
143 - {
144 - since: "7.1"
145 - }
146 - );
147 133 const oldBlock = registry.select(import_block_editor.store).getBlock(clientId);
148 134 const reusableBlock = registry.select("core").getEditedEntityRecord(
149 135 "postType",
150 136 "wp_block",
@@ -155,14 +141,8 @@
155 141 );
156 142 registry.dispatch(import_block_editor.store).replaceBlocks(oldBlock.clientId, newBlocks);
157 143 };
158 144 var __experimentalConvertBlocksToReusable = (clientIds, title, syncType) => async ({ registry, dispatch }) => {
159 - (0, import_deprecated.default)(
160 - "wp.data.dispatch( 'core/reusable-blocks' ).__experimentalConvertBlocksToReusable",
161 - {
162 - since: "7.1"
163 - }
164 - );
165 145 const meta = syncType === "unsynced" ? {
166 146 wp_pattern_sync_status: syncType
167 147 } : void 0;
168 148 const reusableBlock = {
@@ -186,14 +166,8 @@
186 166 true
187 167 );
188 168 };
189 169 var __experimentalDeleteReusableBlock = (id) => async ({ registry }) => {
190 - (0, import_deprecated.default)(
191 - "wp.data.dispatch( 'core/reusable-blocks' ).__experimentalDeleteReusableBlock",
192 - {
193 - since: "7.1"
194 - }
195 - );
196 170 const reusableBlock = registry.select("core").getEditedEntityRecord("postType", "wp_block", id);
197 171 if (!reusableBlock) {
198 172 return;
199 173 }
@@ -209,14 +183,8 @@
209 183 }
210 184 await registry.dispatch("core").deleteEntityRecord("postType", "wp_block", id);
211 185 };
212 186 function __experimentalSetEditingReusableBlock(clientId, isEditing) {
213 - (0, import_deprecated.default)(
214 - "wp.data.dispatch( 'core/reusable-blocks' ).__experimentalSetEditingReusableBlock",
215 - {
216 - since: "7.1"
217 - }
218 - );
219 187 return {
220 188 type: "SET_EDITING_REUSABLE_BLOCK",
221 189 clientId,
222 190 isEditing
@@ -242,16 +210,9 @@
242 210 var selectors_exports = {};
243 211 __export(selectors_exports, {
244 212 __experimentalIsEditingReusableBlock: () => __experimentalIsEditingReusableBlock
245 213 });
246 - var import_deprecated2 = __toESM(require_deprecated(), 1);
247 214 function __experimentalIsEditingReusableBlock(state, clientId) {
248 - (0, import_deprecated2.default)(
249 - "wp.data.select( 'core/reusable-blocks' ).__experimentalIsEditingReusableBlock",
250 - {
251 - since: "7.1"
252 - }
253 - );
254 215 return state.isEditingReusableBlock[clientId];
255 216 }
256 217
257 218 // packages/reusable-blocks/build-module/store/index.mjs
@@ -264,9 +225,8 @@
264 225 (0, import_data2.register)(store);
265 226
266 227 // packages/reusable-blocks/build-module/components/reusable-blocks-menu-items/index.mjs
267 228 var import_block_editor4 = __toESM(require_block_editor(), 1);
268 - var import_deprecated3 = __toESM(require_deprecated(), 1);
269 229
270 230 // packages/reusable-blocks/build-module/components/reusable-blocks-menu-items/reusable-block-convert-button.mjs
271 231 var import_blocks2 = __toESM(require_blocks(), 1);
272 232 var import_block_editor2 = __toESM(require_block_editor(), 1);
@@ -275,9 +235,9 @@
275 235
276 236 // packages/icons/build-module/library/symbol.mjs
277 237 var import_primitives = __toESM(require_primitives(), 1);
278 238 var import_jsx_runtime = __toESM(require_jsx_runtime(), 1);
279 - var symbol_default = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_primitives.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_primitives.Path, { d: "M21.3 10.8l-5.6-5.6c-.7-.7-1.8-.7-2.5 0l-5.6 5.6c-.7.7-.7 1.8 0 2.5l5.6 5.6c.3.3.8.5 1.2.5s.9-.2 1.2-.5l5.6-5.6c.8-.7.8-1.9.1-2.5zm-1 1.4l-5.6 5.6c-.1.1-.3.1-.4 0l-5.6-5.6c-.1-.1-.1-.3 0-.4l5.6-5.6s.1-.1.2-.1.1 0 .2.1l5.6 5.6c.1.1.1.3 0 .4zm-16.6-.4L10 5.5l-1-1-6.3 6.3c-.7.7-.7 1.8 0 2.5L9 19.5l1.1-1.1-6.3-6.3c-.2 0-.2-.2-.1-.3z" }) });
239 + var symbol_default = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_primitives.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_primitives.Path, { d: "M21.3 10.8l-5.6-5.6c-.7-.7-1.8-.7-2.5 0l-5.6 5.6c-.7.7-.7 1.8 0 2.5l5.6 5.6c.3.3.8.5 1.2.5s.9-.2 1.2-.5l5.6-5.6c.8-.7.8-1.9.1-2.5zm-1 1.4l-5.6 5.6c-.1.1-.3.1-.4 0l-5.6-5.6c-.1-.1-.1-.3 0-.4l5.6-5.6s.1-.1.2-.1.1 0 .2.1l5.6 5.6c.1.1.1.3 0 .4zm-16.6-.4L10 5.5l-1-1-6.3 6.3c-.7.7-.7 1.8 0 2.5L9 19.5l1.1-1.1-6.3-6.3c-.2 0-.2-.2-.1-.3z" }) });
280 240
281 241 // packages/reusable-blocks/build-module/components/reusable-blocks-menu-items/reusable-block-convert-button.mjs
282 242 var import_data3 = __toESM(require_data(), 1);
283 243 var import_i18n2 = __toESM(require_i18n(), 1);
@@ -395,8 +355,9 @@
395 355 children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_components.__experimentalVStack, { spacing: "5", children: [
396 356 /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
397 357 import_components.TextControl,
398 358 {
359 + __next40pxDefaultSize: true,
399 360 label: (0, import_i18n2.__)("Name"),
400 361 value: title,
401 362 onChange: setTitle,
402 363 placeholder: (0, import_i18n2.__)("My pattern")
@@ -452,15 +413,13 @@
452 413 var import_components2 = __toESM(require_components(), 1);
453 414 var import_i18n3 = __toESM(require_i18n(), 1);
454 415 var import_blocks3 = __toESM(require_blocks(), 1);
455 416 var import_data4 = __toESM(require_data(), 1);
456 - var import_element2 = __toESM(require_element(), 1);
457 417 var import_block_editor3 = __toESM(require_block_editor(), 1);
458 418 var import_url = __toESM(require_url(), 1);
459 419 var import_core_data2 = __toESM(require_core_data(), 1);
460 420 var import_jsx_runtime3 = __toESM(require_jsx_runtime(), 1);
461 421 function ReusableBlocksManageButton({ clientId }) {
462 - const [showConfirmDialog, setShowConfirmDialog] = (0, import_element2.useState)(false);
463 422 const { canRemove, isVisible, managePatternsUrl } = (0, import_data4.useSelect)(
464 423 (select) => {
465 424 const { getBlock, canRemoveBlock } = select(import_block_editor3.store);
466 425 const { canUser } = select(import_core_data2.store);
@@ -490,32 +449,11 @@
490 449 const { __experimentalConvertBlockToStatic: convertBlockToStatic } = (0, import_data4.useDispatch)(store);
491 450 if (!isVisible) {
492 451 return null;
493 452 }
494 - const handleDetach = () => {
495 - convertBlockToStatic(clientId);
496 - setShowConfirmDialog(false);
497 - };
498 453 return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx_runtime3.Fragment, { children: [
499 454 /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_components2.MenuItem, { href: managePatternsUrl, children: (0, import_i18n3.__)("Manage patterns") }),
500 - canRemove && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx_runtime3.Fragment, { children: [
501 - /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_components2.MenuItem, { onClick: () => setShowConfirmDialog(true), children: (0, import_i18n3.__)("Disconnect pattern") }),
502 - /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
503 - import_components2.__experimentalConfirmDialog,
504 - {
505 - isOpen: showConfirmDialog,
506 - onConfirm: handleDetach,
507 - onCancel: () => setShowConfirmDialog(false),
508 - confirmButtonText: (0, import_i18n3.__)("Disconnect"),
509 - size: "medium",
510 - title: (0, import_i18n3.__)("Disconnect pattern?"),
511 - __experimentalHideHeader: false,
512 - children: (0, import_i18n3.__)(
513 - "Blocks will be separated from the original pattern and will be fully editable. Future changes to the pattern will not apply here."
514 - )
515 - }
516 - )
517 - ] })
455 + canRemove && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_components2.MenuItem, { onClick: () => convertBlockToStatic(clientId), children: (0, import_i18n3.__)("Disconnect pattern") })
518 456 ] });
519 457 }
520 458 var reusable_blocks_manage_button_default = ReusableBlocksManageButton;
521 459
@@ -521,11 +459,8 @@
521 459
522 460 // packages/reusable-blocks/build-module/components/reusable-blocks-menu-items/index.mjs
523 461 var import_jsx_runtime4 = __toESM(require_jsx_runtime(), 1);
524 462 function ReusableBlocksMenuItems({ rootClientId }) {
525 - (0, import_deprecated3.default)("wp.reusableBlocks.ReusableBlocksMenuItems", {
526 - since: "7.1"
527 - });
528 463 return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_block_editor4.BlockSettingsMenuControls, { children: ({ onClose, selectedClientIds }) => /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
529 464 /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
530 465 ReusableBlockConvertButton,
531 466 {