@nocode-factory/sanity-kit 2.58.0 → 2.60.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
- import { _ as DEFAULT_PAGE_BUILDER_FIELD, a as depth, c as segments, d as normalizePath, f as resolveConfig, g as DEFAULT_INTERNAL_FIELDS, h as DEFAULT_I18N, i as redirectMapOf, l as toPath, m as DEFAULT_COMPONENT_PREVIEW, o as pageTypeFor, p as DEFAULT_BOARD_TAGS, s as parentPath, t as finalPath, u as toUrl, v as DEFAULT_SLUG_FIELD, y as DEFAULT_TITLE_FIELD } from "./finalUrl-IXF3zbT9.js";
1
+ import { _ as DEFAULT_PAGE_BUILDER_FIELD, a as depth, c as segments, d as normalizePath, f as resolveConfig, g as DEFAULT_INTERNAL_FIELDS, h as DEFAULT_I18N, i as redirectMapOf, l as toPath, m as DEFAULT_COMPONENT_PREVIEW, o as pageTypeFor, p as DEFAULT_BOARD_TAGS, s as parentPath, t as finalPath, u as toUrl, v as DEFAULT_SLUG_FIELD, y as DEFAULT_TITLE_FIELD } from "./finalUrl-DYyjKCjh.js";
2
2
  import { a as collectTexts$1, c as valueAtKey, d as useKitContext, f as useOptionalKitConfig, i as guessDocumentTitle, l as KitProvider, o as replaceTexts, p as useOptionalKitContext, r as collectDocumentText, s as setAtKey, t as generateJsonLd, u as useKitConfig } from "./aiJsonLd-BFyxgYen.js";
3
3
  import { n as isReplaceImageRequest, r as replaceImagePatch } from "./protocol-Bl7Yj2Ro.js";
4
- import { a as componentDefaultsMainDocument, c as defineComponentDefaults, d as syncTranslationRedirects, f as translationRedirectId, i as DEFAULT_COMPONENT_DEFAULTS_TYPE, l as requiredUnlessDefault, n as withSameLanguageReferences, o as componentDefaultsMainDocuments, p as translationRedirectOptions, r as pageTypesFromSiteRoutes, s as defaultsFieldName, t as fixCrossLanguageReferences, u as requiredUnlessDefaultFor } from "./fixCrossLanguageReferences-CDczoic9.js";
4
+ import { a as componentDefaultsMainDocument, c as defineComponentDefaults, d as syncTranslationRedirects, f as translationRedirectId, i as DEFAULT_COMPONENT_DEFAULTS_TYPE, l as requiredUnlessDefault, n as withSameLanguageReferences, o as componentDefaultsMainDocuments, p as translationRedirectOptions, r as pageTypesFromSiteRoutes, s as defaultsFieldName, t as fixCrossLanguageReferences, u as requiredUnlessDefaultFor } from "./fixCrossLanguageReferences-C4A61VWW.js";
5
5
  import { i as codeEditorInput, n as CodeEmbedInput, r as CodeEditorInput, t as defineCodeEmbedType } from "./codeEmbedType-1bEOTxBT.js";
6
6
  import { createContext, createElement, forwardRef, memo, useCallback, useContext, useEffect, useLayoutEffect, useMemo, useRef, useState, useSyncExternalStore } from "react";
7
7
  import { ToolLink, defineField, definePlugin, defineType, pathToString, set, unset, useClient, useCurrentUser, useDocumentOperation, useFormValue, usePerspective, useSchema, useSetPerspective, useUser, useWorkspace } from "sanity";
@@ -1423,7 +1423,7 @@ function explainGrantError(error) {
1423
1423
  * quelle version. Recopiée de `package.json` par `npm version` (scripts/sync-version.mjs) ; un test
1424
1424
  * le vérifie.
1425
1425
  */
1426
- const KIT_VERSION = "2.58.0";
1426
+ const KIT_VERSION = "2.60.0";
1427
1427
  /**
1428
1428
  * Signale ce Studio au service du kit, une fois par montage.
1429
1429
  *
@@ -1921,7 +1921,7 @@ function useKitUpdate() {
1921
1921
  !controller.signal.aborted && body?.version && setLatest(body.version);
1922
1922
  }).catch(() => {}), () => controller.abort();
1923
1923
  }, []);
1924
- let available = !!(latest && !isPrerelease(latest) && compareVersions(latest, "2.58.0") > 0);
1924
+ let available = !!(latest && !isPrerelease(latest) && compareVersions(latest, "2.60.0") > 0);
1925
1925
  return {
1926
1926
  current: KIT_VERSION,
1927
1927
  latest,
@@ -10795,7 +10795,7 @@ function AssetsTool() {
10795
10795
  });
10796
10796
  }
10797
10797
  /**
10798
- * Menu « + » du Studio en situation monolingue. Pur.
10798
+ * Menu « + » du Studio (monolingue, et multilingue depuis la 2.59.0). Pur.
10799
10799
  *
10800
10800
  * `@sanity/document-internationalization` ajoute, pour chaque type traduit, un
10801
10801
  * template « paramétré » (`${type}-parameterized`) et un template statique par
@@ -10803,8 +10803,9 @@ function AssetsTool() {
10803
10803
  * Avec une seule langue branchée, ces deux-là font doublon avec le « + Article »
10804
10804
  * de base : le menu de création montre « + Article » ET « + Français Article ».
10805
10805
  *
10806
- * On ne garde alors que la base. Avec plusieurs langues on ne touche à rien
10807
- * (« + master » et « + langues » sont voulus).
10806
+ * On ne garde alors que la base. MULTILINGUE (kit configuré avec `i18n`) : la base
10807
+ * crée dans la langue principale (withMasterLanguageBaseTemplates) ; on retire son
10808
+ * doublon « + Français Article » et le paramétré, les autres langues restent.
10808
10809
  *
10809
10810
  * Détection sans connaître la liste des langues : le template `-parameterized`
10810
10811
  * est la signature du plugin ; s'il n'existe qu'UN statique pour ce type (et que
@@ -10812,17 +10813,46 @@ function AssetsTool() {
10812
10813
  * plusieurs statiques : on laisse tout, par prudence — jamais retirer la seule
10813
10814
  * façon de créer un document.
10814
10815
  */
10815
- function dropRedundantLanguageTemplates(options) {
10816
+ function dropRedundantLanguageTemplates(options, i18n) {
10816
10817
  let ids = new Set(options.map((option) => option.templateId)), remove = /* @__PURE__ */ new Set();
10817
10818
  for (let { templateId } of options) {
10818
10819
  if (!templateId.endsWith("-parameterized")) continue;
10819
10820
  let base = templateId.slice(0, -14);
10820
10821
  if (!ids.has(base)) continue;
10822
+ if (i18n && ids.has(`${base}-${i18n.defaultLocale}`)) {
10823
+ remove.add(templateId), remove.add(`${base}-${i18n.defaultLocale}`);
10824
+ continue;
10825
+ }
10821
10826
  let statics = options.filter((option) => option.templateId !== templateId && option.templateId.startsWith(`${base}-`)), only = statics.length === 1 ? statics[0] : void 0;
10822
10827
  only && (remove.add(templateId), remove.add(only.templateId));
10823
10828
  }
10824
10829
  return options.filter((option) => !remove.has(option.templateId));
10825
10830
  }
10831
+ /**
10832
+ * MULTILINGUE : le template de BASE d'un type traduit (« + Article ») crée un
10833
+ * document SANS langue (document-internationalization ne la pose que dans ses
10834
+ * templates « + Français Article » / « + English Article »). Un tel document est
10835
+ * invisible du site (requêtes filtrées sur la langue) et hors des listes par
10836
+ * langue. Le kit fait créer la base dans la langue PRINCIPALE (règle : le contenu
10837
+ * naît dans la langue master, les autres langues suivent par traduction). Une
10838
+ * langue déjà fixée par le template d'origine est respectée.
10839
+ */
10840
+ function withMasterLanguageBaseTemplates(templates, i18n, isTranslated) {
10841
+ return templates.map((template) => {
10842
+ if (template.id !== template.schemaType || !isTranslated(template.schemaType)) return template;
10843
+ let original = template.value, value = async (params, context) => {
10844
+ let resolved = typeof original == "function" ? await original(params, context) : original, base = resolved && typeof resolved == "object" ? resolved : {};
10845
+ return base[i18n.field] ? base : {
10846
+ ...base,
10847
+ [i18n.field]: i18n.defaultLocale
10848
+ };
10849
+ };
10850
+ return {
10851
+ ...template,
10852
+ value
10853
+ };
10854
+ });
10855
+ }
10826
10856
  const store$1 = /* @__PURE__ */ new Map();
10827
10857
  function entryFor$1(client, type, languageField, language) {
10828
10858
  let { projectId, dataset } = client.config(), key = `${projectId}:${dataset}:${type}:${language ?? ""}`, entry = store$1.get(key);
@@ -12566,14 +12596,35 @@ const pathOf = (preview) => {
12566
12596
  } catch {
12567
12597
  return null;
12568
12598
  }
12599
+ }, FOLDERS_KEY = "ncf-presentation-folders", readFolders = () => {
12600
+ try {
12601
+ return JSON.parse(window.localStorage.getItem(FOLDERS_KEY) || "{}");
12602
+ } catch {
12603
+ return {};
12604
+ }
12569
12605
  };
12570
12606
  /**
12571
12607
  * Liste des pages à gauche de l'aperçu (Presentation) : passer d'une page à l'autre
12572
12608
  * sans repasser par Structure. Langue de la page affichée par défaut, recherche par
12573
12609
  * titre ou adresse ; un clic ouvre la page dans l'aperçu ET son document à côté.
12610
+ * - À la racine : l'accueil et les pages ; puis un DOSSIER repliable par collection à
12611
+ * pages (préfixe d'adresse, ex. « Actualités /actualites/… »), avec son nombre de
12612
+ * fiches, ouvert s'il contient la page affichée ou pendant une recherche.
12613
+ * - Glisser-déposer (poignée) : réordonne les pages, dans leur groupe (racine ou
12614
+ * dossier). Ordre partagé, repris par l'onglet Pages (tri « manual »).
12574
12615
  */
12575
12616
  function PagesNavigator() {
12576
- let config = useKitConfig(), { rows, loading } = usePages(), { pageOrder, savePageOrder } = useBoardLayout(), params = usePresentationParams(!1), navigate = usePresentationNavigate(), i18n = config.i18n, shownLocale = localeOfPreview(params?.preview, i18n), [locale, setLocale] = useState(null), [search, setSearch] = useState(""), [dragId, setDragId] = useState(null), activeLocale = locale ?? shownLocale ?? i18n?.defaultLocale ?? "", current = pathOf(params?.preview), withPath = useMemo(() => rows.filter((r) => r.path !== null).sort((a, b) => (a.path ?? "").localeCompare(b.path ?? "")), [rows]), visible = useMemo(() => {
12617
+ let config = useKitConfig(), schema = useSchema(), { rows, loading } = usePages(), { pageOrder, savePageOrder } = useBoardLayout(), params = usePresentationParams(!1), navigate = usePresentationNavigate(), i18n = config.i18n, shownLocale = localeOfPreview(params?.preview, i18n), [locale, setLocale] = useState(null), [search, setSearch] = useState(""), [drag, setDrag] = useState(null), [open, setOpen] = useState(() => typeof window > "u" ? {} : readFolders()), activeLocale = locale ?? shownLocale ?? i18n?.defaultLocale ?? "", current = pathOf(params?.preview), folderTypes = useMemo(() => config.pageTypes.filter((t) => t.pathPrefix).map((t) => ({
12618
+ type: t.type,
12619
+ label: config.collectionLabels[t.type] || schema.get(t.type)?.title || t.type,
12620
+ prefix: i18n && (t.localizedPrefixes?.[activeLocale] ?? t.localizedPrefixes?.[i18n.defaultLocale]) || t.pathPrefix || ""
12621
+ })), [
12622
+ config.pageTypes,
12623
+ config.collectionLabels,
12624
+ schema,
12625
+ i18n,
12626
+ activeLocale
12627
+ ]), folderOf = useMemo(() => new Set(folderTypes.map((f) => f.type)), [folderTypes]), withPath = useMemo(() => rows.filter((r) => r.path !== null).sort((a, b) => (a.path ?? "").localeCompare(b.path ?? "")), [rows]), visible = useMemo(() => {
12577
12628
  let q = search.trim().toLowerCase();
12578
12629
  return orderByIds(withPath.filter((r) => !i18n || !activeLocale || !r.locale || r.locale === activeLocale).filter((r) => !q || r.title.toLowerCase().includes(q) || (r.path ?? "").toLowerCase().includes(q)), pageOrder);
12579
12630
  }, [
@@ -12582,11 +12633,108 @@ function PagesNavigator() {
12582
12633
  activeLocale,
12583
12634
  i18n,
12584
12635
  pageOrder
12585
- ]), onReorder = (targetId) => {
12586
- if (!dragId) return;
12636
+ ]), groups = useMemo(() => ({
12637
+ root: visible.filter((r) => !folderOf.has(r.type)),
12638
+ folders: folderTypes.map((f) => ({
12639
+ ...f,
12640
+ rows: visible.filter((r) => r.type === f.type)
12641
+ })).filter((f) => f.rows.length)
12642
+ }), [
12643
+ visible,
12644
+ folderTypes,
12645
+ folderOf
12646
+ ]), groupOf = (row) => folderOf.has(row.type) ? row.type : "", onReorder = (targetId) => {
12647
+ if (!drag) return;
12587
12648
  let fullIds = orderByIds(withPath, pageOrder).map((r) => r.id);
12588
- savePageOrder(reorderBefore(fullIds, dragId, targetId)), setDragId(null);
12589
- };
12649
+ savePageOrder(reorderBefore(fullIds, drag.id, targetId)), setDrag(null);
12650
+ }, toggle = (type, value) => {
12651
+ let next = {
12652
+ ...open,
12653
+ [type]: value
12654
+ };
12655
+ setOpen(next);
12656
+ try {
12657
+ window.localStorage.setItem(FOLDERS_KEY, JSON.stringify(next));
12658
+ } catch {}
12659
+ }, item = (row, nested = !1) => {
12660
+ let selected = current !== null && current === ((row.path ?? "").replace(/\/$/, "") || "/"), group = groupOf(row);
12661
+ return /* @__PURE__ */ jsx(Card, {
12662
+ as: "button",
12663
+ padding: 2,
12664
+ radius: 2,
12665
+ tone: selected ? "primary" : "default",
12666
+ pressed: selected,
12667
+ draggable: !0,
12668
+ onDragStart: (event) => {
12669
+ setDrag({
12670
+ id: row.id,
12671
+ group
12672
+ }), event.dataTransfer.effectAllowed = "move";
12673
+ },
12674
+ onDragOver: (event) => {
12675
+ drag && drag.id !== row.id && drag.group === group && event.preventDefault();
12676
+ },
12677
+ onDrop: (event) => {
12678
+ event.preventDefault(), drag?.group === group && onReorder(row.id);
12679
+ },
12680
+ onDragEnd: () => setDrag(null),
12681
+ style: {
12682
+ textAlign: "left",
12683
+ cursor: "pointer",
12684
+ border: 0,
12685
+ width: "100%",
12686
+ opacity: drag?.id === row.id ? .4 : 1,
12687
+ marginLeft: nested ? 18 : 0,
12688
+ maxWidth: nested ? "calc(100% - 18px)" : void 0
12689
+ },
12690
+ onClick: () => navigate(row.path ?? void 0, {
12691
+ type: row.type,
12692
+ id: row.id
12693
+ }),
12694
+ children: /* @__PURE__ */ jsxs(Flex, {
12695
+ align: "center",
12696
+ gap: 2,
12697
+ children: [
12698
+ /* @__PURE__ */ jsx(Text, {
12699
+ size: 1,
12700
+ muted: !0,
12701
+ style: {
12702
+ flex: "none",
12703
+ cursor: "grab"
12704
+ },
12705
+ title: "Glisser pour réordonner",
12706
+ children: /* @__PURE__ */ jsx(DragHandleIcon, {})
12707
+ }),
12708
+ /* @__PURE__ */ jsxs(Stack, {
12709
+ gap: 1,
12710
+ flex: 1,
12711
+ style: { minWidth: 0 },
12712
+ children: [/* @__PURE__ */ jsx(Text, {
12713
+ size: 1,
12714
+ weight: selected ? "semibold" : "regular",
12715
+ textOverflow: "ellipsis",
12716
+ children: row.title || row.path
12717
+ }), /* @__PURE__ */ jsx(Text, {
12718
+ size: 0,
12719
+ muted: !0,
12720
+ textOverflow: "ellipsis",
12721
+ children: row.path
12722
+ })]
12723
+ }),
12724
+ row.status !== "published" && /* @__PURE__ */ jsx(StatusBadge, { status: row.status })
12725
+ ]
12726
+ })
12727
+ }, row.id);
12728
+ }, endZone = (group, lastId) => drag && drag.group === group ? /* @__PURE__ */ jsx(Box, {
12729
+ padding: 2,
12730
+ onDragOver: (event) => event.preventDefault(),
12731
+ onDrop: (event) => {
12732
+ event.preventDefault();
12733
+ let full = orderByIds(withPath, pageOrder).map((r) => r.id), after = lastId ? full[full.indexOf(lastId) + 1] : void 0;
12734
+ onReorder(after ?? null);
12735
+ },
12736
+ style: { height: 24 }
12737
+ }) : null;
12590
12738
  return /* @__PURE__ */ jsxs(Card, {
12591
12739
  height: "fill",
12592
12740
  borderRight: !0,
@@ -12644,79 +12792,66 @@ function PagesNavigator() {
12644
12792
  gap: 1,
12645
12793
  padding: 1,
12646
12794
  children: [
12647
- visible.map((row) => {
12648
- let selected = current !== null && current === ((row.path ?? "").replace(/\/$/, "") || "/");
12649
- return /* @__PURE__ */ jsx(Card, {
12650
- as: "button",
12651
- padding: 2,
12652
- radius: 2,
12653
- tone: selected ? "primary" : "default",
12654
- pressed: selected,
12655
- draggable: !0,
12656
- onDragStart: (event) => {
12657
- setDragId(row.id), event.dataTransfer.effectAllowed = "move";
12658
- },
12659
- onDragOver: (event) => {
12660
- dragId && dragId !== row.id && event.preventDefault();
12661
- },
12662
- onDrop: (event) => {
12663
- event.preventDefault(), onReorder(row.id);
12664
- },
12665
- onDragEnd: () => setDragId(null),
12666
- style: {
12667
- textAlign: "left",
12668
- cursor: "pointer",
12669
- border: 0,
12670
- width: "100%",
12671
- opacity: dragId === row.id ? .4 : 1
12672
- },
12673
- onClick: () => navigate(row.path ?? void 0, {
12674
- type: row.type,
12675
- id: row.id
12676
- }),
12677
- children: /* @__PURE__ */ jsxs(Flex, {
12678
- align: "center",
12679
- gap: 2,
12680
- children: [
12681
- /* @__PURE__ */ jsx(Text, {
12682
- size: 1,
12683
- muted: !0,
12684
- style: {
12685
- flex: "none",
12686
- cursor: "grab"
12687
- },
12688
- title: "Glisser pour réordonner",
12689
- children: /* @__PURE__ */ jsx(DragHandleIcon, {})
12690
- }),
12691
- /* @__PURE__ */ jsxs(Stack, {
12692
- gap: 1,
12693
- flex: 1,
12694
- style: { minWidth: 0 },
12695
- children: [/* @__PURE__ */ jsx(Text, {
12696
- size: 1,
12697
- weight: selected ? "semibold" : "regular",
12698
- textOverflow: "ellipsis",
12699
- children: row.title || row.path
12700
- }), /* @__PURE__ */ jsx(Text, {
12701
- size: 0,
12702
- muted: !0,
12703
- textOverflow: "ellipsis",
12704
- children: row.path
12705
- })]
12706
- }),
12707
- row.status !== "published" && /* @__PURE__ */ jsx(StatusBadge, { status: row.status })
12708
- ]
12709
- })
12710
- }, row.id);
12795
+ groups.root.map((row) => item(row)),
12796
+ endZone("", groups.root.at(-1)?.id),
12797
+ groups.folders.map((f) => {
12798
+ let hasCurrent = f.rows.some((r) => current === ((r.path ?? "").replace(/\/$/, "") || "/")), isOpen = search.trim() ? !0 : open[f.type] ?? hasCurrent;
12799
+ return /* @__PURE__ */ jsxs(Stack, {
12800
+ gap: 1,
12801
+ marginTop: 2,
12802
+ children: [
12803
+ /* @__PURE__ */ jsx(Card, {
12804
+ as: "button",
12805
+ padding: 2,
12806
+ radius: 2,
12807
+ style: {
12808
+ textAlign: "left",
12809
+ cursor: "pointer",
12810
+ border: 0,
12811
+ width: "100%"
12812
+ },
12813
+ "aria-expanded": isOpen,
12814
+ onClick: () => toggle(f.type, !isOpen),
12815
+ children: /* @__PURE__ */ jsxs(Flex, {
12816
+ align: "center",
12817
+ gap: 2,
12818
+ children: [
12819
+ /* @__PURE__ */ jsx(Text, {
12820
+ size: 1,
12821
+ muted: !0,
12822
+ children: jsx(isOpen ? ChevronDownIcon : ChevronRightIcon, {})
12823
+ }),
12824
+ /* @__PURE__ */ jsx(Text, {
12825
+ size: 1,
12826
+ children: /* @__PURE__ */ jsx(FolderIcon, {})
12827
+ }),
12828
+ /* @__PURE__ */ jsxs(Stack, {
12829
+ gap: 2,
12830
+ flex: 1,
12831
+ style: { minWidth: 0 },
12832
+ children: [/* @__PURE__ */ jsx(Text, {
12833
+ size: 1,
12834
+ weight: "semibold",
12835
+ textOverflow: "ellipsis",
12836
+ children: f.label
12837
+ }), /* @__PURE__ */ jsxs(Text, {
12838
+ size: 0,
12839
+ muted: !0,
12840
+ children: [f.prefix, "/…"]
12841
+ })]
12842
+ }),
12843
+ /* @__PURE__ */ jsx(Badge, {
12844
+ fontSize: 0,
12845
+ children: f.rows.length
12846
+ })
12847
+ ]
12848
+ })
12849
+ }),
12850
+ isOpen && f.rows.map((row) => item(row, !0)),
12851
+ isOpen && endZone(f.type, f.rows.at(-1)?.id)
12852
+ ]
12853
+ }, f.type);
12711
12854
  }),
12712
- dragId ? /* @__PURE__ */ jsx(Box, {
12713
- padding: 2,
12714
- onDragOver: (event) => event.preventDefault(),
12715
- onDrop: (event) => {
12716
- event.preventDefault(), onReorder(null);
12717
- },
12718
- style: { height: 24 }
12719
- }) : null,
12720
12855
  !visible.length && /* @__PURE__ */ jsx(Box, {
12721
12856
  padding: 3,
12722
12857
  children: /* @__PURE__ */ jsx(Text, {
@@ -13839,10 +13974,16 @@ const ncfKit = definePlugin((options) => {
13839
13974
  ].filter((d) => config.tools[d.name]).map((d) => d.tool),
13840
13975
  schema: {
13841
13976
  types: kitSchemaTypes,
13842
- templates: (prev) => prev.filter((template) => !isKitType(template.schemaType))
13977
+ templates: (prev, context) => {
13978
+ let kept = prev.filter((template) => !isKitType(template.schemaType)), i18n = config.i18n;
13979
+ return i18n ? withMasterLanguageBaseTemplates(kept, {
13980
+ field: i18n.field,
13981
+ defaultLocale: i18n.defaultLocale
13982
+ }, (type) => hasLanguageField(context.schema.get(type), i18n.field)) : kept;
13983
+ }
13843
13984
  },
13844
13985
  document: {
13845
- newDocumentOptions: (prev) => dropRedundantLanguageTemplates(prev.filter((option) => option.templateId !== BOARD_LAYOUT_TYPE)),
13986
+ newDocumentOptions: (prev) => dropRedundantLanguageTemplates(prev.filter((option) => option.templateId !== BOARD_LAYOUT_TYPE), config.i18n),
13846
13987
  actions: (prev, context) => config.pageTypeNames.includes(context.schemaType) ? prev.map((action) => action.action === "unpublish" ? config.i18n ? createRemoveFromSite(config) : RemoveFromSiteAction : action.action === "publish" ? addJsonLd(config.i18n ? withTranslationRedirects(withPropagation(action, config, void 0, { allowCreate: !0 }), config) : action) : action.action === "delete" && config.i18n ? withTranslationDelete(action, config) : action) : context.schemaType === config.componentPreview.defaultsType && config.i18n ? prev.map((action) => action.action === "publish" ? withPropagation(action, config, config.i18n?.defaultsSourceLocale) : action.action === "delete" ? withTranslationDelete(action, config, config.i18n?.defaultsSourceLocale) : action) : config.i18n && !isKitType(context.schemaType) && hasLanguageField(context.schema.get(context.schemaType), config.i18n.field) ? prev.map((action) => action.action === "publish" ? withPropagation(action, config, void 0, { allowCreate: !0 }) : action.action === "delete" ? withTranslationDelete(action, config) : action.action === "unpublish" ? createRemoveFromSite(config) : action) : prev
13847
13988
  },
13848
13989
  studio: { components: {