@haiyue/extensions 0.1.0 → 0.2.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 +25 -0
- package/dist/animation/Animation2DComponent.d.ts +18 -0
- package/dist/animation/Animation2DExtensionRegistry.d.ts +7 -0
- package/dist/animation/Animation2DRenderSystem.d.ts +6 -0
- package/dist/animation/Animation2DRuntime.d.ts +6 -2
- package/dist/animation/AnimationTextRasterizer.d.ts +4 -0
- package/dist/animation/AnimationVisual2D.d.ts +58 -2
- package/dist/animation/interaction/InteractionRuntime.d.ts +83 -0
- package/dist/animation/interaction/runtime-types.d.ts +257 -0
- package/dist/animation.d.ts +3 -1
- package/dist/animation.js +551 -59
- package/dist/animation3d.js +1 -1
- package/dist/canvas-text.js +1 -1
- package/dist/chunks/2d-ui-animation-2d.generated-FpziAeGJ.js +4 -0
- package/dist/chunks/2d-ui-indexed-sprite.generated-DmKR0CC3.js +4 -0
- package/dist/chunks/Animation2DStateMachine-BHcA6Cu3.js +18212 -0
- package/dist/chunks/{AnimationStateMachineController-BIcAh-sT.js → AnimationStateMachineController-4sKaqh9E.js} +2 -2
- package/dist/chunks/AnimationVisual2D-8y3qp0_U.js +230 -0
- package/dist/chunks/{RenderSystem2DBase-DDT61dAu.js → RenderSystem2DBase-CF2s00vg.js} +2 -2
- package/dist/controls/VirtualJoystickControls.d.ts +46 -0
- package/dist/controls/contracts.d.ts +91 -0
- package/dist/controls.d.ts +2 -0
- package/dist/controls.js +358 -0
- package/dist/deformable-animation/runtime/DeformableMesh2DRuntimeExtension.d.ts +11 -0
- package/dist/deformable-animation/runtime/DeformableMesh2DSampler.d.ts +11 -0
- package/dist/deformable-animation.d.ts +5 -0
- package/dist/deformable-animation.js +316 -0
- package/dist/experimental-indexed-sprite.d.ts +5 -0
- package/dist/experimental-indexed-sprite.js +482 -0
- package/dist/gltf-worker-runtime.js +9 -9
- package/dist/hya-state-machine.js +3 -2
- package/dist/index.js +1 -1
- package/dist/indexed-sprite/AtlasLayout.d.ts +2 -0
- package/dist/indexed-sprite/IndexedSpriteRenderer.d.ts +23 -0
- package/dist/indexed-sprite/contracts.d.ts +89 -0
- package/dist/internal/2d-ui-shader-artifact.js +232 -23
- package/dist/ray-tracing/acceleration/bvh.d.ts +37 -0
- package/dist/ray-tracing/acceleration/index.d.ts +6 -0
- package/dist/ray-tracing/acceleration/pack.d.ts +152 -0
- package/dist/ray-tracing/acceleration/query.d.ts +4 -0
- package/dist/ray-tracing/acceleration/runtime.d.ts +30 -0
- package/dist/ray-tracing/acceleration/tlas.d.ts +4 -0
- package/dist/ray-tracing/acceleration/types.d.ts +165 -0
- package/dist/ray-tracing/denoise/index.d.ts +3 -0
- package/dist/ray-tracing/denoise/layout.d.ts +9 -0
- package/dist/ray-tracing/denoise/runtime.d.ts +23 -0
- package/dist/ray-tracing/denoise/types.d.ts +28 -0
- package/dist/ray-tracing/hybrid/contract.d.ts +2 -0
- package/dist/ray-tracing/hybrid/index.d.ts +5 -0
- package/dist/ray-tracing/hybrid/layout.d.ts +17 -0
- package/dist/ray-tracing/hybrid/plan.d.ts +2 -0
- package/dist/ray-tracing/hybrid/runtime.d.ts +31 -0
- package/dist/ray-tracing/hybrid/shaders/hybrid-artifact.generated.d.ts +625 -0
- package/dist/ray-tracing/hybrid/types.d.ts +144 -0
- package/dist/ray-tracing/lifecycle/device-recovery.d.ts +31 -0
- package/dist/ray-tracing/lifecycle/index.d.ts +2 -0
- package/dist/ray-tracing/lifecycle/types.d.ts +37 -0
- package/dist/ray-tracing/material/index.d.ts +2 -0
- package/dist/ray-tracing/material/pack.d.ts +5 -0
- package/dist/ray-tracing/material/types.d.ts +63 -0
- package/dist/ray-tracing/reference/index.d.ts +122 -0
- package/dist/ray-tracing/renderer/index.d.ts +7 -0
- package/dist/ray-tracing/renderer/layout.d.ts +20 -0
- package/dist/ray-tracing/renderer/plan.d.ts +2 -0
- package/dist/ray-tracing/renderer/reference.d.ts +17 -0
- package/dist/ray-tracing/renderer/runtime.d.ts +39 -0
- package/dist/ray-tracing/renderer/scene.d.ts +4 -0
- package/dist/ray-tracing/renderer/types.d.ts +115 -0
- package/dist/ray-tracing/sampling/index.d.ts +8 -0
- package/dist/ray-tracing/sampling/layout.d.ts +12 -0
- package/dist/ray-tracing/sampling/plan.d.ts +5 -0
- package/dist/ray-tracing/sampling/revision.d.ts +15 -0
- package/dist/ray-tracing/sampling/runtime.d.ts +44 -0
- package/dist/ray-tracing/sampling/sequence.d.ts +2 -0
- package/dist/ray-tracing/sampling/types.d.ts +96 -0
- package/dist/ray-tracing/scene/index.d.ts +41 -0
- package/dist/ray-tracing/traversal/index.d.ts +4 -0
- package/dist/ray-tracing/traversal/layout.d.ts +16 -0
- package/dist/ray-tracing/traversal/plan.d.ts +2 -0
- package/dist/ray-tracing/traversal/runtime.d.ts +25 -0
- package/dist/ray-tracing/traversal/types.d.ts +79 -0
- package/dist/ray-tracing/worker/client.d.ts +25 -0
- package/dist/ray-tracing/worker/index.d.ts +5 -0
- package/dist/ray-tracing/worker/runtime.d.ts +11 -0
- package/dist/ray-tracing/worker/serialization.d.ts +16 -0
- package/dist/ray-tracing/worker/source.d.ts +1 -0
- package/dist/ray-tracing/worker/types.d.ts +91 -0
- package/dist/ray-tracing.d.ts +17 -0
- package/dist/ray-tracing.js +7666 -0
- package/dist/spine.js +1 -1
- package/dist/tilemap.js +1 -1
- package/package.json +26 -23
- package/dist/animation/Animation2DStateMachineVisualRuntime.d.ts +0 -27
- package/dist/animation/Particle2DDescriptorAdapter.d.ts +0 -5
- package/dist/animation3d/Animation3DResource.d.ts +0 -28
- package/dist/animation3d/hya/HyaAnimation3DStateMachineRuntime.d.ts +0 -65
- package/dist/animation3d/hya/index.d.ts +0 -4
- package/dist/animation3d/runtime/integration/Animation3DStateMachineMixerAdapter.d.ts +0 -81
- package/dist/animation3d/runtime/integration/Animation3DStateMachineMixerIntegration.d.ts +0 -39
- package/dist/animation3d/runtime/integration/index.d.ts +0 -2
- package/dist/animation3d/runtime/mixer/Action.d.ts +0 -150
- package/dist/animation3d/runtime/mixer/Animation3DMixerRuntimeStore.d.ts +0 -6
- package/dist/animation3d/runtime/mixer/Mixer.d.ts +0 -59
- package/dist/animation3d/runtime/mixer/PoseBuffer.d.ts +0 -1
- package/dist/animation3d/runtime/mixer/TrackSampler.d.ts +0 -24
- package/dist/animation3d/runtime/mixer/index.d.ts +0 -4
- package/dist/animation3d/runtime/state-machine/Animation3DBlendTreeWeights.d.ts +0 -1
- package/dist/animation3d/runtime/state-machine/Animation3DStateMachineCompiler.d.ts +0 -1
- package/dist/animation3d/runtime/state-machine/Animation3DStateMachineController.d.ts +0 -1
- package/dist/animation3d/runtime/state-machine/Animation3DStateMachineMixerPort.d.ts +0 -1
- package/dist/animation3d/runtime/state-machine/index.d.ts +0 -6
- package/dist/benchmark.d.ts +0 -30
- package/dist/chunks/2d-ui-animation-2d.generated-D4aHzFU2.js +0 -4
- package/dist/chunks/Animation2DStateMachine-9IonguNa.js +0 -3245
- package/dist/gltf/GltfAccessorReader.d.ts +0 -7
- package/dist/gltf/GltfDracoDecoder.d.ts +0 -4
- package/dist/gltf/GltfLoaderErrors.d.ts +0 -4
- package/dist/gltf/GltfMaterialDescriptor.d.ts +0 -23
- package/dist/gltf/GltfMaterialLoader.d.ts +0 -6
- package/dist/gltf-worker-runtime.d.ts +0 -7
- package/dist/plugins/pluginUtils.d.ts +0 -20
- package/dist/plugins.d.ts +0 -6
- package/dist/shaders/generated/2d-ui-artifact.generated.d.ts +0 -658
- package/dist/spine/Spine2DGpuRenderer.d.ts +0 -65
- package/dist/spine/Spine2DRuntime.d.ts +0 -103
- package/dist/spine/SpineAnimationBoneTimelines.d.ts +0 -8
- package/dist/spine/SpineFloatBuilder.d.ts +0 -15
- package/dist/spine/SpinePathConstraintSolver.d.ts +0 -32
- package/dist/spine/SpineSkeletonRuntime.d.ts +0 -185
- package/dist/spine/SpineSlotAnimation.d.ts +0 -17
- package/dist/spine/SpineTimelineRuntime.d.ts +0 -25
- package/dist/spine/SpineVertexBuilder.d.ts +0 -61
- package/dist/tilemap/Tilemap2DRenderer.d.ts +0 -24
- package/dist/utils/arrayAccess.d.ts +0 -4
- package/dist/utils/camera2d.d.ts +0 -12
- package/src/animation/Animation2DComponent.ts +0 -135
- package/src/animation/Animation2DExtensionRegistry.ts +0 -52
- package/src/animation/Animation2DRenderSystem.ts +0 -1026
- package/src/animation/Animation2DRuntime.ts +0 -1326
- package/src/animation/Animation2DStateMachine.ts +0 -39
- package/src/animation/Animation2DStateMachineComponent.ts +0 -228
- package/src/animation/Animation2DStateMachineRuntime.ts +0 -141
- package/src/animation/Animation2DStateMachineSystem.ts +0 -60
- package/src/animation/Animation2DStateMachineVisualRuntime.ts +0 -282
- package/src/animation/Animation2DSystem.ts +0 -72
- package/src/animation/AnimationAssetLoader.ts +0 -84
- package/src/animation/AnimationAudioClip.ts +0 -140
- package/src/animation/AnimationPathTessellator.ts +0 -691
- package/src/animation/AnimationTextRasterizer.ts +0 -340
- package/src/animation/AnimationVisual2D.ts +0 -153
- package/src/animation/HyaAnimation2DClipAdapter.ts +0 -845
- package/src/animation/Particle2DDescriptorAdapter.ts +0 -35
- package/src/animation/runtime/mixer/Action.ts +0 -876
- package/src/animation/runtime/mixer/Mixer.ts +0 -505
- package/src/animation/runtime/mixer/PoseBuffer.ts +0 -105
- package/src/animation/runtime/mixer/Sampler.ts +0 -252
- package/src/animation/runtime/mixer/Types.ts +0 -138
- package/src/animation/runtime/mixer/index.ts +0 -31
- package/src/animation-state-machine/AnimationStateMachine.ts +0 -146
- package/src/animation-state-machine/AnimationStateMachineChannels.ts +0 -116
- package/src/animation-state-machine/runtime/Animation2DStateMachineMixerAdapter.ts +0 -197
- package/src/animation-state-machine/runtime/AnimationStateMachineBlendTreeWeights.ts +0 -503
- package/src/animation-state-machine/runtime/AnimationStateMachineCompiler.ts +0 -763
- package/src/animation-state-machine/runtime/AnimationStateMachineController.ts +0 -987
- package/src/animation-state-machine/runtime/AnimationStateMachineMixerPort.ts +0 -54
- package/src/animation-state-machine/runtime/index.ts +0 -47
- package/src/animation.ts +0 -33
- package/src/animation3d/Animation3DAction.ts +0 -73
- package/src/animation3d/Animation3DBinding.ts +0 -116
- package/src/animation3d/Animation3DClip.ts +0 -22
- package/src/animation3d/Animation3DError.ts +0 -34
- package/src/animation3d/Animation3DMixer.ts +0 -82
- package/src/animation3d/Animation3DPose.ts +0 -100
- package/src/animation3d/Animation3DPoseBuffer.ts +0 -85
- package/src/animation3d/Animation3DResource.ts +0 -49
- package/src/animation3d/Animation3DStateMachine.ts +0 -126
- package/src/animation3d/Animation3DStateMachineRuntime.ts +0 -191
- package/src/animation3d/Animation3DTrack.ts +0 -29
- package/src/animation3d/hya/HyaAnimation3DRuntime.ts +0 -756
- package/src/animation3d/hya/HyaAnimation3DStateMachineRuntime.ts +0 -618
- package/src/animation3d/hya/HyaAnimation3DTypes.ts +0 -168
- package/src/animation3d/hya/index.ts +0 -10
- package/src/animation3d/index.ts +0 -76
- package/src/animation3d/runtime/integration/Animation3DStateMachineMixerAdapter.ts +0 -325
- package/src/animation3d/runtime/integration/Animation3DStateMachineMixerIntegration.ts +0 -158
- package/src/animation3d/runtime/integration/index.ts +0 -9
- package/src/animation3d/runtime/mixer/Action.ts +0 -833
- package/src/animation3d/runtime/mixer/Animation3DMixerRuntimeStore.ts +0 -26
- package/src/animation3d/runtime/mixer/Mixer.ts +0 -562
- package/src/animation3d/runtime/mixer/PoseBuffer.ts +0 -1
- package/src/animation3d/runtime/mixer/TrackSampler.ts +0 -399
- package/src/animation3d/runtime/mixer/index.ts +0 -8
- package/src/animation3d/runtime/state-machine/Animation3DBlendTreeWeights.ts +0 -4
- package/src/animation3d/runtime/state-machine/Animation3DStateMachineCompiler.ts +0 -1
- package/src/animation3d/runtime/state-machine/Animation3DStateMachineController.ts +0 -1
- package/src/animation3d/runtime/state-machine/Animation3DStateMachineMixerPort.ts +0 -1
- package/src/animation3d/runtime/state-machine/index.ts +0 -45
- package/src/animation3d.ts +0 -5
- package/src/benchmark.ts +0 -168
- package/src/canvas-text/CanvasText2DRenderSystem.ts +0 -292
- package/src/canvas-text/CanvasTextComponent.ts +0 -47
- package/src/canvas-text.ts +0 -4
- package/src/experimental-gltf-worker.ts +0 -18
- package/src/experimental-spine-worker.ts +0 -9
- package/src/gltf/GltfAccessorReader.ts +0 -271
- package/src/gltf/GltfAnimation3DAdapter.ts +0 -680
- package/src/gltf/GltfAnimationRuntime.ts +0 -392
- package/src/gltf/GltfAssetWorkerClient.ts +0 -136
- package/src/gltf/GltfCompatibilityReport.ts +0 -214
- package/src/gltf/GltfConservativeBounds.ts +0 -219
- package/src/gltf/GltfDracoDecoder.ts +0 -251
- package/src/gltf/GltfExtensionAdapter.ts +0 -340
- package/src/gltf/GltfLoaderContract.ts +0 -333
- package/src/gltf/GltfLoaderErrors.ts +0 -59
- package/src/gltf/GltfMaterialDescriptor.ts +0 -134
- package/src/gltf/GltfMaterialEncoder.ts +0 -173
- package/src/gltf/GltfMaterialLoader.ts +0 -293
- package/src/gltf/GltfModelComponent.ts +0 -115
- package/src/gltf/GltfModelSystem.ts +0 -208
- package/src/gltf/GltfPlugin.ts +0 -84
- package/src/gltf/GltfSchema.ts +0 -229
- package/src/gltf/GltfUvSemanticPlanner.ts +0 -166
- package/src/gltf/gltfLoader.ts +0 -910
- package/src/gltf-animation3d.ts +0 -10
- package/src/gltf-worker-runtime.ts +0 -10
- package/src/gltf.ts +0 -56
- package/src/grid/Grid2DComponent.ts +0 -69
- package/src/grid.ts +0 -2
- package/src/hya-state-machine.ts +0 -19
- package/src/index.ts +0 -2
- package/src/plugins/pluginUtils.ts +0 -50
- package/src/plugins.ts +0 -6
- package/src/shaders/generated/2d-ui-animation-2d.generated.wgsl +0 -242
- package/src/shaders/generated/2d-ui-artifact.generated.ts +0 -867
- package/src/shaders/generated/2d-ui-canvas-text-2d.generated.wgsl +0 -38
- package/src/shaders/generated/2d-ui-spine2d.generated.wgsl +0 -41
- package/src/shaders/generated/2d-ui-tilemap2d.generated.wgsl +0 -36
- package/src/spine/Spine2DComponent.ts +0 -168
- package/src/spine/Spine2DGpuRenderer.ts +0 -449
- package/src/spine/Spine2DRenderSystem.ts +0 -199
- package/src/spine/Spine2DRuntime.ts +0 -1529
- package/src/spine/SpineAnimationBoneTimelines.ts +0 -30
- package/src/spine/SpineAssetParser.ts +0 -20
- package/src/spine/SpineAssetWorkerClient.ts +0 -112
- package/src/spine/SpineAssetWorkerContract.ts +0 -4
- package/src/spine/SpineAtlasParser.ts +0 -127
- package/src/spine/SpineFloatBuilder.ts +0 -66
- package/src/spine/SpinePathConstraintSolver.ts +0 -582
- package/src/spine/SpinePlugin.ts +0 -76
- package/src/spine/SpineSkeletonRuntime.ts +0 -521
- package/src/spine/SpineSlotAnimation.ts +0 -195
- package/src/spine/SpineTimelineRuntime.ts +0 -453
- package/src/spine/SpineVertexBuilder.ts +0 -686
- package/src/spine.ts +0 -7
- package/src/tilemap/Tilemap2DComponent.ts +0 -232
- package/src/tilemap/Tilemap2DRenderSystem.ts +0 -58
- package/src/tilemap/Tilemap2DRenderer.ts +0 -289
- package/src/tilemap/TilemapPlugin.ts +0 -75
- package/src/tilemap.ts +0 -6
- package/src/tween/Tween2DComponent.ts +0 -83
- package/src/tween/Tween2DSystem.ts +0 -78
- package/src/tween.ts +0 -4
- package/src/types/earcut.d.ts +0 -7
- package/src/types/wgsl.d.ts +0 -4
- package/src/utils/RenderSystem2DBase.ts +0 -164
- package/src/utils/arrayAccess.ts +0 -17
- package/src/utils/camera2d.ts +0 -68
- package/src/utils/render2dGpu.ts +0 -132
- package/test/fixtures/gltf/animation-characterization.gltf +0 -344
package/README.md
CHANGED
|
@@ -2,12 +2,19 @@
|
|
|
2
2
|
|
|
3
3
|
Optional runtime capabilities for `@haiyue/engine`.
|
|
4
4
|
|
|
5
|
+
`@haiyue/extensions/controls` adds configurable fixed/floating virtual joystick input,
|
|
6
|
+
per-frame events, Entity movement/heading and optional Engine GUI presentation.
|
|
7
|
+
See the [guide](../docs/engine-guide/virtual-joystick.md) and
|
|
8
|
+
[runnable example](../examples/virtual-joystick/index.html). This new stable subpath
|
|
9
|
+
is a local candidate for a future reviewed minor release, not a published 0.1.x addition.
|
|
10
|
+
|
|
5
11
|
## Stable entrypoints
|
|
6
12
|
|
|
7
13
|
- `@haiyue/extensions/gltf` — glTF loading, runtime components, compatibility reports, materials, and the engine plugin.
|
|
8
14
|
- `@haiyue/extensions/animation3d` — source-independent 3D clips, mixers, pose buffers, layers, masks, events, state machines, and the HYA adapter.
|
|
9
15
|
- `@haiyue/extensions/gltf-animation3d` — adapts glTF clips to the source-independent Animation3D runtime.
|
|
10
16
|
- `@haiyue/extensions/animation` — HYA Animation2D components, systems, loading, rendering, and state-machine integration.
|
|
17
|
+
- `@haiyue/extensions/deformable-animation` — source-neutral HYA deformable-mesh sampling, dynamic geometry, texture and alpha-mask runtime; it has no Live2D/Cubism dependency.
|
|
11
18
|
- `@haiyue/extensions/hya-state-machine` — the focused HYA 2D state-machine runtime.
|
|
12
19
|
- `@haiyue/extensions/spine` — Spine component, render system, plugin, and the stable worker interface seam.
|
|
13
20
|
- `@haiyue/extensions/tilemap` — Tilemap2D component, render system, and plugin.
|
|
@@ -27,4 +34,22 @@ engine.installPlugin(createGltfPlugin());
|
|
|
27
34
|
|
|
28
35
|
The package root remains a minimal experimental authoring base. Worker transport and low-level parsing are explicitly available from `@haiyue/extensions/experimental/gltf-worker` and `@haiyue/extensions/experimental/spine-worker`; they may change without stable-API compatibility guarantees.
|
|
29
36
|
|
|
37
|
+
The source-neutral indexed-sprite renderer is available from `@haiyue/extensions/experimental/indexed-sprite`. It stores index planes and palette rows separately, so changing a palette does not duplicate sprite pixels. It also accepts RGB/RGBA planes, batches atlas pages, supports nearest or palette-aware linear filtering, and owns bounded upload/recovery/disposal:
|
|
38
|
+
|
|
39
|
+
```ts
|
|
40
|
+
import { IndexedSpriteRenderer } from '@haiyue/extensions/experimental/indexed-sprite';
|
|
41
|
+
|
|
42
|
+
const renderer = new IndexedSpriteRenderer(device, [{
|
|
43
|
+
id: 'idle-0', width: 2, height: 2, format: 'indexed8',
|
|
44
|
+
pixels: new Uint8Array([0, 1, 1, 0]),
|
|
45
|
+
}], [{
|
|
46
|
+
id: 'default', colorCount: 2,
|
|
47
|
+
rgba: new Uint8Array([0, 0, 0, 0, 255, 255, 255, 255]),
|
|
48
|
+
}], { targetFormat: navigator.gpu.getPreferredCanvasFormat() });
|
|
49
|
+
|
|
50
|
+
renderer.uploadAll();
|
|
51
|
+
renderer.render(pass, [{ spriteId: 'idle-0', paletteId: 'default', x: 320, y: 180 }], 1280, 720);
|
|
52
|
+
renderer.dispose();
|
|
53
|
+
```
|
|
54
|
+
|
|
30
55
|
WebGPU is required by the runtime; there is no WebGL fallback.
|
|
@@ -5,10 +5,22 @@ import type { Animation2DExtensionRegistry } from './Animation2DExtensionRegistr
|
|
|
5
5
|
export interface Animation2DComponentOptions {
|
|
6
6
|
autoplay?: boolean;
|
|
7
7
|
loop?: boolean;
|
|
8
|
+
/** Seconds from which playback repeats after the first complete pass. */
|
|
9
|
+
loopStartTime?: number;
|
|
10
|
+
/** Exclusive end of the repeated range; later timeline content remains available for an exit pass. */
|
|
11
|
+
loopEndTime?: number;
|
|
8
12
|
speed?: number;
|
|
9
13
|
startTime?: number;
|
|
10
14
|
runtimeExtensions?: Animation2DExtensionRegistry;
|
|
11
15
|
}
|
|
16
|
+
export interface Animation2DNodeOverride {
|
|
17
|
+
/** Local node position in the HYA canvas coordinate system (screen-y-down). */
|
|
18
|
+
readonly position?: readonly [number, number];
|
|
19
|
+
/** Runtime opacity replacement in the inclusive 0..1 range. */
|
|
20
|
+
readonly opacity?: number;
|
|
21
|
+
/** Overrides authored/timeline visibility while present. */
|
|
22
|
+
readonly enabled?: boolean;
|
|
23
|
+
}
|
|
12
24
|
export interface Animation2DRuntimeStats {
|
|
13
25
|
readonly nodeCount: number;
|
|
14
26
|
readonly visualCount: number;
|
|
@@ -26,10 +38,13 @@ export declare class Animation2DComponent extends Component {
|
|
|
26
38
|
readonly animation: ParsedAnimation;
|
|
27
39
|
playing: boolean;
|
|
28
40
|
loop: boolean;
|
|
41
|
+
readonly loopStartTime: number;
|
|
42
|
+
readonly loopEndTime: number;
|
|
29
43
|
speed: number;
|
|
30
44
|
currentTime: number;
|
|
31
45
|
completed: boolean;
|
|
32
46
|
readonly runtimeExtensions: Animation2DExtensionRegistry | undefined;
|
|
47
|
+
readonly _nodeOverrides: Map<string, Animation2DNodeOverride>;
|
|
33
48
|
_runtime: Animation2DRuntime | null;
|
|
34
49
|
_needsApply: boolean;
|
|
35
50
|
_forceParticleSeek: boolean;
|
|
@@ -39,6 +54,9 @@ export declare class Animation2DComponent extends Component {
|
|
|
39
54
|
pause(): this;
|
|
40
55
|
seek(seconds: number): this;
|
|
41
56
|
setSpeed(speed: number): this;
|
|
57
|
+
setNodeOverride(nodeId: string, override: Animation2DNodeOverride): this;
|
|
58
|
+
clearNodeOverride(nodeId: string): this;
|
|
59
|
+
clearNodeOverrides(): this;
|
|
42
60
|
onEntityRemoveComponent(_entity: Entity, component: Component): void;
|
|
43
61
|
onEntityRemoveFromWorld(_entity: Entity, _world: World): void;
|
|
44
62
|
clone(): Animation2DComponent;
|
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
import type { AnimationComponent, AnimationNode, ParsedAnimation } from '@haiyue/animation-spec';
|
|
2
2
|
import type { Entity } from '@haiyue/engine';
|
|
3
|
+
import type { AssetManager } from '@haiyue/engine/assets';
|
|
3
4
|
export interface Animation2DExtensionContext {
|
|
4
5
|
readonly animation: ParsedAnimation;
|
|
5
6
|
readonly node: Readonly<AnimationNode>;
|
|
6
7
|
readonly component: Readonly<AnimationComponent>;
|
|
7
8
|
/** Anchor-adjusted parent for entities created by the extension. */
|
|
8
9
|
readonly parent: Entity;
|
|
10
|
+
/** Shared runtime asset manager; absent hosts must reject resource-backed handlers. */
|
|
11
|
+
readonly assetManager?: AssetManager;
|
|
12
|
+
/** Stable identity separating multiple instances of the same HYA document. */
|
|
13
|
+
readonly instanceId: number;
|
|
14
|
+
/** Aborted before the owning animation hierarchy is destroyed. */
|
|
15
|
+
readonly signal: AbortSignal;
|
|
9
16
|
}
|
|
10
17
|
export interface Animation2DExtensionInstance {
|
|
11
18
|
/** Deterministic composition-time update; implementations must tolerate seeks and loop wrap. */
|
|
@@ -24,6 +24,8 @@ export declare class Animation2DRenderSystem extends RenderSystem2DBase {
|
|
|
24
24
|
private textureLayout;
|
|
25
25
|
private compositeLayout;
|
|
26
26
|
private sampler;
|
|
27
|
+
private mipmapSampler;
|
|
28
|
+
private mipmapPipeline;
|
|
27
29
|
private whiteTexture;
|
|
28
30
|
private whiteBindGroup;
|
|
29
31
|
private emptyCompositeBindGroup;
|
|
@@ -34,6 +36,8 @@ export declare class Animation2DRenderSystem extends RenderSystem2DBase {
|
|
|
34
36
|
private pipelines;
|
|
35
37
|
private readonly entityGpu;
|
|
36
38
|
private readonly geometryGpu;
|
|
39
|
+
private readonly explicitUvIds;
|
|
40
|
+
private nextExplicitUvId;
|
|
37
41
|
private textureBindGroups;
|
|
38
42
|
private readonly maskTargets;
|
|
39
43
|
private readonly effectTargets;
|
|
@@ -72,7 +76,9 @@ export declare class Animation2DRenderSystem extends RenderSystem2DBase {
|
|
|
72
76
|
private drawEffectResult;
|
|
73
77
|
private getEntityGpu;
|
|
74
78
|
private getVisualTextureBindGroup;
|
|
79
|
+
private generateTextMipChain;
|
|
75
80
|
private getGeometryGpu;
|
|
81
|
+
private geometryKey;
|
|
76
82
|
private getTextureBindGroup;
|
|
77
83
|
private createTextureBindGroup;
|
|
78
84
|
private resolveCompositeBindGroup;
|
|
@@ -2,7 +2,7 @@ import { type AnimationComposite, type AnimationLayerEffect, type AnimationNode,
|
|
|
2
2
|
import { Entity, Transform2D } from '@haiyue/engine';
|
|
3
3
|
import { ParticleEmitter2D } from '@haiyue/engine/components';
|
|
4
4
|
import type { AssetManager } from '@haiyue/engine/assets';
|
|
5
|
-
import type { Animation2DRuntimeStats } from './Animation2DComponent.js';
|
|
5
|
+
import type { Animation2DNodeOverride, Animation2DRuntimeStats } from './Animation2DComponent.js';
|
|
6
6
|
import type { Animation2DExtensionInstance, Animation2DExtensionRegistry } from './Animation2DExtensionRegistry.js';
|
|
7
7
|
import { type VectorPathMorphComponent, type VectorStrokePathComponent } from './AnimationPathTessellator.js';
|
|
8
8
|
import { AnimationVisual2D } from './AnimationVisual2D.js';
|
|
@@ -22,6 +22,7 @@ export interface Animation2DRuntimeVisual {
|
|
|
22
22
|
lastVectorTime?: number;
|
|
23
23
|
readonly textRasterizer?: AnimationTextRasterizer;
|
|
24
24
|
readonly sourceEffects?: readonly Readonly<AnimationLayerEffect>[];
|
|
25
|
+
readonly sourceEffectOffset?: number;
|
|
25
26
|
lastEffectTime?: number;
|
|
26
27
|
readonly compositeExpansionTracks?: readonly (Readonly<AnimationVectorValueTrack> | undefined)[];
|
|
27
28
|
lastCompositeTime?: number;
|
|
@@ -58,6 +59,7 @@ export interface Animation2DRuntimeNode {
|
|
|
58
59
|
export declare class Animation2DRuntime {
|
|
59
60
|
private readonly _animation;
|
|
60
61
|
private readonly _assetManager?;
|
|
62
|
+
private readonly _nodeOverrides;
|
|
61
63
|
private readonly _root;
|
|
62
64
|
protected readonly _nodes: Animation2DRuntimeNode[];
|
|
63
65
|
protected readonly _nodesById: Map<string, Animation2DRuntimeNode>;
|
|
@@ -69,6 +71,7 @@ export declare class Animation2DRuntime {
|
|
|
69
71
|
private readonly _assetHandles;
|
|
70
72
|
private readonly _fontLoads;
|
|
71
73
|
private readonly _fontFaces;
|
|
74
|
+
private readonly _expressionDataLoads;
|
|
72
75
|
private readonly _instanceId;
|
|
73
76
|
private _visualCount;
|
|
74
77
|
private _unsupportedComponentCount;
|
|
@@ -82,12 +85,13 @@ export declare class Animation2DRuntime {
|
|
|
82
85
|
protected _speed: number;
|
|
83
86
|
protected _lastAppliedTime: number;
|
|
84
87
|
get stats(): Animation2DRuntimeStats;
|
|
85
|
-
constructor(owner: Entity, _animation: ParsedAnimation, runtimeExtensions?: Animation2DExtensionRegistry, _assetManager?: AssetManager | undefined);
|
|
88
|
+
constructor(owner: Entity, _animation: ParsedAnimation, runtimeExtensions?: Animation2DExtensionRegistry, _assetManager?: AssetManager | undefined, _nodeOverrides?: ReadonlyMap<string, Animation2DNodeOverride>);
|
|
86
89
|
apply(time: number, playing?: boolean, speed?: number, forceParticleSeek?: boolean): void;
|
|
87
90
|
destroy(): void;
|
|
88
91
|
setPlaying(playing: boolean): void;
|
|
89
92
|
private _loadTexture;
|
|
90
93
|
protected _materializeCoreVisual(node: Animation2DRuntimeNode, deferred: DeferredCoreVisual): void;
|
|
94
|
+
private _loadTextExpressionData;
|
|
91
95
|
private _loadTextFonts;
|
|
92
96
|
private _loadFont;
|
|
93
97
|
private _applyTrack;
|
|
@@ -11,9 +11,13 @@ export declare class AnimationTextRasterizer {
|
|
|
11
11
|
private updating;
|
|
12
12
|
private updateToken;
|
|
13
13
|
private readonly animated;
|
|
14
|
+
private readonly expressionData;
|
|
15
|
+
private readonly outlineFonts;
|
|
14
16
|
constructor(component: Readonly<AnimationText2DComponent>);
|
|
15
17
|
setTime(time: number): void;
|
|
16
18
|
invalidateFont(): void;
|
|
19
|
+
setFontData(family: string, style: 'normal' | 'italic', weight: string | number, data: ArrayBuffer): void;
|
|
20
|
+
setExpressionData(resource: string, value: unknown): void;
|
|
17
21
|
destroy(): void;
|
|
18
22
|
updateTexture(): Promise<void>;
|
|
19
23
|
private draw;
|
|
@@ -5,9 +5,21 @@ import type { AnimationTextRasterizer } from './AnimationTextRasterizer';
|
|
|
5
5
|
export interface AnimationVisual2DOptions {
|
|
6
6
|
geometry: Geometry2D;
|
|
7
7
|
color: readonly [number, number, number, number];
|
|
8
|
+
/** Drawable-local multiply tint. Alpha is retained for pose parity but is not rendered. */
|
|
9
|
+
multiplyColor?: readonly [number, number, number, number];
|
|
10
|
+
/** Drawable-local alpha-aware screen tint. Alpha is retained for pose parity but is not rendered. */
|
|
11
|
+
screenColor?: readonly [number, number, number, number];
|
|
8
12
|
instanceId: number;
|
|
9
13
|
nodeId: string;
|
|
10
14
|
order: number;
|
|
15
|
+
/** Source-neutral draw blend used by deformable meshes and other authored visuals. */
|
|
16
|
+
blendMode?: AnimationVisual2DBlendMode;
|
|
17
|
+
/** Declares whether filtered source texels are already premultiplied. */
|
|
18
|
+
textureAlphaMode?: AnimationVisual2DTextureAlphaMode;
|
|
19
|
+
/** Source-neutral back-face culling. False draws both triangle faces. */
|
|
20
|
+
culling?: boolean;
|
|
21
|
+
/** Optional explicit UV pairs for arbitrary textured triangle meshes. */
|
|
22
|
+
uvs?: Float32Array;
|
|
11
23
|
sourceOnly?: boolean;
|
|
12
24
|
composite?: Readonly<AnimationComposite>;
|
|
13
25
|
texture?: GPUTexture | null;
|
|
@@ -19,6 +31,8 @@ export interface AnimationVisual2DOptions {
|
|
|
19
31
|
gradient?: AnimationVisualGradient | null;
|
|
20
32
|
effects?: readonly AnimationVisualEffect[];
|
|
21
33
|
}
|
|
34
|
+
export type AnimationVisual2DBlendMode = 'normal' | 'additive' | 'multiplicative' | 'screen';
|
|
35
|
+
export type AnimationVisual2DTextureAlphaMode = 'straight' | 'premultiplied';
|
|
22
36
|
export interface AnimationVisualGradient {
|
|
23
37
|
kind: 'linear' | 'radial';
|
|
24
38
|
start: [number, number];
|
|
@@ -27,7 +41,7 @@ export interface AnimationVisualGradient {
|
|
|
27
41
|
stops: Float32Array;
|
|
28
42
|
opacity: number;
|
|
29
43
|
}
|
|
30
|
-
export type AnimationVisualEffectKind = 'tint' | 'fill' | 'opacity' | 'color-matrix' | 'blur' | 'drop-shadow';
|
|
44
|
+
export type AnimationVisualEffectKind = 'tint' | 'fill' | 'opacity' | 'color-matrix' | 'blur' | 'drop-shadow' | 'inner-feather' | 'vector-feather';
|
|
31
45
|
export interface AnimationVisualEffect {
|
|
32
46
|
readonly kind: AnimationVisualEffectKind;
|
|
33
47
|
/** Mutable, kind-specific sampled values owned by the animation runtime. */
|
|
@@ -41,7 +55,11 @@ export declare class AnimationVisual2D extends Component {
|
|
|
41
55
|
readonly instanceId: number;
|
|
42
56
|
readonly nodeId: string;
|
|
43
57
|
readonly nodeKey: string;
|
|
44
|
-
|
|
58
|
+
order: number;
|
|
59
|
+
readonly blendMode: AnimationVisual2DBlendMode;
|
|
60
|
+
readonly textureAlphaMode: AnimationVisual2DTextureAlphaMode;
|
|
61
|
+
readonly culling: boolean;
|
|
62
|
+
readonly uvs: Float32Array | null;
|
|
45
63
|
readonly sourceOnly: boolean;
|
|
46
64
|
readonly compositeLayers: readonly Readonly<AnimationCompositeLayer>[];
|
|
47
65
|
readonly compositeKeys: readonly string[];
|
|
@@ -51,6 +69,8 @@ export declare class AnimationVisual2D extends Component {
|
|
|
51
69
|
readonly compositeMode: AnimationCompositeMode | undefined;
|
|
52
70
|
readonly uvRect: [number, number, number, number];
|
|
53
71
|
readonly color: [number, number, number, number];
|
|
72
|
+
readonly multiplyColor: [number, number, number, number];
|
|
73
|
+
readonly screenColor: [number, number, number, number];
|
|
54
74
|
texture: GPUTexture | null;
|
|
55
75
|
textureHandle: AssetHandle<GPUTexture> | null;
|
|
56
76
|
readonly textMaterial: AnimationTextRasterizer | null;
|
|
@@ -60,9 +80,45 @@ export declare class AnimationVisual2D extends Component {
|
|
|
60
80
|
revision: number;
|
|
61
81
|
constructor(options: AnimationVisual2DOptions);
|
|
62
82
|
setTexture(texture: GPUTexture | null): void;
|
|
83
|
+
setOrder(order: number): void;
|
|
63
84
|
setTextureHandle(handle: AssetHandle<GPUTexture> | null): void;
|
|
64
85
|
setUvRect(value: readonly [number, number, number, number]): void;
|
|
86
|
+
/** Updates caller-owned drawable color state without replacing visual or GPU owners. */
|
|
87
|
+
setDrawableColors(multiplyColor: readonly [number, number, number, number] | Float32Array, screenColor: readonly [number, number, number, number] | Float32Array): void;
|
|
65
88
|
setCompositeExpansion(index: number, value: number): void;
|
|
66
89
|
resolveTexture(): GPUTexture | null;
|
|
67
90
|
clone(): AnimationVisual2D;
|
|
68
91
|
}
|
|
92
|
+
export declare class AnimationVisual2DConfigurationError extends TypeError {
|
|
93
|
+
readonly code: 'E_ANIMATION_2D_CULLING_INVALID' | 'E_ANIMATION_2D_MULTIPLY_COLOR_INVALID' | 'E_ANIMATION_2D_SCREEN_COLOR_INVALID';
|
|
94
|
+
readonly path: string;
|
|
95
|
+
constructor(code: 'E_ANIMATION_2D_CULLING_INVALID' | 'E_ANIMATION_2D_MULTIPLY_COLOR_INVALID' | 'E_ANIMATION_2D_SCREEN_COLOR_INVALID', message: string, path: string);
|
|
96
|
+
}
|
|
97
|
+
export interface AnimationDrawableColorPixelInput {
|
|
98
|
+
readonly texture: readonly [number, number, number, number];
|
|
99
|
+
readonly textureAlphaMode?: AnimationVisual2DTextureAlphaMode;
|
|
100
|
+
readonly baseColor?: readonly [number, number, number, number];
|
|
101
|
+
readonly multiplyColor?: readonly [number, number, number, number];
|
|
102
|
+
readonly screenColor?: readonly [number, number, number, number];
|
|
103
|
+
readonly coverage?: number;
|
|
104
|
+
/** Mask setup intentionally ignores drawable tint RGB. */
|
|
105
|
+
readonly outputMask?: boolean;
|
|
106
|
+
}
|
|
107
|
+
/** CPU oracle for the premultiplied fragment emitted before framebuffer compositing. */
|
|
108
|
+
export declare function composeAnimationDrawableColorPixel(input: AnimationDrawableColorPixelInput): [number, number, number, number];
|
|
109
|
+
export declare class Animation2DPipelineCreationError extends Error {
|
|
110
|
+
readonly pipelineKey: string;
|
|
111
|
+
readonly cause: unknown;
|
|
112
|
+
readonly code: "E_ANIMATION_2D_PIPELINE_CREATION_FAILED";
|
|
113
|
+
readonly path: "$runtime.animation2D.pipeline";
|
|
114
|
+
constructor(pipelineKey: string, cause: unknown);
|
|
115
|
+
}
|
|
116
|
+
export declare function createAnimation2DPipeline<T>(pipelineKey: string, create: () => T): T;
|
|
117
|
+
/**
|
|
118
|
+
* Source-neutral 2D front faces are CCW in clip space. WebGPU normalizes the
|
|
119
|
+
* viewport convention for front-face classification; callers must not add an
|
|
120
|
+
* extra framebuffer-Y inversion. Real model/world reflections still reverse it.
|
|
121
|
+
*/
|
|
122
|
+
export declare const ANIMATION_2D_WEBGPU_FRONT_FACE: "ccw";
|
|
123
|
+
export declare function animation2DCullingPrimitive(culling: boolean): GPUPrimitiveState;
|
|
124
|
+
export declare function animation2DCullingPipelineKey(culling: boolean): string;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import type { InteractionActionPort, InteractionGeometryPort, RuntimeInteractionDocument, RuntimeValue } from './runtime-types.js';
|
|
2
|
+
interface PointerInput {
|
|
3
|
+
readonly kind: 'move' | 'down' | 'up';
|
|
4
|
+
readonly pointerId: number;
|
|
5
|
+
readonly point: readonly [number, number];
|
|
6
|
+
readonly button?: number;
|
|
7
|
+
}
|
|
8
|
+
export interface InteractionRuntimeOptions {
|
|
9
|
+
readonly geometryPort?: InteractionGeometryPort;
|
|
10
|
+
readonly actionPort?: InteractionActionPort;
|
|
11
|
+
readonly maxEventQueue?: number;
|
|
12
|
+
readonly maxEventRecursion?: number;
|
|
13
|
+
readonly maxPointers?: number;
|
|
14
|
+
readonly maxStringBytes?: number;
|
|
15
|
+
}
|
|
16
|
+
export declare class InteractionRuntime {
|
|
17
|
+
readonly document: RuntimeInteractionDocument;
|
|
18
|
+
private readonly options;
|
|
19
|
+
private readonly targets;
|
|
20
|
+
private readonly listeners;
|
|
21
|
+
private readonly queue;
|
|
22
|
+
private pointers;
|
|
23
|
+
private captures;
|
|
24
|
+
private focused;
|
|
25
|
+
private sequence;
|
|
26
|
+
private transactionSequence;
|
|
27
|
+
private draining;
|
|
28
|
+
private currentDepth;
|
|
29
|
+
private disposed;
|
|
30
|
+
private readonly maxEventQueue;
|
|
31
|
+
private readonly maxEventRecursion;
|
|
32
|
+
private readonly maxPointers;
|
|
33
|
+
private readonly maxStringBytes;
|
|
34
|
+
constructor(document: RuntimeInteractionDocument, options?: InteractionRuntimeOptions);
|
|
35
|
+
dispatchPointer(input: PointerInput): void;
|
|
36
|
+
dispatchKeyboard(input: Readonly<{
|
|
37
|
+
key: string;
|
|
38
|
+
phase: 'down' | 'up' | 'repeat';
|
|
39
|
+
modifiers?: readonly string[];
|
|
40
|
+
}>): void;
|
|
41
|
+
dispatchText(text: string): void;
|
|
42
|
+
dispatchDataChange(binding: string, value: RuntimeValue, target?: string | undefined): void;
|
|
43
|
+
dispatchGamepad(input: Readonly<{
|
|
44
|
+
index: number;
|
|
45
|
+
control: string;
|
|
46
|
+
phase: 'down' | 'up' | 'change';
|
|
47
|
+
value: number;
|
|
48
|
+
}>): void;
|
|
49
|
+
dispatchSemanticAction(target: string, action: 'tap' | 'increase' | 'decrease' | 'focus'): void;
|
|
50
|
+
enqueueReportedEvent(name: string, payload?: RuntimeValue, target?: string | undefined): void;
|
|
51
|
+
enqueueComponentEvent(target: string, name: string, payload?: RuntimeValue): void;
|
|
52
|
+
focus(target: string | undefined): void;
|
|
53
|
+
focusNext(reverse?: boolean): string | undefined;
|
|
54
|
+
hitTest(point: readonly [number, number]): string | undefined;
|
|
55
|
+
dispose(): void;
|
|
56
|
+
get trace(): Readonly<{
|
|
57
|
+
sequence: number;
|
|
58
|
+
focused: string | null;
|
|
59
|
+
captures: readonly Readonly<{
|
|
60
|
+
pointer: number;
|
|
61
|
+
target: string;
|
|
62
|
+
}>[];
|
|
63
|
+
pointers: number;
|
|
64
|
+
queued: number;
|
|
65
|
+
disposed: boolean;
|
|
66
|
+
}>;
|
|
67
|
+
private enqueue;
|
|
68
|
+
private drain;
|
|
69
|
+
private route;
|
|
70
|
+
private invokeListeners;
|
|
71
|
+
private invokeAction;
|
|
72
|
+
private matches;
|
|
73
|
+
private containsTarget;
|
|
74
|
+
private toLocal;
|
|
75
|
+
private path;
|
|
76
|
+
private focusFromPointer;
|
|
77
|
+
private target;
|
|
78
|
+
private snapshot;
|
|
79
|
+
private restore;
|
|
80
|
+
private stringInput;
|
|
81
|
+
private assertLive;
|
|
82
|
+
}
|
|
83
|
+
export {};
|
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
export interface RuntimeObject {
|
|
2
|
+
readonly [key: string]: RuntimeValue;
|
|
3
|
+
}
|
|
4
|
+
export type RuntimeValue = number | string | boolean | null | readonly RuntimeValue[] | RuntimeObject;
|
|
5
|
+
export type RuntimePath = readonly (string | number)[];
|
|
6
|
+
export interface RuntimeProperty {
|
|
7
|
+
readonly id: string;
|
|
8
|
+
readonly kind: 'number' | 'integer' | 'string' | 'boolean' | 'color' | 'trigger' | 'enum' | 'model' | 'list' | 'image' | 'artboard' | 'font' | 'blob';
|
|
9
|
+
readonly enum?: string;
|
|
10
|
+
readonly model?: string;
|
|
11
|
+
readonly item?: Readonly<{
|
|
12
|
+
kind: string;
|
|
13
|
+
enum?: string;
|
|
14
|
+
model?: string;
|
|
15
|
+
}>;
|
|
16
|
+
readonly defaultValue?: RuntimeValue;
|
|
17
|
+
readonly nullable?: boolean;
|
|
18
|
+
}
|
|
19
|
+
export interface RuntimeModel {
|
|
20
|
+
readonly id: string;
|
|
21
|
+
readonly properties: readonly RuntimeProperty[];
|
|
22
|
+
readonly defaultInstance?: string;
|
|
23
|
+
}
|
|
24
|
+
export interface RuntimeInstance {
|
|
25
|
+
readonly id: string;
|
|
26
|
+
readonly model: string;
|
|
27
|
+
readonly scope: 'default' | 'global' | 'local';
|
|
28
|
+
readonly values: Readonly<Record<string, RuntimeValue>>;
|
|
29
|
+
}
|
|
30
|
+
export interface RuntimeConverter {
|
|
31
|
+
readonly id: string;
|
|
32
|
+
readonly version: 1;
|
|
33
|
+
readonly operations: readonly Readonly<Record<string, unknown>>[];
|
|
34
|
+
}
|
|
35
|
+
export interface RuntimeBinding {
|
|
36
|
+
readonly id: string;
|
|
37
|
+
readonly target: string;
|
|
38
|
+
readonly targetPath: readonly string[];
|
|
39
|
+
readonly source: Readonly<{
|
|
40
|
+
mode: 'explicit' | 'default' | 'global' | 'auto';
|
|
41
|
+
instance?: string;
|
|
42
|
+
model?: string;
|
|
43
|
+
path: RuntimePath;
|
|
44
|
+
}>;
|
|
45
|
+
readonly converter?: string;
|
|
46
|
+
readonly direction: 'read' | 'write' | 'two-way';
|
|
47
|
+
}
|
|
48
|
+
export interface RuntimePropertyGroup {
|
|
49
|
+
readonly id: string;
|
|
50
|
+
readonly version: 1;
|
|
51
|
+
readonly operations: readonly Readonly<Record<string, unknown>>[];
|
|
52
|
+
}
|
|
53
|
+
export interface RuntimeDataComponent {
|
|
54
|
+
readonly id: string;
|
|
55
|
+
readonly stateful: true;
|
|
56
|
+
readonly model: string;
|
|
57
|
+
readonly exposedProperties?: readonly string[];
|
|
58
|
+
readonly exposedInputs?: readonly string[];
|
|
59
|
+
readonly exposedEvents?: readonly string[];
|
|
60
|
+
}
|
|
61
|
+
export interface RuntimeDataDocument {
|
|
62
|
+
readonly enums: readonly Readonly<{
|
|
63
|
+
id: string;
|
|
64
|
+
values: readonly Readonly<{
|
|
65
|
+
key: string;
|
|
66
|
+
value: number;
|
|
67
|
+
}>[];
|
|
68
|
+
}>[];
|
|
69
|
+
readonly models: readonly RuntimeModel[];
|
|
70
|
+
readonly instances: readonly RuntimeInstance[];
|
|
71
|
+
readonly converters: readonly RuntimeConverter[];
|
|
72
|
+
readonly propertyGroups: readonly RuntimePropertyGroup[];
|
|
73
|
+
readonly bindings: readonly RuntimeBinding[];
|
|
74
|
+
readonly components: readonly RuntimeDataComponent[];
|
|
75
|
+
}
|
|
76
|
+
export interface DataChange {
|
|
77
|
+
readonly sequence: number;
|
|
78
|
+
readonly transactionId: number;
|
|
79
|
+
readonly instance: string;
|
|
80
|
+
readonly path: RuntimePath;
|
|
81
|
+
readonly kind: 'set' | 'trigger' | 'list-insert' | 'list-remove' | 'list-move' | 'rebind';
|
|
82
|
+
readonly previous: RuntimeValue | undefined;
|
|
83
|
+
readonly value: RuntimeValue | undefined;
|
|
84
|
+
}
|
|
85
|
+
export interface DataObservationBatch {
|
|
86
|
+
readonly advance: number;
|
|
87
|
+
readonly changes: readonly DataChange[];
|
|
88
|
+
}
|
|
89
|
+
export interface DataSubscription {
|
|
90
|
+
unsubscribe(): void;
|
|
91
|
+
}
|
|
92
|
+
export interface CustomConverterPort {
|
|
93
|
+
begin(transactionId: number): void;
|
|
94
|
+
invoke(request: Readonly<{
|
|
95
|
+
protocol: string;
|
|
96
|
+
port: string;
|
|
97
|
+
value: RuntimeValue;
|
|
98
|
+
arguments: Readonly<Record<string, RuntimeValue>>;
|
|
99
|
+
}>): RuntimeValue;
|
|
100
|
+
commit(transactionId: number): void;
|
|
101
|
+
rollback(transactionId: number): void;
|
|
102
|
+
dispose?(): void;
|
|
103
|
+
}
|
|
104
|
+
export interface DataResourceHandle {
|
|
105
|
+
readonly value: unknown;
|
|
106
|
+
release(): void;
|
|
107
|
+
}
|
|
108
|
+
export interface DataResourcePort {
|
|
109
|
+
acquire(kind: 'image' | 'artboard' | 'font' | 'blob', id: string, signal: AbortSignal): Promise<DataResourceHandle>;
|
|
110
|
+
}
|
|
111
|
+
export type RuntimeHitArea = Readonly<Record<string, unknown>>;
|
|
112
|
+
export interface RuntimeInteractionTarget {
|
|
113
|
+
readonly id: string;
|
|
114
|
+
readonly parent?: string;
|
|
115
|
+
readonly component?: string;
|
|
116
|
+
readonly order: number;
|
|
117
|
+
readonly transform?: readonly [number, number, number, number, number, number];
|
|
118
|
+
readonly hitArea: RuntimeHitArea;
|
|
119
|
+
readonly clips?: readonly string[];
|
|
120
|
+
readonly enabled?: boolean;
|
|
121
|
+
readonly focusable?: boolean;
|
|
122
|
+
readonly tabIndex?: number;
|
|
123
|
+
}
|
|
124
|
+
export interface RuntimeInteractionAction extends Readonly<Record<string, unknown>> {
|
|
125
|
+
readonly kind: string;
|
|
126
|
+
}
|
|
127
|
+
export interface RuntimeInteractionListener {
|
|
128
|
+
readonly id: string;
|
|
129
|
+
readonly target: string;
|
|
130
|
+
readonly event: string;
|
|
131
|
+
readonly phases: readonly ('capture' | 'target' | 'bubble')[];
|
|
132
|
+
readonly pointerButton?: number;
|
|
133
|
+
readonly key?: string;
|
|
134
|
+
readonly keyPhase?: string;
|
|
135
|
+
readonly modifiers?: readonly string[];
|
|
136
|
+
readonly gamepad?: Readonly<{
|
|
137
|
+
index?: number;
|
|
138
|
+
control: string;
|
|
139
|
+
phase: string;
|
|
140
|
+
}>;
|
|
141
|
+
readonly semanticAction?: string;
|
|
142
|
+
readonly actions: readonly RuntimeInteractionAction[];
|
|
143
|
+
}
|
|
144
|
+
export interface RuntimeInteractionDocument {
|
|
145
|
+
readonly dragThreshold: number;
|
|
146
|
+
readonly targets: readonly RuntimeInteractionTarget[];
|
|
147
|
+
readonly listeners: readonly RuntimeInteractionListener[];
|
|
148
|
+
readonly limits?: Readonly<{
|
|
149
|
+
maxEventQueue?: number;
|
|
150
|
+
maxEventRecursion?: number;
|
|
151
|
+
maxPointers?: number;
|
|
152
|
+
}>;
|
|
153
|
+
}
|
|
154
|
+
export interface InteractionGeometryPort {
|
|
155
|
+
matrix?(target: string): readonly [number, number, number, number, number, number] | undefined;
|
|
156
|
+
visible?(target: string): boolean;
|
|
157
|
+
containsGeometry?(port: string, target: string, localPoint: readonly [number, number]): boolean;
|
|
158
|
+
}
|
|
159
|
+
export interface RoutedInteractionEvent {
|
|
160
|
+
readonly sequence: number;
|
|
161
|
+
readonly kind: string;
|
|
162
|
+
readonly phase: 'capture' | 'target' | 'bubble';
|
|
163
|
+
readonly target: string;
|
|
164
|
+
readonly currentTarget: string;
|
|
165
|
+
readonly pointerId?: number;
|
|
166
|
+
readonly point?: readonly [number, number];
|
|
167
|
+
readonly localPoint?: readonly [number, number];
|
|
168
|
+
readonly button?: number;
|
|
169
|
+
readonly key?: string;
|
|
170
|
+
readonly keyPhase?: string;
|
|
171
|
+
readonly modifiers?: readonly string[];
|
|
172
|
+
readonly text?: string;
|
|
173
|
+
readonly binding?: string;
|
|
174
|
+
readonly value?: RuntimeValue;
|
|
175
|
+
readonly gamepad?: Readonly<{
|
|
176
|
+
index: number;
|
|
177
|
+
control: string;
|
|
178
|
+
phase: string;
|
|
179
|
+
value: number;
|
|
180
|
+
}>;
|
|
181
|
+
readonly semanticAction?: string;
|
|
182
|
+
readonly name?: string;
|
|
183
|
+
readonly payload?: RuntimeValue;
|
|
184
|
+
}
|
|
185
|
+
export interface InteractionActionPort {
|
|
186
|
+
begin(transactionId: number): void;
|
|
187
|
+
invoke(action: RuntimeInteractionAction, event: RoutedInteractionEvent): void;
|
|
188
|
+
commit(transactionId: number): void;
|
|
189
|
+
rollback(transactionId: number): void;
|
|
190
|
+
dispose?(): void;
|
|
191
|
+
}
|
|
192
|
+
export interface RuntimeSemanticValue {
|
|
193
|
+
readonly kind: 'literal' | 'binding';
|
|
194
|
+
readonly value?: RuntimeValue;
|
|
195
|
+
readonly binding?: string;
|
|
196
|
+
}
|
|
197
|
+
export interface RuntimeSemanticNode {
|
|
198
|
+
readonly id: string;
|
|
199
|
+
readonly target: string;
|
|
200
|
+
readonly parent?: string;
|
|
201
|
+
readonly role: string;
|
|
202
|
+
readonly label?: RuntimeSemanticValue;
|
|
203
|
+
readonly value?: RuntimeSemanticValue;
|
|
204
|
+
readonly hint?: RuntimeSemanticValue;
|
|
205
|
+
readonly headingLevel?: number;
|
|
206
|
+
readonly traits?: readonly string[];
|
|
207
|
+
readonly state?: Readonly<Record<string, RuntimeSemanticValue>>;
|
|
208
|
+
readonly capabilities?: Readonly<Record<string, boolean>>;
|
|
209
|
+
readonly actions?: readonly string[];
|
|
210
|
+
readonly live?: string;
|
|
211
|
+
readonly readingOrder: number;
|
|
212
|
+
readonly navigationOrder: number;
|
|
213
|
+
}
|
|
214
|
+
export interface RuntimeSemanticsDocument {
|
|
215
|
+
readonly nodes: readonly RuntimeSemanticNode[];
|
|
216
|
+
readonly reducedMotion: Readonly<Record<string, unknown>>;
|
|
217
|
+
}
|
|
218
|
+
export interface SemanticSnapshotNode {
|
|
219
|
+
readonly id: string;
|
|
220
|
+
readonly target: string;
|
|
221
|
+
readonly parent?: string;
|
|
222
|
+
readonly role: string;
|
|
223
|
+
readonly label?: string;
|
|
224
|
+
readonly value?: string | number;
|
|
225
|
+
readonly hint?: string;
|
|
226
|
+
readonly headingLevel?: number;
|
|
227
|
+
readonly traits: readonly string[];
|
|
228
|
+
readonly state: Readonly<Record<string, boolean>>;
|
|
229
|
+
readonly capabilities: Readonly<Record<string, boolean>>;
|
|
230
|
+
readonly actions: readonly string[];
|
|
231
|
+
readonly live: string;
|
|
232
|
+
readonly readingOrder: number;
|
|
233
|
+
readonly navigationOrder: number;
|
|
234
|
+
}
|
|
235
|
+
export interface SemanticSnapshot {
|
|
236
|
+
readonly revision: number;
|
|
237
|
+
readonly nodes: readonly SemanticSnapshotNode[];
|
|
238
|
+
readonly readingOrder: readonly string[];
|
|
239
|
+
readonly navigationOrder: readonly string[];
|
|
240
|
+
readonly announcements: readonly Readonly<{
|
|
241
|
+
node: string;
|
|
242
|
+
mode: string;
|
|
243
|
+
text: string;
|
|
244
|
+
}>[];
|
|
245
|
+
}
|
|
246
|
+
export interface SemanticBindingPort {
|
|
247
|
+
read(binding: string): RuntimeValue;
|
|
248
|
+
subscribe?(listener: () => void): DataSubscription;
|
|
249
|
+
}
|
|
250
|
+
export interface SemanticHostBridge {
|
|
251
|
+
update(snapshot: SemanticSnapshot): void;
|
|
252
|
+
subscribeActions?(listener: (node: string, action: string) => void): DataSubscription;
|
|
253
|
+
dispose?(): void;
|
|
254
|
+
}
|
|
255
|
+
export interface SemanticActionPort {
|
|
256
|
+
invoke(target: string, action: string): void;
|
|
257
|
+
}
|
package/dist/animation.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export { Animation2DComponent } from './animation/Animation2DComponent';
|
|
2
|
-
export type { Animation2DComponentOptions, Animation2DRuntimeStats } from './animation/Animation2DComponent';
|
|
2
|
+
export type { Animation2DComponentOptions, Animation2DNodeOverride, Animation2DRuntimeStats } from './animation/Animation2DComponent';
|
|
3
|
+
export { InteractionRuntime } from './animation/interaction/InteractionRuntime';
|
|
4
|
+
export type { InteractionActionPort, InteractionGeometryPort, RoutedInteractionEvent, RuntimeInteractionAction, RuntimeInteractionDocument } from './animation/interaction/runtime-types';
|
|
3
5
|
export { Animation2DSystem } from './animation/Animation2DSystem';
|
|
4
6
|
export type { Animation2DSystemOptions } from './animation/Animation2DSystem';
|
|
5
7
|
export { Animation2DRenderSystem } from './animation/Animation2DRenderSystem';
|