@aura3d/editor-runtime 1.4.0 → 1.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.
Files changed (48) hide show
  1. package/package.json +36 -5
  2. package/src/AnimationSceneEditor.ts +0 -368
  3. package/src/AssetDropZone.ts +0 -144
  4. package/src/CameraPathEditor.ts +0 -223
  5. package/src/Command.ts +0 -11
  6. package/src/CommandHistory.ts +0 -136
  7. package/src/CurveEditor.ts +0 -152
  8. package/src/DiagnosticsOverlayModel.ts +0 -85
  9. package/src/EditorPluginHost.ts +0 -106
  10. package/src/EditorRuntime.ts +0 -349
  11. package/src/EditorStateModel.ts +0 -336
  12. package/src/EpisodeReviewPanel.ts +0 -236
  13. package/src/EventTrackEditor.ts +0 -169
  14. package/src/Gizmo.ts +0 -101
  15. package/src/HierarchyModel.ts +0 -57
  16. package/src/InspectorModel.ts +0 -71
  17. package/src/KeyframeEditor.ts +0 -214
  18. package/src/LocalizationAccessibilityFixtures.ts +0 -368
  19. package/src/MaterialVariantWorkflow.ts +0 -101
  20. package/src/MultiUserReviewWorkflow.ts +0 -229
  21. package/src/NonlinearAnimationEditor.ts +0 -262
  22. package/src/PickingService.ts +0 -174
  23. package/src/PlayModeBridge.ts +0 -27
  24. package/src/PrefabRegistry.ts +0 -164
  25. package/src/ProjectSerializer.ts +0 -200
  26. package/src/PropertyPanel.ts +0 -82
  27. package/src/RenderQueuePanel.ts +0 -106
  28. package/src/RotateGizmo.ts +0 -35
  29. package/src/ScaleGizmo.ts +0 -40
  30. package/src/SceneOutliner.ts +0 -78
  31. package/src/Selection.ts +0 -63
  32. package/src/ShaderGraphModel.ts +0 -254
  33. package/src/StaticExportRuntime.ts +0 -322
  34. package/src/TimelineEditorController.ts +0 -525
  35. package/src/TimelineModel.ts +0 -466
  36. package/src/TimelineRuntimeBridge.ts +0 -280
  37. package/src/TimelineTrackTypes.ts +0 -89
  38. package/src/TimelineUI.ts +0 -153
  39. package/src/TranslateGizmo.ts +0 -39
  40. package/src/VisualReviewDashboard.ts +0 -87
  41. package/src/commands/CreateNodeCommand.ts +0 -23
  42. package/src/commands/DeleteNodeCommand.ts +0 -74
  43. package/src/commands/ReparentNodeCommand.ts +0 -55
  44. package/src/commands/SetPropertyCommand.ts +0 -47
  45. package/src/commands/TransformCommand.ts +0 -107
  46. package/src/index.ts +0 -140
  47. package/tests/editor-runtime.test.ts +0 -1087
  48. package/tsconfig.json +0 -7
@@ -1,74 +0,0 @@
1
- import type { Command } from "../Command";
2
- import type { NodeContainer } from "./CreateNodeCommand";
3
-
4
- interface SceneNodeLike {
5
- readonly children: SceneNodeLike[];
6
- parent: SceneNodeLike | null;
7
- addChild(child: SceneNodeLike): unknown;
8
- removeChild(child: SceneNodeLike): boolean;
9
- removeFromParent(): boolean;
10
- markWorldDirty?(): void;
11
- }
12
-
13
- export class DeleteNodeCommand<TNode> implements Command {
14
- readonly name = "Delete Node";
15
- private sceneParent: SceneNodeLike | null = null;
16
- private sceneIndex = -1;
17
-
18
- constructor(
19
- private readonly container: NodeContainer<TNode>,
20
- private readonly node: TNode
21
- ) {}
22
-
23
- execute(): void {
24
- const sceneNode = asSceneNode(this.node);
25
- if (sceneNode) {
26
- this.sceneParent = sceneNode.parent;
27
- this.sceneIndex = this.sceneParent?.children.indexOf(sceneNode) ?? -1;
28
- if (this.sceneParent && sceneNode.removeFromParent()) {
29
- return;
30
- }
31
- this.sceneParent = null;
32
- this.sceneIndex = -1;
33
- }
34
-
35
- this.container.remove(this.node);
36
- }
37
-
38
- undo(): void {
39
- const sceneNode = asSceneNode(this.node);
40
- if (sceneNode && this.sceneParent) {
41
- this.sceneParent.addChild(sceneNode);
42
- if (this.sceneIndex >= 0) {
43
- const currentIndex = this.sceneParent.children.indexOf(sceneNode);
44
- if (currentIndex >= 0 && currentIndex !== this.sceneIndex) {
45
- this.sceneParent.children.splice(currentIndex, 1);
46
- this.sceneParent.children.splice(Math.min(this.sceneIndex, this.sceneParent.children.length), 0, sceneNode);
47
- sceneNode.markWorldDirty?.();
48
- }
49
- }
50
- return;
51
- }
52
-
53
- this.container.add(this.node);
54
- }
55
- }
56
-
57
- function asSceneNode(value: unknown): SceneNodeLike | undefined {
58
- if (!value || typeof value !== "object") {
59
- return undefined;
60
- }
61
-
62
- const candidate = value as Partial<SceneNodeLike>;
63
- if (
64
- Array.isArray(candidate.children) &&
65
- "parent" in candidate &&
66
- typeof candidate.addChild === "function" &&
67
- typeof candidate.removeChild === "function" &&
68
- typeof candidate.removeFromParent === "function"
69
- ) {
70
- return candidate as SceneNodeLike;
71
- }
72
-
73
- return undefined;
74
- }
@@ -1,55 +0,0 @@
1
- import type { Command } from "../Command";
2
-
3
- interface ParentLike<TNode> {
4
- readonly children: TNode[];
5
- addChild(child: TNode): unknown;
6
- removeChild(child: TNode): boolean;
7
- }
8
-
9
- interface ChildLike<TNode> {
10
- parent: ParentLike<TNode> | null;
11
- markWorldDirty?(): void;
12
- }
13
-
14
- export class ReparentNodeCommand<TNode extends ChildLike<TNode>> implements Command {
15
- readonly name = "Reparent Node";
16
- private readonly oldParent: ParentLike<TNode> | null;
17
- private readonly oldIndex: number;
18
- private readonly newIndex: number;
19
-
20
- constructor(
21
- private readonly node: TNode,
22
- private readonly newParent: ParentLike<TNode>,
23
- newIndex?: number
24
- ) {
25
- this.oldParent = node.parent;
26
- this.oldIndex = this.oldParent?.children.indexOf(node) ?? -1;
27
- this.newIndex = newIndex ?? newParent.children.length;
28
- }
29
-
30
- execute(): void {
31
- this.move(this.newParent, this.newIndex);
32
- }
33
-
34
- undo(): void {
35
- if (!this.oldParent) {
36
- this.node.parent?.removeChild(this.node);
37
- return;
38
- }
39
- this.move(this.oldParent, this.oldIndex);
40
- }
41
-
42
- private move(parent: ParentLike<TNode>, index: number): void {
43
- if (this.node.parent !== parent) {
44
- this.node.parent?.removeChild(this.node);
45
- parent.addChild(this.node);
46
- }
47
- const currentIndex = parent.children.indexOf(this.node);
48
- const targetIndex = Math.max(0, Math.min(index, parent.children.length - 1));
49
- if (currentIndex >= 0 && currentIndex !== targetIndex) {
50
- parent.children.splice(currentIndex, 1);
51
- parent.children.splice(targetIndex, 0, this.node);
52
- this.node.markWorldDirty?.();
53
- }
54
- }
55
- }
@@ -1,47 +0,0 @@
1
- import type { Command } from "../Command";
2
-
3
- export class SetPropertyCommand<T extends object> implements Command {
4
- readonly name = "Set Property";
5
- private readonly before: unknown;
6
-
7
- constructor(
8
- private readonly target: T,
9
- private readonly path: readonly string[],
10
- private readonly after: unknown
11
- ) {
12
- if (path.length === 0) {
13
- throw new Error("Property path cannot be empty");
14
- }
15
- this.before = this.read();
16
- }
17
-
18
- execute(): void {
19
- this.write(this.after);
20
- }
21
-
22
- undo(): void {
23
- this.write(this.before);
24
- }
25
-
26
- private read(): unknown {
27
- let cursor: unknown = this.target;
28
- for (const segment of this.path) {
29
- if (cursor === null || typeof cursor !== "object" || !(segment in cursor)) {
30
- throw new Error(`Invalid property path: ${this.path.join(".")}`);
31
- }
32
- cursor = (cursor as Record<string, unknown>)[segment];
33
- }
34
- return cursor;
35
- }
36
-
37
- private write(value: unknown): void {
38
- let cursor: unknown = this.target;
39
- for (const segment of this.path.slice(0, -1)) {
40
- if (cursor === null || typeof cursor !== "object" || !(segment in cursor)) {
41
- throw new Error(`Invalid property path: ${this.path.join(".")}`);
42
- }
43
- cursor = (cursor as Record<string, unknown>)[segment];
44
- }
45
- (cursor as Record<string, unknown>)[this.path[this.path.length - 1]] = value;
46
- }
47
- }
@@ -1,107 +0,0 @@
1
- import type { Command } from "../Command";
2
-
3
- export interface TransformLike {
4
- position: { x: number; y: number; z: number };
5
- rotation?: { x: number; y: number; z: number; w?: number };
6
- scale?: { x: number; y: number; z: number };
7
- }
8
-
9
- export interface SceneTransformTargetLike {
10
- readonly transform: {
11
- readonly position: [number, number, number];
12
- readonly rotation: [number, number, number, number];
13
- readonly scale: [number, number, number];
14
- setPosition(x: number, y: number, z: number): unknown;
15
- setRotation(x: number, y: number, z: number, w: number): unknown;
16
- setScale(x: number, y: number, z: number): unknown;
17
- };
18
- }
19
-
20
- export type TransformTarget = TransformLike | SceneTransformTargetLike;
21
-
22
- function cloneTransform(transform: TransformLike): TransformLike {
23
- return {
24
- position: { ...transform.position },
25
- rotation: transform.rotation ? { ...transform.rotation } : undefined,
26
- scale: transform.scale ? { ...transform.scale } : undefined
27
- };
28
- }
29
-
30
- function readTransform(target: TransformTarget): TransformLike {
31
- if ("transform" in target) {
32
- return {
33
- position: {
34
- x: target.transform.position[0],
35
- y: target.transform.position[1],
36
- z: target.transform.position[2]
37
- },
38
- rotation: {
39
- x: target.transform.rotation[0],
40
- y: target.transform.rotation[1],
41
- z: target.transform.rotation[2],
42
- w: target.transform.rotation[3]
43
- },
44
- scale: {
45
- x: target.transform.scale[0],
46
- y: target.transform.scale[1],
47
- z: target.transform.scale[2]
48
- }
49
- };
50
- }
51
- return cloneTransform(target);
52
- }
53
-
54
- function applyTransform(target: TransformTarget, transform: TransformLike): void {
55
- if ("transform" in target) {
56
- target.transform.setPosition(transform.position.x, transform.position.y, transform.position.z);
57
- if (transform.rotation) {
58
- target.transform.setRotation(
59
- transform.rotation.x,
60
- transform.rotation.y,
61
- transform.rotation.z,
62
- transform.rotation.w ?? 1
63
- );
64
- }
65
- if (transform.scale) {
66
- target.transform.setScale(transform.scale.x, transform.scale.y, transform.scale.z);
67
- }
68
- return;
69
- }
70
- target.position = { ...transform.position };
71
- target.rotation = transform.rotation ? { ...transform.rotation } : undefined;
72
- target.scale = transform.scale ? { ...transform.scale } : undefined;
73
- }
74
-
75
- export class TransformCommand implements Command {
76
- readonly name = "Transform";
77
- private readonly before: TransformLike;
78
- private readonly after: TransformLike;
79
-
80
- constructor(
81
- private readonly target: TransformTarget,
82
- next: TransformLike,
83
- before?: TransformLike
84
- ) {
85
- this.before = cloneTransform(before ?? readTransform(target));
86
- this.after = cloneTransform(next);
87
- }
88
-
89
- execute(): void {
90
- applyTransform(this.target, this.after);
91
- }
92
-
93
- undo(): void {
94
- applyTransform(this.target, this.before);
95
- }
96
-
97
- canMerge(next: Command): boolean {
98
- return next instanceof TransformCommand && next.target === this.target;
99
- }
100
-
101
- merge(next: Command): Command {
102
- if (!(next instanceof TransformCommand) || next.target !== this.target) {
103
- throw new Error("TransformCommand can only merge commands for the same target.");
104
- }
105
- return new TransformCommand(this.target, next.after, this.before);
106
- }
107
- }
package/src/index.ts DELETED
@@ -1,140 +0,0 @@
1
- export type { Command, CommandContext } from "./Command";
2
- export { CommandHistory, CommandTransactionError } from "./CommandHistory";
3
- export { AssetDropZone, readAssetFromDataTransfer, serializeAssetForDrag } from "./AssetDropZone";
4
- export type { AssetDropPlacement, AssetDropResult, AssetDropZoneOptions, AnimationAssetCategory, AnimationEditorAssetReference } from "./AssetDropZone";
5
- export { CameraPathEditor, createCameraPathEditor, readCameraPathKeyframes } from "./CameraPathEditor";
6
- export type { EditorCameraPathEvidence, EditorCameraPathKeyframe, EditorCameraPathSample, EditorCameraVector3 } from "./CameraPathEditor";
7
- export { AnimationSceneEditor, createAnimationSceneNode } from "./AnimationSceneEditor";
8
- export type { AnimationSceneEditorOptions, AnimationSceneEditorSnapshot, AnimationSceneEpisodeSnapshot, AnimationSceneEpisodeState, AnimationSceneNode, AnimationSceneTransform } from "./AnimationSceneEditor";
9
- export { CurveEditor } from "./CurveEditor";
10
- export type { TimelineCurveEvidence, TimelineCurvePoint, TimelineCurveSample } from "./CurveEditor";
11
- export { DiagnosticsOverlayModel } from "./DiagnosticsOverlayModel";
12
- export type { EditorDiagnosticsInput, EditorDiagnosticsResource, EditorDiagnosticsSnapshot } from "./DiagnosticsOverlayModel";
13
- export { EditorRuntime } from "./EditorRuntime";
14
- export type { EditorMode, EditorRuntimeSnapshot } from "./EditorRuntime";
15
- export { EventTrackEditor, createEventTrackEditor } from "./EventTrackEditor";
16
- export type { AddEventMarkerOptions, EventMarkerView, EventTrackEditorOptions, EventTrackLane } from "./EventTrackEditor";
17
- export { EpisodeReviewPanel, createEpisodeReviewPanel } from "./EpisodeReviewPanel";
18
- export type { EpisodeReviewManualVisemeEdit, EpisodeReviewNote, EpisodeReviewPanelSnapshot, EpisodeReviewPanelState, EpisodeReviewRejectedFrame, EpisodeReviewStatus, EpisodeReviewWaveformLane } from "./EpisodeReviewPanel";
19
- export { EditorStateModel, createMemoryEditorStateStorage } from "./EditorStateModel";
20
- export type { EditorGridSnapSettings, EditorStateChange, EditorStateSnapshot, EditorStateStorage, EditorViewportSettings } from "./EditorStateModel";
21
- export { EditorPluginHost } from "./EditorPluginHost";
22
- export type {
23
- EditorImporterContribution,
24
- EditorPanelContribution,
25
- EditorPlugin,
26
- EditorPluginSnapshot,
27
- EditorScriptingNodeContribution,
28
- EditorToolContribution
29
- } from "./EditorPluginHost";
30
- export { Gizmo } from "./Gizmo";
31
- export { DEFAULT_GIZMO_SETTINGS, normalizeGizmoSettings } from "./Gizmo";
32
- export type { GizmoAxis, GizmoDrag, GizmoHandle, GizmoHit, GizmoPivotMode, GizmoPlaneAxis, GizmoSettings, GizmoSpaceMode } from "./Gizmo";
33
- export { HierarchyModel } from "./HierarchyModel";
34
- export type { HierarchyLikeNode, HierarchyNodeDescriptor } from "./HierarchyModel";
35
- export { InspectorModel } from "./InspectorModel";
36
- export type { InspectorEditableValue, InspectorProperty } from "./InspectorModel";
37
- export { KeyframeEditor, encodeTimelineKeyframes, readTimelineKeyframes, timelineKeyframesByProperty } from "./KeyframeEditor";
38
- export type {
39
- CreateTimelineKeyframeOptions,
40
- PasteTimelineKeyframesOptions,
41
- TimelineBezierHandle,
42
- TimelineKeyframe,
43
- TimelineKeyframeInterpolation,
44
- TimelineKeyframeValue
45
- } from "./KeyframeEditor";
46
- export { sampleLocalizationAccessibilityFixture } from "./LocalizationAccessibilityFixtures";
47
- export type {
48
- EditorAccessibilityElementSample,
49
- EditorAccessibilityRole,
50
- EditorLocalizationAccessibilityFixture,
51
- EditorLocalizedStringSample,
52
- EditorLocaleDescriptor,
53
- EditorLocaleDirection,
54
- EditorPluralCategory
55
- } from "./LocalizationAccessibilityFixtures";
56
- export { MaterialVariantWorkflow } from "./MaterialVariantWorkflow";
57
- export type { MaterialVariantRenderOptions, MaterialVariantState } from "./MaterialVariantWorkflow";
58
- export { MultiUserReviewWorkflow, createMultiUserReviewWorkflow } from "./MultiUserReviewWorkflow";
59
- export type {
60
- MultiUserReviewWorkflowSnapshot,
61
- MultiUserReviewWorkflowState,
62
- ReviewDecision,
63
- ReviewDecisionStatus,
64
- ReviewParticipant,
65
- ReviewParticipantRole,
66
- ReviewThread,
67
- ReviewWorkflowStatus
68
- } from "./MultiUserReviewWorkflow";
69
- export { NonlinearAnimationEditor, createNonlinearAnimationEditor } from "./NonlinearAnimationEditor";
70
- export type {
71
- NonlinearAnimationEditorSnapshot,
72
- NonlinearAnimationEditorState,
73
- NonlinearBinAsset,
74
- NonlinearBinAssetKind,
75
- NonlinearSequenceConfig,
76
- NonlinearSequenceSnapshot
77
- } from "./NonlinearAnimationEditor";
78
- export { PickingService } from "./PickingService";
79
- export type { EditorPickHit, EditorPickTarget, EditorPickingColorId, EditorPickingEvidenceSnapshot } from "./PickingService";
80
- export { PlayModeBridge } from "./PlayModeBridge";
81
- export type { SnapshotAdapter } from "./PlayModeBridge";
82
- export { PrefabRegistry, validatePrefab } from "./PrefabRegistry";
83
- export type { CreatePrefabOptions, EditorPrefab, EditorPrefabNodeBase, EditorPrefabSchemaVersion, InstantiatePrefabOptions } from "./PrefabRegistry";
84
- export { PropertyPanel } from "./PropertyPanel";
85
- export type { PropertyPanelField, PropertyPanelOptions } from "./PropertyPanel";
86
- export { RotateGizmo } from "./RotateGizmo";
87
- export { RenderQueuePanel, createRenderQueuePanel } from "./RenderQueuePanel";
88
- export type { RenderQueuePanelItem, RenderQueuePanelItemStatus, RenderQueuePanelSnapshot } from "./RenderQueuePanel";
89
- export { ScaleGizmo } from "./ScaleGizmo";
90
- export { SceneOutliner } from "./SceneOutliner";
91
- export type { SceneOutlinerItem, SceneOutlinerOptions } from "./SceneOutliner";
92
- export { Selection } from "./Selection";
93
- export type { SelectionChange, SelectionId, SelectionListener } from "./Selection";
94
- export { createOldBranchShaderGraphFixture } from "./ShaderGraphModel";
95
- export type { ShaderGraphDiagnostic, ShaderGraphEdge, ShaderGraphFixture, ShaderGraphNode, ShaderGraphPort, ShaderGraphValueType } from "./ShaderGraphModel";
96
- export { createStaticExportHtml, createStaticExportRuntime } from "./StaticExportRuntime";
97
- export type { StaticExportHtmlOptions, StaticExportRuntimeOptions } from "./StaticExportRuntime";
98
- export * from "./ProjectSerializer.js";
99
- export {
100
- TimelineRuntimeBridge,
101
- createTimelineRuntimeBridge
102
- } from "./TimelineRuntimeBridge";
103
- export type {
104
- TimelineRuntimeAnimationApplication,
105
- TimelineRuntimeBindingConfig,
106
- TimelineRuntimeBridgeConfig,
107
- TimelineRuntimeBridgeSnapshot,
108
- TimelineRuntimeSignalDispatch,
109
- TimelineRuntimeTarget,
110
- TimelineRuntimeTargetSnapshot
111
- } from "./TimelineRuntimeBridge";
112
- export { TranslateGizmo } from "./TranslateGizmo";
113
- export { TimelineEditorController } from "./TimelineEditorController";
114
- export type { TimelineEditorClipboard, TimelineEditorControllerOptions, TimelineEditorSnapshot, TimelineRoutePlaybackBinding } from "./TimelineEditorController";
115
- export { TimelineClip, TimelineModel, TimelineTrack } from "./TimelineModel";
116
- export type {
117
- TimelineActiveClipSnapshot,
118
- TimelineClipBlendMode,
119
- TimelineClipConfig,
120
- TimelineEasingName,
121
- TimelineLoopMode,
122
- TimelineModelConfig,
123
- TimelineSignalEventSnapshot,
124
- TimelineSnapshot,
125
- TimelineTrackConfig,
126
- TimelineTrackSnapshot
127
- } from "./TimelineModel";
128
- export { TIMELINE_TRACK_TYPES, createTimelineTrackConfig, timelineTrackKindFromConfig, timelineTrackTypeDefinition } from "./TimelineTrackTypes";
129
- export type { CreateTimelineTrackConfigOptions, TimelineEditorTrackKind, TimelineTrackTypeDefinition } from "./TimelineTrackTypes";
130
- export { TimelineUI, renderTimelineUI } from "./TimelineUI";
131
- export type { TimelineUIOptions, TimelineUIRenderResult } from "./TimelineUI";
132
- export { VisualReviewDashboard, createVisualReviewDashboard } from "./VisualReviewDashboard";
133
- export type { VisualReviewDashboardPackage, VisualReviewDashboardSnapshot } from "./VisualReviewDashboard";
134
- export { CreateNodeCommand } from "./commands/CreateNodeCommand";
135
- export type { NodeContainer } from "./commands/CreateNodeCommand";
136
- export { DeleteNodeCommand } from "./commands/DeleteNodeCommand";
137
- export { ReparentNodeCommand } from "./commands/ReparentNodeCommand";
138
- export { SetPropertyCommand } from "./commands/SetPropertyCommand";
139
- export { TransformCommand } from "./commands/TransformCommand";
140
- export type { SceneTransformTargetLike, TransformLike, TransformTarget } from "./commands/TransformCommand";