@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.
@@ -7,7 +7,8 @@ export class Emitter {
7
7
  }
8
8
  createTransformListen(handler) {
9
9
  let parentUnsubscribe = null;
10
- const { emit, listen } = createListenable(() => parentUnsubscribe = this.onListen(value => {
10
+ const parentListen = this.onListen;
11
+ const { emit, listen } = createListenable(() => parentUnsubscribe = parentListen(value => {
11
12
  handler(value, emit);
12
13
  }), () => {
13
14
  parentUnsubscribe();
@@ -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 => this.seekDirect(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.slice(lastIdx, m.index); // literal before token
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.slice(lastIdx);
152
+ const tail = s.substring(lastIdx);
153
153
  if (tail.length) {
154
154
  chunks.push({ prefix: tail, token: "", type: TokenTypes.none });
155
155
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xtia/timeline",
3
- "version": "1.1.11",
3
+ "version": "1.1.12",
4
4
  "repository": {
5
5
  "url": "https://github.com/tiadrop/timeline",
6
6
  "type": "github"