create-kerf-component 5.0.0-beta.7 → 5.0.0-beta.70
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 +75 -3
- package/catalog.js +937 -0
- package/component-composition.schema.json +399 -0
- package/component-metadata.schema.json +282 -0
- package/index.js +30 -3
- package/package.json +9 -2
- package/template/README.md +53 -10
- package/template/component-composition.json +144 -0
- package/template/kerf.components.json +71 -0
- package/template/package.json +15 -3
- package/template/src/counter.css +38 -0
- package/template/src/counter.tsx +18 -3
|
@@ -0,0 +1,399 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://raw.githubusercontent.com/brianwestphal/kerf/main/ui/ai/component-composition.schema.json",
|
|
4
|
+
"title": "Kerf UI composition catalog",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"required": ["schemaVersion", "package", "compatibility", "entries"],
|
|
7
|
+
"properties": {
|
|
8
|
+
"$schema": { "type": "string" },
|
|
9
|
+
"schemaVersion": {
|
|
10
|
+
"const": 1,
|
|
11
|
+
"description": "Version of the composition catalog format itself, independent of component-catalog.json's own schemaVersion."
|
|
12
|
+
},
|
|
13
|
+
"package": { "type": "string", "minLength": 1 },
|
|
14
|
+
"compatibility": {
|
|
15
|
+
"type": "object",
|
|
16
|
+
"required": ["componentCatalog", "identity"],
|
|
17
|
+
"properties": {
|
|
18
|
+
"componentCatalog": {
|
|
19
|
+
"type": "string",
|
|
20
|
+
"minLength": 1,
|
|
21
|
+
"description": "Relative path to the component (selection) catalog this composition layer describes, or \"not-applicable\" when the package publishes none."
|
|
22
|
+
},
|
|
23
|
+
"identity": { "const": "package:id" }
|
|
24
|
+
},
|
|
25
|
+
"additionalProperties": false
|
|
26
|
+
},
|
|
27
|
+
"entries": { "type": "array", "items": { "$ref": "#/$defs/entry" } }
|
|
28
|
+
},
|
|
29
|
+
"additionalProperties": false,
|
|
30
|
+
"$defs": {
|
|
31
|
+
"stateAttribute": {
|
|
32
|
+
"type": "object",
|
|
33
|
+
"required": ["name", "on", "helper", "meaning"],
|
|
34
|
+
"properties": {
|
|
35
|
+
"name": {
|
|
36
|
+
"type": "string",
|
|
37
|
+
"minLength": 1,
|
|
38
|
+
"pattern": "^data-[a-z0-9]+(-[a-z0-9]+)*$"
|
|
39
|
+
},
|
|
40
|
+
"on": {
|
|
41
|
+
"type": "string",
|
|
42
|
+
"minLength": 1,
|
|
43
|
+
"description": "The element that carries it: a public class, or the element passed to the helper."
|
|
44
|
+
},
|
|
45
|
+
"helper": {
|
|
46
|
+
"type": "string",
|
|
47
|
+
"minLength": 1,
|
|
48
|
+
"description": "The helper, one of wiring.helpers, that writes it."
|
|
49
|
+
},
|
|
50
|
+
"meaning": {
|
|
51
|
+
"type": "string",
|
|
52
|
+
"minLength": 1,
|
|
53
|
+
"description": "What its presence or value means."
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
"additionalProperties": false
|
|
57
|
+
},
|
|
58
|
+
"stringList": {
|
|
59
|
+
"type": "array",
|
|
60
|
+
"items": { "type": "string", "minLength": 1 },
|
|
61
|
+
"uniqueItems": true
|
|
62
|
+
},
|
|
63
|
+
"cardinality": {
|
|
64
|
+
"type": "object",
|
|
65
|
+
"required": ["min", "max"],
|
|
66
|
+
"properties": {
|
|
67
|
+
"min": { "type": "integer", "minimum": 0 },
|
|
68
|
+
"max": {
|
|
69
|
+
"anyOf": [
|
|
70
|
+
{ "type": "integer", "minimum": 1 },
|
|
71
|
+
{ "const": "unbounded" }
|
|
72
|
+
]
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
"additionalProperties": false
|
|
76
|
+
},
|
|
77
|
+
"zone": {
|
|
78
|
+
"type": "object",
|
|
79
|
+
"required": ["id", "accepts", "cardinality", "exclusiveWith"],
|
|
80
|
+
"properties": {
|
|
81
|
+
"id": { "type": "string", "minLength": 1 },
|
|
82
|
+
"jsx": {
|
|
83
|
+
"type": "object",
|
|
84
|
+
"required": ["prop"],
|
|
85
|
+
"properties": {
|
|
86
|
+
"prop": { "type": "string", "minLength": 1 }
|
|
87
|
+
},
|
|
88
|
+
"additionalProperties": false
|
|
89
|
+
},
|
|
90
|
+
"accepts": { "$ref": "#/$defs/stringList" },
|
|
91
|
+
"cardinality": { "$ref": "#/$defs/cardinality" },
|
|
92
|
+
"exclusiveWith": { "$ref": "#/$defs/stringList" }
|
|
93
|
+
},
|
|
94
|
+
"additionalProperties": false
|
|
95
|
+
},
|
|
96
|
+
"state": {
|
|
97
|
+
"type": "object",
|
|
98
|
+
"required": ["id", "owner", "required"],
|
|
99
|
+
"properties": {
|
|
100
|
+
"id": { "type": "string", "minLength": 1 },
|
|
101
|
+
"owner": { "enum": ["application", "controlled", "component"] },
|
|
102
|
+
"required": { "type": "boolean" }
|
|
103
|
+
},
|
|
104
|
+
"additionalProperties": false
|
|
105
|
+
},
|
|
106
|
+
"diagnostic": {
|
|
107
|
+
"type": "object",
|
|
108
|
+
"required": ["id", "severity", "when", "message"],
|
|
109
|
+
"properties": {
|
|
110
|
+
"id": { "type": "string", "pattern": "^KUI-C[0-9]{3}$" },
|
|
111
|
+
"severity": { "enum": ["error", "warning"] },
|
|
112
|
+
"when": { "type": "string", "minLength": 1 },
|
|
113
|
+
"message": { "type": "string", "minLength": 1 }
|
|
114
|
+
},
|
|
115
|
+
"additionalProperties": false
|
|
116
|
+
},
|
|
117
|
+
"entry": {
|
|
118
|
+
"type": "object",
|
|
119
|
+
"required": [
|
|
120
|
+
"key",
|
|
121
|
+
"package",
|
|
122
|
+
"id",
|
|
123
|
+
"name",
|
|
124
|
+
"kind",
|
|
125
|
+
"source",
|
|
126
|
+
"parents",
|
|
127
|
+
"contexts",
|
|
128
|
+
"zones",
|
|
129
|
+
"children",
|
|
130
|
+
"state",
|
|
131
|
+
"wiring",
|
|
132
|
+
"responsive",
|
|
133
|
+
"layout",
|
|
134
|
+
"accessibility",
|
|
135
|
+
"boundaries",
|
|
136
|
+
"diagnostics",
|
|
137
|
+
"provenance"
|
|
138
|
+
],
|
|
139
|
+
"properties": {
|
|
140
|
+
"key": { "type": "string", "minLength": 3 },
|
|
141
|
+
"package": { "type": "string", "minLength": 1 },
|
|
142
|
+
"id": { "type": "string", "minLength": 1 },
|
|
143
|
+
"name": { "type": "string", "minLength": 1 },
|
|
144
|
+
"kind": { "enum": ["component", "composition", "recipe"] },
|
|
145
|
+
"purpose": { "type": "string", "minLength": 1 },
|
|
146
|
+
"publicExports": {
|
|
147
|
+
"description": "Each export's name and the package.json#exports subpath that serves it. An entry from a private application omits subpath: the application is bundled, never imported by package name, so the name resolves through the entry's source file.",
|
|
148
|
+
"type": "array",
|
|
149
|
+
"items": {
|
|
150
|
+
"type": "object",
|
|
151
|
+
"required": ["name"],
|
|
152
|
+
"properties": {
|
|
153
|
+
"name": { "type": "string", "minLength": 1 },
|
|
154
|
+
"subpath": { "type": "string", "pattern": "^\\." }
|
|
155
|
+
},
|
|
156
|
+
"additionalProperties": false
|
|
157
|
+
},
|
|
158
|
+
"minItems": 1
|
|
159
|
+
},
|
|
160
|
+
"sourceLinks": { "$ref": "#/$defs/stringList" },
|
|
161
|
+
"source": { "type": "string", "minLength": 1 },
|
|
162
|
+
"styleSources": {
|
|
163
|
+
"description": "Stylesheets owned by this component, relative to the catalog package root. Required for an entry to own its CSS in opt-in component ownership mode when no selection catalog supplies it.",
|
|
164
|
+
"type": "array",
|
|
165
|
+
"items": {
|
|
166
|
+
"type": "string",
|
|
167
|
+
"pattern": "^(?!.*(?:^|/)\\.{1,2}(?:/|$))[A-Za-z0-9._-]+(?:/[A-Za-z0-9._-]+)*\\.css$"
|
|
168
|
+
},
|
|
169
|
+
"minItems": 1,
|
|
170
|
+
"uniqueItems": true
|
|
171
|
+
},
|
|
172
|
+
"rendersAs": {
|
|
173
|
+
"description": "For a wrapper component: the cataloged roots it renders (package-qualified keys), any one of them or nothing. Composition checks treat an element of this entry as each declared root: a zone accepts it only if it accepts every root, and each root's parent contract applies to where it is placed.",
|
|
174
|
+
"type": "array",
|
|
175
|
+
"minItems": 1,
|
|
176
|
+
"items": { "type": "string", "pattern": "^[^:]+:[^:]+$" },
|
|
177
|
+
"uniqueItems": true
|
|
178
|
+
},
|
|
179
|
+
"jsxExports": {
|
|
180
|
+
"description": "Placement contracts for additional JSX exports from one selection entry. These exports do not stand for the entry's root or its zones.",
|
|
181
|
+
"type": "object",
|
|
182
|
+
"propertyNames": { "pattern": "^[A-Z][A-Za-z0-9]*$" },
|
|
183
|
+
"additionalProperties": {
|
|
184
|
+
"type": "object",
|
|
185
|
+
"required": ["parents"],
|
|
186
|
+
"properties": {
|
|
187
|
+
"parents": {
|
|
188
|
+
"type": "object",
|
|
189
|
+
"required": ["mode", "entries"],
|
|
190
|
+
"properties": {
|
|
191
|
+
"mode": { "enum": ["any", "root", "listed"] },
|
|
192
|
+
"entries": { "$ref": "#/$defs/stringList" }
|
|
193
|
+
},
|
|
194
|
+
"additionalProperties": false
|
|
195
|
+
}
|
|
196
|
+
},
|
|
197
|
+
"additionalProperties": false
|
|
198
|
+
}
|
|
199
|
+
},
|
|
200
|
+
"parents": {
|
|
201
|
+
"type": "object",
|
|
202
|
+
"required": ["mode", "entries"],
|
|
203
|
+
"properties": {
|
|
204
|
+
"mode": { "enum": ["any", "root", "listed"] },
|
|
205
|
+
"entries": { "$ref": "#/$defs/stringList" }
|
|
206
|
+
},
|
|
207
|
+
"additionalProperties": false
|
|
208
|
+
},
|
|
209
|
+
"contexts": { "$ref": "#/$defs/stringList" },
|
|
210
|
+
"zones": { "type": "array", "items": { "$ref": "#/$defs/zone" } },
|
|
211
|
+
"children": {
|
|
212
|
+
"type": "object",
|
|
213
|
+
"required": ["mode", "concepts", "requiredConcepts"],
|
|
214
|
+
"properties": {
|
|
215
|
+
"mode": { "enum": ["any", "none", "listed"] },
|
|
216
|
+
"concepts": { "$ref": "#/$defs/stringList" },
|
|
217
|
+
"requiredConcepts": { "$ref": "#/$defs/stringList" }
|
|
218
|
+
},
|
|
219
|
+
"additionalProperties": false
|
|
220
|
+
},
|
|
221
|
+
"state": { "type": "array", "items": { "$ref": "#/$defs/state" } },
|
|
222
|
+
"wiring": {
|
|
223
|
+
"type": "object",
|
|
224
|
+
"required": ["required", "helpers", "obligations"],
|
|
225
|
+
"properties": {
|
|
226
|
+
"required": { "type": "boolean" },
|
|
227
|
+
"scope": { "enum": ["application", "module"] },
|
|
228
|
+
"helpers": { "$ref": "#/$defs/stringList" },
|
|
229
|
+
"sources": {
|
|
230
|
+
"description": "Application-owned helper exports and their defining source files, relative to the catalog package root.",
|
|
231
|
+
"type": "array",
|
|
232
|
+
"items": {
|
|
233
|
+
"type": "object",
|
|
234
|
+
"required": ["export", "source"],
|
|
235
|
+
"properties": {
|
|
236
|
+
"export": { "type": "string", "minLength": 1 },
|
|
237
|
+
"source": { "type": "string", "minLength": 1 }
|
|
238
|
+
},
|
|
239
|
+
"additionalProperties": false
|
|
240
|
+
}
|
|
241
|
+
},
|
|
242
|
+
"obligations": { "$ref": "#/$defs/stringList" },
|
|
243
|
+
"stateAttributes": {
|
|
244
|
+
"description": "Wiring-owned state attributes: data-* attributes a wiring helper writes at runtime, which the application must not render, remove, or treat as its own state. Optional for extension catalogs; first-party entries always list it, empty when their helpers write none.",
|
|
245
|
+
"type": "array",
|
|
246
|
+
"items": { "$ref": "#/$defs/stateAttribute" }
|
|
247
|
+
}
|
|
248
|
+
},
|
|
249
|
+
"additionalProperties": false
|
|
250
|
+
},
|
|
251
|
+
"responsive": {
|
|
252
|
+
"type": "object",
|
|
253
|
+
"required": ["owner", "behaviors"],
|
|
254
|
+
"properties": {
|
|
255
|
+
"owner": {
|
|
256
|
+
"enum": ["application", "component", "shared", "not-applicable"]
|
|
257
|
+
},
|
|
258
|
+
"behaviors": { "$ref": "#/$defs/stringList" }
|
|
259
|
+
},
|
|
260
|
+
"additionalProperties": false
|
|
261
|
+
},
|
|
262
|
+
"layout": {
|
|
263
|
+
"type": "object",
|
|
264
|
+
"required": ["roles", "geometry"],
|
|
265
|
+
"properties": {
|
|
266
|
+
"roles": { "$ref": "#/$defs/stringList" },
|
|
267
|
+
"geometry": {
|
|
268
|
+
"type": "object",
|
|
269
|
+
"required": ["margin", "border", "padding"],
|
|
270
|
+
"properties": {
|
|
271
|
+
"margin": {
|
|
272
|
+
"enum": [
|
|
273
|
+
"self",
|
|
274
|
+
"parent",
|
|
275
|
+
"child",
|
|
276
|
+
"none",
|
|
277
|
+
"conditional",
|
|
278
|
+
"composed"
|
|
279
|
+
]
|
|
280
|
+
},
|
|
281
|
+
"border": {
|
|
282
|
+
"enum": [
|
|
283
|
+
"self",
|
|
284
|
+
"parent",
|
|
285
|
+
"child",
|
|
286
|
+
"none",
|
|
287
|
+
"conditional",
|
|
288
|
+
"composed"
|
|
289
|
+
]
|
|
290
|
+
},
|
|
291
|
+
"padding": {
|
|
292
|
+
"enum": [
|
|
293
|
+
"self",
|
|
294
|
+
"parent",
|
|
295
|
+
"child",
|
|
296
|
+
"none",
|
|
297
|
+
"conditional",
|
|
298
|
+
"composed"
|
|
299
|
+
]
|
|
300
|
+
},
|
|
301
|
+
"notes": { "$ref": "#/$defs/stringList" }
|
|
302
|
+
},
|
|
303
|
+
"additionalProperties": false
|
|
304
|
+
}
|
|
305
|
+
},
|
|
306
|
+
"additionalProperties": false
|
|
307
|
+
},
|
|
308
|
+
"accessibility": {
|
|
309
|
+
"type": "object",
|
|
310
|
+
"required": ["obligations"],
|
|
311
|
+
"properties": { "obligations": { "$ref": "#/$defs/stringList" } },
|
|
312
|
+
"additionalProperties": false
|
|
313
|
+
},
|
|
314
|
+
"cssValueProps": {
|
|
315
|
+
"type": "array",
|
|
316
|
+
"items": { "$ref": "#/$defs/cssValueProp" }
|
|
317
|
+
},
|
|
318
|
+
"boundaries": {
|
|
319
|
+
"type": "object",
|
|
320
|
+
"required": ["rootClass", "publicClasses", "publicTokens"],
|
|
321
|
+
"properties": {
|
|
322
|
+
"rootClass": {
|
|
323
|
+
"oneOf": [
|
|
324
|
+
{ "type": "string", "minLength": 1 },
|
|
325
|
+
{ "type": "null" }
|
|
326
|
+
]
|
|
327
|
+
},
|
|
328
|
+
"publicClasses": { "$ref": "#/$defs/stringList" },
|
|
329
|
+
"placeableClasses": {
|
|
330
|
+
"$ref": "#/$defs/stringList",
|
|
331
|
+
"description": "The subset of publicClasses an application may place on its own elements. Absent means none: every public class is the component's rendered anatomy, reached by rendering the component."
|
|
332
|
+
},
|
|
333
|
+
"rootElement": {
|
|
334
|
+
"type": "string",
|
|
335
|
+
"pattern": "^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$",
|
|
336
|
+
"description": "The intrinsic element the component renders at its root. It identifies composed child roots for ownership checks; a placeableClasses class on a plain element of this tag recreates the component, while the class stays placeable on another carrier."
|
|
337
|
+
},
|
|
338
|
+
"publicTokens": { "$ref": "#/$defs/stringList" },
|
|
339
|
+
"publicParts": { "$ref": "#/$defs/stringList" }
|
|
340
|
+
},
|
|
341
|
+
"additionalProperties": false
|
|
342
|
+
},
|
|
343
|
+
"diagnostics": {
|
|
344
|
+
"type": "array",
|
|
345
|
+
"items": { "$ref": "#/$defs/diagnostic" }
|
|
346
|
+
},
|
|
347
|
+
"provenance": {
|
|
348
|
+
"type": "object",
|
|
349
|
+
"required": ["selection", "composition"],
|
|
350
|
+
"properties": {
|
|
351
|
+
"selection": { "type": "string", "minLength": 1 },
|
|
352
|
+
"composition": { "type": "string", "minLength": 1 }
|
|
353
|
+
},
|
|
354
|
+
"additionalProperties": false
|
|
355
|
+
}
|
|
356
|
+
},
|
|
357
|
+
"additionalProperties": false
|
|
358
|
+
},
|
|
359
|
+
"cssValueProp": {
|
|
360
|
+
"type": "object",
|
|
361
|
+
"required": [
|
|
362
|
+
"path",
|
|
363
|
+
"grammar",
|
|
364
|
+
"helpers",
|
|
365
|
+
"shorthands",
|
|
366
|
+
"canonicalShorthands",
|
|
367
|
+
"exceptionalShorthands",
|
|
368
|
+
"rawPolicy",
|
|
369
|
+
"examples"
|
|
370
|
+
],
|
|
371
|
+
"properties": {
|
|
372
|
+
"path": {
|
|
373
|
+
"type": "string",
|
|
374
|
+
"pattern": "^[A-Za-z][A-Za-z0-9]*(?:\\[\\]\\.[A-Za-z][A-Za-z0-9]*)?$"
|
|
375
|
+
},
|
|
376
|
+
"grammar": {
|
|
377
|
+
"enum": [
|
|
378
|
+
"length",
|
|
379
|
+
"size",
|
|
380
|
+
"flex",
|
|
381
|
+
"color",
|
|
382
|
+
"declarations",
|
|
383
|
+
"media-query",
|
|
384
|
+
"pixels"
|
|
385
|
+
]
|
|
386
|
+
},
|
|
387
|
+
"helpers": { "$ref": "#/$defs/stringList" },
|
|
388
|
+
"nonStandaloneHelpers": { "$ref": "#/$defs/stringList" },
|
|
389
|
+
"shorthands": { "$ref": "#/$defs/stringList" },
|
|
390
|
+
"canonicalShorthands": { "$ref": "#/$defs/stringList" },
|
|
391
|
+
"exceptionalShorthands": { "$ref": "#/$defs/stringList" },
|
|
392
|
+
"rawPolicy": { "enum": ["forbid", "allow", "unsafe-only"] },
|
|
393
|
+
"unsafeHelper": { "type": "string", "minLength": 1 },
|
|
394
|
+
"examples": { "$ref": "#/$defs/stringList" }
|
|
395
|
+
},
|
|
396
|
+
"additionalProperties": false
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
}
|
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://raw.githubusercontent.com/brianwestphal/kerf/main/create-kerf-component/component-metadata.schema.json",
|
|
4
|
+
"title": "Kerf consumer component metadata source",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"required": ["schemaVersion", "components"],
|
|
7
|
+
"properties": {
|
|
8
|
+
"$schema": { "type": "string" },
|
|
9
|
+
"schemaVersion": { "const": 1 },
|
|
10
|
+
"componentCatalog": {
|
|
11
|
+
"type": "string",
|
|
12
|
+
"minLength": 1,
|
|
13
|
+
"description": "Relative path to the package's component (selection) catalog, copied into the generated composition catalog's compatibility.componentCatalog; defaults to \"not-applicable\"."
|
|
14
|
+
},
|
|
15
|
+
"components": {
|
|
16
|
+
"type": "array",
|
|
17
|
+
"items": { "$ref": "#/$defs/component" }
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"additionalProperties": false,
|
|
21
|
+
"$defs": {
|
|
22
|
+
"stateAttribute": {
|
|
23
|
+
"type": "object",
|
|
24
|
+
"required": ["name", "on", "helper", "meaning"],
|
|
25
|
+
"properties": {
|
|
26
|
+
"name": {
|
|
27
|
+
"type": "string",
|
|
28
|
+
"minLength": 1,
|
|
29
|
+
"pattern": "^data-[a-z0-9]+(-[a-z0-9]+)*$"
|
|
30
|
+
},
|
|
31
|
+
"on": {
|
|
32
|
+
"type": "string",
|
|
33
|
+
"minLength": 1,
|
|
34
|
+
"description": "The element that carries it: a public class, or the element passed to the helper."
|
|
35
|
+
},
|
|
36
|
+
"helper": {
|
|
37
|
+
"type": "string",
|
|
38
|
+
"minLength": 1,
|
|
39
|
+
"description": "The helper, one of wiring.helpers, that writes it."
|
|
40
|
+
},
|
|
41
|
+
"meaning": {
|
|
42
|
+
"type": "string",
|
|
43
|
+
"minLength": 1,
|
|
44
|
+
"description": "What its presence or value means."
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
"additionalProperties": false
|
|
48
|
+
},
|
|
49
|
+
"stringList": {
|
|
50
|
+
"type": "array",
|
|
51
|
+
"items": { "type": "string", "minLength": 1 },
|
|
52
|
+
"uniqueItems": true
|
|
53
|
+
},
|
|
54
|
+
"cardinality": {
|
|
55
|
+
"type": "object",
|
|
56
|
+
"required": ["min", "max"],
|
|
57
|
+
"properties": {
|
|
58
|
+
"min": { "type": "integer", "minimum": 0 },
|
|
59
|
+
"max": {
|
|
60
|
+
"anyOf": [
|
|
61
|
+
{ "type": "integer", "minimum": 1 },
|
|
62
|
+
{ "const": "unbounded" }
|
|
63
|
+
]
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
"additionalProperties": false
|
|
67
|
+
},
|
|
68
|
+
"diagnostic": {
|
|
69
|
+
"type": "object",
|
|
70
|
+
"required": ["id", "severity", "when", "message"],
|
|
71
|
+
"properties": {
|
|
72
|
+
"id": { "type": "string", "pattern": "^KUI-C[0-9]{3}$" },
|
|
73
|
+
"severity": { "enum": ["error", "warning"] },
|
|
74
|
+
"when": { "type": "string", "minLength": 1 },
|
|
75
|
+
"message": { "type": "string", "minLength": 1 }
|
|
76
|
+
},
|
|
77
|
+
"additionalProperties": false
|
|
78
|
+
},
|
|
79
|
+
"component": {
|
|
80
|
+
"type": "object",
|
|
81
|
+
"required": [
|
|
82
|
+
"id",
|
|
83
|
+
"name",
|
|
84
|
+
"kind",
|
|
85
|
+
"purpose",
|
|
86
|
+
"source",
|
|
87
|
+
"publicExports",
|
|
88
|
+
"sourceLinks",
|
|
89
|
+
"composition",
|
|
90
|
+
"boundaries",
|
|
91
|
+
"accessibility",
|
|
92
|
+
"diagnostics",
|
|
93
|
+
"provenance"
|
|
94
|
+
],
|
|
95
|
+
"properties": {
|
|
96
|
+
"id": { "type": "string", "minLength": 1 },
|
|
97
|
+
"name": { "type": "string", "minLength": 1 },
|
|
98
|
+
"kind": { "enum": ["component", "composition", "recipe"] },
|
|
99
|
+
"purpose": { "type": "string", "minLength": 1 },
|
|
100
|
+
"source": { "type": "string", "minLength": 1 },
|
|
101
|
+
"publicExports": {
|
|
102
|
+
"type": "array",
|
|
103
|
+
"minItems": 1,
|
|
104
|
+
"description": "Each export's name and package.json#exports subpath. A private application (package.json#private) may omit subpath; the name is then verified against the component's source file.",
|
|
105
|
+
"items": {
|
|
106
|
+
"type": "object",
|
|
107
|
+
"required": ["name"],
|
|
108
|
+
"properties": {
|
|
109
|
+
"name": { "type": "string", "minLength": 1 },
|
|
110
|
+
"subpath": { "type": "string", "pattern": "^\\." }
|
|
111
|
+
},
|
|
112
|
+
"additionalProperties": false
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
"sourceLinks": { "$ref": "#/$defs/stringList" },
|
|
116
|
+
"composition": { "$ref": "#/$defs/composition" },
|
|
117
|
+
"boundaries": {
|
|
118
|
+
"type": "object",
|
|
119
|
+
"required": ["rootClass", "publicClasses", "publicTokens"],
|
|
120
|
+
"properties": {
|
|
121
|
+
"rootClass": {
|
|
122
|
+
"oneOf": [
|
|
123
|
+
{ "type": "string", "minLength": 1 },
|
|
124
|
+
{ "type": "null" }
|
|
125
|
+
]
|
|
126
|
+
},
|
|
127
|
+
"publicClasses": { "$ref": "#/$defs/stringList" },
|
|
128
|
+
"placeableClasses": {
|
|
129
|
+
"$ref": "#/$defs/stringList",
|
|
130
|
+
"description": "The subset of publicClasses an application may place on its own elements (a layout utility, item geometry on another carrier). Absent means none: every public class is the component's rendered anatomy, which eslint-plugin-kerfjs reports on an application-owned element as KUI-L103 with the component to render."
|
|
131
|
+
},
|
|
132
|
+
"rootElement": {
|
|
133
|
+
"type": "string",
|
|
134
|
+
"pattern": "^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$",
|
|
135
|
+
"description": "The intrinsic element the component renders around its own placeableClasses. A placeable class on a plain element of this tag is the component recreated (KUI-L103); another carrier element keeps it. Requires placeableClasses."
|
|
136
|
+
},
|
|
137
|
+
"publicTokens": { "$ref": "#/$defs/stringList" }
|
|
138
|
+
},
|
|
139
|
+
"additionalProperties": false
|
|
140
|
+
},
|
|
141
|
+
"accessibility": {
|
|
142
|
+
"type": "object",
|
|
143
|
+
"required": ["obligations"],
|
|
144
|
+
"properties": { "obligations": { "$ref": "#/$defs/stringList" } },
|
|
145
|
+
"additionalProperties": false
|
|
146
|
+
},
|
|
147
|
+
"diagnostics": {
|
|
148
|
+
"type": "array",
|
|
149
|
+
"items": { "$ref": "#/$defs/diagnostic" }
|
|
150
|
+
},
|
|
151
|
+
"provenance": {
|
|
152
|
+
"type": "object",
|
|
153
|
+
"required": ["selection", "composition"],
|
|
154
|
+
"properties": {
|
|
155
|
+
"selection": { "type": "string", "minLength": 1 },
|
|
156
|
+
"composition": { "type": "string", "minLength": 1 }
|
|
157
|
+
},
|
|
158
|
+
"additionalProperties": false
|
|
159
|
+
}
|
|
160
|
+
},
|
|
161
|
+
"additionalProperties": false
|
|
162
|
+
},
|
|
163
|
+
"composition": {
|
|
164
|
+
"type": "object",
|
|
165
|
+
"required": [
|
|
166
|
+
"parents",
|
|
167
|
+
"contexts",
|
|
168
|
+
"zones",
|
|
169
|
+
"children",
|
|
170
|
+
"state",
|
|
171
|
+
"wiring",
|
|
172
|
+
"responsive",
|
|
173
|
+
"layout"
|
|
174
|
+
],
|
|
175
|
+
"properties": {
|
|
176
|
+
"rendersAs": {
|
|
177
|
+
"description": "For a wrapper component: the cataloged roots it renders (package-qualified keys such as @kerfjs/ui:toolbar-control-group), any one of them or nothing. UI composition checks treat the wrapper as each declared root.",
|
|
178
|
+
"type": "array",
|
|
179
|
+
"minItems": 1,
|
|
180
|
+
"items": { "type": "string", "pattern": "^[^:]+:[^:]+$" },
|
|
181
|
+
"uniqueItems": true
|
|
182
|
+
},
|
|
183
|
+
"parents": {
|
|
184
|
+
"type": "object",
|
|
185
|
+
"required": ["mode", "entries"],
|
|
186
|
+
"properties": {
|
|
187
|
+
"mode": { "enum": ["any", "root", "listed"] },
|
|
188
|
+
"entries": { "$ref": "#/$defs/stringList" }
|
|
189
|
+
},
|
|
190
|
+
"additionalProperties": false
|
|
191
|
+
},
|
|
192
|
+
"contexts": { "$ref": "#/$defs/stringList" },
|
|
193
|
+
"zones": {
|
|
194
|
+
"type": "array",
|
|
195
|
+
"items": {
|
|
196
|
+
"type": "object",
|
|
197
|
+
"required": ["id", "accepts", "cardinality", "exclusiveWith"],
|
|
198
|
+
"properties": {
|
|
199
|
+
"id": { "type": "string", "minLength": 1 },
|
|
200
|
+
"accepts": { "$ref": "#/$defs/stringList" },
|
|
201
|
+
"cardinality": { "$ref": "#/$defs/cardinality" },
|
|
202
|
+
"exclusiveWith": { "$ref": "#/$defs/stringList" }
|
|
203
|
+
},
|
|
204
|
+
"additionalProperties": false
|
|
205
|
+
}
|
|
206
|
+
},
|
|
207
|
+
"children": {
|
|
208
|
+
"type": "object",
|
|
209
|
+
"required": ["mode", "concepts", "requiredConcepts"],
|
|
210
|
+
"properties": {
|
|
211
|
+
"mode": { "enum": ["any", "none", "listed"] },
|
|
212
|
+
"concepts": { "$ref": "#/$defs/stringList" },
|
|
213
|
+
"requiredConcepts": { "$ref": "#/$defs/stringList" }
|
|
214
|
+
},
|
|
215
|
+
"additionalProperties": false
|
|
216
|
+
},
|
|
217
|
+
"state": {
|
|
218
|
+
"type": "array",
|
|
219
|
+
"items": {
|
|
220
|
+
"type": "object",
|
|
221
|
+
"required": ["id", "owner", "required"],
|
|
222
|
+
"properties": {
|
|
223
|
+
"id": { "type": "string", "minLength": 1 },
|
|
224
|
+
"owner": { "enum": ["application", "controlled", "component"] },
|
|
225
|
+
"required": { "type": "boolean" }
|
|
226
|
+
},
|
|
227
|
+
"additionalProperties": false
|
|
228
|
+
}
|
|
229
|
+
},
|
|
230
|
+
"wiring": {
|
|
231
|
+
"type": "object",
|
|
232
|
+
"required": ["required", "helpers", "obligations"],
|
|
233
|
+
"properties": {
|
|
234
|
+
"required": { "type": "boolean" },
|
|
235
|
+
"helpers": { "$ref": "#/$defs/stringList" },
|
|
236
|
+
"obligations": { "$ref": "#/$defs/stringList" },
|
|
237
|
+
"stateAttributes": {
|
|
238
|
+
"description": "Optional wiring-owned state attributes: data-* attributes a wiring helper writes at runtime, which the application must not render, remove, or treat as its own state.",
|
|
239
|
+
"type": "array",
|
|
240
|
+
"items": { "$ref": "#/$defs/stateAttribute" }
|
|
241
|
+
}
|
|
242
|
+
},
|
|
243
|
+
"additionalProperties": false
|
|
244
|
+
},
|
|
245
|
+
"responsive": {
|
|
246
|
+
"type": "object",
|
|
247
|
+
"required": ["owner", "behaviors"],
|
|
248
|
+
"properties": {
|
|
249
|
+
"owner": {
|
|
250
|
+
"enum": ["application", "component", "shared", "not-applicable"]
|
|
251
|
+
},
|
|
252
|
+
"behaviors": { "$ref": "#/$defs/stringList" }
|
|
253
|
+
},
|
|
254
|
+
"additionalProperties": false
|
|
255
|
+
},
|
|
256
|
+
"layout": {
|
|
257
|
+
"type": "object",
|
|
258
|
+
"required": ["roles", "geometry"],
|
|
259
|
+
"properties": {
|
|
260
|
+
"roles": { "$ref": "#/$defs/stringList" },
|
|
261
|
+
"geometry": {
|
|
262
|
+
"type": "object",
|
|
263
|
+
"required": ["margin", "border", "padding"],
|
|
264
|
+
"properties": {
|
|
265
|
+
"margin": { "$ref": "#/$defs/geometryOwner" },
|
|
266
|
+
"border": { "$ref": "#/$defs/geometryOwner" },
|
|
267
|
+
"padding": { "$ref": "#/$defs/geometryOwner" },
|
|
268
|
+
"notes": { "$ref": "#/$defs/stringList" }
|
|
269
|
+
},
|
|
270
|
+
"additionalProperties": false
|
|
271
|
+
}
|
|
272
|
+
},
|
|
273
|
+
"additionalProperties": false
|
|
274
|
+
}
|
|
275
|
+
},
|
|
276
|
+
"additionalProperties": false
|
|
277
|
+
},
|
|
278
|
+
"geometryOwner": {
|
|
279
|
+
"enum": ["self", "parent", "child", "none", "conditional", "composed"]
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
}
|