PluginProbe
Gutenberg / trunk
Gutenberg vtrunk
24.1.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 All 404 releases
← All changes | build/scripts/widgets/index.js +19 -19 23.4.0 → trunk View file →
@@ -1,4 +1,5 @@
1 +(function() {
1 2 var wp;
2 3 (wp ||= {}).widgets = (() => {
3 4 var __create = Object.create;
4 5 var __defProp = Object.defineProperty;
@@ -137,24 +138,30 @@
137 138
138 139 // packages/icons/build-module/library/brush.mjs
139 140 var import_primitives = __toESM(require_primitives(), 1);
140 141 var import_jsx_runtime = __toESM(require_jsx_runtime(), 1);
141 - var brush_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: "M4 20h8v-1.5H4V20zM18.9 3.5c-.6-.6-1.5-.6-2.1 0l-7.2 7.2c-.4-.1-.7 0-1.1.1-.5.2-1.5.7-1.9 2.2-.4 1.7-.8 2.2-1.1 2.7-.1.1-.2.3-.3.4l-.6 1.1H6c2 0 3.4-.4 4.7-1.4.8-.6 1.2-1.4 1.3-2.3 0-.3 0-.5-.1-.7L19 5.7c.5-.6.5-1.6-.1-2.2zM9.7 14.7c-.7.5-1.5.8-2.4 1 .2-.5.5-1.2.8-2.3.2-.6.4-1 .8-1.1.5-.1 1 .1 1.3.3.2.2.3.5.2.8 0 .3-.1.9-.7 1.3z" }) });
142 + var brush_default = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_primitives.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_primitives.Path, { d: "M17 15.25L17.5858 14.6642C18.3668 13.8832 18.3668 12.6168 17.5858 11.8358L16.7071 10.9571C16.3166 10.5666 16.3166 9.93342 16.7071 9.54289L20 6.25C20.5523 5.69772 20.5523 4.80228 20 4.25C19.4477 3.69772 18.5523 3.69771 18 4.25L14.7071 7.54289C14.3166 7.93342 13.6834 7.93342 13.2929 7.54289L12.4142 6.66421C11.6332 5.88316 10.3668 5.88316 9.58579 6.66421L9 7.25M17 15.25L14.1213 18.1287C12.9497 19.3003 11.0503 19.3003 9.87868 18.1287L8 16.25M17 15.25L9 7.25M9 7.25L4 12.25L6 14.25M6 14.25L8 12.25M6 14.25L8 16.25M8 16.25L10 14.25", vectorEffect: "non-scaling-stroke" }) });
142 143
143 144 // packages/icons/build-module/library/group.mjs
144 145 var import_primitives2 = __toESM(require_primitives(), 1);
145 146 var import_jsx_runtime2 = __toESM(require_jsx_runtime(), 1);
146 - var group_default = /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_primitives2.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_primitives2.Path, { d: "M18 4h-7c-1.1 0-2 .9-2 2v3H6c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2h7c1.1 0 2-.9 2-2v-3h3c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-4.5 14c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5v-7c0-.3.2-.5.5-.5h3V13c0 1.1.9 2 2 2h2.5v3zm0-4.5H11c-.3 0-.5-.2-.5-.5v-2.5H13c.3 0 .5.2.5.5v2.5zm5-.5c0 .3-.2.5-.5.5h-3V11c0-1.1-.9-2-2-2h-2.5V6c0-.3.2-.5.5-.5h7c.3 0 .5.2.5.5v7z" }) });
147 + var group_default = /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_primitives2.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: [
148 + /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_primitives2.Path, { d: "M4.75 11C4.75 10.3096 5.30964 9.75 6 9.75H13C13.6904 9.75 14.25 10.3096 14.25 11V18C14.25 18.6904 13.6904 19.25 13 19.25H6C5.30964 19.25 4.75 18.6904 4.75 18V11Z", vectorEffect: "non-scaling-stroke" }),
149 + /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_primitives2.Path, { d: "M9.75 6C9.75 5.30964 10.3096 4.75 11 4.75H18C18.6904 4.75 19.25 5.30964 19.25 6V13C19.25 13.6904 18.6904 14.25 18 14.25H11C10.3096 14.25 9.75 13.6904 9.75 13V6Z", vectorEffect: "non-scaling-stroke" })
150 + ] });
147 151
148 152 // packages/icons/build-module/library/move-to.mjs
149 153 var import_primitives3 = __toESM(require_primitives(), 1);
150 154 var import_jsx_runtime3 = __toESM(require_jsx_runtime(), 1);
151 - var move_to_default = /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_primitives3.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_primitives3.Path, { d: "M19.75 9c0-1.257-.565-2.197-1.39-2.858-.797-.64-1.827-1.017-2.815-1.247-1.802-.42-3.703-.403-4.383-.396L11 4.5V6l.177-.001c.696-.006 2.416-.02 4.028.356.887.207 1.67.518 2.216.957.52.416.829.945.829 1.688 0 .592-.167.966-.407 1.23-.255.281-.656.508-1.236.674-1.19.34-2.82.346-4.607.346h-.077c-1.692 0-3.527 0-4.942.404-.732.209-1.424.545-1.935 1.108-.526.579-.796 1.33-.796 2.238 0 1.257.565 2.197 1.39 2.858.797.64 1.827 1.017 2.815 1.247 1.802.42 3.703.403 4.383.396L13 19.5h.714V22L18 18.5 13.714 15v3H13l-.177.001c-.696.006-2.416.02-4.028-.356-.887-.207-1.67-.518-2.216-.957-.52-.416-.829-.945-.829-1.688 0-.592.167-.966.407-1.23.255-.281.656-.508 1.237-.674 1.189-.34 2.819-.346 4.606-.346h.077c1.692 0 3.527 0 4.941-.404.732-.209 1.425-.545 1.936-1.108.526-.579.796-1.33.796-2.238z" }) });
155 + var move_to_default = /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_primitives3.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_primitives3.Path, { d: "M11 4H15C16.933 4 18.5 5.567 18.5 7.5C18.5 9.433 16.933 11 15 11H8.5C6.567 11 5 12.567 5 14.5C5 16.433 6.567 18 8.5 18H11H17M14 21L17 18L14 15", vectorEffect: "non-scaling-stroke" }) });
152 156
153 157 // packages/icons/build-module/library/widget.mjs
154 158 var import_primitives4 = __toESM(require_primitives(), 1);
155 159 var import_jsx_runtime4 = __toESM(require_jsx_runtime(), 1);
156 - var widget_default = /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_primitives4.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_primitives4.Path, { d: "M6 3H8V5H16V3H18V5C19.1046 5 20 5.89543 20 7V19C20 20.1046 19.1046 21 18 21H6C4.89543 21 4 20.1046 4 19V7C4 5.89543 4.89543 5 6 5V3ZM18 6.5H6C5.72386 6.5 5.5 6.72386 5.5 7V8H18.5V7C18.5 6.72386 18.2761 6.5 18 6.5ZM18.5 9.5H5.5V19C5.5 19.2761 5.72386 19.5 6 19.5H18C18.2761 19.5 18.5 19.2761 18.5 19V9.5ZM11 11H13V13H11V11ZM7 11V13H9V11H7ZM15 13V11H17V13H15Z" }) });
160 + var widget_default = /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_primitives4.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: [
161 + /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_primitives4.Path, { d: "M19.25 8.25V7C19.25 6.30964 18.6904 5.75 18 5.75H17M7 5.75H6C5.30964 5.75 4.75 6.30964 4.75 7V8.25L4.75 19C4.75 19.6904 5.30964 20.25 6 20.25H18C18.6904 20.25 19.25 19.6904 19.25 19V8.25M19.25 8.25H4.75M7.25 11.75H9.25M11 11.75H13M14.75 11.75H16.75M7 5.75V3M7 5.75H17M17 5.75V3", vectorEffect: "non-scaling-stroke" }),
162 + /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_primitives4.Path, { d: "M18 5.75H6C5.30964 5.75 4.75 6.30964 4.75 7V8.25H19.25V7C19.25 6.30964 18.6904 5.75 18 5.75Z", fill: "currentColor", vectorEffect: "non-scaling-stroke" })
163 + ] });
157 164
158 165 // packages/widgets/build-module/blocks/legacy-widget/block.json
159 166 var block_default = {
160 167 $schema: "https://schemas.wp.org/trunk/block.json",
@@ -229,9 +236,8 @@
229 236 }
230 237 return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
231 238 import_components.SelectControl,
232 239 {
233 - __next40pxDefaultSize: true,
234 240 label: (0, import_i18n.__)("Legacy widget"),
235 241 value: selectedId ?? "",
236 242 options: [
237 243 { value: "", label: (0, import_i18n.__)("Select widget") },
@@ -1000,11 +1006,9 @@
1000 1006 },
1001 1007 {
1002 1008 block: "core/html",
1003 1009 widget: "custom_html",
1004 - transform: ({ content }) => ({
1005 - content
1006 - })
1010 + transformBlock: ({ content }) => (0, import_blocks2.createBlock)("core/html", {}, [], [content])
1007 1011 },
1008 1012 {
1009 1013 block: "core/archives",
1010 1014 widget: "archives",
@@ -1145,9 +1149,9 @@
1145 1149 itemsToShow: items
1146 1150 };
1147 1151 }
1148 1152 }
1149 - ].map(({ block, widget, transform }) => {
1153 + ].map(({ block, widget, transform, transformBlock }) => {
1150 1154 return {
1151 1155 type: "block",
1152 1156 blocks: [block],
1153 1157 isMatch: ({ idBase, instance }) => {
@@ -1153,9 +1157,9 @@
1153 1157 isMatch: ({ idBase, instance }) => {
1154 1158 return idBase === widget && !!instance?.raw;
1155 1159 },
1156 1160 transform: ({ instance }) => {
1157 - const transformedBlock = (0, import_blocks2.createBlock)(
1161 + const transformedBlock = transformBlock ? transformBlock(instance.raw) : (0, import_blocks2.createBlock)(
1158 1162 block,
1159 1163 transform ? transform(instance.raw) : void 0
1160 1164 );
1161 1165 if (!instance.raw?.title) {
@@ -1331,17 +1335,11 @@
1331 1335 (block) => block.name === "core/widget-group"
1332 1336 );
1333 1337 },
1334 1338 __experimentalConvert(blocks) {
1335 - let innerBlocks = [
1336 - ...blocks.map((block) => {
1337 - return (0, import_blocks3.createBlock)(
1338 - block.name,
1339 - block.attributes,
1340 - block.innerBlocks
1341 - );
1342 - })
1343 - ];
1339 + let innerBlocks = blocks.map(
1340 + (block) => (0, import_blocks3.cloneSanitizedBlock)(block)
1341 + );
1344 1342 const firstHeadingBlock = innerBlocks[0].name === "core/heading" ? innerBlocks[0] : null;
1345 1343 innerBlocks = innerBlocks.filter(
1346 1344 (block) => block !== firstHeadingBlock
1347 1345 );
@@ -1466,6 +1464,8 @@
1466 1464 }
1467 1465 );
1468 1466 }
1469 1467 return __toCommonJS(index_exports);
1468 +})();
1469 +(window.wp ||= {}).widgets = wp.widgets;
1470 1470 })();
1471 1471 //# sourceMappingURL=index.js.map