view-contracts 0.5.6 → 0.5.8
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 +11 -1
- package/cli-contract.yaml +1 -1
- package/dist/preview.mjs +185 -185
- package/dist/preview.mjs.map +4 -4
- package/dist/view-contracts.bundle.mjs +163 -163
- package/dist/view-contracts.bundle.mjs.map +4 -4
- package/docs/cli-reference.md +1 -1
- package/package.json +8 -7
- package/spec/ui-dsl.schema.json +159 -2
package/docs/cli-reference.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "view-contracts",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.8",
|
|
4
4
|
"description": "Contract-first UI design toolchain — restricted TSX to View IR to platform renderers",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -46,6 +46,7 @@
|
|
|
46
46
|
"bundle": "node esbuild.bundle.mjs",
|
|
47
47
|
"bundle:min": "node esbuild.bundle.mjs --minify",
|
|
48
48
|
"build:views": "tsx src/cli.ts build -c examples/admin-dashboard/view-contracts.config.yaml",
|
|
49
|
+
"sync:generated": "cli-contracts version-sync && npm run build:cli && npm run schema:generate && npm run build:views",
|
|
49
50
|
"render:swiftui-prototype": "tsx scripts/render-swiftui-prototype.ts",
|
|
50
51
|
"build:example": "vite build --config examples/admin-dashboard/.vite/vite.config.ts",
|
|
51
52
|
"compile": "tsx src/cli.ts compile -c examples/admin-dashboard/view-contracts.config.yaml",
|
|
@@ -54,11 +55,11 @@
|
|
|
54
55
|
"contracts:check": "tsx src/cli.ts contracts check -c examples/admin-dashboard/view-contracts.config.yaml",
|
|
55
56
|
"schema:generate": "tsx scripts/schema-generate.ts",
|
|
56
57
|
"cli-contracts:validate": "cli-contracts validate",
|
|
58
|
+
"typecheck": "tsc -b",
|
|
57
59
|
"test": "vitest run",
|
|
58
60
|
"test:unit": "vitest run",
|
|
59
61
|
"test:smoke": "node dist/view-contracts.bundle.mjs --version && node dist/view-contracts.bundle.mjs --help",
|
|
60
62
|
"test:ci": "npm run test:unit && npm run build:publish && npm run test:smoke",
|
|
61
|
-
"version": "node -e \"const fs=require('fs');const f='cli-contract.yaml';fs.writeFileSync(f,fs.readFileSync(f,'utf8').replace(/^ version: .*/m,' version: '+process.env.npm_package_version))\" && git add cli-contract.yaml",
|
|
62
63
|
"prepublishOnly": "npm run build:publish && npm run test:ci"
|
|
63
64
|
},
|
|
64
65
|
"keywords": [
|
|
@@ -86,9 +87,9 @@
|
|
|
86
87
|
"node": ">=20.0.0"
|
|
87
88
|
},
|
|
88
89
|
"peerDependencies": {
|
|
89
|
-
"vite": "^5.0.0 || ^6.0.0",
|
|
90
90
|
"react": "^18.0.0 || ^19.0.0",
|
|
91
|
-
"react-dom": "^18.0.0 || ^19.0.0"
|
|
91
|
+
"react-dom": "^18.0.0 || ^19.0.0",
|
|
92
|
+
"vite": "^5.0.0 || ^6.0.0"
|
|
92
93
|
},
|
|
93
94
|
"peerDependenciesMeta": {
|
|
94
95
|
"vite": {
|
|
@@ -107,8 +108,8 @@
|
|
|
107
108
|
"handlebars": "^4.7.9",
|
|
108
109
|
"js-yaml": "^4.1.1",
|
|
109
110
|
"micro-contracts": "^0.17.10",
|
|
110
|
-
"react": "^19.
|
|
111
|
-
"react-dom": "^19.
|
|
111
|
+
"react": "^18.0.0 || ^19.0.0",
|
|
112
|
+
"react-dom": "^18.0.0 || ^19.0.0",
|
|
112
113
|
"typescript": "^5.9.3"
|
|
113
114
|
},
|
|
114
115
|
"devDependencies": {
|
|
@@ -119,7 +120,7 @@
|
|
|
119
120
|
"@types/react-dom": "^19.2.3",
|
|
120
121
|
"@vitejs/plugin-react": "^4.7.0",
|
|
121
122
|
"ajv": "^8.18.0",
|
|
122
|
-
"cli-contracts": "^0.
|
|
123
|
+
"cli-contracts": "^0.34.6",
|
|
123
124
|
"esbuild": "^0.28.0",
|
|
124
125
|
"pixelmatch": "^7.2.0",
|
|
125
126
|
"playwright": "^1.61.0",
|
package/spec/ui-dsl.schema.json
CHANGED
|
@@ -99,6 +99,13 @@
|
|
|
99
99
|
"password",
|
|
100
100
|
"tel"
|
|
101
101
|
],
|
|
102
|
+
"inputType": [
|
|
103
|
+
"text",
|
|
104
|
+
"password",
|
|
105
|
+
"email",
|
|
106
|
+
"url",
|
|
107
|
+
"tel"
|
|
108
|
+
],
|
|
102
109
|
"clip": [
|
|
103
110
|
"none",
|
|
104
111
|
"bounds",
|
|
@@ -268,6 +275,16 @@
|
|
|
268
275
|
"enum": "border",
|
|
269
276
|
"x-notes": "none|token|{width,color}"
|
|
270
277
|
},
|
|
278
|
+
"separator": {
|
|
279
|
+
"type": "number",
|
|
280
|
+
"x-category": "visual",
|
|
281
|
+
"x-notes": "Row separator width in px/dp/pt (0=off)"
|
|
282
|
+
},
|
|
283
|
+
"separatorColor": {
|
|
284
|
+
"type": "string",
|
|
285
|
+
"x-category": "visual",
|
|
286
|
+
"x-notes": "Row separator color token"
|
|
287
|
+
},
|
|
271
288
|
"radius": {
|
|
272
289
|
"type": "string",
|
|
273
290
|
"x-category": "visual",
|
|
@@ -338,8 +355,8 @@
|
|
|
338
355
|
},
|
|
339
356
|
"name": {
|
|
340
357
|
"type": "string",
|
|
341
|
-
"x-category": "
|
|
342
|
-
"description": "
|
|
358
|
+
"x-category": "identity",
|
|
359
|
+
"description": "Form field name (for FormData) or icon token in the renderer icon set"
|
|
343
360
|
},
|
|
344
361
|
"onClick": {
|
|
345
362
|
"type": "action",
|
|
@@ -368,6 +385,12 @@
|
|
|
368
385
|
"x-category": "interaction",
|
|
369
386
|
"enum": "keyboardType"
|
|
370
387
|
},
|
|
388
|
+
"inputType": {
|
|
389
|
+
"type": "string",
|
|
390
|
+
"x-category": "interaction",
|
|
391
|
+
"enum": "inputType",
|
|
392
|
+
"description": "HTML input type variant (text, password, email, url, tel)"
|
|
393
|
+
},
|
|
371
394
|
"value": {
|
|
372
395
|
"type": [
|
|
373
396
|
"string",
|
|
@@ -414,6 +437,47 @@
|
|
|
414
437
|
"x-category": "visual",
|
|
415
438
|
"x-notes": "active theme id for runtime theme switching"
|
|
416
439
|
},
|
|
440
|
+
"display": {
|
|
441
|
+
"type": "string",
|
|
442
|
+
"x-category": "layout",
|
|
443
|
+
"x-notes": "CSS display value (grid, flex, etc.)"
|
|
444
|
+
},
|
|
445
|
+
"gridTemplateColumns": {
|
|
446
|
+
"type": "string",
|
|
447
|
+
"x-category": "layout",
|
|
448
|
+
"x-notes": "CSS grid-template-columns"
|
|
449
|
+
},
|
|
450
|
+
"flexDirection": {
|
|
451
|
+
"type": "string",
|
|
452
|
+
"x-category": "layout",
|
|
453
|
+
"x-notes": "CSS flex-direction"
|
|
454
|
+
},
|
|
455
|
+
"alignItems": {
|
|
456
|
+
"type": "string",
|
|
457
|
+
"x-category": "alignment",
|
|
458
|
+
"x-notes": "CSS align-items"
|
|
459
|
+
},
|
|
460
|
+
"margin": {
|
|
461
|
+
"type": [
|
|
462
|
+
"string",
|
|
463
|
+
"number"
|
|
464
|
+
],
|
|
465
|
+
"x-category": "spacing",
|
|
466
|
+
"x-notes": "space token or per-side"
|
|
467
|
+
},
|
|
468
|
+
"borderColor": {
|
|
469
|
+
"type": "string",
|
|
470
|
+
"x-category": "visual",
|
|
471
|
+
"x-notes": "border color token"
|
|
472
|
+
},
|
|
473
|
+
"fontSize": {
|
|
474
|
+
"type": [
|
|
475
|
+
"string",
|
|
476
|
+
"number"
|
|
477
|
+
],
|
|
478
|
+
"x-category": "text",
|
|
479
|
+
"x-notes": "CSS font-size"
|
|
480
|
+
},
|
|
417
481
|
"flex": {
|
|
418
482
|
"type": "number",
|
|
419
483
|
"x-category": "size",
|
|
@@ -1093,6 +1157,9 @@
|
|
|
1093
1157
|
"fontWeight": {
|
|
1094
1158
|
"$ref": "#/properties/fontWeight"
|
|
1095
1159
|
},
|
|
1160
|
+
"fontSize": {
|
|
1161
|
+
"$ref": "#/properties/fontSize"
|
|
1162
|
+
},
|
|
1096
1163
|
"variant": {
|
|
1097
1164
|
"$ref": "#/properties/variant"
|
|
1098
1165
|
},
|
|
@@ -1172,6 +1239,9 @@
|
|
|
1172
1239
|
"required": {
|
|
1173
1240
|
"$ref": "#/properties/required"
|
|
1174
1241
|
},
|
|
1242
|
+
"name": {
|
|
1243
|
+
"$ref": "#/properties/name"
|
|
1244
|
+
},
|
|
1175
1245
|
"value": {
|
|
1176
1246
|
"$ref": "#/properties/value"
|
|
1177
1247
|
},
|
|
@@ -1193,6 +1263,9 @@
|
|
|
1193
1263
|
"keyboardType": {
|
|
1194
1264
|
"$ref": "#/properties/keyboardType"
|
|
1195
1265
|
},
|
|
1266
|
+
"inputType": {
|
|
1267
|
+
"$ref": "#/properties/inputType"
|
|
1268
|
+
},
|
|
1196
1269
|
"focusable": {
|
|
1197
1270
|
"$ref": "#/properties/focusable"
|
|
1198
1271
|
},
|
|
@@ -1226,6 +1299,9 @@
|
|
|
1226
1299
|
"minHeight": {
|
|
1227
1300
|
"$ref": "#/properties/minHeight"
|
|
1228
1301
|
},
|
|
1302
|
+
"fontSize": {
|
|
1303
|
+
"$ref": "#/properties/fontSize"
|
|
1304
|
+
},
|
|
1229
1305
|
"variant": {
|
|
1230
1306
|
"$ref": "#/properties/variant"
|
|
1231
1307
|
}
|
|
@@ -1254,6 +1330,9 @@
|
|
|
1254
1330
|
"required": {
|
|
1255
1331
|
"$ref": "#/properties/required"
|
|
1256
1332
|
},
|
|
1333
|
+
"name": {
|
|
1334
|
+
"$ref": "#/properties/name"
|
|
1335
|
+
},
|
|
1257
1336
|
"value": {
|
|
1258
1337
|
"$ref": "#/properties/value"
|
|
1259
1338
|
},
|
|
@@ -1275,6 +1354,9 @@
|
|
|
1275
1354
|
"focusable": {
|
|
1276
1355
|
"$ref": "#/properties/focusable"
|
|
1277
1356
|
},
|
|
1357
|
+
"width": {
|
|
1358
|
+
"$ref": "#/properties/width"
|
|
1359
|
+
},
|
|
1278
1360
|
"minHeight": {
|
|
1279
1361
|
"$ref": "#/properties/minHeight"
|
|
1280
1362
|
},
|
|
@@ -1299,6 +1381,9 @@
|
|
|
1299
1381
|
"borderColor": {
|
|
1300
1382
|
"$ref": "#/properties/borderColor"
|
|
1301
1383
|
},
|
|
1384
|
+
"fontSize": {
|
|
1385
|
+
"$ref": "#/properties/fontSize"
|
|
1386
|
+
},
|
|
1302
1387
|
"variant": {
|
|
1303
1388
|
"$ref": "#/properties/variant"
|
|
1304
1389
|
}
|
|
@@ -1324,6 +1409,9 @@
|
|
|
1324
1409
|
"required": {
|
|
1325
1410
|
"$ref": "#/properties/required"
|
|
1326
1411
|
},
|
|
1412
|
+
"name": {
|
|
1413
|
+
"$ref": "#/properties/name"
|
|
1414
|
+
},
|
|
1327
1415
|
"value": {
|
|
1328
1416
|
"$ref": "#/properties/value"
|
|
1329
1417
|
},
|
|
@@ -1369,6 +1457,9 @@
|
|
|
1369
1457
|
"minHeight": {
|
|
1370
1458
|
"$ref": "#/properties/minHeight"
|
|
1371
1459
|
},
|
|
1460
|
+
"fontSize": {
|
|
1461
|
+
"$ref": "#/properties/fontSize"
|
|
1462
|
+
},
|
|
1372
1463
|
"variant": {
|
|
1373
1464
|
"$ref": "#/properties/variant"
|
|
1374
1465
|
}
|
|
@@ -1702,6 +1793,18 @@
|
|
|
1702
1793
|
"gap": {
|
|
1703
1794
|
"$ref": "#/properties/gap"
|
|
1704
1795
|
},
|
|
1796
|
+
"border": {
|
|
1797
|
+
"$ref": "#/properties/border"
|
|
1798
|
+
},
|
|
1799
|
+
"borderColor": {
|
|
1800
|
+
"$ref": "#/properties/borderColor"
|
|
1801
|
+
},
|
|
1802
|
+
"separator": {
|
|
1803
|
+
"$ref": "#/properties/separator"
|
|
1804
|
+
},
|
|
1805
|
+
"separatorColor": {
|
|
1806
|
+
"$ref": "#/properties/separatorColor"
|
|
1807
|
+
},
|
|
1705
1808
|
"variant": {
|
|
1706
1809
|
"$ref": "#/properties/variant"
|
|
1707
1810
|
}
|
|
@@ -1722,6 +1825,18 @@
|
|
|
1722
1825
|
"height": {
|
|
1723
1826
|
"$ref": "#/properties/height"
|
|
1724
1827
|
},
|
|
1828
|
+
"border": {
|
|
1829
|
+
"$ref": "#/properties/border"
|
|
1830
|
+
},
|
|
1831
|
+
"borderColor": {
|
|
1832
|
+
"$ref": "#/properties/borderColor"
|
|
1833
|
+
},
|
|
1834
|
+
"background": {
|
|
1835
|
+
"$ref": "#/properties/background"
|
|
1836
|
+
},
|
|
1837
|
+
"alignItems": {
|
|
1838
|
+
"$ref": "#/properties/alignItems"
|
|
1839
|
+
},
|
|
1725
1840
|
"variant": {
|
|
1726
1841
|
"$ref": "#/properties/variant"
|
|
1727
1842
|
}
|
|
@@ -1750,6 +1865,24 @@
|
|
|
1750
1865
|
"align": {
|
|
1751
1866
|
"$ref": "#/properties/align"
|
|
1752
1867
|
},
|
|
1868
|
+
"border": {
|
|
1869
|
+
"$ref": "#/properties/border"
|
|
1870
|
+
},
|
|
1871
|
+
"borderColor": {
|
|
1872
|
+
"$ref": "#/properties/borderColor"
|
|
1873
|
+
},
|
|
1874
|
+
"padding": {
|
|
1875
|
+
"$ref": "#/properties/padding"
|
|
1876
|
+
},
|
|
1877
|
+
"fontSize": {
|
|
1878
|
+
"$ref": "#/properties/fontSize"
|
|
1879
|
+
},
|
|
1880
|
+
"fontWeight": {
|
|
1881
|
+
"$ref": "#/properties/fontWeight"
|
|
1882
|
+
},
|
|
1883
|
+
"foreground": {
|
|
1884
|
+
"$ref": "#/properties/foreground"
|
|
1885
|
+
},
|
|
1753
1886
|
"variant": {
|
|
1754
1887
|
"$ref": "#/properties/variant"
|
|
1755
1888
|
}
|
|
@@ -1769,6 +1902,15 @@
|
|
|
1769
1902
|
"height": {
|
|
1770
1903
|
"$ref": "#/properties/height"
|
|
1771
1904
|
},
|
|
1905
|
+
"border": {
|
|
1906
|
+
"$ref": "#/properties/border"
|
|
1907
|
+
},
|
|
1908
|
+
"borderColor": {
|
|
1909
|
+
"$ref": "#/properties/borderColor"
|
|
1910
|
+
},
|
|
1911
|
+
"alignItems": {
|
|
1912
|
+
"$ref": "#/properties/alignItems"
|
|
1913
|
+
},
|
|
1772
1914
|
"variant": {
|
|
1773
1915
|
"$ref": "#/properties/variant"
|
|
1774
1916
|
}
|
|
@@ -1794,6 +1936,21 @@
|
|
|
1794
1936
|
"align": {
|
|
1795
1937
|
"$ref": "#/properties/align"
|
|
1796
1938
|
},
|
|
1939
|
+
"border": {
|
|
1940
|
+
"$ref": "#/properties/border"
|
|
1941
|
+
},
|
|
1942
|
+
"borderColor": {
|
|
1943
|
+
"$ref": "#/properties/borderColor"
|
|
1944
|
+
},
|
|
1945
|
+
"padding": {
|
|
1946
|
+
"$ref": "#/properties/padding"
|
|
1947
|
+
},
|
|
1948
|
+
"fontSize": {
|
|
1949
|
+
"$ref": "#/properties/fontSize"
|
|
1950
|
+
},
|
|
1951
|
+
"foreground": {
|
|
1952
|
+
"$ref": "#/properties/foreground"
|
|
1953
|
+
},
|
|
1797
1954
|
"variant": {
|
|
1798
1955
|
"$ref": "#/properties/variant"
|
|
1799
1956
|
}
|