@elaraai/east-ui-components 1.0.11 → 1.0.13

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.
@@ -6,6 +6,8 @@ export type SchematicValue = ValueTypeOf<typeof Schematic.Types.Schematic>;
6
6
  export type SchematicItemValue = ValueTypeOf<typeof Schematic.Types.Item>;
7
7
  /** East Schematic zone value type. */
8
8
  export type SchematicZoneValue = ValueTypeOf<typeof Schematic.Types.Zone>;
9
+ /** East Schematic shape-geometry value type (`rect` / `circle` / `polyline` / `polygon`). */
10
+ export type SchematicGeometryValue = ValueTypeOf<typeof Schematic.Types.Geometry>;
9
11
  export interface EastChakraSchematicProps {
10
12
  value: SchematicValue;
11
13
  storageKey: string;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/collections/schematic/index.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAQH,OAAO,EAAY,KAAK,WAAW,EAAE,MAAM,eAAe,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAQtD,iCAAiC;AACjC,MAAM,MAAM,cAAc,GAAG,WAAW,CAAC,OAAO,SAAS,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;AAE3E,sCAAsC;AACtC,MAAM,MAAM,kBAAkB,GAAG,WAAW,CAAC,OAAO,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;AAE1E,sCAAsC;AACtC,MAAM,MAAM,kBAAkB,GAAG,WAAW,CAAC,OAAO,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;AAE1E,MAAM,WAAW,wBAAwB;IACrC,KAAK,EAAE,cAAc,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;CACtB;AA6LD;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,gEAolBiE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/collections/schematic/index.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAQH,OAAO,EAAY,KAAK,WAAW,EAAE,MAAM,eAAe,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAUtD,iCAAiC;AACjC,MAAM,MAAM,cAAc,GAAG,WAAW,CAAC,OAAO,SAAS,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;AAE3E,sCAAsC;AACtC,MAAM,MAAM,kBAAkB,GAAG,WAAW,CAAC,OAAO,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;AAE1E,sCAAsC;AACtC,MAAM,MAAM,kBAAkB,GAAG,WAAW,CAAC,OAAO,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;AAE1E,6FAA6F;AAC7F,MAAM,MAAM,sBAAsB,GAAG,WAAW,CAAC,OAAO,SAAS,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;AAElF,MAAM,WAAW,wBAAwB;IACrC,KAAK,EAAE,cAAc,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;CACtB;AAmKD;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,gEAglBiE,CAAC"}
@@ -0,0 +1,83 @@
1
+ import { ValueTypeOf } from '@elaraai/east';
2
+ import { Schematic } from '@elaraai/east-ui/internal';
3
+ type SchematicValue = ValueTypeOf<typeof Schematic.Types.Schematic>;
4
+ type SchematicItemValue = ValueTypeOf<typeof Schematic.Types.Item>;
5
+ type Pt = {
6
+ x: number;
7
+ y: number;
8
+ };
9
+ /** Per-item LOD tier (mirrors the React layer). */
10
+ export type LodTier = "card" | "label" | "dot";
11
+ /** An `[r, g, b]` triple in 0–255. */
12
+ export type RGB = [number, number, number];
13
+ /**
14
+ * Theme-resolved colours the paint layer needs. The React layer resolves these
15
+ * from Chakra semantic tokens (CSS custom properties) once per theme; the paint
16
+ * layer is colour-system-agnostic and just consumes RGB.
17
+ */
18
+ export interface SchematicPalette {
19
+ /** Brand teal (links, `info` status). */
20
+ brand600: RGB;
21
+ brand500: RGB;
22
+ /** Foreground ink (`ink` tone). */
23
+ fg: RGB;
24
+ fgMuted: RGB;
25
+ fgSubtle: RGB;
26
+ /** Zone `muted` stroke. */
27
+ borderStrong: RGB;
28
+ borderSubtle: RGB;
29
+ /** Card / pin background, and the eyebrow-label halo. */
30
+ bgSurface: RGB;
31
+ bgPanel: RGB;
32
+ /** Status tones. */
33
+ statusOk: RGB;
34
+ statusWarn: RGB;
35
+ statusBad: RGB;
36
+ /** Dot ring. */
37
+ white: RGB;
38
+ }
39
+ /** The pan/zoom transform in CSS pixels: `screen = world × ppu + t`. */
40
+ export interface PaintCamera {
41
+ ppu: number;
42
+ tx: number;
43
+ ty: number;
44
+ }
45
+ /** Everything {@link paintSchematic} needs for one frame. */
46
+ export interface PaintInput {
47
+ ctx: CanvasRenderingContext2D;
48
+ value: SchematicValue;
49
+ cam: PaintCamera;
50
+ /** Canvas size in CSS px (the ctx is pre-scaled by devicePixelRatio). */
51
+ width: number;
52
+ height: number;
53
+ /** Viewport-culled items (the React layer's `visibleItems`). */
54
+ visibleItems: readonly SchematicItemValue[];
55
+ /** Per-item LOD tier after declutter. */
56
+ tiers: ReadonlyMap<string, LodTier>;
57
+ selected: string | null;
58
+ /** Item key → world centre, for link endpoints. */
59
+ centers: ReadonlyMap<string, Pt>;
60
+ palette: SchematicPalette;
61
+ }
62
+ /** Centre / radius / sweep of a DXF bulge arc, ready for `CanvasRenderingContext2D.arc`. */
63
+ export interface BulgeArc {
64
+ cx: number;
65
+ cy: number;
66
+ radius: number;
67
+ startAngle: number;
68
+ endAngle: number;
69
+ anticlockwise: boolean;
70
+ }
71
+ /**
72
+ * Pure geometry of the circular arc a DXF `bulge` encodes for the edge
73
+ * `p1`→`p2` (`bulge = tan(includedAngle / 4)`; sign = turn direction). Returns
74
+ * `null` for a straight or degenerate edge (`|bulge|` ~ 0, or a zero-length
75
+ * chord). Screen space: the caller has already transformed the vertices, and
76
+ * the uniform camera scale preserves the bulge (it is the tangent of an angle).
77
+ * Exported so the arc maths is unit-testable without a Canvas2D context.
78
+ */
79
+ export declare function arcFromBulge(p1: Pt, p2: Pt, bulge: number): BulgeArc | null;
80
+ /** Draw the schematic's bulk-shape layer for one frame. Clears first. */
81
+ export declare function paintSchematic(input: PaintInput): void;
82
+ export {};
83
+ //# sourceMappingURL=paint.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"paint.d.ts","sourceRoot":"","sources":["../../../src/collections/schematic/paint.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAGtD,KAAK,cAAc,GAAG,WAAW,CAAC,OAAO,SAAS,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;AACpE,KAAK,kBAAkB,GAAG,WAAW,CAAC,OAAO,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;AACnE,KAAK,EAAE,GAAG;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAInC,mDAAmD;AACnD,MAAM,MAAM,OAAO,GAAG,MAAM,GAAG,OAAO,GAAG,KAAK,CAAC;AAE/C,sCAAsC;AACtC,MAAM,MAAM,GAAG,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AAE3C;;;;GAIG;AACH,MAAM,WAAW,gBAAgB;IAC7B,yCAAyC;IACzC,QAAQ,EAAE,GAAG,CAAC;IACd,QAAQ,EAAE,GAAG,CAAC;IACd,mCAAmC;IACnC,EAAE,EAAE,GAAG,CAAC;IACR,OAAO,EAAE,GAAG,CAAC;IACb,QAAQ,EAAE,GAAG,CAAC;IACd,2BAA2B;IAC3B,YAAY,EAAE,GAAG,CAAC;IAClB,YAAY,EAAE,GAAG,CAAC;IAClB,yDAAyD;IACzD,SAAS,EAAE,GAAG,CAAC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,UAAU,GAAG,IAAI,CAoPtD"}
@@ -0,0 +1,9 @@
1
+ import { SchematicPalette } from './paint';
2
+ /**
3
+ * Renders a visually-hidden set of themed probes and reports the resolved
4
+ * {@link SchematicPalette} to `onResolve` on mount and on every theme change.
5
+ */
6
+ export declare const SchematicPaletteProbe: import('react').NamedExoticComponent<{
7
+ onResolve: (palette: SchematicPalette) => void;
8
+ }>;
9
+ //# sourceMappingURL=theme.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../../src/collections/schematic/theme.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAcH,OAAO,EAAE,KAAK,gBAAgB,EAAY,MAAM,SAAS,CAAC;AA2B1D;;;GAGG;AACH,eAAO,MAAM,qBAAqB;eACF,CAAC,OAAO,EAAE,gBAAgB,KAAK,IAAI;EAyBjE,CAAC"}