@elaraai/east-ui 1.0.97 → 1.0.98

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.
Files changed (99) hide show
  1. package/dist/src/collections/index.d.ts +0 -1
  2. package/dist/src/collections/index.d.ts.map +1 -1
  3. package/dist/src/collections/index.js +0 -1
  4. package/dist/src/collections/index.js.map +1 -1
  5. package/dist/src/component.d.ts +0 -999
  6. package/dist/src/component.d.ts.map +1 -1
  7. package/dist/src/component.js +0 -44
  8. package/dist/src/component.js.map +1 -1
  9. package/dist/src/contracts/drag.d.ts +2 -2
  10. package/dist/src/contracts/drag.js +2 -2
  11. package/dist/src/contracts/editing.d.ts +4 -0
  12. package/dist/src/contracts/editing.d.ts.map +1 -1
  13. package/dist/src/contracts/editing.js +2 -1
  14. package/dist/src/contracts/editing.js.map +1 -1
  15. package/dist/src/index.d.ts +2 -1
  16. package/dist/src/index.d.ts.map +1 -1
  17. package/dist/src/index.js +4 -1
  18. package/dist/src/index.js.map +1 -1
  19. package/dist/src/internal.d.ts +4 -1
  20. package/dist/src/internal.d.ts.map +1 -1
  21. package/dist/src/internal.js +5 -2
  22. package/dist/src/internal.js.map +1 -1
  23. package/dist/src/layout/snap-grid/index.d.ts +1 -0
  24. package/dist/src/layout/snap-grid/index.d.ts.map +1 -1
  25. package/dist/src/pick/panel/index.js +1 -1
  26. package/dist/src/pick/panel/index.js.map +1 -1
  27. package/dist/src/platform/slice/index.d.ts +4 -7
  28. package/dist/src/platform/slice/index.d.ts.map +1 -1
  29. package/dist/src/platform/slice/index.js +5 -8
  30. package/dist/src/platform/slice/index.js.map +1 -1
  31. package/dist/src/platform/slice/record-area.d.ts +181 -0
  32. package/dist/src/platform/slice/record-area.d.ts.map +1 -0
  33. package/dist/src/platform/slice/record-area.js +304 -0
  34. package/dist/src/platform/slice/record-area.js.map +1 -0
  35. package/dist/src/platform/slice/record-chrome.d.ts +138 -0
  36. package/dist/src/platform/slice/record-chrome.d.ts.map +1 -1
  37. package/dist/src/platform/slice/record-plan.d.ts +34 -1
  38. package/dist/src/platform/slice/record-plan.d.ts.map +1 -1
  39. package/dist/src/platform/slice/record-plan.js +126 -3
  40. package/dist/src/platform/slice/record-plan.js.map +1 -1
  41. package/dist/src/platform/slice/record-series.d.ts +166 -0
  42. package/dist/src/platform/slice/record-series.d.ts.map +1 -0
  43. package/dist/src/platform/slice/record-series.js +258 -0
  44. package/dist/src/platform/slice/record-series.js.map +1 -0
  45. package/dist/src/platform/slice/record-types.d.ts +1862 -13
  46. package/dist/src/platform/slice/record-types.d.ts.map +1 -1
  47. package/dist/src/platform/slice/record-types.js +50 -4
  48. package/dist/src/platform/slice/record-types.js.map +1 -1
  49. package/dist/src/platform/slice/record.d.ts +17 -2
  50. package/dist/src/platform/slice/record.d.ts.map +1 -1
  51. package/dist/src/platform/slice/record.js +62 -9
  52. package/dist/src/platform/slice/record.js.map +1 -1
  53. package/dist/src/runtime/collections/index.d.ts +0 -1
  54. package/dist/src/runtime/collections/index.d.ts.map +1 -1
  55. package/dist/src/runtime/collections/index.js +0 -1
  56. package/dist/src/runtime/collections/index.js.map +1 -1
  57. package/dist/src/runtime/record-slice-source.d.ts +298 -0
  58. package/dist/src/runtime/record-slice-source.d.ts.map +1 -1
  59. package/dist/src/runtime/record-slice-source.js +554 -16
  60. package/dist/src/runtime/record-slice-source.js.map +1 -1
  61. package/dist/src/runtime/record-slice.d.ts +87 -3
  62. package/dist/src/runtime/record-slice.d.ts.map +1 -1
  63. package/dist/src/runtime/record-slice.js +175 -12
  64. package/dist/src/runtime/record-slice.js.map +1 -1
  65. package/dist/src/slice/record/index.d.ts +69 -0
  66. package/dist/src/slice/record/index.d.ts.map +1 -1
  67. package/dist/src/style/color.d.ts +237 -0
  68. package/dist/src/style/color.d.ts.map +1 -0
  69. package/dist/src/style/color.js +105 -0
  70. package/dist/src/style/color.js.map +1 -0
  71. package/dist/src/style/namespace.d.ts +151 -1
  72. package/dist/src/style/namespace.d.ts.map +1 -1
  73. package/dist/src/style/namespace.js +9 -1
  74. package/dist/src/style/namespace.js.map +1 -1
  75. package/dist/src/style.d.ts +3 -0
  76. package/dist/src/style.d.ts.map +1 -1
  77. package/dist/src/style.js +3 -0
  78. package/dist/src/style.js.map +1 -1
  79. package/dist/test/style.examples.d.ts +1 -0
  80. package/dist/test/style.examples.d.ts.map +1 -1
  81. package/dist/test/style.examples.js +17 -2
  82. package/dist/test/style.examples.js.map +1 -1
  83. package/package.json +4 -4
  84. package/dist/src/collections/schematic/index.d.ts +0 -1390
  85. package/dist/src/collections/schematic/index.d.ts.map +0 -1
  86. package/dist/src/collections/schematic/index.js +0 -815
  87. package/dist/src/collections/schematic/index.js.map +0 -1
  88. package/dist/src/collections/schematic/types.d.ts +0 -1183
  89. package/dist/src/collections/schematic/types.d.ts.map +0 -1
  90. package/dist/src/collections/schematic/types.js +0 -724
  91. package/dist/src/collections/schematic/types.js.map +0 -1
  92. package/dist/src/runtime/collections/schematic.d.ts +0 -73
  93. package/dist/src/runtime/collections/schematic.d.ts.map +0 -1
  94. package/dist/src/runtime/collections/schematic.js +0 -69
  95. package/dist/src/runtime/collections/schematic.js.map +0 -1
  96. package/dist/test/collections/schematic.examples.d.ts +0 -23
  97. package/dist/test/collections/schematic.examples.d.ts.map +0 -1
  98. package/dist/test/collections/schematic.examples.js +0 -602
  99. package/dist/test/collections/schematic.examples.js.map +0 -1
@@ -1,724 +0,0 @@
1
- /**
2
- * Copyright (c) 2025 Elara AI Pty Ltd
3
- * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.
4
- */
5
- import { ArrayType, BooleanType, FloatType, NullType, OptionType, StringType, StructType, VariantType, } from "@elaraai/east";
6
- import { StatusTokenType } from "../../style/interaction.js";
7
- /**
8
- * Theme tone for zone strokes, hatching, and links.
9
- *
10
- * @remarks
11
- * Colour stays theme-owned: data selects a tone and the renderer's recipe
12
- * maps each tone to its token.
13
- *
14
- * @property brand - Brand teal
15
- * @property ink - Foreground ink
16
- * @property muted - Muted foreground
17
- * @property success - Status ok
18
- * @property warning - Status warn
19
- * @property danger - Status bad
20
- */
21
- export const SchematicToneType = VariantType({
22
- /** Brand teal */
23
- brand: NullType,
24
- /** Foreground ink */
25
- ink: NullType,
26
- /** Muted foreground */
27
- muted: NullType,
28
- /** Status ok */
29
- success: NullType,
30
- /** Status warn */
31
- warning: NullType,
32
- /** Status bad */
33
- danger: NullType,
34
- });
35
- /**
36
- * Zone render pattern — each case carries its style configuration.
37
- *
38
- * @property outline - Dashed boundary with an eyebrow label (rooms, cells)
39
- * @property hatch - Hatched band (walkways, aisles, exclusion strips)
40
- */
41
- export const SchematicZonePatternType = VariantType({
42
- /** Dashed boundary with an eyebrow label (rooms, cells) */
43
- outline: StructType({
44
- /** Stroke tone (default `muted`) */
45
- tone: OptionType(SchematicToneType),
46
- }),
47
- /** Hatched band (walkways, aisles, exclusion strips) */
48
- hatch: StructType({
49
- /** Hatch-line tone (default `muted`) */
50
- tone: OptionType(SchematicToneType),
51
- /** Line spacing in pixels (default 8) */
52
- spacing: OptionType(FloatType),
53
- /** Line angle in degrees (default 45) */
54
- angle: OptionType(FloatType),
55
- }),
56
- });
57
- /**
58
- * Link render style — each case carries its stroke configuration.
59
- *
60
- * @property solid - A physical run (pipe, conveyor)
61
- * @property dashed - A routing / logical connection
62
- */
63
- export const SchematicLinkStyleType = VariantType({
64
- /** A physical run (pipe, conveyor) */
65
- solid: StructType({
66
- /** Stroke tone (default `brand`) */
67
- tone: OptionType(SchematicToneType),
68
- /** Stroke width in pixels (default 2.5) */
69
- weight: OptionType(FloatType),
70
- }),
71
- /** A routing / logical connection */
72
- dashed: StructType({
73
- /** Stroke tone (default `muted`) */
74
- tone: OptionType(SchematicToneType),
75
- /** Stroke width in pixels (default 1.5) */
76
- weight: OptionType(FloatType),
77
- }),
78
- });
79
- /**
80
- * Link routing mode.
81
- *
82
- * @remarks
83
- * `orthogonal` (the default) routes axis-aligned with rounded corners —
84
- * the conventional pipe-diagram look; `direct` draws straight segments
85
- * between anchors. `via` waypoints apply in both modes.
86
- *
87
- * @property orthogonal - Axis-aligned with rounded corners
88
- * @property direct - Straight segments between anchors
89
- */
90
- export const SchematicRouteType = VariantType({
91
- /** Axis-aligned with rounded corners */
92
- orthogonal: StructType({
93
- /** Corner radius in pixels (default 8) */
94
- corner: OptionType(FloatType),
95
- }),
96
- /** Straight segments between anchors */
97
- direct: NullType,
98
- });
99
- /**
100
- * A world-coordinate point (used by link waypoints).
101
- *
102
- * @property x - World x
103
- * @property y - World y
104
- */
105
- export const SchematicPointType = StructType({
106
- /** World x */
107
- x: FloatType,
108
- /** World y */
109
- y: FloatType,
110
- });
111
- /**
112
- * A polyline / polygon vertex — a world point plus DXF `bulge`.
113
- *
114
- * @remarks
115
- * `bulge` encodes the edge from THIS vertex to the NEXT one: `0` is a
116
- * straight segment; nonzero is a circular arc where
117
- * `bulge = tan(includedAngle / 4)` and the sign gives the turn direction
118
- * (positive = counter-clockwise in world space). One polyline / polygon thus
119
- * stores true curved kerbs / walls exactly — no flattening into many short
120
- * segments. For a closed `polygon`, the last vertex's `bulge` applies to the
121
- * closing edge back to the first vertex.
122
- *
123
- * @property x - World x
124
- * @property y - World y
125
- * @property bulge - DXF bulge for the edge to the next vertex (0 = straight)
126
- */
127
- export const SchematicVertexType = StructType({
128
- /** World x */
129
- x: FloatType,
130
- /** World y */
131
- y: FloatType,
132
- /** DXF bulge for the edge to the next vertex (0 = straight; `tan(includedAngle / 4)`). */
133
- bulge: FloatType,
134
- });
135
- /**
136
- * Shared shape geometry for zones (`geometry`) and item footprints
137
- * (`footprint`) — one variant, four cases.
138
- *
139
- * @remarks
140
- * Geometry is **additive**: a zone keeps its required `x/y/width/height`
141
- * bounding box and an item keeps its required `x/y` anchor/centroid; the
142
- * shape, when present, is what the renderer strokes/fills. Absent geometry
143
- * (`none`) means today's behaviour — a zone is its rect, an item is its
144
- * point + icon. `circle` centres on the entity anchor (an item's `x/y`, a
145
- * zone's bbox centre). `polyline` / `polygon` carry {@link SchematicVertexType}
146
- * vertices in world coords, each with a DXF `bulge`, so curved kerbs / walls
147
- * are exact (no flattening); all of them paint on the Canvas2D layer, while
148
- * `rect` keeps the marker fast path.
149
- *
150
- * @property rect - Axis-aligned box (zones: the `x/y/width/height` box; items: the point / marker form)
151
- * @property circle - Circle centred on the entity anchor; `radius` in world units (tanks, silos)
152
- * @property polyline - Open, arc-aware polyline in world coords; optional world-space band `width`
153
- * @property polygon - Closed, arc-aware polygon in world coords (>= 3 vertices, auto-closed)
154
- */
155
- export const SchematicGeometryType = VariantType({
156
- /** Axis-aligned box — zones use `x/y/width/height`; items, the point / marker form. */
157
- rect: NullType,
158
- /** Circle centred on the entity anchor (item `x/y` or zone bbox centre); `radius` in world units. */
159
- circle: StructType({
160
- /** Circle radius in world units. */
161
- radius: FloatType,
162
- }),
163
- /** Open, arc-aware polyline in world coords; optional world-space band width. */
164
- polyline: StructType({
165
- /** Vertices in world coords, in order (each carries a DXF bulge). */
166
- vertices: ArrayType(SchematicVertexType),
167
- /** Optional band width in world units — the stroke widens into a road / aisle. */
168
- width: OptionType(FloatType),
169
- }),
170
- /** Closed, arc-aware polygon in world coords (>= 3 vertices, auto-closed). */
171
- polygon: StructType({
172
- /** Boundary vertices in world coords, in order (each carries a DXF bulge). */
173
- vertices: ArrayType(SchematicVertexType),
174
- }),
175
- });
176
- /**
177
- * A resolved placed item (node card).
178
- *
179
- * @property key - Item identity — links reference it; `onSelect` returns it
180
- * @property x - World x of the card centre
181
- * @property y - World y of the card centre
182
- * @property label - Primary identity line
183
- * @property sublabel - Optional muted second line (kind / capacity)
184
- * @property icon - Optional Font Awesome solid icon name
185
- * @property status - Optional status dot tone
186
- * @property meter - Optional mini utilisation bar
187
- * @property metric - Optional live metric text
188
- * @property width - Optional world width — renders the wide bar form
189
- * @property footprint - Optional shape footprint; absent ⇒ point + icon (`x/y` stay the anchor/centroid)
190
- * @property tone - Optional colour override (semantic tone); absent ⇒ `status` drives the colour
191
- * @property color - Optional raw CSS stroke / marker tint; wins over `tone`
192
- * @property bg - Optional raw CSS fill for a polygon / circle footprint
193
- * @property fillOpacity - Optional fill alpha (0–1) for a polygon / circle footprint
194
- * @property weight - Optional stroke width in px
195
- */
196
- export const SchematicItemType = StructType({
197
- /** Item identity — links reference it; `onSelect` returns it */
198
- key: StringType,
199
- /** World x of the card centre */
200
- x: FloatType,
201
- /** World y of the card centre */
202
- y: FloatType,
203
- /** Primary identity line */
204
- label: StringType,
205
- /** Optional muted second line (kind / capacity) */
206
- sublabel: OptionType(StringType),
207
- /** Optional Font Awesome solid icon name */
208
- icon: OptionType(StringType),
209
- /** Optional status dot tone */
210
- status: OptionType(StatusTokenType),
211
- /** Optional mini utilisation bar */
212
- meter: OptionType(StructType({
213
- /** Current value */
214
- value: FloatType,
215
- /** Full-scale value */
216
- max: FloatType,
217
- })),
218
- /** Optional live metric text */
219
- metric: OptionType(StringType),
220
- /** Optional world width — renders the wide bar form */
221
- width: OptionType(FloatType),
222
- /** Optional shape footprint; absent ⇒ point + icon (`x/y` stay the anchor/centroid) */
223
- footprint: OptionType(SchematicGeometryType),
224
- /** Optional colour override (semantic tone); absent ⇒ `status` drives the colour */
225
- tone: OptionType(SchematicToneType),
226
- /** Optional raw CSS stroke / marker tint (e.g. `"#2D7FF9"`, `"teal"`); wins over `tone` */
227
- color: OptionType(StringType),
228
- /** Optional raw CSS fill for a polygon / circle footprint */
229
- bg: OptionType(StringType),
230
- /** Optional fill alpha (0–1) for a polygon / circle footprint */
231
- fillOpacity: OptionType(FloatType),
232
- /** Optional stroke width in px */
233
- weight: OptionType(FloatType),
234
- /** Optional slice-excluded flag — when a {@link SchematicSliceEffectType}
235
- * is active, a `some(true)` item is treated as filtered-out (ghosted /
236
- * hidden per the effect); absent / `some(false)` ⇒ included / normal. */
237
- excluded: OptionType(BooleanType),
238
- /** Optional layer membership — the `key` of a {@link SchematicLayerType} in
239
- * the root `layers`. Hidden when its layer is hidden; absent ⇒ unlayered
240
- * (always visible). An unknown key is treated as always-visible. */
241
- layer: OptionType(StringType),
242
- });
243
- /**
244
- * A resolved annotation zone (room, cell, walkway band).
245
- *
246
- * @property key - Zone identity
247
- * @property label - Mono eyebrow label on the boundary
248
- * @property x - World x of the top-left corner
249
- * @property y - World y of the top-left corner
250
- * @property width - World width
251
- * @property height - World height
252
- * @property pattern - Render pattern (`outline` / `hatch`)
253
- * @property geometry - Optional shape geometry; absent ⇒ rect (`x/y/width/height` stay the bounding box)
254
- * @property tone - Optional colour override (semantic tone); absent ⇒ the `pattern`'s tone drives the colour
255
- * @property color - Optional raw CSS stroke tint; wins over `tone`
256
- * @property bg - Optional raw CSS area fill (opt-in; zones are unfilled by default)
257
- * @property fillOpacity - Optional fill alpha (0–1) for the area fill
258
- * @property weight - Optional stroke width in px
259
- */
260
- export const SchematicZoneType = StructType({
261
- /** Zone identity */
262
- key: StringType,
263
- /** Mono eyebrow label on the boundary */
264
- label: StringType,
265
- /** World x of the top-left corner */
266
- x: FloatType,
267
- /** World y of the top-left corner */
268
- y: FloatType,
269
- /** World width */
270
- width: FloatType,
271
- /** World height */
272
- height: FloatType,
273
- /** Render pattern (`outline` / `hatch`) */
274
- pattern: SchematicZonePatternType,
275
- /** Optional shape geometry; absent ⇒ rect (`x/y/width/height` stay the bounding box) */
276
- geometry: OptionType(SchematicGeometryType),
277
- /** Optional colour override (semantic tone); absent ⇒ the `pattern`'s tone drives the colour */
278
- tone: OptionType(SchematicToneType),
279
- /** Optional raw CSS stroke tint (e.g. `"#2D7FF9"`, `"teal"`); wins over `tone` */
280
- color: OptionType(StringType),
281
- /** Optional raw CSS area fill (opt-in; zones are unfilled by default) */
282
- bg: OptionType(StringType),
283
- /** Optional fill alpha (0–1) for the area fill */
284
- fillOpacity: OptionType(FloatType),
285
- /** Optional stroke width in px */
286
- weight: OptionType(FloatType),
287
- /** Optional layer membership — the `key` of a {@link SchematicLayerType};
288
- * hidden when its layer is hidden. Absent ⇒ unlayered (always visible). */
289
- layer: OptionType(StringType),
290
- });
291
- /**
292
- * A resolved link between two placed items.
293
- *
294
- * @property key - Link identity
295
- * @property from - Source item key
296
- * @property to - Destination item key
297
- * @property label - Optional mid-path label (name / flow description)
298
- * @property metric - Optional mid-path metric readout (muted, after the label)
299
- * @property style - Render style (`solid` / `dashed`, with stroke config)
300
- * @property route - Routing mode (`orthogonal` / `direct`)
301
- * @property via - Optional world-coordinate waypoints, in order
302
- */
303
- export const SchematicLinkType = StructType({
304
- /** Link identity */
305
- key: StringType,
306
- /** Source item key */
307
- from: StringType,
308
- /** Destination item key */
309
- to: StringType,
310
- /** Optional label rendered mid-path (a name / flow description); hidden when zoomed out past the label band */
311
- label: OptionType(StringType),
312
- /** Optional metric rendered after the label mid-path (a rate / capacity readout), muted */
313
- metric: OptionType(StringType),
314
- /** Render style (`solid` / `dashed`, with stroke config) */
315
- style: SchematicLinkStyleType,
316
- /** Routing mode (`orthogonal` / `direct`) */
317
- route: SchematicRouteType,
318
- /** Optional world-coordinate waypoints, in order */
319
- via: ArrayType(SchematicPointType),
320
- /** Optional layer membership — the `key` of a {@link SchematicLayerType};
321
- * hidden when its layer is hidden (a link also vanishes when either endpoint
322
- * item is hidden). Absent ⇒ unlayered (always visible). */
323
- layer: OptionType(StringType),
324
- });
325
- /**
326
- * Positive emphasis applied to the remaining (matched) items when a
327
- * {@link SchematicSliceEffectType} is active.
328
- *
329
- * @remarks
330
- * `halo` draws a static highlight ring behind each matched marker / card;
331
- * `pulse` animates that ring (a slow breathing glow) to pull the eye to the
332
- * survivors. `pulse` runs a lightweight animation loop; `halo` repaints on the
333
- * normal frame path.
334
- *
335
- * @property halo - Static highlight ring on matched items
336
- * @property pulse - Animated pulse ring on matched items
337
- */
338
- export const SchematicEmphasisType = VariantType({
339
- /** Static highlight ring on matched items. */
340
- halo: NullType,
341
- /** Animated pulse ring on matched items. */
342
- pulse: NullType,
343
- });
344
- /**
345
- * Optional slice-driven render effect — how the Schematic treats items once a
346
- * bound slice narrows them, instead of the default "hidden completely". A flat
347
- * bag of independently-optional settings, mirroring the flat `sliceHidden` /
348
- * `sliceOpacity` / `sliceEmphasis` / … config props (each driven statically or
349
- * reactively via `SubtypeExprOrValue`).
350
- *
351
- * @remarks
352
- * Feed the **full** item set (not `Slice.rows`) and mark each item's `excluded`
353
- * flag (e.g. via `Slice.partition`, or `Slice.apply.matches(...).not()`).
354
- * `hidden` removes the filtered-out items entirely (else they stay as context);
355
- * `opacity` / `desaturate` / `dot` de-emphasise the kept ones; `emphasis`
356
- * highlights the remainder; `frame` boxes the matched set and `frameFit` also
357
- * flies the camera to it. Every field absent is a no-op.
358
- *
359
- * @property hidden - Remove filtered-out items entirely; absent / `some(false)` ⇒ keep as context
360
- * @property opacity - Fade alpha (0–1) for kept filtered-out items; absent ⇒ full
361
- * @property desaturate - Drain kept filtered-out items' colour to grey
362
- * @property dot - Collapse kept filtered-out items to a bare dot
363
- * @property emphasis - Positive emphasis on matched items (absent ⇒ none)
364
- * @property frame - Draw a bounding frame around the matched set
365
- * @property frameFit - Auto-fit the camera to the matched frame when the set changes
366
- */
367
- export const SchematicSliceEffectType = StructType({
368
- /** Remove filtered-out items entirely; absent / `some(false)` ⇒ keep as context. */
369
- hidden: OptionType(BooleanType),
370
- /** Fade alpha (0–1) for kept filtered-out items; absent ⇒ full. */
371
- opacity: OptionType(FloatType),
372
- /** Drain kept filtered-out items' colour to grey. */
373
- desaturate: OptionType(BooleanType),
374
- /** Collapse kept filtered-out items to a bare dot (drop card / label / footprint). */
375
- dot: OptionType(BooleanType),
376
- /** Positive emphasis on matched items; absent ⇒ none. */
377
- emphasis: OptionType(SchematicEmphasisType),
378
- /** Draw a bounding frame around the matched set. */
379
- frame: OptionType(BooleanType),
380
- /** Auto-fit the camera to the matched frame when the matched set changes. */
381
- frameFit: OptionType(BooleanType),
382
- });
383
- /**
384
- * A named layer — a cross-cutting group of items / zones / links that can be
385
- * shown, hidden, isolated (solo), locked, or dimmed together via the canvas
386
- * layer button.
387
- *
388
- * @remarks
389
- * Membership is by `key`: an entity's `layer` field names the layer it belongs
390
- * to. Layer visibility / lock are VIEW state (owned by the renderer, persisted
391
- * per panel); the `visible` / `locked` here are the AUTHOR defaults the user's
392
- * toggles override. `opacity` dims the layer's items (markers / footprints) in
393
- * v1 (zone / link dimming is not yet applied). `tone` colours the panel swatch
394
- * (theme-owned). Membership is strictly per-entity — hiding a container zone
395
- * does not hide the items geometrically inside it.
396
- *
397
- * @property key - Layer identity — entities reference it via their `layer` field
398
- * @property label - Display name shown in the layer panel
399
- * @property visible - Author default visibility; absent / `some(true)` ⇒ shown, `some(false)` ⇒ ships hidden
400
- * @property locked - Author default lock (non-selectable); absent ⇒ unlocked
401
- * @property opacity - Optional item dim (0–1) for the layer's items; absent ⇒ full
402
- * @property tone - Optional panel swatch tone
403
- */
404
- export const SchematicLayerType = StructType({
405
- /** Layer identity — entities reference it via their `layer` field. */
406
- key: StringType,
407
- /** Display name shown in the layer panel. */
408
- label: StringType,
409
- /** Author default visibility; `some(false)` ships hidden, absent ⇒ shown. */
410
- visible: OptionType(BooleanType),
411
- /** Author default lock (non-selectable); absent ⇒ unlocked. */
412
- locked: OptionType(BooleanType),
413
- /** Optional item dim (0–1) for the layer's items; absent ⇒ full. */
414
- opacity: OptionType(FloatType),
415
- /** Optional panel swatch tone. */
416
- tone: OptionType(SchematicToneType),
417
- });
418
- /**
419
- * Selection cardinality for the Schematic. Absent on the root ⇒ `single`.
420
- *
421
- * @remarks
422
- * `single` keeps today's behaviour — one selected item at a time, no
423
- * marquee. `multiple` is the multi-select mode: it reveals a marquee tool
424
- * in a second control group, where a plain tap / box **replaces** the
425
- * selection and **Shift**+tap / **Shift**+box **extend** it (Shift-tap
426
- * toggles a single item; Shift-box unions). Esc / the clear button reset.
427
- *
428
- * @property single - At most one item selected; tap replaces (default; no marquee)
429
- * @property multiple - Multi-select; tap / box replace, Shift+tap / Shift+box extend
430
- */
431
- export const SchematicSelectionModeType = VariantType({
432
- /** At most one item selected; tap replaces (default; no marquee). */
433
- single: NullType,
434
- /** Multi-select; tap / box replace, Shift+tap toggles and Shift+box unions. */
435
- multiple: NullType,
436
- });
437
- /**
438
- * A world-coordinate rectangle swept by a marquee gesture — matches the
439
- * box handed to the spatial index, so coordinates are world units.
440
- *
441
- * @property minX - Left edge (world units)
442
- * @property minY - Top edge (world units)
443
- * @property maxX - Right edge (world units)
444
- * @property maxY - Bottom edge (world units)
445
- */
446
- export const SchematicRegionType = StructType({
447
- /** Left edge (world units). */
448
- minX: FloatType,
449
- /** Top edge (world units). */
450
- minY: FloatType,
451
- /** Right edge (world units). */
452
- maxX: FloatType,
453
- /** Bottom edge (world units). */
454
- maxY: FloatType,
455
- });
456
- /**
457
- * Selection-set change event — the Schematic analogue of Table's
458
- * `TableRowSelectionEventType`. Passed to `onSelectionChange` whenever the
459
- * selected set changes (a tap, a marquee sweep, or a clear).
460
- *
461
- * @remarks
462
- * `key` is `some` for a single-item tap and `none` for a bulk marquee or a
463
- * clear. `selectedKeys` is always the FULL selection after the gesture (the
464
- * spatial analogue of `selectedRowsIndices`). `region` is `some` only for a
465
- * marquee sweep.
466
- *
467
- * @property key - The item that triggered the change (some for a tap; none for marquee / clear)
468
- * @property selected - Whether `key` is now selected (for a tap); for bulk changes, whether the set is non-empty
469
- * @property selectedKeys - The full selected set after the gesture
470
- * @property additive - Whether the gesture added to the prior selection (true) or replaced it (false)
471
- * @property region - The world rectangle a marquee swept (some for a marquee; none for tap / clear)
472
- */
473
- export const SchematicSelectionEventType = StructType({
474
- /** The item that triggered the change (some for a tap; none for marquee / clear). */
475
- key: OptionType(StringType),
476
- /** Whether `key` is now selected (tap); for bulk changes, whether the set is non-empty. */
477
- selected: BooleanType,
478
- /** The full selected set after the gesture. */
479
- selectedKeys: ArrayType(StringType),
480
- /** Whether the gesture added to the prior selection (true) or replaced it (false). */
481
- additive: BooleanType,
482
- /** The world rectangle a marquee swept (some for a marquee; none for tap / clear). */
483
- region: OptionType(SchematicRegionType),
484
- });
485
- /**
486
- * Viewport-settled event — the camera zoom plus the visible world rectangle,
487
- * reported (debounced) after a pan / zoom / fly / resize settles. Passed to
488
- * `onViewportChange` so hosts can sync external UI, lazy-load data for the
489
- * visible region, or persist the view.
490
- *
491
- * @property zoom - The settled camera zoom (1 = fully zoomed out)
492
- * @property minX - Left edge of the visible world rect
493
- * @property minY - Top edge of the visible world rect
494
- * @property maxX - Right edge of the visible world rect
495
- * @property maxY - Bottom edge of the visible world rect
496
- */
497
- export const SchematicViewportEventType = StructType({
498
- /** The settled camera zoom (1 = fully zoomed out). */
499
- zoom: FloatType,
500
- /** Left edge of the visible world rect. */
501
- minX: FloatType,
502
- /** Top edge of the visible world rect. */
503
- minY: FloatType,
504
- /** Right edge of the visible world rect. */
505
- maxX: FloatType,
506
- /** Bottom edge of the visible world rect. */
507
- maxY: FloatType,
508
- });
509
- /**
510
- * Zone (area) selection-set change event — the zone analogue of
511
- * `SchematicSelectionEventType`, passed to `onZoneSelectionChange` whenever
512
- * the selected ZONE set changes (a tap on a zone body, a nav-rail zone click,
513
- * or a clear).
514
- *
515
- * @remarks
516
- * `childItemKeys` reports the items sitting **inside** the selected zones —
517
- * an item counts when its innermost containing zone, or any of that zone's
518
- * ancestors, is selected (so selecting a hall includes items in its nested
519
- * cells). Items always take hit-test precedence: tapping an item never
520
- * selects its host zone.
521
- *
522
- * @property key - The zone that triggered the change (some for a tap; none for a clear)
523
- * @property selected - Whether `key` is now selected; for bulk changes, whether the set is non-empty
524
- * @property selectedKeys - The full selected zone set after the gesture
525
- * @property childItemKeys - Item keys inside the selected zones (nested descendants included)
526
- * @property additive - Whether the gesture added to the prior selection (true) or replaced it (false)
527
- */
528
- export const SchematicZoneSelectionEventType = StructType({
529
- /** The zone that triggered the change (some for a tap; none for a clear). */
530
- key: OptionType(StringType),
531
- /** Whether `key` is now selected (tap); for bulk changes, whether the set is non-empty. */
532
- selected: BooleanType,
533
- /** The full selected zone set after the gesture. */
534
- selectedKeys: ArrayType(StringType),
535
- /** Item keys inside the selected zones (nested descendants included). */
536
- childItemKeys: ArrayType(StringType),
537
- /** Whether the gesture added to the prior selection (true) or replaced it (false). */
538
- additive: BooleanType,
539
- });
540
- /**
541
- * Link-gesture mode for the connect tool. Absent on the root ⇒ `draw`.
542
- *
543
- * @remarks
544
- * `draw`: a committed connect gesture adds a **physical link** to the
545
- * renderer's local link state (the form-input model — works with no callback
546
- * wired), and `onCreateLink` fires in addition. `connect`: the gesture is a
547
- * **pure connection event** — nothing is added; only `onCreateLink` fires
548
- * (with the pair, the accumulated session, and any existing links between the
549
- * endpoints), and the gesture stays repeatable — the channel for planning
550
- * operations between plant areas rather than drawing pipes.
551
- *
552
- * @property draw - The gesture draws a physical link (local-state-first)
553
- * @property connect - The gesture only fires the event (nothing added; repeatable)
554
- */
555
- export const SchematicLinkModeType = VariantType({
556
- /** The gesture draws a physical link (local-state-first). */
557
- draw: NullType,
558
- /** The gesture only fires the event (nothing added; repeatable). */
559
- connect: NullType,
560
- });
561
- /**
562
- * One connection's endpoints — the unit a connect gesture produces.
563
- *
564
- * @property key - Renderer-generated key for the gesture's connection
565
- * @property from - Source item key
566
- * @property to - Destination item key
567
- */
568
- export const SchematicLinkEndpointsType = StructType({
569
- /** Renderer-generated key for the gesture's connection. */
570
- key: StringType,
571
- /** Source item key. */
572
- from: StringType,
573
- /** Destination item key. */
574
- to: StringType,
575
- });
576
- /**
577
- * A connect-session collapsed to net endpoints — carried on every
578
- * `onCreateLink` so handlers can upsert ONE net per session.
579
- *
580
- * @remarks
581
- * `key` is the SESSION key, stable across all of a session's commits: the
582
- * plain drag and every Shift-extension report the same `key` with the
583
- * accumulated `sources` (distinct froms) and `destinations` (distinct tos).
584
- *
585
- * @property key - The session key (stable across the session's commits)
586
- * @property sources - Distinct source item keys so far
587
- * @property destinations - Distinct destination item keys so far
588
- */
589
- export const SchematicNetEndpointsType = StructType({
590
- /** The session key (stable across the session's commits). */
591
- key: StringType,
592
- /** Distinct source item keys so far. */
593
- sources: ArrayType(StringType),
594
- /** Distinct destination item keys so far. */
595
- destinations: ArrayType(StringType),
596
- });
597
- /**
598
- * A net — a manifold / bus link joining MANY sources to MANY destinations as
599
- * ONE entity, rendered as a trunk with per-endpoint branches.
600
- *
601
- * @remarks
602
- * Use a net when the real topology is a shared run (a CIP manifold feeding
603
- * 30 units, a header bridging two banks) — one row instead of a pairwise
604
- * `links` explosion. The trunk routes like a link (`route`, with `via` as
605
- * TRUNK waypoints); each source branches into the trunk head, each
606
- * destination off the tail. A branch drops when its endpoint item is hidden
607
- * (layer / slice-hide); the whole net hides when either side empties, or
608
- * when its own `layer` is hidden.
609
- *
610
- * @property key - Net identity (participates in link selection / deletion)
611
- * @property sources - Source item keys (the feeding side)
612
- * @property destinations - Destination item keys (the fed side)
613
- * @property label - Optional mid-trunk label (name / flow description)
614
- * @property metric - Optional mid-trunk metric readout (muted, after the label)
615
- * @property style - Render style (`solid` / `dashed`) — one stroke for the whole net
616
- * @property route - Trunk routing mode (`orthogonal` / `direct`)
617
- * @property via - Optional world-coordinate TRUNK waypoints, in order
618
- * @property layer - Optional layer membership — hidden when its layer is hidden
619
- */
620
- export const SchematicNetType = StructType({
621
- /** Net identity (participates in link selection / deletion) */
622
- key: StringType,
623
- /** Source item keys (the feeding side) */
624
- sources: ArrayType(StringType),
625
- /** Destination item keys (the fed side) */
626
- destinations: ArrayType(StringType),
627
- /** Optional label rendered mid-trunk */
628
- label: OptionType(StringType),
629
- /** Optional metric rendered after the label mid-trunk, muted */
630
- metric: OptionType(StringType),
631
- /** Render style (`solid` / `dashed`, with stroke config) */
632
- style: SchematicLinkStyleType,
633
- /** Trunk routing mode (`orthogonal` / `direct`) */
634
- route: SchematicRouteType,
635
- /** Optional world-coordinate trunk waypoints, in order */
636
- via: ArrayType(SchematicPointType),
637
- /** Optional layer membership — hidden when its layer is hidden */
638
- layer: OptionType(StringType),
639
- });
640
- /**
641
- * Link-creation event passed to `onCreateLink` on every committed connect
642
- * gesture.
643
- *
644
- * @remarks
645
- * Connect gestures build a **session**: a plain drag starts a new session
646
- * (one connection); a **Shift**+drag ADDS to the open session — mirroring
647
- * Shift = "extend the set" in the selection modes — so an operation relating
648
- * MORE than two items is built one visual link at a time. The event always
649
- * carries the newest `link`, the FULL accumulated `links` session (newest
650
- * included), whether the gesture was `additive` (Shift), and the keys of
651
- * `existing` links already joining the newest pair (either direction).
652
- *
653
- * @property link - The newest connection (this drag)
654
- * @property links - The full session set, `link` included (length 1 for a plain drag)
655
- * @property net - The session collapsed to net endpoints (stable session `key` — upsert-friendly)
656
- * @property additive - True when Shift extended an open session
657
- * @property existing - Keys of links already joining the newest from↔to (either direction)
658
- * @property absorbed - Keys of existing pairwise links absorbed into the session (selected-link seed)
659
- */
660
- export const SchematicLinkCreateEventType = StructType({
661
- /** The newest connection (this drag). */
662
- link: SchematicLinkEndpointsType,
663
- /** The full session set, `link` included (length 1 for a plain drag). */
664
- links: ArrayType(SchematicLinkEndpointsType),
665
- /** The session collapsed to net endpoints — upsert ONE net per session by `net.key`. */
666
- net: SchematicNetEndpointsType,
667
- /** True when Shift extended an open session. */
668
- additive: BooleanType,
669
- /** Keys of links already joining the newest from↔to (either direction). */
670
- existing: ArrayType(StringType),
671
- /** Keys of EXISTING pairwise links absorbed into this session (a selected
672
- * link's Shift-drag seed) — delete these rows when upserting the net. */
673
- absorbed: ArrayType(StringType),
674
- });
675
- /**
676
- * Link-edit event passed to `onEditLink` after an endpoint connector is
677
- * dragged to a new item.
678
- *
679
- * @property key - The edited link's key
680
- * @property from - Source item key AFTER the re-target
681
- * @property to - Destination item key AFTER the re-target
682
- */
683
- export const SchematicLinkEditEventType = StructType({
684
- /** The edited link's key. */
685
- key: StringType,
686
- /** Source item key AFTER the re-target. */
687
- from: StringType,
688
- /** Destination item key AFTER the re-target. */
689
- to: StringType,
690
- });
691
- /**
692
- * Item-move event passed to `onMoveItem` when a move-tool drag releases.
693
- *
694
- * @remarks
695
- * When the dragged item is part of the current selection the WHOLE selection
696
- * moves rigidly — `keys` lists every moved item (the pressed `key` included)
697
- * and `dx`/`dy` is the shared world delta; `x`/`y` is the pressed item's
698
- * final position. Fired once per gesture, on release.
699
- *
700
- * @property key - The pressed (dragged) item's key
701
- * @property x - The pressed item's final world x
702
- * @property y - The pressed item's final world y
703
- * @property keys - Every item moved by the gesture (`key` included)
704
- * @property dx - The gesture's world x delta (applies to all `keys`)
705
- * @property dy - The gesture's world y delta (applies to all `keys`)
706
- */
707
- export const SchematicItemMoveEventType = StructType({
708
- /** The pressed (dragged) item's key. */
709
- key: StringType,
710
- /** The pressed item's final world x. */
711
- x: FloatType,
712
- /** The pressed item's final world y. */
713
- y: FloatType,
714
- /** Every item moved by the gesture (`key` included). */
715
- keys: ArrayType(StringType),
716
- /** The gesture's world x delta (applies to all `keys`). */
717
- dx: FloatType,
718
- /** The gesture's world y delta (applies to all `keys`). */
719
- dy: FloatType,
720
- });
721
- // `SchematicRootType` lives in `./index.ts` (the resolved mirror of the inline
722
- // `Schematic` struct in `component.ts`) so its hover builders can reference
723
- // `UIComponentType`, which this file must not import (circular).
724
- //# sourceMappingURL=types.js.map