@vizij/runtime-react 0.3.1 → 0.4.1
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 +1 -0
- package/dist/index.cjs +295 -50
- package/dist/index.d.cts +47 -2
- package/dist/index.d.ts +47 -2
- package/dist/index.js +292 -50
- package/package.json +4 -4
package/dist/index.d.cts
CHANGED
|
@@ -4,7 +4,7 @@ import { ReactNode, PropsWithChildren } from 'react';
|
|
|
4
4
|
import { ValueJSON } from '@vizij/value-json';
|
|
5
5
|
import { IrGraph } from '@vizij/node-graph-authoring';
|
|
6
6
|
import { RawValue, AnimatableValue } from '@vizij/utils';
|
|
7
|
-
import { World, VizijBundleExtension, VizijProps } from '@vizij/render';
|
|
7
|
+
import { World, VizijBundleExtension, VizijStarredItem, VizijProps } from '@vizij/render';
|
|
8
8
|
|
|
9
9
|
/** Value shape hint. Accepted through the public surface, unused by the device. */
|
|
10
10
|
type ShapeJSON = Record<string, unknown>;
|
|
@@ -156,6 +156,12 @@ type VizijAssetBundle = {
|
|
|
156
156
|
};
|
|
157
157
|
animations?: VizijAnimationAsset[];
|
|
158
158
|
programs?: VizijProgramAsset[];
|
|
159
|
+
/**
|
|
160
|
+
* Designer-curated set of starred drivers/poses, resolved from the loaded
|
|
161
|
+
* bundle's `starred` section. References real functionality by stable id
|
|
162
|
+
* (driver = standard-input id, pose = pose id).
|
|
163
|
+
*/
|
|
164
|
+
starred?: VizijStarredItem[];
|
|
159
165
|
initialInputs?: Record<string, ValueJSON>;
|
|
160
166
|
metadata?: Record<string, unknown>;
|
|
161
167
|
bundle?: VizijBundleExtension | null;
|
|
@@ -394,4 +400,43 @@ declare function resolveFaceControls(assetBundle: VizijAssetBundle, runtimeFaceI
|
|
|
394
400
|
declare function mapNormalizedControlValue(control: FaceScalarControl, normalizedValue: number): number;
|
|
395
401
|
declare function mapUnitControlValue(control: FaceScalarControl, unitValue: number): number;
|
|
396
402
|
|
|
397
|
-
|
|
403
|
+
/**
|
|
404
|
+
* Compose several Vizij graph specs into the ONE graph an Arora device runs.
|
|
405
|
+
*
|
|
406
|
+
* The device runs a single ProcessingGraph as its behavior, so the separate
|
|
407
|
+
* graph sources become a union of nodes and edges here. Sources and their
|
|
408
|
+
* provenance (see `graphSourcesRef` in VizijRuntimeProvider for details):
|
|
409
|
+
* the **rig** graph shipped in the loaded GLB/asset bundle, the bundle's
|
|
410
|
+
* **pose-driver** graph, and one source per **playing program** (bundle
|
|
411
|
+
* programs and the authoring motiongraph, which publishes the editor's
|
|
412
|
+
* graph as a program). Node ids
|
|
413
|
+
* are prefixed `${sourceId}::` so sources can't collide; `params.path` is
|
|
414
|
+
* deliberately NOT prefixed — path identity on the device's shared store is
|
|
415
|
+
* the cross-graph contract (a pose output written to a store path is read by
|
|
416
|
+
* a rig input node with the same path on the next tick).
|
|
417
|
+
*
|
|
418
|
+
* Output-path collisions across sources (two `output` nodes writing one
|
|
419
|
+
* path) are warned and resolved last-writer-wins by evaluation order; there
|
|
420
|
+
* is no additive merge for that case yet, and current bundles don't collide.
|
|
421
|
+
* If a real bundle does, insert an explicit combiner node here instead of
|
|
422
|
+
* widening this warning.
|
|
423
|
+
*/
|
|
424
|
+
type SpecRecord = Record<string, unknown>;
|
|
425
|
+
/** A graph spec treated structurally (same tolerance as `utils/graph.ts`). */
|
|
426
|
+
type ComposableSpec = SpecRecord;
|
|
427
|
+
interface GraphSource {
|
|
428
|
+
/** Stable id of the source graph (e.g. "rig", "pose", a program id). */
|
|
429
|
+
sourceId: string;
|
|
430
|
+
spec: ComposableSpec;
|
|
431
|
+
}
|
|
432
|
+
/**
|
|
433
|
+
* Union `sources` into one spec. Later sources evaluate after earlier ones,
|
|
434
|
+
* so on an output-path collision the last source wins (warned).
|
|
435
|
+
*/
|
|
436
|
+
declare function composeGraphSpecs(sources: GraphSource[]): ComposableSpec;
|
|
437
|
+
|
|
438
|
+
declare function collectInputPathMap(spec: GraphRegistrationConfig["spec"]): Record<string, string>;
|
|
439
|
+
|
|
440
|
+
declare function resolveAnimationBridgeOutputPaths(channel: string, faceId?: string, rigInputMap?: Record<string, string>): string[];
|
|
441
|
+
|
|
442
|
+
export { type AnimateValueOptions, type AnimationClipLike, type AnimationKeyframeLike, type AnimationPlaybackState, type AnimationTrackLike, type ComposableSpec, EMOTION_POSE_KEYS, EXPRESSIVE_EMOTION_POSE_KEYS, type FaceScalarControl, type GraphSource, type InputDriverContext, type InputDriverFactory, type InputDriverLifecycle, POSE_WEIGHT_INPUT_PATH_PREFIX, type PlayAnimationOptions, type PoseDefinition, type PoseGroupDefinition, type PoseRigConfig, type ProgramPlaybackState, type RootBounds, type RuntimeGraphBundle, type RuntimeOutputWrite, type RuntimeUpdatePlan, type RuntimeUpdateTier, type StopProgramOptions, VISEME_POSE_KEYS, type VizijAnimationAsset, type VizijAssetBundle, type VizijGlbAsset, type VizijGraphAsset, type VizijProgramAsset, VizijRuntimeFace, type VizijRuntimeFaceProps, VizijRuntimeProvider, type VizijRuntimeProviderProps, type VizijRuntimeStatus, buildPoseWeightInputPathSegment, buildPoseWeightPathMap, buildPoseWeightRelativePath, buildRigInputPath, buildSemanticPoseWeightPathMap, collectInputPathMap, composeGraphSpecs, filterPosesBySemanticKind, getPoseSemanticKey, mapNormalizedControlValue, mapUnitControlValue, normalizePoseSemanticKey, resolveAnimationBridgeOutputPaths, resolveFaceControls, resolvePoseMembership, resolvePoseSemantics, resolveRuntimeUpdatePlan, useOptionalVizijRuntime, useRigInput, useVizijOutputs, useVizijRuntime };
|
package/dist/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { ReactNode, PropsWithChildren } from 'react';
|
|
|
4
4
|
import { ValueJSON } from '@vizij/value-json';
|
|
5
5
|
import { IrGraph } from '@vizij/node-graph-authoring';
|
|
6
6
|
import { RawValue, AnimatableValue } from '@vizij/utils';
|
|
7
|
-
import { World, VizijBundleExtension, VizijProps } from '@vizij/render';
|
|
7
|
+
import { World, VizijBundleExtension, VizijStarredItem, VizijProps } from '@vizij/render';
|
|
8
8
|
|
|
9
9
|
/** Value shape hint. Accepted through the public surface, unused by the device. */
|
|
10
10
|
type ShapeJSON = Record<string, unknown>;
|
|
@@ -156,6 +156,12 @@ type VizijAssetBundle = {
|
|
|
156
156
|
};
|
|
157
157
|
animations?: VizijAnimationAsset[];
|
|
158
158
|
programs?: VizijProgramAsset[];
|
|
159
|
+
/**
|
|
160
|
+
* Designer-curated set of starred drivers/poses, resolved from the loaded
|
|
161
|
+
* bundle's `starred` section. References real functionality by stable id
|
|
162
|
+
* (driver = standard-input id, pose = pose id).
|
|
163
|
+
*/
|
|
164
|
+
starred?: VizijStarredItem[];
|
|
159
165
|
initialInputs?: Record<string, ValueJSON>;
|
|
160
166
|
metadata?: Record<string, unknown>;
|
|
161
167
|
bundle?: VizijBundleExtension | null;
|
|
@@ -394,4 +400,43 @@ declare function resolveFaceControls(assetBundle: VizijAssetBundle, runtimeFaceI
|
|
|
394
400
|
declare function mapNormalizedControlValue(control: FaceScalarControl, normalizedValue: number): number;
|
|
395
401
|
declare function mapUnitControlValue(control: FaceScalarControl, unitValue: number): number;
|
|
396
402
|
|
|
397
|
-
|
|
403
|
+
/**
|
|
404
|
+
* Compose several Vizij graph specs into the ONE graph an Arora device runs.
|
|
405
|
+
*
|
|
406
|
+
* The device runs a single ProcessingGraph as its behavior, so the separate
|
|
407
|
+
* graph sources become a union of nodes and edges here. Sources and their
|
|
408
|
+
* provenance (see `graphSourcesRef` in VizijRuntimeProvider for details):
|
|
409
|
+
* the **rig** graph shipped in the loaded GLB/asset bundle, the bundle's
|
|
410
|
+
* **pose-driver** graph, and one source per **playing program** (bundle
|
|
411
|
+
* programs and the authoring motiongraph, which publishes the editor's
|
|
412
|
+
* graph as a program). Node ids
|
|
413
|
+
* are prefixed `${sourceId}::` so sources can't collide; `params.path` is
|
|
414
|
+
* deliberately NOT prefixed — path identity on the device's shared store is
|
|
415
|
+
* the cross-graph contract (a pose output written to a store path is read by
|
|
416
|
+
* a rig input node with the same path on the next tick).
|
|
417
|
+
*
|
|
418
|
+
* Output-path collisions across sources (two `output` nodes writing one
|
|
419
|
+
* path) are warned and resolved last-writer-wins by evaluation order; there
|
|
420
|
+
* is no additive merge for that case yet, and current bundles don't collide.
|
|
421
|
+
* If a real bundle does, insert an explicit combiner node here instead of
|
|
422
|
+
* widening this warning.
|
|
423
|
+
*/
|
|
424
|
+
type SpecRecord = Record<string, unknown>;
|
|
425
|
+
/** A graph spec treated structurally (same tolerance as `utils/graph.ts`). */
|
|
426
|
+
type ComposableSpec = SpecRecord;
|
|
427
|
+
interface GraphSource {
|
|
428
|
+
/** Stable id of the source graph (e.g. "rig", "pose", a program id). */
|
|
429
|
+
sourceId: string;
|
|
430
|
+
spec: ComposableSpec;
|
|
431
|
+
}
|
|
432
|
+
/**
|
|
433
|
+
* Union `sources` into one spec. Later sources evaluate after earlier ones,
|
|
434
|
+
* so on an output-path collision the last source wins (warned).
|
|
435
|
+
*/
|
|
436
|
+
declare function composeGraphSpecs(sources: GraphSource[]): ComposableSpec;
|
|
437
|
+
|
|
438
|
+
declare function collectInputPathMap(spec: GraphRegistrationConfig["spec"]): Record<string, string>;
|
|
439
|
+
|
|
440
|
+
declare function resolveAnimationBridgeOutputPaths(channel: string, faceId?: string, rigInputMap?: Record<string, string>): string[];
|
|
441
|
+
|
|
442
|
+
export { type AnimateValueOptions, type AnimationClipLike, type AnimationKeyframeLike, type AnimationPlaybackState, type AnimationTrackLike, type ComposableSpec, EMOTION_POSE_KEYS, EXPRESSIVE_EMOTION_POSE_KEYS, type FaceScalarControl, type GraphSource, type InputDriverContext, type InputDriverFactory, type InputDriverLifecycle, POSE_WEIGHT_INPUT_PATH_PREFIX, type PlayAnimationOptions, type PoseDefinition, type PoseGroupDefinition, type PoseRigConfig, type ProgramPlaybackState, type RootBounds, type RuntimeGraphBundle, type RuntimeOutputWrite, type RuntimeUpdatePlan, type RuntimeUpdateTier, type StopProgramOptions, VISEME_POSE_KEYS, type VizijAnimationAsset, type VizijAssetBundle, type VizijGlbAsset, type VizijGraphAsset, type VizijProgramAsset, VizijRuntimeFace, type VizijRuntimeFaceProps, VizijRuntimeProvider, type VizijRuntimeProviderProps, type VizijRuntimeStatus, buildPoseWeightInputPathSegment, buildPoseWeightPathMap, buildPoseWeightRelativePath, buildRigInputPath, buildSemanticPoseWeightPathMap, collectInputPathMap, composeGraphSpecs, filterPosesBySemanticKind, getPoseSemanticKey, mapNormalizedControlValue, mapUnitControlValue, normalizePoseSemanticKey, resolveAnimationBridgeOutputPaths, resolveFaceControls, resolvePoseMembership, resolvePoseSemantics, resolveRuntimeUpdatePlan, useOptionalVizijRuntime, useRigInput, useVizijOutputs, useVizijRuntime };
|