@almadar/ui 5.147.0 → 5.149.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.
Files changed (29) hide show
  1. package/dist/{GameAudioProvider-CPGwD49P.d.cts → GameAudioProvider-B48iXwz3.d.ts} +2 -50
  2. package/dist/{GameAudioProvider-CPGwD49P.d.ts → GameAudioProvider-CQAdPreB.d.cts} +2 -50
  3. package/dist/avl/index.cjs +535 -15
  4. package/dist/avl/index.js +535 -15
  5. package/dist/{avl-schema-parser-DVmrgdwc.d.cts → avl-schema-parser-CVzkNzg7.d.cts} +18 -9
  6. package/dist/{avl-schema-parser-BRJ77Yze.d.ts → avl-schema-parser-Cx_4SVg9.d.ts} +18 -9
  7. package/dist/{cn-BAn68sNO.d.cts → cn-BnAJZcNb.d.cts} +2 -8
  8. package/dist/{cn-CWxxLkri.d.ts → cn-DJTUjk1M.d.ts} +2 -8
  9. package/dist/components/index.cjs +545 -18
  10. package/dist/components/index.d.cts +278 -98
  11. package/dist/components/index.d.ts +278 -98
  12. package/dist/components/index.js +541 -20
  13. package/dist/lib/drawable/three/index.cjs +56 -29
  14. package/dist/lib/drawable/three/index.d.cts +4 -3
  15. package/dist/lib/drawable/three/index.d.ts +4 -3
  16. package/dist/lib/drawable/three/index.js +56 -29
  17. package/dist/lib/index.d.cts +3 -2
  18. package/dist/lib/index.d.ts +3 -2
  19. package/dist/{paintDispatch-Cb_hQj4Y.d.ts → paintDispatch-BjZjUbcb.d.cts} +63 -69
  20. package/dist/{paintDispatch-Cb_hQj4Y.d.cts → paintDispatch-CxdLjHQq.d.ts} +63 -69
  21. package/dist/providers/index.cjs +535 -15
  22. package/dist/providers/index.d.cts +2 -1
  23. package/dist/providers/index.d.ts +2 -1
  24. package/dist/providers/index.js +535 -15
  25. package/dist/runtime/index.cjs +535 -15
  26. package/dist/runtime/index.js +535 -15
  27. package/dist/types-B3nHgnMG.d.cts +51 -0
  28. package/dist/types-B3nHgnMG.d.ts +51 -0
  29. package/package.json +4 -4
@@ -1,22 +1,6 @@
1
1
  import { ScenePos, Asset } from '@almadar/core';
2
+ import { P as Point, R as Rect } from './types-B3nHgnMG.js';
2
3
 
3
- /** Source sub-rectangle within a texture (an atlas frame). Omitted → whole texture. */
4
- interface BlitSrc {
5
- x: number;
6
- y: number;
7
- w: number;
8
- h: number;
9
- }
10
- /** A polyline/polygon vertex in pixel space. */
11
- interface PainterPoint {
12
- x: number;
13
- y: number;
14
- }
15
- /** A drop shadow applied to subsequent draws until cleared. */
16
- interface PainterShadow {
17
- color: string;
18
- blur: number;
19
- }
20
4
  /** One color stop of a {@link PainterGradient}; `offset` is 0..1 along the gradient. */
21
5
  interface PainterGradientStop {
22
6
  offset: number;
@@ -57,50 +41,6 @@ interface DrawableBase {
57
41
  id?: string;
58
42
  }
59
43
 
60
- /**
61
- * `draw-sprite` — the neutral image/atlas-frame drawable atom (dimension-agnostic).
62
- *
63
- * ONE descriptor (`DrawSpriteProps`, grounded in core `ScenePos` + `Asset`) with
64
- * TWO backends: `paintSprite` (2D, here — via the portable `Painter2D` seam) and
65
- * an R3F mesh (`Sprite3D` in `lib/drawable/mesh3d`, kept OUT of this file so the
66
- * 2D paint path never pulls `three`/`drei` into an app bundle — the codebase
67
- * code-splits R3F). The canvas host picks the backend by `mode`; that is what
68
- * makes canvas-2d and canvas-3d the same `children` interface. Genre uses (tile,
69
- * unit body, feature, effect, movement ghost, background cover) are all this atom
70
- * with different `anchor`/`size`/`frame`/`flip`/`shadow` — composed in `.lolo`,
71
- * not here. The React component renders `null` (a drawable is painted by the host,
72
- * not the DOM); it exists so the pattern pipeline registers a `draw-sprite`
73
- * pattern and standalone pages stay inspectable.
74
- */
75
-
76
- interface DrawSpriteProps extends DrawableBase {
77
- type: 'draw-sprite';
78
- /** Logical scene position; the projector maps it to pixels / world. */
79
- position: ScenePos;
80
- /** The image / atlas reference to blit. */
81
- asset: Asset;
82
- /** How the sprite aligns to its projected position. Default `'top-left'`. */
83
- anchor?: DrawableAnchor;
84
- /** Draw width in world units (fractions of `projector.tileWidth`). Omitted → one cell on tile grids (`flat`/`iso`/`hex`); native source px on `free`/`side`. */
85
- width?: number;
86
- /** Draw height in world units (fractions of `projector.tileWidth`). Omitted → one cell on tile grids (`flat`/`iso`/`hex`); native source px on `free`/`side`. */
87
- height?: number;
88
- /** Explicit atlas sub-rect override (px); omitted → resolved from `asset.atlas`/`asset.sprite`. */
89
- frame?: BlitSrc;
90
- /** Animation to play. 3D backend: a named GLB clip (matched case-insensitively). 2D painter: when `asset.atlas` resolves to a `SpriteSheetAtlas` manifest, the canonical row of that name (idle/walk/attack/hit/death) plays off the host paint clock; an explicit `frame` rect overrides. */
91
- animation?: string;
92
- /** Override the sheet row's loop flag. The paint clock is wall-time, so one-shot rows hold their final frame — preview pages set `true` to cycle attack/hit/death continuously. */
93
- loop?: boolean;
94
- /** Mirror horizontally (facing). */
95
- flipX?: boolean;
96
- /** Rotation in radians about the sprite's center. */
97
- rotation?: number;
98
- /** 0..1 opacity. */
99
- opacity?: number;
100
- /** Drop shadow (e.g. a team-colored glow). */
101
- shadow?: PainterShadow;
102
- }
103
-
104
44
  /**
105
45
  * `draw-shape` — the neutral vector-fill/stroke drawable atom (dimension-agnostic).
106
46
  *
@@ -128,11 +68,11 @@ type DrawShapeGradientStop = PainterGradientStop;
128
68
  interface DrawShapeGradient {
129
69
  kind: 'linear' | 'radial' | 'conic';
130
70
  /** Linear start point in world units. */
131
- from?: PainterPoint;
71
+ from?: Point;
132
72
  /** Linear end point in world units. */
133
- to?: PainterPoint;
73
+ to?: Point;
134
74
  /** Radial/conic center in world units. */
135
- center?: PainterPoint;
75
+ center?: Point;
136
76
  /** Radial radius in world units. */
137
77
  radius?: number;
138
78
  /** Conic start angle in radians. */
@@ -216,7 +156,7 @@ interface DrawShapeProps extends DrawableBase {
216
156
  offsetX?: number;
217
157
  offsetY?: number;
218
158
  /** Poly vertices as world-unit offsets relative to the cell's projected top-left. */
219
- points?: PainterPoint[];
159
+ points?: Point[];
220
160
  /** SVG path data in world units relative to the cell's projected top-left — same coordinate convention as `points`. */
221
161
  d?: string;
222
162
  fill?: string;
@@ -239,7 +179,7 @@ interface DrawShapeProps extends DrawableBase {
239
179
  /** Rotation in radians (painter units, same as `draw-group`), about `pivot`. */
240
180
  rotate?: number;
241
181
  /** Rotation pivot in world units relative to the cell's projected top-left; default `{x:0.5, y:0.5}` (cell center). */
242
- pivot?: PainterPoint;
182
+ pivot?: Point;
243
183
  /** Soft glow / drop-shadow behind the shape; `blur` in world units. */
244
184
  shadow?: DrawShapeShadow;
245
185
  /** Keyframe animation over this shape's props; the host runs a paint clock while present. */
@@ -248,6 +188,50 @@ interface DrawShapeProps extends DrawableBase {
248
188
  opacity?: number;
249
189
  }
250
190
 
191
+ /**
192
+ * `draw-sprite` — the neutral image/atlas-frame drawable atom (dimension-agnostic).
193
+ *
194
+ * ONE descriptor (`DrawSpriteProps`, grounded in core `ScenePos` + `Asset`) with
195
+ * TWO backends: `paintSprite` (2D, here — via the portable `Painter2D` seam) and
196
+ * an R3F mesh (`Sprite3D` in `lib/drawable/mesh3d`, kept OUT of this file so the
197
+ * 2D paint path never pulls `three`/`drei` into an app bundle — the codebase
198
+ * code-splits R3F). The canvas host picks the backend by `mode`; that is what
199
+ * makes canvas-2d and canvas-3d the same `children` interface. Genre uses (tile,
200
+ * unit body, feature, effect, movement ghost, background cover) are all this atom
201
+ * with different `anchor`/`size`/`frame`/`flip`/`shadow` — composed in `.lolo`,
202
+ * not here. The React component renders `null` (a drawable is painted by the host,
203
+ * not the DOM); it exists so the pattern pipeline registers a `draw-sprite`
204
+ * pattern and standalone pages stay inspectable.
205
+ */
206
+
207
+ interface DrawSpriteProps extends DrawableBase {
208
+ type: 'draw-sprite';
209
+ /** Logical scene position; the projector maps it to pixels / world. */
210
+ position: ScenePos;
211
+ /** The image / atlas reference to blit. */
212
+ asset: Asset;
213
+ /** How the sprite aligns to its projected position. Default `'top-left'`. */
214
+ anchor?: DrawableAnchor;
215
+ /** Draw width in world units (fractions of `projector.tileWidth`). Omitted → one cell on tile grids (`flat`/`iso`/`hex`); native source px on `free`/`side`. */
216
+ width?: number;
217
+ /** Draw height in world units (fractions of `projector.tileWidth`). Omitted → one cell on tile grids (`flat`/`iso`/`hex`); native source px on `free`/`side`. */
218
+ height?: number;
219
+ /** Explicit atlas sub-rect override (px); omitted → resolved from `asset.atlas`/`asset.sprite`. */
220
+ frame?: Rect;
221
+ /** Animation to play. 3D backend: a named GLB clip (matched case-insensitively). 2D painter: when `asset.atlas` resolves to a `SpriteSheetAtlas` manifest, the canonical row of that name (idle/walk/attack/hit/death) plays off the host paint clock; an explicit `frame` rect overrides. */
222
+ animation?: string;
223
+ /** Override the sheet row's loop flag. The paint clock is wall-time, so one-shot rows hold their final frame — preview pages set `true` to cycle attack/hit/death continuously. */
224
+ loop?: boolean;
225
+ /** Mirror horizontally (facing). */
226
+ flipX?: boolean;
227
+ /** Rotation in radians about the sprite's center. */
228
+ rotation?: number;
229
+ /** 0..1 opacity. */
230
+ opacity?: number;
231
+ /** Drop shadow (e.g. a team-colored glow). */
232
+ shadow?: DrawShapeShadow;
233
+ }
234
+
251
235
  /**
252
236
  * `draw-text` — the neutral text drawable atom (dimension-agnostic).
253
237
  *
@@ -258,6 +242,16 @@ interface DrawShapeProps extends DrawableBase {
258
242
  * component renders `null` (a drawable is painted by the host, not the DOM).
259
243
  */
260
244
 
245
+ /**
246
+ * Mirrors DOM lib.dom.d.ts `CanvasTextAlign` by value (used directly instead
247
+ * of the ambient global so the pattern-sync scanner — which only indexes
248
+ * `components/**` and can't see ambient TS-lib types — resolves this to a
249
+ * concrete enum instead of `json`). Structurally identical; `node.align`
250
+ * still flows straight into `Painter2D.text`'s `TextStyle.align`.
251
+ */
252
+ type DrawTextAlign = 'center' | 'end' | 'left' | 'right' | 'start';
253
+ /** Mirrors DOM `CanvasTextBaseline` by value — see {@link DrawTextAlign}. */
254
+ type DrawTextBaseline = 'alphabetic' | 'bottom' | 'hanging' | 'ideographic' | 'middle' | 'top';
261
255
  interface DrawTextProps extends DrawableBase {
262
256
  type: 'draw-text';
263
257
  text: string;
@@ -268,8 +262,8 @@ interface DrawTextProps extends DrawableBase {
268
262
  offsetY?: number;
269
263
  color: string;
270
264
  font?: string;
271
- align?: CanvasTextAlign;
272
- baseline?: CanvasTextBaseline;
265
+ align?: DrawTextAlign;
266
+ baseline?: DrawTextBaseline;
273
267
  opacity?: number;
274
268
  }
275
269
 
@@ -525,4 +519,4 @@ interface DrawTextLayerProps extends DrawableBase {
525
519
  /** Every drawable descriptor. The host's `children` are a `DrawableNode[]`. */
526
520
  type DrawableNode = DrawSpriteProps | DrawShapeProps | DrawTextProps | DrawGroupProps | DrawMeshProps | DrawSpriteLayerProps | DrawShapeLayerProps | DrawTextLayerProps;
527
521
 
528
- export type { DrawableNode as D };
522
+ export type { DrawableNode as D, MeshShapeKind as M, MeshMaterial as a, DrawGroupProps as b, DrawTextProps as c, DrawMeshProps as d };