@nocode-factory/sanity-kit 2.25.0 → 2.26.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.
Files changed (74) hide show
  1. package/dist/{componentDefaults-BY3hQ6aD.js → componentDefaults-2eWjLLBf.js} +6 -6
  2. package/dist/componentDefaults-2eWjLLBf.js.map +1 -0
  3. package/dist/index.d.ts +2 -2
  4. package/dist/index.js +366 -366
  5. package/dist/index.js.map +1 -1
  6. package/dist/schema.js +1 -1
  7. package/dist/web-server.js +2 -2
  8. package/dist/web-server.js.map +1 -1
  9. package/dist/web.js +9 -9
  10. package/dist/web.js.map +1 -1
  11. package/package.json +1 -1
  12. package/src/actions/PropagatePublish.tsx +14 -14
  13. package/src/actions/RemoveFromSite.tsx +9 -9
  14. package/src/config/defaults.ts +7 -7
  15. package/src/config/resolve.ts +1 -1
  16. package/src/config/validate.ts +24 -24
  17. package/src/context/BoardLayoutContext.tsx +1 -1
  18. package/src/context/KitContext.tsx +1 -1
  19. package/src/context/PreviewTargetContext.tsx +1 -1
  20. package/src/form/OverrideInput.tsx +5 -5
  21. package/src/form/SlugUrlInput.tsx +2 -2
  22. package/src/form/TranslationTodoInput.tsx +2 -2
  23. package/src/hooks/useHistory.ts +5 -5
  24. package/src/hooks/useOccurrences.ts +1 -1
  25. package/src/hooks/useOpenOnline.ts +4 -4
  26. package/src/index.ts +4 -4
  27. package/src/lib/grouping.ts +2 -2
  28. package/src/lib/overrides.ts +10 -10
  29. package/src/lib/pages.ts +3 -3
  30. package/src/lib/service.ts +5 -5
  31. package/src/lib/status.ts +3 -3
  32. package/src/lib/studioLinks.ts +6 -6
  33. package/src/schema/boardLayout.ts +32 -32
  34. package/src/schema/componentDefaults.ts +5 -5
  35. package/src/schema/translationTodo.ts +6 -6
  36. package/src/tools/components/BlockCard.tsx +3 -3
  37. package/src/tools/components/ComponentsTool.tsx +17 -17
  38. package/src/tools/components/map/SectionNode.tsx +1 -1
  39. package/src/tools/components/map/SectionsMap.tsx +10 -10
  40. package/src/tools/designSystem/DesignSystemTool.tsx +3 -3
  41. package/src/tools/history/DiffPanel.tsx +23 -23
  42. package/src/tools/history/HistoryTool.tsx +21 -23
  43. package/src/tools/more/MoreTool.tsx +1 -1
  44. package/src/tools/navbar/KitUpdate.tsx +8 -8
  45. package/src/tools/navbar/PreviewLauncher.tsx +6 -6
  46. package/src/tools/navbar/ToolButtons.tsx +2 -2
  47. package/src/tools/pages/ColumnHeader.tsx +18 -18
  48. package/src/tools/pages/ColumnVisibility.tsx +10 -10
  49. package/src/tools/pages/FieldValue.tsx +9 -9
  50. package/src/tools/pages/PagesTable.tsx +11 -11
  51. package/src/tools/pages/PagesTool.tsx +19 -19
  52. package/src/tools/pages/PagesToolbar.tsx +3 -3
  53. package/src/tools/pages/PathCell.tsx +1 -1
  54. package/src/tools/pages/PreviewTarget.tsx +10 -10
  55. package/src/tools/pages/SharePreview.tsx +19 -20
  56. package/src/tools/pages/TagCell.tsx +2 -2
  57. package/src/tools/pages/ViewTabs.tsx +4 -4
  58. package/src/tools/pages/board/BoardView.tsx +11 -11
  59. package/src/tools/pages/board/PageNode.tsx +5 -5
  60. package/src/tools/pages/board/PagePanel.tsx +10 -10
  61. package/src/tools/presentation/PreviewHeader.tsx +1 -1
  62. package/src/tools/shared/AnnotationNode.tsx +3 -3
  63. package/src/ui/ActorName.tsx +1 -1
  64. package/src/ui/ConfigIssues.tsx +3 -3
  65. package/src/ui/PreviewOriginsNotice.tsx +3 -3
  66. package/src/ui/ProjectStatusNotice.tsx +7 -7
  67. package/src/ui/QueryError.tsx +2 -2
  68. package/src/ui/ToolPlaceholder.tsx +2 -2
  69. package/src/ui/formatDate.ts +1 -1
  70. package/src/version.ts +1 -1
  71. package/src/web/PreviewBanner.tsx +9 -9
  72. package/src/web/draftModeToggle.ts +1 -1
  73. package/src/web/previewGrant.ts +5 -5
  74. package/dist/componentDefaults-BY3hQ6aD.js.map +0 -1
@@ -18,7 +18,7 @@ export function BoardLayoutProvider(props: {children: ReactNode}) {
18
18
  export function useBoardLayout(): BoardLayoutState {
19
19
  const value = useContext(BoardLayoutContext)
20
20
  if (!value) {
21
- throw new Error('useBoardLayout doit être appelé sous BoardLayoutProvider.')
21
+ throw new Error('useBoardLayout must be called inside BoardLayoutProvider.')
22
22
  }
23
23
  return value
24
24
  }
@@ -22,7 +22,7 @@ export function KitProvider(props: KitProviderProps) {
22
22
  export function useKitContext(): KitContextValue {
23
23
  const value = useContext(KitContext)
24
24
  if (!value) {
25
- throw new Error('useKitContext doit être appelé dans un outil du plugin @nocode-factory/sanity-kit.')
25
+ throw new Error('useKitContext must be called inside a tool of the @nocode-factory/sanity-kit plugin.')
26
26
  }
27
27
  return value
28
28
  }
@@ -21,7 +21,7 @@ export function PreviewTargetProvider(props: {children: ReactNode}) {
21
21
  export function usePreviewTarget(): PreviewTargetState {
22
22
  const value = useContext(PreviewTargetContext)
23
23
  if (!value) {
24
- throw new Error('usePreviewTarget doit être appelé sous PreviewTargetProvider.')
24
+ throw new Error('usePreviewTarget must be called inside PreviewTargetProvider.')
25
25
  }
26
26
  return value
27
27
  }
@@ -102,7 +102,7 @@ export function createOverrideInput(config: ResolvedKitConfig): ComponentType<In
102
102
  {inherits && placeholder === null && (
103
103
  <Box marginTop={2}>
104
104
  <Text size={0} muted>
105
- Valeur par défaut du composant : {describeValue(inherited)}
105
+ Component default value: {describeValue(inherited)}
106
106
  </Text>
107
107
  </Box>
108
108
  )}
@@ -135,7 +135,7 @@ const BLUE = 'var(--card-badge-primary-dot-color, #2276fc)'
135
135
 
136
136
  function OverrideDot(props: {hasDefault: boolean; full: string; short: string; onClick: () => void}) {
137
137
  const [hover, setHover] = useState(false)
138
- const label = props.hasDefault ? `↺ ${props.short}` : 'Pas de valeur par défaut'
138
+ const label = props.hasDefault ? `↺ ${props.short}` : 'No default value'
139
139
  return (
140
140
  <Tooltip
141
141
  portal
@@ -144,8 +144,8 @@ function OverrideDot(props: {hasDefault: boolean; full: string; short: string; o
144
144
  <Box padding={2} style={{maxWidth: 280}}>
145
145
  <Text size={1}>
146
146
  {props.hasDefault
147
- ? `Différent de la valeur par défaut du composant (${props.full}). Cliquer pour revenir à la valeur par défaut : le champ la suivra, même si elle change.`
148
- : 'Ce composant n\'a pas de valeur par défaut pour ce champ. Cliquer pour la définir (Composants : valeurs par défaut).'}
147
+ ? `Different from the component default value (${props.full}). Click to go back to the default value: the field will follow it, even if it changes.`
148
+ : 'This component has no default value for this field. Click to set it (Components: default values).'}
149
149
  </Text>
150
150
  </Box>
151
151
  }
@@ -157,7 +157,7 @@ function OverrideDot(props: {hasDefault: boolean; full: string; short: string; o
157
157
  onMouseLeave={() => setHover(false)}
158
158
  onFocus={() => setHover(true)}
159
159
  onBlur={() => setHover(false)}
160
- aria-label={props.hasDefault ? `Revenir à la valeur par défaut du composant : ${props.full}` : 'Définir la valeur par défaut du composant'}
160
+ aria-label={props.hasDefault ? `Go back to the component default value: ${props.full}` : 'Set the component default value'}
161
161
  style={{
162
162
  marginTop: 9,
163
163
  flex: 'none',
@@ -39,8 +39,8 @@ export function createSlugUrlInput(config: ResolvedKitConfig): ComponentType<Inp
39
39
  <Text size={1} muted style={{flex: 1, minWidth: 0, wordBreak: 'break-all'}}>
40
40
  {url}
41
41
  </Text>
42
- <Button mode="ghost" fontSize={1} padding={2} text={copied ? 'Copié' : 'Copier'} onClick={copy} />
43
- <Button as="a" href={url} target="_blank" rel="noopener noreferrer" mode="ghost" fontSize={1} padding={2} text="Ouvrir" />
42
+ <Button mode="ghost" fontSize={1} padding={2} text={copied ? 'Copied' : 'Copy'} onClick={copy} />
43
+ <Button as="a" href={url} target="_blank" rel="noopener noreferrer" mode="ghost" fontSize={1} padding={2} text="Open" />
44
44
  </Flex>
45
45
  </Card>
46
46
  )}
@@ -35,9 +35,9 @@ export function withTranslationTodo(Inner: ComponentType<InputProps>, config: Re
35
35
  <Card tone="caution" padding={2} radius={2} border>
36
36
  <Flex align="center" gap={2}>
37
37
  <Text size={1} style={{flex: 1}}>
38
- À traduire : modifié dans la version {(todo?.sourceLanguage ?? '').toUpperCase()}.
38
+ To translate: changed in the {(todo?.sourceLanguage ?? '').toUpperCase()} version.
39
39
  </Text>
40
- <Button mode="ghost" fontSize={1} padding={2} text="Marquer comme traduit" disabled={busy} onClick={done} />
40
+ <Button mode="ghost" fontSize={1} padding={2} text="Mark as translated" disabled={busy} onClick={done} />
41
41
  </Flex>
42
42
  </Card>
43
43
  )}
@@ -16,11 +16,11 @@ export interface HistoryState {
16
16
  function explain(error: unknown): string {
17
17
  const code = error instanceof Error ? error.message : String(error)
18
18
  if (code === 'bad_key')
19
- return "La clé de lecture n'est pas reconnue : relancez `npx ncf-kit setup` dans le dossier du studio, puis redéployez-le."
19
+ return "The read key is not recognized: run `npx ncf-kit setup` again in the studio folder, then redeploy it."
20
20
  if (code === 'project_inactive')
21
- return "Le journal n'est pas activé pour ce projet chez NoCode Factory : `npx ncf-kit setup` l'active, ou contactez NoCode Factory."
22
- if (code === 'missing_key') return 'Aucune clé de lecture configurée.'
23
- return "Le journal n'a pas pu être chargé."
21
+ return "The log is not enabled for this project at NoCode Factory: `npx ncf-kit setup` enables it, or contact NoCode Factory."
22
+ if (code === 'missing_key') return 'No read key configured.'
23
+ return "The log could not be loaded."
24
24
  }
25
25
 
26
26
  /**
@@ -42,7 +42,7 @@ export function useHistory(documentId?: string): HistoryState {
42
42
 
43
43
  useEffect(() => {
44
44
  if (!history) {
45
- setError('Aucune clé de lecture configurée.')
45
+ setError('No read key configured.')
46
46
  return undefined
47
47
  }
48
48
 
@@ -52,7 +52,7 @@ export function useOccurrences(): OccurrencesState {
52
52
  map.set(id, {
53
53
  id,
54
54
  type: doc._type,
55
- title: (typeof title === 'string' ? title.trim() : '') || 'Sans titre',
55
+ title: (typeof title === 'string' ? title.trim() : '') || 'Untitled',
56
56
  })
57
57
  }
58
58
  return map
@@ -50,9 +50,9 @@ export function useOpenOnline() {
50
50
  const tab = window.open('about:blank', '_blank')
51
51
  if (!tab) return
52
52
  tab.opener = null
53
- tab.document.title = 'Ouverture de la préversion…'
53
+ tab.document.title = 'Opening the preview…'
54
54
  tab.document.body.innerHTML =
55
- '<p style="font:15px/1.6 system-ui,sans-serif;color:#57534e;padding:2rem">Ouverture de la préversion…</p>'
55
+ '<p style="font:15px/1.6 system-ui,sans-serif;color:#57534e;padding:2rem">Opening the preview…</p>'
56
56
 
57
57
  try {
58
58
  const {projectId, dataset, token} = client.config()
@@ -81,8 +81,8 @@ export function useOpenOnline() {
81
81
  // On le dit dans l'onglet ouvert, plutôt que de laisser une page blanche
82
82
  // ou d'envoyer sur la page de refus sans explication.
83
83
  const message = explainGrantError(cause)
84
- tab.document.title = 'Préversion indisponible'
85
- tab.document.body.innerHTML = `<main style="font:15px/1.6 system-ui,sans-serif;color:#1c1917;padding:2rem;max-width:32rem"><h1 style="font-size:18px">Impossible d'ouvrir la préversion</h1><p style="color:#57534e"></p></main>`
84
+ tab.document.title = 'Preview unavailable'
85
+ tab.document.body.innerHTML = `<main style="font:15px/1.6 system-ui,sans-serif;color:#1c1917;padding:2rem;max-width:32rem"><h1 style="font-size:18px">Unable to open the preview</h1><p style="color:#57534e"></p></main>`
86
86
  const paragraph = tab.document.querySelector('p')
87
87
  if (paragraph) paragraph.textContent = message
88
88
  }
package/src/index.ts CHANGED
@@ -85,11 +85,11 @@ export const ncfKit = definePlugin<NcfKitConfig>((options) => {
85
85
  name: 'components',
86
86
  tool: {
87
87
  name: NCF_COMPONENTS_TOOL,
88
- title: 'Composants',
88
+ title: 'Components',
89
89
  icon: ComponentIcon,
90
90
  component: createToolComponent({
91
91
  name: 'components',
92
- title: 'Composants',
92
+ title: 'Components',
93
93
  config,
94
94
  issues,
95
95
  Component: ComponentsTool,
@@ -100,11 +100,11 @@ export const ncfKit = definePlugin<NcfKitConfig>((options) => {
100
100
  name: 'history',
101
101
  tool: {
102
102
  name: NCF_HISTORY_TOOL,
103
- title: 'Historique',
103
+ title: 'History',
104
104
  icon: ClockIcon,
105
105
  component: createToolComponent({
106
106
  name: 'history',
107
- title: 'Historique',
107
+ title: 'History',
108
108
  config,
109
109
  issues,
110
110
  Component: HistoryTool,
@@ -15,7 +15,7 @@ export interface RowGroup {
15
15
  rows: PageRow[]
16
16
  }
17
17
 
18
- export const UNSET_LABEL = 'Non renseigné'
18
+ export const UNSET_LABEL = 'Not set'
19
19
 
20
20
  export interface GroupOptions {
21
21
  /** Disposition enregistrée, qui porte étiquettes et champs internes. */
@@ -47,7 +47,7 @@ function describe(
47
47
  if (!value) return {label: UNSET_LABEL}
48
48
  if (groupBy === 'status') return {label: STATUS_LABELS[row_status(value)].label}
49
49
  if (groupBy === 'indexation') {
50
- return value === 'noindex' ? {label: 'Non indexable'} : {label: 'Indexable'}
50
+ return value === 'noindex' ? {label: 'Not indexable'} : {label: 'Indexable'}
51
51
  }
52
52
  if (groupBy === 'tag') {
53
53
  const tag = options.tags.find((t) => t.id === value)
@@ -129,20 +129,20 @@ export function sameValue(a: unknown, b: unknown): boolean {
129
129
 
130
130
  /** Valeur par défaut lisible, pour la bulle de la pastille. */
131
131
  export function describeValue(value: unknown): string {
132
- if (isEmptyValue(value)) return 'vide (valeur du design system)'
133
- if (typeof value === 'string') return value.length > 60 ? `« ${value.slice(0, 57)}… »` : `« ${value} »`
134
- if (typeof value === 'boolean') return value ? 'Oui' : 'Non'
132
+ if (isEmptyValue(value)) return 'empty (design system value)'
133
+ if (typeof value === 'string') return value.length > 60 ? `"${value.slice(0, 57)}…"` : `"${value}"`
134
+ if (typeof value === 'boolean') return value ? 'Yes' : 'No'
135
135
  if (typeof value === 'number') return String(value)
136
- if (Array.isArray(value)) return `${value.length} élément${value.length > 1 ? 's' : ''}`
136
+ if (Array.isArray(value)) return `${value.length} item${value.length > 1 ? 's' : ''}`
137
137
  if (value && typeof value === 'object') {
138
138
  const v = value as Record<string, unknown>
139
- if (typeof v.token === 'string') return `couleur ${v.token}`
140
- if (typeof v.customHex === 'string') return `couleur ${v.customHex}`
141
- if (typeof v.label === 'string') return `« ${v.label} »`
142
- if (v.asset) return 'une image'
143
- if (typeof v._ref === 'string') return 'un document'
139
+ if (typeof v.token === 'string') return `color ${v.token}`
140
+ if (typeof v.customHex === 'string') return `color ${v.customHex}`
141
+ if (typeof v.label === 'string') return `"${v.label}"`
142
+ if (v.asset) return 'an image'
143
+ if (typeof v._ref === 'string') return 'a document'
144
144
  }
145
- return 'une valeur'
145
+ return 'a value'
146
146
  }
147
147
 
148
148
  /**
package/src/lib/pages.ts CHANGED
@@ -44,8 +44,8 @@ export function formatDocumentValue(
44
44
  type: 'text' | 'boolean' | 'number',
45
45
  invert = false,
46
46
  ): string {
47
- if (value === null || value === undefined) return type === 'boolean' && invert ? 'Oui' : ''
48
- if (type === 'boolean') return (invert ? !value : Boolean(value)) ? 'Oui' : 'Non'
47
+ if (value === null || value === undefined) return type === 'boolean' && invert ? 'Yes' : ''
48
+ if (type === 'boolean') return (invert ? !value : Boolean(value)) ? 'Yes' : 'No'
49
49
  if (type === 'number') return typeof value === 'number' ? String(value) : ''
50
50
  if (typeof value === 'string') return value.trim()
51
51
  if (typeof value === 'number' || typeof value === 'boolean') return String(value)
@@ -73,7 +73,7 @@ export function buildPageRows(
73
73
  return {
74
74
  id: merged.id,
75
75
  type: doc._type,
76
- title: doc.ncfTitle?.trim() || 'Sans titre',
76
+ title: doc.ncfTitle?.trim() || 'Untitled',
77
77
  path,
78
78
  url: toUrl(config.previewUrl, path),
79
79
  locale: doc.ncfLocale ?? null,
@@ -115,10 +115,10 @@ export async function requestPreviewGrant(
115
115
  export function explainGrantError(error: unknown): string {
116
116
  const code = error instanceof Error ? error.message : String(error)
117
117
  if (code === 'missing_sanity_token') {
118
- return "Votre session Sanity n'expose pas de jeton : impossible de prouver votre accès au projet."
118
+ return "Your Sanity session exposes no token: unable to prove your access to the project."
119
119
  }
120
- if (code === 'no_project_access') return "Votre compte n'a pas accès à ce projet Sanity."
121
- if (code === 'project_inactive') return "Ce projet n'est pas actif chez NoCode Factory."
122
- if (code === 'unknown_project') return "Ce projet n'est pas enregistré chez NoCode Factory."
123
- return "Le lien n'a pas pu être créé."
120
+ if (code === 'no_project_access') return "Your account has no access to this Sanity project."
121
+ if (code === 'project_inactive') return "This project is not active at NoCode Factory."
122
+ if (code === 'unknown_project') return "This project is not registered at NoCode Factory."
123
+ return "The link could not be created."
124
124
  }
package/src/lib/status.ts CHANGED
@@ -116,7 +116,7 @@ export function mergeVersions<T extends VersionedDoc>(docs: readonly T[]): Merge
116
116
  }
117
117
 
118
118
  export const STATUS_LABELS: Record<PageStatus, {label: string; tone: 'positive' | 'caution' | 'default'; help: string}> = {
119
- published: {label: 'Publiée', tone: 'positive', help: 'En ligne, à jour'},
120
- modified: {label: 'Modifiée', tone: 'caution', help: 'En ligne, avec des modifications non publiées'},
121
- draft: {label: 'Non publiée', tone: 'default', help: 'Absente du site : jamais publiée, ou retirée du site (contenu conservé en brouillon)'},
119
+ published: {label: 'Published', tone: 'positive', help: 'Live, up to date'},
120
+ modified: {label: 'Modified', tone: 'caution', help: 'Live, with unpublished changes'},
121
+ draft: {label: 'Not published', tone: 'default', help: 'Not on the site: never published, or removed from the site (content kept in the draft)'},
122
122
  }
@@ -10,8 +10,8 @@ import type {NcfEnvironment} from '../config/types'
10
10
  export type PreviewPerspective = 'drafts' | 'published'
11
11
 
12
12
  export const PERSPECTIVES: {id: PreviewPerspective; label: string; hint: string}[] = [
13
- {id: 'drafts', label: 'Brouillons', hint: 'Ce qui sortira après publication'},
14
- {id: 'published', label: 'En ligne', hint: 'Ce que voit le public aujourd\'hui'},
13
+ {id: 'drafts', label: 'Drafts', hint: 'What will go live after publishing'},
14
+ {id: 'published', label: 'Published', hint: 'What the public sees today'},
15
15
  ]
16
16
 
17
17
  /** Retire le slash final, pour ne pas produire d'URL à double slash. */
@@ -67,13 +67,13 @@ export interface PreviewTargetEntry {
67
67
  export function previewTargets(environments: readonly NcfEnvironment[], previewUrl: string | null | undefined): PreviewTargetEntry[] {
68
68
  const previews = environments.filter((e) => !isPublicEnvironment(e, previewUrl))
69
69
  const publics = environments.filter((e) => isPublicEnvironment(e, previewUrl))
70
- const name = (e: NcfEnvironment) => (e.id === 'preprod' ? 'Préprod' : e.label)
70
+ const name = (e: NcfEnvironment) => (e.id === 'preprod' ? 'Staging' : e.label)
71
71
  return [
72
72
  ...previews.flatMap((environment): PreviewTargetEntry[] => [
73
- {environment, perspective: 'drafts', label: `${name(environment)} · Brouillons`, hint: 'Ce qui sortira après publication', tone: 'draft'},
74
- {environment, perspective: 'published', label: `${name(environment)} · En ligne`, hint: "Le contenu publié, sur la version de test du site", tone: 'live'},
73
+ {environment, perspective: 'drafts', label: `${name(environment)} · Drafts`, hint: 'What will go live after publishing', tone: 'draft'},
74
+ {environment, perspective: 'published', label: `${name(environment)} · Published`, hint: 'The published content, on the test version of the site', tone: 'live'},
75
75
  ]),
76
- ...publics.map((environment): PreviewTargetEntry => ({environment, perspective: 'published', label: 'Prod · En ligne', hint: 'Le site public, tel que le voient les visiteurs', tone: 'prod'})),
76
+ ...publics.map((environment): PreviewTargetEntry => ({environment, perspective: 'published', label: 'Prod · Published', hint: 'The public site, as visitors see it', tone: 'prod'})),
77
77
  ]
78
78
  }
79
79
 
@@ -16,26 +16,26 @@ export const NCF_HIDDEN_TYPES = [BOARD_LAYOUT_TYPE, TRANSLATION_TODO_TYPE] as co
16
16
 
17
17
  const boardNodeType = defineType({
18
18
  name: BOARD_NODE_TYPE,
19
- title: 'Position d\'une page',
19
+ title: 'Page position',
20
20
  type: 'object',
21
21
  fields: [
22
22
  defineField({name: 'documentId', title: 'Document', type: 'string'}),
23
23
  defineField({name: 'x', title: 'X', type: 'number'}),
24
24
  defineField({name: 'y', title: 'Y', type: 'number'}),
25
25
  // Taille choisie à la main ; absente tant que le nœud garde sa taille.
26
- defineField({name: 'width', title: 'Largeur', type: 'number'}),
27
- defineField({name: 'height', title: 'Hauteur', type: 'number'}),
28
- defineField({name: 'tag', title: 'Étiquette de suivi', type: 'string'}),
26
+ defineField({name: 'width', title: 'Width', type: 'number'}),
27
+ defineField({name: 'height', title: 'Height', type: 'number'}),
28
+ defineField({name: 'tag', title: 'Tracking tag', type: 'string'}),
29
29
  defineField({
30
30
  name: 'fields',
31
- title: 'Gestion interne',
31
+ title: 'Internal management',
32
32
  type: 'array',
33
33
  of: [{type: NODE_FIELD_TYPE}],
34
34
  }),
35
35
  ],
36
36
  preview: {
37
37
  select: {title: 'documentId', x: 'x', y: 'y'},
38
- prepare: ({title, x, y}) => ({title: title ?? 'Sans document', subtitle: `${x ?? 0} × ${y ?? 0}`}),
38
+ prepare: ({title, x, y}) => ({title: title ?? 'No document', subtitle: `${x ?? 0} × ${y ?? 0}`}),
39
39
  },
40
40
  })
41
41
 
@@ -45,7 +45,7 @@ const annotationType = defineType({
45
45
  title: 'Annotation',
46
46
  type: 'object',
47
47
  fields: [
48
- defineField({name: 'id', title: 'Identifiant', type: 'string'}),
48
+ defineField({name: 'id', title: 'ID', type: 'string'}),
49
49
  defineField({
50
50
  name: 'scope',
51
51
  title: 'Canvas',
@@ -54,28 +54,28 @@ const annotationType = defineType({
54
54
  }),
55
55
  defineField({
56
56
  name: 'kind',
57
- title: 'Nature',
57
+ title: 'Kind',
58
58
  type: 'string',
59
- options: {list: [{title: 'Texte', value: 'text'}, {title: 'Forme', value: 'rect'}]},
59
+ options: {list: [{title: 'Text', value: 'text'}, {title: 'Shape', value: 'rect'}]},
60
60
  }),
61
61
  defineField({name: 'x', type: 'number'}),
62
62
  defineField({name: 'y', type: 'number'}),
63
63
  defineField({name: 'width', type: 'number'}),
64
64
  defineField({name: 'height', type: 'number'}),
65
- defineField({name: 'text', title: 'Texte', type: 'string'}),
66
- defineField({name: 'color', title: 'Couleur', type: 'string'}),
65
+ defineField({name: 'text', title: 'Text', type: 'string'}),
66
+ defineField({name: 'color', title: 'Color', type: 'string'}),
67
67
  ],
68
68
  preview: {select: {title: 'text', subtitle: 'scope'}},
69
69
  })
70
70
 
71
71
  const columnOptionType = defineType({
72
72
  name: COLUMN_OPTION_TYPE,
73
- title: 'Choix',
73
+ title: 'Choice',
74
74
  type: 'object',
75
75
  fields: [
76
- defineField({name: 'id', title: 'Identifiant', type: 'string'}),
77
- defineField({name: 'label', title: 'Libellé', type: 'string'}),
78
- defineField({name: 'color', title: 'Couleur', type: 'string'}),
76
+ defineField({name: 'id', title: 'ID', type: 'string'}),
77
+ defineField({name: 'label', title: 'Label', type: 'string'}),
78
+ defineField({name: 'color', title: 'Color', type: 'string'}),
79
79
  ],
80
80
  preview: {select: {title: 'label', subtitle: 'id'}},
81
81
  })
@@ -87,29 +87,29 @@ const columnOptionType = defineType({
87
87
  */
88
88
  const columnType = defineType({
89
89
  name: COLUMN_TYPE,
90
- title: 'Colonne de gestion interne',
90
+ title: 'Internal management column',
91
91
  type: 'object',
92
92
  fields: [
93
- defineField({name: 'id', title: 'Identifiant', type: 'string'}),
94
- defineField({name: 'label', title: 'Nom', type: 'string'}),
93
+ defineField({name: 'id', title: 'ID', type: 'string'}),
94
+ defineField({name: 'label', title: 'Name', type: 'string'}),
95
95
  defineField({
96
96
  name: 'type',
97
97
  title: 'Type',
98
98
  type: 'string',
99
- options: {list: [{title: 'Texte', value: 'text'}, {title: 'Liste', value: 'select'}]},
99
+ options: {list: [{title: 'Text', value: 'text'}, {title: 'List', value: 'select'}]},
100
100
  }),
101
- defineField({name: 'options', title: 'Choix', type: 'array', of: [{type: COLUMN_OPTION_TYPE}]}),
101
+ defineField({name: 'options', title: 'Choices', type: 'array', of: [{type: COLUMN_OPTION_TYPE}]}),
102
102
  ],
103
103
  preview: {select: {title: 'label', subtitle: 'type'}},
104
104
  })
105
105
 
106
106
  const nodeFieldType = defineType({
107
107
  name: NODE_FIELD_TYPE,
108
- title: 'Champ de gestion interne',
108
+ title: 'Internal management field',
109
109
  type: 'object',
110
110
  fields: [
111
- defineField({name: 'fieldId', title: 'Champ', type: 'string'}),
112
- defineField({name: 'value', title: 'Valeur', type: 'string'}),
111
+ defineField({name: 'fieldId', title: 'Field', type: 'string'}),
112
+ defineField({name: 'value', title: 'Value', type: 'string'}),
113
113
  ],
114
114
  preview: {
115
115
  select: {title: 'fieldId', subtitle: 'value'},
@@ -118,16 +118,16 @@ const nodeFieldType = defineType({
118
118
 
119
119
  const sectionNodeType = defineType({
120
120
  name: SECTION_NODE_TYPE,
121
- title: 'Position d\'une section',
121
+ title: 'Section position',
122
122
  type: 'object',
123
123
  fields: [
124
- defineField({name: 'blockName', title: 'Type de bloc', type: 'string'}),
124
+ defineField({name: 'blockName', title: 'Block type', type: 'string'}),
125
125
  defineField({name: 'x', title: 'X', type: 'number'}),
126
126
  defineField({name: 'y', title: 'Y', type: 'number'}),
127
127
  ],
128
128
  preview: {
129
129
  select: {title: 'blockName', x: 'x', y: 'y'},
130
- prepare: ({title, x, y}) => ({title: title ?? 'Sans bloc', subtitle: `${x ?? 0} × ${y ?? 0}`}),
130
+ prepare: ({title, x, y}) => ({title: title ?? 'No block', subtitle: `${x ?? 0} × ${y ?? 0}`}),
131
131
  },
132
132
  })
133
133
 
@@ -137,7 +137,7 @@ const sectionNodeType = defineType({
137
137
  */
138
138
  const boardLayoutType = defineType({
139
139
  name: BOARD_LAYOUT_TYPE,
140
- title: 'Disposition du board (NCF)',
140
+ title: 'Board layout (NCF)',
141
141
  type: 'document',
142
142
  fields: [
143
143
  defineField({
@@ -154,26 +154,26 @@ const boardLayoutType = defineType({
154
154
  }),
155
155
  defineField({
156
156
  name: 'columns',
157
- title: 'Colonnes de gestion interne',
157
+ title: 'Internal management columns',
158
158
  type: 'array',
159
159
  of: [{type: COLUMN_TYPE}],
160
160
  }),
161
161
  // Distingue « jamais réglé » de « volontairement vidé ».
162
- defineField({name: 'columnsSet', title: 'Colonnes réglées', type: 'boolean'}),
162
+ defineField({name: 'columnsSet', title: 'Columns set', type: 'boolean'}),
163
163
  defineField({
164
164
  name: 'sections',
165
- title: 'Positions des sections',
165
+ title: 'Section positions',
166
166
  type: 'array',
167
167
  of: [{type: SECTION_NODE_TYPE}],
168
168
  }),
169
169
  defineField({
170
170
  name: 'updatedBy',
171
- title: 'Modifié par',
171
+ title: 'Modified by',
172
172
  type: 'string',
173
173
  readOnly: true,
174
174
  }),
175
175
  ],
176
- preview: {prepare: () => ({title: 'Disposition du board (NCF)'})},
176
+ preview: {prepare: () => ({title: 'Board layout (NCF)'})},
177
177
  })
178
178
 
179
179
  export const kitSchemaTypes = [
@@ -38,19 +38,19 @@ const relax = (f: FieldDef): FieldDef => {
38
38
 
39
39
  /** Document « Composants : valeurs par défaut », généré depuis les sections. */
40
40
  export function defineComponentDefaults(options: {sections: readonly unknown[]; name?: string; title?: string; namespace?: string}) {
41
- const {name = DEFAULT_COMPONENT_DEFAULTS_TYPE, title = '🧩 Composants : valeurs par défaut', namespace = 'section.'} = options
41
+ const {name = DEFAULT_COMPONENT_DEFAULTS_TYPE, title = '🧩 Components: default values', namespace = 'section.'} = options
42
42
  return defineType({
43
43
  name,
44
44
  title,
45
45
  type: 'document',
46
46
  description:
47
- 'Valeurs appliquées à chaque instance d\'un composant dont le champ est vide. Un champ rempli dans une instance reste prioritaire (override).',
47
+ 'Values applied to every instance of a component whose field is empty. A field filled in an instance takes precedence (override).',
48
48
  fields: (options.sections as SectionDef[]).map((t) =>
49
49
  defineField({
50
50
  name: defaultsFieldName(t.name, namespace),
51
51
  title: t.title || t.name,
52
52
  type: 'object',
53
- description: 'Valeurs par défaut de ce composant. Vide = valeur du design system.',
53
+ description: 'Default values of this component. Empty = design system value.',
54
54
  options: {collapsible: true, collapsed: true},
55
55
  fields: t.fields.map(relax) as never,
56
56
  }),
@@ -74,7 +74,7 @@ export function requiredUnlessDefaultFor(options: {type?: string; namespace?: st
74
74
  const type = (context.parent as {_type?: string} | undefined)?._type
75
75
  const field = context.path?.[context.path.length - 1]
76
76
  const name = type ? defaultsFieldName(type, namespace) : ''
77
- if (!type?.startsWith(namespace) || typeof field !== 'string' || !/^\w+$/.test(name) || !/^\w+$/.test(field)) return 'Obligatoire.'
77
+ if (!type?.startsWith(namespace) || typeof field !== 'string' || !/^\w+$/.test(name) || !/^\w+$/.test(field)) return 'Required.'
78
78
  const language = (context.document as {language?: string} | undefined)?.language ?? null
79
79
  const inherited = await context
80
80
  .getClient({apiVersion: '2024-10-01'})
@@ -82,7 +82,7 @@ export function requiredUnlessDefaultFor(options: {type?: string; namespace?: st
82
82
  `*[_type == $defaultsType && !(_id in path("drafts.**")) && ($language == null || language == $language)][0].${name}.${field}`,
83
83
  {defaultsType, language},
84
84
  )
85
- return isEmpty(inherited) ? 'Obligatoire (ou à définir dans Composants > valeurs par défaut).' : true
85
+ return isEmpty(inherited) ? 'Required (or set it in Components > default values).' : true
86
86
  }) as unknown as R
87
87
  }
88
88
 
@@ -11,13 +11,13 @@ export const translationTodoId = (documentId: string) => `ncfTodo.${documentId.r
11
11
 
12
12
  export const translationTodoType = defineType({
13
13
  name: TRANSLATION_TODO_TYPE,
14
- title: 'À traduire (NCF)',
14
+ title: 'To translate (NCF)',
15
15
  type: 'document',
16
16
  fields: [
17
- defineField({name: 'documentId', title: 'Traduction', type: 'string', readOnly: true}),
18
- defineField({name: 'sourceId', title: 'Version principale', type: 'string', readOnly: true}),
19
- defineField({name: 'sourceLanguage', title: 'Langue principale', type: 'string', readOnly: true}),
20
- defineField({name: 'paths', title: 'Champs à traduire', type: 'array', of: [{type: 'string'}], readOnly: true}),
17
+ defineField({name: 'documentId', title: 'Translation', type: 'string', readOnly: true}),
18
+ defineField({name: 'sourceId', title: 'Main version', type: 'string', readOnly: true}),
19
+ defineField({name: 'sourceLanguage', title: 'Main language', type: 'string', readOnly: true}),
20
+ defineField({name: 'paths', title: 'Fields to translate', type: 'array', of: [{type: 'string'}], readOnly: true}),
21
21
  ],
22
- preview: {select: {title: 'documentId'}, prepare: ({title}) => ({title: `À traduire : ${title}`})},
22
+ preview: {select: {title: 'documentId'}, prepare: ({title}) => ({title: `To translate: ${title}`})},
23
23
  })
@@ -34,7 +34,7 @@ export function BlockCard(props: BlockCardProps) {
34
34
  padding={0}
35
35
  as={onOpen ? 'button' : undefined}
36
36
  onClick={onOpen}
37
- title={onOpen ? 'Voir le composant en vrai et régler ses valeurs par défaut' : undefined}
37
+ title={onOpen ? 'See the real component and set its default values' : undefined}
38
38
  style={{height: '100%', overflow: 'hidden', width: '100%', textAlign: 'left', cursor: onOpen ? 'pointer' : undefined}}
39
39
  >
40
40
  <Stack gap={0} style={{height: '100%'}}>
@@ -56,7 +56,7 @@ export function BlockCard(props: BlockCardProps) {
56
56
  ) : (
57
57
  <Flex align="center" justify="center" style={{height: '100%'}} padding={3}>
58
58
  <Text size={0} muted align="center">
59
- {failed ? 'Capture introuvable' : 'Pas de capture'}
59
+ {failed ? 'Screenshot not found' : 'No screenshot'}
60
60
  </Text>
61
61
  </Flex>
62
62
  )}
@@ -77,7 +77,7 @@ export function BlockCard(props: BlockCardProps) {
77
77
  weight="medium"
78
78
  muted={unused}
79
79
  style={{...TABULAR, flex: 'none'}}
80
- title={unused ? 'Jamais utilisé' : `${occurrence.count} occurrences`}
80
+ title={unused ? 'Never used' : `${occurrence.count} occurrences`}
81
81
  >
82
82
  {occurrence.count}
83
83
  </Text>