@nocode-factory/sanity-kit 2.56.0 → 2.59.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/README.md +45 -8
- package/bin/item-types.mjs +131 -0
- package/bin/ncf-kit.mjs +121 -2
- package/dist/{finalUrl-IXF3zbT9.js → finalUrl-DYyjKCjh.js} +2 -1
- package/dist/finalUrl-DYyjKCjh.js.map +1 -0
- package/dist/{fixCrossLanguageReferences-CDczoic9.js → fixCrossLanguageReferences-C4A61VWW.js} +2 -2
- package/dist/{fixCrossLanguageReferences-CDczoic9.js.map → fixCrossLanguageReferences-C4A61VWW.js.map} +1 -1
- package/dist/{fixCrossLanguageReferences-C1VsmGsJ.d.ts → fixCrossLanguageReferences-CfFDSTD5.d.ts} +8 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +7240 -7011
- package/dist/index.js.map +1 -1
- package/dist/inherited-DZvM35P6.js +101 -0
- package/dist/inherited-DZvM35P6.js.map +1 -0
- package/dist/jsonld.js +1 -1
- package/dist/protocol-Bl7Yj2Ro.js +31 -0
- package/dist/protocol-Bl7Yj2Ro.js.map +1 -0
- package/dist/schema.d.ts +1 -1
- package/dist/schema.js +2 -2
- package/dist/web-edit.d.ts +192 -0
- package/dist/web-edit.js +144 -0
- package/dist/web-edit.js.map +1 -0
- package/dist/web-editing.d.ts +51 -0
- package/dist/web-editing.js +693 -0
- package/dist/web-editing.js.map +1 -0
- package/package.json +22 -2
- package/scripts/use-client.mjs +1 -1
- package/src/config/resolve.ts +1 -0
- package/src/config/types.ts +7 -1
- package/src/form/AssetSourceBrowser.tsx +68 -39
- package/src/index.ts +12 -5
- package/src/lib/i18nTemplates.ts +38 -4
- package/src/tools/collections/CollectionTable.tsx +116 -89
- package/src/tools/presentation/PagesNavigator.tsx +150 -56
- package/src/ui/PreviewEditBridge.tsx +74 -0
- package/src/version.ts +1 -1
- package/src/web/edit/ImageReplaceLayer.tsx +174 -0
- package/src/web/edit/InlineTextEditor.tsx +365 -0
- package/src/web/edit/InlineTextOverlay.tsx +43 -0
- package/src/web/edit/PreviewEditing.tsx +191 -0
- package/src/web/edit/index.ts +18 -0
- package/src/web/edit/inherited.ts +174 -0
- package/src/web/edit/labels.ts +37 -0
- package/src/web/edit/protocol.ts +47 -0
- package/src/web/edit/store.ts +98 -0
- package/src/web/edit/targets.ts +186 -0
- package/src/web/editing.ts +18 -0
- package/dist/finalUrl-IXF3zbT9.js.map +0 -1
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import {createDataAttribute} from '@sanity/visual-editing/create-data-attribute'
|
|
2
|
+
import {resolveEditInfo, studioPath, type ContentSourceMap, type ContentSourceMapParsedPath} from '@sanity/client/csm'
|
|
3
|
+
import {vercelStegaClean} from '@vercel/stega'
|
|
4
|
+
import {retagInheritedList, type InheritedEdit} from './inherited'
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* ÉDITION DANS L'APERÇU, IMAGES (mode brouillon seulement) : chaque image est
|
|
8
|
+
* cliquable dans Presentation, alt rempli ou non, et porte son document et son
|
|
9
|
+
* chemin EXACTS pour la pastille « Replace this image » (`NcfPreviewEditing`).
|
|
10
|
+
*
|
|
11
|
+
* Sanity ne repère d'ordinaire une image que par son alt (texte encodé en stega) :
|
|
12
|
+
* une image sans alt n'avait aucun overlay. Ici, la carte des sources (Content
|
|
13
|
+
* Source Map, renvoyée par `sanityFetch` en brouillon) donne pour chaque image son
|
|
14
|
+
* document et son champ ; on les attache à la valeur (`_editTarget`, `_editPath`,
|
|
15
|
+
* `_editDoc`, `_editType`), que le composant pose avec `imageEditAttributes`.
|
|
16
|
+
*
|
|
17
|
+
* Câblage d'un projet (starter) :
|
|
18
|
+
* - `annotateImageEditTargets(data, sourceMap, {studioUrl})` sur le résultat de
|
|
19
|
+
* `sanityFetch` en brouillon ;
|
|
20
|
+
* - `withPreviewEditTargets(reattributeTo(source, key), source, key, collected, {studioUrl})`
|
|
21
|
+
* comme rappel d'héritage de `applyDefaults` ;
|
|
22
|
+
* - `rekeyOwnImageTargets(section, source, key, {studioUrl})` sur chaque section ;
|
|
23
|
+
* - `imageEditAttributes(image)` / `imageAlt(image)` sur chaque image affichée.
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
export type ImageEditValue = {
|
|
27
|
+
asset?: {_ref?: string}
|
|
28
|
+
alt?: string
|
|
29
|
+
_editTarget?: string
|
|
30
|
+
_editPath?: string
|
|
31
|
+
_editDoc?: string
|
|
32
|
+
_editType?: string
|
|
33
|
+
} | null | undefined
|
|
34
|
+
|
|
35
|
+
type Marked = {asset: {_ref: string}; _editTarget?: string; _editPath?: string; _editDoc?: string; _editType?: string}
|
|
36
|
+
type Segment = ContentSourceMapParsedPath[number]
|
|
37
|
+
|
|
38
|
+
function isImageValue(value: unknown): value is Marked {
|
|
39
|
+
if (!value || typeof value !== 'object' || Array.isArray(value)) return false
|
|
40
|
+
const ref = (value as {asset?: {_ref?: unknown}}).asset?._ref
|
|
41
|
+
return typeof ref === 'string' && ref.startsWith('image-')
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Pose le repère Sanity et le chemin exact. Image élément de liste
|
|
46
|
+
* (`…images[_key=="i3"]`) : Sanity n'active pas un repère placé dans un élément de
|
|
47
|
+
* liste d'images ; le repère vise la liste, le chemin exact reste dans `_editPath`.
|
|
48
|
+
*/
|
|
49
|
+
function mark(value: Marked, id: string, type: string, path: string, extra: Record<string, string | undefined> & {baseUrl: string}) {
|
|
50
|
+
const inList = /\[[^\]]+\]$/.test(path)
|
|
51
|
+
value._editTarget = createDataAttribute({...extra, id, type, path: inList ? path.replace(/\[[^\]]+\]$/, '') : path}).toString()
|
|
52
|
+
value._editPath = path
|
|
53
|
+
value._editDoc = id.replace(/^drafts\./, '')
|
|
54
|
+
value._editType = type
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export type ImageEditOptions = {
|
|
58
|
+
/** Adresse du Studio (celle de `stega.studioUrl`). */
|
|
59
|
+
studioUrl: string
|
|
60
|
+
/** Type du document des valeurs par défaut des composants (jamais marqué). */
|
|
61
|
+
defaultsType?: string
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Marque chaque image du résultat d'une requête en brouillon. Une image venue du
|
|
66
|
+
* document des valeurs par défaut n'est pas marquée ici (un clic modifierait
|
|
67
|
+
* l'image de TOUTES les pages) : `withPreviewEditTargets` la fait viser l'instance.
|
|
68
|
+
*/
|
|
69
|
+
export function annotateImageEditTargets<T>(data: T, sourceMap: ContentSourceMap | null | undefined, options: ImageEditOptions): T {
|
|
70
|
+
if (!sourceMap) return data
|
|
71
|
+
const defaultsType = options.defaultsType ?? 'componentDefaults'
|
|
72
|
+
const fromSourceMap = (value: Marked, path: ContentSourceMapParsedPath) => {
|
|
73
|
+
const info = resolveEditInfo({studioUrl: options.studioUrl, resultSourceMap: sourceMap, resultPath: [...path, 'asset', '_ref']})
|
|
74
|
+
if (!info || info.type === defaultsType) return
|
|
75
|
+
const full = typeof info.path === 'string' ? info.path : studioPath.toString(info.path as never)
|
|
76
|
+
const imagePath = full.replace(/\.asset\._ref$/, '')
|
|
77
|
+
if (!imagePath || imagePath === full) return
|
|
78
|
+
mark(value, info.id, info.type, imagePath, {
|
|
79
|
+
baseUrl: info.baseUrl,
|
|
80
|
+
workspace: info.workspace,
|
|
81
|
+
tool: info.tool,
|
|
82
|
+
projectId: info.projectId,
|
|
83
|
+
dataset: info.dataset,
|
|
84
|
+
})
|
|
85
|
+
}
|
|
86
|
+
const visit = (value: unknown, path: ContentSourceMapParsedPath) => {
|
|
87
|
+
if (Array.isArray(value)) {
|
|
88
|
+
value.forEach((item, index) => {
|
|
89
|
+
const key = item && typeof item === 'object' && typeof (item as {_key?: unknown})._key === 'string' ? (item as {_key: string})._key : null
|
|
90
|
+
const segment: Segment = key ? {_key: key, _index: index} : index
|
|
91
|
+
visit(item, [...path, segment])
|
|
92
|
+
})
|
|
93
|
+
return
|
|
94
|
+
}
|
|
95
|
+
if (!value || typeof value !== 'object') return
|
|
96
|
+
if (isImageValue(value) && !value._editTarget) fromSourceMap(value, path)
|
|
97
|
+
for (const [key, child] of Object.entries(value)) {
|
|
98
|
+
if (key.startsWith('_edit')) continue
|
|
99
|
+
visit(child, [...path, key])
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
visit(data, [])
|
|
103
|
+
return data
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
type OnInherit = (value: unknown, path: string[]) => unknown
|
|
107
|
+
type Source = {id: string; type: string; path: string; single?: boolean}
|
|
108
|
+
|
|
109
|
+
const sectionBase = (source: Source, key: string | undefined) => (key && !source.single ? `${source.path}[_key=="${key}"]` : source.path)
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Rappel d'héritage pour `applyDefaults` (en aperçu), autour de `reattributeTo` :
|
|
113
|
+
* - image héritée : vise le champ image de L'INSTANCE (choisir une image crée une
|
|
114
|
+
* image propre à la page, la valeur par défaut ne change pas) ;
|
|
115
|
+
* - texte hérité : sa valeur par défaut exacte est jointe (`collected`) ;
|
|
116
|
+
* - liste simple ou texte riche hérité : modifiable ligne à ligne (voir `inherited.ts`).
|
|
117
|
+
* `collected` est à rendre par la section avec `inheritedEditScriptProps`.
|
|
118
|
+
*/
|
|
119
|
+
export function withPreviewEditTargets(onInherit: OnInherit, source: Source, key: string | undefined, collected: InheritedEdit[], options: ImageEditOptions): OnInherit {
|
|
120
|
+
const base = sectionBase(source, key)
|
|
121
|
+
const pageId = source.id.replace(/^drafts\./, '')
|
|
122
|
+
const markInherited = (value: unknown, path: string) => {
|
|
123
|
+
if (Array.isArray(value) || !value || typeof value !== 'object') return
|
|
124
|
+
if (isImageValue(value)) {
|
|
125
|
+
mark(value, pageId, source.type, path, {baseUrl: options.studioUrl})
|
|
126
|
+
return
|
|
127
|
+
}
|
|
128
|
+
for (const [k, child] of Object.entries(value)) if (!k.startsWith('_')) markInherited(child, `${path}.${k}`)
|
|
129
|
+
}
|
|
130
|
+
return (value, path) => {
|
|
131
|
+
const out = onInherit(value, path)
|
|
132
|
+
if (out && typeof out === 'object' && !Array.isArray(out)) {
|
|
133
|
+
const copy = isImageValue(out) ? {...out} : out
|
|
134
|
+
markInherited(copy, `${base}.${path.join('.')}`)
|
|
135
|
+
return copy
|
|
136
|
+
}
|
|
137
|
+
if (typeof out === 'string') collected.push({path: `${base}.${path.join('.')}`, value: vercelStegaClean(out)})
|
|
138
|
+
// Liste héritée directement par un champ de la section (le parent existe dans la page).
|
|
139
|
+
if (Array.isArray(out) && path.length === 1) return retagInheritedList(out, `${base}.${path[0]}`, source, collected)
|
|
140
|
+
return out
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Chemin EXACT des images qui appartiennent à la page, recalculé avec les clés
|
|
146
|
+
* `_key` de la section. La carte des sources donne parfois un rang au lieu de la
|
|
147
|
+
* clé (`images:0`) : Sanity ne retrouve alors pas le champ. Une image d'un AUTRE
|
|
148
|
+
* document (carte liée, témoignage...) garde son repère.
|
|
149
|
+
*/
|
|
150
|
+
export function rekeyOwnImageTargets<T>(section: T, source: Source, key: string | undefined, options: ImageEditOptions): T {
|
|
151
|
+
const pageId = source.id.replace(/^drafts\./, '')
|
|
152
|
+
const visit = (value: unknown, path: string) => {
|
|
153
|
+
if (Array.isArray(value)) {
|
|
154
|
+
value.forEach((item, index) => {
|
|
155
|
+
const k = item && typeof item === 'object' ? (item as {_key?: unknown})._key : undefined
|
|
156
|
+
visit(item, typeof k === 'string' ? `${path}[_key=="${k}"]` : `${path}[${index}]`)
|
|
157
|
+
})
|
|
158
|
+
return
|
|
159
|
+
}
|
|
160
|
+
if (!value || typeof value !== 'object') return
|
|
161
|
+
if (isImageValue(value) && value._editDoc) {
|
|
162
|
+
if (value._editDoc === pageId) mark(value, pageId, source.type, path, {baseUrl: options.studioUrl})
|
|
163
|
+
return
|
|
164
|
+
}
|
|
165
|
+
for (const [k, child] of Object.entries(value)) if (!k.startsWith('_')) visit(child, `${path}.${k}`)
|
|
166
|
+
}
|
|
167
|
+
visit(section, sectionBase(source, key))
|
|
168
|
+
return section
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
export type ImageEditAttributes = {'data-sanity'?: string; 'data-edit-image'?: string; 'data-edit-doc'?: string; 'data-edit-type'?: string}
|
|
172
|
+
|
|
173
|
+
/** Attributs à poser sur le cadre d'une image marquée ; vide pour les visiteurs. */
|
|
174
|
+
export function imageEditAttributes(image: ImageEditValue): ImageEditAttributes {
|
|
175
|
+
if (!image?._editTarget || !image._editPath || !image._editDoc || !image._editType) return {}
|
|
176
|
+
return {'data-sanity': image._editTarget, 'data-edit-image': image._editPath, 'data-edit-doc': image._editDoc, 'data-edit-type': image._editType}
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* Alt d'une image marquée : nettoyé de ses marqueurs (sinon Sanity la prendrait
|
|
181
|
+
* pour un texte et le clic ouvrirait l'alt au lieu de l'image).
|
|
182
|
+
*/
|
|
183
|
+
export function imageAlt(image: ImageEditValue, alt?: string): string {
|
|
184
|
+
const value = alt ?? image?.alt ?? ''
|
|
185
|
+
return image?._editTarget ? vercelStegaClean(value) : value
|
|
186
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ÉDITION SUR PLACE dans l'aperçu (Presentation), point d'entrée **client** :
|
|
3
|
+
*
|
|
4
|
+
* ```tsx
|
|
5
|
+
* import {NcfPreviewEditing, ncfOverlayComponents} from '@nocode-factory/sanity-kit/web/editing'
|
|
6
|
+
*
|
|
7
|
+
* <VisualEditing refresh={useNcfPreviewRefresh()} components={ncfOverlayComponents} />
|
|
8
|
+
* <NcfPreviewEditing labels={messages.previewEditing} />
|
|
9
|
+
* ```
|
|
10
|
+
*
|
|
11
|
+
* Séparé de `/web` : il dépend de `@sanity/visual-editing` et `@sanity/mutate`
|
|
12
|
+
* (fournis par next-sanity), qu'un projet sans édition visuelle n'a pas à installer.
|
|
13
|
+
* Côté données (requêtes, sections, images) : `@nocode-factory/sanity-kit/web/edit`.
|
|
14
|
+
*/
|
|
15
|
+
export {NcfPreviewEditing, ncfOverlayComponents} from './edit/PreviewEditing'
|
|
16
|
+
export type {NcfPreviewEditingProps} from './edit/PreviewEditing'
|
|
17
|
+
export {DEFAULT_PREVIEW_EDITING_LABELS} from './edit/labels'
|
|
18
|
+
export type {PreviewEditingLabels} from './edit/labels'
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"finalUrl-IXF3zbT9.js","names":[],"sources":["../src/config/defaults.ts","../src/config/resolve.ts","../src/lib/paths.ts","../src/lib/finalUrl.ts"],"sourcesContent":["import type {\n NcfBoardTag,\n NcfInternalField,\n NcfComponentPreviewConfig,\n NcfI18nConfig,\n NcfToolsConfig,\n} from './types'\n\nexport const DEFAULT_PAGE_BUILDER_FIELD = 'sections'\nexport const DEFAULT_SLUG_FIELD = 'slug'\nexport const DEFAULT_TITLE_FIELD = 'title'\nexport const DEFAULT_BLOCK_NAMESPACE = ''\n\n/**\n * Chemins essayés pour savoir si une page est indexable. Le premier\n * correspond à la convention du starter (`seo.noindex`), le second couvre les\n * schémas qui portent le drapeau à la racine.\n */\nexport const DEFAULT_NOINDEX_FIELDS = ['seo.noindex', 'noindex']\n\n// Aucune langue par défaut : la langue principale (master) vient TOUJOURS du projet\n// (`defaultLocale`, sinon la première de `locales`). Un site peut avoir le français,\n// l'anglais ou toute autre langue comme master.\nexport const DEFAULT_I18N: Omit<Required<NcfI18nConfig>, 'defaultsSourceLocale' | 'defaultLocale'> = {\n field: 'language',\n locales: [],\n}\n\n/**\n * Convention NoCode Factory : page `/design-system` dans le front, captures\n * dans `/sections/<nom>.png` générées au push par GitHub Actions.\n */\nexport const DEFAULT_COMPONENT_PREVIEW: Required<NcfComponentPreviewConfig> = {\n provider: 'designSystemPage',\n path: '/design-system',\n anchor: '{name}',\n thumbnail: '/sections/{name}.png',\n defaultsType: 'componentDefaults',\n live: '/design-system/composant?type={name}',\n}\n\nexport const DEFAULT_TOOLS: Required<NcfToolsConfig> = {\n pages: true,\n components: true,\n history: true,\n designSystem: true,\n assets: true,\n}\n\n/**\n * Outils rangés dans « Plus » : Vision (console GROQ) et la planification\n * (« Scheduled drafts » quand les Releases sont désactivées, « Releases » sinon :\n * le même outil, nommé `releases` ; `schedules` couvre les anciennes versions).\n */\nexport const DEFAULT_TOOLBAR_MORE = ['vision', 'releases', 'schedules']\n\n/**\n * Étiquettes de suivi par défaut : l'avancement d'une refonte, pas un statut\n * de publication. Elles vivent dans le document de disposition du kit, donc\n * aucun schéma client n'est modifié.\n */\nexport const DEFAULT_BOARD_TAGS: NcfBoardTag[] = [\n {id: 'en-cours', label: 'In progress', color: '#f5a623'},\n {id: 'fait', label: 'Done', color: '#43d675'},\n {id: 'a-relire', label: 'To review', color: '#2276fc'},\n {id: 'a-refondre', label: 'To rework', color: '#f03e3e'},\n]\n\n/**\n * Colonnes de gestion interne par défaut. Volontairement peu nombreuses : ce\n * sont celles qu'on redemande sur tous les projets. `internalFields` les\n * remplace entièrement.\n */\nexport const DEFAULT_INTERNAL_FIELDS: NcfInternalField[] = [\n {id: 'owner', label: 'Owner', type: 'text'},\n {id: 'audience', label: 'Audience', type: 'text'},\n {id: 'role', label: 'Page role', type: 'text'},\n]\n\n/**\n * Service du kit, hébergé par NoCode Factory.\n *\n * Renseigné d'office pour qu'un Studio n'ait rien à configurer : il se\n * signale au démarrage, et c'est ce qui permet de savoir quels projets\n * utilisent le kit. `endpoint` le remplace pour une instance privée.\n */\nexport const DEFAULT_SERVICE_ENDPOINT = 'https://dkoxgivytgsmvqmjvmjt.supabase.co/functions/v1'\n","import {\n DEFAULT_BLOCK_NAMESPACE,\n DEFAULT_BOARD_TAGS,\n DEFAULT_INTERNAL_FIELDS,\n DEFAULT_SERVICE_ENDPOINT,\n DEFAULT_COMPONENT_PREVIEW,\n DEFAULT_I18N,\n DEFAULT_NOINDEX_FIELDS,\n DEFAULT_PAGE_BUILDER_FIELD,\n DEFAULT_SLUG_FIELD,\n DEFAULT_TITLE_FIELD,\n DEFAULT_TOOLBAR_MORE, DEFAULT_TOOLS,\n} from './defaults'\nimport type {\n NcfEnvironment,\n NcfKitConfig,\n NcfPageTypeConfig,\n ResolvedKitConfig,\n ResolvedPageType,\n} from './types'\n\nconst trimTrailingSlash = (url: string) => url.replace(/\\/+$/, '')\n\n/** Garantit un chemin absolu ('accueil' -> '/accueil', '' -> '/'). */\nexport const normalizePath = (path: string): string => {\n const trimmed = path.trim()\n if (!trimmed || trimmed === '/') return '/'\n const withSlash = trimmed.startsWith('/') ? trimmed : `/${trimmed}`\n return withSlash.length > 1 ? trimTrailingSlash(withSlash) : withSlash\n}\n\nfunction resolvePageType(\n entry: NcfPageTypeConfig,\n defaults: {slugField: string; titleField: string},\n): ResolvedPageType {\n if (typeof entry === 'string') {\n return {\n type: entry.trim(),\n slugField: defaults.slugField,\n path: null,\n pathPrefix: null,\n localizedPrefixes: null,\n titleField: defaults.titleField,\n }\n }\n\n // `path` gagne sur `slugField` : une page à chemin fixe (l'accueil) n'a pas\n // de slug à lire, même si le type en porte un par ailleurs.\n const path = typeof entry.path === 'string' ? normalizePath(entry.path) : null\n const slugField =\n entry.slugField === null ? null : (entry.slugField?.trim() || defaults.slugField)\n\n // Un préfixe vide ou '/' vaut « à la racine » : pas de préfixe.\n const prefix = typeof entry.pathPrefix === 'string' ? normalizePath(entry.pathPrefix) : '/'\n\n return {\n type: (entry.type ?? '').trim(),\n slugField: path ? null : slugField,\n path,\n // Conservé même avec `path` (qui gagne au calcul du chemin) : la validation\n // peut ainsi signaler le préfixe inutile.\n pathPrefix: prefix === '/' ? null : prefix,\n localizedPrefixes: entry.localizedPrefixes\n ? Object.fromEntries(Object.entries(entry.localizedPrefixes).map(([l, p]) => [l, normalizePath(p) === '/' ? '' : normalizePath(p)]))\n : null,\n titleField: entry.titleField?.trim() || defaults.titleField,\n }\n}\n\n/** Applique les valeurs par défaut. Ne valide rien : voir `validateConfig`. */\nexport function resolveConfig(input: NcfKitConfig): ResolvedKitConfig {\n const slugField = input.slugField?.trim() || DEFAULT_SLUG_FIELD\n const titleField = input.titleField?.trim() || DEFAULT_TITLE_FIELD\n\n const pageTypes = (Array.isArray(input.pageTypes) ? input.pageTypes : []).map((entry) =>\n resolvePageType(entry, {slugField, titleField}),\n )\n\n const i18n =\n input.i18n === false || input.i18n === undefined\n ? null\n : (() => {\n const locales = (input.i18n.locales ?? DEFAULT_I18N.locales).map((l) => l.trim()).filter(Boolean)\n // Master : `defaultLocale`, sinon la première langue. Jamais une langue écrite\n // dans le kit (absente : signalé par validateConfig).\n const defaultLocale = input.i18n.defaultLocale?.trim() || locales[0] || ''\n return {\n field: input.i18n.field?.trim() || DEFAULT_I18N.field,\n defaultLocale,\n locales,\n // Valeurs par défaut des composants : écrites dans la langue master,\n // traduites vers les autres (sauf choix explicite du projet).\n defaultsSourceLocale: input.i18n.defaultsSourceLocale?.trim() || defaultLocale,\n }\n })()\n\n return {\n pageTypes,\n codedPages: (input.siteRoutes?.fixed ?? [])\n .filter((f) => f.pageSlug && !f.homePage && !f.system && !f.notFound)\n .map((f) => ({pageSlug: f.pageSlug as string, path: normalizePath(f.path), localized: f.localized ?? null})),\n redirectType: input.redirectType?.trim() || 'redirect',\n pageTypeNames: pageTypes.map((p) => p.type).filter(Boolean),\n pageBuilderField: input.pageBuilderField?.trim() || DEFAULT_PAGE_BUILDER_FIELD,\n blockNamespace: input.blockNamespace ?? DEFAULT_BLOCK_NAMESPACE,\n noindexFields: input.noindexField\n ? [input.noindexField].flat().map((field) => field.trim()).filter(Boolean)\n : DEFAULT_NOINDEX_FIELDS,\n previewUrl: input.previewUrl ? trimTrailingSlash(input.previewUrl.trim()) : null,\n environments: resolveEnvironments(input),\n pageThumbnail: input.pageThumbnail?.trim() || null,\n i18n,\n componentPreview: {\n provider: input.componentPreview?.provider ?? DEFAULT_COMPONENT_PREVIEW.provider,\n path: input.componentPreview?.path ?? DEFAULT_COMPONENT_PREVIEW.path,\n anchor: input.componentPreview?.anchor ?? DEFAULT_COMPONENT_PREVIEW.anchor,\n thumbnail: input.componentPreview?.thumbnail ?? DEFAULT_COMPONENT_PREVIEW.thumbnail,\n defaultsType: input.componentPreview?.defaultsType ?? DEFAULT_COMPONENT_PREVIEW.defaultsType,\n live: input.componentPreview?.live ?? DEFAULT_COMPONENT_PREVIEW.live,\n },\n serviceEndpoint:\n input.serviceEndpoint === false\n ? null\n : trimTrailingSlash((input.serviceEndpoint || DEFAULT_SERVICE_ENDPOINT).trim()),\n history: input.history?.projectKey?.trim()\n ? {\n projectKey: input.history.projectKey.trim(),\n endpoint: trimTrailingSlash(\n (input.history.endpoint || input.serviceEndpoint || DEFAULT_SERVICE_ENDPOINT).trim(),\n ),\n }\n : null,\n // Le JSON-LD IA s'appuie sur le même service que la traduction : sans\n // `history.projectKey`, il n'y a pas d'IA à brancher.\n jsonLd:\n input.jsonLd?.enabled && input.history?.projectKey?.trim()\n ? {field: input.jsonLd.field?.trim() || 'jsonLd'}\n : null,\n tools: {...DEFAULT_TOOLS, ...input.tools},\n moreTools: input.moreTools === false ? [] : (input.moreTools ?? DEFAULT_TOOLBAR_MORE),\n boardTags: input.boardTags?.length ? input.boardTags : DEFAULT_BOARD_TAGS,\n internalFields: input.internalFields?.length\n ? input.internalFields\n : DEFAULT_INTERNAL_FIELDS,\n // Additif : le schéma du client fournit déjà l'essentiel, ceci ne sert\n // qu'à ce qu'un parcours de schéma ne sait pas exprimer.\n documentColumns: (input.documentColumns ?? []).map((column) => ({\n key: column.key.trim(),\n label: column.label?.trim() || column.key.trim(),\n paths: [column.path].flat().map((path) => path.trim()).filter(Boolean),\n type: column.type ?? 'text',\n })),\n collections: {\n include: (input.collections?.include ?? []).map((name) => name.trim()).filter(Boolean),\n exclude: (input.collections?.exclude ?? []).map((name) => name.trim()).filter(Boolean),\n labels: input.collections?.labels ?? {},\n },\n }\n}\n\n\n/**\n * Préproduction déduite de la production, par convention.\n *\n * NoCode Factory assigne à chaque projet un domaine Vercel **fixe** pour la\n * branche `preprod`, de la forme `preview-<projet>.vercel.app`. Fixe parce\n * qu'un lien de partage doit survivre au commit suivant : une URL de\n * déploiement change à chaque poussée, un domaine assigné non.\n *\n * La déduire évite de la déclarer neuf fois. Elle n'est proposée que pour un\n * hôte Vercel — ailleurs la convention ne s'applique pas — et `environments`\n * la remplace dès qu'on la déclare explicitement.\n */\nexport function conventionalPreprodUrl(previewUrl: string | null): string | null {\n if (!previewUrl) return null\n try {\n const url = new URL(previewUrl)\n if (!url.hostname.endsWith('.vercel.app')) return null\n // Une préproduction ne se dérive pas d'une préproduction.\n if (url.hostname.startsWith('preview-')) return null\n return `${url.protocol}//preview-${url.hostname}`\n } catch {\n return null\n }\n}\n\n/**\n * Environnements d'aperçu.\n *\n * `previewUrl` en fournit toujours un, nommé « Production » : un projet qui\n * n'en déclare pas d'autres doit quand même pouvoir basculer entre brouillons\n * et contenu en ligne.\n *\n * Quand `environments` mentionne déjà `previewUrl`, on ne le double pas.\n */\nfunction resolveEnvironments(input: NcfKitConfig): NcfEnvironment[] {\n const declared = (input.environments ?? [])\n .map((environment) => ({\n id: environment.id.trim(),\n label: environment.label?.trim() || environment.id.trim(),\n url: trimTrailingSlash((environment.url ?? '').trim()),\n }))\n .filter((environment) => environment.id && environment.url)\n\n const preview = input.previewUrl ? trimTrailingSlash(input.previewUrl.trim()) : null\n if (!preview) return declared\n\n const production = declared.some((environment) => environment.url === preview)\n ? []\n : [{id: 'production', label: 'Production', url: preview}]\n\n // La préproduction conventionnelle complète la liste, sauf si le projet en\n // a déjà déclaré une — sa déclaration explicite fait foi.\n //\n // On compare l'identifiant autant que l'URL : un projet dont le domaine ne\n // suit pas exactement la convention déclare bien un `preprod`, à une autre\n // adresse. En n'écartant que par l'URL, on en ajoutait un second portant le\n // même identifiant, et la configuration devenait invalide.\n const conventional = conventionalPreprodUrl(preview)\n const hasPreprod =\n declared.some(\n (environment) => environment.url === conventional || environment.id === 'preprod',\n ) || input.preprodUrl === false\n\n const preprod =\n conventional && !hasPreprod\n ? [{id: 'preprod', label: 'Staging', url: conventional}]\n : []\n\n return [...production, ...preprod, ...declared]\n}\n","import {normalizePath} from '../config/resolve'\nimport type {ResolvedI18n, ResolvedPageType} from '../config/types'\n\nexport interface PathInput {\n /** Valeur du champ slug (`slug.current`). Peut contenir des `/`. */\n slug?: string | null\n /** Chemin fixe du type de page, s'il en a un. */\n path?: string | null\n /** Préfixe d'URL du type de page ('/blog'), devant le slug. */\n pathPrefix?: string | null\n /** Préfixe par langue (dossiers traduits) : celui de `locale` gagne sur `pathPrefix`. */\n localizedPrefixes?: Record<string, string> | null\n /** Langue du document. */\n locale?: string | null\n}\n\n/**\n * Chemin d'une page sur le site. Le chemin fixe l'emporte sur le slug, le\n * préfixe du type se place devant le slug ('/blog' + 'mon-article'), et la\n * langue par défaut n'est pas préfixée (convention Next.js du starter).\n */\nexport function toPath(input: PathInput, i18n: ResolvedI18n | null): string | null {\n const localized = input.locale ? input.localizedPrefixes?.[input.locale] : undefined\n const raw = localized !== undefined ? localized : input.pathPrefix\n const prefix = typeof raw === 'string' && raw ? normalizePath(raw) : '/'\n const base =\n typeof input.path === 'string' && input.path\n ? normalizePath(input.path)\n : input.slug\n ? normalizePath(prefix === '/' ? input.slug : `${prefix}/${input.slug.replace(/^\\/+/, '')}`)\n : null\n\n if (base === null) return null\n if (!i18n || !input.locale || input.locale === i18n.defaultLocale) return base\n return base === '/' ? `/${input.locale}` : `/${input.locale}${base}`\n}\n\n/** URL absolue d'une page, ou `null` si le front n'est pas configuré. */\nexport function toUrl(previewUrl: string | null, path: string | null): string | null {\n if (!previewUrl || path === null) return null\n return path === '/' ? previewUrl : `${previewUrl}${path}`\n}\n\n/** Segments d'un chemin : '/services/plomberie' -> ['services', 'plomberie']. */\nexport function segments(path: string): string[] {\n return path.split('/').filter(Boolean)\n}\n\n/** Profondeur dans l'arborescence. '/' vaut 0. */\nexport function depth(path: string): number {\n return segments(path).length\n}\n\n/**\n * Chemin du parent, ou `null` à la racine. Sert au placement automatique du\n * board : '/services/plomberie' -> '/services'.\n */\nexport function parentPath(path: string): string | null {\n const parts = segments(path)\n if (parts.length === 0) return null\n if (parts.length === 1) return '/'\n return `/${parts.slice(0, -1).join('/')}`\n}\n\n/** Le type de page correspondant à un document. */\nexport function pageTypeFor(\n type: string,\n pageTypes: ResolvedPageType[],\n): ResolvedPageType | undefined {\n return pageTypes.find((p) => p.type === type)\n}\n","import type {ResolvedKitConfig, ResolvedPageType} from '../config/types'\nimport {toPath} from './paths'\n\n/** Clé de comparaison des redirections (comme le site) : minuscules, sans « / » final, sans ? ni #. */\nexport const redirectKey = (path: string) => {\n const clean = (path.trim().split(/[?#]/)[0] ?? '').toLowerCase()\n return clean.length > 1 ? clean.replace(/\\/+$/, '') : clean\n}\n\n/** Table des redirections du Studio : départ (normalisé) -> destination. */\nexport type RedirectMap = Map<string, string>\n\nexport function redirectMapOf(rows: readonly {from?: string | null; to?: string | null}[]): RedirectMap {\n const map: RedirectMap = new Map()\n for (const r of rows) {\n if (!r.from?.startsWith('/') || !r.to) continue\n const key = redirectKey(r.from)\n if (key !== redirectKey(r.to) && !map.has(key)) map.set(key, r.to.trim())\n }\n return map\n}\n\n/** Destination finale d'une adresse (chaîne de redirections suivie, boucles ignorées). */\nexport function followRedirects(path: string, redirects: RedirectMap | null | undefined): string {\n if (!redirects?.size) return path\n let current = path\n const seen = new Set<string>()\n for (let hop = 0; hop < 5; hop++) {\n const next = redirects.get(redirectKey(current))\n if (!next || seen.has(next)) break\n seen.add(next)\n current = next\n }\n return current\n}\n\n/**\n * URL FINALE d'une page (celle qui répond 200, sans redirection) : adresse réelle\n * d'une page codée (registre `siteRoutes`, dossier de la langue), sinon dossier et\n * slug de la langue ; puis destination si l'adresse est le départ d'une redirection\n * du Studio. Affichée partout dans le kit (onglet Pages, board, Presentation, slug).\n */\nexport function finalPath(\n input: {slug: string | null; locale: string | null},\n pageType: ResolvedPageType | null | undefined,\n config: Pick<ResolvedKitConfig, 'i18n' | 'codedPages'>,\n redirects?: RedirectMap | null,\n): string | null {\n if (!pageType) return null\n const atRoot = !pageType.path && !pageType.pathPrefix && !pageType.localizedPrefixes\n const coded = atRoot && input.slug ? config.codedPages.find((c) => c.pageSlug === input.slug) : undefined\n const path = coded\n ? toPath({path: (input.locale && coded.localized?.[input.locale]) || coded.path, locale: input.locale}, config.i18n)\n : toPath(\n {slug: input.slug, path: pageType.path, pathPrefix: pageType.pathPrefix, localizedPrefixes: pageType.localizedPrefixes, locale: input.locale},\n config.i18n,\n )\n return path === null ? null : followRedirects(path, redirects)\n}\n"],"mappings":"AAQA,MAAa,6BAA6B,YAC7B,qBAAqB,QACrB,sBAAsB,SAQtB,yBAAyB,CAAC,eAAe,SAAS,GAKlD,eAAwF;CACnG,OAAO;CACP,SAAS,CAAC;AACZ,GAMa,4BAAiE;CAC5E,UAAU;CACV,MAAM;CACN,QAAQ;CACR,WAAW;CACX,cAAc;CACd,MAAM;AACR,GAEa,gBAA0C;CACrD,OAAO;CACP,YAAY;CACZ,SAAS;CACT,cAAc;CACd,QAAQ;AACV,GAOa,uBAAuB;CAAC;CAAU;CAAY;AAAW,GAOzD,qBAAoC;CAC/C;EAAC,IAAI;EAAY,OAAO;EAAe,OAAO;CAAS;CACvD;EAAC,IAAI;EAAQ,OAAO;EAAQ,OAAO;CAAS;CAC5C;EAAC,IAAI;EAAY,OAAO;EAAa,OAAO;CAAS;CACrD;EAAC,IAAI;EAAc,OAAO;EAAa,OAAO;CAAS;AACzD,GAOa,0BAA8C;CACzD;EAAC,IAAI;EAAS,OAAO;EAAS,MAAM;CAAM;CAC1C;EAAC,IAAI;EAAY,OAAO;EAAY,MAAM;CAAM;CAChD;EAAC,IAAI;EAAQ,OAAO;EAAa,MAAM;CAAM;AAC/C,GCxDM,qBAAqB,QAAgB,IAAI,QAAQ,QAAQ,EAAE,GAGpD,iBAAiB,SAAyB;CACr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