PluginProbe
Gutenberg / 24.1.0
Gutenberg v24.1.0
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/core-data/index.js +40 -48 24.0.0 → 24.1.0 View file →
@@ -4548,9 +4548,11 @@
4548 4548 );
4549 4549 if (!templates) {
4550 4550 return;
4551 4551 }
4552 - const id = templates.find(({ slug }) => slug === "front-page")?.id;
4552 + const id = templates.find(
4553 + ({ slug }) => slug === "front-page"
4554 + )?.id;
4553 4555 if (id) {
4554 4556 return id;
4555 4557 }
4556 4558 }
@@ -4699,9 +4701,9 @@
4699 4701 return item;
4700 4702 }
4701 4703 return getFilteredItem(item, query._fields);
4702 4704 });
4703 - getEntityRecord.__unstableNormalizeArgs = (args) => {
4705 + getEntityRecord.normalizeArgs = (args) => {
4704 4706 const newArgs = [...args];
4705 4707 const recordKey = newArgs?.[2];
4706 4708 newArgs[2] = isNumericID(recordKey) ? Number(recordKey) : recordKey;
4707 4709 return newArgs;
@@ -6446,8 +6448,9 @@
6446 6448 return results;
6447 6449 }
6448 6450 function sortResults(results, search) {
6449 6451 const searchTokens = tokenize(search);
6452 + const scoreKey = (result) => `${result.kind}:${result.type}:${result.id}`;
6450 6453 const scores = {};
6451 6454 for (const result of results) {
6452 6455 if (result.title) {
6453 6456 const titleTokens = tokenize(result.title);
@@ -6462,14 +6465,16 @@
6462 6465 )
6463 6466 );
6464 6467 const exactMatchScore = exactMatchingTokens.length / titleTokens.length * 10;
6465 6468 const subMatchScore = subMatchingTokens.length / titleTokens.length;
6466 - scores[result.id] = exactMatchScore + subMatchScore;
6469 + scores[scoreKey(result)] = exactMatchScore + subMatchScore;
6467 6470 } else {
6468 - scores[result.id] = 0;
6471 + scores[scoreKey(result)] = 0;
6469 6472 }
6470 6473 }
6471 - return results.sort((a, b) => scores[b.id] - scores[a.id]);
6474 + return results.sort(
6475 + (a, b) => scores[scoreKey(b)] - scores[scoreKey(a)]
6476 + );
6472 6477 }
6473 6478 function tokenize(text) {
6474 6479 return text.toLowerCase().match(/[\p{L}\p{N}]+/gu) || [];
6475 6480 }
@@ -6607,9 +6612,8 @@
6607 6612 const record = await response.json();
6608 6613 const permissions = getUserPermissionsFromAllowHeader(
6609 6614 response.headers?.get("allow")
6610 6615 );
6611 - const canUserResolutionsArgs = [];
6612 6616 const receiveUserPermissionArgs = {};
6613 6617 for (const action of ALLOWED_RESOURCE_ACTIONS) {
6614 6618 receiveUserPermissionArgs[getUserPermissionCacheKey(action, {
6615 6619 kind,
@@ -6615,13 +6619,10 @@
6615 6619 kind,
6616 6620 name,
6617 6621 id: key
6618 6622 })] = permissions[action];
6619 - canUserResolutionsArgs.push([
6620 - action,
6621 - { kind, name, id: key }
6622 - ]);
6623 6623 }
6624 + const canUserResolutionsArgs = [[{ kind, name, id: key }]];
6624 6625 if (entityConfig.syncConfig && isNumericID(key) && !query) {
6625 6626 const objectType = `${kind}/${name}`;
6626 6627 const objectId = key;
6627 6628 const recordWithTransients = { ...record };
@@ -6895,13 +6896,12 @@
6895 6896 }));
6896 6897 const canUserResolutionsArgs = [];
6897 6898 const receiveUserPermissionArgs = {};
6898 6899 for (const targetHint of targetHints) {
6900 + canUserResolutionsArgs.push([
6901 + { kind, name, id: targetHint.id }
6902 + ]);
6899 6903 for (const action of ALLOWED_RESOURCE_ACTIONS) {
6900 - canUserResolutionsArgs.push([
6901 - action,
6902 - { kind, name, id: targetHint.id }
6903 - ]);
6904 6904 receiveUserPermissionArgs[getUserPermissionCacheKey(action, {
6905 6905 kind,
6906 6906 name,
6907 6907 id: targetHint.id
@@ -6950,26 +6950,9 @@
6950 6950 } catch {
6951 6951 dispatch3.receiveEmbedPreview(url, false);
6952 6952 }
6953 6953 };
6954 - var canUser2 = (requestedAction, resource, id) => async ({ dispatch: dispatch3, registry, resolveSelect: resolveSelect2 }) => {
6955 - if (!ALLOWED_RESOURCE_ACTIONS.includes(requestedAction)) {
6956 - throw new Error(`'${requestedAction}' is not a valid action.`);
6957 - }
6958 - const { hasStartedResolution } = registry.select(STORE_NAME);
6959 - for (const relatedAction of ALLOWED_RESOURCE_ACTIONS) {
6960 - if (relatedAction === requestedAction) {
6961 - continue;
6962 - }
6963 - const isAlreadyResolving = hasStartedResolution("canUser", [
6964 - relatedAction,
6965 - resource,
6966 - id
6967 - ]);
6968 - if (isAlreadyResolving) {
6969 - return;
6970 - }
6971 - }
6954 + var canUser2 = (resource, id) => async ({ dispatch: dispatch3, resolveSelect: resolveSelect2 }) => {
6972 6955 let resourcePath = null;
6973 6956 if (typeof resource === "object") {
6974 6957 if (!resource.kind || !resource.name) {
6975 6958 throw new Error("The entity resource object is not valid.");
@@ -7000,22 +6983,16 @@
7000 6983 const permissions = getUserPermissionsFromAllowHeader(
7001 6984 response.headers?.get("allow")
7002 6985 );
7003 6986 const receiveUserPermissionArgs = {};
7004 - const canUserResolutionsArgs = [];
7005 6987 for (const action of ALLOWED_RESOURCE_ACTIONS) {
7006 6988 receiveUserPermissionArgs[getUserPermissionCacheKey(action, resource, id)] = permissions[action];
7007 - if (action !== requestedAction) {
7008 - canUserResolutionsArgs.push([action, resource, id]);
7009 - }
7010 6989 }
7011 - registry.batch(() => {
7012 - dispatch3.receiveUserPermissions(receiveUserPermissionArgs);
7013 - dispatch3.finishResolutions("canUser", canUserResolutionsArgs);
7014 - });
6990 + dispatch3.receiveUserPermissions(receiveUserPermissionArgs);
7015 6991 };
7016 - var canUserEditEntityRecord2 = (kind, name, recordId) => async ({ dispatch: dispatch3 }) => {
7017 - await dispatch3(canUser2("update", { kind, name, id: recordId }));
6992 + canUser2.getResolutionArgs = (action, resource, id) => [resource, id];
6993 + var canUserEditEntityRecord2 = (kind, name, recordId) => async ({ resolveSelect: resolveSelect2 }) => {
6994 + await resolveSelect2.canUser("update", { kind, name, id: recordId });
7018 6995 };
7019 6996 var getAutosaves2 = (postType, postId) => async ({ dispatch: dispatch3, resolveSelect: resolveSelect2 }) => {
7020 6997 const {
7021 6998 rest_base: restBase,
@@ -8487,34 +8464,49 @@
8487 8464
8488 8465 // packages/icons/build-module/library/footer.mjs
8489 8466 var import_primitives = __toESM(require_primitives(), 1);
8490 8467 var import_jsx_runtime2 = __toESM(require_jsx_runtime(), 1);
8491 - var footer_default = /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_primitives.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_primitives.Path, { fillRule: "evenodd", d: "M18 5.5h-8v8h8.5V6a.5.5 0 00-.5-.5zm-9.5 8h-3V6a.5.5 0 01.5-.5h2.5v8zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z" }) });
8468 + var footer_default = /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_primitives.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: [
8469 + /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_primitives.Path, { d: "M9.75 4.75H18C18.6904 4.75 19.25 5.30964 19.25 6V14.25M9.75 4.75H6C5.30964 4.75 4.75 5.30964 4.75 6V14.25M9.75 4.75V14.25M19.25 14.25V18C19.25 18.6904 18.6904 19.25 18 19.25H6C5.30964 19.25 4.75 18.6904 4.75 18V14.25M19.25 14.25H9.75M9.75 14.25H4.75", vectorEffect: "non-scaling-stroke" }),
8470 + /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_primitives.Path, { d: "M19.25 15.5V18C19.25 18.6904 18.6904 19.25 18 19.25H6C5.30964 19.25 4.75 18.6904 4.75 18V15.5C4.75 14.8096 5.30964 14.25 6 14.25H18C18.6904 14.25 19.25 14.8096 19.25 15.5Z", fill: "currentColor", vectorEffect: "non-scaling-stroke" })
8471 + ] });
8492 8472
8493 8473 // packages/icons/build-module/library/header.mjs
8494 8474 var import_primitives2 = __toESM(require_primitives(), 1);
8495 8475 var import_jsx_runtime3 = __toESM(require_jsx_runtime(), 1);
8496 - var header_default = /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_primitives2.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_primitives2.Path, { d: "M18.5 10.5H10v8h8a.5.5 0 00.5-.5v-7.5zm-10 0h-3V18a.5.5 0 00.5.5h2.5v-8zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z" }) });
8476 + var header_default = /* @__PURE__ */ (0, import_jsx_runtime3.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: [
8477 + /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_primitives2.Path, { d: "M9.75 19.25H18C18.6904 19.25 19.25 18.6904 19.25 18V9.75M9.75 19.25H6C5.30964 19.25 4.75 18.6904 4.75 18V9.75M9.75 19.25V9.75M19.25 9.75V6C19.25 5.30964 18.6904 4.75 18 4.75H6C5.30964 4.75 4.75 5.30964 4.75 6V9.75M19.25 9.75H9.75M9.75 9.75H4.75", vectorEffect: "non-scaling-stroke" }),
8478 + /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_primitives2.Path, { d: "M19.25 8.5V6C19.25 5.30964 18.6904 4.75 18 4.75H6C5.30964 4.75 4.75 5.30964 4.75 6V8.5C4.75 9.19036 5.30964 9.75 6 9.75H18C18.6904 9.75 19.25 9.19036 19.25 8.5Z", fill: "currentColor", vectorEffect: "non-scaling-stroke" })
8479 + ] });
8497 8480
8498 8481 // packages/icons/build-module/library/layout.mjs
8499 8482 var import_primitives3 = __toESM(require_primitives(), 1);
8500 8483 var import_jsx_runtime4 = __toESM(require_jsx_runtime(), 1);
8501 - var layout_default = /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_primitives3.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_primitives3.Path, { d: "M18 5.5H6a.5.5 0 00-.5.5v3h13V6a.5.5 0 00-.5-.5zm.5 5H10v8h8a.5.5 0 00.5-.5v-7.5zm-10 0h-3V18a.5.5 0 00.5.5h2.5v-8zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z" }) });
8484 + var layout_default = /* @__PURE__ */ (0, import_jsx_runtime4.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_runtime4.jsx)(import_primitives3.Path, { d: "M9.75 19.25H18C18.6904 19.25 19.25 18.6904 19.25 18V9.75M9.75 19.25H6C5.30964 19.25 4.75 18.6904 4.75 18V9.75M9.75 19.25V9.75M19.25 9.75V6C19.25 5.30964 18.6904 4.75 18 4.75H6C5.30964 4.75 4.75 5.30964 4.75 6V9.75M19.25 9.75H9.75M9.75 9.75H4.75", vectorEffect: "non-scaling-stroke" }) });
8502 8485
8503 8486 // packages/icons/build-module/library/navigation-overlay.mjs
8504 8487 var import_primitives4 = __toESM(require_primitives(), 1);
8505 8488 var import_jsx_runtime5 = __toESM(require_jsx_runtime(), 1);
8506 - var navigation_overlay_default = /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_primitives4.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_primitives4.Path, { d: "M18.5 10a1.5 1.5 0 0 1 1.5 1.5v7a1.5 1.5 0 0 1-1.5 1.5h-7a1.5 1.5 0 0 1-1.5-1.5v-7a1.5 1.5 0 0 1 1.5-1.5zM16 4a2 2 0 0 1 2 2v2h-1.5V6a.5.5 0 0 0-.5-.5H6a.5.5 0 0 0-.5.5v3H8v1.5H5.5V16a.5.5 0 0 0 .5.5h2V18H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2z" }) });
8489 + var navigation_overlay_default = /* @__PURE__ */ (0, import_jsx_runtime5.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: [
8490 + /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_primitives4.Path, { d: "M4.75 9.25V16C4.75 16.6904 5.30964 17.25 6 17.25H8M4.75 9.25V6C4.75 5.30964 5.30964 4.75 6 4.75H16C16.6904 4.75 17.25 5.30964 17.25 6V8M4.75 9.25H8", vectorEffect: "non-scaling-stroke" }),
8491 + /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_primitives4.Path, { d: "M10.75 11.25C10.75 10.9739 10.9739 10.75 11.25 10.75H18.75C19.0261 10.75 19.25 10.9739 19.25 11.25V18.75C19.25 19.0261 19.0261 19.25 18.75 19.25H11.25C10.9739 19.25 10.75 19.0261 10.75 18.75V11.25Z", fill: "currentColor", vectorEffect: "non-scaling-stroke" })
8492 + ] });
8507 8493
8508 8494 // packages/icons/build-module/library/sidebar.mjs
8509 8495 var import_primitives5 = __toESM(require_primitives(), 1);
8510 8496 var import_jsx_runtime6 = __toESM(require_jsx_runtime(), 1);
8511 - var sidebar_default = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_primitives5.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_primitives5.Path, { d: "M18 5.5H6a.5.5 0 00-.5.5v3h13V6a.5.5 0 00-.5-.5zm.5 5H10v8h8a.5.5 0 00.5-.5v-7.5zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z" }) });
8497 + var sidebar_default = /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_primitives5.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: [
8498 + /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_primitives5.Path, { d: "M9.75 19.25H18C18.6904 19.25 19.25 18.6904 19.25 18V9.75M9.75 19.25H6C5.30964 19.25 4.75 18.6904 4.75 18V9.75M9.75 19.25V9.75M19.25 9.75V6C19.25 5.30964 18.6904 4.75 18 4.75H6C5.30964 4.75 4.75 5.30964 4.75 6V9.75M19.25 9.75H9.75M9.75 9.75H4.75", vectorEffect: "non-scaling-stroke" }),
8499 + /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_primitives5.Path, { d: "M6 19.25H9.75V9.75H4.75V18C4.75 18.6904 5.30964 19.25 6 19.25Z", fill: "currentColor", vectorEffect: "non-scaling-stroke" })
8500 + ] });
8512 8501
8513 8502 // packages/icons/build-module/library/symbol-filled.mjs
8514 8503 var import_primitives6 = __toESM(require_primitives(), 1);
8515 8504 var import_jsx_runtime7 = __toESM(require_jsx_runtime(), 1);
8516 - var symbol_filled_default = /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_primitives6.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_primitives6.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-17.6 1L10 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" }) });
8505 + var symbol_filled_default = /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_primitives6.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: [
8506 + /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_primitives6.Path, { d: "M15.2071 6.20711L20.2929 11.2929C20.6834 11.6834 20.6834 12.3166 20.2929 12.7071L15.2071 17.7929C14.8166 18.1834 14.1834 18.1834 13.7929 17.7929L8.70711 12.7071C8.31658 12.3166 8.31658 11.6834 8.70711 11.2929L13.7929 6.20711C14.1834 5.81658 14.8166 5.81658 15.2071 6.20711Z", fill: "currentColor", vectorEffect: "non-scaling-stroke" }),
8507 + /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_primitives6.Path, { d: "M9.5 5.5L3.70711 11.2929C3.31658 11.6834 3.31658 12.3166 3.70711 12.7071L9.5 18.5", vectorEffect: "non-scaling-stroke" })
8508 + ] });
8517 8509
8518 8510 // packages/core-data/build-module/utils/get-template-part-icon.mjs
8519 8511 function getTemplatePartIcon(areaOrIconName) {
8520 8512 if ("header" === areaOrIconName) {