uidl-runtime 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 (83) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +175 -0
  3. package/bin/validate.mjs +44 -0
  4. package/dist/actions/eventBus.d.ts +7 -0
  5. package/dist/actions/index.d.ts +5 -0
  6. package/dist/actions/interpreter.d.ts +54 -0
  7. package/dist/compiler/dashboard.d.ts +10 -0
  8. package/dist/compiler/form.d.ts +22 -0
  9. package/dist/compiler/index.d.ts +16 -0
  10. package/dist/compiler/list.d.ts +20 -0
  11. package/dist/compiler/report.d.ts +10 -0
  12. package/dist/compiler/settings.d.ts +10 -0
  13. package/dist/compiler/tree.d.ts +10 -0
  14. package/dist/compiler/types.d.ts +315 -0
  15. package/dist/compiler/wizard.d.ts +10 -0
  16. package/dist/components/BarcodeAndQRCode.d.ts +29 -0
  17. package/dist/components/charts.d.ts +66 -0
  18. package/dist/components/iconPaths.d.ts +5 -0
  19. package/dist/components/icons.d.ts +31 -0
  20. package/dist/components/primitives.d.ts +411 -0
  21. package/dist/data/adapters/http.d.ts +37 -0
  22. package/dist/data/adapters/inMemory.d.ts +62 -0
  23. package/dist/data/errors.d.ts +15 -0
  24. package/dist/data/index.d.ts +7 -0
  25. package/dist/data/testing/mockHttpServer.d.ts +16 -0
  26. package/dist/data/types.d.ts +74 -0
  27. package/dist/editor/Canvas.d.ts +22 -0
  28. package/dist/editor/Editor.d.ts +18 -0
  29. package/dist/editor/LayerTree.d.ts +12 -0
  30. package/dist/editor/PropertyPanel.d.ts +7 -0
  31. package/dist/editor/StylePanel.d.ts +7 -0
  32. package/dist/editor/ValidationStatus.d.ts +9 -0
  33. package/dist/editor/WidgetPalette.d.ts +6 -0
  34. package/dist/editor/document.d.ts +10 -0
  35. package/dist/editor/index.d.ts +2 -0
  36. package/dist/editor/store.d.ts +46 -0
  37. package/dist/expr/evaluate.d.ts +51 -0
  38. package/dist/hooks/useElementWidth.d.ts +14 -0
  39. package/dist/index.d.ts +61 -0
  40. package/dist/registry/defaults.d.ts +2 -0
  41. package/dist/registry/registry.d.ts +4 -0
  42. package/dist/renderer/RenderNode.d.ts +16 -0
  43. package/dist/renderer/UIDocumentRenderer.d.ts +13 -0
  44. package/dist/renderer/instantiateComponent.d.ts +18 -0
  45. package/dist/renderer/renderDocument.d.ts +63 -0
  46. package/dist/schema/action.schema.json +515 -0
  47. package/dist/schema/design-tokens.schema.json +51 -0
  48. package/dist/schema/jsonSchema.d.ts +11 -0
  49. package/dist/schema/theme-presets.schema.json +952 -0
  50. package/dist/schema/uidl-document.schema.json +187 -0
  51. package/dist/schemas/actions.d.ts +5 -0
  52. package/dist/schemas/document.d.ts +35 -0
  53. package/dist/schemas/theme.d.ts +260 -0
  54. package/dist/services/aiPromptGenerator.d.ts +11 -0
  55. package/dist/state/createDocumentState.d.ts +18 -0
  56. package/dist/state/dataSources.d.ts +58 -0
  57. package/dist/state/index.d.ts +4 -0
  58. package/dist/style.css +2 -0
  59. package/dist/theme/engine.d.ts +9 -0
  60. package/dist/theme/index.d.ts +7 -0
  61. package/dist/theme/meridianPreset.d.ts +5 -0
  62. package/dist/theme/presets.d.ts +5 -0
  63. package/dist/theme/registry.d.ts +15 -0
  64. package/dist/theme/serialize.d.ts +5 -0
  65. package/dist/theme/tailwind.d.ts +11 -0
  66. package/dist/types/actions.d.ts +116 -0
  67. package/dist/types/editor.d.ts +45 -0
  68. package/dist/types/index.d.ts +82 -0
  69. package/dist/types/theme.d.ts +95 -0
  70. package/dist/uidl-runtime.js +98 -0
  71. package/dist/uidl-runtime.js.map +1 -0
  72. package/dist/uidl-runtime.mjs +17779 -0
  73. package/dist/uidl-runtime.mjs.map +1 -0
  74. package/dist/utils/chart.d.ts +12 -0
  75. package/dist/utils/cn.d.ts +1 -0
  76. package/dist/utils/formLayout.d.ts +93 -0
  77. package/dist/utils/i18n.d.ts +132 -0
  78. package/dist/utils/listCell.d.ts +21 -0
  79. package/dist/utils/responsive.d.ts +3 -0
  80. package/dist/utils/tailwind.d.ts +23 -0
  81. package/dist/validate/validateResponsive.d.ts +7 -0
  82. package/dist/version.d.ts +10 -0
  83. package/package.json +109 -0
@@ -0,0 +1,515 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "anyOf": [
4
+ {
5
+ "type": "object",
6
+ "properties": {
7
+ "setState": {
8
+ "type": "object",
9
+ "properties": {
10
+ "path": {
11
+ "type": "string"
12
+ },
13
+ "value": {}
14
+ },
15
+ "required": [
16
+ "path",
17
+ "value"
18
+ ],
19
+ "additionalProperties": false
20
+ }
21
+ },
22
+ "required": [
23
+ "setState"
24
+ ],
25
+ "additionalProperties": false
26
+ },
27
+ {
28
+ "type": "object",
29
+ "properties": {
30
+ "navigate": {
31
+ "type": "object",
32
+ "properties": {
33
+ "route": {
34
+ "anyOf": [
35
+ {
36
+ "type": "string"
37
+ },
38
+ {
39
+ "type": "object",
40
+ "propertyNames": {
41
+ "type": "string"
42
+ },
43
+ "additionalProperties": {}
44
+ }
45
+ ]
46
+ }
47
+ },
48
+ "required": [
49
+ "route"
50
+ ],
51
+ "additionalProperties": false
52
+ }
53
+ },
54
+ "required": [
55
+ "navigate"
56
+ ],
57
+ "additionalProperties": false
58
+ },
59
+ {
60
+ "type": "object",
61
+ "properties": {
62
+ "api": {
63
+ "type": "object",
64
+ "properties": {
65
+ "url": {
66
+ "type": "string"
67
+ },
68
+ "method": {
69
+ "type": "string",
70
+ "enum": [
71
+ "GET",
72
+ "POST",
73
+ "PUT",
74
+ "DELETE"
75
+ ]
76
+ },
77
+ "body": {
78
+ "type": "object",
79
+ "propertyNames": {
80
+ "type": "string"
81
+ },
82
+ "additionalProperties": {}
83
+ },
84
+ "dataSource": {
85
+ "type": "string"
86
+ }
87
+ },
88
+ "required": [
89
+ "url",
90
+ "method"
91
+ ],
92
+ "additionalProperties": false
93
+ }
94
+ },
95
+ "required": [
96
+ "api"
97
+ ],
98
+ "additionalProperties": false
99
+ },
100
+ {
101
+ "type": "object",
102
+ "properties": {
103
+ "mutate": {
104
+ "type": "object",
105
+ "properties": {
106
+ "operation": {
107
+ "type": "string",
108
+ "enum": [
109
+ "create",
110
+ "update",
111
+ "delete",
112
+ "transition"
113
+ ]
114
+ },
115
+ "collection": {
116
+ "anyOf": [
117
+ {
118
+ "type": "string"
119
+ },
120
+ {
121
+ "type": "object",
122
+ "properties": {
123
+ "$bind": {
124
+ "type": "string"
125
+ }
126
+ },
127
+ "required": [
128
+ "$bind"
129
+ ],
130
+ "additionalProperties": false
131
+ },
132
+ {
133
+ "type": "object",
134
+ "properties": {
135
+ "$expr": {}
136
+ },
137
+ "required": [
138
+ "$expr"
139
+ ],
140
+ "additionalProperties": false
141
+ }
142
+ ]
143
+ },
144
+ "id": {
145
+ "anyOf": [
146
+ {
147
+ "type": "string"
148
+ },
149
+ {
150
+ "type": "number"
151
+ },
152
+ {
153
+ "type": "object",
154
+ "properties": {
155
+ "$bind": {
156
+ "type": "string"
157
+ }
158
+ },
159
+ "required": [
160
+ "$bind"
161
+ ],
162
+ "additionalProperties": false
163
+ },
164
+ {
165
+ "type": "object",
166
+ "properties": {
167
+ "$expr": {}
168
+ },
169
+ "required": [
170
+ "$expr"
171
+ ],
172
+ "additionalProperties": false
173
+ }
174
+ ]
175
+ },
176
+ "payload": {
177
+ "anyOf": [
178
+ {
179
+ "type": "object",
180
+ "propertyNames": {
181
+ "type": "string"
182
+ },
183
+ "additionalProperties": {}
184
+ },
185
+ {
186
+ "type": "object",
187
+ "properties": {
188
+ "$bind": {
189
+ "type": "string"
190
+ }
191
+ },
192
+ "required": [
193
+ "$bind"
194
+ ],
195
+ "additionalProperties": false
196
+ },
197
+ {
198
+ "type": "object",
199
+ "properties": {
200
+ "$expr": {}
201
+ },
202
+ "required": [
203
+ "$expr"
204
+ ],
205
+ "additionalProperties": false
206
+ }
207
+ ]
208
+ },
209
+ "transition": {
210
+ "anyOf": [
211
+ {
212
+ "type": "string"
213
+ },
214
+ {
215
+ "type": "object",
216
+ "properties": {
217
+ "$bind": {
218
+ "type": "string"
219
+ }
220
+ },
221
+ "required": [
222
+ "$bind"
223
+ ],
224
+ "additionalProperties": false
225
+ },
226
+ {
227
+ "type": "object",
228
+ "properties": {
229
+ "$expr": {}
230
+ },
231
+ "required": [
232
+ "$expr"
233
+ ],
234
+ "additionalProperties": false
235
+ }
236
+ ]
237
+ },
238
+ "version": {
239
+ "anyOf": [
240
+ {
241
+ "type": "number"
242
+ },
243
+ {
244
+ "type": "object",
245
+ "properties": {
246
+ "$bind": {
247
+ "type": "string"
248
+ }
249
+ },
250
+ "required": [
251
+ "$bind"
252
+ ],
253
+ "additionalProperties": false
254
+ },
255
+ {
256
+ "type": "object",
257
+ "properties": {
258
+ "$expr": {}
259
+ },
260
+ "required": [
261
+ "$expr"
262
+ ],
263
+ "additionalProperties": false
264
+ }
265
+ ]
266
+ },
267
+ "resultPath": {
268
+ "type": "string"
269
+ },
270
+ "errorPath": {
271
+ "type": "string"
272
+ },
273
+ "fieldErrorsPath": {
274
+ "type": "string"
275
+ },
276
+ "statusPath": {
277
+ "type": "string"
278
+ },
279
+ "onSuccess": {
280
+ "$ref": "#"
281
+ },
282
+ "onError": {
283
+ "$ref": "#"
284
+ }
285
+ },
286
+ "required": [
287
+ "operation",
288
+ "collection"
289
+ ],
290
+ "additionalProperties": false
291
+ }
292
+ },
293
+ "required": [
294
+ "mutate"
295
+ ],
296
+ "additionalProperties": false
297
+ },
298
+ {
299
+ "type": "object",
300
+ "properties": {
301
+ "command": {
302
+ "type": "object",
303
+ "properties": {
304
+ "name": {
305
+ "anyOf": [
306
+ {
307
+ "type": "string"
308
+ },
309
+ {
310
+ "type": "object",
311
+ "properties": {
312
+ "$bind": {
313
+ "type": "string"
314
+ }
315
+ },
316
+ "required": [
317
+ "$bind"
318
+ ],
319
+ "additionalProperties": false
320
+ },
321
+ {
322
+ "type": "object",
323
+ "properties": {
324
+ "$expr": {}
325
+ },
326
+ "required": [
327
+ "$expr"
328
+ ],
329
+ "additionalProperties": false
330
+ }
331
+ ]
332
+ },
333
+ "payload": {
334
+ "anyOf": [
335
+ {
336
+ "type": "object",
337
+ "propertyNames": {
338
+ "type": "string"
339
+ },
340
+ "additionalProperties": {}
341
+ },
342
+ {
343
+ "type": "object",
344
+ "properties": {
345
+ "$bind": {
346
+ "type": "string"
347
+ }
348
+ },
349
+ "required": [
350
+ "$bind"
351
+ ],
352
+ "additionalProperties": false
353
+ },
354
+ {
355
+ "type": "object",
356
+ "properties": {
357
+ "$expr": {}
358
+ },
359
+ "required": [
360
+ "$expr"
361
+ ],
362
+ "additionalProperties": false
363
+ }
364
+ ]
365
+ },
366
+ "resultPath": {
367
+ "type": "string"
368
+ },
369
+ "errorPath": {
370
+ "type": "string"
371
+ },
372
+ "statusPath": {
373
+ "type": "string"
374
+ },
375
+ "onSuccess": {
376
+ "$ref": "#"
377
+ },
378
+ "onError": {
379
+ "$ref": "#"
380
+ }
381
+ },
382
+ "required": [
383
+ "name"
384
+ ],
385
+ "additionalProperties": false
386
+ }
387
+ },
388
+ "required": [
389
+ "command"
390
+ ],
391
+ "additionalProperties": false
392
+ },
393
+ {
394
+ "type": "object",
395
+ "properties": {
396
+ "showSnackbar": {
397
+ "type": "object",
398
+ "properties": {
399
+ "message": {
400
+ "type": "string"
401
+ },
402
+ "duration": {
403
+ "type": "number"
404
+ }
405
+ },
406
+ "required": [
407
+ "message"
408
+ ],
409
+ "additionalProperties": false
410
+ }
411
+ },
412
+ "required": [
413
+ "showSnackbar"
414
+ ],
415
+ "additionalProperties": false
416
+ },
417
+ {
418
+ "type": "object",
419
+ "properties": {
420
+ "showDialog": {
421
+ "type": "object",
422
+ "properties": {
423
+ "title": {
424
+ "type": "string"
425
+ },
426
+ "content": {
427
+ "type": "string"
428
+ }
429
+ },
430
+ "required": [
431
+ "title",
432
+ "content"
433
+ ],
434
+ "additionalProperties": false
435
+ }
436
+ },
437
+ "required": [
438
+ "showDialog"
439
+ ],
440
+ "additionalProperties": false
441
+ },
442
+ {
443
+ "type": "object",
444
+ "properties": {
445
+ "validate": {
446
+ "type": "object",
447
+ "properties": {
448
+ "fields": {
449
+ "type": "array",
450
+ "items": {
451
+ "type": "string"
452
+ }
453
+ }
454
+ },
455
+ "required": [
456
+ "fields"
457
+ ],
458
+ "additionalProperties": false
459
+ }
460
+ },
461
+ "required": [
462
+ "validate"
463
+ ],
464
+ "additionalProperties": false
465
+ },
466
+ {
467
+ "type": "object",
468
+ "properties": {
469
+ "sequence": {
470
+ "type": "array",
471
+ "items": {
472
+ "$ref": "#"
473
+ }
474
+ }
475
+ },
476
+ "required": [
477
+ "sequence"
478
+ ],
479
+ "additionalProperties": false
480
+ },
481
+ {
482
+ "type": "object",
483
+ "properties": {
484
+ "if": {
485
+ "type": "object",
486
+ "properties": {
487
+ "condition": {
488
+ "type": "object",
489
+ "propertyNames": {
490
+ "type": "string"
491
+ },
492
+ "additionalProperties": {}
493
+ },
494
+ "then": {
495
+ "$ref": "#"
496
+ },
497
+ "else": {
498
+ "$ref": "#"
499
+ }
500
+ },
501
+ "required": [
502
+ "condition",
503
+ "then"
504
+ ],
505
+ "additionalProperties": false
506
+ }
507
+ },
508
+ "required": [
509
+ "if"
510
+ ],
511
+ "additionalProperties": false
512
+ }
513
+ ],
514
+ "$id": "https://uidl-runtime.local/schema/action.schema.json"
515
+ }
@@ -0,0 +1,51 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "type": "object",
4
+ "properties": {
5
+ "color": {
6
+ "type": "object",
7
+ "propertyNames": {
8
+ "type": "string"
9
+ },
10
+ "additionalProperties": {
11
+ "type": "string"
12
+ }
13
+ },
14
+ "font": {
15
+ "type": "object",
16
+ "propertyNames": {
17
+ "type": "string"
18
+ },
19
+ "additionalProperties": {
20
+ "type": "string"
21
+ }
22
+ },
23
+ "spacing": {
24
+ "type": "object",
25
+ "propertyNames": {
26
+ "type": "string"
27
+ },
28
+ "additionalProperties": {
29
+ "type": "string"
30
+ }
31
+ },
32
+ "radius": {
33
+ "type": "object",
34
+ "propertyNames": {
35
+ "type": "string"
36
+ },
37
+ "additionalProperties": {
38
+ "type": "string"
39
+ }
40
+ },
41
+ "shadow": {
42
+ "type": "object",
43
+ "propertyNames": {
44
+ "type": "string"
45
+ },
46
+ "additionalProperties": {}
47
+ }
48
+ },
49
+ "additionalProperties": false,
50
+ "$id": "https://uidl-runtime.local/schema/design-tokens.schema.json"
51
+ }
@@ -0,0 +1,11 @@
1
+ export interface JsonSchemaExport {
2
+ filename: string;
3
+ id: string;
4
+ schema: Record<string, unknown>;
5
+ }
6
+ /**
7
+ * Generates standalone JSON Schema (draft 2020-12) documents for every public
8
+ * UIDL contract, so non-TypeScript hosts and AI agents can validate documents
9
+ * without depending on this package's Zod schemas directly.
10
+ */
11
+ export declare function generateJsonSchemas(): JsonSchemaExport[];