unframer 2.25.5 → 2.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/babel-jsx.d.ts +15 -0
- package/dist/babel-jsx.d.ts.map +1 -0
- package/dist/babel-jsx.js +223 -0
- package/dist/babel-jsx.js.map +1 -0
- package/dist/babel-plugin-imports.d.ts +0 -6
- package/dist/babel-plugin-imports.d.ts.map +1 -1
- package/dist/babel-plugin-imports.js +2 -135
- package/dist/babel-plugin-imports.js.map +1 -1
- package/dist/cli.d.ts +1 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +31 -6
- package/dist/cli.js.map +1 -1
- package/dist/css.js +13 -13
- package/dist/esbuild.d.ts.map +1 -1
- package/dist/esbuild.js +5 -5
- package/dist/esbuild.js.map +1 -1
- package/dist/example-code.test.js +39 -39
- package/dist/example-code.test.js.map +1 -1
- package/dist/exporter.d.ts.map +1 -1
- package/dist/exporter.js +137 -87
- package/dist/exporter.js.map +1 -1
- package/dist/flat-cache-interceptor.d.ts +27 -0
- package/dist/flat-cache-interceptor.d.ts.map +1 -0
- package/dist/flat-cache-interceptor.js +99 -0
- package/dist/flat-cache-interceptor.js.map +1 -0
- package/dist/framer.d.ts.map +1 -1
- package/dist/framer.js +837 -684
- package/dist/framer.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/react.d.ts.map +1 -1
- package/dist/react.js +15 -3
- package/dist/react.js.map +1 -1
- package/dist/sentry.d.ts.map +1 -1
- package/dist/sentry.js +1 -16
- package/dist/sentry.js.map +1 -1
- package/dist/undici-dispatcher.d.ts +2 -0
- package/dist/undici-dispatcher.d.ts.map +1 -0
- package/dist/undici-dispatcher.js +13 -0
- package/dist/undici-dispatcher.js.map +1 -0
- package/dist/utils.d.ts +3 -3
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +4 -10
- package/dist/utils.js.map +1 -1
- package/dist/utils.test.d.ts +2 -0
- package/dist/utils.test.d.ts.map +1 -0
- package/dist/utils.test.js +143 -0
- package/dist/utils.test.js.map +1 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/esm/babel-jsx.d.ts +15 -0
- package/esm/babel-jsx.d.ts.map +1 -0
- package/esm/babel-jsx.js +219 -0
- package/esm/babel-jsx.js.map +1 -0
- package/esm/babel-plugin-imports.d.ts +0 -6
- package/esm/babel-plugin-imports.d.ts.map +1 -1
- package/esm/babel-plugin-imports.js +2 -134
- package/esm/babel-plugin-imports.js.map +1 -1
- package/esm/cli.d.ts +1 -0
- package/esm/cli.d.ts.map +1 -1
- package/esm/cli.js +31 -6
- package/esm/cli.js.map +1 -1
- package/esm/css.js +13 -13
- package/esm/esbuild.d.ts.map +1 -1
- package/esm/esbuild.js +4 -4
- package/esm/esbuild.js.map +1 -1
- package/esm/example-code.test.js +40 -40
- package/esm/example-code.test.js.map +1 -1
- package/esm/exporter.d.ts.map +1 -1
- package/esm/exporter.js +100 -50
- package/esm/exporter.js.map +1 -1
- package/esm/flat-cache-interceptor.d.ts +27 -0
- package/esm/flat-cache-interceptor.d.ts.map +1 -0
- package/esm/flat-cache-interceptor.js +95 -0
- package/esm/flat-cache-interceptor.js.map +1 -0
- package/esm/framer.d.ts.map +1 -1
- package/esm/framer.js +813 -672
- package/esm/framer.js.map +1 -1
- package/esm/index.d.ts +1 -1
- package/esm/index.d.ts.map +1 -1
- package/esm/react.d.ts.map +1 -1
- package/esm/react.js +15 -3
- package/esm/react.js.map +1 -1
- package/esm/sentry.d.ts.map +1 -1
- package/esm/sentry.js +1 -16
- package/esm/sentry.js.map +1 -1
- package/esm/undici-dispatcher.d.ts +2 -0
- package/esm/undici-dispatcher.d.ts.map +1 -0
- package/esm/undici-dispatcher.js +10 -0
- package/esm/undici-dispatcher.js.map +1 -0
- package/esm/utils.d.ts +3 -3
- package/esm/utils.d.ts.map +1 -1
- package/esm/utils.js +3 -9
- package/esm/utils.js.map +1 -1
- package/esm/utils.test.d.ts +2 -0
- package/esm/utils.test.d.ts.map +1 -0
- package/esm/utils.test.js +141 -0
- package/esm/utils.test.js.map +1 -0
- package/esm/version.d.ts +1 -1
- package/esm/version.js +1 -1
- package/package.json +8 -10
- package/src/babel-jsx.ts +277 -0
- package/src/babel-plugin-imports.ts +6 -169
- package/src/cli.ts +45 -6
- package/src/css.ts +13 -13
- package/src/esbuild.ts +5 -4
- package/src/example-code.test.ts +40 -41
- package/src/exporter.ts +124 -54
- package/src/flat-cache-interceptor.ts +114 -0
- package/src/framer.js +902 -739
- package/src/index.ts +1 -1
- package/src/react.tsx +15 -1
- package/src/sentry.ts +1 -20
- package/src/undici-dispatcher.ts +13 -0
- package/src/utils.test.ts +148 -0
- package/src/utils.ts +4 -17
- package/src/version.ts +1 -1
package/src/framer.js
CHANGED
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
__toESM,
|
|
14
14
|
} from './framer-chunks/chunk-A2PMVMFI.js';
|
|
15
15
|
|
|
16
|
-
// /:https://app.framerstatic.com/chunk-
|
|
16
|
+
// /:https://app.framerstatic.com/chunk-A6RUM2JZ.mjs
|
|
17
17
|
import { createContext, } from 'react';
|
|
18
18
|
import { useEffect, useLayoutEffect, } from 'react';
|
|
19
19
|
import { useCallback, useContext, useId, } from 'react';
|
|
@@ -68,281 +68,6 @@ var LayoutGroupContext = createContext({},);
|
|
|
68
68
|
var isBrowser = typeof window !== 'undefined';
|
|
69
69
|
var useIsomorphicLayoutEffect = isBrowser ? useLayoutEffect : useEffect;
|
|
70
70
|
var PresenceContext = /* @__PURE__ */ createContext(null,);
|
|
71
|
-
var MotionConfigContext = createContext({
|
|
72
|
-
transformPagePoint: (p) => p,
|
|
73
|
-
isStatic: false,
|
|
74
|
-
reducedMotion: 'never',
|
|
75
|
-
},);
|
|
76
|
-
function usePresence(subscribe = true,) {
|
|
77
|
-
const context = useContext(PresenceContext,);
|
|
78
|
-
if (context === null) return [true, null,];
|
|
79
|
-
const {
|
|
80
|
-
isPresent: isPresent2,
|
|
81
|
-
onExitComplete,
|
|
82
|
-
register,
|
|
83
|
-
} = context;
|
|
84
|
-
const id4 = useId();
|
|
85
|
-
useEffect(() => {
|
|
86
|
-
if (subscribe) {
|
|
87
|
-
return register(id4,);
|
|
88
|
-
}
|
|
89
|
-
}, [subscribe,],);
|
|
90
|
-
const safeToRemove = useCallback(() => subscribe && onExitComplete && onExitComplete(id4,), [id4, onExitComplete, subscribe,],);
|
|
91
|
-
return !isPresent2 && onExitComplete ? [false, safeToRemove,] : [true,];
|
|
92
|
-
}
|
|
93
|
-
function useIsPresent() {
|
|
94
|
-
return isPresent(useContext(PresenceContext,),);
|
|
95
|
-
}
|
|
96
|
-
function isPresent(context,) {
|
|
97
|
-
return context === null ? true : context.isPresent;
|
|
98
|
-
}
|
|
99
|
-
function useConstant(init,) {
|
|
100
|
-
const ref = useRef3(null,);
|
|
101
|
-
if (ref.current === null) {
|
|
102
|
-
ref.current = init();
|
|
103
|
-
}
|
|
104
|
-
return ref.current;
|
|
105
|
-
}
|
|
106
|
-
var PopChildMeasure = class extends React2.Component {
|
|
107
|
-
getSnapshotBeforeUpdate(prevProps,) {
|
|
108
|
-
const element = this.props.childRef.current;
|
|
109
|
-
if (element && prevProps.isPresent && !this.props.isPresent) {
|
|
110
|
-
const parent = element.offsetParent;
|
|
111
|
-
const parentWidth = parent instanceof HTMLElement ? parent.offsetWidth || 0 : 0;
|
|
112
|
-
const size = this.props.sizeRef.current;
|
|
113
|
-
size.height = element.offsetHeight || 0;
|
|
114
|
-
size.width = element.offsetWidth || 0;
|
|
115
|
-
size.top = element.offsetTop;
|
|
116
|
-
size.left = element.offsetLeft;
|
|
117
|
-
size.right = parentWidth - size.width - size.left;
|
|
118
|
-
}
|
|
119
|
-
return null;
|
|
120
|
-
}
|
|
121
|
-
/**
|
|
122
|
-
* Required with getSnapshotBeforeUpdate to stop React complaining.
|
|
123
|
-
*/
|
|
124
|
-
componentDidUpdate() {}
|
|
125
|
-
render() {
|
|
126
|
-
return this.props.children;
|
|
127
|
-
}
|
|
128
|
-
};
|
|
129
|
-
function PopChild({
|
|
130
|
-
children,
|
|
131
|
-
isPresent: isPresent2,
|
|
132
|
-
anchorX,
|
|
133
|
-
},) {
|
|
134
|
-
const id4 = useId();
|
|
135
|
-
const ref = useRef3(null,);
|
|
136
|
-
const size = useRef3({
|
|
137
|
-
width: 0,
|
|
138
|
-
height: 0,
|
|
139
|
-
top: 0,
|
|
140
|
-
left: 0,
|
|
141
|
-
right: 0,
|
|
142
|
-
},);
|
|
143
|
-
const {
|
|
144
|
-
nonce,
|
|
145
|
-
} = useContext(MotionConfigContext,);
|
|
146
|
-
useInsertionEffect(() => {
|
|
147
|
-
const {
|
|
148
|
-
width,
|
|
149
|
-
height,
|
|
150
|
-
top,
|
|
151
|
-
left,
|
|
152
|
-
right,
|
|
153
|
-
} = size.current;
|
|
154
|
-
if (isPresent2 || !ref.current || !width || !height) return;
|
|
155
|
-
const x = anchorX === 'left' ? `left: ${left}` : `right: ${right}`;
|
|
156
|
-
ref.current.dataset.motionPopId = id4;
|
|
157
|
-
const style2 = document.createElement('style',);
|
|
158
|
-
if (nonce) style2.nonce = nonce;
|
|
159
|
-
document.head.appendChild(style2,);
|
|
160
|
-
if (style2.sheet) {
|
|
161
|
-
style2.sheet.insertRule(`
|
|
162
|
-
[data-motion-pop-id="${id4}"] {
|
|
163
|
-
position: absolute !important;
|
|
164
|
-
width: ${width}px !important;
|
|
165
|
-
height: ${height}px !important;
|
|
166
|
-
${x}px !important;
|
|
167
|
-
top: ${top}px !important;
|
|
168
|
-
}
|
|
169
|
-
`,);
|
|
170
|
-
}
|
|
171
|
-
return () => {
|
|
172
|
-
if (document.head.contains(style2,)) {
|
|
173
|
-
document.head.removeChild(style2,);
|
|
174
|
-
}
|
|
175
|
-
};
|
|
176
|
-
}, [isPresent2,],);
|
|
177
|
-
return jsx3(PopChildMeasure, {
|
|
178
|
-
isPresent: isPresent2,
|
|
179
|
-
childRef: ref,
|
|
180
|
-
sizeRef: size,
|
|
181
|
-
children: React2.cloneElement(children, {
|
|
182
|
-
ref,
|
|
183
|
-
},),
|
|
184
|
-
},);
|
|
185
|
-
}
|
|
186
|
-
var PresenceChild = ({
|
|
187
|
-
children,
|
|
188
|
-
initial,
|
|
189
|
-
isPresent: isPresent2,
|
|
190
|
-
onExitComplete,
|
|
191
|
-
custom,
|
|
192
|
-
presenceAffectsLayout,
|
|
193
|
-
mode,
|
|
194
|
-
anchorX,
|
|
195
|
-
},) => {
|
|
196
|
-
const presenceChildren = useConstant(newChildrenMap,);
|
|
197
|
-
const id4 = useId();
|
|
198
|
-
let isReusedContext = true;
|
|
199
|
-
let context = useMemo2(() => {
|
|
200
|
-
isReusedContext = false;
|
|
201
|
-
return {
|
|
202
|
-
id: id4,
|
|
203
|
-
initial,
|
|
204
|
-
isPresent: isPresent2,
|
|
205
|
-
custom,
|
|
206
|
-
onExitComplete: (childId) => {
|
|
207
|
-
presenceChildren.set(childId, true,);
|
|
208
|
-
for (const isComplete of presenceChildren.values()) {
|
|
209
|
-
if (!isComplete) return;
|
|
210
|
-
}
|
|
211
|
-
onExitComplete && onExitComplete();
|
|
212
|
-
},
|
|
213
|
-
register: (childId) => {
|
|
214
|
-
presenceChildren.set(childId, false,);
|
|
215
|
-
return () => presenceChildren.delete(childId,);
|
|
216
|
-
},
|
|
217
|
-
};
|
|
218
|
-
}, [isPresent2, presenceChildren, onExitComplete,],);
|
|
219
|
-
if (presenceAffectsLayout && isReusedContext) {
|
|
220
|
-
context = {
|
|
221
|
-
...context,
|
|
222
|
-
};
|
|
223
|
-
}
|
|
224
|
-
useMemo2(() => {
|
|
225
|
-
presenceChildren.forEach((_, key7,) => presenceChildren.set(key7, false,));
|
|
226
|
-
}, [isPresent2,],);
|
|
227
|
-
React2.useEffect(() => {
|
|
228
|
-
!isPresent2 && !presenceChildren.size && onExitComplete && onExitComplete();
|
|
229
|
-
}, [isPresent2,],);
|
|
230
|
-
if (mode === 'popLayout') {
|
|
231
|
-
children = jsx3(PopChild, {
|
|
232
|
-
isPresent: isPresent2,
|
|
233
|
-
anchorX,
|
|
234
|
-
children,
|
|
235
|
-
},);
|
|
236
|
-
}
|
|
237
|
-
return jsx3(PresenceContext.Provider, {
|
|
238
|
-
value: context,
|
|
239
|
-
children,
|
|
240
|
-
},);
|
|
241
|
-
};
|
|
242
|
-
function newChildrenMap() {
|
|
243
|
-
return /* @__PURE__ */ new Map();
|
|
244
|
-
}
|
|
245
|
-
var getChildKey = (child) => child.key || '';
|
|
246
|
-
function onlyElements(children,) {
|
|
247
|
-
const filtered = [];
|
|
248
|
-
Children.forEach(children, (child) => {
|
|
249
|
-
if (isValidElement(child,)) filtered.push(child,);
|
|
250
|
-
},);
|
|
251
|
-
return filtered;
|
|
252
|
-
}
|
|
253
|
-
var AnimatePresence = ({
|
|
254
|
-
children,
|
|
255
|
-
custom,
|
|
256
|
-
initial = true,
|
|
257
|
-
onExitComplete,
|
|
258
|
-
presenceAffectsLayout = true,
|
|
259
|
-
mode = 'sync',
|
|
260
|
-
propagate = false,
|
|
261
|
-
anchorX = 'left',
|
|
262
|
-
},) => {
|
|
263
|
-
const [isParentPresent, safeToRemove,] = usePresence(propagate,);
|
|
264
|
-
const presentChildren = useMemo2(() => onlyElements(children,), [children,],);
|
|
265
|
-
const presentKeys = propagate && !isParentPresent ? [] : presentChildren.map(getChildKey,);
|
|
266
|
-
const isInitialRender = useRef3(true,);
|
|
267
|
-
const pendingPresentChildren = useRef3(presentChildren,);
|
|
268
|
-
const exitComplete = useConstant(() => /* @__PURE__ */ new Map());
|
|
269
|
-
const [diffedChildren, setDiffedChildren,] = useState(presentChildren,);
|
|
270
|
-
const [renderedChildren, setRenderedChildren,] = useState(presentChildren,);
|
|
271
|
-
useIsomorphicLayoutEffect(() => {
|
|
272
|
-
isInitialRender.current = false;
|
|
273
|
-
pendingPresentChildren.current = presentChildren;
|
|
274
|
-
for (let i = 0; i < renderedChildren.length; i++) {
|
|
275
|
-
const key7 = getChildKey(renderedChildren[i],);
|
|
276
|
-
if (!presentKeys.includes(key7,)) {
|
|
277
|
-
if (exitComplete.get(key7,) !== true) {
|
|
278
|
-
exitComplete.set(key7, false,);
|
|
279
|
-
}
|
|
280
|
-
} else {
|
|
281
|
-
exitComplete.delete(key7,);
|
|
282
|
-
}
|
|
283
|
-
}
|
|
284
|
-
}, [renderedChildren, presentKeys.length, presentKeys.join('-',),],);
|
|
285
|
-
const exitingChildren = [];
|
|
286
|
-
if (presentChildren !== diffedChildren) {
|
|
287
|
-
let nextChildren = [...presentChildren,];
|
|
288
|
-
for (let i = 0; i < renderedChildren.length; i++) {
|
|
289
|
-
const child = renderedChildren[i];
|
|
290
|
-
const key7 = getChildKey(child,);
|
|
291
|
-
if (!presentKeys.includes(key7,)) {
|
|
292
|
-
nextChildren.splice(i, 0, child,);
|
|
293
|
-
exitingChildren.push(child,);
|
|
294
|
-
}
|
|
295
|
-
}
|
|
296
|
-
if (mode === 'wait' && exitingChildren.length) {
|
|
297
|
-
nextChildren = exitingChildren;
|
|
298
|
-
}
|
|
299
|
-
setRenderedChildren(onlyElements(nextChildren,),);
|
|
300
|
-
setDiffedChildren(presentChildren,);
|
|
301
|
-
return null;
|
|
302
|
-
}
|
|
303
|
-
if (false) {
|
|
304
|
-
console.warn(
|
|
305
|
-
`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`,
|
|
306
|
-
);
|
|
307
|
-
}
|
|
308
|
-
const {
|
|
309
|
-
forceRender,
|
|
310
|
-
} = useContext(LayoutGroupContext,);
|
|
311
|
-
return jsx3(Fragment, {
|
|
312
|
-
children: renderedChildren.map((child) => {
|
|
313
|
-
const key7 = getChildKey(child,);
|
|
314
|
-
const isPresent2 = propagate && !isParentPresent ? false : presentChildren === renderedChildren || presentKeys.includes(key7,);
|
|
315
|
-
const onExit = () => {
|
|
316
|
-
if (exitComplete.has(key7,)) {
|
|
317
|
-
exitComplete.set(key7, true,);
|
|
318
|
-
} else {
|
|
319
|
-
return;
|
|
320
|
-
}
|
|
321
|
-
let isEveryExitComplete = true;
|
|
322
|
-
exitComplete.forEach((isExitComplete) => {
|
|
323
|
-
if (!isExitComplete) isEveryExitComplete = false;
|
|
324
|
-
},);
|
|
325
|
-
if (isEveryExitComplete) {
|
|
326
|
-
forceRender == null ? void 0 : forceRender();
|
|
327
|
-
setRenderedChildren(pendingPresentChildren.current,);
|
|
328
|
-
propagate && (safeToRemove == null ? void 0 : safeToRemove());
|
|
329
|
-
onExitComplete && onExitComplete();
|
|
330
|
-
}
|
|
331
|
-
};
|
|
332
|
-
return jsx3(PresenceChild, {
|
|
333
|
-
isPresent: isPresent2,
|
|
334
|
-
initial: !isInitialRender.current || initial ? void 0 : false,
|
|
335
|
-
custom,
|
|
336
|
-
presenceAffectsLayout,
|
|
337
|
-
mode,
|
|
338
|
-
onExitComplete: isPresent2 ? void 0 : onExit,
|
|
339
|
-
anchorX,
|
|
340
|
-
children: child,
|
|
341
|
-
}, key7,);
|
|
342
|
-
},),
|
|
343
|
-
},);
|
|
344
|
-
};
|
|
345
|
-
var DeprecatedLayoutGroupContext = createContext(null,);
|
|
346
71
|
function addUniqueItem(arr, item,) {
|
|
347
72
|
if (arr.indexOf(item,) === -1) arr.push(item,);
|
|
348
73
|
}
|
|
@@ -380,6 +105,9 @@ if (false) {
|
|
|
380
105
|
}
|
|
381
106
|
var MotionGlobalConfig = {};
|
|
382
107
|
var isNumericalString = (v) => /^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(v,);
|
|
108
|
+
function isObject(value,) {
|
|
109
|
+
return typeof value === 'object' && value !== null;
|
|
110
|
+
}
|
|
383
111
|
var isZeroValueString = (v) => /^0[^.\s]+$/u.test(v,);
|
|
384
112
|
// @__NO_SIDE_EFFECTS__
|
|
385
113
|
function memo(callback,) {
|
|
@@ -1609,15 +1337,13 @@ var JSAnimation = class extends WithPromise {
|
|
|
1609
1337
|
this.currentTime = 0;
|
|
1610
1338
|
this.holdTime = null;
|
|
1611
1339
|
this.playbackSpeed = 1;
|
|
1612
|
-
this.stop = (
|
|
1340
|
+
this.stop = () => {
|
|
1613
1341
|
var _a, _b;
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
this.tick(time.now(),);
|
|
1620
|
-
}
|
|
1342
|
+
const {
|
|
1343
|
+
motionValue: motionValue2,
|
|
1344
|
+
} = this.options;
|
|
1345
|
+
if (motionValue2 && motionValue2.updatedAt !== time.now()) {
|
|
1346
|
+
this.tick(time.now(),);
|
|
1621
1347
|
}
|
|
1622
1348
|
this.isStopped = true;
|
|
1623
1349
|
if (this.state === 'idle') return;
|
|
@@ -2478,12 +2204,15 @@ var NativeAnimationExtended = class extends NativeAnimation {
|
|
|
2478
2204
|
sampleAnimation.stop();
|
|
2479
2205
|
}
|
|
2480
2206
|
};
|
|
2481
|
-
|
|
2482
|
-
|
|
2207
|
+
function isHTMLElement(element,) {
|
|
2208
|
+
return isObject(element,) && 'offsetHeight' in element;
|
|
2209
|
+
}
|
|
2210
|
+
var acceleratedValues = /* @__PURE__ */ new Set(['opacity', 'clipPath', 'filter', 'transform',// TODO: Could be re-enabled now we have support for linear() easing
|
|
2483
2211
|
// "background-color"
|
|
2484
2212
|
],);
|
|
2485
2213
|
var supportsWaapi = /* @__PURE__ */ memo(() => Object.hasOwnProperty.call(Element.prototype, 'animate',));
|
|
2486
2214
|
function supportsBrowserAnimation(options,) {
|
|
2215
|
+
var _a;
|
|
2487
2216
|
const {
|
|
2488
2217
|
motionValue: motionValue2,
|
|
2489
2218
|
name,
|
|
@@ -2492,7 +2221,7 @@ function supportsBrowserAnimation(options,) {
|
|
|
2492
2221
|
damping,
|
|
2493
2222
|
type,
|
|
2494
2223
|
} = options;
|
|
2495
|
-
if (!motionValue2
|
|
2224
|
+
if (!isHTMLElement((_a = motionValue2 == null ? void 0 : motionValue2.owner) == null ? void 0 : _a.current,)) {
|
|
2496
2225
|
return false;
|
|
2497
2226
|
}
|
|
2498
2227
|
const {
|
|
@@ -3148,6 +2877,120 @@ function resolveElements(elementOrSelector, scope, selectorCache,) {
|
|
|
3148
2877
|
}
|
|
3149
2878
|
return Array.from(elementOrSelector,);
|
|
3150
2879
|
}
|
|
2880
|
+
var getValueAsType = (value, type,) => {
|
|
2881
|
+
return type && typeof value === 'number' ? type.transform(value,) : value;
|
|
2882
|
+
};
|
|
2883
|
+
function camelToDash(str,) {
|
|
2884
|
+
return str.replace(/([A-Z])/g, (match) => `-${match.toLowerCase()}`,);
|
|
2885
|
+
}
|
|
2886
|
+
function createSelectorEffect(subjectEffect,) {
|
|
2887
|
+
return (subject, values,) => {
|
|
2888
|
+
const elements = resolveElements(subject,);
|
|
2889
|
+
const subscriptions = [];
|
|
2890
|
+
for (const element of elements) {
|
|
2891
|
+
const remove2 = subjectEffect(element, values,);
|
|
2892
|
+
subscriptions.push(remove2,);
|
|
2893
|
+
}
|
|
2894
|
+
return () => {
|
|
2895
|
+
for (const remove2 of subscriptions) remove2();
|
|
2896
|
+
};
|
|
2897
|
+
};
|
|
2898
|
+
}
|
|
2899
|
+
var MotionValueState = class {
|
|
2900
|
+
constructor() {
|
|
2901
|
+
this.latest = {};
|
|
2902
|
+
this.values = /* @__PURE__ */ new Map();
|
|
2903
|
+
}
|
|
2904
|
+
set(name, value, render, computed, useDefaultValueType = true,) {
|
|
2905
|
+
const existingValue = this.values.get(name,);
|
|
2906
|
+
if (existingValue) {
|
|
2907
|
+
existingValue.onRemove();
|
|
2908
|
+
}
|
|
2909
|
+
const onChange = () => {
|
|
2910
|
+
const v = value.get();
|
|
2911
|
+
if (useDefaultValueType) {
|
|
2912
|
+
this.latest[name] = getValueAsType(v, numberValueTypes[name],);
|
|
2913
|
+
} else {
|
|
2914
|
+
this.latest[name] = v;
|
|
2915
|
+
}
|
|
2916
|
+
render && frame.render(render,);
|
|
2917
|
+
};
|
|
2918
|
+
onChange();
|
|
2919
|
+
const cancelOnChange = value.on('change', onChange,);
|
|
2920
|
+
computed && value.addDependent(computed,);
|
|
2921
|
+
const remove2 = () => {
|
|
2922
|
+
cancelOnChange();
|
|
2923
|
+
render && cancelFrame(render,);
|
|
2924
|
+
this.values.delete(name,);
|
|
2925
|
+
computed && value.removeDependent(computed,);
|
|
2926
|
+
};
|
|
2927
|
+
this.values.set(name, {
|
|
2928
|
+
value,
|
|
2929
|
+
onRemove: remove2,
|
|
2930
|
+
},);
|
|
2931
|
+
return remove2;
|
|
2932
|
+
}
|
|
2933
|
+
get(name,) {
|
|
2934
|
+
var _a;
|
|
2935
|
+
return (_a = this.values.get(name,)) == null ? void 0 : _a.value;
|
|
2936
|
+
}
|
|
2937
|
+
destroy() {
|
|
2938
|
+
for (const value of this.values.values()) {
|
|
2939
|
+
value.onRemove();
|
|
2940
|
+
}
|
|
2941
|
+
}
|
|
2942
|
+
};
|
|
2943
|
+
function createEffect(addValue,) {
|
|
2944
|
+
const stateCache = /* @__PURE__ */ new WeakMap();
|
|
2945
|
+
const subscriptions = [];
|
|
2946
|
+
return (subject, values,) => {
|
|
2947
|
+
const state = stateCache.get(subject,) ?? new MotionValueState();
|
|
2948
|
+
stateCache.set(subject, state,);
|
|
2949
|
+
for (const key7 in values) {
|
|
2950
|
+
const value = values[key7];
|
|
2951
|
+
const remove2 = addValue(subject, state, key7, value,);
|
|
2952
|
+
subscriptions.push(remove2,);
|
|
2953
|
+
}
|
|
2954
|
+
return () => {
|
|
2955
|
+
for (const cancel of subscriptions) cancel();
|
|
2956
|
+
};
|
|
2957
|
+
};
|
|
2958
|
+
}
|
|
2959
|
+
function canSetAsProperty(element, name,) {
|
|
2960
|
+
if (!(name in element)) return false;
|
|
2961
|
+
const descriptor = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(element,), name,) ||
|
|
2962
|
+
Object.getOwnPropertyDescriptor(element, name,);
|
|
2963
|
+
return descriptor && typeof descriptor.set === 'function';
|
|
2964
|
+
}
|
|
2965
|
+
var addAttrValue = (element, state, key7, value,) => {
|
|
2966
|
+
const isProp = canSetAsProperty(element, key7,);
|
|
2967
|
+
const name = isProp ? key7 : key7.startsWith('data',) || key7.startsWith('aria',) ? camelToDash(key7,) : key7;
|
|
2968
|
+
const render = isProp
|
|
2969
|
+
? () => {
|
|
2970
|
+
element[name] = state.latest[key7];
|
|
2971
|
+
}
|
|
2972
|
+
: () => {
|
|
2973
|
+
const v = state.latest[key7];
|
|
2974
|
+
if (v === null || v === void 0) {
|
|
2975
|
+
element.removeAttribute(name,);
|
|
2976
|
+
} else {
|
|
2977
|
+
element.setAttribute(name, String(v,),);
|
|
2978
|
+
}
|
|
2979
|
+
};
|
|
2980
|
+
return state.set(key7, value, render,);
|
|
2981
|
+
};
|
|
2982
|
+
var attrEffect = /* @__PURE__ */ createSelectorEffect(/* @__PURE__ */ createEffect(addAttrValue,),);
|
|
2983
|
+
var propEffect = /* @__PURE__ */ createEffect((subject, state, key7, value,) => {
|
|
2984
|
+
return state.set(
|
|
2985
|
+
key7,
|
|
2986
|
+
value,
|
|
2987
|
+
() => {
|
|
2988
|
+
subject[key7] = state.latest[key7];
|
|
2989
|
+
},
|
|
2990
|
+
void 0,
|
|
2991
|
+
false,
|
|
2992
|
+
);
|
|
2993
|
+
},);
|
|
3151
2994
|
var MAX_VELOCITY_DELTA = 30;
|
|
3152
2995
|
var isFloat = (value) => {
|
|
3153
2996
|
return !isNaN(parseFloat(value,),);
|
|
@@ -3436,48 +3279,6 @@ var MotionValue = class {
|
|
|
3436
3279
|
function motionValue(init, options,) {
|
|
3437
3280
|
return new MotionValue(init, options,);
|
|
3438
3281
|
}
|
|
3439
|
-
var getValueAsType = (value, type,) => {
|
|
3440
|
-
return type && typeof value === 'number' ? type.transform(value,) : value;
|
|
3441
|
-
};
|
|
3442
|
-
var MotionValueState = class {
|
|
3443
|
-
constructor() {
|
|
3444
|
-
this.latest = {};
|
|
3445
|
-
this.values = /* @__PURE__ */ new Map();
|
|
3446
|
-
}
|
|
3447
|
-
set(name, value, render, computed,) {
|
|
3448
|
-
const existingValue = this.values.get(name,);
|
|
3449
|
-
if (existingValue) {
|
|
3450
|
-
existingValue.onRemove();
|
|
3451
|
-
}
|
|
3452
|
-
const onChange = () => {
|
|
3453
|
-
this.latest[name] = getValueAsType(value.get(), numberValueTypes[name],);
|
|
3454
|
-
render && frame.render(render,);
|
|
3455
|
-
};
|
|
3456
|
-
onChange();
|
|
3457
|
-
const cancelOnChange = value.on('change', onChange,);
|
|
3458
|
-
computed && value.addDependent(computed,);
|
|
3459
|
-
const remove2 = () => {
|
|
3460
|
-
cancelOnChange();
|
|
3461
|
-
render && cancelFrame(render,);
|
|
3462
|
-
this.values.delete(name,);
|
|
3463
|
-
computed && value.removeDependent(computed,);
|
|
3464
|
-
};
|
|
3465
|
-
this.values.set(name, {
|
|
3466
|
-
value,
|
|
3467
|
-
onRemove: remove2,
|
|
3468
|
-
},);
|
|
3469
|
-
return remove2;
|
|
3470
|
-
}
|
|
3471
|
-
get(name,) {
|
|
3472
|
-
var _a;
|
|
3473
|
-
return (_a = this.values.get(name,)) == null ? void 0 : _a.value;
|
|
3474
|
-
}
|
|
3475
|
-
destroy() {
|
|
3476
|
-
for (const value of this.values.values()) {
|
|
3477
|
-
value.onRemove();
|
|
3478
|
-
}
|
|
3479
|
-
}
|
|
3480
|
-
};
|
|
3481
3282
|
var translateAlias = {
|
|
3482
3283
|
x: 'translateX',
|
|
3483
3284
|
y: 'translateY',
|
|
@@ -3506,34 +3307,30 @@ function buildTransform(state,) {
|
|
|
3506
3307
|
}
|
|
3507
3308
|
return transformIsDefault ? 'none' : transform2.trim();
|
|
3508
3309
|
}
|
|
3509
|
-
var
|
|
3510
|
-
|
|
3511
|
-
const elements = resolveElements(subject,);
|
|
3512
|
-
const subscriptions = [];
|
|
3513
|
-
for (let i = 0; i < elements.length; i++) {
|
|
3514
|
-
const element = elements[i];
|
|
3515
|
-
const state = stateMap.get(element,) ?? new MotionValueState();
|
|
3516
|
-
stateMap.set(element, state,);
|
|
3517
|
-
for (const key7 in values) {
|
|
3518
|
-
const value = values[key7];
|
|
3519
|
-
const remove2 = addValue(element, state, key7, value,);
|
|
3520
|
-
subscriptions.push(remove2,);
|
|
3521
|
-
}
|
|
3522
|
-
}
|
|
3523
|
-
return () => {
|
|
3524
|
-
for (const cancel of subscriptions) cancel();
|
|
3525
|
-
};
|
|
3526
|
-
}
|
|
3527
|
-
function addValue(element, state, key7, value,) {
|
|
3310
|
+
var originProps = /* @__PURE__ */ new Set(['originX', 'originY', 'originZ',],);
|
|
3311
|
+
var addStyleValue = (element, state, key7, value,) => {
|
|
3528
3312
|
let render = void 0;
|
|
3529
3313
|
let computed = void 0;
|
|
3530
3314
|
if (transformProps.has(key7,)) {
|
|
3531
3315
|
if (!state.get('transform',)) {
|
|
3316
|
+
if (!isHTMLElement(element,) && !state.get('transformBox',)) {
|
|
3317
|
+
addStyleValue(element, state, 'transformBox', new MotionValue('fill-box',),);
|
|
3318
|
+
}
|
|
3532
3319
|
state.set('transform', new MotionValue('none',), () => {
|
|
3533
3320
|
element.style.transform = buildTransform(state,);
|
|
3534
3321
|
},);
|
|
3535
3322
|
}
|
|
3536
3323
|
computed = state.get('transform',);
|
|
3324
|
+
} else if (originProps.has(key7,)) {
|
|
3325
|
+
if (!state.get('transformOrigin',)) {
|
|
3326
|
+
state.set('transformOrigin', new MotionValue('',), () => {
|
|
3327
|
+
const originX = state.latest.originX ?? '50%';
|
|
3328
|
+
const originY = state.latest.originY ?? '50%';
|
|
3329
|
+
const originZ = state.latest.originZ ?? 0;
|
|
3330
|
+
element.style.transformOrigin = `${originX} ${originY} ${originZ}`;
|
|
3331
|
+
},);
|
|
3332
|
+
}
|
|
3333
|
+
computed = state.get('transformOrigin',);
|
|
3537
3334
|
} else if (isCSSVar(key7,)) {
|
|
3538
3335
|
render = () => {
|
|
3539
3336
|
element.style.setProperty(key7, state.latest[key7],);
|
|
@@ -3544,6 +3341,38 @@ function addValue(element, state, key7, value,) {
|
|
|
3544
3341
|
};
|
|
3545
3342
|
}
|
|
3546
3343
|
return state.set(key7, value, render, computed,);
|
|
3344
|
+
};
|
|
3345
|
+
var styleEffect = /* @__PURE__ */ createSelectorEffect(/* @__PURE__ */ createEffect(addStyleValue,),);
|
|
3346
|
+
var toPx = px.transform;
|
|
3347
|
+
function addSVGPathValue(element, state, key7, value,) {
|
|
3348
|
+
frame.render(() => element.setAttribute('pathLength', '1',));
|
|
3349
|
+
if (key7 === 'pathOffset') {
|
|
3350
|
+
return state.set(key7, value, () => element.setAttribute('stroke-dashoffset', toPx(-state.latest[key7],),),);
|
|
3351
|
+
} else {
|
|
3352
|
+
if (!state.get('stroke-dasharray',)) {
|
|
3353
|
+
state.set('stroke-dasharray', new MotionValue('1 1',), () => {
|
|
3354
|
+
const {
|
|
3355
|
+
pathLength = 1,
|
|
3356
|
+
pathSpacing,
|
|
3357
|
+
} = state.latest;
|
|
3358
|
+
element.setAttribute('stroke-dasharray', `${toPx(pathLength,)} ${toPx(pathSpacing ?? 1 - Number(pathLength,),)}`,);
|
|
3359
|
+
},);
|
|
3360
|
+
}
|
|
3361
|
+
return state.set(key7, value, void 0, state.get('stroke-dasharray',),);
|
|
3362
|
+
}
|
|
3363
|
+
}
|
|
3364
|
+
var addSVGValue = (element, state, key7, value,) => {
|
|
3365
|
+
if (key7.startsWith('path',)) {
|
|
3366
|
+
return addSVGPathValue(element, state, key7, value,);
|
|
3367
|
+
} else if (key7.startsWith('attr',)) {
|
|
3368
|
+
return addAttrValue(element, state, convertAttrKey(key7,), value,);
|
|
3369
|
+
}
|
|
3370
|
+
const handler = key7 in element.style ? addStyleValue : addAttrValue;
|
|
3371
|
+
return handler(element, state, key7, value,);
|
|
3372
|
+
};
|
|
3373
|
+
var svgEffect = /* @__PURE__ */ createSelectorEffect(/* @__PURE__ */ createEffect(addSVGValue,),);
|
|
3374
|
+
function convertAttrKey(key7,) {
|
|
3375
|
+
return key7.replace(/^attr([A-Z])/, (_, firstChar,) => firstChar.toLowerCase(),);
|
|
3547
3376
|
}
|
|
3548
3377
|
var {
|
|
3549
3378
|
schedule: microtask,
|
|
@@ -3700,7 +3529,7 @@ function press(targetOrSelector, onPressStart, options = {},) {
|
|
|
3700
3529
|
targets.forEach((target) => {
|
|
3701
3530
|
const pointerDownTarget = options.useGlobalTarget ? window : target;
|
|
3702
3531
|
pointerDownTarget.addEventListener('pointerdown', startPress, eventOptions,);
|
|
3703
|
-
if (target
|
|
3532
|
+
if (isHTMLElement(target,)) {
|
|
3704
3533
|
target.addEventListener('focus', (event) => enableKeyboardPress(event, eventOptions,),);
|
|
3705
3534
|
if (!isElementKeyboardAccessible(target,) && !target.hasAttribute('tabindex',)) {
|
|
3706
3535
|
target.tabIndex = 0;
|
|
@@ -3845,6 +3674,12 @@ function recordStats() {
|
|
|
3845
3674
|
frame.postRender(record, true,);
|
|
3846
3675
|
return reportStats;
|
|
3847
3676
|
}
|
|
3677
|
+
function isSVGElement(element,) {
|
|
3678
|
+
return isObject(element,) && 'ownerSVGElement' in element;
|
|
3679
|
+
}
|
|
3680
|
+
function isSVGSVGElement(element,) {
|
|
3681
|
+
return isSVGElement(element,) && element.tagName === 'svg';
|
|
3682
|
+
}
|
|
3848
3683
|
function transform(...args) {
|
|
3849
3684
|
const useImmediate = !Array.isArray(args[0],);
|
|
3850
3685
|
const argOffset = useImmediate ? 0 : -1;
|
|
@@ -3877,6 +3712,56 @@ function mapValue(inputValue, inputRange, outputRange, options,) {
|
|
|
3877
3712
|
const map2 = transform(inputRange, outputRange, options,);
|
|
3878
3713
|
return transformValue(() => map2(inputValue.get(),));
|
|
3879
3714
|
}
|
|
3715
|
+
var isMotionValue = (value) => Boolean(value && value.getVelocity,);
|
|
3716
|
+
function springValue(source, options,) {
|
|
3717
|
+
const initialValue = isMotionValue(source,) ? source.get() : source;
|
|
3718
|
+
const value = motionValue(initialValue,);
|
|
3719
|
+
attachSpring(value, source, options,);
|
|
3720
|
+
return value;
|
|
3721
|
+
}
|
|
3722
|
+
function attachSpring(value, source, options,) {
|
|
3723
|
+
const initialValue = value.get();
|
|
3724
|
+
let activeAnimation = null;
|
|
3725
|
+
let latestValue = initialValue;
|
|
3726
|
+
let latestSetter;
|
|
3727
|
+
const unit = typeof initialValue === 'string' ? initialValue.replace(/[\d.-]/g, '',) : void 0;
|
|
3728
|
+
const stopAnimation2 = () => {
|
|
3729
|
+
if (activeAnimation) {
|
|
3730
|
+
activeAnimation.stop();
|
|
3731
|
+
activeAnimation = null;
|
|
3732
|
+
}
|
|
3733
|
+
};
|
|
3734
|
+
const startAnimation2 = () => {
|
|
3735
|
+
stopAnimation2();
|
|
3736
|
+
activeAnimation = new JSAnimation({
|
|
3737
|
+
keyframes: [asNumber(value.get(),), asNumber(latestValue,),],
|
|
3738
|
+
velocity: value.getVelocity(),
|
|
3739
|
+
type: 'spring',
|
|
3740
|
+
restDelta: 1e-3,
|
|
3741
|
+
restSpeed: 0.01,
|
|
3742
|
+
...options,
|
|
3743
|
+
onUpdate: latestSetter,
|
|
3744
|
+
},);
|
|
3745
|
+
};
|
|
3746
|
+
value.attach((v, set,) => {
|
|
3747
|
+
latestValue = v;
|
|
3748
|
+
latestSetter = (latest) => set(parseValue(latest, unit,),);
|
|
3749
|
+
frame.postRender(startAnimation2,);
|
|
3750
|
+
return value.get();
|
|
3751
|
+
}, stopAnimation2,);
|
|
3752
|
+
let unsubscribe = void 0;
|
|
3753
|
+
if (isMotionValue(source,)) {
|
|
3754
|
+
unsubscribe = source.on('change', (v) => value.set(parseValue(v, unit,),),);
|
|
3755
|
+
value.on('destroy', unsubscribe,);
|
|
3756
|
+
}
|
|
3757
|
+
return unsubscribe;
|
|
3758
|
+
}
|
|
3759
|
+
function parseValue(v, unit,) {
|
|
3760
|
+
return unit ? v + unit : v;
|
|
3761
|
+
}
|
|
3762
|
+
function asNumber(v,) {
|
|
3763
|
+
return typeof v === 'number' ? v : parseFloat(v,);
|
|
3764
|
+
}
|
|
3880
3765
|
var valueTypes = [...dimensionValueTypes, color, complex,];
|
|
3881
3766
|
var findValueType = (v) => valueTypes.find(testValueType(v,),);
|
|
3882
3767
|
function chooseLayerType(valueName,) {
|
|
@@ -4163,6 +4048,281 @@ var cancelSync = stepsOrder.reduce((acc, key7,) => {
|
|
|
4163
4048
|
acc[key7] = (process2) => cancelFrame(process2,);
|
|
4164
4049
|
return acc;
|
|
4165
4050
|
}, {},);
|
|
4051
|
+
var MotionConfigContext = createContext({
|
|
4052
|
+
transformPagePoint: (p) => p,
|
|
4053
|
+
isStatic: false,
|
|
4054
|
+
reducedMotion: 'never',
|
|
4055
|
+
},);
|
|
4056
|
+
function usePresence(subscribe = true,) {
|
|
4057
|
+
const context = useContext(PresenceContext,);
|
|
4058
|
+
if (context === null) return [true, null,];
|
|
4059
|
+
const {
|
|
4060
|
+
isPresent: isPresent2,
|
|
4061
|
+
onExitComplete,
|
|
4062
|
+
register,
|
|
4063
|
+
} = context;
|
|
4064
|
+
const id4 = useId();
|
|
4065
|
+
useEffect(() => {
|
|
4066
|
+
if (subscribe) {
|
|
4067
|
+
return register(id4,);
|
|
4068
|
+
}
|
|
4069
|
+
}, [subscribe,],);
|
|
4070
|
+
const safeToRemove = useCallback(() => subscribe && onExitComplete && onExitComplete(id4,), [id4, onExitComplete, subscribe,],);
|
|
4071
|
+
return !isPresent2 && onExitComplete ? [false, safeToRemove,] : [true,];
|
|
4072
|
+
}
|
|
4073
|
+
function useIsPresent() {
|
|
4074
|
+
return isPresent(useContext(PresenceContext,),);
|
|
4075
|
+
}
|
|
4076
|
+
function isPresent(context,) {
|
|
4077
|
+
return context === null ? true : context.isPresent;
|
|
4078
|
+
}
|
|
4079
|
+
function useConstant(init,) {
|
|
4080
|
+
const ref = useRef3(null,);
|
|
4081
|
+
if (ref.current === null) {
|
|
4082
|
+
ref.current = init();
|
|
4083
|
+
}
|
|
4084
|
+
return ref.current;
|
|
4085
|
+
}
|
|
4086
|
+
var PopChildMeasure = class extends React2.Component {
|
|
4087
|
+
getSnapshotBeforeUpdate(prevProps,) {
|
|
4088
|
+
const element = this.props.childRef.current;
|
|
4089
|
+
if (element && prevProps.isPresent && !this.props.isPresent) {
|
|
4090
|
+
const parent = element.offsetParent;
|
|
4091
|
+
const parentWidth = isHTMLElement(parent,) ? parent.offsetWidth || 0 : 0;
|
|
4092
|
+
const size = this.props.sizeRef.current;
|
|
4093
|
+
size.height = element.offsetHeight || 0;
|
|
4094
|
+
size.width = element.offsetWidth || 0;
|
|
4095
|
+
size.top = element.offsetTop;
|
|
4096
|
+
size.left = element.offsetLeft;
|
|
4097
|
+
size.right = parentWidth - size.width - size.left;
|
|
4098
|
+
}
|
|
4099
|
+
return null;
|
|
4100
|
+
}
|
|
4101
|
+
/**
|
|
4102
|
+
* Required with getSnapshotBeforeUpdate to stop React complaining.
|
|
4103
|
+
*/
|
|
4104
|
+
componentDidUpdate() {}
|
|
4105
|
+
render() {
|
|
4106
|
+
return this.props.children;
|
|
4107
|
+
}
|
|
4108
|
+
};
|
|
4109
|
+
function PopChild({
|
|
4110
|
+
children,
|
|
4111
|
+
isPresent: isPresent2,
|
|
4112
|
+
anchorX,
|
|
4113
|
+
},) {
|
|
4114
|
+
const id4 = useId();
|
|
4115
|
+
const ref = useRef3(null,);
|
|
4116
|
+
const size = useRef3({
|
|
4117
|
+
width: 0,
|
|
4118
|
+
height: 0,
|
|
4119
|
+
top: 0,
|
|
4120
|
+
left: 0,
|
|
4121
|
+
right: 0,
|
|
4122
|
+
},);
|
|
4123
|
+
const {
|
|
4124
|
+
nonce,
|
|
4125
|
+
} = useContext(MotionConfigContext,);
|
|
4126
|
+
useInsertionEffect(() => {
|
|
4127
|
+
const {
|
|
4128
|
+
width,
|
|
4129
|
+
height,
|
|
4130
|
+
top,
|
|
4131
|
+
left,
|
|
4132
|
+
right,
|
|
4133
|
+
} = size.current;
|
|
4134
|
+
if (isPresent2 || !ref.current || !width || !height) return;
|
|
4135
|
+
const x = anchorX === 'left' ? `left: ${left}` : `right: ${right}`;
|
|
4136
|
+
ref.current.dataset.motionPopId = id4;
|
|
4137
|
+
const style2 = document.createElement('style',);
|
|
4138
|
+
if (nonce) style2.nonce = nonce;
|
|
4139
|
+
document.head.appendChild(style2,);
|
|
4140
|
+
if (style2.sheet) {
|
|
4141
|
+
style2.sheet.insertRule(`
|
|
4142
|
+
[data-motion-pop-id="${id4}"] {
|
|
4143
|
+
position: absolute !important;
|
|
4144
|
+
width: ${width}px !important;
|
|
4145
|
+
height: ${height}px !important;
|
|
4146
|
+
${x}px !important;
|
|
4147
|
+
top: ${top}px !important;
|
|
4148
|
+
}
|
|
4149
|
+
`,);
|
|
4150
|
+
}
|
|
4151
|
+
return () => {
|
|
4152
|
+
if (document.head.contains(style2,)) {
|
|
4153
|
+
document.head.removeChild(style2,);
|
|
4154
|
+
}
|
|
4155
|
+
};
|
|
4156
|
+
}, [isPresent2,],);
|
|
4157
|
+
return jsx3(PopChildMeasure, {
|
|
4158
|
+
isPresent: isPresent2,
|
|
4159
|
+
childRef: ref,
|
|
4160
|
+
sizeRef: size,
|
|
4161
|
+
children: React2.cloneElement(children, {
|
|
4162
|
+
ref,
|
|
4163
|
+
},),
|
|
4164
|
+
},);
|
|
4165
|
+
}
|
|
4166
|
+
var PresenceChild = ({
|
|
4167
|
+
children,
|
|
4168
|
+
initial,
|
|
4169
|
+
isPresent: isPresent2,
|
|
4170
|
+
onExitComplete,
|
|
4171
|
+
custom,
|
|
4172
|
+
presenceAffectsLayout,
|
|
4173
|
+
mode,
|
|
4174
|
+
anchorX,
|
|
4175
|
+
},) => {
|
|
4176
|
+
const presenceChildren = useConstant(newChildrenMap,);
|
|
4177
|
+
const id4 = useId();
|
|
4178
|
+
let isReusedContext = true;
|
|
4179
|
+
let context = useMemo2(() => {
|
|
4180
|
+
isReusedContext = false;
|
|
4181
|
+
return {
|
|
4182
|
+
id: id4,
|
|
4183
|
+
initial,
|
|
4184
|
+
isPresent: isPresent2,
|
|
4185
|
+
custom,
|
|
4186
|
+
onExitComplete: (childId) => {
|
|
4187
|
+
presenceChildren.set(childId, true,);
|
|
4188
|
+
for (const isComplete of presenceChildren.values()) {
|
|
4189
|
+
if (!isComplete) return;
|
|
4190
|
+
}
|
|
4191
|
+
onExitComplete && onExitComplete();
|
|
4192
|
+
},
|
|
4193
|
+
register: (childId) => {
|
|
4194
|
+
presenceChildren.set(childId, false,);
|
|
4195
|
+
return () => presenceChildren.delete(childId,);
|
|
4196
|
+
},
|
|
4197
|
+
};
|
|
4198
|
+
}, [isPresent2, presenceChildren, onExitComplete,],);
|
|
4199
|
+
if (presenceAffectsLayout && isReusedContext) {
|
|
4200
|
+
context = {
|
|
4201
|
+
...context,
|
|
4202
|
+
};
|
|
4203
|
+
}
|
|
4204
|
+
useMemo2(() => {
|
|
4205
|
+
presenceChildren.forEach((_, key7,) => presenceChildren.set(key7, false,));
|
|
4206
|
+
}, [isPresent2,],);
|
|
4207
|
+
React2.useEffect(() => {
|
|
4208
|
+
!isPresent2 && !presenceChildren.size && onExitComplete && onExitComplete();
|
|
4209
|
+
}, [isPresent2,],);
|
|
4210
|
+
if (mode === 'popLayout') {
|
|
4211
|
+
children = jsx3(PopChild, {
|
|
4212
|
+
isPresent: isPresent2,
|
|
4213
|
+
anchorX,
|
|
4214
|
+
children,
|
|
4215
|
+
},);
|
|
4216
|
+
}
|
|
4217
|
+
return jsx3(PresenceContext.Provider, {
|
|
4218
|
+
value: context,
|
|
4219
|
+
children,
|
|
4220
|
+
},);
|
|
4221
|
+
};
|
|
4222
|
+
function newChildrenMap() {
|
|
4223
|
+
return /* @__PURE__ */ new Map();
|
|
4224
|
+
}
|
|
4225
|
+
var getChildKey = (child) => child.key || '';
|
|
4226
|
+
function onlyElements(children,) {
|
|
4227
|
+
const filtered = [];
|
|
4228
|
+
Children.forEach(children, (child) => {
|
|
4229
|
+
if (isValidElement(child,)) filtered.push(child,);
|
|
4230
|
+
},);
|
|
4231
|
+
return filtered;
|
|
4232
|
+
}
|
|
4233
|
+
var AnimatePresence = ({
|
|
4234
|
+
children,
|
|
4235
|
+
custom,
|
|
4236
|
+
initial = true,
|
|
4237
|
+
onExitComplete,
|
|
4238
|
+
presenceAffectsLayout = true,
|
|
4239
|
+
mode = 'sync',
|
|
4240
|
+
propagate = false,
|
|
4241
|
+
anchorX = 'left',
|
|
4242
|
+
},) => {
|
|
4243
|
+
const [isParentPresent, safeToRemove,] = usePresence(propagate,);
|
|
4244
|
+
const presentChildren = useMemo2(() => onlyElements(children,), [children,],);
|
|
4245
|
+
const presentKeys = propagate && !isParentPresent ? [] : presentChildren.map(getChildKey,);
|
|
4246
|
+
const isInitialRender = useRef3(true,);
|
|
4247
|
+
const pendingPresentChildren = useRef3(presentChildren,);
|
|
4248
|
+
const exitComplete = useConstant(() => /* @__PURE__ */ new Map());
|
|
4249
|
+
const [diffedChildren, setDiffedChildren,] = useState(presentChildren,);
|
|
4250
|
+
const [renderedChildren, setRenderedChildren,] = useState(presentChildren,);
|
|
4251
|
+
useIsomorphicLayoutEffect(() => {
|
|
4252
|
+
isInitialRender.current = false;
|
|
4253
|
+
pendingPresentChildren.current = presentChildren;
|
|
4254
|
+
for (let i = 0; i < renderedChildren.length; i++) {
|
|
4255
|
+
const key7 = getChildKey(renderedChildren[i],);
|
|
4256
|
+
if (!presentKeys.includes(key7,)) {
|
|
4257
|
+
if (exitComplete.get(key7,) !== true) {
|
|
4258
|
+
exitComplete.set(key7, false,);
|
|
4259
|
+
}
|
|
4260
|
+
} else {
|
|
4261
|
+
exitComplete.delete(key7,);
|
|
4262
|
+
}
|
|
4263
|
+
}
|
|
4264
|
+
}, [renderedChildren, presentKeys.length, presentKeys.join('-',),],);
|
|
4265
|
+
const exitingChildren = [];
|
|
4266
|
+
if (presentChildren !== diffedChildren) {
|
|
4267
|
+
let nextChildren = [...presentChildren,];
|
|
4268
|
+
for (let i = 0; i < renderedChildren.length; i++) {
|
|
4269
|
+
const child = renderedChildren[i];
|
|
4270
|
+
const key7 = getChildKey(child,);
|
|
4271
|
+
if (!presentKeys.includes(key7,)) {
|
|
4272
|
+
nextChildren.splice(i, 0, child,);
|
|
4273
|
+
exitingChildren.push(child,);
|
|
4274
|
+
}
|
|
4275
|
+
}
|
|
4276
|
+
if (mode === 'wait' && exitingChildren.length) {
|
|
4277
|
+
nextChildren = exitingChildren;
|
|
4278
|
+
}
|
|
4279
|
+
setRenderedChildren(onlyElements(nextChildren,),);
|
|
4280
|
+
setDiffedChildren(presentChildren,);
|
|
4281
|
+
return null;
|
|
4282
|
+
}
|
|
4283
|
+
if (false) {
|
|
4284
|
+
console.warn(
|
|
4285
|
+
`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`,
|
|
4286
|
+
);
|
|
4287
|
+
}
|
|
4288
|
+
const {
|
|
4289
|
+
forceRender,
|
|
4290
|
+
} = useContext(LayoutGroupContext,);
|
|
4291
|
+
return jsx3(Fragment, {
|
|
4292
|
+
children: renderedChildren.map((child) => {
|
|
4293
|
+
const key7 = getChildKey(child,);
|
|
4294
|
+
const isPresent2 = propagate && !isParentPresent ? false : presentChildren === renderedChildren || presentKeys.includes(key7,);
|
|
4295
|
+
const onExit = () => {
|
|
4296
|
+
if (exitComplete.has(key7,)) {
|
|
4297
|
+
exitComplete.set(key7, true,);
|
|
4298
|
+
} else {
|
|
4299
|
+
return;
|
|
4300
|
+
}
|
|
4301
|
+
let isEveryExitComplete = true;
|
|
4302
|
+
exitComplete.forEach((isExitComplete) => {
|
|
4303
|
+
if (!isExitComplete) isEveryExitComplete = false;
|
|
4304
|
+
},);
|
|
4305
|
+
if (isEveryExitComplete) {
|
|
4306
|
+
forceRender == null ? void 0 : forceRender();
|
|
4307
|
+
setRenderedChildren(pendingPresentChildren.current,);
|
|
4308
|
+
propagate && (safeToRemove == null ? void 0 : safeToRemove());
|
|
4309
|
+
onExitComplete && onExitComplete();
|
|
4310
|
+
}
|
|
4311
|
+
};
|
|
4312
|
+
return jsx3(PresenceChild, {
|
|
4313
|
+
isPresent: isPresent2,
|
|
4314
|
+
initial: !isInitialRender.current || initial ? void 0 : false,
|
|
4315
|
+
custom,
|
|
4316
|
+
presenceAffectsLayout,
|
|
4317
|
+
mode,
|
|
4318
|
+
onExitComplete: isPresent2 ? void 0 : onExit,
|
|
4319
|
+
anchorX,
|
|
4320
|
+
children: child,
|
|
4321
|
+
}, key7,);
|
|
4322
|
+
},),
|
|
4323
|
+
},);
|
|
4324
|
+
};
|
|
4325
|
+
var DeprecatedLayoutGroupContext = createContext(null,);
|
|
4166
4326
|
function useIsMounted() {
|
|
4167
4327
|
const isMounted = useRef3(false,);
|
|
4168
4328
|
useIsomorphicLayoutEffect(() => {
|
|
@@ -4376,9 +4536,9 @@ function MotionConfig({
|
|
|
4376
4536
|
},);
|
|
4377
4537
|
}
|
|
4378
4538
|
var MotionContext = /* @__PURE__ */ createContext({},);
|
|
4379
|
-
var
|
|
4539
|
+
var camelToDash2 = (str) => str.replace(/([a-z])([A-Z])/gu, '$1-$2',).toLowerCase();
|
|
4380
4540
|
var optimizedAppearDataId = 'framerAppearId';
|
|
4381
|
-
var optimizedAppearDataAttribute = 'data-' +
|
|
4541
|
+
var optimizedAppearDataAttribute = 'data-' + camelToDash2(optimizedAppearDataId,);
|
|
4382
4542
|
var SwitchLayoutGroupContext = createContext({},);
|
|
4383
4543
|
function isAnimationControls(v,) {
|
|
4384
4544
|
return v !== null && typeof v === 'object' && typeof v.start === 'function';
|
|
@@ -4649,7 +4809,6 @@ function addScaleCorrector(correctors,) {
|
|
|
4649
4809
|
}
|
|
4650
4810
|
}
|
|
4651
4811
|
}
|
|
4652
|
-
var isMotionValue = (value) => Boolean(value && value.getVelocity,);
|
|
4653
4812
|
var translateAlias2 = {
|
|
4654
4813
|
x: 'translateX',
|
|
4655
4814
|
y: 'translateY',
|
|
@@ -4901,6 +5060,96 @@ function useHTMLProps(props, visualState,) {
|
|
|
4901
5060
|
htmlProps.style = style2;
|
|
4902
5061
|
return htmlProps;
|
|
4903
5062
|
}
|
|
5063
|
+
var dashKeys = {
|
|
5064
|
+
offset: 'stroke-dashoffset',
|
|
5065
|
+
array: 'stroke-dasharray',
|
|
5066
|
+
};
|
|
5067
|
+
var camelKeys = {
|
|
5068
|
+
offset: 'strokeDashoffset',
|
|
5069
|
+
array: 'strokeDasharray',
|
|
5070
|
+
};
|
|
5071
|
+
function buildSVGPath(attrs, length, spacing = 1, offset = 0, useDashCase = true,) {
|
|
5072
|
+
attrs.pathLength = 1;
|
|
5073
|
+
const keys23 = useDashCase ? dashKeys : camelKeys;
|
|
5074
|
+
attrs[keys23.offset] = px.transform(-offset,);
|
|
5075
|
+
const pathLength = px.transform(length,);
|
|
5076
|
+
const pathSpacing = px.transform(spacing,);
|
|
5077
|
+
attrs[keys23.array] = `${pathLength} ${pathSpacing}`;
|
|
5078
|
+
}
|
|
5079
|
+
function buildSVGAttrs(
|
|
5080
|
+
state,
|
|
5081
|
+
{
|
|
5082
|
+
attrX,
|
|
5083
|
+
attrY,
|
|
5084
|
+
attrScale,
|
|
5085
|
+
pathLength,
|
|
5086
|
+
pathSpacing = 1,
|
|
5087
|
+
pathOffset = 0,
|
|
5088
|
+
// This is object creation, which we try to avoid per-frame.
|
|
5089
|
+
...latest
|
|
5090
|
+
},
|
|
5091
|
+
isSVGTag2,
|
|
5092
|
+
transformTemplate2,
|
|
5093
|
+
styleProp,
|
|
5094
|
+
) {
|
|
5095
|
+
buildHTMLStyles(state, latest, transformTemplate2,);
|
|
5096
|
+
if (isSVGTag2) {
|
|
5097
|
+
if (state.style.viewBox) {
|
|
5098
|
+
state.attrs.viewBox = state.style.viewBox;
|
|
5099
|
+
}
|
|
5100
|
+
return;
|
|
5101
|
+
}
|
|
5102
|
+
state.attrs = state.style;
|
|
5103
|
+
state.style = {};
|
|
5104
|
+
const {
|
|
5105
|
+
attrs,
|
|
5106
|
+
style: style2,
|
|
5107
|
+
} = state;
|
|
5108
|
+
if (attrs.transform) {
|
|
5109
|
+
style2.transform = attrs.transform;
|
|
5110
|
+
delete attrs.transform;
|
|
5111
|
+
}
|
|
5112
|
+
if (style2.transform || attrs.transformOrigin) {
|
|
5113
|
+
style2.transformOrigin = attrs.transformOrigin ?? '50% 50%';
|
|
5114
|
+
delete attrs.transformOrigin;
|
|
5115
|
+
}
|
|
5116
|
+
if (style2.transform) {
|
|
5117
|
+
style2.transformBox = (styleProp == null ? void 0 : styleProp.transformBox) ?? 'fill-box';
|
|
5118
|
+
delete attrs.transformBox;
|
|
5119
|
+
}
|
|
5120
|
+
if (attrX !== void 0) attrs.x = attrX;
|
|
5121
|
+
if (attrY !== void 0) attrs.y = attrY;
|
|
5122
|
+
if (attrScale !== void 0) attrs.scale = attrScale;
|
|
5123
|
+
if (pathLength !== void 0) {
|
|
5124
|
+
buildSVGPath(attrs, pathLength, pathSpacing, pathOffset, false,);
|
|
5125
|
+
}
|
|
5126
|
+
}
|
|
5127
|
+
var createSvgRenderState = () => ({
|
|
5128
|
+
...createHtmlRenderState(),
|
|
5129
|
+
attrs: {},
|
|
5130
|
+
});
|
|
5131
|
+
var isSVGTag = (tag) => typeof tag === 'string' && tag.toLowerCase() === 'svg';
|
|
5132
|
+
function useSVGProps(props, visualState, _isStatic, Component33,) {
|
|
5133
|
+
const visualProps = useMemo2(() => {
|
|
5134
|
+
const state = createSvgRenderState();
|
|
5135
|
+
buildSVGAttrs(state, visualState, isSVGTag(Component33,), props.transformTemplate, props.style,);
|
|
5136
|
+
return {
|
|
5137
|
+
...state.attrs,
|
|
5138
|
+
style: {
|
|
5139
|
+
...state.style,
|
|
5140
|
+
},
|
|
5141
|
+
};
|
|
5142
|
+
}, [visualState,],);
|
|
5143
|
+
if (props.style) {
|
|
5144
|
+
const rawStyles = {};
|
|
5145
|
+
copyRawValuesOnly(rawStyles, props.style, props,);
|
|
5146
|
+
visualProps.style = {
|
|
5147
|
+
...rawStyles,
|
|
5148
|
+
...visualProps.style,
|
|
5149
|
+
};
|
|
5150
|
+
}
|
|
5151
|
+
return visualProps;
|
|
5152
|
+
}
|
|
4904
5153
|
var lowercaseSVGElements = [
|
|
4905
5154
|
'animate',
|
|
4906
5155
|
'circle',
|
|
@@ -4955,96 +5204,6 @@ function isSVGComponent(Component33,) {
|
|
|
4955
5204
|
}
|
|
4956
5205
|
return false;
|
|
4957
5206
|
}
|
|
4958
|
-
var dashKeys = {
|
|
4959
|
-
offset: 'stroke-dashoffset',
|
|
4960
|
-
array: 'stroke-dasharray',
|
|
4961
|
-
};
|
|
4962
|
-
var camelKeys = {
|
|
4963
|
-
offset: 'strokeDashoffset',
|
|
4964
|
-
array: 'strokeDasharray',
|
|
4965
|
-
};
|
|
4966
|
-
function buildSVGPath(attrs, length, spacing = 1, offset = 0, useDashCase = true,) {
|
|
4967
|
-
attrs.pathLength = 1;
|
|
4968
|
-
const keys23 = useDashCase ? dashKeys : camelKeys;
|
|
4969
|
-
attrs[keys23.offset] = px.transform(-offset,);
|
|
4970
|
-
const pathLength = px.transform(length,);
|
|
4971
|
-
const pathSpacing = px.transform(spacing,);
|
|
4972
|
-
attrs[keys23.array] = `${pathLength} ${pathSpacing}`;
|
|
4973
|
-
}
|
|
4974
|
-
function buildSVGAttrs(
|
|
4975
|
-
state,
|
|
4976
|
-
{
|
|
4977
|
-
attrX,
|
|
4978
|
-
attrY,
|
|
4979
|
-
attrScale,
|
|
4980
|
-
pathLength,
|
|
4981
|
-
pathSpacing = 1,
|
|
4982
|
-
pathOffset = 0,
|
|
4983
|
-
// This is object creation, which we try to avoid per-frame.
|
|
4984
|
-
...latest
|
|
4985
|
-
},
|
|
4986
|
-
isSVGTag2,
|
|
4987
|
-
transformTemplate2,
|
|
4988
|
-
styleProp,
|
|
4989
|
-
) {
|
|
4990
|
-
buildHTMLStyles(state, latest, transformTemplate2,);
|
|
4991
|
-
if (isSVGTag2) {
|
|
4992
|
-
if (state.style.viewBox) {
|
|
4993
|
-
state.attrs.viewBox = state.style.viewBox;
|
|
4994
|
-
}
|
|
4995
|
-
return;
|
|
4996
|
-
}
|
|
4997
|
-
state.attrs = state.style;
|
|
4998
|
-
state.style = {};
|
|
4999
|
-
const {
|
|
5000
|
-
attrs,
|
|
5001
|
-
style: style2,
|
|
5002
|
-
} = state;
|
|
5003
|
-
if (attrs.transform) {
|
|
5004
|
-
style2.transform = attrs.transform;
|
|
5005
|
-
delete attrs.transform;
|
|
5006
|
-
}
|
|
5007
|
-
if (style2.transform || attrs.transformOrigin) {
|
|
5008
|
-
style2.transformOrigin = attrs.transformOrigin ?? '50% 50%';
|
|
5009
|
-
delete attrs.transformOrigin;
|
|
5010
|
-
}
|
|
5011
|
-
if (style2.transform) {
|
|
5012
|
-
style2.transformBox = (styleProp == null ? void 0 : styleProp.transformBox) ?? 'fill-box';
|
|
5013
|
-
delete attrs.transformBox;
|
|
5014
|
-
}
|
|
5015
|
-
if (attrX !== void 0) attrs.x = attrX;
|
|
5016
|
-
if (attrY !== void 0) attrs.y = attrY;
|
|
5017
|
-
if (attrScale !== void 0) attrs.scale = attrScale;
|
|
5018
|
-
if (pathLength !== void 0) {
|
|
5019
|
-
buildSVGPath(attrs, pathLength, pathSpacing, pathOffset, false,);
|
|
5020
|
-
}
|
|
5021
|
-
}
|
|
5022
|
-
var createSvgRenderState = () => ({
|
|
5023
|
-
...createHtmlRenderState(),
|
|
5024
|
-
attrs: {},
|
|
5025
|
-
});
|
|
5026
|
-
var isSVGTag = (tag) => typeof tag === 'string' && tag.toLowerCase() === 'svg';
|
|
5027
|
-
function useSVGProps(props, visualState, _isStatic, Component33,) {
|
|
5028
|
-
const visualProps = useMemo2(() => {
|
|
5029
|
-
const state = createSvgRenderState();
|
|
5030
|
-
buildSVGAttrs(state, visualState, isSVGTag(Component33,), props.transformTemplate, props.style,);
|
|
5031
|
-
return {
|
|
5032
|
-
...state.attrs,
|
|
5033
|
-
style: {
|
|
5034
|
-
...state.style,
|
|
5035
|
-
},
|
|
5036
|
-
};
|
|
5037
|
-
}, [visualState,],);
|
|
5038
|
-
if (props.style) {
|
|
5039
|
-
const rawStyles = {};
|
|
5040
|
-
copyRawValuesOnly(rawStyles, props.style, props,);
|
|
5041
|
-
visualProps.style = {
|
|
5042
|
-
...rawStyles,
|
|
5043
|
-
...visualProps.style,
|
|
5044
|
-
};
|
|
5045
|
-
}
|
|
5046
|
-
return visualProps;
|
|
5047
|
-
}
|
|
5048
5207
|
function createUseRender(forwardMotionProps = false,) {
|
|
5049
5208
|
const useRender = (Component33, props, ref, {
|
|
5050
5209
|
latestValues,
|
|
@@ -7438,12 +7597,9 @@ function animateSingleValue(value, keyframes2, options,) {
|
|
|
7438
7597
|
motionValue$1.start(animateMotionValue('', motionValue$1, keyframes2, options,),);
|
|
7439
7598
|
return motionValue$1.animation;
|
|
7440
7599
|
}
|
|
7441
|
-
function isSVGElement(element,) {
|
|
7442
|
-
return element instanceof SVGElement && element.tagName !== 'svg';
|
|
7443
|
-
}
|
|
7444
7600
|
var borders = ['TopLeft', 'TopRight', 'BottomLeft', 'BottomRight',];
|
|
7445
7601
|
var numBorders = borders.length;
|
|
7446
|
-
var
|
|
7602
|
+
var asNumber2 = (value) => typeof value === 'string' ? parseFloat(value,) : value;
|
|
7447
7603
|
var isPx = (value) => typeof value === 'number' || px.test(value,);
|
|
7448
7604
|
function mixValues(target, follow, lead, progress2, shouldCrossfadeOpacity, isOnlyMember,) {
|
|
7449
7605
|
if (shouldCrossfadeOpacity) {
|
|
@@ -7461,7 +7617,7 @@ function mixValues(target, follow, lead, progress2, shouldCrossfadeOpacity, isOn
|
|
|
7461
7617
|
leadRadius || (leadRadius = 0);
|
|
7462
7618
|
const canMix = followRadius === 0 || leadRadius === 0 || isPx(followRadius,) === isPx(leadRadius,);
|
|
7463
7619
|
if (canMix) {
|
|
7464
|
-
target[borderLabel] = Math.max(mixNumber(
|
|
7620
|
+
target[borderLabel] = Math.max(mixNumber(asNumber2(followRadius,), asNumber2(leadRadius,), progress2,), 0,);
|
|
7465
7621
|
if (percent.test(leadRadius,) || percent.test(followRadius,)) {
|
|
7466
7622
|
target[borderLabel] += '%';
|
|
7467
7623
|
}
|
|
@@ -7811,7 +7967,7 @@ function createProjectionNode2({
|
|
|
7811
7967
|
*/
|
|
7812
7968
|
mount(instance,) {
|
|
7813
7969
|
if (this.instance) return;
|
|
7814
|
-
this.isSVG = isSVGElement(instance,);
|
|
7970
|
+
this.isSVG = isSVGElement(instance,) && !isSVGSVGElement(instance,);
|
|
7815
7971
|
this.instance = instance;
|
|
7816
7972
|
const {
|
|
7817
7973
|
layoutId,
|
|
@@ -7869,7 +8025,6 @@ function createProjectionNode2({
|
|
|
7869
8025
|
this.resumingFrom = this.resumeFrom;
|
|
7870
8026
|
this.resumingFrom.resumingFrom = void 0;
|
|
7871
8027
|
}
|
|
7872
|
-
this.setAnimationOrigin(delta, hasOnlyRelativeTargetChanged,);
|
|
7873
8028
|
const animationOptions = {
|
|
7874
8029
|
...getValueTransition(layoutTransition, 'layout',),
|
|
7875
8030
|
onPlay: onLayoutAnimationStart,
|
|
@@ -7880,6 +8035,7 @@ function createProjectionNode2({
|
|
|
7880
8035
|
animationOptions.type = false;
|
|
7881
8036
|
}
|
|
7882
8037
|
this.startAnimation(animationOptions,);
|
|
8038
|
+
this.setAnimationOrigin(delta, hasOnlyRelativeTargetChanged,);
|
|
7883
8039
|
} else {
|
|
7884
8040
|
if (!hasLayoutChanged) {
|
|
7885
8041
|
finishAnimation(this,);
|
|
@@ -8408,8 +8564,8 @@ function createProjectionNode2({
|
|
|
8408
8564
|
startAnimation(options,) {
|
|
8409
8565
|
var _a, _b, _c;
|
|
8410
8566
|
this.notifyListeners('animationStart',);
|
|
8411
|
-
(_a = this.currentAnimation) == null ? void 0 : _a.stop(
|
|
8412
|
-
(_c = (_b = this.resumingFrom) == null ? void 0 : _b.currentAnimation) == null ? void 0 : _c.stop(
|
|
8567
|
+
(_a = this.currentAnimation) == null ? void 0 : _a.stop();
|
|
8568
|
+
(_c = (_b = this.resumingFrom) == null ? void 0 : _b.currentAnimation) == null ? void 0 : _c.stop();
|
|
8413
8569
|
if (this.pendingAnimation) {
|
|
8414
8570
|
cancelFrame(this.pendingAnimation,);
|
|
8415
8571
|
this.pendingAnimation = void 0;
|
|
@@ -8453,7 +8609,7 @@ function createProjectionNode2({
|
|
|
8453
8609
|
finishAnimation() {
|
|
8454
8610
|
if (this.currentAnimation) {
|
|
8455
8611
|
this.mixTargetDelta && this.mixTargetDelta(animationTarget,);
|
|
8456
|
-
this.currentAnimation.stop(
|
|
8612
|
+
this.currentAnimation.stop();
|
|
8457
8613
|
}
|
|
8458
8614
|
this.completeAnimation();
|
|
8459
8615
|
}
|
|
@@ -8662,7 +8818,7 @@ function createProjectionNode2({
|
|
|
8662
8818
|
resetTree() {
|
|
8663
8819
|
this.root.nodes.forEach((node) => {
|
|
8664
8820
|
var _a;
|
|
8665
|
-
return (_a = node.currentAnimation) == null ? void 0 : _a.stop(
|
|
8821
|
+
return (_a = node.currentAnimation) == null ? void 0 : _a.stop();
|
|
8666
8822
|
},);
|
|
8667
8823
|
this.root.nodes.forEach(clearMeasurements,);
|
|
8668
8824
|
this.root.sharedNodes.clear();
|
|
@@ -9212,7 +9368,7 @@ var camelCaseAttributes = /* @__PURE__ */ new Set([
|
|
|
9212
9368
|
function renderSVG(element, renderState, _styleProp, projection,) {
|
|
9213
9369
|
renderHTML(element, renderState, void 0, projection,);
|
|
9214
9370
|
for (const key7 in renderState.attrs) {
|
|
9215
|
-
element.setAttribute(!camelCaseAttributes.has(key7,) ?
|
|
9371
|
+
element.setAttribute(!camelCaseAttributes.has(key7,) ? camelToDash2(key7,) : key7, renderState.attrs[key7],);
|
|
9216
9372
|
}
|
|
9217
9373
|
}
|
|
9218
9374
|
var SVGVisualElement = class extends DOMVisualElement {
|
|
@@ -9230,7 +9386,7 @@ var SVGVisualElement = class extends DOMVisualElement {
|
|
|
9230
9386
|
const defaultType = getDefaultValueType(key7,);
|
|
9231
9387
|
return defaultType ? defaultType.default || 0 : 0;
|
|
9232
9388
|
}
|
|
9233
|
-
key7 = !camelCaseAttributes.has(key7,) ?
|
|
9389
|
+
key7 = !camelCaseAttributes.has(key7,) ? camelToDash2(key7,) : key7;
|
|
9234
9390
|
return instance.getAttribute(key7,);
|
|
9235
9391
|
}
|
|
9236
9392
|
scrapeMotionValuesFromProps(props, prevProps, visualElement,) {
|
|
@@ -9291,7 +9447,7 @@ function getElementSize(target, borderBoxSize,) {
|
|
|
9291
9447
|
width: inlineSize,
|
|
9292
9448
|
height: blockSize,
|
|
9293
9449
|
};
|
|
9294
|
-
} else if (target
|
|
9450
|
+
} else if (isSVGElement(target,) && 'getBBox' in target) {
|
|
9295
9451
|
return target.getBBox();
|
|
9296
9452
|
} else {
|
|
9297
9453
|
return {
|
|
@@ -9430,7 +9586,7 @@ function calcInset(element, container,) {
|
|
|
9430
9586
|
};
|
|
9431
9587
|
let current2 = element;
|
|
9432
9588
|
while (current2 && current2 !== container) {
|
|
9433
|
-
if (current2
|
|
9589
|
+
if (isHTMLElement(current2,)) {
|
|
9434
9590
|
inset2.x += current2.offsetLeft;
|
|
9435
9591
|
inset2.y += current2.offsetTop;
|
|
9436
9592
|
current2 = current2.offsetParent;
|
|
@@ -9590,8 +9746,8 @@ function measure(container, target = container, info,) {
|
|
|
9590
9746
|
}
|
|
9591
9747
|
function createOnScrollHandler(element, onScroll, info, options = {},) {
|
|
9592
9748
|
return {
|
|
9593
|
-
measure: () =>
|
|
9594
|
-
|
|
9749
|
+
measure: (time2) => {
|
|
9750
|
+
measure(element, options.target, info,);
|
|
9595
9751
|
updateScrollInfo(element, info, time2,);
|
|
9596
9752
|
if (options.offset || options.target) {
|
|
9597
9753
|
resolveOffsets(element, info, options,);
|
|
@@ -9619,21 +9775,17 @@ function scrollInfo(onScroll, {
|
|
|
9619
9775
|
containerHandlers.add(containerHandler,);
|
|
9620
9776
|
if (!scrollListeners.has(container,)) {
|
|
9621
9777
|
const measureAll = () => {
|
|
9622
|
-
for (const handler of containerHandlers) handler.measure();
|
|
9623
|
-
};
|
|
9624
|
-
const updateAll = () => {
|
|
9625
9778
|
for (const handler of containerHandlers) {
|
|
9626
|
-
handler.
|
|
9779
|
+
handler.measure(frameData.timestamp,);
|
|
9627
9780
|
}
|
|
9781
|
+
frame.preUpdate(notifyAll2,);
|
|
9628
9782
|
};
|
|
9629
9783
|
const notifyAll2 = () => {
|
|
9630
|
-
for (const handler of containerHandlers)
|
|
9631
|
-
|
|
9632
|
-
|
|
9633
|
-
frame.read(measureAll,);
|
|
9634
|
-
frame.read(updateAll,);
|
|
9635
|
-
frame.preUpdate(notifyAll2,);
|
|
9784
|
+
for (const handler of containerHandlers) {
|
|
9785
|
+
handler.notify();
|
|
9786
|
+
}
|
|
9636
9787
|
};
|
|
9788
|
+
const listener2 = () => frame.read(measureAll,);
|
|
9637
9789
|
scrollListeners.set(container, listener2,);
|
|
9638
9790
|
const target = getEventTarget(container,);
|
|
9639
9791
|
window.addEventListener('resize', listener2, {
|
|
@@ -9837,55 +9989,47 @@ function useMotionTemplate(fragments, ...values) {
|
|
|
9837
9989
|
}
|
|
9838
9990
|
return useCombineMotionValues(values.filter(isMotionValue,), buildValue,);
|
|
9839
9991
|
}
|
|
9840
|
-
function
|
|
9992
|
+
function useComputed(compute,) {
|
|
9993
|
+
collectMotionValues.current = [];
|
|
9994
|
+
compute();
|
|
9995
|
+
const value = useCombineMotionValues(collectMotionValues.current, compute,);
|
|
9996
|
+
collectMotionValues.current = void 0;
|
|
9997
|
+
return value;
|
|
9998
|
+
}
|
|
9999
|
+
function useTransform(input, inputRangeOrTransformer, outputRange, options,) {
|
|
10000
|
+
if (typeof input === 'function') {
|
|
10001
|
+
return useComputed(input,);
|
|
10002
|
+
}
|
|
10003
|
+
const transformer = typeof inputRangeOrTransformer === 'function'
|
|
10004
|
+
? inputRangeOrTransformer
|
|
10005
|
+
: transform(inputRangeOrTransformer, outputRange, options,);
|
|
10006
|
+
return Array.isArray(input,) ? useListTransform(input, transformer,) : useListTransform([input,], ([latest,],) => transformer(latest,),);
|
|
10007
|
+
}
|
|
10008
|
+
function useListTransform(values, transformer,) {
|
|
10009
|
+
const latest = useConstant(() => []);
|
|
10010
|
+
return useCombineMotionValues(values, () => {
|
|
10011
|
+
latest.length = 0;
|
|
10012
|
+
const numValues = values.length;
|
|
10013
|
+
for (let i = 0; i < numValues; i++) {
|
|
10014
|
+
latest[i] = values[i].get();
|
|
10015
|
+
}
|
|
10016
|
+
return transformer(latest,);
|
|
10017
|
+
},);
|
|
10018
|
+
}
|
|
10019
|
+
function useSpring(source, options = {},) {
|
|
9841
10020
|
const {
|
|
9842
10021
|
isStatic,
|
|
9843
10022
|
} = useContext(MotionConfigContext,);
|
|
9844
|
-
const
|
|
9845
|
-
|
|
9846
|
-
|
|
9847
|
-
|
|
9848
|
-
const
|
|
9849
|
-
const latestSetter = useRef3(noop,);
|
|
9850
|
-
const startAnimation2 = () => {
|
|
9851
|
-
stopAnimation2();
|
|
9852
|
-
activeSpringAnimation.current = new JSAnimation({
|
|
9853
|
-
keyframes: [asNumber2(value.get(),), asNumber2(latestValue.current,),],
|
|
9854
|
-
velocity: value.getVelocity(),
|
|
9855
|
-
type: 'spring',
|
|
9856
|
-
restDelta: 1e-3,
|
|
9857
|
-
restSpeed: 0.01,
|
|
9858
|
-
...config,
|
|
9859
|
-
onUpdate: latestSetter.current,
|
|
9860
|
-
},);
|
|
9861
|
-
};
|
|
9862
|
-
const stopAnimation2 = () => {
|
|
9863
|
-
if (activeSpringAnimation.current) {
|
|
9864
|
-
activeSpringAnimation.current.stop();
|
|
9865
|
-
}
|
|
9866
|
-
};
|
|
10023
|
+
const getFromSource = () => isMotionValue(source,) ? source.get() : source;
|
|
10024
|
+
if (isStatic) {
|
|
10025
|
+
return useTransform(getFromSource,);
|
|
10026
|
+
}
|
|
10027
|
+
const value = useMotionValue(getFromSource(),);
|
|
9867
10028
|
useInsertionEffect(() => {
|
|
9868
|
-
return value
|
|
9869
|
-
|
|
9870
|
-
latestValue.current = v;
|
|
9871
|
-
latestSetter.current = (latest) => set(parseValue(latest, unit,),);
|
|
9872
|
-
frame.postRender(startAnimation2,);
|
|
9873
|
-
return value.get();
|
|
9874
|
-
}, stopAnimation2,);
|
|
9875
|
-
}, [JSON.stringify(config,),],);
|
|
9876
|
-
useIsomorphicLayoutEffect(() => {
|
|
9877
|
-
if (isMotionValue(source,)) {
|
|
9878
|
-
return source.on('change', (v) => value.set(parseValue(v, unit,),),);
|
|
9879
|
-
}
|
|
9880
|
-
}, [value, unit,],);
|
|
10029
|
+
return attachSpring(value, source, options,);
|
|
10030
|
+
}, [value, JSON.stringify(options,),],);
|
|
9881
10031
|
return value;
|
|
9882
10032
|
}
|
|
9883
|
-
function parseValue(v, unit,) {
|
|
9884
|
-
return unit ? v + unit : v;
|
|
9885
|
-
}
|
|
9886
|
-
function asNumber2(v,) {
|
|
9887
|
-
return typeof v === 'number' ? v : parseFloat(v,);
|
|
9888
|
-
}
|
|
9889
10033
|
function useAnimationFrame(callback,) {
|
|
9890
10034
|
const initialTimestamp = useRef3(0,);
|
|
9891
10035
|
const {
|
|
@@ -9909,33 +10053,6 @@ function useTime() {
|
|
|
9909
10053
|
useAnimationFrame((t) => time2.set(t,));
|
|
9910
10054
|
return time2;
|
|
9911
10055
|
}
|
|
9912
|
-
function useComputed(compute,) {
|
|
9913
|
-
collectMotionValues.current = [];
|
|
9914
|
-
compute();
|
|
9915
|
-
const value = useCombineMotionValues(collectMotionValues.current, compute,);
|
|
9916
|
-
collectMotionValues.current = void 0;
|
|
9917
|
-
return value;
|
|
9918
|
-
}
|
|
9919
|
-
function useTransform(input, inputRangeOrTransformer, outputRange, options,) {
|
|
9920
|
-
if (typeof input === 'function') {
|
|
9921
|
-
return useComputed(input,);
|
|
9922
|
-
}
|
|
9923
|
-
const transformer = typeof inputRangeOrTransformer === 'function'
|
|
9924
|
-
? inputRangeOrTransformer
|
|
9925
|
-
: transform(inputRangeOrTransformer, outputRange, options,);
|
|
9926
|
-
return Array.isArray(input,) ? useListTransform(input, transformer,) : useListTransform([input,], ([latest,],) => transformer(latest,),);
|
|
9927
|
-
}
|
|
9928
|
-
function useListTransform(values, transformer,) {
|
|
9929
|
-
const latest = useConstant(() => []);
|
|
9930
|
-
return useCombineMotionValues(values, () => {
|
|
9931
|
-
latest.length = 0;
|
|
9932
|
-
const numValues = values.length;
|
|
9933
|
-
for (let i = 0; i < numValues; i++) {
|
|
9934
|
-
latest[i] = values[i].get();
|
|
9935
|
-
}
|
|
9936
|
-
return transformer(latest,);
|
|
9937
|
-
},);
|
|
9938
|
-
}
|
|
9939
10056
|
function useVelocity(value,) {
|
|
9940
10057
|
const velocity = useMotionValue(value.getVelocity(),);
|
|
9941
10058
|
const updateVelocity = () => {
|
|
@@ -10359,7 +10476,7 @@ function createDOMVisualElement(element,) {
|
|
|
10359
10476
|
latestValues: {},
|
|
10360
10477
|
},
|
|
10361
10478
|
};
|
|
10362
|
-
const node = isSVGElement(element,) ? new SVGVisualElement(options,) : new HTMLVisualElement(options,);
|
|
10479
|
+
const node = isSVGElement(element,) && !isSVGSVGElement(element,) ? new SVGVisualElement(options,) : new HTMLVisualElement(options,);
|
|
10363
10480
|
node.mount(element,);
|
|
10364
10481
|
visualElementStore.set(element, node,);
|
|
10365
10482
|
}
|
|
@@ -11104,7 +11221,7 @@ function stagger(duration = 0.1, {
|
|
|
11104
11221
|
};
|
|
11105
11222
|
}
|
|
11106
11223
|
|
|
11107
|
-
// /:https://app.framerstatic.com/framer.
|
|
11224
|
+
// /:https://app.framerstatic.com/framer.C2MZBAEL.mjs
|
|
11108
11225
|
import { lazy as ReactLazy, } from 'react';
|
|
11109
11226
|
import React4 from 'react';
|
|
11110
11227
|
import { startTransition as startTransition2, } from 'react';
|
|
@@ -11112,6 +11229,7 @@ import { Suspense as Suspense2, } from 'react';
|
|
|
11112
11229
|
import { memo as memo2, } from 'react';
|
|
11113
11230
|
import ReactDOM from 'react-dom';
|
|
11114
11231
|
import { createRef, } from 'react';
|
|
11232
|
+
import { useTransition, } from 'react';
|
|
11115
11233
|
import { cloneElement as cloneElement32, } from 'react';
|
|
11116
11234
|
var __unframerNavigator2 = typeof window !== 'undefined' ? navigator : void 0;
|
|
11117
11235
|
var require_hsluv = __commonJS({
|
|
@@ -12273,9 +12391,9 @@ function useCurrentRouteId() {
|
|
|
12273
12391
|
}
|
|
12274
12392
|
function useOnRouteChange(cb,) {
|
|
12275
12393
|
const currentRoute = useCurrentRoute();
|
|
12276
|
-
const
|
|
12277
|
-
if (isEqual(lastRoute, currentRoute,) || !currentRoute) return;
|
|
12278
|
-
|
|
12394
|
+
const lastRoute = React4.useRef(currentRoute,);
|
|
12395
|
+
if (isEqual(lastRoute.current, currentRoute,) || !currentRoute) return;
|
|
12396
|
+
lastRoute.current = currentRoute;
|
|
12279
12397
|
cb(currentRoute,);
|
|
12280
12398
|
}
|
|
12281
12399
|
function useRoute(routeId,) {
|
|
@@ -12344,7 +12462,7 @@ function isNumber2(value,) {
|
|
|
12344
12462
|
function isArray(value,) {
|
|
12345
12463
|
return Array.isArray(value,);
|
|
12346
12464
|
}
|
|
12347
|
-
function
|
|
12465
|
+
function isObject2(value,) {
|
|
12348
12466
|
return value !== null && typeof value === 'object' && !isArray(value,);
|
|
12349
12467
|
}
|
|
12350
12468
|
function isUndefined(value,) {
|
|
@@ -12360,7 +12478,7 @@ function isValidDate(value,) {
|
|
|
12360
12478
|
return value instanceof Date && !Number.isNaN(value.getTime(),);
|
|
12361
12479
|
}
|
|
12362
12480
|
function isGenerator2(value,) {
|
|
12363
|
-
return
|
|
12481
|
+
return isObject2(value,) && isFunction(value.return,);
|
|
12364
12482
|
}
|
|
12365
12483
|
var noop2 = () => {};
|
|
12366
12484
|
var isWindow = typeof window !== 'undefined';
|
|
@@ -12462,9 +12580,14 @@ function yieldUnlessUrgent(options,) {
|
|
|
12462
12580
|
function interactionResponse(options,) {
|
|
12463
12581
|
return new Promise((resolve) => {
|
|
12464
12582
|
setTimeout(resolve, 100,);
|
|
12465
|
-
frame.read(
|
|
12466
|
-
|
|
12467
|
-
|
|
12583
|
+
frame.read(
|
|
12584
|
+
() => {
|
|
12585
|
+
void schedulerYield(options,).then(resolve,);
|
|
12586
|
+
},
|
|
12587
|
+
false,
|
|
12588
|
+
// In some cases, interactionResponse might be called in a rAF. This means, we should right away call `schedulerYield`, as the next paint follows immediately.
|
|
12589
|
+
true,
|
|
12590
|
+
);
|
|
12468
12591
|
},);
|
|
12469
12592
|
}
|
|
12470
12593
|
function schedulerYield(options,) {
|
|
@@ -13424,7 +13547,7 @@ async function pushRouteState(routeId, route, {
|
|
|
13424
13547
|
}
|
|
13425
13548
|
function isHistoryState(data2,) {
|
|
13426
13549
|
const routeIdKey = 'routeId';
|
|
13427
|
-
return
|
|
13550
|
+
return isObject2(data2,) && isString(data2[routeIdKey],);
|
|
13428
13551
|
}
|
|
13429
13552
|
function replaceHistoryState(data2, url, ignoreReplaceStateWrapper = false,) {
|
|
13430
13553
|
performance.mark('framer-history-replace',);
|
|
@@ -13512,7 +13635,7 @@ function usePopStateHandler(currentRouteId, setCurrentRouteId,) {
|
|
|
13512
13635
|
((_a = window.navigation) == null ? void 0 : _a.transition) &&
|
|
13513
13636
|
((_c = (_b = window.navigation) == null ? void 0 : _b.transition) == null ? void 0 : _c.navigationType) !== 'traverse'
|
|
13514
13637
|
) return;
|
|
13515
|
-
if (!
|
|
13638
|
+
if (!isObject2(state,)) return;
|
|
13516
13639
|
const {
|
|
13517
13640
|
routeId,
|
|
13518
13641
|
hash: hash2,
|
|
@@ -13530,7 +13653,7 @@ function usePopStateHandler(currentRouteId, setCurrentRouteId,) {
|
|
|
13530
13653
|
routeId,
|
|
13531
13654
|
isString(localeId,) ? localeId : void 0,
|
|
13532
13655
|
isString(hash2,) ? hash2 : void 0,
|
|
13533
|
-
|
|
13656
|
+
isObject2(pathVariables,) ? pathVariables : void 0,
|
|
13534
13657
|
true,
|
|
13535
13658
|
nextRender,
|
|
13536
13659
|
false,
|
|
@@ -13578,7 +13701,7 @@ function getHashForRoute(hash2, route, hashVariables,) {
|
|
|
13578
13701
|
const resolvedHash = getRouteElementId(route, hash2,);
|
|
13579
13702
|
if (!resolvedHash) return void 0;
|
|
13580
13703
|
const variables = Object.assign({}, route == null ? void 0 : route.elements, hashVariables,);
|
|
13581
|
-
return resolvedHash.replace(pathVariablesRegExp, (m2, p1,) =>
|
|
13704
|
+
return resolvedHash.replace(pathVariablesRegExp, (m2, p1,) => variables[p1] ?? m2,);
|
|
13582
13705
|
}
|
|
13583
13706
|
function getPathForRoute(route, {
|
|
13584
13707
|
currentRoutePath,
|
|
@@ -15046,7 +15169,7 @@ var Interpolation = {
|
|
|
15046
15169
|
var NumberInterpolation = {
|
|
15047
15170
|
interpolate(from, to,) {
|
|
15048
15171
|
[from, to,] = Interpolation.handleUndefined(from, to,);
|
|
15049
|
-
const a1 =
|
|
15172
|
+
const a1 = from;
|
|
15050
15173
|
const b1 = to - a1;
|
|
15051
15174
|
return (progress2) => {
|
|
15052
15175
|
const value = a1 + b1 * progress2;
|
|
@@ -15758,7 +15881,7 @@ function rgbToHsv(r, g, b,) {
|
|
|
15758
15881
|
const max = Math.max(r, g, b,);
|
|
15759
15882
|
const min = Math.min(r, g, b,);
|
|
15760
15883
|
const d = max - min;
|
|
15761
|
-
let h;
|
|
15884
|
+
let h = 0;
|
|
15762
15885
|
const s = max === 0 ? 0 : d / max;
|
|
15763
15886
|
const v = max;
|
|
15764
15887
|
if (max === min) {
|
|
@@ -16346,7 +16469,7 @@ var Color = /* @__PURE__ */ (() => {
|
|
|
16346
16469
|
return false;
|
|
16347
16470
|
};
|
|
16348
16471
|
Color2.isColorObject = (color2) => {
|
|
16349
|
-
return
|
|
16472
|
+
return isObject2(color2,) && typeof color2.r === 'number' && typeof color2.g === 'number' && typeof color2.b === 'number' &&
|
|
16350
16473
|
typeof color2.h === 'number' && typeof color2.s === 'number' && typeof color2.l === 'number' && typeof color2.a === 'number' &&
|
|
16351
16474
|
typeof color2.roundA === 'number' && typeof color2.format === 'string';
|
|
16352
16475
|
};
|
|
@@ -20898,7 +21021,7 @@ function injectComponentCSSRules() {
|
|
|
20898
21021
|
}
|
|
20899
21022
|
}
|
|
20900
21023
|
function isReactComponent(component,) {
|
|
20901
|
-
return
|
|
21024
|
+
return isObject2(component,) || isFunction(component,);
|
|
20902
21025
|
}
|
|
20903
21026
|
var optionalKey = 'optional';
|
|
20904
21027
|
function controlIsOptional(control,) {
|
|
@@ -20928,14 +21051,14 @@ function getControlDefaultValue(control,) {
|
|
|
20928
21051
|
case 'number':
|
|
20929
21052
|
return isNumber2(control.defaultValue,) ? control.defaultValue : void 0;
|
|
20930
21053
|
case 'transition':
|
|
20931
|
-
return
|
|
21054
|
+
return isObject2(control.defaultValue,) ? control.defaultValue : void 0;
|
|
20932
21055
|
case 'border':
|
|
20933
|
-
return
|
|
21056
|
+
return isObject2(control.defaultValue,) ? control.defaultValue : void 0;
|
|
20934
21057
|
case 'font':
|
|
20935
|
-
return
|
|
21058
|
+
return isObject2(control.defaultValue,) ? control.defaultValue : void 0;
|
|
20936
21059
|
case 'object': {
|
|
20937
|
-
const value =
|
|
20938
|
-
if (
|
|
21060
|
+
const value = isObject2(control.defaultValue,) ? control.defaultValue : {};
|
|
21061
|
+
if (isObject2(control.controls,)) {
|
|
20939
21062
|
applyControlDefaultsToDefaultProps(value, control.controls,);
|
|
20940
21063
|
}
|
|
20941
21064
|
return value;
|
|
@@ -20979,7 +21102,7 @@ function applyControlDefaultsToDefaultProps(defaultProps, controls,) {
|
|
|
20979
21102
|
}
|
|
20980
21103
|
}
|
|
20981
21104
|
function getDefaultProps(component,) {
|
|
20982
|
-
if (
|
|
21105
|
+
if (isObject2(component.defaultProps,)) {
|
|
20983
21106
|
return component.defaultProps;
|
|
20984
21107
|
}
|
|
20985
21108
|
const defaultProps = {};
|
|
@@ -23320,7 +23443,7 @@ function useMeasureLayout(props, ref, getChildren = () => [], options = {},) {
|
|
|
23320
23443
|
const {
|
|
23321
23444
|
skipHook = false,
|
|
23322
23445
|
} = options;
|
|
23323
|
-
const inCodeComponent =
|
|
23446
|
+
const inCodeComponent = useContext(ComponentContainerContext,);
|
|
23324
23447
|
const onCanvas = RenderTarget.current() === RenderTarget.canvas;
|
|
23325
23448
|
useIsomorphicLayoutEffect2(() => {
|
|
23326
23449
|
if (!onCanvas || inCodeComponent || skipHook) {
|
|
@@ -23609,7 +23732,7 @@ var LinearGradient = {
|
|
|
23609
23732
|
* @param value -
|
|
23610
23733
|
*/
|
|
23611
23734
|
isLinearGradient: (value) => {
|
|
23612
|
-
return
|
|
23735
|
+
return isObject2(value,) && linearGradientKeys.every((key7) => key7 in value) &&
|
|
23613
23736
|
(isSimpleGradient(value,) || isMultiStopGradient(value,));
|
|
23614
23737
|
},
|
|
23615
23738
|
/** @internal */
|
|
@@ -23633,7 +23756,7 @@ var RadialGradient = {
|
|
|
23633
23756
|
* @public
|
|
23634
23757
|
*/
|
|
23635
23758
|
isRadialGradient: (value) => {
|
|
23636
|
-
return
|
|
23759
|
+
return isObject2(value,) && radialGradientKeys.every((key7) => key7 in value) &&
|
|
23637
23760
|
(isSimpleGradient(value,) || isMultiStopGradient(value,));
|
|
23638
23761
|
},
|
|
23639
23762
|
/** @internal */
|
|
@@ -23873,7 +23996,7 @@ function useStyleAndRect(props,) {
|
|
|
23873
23996
|
React4.useInsertionEffect(() => {
|
|
23874
23997
|
injectComponentCSSRules();
|
|
23875
23998
|
}, [],);
|
|
23876
|
-
const inCodeComponent =
|
|
23999
|
+
const inCodeComponent = useContext(ComponentContainerContext,);
|
|
23877
24000
|
const {
|
|
23878
24001
|
style: style2,
|
|
23879
24002
|
_initialStyle,
|
|
@@ -24047,7 +24170,7 @@ var VisibleFrame = /* @__PURE__ */ forwardRef(function VisibleFrame2(props, forw
|
|
|
24047
24170
|
}
|
|
24048
24171
|
useMeasureLayout(props, ref,);
|
|
24049
24172
|
const backgroundImage = backgroundImageFromProps(props,);
|
|
24050
|
-
const inCodeComponent =
|
|
24173
|
+
const inCodeComponent = useContext(ComponentContainerContext,);
|
|
24051
24174
|
const parentSize = resolveParentSize(propsWithOverrides, unwrappedProps, rect, inCodeComponent,);
|
|
24052
24175
|
const wrappedContent = useProvideParentSize(
|
|
24053
24176
|
/* @__PURE__ */ jsxs(Fragment, {
|
|
@@ -24263,7 +24386,7 @@ var SharedLayoutRoot = class extends Component2 {
|
|
|
24263
24386
|
getSnapshotBeforeUpdate() {
|
|
24264
24387
|
var _a;
|
|
24265
24388
|
if (!this.scheduledPromotion || !this.lead || !this.follow) return null;
|
|
24266
|
-
const needsReset =
|
|
24389
|
+
const needsReset = ((_a = this.lead) == null ? void 0 : _a.layoutMaybeMutated) && !this.shouldAnimate;
|
|
24267
24390
|
this.lead.projectionNodes.forEach((projectionNode) => {
|
|
24268
24391
|
var _a2;
|
|
24269
24392
|
projectionNode == null ? void 0 : projectionNode.promote({
|
|
@@ -24335,7 +24458,7 @@ function setRef(ref, value,) {
|
|
|
24335
24458
|
}
|
|
24336
24459
|
}
|
|
24337
24460
|
function isMutableRef(ref,) {
|
|
24338
|
-
return
|
|
24461
|
+
return isObject2(ref,) && 'current' in ref;
|
|
24339
24462
|
}
|
|
24340
24463
|
function refHasValue(ref,) {
|
|
24341
24464
|
return isMutableRef(ref,) && ref.current !== null;
|
|
@@ -24439,6 +24562,21 @@ var SharedIntersectionObserver = class {
|
|
|
24439
24562
|
}
|
|
24440
24563
|
};
|
|
24441
24564
|
var SharedIntersectionObserverContext = /* @__PURE__ */ createContext(/* @__PURE__ */ new Map(),);
|
|
24565
|
+
function observeElement(observers2, key7, element, root, callback, rootMargin, threshold,) {
|
|
24566
|
+
let observer2 = observers2.get(key7,);
|
|
24567
|
+
if (!observer2 || observer2.root !== (root == null ? void 0 : root.current)) {
|
|
24568
|
+
observer2 = new SharedIntersectionObserver({
|
|
24569
|
+
root: root == null ? void 0 : root.current,
|
|
24570
|
+
rootMargin,
|
|
24571
|
+
threshold,
|
|
24572
|
+
},);
|
|
24573
|
+
observers2.set(key7, observer2,);
|
|
24574
|
+
}
|
|
24575
|
+
observer2.observeElementWithCallback(element, callback,);
|
|
24576
|
+
return () => {
|
|
24577
|
+
observer2.unobserve(element,);
|
|
24578
|
+
};
|
|
24579
|
+
}
|
|
24442
24580
|
function _useSharedIntersectionObserver(ref, callback, options,) {
|
|
24443
24581
|
const key7 = useConstant2(() => `${options.rootMargin}`);
|
|
24444
24582
|
const observers2 = useContext(SharedIntersectionObserverContext,);
|
|
@@ -24451,19 +24589,7 @@ function _useSharedIntersectionObserver(ref, callback, options,) {
|
|
|
24451
24589
|
useRefEffect(ref, (element) => {
|
|
24452
24590
|
if (!enabled) return;
|
|
24453
24591
|
if (element === null) return;
|
|
24454
|
-
|
|
24455
|
-
if (!observer2 || observer2.root !== (root == null ? void 0 : root.current)) {
|
|
24456
|
-
observer2 = new SharedIntersectionObserver({
|
|
24457
|
-
root: root == null ? void 0 : root.current,
|
|
24458
|
-
rootMargin,
|
|
24459
|
-
threshold,
|
|
24460
|
-
},);
|
|
24461
|
-
observers2.set(key7, observer2,);
|
|
24462
|
-
}
|
|
24463
|
-
observer2.observeElementWithCallback(element, callback,);
|
|
24464
|
-
return () => {
|
|
24465
|
-
observer2 == null ? void 0 : observer2.unobserve(element,);
|
|
24466
|
-
};
|
|
24592
|
+
return observeElement(observers2, key7, element, root, callback, rootMargin, threshold,);
|
|
24467
24593
|
}, [enabled, callback, root, rootMargin, threshold,],);
|
|
24468
24594
|
}
|
|
24469
24595
|
var useSharedIntersectionObserver = typeof IntersectionObserver === 'undefined' ? noop2 : _useSharedIntersectionObserver;
|
|
@@ -24552,7 +24678,7 @@ var LayoutTree = class extends Component2 {
|
|
|
24552
24678
|
} = nextProps;
|
|
24553
24679
|
this.isExiting = isExiting;
|
|
24554
24680
|
if (isLead === void 0) return true;
|
|
24555
|
-
const hasBecomeLead = !this.props.isLead &&
|
|
24681
|
+
const hasBecomeLead = !this.props.isLead && isLead;
|
|
24556
24682
|
const hasExitBeenCancelled = this.props.isExiting && !isExiting;
|
|
24557
24683
|
const shouldPromote = hasBecomeLead || hasExitBeenCancelled;
|
|
24558
24684
|
const shouldDemote = !!this.props.isLead && !isLead;
|
|
@@ -25965,7 +26091,7 @@ function containerContent(item,) {
|
|
|
25965
26091
|
const position = (_a = item == null ? void 0 : item.transition) == null ? void 0 : _a.position;
|
|
25966
26092
|
const shouldStretchWidth = !position || position.left !== void 0 && position.right !== void 0;
|
|
25967
26093
|
const shouldStretchHeight = !position || position.top !== void 0 && position.bottom !== void 0;
|
|
25968
|
-
const canStretchStyle = 'style' in child.props ?
|
|
26094
|
+
const canStretchStyle = 'style' in child.props ? isObject2(child.props.style,) : true;
|
|
25969
26095
|
if (shouldStretchWidth) {
|
|
25970
26096
|
const canStretchWidth = 'width' in child.props;
|
|
25971
26097
|
if (canStretchWidth) props.width = '100%';
|
|
@@ -27164,7 +27290,7 @@ function hasRadius(props,) {
|
|
|
27164
27290
|
}
|
|
27165
27291
|
function getRadiusValue(value,) {
|
|
27166
27292
|
let num = Number(value,);
|
|
27167
|
-
if (typeof value === 'string' && Number.isNaN(
|
|
27293
|
+
if (typeof value === 'string' && Number.isNaN(num,)) {
|
|
27168
27294
|
return value;
|
|
27169
27295
|
} else if (isAnimatable2(value,)) {
|
|
27170
27296
|
num = Animatable.getNumber(value,);
|
|
@@ -28331,7 +28457,7 @@ var Stack = /* @__PURE__ */ (() => {
|
|
|
28331
28457
|
__contentWrapperStyle,
|
|
28332
28458
|
...containerProps
|
|
28333
28459
|
} = stackProps;
|
|
28334
|
-
const useFlexboxGap =
|
|
28460
|
+
const useFlexboxGap = externalUseFlexboxGap || wrap2;
|
|
28335
28461
|
const stackRef = React4.useRef(null,);
|
|
28336
28462
|
const flexDirection = toFlexDirection(direction,);
|
|
28337
28463
|
const isReverse = isReverseDirection(flexDirection,);
|
|
@@ -28793,7 +28919,7 @@ var Page = /* @__PURE__ */ React4.forwardRef(function Page2(props, forwardedRef,
|
|
|
28793
28919
|
containerSizeRef.current.height = containerProps.height;
|
|
28794
28920
|
}
|
|
28795
28921
|
const updateOnResize = React4.useCallback(() => {
|
|
28796
|
-
if (!hasFixedSize) setForceUpdateCount((v) => v + 1);
|
|
28922
|
+
if (!hasFixedSize) startTransition2(() => setForceUpdateCount((v) => v + 1));
|
|
28797
28923
|
}, [hasFixedSize,],);
|
|
28798
28924
|
React4.useEffect(() => {
|
|
28799
28925
|
if (RenderTarget.current() !== RenderTarget.preview) return;
|
|
@@ -30026,7 +30152,7 @@ var useUpdateChildSize = ({
|
|
|
30026
30152
|
: updatedSize;
|
|
30027
30153
|
return React4.cloneElement(child, update,);
|
|
30028
30154
|
},);
|
|
30029
|
-
}, [dragDirection, children,],);
|
|
30155
|
+
}, [dragDirection, children, fromCanvasComponent,],);
|
|
30030
30156
|
};
|
|
30031
30157
|
var numberFromOptionalMotionValue = (value) => {
|
|
30032
30158
|
return typeof value === 'number' ? value : value.get();
|
|
@@ -30319,7 +30445,6 @@ var EmulatedScroll = /* @__PURE__ */ React4.forwardRef(function EmulatedScroll2(
|
|
|
30319
30445
|
preserve3d: containerProps.preserve3d,
|
|
30320
30446
|
children: [
|
|
30321
30447
|
/* @__PURE__ */ jsx3(EmptyState, {
|
|
30322
|
-
children,
|
|
30323
30448
|
size: {
|
|
30324
30449
|
width: isFiniteNumber(containerProps.width,) ? containerProps.width : '100%',
|
|
30325
30450
|
height: isFiniteNumber(containerProps.height,) ? containerProps.height : '100%',
|
|
@@ -30327,6 +30452,7 @@ var EmulatedScroll = /* @__PURE__ */ React4.forwardRef(function EmulatedScroll2(
|
|
|
30327
30452
|
insideUserCodeComponent: !containerProps.__fromCodeComponentNode,
|
|
30328
30453
|
title: 'Scroll',
|
|
30329
30454
|
description: 'Click and drag the connector to any frame on the canvas \u2192',
|
|
30455
|
+
children,
|
|
30330
30456
|
},),
|
|
30331
30457
|
useUpdateChildSize({
|
|
30332
30458
|
dragDirection: direction,
|
|
@@ -31526,8 +31652,8 @@ var AnimationCollector = class {
|
|
|
31526
31652
|
const initial = props.__framer__presenceInitial ?? props.initial;
|
|
31527
31653
|
const animate3 = props.__framer__presenceAnimate ?? props.animate;
|
|
31528
31654
|
const config = {
|
|
31529
|
-
initial:
|
|
31530
|
-
animate:
|
|
31655
|
+
initial: isObject2(initial,) ? initial : void 0,
|
|
31656
|
+
animate: isObject2(animate3,) ? animate3 : void 0,
|
|
31531
31657
|
transformTemplate: isString(transformTemplate2,) ? transformTemplate2 : void 0,
|
|
31532
31658
|
};
|
|
31533
31659
|
for (const variantId of variants) this.setHash(id3, this.variantHash(variantId, info,), config,);
|
|
@@ -31697,6 +31823,7 @@ function useLoop({
|
|
|
31697
31823
|
const values = useConstant2(makeFXValues,);
|
|
31698
31824
|
const mirrorStateRef = useRef3(false,);
|
|
31699
31825
|
const delay2 = useDelay();
|
|
31826
|
+
const animationPromiseRef = useRef3(null,);
|
|
31700
31827
|
const animateValues = useCallback(async () => {
|
|
31701
31828
|
if (!loop) return;
|
|
31702
31829
|
const transition = loopTransition || void 0;
|
|
@@ -31704,9 +31831,9 @@ function useLoop({
|
|
|
31704
31831
|
const to = mirror ? defaultFXValues : loop;
|
|
31705
31832
|
const from = mirror ? loop : defaultFXValues;
|
|
31706
31833
|
mirrorStateRef.current = !mirrorStateRef.current;
|
|
31707
|
-
|
|
31834
|
+
animationPromiseRef.current = Promise.all(effectValuesKeys.map((key7) => {
|
|
31708
31835
|
if (shouldReduceMotion && key7 !== 'opacity') return;
|
|
31709
|
-
values[key7].
|
|
31836
|
+
values[key7].jump(from[key7] ?? defaultFXValues[key7],);
|
|
31710
31837
|
return new Promise((resolve) => {
|
|
31711
31838
|
const opts = {
|
|
31712
31839
|
...transition,
|
|
@@ -31718,6 +31845,7 @@ function useLoop({
|
|
|
31718
31845
|
}
|
|
31719
31846
|
},);
|
|
31720
31847
|
},),);
|
|
31848
|
+
return animationPromiseRef.current;
|
|
31721
31849
|
}, [loop, loopRepeatType, loopTransition, shouldReduceMotion,],);
|
|
31722
31850
|
const [isRunning, setIsRunning,] = useState(false,);
|
|
31723
31851
|
const shouldRunRef = useRef3(false,);
|
|
@@ -31725,7 +31853,7 @@ function useLoop({
|
|
|
31725
31853
|
if (!loopEffectEnabled || !shouldRunRef.current) return;
|
|
31726
31854
|
await animateValues();
|
|
31727
31855
|
await delay2(loopRepeatDelay ?? 0,);
|
|
31728
|
-
|
|
31856
|
+
void animateLoop();
|
|
31729
31857
|
}, [animateValues, delay2, loopEffectEnabled, loopRepeatDelay,],);
|
|
31730
31858
|
const start2 = useCallback(() => {
|
|
31731
31859
|
if (shouldRunRef.current) return;
|
|
@@ -31772,14 +31900,23 @@ function useLoop({
|
|
|
31772
31900
|
}, [start2, stop, loopPauseOffscreen, hasLoop,],);
|
|
31773
31901
|
useEffect(() => {
|
|
31774
31902
|
return () => stop();
|
|
31775
|
-
}, [],);
|
|
31903
|
+
}, [stop,],);
|
|
31904
|
+
const isIntersectingRef = useRef3(false,);
|
|
31905
|
+
const stopAfterAnimationEnds = useCallback(async () => {
|
|
31906
|
+
if (!animationPromiseRef.current) return;
|
|
31907
|
+
await animationPromiseRef.current;
|
|
31908
|
+
if (isIntersectingRef.current) return;
|
|
31909
|
+
stop();
|
|
31910
|
+
}, [stop,],);
|
|
31776
31911
|
const startAndStopBasedOnIntersection = useCallback((entry) => {
|
|
31777
31912
|
if (entry.isIntersecting) {
|
|
31913
|
+
isIntersectingRef.current = true;
|
|
31778
31914
|
start2();
|
|
31779
31915
|
} else {
|
|
31780
|
-
|
|
31916
|
+
isIntersectingRef.current = false;
|
|
31917
|
+
void stopAfterAnimationEnds();
|
|
31781
31918
|
}
|
|
31782
|
-
}, [start2,
|
|
31919
|
+
}, [start2, stopAfterAnimationEnds,],);
|
|
31783
31920
|
useSharedIntersectionObserver(ref, startAndStopBasedOnIntersection, {
|
|
31784
31921
|
enabled: hasLoop && loopPauseOffscreen,
|
|
31785
31922
|
},);
|
|
@@ -31845,7 +31982,7 @@ function useParallax(options, ref, visibilityStyle,) {
|
|
|
31845
31982
|
};
|
|
31846
31983
|
}
|
|
31847
31984
|
function getTransition(value,) {
|
|
31848
|
-
if (isString(value,) || !
|
|
31985
|
+
if (isString(value,) || !isObject2(value,)) return void 0;
|
|
31849
31986
|
return value == null ? void 0 : value.transition;
|
|
31850
31987
|
}
|
|
31851
31988
|
function runEffectAnimation(target, effect, shouldReduceMotion, ref, appearId, instant,) {
|
|
@@ -31855,7 +31992,7 @@ function runEffectAnimation(target, effect, shouldReduceMotion, ref, appearId, i
|
|
|
31855
31992
|
if (shouldReduceMotion && key7 !== 'opacity') return resolve();
|
|
31856
31993
|
const motionValue2 = effect.values[key7];
|
|
31857
31994
|
motionValue2.stop();
|
|
31858
|
-
let value = !
|
|
31995
|
+
let value = !isObject2(target,) ? defaultFXValues[key7] : (target == null ? void 0 : target[key7]) ?? defaultFXValues[key7];
|
|
31859
31996
|
if (isMotionValue(value,)) value = value.get();
|
|
31860
31997
|
if (!isNumber2(value,)) return resolve();
|
|
31861
31998
|
const visualElement = visualElementStore.get(ref.current,);
|
|
@@ -31907,14 +32044,14 @@ function usePresenceAnimation(
|
|
|
31907
32044
|
},);
|
|
31908
32045
|
const effect = useConstant2(() => {
|
|
31909
32046
|
const base = initial ?? style2;
|
|
31910
|
-
if (!
|
|
32047
|
+
if (!isObject2(base,)) {
|
|
31911
32048
|
return {
|
|
31912
32049
|
values: makeFXValues(),
|
|
31913
32050
|
};
|
|
31914
32051
|
}
|
|
31915
32052
|
const defaults = {};
|
|
31916
32053
|
for (const key7 in base) {
|
|
31917
|
-
const value =
|
|
32054
|
+
const value = isObject2(base,) ? base[key7] : void 0;
|
|
31918
32055
|
if (!isNumber2(value,)) continue;
|
|
31919
32056
|
defaults[key7] = value;
|
|
31920
32057
|
}
|
|
@@ -32484,10 +32621,10 @@ var add2 = (values) => values.reduce((sum, value,) => sum += value, 0,);
|
|
|
32484
32621
|
var multiply = (values) => values.reduce((sum, value,) => sum = sum * value, 1,);
|
|
32485
32622
|
var reactRefObjectKey = 'current';
|
|
32486
32623
|
function isReactRefObject(value,) {
|
|
32487
|
-
return
|
|
32624
|
+
return isObject2(value,) && reactRefObjectKey in value;
|
|
32488
32625
|
}
|
|
32489
32626
|
function addMotionValueStyle(style2, values,) {
|
|
32490
|
-
if (!style2 || !
|
|
32627
|
+
if (!style2 || !isObject2(style2,)) return values;
|
|
32491
32628
|
for (const key7 in style2) {
|
|
32492
32629
|
const value = style2[key7];
|
|
32493
32630
|
if (!isMotionValue(value,) || !isFXValuesKey(key7,)) continue;
|
|
@@ -32718,7 +32855,7 @@ var SynchronousSuspenseErrorBoundary = class extends Component2 {
|
|
|
32718
32855
|
error,
|
|
32719
32856
|
'\n\nComponent stack:\n',
|
|
32720
32857
|
componentStack,
|
|
32721
|
-
'\n\nThis error indicates a state update wasn\u2019t wrapped with startTransition. Some of the UI might flash as a result. If you are the author of this website, check recently added custom code, and if the issue persists, report it to the Framer team via https://www.framer.
|
|
32858
|
+
'\n\nThis error indicates a state update wasn\u2019t wrapped with startTransition. Some of the UI might flash as a result. If you are the author of this website, check recently added custom code, and if the issue persists, report it to the Framer team via https://www.framer.com/contact/.',
|
|
32722
32859
|
);
|
|
32723
32860
|
const stack = error instanceof Error && typeof error.stack === 'string' ? error.stack : void 0;
|
|
32724
32861
|
sendTrackingEvent('published_site_load_recoverable_error', {
|
|
@@ -32791,7 +32928,7 @@ function shouldEnableCodeBoundaries() {
|
|
|
32791
32928
|
return RenderTarget.current() !== RenderTarget.canvas;
|
|
32792
32929
|
}
|
|
32793
32930
|
function CodeComponentBoundary({
|
|
32794
|
-
|
|
32931
|
+
getErrorMessage,
|
|
32795
32932
|
fallback,
|
|
32796
32933
|
children,
|
|
32797
32934
|
},) {
|
|
@@ -32802,7 +32939,7 @@ function CodeComponentBoundary({
|
|
|
32802
32939
|
fallback,
|
|
32803
32940
|
children: /* @__PURE__ */ jsx3(ClientSideErrorBoundary, {
|
|
32804
32941
|
fallback,
|
|
32805
|
-
|
|
32942
|
+
getErrorMessage,
|
|
32806
32943
|
children,
|
|
32807
32944
|
},),
|
|
32808
32945
|
},);
|
|
@@ -32820,7 +32957,7 @@ var ClientSideErrorBoundary = class extends Component2 {
|
|
|
32820
32957
|
};
|
|
32821
32958
|
}
|
|
32822
32959
|
componentDidCatch(error, errorInfo,) {
|
|
32823
|
-
logError(this.props.
|
|
32960
|
+
logError(this.props.getErrorMessage(), errorInfo == null ? void 0 : errorInfo.componentStack,);
|
|
32824
32961
|
collectErrorToAnalytics(error, errorInfo,);
|
|
32825
32962
|
}
|
|
32826
32963
|
render() {
|
|
@@ -33002,7 +33139,7 @@ function useMaybeWrapComponentWithCodeBoundary(children, scopeId, nodeId, isAuth
|
|
|
33002
33139
|
);
|
|
33003
33140
|
if (shouldWrapWithBoundary) {
|
|
33004
33141
|
children = /* @__PURE__ */ jsx3(CodeComponentBoundary, {
|
|
33005
|
-
|
|
33142
|
+
getErrorMessage: getErrorMessageForComponent.bind(null, scopeId, nodeId,),
|
|
33006
33143
|
fallback: null,
|
|
33007
33144
|
children,
|
|
33008
33145
|
},);
|
|
@@ -33870,7 +34007,7 @@ function childrenWithOrigin(child, {
|
|
|
33870
34007
|
y,
|
|
33871
34008
|
},) {
|
|
33872
34009
|
if (!child || !isReactChild(child,) || !isReactElement(child,)) return null;
|
|
33873
|
-
if (!
|
|
34010
|
+
if (!isObject2(child.props.style,) && !isUndefined(child.props.style,)) return null;
|
|
33874
34011
|
const style2 = {
|
|
33875
34012
|
...child.props.style,
|
|
33876
34013
|
originX: x,
|
|
@@ -34031,6 +34168,17 @@ function Floating({
|
|
|
34031
34168
|
getPortalContainer(portalSelector, inComponent,),
|
|
34032
34169
|
);
|
|
34033
34170
|
}
|
|
34171
|
+
var Instance = /* @__PURE__ */ React4.forwardRef(function Instance2({
|
|
34172
|
+
Component: Component17,
|
|
34173
|
+
...props
|
|
34174
|
+
}, ref,) {
|
|
34175
|
+
return Component17
|
|
34176
|
+
? /* @__PURE__ */ jsx3(Component17, {
|
|
34177
|
+
...props,
|
|
34178
|
+
ref,
|
|
34179
|
+
},)
|
|
34180
|
+
: null;
|
|
34181
|
+
},);
|
|
34034
34182
|
var GracefullyDegradingErrorBoundary = class extends Component2 {
|
|
34035
34183
|
constructor() {
|
|
34036
34184
|
super(...arguments,);
|
|
@@ -34042,7 +34190,7 @@ var GracefullyDegradingErrorBoundary = class extends Component2 {
|
|
|
34042
34190
|
__publicField(
|
|
34043
34191
|
this,
|
|
34044
34192
|
'messageReport',
|
|
34045
|
-
'If you are the author of this website, please report this issue to the Framer team via https://www.framer.
|
|
34193
|
+
'If you are the author of this website, please report this issue to the Framer team via https://www.framer.com/contact/',
|
|
34046
34194
|
);
|
|
34047
34195
|
}
|
|
34048
34196
|
static getDerivedStateFromError(error,) {
|
|
@@ -34062,7 +34210,7 @@ var GracefullyDegradingErrorBoundary = class extends Component2 {
|
|
|
34062
34210
|
error,
|
|
34063
34211
|
);
|
|
34064
34212
|
const sampleRate = Math.random();
|
|
34065
|
-
if (sampleRate > 0.
|
|
34213
|
+
if (sampleRate > 0.5) return;
|
|
34066
34214
|
const stack = error instanceof Error && typeof error.stack === 'string' ? error.stack : null;
|
|
34067
34215
|
sendTrackingEvent('published_site_load_error', {
|
|
34068
34216
|
message: String(error,),
|
|
@@ -35473,7 +35621,7 @@ async function submitForm(action, data2, projectHash,) {
|
|
|
35473
35621
|
}
|
|
35474
35622
|
}
|
|
35475
35623
|
function responseHasError(response,) {
|
|
35476
|
-
return typeof response === 'object' && response !== null && 'error' in response &&
|
|
35624
|
+
return typeof response === 'object' && response !== null && 'error' in response && isObject2(response.error,) &&
|
|
35477
35625
|
'message' in response.error && typeof response.error.message === 'string';
|
|
35478
35626
|
}
|
|
35479
35627
|
function isSamePage(a, b,) {
|
|
@@ -35673,7 +35821,7 @@ function Router({
|
|
|
35673
35821
|
let localeId;
|
|
35674
35822
|
if (isString(localeOrLocaleId,)) {
|
|
35675
35823
|
localeId = localeOrLocaleId;
|
|
35676
|
-
} else if (
|
|
35824
|
+
} else if (isObject2(localeOrLocaleId,)) {
|
|
35677
35825
|
localeId = localeOrLocaleId.id;
|
|
35678
35826
|
}
|
|
35679
35827
|
const defaultLocale = locales.find(({
|
|
@@ -35698,7 +35846,6 @@ function Router({
|
|
|
35698
35846
|
preserveQueryParams,
|
|
35699
35847
|
},);
|
|
35700
35848
|
if (!localeResult) return;
|
|
35701
|
-
const currentPathVariables2 = currentPathVariablesRef.current;
|
|
35702
35849
|
const currentStatePaginationInfo = isHistoryState(window.history.state,) ? window.history.state.paginationInfo : void 0;
|
|
35703
35850
|
const currentPath = localeResult.path;
|
|
35704
35851
|
currentPathVariablesRef.current = localeResult.pathVariables;
|
|
@@ -35708,7 +35855,7 @@ function Router({
|
|
|
35708
35855
|
return pushHistoryState(
|
|
35709
35856
|
{
|
|
35710
35857
|
routeId: currentRouteId2,
|
|
35711
|
-
pathVariables:
|
|
35858
|
+
pathVariables: localeResult.pathVariables,
|
|
35712
35859
|
localeId: nextLocale.id,
|
|
35713
35860
|
paginationInfo: currentStatePaginationInfo,
|
|
35714
35861
|
},
|
|
@@ -36401,14 +36548,13 @@ _subscribers2 = /* @__PURE__ */ new WeakMap();
|
|
|
36401
36548
|
_results = /* @__PURE__ */ new WeakMap();
|
|
36402
36549
|
_SSRResults = /* @__PURE__ */ new WeakMap();
|
|
36403
36550
|
_onlyPrefetched = /* @__PURE__ */ new WeakMap();
|
|
36404
|
-
function
|
|
36551
|
+
function useFetchRequestsForChildren(requests, disabled, children,) {
|
|
36405
36552
|
const fetchClient = React2.useContext(FetchClientContext,);
|
|
36406
36553
|
if (!fetchClient) {
|
|
36407
36554
|
throw new Error('useFetchRequest must be used within a FetchClientProvider',);
|
|
36408
36555
|
}
|
|
36409
36556
|
const isRestoringCache = React2.useContext(IsRestoringCacheContext,);
|
|
36410
36557
|
const [observer2,] = React2.useState(() => new RequestsObserver(fetchClient, requests,));
|
|
36411
|
-
const [result, setResult,] = React2.useState(() => observer2.getServerResults());
|
|
36412
36558
|
React2.useLayoutEffect(() => {
|
|
36413
36559
|
if (disabled) return;
|
|
36414
36560
|
observer2.setRequests(requests, {
|
|
@@ -36416,18 +36562,15 @@ function useFetchRequests(requests, disabled,) {
|
|
|
36416
36562
|
},);
|
|
36417
36563
|
}, [requests, observer2, disabled,],);
|
|
36418
36564
|
React2.useEffect(() => {
|
|
36419
|
-
|
|
36420
|
-
|
|
36421
|
-
|
|
36422
|
-
|
|
36423
|
-
|
|
36424
|
-
|
|
36425
|
-
|
|
36426
|
-
|
|
36427
|
-
|
|
36428
|
-
};
|
|
36429
|
-
}, [observer2, disabled, isRestoringCache,],);
|
|
36430
|
-
return result;
|
|
36565
|
+
return () => observer2.unmount();
|
|
36566
|
+
}, [observer2,],);
|
|
36567
|
+
const subscribe = React2.useCallback((onChange) => {
|
|
36568
|
+
if (isRestoringCache || disabled) return noop4;
|
|
36569
|
+
return observer2.subscribe(onChange,);
|
|
36570
|
+
}, [disabled, observer2, isRestoringCache,],);
|
|
36571
|
+
const synchronousData = React2.useSyncExternalStore(subscribe, observer2.getResults, observer2.getServerResults,);
|
|
36572
|
+
const deferredData = React2.useDeferredValue(synchronousData,);
|
|
36573
|
+
return useMemoOne(() => children(deferredData.data, deferredData.status,), [deferredData, children,],);
|
|
36431
36574
|
}
|
|
36432
36575
|
function usePrefetch() {
|
|
36433
36576
|
const fetchClient = React2.useContext(FetchClientContext,);
|
|
@@ -36595,11 +36738,7 @@ var Fetcher = /* @__PURE__ */ React2.forwardRef(function Fetcher2({
|
|
|
36595
36738
|
...rest
|
|
36596
36739
|
}, ref,) {
|
|
36597
36740
|
const cloneWithPropsAndRef = useCloneChildrenWithPropsAndRef(ref,);
|
|
36598
|
-
const
|
|
36599
|
-
data: data2,
|
|
36600
|
-
status,
|
|
36601
|
-
} = useFetchRequests(requests, disabled,);
|
|
36602
|
-
const childrenWithValues = children(data2, status,);
|
|
36741
|
+
const childrenWithValues = useFetchRequestsForChildren(requests, disabled, children,);
|
|
36603
36742
|
return cloneWithPropsAndRef(childrenWithValues, rest,);
|
|
36604
36743
|
},);
|
|
36605
36744
|
var callEach = (...fns) => fns.forEach((fn) => fn && fn());
|
|
@@ -36631,19 +36770,19 @@ function isAnyCollection(value,) {
|
|
|
36631
36770
|
return isAnyLegacyCollection(value,) || isAnyDatabaseCollection(value,);
|
|
36632
36771
|
}
|
|
36633
36772
|
function isLegacyCollection(value,) {
|
|
36634
|
-
return isArray(value,) && value.every(
|
|
36773
|
+
return isArray(value,) && value.every(isObject2,);
|
|
36635
36774
|
}
|
|
36636
36775
|
function isLegacyLocalizedCollection(value,) {
|
|
36637
|
-
return
|
|
36776
|
+
return isObject2(value,) && isFunction(value.read,) && isFunction(value.preload,);
|
|
36638
36777
|
}
|
|
36639
36778
|
function isAnyLegacyCollection(value,) {
|
|
36640
36779
|
return isLegacyCollection(value,) || isLegacyLocalizedCollection(value,);
|
|
36641
36780
|
}
|
|
36642
36781
|
function isDatabaseCollection(value,) {
|
|
36643
|
-
return
|
|
36782
|
+
return isObject2(value,) && isObject2(value.schema,);
|
|
36644
36783
|
}
|
|
36645
36784
|
function isLocalizedDatabaseCollection(value,) {
|
|
36646
|
-
return
|
|
36785
|
+
return isObject2(value,) && isObject2(value.collectionByLocaleId,);
|
|
36647
36786
|
}
|
|
36648
36787
|
function isAnyDatabaseCollection(value,) {
|
|
36649
36788
|
return isDatabaseCollection(value,) || isLocalizedDatabaseCollection(value,);
|
|
@@ -37481,7 +37620,7 @@ function Hash(value,) {
|
|
|
37481
37620
|
return value;
|
|
37482
37621
|
}
|
|
37483
37622
|
function isHashable(value,) {
|
|
37484
|
-
return
|
|
37623
|
+
return isObject2(value,) && isFunction(value.getHash,);
|
|
37485
37624
|
}
|
|
37486
37625
|
function calculateHash(name, ...values) {
|
|
37487
37626
|
const hashes = values.map((value) => {
|
|
@@ -41124,7 +41263,7 @@ function getCollectionId(collection,) {
|
|
|
41124
41263
|
return id3;
|
|
41125
41264
|
}
|
|
41126
41265
|
function replaceCollection(_, value,) {
|
|
41127
|
-
if (
|
|
41266
|
+
if (isObject2(value,) && value.type === 'Collection' && isAnyCollection(value.data,)) {
|
|
41128
41267
|
return getCollectionId(value.data,);
|
|
41129
41268
|
}
|
|
41130
41269
|
return value;
|
|
@@ -41358,7 +41497,7 @@ function useDataRecord(collection, variables,) {
|
|
|
41358
41497
|
const pageRecord = collection.find((record2) => {
|
|
41359
41498
|
return Object.entries(variables,).every(([key7, value,],) => {
|
|
41360
41499
|
const recordValue = record2[key7];
|
|
41361
|
-
if (value === void 0 || recordValue === void 0 ||
|
|
41500
|
+
if (value === void 0 || recordValue === void 0 || isObject2(value,) || isObject2(recordValue,)) {
|
|
41362
41501
|
return false;
|
|
41363
41502
|
}
|
|
41364
41503
|
return String(value,) === String(recordValue,);
|
|
@@ -41400,7 +41539,7 @@ function useSiteRefs() {
|
|
|
41400
41539
|
}, [path,],);
|
|
41401
41540
|
}
|
|
41402
41541
|
function isFramerGamepadKeydownData(value,) {
|
|
41403
|
-
return
|
|
41542
|
+
return isObject2(value,) && value.mapping !== void 0;
|
|
41404
41543
|
}
|
|
41405
41544
|
function gamepadInputsHaveChanged(previous, current2,) {
|
|
41406
41545
|
if (previous.length !== current2.length) return true;
|
|
@@ -41644,13 +41783,8 @@ function useOnAppear(callback,) {
|
|
|
41644
41783
|
default: callback,
|
|
41645
41784
|
},);
|
|
41646
41785
|
}
|
|
41647
|
-
|
|
41786
|
+
function setOverflow(blockDocumentScrolling, show,) {
|
|
41648
41787
|
if (blockDocumentScrolling === false) return;
|
|
41649
|
-
if (yieldBefore) {
|
|
41650
|
-
await yieldToMain({
|
|
41651
|
-
continueAfter: 'paint',
|
|
41652
|
-
},);
|
|
41653
|
-
}
|
|
41654
41788
|
frame.render(() => {
|
|
41655
41789
|
const htmlStyle = document.documentElement.style;
|
|
41656
41790
|
if (show) {
|
|
@@ -41664,18 +41798,27 @@ function useOverlayState({
|
|
|
41664
41798
|
blockDocumentScrolling = true,
|
|
41665
41799
|
} = {},) {
|
|
41666
41800
|
const [showOverlay, setShowOverlay,] = React4.useState(false,);
|
|
41667
|
-
const callback = React4.useCallback((show) => {
|
|
41668
|
-
|
|
41669
|
-
|
|
41801
|
+
const callback = React4.useCallback(async (show) => {
|
|
41802
|
+
await yieldToMain({
|
|
41803
|
+
priority: 'user-blocking',
|
|
41804
|
+
continueAfter: 'paint',
|
|
41805
|
+
},);
|
|
41806
|
+
startTransition2(() => setShowOverlay(show,));
|
|
41807
|
+
setOverflow(blockDocumentScrolling, show,);
|
|
41670
41808
|
}, [blockDocumentScrolling,],);
|
|
41671
41809
|
React4.useEffect(() => () => {
|
|
41672
|
-
void
|
|
41810
|
+
void yieldToMain({
|
|
41811
|
+
priority: 'user-blocking',
|
|
41812
|
+
continueAfter: 'paint',
|
|
41813
|
+
},).then(() => {
|
|
41814
|
+
setOverflow(blockDocumentScrolling, false,);
|
|
41815
|
+
},);
|
|
41673
41816
|
}, [blockDocumentScrolling,],);
|
|
41674
41817
|
return [showOverlay, callback,];
|
|
41675
41818
|
}
|
|
41676
41819
|
var key4 = 'page';
|
|
41677
41820
|
function isRoute(route,) {
|
|
41678
|
-
return
|
|
41821
|
+
return isObject2(route,) && key4 in route && route.page !== void 0;
|
|
41679
41822
|
}
|
|
41680
41823
|
async function componentForRoute(route,) {
|
|
41681
41824
|
if (!isRoute(route,)) return;
|
|
@@ -41691,7 +41834,7 @@ async function componentForRoute(route,) {
|
|
|
41691
41834
|
}
|
|
41692
41835
|
var preloadKey2 = 'preload';
|
|
41693
41836
|
function withPreload(component,) {
|
|
41694
|
-
return !!component &&
|
|
41837
|
+
return !!component && isObject2(component,) && preloadKey2 in component;
|
|
41695
41838
|
}
|
|
41696
41839
|
function usePrototypeNavigate({
|
|
41697
41840
|
preload,
|
|
@@ -41813,7 +41956,7 @@ function usePreloadQuery() {
|
|
|
41813
41956
|
function getWhereExpressionFromPathVariables(pathVariables, collection,) {
|
|
41814
41957
|
const entries = Object.entries(pathVariables ?? {},).filter(([, value,],) => {
|
|
41815
41958
|
if (isUndefined(value,)) return false;
|
|
41816
|
-
if (
|
|
41959
|
+
if (isObject2(value,)) return false;
|
|
41817
41960
|
return true;
|
|
41818
41961
|
},);
|
|
41819
41962
|
const expressions = entries.map(([name, value,],) => ({
|
|
@@ -41848,62 +41991,44 @@ function getWhereExpressionFromPathVariables(pathVariables, collection,) {
|
|
|
41848
41991
|
}));
|
|
41849
41992
|
}
|
|
41850
41993
|
function useLoadMorePagination(totalSize, pageSize, hash2, paginateWithSuspendedLoadingState = false,) {
|
|
41994
|
+
var _a, _b, _c, _d;
|
|
41995
|
+
const [isPending, startLoadingTransition,] = useTransition();
|
|
41851
41996
|
const totalPages = Math.ceil(totalSize / pageSize,);
|
|
41852
|
-
const [
|
|
41853
|
-
|
|
41854
|
-
const currentPage = ((_d = (_c = (_b = (_a = globalThis == null ? void 0 : globalThis.history) == null ? void 0 : _a.state) == null
|
|
41997
|
+
const [currentPage, setCurrentPage,] = useState(
|
|
41998
|
+
((_d = (_c = (_b = (_a = globalThis == null ? void 0 : globalThis.history) == null ? void 0 : _a.state) == null
|
|
41855
41999
|
? void 0
|
|
41856
42000
|
: _b.paginationInfo) == null
|
|
41857
42001
|
? void 0
|
|
41858
42002
|
: _c[hash2]) == null
|
|
41859
42003
|
? void 0
|
|
41860
|
-
: _d.currentPage) ?? 1
|
|
42004
|
+
: _d.currentPage) ?? 1,
|
|
42005
|
+
);
|
|
42006
|
+
const paginationInfo = useMemo2(() => {
|
|
41861
42007
|
return {
|
|
41862
42008
|
currentPage,
|
|
41863
42009
|
totalPages,
|
|
41864
|
-
isLoading:
|
|
42010
|
+
isLoading: isPending,
|
|
41865
42011
|
};
|
|
41866
|
-
},);
|
|
41867
|
-
useEffect(() => {
|
|
41868
|
-
startTransition2(() => {
|
|
41869
|
-
setPaginationInfo((current2) => {
|
|
41870
|
-
if (current2.totalPages === totalPages) return current2;
|
|
41871
|
-
return {
|
|
41872
|
-
...current2,
|
|
41873
|
-
totalPages,
|
|
41874
|
-
};
|
|
41875
|
-
},);
|
|
41876
|
-
},);
|
|
41877
|
-
}, [totalPages,],);
|
|
42012
|
+
}, [currentPage, totalPages, isPending,],);
|
|
41878
42013
|
useEffect(() => {
|
|
41879
42014
|
pushLoadMoreHistory(hash2, paginationInfo,);
|
|
41880
42015
|
}, [hash2, paginationInfo,],);
|
|
41881
42016
|
const onCanvas = useIsOnFramerCanvas();
|
|
41882
|
-
const loadMore = useCallback(() => {
|
|
42017
|
+
const loadMore = useCallback(async () => {
|
|
41883
42018
|
if (onCanvas) return;
|
|
41884
|
-
if (
|
|
41885
|
-
|
|
41886
|
-
|
|
41887
|
-
|
|
41888
|
-
...info,
|
|
41889
|
-
currentPage: Math.min(info.currentPage + 1, info.totalPages,),
|
|
41890
|
-
isLoading: false,
|
|
41891
|
-
}));
|
|
41892
|
-
},);
|
|
41893
|
-
return;
|
|
41894
|
-
}
|
|
41895
|
-
setPaginationInfo((info) => ({
|
|
41896
|
-
...info,
|
|
41897
|
-
isLoading: true,
|
|
41898
|
-
}));
|
|
41899
|
-
requestAnimationFrame(() => {
|
|
41900
|
-
setPaginationInfo((info) => ({
|
|
41901
|
-
...info,
|
|
41902
|
-
currentPage: Math.min(info.currentPage + 1, info.totalPages,),
|
|
41903
|
-
isLoading: false,
|
|
41904
|
-
}));
|
|
42019
|
+
if (currentPage >= totalPages) return;
|
|
42020
|
+
await yieldToMain({
|
|
42021
|
+
priority: 'user-blocking',
|
|
42022
|
+
continueAfter: 'paint',
|
|
41905
42023
|
},);
|
|
41906
|
-
|
|
42024
|
+
const renderNextPage = (startTransition14) => {
|
|
42025
|
+
startTransition14(() => {
|
|
42026
|
+
setCurrentPage((_currentPage) => Math.min(_currentPage + 1, totalPages,));
|
|
42027
|
+
},);
|
|
42028
|
+
};
|
|
42029
|
+
if (!paginateWithSuspendedLoadingState) return renderNextPage(startTransition2,);
|
|
42030
|
+
return renderNextPage(startLoadingTransition,);
|
|
42031
|
+
}, [currentPage, totalPages, paginateWithSuspendedLoadingState,],);
|
|
41907
42032
|
return {
|
|
41908
42033
|
paginationInfo,
|
|
41909
42034
|
loadMore,
|
|
@@ -42018,15 +42143,16 @@ function useRunCallbackIfPageIsVisible() {
|
|
|
42018
42143
|
}, [clean,],);
|
|
42019
42144
|
}
|
|
42020
42145
|
function useRunCallbackIfElementIsInView() {
|
|
42021
|
-
const
|
|
42146
|
+
const observerRefCleanup = useRef3();
|
|
42022
42147
|
const isInViewRef = useRef3(false,);
|
|
42023
42148
|
const callbackRef = useRef3();
|
|
42149
|
+
const observers2 = useContext(SharedIntersectionObserverContext,);
|
|
42024
42150
|
useEffect(() => {
|
|
42025
42151
|
return () => {
|
|
42026
42152
|
var _a;
|
|
42027
|
-
(_a =
|
|
42153
|
+
(_a = observerRefCleanup.current) == null ? void 0 : _a.call(observerRefCleanup,);
|
|
42028
42154
|
callbackRef.current = void 0;
|
|
42029
|
-
|
|
42155
|
+
observerRefCleanup.current = void 0;
|
|
42030
42156
|
};
|
|
42031
42157
|
}, [],);
|
|
42032
42158
|
return useCallback((callback, ref,) => {
|
|
@@ -42035,21 +42161,21 @@ function useRunCallbackIfElementIsInView() {
|
|
|
42035
42161
|
return;
|
|
42036
42162
|
}
|
|
42037
42163
|
callbackRef.current = callback;
|
|
42038
|
-
if (
|
|
42039
|
-
|
|
42040
|
-
|
|
42041
|
-
|
|
42042
|
-
|
|
42043
|
-
|
|
42044
|
-
|
|
42045
|
-
|
|
42046
|
-
|
|
42047
|
-
|
|
42048
|
-
|
|
42049
|
-
|
|
42050
|
-
|
|
42051
|
-
|
|
42052
|
-
}, [],);
|
|
42164
|
+
if (observerRefCleanup.current) return;
|
|
42165
|
+
let queuedMicrotask = false;
|
|
42166
|
+
const observerCallback = (entry) => {
|
|
42167
|
+
isInViewRef.current = entry.isIntersecting;
|
|
42168
|
+
if (queuedMicrotask) return;
|
|
42169
|
+
queuedMicrotask = true;
|
|
42170
|
+
queueMicrotask(() => {
|
|
42171
|
+
var _a;
|
|
42172
|
+
if (!isInViewRef.current) return;
|
|
42173
|
+
queuedMicrotask = false;
|
|
42174
|
+
(_a = callbackRef.current) == null ? void 0 : _a.call(callbackRef,);
|
|
42175
|
+
},);
|
|
42176
|
+
};
|
|
42177
|
+
observerRefCleanup.current = observeElement(observers2, 'undefined', ref.current, null, observerCallback,);
|
|
42178
|
+
}, [observers2,],);
|
|
42053
42179
|
}
|
|
42054
42180
|
function useUpdateIfVisible(ref,) {
|
|
42055
42181
|
const runUpdateIfPageIsVisible = useRunCallbackIfPageIsVisible();
|
|
@@ -42067,20 +42193,26 @@ var globalWaitingForClickPromise;
|
|
|
42067
42193
|
var globalWaitingForClickResolve;
|
|
42068
42194
|
async function getPromiseWithFallback() {
|
|
42069
42195
|
return new Promise((resolve) => {
|
|
42070
|
-
|
|
42196
|
+
let resolveFn = resolve;
|
|
42197
|
+
setTimeout(() => {
|
|
42198
|
+
if (!resolveFn) return;
|
|
42199
|
+
performance.mark('wait-for-click-fallback',);
|
|
42200
|
+
resolveFn();
|
|
42201
|
+
}, 150,);
|
|
42202
|
+
globalWaitingForClickResolve = () => {
|
|
42071
42203
|
resolve();
|
|
42072
|
-
|
|
42204
|
+
resolveFn = void 0;
|
|
42073
42205
|
};
|
|
42074
|
-
const timeout = setTimeout(resolveFn, 150,);
|
|
42075
|
-
globalWaitingForClickResolve = resolveFn;
|
|
42076
42206
|
},);
|
|
42077
42207
|
}
|
|
42078
42208
|
function globalWaitForClickListener(event,) {
|
|
42079
42209
|
if (event.button === 0) {
|
|
42210
|
+
performance.mark('pointerdown-listener',);
|
|
42080
42211
|
globalWaitingForClickPromise = getPromiseWithFallback();
|
|
42081
42212
|
}
|
|
42082
42213
|
}
|
|
42083
42214
|
function globalClickReceivedListener() {
|
|
42215
|
+
performance.mark('click-received-listener',);
|
|
42084
42216
|
globalWaitingForClickPromise = void 0;
|
|
42085
42217
|
globalWaitingForClickResolve == null ? void 0 : globalWaitingForClickResolve();
|
|
42086
42218
|
globalWaitingForClickResolve = void 0;
|
|
@@ -42158,13 +42290,17 @@ function useVariantState({
|
|
|
42158
42290
|
internalState.current.gestureVariant = nextGesture;
|
|
42159
42291
|
const yieldOnTap = yieldOnTapFeatureOn && internalState.current.isPressedHasUpdated;
|
|
42160
42292
|
if (yieldOnTap && globalWaitingForClickPromise) {
|
|
42293
|
+
performance.mark('wait-for-tap-start',);
|
|
42161
42294
|
await globalWaitingForClickPromise;
|
|
42295
|
+
performance.measure('wait-for-tap', 'wait-for-tap-start',);
|
|
42162
42296
|
}
|
|
42163
42297
|
if (yieldOnTap) {
|
|
42298
|
+
performance.mark('yield-on-tap-start',);
|
|
42164
42299
|
await yieldToMain({
|
|
42165
42300
|
priority: 'user-blocking',
|
|
42166
42301
|
continueAfter: 'paint',
|
|
42167
42302
|
},);
|
|
42303
|
+
performance.measure('yield-on-tap', 'yield-on-tap-start',);
|
|
42168
42304
|
}
|
|
42169
42305
|
const {
|
|
42170
42306
|
isHovered: isHovered2,
|
|
@@ -42331,7 +42467,7 @@ function withCodeBoundaryForOverrides(Component17, {
|
|
|
42331
42467
|
if (shouldWrapWithBoundary) {
|
|
42332
42468
|
if (appliedOverride.status === 'success') {
|
|
42333
42469
|
return /* @__PURE__ */ jsx3(CodeComponentBoundary, {
|
|
42334
|
-
|
|
42470
|
+
getErrorMessage: getErrorMessageForOverride.bind(null, scopeId, nodeId,),
|
|
42335
42471
|
fallback: /* @__PURE__ */ jsx3(Component17, {
|
|
42336
42472
|
...props,
|
|
42337
42473
|
ref,
|
|
@@ -42564,7 +42700,7 @@ var withVariantAppearEffect = (Component17) =>
|
|
|
42564
42700
|
},);
|
|
42565
42701
|
},);
|
|
42566
42702
|
}, [animateOnce, threshold, targets, props.variant, scrollDirection, exitTarget,],);
|
|
42567
|
-
useScrollDirectionChange(scrollDirection, setVariant, {
|
|
42703
|
+
useScrollDirectionChange(scrollDirection, (variant) => React4.startTransition(() => setVariant(variant,)), {
|
|
42568
42704
|
enabled: variantAppearEffectEnabled,
|
|
42569
42705
|
repeat: !animateOnce,
|
|
42570
42706
|
},);
|
|
@@ -42572,7 +42708,7 @@ var withVariantAppearEffect = (Component17) =>
|
|
|
42572
42708
|
if (!variantAppearEffectEnabled) return;
|
|
42573
42709
|
const useObscuredVariant = !options.targets && !options.scrollDirection;
|
|
42574
42710
|
const target = useObscuredVariant ? options.obscuredVariantId : void 0;
|
|
42575
|
-
|
|
42711
|
+
startTransition2(() => setVariant(target,));
|
|
42576
42712
|
},);
|
|
42577
42713
|
if (!('variantAppearEffectEnabled' in options) || variantAppearEffectEnabled === true) {
|
|
42578
42714
|
return /* @__PURE__ */ jsx3(Component17, {
|
|
@@ -44409,10 +44545,10 @@ function loadVariationAxes(source,) {
|
|
|
44409
44545
|
}
|
|
44410
44546
|
}
|
|
44411
44547
|
function isValidVariationAxesData(data2,) {
|
|
44412
|
-
return
|
|
44548
|
+
return isObject2(data2,) && Object.values(data2,).every(isValidVariationAxes,);
|
|
44413
44549
|
}
|
|
44414
44550
|
function isVariationAxis2(data2,) {
|
|
44415
|
-
return
|
|
44551
|
+
return isObject2(data2,) && isString(data2.tag,);
|
|
44416
44552
|
}
|
|
44417
44553
|
function isValidVariationAxes(data2,) {
|
|
44418
44554
|
return Array.isArray(data2,) && data2.every(isVariationAxis2,);
|
|
@@ -44421,10 +44557,17 @@ var FontStore = class {
|
|
|
44421
44557
|
constructor() {
|
|
44422
44558
|
__publicField(this, 'enabled', false,);
|
|
44423
44559
|
__publicField(this, 'bySelector', /* @__PURE__ */ new Map(),);
|
|
44560
|
+
__publicField(this, 'loadedSelectors', /* @__PURE__ */ new Set(),);
|
|
44424
44561
|
__publicField(this, 'getGoogleFontsListPromise',);
|
|
44425
44562
|
__publicField(this, 'getFontshareFontsListPromise',);
|
|
44426
44563
|
__publicField(this, 'getBuiltInFontsListPromise',);
|
|
44427
|
-
__publicField(
|
|
44564
|
+
__publicField(
|
|
44565
|
+
this,
|
|
44566
|
+
'customFontsImportPromise',
|
|
44567
|
+
new Promise((resolve) => {
|
|
44568
|
+
this.resolveCustomFontsImportPromise = resolve;
|
|
44569
|
+
},),
|
|
44570
|
+
);
|
|
44428
44571
|
__publicField(this, 'local',);
|
|
44429
44572
|
__publicField(this, 'google',);
|
|
44430
44573
|
__publicField(this, 'fontshare',);
|
|
@@ -44507,9 +44650,13 @@ var FontStore = class {
|
|
|
44507
44650
|
this.bySelector.delete(key7,);
|
|
44508
44651
|
}
|
|
44509
44652
|
},);
|
|
44510
|
-
|
|
44653
|
+
const importedFonts = this.custom.importFonts(assets,);
|
|
44654
|
+
for (const font of importedFonts) {
|
|
44511
44655
|
this.addFont(font,);
|
|
44512
44656
|
}
|
|
44657
|
+
if (importedFonts.length > 0) {
|
|
44658
|
+
this.resolveCustomFontsImportPromise();
|
|
44659
|
+
}
|
|
44513
44660
|
}
|
|
44514
44661
|
getFontFamily(info,) {
|
|
44515
44662
|
const fontFamily = this[info.source].getFontFamilyByName(info.name,);
|
|
@@ -44669,6 +44816,12 @@ var FontStore = class {
|
|
|
44669
44816
|
},),
|
|
44670
44817
|
);
|
|
44671
44818
|
}
|
|
44819
|
+
const shouldImportCustomFonts = selectors.some((selector) => selector.startsWith(customFontSelectorPrefix,));
|
|
44820
|
+
if (shouldImportCustomFonts) {
|
|
44821
|
+
importPromises.push(this.customFontsImportPromise.catch((error) => {
|
|
44822
|
+
warnOnce2('Failed to load custom fonts:', error,);
|
|
44823
|
+
},),);
|
|
44824
|
+
}
|
|
44672
44825
|
if (importPromises.length > 0) {
|
|
44673
44826
|
await Promise.all(importPromises,);
|
|
44674
44827
|
}
|
|
@@ -45000,10 +45153,9 @@ var PlainTextInput = /* @__PURE__ */ forwardRef(function FormPlainTextInput(prop
|
|
|
45000
45153
|
className: cx(textInputWrapperClassName, inputWrapperClassName, className2,),
|
|
45001
45154
|
...rest,
|
|
45002
45155
|
children: type === 'textarea'
|
|
45003
|
-
? /* @__PURE__ */
|
|
45156
|
+
? /* @__PURE__ */ jsx3(motion.textarea, {
|
|
45004
45157
|
...dataProps,
|
|
45005
45158
|
...eventHandlers,
|
|
45006
|
-
key: defaultValue,
|
|
45007
45159
|
required,
|
|
45008
45160
|
autoFocus,
|
|
45009
45161
|
name: inputName,
|
|
@@ -45011,11 +45163,10 @@ var PlainTextInput = /* @__PURE__ */ forwardRef(function FormPlainTextInput(prop
|
|
|
45011
45163
|
className: inputClassName,
|
|
45012
45164
|
defaultValue,
|
|
45013
45165
|
maxLength,
|
|
45014
|
-
},)
|
|
45015
|
-
: /* @__PURE__ */
|
|
45166
|
+
}, defaultValue,)
|
|
45167
|
+
: /* @__PURE__ */ jsx3(motion.input, {
|
|
45016
45168
|
...dataProps,
|
|
45017
45169
|
...eventHandlers,
|
|
45018
|
-
key: defaultValue,
|
|
45019
45170
|
type,
|
|
45020
45171
|
required,
|
|
45021
45172
|
autoFocus,
|
|
@@ -45027,7 +45178,7 @@ var PlainTextInput = /* @__PURE__ */ forwardRef(function FormPlainTextInput(prop
|
|
|
45027
45178
|
max,
|
|
45028
45179
|
step: step2,
|
|
45029
45180
|
maxLength,
|
|
45030
|
-
},),
|
|
45181
|
+
}, defaultValue,),
|
|
45031
45182
|
},);
|
|
45032
45183
|
},);
|
|
45033
45184
|
var iconSize2 = 16;
|
|
@@ -46453,7 +46604,7 @@ var RichText2 = /* @__PURE__ */ forwardRef(function RichText3({
|
|
|
46453
46604
|
}, ref,) {
|
|
46454
46605
|
const content = html || children || htmlFromDesign;
|
|
46455
46606
|
if (isString(content,)) {
|
|
46456
|
-
if (!props.stylesPresetsClassName &&
|
|
46607
|
+
if (!props.stylesPresetsClassName && isObject2(props.stylesPresetsClassNames,)) {
|
|
46457
46608
|
props.stylesPresetsClassName = Object.values(props.stylesPresetsClassNames,).join(' ',);
|
|
46458
46609
|
}
|
|
46459
46610
|
const contentProp = {
|
|
@@ -48643,7 +48794,7 @@ var VectorGroup = /* @__PURE__ */ (() => {
|
|
|
48643
48794
|
})();
|
|
48644
48795
|
var key6 = 'calculatedPaths';
|
|
48645
48796
|
function withShape(target,) {
|
|
48646
|
-
if (!
|
|
48797
|
+
if (!isObject2(target,)) return false;
|
|
48647
48798
|
return key6 in target;
|
|
48648
48799
|
}
|
|
48649
48800
|
var Size = /* @__PURE__ */ (() => {
|
|
@@ -48880,7 +49031,7 @@ function inspect(item, max, l,) {
|
|
|
48880
49031
|
if (item === void 0) {
|
|
48881
49032
|
return 'undefined';
|
|
48882
49033
|
}
|
|
48883
|
-
if (
|
|
49034
|
+
if (isObject2(item,) && isFunction(item.toInspect,)) {
|
|
48884
49035
|
return item.toInspect();
|
|
48885
49036
|
}
|
|
48886
49037
|
if (isString(item,)) {
|
|
@@ -48893,7 +49044,7 @@ function inspect(item, max, l,) {
|
|
|
48893
49044
|
let code = item.toString().slice('function '.length,).replace(/\n/gu, '',).replace(/\s+/gu, ' ',);
|
|
48894
49045
|
const limit = 50;
|
|
48895
49046
|
if (code.length > limit && l > 0) {
|
|
48896
|
-
code = `${code.slice(0,
|
|
49047
|
+
code = `${code.slice(0, limit + 1,).trim()}\u2026 }`;
|
|
48897
49048
|
}
|
|
48898
49049
|
return `<Function ${code}>`;
|
|
48899
49050
|
}
|
|
@@ -48903,7 +49054,7 @@ function inspect(item, max, l,) {
|
|
|
48903
49054
|
}
|
|
48904
49055
|
return `[${item.map((i) => inspect(i, max, (l || 0) + 1,)).join(', ',)}]`;
|
|
48905
49056
|
}
|
|
48906
|
-
if (
|
|
49057
|
+
if (isObject2(item,)) {
|
|
48907
49058
|
let objectInfo;
|
|
48908
49059
|
const objectType = inspectObjectType(item,);
|
|
48909
49060
|
if (/HTML\w+?Element/u.test(objectType,)) {
|
|
@@ -48979,8 +49130,8 @@ var package_default = {
|
|
|
48979
49130
|
'@types/react': '^18.2.67',
|
|
48980
49131
|
'@types/react-dom': '^18.2.22',
|
|
48981
49132
|
'@types/yargs': '^17.0.33',
|
|
48982
|
-
'@typescript-eslint/eslint-plugin': '^8.
|
|
48983
|
-
'@typescript-eslint/parser': '^8.
|
|
49133
|
+
'@typescript-eslint/eslint-plugin': '^8.32.1',
|
|
49134
|
+
'@typescript-eslint/parser': '^8.32.1',
|
|
48984
49135
|
chalk: '^4.1.2',
|
|
48985
49136
|
eslint: '^8.57.1',
|
|
48986
49137
|
'eslint-plugin-framer-studio': 'workspace:*',
|
|
@@ -48996,7 +49147,7 @@ var package_default = {
|
|
|
48996
49147
|
yargs: '^17.7.2',
|
|
48997
49148
|
},
|
|
48998
49149
|
peerDependencies: {
|
|
48999
|
-
'framer-motion': '12.
|
|
49150
|
+
'framer-motion': '12.14.0',
|
|
49000
49151
|
react: '^18.2.0',
|
|
49001
49152
|
'react-dom': '^18.2.0',
|
|
49002
49153
|
},
|
|
@@ -49021,11 +49172,13 @@ export {
|
|
|
49021
49172
|
acceleratedValues2 as acceleratedValues,
|
|
49022
49173
|
activeAnimations,
|
|
49023
49174
|
addActionControls,
|
|
49175
|
+
addAttrValue,
|
|
49024
49176
|
addFonts,
|
|
49025
49177
|
addPointerEvent,
|
|
49026
49178
|
addPointerInfo,
|
|
49027
49179
|
addPropertyControls,
|
|
49028
49180
|
addScaleCorrector,
|
|
49181
|
+
addStyleValue,
|
|
49029
49182
|
addUniqueItem,
|
|
49030
49183
|
alpha,
|
|
49031
49184
|
analyseComplexValue,
|
|
@@ -49046,6 +49199,8 @@ export {
|
|
|
49046
49199
|
AnyInterpolation,
|
|
49047
49200
|
applyPxDefaults,
|
|
49048
49201
|
AsyncMotionValueAnimation,
|
|
49202
|
+
attachSpring,
|
|
49203
|
+
attrEffect,
|
|
49049
49204
|
AutomaticLayoutIds,
|
|
49050
49205
|
BackgroundImage,
|
|
49051
49206
|
backgroundImageFromProps,
|
|
@@ -49214,6 +49369,7 @@ export {
|
|
|
49214
49369
|
inferInitialRouteFromPath,
|
|
49215
49370
|
injectComponentCSSRules,
|
|
49216
49371
|
installFlexboxGapWorkaroundIfNeeded,
|
|
49372
|
+
Instance,
|
|
49217
49373
|
InternalID,
|
|
49218
49374
|
interpolate,
|
|
49219
49375
|
invariant,
|
|
@@ -49235,10 +49391,12 @@ export {
|
|
|
49235
49391
|
isFramerPageLink,
|
|
49236
49392
|
isGapEnabled,
|
|
49237
49393
|
isGenerator,
|
|
49394
|
+
isHTMLElement,
|
|
49238
49395
|
isMotionComponent,
|
|
49239
49396
|
isMotionValue2 as isMotionValue,
|
|
49240
49397
|
isNodeOrChild,
|
|
49241
49398
|
isNumericalString,
|
|
49399
|
+
isObject,
|
|
49242
49400
|
isOfAnnotatedType,
|
|
49243
49401
|
isOverride,
|
|
49244
49402
|
isPrimaryPointer,
|
|
@@ -49247,6 +49405,8 @@ export {
|
|
|
49247
49405
|
isShallowEqualArray,
|
|
49248
49406
|
isStaticRenderer,
|
|
49249
49407
|
isStraightCurve,
|
|
49408
|
+
isSVGElement,
|
|
49409
|
+
isSVGSVGElement,
|
|
49250
49410
|
isValidMotionProp,
|
|
49251
49411
|
isWaapiSupportedEasing,
|
|
49252
49412
|
isZeroValueString,
|
|
@@ -49341,6 +49501,7 @@ export {
|
|
|
49341
49501
|
print,
|
|
49342
49502
|
progress,
|
|
49343
49503
|
progressPercentage,
|
|
49504
|
+
propEffect,
|
|
49344
49505
|
PropertyOverrides2 as PropertyOverrides,
|
|
49345
49506
|
PropertyStore,
|
|
49346
49507
|
propsForLink,
|
|
@@ -49384,6 +49545,7 @@ export {
|
|
|
49384
49545
|
SmartComponentScopedContainer,
|
|
49385
49546
|
spring,
|
|
49386
49547
|
SpringAnimator,
|
|
49548
|
+
springValue,
|
|
49387
49549
|
SSRVariants,
|
|
49388
49550
|
Stack,
|
|
49389
49551
|
stagger,
|
|
@@ -49402,6 +49564,7 @@ export {
|
|
|
49402
49564
|
supportsPartialKeyframes,
|
|
49403
49565
|
supportsScrollTimeline,
|
|
49404
49566
|
SVG,
|
|
49567
|
+
svgEffect,
|
|
49405
49568
|
SwitchLayoutGroupContext,
|
|
49406
49569
|
sync,
|
|
49407
49570
|
systemFontFamilyName,
|