@hanzogui/animations-motion 2.0.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.
Files changed (38) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +72 -0
  3. package/dist/cjs/createAnimations.cjs +449 -0
  4. package/dist/cjs/createAnimations.native.js +548 -0
  5. package/dist/cjs/createAnimations.native.js.map +1 -0
  6. package/dist/cjs/index.cjs +19 -0
  7. package/dist/cjs/index.native.js +37 -0
  8. package/dist/cjs/index.native.js.map +1 -0
  9. package/dist/cjs/polyfill.cjs +1 -0
  10. package/dist/cjs/polyfill.native.js +4 -0
  11. package/dist/cjs/polyfill.native.js.map +1 -0
  12. package/dist/esm/createAnimations.mjs +414 -0
  13. package/dist/esm/createAnimations.mjs.map +1 -0
  14. package/dist/esm/createAnimations.native.js +510 -0
  15. package/dist/esm/createAnimations.native.js.map +1 -0
  16. package/dist/esm/index.js +2 -0
  17. package/dist/esm/index.js.map +1 -0
  18. package/dist/esm/index.mjs +2 -0
  19. package/dist/esm/index.mjs.map +1 -0
  20. package/dist/esm/index.native.js +11 -0
  21. package/dist/esm/index.native.js.map +1 -0
  22. package/dist/esm/polyfill.mjs +2 -0
  23. package/dist/esm/polyfill.mjs.map +1 -0
  24. package/dist/esm/polyfill.native.js +2 -0
  25. package/dist/esm/polyfill.native.js.map +1 -0
  26. package/package.json +53 -0
  27. package/src/createAnimations.tsx +905 -0
  28. package/src/index.native.ts +28 -0
  29. package/src/index.ts +3 -0
  30. package/src/polyfill.ts +4 -0
  31. package/types/createAnimations.d.ts +8 -0
  32. package/types/createAnimations.d.ts.map +11 -0
  33. package/types/index.d.ts +4 -0
  34. package/types/index.d.ts.map +11 -0
  35. package/types/index.native.d.ts +4 -0
  36. package/types/index.native.d.ts.map +11 -0
  37. package/types/polyfill.d.ts +2 -0
  38. package/types/polyfill.d.ts.map +11 -0
@@ -0,0 +1,510 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { getEffectiveAnimation, normalizeTransition } from "@hanzogui/animation-helpers";
3
+ import { ResetPresence, usePresence } from "@hanzogui/use-presence";
4
+ import { fixStyles, getConfig, getSplitStyles, hooks, styleToCSS, Text, useComposedRefs, useIsomorphicLayoutEffect, useThemeWithState, View } from "@hanzogui/web";
5
+ import { useAnimate, useMotionValue, useMotionValueEvent } from "motion/react";
6
+ import React, { forwardRef, useEffect, useLayoutEffect, useMemo, useRef, useState } from "react";
7
+ function _instanceof(left, right) {
8
+ return right != null && typeof Symbol < "u" && right[Symbol.hasInstance] ? !!right[Symbol.hasInstance](left) : left instanceof right;
9
+ }
10
+ function _type_of(obj) {
11
+ "@swc/helpers - typeof";
12
+
13
+ return obj && typeof Symbol < "u" && obj.constructor === Symbol ? "symbol" : typeof obj;
14
+ }
15
+ var isServer = typeof window > "u";
16
+ function useAnimateSSRSafe() {
17
+ return isServer ? [useRef(null), function () {}] : useAnimate();
18
+ }
19
+ var MotionValueStrategy = /* @__PURE__ */new WeakMap();
20
+ function createAnimations(animations) {
21
+ var isHydratingGlobal,
22
+ hydratingComponents = /* @__PURE__ */new Set();
23
+ return {
24
+ View: MotionView,
25
+ Text: MotionText,
26
+ isReactNative: !1,
27
+ inputStyle: "css",
28
+ outputStyle: "inline",
29
+ avoidReRenders: !0,
30
+ animations,
31
+ usePresence,
32
+ ResetPresence,
33
+ onMount() {
34
+ isHydratingGlobal = !1, hydratingComponents.forEach(function (cb) {
35
+ return cb();
36
+ });
37
+ },
38
+ useAnimations: function (animationProps) {
39
+ isHydratingGlobal === void 0 && !getConfig().settings.disableSSR && (isHydratingGlobal = !0);
40
+ var {
41
+ props,
42
+ style,
43
+ componentState,
44
+ stateRef,
45
+ useStyleEmitter,
46
+ presence
47
+ } = animationProps,
48
+ animationKey = Array.isArray(props.transition) ? props.transition[0] : props.transition,
49
+ isComponentHydrating = componentState.unmounted === !0,
50
+ isMounting = componentState.unmounted === "should-enter",
51
+ isEntering = !!componentState.unmounted,
52
+ isExiting = presence?.[0] === !1,
53
+ sendExitComplete = presence?.[1],
54
+ refs = useRef(null);
55
+ refs.current || (refs.current = {
56
+ isFirstRender: !0,
57
+ lastDoAnimate: null,
58
+ lastDontAnimate: null,
59
+ controls: null,
60
+ lastAnimateAt: 0,
61
+ disposed: !1,
62
+ wasExiting: !1,
63
+ isExiting: !1,
64
+ sendExitComplete: void 0,
65
+ animationState: "default",
66
+ frozenExitTarget: null,
67
+ exitCompleteScheduled: !1,
68
+ wasEntering: !1
69
+ });
70
+ var justFinishedEntering = refs.current.wasEntering && !isEntering;
71
+ useEffect(function () {
72
+ refs.current.wasEntering = isEntering;
73
+ });
74
+ var animationState = isExiting ? "exit" : isMounting || justFinishedEntering ? "enter" : "default",
75
+ disableAnimation = isComponentHydrating || isMounting || !animationKey,
76
+ [scope, animate] = useAnimateSSRSafe();
77
+ refs.current.isExiting = isExiting, refs.current.sendExitComplete = sendExitComplete, refs.current.animationState = animationState;
78
+ var justStartedExiting = isExiting && !refs.current.wasExiting,
79
+ justStoppedExiting = !isExiting && refs.current.wasExiting;
80
+ (justStartedExiting || justStoppedExiting) && (refs.current.frozenExitTarget = null, refs.current.exitCompleteScheduled = !1), useEffect(function () {
81
+ refs.current.wasExiting = isExiting;
82
+ });
83
+ var {
84
+ dontAnimate = {},
85
+ doAnimate,
86
+ animationOptions
87
+ } = getMotionAnimatedProps(props, style, disableAnimation, animationState),
88
+ [firstRenderStyle] = useState(style);
89
+ refs.current.isFirstRender && (refs.current.lastDontAnimate = firstRenderStyle);
90
+ var [isHydrating, setIsHydrating] = useState(isHydratingGlobal);
91
+ useLayoutEffect(function () {
92
+ return isHydratingGlobal && hydratingComponents.add(function () {
93
+ setIsHydrating(!1);
94
+ }), function () {
95
+ refs.current.disposed = !0;
96
+ };
97
+ }, []);
98
+ var flushAnimation = function (param) {
99
+ var {
100
+ doAnimate: doAnimateRaw = {},
101
+ animationOptions: passedOptions = {},
102
+ dontAnimate: dontAnimate2
103
+ } = param,
104
+ startedControls = null,
105
+ isCurrentlyExiting = refs.current.isExiting,
106
+ currentSendExitComplete = refs.current.sendExitComplete,
107
+ doAnimate2 = doAnimateRaw;
108
+ isCurrentlyExiting && refs.current.frozenExitTarget && (doAnimate2 = refs.current.frozenExitTarget);
109
+ var _props_transition,
110
+ animationOptions2 = isCurrentlyExiting && currentSendExitComplete ? getAnimationOptions((_props_transition = props.transition) !== null && _props_transition !== void 0 ? _props_transition : null, "exit") : passedOptions;
111
+ try {
112
+ var node = stateRef.current.host;
113
+ if (refs.current.isFirstRender && (refs.current.lastDontAnimate = null, refs.current.lastDoAnimate = null), process.env.NODE_ENV === "development" && props.debug && props.debug !== "profile" && (console.groupCollapsed(`[motion] animate (${JSON.stringify(getDiff(refs.current.lastDoAnimate, doAnimate2), null, 2)})`), console.info({
114
+ props,
115
+ componentState,
116
+ doAnimate: doAnimate2,
117
+ dontAnimate: dontAnimate2,
118
+ animationOptions: animationOptions2,
119
+ animationProps,
120
+ lastDoAnimate: {
121
+ ...refs.current.lastDoAnimate
122
+ },
123
+ lastDontAnimate: {
124
+ ...refs.current.lastDontAnimate
125
+ },
126
+ isExiting,
127
+ style,
128
+ node
129
+ }), console.groupCollapsed("trace >"), console.trace(), console.groupEnd(), console.groupEnd()), !_instanceof(node, HTMLElement)) return;
130
+ var prevDont = refs.current.lastDontAnimate;
131
+ if (dontAnimate2) if (prevDont) {
132
+ removeRemovedStyles(prevDont, dontAnimate2, node, doAnimate2);
133
+ var changed = getDiff(prevDont, dontAnimate2);
134
+ changed && Object.assign(node.style, changed);
135
+ } else Object.assign(node.style, dontAnimate2);
136
+ if (doAnimate2) {
137
+ if (prevDont) for (var key in prevDont) key in doAnimate2 && (node.style[key] = prevDont[key], refs.current.lastDoAnimate && (refs.current.lastDoAnimate[key] = prevDont[key]));
138
+ var lastAnimated = refs.current.lastDoAnimate;
139
+ lastAnimated && removeRemovedStyles(lastAnimated, doAnimate2, node, dontAnimate2);
140
+ var diff = getDiff(refs.current.lastDoAnimate, doAnimate2);
141
+ if (diff) {
142
+ isCurrentlyExiting && !refs.current.frozenExitTarget && (refs.current.frozenExitTarget = {
143
+ ...doAnimate2
144
+ });
145
+ var isPopperPosition = node.hasAttribute("data-popper-animate-position"),
146
+ midFlightValues = null;
147
+ if (refs.current.controls) {
148
+ try {
149
+ var computed = getComputedStyle(node);
150
+ midFlightValues = {};
151
+ for (var key1 in diff) {
152
+ var val = computed[key1];
153
+ val !== void 0 && val !== "" && (midFlightValues[key1] = val);
154
+ }
155
+ } catch {}
156
+ if (isCurrentlyExiting && refs.current.controls.stop(), midFlightValues) for (var key2 in midFlightValues) node.style[key2] = midFlightValues[key2];
157
+ if (isPopperPosition) {
158
+ var anims = node.getAnimations(),
159
+ _iteratorNormalCompletion = !0,
160
+ _didIteratorError = !1,
161
+ _iteratorError = void 0;
162
+ try {
163
+ for (var _iterator = anims[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
164
+ var anim = _step.value;
165
+ anim.cancel();
166
+ }
167
+ } catch (err) {
168
+ _didIteratorError = !0, _iteratorError = err;
169
+ } finally {
170
+ try {
171
+ !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
172
+ } finally {
173
+ if (_didIteratorError) throw _iteratorError;
174
+ }
175
+ }
176
+ }
177
+ }
178
+ var fixedDiff = fixTransparentColors(diff, refs.current.lastDoAnimate, doAnimate2);
179
+ midFlightValues?.transform && fixedDiff.transform && (fixedDiff.transform = [midFlightValues.transform, fixedDiff.transform]), startedControls = animate(scope.current, fixedDiff, animationOptions2), refs.current.controls = startedControls, refs.current.lastAnimateAt = Date.now();
180
+ }
181
+ }
182
+ refs.current.lastDontAnimate = dontAnimate2 ? {
183
+ ...dontAnimate2
184
+ } : {}, refs.current.lastDoAnimate = doAnimate2 ? {
185
+ ...doAnimate2
186
+ } : {};
187
+ } finally {
188
+ isCurrentlyExiting && currentSendExitComplete && (startedControls ? (refs.current.exitCompleteScheduled = !0, startedControls.finished.then(function () {
189
+ refs.current.isExiting && currentSendExitComplete();
190
+ }).catch(function () {
191
+ refs.current.isExiting && currentSendExitComplete();
192
+ })) : refs.current.exitCompleteScheduled || currentSendExitComplete());
193
+ }
194
+ };
195
+ return useStyleEmitter?.(function (nextStyle, effectiveTransition) {
196
+ var _$animationProps = getMotionAnimatedProps(props, nextStyle, disableAnimation, refs.current.animationState, effectiveTransition);
197
+ flushAnimation(_$animationProps);
198
+ }), useIsomorphicLayoutEffect(function () {
199
+ if (refs.current.isFirstRender) {
200
+ if (refs.current.isFirstRender = !1, isHydrating) {
201
+ doAnimate && Object.keys(doAnimate).length > 0 ? refs.current.lastDoAnimate = {
202
+ ...doAnimate
203
+ } : refs.current.lastDoAnimate = dontAnimate ? {
204
+ ...dontAnimate
205
+ } : {}, refs.current.lastDontAnimate = dontAnimate ? {
206
+ ...dontAnimate
207
+ } : {}, refs.current.lastAnimateAt = Date.now();
208
+ return;
209
+ }
210
+ refs.current.lastDontAnimate = dontAnimate ? {
211
+ ...dontAnimate
212
+ } : {}, refs.current.lastDoAnimate = doAnimate ? {
213
+ ...doAnimate
214
+ } : {};
215
+ return;
216
+ }
217
+ flushAnimation({
218
+ doAnimate,
219
+ dontAnimate,
220
+ animationOptions
221
+ });
222
+ }, [style, isExiting, disableAnimation]), process.env.NODE_ENV === "development" && props.debug && props.debug !== "profile" && (console.groupCollapsed("[motion] render"), console.info({
223
+ style,
224
+ doAnimate,
225
+ dontAnimate,
226
+ scope,
227
+ animationOptions,
228
+ isExiting,
229
+ isFirstRender: refs.current.isFirstRender,
230
+ animationProps
231
+ }), console.groupEnd()), {
232
+ style: firstRenderStyle,
233
+ ref: scope,
234
+ render: "div"
235
+ };
236
+ },
237
+ useAnimatedNumber(initial) {
238
+ var motionValue = useMotionValue(initial);
239
+ return React.useMemo(function () {
240
+ return {
241
+ getInstance() {
242
+ return motionValue;
243
+ },
244
+ getValue() {
245
+ return motionValue.get();
246
+ },
247
+ setValue(next) {
248
+ var config = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {
249
+ type: "spring"
250
+ },
251
+ onFinish = arguments.length > 2 ? arguments[2] : void 0;
252
+ if (config.type === "direct") MotionValueStrategy.set(motionValue, {
253
+ type: "direct"
254
+ }), motionValue.set(next), onFinish?.();else {
255
+ if (MotionValueStrategy.set(motionValue, config), onFinish) var unsubscribe = motionValue.on("change", function (value) {
256
+ Math.abs(value - next) < 0.01 && (unsubscribe(), onFinish());
257
+ });
258
+ motionValue.set(next);
259
+ }
260
+ },
261
+ stop() {
262
+ motionValue.stop();
263
+ }
264
+ };
265
+ }, [motionValue]);
266
+ },
267
+ useAnimatedNumberReaction(param, onValue) {
268
+ var {
269
+ value
270
+ } = param,
271
+ instance = value.getInstance();
272
+ useMotionValueEvent(instance, "change", onValue);
273
+ },
274
+ useAnimatedNumberStyle(val, getStyleProp) {
275
+ var motionValue = val.getInstance(),
276
+ getStyleRef = useRef(getStyleProp);
277
+ return getStyleRef.current = getStyleProp, useMemo(function () {
278
+ return {
279
+ getStyle: function (cur) {
280
+ return getStyleRef.current(cur);
281
+ },
282
+ motionValue
283
+ };
284
+ }, []);
285
+ }
286
+ };
287
+ function getMotionAnimatedProps(props, style, disable) {
288
+ var animationState = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : "default",
289
+ transitionOverride = arguments.length > 4 ? arguments[4] : void 0;
290
+ if (disable) return {
291
+ dontAnimate: style
292
+ };
293
+ var _ref,
294
+ animationOptions = getAnimationOptions((_ref = transitionOverride ?? props.transition) !== null && _ref !== void 0 ? _ref : null, animationState),
295
+ dontAnimate,
296
+ doAnimate,
297
+ animateOnly = props.animateOnly;
298
+ for (var key in style) {
299
+ var value = style[key];
300
+ disableAnimationProps.has(key) || animateOnly && !animateOnly.includes(key) ? (dontAnimate || (dontAnimate = {}), dontAnimate[key] = value) : (doAnimate || (doAnimate = {}), doAnimate[key] = value);
301
+ }
302
+ return {
303
+ dontAnimate,
304
+ doAnimate,
305
+ animationOptions
306
+ };
307
+ }
308
+ function getAnimationOptions(transitionProp) {
309
+ var animationState = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "default",
310
+ normalized = normalizeTransition(transitionProp),
311
+ effectiveKey = getEffectiveAnimation(normalized, animationState);
312
+ !effectiveKey && animationState === "default" && (effectiveKey = normalized.enter || normalized.exit || null);
313
+ var globalConfigOverride = normalized.config ? {
314
+ ...normalized.config
315
+ } : void 0;
316
+ if (!effectiveKey && Object.keys(normalized.properties).length === 0 && !globalConfigOverride) return {};
317
+ var defaultConfig = effectiveKey ? withInferredType(animations[effectiveKey]) : null,
318
+ delay = normalized.delay,
319
+ result = {};
320
+ defaultConfig && Object.assign(result, defaultConfig), globalConfigOverride && (Object.assign(result, globalConfigOverride), result.type === void 0 && result.duration !== void 0 && result.damping === void 0 && result.stiffness === void 0 && result.mass === void 0 && (result.type = "tween")), delay && (result.delay = delay), (defaultConfig || globalConfigOverride || delay) && (result.default = {
321
+ ...defaultConfig,
322
+ ...globalConfigOverride,
323
+ ...(delay ? {
324
+ delay
325
+ } : null)
326
+ });
327
+ var _iteratorNormalCompletion = !0,
328
+ _didIteratorError = !1,
329
+ _iteratorError = void 0;
330
+ try {
331
+ for (var _iterator = Object.entries(normalized.properties)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
332
+ var [propName, animationNameOrConfig] = _step.value;
333
+ if (typeof animationNameOrConfig == "string") result[propName] = withInferredType(animations[animationNameOrConfig]);else if (animationNameOrConfig && (typeof animationNameOrConfig > "u" ? "undefined" : _type_of(animationNameOrConfig)) === "object") {
334
+ var baseConfig = animationNameOrConfig.type ? withInferredType(animations[animationNameOrConfig.type]) : defaultConfig;
335
+ result[propName] = {
336
+ ...baseConfig,
337
+ ...animationNameOrConfig
338
+ };
339
+ }
340
+ }
341
+ } catch (err) {
342
+ _didIteratorError = !0, _iteratorError = err;
343
+ } finally {
344
+ try {
345
+ !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
346
+ } finally {
347
+ if (_didIteratorError) throw _iteratorError;
348
+ }
349
+ }
350
+ convertMsToS(result), convertMsToS(result.default);
351
+ for (var key in result) key !== "default" && _type_of(result[key]) === "object" && convertMsToS(result[key]);
352
+ return result;
353
+ }
354
+ }
355
+ function withInferredType(config) {
356
+ if (!config) return {
357
+ type: "spring"
358
+ };
359
+ var isTimingBased = config.duration !== void 0 && config.damping === void 0 && config.stiffness === void 0 && config.mass === void 0;
360
+ return {
361
+ type: isTimingBased ? "tween" : "spring",
362
+ ...config
363
+ };
364
+ }
365
+ function convertMsToS(config) {
366
+ if (config && (typeof config.delay == "number" && (config.delay = config.delay / 1e3), typeof config.duration == "number")) {
367
+ var isTimingBased = config.type === "tween" || config.type === void 0 && config.damping === void 0 && config.stiffness === void 0 && config.mass === void 0;
368
+ isTimingBased && (config.duration = config.duration / 1e3);
369
+ }
370
+ }
371
+ function removeRemovedStyles(prev, next, node, dontClearIfIn) {
372
+ for (var key in prev) if (!(key in next)) {
373
+ if (dontClearIfIn && key in dontClearIfIn) continue;
374
+ node.style[key] = "";
375
+ }
376
+ }
377
+ var disableAnimationProps = /* @__PURE__ */new Set(["alignContent", "alignItems", "boxSizing", "contain", "containerType", "display", "flexBasis", "flexDirection", "fontFamily", "justifyContent", "overflow", "overflowX", "overflowY", "pointerEvents", "position", "textWrap", "userSelect"]),
378
+ MotionView = createMotionView("div"),
379
+ MotionText = createMotionView("span");
380
+ function createMotionView(defaultTag) {
381
+ var isText = defaultTag === "span",
382
+ Component = /* @__PURE__ */forwardRef(function (propsIn, ref) {
383
+ var _hooks_usePropsTransform,
384
+ {
385
+ forwardedRef,
386
+ animation,
387
+ render = defaultTag,
388
+ style,
389
+ ...propsRest
390
+ } = propsIn,
391
+ [scope, animate] = useAnimateSSRSafe(),
392
+ hostRef = useRef(null),
393
+ composedRefs = useComposedRefs(forwardedRef, ref, hostRef, scope),
394
+ stateRef = useRef(null);
395
+ stateRef.current || (stateRef.current = {
396
+ get host() {
397
+ return hostRef.current;
398
+ }
399
+ });
400
+ var [_, state] = useThemeWithState({}),
401
+ styles = Array.isArray(style) ? style : [style],
402
+ [animatedStyle, nonAnimatedStyles] = function () {
403
+ var animatedStyle2,
404
+ nonAnimatedStyles2 = [],
405
+ _iteratorNormalCompletion = !0,
406
+ _didIteratorError = !1,
407
+ _iteratorError = void 0;
408
+ try {
409
+ for (var _iterator = styles[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
410
+ var style2 = _step.value;
411
+ style2.getStyle ? animatedStyle2 = style2 : nonAnimatedStyles2.push(style2);
412
+ }
413
+ } catch (err) {
414
+ _didIteratorError = !0, _iteratorError = err;
415
+ } finally {
416
+ try {
417
+ !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
418
+ } finally {
419
+ if (_didIteratorError) throw _iteratorError;
420
+ }
421
+ }
422
+ return [animatedStyle2, nonAnimatedStyles2];
423
+ }();
424
+ function getProps(props2) {
425
+ var out = getSplitStyles(props2, isText ? Text.staticConfig : View.staticConfig, state?.theme, state?.name, {
426
+ unmounted: !1
427
+ }, {
428
+ isAnimated: !1,
429
+ noClass: !0,
430
+ resolveValues: "auto"
431
+ });
432
+ return out ? (out.viewProps.style && (fixStyles(out.viewProps.style), styleToCSS(out.viewProps.style)), out.viewProps) : {};
433
+ }
434
+ var props = getProps({
435
+ ...propsRest,
436
+ style: nonAnimatedStyles
437
+ }),
438
+ Element = render || "div",
439
+ transformedProps = (_hooks_usePropsTransform = hooks.usePropsTransform) === null || _hooks_usePropsTransform === void 0 ? void 0 : _hooks_usePropsTransform.call(hooks, render, props, stateRef, !1);
440
+ return useEffect(function () {
441
+ if (animatedStyle) return animatedStyle.motionValue.on("change", function (value) {
442
+ var nextStyle = animatedStyle.getStyle(value),
443
+ animationConfig = MotionValueStrategy.get(animatedStyle.motionValue),
444
+ node = hostRef.current,
445
+ webStyle = getProps({
446
+ style: nextStyle
447
+ }).style;
448
+ if (webStyle && _instanceof(node, HTMLElement)) {
449
+ var motionAnimationConfig = animationConfig?.type === "timing" ? {
450
+ type: "tween",
451
+ duration: (animationConfig?.duration || 0) / 1e3
452
+ } : animationConfig?.type === "direct" ? {
453
+ type: "tween",
454
+ duration: 0
455
+ } : {
456
+ type: "spring",
457
+ ...animationConfig
458
+ };
459
+ animate(node, webStyle, motionAnimationConfig);
460
+ }
461
+ });
462
+ }, [animatedStyle]), /* @__PURE__ */_jsx(Element, {
463
+ ...transformedProps,
464
+ ref: composedRefs
465
+ });
466
+ });
467
+ return Component.acceptRenderProp = !0, Component;
468
+ }
469
+ function getDiff(previous, next) {
470
+ if (!previous) return next;
471
+ var diff = null;
472
+ for (var key in next) next[key] !== previous[key] && (diff || (diff = {}), diff[key] = next[key]);
473
+ return diff;
474
+ }
475
+ function fixTransparentColors(diff, previous, next) {
476
+ var result = diff;
477
+ for (var key in diff) if (diff[key] === "transparent") {
478
+ var fixed = "rgba(0, 0, 0, 0)",
479
+ candidates = [previous?.[key], next?.[key]],
480
+ _iteratorNormalCompletion = !0,
481
+ _didIteratorError = !1,
482
+ _iteratorError = void 0;
483
+ try {
484
+ for (var _iterator = candidates[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
485
+ var candidate = _step.value;
486
+ if (typeof candidate == "string" && candidate !== "transparent") {
487
+ var rgbaMatch = candidate.match(/^rgba?\(([^,]+),\s*([^,]+),\s*([^,)]+)/);
488
+ if (rgbaMatch) {
489
+ fixed = `rgba(${rgbaMatch[1]}, ${rgbaMatch[2]}, ${rgbaMatch[3]}, 0)`;
490
+ break;
491
+ }
492
+ }
493
+ }
494
+ } catch (err) {
495
+ _didIteratorError = !0, _iteratorError = err;
496
+ } finally {
497
+ try {
498
+ !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
499
+ } finally {
500
+ if (_didIteratorError) throw _iteratorError;
501
+ }
502
+ }
503
+ result === diff && (result = {
504
+ ...diff
505
+ }), result[key] = fixed;
506
+ }
507
+ return result;
508
+ }
509
+ export { createAnimations, disableAnimationProps };
510
+ //# sourceMappingURL=createAnimations.native.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["jsx","_jsx","getEffectiveAnimation","normalizeTransition","ResetPresence","usePresence","fixStyles","getConfig","getSplitStyles","hooks","styleToCSS","Text","useComposedRefs","useIsomorphicLayoutEffect","useThemeWithState","View","useAnimate","useMotionValue","useMotionValueEvent","React","forwardRef","useEffect","useLayoutEffect","useMemo","useRef","useState","_instanceof","left","right","Symbol","hasInstance","_type_of","obj","constructor","isServer","window","useAnimateSSRSafe","MotionValueStrategy","WeakMap","createAnimations","animations","isHydratingGlobal","hydratingComponents","Set","MotionView","MotionText","isReactNative","inputStyle","outputStyle","avoidReRenders","onMount","forEach","cb","useAnimations","animationProps","settings","disableSSR","props","style","componentState","stateRef","useStyleEmitter","presence","animationKey","Array","isArray","transition","isComponentHydrating","unmounted","isMounting","isEntering","isExiting","sendExitComplete","refs","current","isFirstRender","lastDoAnimate","lastDontAnimate","controls","lastAnimateAt","disposed","wasExiting","animationState","frozenExitTarget","exitCompleteScheduled","wasEntering","justFinishedEntering","disableAnimation","scope","animate","justStartedExiting","justStoppedExiting","dontAnimate","doAnimate","animationOptions","getMotionAnimatedProps","firstRenderStyle","isHydrating","setIsHydrating","add","flushAnimation","param","doAnimateRaw","passedOptions","dontAnimate2","startedControls","isCurrentlyExiting","currentSendExitComplete","doAnimate2","_props_transition","animationOptions2","getAnimationOptions","node","host","process","env","NODE_ENV","debug","console","groupCollapsed","JSON","stringify","getDiff","info","trace","groupEnd","HTMLElement","prevDont","removeRemovedStyles","changed","Object","assign","key","lastAnimated","diff","isPopperPosition","hasAttribute","midFlightValues","computed","getComputedStyle","key1","val","stop","key2","anims","getAnimations","_iteratorNormalCompletion","_didIteratorError","_iteratorError","_iterator","iterator","_step","next","done","anim","value","cancel","err","return","fixedDiff","fixTransparentColors","transform","Date","now","finished","then","catch","nextStyle","effectiveTransition","_$animationProps","keys","length","ref","render","useAnimatedNumber","initial","motionValue","getInstance","getValue","get","setValue","config","arguments","type","onFinish","set","unsubscribe","on","Math","abs","useAnimatedNumberReaction","onValue","instance","useAnimatedNumberStyle","getStyleProp","getStyleRef","getStyle","cur","disable","transitionOverride","_ref","animateOnly","disableAnimationProps","has","includes","transitionProp","normalized","effectiveKey","enter","exit","globalConfigOverride","properties","defaultConfig","withInferredType","delay","result","duration","damping","stiffness","mass","default","entries","propName","animationNameOrConfig","baseConfig","convertMsToS","isTimingBased","prev","dontClearIfIn","createMotionView","defaultTag","isText","Component","propsIn","_hooks_usePropsTransform","forwardedRef","animation","propsRest","hostRef","composedRefs","_","state","styles","animatedStyle","nonAnimatedStyles","animatedStyle2","nonAnimatedStyles2","style2","push","getProps","props2","out","staticConfig","theme","name","isAnimated","noClass","resolveValues","viewProps"],"sources":["../../src/createAnimations.tsx"],"sourcesContent":[null],"mappings":"AAAA,SAASA,GAAA,IAAAC,IAAA,2BAAuB;AAChC,SAASC,qBAAe,EAAAC,mBAAmB;AAC3C,SAAAC,aAAA,EAAAC,WAAA;AAAA,SAGEC,SAAA,EAAAC,SAAA,EAAAC,cAAA,EAAAC,KAAA,EAAAC,UAAA,EAAAC,IAAA,EAAAC,eAAA,EAAAC,yBAAA,EAAAC,iBAAA,EAAAC,IAAA;AAAA,SACAC,UAAA,EAAAC,cAAA,EAAAC,mBAAA;AAAA,OACAC,KAAA,IAAAC,UAAA,EAAAC,SAAA,EAAAC,eAAA,EAAAC,OAAA,EAAAC,MAAA,EAAAC,QAAA;AAAA,SACAC,YAAAC,IAAA,EAAAC,KAAA;EACA,OAAAA,KAAA,mBAAAC,MAAA,UAAAD,KAAA,CAAAC,MAAA,CAAAC,WAAA,MAAAF,KAAA,CAAAC,MAAA,CAAAC,WAAA,EAAAH,IAAA,IAAAA,IAAA,YAAAC,KAAA;AAAA;AACA,SAGAG,SAAAC,GAAA;EACA;;EACA,OAAAA,GAAA,WAAAH,M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ACb;UACE;UACE,OAAI,CACJiG,cAAM,EACNC,kBAAW,CACT;QACE;MACA,SAAAG,QAAIA,CAAAC,MAAW;QACb,IAAAC,GAAA,GAAAnP,cAAgB,CAAAkP,MAAA,EAAWnB,MAAM,GAAA5N,IAAA,CAAAiP,YAAiB,GAAA7O,IAAU,CAAC6O,YAAC,EAAAX,KAAA,EAAAY,KAAA,EAAAZ,KAAA,EAAAa,IAAA;UAC9D1L,SAAA;QAAA;UAEJ2L,UAAA;UAEEC,OAAA,EAAW;UAIjBC,aAAA;QAEF;QACF,OAAAN,GAAA,IAAAA,GAAA,CAAAO,SAAA,CAAAxM,KAAA,KAAApD,SAAA,CAAAqP,GAAA,CAAAO,SAAA,CAAAxM,KAAA,GAAAhD,UAAA,CAAAiP,GAAA,CAAAO,SAAA,CAAAxM,KAAA,IAAAiM,GAAA,CAAAO,SAAA","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ export * from "./createAnimations.mjs";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AAEA,cAAc","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ export * from "./createAnimations.mjs";
2
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AAEA,cAAc","ignoreList":[]}
@@ -0,0 +1,11 @@
1
+ var hasWarnedOnce = !1;
2
+ function createAnimations(_animations) {
3
+ return process.env.NODE_ENV === "development" && (hasWarnedOnce || (hasWarnedOnce = !0, console.warn("[@hanzogui/animations-motion] This animation driver only works on web. On native, use @hanzogui/animations-react-native or @hanzogui/animations-reanimated instead."))), {
4
+ isReactNative: !1,
5
+ animations: _animations,
6
+ View: void 0,
7
+ Text: void 0
8
+ };
9
+ }
10
+ export { createAnimations };
11
+ //# sourceMappingURL=index.native.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["hasWarnedOnce","createAnimations","_animations","process","env","NODE_ENV","console","warn","isReactNative","animations","View","Text"],"sources":["../../src/index.native.ts"],"sourcesContent":[null],"mappings":"AAEA,IAAIA,aAAA,GAAgB;AACb,SAASC,iBAAiBC,WAAA,EAAa;EAC1C,OAAIC,OAAA,CAAQC,GAAA,CAAIC,QAAA,KAAa,kBACpBL,aAAA,KACDA,aAAA,GAAgB,IAChBM,OAAA,CAAQC,IAAA,CAAK,qKAAqK,KAKnL;IACHC,aAAA,EAAe;IACfC,UAAA,EAAYP,WAAA;IACZQ,IAAA,EAAM;IACNC,IAAA,EAAM;EACV;AACJ","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ typeof requestAnimationFrame > "u" && (globalThis.requestAnimationFrame = setTimeout);
2
+ //# sourceMappingURL=polyfill.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["requestAnimationFrame","globalThis","setTimeout"],"sources":["../../src/polyfill.ts"],"sourcesContent":[null],"mappings":"AACI,OAAOA,qBAAA,GAA0B,QACnCC,UAAA,CAAWD,qBAAA,GAA2BE,UAAA","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ typeof requestAnimationFrame > "u" && (globalThis.requestAnimationFrame = setTimeout);
2
+ //# sourceMappingURL=polyfill.native.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["requestAnimationFrame","globalThis","setTimeout"],"sources":["../../src/polyfill.ts"],"sourcesContent":[null],"mappings":"AACI,OAAOA,qBAAA,GAA0B,QACnCC,UAAA,CAAWD,qBAAA,GAA2BE,UAAA","ignoreList":[]}
package/package.json ADDED
@@ -0,0 +1,53 @@
1
+ {
2
+ "name": "@hanzogui/animations-motion",
3
+ "version": "2.0.0",
4
+ "license": "MIT",
5
+ "source": "src/index.ts",
6
+ "files": [
7
+ "src",
8
+ "types",
9
+ "dist"
10
+ ],
11
+ "type": "module",
12
+ "sideEffects": [
13
+ "polyfill.js",
14
+ "polyfill.mjs"
15
+ ],
16
+ "main": "dist/cjs",
17
+ "module": "dist/esm",
18
+ "types": "./types/index.d.ts",
19
+ "exports": {
20
+ "./package.json": "./package.json",
21
+ ".": {
22
+ "types": "./types/index.d.ts",
23
+ "react-native": "./dist/esm/index.native.js",
24
+ "browser": "./dist/esm/index.mjs",
25
+ "module": "./dist/esm/index.mjs",
26
+ "import": "./dist/esm/index.mjs",
27
+ "require": "./dist/cjs/index.cjs",
28
+ "default": "./dist/esm/index.mjs"
29
+ }
30
+ },
31
+ "publishConfig": {
32
+ "access": "public"
33
+ },
34
+ "scripts": {
35
+ "build": "hanzo-gui-build",
36
+ "watch": "hanzo-gui-build --watch",
37
+ "clean": "hanzo-gui-build clean",
38
+ "clean:build": "hanzo-gui-build clean:build"
39
+ },
40
+ "dependencies": {
41
+ "@hanzogui/animation-helpers": "workspace:*",
42
+ "@hanzogui/use-presence": "workspace:*",
43
+ "@hanzogui/web": "workspace:*",
44
+ "motion": ">=12.35.1"
45
+ },
46
+ "devDependencies": {
47
+ "@hanzogui/build": "workspace:*",
48
+ "react": ">=19"
49
+ },
50
+ "peerDependencies": {
51
+ "react": ">=19"
52
+ }
53
+ }