@almadar/ui 5.138.0 → 5.140.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.
@@ -184,12 +184,18 @@ function collectDrawnItems(nodes) {
184
184
  for (const n of nodes) {
185
185
  switch (n.type) {
186
186
  case "draw-sprite":
187
+ if (isValidScenePos(n.position)) out.push({ pos: n.position, id: n.id, anchor: n.anchor, width: n.width, height: n.height });
188
+ break;
187
189
  case "draw-shape":
188
190
  case "draw-text":
189
191
  case "draw-group":
190
192
  if (isValidScenePos(n.position)) out.push({ pos: n.position, id: n.id });
191
193
  break;
192
194
  case "draw-sprite-layer":
195
+ for (const it of n.items) {
196
+ if (isValidScenePos(it.position)) out.push({ pos: it.position, id: it.id, anchor: it.anchor, width: it.width, height: it.height });
197
+ }
198
+ break;
193
199
  case "draw-shape-layer":
194
200
  case "draw-text-layer":
195
201
  for (const it of n.items) {
@@ -3,7 +3,7 @@ import React__default, { Component, ReactNode, ErrorInfo } from 'react';
3
3
  import { ScenePos, EventEmit, JsonObject, OrbitalSchema } from '@almadar/core';
4
4
  import * as THREE from 'three';
5
5
  import { QuadraticBezierCurve3 } from 'three';
6
- import { D as DrawableNode } from '../../../paintDispatch-DXygiK7M.cjs';
6
+ import { D as DrawableNode } from '../../../paintDispatch-B5pPeSEp.cjs';
7
7
  import { OrbitControls } from 'three/examples/jsm/controls/OrbitControls.js';
8
8
  import { I as IsometricTile, a as IsometricUnit, b as IsometricFeature, A as ApplicationLevelData, O as OrbitalLevelData, T as TraitLevelData, c as TransitionLevelData } from '../../../avl-schema-parser-B8Onmfsu.cjs';
9
9
  export { U as UnitAnimationState } from '../../../avl-schema-parser-B8Onmfsu.cjs';
@@ -3,7 +3,7 @@ import React__default, { Component, ReactNode, ErrorInfo } from 'react';
3
3
  import { ScenePos, EventEmit, JsonObject, OrbitalSchema } from '@almadar/core';
4
4
  import * as THREE from 'three';
5
5
  import { QuadraticBezierCurve3 } from 'three';
6
- import { D as DrawableNode } from '../../../paintDispatch-DXygiK7M.js';
6
+ import { D as DrawableNode } from '../../../paintDispatch-B5pPeSEp.js';
7
7
  import { OrbitControls } from 'three/examples/jsm/controls/OrbitControls.js';
8
8
  import { I as IsometricTile, a as IsometricUnit, b as IsometricFeature, A as ApplicationLevelData, O as OrbitalLevelData, T as TraitLevelData, c as TransitionLevelData } from '../../../avl-schema-parser-B8Onmfsu.js';
9
9
  export { U as UnitAnimationState } from '../../../avl-schema-parser-B8Onmfsu.js';
@@ -160,12 +160,18 @@ function collectDrawnItems(nodes) {
160
160
  for (const n of nodes) {
161
161
  switch (n.type) {
162
162
  case "draw-sprite":
163
+ if (isValidScenePos(n.position)) out.push({ pos: n.position, id: n.id, anchor: n.anchor, width: n.width, height: n.height });
164
+ break;
163
165
  case "draw-shape":
164
166
  case "draw-text":
165
167
  case "draw-group":
166
168
  if (isValidScenePos(n.position)) out.push({ pos: n.position, id: n.id });
167
169
  break;
168
170
  case "draw-sprite-layer":
171
+ for (const it of n.items) {
172
+ if (isValidScenePos(it.position)) out.push({ pos: it.position, id: it.id, anchor: it.anchor, width: it.width, height: it.height });
173
+ }
174
+ break;
169
175
  case "draw-shape-layer":
170
176
  case "draw-text-layer":
171
177
  for (const it of n.items) {
@@ -1,7 +1,7 @@
1
- export { C as ContentSegment, D as DEFAULT_CONFIG, a as DomEntityBox, b as DomLayoutData, c as DomOutputsBox, d as DomStateNode, e as DomTransitionLabel, f as DomTransitionPath, E as EntityDefinition, R as RenderOptions, S as StateDefinition, g as StateMachineDefinition, T as TraitSnapshotGetter, h as TransitionDefinition, V as VisualizerConfig, i as bindCanvasCapture, j as bindEventBus, k as bindLastDrawables, l as bindTraitStateGetter, m as clearVerification, n as cn, o as extractOutputsFromTransitions, p as extractStateMachine, q as formatGuard, r as getAllChecks, s as getBridgeHealth, t as getEffectSummary, u as getSnapshot, v as getSummary, w as getTraitSnapshots, x as getTransitions, y as getTransitionsForTrait, z as parseContentSegments, A as parseMarkdownWithCodeBlocks, B as recordServerResponse, F as recordTransition, G as registerCheck, H as registerTraitSnapshot, I as renderStateMachineToDomData, J as renderStateMachineToSvg, K as subscribeToVerification, L as updateAssetStatus, M as updateBridgeHealth, N as updateCheck, O as waitForTransition } from '../cn-CL0kdshO.cjs';
1
+ export { C as ContentSegment, D as DEFAULT_CONFIG, a as DomEntityBox, b as DomLayoutData, c as DomOutputsBox, d as DomStateNode, e as DomTransitionLabel, f as DomTransitionPath, E as EntityDefinition, R as RenderOptions, S as StateDefinition, g as StateMachineDefinition, T as TraitSnapshotGetter, h as TransitionDefinition, V as VisualizerConfig, i as bindCanvasCapture, j as bindEventBus, k as bindLastDrawables, l as bindTraitStateGetter, m as clearVerification, n as cn, o as extractOutputsFromTransitions, p as extractStateMachine, q as formatGuard, r as getAllChecks, s as getBridgeHealth, t as getEffectSummary, u as getSnapshot, v as getSummary, w as getTraitSnapshots, x as getTransitions, y as getTransitionsForTrait, z as parseContentSegments, A as parseMarkdownWithCodeBlocks, B as recordServerResponse, F as recordTransition, G as registerCheck, H as registerTraitSnapshot, I as renderStateMachineToDomData, J as renderStateMachineToSvg, K as subscribeToVerification, L as updateAssetStatus, M as updateBridgeHealth, N as updateCheck, O as waitForTransition } from '../cn-DkGYzPOg.cjs';
2
2
  import { FieldValue, EntityRow, EventPayload } from '@almadar/core';
3
3
  export { AssetLoadStatus, BridgeHealth, CheckStatus, EffectTrace, EventLogEntry, OrbitalVerificationAPI, ServerResponseTrace, TraitStateSnapshot, TransitionTrace, VerificationCheck, VerificationSnapshot, VerificationSummary } from '@almadar/core';
4
- import '../paintDispatch-DXygiK7M.cjs';
4
+ import '../paintDispatch-B5pPeSEp.cjs';
5
5
  import 'clsx';
6
6
 
7
7
  /**
@@ -1,7 +1,7 @@
1
- export { C as ContentSegment, D as DEFAULT_CONFIG, a as DomEntityBox, b as DomLayoutData, c as DomOutputsBox, d as DomStateNode, e as DomTransitionLabel, f as DomTransitionPath, E as EntityDefinition, R as RenderOptions, S as StateDefinition, g as StateMachineDefinition, T as TraitSnapshotGetter, h as TransitionDefinition, V as VisualizerConfig, i as bindCanvasCapture, j as bindEventBus, k as bindLastDrawables, l as bindTraitStateGetter, m as clearVerification, n as cn, o as extractOutputsFromTransitions, p as extractStateMachine, q as formatGuard, r as getAllChecks, s as getBridgeHealth, t as getEffectSummary, u as getSnapshot, v as getSummary, w as getTraitSnapshots, x as getTransitions, y as getTransitionsForTrait, z as parseContentSegments, A as parseMarkdownWithCodeBlocks, B as recordServerResponse, F as recordTransition, G as registerCheck, H as registerTraitSnapshot, I as renderStateMachineToDomData, J as renderStateMachineToSvg, K as subscribeToVerification, L as updateAssetStatus, M as updateBridgeHealth, N as updateCheck, O as waitForTransition } from '../cn-CCaph5o9.js';
1
+ export { C as ContentSegment, D as DEFAULT_CONFIG, a as DomEntityBox, b as DomLayoutData, c as DomOutputsBox, d as DomStateNode, e as DomTransitionLabel, f as DomTransitionPath, E as EntityDefinition, R as RenderOptions, S as StateDefinition, g as StateMachineDefinition, T as TraitSnapshotGetter, h as TransitionDefinition, V as VisualizerConfig, i as bindCanvasCapture, j as bindEventBus, k as bindLastDrawables, l as bindTraitStateGetter, m as clearVerification, n as cn, o as extractOutputsFromTransitions, p as extractStateMachine, q as formatGuard, r as getAllChecks, s as getBridgeHealth, t as getEffectSummary, u as getSnapshot, v as getSummary, w as getTraitSnapshots, x as getTransitions, y as getTransitionsForTrait, z as parseContentSegments, A as parseMarkdownWithCodeBlocks, B as recordServerResponse, F as recordTransition, G as registerCheck, H as registerTraitSnapshot, I as renderStateMachineToDomData, J as renderStateMachineToSvg, K as subscribeToVerification, L as updateAssetStatus, M as updateBridgeHealth, N as updateCheck, O as waitForTransition } from '../cn-Do5Ra3l3.js';
2
2
  import { FieldValue, EntityRow, EventPayload } from '@almadar/core';
3
3
  export { AssetLoadStatus, BridgeHealth, CheckStatus, EffectTrace, EventLogEntry, OrbitalVerificationAPI, ServerResponseTrace, TraitStateSnapshot, TransitionTrace, VerificationCheck, VerificationSnapshot, VerificationSummary } from '@almadar/core';
4
- import '../paintDispatch-DXygiK7M.js';
4
+ import '../paintDispatch-B5pPeSEp.js';
5
5
  import 'clsx';
6
6
 
7
7
  /**
@@ -17,6 +17,11 @@ interface PainterShadow {
17
17
  color: string;
18
18
  blur: number;
19
19
  }
20
+ /** One color stop of a {@link PainterGradient}; `offset` is 0..1 along the gradient. */
21
+ interface PainterGradientStop {
22
+ offset: number;
23
+ color: string;
24
+ }
20
25
 
21
26
  /**
22
27
  * Drawable contract — the shared vocabulary every neutral drawable primitive
@@ -110,6 +115,64 @@ interface DrawSpriteProps extends DrawableBase {
110
115
  */
111
116
 
112
117
  type ShapeKind = 'cell' | 'rect' | 'ellipse' | 'poly' | 'path';
118
+ /** One gradient color stop; `offset` is 0..1 along the gradient axis. */
119
+ type DrawShapeGradientStop = PainterGradientStop;
120
+ /**
121
+ * A gradient fill in world units relative to the cell's projected top-left —
122
+ * same coordinate convention as `points` and `d`. Overrides `fill` when present.
123
+ */
124
+ interface DrawShapeGradient {
125
+ kind: 'linear' | 'radial';
126
+ /** Linear start point in world units. */
127
+ from?: PainterPoint;
128
+ /** Linear end point in world units. */
129
+ to?: PainterPoint;
130
+ /** Radial center in world units. */
131
+ center?: PainterPoint;
132
+ /** Radial radius in world units. */
133
+ radius?: number;
134
+ /** Ordered color stops. */
135
+ stops: DrawShapeGradientStop[];
136
+ }
137
+ /** A soft glow / drop-shadow behind the shape; `blur` is in world units. */
138
+ interface DrawShapeShadow {
139
+ color: string;
140
+ blur: number;
141
+ }
142
+ /**
143
+ * One keyframe of a {@link DrawShapeAnimation}: `at` is the 0..1 position in
144
+ * the cycle; every other field overrides the shape's base prop at that moment.
145
+ */
146
+ interface DrawShapeKeyframe {
147
+ at: number;
148
+ offsetX?: number;
149
+ offsetY?: number;
150
+ rotate?: number;
151
+ opacity?: number;
152
+ radiusX?: number;
153
+ radiusY?: number;
154
+ width?: number;
155
+ height?: number;
156
+ strokeWidth?: number;
157
+ fill?: string;
158
+ stroke?: string;
159
+ shadow?: DrawShapeShadow;
160
+ }
161
+ /**
162
+ * Declarative keyframe animation for a drawable. The host runs a paint clock
163
+ * while any drawable declares one; numeric tracks lerp between keyframes,
164
+ * string tracks hold the previous keyframe's value, `shadow` lerps `blur` and
165
+ * holds `color`. A track starts from the shape's base prop until its first
166
+ * keyframe defines it.
167
+ */
168
+ interface DrawShapeAnimation {
169
+ /** One cycle length in ms. */
170
+ durationMs: number;
171
+ /** Loop the cycle (default true); false plays once and holds the final keyframes. */
172
+ loop?: boolean;
173
+ /** Keyframes ordered by `at` (0..1). */
174
+ keyframes: DrawShapeKeyframe[];
175
+ }
113
176
  interface DrawShapeProps extends DrawableBase {
114
177
  type: 'draw-shape';
115
178
  shape: ShapeKind;
@@ -125,7 +188,7 @@ interface DrawShapeProps extends DrawableBase {
125
188
  radiusX?: number;
126
189
  /** Ellipse vertical radius in world units; omitted → `radiusX` (a circle). */
127
190
  radiusY?: number;
128
- /** Fine nudge from the anchor point in world units. */
191
+ /** Fine nudge in world units — applies to every shape kind except `cell` (rect/ellipse from their anchor point; poly/path from the projected top-left). */
129
192
  offsetX?: number;
130
193
  offsetY?: number;
131
194
  /** Poly vertices as world-unit offsets relative to the cell's projected top-left. */
@@ -133,8 +196,18 @@ interface DrawShapeProps extends DrawableBase {
133
196
  /** SVG path data in world units relative to the cell's projected top-left — same coordinate convention as `points`. */
134
197
  d?: string;
135
198
  fill?: string;
199
+ /** Gradient fill in world units; overrides `fill` when present. */
200
+ gradient?: DrawShapeGradient;
136
201
  stroke?: string;
137
202
  strokeWidth?: number;
203
+ /** Rotation in radians (painter units, same as `draw-group`), about `pivot`. */
204
+ rotate?: number;
205
+ /** Rotation pivot in world units relative to the cell's projected top-left; default `{x:0.5, y:0.5}` (cell center). */
206
+ pivot?: PainterPoint;
207
+ /** Soft glow / drop-shadow behind the shape; `blur` in world units. */
208
+ shadow?: DrawShapeShadow;
209
+ /** Keyframe animation over this shape's props; the host runs a paint clock while present. */
210
+ animation?: DrawShapeAnimation;
138
211
  /** 0..1 opacity. */
139
212
  opacity?: number;
140
213
  }
@@ -17,6 +17,11 @@ interface PainterShadow {
17
17
  color: string;
18
18
  blur: number;
19
19
  }
20
+ /** One color stop of a {@link PainterGradient}; `offset` is 0..1 along the gradient. */
21
+ interface PainterGradientStop {
22
+ offset: number;
23
+ color: string;
24
+ }
20
25
 
21
26
  /**
22
27
  * Drawable contract — the shared vocabulary every neutral drawable primitive
@@ -110,6 +115,64 @@ interface DrawSpriteProps extends DrawableBase {
110
115
  */
111
116
 
112
117
  type ShapeKind = 'cell' | 'rect' | 'ellipse' | 'poly' | 'path';
118
+ /** One gradient color stop; `offset` is 0..1 along the gradient axis. */
119
+ type DrawShapeGradientStop = PainterGradientStop;
120
+ /**
121
+ * A gradient fill in world units relative to the cell's projected top-left —
122
+ * same coordinate convention as `points` and `d`. Overrides `fill` when present.
123
+ */
124
+ interface DrawShapeGradient {
125
+ kind: 'linear' | 'radial';
126
+ /** Linear start point in world units. */
127
+ from?: PainterPoint;
128
+ /** Linear end point in world units. */
129
+ to?: PainterPoint;
130
+ /** Radial center in world units. */
131
+ center?: PainterPoint;
132
+ /** Radial radius in world units. */
133
+ radius?: number;
134
+ /** Ordered color stops. */
135
+ stops: DrawShapeGradientStop[];
136
+ }
137
+ /** A soft glow / drop-shadow behind the shape; `blur` is in world units. */
138
+ interface DrawShapeShadow {
139
+ color: string;
140
+ blur: number;
141
+ }
142
+ /**
143
+ * One keyframe of a {@link DrawShapeAnimation}: `at` is the 0..1 position in
144
+ * the cycle; every other field overrides the shape's base prop at that moment.
145
+ */
146
+ interface DrawShapeKeyframe {
147
+ at: number;
148
+ offsetX?: number;
149
+ offsetY?: number;
150
+ rotate?: number;
151
+ opacity?: number;
152
+ radiusX?: number;
153
+ radiusY?: number;
154
+ width?: number;
155
+ height?: number;
156
+ strokeWidth?: number;
157
+ fill?: string;
158
+ stroke?: string;
159
+ shadow?: DrawShapeShadow;
160
+ }
161
+ /**
162
+ * Declarative keyframe animation for a drawable. The host runs a paint clock
163
+ * while any drawable declares one; numeric tracks lerp between keyframes,
164
+ * string tracks hold the previous keyframe's value, `shadow` lerps `blur` and
165
+ * holds `color`. A track starts from the shape's base prop until its first
166
+ * keyframe defines it.
167
+ */
168
+ interface DrawShapeAnimation {
169
+ /** One cycle length in ms. */
170
+ durationMs: number;
171
+ /** Loop the cycle (default true); false plays once and holds the final keyframes. */
172
+ loop?: boolean;
173
+ /** Keyframes ordered by `at` (0..1). */
174
+ keyframes: DrawShapeKeyframe[];
175
+ }
113
176
  interface DrawShapeProps extends DrawableBase {
114
177
  type: 'draw-shape';
115
178
  shape: ShapeKind;
@@ -125,7 +188,7 @@ interface DrawShapeProps extends DrawableBase {
125
188
  radiusX?: number;
126
189
  /** Ellipse vertical radius in world units; omitted → `radiusX` (a circle). */
127
190
  radiusY?: number;
128
- /** Fine nudge from the anchor point in world units. */
191
+ /** Fine nudge in world units — applies to every shape kind except `cell` (rect/ellipse from their anchor point; poly/path from the projected top-left). */
129
192
  offsetX?: number;
130
193
  offsetY?: number;
131
194
  /** Poly vertices as world-unit offsets relative to the cell's projected top-left. */
@@ -133,8 +196,18 @@ interface DrawShapeProps extends DrawableBase {
133
196
  /** SVG path data in world units relative to the cell's projected top-left — same coordinate convention as `points`. */
134
197
  d?: string;
135
198
  fill?: string;
199
+ /** Gradient fill in world units; overrides `fill` when present. */
200
+ gradient?: DrawShapeGradient;
136
201
  stroke?: string;
137
202
  strokeWidth?: number;
203
+ /** Rotation in radians (painter units, same as `draw-group`), about `pivot`. */
204
+ rotate?: number;
205
+ /** Rotation pivot in world units relative to the cell's projected top-left; default `{x:0.5, y:0.5}` (cell center). */
206
+ pivot?: PainterPoint;
207
+ /** Soft glow / drop-shadow behind the shape; `blur` in world units. */
208
+ shadow?: DrawShapeShadow;
209
+ /** Keyframe animation over this shape's props; the host runs a paint clock while present. */
210
+ animation?: DrawShapeAnimation;
138
211
  /** 0..1 opacity. */
139
212
  opacity?: number;
140
213
  }