@3driseai/3drise-core 1.0.18 → 1.0.19
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/dist/services/AnimationsManager.d.ts +6 -106
- package/dist/services/AnimationsManager.d.ts.map +1 -1
- package/dist/services/AnimationsManager.js +5 -391
- package/dist/services/SceneActions.d.ts +17 -3
- package/dist/services/SceneActions.d.ts.map +1 -1
- package/dist/services/SceneActions.js +12 -8
- package/dist/services/index.d.ts +1 -2
- package/dist/services/index.d.ts.map +1 -1
- package/dist/types/actions.d.ts +8 -1
- package/dist/types/actions.d.ts.map +1 -1
- package/dist/types/actions.js +0 -4
- package/dist/types/animations.d.ts +0 -51
- package/dist/types/animations.d.ts.map +1 -1
- package/dist/types/objectSettings.d.ts +52 -14
- package/dist/types/objectSettings.d.ts.map +1 -1
- package/dist/types/types.d.ts +3 -2
- package/dist/types/types.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,114 +1,14 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { PathConfig } from "../types/animations";
|
|
2
2
|
import type { Vector3Array } from "../types/scene3d";
|
|
3
|
-
export type AnimationEventType = 'sequenceStart' | 'sequenceEnd' | 'stepStart' | 'stepEnd';
|
|
4
|
-
export interface AnimationEvent {
|
|
5
|
-
type: AnimationEventType;
|
|
6
|
-
sequenceId: string;
|
|
7
|
-
sequence: AnimationSequence;
|
|
8
|
-
step?: TransitionStep;
|
|
9
|
-
stepIndex?: number;
|
|
10
|
-
}
|
|
11
|
-
type AnimationEventListener = (event: AnimationEvent) => void;
|
|
12
3
|
/**
|
|
13
|
-
* AnimationsManager
|
|
14
|
-
*
|
|
15
|
-
*
|
|
4
|
+
* AnimationsManager — the path registry (PathCreator, path animation) and the
|
|
5
|
+
* progress helpers per-object animations use.
|
|
6
|
+
*
|
|
7
|
+
* Sequence playback moved to Animations V2 (viewer `animationsV2/ClipsRuntime`);
|
|
8
|
+
* the V1 sequence player, its GSAP timelines and its step events are gone.
|
|
16
9
|
*/
|
|
17
10
|
declare class AnimationsManager {
|
|
18
|
-
private activeSequences;
|
|
19
11
|
private paths;
|
|
20
|
-
private timelines;
|
|
21
|
-
private eventListeners;
|
|
22
|
-
constructor();
|
|
23
|
-
/**
|
|
24
|
-
* Add an event listener
|
|
25
|
-
*/
|
|
26
|
-
on(eventType: AnimationEventType, listener: AnimationEventListener): void;
|
|
27
|
-
/**
|
|
28
|
-
* Remove an event listener
|
|
29
|
-
*/
|
|
30
|
-
off(eventType: AnimationEventType, listener: AnimationEventListener): void;
|
|
31
|
-
/**
|
|
32
|
-
* Emit an event
|
|
33
|
-
*/
|
|
34
|
-
private emit;
|
|
35
|
-
/**
|
|
36
|
-
* @deprecated Sequences are now managed in Redux. Use playSequence(sequence) directly.
|
|
37
|
-
* This method is kept for backwards compatibility during migration.
|
|
38
|
-
*/
|
|
39
|
-
addSequence(sequence: AnimationSequence): AnimationSequence;
|
|
40
|
-
/**
|
|
41
|
-
* @deprecated Sequences are now managed in Redux.
|
|
42
|
-
*/
|
|
43
|
-
removeSequence(sequenceId: string): void;
|
|
44
|
-
/**
|
|
45
|
-
* Get an actively playing sequence's runtime state
|
|
46
|
-
*/
|
|
47
|
-
getSequence(sequenceId: string): AnimationSequence | undefined;
|
|
48
|
-
/**
|
|
49
|
-
* @deprecated Sequences are now managed in Redux. Use Redux selectors instead.
|
|
50
|
-
*/
|
|
51
|
-
getAllSequences(): AnimationSequence[];
|
|
52
|
-
/**
|
|
53
|
-
* Execute a single animation step with multiple transitions
|
|
54
|
-
* Returns a GSAP timeline for this step
|
|
55
|
-
*/
|
|
56
|
-
private executeStep;
|
|
57
|
-
/**
|
|
58
|
-
* Play an animation sequence
|
|
59
|
-
* @param sequenceOrId - Either a full AnimationSequence object or a sequence ID (for backwards compat)
|
|
60
|
-
* @param options - Playback options
|
|
61
|
-
*/
|
|
62
|
-
playSequence(sequenceOrId: AnimationSequence | string, options?: AnimationPlaybackOptions): Promise<void>;
|
|
63
|
-
/**
|
|
64
|
-
* Pause an animation sequence
|
|
65
|
-
*/
|
|
66
|
-
pauseSequence(sequenceId: string): void;
|
|
67
|
-
/**
|
|
68
|
-
* Resume a paused animation sequence
|
|
69
|
-
*/
|
|
70
|
-
resumeSequence(sequenceId: string): void;
|
|
71
|
-
/**
|
|
72
|
-
* Stop an animation sequence
|
|
73
|
-
*/
|
|
74
|
-
stopSequence(sequenceId: string): void;
|
|
75
|
-
/**
|
|
76
|
-
* Stop all animation sequences
|
|
77
|
-
*/
|
|
78
|
-
stopAllSequences(): void;
|
|
79
|
-
/**
|
|
80
|
-
* @deprecated Use Redux to update sequences. This only affects runtime state.
|
|
81
|
-
*/
|
|
82
|
-
updateSequence(sequenceId: string, updates: Partial<AnimationSequence>): void;
|
|
83
|
-
/**
|
|
84
|
-
* Check if a sequence is playing
|
|
85
|
-
*/
|
|
86
|
-
isSequencePlaying(sequenceId: string): boolean;
|
|
87
|
-
/**
|
|
88
|
-
* Check if a sequence is paused
|
|
89
|
-
*/
|
|
90
|
-
isSequencePaused(sequenceId: string): boolean;
|
|
91
|
-
/**
|
|
92
|
-
* Seek to a specific progress point in the animation (0-1)
|
|
93
|
-
*/
|
|
94
|
-
seekToProgress(sequenceId: string, progress: number): void;
|
|
95
|
-
/**
|
|
96
|
-
* Go to the start of the animation
|
|
97
|
-
*/
|
|
98
|
-
goToStart(sequenceId: string): void;
|
|
99
|
-
/**
|
|
100
|
-
* Go to the end of the animation
|
|
101
|
-
*/
|
|
102
|
-
goToEnd(sequenceId: string): void;
|
|
103
|
-
/**
|
|
104
|
-
* Get the current progress of a sequence (0-1)
|
|
105
|
-
*/
|
|
106
|
-
getProgress(sequenceId: string): number;
|
|
107
|
-
/**
|
|
108
|
-
* Clear all active sequences and timelines
|
|
109
|
-
*/
|
|
110
|
-
clear(): void;
|
|
111
|
-
reverseSteps(sequence: AnimationSequence): AnimationSequence;
|
|
112
12
|
/**
|
|
113
13
|
* Get progress based on start time and duration (uses wall-clock time like GSAP)
|
|
114
14
|
* @param startTime - The timestamp when animation started (from performance.now() or Date.now())
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AnimationsManager.d.ts","sourceRoot":"","sources":["../../src/services/AnimationsManager.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AnimationsManager.d.ts","sourceRoot":"","sources":["../../src/services/AnimationsManager.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAErD;;;;;;GAMG;AACH,cAAM,iBAAiB;IACnB,OAAO,CAAC,KAAK,CAAe;IAC5B;;;;;;OAMG;IACH,mBAAmB,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,GAAE,MAAiB,GAAG,MAAM;IAYzF;;OAEG;IACH,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,GAAE,MAAU,GAAG,MAAM;IAM7E;;OAEG;IACH,UAAU,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,aAAa,GAAE,YAAY,EAAO,GAAG,MAAM;IAUrE;;OAEG;IACH,OAAO,CAAC,YAAY,EAAE,UAAU,GAAG,IAAI;IAGvC;;OAEG;IACH,OAAO,CAAC,MAAM,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS;IAG/C;;OAEG;IACH,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY,EAAE,GAAG,SAAS;IAGzD;;OAEG;IACH,WAAW,IAAI,UAAU,EAAE;IAG3B;;OAEG;IACH,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC,GAAG,IAAI;IAM1E;;OAEG;IACH,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,GAAG,IAAI;IAM9D;;OAEG;IACH,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,GAAG,IAAI;IAMzD;;OAEG;IACH,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI;IAMxD;;OAEG;IACH,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAGhC;;OAEG;IACH,aAAa,IAAI,IAAI;CAGxB;;AAED,wBAAuC"}
|
|
@@ -1,399 +1,13 @@
|
|
|
1
|
-
import gsap from 'gsap';
|
|
2
1
|
import { applyEasing, gsapEasingMap } from '../utils/easingUtils.js';
|
|
3
2
|
/**
|
|
4
|
-
* AnimationsManager
|
|
5
|
-
*
|
|
6
|
-
*
|
|
3
|
+
* AnimationsManager — the path registry (PathCreator, path animation) and the
|
|
4
|
+
* progress helpers per-object animations use.
|
|
5
|
+
*
|
|
6
|
+
* Sequence playback moved to Animations V2 (viewer `animationsV2/ClipsRuntime`);
|
|
7
|
+
* the V1 sequence player, its GSAP timelines and its step events are gone.
|
|
7
8
|
*/
|
|
8
9
|
class AnimationsManager {
|
|
9
|
-
// Runtime state for actively playing sequences
|
|
10
|
-
activeSequences = new Map();
|
|
11
10
|
paths = new Map([]);
|
|
12
|
-
timelines = new Map();
|
|
13
|
-
eventListeners = new Map();
|
|
14
|
-
constructor() {
|
|
15
|
-
// Initialize event listener sets
|
|
16
|
-
this.eventListeners.set('sequenceStart', new Set());
|
|
17
|
-
this.eventListeners.set('sequenceEnd', new Set());
|
|
18
|
-
this.eventListeners.set('stepStart', new Set());
|
|
19
|
-
this.eventListeners.set('stepEnd', new Set());
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Add an event listener
|
|
23
|
-
*/
|
|
24
|
-
on(eventType, listener) {
|
|
25
|
-
const listeners = this.eventListeners.get(eventType);
|
|
26
|
-
if (listeners) {
|
|
27
|
-
listeners.add(listener);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Remove an event listener
|
|
32
|
-
*/
|
|
33
|
-
off(eventType, listener) {
|
|
34
|
-
const listeners = this.eventListeners.get(eventType);
|
|
35
|
-
if (listeners) {
|
|
36
|
-
listeners.delete(listener);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* Emit an event
|
|
41
|
-
*/
|
|
42
|
-
emit(event) {
|
|
43
|
-
const listeners = this.eventListeners.get(event.type);
|
|
44
|
-
if (listeners) {
|
|
45
|
-
listeners.forEach(listener => {
|
|
46
|
-
try {
|
|
47
|
-
listener(event);
|
|
48
|
-
}
|
|
49
|
-
catch (error) {
|
|
50
|
-
console.error(`Error in animation event listener for ${event.type}:`, error);
|
|
51
|
-
}
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
* @deprecated Sequences are now managed in Redux. Use playSequence(sequence) directly.
|
|
57
|
-
* This method is kept for backwards compatibility during migration.
|
|
58
|
-
*/
|
|
59
|
-
addSequence(sequence) {
|
|
60
|
-
console.warn('AnimationsManager.addSequence is deprecated. Sequences are managed in Redux.');
|
|
61
|
-
// Store for backwards compatibility
|
|
62
|
-
this.activeSequences.set(sequence.id, {
|
|
63
|
-
...sequence,
|
|
64
|
-
currentStep: 0,
|
|
65
|
-
isPlaying: false,
|
|
66
|
-
isPaused: false,
|
|
67
|
-
progress: 0,
|
|
68
|
-
});
|
|
69
|
-
return this.activeSequences.get(sequence.id);
|
|
70
|
-
}
|
|
71
|
-
/**
|
|
72
|
-
* @deprecated Sequences are now managed in Redux.
|
|
73
|
-
*/
|
|
74
|
-
removeSequence(sequenceId) {
|
|
75
|
-
console.warn('AnimationsManager.removeSequence is deprecated. Sequences are managed in Redux.');
|
|
76
|
-
this.stopSequence(sequenceId);
|
|
77
|
-
this.activeSequences.delete(sequenceId);
|
|
78
|
-
this.timelines.delete(sequenceId);
|
|
79
|
-
}
|
|
80
|
-
/**
|
|
81
|
-
* Get an actively playing sequence's runtime state
|
|
82
|
-
*/
|
|
83
|
-
getSequence(sequenceId) {
|
|
84
|
-
return this.activeSequences.get(sequenceId);
|
|
85
|
-
}
|
|
86
|
-
/**
|
|
87
|
-
* @deprecated Sequences are now managed in Redux. Use Redux selectors instead.
|
|
88
|
-
*/
|
|
89
|
-
getAllSequences() {
|
|
90
|
-
console.warn('AnimationsManager.getAllSequences is deprecated. Use Redux selectors.');
|
|
91
|
-
return Array.from(this.activeSequences.values());
|
|
92
|
-
}
|
|
93
|
-
// updateSequence(sequenceId: string, updates: Partial<AnimationSequence>): void {
|
|
94
|
-
// const sequence = this.sequences.get(sequenceId);
|
|
95
|
-
// if (sequence) {
|
|
96
|
-
// Object.assign(sequence, updates);
|
|
97
|
-
// }
|
|
98
|
-
// }
|
|
99
|
-
/**
|
|
100
|
-
* Execute a single animation step with multiple transitions
|
|
101
|
-
* Returns a GSAP timeline for this step
|
|
102
|
-
*/
|
|
103
|
-
executeStep(step, stepTimeline, sequence, stepIndex) {
|
|
104
|
-
const { duration, ease = 'power2.out' } = step;
|
|
105
|
-
const stagger = step.stagger || 0;
|
|
106
|
-
// Total GSAP timeline duration must cover the last staggered transition finishing.
|
|
107
|
-
// last object starts at (n-1)*stagger, runs for `duration` seconds.
|
|
108
|
-
const totalDuration = duration + (step.transitions.length > 1 ? (step.transitions.length) * stagger : 0);
|
|
109
|
-
// Emit step start event with step data
|
|
110
|
-
stepTimeline.call(() => {
|
|
111
|
-
this.emit({
|
|
112
|
-
type: 'stepStart',
|
|
113
|
-
sequenceId: sequence.id,
|
|
114
|
-
sequence,
|
|
115
|
-
step,
|
|
116
|
-
stepIndex,
|
|
117
|
-
});
|
|
118
|
-
}, undefined, 0); // Call at the start of the step timeline
|
|
119
|
-
// console.log('Executing step', stepIndex, 'of sequence', sequence.id, 'with duration', duration, 'stagger', stagger, 'totalDuration', totalDuration);
|
|
120
|
-
stepTimeline.to({}, { duration: totalDuration, ease: ease });
|
|
121
|
-
// Emit step end event
|
|
122
|
-
stepTimeline.call(() => {
|
|
123
|
-
this.emit({
|
|
124
|
-
type: 'stepEnd',
|
|
125
|
-
sequenceId: sequence.id,
|
|
126
|
-
sequence,
|
|
127
|
-
step,
|
|
128
|
-
stepIndex,
|
|
129
|
-
});
|
|
130
|
-
if (step.onComplete) {
|
|
131
|
-
step.onComplete();
|
|
132
|
-
}
|
|
133
|
-
});
|
|
134
|
-
}
|
|
135
|
-
/**
|
|
136
|
-
* Play an animation sequence
|
|
137
|
-
* @param sequenceOrId - Either a full AnimationSequence object or a sequence ID (for backwards compat)
|
|
138
|
-
* @param options - Playback options
|
|
139
|
-
*/
|
|
140
|
-
async playSequence(sequenceOrId, options = {}) {
|
|
141
|
-
// Support both sequence object and ID for backwards compatibility
|
|
142
|
-
let sequence;
|
|
143
|
-
let originalSequence; // Keep original for yoyo/loop callbacks
|
|
144
|
-
let sequenceId;
|
|
145
|
-
if (typeof sequenceOrId === 'string') {
|
|
146
|
-
// ID passed - look up in activeSequences (backwards compat)
|
|
147
|
-
const found = this.activeSequences.get(sequenceOrId);
|
|
148
|
-
if (!found) {
|
|
149
|
-
console.warn(`Animation sequence with ID ${sequenceOrId} not found. Pass sequence data directly.`);
|
|
150
|
-
return;
|
|
151
|
-
}
|
|
152
|
-
originalSequence = found;
|
|
153
|
-
sequence = options.reverse ? this.reverseSteps(found) : found;
|
|
154
|
-
sequenceId = sequenceOrId;
|
|
155
|
-
}
|
|
156
|
-
else {
|
|
157
|
-
// Sequence object passed directly (preferred)
|
|
158
|
-
originalSequence = sequenceOrId;
|
|
159
|
-
sequence = options.reverse ? this.reverseSteps(sequenceOrId) : sequenceOrId;
|
|
160
|
-
sequenceId = sequence.id;
|
|
161
|
-
}
|
|
162
|
-
// console.log('Playing sequence:', sequenceId, options);
|
|
163
|
-
// Stop existing timeline if any
|
|
164
|
-
this.stopSequence(sequenceId);
|
|
165
|
-
// Store in activeSequences for runtime state tracking
|
|
166
|
-
const runtimeSequence = {
|
|
167
|
-
...sequence,
|
|
168
|
-
isPlaying: true,
|
|
169
|
-
isPaused: false,
|
|
170
|
-
currentStep: options.startStep || 0,
|
|
171
|
-
progress: 0,
|
|
172
|
-
};
|
|
173
|
-
this.activeSequences.set(sequenceId, runtimeSequence);
|
|
174
|
-
// console.log({sequence});
|
|
175
|
-
// Create main timeline
|
|
176
|
-
// When yoyo is enabled, we handle looping manually via callbacks
|
|
177
|
-
// When yoyo is disabled, we can use GSAP's repeat for loop
|
|
178
|
-
const useGsapRepeat = originalSequence.loop && !originalSequence.yoyo;
|
|
179
|
-
const mainTimeline = gsap.timeline({
|
|
180
|
-
paused: false,
|
|
181
|
-
repeat: useGsapRepeat ? -1 : 0,
|
|
182
|
-
onStart: () => {
|
|
183
|
-
// Emit sequence start event
|
|
184
|
-
this.emit({
|
|
185
|
-
type: 'sequenceStart',
|
|
186
|
-
sequenceId,
|
|
187
|
-
sequence: runtimeSequence,
|
|
188
|
-
});
|
|
189
|
-
},
|
|
190
|
-
onUpdate: () => {
|
|
191
|
-
const progress = mainTimeline.progress();
|
|
192
|
-
// console.log(progress);
|
|
193
|
-
runtimeSequence.progress = progress;
|
|
194
|
-
},
|
|
195
|
-
onComplete: () => {
|
|
196
|
-
runtimeSequence.isPlaying = false;
|
|
197
|
-
runtimeSequence.currentStep = 0;
|
|
198
|
-
runtimeSequence.progress = 1;
|
|
199
|
-
// Emit sequence end event
|
|
200
|
-
this.emit({
|
|
201
|
-
type: 'sequenceEnd',
|
|
202
|
-
sequenceId,
|
|
203
|
-
sequence: runtimeSequence,
|
|
204
|
-
});
|
|
205
|
-
if (originalSequence.yoyo) {
|
|
206
|
-
if (!options._isYoyoReturn) {
|
|
207
|
-
// Just finished the first pass, play the return leg (reversed)
|
|
208
|
-
this.playSequence(originalSequence, {
|
|
209
|
-
...options,
|
|
210
|
-
reverse: true,
|
|
211
|
-
_isYoyoReturn: true,
|
|
212
|
-
});
|
|
213
|
-
}
|
|
214
|
-
else if (originalSequence.loop) {
|
|
215
|
-
// Finished the return leg and loop is true, start fresh (forward)
|
|
216
|
-
this.playSequence(originalSequence, {
|
|
217
|
-
...options,
|
|
218
|
-
reverse: false,
|
|
219
|
-
_isYoyoReturn: false,
|
|
220
|
-
});
|
|
221
|
-
}
|
|
222
|
-
// If _isYoyoReturn and loop is false, we're done (no replay)
|
|
223
|
-
}
|
|
224
|
-
if (options.onComplete) {
|
|
225
|
-
options.onComplete();
|
|
226
|
-
}
|
|
227
|
-
},
|
|
228
|
-
});
|
|
229
|
-
// Add forward steps to timeline
|
|
230
|
-
for (let i = 0; i < sequence.steps.length; i++) {
|
|
231
|
-
const step = sequence.steps[i];
|
|
232
|
-
const delay = step.delay || 0;
|
|
233
|
-
// Create a nested timeline for each step
|
|
234
|
-
const stepTimeline = gsap.timeline({
|
|
235
|
-
onStart: () => {
|
|
236
|
-
runtimeSequence.currentStep = i;
|
|
237
|
-
}
|
|
238
|
-
});
|
|
239
|
-
// Execute the step (this will add tweens to stepTimeline and emit events)
|
|
240
|
-
this.executeStep(step, stepTimeline, sequence, i);
|
|
241
|
-
// Add the step timeline to the main timeline
|
|
242
|
-
if (delay > 0) {
|
|
243
|
-
mainTimeline.add(stepTimeline, `+=${delay}`);
|
|
244
|
-
}
|
|
245
|
-
else {
|
|
246
|
-
mainTimeline.add(stepTimeline);
|
|
247
|
-
}
|
|
248
|
-
}
|
|
249
|
-
// Apply speed multiplier if provided
|
|
250
|
-
if (options.speed !== undefined && options.speed > 0) {
|
|
251
|
-
mainTimeline.timeScale(options.speed);
|
|
252
|
-
}
|
|
253
|
-
this.timelines.set(sequenceId, mainTimeline);
|
|
254
|
-
}
|
|
255
|
-
/**
|
|
256
|
-
* Pause an animation sequence
|
|
257
|
-
*/
|
|
258
|
-
pauseSequence(sequenceId) {
|
|
259
|
-
const timeline = this.timelines.get(sequenceId);
|
|
260
|
-
const sequence = this.activeSequences.get(sequenceId);
|
|
261
|
-
if (timeline && sequence) {
|
|
262
|
-
timeline.pause();
|
|
263
|
-
sequence.isPaused = true;
|
|
264
|
-
sequence.isPlaying = false;
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
|
-
/**
|
|
268
|
-
* Resume a paused animation sequence
|
|
269
|
-
*/
|
|
270
|
-
resumeSequence(sequenceId) {
|
|
271
|
-
const timeline = this.timelines.get(sequenceId);
|
|
272
|
-
const sequence = this.activeSequences.get(sequenceId);
|
|
273
|
-
if (timeline && sequence) {
|
|
274
|
-
timeline.resume();
|
|
275
|
-
sequence.isPaused = false;
|
|
276
|
-
sequence.isPlaying = true;
|
|
277
|
-
}
|
|
278
|
-
}
|
|
279
|
-
/**
|
|
280
|
-
* Stop an animation sequence
|
|
281
|
-
*/
|
|
282
|
-
stopSequence(sequenceId) {
|
|
283
|
-
const timeline = this.timelines.get(sequenceId);
|
|
284
|
-
const sequence = this.activeSequences.get(sequenceId);
|
|
285
|
-
if (timeline) {
|
|
286
|
-
timeline.kill();
|
|
287
|
-
this.timelines.delete(sequenceId);
|
|
288
|
-
}
|
|
289
|
-
if (sequence) {
|
|
290
|
-
sequence.isPlaying = false;
|
|
291
|
-
sequence.isPaused = false;
|
|
292
|
-
sequence.currentStep = 0;
|
|
293
|
-
sequence.progress = 0;
|
|
294
|
-
// Clean up from activeSequences when stopped
|
|
295
|
-
this.activeSequences.delete(sequenceId);
|
|
296
|
-
}
|
|
297
|
-
}
|
|
298
|
-
/**
|
|
299
|
-
* Stop all animation sequences
|
|
300
|
-
*/
|
|
301
|
-
stopAllSequences() {
|
|
302
|
-
this.activeSequences.forEach((_, sequenceId) => {
|
|
303
|
-
this.stopSequence(sequenceId);
|
|
304
|
-
});
|
|
305
|
-
}
|
|
306
|
-
/**
|
|
307
|
-
* @deprecated Use Redux to update sequences. This only affects runtime state.
|
|
308
|
-
*/
|
|
309
|
-
updateSequence(sequenceId, updates) {
|
|
310
|
-
console.warn('AnimationsManager.updateSequence is deprecated. Use Redux.');
|
|
311
|
-
const sequence = this.activeSequences.get(sequenceId);
|
|
312
|
-
if (sequence) {
|
|
313
|
-
Object.assign(sequence, updates);
|
|
314
|
-
}
|
|
315
|
-
}
|
|
316
|
-
/**
|
|
317
|
-
* Check if a sequence is playing
|
|
318
|
-
*/
|
|
319
|
-
isSequencePlaying(sequenceId) {
|
|
320
|
-
const sequence = this.activeSequences.get(sequenceId);
|
|
321
|
-
return sequence?.isPlaying || false;
|
|
322
|
-
}
|
|
323
|
-
/**
|
|
324
|
-
* Check if a sequence is paused
|
|
325
|
-
*/
|
|
326
|
-
isSequencePaused(sequenceId) {
|
|
327
|
-
const sequence = this.activeSequences.get(sequenceId);
|
|
328
|
-
return sequence?.isPaused || false;
|
|
329
|
-
}
|
|
330
|
-
/**
|
|
331
|
-
* Seek to a specific progress point in the animation (0-1)
|
|
332
|
-
*/
|
|
333
|
-
seekToProgress(sequenceId, progress) {
|
|
334
|
-
const timeline = this.timelines.get(sequenceId);
|
|
335
|
-
const sequence = this.activeSequences.get(sequenceId);
|
|
336
|
-
if (timeline && sequence) {
|
|
337
|
-
const clampedProgress = Math.max(0, Math.min(1, progress));
|
|
338
|
-
timeline.progress(clampedProgress);
|
|
339
|
-
sequence.progress = clampedProgress;
|
|
340
|
-
}
|
|
341
|
-
}
|
|
342
|
-
/**
|
|
343
|
-
* Go to the start of the animation
|
|
344
|
-
*/
|
|
345
|
-
goToStart(sequenceId) {
|
|
346
|
-
this.seekToProgress(sequenceId, 0);
|
|
347
|
-
}
|
|
348
|
-
/**
|
|
349
|
-
* Go to the end of the animation
|
|
350
|
-
*/
|
|
351
|
-
goToEnd(sequenceId) {
|
|
352
|
-
this.seekToProgress(sequenceId, 1);
|
|
353
|
-
}
|
|
354
|
-
/**
|
|
355
|
-
* Get the current progress of a sequence (0-1)
|
|
356
|
-
*/
|
|
357
|
-
getProgress(sequenceId) {
|
|
358
|
-
const timeline = this.timelines.get(sequenceId);
|
|
359
|
-
return timeline?.progress() || 0;
|
|
360
|
-
}
|
|
361
|
-
/**
|
|
362
|
-
* Clear all active sequences and timelines
|
|
363
|
-
*/
|
|
364
|
-
clear() {
|
|
365
|
-
this.stopAllSequences();
|
|
366
|
-
this.activeSequences.clear();
|
|
367
|
-
this.timelines.clear();
|
|
368
|
-
}
|
|
369
|
-
reverseSteps(sequence) {
|
|
370
|
-
// Create a deep copy of the sequence
|
|
371
|
-
const reversedSequence = {
|
|
372
|
-
...sequence,
|
|
373
|
-
id: sequence.id,
|
|
374
|
-
steps: [...sequence.steps].reverse().map(step => {
|
|
375
|
-
// Deep copy the step
|
|
376
|
-
const reversedStep = {
|
|
377
|
-
...step,
|
|
378
|
-
transitions: step.transitions.map(transition => {
|
|
379
|
-
// Deep copy the transition
|
|
380
|
-
const { properties } = transition;
|
|
381
|
-
// Ensure we maintain the correct structure with from and to properties
|
|
382
|
-
const reversedProperties = {
|
|
383
|
-
from: properties.to || {},
|
|
384
|
-
to: properties.from || {},
|
|
385
|
-
};
|
|
386
|
-
return {
|
|
387
|
-
...transition,
|
|
388
|
-
properties: reversedProperties,
|
|
389
|
-
};
|
|
390
|
-
}),
|
|
391
|
-
};
|
|
392
|
-
return reversedStep;
|
|
393
|
-
}),
|
|
394
|
-
};
|
|
395
|
-
return reversedSequence;
|
|
396
|
-
}
|
|
397
11
|
/**
|
|
398
12
|
* Get progress based on start time and duration (uses wall-clock time like GSAP)
|
|
399
13
|
* @param startTime - The timestamp when animation started (from performance.now() or Date.now())
|
|
@@ -1,24 +1,38 @@
|
|
|
1
1
|
import type { ActionSequence } from '../types/actions';
|
|
2
2
|
import { type SettingsPatch } from '../utils/settingsPatch';
|
|
3
3
|
type Listener = () => void;
|
|
4
|
-
export type SceneActionsEvent =
|
|
4
|
+
export type SceneActionsEvent =
|
|
5
|
+
/** `reapplied`: it was already applied (patches moved to the top). `runEffects`: false for a patch-only preview. */
|
|
6
|
+
{
|
|
5
7
|
type: 'applied';
|
|
6
8
|
actionId: string;
|
|
9
|
+
action: ActionSequence;
|
|
10
|
+
reapplied: boolean;
|
|
11
|
+
runEffects: boolean;
|
|
7
12
|
} | {
|
|
8
13
|
type: 'reverted';
|
|
9
14
|
actionId: string;
|
|
10
|
-
|
|
15
|
+
action: ActionSequence;
|
|
16
|
+
}
|
|
17
|
+
/** `actions`: those that were applied until now. */
|
|
18
|
+
| {
|
|
11
19
|
type: 'reset';
|
|
20
|
+
actions: ActionSequence[];
|
|
12
21
|
};
|
|
22
|
+
export interface ApplyActionOptions {
|
|
23
|
+
/** Run the action's effects (default true). The editor previews patches only. */
|
|
24
|
+
effects?: boolean;
|
|
25
|
+
}
|
|
13
26
|
declare class SceneActions {
|
|
14
27
|
private stacks;
|
|
15
28
|
private merged;
|
|
29
|
+
/** Applied actions, by id — the definition as it was applied (for revert events). */
|
|
16
30
|
private applied;
|
|
17
31
|
private stateListeners;
|
|
18
32
|
private eventListeners;
|
|
19
33
|
private version;
|
|
20
34
|
/** Apply an action. Re-applying moves its patches to the top of each stack. */
|
|
21
|
-
applyAction(action: ActionSequence): void;
|
|
35
|
+
applyAction(action: ActionSequence, options?: ApplyActionOptions): void;
|
|
22
36
|
/** Remove an action's patches from every element it touched. */
|
|
23
37
|
revertAction(actionOrId: ActionSequence | string): void;
|
|
24
38
|
/** Apply when not applied, revert when applied. Returns true when it applied. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SceneActions.d.ts","sourceRoot":"","sources":["../../src/services/SceneActions.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SceneActions.d.ts","sourceRoot":"","sources":["../../src/services/SceneActions.ts"],"names":[],"mappings":"AA6BA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAA0B,KAAK,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAEpF,KAAK,QAAQ,GAAG,MAAM,IAAI,CAAC;AAE3B,MAAM,MAAM,iBAAiB;AACzB,oHAAoH;AAClH;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;I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K,IAAI,GAAG,MAAM,IAAI;IAKjE,yFAAyF;IACzF,UAAU,IAAI,MAAM;IAIpB,OAAO,CAAC,aAAa;IAYrB,OAAO,CAAC,MAAM;CAgBjB;AAED,QAAA,MAAM,YAAY,cAAqB,CAAC;AACxC,eAAe,YAAY,CAAC"}
|
|
@@ -2,12 +2,14 @@ import { composeSettingsPatches } from '../utils/settingsPatch.js';
|
|
|
2
2
|
class SceneActions {
|
|
3
3
|
stacks = new Map();
|
|
4
4
|
merged = new Map();
|
|
5
|
-
applied
|
|
5
|
+
/** Applied actions, by id — the definition as it was applied (for revert events). */
|
|
6
|
+
applied = new Map();
|
|
6
7
|
stateListeners = new Map();
|
|
7
8
|
eventListeners = new Set();
|
|
8
9
|
version = 0;
|
|
9
10
|
/** Apply an action. Re-applying moves its patches to the top of each stack. */
|
|
10
|
-
applyAction(action) {
|
|
11
|
+
applyAction(action, options = {}) {
|
|
12
|
+
const reapplied = this.applied.has(action.id);
|
|
11
13
|
const touched = this.removeEntries(action.id);
|
|
12
14
|
for (const target of action.targets ?? []) {
|
|
13
15
|
if (!target?.state || !target.patch || Object.keys(target.patch).length === 0)
|
|
@@ -17,17 +19,18 @@ class SceneActions {
|
|
|
17
19
|
this.stacks.set(target.state, stack);
|
|
18
20
|
touched.add(target.state);
|
|
19
21
|
}
|
|
20
|
-
this.applied.
|
|
21
|
-
this.commit(touched, { type: 'applied', actionId: action.id });
|
|
22
|
+
this.applied.set(action.id, action);
|
|
23
|
+
this.commit(touched, { type: 'applied', actionId: action.id, action, reapplied, runEffects: options.effects !== false });
|
|
22
24
|
}
|
|
23
25
|
/** Remove an action's patches from every element it touched. */
|
|
24
26
|
revertAction(actionOrId) {
|
|
25
27
|
const actionId = typeof actionOrId === 'string' ? actionOrId : actionOrId.id;
|
|
26
|
-
|
|
28
|
+
const action = this.applied.get(actionId);
|
|
29
|
+
if (!action)
|
|
27
30
|
return;
|
|
28
31
|
const touched = this.removeEntries(actionId);
|
|
29
32
|
this.applied.delete(actionId);
|
|
30
|
-
this.commit(touched, { type: 'reverted', actionId });
|
|
33
|
+
this.commit(touched, { type: 'reverted', actionId, action });
|
|
31
34
|
}
|
|
32
35
|
/** Apply when not applied, revert when applied. Returns true when it applied. */
|
|
33
36
|
toggleAction(action) {
|
|
@@ -42,14 +45,15 @@ class SceneActions {
|
|
|
42
45
|
return this.applied.has(actionId);
|
|
43
46
|
}
|
|
44
47
|
getAppliedActionIds() {
|
|
45
|
-
return Array.from(this.applied);
|
|
48
|
+
return Array.from(this.applied.keys());
|
|
46
49
|
}
|
|
47
50
|
/** Drop every patch (project load, "reset" in the editor). */
|
|
48
51
|
reset() {
|
|
49
52
|
const touched = new Set(this.stacks.keys());
|
|
53
|
+
const actions = Array.from(this.applied.values());
|
|
50
54
|
this.stacks.clear();
|
|
51
55
|
this.applied.clear();
|
|
52
|
-
this.commit(touched, { type: 'reset' });
|
|
56
|
+
this.commit(touched, { type: 'reset', actions });
|
|
53
57
|
}
|
|
54
58
|
/** The merged patch for one element — stable identity until it changes. */
|
|
55
59
|
getPatch(state) {
|
package/dist/services/index.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import texturesManager from './TexturesManager';
|
|
2
2
|
export type { MaterialDefinition, MaterialInstance, MaterialVariant, ShaderSource, UniformInfo, } from './MaterialRegistry';
|
|
3
3
|
export type { FontInfo } from './FontManager';
|
|
4
|
-
export type { AnimationEvent, AnimationEventType } from './AnimationsManager';
|
|
5
4
|
export type { SkyTimeState, TimeOfDayLabel } from './SkySystemManager';
|
|
6
5
|
export { MaterialRegistry, default as MaterialRegistryAPI } from './MaterialRegistry';
|
|
7
6
|
export * from '../utils/MaterialCompiler';
|
|
@@ -17,5 +16,5 @@ export { SkySystemManager, skySystemManager } from './SkySystemManager';
|
|
|
17
16
|
export { CubeCameraManager, cubeCameraManager } from './CubeCameraManager';
|
|
18
17
|
export { default as SceneStore } from './SceneStore';
|
|
19
18
|
export { default as SceneActions } from './SceneActions';
|
|
20
|
-
export type { SceneActionsEvent } from './SceneActions';
|
|
19
|
+
export type { SceneActionsEvent, ApplyActionOptions } from './SceneActions';
|
|
21
20
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/services/index.ts"],"names":[],"mappings":"AAAA,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAChD,YAAY,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,eAAe,EAAE,YAAY,EAAE,WAAW,GAAG,MAAM,oBAAoB,CAAC;AAE5H,YAAY,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/services/index.ts"],"names":[],"mappings":"AAAA,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAChD,YAAY,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,eAAe,EAAE,YAAY,EAAE,WAAW,GAAG,MAAM,oBAAoB,CAAC;AAE5H,YAAY,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAG9C,YAAY,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEvE,OAAO,EAAE,gBAAgB,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACtF,cAAc,2BAA2B,CAAC;AAC1C,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,CAAC;AAC3B,OAAO,EAAE,WAAW,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,eAAe,CAAC;AACpE,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,cAAc,kBAAkB,CAAC;AACjC,OAAO,EAAE,sBAAsB,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC5E,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC1F,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACxE,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAC3E,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACzD,YAAY,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC"}
|
package/dist/types/actions.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { OperationEffect } from './objectSettings';
|
|
1
2
|
/**
|
|
2
3
|
* Action Types
|
|
3
4
|
* Defines the structure for UI actions that can trigger animations, toggle elements, or load projects
|
|
@@ -28,7 +29,7 @@ export type ActionsSet = {
|
|
|
28
29
|
};
|
|
29
30
|
/**
|
|
30
31
|
* One element an action changes: `state` addresses it (a scene object id, or one of
|
|
31
|
-
* 'camera' | 'sky' | 'ocean' | 'clouds'), and `patch` is a deep partial of that
|
|
32
|
+
* 'camera' | 'sky' | 'ocean' | 'clouds' | 'terrain'), and `patch` is a deep partial of that
|
|
32
33
|
* element's own settings — `{ materialSettings: { materialVariant: 'Glass' } }`,
|
|
33
34
|
* `{ config: { intensity: 4 } }`, `{ meshSettings: { position: [0, 2, 0] } }`.
|
|
34
35
|
*/
|
|
@@ -54,6 +55,12 @@ export interface ActionSequence {
|
|
|
54
55
|
key?: string;
|
|
55
56
|
description?: string;
|
|
56
57
|
targets: ActionTarget[];
|
|
58
|
+
/**
|
|
59
|
+
* Operations run when the action is applied, undone when it is reverted
|
|
60
|
+
* (glow, fade, zoom to…). Patches change what elements ARE; effects are what
|
|
61
|
+
* HAPPENS to objects. Patches are applied first.
|
|
62
|
+
*/
|
|
63
|
+
effects?: OperationEffect[];
|
|
57
64
|
assetId?: string | null;
|
|
58
65
|
/** Runtime only */
|
|
59
66
|
isDirty?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../../src/types/actions.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,aAAa,GAAG,cAAc,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,GAAG,eAAe,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,GAAG,aAAa,GAAG,MAAM,CAAC;AAE1L,MAAM,WAAW,MAAM;IACnB,wCAAwC;IACxC,yBAAyB;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,cAAc,CAAC;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,gCAAgC;IAChC,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,kEAAkE;IAClE,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,wEAAwE;IACxE,sDAAsD;IACtD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CACjC;AAED,MAAM,MAAM,UAAU,GAAG;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,EAAE,CAAC;CACrB,CAAC;AACF;;;;;GAKG;AACH,MAAM,WAAW,YAAY;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAC9B;AAED;;;;;;GAMG;AACH,MAAM,WAAW,cAAc;IAC3B,EAAE,EAAE,MAAM,CAAC;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E,CAAC;CACrB,CAAC;AACF;;;;;GAKG;AACH,MAAM,WAAW,YAAY;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAC9B;AAED;;;;;;GAMG;AACH,MAAM,WAAW,cAAc;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb;;;;OAIG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,YAAY,EAAE,CAAC;IACxB;;;;OAIG;IACH,OAAO,CAAC,EAAE,eAAe,EAAE,CAAC;IAC5B,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,mBAAmB;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;CACrB;AACD,OAAO,EAAE,CAAC"}
|
package/dist/types/actions.js
CHANGED
|
@@ -11,44 +11,6 @@ export type Transition = {
|
|
|
11
11
|
from?: Record<string, any>;
|
|
12
12
|
};
|
|
13
13
|
};
|
|
14
|
-
export interface TransitionStep {
|
|
15
|
-
/** Duration of this animation step in seconds */
|
|
16
|
-
duration: number;
|
|
17
|
-
/** Properties to pass to the dispatcher for this state */
|
|
18
|
-
transitions: Transition[];
|
|
19
|
-
/** Optional delay before this step starts (in seconds) */
|
|
20
|
-
delay?: number;
|
|
21
|
-
/** Optional stagger between each transition in seconds (0 = all simultaneous) */
|
|
22
|
-
stagger?: number;
|
|
23
|
-
/** Optional easing function name */
|
|
24
|
-
ease?: string;
|
|
25
|
-
/** Optional callback when this step completes */
|
|
26
|
-
onComplete?: () => void;
|
|
27
|
-
}
|
|
28
|
-
export interface AnimationSequence {
|
|
29
|
-
/** Unique identifier for this sequence */
|
|
30
|
-
id: string;
|
|
31
|
-
/** Name of the animation sequence */
|
|
32
|
-
name: string;
|
|
33
|
-
/** Description of the animation sequence */
|
|
34
|
-
description?: string;
|
|
35
|
-
/** Array of animation steps to execute */
|
|
36
|
-
steps: TransitionStep[];
|
|
37
|
-
/** Whether this sequence should loop */
|
|
38
|
-
loop?: boolean;
|
|
39
|
-
/** Whether this sequence should yoyo (play forwards then backwards) */
|
|
40
|
-
yoyo?: boolean;
|
|
41
|
-
/** Current step index being executed */
|
|
42
|
-
currentStep?: number;
|
|
43
|
-
/** Whether this sequence is currently playing */
|
|
44
|
-
isPlaying?: boolean;
|
|
45
|
-
/** Whether this sequence is paused */
|
|
46
|
-
isPaused?: boolean;
|
|
47
|
-
/** Progress of the animation (0-1) */
|
|
48
|
-
progress?: number;
|
|
49
|
-
assetId?: string | null;
|
|
50
|
-
isDirty?: boolean;
|
|
51
|
-
}
|
|
52
14
|
export interface PathGeometrySettings {
|
|
53
15
|
/** Type of geometry to render */
|
|
54
16
|
type: 'none' | 'road' | 'tube' | 'walls' | 'line' | 'particles';
|
|
@@ -92,18 +54,5 @@ export interface PathConfig {
|
|
|
92
54
|
export type PathSettings = CreatedObjectSettings & {
|
|
93
55
|
config: PathConfig;
|
|
94
56
|
};
|
|
95
|
-
export interface AnimationPlaybackOptions {
|
|
96
|
-
/** Start from a specific step index */
|
|
97
|
-
startStep?: number;
|
|
98
|
-
/** Whether to loop the sequence */
|
|
99
|
-
loop?: boolean;
|
|
100
|
-
/** Speed multiplier (1.0 = normal speed) */
|
|
101
|
-
speed?: number;
|
|
102
|
-
reverse?: boolean;
|
|
103
|
-
/** Callback when sequence completes */
|
|
104
|
-
onComplete?: () => void;
|
|
105
|
-
/** Internal flag to track yoyo return pass (do not set manually) */
|
|
106
|
-
_isYoyoReturn?: boolean;
|
|
107
|
-
}
|
|
108
57
|
export {};
|
|
109
58
|
//# sourceMappingURL=animations.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"animations.d.ts","sourceRoot":"","sources":["../../src/types/animations.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,qBAAqB,EAAE,YAAY,EA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qC;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,4CAA4C;IAC5C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,0CAA0C;IAC1C,MAAM,EAAE,YAAY,EAAE,CAAC;IACvB,2CAA2C;IAC3C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,sFAAsF;IACtF,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,iFAAiF;IACjF,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,8DAA8D;IAC9D,QAAQ,CAAC,EAAE,oBAAoB,CAAC;IAChC,2EAA2E;IAC3E,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,uEAAuE;IACvE,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,MAAM,YAAY,GAAG,qBAAqB,GAAG;IAC/C,MAAM,EAAE,UAAU,CAAC;CACtB,CAAC;AAIF,OAAO,EAAE,CAAC"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { AnimationOptions, Vector3 } from "./scene3d";
|
|
2
2
|
import type { MaterialSettings } from "./materials";
|
|
3
3
|
import type { ShaderEffect } from "./shaderEffects";
|
|
4
|
-
import type { OperationTypes } from "./actions";
|
|
5
4
|
import type { ColorEffectType, EffectTriggerMode, TransformEffectType } from "./effects";
|
|
6
5
|
import { GenerativeEffectSettings } from "./generativeEffects";
|
|
7
6
|
export type PositionEffectType = Extract<TransformEffectType, 'wave' | 'float' | 'shake' | 'bounce'>;
|
|
@@ -95,21 +94,60 @@ export interface PropertyMutation {
|
|
|
95
94
|
from: any;
|
|
96
95
|
to: any;
|
|
97
96
|
}
|
|
97
|
+
/**
|
|
98
|
+
* An object interaction: a trigger on this object and what it does — effects on
|
|
99
|
+
* objects, commands to animations, commands to actions. Stored in
|
|
100
|
+
* `CreatedObjectSettings.actions` (the object's interaction list).
|
|
101
|
+
*/
|
|
102
|
+
export type InteractionTrigger = 'click' | 'mouseEnter' | 'mouseLeave';
|
|
103
|
+
/**
|
|
104
|
+
* What an effect does to its targets. zoom / focus / moveToFront take ONE target;
|
|
105
|
+
* glow / fade / visibility take many; displayImage is a gallery's own.
|
|
106
|
+
* See the viewer's INTERACTION_OPERATIONS catalogue.
|
|
107
|
+
*/
|
|
108
|
+
/**
|
|
109
|
+
* An operation's name. The built-ins are listed; the viewer's operations registry
|
|
110
|
+
* (packages/viewer/src/operations) is the source of truth and can grow.
|
|
111
|
+
*/
|
|
112
|
+
export type OperationName = 'zoom' | 'focus' | 'moveToFront' | 'glow' | 'fade' | 'visibility' | 'displayImage' | (string & {});
|
|
113
|
+
/** A value of an operation parameter (duration, distance, colour…). */
|
|
114
|
+
export type OperationParamValue = number | string | boolean;
|
|
115
|
+
/**
|
|
116
|
+
* One operation on its targets — shared by interactions and actions.
|
|
117
|
+
* Only regular scene objects (and their model nodes) are targets.
|
|
118
|
+
*/
|
|
119
|
+
export interface OperationEffect {
|
|
120
|
+
id: string;
|
|
121
|
+
operation: OperationName;
|
|
122
|
+
/** Scene object ids; interactions may also use 'self' (the object the interaction is on). */
|
|
123
|
+
targets: string[];
|
|
124
|
+
/** Narrows a `model` target to named nodes, keyed by that model's object id. */
|
|
125
|
+
meshNames?: Record<string, string[]>;
|
|
126
|
+
/** Overrides of the operation's parameter defaults. */
|
|
127
|
+
params?: Record<string, OperationParamValue>;
|
|
128
|
+
}
|
|
129
|
+
export type InteractionAnimationCommand = 'play' | 'pause' | 'stop' | 'toggle';
|
|
130
|
+
export interface InteractionAnimation {
|
|
131
|
+
id: string;
|
|
132
|
+
kind: 'clip' | 'sequence';
|
|
133
|
+
/** Clip or sequence id. */
|
|
134
|
+
ref: string;
|
|
135
|
+
command: InteractionAnimationCommand;
|
|
136
|
+
}
|
|
137
|
+
/** toggle: apply, then revert, … */
|
|
138
|
+
export type InteractionActionCommand = 'apply' | 'revert' | 'toggle';
|
|
139
|
+
export interface InteractionAction {
|
|
140
|
+
id: string;
|
|
141
|
+
/** Action sequence id. */
|
|
142
|
+
ref: string;
|
|
143
|
+
command: InteractionActionCommand;
|
|
144
|
+
}
|
|
98
145
|
export interface Interaction {
|
|
99
|
-
mouseEvent:
|
|
146
|
+
mouseEvent: InteractionTrigger;
|
|
100
147
|
enabled: boolean;
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
targetIds?: string[];
|
|
105
|
-
/** How targets are affected: 'replace' = only targets, 'add' = clicked + targets */
|
|
106
|
-
targetMode?: 'replace' | 'add';
|
|
107
|
-
/** Animation sequence IDs to trigger */
|
|
108
|
-
animationIds?: string[];
|
|
109
|
-
/** Action sequence IDs to apply (instant). With the 'toggle' operation, every second trigger reverts them. */
|
|
110
|
-
actionIds?: string[];
|
|
111
|
-
/** Narrows a `model` target in targetIds to specific mesh names, keyed by that model's object id */
|
|
112
|
-
targetMeshNames?: Record<string, string[]>;
|
|
148
|
+
effects: OperationEffect[];
|
|
149
|
+
animations: InteractionAnimation[];
|
|
150
|
+
actions: InteractionAction[];
|
|
113
151
|
}
|
|
114
152
|
export interface ClickInteraction {
|
|
115
153
|
interactions: Interaction[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"objectSettings.d.ts","sourceRoot":"","sources":["../../src/types/objectSettings.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC3D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"objectSettings.d.ts","sourceRoot":"","sources":["../../src/types/objectSettings.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC3D,OAAO,KAAK,EAAE,gBAAgB,EAA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AED,MAAM,WAAW,iBAAiB;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;IACjB,gBAAgB,EAAE,gBAAgB,CAAC;CACtC;AAED,MAAM,WAAW,oBAAoB;IACjC,OAAO,EAAE,OAAO,CAAC;IACjB,oDAAoD;IACpD,UAAU,EAAE,iBAAiB,EAAE,CAAC;CACnC;AAED,MAAM,WAAW,eAAe;IAC5B,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,iBAAiB,EAAE,CAAC;CACnC;AAED,MAAM,WAAW,qBAAqB;IAClC,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,eAAe,CAAC;IAC5B,QAAQ,CAAC,EAAE,eAAe,CAAC;IAC3B,KAAK,CAAC,EAAE,eAAe,CAAC;IACxB,KAAK,CAAC,EAAE,eAAe,CAAC;IACxB,MAAM,CAAC,EAAE,eAAe,CAAC;IACzB,IAAI,CAAC,EAAE,eAAe,CAAC;IACvB,yEAAyE;IACzE,SAAS,CAAC,EAAE,eAAe,CAAC;CAC/B;AAUD;;GAEG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,GAAG,GAAG,OAAO,CAErD;AACD;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,GAAG,GAAG,OAAO,CAQxD"}
|
package/dist/types/types.d.ts
CHANGED
|
@@ -6,7 +6,6 @@ import { Object3D } from "three";
|
|
|
6
6
|
import type { HtmlElement } from "./uiController";
|
|
7
7
|
import type { Action } from "./actions";
|
|
8
8
|
import type { SceneLightConfig } from "./lights";
|
|
9
|
-
import type { AnimationSequence } from "./animations";
|
|
10
9
|
import type { ActionSequence } from "./actions";
|
|
11
10
|
import type { CursorModuleConfig } from "./cursor";
|
|
12
11
|
import { type ThreeEvent } from "@react-three/fiber";
|
|
@@ -67,7 +66,9 @@ export interface ProjectData {
|
|
|
67
66
|
sceneObjects: CreatedObjectSettings[];
|
|
68
67
|
uiSettings: any;
|
|
69
68
|
actions?: Action[];
|
|
70
|
-
|
|
69
|
+
/** Animations V2 rows (normalised by the viewer: normalizeSequence / normalizeClip). */
|
|
70
|
+
animationSequences?: any[];
|
|
71
|
+
animationClips?: any[];
|
|
71
72
|
actionSequences?: ActionSequence[];
|
|
72
73
|
cursor?: CursorModuleConfig;
|
|
73
74
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAAE,WAAW,EAAE,aAAa,EAAE,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACnJ,OAAO,KAAK,EAAE,WAAW,EAAE,qBAAqB,EAAE,YAAY,EAAE,eAAe,EAAE,UAAU,EAAE,aAAa,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACjK,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AACjD,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAAE,WAAW,EAAE,aAAa,EAAE,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACnJ,OAAO,KAAK,EAAE,WAAW,EAAE,qBAAqB,EAAE,YAAY,EAAE,eAAe,EAAE,UA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