@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.
- package/README.md +2 -2
- package/dist/.tsbuildinfo.contract +1 -0
- package/dist/.tsbuildinfo.runtime +1 -0
- package/dist/boundsRectangle.d.ts +14 -13
- package/dist/boundsRectangle.d.ts.map +1 -1
- package/dist/boundsRectangle.js +11 -5
- package/dist/boundsRectangle.js.map +1 -1
- package/dist/contract.d.ts +21 -22
- package/dist/contract.d.ts.map +1 -1
- package/dist/contract.js +20 -22
- package/dist/contract.js.map +1 -1
- package/dist/contract.node-types.d.ts +22 -0
- package/dist/contract.node-types.d.ts.map +1 -0
- package/dist/contract.node-types.js +3 -0
- package/dist/contract.node-types.js.map +1 -0
- package/dist/enableNodeGuards.d.ts +2 -1
- package/dist/enableNodeGuards.d.ts.map +1 -1
- package/dist/enableNodeGuards.js +6 -6
- package/dist/enableNodeGuards.js.map +1 -1
- package/dist/hasAppearance.d.ts +1 -1
- package/dist/hasBlendMode.d.ts +1 -1
- package/dist/hasBoundsRectangle.d.ts +4 -3
- package/dist/hasBoundsRectangle.d.ts.map +1 -1
- package/dist/hasBoundsRectangle.js.map +1 -1
- package/dist/hasClip.d.ts +1 -1
- package/dist/hasClip.d.ts.map +1 -1
- package/dist/hasMaterial.d.ts +1 -1
- package/dist/hasTransform2d.d.ts +1 -1
- package/dist/hasTransform3d.d.ts +1 -1
- package/dist/hasTransform3d.d.ts.map +1 -1
- package/dist/hasTransform3d.js.map +1 -1
- package/dist/hierarchy.d.ts +23 -23
- package/dist/hierarchy.d.ts.map +1 -1
- package/dist/hierarchy.js +34 -16
- package/dist/hierarchy.js.map +1 -1
- package/dist/index.d.ts +22 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +20 -1
- package/dist/index.js.map +1 -1
- package/dist/node.d.ts +11 -9
- package/dist/node.d.ts.map +1 -1
- package/dist/node.js +18 -14
- package/dist/node.js.map +1 -1
- package/dist/nodeColorAdjustment.d.ts +6 -5
- package/dist/nodeColorAdjustment.d.ts.map +1 -1
- package/dist/nodeColorAdjustment.js +2 -2
- package/dist/nodeColorAdjustment.js.map +1 -1
- package/dist/nodeOrderList.d.ts +17 -16
- package/dist/nodeOrderList.d.ts.map +1 -1
- package/dist/nodeOrderList.js +4 -4
- package/dist/nodeOrderList.js.map +1 -1
- package/dist/nodeTransform2d.d.ts +11 -10
- package/dist/nodeTransform2d.d.ts.map +1 -1
- package/dist/nodeTransform2d.js +27 -16
- package/dist/nodeTransform2d.js.map +1 -1
- package/dist/nodeTransform3d.d.ts +13 -12
- package/dist/nodeTransform3d.d.ts.map +1 -1
- package/dist/nodeTransform3d.js +26 -15
- package/dist/nodeTransform3d.js.map +1 -1
- package/dist/revision.d.ts +18 -18
- package/dist/revision.d.ts.map +1 -1
- package/dist/revision.js +18 -9
- package/dist/revision.js.map +1 -1
- package/dist/stageFit.d.ts +4 -2
- package/dist/stageFit.d.ts.map +1 -1
- package/dist/stageFit.js +1 -1
- package/dist/stageFit.js.map +1 -1
- package/dist/traversal.d.ts +11 -11
- package/dist/traversal.d.ts.map +1 -1
- package/dist/traversal.js +2 -2
- package/dist/traversal.js.map +1 -1
- package/dist/types/AppearanceFlags.d.ts +22 -0
- package/dist/types/AppearanceFlags.d.ts.map +1 -0
- package/dist/types/AppearanceFlags.js +38 -0
- package/dist/types/AppearanceFlags.js.map +1 -0
- package/dist/types/HasAppearance.d.ts +14 -0
- package/dist/types/HasAppearance.d.ts.map +1 -0
- package/dist/types/HasAppearance.js +2 -0
- package/dist/types/HasAppearance.js.map +1 -0
- package/dist/types/HasBlendMode.d.ts +7 -0
- package/dist/types/HasBlendMode.d.ts.map +1 -0
- package/dist/types/HasBlendMode.js +2 -0
- package/dist/types/HasBlendMode.js.map +1 -0
- package/dist/types/HasBoundsRectangle.d.ts +17 -0
- package/dist/types/HasBoundsRectangle.d.ts.map +1 -0
- package/dist/types/HasBoundsRectangle.js +2 -0
- package/dist/types/HasBoundsRectangle.js.map +1 -0
- package/dist/types/HasClip.d.ts +14 -0
- package/dist/types/HasClip.d.ts.map +1 -0
- package/dist/types/HasClip.js +2 -0
- package/dist/types/HasClip.js.map +1 -0
- package/dist/types/HasColorScaleBias.d.ts +7 -0
- package/dist/types/HasColorScaleBias.d.ts.map +1 -0
- package/dist/types/HasColorScaleBias.js +2 -0
- package/dist/types/HasColorScaleBias.js.map +1 -0
- package/dist/types/HasMaterial.d.ts +8 -0
- package/dist/types/HasMaterial.d.ts.map +1 -0
- package/dist/types/HasMaterial.js +2 -0
- package/dist/types/HasMaterial.js.map +1 -0
- package/dist/types/HasTransform2D.d.ts +29 -0
- package/dist/types/HasTransform2D.d.ts.map +1 -0
- package/dist/types/HasTransform2D.js +2 -0
- package/dist/types/HasTransform2D.js.map +1 -0
- package/dist/types/HasTransform3D.d.ts +17 -0
- package/dist/types/HasTransform3D.d.ts.map +1 -0
- package/dist/types/HasTransform3D.js +2 -0
- package/dist/types/HasTransform3D.js.map +1 -0
- package/dist/types/HierarchyNode.d.ts +4 -0
- package/dist/types/HierarchyNode.d.ts.map +1 -0
- package/dist/types/HierarchyNode.js +2 -0
- package/dist/types/HierarchyNode.js.map +1 -0
- package/dist/types/MethodsOf.d.ts +4 -0
- package/dist/types/MethodsOf.d.ts.map +1 -0
- package/dist/types/MethodsOf.js +2 -0
- package/dist/types/MethodsOf.js.map +1 -0
- package/dist/types/Node.d.ts +52 -0
- package/dist/types/Node.d.ts.map +1 -0
- package/dist/types/Node.js +3 -0
- package/dist/types/Node.js.map +1 -0
- package/dist/types/NodeDescendantVisitor.d.ts +3 -0
- package/dist/types/NodeDescendantVisitor.d.ts.map +1 -0
- package/dist/types/NodeDescendantVisitor.js +2 -0
- package/dist/types/NodeDescendantVisitor.js.map +1 -0
- package/dist/types/NodeOrderList.d.ts +10 -0
- package/dist/types/NodeOrderList.d.ts.map +1 -0
- package/dist/types/NodeOrderList.js +2 -0
- package/dist/types/NodeOrderList.js.map +1 -0
- package/dist/types/NodeSignals.d.ts +12 -0
- package/dist/types/NodeSignals.d.ts.map +1 -0
- package/dist/types/NodeSignals.js +2 -0
- package/dist/types/NodeSignals.js.map +1 -0
- package/dist/types/PartialNode.d.ts +6 -0
- package/dist/types/PartialNode.d.ts.map +1 -0
- package/dist/types/PartialNode.js +2 -0
- package/dist/types/PartialNode.js.map +1 -0
- package/dist/types/RendererData.d.ts +5 -0
- package/dist/types/RendererData.d.ts.map +1 -0
- package/dist/types/RendererData.js +2 -0
- package/dist/types/RendererData.js.map +1 -0
- package/dist/types/Scene2DFitContext.d.ts +9 -0
- package/dist/types/Scene2DFitContext.d.ts.map +1 -0
- package/dist/types/Scene2DFitContext.js +2 -0
- package/dist/types/Scene2DFitContext.js.map +1 -0
- package/dist/types/Viewport.d.ts +11 -0
- package/dist/types/Viewport.d.ts.map +1 -0
- package/dist/types/Viewport.js +2 -0
- package/dist/types/Viewport.js.map +1 -0
- package/dist/types/ViewportScaleMode.d.ts +2 -0
- package/dist/types/ViewportScaleMode.d.ts.map +1 -0
- package/dist/types/ViewportScaleMode.js +2 -0
- package/dist/types/ViewportScaleMode.js.map +1 -0
- package/dist/types.d.ts +3 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/dist/viewport.d.ts +2 -1
- package/dist/viewport.d.ts.map +1 -1
- package/dist/viewport.js +2 -2
- package/dist/viewport.js.map +1 -1
- package/package.json +13 -10
- package/src/boundsRectangle.test.ts +86 -11
- package/src/enableNodeGuards.test.ts +22 -15
- package/src/hasAppearance.test.ts +3 -4
- package/src/hasBlendMode.test.ts +4 -4
- package/src/hasBoundsRectangle.test.ts +4 -4
- package/src/hasClip.test.ts +4 -3
- package/src/hasMaterial.test.ts +3 -4
- package/src/hasTransform2d.test.ts +3 -4
- package/src/hasTransform3d.test.ts +3 -3
- package/src/hierarchy.test.ts +104 -18
- package/src/node.test.ts +47 -29
- package/src/nodeColorAdjustment.test.ts +4 -4
- package/src/nodeOrderList.test.ts +10 -10
- package/src/nodeTransform2d.test.ts +53 -4
- package/src/nodeTransform3d.test.ts +39 -12
- package/src/revision.test.ts +40 -3
- package/src/stageFit.test.ts +7 -12
- package/src/traversal.test.ts +21 -22
- package/src/viewport.test.ts +1 -1
package/dist/nodeTransform3d.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getEntityRuntime } from '@flighthq/entity/contract';
|
|
2
2
|
import { acquireMatrix4, composeMatrix4, copyMatrix4, copyQuaternion, copyVector3, createMatrix4, decomposeMatrix4, inverseMatrix4, matrix4TransformPoint, multiplyMatrix4, releaseMatrix4, } from '@flighthq/geometry/contract';
|
|
3
|
-
import { computeNodeWorldTransformRevision, invalidateNodeLocalTransform } from './revision';
|
|
3
|
+
import { computeNodeWorldTransformRevision, invalidateNodeLocalTransform } from './revision.js';
|
|
4
4
|
export function convertNodeVector3GlobalToLocal(out, source, point) {
|
|
5
5
|
// Acquire from pool instead of allocating to avoid hot-path GC pressure.
|
|
6
6
|
const inv = acquireMatrix4();
|
|
@@ -20,20 +20,11 @@ export function ensureNodeLocalMatrix4(target) {
|
|
|
20
20
|
recomputeLocalTransform3D(target, runtime);
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
|
+
// Resolves the graph root once, then walks the ancestor chain with it: every recompute along the chain
|
|
24
|
+
// mints its revision from the same root counter without re-walking to the root per node.
|
|
23
25
|
export function ensureNodeWorldMatrix4(target) {
|
|
24
26
|
const runtime = getEntityRuntime(target);
|
|
25
|
-
|
|
26
|
-
let parentRuntime;
|
|
27
|
-
let parentWorldTransformId = 0;
|
|
28
|
-
if (parent !== null) {
|
|
29
|
-
ensureNodeWorldMatrix4(parent);
|
|
30
|
-
parentRuntime = getEntityRuntime(parent);
|
|
31
|
-
parentWorldTransformId = parentRuntime.worldTransformId;
|
|
32
|
-
}
|
|
33
|
-
if (runtime.worldTransformUsingLocalTransformId !== runtime.localTransformId ||
|
|
34
|
-
runtime.worldTransformUsingParentTransformId !== parentWorldTransformId) {
|
|
35
|
-
recomputeWorldTransform3D(target, runtime, parentRuntime);
|
|
36
|
-
}
|
|
27
|
+
ensureWorldTransform3D(target, runtime, resolveRootRuntime(runtime));
|
|
37
28
|
}
|
|
38
29
|
export function getNodeLocalMatrix4(target) {
|
|
39
30
|
ensureNodeLocalMatrix4(target);
|
|
@@ -88,6 +79,20 @@ export function syncNodeTransform3DFromMatrix4(target) {
|
|
|
88
79
|
decomposeMatrix4(target.position, target.rotation, target.scale, runtime.localMatrix4);
|
|
89
80
|
runtime.localMatrix4Detached = false;
|
|
90
81
|
}
|
|
82
|
+
function ensureWorldTransform3D(target, runtime, rootRuntime) {
|
|
83
|
+
const parent = runtime.parent;
|
|
84
|
+
let parentRuntime;
|
|
85
|
+
let parentWorldTransformId = 0;
|
|
86
|
+
if (parent !== null) {
|
|
87
|
+
parentRuntime = getEntityRuntime(parent);
|
|
88
|
+
ensureWorldTransform3D(parent, parentRuntime, rootRuntime);
|
|
89
|
+
parentWorldTransformId = parentRuntime.worldTransformId;
|
|
90
|
+
}
|
|
91
|
+
if (runtime.worldTransformUsingLocalTransformId !== runtime.localTransformId ||
|
|
92
|
+
runtime.worldTransformUsingParentTransformId !== parentWorldTransformId) {
|
|
93
|
+
recomputeWorldTransform3D(target, runtime, parentRuntime, rootRuntime);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
91
96
|
function recomputeLocalTransform3D(target, runtime) {
|
|
92
97
|
if (runtime.localMatrix4 === null)
|
|
93
98
|
runtime.localMatrix4 = createMatrix4();
|
|
@@ -95,7 +100,7 @@ function recomputeLocalTransform3D(target, runtime) {
|
|
|
95
100
|
runtime.localMatrix4Detached = false;
|
|
96
101
|
runtime.localTransformUsingLocalTransformId = runtime.localTransformId;
|
|
97
102
|
}
|
|
98
|
-
function recomputeWorldTransform3D(target, runtime, parentRuntime) {
|
|
103
|
+
function recomputeWorldTransform3D(target, runtime, parentRuntime, rootRuntime) {
|
|
99
104
|
if (runtime.worldMatrix4 === null) {
|
|
100
105
|
runtime.worldMatrix4 = createMatrix4();
|
|
101
106
|
}
|
|
@@ -106,6 +111,12 @@ function recomputeWorldTransform3D(target, runtime, parentRuntime) {
|
|
|
106
111
|
else {
|
|
107
112
|
copyMatrix4(runtime.worldMatrix4, runtime.localMatrix4);
|
|
108
113
|
}
|
|
109
|
-
computeNodeWorldTransformRevision(runtime, parentRuntime);
|
|
114
|
+
computeNodeWorldTransformRevision(runtime, parentRuntime, rootRuntime);
|
|
115
|
+
}
|
|
116
|
+
function resolveRootRuntime(runtime) {
|
|
117
|
+
let current = runtime;
|
|
118
|
+
while (current.parent !== null)
|
|
119
|
+
current = getEntityRuntime(current.parent);
|
|
120
|
+
return current;
|
|
110
121
|
}
|
|
111
122
|
//# sourceMappingURL=nodeTransform3d.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nodeTransform3d.js","sourceRoot":"","sources":["../src/nodeTransform3d.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EACL,cAAc,EACd,cAAc,EACd,WAAW,EACX,cAAc,EACd,WAAW,EACX,aAAa,EACb,gBAAgB,EAChB,cAAc,EACd,qBAAqB,EACrB,eAAe,EACf,cAAc,GACf,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"nodeTransform3d.js","sourceRoot":"","sources":["../src/nodeTransform3d.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EACL,cAAc,EACd,cAAc,EACd,WAAW,EACX,cAAc,EACd,WAAW,EACX,aAAa,EACb,gBAAgB,EAChB,cAAc,EACd,qBAAqB,EACrB,eAAe,EACf,cAAc,GACf,MAAM,6BAA6B,CAAC;AAIrC,OAAO,EAAE,iCAAiC,EAAE,4BAA4B,EAAE,MAAM,eAAe,CAAC;AAEhG,MAAM,U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I,OAAO,CAAC,YAAY,KAAK,IAAI;QAAE,OAAO,CAAC,YAAY,GAAG,aAAa,EAAE,CAAC;IAC1E,cAAc,CAAC,OAAO,CAAC,YAAY,EAAE,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC;IACrF,OAAO,CAAC,oBAAoB,GAAG,KAAK,CAAC;IACrC,OAAO,CAAC,mCAAmC,GAAG,OAAO,CAAC,gBAAgB,CAAC;AACzE,CAAC;AAED,SAAS,yBAAyB,CAChC,MAA+B,EAC/B,OAAoD,EACpD,aAAgF,EAChF,WAAgC;IAEhC,IAAI,OAAO,CAAC,YAAY,KAAK,IAAI,EAAE,CAAC;QAClC,OAAO,CAAC,YAAY,GAAG,aAAa,EAAE,CAAC;IACzC,CAAC;IACD,sBAAsB,CAAC,MAAM,CAAC,CAAC;IAE/B,IAAI,aAAa,KAAK,SAAS,EAAE,CAAC;QAChC,eAAe,CAAC,OAAO,CAAC,YAAY,EAAE,aAAa,CAAC,YAAa,EAAE,OAAO,CAAC,YAAa,CAAC,CAAC;IAC5F,CAAC;SAAM,CAAC;QACN,WAAW,CAAC,OAAO,CAAC,YAAY,EAAE,OAAO,CAAC,YAAa,CAAC,CAAC;IAC3D,CAAC;IAED,iCAAiC,CAAC,OAAO,EAAE,aAAa,EAAE,WAAW,CAAC,CAAC;AACzE,CAAC;AAED,SAAS,kBAAkB,CAAwB,OAA4B;IAC7E,IAAI,OAAO,GAAG,OAAO,CAAC;IACtB,OAAO,OAAO,CAAC,MAAM,KAAK,IAAI;QAAE,OAAO,GAAG,gBAAgB,CAAC,OAAO,CAAC,MAAM,CAAwB,CAAC;IAClG,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
package/dist/revision.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import type { Node, NodeRuntime } from '
|
|
2
|
-
export declare function computeNodeWorldTransformRevision<
|
|
3
|
-
export declare function getNodeAppearanceRevision<
|
|
4
|
-
export declare function getNodeChildrenRevision<
|
|
5
|
-
export declare function getNodeLocalBoundsRevision<
|
|
6
|
-
export declare function getNodeLocalContentRevision<
|
|
7
|
-
export declare function getNodeLocalTransformRevision<
|
|
8
|
-
export declare function getNodeParentReferenceRevision<
|
|
9
|
-
export declare function getNodeWorldTransformRevision<
|
|
1
|
+
import type { Node, NodeRuntime } from './contract.node-types.ts';
|
|
2
|
+
export declare function computeNodeWorldTransformRevision<Fields extends object>(runtime: NodeRuntime<Fields>, parentRuntime?: Readonly<NodeRuntime<Fields>>, rootRuntime?: NodeRuntime<Fields>): void;
|
|
3
|
+
export declare function getNodeAppearanceRevision<Fields extends object>(source: Readonly<Node<Fields>>): number;
|
|
4
|
+
export declare function getNodeChildrenRevision<Fields extends object>(source: Readonly<Node<Fields>>): number;
|
|
5
|
+
export declare function getNodeLocalBoundsRevision<Fields extends object>(source: Readonly<Node<Fields>>): number;
|
|
6
|
+
export declare function getNodeLocalContentRevision<Fields extends object>(source: Readonly<Node<Fields>>): number;
|
|
7
|
+
export declare function getNodeLocalTransformRevision<Fields extends object>(source: Readonly<Node<Fields>>): number;
|
|
8
|
+
export declare function getNodeParentReferenceRevision<Fields extends object>(source: Readonly<Node<Fields>>): number;
|
|
9
|
+
export declare function getNodeWorldTransformRevision<Fields extends object>(source: Readonly<Node<Fields>>): number;
|
|
10
10
|
/**
|
|
11
11
|
* Target node's rendered content changed — the general direct-mutation companion. After mutating a
|
|
12
12
|
* node's content fields in place (rather than through a setter), call this to invalidate the content
|
|
@@ -14,38 +14,38 @@ export declare function getNodeWorldTransformRevision<Traits extends object>(sou
|
|
|
14
14
|
* contract for any node kind. Setters keep their own precise per-field invalidation; this is the
|
|
15
15
|
* broad companion, not a replacement for them. Never touches the transform.
|
|
16
16
|
*/
|
|
17
|
-
export declare function invalidateContent<
|
|
18
|
-
export declare function invalidateNode<
|
|
17
|
+
export declare function invalidateContent<Fields extends object>(target: Node<Fields>): void;
|
|
18
|
+
export declare function invalidateNode<Fields extends object>(target: Node<Fields>): void;
|
|
19
19
|
/**
|
|
20
20
|
* Target object's appearance changed (excluding transforms).
|
|
21
21
|
*/
|
|
22
|
-
export declare function invalidateNodeAppearance<
|
|
22
|
+
export declare function invalidateNodeAppearance<Fields extends object>(target: Node<Fields>): void;
|
|
23
23
|
/**
|
|
24
24
|
* Target object's own dimensions (not including children) changed.
|
|
25
25
|
*/
|
|
26
|
-
export declare function invalidateNodeLocalBounds<
|
|
26
|
+
export declare function invalidateNodeLocalBounds<Fields extends object>(target: Node<Fields>): void;
|
|
27
27
|
/**
|
|
28
28
|
* Target object's own drawable surface changed (the rasterizable payload — shape commands, text,
|
|
29
29
|
* pixels — not its children and not how it is composited). Renderers re-rasterize on this; the walk
|
|
30
30
|
* and render caches re-examine the node. Distinct from appearance (compositing) and bounds (extent).
|
|
31
31
|
*/
|
|
32
|
-
export declare function invalidateNodeLocalContent<
|
|
32
|
+
export declare function invalidateNodeLocalContent<Fields extends object>(target: Node<Fields>): void;
|
|
33
33
|
/**
|
|
34
34
|
* Target object's own transform (x, y, rotation, scaleX, scaleY, skewX, skewY, or pivot) changed.
|
|
35
35
|
*/
|
|
36
|
-
export declare function invalidateNodeLocalTransform<
|
|
36
|
+
export declare function invalidateNodeLocalTransform<Fields extends object>(target: Node<Fields>): void;
|
|
37
37
|
/**
|
|
38
38
|
* Target object's parent changed.
|
|
39
39
|
*/
|
|
40
|
-
export declare function invalidateNodeParentReference<
|
|
40
|
+
export declare function invalidateNodeParentReference<Fields extends object>(target: Node<Fields>): void;
|
|
41
41
|
/**
|
|
42
42
|
* Target object's visual output changed (appearance or local transform).
|
|
43
43
|
* Use this when animating properties like alpha, x, y, scaleX, scaleY, rotation.
|
|
44
44
|
*/
|
|
45
|
-
export declare function invalidateNodeRender<
|
|
45
|
+
export declare function invalidateNodeRender<Fields extends object>(target: Node<Fields>): void;
|
|
46
46
|
/**
|
|
47
47
|
* Target object's child bounds have changed. Invalidates the target and every ancestor whose
|
|
48
48
|
* aggregate world bounds include it.
|
|
49
49
|
*/
|
|
50
|
-
export declare function invalidateNodeWorldBounds<
|
|
50
|
+
export declare function invalidateNodeWorldBounds<Fields extends object>(target: Node<Fields>): void;
|
|
51
51
|
//# sourceMappingURL=revision.d.ts.map
|
package/dist/revision.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"revision.d.ts","sourceRoot":"","sources":["../src/revision.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"revision.d.ts","sourceRoot":"","sources":["../src/revision.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAalE,wBAAgB,iCAAiC,CAAC,MAAM,SAAS,MAAM,EACrE,OAAO,EAAE,WAAW,CAAC,MAAM,CAAC,EAC5B,aAAa,CAAC,EAAE,QAAQ,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,EAC7C,WAAW,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,GAChC,IAAI,CASN;AAED,wBAAgB,yBAAyB,CAAC,MAAM,SAAS,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,MAAM,CAEvG;AAED,wBAAgB,uBAAuB,CAAC,MAAM,SAAS,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,MAAM,CAErG;AAED,wBAAgB,0BAA0B,CAAC,MAAM,SAAS,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,MAAM,CAExG;AAED,wBAAgB,2BAA2B,CAAC,MAAM,SAAS,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,MAAM,CAEzG;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oBAAoB,CAAC,MAAM,SAAS,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,GAAG,IAAI,CAGtF;AAED;;;GAGG;AACH,wBAAgB,yBAAyB,CAAC,MAAM,SAAS,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,GAAG,IAAI,CAQ3F"}
|
package/dist/revision.js
CHANGED
|
@@ -1,18 +1,24 @@
|
|
|
1
|
-
import { getNodeRuntime } from './node';
|
|
1
|
+
import { getNodeRuntime } from './node.js';
|
|
2
2
|
// Records that the node's world transform was just recomputed. `worldTransformId` must change on every
|
|
3
3
|
// recompute so descendants gated on it re-resolve: a child stores its parent's `worldTransformId` and
|
|
4
4
|
// recomputes when it differs. A composite of (localTransformId, parentWorldTransformId) is NOT enough —
|
|
5
5
|
// it is lossy (an ancestor two-plus levels up changes a node's world matrix without changing the node's
|
|
6
6
|
// own composite id, since the ancestor's contribution does not survive into the low bits), so the change
|
|
7
7
|
// never reaches grandchildren. A fresh monotonic revision per recompute is unconditionally propagating.
|
|
8
|
-
|
|
8
|
+
//
|
|
9
|
+
// The revision is minted from the graph root's `worldTransformRevisionCounter`, so ids are unique within
|
|
10
|
+
// one graph and two graphs never share a counter. `rootRuntime` is the runtime of the node's root (the
|
|
11
|
+
// node itself when it has no parent); callers that already resolved it pass it to skip the parent walk.
|
|
12
|
+
export function computeNodeWorldTransformRevision(runtime, parentRuntime, rootRuntime) {
|
|
13
|
+
const root = rootRuntime ?? resolveNodeRootRuntime(runtime);
|
|
9
14
|
runtime.worldTransformUsingLocalTransformId = runtime.localTransformId;
|
|
10
15
|
runtime.worldTransformUsingParentTransformId = parentRuntime ? parentRuntime.worldTransformId : 0;
|
|
11
|
-
|
|
16
|
+
let revision = (root.worldTransformRevisionCounter + 1) >>> 0;
|
|
12
17
|
// 0 is the fresh-runtime sentinel (never a live revision), so step past a wrap back to 0.
|
|
13
|
-
if (
|
|
14
|
-
|
|
15
|
-
|
|
18
|
+
if (revision === 0)
|
|
19
|
+
revision = 1;
|
|
20
|
+
root.worldTransformRevisionCounter = revision;
|
|
21
|
+
runtime.worldTransformId = revision;
|
|
16
22
|
}
|
|
17
23
|
export function getNodeAppearanceRevision(source) {
|
|
18
24
|
return getNodeRuntime(source).appearanceId;
|
|
@@ -113,7 +119,10 @@ export function invalidateNodeWorldBounds(target) {
|
|
|
113
119
|
current = runtime.parent;
|
|
114
120
|
}
|
|
115
121
|
}
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
122
|
+
function resolveNodeRootRuntime(runtime) {
|
|
123
|
+
let current = runtime;
|
|
124
|
+
while (current.parent !== null)
|
|
125
|
+
current = getNodeRuntime(current.parent);
|
|
126
|
+
return current;
|
|
127
|
+
}
|
|
119
128
|
//# sourceMappingURL=revision.js.map
|
package/dist/revision.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"revision.js","sourceRoot":"","sources":["../src/revision.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"revision.js","sourceRoot":"","sources":["../src/revision.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAE3C,uGAAuG;AACvG,sGAAsG;AACtG,wGAAwG;AACxG,wGAAwG;AACxG,yGAAyG;AACzG,wGAAwG;AACxG,EAAE;AACF,yGAAyG;AACzG,uGAAuG;AACvG,wGAAwG;AACxG,MAAM,UAAU,iCAAiC,CAC/C,OAA4B,EAC5B,aAA6C,EAC7C,WAAiC;IAEjC,MAAM,IAAI,GAAG,WAAW,IAAI,sBAAsB,CAAC,OAAO,CAAC,CAAC;IAC5D,OAAO,CAAC,mCAAmC,GAAG,OAAO,CAAC,gBAAgB,CAAC;IACvE,OAAO,CAAC,oCAAoC,GAAG,aAAa,CAAC,CAAC,CAAC,aAAa,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC;IAClG,IAAI,QAAQ,GAAG,CAAC,IAAI,CAAC,6BAA6B,GAAG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AAO,CAAC,oCAAoC,GAAG,CAAC,CAAC,CAAC;AACpD,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,oBAAoB,CAAwB,MAAoB;IAC9E,wBAAwB,CAAC,MAAM,CAAC,CAAC;IACjC,4BAA4B,CAAC,MAAM,CAAC,CAAC;AACvC,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,yBAAyB,CAAwB,MAAoB;IACnF,IAAI,OAAO,GAAwB,MAAM,CAAC;IAC1C,OAAO,OAAO,KAAK,IAAI,EAAE,CAAC;QACxB,MAAM,OAAO,GAAG,cAAc,CAAC,OAAO,CAAwB,CAAC;QAC/D,OAAO,CAAC,gCAAgC,GAAG,CAAC,CAAC,CAAC;QAC9C,OAAO,CAAC,6BAA6B,GAAG,CAAC,CAAC,CAAC;QAC3C,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC;IAC3B,CAAC;AACH,CAAC;AAED,SAAS,sBAAsB,CAAwB,OAA4B;IACjF,IAAI,OAAO,GAAG,OAAO,CAAC;IACtB,OAAO,OAAO,CAAC,MAAM,KAAK,IAAI;QAAE,OAAO,GAAG,cAAc,CAAC,OAAO,CAAC,MAAM,CAAwB,CAAC;IAChG,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
package/dist/stageFit.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import type { MatrixLike
|
|
1
|
+
import type { MatrixLike } from '@flighthq/geometry/contract';
|
|
2
|
+
import type { ViewportAlign } from '@flighthq/layout/contract';
|
|
3
|
+
import type { NodeFields, Scene2DFitContext } from './contract.node-types.ts';
|
|
2
4
|
export declare function computeScene2DFitAlignX(scaledContentWidth: number, viewWidth: number, align: ViewportAlign): number;
|
|
3
5
|
export declare function computeScene2DFitAlignY(scaledContentHeight: number, viewHeight: number, align: ViewportAlign): number;
|
|
4
6
|
export declare function computeScene2DFitFillScale(contentWidth: number, contentHeight: number, viewWidth: number, viewHeight: number): number;
|
|
5
7
|
export declare function computeScene2DFitScale(contentWidth: number, contentHeight: number, viewWidth: number, viewHeight: number): number;
|
|
6
|
-
export declare function computeScene2DFitTransform<
|
|
8
|
+
export declare function computeScene2DFitTransform<Fields extends object = NodeFields>(out: MatrixLike, scene2d: Readonly<Scene2DFitContext<Fields>>, viewWidth: number, viewHeight: number): void;
|
|
7
9
|
//# sourceMappingURL=stageFit.d.ts.map
|
package/dist/stageFit.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stageFit.d.ts","sourceRoot":"","sources":["../src/stageFit.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"stageFit.d.ts","sourceRoot":"","sources":["../src/stageFit.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAa,MAAM,6BAA6B,CAAC;AACzE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE/D,OAAO,KAAK,EAAyC,UAAU,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAOrH,wBAAgB,uBAAuB,CAAC,kBAAkB,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,aAAa,GAAG,MAAM,CAInH;AAGD,wBAAgB,uBAAuB,CAAC,mBAAmB,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,aAAa,GAAG,MAAM,CAIrH;AAGD,wBAAgB,0BAA0B,CACxC,YAAY,EAAE,MAAM,EACpB,aAAa,EAAE,MAAM,EACrB,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,GACjB,MAAM,CAER;AAGD,wBAAgB,sBAAsB,CACpC,YAAY,EAAE,MAAM,EACpB,aAAa,EAAE,MAAM,EACrB,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,GACjB,MAAM,CAER;AAMD,wBAAgB,0BAA0B,CAAC,MAAM,SAAS,MAAM,GAAG,UAAU,EAC3E,GAAG,EAAE,UAAU,EACf,OAAO,EAAE,QAAQ,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC,EAC5C,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,GACjB,IAAI,CAmDN"}
|
package/dist/stageFit.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRectangle } from '@flighthq/geometry/contract';
|
|
2
|
-
import { getNodeRuntime } from './node';
|
|
2
|
+
import { getNodeRuntime } from './node.js';
|
|
3
3
|
// The structural fit context these functions read: a root node plus how it maps into the view. `Scene2D`
|
|
4
4
|
// satisfies it (its `align`/`scaleMode`/`root` fields); kept structural and generic so the fit math stays in
|
|
5
5
|
// `@flighthq/node` without depending on the display-object `Scene2D` type.
|
package/dist/stageFit.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stageFit.js","sourceRoot":"","sources":["../src/stageFit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"stageFit.js","sourceRoot":"","sources":["../src/stageFit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAK9D,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAE3C,yGAAyG;AACzG,6GAA6G;AAC7G,2EAA2E;AAC3E,yFAAyF;AACzF,MAAM,UAAU,uBAAuB,CAAC,kBAA0B,EAAE,SAAiB,EAAE,KAAoB;IACzG,IAAI,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC;QAAE,OAAO,CAAC,CAAC;IACrC,IAAI,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC;QAAE,OAAO,SAAS,GAAG,kBAAkB,CAAC;IACnE,OAAO,CAAC,SAAS,GAAG,kBAAkB,CAAC,GAAG,CAAC,CAAC;AAC9C,CAAC;AAED,uFAAuF;AACvF,MAAM,UAAU,uBAAuB,CAAC,mBAA2B,EAAE,UAAkB,EAAE,KA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AC,CAAC;IAC3F,CAAC;IAED,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC;IACX,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;IACV,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;IACV,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC;IACX,GAAG,CAAC,EAAE,GAAG,uBAAuB,CAAC,YAAY,GAAG,EAAE,EAAE,SAAS,EAAE,OAAO,CAAC,KAAK,CAAC,GAAG,QAAQ,GAAG,EAAE,CAAC;IAC9F,GAAG,CAAC,EAAE,GAAG,uBAAuB,CAAC,aAAa,GAAG,EAAE,EAAE,UAAU,EAAE,OAAO,CAAC,KAAK,CAAC,GAAG,QAAQ,GAAG,EAAE,CAAC;AAClG,CAAC;AAED,MAAM,cAAc,GAAc,eAAe,EAAE,CAAC"}
|
package/dist/traversal.d.ts
CHANGED
|
@@ -1,53 +1,53 @@
|
|
|
1
|
-
import type { Node, NodeDescendantVisitor, NodeOf,
|
|
1
|
+
import type { Node, NodeDescendantVisitor, NodeOf, NodeFields } from './contract.node-types.ts';
|
|
2
2
|
/**
|
|
3
3
|
* Finds the first descendant of `source` (depth-first pre-order) that satisfies `predicate`.
|
|
4
4
|
* Returns `null` if no descendant matches. When `predicate` is a type guard, the result is
|
|
5
5
|
* narrowed to the guarded type, so `findNode(root, isMesh)` returns `Mesh | null` with no cast.
|
|
6
6
|
*/
|
|
7
|
-
export declare function findNode<
|
|
8
|
-
export declare function findNode<
|
|
7
|
+
export declare function findNode<Fields extends object, Result extends Node<Fields>>(source: Readonly<Node<Fields>>, predicate: (node: Node<Fields>) => node is Result): Result | null;
|
|
8
|
+
export declare function findNode<Fields extends object = NodeFields>(source: Readonly<Node<Fields>>, predicate: (node: Node<Fields>) => boolean): NodeOf<Fields> | null;
|
|
9
9
|
/**
|
|
10
10
|
* Finds the first descendant of `source` (depth-first pre-order) with the given `name`. Searches
|
|
11
11
|
* the full subtree recursively, unlike `getNodeChildByName` which only checks direct children.
|
|
12
12
|
* Returns `null` if no descendant matches.
|
|
13
13
|
*/
|
|
14
|
-
export declare function findNodeByName<
|
|
14
|
+
export declare function findNodeByName<Fields extends object = NodeFields>(source: Readonly<Node<Fields>>, name: string): NodeOf<Fields> | null;
|
|
15
15
|
/**
|
|
16
16
|
* Walks upward from `source` toward the root, calling `callback` for each ancestor. If `callback`
|
|
17
17
|
* returns `false`, the walk stops early. The source node itself is not visited.
|
|
18
18
|
*/
|
|
19
|
-
export declare function forEachNodeAncestor<
|
|
19
|
+
export declare function forEachNodeAncestor<Fields extends object = NodeFields>(source: Readonly<Node<Fields>>, callback: (node: Node<Fields>) => boolean | void): void;
|
|
20
20
|
/**
|
|
21
21
|
* Calls `callback` for every descendant of `source` in depth-first pre-order. Unlike
|
|
22
22
|
* `walkNodeDescendants`, this variant never stops early — every descendant is visited regardless
|
|
23
23
|
* of the callback's return value.
|
|
24
24
|
*/
|
|
25
|
-
export declare function forEachNodeDescendant<
|
|
25
|
+
export declare function forEachNodeDescendant<Fields extends object = NodeFields>(source: Readonly<Node<Fields>>, callback: (node: Node<Fields>) => void): void;
|
|
26
26
|
/**
|
|
27
27
|
* Returns a read-only snapshot of the direct children of `source`. Returns an empty array if the
|
|
28
28
|
* node has no children. The returned array is a copy and safe to iterate while the graph mutates.
|
|
29
29
|
*/
|
|
30
|
-
export declare function getNodeChildren<
|
|
30
|
+
export declare function getNodeChildren<Fields extends object = NodeFields>(source: Readonly<Node<Fields>>): readonly NodeOf<Fields>[];
|
|
31
31
|
/**
|
|
32
32
|
* Returns the depth of `source` in the tree: 0 for a root node (no parent), 1 for a direct child
|
|
33
33
|
* of the root, and so on.
|
|
34
34
|
*/
|
|
35
|
-
export declare function getNodeDepth<
|
|
35
|
+
export declare function getNodeDepth<Fields extends object = NodeFields>(source: Readonly<Node<Fields>>): number;
|
|
36
36
|
/**
|
|
37
37
|
* Returns the next sibling of `source` (the child immediately after it in its parent's children
|
|
38
38
|
* array), or `null` if `source` is the last child or has no parent.
|
|
39
39
|
*/
|
|
40
|
-
export declare function getNodeNextSibling<
|
|
40
|
+
export declare function getNodeNextSibling<Fields extends object = NodeFields>(source: Readonly<Node<Fields>>): NodeOf<Fields> | null;
|
|
41
41
|
/**
|
|
42
42
|
* Returns the previous sibling of `source` (the child immediately before it in its parent's
|
|
43
43
|
* children array), or `null` if `source` is the first child or has no parent.
|
|
44
44
|
*/
|
|
45
|
-
export declare function getNodePreviousSibling<
|
|
45
|
+
export declare function getNodePreviousSibling<Fields extends object = NodeFields>(source: Readonly<Node<Fields>>): NodeOf<Fields> | null;
|
|
46
46
|
/**
|
|
47
47
|
* Walks the descendants of `source` in depth-first pre-order, calling `visit` for each node.
|
|
48
48
|
* If `visit` returns `false`, the walk stops early (neither the current node's subtree nor any
|
|
49
49
|
* remaining siblings are visited). Returns `true` if the walk completed without early termination,
|
|
50
50
|
* `false` if it was cut short.
|
|
51
51
|
*/
|
|
52
|
-
export declare function walkNodeDescendants<
|
|
52
|
+
export declare function walkNodeDescendants<Fields extends object = NodeFields>(source: Readonly<Node<Fields>>, visit: NodeDescendantVisitor<Fields>): boolean;
|
|
53
53
|
//# sourceMappingURL=traversal.d.ts.map
|
package/dist/traversal.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"traversal.d.ts","sourceRoot":"","sources":["../src/traversal.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,qBAAqB,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"traversal.d.ts","sourceRoot":"","sources":["../src/traversal.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,qBAAqB,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAIhG;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,MAAM,SAAS,MAAM,EAAE,MAAM,SAAS,IAAI,CAAC,MAAM,CAAC,EACzE,MAA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AC,MAAM,CAAC,EAAE,CAI3B;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,MAAM,SAAS,MAAM,GAAG,UAAU,EAAE,MAAM,EAAE,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,MAAM,CAQvG;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,SAAS,MAAM,GAAG,UAAU,EACnE,MAAM,EAAE,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,GAC7B,MAAM,CAAC,MAAM,CAAC,GAAG,IAAI,CASvB;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,SAAS,MAAM,GAAG,UAAU,EACvE,MAAM,EAAE,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,GAC7B,MAAM,CAAC,MAAM,CAAC,GAAG,IAAI,CASvB;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,SAAS,MAAM,GAAG,UAAU,EACpE,MAAM,EAAE,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,EAC9B,KAAK,EAAE,qBAAqB,CAAC,MAAM,CAAC,GACnC,OAAO,CAST"}
|
package/dist/traversal.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { getNodeParent } from './hierarchy';
|
|
2
|
-
import { getNodeRuntime } from './node';
|
|
1
|
+
import { getNodeParent } from './hierarchy.js';
|
|
2
|
+
import { getNodeRuntime } from './node.js';
|
|
3
3
|
export function findNode(source, predicate) {
|
|
4
4
|
const children = getNodeRuntime(source).children;
|
|
5
5
|
if (children === null)
|
package/dist/traversal.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"traversal.js","sourceRoot":"","sources":["../src/traversal.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"traversal.js","sourceRoot":"","sources":["../src/traversal.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,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IAAI,CAAC;AACd,CAAC;AAED,MAAM,cAAc,GAAqB,EAAE,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export declare enum AppearanceFlags {
|
|
2
|
+
None = 0,
|
|
3
|
+
Visible = 1,
|
|
4
|
+
Alpha = 2,
|
|
5
|
+
BlendMode = 4,
|
|
6
|
+
Clip = 8,
|
|
7
|
+
Any = -2147483648
|
|
8
|
+
}
|
|
9
|
+
export declare namespace AppearanceFlags {
|
|
10
|
+
/**
|
|
11
|
+
* Returns true if any test flags are set
|
|
12
|
+
*/
|
|
13
|
+
function any(flags: AppearanceFlags, test: AppearanceFlags): boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Returns true if all test flags are set
|
|
16
|
+
*/
|
|
17
|
+
function has(flags: AppearanceFlags, test: AppearanceFlags): boolean;
|
|
18
|
+
function add(flags: AppearanceFlags, add: AppearanceFlags): AppearanceFlags;
|
|
19
|
+
function remove(flags: AppearanceFlags, remove: AppearanceFlags): AppearanceFlags;
|
|
20
|
+
function clear(): AppearanceFlags;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=AppearanceFlags.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AppearanceFlags.d.ts","sourceRoot":"","sources":["../../src/types/AppearanceFlags.ts"],"names":[],"mappings":"AAAA,oBAAY,eAAe;IACzB,IAAI,IAAI;IACR,OAAO,IAAS;IAChB,KAAK,IAAS;IACd,SAAS,IAAS;IAClB,IAAI,IAAS;IAEb,GAAG,cAAU;CACd;AAED,yBAAiB,eAAe,CAAC;IAC/B;;OAEG;IACH,SAAgB,GAAG,CAAC,KAAK,EAAE,eAAe,EAAE,IAAI,EAAE,eAAe,GAAG,OAAO,CAE1E;IAED;;OAEG;IACH,SAAgB,GAAG,CAAC,KAAK,EAAE,eAAe,EAAE,IAAI,EAAE,eAAe,GAAG,OAAO,CAE1E;IAED,SAAgB,GAAG,CAAC,KAAK,EAAE,eAAe,EAAE,GAAG,EAAE,eAAe,GAAG,eAAe,CAEjF;IAED,SAAgB,MAAM,CAAC,KAAK,EAAE,eAAe,EAAE,MAAM,EAAE,eAAe,GAAG,eAAe,CAEvF;IAED,SAAgB,KAAK,IAAI,eAAe,CAEvC;CACF"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export var AppearanceFlags;
|
|
2
|
+
(function (AppearanceFlags) {
|
|
3
|
+
AppearanceFlags[AppearanceFlags["None"] = 0] = "None";
|
|
4
|
+
AppearanceFlags[AppearanceFlags["Visible"] = 1] = "Visible";
|
|
5
|
+
AppearanceFlags[AppearanceFlags["Alpha"] = 2] = "Alpha";
|
|
6
|
+
AppearanceFlags[AppearanceFlags["BlendMode"] = 4] = "BlendMode";
|
|
7
|
+
AppearanceFlags[AppearanceFlags["Clip"] = 8] = "Clip";
|
|
8
|
+
AppearanceFlags[AppearanceFlags["Any"] = -2147483648] = "Any";
|
|
9
|
+
})(AppearanceFlags || (AppearanceFlags = {}));
|
|
10
|
+
(function (AppearanceFlags) {
|
|
11
|
+
/**
|
|
12
|
+
* Returns true if any test flags are set
|
|
13
|
+
*/
|
|
14
|
+
function any(flags, test) {
|
|
15
|
+
return (flags & test) !== 0;
|
|
16
|
+
}
|
|
17
|
+
AppearanceFlags.any = any;
|
|
18
|
+
/**
|
|
19
|
+
* Returns true if all test flags are set
|
|
20
|
+
*/
|
|
21
|
+
function has(flags, test) {
|
|
22
|
+
return (flags & test) === test;
|
|
23
|
+
}
|
|
24
|
+
AppearanceFlags.has = has;
|
|
25
|
+
function add(flags, add) {
|
|
26
|
+
return flags | add;
|
|
27
|
+
}
|
|
28
|
+
AppearanceFlags.add = add;
|
|
29
|
+
function remove(flags, remove) {
|
|
30
|
+
return flags & ~remove;
|
|
31
|
+
}
|
|
32
|
+
AppearanceFlags.remove = remove;
|
|
33
|
+
function clear() {
|
|
34
|
+
return AppearanceFlags.None;
|
|
35
|
+
}
|
|
36
|
+
AppearanceFlags.clear = clear;
|
|
37
|
+
})(AppearanceFlags || (AppearanceFlags = {}));
|
|
38
|
+
//# sourceMappingURL=AppearanceFlags.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AppearanceFlags.js","sourceRoot":"","sources":["../../src/types/AppearanceFlags.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,eAQX;AARD,WAAY,eAAe;IACzB,qDAAQ,CAAA;IACR,2DAAgB,CAAA;IAChB,uDAAc,CAAA;IACd,+DAAkB,CAAA;IAClB,qDAAa,CAAA;IAEb,6DAAa,CAAA;AACf,CAAC,EARW,eAAe,KAAf,eAAe,QAQ1B;AAED,WAAiB,eAAe;IAC9B;;OAEG;IACH,SAAgB,GAAG,CAAC,KAAsB,EAAE,IAAqB;QAC/D,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC;IAC9B,CAAC;IAFe,gBAAA,GAAG,MAElB,CAAA;IAED;;OAEG;IACH,SAAgB,GAAG,CAAC,KAAsB,EAAE,IAAqB;QAC/D,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,IAAI,CAAC;IACjC,CAAC;IAFe,gBAAA,GAAG,MAElB,CAAA;IAED,SAAgB,GAAG,CAAC,KAAsB,EAAE,GAAoB;QAC9D,OAAO,KAAK,GAAG,GAAG,CAAC;IACrB,CAAC;IAFe,gBAAA,GAAG,MAElB,CAAA;IAED,SAAgB,MAAM,CAAC,KAAsB,EAAE,MAAuB;QACpE,OAAO,KAAK,GAAG,CAAC,MAAM,CAAC;IACzB,CAAC;IAFe,gBAAA,MAAM,SAErB,CAAA;IAED,SAAgB,KAAK;QACnB,OAAO,eAAe,CAAC,IAAI,CAAC;IAC9B,CAAC;IAFe,gBAAA,KAAK,QAEpB,CAAA;AACH,CAAC,EA1BgB,eAAe,KAAf,eAAe,QA0B/B"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { EntityRuntime } from '@flighthq/entity/contract';
|
|
2
|
+
import type { NodeOf, NodeFields } from './Node.ts';
|
|
3
|
+
export interface HasAppearance {
|
|
4
|
+
alpha: number;
|
|
5
|
+
visible: boolean;
|
|
6
|
+
}
|
|
7
|
+
export interface HasAppearanceRuntime extends EntityRuntime {
|
|
8
|
+
worldAlpha: number | null;
|
|
9
|
+
worldAlphaUsingAppearanceId: number;
|
|
10
|
+
worldAlphaUsingParentAppearanceId: number;
|
|
11
|
+
worldAppearanceId: number;
|
|
12
|
+
}
|
|
13
|
+
export type AppearanceNode<Fields extends object = NodeFields> = NodeOf<Fields> & HasAppearance;
|
|
14
|
+
//# sourceMappingURL=HasAppearance.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HasAppearance.d.ts","sourceRoot":"","sources":["../../src/types/HasAppearance.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE/D,OAAO,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAMpD,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,OAAO,CAAC;CAClB;AAOD,MAAM,WAAW,oBAAqB,SAAQ,aAAa;IACzD,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,2BAA2B,EAAE,MAAM,CAAC;IACpC,iCAAiC,EAAE,MAAM,CAAC;IAC1C,iBAAiB,EAAE,MAAM,CAAC;CAC3B;AAED,MAAM,MAAM,cAAc,CAAC,MAAM,SAAS,MAAM,GAAG,UAAU,IAAI,MAAM,CAAC,MAAM,CAAC,GAAG,aAAa,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HasAppearance.js","sourceRoot":"","sources":["../../src/types/HasAppearance.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { BlendMode } from '@flighthq/materials/contract';
|
|
2
|
+
import type { NodeOf, NodeFields } from './Node.ts';
|
|
3
|
+
export interface HasBlendMode {
|
|
4
|
+
blendMode: BlendMode | null;
|
|
5
|
+
}
|
|
6
|
+
export type BlendModeNode<Fields extends object = NodeFields> = NodeOf<Fields> & HasBlendMode;
|
|
7
|
+
//# sourceMappingURL=HasBlendMode.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HasBlendMode.d.ts","sourceRoot":"","sources":["../../src/types/HasBlendMode.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAE9D,OAAO,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAMpD,MAAM,WAAW,YAAY;IAC3B,SAAS,EAAE,SAAS,GAAG,IAAI,CAAC;CAC7B;AAED,MAAM,MAAM,aAAa,CAAC,MAAM,SAAS,MAAM,GAAG,UAAU,IAAI,MAAM,CAAC,MAAM,CAAC,GAAG,YAAY,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HasBlendMode.js","sourceRoot":"","sources":["../../src/types/HasBlendMode.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { EntityRaw, EntityRuntime } from '@flighthq/entity/contract';
|
|
2
|
+
import type { Rectangle } from '@flighthq/geometry/contract';
|
|
3
|
+
import type { HasTransform2D } from './HasTransform2D.ts';
|
|
4
|
+
import type { NodeAny, NodeOf, NodeFields } from './Node.ts';
|
|
5
|
+
export interface HasBoundsRectangle extends EntityRaw {
|
|
6
|
+
}
|
|
7
|
+
export interface HasBoundsRectangleRuntime<Fields extends object = NodeFields> extends EntityRuntime {
|
|
8
|
+
boundsRectangle: Rectangle | null;
|
|
9
|
+
computeLocalBoundsRectangle: (out: Rectangle, source: Readonly<BoundsNode<Fields>>) => void;
|
|
10
|
+
isLocalBoundsRectangleValid: ((source: Readonly<BoundsNode<Fields>>) => boolean) | null;
|
|
11
|
+
localBoundsRectangle: Rectangle | null;
|
|
12
|
+
worldBoundsRectangle: Rectangle | null;
|
|
13
|
+
}
|
|
14
|
+
export type BoundsNode<Fields extends object = NodeFields> = NodeOf<Fields> & HasBoundsRectangle;
|
|
15
|
+
export type BoundsNodeAny = NodeAny & HasBoundsRectangle;
|
|
16
|
+
export type Spatial2DNode<Fields extends object = NodeFields> = NodeOf<Fields> & HasBoundsRectangle & HasTransform2D;
|
|
17
|
+
//# sourceMappingURL=HasBoundsRectangle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HasBoundsRectangle.d.ts","sourceRoot":"","sources":["../../src/types/HasBoundsRectangle.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAE7D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAE7D,MAAM,WAAW,kBAAmB,SAAQ,SAAS;CAAG;AAMxD,MAAM,WAAW,yBAAyB,CAAC,MAAM,SAAS,MAAM,GAAG,UAAU,CAAE,SAAQ,aAAa;IAClG,eAAe,EAAE,SAAS,GAAG,IAAI,CAAC;IAClC,2BAA2B,EAAE,CAAC,GAAG,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,KAAK,IAAI,CAAC;IAI5F,2BAA2B,EAAE,CAAC,CAAC,MAAM,EAAE,QAAQ,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,KAAK,OAAO,CAAC,GAAG,IAAI,CAAC;IACxF,oBAAoB,EAAE,SAAS,GAAG,IAAI,CAAC;IACvC,oBAAoB,EAAE,SAAS,GAAG,IAAI,CAAC;CACxC;AAED,MAAM,MAAM,UAAU,CAAC,MAAM,SAAS,MAAM,GAAG,UAAU,IAAI,MAAM,CAAC,MAAM,CAAC,GAAG,kBAAkB,CAAC;AACjG,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,kBAAkB,CAAC;AAEzD,MAAM,MAAM,aAAa,CAAC,MAAM,SAAS,MAAM,GAAG,UAAU,IAAI,MAAM,CAAC,MAAM,CAAC,GAAG,kBAAkB,GAAG,cAAc,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HasBoundsRectangle.js","sourceRoot":"","sources":["../../src/types/HasBoundsRectangle.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ClipRegion } from '@flighthq/clip/contract';
|
|
2
|
+
import type { EntityRaw, EntityRuntime, EntityRuntimeKey } from '@flighthq/entity/contract';
|
|
3
|
+
import type { NodeOf, NodeFields } from './Node.ts';
|
|
4
|
+
export interface HasClip extends EntityRaw {
|
|
5
|
+
[EntityRuntimeKey]: EntityRuntime | undefined;
|
|
6
|
+
/**
|
|
7
|
+
* Geometric clip applied to this node and its subtree, or null for no clipping. A rectangle clip is
|
|
8
|
+
* realized as a scissor; an arbitrary path clip as stencil-then-cover. See `ClipRegion`. Build one
|
|
9
|
+
* with the `createClipRegionFrom*` producers in `@flighthq/clip`.
|
|
10
|
+
*/
|
|
11
|
+
clip: ClipRegion | null;
|
|
12
|
+
}
|
|
13
|
+
export type ClipNode<Fields extends object = NodeFields> = NodeOf<Fields> & HasClip;
|
|
14
|
+
//# sourceMappingURL=HasClip.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HasClip.d.ts","sourceRoot":"","sources":["../../src/types/HasClip.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAE5F,OAAO,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAEpD,MAAM,WAAW,OAAQ,SAAQ,SAAS;IACxC,CAAC,gBAAgB,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC;IAC9C;;;;OAIG;IACH,IAAI,EAAE,UAAU,GAAG,IAAI,CAAC;CACzB;AAED,MAAM,MAAM,QAAQ,CAAC,MAAM,SAAS,MAAM,GAAG,UAAU,IAAI,MAAM,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HasClip.js","sourceRoot":"","sources":["../../src/types/HasClip.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ColorScaleBias } from '@flighthq/adjustments/contract';
|
|
2
|
+
import type { NodeOf, NodeFields } from './Node.ts';
|
|
3
|
+
export interface HasColorScaleBias {
|
|
4
|
+
colorScaleBias: ColorScaleBias | null;
|
|
5
|
+
}
|
|
6
|
+
export type ColorScaleBiasNode<Fields extends object = NodeFields> = NodeOf<Fields> & HasColorScaleBias;
|
|
7
|
+
//# sourceMappingURL=HasColorScaleBias.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HasColorScaleBias.d.ts","sourceRoot":"","sources":["../../src/types/HasColorScaleBias.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAErE,OAAO,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AASpD,MAAM,WAAW,iBAAiB;IAChC,cAAc,EAAE,cAAc,GAAG,IAAI,CAAC;CACvC;AAED,MAAM,MAAM,kBAAkB,CAAC,MAAM,SAAS,MAAM,GAAG,UAAU,IAAI,MAAM,CAAC,MAAM,CAAC,GAAG,iBAAiB,CAAC"}
|