@builder.io/sdk-solid 1.0.12 → 1.0.14
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 +1 -1
- package/lib/browser/dev.js +45 -44
- package/lib/browser/dev.jsx +41 -49
- package/lib/browser/index.js +45 -44
- package/lib/browser/index.jsx +41 -49
- package/lib/edge/dev.js +45 -44
- package/lib/edge/dev.jsx +41 -49
- package/lib/edge/index.js +45 -44
- package/lib/edge/index.jsx +41 -49
- package/lib/node/dev.js +45 -44
- package/lib/node/dev.jsx +41 -49
- package/lib/node/index.js +45 -44
- package/lib/node/index.jsx +41 -49
- package/package.json +1 -1
package/lib/edge/index.js
CHANGED
|
@@ -7584,7 +7584,7 @@ function isFromTrustedHost(trustedHosts, e) {
|
|
|
7584
7584
|
}
|
|
7585
7585
|
|
|
7586
7586
|
// src/constants/sdk-version.ts
|
|
7587
|
-
var SDK_VERSION = "1.0.
|
|
7587
|
+
var SDK_VERSION = "1.0.14";
|
|
7588
7588
|
|
|
7589
7589
|
// src/functions/register.ts
|
|
7590
7590
|
var registry = {};
|
|
@@ -7782,10 +7782,6 @@ var subscribeToEditor = (model, callback, options) => {
|
|
|
7782
7782
|
|
|
7783
7783
|
// src/components/content/components/enable-editor.tsx
|
|
7784
7784
|
function EnableEditor(props) {
|
|
7785
|
-
const [forceReRenderCount, setForceReRenderCount] = createSignal(0);
|
|
7786
|
-
createSignal(true);
|
|
7787
|
-
createSignal(0);
|
|
7788
|
-
const [shouldSendResetCookie, setShouldSendResetCookie] = createSignal(false);
|
|
7789
7785
|
const [ContentWrapper, setContentWrapper] = createSignal(props.contentWrapper || "div");
|
|
7790
7786
|
const [httpReqsData, setHttpReqsData] = createSignal({});
|
|
7791
7787
|
const [clicked, setClicked] = createSignal(false);
|
|
@@ -7841,7 +7837,6 @@ function EnableEditor(props) {
|
|
|
7841
7837
|
breakpoints
|
|
7842
7838
|
}
|
|
7843
7839
|
});
|
|
7844
|
-
setForceReRenderCount(forceReRenderCount() + 1);
|
|
7845
7840
|
}
|
|
7846
7841
|
},
|
|
7847
7842
|
animation: (animation) => {
|
|
@@ -7849,7 +7844,6 @@ function EnableEditor(props) {
|
|
|
7849
7844
|
},
|
|
7850
7845
|
contentUpdate: (newContent) => {
|
|
7851
7846
|
mergeNewContent(newContent);
|
|
7852
|
-
setForceReRenderCount(forceReRenderCount() + 1);
|
|
7853
7847
|
}
|
|
7854
7848
|
}
|
|
7855
7849
|
})(event);
|
|
@@ -7940,7 +7934,6 @@ function EnableEditor(props) {
|
|
|
7940
7934
|
onMount(() => {
|
|
7941
7935
|
if (isBrowser()) {
|
|
7942
7936
|
if (isEditing()) {
|
|
7943
|
-
setForceReRenderCount(forceReRenderCount() + 1);
|
|
7944
7937
|
window.addEventListener("message", processMessage);
|
|
7945
7938
|
registerInsertMenu();
|
|
7946
7939
|
setupBrowserForEditing({
|
|
@@ -8007,41 +8000,37 @@ function EnableEditor(props) {
|
|
|
8007
8000
|
}
|
|
8008
8001
|
}
|
|
8009
8002
|
createEffect(on(() => [onUpdateFn_0_props_content()], onUpdateFn_0));
|
|
8010
|
-
const
|
|
8003
|
+
const onUpdateFn_1_props_builderContextSignal_content__data__jsCode = createMemo(() => props.builderContextSignal.content?.data?.jsCode);
|
|
8011
8004
|
function onUpdateFn_1() {
|
|
8012
|
-
}
|
|
8013
|
-
createEffect(on(() => [onUpdateFn_1_shouldSendResetCookie__()], onUpdateFn_1));
|
|
8014
|
-
const onUpdateFn_2_props_builderContextSignal_content__data__jsCode = createMemo(() => props.builderContextSignal.content?.data?.jsCode);
|
|
8015
|
-
function onUpdateFn_2() {
|
|
8016
8005
|
evaluateJsCode();
|
|
8017
8006
|
}
|
|
8018
|
-
createEffect(on(() => [
|
|
8019
|
-
const
|
|
8020
|
-
function
|
|
8007
|
+
createEffect(on(() => [onUpdateFn_1_props_builderContextSignal_content__data__jsCode()], onUpdateFn_1));
|
|
8008
|
+
const onUpdateFn_2_props_builderContextSignal_content__data__httpRequests = createMemo(() => props.builderContextSignal.content?.data?.httpRequests);
|
|
8009
|
+
function onUpdateFn_2() {
|
|
8021
8010
|
runHttpRequests();
|
|
8022
8011
|
}
|
|
8023
|
-
createEffect(on(() => [
|
|
8024
|
-
const
|
|
8025
|
-
function
|
|
8012
|
+
createEffect(on(() => [onUpdateFn_2_props_builderContextSignal_content__data__httpRequests()], onUpdateFn_2));
|
|
8013
|
+
const onUpdateFn_3_props_builderContextSignal_rootState = createMemo(() => props.builderContextSignal.rootState);
|
|
8014
|
+
function onUpdateFn_3() {
|
|
8026
8015
|
emitStateUpdate();
|
|
8027
8016
|
}
|
|
8028
|
-
createEffect(on(() => [
|
|
8029
|
-
const
|
|
8030
|
-
function
|
|
8017
|
+
createEffect(on(() => [onUpdateFn_3_props_builderContextSignal_rootState()], onUpdateFn_3));
|
|
8018
|
+
const onUpdateFn_4_props_data = createMemo(() => props.data);
|
|
8019
|
+
function onUpdateFn_4() {
|
|
8031
8020
|
if (props.data) {
|
|
8032
8021
|
mergeNewRootState(props.data);
|
|
8033
8022
|
}
|
|
8034
8023
|
}
|
|
8035
|
-
createEffect(on(() => [
|
|
8036
|
-
const
|
|
8037
|
-
function
|
|
8024
|
+
createEffect(on(() => [onUpdateFn_4_props_data()], onUpdateFn_4));
|
|
8025
|
+
const onUpdateFn_5_props_locale = createMemo(() => props.locale);
|
|
8026
|
+
function onUpdateFn_5() {
|
|
8038
8027
|
if (props.locale) {
|
|
8039
8028
|
mergeNewRootState({
|
|
8040
8029
|
locale: props.locale
|
|
8041
8030
|
});
|
|
8042
8031
|
}
|
|
8043
8032
|
}
|
|
8044
|
-
createEffect(on(() => [
|
|
8033
|
+
createEffect(on(() => [onUpdateFn_5_props_locale()], onUpdateFn_5));
|
|
8045
8034
|
return createComponent(builder_context_default.Provider, {
|
|
8046
8035
|
get value() {
|
|
8047
8036
|
return props.builderContextSignal;
|
|
@@ -8057,9 +8046,6 @@ function EnableEditor(props) {
|
|
|
8057
8046
|
return `variant-${props.content?.testVariationId || props.content?.id}`;
|
|
8058
8047
|
}
|
|
8059
8048
|
}, {}, {
|
|
8060
|
-
get key() {
|
|
8061
|
-
return forceReRenderCount();
|
|
8062
|
-
},
|
|
8063
8049
|
ref(r$) {
|
|
8064
8050
|
const _ref$ = elementRef;
|
|
8065
8051
|
typeof _ref$ === "function" ? _ref$(r$) : elementRef = r$;
|
|
@@ -8143,18 +8129,7 @@ var getCss = ({
|
|
|
8143
8129
|
}
|
|
8144
8130
|
return cssCode?.replace(/&/g, `div[builder-content-id="${contentId}"]`) || "";
|
|
8145
8131
|
};
|
|
8146
|
-
|
|
8147
|
-
// src/components/content/components/styles.tsx
|
|
8148
|
-
function ContentStyles(props) {
|
|
8149
|
-
const [injectedStyles, setInjectedStyles] = createSignal(`
|
|
8150
|
-
${getCss({
|
|
8151
|
-
cssCode: props.cssCode,
|
|
8152
|
-
contentId: props.contentId
|
|
8153
|
-
})}
|
|
8154
|
-
${getFontCss({
|
|
8155
|
-
customFonts: props.customFonts
|
|
8156
|
-
})}
|
|
8157
|
-
|
|
8132
|
+
var DEFAULT_STYLES = `
|
|
8158
8133
|
.builder-button {
|
|
8159
8134
|
all: unset;
|
|
8160
8135
|
}
|
|
@@ -8171,6 +8146,22 @@ ${getFontCss({
|
|
|
8171
8146
|
text-align: inherit;
|
|
8172
8147
|
font-family: inherit;
|
|
8173
8148
|
}
|
|
8149
|
+
`;
|
|
8150
|
+
var getDefaultStyles = (isNested) => {
|
|
8151
|
+
return !isNested ? DEFAULT_STYLES : "";
|
|
8152
|
+
};
|
|
8153
|
+
|
|
8154
|
+
// src/components/content/components/styles.tsx
|
|
8155
|
+
function ContentStyles(props) {
|
|
8156
|
+
const [injectedStyles, setInjectedStyles] = createSignal(`
|
|
8157
|
+
${getCss({
|
|
8158
|
+
cssCode: props.cssCode,
|
|
8159
|
+
contentId: props.contentId
|
|
8160
|
+
})}
|
|
8161
|
+
${getFontCss({
|
|
8162
|
+
customFonts: props.customFonts
|
|
8163
|
+
})}
|
|
8164
|
+
${getDefaultStyles(props.isNestedRender)}
|
|
8174
8165
|
`.trim());
|
|
8175
8166
|
return createComponent(inlined_styles_default, {
|
|
8176
8167
|
get styles() {
|
|
@@ -8335,6 +8326,9 @@ function ContentComponent(props) {
|
|
|
8335
8326
|
when: TARGET !== "reactNative",
|
|
8336
8327
|
get children() {
|
|
8337
8328
|
return createComponent(styles_default, {
|
|
8329
|
+
get isNestedRender() {
|
|
8330
|
+
return props.isNestedRender;
|
|
8331
|
+
},
|
|
8338
8332
|
get contentId() {
|
|
8339
8333
|
return builderContextSignal().content?.id;
|
|
8340
8334
|
},
|
|
@@ -8396,7 +8390,7 @@ function ContentVariants(props) {
|
|
|
8396
8390
|
});
|
|
8397
8391
|
return [createComponent(Show, {
|
|
8398
8392
|
get when() {
|
|
8399
|
-
return !props.
|
|
8393
|
+
return !props.isNestedRender && TARGET !== "reactNative";
|
|
8400
8394
|
},
|
|
8401
8395
|
get children() {
|
|
8402
8396
|
return createComponent(inlined_script_default, {
|
|
@@ -8428,6 +8422,9 @@ function ContentVariants(props) {
|
|
|
8428
8422
|
children: (variant, _index) => {
|
|
8429
8423
|
_index();
|
|
8430
8424
|
return createComponent(content_default, {
|
|
8425
|
+
get isNestedRender() {
|
|
8426
|
+
return props.isNestedRender;
|
|
8427
|
+
},
|
|
8431
8428
|
get key() {
|
|
8432
8429
|
return variant.testVariationId;
|
|
8433
8430
|
},
|
|
@@ -8485,7 +8482,11 @@ function ContentVariants(props) {
|
|
|
8485
8482
|
}
|
|
8486
8483
|
})];
|
|
8487
8484
|
}
|
|
8488
|
-
}), createComponent(content_default, mergeProps({
|
|
8485
|
+
}), createComponent(content_default, mergeProps({
|
|
8486
|
+
get isNestedRender() {
|
|
8487
|
+
return props.isNestedRender;
|
|
8488
|
+
}
|
|
8489
|
+
}, {}, {
|
|
8489
8490
|
get content() {
|
|
8490
8491
|
return defaultContent();
|
|
8491
8492
|
},
|
|
@@ -8600,7 +8601,7 @@ function Symbol2(props) {
|
|
|
8600
8601
|
}
|
|
8601
8602
|
}, {}, () => props.attributes, {}), false, true);
|
|
8602
8603
|
insert(_el$, createComponent(content_variants_default, {
|
|
8603
|
-
|
|
8604
|
+
isNestedRender: true,
|
|
8604
8605
|
get apiVersion() {
|
|
8605
8606
|
return props.builderContext.apiVersion;
|
|
8606
8607
|
},
|
package/lib/edge/index.jsx
CHANGED
|
@@ -7169,7 +7169,7 @@ function isFromTrustedHost(trustedHosts, e) {
|
|
|
7169
7169
|
}
|
|
7170
7170
|
|
|
7171
7171
|
// src/constants/sdk-version.ts
|
|
7172
|
-
var SDK_VERSION = "1.0.
|
|
7172
|
+
var SDK_VERSION = "1.0.14";
|
|
7173
7173
|
|
|
7174
7174
|
// src/functions/register.ts
|
|
7175
7175
|
var registry = {};
|
|
@@ -7367,10 +7367,6 @@ var subscribeToEditor = (model, callback, options) => {
|
|
|
7367
7367
|
|
|
7368
7368
|
// src/components/content/components/enable-editor.tsx
|
|
7369
7369
|
function EnableEditor(props) {
|
|
7370
|
-
const [forceReRenderCount, setForceReRenderCount] = createSignal12(0);
|
|
7371
|
-
const [firstRender, setFirstRender] = createSignal12(true);
|
|
7372
|
-
const [lastUpdated, setLastUpdated] = createSignal12(0);
|
|
7373
|
-
const [shouldSendResetCookie, setShouldSendResetCookie] = createSignal12(false);
|
|
7374
7370
|
const [ContentWrapper, setContentWrapper] = createSignal12(
|
|
7375
7371
|
props.contentWrapper || "div"
|
|
7376
7372
|
);
|
|
@@ -7425,7 +7421,6 @@ function EnableEditor(props) {
|
|
|
7425
7421
|
breakpoints
|
|
7426
7422
|
}
|
|
7427
7423
|
});
|
|
7428
|
-
setForceReRenderCount(forceReRenderCount() + 1);
|
|
7429
7424
|
}
|
|
7430
7425
|
},
|
|
7431
7426
|
animation: (animation) => {
|
|
@@ -7433,7 +7428,6 @@ function EnableEditor(props) {
|
|
|
7433
7428
|
},
|
|
7434
7429
|
contentUpdate: (newContent) => {
|
|
7435
7430
|
mergeNewContent(newContent);
|
|
7436
|
-
setForceReRenderCount(forceReRenderCount() + 1);
|
|
7437
7431
|
}
|
|
7438
7432
|
}
|
|
7439
7433
|
})(event);
|
|
@@ -7531,7 +7525,6 @@ function EnableEditor(props) {
|
|
|
7531
7525
|
onMount3(() => {
|
|
7532
7526
|
if (isBrowser()) {
|
|
7533
7527
|
if (isEditing()) {
|
|
7534
|
-
setForceReRenderCount(forceReRenderCount() + 1);
|
|
7535
7528
|
window.addEventListener("message", processMessage);
|
|
7536
7529
|
registerInsertMenu();
|
|
7537
7530
|
setupBrowserForEditing({
|
|
@@ -7607,68 +7600,59 @@ function EnableEditor(props) {
|
|
|
7607
7600
|
}
|
|
7608
7601
|
}
|
|
7609
7602
|
createEffect2(on2(() => [onUpdateFn_0_props_content()], onUpdateFn_0));
|
|
7610
|
-
const
|
|
7611
|
-
() => shouldSendResetCookie()
|
|
7612
|
-
);
|
|
7603
|
+
const onUpdateFn_1_props_builderContextSignal_content__data__jsCode = createMemo12(() => props.builderContextSignal.content?.data?.jsCode);
|
|
7613
7604
|
function onUpdateFn_1() {
|
|
7614
|
-
}
|
|
7615
|
-
createEffect2(
|
|
7616
|
-
on2(() => [onUpdateFn_1_shouldSendResetCookie__()], onUpdateFn_1)
|
|
7617
|
-
);
|
|
7618
|
-
const onUpdateFn_2_props_builderContextSignal_content__data__jsCode = createMemo12(() => props.builderContextSignal.content?.data?.jsCode);
|
|
7619
|
-
function onUpdateFn_2() {
|
|
7620
7605
|
evaluateJsCode();
|
|
7621
7606
|
}
|
|
7622
7607
|
createEffect2(
|
|
7623
7608
|
on2(
|
|
7624
|
-
() => [
|
|
7625
|
-
|
|
7609
|
+
() => [onUpdateFn_1_props_builderContextSignal_content__data__jsCode()],
|
|
7610
|
+
onUpdateFn_1
|
|
7626
7611
|
)
|
|
7627
7612
|
);
|
|
7628
|
-
const
|
|
7629
|
-
function
|
|
7613
|
+
const onUpdateFn_2_props_builderContextSignal_content__data__httpRequests = createMemo12(() => props.builderContextSignal.content?.data?.httpRequests);
|
|
7614
|
+
function onUpdateFn_2() {
|
|
7630
7615
|
runHttpRequests();
|
|
7631
7616
|
}
|
|
7632
7617
|
createEffect2(
|
|
7633
7618
|
on2(
|
|
7634
7619
|
() => [
|
|
7635
|
-
|
|
7620
|
+
onUpdateFn_2_props_builderContextSignal_content__data__httpRequests()
|
|
7636
7621
|
],
|
|
7637
|
-
|
|
7622
|
+
onUpdateFn_2
|
|
7638
7623
|
)
|
|
7639
7624
|
);
|
|
7640
|
-
const
|
|
7625
|
+
const onUpdateFn_3_props_builderContextSignal_rootState = createMemo12(
|
|
7641
7626
|
() => props.builderContextSignal.rootState
|
|
7642
7627
|
);
|
|
7643
|
-
function
|
|
7628
|
+
function onUpdateFn_3() {
|
|
7644
7629
|
emitStateUpdate();
|
|
7645
7630
|
}
|
|
7646
7631
|
createEffect2(
|
|
7647
7632
|
on2(
|
|
7648
|
-
() => [
|
|
7649
|
-
|
|
7633
|
+
() => [onUpdateFn_3_props_builderContextSignal_rootState()],
|
|
7634
|
+
onUpdateFn_3
|
|
7650
7635
|
)
|
|
7651
7636
|
);
|
|
7652
|
-
const
|
|
7653
|
-
function
|
|
7637
|
+
const onUpdateFn_4_props_data = createMemo12(() => props.data);
|
|
7638
|
+
function onUpdateFn_4() {
|
|
7654
7639
|
if (props.data) {
|
|
7655
7640
|
mergeNewRootState(props.data);
|
|
7656
7641
|
}
|
|
7657
7642
|
}
|
|
7658
|
-
createEffect2(on2(() => [
|
|
7659
|
-
const
|
|
7660
|
-
function
|
|
7643
|
+
createEffect2(on2(() => [onUpdateFn_4_props_data()], onUpdateFn_4));
|
|
7644
|
+
const onUpdateFn_5_props_locale = createMemo12(() => props.locale);
|
|
7645
|
+
function onUpdateFn_5() {
|
|
7661
7646
|
if (props.locale) {
|
|
7662
7647
|
mergeNewRootState({
|
|
7663
7648
|
locale: props.locale
|
|
7664
7649
|
});
|
|
7665
7650
|
}
|
|
7666
7651
|
}
|
|
7667
|
-
createEffect2(on2(() => [
|
|
7652
|
+
createEffect2(on2(() => [onUpdateFn_5_props_locale()], onUpdateFn_5));
|
|
7668
7653
|
return <builder_context_default.Provider value={props.builderContextSignal}><Show10 when={props.builderContextSignal.content}><Dynamic5
|
|
7669
7654
|
class={`variant-${props.content?.testVariationId || props.content?.id}`}
|
|
7670
7655
|
{...{}}
|
|
7671
|
-
key={forceReRenderCount()}
|
|
7672
7656
|
ref={elementRef}
|
|
7673
7657
|
onClick={(event) => onClick(event)}
|
|
7674
7658
|
builder-content-id={props.builderContextSignal.content?.id}
|
|
@@ -7741,19 +7725,7 @@ var getCss = ({
|
|
|
7741
7725
|
}
|
|
7742
7726
|
return cssCode?.replace(/&/g, `div[builder-content-id="${contentId}"]`) || "";
|
|
7743
7727
|
};
|
|
7744
|
-
|
|
7745
|
-
// src/components/content/components/styles.tsx
|
|
7746
|
-
function ContentStyles(props) {
|
|
7747
|
-
const [injectedStyles, setInjectedStyles] = createSignal13(
|
|
7748
|
-
`
|
|
7749
|
-
${getCss({
|
|
7750
|
-
cssCode: props.cssCode,
|
|
7751
|
-
contentId: props.contentId
|
|
7752
|
-
})}
|
|
7753
|
-
${getFontCss({
|
|
7754
|
-
customFonts: props.customFonts
|
|
7755
|
-
})}
|
|
7756
|
-
|
|
7728
|
+
var DEFAULT_STYLES = `
|
|
7757
7729
|
.builder-button {
|
|
7758
7730
|
all: unset;
|
|
7759
7731
|
}
|
|
@@ -7770,6 +7742,23 @@ ${getFontCss({
|
|
|
7770
7742
|
text-align: inherit;
|
|
7771
7743
|
font-family: inherit;
|
|
7772
7744
|
}
|
|
7745
|
+
`;
|
|
7746
|
+
var getDefaultStyles = (isNested) => {
|
|
7747
|
+
return !isNested ? DEFAULT_STYLES : "";
|
|
7748
|
+
};
|
|
7749
|
+
|
|
7750
|
+
// src/components/content/components/styles.tsx
|
|
7751
|
+
function ContentStyles(props) {
|
|
7752
|
+
const [injectedStyles, setInjectedStyles] = createSignal13(
|
|
7753
|
+
`
|
|
7754
|
+
${getCss({
|
|
7755
|
+
cssCode: props.cssCode,
|
|
7756
|
+
contentId: props.contentId
|
|
7757
|
+
})}
|
|
7758
|
+
${getFontCss({
|
|
7759
|
+
customFonts: props.customFonts
|
|
7760
|
+
})}
|
|
7761
|
+
${getDefaultStyles(props.isNestedRender)}
|
|
7773
7762
|
`.trim()
|
|
7774
7763
|
);
|
|
7775
7764
|
return <Inlined_styles_default styles={injectedStyles()} />;
|
|
@@ -7897,6 +7886,7 @@ function ContentComponent(props) {
|
|
|
7897
7886
|
>
|
|
7898
7887
|
<Show11 when={props.isSsrAbTest}><Inlined_script_default scriptStr={scriptStr()} /></Show11>
|
|
7899
7888
|
<Show11 when={TARGET !== "reactNative"}><Styles_default
|
|
7889
|
+
isNestedRender={props.isNestedRender}
|
|
7900
7890
|
contentId={builderContextSignal().content?.id}
|
|
7901
7891
|
cssCode={builderContextSignal().content?.data?.cssCode}
|
|
7902
7892
|
customFonts={builderContextSignal().content?.data?.customFonts}
|
|
@@ -7944,7 +7934,7 @@ function ContentVariants(props) {
|
|
|
7944
7934
|
setShouldRenderVariants(false);
|
|
7945
7935
|
});
|
|
7946
7936
|
return <>
|
|
7947
|
-
<Show12 when={!props.
|
|
7937
|
+
<Show12 when={!props.isNestedRender && TARGET !== "reactNative"}><Inlined_script_default scriptStr={getScriptString()} /></Show12>
|
|
7948
7938
|
<Show12 when={shouldRenderVariants()}>
|
|
7949
7939
|
<Inlined_styles_default
|
|
7950
7940
|
id={`variants-styles-${props.content?.id}`}
|
|
@@ -7956,6 +7946,7 @@ function ContentVariants(props) {
|
|
|
7956
7946
|
<For7 each={getVariants(props.content)}>{(variant, _index) => {
|
|
7957
7947
|
const index = _index();
|
|
7958
7948
|
return <Content_default
|
|
7949
|
+
isNestedRender={props.isNestedRender}
|
|
7959
7950
|
key={variant.testVariationId}
|
|
7960
7951
|
content={variant}
|
|
7961
7952
|
showContent={false}
|
|
@@ -7979,6 +7970,7 @@ function ContentVariants(props) {
|
|
|
7979
7970
|
}}</For7>
|
|
7980
7971
|
</Show12>
|
|
7981
7972
|
<Content_default
|
|
7973
|
+
isNestedRender={props.isNestedRender}
|
|
7982
7974
|
{...{}}
|
|
7983
7975
|
content={defaultContent()}
|
|
7984
7976
|
showContent={true}
|
|
@@ -8058,7 +8050,7 @@ function Symbol2(props) {
|
|
|
8058
8050
|
}
|
|
8059
8051
|
createEffect3(on3(() => [onUpdateFn_0_props_symbol()], onUpdateFn_0));
|
|
8060
8052
|
return <div class={className()} {...{}} {...props.attributes} {...{}}><Content_variants_default
|
|
8061
|
-
|
|
8053
|
+
isNestedRender={true}
|
|
8062
8054
|
apiVersion={props.builderContext.apiVersion}
|
|
8063
8055
|
apiKey={props.builderContext.apiKey}
|
|
8064
8056
|
context={{
|
package/lib/node/dev.js
CHANGED
|
@@ -4571,7 +4571,7 @@ function isFromTrustedHost(trustedHosts, e) {
|
|
|
4571
4571
|
}
|
|
4572
4572
|
|
|
4573
4573
|
// src/constants/sdk-version.ts
|
|
4574
|
-
var SDK_VERSION = "1.0.
|
|
4574
|
+
var SDK_VERSION = "1.0.14";
|
|
4575
4575
|
|
|
4576
4576
|
// src/functions/register.ts
|
|
4577
4577
|
var registry = {};
|
|
@@ -4770,10 +4770,6 @@ var subscribeToEditor = (model, callback, options) => {
|
|
|
4770
4770
|
|
|
4771
4771
|
// src/components/content/components/enable-editor.tsx
|
|
4772
4772
|
function EnableEditor(props) {
|
|
4773
|
-
const [forceReRenderCount, setForceReRenderCount] = createSignal(0);
|
|
4774
|
-
createSignal(true);
|
|
4775
|
-
createSignal(0);
|
|
4776
|
-
const [shouldSendResetCookie, setShouldSendResetCookie] = createSignal(false);
|
|
4777
4773
|
const [ContentWrapper, setContentWrapper] = createSignal(props.contentWrapper || "div");
|
|
4778
4774
|
const [httpReqsData, setHttpReqsData] = createSignal({});
|
|
4779
4775
|
const [clicked, setClicked] = createSignal(false);
|
|
@@ -4829,7 +4825,6 @@ function EnableEditor(props) {
|
|
|
4829
4825
|
breakpoints
|
|
4830
4826
|
}
|
|
4831
4827
|
});
|
|
4832
|
-
setForceReRenderCount(forceReRenderCount() + 1);
|
|
4833
4828
|
}
|
|
4834
4829
|
},
|
|
4835
4830
|
animation: (animation) => {
|
|
@@ -4837,7 +4832,6 @@ function EnableEditor(props) {
|
|
|
4837
4832
|
},
|
|
4838
4833
|
contentUpdate: (newContent) => {
|
|
4839
4834
|
mergeNewContent(newContent);
|
|
4840
|
-
setForceReRenderCount(forceReRenderCount() + 1);
|
|
4841
4835
|
}
|
|
4842
4836
|
}
|
|
4843
4837
|
})(event);
|
|
@@ -4929,7 +4923,6 @@ function EnableEditor(props) {
|
|
|
4929
4923
|
onMount(() => {
|
|
4930
4924
|
if (isBrowser()) {
|
|
4931
4925
|
if (isEditing()) {
|
|
4932
|
-
setForceReRenderCount(forceReRenderCount() + 1);
|
|
4933
4926
|
window.addEventListener("message", processMessage);
|
|
4934
4927
|
registerInsertMenu();
|
|
4935
4928
|
setupBrowserForEditing({
|
|
@@ -4996,41 +4989,37 @@ function EnableEditor(props) {
|
|
|
4996
4989
|
}
|
|
4997
4990
|
}
|
|
4998
4991
|
createEffect(on(() => [onUpdateFn_0_props_content()], onUpdateFn_0));
|
|
4999
|
-
const
|
|
4992
|
+
const onUpdateFn_1_props_builderContextSignal_content__data__jsCode = createMemo(() => props.builderContextSignal.content?.data?.jsCode);
|
|
5000
4993
|
function onUpdateFn_1() {
|
|
5001
|
-
}
|
|
5002
|
-
createEffect(on(() => [onUpdateFn_1_shouldSendResetCookie__()], onUpdateFn_1));
|
|
5003
|
-
const onUpdateFn_2_props_builderContextSignal_content__data__jsCode = createMemo(() => props.builderContextSignal.content?.data?.jsCode);
|
|
5004
|
-
function onUpdateFn_2() {
|
|
5005
4994
|
evaluateJsCode();
|
|
5006
4995
|
}
|
|
5007
|
-
createEffect(on(() => [
|
|
5008
|
-
const
|
|
5009
|
-
function
|
|
4996
|
+
createEffect(on(() => [onUpdateFn_1_props_builderContextSignal_content__data__jsCode()], onUpdateFn_1));
|
|
4997
|
+
const onUpdateFn_2_props_builderContextSignal_content__data__httpRequests = createMemo(() => props.builderContextSignal.content?.data?.httpRequests);
|
|
4998
|
+
function onUpdateFn_2() {
|
|
5010
4999
|
runHttpRequests();
|
|
5011
5000
|
}
|
|
5012
|
-
createEffect(on(() => [
|
|
5013
|
-
const
|
|
5014
|
-
function
|
|
5001
|
+
createEffect(on(() => [onUpdateFn_2_props_builderContextSignal_content__data__httpRequests()], onUpdateFn_2));
|
|
5002
|
+
const onUpdateFn_3_props_builderContextSignal_rootState = createMemo(() => props.builderContextSignal.rootState);
|
|
5003
|
+
function onUpdateFn_3() {
|
|
5015
5004
|
emitStateUpdate();
|
|
5016
5005
|
}
|
|
5017
|
-
createEffect(on(() => [
|
|
5018
|
-
const
|
|
5019
|
-
function
|
|
5006
|
+
createEffect(on(() => [onUpdateFn_3_props_builderContextSignal_rootState()], onUpdateFn_3));
|
|
5007
|
+
const onUpdateFn_4_props_data = createMemo(() => props.data);
|
|
5008
|
+
function onUpdateFn_4() {
|
|
5020
5009
|
if (props.data) {
|
|
5021
5010
|
mergeNewRootState(props.data);
|
|
5022
5011
|
}
|
|
5023
5012
|
}
|
|
5024
|
-
createEffect(on(() => [
|
|
5025
|
-
const
|
|
5026
|
-
function
|
|
5013
|
+
createEffect(on(() => [onUpdateFn_4_props_data()], onUpdateFn_4));
|
|
5014
|
+
const onUpdateFn_5_props_locale = createMemo(() => props.locale);
|
|
5015
|
+
function onUpdateFn_5() {
|
|
5027
5016
|
if (props.locale) {
|
|
5028
5017
|
mergeNewRootState({
|
|
5029
5018
|
locale: props.locale
|
|
5030
5019
|
});
|
|
5031
5020
|
}
|
|
5032
5021
|
}
|
|
5033
|
-
createEffect(on(() => [
|
|
5022
|
+
createEffect(on(() => [onUpdateFn_5_props_locale()], onUpdateFn_5));
|
|
5034
5023
|
return createComponent(builder_context_default.Provider, {
|
|
5035
5024
|
get value() {
|
|
5036
5025
|
return props.builderContextSignal;
|
|
@@ -5046,9 +5035,6 @@ function EnableEditor(props) {
|
|
|
5046
5035
|
return `variant-${props.content?.testVariationId || props.content?.id}`;
|
|
5047
5036
|
}
|
|
5048
5037
|
}, {}, {
|
|
5049
|
-
get key() {
|
|
5050
|
-
return forceReRenderCount();
|
|
5051
|
-
},
|
|
5052
5038
|
ref(r$) {
|
|
5053
5039
|
const _ref$ = elementRef;
|
|
5054
5040
|
typeof _ref$ === "function" ? _ref$(r$) : elementRef = r$;
|
|
@@ -5132,18 +5118,7 @@ var getCss = ({
|
|
|
5132
5118
|
}
|
|
5133
5119
|
return cssCode?.replace(/&/g, `div[builder-content-id="${contentId}"]`) || "";
|
|
5134
5120
|
};
|
|
5135
|
-
|
|
5136
|
-
// src/components/content/components/styles.tsx
|
|
5137
|
-
function ContentStyles(props) {
|
|
5138
|
-
const [injectedStyles, setInjectedStyles] = createSignal(`
|
|
5139
|
-
${getCss({
|
|
5140
|
-
cssCode: props.cssCode,
|
|
5141
|
-
contentId: props.contentId
|
|
5142
|
-
})}
|
|
5143
|
-
${getFontCss({
|
|
5144
|
-
customFonts: props.customFonts
|
|
5145
|
-
})}
|
|
5146
|
-
|
|
5121
|
+
var DEFAULT_STYLES = `
|
|
5147
5122
|
.builder-button {
|
|
5148
5123
|
all: unset;
|
|
5149
5124
|
}
|
|
@@ -5160,6 +5135,22 @@ ${getFontCss({
|
|
|
5160
5135
|
text-align: inherit;
|
|
5161
5136
|
font-family: inherit;
|
|
5162
5137
|
}
|
|
5138
|
+
`;
|
|
5139
|
+
var getDefaultStyles = (isNested) => {
|
|
5140
|
+
return !isNested ? DEFAULT_STYLES : "";
|
|
5141
|
+
};
|
|
5142
|
+
|
|
5143
|
+
// src/components/content/components/styles.tsx
|
|
5144
|
+
function ContentStyles(props) {
|
|
5145
|
+
const [injectedStyles, setInjectedStyles] = createSignal(`
|
|
5146
|
+
${getCss({
|
|
5147
|
+
cssCode: props.cssCode,
|
|
5148
|
+
contentId: props.contentId
|
|
5149
|
+
})}
|
|
5150
|
+
${getFontCss({
|
|
5151
|
+
customFonts: props.customFonts
|
|
5152
|
+
})}
|
|
5153
|
+
${getDefaultStyles(props.isNestedRender)}
|
|
5163
5154
|
`.trim());
|
|
5164
5155
|
return createComponent(inlined_styles_default, {
|
|
5165
5156
|
get styles() {
|
|
@@ -5324,6 +5315,9 @@ function ContentComponent(props) {
|
|
|
5324
5315
|
when: TARGET !== "reactNative",
|
|
5325
5316
|
get children() {
|
|
5326
5317
|
return createComponent(styles_default, {
|
|
5318
|
+
get isNestedRender() {
|
|
5319
|
+
return props.isNestedRender;
|
|
5320
|
+
},
|
|
5327
5321
|
get contentId() {
|
|
5328
5322
|
return builderContextSignal().content?.id;
|
|
5329
5323
|
},
|
|
@@ -5385,7 +5379,7 @@ function ContentVariants(props) {
|
|
|
5385
5379
|
});
|
|
5386
5380
|
return [createComponent(Show, {
|
|
5387
5381
|
get when() {
|
|
5388
|
-
return !props.
|
|
5382
|
+
return !props.isNestedRender && TARGET !== "reactNative";
|
|
5389
5383
|
},
|
|
5390
5384
|
get children() {
|
|
5391
5385
|
return createComponent(inlined_script_default, {
|
|
@@ -5417,6 +5411,9 @@ function ContentVariants(props) {
|
|
|
5417
5411
|
children: (variant, _index) => {
|
|
5418
5412
|
_index();
|
|
5419
5413
|
return createComponent(content_default, {
|
|
5414
|
+
get isNestedRender() {
|
|
5415
|
+
return props.isNestedRender;
|
|
5416
|
+
},
|
|
5420
5417
|
get key() {
|
|
5421
5418
|
return variant.testVariationId;
|
|
5422
5419
|
},
|
|
@@ -5474,7 +5471,11 @@ function ContentVariants(props) {
|
|
|
5474
5471
|
}
|
|
5475
5472
|
})];
|
|
5476
5473
|
}
|
|
5477
|
-
}), createComponent(content_default, mergeProps({
|
|
5474
|
+
}), createComponent(content_default, mergeProps({
|
|
5475
|
+
get isNestedRender() {
|
|
5476
|
+
return props.isNestedRender;
|
|
5477
|
+
}
|
|
5478
|
+
}, {}, {
|
|
5478
5479
|
get content() {
|
|
5479
5480
|
return defaultContent();
|
|
5480
5481
|
},
|
|
@@ -5589,7 +5590,7 @@ function Symbol(props) {
|
|
|
5589
5590
|
}
|
|
5590
5591
|
}, {}, () => props.attributes, {}), false, true);
|
|
5591
5592
|
insert(_el$, createComponent(content_variants_default, {
|
|
5592
|
-
|
|
5593
|
+
isNestedRender: true,
|
|
5593
5594
|
get apiVersion() {
|
|
5594
5595
|
return props.builderContext.apiVersion;
|
|
5595
5596
|
},
|