@xtia/timeline 1.1.11 → 1.1.12
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/internal/emitters.js +2 -1
- package/internal/timeline.js +4 -1
- package/internal/tween.js +2 -2
- package/package.json +1 -1
package/internal/emitters.js
CHANGED
|
@@ -7,7 +7,8 @@ export class Emitter {
|
|
|
7
7
|
}
|
|
8
8
|
createTransformListen(handler) {
|
|
9
9
|
let parentUnsubscribe = null;
|
|
10
|
-
const
|
|
10
|
+
const parentListen = this.onListen;
|
|
11
|
+
const { emit, listen } = createListenable(() => parentUnsubscribe = parentListen(value => {
|
|
11
12
|
handler(value, emit);
|
|
12
13
|
}), () => {
|
|
13
14
|
parentUnsubscribe();
|
package/internal/timeline.js
CHANGED
|
@@ -213,7 +213,10 @@ export class Timeline {
|
|
|
213
213
|
.range(0, durationMs)
|
|
214
214
|
.ease(easer)
|
|
215
215
|
.tween(this._currentTime, toPosition)
|
|
216
|
-
.apply(v =>
|
|
216
|
+
.apply(v => {
|
|
217
|
+
this.seekDirect(v);
|
|
218
|
+
this._frameEvents?.emit();
|
|
219
|
+
});
|
|
217
220
|
return seeker.end.promise();
|
|
218
221
|
}
|
|
219
222
|
seekDirect(toPosition) {
|
package/internal/tween.js
CHANGED
|
@@ -143,13 +143,13 @@ function tokenise(s) {
|
|
|
143
143
|
let m;
|
|
144
144
|
while ((m = tweenableTokenRegex.exec(s))) {
|
|
145
145
|
const token = m[0];
|
|
146
|
-
const prefix = s.
|
|
146
|
+
const prefix = s.substring(lastIdx, m.index); // literal before token
|
|
147
147
|
const type = getTokenType(token);
|
|
148
148
|
chunks.push({ prefix, token, type });
|
|
149
149
|
lastIdx = m.index + token.length;
|
|
150
150
|
}
|
|
151
151
|
// trailing literal after the last token – stored as a final chunk
|
|
152
|
-
const tail = s.
|
|
152
|
+
const tail = s.substring(lastIdx);
|
|
153
153
|
if (tail.length) {
|
|
154
154
|
chunks.push({ prefix: tail, token: "", type: TokenTypes.none });
|
|
155
155
|
}
|