unframer 3.1.0 → 3.2.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.
Files changed (80) hide show
  1. package/dist/cli.d.ts.map +1 -1
  2. package/dist/cli.js +3 -0
  3. package/dist/cli.js.map +1 -1
  4. package/dist/exporter.d.ts +2 -1
  5. package/dist/exporter.d.ts.map +1 -1
  6. package/dist/exporter.js +76 -31
  7. package/dist/exporter.js.map +1 -1
  8. package/dist/framer-chunks/fontshare-2X4LZ75B-D2V5BX73.d.ts +634 -0
  9. package/dist/framer-chunks/fontshare-2X4LZ75B-D2V5BX73.d.ts.map +1 -0
  10. package/dist/framer-chunks/fontshare-2X4LZ75B-D2V5BX73.js +8 -0
  11. package/dist/framer-chunks/fontshare-2X4LZ75B-D2V5BX73.js.map +1 -0
  12. package/dist/framer-chunks/fontshare-EOIRPPWV-VDFFNW4K.d.ts +115 -0
  13. package/dist/framer-chunks/fontshare-EOIRPPWV-VDFFNW4K.d.ts.map +1 -0
  14. package/dist/framer-chunks/fontshare-EOIRPPWV-VDFFNW4K.js +8 -0
  15. package/dist/framer-chunks/fontshare-EOIRPPWV-VDFFNW4K.js.map +1 -0
  16. package/dist/framer-chunks/fontshare-Y53BJZLK-EUQIV252.d.ts +781 -0
  17. package/dist/framer-chunks/fontshare-Y53BJZLK-EUQIV252.d.ts.map +1 -0
  18. package/dist/framer-chunks/fontshare-Y53BJZLK-EUQIV252.js +8 -0
  19. package/dist/framer-chunks/fontshare-Y53BJZLK-EUQIV252.js.map +1 -0
  20. package/dist/framer-chunks/google-2KFYDWCN-PJC2DDXK.d.ts +1566 -0
  21. package/dist/framer-chunks/google-2KFYDWCN-PJC2DDXK.d.ts.map +1 -0
  22. package/dist/framer-chunks/google-2KFYDWCN-PJC2DDXK.js +8 -0
  23. package/dist/framer-chunks/google-2KFYDWCN-PJC2DDXK.js.map +1 -0
  24. package/dist/framer-chunks/google-HSMCYMMG-DWNQGSHN.d.ts +10293 -0
  25. package/dist/framer-chunks/google-HSMCYMMG-DWNQGSHN.d.ts.map +1 -0
  26. package/dist/framer-chunks/google-HSMCYMMG-DWNQGSHN.js +8 -0
  27. package/dist/framer-chunks/google-HSMCYMMG-DWNQGSHN.js.map +1 -0
  28. package/dist/framer-chunks/google-S367OFIE-AWJEPMSF.d.ts +3588 -0
  29. package/dist/framer-chunks/google-S367OFIE-AWJEPMSF.d.ts.map +1 -0
  30. package/dist/framer-chunks/google-S367OFIE-AWJEPMSF.js +8 -0
  31. package/dist/framer-chunks/google-S367OFIE-AWJEPMSF.js.map +1 -0
  32. package/dist/framer.js +199 -107
  33. package/dist/version.d.ts +1 -1
  34. package/dist/version.js +1 -1
  35. package/esm/cli.d.ts.map +1 -1
  36. package/esm/cli.js +3 -0
  37. package/esm/cli.js.map +1 -1
  38. package/esm/exporter.d.ts +2 -1
  39. package/esm/exporter.d.ts.map +1 -1
  40. package/esm/exporter.js +77 -32
  41. package/esm/exporter.js.map +1 -1
  42. package/esm/framer-chunks/fontshare-2X4LZ75B-D2V5BX73.d.ts +634 -0
  43. package/esm/framer-chunks/fontshare-2X4LZ75B-D2V5BX73.d.ts.map +1 -0
  44. package/esm/framer-chunks/fontshare-2X4LZ75B-D2V5BX73.js +5 -0
  45. package/esm/framer-chunks/fontshare-2X4LZ75B-D2V5BX73.js.map +1 -0
  46. package/esm/framer-chunks/fontshare-EOIRPPWV-VDFFNW4K.d.ts +115 -0
  47. package/esm/framer-chunks/fontshare-EOIRPPWV-VDFFNW4K.d.ts.map +1 -0
  48. package/esm/framer-chunks/fontshare-EOIRPPWV-VDFFNW4K.js +5 -0
  49. package/esm/framer-chunks/fontshare-EOIRPPWV-VDFFNW4K.js.map +1 -0
  50. package/esm/framer-chunks/fontshare-Y53BJZLK-EUQIV252.d.ts +781 -0
  51. package/esm/framer-chunks/fontshare-Y53BJZLK-EUQIV252.d.ts.map +1 -0
  52. package/esm/framer-chunks/fontshare-Y53BJZLK-EUQIV252.js +5 -0
  53. package/esm/framer-chunks/fontshare-Y53BJZLK-EUQIV252.js.map +1 -0
  54. package/esm/framer-chunks/google-2KFYDWCN-PJC2DDXK.d.ts +1566 -0
  55. package/esm/framer-chunks/google-2KFYDWCN-PJC2DDXK.d.ts.map +1 -0
  56. package/esm/framer-chunks/google-2KFYDWCN-PJC2DDXK.js +5 -0
  57. package/esm/framer-chunks/google-2KFYDWCN-PJC2DDXK.js.map +1 -0
  58. package/esm/framer-chunks/google-HSMCYMMG-DWNQGSHN.d.ts +10293 -0
  59. package/esm/framer-chunks/google-HSMCYMMG-DWNQGSHN.d.ts.map +1 -0
  60. package/esm/framer-chunks/google-HSMCYMMG-DWNQGSHN.js +5 -0
  61. package/esm/framer-chunks/google-HSMCYMMG-DWNQGSHN.js.map +1 -0
  62. package/esm/framer-chunks/google-S367OFIE-AWJEPMSF.d.ts +3588 -0
  63. package/esm/framer-chunks/google-S367OFIE-AWJEPMSF.d.ts.map +1 -0
  64. package/esm/framer-chunks/google-S367OFIE-AWJEPMSF.js +5 -0
  65. package/esm/framer-chunks/google-S367OFIE-AWJEPMSF.js.map +1 -0
  66. package/esm/framer.js +199 -107
  67. package/esm/version.d.ts +1 -1
  68. package/esm/version.js +1 -1
  69. package/package.json +2 -2
  70. package/src/cli.ts +3 -0
  71. package/src/exporter.ts +101 -33
  72. package/src/framer-chunks/fontshare-2X4LZ75B-D2V5BX73.js +7 -0
  73. package/src/framer-chunks/fontshare-EOIRPPWV-VDFFNW4K.js +7 -0
  74. package/src/framer-chunks/fontshare-Y53BJZLK-EUQIV252.js +7 -0
  75. package/src/framer-chunks/google-2KFYDWCN-PJC2DDXK.js +7 -0
  76. package/src/framer-chunks/google-HSMCYMMG-DWNQGSHN.js +7 -0
  77. package/src/framer-chunks/google-S367OFIE-AWJEPMSF.js +7 -0
  78. package/src/framer.js +198 -111
  79. package/src/styles/framer.css +13 -12
  80. package/src/version.ts +1 -1
package/src/framer.js CHANGED
@@ -11214,7 +11214,7 @@ function stagger(duration = 0.1, {
11214
11214
  };
11215
11215
  }
11216
11216
 
11217
- // /:https://app.framerstatic.com/framer.O23R7WUO.mjs
11217
+ // /:https://app.framerstatic.com/framer.ZNMFLOLI.mjs
11218
11218
  import { lazy as ReactLazy, } from 'react';
11219
11219
  import React4 from 'react';
11220
11220
  import { startTransition as startTransition2, } from 'react';
@@ -12649,31 +12649,10 @@ function useRouteHandler(routeId, preload = false, elementId,) {
12649
12649
  const handler = React4.useCallback(() => navigate == null ? void 0 : navigate(routeId, elementId,), [navigate, elementId, routeId,],);
12650
12650
  return handler;
12651
12651
  }
12652
- var timezone;
12653
- var visitorLocale;
12654
- function setTimezoneAndLocaleForTracking() {
12655
- const resolvedDateTimeOptions = Intl.DateTimeFormat().resolvedOptions();
12656
- timezone = resolvedDateTimeOptions.timeZone;
12657
- visitorLocale = resolvedDateTimeOptions.locale;
12658
- }
12659
- requestIdleCallback(setTimezoneAndLocaleForTracking,);
12652
+ var pageviewEventVersion = 2;
12660
12653
  function sendTrackingEvent(eventType, eventData, sendOn = 'lazy',) {
12661
- if (!safeWindow.__framer_events) return;
12662
- if (!timezone || !visitorLocale) setTimezoneAndLocaleForTracking();
12663
- safeWindow.__framer_events.push([eventType, {
12664
- // Base properties common to all events
12665
- referrer: null,
12666
- // The first pageview event will always be sent before hydration, in a script in `exportToHTML.ts`.
12667
- url: safeWindow.location.href,
12668
- hostname: safeWindow.location.hostname || null,
12669
- pathname: safeWindow.location.pathname || null,
12670
- hash: safeWindow.location.hash || null,
12671
- search: safeWindow.location.search || null,
12672
- timezone,
12673
- locale: visitorLocale,
12674
- // Additional properties specific to custom events
12675
- ...eventData,
12676
- }, sendOn,],);
12654
+ var _a;
12655
+ (_a = safeWindow.__framer_events) == null ? void 0 : _a.push([eventType, eventData, sendOn,],);
12677
12656
  switch (eventType) {
12678
12657
  case 'published_site_click': {
12679
12658
  const {
@@ -13646,6 +13625,7 @@ function usePopStateHandler(currentRouteId, setCurrentRouteId,) {
13646
13625
  routeId,
13647
13626
  isString(localeId,) ? localeId : void 0,
13648
13627
  isString(hash2,) ? hash2 : void 0,
13628
+ window.location.pathname + window.location.search + window.location.hash,
13649
13629
  isObject2(pathVariables,) ? pathVariables : void 0,
13650
13630
  true,
13651
13631
  nextRender,
@@ -19314,8 +19294,13 @@ var DimensionType = /* @__PURE__ */ ((DimensionType2) => {
19314
19294
  DimensionType2[DimensionType2['Auto'] = 2] = 'Auto';
19315
19295
  DimensionType2[DimensionType2['FractionOfFreeSpace'] = 3] = 'FractionOfFreeSpace';
19316
19296
  DimensionType2[DimensionType2['Viewport'] = 4] = 'Viewport';
19297
+ DimensionType2[DimensionType2['FitImage'] = 5] = 'FitImage';
19317
19298
  return DimensionType2;
19318
19299
  })(DimensionType || {},);
19300
+ function isAutoDimensionType(dimensionType,) {
19301
+ if (isUndefined(dimensionType,)) return false;
19302
+ return dimensionType === 2 || dimensionType === 5;
19303
+ }
19319
19304
  function isConstraintSupportingChild(child,) {
19320
19305
  if (!isReactChild(child,) || !isReactElement(child,)) {
19321
19306
  return false;
@@ -19326,7 +19311,7 @@ var ConstraintMask = {
19326
19311
  // Modifies the constraint mask to remove invalid (mutually exclusive) options and returns the original.
19327
19312
  // TODO: this removes major inconsistencies but probably needs to be merged with ConstraintSolver.
19328
19313
  quickfix: (constraints) => {
19329
- if (constraints.widthType === 2 || constraints.heightType === 2) {
19314
+ if (isAutoDimensionType(constraints.widthType,) || isAutoDimensionType(constraints.heightType,)) {
19330
19315
  constraints.aspectRatio = null;
19331
19316
  }
19332
19317
  if (isFiniteNumber(constraints.aspectRatio,)) {
@@ -19344,13 +19329,13 @@ var ConstraintMask = {
19344
19329
  }
19345
19330
  }
19346
19331
  if (constraints.left && constraints.right) {
19347
- if (constraints.fixedSize || constraints.widthType === 2 || isFiniteNumber(constraints.maxWidth,)) {
19332
+ if (constraints.fixedSize || isAutoDimensionType(constraints.widthType,) || isFiniteNumber(constraints.maxWidth,)) {
19348
19333
  constraints.right = false;
19349
19334
  }
19350
19335
  constraints.widthType = 0;
19351
19336
  }
19352
19337
  if (constraints.top && constraints.bottom) {
19353
- if (constraints.fixedSize || constraints.heightType === 2 || isFiniteNumber(constraints.maxHeight,)) {
19338
+ if (constraints.fixedSize || isAutoDimensionType(constraints.heightType,) || isFiniteNumber(constraints.maxHeight,)) {
19354
19339
  constraints.bottom = false;
19355
19340
  }
19356
19341
  constraints.heightType = 0;
@@ -19459,7 +19444,7 @@ var ConstraintValues = {
19459
19444
  const hOpposingPinsOffset = pinnedOffset(values.left, values.right,);
19460
19445
  if (parentWidth && isFiniteNumber(hOpposingPinsOffset,)) {
19461
19446
  width = parentWidth - hOpposingPinsOffset;
19462
- } else if (autoSize && values.widthType === 2) {
19447
+ } else if (autoSize && isAutoDimensionType(values.widthType,)) {
19463
19448
  width = autoSize.width;
19464
19449
  } else if (isFiniteNumber(values.width,)) {
19465
19450
  switch (values.widthType) {
@@ -19476,6 +19461,7 @@ var ConstraintValues = {
19476
19461
  }
19477
19462
  break;
19478
19463
  case 2:
19464
+ case 5:
19479
19465
  break;
19480
19466
  default:
19481
19467
  assertNever(values.widthType,);
@@ -19484,7 +19470,7 @@ var ConstraintValues = {
19484
19470
  const vOpposingPinsOffset = pinnedOffset(values.top, values.bottom,);
19485
19471
  if (parentHeight && isFiniteNumber(vOpposingPinsOffset,)) {
19486
19472
  height = parentHeight - vOpposingPinsOffset;
19487
- } else if (autoSize && values.heightType === 2) {
19473
+ } else if (autoSize && isAutoDimensionType(values.heightType,)) {
19488
19474
  height = autoSize.height;
19489
19475
  } else if (isFiniteNumber(values.height,)) {
19490
19476
  switch (values.heightType) {
@@ -19501,6 +19487,7 @@ var ConstraintValues = {
19501
19487
  }
19502
19488
  break;
19503
19489
  case 2:
19490
+ case 5:
19504
19491
  break;
19505
19492
  default:
19506
19493
  assertNever(values.heightType,);
@@ -20565,9 +20552,10 @@ var richTextCSSRules = /* @__PURE__ */ (() => [
20565
20552
  text-transform: var(--framer-blockquote-text-transform, var(--framer-link-text-transform, var(--framer-text-transform, none)));
20566
20553
  /* Cursor inherit to overwrite the user agent stylesheet on rich text links. */
20567
20554
  cursor: var(--framer-custom-cursors, pointer);
20568
- background-color: var(--framer-link-text-background-color, var(--framer-text-background-color, initial));
20569
- border-radius: var(--framer-link-text-background-radius, var(--framer-text-background-radius, initial));
20570
- padding: var(--framer-link-text-background-padding, var(--framer-text-background-padding, initial));
20555
+ /* Don't inherit background styles from any parent text style. */
20556
+ background-color: var(--framer-link-text-background-color, initial);
20557
+ border-radius: var(--framer-link-text-background-radius, initial);
20558
+ padding: var(--framer-link-text-background-padding, initial);
20571
20559
  }
20572
20560
  `,
20573
20561
  // Text decoration can't be applied to the nested spans of links because it breaks animations
@@ -20592,9 +20580,7 @@ var richTextCSSRules = /* @__PURE__ */ (() => [
20592
20580
  color: ${
20593
20581
  createRGBVariableFallbacks(['--framer-blockquote-text-color', '--framer-link-text-color', '--framer-text-color',], '#000',)
20594
20582
  };
20595
- background-color: ${
20596
- createRGBVariableFallbacks(['--framer-link-text-background-color', '--framer-text-background-color',], 'initial',)
20597
- };
20583
+ background-color: ${createRGBVariableFallbacks(['--framer-link-text-background-color',], 'initial',)};
20598
20584
  }
20599
20585
  }
20600
20586
  `, /* css */
@@ -20718,9 +20704,9 @@ var richTextCSSRules = /* @__PURE__ */ (() => [
20718
20704
  color: var(--framer-link-current-text-color, var(--framer-link-text-color, var(--framer-text-color, #000)));
20719
20705
  font-size: calc(var(--framer-link-current-font-size, var(--framer-link-font-size, var(--framer-font-size, 16px))) * var(--framer-font-size-scale, 1));
20720
20706
  text-transform: var(--framer-link-current-text-transform, var(--framer-link-text-transform, var(--framer-text-transform, none)));
20721
- background-color: var(--framer-link-current-text-background-color, var(--framer-link-text-background-color, var(--framer-text-background-color, initial)));
20722
- border-radius: var(--framer-link-current-text-background-radius, var(--framer-link-text-background-radius, var(--framer-text-background-radius, initial)));
20723
- padding: var(--framer-link-current-text-background-padding, var(--framer-link-text-background-padding, var(--framer-text-background-padding, initial)));
20707
+ background-color: var(--framer-link-current-text-background-color, var(--framer-link-text-background-color, initial));
20708
+ border-radius: var(--framer-link-current-text-background-radius, var(--framer-link-text-background-radius, initial));
20709
+ padding: var(--framer-link-current-text-background-padding, var(--framer-link-text-background-padding, initial));
20724
20710
  }
20725
20711
  `, /* css */
20726
20712
  `
@@ -20800,9 +20786,9 @@ var richTextCSSRules = /* @__PURE__ */ (() => [
20800
20786
  color: var(--framer-link-hover-text-color, var(--framer-link-current-text-color, var(--framer-link-text-color, var(--framer-text-color, #000))));
20801
20787
  font-size: calc(var(--framer-link-hover-font-size, var(--framer-link-current-font-size, var(--framer-link-font-size, var(--framer-font-size, 16px)))) * var(--framer-font-size-scale, 1));
20802
20788
  text-transform: var(--framer-link-hover-text-transform, var(--framer-link-current-text-transform, var(--framer-link-text-transform, var(--framer-text-transform, none))));
20803
- background-color: var(--framer-link-hover-text-background-color, var(--framer-link-current-text-background-color, var(--framer-link-text-background-color, var(--framer-text-background-color, initial))));
20804
- border-radius: var(--framer-link-hover-text-background-radius, var(--framer-link-current-text-background-radius, var(--framer-link-text-background-radius, var(--framer-text-background-radius, initial))));
20805
- padding: var(--framer-link-hover-text-background-padding, var(--framer-link-current-text-background-padding, var(--framer-link-text-background-padding, var(--framer-text-background-padding, initial))));
20789
+ background-color: var(--framer-link-hover-text-background-color, var(--framer-link-current-text-background-color, var(--framer-link-text-background-color, initial)));
20790
+ border-radius: var(--framer-link-hover-text-background-radius, var(--framer-link-current-text-background-radius, var(--framer-link-text-background-radius, initial)));
20791
+ padding: var(--framer-link-hover-text-background-padding, var(--framer-link-current-text-background-padding, var(--framer-link-text-background-padding, initial)));
20806
20792
  }
20807
20793
  `, /* css */
20808
20794
  `
@@ -20836,7 +20822,6 @@ var richTextCSSRules = /* @__PURE__ */ (() => [
20836
20822
  '--framer-link-hover-text-background-color',
20837
20823
  '--framer-link-current-text-background-color',
20838
20824
  '--framer-link-text-background-color',
20839
- '--framer-text-background-color',
20840
20825
  ], 'initial',)
20841
20826
  };
20842
20827
  }
@@ -20877,7 +20862,6 @@ var richTextCSSRules = /* @__PURE__ */ (() => [
20877
20862
  '--framer-link-hover-text-background-color',
20878
20863
  '--framer-link-current-text-background-color',
20879
20864
  '--framer-link-text-background-color',
20880
- '--framer-text-background-color',
20881
20865
  ], 'initial',)
20882
20866
  };
20883
20867
  }
@@ -23433,7 +23417,7 @@ var key = 'src';
23433
23417
  var BackgroundImage = {
23434
23418
  isImageObject: function (image,) {
23435
23419
  if (!image || typeof image === 'string') return false;
23436
- return key in image;
23420
+ return typeof image === 'object' && key in image;
23437
23421
  },
23438
23422
  };
23439
23423
  function applyForwardOverrides(background, props,) {
@@ -23474,6 +23458,34 @@ function backgroundImageFromProps(props,) {
23474
23458
  }
23475
23459
  return applyForwardOverrides(backgroundImage, props,);
23476
23460
  }
23461
+ function getIntrinsicSizeForBackgroundImage(background,) {
23462
+ if (!background) return void 0;
23463
+ if (background.pixelHeight && background.pixelWidth) {
23464
+ return {
23465
+ width: background.pixelWidth,
23466
+ height: background.pixelHeight,
23467
+ };
23468
+ }
23469
+ return parseImageSizeFromSrc(background.src,);
23470
+ }
23471
+ function parseImageSizeFromSrc(src,) {
23472
+ if (!src) return void 0;
23473
+ let url;
23474
+ try {
23475
+ url = new URL(src,);
23476
+ } catch {
23477
+ return void 0;
23478
+ }
23479
+ const width = url.searchParams.get('width',);
23480
+ const height = url.searchParams.get('height',);
23481
+ if (width && height) {
23482
+ return {
23483
+ width: parseInt(width,),
23484
+ height: parseInt(height,),
23485
+ };
23486
+ }
23487
+ return void 0;
23488
+ }
23477
23489
  function htmlElementAsMotionComponent(asElem,) {
23478
23490
  return asElem && asElem !== 'search' && asElem !== 'slot' && asElem !== 'template' ? motion[asElem] : motion['div'];
23479
23491
  }
@@ -24582,6 +24594,11 @@ var VisibleFrame = /* @__PURE__ */ forwardRef(function VisibleFrame2(props, forw
24582
24594
  parentSize,
24583
24595
  );
24584
24596
  const MotionComponent = htmlElementAsMotionComponent(props.as,);
24597
+ const intrinsicSize = getIntrinsicSizeForBackgroundImage(backgroundImage,);
24598
+ if (props.fitImageDimension && intrinsicSize) {
24599
+ currentStyle[props.fitImageDimension] = 'auto';
24600
+ currentStyle.aspectRatio = intrinsicSize.width / intrinsicSize.height;
24601
+ }
24585
24602
  return /* @__PURE__ */ jsxs(MotionComponent, {
24586
24603
  ...dataProps,
24587
24604
  ...motionProps,
@@ -34332,14 +34349,14 @@ function domWriteCreateUpdateSafeArea(safeAreaRef,) {
34332
34349
  Object.assign(safeAreaRef.current.style, floatingPositionSafeAreaStyle(x, y, placement, anchorRect, calculatedRect,),);
34333
34350
  };
34334
34351
  }
34335
- function domWriteUpdatePosition(floatingPositionRef, position, rect,) {
34352
+ function domWriteUpdatePosition(floatingPositionRef, position, rect, scrollX, scrollY,) {
34336
34353
  if (!floatingPositionRef.current) return;
34337
34354
  Object.assign(floatingPositionRef.current.style, {
34338
34355
  position,
34339
34356
  visibility: 'visible',
34340
34357
  // Append "px" because we are assigning this object straight to style.
34341
- left: ((rect == null ? void 0 : rect.x) ?? 0) + (position === 'fixed' ? 0 : safeWindow.scrollX) + 'px',
34342
- top: ((rect == null ? void 0 : rect.y) ?? 0) + (position === 'fixed' ? 0 : safeWindow.scrollY) + 'px',
34358
+ left: ((rect == null ? void 0 : rect.x) ?? 0) + scrollX + 'px',
34359
+ top: ((rect == null ? void 0 : rect.y) ?? 0) + scrollY + 'px',
34343
34360
  },);
34344
34361
  }
34345
34362
  var FloatingStackingContext = /* @__PURE__ */ (() => {
@@ -34484,12 +34501,13 @@ function Floating({
34484
34501
  let elementRect;
34485
34502
  let safePlacement;
34486
34503
  let calculatedRect;
34487
- let scrolls;
34488
34504
  let latestEvent;
34489
34505
  let updateSafeArea;
34506
+ let scrollX = 0;
34507
+ let scrollY = 0;
34490
34508
  const onRender = () => {
34491
34509
  if (cleanupHasRun) return;
34492
- domWriteUpdatePosition(floatingPositionRef, position, calculatedRect,);
34510
+ domWriteUpdatePosition(floatingPositionRef, position, calculatedRect, scrollX, scrollY,);
34493
34511
  if (safeArea) updateSafeArea(anchorRect, calculatedRect, safePlacement, latestEvent,);
34494
34512
  latestEvent = void 0;
34495
34513
  };
@@ -34498,7 +34516,7 @@ function Floating({
34498
34516
  if (latestEvent) {
34499
34517
  onRender();
34500
34518
  } else {
34501
- domWriteUpdatePosition(floatingPositionRef, position, calculatedRect,);
34519
+ domWriteUpdatePosition(floatingPositionRef, position, calculatedRect, scrollX, scrollY,);
34502
34520
  }
34503
34521
  initialUpdateHasRun = true;
34504
34522
  };
@@ -34508,6 +34526,13 @@ function Floating({
34508
34526
  };
34509
34527
  const domReadUpdateSafePlacementAndRect = () => {
34510
34528
  if (!getSafePlacementRect || cleanupHasRun) return;
34529
+ if (position === 'fixed') {
34530
+ scrollX = 0;
34531
+ scrollY = 0;
34532
+ } else {
34533
+ scrollX = safeWindow.scrollX;
34534
+ scrollY = safeWindow.scrollY;
34535
+ }
34511
34536
  anchorRect = anchorRef.current.getBoundingClientRect();
34512
34537
  const safePlacementAndRect = getSafePlacementRect(anchorRect, elementRect,);
34513
34538
  safePlacement = safePlacementAndRect[0];
@@ -36165,64 +36190,77 @@ function isSamePage(a, b,) {
36165
36190
  return aPathVariables.length === bPathVariables.length &&
36166
36191
  Object.keys(aPathVariables,).every((key7) => aPathVariables[key7] === bPathVariables[key7]);
36167
36192
  }
36168
- function getPageviewEventData({
36169
- abTestId,
36170
- framerSiteId,
36171
- routeId,
36172
- routePath,
36173
- collectionItemId,
36174
- localeCode,
36175
- },) {
36176
- return {
36177
- abTestId,
36178
- framerSiteId,
36179
- routePath: routePath || '/',
36180
- collectionItemId,
36181
- framerLocale: localeCode,
36182
- webPageId: routeId,
36183
- };
36193
+ var timezone = null;
36194
+ var visitorLocale = null;
36195
+ function setTimezoneAndLocaleForTracking() {
36196
+ const resolvedDateTimeOptions = Intl.DateTimeFormat().resolvedOptions();
36197
+ timezone = resolvedDateTimeOptions.timeZone;
36198
+ visitorLocale = resolvedDateTimeOptions.locale;
36184
36199
  }
36185
- var useSendPageView = (currentRoute, currentRouteId, currentPathVariables, collectionUtils, activeLocale,) => {
36200
+ requestIdleCallback(setTimezoneAndLocaleForTracking,);
36201
+ var useSendPageView = (currentRoute, currentRouteId, currentPathnameWithHash, currentPathVariables, collectionUtils, activeLocale,) => {
36186
36202
  const framerSiteId = useContext(FormContext,);
36187
36203
  const pageviewEventData = useRef3();
36188
36204
  const skipFirstPageView = useRef3(true,);
36189
36205
  useEffect(() => {
36190
- const getFullPageviewEventData = async () => {
36191
- var _a;
36192
- let collectionItemId = null;
36193
- if ((currentRoute == null ? void 0 : currentRoute.collectionId) && collectionUtils && currentPathVariables) {
36194
- const utils = await ((_a = collectionUtils[currentRoute.collectionId]) == null ? void 0 : _a.call(collectionUtils,));
36195
- const [slug,] = Object.values(currentPathVariables,);
36196
- if (utils && typeof slug === 'string') {
36197
- collectionItemId = (await utils.getRecordIdBySlug(slug, activeLocale || void 0,)) ?? null;
36198
- }
36199
- }
36200
- return getPageviewEventData({
36206
+ function getFullPageviewEventData() {
36207
+ if (!timezone || !visitorLocale) setTimezoneAndLocaleForTracking();
36208
+ const currentLocation = currentPathnameWithHash
36209
+ ? new URL(safeWindow.location.origin + currentPathnameWithHash,)
36210
+ : safeWindow.location;
36211
+ const eventData = {
36212
+ version: pageviewEventVersion,
36201
36213
  abTestId: currentRoute == null ? void 0 : currentRoute.abTestId,
36202
36214
  framerSiteId: framerSiteId ?? null,
36203
36215
  // If we are in a variant route, let's use the variant ID as the route ID instead, so that the analytics panel will be able to show the correct tracking data.
36204
- routeId: (currentRoute == null ? void 0 : currentRoute.abTestingVariantId) ?? currentRouteId,
36205
- routePath: currentRoute == null ? void 0 : currentRoute.path,
36206
- collectionItemId,
36207
- localeCode: (activeLocale == null ? void 0 : activeLocale.code) || null,
36208
- },);
36209
- };
36216
+ webPageId: (currentRoute == null ? void 0 : currentRoute.abTestingVariantId) ?? currentRouteId,
36217
+ routePath: (currentRoute == null ? void 0 : currentRoute.path) || '/',
36218
+ collectionItemId: null,
36219
+ framerLocale: (activeLocale == null ? void 0 : activeLocale.code) || null,
36220
+ referrer: null,
36221
+ // The first pageview event will always be sent before hydration, in a script in `exportToHTML.ts`.
36222
+ url: currentLocation.href,
36223
+ hostname: currentLocation.hostname,
36224
+ // Capture the current location before the user moves to a new page to prevent
36225
+ // tracking wrong pathnames due to a race condition caused by async operations
36226
+ // when resolving the collection item ID below
36227
+ pathname: currentLocation.pathname,
36228
+ search: currentLocation.search || null,
36229
+ hash: currentLocation.hash || null,
36230
+ timezone,
36231
+ locale: visitorLocale,
36232
+ };
36233
+ return (currentRoute == null ? void 0 : currentRoute.collectionId) && collectionUtils && currentPathVariables
36234
+ ? (async () => {
36235
+ var _a;
36236
+ let collectionItemId = null;
36237
+ const utils = currentRoute.collectionId &&
36238
+ (await ((_a = collectionUtils[currentRoute.collectionId]) == null ? void 0 : _a.call(collectionUtils,)));
36239
+ const [slug,] = Object.values(currentPathVariables,);
36240
+ if (utils && typeof slug === 'string') {
36241
+ collectionItemId = (await utils.getRecordIdBySlug(slug, activeLocale || void 0,)) ?? null;
36242
+ }
36243
+ return {
36244
+ ...eventData,
36245
+ collectionItemId,
36246
+ };
36247
+ })()
36248
+ : eventData;
36249
+ }
36210
36250
  void (async () => {
36211
- const pageviewEventDataPromise = getFullPageviewEventData();
36212
- pageviewEventData.current = pageviewEventDataPromise;
36251
+ const eventDataOrPromise = pageviewEventData.current = getFullPageviewEventData();
36252
+ const eventData = eventDataOrPromise instanceof Promise ? await eventDataOrPromise : eventDataOrPromise;
36253
+ pageviewEventData.current = eventData;
36213
36254
  if (skipFirstPageView.current) {
36214
36255
  skipFirstPageView.current = false;
36215
- return;
36256
+ } else {
36257
+ sendTrackingEvent('published_site_pageview', eventData, 'eager',);
36216
36258
  }
36217
- const eventData = await pageviewEventDataPromise;
36218
- pageviewEventData.current = eventData;
36219
- sendTrackingEvent('published_site_pageview', eventData, 'eager',);
36220
36259
  })();
36221
36260
  const listener = async (event) => {
36222
36261
  if (event.persisted) {
36223
- const pageviewEventDataPromise = getFullPageviewEventData();
36224
- pageviewEventData.current = pageviewEventDataPromise;
36225
- const eventData = await getFullPageviewEventData();
36262
+ const eventDataOrPromise = pageviewEventData.current = getFullPageviewEventData();
36263
+ const eventData = eventDataOrPromise instanceof Promise ? await eventDataOrPromise : eventDataOrPromise;
36226
36264
  pageviewEventData.current = eventData;
36227
36265
  sendTrackingEvent('published_site_pageview', eventData, 'eager',);
36228
36266
  }
@@ -36231,7 +36269,7 @@ var useSendPageView = (currentRoute, currentRouteId, currentPathVariables, colle
36231
36269
  return () => {
36232
36270
  window.removeEventListener('pageshow', listener,);
36233
36271
  };
36234
- }, [currentRoute, currentRouteId, currentPathVariables, collectionUtils, activeLocale, framerSiteId,],);
36272
+ }, [currentRoute, currentRouteId, currentPathnameWithHash, currentPathVariables, collectionUtils, activeLocale, framerSiteId,],);
36235
36273
  return pageviewEventData;
36236
36274
  };
36237
36275
  var defaultLocaleId = 'default';
@@ -36343,6 +36381,7 @@ function Router({
36343
36381
  return (fn) => fn();
36344
36382
  }, [synchronousNavigationOnDesktop,],);
36345
36383
  const isInitialNavigationRef = useRef3(true,);
36384
+ const currentPathnameWithHashRef = useRef3();
36346
36385
  const currentRouteRef = useRef3(initialRoute,);
36347
36386
  const currentPathVariablesRef = useRef3(initialPathVariables,);
36348
36387
  const currentLocaleIdRef = useRef3(initialLocaleId,);
@@ -36438,12 +36477,13 @@ function Router({
36438
36477
  transitionFn,
36439
36478
  ],);
36440
36479
  const setCurrentRouteId = useCallback(
36441
- (routeId, localeId, hash2, pathVariables, isHistoryTransition, nextRender, smoothScroll = false, updateURL,) => {
36480
+ (routeId, localeId, hash2, pathnameWithHash, pathVariables, isHistoryTransition, nextRender, smoothScroll = false, updateURL,) => {
36442
36481
  isInitialNavigationRef.current = false;
36443
36482
  const currentRouteId2 = currentRouteRef.current;
36444
36483
  currentRouteRef.current = routeId;
36445
36484
  currentPathVariablesRef.current = pathVariables;
36446
36485
  currentLocaleIdRef.current = localeId;
36486
+ currentPathnameWithHashRef.current = pathnameWithHash;
36447
36487
  scheduleSideEffect(() => {
36448
36488
  updateScrollPosition(hash2, smoothScroll, isHistoryTransition,);
36449
36489
  },);
@@ -36537,10 +36577,22 @@ function Router({
36537
36577
  siteCanonicalURL,
36538
36578
  }, ignorePushStateWrapper,);
36539
36579
  };
36580
+ const pathnameWithHash = getSitePrefix(siteCanonicalURL,) + getPathForRoute(newRoute, {
36581
+ currentRoutePath: currentRoute2 == null ? void 0 : currentRoute2.path,
36582
+ currentPathVariables: currentPathVariables2,
36583
+ hash: hash2,
36584
+ pathVariables,
36585
+ localeId: currentRouteLocaleId,
36586
+ preserveQueryParams,
36587
+ siteCanonicalURL,
36588
+ relative: false,
36589
+ // We need an absolute path for the hash
36590
+ },);
36540
36591
  setCurrentRouteId(
36541
36592
  routeId,
36542
36593
  currentRouteLocaleId,
36543
36594
  routeElementId,
36595
+ pathnameWithHash,
36544
36596
  pathVariables,
36545
36597
  false,
36546
36598
  nextRender,
@@ -36550,10 +36602,18 @@ function Router({
36550
36602
  }, [routes, setCurrentRouteId, disableHistory, preserveQueryParams, siteCanonicalURL, monitorNextPaintAfterRender,],);
36551
36603
  const getRoute = useGetRouteCallback(routes,);
36552
36604
  const currentRouteId = currentRouteRef.current;
36605
+ const currentPathnameWithHash = currentPathnameWithHashRef.current;
36553
36606
  const currentPathVariables = currentPathVariablesRef.current;
36554
36607
  const currentRoute = routes[currentRouteId];
36555
36608
  const currentRoutePath = currentRoute == null ? void 0 : currentRoute.path;
36556
- const pageviewEventData = useSendPageView(currentRoute, currentRouteId, currentPathVariables, collectionUtils, activeLocale,);
36609
+ const pageviewEventData = useSendPageView(
36610
+ currentRoute,
36611
+ currentRouteId,
36612
+ currentPathnameWithHash,
36613
+ currentPathVariables,
36614
+ collectionUtils,
36615
+ activeLocale,
36616
+ );
36557
36617
  const isInitialNavigation = isInitialNavigationRef.current;
36558
36618
  const api = useMemo2(() => ({
36559
36619
  navigate,
@@ -36606,7 +36666,7 @@ function Router({
36606
36666
  /* @__PURE__ */ jsx3(MarkSuspenseEffects.Start, {},),
36607
36667
  /* @__PURE__ */ jsx3(WithLayoutTemplate, {
36608
36668
  LayoutTemplate,
36609
- routeId: currentRouteId,
36669
+ routeId: (currentRoute == null ? void 0 : currentRoute.abTestingVariantId) ?? currentRouteId,
36610
36670
  style: defaultPageStyle,
36611
36671
  children: (inLayoutTemplate) => {
36612
36672
  return /* @__PURE__ */ jsx3(Fragment, {
@@ -44446,7 +44506,11 @@ try {
44446
44506
  } catch {}
44447
44507
  var postLogEntry;
44448
44508
  try {
44449
- if (typeof window !== 'undefined' && !!window.postMessage && window.top !== window) {
44509
+ if (
44510
+ typeof window !== 'undefined' && !!window.postMessage && window.parent !== window &&
44511
+ // Don't post messages to the top-level site from the Editor Bar
44512
+ !window.location.pathname.startsWith('/edit',)
44513
+ ) {
44450
44514
  postLogEntry = (entry) => {
44451
44515
  var _a;
44452
44516
  try {
@@ -44460,7 +44524,7 @@ try {
44460
44524
  parts,
44461
44525
  printed,
44462
44526
  };
44463
- (_a = window.top) == null ? void 0 : _a.postMessage(data2, getServiceMap().app,);
44527
+ (_a = window.parent) == null ? void 0 : _a.postMessage(data2, getServiceMap().app,);
44464
44528
  } catch {}
44465
44529
  };
44466
44530
  }
@@ -45481,11 +45545,11 @@ function getAssetOwnerType(asset,) {
45481
45545
  async function loadFontsWithOpenType(source,) {
45482
45546
  switch (source) {
45483
45547
  case 'google': {
45484
- const supportedFonts = await import('./framer-chunks/google-3ASCFEEO-3R47BR2A.js');
45548
+ const supportedFonts = await import('./framer-chunks/google-2KFYDWCN-PJC2DDXK.js');
45485
45549
  return supportedFonts == null ? void 0 : supportedFonts.default;
45486
45550
  }
45487
45551
  case 'fontshare': {
45488
- const supportedFonts = await import('./framer-chunks/fontshare-4J2ZFRBB-H5VQLZTM.js');
45552
+ const supportedFonts = await import('./framer-chunks/fontshare-EOIRPPWV-VDFFNW4K.js');
45489
45553
  return supportedFonts == null ? void 0 : supportedFonts.default;
45490
45554
  }
45491
45555
  default:
@@ -45495,11 +45559,11 @@ async function loadFontsWithOpenType(source,) {
45495
45559
  async function loadFontToOpenTypeFeatures(source,) {
45496
45560
  switch (source) {
45497
45561
  case 'google': {
45498
- const features = await import('./framer-chunks/google-FDB6LUFQ-PFSUZGKF.js');
45562
+ const features = await import('./framer-chunks/google-HSMCYMMG-DWNQGSHN.js');
45499
45563
  return features == null ? void 0 : features.default;
45500
45564
  }
45501
45565
  case 'fontshare': {
45502
- const features = await import('./framer-chunks/fontshare-622CVMZZ-HFPH543A.js');
45566
+ const features = await import('./framer-chunks/fontshare-Y53BJZLK-EUQIV252.js');
45503
45567
  return features == null ? void 0 : features.default;
45504
45568
  }
45505
45569
  case 'framer': {
@@ -46047,10 +46111,10 @@ function loadVariationAxes(source,) {
46047
46111
  const axes = (async () => {
46048
46112
  switch (source) {
46049
46113
  case 'google': {
46050
- return (await import('./framer-chunks/google-C62SNV32-LCI4F7VO.js')).default;
46114
+ return (await import('./framer-chunks/google-S367OFIE-AWJEPMSF.js')).default;
46051
46115
  }
46052
46116
  case 'fontshare': {
46053
- return (await import('./framer-chunks/fontshare-JGEKH7YN-QOX3MC3K.js')).default;
46117
+ return (await import('./framer-chunks/fontshare-2X4LZ75B-D2V5BX73.js')).default;
46054
46118
  }
46055
46119
  default:
46056
46120
  assertNever(source,);
@@ -47143,12 +47207,35 @@ var Image2 = /* @__PURE__ */ React4.forwardRef(function Image3(props, ref,) {
47143
47207
  children,
47144
47208
  alt,
47145
47209
  draggable,
47210
+ fitImageDimension,
47146
47211
  style: styleFromProps,
47147
47212
  ...rest
47148
47213
  } = props;
47149
47214
  const style2 = {
47150
47215
  ...styleFromProps,
47151
47216
  };
47217
+ const intrinsicSize = useMemo2(() => getIntrinsicSizeForBackgroundImage(background,), [background,],);
47218
+ const [fallbackIntrinsicSize, setFallbackIntrinsicSize,] = useState();
47219
+ React4.useLayoutEffect(() => {
47220
+ if (!(background == null ? void 0 : background.src)) return;
47221
+ if (!fitImageDimension) return;
47222
+ if (intrinsicSize) return;
47223
+ const img = document.createElement('img',);
47224
+ img.onload = () => {
47225
+ if (img.naturalWidth && img.naturalHeight) {
47226
+ setFallbackIntrinsicSize({
47227
+ width: img.naturalWidth,
47228
+ height: img.naturalHeight,
47229
+ },);
47230
+ }
47231
+ };
47232
+ img.src = background.src;
47233
+ }, [background == null ? void 0 : background.src, fitImageDimension, intrinsicSize,],);
47234
+ const size = intrinsicSize ?? fallbackIntrinsicSize;
47235
+ if (fitImageDimension && size) {
47236
+ style2[fitImageDimension] = 'auto';
47237
+ style2.aspectRatio = size.width / size.height;
47238
+ }
47152
47239
  if (background) {
47153
47240
  delete style2.background;
47154
47241
  }
@@ -49408,7 +49495,7 @@ var TextComponent = /* @__PURE__ */ (() => {
49408
49495
  } = this.props;
49409
49496
  if (this.props.transformTemplate) return this.props.transformTemplate;
49410
49497
  const frame2 = this.frame;
49411
- const isDOMLayoutAutoSized = _usesDOMRect && (widthType === 2 || heightType === 2);
49498
+ const isDOMLayoutAutoSized = _usesDOMRect && (isAutoDimensionType(widthType,) || isAutoDimensionType(heightType,));
49412
49499
  const hasTransformTemplate = !frame2 || !RenderTarget.hasRestrictions() || __fromCanvasComponent || isDOMLayoutAutoSized;
49413
49500
  if (hasTransformTemplate) return transformTemplate(this.props.center,);
49414
49501
  }
@@ -50646,12 +50733,12 @@ var package_default = {
50646
50733
  '@types/dom-navigation': '^1.0.5',
50647
50734
  '@types/fontfaceobserver': '2.1',
50648
50735
  '@types/google.fonts': '1.0',
50649
- '@types/node': '22.16',
50736
+ '@types/node': '22.17',
50650
50737
  '@types/react': '18.2',
50651
50738
  '@types/react-dom': '18.2',
50652
50739
  '@types/yargs': '^17.0.33',
50653
- '@typescript-eslint/eslint-plugin': '^8.36.0',
50654
- '@typescript-eslint/parser': '^8.36.0',
50740
+ '@typescript-eslint/eslint-plugin': '^8.40.0',
50741
+ '@typescript-eslint/parser': '^8.40.0',
50655
50742
  chalk: '^4.1.2',
50656
50743
  eslint: '^8.57.1',
50657
50744
  'eslint-plugin-framer-studio': 'workspace:*',
@@ -50664,7 +50751,7 @@ var package_default = {
50664
50751
  react: '^18.2.0',
50665
50752
  'react-dom': '^18.2.0',
50666
50753
  semver: '^7.7.1',
50667
- typescript: '^5.8.3',
50754
+ typescript: '^5.9.2',
50668
50755
  yargs: '^17.7.2',
50669
50756
  },
50670
50757
  peerDependencies: {