@forumone/throughline-design-contract 0.2.0 → 0.4.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.
- package/CHANGELOG.md +51 -0
- package/README.md +27 -0
- package/dist/loader.d.ts +8 -1
- package/dist/loader.d.ts.map +1 -1
- package/dist/loader.js +16 -0
- package/dist/loader.js.map +1 -1
- package/dist/manifest.d.ts +5 -0
- package/dist/manifest.d.ts.map +1 -1
- package/dist/schema.d.ts +56 -0
- package/dist/schema.d.ts.map +1 -1
- package/dist/schema.js +93 -0
- package/dist/schema.js.map +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,56 @@
|
|
|
1
1
|
# @forumone/throughline-design-contract
|
|
2
2
|
|
|
3
|
+
## 0.4.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 14f2be4: A contract can say a boolean starts ticked, and be believed
|
|
8
|
+
|
|
9
|
+
`boolean` fields were generated as `{ type: 'checkbox', defaultValue: false }`,
|
|
10
|
+
with the `false` hardcoded. That made a component's own default unreachable from
|
|
11
|
+
the CMS. A checkbox is stored ticked or unticked and never absent, so `coerce`
|
|
12
|
+
always had a value to turn into a real boolean, the prop was never `undefined`,
|
|
13
|
+
and a signature default like `hasFacade = true` could not apply. Every boolean a
|
|
14
|
+
contract described arrived at its component as `false`, whatever the component
|
|
15
|
+
said.
|
|
16
|
+
|
|
17
|
+
It was not theoretical. `VideoEmbed.hasFacade` exists to keep a provider's
|
|
18
|
+
iframe — several hundred kilobytes and its third-party cookies — off the page
|
|
19
|
+
until a reader presses play, and its contract says "Leave on". Every embed an
|
|
20
|
+
author added shipped with it off: the YouTube iframe was in the server HTML from
|
|
21
|
+
first paint, setting cookies on readers who never pressed play, on a site whose
|
|
22
|
+
stated rule is that no third-party tracking runs before consent.
|
|
23
|
+
|
|
24
|
+
So `ContentField` gains an optional `defaultValue`, read by the checkbox branch
|
|
25
|
+
and rejected on any other field type — anywhere else it is a value the author
|
|
26
|
+
expects to take effect and nothing ever would.
|
|
27
|
+
|
|
28
|
+
`allOrNothing` had to learn about it too. That rule treats `false` as "nobody
|
|
29
|
+
touched this", which is right for a checkbox that starts unticked and exactly
|
|
30
|
+
wrong for one that starts ticked: left alone, a group holding a ticked-by-default
|
|
31
|
+
boolean would never look empty, and the rule would demand the group's required
|
|
32
|
+
children of an author who had typed nothing. It now takes a field's declared
|
|
33
|
+
default into account rather than the value alone.
|
|
34
|
+
|
|
35
|
+
**Existing stored values are untouched.** `defaultValue` applies to a field an
|
|
36
|
+
author has not yet filled in, so blocks already saved keep whatever is in the
|
|
37
|
+
database; a `VideoEmbed` saved before this change still renders without its
|
|
38
|
+
facade until someone edits it.
|
|
39
|
+
|
|
40
|
+
## 0.3.0
|
|
41
|
+
|
|
42
|
+
### Minor Changes
|
|
43
|
+
|
|
44
|
+
- 24bd325: Add an optional `group` to the component contract, so an authoring UI can shelve components separately from what they are.
|
|
45
|
+
|
|
46
|
+
`category` was answering two questions at once — what a component _is_, and where an editor looks for it — and it is a bad answer to the second at any real size. A design system of sixty blocks files roughly half of them under `section`, so a picker grouped on `category` hands back the flat list the grouping was meant to avoid while `card` and `navigation` hold one entry each. Evening the shelves out within `category` would file components under the wrong kind for every consumer that reasons about kind, including `list_components`.
|
|
47
|
+
|
|
48
|
+
So `category` keeps its meaning and its enum, and `group` takes the second question with a vocabulary of shelf labels: `hero`, `narrative`, `proof`, `listing`, `media`, `form`, `cta`, `navigation`, `utility`. No `section`, which is the problem being solved; no `card` or `data`, which name a kind rather than a place to look.
|
|
49
|
+
|
|
50
|
+
New API: `groupOf(component)` resolves `group ?? category`, and `LoadedManifest` gains `listByGroup()` and `listGroups()` which match on the resolved value. Grouping consumers should call `groupOf` rather than reading either field.
|
|
51
|
+
|
|
52
|
+
Non-breaking. `group` is optional, and the fallback means a design system that sets none groups exactly as it did before.
|
|
53
|
+
|
|
3
54
|
## 0.2.0
|
|
4
55
|
|
|
5
56
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -64,6 +64,27 @@ export const contract: ComponentContract = {
|
|
|
64
64
|
|
|
65
65
|
Your design system's build tooling aggregates these into a `Manifest`. See the reference design system for a canonical example.
|
|
66
66
|
|
|
67
|
+
## `category` and `group`
|
|
68
|
+
|
|
69
|
+
Two fields, two questions.
|
|
70
|
+
|
|
71
|
+
`category` is what the component **is** — `hero`, `section`, `card`, `media`, `cta`, `navigation`, `data`, `form`, `utility`. It is required, and consumers reason about it as a kind: `list_components` in the components MCP server filters on it.
|
|
72
|
+
|
|
73
|
+
`group` is where an **editor looks for it** — `hero`, `narrative`, `proof`, `listing`, `media`, `form`, `cta`, `navigation`, `utility`. It is optional, and exists because `category` is a bad answer to that second question at any real size. A design system of sixty blocks files roughly half of them under `section`, so an authoring UI grouped on `category` hands back the flat list the grouping was meant to avoid, while `card` and `navigation` hold one entry each. Evening the shelves out by moving components between categories would file them under the wrong *kind* for every other consumer, so the fix is a second field rather than a looser first one.
|
|
74
|
+
|
|
75
|
+
There is deliberately no `section` in the group vocabulary — a shelf holding half the library is the problem this field exists to solve — and no `card` or `data`, both of which name a kind rather than a place to look.
|
|
76
|
+
|
|
77
|
+
Read the resolved value with `groupOf`, never either field directly:
|
|
78
|
+
|
|
79
|
+
```typescript
|
|
80
|
+
import { groupOf } from '@forumone/throughline-design-contract'
|
|
81
|
+
|
|
82
|
+
groupOf({ category: 'section', group: 'proof' }) // 'proof'
|
|
83
|
+
groupOf({ category: 'hero' }) // 'hero' — falls back
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
The fallback is what makes this a non-breaking addition: a design system that sets no `group` anywhere groups exactly as it did before the field existed, and one part-way through adopting it stays consistent instead of grouping half one way and half the other.
|
|
87
|
+
|
|
67
88
|
## Loading a manifest at runtime
|
|
68
89
|
|
|
69
90
|
```typescript
|
|
@@ -78,6 +99,12 @@ console.log(hero.intent)
|
|
|
78
99
|
for (const name of loaded.listByCategory('card')) {
|
|
79
100
|
console.log(name)
|
|
80
101
|
}
|
|
102
|
+
|
|
103
|
+
// Grouped for an authoring UI. Matches on the resolved group, so components
|
|
104
|
+
// with no `group` are found by their category.
|
|
105
|
+
for (const shelf of loaded.listGroups()) {
|
|
106
|
+
console.log(shelf, loaded.listByGroup(shelf).length)
|
|
107
|
+
}
|
|
81
108
|
```
|
|
82
109
|
|
|
83
110
|
Invalid manifests throw immediately with a path-qualified error message. The loader never partially loads invalid data.
|
package/dist/loader.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Manifest } from './manifest.js';
|
|
2
|
-
import type { ComponentContract, ComponentCategory } from './schema.js';
|
|
2
|
+
import type { ComponentContract, ComponentCategory, ComponentGroup } from './schema.js';
|
|
3
3
|
/**
|
|
4
4
|
* A validated, queryable manifest. Returned by {@link loadManifest} and
|
|
5
5
|
* {@link loadManifestFromUrl}. Consumers use the helper methods rather than
|
|
@@ -22,6 +22,13 @@ export declare class LoadedManifest {
|
|
|
22
22
|
listByCategory(category: ComponentCategory | string): ComponentContract[];
|
|
23
23
|
/** Every distinct category present, sorted alphabetically. */
|
|
24
24
|
listCategories(): string[];
|
|
25
|
+
/**
|
|
26
|
+
* Every component filed under a shelf. Matches on the resolved group, so a
|
|
27
|
+
* component with no `group` is found by its category.
|
|
28
|
+
*/
|
|
29
|
+
listByGroup(group: ComponentGroup | string): ComponentContract[];
|
|
30
|
+
/** Every distinct resolved group present, sorted alphabetically. */
|
|
31
|
+
listGroups(): string[];
|
|
25
32
|
/** Token definition by name, or `undefined` if absent. */
|
|
26
33
|
getToken(name: string): {
|
|
27
34
|
value: string;
|
package/dist/loader.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../src/loader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,QAAQ,EAAkB,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"loader.d.ts","source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Of } from './schema.js';
|
|
2
3
|
/**
|
|
3
4
|
* A validated, queryable manifest. Returned by {@link loadManifest} and
|
|
4
5
|
* {@link loadManifestFromUrl}. Consumers use the helper methods rather than
|
|
@@ -45,6 +46,21 @@ export class LoadedManifest {
|
|
|
45
46
|
}
|
|
46
47
|
return Array.from(categories).sort();
|
|
47
48
|
}
|
|
49
|
+
/**
|
|
50
|
+
* Every component filed under a shelf. Matches on the resolved group, so a
|
|
51
|
+
* component with no `group` is found by its category.
|
|
52
|
+
*/
|
|
53
|
+
listByGroup(group) {
|
|
54
|
+
return Object.values(this.raw.components).filter((c) => groupOf(c) === group);
|
|
55
|
+
}
|
|
56
|
+
/** Every distinct resolved group present, sorted alphabetically. */
|
|
57
|
+
listGroups() {
|
|
58
|
+
const groups = new Set();
|
|
59
|
+
for (const component of Object.values(this.raw.components)) {
|
|
60
|
+
groups.add(groupOf(component));
|
|
61
|
+
}
|
|
62
|
+
return Array.from(groups).sort();
|
|
63
|
+
}
|
|
48
64
|
/** Token definition by name, or `undefined` if absent. */
|
|
49
65
|
getToken(name) {
|
|
50
66
|
return this.raw.tokens.find((t) => t.name === name);
|
package/dist/loader.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loader.js","sourceRoot":"","sources":["../src/loader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,cAAc,EAAE,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"loader.js","sourceRoot":"","sources":["../src/loader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,cAAc,EAAE,MAAM,eAAe,CAAA;AAC7D,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAGrC;;;;GAIG;AACH,MAAM,OAAO,cAAc;IACG;IAA5B,YAA4B,GAAa;QAAb,QAAG,GAAH,GAAG,CAAU;IAAG,CAAC;IAE7C,oCAAoC;IACpC,IAAI,YAAY;QACd,OAAO,IAAI,CAAC,GAAG,CAAC,YAAY,CAAA;I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C,KAAK,UAAU,mBAAmB,CACvC,GAAW,EACX,IAAkB;IAElB,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,EAAE,IAAI,CAAC,CAAA;IACvC,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;QACjB,MAAM,IAAI,KAAK,CAAC,iCAAiC,GAAG,UAAU,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAA;IAClF,CAAC;IACD,MAAM,IAAI,GAAG,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAY,CAAA;IAC/C,OAAO,YAAY,CAAC,IAAI,CAAC,CAAA;AAC3B,CAAC"}
|
package/dist/manifest.d.ts
CHANGED
|
@@ -54,6 +54,7 @@ export declare const ManifestSchema: z.ZodObject<{
|
|
|
54
54
|
components: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
55
55
|
name: z.ZodString;
|
|
56
56
|
category: z.ZodEnum<["hero", "section", "card", "media", "cta", "navigation", "data", "form", "utility"]>;
|
|
57
|
+
group: z.ZodOptional<z.ZodEnum<["hero", "narrative", "proof", "listing", "media", "form", "cta", "navigation", "utility"]>>;
|
|
57
58
|
description: z.ZodString;
|
|
58
59
|
intent: z.ZodString;
|
|
59
60
|
composition: z.ZodObject<{
|
|
@@ -243,6 +244,7 @@ export declare const ManifestSchema: z.ZodObject<{
|
|
|
243
244
|
animates: boolean;
|
|
244
245
|
requiresAnalytics: boolean;
|
|
245
246
|
};
|
|
247
|
+
group?: "hero" | "media" | "cta" | "navigation" | "form" | "utility" | "narrative" | "proof" | "listing" | undefined;
|
|
246
248
|
}, {
|
|
247
249
|
name: string;
|
|
248
250
|
category: "section" | "hero" | "card" | "media" | "cta" | "navigation" | "data" | "form" | "utility";
|
|
@@ -282,6 +284,7 @@ export declare const ManifestSchema: z.ZodObject<{
|
|
|
282
284
|
label: string;
|
|
283
285
|
storyId: string;
|
|
284
286
|
}[];
|
|
287
|
+
group?: "hero" | "media" | "cta" | "navigation" | "form" | "utility" | "narrative" | "proof" | "listing" | undefined;
|
|
285
288
|
antiExamples?: {
|
|
286
289
|
label: string;
|
|
287
290
|
why: string;
|
|
@@ -369,6 +372,7 @@ export declare const ManifestSchema: z.ZodObject<{
|
|
|
369
372
|
animates: boolean;
|
|
370
373
|
requiresAnalytics: boolean;
|
|
371
374
|
};
|
|
375
|
+
group?: "hero" | "media" | "cta" | "navigation" | "form" | "utility" | "narrative" | "proof" | "listing" | undefined;
|
|
372
376
|
}>;
|
|
373
377
|
build: {
|
|
374
378
|
timestamp: string;
|
|
@@ -427,6 +431,7 @@ export declare const ManifestSchema: z.ZodObject<{
|
|
|
427
431
|
label: string;
|
|
428
432
|
storyId: string;
|
|
429
433
|
}[];
|
|
434
|
+
group?: "hero" | "media" | "cta" | "navigation" | "form" | "utility" | "narrative" | "proof" | "listing" | undefined;
|
|
430
435
|
antiExamples?: {
|
|
431
436
|
label: string;
|
|
432
437
|
why: string;
|
package/dist/manifest.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../src/manifest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB,QAAA,MAAM,qBAAqB;;;;;;;;;;;;EAIzB,CAAA;AAEF,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAA;AAEnE,eAAO,MAAM,cAAc;IACzB,2DAA2D;;IAG3D,wCAAwC;;;;;;;;;;;;;;;;;;;;IASxC,+EAA+E;;;;;;;;;;;;;;IAG/E,gCAAgC
|
|
1
|
+
{"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../src/manifest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB,QAAA,MAAM,qBAAqB;;;;;;;;;;;;EAIzB,CAAA;AAEF,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAA;AAEnE,eAAO,MAAM,cAAc;IACzB,2DAA2D;;IAG3D,wCAAwC;;;;;;;;;;;;;;;;;;;;IASxC,+EAA+E;;;;;;;;;;;;;;IAG/E,gCAAgC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAGhC,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAKtB,CAAA;AAEF,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAA"}
|
package/dist/schema.d.ts
CHANGED
|
@@ -8,11 +8,43 @@ export declare const CONTRACT_VERSION = "1.0.0";
|
|
|
8
8
|
declare const FieldTypeSchema: z.ZodEnum<["text", "richtext", "link", "image", "video", "select", "group", "array", "boolean", "number"]>;
|
|
9
9
|
declare const PlacementSchema: z.ZodEnum<["page", "section", "inline"]>;
|
|
10
10
|
declare const CategorySchema: z.ZodEnum<["hero", "section", "card", "media", "cta", "navigation", "data", "form", "utility"]>;
|
|
11
|
+
/**
|
|
12
|
+
* Where an editor looks for a component, as distinct from what the component
|
|
13
|
+
* *is*.
|
|
14
|
+
*
|
|
15
|
+
* `category` answers the second question and several consumers reason about it
|
|
16
|
+
* as a kind. It is a poor answer to the first: a real design system files
|
|
17
|
+
* roughly half its library under `section`, so a picker grouped on `category`
|
|
18
|
+
* hands back the flat list the grouping was meant to avoid, while `card` and
|
|
19
|
+
* `navigation` hold one entry each. Redistributing within `category` to even
|
|
20
|
+
* the shelves out would file components under the wrong kind for every other
|
|
21
|
+
* consumer.
|
|
22
|
+
*
|
|
23
|
+
* So this is a second, optional field. The values are shelf labels, chosen to
|
|
24
|
+
* split the sections a `category` cannot:
|
|
25
|
+
*
|
|
26
|
+
* - `hero` — page openers
|
|
27
|
+
* - `narrative` — sections that explain, walk through, or tell
|
|
28
|
+
* - `proof` — sections that evidence a claim: testimony, clients, results
|
|
29
|
+
* - `listing` — collections of records, usually repeating
|
|
30
|
+
* - `media` — image, video, audio, and their captions
|
|
31
|
+
* - `form` — anything an editor thinks of as a form
|
|
32
|
+
* - `cta` — asks
|
|
33
|
+
* - `navigation` — wayfinding within or across pages
|
|
34
|
+
* - `utility` — structural or incidental
|
|
35
|
+
*
|
|
36
|
+
* There is deliberately no `section`: a shelf that holds half the library is
|
|
37
|
+
* the problem this field exists to solve. There is no `card` or `data` either
|
|
38
|
+
* — both name a kind rather than a place to look, and their contents belong on
|
|
39
|
+
* `listing` and `proof` respectively.
|
|
40
|
+
*/
|
|
41
|
+
declare const GroupSchema: z.ZodEnum<["hero", "narrative", "proof", "listing", "media", "form", "cta", "navigation", "utility"]>;
|
|
11
42
|
export type ContentField = {
|
|
12
43
|
name: string;
|
|
13
44
|
type: z.infer<typeof FieldTypeSchema>;
|
|
14
45
|
required: boolean;
|
|
15
46
|
maxLength?: number | undefined;
|
|
47
|
+
defaultValue?: boolean | undefined;
|
|
16
48
|
constraints?: string | undefined;
|
|
17
49
|
of?: ContentField[] | undefined;
|
|
18
50
|
};
|
|
@@ -22,12 +54,19 @@ export type ContentFieldInput = {
|
|
|
22
54
|
type: z.infer<typeof FieldTypeSchema>;
|
|
23
55
|
required?: boolean | undefined;
|
|
24
56
|
maxLength?: number | undefined;
|
|
57
|
+
defaultValue?: boolean | undefined;
|
|
25
58
|
constraints?: string | undefined;
|
|
26
59
|
of?: ContentFieldInput[] | undefined;
|
|
27
60
|
};
|
|
28
61
|
export declare const ComponentContractSchema: z.ZodObject<{
|
|
29
62
|
name: z.ZodString;
|
|
30
63
|
category: z.ZodEnum<["hero", "section", "card", "media", "cta", "navigation", "data", "form", "utility"]>;
|
|
64
|
+
/**
|
|
65
|
+
* The shelf an authoring UI files this component under. Optional: when it is
|
|
66
|
+
* absent, {@link groupOf} falls back to {@link category}, so a design system
|
|
67
|
+
* that sets none groups exactly as it did before this field existed.
|
|
68
|
+
*/
|
|
69
|
+
group: z.ZodOptional<z.ZodEnum<["hero", "narrative", "proof", "listing", "media", "form", "cta", "navigation", "utility"]>>;
|
|
31
70
|
description: z.ZodString;
|
|
32
71
|
intent: z.ZodString;
|
|
33
72
|
composition: z.ZodObject<{
|
|
@@ -217,6 +256,7 @@ export declare const ComponentContractSchema: z.ZodObject<{
|
|
|
217
256
|
animates: boolean;
|
|
218
257
|
requiresAnalytics: boolean;
|
|
219
258
|
};
|
|
259
|
+
group?: "hero" | "media" | "cta" | "navigation" | "form" | "utility" | "narrative" | "proof" | "listing" | undefined;
|
|
220
260
|
}, {
|
|
221
261
|
name: string;
|
|
222
262
|
category: "section" | "hero" | "card" | "media" | "cta" | "navigation" | "data" | "form" | "utility";
|
|
@@ -256,6 +296,7 @@ export declare const ComponentContractSchema: z.ZodObject<{
|
|
|
256
296
|
label: string;
|
|
257
297
|
storyId: string;
|
|
258
298
|
}[];
|
|
299
|
+
group?: "hero" | "media" | "cta" | "navigation" | "form" | "utility" | "narrative" | "proof" | "listing" | undefined;
|
|
259
300
|
antiExamples?: {
|
|
260
301
|
label: string;
|
|
261
302
|
why: string;
|
|
@@ -270,6 +311,21 @@ export declare const ComponentContractSchema: z.ZodObject<{
|
|
|
270
311
|
}>;
|
|
271
312
|
export type ComponentContract = z.infer<typeof ComponentContractSchema>;
|
|
272
313
|
export type ComponentCategory = z.infer<typeof CategorySchema>;
|
|
314
|
+
export type ComponentGroup = z.infer<typeof GroupSchema>;
|
|
315
|
+
/**
|
|
316
|
+
* The shelf a component is filed under: its `group` when set, otherwise its
|
|
317
|
+
* `category`.
|
|
318
|
+
*
|
|
319
|
+
* Anything that groups components should call this rather than reading either
|
|
320
|
+
* field directly, so a design system part-way through adopting `group` groups
|
|
321
|
+
* consistently instead of half one way and half the other. It takes a
|
|
322
|
+
* structural type so it also accepts the looser component shapes consumers
|
|
323
|
+
* carry around, not only a fully parsed {@link ComponentContract}.
|
|
324
|
+
*/
|
|
325
|
+
export declare function groupOf(component: {
|
|
326
|
+
category: string;
|
|
327
|
+
group?: string | undefined;
|
|
328
|
+
}): string;
|
|
273
329
|
export type ComponentPlacement = z.infer<typeof PlacementSchema>;
|
|
274
330
|
export type ContentFieldType = z.infer<typeof FieldTypeSchema>;
|
|
275
331
|
export {};
|
package/dist/schema.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../src/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,UAAU,CAAA;AAEvC,QAAA,MAAM,eAAe,4GAWnB,CAAA;AAEF,QAAA,MAAM,eAAe,0CAAwC,CAAA;AAE7D,QAAA,MAAM,cAAc,iGAUlB,CAAA;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAA;IACrC,QAAQ,EAAE,OAAO,CAAA;IACjB,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC9B,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAChC,EAAE,CAAC,EAAE,YAAY,EAAE,GAAG,SAAS,CAAA;CAChC,CAAA;AAED,iFAAiF;AACjF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,IAA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
30
|
'utility',
|
|
31
31
|
]);
|
|
32
|
+
/**
|
|
33
|
+
* Where an editor looks for a component, as distinct from what the component
|
|
34
|
+
* *is*.
|
|
35
|
+
*
|
|
36
|
+
* `category` answers the second question and several consumers reason about it
|
|
37
|
+
* as a kind. It is a poor answer to the first: a real design system files
|
|
38
|
+
* roughly half its library under `section`, so a picker grouped on `category`
|
|
39
|
+
* hands back the flat list the grouping was meant to avoid, while `card` and
|
|
40
|
+
* `navigation` hold one entry each. Redistributing within `category` to even
|
|
41
|
+
* the shelves out would file components under the wrong kind for every other
|
|
42
|
+
* consumer.
|
|
43
|
+
*
|
|
44
|
+
* So this is a second, optional field. The values are shelf labels, chosen to
|
|
45
|
+
* split the sections a `category` cannot:
|
|
46
|
+
*
|
|
47
|
+
* - `hero` — page openers
|
|
48
|
+
* - `narrative` — sections that explain, walk through, or tell
|
|
49
|
+
* - `proof` — sections that evidence a claim: testimony, clients, results
|
|
50
|
+
* - `listing` — collections of records, usually repeating
|
|
51
|
+
* - `media` — image, video, audio, and their captions
|
|
52
|
+
* - `form` — anything an editor thinks of as a form
|
|
53
|
+
* - `cta` — asks
|
|
54
|
+
* - `navigation` — wayfinding within or across pages
|
|
55
|
+
* - `utility` — structural or incidental
|
|
56
|
+
*
|
|
57
|
+
* There is deliberately no `section`: a shelf that holds half the library is
|
|
58
|
+
* the problem this field exists to solve. There is no `card` or `data` either
|
|
59
|
+
* — both name a kind rather than a place to look, and their contents belong on
|
|
60
|
+
* `listing` and `proof` respectively.
|
|
61
|
+
*/
|
|
62
|
+
const GroupSchema = z.enum([
|
|
63
|
+
'hero',
|
|
64
|
+
'narrative',
|
|
65
|
+
'proof',
|
|
66
|
+
'listing',
|
|
67
|
+
'media',
|
|
68
|
+
'form',
|
|
69
|
+
'cta',
|
|
70
|
+
'navigation',
|
|
71
|
+
'utility',
|
|
72
|
+
]);
|
|
32
73
|
const ContentFieldSchema = z.lazy(() => z.object({
|
|
33
74
|
name: z.string().min(1),
|
|
34
75
|
type: FieldTypeSchema,
|
|
35
76
|
required: z.boolean().default(false),
|
|
36
77
|
maxLength: z.number().int().positive().optional(),
|
|
78
|
+
/*
|
|
79
|
+
What the field holds before an author touches it, for `boolean` only.
|
|
80
|
+
|
|
81
|
+
A component's own default lives in its signature — `hasFacade = true` — and
|
|
82
|
+
is reachable only when the prop arrives as `undefined`. A generated CMS
|
|
83
|
+
field never leaves it undefined: a checkbox is stored ticked or unticked,
|
|
84
|
+
so the component is always handed an explicit value and its default can
|
|
85
|
+
never apply. Without somewhere to declare it, every boolean a contract
|
|
86
|
+
describes reaches the component as `false`, whatever the component says.
|
|
87
|
+
|
|
88
|
+
That inverted `VideoEmbed.hasFacade`, whose whole purpose is to keep a
|
|
89
|
+
provider's iframe and its third-party cookies off the page until a reader
|
|
90
|
+
presses play. The contract said "Leave on"; every embed an author added
|
|
91
|
+
shipped with it off.
|
|
92
|
+
|
|
93
|
+
Deliberately boolean-only. `text` and `number` defaults are a different
|
|
94
|
+
question — an empty string and a missing number are already meaningful, and
|
|
95
|
+
a default there competes with `required` rather than completing it. Widen
|
|
96
|
+
this when a component needs it, not before.
|
|
97
|
+
*/
|
|
98
|
+
defaultValue: z.boolean().optional(),
|
|
37
99
|
/** Human-readable constraint description the AI reasons about. */
|
|
38
100
|
constraints: z.string().optional(),
|
|
39
101
|
/** For array or group fields, the nested field shape. */
|
|
40
102
|
of: z.array(ContentFieldSchema).optional(),
|
|
103
|
+
}).superRefine((field, ctx) => {
|
|
104
|
+
// Only `boolean` reads `defaultValue`, so anywhere else it is a value the
|
|
105
|
+
// author expects to take effect and nothing ever will. Rejecting it is the
|
|
106
|
+
// difference between a contract that fails validation and a field that
|
|
107
|
+
// quietly ignores half of what it was told.
|
|
108
|
+
if (field.defaultValue !== undefined && field.type !== 'boolean') {
|
|
109
|
+
ctx.addIssue({
|
|
110
|
+
code: z.ZodIssueCode.custom,
|
|
111
|
+
path: ['defaultValue'],
|
|
112
|
+
message: `defaultValue is only read for boolean fields; "${field.name}" is ${field.type}.`,
|
|
113
|
+
});
|
|
114
|
+
}
|
|
41
115
|
}));
|
|
42
116
|
export const ComponentContractSchema = z.object({
|
|
43
117
|
// Identity
|
|
44
118
|
name: z.string().min(1).regex(/^[A-Z][A-Za-z0-9]+$/, 'Component names must be PascalCase'),
|
|
45
119
|
category: CategorySchema,
|
|
120
|
+
/**
|
|
121
|
+
* The shelf an authoring UI files this component under. Optional: when it is
|
|
122
|
+
* absent, {@link groupOf} falls back to {@link category}, so a design system
|
|
123
|
+
* that sets none groups exactly as it did before this field existed.
|
|
124
|
+
*/
|
|
125
|
+
group: GroupSchema.optional(),
|
|
46
126
|
description: z.string().min(20).max(280),
|
|
47
127
|
intent: z.string().min(20).max(500),
|
|
48
128
|
// Composition
|
|
@@ -107,4 +187,17 @@ export const ComponentContractSchema = z.object({
|
|
|
107
187
|
})
|
|
108
188
|
.default({}),
|
|
109
189
|
});
|
|
190
|
+
/**
|
|
191
|
+
* The shelf a component is filed under: its `group` when set, otherwise its
|
|
192
|
+
* `category`.
|
|
193
|
+
*
|
|
194
|
+
* Anything that groups components should call this rather than reading either
|
|
195
|
+
* field directly, so a design system part-way through adopting `group` groups
|
|
196
|
+
* consistently instead of half one way and half the other. It takes a
|
|
197
|
+
* structural type so it also accepts the looser component shapes consumers
|
|
198
|
+
* carry around, not only a fully parsed {@link ComponentContract}.
|
|
199
|
+
*/
|
|
200
|
+
export function groupOf(component) {
|
|
201
|
+
return component.group ?? component.category;
|
|
202
|
+
}
|
|
110
203
|
//# sourceMappingURL=schema.js.map
|
package/dist/schema.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../src/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB;;;;GAIG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,OAAO,CAAA;AAEvC,MAAM,eAAe,GAAG,CAAC,CAAC,IAAI,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,MAAM,CAAC;QACP,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;QACjB,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE;QACf,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;KAClC,CAAC,CACH;SACA,OAAO,CAAC,EAAE,CAAC;IAEd,aAAa;IACb,QAAQ,EAAE,CAAC;SACR,MAAM,CAAC;QACN,WAAW,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC;QACvC,cAAc,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC;QAC1C,QAAQ,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC;QACpC,iBAAiB,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC;KAC9C,CAAC;SACD,OAAO,CAAC,EAAE,CAAC;CACf,CAAC,CAAA;AAMF;;;;;;;;;GASG;AACH,MAAM,UAAU,OAAO,CAAC,SAA2D;IACjF,OAAO,SAAS,CAAC,KAAK,IAAI,SAAS,CAAC,QAAQ,CAAA;AAC9C,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@forumone/throughline-design-contract",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "The contract every AI-ready design system satisfies to be consumable by Throughline.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -47,8 +47,8 @@
|
|
|
47
47
|
"eslint": "^9.15.0",
|
|
48
48
|
"typescript": "^5.6.0",
|
|
49
49
|
"vitest": "^2.1.0",
|
|
50
|
-
"@forumone/throughline-
|
|
51
|
-
"@forumone/throughline-
|
|
50
|
+
"@forumone/throughline-tsconfig": "0.0.0",
|
|
51
|
+
"@forumone/throughline-eslint-config": "0.0.0"
|
|
52
52
|
},
|
|
53
53
|
"scripts": {
|
|
54
54
|
"build": "tsc -b",
|