@flighthq/node 0.5.1-next.920.da8f530 → 0.6.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 (179) hide show
  1. package/README.md +2 -2
  2. package/dist/.tsbuildinfo.contract +1 -0
  3. package/dist/.tsbuildinfo.runtime +1 -0
  4. package/dist/boundsRectangle.d.ts +14 -13
  5. package/dist/boundsRectangle.d.ts.map +1 -1
  6. package/dist/boundsRectangle.js +11 -5
  7. package/dist/boundsRectangle.js.map +1 -1
  8. package/dist/contract.d.ts +21 -22
  9. package/dist/contract.d.ts.map +1 -1
  10. package/dist/contract.js +20 -22
  11. package/dist/contract.js.map +1 -1
  12. package/dist/contract.node-types.d.ts +22 -0
  13. package/dist/contract.node-types.d.ts.map +1 -0
  14. package/dist/contract.node-types.js +3 -0
  15. package/dist/contract.node-types.js.map +1 -0
  16. package/dist/enableNodeGuards.d.ts +2 -1
  17. package/dist/enableNodeGuards.d.ts.map +1 -1
  18. package/dist/enableNodeGuards.js +6 -6
  19. package/dist/enableNodeGuards.js.map +1 -1
  20. package/dist/hasAppearance.d.ts +1 -1
  21. package/dist/hasBlendMode.d.ts +1 -1
  22. package/dist/hasBoundsRectangle.d.ts +4 -3
  23. package/dist/hasBoundsRectangle.d.ts.map +1 -1
  24. package/dist/hasBoundsRectangle.js.map +1 -1
  25. package/dist/hasClip.d.ts +1 -1
  26. package/dist/hasClip.d.ts.map +1 -1
  27. package/dist/hasMaterial.d.ts +1 -1
  28. package/dist/hasTransform2d.d.ts +1 -1
  29. package/dist/hasTransform3d.d.ts +1 -1
  30. package/dist/hasTransform3d.d.ts.map +1 -1
  31. package/dist/hasTransform3d.js.map +1 -1
  32. package/dist/hierarchy.d.ts +23 -23
  33. package/dist/hierarchy.d.ts.map +1 -1
  34. package/dist/hierarchy.js +34 -16
  35. package/dist/hierarchy.js.map +1 -1
  36. package/dist/index.d.ts +22 -1
  37. package/dist/index.d.ts.map +1 -1
  38. package/dist/index.js +20 -1
  39. package/dist/index.js.map +1 -1
  40. package/dist/node.d.ts +11 -9
  41. package/dist/node.d.ts.map +1 -1
  42. package/dist/node.js +18 -14
  43. package/dist/node.js.map +1 -1
  44. package/dist/nodeColorAdjustment.d.ts +6 -5
  45. package/dist/nodeColorAdjustment.d.ts.map +1 -1
  46. package/dist/nodeColorAdjustment.js +2 -2
  47. package/dist/nodeColorAdjustment.js.map +1 -1
  48. package/dist/nodeOrderList.d.ts +17 -16
  49. package/dist/nodeOrderList.d.ts.map +1 -1
  50. package/dist/nodeOrderList.js +4 -4
  51. package/dist/nodeOrderList.js.map +1 -1
  52. package/dist/nodeTransform2d.d.ts +11 -10
  53. package/dist/nodeTransform2d.d.ts.map +1 -1
  54. package/dist/nodeTransform2d.js +27 -16
  55. package/dist/nodeTransform2d.js.map +1 -1
  56. package/dist/nodeTransform3d.d.ts +13 -12
  57. package/dist/nodeTransform3d.d.ts.map +1 -1
  58. package/dist/nodeTransform3d.js +26 -15
  59. package/dist/nodeTransform3d.js.map +1 -1
  60. package/dist/revision.d.ts +18 -18
  61. package/dist/revision.d.ts.map +1 -1
  62. package/dist/revision.js +18 -9
  63. package/dist/revision.js.map +1 -1
  64. package/dist/stageFit.d.ts +4 -2
  65. package/dist/stageFit.d.ts.map +1 -1
  66. package/dist/stageFit.js +1 -1
  67. package/dist/stageFit.js.map +1 -1
  68. package/dist/traversal.d.ts +11 -11
  69. package/dist/traversal.d.ts.map +1 -1
  70. package/dist/traversal.js +2 -2
  71. package/dist/traversal.js.map +1 -1
  72. package/dist/types/AppearanceFlags.d.ts +22 -0
  73. package/dist/types/AppearanceFlags.d.ts.map +1 -0
  74. package/dist/types/AppearanceFlags.js +38 -0
  75. package/dist/types/AppearanceFlags.js.map +1 -0
  76. package/dist/types/HasAppearance.d.ts +14 -0
  77. package/dist/types/HasAppearance.d.ts.map +1 -0
  78. package/dist/types/HasAppearance.js +2 -0
  79. package/dist/types/HasAppearance.js.map +1 -0
  80. package/dist/types/HasBlendMode.d.ts +7 -0
  81. package/dist/types/HasBlendMode.d.ts.map +1 -0
  82. package/dist/types/HasBlendMode.js +2 -0
  83. package/dist/types/HasBlendMode.js.map +1 -0
  84. package/dist/types/HasBoundsRectangle.d.ts +17 -0
  85. package/dist/types/HasBoundsRectangle.d.ts.map +1 -0
  86. package/dist/types/HasBoundsRectangle.js +2 -0
  87. package/dist/types/HasBoundsRectangle.js.map +1 -0
  88. package/dist/types/HasClip.d.ts +14 -0
  89. package/dist/types/HasClip.d.ts.map +1 -0
  90. package/dist/types/HasClip.js +2 -0
  91. package/dist/types/HasClip.js.map +1 -0
  92. package/dist/types/HasColorScaleBias.d.ts +7 -0
  93. package/dist/types/HasColorScaleBias.d.ts.map +1 -0
  94. package/dist/types/HasColorScaleBias.js +2 -0
  95. package/dist/types/HasColorScaleBias.js.map +1 -0
  96. package/dist/types/HasMaterial.d.ts +8 -0
  97. package/dist/types/HasMaterial.d.ts.map +1 -0
  98. package/dist/types/HasMaterial.js +2 -0
  99. package/dist/types/HasMaterial.js.map +1 -0
  100. package/dist/types/HasTransform2D.d.ts +29 -0
  101. package/dist/types/HasTransform2D.d.ts.map +1 -0
  102. package/dist/types/HasTransform2D.js +2 -0
  103. package/dist/types/HasTransform2D.js.map +1 -0
  104. package/dist/types/HasTransform3D.d.ts +17 -0
  105. package/dist/types/HasTransform3D.d.ts.map +1 -0
  106. package/dist/types/HasTransform3D.js +2 -0
  107. package/dist/types/HasTransform3D.js.map +1 -0
  108. package/dist/types/HierarchyNode.d.ts +4 -0
  109. package/dist/types/HierarchyNode.d.ts.map +1 -0
  110. package/dist/types/HierarchyNode.js +2 -0
  111. package/dist/types/HierarchyNode.js.map +1 -0
  112. package/dist/types/MethodsOf.d.ts +4 -0
  113. package/dist/types/MethodsOf.d.ts.map +1 -0
  114. package/dist/types/MethodsOf.js +2 -0
  115. package/dist/types/MethodsOf.js.map +1 -0
  116. package/dist/types/Node.d.ts +52 -0
  117. package/dist/types/Node.d.ts.map +1 -0
  118. package/dist/types/Node.js +3 -0
  119. package/dist/types/Node.js.map +1 -0
  120. package/dist/types/NodeDescendantVisitor.d.ts +3 -0
  121. package/dist/types/NodeDescendantVisitor.d.ts.map +1 -0
  122. package/dist/types/NodeDescendantVisitor.js +2 -0
  123. package/dist/types/NodeDescendantVisitor.js.map +1 -0
  124. package/dist/types/NodeOrderList.d.ts +10 -0
  125. package/dist/types/NodeOrderList.d.ts.map +1 -0
  126. package/dist/types/NodeOrderList.js +2 -0
  127. package/dist/types/NodeOrderList.js.map +1 -0
  128. package/dist/types/NodeSignals.d.ts +12 -0
  129. package/dist/types/NodeSignals.d.ts.map +1 -0
  130. package/dist/types/NodeSignals.js +2 -0
  131. package/dist/types/NodeSignals.js.map +1 -0
  132. package/dist/types/PartialNode.d.ts +6 -0
  133. package/dist/types/PartialNode.d.ts.map +1 -0
  134. package/dist/types/PartialNode.js +2 -0
  135. package/dist/types/PartialNode.js.map +1 -0
  136. package/dist/types/RendererData.d.ts +5 -0
  137. package/dist/types/RendererData.d.ts.map +1 -0
  138. package/dist/types/RendererData.js +2 -0
  139. package/dist/types/RendererData.js.map +1 -0
  140. package/dist/types/Scene2DFitContext.d.ts +9 -0
  141. package/dist/types/Scene2DFitContext.d.ts.map +1 -0
  142. package/dist/types/Scene2DFitContext.js +2 -0
  143. package/dist/types/Scene2DFitContext.js.map +1 -0
  144. package/dist/types/Viewport.d.ts +11 -0
  145. package/dist/types/Viewport.d.ts.map +1 -0
  146. package/dist/types/Viewport.js +2 -0
  147. package/dist/types/Viewport.js.map +1 -0
  148. package/dist/types/ViewportScaleMode.d.ts +2 -0
  149. package/dist/types/ViewportScaleMode.d.ts.map +1 -0
  150. package/dist/types/ViewportScaleMode.js +2 -0
  151. package/dist/types/ViewportScaleMode.js.map +1 -0
  152. package/dist/types.d.ts +3 -0
  153. package/dist/types.d.ts.map +1 -0
  154. package/dist/types.js +2 -0
  155. package/dist/types.js.map +1 -0
  156. package/dist/viewport.d.ts +2 -1
  157. package/dist/viewport.d.ts.map +1 -1
  158. package/dist/viewport.js +2 -2
  159. package/dist/viewport.js.map +1 -1
  160. package/package.json +13 -10
  161. package/src/boundsRectangle.test.ts +86 -11
  162. package/src/enableNodeGuards.test.ts +22 -15
  163. package/src/hasAppearance.test.ts +3 -4
  164. package/src/hasBlendMode.test.ts +4 -4
  165. package/src/hasBoundsRectangle.test.ts +4 -4
  166. package/src/hasClip.test.ts +4 -3
  167. package/src/hasMaterial.test.ts +3 -4
  168. package/src/hasTransform2d.test.ts +3 -4
  169. package/src/hasTransform3d.test.ts +3 -3
  170. package/src/hierarchy.test.ts +104 -18
  171. package/src/node.test.ts +47 -29
  172. package/src/nodeColorAdjustment.test.ts +4 -4
  173. package/src/nodeOrderList.test.ts +10 -10
  174. package/src/nodeTransform2d.test.ts +53 -4
  175. package/src/nodeTransform3d.test.ts +39 -12
  176. package/src/revision.test.ts +40 -3
  177. package/src/stageFit.test.ts +7 -12
  178. package/src/traversal.test.ts +21 -22
  179. package/src/viewport.test.ts +1 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HasColorScaleBias.js","sourceRoot":"","sources":["../../src/types/HasColorScaleBias.ts"],"names":[],"mappings":""}
@@ -0,0 +1,8 @@
1
+ import type { MaterialData, Material2D } from '@flighthq/materials/contract';
2
+ import type { NodeOf, NodeFields } from './Node.ts';
3
+ export interface HasMaterial {
4
+ material: Material2D | null;
5
+ materialData: MaterialData | null;
6
+ }
7
+ export type MaterialNode<Fields extends object = NodeFields> = NodeOf<Fields> & HasMaterial;
8
+ //# sourceMappingURL=HasMaterial.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HasMaterial.d.ts","sourceRoot":"","sources":["../../src/types/HasMaterial.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAE7E,OAAO,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAKpD,MAAM,WAAW,WAAW;IAG1B,QAAQ,EAAE,UAAU,GAAG,IAAI,CAAC;IAC5B,YAAY,EAAE,YAAY,GAAG,IAAI,CAAC;CACnC;AAED,MAAM,MAAM,YAAY,CAAC,MAAM,SAAS,MAAM,GAAG,UAAU,IAAI,MAAM,CAAC,MAAM,CAAC,GAAG,WAAW,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=HasMaterial.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HasMaterial.js","sourceRoot":"","sources":["../../src/types/HasMaterial.ts"],"names":[],"mappings":""}
@@ -0,0 +1,29 @@
1
+ import type { EntityRaw, EntityRuntime, EntityRuntimeKey } from '@flighthq/entity/contract';
2
+ import type { Matrix } from '@flighthq/geometry/contract';
3
+ import type { NodeOf, NodeFields } from './Node.ts';
4
+ export interface HasTransform2D extends EntityRaw {
5
+ [EntityRuntimeKey]: EntityRuntime | undefined;
6
+ /**
7
+ * Local pivot point that rotation and scale turn around and that aligns to (`x`, `y`). In local
8
+ * units, the same space as children. Defaults to 0,0 (top-left), which reproduces a pivot-free
9
+ * transform. A sprite built from a spritesheet frame sets this to the frame's registration point.
10
+ */
11
+ pivotX: number;
12
+ pivotY: number;
13
+ rotation: number;
14
+ scaleX: number;
15
+ scaleY: number;
16
+ skewX: number;
17
+ skewY: number;
18
+ x: number;
19
+ y: number;
20
+ }
21
+ export interface HasTransform2DRuntime extends EntityRuntime {
22
+ localMatrix: Matrix | null;
23
+ rotationAngle: number;
24
+ rotationCosine: number;
25
+ rotationSine: number;
26
+ worldMatrix: Matrix | null;
27
+ }
28
+ export type Transform2DNode<Fields extends object = NodeFields> = NodeOf<Fields> & HasTransform2D;
29
+ //# sourceMappingURL=HasTransform2D.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HasTransform2D.d.ts","sourceRoot":"","sources":["../../src/types/HasTransform2D.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC5F,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AAE1D,OAAO,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAEpD,MAAM,WAAW,cAAe,SAAQ,SAAS;IAC/C,CAAC,gBAAgB,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC;IAC9C;;;;OAIG;IACH,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX;AAED,MAAM,WAAW,qBAAsB,SAAQ,aAAa;IAC1D,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B;AAED,MAAM,MAAM,eAAe,CAAC,MAAM,SAAS,MAAM,GAAG,UAAU,IAAI,MAAM,CAAC,MAAM,CAAC,GAAG,cAAc,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=HasTransform2D.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HasTransform2D.js","sourceRoot":"","sources":["../../src/types/HasTransform2D.ts"],"names":[],"mappings":""}
@@ -0,0 +1,17 @@
1
+ import type { EntityRuntime } from '@flighthq/entity/contract';
2
+ import type { Matrix4 } from '@flighthq/geometry/contract';
3
+ import type { Quaternion } from '@flighthq/geometry/contract';
4
+ import type { Vector3 } from '@flighthq/geometry/contract';
5
+ import type { NodeOf, NodeFields } from './Node.ts';
6
+ export interface HasTransform3D {
7
+ position: Vector3;
8
+ rotation: Quaternion;
9
+ scale: Vector3;
10
+ }
11
+ export interface HasTransform3DRuntime extends EntityRuntime {
12
+ localMatrix4: Matrix4 | null;
13
+ localMatrix4Detached: boolean;
14
+ worldMatrix4: Matrix4 | null;
15
+ }
16
+ export type Transform3DNode<Fields extends object = NodeFields> = NodeOf<Fields> & HasTransform3D;
17
+ //# sourceMappingURL=HasTransform3D.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HasTransform3D.d.ts","sourceRoot":"","sources":["../../src/types/HasTransform3D.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAE3D,OAAO,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAOpD,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,UAAU,CAAC;IACrB,KAAK,EAAE,OAAO,CAAC;CAChB;AAED,MAAM,WAAW,qBAAsB,SAAQ,aAAa;IAE1D,YAAY,EAAE,OAAO,GAAG,IAAI,CAAC;IAI7B,oBAAoB,EAAE,OAAO,CAAC;IAC9B,YAAY,EAAE,OAAO,GAAG,IAAI,CAAC;CAC9B;AAED,MAAM,MAAM,eAAe,CAAC,MAAM,SAAS,MAAM,GAAG,UAAU,IAAI,MAAM,CAAC,MAAM,CAAC,GAAG,cAAc,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=HasTransform3D.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HasTransform3D.js","sourceRoot":"","sources":["../../src/types/HasTransform3D.ts"],"names":[],"mappings":""}
@@ -0,0 +1,4 @@
1
+ import type { Node, NodeAny, NodeFields } from './Node.ts';
2
+ export type HierarchyNode<Fields extends object = NodeFields> = Node<Fields>;
3
+ export type HierarchyNodeAny = NodeAny;
4
+ //# sourceMappingURL=HierarchyNode.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HierarchyNode.d.ts","sourceRoot":"","sources":["../../src/types/HierarchyNode.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAE3D,MAAM,MAAM,aAAa,CAAC,MAAM,SAAS,MAAM,GAAG,UAAU,IAAI,IAAI,CAAC,MAAM,CAAC,CAAC;AAC7E,MAAM,MAAM,gBAAgB,GAAG,OAAO,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=HierarchyNode.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HierarchyNode.js","sourceRoot":"","sources":["../../src/types/HierarchyNode.ts"],"names":[],"mappings":""}
@@ -0,0 +1,4 @@
1
+ export type MethodsOf<T> = {
2
+ [K in keyof T as T[K] extends (...args: any) => any ? K : never]: T[K];
3
+ };
4
+ //# sourceMappingURL=MethodsOf.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MethodsOf.d.ts","sourceRoot":"","sources":["../../src/types/MethodsOf.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,SAAS,CAAC,CAAC,IAAI;KACxB,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,KAAK,GAAG,GAAG,CAAC,GAAG,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC;CACvE,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=MethodsOf.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MethodsOf.js","sourceRoot":"","sources":["../../src/types/MethodsOf.ts"],"names":[],"mappings":""}
@@ -0,0 +1,52 @@
1
+ import type { ColorAdjustmentRuntime } from '@flighthq/adjustments/contract';
2
+ import type { EntityRaw, EntityRuntime, EntityRuntimeKey, Kind } from '@flighthq/entity/contract';
3
+ import type { NodeSignals } from './NodeSignals.ts';
4
+ declare const NodeFieldsKey: unique symbol;
5
+ export type NodeFieldsKey<T extends object> = symbol & {
6
+ readonly [NodeFieldsKey]?: T;
7
+ };
8
+ export interface NodeData extends EntityRaw {
9
+ [EntityRuntimeKey]: EntityRuntime | undefined;
10
+ }
11
+ export type NodeDataFactory<D extends NodeData> = () => D;
12
+ export type NodeRuntimeFactory<R extends EntityRuntime> = () => R;
13
+ export interface NodeFields {
14
+ readonly data: NodeData | null;
15
+ enabled: boolean;
16
+ kind: Kind;
17
+ name: string | null;
18
+ }
19
+ export interface Node<Fields extends object = NodeFields> extends NodeFields, EntityRaw {
20
+ [EntityRuntimeKey]: NodeRuntime<Fields> | undefined;
21
+ }
22
+ export type NodeOf<Fields extends object> = Node<Fields> & NoInfer<Fields>;
23
+ export interface NodeRuntime<Fields extends object = NodeFields> extends EntityRuntime, ColorAdjustmentRuntime {
24
+ appearanceId: number;
25
+ boundsUsingLocalBoundsId: number;
26
+ boundsUsingLocalTransformId: number;
27
+ canAddChild: (target: Node<Fields>, child: Node<Fields>) => boolean;
28
+ children: NodeOf<Fields>[] | null;
29
+ childrenId: number;
30
+ fields?: NodeFieldsKey<Fields>;
31
+ interactionSignals: unknown;
32
+ localBoundsId: number;
33
+ localBoundsUsingLocalBoundsId: number;
34
+ localContentId: number;
35
+ localTransformId: number;
36
+ localTransformUsingLocalTransformId: number;
37
+ nodeSignals: NodeSignals | null;
38
+ interactionState: unknown;
39
+ parent: NodeOf<Fields> | null;
40
+ parentReferenceId: number;
41
+ worldBoundsUsingLocalBoundsId: number;
42
+ worldBoundsUsingWorldTransformId: number;
43
+ worldTransformId: number;
44
+ worldTransformRevisionCounter: number;
45
+ worldTransformUsingLocalTransformId: number;
46
+ worldTransformUsingParentTransformId: number;
47
+ }
48
+ export declare const NodeKind = "Node";
49
+ export declare const NullScene3D: unique symbol;
50
+ export type NodeAny = Node<any>;
51
+ export type { NodeSignals };
52
+ //# sourceMappingURL=Node.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Node.d.ts","sourceRoot":"","sources":["../../src/types/Node.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AAC7E,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,gBAAgB,EAAE,IAAI,EAAE,MAAM,2BAA2B,CAAC;AAElG,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,CAAC,MAAM,aAAa,EAAE,OAAO,MAAM,CAAC;AAC3C,MAAM,MAAM,aAAa,CAAC,CAAC,SAAS,MAAM,IAAI,MAAM,GAAG;IACrD,QAAQ,CAAC,CAAC,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC;CAC9B,CAAC;AACF,MAAM,WAAW,QAAS,SAAQ,SAAS;IACzC,CAAC,gBAAgB,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC;CAC/C;AACD,MAAM,MAAM,eAAe,CAAC,CAAC,SAAS,QAAQ,IAAI,MAAM,CAAC,CAAC;AAC1D,MAAM,MAAM,kBAAkB,CAAC,CAAC,SAAS,aAAa,IAAI,MAAM,CAAC,CAAC;AAClE,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,IAAI,EAAE,QAAQ,GAAG,IAAI,CAAC;IAC/B,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,IAAI,CAAC;IACX,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CACrB;AACD,MAAM,WAAW,IAAI,CAAC,MAAM,SAAS,MAAM,GAAG,UAAU,CAAE,SAAQ,UAAU,EAAE,SAAS;IACrF,CAAC,gBAAgB,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,GAAG,SAAS,CAAC;CACrD;AACD,MAAM,MAAM,MAAM,CAAC,MAAM,SAAS,MAAM,IAAI,IAAI,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;AAC3E,MAAM,WAAW,WAAW,CAAC,MAAM,SAAS,MAAM,GAAG,UAAU,CAAE,SAAQ,aAAa,EAAE,sBAAsB;IAC5G,YAAY,EAAE,MAAM,CAAC;IACrB,wBAAwB,EAAE,MAAM,CAAC;IACjC,2BAA2B,EAAE,MAAM,CAAC;IACpC,WAAW,EAAE,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK,OAAO,CAAC;IACpE,QAAQ,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,GAAG,IAAI,CAAC;IAGlC,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IAC/B,kBAAkB,EAAE,OAAO,CAAC;IAC5B,aAAa,EAAE,MAAM,CAAC;IACtB,6BAA6B,EAAE,MAAM,CAAC;IACtC,cAAc,EAAE,MAAM,CAAC;IACvB,gBAAgB,EAAE,MAAM,CAAC;IACzB,mCAAmC,EAAE,MAAM,CAAC;IAC5C,WAAW,EAAE,WAAW,GAAG,IAAI,CAAC;IAIhC,gBAAgB,EAAE,OAAO,CAAC;IAC1B,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;IAI9B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,6BAA6B,EAAE,MAAM,CAAC;IACtC,gCAAgC,EAAE,MAAM,CAAC;IACzC,gBAAgB,EAAE,MAAM,CAAC;IAIzB,6BAA6B,EAAE,MAAM,CAAC;IACtC,mCAAmC,EAAE,MAAM,CAAC;IAC5C,oCAAoC,EAAE,MAAM,CAAC;CAC9C;AACD,eAAO,MAAM,QAAQ,SAAS,CAAC;AAC/B,eAAO,MAAM,WAAW,eAAwB,CAAC;AAEjD,MAAM,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC;AAChC,YAAY,EAAE,WAAW,EAAE,CAAC"}
@@ -0,0 +1,3 @@
1
+ export const NodeKind = 'Node';
2
+ export const NullScene3D = Symbol('NullScene3D');
3
+ //# sourceMappingURL=Node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Node.js","sourceRoot":"","sources":["../../src/types/Node.ts"],"names":[],"mappings":"AA2DA,MAAM,CAAC,MAAM,QAAQ,GAAG,MAAM,CAAC;AAC/B,MAAM,CAAC,MAAM,WAAW,GAAG,MAAM,CAAC,aAAa,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { Node, NodeFields } from './Node.ts';
2
+ export type NodeDescendantVisitor<Fields extends object = NodeFields> = (node: Node<Fields>) => boolean;
3
+ //# sourceMappingURL=NodeDescendantVisitor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NodeDescendantVisitor.d.ts","sourceRoot":"","sources":["../../src/types/NodeDescendantVisitor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAKlD,MAAM,MAAM,qBAAqB,CAAC,MAAM,SAAS,MAAM,GAAG,UAAU,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK,OAAO,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=NodeDescendantVisitor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NodeDescendantVisitor.js","sourceRoot":"","sources":["../../src/types/NodeDescendantVisitor.ts"],"names":[],"mappings":""}
@@ -0,0 +1,10 @@
1
+ import type { EntityRaw, EntityRuntime, EntityRuntimeKey } from '@flighthq/entity/contract';
2
+ import type { Node, NodeFields } from './Node.ts';
3
+ export interface NodeOrderList<Fields extends object = NodeFields> extends EntityRaw {
4
+ [EntityRuntimeKey]: EntityRuntime | undefined;
5
+ entryCount: number;
6
+ nodes: Node<Fields>[];
7
+ sortKeys: number[];
8
+ }
9
+ export type NodeOrderListEntryVisitor<Fields extends object = NodeFields> = (node: Node<Fields>, sortKey: number, index: number) => boolean | void;
10
+ //# sourceMappingURL=NodeOrderList.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NodeOrderList.d.ts","sourceRoot":"","sources":["../../src/types/NodeOrderList.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAE5F,OAAO,KAAK,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAClD,MAAM,WAAW,aAAa,CAAC,MAAM,SAAS,MAAM,GAAG,UAAU,CAAE,SAAQ,SAAS;IAClF,CAAC,gBAAgB,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC;IAC9C,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;IACtB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AACD,MAAM,MAAM,yBAAyB,CAAC,MAAM,SAAS,MAAM,GAAG,UAAU,IAAI,CAC1E,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,EAClB,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,MAAM,KACV,OAAO,GAAG,IAAI,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=NodeOrderList.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NodeOrderList.js","sourceRoot":"","sources":["../../src/types/NodeOrderList.ts"],"names":[],"mappings":""}
@@ -0,0 +1,12 @@
1
+ import type { EntityRaw, EntityRuntime, EntityRuntimeKey } from '@flighthq/entity/contract';
2
+ import type { Signal } from '@flighthq/signals/contract';
3
+ import type { NodeAny } from './Node.ts';
4
+ export interface NodeSignals extends EntityRaw {
5
+ [EntityRuntimeKey]: EntityRuntime | undefined;
6
+ onChildAdded: Signal<NodeAny>;
7
+ onChildRemoved: Signal<NodeAny>;
8
+ onChildrenChanged: Signal<void>;
9
+ onChildrenOrderChanged: Signal<void>;
10
+ onParentChanged: Signal<void>;
11
+ }
12
+ //# sourceMappingURL=NodeSignals.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NodeSignals.d.ts","sourceRoot":"","sources":["../../src/types/NodeSignals.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC5F,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAEzD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,MAAM,WAAW,WAAY,SAAQ,SAAS;IAC5C,CAAC,gBAAgB,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC;IAC9C,YAAY,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;IAC9B,cAAc,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;IAChC,iBAAiB,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;IAChC,sBAAsB,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;IACrC,eAAe,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;CAC/B"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=NodeSignals.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NodeSignals.js","sourceRoot":"","sources":["../../src/types/NodeSignals.ts"],"names":[],"mappings":""}
@@ -0,0 +1,6 @@
1
+ export type PartialNode<T> = {
2
+ data?: Partial<T extends {
3
+ data: infer U;
4
+ } ? U : never>;
5
+ } & Partial<Omit<T, 'data'>>;
6
+ //# sourceMappingURL=PartialNode.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PartialNode.d.ts","sourceRoot":"","sources":["../../src/types/PartialNode.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,WAAW,CAAC,CAAC,IAAI;IAC3B,IAAI,CAAC,EAAE,OAAO,CAAC,CAAC,SAAS;QAAE,IAAI,EAAE,MAAM,CAAC,CAAA;KAAE,GAAG,CAAC,GAAG,KAAK,CAAC,CAAC;CACzD,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=PartialNode.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PartialNode.js","sourceRoot":"","sources":["../../src/types/PartialNode.ts"],"names":[],"mappings":""}
@@ -0,0 +1,5 @@
1
+ import type { EntityRaw, EntityRuntime, EntityRuntimeKey } from '@flighthq/entity/contract';
2
+ export interface RendererData extends EntityRaw {
3
+ [EntityRuntimeKey]: EntityRuntime | undefined;
4
+ }
5
+ //# sourceMappingURL=RendererData.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RendererData.d.ts","sourceRoot":"","sources":["../../src/types/RendererData.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAE5F,MAAM,WAAW,YAAa,SAAQ,SAAS;IAC7C,CAAC,gBAAgB,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC;CAC/C"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=RendererData.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RendererData.js","sourceRoot":"","sources":["../../src/types/RendererData.ts"],"names":[],"mappings":""}
@@ -0,0 +1,9 @@
1
+ import type { ViewportAlign } from '@flighthq/layout/contract';
2
+ import type { Node, NodeFields } from './Node.ts';
3
+ import type { ViewportScaleMode } from './ViewportScaleMode.ts';
4
+ export interface Scene2DFitContext<Fields extends object = NodeFields> {
5
+ align: ViewportAlign;
6
+ root: Node<Fields> | null;
7
+ scaleMode: ViewportScaleMode;
8
+ }
9
+ //# sourceMappingURL=Scene2DFitContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Scene2DFitContext.d.ts","sourceRoot":"","sources":["../../src/types/Scene2DFitContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE/D,OAAO,KAAK,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAClD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAEhE,MAAM,WAAW,iBAAiB,CAAC,MAAM,SAAS,MAAM,GAAG,UAAU;IACnE,KAAK,EAAE,aAAa,CAAC;IACrB,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;IAC1B,SAAS,EAAE,iBAAiB,CAAC;CAC9B"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=Scene2DFitContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Scene2DFitContext.js","sourceRoot":"","sources":["../../src/types/Scene2DFitContext.ts"],"names":[],"mappings":""}
@@ -0,0 +1,11 @@
1
+ import type { EntityRaw, EntityRuntime, EntityRuntimeKey } from '@flighthq/entity/contract';
2
+ export interface Viewport extends EntityRaw {
3
+ [EntityRuntimeKey]: EntityRuntime | undefined;
4
+ devicePixelRatio: number;
5
+ height: number;
6
+ width: number;
7
+ x: number;
8
+ y: number;
9
+ }
10
+ export type ViewportLike = Partial<Viewport>;
11
+ //# sourceMappingURL=Viewport.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Viewport.d.ts","sourceRoot":"","sources":["../../src/types/Viewport.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAQ5F,MAAM,WAAW,QAAS,SAAQ,SAAS;IACzC,CAAC,gBAAgB,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC;IAC9C,gBAAgB,EAAE,MAAM,CAAC;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX;AAED,MAAM,MAAM,YAAY,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=Viewport.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Viewport.js","sourceRoot":"","sources":["../../src/types/Viewport.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export type ViewportScaleMode = 'exactfit' | 'noborder' | 'noscale' | 'showall';
2
+ //# sourceMappingURL=ViewportScaleMode.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ViewportScaleMode.d.ts","sourceRoot":"","sources":["../../src/types/ViewportScaleMode.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,iBAAiB,GAAG,UAAU,GAAG,UAAU,GAAG,SAAS,GAAG,SAAS,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=ViewportScaleMode.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ViewportScaleMode.js","sourceRoot":"","sources":["../../src/types/ViewportScaleMode.ts"],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
1
+ import type { NodeAny } from './contract.node-types.ts';
2
+ export type NodeRef = NodeAny;
3
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AAIxD,MAAM,MAAM,OAAO,GAAG,OAAO,CAAC"}
package/dist/types.js ADDED
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
@@ -1,4 +1,5 @@
1
- import type { Viewport, ViewportLike, EntityConstruction } from '@flighthq/types/contract';
1
+ import type { EntityConstruction } from '@flighthq/entity/contract';
2
+ import type { Viewport, ViewportLike } from './contract.node-types.ts';
2
3
  export declare function createViewport(obj?: Readonly<ViewportLike>): Viewport;
3
4
  export declare function getViewportAspect(viewport: Readonly<Viewport>): number;
4
5
  export declare function initializeViewport(out: EntityConstruction<Viewport>, obj?: Readonly<ViewportLike>): void;
@@ -1 +1 @@
1
- {"version":3,"file":"viewport.d.ts","sourceRoot":"","sources":["../src/viewport.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAE3F,wBAAgB,cAAc,CAAC,GAAG,CAAC,EAAE,QAAQ,CAAC,YAAY,CAAC,GAAG,QAAQ,CAIrE;AAID,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,QAAQ,CAAC,QAAQ,CAAC,GAAG,MAAM,CAEtE;AAKD,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,kBAAkB,CAAC,QAAQ,CAAC,EAAE,GAAG,CAAC,EAAE,QAAQ,CAAC,YAAY,CAAC,GAAG,IAAI,CAMxG"}
1
+ {"version":3,"file":"viewport.d.ts","sourceRoot":"","sources":["../src/viewport.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAEpE,OAAO,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAEvE,wBAAgB,cAAc,CAAC,GAAG,CAAC,EAAE,QAAQ,CAAC,YAAY,CAAC,GAAG,QAAQ,CAIrE;AAID,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,QAAQ,CAAC,QAAQ,CAAC,GAAG,MAAM,CAEtE;AAKD,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,kBAAkB,CAAC,QAAQ,CAAC,EAAE,GAAG,CAAC,EAAE,QAAQ,CAAC,YAAY,CAAC,GAAG,IAAI,CAMxG"}
package/dist/viewport.js CHANGED
@@ -1,8 +1,8 @@
1
- import { allocateEntity, finishEntity } from '@flighthq/entity/contract';
1
+ import { allocateEntity } from '@flighthq/entity/contract';
2
2
  export function createViewport(obj) {
3
3
  const out = allocateEntity();
4
4
  initializeViewport(out, obj);
5
- return finishEntity(out);
5
+ return out;
6
6
  }
7
7
  // Returns the viewport's aspect ratio (width / height), or 1 for a degenerate (zero-height) rect. A 3D
8
8
  // camera reads its projection aspect from this (`setCamera3DAspect(camera, getViewportAspect(viewport))`).
@@ -1 +1 @@
1
- {"version":3,"file":"viewport.js","sourceRoot":"","sources":["../src/viewport.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAGzE,MAAM,UAAU,cAAc,CAAC,GAA4B;IACzD,MAAM,GAAG,GAAG,cAAc,EAAY,CAAC;IACvC,kBAAkB,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IAC7B,OAAO,YAAY,CAAC,GAAG,CAAC,CAAC;AAC3B,CAAC;AAED,uGAAuG;AACvG,2GAA2G;AAC3G,MAAM,UAAU,iBAAiB,CAAC,QAA4B;IAC5D,OAAO,QAAQ,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;AACtE,CAAC;AAED,wGAAwG;AACxG,0GAA0G;AAC1G,4EAA4E;AAC5E,MAAM,UAAU,kBAAkB,CAAC,GAAiC,EAAE,GAA4B;IAChG,GAAG,CAAC,gBAAgB,GAAG,GAAG,EAAE,gBAAgB,IAAI,CAAC,CAAC;IAClD,GAAG,CAAC,MAAM,GAAG,GAAG,EAAE,MAAM,IAAI,CAAC,CAAC;IAC9B,GAAG,CAAC,KAAK,GAAG,GAAG,EAAE,KAAK,IAAI,CAAC,CAAC;IAC5B,GAAG,CAAC,CAAC,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC;IACpB,GAAG,CAAC,CAAC,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC;AACtB,CAAC"}
1
+ {"version":3,"file":"viewport.js","sourceRoot":"","sources":["../src/viewport.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAK3D,MAAM,UAAU,cAAc,CAAC,GAA4B;IACzD,MAAM,GAAG,GAAG,cAAc,EAAY,CAAC;IACvC,kBAAkB,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IAC7B,OAAO,GAAG,CAAC;AACb,CAAC;AAED,uGAAuG;AACvG,2GAA2G;AAC3G,MAAM,UAAU,iBAAiB,CAAC,QAA4B;IAC5D,OAAO,QAAQ,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;AACtE,CAAC;AAED,wGAAwG;AACxG,0GAA0G;AAC1G,4EAA4E;AAC5E,MAAM,UAAU,kBAAkB,CAAC,GAAiC,EAAE,GAA4B;IAChG,GAAG,CAAC,gBAAgB,GAAG,GAAG,EAAE,gBAAgB,IAAI,CAAC,CAAC;IAClD,GAAG,CAAC,MAAM,GAAG,GAAG,EAAE,MAAM,IAAI,CAAC,CAAC;IAC9B,GAAG,CAAC,KAAK,GAAG,GAAG,EAAE,KAAK,IAAI,CAAC,CAAC;IAC5B,GAAG,CAAC,CAAC,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC;IACpB,GAAG,CAAC,CAAC,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC;AACtB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flighthq/node",
3
- "version": "0.5.1-next.920.da8f530",
3
+ "version": "0.6.0",
4
4
  "author": "Joshua Granick and other contributors",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -32,23 +32,26 @@
32
32
  "scripts": {
33
33
  "build": "tsc -b",
34
34
  "clean": "tsc -b --clean",
35
+ "generate": "tsx ../../scripts/generate-rust-package.ts --crate flight-node --package node",
36
+ "generate:check": "tsx ../../scripts/generate-rust-package.ts --crate flight-node --package node --check",
35
37
  "test": "vitest run --config vitest.config.ts",
36
38
  "test:watch": "vitest --watch --config vitest.config.ts",
37
39
  "prepack": "npm run clean && npm run clean:dist && npm run build",
38
40
  "clean:dist": "tsx ../../scripts/clean-package-dist.ts"
39
41
  },
40
42
  "dependencies": {
41
- "@flighthq/adjustments": "0.5.1-next.920.da8f530",
42
- "@flighthq/entity": "0.5.1-next.920.da8f530",
43
- "@flighthq/geometry": "0.5.1-next.920.da8f530",
44
- "@flighthq/log": "0.5.1-next.920.da8f530",
45
- "@flighthq/materials": "0.5.1-next.920.da8f530",
46
- "@flighthq/math": "0.5.1-next.920.da8f530",
47
- "@flighthq/signals": "0.5.1-next.920.da8f530",
48
- "@flighthq/types": "0.5.1-next.920.da8f530"
43
+ "@flighthq/adjustments": "0.6.0",
44
+ "@flighthq/clip": "0.6.0",
45
+ "@flighthq/entity": "0.6.0",
46
+ "@flighthq/geometry": "0.6.0",
47
+ "@flighthq/layout": "0.6.0",
48
+ "@flighthq/log": "0.6.0",
49
+ "@flighthq/materials": "0.6.0",
50
+ "@flighthq/math": "0.6.0",
51
+ "@flighthq/signals": "0.6.0"
49
52
  },
50
53
  "devDependencies": {
51
- "typescript": "^5.3.0"
54
+ "typescript": "^7.0.2"
52
55
  },
53
56
  "description": "Base scene graph: transform hierarchy, bounds, appearance traits, child management",
54
57
  "sideEffects": false
@@ -6,25 +6,18 @@ import {
6
6
  setEmptyRectangle as setEmpty,
7
7
  setRectangle,
8
8
  } from '@flighthq/geometry/contract';
9
+ import type { Rectangle } from '@flighthq/geometry/contract';
9
10
  import {
10
11
  addNodeChild,
11
12
  createNode,
12
13
  ensureNodeLocalMatrix,
14
+ getNodeWorldMatrix,
13
15
  initTransform2DRuntimeTrait,
14
16
  initTransform2DTrait,
15
17
  invalidateNodeLocalTransform,
16
18
  removeNodeChild,
17
19
  setNodeEnabled,
18
20
  } from '@flighthq/node/contract';
19
- import type {
20
- HasBoundsRectangle,
21
- HasBoundsRectangleRuntime,
22
- HasTransform2D,
23
- HasTransform2DRuntime,
24
- Node,
25
- NodeRuntime,
26
- Rectangle,
27
- } from '@flighthq/types/contract';
28
21
 
29
22
  import {
30
23
  computeNodeBoundsRectangle,
@@ -39,8 +32,16 @@ import {
39
32
  getNodeWorldBoundsRectangle,
40
33
  setNodeHeight,
41
34
  setNodeWidth,
42
- } from './boundsRectangle';
43
- import { initBoundsRectangleRuntimeTrait, initBoundsRectangleTrait } from './hasBoundsRectangle';
35
+ } from './boundsRectangle.ts';
36
+ import type {
37
+ HasBoundsRectangle,
38
+ HasBoundsRectangleRuntime,
39
+ HasTransform2D,
40
+ HasTransform2DRuntime,
41
+ Node,
42
+ NodeRuntime,
43
+ } from './contract.node-types.ts';
44
+ import { initBoundsRectangleRuntimeTrait, initBoundsRectangleTrait } from './hasBoundsRectangle.ts';
44
45
 
45
46
  function getEntityRuntime(
46
47
  source: TestNode,
@@ -553,6 +554,80 @@ describe('getNodeWidth', () => {
553
554
  });
554
555
 
555
556
  describe('getNodeWorldBoundsRectangle', () => {
557
+ // Reparenting changes only which root mints world-transform ids, so only the two root-minted stamps
558
+ // are cleared; the node's own local bounds and local-transform stamps survive and are not recomputed.
559
+ it('keeps root-independent caches across a reparent while refreshing world state', () => {
560
+ const rootA = createTestNode();
561
+ const moved = createTestNode();
562
+ const leaf = createTestNode();
563
+ addNodeChild(rootA, moved);
564
+ addNodeChild(moved, leaf);
565
+ let computes = 0;
566
+ getEntityRuntime(leaf).computeLocalBoundsRectangle = (out) => {
567
+ computes++;
568
+ setRectangle(out as Rectangle, 0, 0, 4, 4);
569
+ };
570
+ rootA.x = 100;
571
+ leaf.x = 2;
572
+ invalidateNodeLocalTransform(rootA);
573
+ invalidateNodeLocalTransform(leaf);
574
+ expect(getNodeWorldBoundsRectangle(leaf).x).toBe(102);
575
+ const runtime = getEntityRuntime(leaf);
576
+ const localBoundsId = runtime.localBoundsId;
577
+ const localBoundsUsingLocalBoundsId = runtime.localBoundsUsingLocalBoundsId;
578
+ const worldBoundsUsingLocalBoundsId = runtime.worldBoundsUsingLocalBoundsId;
579
+ const worldTransformUsingLocalTransformId = runtime.worldTransformUsingLocalTransformId;
580
+ const localBoundsRectangle = runtime.localBoundsRectangle;
581
+ const rootB = createTestNode();
582
+ rootB.x = 7;
583
+ invalidateNodeLocalTransform(rootB);
584
+ getNodeWorldMatrix(rootB);
585
+
586
+ addNodeChild(rootB, moved);
587
+
588
+ expect(runtime.worldTransformUsingParentTransformId).toBe(-1);
589
+ expect(runtime.worldBoundsUsingWorldTransformId).toBe(-1);
590
+ expect(runtime.localBoundsId).toBe(localBoundsId);
591
+ expect(runtime.localBoundsUsingLocalBoundsId).toBe(localBoundsUsingLocalBoundsId);
592
+ expect(runtime.worldBoundsUsingLocalBoundsId).toBe(worldBoundsUsingLocalBoundsId);
593
+ expect(runtime.worldTransformUsingLocalTransformId).toBe(worldTransformUsingLocalTransformId);
594
+ expect(getNodeWorldMatrix(leaf).tx).toBe(9);
595
+ expect(getNodeWorldBoundsRectangle(leaf).x).toBe(9);
596
+ expect(runtime.localBoundsRectangle).toBe(localBoundsRectangle);
597
+ expect(computes).toBe(1);
598
+ });
599
+
600
+ // The bounds analog of the hierarchy reparent regression: world bounds of the moved subtree must be
601
+ // re-derived under the new root, never reused through a stamp minted by the old root's counter.
602
+ it('re-derives the moved subtree world bounds under its new root', () => {
603
+ const rootA = createTestNode();
604
+ const moved = createTestNode();
605
+ const middle = createTestNode();
606
+ const leaf = createTestNode();
607
+ addNodeChild(rootA, moved);
608
+ addNodeChild(moved, middle);
609
+ addNodeChild(middle, leaf);
610
+ getEntityRuntime(leaf).computeLocalBoundsRectangle = (out) => setRectangle(out as Rectangle, 0, 0, 4, 4);
611
+ rootA.x = 100;
612
+ middle.x = 1;
613
+ leaf.x = 2;
614
+ invalidateNodeLocalTransform(rootA);
615
+ invalidateNodeLocalTransform(middle);
616
+ invalidateNodeLocalTransform(leaf);
617
+ expect(getNodeWorldBoundsRectangle(leaf).x).toBe(103);
618
+ expect(getNodeWorldBoundsRectangle(middle).x).toBe(103);
619
+ const rootB = createTestNode();
620
+ getNodeWorldBoundsRectangle(rootB);
621
+
622
+ addNodeChild(rootB, moved);
623
+ moved.x = 5;
624
+ invalidateNodeLocalTransform(moved);
625
+
626
+ expect(getNodeWorldBoundsRectangle(middle).x).toBe(8);
627
+ expect(getNodeWorldBoundsRectangle(leaf).x).toBe(8);
628
+ expect(getNodeWorldBoundsRectangle(moved).x).toBe(8);
629
+ });
630
+
556
631
  it('should call ensure and return worldBoundsRectangle', () => {
557
632
  const object = createTestNode();
558
633
  const runtime = getEntityRuntime(object);