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/src/framer.js CHANGED
@@ -517370,7 +517370,7 @@ function steps(numSteps, direction = 'end',) {
517370
517370
  };
517371
517371
  }
517372
517372
 
517373
- // /:https://app.framerstatic.com/framer.5IYC6IGH.mjs
517373
+ // /:https://app.framerstatic.com/framer.43KQGWBL.mjs
517374
517374
  init_chunk_QLPHEVXG();
517375
517375
  import React4 from 'react';
517376
517376
  import { Suspense as Suspense3, } from 'react';
@@ -520160,7 +520160,10 @@ function getPathForRoute(route, {
520160
520160
  hashVariables,
520161
520161
  relative: relative2 = true,
520162
520162
  preserveQueryParams,
520163
+ onlyHash = false,
520163
520164
  },) {
520165
+ const resolvedHash = getHashForRoute(hash2, route, hashVariables,);
520166
+ if (onlyHash) return resolvedHash ?? '';
520164
520167
  let currentPath = currentRoutePath ?? '/';
520165
520168
  if (currentPathVariables) {
520166
520169
  currentPath = currentPath.replace(pathVariablesRegExp, (m2, p1,) => String(currentPathVariables[p1] || m2,),);
@@ -520170,7 +520173,6 @@ function getPathForRoute(route, {
520170
520173
  if (pathVariables) {
520171
520174
  path = path.replace(pathVariablesRegExp, (m2, p1,) => String(pathVariables[p1] || m2,),);
520172
520175
  }
520173
- const resolvedHash = getHashForRoute(hash2, route, hashVariables,);
520174
520176
  const isSamePageHashNavigation = currentPath === path && resolvedHash;
520175
520177
  if (relative2) {
520176
520178
  path = computeRelativePath(currentPath, path,);
@@ -520933,6 +520935,9 @@ function Point(x, y,) {
520933
520935
  };
520934
520936
  }
520935
520937
  ((Point2) => {
520938
+ Point2.isQuadrilateralPoints = (points) => {
520939
+ return (points == null ? void 0 : points.length) === 4;
520940
+ };
520936
520941
  Point2.add = (...args) => {
520937
520942
  return args.reduce((previousValue, currentValue,) => {
520938
520943
  return {
@@ -521043,9 +521048,10 @@ function Point(x, y,) {
521043
521048
  const angles = /* @__PURE__ */ new Map();
521044
521049
  for (let i = 0; i < points.length; i++) {
521045
521050
  const point2 = points[i];
521046
- angles.set(point2, Math.atan2(point2.x - centerPoint.x, point2.y - centerPoint.y,),);
521051
+ if (!point2) continue;
521052
+ angles.set(point2, Math.atan2(point2.y - centerPoint.y, point2.x - centerPoint.x,),);
521047
521053
  }
521048
- return points.sort((a, b,) => angles.get(a,) - angles.get(b,));
521054
+ return points.sort((a, b,) => (angles.get(a,) ?? 0) - (angles.get(b,) ?? 0));
521049
521055
  }
521050
521056
  Point2.sortClockwise = sortClockwise;
521051
521057
  })(Point || (Point = {}),);
@@ -527771,9 +527777,9 @@ var deviceCodeComponentPresetIds = [
527771
527777
  '1440p',
527772
527778
  '4k',
527773
527779
  ];
527774
- var devicePresetsMap = /* @__PURE__ */ devicePresets.reduce((map, preset,) => {
527775
- map[preset.id] = preset;
527776
- return map;
527780
+ var devicePresetsMap = /* @__PURE__ */ devicePresets.reduce((map2, preset,) => {
527781
+ map2[preset.id] = preset;
527782
+ return map2;
527777
527783
  }, {},);
527778
527784
  function getDevicePreset(presetId,) {
527779
527785
  return devicePresetsMap[presetId] ?? devicePresetsMap[defaultPresetId];
@@ -536821,6 +536827,10 @@ function useFXValues(values, enabled,) {
536821
536827
  }, [effect, enabled,],);
536822
536828
  return effect;
536823
536829
  }
536830
+ function useIsStaticRenderer() {
536831
+ const currentTarget = RenderTarget.current();
536832
+ return currentTarget === RenderTarget.canvas || currentTarget === RenderTarget.export;
536833
+ }
536824
536834
  var loopOptionsKeys = /* @__PURE__ */ new Set(['loopEffectEnabled', 'loopTransition', 'loop', 'loopRepeatType', 'loopRepeatDelay',],);
536825
536835
  var useDelay = () => {
536826
536836
  const timeoutRef = useRef();
@@ -537594,8 +537604,8 @@ var withFX = (Component18) =>
537594
537604
  ref: forwardedRef,
537595
537605
  },);
537596
537606
  }
537597
- const currentTarget = RenderTarget.current();
537598
- if (currentTarget === RenderTarget.canvas || currentTarget === RenderTarget.export) {
537607
+ const isRenderingStaticContent = useIsStaticRenderer();
537608
+ if (isRenderingStaticContent) {
537599
537609
  const animate4 = isVariantOrVariantList(props.animate,) ? props.animate : void 0;
537600
537610
  const initial2 = isVariantOrVariantList(props.initial,) ? props.initial : void 0;
537601
537611
  return /* @__PURE__ */ jsx(Component18, {
@@ -538578,7 +538588,7 @@ var Polygon = {
538578
538588
  const d = (point2.x - x1) * (y2 - y1) - (point2.y - y1) * (x2 - x1);
538579
538589
  if (d === 0) continue;
538580
538590
  const localSign = d > 0;
538581
- sign ?? (sign = localSign);
538591
+ sign ??= localSign;
538582
538592
  if (sign !== localSign) return false;
538583
538593
  }
538584
538594
  return true;
@@ -539156,6 +539166,81 @@ function Floating({
539156
539166
  );
539157
539167
  }
539158
539168
  var GeneratedComponentContext = /* @__PURE__ */ React4.createContext(void 0,);
539169
+ var LibraryFeaturesContext = /* @__PURE__ */ React4.createContext(void 0,);
539170
+ var LibraryFeaturesProvider = /* @__PURE__ */ (() => LibraryFeaturesContext.Provider)();
539171
+ var useLibraryFeatures = () => {
539172
+ const context = React4.useContext(LibraryFeaturesContext,);
539173
+ return context ?? {};
539174
+ };
539175
+ var GracefullyDegradingErrorBoundary = class extends Component {
539176
+ constructor() {
539177
+ super(...arguments,);
539178
+ __publicField(this, 'state', {
539179
+ error: void 0,
539180
+ },);
539181
+ __publicField(this, 'message', 'Made UI non-interactive due to an error',);
539182
+ __publicField(
539183
+ this,
539184
+ 'messageReport',
539185
+ 'If you are the author of this website, please report this issue to the Framer team via https://www.framer.community/',
539186
+ );
539187
+ }
539188
+ static getDerivedStateFromError(error,) {
539189
+ return {
539190
+ error,
539191
+ };
539192
+ }
539193
+ componentDidCatch(error,) {
539194
+ var _a, _b;
539195
+ window.__framer_hadFatalError = true;
539196
+ if ('cause' in error) {
539197
+ error = error.cause;
539198
+ }
539199
+ console.error(`${this.message} (see above). ${this.messageReport}.`,);
539200
+ const sampleRate = Math.random();
539201
+ if (!((_a = this.context) == null ? void 0 : _a.codeBoundaries) && sampleRate > 0.01) return;
539202
+ if (sampleRate > 0.25) return;
539203
+ const stack = error instanceof Error && typeof error.stack === 'string' ? error.stack : null;
539204
+ (_b = window.__framer_events) == null ? void 0 : _b.push(['published_site_load_error', {
539205
+ message: String(error,),
539206
+ stack,
539207
+ },],);
539208
+ }
539209
+ render() {
539210
+ var _a, _b;
539211
+ const error = this.state.error;
539212
+ if (!error) return this.props.children;
539213
+ const unwrappedError = 'cause' in error ? error.cause : error;
539214
+ const closingHTMLComment = /-->/gu;
539215
+ const closingHTMLCommentReplacement = '--!>';
539216
+ const dom = isBot(navigator.userAgent,) ? ((_a = document.getElementById('main',)) == null ? void 0 : _a.innerHTML) || '' : // @FIXME: We should have a UI for fatal error recovery.
539217
+ // 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.
539218
+ // We do render instead of throwing, so that:
539219
+ // - `componentDidCatch` runs (if we throw here, it does not)
539220
+ // - we can skip logging `Recoverable error during hydration`, because we know it was fatal.
539221
+ '';
539222
+ return (
539223
+ // This has the caveat that we will slightly modify the DOM, but it appears to be fine in this case.
539224
+ // 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.
539225
+ /* @__PURE__ */
539226
+ jsx('div', {
539227
+ style: {
539228
+ display: 'contents',
539229
+ },
539230
+ suppressHydrationWarning: true,
539231
+ dangerouslySetInnerHTML: {
539232
+ __html:
539233
+ `<!-- DOM replaced by GracefullyDegradingErrorBoundary due to "${
539234
+ unwrappedError.message.replace(closingHTMLComment, closingHTMLCommentReplacement,)
539235
+ }". ${this.messageReport}: --><!-- Stack: ${
539236
+ (_b = error.stack) == null ? void 0 : _b.replace(closingHTMLComment, '--!>',)
539237
+ } -->` + dom,
539238
+ },
539239
+ },)
539240
+ );
539241
+ }
539242
+ };
539243
+ __publicField(GracefullyDegradingErrorBoundary, 'contextType', LibraryFeaturesContext,);
539159
539244
  var LazyValue = class {
539160
539245
  constructor(resolver,) {
539161
539246
  this.resolver = resolver;
@@ -539209,12 +539294,6 @@ var LazyValue = class {
539209
539294
  }
539210
539295
  }
539211
539296
  };
539212
- var LibraryFeaturesContext = /* @__PURE__ */ React4.createContext(void 0,);
539213
- var LibraryFeaturesProvider = /* @__PURE__ */ (() => LibraryFeaturesContext.Provider)();
539214
- var useLibraryFeatures = () => {
539215
- const context = React4.useContext(LibraryFeaturesContext,);
539216
- return context ?? {};
539217
- };
539218
539297
  function findAnchorElement(target, withinElement,) {
539219
539298
  if (target instanceof HTMLAnchorElement) {
539220
539299
  return target;
@@ -539949,13 +540028,13 @@ function useReplaceNestedLinks(nodeId, href, propsAddedByLink,) {
539949
540028
  const refCallback = useCallback((node) => {
539950
540029
  if (isOnFramerCanvas || !shouldReplaceLink || !isValidLink) return;
539951
540030
  node.dataset.hydrated = 'true';
539952
- }, [isOnFramerCanvas, isValidLink, shouldReplaceLink,],);
540031
+ }, [isValidLink, shouldReplaceLink,],);
539953
540032
  return [getChildren, refCallback,];
539954
540033
  }
539955
540034
  function resolveLink(href, router, implicitPathVariables,) {
539956
540035
  return resolveLinkInternal(href, router, implicitPathVariables,);
539957
540036
  }
539958
- function resolveLinkInternal(href, router, implicitPathVariables, resolveSlugs2,) {
540037
+ function resolveLinkInternal(href, router, implicitPathVariables, onlyHash, resolveSlugs2,) {
539959
540038
  const pageLink = isLinkToWebPage(href,) ? href : linkFromFramerPageLink(href,);
539960
540039
  if (!isLinkToWebPage(pageLink,)) return isString(href,) ? propsForLink(href,).href : void 0;
539961
540040
  if (!router.getRoute || !router.currentRouteId) return void 0;
@@ -539994,6 +540073,7 @@ function resolveLinkInternal(href, router, implicitPathVariables, resolveSlugs2,
539994
540073
  hashVariables: combinedHashVariables,
539995
540074
  relative: false,
539996
540075
  preserveQueryParams: router.preserveQueryParams,
540076
+ onlyHash,
539997
540077
  },);
539998
540078
  }
539999
540079
  function resolvePageScope(pageLink, router,) {
@@ -541167,75 +541247,6 @@ function usePrefetch() {
541167
541247
  }
541168
541248
  return React2.useCallback((request) => fetchClient.prefetch(request,), [fetchClient,],);
541169
541249
  }
541170
- var GracefullyDegradingErrorBoundary = class extends Component {
541171
- constructor() {
541172
- super(...arguments,);
541173
- __publicField(this, 'state', {
541174
- error: void 0,
541175
- },);
541176
- __publicField(this, 'message', 'Made UI non-interactive due to an error',);
541177
- __publicField(
541178
- this,
541179
- 'messageReport',
541180
- 'If you are the author of this website, please report this issue to the Framer team via https://www.framer.community/',
541181
- );
541182
- }
541183
- static getDerivedStateFromError(error,) {
541184
- return {
541185
- error,
541186
- };
541187
- }
541188
- componentDidCatch(error,) {
541189
- var _a, _b;
541190
- window.__framer_hadFatalError = true;
541191
- if ('cause' in error) {
541192
- error = error.cause;
541193
- }
541194
- console.error(`${this.message} (see above). ${this.messageReport}.`,);
541195
- const sampleRate = Math.random();
541196
- if (!((_a = this.context) == null ? void 0 : _a.codeBoundaries) && sampleRate > 0.01) return;
541197
- if (sampleRate > 0.25) return;
541198
- const stack = error instanceof Error && typeof error.stack === 'string' ? error.stack : null;
541199
- (_b = window.__framer_events) == null ? void 0 : _b.push(['published_site_load_error', {
541200
- message: String(error,),
541201
- stack,
541202
- },],);
541203
- }
541204
- render() {
541205
- var _a, _b;
541206
- const error = this.state.error;
541207
- if (!error) return this.props.children;
541208
- const unwrappedError = 'cause' in error ? error.cause : error;
541209
- const closingHTMLComment = /-->/gu;
541210
- const closingHTMLCommentReplacement = '--!>';
541211
- const dom = isBot(navigator.userAgent,) ? ((_a = document.getElementById('main',)) == null ? void 0 : _a.innerHTML) || '' : // @FIXME: We should have a UI for fatal error recovery.
541212
- // 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.
541213
- // We do render instead of throwing, so that:
541214
- // - `componentDidCatch` runs (if we throw here, it does not)
541215
- // - we can skip logging `Recoverable error during hydration`, because we know it was fatal.
541216
- '';
541217
- return (
541218
- // This has the caveat that we will slightly modify the DOM, but it appears to be fine in this case.
541219
- // 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.
541220
- /* @__PURE__ */
541221
- jsx('div', {
541222
- style: {
541223
- display: 'contents',
541224
- },
541225
- suppressHydrationWarning: true,
541226
- dangerouslySetInnerHTML: {
541227
- __html:
541228
- `<!-- DOM replaced by GracefullyDegradingErrorBoundary due to "${
541229
- unwrappedError.message.replace(closingHTMLComment, closingHTMLCommentReplacement,)
541230
- }". ${this.messageReport}: --><!-- Stack: ${
541231
- (_b = error.stack) == null ? void 0 : _b.replace(closingHTMLComment, '--!>',)
541232
- } -->` + dom,
541233
- },
541234
- },)
541235
- );
541236
- }
541237
- };
541238
- __publicField(GracefullyDegradingErrorBoundary, 'contextType', LibraryFeaturesContext,);
541239
541250
  function PageRoot({
541240
541251
  RootComponent,
541241
541252
  isWebsite,
@@ -541251,6 +541262,8 @@ function PageRoot({
541251
541262
  locales,
541252
541263
  preserveQueryParams,
541253
541264
  EditorBar,
541265
+ defaultPageStyle,
541266
+ disableHistory,
541254
541267
  LayoutTemplate,
541255
541268
  },) {
541256
541269
  const {
@@ -541261,32 +541274,31 @@ function PageRoot({
541261
541274
  MainLoop.start();
541262
541275
  }, [],);
541263
541276
  if (isWebsite) {
541264
- return /* @__PURE__ */ jsx(GracefullyDegradingErrorBoundary, {
541265
- children: /* @__PURE__ */ jsx(MotionConfig, {
541266
- reducedMotion: isReducedMotion ? 'user' : 'never',
541267
- children: /* @__PURE__ */ jsx(FetchClientProvider, {
541268
- children: /* @__PURE__ */ jsx(CustomCursorHost, {
541269
- children: /* @__PURE__ */ jsx(FormContext.Provider, {
541270
- value: framerSiteId,
541271
- children: /* @__PURE__ */ jsx(Router, {
541272
- initialRoute: routeId,
541273
- initialPathVariables: pathVariables,
541274
- initialLocaleId: localeId,
541275
- routes,
541276
- collectionUtils,
541277
- notFoundPage,
541278
- locales,
541279
- defaultPageStyle: {
541280
- minHeight: '100vh',
541281
- width: 'auto',
541282
- },
541283
- preserveQueryParams,
541284
- enableAsyncURLUpdates,
541285
- editorBar: /* @__PURE__ */ jsx(EditorBarLauncher, {
541286
- EditorBar,
541287
- },),
541288
- LayoutTemplate,
541277
+ return /* @__PURE__ */ jsx(MotionConfig, {
541278
+ reducedMotion: isReducedMotion ? 'user' : 'never',
541279
+ children: /* @__PURE__ */ jsx(FetchClientProvider, {
541280
+ children: /* @__PURE__ */ jsx(CustomCursorHost, {
541281
+ children: /* @__PURE__ */ jsx(FormContext.Provider, {
541282
+ value: framerSiteId,
541283
+ children: /* @__PURE__ */ jsx(Router, {
541284
+ initialRoute: routeId,
541285
+ initialPathVariables: pathVariables,
541286
+ initialLocaleId: localeId,
541287
+ routes,
541288
+ collectionUtils,
541289
+ notFoundPage,
541290
+ locales,
541291
+ defaultPageStyle: defaultPageStyle ?? {
541292
+ minHeight: '100vh',
541293
+ width: 'auto',
541294
+ },
541295
+ preserveQueryParams,
541296
+ enableAsyncURLUpdates,
541297
+ editorBar: /* @__PURE__ */ jsx(EditorBarLauncher, {
541298
+ EditorBar,
541289
541299
  },),
541300
+ disableHistory,
541301
+ LayoutTemplate,
541290
541302
  },),
541291
541303
  },),
541292
541304
  },),
@@ -541559,7 +541571,8 @@ var ResolveLinks = /* @__PURE__ */ withChildrenCanSuspend(/* @__PURE__ */ forwar
541559
541571
  const cloneWithPropsAndRef = useCloneChildrenWithPropsAndRef(ref,);
541560
541572
  const promises = [];
541561
541573
  const resolvedLinks = links.map((link) => {
541562
- return resolveLinkInternal(link.href, router, link.implicitPathVariables, (unresolvedPathSlugs, unresolvedHashslugs,) => {
541574
+ if (!link) return void 0;
541575
+ return resolveLinkInternal(link.href, router, link.implicitPathVariables, link.refKey, (unresolvedPathSlugs, unresolvedHashSlugs,) => {
541563
541576
  function handleSlugs(slugs,) {
541564
541577
  const result = {};
541565
541578
  for (const slugKey in slugs) {
@@ -541581,7 +541594,7 @@ var ResolveLinks = /* @__PURE__ */ withChildrenCanSuspend(/* @__PURE__ */ forwar
541581
541594
  }
541582
541595
  return {
541583
541596
  path: handleSlugs(unresolvedPathSlugs,),
541584
- hash: handleSlugs(unresolvedHashslugs,),
541597
+ hash: handleSlugs(unresolvedHashSlugs,),
541585
541598
  };
541586
541599
  },);
541587
541600
  },);
@@ -542482,7 +542495,7 @@ var RichText = class {
542482
542495
  __publicField(this, 'cached',);
542483
542496
  }
542484
542497
  resolve() {
542485
- this.cached ?? (this.cached = this.data.resolveRichText(this.pointer,));
542498
+ this.cached ??= this.data.resolveRichText(this.pointer,);
542486
542499
  return this.cached;
542487
542500
  }
542488
542501
  };
@@ -542939,7 +542952,7 @@ var RelationalProject = class extends RelationalNode {
542939
542952
  constructor(input, projections, passthrough,) {
542940
542953
  let isSynchronous = input.isSynchronous;
542941
542954
  for (const projection of projections) {
542942
- isSynchronous && (isSynchronous = projection.input.isSynchronous);
542955
+ isSynchronous &&= projection.input.isSynchronous;
542943
542956
  }
542944
542957
  super(isSynchronous,);
542945
542958
  this.input = input;
@@ -543086,7 +543099,7 @@ var ScalarCase = class extends ScalarNode {
543086
543099
  if (input) {
543087
543100
  referencedFields.merge(input.referencedFields,);
543088
543101
  referencedOuterFields.merge(input.referencedOuterFields,);
543089
- isSynchronous && (isSynchronous = input.isSynchronous);
543102
+ isSynchronous &&= input.isSynchronous;
543090
543103
  }
543091
543104
  for (
543092
543105
  const {
@@ -543096,15 +543109,15 @@ var ScalarCase = class extends ScalarNode {
543096
543109
  ) {
543097
543110
  referencedFields.merge(when.referencedFields,);
543098
543111
  referencedOuterFields.merge(when.referencedOuterFields,);
543099
- isSynchronous && (isSynchronous = when.isSynchronous);
543112
+ isSynchronous &&= when.isSynchronous;
543100
543113
  referencedFields.merge(then.referencedFields,);
543101
543114
  referencedOuterFields.merge(then.referencedOuterFields,);
543102
- isSynchronous && (isSynchronous = then.isSynchronous);
543115
+ isSynchronous &&= then.isSynchronous;
543103
543116
  }
543104
543117
  if (otherwise) {
543105
543118
  referencedFields.merge(otherwise.referencedFields,);
543106
543119
  referencedOuterFields.merge(otherwise.referencedOuterFields,);
543107
- isSynchronous && (isSynchronous = otherwise.isSynchronous);
543120
+ isSynchronous &&= otherwise.isSynchronous;
543108
543121
  }
543109
543122
  super(referencedFields, referencedOuterFields, isSynchronous,);
543110
543123
  this.input = input;
@@ -544886,7 +544899,7 @@ var Memo = class {
544886
544899
  this.nodes.set(hash2, node,);
544887
544900
  const outputFields = node.getOutputFields();
544888
544901
  const relational = new RelationalProps(outputFields,);
544889
- group ?? (group = this.addGroup(relational,));
544902
+ group ??= this.addGroup(relational,);
544890
544903
  group.addNode(node,);
544891
544904
  assert(relational.isCompatible(group.relational,), 'Group has inconsistent relational props',);
544892
544905
  return node;
@@ -546490,14 +546503,34 @@ function useDataRecord(collection, variables,) {
546490
546503
  }, [collection, variables,],);
546491
546504
  }
546492
546505
  function useDynamicRefs() {
546493
- const map = useConstant2(() => /* @__PURE__ */ new Map());
546506
+ const map2 = useConstant2(() => /* @__PURE__ */ new Map());
546494
546507
  return React4.useCallback((key7) => {
546495
- const existing = map.get(key7,);
546508
+ const existing = map2.get(key7,);
546496
546509
  if (existing) return existing;
546497
546510
  const ref = createRef();
546498
- map.set(key7, ref,);
546511
+ map2.set(key7, ref,);
546499
546512
  return ref;
546500
- }, [map,],);
546513
+ }, [],);
546514
+ }
546515
+ var map = /* @__PURE__ */ new Map();
546516
+ function useSiteRefs() {
546517
+ const route = useCurrentRoute();
546518
+ const path = useMemo(() => {
546519
+ return getPathForRoute(route, {
546520
+ currentRoutePath: route == null ? void 0 : route.path,
546521
+ currentPathVariables: route == null ? void 0 : route.pathVariables,
546522
+ preserveQueryParams: false,
546523
+ relative: false,
546524
+ },);
546525
+ }, [route,],);
546526
+ return React4.useCallback((key7) => {
546527
+ const computedKey = `${path}-${key7}`;
546528
+ const existing = map.get(computedKey,);
546529
+ if (existing) return existing;
546530
+ const ref = createRef();
546531
+ map.set(computedKey, ref,);
546532
+ return ref;
546533
+ }, [path,],);
546501
546534
  }
546502
546535
  function isFramerGamepadKeydownData(value,) {
546503
546536
  return isObject(value,) && value.mapping !== void 0;
@@ -546714,14 +546747,14 @@ function useNavigate() {
546714
546747
  return false;
546715
546748
  };
546716
546749
  }
546717
- function callbackForVariant(map, variant,) {
546718
- if (map[variant]) return map[variant];
546719
- if (variant in map) return void 0;
546720
- return map.default;
546750
+ function callbackForVariant(map2, variant,) {
546751
+ if (map2[variant]) return map2[variant];
546752
+ if (variant in map2) return void 0;
546753
+ return map2.default;
546721
546754
  }
546722
546755
  function useOnVariantChange(variant, callbackMap,) {
546723
- const isOnFramerCanvas = useIsOnFramerCanvas();
546724
- if (isOnFramerCanvas) return;
546756
+ const isRenderingStaticContent = useIsStaticRenderer();
546757
+ if (isRenderingStaticContent) return;
546725
546758
  const isActiveScreenRef = React4.useRef(true,);
546726
546759
  const callbackMapRef = React4.useRef(callbackMap,);
546727
546760
  useOnCurrentTargetChange((isCurrent, isOverlayed,) => {
@@ -547112,6 +547145,38 @@ function safeBaseVariant(targetVariant, fallbackVariant, validBaseVariants,) {
547112
547145
  return fallbackVariant;
547113
547146
  }
547114
547147
  var CycleVariantState = /* @__PURE__ */ Symbol('cycle',);
547148
+ function useRunCallbackIfPageIsVisible() {
547149
+ const listenerRef = useRef();
547150
+ const callbackRef = useRef();
547151
+ const clean = useCallback(() => {
547152
+ if (!listenerRef.current) return;
547153
+ document.removeEventListener('visibilitychange', listenerRef.current,);
547154
+ listenerRef.current = void 0;
547155
+ callbackRef.current = void 0;
547156
+ }, [],);
547157
+ useEffect(() => {
547158
+ return () => {
547159
+ clean();
547160
+ };
547161
+ }, [clean,],);
547162
+ return useCallback((callback) => {
547163
+ if (!document.hidden) {
547164
+ callback();
547165
+ clean();
547166
+ return;
547167
+ }
547168
+ callbackRef.current = callback;
547169
+ if (listenerRef.current) return;
547170
+ const listenerFn = () => {
547171
+ var _a;
547172
+ if (document.hidden) return;
547173
+ (_a = callbackRef.current) == null ? void 0 : _a.call(callbackRef,);
547174
+ clean();
547175
+ };
547176
+ listenerRef.current = listenerFn;
547177
+ document.addEventListener('visibilitychange', listenerFn,);
547178
+ }, [clean,],);
547179
+ }
547115
547180
  function useVariantState({
547116
547181
  variant,
547117
547182
  defaultVariant: externalDefaultVariant,
@@ -547127,7 +547192,15 @@ function useVariantState({
547127
547192
  const {
547128
547193
  wrapUpdatesInTransitions,
547129
547194
  } = useLibraryFeatures();
547130
- const internalState = React4.useRef({
547195
+ const update = useCallback((useTransition) => {
547196
+ if (useTransition) {
547197
+ startTransition2(() => void forceUpdate());
547198
+ return;
547199
+ }
547200
+ forceUpdate();
547201
+ }, [forceUpdate,],);
547202
+ const runUpdateIfPageIsVisible = useRunCallbackIfPageIsVisible();
547203
+ const internalState = useRef({
547131
547204
  isHovered: false,
547132
547205
  isPressed: false,
547133
547206
  isError: false,
@@ -547144,7 +547217,7 @@ function useVariantState({
547144
547217
  cycleOrder: externalCycleOrder,
547145
547218
  transitions: externalTransitions,
547146
547219
  },);
547147
- const resolveNextVariant = React4.useCallback((targetBaseVariant) => {
547220
+ const resolveNextVariant = useCallback((targetBaseVariant) => {
547148
547221
  const {
547149
547222
  isHovered: isHovered2,
547150
547223
  isPressed: isPressed2,
@@ -547162,8 +547235,19 @@ function useVariantState({
547162
547235
  );
547163
547236
  const nextGestureVariant = gesture ? createGestureVariant(nextBaseVariant, gesture,) : void 0;
547164
547237
  return [nextBaseVariant, nextGestureVariant,];
547165
- }, [validBaseVariants,],);
547166
- const setGestureState = React4.useCallback(({
547238
+ }, [],);
547239
+ const updateIfNeeded = useCallback(
547240
+ (baseVariant2, gestureVariant2, defaultVariant2, nextBaseVariant, isError2 = false, clearError = false,) => {
547241
+ const [nextBase, nextGesture,] = resolveNextVariant(nextBaseVariant,);
547242
+ if (nextBase === baseVariant2 && nextGesture === gestureVariant2) return;
547243
+ if (clearError) internalState.current.isError = false;
547244
+ internalState.current.baseVariant = nextBase || defaultVariant2;
547245
+ internalState.current.gestureVariant = nextGesture;
547246
+ runUpdateIfPageIsVisible(() => update(wrapUpdatesInTransitions || isError2,));
547247
+ },
547248
+ [resolveNextVariant, runUpdateIfPageIsVisible, wrapUpdatesInTransitions, update,],
547249
+ );
547250
+ const setGestureState = useCallback(({
547167
547251
  isHovered: isHovered2,
547168
547252
  isPressed: isPressed2,
547169
547253
  isError: isError2,
@@ -547176,20 +547260,9 @@ function useVariantState({
547176
547260
  gestureVariant: gestureVariant2,
547177
547261
  defaultVariant: defaultVariant2,
547178
547262
  } = internalState.current;
547179
- const [nextBase, nextGesture,] = resolveNextVariant(baseVariant2,);
547180
- if (nextBase !== baseVariant2 || nextGesture !== gestureVariant2) {
547181
- internalState.current.baseVariant = nextBase || defaultVariant2;
547182
- internalState.current.gestureVariant = nextGesture;
547183
- if (isError2 || wrapUpdatesInTransitions) {
547184
- React4.startTransition(() => {
547185
- forceUpdate();
547186
- },);
547187
- } else {
547188
- forceUpdate();
547189
- }
547190
- }
547191
- }, [resolveNextVariant, forceUpdate, wrapUpdatesInTransitions,],);
547192
- const setVariant = React4.useCallback((proposedVariant) => {
547263
+ updateIfNeeded(baseVariant2, gestureVariant2, defaultVariant2, baseVariant2, isError2,);
547264
+ }, [updateIfNeeded,],);
547265
+ const setVariant = useCallback((proposedVariant) => {
547193
547266
  const {
547194
547267
  defaultVariant: defaultVariant2,
547195
547268
  cycleOrder,
@@ -547199,29 +547272,15 @@ function useVariantState({
547199
547272
  const nextBaseVariant = proposedVariant === CycleVariantState
547200
547273
  ? nextVariant(cycleOrder || [], baseVariant2 || defaultVariant2,)
547201
547274
  : proposedVariant;
547202
- const [nextBase, nextGesture,] = resolveNextVariant(nextBaseVariant,);
547203
- if (nextBase !== baseVariant2 || nextGesture !== gestureVariant2) {
547204
- internalState.current.isError = false;
547205
- internalState.current.baseVariant = nextBase || defaultVariant2;
547206
- internalState.current.gestureVariant = nextGesture;
547207
- if (wrapUpdatesInTransitions) {
547208
- React4.startTransition(() => {
547209
- forceUpdate();
547210
- },);
547211
- } else {
547212
- forceUpdate();
547213
- }
547214
- }
547215
- }, [resolveNextVariant, wrapUpdatesInTransitions, forceUpdate,],);
547216
- const clearLoadingGesture = React4.useCallback(() => {
547275
+ updateIfNeeded(baseVariant2, gestureVariant2, defaultVariant2, nextBaseVariant, false, true,);
547276
+ }, [updateIfNeeded,],);
547277
+ const clearLoadingGesture = useCallback(() => {
547217
547278
  const {
547218
547279
  baseVariant: baseVariant2,
547219
547280
  } = internalState.current;
547220
547281
  internalState.current.loadedBaseVariant[baseVariant2] = true;
547221
- React4.startTransition(() => {
547222
- forceUpdate();
547223
- },);
547224
- }, [forceUpdate,],);
547282
+ runUpdateIfPageIsVisible(() => update(true,));
547283
+ }, [runUpdateIfPageIsVisible, update,],);
547225
547284
  if (variant !== internalState.current.lastVariant) {
547226
547285
  const [nextBase, nextGesture,] = resolveNextVariant(variant,);
547227
547286
  internalState.current.lastVariant = nextBase;
@@ -547241,7 +547300,7 @@ function useVariantState({
547241
547300
  loadedBaseVariant,
547242
547301
  } = internalState.current;
547243
547302
  const addVariantProps = useAddVariantProps(internalState.current.baseVariant, internalState.current.gestureVariant, variantProps2,);
547244
- return React4.useMemo(() => {
547303
+ return useMemo(() => {
547245
547304
  var _a;
547246
547305
  const variants = [];
547247
547306
  if (baseVariant !== defaultVariant) variants.push(baseVariant,);
@@ -547307,6 +547366,12 @@ function useVariantState({
547307
547366
  variantClassNames,
547308
547367
  ],);
547309
547368
  }
547369
+ var reUnsafeCharacters = /[}{<>&;]/u;
547370
+ function safeCSSValue(value,) {
547371
+ if (!isString(value,)) return 'none';
547372
+ if (reUnsafeCharacters.test(value,)) return 'none';
547373
+ return value;
547374
+ }
547310
547375
  function withCodeBoundaryForOverrides(Component18, {
547311
547376
  scopeId,
547312
547377
  nodeId,
@@ -549416,16 +549481,6 @@ var FontStore = class {
549416
549481
  }
549417
549482
  };
549418
549483
  var fontStore = /* @__PURE__ */ new FontStore();
549419
- Promise.allSettled = Promise.allSettled || ((promises) =>
549420
- Promise.all(promises.map((p) =>
549421
- p.then((v) => ({
549422
- status: 'fulfilled',
549423
- value: v,
549424
- })).catch((e) => ({
549425
- status: 'rejected',
549426
- reason: e,
549427
- }))
549428
- ),));
549429
549484
  function CustomProperties({
549430
549485
  children,
549431
549486
  customProperties,
@@ -550923,10 +550978,8 @@ function getInitialEffectStyle(canPlay, canAnimate2, effect,) {
550923
550978
  }
550924
550979
  function useTextEffect(config, ref, preview,) {
550925
550980
  const elements = useConstant2(() => /* @__PURE__ */ new Set());
550926
- const isOnCanvas = useIsOnFramerCanvas();
550927
- const isOnExport = RenderTarget.current() === RenderTarget.export;
550928
- const isOnCanvasOrExport = isOnCanvas || isOnExport;
550929
- const canPlay = preview || !isOnCanvasOrExport;
550981
+ const isRenderingStaticContent = useIsStaticRenderer();
550982
+ const canPlay = preview || !isRenderingStaticContent;
550930
550983
  const state2 = React2.useRef({
550931
550984
  hasMounted: false,
550932
550985
  hasAnimatedOnce: false,
@@ -551188,22 +551241,26 @@ var FitText = /* @__PURE__ */ forwardRef(({
551188
551241
  children,
551189
551242
  ...props
551190
551243
  }, ref,) => {
551191
- return /* @__PURE__ */ jsx(motion.svg, {
551192
- ref,
551193
- ...props,
551194
- viewBox,
551195
- children: /* @__PURE__ */ jsx(motion.foreignObject, {
551196
- width: '100%',
551197
- height: '100%',
551198
- className: 'framer-fit-text',
551199
- transform: `scale(${viewBoxScale})`,
551200
- style: {
551201
- overflow: 'visible',
551202
- transformOrigin: 'center center',
551203
- },
551204
- children,
551205
- },),
551206
- },);
551244
+ return (
551245
+ // biome-ignore lint/a11y/noSvgWithoutTitle: FIXME: FitText might be inaccessible to screen readers because it’s wrapped in an svg
551246
+ /* @__PURE__ */
551247
+ jsx(motion.svg, {
551248
+ ref,
551249
+ ...props,
551250
+ viewBox,
551251
+ children: /* @__PURE__ */ jsx(motion.foreignObject, {
551252
+ width: '100%',
551253
+ height: '100%',
551254
+ className: 'framer-fit-text',
551255
+ transform: `scale(${viewBoxScale})`,
551256
+ style: {
551257
+ overflow: 'visible',
551258
+ transformOrigin: 'center center',
551259
+ },
551260
+ children,
551261
+ },),
551262
+ },)
551263
+ );
551207
551264
  },);
551208
551265
  var RichTextContainer = /* @__PURE__ */ forwardRef((props, ref,) => {
551209
551266
  const {
@@ -551325,7 +551382,7 @@ var RichTextContainer = /* @__PURE__ */ forwardRef((props, ref,) => {
551325
551382
  style: containerStyle,
551326
551383
  layoutId,
551327
551384
  transformTemplate: template,
551328
- 'data-framer-name': name,
551385
+ 'data-framer-name': rest['data-framer-name'] ?? name,
551329
551386
  'data-framer-component-type': 'RichTextContainer',
551330
551387
  children: /* @__PURE__ */ jsx(FitText, {
551331
551388
  viewBox,
@@ -551346,7 +551403,7 @@ var RichTextContainer = /* @__PURE__ */ forwardRef((props, ref,) => {
551346
551403
  viewBox,
551347
551404
  viewBoxScale,
551348
551405
  transformTemplate: template,
551349
- 'data-framer-name': name,
551406
+ 'data-framer-name': rest['data-framer-name'] ?? name,
551350
551407
  'data-framer-component-type': 'RichTextContainer',
551351
551408
  children: processedChildren,
551352
551409
  },);
@@ -551358,7 +551415,7 @@ var RichTextContainer = /* @__PURE__ */ forwardRef((props, ref,) => {
551358
551415
  style: containerStyle,
551359
551416
  layoutId,
551360
551417
  transformTemplate: template,
551361
- 'data-framer-name': name,
551418
+ 'data-framer-name': rest['data-framer-name'] ?? name,
551362
551419
  'data-framer-component-type': 'RichTextContainer',
551363
551420
  children: processedChildren,
551364
551421
  },);
@@ -551598,7 +551655,7 @@ function imagePatternPropsForFill(fill, frame2, id3, includeTransform,) {
551598
551655
  const validScaleX = realWidth / frame2.width;
551599
551656
  const validScaleY = realHeight / frame2.height;
551600
551657
  if (fit === 'tile') {
551601
- fill.backgroundSize ?? (fill.backgroundSize = 1);
551658
+ fill.backgroundSize ??= 1;
551602
551659
  width = Math.round(fill.backgroundSize * (imageWidth / 2),);
551603
551660
  height = Math.round(fill.backgroundSize * (imageHeight / 2),);
551604
551661
  const layerPositionX = frame2.x ?? 0;
@@ -551771,7 +551828,7 @@ var supportsNativeParseHTML = /* @__PURE__ */ (() =>
551771
551828
  !isFirefox() && typeof Document !== 'undefined' && typeof Document.parseHTMLUnsafe === 'function')();
551772
551829
  function domParser(html, type,) {
551773
551830
  if (supportsNativeParseHTML && !type) return Document.parseHTMLUnsafe(html,);
551774
- parser ?? (parser = new DOMParser());
551831
+ parser ??= new DOMParser();
551775
551832
  return parser.parseFromString(html, type ?? 'text/html',);
551776
551833
  }
551777
551834
  var useDOM = /* @__PURE__ */ isBrowser2();
@@ -552516,7 +552573,7 @@ var TextComponent = /* @__PURE__ */ (() => {
552516
552573
  }
552517
552574
  const dataProps = {
552518
552575
  'data-framer-component-type': 'Text',
552519
- 'data-framer-name': name,
552576
+ 'data-framer-name': rest['data-framer-name'] ?? name,
552520
552577
  };
552521
552578
  if (autoSize) {
552522
552579
  asRecord(dataProps,)['data-framer-component-text-autosized'] = 'true';
@@ -554071,6 +554128,7 @@ export {
554071
554128
  getMeasurableCodeComponentChildren,
554072
554129
  getPropertyControls,
554073
554130
  getWhereExpressionFromPathVariables,
554131
+ GracefullyDegradingErrorBoundary,
554074
554132
  gradientForShape,
554075
554133
  Image2 as Image,
554076
554134
  imagePatternPropsForFill,
@@ -554182,6 +554240,7 @@ export {
554182
554240
  roundedNumber,
554183
554241
  roundedNumberString,
554184
554242
  roundWithOffset,
554243
+ safeCSSValue,
554185
554244
  Scroll,
554186
554245
  scroll,
554187
554246
  scrollInfo,
@@ -554286,6 +554345,7 @@ export {
554286
554345
  useRouteHandler,
554287
554346
  useRouter,
554288
554347
  useScroll,
554348
+ useSiteRefs,
554289
554349
  useSpring,
554290
554350
  useTime,
554291
554351
  useTransform,