@pagemold/graph 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,9 @@
1
+ /**
2
+ * PageMold Graph Package
3
+ * Design Graph types and validation - the contract between capture library and Figma plugin
4
+ */
5
+ export * from './types.js';
6
+ export * from './validation.js';
7
+ export type { FidelityTag, ReasonCode } from './types.js';
8
+ export type { DesignGraph } from './schema.js';
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAGhC,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAK1D,YAAY,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,7 @@
1
+ /**
2
+ * PageMold Graph Package
3
+ * Design Graph types and validation - the contract between capture library and Figma plugin
4
+ */
5
+ export * from './types.js';
6
+ export * from './validation.js';
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Design Graph Schema v1
3
+ * The contract between capture library and Figma plugin
4
+ * Part of the PageMold project
5
+ */
6
+ export * from './types.js';
7
+ export { validateDesignGraph, ManifestSchema } from './validation.js';
8
+ export type FidelityTag = "exact" | "approx" | "unsupported";
9
+ export type ReasonCode = "RASTER_FALLBACK" | "FONT_SUBSTITUTED" | "EASING_APPROX" | "WEBGL" | "CANVAS" | "LOTTIE" | "SCROLL_LINKED" | "SVG_INVALID" | "VIDEO" | "IFRAME_CROSS_ORIGIN" | "OTHER";
10
+ /**
11
+ * Design Graph v1 - Main contract type
12
+ * Validates structure for cross-package communication
13
+ */
14
+ import { z } from 'zod';
15
+ import { ManifestSchema as _ManifestSchema } from './validation.js';
16
+ export type DesignGraph = z.infer<typeof _ManifestSchema>;
17
+ /**
18
+ * Schema validation rules
19
+ */
20
+ //# sourceMappingURL=schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../src/schema.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAGtE,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,QAAQ,GAAG,aAAa,CAAC;AAE7D,MAAM,MAAM,UAAU,GAClB,iBAAiB,GACjB,kBAAkB,GAClB,eAAe,GACf,OAAO,GACP,QAAQ,GACR,QAAQ,GACR,eAAe,GACf,aAAa,GACb,OAAO,GACP,qBAAqB,GACrB,OAAO,CAAC;AAEZ;;;GAGG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,cAAc,IAAI,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACpE,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAE1D;;GAEG"}
package/dist/schema.js ADDED
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Design Graph Schema v1
3
+ * The contract between capture library and Figma plugin
4
+ * Part of the PageMold project
5
+ */
6
+ // Re-export types and validation
7
+ export * from './types.js';
8
+ export { validateDesignGraph, ManifestSchema } from './validation.js';
9
+ /**
10
+ * Schema validation rules
11
+ */
12
+ // Coordinates are parent-local pixels at the capture viewport
13
+ // Assets are referenced by content hash
14
+ // Every node has a fidelity tag
15
+ // Unknown fields are rejected in strict mode (CI) and ignored with warning in plugin
16
+ // Schema changes go through ADR, version bump, migration function
17
+ //# sourceMappingURL=schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.js","sourceRoot":"","sources":["../src/schema.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,iCAAiC;AACjC,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AA0BtE;;GAEG;AACH,8DAA8D;AAC9D,wCAAwC;AACxC,gCAAgC;AAChC,qFAAqF;AACrF,kEAAkE"}
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Design Graph Types - Runtime types re-exported from validation schemas
3
+ * These types are the runtime representation of the validated schema
4
+ */
5
+ import { z } from 'zod';
6
+ import { ManifestSchema, PageDocSchema, NodeSchema, StyleSchema, FillSchema, StrokeSchema, EffectSchema, FontSchema, StateSchema, DiagnosticSchema, TokenSchema, ComponentSchema, GradientStopSchema } from './validation.js';
7
+ export type Manifest = z.infer<typeof ManifestSchema>;
8
+ export type PageDoc = z.infer<typeof PageDocSchema>;
9
+ export type Node = z.infer<typeof NodeSchema>;
10
+ export type Style = z.infer<typeof StyleSchema>;
11
+ export type Fill = z.infer<typeof FillSchema>;
12
+ export type Stroke = z.infer<typeof StrokeSchema>;
13
+ export type Effect = z.infer<typeof EffectSchema>;
14
+ export type Font = z.infer<typeof FontSchema>;
15
+ export type State = z.infer<typeof StateSchema>;
16
+ export type Diagnostic = z.infer<typeof DiagnosticSchema>;
17
+ export type Token = z.infer<typeof TokenSchema>;
18
+ export type GradientStop = z.infer<typeof GradientStopSchema>;
19
+ export type Component = z.infer<typeof ComponentSchema>;
20
+ export type FidelityTag = "exact" | "approx" | "unsupported";
21
+ export type ReasonCode = "RASTER_FALLBACK" | "FONT_SUBSTITUTED" | "EASING_APPROX" | "WEBGL" | "CANVAS" | "LOTTIE" | "SCROLL_LINKED" | "SVG_INVALID" | "VIDEO" | "IFRAME_CROSS_ORIGIN" | "OTHER";
22
+ export interface Capture {
23
+ viewport: {
24
+ width: number;
25
+ height: number;
26
+ deviceScale: number;
27
+ };
28
+ screenshot: string;
29
+ root: Node;
30
+ }
31
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,cAAc,EACd,aAAa,EACb,UAAU,EACV,WAAW,EACX,UAAU,EACV,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,WAAW,EACX,gBAAgB,EAChB,WAAW,EACX,eAAe,EACf,kBAAkB,EACnB,MAAM,iBAAiB,CAAC;AAGzB,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AACtD,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AACpD,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC;AAC9C,MAAM,MAAM,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC;AAChD,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC;AAC9C,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AAClD,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AAClD,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC;AAC9C,MAAM,MAAM,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC;AAChD,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAC1D,MAAM,MAAM,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC;AAChD,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAC9D,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAGxD,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,QAAQ,GAAG,aAAa,CAAC;AAC7D,MAAM,MAAM,UAAU,GAClB,iBAAiB,GACjB,kBAAkB,GAClB,eAAe,GACf,OAAO,GACP,QAAQ,GACR,QAAQ,GACR,eAAe,GACf,aAAa,GACb,OAAO,GACP,qBAAqB,GACrB,OAAO,CAAC;AAEZ,MAAM,WAAW,OAAO;IACtB,QAAQ,EAAE;QACR,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,MAAM,CAAC;QACf,WAAW,EAAE,MAAM,CAAC;KACrB,CAAC;IACF,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,IAAI,CAAC;CACZ"}
package/dist/types.js ADDED
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Design Graph Types - Runtime types re-exported from validation schemas
3
+ * These types are the runtime representation of the validated schema
4
+ */
5
+ export {};
6
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Design Graph Types - Runtime types re-exported from validation schemas
3
+ * These types are the runtime representation of the validated schema
4
+ */
5
+ import { z } from 'zod';
6
+ import { ManifestSchema, PageDocSchema, NodeSchema, StyleSchema, FillSchema, StrokeSchema, EffectSchema, FontSchema, StateSchema, DiagnosticSchema, TokenSchema, ComponentSchema, GradientStopSchema } from './validation.js';
7
+ export type Manifest = z.infer<typeof ManifestSchema>;
8
+ export type PageDoc = z.infer<typeof PageDocSchema>;
9
+ export type Node = z.infer<typeof NodeSchema>;
10
+ export type Style = z.infer<typeof StyleSchema>;
11
+ export type Fill = z.infer<typeof FillSchema>;
12
+ export type Stroke = z.infer<typeof StrokeSchema>;
13
+ export type Effect = z.infer<typeof EffectSchema>;
14
+ export type Font = z.infer<typeof FontSchema>;
15
+ export type State = z.infer<typeof StateSchema>;
16
+ export type Diagnostic = z.infer<typeof DiagnosticSchema>;
17
+ export type Token = z.infer<typeof TokenSchema>;
18
+ export type GradientStop = z.infer<typeof GradientStopSchema>;
19
+ export type Component = z.infer<typeof ComponentSchema>;
20
+ export type FidelityTag = "exact" | "approx" | "unsupported";
21
+ export type ReasonCode = "RASTER_FALLBACK" | "FONT_SUBSTITUTED" | "EASING_APPROX" | "WEBGL" | "CANVAS" | "LOTTIE" | "SCROLL_LINKED" | "SVG_INVALID" | "VIDEO" | "IFRAME_CROSS_ORIGIN" | "OTHER";
22
+ export interface Capture {
23
+ viewport: {
24
+ width: number;
25
+ height: number;
26
+ deviceScale: number;
27
+ };
28
+ screenshot: string;
29
+ root: Node;
30
+ }
31
+ //# sourceMappingURL=validation-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validation-types.d.ts","sourceRoot":"","sources":["../src/validation-types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,cAAc,EACd,aAAa,EACb,UAAU,EACV,WAAW,EACX,UAAU,EACV,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,WAAW,EACX,gBAAgB,EAChB,WAAW,EACX,eAAe,EACf,kBAAkB,EACnB,MAAM,iBAAiB,CAAC;AAGzB,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AACtD,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AACpD,MAAM,MAAM,IAAI,GAAG,CAA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AAM,CAAC;IACnB,IAAI,EAAE,IAAI,CAAC;CACZ"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Design Graph Types - Runtime types re-exported from validation schemas
3
+ * These types are the runtime representation of the validated schema
4
+ */
5
+ export {};
6
+ //# sourceMappingURL=validation-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validation-types.js","sourceRoot":"","sources":["../src/validation-types.ts"],"names":[],"mappings":"AAAA;;;GAGG"}