unframer 2.6.1 → 2.6.2
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/exporter.d.ts.map +1 -1
- package/dist/exporter.js +2 -1
- package/dist/exporter.js.map +1 -1
- package/dist/framer.d.ts.map +1 -1
- package/dist/framer.js +1272 -583
- package/dist/framer.js.map +1 -1
- package/esm/exporter.d.ts.map +1 -1
- package/esm/exporter.js +2 -1
- package/esm/exporter.js.map +1 -1
- package/esm/framer.d.ts.map +1 -1
- package/esm/framer.js +1257 -574
- package/esm/framer.js.map +1 -1
- package/package.json +1 -1
- package/src/exporter.ts +1 -0
- package/src/framer.js +1280 -574
package/dist/framer.js
CHANGED
|
@@ -48,13 +48,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
48
48
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
49
49
|
exports.ComponentViewportProvider = exports.ComponentPresetsProvider = exports.ComponentPresetsConsumer = exports.ComponentContainerContext = exports.complex = exports.combinedCSSRulesForPreview = exports.ColorMixModelType = exports.ColorFormat = exports.color = exports.Color = exports.collectVisualStyleFromProps = exports.clamp = exports.circOut = exports.circInOut = exports.circIn = exports.cancelSync = exports.cancelFrame = exports.callEach = exports.calculateRect = exports.calcLength = exports.buildTransform = exports.BoxShadow = exports.BezierAnimator = exports.backOut = exports.backInOut = exports.backIn = exports.backgroundImageFromProps = exports.BackgroundImage = exports.AutomaticLayoutIds = exports.AnyInterpolation = exports.anticipate = exports.annotateTypeOnStringify = exports.animations = exports.animationControls = exports.animateVisualElement = exports.animateValue = exports.AnimateSharedLayout = exports.AnimatePresence = exports.animate = exports.Animatable = exports.AnchorLinkTarget = exports.addScaleCorrector = exports.addPropertyControls = exports.addPointerInfo = exports.addPointerEvent = exports.addFonts = exports.addActionControls = exports.AcceleratedAnimation = exports._injectRuntime = exports.combinedCSSRules = void 0;
|
|
50
50
|
exports.environment = exports.EmptyState = exports.easeOut = exports.easeInOut = exports.easeIn = exports.Draggable = exports.DragControls = exports.domMax = exports.domAnimation = exports.DOM = exports.distance2D = exports.distance = exports.dispatchKeyDownEvent = exports.disableInstantTransitions = exports.DimensionType = exports.devicePresets = exports.DeviceCodeComponent = exports.Device = exports.LayoutGroupContext = exports.DeprecatedLayoutGroupContext = exports.DeprecatedFrameWithEvents = exports.DeprecatedComponentContainer = exports.delay = exports.degreesToRadians = exports.defaultDeviceProps = exports.debounce = exports.DataObserverContext = exports.DataObserver = exports.DataContext = exports.Data = exports.CycleVariantState = exports.cx = exports.CustomProperties = exports.CustomCursorHost = exports.cubicBezier = exports.cssBackgroundSize = exports.createScopedAnimate = exports.createMotionComponent = exports.createFramerPageLink = exports.createDomMotionComponent = exports.createData = exports.createBox = exports.convertPropsToDeviceOptions = exports.convertPresentationTree = exports.ConvertColor = exports.ControlType = exports.Container = exports.ConstraintValues = exports.constraintsEnabled = exports.ConstraintMask = void 0;
|
|
51
|
-
exports.
|
|
52
|
-
exports.
|
|
53
|
-
exports.
|
|
54
|
-
exports.
|
|
55
|
-
exports.
|
|
56
|
-
exports.wrap = exports.withVariantFX = exports.withVariantAppearEffect = exports.withStyleAppearEffect = exports.withShape = exports.withPath = exports.withParallaxTransform = exports.WithOverride = exports.withOpacity = exports.WithNavigator = exports.withMeasuredSize = exports.withMappedReactProps = exports.withInfiniteScroll = exports.withGeneratedLayoutId = exports.withFX = exports.withCSS = exports.WindowContext = exports.warning = exports.visualElementStore = exports.VisualElement = exports.version = exports.VectorGroup = exports.Vector = exports.VariantSelector = exports.valueToDimensionType = exports.ValueInterpolation = void 0;
|
|
57
|
-
// https :https://app.framerstatic.com/chunk-
|
|
51
|
+
exports.interpolate = exports.InternalID = exports.installFlexboxGapWorkaroundIfNeeded = exports.injectComponentCSSRules = exports.inferInitialRouteFromPath = exports.imageUrlForAsset = exports.imagePatternPropsForFill = exports.Image = exports.gradientForShape = exports.getWhereExpressionFromPathVariables = exports.getPropertyControls = exports.getMergedConstraintsProps = exports.getMeasurableCodeComponentChildren = exports.getFontsFromSharedStyle = exports.getFontsFromComponentPreset = exports.getFonts = exports.getDevicePreset = exports.getComponentSize = exports.GeneratedComponentContext = exports.GamepadContext = exports.FrameWithMotion = exports.FramerEventSession = exports.FramerEventListener = exports.FramerEvent = exports.framerCSSMarker = exports.framerAppearTransformTemplateToken = exports.framerAppearIdKey = exports.framerAppearEffects = exports.framerAppearAnimationScriptKey = exports.FramerAnimation = exports.frameFromElements = exports.frameFromElement = exports.frameData = exports.frame = exports.Frame = exports.fraction = exports.FormSelect = exports.FormPlainTextInput = exports.FormContainer = exports.FormBooleanInput = exports.forceLayerBackingWithCSSProperties = exports.fontStore = exports.FontSourceNames = exports.Floating = exports.FlatTree = exports.finiteNumber = exports.filterProps = exports.Fetcher = exports.executeInRenderEnvironment = exports.ErrorPlaceholder = void 0;
|
|
52
|
+
exports.MotionSetup = exports.MotionGlobalConfig = exports.MotionContext = exports.MotionConfigContext = exports.MotionConfig = exports.motion = exports.modulate = exports.mix = exports.mirrorEasing = exports.memoize = exports.markHydrationStart = exports.makeUseVisualState = exports.makePaddingString = exports.MainLoop = exports.m = exports.localShadowFrame = exports.localPackageFallbackIdentifier = exports.loadJSON = exports.loadFont = exports.Link = exports.LinearGradient = exports.Line = exports.LibraryFeaturesProvider = exports.LazyValue = exports.LazyMotion = exports.lazy = exports.LayoutIdContext = exports.LayoutGroup = exports.Layer = exports.isValidMotionProp = exports.isStraightCurve = exports.isShallowEqualArray = exports.isRelativeNumber = exports.isReactDefinition = exports.isOverride = exports.isOfAnnotatedType = exports.isMotionValue = exports.isMotionComponent = exports.isGapEnabled = exports.isFramerPageLink = exports.isFramerGamepadKeydownData = exports.isFractionDimension = exports.isFiniteNumber = exports.isEqual = exports.isDragActive = exports.isDesignDefinition = exports.isBrowser = exports.isAnimatable = exports.inView = exports.invariant = void 0;
|
|
53
|
+
exports.scroll = exports.Scroll = exports.roundWithOffset = exports.roundedNumberString = exports.roundedNumber = exports.RichText = exports.reverseEasing = exports.resolvePageScope = exports.resolveMotionValue = exports.ResolveLinks = exports.resolveLink = exports.Reorder = exports.RenderTarget = exports.removeHiddenBreakpointLayersV2 = exports.removeHiddenBreakpointLayers = exports.Rect = exports.RadialGradient = exports.QueryEngine = exports.px = exports.pushLoadMoreHistory = exports.propsForLink = exports.PropertyStore = exports.PropertyOverrides = exports.progress = exports.print = exports.PresenceContext = exports.Polygon = exports.Point = exports.pipe = exports.PathVariablesContext = exports.PathSegment = exports.pathDefaults = exports.parseFramerPageLink = exports.ParentSizeState = exports.PageRoot = exports.PageEffectsProvider = exports.Page = exports.paddingFromProps = exports.optimizedAppearDataAttribute = exports.optimizeAppearTransformTemplate = exports.optimizeAppear = exports.ObservableObject = exports.NotFoundError = exports.Navigation = exports.NavigationTransitionType = exports.NavigationConsumer = exports.NavigationCallbackProvider = exports.NavigateTo = exports.motionValue = exports.MotionValue = void 0;
|
|
54
|
+
exports.useElementScroll = exports.useDynamicRefs = exports.useDragControls = exports.useDomEvent = exports.useDataRecord = exports.useCycle = exports.useCustomCursors = exports.useCurrentRouteId = exports.useCurrentPathVariables = exports.useConstant = exports.useComponentViewport = exports.useBreakpointVariants = exports.useAnimationFrame = exports.useAnimationControls = exports.useAnimation = exports.useDeprecatedAnimatedState = exports.useAnimatedState = exports.useAnimate = exports.useAddVariantProps = exports.useActiveVariantCallback = exports.useActiveTargetCallback = exports.unwrapMotionComponent = exports.turnOffReactEventHandling = exports.transformTemplate = exports.transformString = exports.transform = exports.toSVGPath = exports.toJustifyOrAlignment = exports.toFlexDirection = exports.throttle = exports.Text = exports.systemFontFamilyName = exports.sync = exports.SwitchLayoutGroupContext = exports.SVG = exports.StyleSheetContext = exports.steps = exports.startOptimizedAppearAnimation = exports.startAnimation = exports.stagger = exports.Stack = exports.SSRVariants = exports.SpringAnimator = exports.spring = exports.Size = exports.shouldOpenLinkInNewTab = exports.sharedSVGManager = exports.Shadow = exports.setGlobalRenderEnvironment = exports.scrollInfo = void 0;
|
|
55
|
+
exports.useTransform = exports.useTime = exports.useSpring = exports.useScroll = exports.useRouter = exports.useRouteHandler = exports.useRouteElementId = exports.useRouteAnchor = exports.useRoute = exports.useResetProjection = exports.useRenderEnvironment = exports.useReducedMotionConfig = exports.useReducedMotion = exports.useQueryData = exports.useProvidedWindow = exports.usePrototypeNavigate = exports.usePresence = exports.usePreloadQuery = exports.usePrefetch = exports.usePageEffects = exports.useOverlayState = exports.useOnVariantChange = exports.useOnCurrentTargetChange = exports.useOnAppear = exports.useObserveData = exports.useNavigation = exports.useNavigate = exports.useMotionValueEvent = exports.useMotionValue = exports.useMotionTemplate = exports.useMeasureLayout = exports.useLocalizationInfo = exports.useLocaleInfo = exports.useLocaleCode = exports.useLocale = exports.useLoadMorePaginatedQuery = exports.useIsPresent = exports.useIsOnFramerCanvas = exports.useIsomorphicLayoutEffect = exports.useIsInCurrentNavigationTarget = exports.useInView = exports.useDeprecatedInvertedScale = exports.useInvertedScale = exports.useInstantTransition = exports.useInstantLayoutTransition = exports.useInitialRouteComponent = exports.useHydratedBreakpointVariants = exports.useHotkey = exports.useGamepad = exports.useForceUpdate = void 0;
|
|
56
|
+
exports.wrap = exports.withVariantFX = exports.withVariantAppearEffect = exports.withStyleAppearEffect = exports.withShape = exports.withPerformanceMarks = exports.withPath = exports.withParallaxTransform = exports.WithOverride = exports.withOpacity = exports.WithNavigator = exports.withMeasuredSize = exports.withMappedReactProps = exports.withInfiniteScroll = exports.withGeneratedLayoutId = exports.withFX = exports.withCSS = exports.WindowContext = exports.warning = exports.visualElementStore = exports.VisualElement = exports.version = exports.VectorGroup = exports.Vector = exports.VariantSelector = exports.valueToDimensionType = exports.ValueInterpolation = exports.useWillChange = exports.useViewportScroll = exports.useVelocity = exports.useVariantState = exports.useUnmountEffect = void 0;
|
|
57
|
+
// https :https://app.framerstatic.com/chunk-VBDYROES.js
|
|
58
58
|
const react_1 = require("react");
|
|
59
59
|
const react_2 = require("react");
|
|
60
60
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
@@ -196,9 +196,26 @@ var MotionGlobalConfig = {
|
|
|
196
196
|
useManualTiming: false,
|
|
197
197
|
};
|
|
198
198
|
exports.MotionGlobalConfig = MotionGlobalConfig;
|
|
199
|
-
var LayoutGroupContext = (0, react_1.createContext)({});
|
|
200
199
|
var SwitchLayoutGroupContext = (0, react_1.createContext)({});
|
|
201
200
|
exports.SwitchLayoutGroupContext = SwitchLayoutGroupContext;
|
|
201
|
+
var LayoutGroupContext = (0, react_1.createContext)({});
|
|
202
|
+
var noop = (any) => any;
|
|
203
|
+
var warning = noop;
|
|
204
|
+
exports.warning = warning;
|
|
205
|
+
var invariant = noop;
|
|
206
|
+
exports.invariant = invariant;
|
|
207
|
+
if (false) {
|
|
208
|
+
exports.warning = warning = (check, message) => {
|
|
209
|
+
if (!check && typeof console !== 'undefined') {
|
|
210
|
+
console.warn(message);
|
|
211
|
+
}
|
|
212
|
+
};
|
|
213
|
+
exports.invariant = invariant = (check, message) => {
|
|
214
|
+
if (!check) {
|
|
215
|
+
throw new Error(message);
|
|
216
|
+
}
|
|
217
|
+
};
|
|
218
|
+
}
|
|
202
219
|
var LazyContext = (0, react_1.createContext)({
|
|
203
220
|
strict: false,
|
|
204
221
|
});
|
|
@@ -353,7 +370,11 @@ function createRenderBatcher(scheduleNextBatch, allowKeepAlive) {
|
|
|
353
370
|
};
|
|
354
371
|
}
|
|
355
372
|
var { schedule: microtask, cancel: cancelMicrotask, } = createRenderBatcher(queueMicrotask, false);
|
|
356
|
-
function
|
|
373
|
+
function isRefObject(ref) {
|
|
374
|
+
return ref && typeof ref === 'object' && Object.prototype.hasOwnProperty.call(ref, 'current');
|
|
375
|
+
}
|
|
376
|
+
var scheduleHandoffComplete = false;
|
|
377
|
+
function useVisualElement(Component33, visualState, props, createVisualElement2, ProjectionNodeConstructor) {
|
|
357
378
|
const { visualElement: parent, } = (0, react_3.useContext)(MotionContext);
|
|
358
379
|
const lazyContext = (0, react_3.useContext)(LazyContext);
|
|
359
380
|
const presenceContext = (0, react_3.useContext)(PresenceContext);
|
|
@@ -371,6 +392,11 @@ function useVisualElement(Component33, visualState, props, createVisualElement2)
|
|
|
371
392
|
});
|
|
372
393
|
}
|
|
373
394
|
const visualElement = visualElementRef.current;
|
|
395
|
+
const initialLayoutGroupConfig = (0, react_3.useContext)(SwitchLayoutGroupContext);
|
|
396
|
+
if (visualElement && !visualElement.projection && ProjectionNodeConstructor &&
|
|
397
|
+
(visualElement.type === 'html' || visualElement.type === 'svg')) {
|
|
398
|
+
createProjectionNode(visualElementRef.current, props, ProjectionNodeConstructor, initialLayoutGroupConfig);
|
|
399
|
+
}
|
|
374
400
|
(0, react_4.useInsertionEffect)(() => {
|
|
375
401
|
visualElement && visualElement.update(props, presenceContext);
|
|
376
402
|
});
|
|
@@ -378,6 +404,7 @@ function useVisualElement(Component33, visualState, props, createVisualElement2)
|
|
|
378
404
|
useIsomorphicLayoutEffect(() => {
|
|
379
405
|
if (!visualElement)
|
|
380
406
|
return;
|
|
407
|
+
visualElement.updateFeatures();
|
|
381
408
|
microtask.render(visualElement.render);
|
|
382
409
|
if (wantsHandoff.current && visualElement.animationState) {
|
|
383
410
|
visualElement.animationState.animateChanges();
|
|
@@ -386,25 +413,58 @@ function useVisualElement(Component33, visualState, props, createVisualElement2)
|
|
|
386
413
|
(0, react_2.useEffect)(() => {
|
|
387
414
|
if (!visualElement)
|
|
388
415
|
return;
|
|
389
|
-
visualElement.updateFeatures();
|
|
390
416
|
if (!wantsHandoff.current && visualElement.animationState) {
|
|
391
417
|
visualElement.animationState.animateChanges();
|
|
392
418
|
}
|
|
393
419
|
if (wantsHandoff.current) {
|
|
394
420
|
wantsHandoff.current = false;
|
|
395
|
-
|
|
421
|
+
if (!scheduleHandoffComplete) {
|
|
422
|
+
scheduleHandoffComplete = true;
|
|
423
|
+
queueMicrotask(completeHandoff);
|
|
424
|
+
}
|
|
396
425
|
}
|
|
397
426
|
});
|
|
398
427
|
return visualElement;
|
|
399
428
|
}
|
|
400
|
-
function
|
|
401
|
-
|
|
429
|
+
function completeHandoff() {
|
|
430
|
+
window.HandoffComplete = true;
|
|
431
|
+
}
|
|
432
|
+
function createProjectionNode(visualElement, props, ProjectionNodeConstructor, initialPromotionConfig) {
|
|
433
|
+
const { layoutId, layout: layout2, drag: drag2, dragConstraints, layoutScroll, layoutRoot, } = props;
|
|
434
|
+
visualElement.projection = new ProjectionNodeConstructor(visualElement.latestValues, props['data-framer-portal-id'] ? void 0 : getClosestProjectingNode(visualElement.parent));
|
|
435
|
+
visualElement.projection.setOptions({
|
|
436
|
+
layoutId,
|
|
437
|
+
layout: layout2,
|
|
438
|
+
alwaysMeasureLayout: Boolean(drag2) || dragConstraints && isRefObject(dragConstraints),
|
|
439
|
+
visualElement,
|
|
440
|
+
scheduleRender: () => visualElement.scheduleRender(),
|
|
441
|
+
/**
|
|
442
|
+
* TODO: Update options in an effect. This could be tricky as it'll be too late
|
|
443
|
+
* to update by the time layout animations run.
|
|
444
|
+
* We also need to fix this safeToRemove by linking it up to the one returned by usePresence,
|
|
445
|
+
* ensuring it gets called if there's no potential layout animations.
|
|
446
|
+
*/
|
|
447
|
+
animationType: typeof layout2 === 'string' ? layout2 : 'both',
|
|
448
|
+
initialPromotionConfig,
|
|
449
|
+
layoutScroll,
|
|
450
|
+
layoutRoot,
|
|
451
|
+
});
|
|
452
|
+
}
|
|
453
|
+
function getClosestProjectingNode(visualElement) {
|
|
454
|
+
if (!visualElement)
|
|
455
|
+
return void 0;
|
|
456
|
+
return visualElement.options.allowProjection !== false ? visualElement.projection : getClosestProjectingNode(visualElement.parent);
|
|
402
457
|
}
|
|
403
458
|
function useMotionRef(visualState, visualElement, externalRef) {
|
|
404
459
|
return (0, react_5.useCallback)((instance) => {
|
|
405
460
|
instance && visualState.mount && visualState.mount(instance);
|
|
406
461
|
if (visualElement) {
|
|
407
|
-
|
|
462
|
+
if (instance) {
|
|
463
|
+
visualElement.mount(instance);
|
|
464
|
+
}
|
|
465
|
+
else {
|
|
466
|
+
visualElement.unmount();
|
|
467
|
+
}
|
|
408
468
|
}
|
|
409
469
|
if (externalRef) {
|
|
410
470
|
if (typeof externalRef === 'function') {
|
|
@@ -486,14 +546,10 @@ function createMotionComponent({ preloadedFeatures: preloadedFeatures2, createVi
|
|
|
486
546
|
const context = useCreateMotionContext(props);
|
|
487
547
|
const visualState = useVisualState2(props, isStatic);
|
|
488
548
|
if (!isStatic && isBrowser) {
|
|
489
|
-
|
|
490
|
-
const
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
MeasureLayout2 = context.visualElement.loadFeatures(
|
|
494
|
-
// Note: Pass the full new combined props to correctly re-render dynamic feature components.
|
|
495
|
-
configAndProps, isStrict, preloadedFeatures2, initialLayoutGroupConfig);
|
|
496
|
-
}
|
|
549
|
+
useStrictMode(configAndProps, preloadedFeatures2);
|
|
550
|
+
const layoutProjection = getProjectionFunctionality(configAndProps);
|
|
551
|
+
MeasureLayout2 = layoutProjection.MeasureLayout;
|
|
552
|
+
context.visualElement = useVisualElement(Component33, visualState, configAndProps, createVisualElement2, layoutProjection.ProjectionNode);
|
|
497
553
|
}
|
|
498
554
|
return (0, jsx_runtime_1.jsxs)(MotionContext.Provider, {
|
|
499
555
|
value: context,
|
|
@@ -514,6 +570,26 @@ function useLayoutId({ layoutId, }) {
|
|
|
514
570
|
const layoutGroupId = (0, react_3.useContext)(LayoutGroupContext).id;
|
|
515
571
|
return layoutGroupId && layoutId !== void 0 ? layoutGroupId + '-' + layoutId : layoutId;
|
|
516
572
|
}
|
|
573
|
+
function useStrictMode(configAndProps, preloadedFeatures2) {
|
|
574
|
+
const isStrict = (0, react_3.useContext)(LazyContext).strict;
|
|
575
|
+
if (false) {
|
|
576
|
+
const strictMessage = 'You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.';
|
|
577
|
+
configAndProps.ignoreStrict ? warning(false, strictMessage) : invariant(false, strictMessage);
|
|
578
|
+
}
|
|
579
|
+
}
|
|
580
|
+
function getProjectionFunctionality(props) {
|
|
581
|
+
const { drag: drag2, layout: layout2, } = featureDefinitions;
|
|
582
|
+
if (!drag2 && !layout2)
|
|
583
|
+
return {};
|
|
584
|
+
const combined = Object.assign(Object.assign({}, drag2), layout2);
|
|
585
|
+
return {
|
|
586
|
+
MeasureLayout: (drag2 === null || drag2 === void 0 ? void 0 : drag2.isEnabled(props)) ||
|
|
587
|
+
(layout2 === null || layout2 === void 0 ? void 0 : layout2.isEnabled(props))
|
|
588
|
+
? combined.MeasureLayout
|
|
589
|
+
: void 0,
|
|
590
|
+
ProjectionNode: combined.ProjectionNode,
|
|
591
|
+
};
|
|
592
|
+
}
|
|
517
593
|
var scaleCorrectors = {};
|
|
518
594
|
function addScaleCorrector(correctors) {
|
|
519
595
|
Object.assign(scaleCorrectors, correctors);
|
|
@@ -584,6 +660,9 @@ var singleColorRegex = /^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}
|
|
|
584
660
|
function isString(v) {
|
|
585
661
|
return typeof v === 'string';
|
|
586
662
|
}
|
|
663
|
+
function isNullish(v) {
|
|
664
|
+
return v == null;
|
|
665
|
+
}
|
|
587
666
|
var createUnitType = (unit) => ({
|
|
588
667
|
test: (v) => isString(v) && v.endsWith(unit) && v.split(' ').length === 1,
|
|
589
668
|
parse: parseFloat,
|
|
@@ -758,7 +837,6 @@ function makeLatestValues(props, context, presenceContext, scrapeMotionValues) {
|
|
|
758
837
|
}
|
|
759
838
|
return values;
|
|
760
839
|
}
|
|
761
|
-
var noop = (any) => any;
|
|
762
840
|
var { schedule: frame, cancel: cancelFrame, state: frameData, steps, } = createRenderBatcher(typeof requestAnimationFrame !== 'undefined' ? requestAnimationFrame : noop, true);
|
|
763
841
|
exports.frame = frame;
|
|
764
842
|
exports.cancelFrame = cancelFrame;
|
|
@@ -846,22 +924,6 @@ function isDragActive() {
|
|
|
846
924
|
return false;
|
|
847
925
|
}
|
|
848
926
|
exports.isDragActive = isDragActive;
|
|
849
|
-
var warning = noop;
|
|
850
|
-
exports.warning = warning;
|
|
851
|
-
var invariant = noop;
|
|
852
|
-
exports.invariant = invariant;
|
|
853
|
-
if (false) {
|
|
854
|
-
exports.warning = warning = (check, message) => {
|
|
855
|
-
if (!check && typeof console !== 'undefined') {
|
|
856
|
-
console.warn(message);
|
|
857
|
-
}
|
|
858
|
-
};
|
|
859
|
-
exports.invariant = invariant = (check, message) => {
|
|
860
|
-
if (!check) {
|
|
861
|
-
throw new Error(message);
|
|
862
|
-
}
|
|
863
|
-
};
|
|
864
|
-
}
|
|
865
927
|
var number = {
|
|
866
928
|
test: (v) => typeof v === 'number',
|
|
867
929
|
parse: parseFloat,
|
|
@@ -870,7 +932,8 @@ var number = {
|
|
|
870
932
|
var alpha = Object.assign(Object.assign({}, number), { transform: (v) => clamp(0, 1, v) });
|
|
871
933
|
var scale = Object.assign(Object.assign({}, number), { default: 1 });
|
|
872
934
|
var isColorString = (type, testProp) => (v) => {
|
|
873
|
-
return Boolean(isString(v) && singleColorRegex.test(v) && v.startsWith(type) ||
|
|
935
|
+
return Boolean(isString(v) && singleColorRegex.test(v) && v.startsWith(type) ||
|
|
936
|
+
testProp && !isNullish(v) && Object.prototype.hasOwnProperty.call(v, testProp));
|
|
874
937
|
};
|
|
875
938
|
var splitColor = (aName, bName, cName) => (v) => {
|
|
876
939
|
if (!isString(v))
|
|
@@ -2788,7 +2851,7 @@ var MotionValue = class {
|
|
|
2788
2851
|
* @internal
|
|
2789
2852
|
*/
|
|
2790
2853
|
constructor(init, options = {}) {
|
|
2791
|
-
this.version = '11.2.
|
|
2854
|
+
this.version = '11.2.13';
|
|
2792
2855
|
this.canTrackVelocity = null;
|
|
2793
2856
|
this.events = {};
|
|
2794
2857
|
this.updateAndNotify = (v, render = true) => {
|
|
@@ -3384,7 +3447,7 @@ function animateList(visualElement) {
|
|
|
3384
3447
|
}
|
|
3385
3448
|
function createAnimationState(visualElement) {
|
|
3386
3449
|
let animate22 = animateList(visualElement);
|
|
3387
|
-
|
|
3450
|
+
let state = createState();
|
|
3388
3451
|
let isInitialRender = true;
|
|
3389
3452
|
const buildResolvedTypeValues = (type) => (acc, definition) => {
|
|
3390
3453
|
var _a;
|
|
@@ -3535,6 +3598,10 @@ function createAnimationState(visualElement) {
|
|
|
3535
3598
|
setActive,
|
|
3536
3599
|
setAnimateFunction,
|
|
3537
3600
|
getState: () => state,
|
|
3601
|
+
reset: () => {
|
|
3602
|
+
state = createState();
|
|
3603
|
+
isInitialRender = true;
|
|
3604
|
+
},
|
|
3538
3605
|
};
|
|
3539
3606
|
}
|
|
3540
3607
|
function checkVariantsDidChange(prev, next) {
|
|
@@ -3584,9 +3651,8 @@ var AnimationFeature = class extends Feature {
|
|
|
3584
3651
|
}
|
|
3585
3652
|
updateAnimationControlsSubscription() {
|
|
3586
3653
|
const { animate: animate22, } = this.node.getProps();
|
|
3587
|
-
this.unmount();
|
|
3588
3654
|
if (isAnimationControls(animate22)) {
|
|
3589
|
-
this.
|
|
3655
|
+
this.unmountControls = animate22.subscribe(this.node);
|
|
3590
3656
|
}
|
|
3591
3657
|
}
|
|
3592
3658
|
/**
|
|
@@ -3602,7 +3668,11 @@ var AnimationFeature = class extends Feature {
|
|
|
3602
3668
|
this.updateAnimationControlsSubscription();
|
|
3603
3669
|
}
|
|
3604
3670
|
}
|
|
3605
|
-
unmount() {
|
|
3671
|
+
unmount() {
|
|
3672
|
+
var _a;
|
|
3673
|
+
this.node.animationState.reset();
|
|
3674
|
+
(_a = this.unmountControls) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
3675
|
+
}
|
|
3606
3676
|
};
|
|
3607
3677
|
var id = 0;
|
|
3608
3678
|
var ExitAnimationFeature = class extends Feature {
|
|
@@ -3789,7 +3859,7 @@ function updateMotionValuesFromProps(element, next, prev) {
|
|
|
3789
3859
|
willChange.add(key7);
|
|
3790
3860
|
}
|
|
3791
3861
|
if (false) {
|
|
3792
|
-
warnOnce(nextValue.version === '11.2.
|
|
3862
|
+
warnOnce(nextValue.version === '11.2.13', `Attempting to mix Framer Motion versions ${nextValue.version} with 11.2.13 may not work as expected.`);
|
|
3793
3863
|
}
|
|
3794
3864
|
}
|
|
3795
3865
|
else if (isMotionValue(prevValue)) {
|
|
@@ -3826,8 +3896,6 @@ function updateMotionValuesFromProps(element, next, prev) {
|
|
|
3826
3896
|
}
|
|
3827
3897
|
var valueTypes = [...dimensionValueTypes, color, complex,];
|
|
3828
3898
|
var findValueType = (v) => valueTypes.find(testValueType(v));
|
|
3829
|
-
var featureNames = Object.keys(featureDefinitions);
|
|
3830
|
-
var numFeatures = featureNames.length;
|
|
3831
3899
|
var propEventHandlers = [
|
|
3832
3900
|
'AnimationStart',
|
|
3833
3901
|
'AnimationComplete',
|
|
@@ -3838,11 +3906,6 @@ var propEventHandlers = [
|
|
|
3838
3906
|
'LayoutAnimationComplete',
|
|
3839
3907
|
];
|
|
3840
3908
|
var numVariantProps = variantProps.length;
|
|
3841
|
-
function getClosestProjectingNode(visualElement) {
|
|
3842
|
-
if (!visualElement)
|
|
3843
|
-
return void 0;
|
|
3844
|
-
return visualElement.options.allowProjection !== false ? visualElement.projection : getClosestProjectingNode(visualElement.parent);
|
|
3845
|
-
}
|
|
3846
3909
|
var VisualElement = class {
|
|
3847
3910
|
/**
|
|
3848
3911
|
* This method takes React props and returns found MotionValues. For example, HTML
|
|
@@ -3934,7 +3997,6 @@ var VisualElement = class {
|
|
|
3934
3997
|
this.update(this.props, this.presenceContext);
|
|
3935
3998
|
}
|
|
3936
3999
|
unmount() {
|
|
3937
|
-
var _a;
|
|
3938
4000
|
visualElementStore.delete(this.current);
|
|
3939
4001
|
this.projection && this.projection.unmount();
|
|
3940
4002
|
cancelFrame(this.notifyUpdate);
|
|
@@ -3946,7 +4008,11 @@ var VisualElement = class {
|
|
|
3946
4008
|
this.events[key7].clear();
|
|
3947
4009
|
}
|
|
3948
4010
|
for (const key7 in this.features) {
|
|
3949
|
-
|
|
4011
|
+
const feature = this.features[key7];
|
|
4012
|
+
if (feature) {
|
|
4013
|
+
feature.unmount();
|
|
4014
|
+
feature.isMounted = false;
|
|
4015
|
+
}
|
|
3950
4016
|
}
|
|
3951
4017
|
this.current = null;
|
|
3952
4018
|
}
|
|
@@ -3973,60 +4039,25 @@ var VisualElement = class {
|
|
|
3973
4039
|
}
|
|
3974
4040
|
return this.sortInstanceNodePosition(this.current, other.current);
|
|
3975
4041
|
}
|
|
3976
|
-
loadFeatures(_j, isStrict, preloadedFeatures2, initialLayoutGroupConfig) {
|
|
3977
|
-
var { children } = _j, renderedProps = __rest(_j, ["children"]);
|
|
3978
|
-
let ProjectionNodeConstructor;
|
|
3979
|
-
let MeasureLayout2;
|
|
3980
|
-
if (false) {
|
|
3981
|
-
const strictMessage = 'You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.';
|
|
3982
|
-
renderedProps.ignoreStrict ? warning(false, strictMessage) : invariant(false, strictMessage);
|
|
3983
|
-
}
|
|
3984
|
-
for (let i = 0; i < numFeatures; i++) {
|
|
3985
|
-
const name = featureNames[i];
|
|
3986
|
-
const { isEnabled, Feature: FeatureConstructor, ProjectionNode, MeasureLayout: MeasureLayoutComponent, } = featureDefinitions[name];
|
|
3987
|
-
if (ProjectionNode)
|
|
3988
|
-
ProjectionNodeConstructor = ProjectionNode;
|
|
3989
|
-
if (isEnabled(renderedProps)) {
|
|
3990
|
-
if (!this.features[name] && FeatureConstructor) {
|
|
3991
|
-
this.features[name] = new FeatureConstructor(this);
|
|
3992
|
-
}
|
|
3993
|
-
if (MeasureLayoutComponent) {
|
|
3994
|
-
MeasureLayout2 = MeasureLayoutComponent;
|
|
3995
|
-
}
|
|
3996
|
-
}
|
|
3997
|
-
}
|
|
3998
|
-
if ((this.type === 'html' || this.type === 'svg') && !this.projection && ProjectionNodeConstructor) {
|
|
3999
|
-
const { layoutId, layout: layout2, drag: drag2, dragConstraints, layoutScroll, layoutRoot, } = renderedProps;
|
|
4000
|
-
this.projection = new ProjectionNodeConstructor(this.latestValues, renderedProps['data-framer-portal-id'] ? void 0 : getClosestProjectingNode(this.parent));
|
|
4001
|
-
this.projection.setOptions({
|
|
4002
|
-
layoutId,
|
|
4003
|
-
layout: layout2,
|
|
4004
|
-
alwaysMeasureLayout: Boolean(drag2) || dragConstraints && isRefObject(dragConstraints),
|
|
4005
|
-
visualElement: this,
|
|
4006
|
-
scheduleRender: () => this.scheduleRender(),
|
|
4007
|
-
/**
|
|
4008
|
-
* TODO: Update options in an effect. This could be tricky as it'll be too late
|
|
4009
|
-
* to update by the time layout animations run.
|
|
4010
|
-
* We also need to fix this safeToRemove by linking it up to the one returned by usePresence,
|
|
4011
|
-
* ensuring it gets called if there's no potential layout animations.
|
|
4012
|
-
*/
|
|
4013
|
-
animationType: typeof layout2 === 'string' ? layout2 : 'both',
|
|
4014
|
-
initialPromotionConfig: initialLayoutGroupConfig,
|
|
4015
|
-
layoutScroll,
|
|
4016
|
-
layoutRoot,
|
|
4017
|
-
});
|
|
4018
|
-
}
|
|
4019
|
-
return MeasureLayout2;
|
|
4020
|
-
}
|
|
4021
4042
|
updateFeatures() {
|
|
4022
|
-
|
|
4023
|
-
|
|
4024
|
-
|
|
4025
|
-
|
|
4043
|
+
let key7 = 'animation';
|
|
4044
|
+
for (key7 in featureDefinitions) {
|
|
4045
|
+
const featureDefinition = featureDefinitions[key7];
|
|
4046
|
+
if (!featureDefinition)
|
|
4047
|
+
continue;
|
|
4048
|
+
const { isEnabled, Feature: FeatureConstructor, } = featureDefinition;
|
|
4049
|
+
if (!this.features[key7] && FeatureConstructor && isEnabled(this.props)) {
|
|
4050
|
+
this.features[key7] = new FeatureConstructor(this);
|
|
4026
4051
|
}
|
|
4027
|
-
|
|
4028
|
-
feature.
|
|
4029
|
-
feature.isMounted
|
|
4052
|
+
if (this.features[key7]) {
|
|
4053
|
+
const feature = this.features[key7];
|
|
4054
|
+
if (feature.isMounted) {
|
|
4055
|
+
feature.update();
|
|
4056
|
+
}
|
|
4057
|
+
else {
|
|
4058
|
+
feature.mount();
|
|
4059
|
+
feature.isMounted = true;
|
|
4060
|
+
}
|
|
4030
4061
|
}
|
|
4031
4062
|
}
|
|
4032
4063
|
}
|
|
@@ -5528,7 +5559,7 @@ var VisualElementDragControls = class {
|
|
|
5528
5559
|
});
|
|
5529
5560
|
const measureDragConstraints = () => {
|
|
5530
5561
|
const { dragConstraints, } = this.getProps();
|
|
5531
|
-
if (isRefObject(dragConstraints)) {
|
|
5562
|
+
if (isRefObject(dragConstraints) && dragConstraints.current) {
|
|
5532
5563
|
this.constraints = this.resolveRefConstraints();
|
|
5533
5564
|
}
|
|
5534
5565
|
};
|
|
@@ -5538,7 +5569,7 @@ var VisualElementDragControls = class {
|
|
|
5538
5569
|
projection.root && projection.root.updateScroll();
|
|
5539
5570
|
projection.updateLayout();
|
|
5540
5571
|
}
|
|
5541
|
-
measureDragConstraints
|
|
5572
|
+
frame.read(measureDragConstraints);
|
|
5542
5573
|
const stopResizeListener = addDomEvent(window, 'resize', () => this.scalePositionWithinConstraints());
|
|
5543
5574
|
const stopLayoutUpdateListener = projection.addEventListener('didUpdate', ({ delta, hasLayoutChanged, }) => {
|
|
5544
5575
|
if (this.isDragging && hasLayoutChanged) {
|
|
@@ -6073,7 +6104,7 @@ function isOptimisedAppearTree(projectionNode) {
|
|
|
6073
6104
|
return false;
|
|
6074
6105
|
}
|
|
6075
6106
|
}
|
|
6076
|
-
function
|
|
6107
|
+
function createProjectionNode2({ attachResizeListener, defaultParent, measureScroll, checkIsScrollRoot, resetTransform, }) {
|
|
6077
6108
|
return class ProjectionNode {
|
|
6078
6109
|
constructor(latestValues = {}, parent = defaultParent === null || defaultParent === void 0 ? void 0 : defaultParent()) {
|
|
6079
6110
|
this.id = id2++;
|
|
@@ -6100,6 +6131,7 @@ function createProjectionNode({ attachResizeListener, defaultParent, measureScro
|
|
|
6100
6131
|
this.eventHandlers = /* @__PURE__ */ new Map();
|
|
6101
6132
|
this.hasTreeAnimated = false;
|
|
6102
6133
|
this.updateScheduled = false;
|
|
6134
|
+
this.scheduleUpdate = () => this.update();
|
|
6103
6135
|
this.projectionUpdateScheduled = false;
|
|
6104
6136
|
this.checkUpdateFailed = () => {
|
|
6105
6137
|
if (this.isUpdating) {
|
|
@@ -6306,7 +6338,7 @@ function createProjectionNode({ attachResizeListener, defaultParent, measureScro
|
|
|
6306
6338
|
didUpdate() {
|
|
6307
6339
|
if (!this.updateScheduled) {
|
|
6308
6340
|
this.updateScheduled = true;
|
|
6309
|
-
microtask.read(
|
|
6341
|
+
microtask.read(this.scheduleUpdate);
|
|
6310
6342
|
}
|
|
6311
6343
|
}
|
|
6312
6344
|
clearAllSnapshots() {
|
|
@@ -6376,7 +6408,7 @@ function createProjectionNode({ attachResizeListener, defaultParent, measureScro
|
|
|
6376
6408
|
resetTransform() {
|
|
6377
6409
|
if (!resetTransform)
|
|
6378
6410
|
return;
|
|
6379
|
-
const isResetRequested = this.isLayoutDirty || this.shouldResetTransform;
|
|
6411
|
+
const isResetRequested = this.isLayoutDirty || this.shouldResetTransform || this.options.alwaysMeasureLayout;
|
|
6380
6412
|
const hasProjection = this.projectionDelta && !isDeltaZero(this.projectionDelta);
|
|
6381
6413
|
const transformTemplate2 = this.getTransformTemplate();
|
|
6382
6414
|
const transformTemplateValue = transformTemplate2 ? transformTemplate2(this.latestValues, '') : void 0;
|
|
@@ -7088,7 +7120,7 @@ function shouldAnimatePositionOnly(animationType, snapshot, layout2) {
|
|
|
7088
7120
|
return animationType === 'position' ||
|
|
7089
7121
|
animationType === 'preserve-aspect' && !isNear(aspectRatio(snapshot), aspectRatio(layout2), 0.2);
|
|
7090
7122
|
}
|
|
7091
|
-
var DocumentProjectionNode =
|
|
7123
|
+
var DocumentProjectionNode = createProjectionNode2({
|
|
7092
7124
|
attachResizeListener: (ref, notify2) => addDomEvent(ref, 'resize', notify2),
|
|
7093
7125
|
measureScroll: () => ({
|
|
7094
7126
|
x: document.documentElement.scrollLeft || document.body.scrollLeft,
|
|
@@ -7099,7 +7131,7 @@ var DocumentProjectionNode = createProjectionNode({
|
|
|
7099
7131
|
var rootProjectionNode = {
|
|
7100
7132
|
current: void 0,
|
|
7101
7133
|
};
|
|
7102
|
-
var HTMLProjectionNode =
|
|
7134
|
+
var HTMLProjectionNode = createProjectionNode2({
|
|
7103
7135
|
measureScroll: (instance) => ({
|
|
7104
7136
|
x: instance.scrollLeft,
|
|
7105
7137
|
y: instance.scrollTop,
|
|
@@ -9145,7 +9177,7 @@ var cancelSync = stepsOrder.reduce((acc, key7) => {
|
|
|
9145
9177
|
return acc;
|
|
9146
9178
|
}, {});
|
|
9147
9179
|
exports.cancelSync = cancelSync;
|
|
9148
|
-
// https :https://app.framerstatic.com/framer.
|
|
9180
|
+
// https :https://app.framerstatic.com/framer.E3XQPBSV.js
|
|
9149
9181
|
const react_12 = __importDefault(require("react"));
|
|
9150
9182
|
const react_13 = require("react");
|
|
9151
9183
|
const react_14 = require("react");
|
|
@@ -9828,16 +9860,16 @@ var require_browser = __commonJS({
|
|
|
9828
9860
|
process5.argv = [];
|
|
9829
9861
|
process5.version = '';
|
|
9830
9862
|
process5.versions = {};
|
|
9831
|
-
function
|
|
9832
|
-
process5.on =
|
|
9833
|
-
process5.addListener =
|
|
9834
|
-
process5.once =
|
|
9835
|
-
process5.off =
|
|
9836
|
-
process5.removeListener =
|
|
9837
|
-
process5.removeAllListeners =
|
|
9838
|
-
process5.emit =
|
|
9839
|
-
process5.prependListener =
|
|
9840
|
-
process5.prependOnceListener =
|
|
9863
|
+
function noop3() { }
|
|
9864
|
+
process5.on = noop3;
|
|
9865
|
+
process5.addListener = noop3;
|
|
9866
|
+
process5.once = noop3;
|
|
9867
|
+
process5.off = noop3;
|
|
9868
|
+
process5.removeListener = noop3;
|
|
9869
|
+
process5.removeAllListeners = noop3;
|
|
9870
|
+
process5.emit = noop3;
|
|
9871
|
+
process5.prependListener = noop3;
|
|
9872
|
+
process5.prependOnceListener = noop3;
|
|
9841
9873
|
process5.listeners = function (name) {
|
|
9842
9874
|
return [];
|
|
9843
9875
|
};
|
|
@@ -11105,25 +11137,47 @@ function getRouteElementId(route, hash2) {
|
|
|
11105
11137
|
return void 0;
|
|
11106
11138
|
}
|
|
11107
11139
|
function isBot(userAgent) {
|
|
11108
|
-
return /bot|
|
|
11140
|
+
return /bot|-google|google-|yandex|ia_archiver/iu.test(userAgent);
|
|
11109
11141
|
}
|
|
11110
|
-
function yieldToMain(
|
|
11142
|
+
function yieldToMain(options) {
|
|
11111
11143
|
if ('scheduler' in window) {
|
|
11112
|
-
const options = {
|
|
11113
|
-
priority: isHighPriority ? 'user-blocking' : 'user-visible',
|
|
11114
|
-
};
|
|
11115
11144
|
if ('yield' in scheduler)
|
|
11116
11145
|
return scheduler.yield(options);
|
|
11117
11146
|
if ('postTask' in scheduler)
|
|
11118
11147
|
return scheduler.postTask(() => { }, options);
|
|
11119
11148
|
}
|
|
11120
|
-
if (
|
|
11149
|
+
if ((options === null || options === void 0 ? void 0 : options.priority) === 'user-blocking') {
|
|
11121
11150
|
return Promise.resolve();
|
|
11122
11151
|
}
|
|
11123
11152
|
return new Promise((resolve) => {
|
|
11124
|
-
setTimeout(resolve
|
|
11153
|
+
setTimeout(resolve);
|
|
11125
11154
|
});
|
|
11126
11155
|
}
|
|
11156
|
+
function yieldBefore(fn, options) {
|
|
11157
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
11158
|
+
yield yieldToMain(options);
|
|
11159
|
+
return fn();
|
|
11160
|
+
});
|
|
11161
|
+
}
|
|
11162
|
+
function interactionResponse(options, fallback = true) {
|
|
11163
|
+
return new Promise((resolve) => {
|
|
11164
|
+
if (fallback)
|
|
11165
|
+
setTimeout(resolve, 100);
|
|
11166
|
+
requestAnimationFrame(() => {
|
|
11167
|
+
void yieldBefore(resolve, options);
|
|
11168
|
+
});
|
|
11169
|
+
});
|
|
11170
|
+
}
|
|
11171
|
+
function useAfterPaintEffect(fn, deps, options) {
|
|
11172
|
+
(0, react_2.useLayoutEffect)(() => {
|
|
11173
|
+
const runAfterPaint = () => __awaiter(this, void 0, void 0, function* () {
|
|
11174
|
+
yield interactionResponse(options, false);
|
|
11175
|
+
fn();
|
|
11176
|
+
});
|
|
11177
|
+
void runAfterPaint();
|
|
11178
|
+
}, deps);
|
|
11179
|
+
}
|
|
11180
|
+
var noop2 = () => { };
|
|
11127
11181
|
function replacePathVariables(path, currentLocale, nextLocale, defaultLocale, collectionId, pathVariables, collectionUtils) {
|
|
11128
11182
|
return __awaiter(this, void 0, void 0, function* () {
|
|
11129
11183
|
var _a, _b, _c;
|
|
@@ -11516,24 +11570,52 @@ function createViewTransitionStylesheet({ exit = defaultPageTransition, enter, }
|
|
|
11516
11570
|
document.head.appendChild(styleElement);
|
|
11517
11571
|
}
|
|
11518
11572
|
function removeViewTransitionStylesheet() {
|
|
11519
|
-
|
|
11520
|
-
|
|
11521
|
-
|
|
11522
|
-
document.
|
|
11523
|
-
|
|
11573
|
+
requestIdleCallback(() => {
|
|
11574
|
+
frame.render(() => {
|
|
11575
|
+
performance.mark('framer-vt-remove');
|
|
11576
|
+
const element = document.getElementById(VIEW_TRANSITION_STYLES_ID);
|
|
11577
|
+
if (element) {
|
|
11578
|
+
document.head.removeChild(element);
|
|
11579
|
+
}
|
|
11580
|
+
});
|
|
11524
11581
|
});
|
|
11525
11582
|
}
|
|
11526
11583
|
function supportsViewTransitions() {
|
|
11527
11584
|
return Boolean(document.startViewTransition);
|
|
11528
11585
|
}
|
|
11529
|
-
function
|
|
11530
|
-
|
|
11531
|
-
|
|
11532
|
-
|
|
11533
|
-
|
|
11534
|
-
|
|
11535
|
-
|
|
11536
|
-
|
|
11586
|
+
function addVTStylesheetAfterInRender(effect) {
|
|
11587
|
+
return new Promise((resolve) => {
|
|
11588
|
+
frame.render(() => {
|
|
11589
|
+
performance.mark('framer-vt-style');
|
|
11590
|
+
createViewTransitionStylesheet(effect);
|
|
11591
|
+
resolve();
|
|
11592
|
+
});
|
|
11593
|
+
});
|
|
11594
|
+
}
|
|
11595
|
+
function startViewTransition(updateView, effect, signal) {
|
|
11596
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
11597
|
+
if (!supportsViewTransitions()) {
|
|
11598
|
+
void updateView();
|
|
11599
|
+
return;
|
|
11600
|
+
}
|
|
11601
|
+
yield addVTStylesheetAfterInRender(effect);
|
|
11602
|
+
if (signal === null || signal === void 0 ? void 0 : signal.aborted)
|
|
11603
|
+
return;
|
|
11604
|
+
performance.mark('framer-vt');
|
|
11605
|
+
const transition = document.startViewTransition(() => {
|
|
11606
|
+
performance.mark('framer-vt-freeze');
|
|
11607
|
+
if (signal === null || signal === void 0 ? void 0 : signal.aborted)
|
|
11608
|
+
return;
|
|
11609
|
+
else
|
|
11610
|
+
signal === null || signal === void 0 ? void 0 : signal.addEventListener('abort', () => transition.skipTransition());
|
|
11611
|
+
void updateView();
|
|
11612
|
+
});
|
|
11613
|
+
Promise.all([transition.ready, transition.finished,]).then(() => {
|
|
11614
|
+
performance.mark('framer-vt-unfreeze');
|
|
11615
|
+
removeViewTransitionStylesheet();
|
|
11616
|
+
}).catch(() => { });
|
|
11617
|
+
return transition;
|
|
11618
|
+
});
|
|
11537
11619
|
}
|
|
11538
11620
|
function useViewTransition() {
|
|
11539
11621
|
const sitePageEffects = usePageEffects();
|
|
@@ -11544,7 +11626,7 @@ function useViewTransition() {
|
|
|
11544
11626
|
resolveHasPainted.current = void 0;
|
|
11545
11627
|
}
|
|
11546
11628
|
});
|
|
11547
|
-
return (0, react_5.useCallback)((currentRouteId, nextRouteId, update) => {
|
|
11629
|
+
return (0, react_5.useCallback)((currentRouteId, nextRouteId, update, yieldBeforeFreezePeriod, signal) => {
|
|
11548
11630
|
const pageEffect = getPageEffectForRoute(currentRouteId, nextRouteId, sitePageEffects);
|
|
11549
11631
|
if (pageEffect) {
|
|
11550
11632
|
const hasPainted = new Promise((resolve) => {
|
|
@@ -11554,6 +11636,15 @@ function useViewTransition() {
|
|
|
11554
11636
|
update();
|
|
11555
11637
|
yield hasPainted;
|
|
11556
11638
|
});
|
|
11639
|
+
const yieldBeforeViewTransition = () => __awaiter(this, void 0, void 0, function* () {
|
|
11640
|
+
yield interactionResponse({
|
|
11641
|
+
priority: 'user-blocking',
|
|
11642
|
+
signal,
|
|
11643
|
+
}, false).catch(noop2);
|
|
11644
|
+
return startViewTransition(asyncUpdate, pageEffect, signal);
|
|
11645
|
+
});
|
|
11646
|
+
if (yieldBeforeFreezePeriod)
|
|
11647
|
+
return yieldBeforeViewTransition();
|
|
11557
11648
|
return startViewTransition(asyncUpdate, pageEffect);
|
|
11558
11649
|
}
|
|
11559
11650
|
else {
|
|
@@ -11561,47 +11652,62 @@ function useViewTransition() {
|
|
|
11561
11652
|
}
|
|
11562
11653
|
}, [sitePageEffects,]);
|
|
11563
11654
|
}
|
|
11564
|
-
function pushRouteState(
|
|
11565
|
-
|
|
11566
|
-
|
|
11567
|
-
|
|
11568
|
-
|
|
11569
|
-
|
|
11570
|
-
|
|
11571
|
-
|
|
11572
|
-
|
|
11573
|
-
|
|
11574
|
-
|
|
11575
|
-
|
|
11576
|
-
|
|
11577
|
-
|
|
11578
|
-
|
|
11579
|
-
|
|
11580
|
-
|
|
11581
|
-
|
|
11582
|
-
|
|
11583
|
-
|
|
11655
|
+
function pushRouteState(routeId_1, route_1, _j) {
|
|
11656
|
+
return __awaiter(this, arguments, void 0, function* (routeId, route, { currentRoutePath, currentPathVariables, hash: hash2, pathVariables, localeId, preserveQueryParams, }, enableAsyncURLUpdate = false, ignorePushStateWrapper = false) {
|
|
11657
|
+
const { path, } = route;
|
|
11658
|
+
if (!path)
|
|
11659
|
+
return;
|
|
11660
|
+
try {
|
|
11661
|
+
const newPath = getPathForRoute(route, {
|
|
11662
|
+
currentRoutePath,
|
|
11663
|
+
currentPathVariables,
|
|
11664
|
+
hash: hash2,
|
|
11665
|
+
pathVariables,
|
|
11666
|
+
preserveQueryParams,
|
|
11667
|
+
});
|
|
11668
|
+
const urlUpdatePromise = pushHistoryState({
|
|
11669
|
+
routeId,
|
|
11670
|
+
hash: hash2,
|
|
11671
|
+
pathVariables,
|
|
11672
|
+
localeId,
|
|
11673
|
+
}, newPath, enableAsyncURLUpdate, ignorePushStateWrapper);
|
|
11674
|
+
if (!enableAsyncURLUpdate)
|
|
11675
|
+
yield urlUpdatePromise;
|
|
11676
|
+
}
|
|
11677
|
+
catch (_k) { }
|
|
11678
|
+
});
|
|
11584
11679
|
}
|
|
11585
11680
|
function isHistoryState(data2) {
|
|
11586
11681
|
const routeIdKey = 'routeId';
|
|
11587
11682
|
return isObject(data2) && isString2(data2[routeIdKey]);
|
|
11588
11683
|
}
|
|
11589
11684
|
function replaceHistoryState(data2, url) {
|
|
11685
|
+
performance.mark('framer-history-replace');
|
|
11590
11686
|
window.history.replaceState(data2,
|
|
11591
11687
|
// Second arg is unused and exists for historical purposes only
|
|
11592
11688
|
// https://developer.mozilla.org/en-US/docs/Web/API/History/replaceState#unused
|
|
11593
11689
|
'', url);
|
|
11594
11690
|
}
|
|
11595
|
-
function pushHistoryState(
|
|
11596
|
-
|
|
11597
|
-
|
|
11598
|
-
|
|
11599
|
-
|
|
11691
|
+
function pushHistoryState(data2_1, url_1) {
|
|
11692
|
+
return __awaiter(this, arguments, void 0, function* (data2, url, awaitPaintBeforeUpdate = false, ignorePushStateWrapper = false) {
|
|
11693
|
+
if (awaitPaintBeforeUpdate) {
|
|
11694
|
+
yield interactionResponse({
|
|
11695
|
+
priority: 'user-blocking',
|
|
11696
|
+
});
|
|
11697
|
+
}
|
|
11698
|
+
performance.mark('framer-history-push');
|
|
11699
|
+
const pushState = ignorePushStateWrapper ? window.history.__proto__.pushState : window.history.pushState;
|
|
11700
|
+
pushState.call(window.history, data2,
|
|
11701
|
+
// Second arg is unused and exists for historical purposes only
|
|
11702
|
+
// https://developer.mozilla.org/en-US/docs/Web/API/History/pushState#unused
|
|
11703
|
+
'', url);
|
|
11704
|
+
});
|
|
11600
11705
|
}
|
|
11601
11706
|
function useReplaceInitialState({ disabled, routeId, initialPathVariables, initialLocaleId, }) {
|
|
11602
|
-
|
|
11707
|
+
(0, react_2.useLayoutEffect)(() => {
|
|
11603
11708
|
if (disabled)
|
|
11604
11709
|
return;
|
|
11710
|
+
performance.mark('framer-history-set-initial-state');
|
|
11605
11711
|
replaceHistoryState({
|
|
11606
11712
|
routeId,
|
|
11607
11713
|
pathVariables: initialPathVariables,
|
|
@@ -11611,8 +11717,8 @@ function useReplaceInitialState({ disabled, routeId, initialPathVariables, initi
|
|
|
11611
11717
|
}
|
|
11612
11718
|
function usePopStateHandler(currentRouteId, setCurrentRouteId) {
|
|
11613
11719
|
const startViewTransition2 = useViewTransition();
|
|
11614
|
-
const viewTransitionReady =
|
|
11615
|
-
const popStateHandler =
|
|
11720
|
+
const viewTransitionReady = (0, react_4.useRef)(void 0);
|
|
11721
|
+
const popStateHandler = (0, react_5.useCallback)((_j) => __awaiter(this, [_j], void 0, function* ({ state, }) {
|
|
11616
11722
|
var _a, _b, _c;
|
|
11617
11723
|
if (!isObject(state))
|
|
11618
11724
|
return;
|
|
@@ -11622,14 +11728,14 @@ function usePopStateHandler(currentRouteId, setCurrentRouteId) {
|
|
|
11622
11728
|
const changeRoute = () => {
|
|
11623
11729
|
setCurrentRouteId(routeId, isString2(localeId) ? localeId : void 0, isString2(hash2) ? hash2 : void 0, isObject(pathVariables) ? pathVariables : void 0, false, true);
|
|
11624
11730
|
};
|
|
11625
|
-
const transition = startViewTransition2(currentRouteId.current, routeId, changeRoute);
|
|
11731
|
+
const transition = yield startViewTransition2(currentRouteId.current, routeId, changeRoute, false);
|
|
11626
11732
|
if (transition) {
|
|
11627
11733
|
void transition.updateCallbackDone.then((_a = viewTransitionReady.current) === null || _a === void 0 ? void 0 : _a.resolve).catch((_b = viewTransitionReady.current) === null || _b === void 0 ? void 0 : _b.reject);
|
|
11628
11734
|
}
|
|
11629
11735
|
else {
|
|
11630
11736
|
(_c = viewTransitionReady.current) === null || _c === void 0 ? void 0 : _c.resolve();
|
|
11631
11737
|
}
|
|
11632
|
-
}, [currentRouteId, setCurrentRouteId, startViewTransition2,]);
|
|
11738
|
+
}), [currentRouteId, setCurrentRouteId, startViewTransition2,]);
|
|
11633
11739
|
const traversalHandler = (0, react_5.useCallback)((event) => {
|
|
11634
11740
|
if (event.navigationType !== 'traverse')
|
|
11635
11741
|
return;
|
|
@@ -11647,7 +11753,7 @@ function usePopStateHandler(currentRouteId, setCurrentRouteId) {
|
|
|
11647
11753
|
scroll: 'after-transition',
|
|
11648
11754
|
});
|
|
11649
11755
|
}, []);
|
|
11650
|
-
|
|
11756
|
+
(0, react_2.useEffect)(() => {
|
|
11651
11757
|
var _a;
|
|
11652
11758
|
window.addEventListener('popstate', popStateHandler);
|
|
11653
11759
|
(_a = window.navigation) === null || _a === void 0 ? void 0 : _a.addEventListener('navigate', traversalHandler);
|
|
@@ -11720,9 +11826,9 @@ function switchLocale(options) {
|
|
|
11720
11826
|
try {
|
|
11721
11827
|
localStorage.setItem('preferredLocale', options.nextLocale.code);
|
|
11722
11828
|
}
|
|
11723
|
-
catch (
|
|
11829
|
+
catch (_j) { }
|
|
11724
11830
|
try {
|
|
11725
|
-
if (
|
|
11831
|
+
if (!isString2(result.path)) {
|
|
11726
11832
|
throw new Error('Expected result.path to be a string');
|
|
11727
11833
|
}
|
|
11728
11834
|
if (result.isMissingInLocale) {
|
|
@@ -11730,14 +11836,8 @@ function switchLocale(options) {
|
|
|
11730
11836
|
if (hasRedirect)
|
|
11731
11837
|
return;
|
|
11732
11838
|
}
|
|
11733
|
-
pushHistoryState({
|
|
11734
|
-
routeId: options.routeId,
|
|
11735
|
-
pathVariables: result.pathVariables,
|
|
11736
|
-
localeId: options.nextLocale.id,
|
|
11737
|
-
paginationInfo: window.history.state.paginationInfo,
|
|
11738
|
-
}, result.path);
|
|
11739
11839
|
}
|
|
11740
|
-
catch (
|
|
11840
|
+
catch (_k) { }
|
|
11741
11841
|
return result;
|
|
11742
11842
|
});
|
|
11743
11843
|
}
|
|
@@ -11752,16 +11852,194 @@ function pushLoadMoreHistory(hash2, paginationInfo) {
|
|
|
11752
11852
|
catch (_j) { }
|
|
11753
11853
|
}
|
|
11754
11854
|
exports.pushLoadMoreHistory = pushLoadMoreHistory;
|
|
11755
|
-
function
|
|
11756
|
-
|
|
11757
|
-
|
|
11758
|
-
|
|
11759
|
-
|
|
11760
|
-
|
|
11761
|
-
|
|
11762
|
-
|
|
11763
|
-
|
|
11855
|
+
function useNativeLoadingSpinner() {
|
|
11856
|
+
const navigationPromise = (0, react_4.useRef)(Promise.resolve());
|
|
11857
|
+
const navigationController = (0, react_4.useRef)();
|
|
11858
|
+
const navigateListener = (0, react_5.useCallback)((navigateEvent) => {
|
|
11859
|
+
if (
|
|
11860
|
+
// we want to intercept non-user triggered replaceState and pushState while the navigation is on-going
|
|
11861
|
+
// but we don't want to intercept e.g. 'traverse' (= browser back/forward) events, as we do this in the usePopStateHandler listener.
|
|
11862
|
+
navigateEvent.userInitiated)
|
|
11863
|
+
return;
|
|
11864
|
+
const controller = navigationController.current;
|
|
11865
|
+
controller === null || controller === void 0 ? void 0 : controller.signal.addEventListener('abort', () => {
|
|
11866
|
+
controller.abort('user aborted');
|
|
11867
|
+
});
|
|
11868
|
+
navigateEvent.intercept({
|
|
11869
|
+
handler: () => navigationPromise.current,
|
|
11870
|
+
});
|
|
11871
|
+
}, []);
|
|
11872
|
+
return (0, react_5.useCallback)((promise, updateURL, controller) => {
|
|
11873
|
+
if (!window.navigation) {
|
|
11874
|
+
void updateURL();
|
|
11875
|
+
return;
|
|
11876
|
+
}
|
|
11877
|
+
navigationPromise.current = promise;
|
|
11878
|
+
navigationController.current = controller;
|
|
11879
|
+
window.navigation.addEventListener('navigate', navigateListener);
|
|
11880
|
+
void updateURL(true);
|
|
11881
|
+
promise.catch(noop2).finally(() => {
|
|
11882
|
+
window.navigation.removeEventListener('navigate', navigateListener);
|
|
11883
|
+
});
|
|
11884
|
+
}, [navigateListener,]);
|
|
11885
|
+
}
|
|
11886
|
+
function measureSafe(name, start, end) {
|
|
11887
|
+
try {
|
|
11888
|
+
performance.measure(name, start, end);
|
|
11889
|
+
}
|
|
11890
|
+
catch (e) {
|
|
11891
|
+
console.warn(`Could not measure ${name}`, e);
|
|
11892
|
+
}
|
|
11893
|
+
}
|
|
11894
|
+
var shouldMark = false;
|
|
11895
|
+
function markHydrationStart() {
|
|
11896
|
+
shouldMark = true;
|
|
11897
|
+
performance.mark('framer-hydration-start');
|
|
11764
11898
|
}
|
|
11899
|
+
exports.markHydrationStart = markHydrationStart;
|
|
11900
|
+
var routerHydrationInsertionEffectStartHasRun = false;
|
|
11901
|
+
var routerHydrationLayoutEffectStartHasRun = false;
|
|
11902
|
+
var routerHydrationEffectStartHasRun = false;
|
|
11903
|
+
function useMarkRouterEffects() {
|
|
11904
|
+
const hydrationMarkPrefix = 'framer-hydration-router';
|
|
11905
|
+
(0, react_4.useInsertionEffect)(() => {
|
|
11906
|
+
if (routerHydrationInsertionEffectStartHasRun || !shouldMark)
|
|
11907
|
+
return;
|
|
11908
|
+
routerHydrationInsertionEffectStartHasRun = true;
|
|
11909
|
+
performance.mark(`${hydrationMarkPrefix}-insertion-effect`);
|
|
11910
|
+
}, []);
|
|
11911
|
+
(0, react_2.useLayoutEffect)(() => {
|
|
11912
|
+
if (routerHydrationLayoutEffectStartHasRun || !shouldMark)
|
|
11913
|
+
return;
|
|
11914
|
+
routerHydrationLayoutEffectStartHasRun = true;
|
|
11915
|
+
performance.mark(`${hydrationMarkPrefix}-layout-effect`);
|
|
11916
|
+
}, []);
|
|
11917
|
+
(0, react_2.useEffect)(() => {
|
|
11918
|
+
if (routerHydrationEffectStartHasRun || !shouldMark)
|
|
11919
|
+
return;
|
|
11920
|
+
routerHydrationEffectStartHasRun = true;
|
|
11921
|
+
performance.mark(`${hydrationMarkPrefix}-effect`);
|
|
11922
|
+
}, []);
|
|
11923
|
+
}
|
|
11924
|
+
var hydrationInsertionEffectStartHasRun = false;
|
|
11925
|
+
var hydrationLayoutEffectStartHasRun = false;
|
|
11926
|
+
var hydrationEffectStartHasRun = false;
|
|
11927
|
+
function useMarkSuspenseEffectsStart() {
|
|
11928
|
+
const hydrationMarkPrefix = 'framer-hydration-';
|
|
11929
|
+
const hydrationLayoutEffectsEnd = `${hydrationMarkPrefix}layout-effects-end`;
|
|
11930
|
+
const hydrationEffectsEnd = `${hydrationMarkPrefix}effects-end`;
|
|
11931
|
+
const hydrationBrowserRenderStart = `${hydrationMarkPrefix}browser-render-start`;
|
|
11932
|
+
const hydrationRenderEnd = `${hydrationMarkPrefix}render-end`;
|
|
11933
|
+
(0, react_4.useInsertionEffect)(() => {
|
|
11934
|
+
if (hydrationInsertionEffectStartHasRun || !shouldMark)
|
|
11935
|
+
return;
|
|
11936
|
+
hydrationInsertionEffectStartHasRun = true;
|
|
11937
|
+
performance.mark(hydrationRenderEnd);
|
|
11938
|
+
measureSafe(`${hydrationMarkPrefix}render`, `${hydrationMarkPrefix}start`, hydrationRenderEnd);
|
|
11939
|
+
performance.mark(`${hydrationMarkPrefix}insertion-effects-start`);
|
|
11940
|
+
}, []);
|
|
11941
|
+
(0, react_2.useLayoutEffect)(() => {
|
|
11942
|
+
if (hydrationLayoutEffectStartHasRun || !shouldMark)
|
|
11943
|
+
return;
|
|
11944
|
+
hydrationLayoutEffectStartHasRun = true;
|
|
11945
|
+
performance.mark(`${hydrationMarkPrefix}layout-effects-start`);
|
|
11946
|
+
requestAnimationFrame(() => {
|
|
11947
|
+
var _a, _b, _c;
|
|
11948
|
+
performance.mark(hydrationBrowserRenderStart);
|
|
11949
|
+
measureSafe(`${hydrationMarkPrefix}uho`, (_b = (_a = performance.getEntriesByName(hydrationEffectsEnd)[0]) === null || _a === void 0 ? void 0 : _a.name) !== null &&
|
|
11950
|
+
_b !== void 0
|
|
11951
|
+
? _b
|
|
11952
|
+
: (_c = performance.getEntriesByName(hydrationLayoutEffectsEnd)[0]) === null || _c === void 0
|
|
11953
|
+
? void 0
|
|
11954
|
+
: _c.name, hydrationBrowserRenderStart);
|
|
11955
|
+
});
|
|
11956
|
+
}, []);
|
|
11957
|
+
(0, react_2.useEffect)(() => {
|
|
11958
|
+
var _a;
|
|
11959
|
+
if (hydrationEffectStartHasRun || !shouldMark)
|
|
11960
|
+
return;
|
|
11961
|
+
hydrationEffectStartHasRun = true;
|
|
11962
|
+
const hydrationEffectsStart = `${hydrationMarkPrefix}effects-start`;
|
|
11963
|
+
performance.mark(hydrationEffectsStart);
|
|
11964
|
+
const hasPaintStarted = (_a = performance.getEntriesByName(hydrationBrowserRenderStart)[0]) === null || _a === void 0
|
|
11965
|
+
? void 0
|
|
11966
|
+
: _a.name;
|
|
11967
|
+
if (!hasPaintStarted) {
|
|
11968
|
+
measureSafe(`${hydrationMarkPrefix}commit`, hydrationLayoutEffectsEnd, hydrationEffectsStart);
|
|
11969
|
+
performance.mark(`${hydrationMarkPrefix}effects-sync`);
|
|
11970
|
+
}
|
|
11971
|
+
}, []);
|
|
11972
|
+
return null;
|
|
11973
|
+
}
|
|
11974
|
+
var hydrationInsertionEffectHasRun = false;
|
|
11975
|
+
var hydrationLayoutEffectHasRun = false;
|
|
11976
|
+
var hydrationEffectHasRun = false;
|
|
11977
|
+
var hydrationPaintEffectHasRun = false;
|
|
11978
|
+
function useMarkSuspenseEffectEnd() {
|
|
11979
|
+
const hydrationMarkPrefix = 'framer-hydration-';
|
|
11980
|
+
const hydrationLayoutEffectsEnd = `${hydrationMarkPrefix}layout-effects-end`;
|
|
11981
|
+
const hydrationEffectsEnd = `${hydrationMarkPrefix}effects-end`;
|
|
11982
|
+
const hydrationBrowserRenderStart = `${hydrationMarkPrefix}browser-render-start`;
|
|
11983
|
+
const hydrationStart = `${hydrationMarkPrefix}start`;
|
|
11984
|
+
const hydrationInsertionEffectsEnd = `${hydrationMarkPrefix}insertion-effects-end`;
|
|
11985
|
+
const hydrationFP = `${hydrationMarkPrefix}first-paint`;
|
|
11986
|
+
const hydrationAnimationFrameEnd = `${hydrationMarkPrefix}browser-raf-end`;
|
|
11987
|
+
(0, react_4.useInsertionEffect)(() => {
|
|
11988
|
+
if (hydrationInsertionEffectHasRun || !shouldMark)
|
|
11989
|
+
return;
|
|
11990
|
+
hydrationInsertionEffectHasRun = true;
|
|
11991
|
+
performance.mark(hydrationInsertionEffectsEnd);
|
|
11992
|
+
measureSafe(`${hydrationMarkPrefix}insertion-effects`, `${hydrationMarkPrefix}insertion-effects-start`, hydrationInsertionEffectsEnd);
|
|
11993
|
+
}, []);
|
|
11994
|
+
(0, react_2.useLayoutEffect)(() => {
|
|
11995
|
+
if (hydrationLayoutEffectHasRun || !shouldMark)
|
|
11996
|
+
return;
|
|
11997
|
+
hydrationLayoutEffectHasRun = true;
|
|
11998
|
+
performance.mark(hydrationLayoutEffectsEnd);
|
|
11999
|
+
measureSafe(`${hydrationMarkPrefix}layout-effects`, `${hydrationMarkPrefix}layout-effects-start`, hydrationLayoutEffectsEnd);
|
|
12000
|
+
requestAnimationFrame(() => {
|
|
12001
|
+
performance.mark(hydrationAnimationFrameEnd);
|
|
12002
|
+
measureSafe(`${hydrationMarkPrefix}raf`, hydrationBrowserRenderStart, hydrationAnimationFrameEnd);
|
|
12003
|
+
});
|
|
12004
|
+
}, []);
|
|
12005
|
+
(0, react_2.useEffect)(() => {
|
|
12006
|
+
var _a, _b, _c;
|
|
12007
|
+
if (hydrationEffectHasRun || !shouldMark)
|
|
12008
|
+
return;
|
|
12009
|
+
hydrationEffectHasRun = true;
|
|
12010
|
+
performance.mark(hydrationEffectsEnd);
|
|
12011
|
+
measureSafe(`${hydrationMarkPrefix}effects`, (_b = (_a = performance.getEntriesByName(hydrationFP)[0]) === null || _a === void 0 ? void 0 : _a.name) !== null && _b !== void 0
|
|
12012
|
+
? _b
|
|
12013
|
+
: (_c = performance.getEntriesByName(`${hydrationMarkPrefix}effects-start`)[0]) === null || _c === void 0
|
|
12014
|
+
? void 0
|
|
12015
|
+
: _c.name, hydrationEffectsEnd);
|
|
12016
|
+
}, []);
|
|
12017
|
+
useAfterPaintEffect(() => {
|
|
12018
|
+
if (hydrationPaintEffectHasRun || !shouldMark)
|
|
12019
|
+
return;
|
|
12020
|
+
hydrationPaintEffectHasRun = true;
|
|
12021
|
+
performance.mark(hydrationFP);
|
|
12022
|
+
measureSafe(`${hydrationMarkPrefix}time-to-first-paint`, hydrationStart, hydrationFP);
|
|
12023
|
+
measureSafe(`${hydrationMarkPrefix}browser-render`, hydrationAnimationFrameEnd, hydrationFP);
|
|
12024
|
+
}, [],
|
|
12025
|
+
// user-blocking ensures we get the correct timings here. Other priorites might delay this effect a little bit.
|
|
12026
|
+
{
|
|
12027
|
+
priority: 'user-blocking',
|
|
12028
|
+
});
|
|
12029
|
+
return null;
|
|
12030
|
+
}
|
|
12031
|
+
function MarkSuspenseEffectsStart() {
|
|
12032
|
+
useMarkSuspenseEffectsStart();
|
|
12033
|
+
return null;
|
|
12034
|
+
}
|
|
12035
|
+
function MarkSuspenseEffectsEnd() {
|
|
12036
|
+
useMarkSuspenseEffectEnd();
|
|
12037
|
+
return null;
|
|
12038
|
+
}
|
|
12039
|
+
var MarkSuspenseEffects = {
|
|
12040
|
+
Start: MarkSuspenseEffectsStart,
|
|
12041
|
+
End: MarkSuspenseEffectsEnd,
|
|
12042
|
+
};
|
|
11765
12043
|
var eventsToStop = [
|
|
11766
12044
|
'mousedown',
|
|
11767
12045
|
'mouseup',
|
|
@@ -11799,104 +12077,45 @@ var stopFn = (event) => {
|
|
|
11799
12077
|
event.stopPropagation();
|
|
11800
12078
|
performance.mark('framer-react-event-handling-prevented');
|
|
11801
12079
|
};
|
|
11802
|
-
|
|
11803
|
-
|
|
11804
|
-
if (!eventsToStop)
|
|
11805
|
-
return;
|
|
11806
|
-
const options = {
|
|
11807
|
-
capture: true,
|
|
11808
|
-
};
|
|
11809
|
-
eventsToStop.forEach((event) => document.body.addEventListener(event, stopFn, options));
|
|
11810
|
-
window.__FRAMER_TURN_OFF_REACT_EVENT_HANDLING__ = void 0;
|
|
11811
|
-
};
|
|
11812
|
-
}
|
|
11813
|
-
function turnOnReactEventHandling() {
|
|
12080
|
+
var shouldTurnOnEventHandling = false;
|
|
12081
|
+
function turnOffReactEventHandling() {
|
|
11814
12082
|
if (!eventsToStop)
|
|
11815
12083
|
return;
|
|
12084
|
+
shouldTurnOnEventHandling = true;
|
|
12085
|
+
performance.mark('framer-react-event-handling-start');
|
|
11816
12086
|
const options = {
|
|
11817
12087
|
capture: true,
|
|
11818
12088
|
};
|
|
11819
|
-
eventsToStop.forEach((event) => document.body.
|
|
11820
|
-
eventsToStop = void 0;
|
|
12089
|
+
eventsToStop.forEach((event) => document.body.addEventListener(event, stopFn, options));
|
|
11821
12090
|
}
|
|
11822
|
-
|
|
11823
|
-
|
|
11824
|
-
|
|
11825
|
-
|
|
11826
|
-
catch (e) {
|
|
11827
|
-
console.warn(`Could not measure ${name}`, e);
|
|
11828
|
-
}
|
|
11829
|
-
}
|
|
11830
|
-
var hydrationEffectHasRun = false;
|
|
11831
|
-
var hydrationInsertionEffectHasRun = false;
|
|
11832
|
-
var hydrationLayoutEffectHasRun = false;
|
|
11833
|
-
function OnHydrationEnd({ addHydrationMarkers, turnOffEventHandlerHack, }) {
|
|
11834
|
-
const hydrationMarkPrefix = 'framer-hydration-';
|
|
11835
|
-
const hydrationStart = `${hydrationMarkPrefix}start`;
|
|
11836
|
-
const hydrationRenderEnd = `${hydrationMarkPrefix}render-end`;
|
|
11837
|
-
const hydrationLayoutEffectsEnd = `${hydrationMarkPrefix}layout-effects-end`;
|
|
11838
|
-
const hydrationEffectsEnd = `${hydrationMarkPrefix}effects-end`;
|
|
11839
|
-
const hydrationFP = `${hydrationMarkPrefix}first-paint`;
|
|
11840
|
-
(0, react_4.useInsertionEffect)(() => {
|
|
11841
|
-
if (hydrationInsertionEffectHasRun)
|
|
12091
|
+
exports.turnOffReactEventHandling = turnOffReactEventHandling;
|
|
12092
|
+
function TurnOnReactEventHandling() {
|
|
12093
|
+
useAfterPaintEffect(() => {
|
|
12094
|
+
if (!shouldTurnOnEventHandling || !eventsToStop)
|
|
11842
12095
|
return;
|
|
11843
|
-
|
|
11844
|
-
|
|
11845
|
-
|
|
11846
|
-
|
|
11847
|
-
|
|
11848
|
-
|
|
11849
|
-
|
|
11850
|
-
|
|
11851
|
-
|
|
11852
|
-
|
|
11853
|
-
|
|
11854
|
-
performance.mark(hydrationLayoutEffectsEnd);
|
|
11855
|
-
measureSafe(`${hydrationMarkPrefix}layout-effects`, hydrationRenderEnd, hydrationLayoutEffectsEnd);
|
|
11856
|
-
}
|
|
11857
|
-
requestAnimationFrame(() => {
|
|
11858
|
-
var _a, _b, _c;
|
|
11859
|
-
const browserRenderStart = `${hydrationMarkPrefix}browser-render-start`;
|
|
11860
|
-
if (addHydrationMarkers) {
|
|
11861
|
-
performance.mark(browserRenderStart);
|
|
11862
|
-
measureSafe(`${hydrationMarkPrefix}uho`, (_b = (_a = performance.getEntriesByName(hydrationEffectsEnd)[0]) === null || _a === void 0 ? void 0 : _a.name) !== null &&
|
|
11863
|
-
_b !== void 0
|
|
11864
|
-
? _b
|
|
11865
|
-
: (_c = performance.getEntriesByName(hydrationLayoutEffectsEnd)[0]) === null || _c === void 0
|
|
11866
|
-
? void 0
|
|
11867
|
-
: _c.name, browserRenderStart);
|
|
11868
|
-
}
|
|
11869
|
-
setTimeout(() => {
|
|
11870
|
-
if (turnOffEventHandlerHack) {
|
|
11871
|
-
turnOnReactEventHandling();
|
|
11872
|
-
}
|
|
11873
|
-
if (addHydrationMarkers) {
|
|
11874
|
-
performance.mark(hydrationFP);
|
|
11875
|
-
measureSafe(`${hydrationMarkPrefix}time-to-first-paint`, hydrationStart, hydrationFP);
|
|
11876
|
-
measureSafe(`${hydrationMarkPrefix}browser-render`, browserRenderStart, hydrationFP);
|
|
11877
|
-
}
|
|
11878
|
-
}, 0);
|
|
11879
|
-
});
|
|
11880
|
-
}, []);
|
|
11881
|
-
(0, react_2.useEffect)(() => {
|
|
11882
|
-
var _a, _b, _c;
|
|
11883
|
-
if (hydrationEffectHasRun)
|
|
11884
|
-
return;
|
|
11885
|
-
hydrationEffectHasRun = true;
|
|
11886
|
-
if (turnOffEventHandlerHack) {
|
|
11887
|
-
turnOnReactEventHandling();
|
|
11888
|
-
}
|
|
11889
|
-
if (addHydrationMarkers) {
|
|
11890
|
-
performance.mark(hydrationEffectsEnd);
|
|
11891
|
-
measureSafe(`${hydrationMarkPrefix}effects`, (_b = (_a = performance.getEntriesByName(hydrationFP)[0]) === null || _a === void 0 ? void 0 : _a.name) !== null && _b !== void 0
|
|
11892
|
-
? _b
|
|
11893
|
-
: (_c = performance.getEntriesByName(hydrationLayoutEffectsEnd)[0]) === null || _c === void 0
|
|
11894
|
-
? void 0
|
|
11895
|
-
: _c.name, hydrationEffectsEnd);
|
|
11896
|
-
}
|
|
11897
|
-
}, []);
|
|
12096
|
+
const options = {
|
|
12097
|
+
capture: true,
|
|
12098
|
+
};
|
|
12099
|
+
eventsToStop.forEach((event) => document.body.removeEventListener(event, stopFn, options));
|
|
12100
|
+
eventsToStop = void 0;
|
|
12101
|
+
performance.mark('framer-react-event-handling-end');
|
|
12102
|
+
}, [],
|
|
12103
|
+
// user-blocking ensures this runs right after the paint, so users can interact asap.
|
|
12104
|
+
{
|
|
12105
|
+
priority: 'user-blocking',
|
|
12106
|
+
});
|
|
11898
12107
|
return null;
|
|
11899
12108
|
}
|
|
12109
|
+
function isSamePage(a, b) {
|
|
12110
|
+
if (a.routeId !== b.routeId)
|
|
12111
|
+
return false;
|
|
12112
|
+
if (a.pathVariables === b.pathVariables)
|
|
12113
|
+
return true;
|
|
12114
|
+
const aPathVariables = a.pathVariables || {};
|
|
12115
|
+
const bPathVariables = b.pathVariables || {};
|
|
12116
|
+
return aPathVariables.length === bPathVariables.length &&
|
|
12117
|
+
Object.keys(aPathVariables).every((key7) => aPathVariables[key7] === bPathVariables[key7]);
|
|
12118
|
+
}
|
|
11900
12119
|
function useGetRouteCallback(routes) {
|
|
11901
12120
|
return react_12.default.useCallback((routeId) => routes[routeId], [routes,]);
|
|
11902
12121
|
}
|
|
@@ -12001,25 +12220,31 @@ function useLocale() {
|
|
|
12001
12220
|
return useLocaleCode();
|
|
12002
12221
|
}
|
|
12003
12222
|
exports.useLocale = useLocale;
|
|
12004
|
-
function
|
|
12223
|
+
function useMonitorNextPaintAfterRender(label) {
|
|
12005
12224
|
const startLabel = `start-${label}`;
|
|
12006
12225
|
const endLabel = `end-${label}`;
|
|
12007
12226
|
const resolveHasPainted = (0, react_4.useRef)(void 0);
|
|
12008
|
-
(
|
|
12227
|
+
useAfterPaintEffect(() => {
|
|
12009
12228
|
if (resolveHasPainted.current) {
|
|
12010
12229
|
resolveHasPainted.current();
|
|
12011
12230
|
resolveHasPainted.current = void 0;
|
|
12012
12231
|
}
|
|
12232
|
+
}, void 0,
|
|
12233
|
+
// user-blocking ensures we get the correct timings here. Other priorites might delay this effect a little bit.
|
|
12234
|
+
{
|
|
12235
|
+
priority: 'user-blocking',
|
|
12013
12236
|
});
|
|
12014
12237
|
return (0, react_5.useCallback)(() => {
|
|
12015
12238
|
const hasPainted = new Promise((resolve) => {
|
|
12016
12239
|
resolveHasPainted.current = resolve;
|
|
12017
12240
|
});
|
|
12018
12241
|
performance.mark(startLabel);
|
|
12019
|
-
hasPainted.
|
|
12242
|
+
return hasPainted.finally(() => {
|
|
12020
12243
|
performance.mark(endLabel);
|
|
12021
12244
|
performance.measure(label, startLabel, endLabel);
|
|
12022
|
-
}).catch(() => {
|
|
12245
|
+
}).catch((e) => {
|
|
12246
|
+
console.error(e);
|
|
12247
|
+
});
|
|
12023
12248
|
}, [label, startLabel, endLabel,]);
|
|
12024
12249
|
}
|
|
12025
12250
|
function updateScrollPosition(hash2, smoothScroll, isHistoryTransition) {
|
|
@@ -12033,19 +12258,67 @@ function updateScrollPosition(hash2, smoothScroll, isHistoryTransition) {
|
|
|
12033
12258
|
window.scrollTo(0, 0);
|
|
12034
12259
|
}
|
|
12035
12260
|
function useScheduleRenderSideEffects(dep) {
|
|
12036
|
-
const actions =
|
|
12037
|
-
|
|
12261
|
+
const actions = (0, react_4.useRef)([]);
|
|
12262
|
+
(0, react_2.useLayoutEffect)(() => {
|
|
12038
12263
|
var _a;
|
|
12039
12264
|
if (!((_a = actions.current) === null || _a === void 0 ? void 0 : _a.length))
|
|
12040
12265
|
return;
|
|
12041
12266
|
actions.current.forEach((action) => action());
|
|
12042
12267
|
actions.current = [];
|
|
12043
12268
|
}, [dep,]);
|
|
12044
|
-
return
|
|
12269
|
+
return (0, react_5.useCallback)((cb) => {
|
|
12045
12270
|
actions.current.push(cb);
|
|
12046
12271
|
}, []);
|
|
12047
12272
|
}
|
|
12048
|
-
function
|
|
12273
|
+
function useNavigationTransition(enableAsyncURLUpdates) {
|
|
12274
|
+
const startNativeSpinner = useNativeLoadingSpinner();
|
|
12275
|
+
const monitorNextPaintAfterRender = useMonitorNextPaintAfterRender('route-change');
|
|
12276
|
+
const navigationController = (0, react_4.useRef)(void 0);
|
|
12277
|
+
return (0, react_5.useCallback)((transitionFn_1, updateURL_1, ...args_1) => __awaiter(this, [transitionFn_1, updateURL_1, ...args_1], void 0, function* (transitionFn, updateURL, isAbortable = true) {
|
|
12278
|
+
var _a;
|
|
12279
|
+
if (!enableAsyncURLUpdates) {
|
|
12280
|
+
yield (updateURL === null || updateURL === void 0 ? void 0 : updateURL());
|
|
12281
|
+
transitionFn();
|
|
12282
|
+
void monitorNextPaintAfterRender();
|
|
12283
|
+
return new Promise((resolve) => {
|
|
12284
|
+
resolve();
|
|
12285
|
+
});
|
|
12286
|
+
}
|
|
12287
|
+
(_a = navigationController.current) === null || _a === void 0 ? void 0 : _a.abort();
|
|
12288
|
+
const controller = isAbortable ? new AbortController() : void 0;
|
|
12289
|
+
navigationController.current = controller;
|
|
12290
|
+
const signal = controller === null || controller === void 0 ? void 0 : controller.signal;
|
|
12291
|
+
const nextRender = monitorNextPaintAfterRender();
|
|
12292
|
+
if (!updateURL) {
|
|
12293
|
+
navigationController.current = void 0;
|
|
12294
|
+
transitionFn(signal);
|
|
12295
|
+
return nextRender;
|
|
12296
|
+
}
|
|
12297
|
+
transitionFn(signal);
|
|
12298
|
+
yield interactionResponse({
|
|
12299
|
+
priority: 'user-visible',
|
|
12300
|
+
signal,
|
|
12301
|
+
}).catch(noop2);
|
|
12302
|
+
yield interactionResponse({
|
|
12303
|
+
priority: 'user-visible',
|
|
12304
|
+
signal,
|
|
12305
|
+
}).catch(noop2);
|
|
12306
|
+
let resolveNavigationPromise;
|
|
12307
|
+
const navigationPromise = new Promise((resolve, reject) => {
|
|
12308
|
+
resolveNavigationPromise = resolve;
|
|
12309
|
+
if (signal === null || signal === void 0 ? void 0 : signal.aborted)
|
|
12310
|
+
reject();
|
|
12311
|
+
else
|
|
12312
|
+
signal === null || signal === void 0 ? void 0 : signal.addEventListener('abort', reject);
|
|
12313
|
+
});
|
|
12314
|
+
startNativeSpinner(navigationPromise, updateURL, controller);
|
|
12315
|
+
return nextRender.then(() => {
|
|
12316
|
+
resolveNavigationPromise();
|
|
12317
|
+
});
|
|
12318
|
+
}), [enableAsyncURLUpdates, monitorNextPaintAfterRender, startNativeSpinner,]);
|
|
12319
|
+
}
|
|
12320
|
+
function Router({ defaultPageStyle, disableHistory, initialPathVariables, initialRoute, notFoundPage, collectionUtils, routes, initialLocaleId, locales = [], preserveQueryParams = false, enableAsyncURLUpdates = false, }) {
|
|
12321
|
+
useMarkRouterEffects();
|
|
12049
12322
|
useReplaceInitialState({
|
|
12050
12323
|
disabled: disableHistory,
|
|
12051
12324
|
routeId: initialRoute,
|
|
@@ -12053,12 +12326,14 @@ function Router({ defaultPageStyle, disableHistory, initialPathVariables, initia
|
|
|
12053
12326
|
initialLocaleId,
|
|
12054
12327
|
});
|
|
12055
12328
|
const startViewTransition2 = useViewTransition();
|
|
12056
|
-
const
|
|
12057
|
-
const
|
|
12058
|
-
const
|
|
12059
|
-
const
|
|
12329
|
+
const [dep, forceUpdate,] = useForceUpdate2();
|
|
12330
|
+
const scheduleSideEffect = useScheduleRenderSideEffects(dep);
|
|
12331
|
+
const startNavigation = useNavigationTransition(enableAsyncURLUpdates);
|
|
12332
|
+
const currentRouteRef = (0, react_4.useRef)(initialRoute);
|
|
12333
|
+
const currentPathVariablesRef = (0, react_4.useRef)(initialPathVariables);
|
|
12334
|
+
const currentLocaleIdRef = (0, react_4.useRef)(initialLocaleId);
|
|
12060
12335
|
const currentLocaleId = currentLocaleIdRef.current;
|
|
12061
|
-
const activeLocale =
|
|
12336
|
+
const activeLocale = (0, react_6.useMemo)(() => {
|
|
12062
12337
|
var _a;
|
|
12063
12338
|
return (_a = locales.find(({ id: id3, }) => {
|
|
12064
12339
|
if (!currentLocaleId)
|
|
@@ -12068,8 +12343,7 @@ function Router({ defaultPageStyle, disableHistory, initialPathVariables, initia
|
|
|
12068
12343
|
? _a
|
|
12069
12344
|
: null;
|
|
12070
12345
|
}, [currentLocaleId, locales,]);
|
|
12071
|
-
const
|
|
12072
|
-
const localeInfo = react_12.default.useMemo(() => {
|
|
12346
|
+
const localeInfo = (0, react_6.useMemo)(() => {
|
|
12073
12347
|
return {
|
|
12074
12348
|
activeLocale,
|
|
12075
12349
|
locales,
|
|
@@ -12102,28 +12376,55 @@ function Router({ defaultPageStyle, disableHistory, initialPathVariables, initia
|
|
|
12102
12376
|
});
|
|
12103
12377
|
if (!localeResult)
|
|
12104
12378
|
return;
|
|
12379
|
+
const currentPathVariables2 = currentPathVariablesRef.current;
|
|
12380
|
+
const currentStatePaginationInfo = window.history.state.paginationInfo;
|
|
12381
|
+
const currentPath = localeResult.path;
|
|
12105
12382
|
currentPathVariablesRef.current = localeResult.pathVariables;
|
|
12106
12383
|
currentLocaleIdRef.current = nextLocale.id;
|
|
12107
|
-
|
|
12108
|
-
|
|
12384
|
+
const updateURL = (...args_1) => __awaiter(this, [...args_1], void 0, function* (ignorePushStateWrapper = false) {
|
|
12385
|
+
if (!currentPath)
|
|
12386
|
+
return;
|
|
12387
|
+
return pushHistoryState({
|
|
12388
|
+
routeId: currentRouteId2,
|
|
12389
|
+
pathVariables: currentPathVariables2,
|
|
12390
|
+
localeId: nextLocale.id,
|
|
12391
|
+
paginationInfo: currentStatePaginationInfo,
|
|
12392
|
+
}, currentPath,
|
|
12393
|
+
// we yield in startNavigation before updating the URL, so yielding again is not needed.
|
|
12394
|
+
false, ignorePushStateWrapper);
|
|
12395
|
+
});
|
|
12396
|
+
void startNavigation(() => {
|
|
12397
|
+
void startViewTransition2(currentRouteId2, currentRouteId2, () => (0, react_13.startTransition)(forceUpdate), enableAsyncURLUpdates);
|
|
12398
|
+
}, updateURL, false);
|
|
12109
12399
|
}
|
|
12110
12400
|
catch (_j) { }
|
|
12111
12401
|
}),
|
|
12112
12402
|
};
|
|
12113
|
-
}, [
|
|
12114
|
-
|
|
12115
|
-
|
|
12403
|
+
}, [
|
|
12404
|
+
activeLocale,
|
|
12405
|
+
collectionUtils,
|
|
12406
|
+
enableAsyncURLUpdates,
|
|
12407
|
+
forceUpdate,
|
|
12408
|
+
locales,
|
|
12409
|
+
preserveQueryParams,
|
|
12410
|
+
routes,
|
|
12411
|
+
startNavigation,
|
|
12412
|
+
startViewTransition2,
|
|
12413
|
+
]);
|
|
12414
|
+
const setCurrentRouteId = (0, react_5.useCallback)((routeId, localeId, hash2, pathVariables, smoothScroll = false, isHistoryTransition = false, updateURL) => {
|
|
12415
|
+
const currentRouteId2 = currentRouteRef.current;
|
|
12116
12416
|
currentRouteRef.current = routeId;
|
|
12117
12417
|
currentPathVariablesRef.current = pathVariables;
|
|
12118
12418
|
currentLocaleIdRef.current = localeId;
|
|
12119
12419
|
scheduleSideEffect(() => {
|
|
12120
12420
|
updateScrollPosition(hash2, smoothScroll, isHistoryTransition);
|
|
12121
12421
|
});
|
|
12122
|
-
|
|
12123
|
-
|
|
12124
|
-
|
|
12422
|
+
void startNavigation((signal) => {
|
|
12423
|
+
void startViewTransition2(currentRouteId2, routeId, () => (0, react_13.startTransition)(forceUpdate), enableAsyncURLUpdates, signal);
|
|
12424
|
+
}, updateURL);
|
|
12425
|
+
}, [enableAsyncURLUpdates, forceUpdate, scheduleSideEffect, startNavigation, startViewTransition2,]);
|
|
12125
12426
|
usePopStateHandler(currentRouteRef, setCurrentRouteId);
|
|
12126
|
-
const navigate =
|
|
12427
|
+
const navigate = (0, react_5.useCallback)((routeId, hash2, pathVariables, smoothScroll) => __awaiter(this, void 0, void 0, function* () {
|
|
12127
12428
|
var _a, _b;
|
|
12128
12429
|
const newRoute = routes[routeId];
|
|
12129
12430
|
if (pathVariables) {
|
|
@@ -12139,51 +12440,54 @@ function Router({ defaultPageStyle, disableHistory, initialPathVariables, initia
|
|
|
12139
12440
|
pathVariables = Object.fromEntries(Object.entries(pathVariables).filter(([key7,]) => inUse.has(key7)));
|
|
12140
12441
|
}
|
|
12141
12442
|
const routeElementId = getRouteElementId(newRoute, hash2);
|
|
12443
|
+
const currentPathVariables2 = currentPathVariablesRef.current;
|
|
12444
|
+
const currentRouteLocaleId = currentLocaleIdRef.current;
|
|
12142
12445
|
if (isSamePage({
|
|
12143
12446
|
routeId: currentRouteRef.current,
|
|
12144
|
-
pathVariables:
|
|
12447
|
+
pathVariables: currentPathVariables2,
|
|
12145
12448
|
}, {
|
|
12146
12449
|
routeId,
|
|
12147
12450
|
pathVariables,
|
|
12148
12451
|
})) {
|
|
12149
|
-
if (((_b = window.history.state) === null || _b === void 0 ? void 0 : _b.hash) !== hash2) {
|
|
12150
|
-
if (!disableHistory) {
|
|
12151
|
-
const route = routes[routeId];
|
|
12152
|
-
if (route) {
|
|
12153
|
-
pushRouteState(routeId, route, {
|
|
12154
|
-
currentRoutePath: route.path,
|
|
12155
|
-
currentPathVariables: currentPathVariablesRef.current,
|
|
12156
|
-
pathVariables,
|
|
12157
|
-
hash: hash2,
|
|
12158
|
-
localeId: currentLocaleIdRef.current,
|
|
12159
|
-
preserveQueryParams,
|
|
12160
|
-
});
|
|
12161
|
-
}
|
|
12162
|
-
}
|
|
12163
|
-
}
|
|
12164
12452
|
updateScrollPosition(routeElementId, smoothScroll, false);
|
|
12453
|
+
const route = routes[routeId];
|
|
12454
|
+
if (((_b = window.history.state) === null || _b === void 0 ? void 0 : _b.hash) === hash2 || disableHistory || !route)
|
|
12455
|
+
return;
|
|
12456
|
+
const updateURLPromise = pushRouteState(routeId, route, {
|
|
12457
|
+
currentRoutePath: route.path,
|
|
12458
|
+
currentPathVariables: currentPathVariables2,
|
|
12459
|
+
pathVariables,
|
|
12460
|
+
hash: hash2,
|
|
12461
|
+
localeId: currentRouteLocaleId,
|
|
12462
|
+
preserveQueryParams,
|
|
12463
|
+
},
|
|
12464
|
+
// we want to yield as this is called synchronusly from an user interaction.
|
|
12465
|
+
enableAsyncURLUpdates);
|
|
12466
|
+
if (!enableAsyncURLUpdates)
|
|
12467
|
+
return yield updateURLPromise;
|
|
12165
12468
|
return;
|
|
12166
12469
|
}
|
|
12167
12470
|
if (!newRoute)
|
|
12168
12471
|
return;
|
|
12169
|
-
|
|
12170
|
-
|
|
12171
|
-
pushRouteState(routeId, newRoute, {
|
|
12472
|
+
const currentRoute = routes[currentRouteRef.current];
|
|
12473
|
+
const updateURL = (...args_1) => __awaiter(this, [...args_1], void 0, function* (ignorePushStateWrapper = false) {
|
|
12474
|
+
return pushRouteState(routeId, newRoute, {
|
|
12172
12475
|
currentRoutePath: currentRoute === null || currentRoute === void 0 ? void 0 : currentRoute.path,
|
|
12173
|
-
currentPathVariables:
|
|
12476
|
+
currentPathVariables: currentPathVariables2,
|
|
12174
12477
|
hash: hash2,
|
|
12175
12478
|
pathVariables,
|
|
12176
|
-
localeId:
|
|
12479
|
+
localeId: currentRouteLocaleId,
|
|
12177
12480
|
preserveQueryParams,
|
|
12178
|
-
}
|
|
12179
|
-
|
|
12180
|
-
|
|
12181
|
-
|
|
12182
|
-
|
|
12481
|
+
},
|
|
12482
|
+
// we yield in startNavigation before updating the URL, so yielding again is not needed.
|
|
12483
|
+
false, ignorePushStateWrapper);
|
|
12484
|
+
});
|
|
12485
|
+
setCurrentRouteId(routeId, currentRouteLocaleId, routeElementId, pathVariables, smoothScroll, false, disableHistory ? void 0 : updateURL);
|
|
12486
|
+
}), [routes, setCurrentRouteId, disableHistory, preserveQueryParams, enableAsyncURLUpdates,]);
|
|
12183
12487
|
const getRoute = useGetRouteCallback(routes);
|
|
12184
12488
|
const currentRouteId = currentRouteRef.current;
|
|
12185
12489
|
const currentPathVariables = currentPathVariablesRef.current;
|
|
12186
|
-
const api =
|
|
12490
|
+
const api = (0, react_6.useMemo)(() => ({
|
|
12187
12491
|
navigate,
|
|
12188
12492
|
getRoute,
|
|
12189
12493
|
currentRouteId,
|
|
@@ -12211,16 +12515,17 @@ function Router({ defaultPageStyle, disableHistory, initialPathVariables, initia
|
|
|
12211
12515
|
notFoundPage,
|
|
12212
12516
|
defaultPageStyle,
|
|
12213
12517
|
forceUpdateKey: dep,
|
|
12214
|
-
children: (0, jsx_runtime_1.
|
|
12215
|
-
children:
|
|
12216
|
-
|
|
12217
|
-
|
|
12518
|
+
children: (0, jsx_runtime_1.jsxs)(react_8.Fragment, {
|
|
12519
|
+
children: [
|
|
12520
|
+
(0, jsx_runtime_1.jsx)(MarkSuspenseEffects.Start, {}),
|
|
12521
|
+
pageExistsInCurrentLocale
|
|
12522
|
+
? renderPage(current.page, defaultPageStyle)
|
|
12523
|
+
: notFoundPage && renderPage(notFoundPage, defaultPageStyle),
|
|
12524
|
+
],
|
|
12218
12525
|
}, remountKey),
|
|
12219
12526
|
}),
|
|
12220
|
-
(0, jsx_runtime_1.jsx)(
|
|
12221
|
-
|
|
12222
|
-
turnOffEventHandlerHack: enableImproveInpDuringHydration,
|
|
12223
|
-
}),
|
|
12527
|
+
(0, jsx_runtime_1.jsx)(TurnOnReactEventHandling, {}),
|
|
12528
|
+
(0, jsx_runtime_1.jsx)(MarkSuspenseEffects.End, {}),
|
|
12224
12529
|
],
|
|
12225
12530
|
}),
|
|
12226
12531
|
}),
|
|
@@ -14410,8 +14715,8 @@ var ObjectInterpolation = (valueInterpolation) => {
|
|
|
14410
14715
|
difference(from, to) {
|
|
14411
14716
|
let sum = 0;
|
|
14412
14717
|
for (const key7 in from) {
|
|
14413
|
-
const
|
|
14414
|
-
sum += Math.pow(
|
|
14718
|
+
const difference2 = valueInterpolation.difference(from[key7], to[key7]);
|
|
14719
|
+
sum += Math.pow(difference2, 2);
|
|
14415
14720
|
}
|
|
14416
14721
|
return Math.sqrt(sum);
|
|
14417
14722
|
},
|
|
@@ -17429,6 +17734,7 @@ var richTextCSSRules = [
|
|
|
17429
17734
|
h6.framer-text:not(:first-child),
|
|
17430
17735
|
ol.framer-text:not(:first-child),
|
|
17431
17736
|
ul.framer-text:not(:first-child),
|
|
17737
|
+
blockquote.framer-text:not(:first-child),
|
|
17432
17738
|
.framer-image.framer-text:not(:first-child) {
|
|
17433
17739
|
margin-top: var(--framer-blockquote-paragraph-spacing, var(--framer-paragraph-spacing, 0));
|
|
17434
17740
|
}
|
|
@@ -17466,13 +17772,13 @@ var richTextCSSRules = [
|
|
|
17466
17772
|
`
|
|
17467
17773
|
code.framer-text,
|
|
17468
17774
|
code.framer-text span.framer-text:not([data-text-fill]) {
|
|
17469
|
-
font-family: var(--framer-code-font-family, var(--framer-font-family, Inter, Inter Placeholder, sans-serif));
|
|
17470
|
-
font-style: var(--framer-code-font-style, var(--framer-font-style, normal));
|
|
17471
|
-
font-weight: var(--framer-code-font-weight, var(--framer-font-weight, 400));
|
|
17472
|
-
color: var(--framer-code-text-color, var(--framer-text-color, #000));
|
|
17473
|
-
font-size: calc(var(--framer-font-size, 16px) * var(--framer-font-size-scale, 1));
|
|
17474
|
-
letter-spacing: var(--framer-letter-spacing, 0);
|
|
17475
|
-
line-height: var(--framer-line-height, 1.2em);
|
|
17775
|
+
font-family: var(--framer-blockquote-font-family, var(--framer-code-font-family, var(--framer-font-family, Inter, Inter Placeholder, sans-serif)));
|
|
17776
|
+
font-style: var(--framer-blockquote-font-style, var(--framer-code-font-style, var(--framer-font-style, normal)));
|
|
17777
|
+
font-weight: var(--framer-blockquote-font-weight, var(--framer-code-font-weight, var(--framer-font-weight, 400)));
|
|
17778
|
+
color: var(--framer-blockquote-text-color, var(--framer-code-text-color, var(--framer-text-color, #000)));
|
|
17779
|
+
font-size: calc(var(--framer-blockquote-font-size, var(--framer-font-size, 16px)) * var(--framer-font-size-scale, 1));
|
|
17780
|
+
letter-spacing: var(--framer-blockquote-letter-spacing, var(--framer-letter-spacing, 0));
|
|
17781
|
+
line-height: var(--framer-blockquote-line-height, var(--framer-line-height, 1.2em));
|
|
17476
17782
|
}
|
|
17477
17783
|
`, /* css */
|
|
17478
17784
|
`
|
|
@@ -17487,13 +17793,13 @@ var richTextCSSRules = [
|
|
|
17487
17793
|
`
|
|
17488
17794
|
a.framer-text,
|
|
17489
17795
|
a.framer-text span.framer-text:not([data-text-fill]) {
|
|
17490
|
-
font-family: var(--framer-link-font-family, var(--framer-font-family, Inter, Inter Placeholder, sans-serif));
|
|
17491
|
-
font-style: var(--framer-link-font-style, var(--framer-font-style, normal));
|
|
17492
|
-
font-weight: var(--framer-link-font-weight, var(--framer-font-weight, 400));
|
|
17493
|
-
color: var(--framer-link-text-color, var(--framer-text-color, #000));
|
|
17494
|
-
font-size: calc(var(--framer-
|
|
17495
|
-
text-transform: var(--framer-link-text-transform, var(--framer-text-transform, none));
|
|
17496
|
-
text-decoration: var(--framer-link-text-decoration, var(--framer-text-decoration, none));
|
|
17796
|
+
font-family: var(--framer-blockquote-font-family, var(--framer-link-font-family, var(--framer-font-family, Inter, Inter Placeholder, sans-serif)));
|
|
17797
|
+
font-style: var(--framer-blockquote-font-style, var(--framer-link-font-style, var(--framer-font-style, normal)));
|
|
17798
|
+
font-weight: var(--framer-blockquote-font-weight, var(--framer-link-font-weight, var(--framer-font-weight, 400)));
|
|
17799
|
+
color: var(--framer-blockquote-text-color, var(--framer-link-text-color, var(--framer-text-color, #000)));
|
|
17800
|
+
font-size: calc(var(--framer-blockquote-font-size, var(--framer-font-size, 16px)) * var(--framer-font-size-scale, 1));
|
|
17801
|
+
text-transform: var(--framer-blockquote-text-transform, var(--framer-link-text-transform, var(--framer-text-transform, none)));
|
|
17802
|
+
text-decoration: var(--framer-blockquote-text-decoration, var(--framer-link-text-decoration, var(--framer-text-decoration, none)));
|
|
17497
17803
|
/* Cursor inherit to overwrite the user agent stylesheet on rich text links. */
|
|
17498
17804
|
cursor: var(--framer-custom-cursors, pointer);
|
|
17499
17805
|
}
|
|
@@ -17501,33 +17807,33 @@ var richTextCSSRules = [
|
|
|
17501
17807
|
`
|
|
17502
17808
|
code.framer-text a.framer-text,
|
|
17503
17809
|
code.framer-text a.framer-text span.framer-text:not([data-text-fill]) {
|
|
17504
|
-
font-family: var(--framer-code-font-family, var(--framer-font-family, Inter, Inter Placeholder, sans-serif));
|
|
17505
|
-
font-style: var(--framer-code-font-style, var(--framer-font-style, normal));
|
|
17506
|
-
font-weight: var(--framer-code-font-weight, var(--framer-font-weight, 400));
|
|
17507
|
-
color: var(--framer-link-text-color, var(--framer-code-text-color, var(--framer-text-color, #000)));
|
|
17508
|
-
font-size: calc(var(--framer-
|
|
17810
|
+
font-family: var(--framer-blockquote-font-family, var(--framer-code-font-family, var(--framer-font-family, Inter, Inter Placeholder, sans-serif)));
|
|
17811
|
+
font-style: var(--framer-blockquote-font-style, var(--framer-code-font-style, var(--framer-font-style, normal)));
|
|
17812
|
+
font-weight: var(--framer-blockquote-font-weight, var(--framer-code-font-weight, var(--framer-font-weight, 400)));
|
|
17813
|
+
color: var(--framer-blockquote-text-color, var(--framer-link-text-color, var(--framer-code-text-color, var(--framer-text-color, #000))));
|
|
17814
|
+
font-size: calc(var(--framer-blockquote-font-size, var(--framer-font-size, 16px)) * var(--framer-font-size-scale, 1));
|
|
17509
17815
|
}
|
|
17510
17816
|
`, /* css */
|
|
17511
17817
|
`
|
|
17512
17818
|
a.framer-text:hover,
|
|
17513
17819
|
a.framer-text:hover span.framer-text:not([data-text-fill]) {
|
|
17514
|
-
font-family: var(--framer-link-hover-font-family, var(--framer-link-font-family, var(--framer-font-family, Inter, Inter Placeholder, sans-serif)));
|
|
17515
|
-
font-style: var(--framer-link-hover-font-style, var(--framer-link-font-style, var(--framer-font-style, normal)));
|
|
17516
|
-
font-weight: var(--framer-link-hover-font-weight, var(--framer-link-font-weight, var(--framer-font-weight, 400)));
|
|
17517
|
-
color: var(--framer-link-hover-text-color, var(--framer-link-text-color, var(--framer-text-color, #000)));
|
|
17518
|
-
font-size: calc(var(--framer-link-hover-font-size, var(--framer-
|
|
17519
|
-
text-transform: var(--framer-link-hover-text-transform, var(--framer-link-text-transform, var(--framer-text-transform, none)));
|
|
17520
|
-
text-decoration: var(--framer-link-hover-text-decoration, var(--framer-link-text-decoration, var(--framer-text-decoration, none)));
|
|
17820
|
+
font-family: var(--framer-link-hover-font-family, var(--framer-blockquote-font-family, var(--framer-link-font-family, var(--framer-font-family, Inter, Inter Placeholder, sans-serif))));
|
|
17821
|
+
font-style: var(--framer-link-hover-font-style, var(--framer-blockquote-font-style, var(--framer-link-font-style, var(--framer-font-style, normal))));
|
|
17822
|
+
font-weight: var(--framer-link-hover-font-weight, var(--framer-blockquote-font-weight, var(--framer-link-font-weight, var(--framer-font-weight, 400))));
|
|
17823
|
+
color: var(--framer-link-hover-text-color, var(--framer-blockquote-text-color, var(--framer-link-text-color, var(--framer-text-color, #000))));
|
|
17824
|
+
font-size: calc(var(--framer-link-hover-font-size, var(--framer-blockquote-font-size, var(--framer-font-size, 16px))) * var(--framer-font-size-scale, 1));
|
|
17825
|
+
text-transform: var(--framer-link-hover-text-transform, var(--framer-blockquote-text-transform, var(--framer-link-text-transform, var(--framer-text-transform, none))));
|
|
17826
|
+
text-decoration: var(--framer-link-hover-text-decoration, var(--framer-blockquote-text-decoration, var(--framer-link-text-decoration, var(--framer-text-decoration, none))));
|
|
17521
17827
|
}
|
|
17522
17828
|
`, /* css */
|
|
17523
17829
|
`
|
|
17524
17830
|
code.framer-text a.framer-text:hover,
|
|
17525
17831
|
code.framer-text a.framer-text:hover span.framer-text:not([data-text-fill]) {
|
|
17526
|
-
font-family: var(--framer-code-font-family, var(--framer-font-family, Inter, Inter Placeholder, sans-serif));
|
|
17527
|
-
font-style: var(--framer-code-font-style, var(--framer-font-style, normal));
|
|
17528
|
-
font-weight: var(--framer-code-font-weight, var(--framer-font-weight, 400));
|
|
17529
|
-
color: var(--framer-link-hover-text-color, var(--framer-link-text-color, var(--framer-code-text-color, var(--framer-text-color, #000))));
|
|
17530
|
-
font-size: calc(var(--framer-link-hover-font-size, var(--framer-link-font-size, var(--framer-font-size, 16px))) * var(--framer-font-size-scale, 1));
|
|
17832
|
+
font-family: var(--framer-blockquote-font-family, var(--framer-code-font-family, var(--framer-font-family, Inter, Inter Placeholder, sans-serif)));
|
|
17833
|
+
font-style: var(--framer-blockquote-font-style, var(--framer-code-font-style, var(--framer-font-style, normal)));
|
|
17834
|
+
font-weight: var(--framer-blockquote-font-weight, var(--framer-code-font-weight, var(--framer-font-weight, 400)));
|
|
17835
|
+
color: var(--framer-link-hover-text-color, var(--framer-blockquote-text-color, var(--framer-link-text-color, var(--framer-code-text-color, var(--framer-text-color, #000)))));
|
|
17836
|
+
font-size: calc(var(--framer-link-hover-font-size, var(--framer-blockquote-font-size, var(--framer-link-font-size, var(--framer-font-size, 16px)))) * var(--framer-font-size-scale, 1));
|
|
17531
17837
|
}
|
|
17532
17838
|
`, /* css */
|
|
17533
17839
|
`
|
|
@@ -18021,8 +18327,8 @@ function isUndefined(value) {
|
|
|
18021
18327
|
function isNull(value) {
|
|
18022
18328
|
return value === null;
|
|
18023
18329
|
}
|
|
18024
|
-
function
|
|
18025
|
-
return
|
|
18330
|
+
function isNullish2(value) {
|
|
18331
|
+
return value == null;
|
|
18026
18332
|
}
|
|
18027
18333
|
function isValidDate(value) {
|
|
18028
18334
|
return value instanceof Date && !isNaN(value.getTime());
|
|
@@ -19639,150 +19945,6 @@ var reactPropsRegex = /^(?:children|dangerouslySetInnerHTML|key|ref|autoFocus|de
|
|
|
19639
19945
|
var isPropValid = /* @__PURE__ */ memoize((prop) => reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111 && prop.charCodeAt(1) === 110 && prop.charCodeAt(2) < 91
|
|
19640
19946
|
/* Z+1 */
|
|
19641
19947
|
);
|
|
19642
|
-
var LibraryFeaturesContext = /* @__PURE__ */ react_12.default.createContext(void 0);
|
|
19643
|
-
var LibraryFeaturesProvider = /* @__PURE__ */ (() => LibraryFeaturesContext.Provider)();
|
|
19644
|
-
exports.LibraryFeaturesProvider = LibraryFeaturesProvider;
|
|
19645
|
-
var useLibraryFeatures = () => {
|
|
19646
|
-
const context = react_12.default.useContext(LibraryFeaturesContext);
|
|
19647
|
-
return context !== null && context !== void 0 ? context : {};
|
|
19648
|
-
};
|
|
19649
|
-
var import_process = __toESM(require_browser(), 1);
|
|
19650
|
-
var safeNavigator = typeof navigator !== 'undefined' ? navigator : void 0;
|
|
19651
|
-
var isBrowser2 = () => typeof document === 'object';
|
|
19652
|
-
var isWebKit = () => {
|
|
19653
|
-
var _a;
|
|
19654
|
-
return ((_a = safeNavigator) == null ? void 0 : _a.userAgent.includes('AppleWebKit/')) && !isChrome() && !isEdge();
|
|
19655
|
-
};
|
|
19656
|
-
var webkitVersion = () => {
|
|
19657
|
-
let version2 = -1;
|
|
19658
|
-
const regexp = /AppleWebKit\/([\d.]+)/;
|
|
19659
|
-
const result = safeNavigator && regexp.exec(safeNavigator.userAgent);
|
|
19660
|
-
if (result && result[1]) {
|
|
19661
|
-
version2 = parseFloat(result[1]);
|
|
19662
|
-
}
|
|
19663
|
-
return version2;
|
|
19664
|
-
};
|
|
19665
|
-
var safariVersion = () => {
|
|
19666
|
-
let version2 = -1;
|
|
19667
|
-
const regexp = /Version\/([\d.]+)/;
|
|
19668
|
-
const result = safeNavigator && regexp.exec(safeNavigator.userAgent);
|
|
19669
|
-
if (result && result[1]) {
|
|
19670
|
-
version2 = parseFloat(result[1]);
|
|
19671
|
-
}
|
|
19672
|
-
return version2;
|
|
19673
|
-
};
|
|
19674
|
-
var isChrome = () => safeNavigator && /Chrome/.test(safeNavigator.userAgent) && /Google Inc/.test(safeNavigator.vendor) && !isEdge();
|
|
19675
|
-
var isSafari = () => safeNavigator && /Safari/.test(safeNavigator.userAgent) && /Apple Computer/.test(safeNavigator.vendor);
|
|
19676
|
-
var isFirefox = () => safeNavigator && /Firefox\/\d+\.\d+$/.test(safeNavigator.userAgent);
|
|
19677
|
-
var isFramerX = () => safeNavigator && /FramerX/.test(safeNavigator.userAgent);
|
|
19678
|
-
var isEdge = () => safeNavigator && /Edg\//.test(safeNavigator.userAgent);
|
|
19679
|
-
var isAndroid = () => safeNavigator && /android/i.test(safeNavigator.userAgent);
|
|
19680
|
-
var isIOS = () => safeNavigator && /iPhone|iPod|iPad/i.test(safeNavigator.platform);
|
|
19681
|
-
var isMacOS = () => safeNavigator && /Mac/.test(safeNavigator.platform);
|
|
19682
|
-
var isWindows = () => safeNavigator && /Win/.test(safeNavigator.platform);
|
|
19683
|
-
var isTouch = () => safeWindow.ontouchstart === null && safeWindow.ontouchmove === null && safeWindow.ontouchend === null;
|
|
19684
|
-
var isDesktop = () => deviceType() === 'desktop';
|
|
19685
|
-
var isPhone = () => deviceType() === 'phone';
|
|
19686
|
-
var isTablet = () => deviceType() === 'tablet';
|
|
19687
|
-
var isMobile = () => isPhone() || isTablet();
|
|
19688
|
-
var isFileUrl = (url) => url.startsWith('file://');
|
|
19689
|
-
var isDataUrl = (url) => url.startsWith('data:');
|
|
19690
|
-
var isTest = () => import_process.default.env.NODE_ENV === 'test';
|
|
19691
|
-
var isRelativeUrl = (url) => !/^[a-z]{1,8}:\/\/.*$/i.test(url);
|
|
19692
|
-
var isLocalServerUrl = (url) => /[a-z]{1,8}:\/\/127\.0\.0\.1/i.test(url) || /[a-zA-Z]{1,8}:\/\/localhost/.test(url);
|
|
19693
|
-
var isLocalUrl = (url) => {
|
|
19694
|
-
if (isFileUrl(url))
|
|
19695
|
-
return true;
|
|
19696
|
-
if (isLocalServerUrl(url))
|
|
19697
|
-
return true;
|
|
19698
|
-
return false;
|
|
19699
|
-
};
|
|
19700
|
-
var isLocalAssetUrl = (url, baseUrl) => {
|
|
19701
|
-
if (baseUrl === null)
|
|
19702
|
-
baseUrl = safeWindow.location.href;
|
|
19703
|
-
if (isDataUrl(url))
|
|
19704
|
-
return false;
|
|
19705
|
-
if (isLocalUrl(url))
|
|
19706
|
-
return true;
|
|
19707
|
-
if (isRelativeUrl(url) && isLocalUrl(baseUrl))
|
|
19708
|
-
return true;
|
|
19709
|
-
return false;
|
|
19710
|
-
};
|
|
19711
|
-
var devicePixelRatio2 = () => safeWindow.devicePixelRatio;
|
|
19712
|
-
var isJP2Supported = function () {
|
|
19713
|
-
if (isFirefox())
|
|
19714
|
-
return false;
|
|
19715
|
-
return isWebKit();
|
|
19716
|
-
};
|
|
19717
|
-
var isWebPSupported = () => isChrome();
|
|
19718
|
-
var deviceType = () => {
|
|
19719
|
-
if (safeNavigator && /tablet|iPad|Nexus 9/i.test(safeNavigator.userAgent))
|
|
19720
|
-
return 'tablet';
|
|
19721
|
-
if (safeNavigator && /mobi/i.test(safeNavigator.userAgent))
|
|
19722
|
-
return 'phone';
|
|
19723
|
-
return 'desktop';
|
|
19724
|
-
};
|
|
19725
|
-
var deviceOS = () => {
|
|
19726
|
-
if (isMacOS())
|
|
19727
|
-
return 'macos';
|
|
19728
|
-
if (isIOS())
|
|
19729
|
-
return 'ios';
|
|
19730
|
-
if (isAndroid())
|
|
19731
|
-
return 'android';
|
|
19732
|
-
if (isWindows())
|
|
19733
|
-
return 'windows';
|
|
19734
|
-
};
|
|
19735
|
-
var deviceFont = (os) => {
|
|
19736
|
-
if (!os) {
|
|
19737
|
-
os = deviceOS();
|
|
19738
|
-
}
|
|
19739
|
-
const fonts = {
|
|
19740
|
-
apple: '-apple-system, BlinkMacSystemFont, SF Pro Text, SF UI Text, Helvetica Neue',
|
|
19741
|
-
google: 'Roboto, Helvetica Neue',
|
|
19742
|
-
microsoft: 'Segoe UI, Helvetica Neue',
|
|
19743
|
-
};
|
|
19744
|
-
if (os === 'macos')
|
|
19745
|
-
return fonts.apple;
|
|
19746
|
-
if (os === 'ios')
|
|
19747
|
-
return fonts.apple;
|
|
19748
|
-
if (os === 'android')
|
|
19749
|
-
return fonts.google;
|
|
19750
|
-
if (os === 'windows')
|
|
19751
|
-
return fonts.microsoft;
|
|
19752
|
-
return fonts.apple;
|
|
19753
|
-
};
|
|
19754
|
-
var environment = {
|
|
19755
|
-
isWebKit,
|
|
19756
|
-
webkitVersion,
|
|
19757
|
-
isChrome,
|
|
19758
|
-
isSafari,
|
|
19759
|
-
isFirefox,
|
|
19760
|
-
isFramerX,
|
|
19761
|
-
isEdge,
|
|
19762
|
-
isAndroid,
|
|
19763
|
-
isIOS,
|
|
19764
|
-
isMacOS,
|
|
19765
|
-
isWindows,
|
|
19766
|
-
isTouch,
|
|
19767
|
-
isDesktop,
|
|
19768
|
-
isPhone,
|
|
19769
|
-
isTablet,
|
|
19770
|
-
isMobile,
|
|
19771
|
-
isFileUrl,
|
|
19772
|
-
isDataUrl,
|
|
19773
|
-
isRelativeUrl,
|
|
19774
|
-
isLocalServerUrl,
|
|
19775
|
-
isLocalUrl,
|
|
19776
|
-
isLocalAssetUrl,
|
|
19777
|
-
devicePixelRatio: devicePixelRatio2,
|
|
19778
|
-
isJP2Supported,
|
|
19779
|
-
isWebPSupported,
|
|
19780
|
-
deviceType,
|
|
19781
|
-
deviceOS,
|
|
19782
|
-
deviceFont,
|
|
19783
|
-
safariVersion,
|
|
19784
|
-
};
|
|
19785
|
-
exports.environment = environment;
|
|
19786
19948
|
var mockWithWarning = (message) => {
|
|
19787
19949
|
return () => {
|
|
19788
19950
|
warnOnce2(message);
|
|
@@ -19917,39 +20079,12 @@ function getImageStyle(image, containerSize) {
|
|
|
19917
20079
|
function StaticImage({ image, containerSize, nodeId, alt, }) {
|
|
19918
20080
|
const source = runtime.useImageSource(image, containerSize, nodeId);
|
|
19919
20081
|
const imageStyle = getImageStyle(image, containerSize);
|
|
19920
|
-
const [measuredSizes, setMeasuredSizes,] = react_12.default.useState();
|
|
19921
20082
|
const imageRef = react_12.default.useRef(null);
|
|
19922
|
-
const libraryFeatures = useLibraryFeatures();
|
|
19923
|
-
react_12.default.useEffect(() => {
|
|
19924
|
-
if (!libraryFeatures.imgSizesWorkaroundEnabled)
|
|
19925
|
-
return;
|
|
19926
|
-
const imageElement = imageRef.current;
|
|
19927
|
-
if (!imageElement)
|
|
19928
|
-
return;
|
|
19929
|
-
if (isTest())
|
|
19930
|
-
return;
|
|
19931
|
-
if (!image.sizes)
|
|
19932
|
-
return;
|
|
19933
|
-
const smartComponentParent = imageElement.closest('[data-framer-name]');
|
|
19934
|
-
if (!smartComponentParent)
|
|
19935
|
-
return;
|
|
19936
|
-
const imageNodeWidth = imageElement.clientWidth;
|
|
19937
|
-
const currentSizes = Number(image.sizes.replace('px', ''));
|
|
19938
|
-
if (
|
|
19939
|
-
// If we successfully parsed `sizes`, and...
|
|
19940
|
-
!isNaN(currentSizes) &&
|
|
19941
|
-
// ...if the image node is smaller than the currently set `sizes`
|
|
19942
|
-
// attribute,..
|
|
19943
|
-
imageNodeWidth < currentSizes) {
|
|
19944
|
-
return;
|
|
19945
|
-
}
|
|
19946
|
-
setMeasuredSizes(imageNodeWidth + 'px');
|
|
19947
|
-
}, [image.sizes,]);
|
|
19948
20083
|
return /* @__PURE__ */ (0, jsx_runtime_1.jsx)('img', {
|
|
19949
20084
|
ref: imageRef,
|
|
19950
20085
|
decoding: 'async',
|
|
19951
20086
|
loading: image.loading,
|
|
19952
|
-
sizes:
|
|
20087
|
+
sizes: image.sizes,
|
|
19953
20088
|
srcSet: image.srcSet,
|
|
19954
20089
|
src: source,
|
|
19955
20090
|
alt: alt !== null && alt !== void 0 ? alt : image.alt,
|
|
@@ -20142,6 +20277,143 @@ function Border(props) {
|
|
|
20142
20277
|
function htmlElementAsMotionComponent(asElem) {
|
|
20143
20278
|
return asElem && asElem !== 'search' && asElem !== 'slot' && asElem !== 'template' ? motion[asElem] : motion['div'];
|
|
20144
20279
|
}
|
|
20280
|
+
var import_process = __toESM(require_browser(), 1);
|
|
20281
|
+
var safeNavigator = typeof navigator !== 'undefined' ? navigator : void 0;
|
|
20282
|
+
var isBrowser2 = () => typeof document === 'object';
|
|
20283
|
+
var isWebKit = () => {
|
|
20284
|
+
var _a;
|
|
20285
|
+
return ((_a = safeNavigator) == null ? void 0 : _a.userAgent.includes('AppleWebKit/')) && !isChrome() && !isEdge();
|
|
20286
|
+
};
|
|
20287
|
+
var webkitVersion = () => {
|
|
20288
|
+
let version2 = -1;
|
|
20289
|
+
const regexp = /AppleWebKit\/([\d.]+)/;
|
|
20290
|
+
const result = safeNavigator && regexp.exec(safeNavigator.userAgent);
|
|
20291
|
+
if (result && result[1]) {
|
|
20292
|
+
version2 = parseFloat(result[1]);
|
|
20293
|
+
}
|
|
20294
|
+
return version2;
|
|
20295
|
+
};
|
|
20296
|
+
var safariVersion = () => {
|
|
20297
|
+
let version2 = -1;
|
|
20298
|
+
const regexp = /Version\/([\d.]+)/;
|
|
20299
|
+
const result = safeNavigator && regexp.exec(safeNavigator.userAgent);
|
|
20300
|
+
if (result && result[1]) {
|
|
20301
|
+
version2 = parseFloat(result[1]);
|
|
20302
|
+
}
|
|
20303
|
+
return version2;
|
|
20304
|
+
};
|
|
20305
|
+
var isChrome = () => safeNavigator && /Chrome/.test(safeNavigator.userAgent) && /Google Inc/.test(safeNavigator.vendor) && !isEdge();
|
|
20306
|
+
var isSafari = () => safeNavigator && /Safari/.test(safeNavigator.userAgent) && /Apple Computer/.test(safeNavigator.vendor);
|
|
20307
|
+
var isFirefox = () => safeNavigator && /Firefox\/\d+\.\d+$/.test(safeNavigator.userAgent);
|
|
20308
|
+
var isFramerX = () => safeNavigator && /FramerX/.test(safeNavigator.userAgent);
|
|
20309
|
+
var isEdge = () => safeNavigator && /Edg\//.test(safeNavigator.userAgent);
|
|
20310
|
+
var isAndroid = () => safeNavigator && /android/i.test(safeNavigator.userAgent);
|
|
20311
|
+
var isIOS = () => safeNavigator && /iPhone|iPod|iPad/i.test(safeNavigator.platform);
|
|
20312
|
+
var isMacOS = () => safeNavigator && /Mac/.test(safeNavigator.platform);
|
|
20313
|
+
var isWindows = () => safeNavigator && /Win/.test(safeNavigator.platform);
|
|
20314
|
+
var isTouch = () => safeWindow.ontouchstart === null && safeWindow.ontouchmove === null && safeWindow.ontouchend === null;
|
|
20315
|
+
var isDesktop = () => deviceType() === 'desktop';
|
|
20316
|
+
var isPhone = () => deviceType() === 'phone';
|
|
20317
|
+
var isTablet = () => deviceType() === 'tablet';
|
|
20318
|
+
var isMobile = () => isPhone() || isTablet();
|
|
20319
|
+
var isFileUrl = (url) => url.startsWith('file://');
|
|
20320
|
+
var isDataUrl = (url) => url.startsWith('data:');
|
|
20321
|
+
var isTest = () => import_process.default.env.NODE_ENV === 'test';
|
|
20322
|
+
var isRelativeUrl = (url) => !/^[a-z]{1,8}:\/\/.*$/i.test(url);
|
|
20323
|
+
var isLocalServerUrl = (url) => /[a-z]{1,8}:\/\/127\.0\.0\.1/i.test(url) || /[a-zA-Z]{1,8}:\/\/localhost/.test(url);
|
|
20324
|
+
var isLocalUrl = (url) => {
|
|
20325
|
+
if (isFileUrl(url))
|
|
20326
|
+
return true;
|
|
20327
|
+
if (isLocalServerUrl(url))
|
|
20328
|
+
return true;
|
|
20329
|
+
return false;
|
|
20330
|
+
};
|
|
20331
|
+
var isLocalAssetUrl = (url, baseUrl) => {
|
|
20332
|
+
if (baseUrl === null)
|
|
20333
|
+
baseUrl = safeWindow.location.href;
|
|
20334
|
+
if (isDataUrl(url))
|
|
20335
|
+
return false;
|
|
20336
|
+
if (isLocalUrl(url))
|
|
20337
|
+
return true;
|
|
20338
|
+
if (isRelativeUrl(url) && isLocalUrl(baseUrl))
|
|
20339
|
+
return true;
|
|
20340
|
+
return false;
|
|
20341
|
+
};
|
|
20342
|
+
var devicePixelRatio2 = () => safeWindow.devicePixelRatio;
|
|
20343
|
+
var isJP2Supported = function () {
|
|
20344
|
+
if (isFirefox())
|
|
20345
|
+
return false;
|
|
20346
|
+
return isWebKit();
|
|
20347
|
+
};
|
|
20348
|
+
var isWebPSupported = () => isChrome();
|
|
20349
|
+
var deviceType = () => {
|
|
20350
|
+
if (safeNavigator && /tablet|iPad|Nexus 9/i.test(safeNavigator.userAgent))
|
|
20351
|
+
return 'tablet';
|
|
20352
|
+
if (safeNavigator && /mobi/i.test(safeNavigator.userAgent))
|
|
20353
|
+
return 'phone';
|
|
20354
|
+
return 'desktop';
|
|
20355
|
+
};
|
|
20356
|
+
var deviceOS = () => {
|
|
20357
|
+
if (isMacOS())
|
|
20358
|
+
return 'macos';
|
|
20359
|
+
if (isIOS())
|
|
20360
|
+
return 'ios';
|
|
20361
|
+
if (isAndroid())
|
|
20362
|
+
return 'android';
|
|
20363
|
+
if (isWindows())
|
|
20364
|
+
return 'windows';
|
|
20365
|
+
};
|
|
20366
|
+
var deviceFont = (os) => {
|
|
20367
|
+
if (!os) {
|
|
20368
|
+
os = deviceOS();
|
|
20369
|
+
}
|
|
20370
|
+
const fonts = {
|
|
20371
|
+
apple: '-apple-system, BlinkMacSystemFont, SF Pro Text, SF UI Text, Helvetica Neue',
|
|
20372
|
+
google: 'Roboto, Helvetica Neue',
|
|
20373
|
+
microsoft: 'Segoe UI, Helvetica Neue',
|
|
20374
|
+
};
|
|
20375
|
+
if (os === 'macos')
|
|
20376
|
+
return fonts.apple;
|
|
20377
|
+
if (os === 'ios')
|
|
20378
|
+
return fonts.apple;
|
|
20379
|
+
if (os === 'android')
|
|
20380
|
+
return fonts.google;
|
|
20381
|
+
if (os === 'windows')
|
|
20382
|
+
return fonts.microsoft;
|
|
20383
|
+
return fonts.apple;
|
|
20384
|
+
};
|
|
20385
|
+
var environment = {
|
|
20386
|
+
isWebKit,
|
|
20387
|
+
webkitVersion,
|
|
20388
|
+
isChrome,
|
|
20389
|
+
isSafari,
|
|
20390
|
+
isFirefox,
|
|
20391
|
+
isFramerX,
|
|
20392
|
+
isEdge,
|
|
20393
|
+
isAndroid,
|
|
20394
|
+
isIOS,
|
|
20395
|
+
isMacOS,
|
|
20396
|
+
isWindows,
|
|
20397
|
+
isTouch,
|
|
20398
|
+
isDesktop,
|
|
20399
|
+
isPhone,
|
|
20400
|
+
isTablet,
|
|
20401
|
+
isMobile,
|
|
20402
|
+
isFileUrl,
|
|
20403
|
+
isDataUrl,
|
|
20404
|
+
isRelativeUrl,
|
|
20405
|
+
isLocalServerUrl,
|
|
20406
|
+
isLocalUrl,
|
|
20407
|
+
isLocalAssetUrl,
|
|
20408
|
+
devicePixelRatio: devicePixelRatio2,
|
|
20409
|
+
isJP2Supported,
|
|
20410
|
+
isWebPSupported,
|
|
20411
|
+
deviceType,
|
|
20412
|
+
deviceOS,
|
|
20413
|
+
deviceFont,
|
|
20414
|
+
safariVersion,
|
|
20415
|
+
};
|
|
20416
|
+
exports.environment = environment;
|
|
20145
20417
|
var isChrome2 = /* @__PURE__ */ isChrome();
|
|
20146
20418
|
function layoutHintDataPropsForCenter(center) {
|
|
20147
20419
|
const props = {};
|
|
@@ -29609,6 +29881,9 @@ var LazyValue = class {
|
|
|
29609
29881
|
};
|
|
29610
29882
|
return promise;
|
|
29611
29883
|
}
|
|
29884
|
+
waitFor() {
|
|
29885
|
+
return this.resolver();
|
|
29886
|
+
}
|
|
29612
29887
|
/** Synchronously read the value after calling preload() before. */
|
|
29613
29888
|
read() {
|
|
29614
29889
|
const status = this.status;
|
|
@@ -29628,6 +29903,13 @@ var LazyValue = class {
|
|
|
29628
29903
|
}
|
|
29629
29904
|
};
|
|
29630
29905
|
exports.LazyValue = LazyValue;
|
|
29906
|
+
var LibraryFeaturesContext = /* @__PURE__ */ react_12.default.createContext(void 0);
|
|
29907
|
+
var LibraryFeaturesProvider = /* @__PURE__ */ (() => LibraryFeaturesContext.Provider)();
|
|
29908
|
+
exports.LibraryFeaturesProvider = LibraryFeaturesProvider;
|
|
29909
|
+
var useLibraryFeatures = () => {
|
|
29910
|
+
const context = react_12.default.useContext(LibraryFeaturesContext);
|
|
29911
|
+
return context !== null && context !== void 0 ? context : {};
|
|
29912
|
+
};
|
|
29631
29913
|
function findAnchorElement(target, withinElement) {
|
|
29632
29914
|
if (target instanceof HTMLAnchorElement) {
|
|
29633
29915
|
return target;
|
|
@@ -29975,7 +30257,7 @@ function createOnClickLinkHandler(router, routeId, elementId, combinedPathVariab
|
|
|
29975
30257
|
event.preventDefault();
|
|
29976
30258
|
const route = (_a = router.getRoute) == null ? void 0 : _a.call(router, routeId);
|
|
29977
30259
|
if (route && isLazyComponentType(route == null ? void 0 : route.page)) {
|
|
29978
|
-
|
|
30260
|
+
void route.page.preload();
|
|
29979
30261
|
}
|
|
29980
30262
|
(_b = router.navigate) == null ? void 0 : _b.call(router, routeId, elementId, combinedPathVariables, smoothScroll);
|
|
29981
30263
|
});
|
|
@@ -30421,7 +30703,301 @@ function responseHasError(response) {
|
|
|
30421
30703
|
return typeof response === 'object' && response !== null && 'error' in response && isObject2(response.error) &&
|
|
30422
30704
|
'message' in response.error && typeof response.error.message === 'string';
|
|
30423
30705
|
}
|
|
30424
|
-
|
|
30706
|
+
var loadingFetchResult = {
|
|
30707
|
+
status: 'loading',
|
|
30708
|
+
data: void 0,
|
|
30709
|
+
};
|
|
30710
|
+
function isValidURL2(href) {
|
|
30711
|
+
try {
|
|
30712
|
+
const url = new URL(href);
|
|
30713
|
+
return Boolean(url.protocol);
|
|
30714
|
+
}
|
|
30715
|
+
catch (_j) { }
|
|
30716
|
+
}
|
|
30717
|
+
function isCacheExpired(insertionTimestamp, cacheDuration) {
|
|
30718
|
+
const cacheDurationMs = cacheDuration * 1e3;
|
|
30719
|
+
const currentTimestamp = Date.now();
|
|
30720
|
+
const expirationTimestamp = insertionTimestamp + cacheDurationMs;
|
|
30721
|
+
return currentTimestamp >= expirationTimestamp;
|
|
30722
|
+
}
|
|
30723
|
+
var noop22 = () => { };
|
|
30724
|
+
var _responseValues;
|
|
30725
|
+
var _subscribers;
|
|
30726
|
+
var _cacheDurations;
|
|
30727
|
+
var _cachedAt;
|
|
30728
|
+
var _staleQueriesInterval;
|
|
30729
|
+
var _FetchClient = class {
|
|
30730
|
+
constructor() {
|
|
30731
|
+
__privateAdd(this, _responseValues, /* @__PURE__ */ new Map());
|
|
30732
|
+
__privateAdd(this, _subscribers, /* @__PURE__ */ new Map());
|
|
30733
|
+
__privateAdd(this, _cacheDurations, /* @__PURE__ */ new Map());
|
|
30734
|
+
__privateAdd(this, _cachedAt, /* @__PURE__ */ new Map());
|
|
30735
|
+
__privateAdd(this, _staleQueriesInterval, void 0);
|
|
30736
|
+
__publicField(this, 'checkForStaleQueries', () => {
|
|
30737
|
+
const activeURLS = __privateGet(this, _subscribers).keys();
|
|
30738
|
+
for (const url of activeURLS) {
|
|
30739
|
+
const cachedAt = __privateGet(this, _cachedAt).get(url);
|
|
30740
|
+
const cacheDuration = __privateGet(this, _cacheDurations).get(url);
|
|
30741
|
+
if (!cacheDuration || !cachedAt)
|
|
30742
|
+
continue;
|
|
30743
|
+
void this.fetchWithCache(url, cacheDuration);
|
|
30744
|
+
}
|
|
30745
|
+
});
|
|
30746
|
+
__publicField(this, 'persistCache', debounce(() => {
|
|
30747
|
+
const data2 = {};
|
|
30748
|
+
for (const [url, responseValue,] of __privateGet(this, _responseValues)) {
|
|
30749
|
+
if (!responseValue)
|
|
30750
|
+
continue;
|
|
30751
|
+
if (responseValue.status !== 'success')
|
|
30752
|
+
continue;
|
|
30753
|
+
const cacheConfig = __privateGet(this, _cacheDurations).get(url);
|
|
30754
|
+
if (!cacheConfig || cacheConfig === 0)
|
|
30755
|
+
continue;
|
|
30756
|
+
const storedAt = __privateGet(this, _cachedAt).get(url);
|
|
30757
|
+
if (!storedAt)
|
|
30758
|
+
continue;
|
|
30759
|
+
if (storedAt && isCacheExpired(storedAt, cacheConfig)) {
|
|
30760
|
+
continue;
|
|
30761
|
+
}
|
|
30762
|
+
data2[url] = [storedAt, cacheConfig, responseValue.data,];
|
|
30763
|
+
}
|
|
30764
|
+
localStorage.setItem(_FetchClient.cacheKey, JSON.stringify(data2));
|
|
30765
|
+
}, 500));
|
|
30766
|
+
this.hydrateCache();
|
|
30767
|
+
}
|
|
30768
|
+
hydrateCache() {
|
|
30769
|
+
try {
|
|
30770
|
+
const rawData = localStorage.getItem(_FetchClient.cacheKey);
|
|
30771
|
+
if (!rawData)
|
|
30772
|
+
return;
|
|
30773
|
+
const data2 = JSON.parse(rawData);
|
|
30774
|
+
if (typeof data2 !== 'object')
|
|
30775
|
+
throw new Error('Invalid cache data');
|
|
30776
|
+
for (const url in data2) {
|
|
30777
|
+
const cached = data2[url];
|
|
30778
|
+
if (!Array.isArray(cached) || cached.length !== 3)
|
|
30779
|
+
throw new Error('Invalid cache data');
|
|
30780
|
+
const [storedAt, cacheDuration, cachedData,] = cached;
|
|
30781
|
+
if (isCacheExpired(storedAt, cacheDuration))
|
|
30782
|
+
continue;
|
|
30783
|
+
__privateGet(this, _cachedAt).set(url, storedAt);
|
|
30784
|
+
__privateGet(this, _cacheDurations).set(url, cacheDuration);
|
|
30785
|
+
__privateGet(this, _responseValues).set(url, {
|
|
30786
|
+
status: 'success',
|
|
30787
|
+
data: cachedData,
|
|
30788
|
+
});
|
|
30789
|
+
}
|
|
30790
|
+
}
|
|
30791
|
+
catch (error) {
|
|
30792
|
+
localStorage.removeItem(_FetchClient.cacheKey);
|
|
30793
|
+
}
|
|
30794
|
+
}
|
|
30795
|
+
setResponseValue(url, value) {
|
|
30796
|
+
__privateGet(this, _responseValues).set(url, value);
|
|
30797
|
+
this.persistCache();
|
|
30798
|
+
const subscribers = __privateGet(this, _subscribers).get(url);
|
|
30799
|
+
if (!subscribers)
|
|
30800
|
+
return;
|
|
30801
|
+
for (const subscriber of subscribers) {
|
|
30802
|
+
subscriber();
|
|
30803
|
+
}
|
|
30804
|
+
}
|
|
30805
|
+
prefetch(url, cacheDuration) {
|
|
30806
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
30807
|
+
if (!isValidURL2(url))
|
|
30808
|
+
return;
|
|
30809
|
+
return this.fetchWithCache(url, cacheDuration);
|
|
30810
|
+
});
|
|
30811
|
+
}
|
|
30812
|
+
fetchWithCache(url, cacheDuration) {
|
|
30813
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
30814
|
+
try {
|
|
30815
|
+
const cachedAt = __privateGet(this, _cachedAt).get(url);
|
|
30816
|
+
const hasExpiredCache = cachedAt && isCacheExpired(cachedAt, cacheDuration);
|
|
30817
|
+
if (__privateGet(this, _responseValues).has(url) && !hasExpiredCache) {
|
|
30818
|
+
return;
|
|
30819
|
+
}
|
|
30820
|
+
const currentValue = __privateGet(this, _responseValues).get(url);
|
|
30821
|
+
if (!currentValue) {
|
|
30822
|
+
this.setResponseValue(url, loadingFetchResult);
|
|
30823
|
+
}
|
|
30824
|
+
const response = yield fetch(url, {
|
|
30825
|
+
method: 'GET',
|
|
30826
|
+
headers: {
|
|
30827
|
+
// Default to JSON always or no?
|
|
30828
|
+
'Content-Type': 'application/json',
|
|
30829
|
+
},
|
|
30830
|
+
});
|
|
30831
|
+
if (!response.ok) {
|
|
30832
|
+
this.setResponseValue(url, {
|
|
30833
|
+
status: 'error',
|
|
30834
|
+
error: new Error('Invalid Response Status'),
|
|
30835
|
+
data: void 0,
|
|
30836
|
+
});
|
|
30837
|
+
return;
|
|
30838
|
+
}
|
|
30839
|
+
const value = yield response.json();
|
|
30840
|
+
this.setResponseValue(url, {
|
|
30841
|
+
status: 'success',
|
|
30842
|
+
data: value,
|
|
30843
|
+
});
|
|
30844
|
+
__privateGet(this, _cachedAt).set(url, Date.now());
|
|
30845
|
+
}
|
|
30846
|
+
catch (error) {
|
|
30847
|
+
this.setResponseValue(url, {
|
|
30848
|
+
status: 'error',
|
|
30849
|
+
error,
|
|
30850
|
+
data: void 0,
|
|
30851
|
+
});
|
|
30852
|
+
}
|
|
30853
|
+
});
|
|
30854
|
+
}
|
|
30855
|
+
getValue(url) {
|
|
30856
|
+
return __privateGet(this, _responseValues).get(url);
|
|
30857
|
+
}
|
|
30858
|
+
subscribe(url, callback, cacheDuration) {
|
|
30859
|
+
var _j;
|
|
30860
|
+
if (!isValidURL2(url))
|
|
30861
|
+
return noop22;
|
|
30862
|
+
const cacheDurationForUrl = __privateGet(this, _cacheDurations).get(url);
|
|
30863
|
+
if (!cacheDurationForUrl || cacheDuration < cacheDurationForUrl) {
|
|
30864
|
+
__privateGet(this, _cacheDurations).set(url, cacheDuration);
|
|
30865
|
+
}
|
|
30866
|
+
if (!__privateGet(this, _staleQueriesInterval)) {
|
|
30867
|
+
__privateSet(this, _staleQueriesInterval, safeWindow.setInterval(this.checkForStaleQueries, 5e3));
|
|
30868
|
+
}
|
|
30869
|
+
void this.fetchWithCache(url, cacheDuration);
|
|
30870
|
+
const subscribers = (_j = __privateGet(this, _subscribers).get(url)) !== null && _j !== void 0 ? _j : new Set();
|
|
30871
|
+
subscribers.add(callback);
|
|
30872
|
+
__privateGet(this, _subscribers).set(url, subscribers);
|
|
30873
|
+
return () => {
|
|
30874
|
+
const nextSubscribers = __privateGet(this, _subscribers).get(url);
|
|
30875
|
+
if (!nextSubscribers)
|
|
30876
|
+
return;
|
|
30877
|
+
nextSubscribers.delete(callback);
|
|
30878
|
+
if (nextSubscribers.size === 0) {
|
|
30879
|
+
__privateGet(this, _subscribers).delete(url);
|
|
30880
|
+
}
|
|
30881
|
+
if (__privateGet(this, _subscribers).size === 0) {
|
|
30882
|
+
safeWindow.clearInterval(__privateGet(this, _staleQueriesInterval));
|
|
30883
|
+
__privateSet(this, _staleQueriesInterval, void 0);
|
|
30884
|
+
}
|
|
30885
|
+
};
|
|
30886
|
+
}
|
|
30887
|
+
};
|
|
30888
|
+
var FetchClient = _FetchClient;
|
|
30889
|
+
_responseValues = /* @__PURE__ */ new WeakMap();
|
|
30890
|
+
_subscribers = /* @__PURE__ */ new WeakMap();
|
|
30891
|
+
_cacheDurations = /* @__PURE__ */ new WeakMap();
|
|
30892
|
+
_cachedAt = /* @__PURE__ */ new WeakMap();
|
|
30893
|
+
_staleQueriesInterval = /* @__PURE__ */ new WeakMap();
|
|
30894
|
+
__publicField(FetchClient, 'cacheKey', 'framer-fetch-cache');
|
|
30895
|
+
var FetchClientContext = React2.createContext(void 0);
|
|
30896
|
+
var FetchClientProvider = ({ children, }) => {
|
|
30897
|
+
const [client,] = React2.useState(() => new FetchClient());
|
|
30898
|
+
return /* @__PURE__ */ (0, jsx_runtime_1.jsx)(FetchClientContext.Provider, {
|
|
30899
|
+
value: client,
|
|
30900
|
+
children,
|
|
30901
|
+
});
|
|
30902
|
+
};
|
|
30903
|
+
function difference(array1, array2) {
|
|
30904
|
+
return array1.filter((x) => !array2.includes(x));
|
|
30905
|
+
}
|
|
30906
|
+
var _subscriptions;
|
|
30907
|
+
var _subscribers2;
|
|
30908
|
+
var _cachedResults;
|
|
30909
|
+
var _queryResult;
|
|
30910
|
+
var RequestsObserver = class {
|
|
30911
|
+
constructor(client) {
|
|
30912
|
+
this.client = client;
|
|
30913
|
+
__privateAdd(this, _subscriptions, /* @__PURE__ */ new Map());
|
|
30914
|
+
__privateAdd(this, _subscribers2, /* @__PURE__ */ new Set());
|
|
30915
|
+
__privateAdd(this, _cachedResults, /* @__PURE__ */ new WeakSet());
|
|
30916
|
+
__privateAdd(this, _queryResult, /* @__PURE__ */ new Map());
|
|
30917
|
+
__publicField(this, 'onFetchResultUpdate', () => {
|
|
30918
|
+
const results = /* @__PURE__ */ new Map();
|
|
30919
|
+
let hasChange = false;
|
|
30920
|
+
const subscribedUrls = __privateGet(this, _subscriptions).keys();
|
|
30921
|
+
for (const url of subscribedUrls) {
|
|
30922
|
+
const result = this.client.getValue(url);
|
|
30923
|
+
if (!result)
|
|
30924
|
+
return;
|
|
30925
|
+
results.set(url, result);
|
|
30926
|
+
if (!__privateGet(this, _cachedResults).has(result)) {
|
|
30927
|
+
__privateGet(this, _cachedResults).add(result);
|
|
30928
|
+
hasChange = true;
|
|
30929
|
+
}
|
|
30930
|
+
}
|
|
30931
|
+
if (!hasChange) {
|
|
30932
|
+
return;
|
|
30933
|
+
}
|
|
30934
|
+
__privateSet(this, _queryResult, results);
|
|
30935
|
+
for (const subscriber of __privateGet(this, _subscribers2)) {
|
|
30936
|
+
subscriber();
|
|
30937
|
+
}
|
|
30938
|
+
});
|
|
30939
|
+
__publicField(this, 'subscribe', (callback) => {
|
|
30940
|
+
__privateGet(this, _subscribers2).add(callback);
|
|
30941
|
+
return () => {
|
|
30942
|
+
__privateGet(this, _subscribers2).delete(callback);
|
|
30943
|
+
};
|
|
30944
|
+
});
|
|
30945
|
+
__publicField(this, 'getResults', () => {
|
|
30946
|
+
return __privateGet(this, _queryResult);
|
|
30947
|
+
});
|
|
30948
|
+
}
|
|
30949
|
+
setRequests(requests) {
|
|
30950
|
+
var _j;
|
|
30951
|
+
var _a;
|
|
30952
|
+
const requestsByURL = new Map(requests.map((query) => [query.url, query,]));
|
|
30953
|
+
const nextSubscribedURLs = Array.from(requestsByURL.keys());
|
|
30954
|
+
const hasSubscriptionChange = nextSubscribedURLs.some((url) => !__privateGet(this, _subscriptions).has(url));
|
|
30955
|
+
if (nextSubscribedURLs.length !== __privateGet(this, _subscriptions).size && !hasSubscriptionChange) {
|
|
30956
|
+
return;
|
|
30957
|
+
}
|
|
30958
|
+
const currentSubscribedURLs = Array.from(__privateGet(this, _subscriptions).keys());
|
|
30959
|
+
const unsubscribeURLs = difference(currentSubscribedURLs, nextSubscribedURLs);
|
|
30960
|
+
for (const url of unsubscribeURLs) {
|
|
30961
|
+
(_a = __privateGet(this, _subscriptions).get(url)) == null ? void 0 : _a();
|
|
30962
|
+
__privateGet(this, _subscriptions).delete(url);
|
|
30963
|
+
}
|
|
30964
|
+
const toSubscribeURLs = difference(nextSubscribedURLs, currentSubscribedURLs);
|
|
30965
|
+
for (const url of toSubscribeURLs) {
|
|
30966
|
+
const requestConfig = requestsByURL.get(url);
|
|
30967
|
+
const unsubscribe = this.client.subscribe(url, this.onFetchResultUpdate, (_j = (requestConfig == null ? void 0 : requestConfig.cacheDuration)) !== null && _j !== void 0 ? _j : 0);
|
|
30968
|
+
__privateGet(this, _subscriptions).set(url, unsubscribe);
|
|
30969
|
+
}
|
|
30970
|
+
__privateSet(this, _cachedResults, /* @__PURE__ */ new WeakSet());
|
|
30971
|
+
this.onFetchResultUpdate();
|
|
30972
|
+
}
|
|
30973
|
+
};
|
|
30974
|
+
_subscriptions = /* @__PURE__ */ new WeakMap();
|
|
30975
|
+
_subscribers2 = /* @__PURE__ */ new WeakMap();
|
|
30976
|
+
_cachedResults = /* @__PURE__ */ new WeakMap();
|
|
30977
|
+
_queryResult = /* @__PURE__ */ new WeakMap();
|
|
30978
|
+
function useFetchRequests(requests, disabled) {
|
|
30979
|
+
const fetchClient = React2.useContext(FetchClientContext);
|
|
30980
|
+
if (!fetchClient) {
|
|
30981
|
+
throw new Error('useFetchRequest must be used within a FetchClientProvider');
|
|
30982
|
+
}
|
|
30983
|
+
const [observer2,] = React2.useState(() => new RequestsObserver(fetchClient));
|
|
30984
|
+
React2.useLayoutEffect(() => {
|
|
30985
|
+
if (disabled)
|
|
30986
|
+
return;
|
|
30987
|
+
observer2.setRequests(requests);
|
|
30988
|
+
}, [requests, observer2, disabled,]);
|
|
30989
|
+
return React2.useSyncExternalStore(observer2.subscribe, observer2.getResults, observer2.getResults);
|
|
30990
|
+
}
|
|
30991
|
+
function usePrefetch() {
|
|
30992
|
+
const fetchClient = React2.useContext(FetchClientContext);
|
|
30993
|
+
if (!fetchClient) {
|
|
30994
|
+
throw new Error('useFetchRequest must be used within a FetchClientProvider');
|
|
30995
|
+
}
|
|
30996
|
+
return React2.useCallback((url, cacheDuration) => fetchClient.prefetch(url, cacheDuration), [fetchClient,]);
|
|
30997
|
+
}
|
|
30998
|
+
exports.usePrefetch = usePrefetch;
|
|
30999
|
+
function PageRoot({ RootComponent, isWebsite, routeId, framerSiteId, pathVariables, routes, collectionUtils, notFoundPage, isReducedMotion = false, includeDataObserver = false, localeId, locales, preserveQueryParams, }) {
|
|
31000
|
+
const { enableAsyncURLUpdates, } = useLibraryFeatures();
|
|
30425
31001
|
react_12.default.useEffect(() => {
|
|
30426
31002
|
if (isWebsite)
|
|
30427
31003
|
return;
|
|
@@ -30433,21 +31009,22 @@ function PageRoot({ RootComponent, isWebsite, routeId, framerSiteId, pathVariabl
|
|
|
30433
31009
|
children: /* @__PURE__ */ (0, jsx_runtime_1.jsx)(CustomCursorHost, {
|
|
30434
31010
|
children: /* @__PURE__ */ (0, jsx_runtime_1.jsx)(FormContext.Provider, {
|
|
30435
31011
|
value: framerSiteId,
|
|
30436
|
-
children: /* @__PURE__ */ (0, jsx_runtime_1.jsx)(
|
|
30437
|
-
|
|
30438
|
-
|
|
30439
|
-
|
|
30440
|
-
|
|
30441
|
-
|
|
30442
|
-
|
|
30443
|
-
|
|
30444
|
-
|
|
30445
|
-
|
|
30446
|
-
|
|
30447
|
-
|
|
30448
|
-
|
|
30449
|
-
|
|
30450
|
-
|
|
31012
|
+
children: /* @__PURE__ */ (0, jsx_runtime_1.jsx)(FetchClientProvider, {
|
|
31013
|
+
children: /* @__PURE__ */ (0, jsx_runtime_1.jsx)(Router, {
|
|
31014
|
+
initialRoute: routeId,
|
|
31015
|
+
initialPathVariables: pathVariables,
|
|
31016
|
+
initialLocaleId: localeId,
|
|
31017
|
+
routes,
|
|
31018
|
+
collectionUtils,
|
|
31019
|
+
notFoundPage,
|
|
31020
|
+
locales,
|
|
31021
|
+
defaultPageStyle: {
|
|
31022
|
+
minHeight: '100vh',
|
|
31023
|
+
width: 'auto',
|
|
31024
|
+
},
|
|
31025
|
+
preserveQueryParams,
|
|
31026
|
+
enableAsyncURLUpdates,
|
|
31027
|
+
}),
|
|
30451
31028
|
}),
|
|
30452
31029
|
}),
|
|
30453
31030
|
}),
|
|
@@ -30682,6 +31259,85 @@ var ResolveLinks = /* @__PURE__ */ React2.forwardRef(function ResolveLinksInner(
|
|
|
30682
31259
|
return cloneWithPropsAndRef(childrenWithLinks, rest);
|
|
30683
31260
|
});
|
|
30684
31261
|
exports.ResolveLinks = ResolveLinks;
|
|
31262
|
+
function isObjectOrArray(value) {
|
|
31263
|
+
return typeof value === 'object' && value !== null;
|
|
31264
|
+
}
|
|
31265
|
+
function getPropertyByPath(input, keyPath) {
|
|
31266
|
+
if (keyPath === '') {
|
|
31267
|
+
return input;
|
|
31268
|
+
}
|
|
31269
|
+
const keyParts = keyPath.split(/[.[\]]+/u).filter((part) => part.length > 0);
|
|
31270
|
+
let current = input;
|
|
31271
|
+
for (const part of keyParts) {
|
|
31272
|
+
if (!isObjectOrArray(current)) {
|
|
31273
|
+
return void 0;
|
|
31274
|
+
}
|
|
31275
|
+
current = current[part];
|
|
31276
|
+
}
|
|
31277
|
+
return current;
|
|
31278
|
+
}
|
|
31279
|
+
function isValidFetchDataValueResult(type, value) {
|
|
31280
|
+
switch (type) {
|
|
31281
|
+
case 'string':
|
|
31282
|
+
return isString22(value) || isNumber2(value);
|
|
31283
|
+
case 'boolean':
|
|
31284
|
+
return isBoolean(value);
|
|
31285
|
+
case 'number':
|
|
31286
|
+
return isNumber2(value);
|
|
31287
|
+
default: {
|
|
31288
|
+
const _ = type;
|
|
31289
|
+
return false;
|
|
31290
|
+
}
|
|
31291
|
+
}
|
|
31292
|
+
}
|
|
31293
|
+
function resolveFetchDataValue(result, request) {
|
|
31294
|
+
if (result.status === 'loading') {
|
|
31295
|
+
return request.fallbackValue;
|
|
31296
|
+
}
|
|
31297
|
+
if (result.status === 'error') {
|
|
31298
|
+
return request.fallbackValue;
|
|
31299
|
+
}
|
|
31300
|
+
const resolvedValue = getPropertyByPath(result.data, request.resultKeyPath);
|
|
31301
|
+
if (!isValidFetchDataValueResult(request.resultOutputType, resolvedValue)) {
|
|
31302
|
+
return request.fallbackValue;
|
|
31303
|
+
}
|
|
31304
|
+
return resolvedValue;
|
|
31305
|
+
}
|
|
31306
|
+
function useFetchDataValues(requests, disabled) {
|
|
31307
|
+
const fetchResults = useFetchRequests(requests, disabled);
|
|
31308
|
+
const data2 = React2.useMemo(() => {
|
|
31309
|
+
return requests.map((request) => {
|
|
31310
|
+
const fetchResult = fetchResults.get(request.url);
|
|
31311
|
+
if (!fetchResult) {
|
|
31312
|
+
return request.fallbackValue;
|
|
31313
|
+
}
|
|
31314
|
+
return resolveFetchDataValue(fetchResult, request);
|
|
31315
|
+
});
|
|
31316
|
+
}, [fetchResults, requests,]);
|
|
31317
|
+
const status = React2.useMemo(() => {
|
|
31318
|
+
const statuses = /* @__PURE__ */ new Set();
|
|
31319
|
+
for (const fetchResult of fetchResults.values()) {
|
|
31320
|
+
statuses.add(fetchResult.status);
|
|
31321
|
+
}
|
|
31322
|
+
if (statuses.has('error'))
|
|
31323
|
+
return 'error';
|
|
31324
|
+
if (statuses.has('loading'))
|
|
31325
|
+
return 'loading';
|
|
31326
|
+
return 'success';
|
|
31327
|
+
}, [fetchResults,]);
|
|
31328
|
+
return {
|
|
31329
|
+
status,
|
|
31330
|
+
data: data2,
|
|
31331
|
+
};
|
|
31332
|
+
}
|
|
31333
|
+
var Fetcher = /* @__PURE__ */ React2.forwardRef(function Fetcher2(_j, ref) {
|
|
31334
|
+
var { requests, disabled, children } = _j, rest = __rest(_j, ["requests", "disabled", "children"]);
|
|
31335
|
+
const cloneWithPropsAndRef = useCloneChildrenWithPropsAndRef(ref);
|
|
31336
|
+
const { data: data2, status, } = useFetchDataValues(requests, disabled);
|
|
31337
|
+
const childrenWithValues = children(data2, status);
|
|
31338
|
+
return cloneWithPropsAndRef(childrenWithValues, rest);
|
|
31339
|
+
});
|
|
31340
|
+
exports.Fetcher = Fetcher;
|
|
30685
31341
|
var callEach = (...fns) => fns.forEach((fn) => fn && fn());
|
|
30686
31342
|
exports.callEach = callEach;
|
|
30687
31343
|
var import_archy = __toESM(require_archy(), 1);
|
|
@@ -30762,7 +31418,7 @@ var CompatibilityDatabaseCollection = class {
|
|
|
30762
31418
|
const data2 = {};
|
|
30763
31419
|
for (const key7 in this.schema) {
|
|
30764
31420
|
const value = item[key7];
|
|
30765
|
-
if (
|
|
31421
|
+
if (isNullish2(value))
|
|
30766
31422
|
continue;
|
|
30767
31423
|
const definition = this.schema[key7];
|
|
30768
31424
|
if (isUndefined(definition))
|
|
@@ -32317,10 +32973,10 @@ var SortItemsPlan = class extends QueryPlan {
|
|
|
32317
32973
|
if (DatabaseValue.equal(left, right, collation)) {
|
|
32318
32974
|
continue;
|
|
32319
32975
|
}
|
|
32320
|
-
if (DatabaseValue.lessThan(left, right, collation) ||
|
|
32976
|
+
if (DatabaseValue.lessThan(left, right, collation) || isNullish2(left)) {
|
|
32321
32977
|
return isAscending ? -1 : 1;
|
|
32322
32978
|
}
|
|
32323
|
-
if (DatabaseValue.greaterThan(left, right, collation) ||
|
|
32979
|
+
if (DatabaseValue.greaterThan(left, right, collation) || isNullish2(right)) {
|
|
32324
32980
|
return isAscending ? 1 : -1;
|
|
32325
32981
|
}
|
|
32326
32982
|
throw new Error('Invalid comparison result.');
|
|
@@ -32355,14 +33011,14 @@ var SliceItemsPlan = class extends QueryPlan {
|
|
|
32355
33011
|
getOffset() {
|
|
32356
33012
|
var _a;
|
|
32357
33013
|
const value = (_a = this.offsetExpression) == null ? void 0 : _a.evaluate();
|
|
32358
|
-
if (
|
|
33014
|
+
if (isNullish2(value) || value.type !== 'number')
|
|
32359
33015
|
return;
|
|
32360
33016
|
return value.value;
|
|
32361
33017
|
}
|
|
32362
33018
|
getLimit() {
|
|
32363
33019
|
var _a;
|
|
32364
33020
|
const value = (_a = this.limitExpression) == null ? void 0 : _a.evaluate();
|
|
32365
|
-
if (
|
|
33021
|
+
if (isNullish2(value) || value.type !== 'number')
|
|
32366
33022
|
return;
|
|
32367
33023
|
return value.value;
|
|
32368
33024
|
}
|
|
@@ -32635,7 +33291,7 @@ function getSelectKey(expression) {
|
|
|
32635
33291
|
}
|
|
32636
33292
|
function resolveValue(richTextResolver, value) {
|
|
32637
33293
|
return __awaiter(this, void 0, void 0, function* () {
|
|
32638
|
-
if (
|
|
33294
|
+
if (isNullish2(value)) {
|
|
32639
33295
|
return null;
|
|
32640
33296
|
}
|
|
32641
33297
|
if (value.type === 'richtext') {
|
|
@@ -33498,6 +34154,13 @@ function useQueryCount(query) {
|
|
|
33498
34154
|
const collection = useQueryData(countQuery);
|
|
33499
34155
|
return collection.length;
|
|
33500
34156
|
}
|
|
34157
|
+
function usePreloadQuery() {
|
|
34158
|
+
const { activeLocale, } = useLocaleInfo();
|
|
34159
|
+
return (0, react_5.useCallback)((query) => __awaiter(this, void 0, void 0, function* () {
|
|
34160
|
+
return queryCache.get(query, activeLocale).waitFor();
|
|
34161
|
+
}), [activeLocale,]);
|
|
34162
|
+
}
|
|
34163
|
+
exports.usePreloadQuery = usePreloadQuery;
|
|
33501
34164
|
function getWhereExpressionFromPathVariables(pathVariables) {
|
|
33502
34165
|
const entries = Object.entries(pathVariables).filter(([, value,]) => {
|
|
33503
34166
|
if (isUndefined(value))
|
|
@@ -33618,8 +34281,10 @@ var VariantSelector = /* @__PURE__ */ ((VariantSelector2) => {
|
|
|
33618
34281
|
return VariantSelector2;
|
|
33619
34282
|
})(VariantSelector || {});
|
|
33620
34283
|
exports.VariantSelector = VariantSelector;
|
|
33621
|
-
function getGesture(enabledGestures, isHovered, isPressed) {
|
|
33622
|
-
const { hover, pressed, } = enabledGestures || {};
|
|
34284
|
+
function getGesture(enabledGestures, isHovered, isPressed, isLoading) {
|
|
34285
|
+
const { hover, pressed, loading, } = enabledGestures || {};
|
|
34286
|
+
if (loading && isLoading)
|
|
34287
|
+
return 'loading';
|
|
33623
34288
|
if (pressed && isPressed)
|
|
33624
34289
|
return 'pressed';
|
|
33625
34290
|
if (hover && isHovered)
|
|
@@ -33642,6 +34307,7 @@ var CycleVariantState = /* @__PURE__ */ Symbol('cycle');
|
|
|
33642
34307
|
exports.CycleVariantState = CycleVariantState;
|
|
33643
34308
|
function useVariantState({ variant, defaultVariant: externalDefaultVariant, transitions: externalTransitions, enabledGestures: externalEnabledGestures, cycleOrder: externalCycleOrder = [], variantProps: variantProps2 = {}, variantClassNames = {}, }) {
|
|
33644
34309
|
const forceUpdate = useForceUpdate3();
|
|
34310
|
+
const isCanvas = useIsOnFramerCanvas();
|
|
33645
34311
|
const validBaseVariants = useConstant2(() => new Set(externalCycleOrder));
|
|
33646
34312
|
const internalState = react_12.default.useRef({
|
|
33647
34313
|
isHovered: false,
|
|
@@ -33650,6 +34316,7 @@ function useVariantState({ variant, defaultVariant: externalDefaultVariant, tran
|
|
|
33650
34316
|
baseVariant: safeBaseVariant(variant, externalDefaultVariant, validBaseVariants),
|
|
33651
34317
|
lastVariant: variant,
|
|
33652
34318
|
gestureVariant: void 0,
|
|
34319
|
+
loadedBaseVariant: {},
|
|
33653
34320
|
// When used in generated components, these are static values defined
|
|
33654
34321
|
// outside of the component function that also need to not result in
|
|
33655
34322
|
// memoized values being recalculated, so we dump them into the ref.
|
|
@@ -33661,11 +34328,11 @@ function useVariantState({ variant, defaultVariant: externalDefaultVariant, tran
|
|
|
33661
34328
|
const resolveNextVariant = react_12.default.useCallback((targetBaseVariant) => {
|
|
33662
34329
|
const { isHovered: isHovered2, isPressed: isPressed2, enabledGestures: enabledGestures2, defaultVariant: defaultVariant2, } = internalState.current;
|
|
33663
34330
|
const nextBaseVariant = safeBaseVariant(targetBaseVariant, defaultVariant2, validBaseVariants);
|
|
33664
|
-
const gesture = getGesture(enabledGestures2 == null ? void 0 : enabledGestures2[nextBaseVariant], isHovered2, isPressed2);
|
|
34331
|
+
const gesture = getGesture(enabledGestures2 == null ? void 0 : enabledGestures2[nextBaseVariant], isHovered2, isPressed2, false);
|
|
33665
34332
|
const nextGestureVariant = gesture ? createGestureVariant(nextBaseVariant, gesture) : void 0;
|
|
33666
34333
|
return [nextBaseVariant, nextGestureVariant,];
|
|
33667
34334
|
}, [validBaseVariants,]);
|
|
33668
|
-
const setGestureState = react_12.default.useCallback(({ isHovered: isHovered2, isPressed: isPressed2, }) => {
|
|
34335
|
+
const setGestureState = react_12.default.useCallback(({ isHovered: isHovered2, isPressed: isPressed2, isLoading, }) => {
|
|
33669
34336
|
if (isHovered2 !== void 0)
|
|
33670
34337
|
internalState.current.isHovered = isHovered2;
|
|
33671
34338
|
if (isPressed2 !== void 0)
|
|
@@ -33690,6 +34357,11 @@ function useVariantState({ variant, defaultVariant: externalDefaultVariant, tran
|
|
|
33690
34357
|
forceUpdate();
|
|
33691
34358
|
}
|
|
33692
34359
|
}, [resolveNextVariant, forceUpdate,]);
|
|
34360
|
+
const clearLoadingGesture = react_12.default.useCallback(() => {
|
|
34361
|
+
const { baseVariant: baseVariant2, } = internalState.current;
|
|
34362
|
+
internalState.current.loadedBaseVariant[baseVariant2] = true;
|
|
34363
|
+
forceUpdate();
|
|
34364
|
+
}, [forceUpdate,]);
|
|
33693
34365
|
if (variant !== internalState.current.lastVariant) {
|
|
33694
34366
|
const [nextBase, nextGesture,] = resolveNextVariant(variant);
|
|
33695
34367
|
internalState.current.lastVariant = nextBase;
|
|
@@ -33698,14 +34370,18 @@ function useVariantState({ variant, defaultVariant: externalDefaultVariant, tran
|
|
|
33698
34370
|
internalState.current.gestureVariant = nextGesture;
|
|
33699
34371
|
}
|
|
33700
34372
|
}
|
|
33701
|
-
const { baseVariant, gestureVariant, defaultVariant, enabledGestures, isHovered, isPressed, } = internalState.current;
|
|
34373
|
+
const { baseVariant, gestureVariant, defaultVariant, enabledGestures, isHovered, isPressed, loadedBaseVariant, } = internalState.current;
|
|
33702
34374
|
const addVariantProps = useAddVariantProps(internalState.current.baseVariant, internalState.current.gestureVariant, variantProps2);
|
|
33703
34375
|
return react_12.default.useMemo(() => {
|
|
34376
|
+
var _a;
|
|
33704
34377
|
const variants = [];
|
|
33705
34378
|
if (baseVariant !== defaultVariant)
|
|
33706
34379
|
variants.push(baseVariant);
|
|
33707
|
-
|
|
33708
|
-
|
|
34380
|
+
const hasLoadingVariant = (_a = enabledGestures == null ? void 0 : enabledGestures[baseVariant]) == null ? void 0 : _a.loading;
|
|
34381
|
+
const isLoading = !isCanvas && !!hasLoadingVariant && !loadedBaseVariant[baseVariant];
|
|
34382
|
+
const gesture = isLoading ? createGestureVariant(baseVariant, 'loading') : gestureVariant;
|
|
34383
|
+
if (gesture)
|
|
34384
|
+
variants.push(gesture);
|
|
33709
34385
|
const gestures = enabledGestures == null ? void 0 : enabledGestures[baseVariant];
|
|
33710
34386
|
const gestureHandlers = {
|
|
33711
34387
|
onMouseEnter: () => setGestureState({
|
|
@@ -33731,24 +34407,28 @@ function useVariantState({ variant, defaultVariant: externalDefaultVariant, tran
|
|
|
33731
34407
|
return {
|
|
33732
34408
|
variants,
|
|
33733
34409
|
baseVariant,
|
|
33734
|
-
gestureVariant,
|
|
34410
|
+
gestureVariant: gesture,
|
|
34411
|
+
isLoading,
|
|
33735
34412
|
transition: activeTransition(internalState.current.transitions, baseVariant),
|
|
33736
34413
|
setVariant,
|
|
33737
34414
|
setGestureState,
|
|
34415
|
+
clearLoadingGesture,
|
|
33738
34416
|
addVariantProps,
|
|
33739
34417
|
gestureHandlers,
|
|
33740
|
-
classNames: cx(createVariantClassName(baseVariant, variantClassNames), getGesture(gestures, isHovered, isPressed)),
|
|
34418
|
+
classNames: cx(createVariantClassName(baseVariant, variantClassNames), getGesture(gestures, isHovered, isPressed, isLoading)),
|
|
33741
34419
|
};
|
|
33742
34420
|
}, [
|
|
33743
34421
|
baseVariant,
|
|
33744
34422
|
gestureVariant,
|
|
33745
34423
|
isHovered,
|
|
33746
34424
|
isPressed,
|
|
34425
|
+
loadedBaseVariant,
|
|
33747
34426
|
addVariantProps,
|
|
33748
34427
|
setVariant,
|
|
33749
34428
|
defaultVariant,
|
|
33750
34429
|
enabledGestures,
|
|
33751
34430
|
setGestureState,
|
|
34431
|
+
clearLoadingGesture,
|
|
33752
34432
|
variantClassNames,
|
|
33753
34433
|
]);
|
|
33754
34434
|
}
|
|
@@ -38679,6 +39359,15 @@ function upgradeComponentFontV1(font) {
|
|
|
38679
39359
|
}
|
|
38680
39360
|
return Object.assign(Object.assign({}, font), { source });
|
|
38681
39361
|
}
|
|
39362
|
+
function withPerformanceMarks(prefix2, callback) {
|
|
39363
|
+
const markStart = `${prefix2}-start`;
|
|
39364
|
+
performance.mark(markStart);
|
|
39365
|
+
callback();
|
|
39366
|
+
const markEnd = `${prefix2}-end`;
|
|
39367
|
+
performance.mark(markEnd);
|
|
39368
|
+
performance.measure(prefix2, markStart, markEnd);
|
|
39369
|
+
}
|
|
39370
|
+
exports.withPerformanceMarks = withPerformanceMarks;
|
|
38682
39371
|
function loadJSON(url) {
|
|
38683
39372
|
return fetch(url, {
|
|
38684
39373
|
mode: 'cors',
|
|
@@ -38856,7 +39545,7 @@ var package_default = {
|
|
|
38856
39545
|
yargs: '^17.6.2',
|
|
38857
39546
|
},
|
|
38858
39547
|
peerDependencies: {
|
|
38859
|
-
'framer-motion': '11.2.
|
|
39548
|
+
'framer-motion': '11.2.13',
|
|
38860
39549
|
react: '^18.2.0',
|
|
38861
39550
|
'react-dom': '^18.2.0',
|
|
38862
39551
|
},
|