@builder.io/sdk-solid 1.0.21 → 1.0.22

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/lib/edge/dev.jsx CHANGED
@@ -160,7 +160,8 @@ function isIframe() {
160
160
 
161
161
  // src/functions/is-editing.ts
162
162
  function isEditing(search) {
163
- return isIframe() && (TARGET === "reactNative" || getSearchString(search || window.location.search).indexOf("builder.frameEditing=") !== -1);
163
+ return isIframe() && (TARGET === "reactNative" || // accessing window.location.search is safe here because `isIframe()` is only `true` if we're in a browser.
164
+ getSearchString(search || window.location.search).indexOf("builder.frameEditing=") !== -1);
164
165
  }
165
166
 
166
167
  // src/functions/track/helpers.ts
@@ -3678,9 +3679,6 @@ function bindAnimations(animations) {
3678
3679
  case "pageLoad":
3679
3680
  triggerAnimation(animation);
3680
3681
  break;
3681
- case "hover":
3682
- bindHoverAnimation(animation);
3683
- break;
3684
3682
  case "scrollInView":
3685
3683
  bindScrollInViewAnimation(animation);
3686
3684
  break;
@@ -3739,33 +3737,6 @@ function triggerAnimation(animation) {
3739
3737
  });
3740
3738
  });
3741
3739
  }
3742
- function bindHoverAnimation(animation) {
3743
- const elements = Array.prototype.slice.call(document.getElementsByClassName(animation.elementId || animation.id || ""));
3744
- if (!elements.length) {
3745
- warnElementNotPresent(animation.elementId || animation.id || "");
3746
- return;
3747
- }
3748
- Array.from(elements).forEach((element) => {
3749
- augmentAnimation(animation, element);
3750
- const defaultState = animation.steps[0].styles;
3751
- const hoverState = animation.steps[1].styles;
3752
- function attachDefaultState() {
3753
- assign(element.style, defaultState);
3754
- }
3755
- function attachHoverState() {
3756
- assign(element.style, hoverState);
3757
- }
3758
- attachDefaultState();
3759
- element.addEventListener("mouseenter", attachHoverState);
3760
- element.addEventListener("mouseleave", attachDefaultState);
3761
- setTimeout(() => {
3762
- element.style.transition = `all ${animation.duration}s ${camelCaseToKebabCase(animation.easing)}`;
3763
- if (animation.delay) {
3764
- element.style.transitionDelay = animation.delay + "s";
3765
- }
3766
- });
3767
- });
3768
- }
3769
3740
  function bindScrollInViewAnimation(animation) {
3770
3741
  const elements = Array.prototype.slice.call(document.getElementsByClassName(animation.elementId || animation.id || ""));
3771
3742
  if (!elements.length) {
@@ -4076,7 +4047,27 @@ function BlockStyles(props) {
4076
4047
  sizesWithUpdatedBreakpoints
4077
4048
  )
4078
4049
  }) : "";
4079
- return [largeStylesClass, mediumStylesClass, smallStylesClass].join(" ");
4050
+ const hoverAnimation = processedBlock.animations && processedBlock.animations.find((item) => item.trigger === "hover");
4051
+ let hoverStylesClass = "";
4052
+ if (hoverAnimation) {
4053
+ const hoverStyles = hoverAnimation.steps?.[1]?.styles || {};
4054
+ hoverStylesClass = createCssClass({
4055
+ className: `${className}:hover`,
4056
+ styles: {
4057
+ ...hoverStyles,
4058
+ transition: `all ${hoverAnimation.duration}s ${camelCaseToKebabCase(
4059
+ hoverAnimation.easing
4060
+ )}`,
4061
+ transitionDelay: hoverAnimation.delay ? `${hoverAnimation.delay}s` : "0s"
4062
+ }
4063
+ }) || "";
4064
+ }
4065
+ return [
4066
+ largeStylesClass,
4067
+ mediumStylesClass,
4068
+ smallStylesClass,
4069
+ hoverStylesClass
4070
+ ].join(" ");
4080
4071
  });
4081
4072
  return <Show2 when={TARGET !== "reactNative" && css5() && canShowBlock()}><Inlined_styles_default id="builderio-block" styles={css5()} /></Show2>;
4082
4073
  }
@@ -4355,7 +4346,7 @@ function Block(props) {
4355
4346
  const animations = processedBlock().animations;
4356
4347
  if (animations && blockId) {
4357
4348
  bindAnimations(
4358
- animations.filter((item) => item.trigger !== "hover").map((animation) => ({
4349
+ animations.map((animation) => ({
4359
4350
  ...animation,
4360
4351
  elementId: blockId
4361
4352
  }))
@@ -6930,14 +6921,12 @@ async function fetchEntries(options) {
6930
6921
  }
6931
6922
 
6932
6923
  // src/functions/is-previewing.ts
6933
- function isPreviewing(search) {
6934
- if (!isBrowser()) {
6935
- return false;
6936
- }
6937
- const normalizedSearch = getSearchString(search || window.location.search);
6938
- if (isEditing(normalizedSearch)) {
6924
+ function isPreviewing(_search) {
6925
+ const search = _search || (isBrowser() ? window.location.search : void 0);
6926
+ if (!search) {
6939
6927
  return false;
6940
6928
  }
6929
+ const normalizedSearch = getSearchString(search);
6941
6930
  return Boolean(normalizedSearch.indexOf("builder.preview=") !== -1);
6942
6931
  }
6943
6932
 
@@ -7188,7 +7177,7 @@ function isFromTrustedHost(trustedHosts, e) {
7188
7177
  }
7189
7178
 
7190
7179
  // src/constants/sdk-version.ts
7191
- var SDK_VERSION = "1.0.21";
7180
+ var SDK_VERSION = "1.0.22";
7192
7181
 
7193
7182
  // src/functions/register.ts
7194
7183
  var registry = {};
@@ -7580,7 +7569,7 @@ function EnableEditor(props) {
7580
7569
  variationId: variationId !== contentId ? variationId : void 0
7581
7570
  });
7582
7571
  }
7583
- if (isPreviewing()) {
7572
+ if (isPreviewing() && !isEditing()) {
7584
7573
  const searchParams = new URL(location.href).searchParams;
7585
7574
  const searchParamPreviewModel = searchParams.get("builder.preview");
7586
7575
  const searchParamPreviewId = searchParams.get(
package/lib/edge/index.js CHANGED
@@ -170,7 +170,8 @@ function isIframe() {
170
170
 
171
171
  // src/functions/is-editing.ts
172
172
  function isEditing(search) {
173
- return isIframe() && (TARGET === "reactNative" || getSearchString(search || window.location.search).indexOf("builder.frameEditing=") !== -1);
173
+ return isIframe() && (TARGET === "reactNative" || // accessing window.location.search is safe here because `isIframe()` is only `true` if we're in a browser.
174
+ getSearchString(search || window.location.search).indexOf("builder.frameEditing=") !== -1);
174
175
  }
175
176
 
176
177
  // src/functions/track/helpers.ts
@@ -3687,9 +3688,6 @@ function bindAnimations(animations) {
3687
3688
  case "pageLoad":
3688
3689
  triggerAnimation(animation);
3689
3690
  break;
3690
- case "hover":
3691
- bindHoverAnimation(animation);
3692
- break;
3693
3691
  case "scrollInView":
3694
3692
  bindScrollInViewAnimation(animation);
3695
3693
  break;
@@ -3747,33 +3745,6 @@ function triggerAnimation(animation) {
3747
3745
  });
3748
3746
  });
3749
3747
  }
3750
- function bindHoverAnimation(animation) {
3751
- const elements = Array.prototype.slice.call(document.getElementsByClassName(animation.elementId || animation.id || ""));
3752
- if (!elements.length) {
3753
- warnElementNotPresent(animation.elementId || animation.id || "");
3754
- return;
3755
- }
3756
- Array.from(elements).forEach((element) => {
3757
- augmentAnimation(animation, element);
3758
- const defaultState = animation.steps[0].styles;
3759
- const hoverState = animation.steps[1].styles;
3760
- function attachDefaultState() {
3761
- assign(element.style, defaultState);
3762
- }
3763
- function attachHoverState() {
3764
- assign(element.style, hoverState);
3765
- }
3766
- attachDefaultState();
3767
- element.addEventListener("mouseenter", attachHoverState);
3768
- element.addEventListener("mouseleave", attachDefaultState);
3769
- setTimeout(() => {
3770
- element.style.transition = `all ${animation.duration}s ${camelCaseToKebabCase(animation.easing)}`;
3771
- if (animation.delay) {
3772
- element.style.transitionDelay = animation.delay + "s";
3773
- }
3774
- });
3775
- });
3776
- }
3777
3748
  function bindScrollInViewAnimation(animation) {
3778
3749
  const elements = Array.prototype.slice.call(document.getElementsByClassName(animation.elementId || animation.id || ""));
3779
3750
  if (!elements.length) {
@@ -4081,7 +4052,20 @@ function BlockStyles(props) {
4081
4052
  styles: smallStyles,
4082
4053
  mediaQuery: getMaxWidthQueryForSize("small", sizesWithUpdatedBreakpoints)
4083
4054
  }) : "";
4084
- return [largeStylesClass, mediumStylesClass, smallStylesClass].join(" ");
4055
+ const hoverAnimation = processedBlock.animations && processedBlock.animations.find((item) => item.trigger === "hover");
4056
+ let hoverStylesClass = "";
4057
+ if (hoverAnimation) {
4058
+ const hoverStyles = hoverAnimation.steps?.[1]?.styles || {};
4059
+ hoverStylesClass = createCssClass({
4060
+ className: `${className}:hover`,
4061
+ styles: {
4062
+ ...hoverStyles,
4063
+ transition: `all ${hoverAnimation.duration}s ${camelCaseToKebabCase(hoverAnimation.easing)}`,
4064
+ transitionDelay: hoverAnimation.delay ? `${hoverAnimation.delay}s` : "0s"
4065
+ }
4066
+ }) || "";
4067
+ }
4068
+ return [largeStylesClass, mediumStylesClass, smallStylesClass, hoverStylesClass].join(" ");
4085
4069
  });
4086
4070
  return createComponent(Show, {
4087
4071
  get when() {
@@ -4413,7 +4397,7 @@ function Block(props) {
4413
4397
  const blockId = processedBlock().id;
4414
4398
  const animations = processedBlock().animations;
4415
4399
  if (animations && blockId) {
4416
- bindAnimations(animations.filter((item) => item.trigger !== "hover").map((animation) => ({
4400
+ bindAnimations(animations.map((animation) => ({
4417
4401
  ...animation,
4418
4402
  elementId: blockId
4419
4403
  })));
@@ -7333,14 +7317,12 @@ async function fetchEntries(options) {
7333
7317
  }
7334
7318
 
7335
7319
  // src/functions/is-previewing.ts
7336
- function isPreviewing(search) {
7337
- if (!isBrowser()) {
7338
- return false;
7339
- }
7340
- const normalizedSearch = getSearchString(search || window.location.search);
7341
- if (isEditing(normalizedSearch)) {
7320
+ function isPreviewing(_search) {
7321
+ const search = _search || (isBrowser() ? window.location.search : void 0);
7322
+ if (!search) {
7342
7323
  return false;
7343
7324
  }
7325
+ const normalizedSearch = getSearchString(search);
7344
7326
  return Boolean(normalizedSearch.indexOf("builder.preview=") !== -1);
7345
7327
  }
7346
7328
 
@@ -7588,7 +7570,7 @@ function isFromTrustedHost(trustedHosts, e) {
7588
7570
  }
7589
7571
 
7590
7572
  // src/constants/sdk-version.ts
7591
- var SDK_VERSION = "1.0.21";
7573
+ var SDK_VERSION = "1.0.22";
7592
7574
 
7593
7575
  // src/functions/register.ts
7594
7576
  var registry = {};
@@ -7964,7 +7946,7 @@ function EnableEditor(props) {
7964
7946
  variationId: variationId !== contentId ? variationId : void 0
7965
7947
  });
7966
7948
  }
7967
- if (isPreviewing()) {
7949
+ if (isPreviewing() && !isEditing()) {
7968
7950
  const searchParams = new URL(location.href).searchParams;
7969
7951
  const searchParamPreviewModel = searchParams.get("builder.preview");
7970
7952
  const searchParamPreviewId = searchParams.get(`builder.preview.${searchParamPreviewModel}`);
@@ -159,7 +159,8 @@ function isIframe() {
159
159
 
160
160
  // src/functions/is-editing.ts
161
161
  function isEditing(search) {
162
- return isIframe() && (TARGET === "reactNative" || getSearchString(search || window.location.search).indexOf("builder.frameEditing=") !== -1);
162
+ return isIframe() && (TARGET === "reactNative" || // accessing window.location.search is safe here because `isIframe()` is only `true` if we're in a browser.
163
+ getSearchString(search || window.location.search).indexOf("builder.frameEditing=") !== -1);
163
164
  }
164
165
 
165
166
  // src/functions/track/helpers.ts
@@ -3676,9 +3677,6 @@ function bindAnimations(animations) {
3676
3677
  case "pageLoad":
3677
3678
  triggerAnimation(animation);
3678
3679
  break;
3679
- case "hover":
3680
- bindHoverAnimation(animation);
3681
- break;
3682
3680
  case "scrollInView":
3683
3681
  bindScrollInViewAnimation(animation);
3684
3682
  break;
@@ -3736,33 +3734,6 @@ function triggerAnimation(animation) {
3736
3734
  });
3737
3735
  });
3738
3736
  }
3739
- function bindHoverAnimation(animation) {
3740
- const elements = Array.prototype.slice.call(document.getElementsByClassName(animation.elementId || animation.id || ""));
3741
- if (!elements.length) {
3742
- warnElementNotPresent(animation.elementId || animation.id || "");
3743
- return;
3744
- }
3745
- Array.from(elements).forEach((element) => {
3746
- augmentAnimation(animation, element);
3747
- const defaultState = animation.steps[0].styles;
3748
- const hoverState = animation.steps[1].styles;
3749
- function attachDefaultState() {
3750
- assign(element.style, defaultState);
3751
- }
3752
- function attachHoverState() {
3753
- assign(element.style, hoverState);
3754
- }
3755
- attachDefaultState();
3756
- element.addEventListener("mouseenter", attachHoverState);
3757
- element.addEventListener("mouseleave", attachDefaultState);
3758
- setTimeout(() => {
3759
- element.style.transition = `all ${animation.duration}s ${camelCaseToKebabCase(animation.easing)}`;
3760
- if (animation.delay) {
3761
- element.style.transitionDelay = animation.delay + "s";
3762
- }
3763
- });
3764
- });
3765
- }
3766
3737
  function bindScrollInViewAnimation(animation) {
3767
3738
  const elements = Array.prototype.slice.call(document.getElementsByClassName(animation.elementId || animation.id || ""));
3768
3739
  if (!elements.length) {
@@ -4070,7 +4041,27 @@ function BlockStyles(props) {
4070
4041
  sizesWithUpdatedBreakpoints
4071
4042
  )
4072
4043
  }) : "";
4073
- return [largeStylesClass, mediumStylesClass, smallStylesClass].join(" ");
4044
+ const hoverAnimation = processedBlock.animations && processedBlock.animations.find((item) => item.trigger === "hover");
4045
+ let hoverStylesClass = "";
4046
+ if (hoverAnimation) {
4047
+ const hoverStyles = hoverAnimation.steps?.[1]?.styles || {};
4048
+ hoverStylesClass = createCssClass({
4049
+ className: `${className}:hover`,
4050
+ styles: {
4051
+ ...hoverStyles,
4052
+ transition: `all ${hoverAnimation.duration}s ${camelCaseToKebabCase(
4053
+ hoverAnimation.easing
4054
+ )}`,
4055
+ transitionDelay: hoverAnimation.delay ? `${hoverAnimation.delay}s` : "0s"
4056
+ }
4057
+ }) || "";
4058
+ }
4059
+ return [
4060
+ largeStylesClass,
4061
+ mediumStylesClass,
4062
+ smallStylesClass,
4063
+ hoverStylesClass
4064
+ ].join(" ");
4074
4065
  });
4075
4066
  return <Show2 when={TARGET !== "reactNative" && css5() && canShowBlock()}><Inlined_styles_default id="builderio-block" styles={css5()} /></Show2>;
4076
4067
  }
@@ -4349,7 +4340,7 @@ function Block(props) {
4349
4340
  const animations = processedBlock().animations;
4350
4341
  if (animations && blockId) {
4351
4342
  bindAnimations(
4352
- animations.filter((item) => item.trigger !== "hover").map((animation) => ({
4343
+ animations.map((animation) => ({
4353
4344
  ...animation,
4354
4345
  elementId: blockId
4355
4346
  }))
@@ -6918,14 +6909,12 @@ async function fetchEntries(options) {
6918
6909
  }
6919
6910
 
6920
6911
  // src/functions/is-previewing.ts
6921
- function isPreviewing(search) {
6922
- if (!isBrowser()) {
6923
- return false;
6924
- }
6925
- const normalizedSearch = getSearchString(search || window.location.search);
6926
- if (isEditing(normalizedSearch)) {
6912
+ function isPreviewing(_search) {
6913
+ const search = _search || (isBrowser() ? window.location.search : void 0);
6914
+ if (!search) {
6927
6915
  return false;
6928
6916
  }
6917
+ const normalizedSearch = getSearchString(search);
6929
6918
  return Boolean(normalizedSearch.indexOf("builder.preview=") !== -1);
6930
6919
  }
6931
6920
 
@@ -7173,7 +7162,7 @@ function isFromTrustedHost(trustedHosts, e) {
7173
7162
  }
7174
7163
 
7175
7164
  // src/constants/sdk-version.ts
7176
- var SDK_VERSION = "1.0.21";
7165
+ var SDK_VERSION = "1.0.22";
7177
7166
 
7178
7167
  // src/functions/register.ts
7179
7168
  var registry = {};
@@ -7563,7 +7552,7 @@ function EnableEditor(props) {
7563
7552
  variationId: variationId !== contentId ? variationId : void 0
7564
7553
  });
7565
7554
  }
7566
- if (isPreviewing()) {
7555
+ if (isPreviewing() && !isEditing()) {
7567
7556
  const searchParams = new URL(location.href).searchParams;
7568
7557
  const searchParamPreviewModel = searchParams.get("builder.preview");
7569
7558
  const searchParamPreviewId = searchParams.get(
package/lib/node/dev.js CHANGED
@@ -166,7 +166,8 @@ function isIframe() {
166
166
 
167
167
  // src/functions/is-editing.ts
168
168
  function isEditing(search) {
169
- return isIframe() && (TARGET === "reactNative" || getSearchString(search || window.location.search).indexOf("builder.frameEditing=") !== -1);
169
+ return isIframe() && (TARGET === "reactNative" || // accessing window.location.search is safe here because `isIframe()` is only `true` if we're in a browser.
170
+ getSearchString(search || window.location.search).indexOf("builder.frameEditing=") !== -1);
170
171
  }
171
172
 
172
173
  // src/functions/track/helpers.ts
@@ -681,9 +682,6 @@ function bindAnimations(animations) {
681
682
  case "pageLoad":
682
683
  triggerAnimation(animation);
683
684
  break;
684
- case "hover":
685
- bindHoverAnimation(animation);
686
- break;
687
685
  case "scrollInView":
688
686
  bindScrollInViewAnimation(animation);
689
687
  break;
@@ -742,33 +740,6 @@ function triggerAnimation(animation) {
742
740
  });
743
741
  });
744
742
  }
745
- function bindHoverAnimation(animation) {
746
- const elements = Array.prototype.slice.call(document.getElementsByClassName(animation.elementId || animation.id || ""));
747
- if (!elements.length) {
748
- warnElementNotPresent(animation.elementId || animation.id || "");
749
- return;
750
- }
751
- Array.from(elements).forEach((element) => {
752
- augmentAnimation(animation, element);
753
- const defaultState = animation.steps[0].styles;
754
- const hoverState = animation.steps[1].styles;
755
- function attachDefaultState() {
756
- assign(element.style, defaultState);
757
- }
758
- function attachHoverState() {
759
- assign(element.style, hoverState);
760
- }
761
- attachDefaultState();
762
- element.addEventListener("mouseenter", attachHoverState);
763
- element.addEventListener("mouseleave", attachDefaultState);
764
- setTimeout(() => {
765
- element.style.transition = `all ${animation.duration}s ${camelCaseToKebabCase(animation.easing)}`;
766
- if (animation.delay) {
767
- element.style.transitionDelay = animation.delay + "s";
768
- }
769
- });
770
- });
771
- }
772
743
  function bindScrollInViewAnimation(animation) {
773
744
  const elements = Array.prototype.slice.call(document.getElementsByClassName(animation.elementId || animation.id || ""));
774
745
  if (!elements.length) {
@@ -1079,7 +1050,20 @@ function BlockStyles(props) {
1079
1050
  styles: smallStyles,
1080
1051
  mediaQuery: getMaxWidthQueryForSize("small", sizesWithUpdatedBreakpoints)
1081
1052
  }) : "";
1082
- return [largeStylesClass, mediumStylesClass, smallStylesClass].join(" ");
1053
+ const hoverAnimation = processedBlock.animations && processedBlock.animations.find((item) => item.trigger === "hover");
1054
+ let hoverStylesClass = "";
1055
+ if (hoverAnimation) {
1056
+ const hoverStyles = hoverAnimation.steps?.[1]?.styles || {};
1057
+ hoverStylesClass = createCssClass({
1058
+ className: `${className}:hover`,
1059
+ styles: {
1060
+ ...hoverStyles,
1061
+ transition: `all ${hoverAnimation.duration}s ${camelCaseToKebabCase(hoverAnimation.easing)}`,
1062
+ transitionDelay: hoverAnimation.delay ? `${hoverAnimation.delay}s` : "0s"
1063
+ }
1064
+ }) || "";
1065
+ }
1066
+ return [largeStylesClass, mediumStylesClass, smallStylesClass, hoverStylesClass].join(" ");
1083
1067
  });
1084
1068
  return createComponent(Show, {
1085
1069
  get when() {
@@ -1411,7 +1395,7 @@ function Block(props) {
1411
1395
  const blockId = processedBlock().id;
1412
1396
  const animations = processedBlock().animations;
1413
1397
  if (animations && blockId) {
1414
- bindAnimations(animations.filter((item) => item.trigger !== "hover").map((animation) => ({
1398
+ bindAnimations(animations.map((animation) => ({
1415
1399
  ...animation,
1416
1400
  elementId: blockId
1417
1401
  })));
@@ -4337,14 +4321,12 @@ async function fetchEntries(options) {
4337
4321
  }
4338
4322
 
4339
4323
  // src/functions/is-previewing.ts
4340
- function isPreviewing(search) {
4341
- if (!isBrowser()) {
4342
- return false;
4343
- }
4344
- const normalizedSearch = getSearchString(search || window.location.search);
4345
- if (isEditing(normalizedSearch)) {
4324
+ function isPreviewing(_search) {
4325
+ const search = _search || (isBrowser() ? window.location.search : void 0);
4326
+ if (!search) {
4346
4327
  return false;
4347
4328
  }
4329
+ const normalizedSearch = getSearchString(search);
4348
4330
  return Boolean(normalizedSearch.indexOf("builder.preview=") !== -1);
4349
4331
  }
4350
4332
 
@@ -4595,7 +4577,7 @@ function isFromTrustedHost(trustedHosts, e) {
4595
4577
  }
4596
4578
 
4597
4579
  // src/constants/sdk-version.ts
4598
- var SDK_VERSION = "1.0.21";
4580
+ var SDK_VERSION = "1.0.22";
4599
4581
 
4600
4582
  // src/functions/register.ts
4601
4583
  var registry = {};
@@ -4973,7 +4955,7 @@ function EnableEditor(props) {
4973
4955
  variationId: variationId !== contentId ? variationId : void 0
4974
4956
  });
4975
4957
  }
4976
- if (isPreviewing()) {
4958
+ if (isPreviewing() && !isEditing()) {
4977
4959
  const searchParams = new URL(location.href).searchParams;
4978
4960
  const searchParamPreviewModel = searchParams.get("builder.preview");
4979
4961
  const searchParamPreviewId = searchParams.get(`builder.preview.${searchParamPreviewModel}`);
package/lib/node/dev.jsx CHANGED
@@ -152,7 +152,8 @@ function isIframe() {
152
152
 
153
153
  // src/functions/is-editing.ts
154
154
  function isEditing(search) {
155
- return isIframe() && (TARGET === "reactNative" || getSearchString(search || window.location.search).indexOf("builder.frameEditing=") !== -1);
155
+ return isIframe() && (TARGET === "reactNative" || // accessing window.location.search is safe here because `isIframe()` is only `true` if we're in a browser.
156
+ getSearchString(search || window.location.search).indexOf("builder.frameEditing=") !== -1);
156
157
  }
157
158
 
158
159
  // src/functions/track/helpers.ts
@@ -670,9 +671,6 @@ function bindAnimations(animations) {
670
671
  case "pageLoad":
671
672
  triggerAnimation(animation);
672
673
  break;
673
- case "hover":
674
- bindHoverAnimation(animation);
675
- break;
676
674
  case "scrollInView":
677
675
  bindScrollInViewAnimation(animation);
678
676
  break;
@@ -731,33 +729,6 @@ function triggerAnimation(animation) {
731
729
  });
732
730
  });
733
731
  }
734
- function bindHoverAnimation(animation) {
735
- const elements = Array.prototype.slice.call(document.getElementsByClassName(animation.elementId || animation.id || ""));
736
- if (!elements.length) {
737
- warnElementNotPresent(animation.elementId || animation.id || "");
738
- return;
739
- }
740
- Array.from(elements).forEach((element) => {
741
- augmentAnimation(animation, element);
742
- const defaultState = animation.steps[0].styles;
743
- const hoverState = animation.steps[1].styles;
744
- function attachDefaultState() {
745
- assign(element.style, defaultState);
746
- }
747
- function attachHoverState() {
748
- assign(element.style, hoverState);
749
- }
750
- attachDefaultState();
751
- element.addEventListener("mouseenter", attachHoverState);
752
- element.addEventListener("mouseleave", attachDefaultState);
753
- setTimeout(() => {
754
- element.style.transition = `all ${animation.duration}s ${camelCaseToKebabCase(animation.easing)}`;
755
- if (animation.delay) {
756
- element.style.transitionDelay = animation.delay + "s";
757
- }
758
- });
759
- });
760
- }
761
732
  function bindScrollInViewAnimation(animation) {
762
733
  const elements = Array.prototype.slice.call(document.getElementsByClassName(animation.elementId || animation.id || ""));
763
734
  if (!elements.length) {
@@ -1068,7 +1039,27 @@ function BlockStyles(props) {
1068
1039
  sizesWithUpdatedBreakpoints
1069
1040
  )
1070
1041
  }) : "";
1071
- return [largeStylesClass, mediumStylesClass, smallStylesClass].join(" ");
1042
+ const hoverAnimation = processedBlock.animations && processedBlock.animations.find((item) => item.trigger === "hover");
1043
+ let hoverStylesClass = "";
1044
+ if (hoverAnimation) {
1045
+ const hoverStyles = hoverAnimation.steps?.[1]?.styles || {};
1046
+ hoverStylesClass = createCssClass({
1047
+ className: `${className}:hover`,
1048
+ styles: {
1049
+ ...hoverStyles,
1050
+ transition: `all ${hoverAnimation.duration}s ${camelCaseToKebabCase(
1051
+ hoverAnimation.easing
1052
+ )}`,
1053
+ transitionDelay: hoverAnimation.delay ? `${hoverAnimation.delay}s` : "0s"
1054
+ }
1055
+ }) || "";
1056
+ }
1057
+ return [
1058
+ largeStylesClass,
1059
+ mediumStylesClass,
1060
+ smallStylesClass,
1061
+ hoverStylesClass
1062
+ ].join(" ");
1072
1063
  });
1073
1064
  return <Show2 when={TARGET !== "reactNative" && css5() && canShowBlock()}><Inlined_styles_default id="builderio-block" styles={css5()} /></Show2>;
1074
1065
  }
@@ -1347,7 +1338,7 @@ function Block(props) {
1347
1338
  const animations = processedBlock().animations;
1348
1339
  if (animations && blockId) {
1349
1340
  bindAnimations(
1350
- animations.filter((item) => item.trigger !== "hover").map((animation) => ({
1341
+ animations.map((animation) => ({
1351
1342
  ...animation,
1352
1343
  elementId: blockId
1353
1344
  }))
@@ -3922,14 +3913,12 @@ async function fetchEntries(options) {
3922
3913
  }
3923
3914
 
3924
3915
  // src/functions/is-previewing.ts
3925
- function isPreviewing(search) {
3926
- if (!isBrowser()) {
3927
- return false;
3928
- }
3929
- const normalizedSearch = getSearchString(search || window.location.search);
3930
- if (isEditing(normalizedSearch)) {
3916
+ function isPreviewing(_search) {
3917
+ const search = _search || (isBrowser() ? window.location.search : void 0);
3918
+ if (!search) {
3931
3919
  return false;
3932
3920
  }
3921
+ const normalizedSearch = getSearchString(search);
3933
3922
  return Boolean(normalizedSearch.indexOf("builder.preview=") !== -1);
3934
3923
  }
3935
3924
 
@@ -4180,7 +4169,7 @@ function isFromTrustedHost(trustedHosts, e) {
4180
4169
  }
4181
4170
 
4182
4171
  // src/constants/sdk-version.ts
4183
- var SDK_VERSION = "1.0.21";
4172
+ var SDK_VERSION = "1.0.22";
4184
4173
 
4185
4174
  // src/functions/register.ts
4186
4175
  var registry = {};
@@ -4572,7 +4561,7 @@ function EnableEditor(props) {
4572
4561
  variationId: variationId !== contentId ? variationId : void 0
4573
4562
  });
4574
4563
  }
4575
- if (isPreviewing()) {
4564
+ if (isPreviewing() && !isEditing()) {
4576
4565
  const searchParams = new URL(location.href).searchParams;
4577
4566
  const searchParamPreviewModel = searchParams.get("builder.preview");
4578
4567
  const searchParamPreviewId = searchParams.get(