@glissade/scene 0.20.0-pre.6 → 0.20.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.
package/dist/describe.js CHANGED
@@ -23,7 +23,7 @@ import { easings, listValueTypes } from "@glissade/core";
23
23
  * never pulled onto the base embed path — a scene that never calls `describe()`
24
24
  * pays zero bytes for it.
25
25
  */
26
- const RAW_VERSION = "0.20.0-pre.6";
26
+ const RAW_VERSION = "0.20.0";
27
27
  const PACKAGE_VERSION = RAW_VERSION.includes("GLISSADE_".concat("VERSION")) ? "0.0.0-dev" : RAW_VERSION;
28
28
  /** Arity of a value type's numeric repr: vec2/vec2-arc → 2, number → 1; others (color/paint/path/string/boolean) carry no scalar arity. */
29
29
  function arityOf(type) {
package/dist/layout.d.ts CHANGED
@@ -3,7 +3,28 @@ import { Column, Layout, LayoutProps, Row, RowProps, Stack, StackProps } from ".
3
3
 
4
4
  //#region src/layoutEngineYoga.d.ts
5
5
 
6
+ /** Options for {@link loadYogaLayoutEngine}. */
7
+ interface LoadYogaOptions {
8
+ /**
9
+ * Override the module specifier the loader dynamic-imports for `yoga-layout`.
10
+ *
11
+ * The default (`undefined`) imports the bare `'yoga-layout/load'` specifier —
12
+ * correct under npm / a bundler / an import map, where the resolver finds the
13
+ * package. But in the **no-build `@glissade/browser` IIFE** there is no
14
+ * resolver, so a bare specifier throws *"Module name, 'yoga-layout/load' does
15
+ * not resolve to a valid URL."* — the headline no-build layout feature can't
16
+ * self-load. Pass a CDN ESM URL to resolve it without an import map, e.g.
17
+ *
18
+ * ```js
19
+ * await glissade.loadYogaLayoutEngine({ url: 'https://esm.sh/yoga-layout@3.2.1/load' });
20
+ * ```
21
+ *
22
+ * (Or register an `<script type="importmap">` mapping `yoga-layout/load` to
23
+ * that URL and call with no argument — see `docs/layout.md`.)
24
+ */
25
+ url?: string;
26
+ }
6
27
  /** Load Yoga (wasm) and register it as the active LayoutEngine. Idempotent. */
7
- declare function loadYogaLayoutEngine(): Promise<LayoutEngine>;
28
+ declare function loadYogaLayoutEngine(opts?: LoadYogaOptions): Promise<LayoutEngine>;
8
29
  //#endregion
9
30
  export { Column, Layout, type LayoutBox, type LayoutChildSpec, type LayoutContainerSpec, type LayoutEngine, LayoutEngineMissingError, type LayoutProps, type LayoutResult, Row, type RowProps, Stack, type StackProps, getLayoutEngine, loadYogaLayoutEngine, setLayoutEngine };
package/dist/layout.js CHANGED
@@ -12,8 +12,12 @@ import { Column, Layout, Row, Stack } from "./layoutCtors.js";
12
12
  * of the bundle).
13
13
  */
14
14
  /** Load Yoga (wasm) and register it as the active LayoutEngine. Idempotent. */
15
- async function loadYogaLayoutEngine() {
16
- const { loadYoga, FlexDirection, Justify, Align, Gutter, Edge, Direction } = await import("yoga-layout/load");
15
+ async function loadYogaLayoutEngine(opts) {
16
+ const { loadYoga, FlexDirection, Justify, Align, Gutter, Edge, Direction } = opts?.url ? await import(
17
+ /* @vite-ignore */
18
+ /* webpackIgnore: true */
19
+ opts.url
20
+ ) : await import("yoga-layout/load");
17
21
  const yoga = await loadYoga();
18
22
  const JUSTIFY = {
19
23
  start: Justify.FlexStart,
@@ -29,6 +29,13 @@ declare class Layout extends Group {
29
29
  #private;
30
30
  /** CLI/host detection marker — avoids importing this entry just to instanceof. */
31
31
  static readonly isLayoutNode = true;
32
+ /**
33
+ * Taxonomy name pinned literally (survives IIFE minification — see {@link Group}).
34
+ * Overrides Group's `'Group'`; `Stack`/`Row`/`Column` are factories returning a
35
+ * `Layout`, so they inherit `'Layout'` and the bind-guard names their construction
36
+ * props (`direction`/`justify`/`align`/`children`) correctly in the minified bundle.
37
+ */
38
+ get describeType(): string;
32
39
  readonly width: BindableSignal<number>;
33
40
  readonly height: BindableSignal<number>;
34
41
  readonly gap: BindableSignal<number>;
@@ -33,6 +33,15 @@ import { computed, signal } from "@glissade/core";
33
33
  var Layout = class extends Group {
34
34
  /** CLI/host detection marker — avoids importing this entry just to instanceof. */
35
35
  static isLayoutNode = true;
36
+ /**
37
+ * Taxonomy name pinned literally (survives IIFE minification — see {@link Group}).
38
+ * Overrides Group's `'Group'`; `Stack`/`Row`/`Column` are factories returning a
39
+ * `Layout`, so they inherit `'Layout'` and the bind-guard names their construction
40
+ * props (`direction`/`justify`/`align`/`children`) correctly in the minified bundle.
41
+ */
42
+ get describeType() {
43
+ return "Layout";
44
+ }
36
45
  width;
37
46
  height;
38
47
  gap;
package/dist/nodes.d.ts CHANGED
@@ -363,6 +363,17 @@ declare abstract class Custom extends Node {}
363
363
  declare function roundedRectSegs(x: number, y: number, w: number, h: number, r: number): PathSeg[];
364
364
  declare class Group extends Node {
365
365
  #private;
366
+ /**
367
+ * Taxonomy name pinned as a STRING LITERAL (not the inherited
368
+ * `constructor.name`): the minified `@glissade/browser` IIFE mangles class
369
+ * names, so the base `Node.describeType` getter returns a garbled name in the
370
+ * bundle — which silently breaks the bind-guard's construction-prop message
371
+ * (`scene.ts` keys `isConstructionProp(node.describeType, …)` on it, so a
372
+ * mangled name falls through to the generic "no signal resolves" error).
373
+ * Every built-in node pins it literally; `ImageNode` already did. Render-neutral
374
+ * (describeType is read only on the error path + by `describe()`).
375
+ */
376
+ get describeType(): string;
366
377
  readonly children: Node[];
367
378
  constructor(props?: NodeProps & {
368
379
  children?: Node[];
@@ -429,6 +440,8 @@ declare function coercePathData(data: unknown): PathValue;
429
440
  */
430
441
  declare function pathFromSegs(segs: readonly PathSeg[]): PathValue;
431
442
  declare class Rect extends Shape {
443
+ /** Taxonomy name pinned literally (survives IIFE minification — see {@link Group}). */
444
+ get describeType(): string;
432
445
  readonly width: BindableSignal<number>;
433
446
  readonly height: BindableSignal<number>;
434
447
  /** Corner radius; clamped to half the smaller dimension. radius = h/2 makes a pill. */
@@ -445,6 +458,8 @@ declare class Rect extends Shape {
445
458
  protected pathSegs(): PathSeg[];
446
459
  }
447
460
  declare class Circle extends Shape {
461
+ /** Taxonomy name pinned literally (survives IIFE minification — see {@link Group}). */
462
+ get describeType(): string;
448
463
  readonly radius: BindableSignal<number>;
449
464
  constructor(props?: ShapeProps & {
450
465
  radius?: PropInit<number>;
@@ -472,6 +487,8 @@ interface PathProps extends ShapeProps {
472
487
  * wherever the author put 0,0); flow placement uses the control-point bounds.
473
488
  */
474
489
  declare class Path extends Shape {
490
+ /** Taxonomy name pinned literally (survives IIFE minification — see {@link Group}). */
491
+ get describeType(): string;
475
492
  readonly data: BindableSignal<PathValue>;
476
493
  constructor(props?: PathProps);
477
494
  /** Control-point bounding box (conservative: contains the true curve). */
@@ -540,6 +557,8 @@ interface VideoProps extends NodeProps {
540
557
  declare class Video extends Node {
541
558
  /** Marks this node as referencing a kind 'video' timeline asset (§3.8). */
542
559
  static readonly assetKind: "video";
560
+ /** Taxonomy name pinned literally (survives IIFE minification — see {@link Group}). */
561
+ get describeType(): string;
543
562
  readonly assetId: string;
544
563
  readonly at: number;
545
564
  readonly trimStart: number;
@@ -637,6 +656,8 @@ interface TextProps extends NodeProps {
637
656
  revealFraction?: PropInit<number>;
638
657
  }
639
658
  declare class Text extends Node {
659
+ /** Taxonomy name pinned literally (survives IIFE minification — see {@link Group}). */
660
+ get describeType(): string;
640
661
  readonly text: BindableSignal<string>;
641
662
  readonly fill: BindableSignal<string>;
642
663
  readonly fontSize: BindableSignal<number>;
package/dist/nodes.js CHANGED
@@ -1035,6 +1035,19 @@ function roundedRectSegs(x, y, w, h, r) {
1035
1035
  ];
1036
1036
  }
1037
1037
  var Group = class extends Node {
1038
+ /**
1039
+ * Taxonomy name pinned as a STRING LITERAL (not the inherited
1040
+ * `constructor.name`): the minified `@glissade/browser` IIFE mangles class
1041
+ * names, so the base `Node.describeType` getter returns a garbled name in the
1042
+ * bundle — which silently breaks the bind-guard's construction-prop message
1043
+ * (`scene.ts` keys `isConstructionProp(node.describeType, …)` on it, so a
1044
+ * mangled name falls through to the generic "no signal resolves" error).
1045
+ * Every built-in node pins it literally; `ImageNode` already did. Render-neutral
1046
+ * (describeType is read only on the error path + by `describe()`).
1047
+ */
1048
+ get describeType() {
1049
+ return "Group";
1050
+ }
1038
1051
  children;
1039
1052
  /** Version bumped on structural child mutation, so a dependency-tracked memo
1040
1053
  * (e.g. Layout's computed) re-runs when the child SET changes — not only when
@@ -1356,6 +1369,10 @@ function pathFromSegs(segs) {
1356
1369
  return contours;
1357
1370
  }
1358
1371
  var Rect = class extends Shape {
1372
+ /** Taxonomy name pinned literally (survives IIFE minification — see {@link Group}). */
1373
+ get describeType() {
1374
+ return "Rect";
1375
+ }
1359
1376
  width;
1360
1377
  height;
1361
1378
  /** Corner radius; clamped to half the smaller dimension. radius = h/2 makes a pill. */
@@ -1383,6 +1400,10 @@ var Rect = class extends Shape {
1383
1400
  }
1384
1401
  };
1385
1402
  var Circle = class extends Shape {
1403
+ /** Taxonomy name pinned literally (survives IIFE minification — see {@link Group}). */
1404
+ get describeType() {
1405
+ return "Circle";
1406
+ }
1386
1407
  radius;
1387
1408
  constructor(props = {}) {
1388
1409
  super(props);
@@ -1416,6 +1437,10 @@ var Circle = class extends Shape {
1416
1437
  * wherever the author put 0,0); flow placement uses the control-point bounds.
1417
1438
  */
1418
1439
  var Path = class extends Shape {
1440
+ /** Taxonomy name pinned literally (survives IIFE minification — see {@link Group}). */
1441
+ get describeType() {
1442
+ return "Path";
1443
+ }
1419
1444
  data;
1420
1445
  constructor(props = {}) {
1421
1446
  super(props);
@@ -1560,6 +1585,10 @@ var ImageNode = class extends Node {
1560
1585
  var Video = class extends Node {
1561
1586
  /** Marks this node as referencing a kind 'video' timeline asset (§3.8). */
1562
1587
  static assetKind = "video";
1588
+ /** Taxonomy name pinned literally (survives IIFE minification — see {@link Group}). */
1589
+ get describeType() {
1590
+ return "Video";
1591
+ }
1563
1592
  assetId;
1564
1593
  at;
1565
1594
  trimStart;
@@ -1614,6 +1643,10 @@ var Video = class extends Node {
1614
1643
  }
1615
1644
  };
1616
1645
  var Text = class extends Node {
1646
+ /** Taxonomy name pinned literally (survives IIFE minification — see {@link Group}). */
1647
+ get describeType() {
1648
+ return "Text";
1649
+ }
1617
1650
  text;
1618
1651
  fill;
1619
1652
  fontSize;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@glissade/scene",
3
- "version": "0.20.0-pre.6",
3
+ "version": "0.20.0",
4
4
  "description": "glissade scene graph: nodes, transforms, DisplayList emission. Renderer-agnostic; zero DOM/Node dependencies.",
5
5
  "license": "Apache-2.0",
6
6
  "engines": {
@@ -59,7 +59,7 @@
59
59
  ],
60
60
  "dependencies": {
61
61
  "yoga-layout": "^3.2.1",
62
- "@glissade/core": "0.20.0-pre.6"
62
+ "@glissade/core": "0.20.0"
63
63
  },
64
64
  "repository": {
65
65
  "type": "git",