@vizejs/composable 0.563.0 → 0.564.0
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/animate.mjs +11 -2
- package/package.json +2 -2
- package/registry/files/animate.ts +12 -2
- package/registry/registry.json +4 -4
package/dist/animate.mjs
CHANGED
|
@@ -83,7 +83,7 @@ function useAnimate(target, keyframes, options) {
|
|
|
83
83
|
sync();
|
|
84
84
|
onCleanup(() => {
|
|
85
85
|
stopFrames();
|
|
86
|
-
created
|
|
86
|
+
if (created) cancelAnimation(created);
|
|
87
87
|
if (animation.value === created) animation.value = null;
|
|
88
88
|
playState.value = "idle";
|
|
89
89
|
});
|
|
@@ -132,9 +132,18 @@ function useAnimate(target, keyframes, options) {
|
|
|
132
132
|
pause: control((current) => current.pause()),
|
|
133
133
|
reverse: control((current) => current.reverse()),
|
|
134
134
|
finish: control((current) => current.finish()),
|
|
135
|
-
cancel: control(
|
|
135
|
+
cancel: control(cancelAnimation)
|
|
136
136
|
};
|
|
137
137
|
}
|
|
138
|
+
/** Observe the current promises before cancellation, including after replay.
|
|
139
|
+
* Cancellation rejects both promises with AbortError; handling that expected
|
|
140
|
+
* lifecycle result leaves the original promises available to their consumers.
|
|
141
|
+
*/
|
|
142
|
+
function cancelAnimation(animation) {
|
|
143
|
+
animation.finished.catch(() => void 0);
|
|
144
|
+
animation.ready.catch(() => void 0);
|
|
145
|
+
animation.cancel();
|
|
146
|
+
}
|
|
138
147
|
function toPlatformKeyframes(frames) {
|
|
139
148
|
if (isKeyframeList(frames)) return frames.map((frame) => ({ ...frame }));
|
|
140
149
|
const indexed = {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vizejs/composable",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.564.0",
|
|
4
4
|
"description": "Lifecycle-safe composable foundations for Vize applications",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"composables",
|
|
@@ -977,7 +977,7 @@
|
|
|
977
977
|
},
|
|
978
978
|
"devDependencies": {
|
|
979
979
|
"@types/node": "25.9.2",
|
|
980
|
-
"@vizejs/native": "0.
|
|
980
|
+
"@vizejs/native": "0.564.0",
|
|
981
981
|
"happy-dom": "21.0.4",
|
|
982
982
|
"typescript": "6.0.3",
|
|
983
983
|
"vite-plus": "0.1.24",
|
|
@@ -235,7 +235,7 @@ export function useAnimate(
|
|
|
235
235
|
sync();
|
|
236
236
|
onCleanup(() => {
|
|
237
237
|
stopFrames();
|
|
238
|
-
created
|
|
238
|
+
if (created) cancelAnimation(created);
|
|
239
239
|
if (animation.value === created) animation.value = null;
|
|
240
240
|
playState.value = "idle";
|
|
241
241
|
});
|
|
@@ -290,10 +290,20 @@ export function useAnimate(
|
|
|
290
290
|
pause: control((current) => current.pause()),
|
|
291
291
|
reverse: control((current) => current.reverse()),
|
|
292
292
|
finish: control((current) => current.finish()),
|
|
293
|
-
cancel: control(
|
|
293
|
+
cancel: control(cancelAnimation),
|
|
294
294
|
};
|
|
295
295
|
}
|
|
296
296
|
|
|
297
|
+
/** Observe the current promises before cancellation, including after replay.
|
|
298
|
+
* Cancellation rejects both promises with AbortError; handling that expected
|
|
299
|
+
* lifecycle result leaves the original promises available to their consumers.
|
|
300
|
+
*/
|
|
301
|
+
function cancelAnimation(animation: Animation): void {
|
|
302
|
+
void animation.finished.catch(() => undefined);
|
|
303
|
+
void animation.ready.catch(() => undefined);
|
|
304
|
+
animation.cancel();
|
|
305
|
+
}
|
|
306
|
+
|
|
297
307
|
function toPlatformKeyframes(frames: AnimationKeyframes): Keyframe[] | PropertyIndexedKeyframes {
|
|
298
308
|
if (isKeyframeList(frames)) return frames.map((frame) => ({ ...frame }));
|
|
299
309
|
const indexed: PropertyIndexedKeyframes = {};
|
package/registry/registry.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"registryKind": "vize-lib",
|
|
4
4
|
"package": {
|
|
5
5
|
"name": "@vizejs/composable",
|
|
6
|
-
"version": "0.
|
|
6
|
+
"version": "0.564.0"
|
|
7
7
|
},
|
|
8
8
|
"kind": "composable",
|
|
9
9
|
"filesDirectory": "files",
|
|
@@ -81,8 +81,8 @@
|
|
|
81
81
|
{
|
|
82
82
|
"path": "animate.ts",
|
|
83
83
|
"role": "entry",
|
|
84
|
-
"sha256": "
|
|
85
|
-
"size":
|
|
84
|
+
"sha256": "1a032df77eae9d9ad319eeb53d860ab38253983864c0703eaf88414954631a1d",
|
|
85
|
+
"size": 11136
|
|
86
86
|
}
|
|
87
87
|
],
|
|
88
88
|
"registryDependencies": [
|
|
@@ -96,7 +96,7 @@
|
|
|
96
96
|
"kind": "peer"
|
|
97
97
|
}
|
|
98
98
|
],
|
|
99
|
-
"contentHash": "
|
|
99
|
+
"contentHash": "d1534b87fcea756c76aa01f784198cc251699398044584e01b7eef7cce479015",
|
|
100
100
|
"examples": []
|
|
101
101
|
},
|
|
102
102
|
{
|