@nocode-factory/sanity-kit 2.24.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 (76) 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 +467 -367
  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/LanguageMismatch.tsx +85 -0
  21. package/src/form/OverrideInput.tsx +5 -5
  22. package/src/form/SlugUrlInput.tsx +2 -2
  23. package/src/form/TranslationTodoInput.tsx +2 -2
  24. package/src/hooks/useHistory.ts +5 -5
  25. package/src/hooks/useOccurrences.ts +1 -1
  26. package/src/hooks/useOpenOnline.ts +4 -4
  27. package/src/index.ts +7 -5
  28. package/src/lib/grouping.ts +2 -2
  29. package/src/lib/overrides.ts +10 -10
  30. package/src/lib/pages.ts +3 -3
  31. package/src/lib/previewLocale.ts +17 -0
  32. package/src/lib/service.ts +5 -5
  33. package/src/lib/status.ts +3 -3
  34. package/src/lib/studioLinks.ts +6 -6
  35. package/src/schema/boardLayout.ts +32 -32
  36. package/src/schema/componentDefaults.ts +5 -5
  37. package/src/schema/translationTodo.ts +6 -6
  38. package/src/tools/components/BlockCard.tsx +3 -3
  39. package/src/tools/components/ComponentsTool.tsx +17 -17
  40. package/src/tools/components/map/SectionNode.tsx +1 -1
  41. package/src/tools/components/map/SectionsMap.tsx +10 -10
  42. package/src/tools/designSystem/DesignSystemTool.tsx +3 -3
  43. package/src/tools/history/DiffPanel.tsx +23 -23
  44. package/src/tools/history/HistoryTool.tsx +21 -23
  45. package/src/tools/more/MoreTool.tsx +1 -1
  46. package/src/tools/navbar/KitUpdate.tsx +8 -8
  47. package/src/tools/navbar/PreviewLauncher.tsx +6 -6
  48. package/src/tools/navbar/ToolButtons.tsx +2 -2
  49. package/src/tools/pages/ColumnHeader.tsx +18 -18
  50. package/src/tools/pages/ColumnVisibility.tsx +10 -10
  51. package/src/tools/pages/FieldValue.tsx +9 -9
  52. package/src/tools/pages/PagesTable.tsx +11 -11
  53. package/src/tools/pages/PagesTool.tsx +19 -19
  54. package/src/tools/pages/PagesToolbar.tsx +3 -3
  55. package/src/tools/pages/PathCell.tsx +1 -1
  56. package/src/tools/pages/PreviewTarget.tsx +10 -10
  57. package/src/tools/pages/SharePreview.tsx +19 -20
  58. package/src/tools/pages/TagCell.tsx +2 -2
  59. package/src/tools/pages/ViewTabs.tsx +4 -4
  60. package/src/tools/pages/board/BoardView.tsx +11 -11
  61. package/src/tools/pages/board/PageNode.tsx +5 -5
  62. package/src/tools/pages/board/PagePanel.tsx +10 -10
  63. package/src/tools/presentation/PreviewHeader.tsx +1 -1
  64. package/src/tools/shared/AnnotationNode.tsx +3 -3
  65. package/src/ui/ActorName.tsx +1 -1
  66. package/src/ui/ConfigIssues.tsx +3 -3
  67. package/src/ui/PreviewOriginsNotice.tsx +3 -3
  68. package/src/ui/ProjectStatusNotice.tsx +7 -7
  69. package/src/ui/QueryError.tsx +2 -2
  70. package/src/ui/ToolPlaceholder.tsx +2 -2
  71. package/src/ui/formatDate.ts +1 -1
  72. package/src/version.ts +1 -1
  73. package/src/web/PreviewBanner.tsx +9 -9
  74. package/src/web/draftModeToggle.ts +1 -1
  75. package/src/web/previewGrant.ts +5 -5
  76. package/dist/componentDefaults-BY3hQ6aD.js.map +0 -1
@@ -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>
@@ -13,10 +13,10 @@ type View = 'grid' | 'map'
13
13
  type Order = 'type' | 'schema' | 'usage' | 'unused'
14
14
 
15
15
  const ORDERS: {value: Order; label: string}[] = [
16
- {value: 'type', label: 'Par type'},
17
- {value: 'usage', label: 'Les plus utilisés'},
18
- {value: 'unused', label: 'Les inutilisés d’abord'},
19
- {value: 'schema', label: 'Ordre du schéma'},
16
+ {value: 'type', label: 'By type'},
17
+ {value: 'usage', label: 'Most used'},
18
+ {value: 'unused', label: 'Unused first'},
19
+ {value: 'schema', label: 'Schema order'},
20
20
  ]
21
21
 
22
22
  export function ComponentsTool() {
@@ -57,7 +57,7 @@ export function ComponentsTool() {
57
57
  <Flex align="center" justify="center" padding={5} gap={3}>
58
58
  <Spinner muted />
59
59
  <Text size={1} muted>
60
- Analyse du page builder…
60
+ Analyzing the page builder…
61
61
  </Text>
62
62
  </Flex>
63
63
  )
@@ -67,11 +67,11 @@ export function ComponentsTool() {
67
67
  return (
68
68
  <Card padding={4} radius={3} shadow={1} tone="caution">
69
69
  <Stack gap={3}>
70
- <Text weight="semibold">Aucun bloc trouvé.</Text>
70
+ <Text weight="semibold">No blocks found.</Text>
71
71
  <Text size={1}>
72
- Le champ « {config.pageBuilderField} » n’existe sur aucun des types{' '}
73
- {config.pageTypeNames.join(', ')}, ou il n’est pas un tableau. Vérifie
74
- `pageBuilderField` dans l’appel à ncfKit().
72
+ The field "{config.pageBuilderField}" does not exist on any of the types{' '}
73
+ {config.pageTypeNames.join(', ')}, or it is not an array. Check
74
+ `pageBuilderField` in the ncfKit() call.
75
75
  </Text>
76
76
  </Stack>
77
77
  </Card>
@@ -82,7 +82,7 @@ export function ComponentsTool() {
82
82
  <Stack gap={4}>
83
83
  <Flex gap={2}>
84
84
  <Button
85
- text="Grille"
85
+ text="Grid"
86
86
  mode={view === 'grid' ? 'default' : 'ghost'}
87
87
  fontSize={1}
88
88
  padding={2}
@@ -99,8 +99,8 @@ export function ComponentsTool() {
99
99
 
100
100
  <Flex align="center" justify="space-between" gap={3} wrap="wrap">
101
101
  <Text size={1} muted>
102
- {blockTypes.length} blocs · {scanned} pages analysées
103
- {unusedCount > 0 ? ` · ${unusedCount} jamais utilisé${unusedCount > 1 ? 's' : ''}` : ''}
102
+ {blockTypes.length} blocks · {scanned} pages analyzed
103
+ {unusedCount > 0 ? ` · ${unusedCount} never used` : ''}
104
104
  </Text>
105
105
 
106
106
  <Flex gap={2} wrap="wrap">
@@ -115,7 +115,7 @@ export function ComponentsTool() {
115
115
  />
116
116
  ))}
117
117
  <Button
118
- text="Rafraîchir"
118
+ text="Refresh"
119
119
  mode="ghost"
120
120
  fontSize={1}
121
121
  padding={2}
@@ -129,8 +129,8 @@ export function ComponentsTool() {
129
129
  {truncated && (
130
130
  <Card padding={3} radius={2} tone="caution">
131
131
  <Text size={1}>
132
- Analyse limitée aux {OCCURRENCE_SCAN_LIMIT} premières pages : les chiffres
133
- ci-dessous sont un minimum, pas un total.
132
+ Analysis limited to the first {OCCURRENCE_SCAN_LIMIT} pages: the numbers
133
+ below are a minimum, not a total.
134
134
  </Text>
135
135
  </Card>
136
136
  )}
@@ -138,8 +138,8 @@ export function ComponentsTool() {
138
138
  {!canPreview && (
139
139
  <Card padding={3} radius={2} tone="transparent" border>
140
140
  <Text size={1} muted>
141
- Vignettes désactivées : renseigne `previewUrl` dans ncfKit() pour afficher les
142
- captures du design system.
141
+ Thumbnails disabled: set `previewUrl` in ncfKit() to show the design system
142
+ screenshots.
143
143
  </Text>
144
144
  </Card>
145
145
  )}
@@ -66,7 +66,7 @@ function SectionNodeComponent(props: NodeProps<SectionFlowNode>) {
66
66
  ) : (
67
67
  <Flex align="center" justify="center" style={{height: '100%'}} padding={2}>
68
68
  <Text size={0} muted align="center">
69
- {failed ? 'Capture introuvable' : 'Pas de capture'}
69
+ {failed ? 'Screenshot not found' : 'No screenshot'}
70
70
  </Text>
71
71
  </Flex>
72
72
  )}
@@ -199,7 +199,7 @@ function MapCanvas(props: SectionsMapProps) {
199
199
  <Stack gap={3}>
200
200
  <Flex gap={2} align="center" wrap="wrap">
201
201
  <Button
202
- text="Réorganiser automatiquement"
202
+ text="Auto arrange"
203
203
  mode="ghost"
204
204
  fontSize={1}
205
205
  padding={2}
@@ -215,20 +215,20 @@ function MapCanvas(props: SectionsMapProps) {
215
215
  />
216
216
  <Button
217
217
  icon={AddIcon}
218
- text="Forme"
218
+ text="Shape"
219
219
  mode="ghost"
220
220
  fontSize={1}
221
221
  padding={2}
222
222
  onClick={() => addAnnotation('rect', screenToFlowPosition({x: 300, y: 320}))}
223
223
  />
224
224
  <Text size={0} muted>
225
- Glisser une tuile enregistre sa position · cliquer affiche ses pages
225
+ Dragging a tile saves its position · clicking shows its pages
226
226
  </Text>
227
227
  </Flex>
228
228
 
229
229
  {saveError && (
230
230
  <Card padding={3} radius={2} tone="critical">
231
- <Text size={1}>La disposition n’a pas pu être enregistrée : {saveError.message}</Text>
231
+ <Text size={1}>The layout could not be saved: {saveError.message}</Text>
232
232
  </Card>
233
233
  )}
234
234
 
@@ -280,13 +280,13 @@ function MapCanvas(props: SectionsMapProps) {
280
280
  padding={1}
281
281
  fontSize={0}
282
282
  icon={CloseIcon}
283
- aria-label="Fermer"
283
+ aria-label="Close"
284
284
  onClick={() => setSelected(null)}
285
285
  />
286
286
  </Flex>
287
287
  <Text size={0} muted>
288
288
  {selectedEntry.occurrence.count === 0
289
- ? 'Jamais utilisé sur le site.'
289
+ ? 'Never used on the site.'
290
290
  : `${selectedPages.length} page${selectedPages.length > 1 ? 's' : ''} · ${selectedEntry.occurrence.count} instance${selectedEntry.occurrence.count > 1 ? 's' : ''}`}
291
291
  </Text>
292
292
  {openComponent && (
@@ -296,8 +296,8 @@ function MapCanvas(props: SectionsMapProps) {
296
296
  tone="primary"
297
297
  fontSize={1}
298
298
  padding={2}
299
- text="Ouvrir le composant"
300
- title="Rendu réel et valeurs par défaut, côte à côte"
299
+ text="Open component"
300
+ title="Real rendering and default values, side by side"
301
301
  onClick={() => openComponent(selectedEntry.block.name)}
302
302
  />
303
303
  </Box>
@@ -336,7 +336,7 @@ function MapCanvas(props: SectionsMapProps) {
336
336
  fontSize={1}
337
337
  padding={2}
338
338
  icon={LaunchIcon}
339
- text="Voir sur le design system"
339
+ text="View on the design system"
340
340
  />
341
341
  </Box>
342
342
  )}
@@ -344,7 +344,7 @@ function MapCanvas(props: SectionsMapProps) {
344
344
  ) : (
345
345
  <Flex align="center" justify="center" style={{height: '100%'}}>
346
346
  <Text size={0} muted align="center">
347
- Cliquer une section pour l’ouvrir (rendu réel et valeurs par défaut) ou aller à ses emplacements dans les pages.
347
+ Click a section to open it (real rendering and default values) or go to where it is used in the pages.
348
348
  </Text>
349
349
  </Flex>
350
350
  )}
@@ -48,12 +48,12 @@ export function DesignSystemTool() {
48
48
  </Text>
49
49
  <Text size={1} muted>
50
50
  {available
51
- ? `Ouverture de la page ${config.componentPreview.path} dans Presentation, avec les valeurs par défaut des composants. Un style changé ici change le composant partout où il n’est pas surchargé.`
52
- : 'Ni document de valeurs par défaut des composants, ni previewUrl : rien à ouvrir. Voir la checklist du kit (README).'}
51
+ ? `Opens the ${config.componentPreview.path} page in Presentation, with the component default values. A style changed here changes the component everywhere it is not overridden.`
52
+ : 'No component default values document and no previewUrl: nothing to open. See the kit checklist (README).'}
53
53
  </Text>
54
54
  {available && (
55
55
  <Flex>
56
- <Button text="Ouvrir le design system" tone="primary" fontSize={1} onClick={open} />
56
+ <Button text="Open design system" tone="primary" fontSize={1} onClick={open} />
57
57
  </Flex>
58
58
  )}
59
59
  </Stack>
@@ -51,7 +51,7 @@ export function DiffPanel(props: DiffPanelProps) {
51
51
  if (!controller.signal.aborted) setDetail(result)
52
52
  })
53
53
  .catch(() => {
54
- if (!controller.signal.aborted) setError("Ce détail n'a pas pu être chargé.")
54
+ if (!controller.signal.aborted) setError('This detail could not be loaded.')
55
55
  })
56
56
  .finally(() => {
57
57
  if (!controller.signal.aborted) setLoading(false)
@@ -121,7 +121,7 @@ export function DiffPanel(props: DiffPanelProps) {
121
121
  </Text>
122
122
  <Flex gap={2} align="center">
123
123
  <Text size={0} muted>
124
- {new Date(event.occurred_at).toLocaleString('fr-FR')} ·
124
+ {new Date(event.occurred_at).toLocaleString('en-US')} ·
125
125
  </Text>
126
126
  <ActorName actorId={event.actor_id} actorName={event.actor_name} />
127
127
  </Flex>
@@ -131,7 +131,7 @@ export function DiffPanel(props: DiffPanelProps) {
131
131
  padding={1}
132
132
  fontSize={0}
133
133
  icon={CloseIcon}
134
- aria-label="Fermer"
134
+ aria-label="Close"
135
135
  onClick={onClose}
136
136
  />
137
137
  </Flex>
@@ -140,7 +140,7 @@ export function DiffPanel(props: DiffPanelProps) {
140
140
  <Flex align="center" gap={2} padding={3}>
141
141
  <Spinner muted />
142
142
  <Text size={1} muted>
143
- Chargement…
143
+ Loading…
144
144
  </Text>
145
145
  </Flex>
146
146
  )}
@@ -155,12 +155,12 @@ export function DiffPanel(props: DiffPanelProps) {
155
155
  <Card padding={3} radius={2} tone="positive">
156
156
  <Stack gap={3}>
157
157
  <Text size={1}>
158
- Fait <b>en brouillon</b>. Rien n'est encore en ligne : ouvrez le document,
159
- vérifiez, puis <b>publiez</b>.
158
+ Done <b>in the draft</b>. Nothing is live yet: open the document,
159
+ check it, then <b>publish</b>.
160
160
  </Text>
161
161
  {conflicts.length > 0 && (
162
162
  <Text size={1}>
163
- Non annulé, car modifié depuis : {conflicts.join(', ')}.
163
+ Not undone, because changed since: {conflicts.join(', ')}.
164
164
  </Text>
165
165
  )}
166
166
  <IntentLink
@@ -168,7 +168,7 @@ export function DiffPanel(props: DiffPanelProps) {
168
168
  params={{id: restored, type: event.document_type}}
169
169
  style={{textDecoration: 'none'}}
170
170
  >
171
- <Button mode="ghost" fontSize={1} padding={2} text="Ouvrir le brouillon" as="span" />
171
+ <Button mode="ghost" fontSize={1} padding={2} text="Open draft" as="span" />
172
172
  </IntentLink>
173
173
  </Stack>
174
174
  </Card>
@@ -178,18 +178,18 @@ export function DiffPanel(props: DiffPanelProps) {
178
178
  <>
179
179
  {!detail.previous && (
180
180
  <Text size={0} muted>
181
- Premier état connu : tout apparaît comme ajouté.
181
+ First known state: everything shows as added.
182
182
  </Text>
183
183
  )}
184
184
 
185
185
  {changes.length === 0 ? (
186
186
  <Text size={1} muted>
187
- Aucune modification de contenu — seuls des champs système ont bougé.
187
+ No content changes, only system fields changed.
188
188
  </Text>
189
189
  ) : (
190
190
  <Stack gap={2}>
191
191
  <Text size={0} weight="semibold" muted>
192
- {changes.length} modification{changes.length > 1 ? 's' : ''}
192
+ {changes.length} change{changes.length > 1 ? 's' : ''}
193
193
  </Text>
194
194
  <Card radius={2} border style={{overflow: 'hidden'}}>
195
195
  <Stack>
@@ -221,14 +221,14 @@ export function DiffPanel(props: DiffPanelProps) {
221
221
  fontSize={1}
222
222
  padding={3}
223
223
  icon={UndoIcon}
224
- text={restoring ? 'Annulation…' : 'Annuler cette modification'}
224
+ text={restoring ? 'Undoing…' : 'Undo this change'}
225
225
  disabled={restoring}
226
226
  onClick={undo}
227
227
  />
228
228
  <Text size={0} muted>
229
- Remet les valeurs d'avant cette modification, et seulement elles : ce
230
- qui a été modifié ensuite est conservé. Le résultat va dans le
231
- brouillon : publiez-le pour le mettre en ligne.
229
+ Restores the values from before this change, and only those: anything
230
+ changed afterwards is kept. The result goes into the draft: publish it
231
+ to put it live.
232
232
  </Text>
233
233
  </Stack>
234
234
  )}
@@ -239,14 +239,14 @@ export function DiffPanel(props: DiffPanelProps) {
239
239
  fontSize={1}
240
240
  padding={3}
241
241
  icon={RestoreIcon}
242
- text={restoring ? 'Restauration…' : 'Restaurer le document tel qu’après cette modification'}
242
+ text={restoring ? 'Restoring…' : 'Restore the document as it was after this change'}
243
243
  disabled={restoring}
244
244
  onClick={restore}
245
245
  />
246
246
  <Text size={0} muted>
247
- Remet le document ENTIER dans l'état qui a suivi cette modification
248
- (les modifications plus récentes sont perdues), dans le brouillon. La
249
- version en ligne n'est pas touchée tant que vous ne publiez pas.
247
+ Puts the ENTIRE document back in the state that followed this change
248
+ (more recent changes are lost), in the draft. The published version is
249
+ not touched until you publish.
250
250
  </Text>
251
251
  </Stack>
252
252
  </Stack>
@@ -265,13 +265,13 @@ export function DiffPanel(props: DiffPanelProps) {
265
265
  function explainRestore(cause: unknown): string {
266
266
  const message = cause instanceof Error ? cause.message : String(cause)
267
267
  if (/permission|insufficient|not allowed/i.test(message)) {
268
- return "Vos droits sur ce dataset ne permettent pas d'écrire ce document."
268
+ return "Your permissions on this dataset do not allow writing this document."
269
269
  }
270
270
  if (/schema|unknown type|invalid/i.test(message)) {
271
271
  return (
272
- "Cet état ne correspond plus au schéma actuel : le type a changé depuis. " +
273
- 'Restauration impossible sans intervention.'
272
+ 'This state no longer matches the current schema: the type has changed since. ' +
273
+ 'It cannot be restored without manual intervention.'
274
274
  )
275
275
  }
276
- return `La restauration a échoué, rien n'a été modifié. (${message.slice(0, 120)})`
276
+ return `Restore failed, nothing was changed. (${message.slice(0, 120)})`
277
277
  }
@@ -9,9 +9,9 @@ import {ActorName} from '../../ui/ActorName'
9
9
  import type {HistoryEvent} from '../../lib/service'
10
10
 
11
11
  const OPERATION: Record<string, {label: string; tone: 'positive' | 'primary' | 'critical'}> = {
12
- create: {label: 'création', tone: 'positive'},
13
- update: {label: 'modification', tone: 'primary'},
14
- delete: {label: 'suppression', tone: 'critical'},
12
+ create: {label: 'created', tone: 'positive'},
13
+ update: {label: 'updated', tone: 'primary'},
14
+ delete: {label: 'deleted', tone: 'critical'},
15
15
  }
16
16
 
17
17
  type Scope = 'all' | 'published'
@@ -23,8 +23,8 @@ type Scope = 'all' | 'published'
23
23
  * « qu'est-ce qui a été touché ? ».
24
24
  */
25
25
  const SCOPES: {id: Scope; label: string}[] = [
26
- {id: 'all', label: 'Tout'},
27
- {id: 'published', label: 'En ligne'},
26
+ {id: 'all', label: 'All'},
27
+ {id: 'published', label: 'Published'},
28
28
  ]
29
29
 
30
30
  /** Journal des modifications du dataset, alimenté par les webhooks Sanity. */
@@ -54,18 +54,18 @@ export function HistoryTool() {
54
54
  <Card padding={4} radius={3} tone="caution">
55
55
  <Stack gap={3}>
56
56
  <Text size={1} weight="semibold">
57
- Historique non configuré
57
+ History not configured
58
58
  </Text>
59
59
  <Text size={1}>
60
- Aucune clé de lecture. Dans le dossier du studio, la commande suivante active le projet,
61
- écrit la clé dans <code>.env</code> et crée le webhook du journal :
60
+ No read key. In the studio folder, the following command enables the project,
61
+ writes the key to <code>.env</code> and creates the log webhook:
62
62
  </Text>
63
63
  <Text size={0} style={MONO}>
64
64
  npx ncf-kit setup --types page,homePage
65
65
  </Text>
66
66
  <Text size={0} muted>
67
- Puis <code>history: {'{'}projectKey: process.env.SANITY_STUDIO_NCF_PROJECT_KEY{'}'}</code> dans
68
- sanity.config.ts et redéployez le studio. Ou masquez cet onglet avec{' '}
67
+ Then add <code>history: {'{'}projectKey: process.env.SANITY_STUDIO_NCF_PROJECT_KEY{'}'}</code> to
68
+ sanity.config.ts and redeploy the studio. Or hide this tab with{' '}
69
69
  <code>tools: {'{'}history: false{'}'}</code>.
70
70
  </Text>
71
71
  </Stack>
@@ -83,7 +83,7 @@ export function HistoryTool() {
83
83
  fontSize={1}
84
84
  padding={3}
85
85
  radius={2}
86
- placeholder="Filtrer par document, type ou auteur…"
86
+ placeholder="Filter by document, type or author…"
87
87
  value={search}
88
88
  onChange={(event) => setSearch(event.currentTarget.value)}
89
89
  />
@@ -105,7 +105,7 @@ export function HistoryTool() {
105
105
  fontSize={1}
106
106
  padding={3}
107
107
  icon={RefreshIcon}
108
- text="Actualiser"
108
+ text="Refresh"
109
109
  onClick={refresh}
110
110
  />
111
111
  </Flex>
@@ -120,7 +120,7 @@ export function HistoryTool() {
120
120
  <Flex align="center" gap={2} padding={4}>
121
121
  <Spinner muted />
122
122
  <Text size={1} muted>
123
- Chargement du journal…
123
+ Loading the log…
124
124
  </Text>
125
125
  </Flex>
126
126
  )}
@@ -129,13 +129,12 @@ export function HistoryTool() {
129
129
  <Card padding={4} radius={3} tone="transparent" border>
130
130
  <Stack gap={3}>
131
131
  <Text size={1} weight="semibold">
132
- Aucun changement enregistré
132
+ No changes recorded
133
133
  </Text>
134
134
  <Text size={1} muted>
135
- Le journal se remplit à partir du webhook Sanity de ce projet. S'il vient
136
- d'être posé, seules les modifications à venir y figureront : rien n'est
137
- reconstitué rétroactivement. Vérifiez aussi que le webhook vise bien le
138
- dataset de ce Studio.
135
+ The log is filled by this project's Sanity webhook. If it was just set up,
136
+ only upcoming changes will appear: nothing is rebuilt retroactively. Also
137
+ check that the webhook targets this Studio's dataset.
139
138
  </Text>
140
139
  </Stack>
141
140
  </Card>
@@ -175,7 +174,7 @@ export function HistoryTool() {
175
174
  fontSize={0}
176
175
  padding={1}
177
176
  >
178
- {event.is_draft ? 'brouillon' : 'en ligne'}
177
+ {event.is_draft ? 'draft' : 'published'}
179
178
  </Badge>
180
179
  </Box>
181
180
  <Box flex={1} style={{minWidth: 0}}>
@@ -188,7 +187,7 @@ export function HistoryTool() {
188
187
  </Box>
189
188
  <Box style={{width: 140, flex: 'none'}}>
190
189
  <Text size={0} muted>
191
- {new Date(event.occurred_at).toLocaleString('fr-FR', {
190
+ {new Date(event.occurred_at).toLocaleString('en-US', {
192
191
  day: '2-digit',
193
192
  month: '2-digit',
194
193
  hour: '2-digit',
@@ -209,7 +208,7 @@ export function HistoryTool() {
209
208
  mode="ghost"
210
209
  fontSize={1}
211
210
  padding={3}
212
- text={loading ? 'Chargement…' : 'Charger plus'}
211
+ text={loading ? 'Loading…' : 'Load more'}
213
212
  disabled={loading}
214
213
  onClick={loadMore}
215
214
  />
@@ -218,8 +217,7 @@ export function HistoryTool() {
218
217
 
219
218
  {search && visible.length === 0 && events.length > 0 && (
220
219
  <Text size={1} muted>
221
- Aucun événement ne correspond. Le filtre ne porte que sur les événements déjà
222
- chargés.
220
+ No matching events. The filter only applies to events already loaded.
223
221
  </Text>
224
222
  )}
225
223
  </Stack>
@@ -73,7 +73,7 @@ export function withMoreTool(tools: Tool[], names: string[] = DEFAULT_MORE_TOOLS
73
73
 
74
74
  const more: Tool<MoreToolOptions> = {
75
75
  name: NCF_MORE_TOOL,
76
- title: 'Plus',
76
+ title: 'More',
77
77
  icon: EllipsisHorizontalIcon,
78
78
  component: MoreToolComponent,
79
79
  options: {tools: hidden},
@@ -47,7 +47,7 @@ export function NcfKitUpdate(props: {inline?: boolean}) {
47
47
  padding={props.inline ? 2 : 3}
48
48
  icon={ArrowUpIcon}
49
49
  text={`Kit ${update.latest}`}
50
- title={`Une version plus récente du kit est disponible (vous exécutez la ${update.current})`}
50
+ title={`A newer version of the kit is available (you are running ${update.current})`}
51
51
  justify={props.inline ? undefined : 'flex-start'}
52
52
  onClick={toggle}
53
53
  />
@@ -57,10 +57,10 @@ export function NcfKitUpdate(props: {inline?: boolean}) {
57
57
  <Stack gap={3} padding={2}>
58
58
  <Stack gap={2}>
59
59
  <Text size={1} weight="semibold">
60
- Kit {update.latest} disponible
60
+ Kit {update.latest} available
61
61
  </Text>
62
62
  <Text size={0} muted>
63
- Vous exécutez la {update.current}.
63
+ You are running {update.current}.
64
64
  </Text>
65
65
  </Stack>
66
66
 
@@ -77,7 +77,7 @@ export function NcfKitUpdate(props: {inline?: boolean}) {
77
77
  fontSize={1}
78
78
  padding={2}
79
79
  icon={copied ? CheckmarkIcon : CopyIcon}
80
- text={copied ? 'Copié' : 'Copier la commande'}
80
+ text={copied ? 'Copied' : 'Copy command'}
81
81
  onClick={copy}
82
82
  />
83
83
  <Button
@@ -88,15 +88,15 @@ export function NcfKitUpdate(props: {inline?: boolean}) {
88
88
  mode="bleed"
89
89
  fontSize={1}
90
90
  padding={2}
91
- text="Nouveautés"
91
+ text="What's new"
92
92
  />
93
93
  </Flex>
94
94
 
95
95
  <Box style={{borderTop: `1px solid ${BORDER}`, paddingTop: 10}}>
96
96
  <Text size={0} muted>
97
- À lancer dans <code>studio/</code> puis <code>web/</code>, suivi d'un{' '}
98
- <code>npx sanity deploy</code>. Le Studio ne peut pas le faire lui-même : il
99
- s'exécute dans votre navigateur, pas sur la machine qui le construit.
97
+ Run it in <code>studio/</code> then <code>web/</code>, followed by{' '}
98
+ <code>npx sanity deploy</code>. The Studio cannot do it itself: it runs in your
99
+ browser, not on the machine that builds it.
100
100
  </Text>
101
101
  </Box>
102
102
  </Stack>