@json-layout/vocabulary 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/LICENSE +21 -0
  2. package/package.json +54 -0
  3. package/src/index.js +4 -0
  4. package/src/layout-keyword/index.js +62 -0
  5. package/src/layout-keyword/schema.js +367 -0
  6. package/src/layout-keyword/schema.json +209 -0
  7. package/src/layout-keyword/types.ts +109 -0
  8. package/src/layout-keyword/validate.js +2 -0
  9. package/src/normalize.js +313 -0
  10. package/src/normalized-layout/index.js +105 -0
  11. package/src/normalized-layout/schema.js +824 -0
  12. package/src/normalized-layout/schema.json +413 -0
  13. package/src/normalized-layout/types.ts +243 -0
  14. package/src/normalized-layout/validate.js +3 -0
  15. package/src/types.ts +19 -0
  16. package/types/index.d.ts +5 -0
  17. package/types/index.d.ts.map +1 -0
  18. package/types/layout-keyword/index.d.ts +42 -0
  19. package/types/layout-keyword/index.d.ts.map +1 -0
  20. package/types/layout-keyword/schema.d.ts +279 -0
  21. package/types/layout-keyword/schema.d.ts.map +1 -0
  22. package/types/layout-keyword/types.d.ts +90 -0
  23. package/types/layout-keyword/types.d.ts.map +1 -0
  24. package/types/layout-keyword/validate.d.ts +24 -0
  25. package/types/layout-keyword/validate.d.ts.map +1 -0
  26. package/types/normalize.d.ts +18 -0
  27. package/types/normalize.d.ts.map +1 -0
  28. package/types/normalized-layout/index.d.ts +96 -0
  29. package/types/normalized-layout/index.d.ts.map +1 -0
  30. package/types/normalized-layout/schema.d.ts +626 -0
  31. package/types/normalized-layout/schema.d.ts.map +1 -0
  32. package/types/normalized-layout/types.d.ts +221 -0
  33. package/types/normalized-layout/types.d.ts.map +1 -0
  34. package/types/normalized-layout/validate.d.ts +23 -0
  35. package/types/normalized-layout/validate.d.ts.map +1 -0
  36. package/types/types.d.ts +19 -0
  37. package/types/types.d.ts.map +1 -0
@@ -0,0 +1,824 @@
1
+
2
+ // raw schema
3
+ export default {
4
+ "$id": "https://json-layout.github.io/normalized-layout-keyword",
5
+ "title": "normalized layout",
6
+ "oneOf": [
7
+ {
8
+ "$ref": "#/$defs/switch-struct"
9
+ },
10
+ {
11
+ "$ref": "#/$defs/comp-object"
12
+ }
13
+ ],
14
+ "$defs": {
15
+ "switch-struct": {
16
+ "type": "object",
17
+ "required": [
18
+ "switch"
19
+ ],
20
+ "additionalProperties": false,
21
+ "properties": {
22
+ "switch": {
23
+ "type": "array",
24
+ "items": {
25
+ "$ref": "#/$defs/comp-object"
26
+ }
27
+ }
28
+ }
29
+ },
30
+ "comp-object": {
31
+ "type": "object",
32
+ "required": [
33
+ "comp"
34
+ ],
35
+ "unevaluatedProperties": false,
36
+ "allOf": [
37
+ {
38
+ "properties": {
39
+ "if": {
40
+ "$ref": "#/$defs/expression"
41
+ },
42
+ "help": {
43
+ "type": "string"
44
+ },
45
+ "cols": {
46
+ "$ref": "#/$defs/cols-obj"
47
+ },
48
+ "props": {
49
+ "$ref": "#/$defs/state-node-props-lib"
50
+ },
51
+ "slots": {
52
+ "type": "object",
53
+ "allOf": [
54
+ {
55
+ "$ref": "#/$defs/state-node-slots-lib"
56
+ },
57
+ {
58
+ "properties": {
59
+ "before": {
60
+ "$ref": "#/$defs/slot"
61
+ },
62
+ "after": {
63
+ "$ref": "#/$defs/slot"
64
+ },
65
+ "component": {
66
+ "$ref": "#/$defs/slot"
67
+ }
68
+ }
69
+ }
70
+ ]
71
+ },
72
+ "options": {
73
+ "$ref": "#/$defs/state-node-options"
74
+ }
75
+ }
76
+ },
77
+ {
78
+ "discriminator": {
79
+ "propertyName": "comp"
80
+ },
81
+ "oneOf": [
82
+ {
83
+ "$ref": "#/$defs/none"
84
+ },
85
+ {
86
+ "$ref": "#/$defs/list"
87
+ },
88
+ {
89
+ "$ref": "#/$defs/text-field"
90
+ },
91
+ {
92
+ "$ref": "#/$defs/number-field"
93
+ },
94
+ {
95
+ "$ref": "#/$defs/textarea"
96
+ },
97
+ {
98
+ "$ref": "#/$defs/checkbox"
99
+ },
100
+ {
101
+ "$ref": "#/$defs/switch"
102
+ },
103
+ {
104
+ "$ref": "#/$defs/slider"
105
+ },
106
+ {
107
+ "$ref": "#/$defs/date-picker"
108
+ },
109
+ {
110
+ "$ref": "#/$defs/date-time-picker"
111
+ },
112
+ {
113
+ "$ref": "#/$defs/time-picker"
114
+ },
115
+ {
116
+ "$ref": "#/$defs/color-picker"
117
+ },
118
+ {
119
+ "$ref": "#/$defs/select"
120
+ },
121
+ {
122
+ "$ref": "#/$defs/one-of-select"
123
+ },
124
+ {
125
+ "$ref": "#/$defs/section"
126
+ },
127
+ {
128
+ "$ref": "#/$defs/tabs"
129
+ },
130
+ {
131
+ "$ref": "#/$defs/vertical-tabs"
132
+ },
133
+ {
134
+ "$ref": "#/$defs/expansion-panels"
135
+ }
136
+ ]
137
+ }
138
+ ]
139
+ },
140
+ "composite-comp-object": {
141
+ "type": "object",
142
+ "discriminator": {
143
+ "propertyName": "comp"
144
+ },
145
+ "oneOf": [
146
+ {
147
+ "$ref": "#/$defs/section"
148
+ },
149
+ {
150
+ "$ref": "#/$defs/tabs"
151
+ },
152
+ {
153
+ "$ref": "#/$defs/vertical-tabs"
154
+ },
155
+ {
156
+ "$ref": "#/$defs/expansion-panels"
157
+ }
158
+ ]
159
+ },
160
+ "none": {
161
+ "type": "object",
162
+ "required": [
163
+ "comp"
164
+ ],
165
+ "properties": {
166
+ "comp": {
167
+ "const": "none"
168
+ }
169
+ }
170
+ },
171
+ "section": {
172
+ "type": "object",
173
+ "required": [
174
+ "comp",
175
+ "children"
176
+ ],
177
+ "properties": {
178
+ "comp": {
179
+ "const": "section"
180
+ },
181
+ "title": {
182
+ "type": [
183
+ "string",
184
+ "null"
185
+ ]
186
+ },
187
+ "subtitle": {
188
+ "type": [
189
+ "string",
190
+ "null"
191
+ ]
192
+ },
193
+ "children": {
194
+ "$ref": "#/$defs/children"
195
+ }
196
+ }
197
+ },
198
+ "tabs": {
199
+ "type": "object",
200
+ "required": [
201
+ "comp",
202
+ "children"
203
+ ],
204
+ "properties": {
205
+ "comp": {
206
+ "const": "tabs"
207
+ },
208
+ "title": {
209
+ "type": [
210
+ "string",
211
+ "null"
212
+ ]
213
+ },
214
+ "subtitle": {
215
+ "type": [
216
+ "string",
217
+ "null"
218
+ ]
219
+ },
220
+ "children": {
221
+ "$ref": "#/$defs/children"
222
+ }
223
+ }
224
+ },
225
+ "vertical-tabs": {
226
+ "type": "object",
227
+ "required": [
228
+ "comp",
229
+ "children"
230
+ ],
231
+ "properties": {
232
+ "comp": {
233
+ "const": "vertical-tabs"
234
+ },
235
+ "title": {
236
+ "type": [
237
+ "string",
238
+ "null"
239
+ ]
240
+ },
241
+ "subtitle": {
242
+ "type": [
243
+ "string",
244
+ "null"
245
+ ]
246
+ },
247
+ "children": {
248
+ "$ref": "#/$defs/children"
249
+ }
250
+ }
251
+ },
252
+ "expansion-panels": {
253
+ "type": "object",
254
+ "required": [
255
+ "comp",
256
+ "children"
257
+ ],
258
+ "properties": {
259
+ "comp": {
260
+ "const": "expansion-panels"
261
+ },
262
+ "title": {
263
+ "type": [
264
+ "string",
265
+ "null"
266
+ ]
267
+ },
268
+ "subtitle": {
269
+ "type": [
270
+ "string",
271
+ "null"
272
+ ]
273
+ },
274
+ "children": {
275
+ "$ref": "#/$defs/children"
276
+ }
277
+ }
278
+ },
279
+ "child": {
280
+ "type": "object",
281
+ "unevaluatedProperties": false,
282
+ "required": [
283
+ "key"
284
+ ],
285
+ "properties": {
286
+ "key": {
287
+ "type": [
288
+ "string",
289
+ "integer"
290
+ ]
291
+ },
292
+ "cols": {
293
+ "$ref": "#/$defs/cols-obj"
294
+ }
295
+ },
296
+ "anyOf": [
297
+ {},
298
+ {
299
+ "$ref": "#/$defs/composite-comp-object"
300
+ }
301
+ ]
302
+ },
303
+ "children": {
304
+ "type": "array",
305
+ "items": {
306
+ "$ref": "#/$defs/child"
307
+ }
308
+ },
309
+ "list": {
310
+ "type": "object",
311
+ "required": [
312
+ "comp",
313
+ "listEditMode",
314
+ "listActions"
315
+ ],
316
+ "properties": {
317
+ "comp": {
318
+ "const": "list"
319
+ },
320
+ "title": {
321
+ "type": "string"
322
+ },
323
+ "listEditMode": {
324
+ "type": "string",
325
+ "enum": [
326
+ "inline",
327
+ "inline-single",
328
+ "menu",
329
+ "dialog"
330
+ ]
331
+ },
332
+ "listActions": {
333
+ "type": "array",
334
+ "items": {
335
+ "type": "string",
336
+ "enum": [
337
+ "add",
338
+ "edit",
339
+ "delete",
340
+ "sort",
341
+ "duplicate"
342
+ ]
343
+ }
344
+ },
345
+ "itemTitle": {
346
+ "$ref": "#/$defs/expression"
347
+ },
348
+ "itemSubtitle": {
349
+ "$ref": "#/$defs/expression"
350
+ },
351
+ "messages": {
352
+ "type": "object",
353
+ "additionalProperties": false,
354
+ "properties": {
355
+ "addItem": {
356
+ "type": "string"
357
+ },
358
+ "delete": {
359
+ "type": "string"
360
+ },
361
+ "edit": {
362
+ "type": "string"
363
+ },
364
+ "duplicate": {
365
+ "type": "string"
366
+ },
367
+ "sort": {
368
+ "type": "string"
369
+ }
370
+ }
371
+ }
372
+ }
373
+ },
374
+ "text-field": {
375
+ "type": "object",
376
+ "required": [
377
+ "comp",
378
+ "label"
379
+ ],
380
+ "properties": {
381
+ "comp": {
382
+ "const": "text-field"
383
+ },
384
+ "label": {
385
+ "type": "string"
386
+ }
387
+ }
388
+ },
389
+ "number-field": {
390
+ "type": "object",
391
+ "required": [
392
+ "comp",
393
+ "label"
394
+ ],
395
+ "properties": {
396
+ "comp": {
397
+ "const": "number-field"
398
+ },
399
+ "label": {
400
+ "type": "string"
401
+ },
402
+ "step": {
403
+ "type": "number"
404
+ },
405
+ "min": {
406
+ "type": "number"
407
+ },
408
+ "max": {
409
+ "type": "number"
410
+ }
411
+ }
412
+ },
413
+ "textarea": {
414
+ "type": "object",
415
+ "required": [
416
+ "comp",
417
+ "label"
418
+ ],
419
+ "properties": {
420
+ "comp": {
421
+ "const": "textarea"
422
+ },
423
+ "label": {
424
+ "type": "string"
425
+ }
426
+ }
427
+ },
428
+ "checkbox": {
429
+ "type": "object",
430
+ "required": [
431
+ "comp",
432
+ "label"
433
+ ],
434
+ "properties": {
435
+ "comp": {
436
+ "const": "checkbox"
437
+ },
438
+ "label": {
439
+ "type": "string"
440
+ }
441
+ }
442
+ },
443
+ "switch": {
444
+ "type": "object",
445
+ "required": [
446
+ "comp",
447
+ "label"
448
+ ],
449
+ "properties": {
450
+ "comp": {
451
+ "const": "switch"
452
+ },
453
+ "label": {
454
+ "type": "string"
455
+ }
456
+ }
457
+ },
458
+ "slider": {
459
+ "type": "object",
460
+ "required": [
461
+ "comp",
462
+ "label",
463
+ "min",
464
+ "max"
465
+ ],
466
+ "properties": {
467
+ "comp": {
468
+ "const": "slider"
469
+ },
470
+ "label": {
471
+ "type": "string"
472
+ },
473
+ "step": {
474
+ "type": "number"
475
+ },
476
+ "min": {
477
+ "type": "number"
478
+ },
479
+ "max": {
480
+ "type": "number"
481
+ }
482
+ }
483
+ },
484
+ "date-picker": {
485
+ "type": "object",
486
+ "required": [
487
+ "comp",
488
+ "label"
489
+ ],
490
+ "properties": {
491
+ "comp": {
492
+ "const": "date-picker"
493
+ },
494
+ "label": {
495
+ "type": "string"
496
+ },
497
+ "min": {
498
+ "type": "string",
499
+ "format": "date"
500
+ },
501
+ "max": {
502
+ "type": "string",
503
+ "format": "date"
504
+ },
505
+ "format": {
506
+ "type": "string",
507
+ "enum": [
508
+ "date",
509
+ "date-time"
510
+ ],
511
+ "default": "date"
512
+ }
513
+ }
514
+ },
515
+ "date-time-picker": {
516
+ "type": "object",
517
+ "required": [
518
+ "comp",
519
+ "label"
520
+ ],
521
+ "properties": {
522
+ "comp": {
523
+ "const": "date-time-picker"
524
+ },
525
+ "label": {
526
+ "type": "string"
527
+ },
528
+ "min": {
529
+ "type": "string",
530
+ "format": "date-time"
531
+ },
532
+ "max": {
533
+ "type": "string",
534
+ "format": "date-time"
535
+ }
536
+ }
537
+ },
538
+ "time-picker": {
539
+ "type": "object",
540
+ "required": [
541
+ "comp",
542
+ "label"
543
+ ],
544
+ "properties": {
545
+ "comp": {
546
+ "const": "time-picker"
547
+ },
548
+ "label": {
549
+ "type": "string"
550
+ },
551
+ "min": {
552
+ "type": "string",
553
+ "format": "time"
554
+ },
555
+ "max": {
556
+ "type": "string",
557
+ "format": "time"
558
+ }
559
+ }
560
+ },
561
+ "color-picker": {
562
+ "type": "object",
563
+ "required": [
564
+ "comp",
565
+ "label"
566
+ ],
567
+ "properties": {
568
+ "comp": {
569
+ "const": "color-picker"
570
+ },
571
+ "label": {
572
+ "type": "string"
573
+ }
574
+ }
575
+ },
576
+ "select": {
577
+ "type": "object",
578
+ "required": [
579
+ "comp",
580
+ "label"
581
+ ],
582
+ "properties": {
583
+ "comp": {
584
+ "const": "select"
585
+ },
586
+ "label": {
587
+ "type": "string"
588
+ },
589
+ "items": {
590
+ "$ref": "#/$defs/select-items"
591
+ },
592
+ "getItems": {
593
+ "$ref": "#/$defs/get-items"
594
+ }
595
+ }
596
+ },
597
+ "select-items": {
598
+ "type": "array",
599
+ "items": {
600
+ "$ref": "#/$defs/select-item"
601
+ }
602
+ },
603
+ "select-item": {
604
+ "type": "object",
605
+ "required": [
606
+ "title",
607
+ "key",
608
+ "value"
609
+ ],
610
+ "properties": {
611
+ "title": {
612
+ "type": "string"
613
+ },
614
+ "key": {
615
+ "type": "string"
616
+ },
617
+ "value": {}
618
+ }
619
+ },
620
+ "get-items": {
621
+ "type": "object",
622
+ "properties": {
623
+ "returnObjects": {
624
+ "type": "boolean",
625
+ "readOnly": true
626
+ },
627
+ "itemsResults": {
628
+ "$ref": "#/$defs/expression"
629
+ },
630
+ "itemTitle": {
631
+ "$ref": "#/$defs/expression"
632
+ },
633
+ "itemKey": {
634
+ "$ref": "#/$defs/expression"
635
+ },
636
+ "itemValue": {
637
+ "$ref": "#/$defs/expression"
638
+ }
639
+ },
640
+ "oneOf": [
641
+ {
642
+ "$ref": "#/$defs/expression"
643
+ },
644
+ {
645
+ "$ref": "#/$defs/get-items-fetch"
646
+ }
647
+ ]
648
+ },
649
+ "get-items-fetch": {
650
+ "type": "object",
651
+ "required": [
652
+ "url"
653
+ ],
654
+ "properties": {
655
+ "url": {
656
+ "$ref": "#/$defs/expression"
657
+ }
658
+ }
659
+ },
660
+ "one-of-select": {
661
+ "type": "object",
662
+ "required": [
663
+ "comp"
664
+ ],
665
+ "properties": {
666
+ "comp": {
667
+ "const": "one-of-select"
668
+ },
669
+ "if": {
670
+ "$ref": "#/$defs/expression"
671
+ },
672
+ "label": {
673
+ "type": "string"
674
+ },
675
+ "help": {
676
+ "type": "string"
677
+ }
678
+ }
679
+ },
680
+ "expression": {
681
+ "type": "object",
682
+ "required": [
683
+ "type",
684
+ "expr"
685
+ ],
686
+ "properties": {
687
+ "type": {
688
+ "type": "string",
689
+ "enum": [
690
+ "js-fn",
691
+ "js-eval",
692
+ "js-tpl"
693
+ ]
694
+ },
695
+ "expr": {
696
+ "type": "string"
697
+ },
698
+ "ref": {
699
+ "type": "integer",
700
+ "readOnly": true
701
+ }
702
+ }
703
+ },
704
+ "cols-obj": {
705
+ "type": "object",
706
+ "additionalProperties": false,
707
+ "required": [
708
+ "xs"
709
+ ],
710
+ "properties": {
711
+ "xs": {
712
+ "$ref": "#/$defs/cols",
713
+ "default": 12
714
+ },
715
+ "sm": {
716
+ "$ref": "#/$defs/cols"
717
+ },
718
+ "md": {
719
+ "$ref": "#/$defs/cols"
720
+ },
721
+ "lg": {
722
+ "$ref": "#/$defs/cols"
723
+ },
724
+ "xl": {
725
+ "$ref": "#/$defs/cols"
726
+ },
727
+ "xxl": {
728
+ "$ref": "#/$defs/cols"
729
+ }
730
+ }
731
+ },
732
+ "cols": {
733
+ "type": "integer",
734
+ "minimum": 0,
735
+ "maximum": 12
736
+ },
737
+ "slot": {
738
+ "oneOf": [
739
+ {
740
+ "type": "object",
741
+ "additionalProperties": false,
742
+ "required": [
743
+ "text"
744
+ ],
745
+ "properties": {
746
+ "text": {
747
+ "type": "string"
748
+ }
749
+ }
750
+ },
751
+ {
752
+ "type": "object",
753
+ "additionalProperties": false,
754
+ "required": [
755
+ "markdown"
756
+ ],
757
+ "properties": {
758
+ "markdown": {
759
+ "type": "string"
760
+ }
761
+ }
762
+ },
763
+ {
764
+ "type": "object",
765
+ "additionalProperties": false,
766
+ "required": [
767
+ "name"
768
+ ],
769
+ "properties": {
770
+ "name": {
771
+ "type": "string"
772
+ }
773
+ }
774
+ }
775
+ ]
776
+ },
777
+ "state-node-options": {
778
+ "type": "object",
779
+ "allOf": [
780
+ {
781
+ "$ref": "#/$defs/state-node-options-lib"
782
+ },
783
+ {
784
+ "properties": {
785
+ "readOnly": {
786
+ "type": "boolean",
787
+ "default": false
788
+ },
789
+ "summary": {
790
+ "type": "boolean",
791
+ "default": false
792
+ },
793
+ "titleDepth": {
794
+ "type": "integer",
795
+ "minimum": 1,
796
+ "maximum": 6,
797
+ "default": 2
798
+ }
799
+ }
800
+ }
801
+ ]
802
+ },
803
+ "state-node-options-lib": {
804
+ "type": "object",
805
+ "patternProperties": {
806
+ ".*": {}
807
+ }
808
+ },
809
+ "state-node-props-lib": {
810
+ "type": "object",
811
+ "patternProperties": {
812
+ ".*": {}
813
+ }
814
+ },
815
+ "state-node-slots-lib": {
816
+ "type": "object",
817
+ "patternProperties": {
818
+ ".*": {
819
+ "$ref": "#/$defs/slot"
820
+ }
821
+ }
822
+ }
823
+ }
824
+ }