@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/node/dev.jsx
CHANGED
|
@@ -4156,7 +4156,7 @@ function isFromTrustedHost(trustedHosts, e) {
|
|
|
4156
4156
|
}
|
|
4157
4157
|
|
|
4158
4158
|
// src/constants/sdk-version.ts
|
|
4159
|
-
var SDK_VERSION = "1.0.
|
|
4159
|
+
var SDK_VERSION = "1.0.14";
|
|
4160
4160
|
|
|
4161
4161
|
// src/functions/register.ts
|
|
4162
4162
|
var registry = {};
|
|
@@ -4355,10 +4355,6 @@ var subscribeToEditor = (model, callback, options) => {
|
|
|
4355
4355
|
|
|
4356
4356
|
// src/components/content/components/enable-editor.tsx
|
|
4357
4357
|
function EnableEditor(props) {
|
|
4358
|
-
const [forceReRenderCount, setForceReRenderCount] = createSignal12(0);
|
|
4359
|
-
const [firstRender, setFirstRender] = createSignal12(true);
|
|
4360
|
-
const [lastUpdated, setLastUpdated] = createSignal12(0);
|
|
4361
|
-
const [shouldSendResetCookie, setShouldSendResetCookie] = createSignal12(false);
|
|
4362
4358
|
const [ContentWrapper, setContentWrapper] = createSignal12(
|
|
4363
4359
|
props.contentWrapper || "div"
|
|
4364
4360
|
);
|
|
@@ -4413,7 +4409,6 @@ function EnableEditor(props) {
|
|
|
4413
4409
|
breakpoints
|
|
4414
4410
|
}
|
|
4415
4411
|
});
|
|
4416
|
-
setForceReRenderCount(forceReRenderCount() + 1);
|
|
4417
4412
|
}
|
|
4418
4413
|
},
|
|
4419
4414
|
animation: (animation) => {
|
|
@@ -4421,7 +4416,6 @@ function EnableEditor(props) {
|
|
|
4421
4416
|
},
|
|
4422
4417
|
contentUpdate: (newContent) => {
|
|
4423
4418
|
mergeNewContent(newContent);
|
|
4424
|
-
setForceReRenderCount(forceReRenderCount() + 1);
|
|
4425
4419
|
}
|
|
4426
4420
|
}
|
|
4427
4421
|
})(event);
|
|
@@ -4520,7 +4514,6 @@ function EnableEditor(props) {
|
|
|
4520
4514
|
onMount3(() => {
|
|
4521
4515
|
if (isBrowser()) {
|
|
4522
4516
|
if (isEditing()) {
|
|
4523
|
-
setForceReRenderCount(forceReRenderCount() + 1);
|
|
4524
4517
|
window.addEventListener("message", processMessage);
|
|
4525
4518
|
registerInsertMenu();
|
|
4526
4519
|
setupBrowserForEditing({
|
|
@@ -4596,68 +4589,59 @@ function EnableEditor(props) {
|
|
|
4596
4589
|
}
|
|
4597
4590
|
}
|
|
4598
4591
|
createEffect2(on2(() => [onUpdateFn_0_props_content()], onUpdateFn_0));
|
|
4599
|
-
const
|
|
4600
|
-
() => shouldSendResetCookie()
|
|
4601
|
-
);
|
|
4592
|
+
const onUpdateFn_1_props_builderContextSignal_content__data__jsCode = createMemo12(() => props.builderContextSignal.content?.data?.jsCode);
|
|
4602
4593
|
function onUpdateFn_1() {
|
|
4603
|
-
}
|
|
4604
|
-
createEffect2(
|
|
4605
|
-
on2(() => [onUpdateFn_1_shouldSendResetCookie__()], onUpdateFn_1)
|
|
4606
|
-
);
|
|
4607
|
-
const onUpdateFn_2_props_builderContextSignal_content__data__jsCode = createMemo12(() => props.builderContextSignal.content?.data?.jsCode);
|
|
4608
|
-
function onUpdateFn_2() {
|
|
4609
4594
|
evaluateJsCode();
|
|
4610
4595
|
}
|
|
4611
4596
|
createEffect2(
|
|
4612
4597
|
on2(
|
|
4613
|
-
() => [
|
|
4614
|
-
|
|
4598
|
+
() => [onUpdateFn_1_props_builderContextSignal_content__data__jsCode()],
|
|
4599
|
+
onUpdateFn_1
|
|
4615
4600
|
)
|
|
4616
4601
|
);
|
|
4617
|
-
const
|
|
4618
|
-
function
|
|
4602
|
+
const onUpdateFn_2_props_builderContextSignal_content__data__httpRequests = createMemo12(() => props.builderContextSignal.content?.data?.httpRequests);
|
|
4603
|
+
function onUpdateFn_2() {
|
|
4619
4604
|
runHttpRequests();
|
|
4620
4605
|
}
|
|
4621
4606
|
createEffect2(
|
|
4622
4607
|
on2(
|
|
4623
4608
|
() => [
|
|
4624
|
-
|
|
4609
|
+
onUpdateFn_2_props_builderContextSignal_content__data__httpRequests()
|
|
4625
4610
|
],
|
|
4626
|
-
|
|
4611
|
+
onUpdateFn_2
|
|
4627
4612
|
)
|
|
4628
4613
|
);
|
|
4629
|
-
const
|
|
4614
|
+
const onUpdateFn_3_props_builderContextSignal_rootState = createMemo12(
|
|
4630
4615
|
() => props.builderContextSignal.rootState
|
|
4631
4616
|
);
|
|
4632
|
-
function
|
|
4617
|
+
function onUpdateFn_3() {
|
|
4633
4618
|
emitStateUpdate();
|
|
4634
4619
|
}
|
|
4635
4620
|
createEffect2(
|
|
4636
4621
|
on2(
|
|
4637
|
-
() => [
|
|
4638
|
-
|
|
4622
|
+
() => [onUpdateFn_3_props_builderContextSignal_rootState()],
|
|
4623
|
+
onUpdateFn_3
|
|
4639
4624
|
)
|
|
4640
4625
|
);
|
|
4641
|
-
const
|
|
4642
|
-
function
|
|
4626
|
+
const onUpdateFn_4_props_data = createMemo12(() => props.data);
|
|
4627
|
+
function onUpdateFn_4() {
|
|
4643
4628
|
if (props.data) {
|
|
4644
4629
|
mergeNewRootState(props.data);
|
|
4645
4630
|
}
|
|
4646
4631
|
}
|
|
4647
|
-
createEffect2(on2(() => [
|
|
4648
|
-
const
|
|
4649
|
-
function
|
|
4632
|
+
createEffect2(on2(() => [onUpdateFn_4_props_data()], onUpdateFn_4));
|
|
4633
|
+
const onUpdateFn_5_props_locale = createMemo12(() => props.locale);
|
|
4634
|
+
function onUpdateFn_5() {
|
|
4650
4635
|
if (props.locale) {
|
|
4651
4636
|
mergeNewRootState({
|
|
4652
4637
|
locale: props.locale
|
|
4653
4638
|
});
|
|
4654
4639
|
}
|
|
4655
4640
|
}
|
|
4656
|
-
createEffect2(on2(() => [
|
|
4641
|
+
createEffect2(on2(() => [onUpdateFn_5_props_locale()], onUpdateFn_5));
|
|
4657
4642
|
return <builder_context_default.Provider value={props.builderContextSignal}><Show10 when={props.builderContextSignal.content}><Dynamic5
|
|
4658
4643
|
class={`variant-${props.content?.testVariationId || props.content?.id}`}
|
|
4659
4644
|
{...{}}
|
|
4660
|
-
key={forceReRenderCount()}
|
|
4661
4645
|
ref={elementRef}
|
|
4662
4646
|
onClick={(event) => onClick(event)}
|
|
4663
4647
|
builder-content-id={props.builderContextSignal.content?.id}
|
|
@@ -4730,19 +4714,7 @@ var getCss = ({
|
|
|
4730
4714
|
}
|
|
4731
4715
|
return cssCode?.replace(/&/g, `div[builder-content-id="${contentId}"]`) || "";
|
|
4732
4716
|
};
|
|
4733
|
-
|
|
4734
|
-
// src/components/content/components/styles.tsx
|
|
4735
|
-
function ContentStyles(props) {
|
|
4736
|
-
const [injectedStyles, setInjectedStyles] = createSignal13(
|
|
4737
|
-
`
|
|
4738
|
-
${getCss({
|
|
4739
|
-
cssCode: props.cssCode,
|
|
4740
|
-
contentId: props.contentId
|
|
4741
|
-
})}
|
|
4742
|
-
${getFontCss({
|
|
4743
|
-
customFonts: props.customFonts
|
|
4744
|
-
})}
|
|
4745
|
-
|
|
4717
|
+
var DEFAULT_STYLES = `
|
|
4746
4718
|
.builder-button {
|
|
4747
4719
|
all: unset;
|
|
4748
4720
|
}
|
|
@@ -4759,6 +4731,23 @@ ${getFontCss({
|
|
|
4759
4731
|
text-align: inherit;
|
|
4760
4732
|
font-family: inherit;
|
|
4761
4733
|
}
|
|
4734
|
+
`;
|
|
4735
|
+
var getDefaultStyles = (isNested) => {
|
|
4736
|
+
return !isNested ? DEFAULT_STYLES : "";
|
|
4737
|
+
};
|
|
4738
|
+
|
|
4739
|
+
// src/components/content/components/styles.tsx
|
|
4740
|
+
function ContentStyles(props) {
|
|
4741
|
+
const [injectedStyles, setInjectedStyles] = createSignal13(
|
|
4742
|
+
`
|
|
4743
|
+
${getCss({
|
|
4744
|
+
cssCode: props.cssCode,
|
|
4745
|
+
contentId: props.contentId
|
|
4746
|
+
})}
|
|
4747
|
+
${getFontCss({
|
|
4748
|
+
customFonts: props.customFonts
|
|
4749
|
+
})}
|
|
4750
|
+
${getDefaultStyles(props.isNestedRender)}
|
|
4762
4751
|
`.trim()
|
|
4763
4752
|
);
|
|
4764
4753
|
return <Inlined_styles_default styles={injectedStyles()} />;
|
|
@@ -4886,6 +4875,7 @@ function ContentComponent(props) {
|
|
|
4886
4875
|
>
|
|
4887
4876
|
<Show11 when={props.isSsrAbTest}><Inlined_script_default scriptStr={scriptStr()} /></Show11>
|
|
4888
4877
|
<Show11 when={TARGET !== "reactNative"}><Styles_default
|
|
4878
|
+
isNestedRender={props.isNestedRender}
|
|
4889
4879
|
contentId={builderContextSignal().content?.id}
|
|
4890
4880
|
cssCode={builderContextSignal().content?.data?.cssCode}
|
|
4891
4881
|
customFonts={builderContextSignal().content?.data?.customFonts}
|
|
@@ -4933,7 +4923,7 @@ function ContentVariants(props) {
|
|
|
4933
4923
|
setShouldRenderVariants(false);
|
|
4934
4924
|
});
|
|
4935
4925
|
return <>
|
|
4936
|
-
<Show12 when={!props.
|
|
4926
|
+
<Show12 when={!props.isNestedRender && TARGET !== "reactNative"}><Inlined_script_default scriptStr={getScriptString()} /></Show12>
|
|
4937
4927
|
<Show12 when={shouldRenderVariants()}>
|
|
4938
4928
|
<Inlined_styles_default
|
|
4939
4929
|
id={`variants-styles-${props.content?.id}`}
|
|
@@ -4945,6 +4935,7 @@ function ContentVariants(props) {
|
|
|
4945
4935
|
<For7 each={getVariants(props.content)}>{(variant, _index) => {
|
|
4946
4936
|
const index = _index();
|
|
4947
4937
|
return <Content_default
|
|
4938
|
+
isNestedRender={props.isNestedRender}
|
|
4948
4939
|
key={variant.testVariationId}
|
|
4949
4940
|
content={variant}
|
|
4950
4941
|
showContent={false}
|
|
@@ -4968,6 +4959,7 @@ function ContentVariants(props) {
|
|
|
4968
4959
|
}}</For7>
|
|
4969
4960
|
</Show12>
|
|
4970
4961
|
<Content_default
|
|
4962
|
+
isNestedRender={props.isNestedRender}
|
|
4971
4963
|
{...{}}
|
|
4972
4964
|
content={defaultContent()}
|
|
4973
4965
|
showContent={true}
|
|
@@ -5047,7 +5039,7 @@ function Symbol(props) {
|
|
|
5047
5039
|
}
|
|
5048
5040
|
createEffect3(on3(() => [onUpdateFn_0_props_symbol()], onUpdateFn_0));
|
|
5049
5041
|
return <div class={className()} {...{}} {...props.attributes} {...{}}><Content_variants_default
|
|
5050
|
-
|
|
5042
|
+
isNestedRender={true}
|
|
5051
5043
|
apiVersion={props.builderContext.apiVersion}
|
|
5052
5044
|
apiKey={props.builderContext.apiKey}
|
|
5053
5045
|
context={{
|
package/lib/node/index.js
CHANGED
|
@@ -4555,7 +4555,7 @@ function isFromTrustedHost(trustedHosts, e) {
|
|
|
4555
4555
|
}
|
|
4556
4556
|
|
|
4557
4557
|
// src/constants/sdk-version.ts
|
|
4558
|
-
var SDK_VERSION = "1.0.
|
|
4558
|
+
var SDK_VERSION = "1.0.14";
|
|
4559
4559
|
|
|
4560
4560
|
// src/functions/register.ts
|
|
4561
4561
|
var registry = {};
|
|
@@ -4753,10 +4753,6 @@ var subscribeToEditor = (model, callback, options) => {
|
|
|
4753
4753
|
|
|
4754
4754
|
// src/components/content/components/enable-editor.tsx
|
|
4755
4755
|
function EnableEditor(props) {
|
|
4756
|
-
const [forceReRenderCount, setForceReRenderCount] = createSignal(0);
|
|
4757
|
-
createSignal(true);
|
|
4758
|
-
createSignal(0);
|
|
4759
|
-
const [shouldSendResetCookie, setShouldSendResetCookie] = createSignal(false);
|
|
4760
4756
|
const [ContentWrapper, setContentWrapper] = createSignal(props.contentWrapper || "div");
|
|
4761
4757
|
const [httpReqsData, setHttpReqsData] = createSignal({});
|
|
4762
4758
|
const [clicked, setClicked] = createSignal(false);
|
|
@@ -4812,7 +4808,6 @@ function EnableEditor(props) {
|
|
|
4812
4808
|
breakpoints
|
|
4813
4809
|
}
|
|
4814
4810
|
});
|
|
4815
|
-
setForceReRenderCount(forceReRenderCount() + 1);
|
|
4816
4811
|
}
|
|
4817
4812
|
},
|
|
4818
4813
|
animation: (animation) => {
|
|
@@ -4820,7 +4815,6 @@ function EnableEditor(props) {
|
|
|
4820
4815
|
},
|
|
4821
4816
|
contentUpdate: (newContent) => {
|
|
4822
4817
|
mergeNewContent(newContent);
|
|
4823
|
-
setForceReRenderCount(forceReRenderCount() + 1);
|
|
4824
4818
|
}
|
|
4825
4819
|
}
|
|
4826
4820
|
})(event);
|
|
@@ -4911,7 +4905,6 @@ function EnableEditor(props) {
|
|
|
4911
4905
|
onMount(() => {
|
|
4912
4906
|
if (isBrowser()) {
|
|
4913
4907
|
if (isEditing()) {
|
|
4914
|
-
setForceReRenderCount(forceReRenderCount() + 1);
|
|
4915
4908
|
window.addEventListener("message", processMessage);
|
|
4916
4909
|
registerInsertMenu();
|
|
4917
4910
|
setupBrowserForEditing({
|
|
@@ -4978,41 +4971,37 @@ function EnableEditor(props) {
|
|
|
4978
4971
|
}
|
|
4979
4972
|
}
|
|
4980
4973
|
createEffect(on(() => [onUpdateFn_0_props_content()], onUpdateFn_0));
|
|
4981
|
-
const
|
|
4974
|
+
const onUpdateFn_1_props_builderContextSignal_content__data__jsCode = createMemo(() => props.builderContextSignal.content?.data?.jsCode);
|
|
4982
4975
|
function onUpdateFn_1() {
|
|
4983
|
-
}
|
|
4984
|
-
createEffect(on(() => [onUpdateFn_1_shouldSendResetCookie__()], onUpdateFn_1));
|
|
4985
|
-
const onUpdateFn_2_props_builderContextSignal_content__data__jsCode = createMemo(() => props.builderContextSignal.content?.data?.jsCode);
|
|
4986
|
-
function onUpdateFn_2() {
|
|
4987
4976
|
evaluateJsCode();
|
|
4988
4977
|
}
|
|
4989
|
-
createEffect(on(() => [
|
|
4990
|
-
const
|
|
4991
|
-
function
|
|
4978
|
+
createEffect(on(() => [onUpdateFn_1_props_builderContextSignal_content__data__jsCode()], onUpdateFn_1));
|
|
4979
|
+
const onUpdateFn_2_props_builderContextSignal_content__data__httpRequests = createMemo(() => props.builderContextSignal.content?.data?.httpRequests);
|
|
4980
|
+
function onUpdateFn_2() {
|
|
4992
4981
|
runHttpRequests();
|
|
4993
4982
|
}
|
|
4994
|
-
createEffect(on(() => [
|
|
4995
|
-
const
|
|
4996
|
-
function
|
|
4983
|
+
createEffect(on(() => [onUpdateFn_2_props_builderContextSignal_content__data__httpRequests()], onUpdateFn_2));
|
|
4984
|
+
const onUpdateFn_3_props_builderContextSignal_rootState = createMemo(() => props.builderContextSignal.rootState);
|
|
4985
|
+
function onUpdateFn_3() {
|
|
4997
4986
|
emitStateUpdate();
|
|
4998
4987
|
}
|
|
4999
|
-
createEffect(on(() => [
|
|
5000
|
-
const
|
|
5001
|
-
function
|
|
4988
|
+
createEffect(on(() => [onUpdateFn_3_props_builderContextSignal_rootState()], onUpdateFn_3));
|
|
4989
|
+
const onUpdateFn_4_props_data = createMemo(() => props.data);
|
|
4990
|
+
function onUpdateFn_4() {
|
|
5002
4991
|
if (props.data) {
|
|
5003
4992
|
mergeNewRootState(props.data);
|
|
5004
4993
|
}
|
|
5005
4994
|
}
|
|
5006
|
-
createEffect(on(() => [
|
|
5007
|
-
const
|
|
5008
|
-
function
|
|
4995
|
+
createEffect(on(() => [onUpdateFn_4_props_data()], onUpdateFn_4));
|
|
4996
|
+
const onUpdateFn_5_props_locale = createMemo(() => props.locale);
|
|
4997
|
+
function onUpdateFn_5() {
|
|
5009
4998
|
if (props.locale) {
|
|
5010
4999
|
mergeNewRootState({
|
|
5011
5000
|
locale: props.locale
|
|
5012
5001
|
});
|
|
5013
5002
|
}
|
|
5014
5003
|
}
|
|
5015
|
-
createEffect(on(() => [
|
|
5004
|
+
createEffect(on(() => [onUpdateFn_5_props_locale()], onUpdateFn_5));
|
|
5016
5005
|
return createComponent(builder_context_default.Provider, {
|
|
5017
5006
|
get value() {
|
|
5018
5007
|
return props.builderContextSignal;
|
|
@@ -5028,9 +5017,6 @@ function EnableEditor(props) {
|
|
|
5028
5017
|
return `variant-${props.content?.testVariationId || props.content?.id}`;
|
|
5029
5018
|
}
|
|
5030
5019
|
}, {}, {
|
|
5031
|
-
get key() {
|
|
5032
|
-
return forceReRenderCount();
|
|
5033
|
-
},
|
|
5034
5020
|
ref(r$) {
|
|
5035
5021
|
const _ref$ = elementRef;
|
|
5036
5022
|
typeof _ref$ === "function" ? _ref$(r$) : elementRef = r$;
|
|
@@ -5114,18 +5100,7 @@ var getCss = ({
|
|
|
5114
5100
|
}
|
|
5115
5101
|
return cssCode?.replace(/&/g, `div[builder-content-id="${contentId}"]`) || "";
|
|
5116
5102
|
};
|
|
5117
|
-
|
|
5118
|
-
// src/components/content/components/styles.tsx
|
|
5119
|
-
function ContentStyles(props) {
|
|
5120
|
-
const [injectedStyles, setInjectedStyles] = createSignal(`
|
|
5121
|
-
${getCss({
|
|
5122
|
-
cssCode: props.cssCode,
|
|
5123
|
-
contentId: props.contentId
|
|
5124
|
-
})}
|
|
5125
|
-
${getFontCss({
|
|
5126
|
-
customFonts: props.customFonts
|
|
5127
|
-
})}
|
|
5128
|
-
|
|
5103
|
+
var DEFAULT_STYLES = `
|
|
5129
5104
|
.builder-button {
|
|
5130
5105
|
all: unset;
|
|
5131
5106
|
}
|
|
@@ -5142,6 +5117,22 @@ ${getFontCss({
|
|
|
5142
5117
|
text-align: inherit;
|
|
5143
5118
|
font-family: inherit;
|
|
5144
5119
|
}
|
|
5120
|
+
`;
|
|
5121
|
+
var getDefaultStyles = (isNested) => {
|
|
5122
|
+
return !isNested ? DEFAULT_STYLES : "";
|
|
5123
|
+
};
|
|
5124
|
+
|
|
5125
|
+
// src/components/content/components/styles.tsx
|
|
5126
|
+
function ContentStyles(props) {
|
|
5127
|
+
const [injectedStyles, setInjectedStyles] = createSignal(`
|
|
5128
|
+
${getCss({
|
|
5129
|
+
cssCode: props.cssCode,
|
|
5130
|
+
contentId: props.contentId
|
|
5131
|
+
})}
|
|
5132
|
+
${getFontCss({
|
|
5133
|
+
customFonts: props.customFonts
|
|
5134
|
+
})}
|
|
5135
|
+
${getDefaultStyles(props.isNestedRender)}
|
|
5145
5136
|
`.trim());
|
|
5146
5137
|
return createComponent(inlined_styles_default, {
|
|
5147
5138
|
get styles() {
|
|
@@ -5306,6 +5297,9 @@ function ContentComponent(props) {
|
|
|
5306
5297
|
when: TARGET !== "reactNative",
|
|
5307
5298
|
get children() {
|
|
5308
5299
|
return createComponent(styles_default, {
|
|
5300
|
+
get isNestedRender() {
|
|
5301
|
+
return props.isNestedRender;
|
|
5302
|
+
},
|
|
5309
5303
|
get contentId() {
|
|
5310
5304
|
return builderContextSignal().content?.id;
|
|
5311
5305
|
},
|
|
@@ -5367,7 +5361,7 @@ function ContentVariants(props) {
|
|
|
5367
5361
|
});
|
|
5368
5362
|
return [createComponent(Show, {
|
|
5369
5363
|
get when() {
|
|
5370
|
-
return !props.
|
|
5364
|
+
return !props.isNestedRender && TARGET !== "reactNative";
|
|
5371
5365
|
},
|
|
5372
5366
|
get children() {
|
|
5373
5367
|
return createComponent(inlined_script_default, {
|
|
@@ -5399,6 +5393,9 @@ function ContentVariants(props) {
|
|
|
5399
5393
|
children: (variant, _index) => {
|
|
5400
5394
|
_index();
|
|
5401
5395
|
return createComponent(content_default, {
|
|
5396
|
+
get isNestedRender() {
|
|
5397
|
+
return props.isNestedRender;
|
|
5398
|
+
},
|
|
5402
5399
|
get key() {
|
|
5403
5400
|
return variant.testVariationId;
|
|
5404
5401
|
},
|
|
@@ -5456,7 +5453,11 @@ function ContentVariants(props) {
|
|
|
5456
5453
|
}
|
|
5457
5454
|
})];
|
|
5458
5455
|
}
|
|
5459
|
-
}), createComponent(content_default, mergeProps({
|
|
5456
|
+
}), createComponent(content_default, mergeProps({
|
|
5457
|
+
get isNestedRender() {
|
|
5458
|
+
return props.isNestedRender;
|
|
5459
|
+
}
|
|
5460
|
+
}, {}, {
|
|
5460
5461
|
get content() {
|
|
5461
5462
|
return defaultContent();
|
|
5462
5463
|
},
|
|
@@ -5571,7 +5572,7 @@ function Symbol(props) {
|
|
|
5571
5572
|
}
|
|
5572
5573
|
}, {}, () => props.attributes, {}), false, true);
|
|
5573
5574
|
insert(_el$, createComponent(content_variants_default, {
|
|
5574
|
-
|
|
5575
|
+
isNestedRender: true,
|
|
5575
5576
|
get apiVersion() {
|
|
5576
5577
|
return props.builderContext.apiVersion;
|
|
5577
5578
|
},
|
package/lib/node/index.jsx
CHANGED
|
@@ -4140,7 +4140,7 @@ function isFromTrustedHost(trustedHosts, e) {
|
|
|
4140
4140
|
}
|
|
4141
4141
|
|
|
4142
4142
|
// src/constants/sdk-version.ts
|
|
4143
|
-
var SDK_VERSION = "1.0.
|
|
4143
|
+
var SDK_VERSION = "1.0.14";
|
|
4144
4144
|
|
|
4145
4145
|
// src/functions/register.ts
|
|
4146
4146
|
var registry = {};
|
|
@@ -4338,10 +4338,6 @@ var subscribeToEditor = (model, callback, options) => {
|
|
|
4338
4338
|
|
|
4339
4339
|
// src/components/content/components/enable-editor.tsx
|
|
4340
4340
|
function EnableEditor(props) {
|
|
4341
|
-
const [forceReRenderCount, setForceReRenderCount] = createSignal12(0);
|
|
4342
|
-
const [firstRender, setFirstRender] = createSignal12(true);
|
|
4343
|
-
const [lastUpdated, setLastUpdated] = createSignal12(0);
|
|
4344
|
-
const [shouldSendResetCookie, setShouldSendResetCookie] = createSignal12(false);
|
|
4345
4341
|
const [ContentWrapper, setContentWrapper] = createSignal12(
|
|
4346
4342
|
props.contentWrapper || "div"
|
|
4347
4343
|
);
|
|
@@ -4396,7 +4392,6 @@ function EnableEditor(props) {
|
|
|
4396
4392
|
breakpoints
|
|
4397
4393
|
}
|
|
4398
4394
|
});
|
|
4399
|
-
setForceReRenderCount(forceReRenderCount() + 1);
|
|
4400
4395
|
}
|
|
4401
4396
|
},
|
|
4402
4397
|
animation: (animation) => {
|
|
@@ -4404,7 +4399,6 @@ function EnableEditor(props) {
|
|
|
4404
4399
|
},
|
|
4405
4400
|
contentUpdate: (newContent) => {
|
|
4406
4401
|
mergeNewContent(newContent);
|
|
4407
|
-
setForceReRenderCount(forceReRenderCount() + 1);
|
|
4408
4402
|
}
|
|
4409
4403
|
}
|
|
4410
4404
|
})(event);
|
|
@@ -4502,7 +4496,6 @@ function EnableEditor(props) {
|
|
|
4502
4496
|
onMount3(() => {
|
|
4503
4497
|
if (isBrowser()) {
|
|
4504
4498
|
if (isEditing()) {
|
|
4505
|
-
setForceReRenderCount(forceReRenderCount() + 1);
|
|
4506
4499
|
window.addEventListener("message", processMessage);
|
|
4507
4500
|
registerInsertMenu();
|
|
4508
4501
|
setupBrowserForEditing({
|
|
@@ -4578,68 +4571,59 @@ function EnableEditor(props) {
|
|
|
4578
4571
|
}
|
|
4579
4572
|
}
|
|
4580
4573
|
createEffect2(on2(() => [onUpdateFn_0_props_content()], onUpdateFn_0));
|
|
4581
|
-
const
|
|
4582
|
-
() => shouldSendResetCookie()
|
|
4583
|
-
);
|
|
4574
|
+
const onUpdateFn_1_props_builderContextSignal_content__data__jsCode = createMemo12(() => props.builderContextSignal.content?.data?.jsCode);
|
|
4584
4575
|
function onUpdateFn_1() {
|
|
4585
|
-
}
|
|
4586
|
-
createEffect2(
|
|
4587
|
-
on2(() => [onUpdateFn_1_shouldSendResetCookie__()], onUpdateFn_1)
|
|
4588
|
-
);
|
|
4589
|
-
const onUpdateFn_2_props_builderContextSignal_content__data__jsCode = createMemo12(() => props.builderContextSignal.content?.data?.jsCode);
|
|
4590
|
-
function onUpdateFn_2() {
|
|
4591
4576
|
evaluateJsCode();
|
|
4592
4577
|
}
|
|
4593
4578
|
createEffect2(
|
|
4594
4579
|
on2(
|
|
4595
|
-
() => [
|
|
4596
|
-
|
|
4580
|
+
() => [onUpdateFn_1_props_builderContextSignal_content__data__jsCode()],
|
|
4581
|
+
onUpdateFn_1
|
|
4597
4582
|
)
|
|
4598
4583
|
);
|
|
4599
|
-
const
|
|
4600
|
-
function
|
|
4584
|
+
const onUpdateFn_2_props_builderContextSignal_content__data__httpRequests = createMemo12(() => props.builderContextSignal.content?.data?.httpRequests);
|
|
4585
|
+
function onUpdateFn_2() {
|
|
4601
4586
|
runHttpRequests();
|
|
4602
4587
|
}
|
|
4603
4588
|
createEffect2(
|
|
4604
4589
|
on2(
|
|
4605
4590
|
() => [
|
|
4606
|
-
|
|
4591
|
+
onUpdateFn_2_props_builderContextSignal_content__data__httpRequests()
|
|
4607
4592
|
],
|
|
4608
|
-
|
|
4593
|
+
onUpdateFn_2
|
|
4609
4594
|
)
|
|
4610
4595
|
);
|
|
4611
|
-
const
|
|
4596
|
+
const onUpdateFn_3_props_builderContextSignal_rootState = createMemo12(
|
|
4612
4597
|
() => props.builderContextSignal.rootState
|
|
4613
4598
|
);
|
|
4614
|
-
function
|
|
4599
|
+
function onUpdateFn_3() {
|
|
4615
4600
|
emitStateUpdate();
|
|
4616
4601
|
}
|
|
4617
4602
|
createEffect2(
|
|
4618
4603
|
on2(
|
|
4619
|
-
() => [
|
|
4620
|
-
|
|
4604
|
+
() => [onUpdateFn_3_props_builderContextSignal_rootState()],
|
|
4605
|
+
onUpdateFn_3
|
|
4621
4606
|
)
|
|
4622
4607
|
);
|
|
4623
|
-
const
|
|
4624
|
-
function
|
|
4608
|
+
const onUpdateFn_4_props_data = createMemo12(() => props.data);
|
|
4609
|
+
function onUpdateFn_4() {
|
|
4625
4610
|
if (props.data) {
|
|
4626
4611
|
mergeNewRootState(props.data);
|
|
4627
4612
|
}
|
|
4628
4613
|
}
|
|
4629
|
-
createEffect2(on2(() => [
|
|
4630
|
-
const
|
|
4631
|
-
function
|
|
4614
|
+
createEffect2(on2(() => [onUpdateFn_4_props_data()], onUpdateFn_4));
|
|
4615
|
+
const onUpdateFn_5_props_locale = createMemo12(() => props.locale);
|
|
4616
|
+
function onUpdateFn_5() {
|
|
4632
4617
|
if (props.locale) {
|
|
4633
4618
|
mergeNewRootState({
|
|
4634
4619
|
locale: props.locale
|
|
4635
4620
|
});
|
|
4636
4621
|
}
|
|
4637
4622
|
}
|
|
4638
|
-
createEffect2(on2(() => [
|
|
4623
|
+
createEffect2(on2(() => [onUpdateFn_5_props_locale()], onUpdateFn_5));
|
|
4639
4624
|
return <builder_context_default.Provider value={props.builderContextSignal}><Show10 when={props.builderContextSignal.content}><Dynamic5
|
|
4640
4625
|
class={`variant-${props.content?.testVariationId || props.content?.id}`}
|
|
4641
4626
|
{...{}}
|
|
4642
|
-
key={forceReRenderCount()}
|
|
4643
4627
|
ref={elementRef}
|
|
4644
4628
|
onClick={(event) => onClick(event)}
|
|
4645
4629
|
builder-content-id={props.builderContextSignal.content?.id}
|
|
@@ -4712,19 +4696,7 @@ var getCss = ({
|
|
|
4712
4696
|
}
|
|
4713
4697
|
return cssCode?.replace(/&/g, `div[builder-content-id="${contentId}"]`) || "";
|
|
4714
4698
|
};
|
|
4715
|
-
|
|
4716
|
-
// src/components/content/components/styles.tsx
|
|
4717
|
-
function ContentStyles(props) {
|
|
4718
|
-
const [injectedStyles, setInjectedStyles] = createSignal13(
|
|
4719
|
-
`
|
|
4720
|
-
${getCss({
|
|
4721
|
-
cssCode: props.cssCode,
|
|
4722
|
-
contentId: props.contentId
|
|
4723
|
-
})}
|
|
4724
|
-
${getFontCss({
|
|
4725
|
-
customFonts: props.customFonts
|
|
4726
|
-
})}
|
|
4727
|
-
|
|
4699
|
+
var DEFAULT_STYLES = `
|
|
4728
4700
|
.builder-button {
|
|
4729
4701
|
all: unset;
|
|
4730
4702
|
}
|
|
@@ -4741,6 +4713,23 @@ ${getFontCss({
|
|
|
4741
4713
|
text-align: inherit;
|
|
4742
4714
|
font-family: inherit;
|
|
4743
4715
|
}
|
|
4716
|
+
`;
|
|
4717
|
+
var getDefaultStyles = (isNested) => {
|
|
4718
|
+
return !isNested ? DEFAULT_STYLES : "";
|
|
4719
|
+
};
|
|
4720
|
+
|
|
4721
|
+
// src/components/content/components/styles.tsx
|
|
4722
|
+
function ContentStyles(props) {
|
|
4723
|
+
const [injectedStyles, setInjectedStyles] = createSignal13(
|
|
4724
|
+
`
|
|
4725
|
+
${getCss({
|
|
4726
|
+
cssCode: props.cssCode,
|
|
4727
|
+
contentId: props.contentId
|
|
4728
|
+
})}
|
|
4729
|
+
${getFontCss({
|
|
4730
|
+
customFonts: props.customFonts
|
|
4731
|
+
})}
|
|
4732
|
+
${getDefaultStyles(props.isNestedRender)}
|
|
4744
4733
|
`.trim()
|
|
4745
4734
|
);
|
|
4746
4735
|
return <Inlined_styles_default styles={injectedStyles()} />;
|
|
@@ -4868,6 +4857,7 @@ function ContentComponent(props) {
|
|
|
4868
4857
|
>
|
|
4869
4858
|
<Show11 when={props.isSsrAbTest}><Inlined_script_default scriptStr={scriptStr()} /></Show11>
|
|
4870
4859
|
<Show11 when={TARGET !== "reactNative"}><Styles_default
|
|
4860
|
+
isNestedRender={props.isNestedRender}
|
|
4871
4861
|
contentId={builderContextSignal().content?.id}
|
|
4872
4862
|
cssCode={builderContextSignal().content?.data?.cssCode}
|
|
4873
4863
|
customFonts={builderContextSignal().content?.data?.customFonts}
|
|
@@ -4915,7 +4905,7 @@ function ContentVariants(props) {
|
|
|
4915
4905
|
setShouldRenderVariants(false);
|
|
4916
4906
|
});
|
|
4917
4907
|
return <>
|
|
4918
|
-
<Show12 when={!props.
|
|
4908
|
+
<Show12 when={!props.isNestedRender && TARGET !== "reactNative"}><Inlined_script_default scriptStr={getScriptString()} /></Show12>
|
|
4919
4909
|
<Show12 when={shouldRenderVariants()}>
|
|
4920
4910
|
<Inlined_styles_default
|
|
4921
4911
|
id={`variants-styles-${props.content?.id}`}
|
|
@@ -4927,6 +4917,7 @@ function ContentVariants(props) {
|
|
|
4927
4917
|
<For7 each={getVariants(props.content)}>{(variant, _index) => {
|
|
4928
4918
|
const index = _index();
|
|
4929
4919
|
return <Content_default
|
|
4920
|
+
isNestedRender={props.isNestedRender}
|
|
4930
4921
|
key={variant.testVariationId}
|
|
4931
4922
|
content={variant}
|
|
4932
4923
|
showContent={false}
|
|
@@ -4950,6 +4941,7 @@ function ContentVariants(props) {
|
|
|
4950
4941
|
}}</For7>
|
|
4951
4942
|
</Show12>
|
|
4952
4943
|
<Content_default
|
|
4944
|
+
isNestedRender={props.isNestedRender}
|
|
4953
4945
|
{...{}}
|
|
4954
4946
|
content={defaultContent()}
|
|
4955
4947
|
showContent={true}
|
|
@@ -5029,7 +5021,7 @@ function Symbol(props) {
|
|
|
5029
5021
|
}
|
|
5030
5022
|
createEffect3(on3(() => [onUpdateFn_0_props_symbol()], onUpdateFn_0));
|
|
5031
5023
|
return <div class={className()} {...{}} {...props.attributes} {...{}}><Content_variants_default
|
|
5032
|
-
|
|
5024
|
+
isNestedRender={true}
|
|
5033
5025
|
apiVersion={props.builderContext.apiVersion}
|
|
5034
5026
|
apiKey={props.builderContext.apiKey}
|
|
5035
5027
|
context={{
|