unframer 2.16.2 → 2.17.1
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/README.md +3 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +5 -4
- package/dist/cli.js.map +1 -1
- package/dist/esbuild.d.ts.map +1 -1
- package/dist/esbuild.js +5 -2
- package/dist/esbuild.js.map +1 -1
- package/dist/exporter.d.ts +11 -3
- package/dist/exporter.d.ts.map +1 -1
- package/dist/exporter.js +62 -85
- package/dist/exporter.js.map +1 -1
- package/dist/framer.d.ts.map +1 -1
- package/dist/framer.js +255 -190
- package/dist/framer.js.map +1 -1
- package/dist/react.d.ts.map +1 -1
- package/dist/react.js +2 -2
- package/dist/react.js.map +1 -1
- package/esm/cli.d.ts.map +1 -1
- package/esm/cli.js +4 -3
- package/esm/cli.js.map +1 -1
- package/esm/esbuild.d.ts.map +1 -1
- package/esm/esbuild.js +5 -2
- package/esm/esbuild.js.map +1 -1
- package/esm/exporter.d.ts +11 -3
- package/esm/exporter.d.ts.map +1 -1
- package/esm/exporter.js +64 -86
- package/esm/exporter.js.map +1 -1
- package/esm/framer.d.ts.map +1 -1
- package/esm/framer.js +249 -187
- package/esm/framer.js.map +1 -1
- package/esm/react.d.ts.map +1 -1
- package/esm/react.js +2 -2
- package/esm/react.js.map +1 -1
- package/package.json +18 -18
- package/src/cli.tsx +7 -5
- package/src/esbuild.ts +5 -2
- package/src/exporter.ts +86 -103
- package/src/framer.js +265 -205
- package/src/react.tsx +3 -5
package/dist/framer.js
CHANGED
|
@@ -37,9 +37,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
39
|
exports.LayoutGroupContext = exports.DeprecatedLayoutGroupContext = exports.DeprecatedFrameWithEvents = exports.DeprecatedComponentContainer = exports.defaultDeviceProps = exports.DataObserverContext = exports.DataObserver = exports.DataContext = exports.Data = exports.CycleVariantState = exports.CustomCursorHost = exports.createBox = exports.ConvertColor = exports.ControlType = exports.Container = exports.ConstraintValues = exports.ConstraintMask = exports.ComponentViewportProvider = exports.ComponentContainerContext = exports.complex = exports.combinedCSSRulesForPreview = exports.ColorMixModelType = exports.ColorFormat = exports.color = exports.Color = exports.clamp = exports.circOut = exports.circInOut = exports.circIn = exports.cancelSync = exports.cancelFrame = exports.callEach = exports.BoxShadow = exports.BezierAnimator = exports.backOut = exports.backInOut = exports.backIn = exports.BackgroundImage = exports.AnyInterpolation = exports.anticipate = exports.animations = exports.AnimateSharedLayout = exports.AnimatePresence = exports.animateMini = exports.animate = exports.Animatable = exports.AnchorLinkTarget = exports.addPointerInfo = exports.AcceleratedAnimation = exports.combinedCSSRules = void 0;
|
|
40
|
-
exports.
|
|
41
|
-
exports.
|
|
42
|
-
exports.LocaleInfoContext = exports.FormContext = exports.FetchClientProvider = exports.FramerLink = exports.wrap = exports.withVariantFX = exports.withVariantAppearEffect = exports.withStyleAppearEffect = exports.withParallaxTransform = exports.withMeasuredSize = exports.withGeneratedLayoutId = exports.withFX = exports.withCSS = exports.WindowContext = exports.warning = exports.visualElementStore = exports.VisualElement = exports.version = exports.VectorGroup = exports.Vector = exports.VariantSelector = exports.ValueInterpolation = exports.useProvidedWindow = exports.useIsomorphicLayoutEffect = exports.useAnimation = exports.Text = exports.systemFontFamilyName = exports.sync = exports.SwitchLayoutGroupContext = exports.StyleSheetContext = exports.Stack = exports.SSRVariants = exports.SpringAnimator = void 0;
|
|
40
|
+
exports.LayoutIdContext = exports.LayoutGroup = exports.Layer = exports.isMotionValue = exports.isBrowser = exports.invariant = exports.InternalID = exports.Image = exports.GracefullyDegradingErrorBoundary = exports.GeneratedComponentContext = exports.GamepadContext = exports.FrameWithMotion = exports.frameSteps = 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.FormSelect = exports.FormPlainTextInput = exports.FormContainer = exports.FormBooleanInput = exports.fontStore = exports.FontSourceNames = exports.FlatTree = exports.Fetcher = exports.environment = exports.easeOut = exports.easeInOut = exports.easeIn = exports.Draggable = exports.DragControls = exports.domMin = exports.domMax = exports.domAnimation = exports.DOM = exports.distance = exports.dispatchKeyDownEvent = exports.DimensionType = exports.devicePresets = exports.DeviceCodeComponent = void 0;
|
|
41
|
+
exports.Size = exports.sharedSVGManager = exports.Shadow = exports.Scroll = exports.RichText = exports.reverseEasing = exports.ResolveLinks = exports.RenderTarget = exports.Rect = exports.RadialGradient = exports.QueryEngine = exports.px = exports.PropertyStore = exports.PropertyOverrides = exports.progress = exports.PresenceContext = exports.Polygon = exports.pipe = exports.PathVariablesContext = exports.PathSegment = exports.pathDefaults = exports.ParentSizeState = exports.Page = exports.optimizedAppearDataAttribute = exports.optimizeAppearTransformTemplate = exports.optimizeAppear = exports.ObservableObject = exports.NotFoundError = exports.nestedLinksCollector = exports.NavigationTransitionType = exports.NavigationConsumer = exports.NavigationCallbackProvider = exports.NavigateTo = exports.Reorder = exports.MotionValue = exports.MotionGlobalConfig = exports.MotionContext = exports.MotionConfigContext = exports.motion = exports.mirrorEasing = exports.makeUseVisualState = exports.MainLoop = exports.m = exports.localPackageFallbackIdentifier = exports.loadFont = exports.Link = exports.LinearGradient = exports.Line = exports.LibraryFeaturesProvider = exports.LazyValue = void 0;
|
|
42
|
+
exports.LocaleInfoContext = exports.FormContext = exports.FetchClientProvider = exports.FramerLink = exports.wrap = exports.withVariantFX = exports.withVariantAppearEffect = exports.withStyleAppearEffect = exports.withParallaxTransform = exports.withMeasuredSize = exports.withGeneratedLayoutId = exports.withFX = exports.withCSS = exports.WindowContext = exports.warning = exports.visualElementStore = exports.VisualElement = exports.version = exports.VectorGroup = exports.Vector = exports.VariantSelector = exports.ValueInterpolation = exports.useProvidedWindow = exports.useIsomorphicLayoutEffect = exports.useAnimation = exports.Text = exports.systemFontFamilyName = exports.sync = exports.SwitchLayoutGroupContext = exports.StyleSheetContext = exports.Stack = exports.SSRVariants = exports.SpringAnimator = exports.SmartComponentScopedContainer = void 0;
|
|
43
43
|
exports._injectRuntime = _injectRuntime;
|
|
44
44
|
exports.addActionControls = addActionControls;
|
|
45
45
|
exports.addFonts = addFonts;
|
|
@@ -151,6 +151,7 @@ exports.resolvePageScope = resolvePageScope;
|
|
|
151
151
|
exports.roundedNumber = roundedNumber;
|
|
152
152
|
exports.roundedNumberString = roundedNumberString;
|
|
153
153
|
exports.roundWithOffset = roundWithOffset;
|
|
154
|
+
exports.safeCSSValue = safeCSSValue;
|
|
154
155
|
exports.scroll = scroll;
|
|
155
156
|
exports.scrollInfo = scrollInfo;
|
|
156
157
|
exports.setGlobalRenderEnvironment = setGlobalRenderEnvironment;
|
|
@@ -239,6 +240,7 @@ exports.useRouteElementId = useRouteElementId;
|
|
|
239
240
|
exports.useRouteHandler = useRouteHandler;
|
|
240
241
|
exports.useRouter = useRouter;
|
|
241
242
|
exports.useScroll = useScroll;
|
|
243
|
+
exports.useSiteRefs = useSiteRefs;
|
|
242
244
|
exports.useSpring = useSpring;
|
|
243
245
|
exports.useTime = useTime;
|
|
244
246
|
exports.useTransform = useTransform;
|
|
@@ -516932,7 +516934,7 @@ function steps(numSteps, direction = 'end') {
|
|
|
516932
516934
|
return clamp(0, 1, rounded / numSteps);
|
|
516933
516935
|
};
|
|
516934
516936
|
}
|
|
516935
|
-
// /:https://app.framerstatic.com/framer.
|
|
516937
|
+
// /:https://app.framerstatic.com/framer.43KQGWBL.mjs
|
|
516936
516938
|
init_chunk_QLPHEVXG();
|
|
516937
516939
|
const react_11 = __importDefault(require("react"));
|
|
516938
516940
|
const react_12 = require("react");
|
|
@@ -519656,7 +519658,10 @@ function getHashForRoute(hash2, route, hashVariables) {
|
|
|
519656
519658
|
const variables = Object.assign({}, route == null ? void 0 : route.elements, hashVariables);
|
|
519657
519659
|
return resolvedHash.replace(pathVariablesRegExp, (m2, p1) => String(variables[p1] ?? m2));
|
|
519658
519660
|
}
|
|
519659
|
-
function getPathForRoute(route, { currentRoutePath, currentPathVariables, hash: hash2, pathVariables, hashVariables, relative: relative2 = true, preserveQueryParams, }) {
|
|
519661
|
+
function getPathForRoute(route, { currentRoutePath, currentPathVariables, hash: hash2, pathVariables, hashVariables, relative: relative2 = true, preserveQueryParams, onlyHash = false, }) {
|
|
519662
|
+
const resolvedHash = getHashForRoute(hash2, route, hashVariables);
|
|
519663
|
+
if (onlyHash)
|
|
519664
|
+
return resolvedHash ?? '';
|
|
519660
519665
|
let currentPath = currentRoutePath ?? '/';
|
|
519661
519666
|
if (currentPathVariables) {
|
|
519662
519667
|
currentPath = currentPath.replace(pathVariablesRegExp, (m2, p1) => String(currentPathVariables[p1] || m2));
|
|
@@ -519666,7 +519671,6 @@ function getPathForRoute(route, { currentRoutePath, currentPathVariables, hash:
|
|
|
519666
519671
|
if (pathVariables) {
|
|
519667
519672
|
path = path.replace(pathVariablesRegExp, (m2, p1) => String(pathVariables[p1] || m2));
|
|
519668
519673
|
}
|
|
519669
|
-
const resolvedHash = getHashForRoute(hash2, route, hashVariables);
|
|
519670
519674
|
const isSamePageHashNavigation = currentPath === path && resolvedHash;
|
|
519671
519675
|
if (relative2) {
|
|
519672
519676
|
path = computeRelativePath(currentPath, path);
|
|
@@ -520421,6 +520425,9 @@ function Point(x, y) {
|
|
|
520421
520425
|
};
|
|
520422
520426
|
}
|
|
520423
520427
|
((Point2) => {
|
|
520428
|
+
Point2.isQuadrilateralPoints = (points) => {
|
|
520429
|
+
return (points == null ? void 0 : points.length) === 4;
|
|
520430
|
+
};
|
|
520424
520431
|
Point2.add = (...args) => {
|
|
520425
520432
|
return args.reduce((previousValue, currentValue) => {
|
|
520426
520433
|
return {
|
|
@@ -520531,9 +520538,11 @@ function Point(x, y) {
|
|
|
520531
520538
|
const angles = /* @__PURE__ */ new Map();
|
|
520532
520539
|
for (let i = 0; i < points.length; i++) {
|
|
520533
520540
|
const point2 = points[i];
|
|
520534
|
-
|
|
520541
|
+
if (!point2)
|
|
520542
|
+
continue;
|
|
520543
|
+
angles.set(point2, Math.atan2(point2.y - centerPoint.y, point2.x - centerPoint.x));
|
|
520535
520544
|
}
|
|
520536
|
-
return points.sort((a, b) => angles.get(a) - angles.get(b));
|
|
520545
|
+
return points.sort((a, b) => (angles.get(a) ?? 0) - (angles.get(b) ?? 0));
|
|
520537
520546
|
}
|
|
520538
520547
|
Point2.sortClockwise = sortClockwise;
|
|
520539
520548
|
})(Point || (exports.Point = Point = {}));
|
|
@@ -527216,9 +527225,9 @@ var deviceCodeComponentPresetIds = [
|
|
|
527216
527225
|
'1440p',
|
|
527217
527226
|
'4k',
|
|
527218
527227
|
];
|
|
527219
|
-
var devicePresetsMap = /* @__PURE__ */ devicePresets.reduce((
|
|
527220
|
-
|
|
527221
|
-
return
|
|
527228
|
+
var devicePresetsMap = /* @__PURE__ */ devicePresets.reduce((map2, preset) => {
|
|
527229
|
+
map2[preset.id] = preset;
|
|
527230
|
+
return map2;
|
|
527222
527231
|
}, {});
|
|
527223
527232
|
function getDevicePreset(presetId) {
|
|
527224
527233
|
return devicePresetsMap[presetId] ?? devicePresetsMap[defaultPresetId];
|
|
@@ -536025,6 +536034,10 @@ function useFXValues(values, enabled) {
|
|
|
536025
536034
|
}, [effect, enabled,]);
|
|
536026
536035
|
return effect;
|
|
536027
536036
|
}
|
|
536037
|
+
function useIsStaticRenderer() {
|
|
536038
|
+
const currentTarget = RenderTarget.current();
|
|
536039
|
+
return currentTarget === RenderTarget.canvas || currentTarget === RenderTarget.export;
|
|
536040
|
+
}
|
|
536028
536041
|
var loopOptionsKeys = /* @__PURE__ */ new Set(['loopEffectEnabled', 'loopTransition', 'loop', 'loopRepeatType', 'loopRepeatDelay',]);
|
|
536029
536042
|
var useDelay = () => {
|
|
536030
536043
|
const timeoutRef = (0, react_5.useRef)();
|
|
@@ -536757,8 +536770,8 @@ var withFX = (Component18) => react_11.default.forwardRef((props, forwardedRef)
|
|
|
536757
536770
|
ref: forwardedRef,
|
|
536758
536771
|
});
|
|
536759
536772
|
}
|
|
536760
|
-
const
|
|
536761
|
-
if (
|
|
536773
|
+
const isRenderingStaticContent = useIsStaticRenderer();
|
|
536774
|
+
if (isRenderingStaticContent) {
|
|
536762
536775
|
const animate4 = isVariantOrVariantList(props.animate) ? props.animate : void 0;
|
|
536763
536776
|
const initial2 = isVariantOrVariantList(props.initial) ? props.initial : void 0;
|
|
536764
536777
|
return /* @__PURE__ */ (0, jsx_runtime_1.jsx)(Component18, {
|
|
@@ -537668,7 +537681,7 @@ var Polygon = {
|
|
|
537668
537681
|
if (d === 0)
|
|
537669
537682
|
continue;
|
|
537670
537683
|
const localSign = d > 0;
|
|
537671
|
-
sign
|
|
537684
|
+
sign ??= localSign;
|
|
537672
537685
|
if (sign !== localSign)
|
|
537673
537686
|
return false;
|
|
537674
537687
|
}
|
|
@@ -538227,6 +538240,76 @@ function Floating({ alignment, placement, safeArea, offsetX, offsetY, anchorRef,
|
|
|
538227
538240
|
}
|
|
538228
538241
|
var GeneratedComponentContext = /* @__PURE__ */ react_11.default.createContext(void 0);
|
|
538229
538242
|
exports.GeneratedComponentContext = GeneratedComponentContext;
|
|
538243
|
+
var LibraryFeaturesContext = /* @__PURE__ */ react_11.default.createContext(void 0);
|
|
538244
|
+
var LibraryFeaturesProvider = /* @__PURE__ */ (() => LibraryFeaturesContext.Provider)();
|
|
538245
|
+
exports.LibraryFeaturesProvider = LibraryFeaturesProvider;
|
|
538246
|
+
var useLibraryFeatures = () => {
|
|
538247
|
+
const context = react_11.default.useContext(LibraryFeaturesContext);
|
|
538248
|
+
return context ?? {};
|
|
538249
|
+
};
|
|
538250
|
+
var GracefullyDegradingErrorBoundary = class extends react_7.Component {
|
|
538251
|
+
constructor() {
|
|
538252
|
+
super(...arguments);
|
|
538253
|
+
__publicField(this, 'state', {
|
|
538254
|
+
error: void 0,
|
|
538255
|
+
});
|
|
538256
|
+
__publicField(this, 'message', 'Made UI non-interactive due to an error');
|
|
538257
|
+
__publicField(this, 'messageReport', 'If you are the author of this website, please report this issue to the Framer team via https://www.framer.community/');
|
|
538258
|
+
}
|
|
538259
|
+
static getDerivedStateFromError(error) {
|
|
538260
|
+
return {
|
|
538261
|
+
error,
|
|
538262
|
+
};
|
|
538263
|
+
}
|
|
538264
|
+
componentDidCatch(error) {
|
|
538265
|
+
var _a, _b;
|
|
538266
|
+
window.__framer_hadFatalError = true;
|
|
538267
|
+
if ('cause' in error) {
|
|
538268
|
+
error = error.cause;
|
|
538269
|
+
}
|
|
538270
|
+
console.error(`${this.message} (see above). ${this.messageReport}.`);
|
|
538271
|
+
const sampleRate = Math.random();
|
|
538272
|
+
if (!((_a = this.context) == null ? void 0 : _a.codeBoundaries) && sampleRate > 0.01)
|
|
538273
|
+
return;
|
|
538274
|
+
if (sampleRate > 0.25)
|
|
538275
|
+
return;
|
|
538276
|
+
const stack = error instanceof Error && typeof error.stack === 'string' ? error.stack : null;
|
|
538277
|
+
(_b = window.__framer_events) == null ? void 0 : _b.push(['published_site_load_error', {
|
|
538278
|
+
message: String(error),
|
|
538279
|
+
stack,
|
|
538280
|
+
},]);
|
|
538281
|
+
}
|
|
538282
|
+
render() {
|
|
538283
|
+
var _a, _b;
|
|
538284
|
+
const error = this.state.error;
|
|
538285
|
+
if (!error)
|
|
538286
|
+
return this.props.children;
|
|
538287
|
+
const unwrappedError = 'cause' in error ? error.cause : error;
|
|
538288
|
+
const closingHTMLComment = /-->/gu;
|
|
538289
|
+
const closingHTMLCommentReplacement = '--!>';
|
|
538290
|
+
const dom = isBot(navigator.userAgent) ? ((_a = document.getElementById('main')) == null ? void 0 : _a.innerHTML) || '' : // @FIXME: We should have a UI for fatal error recovery.
|
|
538291
|
+
// We don't have a UI for fatal error recovery currently, so we just render nothing for regular users. If we were to throw, React would unmount too.
|
|
538292
|
+
// We do render instead of throwing, so that:
|
|
538293
|
+
// - `componentDidCatch` runs (if we throw here, it does not)
|
|
538294
|
+
// - we can skip logging `Recoverable error during hydration`, because we know it was fatal.
|
|
538295
|
+
'';
|
|
538296
|
+
return (
|
|
538297
|
+
// This has the caveat that we will slightly modify the DOM, but it appears to be fine in this case.
|
|
538298
|
+
// The alternative would be to queue a new task that runs after and then set the innerHTML (= avoids the dummy-div), but that means we'll have DOM -> no DOM -> DOM transitions. With the div, we have DOM -> DOM and remove possible race-conditions.
|
|
538299
|
+
/* @__PURE__ */
|
|
538300
|
+
(0, jsx_runtime_1.jsx)('div', {
|
|
538301
|
+
style: {
|
|
538302
|
+
display: 'contents',
|
|
538303
|
+
},
|
|
538304
|
+
suppressHydrationWarning: true,
|
|
538305
|
+
dangerouslySetInnerHTML: {
|
|
538306
|
+
__html: `<!-- DOM replaced by GracefullyDegradingErrorBoundary due to "${unwrappedError.message.replace(closingHTMLComment, closingHTMLCommentReplacement)}". ${this.messageReport}: --><!-- Stack: ${(_b = error.stack) == null ? void 0 : _b.replace(closingHTMLComment, '--!>')} -->` + dom,
|
|
538307
|
+
},
|
|
538308
|
+
}));
|
|
538309
|
+
}
|
|
538310
|
+
};
|
|
538311
|
+
exports.GracefullyDegradingErrorBoundary = GracefullyDegradingErrorBoundary;
|
|
538312
|
+
__publicField(GracefullyDegradingErrorBoundary, 'contextType', LibraryFeaturesContext);
|
|
538230
538313
|
var LazyValue = class {
|
|
538231
538314
|
constructor(resolver) {
|
|
538232
538315
|
this.resolver = resolver;
|
|
@@ -538282,13 +538365,6 @@ var LazyValue = class {
|
|
|
538282
538365
|
}
|
|
538283
538366
|
};
|
|
538284
538367
|
exports.LazyValue = LazyValue;
|
|
538285
|
-
var LibraryFeaturesContext = /* @__PURE__ */ react_11.default.createContext(void 0);
|
|
538286
|
-
var LibraryFeaturesProvider = /* @__PURE__ */ (() => LibraryFeaturesContext.Provider)();
|
|
538287
|
-
exports.LibraryFeaturesProvider = LibraryFeaturesProvider;
|
|
538288
|
-
var useLibraryFeatures = () => {
|
|
538289
|
-
const context = react_11.default.useContext(LibraryFeaturesContext);
|
|
538290
|
-
return context ?? {};
|
|
538291
|
-
};
|
|
538292
538368
|
function findAnchorElement(target, withinElement) {
|
|
538293
538369
|
if (target instanceof HTMLAnchorElement) {
|
|
538294
538370
|
return target;
|
|
@@ -539018,13 +539094,13 @@ function useReplaceNestedLinks(nodeId, href, propsAddedByLink) {
|
|
|
539018
539094
|
if (isOnFramerCanvas || !shouldReplaceLink || !isValidLink)
|
|
539019
539095
|
return;
|
|
539020
539096
|
node.dataset.hydrated = 'true';
|
|
539021
|
-
}, [
|
|
539097
|
+
}, [isValidLink, shouldReplaceLink,]);
|
|
539022
539098
|
return [getChildren, refCallback,];
|
|
539023
539099
|
}
|
|
539024
539100
|
function resolveLink(href, router, implicitPathVariables) {
|
|
539025
539101
|
return resolveLinkInternal(href, router, implicitPathVariables);
|
|
539026
539102
|
}
|
|
539027
|
-
function resolveLinkInternal(href, router, implicitPathVariables, resolveSlugs2) {
|
|
539103
|
+
function resolveLinkInternal(href, router, implicitPathVariables, onlyHash, resolveSlugs2) {
|
|
539028
539104
|
const pageLink = isLinkToWebPage(href) ? href : linkFromFramerPageLink(href);
|
|
539029
539105
|
if (!isLinkToWebPage(pageLink))
|
|
539030
539106
|
return isString(href) ? propsForLink(href).href : void 0;
|
|
@@ -539046,6 +539122,7 @@ function resolveLinkInternal(href, router, implicitPathVariables, resolveSlugs2)
|
|
|
539046
539122
|
hashVariables: combinedHashVariables,
|
|
539047
539123
|
relative: false,
|
|
539048
539124
|
preserveQueryParams: router.preserveQueryParams,
|
|
539125
|
+
onlyHash,
|
|
539049
539126
|
});
|
|
539050
539127
|
}
|
|
539051
539128
|
function resolvePageScope(pageLink, router) {
|
|
@@ -540185,69 +540262,7 @@ function usePrefetch() {
|
|
|
540185
540262
|
}
|
|
540186
540263
|
return React2.useCallback((request) => fetchClient.prefetch(request), [fetchClient,]);
|
|
540187
540264
|
}
|
|
540188
|
-
|
|
540189
|
-
constructor() {
|
|
540190
|
-
super(...arguments);
|
|
540191
|
-
__publicField(this, 'state', {
|
|
540192
|
-
error: void 0,
|
|
540193
|
-
});
|
|
540194
|
-
__publicField(this, 'message', 'Made UI non-interactive due to an error');
|
|
540195
|
-
__publicField(this, 'messageReport', 'If you are the author of this website, please report this issue to the Framer team via https://www.framer.community/');
|
|
540196
|
-
}
|
|
540197
|
-
static getDerivedStateFromError(error) {
|
|
540198
|
-
return {
|
|
540199
|
-
error,
|
|
540200
|
-
};
|
|
540201
|
-
}
|
|
540202
|
-
componentDidCatch(error) {
|
|
540203
|
-
var _a, _b;
|
|
540204
|
-
window.__framer_hadFatalError = true;
|
|
540205
|
-
if ('cause' in error) {
|
|
540206
|
-
error = error.cause;
|
|
540207
|
-
}
|
|
540208
|
-
console.error(`${this.message} (see above). ${this.messageReport}.`);
|
|
540209
|
-
const sampleRate = Math.random();
|
|
540210
|
-
if (!((_a = this.context) == null ? void 0 : _a.codeBoundaries) && sampleRate > 0.01)
|
|
540211
|
-
return;
|
|
540212
|
-
if (sampleRate > 0.25)
|
|
540213
|
-
return;
|
|
540214
|
-
const stack = error instanceof Error && typeof error.stack === 'string' ? error.stack : null;
|
|
540215
|
-
(_b = window.__framer_events) == null ? void 0 : _b.push(['published_site_load_error', {
|
|
540216
|
-
message: String(error),
|
|
540217
|
-
stack,
|
|
540218
|
-
},]);
|
|
540219
|
-
}
|
|
540220
|
-
render() {
|
|
540221
|
-
var _a, _b;
|
|
540222
|
-
const error = this.state.error;
|
|
540223
|
-
if (!error)
|
|
540224
|
-
return this.props.children;
|
|
540225
|
-
const unwrappedError = 'cause' in error ? error.cause : error;
|
|
540226
|
-
const closingHTMLComment = /-->/gu;
|
|
540227
|
-
const closingHTMLCommentReplacement = '--!>';
|
|
540228
|
-
const dom = isBot(navigator.userAgent) ? ((_a = document.getElementById('main')) == null ? void 0 : _a.innerHTML) || '' : // @FIXME: We should have a UI for fatal error recovery.
|
|
540229
|
-
// We don't have a UI for fatal error recovery currently, so we just render nothing for regular users. If we were to throw, React would unmount too.
|
|
540230
|
-
// We do render instead of throwing, so that:
|
|
540231
|
-
// - `componentDidCatch` runs (if we throw here, it does not)
|
|
540232
|
-
// - we can skip logging `Recoverable error during hydration`, because we know it was fatal.
|
|
540233
|
-
'';
|
|
540234
|
-
return (
|
|
540235
|
-
// This has the caveat that we will slightly modify the DOM, but it appears to be fine in this case.
|
|
540236
|
-
// The alternative would be to queue a new task that runs after and then set the innerHTML (= avoids the dummy-div), but that means we'll have DOM -> no DOM -> DOM transitions. With the div, we have DOM -> DOM and remove possible race-conditions.
|
|
540237
|
-
/* @__PURE__ */
|
|
540238
|
-
(0, jsx_runtime_1.jsx)('div', {
|
|
540239
|
-
style: {
|
|
540240
|
-
display: 'contents',
|
|
540241
|
-
},
|
|
540242
|
-
suppressHydrationWarning: true,
|
|
540243
|
-
dangerouslySetInnerHTML: {
|
|
540244
|
-
__html: `<!-- DOM replaced by GracefullyDegradingErrorBoundary due to "${unwrappedError.message.replace(closingHTMLComment, closingHTMLCommentReplacement)}". ${this.messageReport}: --><!-- Stack: ${(_b = error.stack) == null ? void 0 : _b.replace(closingHTMLComment, '--!>')} -->` + dom,
|
|
540245
|
-
},
|
|
540246
|
-
}));
|
|
540247
|
-
}
|
|
540248
|
-
};
|
|
540249
|
-
__publicField(GracefullyDegradingErrorBoundary, 'contextType', LibraryFeaturesContext);
|
|
540250
|
-
function PageRoot({ RootComponent, isWebsite, routeId, framerSiteId, pathVariables, routes, collectionUtils, notFoundPage, isReducedMotion = false, includeDataObserver = false, localeId, locales, preserveQueryParams, EditorBar, LayoutTemplate, }) {
|
|
540265
|
+
function PageRoot({ RootComponent, isWebsite, routeId, framerSiteId, pathVariables, routes, collectionUtils, notFoundPage, isReducedMotion = false, includeDataObserver = false, localeId, locales, preserveQueryParams, EditorBar, defaultPageStyle, disableHistory, LayoutTemplate, }) {
|
|
540251
540266
|
const { enableAsyncURLUpdates, } = useLibraryFeatures();
|
|
540252
540267
|
react_11.default.useEffect(() => {
|
|
540253
540268
|
if (isWebsite)
|
|
@@ -540255,32 +540270,31 @@ function PageRoot({ RootComponent, isWebsite, routeId, framerSiteId, pathVariabl
|
|
|
540255
540270
|
MainLoop.start();
|
|
540256
540271
|
}, []);
|
|
540257
540272
|
if (isWebsite) {
|
|
540258
|
-
return /* @__PURE__ */ (0, jsx_runtime_1.jsx)(
|
|
540259
|
-
|
|
540260
|
-
|
|
540261
|
-
children: /* @__PURE__ */ (0, jsx_runtime_1.jsx)(
|
|
540262
|
-
children: /* @__PURE__ */ (0, jsx_runtime_1.jsx)(
|
|
540263
|
-
|
|
540264
|
-
|
|
540265
|
-
|
|
540266
|
-
|
|
540267
|
-
|
|
540268
|
-
|
|
540269
|
-
|
|
540270
|
-
|
|
540271
|
-
|
|
540272
|
-
|
|
540273
|
-
|
|
540274
|
-
|
|
540275
|
-
|
|
540276
|
-
|
|
540277
|
-
|
|
540278
|
-
|
|
540279
|
-
|
|
540280
|
-
EditorBar,
|
|
540281
|
-
}),
|
|
540282
|
-
LayoutTemplate,
|
|
540273
|
+
return /* @__PURE__ */ (0, jsx_runtime_1.jsx)(MotionConfig, {
|
|
540274
|
+
reducedMotion: isReducedMotion ? 'user' : 'never',
|
|
540275
|
+
children: /* @__PURE__ */ (0, jsx_runtime_1.jsx)(FetchClientProvider, {
|
|
540276
|
+
children: /* @__PURE__ */ (0, jsx_runtime_1.jsx)(CustomCursorHost, {
|
|
540277
|
+
children: /* @__PURE__ */ (0, jsx_runtime_1.jsx)(FormContext.Provider, {
|
|
540278
|
+
value: framerSiteId,
|
|
540279
|
+
children: /* @__PURE__ */ (0, jsx_runtime_1.jsx)(Router, {
|
|
540280
|
+
initialRoute: routeId,
|
|
540281
|
+
initialPathVariables: pathVariables,
|
|
540282
|
+
initialLocaleId: localeId,
|
|
540283
|
+
routes,
|
|
540284
|
+
collectionUtils,
|
|
540285
|
+
notFoundPage,
|
|
540286
|
+
locales,
|
|
540287
|
+
defaultPageStyle: defaultPageStyle ?? {
|
|
540288
|
+
minHeight: '100vh',
|
|
540289
|
+
width: 'auto',
|
|
540290
|
+
},
|
|
540291
|
+
preserveQueryParams,
|
|
540292
|
+
enableAsyncURLUpdates,
|
|
540293
|
+
editorBar: /* @__PURE__ */ (0, jsx_runtime_1.jsx)(EditorBarLauncher, {
|
|
540294
|
+
EditorBar,
|
|
540283
540295
|
}),
|
|
540296
|
+
disableHistory,
|
|
540297
|
+
LayoutTemplate,
|
|
540284
540298
|
}),
|
|
540285
540299
|
}),
|
|
540286
540300
|
}),
|
|
@@ -540508,7 +540522,9 @@ var ResolveLinks = /* @__PURE__ */ withChildrenCanSuspend(/* @__PURE__ */ (0, re
|
|
|
540508
540522
|
const cloneWithPropsAndRef = useCloneChildrenWithPropsAndRef(ref);
|
|
540509
540523
|
const promises = [];
|
|
540510
540524
|
const resolvedLinks = links.map((link) => {
|
|
540511
|
-
|
|
540525
|
+
if (!link)
|
|
540526
|
+
return void 0;
|
|
540527
|
+
return resolveLinkInternal(link.href, router, link.implicitPathVariables, link.refKey, (unresolvedPathSlugs, unresolvedHashSlugs) => {
|
|
540512
540528
|
function handleSlugs(slugs) {
|
|
540513
540529
|
const result = {};
|
|
540514
540530
|
for (const slugKey in slugs) {
|
|
@@ -540531,7 +540547,7 @@ var ResolveLinks = /* @__PURE__ */ withChildrenCanSuspend(/* @__PURE__ */ (0, re
|
|
|
540531
540547
|
}
|
|
540532
540548
|
return {
|
|
540533
540549
|
path: handleSlugs(unresolvedPathSlugs),
|
|
540534
|
-
hash: handleSlugs(
|
|
540550
|
+
hash: handleSlugs(unresolvedHashSlugs),
|
|
540535
540551
|
};
|
|
540536
540552
|
});
|
|
540537
540553
|
});
|
|
@@ -541469,7 +541485,7 @@ var RichText = class {
|
|
|
541469
541485
|
__publicField(this, 'cached');
|
|
541470
541486
|
}
|
|
541471
541487
|
resolve() {
|
|
541472
|
-
this.cached
|
|
541488
|
+
this.cached ??= this.data.resolveRichText(this.pointer);
|
|
541473
541489
|
return this.cached;
|
|
541474
541490
|
}
|
|
541475
541491
|
};
|
|
@@ -541929,7 +541945,7 @@ var RelationalProject = class extends RelationalNode {
|
|
|
541929
541945
|
constructor(input, projections, passthrough) {
|
|
541930
541946
|
let isSynchronous = input.isSynchronous;
|
|
541931
541947
|
for (const projection of projections) {
|
|
541932
|
-
isSynchronous
|
|
541948
|
+
isSynchronous &&= projection.input.isSynchronous;
|
|
541933
541949
|
}
|
|
541934
541950
|
super(isSynchronous);
|
|
541935
541951
|
this.input = input;
|
|
@@ -542061,20 +542077,20 @@ var ScalarCase = class extends ScalarNode {
|
|
|
542061
542077
|
if (input) {
|
|
542062
542078
|
referencedFields.merge(input.referencedFields);
|
|
542063
542079
|
referencedOuterFields.merge(input.referencedOuterFields);
|
|
542064
|
-
isSynchronous
|
|
542080
|
+
isSynchronous &&= input.isSynchronous;
|
|
542065
542081
|
}
|
|
542066
542082
|
for (const { when, then, } of conditions) {
|
|
542067
542083
|
referencedFields.merge(when.referencedFields);
|
|
542068
542084
|
referencedOuterFields.merge(when.referencedOuterFields);
|
|
542069
|
-
isSynchronous
|
|
542085
|
+
isSynchronous &&= when.isSynchronous;
|
|
542070
542086
|
referencedFields.merge(then.referencedFields);
|
|
542071
542087
|
referencedOuterFields.merge(then.referencedOuterFields);
|
|
542072
|
-
isSynchronous
|
|
542088
|
+
isSynchronous &&= then.isSynchronous;
|
|
542073
542089
|
}
|
|
542074
542090
|
if (otherwise) {
|
|
542075
542091
|
referencedFields.merge(otherwise.referencedFields);
|
|
542076
542092
|
referencedOuterFields.merge(otherwise.referencedOuterFields);
|
|
542077
|
-
isSynchronous
|
|
542093
|
+
isSynchronous &&= otherwise.isSynchronous;
|
|
542078
542094
|
}
|
|
542079
542095
|
super(referencedFields, referencedOuterFields, isSynchronous);
|
|
542080
542096
|
this.input = input;
|
|
@@ -543768,7 +543784,7 @@ var Memo = class {
|
|
|
543768
543784
|
this.nodes.set(hash2, node);
|
|
543769
543785
|
const outputFields = node.getOutputFields();
|
|
543770
543786
|
const relational = new RelationalProps(outputFields);
|
|
543771
|
-
group
|
|
543787
|
+
group ??= this.addGroup(relational);
|
|
543772
543788
|
group.addNode(node);
|
|
543773
543789
|
assert(relational.isCompatible(group.relational), 'Group has inconsistent relational props');
|
|
543774
543790
|
return node;
|
|
@@ -545347,15 +545363,36 @@ function useDataRecord(collection, variables) {
|
|
|
545347
545363
|
}, [collection, variables,]);
|
|
545348
545364
|
}
|
|
545349
545365
|
function useDynamicRefs() {
|
|
545350
|
-
const
|
|
545366
|
+
const map2 = useConstant2(() => /* @__PURE__ */ new Map());
|
|
545351
545367
|
return react_11.default.useCallback((key7) => {
|
|
545352
|
-
const existing =
|
|
545368
|
+
const existing = map2.get(key7);
|
|
545353
545369
|
if (existing)
|
|
545354
545370
|
return existing;
|
|
545355
545371
|
const ref = (0, react_14.createRef)();
|
|
545356
|
-
|
|
545372
|
+
map2.set(key7, ref);
|
|
545357
545373
|
return ref;
|
|
545358
|
-
}, [
|
|
545374
|
+
}, []);
|
|
545375
|
+
}
|
|
545376
|
+
var map = /* @__PURE__ */ new Map();
|
|
545377
|
+
function useSiteRefs() {
|
|
545378
|
+
const route = useCurrentRoute();
|
|
545379
|
+
const path = (0, react_6.useMemo)(() => {
|
|
545380
|
+
return getPathForRoute(route, {
|
|
545381
|
+
currentRoutePath: route == null ? void 0 : route.path,
|
|
545382
|
+
currentPathVariables: route == null ? void 0 : route.pathVariables,
|
|
545383
|
+
preserveQueryParams: false,
|
|
545384
|
+
relative: false,
|
|
545385
|
+
});
|
|
545386
|
+
}, [route,]);
|
|
545387
|
+
return react_11.default.useCallback((key7) => {
|
|
545388
|
+
const computedKey = `${path}-${key7}`;
|
|
545389
|
+
const existing = map.get(computedKey);
|
|
545390
|
+
if (existing)
|
|
545391
|
+
return existing;
|
|
545392
|
+
const ref = (0, react_14.createRef)();
|
|
545393
|
+
map.set(computedKey, ref);
|
|
545394
|
+
return ref;
|
|
545395
|
+
}, [path,]);
|
|
545359
545396
|
}
|
|
545360
545397
|
function isFramerGamepadKeydownData(value) {
|
|
545361
545398
|
return isObject(value) && value.mapping !== void 0;
|
|
@@ -545581,16 +545618,16 @@ function useNavigate() {
|
|
|
545581
545618
|
return false;
|
|
545582
545619
|
};
|
|
545583
545620
|
}
|
|
545584
|
-
function callbackForVariant(
|
|
545585
|
-
if (
|
|
545586
|
-
return
|
|
545587
|
-
if (variant in
|
|
545621
|
+
function callbackForVariant(map2, variant) {
|
|
545622
|
+
if (map2[variant])
|
|
545623
|
+
return map2[variant];
|
|
545624
|
+
if (variant in map2)
|
|
545588
545625
|
return void 0;
|
|
545589
|
-
return
|
|
545626
|
+
return map2.default;
|
|
545590
545627
|
}
|
|
545591
545628
|
function useOnVariantChange(variant, callbackMap) {
|
|
545592
|
-
const
|
|
545593
|
-
if (
|
|
545629
|
+
const isRenderingStaticContent = useIsStaticRenderer();
|
|
545630
|
+
if (isRenderingStaticContent)
|
|
545594
545631
|
return;
|
|
545595
545632
|
const isActiveScreenRef = react_11.default.useRef(true);
|
|
545596
545633
|
const callbackMapRef = react_11.default.useRef(callbackMap);
|
|
@@ -545992,12 +546029,55 @@ function safeBaseVariant(targetVariant, fallbackVariant, validBaseVariants) {
|
|
|
545992
546029
|
}
|
|
545993
546030
|
var CycleVariantState = /* @__PURE__ */ Symbol('cycle');
|
|
545994
546031
|
exports.CycleVariantState = CycleVariantState;
|
|
546032
|
+
function useRunCallbackIfPageIsVisible() {
|
|
546033
|
+
const listenerRef = (0, react_5.useRef)();
|
|
546034
|
+
const callbackRef = (0, react_5.useRef)();
|
|
546035
|
+
const clean = (0, react_2.useCallback)(() => {
|
|
546036
|
+
if (!listenerRef.current)
|
|
546037
|
+
return;
|
|
546038
|
+
document.removeEventListener('visibilitychange', listenerRef.current);
|
|
546039
|
+
listenerRef.current = void 0;
|
|
546040
|
+
callbackRef.current = void 0;
|
|
546041
|
+
}, []);
|
|
546042
|
+
(0, react_2.useEffect)(() => {
|
|
546043
|
+
return () => {
|
|
546044
|
+
clean();
|
|
546045
|
+
};
|
|
546046
|
+
}, [clean,]);
|
|
546047
|
+
return (0, react_2.useCallback)((callback) => {
|
|
546048
|
+
if (!document.hidden) {
|
|
546049
|
+
callback();
|
|
546050
|
+
clean();
|
|
546051
|
+
return;
|
|
546052
|
+
}
|
|
546053
|
+
callbackRef.current = callback;
|
|
546054
|
+
if (listenerRef.current)
|
|
546055
|
+
return;
|
|
546056
|
+
const listenerFn = () => {
|
|
546057
|
+
var _a;
|
|
546058
|
+
if (document.hidden)
|
|
546059
|
+
return;
|
|
546060
|
+
(_a = callbackRef.current) == null ? void 0 : _a.call(callbackRef);
|
|
546061
|
+
clean();
|
|
546062
|
+
};
|
|
546063
|
+
listenerRef.current = listenerFn;
|
|
546064
|
+
document.addEventListener('visibilitychange', listenerFn);
|
|
546065
|
+
}, [clean,]);
|
|
546066
|
+
}
|
|
545995
546067
|
function useVariantState({ variant, defaultVariant: externalDefaultVariant, transitions: externalTransitions, enabledGestures: externalEnabledGestures, cycleOrder: externalCycleOrder = [], variantProps: variantProps2 = {}, variantClassNames = {}, }) {
|
|
545996
546068
|
const forceUpdate = useForceUpdate2();
|
|
545997
546069
|
const isCanvas = useIsOnFramerCanvas();
|
|
545998
546070
|
const validBaseVariants = useConstant2(() => new Set(externalCycleOrder));
|
|
545999
546071
|
const { wrapUpdatesInTransitions, } = useLibraryFeatures();
|
|
546000
|
-
const
|
|
546072
|
+
const update = (0, react_2.useCallback)((useTransition) => {
|
|
546073
|
+
if (useTransition) {
|
|
546074
|
+
(0, react_13.startTransition)(() => void forceUpdate());
|
|
546075
|
+
return;
|
|
546076
|
+
}
|
|
546077
|
+
forceUpdate();
|
|
546078
|
+
}, [forceUpdate,]);
|
|
546079
|
+
const runUpdateIfPageIsVisible = useRunCallbackIfPageIsVisible();
|
|
546080
|
+
const internalState = (0, react_5.useRef)({
|
|
546001
546081
|
isHovered: false,
|
|
546002
546082
|
isPressed: false,
|
|
546003
546083
|
isError: false,
|
|
@@ -546014,14 +546094,24 @@ function useVariantState({ variant, defaultVariant: externalDefaultVariant, tran
|
|
|
546014
546094
|
cycleOrder: externalCycleOrder,
|
|
546015
546095
|
transitions: externalTransitions,
|
|
546016
546096
|
});
|
|
546017
|
-
const resolveNextVariant =
|
|
546097
|
+
const resolveNextVariant = (0, react_2.useCallback)((targetBaseVariant) => {
|
|
546018
546098
|
const { isHovered: isHovered2, isPressed: isPressed2, isError: isError2, enabledGestures: enabledGestures2, defaultVariant: defaultVariant2, } = internalState.current;
|
|
546019
546099
|
const nextBaseVariant = safeBaseVariant(targetBaseVariant, defaultVariant2, validBaseVariants);
|
|
546020
546100
|
const gesture = getGesture(enabledGestures2 == null ? void 0 : enabledGestures2[nextBaseVariant], isHovered2, isPressed2, false, isError2);
|
|
546021
546101
|
const nextGestureVariant = gesture ? createGestureVariant(nextBaseVariant, gesture) : void 0;
|
|
546022
546102
|
return [nextBaseVariant, nextGestureVariant,];
|
|
546023
|
-
}, [
|
|
546024
|
-
const
|
|
546103
|
+
}, []);
|
|
546104
|
+
const updateIfNeeded = (0, react_2.useCallback)((baseVariant2, gestureVariant2, defaultVariant2, nextBaseVariant, isError2 = false, clearError = false) => {
|
|
546105
|
+
const [nextBase, nextGesture,] = resolveNextVariant(nextBaseVariant);
|
|
546106
|
+
if (nextBase === baseVariant2 && nextGesture === gestureVariant2)
|
|
546107
|
+
return;
|
|
546108
|
+
if (clearError)
|
|
546109
|
+
internalState.current.isError = false;
|
|
546110
|
+
internalState.current.baseVariant = nextBase || defaultVariant2;
|
|
546111
|
+
internalState.current.gestureVariant = nextGesture;
|
|
546112
|
+
runUpdateIfPageIsVisible(() => update(wrapUpdatesInTransitions || isError2));
|
|
546113
|
+
}, [resolveNextVariant, runUpdateIfPageIsVisible, wrapUpdatesInTransitions, update,]);
|
|
546114
|
+
const setGestureState = (0, react_2.useCallback)(({ isHovered: isHovered2, isPressed: isPressed2, isError: isError2, }) => {
|
|
546025
546115
|
if (isHovered2 !== void 0)
|
|
546026
546116
|
internalState.current.isHovered = isHovered2;
|
|
546027
546117
|
if (isPressed2 !== void 0)
|
|
@@ -546029,47 +546119,20 @@ function useVariantState({ variant, defaultVariant: externalDefaultVariant, tran
|
|
|
546029
546119
|
if (isError2 !== void 0)
|
|
546030
546120
|
internalState.current.isError = isError2;
|
|
546031
546121
|
const { baseVariant: baseVariant2, gestureVariant: gestureVariant2, defaultVariant: defaultVariant2, } = internalState.current;
|
|
546032
|
-
|
|
546033
|
-
|
|
546034
|
-
|
|
546035
|
-
internalState.current.gestureVariant = nextGesture;
|
|
546036
|
-
if (isError2 || wrapUpdatesInTransitions) {
|
|
546037
|
-
react_11.default.startTransition(() => {
|
|
546038
|
-
forceUpdate();
|
|
546039
|
-
});
|
|
546040
|
-
}
|
|
546041
|
-
else {
|
|
546042
|
-
forceUpdate();
|
|
546043
|
-
}
|
|
546044
|
-
}
|
|
546045
|
-
}, [resolveNextVariant, forceUpdate, wrapUpdatesInTransitions,]);
|
|
546046
|
-
const setVariant = react_11.default.useCallback((proposedVariant) => {
|
|
546122
|
+
updateIfNeeded(baseVariant2, gestureVariant2, defaultVariant2, baseVariant2, isError2);
|
|
546123
|
+
}, [updateIfNeeded,]);
|
|
546124
|
+
const setVariant = (0, react_2.useCallback)((proposedVariant) => {
|
|
546047
546125
|
const { defaultVariant: defaultVariant2, cycleOrder, baseVariant: baseVariant2, gestureVariant: gestureVariant2, } = internalState.current;
|
|
546048
546126
|
const nextBaseVariant = proposedVariant === CycleVariantState
|
|
546049
546127
|
? nextVariant(cycleOrder || [], baseVariant2 || defaultVariant2)
|
|
546050
546128
|
: proposedVariant;
|
|
546051
|
-
|
|
546052
|
-
|
|
546053
|
-
|
|
546054
|
-
internalState.current.baseVariant = nextBase || defaultVariant2;
|
|
546055
|
-
internalState.current.gestureVariant = nextGesture;
|
|
546056
|
-
if (wrapUpdatesInTransitions) {
|
|
546057
|
-
react_11.default.startTransition(() => {
|
|
546058
|
-
forceUpdate();
|
|
546059
|
-
});
|
|
546060
|
-
}
|
|
546061
|
-
else {
|
|
546062
|
-
forceUpdate();
|
|
546063
|
-
}
|
|
546064
|
-
}
|
|
546065
|
-
}, [resolveNextVariant, wrapUpdatesInTransitions, forceUpdate,]);
|
|
546066
|
-
const clearLoadingGesture = react_11.default.useCallback(() => {
|
|
546129
|
+
updateIfNeeded(baseVariant2, gestureVariant2, defaultVariant2, nextBaseVariant, false, true);
|
|
546130
|
+
}, [updateIfNeeded,]);
|
|
546131
|
+
const clearLoadingGesture = (0, react_2.useCallback)(() => {
|
|
546067
546132
|
const { baseVariant: baseVariant2, } = internalState.current;
|
|
546068
546133
|
internalState.current.loadedBaseVariant[baseVariant2] = true;
|
|
546069
|
-
|
|
546070
|
-
|
|
546071
|
-
});
|
|
546072
|
-
}, [forceUpdate,]);
|
|
546134
|
+
runUpdateIfPageIsVisible(() => update(true));
|
|
546135
|
+
}, [runUpdateIfPageIsVisible, update,]);
|
|
546073
546136
|
if (variant !== internalState.current.lastVariant) {
|
|
546074
546137
|
const [nextBase, nextGesture,] = resolveNextVariant(variant);
|
|
546075
546138
|
internalState.current.lastVariant = nextBase;
|
|
@@ -546080,7 +546143,7 @@ function useVariantState({ variant, defaultVariant: externalDefaultVariant, tran
|
|
|
546080
546143
|
}
|
|
546081
546144
|
const { baseVariant, gestureVariant, defaultVariant, enabledGestures, isHovered, isPressed, isError, loadedBaseVariant, } = internalState.current;
|
|
546082
546145
|
const addVariantProps = useAddVariantProps(internalState.current.baseVariant, internalState.current.gestureVariant, variantProps2);
|
|
546083
|
-
return
|
|
546146
|
+
return (0, react_6.useMemo)(() => {
|
|
546084
546147
|
var _a;
|
|
546085
546148
|
const variants = [];
|
|
546086
546149
|
if (baseVariant !== defaultVariant)
|
|
@@ -546140,6 +546203,14 @@ function useVariantState({ variant, defaultVariant: externalDefaultVariant, tran
|
|
|
546140
546203
|
variantClassNames,
|
|
546141
546204
|
]);
|
|
546142
546205
|
}
|
|
546206
|
+
var reUnsafeCharacters = /[}{<>&;]/u;
|
|
546207
|
+
function safeCSSValue(value) {
|
|
546208
|
+
if (!isString(value))
|
|
546209
|
+
return 'none';
|
|
546210
|
+
if (reUnsafeCharacters.test(value))
|
|
546211
|
+
return 'none';
|
|
546212
|
+
return value;
|
|
546213
|
+
}
|
|
546143
546214
|
function withCodeBoundaryForOverrides(Component18, { scopeId, nodeId, override, inComponentSlot, }) {
|
|
546144
546215
|
if (!shouldEnableCodeBoundaries()) {
|
|
546145
546216
|
return override(Component18);
|
|
@@ -548241,13 +548312,6 @@ var FontStore = class {
|
|
|
548241
548312
|
};
|
|
548242
548313
|
var fontStore = /* @__PURE__ */ new FontStore();
|
|
548243
548314
|
exports.fontStore = fontStore;
|
|
548244
|
-
Promise.allSettled = Promise.allSettled || ((promises) => Promise.all(promises.map((p) => p.then((v) => ({
|
|
548245
|
-
status: 'fulfilled',
|
|
548246
|
-
value: v,
|
|
548247
|
-
})).catch((e) => ({
|
|
548248
|
-
status: 'rejected',
|
|
548249
|
-
reason: e,
|
|
548250
|
-
})))));
|
|
548251
548315
|
function CustomProperties({ children, customProperties, }) {
|
|
548252
548316
|
return /* @__PURE__ */ (0, jsx_runtime_1.jsx)('div', {
|
|
548253
548317
|
style: customProperties,
|
|
@@ -549572,10 +549636,8 @@ function getInitialEffectStyle(canPlay, canAnimate2, effect) {
|
|
|
549572
549636
|
}
|
|
549573
549637
|
function useTextEffect(config, ref, preview) {
|
|
549574
549638
|
const elements = useConstant2(() => /* @__PURE__ */ new Set());
|
|
549575
|
-
const
|
|
549576
|
-
const
|
|
549577
|
-
const isOnCanvasOrExport = isOnCanvas || isOnExport;
|
|
549578
|
-
const canPlay = preview || !isOnCanvasOrExport;
|
|
549639
|
+
const isRenderingStaticContent = useIsStaticRenderer();
|
|
549640
|
+
const canPlay = preview || !isRenderingStaticContent;
|
|
549579
549641
|
const state2 = React2.useRef({
|
|
549580
549642
|
hasMounted: false,
|
|
549581
549643
|
hasAnimatedOnce: false,
|
|
@@ -549823,7 +549885,10 @@ function createLineGroups(elements) {
|
|
|
549823
549885
|
return groups2;
|
|
549824
549886
|
}
|
|
549825
549887
|
var FitText = /* @__PURE__ */ (0, react_4.forwardRef)(({ viewBoxScale, viewBox, children, ...props }, ref) => {
|
|
549826
|
-
return
|
|
549888
|
+
return (
|
|
549889
|
+
// biome-ignore lint/a11y/noSvgWithoutTitle: FIXME: FitText might be inaccessible to screen readers because it’s wrapped in an svg
|
|
549890
|
+
/* @__PURE__ */
|
|
549891
|
+
(0, jsx_runtime_1.jsx)(motion.svg, {
|
|
549827
549892
|
ref,
|
|
549828
549893
|
...props,
|
|
549829
549894
|
viewBox,
|
|
@@ -549838,7 +549903,7 @@ var FitText = /* @__PURE__ */ (0, react_4.forwardRef)(({ viewBoxScale, viewBox,
|
|
|
549838
549903
|
},
|
|
549839
549904
|
children,
|
|
549840
549905
|
}),
|
|
549841
|
-
});
|
|
549906
|
+
}));
|
|
549842
549907
|
});
|
|
549843
549908
|
var RichTextContainer = /* @__PURE__ */ (0, react_4.forwardRef)((props, ref) => {
|
|
549844
549909
|
const { __fromCanvasComponent = false, _forwardedOverrideId, _forwardedOverrides, _usesDOMRect, anchorLinkOffsetY, as: _as, bottom, center, children, environment: environment2 = RenderTarget.current, fonts = [], height, isEditable = false, left, name, opacity, positionSticky, positionStickyBottom, positionStickyLeft, positionStickyRight, positionStickyTop, right, rotation = 0, style, _initialStyle, stylesPresetsClassNames, text: plainText, top, verticalAlignment = 'top', visible = true, width, willChangeTransform, withExternalLayout = false, viewBox, viewBoxScale = 1, effect, ...rest } = props;
|
|
@@ -549926,7 +549991,7 @@ var RichTextContainer = /* @__PURE__ */ (0, react_4.forwardRef)((props, ref) =>
|
|
|
549926
549991
|
style: containerStyle,
|
|
549927
549992
|
layoutId,
|
|
549928
549993
|
transformTemplate: template,
|
|
549929
|
-
'data-framer-name': name,
|
|
549994
|
+
'data-framer-name': rest['data-framer-name'] ?? name,
|
|
549930
549995
|
'data-framer-component-type': 'RichTextContainer',
|
|
549931
549996
|
children: /* @__PURE__ */ (0, jsx_runtime_1.jsx)(FitText, {
|
|
549932
549997
|
viewBox,
|
|
@@ -549948,7 +550013,7 @@ var RichTextContainer = /* @__PURE__ */ (0, react_4.forwardRef)((props, ref) =>
|
|
|
549948
550013
|
viewBox,
|
|
549949
550014
|
viewBoxScale,
|
|
549950
550015
|
transformTemplate: template,
|
|
549951
|
-
'data-framer-name': name,
|
|
550016
|
+
'data-framer-name': rest['data-framer-name'] ?? name,
|
|
549952
550017
|
'data-framer-component-type': 'RichTextContainer',
|
|
549953
550018
|
children: processedChildren,
|
|
549954
550019
|
});
|
|
@@ -549960,7 +550025,7 @@ var RichTextContainer = /* @__PURE__ */ (0, react_4.forwardRef)((props, ref) =>
|
|
|
549960
550025
|
style: containerStyle,
|
|
549961
550026
|
layoutId,
|
|
549962
550027
|
transformTemplate: template,
|
|
549963
|
-
'data-framer-name': name,
|
|
550028
|
+
'data-framer-name': rest['data-framer-name'] ?? name,
|
|
549964
550029
|
'data-framer-component-type': 'RichTextContainer',
|
|
549965
550030
|
children: processedChildren,
|
|
549966
550031
|
});
|
|
@@ -550195,7 +550260,7 @@ function imagePatternPropsForFill(fill, frame2, id3, includeTransform) {
|
|
|
550195
550260
|
const validScaleX = realWidth / frame2.width;
|
|
550196
550261
|
const validScaleY = realHeight / frame2.height;
|
|
550197
550262
|
if (fit === 'tile') {
|
|
550198
|
-
fill.backgroundSize
|
|
550263
|
+
fill.backgroundSize ??= 1;
|
|
550199
550264
|
width = Math.round(fill.backgroundSize * (imageWidth / 2));
|
|
550200
550265
|
height = Math.round(fill.backgroundSize * (imageHeight / 2));
|
|
550201
550266
|
const layerPositionX = frame2.x ?? 0;
|
|
@@ -550372,7 +550437,7 @@ var supportsNativeParseHTML = /* @__PURE__ */ (() =>
|
|
|
550372
550437
|
function domParser(html, type) {
|
|
550373
550438
|
if (supportsNativeParseHTML && !type)
|
|
550374
550439
|
return Document.parseHTMLUnsafe(html);
|
|
550375
|
-
parser
|
|
550440
|
+
parser ??= new DOMParser();
|
|
550376
550441
|
return parser.parseFromString(html, type ?? 'text/html');
|
|
550377
550442
|
}
|
|
550378
550443
|
var useDOM = /* @__PURE__ */ isBrowser2();
|
|
@@ -551062,7 +551127,7 @@ var TextComponent = /* @__PURE__ */ (() => {
|
|
|
551062
551127
|
}
|
|
551063
551128
|
const dataProps = {
|
|
551064
551129
|
'data-framer-component-type': 'Text',
|
|
551065
|
-
'data-framer-name': name,
|
|
551130
|
+
'data-framer-name': rest['data-framer-name'] ?? name,
|
|
551066
551131
|
};
|
|
551067
551132
|
if (autoSize) {
|
|
551068
551133
|
asRecord(dataProps)['data-framer-component-text-autosized'] = 'true';
|