@builder.io/sdk-solid 1.0.20 → 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/dist/index.d.ts +4 -4
- package/lib/browser/dev.js +23 -41
- package/lib/browser/dev.jsx +30 -41
- package/lib/browser/index.js +23 -41
- package/lib/browser/index.jsx +30 -41
- package/lib/edge/dev.js +23 -41
- package/lib/edge/dev.jsx +30 -41
- package/lib/edge/index.js +23 -41
- package/lib/edge/index.jsx +30 -41
- package/lib/node/dev.js +45 -43
- package/lib/node/dev.jsx +52 -43
- package/lib/node/index.js +46 -43
- package/lib/node/index.jsx +53 -43
- package/package.json +1 -1
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" ||
|
|
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
|
-
|
|
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.
|
|
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(
|
|
6934
|
-
|
|
6935
|
-
|
|
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.
|
|
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" ||
|
|
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
|
-
|
|
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.
|
|
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(
|
|
7337
|
-
|
|
7338
|
-
|
|
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.
|
|
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}`);
|
package/lib/edge/index.jsx
CHANGED
|
@@ -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" ||
|
|
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
|
-
|
|
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.
|
|
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(
|
|
6922
|
-
|
|
6923
|
-
|
|
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.
|
|
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" ||
|
|
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
|
|
@@ -381,8 +382,28 @@ if (typeof output === 'object' && output !== null) {
|
|
|
381
382
|
output;
|
|
382
383
|
`;
|
|
383
384
|
};
|
|
385
|
+
var IVM_INSTANCE = null;
|
|
386
|
+
var getIvm = () => {
|
|
387
|
+
try {
|
|
388
|
+
if (IVM_INSTANCE)
|
|
389
|
+
return IVM_INSTANCE;
|
|
390
|
+
const dynRequiredIvm = safeDynamicRequire("isolated-vm");
|
|
391
|
+
if (dynRequiredIvm)
|
|
392
|
+
return dynRequiredIvm;
|
|
393
|
+
} catch (error2) {
|
|
394
|
+
logger.error("isolated-vm import error.", error2);
|
|
395
|
+
}
|
|
396
|
+
throw new Error(`${MSG_PREFIX}could not import \`isolated-vm\` module for safe script execution on Node server.
|
|
397
|
+
|
|
398
|
+
In certain Node environments, the SDK requires additional initialization steps. This can be achieved by
|
|
399
|
+
importing and calling \`initializeNodeRuntime()\` from "@builder.io/sdk-react/node/init". This must be done in
|
|
400
|
+
a server-only execution path within your application.
|
|
401
|
+
|
|
402
|
+
Please see the documentation for more information: https://builder.io/c/docs/integration-tips#enabling-data-bindings-in-node-environments
|
|
403
|
+
`);
|
|
404
|
+
};
|
|
384
405
|
var getIsolateContext = () => {
|
|
385
|
-
const ivm =
|
|
406
|
+
const ivm = getIvm();
|
|
386
407
|
const isolate = new ivm.Isolate({
|
|
387
408
|
memoryLimit: 128
|
|
388
409
|
});
|
|
@@ -397,7 +418,7 @@ var runInNode = ({
|
|
|
397
418
|
rootSetState,
|
|
398
419
|
rootState
|
|
399
420
|
}) => {
|
|
400
|
-
const ivm =
|
|
421
|
+
const ivm = getIvm();
|
|
401
422
|
const state = fastClone({
|
|
402
423
|
...rootState,
|
|
403
424
|
...localState
|
|
@@ -661,9 +682,6 @@ function bindAnimations(animations) {
|
|
|
661
682
|
case "pageLoad":
|
|
662
683
|
triggerAnimation(animation);
|
|
663
684
|
break;
|
|
664
|
-
case "hover":
|
|
665
|
-
bindHoverAnimation(animation);
|
|
666
|
-
break;
|
|
667
685
|
case "scrollInView":
|
|
668
686
|
bindScrollInViewAnimation(animation);
|
|
669
687
|
break;
|
|
@@ -722,33 +740,6 @@ function triggerAnimation(animation) {
|
|
|
722
740
|
});
|
|
723
741
|
});
|
|
724
742
|
}
|
|
725
|
-
function bindHoverAnimation(animation) {
|
|
726
|
-
const elements = Array.prototype.slice.call(document.getElementsByClassName(animation.elementId || animation.id || ""));
|
|
727
|
-
if (!elements.length) {
|
|
728
|
-
warnElementNotPresent(animation.elementId || animation.id || "");
|
|
729
|
-
return;
|
|
730
|
-
}
|
|
731
|
-
Array.from(elements).forEach((element) => {
|
|
732
|
-
augmentAnimation(animation, element);
|
|
733
|
-
const defaultState = animation.steps[0].styles;
|
|
734
|
-
const hoverState = animation.steps[1].styles;
|
|
735
|
-
function attachDefaultState() {
|
|
736
|
-
assign(element.style, defaultState);
|
|
737
|
-
}
|
|
738
|
-
function attachHoverState() {
|
|
739
|
-
assign(element.style, hoverState);
|
|
740
|
-
}
|
|
741
|
-
attachDefaultState();
|
|
742
|
-
element.addEventListener("mouseenter", attachHoverState);
|
|
743
|
-
element.addEventListener("mouseleave", attachDefaultState);
|
|
744
|
-
setTimeout(() => {
|
|
745
|
-
element.style.transition = `all ${animation.duration}s ${camelCaseToKebabCase(animation.easing)}`;
|
|
746
|
-
if (animation.delay) {
|
|
747
|
-
element.style.transitionDelay = animation.delay + "s";
|
|
748
|
-
}
|
|
749
|
-
});
|
|
750
|
-
});
|
|
751
|
-
}
|
|
752
743
|
function bindScrollInViewAnimation(animation) {
|
|
753
744
|
const elements = Array.prototype.slice.call(document.getElementsByClassName(animation.elementId || animation.id || ""));
|
|
754
745
|
if (!elements.length) {
|
|
@@ -1059,7 +1050,20 @@ function BlockStyles(props) {
|
|
|
1059
1050
|
styles: smallStyles,
|
|
1060
1051
|
mediaQuery: getMaxWidthQueryForSize("small", sizesWithUpdatedBreakpoints)
|
|
1061
1052
|
}) : "";
|
|
1062
|
-
|
|
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(" ");
|
|
1063
1067
|
});
|
|
1064
1068
|
return createComponent(Show, {
|
|
1065
1069
|
get when() {
|
|
@@ -1391,7 +1395,7 @@ function Block(props) {
|
|
|
1391
1395
|
const blockId = processedBlock().id;
|
|
1392
1396
|
const animations = processedBlock().animations;
|
|
1393
1397
|
if (animations && blockId) {
|
|
1394
|
-
bindAnimations(animations.
|
|
1398
|
+
bindAnimations(animations.map((animation) => ({
|
|
1395
1399
|
...animation,
|
|
1396
1400
|
elementId: blockId
|
|
1397
1401
|
})));
|
|
@@ -4317,14 +4321,12 @@ async function fetchEntries(options) {
|
|
|
4317
4321
|
}
|
|
4318
4322
|
|
|
4319
4323
|
// src/functions/is-previewing.ts
|
|
4320
|
-
function isPreviewing(
|
|
4321
|
-
|
|
4322
|
-
|
|
4323
|
-
}
|
|
4324
|
-
const normalizedSearch = getSearchString(search || window.location.search);
|
|
4325
|
-
if (isEditing(normalizedSearch)) {
|
|
4324
|
+
function isPreviewing(_search) {
|
|
4325
|
+
const search = _search || (isBrowser() ? window.location.search : void 0);
|
|
4326
|
+
if (!search) {
|
|
4326
4327
|
return false;
|
|
4327
4328
|
}
|
|
4329
|
+
const normalizedSearch = getSearchString(search);
|
|
4328
4330
|
return Boolean(normalizedSearch.indexOf("builder.preview=") !== -1);
|
|
4329
4331
|
}
|
|
4330
4332
|
|
|
@@ -4575,7 +4577,7 @@ function isFromTrustedHost(trustedHosts, e) {
|
|
|
4575
4577
|
}
|
|
4576
4578
|
|
|
4577
4579
|
// src/constants/sdk-version.ts
|
|
4578
|
-
var SDK_VERSION = "1.0.
|
|
4580
|
+
var SDK_VERSION = "1.0.22";
|
|
4579
4581
|
|
|
4580
4582
|
// src/functions/register.ts
|
|
4581
4583
|
var registry = {};
|
|
@@ -4953,7 +4955,7 @@ function EnableEditor(props) {
|
|
|
4953
4955
|
variationId: variationId !== contentId ? variationId : void 0
|
|
4954
4956
|
});
|
|
4955
4957
|
}
|
|
4956
|
-
if (isPreviewing()) {
|
|
4958
|
+
if (isPreviewing() && !isEditing()) {
|
|
4957
4959
|
const searchParams = new URL(location.href).searchParams;
|
|
4958
4960
|
const searchParamPreviewModel = searchParams.get("builder.preview");
|
|
4959
4961
|
const searchParamPreviewId = searchParams.get(`builder.preview.${searchParamPreviewModel}`);
|