@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/dist/index.d.ts
CHANGED
|
@@ -671,7 +671,7 @@ type VariantsProviderProps = ContentVariantsPrps & {
|
|
|
671
671
|
/**
|
|
672
672
|
* For internal use only. Do not provide this prop.
|
|
673
673
|
*/
|
|
674
|
-
|
|
674
|
+
isNestedRender?: boolean;
|
|
675
675
|
};
|
|
676
676
|
|
|
677
677
|
declare function ContentVariants(props: VariantsProviderProps): solid_js.JSX.Element;
|
package/lib/browser/dev.js
CHANGED
|
@@ -4446,7 +4446,7 @@ function isFromTrustedHost(trustedHosts, e) {
|
|
|
4446
4446
|
}
|
|
4447
4447
|
|
|
4448
4448
|
// src/constants/sdk-version.ts
|
|
4449
|
-
var SDK_VERSION = "1.0.
|
|
4449
|
+
var SDK_VERSION = "1.0.14";
|
|
4450
4450
|
|
|
4451
4451
|
// src/functions/register.ts
|
|
4452
4452
|
var registry = {};
|
|
@@ -4645,10 +4645,6 @@ var subscribeToEditor = (model, callback, options) => {
|
|
|
4645
4645
|
|
|
4646
4646
|
// src/components/content/components/enable-editor.tsx
|
|
4647
4647
|
function EnableEditor(props) {
|
|
4648
|
-
const [forceReRenderCount, setForceReRenderCount] = createSignal(0);
|
|
4649
|
-
createSignal(true);
|
|
4650
|
-
createSignal(0);
|
|
4651
|
-
const [shouldSendResetCookie, setShouldSendResetCookie] = createSignal(false);
|
|
4652
4648
|
const [ContentWrapper, setContentWrapper] = createSignal(props.contentWrapper || "div");
|
|
4653
4649
|
const [httpReqsData, setHttpReqsData] = createSignal({});
|
|
4654
4650
|
const [clicked, setClicked] = createSignal(false);
|
|
@@ -4704,7 +4700,6 @@ function EnableEditor(props) {
|
|
|
4704
4700
|
breakpoints
|
|
4705
4701
|
}
|
|
4706
4702
|
});
|
|
4707
|
-
setForceReRenderCount(forceReRenderCount() + 1);
|
|
4708
4703
|
}
|
|
4709
4704
|
},
|
|
4710
4705
|
animation: (animation) => {
|
|
@@ -4712,7 +4707,6 @@ function EnableEditor(props) {
|
|
|
4712
4707
|
},
|
|
4713
4708
|
contentUpdate: (newContent) => {
|
|
4714
4709
|
mergeNewContent(newContent);
|
|
4715
|
-
setForceReRenderCount(forceReRenderCount() + 1);
|
|
4716
4710
|
}
|
|
4717
4711
|
}
|
|
4718
4712
|
})(event);
|
|
@@ -4804,7 +4798,6 @@ function EnableEditor(props) {
|
|
|
4804
4798
|
onMount(() => {
|
|
4805
4799
|
if (isBrowser()) {
|
|
4806
4800
|
if (isEditing()) {
|
|
4807
|
-
setForceReRenderCount(forceReRenderCount() + 1);
|
|
4808
4801
|
window.addEventListener("message", processMessage);
|
|
4809
4802
|
registerInsertMenu();
|
|
4810
4803
|
setupBrowserForEditing({
|
|
@@ -4871,41 +4864,37 @@ function EnableEditor(props) {
|
|
|
4871
4864
|
}
|
|
4872
4865
|
}
|
|
4873
4866
|
createEffect(on(() => [onUpdateFn_0_props_content()], onUpdateFn_0));
|
|
4874
|
-
const
|
|
4867
|
+
const onUpdateFn_1_props_builderContextSignal_content__data__jsCode = createMemo(() => props.builderContextSignal.content?.data?.jsCode);
|
|
4875
4868
|
function onUpdateFn_1() {
|
|
4876
|
-
}
|
|
4877
|
-
createEffect(on(() => [onUpdateFn_1_shouldSendResetCookie__()], onUpdateFn_1));
|
|
4878
|
-
const onUpdateFn_2_props_builderContextSignal_content__data__jsCode = createMemo(() => props.builderContextSignal.content?.data?.jsCode);
|
|
4879
|
-
function onUpdateFn_2() {
|
|
4880
4869
|
evaluateJsCode();
|
|
4881
4870
|
}
|
|
4882
|
-
createEffect(on(() => [
|
|
4883
|
-
const
|
|
4884
|
-
function
|
|
4871
|
+
createEffect(on(() => [onUpdateFn_1_props_builderContextSignal_content__data__jsCode()], onUpdateFn_1));
|
|
4872
|
+
const onUpdateFn_2_props_builderContextSignal_content__data__httpRequests = createMemo(() => props.builderContextSignal.content?.data?.httpRequests);
|
|
4873
|
+
function onUpdateFn_2() {
|
|
4885
4874
|
runHttpRequests();
|
|
4886
4875
|
}
|
|
4887
|
-
createEffect(on(() => [
|
|
4888
|
-
const
|
|
4889
|
-
function
|
|
4876
|
+
createEffect(on(() => [onUpdateFn_2_props_builderContextSignal_content__data__httpRequests()], onUpdateFn_2));
|
|
4877
|
+
const onUpdateFn_3_props_builderContextSignal_rootState = createMemo(() => props.builderContextSignal.rootState);
|
|
4878
|
+
function onUpdateFn_3() {
|
|
4890
4879
|
emitStateUpdate();
|
|
4891
4880
|
}
|
|
4892
|
-
createEffect(on(() => [
|
|
4893
|
-
const
|
|
4894
|
-
function
|
|
4881
|
+
createEffect(on(() => [onUpdateFn_3_props_builderContextSignal_rootState()], onUpdateFn_3));
|
|
4882
|
+
const onUpdateFn_4_props_data = createMemo(() => props.data);
|
|
4883
|
+
function onUpdateFn_4() {
|
|
4895
4884
|
if (props.data) {
|
|
4896
4885
|
mergeNewRootState(props.data);
|
|
4897
4886
|
}
|
|
4898
4887
|
}
|
|
4899
|
-
createEffect(on(() => [
|
|
4900
|
-
const
|
|
4901
|
-
function
|
|
4888
|
+
createEffect(on(() => [onUpdateFn_4_props_data()], onUpdateFn_4));
|
|
4889
|
+
const onUpdateFn_5_props_locale = createMemo(() => props.locale);
|
|
4890
|
+
function onUpdateFn_5() {
|
|
4902
4891
|
if (props.locale) {
|
|
4903
4892
|
mergeNewRootState({
|
|
4904
4893
|
locale: props.locale
|
|
4905
4894
|
});
|
|
4906
4895
|
}
|
|
4907
4896
|
}
|
|
4908
|
-
createEffect(on(() => [
|
|
4897
|
+
createEffect(on(() => [onUpdateFn_5_props_locale()], onUpdateFn_5));
|
|
4909
4898
|
return createComponent(builder_context_default.Provider, {
|
|
4910
4899
|
get value() {
|
|
4911
4900
|
return props.builderContextSignal;
|
|
@@ -4921,9 +4910,6 @@ function EnableEditor(props) {
|
|
|
4921
4910
|
return `variant-${props.content?.testVariationId || props.content?.id}`;
|
|
4922
4911
|
}
|
|
4923
4912
|
}, {}, {
|
|
4924
|
-
get key() {
|
|
4925
|
-
return forceReRenderCount();
|
|
4926
|
-
},
|
|
4927
4913
|
ref(r$) {
|
|
4928
4914
|
const _ref$ = elementRef;
|
|
4929
4915
|
typeof _ref$ === "function" ? _ref$(r$) : elementRef = r$;
|
|
@@ -5007,18 +4993,7 @@ var getCss = ({
|
|
|
5007
4993
|
}
|
|
5008
4994
|
return cssCode?.replace(/&/g, `div[builder-content-id="${contentId}"]`) || "";
|
|
5009
4995
|
};
|
|
5010
|
-
|
|
5011
|
-
// src/components/content/components/styles.tsx
|
|
5012
|
-
function ContentStyles(props) {
|
|
5013
|
-
const [injectedStyles, setInjectedStyles] = createSignal(`
|
|
5014
|
-
${getCss({
|
|
5015
|
-
cssCode: props.cssCode,
|
|
5016
|
-
contentId: props.contentId
|
|
5017
|
-
})}
|
|
5018
|
-
${getFontCss({
|
|
5019
|
-
customFonts: props.customFonts
|
|
5020
|
-
})}
|
|
5021
|
-
|
|
4996
|
+
var DEFAULT_STYLES = `
|
|
5022
4997
|
.builder-button {
|
|
5023
4998
|
all: unset;
|
|
5024
4999
|
}
|
|
@@ -5035,6 +5010,22 @@ ${getFontCss({
|
|
|
5035
5010
|
text-align: inherit;
|
|
5036
5011
|
font-family: inherit;
|
|
5037
5012
|
}
|
|
5013
|
+
`;
|
|
5014
|
+
var getDefaultStyles = (isNested) => {
|
|
5015
|
+
return !isNested ? DEFAULT_STYLES : "";
|
|
5016
|
+
};
|
|
5017
|
+
|
|
5018
|
+
// src/components/content/components/styles.tsx
|
|
5019
|
+
function ContentStyles(props) {
|
|
5020
|
+
const [injectedStyles, setInjectedStyles] = createSignal(`
|
|
5021
|
+
${getCss({
|
|
5022
|
+
cssCode: props.cssCode,
|
|
5023
|
+
contentId: props.contentId
|
|
5024
|
+
})}
|
|
5025
|
+
${getFontCss({
|
|
5026
|
+
customFonts: props.customFonts
|
|
5027
|
+
})}
|
|
5028
|
+
${getDefaultStyles(props.isNestedRender)}
|
|
5038
5029
|
`.trim());
|
|
5039
5030
|
return createComponent(inlined_styles_default, {
|
|
5040
5031
|
get styles() {
|
|
@@ -5199,6 +5190,9 @@ function ContentComponent(props) {
|
|
|
5199
5190
|
when: TARGET !== "reactNative",
|
|
5200
5191
|
get children() {
|
|
5201
5192
|
return createComponent(styles_default, {
|
|
5193
|
+
get isNestedRender() {
|
|
5194
|
+
return props.isNestedRender;
|
|
5195
|
+
},
|
|
5202
5196
|
get contentId() {
|
|
5203
5197
|
return builderContextSignal().content?.id;
|
|
5204
5198
|
},
|
|
@@ -5260,7 +5254,7 @@ function ContentVariants(props) {
|
|
|
5260
5254
|
});
|
|
5261
5255
|
return [createComponent(Show, {
|
|
5262
5256
|
get when() {
|
|
5263
|
-
return !props.
|
|
5257
|
+
return !props.isNestedRender && TARGET !== "reactNative";
|
|
5264
5258
|
},
|
|
5265
5259
|
get children() {
|
|
5266
5260
|
return createComponent(inlined_script_default, {
|
|
@@ -5292,6 +5286,9 @@ function ContentVariants(props) {
|
|
|
5292
5286
|
children: (variant, _index) => {
|
|
5293
5287
|
_index();
|
|
5294
5288
|
return createComponent(content_default, {
|
|
5289
|
+
get isNestedRender() {
|
|
5290
|
+
return props.isNestedRender;
|
|
5291
|
+
},
|
|
5295
5292
|
get key() {
|
|
5296
5293
|
return variant.testVariationId;
|
|
5297
5294
|
},
|
|
@@ -5349,7 +5346,11 @@ function ContentVariants(props) {
|
|
|
5349
5346
|
}
|
|
5350
5347
|
})];
|
|
5351
5348
|
}
|
|
5352
|
-
}), createComponent(content_default, mergeProps({
|
|
5349
|
+
}), createComponent(content_default, mergeProps({
|
|
5350
|
+
get isNestedRender() {
|
|
5351
|
+
return props.isNestedRender;
|
|
5352
|
+
}
|
|
5353
|
+
}, {}, {
|
|
5353
5354
|
get content() {
|
|
5354
5355
|
return defaultContent();
|
|
5355
5356
|
},
|
|
@@ -5464,7 +5465,7 @@ function Symbol(props) {
|
|
|
5464
5465
|
}
|
|
5465
5466
|
}, {}, () => props.attributes, {}), false, true);
|
|
5466
5467
|
insert(_el$, createComponent(content_variants_default, {
|
|
5467
|
-
|
|
5468
|
+
isNestedRender: true,
|
|
5468
5469
|
get apiVersion() {
|
|
5469
5470
|
return props.builderContext.apiVersion;
|
|
5470
5471
|
},
|
package/lib/browser/dev.jsx
CHANGED
|
@@ -4029,7 +4029,7 @@ function isFromTrustedHost(trustedHosts, e) {
|
|
|
4029
4029
|
}
|
|
4030
4030
|
|
|
4031
4031
|
// src/constants/sdk-version.ts
|
|
4032
|
-
var SDK_VERSION = "1.0.
|
|
4032
|
+
var SDK_VERSION = "1.0.14";
|
|
4033
4033
|
|
|
4034
4034
|
// src/functions/register.ts
|
|
4035
4035
|
var registry = {};
|
|
@@ -4228,10 +4228,6 @@ var subscribeToEditor = (model, callback, options) => {
|
|
|
4228
4228
|
|
|
4229
4229
|
// src/components/content/components/enable-editor.tsx
|
|
4230
4230
|
function EnableEditor(props) {
|
|
4231
|
-
const [forceReRenderCount, setForceReRenderCount] = createSignal12(0);
|
|
4232
|
-
const [firstRender, setFirstRender] = createSignal12(true);
|
|
4233
|
-
const [lastUpdated, setLastUpdated] = createSignal12(0);
|
|
4234
|
-
const [shouldSendResetCookie, setShouldSendResetCookie] = createSignal12(false);
|
|
4235
4231
|
const [ContentWrapper, setContentWrapper] = createSignal12(
|
|
4236
4232
|
props.contentWrapper || "div"
|
|
4237
4233
|
);
|
|
@@ -4286,7 +4282,6 @@ function EnableEditor(props) {
|
|
|
4286
4282
|
breakpoints
|
|
4287
4283
|
}
|
|
4288
4284
|
});
|
|
4289
|
-
setForceReRenderCount(forceReRenderCount() + 1);
|
|
4290
4285
|
}
|
|
4291
4286
|
},
|
|
4292
4287
|
animation: (animation) => {
|
|
@@ -4294,7 +4289,6 @@ function EnableEditor(props) {
|
|
|
4294
4289
|
},
|
|
4295
4290
|
contentUpdate: (newContent) => {
|
|
4296
4291
|
mergeNewContent(newContent);
|
|
4297
|
-
setForceReRenderCount(forceReRenderCount() + 1);
|
|
4298
4292
|
}
|
|
4299
4293
|
}
|
|
4300
4294
|
})(event);
|
|
@@ -4393,7 +4387,6 @@ function EnableEditor(props) {
|
|
|
4393
4387
|
onMount3(() => {
|
|
4394
4388
|
if (isBrowser()) {
|
|
4395
4389
|
if (isEditing()) {
|
|
4396
|
-
setForceReRenderCount(forceReRenderCount() + 1);
|
|
4397
4390
|
window.addEventListener("message", processMessage);
|
|
4398
4391
|
registerInsertMenu();
|
|
4399
4392
|
setupBrowserForEditing({
|
|
@@ -4469,68 +4462,59 @@ function EnableEditor(props) {
|
|
|
4469
4462
|
}
|
|
4470
4463
|
}
|
|
4471
4464
|
createEffect2(on2(() => [onUpdateFn_0_props_content()], onUpdateFn_0));
|
|
4472
|
-
const
|
|
4473
|
-
() => shouldSendResetCookie()
|
|
4474
|
-
);
|
|
4465
|
+
const onUpdateFn_1_props_builderContextSignal_content__data__jsCode = createMemo12(() => props.builderContextSignal.content?.data?.jsCode);
|
|
4475
4466
|
function onUpdateFn_1() {
|
|
4476
|
-
}
|
|
4477
|
-
createEffect2(
|
|
4478
|
-
on2(() => [onUpdateFn_1_shouldSendResetCookie__()], onUpdateFn_1)
|
|
4479
|
-
);
|
|
4480
|
-
const onUpdateFn_2_props_builderContextSignal_content__data__jsCode = createMemo12(() => props.builderContextSignal.content?.data?.jsCode);
|
|
4481
|
-
function onUpdateFn_2() {
|
|
4482
4467
|
evaluateJsCode();
|
|
4483
4468
|
}
|
|
4484
4469
|
createEffect2(
|
|
4485
4470
|
on2(
|
|
4486
|
-
() => [
|
|
4487
|
-
|
|
4471
|
+
() => [onUpdateFn_1_props_builderContextSignal_content__data__jsCode()],
|
|
4472
|
+
onUpdateFn_1
|
|
4488
4473
|
)
|
|
4489
4474
|
);
|
|
4490
|
-
const
|
|
4491
|
-
function
|
|
4475
|
+
const onUpdateFn_2_props_builderContextSignal_content__data__httpRequests = createMemo12(() => props.builderContextSignal.content?.data?.httpRequests);
|
|
4476
|
+
function onUpdateFn_2() {
|
|
4492
4477
|
runHttpRequests();
|
|
4493
4478
|
}
|
|
4494
4479
|
createEffect2(
|
|
4495
4480
|
on2(
|
|
4496
4481
|
() => [
|
|
4497
|
-
|
|
4482
|
+
onUpdateFn_2_props_builderContextSignal_content__data__httpRequests()
|
|
4498
4483
|
],
|
|
4499
|
-
|
|
4484
|
+
onUpdateFn_2
|
|
4500
4485
|
)
|
|
4501
4486
|
);
|
|
4502
|
-
const
|
|
4487
|
+
const onUpdateFn_3_props_builderContextSignal_rootState = createMemo12(
|
|
4503
4488
|
() => props.builderContextSignal.rootState
|
|
4504
4489
|
);
|
|
4505
|
-
function
|
|
4490
|
+
function onUpdateFn_3() {
|
|
4506
4491
|
emitStateUpdate();
|
|
4507
4492
|
}
|
|
4508
4493
|
createEffect2(
|
|
4509
4494
|
on2(
|
|
4510
|
-
() => [
|
|
4511
|
-
|
|
4495
|
+
() => [onUpdateFn_3_props_builderContextSignal_rootState()],
|
|
4496
|
+
onUpdateFn_3
|
|
4512
4497
|
)
|
|
4513
4498
|
);
|
|
4514
|
-
const
|
|
4515
|
-
function
|
|
4499
|
+
const onUpdateFn_4_props_data = createMemo12(() => props.data);
|
|
4500
|
+
function onUpdateFn_4() {
|
|
4516
4501
|
if (props.data) {
|
|
4517
4502
|
mergeNewRootState(props.data);
|
|
4518
4503
|
}
|
|
4519
4504
|
}
|
|
4520
|
-
createEffect2(on2(() => [
|
|
4521
|
-
const
|
|
4522
|
-
function
|
|
4505
|
+
createEffect2(on2(() => [onUpdateFn_4_props_data()], onUpdateFn_4));
|
|
4506
|
+
const onUpdateFn_5_props_locale = createMemo12(() => props.locale);
|
|
4507
|
+
function onUpdateFn_5() {
|
|
4523
4508
|
if (props.locale) {
|
|
4524
4509
|
mergeNewRootState({
|
|
4525
4510
|
locale: props.locale
|
|
4526
4511
|
});
|
|
4527
4512
|
}
|
|
4528
4513
|
}
|
|
4529
|
-
createEffect2(on2(() => [
|
|
4514
|
+
createEffect2(on2(() => [onUpdateFn_5_props_locale()], onUpdateFn_5));
|
|
4530
4515
|
return <builder_context_default.Provider value={props.builderContextSignal}><Show10 when={props.builderContextSignal.content}><Dynamic5
|
|
4531
4516
|
class={`variant-${props.content?.testVariationId || props.content?.id}`}
|
|
4532
4517
|
{...{}}
|
|
4533
|
-
key={forceReRenderCount()}
|
|
4534
4518
|
ref={elementRef}
|
|
4535
4519
|
onClick={(event) => onClick(event)}
|
|
4536
4520
|
builder-content-id={props.builderContextSignal.content?.id}
|
|
@@ -4603,19 +4587,7 @@ var getCss = ({
|
|
|
4603
4587
|
}
|
|
4604
4588
|
return cssCode?.replace(/&/g, `div[builder-content-id="${contentId}"]`) || "";
|
|
4605
4589
|
};
|
|
4606
|
-
|
|
4607
|
-
// src/components/content/components/styles.tsx
|
|
4608
|
-
function ContentStyles(props) {
|
|
4609
|
-
const [injectedStyles, setInjectedStyles] = createSignal13(
|
|
4610
|
-
`
|
|
4611
|
-
${getCss({
|
|
4612
|
-
cssCode: props.cssCode,
|
|
4613
|
-
contentId: props.contentId
|
|
4614
|
-
})}
|
|
4615
|
-
${getFontCss({
|
|
4616
|
-
customFonts: props.customFonts
|
|
4617
|
-
})}
|
|
4618
|
-
|
|
4590
|
+
var DEFAULT_STYLES = `
|
|
4619
4591
|
.builder-button {
|
|
4620
4592
|
all: unset;
|
|
4621
4593
|
}
|
|
@@ -4632,6 +4604,23 @@ ${getFontCss({
|
|
|
4632
4604
|
text-align: inherit;
|
|
4633
4605
|
font-family: inherit;
|
|
4634
4606
|
}
|
|
4607
|
+
`;
|
|
4608
|
+
var getDefaultStyles = (isNested) => {
|
|
4609
|
+
return !isNested ? DEFAULT_STYLES : "";
|
|
4610
|
+
};
|
|
4611
|
+
|
|
4612
|
+
// src/components/content/components/styles.tsx
|
|
4613
|
+
function ContentStyles(props) {
|
|
4614
|
+
const [injectedStyles, setInjectedStyles] = createSignal13(
|
|
4615
|
+
`
|
|
4616
|
+
${getCss({
|
|
4617
|
+
cssCode: props.cssCode,
|
|
4618
|
+
contentId: props.contentId
|
|
4619
|
+
})}
|
|
4620
|
+
${getFontCss({
|
|
4621
|
+
customFonts: props.customFonts
|
|
4622
|
+
})}
|
|
4623
|
+
${getDefaultStyles(props.isNestedRender)}
|
|
4635
4624
|
`.trim()
|
|
4636
4625
|
);
|
|
4637
4626
|
return <Inlined_styles_default styles={injectedStyles()} />;
|
|
@@ -4759,6 +4748,7 @@ function ContentComponent(props) {
|
|
|
4759
4748
|
>
|
|
4760
4749
|
<Show11 when={props.isSsrAbTest}><Inlined_script_default scriptStr={scriptStr()} /></Show11>
|
|
4761
4750
|
<Show11 when={TARGET !== "reactNative"}><Styles_default
|
|
4751
|
+
isNestedRender={props.isNestedRender}
|
|
4762
4752
|
contentId={builderContextSignal().content?.id}
|
|
4763
4753
|
cssCode={builderContextSignal().content?.data?.cssCode}
|
|
4764
4754
|
customFonts={builderContextSignal().content?.data?.customFonts}
|
|
@@ -4806,7 +4796,7 @@ function ContentVariants(props) {
|
|
|
4806
4796
|
setShouldRenderVariants(false);
|
|
4807
4797
|
});
|
|
4808
4798
|
return <>
|
|
4809
|
-
<Show12 when={!props.
|
|
4799
|
+
<Show12 when={!props.isNestedRender && TARGET !== "reactNative"}><Inlined_script_default scriptStr={getScriptString()} /></Show12>
|
|
4810
4800
|
<Show12 when={shouldRenderVariants()}>
|
|
4811
4801
|
<Inlined_styles_default
|
|
4812
4802
|
id={`variants-styles-${props.content?.id}`}
|
|
@@ -4818,6 +4808,7 @@ function ContentVariants(props) {
|
|
|
4818
4808
|
<For7 each={getVariants(props.content)}>{(variant, _index) => {
|
|
4819
4809
|
const index = _index();
|
|
4820
4810
|
return <Content_default
|
|
4811
|
+
isNestedRender={props.isNestedRender}
|
|
4821
4812
|
key={variant.testVariationId}
|
|
4822
4813
|
content={variant}
|
|
4823
4814
|
showContent={false}
|
|
@@ -4841,6 +4832,7 @@ function ContentVariants(props) {
|
|
|
4841
4832
|
}}</For7>
|
|
4842
4833
|
</Show12>
|
|
4843
4834
|
<Content_default
|
|
4835
|
+
isNestedRender={props.isNestedRender}
|
|
4844
4836
|
{...{}}
|
|
4845
4837
|
content={defaultContent()}
|
|
4846
4838
|
showContent={true}
|
|
@@ -4920,7 +4912,7 @@ function Symbol(props) {
|
|
|
4920
4912
|
}
|
|
4921
4913
|
createEffect3(on3(() => [onUpdateFn_0_props_symbol()], onUpdateFn_0));
|
|
4922
4914
|
return <div class={className()} {...{}} {...props.attributes} {...{}}><Content_variants_default
|
|
4923
|
-
|
|
4915
|
+
isNestedRender={true}
|
|
4924
4916
|
apiVersion={props.builderContext.apiVersion}
|
|
4925
4917
|
apiKey={props.builderContext.apiKey}
|
|
4926
4918
|
context={{
|
package/lib/browser/index.js
CHANGED
|
@@ -4431,7 +4431,7 @@ function isFromTrustedHost(trustedHosts, e) {
|
|
|
4431
4431
|
}
|
|
4432
4432
|
|
|
4433
4433
|
// src/constants/sdk-version.ts
|
|
4434
|
-
var SDK_VERSION = "1.0.
|
|
4434
|
+
var SDK_VERSION = "1.0.14";
|
|
4435
4435
|
|
|
4436
4436
|
// src/functions/register.ts
|
|
4437
4437
|
var registry = {};
|
|
@@ -4629,10 +4629,6 @@ var subscribeToEditor = (model, callback, options) => {
|
|
|
4629
4629
|
|
|
4630
4630
|
// src/components/content/components/enable-editor.tsx
|
|
4631
4631
|
function EnableEditor(props) {
|
|
4632
|
-
const [forceReRenderCount, setForceReRenderCount] = createSignal(0);
|
|
4633
|
-
createSignal(true);
|
|
4634
|
-
createSignal(0);
|
|
4635
|
-
const [shouldSendResetCookie, setShouldSendResetCookie] = createSignal(false);
|
|
4636
4632
|
const [ContentWrapper, setContentWrapper] = createSignal(props.contentWrapper || "div");
|
|
4637
4633
|
const [httpReqsData, setHttpReqsData] = createSignal({});
|
|
4638
4634
|
const [clicked, setClicked] = createSignal(false);
|
|
@@ -4688,7 +4684,6 @@ function EnableEditor(props) {
|
|
|
4688
4684
|
breakpoints
|
|
4689
4685
|
}
|
|
4690
4686
|
});
|
|
4691
|
-
setForceReRenderCount(forceReRenderCount() + 1);
|
|
4692
4687
|
}
|
|
4693
4688
|
},
|
|
4694
4689
|
animation: (animation) => {
|
|
@@ -4696,7 +4691,6 @@ function EnableEditor(props) {
|
|
|
4696
4691
|
},
|
|
4697
4692
|
contentUpdate: (newContent) => {
|
|
4698
4693
|
mergeNewContent(newContent);
|
|
4699
|
-
setForceReRenderCount(forceReRenderCount() + 1);
|
|
4700
4694
|
}
|
|
4701
4695
|
}
|
|
4702
4696
|
})(event);
|
|
@@ -4787,7 +4781,6 @@ function EnableEditor(props) {
|
|
|
4787
4781
|
onMount(() => {
|
|
4788
4782
|
if (isBrowser()) {
|
|
4789
4783
|
if (isEditing()) {
|
|
4790
|
-
setForceReRenderCount(forceReRenderCount() + 1);
|
|
4791
4784
|
window.addEventListener("message", processMessage);
|
|
4792
4785
|
registerInsertMenu();
|
|
4793
4786
|
setupBrowserForEditing({
|
|
@@ -4854,41 +4847,37 @@ function EnableEditor(props) {
|
|
|
4854
4847
|
}
|
|
4855
4848
|
}
|
|
4856
4849
|
createEffect(on(() => [onUpdateFn_0_props_content()], onUpdateFn_0));
|
|
4857
|
-
const
|
|
4850
|
+
const onUpdateFn_1_props_builderContextSignal_content__data__jsCode = createMemo(() => props.builderContextSignal.content?.data?.jsCode);
|
|
4858
4851
|
function onUpdateFn_1() {
|
|
4859
|
-
}
|
|
4860
|
-
createEffect(on(() => [onUpdateFn_1_shouldSendResetCookie__()], onUpdateFn_1));
|
|
4861
|
-
const onUpdateFn_2_props_builderContextSignal_content__data__jsCode = createMemo(() => props.builderContextSignal.content?.data?.jsCode);
|
|
4862
|
-
function onUpdateFn_2() {
|
|
4863
4852
|
evaluateJsCode();
|
|
4864
4853
|
}
|
|
4865
|
-
createEffect(on(() => [
|
|
4866
|
-
const
|
|
4867
|
-
function
|
|
4854
|
+
createEffect(on(() => [onUpdateFn_1_props_builderContextSignal_content__data__jsCode()], onUpdateFn_1));
|
|
4855
|
+
const onUpdateFn_2_props_builderContextSignal_content__data__httpRequests = createMemo(() => props.builderContextSignal.content?.data?.httpRequests);
|
|
4856
|
+
function onUpdateFn_2() {
|
|
4868
4857
|
runHttpRequests();
|
|
4869
4858
|
}
|
|
4870
|
-
createEffect(on(() => [
|
|
4871
|
-
const
|
|
4872
|
-
function
|
|
4859
|
+
createEffect(on(() => [onUpdateFn_2_props_builderContextSignal_content__data__httpRequests()], onUpdateFn_2));
|
|
4860
|
+
const onUpdateFn_3_props_builderContextSignal_rootState = createMemo(() => props.builderContextSignal.rootState);
|
|
4861
|
+
function onUpdateFn_3() {
|
|
4873
4862
|
emitStateUpdate();
|
|
4874
4863
|
}
|
|
4875
|
-
createEffect(on(() => [
|
|
4876
|
-
const
|
|
4877
|
-
function
|
|
4864
|
+
createEffect(on(() => [onUpdateFn_3_props_builderContextSignal_rootState()], onUpdateFn_3));
|
|
4865
|
+
const onUpdateFn_4_props_data = createMemo(() => props.data);
|
|
4866
|
+
function onUpdateFn_4() {
|
|
4878
4867
|
if (props.data) {
|
|
4879
4868
|
mergeNewRootState(props.data);
|
|
4880
4869
|
}
|
|
4881
4870
|
}
|
|
4882
|
-
createEffect(on(() => [
|
|
4883
|
-
const
|
|
4884
|
-
function
|
|
4871
|
+
createEffect(on(() => [onUpdateFn_4_props_data()], onUpdateFn_4));
|
|
4872
|
+
const onUpdateFn_5_props_locale = createMemo(() => props.locale);
|
|
4873
|
+
function onUpdateFn_5() {
|
|
4885
4874
|
if (props.locale) {
|
|
4886
4875
|
mergeNewRootState({
|
|
4887
4876
|
locale: props.locale
|
|
4888
4877
|
});
|
|
4889
4878
|
}
|
|
4890
4879
|
}
|
|
4891
|
-
createEffect(on(() => [
|
|
4880
|
+
createEffect(on(() => [onUpdateFn_5_props_locale()], onUpdateFn_5));
|
|
4892
4881
|
return createComponent(builder_context_default.Provider, {
|
|
4893
4882
|
get value() {
|
|
4894
4883
|
return props.builderContextSignal;
|
|
@@ -4904,9 +4893,6 @@ function EnableEditor(props) {
|
|
|
4904
4893
|
return `variant-${props.content?.testVariationId || props.content?.id}`;
|
|
4905
4894
|
}
|
|
4906
4895
|
}, {}, {
|
|
4907
|
-
get key() {
|
|
4908
|
-
return forceReRenderCount();
|
|
4909
|
-
},
|
|
4910
4896
|
ref(r$) {
|
|
4911
4897
|
const _ref$ = elementRef;
|
|
4912
4898
|
typeof _ref$ === "function" ? _ref$(r$) : elementRef = r$;
|
|
@@ -4990,18 +4976,7 @@ var getCss = ({
|
|
|
4990
4976
|
}
|
|
4991
4977
|
return cssCode?.replace(/&/g, `div[builder-content-id="${contentId}"]`) || "";
|
|
4992
4978
|
};
|
|
4993
|
-
|
|
4994
|
-
// src/components/content/components/styles.tsx
|
|
4995
|
-
function ContentStyles(props) {
|
|
4996
|
-
const [injectedStyles, setInjectedStyles] = createSignal(`
|
|
4997
|
-
${getCss({
|
|
4998
|
-
cssCode: props.cssCode,
|
|
4999
|
-
contentId: props.contentId
|
|
5000
|
-
})}
|
|
5001
|
-
${getFontCss({
|
|
5002
|
-
customFonts: props.customFonts
|
|
5003
|
-
})}
|
|
5004
|
-
|
|
4979
|
+
var DEFAULT_STYLES = `
|
|
5005
4980
|
.builder-button {
|
|
5006
4981
|
all: unset;
|
|
5007
4982
|
}
|
|
@@ -5018,6 +4993,22 @@ ${getFontCss({
|
|
|
5018
4993
|
text-align: inherit;
|
|
5019
4994
|
font-family: inherit;
|
|
5020
4995
|
}
|
|
4996
|
+
`;
|
|
4997
|
+
var getDefaultStyles = (isNested) => {
|
|
4998
|
+
return !isNested ? DEFAULT_STYLES : "";
|
|
4999
|
+
};
|
|
5000
|
+
|
|
5001
|
+
// src/components/content/components/styles.tsx
|
|
5002
|
+
function ContentStyles(props) {
|
|
5003
|
+
const [injectedStyles, setInjectedStyles] = createSignal(`
|
|
5004
|
+
${getCss({
|
|
5005
|
+
cssCode: props.cssCode,
|
|
5006
|
+
contentId: props.contentId
|
|
5007
|
+
})}
|
|
5008
|
+
${getFontCss({
|
|
5009
|
+
customFonts: props.customFonts
|
|
5010
|
+
})}
|
|
5011
|
+
${getDefaultStyles(props.isNestedRender)}
|
|
5021
5012
|
`.trim());
|
|
5022
5013
|
return createComponent(inlined_styles_default, {
|
|
5023
5014
|
get styles() {
|
|
@@ -5182,6 +5173,9 @@ function ContentComponent(props) {
|
|
|
5182
5173
|
when: TARGET !== "reactNative",
|
|
5183
5174
|
get children() {
|
|
5184
5175
|
return createComponent(styles_default, {
|
|
5176
|
+
get isNestedRender() {
|
|
5177
|
+
return props.isNestedRender;
|
|
5178
|
+
},
|
|
5185
5179
|
get contentId() {
|
|
5186
5180
|
return builderContextSignal().content?.id;
|
|
5187
5181
|
},
|
|
@@ -5243,7 +5237,7 @@ function ContentVariants(props) {
|
|
|
5243
5237
|
});
|
|
5244
5238
|
return [createComponent(Show, {
|
|
5245
5239
|
get when() {
|
|
5246
|
-
return !props.
|
|
5240
|
+
return !props.isNestedRender && TARGET !== "reactNative";
|
|
5247
5241
|
},
|
|
5248
5242
|
get children() {
|
|
5249
5243
|
return createComponent(inlined_script_default, {
|
|
@@ -5275,6 +5269,9 @@ function ContentVariants(props) {
|
|
|
5275
5269
|
children: (variant, _index) => {
|
|
5276
5270
|
_index();
|
|
5277
5271
|
return createComponent(content_default, {
|
|
5272
|
+
get isNestedRender() {
|
|
5273
|
+
return props.isNestedRender;
|
|
5274
|
+
},
|
|
5278
5275
|
get key() {
|
|
5279
5276
|
return variant.testVariationId;
|
|
5280
5277
|
},
|
|
@@ -5332,7 +5329,11 @@ function ContentVariants(props) {
|
|
|
5332
5329
|
}
|
|
5333
5330
|
})];
|
|
5334
5331
|
}
|
|
5335
|
-
}), createComponent(content_default, mergeProps({
|
|
5332
|
+
}), createComponent(content_default, mergeProps({
|
|
5333
|
+
get isNestedRender() {
|
|
5334
|
+
return props.isNestedRender;
|
|
5335
|
+
}
|
|
5336
|
+
}, {}, {
|
|
5336
5337
|
get content() {
|
|
5337
5338
|
return defaultContent();
|
|
5338
5339
|
},
|
|
@@ -5447,7 +5448,7 @@ function Symbol(props) {
|
|
|
5447
5448
|
}
|
|
5448
5449
|
}, {}, () => props.attributes, {}), false, true);
|
|
5449
5450
|
insert(_el$, createComponent(content_variants_default, {
|
|
5450
|
-
|
|
5451
|
+
isNestedRender: true,
|
|
5451
5452
|
get apiVersion() {
|
|
5452
5453
|
return props.builderContext.apiVersion;
|
|
5453
5454
|
},
|