@nocode-factory/sanity-kit 2.49.1 → 2.51.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 +2 -1
- package/dist/{finalUrl-C1kzYMzQ.js → finalUrl-CaFXmYvm.js} +3 -2
- package/dist/finalUrl-CaFXmYvm.js.map +1 -0
- package/dist/{fixCrossLanguageReferences-BZk9CkdI.js → fixCrossLanguageReferences-BeXywAAU.js} +2 -2
- package/dist/{fixCrossLanguageReferences-BZk9CkdI.js.map → fixCrossLanguageReferences-BeXywAAU.js.map} +1 -1
- package/dist/{fixCrossLanguageReferences-CjL_Xy0U.d.ts → fixCrossLanguageReferences-w3whO9xM.d.ts} +4 -2
- package/dist/index.d.ts +287 -5
- package/dist/index.js +2119 -181
- package/dist/index.js.map +1 -1
- package/dist/jsonld.js +1 -1
- package/dist/schema.d.ts +1 -1
- package/dist/schema.js +2 -2
- package/package.json +3 -1
- package/src/config/defaults.ts +1 -0
- package/src/config/types.ts +3 -1
- package/src/context/ComponentMetaContext.tsx +23 -0
- package/src/form/ArrayNamesInput.tsx +25 -0
- package/src/form/renameArrayMembers.ts +25 -0
- package/src/hooks/useAssetMeta.ts +166 -0
- package/src/hooks/useAssets.ts +23 -0
- package/src/hooks/useComponentMeta.ts +159 -0
- package/src/hooks/useComponentNames.ts +39 -0
- package/src/index.ts +56 -1
- package/src/lib/assets.ts +161 -0
- package/src/lib/componentMeta.ts +70 -0
- package/src/schema/assetMeta.ts +65 -0
- package/src/schema/boardLayout.ts +5 -1
- package/src/schema/componentMeta.ts +54 -0
- package/src/tools/assets/AssetCard.tsx +86 -0
- package/src/tools/assets/AssetDetail.tsx +150 -0
- package/src/tools/assets/AssetTable.tsx +122 -0
- package/src/tools/assets/AssetsTool.tsx +212 -0
- package/src/tools/assets/AssetsToolbar.tsx +98 -0
- package/src/tools/assets/FolderSidebar.tsx +177 -0
- package/src/tools/components/BlockCard.tsx +20 -12
- package/src/tools/components/ComponentEditDialog.tsx +83 -0
- package/src/tools/components/ComponentsTool.tsx +190 -84
- package/src/version.ts +1 -1
- package/dist/finalUrl-C1kzYMzQ.js.map +0 -1
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import {useState} from 'react'
|
|
2
|
+
import {Box, Button, Dialog, Flex, Label, Select, Stack, Text, TextInput} from '@sanity/ui'
|
|
3
|
+
import {blockName, humanizeBlockName} from '../../lib/blocks'
|
|
4
|
+
import type {BlockTypeInfo} from '../../lib/schemaTypes'
|
|
5
|
+
import type {ComponentGroup} from '../../lib/componentMeta'
|
|
6
|
+
import {MONO} from '../../ui/tokens'
|
|
7
|
+
|
|
8
|
+
export interface ComponentEditDialogProps {
|
|
9
|
+
block: BlockTypeInfo
|
|
10
|
+
namespace: string
|
|
11
|
+
currentName: string
|
|
12
|
+
currentGroup: string | null
|
|
13
|
+
groups: ComponentGroup[]
|
|
14
|
+
onSave: (name: string | null, group: string | null) => void
|
|
15
|
+
onClose: () => void
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/** Renommer un composant (nom marketing) et le ranger dans un groupe. */
|
|
19
|
+
export function ComponentEditDialog(props: ComponentEditDialogProps) {
|
|
20
|
+
const {block, namespace, currentName, currentGroup, groups, onSave, onClose} = props
|
|
21
|
+
const [name, setName] = useState(currentName)
|
|
22
|
+
const [group, setGroup] = useState(currentGroup ?? '')
|
|
23
|
+
|
|
24
|
+
const save = () => {
|
|
25
|
+
onSave(name.trim() || null, group || null)
|
|
26
|
+
onClose()
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
return (
|
|
30
|
+
<Dialog
|
|
31
|
+
id="component-edit"
|
|
32
|
+
header="Renommer / ranger le composant"
|
|
33
|
+
onClose={onClose}
|
|
34
|
+
width={0}
|
|
35
|
+
footer={
|
|
36
|
+
<Flex justify="flex-end" gap={2} padding={2}>
|
|
37
|
+
<Button text="Annuler" mode="bleed" onClick={onClose} />
|
|
38
|
+
<Button text="Enregistrer" tone="primary" onClick={save} />
|
|
39
|
+
</Flex>
|
|
40
|
+
}
|
|
41
|
+
>
|
|
42
|
+
<Box padding={4}>
|
|
43
|
+
<Stack gap={4}>
|
|
44
|
+
<Text size={0} muted style={MONO}>
|
|
45
|
+
{blockName(block.name, namespace)}
|
|
46
|
+
</Text>
|
|
47
|
+
|
|
48
|
+
<Stack gap={2}>
|
|
49
|
+
<Label size={0} muted>
|
|
50
|
+
Nom affiché
|
|
51
|
+
</Label>
|
|
52
|
+
<TextInput
|
|
53
|
+
value={name}
|
|
54
|
+
autoFocus
|
|
55
|
+
placeholder={humanizeBlockName(block.name, namespace)}
|
|
56
|
+
onChange={(event) => setName(event.currentTarget.value)}
|
|
57
|
+
onKeyDown={(event) => {
|
|
58
|
+
if (event.key === 'Enter') save()
|
|
59
|
+
}}
|
|
60
|
+
/>
|
|
61
|
+
<Text size={0} muted>
|
|
62
|
+
Ce nom remplace le titre partout (onglet, board, menu d'insertion). Vide = titre d'origine.
|
|
63
|
+
</Text>
|
|
64
|
+
</Stack>
|
|
65
|
+
|
|
66
|
+
<Stack gap={2}>
|
|
67
|
+
<Label size={0} muted>
|
|
68
|
+
Groupe
|
|
69
|
+
</Label>
|
|
70
|
+
<Select value={group} onChange={(event) => setGroup(event.currentTarget.value)}>
|
|
71
|
+
<option value="">Non groupé</option>
|
|
72
|
+
{groups.map((g) => (
|
|
73
|
+
<option key={g.id} value={g.id}>
|
|
74
|
+
{g.name}
|
|
75
|
+
</option>
|
|
76
|
+
))}
|
|
77
|
+
</Select>
|
|
78
|
+
</Stack>
|
|
79
|
+
</Stack>
|
|
80
|
+
</Box>
|
|
81
|
+
</Dialog>
|
|
82
|
+
)
|
|
83
|
+
}
|
|
@@ -1,16 +1,23 @@
|
|
|
1
1
|
import {useMemo, useState} from 'react'
|
|
2
|
-
import {Box, Button, Card, Flex, Grid, Spinner, Stack, Text} from '@sanity/ui'
|
|
2
|
+
import {Box, Button, Card, Dialog, Flex, Grid, Spinner, Stack, Text, TextInput} from '@sanity/ui'
|
|
3
|
+
import {EditIcon} from '@sanity/icons/Edit'
|
|
4
|
+
import {TrashIcon} from '@sanity/icons/Trash'
|
|
3
5
|
import {useKitConfig} from '../../context/KitContext'
|
|
4
6
|
import {useOccurrences, OCCURRENCE_SCAN_LIMIT} from '../../hooks/useOccurrences'
|
|
5
7
|
import {fillTemplate} from '../../lib/blocks'
|
|
8
|
+
import {groupComponents, withCustomNames, type ComponentGroup} from '../../lib/componentMeta'
|
|
6
9
|
import {useOpenComponent} from '../../hooks/useOpenComponent'
|
|
10
|
+
import {ComponentMetaProvider, useComponentMeta} from '../../context/ComponentMetaContext'
|
|
7
11
|
import {QueryError} from '../../ui/QueryError'
|
|
8
12
|
import {BlockCard} from './BlockCard'
|
|
13
|
+
import {ComponentEditDialog} from './ComponentEditDialog'
|
|
9
14
|
import {SectionsMap} from './map/SectionsMap'
|
|
15
|
+
import type {BlockOccurrence} from '../../lib/occurrences'
|
|
16
|
+
import type {BlockTypeInfo} from '../../lib/schemaTypes'
|
|
10
17
|
|
|
11
18
|
type View = 'grid' | 'map'
|
|
12
|
-
|
|
13
19
|
type Order = 'type' | 'schema' | 'usage' | 'unused'
|
|
20
|
+
type Row = {occurrence: BlockOccurrence; block: BlockTypeInfo}
|
|
14
21
|
|
|
15
22
|
const ORDERS: {value: Order; label: string}[] = [
|
|
16
23
|
{value: 'type', label: 'By type'},
|
|
@@ -19,39 +26,60 @@ const ORDERS: {value: Order; label: string}[] = [
|
|
|
19
26
|
{value: 'schema', label: 'Schema order'},
|
|
20
27
|
]
|
|
21
28
|
|
|
29
|
+
/** Outil Composants, sous son provider d'organisation (groupes + noms). */
|
|
22
30
|
export function ComponentsTool() {
|
|
31
|
+
return (
|
|
32
|
+
<ComponentMetaProvider>
|
|
33
|
+
<ComponentsToolInner />
|
|
34
|
+
</ComponentMetaProvider>
|
|
35
|
+
)
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function ComponentsToolInner() {
|
|
23
39
|
const config = useKitConfig()
|
|
24
|
-
const
|
|
25
|
-
|
|
40
|
+
const meta = useComponentMeta()
|
|
41
|
+
const {blockTypes, occurrences, pagesById, truncated, scanned, loading, error, refresh} = useOccurrences()
|
|
26
42
|
const [order, setOrder] = useState<Order>('type')
|
|
27
43
|
const [view, setView] = useState<View>('grid')
|
|
44
|
+
const [grouped, setGrouped] = useState(false)
|
|
45
|
+
const [editing, setEditing] = useState<string | null>(null)
|
|
46
|
+
const [groupDialog, setGroupDialog] = useState<{mode: 'create' | 'rename'; id?: string; name: string} | null>(null)
|
|
47
|
+
const [deletingGroup, setDeletingGroup] = useState<ComponentGroup | null>(null)
|
|
28
48
|
|
|
29
49
|
const preview = config.componentPreview
|
|
30
50
|
const canPreview = preview.provider === 'designSystemPage' && Boolean(config.previewUrl)
|
|
31
51
|
const openComponent = useOpenComponent()
|
|
32
52
|
|
|
33
|
-
|
|
34
|
-
|
|
53
|
+
// Noms marketing appliqués au titre ; le type (block.name) reste la clé technique.
|
|
54
|
+
const named = useMemo(() => withCustomNames(blockTypes, meta.names), [blockTypes, meta.names])
|
|
55
|
+
|
|
56
|
+
const cards = useMemo<Row[]>(() => {
|
|
57
|
+
const byName = new Map(named.map((b) => [b.name, b]))
|
|
35
58
|
const rows = occurrences
|
|
36
59
|
.map((occurrence) => ({occurrence, block: byName.get(occurrence.type)}))
|
|
37
|
-
.filter((row): row is
|
|
38
|
-
Boolean(row.block),
|
|
39
|
-
)
|
|
40
|
-
|
|
60
|
+
.filter((row): row is Row => Boolean(row.block))
|
|
41
61
|
if (order === 'schema') return rows
|
|
42
|
-
if (order === 'type') {
|
|
43
|
-
|
|
44
|
-
}
|
|
45
|
-
if (order === 'unused') {
|
|
46
|
-
return [...rows].sort((a, b) => a.occurrence.count - b.occurrence.count)
|
|
47
|
-
}
|
|
62
|
+
if (order === 'type') return [...rows].sort((a, b) => a.block.title.localeCompare(b.block.title, 'fr', {sensitivity: 'base'}))
|
|
63
|
+
if (order === 'unused') return [...rows].sort((a, b) => a.occurrence.count - b.occurrence.count)
|
|
48
64
|
return [...rows].sort((a, b) => b.occurrence.count - a.occurrence.count)
|
|
49
|
-
}, [occurrences,
|
|
65
|
+
}, [occurrences, named, order])
|
|
50
66
|
|
|
51
67
|
const unusedCount = occurrences.filter((o) => o.count === 0).length
|
|
68
|
+
const editingBlock = editing ? named.find((b) => b.name === editing) : undefined
|
|
52
69
|
|
|
53
|
-
|
|
70
|
+
const renderCard = (card: Row) => (
|
|
71
|
+
<BlockCard
|
|
72
|
+
key={card.block.name}
|
|
73
|
+
block={card.block}
|
|
74
|
+
occurrence={card.occurrence}
|
|
75
|
+
namespace={config.blockNamespace}
|
|
76
|
+
thumbnailUrl={canPreview ? `${config.previewUrl}${fillTemplate(preview.thumbnail, card.block.name, config.blockNamespace)}` : null}
|
|
77
|
+
onOpen={openComponent ? () => openComponent(card.block.name) : undefined}
|
|
78
|
+
onEdit={() => setEditing(card.block.name)}
|
|
79
|
+
/>
|
|
80
|
+
)
|
|
54
81
|
|
|
82
|
+
if (error) return <QueryError error={error} onRetry={refresh} />
|
|
55
83
|
if (loading && blockTypes.length === 0) {
|
|
56
84
|
return (
|
|
57
85
|
<Flex align="center" justify="center" padding={5} gap={3}>
|
|
@@ -62,39 +90,40 @@ export function ComponentsTool() {
|
|
|
62
90
|
</Flex>
|
|
63
91
|
)
|
|
64
92
|
}
|
|
65
|
-
|
|
66
93
|
if (blockTypes.length === 0) {
|
|
67
94
|
return (
|
|
68
95
|
<Card padding={4} radius={3} shadow={1} tone="caution">
|
|
69
96
|
<Stack gap={3}>
|
|
70
97
|
<Text weight="semibold">No blocks found.</Text>
|
|
71
98
|
<Text size={1}>
|
|
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.
|
|
99
|
+
The field "{config.pageBuilderField}" does not exist on any of the types {config.pageTypeNames.join(', ')}, or it is not an array.
|
|
75
100
|
</Text>
|
|
76
101
|
</Stack>
|
|
77
102
|
</Card>
|
|
78
103
|
)
|
|
79
104
|
}
|
|
80
105
|
|
|
106
|
+
const grouping = grouped ? groupComponents(cards.map((c) => c.block), meta.groupOf, meta.groups) : null
|
|
107
|
+
const cardByName = new Map(cards.map((c) => [c.block.name, c]))
|
|
108
|
+
|
|
81
109
|
return (
|
|
82
110
|
<Stack gap={4}>
|
|
83
|
-
<Flex gap={2}>
|
|
84
|
-
<Button
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
111
|
+
<Flex gap={2} align="center" wrap="wrap">
|
|
112
|
+
<Button text="Grid" mode={view === 'grid' ? 'default' : 'ghost'} fontSize={1} padding={2} onClick={() => setView('grid')} />
|
|
113
|
+
<Button text="Map" mode={view === 'map' ? 'default' : 'ghost'} fontSize={1} padding={2} onClick={() => setView('map')} />
|
|
114
|
+
{view === 'grid' ? (
|
|
115
|
+
<Button
|
|
116
|
+
text="By group"
|
|
117
|
+
mode={grouped ? 'default' : 'ghost'}
|
|
118
|
+
tone={grouped ? 'primary' : 'default'}
|
|
119
|
+
fontSize={1}
|
|
120
|
+
padding={2}
|
|
121
|
+
onClick={() => setGrouped((value) => !value)}
|
|
122
|
+
/>
|
|
123
|
+
) : null}
|
|
124
|
+
{grouped && view === 'grid' ? (
|
|
125
|
+
<Button text="New group" mode="ghost" fontSize={1} padding={2} onClick={() => setGroupDialog({mode: 'create', name: ''})} />
|
|
126
|
+
) : null}
|
|
98
127
|
</Flex>
|
|
99
128
|
|
|
100
129
|
<Flex align="center" justify="space-between" gap={3} wrap="wrap">
|
|
@@ -102,73 +131,150 @@ export function ComponentsTool() {
|
|
|
102
131
|
{blockTypes.length} blocks · {scanned} pages analyzed
|
|
103
132
|
{unusedCount > 0 ? ` · ${unusedCount} never used` : ''}
|
|
104
133
|
</Text>
|
|
105
|
-
|
|
106
134
|
<Flex gap={2} wrap="wrap">
|
|
107
135
|
{ORDERS.filter((option) => view === 'grid' || option.value !== 'schema').map((option) => (
|
|
108
|
-
<Button
|
|
109
|
-
key={option.value}
|
|
110
|
-
mode={order === option.value ? 'default' : 'ghost'}
|
|
111
|
-
fontSize={1}
|
|
112
|
-
padding={2}
|
|
113
|
-
text={option.label}
|
|
114
|
-
onClick={() => setOrder(option.value)}
|
|
115
|
-
/>
|
|
136
|
+
<Button key={option.value} mode={order === option.value ? 'default' : 'ghost'} fontSize={1} padding={2} text={option.label} onClick={() => setOrder(option.value)} />
|
|
116
137
|
))}
|
|
117
|
-
<Button
|
|
118
|
-
text="Refresh"
|
|
119
|
-
mode="ghost"
|
|
120
|
-
fontSize={1}
|
|
121
|
-
padding={2}
|
|
122
|
-
onClick={refresh}
|
|
123
|
-
disabled={loading}
|
|
124
|
-
/>
|
|
138
|
+
<Button text="Refresh" mode="ghost" fontSize={1} padding={2} onClick={refresh} disabled={loading} />
|
|
125
139
|
</Flex>
|
|
126
140
|
</Flex>
|
|
127
141
|
|
|
128
|
-
{/* Un comptage tronqué est un chiffre faux : il faut le dire. */}
|
|
129
142
|
{truncated && (
|
|
130
143
|
<Card padding={3} radius={2} tone="caution">
|
|
131
|
-
<Text size={1}>
|
|
132
|
-
Analysis limited to the first {OCCURRENCE_SCAN_LIMIT} pages: the numbers
|
|
133
|
-
below are a minimum, not a total.
|
|
134
|
-
</Text>
|
|
144
|
+
<Text size={1}>Analysis limited to the first {OCCURRENCE_SCAN_LIMIT} pages: the numbers below are a minimum, not a total.</Text>
|
|
135
145
|
</Card>
|
|
136
146
|
)}
|
|
137
|
-
|
|
138
147
|
{!canPreview && (
|
|
139
148
|
<Card padding={3} radius={2} tone="transparent" border>
|
|
140
149
|
<Text size={1} muted>
|
|
141
|
-
Thumbnails disabled: set `previewUrl` in ncfKit() to show the design system
|
|
142
|
-
screenshots.
|
|
150
|
+
Thumbnails disabled: set `previewUrl` in ncfKit() to show the design system screenshots.
|
|
143
151
|
</Text>
|
|
144
152
|
</Card>
|
|
145
153
|
)}
|
|
146
154
|
|
|
147
155
|
{view === 'map' ? (
|
|
148
|
-
<SectionsMap
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
156
|
+
<SectionsMap blockTypes={named} occurrences={occurrences} pagesById={pagesById} order={order === 'schema' ? 'type' : order} />
|
|
157
|
+
) : grouping ? (
|
|
158
|
+
<Stack gap={5}>
|
|
159
|
+
{grouping.grouped.map(({group, blocks}) => (
|
|
160
|
+
<Stack key={group.id} gap={3}>
|
|
161
|
+
<Flex align="center" gap={2}>
|
|
162
|
+
<Text size={2} weight="semibold">
|
|
163
|
+
{group.name}
|
|
164
|
+
</Text>
|
|
165
|
+
<Text size={1} muted>
|
|
166
|
+
{blocks.length}
|
|
167
|
+
</Text>
|
|
168
|
+
<Box flex={1} />
|
|
169
|
+
<Button icon={EditIcon} mode="bleed" fontSize={1} padding={2} title="Renommer le groupe" aria-label="Renommer le groupe" onClick={() => setGroupDialog({mode: 'rename', id: group.id, name: group.name})} />
|
|
170
|
+
<Button icon={TrashIcon} mode="bleed" tone="critical" fontSize={1} padding={2} title="Supprimer le groupe" aria-label="Supprimer le groupe" onClick={() => setDeletingGroup(group)} />
|
|
171
|
+
</Flex>
|
|
172
|
+
{blocks.length ? (
|
|
173
|
+
<Grid gridTemplateColumns={[1, 2, 3, 4]} gap={3}>
|
|
174
|
+
{blocks.map((block) => cardByName.get(block.name)).filter((c): c is Row => Boolean(c)).map(renderCard)}
|
|
175
|
+
</Grid>
|
|
176
|
+
) : (
|
|
177
|
+
<Text size={1} muted>
|
|
178
|
+
Aucun composant dans ce groupe.
|
|
179
|
+
</Text>
|
|
180
|
+
)}
|
|
181
|
+
</Stack>
|
|
182
|
+
))}
|
|
183
|
+
<Stack gap={3}>
|
|
184
|
+
<Text size={2} weight="semibold" muted>
|
|
185
|
+
Sans groupe
|
|
186
|
+
</Text>
|
|
187
|
+
<Grid gridTemplateColumns={[1, 2, 3, 4]} gap={3}>
|
|
188
|
+
{grouping.ungrouped.map((block) => cardByName.get(block.name)).filter((c): c is Row => Boolean(c)).map(renderCard)}
|
|
189
|
+
</Grid>
|
|
190
|
+
</Stack>
|
|
191
|
+
</Stack>
|
|
154
192
|
) : (
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
key={block.name}
|
|
159
|
-
block={block}
|
|
160
|
-
occurrence={occurrence}
|
|
161
|
-
namespace={config.blockNamespace}
|
|
162
|
-
thumbnailUrl={
|
|
163
|
-
canPreview
|
|
164
|
-
? `${config.previewUrl}${fillTemplate(preview.thumbnail, block.name, config.blockNamespace)}`
|
|
165
|
-
: null
|
|
166
|
-
}
|
|
167
|
-
onOpen={openComponent ? () => openComponent(block.name) : undefined}
|
|
168
|
-
/>
|
|
169
|
-
))}
|
|
170
|
-
</Grid>
|
|
193
|
+
<Grid gridTemplateColumns={[1, 2, 3, 4]} gap={3}>
|
|
194
|
+
{cards.map(renderCard)}
|
|
195
|
+
</Grid>
|
|
171
196
|
)}
|
|
197
|
+
|
|
198
|
+
{editingBlock ? (
|
|
199
|
+
<ComponentEditDialog
|
|
200
|
+
block={editingBlock}
|
|
201
|
+
namespace={config.blockNamespace}
|
|
202
|
+
currentName={meta.names.get(editingBlock.name) ?? ''}
|
|
203
|
+
currentGroup={meta.groupOf.get(editingBlock.name) ?? null}
|
|
204
|
+
groups={meta.groups}
|
|
205
|
+
onSave={(name, group) => {
|
|
206
|
+
meta.renameComponent(editingBlock.name, name)
|
|
207
|
+
meta.setGroup(editingBlock.name, group)
|
|
208
|
+
}}
|
|
209
|
+
onClose={() => setEditing(null)}
|
|
210
|
+
/>
|
|
211
|
+
) : null}
|
|
212
|
+
|
|
213
|
+
{groupDialog ? (
|
|
214
|
+
<Dialog
|
|
215
|
+
id="component-group-dialog"
|
|
216
|
+
header={groupDialog.mode === 'rename' ? 'Renommer le groupe' : 'Nouveau groupe'}
|
|
217
|
+
onClose={() => setGroupDialog(null)}
|
|
218
|
+
width={0}
|
|
219
|
+
footer={
|
|
220
|
+
<Flex justify="flex-end" gap={2} padding={2}>
|
|
221
|
+
<Button text="Annuler" mode="bleed" onClick={() => setGroupDialog(null)} />
|
|
222
|
+
<Button
|
|
223
|
+
text={groupDialog.mode === 'rename' ? 'Renommer' : 'Créer'}
|
|
224
|
+
tone="primary"
|
|
225
|
+
disabled={!groupDialog.name.trim()}
|
|
226
|
+
onClick={() => {
|
|
227
|
+
if (groupDialog.mode === 'rename' && groupDialog.id) meta.renameGroup(groupDialog.id, groupDialog.name)
|
|
228
|
+
else meta.createGroup(groupDialog.name)
|
|
229
|
+
setGroupDialog(null)
|
|
230
|
+
}}
|
|
231
|
+
/>
|
|
232
|
+
</Flex>
|
|
233
|
+
}
|
|
234
|
+
>
|
|
235
|
+
<Box padding={4}>
|
|
236
|
+
<TextInput
|
|
237
|
+
value={groupDialog.name}
|
|
238
|
+
autoFocus
|
|
239
|
+
placeholder="Nom du groupe"
|
|
240
|
+
onChange={(event) => setGroupDialog((d) => (d ? {...d, name: event.currentTarget.value} : d))}
|
|
241
|
+
onKeyDown={(event) => {
|
|
242
|
+
if (event.key === 'Enter' && groupDialog.name.trim()) {
|
|
243
|
+
if (groupDialog.mode === 'rename' && groupDialog.id) meta.renameGroup(groupDialog.id, groupDialog.name)
|
|
244
|
+
else meta.createGroup(groupDialog.name)
|
|
245
|
+
setGroupDialog(null)
|
|
246
|
+
}
|
|
247
|
+
}}
|
|
248
|
+
/>
|
|
249
|
+
</Box>
|
|
250
|
+
</Dialog>
|
|
251
|
+
) : null}
|
|
252
|
+
|
|
253
|
+
{deletingGroup ? (
|
|
254
|
+
<Dialog
|
|
255
|
+
id="component-group-delete"
|
|
256
|
+
header="Supprimer le groupe"
|
|
257
|
+
onClose={() => setDeletingGroup(null)}
|
|
258
|
+
width={0}
|
|
259
|
+
footer={
|
|
260
|
+
<Flex justify="flex-end" gap={2} padding={2}>
|
|
261
|
+
<Button text="Annuler" mode="bleed" onClick={() => setDeletingGroup(null)} />
|
|
262
|
+
<Button
|
|
263
|
+
text="Supprimer"
|
|
264
|
+
tone="critical"
|
|
265
|
+
onClick={() => {
|
|
266
|
+
meta.deleteGroup(deletingGroup.id)
|
|
267
|
+
setDeletingGroup(null)
|
|
268
|
+
}}
|
|
269
|
+
/>
|
|
270
|
+
</Flex>
|
|
271
|
+
}
|
|
272
|
+
>
|
|
273
|
+
<Box padding={4}>
|
|
274
|
+
<Text size={1}>Supprimer « {deletingGroup.name} » ? Les composants ne sont pas supprimés : ils repassent « Sans groupe ».</Text>
|
|
275
|
+
</Box>
|
|
276
|
+
</Dialog>
|
|
277
|
+
) : null}
|
|
172
278
|
</Stack>
|
|
173
279
|
)
|
|
174
280
|
}
|
package/src/version.ts
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"finalUrl-C1kzYMzQ.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}\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 }\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;AAChB,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;E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