@hanzogui/animations-css 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.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2020 Nate Wienert
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,251 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf,
6
+ __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 __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
26
+ value: mod,
27
+ enumerable: !0
28
+ }) : target, mod)),
29
+ __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
30
+ value: !0
31
+ }), mod);
32
+ var createAnimations_exports = {};
33
+ __export(createAnimations_exports, {
34
+ createAnimations: () => createAnimations
35
+ });
36
+ module.exports = __toCommonJS(createAnimations_exports);
37
+ var import_animation_helpers = require("@hanzogui/animation-helpers"),
38
+ import_constants = require("@hanzogui/constants"),
39
+ import_use_presence = require("@hanzogui/use-presence"),
40
+ import_web = require("@hanzogui/web"),
41
+ import_react = __toESM(require("react"), 1);
42
+ const EXTRACT_MS_REGEX = /(\d+(?:\.\d+)?)\s*ms/,
43
+ EXTRACT_S_REGEX = /(\d+(?:\.\d+)?)\s*s/;
44
+ function extractDuration(animation) {
45
+ const msMatch = animation.match(EXTRACT_MS_REGEX);
46
+ if (msMatch) return Number.parseInt(msMatch[1], 10);
47
+ const sMatch = animation.match(EXTRACT_S_REGEX);
48
+ return sMatch ? Math.round(Number.parseFloat(sMatch[1]) * 1e3) : 300;
49
+ }
50
+ const MS_DURATION_REGEX = /(\d+(?:\.\d+)?)\s*ms/,
51
+ S_DURATION_REGEX = /(\d+(?:\.\d+)?)\s*s(?!tiffness)/;
52
+ function applyDurationOverride(animation, durationMs) {
53
+ const msReplaced = animation.replace(MS_DURATION_REGEX, `${durationMs}ms`);
54
+ if (msReplaced !== animation) return msReplaced;
55
+ const sReplaced = animation.replace(S_DURATION_REGEX, `${durationMs}ms`);
56
+ return sReplaced !== animation ? sReplaced : `${durationMs}ms ${animation}`;
57
+ }
58
+ const TRANSFORM_KEYS = ["x", "y", "scale", "scaleX", "scaleY", "rotate", "rotateX", "rotateY", "rotateZ", "skewX", "skewY"];
59
+ function buildTransformString(style) {
60
+ if (!style) return "";
61
+ const parts = [];
62
+ if (style.x !== void 0 || style.y !== void 0) {
63
+ const x = style.x ?? 0,
64
+ y = style.y ?? 0;
65
+ parts.push(`translate(${x}px, ${y}px)`);
66
+ }
67
+ if (style.scale !== void 0 && parts.push(`scale(${style.scale})`), style.scaleX !== void 0 && parts.push(`scaleX(${style.scaleX})`), style.scaleY !== void 0 && parts.push(`scaleY(${style.scaleY})`), style.rotate !== void 0) {
68
+ const val = style.rotate,
69
+ unit = typeof val == "string" && val.includes("deg") ? "" : "deg";
70
+ parts.push(`rotate(${val}${unit})`);
71
+ }
72
+ return style.rotateX !== void 0 && parts.push(`rotateX(${style.rotateX}deg)`), style.rotateY !== void 0 && parts.push(`rotateY(${style.rotateY}deg)`), style.rotateZ !== void 0 && parts.push(`rotateZ(${style.rotateZ}deg)`), style.skewX !== void 0 && parts.push(`skewX(${style.skewX}deg)`), style.skewY !== void 0 && parts.push(`skewY(${style.skewY}deg)`), parts.join(" ");
73
+ }
74
+ function applyStylesToNode(node, style) {
75
+ if (!style) return;
76
+ const transformStr = buildTransformString(style);
77
+ transformStr && (node.style.transform = transformStr);
78
+ for (const [key, value] of Object.entries(style)) TRANSFORM_KEYS.includes(key) || value !== void 0 && (key === "opacity" ? node.style.opacity = String(value) : key === "backgroundColor" ? node.style.backgroundColor = String(value) : key === "color" ? node.style.color = String(value) : node.style[key] = typeof value == "number" ? `${value}px` : String(value));
79
+ }
80
+ function createAnimations(animations) {
81
+ const reactionListeners = /* @__PURE__ */new WeakMap();
82
+ return {
83
+ animations,
84
+ usePresence: import_use_presence.usePresence,
85
+ ResetPresence: import_use_presence.ResetPresence,
86
+ inputStyle: "css",
87
+ outputStyle: "css",
88
+ useAnimatedNumber(initial) {
89
+ const [val, setVal] = import_react.default.useState(initial),
90
+ finishTimerRef = import_react.default.useRef(null);
91
+ return {
92
+ getInstance() {
93
+ return setVal;
94
+ },
95
+ getValue() {
96
+ return val;
97
+ },
98
+ setValue(next, config, onFinish) {
99
+ if (setVal(next), finishTimerRef.current && (clearTimeout(finishTimerRef.current), finishTimerRef.current = null), onFinish) if (!config || config.type === "direct" || config.type === "timing" && config.duration === 0) onFinish();else {
100
+ const duration = config.type === "timing" ? config.duration : 300;
101
+ finishTimerRef.current = setTimeout(onFinish, duration);
102
+ }
103
+ const listeners = reactionListeners.get(setVal);
104
+ listeners && listeners.forEach(listener => listener(next));
105
+ },
106
+ stop() {
107
+ finishTimerRef.current && (clearTimeout(finishTimerRef.current), finishTimerRef.current = null);
108
+ }
109
+ };
110
+ },
111
+ useAnimatedNumberReaction({
112
+ value
113
+ }, onValue) {
114
+ import_react.default.useEffect(() => {
115
+ const instance = value.getInstance();
116
+ let queue = reactionListeners.get(instance);
117
+ if (!queue) {
118
+ const next = /* @__PURE__ */new Set();
119
+ reactionListeners.set(instance, next), queue = next;
120
+ }
121
+ return queue.add(onValue), () => {
122
+ queue?.delete(onValue);
123
+ };
124
+ }, []);
125
+ },
126
+ useAnimatedNumberStyle(val, getStyle) {
127
+ return getStyle(val.getValue());
128
+ },
129
+ // @ts-ignore - styleState is added by createComponent
130
+ useAnimations: ({
131
+ props,
132
+ presence,
133
+ style,
134
+ componentState,
135
+ stateRef,
136
+ styleState
137
+ }) => {
138
+ const isHydrating = componentState.unmounted === !0,
139
+ isEntering = !!componentState.unmounted,
140
+ isExiting = presence?.[0] === !1,
141
+ sendExitComplete = presence?.[1],
142
+ wasEnteringRef = import_react.default.useRef(isEntering),
143
+ justFinishedEntering = wasEnteringRef.current && !isEntering;
144
+ import_react.default.useEffect(() => {
145
+ wasEnteringRef.current = isEntering;
146
+ });
147
+ const exitCycleIdRef = import_react.default.useRef(0),
148
+ exitCompletedRef = import_react.default.useRef(!1),
149
+ wasExitingRef = import_react.default.useRef(!1),
150
+ exitInterruptedRef = import_react.default.useRef(!1),
151
+ justStartedExiting = isExiting && !wasExitingRef.current,
152
+ justStoppedExiting = !isExiting && wasExitingRef.current;
153
+ justStartedExiting && (exitCycleIdRef.current++, exitCompletedRef.current = !1), justStoppedExiting && (exitCycleIdRef.current++, exitInterruptedRef.current = !0), import_react.default.useEffect(() => {
154
+ wasExitingRef.current = isExiting;
155
+ });
156
+ const effectiveTransition = styleState?.effectiveTransition ?? props.transition,
157
+ normalized = (0, import_animation_helpers.normalizeTransition)(effectiveTransition),
158
+ effectiveAnimationKey = (0, import_animation_helpers.getEffectiveAnimation)(normalized, isExiting ? "exit" : isEntering || justFinishedEntering ? "enter" : "default"),
159
+ defaultAnimation = effectiveAnimationKey ? animations[effectiveAnimationKey] : null,
160
+ animatedProperties = (0, import_animation_helpers.getAnimatedProperties)(normalized),
161
+ hasDefault = normalized.default !== null || normalized.enter !== null || normalized.exit !== null,
162
+ hasPerPropertyConfigs = animatedProperties.length > 0;
163
+ let keys;
164
+ if (props.animateOnly ? keys = props.animateOnly : hasPerPropertyConfigs && !hasDefault ? keys = animatedProperties : hasPerPropertyConfigs && hasDefault ? keys = ["all", ...animatedProperties] : keys = ["all"], (0, import_constants.useIsomorphicLayoutEffect)(() => {
165
+ const host = stateRef.current.host;
166
+ if (!sendExitComplete || !isExiting || !host) return;
167
+ const node = host,
168
+ cycleId = exitCycleIdRef.current,
169
+ completeExit = () => {
170
+ cycleId === exitCycleIdRef.current && (exitCompletedRef.current || (exitCompletedRef.current = !0, sendExitComplete()));
171
+ };
172
+ if (keys.length === 0) {
173
+ completeExit();
174
+ return;
175
+ }
176
+ let rafId;
177
+ const wasInterrupted = exitInterruptedRef.current;
178
+ let ignoreCancelEvents = wasInterrupted;
179
+ const enterStyle = props.enterStyle,
180
+ exitStyle = props.exitStyle,
181
+ delayStr2 = normalized.delay ? ` ${normalized.delay}ms` : "",
182
+ durationOverride2 = normalized.config?.duration,
183
+ exitTransitionString = keys.map(key => {
184
+ const propAnimation = normalized.properties[key];
185
+ let animationValue = null;
186
+ return typeof propAnimation == "string" ? animationValue = animations[propAnimation] : propAnimation && typeof propAnimation == "object" && propAnimation.type ? animationValue = animations[propAnimation.type] : defaultAnimation && (animationValue = defaultAnimation), animationValue && durationOverride2 && (animationValue = applyDurationOverride(animationValue, durationOverride2)), animationValue ? `${key} ${animationValue}${delayStr2}` : null;
187
+ }).filter(Boolean).join(", ");
188
+ if (wasInterrupted) {
189
+ if (exitInterruptedRef.current = !1, node.style.transition = "none", exitStyle) {
190
+ const resetStyle = {};
191
+ for (const key of Object.keys(exitStyle)) key === "opacity" ? resetStyle[key] = 1 : TRANSFORM_KEYS.includes(key) ? resetStyle[key] = key === "scale" || key === "scaleX" || key === "scaleY" ? 1 : 0 : enterStyle?.[key] !== void 0 && (resetStyle[key] = enterStyle[key]);
192
+ applyStylesToNode(node, resetStyle);
193
+ } else node.style.opacity = "1", node.style.transform = "none";
194
+ node.offsetHeight;
195
+ } else if (exitStyle) {
196
+ ignoreCancelEvents = !0, node.style.transition = "none";
197
+ const resetStyle = {};
198
+ for (const key of Object.keys(exitStyle)) key === "opacity" ? resetStyle[key] = 1 : TRANSFORM_KEYS.includes(key) ? resetStyle[key] = key === "scale" || key === "scaleX" || key === "scaleY" ? 1 : 0 : enterStyle?.[key] !== void 0 && (resetStyle[key] = enterStyle[key]);
199
+ applyStylesToNode(node, resetStyle), node.offsetHeight, rafId = requestAnimationFrame(() => {
200
+ cycleId === exitCycleIdRef.current && (node.style.transition = exitTransitionString, node.offsetHeight, applyStylesToNode(node, exitStyle), ignoreCancelEvents = !1);
201
+ });
202
+ }
203
+ let maxDuration = defaultAnimation ? extractDuration(defaultAnimation) : 200;
204
+ const animationConfigs = (0, import_animation_helpers.getAnimationConfigsForKeys)(normalized, animations, keys, defaultAnimation);
205
+ for (const animationValue of animationConfigs.values()) if (animationValue) {
206
+ const duration = extractDuration(animationValue);
207
+ duration > maxDuration && (maxDuration = duration);
208
+ }
209
+ const delay = normalized.delay ?? 0,
210
+ fallbackTimeout = maxDuration + delay,
211
+ timeoutId = setTimeout(() => {
212
+ completeExit();
213
+ }, fallbackTimeout),
214
+ transitioningProps = new Set(keys);
215
+ let completedCount = 0;
216
+ const onFinishAnimation = event => {
217
+ if (event.target !== node) return;
218
+ const eventProp = event.propertyName;
219
+ (transitioningProps.has(eventProp) || eventProp === "all") && (completedCount++, completedCount >= transitioningProps.size && (clearTimeout(timeoutId), completeExit()));
220
+ },
221
+ onCancelAnimation = () => {
222
+ ignoreCancelEvents || (clearTimeout(timeoutId), completeExit());
223
+ };
224
+ return node.addEventListener("transitionend", onFinishAnimation), node.addEventListener("transitioncancel", onCancelAnimation), wasInterrupted && (rafId = requestAnimationFrame(() => {
225
+ cycleId === exitCycleIdRef.current && (node.style.transition = exitTransitionString, node.offsetHeight, applyStylesToNode(node, exitStyle), ignoreCancelEvents = !1);
226
+ })), () => {
227
+ clearTimeout(timeoutId), rafId !== void 0 && cancelAnimationFrame(rafId), node.removeEventListener("transitionend", onFinishAnimation), node.removeEventListener("transitioncancel", onCancelAnimation), node.style.transition = "";
228
+ };
229
+ }, [sendExitComplete, isExiting, stateRef, keys, normalized, defaultAnimation, props.enterStyle, props.exitStyle]), isHydrating || !(0, import_animation_helpers.hasAnimation)(normalized)) return null;
230
+ Array.isArray(style.transform) && (style.transform = (0, import_web.transformsToString)(style.transform));
231
+ const delayStr = normalized.delay ? ` ${normalized.delay}ms` : "",
232
+ durationOverride = normalized.config?.duration;
233
+ return style.transition = keys.map(key => {
234
+ const propAnimation = normalized.properties[key];
235
+ let animationValue = null;
236
+ return typeof propAnimation == "string" ? animationValue = animations[propAnimation] : propAnimation && typeof propAnimation == "object" && propAnimation.type ? animationValue = animations[propAnimation.type] : defaultAnimation && (animationValue = defaultAnimation), animationValue && durationOverride && (animationValue = applyDurationOverride(animationValue, durationOverride)), animationValue ? `${key} ${animationValue}${delayStr}` : null;
237
+ }).filter(Boolean).join(", "), process.env.NODE_ENV === "development" && props.debug === "verbose" && console.info("CSS animation", {
238
+ props,
239
+ animations,
240
+ normalized,
241
+ defaultAnimation,
242
+ style,
243
+ isEntering,
244
+ isExiting
245
+ }), {
246
+ style,
247
+ className: isEntering ? "t_unmounted" : ""
248
+ };
249
+ }
250
+ };
251
+ }
@@ -0,0 +1,337 @@
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
+ });
38
+ module.exports = __toCommonJS(createAnimations_exports);
39
+ var import_animation_helpers = require("@hanzogui/animation-helpers"),
40
+ import_constants = require("@hanzogui/constants"),
41
+ import_use_presence = require("@hanzogui/use-presence"),
42
+ import_web = require("@hanzogui/web"),
43
+ import_react = __toESM(require("react"), 1);
44
+ function _type_of(obj) {
45
+ "@swc/helpers - typeof";
46
+
47
+ return obj && typeof Symbol < "u" && obj.constructor === Symbol ? "symbol" : typeof obj;
48
+ }
49
+ var EXTRACT_MS_REGEX = /(\d+(?:\.\d+)?)\s*ms/,
50
+ EXTRACT_S_REGEX = /(\d+(?:\.\d+)?)\s*s/;
51
+ function extractDuration(animation) {
52
+ var msMatch = animation.match(EXTRACT_MS_REGEX);
53
+ if (msMatch) return Number.parseInt(msMatch[1], 10);
54
+ var sMatch = animation.match(EXTRACT_S_REGEX);
55
+ return sMatch ? Math.round(Number.parseFloat(sMatch[1]) * 1e3) : 300;
56
+ }
57
+ var MS_DURATION_REGEX = /(\d+(?:\.\d+)?)\s*ms/,
58
+ S_DURATION_REGEX = /(\d+(?:\.\d+)?)\s*s(?!tiffness)/;
59
+ function applyDurationOverride(animation, durationMs) {
60
+ var msReplaced = animation.replace(MS_DURATION_REGEX, `${durationMs}ms`);
61
+ if (msReplaced !== animation) return msReplaced;
62
+ var sReplaced = animation.replace(S_DURATION_REGEX, `${durationMs}ms`);
63
+ return sReplaced !== animation ? sReplaced : `${durationMs}ms ${animation}`;
64
+ }
65
+ var TRANSFORM_KEYS = ["x", "y", "scale", "scaleX", "scaleY", "rotate", "rotateX", "rotateY", "rotateZ", "skewX", "skewY"];
66
+ function buildTransformString(style) {
67
+ if (!style) return "";
68
+ var parts = [];
69
+ if (style.x !== void 0 || style.y !== void 0) {
70
+ var _style_x,
71
+ x = (_style_x = style.x) !== null && _style_x !== void 0 ? _style_x : 0,
72
+ _style_y,
73
+ y = (_style_y = style.y) !== null && _style_y !== void 0 ? _style_y : 0;
74
+ parts.push(`translate(${x}px, ${y}px)`);
75
+ }
76
+ if (style.scale !== void 0 && parts.push(`scale(${style.scale})`), style.scaleX !== void 0 && parts.push(`scaleX(${style.scaleX})`), style.scaleY !== void 0 && parts.push(`scaleY(${style.scaleY})`), style.rotate !== void 0) {
77
+ var val = style.rotate,
78
+ unit = typeof val == "string" && val.includes("deg") ? "" : "deg";
79
+ parts.push(`rotate(${val}${unit})`);
80
+ }
81
+ return style.rotateX !== void 0 && parts.push(`rotateX(${style.rotateX}deg)`), style.rotateY !== void 0 && parts.push(`rotateY(${style.rotateY}deg)`), style.rotateZ !== void 0 && parts.push(`rotateZ(${style.rotateZ}deg)`), style.skewX !== void 0 && parts.push(`skewX(${style.skewX}deg)`), style.skewY !== void 0 && parts.push(`skewY(${style.skewY}deg)`), parts.join(" ");
82
+ }
83
+ function applyStylesToNode(node, style) {
84
+ if (style) {
85
+ var transformStr = buildTransformString(style);
86
+ transformStr && (node.style.transform = transformStr);
87
+ var _iteratorNormalCompletion = !0,
88
+ _didIteratorError = !1,
89
+ _iteratorError = void 0;
90
+ try {
91
+ for (var _iterator = Object.entries(style)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
92
+ var [key, value] = _step.value;
93
+ TRANSFORM_KEYS.includes(key) || value !== void 0 && (key === "opacity" ? node.style.opacity = String(value) : key === "backgroundColor" ? node.style.backgroundColor = String(value) : key === "color" ? node.style.color = String(value) : node.style[key] = typeof value == "number" ? `${value}px` : String(value));
94
+ }
95
+ } catch (err) {
96
+ _didIteratorError = !0, _iteratorError = err;
97
+ } finally {
98
+ try {
99
+ !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
100
+ } finally {
101
+ if (_didIteratorError) throw _iteratorError;
102
+ }
103
+ }
104
+ }
105
+ }
106
+ function createAnimations(animations) {
107
+ var reactionListeners = /* @__PURE__ */new WeakMap();
108
+ return {
109
+ animations,
110
+ usePresence: import_use_presence.usePresence,
111
+ ResetPresence: import_use_presence.ResetPresence,
112
+ inputStyle: "css",
113
+ outputStyle: "css",
114
+ useAnimatedNumber(initial) {
115
+ var [val, setVal] = import_react.default.useState(initial),
116
+ finishTimerRef = import_react.default.useRef(null);
117
+ return {
118
+ getInstance() {
119
+ return setVal;
120
+ },
121
+ getValue() {
122
+ return val;
123
+ },
124
+ setValue(next, config, onFinish) {
125
+ if (setVal(next), finishTimerRef.current && (clearTimeout(finishTimerRef.current), finishTimerRef.current = null), onFinish) if (!config || config.type === "direct" || config.type === "timing" && config.duration === 0) onFinish();else {
126
+ var duration = config.type === "timing" ? config.duration : 300;
127
+ finishTimerRef.current = setTimeout(onFinish, duration);
128
+ }
129
+ var listeners = reactionListeners.get(setVal);
130
+ listeners && listeners.forEach(function (listener) {
131
+ return listener(next);
132
+ });
133
+ },
134
+ stop() {
135
+ finishTimerRef.current && (clearTimeout(finishTimerRef.current), finishTimerRef.current = null);
136
+ }
137
+ };
138
+ },
139
+ useAnimatedNumberReaction(param, onValue) {
140
+ var {
141
+ value
142
+ } = param;
143
+ import_react.default.useEffect(function () {
144
+ var instance = value.getInstance(),
145
+ queue = reactionListeners.get(instance);
146
+ if (!queue) {
147
+ var next = /* @__PURE__ */new Set();
148
+ reactionListeners.set(instance, next), queue = next;
149
+ }
150
+ return queue.add(onValue), function () {
151
+ queue?.delete(onValue);
152
+ };
153
+ }, []);
154
+ },
155
+ useAnimatedNumberStyle(val, getStyle) {
156
+ return getStyle(val.getValue());
157
+ },
158
+ // @ts-ignore - styleState is added by createComponent
159
+ useAnimations: function (param) {
160
+ var {
161
+ props,
162
+ presence,
163
+ style,
164
+ componentState,
165
+ stateRef,
166
+ styleState
167
+ } = param,
168
+ _normalized_config,
169
+ isHydrating = componentState.unmounted === !0,
170
+ isEntering = !!componentState.unmounted,
171
+ isExiting = presence?.[0] === !1,
172
+ sendExitComplete = presence?.[1],
173
+ wasEnteringRef = import_react.default.useRef(isEntering),
174
+ justFinishedEntering = wasEnteringRef.current && !isEntering;
175
+ import_react.default.useEffect(function () {
176
+ wasEnteringRef.current = isEntering;
177
+ });
178
+ var exitCycleIdRef = import_react.default.useRef(0),
179
+ exitCompletedRef = import_react.default.useRef(!1),
180
+ wasExitingRef = import_react.default.useRef(!1),
181
+ exitInterruptedRef = import_react.default.useRef(!1),
182
+ justStartedExiting = isExiting && !wasExitingRef.current,
183
+ justStoppedExiting = !isExiting && wasExitingRef.current;
184
+ justStartedExiting && (exitCycleIdRef.current++, exitCompletedRef.current = !1), justStoppedExiting && (exitCycleIdRef.current++, exitInterruptedRef.current = !0), import_react.default.useEffect(function () {
185
+ wasExitingRef.current = isExiting;
186
+ });
187
+ var _styleState_effectiveTransition,
188
+ effectiveTransition = (_styleState_effectiveTransition = styleState?.effectiveTransition) !== null && _styleState_effectiveTransition !== void 0 ? _styleState_effectiveTransition : props.transition,
189
+ normalized = (0, import_animation_helpers.normalizeTransition)(effectiveTransition),
190
+ animationState = isExiting ? "exit" : isEntering || justFinishedEntering ? "enter" : "default",
191
+ effectiveAnimationKey = (0, import_animation_helpers.getEffectiveAnimation)(normalized, animationState),
192
+ defaultAnimation = effectiveAnimationKey ? animations[effectiveAnimationKey] : null,
193
+ animatedProperties = (0, import_animation_helpers.getAnimatedProperties)(normalized),
194
+ hasDefault = normalized.default !== null || normalized.enter !== null || normalized.exit !== null,
195
+ hasPerPropertyConfigs = animatedProperties.length > 0,
196
+ keys;
197
+ if (props.animateOnly ? keys = props.animateOnly : hasPerPropertyConfigs && !hasDefault ? keys = animatedProperties : hasPerPropertyConfigs && hasDefault ? keys = ["all", ...animatedProperties] : keys = ["all"], (0, import_constants.useIsomorphicLayoutEffect)(function () {
198
+ var _normalized_config2,
199
+ host = stateRef.current.host;
200
+ if (!(!sendExitComplete || !isExiting || !host)) {
201
+ var node = host,
202
+ cycleId = exitCycleIdRef.current,
203
+ completeExit = function () {
204
+ cycleId === exitCycleIdRef.current && (exitCompletedRef.current || (exitCompletedRef.current = !0, sendExitComplete()));
205
+ };
206
+ if (keys.length === 0) {
207
+ completeExit();
208
+ return;
209
+ }
210
+ var rafId,
211
+ wasInterrupted = exitInterruptedRef.current,
212
+ ignoreCancelEvents = wasInterrupted,
213
+ enterStyle = props.enterStyle,
214
+ exitStyle = props.exitStyle,
215
+ delayStr2 = normalized.delay ? ` ${normalized.delay}ms` : "",
216
+ durationOverride2 = (_normalized_config2 = normalized.config) === null || _normalized_config2 === void 0 ? void 0 : _normalized_config2.duration,
217
+ exitTransitionString = keys.map(function (key2) {
218
+ var propAnimation = normalized.properties[key2],
219
+ animationValue2 = null;
220
+ return typeof propAnimation == "string" ? animationValue2 = animations[propAnimation] : propAnimation && (typeof propAnimation > "u" ? "undefined" : _type_of(propAnimation)) === "object" && propAnimation.type ? animationValue2 = animations[propAnimation.type] : defaultAnimation && (animationValue2 = defaultAnimation), animationValue2 && durationOverride2 && (animationValue2 = applyDurationOverride(animationValue2, durationOverride2)), animationValue2 ? `${key2} ${animationValue2}${delayStr2}` : null;
221
+ }).filter(Boolean).join(", ");
222
+ if (wasInterrupted) {
223
+ if (exitInterruptedRef.current = !1, node.style.transition = "none", exitStyle) {
224
+ var resetStyle = {},
225
+ _iteratorNormalCompletion = !0,
226
+ _didIteratorError = !1,
227
+ _iteratorError = void 0;
228
+ try {
229
+ for (var _iterator = Object.keys(exitStyle)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
230
+ var key = _step.value;
231
+ key === "opacity" ? resetStyle[key] = 1 : TRANSFORM_KEYS.includes(key) ? resetStyle[key] = key === "scale" || key === "scaleX" || key === "scaleY" ? 1 : 0 : enterStyle?.[key] !== void 0 && (resetStyle[key] = enterStyle[key]);
232
+ }
233
+ } catch (err) {
234
+ _didIteratorError = !0, _iteratorError = err;
235
+ } finally {
236
+ try {
237
+ !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
238
+ } finally {
239
+ if (_didIteratorError) throw _iteratorError;
240
+ }
241
+ }
242
+ applyStylesToNode(node, resetStyle);
243
+ } else node.style.opacity = "1", node.style.transform = "none";
244
+ node.offsetHeight;
245
+ } else if (exitStyle) {
246
+ ignoreCancelEvents = !0, node.style.transition = "none";
247
+ var resetStyle1 = {},
248
+ _iteratorNormalCompletion1 = !0,
249
+ _didIteratorError1 = !1,
250
+ _iteratorError1 = void 0;
251
+ try {
252
+ for (var _iterator1 = Object.keys(exitStyle)[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = !0) {
253
+ var key1 = _step1.value;
254
+ key1 === "opacity" ? resetStyle1[key1] = 1 : TRANSFORM_KEYS.includes(key1) ? resetStyle1[key1] = key1 === "scale" || key1 === "scaleX" || key1 === "scaleY" ? 1 : 0 : enterStyle?.[key1] !== void 0 && (resetStyle1[key1] = enterStyle[key1]);
255
+ }
256
+ } catch (err) {
257
+ _didIteratorError1 = !0, _iteratorError1 = err;
258
+ } finally {
259
+ try {
260
+ !_iteratorNormalCompletion1 && _iterator1.return != null && _iterator1.return();
261
+ } finally {
262
+ if (_didIteratorError1) throw _iteratorError1;
263
+ }
264
+ }
265
+ applyStylesToNode(node, resetStyle1), node.offsetHeight, rafId = requestAnimationFrame(function () {
266
+ cycleId === exitCycleIdRef.current && (node.style.transition = exitTransitionString, node.offsetHeight, applyStylesToNode(node, exitStyle), ignoreCancelEvents = !1);
267
+ });
268
+ }
269
+ var maxDuration = defaultAnimation ? extractDuration(defaultAnimation) : 200,
270
+ animationConfigs = (0, import_animation_helpers.getAnimationConfigsForKeys)(normalized, animations, keys, defaultAnimation),
271
+ _iteratorNormalCompletion2 = !0,
272
+ _didIteratorError2 = !1,
273
+ _iteratorError2 = void 0;
274
+ try {
275
+ for (var _iterator2 = animationConfigs.values()[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = !0) {
276
+ var animationValue = _step2.value;
277
+ if (animationValue) {
278
+ var duration = extractDuration(animationValue);
279
+ duration > maxDuration && (maxDuration = duration);
280
+ }
281
+ }
282
+ } catch (err) {
283
+ _didIteratorError2 = !0, _iteratorError2 = err;
284
+ } finally {
285
+ try {
286
+ !_iteratorNormalCompletion2 && _iterator2.return != null && _iterator2.return();
287
+ } finally {
288
+ if (_didIteratorError2) throw _iteratorError2;
289
+ }
290
+ }
291
+ var _normalized_delay,
292
+ delay = (_normalized_delay = normalized.delay) !== null && _normalized_delay !== void 0 ? _normalized_delay : 0,
293
+ fallbackTimeout = maxDuration + delay,
294
+ timeoutId = setTimeout(function () {
295
+ completeExit();
296
+ }, fallbackTimeout),
297
+ transitioningProps = new Set(keys),
298
+ completedCount = 0,
299
+ onFinishAnimation = function (event) {
300
+ if (event.target === node) {
301
+ var eventProp = event.propertyName;
302
+ (transitioningProps.has(eventProp) || eventProp === "all") && (completedCount++, completedCount >= transitioningProps.size && (clearTimeout(timeoutId), completeExit()));
303
+ }
304
+ },
305
+ onCancelAnimation = function () {
306
+ ignoreCancelEvents || (clearTimeout(timeoutId), completeExit());
307
+ };
308
+ return node.addEventListener("transitionend", onFinishAnimation), node.addEventListener("transitioncancel", onCancelAnimation), wasInterrupted && (rafId = requestAnimationFrame(function () {
309
+ cycleId === exitCycleIdRef.current && (node.style.transition = exitTransitionString, node.offsetHeight, applyStylesToNode(node, exitStyle), ignoreCancelEvents = !1);
310
+ })), function () {
311
+ clearTimeout(timeoutId), rafId !== void 0 && cancelAnimationFrame(rafId), node.removeEventListener("transitionend", onFinishAnimation), node.removeEventListener("transitioncancel", onCancelAnimation), node.style.transition = "";
312
+ };
313
+ }
314
+ }, [sendExitComplete, isExiting, stateRef, keys, normalized, defaultAnimation, props.enterStyle, props.exitStyle]), isHydrating || !(0, import_animation_helpers.hasAnimation)(normalized)) return null;
315
+ Array.isArray(style.transform) && (style.transform = (0, import_web.transformsToString)(style.transform));
316
+ var delayStr = normalized.delay ? ` ${normalized.delay}ms` : "",
317
+ durationOverride = (_normalized_config = normalized.config) === null || _normalized_config === void 0 ? void 0 : _normalized_config.duration;
318
+ return style.transition = keys.map(function (key) {
319
+ var propAnimation = normalized.properties[key],
320
+ animationValue = null;
321
+ return typeof propAnimation == "string" ? animationValue = animations[propAnimation] : propAnimation && (typeof propAnimation > "u" ? "undefined" : _type_of(propAnimation)) === "object" && propAnimation.type ? animationValue = animations[propAnimation.type] : defaultAnimation && (animationValue = defaultAnimation), animationValue && durationOverride && (animationValue = applyDurationOverride(animationValue, durationOverride)), animationValue ? `${key} ${animationValue}${delayStr}` : null;
322
+ }).filter(Boolean).join(", "), process.env.NODE_ENV === "development" && props.debug === "verbose" && console.info("CSS animation", {
323
+ props,
324
+ animations,
325
+ normalized,
326
+ defaultAnimation,
327
+ style,
328
+ isEntering,
329
+ isExiting
330
+ }), {
331
+ style,
332
+ className: isEntering ? "t_unmounted" : ""
333
+ };
334
+ }
335
+ };
336
+ }
337
+ //# sourceMappingURL=createAnimations.native.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","createAnimations_exports","__export","createAnimations","module","exports","import_animation_helpers","require","import_constants","import_use_presence","import_web","import_react","__toESM","_type_of","obj","Symbol","constructor","EXTRACT_MS_REGEX","EXTRACT_S_REGEX","extractDuration","animation","msMatch","match","Number","parseInt","sMatch","Math","round","parseFloat","MS_DURATION_REGEX","S_DURATION_REGEX","applyDurationOverride","durationMs","msReplaced","replace","sReplaced","TRANSFORM_KEYS","buildTransformString","style","parts","x","y","_style_x","_style_y","push","scale","scaleX","scaleY","rotate","val","unit","includes","rotateX","rotateY","rotateZ","skewX","skewY","join","applyStylesToNode","node","transformStr","transform","_iteratorNormalCompletion","_didIteratorError","_iteratorError","_iterator","Object","entries","iterator","_step","next","done","key","opacity","String","backgroundColor","color","err","return","animations","reactionListeners","WeakMap","usePresence","ResetPresence","inputStyle","outputStyle","useAnimatedNumber","initial","setVal","default","useState","finishTimerRef","useRef","getInstance","getValue","setValue","config","onFinish","current","clearTimeout","type","duration","setTimeout","listeners","get","forEach","listener","stop","useAnimatedNumberReaction","param","onValue","useEffect","instance","queue","Set","set","add","delete","useAnimatedNumberStyle","getStyle","useAnimations","props","presence","componentState","stateRef","styleState","_normalized_config","isHydrating","unmounted","isEntering","isExiting","sendExitComplete","wasEnteringRef","justFinishedEntering","exitCycleIdRef","exitCompletedRef","wasExitingRef","exitInterruptedRef","justStartedExiting","justStoppedExiting","_styleState_effectiveTransition","effectiveTransition","transition","normalized","normalizeTransition","animationState","effectiveAnimationKey","getEffectiveAnimation","defaultAnimation","animatedProperties","getAnimatedProperties","hasDefault","enter","exit","hasPerPropertyConfigs","length","keys","animateOnly","useIsomorphicLayoutEffect","_normalized_config2","host","cycleId","completeExit","rafId","wasInterrupted","ignoreCancelEvents","enterStyle","exitStyle","delayStr2","delay","durationOverride2","exitTransitionString","map","key2","propAnimation","properties","animationValue2","filter","Boolean","resetStyle","offsetHeight","resetStyle1","_iteratorNormalCompletion1","_didIteratorError1","_iteratorError1","_iterator1","_step1","key1","requestAnimationFrame","maxDuration","animationConfigs","getAnimationConfigsForKeys","_iteratorNormalCompletion2","_didIteratorError2","_iteratorError2","_iterator2","values","_step2","animationValue"],"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;AAAA;AAAAC,MAAA,CAAAC,OAAA,GAAAT,YAAA,CAAAK,wBAMO;AAOP,IAAAK,wBAAyB,GAAAC,OAAA,8BACD;EAAAC,gBAAA,GAAAD,OAAA;EAAAE,mBAAA,GAAAF,OAAA;EAAAG,UAAA,GAAAH,OAAA;EAAAI,YAAA,GAAAC,OAAA,CAAAL,OAAA;AAOxB,SAASM,SAAAC,GAAA;EAEP,uBAAgB;;EAChB,OAAIA,GAAA,WAAAC,MA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