@axzydev/axzy_ui_system 1.6.0 → 1.7.1
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/index.cjs +7842 -4676
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/index.d.cts +883 -3
- package/dist/index.d.ts +883 -3
- package/dist/index.js +9118 -5971
- package/dist/index.js.map +1 -1
- package/dist/layered.css +1 -1
- package/package.json +14 -7
- package/src/App.tsx +70 -2
- package/src/components/atoms/image/image.props.ts +2 -0
- package/src/components/atoms/image/image.tsx +3 -2
- package/src/components/molecules/json-editor/json-editor-tree.tsx +235 -0
- package/src/components/molecules/json-editor/json-editor.index.ts +2 -0
- package/src/components/molecules/json-editor/json-editor.props.ts +82 -0
- package/src/components/molecules/json-editor/json-editor.tsx +972 -0
- package/src/components/molecules/json-editor/json-editor.utils.ts +717 -0
- package/src/components/molecules/json-editor/useJsonEditorKeyboard.ts +256 -0
- package/src/components/molecules/json-renderer/json-renderer.index.ts +2 -0
- package/src/components/molecules/json-renderer/json-renderer.props.ts +31 -0
- package/src/components/molecules/json-renderer/json-renderer.tsx +79 -0
- package/src/components/organisms/dialog/dialog.props.ts +2 -0
- package/src/components/organisms/dialog/dialog.tsx +4 -3
- package/src/dev.css +30 -1
- package/src/hooks/useJsonRender.tsx +9 -0
- package/src/i18n/locales/en.ts +54 -0
- package/src/i18n/locales/es.ts +54 -0
- package/src/index.css +414 -0
- package/src/index.ts +99 -2
- package/src/json-renderer/catalog/axzyCatalog.ts +362 -0
- package/src/json-renderer/catalog/catalog.props.ts +128 -0
- package/src/json-renderer/catalog/resolve.ts +225 -0
- package/src/json-renderer/index.ts +70 -0
- package/src/json-renderer/kernel/NodeBoundary.tsx +53 -0
- package/src/json-renderer/kernel/SchemaRenderer.tsx +197 -0
- package/src/json-renderer/kernel/kernel.test.tsx +341 -0
- package/src/json-renderer/kernel/partial.ts +92 -0
- package/src/json-renderer/kernel/renderNode.tsx +113 -0
- package/src/json-renderer/kernel/schemaRenderer.props.ts +42 -0
- package/src/json-renderer/kernel/types.ts +159 -0
- package/src/json-renderer/shared/errors.ts +92 -0
- package/src/json-renderer/shared/limits.ts +87 -0
- package/src/json-renderer/shared/paths.ts +66 -0
- package/src/json-renderer/shared/shared.test.ts +108 -0
- package/src/json-renderer/stream/tolerantParse.test.ts +152 -0
- package/src/json-renderer/stream/tolerantParse.ts +449 -0
- package/src/json-renderer/test/setup.ts +38 -0
- package/src/json-renderer/validation/migrate.ts +83 -0
- package/src/json-renderer/validation/validate.ts +161 -0
- package/src/json-renderer/validation/validation.test.ts +165 -0
- package/src/json-renderer/vocabulary/buildContract.ts +158 -0
- package/src/sandbox/AxzyLogo.tsx +139 -0
- package/src/sandbox/axzyConfig.test.ts +40 -0
- package/src/sandbox/axzyConfig.ts +77 -0
- package/src/sandbox/i18n.ts +220 -0
- package/src/sandbox/navigation.ts +3 -0
- package/src/sandbox/useHashRoute.ts +39 -9
- package/src/showcases/DemoJsonDashboard.tsx +489 -0
- package/src/showcases/DemoJsonDocs.tsx +339 -0
- package/src/showcases/DemoJsonPortfolio.tsx +257 -0
- package/src/showcases/FeedbackShowcases.tsx +16 -5
- package/src/showcases/HomeShowcase.tsx +16 -9
- package/src/showcases/JsonEditorShowcase.tsx +150 -0
- package/src/showcases/JsonRendererShowcase.tsx +70 -0
- package/src/showcases/JsonScreenShowcase.tsx +341 -0
- package/src/showcases/StructureShowcases.tsx +6 -1
- package/src/showcases/demoApp/demoData.ts +181 -0
- package/src/showcases/demoApp/nodeTree.test.ts +39 -0
- package/src/showcases/demoApp/nodeTree.ts +35 -0
- package/src/showcases/demoApp/schemas.test.ts +54 -0
package/src/index.css
CHANGED
|
@@ -169,4 +169,418 @@
|
|
|
169
169
|
:where(.it-table-pinned-right) {
|
|
170
170
|
box-shadow: inset 1px 0 0 0 var(--color-secondary-200);
|
|
171
171
|
}
|
|
172
|
+
|
|
173
|
+
/* ── ITJSONEditor ────────────────────────────────────────────────────────
|
|
174
|
+
Editor de código sobre <textarea>: una capa con el JSON resaltado se pinta
|
|
175
|
+
debajo del textarea transparente. Las dos capas comparten tipografía y
|
|
176
|
+
`line-height`, y el alto de línea lo mide el componente en el DOM
|
|
177
|
+
(`--it-json-editor-line`), de ahí que aquí solo se fije la métrica. */
|
|
178
|
+
:where(.it-json-editor-canvas) {
|
|
179
|
+
--it-json-editor-line: 21px;
|
|
180
|
+
background: #fbfcfd;
|
|
181
|
+
}
|
|
182
|
+
:where(.it-json-editor-canvas[data-canvas="ink"]) {
|
|
183
|
+
background: #0b1120;
|
|
184
|
+
}
|
|
185
|
+
:where(.dark .it-json-editor-canvas) {
|
|
186
|
+
background: #020617;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
:where(.it-json-editor-code) {
|
|
190
|
+
font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
|
|
191
|
+
font-size: 12.5px;
|
|
192
|
+
/* Misma métrica que el textarea: los dos consumen la variable que publica el
|
|
193
|
+
componente con el alto de línea real. */
|
|
194
|
+
line-height: var(--it-json-editor-line, 21px);
|
|
195
|
+
tab-size: 2;
|
|
196
|
+
color: #334155;
|
|
197
|
+
}
|
|
198
|
+
/* El relleno vive en `.it-json-editor-code`, que es la clase compartida por la
|
|
199
|
+
capa resaltada y el textarea: así las dos cajas de scroll tienen el mismo
|
|
200
|
+
contenido y desplazan igual, y el alto de cada línea es exactamente
|
|
201
|
+
`--it-json-editor-line` para que el gutter no se desincronice. */
|
|
202
|
+
:where(.it-json-editor-code) {
|
|
203
|
+
padding: 10px 12px;
|
|
204
|
+
}
|
|
205
|
+
:where(.it-json-editor-code-line) {
|
|
206
|
+
white-space: pre;
|
|
207
|
+
}
|
|
208
|
+
:where(.it-json-editor-highlight) {
|
|
209
|
+
position: absolute;
|
|
210
|
+
inset: 0;
|
|
211
|
+
z-index: 0;
|
|
212
|
+
pointer-events: none;
|
|
213
|
+
}
|
|
214
|
+
:where(.it-json-editor-canvas[data-canvas="ink"] .it-json-editor-code) {
|
|
215
|
+
color: #cbd5e1;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
/* Textarea: texto transparente y cursor visible, encima de la capa pintada.
|
|
219
|
+
Las métricas de texto van declaradas **aquí** y no heredadas de
|
|
220
|
+
`.it-json-editor-code`: el textarea no es hijo de esa capa, así que sin esto
|
|
221
|
+
usa la tipografía de la página y el caret del navegador deja de coincidir
|
|
222
|
+
con el glifo pintado (el clic cae en otro carácter). */
|
|
223
|
+
:where(.it-json-editor-textarea) {
|
|
224
|
+
position: absolute;
|
|
225
|
+
inset: 0;
|
|
226
|
+
z-index: 1;
|
|
227
|
+
width: 100%;
|
|
228
|
+
height: 100%;
|
|
229
|
+
margin: 0;
|
|
230
|
+
border: 0;
|
|
231
|
+
resize: none;
|
|
232
|
+
outline: none;
|
|
233
|
+
background: transparent;
|
|
234
|
+
color: transparent;
|
|
235
|
+
caret-color: #2563eb;
|
|
236
|
+
-webkit-text-fill-color: transparent;
|
|
237
|
+
font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
|
|
238
|
+
font-size: 12.5px;
|
|
239
|
+
line-height: var(--it-json-editor-line, 21px);
|
|
240
|
+
tab-size: 2;
|
|
241
|
+
letter-spacing: normal;
|
|
242
|
+
padding: 10px 12px;
|
|
243
|
+
white-space: pre;
|
|
244
|
+
overflow-wrap: normal;
|
|
245
|
+
word-break: normal;
|
|
246
|
+
}
|
|
247
|
+
:where(.it-json-editor-canvas[data-canvas="ink"] .it-json-editor-textarea) {
|
|
248
|
+
caret-color: #7dd3fc;
|
|
249
|
+
}
|
|
250
|
+
:where(.it-json-editor-textarea)::placeholder {
|
|
251
|
+
color: #94a3b8;
|
|
252
|
+
-webkit-text-fill-color: #94a3b8;
|
|
253
|
+
}
|
|
254
|
+
:where(.it-json-editor-textarea)::selection {
|
|
255
|
+
background: rgb(37 99 235 / 0.25);
|
|
256
|
+
}
|
|
257
|
+
:where(.it-json-editor-canvas[data-canvas="ink"] .it-json-editor-textarea)::selection {
|
|
258
|
+
background: rgb(125 211 252 / 0.25);
|
|
259
|
+
}
|
|
260
|
+
:where(.it-json-editor-nowrap) {
|
|
261
|
+
white-space: pre;
|
|
262
|
+
overflow: auto;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
/* Gutter: números y controles de plegado, con la misma rejilla que el código. */
|
|
266
|
+
:where(.it-json-editor-gutter),
|
|
267
|
+
:where(.it-json-editor-linenumbers) {
|
|
268
|
+
background: rgb(148 163 184 / 0.08);
|
|
269
|
+
border-right: 1px solid rgb(148 163 184 / 0.22);
|
|
270
|
+
}
|
|
271
|
+
:where(.it-json-editor-gutter-row) {
|
|
272
|
+
display: flex;
|
|
273
|
+
align-items: flex-start;
|
|
274
|
+
justify-content: flex-end;
|
|
275
|
+
}
|
|
276
|
+
:where(.it-json-editor-fold) {
|
|
277
|
+
display: inline-flex;
|
|
278
|
+
align-items: center;
|
|
279
|
+
justify-content: center;
|
|
280
|
+
width: 16px;
|
|
281
|
+
height: 16px;
|
|
282
|
+
margin: 2px 1px 0 0;
|
|
283
|
+
border: 0;
|
|
284
|
+
border-radius: 4px;
|
|
285
|
+
background: transparent;
|
|
286
|
+
color: #64748b;
|
|
287
|
+
cursor: pointer;
|
|
288
|
+
}
|
|
289
|
+
:where(.it-json-editor-canvas[data-canvas="ink"] .it-json-editor-fold) {
|
|
290
|
+
color: #94a3b8;
|
|
291
|
+
}
|
|
292
|
+
:where(.it-json-editor-fold:hover) {
|
|
293
|
+
background: rgb(148 163 184 / 0.25);
|
|
294
|
+
color: #1d4ed8;
|
|
295
|
+
}
|
|
296
|
+
:where(.it-json-editor-fold:focus-visible) {
|
|
297
|
+
outline: 2px solid var(--color-primary-500);
|
|
298
|
+
outline-offset: 1px;
|
|
299
|
+
}
|
|
300
|
+
:where(.it-json-editor-linenumber) {
|
|
301
|
+
padding-right: 10px;
|
|
302
|
+
padding-left: 10px;
|
|
303
|
+
font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
|
|
304
|
+
font-size: 11px;
|
|
305
|
+
line-height: var(--it-json-editor-line);
|
|
306
|
+
text-align: right;
|
|
307
|
+
color: #94a3b8;
|
|
308
|
+
white-space: pre;
|
|
309
|
+
}
|
|
310
|
+
:where(.it-json-editor-linenumber--active) {
|
|
311
|
+
color: #1d4ed8;
|
|
312
|
+
font-weight: 600;
|
|
313
|
+
}
|
|
314
|
+
:where(.it-json-editor-canvas[data-canvas="ink"] .it-json-editor-linenumber) {
|
|
315
|
+
color: #64748b;
|
|
316
|
+
}
|
|
317
|
+
:where(.it-json-editor-canvas[data-canvas="ink"] .it-json-editor-linenumber--active) {
|
|
318
|
+
color: #7dd3fc;
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
/* Fondos de línea (cursor y error). */
|
|
322
|
+
:where(.it-json-editor-active-line) {
|
|
323
|
+
z-index: 0;
|
|
324
|
+
background: rgb(37 99 235 / 0.06);
|
|
325
|
+
}
|
|
326
|
+
:where(.it-json-editor-canvas[data-canvas="ink"] .it-json-editor-active-line) {
|
|
327
|
+
background: rgb(148 197 253 / 0.07);
|
|
328
|
+
}
|
|
329
|
+
:where(.it-json-editor-error-line) {
|
|
330
|
+
z-index: 0;
|
|
331
|
+
background: rgb(244 63 94 / 0.12);
|
|
332
|
+
box-shadow: inset 2px 0 0 0 var(--color-danger-500);
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
/* Tokens del resaltado. */
|
|
336
|
+
:where(.it-json-editor-tk-key) {
|
|
337
|
+
color: #0369a1;
|
|
338
|
+
}
|
|
339
|
+
:where(.it-json-editor-tk-string) {
|
|
340
|
+
color: #047857;
|
|
341
|
+
}
|
|
342
|
+
:where(.it-json-editor-tk-number) {
|
|
343
|
+
color: #b45309;
|
|
344
|
+
}
|
|
345
|
+
:where(.it-json-editor-tk-keyword),
|
|
346
|
+
:where(.it-json-editor-tk-null) {
|
|
347
|
+
color: #7c3aed;
|
|
348
|
+
}
|
|
349
|
+
:where(.it-json-editor-tk-punct) {
|
|
350
|
+
color: #64748b;
|
|
351
|
+
}
|
|
352
|
+
:where(.it-json-editor-tk-plain) {
|
|
353
|
+
color: #b91c1c;
|
|
354
|
+
text-decoration: underline wavy rgb(185 28 28 / 0.5);
|
|
355
|
+
}
|
|
356
|
+
:where(.it-json-editor-canvas[data-canvas="ink"] .it-json-editor-tk-key) {
|
|
357
|
+
color: #7dd3fc;
|
|
358
|
+
}
|
|
359
|
+
:where(.it-json-editor-canvas[data-canvas="ink"] .it-json-editor-tk-string) {
|
|
360
|
+
color: #86efac;
|
|
361
|
+
}
|
|
362
|
+
:where(.it-json-editor-canvas[data-canvas="ink"] .it-json-editor-tk-number) {
|
|
363
|
+
color: #fcd34d;
|
|
364
|
+
}
|
|
365
|
+
:where(.it-json-editor-canvas[data-canvas="ink"] .it-json-editor-tk-keyword),
|
|
366
|
+
:where(.it-json-editor-canvas[data-canvas="ink"] .it-json-editor-tk-null) {
|
|
367
|
+
color: #c4b5fd;
|
|
368
|
+
}
|
|
369
|
+
:where(.it-json-editor-canvas[data-canvas="ink"] .it-json-editor-tk-punct) {
|
|
370
|
+
color: #94a3b8;
|
|
371
|
+
}
|
|
372
|
+
:where(.it-json-editor-canvas[data-canvas="ink"] .it-json-editor-tk-plain) {
|
|
373
|
+
color: #fda4af;
|
|
374
|
+
text-decoration: underline wavy rgb(253 164 175 / 0.5);
|
|
375
|
+
}
|
|
376
|
+
:where(.it-json-editor-fold-marker) {
|
|
377
|
+
margin-left: 6px;
|
|
378
|
+
padding: 0 4px;
|
|
379
|
+
border-radius: 4px;
|
|
380
|
+
background: rgb(148 163 184 / 0.2);
|
|
381
|
+
font-size: 10.5px;
|
|
382
|
+
color: #64748b;
|
|
383
|
+
}
|
|
384
|
+
:where(.it-json-editor-canvas[data-canvas="ink"] .it-json-editor-fold-marker) {
|
|
385
|
+
color: #94a3b8;
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
/* Botonera de la barra superior. */
|
|
389
|
+
:where(.it-json-editor-tool) {
|
|
390
|
+
display: inline-flex;
|
|
391
|
+
align-items: center;
|
|
392
|
+
gap: 5px;
|
|
393
|
+
height: 24px;
|
|
394
|
+
padding: 0 8px;
|
|
395
|
+
border: 1px solid var(--color-secondary-200);
|
|
396
|
+
border-radius: 6px;
|
|
397
|
+
background: transparent;
|
|
398
|
+
font-family: "JetBrains Mono", ui-monospace, monospace;
|
|
399
|
+
font-size: 10px;
|
|
400
|
+
font-weight: 500;
|
|
401
|
+
letter-spacing: 0.06em;
|
|
402
|
+
text-transform: uppercase;
|
|
403
|
+
color: var(--color-secondary-600);
|
|
404
|
+
cursor: pointer;
|
|
405
|
+
transition: background-color 120ms ease, color 120ms ease, border-color 120ms ease;
|
|
406
|
+
}
|
|
407
|
+
:where(.dark .it-json-editor-tool) {
|
|
408
|
+
border-color: var(--color-secondary-800);
|
|
409
|
+
color: var(--color-secondary-300);
|
|
410
|
+
}
|
|
411
|
+
:where(.it-json-editor-tool:hover:not(:disabled)) {
|
|
412
|
+
border-color: var(--color-primary-400);
|
|
413
|
+
background: var(--color-primary-50);
|
|
414
|
+
color: var(--color-primary-700);
|
|
415
|
+
}
|
|
416
|
+
:where(.dark .it-json-editor-tool:hover:not(:disabled)) {
|
|
417
|
+
border-color: var(--color-primary-500);
|
|
418
|
+
background: rgb(37 99 235 / 0.15);
|
|
419
|
+
color: var(--color-primary-300);
|
|
420
|
+
}
|
|
421
|
+
:where(.it-json-editor-tool:disabled) {
|
|
422
|
+
opacity: 0.4;
|
|
423
|
+
cursor: not-allowed;
|
|
424
|
+
}
|
|
425
|
+
:where(.it-json-editor-tool:focus-visible) {
|
|
426
|
+
outline: 2px solid var(--color-primary-500);
|
|
427
|
+
outline-offset: 1px;
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
/* Conmutador texto/árbol. */
|
|
431
|
+
:where(.it-json-editor-segment) {
|
|
432
|
+
display: inline-flex;
|
|
433
|
+
align-items: center;
|
|
434
|
+
border: 1px solid var(--color-secondary-200);
|
|
435
|
+
border-radius: 6px;
|
|
436
|
+
overflow: hidden;
|
|
437
|
+
}
|
|
438
|
+
:where(.dark .it-json-editor-segment) {
|
|
439
|
+
border-color: var(--color-secondary-800);
|
|
440
|
+
}
|
|
441
|
+
:where(.it-json-editor-segment-item) {
|
|
442
|
+
display: inline-flex;
|
|
443
|
+
align-items: center;
|
|
444
|
+
gap: 5px;
|
|
445
|
+
height: 24px;
|
|
446
|
+
padding: 0 8px;
|
|
447
|
+
border: 0;
|
|
448
|
+
background: transparent;
|
|
449
|
+
font-family: "JetBrains Mono", ui-monospace, monospace;
|
|
450
|
+
font-size: 10px;
|
|
451
|
+
font-weight: 500;
|
|
452
|
+
letter-spacing: 0.06em;
|
|
453
|
+
text-transform: uppercase;
|
|
454
|
+
color: var(--color-secondary-500);
|
|
455
|
+
cursor: pointer;
|
|
456
|
+
}
|
|
457
|
+
:where(.it-json-editor-segment-item--active) {
|
|
458
|
+
background: var(--color-primary-600);
|
|
459
|
+
color: #ffffff;
|
|
460
|
+
}
|
|
461
|
+
:where(.it-json-editor-segment-item:focus-visible) {
|
|
462
|
+
outline: 2px solid var(--color-primary-500);
|
|
463
|
+
outline-offset: -2px;
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
/* Interruptores de la fila de ajustes. */
|
|
467
|
+
:where(.it-json-editor-toggle) {
|
|
468
|
+
display: inline-flex;
|
|
469
|
+
align-items: center;
|
|
470
|
+
gap: 5px;
|
|
471
|
+
border: 0;
|
|
472
|
+
background: transparent;
|
|
473
|
+
font-family: "JetBrains Mono", ui-monospace, monospace;
|
|
474
|
+
font-size: 10px;
|
|
475
|
+
letter-spacing: 0.1em;
|
|
476
|
+
text-transform: uppercase;
|
|
477
|
+
color: var(--color-secondary-400);
|
|
478
|
+
cursor: pointer;
|
|
479
|
+
}
|
|
480
|
+
:where(.it-json-editor-toggle--on) {
|
|
481
|
+
color: var(--color-primary-700);
|
|
482
|
+
}
|
|
483
|
+
:where(.dark .it-json-editor-toggle--on) {
|
|
484
|
+
color: var(--color-primary-300);
|
|
485
|
+
}
|
|
486
|
+
:where(.it-json-editor-toggle-dot) {
|
|
487
|
+
display: inline-block;
|
|
488
|
+
width: 6px;
|
|
489
|
+
height: 6px;
|
|
490
|
+
border-radius: 999px;
|
|
491
|
+
background: currentColor;
|
|
492
|
+
opacity: 0.4;
|
|
493
|
+
}
|
|
494
|
+
:where(.it-json-editor-toggle--on .it-json-editor-toggle-dot) {
|
|
495
|
+
opacity: 1;
|
|
496
|
+
}
|
|
497
|
+
:where(.it-json-editor-toggle:focus-visible) {
|
|
498
|
+
outline: 2px solid var(--color-primary-500);
|
|
499
|
+
outline-offset: 1px;
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
/* Árbol navegable. */
|
|
503
|
+
:where(.it-json-editor-tree) {
|
|
504
|
+
height: 100%;
|
|
505
|
+
}
|
|
506
|
+
:where(.it-json-editor-tree-spacer) {
|
|
507
|
+
display: inline-block;
|
|
508
|
+
width: 14px;
|
|
509
|
+
flex-shrink: 0;
|
|
510
|
+
}
|
|
511
|
+
:where(.it-json-editor-tk-value) {
|
|
512
|
+
color: #334155;
|
|
513
|
+
}
|
|
514
|
+
:where(.it-json-editor-canvas[data-canvas="ink"] .it-json-editor-tk-value) {
|
|
515
|
+
color: #cbd5e1;
|
|
516
|
+
}
|
|
517
|
+
:where(.it-json-editor-tree-row) {
|
|
518
|
+
display: flex;
|
|
519
|
+
align-items: center;
|
|
520
|
+
gap: 4px;
|
|
521
|
+
min-height: 20px;
|
|
522
|
+
font-family: "JetBrains Mono", ui-monospace, monospace;
|
|
523
|
+
font-size: 11.5px;
|
|
524
|
+
line-height: 1.5;
|
|
525
|
+
color: #334155;
|
|
526
|
+
}
|
|
527
|
+
:where(.it-json-editor-canvas[data-canvas="ink"] .it-json-editor-tree-row) {
|
|
528
|
+
color: #cbd5e1;
|
|
529
|
+
}
|
|
530
|
+
:where(.it-json-editor-tree-row:hover) {
|
|
531
|
+
background: rgb(148 163 184 / 0.12);
|
|
532
|
+
}
|
|
533
|
+
:where(.it-json-editor-tree-toggle) {
|
|
534
|
+
display: inline-flex;
|
|
535
|
+
align-items: center;
|
|
536
|
+
justify-content: center;
|
|
537
|
+
width: 14px;
|
|
538
|
+
height: 14px;
|
|
539
|
+
border: 0;
|
|
540
|
+
border-radius: 3px;
|
|
541
|
+
background: transparent;
|
|
542
|
+
color: #64748b;
|
|
543
|
+
cursor: pointer;
|
|
544
|
+
}
|
|
545
|
+
:where(.it-json-editor-tree-badge) {
|
|
546
|
+
padding: 0 5px;
|
|
547
|
+
border-radius: 999px;
|
|
548
|
+
background: rgb(148 163 184 / 0.18);
|
|
549
|
+
font-size: 9.5px;
|
|
550
|
+
letter-spacing: 0.04em;
|
|
551
|
+
text-transform: uppercase;
|
|
552
|
+
color: #64748b;
|
|
553
|
+
}
|
|
554
|
+
:where(.it-json-editor-canvas[data-canvas="ink"] .it-json-editor-tree-badge) {
|
|
555
|
+
color: #94a3b8;
|
|
556
|
+
}
|
|
557
|
+
:where(.it-json-editor-tree-jump) {
|
|
558
|
+
display: inline-flex;
|
|
559
|
+
align-items: center;
|
|
560
|
+
gap: 3px;
|
|
561
|
+
margin-left: auto;
|
|
562
|
+
padding: 0 5px;
|
|
563
|
+
border: 0;
|
|
564
|
+
border-radius: 4px;
|
|
565
|
+
background: transparent;
|
|
566
|
+
font-family: "JetBrains Mono", ui-monospace, monospace;
|
|
567
|
+
font-size: 9.5px;
|
|
568
|
+
letter-spacing: 0.06em;
|
|
569
|
+
text-transform: uppercase;
|
|
570
|
+
color: #64748b;
|
|
571
|
+
cursor: pointer;
|
|
572
|
+
opacity: 0;
|
|
573
|
+
}
|
|
574
|
+
:where(.it-json-editor-tree-row:hover .it-json-editor-tree-jump),
|
|
575
|
+
:where(.it-json-editor-tree-jump:focus-visible) {
|
|
576
|
+
opacity: 1;
|
|
577
|
+
}
|
|
578
|
+
:where(.it-json-editor-tree-jump:hover) {
|
|
579
|
+
background: var(--color-primary-50);
|
|
580
|
+
color: var(--color-primary-700);
|
|
581
|
+
}
|
|
582
|
+
:where(.dark .it-json-editor-tree-jump:hover) {
|
|
583
|
+
background: rgb(37 99 235 / 0.2);
|
|
584
|
+
color: var(--color-primary-300);
|
|
585
|
+
}
|
|
172
586
|
}
|
package/src/index.ts
CHANGED
|
@@ -6,6 +6,7 @@ import { useDebouncedSearch } from "./hooks/useDebouncedSearch";
|
|
|
6
6
|
import { useEditableRow } from "./hooks/useEditableRow";
|
|
7
7
|
import { useFloatingPanel } from "./hooks/useFloatingPanel";
|
|
8
8
|
import { useTableState, UseTableStateOptions, UseTableStateResult } from "./hooks/useTableState";
|
|
9
|
+
import useJsonRender from "./hooks/useJsonRender";
|
|
9
10
|
|
|
10
11
|
// COMPONENTES
|
|
11
12
|
import ITAccordion from "./components/molecules/accordion/accordion";
|
|
@@ -62,6 +63,82 @@ import ITTabs from "./components/molecules/tabs/tabs";
|
|
|
62
63
|
import ITTripleFilter from "./components/organisms/triple-filter/tripleFilter";
|
|
63
64
|
import ITToast from "./components/organisms/toast/toast";
|
|
64
65
|
import ITWysiwyg from "./components/molecules/wysiwyg/wysiwyg";
|
|
66
|
+
import ITJsonRenderer from "./components/molecules/json-renderer/json-renderer";
|
|
67
|
+
import ITJSONEditor from "./components/molecules/json-editor/json-editor";
|
|
68
|
+
|
|
69
|
+
// MOTOR DE PANTALLAS DECLARATIVAS (json-renderer)
|
|
70
|
+
import {
|
|
71
|
+
ITSchemaRenderer,
|
|
72
|
+
NodeBoundary,
|
|
73
|
+
renderNode,
|
|
74
|
+
auditTree,
|
|
75
|
+
countPendingNodes,
|
|
76
|
+
axzyCatalog,
|
|
77
|
+
axzyCatalogTypes,
|
|
78
|
+
AXZY_CATALOG_ENTRIES,
|
|
79
|
+
AXZY_EXCLUDED_TYPES,
|
|
80
|
+
createCatalog,
|
|
81
|
+
getCatalogEntry,
|
|
82
|
+
isExcludedType,
|
|
83
|
+
getExclusionReason,
|
|
84
|
+
GLOBALLY_FORBIDDEN_PROPS,
|
|
85
|
+
resolveNode,
|
|
86
|
+
parsePartialSchema,
|
|
87
|
+
isNodePending,
|
|
88
|
+
JsonEngineError,
|
|
89
|
+
issue,
|
|
90
|
+
formatPath,
|
|
91
|
+
parsePath,
|
|
92
|
+
readPath,
|
|
93
|
+
hasPath,
|
|
94
|
+
pushPath,
|
|
95
|
+
propPath,
|
|
96
|
+
DEFAULT_LIMITS,
|
|
97
|
+
resolveLimits,
|
|
98
|
+
createLimitTracker,
|
|
99
|
+
validateSchema,
|
|
100
|
+
CURRENT_SCHEMA_VERSION,
|
|
101
|
+
migrateSchema,
|
|
102
|
+
DEFAULT_MIGRATIONS,
|
|
103
|
+
buildVocabularyContract,
|
|
104
|
+
formatVocabularyForPrompt,
|
|
105
|
+
} from "./json-renderer";
|
|
106
|
+
import type {
|
|
107
|
+
ITJsonRenderEngineProps,
|
|
108
|
+
ScreenSchema,
|
|
109
|
+
NodeSchema,
|
|
110
|
+
SchemaValue,
|
|
111
|
+
SchemaReference,
|
|
112
|
+
WhenSchema,
|
|
113
|
+
ActionSchema,
|
|
114
|
+
EffectSchema,
|
|
115
|
+
DataSourceSchema,
|
|
116
|
+
NodeStatus,
|
|
117
|
+
Catalog,
|
|
118
|
+
CatalogEntry,
|
|
119
|
+
PropSpec,
|
|
120
|
+
PropKind,
|
|
121
|
+
ResolvedNode,
|
|
122
|
+
UnresolvedNode,
|
|
123
|
+
PartialParseResult,
|
|
124
|
+
StreamState,
|
|
125
|
+
JsonEngineIssue,
|
|
126
|
+
JsonEngineCode,
|
|
127
|
+
JsonEngineSeverity,
|
|
128
|
+
SchemaPath,
|
|
129
|
+
PathSegment,
|
|
130
|
+
EngineLimits,
|
|
131
|
+
LimitTracker,
|
|
132
|
+
ValidationReport,
|
|
133
|
+
ValidationVerdict,
|
|
134
|
+
ValidateOptions,
|
|
135
|
+
SchemaMigration,
|
|
136
|
+
MigrationRegistry,
|
|
137
|
+
MigrationResult,
|
|
138
|
+
VocabularyContract,
|
|
139
|
+
ComponentContract,
|
|
140
|
+
PropContract,
|
|
141
|
+
} from "./json-renderer";
|
|
65
142
|
|
|
66
143
|
// PROPS
|
|
67
144
|
import type { ITAlertProps } from "./components/molecules/alert/alert.props";
|
|
@@ -118,6 +195,8 @@ import type { ITTabsProps, ITTabItem } from "./components/molecules/tabs/tabs.pr
|
|
|
118
195
|
import type { ITTripleFilterProps, ITTripleFilterOption } from "./components/organisms/triple-filter/tripleFilter.props";
|
|
119
196
|
import type { ITToastProps } from "./components/organisms/toast/toast.props";
|
|
120
197
|
import type { ITWysiwygProps } from "./components/molecules/wysiwyg/wysiwyg.props";
|
|
198
|
+
import type { ITJsonRendererProps, JsonComponentNode, JsonComponentType } from "./components/molecules/json-renderer/json-renderer.props";
|
|
199
|
+
import type { ITJSONEditorProps } from "./components/molecules/json-editor/json-editor.props";
|
|
121
200
|
import type { FieldConfig, FieldConfigV2 } from "./types/field.types";
|
|
122
201
|
import type { ColumnFilters, ColumnFilterValue, TableColors, TableDensity, TableDesign, TableDesignProps, TableDesignSlot } from "./types/table.types";
|
|
123
202
|
|
|
@@ -144,7 +223,7 @@ import type { ITI18nProviderProps, ITI18nValue, ITLocale, ITMessages, ITMessages
|
|
|
144
223
|
|
|
145
224
|
export {
|
|
146
225
|
// Hooks
|
|
147
|
-
useClickOutside, useDebouncedSearch, useEditableRow, useFloatingPanel, useTableState,
|
|
226
|
+
useClickOutside, useDebouncedSearch, useEditableRow, useFloatingPanel, useTableState, useJsonRender,
|
|
148
227
|
createValidationSchema,
|
|
149
228
|
// Components
|
|
150
229
|
ITAccordion,
|
|
@@ -162,7 +241,17 @@ export {
|
|
|
162
241
|
useITTheme, useITThemeSafe, useITFlatAppearance, ITTimePicker, ITToast, ITWysiwyg,
|
|
163
242
|
UploadStatus, FileTypeEnum,
|
|
164
243
|
getContrastTextColor, isLightColor, resolveCssColor,
|
|
165
|
-
ITI18nProvider, useITTranslation, esMessages, enMessages
|
|
244
|
+
ITI18nProvider, useITTranslation, esMessages, enMessages,
|
|
245
|
+
ITJsonRenderer, ITJSONEditor,
|
|
246
|
+
// Motor de pantallas declarativas
|
|
247
|
+
ITSchemaRenderer, NodeBoundary, renderNode, auditTree, countPendingNodes,
|
|
248
|
+
axzyCatalog, axzyCatalogTypes, AXZY_CATALOG_ENTRIES, AXZY_EXCLUDED_TYPES,
|
|
249
|
+
createCatalog, getCatalogEntry, isExcludedType, getExclusionReason, GLOBALLY_FORBIDDEN_PROPS,
|
|
250
|
+
resolveNode, parsePartialSchema, isNodePending,
|
|
251
|
+
JsonEngineError, issue, formatPath, parsePath, readPath, hasPath, pushPath, propPath,
|
|
252
|
+
DEFAULT_LIMITS, resolveLimits, createLimitTracker,
|
|
253
|
+
validateSchema, CURRENT_SCHEMA_VERSION, migrateSchema, DEFAULT_MIGRATIONS,
|
|
254
|
+
buildVocabularyContract, formatVocabularyForPrompt,
|
|
166
255
|
};
|
|
167
256
|
|
|
168
257
|
export type {
|
|
@@ -195,6 +284,14 @@ export {
|
|
|
195
284
|
ITTripleFilterProps, ITTripleFilterOption, ITThemeConfig, ITThemeProviderProps, ITThemePalette, ITThemeAppearance,
|
|
196
285
|
ITTimePickerProps, ITToastProps,
|
|
197
286
|
ITWysiwygProps,
|
|
287
|
+
ITJsonRendererProps, JsonComponentNode, JsonComponentType,
|
|
288
|
+
ITJSONEditorProps,
|
|
289
|
+
ITJsonRenderEngineProps, ScreenSchema, NodeSchema, SchemaValue, SchemaReference, WhenSchema,
|
|
290
|
+
ActionSchema, EffectSchema, DataSourceSchema, NodeStatus, Catalog, CatalogEntry, PropSpec, PropKind,
|
|
291
|
+
ResolvedNode, UnresolvedNode, PartialParseResult, StreamState, JsonEngineIssue, JsonEngineCode,
|
|
292
|
+
JsonEngineSeverity, SchemaPath, PathSegment, EngineLimits, LimitTracker,
|
|
293
|
+
ValidationReport, ValidationVerdict, ValidateOptions, SchemaMigration, MigrationRegistry, MigrationResult,
|
|
294
|
+
VocabularyContract, ComponentContract, PropContract,
|
|
198
295
|
UseTableStateOptions, UseTableStateResult
|
|
199
296
|
};
|
|
200
297
|
|