unframer 2.6.3 → 2.6.4
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/framer.d.ts.map +1 -1
- package/dist/framer.js +374 -370
- package/dist/framer.js.map +1 -1
- package/esm/framer.d.ts.map +1 -1
- package/esm/framer.js +362 -359
- package/esm/framer.js.map +1 -1
- package/package.json +1 -1
- package/src/framer.js +385 -378
package/dist/framer.js
CHANGED
|
@@ -47,14 +47,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
47
47
|
};
|
|
48
48
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
49
49
|
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.ChildrenCanSuspend = 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
|
-
exports.
|
|
51
|
-
exports.
|
|
52
|
-
exports.
|
|
53
|
-
exports.
|
|
54
|
-
exports.
|
|
55
|
-
exports.
|
|
56
|
-
exports.wrap = exports.withVariantFX = exports.withVariantAppearEffect = exports.withStyleAppearEffect = exports.withShape = exports.withPerformanceMarks = exports.withPath = exports.withParallaxTransform = exports.WithOverride = exports.withOptimizedAppearEffect = 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 = exports.useTransform = exports.useTime = exports.useSpring = exports.useScroll = void 0;
|
|
57
|
-
// https :https://app.framerstatic.com/chunk-
|
|
50
|
+
exports.easeOut = exports.easeInOut = exports.easeIn = exports.Draggable = exports.DragControls = exports.domMin = 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 = exports.ComponentViewportProvider = void 0;
|
|
51
|
+
exports.injectComponentCSSRules = exports.inferInitialRouteFromPath = exports.imageUrlForAsset = exports.imagePatternPropsForFill = exports.Image = exports.gradientForShape = exports.getWhereExpressionFromPathVariables = exports.getPropertyControls = exports.getMergedConstraintsProps = exports.getMeasurableCodeComponentChildren = exports.getLoadingLazyAtYPosition = 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 = exports.environment = exports.EmptyState = void 0;
|
|
52
|
+
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 = exports.interpolate = exports.InternalID = exports.installFlexboxGapWorkaroundIfNeeded = void 0;
|
|
53
|
+
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.preloadImage = 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 = exports.MotionSetup = exports.MotionGlobalConfig = exports.MotionContext = void 0;
|
|
54
|
+
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.setInitialHydrationState = exports.setGlobalRenderEnvironment = exports.scrollInfo = exports.scroll = exports.Scroll = exports.roundWithOffset = exports.roundedNumberString = void 0;
|
|
55
|
+
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 = exports.useElementScroll = exports.useDynamicRefs = exports.useDragControls = exports.useDomEvent = exports.useDataRecord = void 0;
|
|
56
|
+
exports.wrap = exports.withVariantFX = exports.withVariantAppearEffect = exports.withStyleAppearEffect = exports.withShape = exports.withPerformanceMarks = exports.withPath = exports.withParallaxTransform = exports.WithOverride = exports.withOptimizedAppearEffect = 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 = exports.useTransform = exports.useTime = exports.useSpring = exports.useScroll = exports.useRouter = void 0;
|
|
57
|
+
// https :https://app.framerstatic.com/chunk-VMMGJNOV.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");
|
|
@@ -66,8 +66,8 @@ const react_7 = require("react");
|
|
|
66
66
|
const react_8 = require("react");
|
|
67
67
|
const react_9 = require("react");
|
|
68
68
|
const react_10 = require("react");
|
|
69
|
-
const react_11 = require("react");
|
|
70
69
|
const React2 = __importStar(require("react"));
|
|
70
|
+
const react_11 = require("react");
|
|
71
71
|
var __create = Object.create;
|
|
72
72
|
var __defProp = Object.defineProperty;
|
|
73
73
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -183,7 +183,7 @@ var MotionContext = (0, react_1.createContext)({});
|
|
|
183
183
|
exports.MotionContext = MotionContext;
|
|
184
184
|
var PresenceContext = (0, react_1.createContext)(null);
|
|
185
185
|
exports.PresenceContext = PresenceContext;
|
|
186
|
-
var isBrowser = typeof
|
|
186
|
+
var isBrowser = typeof window !== 'undefined';
|
|
187
187
|
exports.isBrowser = isBrowser;
|
|
188
188
|
var useIsomorphicLayoutEffect = isBrowser ? react_2.useLayoutEffect : react_2.useEffect;
|
|
189
189
|
exports.useIsomorphicLayoutEffect = useIsomorphicLayoutEffect;
|
|
@@ -360,6 +360,7 @@ function isRefObject(ref) {
|
|
|
360
360
|
}
|
|
361
361
|
var scheduleHandoffComplete = false;
|
|
362
362
|
function useVisualElement(Component33, visualState, props, createVisualElement2, ProjectionNodeConstructor) {
|
|
363
|
+
var _a;
|
|
363
364
|
const { visualElement: parent, } = (0, react_3.useContext)(MotionContext);
|
|
364
365
|
const lazyContext = (0, react_3.useContext)(LazyContext);
|
|
365
366
|
const presenceContext = (0, react_3.useContext)(PresenceContext);
|
|
@@ -385,7 +386,9 @@ function useVisualElement(Component33, visualState, props, createVisualElement2,
|
|
|
385
386
|
(0, react_4.useInsertionEffect)(() => {
|
|
386
387
|
visualElement && visualElement.update(props, presenceContext);
|
|
387
388
|
});
|
|
388
|
-
const
|
|
389
|
+
const optimisedAppearId = props[optimizedAppearDataAttribute];
|
|
390
|
+
const wantsHandoff = (0, react_4.useRef)(Boolean(optimisedAppearId) && !window.MotionHandoffIsComplete &&
|
|
391
|
+
((_a = window.MotionHasOptimisedAnimation) === null || _a === void 0 ? void 0 : _a.call(window, optimisedAppearId)));
|
|
389
392
|
useIsomorphicLayoutEffect(() => {
|
|
390
393
|
if (!visualElement)
|
|
391
394
|
return;
|
|
@@ -401,18 +404,16 @@ function useVisualElement(Component33, visualState, props, createVisualElement2,
|
|
|
401
404
|
if (!wantsHandoff.current && visualElement.animationState) {
|
|
402
405
|
visualElement.animationState.animateChanges();
|
|
403
406
|
}
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
queueMicrotask(completeHandoff);
|
|
409
|
-
}
|
|
407
|
+
wantsHandoff.current = false;
|
|
408
|
+
if (!scheduleHandoffComplete) {
|
|
409
|
+
scheduleHandoffComplete = true;
|
|
410
|
+
queueMicrotask(completeHandoff);
|
|
410
411
|
}
|
|
411
412
|
});
|
|
412
413
|
return visualElement;
|
|
413
414
|
}
|
|
414
415
|
function completeHandoff() {
|
|
415
|
-
window.
|
|
416
|
+
window.MotionHandoffIsComplete = true;
|
|
416
417
|
}
|
|
417
418
|
function createProjectionNode(visualElement, props, ProjectionNodeConstructor, initialPromotionConfig) {
|
|
418
419
|
const { layoutId, layout: layout2, drag: drag2, dragConstraints, layoutScroll, layoutRoot, } = props;
|
|
@@ -580,6 +581,36 @@ function addScaleCorrector(correctors) {
|
|
|
580
581
|
}
|
|
581
582
|
exports.addScaleCorrector = addScaleCorrector;
|
|
582
583
|
var isMotionValue = (value) => Boolean(value && value.getVelocity);
|
|
584
|
+
var clamp = (min, max, v) => {
|
|
585
|
+
if (v > max)
|
|
586
|
+
return max;
|
|
587
|
+
if (v < min)
|
|
588
|
+
return min;
|
|
589
|
+
return v;
|
|
590
|
+
};
|
|
591
|
+
exports.clamp = clamp;
|
|
592
|
+
var sanitize = (v) => Math.round(v * 1e5) / 1e5;
|
|
593
|
+
var floatRegex = /-?(?:\d+(?:\.\d+)?|\.\d+)/gu;
|
|
594
|
+
var colorRegex = /(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;
|
|
595
|
+
var singleColorRegex = /^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu;
|
|
596
|
+
function isString(v) {
|
|
597
|
+
return typeof v === 'string';
|
|
598
|
+
}
|
|
599
|
+
function isNullish(v) {
|
|
600
|
+
return v == null;
|
|
601
|
+
}
|
|
602
|
+
var createUnitType = (unit) => ({
|
|
603
|
+
test: (v) => isString(v) && v.endsWith(unit) && v.split(' ').length === 1,
|
|
604
|
+
parse: parseFloat,
|
|
605
|
+
transform: (v) => `${v}${unit}`,
|
|
606
|
+
});
|
|
607
|
+
var degrees = createUnitType('deg');
|
|
608
|
+
var percent = createUnitType('%');
|
|
609
|
+
var px = createUnitType('px');
|
|
610
|
+
exports.px = px;
|
|
611
|
+
var vh = createUnitType('vh');
|
|
612
|
+
var vw = createUnitType('vw');
|
|
613
|
+
var progressPercentage = Object.assign(Object.assign({}, percent), { parse: (v) => percent.parse(v) / 100, transform: (v) => percent.transform(v * 100) });
|
|
583
614
|
var transformPropOrder = [
|
|
584
615
|
'transformPerspective',
|
|
585
616
|
'x',
|
|
@@ -600,6 +631,85 @@ var transformPropOrder = [
|
|
|
600
631
|
'skewY',
|
|
601
632
|
];
|
|
602
633
|
var transformProps = new Set(transformPropOrder);
|
|
634
|
+
var getValueAsType = (value, type) => {
|
|
635
|
+
return type && typeof value === 'number' ? type.transform(value) : value;
|
|
636
|
+
};
|
|
637
|
+
var number = {
|
|
638
|
+
test: (v) => typeof v === 'number',
|
|
639
|
+
parse: parseFloat,
|
|
640
|
+
transform: (v) => v,
|
|
641
|
+
};
|
|
642
|
+
var alpha = Object.assign(Object.assign({}, number), { transform: (v) => clamp(0, 1, v) });
|
|
643
|
+
var scale = Object.assign(Object.assign({}, number), { default: 1 });
|
|
644
|
+
var int = Object.assign(Object.assign({}, number), { transform: Math.round });
|
|
645
|
+
var numberValueTypes = {
|
|
646
|
+
// Border props
|
|
647
|
+
borderWidth: px,
|
|
648
|
+
borderTopWidth: px,
|
|
649
|
+
borderRightWidth: px,
|
|
650
|
+
borderBottomWidth: px,
|
|
651
|
+
borderLeftWidth: px,
|
|
652
|
+
borderRadius: px,
|
|
653
|
+
radius: px,
|
|
654
|
+
borderTopLeftRadius: px,
|
|
655
|
+
borderTopRightRadius: px,
|
|
656
|
+
borderBottomRightRadius: px,
|
|
657
|
+
borderBottomLeftRadius: px,
|
|
658
|
+
// Positioning props
|
|
659
|
+
width: px,
|
|
660
|
+
maxWidth: px,
|
|
661
|
+
height: px,
|
|
662
|
+
maxHeight: px,
|
|
663
|
+
size: px,
|
|
664
|
+
top: px,
|
|
665
|
+
right: px,
|
|
666
|
+
bottom: px,
|
|
667
|
+
left: px,
|
|
668
|
+
// Spacing props
|
|
669
|
+
padding: px,
|
|
670
|
+
paddingTop: px,
|
|
671
|
+
paddingRight: px,
|
|
672
|
+
paddingBottom: px,
|
|
673
|
+
paddingLeft: px,
|
|
674
|
+
margin: px,
|
|
675
|
+
marginTop: px,
|
|
676
|
+
marginRight: px,
|
|
677
|
+
marginBottom: px,
|
|
678
|
+
marginLeft: px,
|
|
679
|
+
// Transform props
|
|
680
|
+
rotate: degrees,
|
|
681
|
+
rotateX: degrees,
|
|
682
|
+
rotateY: degrees,
|
|
683
|
+
rotateZ: degrees,
|
|
684
|
+
scale,
|
|
685
|
+
scaleX: scale,
|
|
686
|
+
scaleY: scale,
|
|
687
|
+
scaleZ: scale,
|
|
688
|
+
skew: degrees,
|
|
689
|
+
skewX: degrees,
|
|
690
|
+
skewY: degrees,
|
|
691
|
+
distance: px,
|
|
692
|
+
translateX: px,
|
|
693
|
+
translateY: px,
|
|
694
|
+
translateZ: px,
|
|
695
|
+
x: px,
|
|
696
|
+
y: px,
|
|
697
|
+
z: px,
|
|
698
|
+
perspective: px,
|
|
699
|
+
transformPerspective: px,
|
|
700
|
+
opacity: alpha,
|
|
701
|
+
originX: progressPercentage,
|
|
702
|
+
originY: progressPercentage,
|
|
703
|
+
originZ: px,
|
|
704
|
+
// Misc
|
|
705
|
+
zIndex: int,
|
|
706
|
+
backgroundPositionX: px,
|
|
707
|
+
backgroundPositionY: px,
|
|
708
|
+
// SVG
|
|
709
|
+
fillOpacity: alpha,
|
|
710
|
+
strokeOpacity: alpha,
|
|
711
|
+
numOctaves: int,
|
|
712
|
+
};
|
|
603
713
|
var translateAlias = {
|
|
604
714
|
x: 'translateX',
|
|
605
715
|
y: 'translateY',
|
|
@@ -607,13 +717,31 @@ var translateAlias = {
|
|
|
607
717
|
transformPerspective: 'perspective',
|
|
608
718
|
};
|
|
609
719
|
var numTransforms = transformPropOrder.length;
|
|
610
|
-
function buildTransform(
|
|
720
|
+
function buildTransform(latestValues, transform2, transformTemplate2) {
|
|
611
721
|
let transformString3 = '';
|
|
722
|
+
let transformIsDefault = true;
|
|
612
723
|
for (let i = 0; i < numTransforms; i++) {
|
|
613
724
|
const key7 = transformPropOrder[i];
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
725
|
+
const value = latestValues[key7];
|
|
726
|
+
if (value === void 0)
|
|
727
|
+
continue;
|
|
728
|
+
let valueIsDefault = true;
|
|
729
|
+
if (typeof value === 'number') {
|
|
730
|
+
valueIsDefault = value === (key7.startsWith('scale') ? 1 : 0);
|
|
731
|
+
}
|
|
732
|
+
else {
|
|
733
|
+
valueIsDefault = parseFloat(value) === 0;
|
|
734
|
+
}
|
|
735
|
+
if (!valueIsDefault || transformTemplate2) {
|
|
736
|
+
const valueAsType = getValueAsType(value, numberValueTypes[key7]);
|
|
737
|
+
if (!valueIsDefault) {
|
|
738
|
+
transformIsDefault = false;
|
|
739
|
+
const transformName = translateAlias[key7] || key7;
|
|
740
|
+
transformString3 += `${transformName}(${valueAsType}) `;
|
|
741
|
+
}
|
|
742
|
+
if (transformTemplate2) {
|
|
743
|
+
transform2[key7] = valueAsType;
|
|
744
|
+
}
|
|
617
745
|
}
|
|
618
746
|
}
|
|
619
747
|
transformString3 = transformString3.trim();
|
|
@@ -626,36 +754,6 @@ function buildTransform(transform2, transformIsDefault, transformTemplate2) {
|
|
|
626
754
|
return transformString3;
|
|
627
755
|
}
|
|
628
756
|
exports.buildTransform = buildTransform;
|
|
629
|
-
var clamp = (min, max, v) => {
|
|
630
|
-
if (v > max)
|
|
631
|
-
return max;
|
|
632
|
-
if (v < min)
|
|
633
|
-
return min;
|
|
634
|
-
return v;
|
|
635
|
-
};
|
|
636
|
-
exports.clamp = clamp;
|
|
637
|
-
var sanitize = (v) => Math.round(v * 1e5) / 1e5;
|
|
638
|
-
var floatRegex = /-?(?:\d+(?:\.\d+)?|\.\d+)/gu;
|
|
639
|
-
var colorRegex = /(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;
|
|
640
|
-
var singleColorRegex = /^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu;
|
|
641
|
-
function isString(v) {
|
|
642
|
-
return typeof v === 'string';
|
|
643
|
-
}
|
|
644
|
-
function isNullish(v) {
|
|
645
|
-
return v == null;
|
|
646
|
-
}
|
|
647
|
-
var createUnitType = (unit) => ({
|
|
648
|
-
test: (v) => isString(v) && v.endsWith(unit) && v.split(' ').length === 1,
|
|
649
|
-
parse: parseFloat,
|
|
650
|
-
transform: (v) => `${v}${unit}`,
|
|
651
|
-
});
|
|
652
|
-
var degrees = createUnitType('deg');
|
|
653
|
-
var percent = createUnitType('%');
|
|
654
|
-
var px = createUnitType('px');
|
|
655
|
-
exports.px = px;
|
|
656
|
-
var vh = createUnitType('vh');
|
|
657
|
-
var vw = createUnitType('vw');
|
|
658
|
-
var progressPercentage = Object.assign(Object.assign({}, percent), { parse: (v) => percent.parse(v) / 100, transform: (v) => percent.transform(v * 100) });
|
|
659
757
|
var validMotionProps = /* @__PURE__ */ new Set([
|
|
660
758
|
'animate',
|
|
661
759
|
'exit',
|
|
@@ -962,13 +1060,6 @@ function isDragActive() {
|
|
|
962
1060
|
return false;
|
|
963
1061
|
}
|
|
964
1062
|
exports.isDragActive = isDragActive;
|
|
965
|
-
var number = {
|
|
966
|
-
test: (v) => typeof v === 'number',
|
|
967
|
-
parse: parseFloat,
|
|
968
|
-
transform: (v) => v,
|
|
969
|
-
};
|
|
970
|
-
var alpha = Object.assign(Object.assign({}, number), { transform: (v) => clamp(0, 1, v) });
|
|
971
|
-
var scale = Object.assign(Object.assign({}, number), { default: 1 });
|
|
972
1063
|
var isColorString = (type, testProp) => (v) => {
|
|
973
1064
|
return Boolean(isString(v) && singleColorRegex.test(v) && v.startsWith(type) ||
|
|
974
1065
|
testProp && !isNullish(v) && Object.prototype.hasOwnProperty.call(v, testProp));
|
|
@@ -1284,14 +1375,9 @@ function spring(_j) {
|
|
|
1284
1375
|
next: (t) => {
|
|
1285
1376
|
const current = resolveSpring(t);
|
|
1286
1377
|
if (!isResolvedFromDuration) {
|
|
1287
|
-
let currentVelocity =
|
|
1288
|
-
if (
|
|
1289
|
-
|
|
1290
|
-
currentVelocity = calcGeneratorVelocity(resolveSpring, t, current);
|
|
1291
|
-
}
|
|
1292
|
-
else {
|
|
1293
|
-
currentVelocity = 0;
|
|
1294
|
-
}
|
|
1378
|
+
let currentVelocity = 0;
|
|
1379
|
+
if (dampingRatio < 1) {
|
|
1380
|
+
currentVelocity = t === 0 ? secondsToMilliseconds(initialVelocity) : calcGeneratorVelocity(resolveSpring, t, current);
|
|
1295
1381
|
}
|
|
1296
1382
|
const isBelowVelocityThreshold = Math.abs(currentVelocity) <= restSpeed;
|
|
1297
1383
|
const isBelowDisplacementThreshold = Math.abs(target - current) <= restDelta;
|
|
@@ -2371,75 +2457,6 @@ var filter = Object.assign(Object.assign({}, complex), { getAnimatableNone: (v)
|
|
|
2371
2457
|
const functions = v.match(functionRegex);
|
|
2372
2458
|
return functions ? functions.map(applyDefaultFilter).join(' ') : v;
|
|
2373
2459
|
} });
|
|
2374
|
-
var int = Object.assign(Object.assign({}, number), { transform: Math.round });
|
|
2375
|
-
var numberValueTypes = {
|
|
2376
|
-
// Border props
|
|
2377
|
-
borderWidth: px,
|
|
2378
|
-
borderTopWidth: px,
|
|
2379
|
-
borderRightWidth: px,
|
|
2380
|
-
borderBottomWidth: px,
|
|
2381
|
-
borderLeftWidth: px,
|
|
2382
|
-
borderRadius: px,
|
|
2383
|
-
radius: px,
|
|
2384
|
-
borderTopLeftRadius: px,
|
|
2385
|
-
borderTopRightRadius: px,
|
|
2386
|
-
borderBottomRightRadius: px,
|
|
2387
|
-
borderBottomLeftRadius: px,
|
|
2388
|
-
// Positioning props
|
|
2389
|
-
width: px,
|
|
2390
|
-
maxWidth: px,
|
|
2391
|
-
height: px,
|
|
2392
|
-
maxHeight: px,
|
|
2393
|
-
size: px,
|
|
2394
|
-
top: px,
|
|
2395
|
-
right: px,
|
|
2396
|
-
bottom: px,
|
|
2397
|
-
left: px,
|
|
2398
|
-
// Spacing props
|
|
2399
|
-
padding: px,
|
|
2400
|
-
paddingTop: px,
|
|
2401
|
-
paddingRight: px,
|
|
2402
|
-
paddingBottom: px,
|
|
2403
|
-
paddingLeft: px,
|
|
2404
|
-
margin: px,
|
|
2405
|
-
marginTop: px,
|
|
2406
|
-
marginRight: px,
|
|
2407
|
-
marginBottom: px,
|
|
2408
|
-
marginLeft: px,
|
|
2409
|
-
// Transform props
|
|
2410
|
-
rotate: degrees,
|
|
2411
|
-
rotateX: degrees,
|
|
2412
|
-
rotateY: degrees,
|
|
2413
|
-
rotateZ: degrees,
|
|
2414
|
-
scale,
|
|
2415
|
-
scaleX: scale,
|
|
2416
|
-
scaleY: scale,
|
|
2417
|
-
scaleZ: scale,
|
|
2418
|
-
skew: degrees,
|
|
2419
|
-
skewX: degrees,
|
|
2420
|
-
skewY: degrees,
|
|
2421
|
-
distance: px,
|
|
2422
|
-
translateX: px,
|
|
2423
|
-
translateY: px,
|
|
2424
|
-
translateZ: px,
|
|
2425
|
-
x: px,
|
|
2426
|
-
y: px,
|
|
2427
|
-
z: px,
|
|
2428
|
-
perspective: px,
|
|
2429
|
-
transformPerspective: px,
|
|
2430
|
-
opacity: alpha,
|
|
2431
|
-
originX: progressPercentage,
|
|
2432
|
-
originY: progressPercentage,
|
|
2433
|
-
originZ: px,
|
|
2434
|
-
// Misc
|
|
2435
|
-
zIndex: int,
|
|
2436
|
-
backgroundPositionX: px,
|
|
2437
|
-
backgroundPositionY: px,
|
|
2438
|
-
// SVG
|
|
2439
|
-
fillOpacity: alpha,
|
|
2440
|
-
strokeOpacity: alpha,
|
|
2441
|
-
numOctaves: int,
|
|
2442
|
-
};
|
|
2443
2460
|
var defaultValueTypes = Object.assign(Object.assign({}, numberValueTypes), {
|
|
2444
2461
|
// Color props
|
|
2445
2462
|
color, backgroundColor: color, outlineColor: color, fill: color, stroke: color,
|
|
@@ -2781,6 +2798,8 @@ var AcceleratedAnimation = class extends BaseAnimation {
|
|
|
2781
2798
|
this.isStopped = true;
|
|
2782
2799
|
if (this.state === 'idle')
|
|
2783
2800
|
return;
|
|
2801
|
+
this.resolveFinishedPromise();
|
|
2802
|
+
this.updateFinishedPromise();
|
|
2784
2803
|
const { resolved, } = this;
|
|
2785
2804
|
if (!resolved)
|
|
2786
2805
|
return;
|
|
@@ -2869,7 +2888,7 @@ var MotionValue = class {
|
|
|
2869
2888
|
* @internal
|
|
2870
2889
|
*/
|
|
2871
2890
|
constructor(init, options = {}) {
|
|
2872
|
-
this.version = '11.3.
|
|
2891
|
+
this.version = '11.3.23';
|
|
2873
2892
|
this.canTrackVelocity = null;
|
|
2874
2893
|
this.events = {};
|
|
2875
2894
|
this.updateAndNotify = (v, render = true) => {
|
|
@@ -3127,43 +3146,6 @@ function motionValue(init, options) {
|
|
|
3127
3146
|
return new MotionValue(init, options);
|
|
3128
3147
|
}
|
|
3129
3148
|
exports.motionValue = motionValue;
|
|
3130
|
-
var WillChangeMotionValue = class extends MotionValue {
|
|
3131
|
-
constructor() {
|
|
3132
|
-
super(...arguments);
|
|
3133
|
-
this.output = [];
|
|
3134
|
-
this.counts = /* @__PURE__ */ new Map();
|
|
3135
|
-
}
|
|
3136
|
-
add(name) {
|
|
3137
|
-
const styleName = getWillChangeName(name);
|
|
3138
|
-
if (!styleName)
|
|
3139
|
-
return;
|
|
3140
|
-
const prevCount = this.counts.get(styleName) || 0;
|
|
3141
|
-
this.counts.set(styleName, prevCount + 1);
|
|
3142
|
-
if (prevCount === 0) {
|
|
3143
|
-
this.output.push(styleName);
|
|
3144
|
-
this.update();
|
|
3145
|
-
}
|
|
3146
|
-
let hasRemoved = false;
|
|
3147
|
-
return () => {
|
|
3148
|
-
if (hasRemoved)
|
|
3149
|
-
return;
|
|
3150
|
-
hasRemoved = true;
|
|
3151
|
-
const newCount = this.counts.get(styleName) - 1;
|
|
3152
|
-
this.counts.set(styleName, newCount);
|
|
3153
|
-
if (newCount === 0) {
|
|
3154
|
-
removeItem(this.output, styleName);
|
|
3155
|
-
this.update();
|
|
3156
|
-
}
|
|
3157
|
-
};
|
|
3158
|
-
}
|
|
3159
|
-
update() {
|
|
3160
|
-
this.set(this.output.length ? this.output.join(', ') : 'auto');
|
|
3161
|
-
}
|
|
3162
|
-
};
|
|
3163
|
-
function useWillChange() {
|
|
3164
|
-
return useConstant(() => new WillChangeMotionValue('auto'));
|
|
3165
|
-
}
|
|
3166
|
-
exports.useWillChange = useWillChange;
|
|
3167
3149
|
function resolveVariant(visualElement, definition, custom) {
|
|
3168
3150
|
const props = visualElement.getProps();
|
|
3169
3151
|
return resolveVariantFromProps(props, definition, custom !== void 0 ? custom : props.custom, visualElement);
|
|
@@ -3368,6 +3350,39 @@ function setTarget(visualElement, definition) {
|
|
|
3368
3350
|
function getOptimisedAppearId(visualElement) {
|
|
3369
3351
|
return visualElement.getProps()[optimizedAppearDataAttribute];
|
|
3370
3352
|
}
|
|
3353
|
+
var WillChangeMotionValue = class extends MotionValue {
|
|
3354
|
+
constructor() {
|
|
3355
|
+
super(...arguments);
|
|
3356
|
+
this.output = [];
|
|
3357
|
+
this.counts = /* @__PURE__ */ new Map();
|
|
3358
|
+
}
|
|
3359
|
+
add(name) {
|
|
3360
|
+
const styleName = getWillChangeName(name);
|
|
3361
|
+
if (!styleName)
|
|
3362
|
+
return;
|
|
3363
|
+
const prevCount = this.counts.get(styleName) || 0;
|
|
3364
|
+
this.counts.set(styleName, prevCount + 1);
|
|
3365
|
+
if (prevCount === 0) {
|
|
3366
|
+
this.output.push(styleName);
|
|
3367
|
+
this.update();
|
|
3368
|
+
}
|
|
3369
|
+
let hasRemoved = false;
|
|
3370
|
+
return () => {
|
|
3371
|
+
if (hasRemoved)
|
|
3372
|
+
return;
|
|
3373
|
+
hasRemoved = true;
|
|
3374
|
+
const newCount = this.counts.get(styleName) - 1;
|
|
3375
|
+
this.counts.set(styleName, newCount);
|
|
3376
|
+
if (newCount === 0) {
|
|
3377
|
+
removeItem(this.output, styleName);
|
|
3378
|
+
this.update();
|
|
3379
|
+
}
|
|
3380
|
+
};
|
|
3381
|
+
}
|
|
3382
|
+
update() {
|
|
3383
|
+
this.set(this.output.length ? this.output.join(', ') : 'auto');
|
|
3384
|
+
}
|
|
3385
|
+
};
|
|
3371
3386
|
function isWillChangeMotionValue(value) {
|
|
3372
3387
|
return Boolean(isMotionValue(value) && value.add);
|
|
3373
3388
|
}
|
|
@@ -3404,10 +3419,10 @@ function animateTarget(visualElement, targetAndTransition, { delay: delay2 = 0,
|
|
|
3404
3419
|
}
|
|
3405
3420
|
const valueTransition = Object.assign({ delay: delay2, elapsed: 0 }, getValueTransition(transition || {}, key7));
|
|
3406
3421
|
let isHandoff = false;
|
|
3407
|
-
if (window.
|
|
3422
|
+
if (window.MotionHandoffAnimation) {
|
|
3408
3423
|
const appearId = getOptimisedAppearId(visualElement);
|
|
3409
3424
|
if (appearId) {
|
|
3410
|
-
const elapsed = window.
|
|
3425
|
+
const elapsed = window.MotionHandoffAnimation(appearId, key7, frame);
|
|
3411
3426
|
if (elapsed !== null) {
|
|
3412
3427
|
valueTransition.elapsed = elapsed;
|
|
3413
3428
|
isHandoff = true;
|
|
@@ -3486,9 +3501,7 @@ function animateVisualElement(visualElement, definition, options = {}) {
|
|
|
3486
3501
|
animation = Promise.all(animateTarget(visualElement, resolvedDefinition, options));
|
|
3487
3502
|
}
|
|
3488
3503
|
return animation.then(() => {
|
|
3489
|
-
|
|
3490
|
-
visualElement.notify('AnimationComplete', definition);
|
|
3491
|
-
});
|
|
3504
|
+
visualElement.notify('AnimationComplete', definition);
|
|
3492
3505
|
});
|
|
3493
3506
|
}
|
|
3494
3507
|
exports.animateVisualElement = animateVisualElement;
|
|
@@ -3853,7 +3866,7 @@ function usePresence() {
|
|
|
3853
3866
|
const { isPresent: isPresent2, onExitComplete, register, } = context;
|
|
3854
3867
|
const id4 = (0, react_7.useId)();
|
|
3855
3868
|
(0, react_2.useEffect)(() => register(id4), []);
|
|
3856
|
-
const safeToRemove = () => onExitComplete && onExitComplete(id4);
|
|
3869
|
+
const safeToRemove = (0, react_5.useCallback)(() => onExitComplete && onExitComplete(id4), [id4, onExitComplete,]);
|
|
3857
3870
|
return !isPresent2 && onExitComplete ? [false, safeToRemove,] : [true,];
|
|
3858
3871
|
}
|
|
3859
3872
|
exports.usePresence = usePresence;
|
|
@@ -3927,7 +3940,7 @@ function updateMotionValuesFromProps(element, next, prev) {
|
|
|
3927
3940
|
if (isMotionValue(nextValue)) {
|
|
3928
3941
|
element.addValue(key7, nextValue);
|
|
3929
3942
|
if (false) {
|
|
3930
|
-
warnOnce(nextValue.version === '11.3.
|
|
3943
|
+
warnOnce(nextValue.version === '11.3.23', `Attempting to mix Framer Motion versions ${nextValue.version} with 11.3.23 may not work as expected.`);
|
|
3931
3944
|
}
|
|
3932
3945
|
}
|
|
3933
3946
|
else if (isMotionValue(prevValue)) {
|
|
@@ -4418,41 +4431,34 @@ function isForcedMotionValue(key7, { layout: layout2, layoutId, }) {
|
|
|
4418
4431
|
return transformProps.has(key7) || key7.startsWith('origin') ||
|
|
4419
4432
|
(layout2 || layoutId !== void 0) && (!!scaleCorrectors[key7] || key7 === 'opacity');
|
|
4420
4433
|
}
|
|
4421
|
-
var getValueAsType = (value, type) => {
|
|
4422
|
-
return type && typeof value === 'number' ? type.transform(value) : value;
|
|
4423
|
-
};
|
|
4424
4434
|
function buildHTMLStyles(state, latestValues, transformTemplate2) {
|
|
4425
|
-
const { style, vars,
|
|
4435
|
+
const { style, vars, transformOrigin, } = state;
|
|
4426
4436
|
let hasTransform2 = false;
|
|
4427
4437
|
let hasTransformOrigin = false;
|
|
4428
|
-
let transformIsNone = true;
|
|
4429
4438
|
for (const key7 in latestValues) {
|
|
4430
4439
|
const value = latestValues[key7];
|
|
4431
|
-
if (isCSSVariableName(key7)) {
|
|
4432
|
-
vars[key7] = value;
|
|
4433
|
-
continue;
|
|
4434
|
-
}
|
|
4435
|
-
const valueType = numberValueTypes[key7];
|
|
4436
|
-
const valueAsType = getValueAsType(value, valueType);
|
|
4437
4440
|
if (transformProps.has(key7)) {
|
|
4438
4441
|
hasTransform2 = true;
|
|
4439
|
-
|
|
4440
|
-
if (!transformIsNone)
|
|
4441
|
-
continue;
|
|
4442
|
-
if (value !== (valueType.default || 0))
|
|
4443
|
-
transformIsNone = false;
|
|
4442
|
+
continue;
|
|
4444
4443
|
}
|
|
4445
|
-
else if (key7
|
|
4446
|
-
|
|
4447
|
-
|
|
4444
|
+
else if (isCSSVariableName(key7)) {
|
|
4445
|
+
vars[key7] = value;
|
|
4446
|
+
continue;
|
|
4448
4447
|
}
|
|
4449
4448
|
else {
|
|
4450
|
-
|
|
4449
|
+
const valueAsType = getValueAsType(value, numberValueTypes[key7]);
|
|
4450
|
+
if (key7.startsWith('origin')) {
|
|
4451
|
+
hasTransformOrigin = true;
|
|
4452
|
+
transformOrigin[key7] = valueAsType;
|
|
4453
|
+
}
|
|
4454
|
+
else {
|
|
4455
|
+
style[key7] = valueAsType;
|
|
4456
|
+
}
|
|
4451
4457
|
}
|
|
4452
4458
|
}
|
|
4453
4459
|
if (!latestValues.transform) {
|
|
4454
4460
|
if (hasTransform2 || transformTemplate2) {
|
|
4455
|
-
style.transform = buildTransform(state.transform,
|
|
4461
|
+
style.transform = buildTransform(latestValues, state.transform, transformTemplate2);
|
|
4456
4462
|
}
|
|
4457
4463
|
else if (style.transform) {
|
|
4458
4464
|
style.transform = 'none';
|
|
@@ -6167,7 +6173,7 @@ function resetDistortingTransform(key7, visualElement, values, sharedAnimationVa
|
|
|
6167
6173
|
}
|
|
6168
6174
|
}
|
|
6169
6175
|
}
|
|
6170
|
-
function
|
|
6176
|
+
function isOptimisedTransformAnimationInTree(projectionNode) {
|
|
6171
6177
|
projectionNode.hasCheckedOptimisedAppear = true;
|
|
6172
6178
|
if (projectionNode.root === projectionNode)
|
|
6173
6179
|
return false;
|
|
@@ -6175,11 +6181,11 @@ function isOptimisedAppearTree(projectionNode) {
|
|
|
6175
6181
|
if (!visualElement) {
|
|
6176
6182
|
return false;
|
|
6177
6183
|
}
|
|
6178
|
-
else if (getOptimisedAppearId(visualElement)) {
|
|
6184
|
+
else if (window.MotionHasOptimisedTransformAnimation(getOptimisedAppearId(visualElement))) {
|
|
6179
6185
|
return true;
|
|
6180
6186
|
}
|
|
6181
6187
|
else if (projectionNode.parent && !projectionNode.parent.hasCheckedOptimisedAppear) {
|
|
6182
|
-
return
|
|
6188
|
+
return isOptimisedTransformAnimationInTree(projectionNode.parent);
|
|
6183
6189
|
}
|
|
6184
6190
|
else {
|
|
6185
6191
|
return false;
|
|
@@ -6372,8 +6378,8 @@ function createProjectionNode2({ attachResizeListener, defaultParent, measureScr
|
|
|
6372
6378
|
this.options.onExitComplete && this.options.onExitComplete();
|
|
6373
6379
|
return;
|
|
6374
6380
|
}
|
|
6375
|
-
if (window.
|
|
6376
|
-
window.
|
|
6381
|
+
if (window.MotionHandoffCancelAll && isOptimisedTransformAnimationInTree(this)) {
|
|
6382
|
+
window.MotionHandoffCancelAll();
|
|
6377
6383
|
}
|
|
6378
6384
|
!this.root.isUpdating && this.root.startUpdate();
|
|
6379
6385
|
if (this.isLayoutDirty)
|
|
@@ -6483,11 +6489,13 @@ function createProjectionNode2({ attachResizeListener, defaultParent, measureScr
|
|
|
6483
6489
|
needsMeasurement = false;
|
|
6484
6490
|
}
|
|
6485
6491
|
if (needsMeasurement) {
|
|
6492
|
+
const isRoot = checkIsScrollRoot(this.instance);
|
|
6486
6493
|
this.scroll = {
|
|
6487
6494
|
animationId: this.root.animationId,
|
|
6488
6495
|
phase,
|
|
6489
|
-
isRoot
|
|
6496
|
+
isRoot,
|
|
6490
6497
|
offset: measureScroll(this.instance),
|
|
6498
|
+
wasRoot: this.scroll ? this.scroll.isRoot : isRoot,
|
|
6491
6499
|
};
|
|
6492
6500
|
}
|
|
6493
6501
|
}
|
|
@@ -6521,31 +6529,35 @@ function createProjectionNode2({ attachResizeListener, defaultParent, measureScr
|
|
|
6521
6529
|
};
|
|
6522
6530
|
}
|
|
6523
6531
|
measurePageBox() {
|
|
6532
|
+
var _a;
|
|
6524
6533
|
const { visualElement, } = this.options;
|
|
6525
6534
|
if (!visualElement)
|
|
6526
6535
|
return createBox();
|
|
6527
6536
|
const box = visualElement.measureViewportBox();
|
|
6528
|
-
const
|
|
6529
|
-
|
|
6530
|
-
|
|
6531
|
-
|
|
6537
|
+
const wasInScrollRoot = ((_a = this.scroll) === null || _a === void 0 ? void 0 : _a.wasRoot) ||
|
|
6538
|
+
this.path.some(checkNodeWasScrollRoot);
|
|
6539
|
+
if (!wasInScrollRoot) {
|
|
6540
|
+
const { scroll: scroll2, } = this.root;
|
|
6541
|
+
if (scroll2) {
|
|
6542
|
+
translateAxis(box.x, scroll2.offset.x);
|
|
6543
|
+
translateAxis(box.y, scroll2.offset.y);
|
|
6544
|
+
}
|
|
6532
6545
|
}
|
|
6533
6546
|
return box;
|
|
6534
6547
|
}
|
|
6535
6548
|
removeElementScroll(box) {
|
|
6549
|
+
var _a;
|
|
6536
6550
|
const boxWithoutScroll = createBox();
|
|
6537
6551
|
copyBoxInto(boxWithoutScroll, box);
|
|
6552
|
+
if ((_a = this.scroll) === null || _a === void 0 ? void 0 : _a.wasRoot) {
|
|
6553
|
+
return boxWithoutScroll;
|
|
6554
|
+
}
|
|
6538
6555
|
for (let i = 0; i < this.path.length; i++) {
|
|
6539
6556
|
const node = this.path[i];
|
|
6540
6557
|
const { scroll: scroll2, options, } = node;
|
|
6541
6558
|
if (node !== this.root && scroll2 && options.layoutScroll) {
|
|
6542
|
-
if (scroll2.
|
|
6559
|
+
if (scroll2.wasRoot) {
|
|
6543
6560
|
copyBoxInto(boxWithoutScroll, box);
|
|
6544
|
-
const { scroll: rootScroll, } = this.root;
|
|
6545
|
-
if (rootScroll) {
|
|
6546
|
-
translateAxis(boxWithoutScroll.x, -rootScroll.offset.x);
|
|
6547
|
-
translateAxis(boxWithoutScroll.y, -rootScroll.offset.y);
|
|
6548
|
-
}
|
|
6549
6561
|
}
|
|
6550
6562
|
translateAxis(boxWithoutScroll.x, scroll2.offset.x);
|
|
6551
6563
|
translateAxis(boxWithoutScroll.y, scroll2.offset.y);
|
|
@@ -7221,6 +7233,10 @@ function shouldAnimatePositionOnly(animationType, snapshot, layout2) {
|
|
|
7221
7233
|
return animationType === 'position' ||
|
|
7222
7234
|
animationType === 'preserve-aspect' && !isNear(aspectRatio(snapshot), aspectRatio(layout2), 0.2);
|
|
7223
7235
|
}
|
|
7236
|
+
function checkNodeWasScrollRoot(node) {
|
|
7237
|
+
var _a;
|
|
7238
|
+
return node !== node.root && ((_a = node.scroll) === null || _a === void 0 ? void 0 : _a.wasRoot);
|
|
7239
|
+
}
|
|
7224
7240
|
var DocumentProjectionNode = createProjectionNode2({
|
|
7225
7241
|
attachResizeListener: (ref, notify2) => addDomEvent(ref, 'resize', notify2),
|
|
7226
7242
|
measureScroll: () => ({
|
|
@@ -7377,30 +7393,6 @@ function createDomMotionComponent(key7) {
|
|
|
7377
7393
|
exports.createDomMotionComponent = createDomMotionComponent;
|
|
7378
7394
|
var m = createMotionProxy(createDomMotionConfig);
|
|
7379
7395
|
exports.m = m;
|
|
7380
|
-
function useIsMounted() {
|
|
7381
|
-
const isMounted = (0, react_4.useRef)(false);
|
|
7382
|
-
useIsomorphicLayoutEffect(() => {
|
|
7383
|
-
isMounted.current = true;
|
|
7384
|
-
return () => {
|
|
7385
|
-
isMounted.current = false;
|
|
7386
|
-
};
|
|
7387
|
-
}, []);
|
|
7388
|
-
return isMounted;
|
|
7389
|
-
}
|
|
7390
|
-
function useForceUpdate() {
|
|
7391
|
-
const isMounted = useIsMounted();
|
|
7392
|
-
const [forcedRenderCount, setForcedRenderCount,] = (0, react_10.useState)(0);
|
|
7393
|
-
const forceRender = (0, react_5.useCallback)(() => {
|
|
7394
|
-
isMounted.current && setForcedRenderCount(forcedRenderCount + 1);
|
|
7395
|
-
}, [forcedRenderCount,]);
|
|
7396
|
-
const deferredForceRender = (0, react_5.useCallback)(() => frame.postRender(forceRender), [forceRender,]);
|
|
7397
|
-
return [deferredForceRender, forcedRenderCount,];
|
|
7398
|
-
}
|
|
7399
|
-
exports.useForceUpdate = useForceUpdate;
|
|
7400
|
-
function useUnmountEffect(callback) {
|
|
7401
|
-
return (0, react_2.useEffect)(() => () => callback(), []);
|
|
7402
|
-
}
|
|
7403
|
-
exports.useUnmountEffect = useUnmountEffect;
|
|
7404
7396
|
var PopChildMeasure = class extends React2.Component {
|
|
7405
7397
|
getSnapshotBeforeUpdate(prevProps) {
|
|
7406
7398
|
const element = this.props.childRef.current;
|
|
@@ -7512,12 +7504,6 @@ function newChildrenMap() {
|
|
|
7512
7504
|
return /* @__PURE__ */ new Map();
|
|
7513
7505
|
}
|
|
7514
7506
|
var getChildKey = (child) => child.key || '';
|
|
7515
|
-
function updateChildLookup(children, allChildren) {
|
|
7516
|
-
children.forEach((child) => {
|
|
7517
|
-
const key7 = getChildKey(child);
|
|
7518
|
-
allChildren.set(key7, child);
|
|
7519
|
-
});
|
|
7520
|
-
}
|
|
7521
7507
|
function onlyElements(children) {
|
|
7522
7508
|
const filtered = [];
|
|
7523
7509
|
react_11.Children.forEach(children, (child) => {
|
|
@@ -7526,104 +7512,84 @@ function onlyElements(children) {
|
|
|
7526
7512
|
});
|
|
7527
7513
|
return filtered;
|
|
7528
7514
|
}
|
|
7529
|
-
var AnimatePresence = ({ children, custom, initial = true, onExitComplete,
|
|
7515
|
+
var AnimatePresence = ({ children, exitBeforeEnter, custom, initial = true, onExitComplete, presenceAffectsLayout = true, mode = 'sync', }) => {
|
|
7530
7516
|
invariant(!exitBeforeEnter, 'Replace exitBeforeEnter with mode=\'wait\'');
|
|
7531
|
-
const
|
|
7532
|
-
const
|
|
7533
|
-
const filteredChildren = onlyElements(children);
|
|
7534
|
-
let childrenToRender = filteredChildren;
|
|
7535
|
-
const exitingChildren = (0, react_4.useRef)(/* @__PURE__ */ new Map()).current;
|
|
7536
|
-
const presentChildren = (0, react_4.useRef)(childrenToRender);
|
|
7537
|
-
const allChildren = (0, react_4.useRef)(/* @__PURE__ */ new Map()).current;
|
|
7517
|
+
const presentChildren = (0, react_6.useMemo)(() => onlyElements(children), [children,]);
|
|
7518
|
+
const presentKeys = presentChildren.map(getChildKey);
|
|
7538
7519
|
const isInitialRender = (0, react_4.useRef)(true);
|
|
7520
|
+
const pendingPresentChildren = (0, react_4.useRef)(presentChildren);
|
|
7521
|
+
const exitComplete = useConstant(() => /* @__PURE__ */ new Map());
|
|
7522
|
+
const [diffedChildren, setDiffedChildren,] = (0, react_10.useState)(presentChildren);
|
|
7523
|
+
const [renderedChildren, setRenderedChildren,] = (0, react_10.useState)(presentChildren);
|
|
7539
7524
|
useIsomorphicLayoutEffect(() => {
|
|
7540
7525
|
isInitialRender.current = false;
|
|
7541
|
-
|
|
7542
|
-
|
|
7543
|
-
|
|
7544
|
-
|
|
7545
|
-
|
|
7546
|
-
|
|
7547
|
-
|
|
7548
|
-
|
|
7549
|
-
|
|
7550
|
-
|
|
7551
|
-
|
|
7552
|
-
|
|
7553
|
-
|
|
7554
|
-
|
|
7555
|
-
|
|
7556
|
-
|
|
7557
|
-
|
|
7558
|
-
|
|
7559
|
-
|
|
7560
|
-
|
|
7561
|
-
|
|
7562
|
-
|
|
7563
|
-
|
|
7564
|
-
for (let i = 0; i < numPresent; i++) {
|
|
7565
|
-
const key7 = presentKeys[i];
|
|
7566
|
-
if (targetKeys.indexOf(key7) === -1 && !exitingChildren.has(key7)) {
|
|
7567
|
-
exitingChildren.set(key7, void 0);
|
|
7526
|
+
pendingPresentChildren.current = presentChildren;
|
|
7527
|
+
for (let i = 0; i < renderedChildren.length; i++) {
|
|
7528
|
+
const key7 = getChildKey(renderedChildren[i]);
|
|
7529
|
+
if (!presentKeys.includes(key7)) {
|
|
7530
|
+
if (exitComplete.get(key7) !== true) {
|
|
7531
|
+
exitComplete.set(key7, false);
|
|
7532
|
+
}
|
|
7533
|
+
}
|
|
7534
|
+
else {
|
|
7535
|
+
exitComplete.delete(key7);
|
|
7536
|
+
}
|
|
7537
|
+
}
|
|
7538
|
+
}, [renderedChildren, presentKeys.length, presentKeys.join('-'),]);
|
|
7539
|
+
const exitingChildren = [];
|
|
7540
|
+
if (presentChildren !== diffedChildren) {
|
|
7541
|
+
let nextChildren = [...presentChildren,];
|
|
7542
|
+
for (let i = 0; i < renderedChildren.length; i++) {
|
|
7543
|
+
const child = renderedChildren[i];
|
|
7544
|
+
const key7 = getChildKey(child);
|
|
7545
|
+
if (!presentKeys.includes(key7)) {
|
|
7546
|
+
nextChildren.splice(i, 0, child);
|
|
7547
|
+
exitingChildren.push(child);
|
|
7548
|
+
}
|
|
7568
7549
|
}
|
|
7550
|
+
if (mode === 'wait' && exitingChildren.length) {
|
|
7551
|
+
nextChildren = exitingChildren;
|
|
7552
|
+
}
|
|
7553
|
+
setRenderedChildren(onlyElements(nextChildren));
|
|
7554
|
+
setDiffedChildren(presentChildren);
|
|
7555
|
+
return;
|
|
7569
7556
|
}
|
|
7570
|
-
if (
|
|
7571
|
-
|
|
7557
|
+
if (false) {
|
|
7558
|
+
console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`);
|
|
7572
7559
|
}
|
|
7573
|
-
|
|
7574
|
-
|
|
7575
|
-
|
|
7576
|
-
|
|
7577
|
-
|
|
7578
|
-
return;
|
|
7579
|
-
const insertionIndex = presentKeys.indexOf(key7);
|
|
7580
|
-
let exitingComponent = component;
|
|
7581
|
-
if (!exitingComponent) {
|
|
7560
|
+
const { forceRender, } = (0, react_3.useContext)(LayoutGroupContext);
|
|
7561
|
+
return (0, jsx_runtime_1.jsx)(react_8.Fragment, {
|
|
7562
|
+
children: renderedChildren.map((child) => {
|
|
7563
|
+
const key7 = getChildKey(child);
|
|
7564
|
+
const isPresent2 = presentChildren === renderedChildren || presentKeys.includes(key7);
|
|
7582
7565
|
const onExit = () => {
|
|
7583
|
-
|
|
7584
|
-
|
|
7585
|
-
|
|
7586
|
-
|
|
7587
|
-
|
|
7588
|
-
|
|
7589
|
-
|
|
7590
|
-
|
|
7591
|
-
|
|
7592
|
-
|
|
7566
|
+
if (exitComplete.has(key7)) {
|
|
7567
|
+
exitComplete.set(key7, true);
|
|
7568
|
+
}
|
|
7569
|
+
else {
|
|
7570
|
+
return;
|
|
7571
|
+
}
|
|
7572
|
+
let isEveryExitComplete = true;
|
|
7573
|
+
exitComplete.forEach((isExitComplete) => {
|
|
7574
|
+
if (!isExitComplete)
|
|
7575
|
+
isEveryExitComplete = false;
|
|
7593
7576
|
});
|
|
7594
|
-
if (
|
|
7595
|
-
|
|
7596
|
-
|
|
7597
|
-
forceRender();
|
|
7577
|
+
if (isEveryExitComplete) {
|
|
7578
|
+
forceRender === null || forceRender === void 0 ? void 0 : forceRender();
|
|
7579
|
+
setRenderedChildren(pendingPresentChildren.current);
|
|
7598
7580
|
onExitComplete && onExitComplete();
|
|
7599
7581
|
}
|
|
7600
7582
|
};
|
|
7601
|
-
|
|
7602
|
-
isPresent:
|
|
7603
|
-
|
|
7604
|
-
custom,
|
|
7583
|
+
return (0, jsx_runtime_1.jsx)(PresenceChild, {
|
|
7584
|
+
isPresent: isPresent2,
|
|
7585
|
+
initial: !isInitialRender.current || initial ? void 0 : false,
|
|
7586
|
+
custom: isPresent2 ? void 0 : custom,
|
|
7605
7587
|
presenceAffectsLayout,
|
|
7606
7588
|
mode,
|
|
7589
|
+
onExitComplete: isPresent2 ? void 0 : onExit,
|
|
7607
7590
|
children: child,
|
|
7608
|
-
},
|
|
7609
|
-
|
|
7610
|
-
}
|
|
7611
|
-
childrenToRender.splice(insertionIndex, 0, exitingComponent);
|
|
7612
|
-
});
|
|
7613
|
-
childrenToRender = childrenToRender.map((child) => {
|
|
7614
|
-
const key7 = child.key;
|
|
7615
|
-
return exitingChildren.has(key7) ? child : (0, jsx_runtime_1.jsx)(PresenceChild, {
|
|
7616
|
-
isPresent: true,
|
|
7617
|
-
presenceAffectsLayout,
|
|
7618
|
-
mode,
|
|
7619
|
-
children: child,
|
|
7620
|
-
}, getChildKey(child));
|
|
7621
|
-
});
|
|
7622
|
-
if (false) {
|
|
7623
|
-
console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`);
|
|
7624
|
-
}
|
|
7625
|
-
return (0, jsx_runtime_1.jsx)(react_8.Fragment, {
|
|
7626
|
-
children: exitingChildren.size ? childrenToRender : childrenToRender.map((child) => (0, react_11.cloneElement)(child)),
|
|
7591
|
+
}, key7);
|
|
7592
|
+
}),
|
|
7627
7593
|
});
|
|
7628
7594
|
};
|
|
7629
7595
|
exports.AnimatePresence = AnimatePresence;
|
|
@@ -7672,6 +7638,26 @@ function isLazyBundle(features) {
|
|
|
7672
7638
|
var DeprecatedLayoutGroupContext = (0, react_1.createContext)(null);
|
|
7673
7639
|
exports.DeprecatedLayoutGroupContext = DeprecatedLayoutGroupContext;
|
|
7674
7640
|
exports.LayoutGroupContext = DeprecatedLayoutGroupContext;
|
|
7641
|
+
function useIsMounted() {
|
|
7642
|
+
const isMounted = (0, react_4.useRef)(false);
|
|
7643
|
+
useIsomorphicLayoutEffect(() => {
|
|
7644
|
+
isMounted.current = true;
|
|
7645
|
+
return () => {
|
|
7646
|
+
isMounted.current = false;
|
|
7647
|
+
};
|
|
7648
|
+
}, []);
|
|
7649
|
+
return isMounted;
|
|
7650
|
+
}
|
|
7651
|
+
function useForceUpdate() {
|
|
7652
|
+
const isMounted = useIsMounted();
|
|
7653
|
+
const [forcedRenderCount, setForcedRenderCount,] = (0, react_10.useState)(0);
|
|
7654
|
+
const forceRender = (0, react_5.useCallback)(() => {
|
|
7655
|
+
isMounted.current && setForcedRenderCount(forcedRenderCount + 1);
|
|
7656
|
+
}, [forcedRenderCount,]);
|
|
7657
|
+
const deferredForceRender = (0, react_5.useCallback)(() => frame.postRender(forceRender), [forceRender,]);
|
|
7658
|
+
return [deferredForceRender, forcedRenderCount,];
|
|
7659
|
+
}
|
|
7660
|
+
exports.useForceUpdate = useForceUpdate;
|
|
7675
7661
|
var notify = (node) => !node.isLayoutDirty && node.willUpdate(false);
|
|
7676
7662
|
function nodeGroup() {
|
|
7677
7663
|
const nodes = /* @__PURE__ */ new Set();
|
|
@@ -7876,6 +7862,8 @@ var Reorder = {
|
|
|
7876
7862
|
Item,
|
|
7877
7863
|
};
|
|
7878
7864
|
exports.Reorder = Reorder;
|
|
7865
|
+
var domMin = Object.assign({ renderer: createDomVisualElement }, animations);
|
|
7866
|
+
exports.domMin = domMin;
|
|
7879
7867
|
var domAnimation = Object.assign(Object.assign({ renderer: createDomVisualElement }, animations), gestureAnimations);
|
|
7880
7868
|
exports.domAnimation = domAnimation;
|
|
7881
7869
|
var domMax = Object.assign(Object.assign(Object.assign({}, domAnimation), drag), layout);
|
|
@@ -7896,10 +7884,15 @@ function useMotionTemplate(fragments, ...values) {
|
|
|
7896
7884
|
return useCombineMotionValues(values.filter(isMotionValue), buildValue);
|
|
7897
7885
|
}
|
|
7898
7886
|
exports.useMotionTemplate = useMotionTemplate;
|
|
7887
|
+
function toNumber(v) {
|
|
7888
|
+
if (typeof v === 'number')
|
|
7889
|
+
return v;
|
|
7890
|
+
return parseFloat(v);
|
|
7891
|
+
}
|
|
7899
7892
|
function useSpring(source, config = {}) {
|
|
7900
7893
|
const { isStatic, } = (0, react_3.useContext)(MotionConfigContext);
|
|
7901
7894
|
const activeSpringAnimation = (0, react_4.useRef)(null);
|
|
7902
|
-
const value = useMotionValue(isMotionValue(source) ? source.get() : source);
|
|
7895
|
+
const value = useMotionValue(isMotionValue(source) ? toNumber(source.get()) : source);
|
|
7903
7896
|
const latestValue = (0, react_4.useRef)(value.get());
|
|
7904
7897
|
const latestSetter = (0, react_4.useRef)(() => { });
|
|
7905
7898
|
const startAnimation2 = () => {
|
|
@@ -7927,7 +7920,7 @@ function useSpring(source, config = {}) {
|
|
|
7927
7920
|
}, [JSON.stringify(config),]);
|
|
7928
7921
|
useIsomorphicLayoutEffect(() => {
|
|
7929
7922
|
if (isMotionValue(source)) {
|
|
7930
|
-
return source.on('change', (v) => value.set(
|
|
7923
|
+
return source.on('change', (v) => value.set(toNumber(v)));
|
|
7931
7924
|
}
|
|
7932
7925
|
}, [value,]);
|
|
7933
7926
|
return value;
|
|
@@ -8414,6 +8407,10 @@ function useTime() {
|
|
|
8414
8407
|
return time2;
|
|
8415
8408
|
}
|
|
8416
8409
|
exports.useTime = useTime;
|
|
8410
|
+
function useWillChange() {
|
|
8411
|
+
return useConstant(() => new WillChangeMotionValue('auto'));
|
|
8412
|
+
}
|
|
8413
|
+
exports.useWillChange = useWillChange;
|
|
8417
8414
|
function useReducedMotion() {
|
|
8418
8415
|
!hasReducedMotionListener.current && initPrefersReducedMotion();
|
|
8419
8416
|
const [shouldReduceMotion,] = (0, react_10.useState)(prefersReducedMotion.current);
|
|
@@ -8503,6 +8500,10 @@ function animationControls() {
|
|
|
8503
8500
|
return controls;
|
|
8504
8501
|
}
|
|
8505
8502
|
exports.animationControls = animationControls;
|
|
8503
|
+
function useUnmountEffect(callback) {
|
|
8504
|
+
return (0, react_2.useEffect)(() => () => callback(), []);
|
|
8505
|
+
}
|
|
8506
|
+
exports.useUnmountEffect = useUnmountEffect;
|
|
8506
8507
|
var wrap = (min, max, v) => {
|
|
8507
8508
|
const rangeSize = max - min;
|
|
8508
8509
|
return ((v - min) % rangeSize + rangeSize) % rangeSize + min;
|
|
@@ -8973,8 +8974,9 @@ function useResetProjection() {
|
|
|
8973
8974
|
exports.useResetProjection = useResetProjection;
|
|
8974
8975
|
var appearStoreId = (id4, value) => `${id4}: ${value}`;
|
|
8975
8976
|
var appearAnimationStore = /* @__PURE__ */ new Map();
|
|
8977
|
+
var elementsWithAppearAnimations = /* @__PURE__ */ new Set();
|
|
8976
8978
|
var handoffFrameTime;
|
|
8977
|
-
function handoffOptimizedAppearAnimation(elementId, valueName,
|
|
8979
|
+
function handoffOptimizedAppearAnimation(elementId, valueName, frame2) {
|
|
8978
8980
|
const optimisedValueName = transformProps.has(valueName) ? 'transform' : valueName;
|
|
8979
8981
|
const storeId = appearStoreId(elementId, optimisedValueName);
|
|
8980
8982
|
const optimisedAnimation = appearAnimationStore.get(storeId);
|
|
@@ -8982,25 +8984,14 @@ function handoffOptimizedAppearAnimation(elementId, valueName, _value, frame2) {
|
|
|
8982
8984
|
return null;
|
|
8983
8985
|
}
|
|
8984
8986
|
const { animation, startTime, } = optimisedAnimation;
|
|
8985
|
-
|
|
8987
|
+
if (startTime === null || window.MotionHandoffIsComplete) {
|
|
8986
8988
|
appearAnimationStore.delete(storeId);
|
|
8987
|
-
|
|
8988
|
-
frame2.render(() => frame2.render(() => {
|
|
8989
|
-
try {
|
|
8990
|
-
animation.cancel();
|
|
8991
|
-
}
|
|
8992
|
-
catch (error) { }
|
|
8993
|
-
}));
|
|
8994
|
-
}
|
|
8995
|
-
else {
|
|
8989
|
+
frame2.render(() => frame2.render(() => {
|
|
8996
8990
|
try {
|
|
8997
8991
|
animation.cancel();
|
|
8998
8992
|
}
|
|
8999
8993
|
catch (error) { }
|
|
9000
|
-
}
|
|
9001
|
-
};
|
|
9002
|
-
if (startTime === null || window.HandoffComplete) {
|
|
9003
|
-
cancelAnimation();
|
|
8994
|
+
}));
|
|
9004
8995
|
return null;
|
|
9005
8996
|
}
|
|
9006
8997
|
else {
|
|
@@ -9013,14 +9004,14 @@ function handoffOptimizedAppearAnimation(elementId, valueName, _value, frame2) {
|
|
|
9013
9004
|
var startFrameTime;
|
|
9014
9005
|
var readyAnimation;
|
|
9015
9006
|
function startOptimizedAppearAnimation(element, name, keyframes2, options, onReady) {
|
|
9016
|
-
if (window.
|
|
9017
|
-
window.
|
|
9007
|
+
if (window.MotionHandoffIsComplete) {
|
|
9008
|
+
window.MotionHandoffAnimation = void 0;
|
|
9018
9009
|
return;
|
|
9019
9010
|
}
|
|
9020
9011
|
const id4 = element.dataset[optimizedAppearDataId];
|
|
9021
9012
|
if (!id4)
|
|
9022
9013
|
return;
|
|
9023
|
-
window.
|
|
9014
|
+
window.MotionHandoffAnimation = handoffOptimizedAppearAnimation;
|
|
9024
9015
|
const storeId = appearStoreId(id4, name);
|
|
9025
9016
|
if (!readyAnimation) {
|
|
9026
9017
|
readyAnimation = animateStyle(element, name, [keyframes2[0], keyframes2[0],], /**
|
|
@@ -9034,15 +9025,18 @@ function startOptimizedAppearAnimation(element, name, keyframes2, options, onRea
|
|
|
9034
9025
|
animation: readyAnimation,
|
|
9035
9026
|
startTime: null,
|
|
9036
9027
|
});
|
|
9037
|
-
|
|
9038
|
-
|
|
9039
|
-
|
|
9028
|
+
window.MotionHandoffAnimation = handoffOptimizedAppearAnimation;
|
|
9029
|
+
window.MotionHandoffCancelAll = () => {
|
|
9030
|
+
appearAnimationStore.forEach(({ animation, }, animationId) => {
|
|
9031
|
+
if (animationId.endsWith('transform')) {
|
|
9040
9032
|
animation.cancel();
|
|
9041
|
-
|
|
9042
|
-
|
|
9043
|
-
|
|
9044
|
-
|
|
9045
|
-
}
|
|
9033
|
+
appearAnimationStore.delete(animationId);
|
|
9034
|
+
}
|
|
9035
|
+
});
|
|
9036
|
+
window.MotionHandoffCancelAll = void 0;
|
|
9037
|
+
};
|
|
9038
|
+
window.MotionHasOptimisedAnimation = (elementId) => Boolean(elementId && elementsWithAppearAnimations.has(elementId));
|
|
9039
|
+
window.MotionHasOptimisedTransformAnimation = (elementId) => Boolean(elementId && appearAnimationStore.has(appearStoreId(elementId, 'transform')));
|
|
9046
9040
|
}
|
|
9047
9041
|
const startAnimation2 = () => {
|
|
9048
9042
|
readyAnimation.cancel();
|
|
@@ -9058,6 +9052,7 @@ function startOptimizedAppearAnimation(element, name, keyframes2, options, onRea
|
|
|
9058
9052
|
if (onReady)
|
|
9059
9053
|
onReady(appearAnimation);
|
|
9060
9054
|
};
|
|
9055
|
+
elementsWithAppearAnimations.add(id4);
|
|
9061
9056
|
if (readyAnimation.ready) {
|
|
9062
9057
|
readyAnimation.ready.then(startAnimation2).catch(noop);
|
|
9063
9058
|
}
|
|
@@ -9225,12 +9220,13 @@ var cancelSync = stepsOrder.reduce((acc, key7) => {
|
|
|
9225
9220
|
return acc;
|
|
9226
9221
|
}, {});
|
|
9227
9222
|
exports.cancelSync = cancelSync;
|
|
9228
|
-
// https :https://app.framerstatic.com/framer.
|
|
9223
|
+
// https :https://app.framerstatic.com/framer.LMS2FZ32.js
|
|
9229
9224
|
const react_12 = __importDefault(require("react"));
|
|
9230
9225
|
const react_13 = require("react");
|
|
9231
9226
|
const react_14 = require("react");
|
|
9232
9227
|
const react_dom_1 = __importDefault(require("react-dom"));
|
|
9233
9228
|
const react_15 = require("react");
|
|
9229
|
+
const react_16 = require("react");
|
|
9234
9230
|
var require_hsluv = __commonJS({
|
|
9235
9231
|
'../../../node_modules/hsluv/dist/hsluv.cjs'(exports) {
|
|
9236
9232
|
'use strict';
|
|
@@ -28254,9 +28250,9 @@ function runEffectAnimation(target, effect, shouldReduceMotion, ref, appearId, i
|
|
|
28254
28250
|
const visualElement = visualElementStore.get(ref.current);
|
|
28255
28251
|
if (visualElement)
|
|
28256
28252
|
visualElement.setBaseTarget(key7, value);
|
|
28257
|
-
const handoff = isString22(appearId) && !(motionValue2 == null ? void 0 : motionValue2.hasAnimated) && safeWindow.
|
|
28253
|
+
const handoff = isString22(appearId) && !(motionValue2 == null ? void 0 : motionValue2.hasAnimated) && safeWindow.MotionHandoffAnimation
|
|
28258
28254
|
? {
|
|
28259
|
-
elapsed: safeWindow.
|
|
28255
|
+
elapsed: safeWindow.MotionHandoffAnimation(appearId, key7, frame),
|
|
28260
28256
|
}
|
|
28261
28257
|
: void 0;
|
|
28262
28258
|
if (instant) {
|
|
@@ -30788,15 +30784,23 @@ function stateCanSubmitForm(state) {
|
|
|
30788
30784
|
function preventDefault(e) {
|
|
30789
30785
|
e.preventDefault();
|
|
30790
30786
|
}
|
|
30791
|
-
function
|
|
30792
|
-
if (!safeWindow)
|
|
30793
|
-
return;
|
|
30787
|
+
function openExternalLinkInCurrentTab(link, formRef) {
|
|
30794
30788
|
const href = isValidURL(link, false) ? link : `https://${link}`;
|
|
30795
|
-
|
|
30789
|
+
const linkElement = document.createElement('a');
|
|
30790
|
+
linkElement.href = href;
|
|
30791
|
+
linkElement.target = '_self';
|
|
30792
|
+
linkElement.style.display = 'none';
|
|
30793
|
+
if (!('current' in formRef && formRef.current))
|
|
30794
|
+
return;
|
|
30795
|
+
formRef.current.appendChild(linkElement);
|
|
30796
|
+
linkElement.click();
|
|
30797
|
+
linkElement.remove();
|
|
30796
30798
|
}
|
|
30797
30799
|
var FormContext = react_12.default.createContext(void 0);
|
|
30798
|
-
var FormContainer = /* @__PURE__ */ react_12.default.forwardRef((_j,
|
|
30800
|
+
var FormContainer = /* @__PURE__ */ react_12.default.forwardRef((_j, forwardedRef) => {
|
|
30799
30801
|
var { action, children, redirectUrl, onSuccess, onError, onLoading } = _j, props = __rest(_j, ["action", "children", "redirectUrl", "onSuccess", "onError", "onLoading"]);
|
|
30802
|
+
const fallbackRef = react_12.default.useRef(null);
|
|
30803
|
+
const ref = forwardedRef !== null && forwardedRef !== void 0 ? forwardedRef : fallbackRef;
|
|
30800
30804
|
const router = useRouter();
|
|
30801
30805
|
const currentRoute = useCurrentRoute();
|
|
30802
30806
|
const implicitPathVariables = useImplicitPathVariables();
|
|
@@ -30821,7 +30825,7 @@ var FormContainer = /* @__PURE__ */ react_12.default.forwardRef((_j, ref) => {
|
|
|
30821
30825
|
if (isString22(link)) {
|
|
30822
30826
|
const matchingRoute2 = findMatchingRouteAttributesForResolvedPath(router, link, implicitPathVariables);
|
|
30823
30827
|
if (!matchingRoute2) {
|
|
30824
|
-
|
|
30828
|
+
openExternalLinkInCurrentTab(link, ref);
|
|
30825
30829
|
return;
|
|
30826
30830
|
}
|
|
30827
30831
|
const { routeId: routeId2, elementId: elementId2, pathVariables: pathVariables2, } = matchingRoute2;
|
|
@@ -38296,7 +38300,7 @@ function processRichTextChildren(element, stylesPresetsClassNames, plainText, an
|
|
|
38296
38300
|
children = [anchorLink,];
|
|
38297
38301
|
}
|
|
38298
38302
|
}
|
|
38299
|
-
return (0,
|
|
38303
|
+
return (0, react_16.cloneElement)(element, props, ...children);
|
|
38300
38304
|
}
|
|
38301
38305
|
function generateHeadingSlug(children, slugCounters) {
|
|
38302
38306
|
var _j;
|
|
@@ -40540,7 +40544,7 @@ var package_default = {
|
|
|
40540
40544
|
yargs: '^17.6.2',
|
|
40541
40545
|
},
|
|
40542
40546
|
peerDependencies: {
|
|
40543
|
-
'framer-motion': '11.3.
|
|
40547
|
+
'framer-motion': '11.3.23',
|
|
40544
40548
|
react: '^18.2.0',
|
|
40545
40549
|
'react-dom': '^18.2.0',
|
|
40546
40550
|
},
|