@builder.io/sdk-solid 4.0.10 → 4.1.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/lib/browser/dev.js +15 -2
- package/lib/browser/dev.jsx +48 -35
- package/lib/browser/index.js +15 -2
- package/lib/browser/index.jsx +48 -35
- package/lib/edge/dev.js +15 -2
- package/lib/edge/dev.jsx +48 -35
- package/lib/edge/index.js +15 -2
- package/lib/edge/index.jsx +48 -35
- package/lib/node/dev.js +15 -2
- package/lib/node/dev.jsx +48 -35
- package/lib/node/index.js +15 -2
- package/lib/node/index.jsx +48 -35
- package/package.json +1 -1
package/lib/edge/dev.jsx
CHANGED
|
@@ -5165,10 +5165,10 @@ function SectionComponent(props) {
|
|
|
5165
5165
|
var section_default = SectionComponent;
|
|
5166
5166
|
|
|
5167
5167
|
// src/blocks/symbol/symbol.tsx
|
|
5168
|
-
import { onMount as onMount10, on as on9, createEffect as createEffect9, createMemo as
|
|
5168
|
+
import { onMount as onMount10, on as on9, createEffect as createEffect9, createMemo as createMemo21, createSignal as createSignal21 } from "solid-js";
|
|
5169
5169
|
|
|
5170
5170
|
// src/components/content-variants/content-variants.tsx
|
|
5171
|
-
import { Show as Show16, For as For9, onMount as onMount9, createSignal as
|
|
5171
|
+
import { Show as Show16, For as For9, onMount as onMount9, createSignal as createSignal20, createMemo as createMemo20 } from "solid-js";
|
|
5172
5172
|
|
|
5173
5173
|
// src/blocks/personalization-container/helpers/inlined-fns.ts
|
|
5174
5174
|
function filterWithCustomTargeting(userAttributes, query, startDate, endDate) {
|
|
@@ -5591,7 +5591,7 @@ var getDefaultCanTrack = (canTrack) => {
|
|
|
5591
5591
|
};
|
|
5592
5592
|
|
|
5593
5593
|
// src/components/content/content.tsx
|
|
5594
|
-
import { Show as Show15, createSignal as
|
|
5594
|
+
import { Show as Show15, createSignal as createSignal19 } from "solid-js";
|
|
5595
5595
|
|
|
5596
5596
|
// src/blocks/accordion/component-info.ts
|
|
5597
5597
|
var defaultTitle = {
|
|
@@ -7787,8 +7787,20 @@ var componentInfo19 = {
|
|
|
7787
7787
|
};
|
|
7788
7788
|
|
|
7789
7789
|
// src/blocks/img/img.tsx
|
|
7790
|
+
import { createMemo as createMemo15 } from "solid-js";
|
|
7790
7791
|
function ImgComponent(props) {
|
|
7792
|
+
const srcSetToUse = createMemo15(() => {
|
|
7793
|
+
const url = props.imgSrc || props.image;
|
|
7794
|
+
if (!url || typeof url !== "string") {
|
|
7795
|
+
return void 0;
|
|
7796
|
+
}
|
|
7797
|
+
if (!url.match(/builder\.io/)) {
|
|
7798
|
+
return void 0;
|
|
7799
|
+
}
|
|
7800
|
+
return getSrcSet(url);
|
|
7801
|
+
});
|
|
7791
7802
|
return <><img
|
|
7803
|
+
loading="lazy"
|
|
7792
7804
|
style={{
|
|
7793
7805
|
"object-fit": props.backgroundSize || "cover",
|
|
7794
7806
|
"object-position": props.backgroundPosition || "center"
|
|
@@ -7796,6 +7808,7 @@ function ImgComponent(props) {
|
|
|
7796
7808
|
key={isEditing() && props.imgSrc || "default-key"}
|
|
7797
7809
|
alt={props.altText}
|
|
7798
7810
|
src={props.imgSrc || props.image}
|
|
7811
|
+
srcSet={srcSetToUse()}
|
|
7799
7812
|
{...{}}
|
|
7800
7813
|
{...props.attributes}
|
|
7801
7814
|
/></>;
|
|
@@ -7890,10 +7903,10 @@ var componentInfo20 = {
|
|
|
7890
7903
|
};
|
|
7891
7904
|
|
|
7892
7905
|
// src/blocks/video/video.tsx
|
|
7893
|
-
import { Show as Show13, onMount as onMount7, createSignal as
|
|
7906
|
+
import { Show as Show13, onMount as onMount7, createSignal as createSignal16, createMemo as createMemo16 } from "solid-js";
|
|
7894
7907
|
function Video(props) {
|
|
7895
|
-
const [lazyVideoObserver, setLazyVideoObserver] =
|
|
7896
|
-
const videoProps =
|
|
7908
|
+
const [lazyVideoObserver, setLazyVideoObserver] = createSignal16(void 0);
|
|
7909
|
+
const videoProps = createMemo16(() => {
|
|
7897
7910
|
return {
|
|
7898
7911
|
...props.autoPlay === true ? {
|
|
7899
7912
|
autoPlay: true
|
|
@@ -7912,7 +7925,7 @@ function Video(props) {
|
|
|
7912
7925
|
} : {}
|
|
7913
7926
|
};
|
|
7914
7927
|
});
|
|
7915
|
-
const spreadProps =
|
|
7928
|
+
const spreadProps = createMemo16(() => {
|
|
7916
7929
|
return {
|
|
7917
7930
|
...videoProps()
|
|
7918
7931
|
};
|
|
@@ -8152,8 +8165,8 @@ import {
|
|
|
8152
8165
|
onMount as onMount8,
|
|
8153
8166
|
on as on8,
|
|
8154
8167
|
createEffect as createEffect8,
|
|
8155
|
-
createMemo as
|
|
8156
|
-
createSignal as
|
|
8168
|
+
createMemo as createMemo17,
|
|
8169
|
+
createSignal as createSignal17
|
|
8157
8170
|
} from "solid-js";
|
|
8158
8171
|
import { Dynamic as Dynamic5 } from "solid-js/web";
|
|
8159
8172
|
|
|
@@ -8163,7 +8176,7 @@ function getPreviewContent(_searchParams) {
|
|
|
8163
8176
|
}
|
|
8164
8177
|
|
|
8165
8178
|
// src/constants/sdk-version.ts
|
|
8166
|
-
var SDK_VERSION = "4.
|
|
8179
|
+
var SDK_VERSION = "4.1.1";
|
|
8167
8180
|
|
|
8168
8181
|
// src/helpers/sdk-headers.ts
|
|
8169
8182
|
var getSdkHeaders = () => ({
|
|
@@ -9024,13 +9037,13 @@ var getWrapperClassName = (variationId) => {
|
|
|
9024
9037
|
|
|
9025
9038
|
// src/components/content/components/enable-editor.tsx
|
|
9026
9039
|
function EnableEditor(props) {
|
|
9027
|
-
const [hasExecuted, setHasExecuted] =
|
|
9028
|
-
const [ContentWrapper, setContentWrapper] =
|
|
9040
|
+
const [hasExecuted, setHasExecuted] = createSignal17(false);
|
|
9041
|
+
const [ContentWrapper, setContentWrapper] = createSignal17(
|
|
9029
9042
|
props.contentWrapper || "div"
|
|
9030
9043
|
);
|
|
9031
|
-
const [httpReqsData, setHttpReqsData] =
|
|
9032
|
-
const [httpReqsPending, setHttpReqsPending] =
|
|
9033
|
-
const [clicked, setClicked] =
|
|
9044
|
+
const [httpReqsData, setHttpReqsData] = createSignal17({});
|
|
9045
|
+
const [httpReqsPending, setHttpReqsPending] = createSignal17({});
|
|
9046
|
+
const [clicked, setClicked] = createSignal17(false);
|
|
9034
9047
|
function mergeNewRootState(newData) {
|
|
9035
9048
|
const combinedState = {
|
|
9036
9049
|
...props.builderContextSignal.rootState,
|
|
@@ -9064,7 +9077,7 @@ function EnableEditor(props) {
|
|
|
9064
9077
|
content: newContentValue
|
|
9065
9078
|
}));
|
|
9066
9079
|
}
|
|
9067
|
-
const showContentProps =
|
|
9080
|
+
const showContentProps = createMemo17(() => {
|
|
9068
9081
|
return props.showContent ? {} : {
|
|
9069
9082
|
hidden: true,
|
|
9070
9083
|
"aria-hidden": true
|
|
@@ -9249,14 +9262,14 @@ function EnableEditor(props) {
|
|
|
9249
9262
|
}
|
|
9250
9263
|
}
|
|
9251
9264
|
});
|
|
9252
|
-
const onUpdateFn_0_props_content =
|
|
9265
|
+
const onUpdateFn_0_props_content = createMemo17(() => props.content);
|
|
9253
9266
|
function onUpdateFn_0() {
|
|
9254
9267
|
if (props.content) {
|
|
9255
9268
|
mergeNewContent(props.content);
|
|
9256
9269
|
}
|
|
9257
9270
|
}
|
|
9258
9271
|
createEffect8(on8(() => [onUpdateFn_0_props_content()], onUpdateFn_0));
|
|
9259
|
-
const onUpdateFn_1_props_builderContextSignal_rootState =
|
|
9272
|
+
const onUpdateFn_1_props_builderContextSignal_rootState = createMemo17(
|
|
9260
9273
|
() => props.builderContextSignal.rootState
|
|
9261
9274
|
);
|
|
9262
9275
|
function onUpdateFn_1() {
|
|
@@ -9268,14 +9281,14 @@ function EnableEditor(props) {
|
|
|
9268
9281
|
onUpdateFn_1
|
|
9269
9282
|
)
|
|
9270
9283
|
);
|
|
9271
|
-
const onUpdateFn_2_props_data =
|
|
9284
|
+
const onUpdateFn_2_props_data = createMemo17(() => props.data);
|
|
9272
9285
|
function onUpdateFn_2() {
|
|
9273
9286
|
if (props.data) {
|
|
9274
9287
|
mergeNewRootState(props.data);
|
|
9275
9288
|
}
|
|
9276
9289
|
}
|
|
9277
9290
|
createEffect8(on8(() => [onUpdateFn_2_props_data()], onUpdateFn_2));
|
|
9278
|
-
const onUpdateFn_3_props_locale =
|
|
9291
|
+
const onUpdateFn_3_props_locale = createMemo17(() => props.locale);
|
|
9279
9292
|
function onUpdateFn_3() {
|
|
9280
9293
|
if (props.locale) {
|
|
9281
9294
|
mergeNewRootState({
|
|
@@ -9307,9 +9320,9 @@ function EnableEditor(props) {
|
|
|
9307
9320
|
var Enable_editor_default = EnableEditor;
|
|
9308
9321
|
|
|
9309
9322
|
// src/components/content/components/styles.tsx
|
|
9310
|
-
import { createSignal as
|
|
9323
|
+
import { createSignal as createSignal18 } from "solid-js";
|
|
9311
9324
|
function ContentStyles(props) {
|
|
9312
|
-
const [injectedStyles, setInjectedStyles] =
|
|
9325
|
+
const [injectedStyles, setInjectedStyles] = createSignal18(
|
|
9313
9326
|
`
|
|
9314
9327
|
${getCss({
|
|
9315
9328
|
cssCode: props.cssCode,
|
|
@@ -9367,7 +9380,7 @@ var getContentInitialValue = ({
|
|
|
9367
9380
|
|
|
9368
9381
|
// src/components/content/content.tsx
|
|
9369
9382
|
function ContentComponent(props) {
|
|
9370
|
-
const [scriptStr, setScriptStr] =
|
|
9383
|
+
const [scriptStr, setScriptStr] = createSignal19(
|
|
9371
9384
|
getUpdateVariantVisibilityScript({
|
|
9372
9385
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
|
|
9373
9386
|
variationId: props.content?.testVariationId,
|
|
@@ -9375,7 +9388,7 @@ function ContentComponent(props) {
|
|
|
9375
9388
|
contentId: props.content?.id
|
|
9376
9389
|
})
|
|
9377
9390
|
);
|
|
9378
|
-
const [registeredComponents, setRegisteredComponents] =
|
|
9391
|
+
const [registeredComponents, setRegisteredComponents] = createSignal19(
|
|
9379
9392
|
[
|
|
9380
9393
|
...getDefaultRegisteredComponents(),
|
|
9381
9394
|
...props.customComponents || []
|
|
@@ -9390,7 +9403,7 @@ function ContentComponent(props) {
|
|
|
9390
9403
|
{}
|
|
9391
9404
|
)
|
|
9392
9405
|
);
|
|
9393
|
-
const [builderContextSignal, setBuilderContextSignal] =
|
|
9406
|
+
const [builderContextSignal, setBuilderContextSignal] = createSignal19({
|
|
9394
9407
|
content: getContentInitialValue({
|
|
9395
9408
|
content: props.content,
|
|
9396
9409
|
data: props.data
|
|
@@ -9498,13 +9511,13 @@ var Content_default = ContentComponent;
|
|
|
9498
9511
|
|
|
9499
9512
|
// src/components/content-variants/content-variants.tsx
|
|
9500
9513
|
function ContentVariants(props) {
|
|
9501
|
-
const [shouldRenderVariants, setShouldRenderVariants] =
|
|
9514
|
+
const [shouldRenderVariants, setShouldRenderVariants] = createSignal20(
|
|
9502
9515
|
checkShouldRenderVariants2({
|
|
9503
9516
|
canTrack: getDefaultCanTrack(props.canTrack),
|
|
9504
9517
|
content: props.content
|
|
9505
9518
|
})
|
|
9506
9519
|
);
|
|
9507
|
-
const updateCookieAndStylesScriptStr =
|
|
9520
|
+
const updateCookieAndStylesScriptStr = createMemo20(() => {
|
|
9508
9521
|
return getUpdateCookieAndStylesScript(
|
|
9509
9522
|
getVariants(props.content).map((value) => ({
|
|
9510
9523
|
id: value.testVariationId,
|
|
@@ -9513,10 +9526,10 @@ function ContentVariants(props) {
|
|
|
9513
9526
|
props.content?.id || ""
|
|
9514
9527
|
);
|
|
9515
9528
|
});
|
|
9516
|
-
const hideVariantsStyleString =
|
|
9529
|
+
const hideVariantsStyleString = createMemo20(() => {
|
|
9517
9530
|
return getVariants(props.content).map((value) => `.variant-${value.testVariationId} { display: none; } `).join("");
|
|
9518
9531
|
});
|
|
9519
|
-
const defaultContent =
|
|
9532
|
+
const defaultContent = createMemo20(() => {
|
|
9520
9533
|
return shouldRenderVariants() ? {
|
|
9521
9534
|
...props.content,
|
|
9522
9535
|
testVariationId: props.content?.id
|
|
@@ -9635,15 +9648,15 @@ var fetchSymbolContent = async ({
|
|
|
9635
9648
|
|
|
9636
9649
|
// src/blocks/symbol/symbol.tsx
|
|
9637
9650
|
function Symbol2(props) {
|
|
9638
|
-
const [contentToUse, setContentToUse] =
|
|
9639
|
-
const [symbolEntry, setSymbolEntry] =
|
|
9640
|
-
const blocksWrapper =
|
|
9651
|
+
const [contentToUse, setContentToUse] = createSignal21(props.symbol?.content);
|
|
9652
|
+
const [symbolEntry, setSymbolEntry] = createSignal21(props.symbol?.entry);
|
|
9653
|
+
const blocksWrapper = createMemo21(() => {
|
|
9641
9654
|
return "div";
|
|
9642
9655
|
});
|
|
9643
|
-
const contentWrapper =
|
|
9656
|
+
const contentWrapper = createMemo21(() => {
|
|
9644
9657
|
return "div";
|
|
9645
9658
|
});
|
|
9646
|
-
const className =
|
|
9659
|
+
const className = createMemo21(() => {
|
|
9647
9660
|
return [
|
|
9648
9661
|
...[props.attributes[getClassPropName()]],
|
|
9649
9662
|
"builder-symbol",
|
|
@@ -9666,7 +9679,7 @@ function Symbol2(props) {
|
|
|
9666
9679
|
}
|
|
9667
9680
|
onMount10(() => {
|
|
9668
9681
|
});
|
|
9669
|
-
const onUpdateFn_0_props_symbol =
|
|
9682
|
+
const onUpdateFn_0_props_symbol = createMemo21(() => props.symbol);
|
|
9670
9683
|
function onUpdateFn_0() {
|
|
9671
9684
|
setContent();
|
|
9672
9685
|
}
|
package/lib/edge/index.js
CHANGED
|
@@ -8267,8 +8267,18 @@ var componentInfo19 = {
|
|
|
8267
8267
|
noWrap: true,
|
|
8268
8268
|
static: true
|
|
8269
8269
|
};
|
|
8270
|
-
var _tmpl$20 = /* @__PURE__ */ template(`<img>`);
|
|
8270
|
+
var _tmpl$20 = /* @__PURE__ */ template(`<img loading=lazy>`);
|
|
8271
8271
|
function ImgComponent(props) {
|
|
8272
|
+
const srcSetToUse = createMemo(() => {
|
|
8273
|
+
const url = props.imgSrc || props.image;
|
|
8274
|
+
if (!url || typeof url !== "string") {
|
|
8275
|
+
return void 0;
|
|
8276
|
+
}
|
|
8277
|
+
if (!url.match(/builder\.io/)) {
|
|
8278
|
+
return void 0;
|
|
8279
|
+
}
|
|
8280
|
+
return getSrcSet(url);
|
|
8281
|
+
});
|
|
8272
8282
|
return (() => {
|
|
8273
8283
|
const _el$ = _tmpl$20();
|
|
8274
8284
|
spread(_el$, mergeProps({
|
|
@@ -8286,6 +8296,9 @@ function ImgComponent(props) {
|
|
|
8286
8296
|
},
|
|
8287
8297
|
get src() {
|
|
8288
8298
|
return props.imgSrc || props.image;
|
|
8299
|
+
},
|
|
8300
|
+
get srcSet() {
|
|
8301
|
+
return srcSetToUse();
|
|
8289
8302
|
}
|
|
8290
8303
|
}, {}, () => props.attributes), false, false);
|
|
8291
8304
|
return _el$;
|
|
@@ -8656,7 +8669,7 @@ function getPreviewContent(_searchParams) {
|
|
|
8656
8669
|
}
|
|
8657
8670
|
|
|
8658
8671
|
// src/constants/sdk-version.ts
|
|
8659
|
-
var SDK_VERSION = "4.
|
|
8672
|
+
var SDK_VERSION = "4.1.1";
|
|
8660
8673
|
|
|
8661
8674
|
// src/helpers/sdk-headers.ts
|
|
8662
8675
|
var getSdkHeaders = () => ({
|
package/lib/edge/index.jsx
CHANGED
|
@@ -5157,10 +5157,10 @@ function SectionComponent(props) {
|
|
|
5157
5157
|
var section_default = SectionComponent;
|
|
5158
5158
|
|
|
5159
5159
|
// src/blocks/symbol/symbol.tsx
|
|
5160
|
-
import { onMount as onMount10, on as on9, createEffect as createEffect9, createMemo as
|
|
5160
|
+
import { onMount as onMount10, on as on9, createEffect as createEffect9, createMemo as createMemo21, createSignal as createSignal21 } from "solid-js";
|
|
5161
5161
|
|
|
5162
5162
|
// src/components/content-variants/content-variants.tsx
|
|
5163
|
-
import { Show as Show16, For as For9, onMount as onMount9, createSignal as
|
|
5163
|
+
import { Show as Show16, For as For9, onMount as onMount9, createSignal as createSignal20, createMemo as createMemo20 } from "solid-js";
|
|
5164
5164
|
|
|
5165
5165
|
// src/blocks/personalization-container/helpers/inlined-fns.ts
|
|
5166
5166
|
function filterWithCustomTargeting(userAttributes, query, startDate, endDate) {
|
|
@@ -5583,7 +5583,7 @@ var getDefaultCanTrack = (canTrack) => {
|
|
|
5583
5583
|
};
|
|
5584
5584
|
|
|
5585
5585
|
// src/components/content/content.tsx
|
|
5586
|
-
import { Show as Show15, createSignal as
|
|
5586
|
+
import { Show as Show15, createSignal as createSignal19 } from "solid-js";
|
|
5587
5587
|
|
|
5588
5588
|
// src/blocks/accordion/component-info.ts
|
|
5589
5589
|
var defaultTitle = {
|
|
@@ -7777,8 +7777,20 @@ var componentInfo19 = {
|
|
|
7777
7777
|
};
|
|
7778
7778
|
|
|
7779
7779
|
// src/blocks/img/img.tsx
|
|
7780
|
+
import { createMemo as createMemo15 } from "solid-js";
|
|
7780
7781
|
function ImgComponent(props) {
|
|
7782
|
+
const srcSetToUse = createMemo15(() => {
|
|
7783
|
+
const url = props.imgSrc || props.image;
|
|
7784
|
+
if (!url || typeof url !== "string") {
|
|
7785
|
+
return void 0;
|
|
7786
|
+
}
|
|
7787
|
+
if (!url.match(/builder\.io/)) {
|
|
7788
|
+
return void 0;
|
|
7789
|
+
}
|
|
7790
|
+
return getSrcSet(url);
|
|
7791
|
+
});
|
|
7781
7792
|
return <><img
|
|
7793
|
+
loading="lazy"
|
|
7782
7794
|
style={{
|
|
7783
7795
|
"object-fit": props.backgroundSize || "cover",
|
|
7784
7796
|
"object-position": props.backgroundPosition || "center"
|
|
@@ -7786,6 +7798,7 @@ function ImgComponent(props) {
|
|
|
7786
7798
|
key={isEditing() && props.imgSrc || "default-key"}
|
|
7787
7799
|
alt={props.altText}
|
|
7788
7800
|
src={props.imgSrc || props.image}
|
|
7801
|
+
srcSet={srcSetToUse()}
|
|
7789
7802
|
{...{}}
|
|
7790
7803
|
{...props.attributes}
|
|
7791
7804
|
/></>;
|
|
@@ -7880,10 +7893,10 @@ var componentInfo20 = {
|
|
|
7880
7893
|
};
|
|
7881
7894
|
|
|
7882
7895
|
// src/blocks/video/video.tsx
|
|
7883
|
-
import { Show as Show13, onMount as onMount7, createSignal as
|
|
7896
|
+
import { Show as Show13, onMount as onMount7, createSignal as createSignal16, createMemo as createMemo16 } from "solid-js";
|
|
7884
7897
|
function Video(props) {
|
|
7885
|
-
const [lazyVideoObserver, setLazyVideoObserver] =
|
|
7886
|
-
const videoProps =
|
|
7898
|
+
const [lazyVideoObserver, setLazyVideoObserver] = createSignal16(void 0);
|
|
7899
|
+
const videoProps = createMemo16(() => {
|
|
7887
7900
|
return {
|
|
7888
7901
|
...props.autoPlay === true ? {
|
|
7889
7902
|
autoPlay: true
|
|
@@ -7902,7 +7915,7 @@ function Video(props) {
|
|
|
7902
7915
|
} : {}
|
|
7903
7916
|
};
|
|
7904
7917
|
});
|
|
7905
|
-
const spreadProps =
|
|
7918
|
+
const spreadProps = createMemo16(() => {
|
|
7906
7919
|
return {
|
|
7907
7920
|
...videoProps()
|
|
7908
7921
|
};
|
|
@@ -8141,8 +8154,8 @@ import {
|
|
|
8141
8154
|
onMount as onMount8,
|
|
8142
8155
|
on as on8,
|
|
8143
8156
|
createEffect as createEffect8,
|
|
8144
|
-
createMemo as
|
|
8145
|
-
createSignal as
|
|
8157
|
+
createMemo as createMemo17,
|
|
8158
|
+
createSignal as createSignal17
|
|
8146
8159
|
} from "solid-js";
|
|
8147
8160
|
import { Dynamic as Dynamic5 } from "solid-js/web";
|
|
8148
8161
|
|
|
@@ -8152,7 +8165,7 @@ function getPreviewContent(_searchParams) {
|
|
|
8152
8165
|
}
|
|
8153
8166
|
|
|
8154
8167
|
// src/constants/sdk-version.ts
|
|
8155
|
-
var SDK_VERSION = "4.
|
|
8168
|
+
var SDK_VERSION = "4.1.1";
|
|
8156
8169
|
|
|
8157
8170
|
// src/helpers/sdk-headers.ts
|
|
8158
8171
|
var getSdkHeaders = () => ({
|
|
@@ -9007,13 +9020,13 @@ var getWrapperClassName = (variationId) => {
|
|
|
9007
9020
|
|
|
9008
9021
|
// src/components/content/components/enable-editor.tsx
|
|
9009
9022
|
function EnableEditor(props) {
|
|
9010
|
-
const [hasExecuted, setHasExecuted] =
|
|
9011
|
-
const [ContentWrapper, setContentWrapper] =
|
|
9023
|
+
const [hasExecuted, setHasExecuted] = createSignal17(false);
|
|
9024
|
+
const [ContentWrapper, setContentWrapper] = createSignal17(
|
|
9012
9025
|
props.contentWrapper || "div"
|
|
9013
9026
|
);
|
|
9014
|
-
const [httpReqsData, setHttpReqsData] =
|
|
9015
|
-
const [httpReqsPending, setHttpReqsPending] =
|
|
9016
|
-
const [clicked, setClicked] =
|
|
9027
|
+
const [httpReqsData, setHttpReqsData] = createSignal17({});
|
|
9028
|
+
const [httpReqsPending, setHttpReqsPending] = createSignal17({});
|
|
9029
|
+
const [clicked, setClicked] = createSignal17(false);
|
|
9017
9030
|
function mergeNewRootState(newData) {
|
|
9018
9031
|
const combinedState = {
|
|
9019
9032
|
...props.builderContextSignal.rootState,
|
|
@@ -9047,7 +9060,7 @@ function EnableEditor(props) {
|
|
|
9047
9060
|
content: newContentValue
|
|
9048
9061
|
}));
|
|
9049
9062
|
}
|
|
9050
|
-
const showContentProps =
|
|
9063
|
+
const showContentProps = createMemo17(() => {
|
|
9051
9064
|
return props.showContent ? {} : {
|
|
9052
9065
|
hidden: true,
|
|
9053
9066
|
"aria-hidden": true
|
|
@@ -9231,14 +9244,14 @@ function EnableEditor(props) {
|
|
|
9231
9244
|
}
|
|
9232
9245
|
}
|
|
9233
9246
|
});
|
|
9234
|
-
const onUpdateFn_0_props_content =
|
|
9247
|
+
const onUpdateFn_0_props_content = createMemo17(() => props.content);
|
|
9235
9248
|
function onUpdateFn_0() {
|
|
9236
9249
|
if (props.content) {
|
|
9237
9250
|
mergeNewContent(props.content);
|
|
9238
9251
|
}
|
|
9239
9252
|
}
|
|
9240
9253
|
createEffect8(on8(() => [onUpdateFn_0_props_content()], onUpdateFn_0));
|
|
9241
|
-
const onUpdateFn_1_props_builderContextSignal_rootState =
|
|
9254
|
+
const onUpdateFn_1_props_builderContextSignal_rootState = createMemo17(
|
|
9242
9255
|
() => props.builderContextSignal.rootState
|
|
9243
9256
|
);
|
|
9244
9257
|
function onUpdateFn_1() {
|
|
@@ -9250,14 +9263,14 @@ function EnableEditor(props) {
|
|
|
9250
9263
|
onUpdateFn_1
|
|
9251
9264
|
)
|
|
9252
9265
|
);
|
|
9253
|
-
const onUpdateFn_2_props_data =
|
|
9266
|
+
const onUpdateFn_2_props_data = createMemo17(() => props.data);
|
|
9254
9267
|
function onUpdateFn_2() {
|
|
9255
9268
|
if (props.data) {
|
|
9256
9269
|
mergeNewRootState(props.data);
|
|
9257
9270
|
}
|
|
9258
9271
|
}
|
|
9259
9272
|
createEffect8(on8(() => [onUpdateFn_2_props_data()], onUpdateFn_2));
|
|
9260
|
-
const onUpdateFn_3_props_locale =
|
|
9273
|
+
const onUpdateFn_3_props_locale = createMemo17(() => props.locale);
|
|
9261
9274
|
function onUpdateFn_3() {
|
|
9262
9275
|
if (props.locale) {
|
|
9263
9276
|
mergeNewRootState({
|
|
@@ -9289,9 +9302,9 @@ function EnableEditor(props) {
|
|
|
9289
9302
|
var Enable_editor_default = EnableEditor;
|
|
9290
9303
|
|
|
9291
9304
|
// src/components/content/components/styles.tsx
|
|
9292
|
-
import { createSignal as
|
|
9305
|
+
import { createSignal as createSignal18 } from "solid-js";
|
|
9293
9306
|
function ContentStyles(props) {
|
|
9294
|
-
const [injectedStyles, setInjectedStyles] =
|
|
9307
|
+
const [injectedStyles, setInjectedStyles] = createSignal18(
|
|
9295
9308
|
`
|
|
9296
9309
|
${getCss({
|
|
9297
9310
|
cssCode: props.cssCode,
|
|
@@ -9349,7 +9362,7 @@ var getContentInitialValue = ({
|
|
|
9349
9362
|
|
|
9350
9363
|
// src/components/content/content.tsx
|
|
9351
9364
|
function ContentComponent(props) {
|
|
9352
|
-
const [scriptStr, setScriptStr] =
|
|
9365
|
+
const [scriptStr, setScriptStr] = createSignal19(
|
|
9353
9366
|
getUpdateVariantVisibilityScript({
|
|
9354
9367
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
|
|
9355
9368
|
variationId: props.content?.testVariationId,
|
|
@@ -9357,7 +9370,7 @@ function ContentComponent(props) {
|
|
|
9357
9370
|
contentId: props.content?.id
|
|
9358
9371
|
})
|
|
9359
9372
|
);
|
|
9360
|
-
const [registeredComponents, setRegisteredComponents] =
|
|
9373
|
+
const [registeredComponents, setRegisteredComponents] = createSignal19(
|
|
9361
9374
|
[
|
|
9362
9375
|
...getDefaultRegisteredComponents(),
|
|
9363
9376
|
...props.customComponents || []
|
|
@@ -9372,7 +9385,7 @@ function ContentComponent(props) {
|
|
|
9372
9385
|
{}
|
|
9373
9386
|
)
|
|
9374
9387
|
);
|
|
9375
|
-
const [builderContextSignal, setBuilderContextSignal] =
|
|
9388
|
+
const [builderContextSignal, setBuilderContextSignal] = createSignal19({
|
|
9376
9389
|
content: getContentInitialValue({
|
|
9377
9390
|
content: props.content,
|
|
9378
9391
|
data: props.data
|
|
@@ -9480,13 +9493,13 @@ var Content_default = ContentComponent;
|
|
|
9480
9493
|
|
|
9481
9494
|
// src/components/content-variants/content-variants.tsx
|
|
9482
9495
|
function ContentVariants(props) {
|
|
9483
|
-
const [shouldRenderVariants, setShouldRenderVariants] =
|
|
9496
|
+
const [shouldRenderVariants, setShouldRenderVariants] = createSignal20(
|
|
9484
9497
|
checkShouldRenderVariants2({
|
|
9485
9498
|
canTrack: getDefaultCanTrack(props.canTrack),
|
|
9486
9499
|
content: props.content
|
|
9487
9500
|
})
|
|
9488
9501
|
);
|
|
9489
|
-
const updateCookieAndStylesScriptStr =
|
|
9502
|
+
const updateCookieAndStylesScriptStr = createMemo20(() => {
|
|
9490
9503
|
return getUpdateCookieAndStylesScript(
|
|
9491
9504
|
getVariants(props.content).map((value) => ({
|
|
9492
9505
|
id: value.testVariationId,
|
|
@@ -9495,10 +9508,10 @@ function ContentVariants(props) {
|
|
|
9495
9508
|
props.content?.id || ""
|
|
9496
9509
|
);
|
|
9497
9510
|
});
|
|
9498
|
-
const hideVariantsStyleString =
|
|
9511
|
+
const hideVariantsStyleString = createMemo20(() => {
|
|
9499
9512
|
return getVariants(props.content).map((value) => `.variant-${value.testVariationId} { display: none; } `).join("");
|
|
9500
9513
|
});
|
|
9501
|
-
const defaultContent =
|
|
9514
|
+
const defaultContent = createMemo20(() => {
|
|
9502
9515
|
return shouldRenderVariants() ? {
|
|
9503
9516
|
...props.content,
|
|
9504
9517
|
testVariationId: props.content?.id
|
|
@@ -9617,15 +9630,15 @@ var fetchSymbolContent = async ({
|
|
|
9617
9630
|
|
|
9618
9631
|
// src/blocks/symbol/symbol.tsx
|
|
9619
9632
|
function Symbol2(props) {
|
|
9620
|
-
const [contentToUse, setContentToUse] =
|
|
9621
|
-
const [symbolEntry, setSymbolEntry] =
|
|
9622
|
-
const blocksWrapper =
|
|
9633
|
+
const [contentToUse, setContentToUse] = createSignal21(props.symbol?.content);
|
|
9634
|
+
const [symbolEntry, setSymbolEntry] = createSignal21(props.symbol?.entry);
|
|
9635
|
+
const blocksWrapper = createMemo21(() => {
|
|
9623
9636
|
return "div";
|
|
9624
9637
|
});
|
|
9625
|
-
const contentWrapper =
|
|
9638
|
+
const contentWrapper = createMemo21(() => {
|
|
9626
9639
|
return "div";
|
|
9627
9640
|
});
|
|
9628
|
-
const className =
|
|
9641
|
+
const className = createMemo21(() => {
|
|
9629
9642
|
return [
|
|
9630
9643
|
...[props.attributes[getClassPropName()]],
|
|
9631
9644
|
"builder-symbol",
|
|
@@ -9648,7 +9661,7 @@ function Symbol2(props) {
|
|
|
9648
9661
|
}
|
|
9649
9662
|
onMount10(() => {
|
|
9650
9663
|
});
|
|
9651
|
-
const onUpdateFn_0_props_symbol =
|
|
9664
|
+
const onUpdateFn_0_props_symbol = createMemo21(() => props.symbol);
|
|
9652
9665
|
function onUpdateFn_0() {
|
|
9653
9666
|
setContent();
|
|
9654
9667
|
}
|
package/lib/node/dev.js
CHANGED
|
@@ -5267,8 +5267,18 @@ var componentInfo19 = {
|
|
|
5267
5267
|
noWrap: true,
|
|
5268
5268
|
static: true
|
|
5269
5269
|
};
|
|
5270
|
-
var _tmpl$20 = /* @__PURE__ */ template(`<img>`);
|
|
5270
|
+
var _tmpl$20 = /* @__PURE__ */ template(`<img loading=lazy>`);
|
|
5271
5271
|
function ImgComponent(props) {
|
|
5272
|
+
const srcSetToUse = createMemo(() => {
|
|
5273
|
+
const url = props.imgSrc || props.image;
|
|
5274
|
+
if (!url || typeof url !== "string") {
|
|
5275
|
+
return void 0;
|
|
5276
|
+
}
|
|
5277
|
+
if (!url.match(/builder\.io/)) {
|
|
5278
|
+
return void 0;
|
|
5279
|
+
}
|
|
5280
|
+
return getSrcSet(url);
|
|
5281
|
+
});
|
|
5272
5282
|
return (() => {
|
|
5273
5283
|
const _el$ = _tmpl$20();
|
|
5274
5284
|
spread(_el$, mergeProps({
|
|
@@ -5286,6 +5296,9 @@ function ImgComponent(props) {
|
|
|
5286
5296
|
},
|
|
5287
5297
|
get src() {
|
|
5288
5298
|
return props.imgSrc || props.image;
|
|
5299
|
+
},
|
|
5300
|
+
get srcSet() {
|
|
5301
|
+
return srcSetToUse();
|
|
5289
5302
|
}
|
|
5290
5303
|
}, {}, () => props.attributes), false, false);
|
|
5291
5304
|
return _el$;
|
|
@@ -5657,7 +5670,7 @@ function getPreviewContent(_searchParams) {
|
|
|
5657
5670
|
}
|
|
5658
5671
|
|
|
5659
5672
|
// src/constants/sdk-version.ts
|
|
5660
|
-
var SDK_VERSION = "4.
|
|
5673
|
+
var SDK_VERSION = "4.1.1";
|
|
5661
5674
|
|
|
5662
5675
|
// src/helpers/sdk-headers.ts
|
|
5663
5676
|
var getSdkHeaders = () => ({
|