@design-parity/catalog-export 0.1.24 → 0.1.26
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/dist/index.d.ts +4 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/dist/ingest.d.ts.map +1 -1
- package/dist/ingest.js +4 -0
- package/dist/ingest.js.map +1 -1
- package/dist/manifest.d.ts +34 -5
- package/dist/manifest.d.ts.map +1 -1
- package/dist/manifest.js +19 -3
- package/dist/manifest.js.map +1 -1
- package/dist/spec.d.ts +41 -1
- package/dist/spec.d.ts.map +1 -1
- package/dist/spec.js +51 -1
- package/dist/spec.js.map +1 -1
- package/dist/types.d.ts +30 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/wireframe.d.ts +25 -0
- package/dist/wireframe.d.ts.map +1 -0
- package/dist/wireframe.js +50 -0
- package/dist/wireframe.js.map +1 -0
- package/dist/write.d.ts +2 -0
- package/dist/write.d.ts.map +1 -1
- package/dist/write.js +9 -1
- package/dist/write.js.map +1 -1
- package/package.json +9 -4
package/dist/index.d.ts
CHANGED
|
@@ -12,17 +12,18 @@
|
|
|
12
12
|
* `docs/design-artifacts/REFERENCE_KITS.md`). Depends only on
|
|
13
13
|
* `@design-parity/core`.
|
|
14
14
|
*/
|
|
15
|
-
export type { Catalog, CatalogComponent, CatalogMeta, ComponentReference, ComponentVariants, Greenline, Redline, RedlinePadding, } from "./types.js";
|
|
15
|
+
export type { Catalog, CatalogComponent, CatalogMeta, CatalogScreen, ComponentReference, ComponentVariants, Greenline, Redline, RedlinePadding, } from "./types.js";
|
|
16
16
|
export { buildCatalog, buildComponent } from "./ingest.js";
|
|
17
17
|
export type { ComponentSource } from "./ingest.js";
|
|
18
18
|
export { INTERACTIVE_ROLES, MIN_TOUCH_TARGET_DP, buildGreenlines, findingToGreenline, findingsToGreenlines, specGreenlines, } from "./greenlines.js";
|
|
19
19
|
export { buildRedlines } from "./redlines.js";
|
|
20
|
-
export { imagePath, livePreviewUrl, slug, toCatalogManifest, } from "./manifest.js";
|
|
20
|
+
export { imagePath, livePreviewUrl, slug, toCatalogManifest, wireframePath, } from "./manifest.js";
|
|
21
|
+
export { buildWireframeSvg } from "./wireframe.js";
|
|
21
22
|
export type { CatalogManifest, CatalogManifestComponent, CatalogManifestImage, ManifestOptions, PreviewServerOptions, VariantKind, } from "./manifest.js";
|
|
22
23
|
export { toFigmaVariables } from "./figma.js";
|
|
23
24
|
export type { FigmaVariable, FigmaVariableCollection, FigmaVariableType, } from "./figma.js";
|
|
24
25
|
export { writeCatalog } from "./write.js";
|
|
25
26
|
export type { WriteOptions, WriteResult } from "./write.js";
|
|
26
|
-
export { catalogFromCandidates } from "./spec.js";
|
|
27
|
+
export { catalogFromCandidates, screenGraphIssues } from "./spec.js";
|
|
27
28
|
export type { CatalogSpec, CatalogSpecComponent, CatalogSpecGroup, FromCandidatesOptions, FromCandidatesResult, } from "./spec.js";
|
|
28
29
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,YAAY,EACV,OAAO,EACP,gBAAgB,EAChB,WAAW,EACX,kBAAkB,EAClB,iBAAiB,EACjB,SAAS,EACT,OAAO,EACP,cAAc,GACf,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC3D,YAAY,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEnD,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EACnB,eAAe,EACf,kBAAkB,EAClB,oBAAoB,EACpB,cAAc,GACf,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAE9C,OAAO,EACL,SAAS,EACT,cAAc,EACd,IAAI,EACJ,iBAAiB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,YAAY,EACV,OAAO,EACP,gBAAgB,EAChB,WAAW,EACX,aAAa,EACb,kBAAkB,EAClB,iBAAiB,EACjB,SAAS,EACT,OAAO,EACP,cAAc,GACf,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC3D,YAAY,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEnD,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EACnB,eAAe,EACf,kBAAkB,EAClB,oBAAoB,EACpB,cAAc,GACf,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAE9C,OAAO,EACL,SAAS,EACT,cAAc,EACd,IAAI,EACJ,iBAAiB,EACjB,aAAa,GACd,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,YAAY,EACV,eAAe,EACf,wBAAwB,EACxB,oBAAoB,EACpB,eAAe,EACf,oBAAoB,EACpB,WAAW,GACZ,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAC9C,YAAY,EACV,aAAa,EACb,uBAAuB,EACvB,iBAAiB,GAClB,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE5D,OAAO,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AACrE,YAAY,EACV,WAAW,EACX,oBAAoB,EACpB,gBAAgB,EAChB,qBAAqB,EACrB,oBAAoB,GACrB,MAAM,WAAW,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
export { buildCatalog, buildComponent } from "./ingest.js";
|
|
2
2
|
export { INTERACTIVE_ROLES, MIN_TOUCH_TARGET_DP, buildGreenlines, findingToGreenline, findingsToGreenlines, specGreenlines, } from "./greenlines.js";
|
|
3
3
|
export { buildRedlines } from "./redlines.js";
|
|
4
|
-
export { imagePath, livePreviewUrl, slug, toCatalogManifest, } from "./manifest.js";
|
|
4
|
+
export { imagePath, livePreviewUrl, slug, toCatalogManifest, wireframePath, } from "./manifest.js";
|
|
5
|
+
export { buildWireframeSvg } from "./wireframe.js";
|
|
5
6
|
export { toFigmaVariables } from "./figma.js";
|
|
6
7
|
export { writeCatalog } from "./write.js";
|
|
7
|
-
export { catalogFromCandidates } from "./spec.js";
|
|
8
|
+
export { catalogFromCandidates, screenGraphIssues } from "./spec.js";
|
|
8
9
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AA0BA,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAG3D,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EACnB,eAAe,EACf,kBAAkB,EAClB,oBAAoB,EACpB,cAAc,GACf,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAE9C,OAAO,EACL,SAAS,EACT,cAAc,EACd,IAAI,EACJ,iBAAiB,EACjB,aAAa,GACd,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAUnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAO9C,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAG1C,OAAO,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC"}
|
package/dist/ingest.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ingest.d.ts","sourceRoot":"","sources":["../src/ingest.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,KAAK,EACV,YAAY,EACZ,OAAO,EACP,KAAK,EACL,YAAY,EACb,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"ingest.d.ts","sourceRoot":"","sources":["../src/ingest.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,KAAK,EACV,YAAY,EACZ,OAAO,EACP,KAAK,EACL,YAAY,EACb,MAAM,qBAAqB,CAAC;AAK7B,OAAO,KAAK,EACV,OAAO,EACP,gBAAgB,EAChB,WAAW,EACX,kBAAkB,EACnB,MAAM,YAAY,CAAC;AAEpB,8EAA8E;AAC9E,MAAM,WAAW,eAAe;IAC9B,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,kBAAkB,CAAC;IAC/B,yDAAyD;IACzD,KAAK,EAAE,KAAK,EAAE,CAAC;IACf,oEAAoE;IACpE,MAAM,CAAC,EAAE,KAAK,EAAE,CAAC;IACjB,oEAAoE;IACpE,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,gFAAgF;IAChF,SAAS,CAAC,EAAE,YAAY,CAAC;IACzB,0EAA0E;IAC1E,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAC;CACtB;AAED,4EAA4E;AAC5E,wBAAgB,cAAc,CAAC,MAAM,EAAE,eAAe,GAAG,gBAAgB,CAsBxE;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAC1B,IAAI,EAAE,WAAW,EACjB,OAAO,EAAE,SAAS,eAAe,EAAE,EACnC,WAAW,CAAC,EAAE,YAAY,GACzB,OAAO,CAQT"}
|
package/dist/ingest.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { buildGreenlines } from "./greenlines.js";
|
|
2
2
|
import { buildRedlines } from "./redlines.js";
|
|
3
|
+
import { buildWireframeSvg } from "./wireframe.js";
|
|
3
4
|
/** Assemble one {@link CatalogComponent}, computing its greenline layer. */
|
|
4
5
|
export function buildComponent(source) {
|
|
5
6
|
if (source.ideal.length === 0) {
|
|
@@ -23,6 +24,9 @@ export function buildComponent(source) {
|
|
|
23
24
|
component.tokens = source.tokens;
|
|
24
25
|
if (source.semantics !== undefined)
|
|
25
26
|
component.semantics = source.semantics;
|
|
27
|
+
const wireframeSvg = buildWireframeSvg(source.semantics);
|
|
28
|
+
if (wireframeSvg !== undefined)
|
|
29
|
+
component.wireframeSvg = wireframeSvg;
|
|
26
30
|
return component;
|
|
27
31
|
}
|
|
28
32
|
/**
|
package/dist/ingest.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ingest.js","sourceRoot":"","sources":["../src/ingest.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"ingest.js","sourceRoot":"","sources":["../src/ingest.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AA0BnD,4EAA4E;AAC5E,MAAM,UAAU,cAAc,CAAC,MAAuB;IACpD,IAAI,MAAM,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC9B,MAAM,IAAI,KAAK,CACb,8BAA8B,MAAM,CAAC,WAAW,uBAAuB,CACxE,CAAC;IACJ,CAAC;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GAClB,WAAW;QACX,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,EAAE,WAAW,CAAC,EAAE,SAAS,EAAE,WAAW,CAAC;IAC3E,MAAM,OAAO,GAAY,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC;IAC9C,IAAI,cAAc;QAAE,OAAO,CAAC,WAAW,GAAG,cAAc,CAAC;IACzD,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
package/dist/manifest.d.ts
CHANGED
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
* {@link toCatalogManifest} is **pure** (it only computes paths, no I/O); the
|
|
13
13
|
* {@link writeCatalog} step materializes the bytes those paths point at.
|
|
14
14
|
*/
|
|
15
|
-
import type { DesignTokens, Image, Theme } from "@design-parity/core";
|
|
16
|
-
import type { Catalog, ComponentReference, Greenline, Redline } from "./types.js";
|
|
15
|
+
import type { DesignTokens, Image, ParityDirection, Theme } from "@design-parity/core";
|
|
16
|
+
import type { Catalog, CatalogScreen, ComponentReference, Greenline, Redline } from "./types.js";
|
|
17
17
|
/** Which sticker-sheet variant an image belongs to. */
|
|
18
18
|
export type VariantKind = "ideal" | "layout";
|
|
19
19
|
/** One image entry in the manifest — bundle-relative path + variant keys. */
|
|
@@ -24,6 +24,8 @@ export interface CatalogManifestImage {
|
|
|
24
24
|
state: string;
|
|
25
25
|
theme?: Theme;
|
|
26
26
|
size?: string;
|
|
27
|
+
/** Extra named variant axes (e.g. `{ content: "icon+label" }`) → set variant props. */
|
|
28
|
+
props?: Record<string, string>;
|
|
27
29
|
width: number;
|
|
28
30
|
height: number;
|
|
29
31
|
/**
|
|
@@ -46,6 +48,12 @@ export interface CatalogManifestComponent {
|
|
|
46
48
|
greenlines: Greenline[];
|
|
47
49
|
/** Layout spacing spec — per-node box + padding + gap + corner radius. */
|
|
48
50
|
redlines: Redline[];
|
|
51
|
+
/**
|
|
52
|
+
* Bundle-relative path to the pre-generated **wireframe SVG** (one bordered box
|
|
53
|
+
* per composable), when the component carries box geometry. The importer places
|
|
54
|
+
* it as the vector wireframe comparison lane. Absent ⇒ no wireframe.
|
|
55
|
+
*/
|
|
56
|
+
wireframe?: string;
|
|
49
57
|
}
|
|
50
58
|
/** The parsed/serializable `catalog.json`. */
|
|
51
59
|
export interface CatalogManifest {
|
|
@@ -57,6 +65,19 @@ export interface CatalogManifest {
|
|
|
57
65
|
generatedAt?: string;
|
|
58
66
|
/** Bundle-relative path to the DTCG token file, when tokens were exported. */
|
|
59
67
|
tokensFile?: string;
|
|
68
|
+
/**
|
|
69
|
+
* The consumer repo's parity direction (from its `.design-parity.json`), so a
|
|
70
|
+
* design-tool importer knows who owns the source of truth without reaching the
|
|
71
|
+
* repo. `code-led` ⇒ the importer may own the design catalog; `design-led` ⇒
|
|
72
|
+
* renders are reference-only and writes need confirmation; `auto`/absent ⇒ the
|
|
73
|
+
* importer applies its safe default. Set by the generator, not by the renderer.
|
|
74
|
+
*/
|
|
75
|
+
direction?: ParityDirection;
|
|
76
|
+
/**
|
|
77
|
+
* The screen graph — main screens + their related secondaries/dialogs — for a
|
|
78
|
+
* per-screen import. Carried through from the catalog spec; absent ⇒ flat.
|
|
79
|
+
*/
|
|
80
|
+
screens?: CatalogScreen[];
|
|
60
81
|
components: CatalogManifestComponent[];
|
|
61
82
|
}
|
|
62
83
|
/**
|
|
@@ -72,6 +93,12 @@ export interface PreviewServerOptions {
|
|
|
72
93
|
export interface ManifestOptions {
|
|
73
94
|
/** Bundle-relative DTCG token filename. Default `"tokens.dtcg.json"`. */
|
|
74
95
|
tokensFile?: string;
|
|
96
|
+
/**
|
|
97
|
+
* The consumer repo's parity direction to stamp into the manifest (from its
|
|
98
|
+
* `.design-parity.json`). Omitted ⇒ no `direction` field; the importer applies
|
|
99
|
+
* its own safe default.
|
|
100
|
+
*/
|
|
101
|
+
direction?: ParityDirection;
|
|
75
102
|
/**
|
|
76
103
|
* When set, every image entry gets a {@link CatalogManifestImage.livePreview}
|
|
77
104
|
* deep link into this server. Omitted ⇒ no `livePreview` fields (the catalog is
|
|
@@ -94,11 +121,13 @@ export declare function livePreviewUrl(base: string, system: string, imagePath:
|
|
|
94
121
|
export declare function slug(value: string): string;
|
|
95
122
|
/**
|
|
96
123
|
* Bundle-relative path for one variant image of a component. Encodes the
|
|
97
|
-
* component id and every variant key
|
|
98
|
-
* collide:
|
|
99
|
-
* `images/<component>/<variant>__<state>[__<theme>][__<size>].png`.
|
|
124
|
+
* component id and every variant key — including extra `props` axes — so
|
|
125
|
+
* distinct states/themes/sizes/props never collide:
|
|
126
|
+
* `images/<component>/<variant>__<state>[__<theme>][__<size>][__<k-v>…].png`.
|
|
100
127
|
*/
|
|
101
128
|
export declare function imagePath(componentId: string, variant: VariantKind, image: Image): string;
|
|
129
|
+
/** Bundle-relative path for a component's pre-generated wireframe SVG. */
|
|
130
|
+
export declare function wireframePath(componentId: string): string;
|
|
102
131
|
/** Build the serializable {@link CatalogManifest} for a {@link Catalog} (pure). */
|
|
103
132
|
export declare function toCatalogManifest(catalog: Catalog, opts?: ManifestOptions): CatalogManifest;
|
|
104
133
|
//# sourceMappingURL=manifest.d.ts.map
|
package/dist/manifest.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../src/manifest.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../src/manifest.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,eAAe,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAEvF,OAAO,KAAK,EACV,OAAO,EAEP,aAAa,EACb,kBAAkB,EAClB,SAAS,EACT,OAAO,EACR,MAAM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,EAAE,eAAe,CAAC;IAC5B;;;OAGG;IACH,OAAO,CAAC,EAAE,aAAa,EAAE,CAAC;IAC1B,UAAU,EAAE,wBAAwB,EAAE,CAAC;CACxC;AAED;;;;;GAKG;AACH,MAAM,WAAW,oBAAoB;IACnC,oEAAoE;IACpE,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,eAAe;IAC9B,yEAAyE;IACzE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;;OAIG;IACH,SAAS,CAAC,EAAE,eAAe,CAAC;IAC5B;;;;OAIG;IACH,aAAa,CAAC,EAAE,oBAAoB,CAAC;CACtC;AAID;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAC5B,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,GAChB,MAAM,CAOR;AAED,qEAAqE;AACrE,wBAAgB,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAO1C;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CACvB,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,WAAW,EACpB,KAAK,EAAE,KAAK,GACX,MAAM,CAUR;AAyCD,0EAA0E;AAC1E,wBAAgB,aAAa,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAEzD;AAoBD,mFAAmF;AACnF,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,OAAO,EAChB,IAAI,GAAE,eAAoB,GACzB,eAAe,CAoBjB"}
|
package/dist/manifest.js
CHANGED
|
@@ -26,9 +26,9 @@ export function slug(value) {
|
|
|
26
26
|
}
|
|
27
27
|
/**
|
|
28
28
|
* Bundle-relative path for one variant image of a component. Encodes the
|
|
29
|
-
* component id and every variant key
|
|
30
|
-
* collide:
|
|
31
|
-
* `images/<component>/<variant>__<state>[__<theme>][__<size>].png`.
|
|
29
|
+
* component id and every variant key — including extra `props` axes — so
|
|
30
|
+
* distinct states/themes/sizes/props never collide:
|
|
31
|
+
* `images/<component>/<variant>__<state>[__<theme>][__<size>][__<k-v>…].png`.
|
|
32
32
|
*/
|
|
33
33
|
export function imagePath(componentId, variant, image) {
|
|
34
34
|
const parts = [variant, image.state];
|
|
@@ -36,6 +36,10 @@ export function imagePath(componentId, variant, image) {
|
|
|
36
36
|
parts.push(image.theme);
|
|
37
37
|
if (image.size)
|
|
38
38
|
parts.push(image.size);
|
|
39
|
+
// Sorted so the path is deterministic regardless of prop declaration order.
|
|
40
|
+
for (const [key, value] of Object.entries(image.props ?? {}).sort(([a], [b]) => a.localeCompare(b))) {
|
|
41
|
+
parts.push(`${key}-${value}`);
|
|
42
|
+
}
|
|
39
43
|
const file = parts.map(slug).join("__");
|
|
40
44
|
return `images/${slug(componentId)}/${file}.png`;
|
|
41
45
|
}
|
|
@@ -55,6 +59,8 @@ function manifestImages(component, ctx) {
|
|
|
55
59
|
entry.theme = image.theme;
|
|
56
60
|
if (image.size)
|
|
57
61
|
entry.size = image.size;
|
|
62
|
+
if (image.props && Object.keys(image.props).length > 0)
|
|
63
|
+
entry.props = image.props;
|
|
58
64
|
if (ctx.previewServer) {
|
|
59
65
|
entry.livePreview = livePreviewUrl(ctx.previewServer.base, ctx.system, path);
|
|
60
66
|
}
|
|
@@ -65,6 +71,10 @@ function manifestImages(component, ctx) {
|
|
|
65
71
|
push("layout", component.variants.layout);
|
|
66
72
|
return out;
|
|
67
73
|
}
|
|
74
|
+
/** Bundle-relative path for a component's pre-generated wireframe SVG. */
|
|
75
|
+
export function wireframePath(componentId) {
|
|
76
|
+
return `wireframes/${slug(componentId)}.svg`;
|
|
77
|
+
}
|
|
68
78
|
function manifestComponent(component, ctx) {
|
|
69
79
|
const out = {
|
|
70
80
|
componentId: component.componentId,
|
|
@@ -80,6 +90,8 @@ function manifestComponent(component, ctx) {
|
|
|
80
90
|
out.reference = component.reference;
|
|
81
91
|
if (component.tokens !== undefined)
|
|
82
92
|
out.tokens = component.tokens;
|
|
93
|
+
if (component.wireframeSvg !== undefined)
|
|
94
|
+
out.wireframe = wireframePath(component.componentId);
|
|
83
95
|
return out;
|
|
84
96
|
}
|
|
85
97
|
/** Build the serializable {@link CatalogManifest} for a {@link Catalog} (pure). */
|
|
@@ -100,6 +112,10 @@ export function toCatalogManifest(catalog, opts = {}) {
|
|
|
100
112
|
manifest.renderer = catalog.meta.renderer;
|
|
101
113
|
if (catalog.meta.generatedAt)
|
|
102
114
|
manifest.generatedAt = catalog.meta.generatedAt;
|
|
115
|
+
if (opts.direction)
|
|
116
|
+
manifest.direction = opts.direction;
|
|
117
|
+
if (catalog.meta.screens)
|
|
118
|
+
manifest.screens = catalog.meta.screens;
|
|
103
119
|
if (catalog.themeTokens) {
|
|
104
120
|
manifest.tokensFile = opts.tokensFile ?? DEFAULT_TOKENS_FILE;
|
|
105
121
|
}
|
package/dist/manifest.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest.js","sourceRoot":"","sources":["../src/manifest.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"manifest.js","sourceRoot":"","sources":["../src/manifest.ts"],"names":[],"mappings":"AA2HA,MAAM,mBAAmB,GAAG,kBAAkB,CAAC;AAE/C;;;;;;;;;GASG;AACH,MAAM,UAAU,cAAc,CAC5B,IAAY,EACZ,MAAc,EACd,SAAiB;IAEjB,MAAM,EAAE,GAAG,SAAS;SACjB,OAAO,CAAC,WAAW,EAAE,EAAE,CAAC;SACxB,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC;SACrB,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IACxB,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IACtC,OAAO,GAAG,IAAI,MAAM,kBAAkB,CAAC,EAAE,CAAC,YAAY,kBAAkB,CAAC,MAAM,CAAC,EAAE,CAAC;AACrF,CAAC;AAED,qEAAqE;AACrE,MAAM,UAAU,IAAI,CAAC,KAAa;IAChC,OAAO,CACL,KAAK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AAO,GAAG,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC;IAClE,IAAI,OAAO,CAAC,IAAI,CAAC,QAAQ;QAAE,QAAQ,CAAC,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC;IACrE,IAAI,OAAO,CAAC,IAAI,CAAC,WAAW;QAAE,QAAQ,CAAC,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC;IAC9E,IAAI,IAAI,CAAC,SAAS;QAAE,QAAQ,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC;IACxD,IAAI,OAAO,CAAC,IAAI,CAAC,OAAO;QAAE,QAAQ,CAAC,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC;IAClE,IAAI,OAAO,CAAC,WAAW,EAAE,CAAC;QACxB,QAAQ,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,IAAI,mBAAmB,CAAC;IAC/D,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
package/dist/spec.d.ts
CHANGED
|
@@ -14,7 +14,28 @@
|
|
|
14
14
|
* `CandidateRender` is a `@design-parity/core` type, so this stays core-only.
|
|
15
15
|
*/
|
|
16
16
|
import type { CandidateRender, DesignTokens } from "@design-parity/core";
|
|
17
|
-
import type { Catalog, ComponentReference } from "./types.js";
|
|
17
|
+
import type { Catalog, CatalogScreen, ComponentReference } from "./types.js";
|
|
18
|
+
/**
|
|
19
|
+
* One extra **state variant** of a component: its own `@Preview` function whose
|
|
20
|
+
* render folds onto the parent sticker, tagged with `state`. Lets one component
|
|
21
|
+
* carry its default plus every state (pressed / focused / disabled / off / …) —
|
|
22
|
+
* the default is the grid hero, the variants are secondary previews in the
|
|
23
|
+
* single-component view.
|
|
24
|
+
*/
|
|
25
|
+
export interface CatalogSpecVariant {
|
|
26
|
+
/** State this variant renders, e.g. `"pressed"`, `"focused"`, `"disabled"`. */
|
|
27
|
+
state?: string;
|
|
28
|
+
/**
|
|
29
|
+
* Extra named variant axes for this render beyond `state` — e.g.
|
|
30
|
+
* `{ content: "icon+label" }`, `{ density: "compact" }`. Each becomes a
|
|
31
|
+
* variant property on the component set alongside `state`/`theme`/`size`, so a
|
|
32
|
+
* component can vary along content/config axes, not only its state.
|
|
33
|
+
*/
|
|
34
|
+
props?: Record<string, string>;
|
|
35
|
+
/** The `@Preview` **function name** that renders this variant. */
|
|
36
|
+
preview: string;
|
|
37
|
+
caption?: string;
|
|
38
|
+
}
|
|
18
39
|
/** One component slot in a {@link CatalogSpec} group. */
|
|
19
40
|
export interface CatalogSpecComponent {
|
|
20
41
|
/** Stable component id, e.g. `"Button/Filled"`. */
|
|
@@ -24,6 +45,12 @@ export interface CatalogSpecComponent {
|
|
|
24
45
|
caption?: string;
|
|
25
46
|
/** Published-kit reference (URL or `figma:` handle) for the seed import. */
|
|
26
47
|
reference?: ComponentReference;
|
|
48
|
+
/**
|
|
49
|
+
* Extra state renders folded onto this component (see {@link CatalogSpecVariant}).
|
|
50
|
+
* The default `preview` stays the grid hero; each variant's images are appended
|
|
51
|
+
* to `ideal`, re-tagged with the variant's `state`.
|
|
52
|
+
*/
|
|
53
|
+
variants?: CatalogSpecVariant[];
|
|
27
54
|
}
|
|
28
55
|
/** A named group of components in a {@link CatalogSpec}. */
|
|
29
56
|
export interface CatalogSpecGroup {
|
|
@@ -36,7 +63,20 @@ export interface CatalogSpec {
|
|
|
36
63
|
title: string;
|
|
37
64
|
library?: string[];
|
|
38
65
|
groups: CatalogSpecGroup[];
|
|
66
|
+
/**
|
|
67
|
+
* Optional screen graph: which components are main screens and their related
|
|
68
|
+
* secondaries/dialogs, for a per-screen import. Additive — every id references
|
|
69
|
+
* a component declared in {@link CatalogSpec.groups}; absent ⇒ flat catalog.
|
|
70
|
+
*/
|
|
71
|
+
screens?: CatalogScreen[];
|
|
39
72
|
}
|
|
73
|
+
/**
|
|
74
|
+
* The screen-graph references (`screen.id` / `related[]`) that don't name a
|
|
75
|
+
* component declared in any group — a hand-authored `catalog.spec.json` typo or
|
|
76
|
+
* a stale id after a rename. Pure; empty ⇒ the graph is sound. The generator
|
|
77
|
+
* warns on these rather than dropping them silently.
|
|
78
|
+
*/
|
|
79
|
+
export declare function screenGraphIssues(spec: CatalogSpec): string[];
|
|
40
80
|
export interface FromCandidatesOptions {
|
|
41
81
|
/** `compose-preview` version, recorded as provenance. */
|
|
42
82
|
renderer?: string;
|
package/dist/spec.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spec.d.ts","sourceRoot":"","sources":["../src/spec.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAIzE,OAAO,KAAK,EAAE,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"spec.d.ts","sourceRoot":"","sources":["../src/spec.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAIzE,OAAO,KAAK,EAAE,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAE7E;;;;;;GAMG;AACH,MAAM,WAAW,kBAAkB;IACjC,+EAA+E;IAC/E,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;;OAKG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/B,kEAAkE;IAClE,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAWD,yDAAyD;AACzD,MAAM,WAAW,oBAAoB;IACnC,mDAAmD;IACnD,WAAW,EAAE,MAAM,CAAC;IACpB,+EAA+E;IAC/E,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,4EAA4E;IAC5E,SAAS,CAAC,EAAE,kBAAkB,CAAC;IAC/B;;;;OAIG;IACH,QAAQ,CAAC,EAAE,kBAAkB,EAAE,CAAC;CACjC;AAED,4DAA4D;AAC5D,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,oBAAoB,EAAE,CAAC;CACpC;AAED,4EAA4E;AAC5E,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,MAAM,EAAE,gBAAgB,EAAE,CAAC;IAC3B;;;;OAIG;IACH,OAAO,CAAC,EAAE,aAAa,EAAE,CAAC;CAC3B;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,WAAW,GAAG,MAAM,EAAE,CAc7D;AA0CD,MAAM,WAAW,qBAAqB;IACpC,yDAAyD;IACzD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,wDAAwD;IACxD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gFAAgF;IAChF,WAAW,CAAC,EAAE,YAAY,CAAC;CAC5B;AAED,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,OAAO,CAAC;IACjB,0EAA0E;IAC1E,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB;;;;;;OAMG;IACH,gBAAgB,EAAE,MAAM,EAAE,CAAC;CAC5B;AAcD;;;;;;;;;;;GAWG;AACH,wBAAgB,qBAAqB,CACnC,UAAU,EAAE,SAAS,eAAe,EAAE,EACtC,IAAI,EAAE,WAAW,EACjB,IAAI,GAAE,qBAA0B,GAC/B,oBAAoB,CAgEtB"}
|
package/dist/spec.js
CHANGED
|
@@ -1,4 +1,32 @@
|
|
|
1
1
|
import { buildCatalog } from "./ingest.js";
|
|
2
|
+
/** A short label for a variant, for coverage reports: its state and/or props. */
|
|
3
|
+
function variantLabel(variant) {
|
|
4
|
+
const parts = [
|
|
5
|
+
...(variant.state ? [variant.state] : []),
|
|
6
|
+
...Object.entries(variant.props ?? {}).map(([k, v]) => `${k}=${v}`),
|
|
7
|
+
];
|
|
8
|
+
return parts.join(", ") || variant.preview;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* The screen-graph references (`screen.id` / `related[]`) that don't name a
|
|
12
|
+
* component declared in any group — a hand-authored `catalog.spec.json` typo or
|
|
13
|
+
* a stale id after a rename. Pure; empty ⇒ the graph is sound. The generator
|
|
14
|
+
* warns on these rather than dropping them silently.
|
|
15
|
+
*/
|
|
16
|
+
export function screenGraphIssues(spec) {
|
|
17
|
+
const declared = new Set(spec.groups.flatMap((g) => g.components.map((c) => c.componentId)));
|
|
18
|
+
const issues = [];
|
|
19
|
+
for (const screen of spec.screens ?? []) {
|
|
20
|
+
if (!declared.has(screen.id))
|
|
21
|
+
issues.push(`screen "${screen.id}" is not a declared component`);
|
|
22
|
+
for (const related of screen.related ?? []) {
|
|
23
|
+
if (!declared.has(related)) {
|
|
24
|
+
issues.push(`screen "${screen.id}" relates to undeclared component "${related}"`);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
return issues;
|
|
29
|
+
}
|
|
2
30
|
/**
|
|
3
31
|
* The `@Preview` function name a spec component matches on. Prefers the
|
|
4
32
|
* candidate's {@link CandidateRender.functionName} — the stable identity the
|
|
@@ -80,10 +108,31 @@ export function catalogFromCandidates(candidates, spec, opts = {}) {
|
|
|
80
108
|
}
|
|
81
109
|
if (!hasSemantics(candidate))
|
|
82
110
|
withoutSemantics.push(component.componentId);
|
|
111
|
+
// Fold the component's state `variants` (pressed / focused / disabled / …)
|
|
112
|
+
// onto the default render: the default images stay first (the grid hero),
|
|
113
|
+
// each variant's images are appended re-tagged with its `state` so the
|
|
114
|
+
// single-component view can show them as secondary previews. A variant
|
|
115
|
+
// preview that didn't render is reported as missing, keyed by state.
|
|
116
|
+
const ideal = [...candidate.images];
|
|
117
|
+
for (const variant of component.variants ?? []) {
|
|
118
|
+
const variantCandidate = byFunction.get(variant.preview);
|
|
119
|
+
if (!variantCandidate || variantCandidate.images.length === 0) {
|
|
120
|
+
missing.push(`${component.componentId} [${variantLabel(variant)}]`);
|
|
121
|
+
continue;
|
|
122
|
+
}
|
|
123
|
+
for (const image of variantCandidate.images) {
|
|
124
|
+
const tagged = { ...image };
|
|
125
|
+
if (variant.state !== undefined)
|
|
126
|
+
tagged.state = variant.state;
|
|
127
|
+
if (variant.props)
|
|
128
|
+
tagged.props = { ...image.props, ...variant.props };
|
|
129
|
+
ideal.push(tagged);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
83
132
|
const source = {
|
|
84
133
|
componentId: component.componentId,
|
|
85
134
|
group: group.name,
|
|
86
|
-
ideal
|
|
135
|
+
ideal,
|
|
87
136
|
};
|
|
88
137
|
if (component.caption !== undefined)
|
|
89
138
|
source.caption = component.caption;
|
|
@@ -100,6 +149,7 @@ export function catalogFromCandidates(candidates, spec, opts = {}) {
|
|
|
100
149
|
...(spec.library ? { library: spec.library } : {}),
|
|
101
150
|
...(opts.renderer ? { renderer: opts.renderer } : {}),
|
|
102
151
|
generatedAt: opts.generatedAt ?? new Date().toISOString(),
|
|
152
|
+
...(spec.screens ? { screens: spec.screens } : {}),
|
|
103
153
|
};
|
|
104
154
|
const catalog = buildCatalog(meta, sources, opts.themeTokens);
|
|
105
155
|
return { catalog, missing, withoutSemantics };
|
package/dist/spec.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spec.js","sourceRoot":"","sources":["../src/spec.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"spec.js","sourceRoot":"","sources":["../src/spec.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AA0B3C,iFAAiF;AACjF,SAAS,YAAY,CAAC,OAA2B;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
|
|
14
14
|
import type { Bounds, DesignTokens, FindingKind, Image, SemanticTree, Severity } from "@design-parity/core";
|
|
15
|
+
/**
|
|
16
|
+
* One **main screen** and the secondary screens/dialogs directly related to it —
|
|
17
|
+
* the unit a per-screen import page is built from. Screen `id` and every
|
|
18
|
+
* `related` entry are `componentId`s that also appear in the flat groups; the
|
|
19
|
+
* screen graph is *additive* metadata that says which of those are top-level
|
|
20
|
+
* screens and how they cluster, so it never changes the flat catalog.
|
|
21
|
+
*/
|
|
22
|
+
export interface CatalogScreen {
|
|
23
|
+
/** The main screen's `componentId` (must be declared in a group). */
|
|
24
|
+
id: string;
|
|
25
|
+
/** Page title for this screen; defaults to the component's caption/id. */
|
|
26
|
+
title?: string;
|
|
27
|
+
/**
|
|
28
|
+
* `componentId`s of the secondary screens and dialogs shown alongside the main
|
|
29
|
+
* screen (also declared in groups). Ordered as they should appear on the page.
|
|
30
|
+
*/
|
|
31
|
+
related?: string[];
|
|
32
|
+
}
|
|
15
33
|
/** Provenance for a catalog: which system, library, and renderer produced it. */
|
|
16
34
|
export interface CatalogMeta {
|
|
17
35
|
/** Stable system id, kebab-case, e.g. `"compose-m3"`. */
|
|
@@ -24,6 +42,11 @@ export interface CatalogMeta {
|
|
|
24
42
|
renderer?: string;
|
|
25
43
|
/** ISO-8601 timestamp the catalog was generated, for provenance. */
|
|
26
44
|
generatedAt?: string;
|
|
45
|
+
/**
|
|
46
|
+
* The screen graph — main screens + their related secondaries/dialogs — for a
|
|
47
|
+
* per-screen import. Additive; absent ⇒ the flat catalog with no screen pages.
|
|
48
|
+
*/
|
|
49
|
+
screens?: CatalogScreen[];
|
|
27
50
|
}
|
|
28
51
|
/**
|
|
29
52
|
* The two rendered variants the sticker sheet shows for each component:
|
|
@@ -117,6 +140,13 @@ export interface CatalogComponent {
|
|
|
117
140
|
* components that carry only images.
|
|
118
141
|
*/
|
|
119
142
|
semantics?: SemanticTree;
|
|
143
|
+
/**
|
|
144
|
+
* The **wireframe SVG** — one bordered box per composable, generated ahead of
|
|
145
|
+
* time from {@link semantics} (see `buildWireframeSvg`). Baked into the bundle
|
|
146
|
+
* so a static catalog carries the schematic even without a daemon-rendered
|
|
147
|
+
* `layout` variant. Absent when there is no box geometry.
|
|
148
|
+
*/
|
|
149
|
+
wireframeSvg?: string;
|
|
120
150
|
}
|
|
121
151
|
/** A whole design-system catalog: provenance + token set + components. */
|
|
122
152
|
export interface Catalog {
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,KAAK,EACV,MAAM,EACN,YAAY,EACZ,WAAW,EACX,KAAK,EACL,YAAY,EACZ,QAAQ,EACT,MAAM,qBAAqB,CAAC;AAE7B,iFAAiF;AACjF,MAAM,WAAW,WAAW;IAC1B,yDAAyD;IACzD,MAAM,EAAE,MAAM,CAAC;IACf,gDAAgD;IAChD,KAAK,EAAE,MAAM,CAAC;IACd,uFAAuF;IACvF,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,0DAA0D;IAC1D,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,oEAAoE;IACpE,WAAW,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,KAAK,EACV,MAAM,EACN,YAAY,EACZ,WAAW,EACX,KAAK,EACL,YAAY,EACZ,QAAQ,EACT,MAAM,qBAAqB,CAAC;AAE7B;;;;;;GAMG;AACH,MAAM,WAAW,aAAa;IAC5B,qEAAqE;IACrE,EAAE,EAAE,MAAM,CAAC;IACX,0EAA0E;IAC1E,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,iFAAiF;AACjF,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ACf,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,cAAc,CAAC;IACzB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,gEAAgE;AAChE,MAAM,WAAW,gBAAgB;IAC/B,mDAAmD;IACnD,WAAW,EAAE,MAAM,CAAC;IACpB,sDAAsD;IACtD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,6CAA6C;IAC7C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,8EAA8E;IAC9E,SAAS,CAAC,EAAE,kBAAkB,CAAC;IAC/B,QAAQ,EAAE,iBAAiB,CAAC;IAC5B,iFAAiF;IACjF,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,yDAAyD;IACzD,UAAU,EAAE,SAAS,EAAE,CAAC;IACxB;;;;OAIG;IACH,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB;;;;OAIG;IACH,SAAS,CAAC,EAAE,YAAY,CAAC;IACzB;;;;;OAKG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,0EAA0E;AAC1E,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,WAAW,CAAC;IAClB;;;;OAIG;IACH,WAAW,CAAC,EAAE,YAAY,CAAC;IAC3B,UAAU,EAAE,gBAAgB,EAAE,CAAC;CAChC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Build the **wireframe SVG** for a component — the schematic that borders every
|
|
3
|
+
* composable, generated *ahead of time* from the semantics tree the renderer
|
|
4
|
+
* already produced.
|
|
5
|
+
*
|
|
6
|
+
* `compose/semantics-wireframe` produces this SVG in the daemon, but the static
|
|
7
|
+
* bundle ships the compact per-node geometry (bounds) rather than the SVG, so a
|
|
8
|
+
* static catalog has no wireframe render. Since the same bounds ride along on
|
|
9
|
+
* the {@link SemanticTree} (they already drive the redlines), we regenerate the
|
|
10
|
+
* wireframe here — a pure `bounds → SVG` projection, baked into the published
|
|
11
|
+
* bundle so the importer only has to *place* it, never compute it.
|
|
12
|
+
*
|
|
13
|
+
* The output is a plain, deterministic vector: one bordered rectangle per node
|
|
14
|
+
* that carries a box, in the render's own pixel space, so it overlays/compares
|
|
15
|
+
* against the ideal render 1:1. No fills, no text — the schematic a designer
|
|
16
|
+
* reads as "where every box sits".
|
|
17
|
+
*/
|
|
18
|
+
import type { SemanticTree } from "@design-parity/core";
|
|
19
|
+
/**
|
|
20
|
+
* Project a component's {@link SemanticTree} into a wireframe SVG string, or
|
|
21
|
+
* `undefined` when no node carries a box (nothing to draw). Pure and
|
|
22
|
+
* deterministic — the same tree always yields byte-identical SVG.
|
|
23
|
+
*/
|
|
24
|
+
export declare function buildWireframeSvg(tree: SemanticTree | undefined): string | undefined;
|
|
25
|
+
//# sourceMappingURL=wireframe.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wireframe.d.ts","sourceRoot":"","sources":["../src/wireframe.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,KAAK,EAAwB,YAAY,EAAE,MAAM,qBAAqB,CAAC;AA8B9E;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,YAAY,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAkBpF"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/** Muted ink for the wireframe strokes — legible on light and dark. */
|
|
2
|
+
const STROKE = "#5B6470";
|
|
3
|
+
/** Collect every node that carries a box, depth-first (root included). */
|
|
4
|
+
function boxedNodes(root) {
|
|
5
|
+
const out = [];
|
|
6
|
+
const walk = (n) => {
|
|
7
|
+
if (n.bounds)
|
|
8
|
+
out.push(n);
|
|
9
|
+
for (const child of n.children ?? [])
|
|
10
|
+
walk(child);
|
|
11
|
+
};
|
|
12
|
+
walk(root);
|
|
13
|
+
return out;
|
|
14
|
+
}
|
|
15
|
+
/** The union box of a set of bounds — the SVG viewport. */
|
|
16
|
+
function union(boxes) {
|
|
17
|
+
const minX = Math.min(...boxes.map((b) => b.x));
|
|
18
|
+
const minY = Math.min(...boxes.map((b) => b.y));
|
|
19
|
+
const maxX = Math.max(...boxes.map((b) => b.x + b.width));
|
|
20
|
+
const maxY = Math.max(...boxes.map((b) => b.y + b.height));
|
|
21
|
+
return { x: minX, y: minY, width: maxX - minX, height: maxY - minY };
|
|
22
|
+
}
|
|
23
|
+
/** Round to 2dp without trailing zeros, for compact deterministic output. */
|
|
24
|
+
function n(value) {
|
|
25
|
+
return Number(value.toFixed(2)).toString();
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Project a component's {@link SemanticTree} into a wireframe SVG string, or
|
|
29
|
+
* `undefined` when no node carries a box (nothing to draw). Pure and
|
|
30
|
+
* deterministic — the same tree always yields byte-identical SVG.
|
|
31
|
+
*/
|
|
32
|
+
export function buildWireframeSvg(tree) {
|
|
33
|
+
if (!tree)
|
|
34
|
+
return undefined;
|
|
35
|
+
const nodes = boxedNodes(tree.root);
|
|
36
|
+
if (nodes.length === 0)
|
|
37
|
+
return undefined;
|
|
38
|
+
const box = union(nodes.map((node) => node.bounds));
|
|
39
|
+
const rects = nodes
|
|
40
|
+
.map((node) => {
|
|
41
|
+
const b = node.bounds;
|
|
42
|
+
return `<rect x="${n(b.x)}" y="${n(b.y)}" width="${n(Math.max(0, b.width))}" height="${n(Math.max(0, b.height))}" fill="none" stroke="${STROKE}" stroke-width="1"/>`;
|
|
43
|
+
})
|
|
44
|
+
.join("");
|
|
45
|
+
const w = n(box.width);
|
|
46
|
+
const h = n(box.height);
|
|
47
|
+
return (`<svg xmlns="http://www.w3.org/2000/svg" width="${w}" height="${h}"` +
|
|
48
|
+
` viewBox="${n(box.x)} ${n(box.y)} ${w} ${h}">${rects}</svg>`);
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=wireframe.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wireframe.js","sour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C,aAAa,CAAC,GAAG;QACpE,aAAa,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,KAAK,QAAQ,CAC9D,CAAC;AACJ,CAAC"}
|
package/dist/write.d.ts
CHANGED
|
@@ -17,6 +17,8 @@ export interface WriteResult {
|
|
|
17
17
|
figmaPath?: string;
|
|
18
18
|
/** Number of image files written. */
|
|
19
19
|
imageCount: number;
|
|
20
|
+
/** Number of wireframe SVG files written. */
|
|
21
|
+
wireframeCount?: number;
|
|
20
22
|
}
|
|
21
23
|
/** Write the full importable catalog bundle to `outDir`. */
|
|
22
24
|
export declare function writeCatalog(catalog: Catalog, outDir: string, opts?: WriteOptions): Promise<WriteResult>;
|
package/dist/write.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"write.d.ts","sourceRoot":"","sources":["../src/write.ts"],"names":[],"mappings":"AA0BA,OAAO,
|
|
1
|
+
{"version":3,"file":"write.d.ts","sourceRoot":"","sources":["../src/write.ts"],"names":[],"mappings":"AA0BA,OAAO,EAA+C,KAAK,eAAe,EAAE,MAAM,eAAe,CAAC;AAClG,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAE1C,MAAM,WAAW,YAAa,SAAQ,eAAe;IACnD,iFAAiF;IACjF,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,0EAA0E;IAC1E,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,uDAAuD;IACvD,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,WAAW;IAC1B,mDAAmD;IACnD,YAAY,EAAE,MAAM,CAAC;IACrB,uEAAuE;IACvE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,+DAA+D;IAC/D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,qCAAqC;IACrC,UAAU,EAAE,MAAM,CAAC;IACnB,6CAA6C;IAC7C,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AA2BD,4DAA4D;AAC5D,wBAAsB,YAAY,CAChC,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,MAAM,EACd,IAAI,GAAE,YAAiB,GACtB,OAAO,CAAC,WAAW,CAAC,CAuDtB"}
|
package/dist/write.js
CHANGED
|
@@ -21,7 +21,7 @@ import { readFile } from "node:fs/promises";
|
|
|
21
21
|
import { dirname, isAbsolute, join, resolve } from "node:path";
|
|
22
22
|
import { tokensToDtcg } from "@design-parity/core";
|
|
23
23
|
import { toFigmaVariables } from "./figma.js";
|
|
24
|
-
import { imagePath, toCatalogManifest } from "./manifest.js";
|
|
24
|
+
import { imagePath, toCatalogManifest, wireframePath } from "./manifest.js";
|
|
25
25
|
const DATA_URI = /^data:([^;,]*)?(;base64)?,(.*)$/s;
|
|
26
26
|
/** Resolve the bytes for an {@link Image}: inline `data:` URI or a file path. */
|
|
27
27
|
async function imageBytes(image, sourceRoot) {
|
|
@@ -75,6 +75,14 @@ export async function writeCatalog(catalog, outDir, opts = {}) {
|
|
|
75
75
|
result.imageCount += 1;
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
|
+
// The pre-generated wireframe SVG (schematic), baked beside the images so the
|
|
79
|
+
// importer only fetches + places it.
|
|
80
|
+
if (component.wireframeSvg !== undefined) {
|
|
81
|
+
const dest = join(out, wireframePath(component.componentId));
|
|
82
|
+
await mkdir(dirname(dest), { recursive: true });
|
|
83
|
+
await writeFile(dest, component.wireframeSvg, "utf8");
|
|
84
|
+
result.wireframeCount = (result.wireframeCount ?? 0) + 1;
|
|
85
|
+
}
|
|
78
86
|
}
|
|
79
87
|
return result;
|
|
80
88
|
}
|
package/dist/write.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"write.js","sourceRoot":"","sources":["../src/write.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,EAAE,KAAK,EAA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,OAAO,CAAC,IAAI,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;gBAChD,MAAM,SAAS,CAAC,IAAI,EAAE,MAAM,UAAU,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC;gBAC3D,MAAM,CAAC,UAAU,IAAI,CAAC,CAAC;YACzB,CAAC;QACH,CAAC;QAED,8EAA8E;QAC9E,qCAAqC;QACrC,IAAI,SAAS,CAAC,YAAY,KAAK,SAAS,EAAE,CAAC;YACzC,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,EAAE,aAAa,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,CAAC;YAC7D,MAAM,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;YAChD,MAAM,SAAS,CAAC,IAAI,EAAE,SAAS,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC;YACtD,MAAM,CAAC,cAAc,GAAG,CAAC,MAAM,CAAC,cAAc,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;QAC3D,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,23 +1,28 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@design-parity/catalog-export",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.26",
|
|
4
4
|
"description": "Turn a rendered Compose component system (compose-preview data products) into an importable design-artifact catalog: per-component sticker sheets in two variants (ideal + layout), a W3C DTCG token set, and an accessibility 'greenline' annotation layer — laid out for Figma / Stitch / Claude Design import.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
7
|
+
"sideEffects": false,
|
|
7
8
|
"main": "./dist/index.js",
|
|
8
9
|
"types": "./dist/index.d.ts",
|
|
9
10
|
"exports": {
|
|
10
|
-
".": "./dist/index.js"
|
|
11
|
+
".": "./dist/index.js",
|
|
12
|
+
"./figma": {
|
|
13
|
+
"types": "./dist/figma.d.ts",
|
|
14
|
+
"default": "./dist/figma.js"
|
|
15
|
+
}
|
|
11
16
|
},
|
|
12
17
|
"files": [
|
|
13
18
|
"dist"
|
|
14
19
|
],
|
|
15
20
|
"scripts": {
|
|
16
21
|
"build": "tsc --build",
|
|
17
|
-
"test": "vitest run"
|
|
22
|
+
"test": "vitest run --root ../.. packages/catalog-export/test"
|
|
18
23
|
},
|
|
19
24
|
"dependencies": {
|
|
20
|
-
"@design-parity/core": "^0.1.
|
|
25
|
+
"@design-parity/core": "^0.1.26"
|
|
21
26
|
},
|
|
22
27
|
"repository": {
|
|
23
28
|
"type": "git",
|