@builder.io/sdk-solid 2.0.3 → 2.0.5
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 +3 -0
- package/lib/browser/dev.js +32 -9
- package/lib/browser/dev.jsx +89 -62
- package/lib/browser/index.js +32 -9
- package/lib/browser/index.jsx +89 -62
- package/lib/edge/dev.js +32 -9
- package/lib/edge/dev.jsx +89 -62
- package/lib/edge/index.js +32 -9
- package/lib/edge/index.jsx +89 -62
- package/lib/node/dev.js +32 -9
- package/lib/node/dev.jsx +89 -62
- package/lib/node/index.js +32 -9
- package/lib/node/index.jsx +89 -62
- package/package.json +1 -1
package/lib/edge/index.jsx
CHANGED
|
@@ -3666,6 +3666,9 @@ function assign(target, ..._args) {
|
|
|
3666
3666
|
return to;
|
|
3667
3667
|
}
|
|
3668
3668
|
function bindAnimations(animations) {
|
|
3669
|
+
if (TARGET === "reactNative") {
|
|
3670
|
+
return;
|
|
3671
|
+
}
|
|
3669
3672
|
for (const animation of animations) {
|
|
3670
3673
|
switch (animation.trigger) {
|
|
3671
3674
|
case "pageLoad":
|
|
@@ -4689,7 +4692,7 @@ function FragmentComponent(props) {
|
|
|
4689
4692
|
var fragment_default = FragmentComponent;
|
|
4690
4693
|
|
|
4691
4694
|
// src/blocks/image/image.tsx
|
|
4692
|
-
import { Show as Show7, createMemo as createMemo8 } from "solid-js";
|
|
4695
|
+
import { Show as Show7, onMount as onMount2, createMemo as createMemo8 } from "solid-js";
|
|
4693
4696
|
|
|
4694
4697
|
// src/blocks/image/image.helpers.ts
|
|
4695
4698
|
function removeProtocol(path) {
|
|
@@ -4778,12 +4781,14 @@ function Image(props) {
|
|
|
4778
4781
|
const out = props.aspectRatio ? aspectRatioStyles : void 0;
|
|
4779
4782
|
return out;
|
|
4780
4783
|
});
|
|
4784
|
+
onMount2(() => {
|
|
4785
|
+
});
|
|
4781
4786
|
return <>
|
|
4782
4787
|
<>
|
|
4783
4788
|
<picture>
|
|
4784
4789
|
<Show7 when={webpSrcSet()}><source type="image/webp" srcset={webpSrcSet()} /></Show7>
|
|
4785
4790
|
<img
|
|
4786
|
-
class={"builder-image" + (props.className ? " " + props.className : "") + " img-
|
|
4791
|
+
class={"builder-image" + (props.className ? " " + props.className : "") + " img-4512e110"}
|
|
4787
4792
|
loading={props.highPriority ? "eager" : "lazy"}
|
|
4788
4793
|
fetchpriority={props.highPriority ? "high" : "auto"}
|
|
4789
4794
|
alt={props.altText}
|
|
@@ -4801,22 +4806,22 @@ function Image(props) {
|
|
|
4801
4806
|
<Show7
|
|
4802
4807
|
when={props.aspectRatio && !(props.builderBlock?.children?.length && props.fitContent)}
|
|
4803
4808
|
><div
|
|
4804
|
-
class="builder-image-sizer div-
|
|
4809
|
+
class="builder-image-sizer div-4512e110"
|
|
4805
4810
|
style={{
|
|
4806
4811
|
"padding-top": props.aspectRatio * 100 + "%"
|
|
4807
4812
|
}}
|
|
4808
4813
|
/></Show7>
|
|
4809
4814
|
<Show7 when={props.builderBlock?.children?.length && props.fitContent}>{props.children}</Show7>
|
|
4810
|
-
<Show7 when={!props.fitContent && props.builderBlock?.children?.length}><div class="div-
|
|
4815
|
+
<Show7 when={!props.fitContent && props.builderBlock?.children?.length}><div class="div-4512e110-2">{props.children}</div></Show7>
|
|
4811
4816
|
</>
|
|
4812
|
-
<style>{`.img-
|
|
4817
|
+
<style>{`.img-4512e110 {
|
|
4813
4818
|
opacity: 1;
|
|
4814
4819
|
transition: opacity 0.2s ease-in-out;
|
|
4815
|
-
}.div-
|
|
4820
|
+
}.div-4512e110 {
|
|
4816
4821
|
width: 100%;
|
|
4817
4822
|
pointer-events: none;
|
|
4818
4823
|
font-size: 0;
|
|
4819
|
-
}.div-
|
|
4824
|
+
}.div-4512e110-2 {
|
|
4820
4825
|
display: flex;
|
|
4821
4826
|
flex-direction: column;
|
|
4822
4827
|
align-items: stretch;
|
|
@@ -4852,10 +4857,10 @@ function SectionComponent(props) {
|
|
|
4852
4857
|
var section_default = SectionComponent;
|
|
4853
4858
|
|
|
4854
4859
|
// src/blocks/symbol/symbol.tsx
|
|
4855
|
-
import { onMount as
|
|
4860
|
+
import { onMount as onMount6, on as on3, createEffect as createEffect3, createMemo as createMemo20, createSignal as createSignal20 } from "solid-js";
|
|
4856
4861
|
|
|
4857
4862
|
// src/components/content-variants/content-variants.tsx
|
|
4858
|
-
import { Show as Show14, For as For9, onMount as
|
|
4863
|
+
import { Show as Show14, For as For9, onMount as onMount5, createSignal as createSignal19, createMemo as createMemo19 } from "solid-js";
|
|
4859
4864
|
|
|
4860
4865
|
// src/helpers/url.ts
|
|
4861
4866
|
var getTopLevelDomain = (host) => {
|
|
@@ -5049,7 +5054,7 @@ var handleABTesting = async ({
|
|
|
5049
5054
|
var getDefaultCanTrack = (canTrack) => checkIsDefined(canTrack) ? canTrack : true;
|
|
5050
5055
|
|
|
5051
5056
|
// src/components/content/content.tsx
|
|
5052
|
-
import { Show as Show13, createSignal as
|
|
5057
|
+
import { Show as Show13, createSignal as createSignal18 } from "solid-js";
|
|
5053
5058
|
|
|
5054
5059
|
// src/blocks/accordion/component-info.ts
|
|
5055
5060
|
var defaultTitle = {
|
|
@@ -6062,7 +6067,8 @@ var tabs_default = Tabs;
|
|
|
6062
6067
|
// src/blocks/text/component-info.ts
|
|
6063
6068
|
var componentInfo10 = {
|
|
6064
6069
|
shouldReceiveBuilderProps: {
|
|
6065
|
-
builderBlock: TARGET === "reactNative" ? true : false
|
|
6070
|
+
builderBlock: TARGET === "reactNative" ? true : false,
|
|
6071
|
+
builderContext: true
|
|
6066
6072
|
},
|
|
6067
6073
|
name: "Text",
|
|
6068
6074
|
static: true,
|
|
@@ -6084,10 +6090,31 @@ var componentInfo10 = {
|
|
|
6084
6090
|
};
|
|
6085
6091
|
|
|
6086
6092
|
// src/blocks/text/text.tsx
|
|
6093
|
+
import { createMemo as createMemo11 } from "solid-js";
|
|
6087
6094
|
function Text(props) {
|
|
6095
|
+
const processedText = createMemo11(() => {
|
|
6096
|
+
const context = props.builderContext;
|
|
6097
|
+
const {
|
|
6098
|
+
context: contextContext,
|
|
6099
|
+
localState,
|
|
6100
|
+
rootState,
|
|
6101
|
+
rootSetState
|
|
6102
|
+
} = context;
|
|
6103
|
+
return String(props.text?.toString() || "").replace(
|
|
6104
|
+
/{{([^}]+)}}/g,
|
|
6105
|
+
(match, group) => evaluate({
|
|
6106
|
+
code: group,
|
|
6107
|
+
context: contextContext,
|
|
6108
|
+
localState,
|
|
6109
|
+
rootState,
|
|
6110
|
+
rootSetState,
|
|
6111
|
+
enableCache: false
|
|
6112
|
+
})
|
|
6113
|
+
);
|
|
6114
|
+
});
|
|
6088
6115
|
return <><div
|
|
6089
6116
|
class="builder-text"
|
|
6090
|
-
innerHTML={
|
|
6117
|
+
innerHTML={processedText()}
|
|
6091
6118
|
style={{
|
|
6092
6119
|
outline: "none"
|
|
6093
6120
|
}}
|
|
@@ -6121,12 +6148,12 @@ var componentInfo11 = {
|
|
|
6121
6148
|
};
|
|
6122
6149
|
|
|
6123
6150
|
// src/blocks/custom-code/custom-code.tsx
|
|
6124
|
-
import { onMount as
|
|
6151
|
+
import { onMount as onMount3, createSignal as createSignal12 } from "solid-js";
|
|
6125
6152
|
function CustomCode(props) {
|
|
6126
|
-
const [scriptsInserted, setScriptsInserted] =
|
|
6127
|
-
const [scriptsRun, setScriptsRun] =
|
|
6153
|
+
const [scriptsInserted, setScriptsInserted] = createSignal12([]);
|
|
6154
|
+
const [scriptsRun, setScriptsRun] = createSignal12([]);
|
|
6128
6155
|
let elementRef;
|
|
6129
|
-
|
|
6156
|
+
onMount3(() => {
|
|
6130
6157
|
if (!elementRef?.getElementsByTagName || typeof window === "undefined") {
|
|
6131
6158
|
return;
|
|
6132
6159
|
}
|
|
@@ -6185,7 +6212,7 @@ var componentInfo12 = {
|
|
|
6185
6212
|
};
|
|
6186
6213
|
|
|
6187
6214
|
// src/blocks/embed/embed.tsx
|
|
6188
|
-
import { on, createEffect, createMemo as
|
|
6215
|
+
import { on, createEffect, createMemo as createMemo13, createSignal as createSignal13 } from "solid-js";
|
|
6189
6216
|
|
|
6190
6217
|
// src/blocks/embed/helpers.ts
|
|
6191
6218
|
var SCRIPT_MIME_TYPES = ["text/javascript", "application/javascript", "application/ecmascript"];
|
|
@@ -6193,9 +6220,9 @@ var isJsScript = (script) => SCRIPT_MIME_TYPES.includes(script.type);
|
|
|
6193
6220
|
|
|
6194
6221
|
// src/blocks/embed/embed.tsx
|
|
6195
6222
|
function Embed(props) {
|
|
6196
|
-
const [scriptsInserted, setScriptsInserted] =
|
|
6197
|
-
const [scriptsRun, setScriptsRun] =
|
|
6198
|
-
const [ranInitFn, setRanInitFn] =
|
|
6223
|
+
const [scriptsInserted, setScriptsInserted] = createSignal13([]);
|
|
6224
|
+
const [scriptsRun, setScriptsRun] = createSignal13([]);
|
|
6225
|
+
const [ranInitFn, setRanInitFn] = createSignal13(false);
|
|
6199
6226
|
function findAndRunScripts() {
|
|
6200
6227
|
if (!elem || !elem.getElementsByTagName)
|
|
6201
6228
|
return;
|
|
@@ -6218,8 +6245,8 @@ function Embed(props) {
|
|
|
6218
6245
|
}
|
|
6219
6246
|
}
|
|
6220
6247
|
let elem;
|
|
6221
|
-
const onUpdateFn_0_elem =
|
|
6222
|
-
const onUpdateFn_0_ranInitFn__ =
|
|
6248
|
+
const onUpdateFn_0_elem = createMemo13(() => elem);
|
|
6249
|
+
const onUpdateFn_0_ranInitFn__ = createMemo13(() => ranInitFn());
|
|
6223
6250
|
function onUpdateFn_0() {
|
|
6224
6251
|
if (elem && !ranInitFn()) {
|
|
6225
6252
|
setRanInitFn(true);
|
|
@@ -6474,7 +6501,7 @@ var componentInfo13 = {
|
|
|
6474
6501
|
};
|
|
6475
6502
|
|
|
6476
6503
|
// src/blocks/form/form/form.tsx
|
|
6477
|
-
import { Show as Show10, For as For7, createSignal as
|
|
6504
|
+
import { Show as Show10, For as For7, createSignal as createSignal14 } from "solid-js";
|
|
6478
6505
|
|
|
6479
6506
|
// src/functions/get-env.ts
|
|
6480
6507
|
var validEnvList = ["production", "qa", "test", "development", "dev", "cdn-qa", "cloud", "fast", "cdn2", "cdn-prod"];
|
|
@@ -6491,9 +6518,9 @@ var get = (obj, path, defaultValue) => {
|
|
|
6491
6518
|
|
|
6492
6519
|
// src/blocks/form/form/form.tsx
|
|
6493
6520
|
function FormComponent(props) {
|
|
6494
|
-
const [formState, setFormState] =
|
|
6495
|
-
const [responseData, setResponseData] =
|
|
6496
|
-
const [formErrorMessage, setFormErrorMessage] =
|
|
6521
|
+
const [formState, setFormState] = createSignal14("unsubmitted");
|
|
6522
|
+
const [responseData, setResponseData] = createSignal14(null);
|
|
6523
|
+
const [formErrorMessage, setFormErrorMessage] = createSignal14("");
|
|
6497
6524
|
function mergeNewRootState(newData) {
|
|
6498
6525
|
const combinedState = {
|
|
6499
6526
|
...props.builderContext.rootState,
|
|
@@ -7066,9 +7093,9 @@ var componentInfo19 = {
|
|
|
7066
7093
|
};
|
|
7067
7094
|
|
|
7068
7095
|
// src/blocks/video/video.tsx
|
|
7069
|
-
import { Show as Show11, createMemo as
|
|
7096
|
+
import { Show as Show11, createMemo as createMemo15 } from "solid-js";
|
|
7070
7097
|
function Video(props) {
|
|
7071
|
-
const videoProps =
|
|
7098
|
+
const videoProps = createMemo15(() => {
|
|
7072
7099
|
return {
|
|
7073
7100
|
...props.autoPlay === true ? {
|
|
7074
7101
|
autoPlay: true
|
|
@@ -7087,7 +7114,7 @@ function Video(props) {
|
|
|
7087
7114
|
} : {}
|
|
7088
7115
|
};
|
|
7089
7116
|
});
|
|
7090
|
-
const spreadProps =
|
|
7117
|
+
const spreadProps = createMemo15(() => {
|
|
7091
7118
|
return {
|
|
7092
7119
|
...videoProps()
|
|
7093
7120
|
};
|
|
@@ -7293,11 +7320,11 @@ var Inlined_script_default = InlinedScript;
|
|
|
7293
7320
|
// src/components/content/components/enable-editor.tsx
|
|
7294
7321
|
import {
|
|
7295
7322
|
Show as Show12,
|
|
7296
|
-
onMount as
|
|
7323
|
+
onMount as onMount4,
|
|
7297
7324
|
on as on2,
|
|
7298
7325
|
createEffect as createEffect2,
|
|
7299
|
-
createMemo as
|
|
7300
|
-
createSignal as
|
|
7326
|
+
createMemo as createMemo16,
|
|
7327
|
+
createSignal as createSignal16
|
|
7301
7328
|
} from "solid-js";
|
|
7302
7329
|
import { Dynamic as Dynamic5 } from "solid-js/web";
|
|
7303
7330
|
|
|
@@ -7795,7 +7822,7 @@ function isFromTrustedHost(trustedHosts, e) {
|
|
|
7795
7822
|
}
|
|
7796
7823
|
|
|
7797
7824
|
// src/constants/sdk-version.ts
|
|
7798
|
-
var SDK_VERSION = "2.0.
|
|
7825
|
+
var SDK_VERSION = "2.0.5";
|
|
7799
7826
|
|
|
7800
7827
|
// src/functions/register.ts
|
|
7801
7828
|
var registry = {};
|
|
@@ -8072,12 +8099,12 @@ var getWrapperClassName = (variationId) => {
|
|
|
8072
8099
|
|
|
8073
8100
|
// src/components/content/components/enable-editor.tsx
|
|
8074
8101
|
function EnableEditor(props) {
|
|
8075
|
-
const [ContentWrapper, setContentWrapper] =
|
|
8102
|
+
const [ContentWrapper, setContentWrapper] = createSignal16(
|
|
8076
8103
|
props.contentWrapper || "div"
|
|
8077
8104
|
);
|
|
8078
|
-
const [httpReqsData, setHttpReqsData] =
|
|
8079
|
-
const [httpReqsPending, setHttpReqsPending] =
|
|
8080
|
-
const [clicked, setClicked] =
|
|
8105
|
+
const [httpReqsData, setHttpReqsData] = createSignal16({});
|
|
8106
|
+
const [httpReqsPending, setHttpReqsPending] = createSignal16({});
|
|
8107
|
+
const [clicked, setClicked] = createSignal16(false);
|
|
8081
8108
|
function mergeNewRootState(newData) {
|
|
8082
8109
|
const combinedState = {
|
|
8083
8110
|
...props.builderContextSignal.rootState,
|
|
@@ -8111,7 +8138,7 @@ function EnableEditor(props) {
|
|
|
8111
8138
|
content: newContentValue
|
|
8112
8139
|
}));
|
|
8113
8140
|
}
|
|
8114
|
-
const showContentProps =
|
|
8141
|
+
const showContentProps = createMemo16(() => {
|
|
8115
8142
|
return props.showContent ? {} : {
|
|
8116
8143
|
hidden: true,
|
|
8117
8144
|
"aria-hidden": true
|
|
@@ -8230,7 +8257,7 @@ function EnableEditor(props) {
|
|
|
8230
8257
|
}
|
|
8231
8258
|
}
|
|
8232
8259
|
let elementRef;
|
|
8233
|
-
|
|
8260
|
+
onMount4(() => {
|
|
8234
8261
|
if (isBrowser()) {
|
|
8235
8262
|
if (isEditing()) {
|
|
8236
8263
|
window.addEventListener("message", processMessage);
|
|
@@ -8291,7 +8318,7 @@ function EnableEditor(props) {
|
|
|
8291
8318
|
}
|
|
8292
8319
|
}
|
|
8293
8320
|
});
|
|
8294
|
-
|
|
8321
|
+
onMount4(() => {
|
|
8295
8322
|
if (!props.apiKey) {
|
|
8296
8323
|
logger.error(
|
|
8297
8324
|
"No API key provided to `Content` component. This can cause issues. Please provide an API key using the `apiKey` prop."
|
|
@@ -8301,14 +8328,14 @@ function EnableEditor(props) {
|
|
|
8301
8328
|
runHttpRequests();
|
|
8302
8329
|
emitStateUpdate();
|
|
8303
8330
|
});
|
|
8304
|
-
const onUpdateFn_0_props_content =
|
|
8331
|
+
const onUpdateFn_0_props_content = createMemo16(() => props.content);
|
|
8305
8332
|
function onUpdateFn_0() {
|
|
8306
8333
|
if (props.content) {
|
|
8307
8334
|
mergeNewContent(props.content);
|
|
8308
8335
|
}
|
|
8309
8336
|
}
|
|
8310
8337
|
createEffect2(on2(() => [onUpdateFn_0_props_content()], onUpdateFn_0));
|
|
8311
|
-
const onUpdateFn_1_props_builderContextSignal_content__data__jsCode =
|
|
8338
|
+
const onUpdateFn_1_props_builderContextSignal_content__data__jsCode = createMemo16(() => props.builderContextSignal.content?.data?.jsCode);
|
|
8312
8339
|
function onUpdateFn_1() {
|
|
8313
8340
|
evaluateJsCode();
|
|
8314
8341
|
}
|
|
@@ -8318,7 +8345,7 @@ function EnableEditor(props) {
|
|
|
8318
8345
|
onUpdateFn_1
|
|
8319
8346
|
)
|
|
8320
8347
|
);
|
|
8321
|
-
const onUpdateFn_2_props_builderContextSignal_content__data__httpRequests =
|
|
8348
|
+
const onUpdateFn_2_props_builderContextSignal_content__data__httpRequests = createMemo16(() => props.builderContextSignal.content?.data?.httpRequests);
|
|
8322
8349
|
function onUpdateFn_2() {
|
|
8323
8350
|
runHttpRequests();
|
|
8324
8351
|
}
|
|
@@ -8330,7 +8357,7 @@ function EnableEditor(props) {
|
|
|
8330
8357
|
onUpdateFn_2
|
|
8331
8358
|
)
|
|
8332
8359
|
);
|
|
8333
|
-
const onUpdateFn_3_props_builderContextSignal_rootState =
|
|
8360
|
+
const onUpdateFn_3_props_builderContextSignal_rootState = createMemo16(
|
|
8334
8361
|
() => props.builderContextSignal.rootState
|
|
8335
8362
|
);
|
|
8336
8363
|
function onUpdateFn_3() {
|
|
@@ -8342,14 +8369,14 @@ function EnableEditor(props) {
|
|
|
8342
8369
|
onUpdateFn_3
|
|
8343
8370
|
)
|
|
8344
8371
|
);
|
|
8345
|
-
const onUpdateFn_4_props_data =
|
|
8372
|
+
const onUpdateFn_4_props_data = createMemo16(() => props.data);
|
|
8346
8373
|
function onUpdateFn_4() {
|
|
8347
8374
|
if (props.data) {
|
|
8348
8375
|
mergeNewRootState(props.data);
|
|
8349
8376
|
}
|
|
8350
8377
|
}
|
|
8351
8378
|
createEffect2(on2(() => [onUpdateFn_4_props_data()], onUpdateFn_4));
|
|
8352
|
-
const onUpdateFn_5_props_locale =
|
|
8379
|
+
const onUpdateFn_5_props_locale = createMemo16(() => props.locale);
|
|
8353
8380
|
function onUpdateFn_5() {
|
|
8354
8381
|
if (props.locale) {
|
|
8355
8382
|
mergeNewRootState({
|
|
@@ -8376,9 +8403,9 @@ function EnableEditor(props) {
|
|
|
8376
8403
|
var Enable_editor_default = EnableEditor;
|
|
8377
8404
|
|
|
8378
8405
|
// src/components/content/components/styles.tsx
|
|
8379
|
-
import { createSignal as
|
|
8406
|
+
import { createSignal as createSignal17 } from "solid-js";
|
|
8380
8407
|
function ContentStyles(props) {
|
|
8381
|
-
const [injectedStyles, setInjectedStyles] =
|
|
8408
|
+
const [injectedStyles, setInjectedStyles] = createSignal17(
|
|
8382
8409
|
`
|
|
8383
8410
|
${getCss({
|
|
8384
8411
|
cssCode: props.cssCode,
|
|
@@ -8436,7 +8463,7 @@ var getContentInitialValue = ({
|
|
|
8436
8463
|
|
|
8437
8464
|
// src/components/content/content.tsx
|
|
8438
8465
|
function ContentComponent(props) {
|
|
8439
|
-
const [scriptStr, setScriptStr] =
|
|
8466
|
+
const [scriptStr, setScriptStr] = createSignal18(
|
|
8440
8467
|
getUpdateVariantVisibilityScript({
|
|
8441
8468
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
|
|
8442
8469
|
variationId: props.content?.testVariationId,
|
|
@@ -8444,7 +8471,7 @@ function ContentComponent(props) {
|
|
|
8444
8471
|
contentId: props.content?.id
|
|
8445
8472
|
})
|
|
8446
8473
|
);
|
|
8447
|
-
const [registeredComponents, setRegisteredComponents] =
|
|
8474
|
+
const [registeredComponents, setRegisteredComponents] = createSignal18(
|
|
8448
8475
|
[
|
|
8449
8476
|
...getDefaultRegisteredComponents(),
|
|
8450
8477
|
...props.customComponents?.filter(({ models }) => {
|
|
@@ -8465,7 +8492,7 @@ function ContentComponent(props) {
|
|
|
8465
8492
|
{}
|
|
8466
8493
|
)
|
|
8467
8494
|
);
|
|
8468
|
-
const [builderContextSignal, setBuilderContextSignal] =
|
|
8495
|
+
const [builderContextSignal, setBuilderContextSignal] = createSignal18({
|
|
8469
8496
|
content: getContentInitialValue({
|
|
8470
8497
|
content: props.content,
|
|
8471
8498
|
data: props.data
|
|
@@ -8555,13 +8582,13 @@ var Content_default = ContentComponent;
|
|
|
8555
8582
|
|
|
8556
8583
|
// src/components/content-variants/content-variants.tsx
|
|
8557
8584
|
function ContentVariants(props) {
|
|
8558
|
-
const [shouldRenderVariants, setShouldRenderVariants] =
|
|
8585
|
+
const [shouldRenderVariants, setShouldRenderVariants] = createSignal19(
|
|
8559
8586
|
checkShouldRenderVariants({
|
|
8560
8587
|
canTrack: getDefaultCanTrack(props.canTrack),
|
|
8561
8588
|
content: props.content
|
|
8562
8589
|
})
|
|
8563
8590
|
);
|
|
8564
|
-
const updateCookieAndStylesScriptStr =
|
|
8591
|
+
const updateCookieAndStylesScriptStr = createMemo19(() => {
|
|
8565
8592
|
return getUpdateCookieAndStylesScript(
|
|
8566
8593
|
getVariants(props.content).map((value) => ({
|
|
8567
8594
|
id: value.testVariationId,
|
|
@@ -8570,10 +8597,10 @@ function ContentVariants(props) {
|
|
|
8570
8597
|
props.content?.id || ""
|
|
8571
8598
|
);
|
|
8572
8599
|
});
|
|
8573
|
-
const hideVariantsStyleString =
|
|
8600
|
+
const hideVariantsStyleString = createMemo19(() => {
|
|
8574
8601
|
return getVariants(props.content).map((value) => `.variant-${value.testVariationId} { display: none; } `).join("");
|
|
8575
8602
|
});
|
|
8576
|
-
const defaultContent =
|
|
8603
|
+
const defaultContent = createMemo19(() => {
|
|
8577
8604
|
return shouldRenderVariants() ? {
|
|
8578
8605
|
...props.content,
|
|
8579
8606
|
testVariationId: props.content?.id
|
|
@@ -8582,7 +8609,7 @@ function ContentVariants(props) {
|
|
|
8582
8609
|
canTrack: getDefaultCanTrack(props.canTrack)
|
|
8583
8610
|
});
|
|
8584
8611
|
});
|
|
8585
|
-
|
|
8612
|
+
onMount5(() => {
|
|
8586
8613
|
setShouldRenderVariants(false);
|
|
8587
8614
|
});
|
|
8588
8615
|
return <><>
|
|
@@ -8682,14 +8709,14 @@ var fetchSymbolContent = async ({
|
|
|
8682
8709
|
|
|
8683
8710
|
// src/blocks/symbol/symbol.tsx
|
|
8684
8711
|
function Symbol2(props) {
|
|
8685
|
-
const [contentToUse, setContentToUse] =
|
|
8686
|
-
const blocksWrapper =
|
|
8712
|
+
const [contentToUse, setContentToUse] = createSignal20(props.symbol?.content);
|
|
8713
|
+
const blocksWrapper = createMemo20(() => {
|
|
8687
8714
|
return "div";
|
|
8688
8715
|
});
|
|
8689
|
-
const contentWrapper =
|
|
8716
|
+
const contentWrapper = createMemo20(() => {
|
|
8690
8717
|
return "div";
|
|
8691
8718
|
});
|
|
8692
|
-
const className =
|
|
8719
|
+
const className = createMemo20(() => {
|
|
8693
8720
|
return [
|
|
8694
8721
|
...[props.attributes[getClassPropName()]],
|
|
8695
8722
|
"builder-symbol",
|
|
@@ -8709,9 +8736,9 @@ function Symbol2(props) {
|
|
|
8709
8736
|
}
|
|
8710
8737
|
});
|
|
8711
8738
|
}
|
|
8712
|
-
|
|
8739
|
+
onMount6(() => {
|
|
8713
8740
|
});
|
|
8714
|
-
const onUpdateFn_0_props_symbol =
|
|
8741
|
+
const onUpdateFn_0_props_symbol = createMemo20(() => props.symbol);
|
|
8715
8742
|
function onUpdateFn_0() {
|
|
8716
8743
|
setContent();
|
|
8717
8744
|
}
|
package/lib/node/dev.js
CHANGED
|
@@ -703,6 +703,9 @@ function assign(target, ..._args) {
|
|
|
703
703
|
return to;
|
|
704
704
|
}
|
|
705
705
|
function bindAnimations(animations) {
|
|
706
|
+
if (TARGET === "reactNative") {
|
|
707
|
+
return;
|
|
708
|
+
}
|
|
706
709
|
for (const animation of animations) {
|
|
707
710
|
switch (animation.trigger) {
|
|
708
711
|
case "pageLoad":
|
|
@@ -1979,16 +1982,16 @@ function getSrcSet(url) {
|
|
|
1979
1982
|
// src/blocks/image/image.tsx
|
|
1980
1983
|
var _tmpl$5 = /* @__PURE__ */ template(`<source type=image/webp>`);
|
|
1981
1984
|
var _tmpl$23 = /* @__PURE__ */ template(`<picture><img>`);
|
|
1982
|
-
var _tmpl$32 = /* @__PURE__ */ template(`<div class="builder-image-sizer div-
|
|
1983
|
-
var _tmpl$42 = /* @__PURE__ */ template(`<div class=div-
|
|
1984
|
-
var _tmpl$52 = /* @__PURE__ */ template(`<style>.img-
|
|
1985
|
+
var _tmpl$32 = /* @__PURE__ */ template(`<div class="builder-image-sizer div-4512e110">`);
|
|
1986
|
+
var _tmpl$42 = /* @__PURE__ */ template(`<div class=div-4512e110-2>`);
|
|
1987
|
+
var _tmpl$52 = /* @__PURE__ */ template(`<style>.img-4512e110 {
|
|
1985
1988
|
opacity: 1;
|
|
1986
1989
|
transition: opacity 0.2s ease-in-out;
|
|
1987
|
-
}.div-
|
|
1990
|
+
}.div-4512e110 {
|
|
1988
1991
|
width: 100%;
|
|
1989
1992
|
pointer-events: none;
|
|
1990
1993
|
font-size: 0;
|
|
1991
|
-
}.div-
|
|
1994
|
+
}.div-4512e110-2 {
|
|
1992
1995
|
display: flex;
|
|
1993
1996
|
flex-direction: column;
|
|
1994
1997
|
align-items: stretch;
|
|
@@ -2038,6 +2041,8 @@ function Image(props) {
|
|
|
2038
2041
|
const out = props.aspectRatio ? aspectRatioStyles : void 0;
|
|
2039
2042
|
return out;
|
|
2040
2043
|
});
|
|
2044
|
+
onMount(() => {
|
|
2045
|
+
});
|
|
2041
2046
|
return [[(() => {
|
|
2042
2047
|
const _el$ = _tmpl$23(), _el$3 = _el$.firstChild;
|
|
2043
2048
|
insert(_el$, createComponent(Show, {
|
|
@@ -2051,7 +2056,7 @@ function Image(props) {
|
|
|
2051
2056
|
}
|
|
2052
2057
|
}), _el$3);
|
|
2053
2058
|
effect((_p$) => {
|
|
2054
|
-
const _v$ = "builder-image" + (props.className ? " " + props.className : "") + " img-
|
|
2059
|
+
const _v$ = "builder-image" + (props.className ? " " + props.className : "") + " img-4512e110", _v$2 = props.highPriority ? "eager" : "lazy", _v$3 = props.highPriority ? "high" : "auto", _v$4 = props.altText, _v$5 = props.altText ? void 0 : "presentation", _v$6 = {
|
|
2055
2060
|
"object-position": props.backgroundPosition || "center",
|
|
2056
2061
|
"object-fit": props.backgroundSize || "cover",
|
|
2057
2062
|
...aspectRatioCss()
|
|
@@ -3422,7 +3427,8 @@ delegateEvents(["click"]);
|
|
|
3422
3427
|
// src/blocks/text/component-info.ts
|
|
3423
3428
|
var componentInfo10 = {
|
|
3424
3429
|
shouldReceiveBuilderProps: {
|
|
3425
|
-
builderBlock: TARGET === "reactNative" ? true : false
|
|
3430
|
+
builderBlock: TARGET === "reactNative" ? true : false,
|
|
3431
|
+
builderContext: true
|
|
3426
3432
|
},
|
|
3427
3433
|
name: "Text",
|
|
3428
3434
|
static: true,
|
|
@@ -3444,10 +3450,27 @@ var componentInfo10 = {
|
|
|
3444
3450
|
};
|
|
3445
3451
|
var _tmpl$10 = /* @__PURE__ */ template(`<div class=builder-text>`);
|
|
3446
3452
|
function Text(props) {
|
|
3453
|
+
const processedText = createMemo(() => {
|
|
3454
|
+
const context = props.builderContext;
|
|
3455
|
+
const {
|
|
3456
|
+
context: contextContext,
|
|
3457
|
+
localState,
|
|
3458
|
+
rootState,
|
|
3459
|
+
rootSetState
|
|
3460
|
+
} = context;
|
|
3461
|
+
return String(props.text?.toString() || "").replace(/{{([^}]+)}}/g, (match, group) => evaluate({
|
|
3462
|
+
code: group,
|
|
3463
|
+
context: contextContext,
|
|
3464
|
+
localState,
|
|
3465
|
+
rootState,
|
|
3466
|
+
rootSetState,
|
|
3467
|
+
enableCache: false
|
|
3468
|
+
}));
|
|
3469
|
+
});
|
|
3447
3470
|
return (() => {
|
|
3448
3471
|
const _el$ = _tmpl$10();
|
|
3449
3472
|
_el$.style.setProperty("outline", "none");
|
|
3450
|
-
effect(() => _el$.innerHTML =
|
|
3473
|
+
effect(() => _el$.innerHTML = processedText());
|
|
3451
3474
|
return _el$;
|
|
3452
3475
|
})();
|
|
3453
3476
|
}
|
|
@@ -5319,7 +5342,7 @@ function isFromTrustedHost(trustedHosts, e) {
|
|
|
5319
5342
|
}
|
|
5320
5343
|
|
|
5321
5344
|
// src/constants/sdk-version.ts
|
|
5322
|
-
var SDK_VERSION = "2.0.
|
|
5345
|
+
var SDK_VERSION = "2.0.5";
|
|
5323
5346
|
|
|
5324
5347
|
// src/functions/register.ts
|
|
5325
5348
|
var registry = {};
|