@builder.io/sdk-solid 0.14.5 → 1.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/browser/dev.js +188 -135
- package/lib/browser/dev.jsx +255 -174
- package/lib/browser/index.js +188 -135
- package/lib/browser/index.jsx +255 -174
- package/lib/edge/dev.js +188 -135
- package/lib/edge/dev.jsx +255 -174
- package/lib/edge/index.js +188 -135
- package/lib/edge/index.jsx +255 -174
- package/lib/node/dev.js +188 -135
- package/lib/node/dev.jsx +255 -174
- package/lib/node/index.js +188 -135
- package/lib/node/index.jsx +255 -174
- package/package.json +1 -1
package/lib/edge/dev.jsx
CHANGED
|
@@ -79,7 +79,7 @@ function Button(props) {
|
|
|
79
79
|
var button_default = Button;
|
|
80
80
|
|
|
81
81
|
// src/blocks/columns/columns.tsx
|
|
82
|
-
import { Show as Show6, For as For4, createSignal as
|
|
82
|
+
import { Show as Show6, For as For4, createSignal as createSignal6, createMemo as createMemo6 } from "solid-js";
|
|
83
83
|
import { css as css2 } from "solid-styled-components";
|
|
84
84
|
|
|
85
85
|
// src/components/blocks/blocks.tsx
|
|
@@ -107,7 +107,7 @@ import { createContext as createContext2 } from "solid-js";
|
|
|
107
107
|
var components_context_default = createContext2({ registeredComponents: {} });
|
|
108
108
|
|
|
109
109
|
// src/components/block/block.tsx
|
|
110
|
-
import { Show as Show4, For as For2, onMount,
|
|
110
|
+
import { Show as Show4, For as For2, onMount, createMemo as createMemo4 } from "solid-js";
|
|
111
111
|
|
|
112
112
|
// src/functions/get-block-component-options.ts
|
|
113
113
|
function getBlockComponentOptions(block) {
|
|
@@ -276,7 +276,7 @@ function flattenState({
|
|
|
276
276
|
return localState[prop];
|
|
277
277
|
}
|
|
278
278
|
const val = target[prop];
|
|
279
|
-
if (typeof val === "object") {
|
|
279
|
+
if (typeof val === "object" && val !== null) {
|
|
280
280
|
return flattenState({
|
|
281
281
|
rootState: val,
|
|
282
282
|
localState: void 0,
|
|
@@ -3485,6 +3485,30 @@ var shouldForceBrowserRuntimeInNode = () => {
|
|
|
3485
3485
|
var chooseBrowserOrServerEval = (args) => isBrowser() || shouldForceBrowserRuntimeInNode() ? runInBrowser(args) : runInEdge(args);
|
|
3486
3486
|
|
|
3487
3487
|
// src/functions/evaluate/evaluate.ts
|
|
3488
|
+
var EvalCache = class _EvalCache {
|
|
3489
|
+
static cacheLimit = 20;
|
|
3490
|
+
static cache = /* @__PURE__ */ new Map();
|
|
3491
|
+
static getCacheKey(args) {
|
|
3492
|
+
return JSON.stringify({
|
|
3493
|
+
...args,
|
|
3494
|
+
// replace the event with a random number to break cache
|
|
3495
|
+
// thats because we can't serialize the event object due to circular refs in DOM node refs.
|
|
3496
|
+
event: args.event ? Math.random() : void 0
|
|
3497
|
+
});
|
|
3498
|
+
}
|
|
3499
|
+
static getCachedValue(key) {
|
|
3500
|
+
const cachedVal = _EvalCache.cache.get(key);
|
|
3501
|
+
return cachedVal;
|
|
3502
|
+
}
|
|
3503
|
+
static setCachedValue(key, value) {
|
|
3504
|
+
if (_EvalCache.cache.size > 20) {
|
|
3505
|
+
_EvalCache.cache.delete(_EvalCache.cache.keys().next().value);
|
|
3506
|
+
}
|
|
3507
|
+
_EvalCache.cache.set(key, {
|
|
3508
|
+
value
|
|
3509
|
+
});
|
|
3510
|
+
}
|
|
3511
|
+
};
|
|
3488
3512
|
function evaluate({
|
|
3489
3513
|
code,
|
|
3490
3514
|
context,
|
|
@@ -3492,11 +3516,12 @@ function evaluate({
|
|
|
3492
3516
|
rootState,
|
|
3493
3517
|
rootSetState,
|
|
3494
3518
|
event,
|
|
3495
|
-
isExpression = true
|
|
3519
|
+
isExpression = true,
|
|
3520
|
+
enableCache
|
|
3496
3521
|
}) {
|
|
3497
3522
|
if (code === "") {
|
|
3498
3523
|
logger.warn("Skipping evaluation of empty code block.");
|
|
3499
|
-
return;
|
|
3524
|
+
return void 0;
|
|
3500
3525
|
}
|
|
3501
3526
|
const args = {
|
|
3502
3527
|
code: parseCode(code, {
|
|
@@ -3509,8 +3534,20 @@ function evaluate({
|
|
|
3509
3534
|
rootState,
|
|
3510
3535
|
localState
|
|
3511
3536
|
};
|
|
3537
|
+
if (enableCache) {
|
|
3538
|
+
const cacheKey = EvalCache.getCacheKey(args);
|
|
3539
|
+
const cachedValue = EvalCache.getCachedValue(cacheKey);
|
|
3540
|
+
if (cachedValue) {
|
|
3541
|
+
return cachedValue.value;
|
|
3542
|
+
}
|
|
3543
|
+
}
|
|
3512
3544
|
try {
|
|
3513
|
-
|
|
3545
|
+
const newEval = chooseBrowserOrServerEval(args);
|
|
3546
|
+
if (enableCache) {
|
|
3547
|
+
const cacheKey = EvalCache.getCacheKey(args);
|
|
3548
|
+
EvalCache.setCachedValue(cacheKey, newEval);
|
|
3549
|
+
}
|
|
3550
|
+
return newEval;
|
|
3514
3551
|
} catch (e) {
|
|
3515
3552
|
logger.error("Failed code evaluation: " + e.message, {
|
|
3516
3553
|
code
|
|
@@ -3555,7 +3592,8 @@ var evaluateBindings = ({
|
|
|
3555
3592
|
localState,
|
|
3556
3593
|
rootState,
|
|
3557
3594
|
rootSetState,
|
|
3558
|
-
context
|
|
3595
|
+
context,
|
|
3596
|
+
enableCache: true
|
|
3559
3597
|
});
|
|
3560
3598
|
set(copied, binding, value);
|
|
3561
3599
|
}
|
|
@@ -3789,6 +3827,70 @@ function bindScrollInViewAnimation(animation) {
|
|
|
3789
3827
|
});
|
|
3790
3828
|
}
|
|
3791
3829
|
|
|
3830
|
+
// src/functions/camel-to-kebab-case.ts
|
|
3831
|
+
var camelToKebabCase = (string) => string.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase();
|
|
3832
|
+
|
|
3833
|
+
// src/helpers/css.ts
|
|
3834
|
+
var convertStyleMapToCSSArray = (style) => {
|
|
3835
|
+
const cssProps = Object.entries(style).map(([key, value]) => {
|
|
3836
|
+
if (typeof value === "string") {
|
|
3837
|
+
return `${camelToKebabCase(key)}: ${value};`;
|
|
3838
|
+
} else {
|
|
3839
|
+
return void 0;
|
|
3840
|
+
}
|
|
3841
|
+
});
|
|
3842
|
+
return cssProps.filter(checkIsDefined);
|
|
3843
|
+
};
|
|
3844
|
+
var convertStyleMapToCSS = (style) => convertStyleMapToCSSArray(style).join("\n");
|
|
3845
|
+
var createCssClass = ({
|
|
3846
|
+
mediaQuery,
|
|
3847
|
+
className,
|
|
3848
|
+
styles
|
|
3849
|
+
}) => {
|
|
3850
|
+
const cssClass = `.${className} {
|
|
3851
|
+
${convertStyleMapToCSS(styles)}
|
|
3852
|
+
}`;
|
|
3853
|
+
if (mediaQuery) {
|
|
3854
|
+
return `${mediaQuery} {
|
|
3855
|
+
${cssClass}
|
|
3856
|
+
}`;
|
|
3857
|
+
} else {
|
|
3858
|
+
return cssClass;
|
|
3859
|
+
}
|
|
3860
|
+
};
|
|
3861
|
+
|
|
3862
|
+
// src/functions/transform-style-property.ts
|
|
3863
|
+
function transformStyleProperty({
|
|
3864
|
+
style
|
|
3865
|
+
}) {
|
|
3866
|
+
return style;
|
|
3867
|
+
}
|
|
3868
|
+
|
|
3869
|
+
// src/functions/get-style.ts
|
|
3870
|
+
var getStyle = ({
|
|
3871
|
+
block,
|
|
3872
|
+
context
|
|
3873
|
+
}) => {
|
|
3874
|
+
return mapStyleObjToStrIfNeeded(transformStyleProperty({
|
|
3875
|
+
style: block.style || {},
|
|
3876
|
+
context,
|
|
3877
|
+
block
|
|
3878
|
+
}));
|
|
3879
|
+
};
|
|
3880
|
+
function mapStyleObjToStrIfNeeded(style) {
|
|
3881
|
+
switch (TARGET) {
|
|
3882
|
+
case "svelte":
|
|
3883
|
+
case "vue":
|
|
3884
|
+
case "solid":
|
|
3885
|
+
return convertStyleMapToCSSArray(style).join(" ");
|
|
3886
|
+
case "qwik":
|
|
3887
|
+
case "reactNative":
|
|
3888
|
+
case "react":
|
|
3889
|
+
case "rsc":
|
|
3890
|
+
return style;
|
|
3891
|
+
}
|
|
3892
|
+
}
|
|
3893
|
+
|
|
3792
3894
|
// src/components/block/block.helpers.ts
|
|
3793
3895
|
var getComponent = ({
|
|
3794
3896
|
block,
|
|
@@ -3832,7 +3934,8 @@ var getRepeatItemData = ({
|
|
|
3832
3934
|
localState: context.localState,
|
|
3833
3935
|
rootState: context.rootState,
|
|
3834
3936
|
rootSetState: context.rootSetState,
|
|
3835
|
-
context: context.context
|
|
3937
|
+
context: context.context,
|
|
3938
|
+
enableCache: true
|
|
3836
3939
|
});
|
|
3837
3940
|
if (!Array.isArray(itemsArray)) {
|
|
3838
3941
|
return void 0;
|
|
@@ -3856,7 +3959,7 @@ var getRepeatItemData = ({
|
|
|
3856
3959
|
};
|
|
3857
3960
|
|
|
3858
3961
|
// src/components/block/components/block-styles.tsx
|
|
3859
|
-
import { Show as Show2 } from "solid-js";
|
|
3962
|
+
import { Show as Show2, createMemo } from "solid-js";
|
|
3860
3963
|
|
|
3861
3964
|
// src/constants/device-sizes.ts
|
|
3862
3965
|
var SIZES = {
|
|
@@ -3907,38 +4010,6 @@ var getSizesForBreakpoints = ({
|
|
|
3907
4010
|
return newSizes;
|
|
3908
4011
|
};
|
|
3909
4012
|
|
|
3910
|
-
// src/functions/camel-to-kebab-case.ts
|
|
3911
|
-
var camelToKebabCase = (string) => string.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase();
|
|
3912
|
-
|
|
3913
|
-
// src/helpers/css.ts
|
|
3914
|
-
var convertStyleMapToCSSArray = (style) => {
|
|
3915
|
-
const cssProps = Object.entries(style).map(([key, value]) => {
|
|
3916
|
-
if (typeof value === "string") {
|
|
3917
|
-
return `${camelToKebabCase(key)}: ${value};`;
|
|
3918
|
-
} else {
|
|
3919
|
-
return void 0;
|
|
3920
|
-
}
|
|
3921
|
-
});
|
|
3922
|
-
return cssProps.filter(checkIsDefined);
|
|
3923
|
-
};
|
|
3924
|
-
var convertStyleMapToCSS = (style) => convertStyleMapToCSSArray(style).join("\n");
|
|
3925
|
-
var createCssClass = ({
|
|
3926
|
-
mediaQuery,
|
|
3927
|
-
className,
|
|
3928
|
-
styles
|
|
3929
|
-
}) => {
|
|
3930
|
-
const cssClass = `.${className} {
|
|
3931
|
-
${convertStyleMapToCSS(styles)}
|
|
3932
|
-
}`;
|
|
3933
|
-
if (mediaQuery) {
|
|
3934
|
-
return `${mediaQuery} {
|
|
3935
|
-
${cssClass}
|
|
3936
|
-
}`;
|
|
3937
|
-
} else {
|
|
3938
|
-
return cssClass;
|
|
3939
|
-
}
|
|
3940
|
-
};
|
|
3941
|
-
|
|
3942
4013
|
// src/components/inlined-styles.tsx
|
|
3943
4014
|
function InlinedStyles(props) {
|
|
3944
4015
|
return <style innerHTML={props.styles} id={props.id} />;
|
|
@@ -3947,7 +4018,7 @@ var Inlined_styles_default = InlinedStyles;
|
|
|
3947
4018
|
|
|
3948
4019
|
// src/components/block/components/block-styles.tsx
|
|
3949
4020
|
function BlockStyles(props) {
|
|
3950
|
-
|
|
4021
|
+
const canShowBlock = createMemo(() => {
|
|
3951
4022
|
const processedBlock = getProcessedBlock({
|
|
3952
4023
|
block: props.block,
|
|
3953
4024
|
localState: props.context.localState,
|
|
@@ -3963,8 +4034,8 @@ function BlockStyles(props) {
|
|
|
3963
4034
|
return processedBlock.show;
|
|
3964
4035
|
}
|
|
3965
4036
|
return true;
|
|
3966
|
-
}
|
|
3967
|
-
|
|
4037
|
+
});
|
|
4038
|
+
const css5 = createMemo(() => {
|
|
3968
4039
|
const processedBlock = getProcessedBlock({
|
|
3969
4040
|
block: props.block,
|
|
3970
4041
|
localState: props.context.localState,
|
|
@@ -4006,7 +4077,7 @@ function BlockStyles(props) {
|
|
|
4006
4077
|
)
|
|
4007
4078
|
}) : "";
|
|
4008
4079
|
return [largeStylesClass, mediumStylesClass, smallStylesClass].join(" ");
|
|
4009
|
-
}
|
|
4080
|
+
});
|
|
4010
4081
|
return <Show2 when={TARGET !== "reactNative" && css5() && canShowBlock()}><Inlined_styles_default styles={css5()} /></Show2>;
|
|
4011
4082
|
}
|
|
4012
4083
|
var Block_styles_default = BlockStyles;
|
|
@@ -4025,7 +4096,8 @@ var createEventHandler = (value, options) => (event) => evaluate({
|
|
|
4025
4096
|
rootState: options.rootState,
|
|
4026
4097
|
rootSetState: options.rootSetState,
|
|
4027
4098
|
event,
|
|
4028
|
-
isExpression: false
|
|
4099
|
+
isExpression: false,
|
|
4100
|
+
enableCache: true
|
|
4029
4101
|
});
|
|
4030
4102
|
|
|
4031
4103
|
// src/functions/get-block-actions.ts
|
|
@@ -4053,38 +4125,6 @@ function getBlockActions(options) {
|
|
|
4053
4125
|
return obj;
|
|
4054
4126
|
}
|
|
4055
4127
|
|
|
4056
|
-
// src/functions/transform-style-property.ts
|
|
4057
|
-
function transformStyleProperty({
|
|
4058
|
-
style
|
|
4059
|
-
}) {
|
|
4060
|
-
return style;
|
|
4061
|
-
}
|
|
4062
|
-
|
|
4063
|
-
// src/functions/get-style.ts
|
|
4064
|
-
var getStyle = ({
|
|
4065
|
-
block,
|
|
4066
|
-
context
|
|
4067
|
-
}) => {
|
|
4068
|
-
return mapStyleObjToStrIfNeeded(transformStyleProperty({
|
|
4069
|
-
style: block.style || {},
|
|
4070
|
-
context,
|
|
4071
|
-
block
|
|
4072
|
-
}));
|
|
4073
|
-
};
|
|
4074
|
-
function mapStyleObjToStrIfNeeded(style) {
|
|
4075
|
-
switch (TARGET) {
|
|
4076
|
-
case "svelte":
|
|
4077
|
-
case "vue":
|
|
4078
|
-
case "solid":
|
|
4079
|
-
return convertStyleMapToCSSArray(style).join(" ");
|
|
4080
|
-
case "qwik":
|
|
4081
|
-
case "reactNative":
|
|
4082
|
-
case "react":
|
|
4083
|
-
case "rsc":
|
|
4084
|
-
return style;
|
|
4085
|
-
}
|
|
4086
|
-
}
|
|
4087
|
-
|
|
4088
4128
|
// src/functions/transform-block-properties.ts
|
|
4089
4129
|
function transformBlockProperties({
|
|
4090
4130
|
properties
|
|
@@ -4244,21 +4284,20 @@ var Repeated_block_default = RepeatedBlock;
|
|
|
4244
4284
|
|
|
4245
4285
|
// src/components/block/block.tsx
|
|
4246
4286
|
function Block(props) {
|
|
4247
|
-
const
|
|
4248
|
-
function blockComponent() {
|
|
4287
|
+
const blockComponent = createMemo4(() => {
|
|
4249
4288
|
return getComponent({
|
|
4250
4289
|
block: props.block,
|
|
4251
4290
|
context: props.context,
|
|
4252
4291
|
registeredComponents: props.registeredComponents
|
|
4253
4292
|
});
|
|
4254
|
-
}
|
|
4255
|
-
|
|
4293
|
+
});
|
|
4294
|
+
const repeatItem = createMemo4(() => {
|
|
4256
4295
|
return getRepeatItemData({
|
|
4257
4296
|
block: props.block,
|
|
4258
4297
|
context: props.context
|
|
4259
4298
|
});
|
|
4260
|
-
}
|
|
4261
|
-
|
|
4299
|
+
});
|
|
4300
|
+
const processedBlock = createMemo4(() => {
|
|
4262
4301
|
return props.block.repeat?.collection ? props.block : getProcessedBlock({
|
|
4263
4302
|
block: props.block,
|
|
4264
4303
|
localState: props.context.localState,
|
|
@@ -4267,15 +4306,15 @@ function Block(props) {
|
|
|
4267
4306
|
context: props.context.context,
|
|
4268
4307
|
shouldEvaluateBindings: true
|
|
4269
4308
|
});
|
|
4270
|
-
}
|
|
4271
|
-
|
|
4309
|
+
});
|
|
4310
|
+
const Tag = createMemo4(() => {
|
|
4272
4311
|
const shouldUseLink = props.block.tagName === "a" || processedBlock().properties?.href || processedBlock().href;
|
|
4273
4312
|
if (shouldUseLink) {
|
|
4274
4313
|
return props.linkComponent || "a";
|
|
4275
4314
|
}
|
|
4276
4315
|
return props.block.tagName || "div";
|
|
4277
|
-
}
|
|
4278
|
-
|
|
4316
|
+
});
|
|
4317
|
+
const canShowBlock = createMemo4(() => {
|
|
4279
4318
|
if (props.block.repeat?.collection) {
|
|
4280
4319
|
if (repeatItem()?.length)
|
|
4281
4320
|
return true;
|
|
@@ -4284,12 +4323,12 @@ function Block(props) {
|
|
|
4284
4323
|
const shouldHide = "hide" in processedBlock() ? processedBlock().hide : false;
|
|
4285
4324
|
const shouldShow = "show" in processedBlock() ? processedBlock().show : true;
|
|
4286
4325
|
return shouldShow && !shouldHide;
|
|
4287
|
-
}
|
|
4288
|
-
|
|
4326
|
+
});
|
|
4327
|
+
const childrenWithoutParentComponent = createMemo4(() => {
|
|
4289
4328
|
const shouldRenderChildrenOutsideRef = !blockComponent()?.component && !repeatItem();
|
|
4290
4329
|
return shouldRenderChildrenOutsideRef ? processedBlock().children ?? [] : [];
|
|
4291
|
-
}
|
|
4292
|
-
|
|
4330
|
+
});
|
|
4331
|
+
const componentRefProps = createMemo4(() => {
|
|
4293
4332
|
return {
|
|
4294
4333
|
blockChildren: processedBlock().children ?? [],
|
|
4295
4334
|
componentRef: blockComponent()?.component,
|
|
@@ -4303,14 +4342,14 @@ function Block(props) {
|
|
|
4303
4342
|
builderComponents: props.registeredComponents
|
|
4304
4343
|
} : {}
|
|
4305
4344
|
},
|
|
4306
|
-
context:
|
|
4345
|
+
context: props.context,
|
|
4307
4346
|
linkComponent: props.linkComponent,
|
|
4308
4347
|
registeredComponents: props.registeredComponents,
|
|
4309
4348
|
builderBlock: processedBlock(),
|
|
4310
4349
|
includeBlockProps: blockComponent()?.noWrap === true,
|
|
4311
4350
|
isInteractive: !blockComponent()?.isRSC
|
|
4312
4351
|
};
|
|
4313
|
-
}
|
|
4352
|
+
});
|
|
4314
4353
|
onMount(() => {
|
|
4315
4354
|
const blockId = processedBlock().id;
|
|
4316
4355
|
const animations = processedBlock().animations;
|
|
@@ -4372,9 +4411,9 @@ function Block(props) {
|
|
|
4372
4411
|
return <Block
|
|
4373
4412
|
key={child.id}
|
|
4374
4413
|
block={child}
|
|
4375
|
-
context={childrenContext()}
|
|
4376
4414
|
registeredComponents={props.registeredComponents}
|
|
4377
4415
|
linkComponent={props.linkComponent}
|
|
4416
|
+
context={props.context}
|
|
4378
4417
|
/>;
|
|
4379
4418
|
}}</For2>
|
|
4380
4419
|
</Block_wrapper_default></Show4></Show4>
|
|
@@ -4383,12 +4422,13 @@ function Block(props) {
|
|
|
4383
4422
|
var Block_default = Block;
|
|
4384
4423
|
|
|
4385
4424
|
// src/components/blocks/blocks-wrapper.tsx
|
|
4425
|
+
import { createMemo as createMemo5 } from "solid-js";
|
|
4386
4426
|
import { Dynamic as Dynamic4 } from "solid-js/web";
|
|
4387
4427
|
import { css } from "solid-styled-components";
|
|
4388
4428
|
function BlocksWrapper(props) {
|
|
4389
|
-
|
|
4429
|
+
const className = createMemo5(() => {
|
|
4390
4430
|
return "builder-blocks" + (!props.blocks?.length ? " no-blocks" : "");
|
|
4391
|
-
}
|
|
4431
|
+
});
|
|
4392
4432
|
function onClick() {
|
|
4393
4433
|
if (isEditing() && !props.blocks?.length) {
|
|
4394
4434
|
window.parent?.postMessage(
|
|
@@ -4462,12 +4502,12 @@ var Blocks_default = Blocks;
|
|
|
4462
4502
|
|
|
4463
4503
|
// src/blocks/columns/columns.tsx
|
|
4464
4504
|
function Columns(props) {
|
|
4465
|
-
const [gutterSize, setGutterSize] =
|
|
4505
|
+
const [gutterSize, setGutterSize] = createSignal6(
|
|
4466
4506
|
typeof props.space === "number" ? props.space || 0 : 20
|
|
4467
4507
|
);
|
|
4468
|
-
const [cols, setCols] =
|
|
4469
|
-
const [stackAt, setStackAt] =
|
|
4470
|
-
const [flexDir, setFlexDir] =
|
|
4508
|
+
const [cols, setCols] = createSignal6(props.columns || []);
|
|
4509
|
+
const [stackAt, setStackAt] = createSignal6(props.stackColumnsAt || "tablet");
|
|
4510
|
+
const [flexDir, setFlexDir] = createSignal6(
|
|
4471
4511
|
props.stackColumnsAt === "never" ? "row" : props.reverseColumnsWhenStacked ? "column-reverse" : "column"
|
|
4472
4512
|
);
|
|
4473
4513
|
function getWidth(index) {
|
|
@@ -4489,7 +4529,7 @@ function Columns(props) {
|
|
|
4489
4529
|
}) {
|
|
4490
4530
|
return stackAt() === "never" ? desktopStyle : stackedStyle;
|
|
4491
4531
|
}
|
|
4492
|
-
|
|
4532
|
+
const columnsCssVars = createMemo6(() => {
|
|
4493
4533
|
return {
|
|
4494
4534
|
"--flex-dir": flexDir(),
|
|
4495
4535
|
"--flex-dir-tablet": getTabletStyle({
|
|
@@ -4497,7 +4537,7 @@ function Columns(props) {
|
|
|
4497
4537
|
desktopStyle: "row"
|
|
4498
4538
|
})
|
|
4499
4539
|
};
|
|
4500
|
-
}
|
|
4540
|
+
});
|
|
4501
4541
|
function columnCssVars(index) {
|
|
4502
4542
|
const gutter = index === 0 ? 0 : gutterSize();
|
|
4503
4543
|
const width = getColumnCssWidth(index);
|
|
@@ -4538,7 +4578,7 @@ function Columns(props) {
|
|
|
4538
4578
|
);
|
|
4539
4579
|
return breakpointSizes[size].max;
|
|
4540
4580
|
}
|
|
4541
|
-
|
|
4581
|
+
const columnsStyles = createMemo6(() => {
|
|
4542
4582
|
return `
|
|
4543
4583
|
@media (max-width: ${getWidthForBreakpointSize("medium")}px) {
|
|
4544
4584
|
.${props.builderBlock.id}-breakpoints {
|
|
@@ -4564,7 +4604,7 @@ function Columns(props) {
|
|
|
4564
4604
|
}
|
|
4565
4605
|
},
|
|
4566
4606
|
`;
|
|
4567
|
-
}
|
|
4607
|
+
});
|
|
4568
4608
|
return <div
|
|
4569
4609
|
class={`builder-columns ${props.builderBlock.id}-breakpoints ` + css2({
|
|
4570
4610
|
display: "flex",
|
|
@@ -4611,7 +4651,7 @@ function FragmentComponent(props) {
|
|
|
4611
4651
|
var fragment_default = FragmentComponent;
|
|
4612
4652
|
|
|
4613
4653
|
// src/blocks/image/image.tsx
|
|
4614
|
-
import { Show as Show7 } from "solid-js";
|
|
4654
|
+
import { Show as Show7, createMemo as createMemo7 } from "solid-js";
|
|
4615
4655
|
import { css as css3 } from "solid-styled-components";
|
|
4616
4656
|
|
|
4617
4657
|
// src/blocks/image/image.helpers.ts
|
|
@@ -4663,7 +4703,7 @@ function getSrcSet(url) {
|
|
|
4663
4703
|
|
|
4664
4704
|
// src/blocks/image/image.tsx
|
|
4665
4705
|
function Image(props) {
|
|
4666
|
-
|
|
4706
|
+
const srcSetToUse = createMemo7(() => {
|
|
4667
4707
|
const imageToUse = props.image || props.src;
|
|
4668
4708
|
const url = imageToUse;
|
|
4669
4709
|
if (!url || // We can auto add srcset for cdn.builder.io and shopify
|
|
@@ -4680,15 +4720,15 @@ function Image(props) {
|
|
|
4680
4720
|
return getSrcSet(url);
|
|
4681
4721
|
}
|
|
4682
4722
|
return getSrcSet(url);
|
|
4683
|
-
}
|
|
4684
|
-
|
|
4723
|
+
});
|
|
4724
|
+
const webpSrcSet = createMemo7(() => {
|
|
4685
4725
|
if (srcSetToUse()?.match(/builder\.io/) && !props.noWebp) {
|
|
4686
4726
|
return srcSetToUse().replace(/\?/g, "?format=webp&");
|
|
4687
4727
|
} else {
|
|
4688
4728
|
return "";
|
|
4689
4729
|
}
|
|
4690
|
-
}
|
|
4691
|
-
|
|
4730
|
+
});
|
|
4731
|
+
const aspectRatioCss = createMemo7(() => {
|
|
4692
4732
|
const aspectRatioStyles = {
|
|
4693
4733
|
position: "absolute",
|
|
4694
4734
|
height: "100%",
|
|
@@ -4698,7 +4738,7 @@ function Image(props) {
|
|
|
4698
4738
|
};
|
|
4699
4739
|
const out = props.aspectRatio ? aspectRatioStyles : void 0;
|
|
4700
4740
|
return out;
|
|
4701
|
-
}
|
|
4741
|
+
});
|
|
4702
4742
|
return <>
|
|
4703
4743
|
<picture>
|
|
4704
4744
|
<Show7 when={webpSrcSet()}><source type="image/webp" srcset={webpSrcSet()} /></Show7>
|
|
@@ -4709,7 +4749,7 @@ function Image(props) {
|
|
|
4709
4749
|
})}
|
|
4710
4750
|
loading="lazy"
|
|
4711
4751
|
alt={props.altText}
|
|
4712
|
-
role={props.altText ? "presentation"
|
|
4752
|
+
role={props.altText ? void 0 : "presentation"}
|
|
4713
4753
|
style={{
|
|
4714
4754
|
"object-position": props.backgroundPosition || "center",
|
|
4715
4755
|
"object-fit": props.backgroundSize || "cover",
|
|
@@ -4771,10 +4811,10 @@ function SectionComponent(props) {
|
|
|
4771
4811
|
var section_default = SectionComponent;
|
|
4772
4812
|
|
|
4773
4813
|
// src/blocks/symbol/symbol.tsx
|
|
4774
|
-
import { onMount as onMount5, on as on3, createEffect as createEffect3, createSignal as
|
|
4814
|
+
import { onMount as onMount5, on as on3, createEffect as createEffect3, createMemo as createMemo16, createSignal as createSignal16 } from "solid-js";
|
|
4775
4815
|
|
|
4776
4816
|
// src/components/content-variants/content-variants.tsx
|
|
4777
|
-
import { Show as Show12, For as For7, onMount as onMount4, createSignal as
|
|
4817
|
+
import { Show as Show12, For as For7, onMount as onMount4, createSignal as createSignal15, createMemo as createMemo15 } from "solid-js";
|
|
4778
4818
|
|
|
4779
4819
|
// src/helpers/url.ts
|
|
4780
4820
|
var getTopLevelDomain = (host) => {
|
|
@@ -4968,7 +5008,7 @@ var handleABTesting = async ({
|
|
|
4968
5008
|
var getDefaultCanTrack = (canTrack) => checkIsDefined(canTrack) ? canTrack : true;
|
|
4969
5009
|
|
|
4970
5010
|
// src/components/content/content.tsx
|
|
4971
|
-
import { Show as Show11, createSignal as
|
|
5011
|
+
import { Show as Show11, createSignal as createSignal14 } from "solid-js";
|
|
4972
5012
|
|
|
4973
5013
|
// src/blocks/button/component-info.ts
|
|
4974
5014
|
var componentInfo = {
|
|
@@ -5529,10 +5569,10 @@ var componentInfo9 = {
|
|
|
5529
5569
|
};
|
|
5530
5570
|
|
|
5531
5571
|
// src/blocks/custom-code/custom-code.tsx
|
|
5532
|
-
import { onMount as onMount2, createSignal as
|
|
5572
|
+
import { onMount as onMount2, createSignal as createSignal8 } from "solid-js";
|
|
5533
5573
|
function CustomCode(props) {
|
|
5534
|
-
const [scriptsInserted, setScriptsInserted] =
|
|
5535
|
-
const [scriptsRun, setScriptsRun] =
|
|
5574
|
+
const [scriptsInserted, setScriptsInserted] = createSignal8([]);
|
|
5575
|
+
const [scriptsRun, setScriptsRun] = createSignal8([]);
|
|
5536
5576
|
let elementRef;
|
|
5537
5577
|
onMount2(() => {
|
|
5538
5578
|
if (!elementRef?.getElementsByTagName || typeof window === "undefined") {
|
|
@@ -5614,7 +5654,7 @@ var componentInfo10 = {
|
|
|
5614
5654
|
};
|
|
5615
5655
|
|
|
5616
5656
|
// src/blocks/embed/embed.tsx
|
|
5617
|
-
import { on, createEffect, createSignal as
|
|
5657
|
+
import { on, createEffect, createMemo as createMemo9, createSignal as createSignal9 } from "solid-js";
|
|
5618
5658
|
|
|
5619
5659
|
// src/blocks/embed/helpers.ts
|
|
5620
5660
|
var SCRIPT_MIME_TYPES = ["text/javascript", "application/javascript", "application/ecmascript"];
|
|
@@ -5622,9 +5662,9 @@ var isJsScript = (script) => SCRIPT_MIME_TYPES.includes(script.type);
|
|
|
5622
5662
|
|
|
5623
5663
|
// src/blocks/embed/embed.tsx
|
|
5624
5664
|
function Embed(props) {
|
|
5625
|
-
const [scriptsInserted, setScriptsInserted] =
|
|
5626
|
-
const [scriptsRun, setScriptsRun] =
|
|
5627
|
-
const [ranInitFn, setRanInitFn] =
|
|
5665
|
+
const [scriptsInserted, setScriptsInserted] = createSignal9([]);
|
|
5666
|
+
const [scriptsRun, setScriptsRun] = createSignal9([]);
|
|
5667
|
+
const [ranInitFn, setRanInitFn] = createSignal9(false);
|
|
5628
5668
|
function findAndRunScripts() {
|
|
5629
5669
|
if (!elem || !elem.getElementsByTagName)
|
|
5630
5670
|
return;
|
|
@@ -5648,13 +5688,17 @@ function Embed(props) {
|
|
|
5648
5688
|
}
|
|
5649
5689
|
}
|
|
5650
5690
|
let elem;
|
|
5691
|
+
const onUpdateFn_0_elem = createMemo9(() => elem);
|
|
5692
|
+
const onUpdateFn_0_ranInitFn__ = createMemo9(() => ranInitFn());
|
|
5651
5693
|
function onUpdateFn_0() {
|
|
5652
5694
|
if (elem && !ranInitFn()) {
|
|
5653
5695
|
setRanInitFn(true);
|
|
5654
5696
|
findAndRunScripts();
|
|
5655
5697
|
}
|
|
5656
5698
|
}
|
|
5657
|
-
createEffect(
|
|
5699
|
+
createEffect(
|
|
5700
|
+
on(() => [onUpdateFn_0_elem(), onUpdateFn_0_ranInitFn__()], onUpdateFn_0)
|
|
5701
|
+
);
|
|
5658
5702
|
return <div class="builder-embed" ref={elem} innerHTML={props.content} />;
|
|
5659
5703
|
}
|
|
5660
5704
|
var embed_default = Embed;
|
|
@@ -5894,7 +5938,7 @@ var componentInfo11 = {
|
|
|
5894
5938
|
};
|
|
5895
5939
|
|
|
5896
5940
|
// src/blocks/form/form/form.tsx
|
|
5897
|
-
import { Show as Show8, For as For5, createSignal as
|
|
5941
|
+
import { Show as Show8, For as For5, createSignal as createSignal10 } from "solid-js";
|
|
5898
5942
|
import { css as css4 } from "solid-styled-components";
|
|
5899
5943
|
|
|
5900
5944
|
// src/functions/get-env.ts
|
|
@@ -5912,9 +5956,9 @@ var get = (obj, path, defaultValue) => {
|
|
|
5912
5956
|
|
|
5913
5957
|
// src/blocks/form/form/form.tsx
|
|
5914
5958
|
function FormComponent(props) {
|
|
5915
|
-
const [formState, setFormState] =
|
|
5916
|
-
const [responseData, setResponseData] =
|
|
5917
|
-
const [formErrorMessage, setFormErrorMessage] =
|
|
5959
|
+
const [formState, setFormState] = createSignal10("unsubmitted");
|
|
5960
|
+
const [responseData, setResponseData] = createSignal10(null);
|
|
5961
|
+
const [formErrorMessage, setFormErrorMessage] = createSignal10("");
|
|
5918
5962
|
function mergeNewRootState(newData) {
|
|
5919
5963
|
const combinedState = {
|
|
5920
5964
|
...props.builderContext.rootState,
|
|
@@ -6430,9 +6474,9 @@ var componentInfo16 = {
|
|
|
6430
6474
|
};
|
|
6431
6475
|
|
|
6432
6476
|
// src/blocks/video/video.tsx
|
|
6433
|
-
import { Show as Show9 } from "solid-js";
|
|
6477
|
+
import { Show as Show9, createMemo as createMemo11 } from "solid-js";
|
|
6434
6478
|
function Video(props) {
|
|
6435
|
-
|
|
6479
|
+
const videoProps = createMemo11(() => {
|
|
6436
6480
|
return {
|
|
6437
6481
|
...props.autoPlay === true ? {
|
|
6438
6482
|
autoPlay: true
|
|
@@ -6450,12 +6494,12 @@ function Video(props) {
|
|
|
6450
6494
|
playsInline: true
|
|
6451
6495
|
} : {}
|
|
6452
6496
|
};
|
|
6453
|
-
}
|
|
6454
|
-
|
|
6497
|
+
});
|
|
6498
|
+
const spreadProps = createMemo11(() => {
|
|
6455
6499
|
return {
|
|
6456
6500
|
...videoProps()
|
|
6457
6501
|
};
|
|
6458
|
-
}
|
|
6502
|
+
});
|
|
6459
6503
|
return <div
|
|
6460
6504
|
style={{
|
|
6461
6505
|
position: "relative"
|
|
@@ -6645,7 +6689,14 @@ function InlinedScript(props) {
|
|
|
6645
6689
|
var Inlined_script_default = InlinedScript;
|
|
6646
6690
|
|
|
6647
6691
|
// src/components/content/components/enable-editor.tsx
|
|
6648
|
-
import {
|
|
6692
|
+
import {
|
|
6693
|
+
Show as Show10,
|
|
6694
|
+
onMount as onMount3,
|
|
6695
|
+
on as on2,
|
|
6696
|
+
createEffect as createEffect2,
|
|
6697
|
+
createMemo as createMemo12,
|
|
6698
|
+
createSignal as createSignal12
|
|
6699
|
+
} from "solid-js";
|
|
6649
6700
|
import { Dynamic as Dynamic5 } from "solid-js/web";
|
|
6650
6701
|
|
|
6651
6702
|
// src/helpers/preview-lru-cache/get.ts
|
|
@@ -7133,7 +7184,7 @@ function isFromTrustedHost(trustedHosts, e) {
|
|
|
7133
7184
|
}
|
|
7134
7185
|
|
|
7135
7186
|
// src/constants/sdk-version.ts
|
|
7136
|
-
var SDK_VERSION = "0.
|
|
7187
|
+
var SDK_VERSION = "1.0.12";
|
|
7137
7188
|
|
|
7138
7189
|
// src/functions/register.ts
|
|
7139
7190
|
var registry = {};
|
|
@@ -7332,15 +7383,15 @@ var subscribeToEditor = (model, callback, options) => {
|
|
|
7332
7383
|
|
|
7333
7384
|
// src/components/content/components/enable-editor.tsx
|
|
7334
7385
|
function EnableEditor(props) {
|
|
7335
|
-
const [forceReRenderCount, setForceReRenderCount] =
|
|
7336
|
-
const [firstRender, setFirstRender] =
|
|
7337
|
-
const [lastUpdated, setLastUpdated] =
|
|
7338
|
-
const [shouldSendResetCookie, setShouldSendResetCookie] =
|
|
7339
|
-
const [ContentWrapper, setContentWrapper] =
|
|
7386
|
+
const [forceReRenderCount, setForceReRenderCount] = createSignal12(0);
|
|
7387
|
+
const [firstRender, setFirstRender] = createSignal12(true);
|
|
7388
|
+
const [lastUpdated, setLastUpdated] = createSignal12(0);
|
|
7389
|
+
const [shouldSendResetCookie, setShouldSendResetCookie] = createSignal12(false);
|
|
7390
|
+
const [ContentWrapper, setContentWrapper] = createSignal12(
|
|
7340
7391
|
props.contentWrapper || "div"
|
|
7341
7392
|
);
|
|
7342
|
-
const [httpReqsData, setHttpReqsData] =
|
|
7343
|
-
const [clicked, setClicked] =
|
|
7393
|
+
const [httpReqsData, setHttpReqsData] = createSignal12({});
|
|
7394
|
+
const [clicked, setClicked] = createSignal12(false);
|
|
7344
7395
|
function mergeNewRootState(newData) {
|
|
7345
7396
|
const combinedState = {
|
|
7346
7397
|
...props.builderContextSignal.rootState,
|
|
@@ -7411,7 +7462,11 @@ function EnableEditor(props) {
|
|
|
7411
7462
|
context: props.context || {},
|
|
7412
7463
|
localState: void 0,
|
|
7413
7464
|
rootState: props.builderContextSignal.rootState,
|
|
7414
|
-
rootSetState: props.builderContextSignal.rootSetState
|
|
7465
|
+
rootSetState: props.builderContextSignal.rootSetState,
|
|
7466
|
+
/**
|
|
7467
|
+
* We don't want to cache the result of the JS code, since it's arbitrary side effect code.
|
|
7468
|
+
*/
|
|
7469
|
+
enableCache: false
|
|
7415
7470
|
});
|
|
7416
7471
|
}
|
|
7417
7472
|
}
|
|
@@ -7436,13 +7491,16 @@ function EnableEditor(props) {
|
|
|
7436
7491
|
function evalExpression(expression) {
|
|
7437
7492
|
return expression.replace(
|
|
7438
7493
|
/{{([^}]+)}}/g,
|
|
7439
|
-
(_match, group) =>
|
|
7440
|
-
|
|
7441
|
-
|
|
7442
|
-
|
|
7443
|
-
|
|
7444
|
-
|
|
7445
|
-
|
|
7494
|
+
(_match, group) => String(
|
|
7495
|
+
evaluate({
|
|
7496
|
+
code: group,
|
|
7497
|
+
context: props.context || {},
|
|
7498
|
+
localState: void 0,
|
|
7499
|
+
rootState: props.builderContextSignal.rootState,
|
|
7500
|
+
rootSetState: props.builderContextSignal.rootSetState,
|
|
7501
|
+
enableCache: true
|
|
7502
|
+
})
|
|
7503
|
+
)
|
|
7446
7504
|
);
|
|
7447
7505
|
}
|
|
7448
7506
|
function handleRequest({ url, key }) {
|
|
@@ -7559,40 +7617,63 @@ function EnableEditor(props) {
|
|
|
7559
7617
|
runHttpRequests();
|
|
7560
7618
|
emitStateUpdate();
|
|
7561
7619
|
});
|
|
7620
|
+
const onUpdateFn_0_props_content = createMemo12(() => props.content);
|
|
7562
7621
|
function onUpdateFn_0() {
|
|
7563
7622
|
if (props.content) {
|
|
7564
7623
|
mergeNewContent(props.content);
|
|
7565
7624
|
}
|
|
7566
7625
|
}
|
|
7567
|
-
createEffect2(on2(() => [
|
|
7626
|
+
createEffect2(on2(() => [onUpdateFn_0_props_content()], onUpdateFn_0));
|
|
7627
|
+
const onUpdateFn_1_shouldSendResetCookie__ = createMemo12(
|
|
7628
|
+
() => shouldSendResetCookie()
|
|
7629
|
+
);
|
|
7568
7630
|
function onUpdateFn_1() {
|
|
7569
7631
|
}
|
|
7570
|
-
createEffect2(
|
|
7632
|
+
createEffect2(
|
|
7633
|
+
on2(() => [onUpdateFn_1_shouldSendResetCookie__()], onUpdateFn_1)
|
|
7634
|
+
);
|
|
7635
|
+
const onUpdateFn_2_props_builderContextSignal_content__data__jsCode = createMemo12(() => props.builderContextSignal.content?.data?.jsCode);
|
|
7571
7636
|
function onUpdateFn_2() {
|
|
7572
7637
|
evaluateJsCode();
|
|
7573
7638
|
}
|
|
7574
7639
|
createEffect2(
|
|
7575
|
-
on2(
|
|
7640
|
+
on2(
|
|
7641
|
+
() => [onUpdateFn_2_props_builderContextSignal_content__data__jsCode()],
|
|
7642
|
+
onUpdateFn_2
|
|
7643
|
+
)
|
|
7576
7644
|
);
|
|
7645
|
+
const onUpdateFn_3_props_builderContextSignal_content__data__httpRequests = createMemo12(() => props.builderContextSignal.content?.data?.httpRequests);
|
|
7577
7646
|
function onUpdateFn_3() {
|
|
7578
7647
|
runHttpRequests();
|
|
7579
7648
|
}
|
|
7580
7649
|
createEffect2(
|
|
7581
7650
|
on2(
|
|
7582
|
-
() => [
|
|
7651
|
+
() => [
|
|
7652
|
+
onUpdateFn_3_props_builderContextSignal_content__data__httpRequests()
|
|
7653
|
+
],
|
|
7583
7654
|
onUpdateFn_3
|
|
7584
7655
|
)
|
|
7585
7656
|
);
|
|
7657
|
+
const onUpdateFn_4_props_builderContextSignal_rootState = createMemo12(
|
|
7658
|
+
() => props.builderContextSignal.rootState
|
|
7659
|
+
);
|
|
7586
7660
|
function onUpdateFn_4() {
|
|
7587
7661
|
emitStateUpdate();
|
|
7588
7662
|
}
|
|
7589
|
-
createEffect2(
|
|
7663
|
+
createEffect2(
|
|
7664
|
+
on2(
|
|
7665
|
+
() => [onUpdateFn_4_props_builderContextSignal_rootState()],
|
|
7666
|
+
onUpdateFn_4
|
|
7667
|
+
)
|
|
7668
|
+
);
|
|
7669
|
+
const onUpdateFn_5_props_data = createMemo12(() => props.data);
|
|
7590
7670
|
function onUpdateFn_5() {
|
|
7591
7671
|
if (props.data) {
|
|
7592
7672
|
mergeNewRootState(props.data);
|
|
7593
7673
|
}
|
|
7594
7674
|
}
|
|
7595
|
-
createEffect2(on2(() => [
|
|
7675
|
+
createEffect2(on2(() => [onUpdateFn_5_props_data()], onUpdateFn_5));
|
|
7676
|
+
const onUpdateFn_6_props_locale = createMemo12(() => props.locale);
|
|
7596
7677
|
function onUpdateFn_6() {
|
|
7597
7678
|
if (props.locale) {
|
|
7598
7679
|
mergeNewRootState({
|
|
@@ -7600,7 +7681,7 @@ function EnableEditor(props) {
|
|
|
7600
7681
|
});
|
|
7601
7682
|
}
|
|
7602
7683
|
}
|
|
7603
|
-
createEffect2(on2(() => [
|
|
7684
|
+
createEffect2(on2(() => [onUpdateFn_6_props_locale()], onUpdateFn_6));
|
|
7604
7685
|
return <builder_context_default.Provider value={props.builderContextSignal}><Show10 when={props.builderContextSignal.content}><Dynamic5
|
|
7605
7686
|
class={`variant-${props.content?.testVariationId || props.content?.id}`}
|
|
7606
7687
|
{...{}}
|
|
@@ -7621,7 +7702,7 @@ function EnableEditor(props) {
|
|
|
7621
7702
|
var Enable_editor_default = EnableEditor;
|
|
7622
7703
|
|
|
7623
7704
|
// src/components/content/components/styles.tsx
|
|
7624
|
-
import { createSignal as
|
|
7705
|
+
import { createSignal as createSignal13 } from "solid-js";
|
|
7625
7706
|
|
|
7626
7707
|
// src/components/content/components/styles.helpers.ts
|
|
7627
7708
|
var getCssFromFont = (font) => {
|
|
@@ -7680,7 +7761,7 @@ var getCss = ({
|
|
|
7680
7761
|
|
|
7681
7762
|
// src/components/content/components/styles.tsx
|
|
7682
7763
|
function ContentStyles(props) {
|
|
7683
|
-
const [injectedStyles, setInjectedStyles] =
|
|
7764
|
+
const [injectedStyles, setInjectedStyles] = createSignal13(
|
|
7684
7765
|
`
|
|
7685
7766
|
${getCss({
|
|
7686
7767
|
cssCode: props.cssCode,
|
|
@@ -7750,7 +7831,7 @@ var getContentInitialValue = ({
|
|
|
7750
7831
|
|
|
7751
7832
|
// src/components/content/content.tsx
|
|
7752
7833
|
function ContentComponent(props) {
|
|
7753
|
-
const [scriptStr, setScriptStr] =
|
|
7834
|
+
const [scriptStr, setScriptStr] = createSignal14(
|
|
7754
7835
|
getUpdateVariantVisibilityScript({
|
|
7755
7836
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
|
|
7756
7837
|
variationId: props.content?.testVariationId,
|
|
@@ -7758,7 +7839,7 @@ function ContentComponent(props) {
|
|
|
7758
7839
|
contentId: props.content?.id
|
|
7759
7840
|
})
|
|
7760
7841
|
);
|
|
7761
|
-
const [registeredComponents, setRegisteredComponents] =
|
|
7842
|
+
const [registeredComponents, setRegisteredComponents] = createSignal14(
|
|
7762
7843
|
[
|
|
7763
7844
|
...getDefaultRegisteredComponents(),
|
|
7764
7845
|
...props.customComponents || []
|
|
@@ -7773,7 +7854,7 @@ function ContentComponent(props) {
|
|
|
7773
7854
|
{}
|
|
7774
7855
|
)
|
|
7775
7856
|
);
|
|
7776
|
-
const [builderContextSignal, setBuilderContextSignal] =
|
|
7857
|
+
const [builderContextSignal, setBuilderContextSignal] = createSignal14({
|
|
7777
7858
|
content: getContentInitialValue({
|
|
7778
7859
|
content: props.content,
|
|
7779
7860
|
data: props.data
|
|
@@ -7849,13 +7930,13 @@ var Content_default = ContentComponent;
|
|
|
7849
7930
|
|
|
7850
7931
|
// src/components/content-variants/content-variants.tsx
|
|
7851
7932
|
function ContentVariants(props) {
|
|
7852
|
-
const [shouldRenderVariants, setShouldRenderVariants] =
|
|
7933
|
+
const [shouldRenderVariants, setShouldRenderVariants] = createSignal15(
|
|
7853
7934
|
checkShouldRenderVariants({
|
|
7854
7935
|
canTrack: getDefaultCanTrack(props.canTrack),
|
|
7855
7936
|
content: props.content
|
|
7856
7937
|
})
|
|
7857
7938
|
);
|
|
7858
|
-
|
|
7939
|
+
const updateCookieAndStylesScriptStr = createMemo15(() => {
|
|
7859
7940
|
return getUpdateCookieAndStylesScript(
|
|
7860
7941
|
getVariants(props.content).map((value) => ({
|
|
7861
7942
|
id: value.testVariationId,
|
|
@@ -7863,11 +7944,11 @@ function ContentVariants(props) {
|
|
|
7863
7944
|
})),
|
|
7864
7945
|
props.content?.id || ""
|
|
7865
7946
|
);
|
|
7866
|
-
}
|
|
7867
|
-
|
|
7947
|
+
});
|
|
7948
|
+
const hideVariantsStyleString = createMemo15(() => {
|
|
7868
7949
|
return getVariants(props.content).map((value) => `.variant-${value.testVariationId} { display: none; } `).join("");
|
|
7869
|
-
}
|
|
7870
|
-
|
|
7950
|
+
});
|
|
7951
|
+
const defaultContent = createMemo15(() => {
|
|
7871
7952
|
return shouldRenderVariants() ? {
|
|
7872
7953
|
...props.content,
|
|
7873
7954
|
testVariationId: props.content?.id
|
|
@@ -7875,7 +7956,7 @@ function ContentVariants(props) {
|
|
|
7875
7956
|
item: props.content,
|
|
7876
7957
|
canTrack: getDefaultCanTrack(props.canTrack)
|
|
7877
7958
|
});
|
|
7878
|
-
}
|
|
7959
|
+
});
|
|
7879
7960
|
onMount4(() => {
|
|
7880
7961
|
setShouldRenderVariants(false);
|
|
7881
7962
|
});
|
|
@@ -7965,15 +8046,15 @@ var fetchSymbolContent = async ({
|
|
|
7965
8046
|
|
|
7966
8047
|
// src/blocks/symbol/symbol.tsx
|
|
7967
8048
|
function Symbol2(props) {
|
|
7968
|
-
const [contentToUse, setContentToUse] =
|
|
7969
|
-
|
|
8049
|
+
const [contentToUse, setContentToUse] = createSignal16(props.symbol?.content);
|
|
8050
|
+
const className = createMemo16(() => {
|
|
7970
8051
|
return [
|
|
7971
8052
|
...[props.attributes[getClassPropName()]],
|
|
7972
8053
|
"builder-symbol",
|
|
7973
8054
|
props.symbol?.inline ? "builder-inline-symbol" : void 0,
|
|
7974
8055
|
props.symbol?.dynamic || props.dynamic ? "builder-dynamic-symbol" : void 0
|
|
7975
8056
|
].filter(Boolean).join(" ");
|
|
7976
|
-
}
|
|
8057
|
+
});
|
|
7977
8058
|
function setContent() {
|
|
7978
8059
|
if (contentToUse())
|
|
7979
8060
|
return;
|
|
@@ -7987,12 +8068,12 @@ function Symbol2(props) {
|
|
|
7987
8068
|
});
|
|
7988
8069
|
}
|
|
7989
8070
|
onMount5(() => {
|
|
7990
|
-
setContent();
|
|
7991
8071
|
});
|
|
8072
|
+
const onUpdateFn_0_props_symbol = createMemo16(() => props.symbol);
|
|
7992
8073
|
function onUpdateFn_0() {
|
|
7993
8074
|
setContent();
|
|
7994
8075
|
}
|
|
7995
|
-
createEffect3(on3(() => [
|
|
8076
|
+
createEffect3(on3(() => [onUpdateFn_0_props_symbol()], onUpdateFn_0));
|
|
7996
8077
|
return <div class={className()} {...{}} {...props.attributes} {...{}}><Content_variants_default
|
|
7997
8078
|
__isNestedRender={true}
|
|
7998
8079
|
apiVersion={props.builderContext.apiVersion}
|