every-json 1.0.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/PROMPT.MD +1020 -0
- package/README.md +93 -0
- package/dist/every-json.css +1 -0
- package/dist/every-json.es.js +582 -0
- package/dist/every-json.umd.js +11 -0
- package/package.json +32 -0
package/PROMPT.MD
ADDED
|
@@ -0,0 +1,1020 @@
|
|
|
1
|
+
# 🌳 TreeJSON - Bibliothèque de Visualisation JSON
|
|
2
|
+
|
|
3
|
+
## 📦 Vision du Projet
|
|
4
|
+
|
|
5
|
+
**TreeJSON** est une bibliothèque JavaScript moderne qui transforme des données JSON brutes en **expériences visuelles immersives et interactives**. Pensez à Chart.js pour les graphiques, TreeJSON est pour les données structurées.
|
|
6
|
+
|
|
7
|
+
L'objectif n'est pas simplement d'afficher du JSON, mais de créer une **interface utilisateur premium** qui rend la navigation dans les données intuitive, agréable et productive.
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## 🎯 Objectifs Principaux
|
|
12
|
+
|
|
13
|
+
1. **Visualisation Multi-Mode** : Tree, Table, Cards, Timeline, Graph
|
|
14
|
+
2. **Design Exceptionnel** : Interface moderne digne des meilleurs outils dev
|
|
15
|
+
3. **Interactions Fluides** : Animations naturelles, transitions douces
|
|
16
|
+
4. **Performance** : Gestion de JSON volumineux (10k+ nœuds)
|
|
17
|
+
5. **Accessibilité** : Navigation clavier, screen readers, ARIA
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## 🎨 Philosophie UI/UX
|
|
22
|
+
|
|
23
|
+
### Principes de Design
|
|
24
|
+
|
|
25
|
+
**1. Visual Hierarchy (Hiérarchie Visuelle)**
|
|
26
|
+
|
|
27
|
+
- Utiliser la taille, la couleur et l'espacement pour guider l'œil
|
|
28
|
+
- Les nœuds parents doivent être visuellement dominants
|
|
29
|
+
- La profondeur doit être perceptible instantanément
|
|
30
|
+
|
|
31
|
+
**2. Progressive Disclosure**
|
|
32
|
+
|
|
33
|
+
- Masquer la complexité par défaut
|
|
34
|
+
- Révéler les détails au survol/clic
|
|
35
|
+
- Préserver le contexte lors de l'exploration
|
|
36
|
+
|
|
37
|
+
**3. Feedback Immédiat**
|
|
38
|
+
|
|
39
|
+
- Chaque interaction doit avoir une réponse visuelle
|
|
40
|
+
- Micro-animations (150-300ms) pour les transitions
|
|
41
|
+
- États hover/active/focus clairement différenciés
|
|
42
|
+
|
|
43
|
+
**4. Data Storytelling**
|
|
44
|
+
|
|
45
|
+
- Le JSON raconte une histoire : aidez l'utilisateur à la comprendre
|
|
46
|
+
- Mise en évidence des patterns et anomalies
|
|
47
|
+
- Chemins de navigation suggérés
|
|
48
|
+
|
|
49
|
+
### Références Design
|
|
50
|
+
|
|
51
|
+
- **VS Code** : palette de couleurs, syntax highlighting
|
|
52
|
+
- **GitHub** : interfaces claires, hiérarchie de l'information
|
|
53
|
+
- **Notion** : fluidité des interactions, design épuré
|
|
54
|
+
- **Linear** : animations subtiles, attention aux détails
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
## 🧩 Cas d'Usage
|
|
59
|
+
|
|
60
|
+
- 🔍 **Debug & Inspection** : Visualiser les réponses d'API en développement
|
|
61
|
+
- 📊 **Dashboards Admin** : Afficher configurations et états système
|
|
62
|
+
- 📚 **Documentation** : Illustrer structures de données dans la doc technique
|
|
63
|
+
- 🎓 **Éducation** : Enseigner les structures de données JSON
|
|
64
|
+
- 🧪 **Testing** : Comparer snapshots et valider responses
|
|
65
|
+
- 🔧 **Outils Internes** : Explorateurs de logs, configs, metadata
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
## ⚙️ API Publique
|
|
70
|
+
|
|
71
|
+
### Utilisation Simple
|
|
72
|
+
|
|
73
|
+
```javascript
|
|
74
|
+
TreeJSON.render("#container", data);
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### Configuration Avancée
|
|
78
|
+
|
|
79
|
+
```javascript
|
|
80
|
+
TreeJSON.render("#container", data, {
|
|
81
|
+
// MODE D'AFFICHAGE
|
|
82
|
+
mode: "tree", // "tree" | "table" | "cards" | "timeline" | "graph"
|
|
83
|
+
|
|
84
|
+
// APPARENCE
|
|
85
|
+
theme: "auto", // "light" | "dark" | "auto" | custom object
|
|
86
|
+
colorScheme: "default", // "default" | "github" | "dracula" | "nord"
|
|
87
|
+
font: "system", // "system" | "mono" | custom font-family
|
|
88
|
+
density: "comfortable", // "compact" | "comfortable" | "spacious"
|
|
89
|
+
|
|
90
|
+
// INTERACTIVITÉ
|
|
91
|
+
collapsible: true, // Plier/déplier les nœuds
|
|
92
|
+
autoCollapse: 3, // Auto-replier après N niveaux
|
|
93
|
+
searchable: true, // Barre de recherche intégrée
|
|
94
|
+
copyable: true, // Boutons "copier" sur les valeurs
|
|
95
|
+
expandOnHover: false, // Preview au survol
|
|
96
|
+
|
|
97
|
+
// AFFICHAGE DES DONNÉES
|
|
98
|
+
showTypes: true, // Afficher (string), (number)...
|
|
99
|
+
showSizes: true, // Montrer tailles arrays/objects
|
|
100
|
+
showIndexes: true, // [0], [1] pour les tableaux
|
|
101
|
+
showPath: true, // Chemin JSON au survol
|
|
102
|
+
maxDepth: null, // Limiter la profondeur visible
|
|
103
|
+
|
|
104
|
+
// FILTRES & RECHERCHE
|
|
105
|
+
highlight: ["error", "warning"], // Mots-clés à mettre en évidence
|
|
106
|
+
filter: (key, value) => true, // Fonction de filtrage custom
|
|
107
|
+
sort: "none", // "none" | "asc" | "desc" | "type"
|
|
108
|
+
|
|
109
|
+
// PERFORMANCE
|
|
110
|
+
virtualize: true, // Virtual scrolling pour gros JSON
|
|
111
|
+
lazyLoad: true, // Charger nœuds à la demande
|
|
112
|
+
maxNodes: 10000, // Limite de sécurité
|
|
113
|
+
|
|
114
|
+
// EXPORTS & OUTILS
|
|
115
|
+
downloadable: true, // Bouton download JSON
|
|
116
|
+
shareable: true, // Générer lien partageable (état UI)
|
|
117
|
+
diffMode: false, // Comparer avec autre JSON
|
|
118
|
+
|
|
119
|
+
// CALLBACKS
|
|
120
|
+
onNodeClick: (node) => {},
|
|
121
|
+
onNodeExpand: (node) => {},
|
|
122
|
+
onSearch: (results) => {},
|
|
123
|
+
onError: (error) => {}
|
|
124
|
+
});
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
---
|
|
128
|
+
|
|
129
|
+
## 🗂️ Architecture Technique
|
|
130
|
+
|
|
131
|
+
### Stack
|
|
132
|
+
|
|
133
|
+
- **TypeScript** : Typage fort, maintenabilité
|
|
134
|
+
- **Vanilla JS** : Zero dependency, performance native
|
|
135
|
+
- **CSS Custom Properties** : Thèmes dynamiques
|
|
136
|
+
- **Web Components** : Encapsulation (optionnel)
|
|
137
|
+
|
|
138
|
+
### Contraintes Techniques
|
|
139
|
+
|
|
140
|
+
- ✅ **Zero dependencies** : aucune lib externe requise
|
|
141
|
+
- ✅ **Framework agnostic** : fonctionne partout
|
|
142
|
+
- ✅ **Tree-shakeable** : import seulement ce dont vous avez besoin
|
|
143
|
+
- ✅ **SSR compatible** : génération côté serveur possible
|
|
144
|
+
- ✅ **A11y first** : accessible par défaut
|
|
145
|
+
- ✅ **< 50kb gzipped** : léger et rapide
|
|
146
|
+
|
|
147
|
+
### Structure du Projet
|
|
148
|
+
|
|
149
|
+
```bash
|
|
150
|
+
treejson/
|
|
151
|
+
├─ src/
|
|
152
|
+
│ ├─ core/
|
|
153
|
+
│ │ ├─ parser.ts # Analyse et normalisation JSON
|
|
154
|
+
│ │ ├─ renderer.ts # Moteur de rendu principal
|
|
155
|
+
│ │ ├─ node.ts # Abstraction d'un nœud
|
|
156
|
+
│ │ ├─ state.ts # Gestion de l'état UI
|
|
157
|
+
│ │ └─ events.ts # Système d'événements
|
|
158
|
+
│ │
|
|
159
|
+
│ ├─ modes/
|
|
160
|
+
│ │ ├─ tree.ts # Vue arborescente
|
|
161
|
+
│ │ ├─ table.ts # Vue tabulaire
|
|
162
|
+
│ │ ├─ cards.ts # Vue en cartes
|
|
163
|
+
│ │ ├─ timeline.ts # Vue chronologique (dates)
|
|
164
|
+
│ │ └─ graph.ts # Vue graphe relationnel
|
|
165
|
+
│ │
|
|
166
|
+
│ ├─ components/
|
|
167
|
+
│ │ ├─ search-bar.ts # Barre de recherche
|
|
168
|
+
│ │ ├─ toolbar.ts # Barre d'outils
|
|
169
|
+
│ │ ├─ breadcrumb.ts # Fil d'Ariane
|
|
170
|
+
│ │ ├─ minimap.ts # Mini-carte de navigation
|
|
171
|
+
│ │ └─ context-menu.ts # Menu contextuel
|
|
172
|
+
│ │
|
|
173
|
+
│ ├─ features/
|
|
174
|
+
│ │ ├─ search.ts # Recherche avancée
|
|
175
|
+
│ │ ├─ filter.ts # Filtrage
|
|
176
|
+
│ │ ├─ diff.ts # Comparaison de JSON
|
|
177
|
+
│ │ ├─ export.ts # Export (PNG, PDF, MD)
|
|
178
|
+
│ │ ├─ copy.ts # Copier valeurs/chemins
|
|
179
|
+
│ │ └─ virtualization.ts # Virtual scrolling
|
|
180
|
+
│ │
|
|
181
|
+
│ ├─ themes/
|
|
182
|
+
│ │ ├─ base.css # Styles de base
|
|
183
|
+
│ │ ├─ light.css # Thème clair
|
|
184
|
+
│ │ ├─ dark.css # Thème sombre
|
|
185
|
+
│ │ ├─ github.css # Style GitHub
|
|
186
|
+
│ │ ├─ dracula.css # Style Dracula
|
|
187
|
+
│ │ └─ nord.css # Style Nord
|
|
188
|
+
│ │
|
|
189
|
+
│ ├─ animations/
|
|
190
|
+
│ │ ├─ transitions.css # Transitions fluides
|
|
191
|
+
│ │ └─ keyframes.css # Animations complexes
|
|
192
|
+
│ │
|
|
193
|
+
│ ├─ utils/
|
|
194
|
+
│ │ ├─ dom.ts # Helpers DOM
|
|
195
|
+
│ │ ├─ types.ts # Définitions TypeScript
|
|
196
|
+
│ │ ├─ validators.ts # Validation données
|
|
197
|
+
│ │ ├─ formatters.ts # Formatage valeurs
|
|
198
|
+
│ │ └─ performance.ts # Optimisations
|
|
199
|
+
│ │
|
|
200
|
+
│ └─ index.ts # Point d'entrée public
|
|
201
|
+
│
|
|
202
|
+
├─ demo/
|
|
203
|
+
│ ├─ index.html # Landing page
|
|
204
|
+
│ ├─ examples/ # Exemples variés
|
|
205
|
+
│ │ ├─ api-response.html
|
|
206
|
+
│ │ ├─ config.html
|
|
207
|
+
│ │ ├─ diff.html
|
|
208
|
+
│ │ └─ large-data.html
|
|
209
|
+
│ └─ assets/
|
|
210
|
+
│
|
|
211
|
+
├─ tests/
|
|
212
|
+
│ ├─ unit/
|
|
213
|
+
│ ├─ integration/
|
|
214
|
+
│ └─ e2e/
|
|
215
|
+
│
|
|
216
|
+
├─ docs/
|
|
217
|
+
│ ├─ api.md
|
|
218
|
+
│ ├─ examples.md
|
|
219
|
+
│ ├─ theming.md
|
|
220
|
+
│ └─ performance.md
|
|
221
|
+
│
|
|
222
|
+
├─ dist/
|
|
223
|
+
├─ package.json
|
|
224
|
+
├─ tsconfig.json
|
|
225
|
+
├─ vite.config.ts
|
|
226
|
+
└─ README.md
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
---
|
|
230
|
+
|
|
231
|
+
## 🌳 Mode TREE (Priorité v1)
|
|
232
|
+
|
|
233
|
+
### Design UI/UX
|
|
234
|
+
|
|
235
|
+
**Anatomie d'un Nœud**
|
|
236
|
+
|
|
237
|
+
```bash
|
|
238
|
+
┌─────────────────────────────────────────────────────┐
|
|
239
|
+
│ [▼] user (object) {3} │
|
|
240
|
+
│ │ │
|
|
241
|
+
│ ├─ [icon] name │
|
|
242
|
+
│ │ "Bernadette" (string) │
|
|
243
|
+
│ │ │
|
|
244
|
+
│ ├─ [icon] age │
|
|
245
|
+
│ │ 16 (number) │
|
|
246
|
+
│ │ │
|
|
247
|
+
│ └─ [▼] skills (array) [2] │
|
|
248
|
+
│ ├─ [0] "JavaScript" (string) │
|
|
249
|
+
│ └─ [1] "Python" (string) │
|
|
250
|
+
└─────────────────────────────────────────────────────┘
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
**Éléments Visuels**
|
|
254
|
+
|
|
255
|
+
1. **Icônes Expand/Collapse**
|
|
256
|
+
- Triangle pointant vers le bas : ouvert
|
|
257
|
+
- Triangle pointant vers la droite : fermé
|
|
258
|
+
- Animation rotation 200ms ease-out
|
|
259
|
+
- Zone cliquable généreuse (32x32px minimum)
|
|
260
|
+
|
|
261
|
+
2. **Lignes de Connexion**
|
|
262
|
+
- Lignes verticales et horizontales subtiles
|
|
263
|
+
- Couleur : `--color-border-subtle`
|
|
264
|
+
- Dashed pour niveaux profonds (> 5)
|
|
265
|
+
|
|
266
|
+
3. **Badges de Type**
|
|
267
|
+
- Pills arrondis avec couleurs distinctes
|
|
268
|
+
- Exemples :
|
|
269
|
+
- `(string)` : blue-500
|
|
270
|
+
- `(number)` : green-500
|
|
271
|
+
- `(boolean)` : purple-500
|
|
272
|
+
- `(null)` : gray-400
|
|
273
|
+
- `(object)` : orange-500
|
|
274
|
+
- `(array)` : pink-500
|
|
275
|
+
|
|
276
|
+
4. **Compteurs**
|
|
277
|
+
- `{3}` pour objets = nombre de clés
|
|
278
|
+
- `[5]` pour arrays = nombre d'éléments
|
|
279
|
+
- Position : aligné à droite, opacité 60%
|
|
280
|
+
|
|
281
|
+
5. **Syntax Highlighting**
|
|
282
|
+
- Clés : font-weight 600, couleur distinctive
|
|
283
|
+
- Valeurs strings : entre guillemets, couleur chaude
|
|
284
|
+
- Valeurs numbers : couleur froide
|
|
285
|
+
- Valeurs boolean : couleur vive
|
|
286
|
+
- null : italic, opacité réduite
|
|
287
|
+
|
|
288
|
+
**États Interactifs**
|
|
289
|
+
|
|
290
|
+
- **Hover**
|
|
291
|
+
- Background légèrement teinté
|
|
292
|
+
- Révèle actions secondaires (copy, expand all, etc.)
|
|
293
|
+
- Smooth transition 150ms
|
|
294
|
+
|
|
295
|
+
- **Focus**
|
|
296
|
+
- Outline visible pour navigation clavier
|
|
297
|
+
- 2px solid, couleur accent
|
|
298
|
+
- Offset de 2px
|
|
299
|
+
|
|
300
|
+
- **Active/Selected**
|
|
301
|
+
- Background plus prononcé
|
|
302
|
+
- Border latéral accent (3px)
|
|
303
|
+
- Path du nœud affiché dans toolbar
|
|
304
|
+
|
|
305
|
+
- **Searched/Highlighted**
|
|
306
|
+
- Background jaune subtil
|
|
307
|
+
- Animation fade-in
|
|
308
|
+
- Scroll automatique vers résultat
|
|
309
|
+
|
|
310
|
+
**Micro-interactions**
|
|
311
|
+
|
|
312
|
+
- **Expand/Collapse**
|
|
313
|
+
- Rotation icône : 90° en 200ms
|
|
314
|
+
- Children : slide down avec opacity
|
|
315
|
+
- Easing : cubic-bezier(0.4, 0, 0.2, 1)
|
|
316
|
+
|
|
317
|
+
- **Copy Value**
|
|
318
|
+
- Bouton apparaît au hover
|
|
319
|
+
- Click → checkmark animation
|
|
320
|
+
- Toast notification : "Copied to clipboard"
|
|
321
|
+
|
|
322
|
+
- **Long Press** (mobile)
|
|
323
|
+
- Contexte menu après 500ms
|
|
324
|
+
- Haptic feedback
|
|
325
|
+
|
|
326
|
+
**Responsive**
|
|
327
|
+
|
|
328
|
+
- **Desktop (> 1024px)**
|
|
329
|
+
- Largeur maximale : 1200px
|
|
330
|
+
- Sidebar optionnelle : minimap + outline
|
|
331
|
+
- Dual-pane pour diff mode
|
|
332
|
+
|
|
333
|
+
- **Tablet (768px - 1024px)**
|
|
334
|
+
- Stack vertical
|
|
335
|
+
- Toolbar collapsible
|
|
336
|
+
- Font size légèrement réduit
|
|
337
|
+
|
|
338
|
+
- **Mobile (< 768px)**
|
|
339
|
+
- Full width
|
|
340
|
+
- Toolbar bottom sheet
|
|
341
|
+
- Swipe gestures (expand/collapse)
|
|
342
|
+
- Virtual keyboard optimizations
|
|
343
|
+
|
|
344
|
+
---
|
|
345
|
+
|
|
346
|
+
## 📊 Mode TABLE
|
|
347
|
+
|
|
348
|
+
### Design Concept
|
|
349
|
+
|
|
350
|
+
Transformation intelligente d'objets homogènes en tableau data-grid moderne.
|
|
351
|
+
|
|
352
|
+
**Features Visuelles**
|
|
353
|
+
|
|
354
|
+
- **Header Sticky**
|
|
355
|
+
- Reste visible au scroll
|
|
356
|
+
- Ombre portée au scroll
|
|
357
|
+
- Tri par colonne (asc/desc)
|
|
358
|
+
|
|
359
|
+
- **Cells**
|
|
360
|
+
- Padding généreux (12px 16px)
|
|
361
|
+
- Border subtle entre cells
|
|
362
|
+
- Truncate long text avec tooltip
|
|
363
|
+
|
|
364
|
+
- **Striped Rows**
|
|
365
|
+
- Alternance subtile de background
|
|
366
|
+
- Highlight row au hover
|
|
367
|
+
|
|
368
|
+
- **Resizable Columns**
|
|
369
|
+
- Drag handle entre headers
|
|
370
|
+
- Double-click : auto-fit content
|
|
371
|
+
- Persist dans localStorage
|
|
372
|
+
|
|
373
|
+
- **Infinite Scroll**
|
|
374
|
+
- Load more automatique
|
|
375
|
+
- Skeleton loading
|
|
376
|
+
|
|
377
|
+
**Interactions**
|
|
378
|
+
|
|
379
|
+
- Click cell → copy value
|
|
380
|
+
- Click row → expand details (drawer)
|
|
381
|
+
- Multi-select avec checkboxes
|
|
382
|
+
- Keyboard navigation (arrow keys)
|
|
383
|
+
|
|
384
|
+
---
|
|
385
|
+
|
|
386
|
+
## 🗃️ Mode CARDS
|
|
387
|
+
|
|
388
|
+
### Design Concept
|
|
389
|
+
|
|
390
|
+
Chaque entrée devient une card Material Design, idéale pour mobiles et dashboards.
|
|
391
|
+
|
|
392
|
+
**Anatomie d'une Card**
|
|
393
|
+
|
|
394
|
+
```
|
|
395
|
+
┌────────────────────────────┐
|
|
396
|
+
│ 👤 User │
|
|
397
|
+
│ │
|
|
398
|
+
│ Name: Bernadette │
|
|
399
|
+
│ Age: 16 │
|
|
400
|
+
│ Role: Developer │
|
|
401
|
+
│ │
|
|
402
|
+
│ [View Details] [Copy] │
|
|
403
|
+
└────────────────────────────┘
|
|
404
|
+
```
|
|
405
|
+
|
|
406
|
+
**Caractéristiques**
|
|
407
|
+
|
|
408
|
+
- **Layout**
|
|
409
|
+
- Grid responsive (1-2-3-4 colonnes selon viewport)
|
|
410
|
+
- Gap de 16-24px
|
|
411
|
+
- Masonry layout pour hauteurs variables
|
|
412
|
+
|
|
413
|
+
- **Style**
|
|
414
|
+
- Border radius 12px
|
|
415
|
+
- Box shadow subtile
|
|
416
|
+
- Elevation au hover
|
|
417
|
+
|
|
418
|
+
- **Content**
|
|
419
|
+
- Icon/emoji en header
|
|
420
|
+
- Key-value pairs lisibles
|
|
421
|
+
- Actions en footer
|
|
422
|
+
|
|
423
|
+
- **Animations**
|
|
424
|
+
- Stagger animation à l'apparition
|
|
425
|
+
- Scale au hover (1.02x)
|
|
426
|
+
- Smooth transitions
|
|
427
|
+
|
|
428
|
+
---
|
|
429
|
+
|
|
430
|
+
## 🕐 Mode TIMELINE
|
|
431
|
+
|
|
432
|
+
**Nouveau mode** pour données temporelles (logs, events, history).
|
|
433
|
+
|
|
434
|
+
### Features
|
|
435
|
+
|
|
436
|
+
- Axe temporel vertical ou horizontal
|
|
437
|
+
- Grouping par jour/heure
|
|
438
|
+
- Zoom in/out
|
|
439
|
+
- Filtres par date range
|
|
440
|
+
- Event markers colorés
|
|
441
|
+
- Tooltips riches au hover
|
|
442
|
+
|
|
443
|
+
### Use Cases
|
|
444
|
+
|
|
445
|
+
- Logs d'application
|
|
446
|
+
- Historique de modifications
|
|
447
|
+
- Event streams
|
|
448
|
+
- Activity feeds
|
|
449
|
+
|
|
450
|
+
---
|
|
451
|
+
|
|
452
|
+
## 🔗 Mode GRAPH
|
|
453
|
+
|
|
454
|
+
**Nouveau mode** pour données relationnelles.
|
|
455
|
+
|
|
456
|
+
### Features
|
|
457
|
+
|
|
458
|
+
- Visualisation force-directed graph
|
|
459
|
+
- Nodes = objets
|
|
460
|
+
- Edges = relations (refs, IDs)
|
|
461
|
+
- Pan & zoom
|
|
462
|
+
- Node clustering
|
|
463
|
+
- Search & highlight paths
|
|
464
|
+
|
|
465
|
+
### Use Cases
|
|
466
|
+
|
|
467
|
+
- Dépendances entre entités
|
|
468
|
+
- Structures de graphe
|
|
469
|
+
- Réseaux de relations
|
|
470
|
+
|
|
471
|
+
---
|
|
472
|
+
|
|
473
|
+
## 🎨 Système de Thèmes
|
|
474
|
+
|
|
475
|
+
### Thèmes Intégrés
|
|
476
|
+
|
|
477
|
+
1. **Light (Default)**
|
|
478
|
+
- Background : white / gray-50
|
|
479
|
+
- Text : gray-900
|
|
480
|
+
- Accent : blue-600
|
|
481
|
+
- Borders : gray-200
|
|
482
|
+
|
|
483
|
+
2. **Dark**
|
|
484
|
+
- Background : gray-900 / black
|
|
485
|
+
- Text : gray-100
|
|
486
|
+
- Accent : blue-400
|
|
487
|
+
- Borders : gray-700
|
|
488
|
+
|
|
489
|
+
3. **GitHub**
|
|
490
|
+
- Inspiration de github.com
|
|
491
|
+
- Syntax colors identiques
|
|
492
|
+
|
|
493
|
+
4. **Dracula**
|
|
494
|
+
- Purple dominant
|
|
495
|
+
- High contrast
|
|
496
|
+
|
|
497
|
+
5. **Nord**
|
|
498
|
+
- Palette nordique
|
|
499
|
+
- Tons froids
|
|
500
|
+
|
|
501
|
+
### Custom Theming
|
|
502
|
+
|
|
503
|
+
```javascript
|
|
504
|
+
TreeJSON.render("#app", data, {
|
|
505
|
+
theme: {
|
|
506
|
+
colors: {
|
|
507
|
+
background: "#ffffff",
|
|
508
|
+
text: "#000000",
|
|
509
|
+
accent: "#007bff",
|
|
510
|
+
border: "#e5e7eb",
|
|
511
|
+
string: "#22863a",
|
|
512
|
+
number: "#005cc5",
|
|
513
|
+
boolean: "#6f42c1",
|
|
514
|
+
null: "#6a737d"
|
|
515
|
+
},
|
|
516
|
+
fonts: {
|
|
517
|
+
base: "'Inter', sans-serif",
|
|
518
|
+
mono: "'Fira Code', monospace"
|
|
519
|
+
},
|
|
520
|
+
spacing: {
|
|
521
|
+
compact: 4,
|
|
522
|
+
comfortable: 8,
|
|
523
|
+
spacious: 16
|
|
524
|
+
},
|
|
525
|
+
animations: {
|
|
526
|
+
duration: 200,
|
|
527
|
+
easing: "ease-out"
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
});
|
|
531
|
+
```
|
|
532
|
+
|
|
533
|
+
---
|
|
534
|
+
|
|
535
|
+
## 🔍 Recherche Avancée
|
|
536
|
+
|
|
537
|
+
### UI Components
|
|
538
|
+
|
|
539
|
+
**Search Bar**
|
|
540
|
+
- Position : top de l'interface
|
|
541
|
+
- Icône search + clear button
|
|
542
|
+
- Placeholder contextuel
|
|
543
|
+
- Keyboard shortcut : `Cmd/Ctrl + K`
|
|
544
|
+
|
|
545
|
+
### Features
|
|
546
|
+
|
|
547
|
+
- **Fuzzy Search** : tolérance aux typos
|
|
548
|
+
- **Path Search** : `user.address.city`
|
|
549
|
+
- **Type Filters** : chercher uniquement strings/numbers
|
|
550
|
+
- **Regex Support** : pour utilisateurs avancés
|
|
551
|
+
- **Results Navigation** : Prev/Next buttons
|
|
552
|
+
- **Highlight Matches** : background jaune, scroll auto
|
|
553
|
+
|
|
554
|
+
### Result Display
|
|
555
|
+
|
|
556
|
+
```
|
|
557
|
+
┌────────────────────────────────────────┐
|
|
558
|
+
│ 🔍 Search: "email" │
|
|
559
|
+
│ ──────────────────────────────────── │
|
|
560
|
+
│ 3 results found │
|
|
561
|
+
│ │
|
|
562
|
+
│ ✓ user.email │
|
|
563
|
+
│ ✓ contacts[0].email │
|
|
564
|
+
│ ✓ settings.notificationEmail │
|
|
565
|
+
│ │
|
|
566
|
+
│ [1 / 3] [↑] [↓] [Clear] │
|
|
567
|
+
└────────────────────────────────────────┘
|
|
568
|
+
```
|
|
569
|
+
|
|
570
|
+
---
|
|
571
|
+
|
|
572
|
+
## 📋 Features Additionelles
|
|
573
|
+
|
|
574
|
+
### 1. Copy to Clipboard
|
|
575
|
+
|
|
576
|
+
**Ce qui peut être copié**
|
|
577
|
+
|
|
578
|
+
- Valeur brute
|
|
579
|
+
- Valeur formatée (JSON, CSV, etc.)
|
|
580
|
+
- Path JSON (`user.skills[1]`)
|
|
581
|
+
- Node complet (subtree)
|
|
582
|
+
- Screenshot (PNG)
|
|
583
|
+
|
|
584
|
+
**UI**
|
|
585
|
+
|
|
586
|
+
- Icon copy au hover
|
|
587
|
+
- Animation checkmark après copy
|
|
588
|
+
- Toast notification
|
|
589
|
+
|
|
590
|
+
### 2. Breadcrumb Navigation
|
|
591
|
+
|
|
592
|
+
```
|
|
593
|
+
Home > API Response > data > users > [0] > address
|
|
594
|
+
```
|
|
595
|
+
|
|
596
|
+
- Chaque segment cliquable
|
|
597
|
+
- Overflow avec ellipsis
|
|
598
|
+
- Tooltip sur hover (full path)
|
|
599
|
+
|
|
600
|
+
### 3. Minimap
|
|
601
|
+
|
|
602
|
+
- Aperçu de la structure complète
|
|
603
|
+
- Viewport indicator
|
|
604
|
+
- Click pour naviguer
|
|
605
|
+
- Collapsible sidebar
|
|
606
|
+
|
|
607
|
+
### 4. Context Menu
|
|
608
|
+
|
|
609
|
+
Right-click sur un nœud :
|
|
610
|
+
|
|
611
|
+
- Copy Value
|
|
612
|
+
- Copy Path
|
|
613
|
+
- Copy as JSON
|
|
614
|
+
- Expand All Children
|
|
615
|
+
- Collapse All Children
|
|
616
|
+
- Focus This Node
|
|
617
|
+
- Filter by Type
|
|
618
|
+
- Export Subtree
|
|
619
|
+
|
|
620
|
+
### 5. Keyboard Shortcuts
|
|
621
|
+
|
|
622
|
+
```
|
|
623
|
+
Cmd/Ctrl + K → Open search
|
|
624
|
+
Arrow Keys → Navigate nodes
|
|
625
|
+
Enter → Expand/Collapse
|
|
626
|
+
Cmd/Ctrl + C → Copy selected
|
|
627
|
+
Cmd/Ctrl + F → Find in page
|
|
628
|
+
Esc → Close panels
|
|
629
|
+
Space → Toggle node
|
|
630
|
+
```
|
|
631
|
+
|
|
632
|
+
### 6. Diff Mode
|
|
633
|
+
|
|
634
|
+
Comparer deux JSON côte à côte :
|
|
635
|
+
|
|
636
|
+
- Added : vert
|
|
637
|
+
- Removed : rouge
|
|
638
|
+
- Modified : orange
|
|
639
|
+
- Unchanged : gris
|
|
640
|
+
|
|
641
|
+
Split view ou unified view.
|
|
642
|
+
|
|
643
|
+
### 7. Export Options
|
|
644
|
+
|
|
645
|
+
- **JSON** : télécharger le JSON (formaté ou minifié)
|
|
646
|
+
- **Markdown** : conversion en doc MD
|
|
647
|
+
- **PNG** : screenshot de la vue
|
|
648
|
+
- **PDF** : export PDF de la structure
|
|
649
|
+
- **CSV** : pour mode table
|
|
650
|
+
|
|
651
|
+
### 8. Share State
|
|
652
|
+
|
|
653
|
+
Générer URL avec état UI :
|
|
654
|
+
|
|
655
|
+
- Nœuds expandés
|
|
656
|
+
- Recherche active
|
|
657
|
+
- Mode sélectionné
|
|
658
|
+
- Scroll position
|
|
659
|
+
|
|
660
|
+
Utile pour partager en équipe.
|
|
661
|
+
|
|
662
|
+
---
|
|
663
|
+
|
|
664
|
+
## 🚀 Performance
|
|
665
|
+
|
|
666
|
+
### Optimisations
|
|
667
|
+
|
|
668
|
+
1. **Virtual Scrolling**
|
|
669
|
+
- Render uniquement nœuds visibles
|
|
670
|
+
- Recyclage des éléments DOM
|
|
671
|
+
- Smooth scroll
|
|
672
|
+
|
|
673
|
+
2. **Lazy Loading**
|
|
674
|
+
- Charger nœuds à la demande
|
|
675
|
+
- Pagination pour gros arrays
|
|
676
|
+
- Progressive rendering
|
|
677
|
+
|
|
678
|
+
3. **Web Workers**
|
|
679
|
+
- Parsing JSON en background
|
|
680
|
+
- Calculs lourds off main thread
|
|
681
|
+
|
|
682
|
+
4. **Memoization**
|
|
683
|
+
- Cache des renders
|
|
684
|
+
- Avoid re-renders inutiles
|
|
685
|
+
|
|
686
|
+
5. **Request Animation Frame**
|
|
687
|
+
- Animations performantes
|
|
688
|
+
- Batch DOM updates
|
|
689
|
+
|
|
690
|
+
### Benchmarks Cibles
|
|
691
|
+
|
|
692
|
+
- **Parse** : < 100ms pour 10k nodes
|
|
693
|
+
- **First Render** : < 300ms
|
|
694
|
+
- **Interaction** : < 16ms (60fps)
|
|
695
|
+
- **Memory** : < 50MB pour 50k nodes
|
|
696
|
+
|
|
697
|
+
---
|
|
698
|
+
|
|
699
|
+
## ♿ Accessibilité
|
|
700
|
+
|
|
701
|
+
### Standards
|
|
702
|
+
|
|
703
|
+
- **WCAG 2.1 Level AA** minimum
|
|
704
|
+
- **ARIA** labels et roles
|
|
705
|
+
- **Keyboard navigation** complète
|
|
706
|
+
- **Screen reader** optimisé
|
|
707
|
+
- **Focus management**
|
|
708
|
+
|
|
709
|
+
### Implémentation
|
|
710
|
+
|
|
711
|
+
```html
|
|
712
|
+
<div
|
|
713
|
+
role="tree"
|
|
714
|
+
aria-label="JSON data structure"
|
|
715
|
+
>
|
|
716
|
+
<div
|
|
717
|
+
role="treeitem"
|
|
718
|
+
aria-expanded="true"
|
|
719
|
+
aria-level="1"
|
|
720
|
+
tabindex="0"
|
|
721
|
+
>
|
|
722
|
+
<span aria-label="user object with 3 properties">
|
|
723
|
+
user
|
|
724
|
+
</span>
|
|
725
|
+
</div>
|
|
726
|
+
</div>
|
|
727
|
+
```
|
|
728
|
+
|
|
729
|
+
### Tests A11y
|
|
730
|
+
|
|
731
|
+
- Screen reader testing (NVDA, JAWS, VoiceOver)
|
|
732
|
+
- Keyboard-only navigation
|
|
733
|
+
- Color contrast validation
|
|
734
|
+
- Focus indicators visibles
|
|
735
|
+
|
|
736
|
+
---
|
|
737
|
+
|
|
738
|
+
## 🧪 Testing Strategy
|
|
739
|
+
|
|
740
|
+
### Unit Tests
|
|
741
|
+
|
|
742
|
+
- Parser logic
|
|
743
|
+
- Formatters
|
|
744
|
+
- Validators
|
|
745
|
+
- Utilities
|
|
746
|
+
|
|
747
|
+
### Integration Tests
|
|
748
|
+
|
|
749
|
+
- Mode rendering
|
|
750
|
+
- Feature interactions
|
|
751
|
+
- Theme switching
|
|
752
|
+
- Event handling
|
|
753
|
+
|
|
754
|
+
### E2E Tests
|
|
755
|
+
|
|
756
|
+
- User flows
|
|
757
|
+
- Performance benchmarks
|
|
758
|
+
- Cross-browser compatibility
|
|
759
|
+
- Responsive behavior
|
|
760
|
+
|
|
761
|
+
### Visual Regression
|
|
762
|
+
|
|
763
|
+
- Screenshot comparison
|
|
764
|
+
- CSS changes detection
|
|
765
|
+
- Theme variations
|
|
766
|
+
|
|
767
|
+
---
|
|
768
|
+
|
|
769
|
+
## 📦 Distribution
|
|
770
|
+
|
|
771
|
+
### Package Formats
|
|
772
|
+
|
|
773
|
+
```json
|
|
774
|
+
{
|
|
775
|
+
"main": "dist/treejson.umd.js",
|
|
776
|
+
"module": "dist/treejson.esm.js",
|
|
777
|
+
"types": "dist/types/index.d.ts",
|
|
778
|
+
"exports": {
|
|
779
|
+
".": {
|
|
780
|
+
"import": "./dist/treejson.esm.js",
|
|
781
|
+
"require": "./dist/treejson.umd.js"
|
|
782
|
+
},
|
|
783
|
+
"./themes/*": "./dist/themes/*"
|
|
784
|
+
}
|
|
785
|
+
}
|
|
786
|
+
```
|
|
787
|
+
|
|
788
|
+
### CDN
|
|
789
|
+
|
|
790
|
+
```html
|
|
791
|
+
<!-- Latest -->
|
|
792
|
+
<script src="https://cdn.jsdelivr.net/npm/treejson/dist/treejson.umd.js"></script>
|
|
793
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/treejson/dist/treejson.css">
|
|
794
|
+
|
|
795
|
+
<!-- Version spécifique -->
|
|
796
|
+
<script src="https://cdn.jsdelivr.net/npm/treejson@1.0.0/dist/treejson.umd.js"></script>
|
|
797
|
+
```
|
|
798
|
+
|
|
799
|
+
### NPM
|
|
800
|
+
|
|
801
|
+
```bash
|
|
802
|
+
npm install treejson
|
|
803
|
+
```
|
|
804
|
+
|
|
805
|
+
```javascript
|
|
806
|
+
import TreeJSON from 'treejson';
|
|
807
|
+
import 'treejson/dist/treejson.css';
|
|
808
|
+
```
|
|
809
|
+
|
|
810
|
+
---
|
|
811
|
+
|
|
812
|
+
## 📚 Documentation
|
|
813
|
+
|
|
814
|
+
### Structure
|
|
815
|
+
|
|
816
|
+
1. **Getting Started**
|
|
817
|
+
- Installation
|
|
818
|
+
- Quick start
|
|
819
|
+
- Basic examples
|
|
820
|
+
|
|
821
|
+
2. **API Reference**
|
|
822
|
+
- Configuration options
|
|
823
|
+
- Methods
|
|
824
|
+
- Events
|
|
825
|
+
- Types
|
|
826
|
+
|
|
827
|
+
3. **Modes**
|
|
828
|
+
- Tree
|
|
829
|
+
- Table
|
|
830
|
+
- Cards
|
|
831
|
+
- Timeline
|
|
832
|
+
- Graph
|
|
833
|
+
|
|
834
|
+
4. **Theming**
|
|
835
|
+
- Built-in themes
|
|
836
|
+
- Custom themes
|
|
837
|
+
- CSS variables
|
|
838
|
+
|
|
839
|
+
5. **Advanced**
|
|
840
|
+
- Performance tips
|
|
841
|
+
- Custom renderers
|
|
842
|
+
- Plugins
|
|
843
|
+
|
|
844
|
+
6. **Examples**
|
|
845
|
+
- Real-world use cases
|
|
846
|
+
- Code snippets
|
|
847
|
+
- Live demos
|
|
848
|
+
|
|
849
|
+
### Interactive Playground
|
|
850
|
+
|
|
851
|
+
- Monaco editor pour éditer JSON
|
|
852
|
+
- Preview en temps réel
|
|
853
|
+
- Options configurables
|
|
854
|
+
- Share functionality
|
|
855
|
+
|
|
856
|
+
---
|
|
857
|
+
|
|
858
|
+
## 🎯 Roadmap
|
|
859
|
+
|
|
860
|
+
### Phase 1 : Core (v0.1 - v0.5)
|
|
861
|
+
|
|
862
|
+
- ✅ Parser & Renderer
|
|
863
|
+
- ✅ Mode Tree
|
|
864
|
+
- ✅ Themes (Light/Dark)
|
|
865
|
+
- ✅ Basic interactions
|
|
866
|
+
|
|
867
|
+
### Phase 2 : Features (v0.6 - v1.0)
|
|
868
|
+
|
|
869
|
+
- ✅ Search
|
|
870
|
+
- ✅ Copy functionality
|
|
871
|
+
- ✅ Keyboard shortcuts
|
|
872
|
+
- ✅ Mode Table
|
|
873
|
+
- ✅ Mode Cards
|
|
874
|
+
|
|
875
|
+
### Phase 3 : Advanced (v1.1 - v2.0)
|
|
876
|
+
|
|
877
|
+
- Mode Timeline
|
|
878
|
+
- Mode Graph
|
|
879
|
+
- Diff mode
|
|
880
|
+
- Export options
|
|
881
|
+
- Share state
|
|
882
|
+
|
|
883
|
+
### Phase 4 : Ecosystem (v2.0+)
|
|
884
|
+
|
|
885
|
+
- Plugins system
|
|
886
|
+
- React/Vue/Svelte wrappers
|
|
887
|
+
- VS Code extension
|
|
888
|
+
- Browser extension
|
|
889
|
+
- CLI tool
|
|
890
|
+
|
|
891
|
+
---
|
|
892
|
+
|
|
893
|
+
## 🏁 Définition of Done
|
|
894
|
+
|
|
895
|
+
### Pour la v1.0
|
|
896
|
+
|
|
897
|
+
**Code**
|
|
898
|
+
- ✅ Mode Tree complet et testé
|
|
899
|
+
- ✅ Mode Table fonctionnel
|
|
900
|
+
- ✅ Mode Cards implémenté
|
|
901
|
+
- ✅ 2 thèmes (Light/Dark)
|
|
902
|
+
- ✅ Search opérationnelle
|
|
903
|
+
- ✅ Copy to clipboard
|
|
904
|
+
- ✅ Keyboard navigation
|
|
905
|
+
- ✅ 90%+ test coverage
|
|
906
|
+
- ✅ Zero critical bugs
|
|
907
|
+
|
|
908
|
+
**Design**
|
|
909
|
+
- ✅ UI moderne et cohérente
|
|
910
|
+
- ✅ Animations fluides (60fps)
|
|
911
|
+
- ✅ Responsive (mobile → desktop)
|
|
912
|
+
- ✅ Accessible (WCAG AA)
|
|
913
|
+
- ✅ Customizable (theming)
|
|
914
|
+
|
|
915
|
+
**Docs**
|
|
916
|
+
- ✅ README complet
|
|
917
|
+
- ✅ API documentation
|
|
918
|
+
- ✅ 10+ exemples live
|
|
919
|
+
- ✅ Migration guide
|
|
920
|
+
- ✅ Contributing guide
|
|
921
|
+
|
|
922
|
+
**Distribution**
|
|
923
|
+
- ✅ NPM package publié
|
|
924
|
+
- ✅ CDN disponible
|
|
925
|
+
- ✅ TypeScript types
|
|
926
|
+
- ✅ Source maps
|
|
927
|
+
- ✅ < 50kb gzipped
|
|
928
|
+
|
|
929
|
+
---
|
|
930
|
+
|
|
931
|
+
## 🎨 Design Assets Nécessaires
|
|
932
|
+
|
|
933
|
+
### Icônes
|
|
934
|
+
|
|
935
|
+
- Expand/collapse triangles
|
|
936
|
+
- Type icons (string, number, etc.)
|
|
937
|
+
- Action icons (copy, search, download)
|
|
938
|
+
- Status icons (loading, error, success)
|
|
939
|
+
|
|
940
|
+
### Illustrations
|
|
941
|
+
|
|
942
|
+
- Empty state (no data)
|
|
943
|
+
- Error state (invalid JSON)
|
|
944
|
+
- Loading state (skeleton)
|
|
945
|
+
|
|
946
|
+
### Animations
|
|
947
|
+
|
|
948
|
+
- Expand/collapse
|
|
949
|
+
- Fade in/out
|
|
950
|
+
- Slide transitions
|
|
951
|
+
- Loading spinners
|
|
952
|
+
|
|
953
|
+
---
|
|
954
|
+
|
|
955
|
+
## 🤝 Prochaines Étapes
|
|
956
|
+
|
|
957
|
+
### Étape 1 : Prototype Design
|
|
958
|
+
- Figma mockups pour mode Tree
|
|
959
|
+
- Design system (colors, spacing, typography)
|
|
960
|
+
- Interactions prototypes
|
|
961
|
+
|
|
962
|
+
### Étape 2 : Core Development
|
|
963
|
+
- Setup projet (TS, Vite, tests)
|
|
964
|
+
- Parser implementation
|
|
965
|
+
- Renderer base
|
|
966
|
+
|
|
967
|
+
### Étape 3 : Mode Tree MVP
|
|
968
|
+
- DOM generation
|
|
969
|
+
- Styling (CSS)
|
|
970
|
+
- Basic interactions
|
|
971
|
+
|
|
972
|
+
### Étape 4 : Polish & Test
|
|
973
|
+
- Animations
|
|
974
|
+
- Edge cases
|
|
975
|
+
- Performance optimization
|
|
976
|
+
|
|
977
|
+
### Étape 5 : Documentation
|
|
978
|
+
- README
|
|
979
|
+
- API docs
|
|
980
|
+
- Live examples
|
|
981
|
+
|
|
982
|
+
---
|
|
983
|
+
|
|
984
|
+
## 💬 Questions Ouvertes
|
|
985
|
+
|
|
986
|
+
1. **Web Components** : Utiliser ou non ?
|
|
987
|
+
2. **CSS-in-JS** : Vanilla CSS ou solution JS ?
|
|
988
|
+
3. **Icons** : Icon font, SVG inline, ou externe ?
|
|
989
|
+
4. **Animation library** : Vanilla ou GSAP ?
|
|
990
|
+
5. **State management** : Custom ou Zustand-like ?
|
|
991
|
+
|
|
992
|
+
---
|
|
993
|
+
|
|
994
|
+
## 🌟 Vision Finale
|
|
995
|
+
|
|
996
|
+
TreeJSON ne doit pas être "juste un afficheur de JSON". Il doit être :
|
|
997
|
+
|
|
998
|
+
- **Le meilleur** outil de visualisation JSON du marché
|
|
999
|
+
- **Le plus beau** visuellement
|
|
1000
|
+
- **Le plus fluide** en interactions
|
|
1001
|
+
- **Le plus accessible**
|
|
1002
|
+
- **Le plus extensible**
|
|
1003
|
+
|
|
1004
|
+
Un outil que les développeurs recommandent spontanément, qu'ils intègrent dans leurs workflows, et dont ils ne peuvent plus se passer.
|
|
1005
|
+
|
|
1006
|
+
**TreeJSON = The JSON visualization you always wanted.**
|
|
1007
|
+
|
|
1008
|
+
---
|
|
1009
|
+
|
|
1010
|
+
Prêt à construire ? 🚀
|
|
1011
|
+
|
|
1012
|
+
Quelle brique veux-tu développer en premier ?
|
|
1013
|
+
|
|
1014
|
+
1. 🎨 **Design System** (Figma mockups + CSS variables)
|
|
1015
|
+
2. 🧠 **Core Parser** (TypeScript implementation)
|
|
1016
|
+
3. 🌳 **Tree Renderer** (DOM generation + interactions)
|
|
1017
|
+
4. 📦 **Project Setup** (Repo structure + build config)
|
|
1018
|
+
5. 📚 **Demo Page** (Landing + examples)
|
|
1019
|
+
|
|
1020
|
+
Dis-moi et on y va ! 🔥
|