@nocode-factory/sanity-kit 2.37.1 → 2.38.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,4 +1,4 @@
1
- import { _ as DEFAULT_SLUG_FIELD, a as componentDefaultsMainDocuments, b as DEFAULT_TOOLS, c as requiredUnlessDefault, d as DEFAULT_COMPONENT_PREVIEW, f as DEFAULT_I18N, h as DEFAULT_PAGE_BUILDER_FIELD, i as componentDefaultsMainDocument, l as requiredUnlessDefaultFor, m as DEFAULT_NOINDEX_FIELDS, n as withSameLanguageReferences, o as defaultsFieldName, p as DEFAULT_INTERNAL_FIELDS, r as DEFAULT_COMPONENT_DEFAULTS_TYPE, s as defineComponentDefaults, t as fixCrossLanguageReferences, u as DEFAULT_BOARD_TAGS, v as DEFAULT_TITLE_FIELD, y as DEFAULT_TOOLBAR_MORE } from "./fixCrossLanguageReferences-CagQ_Vvk.js";
1
+ import { C as DEFAULT_I18N, D as DEFAULT_TITLE_FIELD, E as DEFAULT_SLUG_FIELD, S as DEFAULT_COMPONENT_PREVIEW, T as DEFAULT_PAGE_BUILDER_FIELD, _ as toPath, a as componentDefaultsMainDocuments, b as resolveConfig, c as requiredUnlessDefault, d as translationRedirectId, f as translationRedirectOptions, g as segments, h as parentPath, i as componentDefaultsMainDocument, l as requiredUnlessDefaultFor, m as pageTypeFor, n as withSameLanguageReferences, o as defaultsFieldName, p as depth, r as DEFAULT_COMPONENT_DEFAULTS_TYPE, s as defineComponentDefaults, t as fixCrossLanguageReferences, u as syncTranslationRedirects, v as toUrl, w as DEFAULT_INTERNAL_FIELDS, x as DEFAULT_BOARD_TAGS, y as normalizePath } from "./fixCrossLanguageReferences-CTQ58gmP.js";
2
2
  import { createContext, createElement, forwardRef, memo, useCallback, useContext, useEffect, useLayoutEffect, useMemo, useRef, useState, useSyncExternalStore } from "react";
3
3
  import { ToolLink, defineField, definePlugin, defineType, pathToString, set, unset, useClient, useCurrentUser, useFormValue, usePerspective, useSchema, useSetPerspective, useUser, useWorkspace } from "sanity";
4
4
  import { ClockIcon } from "@sanity/icons/Clock";
@@ -43,130 +43,6 @@ import { useToast } from "@sanity/ui/toast";
43
43
  import { createPortal } from "react-dom";
44
44
  import { TabletDeviceIcon } from "@sanity/icons/TabletDevice";
45
45
  import { PanelRightIcon } from "@sanity/icons/PanelRight";
46
- const trimTrailingSlash = (url) => url.replace(/\/+$/, ""), normalizePath = (path) => {
47
- let trimmed = path.trim();
48
- if (!trimmed || trimmed === "/") return "/";
49
- let withSlash = trimmed.startsWith("/") ? trimmed : `/${trimmed}`;
50
- return withSlash.length > 1 ? trimTrailingSlash(withSlash) : withSlash;
51
- };
52
- function resolvePageType(entry, defaults) {
53
- if (typeof entry == "string") return {
54
- type: entry.trim(),
55
- slugField: defaults.slugField,
56
- path: null,
57
- pathPrefix: null,
58
- titleField: defaults.titleField
59
- };
60
- let path = typeof entry.path == "string" ? normalizePath(entry.path) : null, slugField = entry.slugField === null ? null : entry.slugField?.trim() || defaults.slugField, prefix = typeof entry.pathPrefix == "string" ? normalizePath(entry.pathPrefix) : "/";
61
- return {
62
- type: (entry.type ?? "").trim(),
63
- slugField: path ? null : slugField,
64
- path,
65
- pathPrefix: prefix === "/" ? null : prefix,
66
- titleField: entry.titleField?.trim() || defaults.titleField
67
- };
68
- }
69
- /** Applique les valeurs par défaut. Ne valide rien : voir `validateConfig`. */
70
- function resolveConfig(input) {
71
- let slugField = input.slugField?.trim() || "slug", titleField = input.titleField?.trim() || "title", pageTypes = (Array.isArray(input.pageTypes) ? input.pageTypes : []).map((entry) => resolvePageType(entry, {
72
- slugField,
73
- titleField
74
- })), i18n = input.i18n === !1 || input.i18n === void 0 ? null : {
75
- field: input.i18n.field?.trim() || DEFAULT_I18N.field,
76
- defaultLocale: input.i18n.defaultLocale?.trim() || DEFAULT_I18N.defaultLocale,
77
- locales: input.i18n.locales ?? DEFAULT_I18N.locales,
78
- defaultsSourceLocale: input.i18n.defaultsSourceLocale?.trim() || ((input.i18n.locales ?? DEFAULT_I18N.locales).includes("en") ? "en" : input.i18n.defaultLocale?.trim() || DEFAULT_I18N.defaultLocale)
79
- };
80
- return {
81
- pageTypes,
82
- pageTypeNames: pageTypes.map((p) => p.type).filter(Boolean),
83
- pageBuilderField: input.pageBuilderField?.trim() || "sections",
84
- blockNamespace: input.blockNamespace ?? "",
85
- noindexFields: input.noindexField ? [input.noindexField].flat().map((field) => field.trim()).filter(Boolean) : DEFAULT_NOINDEX_FIELDS,
86
- previewUrl: input.previewUrl ? trimTrailingSlash(input.previewUrl.trim()) : null,
87
- environments: resolveEnvironments(input),
88
- pageThumbnail: input.pageThumbnail?.trim() || null,
89
- i18n,
90
- componentPreview: {
91
- provider: input.componentPreview?.provider ?? DEFAULT_COMPONENT_PREVIEW.provider,
92
- path: input.componentPreview?.path ?? DEFAULT_COMPONENT_PREVIEW.path,
93
- anchor: input.componentPreview?.anchor ?? DEFAULT_COMPONENT_PREVIEW.anchor,
94
- thumbnail: input.componentPreview?.thumbnail ?? DEFAULT_COMPONENT_PREVIEW.thumbnail,
95
- defaultsType: input.componentPreview?.defaultsType ?? DEFAULT_COMPONENT_PREVIEW.defaultsType,
96
- live: input.componentPreview?.live ?? DEFAULT_COMPONENT_PREVIEW.live
97
- },
98
- serviceEndpoint: input.serviceEndpoint === !1 ? null : trimTrailingSlash((input.serviceEndpoint || "https://dkoxgivytgsmvqmjvmjt.supabase.co/functions/v1").trim()),
99
- history: input.history?.projectKey?.trim() ? {
100
- projectKey: input.history.projectKey.trim(),
101
- endpoint: trimTrailingSlash((input.history.endpoint || input.serviceEndpoint || "https://dkoxgivytgsmvqmjvmjt.supabase.co/functions/v1").trim())
102
- } : null,
103
- tools: {
104
- ...DEFAULT_TOOLS,
105
- ...input.tools
106
- },
107
- moreTools: input.moreTools === !1 ? [] : input.moreTools ?? DEFAULT_TOOLBAR_MORE,
108
- boardTags: input.boardTags?.length ? input.boardTags : DEFAULT_BOARD_TAGS,
109
- internalFields: input.internalFields?.length ? input.internalFields : DEFAULT_INTERNAL_FIELDS,
110
- documentColumns: (input.documentColumns ?? []).map((column) => ({
111
- key: column.key.trim(),
112
- label: column.label?.trim() || column.key.trim(),
113
- paths: [column.path].flat().map((path) => path.trim()).filter(Boolean),
114
- type: column.type ?? "text"
115
- }))
116
- };
117
- }
118
- /**
119
- * Préproduction déduite de la production, par convention.
120
- *
121
- * NoCode Factory assigne à chaque projet un domaine Vercel **fixe** pour la
122
- * branche `preprod`, de la forme `preview-<projet>.vercel.app`. Fixe parce
123
- * qu'un lien de partage doit survivre au commit suivant : une URL de
124
- * déploiement change à chaque poussée, un domaine assigné non.
125
- *
126
- * La déduire évite de la déclarer neuf fois. Elle n'est proposée que pour un
127
- * hôte Vercel — ailleurs la convention ne s'applique pas — et `environments`
128
- * la remplace dès qu'on la déclare explicitement.
129
- */
130
- function conventionalPreprodUrl(previewUrl) {
131
- if (!previewUrl) return null;
132
- try {
133
- let url = new URL(previewUrl);
134
- return !url.hostname.endsWith(".vercel.app") || url.hostname.startsWith("preview-") ? null : `${url.protocol}//preview-${url.hostname}`;
135
- } catch {
136
- return null;
137
- }
138
- }
139
- /**
140
- * Environnements d'aperçu.
141
- *
142
- * `previewUrl` en fournit toujours un, nommé « Production » : un projet qui
143
- * n'en déclare pas d'autres doit quand même pouvoir basculer entre brouillons
144
- * et contenu en ligne.
145
- *
146
- * Quand `environments` mentionne déjà `previewUrl`, on ne le double pas.
147
- */
148
- function resolveEnvironments(input) {
149
- let declared = (input.environments ?? []).map((environment) => ({
150
- id: environment.id.trim(),
151
- label: environment.label?.trim() || environment.id.trim(),
152
- url: trimTrailingSlash((environment.url ?? "").trim())
153
- })).filter((environment) => environment.id && environment.url), preview = input.previewUrl ? trimTrailingSlash(input.previewUrl.trim()) : null;
154
- if (!preview) return declared;
155
- let production = declared.some((environment) => environment.url === preview) ? [] : [{
156
- id: "production",
157
- label: "Production",
158
- url: preview
159
- }], conventional = conventionalPreprodUrl(preview), hasPreprod = declared.some((environment) => environment.url === conventional || environment.id === "preprod") || input.preprodUrl === !1, preprod = conventional && !hasPreprod ? [{
160
- id: "preprod",
161
- label: "Staging",
162
- url: conventional
163
- }] : [];
164
- return [
165
- ...production,
166
- ...preprod,
167
- ...declared
168
- ];
169
- }
170
46
  const isAbsoluteHttpUrl = (value) => {
171
47
  try {
172
48
  let url = new URL(value);
@@ -1384,7 +1260,7 @@ function explainGrantError(error) {
1384
1260
  * quelle version. Recopiée de `package.json` par `npm version` (scripts/sync-version.mjs) ; un test
1385
1261
  * le vérifie.
1386
1262
  */
1387
- const KIT_VERSION = "2.37.1";
1263
+ const KIT_VERSION = "2.38.0";
1388
1264
  /**
1389
1265
  * Signale ce Studio au service du kit, une fois par montage.
1390
1266
  *
@@ -1727,7 +1603,7 @@ function useKitUpdate() {
1727
1603
  !controller.signal.aborted && body?.version && setLatest(body.version);
1728
1604
  }).catch(() => {}), () => controller.abort();
1729
1605
  }, []);
1730
- let available = !!(latest && !isPrerelease(latest) && compareVersions(latest, "2.37.1") > 0);
1606
+ let available = !!(latest && !isPrerelease(latest) && compareVersions(latest, "2.38.0") > 0);
1731
1607
  return {
1732
1608
  current: KIT_VERSION,
1733
1609
  latest,
@@ -2173,39 +2049,6 @@ function buildContentsQuery(config, limit) {
2173
2049
  ].join("\n");
2174
2050
  }
2175
2051
  /**
2176
- * Chemin d'une page sur le site. Le chemin fixe l'emporte sur le slug, le
2177
- * préfixe du type se place devant le slug ('/blog' + 'mon-article'), et la
2178
- * langue par défaut n'est pas préfixée (convention Next.js du starter).
2179
- */
2180
- function toPath(input, i18n) {
2181
- let prefix = typeof input.pathPrefix == "string" && input.pathPrefix ? normalizePath(input.pathPrefix) : "/", base = typeof input.path == "string" && input.path ? normalizePath(input.path) : input.slug ? normalizePath(prefix === "/" ? input.slug : `${prefix}/${input.slug.replace(/^\/+/, "")}`) : null;
2182
- return base === null ? null : !i18n || !input.locale || input.locale === i18n.defaultLocale ? base : base === "/" ? `/${input.locale}` : `/${input.locale}${base}`;
2183
- }
2184
- /** URL absolue d'une page, ou `null` si le front n'est pas configuré. */
2185
- function toUrl(previewUrl, path) {
2186
- return !previewUrl || path === null ? null : path === "/" ? previewUrl : `${previewUrl}${path}`;
2187
- }
2188
- /** Segments d'un chemin : '/services/plomberie' -> ['services', 'plomberie']. */
2189
- function segments(path) {
2190
- return path.split("/").filter(Boolean);
2191
- }
2192
- /** Profondeur dans l'arborescence. '/' vaut 0. */
2193
- function depth(path) {
2194
- return segments(path).length;
2195
- }
2196
- /**
2197
- * Chemin du parent, ou `null` à la racine. Sert au placement automatique du
2198
- * board : '/services/plomberie' -> '/services'.
2199
- */
2200
- function parentPath(path) {
2201
- let parts = segments(path);
2202
- return parts.length === 0 ? null : parts.length === 1 ? "/" : `/${parts.slice(0, -1).join("/")}`;
2203
- }
2204
- /** Le type de page correspondant à un document. */
2205
- function pageTypeFor(type, pageTypes) {
2206
- return pageTypes.find((p) => p.type === type);
2207
- }
2208
- /**
2209
2052
  * Met une valeur du document en forme pour une cellule.
2210
2053
  *
2211
2054
  * Ce qui ne tient pas sur une ligne — un objet, un tableau de sections — n'est
@@ -3283,8 +3126,9 @@ async function createTranslatedVersion(opts) {
3283
3126
  current: slug
3284
3127
  };
3285
3128
  }
3129
+ slugField && remaining.includes(pageType?.titleField ?? "title") && !remaining.includes(slugField) && (remaining = [...remaining, slugField]);
3286
3130
  let published = ai && !remaining.length && !aiError;
3287
- return await client.createOrReplace({
3131
+ await client.createOrReplace({
3288
3132
  ...doc,
3289
3133
  _id: published ? id : `drafts.${id}`,
3290
3134
  _type: type
@@ -3301,7 +3145,9 @@ async function createTranslatedVersion(opts) {
3301
3145
  }), await linkTranslations(client, sourceId, sourceLanguage, type, [{
3302
3146
  language,
3303
3147
  id
3304
- }]), {
3148
+ }]);
3149
+ let redirects = published ? translationRedirectOptions(config) : null;
3150
+ return redirects && await syncTranslationRedirects(client, redirects, [sourceId]).catch(() => {}), {
3305
3151
  id,
3306
3152
  published,
3307
3153
  aiError
@@ -9396,7 +9242,7 @@ const withDrafts = (ids) => ids.flatMap((id) => [id, `drafts.${id}`]);
9396
9242
  * suppression native, inchangée.
9397
9243
  */
9398
9244
  function withTranslationDelete(Delete, config, masterLocale) {
9399
- let i18n = config.i18n, master = masterLocale ?? i18n?.defaultLocale, Wrapped = (props) => {
9245
+ let i18n = config.i18n, master = masterLocale ?? i18n?.defaultLocale, redirects = translationRedirectOptions(config), Wrapped = (props) => {
9400
9246
  let base = Delete(props), client = useKitClient(), [versions, setVersions] = useState(null), current = props.draft ?? props.published;
9401
9247
  useEffect(() => {
9402
9248
  if (!i18n || current?.[i18n.field] !== master) return;
@@ -9412,8 +9258,8 @@ function withTranslationDelete(Delete, config, masterLocale) {
9412
9258
  props.id,
9413
9259
  current?.[i18n?.field ?? "language"]
9414
9260
  ]);
9415
- let [open, setOpen] = useState(!1);
9416
- return !base || !i18n || current?.[i18n.field] !== master || !versions?.length ? base : {
9261
+ let [open, setOpen] = useState(!1), isMaster = !!i18n && current?.[i18n.field] === master, hasPage = !!redirects?.types.some((t) => t.type === props.type);
9262
+ return !base || !i18n || (isMaster ? versions === null || !versions.length && !hasPage : !hasPage) ? base : {
9417
9263
  ...base,
9418
9264
  onHandle: () => setOpen(!0),
9419
9265
  dialog: open ? {
@@ -9424,7 +9270,8 @@ function withTranslationDelete(Delete, config, masterLocale) {
9424
9270
  content: /* @__PURE__ */ jsx(DeleteDialog, {
9425
9271
  id: props.id,
9426
9272
  language: String(current?.[i18n.field] ?? ""),
9427
- versions,
9273
+ versions: isMaster ? versions ?? [] : [],
9274
+ redirects: hasPage ? redirects : null,
9428
9275
  onDone: () => {
9429
9276
  setOpen(!1), props.onComplete();
9430
9277
  }
@@ -9435,7 +9282,7 @@ function withTranslationDelete(Delete, config, masterLocale) {
9435
9282
  return Wrapped;
9436
9283
  }
9437
9284
  function DeleteDialog(props) {
9438
- let { id, language, onDone } = props, client = useKitClient(), toast = useToast(), [versions, setVersions] = useState(props.versions), [referrers, setReferrers] = useState(null), [busy, setBusy] = useState(!1), [error, setError] = useState(null), ids = [id, ...versions.filter((v) => v.selected).map((v) => v.id)], key = ids.join(",");
9285
+ let { id, language, onDone, redirects } = props, client = useKitClient(), toast = useToast(), [versions, setVersions] = useState(props.versions), [referrers, setReferrers] = useState(null), [busy, setBusy] = useState(!1), [error, setError] = useState(null), ids = [id, ...versions.filter((v) => v.selected).map((v) => v.id)], key = ids.join(",");
9439
9286
  useEffect(() => {
9440
9287
  setReferrers(null);
9441
9288
  let all = withDrafts(ids);
@@ -9454,6 +9301,22 @@ function DeleteDialog(props) {
9454
9301
  let gone = (meta.translations ?? []).filter((t) => ids.includes(t.value?._ref ?? ""));
9455
9302
  (meta.translations ?? []).length - gone.length > 1 ? tx.patch(meta._id, (p) => p.unset(gone.map((t) => `translations[_key == "${t._key}"]`))) : tx.delete(meta._id);
9456
9303
  }
9304
+ if (redirects) {
9305
+ let field = redirects.field ?? "language", gone = await client.fetch(`*[_id in $ids]{_type, "slug": slug.current, "language": ${field}}`, { ids }), i18nPaths = {
9306
+ field,
9307
+ defaultLocale: redirects.defaultLocale,
9308
+ locales: [],
9309
+ defaultsSourceLocale: redirects.defaultLocale
9310
+ }, paths = gone.map((d) => toPath({
9311
+ slug: d.slug,
9312
+ pathPrefix: redirects.types.find((t) => t.type === d._type)?.pathPrefix,
9313
+ locale: d.language
9314
+ }, i18nPaths)).filter((x) => !!x), redirectType = redirects.redirectType ?? "redirect", leading = paths.length ? await client.fetch("*[_type == $redirectType && to in $paths]._id", {
9315
+ redirectType,
9316
+ paths
9317
+ }) : [];
9318
+ for (let rid of /* @__PURE__ */ new Set([...leading, ...ids.map(translationRedirectId)])) tx.delete(rid);
9319
+ }
9457
9320
  await tx.commit({ visibility: "async" }), toast.push({
9458
9321
  status: "success",
9459
9322
  title: `Deleted: ${[language, ...versions.filter((v) => v.selected).map((v) => v.language)].map((l) => l.toUpperCase()).join(", ")}`,
@@ -9472,10 +9335,12 @@ function DeleteDialog(props) {
9472
9335
  children: [
9473
9336
  "The ",
9474
9337
  language.toUpperCase(),
9475
- " version will be deleted for good (published and draft). Delete the other language versions too?"
9338
+ " version will be deleted for good (published and draft).",
9339
+ versions.length ? " Delete the other language versions too?" : "",
9340
+ redirects ? " Redirects leading to it are removed." : ""
9476
9341
  ]
9477
9342
  }),
9478
- /* @__PURE__ */ jsx(Stack, {
9343
+ versions.length > 0 && /* @__PURE__ */ jsx(Stack, {
9479
9344
  gap: 2,
9480
9345
  children: versions.map((v, index) => /* @__PURE__ */ jsx(Card, {
9481
9346
  padding: 3,
@@ -9564,6 +9429,31 @@ function DeleteDialog(props) {
9564
9429
  });
9565
9430
  }
9566
9431
  /**
9432
+ * Publier une version d'une page ou d'une fiche traduite : les redirections
9433
+ * « slug d'origine dans cette langue → slug traduit » de son groupe de traductions
9434
+ * sont mises à jour (créées, corrigées si un slug change, retirées si inutiles).
9435
+ * Jamais bloquant : un échec est seulement signalé dans la console.
9436
+ */
9437
+ function withTranslationRedirects(Publish, config) {
9438
+ let options = translationRedirectOptions(config);
9439
+ if (!options) return Publish;
9440
+ let Wrapped = (props) => {
9441
+ let base = Publish(props), client = useKitClient();
9442
+ return base && {
9443
+ ...base,
9444
+ onHandle: () => {
9445
+ let draft = props.draft, slugField = options.types.find((t) => t.type === props.type)?.slugField ?? "slug", slug = draft?.[slugField]?.current, language = draft?.[options.field ?? "language"];
9446
+ base.onHandle?.(), syncTranslationRedirects(client, options, [props.id], {
9447
+ id: props.id,
9448
+ slug,
9449
+ language
9450
+ }).catch((cause) => console.error("Redirections de traduction non mises à jour :", cause));
9451
+ }
9452
+ };
9453
+ };
9454
+ return Wrapped;
9455
+ }
9456
+ /**
9567
9457
  * `pageTypes` déduits du registre du starter, pour ne pas redire au kit ce que
9568
9458
  * le site sait déjà : l'accueil (chemin fixe `/`) et chaque collection avec
9569
9459
  * son préfixe d'URL (`/blog`, `/produits`, ou la racine).
@@ -10204,7 +10094,7 @@ const ncfKit = definePlugin((options) => {
10204
10094
  },
10205
10095
  document: {
10206
10096
  newDocumentOptions: (prev) => prev.filter((option) => option.templateId !== BOARD_LAYOUT_TYPE),
10207
- actions: (prev, context) => config.pageTypeNames.includes(context.schemaType) ? prev.map((action) => action.action === "unpublish" ? config.i18n ? createRemoveFromSite(config) : RemoveFromSiteAction : action.action === "publish" && config.i18n ? withPropagation(action, config, void 0, { allowCreate: !0 }) : 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
10097
+ actions: (prev, context) => config.pageTypeNames.includes(context.schemaType) ? prev.map((action) => action.action === "unpublish" ? config.i18n ? createRemoveFromSite(config) : RemoveFromSiteAction : action.action === "publish" && config.i18n ? withTranslationRedirects(withPropagation(action, config, void 0, { allowCreate: !0 }), config) : 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
10208
10098
  },
10209
10099
  studio: { components: { toolMenu: createPreviewLauncher(config, issues) } },
10210
10100
  form: { components: { input: createKitInput(config) } }