@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.
- package/dist/{componentDefaults-BY3hQ6aD.js → componentDefaults-2eWjLLBf.js} +6 -6
- package/dist/componentDefaults-2eWjLLBf.js.map +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +467 -367
- package/dist/index.js.map +1 -1
- package/dist/schema.js +1 -1
- package/dist/web-server.js +2 -2
- package/dist/web-server.js.map +1 -1
- package/dist/web.js +9 -9
- package/dist/web.js.map +1 -1
- package/package.json +1 -1
- package/src/actions/PropagatePublish.tsx +14 -14
- package/src/actions/RemoveFromSite.tsx +9 -9
- package/src/config/defaults.ts +7 -7
- package/src/config/resolve.ts +1 -1
- package/src/config/validate.ts +24 -24
- package/src/context/BoardLayoutContext.tsx +1 -1
- package/src/context/KitContext.tsx +1 -1
- package/src/context/PreviewTargetContext.tsx +1 -1
- package/src/form/LanguageMismatch.tsx +85 -0
- package/src/form/OverrideInput.tsx +5 -5
- package/src/form/SlugUrlInput.tsx +2 -2
- package/src/form/TranslationTodoInput.tsx +2 -2
- package/src/hooks/useHistory.ts +5 -5
- package/src/hooks/useOccurrences.ts +1 -1
- package/src/hooks/useOpenOnline.ts +4 -4
- package/src/index.ts +7 -5
- package/src/lib/grouping.ts +2 -2
- package/src/lib/overrides.ts +10 -10
- package/src/lib/pages.ts +3 -3
- package/src/lib/previewLocale.ts +17 -0
- package/src/lib/service.ts +5 -5
- package/src/lib/status.ts +3 -3
- package/src/lib/studioLinks.ts +6 -6
- package/src/schema/boardLayout.ts +32 -32
- package/src/schema/componentDefaults.ts +5 -5
- package/src/schema/translationTodo.ts +6 -6
- package/src/tools/components/BlockCard.tsx +3 -3
- package/src/tools/components/ComponentsTool.tsx +17 -17
- package/src/tools/components/map/SectionNode.tsx +1 -1
- package/src/tools/components/map/SectionsMap.tsx +10 -10
- package/src/tools/designSystem/DesignSystemTool.tsx +3 -3
- package/src/tools/history/DiffPanel.tsx +23 -23
- package/src/tools/history/HistoryTool.tsx +21 -23
- package/src/tools/more/MoreTool.tsx +1 -1
- package/src/tools/navbar/KitUpdate.tsx +8 -8
- package/src/tools/navbar/PreviewLauncher.tsx +6 -6
- package/src/tools/navbar/ToolButtons.tsx +2 -2
- package/src/tools/pages/ColumnHeader.tsx +18 -18
- package/src/tools/pages/ColumnVisibility.tsx +10 -10
- package/src/tools/pages/FieldValue.tsx +9 -9
- package/src/tools/pages/PagesTable.tsx +11 -11
- package/src/tools/pages/PagesTool.tsx +19 -19
- package/src/tools/pages/PagesToolbar.tsx +3 -3
- package/src/tools/pages/PathCell.tsx +1 -1
- package/src/tools/pages/PreviewTarget.tsx +10 -10
- package/src/tools/pages/SharePreview.tsx +19 -20
- package/src/tools/pages/TagCell.tsx +2 -2
- package/src/tools/pages/ViewTabs.tsx +4 -4
- package/src/tools/pages/board/BoardView.tsx +11 -11
- package/src/tools/pages/board/PageNode.tsx +5 -5
- package/src/tools/pages/board/PagePanel.tsx +10 -10
- package/src/tools/presentation/PreviewHeader.tsx +1 -1
- package/src/tools/shared/AnnotationNode.tsx +3 -3
- package/src/ui/ActorName.tsx +1 -1
- package/src/ui/ConfigIssues.tsx +3 -3
- package/src/ui/PreviewOriginsNotice.tsx +3 -3
- package/src/ui/ProjectStatusNotice.tsx +7 -7
- package/src/ui/QueryError.tsx +2 -2
- package/src/ui/ToolPlaceholder.tsx +2 -2
- package/src/ui/formatDate.ts +1 -1
- package/src/version.ts +1 -1
- package/src/web/PreviewBanner.tsx +9 -9
- package/src/web/draftModeToggle.ts +1 -1
- package/src/web/previewGrant.ts +5 -5
- package/dist/componentDefaults-BY3hQ6aD.js.map +0 -1
|
@@ -85,8 +85,8 @@ export function NcfPreviewLauncher(props: ToolMenuProps) {
|
|
|
85
85
|
fontSize={1}
|
|
86
86
|
padding={inline ? 2 : 3}
|
|
87
87
|
icon={EyeOpenIcon}
|
|
88
|
-
text="
|
|
89
|
-
title="
|
|
88
|
+
text="Preview"
|
|
89
|
+
title="Open the site in the preview"
|
|
90
90
|
justify={inline ? undefined : 'flex-start'}
|
|
91
91
|
onClick={toggle}
|
|
92
92
|
/>
|
|
@@ -96,7 +96,7 @@ export function NcfPreviewLauncher(props: ToolMenuProps) {
|
|
|
96
96
|
<Stack gap={1}>
|
|
97
97
|
<Box paddingX={2} paddingTop={1} paddingBottom={2}>
|
|
98
98
|
<Text size={0} muted>
|
|
99
|
-
|
|
99
|
+
Click: opens in the Studio. The ↗ icon: opens the live site.
|
|
100
100
|
</Text>
|
|
101
101
|
</Box>
|
|
102
102
|
{previewTargets(environments, config.previewUrl).map((target) => {
|
|
@@ -113,7 +113,7 @@ export function NcfPreviewLauncher(props: ToolMenuProps) {
|
|
|
113
113
|
close()
|
|
114
114
|
}}
|
|
115
115
|
style={{cursor: 'pointer', borderRadius: 6, minWidth: 0, background: tone.background, color: tone.color}}
|
|
116
|
-
title="
|
|
116
|
+
title="Open in the Studio (Presentation)"
|
|
117
117
|
>
|
|
118
118
|
<Stack gap={1} style={{minWidth: 0}}>
|
|
119
119
|
<Text size={1} weight="semibold" style={{color: tone.color}}>
|
|
@@ -129,8 +129,8 @@ export function NcfPreviewLauncher(props: ToolMenuProps) {
|
|
|
129
129
|
padding={2}
|
|
130
130
|
fontSize={1}
|
|
131
131
|
icon={LaunchIcon}
|
|
132
|
-
title="
|
|
133
|
-
aria-label={`
|
|
132
|
+
title="Open the live site in a new tab"
|
|
133
|
+
aria-label={`Open ${target.label} in a new tab`}
|
|
134
134
|
onClick={() => {
|
|
135
135
|
openOnline(target.environment, target.perspective)
|
|
136
136
|
close()
|
|
@@ -64,12 +64,12 @@ export function NcfToolButtons(props: ToolMenuProps & {more: string[]}) {
|
|
|
64
64
|
button={
|
|
65
65
|
<Button
|
|
66
66
|
icon={EllipsisHorizontalIcon}
|
|
67
|
-
text="
|
|
67
|
+
text="More"
|
|
68
68
|
mode="bleed"
|
|
69
69
|
fontSize={1}
|
|
70
70
|
padding={3}
|
|
71
71
|
selected={more.some((t) => t.name === activeToolName)}
|
|
72
|
-
title={`
|
|
72
|
+
title={`Technical tools (${more.map((t) => t.title || t.name).join(', ')})`}
|
|
73
73
|
/>
|
|
74
74
|
}
|
|
75
75
|
menu={
|
|
@@ -50,17 +50,17 @@ export function ColumnHeader(props: ColumnHeaderProps) {
|
|
|
50
50
|
return (
|
|
51
51
|
<Flex align="center" gap={1}>
|
|
52
52
|
<Text size={0} muted>
|
|
53
|
-
|
|
53
|
+
Delete?
|
|
54
54
|
</Text>
|
|
55
55
|
<Button
|
|
56
56
|
mode="bleed"
|
|
57
57
|
tone="critical"
|
|
58
58
|
padding={1}
|
|
59
59
|
fontSize={0}
|
|
60
|
-
text="
|
|
60
|
+
text="Yes"
|
|
61
61
|
onClick={() => onRemove(column.id)}
|
|
62
62
|
/>
|
|
63
|
-
<Button mode="bleed" padding={1} fontSize={0} text="
|
|
63
|
+
<Button mode="bleed" padding={1} fontSize={0} text="No" onClick={() => setConfirming(false)} />
|
|
64
64
|
</Flex>
|
|
65
65
|
)
|
|
66
66
|
}
|
|
@@ -74,7 +74,7 @@ export function ColumnHeader(props: ColumnHeaderProps) {
|
|
|
74
74
|
onMouseLeave={() => setHovered(false)}
|
|
75
75
|
>
|
|
76
76
|
<Box flex={1} style={{minWidth: 0, cursor: 'text'}} onClick={() => setEditing(true)}>
|
|
77
|
-
<Text size={0} weight="medium" muted textOverflow="ellipsis" title="
|
|
77
|
+
<Text size={0} weight="medium" muted textOverflow="ellipsis" title="Click to rename">
|
|
78
78
|
{column.label || column.id}
|
|
79
79
|
</Text>
|
|
80
80
|
</Box>
|
|
@@ -94,8 +94,8 @@ export function ColumnHeader(props: ColumnHeaderProps) {
|
|
|
94
94
|
padding={1}
|
|
95
95
|
fontSize={0}
|
|
96
96
|
icon={UlistIcon}
|
|
97
|
-
title="
|
|
98
|
-
aria-label="
|
|
97
|
+
title="Manage choices"
|
|
98
|
+
aria-label="Manage column choices"
|
|
99
99
|
onClick={toggle}
|
|
100
100
|
/>
|
|
101
101
|
)}
|
|
@@ -108,8 +108,8 @@ export function ColumnHeader(props: ColumnHeaderProps) {
|
|
|
108
108
|
padding={1}
|
|
109
109
|
fontSize={0}
|
|
110
110
|
icon={ChevronLeftIcon}
|
|
111
|
-
title="
|
|
112
|
-
aria-label="
|
|
111
|
+
title="Move left"
|
|
112
|
+
aria-label="Move column left"
|
|
113
113
|
onClick={() => onMove(column.id, -1)}
|
|
114
114
|
/>
|
|
115
115
|
<Button
|
|
@@ -117,8 +117,8 @@ export function ColumnHeader(props: ColumnHeaderProps) {
|
|
|
117
117
|
padding={1}
|
|
118
118
|
fontSize={0}
|
|
119
119
|
icon={ChevronRightIcon}
|
|
120
|
-
title="
|
|
121
|
-
aria-label="
|
|
120
|
+
title="Move right"
|
|
121
|
+
aria-label="Move column right"
|
|
122
122
|
onClick={() => onMove(column.id, 1)}
|
|
123
123
|
/>
|
|
124
124
|
<Button
|
|
@@ -127,8 +127,8 @@ export function ColumnHeader(props: ColumnHeaderProps) {
|
|
|
127
127
|
fontSize={0}
|
|
128
128
|
icon={CloseIcon}
|
|
129
129
|
tone="critical"
|
|
130
|
-
title="
|
|
131
|
-
aria-label="
|
|
130
|
+
title="Delete column"
|
|
131
|
+
aria-label="Delete column"
|
|
132
132
|
onClick={() => setConfirming(true)}
|
|
133
133
|
/>
|
|
134
134
|
</Flex>
|
|
@@ -154,7 +154,7 @@ export function AddColumn(props: AddColumnProps) {
|
|
|
154
154
|
padding={1}
|
|
155
155
|
fontSize={0}
|
|
156
156
|
icon={AddIcon}
|
|
157
|
-
text="
|
|
157
|
+
text="Column"
|
|
158
158
|
onClick={() => setOpen(true)}
|
|
159
159
|
/>
|
|
160
160
|
)
|
|
@@ -175,7 +175,7 @@ export function AddColumn(props: AddColumnProps) {
|
|
|
175
175
|
padding={1}
|
|
176
176
|
radius={2}
|
|
177
177
|
autoFocus
|
|
178
|
-
placeholder="
|
|
178
|
+
placeholder="Column name"
|
|
179
179
|
value={label}
|
|
180
180
|
onChange={(event) => setLabel(event.currentTarget.value)}
|
|
181
181
|
onKeyDown={(event) => {
|
|
@@ -188,14 +188,14 @@ export function AddColumn(props: AddColumnProps) {
|
|
|
188
188
|
mode={type === 'text' ? 'default' : 'bleed'}
|
|
189
189
|
padding={1}
|
|
190
190
|
fontSize={0}
|
|
191
|
-
text="
|
|
191
|
+
text="Text"
|
|
192
192
|
onClick={() => setType('text')}
|
|
193
193
|
/>
|
|
194
194
|
<Button
|
|
195
195
|
mode={type === 'select' ? 'default' : 'bleed'}
|
|
196
196
|
padding={1}
|
|
197
197
|
fontSize={0}
|
|
198
|
-
text="
|
|
198
|
+
text="List"
|
|
199
199
|
onClick={() => setType('select')}
|
|
200
200
|
/>
|
|
201
201
|
</Flex>
|
|
@@ -205,10 +205,10 @@ export function AddColumn(props: AddColumnProps) {
|
|
|
205
205
|
tone="primary"
|
|
206
206
|
padding={1}
|
|
207
207
|
fontSize={0}
|
|
208
|
-
text="
|
|
208
|
+
text="Add"
|
|
209
209
|
onClick={submit}
|
|
210
210
|
/>
|
|
211
|
-
<Button mode="bleed" padding={1} fontSize={0} text="
|
|
211
|
+
<Button mode="bleed" padding={1} fontSize={0} text="Cancel" onClick={() => setOpen(false)} />
|
|
212
212
|
</Flex>
|
|
213
213
|
</Stack>
|
|
214
214
|
</Card>
|
|
@@ -8,10 +8,10 @@ import type {ResolvedDocumentColumn} from '../../config/types'
|
|
|
8
8
|
|
|
9
9
|
/** Colonnes qu'on peut masquer. Titre et chemin restent toujours visibles. */
|
|
10
10
|
export const HIDEABLE = [
|
|
11
|
-
{key: 'status', label: '
|
|
12
|
-
{key: 'blockCount', label: '
|
|
13
|
-
{key: 'updatedAt', label: '
|
|
14
|
-
{key: 'tag', label: '
|
|
11
|
+
{key: 'status', label: 'Status'},
|
|
12
|
+
{key: 'blockCount', label: 'Blocks'},
|
|
13
|
+
{key: 'updatedAt', label: 'Updated'},
|
|
14
|
+
{key: 'tag', label: 'Tag'},
|
|
15
15
|
] as const
|
|
16
16
|
|
|
17
17
|
export type HideableKey = (typeof HIDEABLE)[number]['key']
|
|
@@ -33,10 +33,10 @@ export function ColumnVisibility(props: ColumnVisibilityProps) {
|
|
|
33
33
|
const shownCount = dataColumns.filter((column) => shownData.has(column.key)).length
|
|
34
34
|
const label =
|
|
35
35
|
hiddenCount > 0
|
|
36
|
-
? `
|
|
36
|
+
? `Columns · ${hiddenCount} hidden`
|
|
37
37
|
: shownCount > 0
|
|
38
|
-
? `
|
|
39
|
-
: '
|
|
38
|
+
? `Columns · +${shownCount}`
|
|
39
|
+
: 'Columns'
|
|
40
40
|
|
|
41
41
|
return (
|
|
42
42
|
<InlinePopover
|
|
@@ -124,7 +124,7 @@ function DataColumnList(props: ColumnVisibilityProps) {
|
|
|
124
124
|
<>
|
|
125
125
|
<Box paddingX={2} paddingTop={3} paddingBottom={1}>
|
|
126
126
|
<Text size={0} weight="semibold" muted>
|
|
127
|
-
|
|
127
|
+
Page data
|
|
128
128
|
</Text>
|
|
129
129
|
</Box>
|
|
130
130
|
|
|
@@ -133,7 +133,7 @@ function DataColumnList(props: ColumnVisibilityProps) {
|
|
|
133
133
|
<input
|
|
134
134
|
type="text"
|
|
135
135
|
value={filter}
|
|
136
|
-
placeholder="
|
|
136
|
+
placeholder="Filter…"
|
|
137
137
|
onChange={(event) => setFilter(event.currentTarget.value)}
|
|
138
138
|
style={{
|
|
139
139
|
width: '100%',
|
|
@@ -162,7 +162,7 @@ function DataColumnList(props: ColumnVisibilityProps) {
|
|
|
162
162
|
{matches.length === 0 && (
|
|
163
163
|
<Box padding={2}>
|
|
164
164
|
<Text size={0} muted>
|
|
165
|
-
|
|
165
|
+
No matching fields.
|
|
166
166
|
</Text>
|
|
167
167
|
</Box>
|
|
168
168
|
)}
|
|
@@ -54,7 +54,7 @@ export function FieldValue(props: FieldValueProps) {
|
|
|
54
54
|
border: bordered ? `1px solid ${BORDER}` : undefined,
|
|
55
55
|
background: bordered ? 'var(--card-bg-color)' : undefined,
|
|
56
56
|
}}
|
|
57
|
-
title={`
|
|
57
|
+
title={`Change ${(column.label || column.id).toLowerCase()}`}
|
|
58
58
|
>
|
|
59
59
|
{current ? (
|
|
60
60
|
<>
|
|
@@ -108,7 +108,7 @@ export function OptionEditor(props: OptionEditorProps) {
|
|
|
108
108
|
<Stack gap={1}>
|
|
109
109
|
{onSelect && (
|
|
110
110
|
<Option
|
|
111
|
-
label="
|
|
111
|
+
label="No value"
|
|
112
112
|
selected={!options.some((option) => option.id === selectedId)}
|
|
113
113
|
onSelect={() => onSelect('')}
|
|
114
114
|
/>
|
|
@@ -117,7 +117,7 @@ export function OptionEditor(props: OptionEditorProps) {
|
|
|
117
117
|
{options.length === 0 && !onSelect && (
|
|
118
118
|
<Box padding={2}>
|
|
119
119
|
<Text size={0} muted>
|
|
120
|
-
|
|
120
|
+
No choices yet.
|
|
121
121
|
</Text>
|
|
122
122
|
</Box>
|
|
123
123
|
)}
|
|
@@ -185,7 +185,7 @@ function Option(props: {
|
|
|
185
185
|
>
|
|
186
186
|
<Box
|
|
187
187
|
onClick={() => props.onColor && setPicking((value) => !value)}
|
|
188
|
-
title={props.onColor ? '
|
|
188
|
+
title={props.onColor ? 'Color' : undefined}
|
|
189
189
|
style={{
|
|
190
190
|
width: 10,
|
|
191
191
|
height: 10,
|
|
@@ -213,8 +213,8 @@ function Option(props: {
|
|
|
213
213
|
padding={1}
|
|
214
214
|
fontSize={0}
|
|
215
215
|
icon={CloseIcon}
|
|
216
|
-
title="
|
|
217
|
-
aria-label="
|
|
216
|
+
title="Delete this choice"
|
|
217
|
+
aria-label="Delete this choice"
|
|
218
218
|
onClick={props.onRemove}
|
|
219
219
|
/>
|
|
220
220
|
)}
|
|
@@ -243,7 +243,7 @@ function Option(props: {
|
|
|
243
243
|
mode="bleed"
|
|
244
244
|
padding={1}
|
|
245
245
|
fontSize={0}
|
|
246
|
-
text="
|
|
246
|
+
text="None"
|
|
247
247
|
onClick={() => {
|
|
248
248
|
props.onColor?.(null)
|
|
249
249
|
setPicking(false)
|
|
@@ -279,7 +279,7 @@ function NewOption(props: {onAdd: (label: string) => void}) {
|
|
|
279
279
|
padding={2}
|
|
280
280
|
fontSize={1}
|
|
281
281
|
icon={AddIcon}
|
|
282
|
-
text="
|
|
282
|
+
text="Add a choice"
|
|
283
283
|
style={{width: '100%', justifyContent: 'flex-start'}}
|
|
284
284
|
onClick={() => setOpen(true)}
|
|
285
285
|
/>
|
|
@@ -292,7 +292,7 @@ function NewOption(props: {onAdd: (label: string) => void}) {
|
|
|
292
292
|
type="text"
|
|
293
293
|
autoFocus
|
|
294
294
|
value={label}
|
|
295
|
-
placeholder="
|
|
295
|
+
placeholder="Choice name"
|
|
296
296
|
onChange={(event) => setLabel(event.currentTarget.value)}
|
|
297
297
|
onKeyDown={(event) => {
|
|
298
298
|
if (event.key === 'Enter') submit()
|
|
@@ -18,11 +18,11 @@ import {PathCell} from './PathCell'
|
|
|
18
18
|
import {TagCell} from './TagCell'
|
|
19
19
|
|
|
20
20
|
const BASE_COLUMNS: {key: SortKey; label: string; align?: 'right'; width: string}[] = [
|
|
21
|
-
{key: 'title', label: '
|
|
22
|
-
{key: 'path', label: '
|
|
23
|
-
{key: 'status', label: '
|
|
24
|
-
{key: 'blockCount', label: '
|
|
25
|
-
{key: 'updatedAt', label: '
|
|
21
|
+
{key: 'title', label: 'Title', width: 'minmax(180px, 1.6fr)'},
|
|
22
|
+
{key: 'path', label: 'Path', width: 'minmax(200px, 2fr)'},
|
|
23
|
+
{key: 'status', label: 'Status', width: '118px'},
|
|
24
|
+
{key: 'blockCount', label: 'Blocks', align: 'right', width: '64px'},
|
|
25
|
+
{key: 'updatedAt', label: 'Updated', width: '132px'},
|
|
26
26
|
]
|
|
27
27
|
|
|
28
28
|
export interface PagesTableProps {
|
|
@@ -170,7 +170,7 @@ export function PagesTable(props: PagesTableProps) {
|
|
|
170
170
|
justify={column.align === 'right' ? 'flex-end' : 'flex-start'}
|
|
171
171
|
onClick={() => onSort(column.key)}
|
|
172
172
|
style={{cursor: 'pointer', userSelect: 'none'}}
|
|
173
|
-
title={`
|
|
173
|
+
title={`Sort by ${column.label.toLowerCase()}`}
|
|
174
174
|
>
|
|
175
175
|
<Text size={0} weight="medium" muted={!active}>
|
|
176
176
|
{column.label}
|
|
@@ -188,7 +188,7 @@ export function PagesTable(props: PagesTableProps) {
|
|
|
188
188
|
|
|
189
189
|
{showTag && (
|
|
190
190
|
<Text size={0} weight="medium" muted>
|
|
191
|
-
|
|
191
|
+
Tag
|
|
192
192
|
</Text>
|
|
193
193
|
)}
|
|
194
194
|
|
|
@@ -297,7 +297,7 @@ export function PagesTable(props: PagesTableProps) {
|
|
|
297
297
|
<Box
|
|
298
298
|
style={{...CELL, cursor: 'pointer'}}
|
|
299
299
|
onClick={() => onOpen(entryRow)}
|
|
300
|
-
title="
|
|
300
|
+
title="Open in Presentation"
|
|
301
301
|
>
|
|
302
302
|
<Text size={1} weight="medium" textOverflow="ellipsis">
|
|
303
303
|
{entryRow.title}
|
|
@@ -324,9 +324,9 @@ export function PagesTable(props: PagesTableProps) {
|
|
|
324
324
|
<Badge
|
|
325
325
|
tone="caution"
|
|
326
326
|
fontSize={0}
|
|
327
|
-
title="
|
|
327
|
+
title="Fields changed in the main version, not yet translated (marked "To translate" in the form)"
|
|
328
328
|
>
|
|
329
|
-
|
|
329
|
+
To translate · {todos?.get(entryRow.id)}
|
|
330
330
|
</Badge>
|
|
331
331
|
)}
|
|
332
332
|
{/* L'indexation ne se signale que lorsqu'elle bloque :
|
|
@@ -335,7 +335,7 @@ export function PagesTable(props: PagesTableProps) {
|
|
|
335
335
|
<Badge
|
|
336
336
|
tone="caution"
|
|
337
337
|
fontSize={0}
|
|
338
|
-
title="
|
|
338
|
+
title="Excluded from Google, the sitemap and llms.txt"
|
|
339
339
|
>
|
|
340
340
|
Noindex
|
|
341
341
|
</Badge>
|
|
@@ -143,8 +143,8 @@ export function PagesTool() {
|
|
|
143
143
|
if (error) return <QueryError error={error} onRetry={refresh} />
|
|
144
144
|
|
|
145
145
|
const colorOptions = [
|
|
146
|
-
{value: 'tag' as ColorBy, label: '
|
|
147
|
-
{value: 'status' as ColorBy, label: '
|
|
146
|
+
{value: 'tag' as ColorBy, label: 'Tag'},
|
|
147
|
+
{value: 'status' as ColorBy, label: 'Status'},
|
|
148
148
|
...columns.map((field) => ({
|
|
149
149
|
value: `field:${field.id}` as ColorBy,
|
|
150
150
|
label: field.label || field.id,
|
|
@@ -154,13 +154,13 @@ export function PagesTool() {
|
|
|
154
154
|
const summary =
|
|
155
155
|
visible.length === rows.length
|
|
156
156
|
? `${rows.length} page${rows.length > 1 ? 's' : ''}`
|
|
157
|
-
: `${visible.length}
|
|
157
|
+
: `${visible.length} of ${rows.length}`
|
|
158
158
|
|
|
159
159
|
const loadingState = (
|
|
160
160
|
<Flex align="center" justify="center" padding={6} gap={3}>
|
|
161
161
|
<Spinner muted />
|
|
162
162
|
<Text size={1} muted>
|
|
163
|
-
|
|
163
|
+
Loading pages…
|
|
164
164
|
</Text>
|
|
165
165
|
</Flex>
|
|
166
166
|
)
|
|
@@ -200,7 +200,7 @@ export function PagesTool() {
|
|
|
200
200
|
|
|
201
201
|
{locales.length > 1 && (
|
|
202
202
|
<Box style={{width: 120, flex: 'none'}}>
|
|
203
|
-
<FieldLabel>
|
|
203
|
+
<FieldLabel>Language</FieldLabel>
|
|
204
204
|
<Select
|
|
205
205
|
fontSize={1}
|
|
206
206
|
radius={2}
|
|
@@ -210,7 +210,7 @@ export function PagesTool() {
|
|
|
210
210
|
setPage(0)
|
|
211
211
|
}}
|
|
212
212
|
>
|
|
213
|
-
<option value="">
|
|
213
|
+
<option value="">All</option>
|
|
214
214
|
{locales.map((code) => (
|
|
215
215
|
<option key={code} value={code}>
|
|
216
216
|
{code.toUpperCase()}
|
|
@@ -222,7 +222,7 @@ export function PagesTool() {
|
|
|
222
222
|
|
|
223
223
|
{(todos.size > 0 || onlyTodo) && (
|
|
224
224
|
<Box style={{width: 150, flex: 'none'}}>
|
|
225
|
-
<FieldLabel>
|
|
225
|
+
<FieldLabel>Translation</FieldLabel>
|
|
226
226
|
<Select
|
|
227
227
|
fontSize={1}
|
|
228
228
|
radius={2}
|
|
@@ -232,24 +232,24 @@ export function PagesTool() {
|
|
|
232
232
|
setPage(0)
|
|
233
233
|
}}
|
|
234
234
|
>
|
|
235
|
-
<option value="">
|
|
236
|
-
<option value="todo"
|
|
235
|
+
<option value="">All</option>
|
|
236
|
+
<option value="todo">To translate ({todos.size})</option>
|
|
237
237
|
</Select>
|
|
238
238
|
</Box>
|
|
239
239
|
)}
|
|
240
240
|
|
|
241
241
|
{view === 'list' && (
|
|
242
242
|
<Box style={{width: 168, flex: 'none'}}>
|
|
243
|
-
<FieldLabel>
|
|
243
|
+
<FieldLabel>Group by</FieldLabel>
|
|
244
244
|
<Select
|
|
245
245
|
fontSize={1}
|
|
246
246
|
radius={2}
|
|
247
247
|
value={groupBy}
|
|
248
248
|
onChange={(event) => setGroupBy(event.currentTarget.value as GroupBy)}
|
|
249
249
|
>
|
|
250
|
-
<option value="none">
|
|
251
|
-
<option value="tag"
|
|
252
|
-
<option value="status">
|
|
250
|
+
<option value="none">None</option>
|
|
251
|
+
<option value="tag">Tag</option>
|
|
252
|
+
<option value="status">Status</option>
|
|
253
253
|
<option value="indexation">Indexation</option>
|
|
254
254
|
<option value="type">Type</option>
|
|
255
255
|
{columns.map((field) => (
|
|
@@ -262,7 +262,7 @@ export function PagesTool() {
|
|
|
262
262
|
)}
|
|
263
263
|
|
|
264
264
|
<Box style={{width: 168, flex: 'none'}}>
|
|
265
|
-
<FieldLabel>
|
|
265
|
+
<FieldLabel>Color by</FieldLabel>
|
|
266
266
|
<Select
|
|
267
267
|
fontSize={1}
|
|
268
268
|
radius={2}
|
|
@@ -310,12 +310,12 @@ export function PagesTool() {
|
|
|
310
310
|
<Box padding={6}>
|
|
311
311
|
<Stack gap={3}>
|
|
312
312
|
<Text size={1} weight="medium" align="center">
|
|
313
|
-
{rows.length === 0 ? '
|
|
313
|
+
{rows.length === 0 ? 'No pages in this dataset' : 'No results'}
|
|
314
314
|
</Text>
|
|
315
315
|
<Text size={1} muted align="center">
|
|
316
316
|
{rows.length === 0
|
|
317
|
-
? `
|
|
318
|
-
: '
|
|
317
|
+
? `The kit tracks the types ${config.pageTypeNames.join(', ')}.`
|
|
318
|
+
: 'Try another term or another language, or clear the search.'}
|
|
319
319
|
</Text>
|
|
320
320
|
</Stack>
|
|
321
321
|
</Box>
|
|
@@ -357,9 +357,9 @@ export function PagesTool() {
|
|
|
357
357
|
|
|
358
358
|
{pageCount > 1 && (
|
|
359
359
|
<Flex gap={2}>
|
|
360
|
-
<PageStep label="
|
|
360
|
+
<PageStep label="Previous" disabled={current === 0} onClick={() => setPage(current - 1)} />
|
|
361
361
|
<PageStep
|
|
362
|
-
label="
|
|
362
|
+
label="Next"
|
|
363
363
|
disabled={current >= pageCount - 1}
|
|
364
364
|
onClick={() => setPage(current + 1)}
|
|
365
365
|
/>
|
|
@@ -26,7 +26,7 @@ export function PagesToolbar(props: PagesToolbarProps) {
|
|
|
26
26
|
<TextInput
|
|
27
27
|
value={props.search}
|
|
28
28
|
onChange={(event) => props.onSearch(event.currentTarget.value)}
|
|
29
|
-
placeholder="
|
|
29
|
+
placeholder="Search a title or a path"
|
|
30
30
|
icon={SearchIcon}
|
|
31
31
|
clearButton={props.search.length > 0}
|
|
32
32
|
onClear={() => props.onSearch('')}
|
|
@@ -42,8 +42,8 @@ export function PagesToolbar(props: PagesToolbarProps) {
|
|
|
42
42
|
tone="default"
|
|
43
43
|
fontSize={1}
|
|
44
44
|
padding={2}
|
|
45
|
-
title="
|
|
46
|
-
aria-label="
|
|
45
|
+
title="Refresh"
|
|
46
|
+
aria-label="Refresh"
|
|
47
47
|
onClick={props.onRefresh}
|
|
48
48
|
disabled={props.busy}
|
|
49
49
|
/>
|
|
@@ -47,7 +47,7 @@ export function PreviewTarget(props: PreviewTargetProps) {
|
|
|
47
47
|
|
|
48
48
|
return (
|
|
49
49
|
<Box style={{flex: 'none'}}>
|
|
50
|
-
<FieldLabel>
|
|
50
|
+
<FieldLabel>Preview</FieldLabel>
|
|
51
51
|
<Flex gap={1} align="center">
|
|
52
52
|
{PERSPECTIVES.map((option) => {
|
|
53
53
|
const active = option.id === perspective
|
|
@@ -61,7 +61,7 @@ export function PreviewTarget(props: PreviewTargetProps) {
|
|
|
61
61
|
fontSize={1}
|
|
62
62
|
padding={2}
|
|
63
63
|
text={option.label}
|
|
64
|
-
title={unavailable ?
|
|
64
|
+
title={unavailable ? 'Production only shows published content: review drafts on staging.' : option.hint}
|
|
65
65
|
aria-pressed={active}
|
|
66
66
|
onClick={() => onPerspective(option.id)}
|
|
67
67
|
/>
|
|
@@ -76,8 +76,8 @@ export function PreviewTarget(props: PreviewTargetProps) {
|
|
|
76
76
|
fontSize={1}
|
|
77
77
|
padding={2}
|
|
78
78
|
icon={EarthGlobeIcon}
|
|
79
|
-
text={current?.label ?? '
|
|
80
|
-
title="
|
|
79
|
+
text={current?.label ?? 'Environment'}
|
|
80
|
+
title="Site version loaded in the preview"
|
|
81
81
|
onClick={toggle}
|
|
82
82
|
/>
|
|
83
83
|
)}
|
|
@@ -86,7 +86,7 @@ export function PreviewTarget(props: PreviewTargetProps) {
|
|
|
86
86
|
<Stack gap={1}>
|
|
87
87
|
<Box paddingX={2} paddingTop={2} paddingBottom={1}>
|
|
88
88
|
<Text size={0} muted>
|
|
89
|
-
|
|
89
|
+
Site version. The data does not change.
|
|
90
90
|
</Text>
|
|
91
91
|
</Box>
|
|
92
92
|
|
|
@@ -154,7 +154,7 @@ function EnvironmentRow(props: {
|
|
|
154
154
|
<Text size={0} muted textOverflow="ellipsis">
|
|
155
155
|
{/* Le site public se signale : on n'y prévisualise rien, et un lien
|
|
156
156
|
de partage vers lui ne montrerait rien. */}
|
|
157
|
-
{props.isProduction ? '
|
|
157
|
+
{props.isProduction ? 'public site (no preview)' : hostOf(props.environment.url)}
|
|
158
158
|
</Text>
|
|
159
159
|
</Stack>
|
|
160
160
|
{/* Seule l'adresse collée s'oublie : les environnements déclarés
|
|
@@ -165,8 +165,8 @@ function EnvironmentRow(props: {
|
|
|
165
165
|
padding={1}
|
|
166
166
|
fontSize={0}
|
|
167
167
|
icon={CloseIcon}
|
|
168
|
-
title="
|
|
169
|
-
aria-label="
|
|
168
|
+
title="Forget this address"
|
|
169
|
+
aria-label="Forget this address"
|
|
170
170
|
onClick={props.onForget}
|
|
171
171
|
/>
|
|
172
172
|
)}
|
|
@@ -196,7 +196,7 @@ function CustomUrlField(props: {current: string | null; onSubmit: (url: string)
|
|
|
196
196
|
<input
|
|
197
197
|
type="text"
|
|
198
198
|
value={value}
|
|
199
|
-
placeholder={props.current ? '
|
|
199
|
+
placeholder={props.current ? 'Other address…' : 'Paste a preview URL…'}
|
|
200
200
|
onChange={(event) => {
|
|
201
201
|
setValue(event.currentTarget.value)
|
|
202
202
|
setRejected(false)
|
|
@@ -219,7 +219,7 @@ function CustomUrlField(props: {current: string | null; onSubmit: (url: string)
|
|
|
219
219
|
/>
|
|
220
220
|
{rejected && (
|
|
221
221
|
<Text size={0} style={{color: 'var(--card-badge-critical-dot-color, #e03131)'}}>
|
|
222
|
-
|
|
222
|
+
Unusable address.
|
|
223
223
|
</Text>
|
|
224
224
|
)}
|
|
225
225
|
</Stack>
|