houxit 0.1.11 → 0.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/dist/houxit.cjs CHANGED
@@ -2,8 +2,8 @@
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  //#region src/index.js
4
4
  var log = console.log;
5
- var version = "0.1.10";
6
- var get_version = () => "houxit-0.1.10";
5
+ var version = "0.1.15";
6
+ var get_version = () => "houxit-0.1.15";
7
7
  var isArray = Array.isArray;
8
8
  var toString = Object.prototype.toString;
9
9
  var _toStringCall = (txt) => toString.call(txt);
@@ -3589,7 +3589,7 @@ function HydrateSuspenseRender(self, suspense, element, isRerender, config) {
3589
3589
  var BUILT_IN_TRANSITIONS = {};
3590
3590
  var BUILT_IN_ANIMATIONS = {};
3591
3591
  var hasMotionInstance = (self, name, mode) => {
3592
- return _makeMap_(mode === "transitions" ? BUILT_IN_TRANSITIONS : BUILT_IN_ANIMATIONS, name) || _makeMap_(self[$$$register][mode], name) || _wufHas_instance(name);
3592
+ return _makeMap_(mode === "transitions" ? BUILT_IN_TRANSITIONS : BUILT_IN_ANIMATIONS, name) || _makeMap_(self[$$$register][mode], name) || _wufHas_instance(self, name);
3593
3593
  };
3594
3594
  function normalize_Motion(self, name, mode) {
3595
3595
  const BUILT_IN_MOTION = mode === "transitions" ? BUILT_IN_TRANSITIONS : BUILT_IN_ANIMATIONS;
@@ -6337,7 +6337,7 @@ function applyHouxitAnimation(node, animation, params = {}, options = {}) {
6337
6337
  fill: "both",
6338
6338
  autoplay: false
6339
6339
  }, config || {});
6340
- const { duration, delay, easing, iterations, direction, fill, autoplay, styles, keyframes, frame } = config;
6340
+ const { duration, delay, easing, iterations, direction, fill, autoplay, styles, keyframes, frame, onStart } = config;
6341
6341
  if (!frame && isString(easing.css) && keyframes && !isFunction(keyframes.keyframes)) return applyCSSBasedAnimation(node, config, params, options);
6342
6342
  let player = null, destroyed = false;
6343
6343
  function startRAF() {
@@ -6365,10 +6365,7 @@ function applyHouxitAnimation(node, animation, params = {}, options = {}) {
6365
6365
  const rawT = elapsed / duration;
6366
6366
  let iterationIndex = Math.floor(rawT);
6367
6367
  let iterationProgress = rawT - iterationIndex;
6368
- if (!started) {
6369
- started = true;
6370
- onStart?.();
6371
- }
6368
+ if (!started) started = true;
6372
6369
  if (totalIterations !== Infinity && iterationIndex >= totalIterations) {
6373
6370
  iterationIndex = totalIterations - 1;
6374
6371
  iterationProgress = 1;
@@ -6420,7 +6417,6 @@ function applyHouxitAnimation(node, animation, params = {}, options = {}) {
6420
6417
  player.oncancel = () => {
6421
6418
  if (!destroyed) oncancel?.();
6422
6419
  };
6423
- onstart?.();
6424
6420
  if (!autoplay) player.pause();
6425
6421
  return player;
6426
6422
  }
@@ -6473,7 +6469,6 @@ function applyCSSBasedAnimation(node, config, params = {}, options = {}) {
6473
6469
  document.head.appendChild(style);
6474
6470
  function handleStart(e) {
6475
6471
  if (e.target !== node) return;
6476
- onstart?.();
6477
6472
  }
6478
6473
  function handleEnd(e) {
6479
6474
  if (e.target !== node) return;