@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,548 @@
1
+ "use strict";
2
+
3
+ var __create = Object.create;
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getProtoOf = Object.getPrototypeOf,
8
+ __hasOwnProp = Object.prototype.hasOwnProperty;
9
+ var __export = (target, all) => {
10
+ for (var name in all) __defProp(target, name, {
11
+ get: all[name],
12
+ enumerable: !0
13
+ });
14
+ },
15
+ __copyProps = (to, from, except, desc) => {
16
+ if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
17
+ get: () => from[key],
18
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
19
+ });
20
+ return to;
21
+ };
22
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
23
+ // If the importer is in node compatibility mode or this is not an ESM
24
+ // file that has been converted to a CommonJS file using a Babel-
25
+ // compatible transform (i.e. "__esModule" has not been set), then set
26
+ // "default" to the CommonJS "module.exports" for node compatibility.
27
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
28
+ value: mod,
29
+ enumerable: !0
30
+ }) : target, mod)),
31
+ __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
32
+ value: !0
33
+ }), mod);
34
+ var createAnimations_exports = {};
35
+ __export(createAnimations_exports, {
36
+ createAnimations: () => createAnimations,
37
+ disableAnimationProps: () => disableAnimationProps
38
+ });
39
+ module.exports = __toCommonJS(createAnimations_exports);
40
+ var import_jsx_runtime = require("react/jsx-runtime"),
41
+ import_animation_helpers = require("@hanzogui/animation-helpers"),
42
+ import_use_presence = require("@hanzogui/use-presence"),
43
+ import_web = require("@hanzogui/web"),
44
+ import_react = require("motion/react"),
45
+ import_react2 = __toESM(require("react"), 1);
46
+ function _instanceof(left, right) {
47
+ return right != null && typeof Symbol < "u" && right[Symbol.hasInstance] ? !!right[Symbol.hasInstance](left) : left instanceof right;
48
+ }
49
+ function _type_of(obj) {
50
+ "@swc/helpers - typeof";
51
+
52
+ return obj && typeof Symbol < "u" && obj.constructor === Symbol ? "symbol" : typeof obj;
53
+ }
54
+ var isServer = typeof window > "u";
55
+ function useAnimateSSRSafe() {
56
+ return isServer ? [(0, import_react2.useRef)(null), function () {}] : (0, import_react.useAnimate)();
57
+ }
58
+ var MotionValueStrategy = /* @__PURE__ */new WeakMap();
59
+ function createAnimations(animations) {
60
+ var isHydratingGlobal,
61
+ hydratingComponents = /* @__PURE__ */new Set();
62
+ return {
63
+ View: MotionView,
64
+ Text: MotionText,
65
+ isReactNative: !1,
66
+ inputStyle: "css",
67
+ outputStyle: "inline",
68
+ avoidReRenders: !0,
69
+ animations,
70
+ usePresence: import_use_presence.usePresence,
71
+ ResetPresence: import_use_presence.ResetPresence,
72
+ onMount() {
73
+ isHydratingGlobal = !1, hydratingComponents.forEach(function (cb) {
74
+ return cb();
75
+ });
76
+ },
77
+ useAnimations: function (animationProps) {
78
+ isHydratingGlobal === void 0 && !(0, import_web.getConfig)().settings.disableSSR && (isHydratingGlobal = !0);
79
+ var {
80
+ props,
81
+ style,
82
+ componentState,
83
+ stateRef,
84
+ useStyleEmitter,
85
+ presence
86
+ } = animationProps,
87
+ animationKey = Array.isArray(props.transition) ? props.transition[0] : props.transition,
88
+ isComponentHydrating = componentState.unmounted === !0,
89
+ isMounting = componentState.unmounted === "should-enter",
90
+ isEntering = !!componentState.unmounted,
91
+ isExiting = presence?.[0] === !1,
92
+ sendExitComplete = presence?.[1],
93
+ refs = (0, import_react2.useRef)(null);
94
+ refs.current || (refs.current = {
95
+ isFirstRender: !0,
96
+ lastDoAnimate: null,
97
+ lastDontAnimate: null,
98
+ controls: null,
99
+ lastAnimateAt: 0,
100
+ disposed: !1,
101
+ wasExiting: !1,
102
+ isExiting: !1,
103
+ sendExitComplete: void 0,
104
+ animationState: "default",
105
+ frozenExitTarget: null,
106
+ exitCompleteScheduled: !1,
107
+ wasEntering: !1
108
+ });
109
+ var justFinishedEntering = refs.current.wasEntering && !isEntering;
110
+ (0, import_react2.useEffect)(function () {
111
+ refs.current.wasEntering = isEntering;
112
+ });
113
+ var animationState = isExiting ? "exit" : isMounting || justFinishedEntering ? "enter" : "default",
114
+ disableAnimation = isComponentHydrating || isMounting || !animationKey,
115
+ [scope, animate] = useAnimateSSRSafe();
116
+ refs.current.isExiting = isExiting, refs.current.sendExitComplete = sendExitComplete, refs.current.animationState = animationState;
117
+ var justStartedExiting = isExiting && !refs.current.wasExiting,
118
+ justStoppedExiting = !isExiting && refs.current.wasExiting;
119
+ (justStartedExiting || justStoppedExiting) && (refs.current.frozenExitTarget = null, refs.current.exitCompleteScheduled = !1), (0, import_react2.useEffect)(function () {
120
+ refs.current.wasExiting = isExiting;
121
+ });
122
+ var {
123
+ dontAnimate = {},
124
+ doAnimate,
125
+ animationOptions
126
+ } = getMotionAnimatedProps(props, style, disableAnimation, animationState),
127
+ [firstRenderStyle] = (0, import_react2.useState)(style);
128
+ refs.current.isFirstRender && (refs.current.lastDontAnimate = firstRenderStyle);
129
+ var [isHydrating, setIsHydrating] = (0, import_react2.useState)(isHydratingGlobal);
130
+ (0, import_react2.useLayoutEffect)(function () {
131
+ return isHydratingGlobal && hydratingComponents.add(function () {
132
+ setIsHydrating(!1);
133
+ }), function () {
134
+ refs.current.disposed = !0;
135
+ };
136
+ }, []);
137
+ var flushAnimation = function (param) {
138
+ var {
139
+ doAnimate: doAnimateRaw = {},
140
+ animationOptions: passedOptions = {},
141
+ dontAnimate: dontAnimate2
142
+ } = param,
143
+ startedControls = null,
144
+ isCurrentlyExiting = refs.current.isExiting,
145
+ currentSendExitComplete = refs.current.sendExitComplete,
146
+ doAnimate2 = doAnimateRaw;
147
+ isCurrentlyExiting && refs.current.frozenExitTarget && (doAnimate2 = refs.current.frozenExitTarget);
148
+ var _props_transition,
149
+ animationOptions2 = isCurrentlyExiting && currentSendExitComplete ? getAnimationOptions((_props_transition = props.transition) !== null && _props_transition !== void 0 ? _props_transition : null, "exit") : passedOptions;
150
+ try {
151
+ var node = stateRef.current.host;
152
+ 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({
153
+ props,
154
+ componentState,
155
+ doAnimate: doAnimate2,
156
+ dontAnimate: dontAnimate2,
157
+ animationOptions: animationOptions2,
158
+ animationProps,
159
+ lastDoAnimate: {
160
+ ...refs.current.lastDoAnimate
161
+ },
162
+ lastDontAnimate: {
163
+ ...refs.current.lastDontAnimate
164
+ },
165
+ isExiting,
166
+ style,
167
+ node
168
+ }), console.groupCollapsed("trace >"), console.trace(), console.groupEnd(), console.groupEnd()), !_instanceof(node, HTMLElement)) return;
169
+ var prevDont = refs.current.lastDontAnimate;
170
+ if (dontAnimate2) if (prevDont) {
171
+ removeRemovedStyles(prevDont, dontAnimate2, node, doAnimate2);
172
+ var changed = getDiff(prevDont, dontAnimate2);
173
+ changed && Object.assign(node.style, changed);
174
+ } else Object.assign(node.style, dontAnimate2);
175
+ if (doAnimate2) {
176
+ if (prevDont) for (var key in prevDont) key in doAnimate2 && (node.style[key] = prevDont[key], refs.current.lastDoAnimate && (refs.current.lastDoAnimate[key] = prevDont[key]));
177
+ var lastAnimated = refs.current.lastDoAnimate;
178
+ lastAnimated && removeRemovedStyles(lastAnimated, doAnimate2, node, dontAnimate2);
179
+ var diff = getDiff(refs.current.lastDoAnimate, doAnimate2);
180
+ if (diff) {
181
+ isCurrentlyExiting && !refs.current.frozenExitTarget && (refs.current.frozenExitTarget = {
182
+ ...doAnimate2
183
+ });
184
+ var isPopperPosition = node.hasAttribute("data-popper-animate-position"),
185
+ midFlightValues = null;
186
+ if (refs.current.controls) {
187
+ try {
188
+ var computed = getComputedStyle(node);
189
+ midFlightValues = {};
190
+ for (var key1 in diff) {
191
+ var val = computed[key1];
192
+ val !== void 0 && val !== "" && (midFlightValues[key1] = val);
193
+ }
194
+ } catch {}
195
+ if (isCurrentlyExiting && refs.current.controls.stop(), midFlightValues) for (var key2 in midFlightValues) node.style[key2] = midFlightValues[key2];
196
+ if (isPopperPosition) {
197
+ var anims = node.getAnimations(),
198
+ _iteratorNormalCompletion = !0,
199
+ _didIteratorError = !1,
200
+ _iteratorError = void 0;
201
+ try {
202
+ for (var _iterator = anims[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
203
+ var anim = _step.value;
204
+ anim.cancel();
205
+ }
206
+ } catch (err) {
207
+ _didIteratorError = !0, _iteratorError = err;
208
+ } finally {
209
+ try {
210
+ !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
211
+ } finally {
212
+ if (_didIteratorError) throw _iteratorError;
213
+ }
214
+ }
215
+ }
216
+ }
217
+ var fixedDiff = fixTransparentColors(diff, refs.current.lastDoAnimate, doAnimate2);
218
+ 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();
219
+ }
220
+ }
221
+ refs.current.lastDontAnimate = dontAnimate2 ? {
222
+ ...dontAnimate2
223
+ } : {}, refs.current.lastDoAnimate = doAnimate2 ? {
224
+ ...doAnimate2
225
+ } : {};
226
+ } finally {
227
+ isCurrentlyExiting && currentSendExitComplete && (startedControls ? (refs.current.exitCompleteScheduled = !0, startedControls.finished.then(function () {
228
+ refs.current.isExiting && currentSendExitComplete();
229
+ }).catch(function () {
230
+ refs.current.isExiting && currentSendExitComplete();
231
+ })) : refs.current.exitCompleteScheduled || currentSendExitComplete());
232
+ }
233
+ };
234
+ return useStyleEmitter?.(function (nextStyle, effectiveTransition) {
235
+ var _$animationProps = getMotionAnimatedProps(props, nextStyle, disableAnimation, refs.current.animationState, effectiveTransition);
236
+ flushAnimation(_$animationProps);
237
+ }), (0, import_web.useIsomorphicLayoutEffect)(function () {
238
+ if (refs.current.isFirstRender) {
239
+ if (refs.current.isFirstRender = !1, isHydrating) {
240
+ doAnimate && Object.keys(doAnimate).length > 0 ? refs.current.lastDoAnimate = {
241
+ ...doAnimate
242
+ } : refs.current.lastDoAnimate = dontAnimate ? {
243
+ ...dontAnimate
244
+ } : {}, refs.current.lastDontAnimate = dontAnimate ? {
245
+ ...dontAnimate
246
+ } : {}, refs.current.lastAnimateAt = Date.now();
247
+ return;
248
+ }
249
+ refs.current.lastDontAnimate = dontAnimate ? {
250
+ ...dontAnimate
251
+ } : {}, refs.current.lastDoAnimate = doAnimate ? {
252
+ ...doAnimate
253
+ } : {};
254
+ return;
255
+ }
256
+ flushAnimation({
257
+ doAnimate,
258
+ dontAnimate,
259
+ animationOptions
260
+ });
261
+ }, [style, isExiting, disableAnimation]), process.env.NODE_ENV === "development" && props.debug && props.debug !== "profile" && (console.groupCollapsed("[motion] render"), console.info({
262
+ style,
263
+ doAnimate,
264
+ dontAnimate,
265
+ scope,
266
+ animationOptions,
267
+ isExiting,
268
+ isFirstRender: refs.current.isFirstRender,
269
+ animationProps
270
+ }), console.groupEnd()), {
271
+ style: firstRenderStyle,
272
+ ref: scope,
273
+ render: "div"
274
+ };
275
+ },
276
+ useAnimatedNumber(initial) {
277
+ var motionValue = (0, import_react.useMotionValue)(initial);
278
+ return import_react2.default.useMemo(function () {
279
+ return {
280
+ getInstance() {
281
+ return motionValue;
282
+ },
283
+ getValue() {
284
+ return motionValue.get();
285
+ },
286
+ setValue(next) {
287
+ var config = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {
288
+ type: "spring"
289
+ },
290
+ onFinish = arguments.length > 2 ? arguments[2] : void 0;
291
+ if (config.type === "direct") MotionValueStrategy.set(motionValue, {
292
+ type: "direct"
293
+ }), motionValue.set(next), onFinish?.();else {
294
+ if (MotionValueStrategy.set(motionValue, config), onFinish) var unsubscribe = motionValue.on("change", function (value) {
295
+ Math.abs(value - next) < 0.01 && (unsubscribe(), onFinish());
296
+ });
297
+ motionValue.set(next);
298
+ }
299
+ },
300
+ stop() {
301
+ motionValue.stop();
302
+ }
303
+ };
304
+ }, [motionValue]);
305
+ },
306
+ useAnimatedNumberReaction(param, onValue) {
307
+ var {
308
+ value
309
+ } = param,
310
+ instance = value.getInstance();
311
+ (0, import_react.useMotionValueEvent)(instance, "change", onValue);
312
+ },
313
+ useAnimatedNumberStyle(val, getStyleProp) {
314
+ var motionValue = val.getInstance(),
315
+ getStyleRef = (0, import_react2.useRef)(getStyleProp);
316
+ return getStyleRef.current = getStyleProp, (0, import_react2.useMemo)(function () {
317
+ return {
318
+ getStyle: function (cur) {
319
+ return getStyleRef.current(cur);
320
+ },
321
+ motionValue
322
+ };
323
+ }, []);
324
+ }
325
+ };
326
+ function getMotionAnimatedProps(props, style, disable) {
327
+ var animationState = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : "default",
328
+ transitionOverride = arguments.length > 4 ? arguments[4] : void 0;
329
+ if (disable) return {
330
+ dontAnimate: style
331
+ };
332
+ var _ref,
333
+ animationOptions = getAnimationOptions((_ref = transitionOverride ?? props.transition) !== null && _ref !== void 0 ? _ref : null, animationState),
334
+ dontAnimate,
335
+ doAnimate,
336
+ animateOnly = props.animateOnly;
337
+ for (var key in style) {
338
+ var value = style[key];
339
+ disableAnimationProps.has(key) || animateOnly && !animateOnly.includes(key) ? (dontAnimate || (dontAnimate = {}), dontAnimate[key] = value) : (doAnimate || (doAnimate = {}), doAnimate[key] = value);
340
+ }
341
+ return {
342
+ dontAnimate,
343
+ doAnimate,
344
+ animationOptions
345
+ };
346
+ }
347
+ function getAnimationOptions(transitionProp) {
348
+ var animationState = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "default",
349
+ normalized = (0, import_animation_helpers.normalizeTransition)(transitionProp),
350
+ effectiveKey = (0, import_animation_helpers.getEffectiveAnimation)(normalized, animationState);
351
+ !effectiveKey && animationState === "default" && (effectiveKey = normalized.enter || normalized.exit || null);
352
+ var globalConfigOverride = normalized.config ? {
353
+ ...normalized.config
354
+ } : void 0;
355
+ if (!effectiveKey && Object.keys(normalized.properties).length === 0 && !globalConfigOverride) return {};
356
+ var defaultConfig = effectiveKey ? withInferredType(animations[effectiveKey]) : null,
357
+ delay = normalized.delay,
358
+ result = {};
359
+ 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 = {
360
+ ...defaultConfig,
361
+ ...globalConfigOverride,
362
+ ...(delay ? {
363
+ delay
364
+ } : null)
365
+ });
366
+ var _iteratorNormalCompletion = !0,
367
+ _didIteratorError = !1,
368
+ _iteratorError = void 0;
369
+ try {
370
+ for (var _iterator = Object.entries(normalized.properties)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
371
+ var [propName, animationNameOrConfig] = _step.value;
372
+ if (typeof animationNameOrConfig == "string") result[propName] = withInferredType(animations[animationNameOrConfig]);else if (animationNameOrConfig && (typeof animationNameOrConfig > "u" ? "undefined" : _type_of(animationNameOrConfig)) === "object") {
373
+ var baseConfig = animationNameOrConfig.type ? withInferredType(animations[animationNameOrConfig.type]) : defaultConfig;
374
+ result[propName] = {
375
+ ...baseConfig,
376
+ ...animationNameOrConfig
377
+ };
378
+ }
379
+ }
380
+ } catch (err) {
381
+ _didIteratorError = !0, _iteratorError = err;
382
+ } finally {
383
+ try {
384
+ !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
385
+ } finally {
386
+ if (_didIteratorError) throw _iteratorError;
387
+ }
388
+ }
389
+ convertMsToS(result), convertMsToS(result.default);
390
+ for (var key in result) key !== "default" && _type_of(result[key]) === "object" && convertMsToS(result[key]);
391
+ return result;
392
+ }
393
+ }
394
+ function withInferredType(config) {
395
+ if (!config) return {
396
+ type: "spring"
397
+ };
398
+ var isTimingBased = config.duration !== void 0 && config.damping === void 0 && config.stiffness === void 0 && config.mass === void 0;
399
+ return {
400
+ type: isTimingBased ? "tween" : "spring",
401
+ ...config
402
+ };
403
+ }
404
+ function convertMsToS(config) {
405
+ if (config && (typeof config.delay == "number" && (config.delay = config.delay / 1e3), typeof config.duration == "number")) {
406
+ var isTimingBased = config.type === "tween" || config.type === void 0 && config.damping === void 0 && config.stiffness === void 0 && config.mass === void 0;
407
+ isTimingBased && (config.duration = config.duration / 1e3);
408
+ }
409
+ }
410
+ function removeRemovedStyles(prev, next, node, dontClearIfIn) {
411
+ for (var key in prev) if (!(key in next)) {
412
+ if (dontClearIfIn && key in dontClearIfIn) continue;
413
+ node.style[key] = "";
414
+ }
415
+ }
416
+ var disableAnimationProps = /* @__PURE__ */new Set(["alignContent", "alignItems", "boxSizing", "contain", "containerType", "display", "flexBasis", "flexDirection", "fontFamily", "justifyContent", "overflow", "overflowX", "overflowY", "pointerEvents", "position", "textWrap", "userSelect"]),
417
+ MotionView = createMotionView("div"),
418
+ MotionText = createMotionView("span");
419
+ function createMotionView(defaultTag) {
420
+ var isText = defaultTag === "span",
421
+ Component = /* @__PURE__ */(0, import_react2.forwardRef)(function (propsIn, ref) {
422
+ var _hooks_usePropsTransform,
423
+ {
424
+ forwardedRef,
425
+ animation,
426
+ render = defaultTag,
427
+ style,
428
+ ...propsRest
429
+ } = propsIn,
430
+ [scope, animate] = useAnimateSSRSafe(),
431
+ hostRef = (0, import_react2.useRef)(null),
432
+ composedRefs = (0, import_web.useComposedRefs)(forwardedRef, ref, hostRef, scope),
433
+ stateRef = (0, import_react2.useRef)(null);
434
+ stateRef.current || (stateRef.current = {
435
+ get host() {
436
+ return hostRef.current;
437
+ }
438
+ });
439
+ var [_, state] = (0, import_web.useThemeWithState)({}),
440
+ styles = Array.isArray(style) ? style : [style],
441
+ [animatedStyle, nonAnimatedStyles] = function () {
442
+ var animatedStyle2,
443
+ nonAnimatedStyles2 = [],
444
+ _iteratorNormalCompletion = !0,
445
+ _didIteratorError = !1,
446
+ _iteratorError = void 0;
447
+ try {
448
+ for (var _iterator = styles[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
449
+ var style2 = _step.value;
450
+ style2.getStyle ? animatedStyle2 = style2 : nonAnimatedStyles2.push(style2);
451
+ }
452
+ } catch (err) {
453
+ _didIteratorError = !0, _iteratorError = err;
454
+ } finally {
455
+ try {
456
+ !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
457
+ } finally {
458
+ if (_didIteratorError) throw _iteratorError;
459
+ }
460
+ }
461
+ return [animatedStyle2, nonAnimatedStyles2];
462
+ }();
463
+ function getProps(props2) {
464
+ var out = (0, import_web.getSplitStyles)(props2, isText ? import_web.Text.staticConfig : import_web.View.staticConfig, state?.theme, state?.name, {
465
+ unmounted: !1
466
+ }, {
467
+ isAnimated: !1,
468
+ noClass: !0,
469
+ resolveValues: "auto"
470
+ });
471
+ return out ? (out.viewProps.style && ((0, import_web.fixStyles)(out.viewProps.style), (0, import_web.styleToCSS)(out.viewProps.style)), out.viewProps) : {};
472
+ }
473
+ var props = getProps({
474
+ ...propsRest,
475
+ style: nonAnimatedStyles
476
+ }),
477
+ Element = render || "div",
478
+ transformedProps = (_hooks_usePropsTransform = import_web.hooks.usePropsTransform) === null || _hooks_usePropsTransform === void 0 ? void 0 : _hooks_usePropsTransform.call(import_web.hooks, render, props, stateRef, !1);
479
+ return (0, import_react2.useEffect)(function () {
480
+ if (animatedStyle) return animatedStyle.motionValue.on("change", function (value) {
481
+ var nextStyle = animatedStyle.getStyle(value),
482
+ animationConfig = MotionValueStrategy.get(animatedStyle.motionValue),
483
+ node = hostRef.current,
484
+ webStyle = getProps({
485
+ style: nextStyle
486
+ }).style;
487
+ if (webStyle && _instanceof(node, HTMLElement)) {
488
+ var motionAnimationConfig = animationConfig?.type === "timing" ? {
489
+ type: "tween",
490
+ duration: (animationConfig?.duration || 0) / 1e3
491
+ } : animationConfig?.type === "direct" ? {
492
+ type: "tween",
493
+ duration: 0
494
+ } : {
495
+ type: "spring",
496
+ ...animationConfig
497
+ };
498
+ animate(node, webStyle, motionAnimationConfig);
499
+ }
500
+ });
501
+ }, [animatedStyle]), /* @__PURE__ */(0, import_jsx_runtime.jsx)(Element, {
502
+ ...transformedProps,
503
+ ref: composedRefs
504
+ });
505
+ });
506
+ return Component.acceptRenderProp = !0, Component;
507
+ }
508
+ function getDiff(previous, next) {
509
+ if (!previous) return next;
510
+ var diff = null;
511
+ for (var key in next) next[key] !== previous[key] && (diff || (diff = {}), diff[key] = next[key]);
512
+ return diff;
513
+ }
514
+ function fixTransparentColors(diff, previous, next) {
515
+ var result = diff;
516
+ for (var key in diff) if (diff[key] === "transparent") {
517
+ var fixed = "rgba(0, 0, 0, 0)",
518
+ candidates = [previous?.[key], next?.[key]],
519
+ _iteratorNormalCompletion = !0,
520
+ _didIteratorError = !1,
521
+ _iteratorError = void 0;
522
+ try {
523
+ for (var _iterator = candidates[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
524
+ var candidate = _step.value;
525
+ if (typeof candidate == "string" && candidate !== "transparent") {
526
+ var rgbaMatch = candidate.match(/^rgba?\(([^,]+),\s*([^,]+),\s*([^,)]+)/);
527
+ if (rgbaMatch) {
528
+ fixed = `rgba(${rgbaMatch[1]}, ${rgbaMatch[2]}, ${rgbaMatch[3]}, 0)`;
529
+ break;
530
+ }
531
+ }
532
+ }
533
+ } catch (err) {
534
+ _didIteratorError = !0, _iteratorError = err;
535
+ } finally {
536
+ try {
537
+ !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
538
+ } finally {
539
+ if (_didIteratorError) throw _iteratorError;
540
+ }
541
+ }
542
+ result === diff && (result = {
543
+ ...diff
544
+ }), result[key] = fixed;
545
+ }
546
+ return result;
547
+ }
548
+ //# sourceMappingURL=createAnimations.native.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","createAnimations_exports","__export","createAnimations","disableAnimationProps","module","exports","import_jsx_runtime","require","import_animation_helpers","import_use_presence","import_web","import_react","import_react2","__toESM","_instanceof","left","right","Symbol","hasInstance","_type_of","obj","constructor","isServer","window","useAnimateSSRSafe","useRef","useAnimate","MotionValueStrategy","WeakMap","animations","isHydratingGlobal","hydratingComponents","Set","View","MotionView","Text","MotionText","isReactNative","inputStyle","outputStyle","avoidReRenders","usePresence","ResetPresence","onMount","forEach","cb","useAnimations","animationProps","getConfig","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","useEffect","disableAnimation","scope","animate","justStartedExiting","justStoppedExiting","dontAnimate","doAnimate","animationOptions","getMotionAnimatedProps","firstRenderStyle","useState","isHydrating","setIsHydrating","useLayoutEffect","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","cancel","err","return","fixedDiff","fixTransparentColors","transform","Date","now","finished","then","catch","nextStyle","effectiveTransition","_$animationProps","useIsomorphicLayoutEffect","keys","length","ref","render","useAnimatedNumber","initial","motionValue","useMotionValue","default","useMemo","getInstance","getValue","get","setValue","config","arguments","type","onFinish","set","unsubscribe","on","Math","abs","useAnimatedNumberReaction","onValue","instance","useMotionValueEvent","useAnimatedNumberStyle","getStyleProp","getStyleRef","getStyle","cur","disable","transitionOverride","_ref","animateOnly","has","includes","transitionProp","normalized","normalizeTransition","effectiveKey","getEffectiveAnimation","enter","exit","globalConfigOverride","properties","defaultConfig","withInferredType","delay","result","duration","damping","stiffness","mass","entries","propName","animationNameOrConfig","baseConfig","convertMsToS","isTimingBased","prev","dontClearIfIn","createMotionView","defaultTag","isText","Component","forwardRef","propsIn","_hooks_usePropsTransform","forwardedRef","animation","propsRest","hostRef","composedRefs","useComposedRefs","_","state","useThemeWithState","styles","animatedStyle","nonAnimatedStyles","animatedStyle2","nonAnimatedStyles2","style2","push"],"sources":["../../src/createAnimations.tsx"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAAA;EAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;IAAAC,KAAA;EAAA,IAAAH,GAAA;AAAA,IAAAI,wBAAA;AAAAC,QAAA,CAAAD,wBAAA;EAAAE,gBAAA,EAAAA,CAAA,KAAAA,gBAAA;EAAAC,qBAAA,EAAAA,CAAA,KAAAA;AAAA;AAAAC,MAAA,CAAAC,OAAA,GAAAV,YAAA,CAAAK,wBAA2D;AAoC3D,IAAAM,kBAAiB,GAAOC,OAAA,CAAW;EAAAC,wBAAA,GAAAD,OAAA;EAAAE,mBAAA,GAAAF,OAAA;EAAAG,UAAA,GAAAH,OAAA;EAAAI,YAAA,GAAAJ,OAAA;EAAAK,aAAA,GAAAC,OAAA,CAAAN,OAAA;AAKnC,SAASO,YAAAC,IAAA,EAAAC,KAAoB;EAC3B,OAAIA,KAAA,QACK,IAAC,OAAAC,MAAA,UAAOD,KAAI,CAAIC,MAAM,CAAAC,WAAA,MAAAF,KAAA,CAAAC,MAAA,CAAAC,WAAA,EAAAH,IAAA,IAAAA,IAAA,YAAAC,KAAA;A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,IAAAK,KAAA,GAAAF,SAAA,CAAAG,IAAA,IAAAC,IAAA,GAAAP,yBAAA;cAEE,IAAA4G,MAAW,GAAAvG,KACb,CAAArJ,KAAA;cAGJ4P,MAAA,CAAAtD,QAAA,GAAAoD,cAAA,GAAAE,MAAA,GAAAD,kBAAA,CAAAE,IAAA,CAAAD,MAAA;YAEF;UACF,SAAAlG,GAAA","ignoreList":[]}
@@ -0,0 +1,19 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __copyProps = (to, from, except, desc) => {
6
+ if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
7
+ get: () => from[key],
8
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
9
+ });
10
+ return to;
11
+ },
12
+ __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
13
+ var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
14
+ value: !0
15
+ }), mod);
16
+ var index_exports = {};
17
+ module.exports = __toCommonJS(index_exports);
18
+ var import_polyfill = require("./polyfill.cjs");
19
+ __reExport(index_exports, require("./createAnimations.cjs"), module.exports);
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all) __defProp(target, name, {
9
+ get: all[name],
10
+ enumerable: !0
11
+ });
12
+ },
13
+ __copyProps = (to, from, except, desc) => {
14
+ if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
15
+ get: () => from[key],
16
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
17
+ });
18
+ return to;
19
+ };
20
+ var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
21
+ value: !0
22
+ }), mod);
23
+ var index_native_exports = {};
24
+ __export(index_native_exports, {
25
+ createAnimations: () => createAnimations
26
+ });
27
+ module.exports = __toCommonJS(index_native_exports);
28
+ var hasWarnedOnce = !1;
29
+ function createAnimations(_animations) {
30
+ 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."))), {
31
+ isReactNative: !1,
32
+ animations: _animations,
33
+ View: void 0,
34
+ Text: void 0
35
+ };
36
+ }
37
+ //# sourceMappingURL=index.native.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["index_native_exports","__export","createAnimations","module","exports","__toCommonJS","hasWarnedOnce","_animations","process","env","NODE_ENV","console","warn","isReactNative","animations","View","Text"],"sources":["../../src/index.native.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,oBAAA;AAAAC,QAAA,CAAAD,oBAAA;EAAAE,gBAAA,EAAAA,CAAA,KAAAA;AAAA;AAAAC,MAAA,CAAAC,OAAA,GAAAC,YAAA,CAAAL,oBAAA;AAEA,IAAIM,aAAA,GAAgB;AACb,SAASJ,iBAAiBK,WAAA,EAAa;EAC1C,OAAIC,OAAA,CAAQC,GAAA,CAAIC,QAAA,KAAa,kBACpBJ,aAAA,KACDA,aAAA,GAAgB,IAChBK,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 @@
1
+ typeof requestAnimationFrame > "u" && (globalThis.requestAnimationFrame = setTimeout);
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+
3
+ typeof requestAnimationFrame > "u" && (globalThis.requestAnimationFrame = setTimeout);
4
+ //# sourceMappingURL=polyfill.native.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":["../../src/polyfill.ts"],"sourcesContent":[null],"mappings":"AACI,YAAO","ignoreList":[]}