@builder.io/sdk-solid 2.0.8 → 2.0.13
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 +155 -79
- package/lib/browser/dev.jsx +144 -84
- package/lib/browser/index.js +155 -79
- package/lib/browser/index.jsx +144 -84
- package/lib/edge/dev.js +155 -79
- package/lib/edge/dev.jsx +144 -84
- package/lib/edge/index.js +155 -79
- package/lib/edge/index.jsx +144 -84
- package/lib/node/dev.js +157 -81
- package/lib/node/dev.jsx +146 -86
- package/lib/node/index.js +157 -81
- package/lib/node/index.jsx +146 -86
- package/package.json +3 -3
package/lib/edge/index.jsx
CHANGED
|
@@ -111,7 +111,13 @@ import { createContext as createContext2 } from "solid-js";
|
|
|
111
111
|
var components_context_default = createContext2({ registeredComponents: {} });
|
|
112
112
|
|
|
113
113
|
// src/components/block/block.tsx
|
|
114
|
-
import {
|
|
114
|
+
import {
|
|
115
|
+
Show as Show4,
|
|
116
|
+
For as For2,
|
|
117
|
+
onMount,
|
|
118
|
+
createMemo as createMemo5,
|
|
119
|
+
createSignal as createSignal5
|
|
120
|
+
} from "solid-js";
|
|
115
121
|
|
|
116
122
|
// src/functions/get-block-component-options.ts
|
|
117
123
|
function getBlockComponentOptions(block) {
|
|
@@ -121,6 +127,15 @@ function getBlockComponentOptions(block) {
|
|
|
121
127
|
};
|
|
122
128
|
}
|
|
123
129
|
|
|
130
|
+
// src/helpers/omit.ts
|
|
131
|
+
function omit(obj, ...values) {
|
|
132
|
+
const newObject = Object.assign({}, obj);
|
|
133
|
+
for (const key of values) {
|
|
134
|
+
delete newObject[key];
|
|
135
|
+
}
|
|
136
|
+
return newObject;
|
|
137
|
+
}
|
|
138
|
+
|
|
124
139
|
// src/helpers/logger.ts
|
|
125
140
|
var logger = {
|
|
126
141
|
log: (...message) => void 0,
|
|
@@ -3477,6 +3492,7 @@ var shouldForceBrowserRuntimeInNode = () => {
|
|
|
3477
3492
|
var chooseBrowserOrServerEval = (args) => isBrowser() || shouldForceBrowserRuntimeInNode() ? runInBrowser(args) : runInEdge(args);
|
|
3478
3493
|
|
|
3479
3494
|
// src/functions/evaluate/evaluate.ts
|
|
3495
|
+
var DISABLE_CACHE = true;
|
|
3480
3496
|
var EvalCache = class _EvalCache {
|
|
3481
3497
|
static cacheLimit = 20;
|
|
3482
3498
|
static cache = /* @__PURE__ */ new Map();
|
|
@@ -3525,7 +3541,7 @@ function evaluate({
|
|
|
3525
3541
|
rootState,
|
|
3526
3542
|
localState
|
|
3527
3543
|
};
|
|
3528
|
-
if (enableCache) {
|
|
3544
|
+
if (enableCache && !DISABLE_CACHE) {
|
|
3529
3545
|
const cacheKey = EvalCache.getCacheKey(args);
|
|
3530
3546
|
const cachedValue = EvalCache.getCachedValue(cacheKey);
|
|
3531
3547
|
if (cachedValue) {
|
|
@@ -3556,6 +3572,53 @@ function transformBlock(block) {
|
|
|
3556
3572
|
}
|
|
3557
3573
|
|
|
3558
3574
|
// src/functions/get-processed-block.ts
|
|
3575
|
+
function deepCloneWithConditions(obj) {
|
|
3576
|
+
if (obj === null || typeof obj !== "object") {
|
|
3577
|
+
return obj;
|
|
3578
|
+
}
|
|
3579
|
+
if (Array.isArray(obj)) {
|
|
3580
|
+
return obj.map((item) => deepCloneWithConditions(item));
|
|
3581
|
+
}
|
|
3582
|
+
if (obj["@type"] === "@builder.io/sdk:Element") {
|
|
3583
|
+
return obj;
|
|
3584
|
+
}
|
|
3585
|
+
const clonedObj = {};
|
|
3586
|
+
for (const key in obj) {
|
|
3587
|
+
if (key !== "meta" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
3588
|
+
clonedObj[key] = deepCloneWithConditions(obj[key]);
|
|
3589
|
+
}
|
|
3590
|
+
}
|
|
3591
|
+
return clonedObj;
|
|
3592
|
+
}
|
|
3593
|
+
var IS_SDK_WITHOUT_CACHED_PROCESSED_BLOCK = ["svelte", "vue", "angular", "qwik", "solid"].includes(TARGET);
|
|
3594
|
+
var getCopy = (block) => {
|
|
3595
|
+
if (IS_SDK_WITHOUT_CACHED_PROCESSED_BLOCK) {
|
|
3596
|
+
const copy = fastClone(block);
|
|
3597
|
+
const copied = {
|
|
3598
|
+
...copy,
|
|
3599
|
+
properties: {
|
|
3600
|
+
...copy.properties
|
|
3601
|
+
},
|
|
3602
|
+
actions: {
|
|
3603
|
+
...copy.actions
|
|
3604
|
+
}
|
|
3605
|
+
};
|
|
3606
|
+
return copied;
|
|
3607
|
+
} else {
|
|
3608
|
+
const copy = deepCloneWithConditions(omit(block, "children", "meta"));
|
|
3609
|
+
return {
|
|
3610
|
+
...copy,
|
|
3611
|
+
properties: {
|
|
3612
|
+
...copy.properties
|
|
3613
|
+
},
|
|
3614
|
+
actions: {
|
|
3615
|
+
...copy.actions
|
|
3616
|
+
},
|
|
3617
|
+
children: block.children,
|
|
3618
|
+
meta: block.meta
|
|
3619
|
+
};
|
|
3620
|
+
}
|
|
3621
|
+
};
|
|
3559
3622
|
var evaluateBindings = ({
|
|
3560
3623
|
block,
|
|
3561
3624
|
context,
|
|
@@ -3566,16 +3629,7 @@ var evaluateBindings = ({
|
|
|
3566
3629
|
if (!block.bindings) {
|
|
3567
3630
|
return block;
|
|
3568
3631
|
}
|
|
3569
|
-
const
|
|
3570
|
-
const copied = {
|
|
3571
|
-
...copy,
|
|
3572
|
-
properties: {
|
|
3573
|
-
...copy.properties
|
|
3574
|
-
},
|
|
3575
|
-
actions: {
|
|
3576
|
-
...copy.actions
|
|
3577
|
-
}
|
|
3578
|
-
};
|
|
3632
|
+
const copied = getCopy(block);
|
|
3579
3633
|
for (const binding in block.bindings) {
|
|
3580
3634
|
const expression = block.bindings[binding];
|
|
3581
3635
|
const value = evaluate({
|
|
@@ -3857,17 +3911,9 @@ function mapStyleObjToStrIfNeeded(style) {
|
|
|
3857
3911
|
// src/components/block/block.helpers.ts
|
|
3858
3912
|
var getComponent = ({
|
|
3859
3913
|
block,
|
|
3860
|
-
context,
|
|
3861
3914
|
registeredComponents
|
|
3862
3915
|
}) => {
|
|
3863
|
-
const componentName =
|
|
3864
|
-
block,
|
|
3865
|
-
localState: context.localState,
|
|
3866
|
-
rootState: context.rootState,
|
|
3867
|
-
rootSetState: context.rootSetState,
|
|
3868
|
-
context: context.context,
|
|
3869
|
-
shouldEvaluateBindings: false
|
|
3870
|
-
}).component?.name;
|
|
3916
|
+
const componentName = block.component?.name;
|
|
3871
3917
|
if (!componentName) {
|
|
3872
3918
|
return null;
|
|
3873
3919
|
}
|
|
@@ -4011,14 +4057,7 @@ var Inlined_styles_default = InlinedStyles;
|
|
|
4011
4057
|
// src/components/block/components/block-styles.tsx
|
|
4012
4058
|
function BlockStyles(props) {
|
|
4013
4059
|
const canShowBlock = createMemo(() => {
|
|
4014
|
-
const processedBlock =
|
|
4015
|
-
block: props.block,
|
|
4016
|
-
localState: props.context.localState,
|
|
4017
|
-
rootState: props.context.rootState,
|
|
4018
|
-
rootSetState: props.context.rootSetState,
|
|
4019
|
-
context: props.context.context,
|
|
4020
|
-
shouldEvaluateBindings: true
|
|
4021
|
-
});
|
|
4060
|
+
const processedBlock = props.block;
|
|
4022
4061
|
if (checkIsDefined(processedBlock.hide)) {
|
|
4023
4062
|
return !processedBlock.hide;
|
|
4024
4063
|
}
|
|
@@ -4028,14 +4067,7 @@ function BlockStyles(props) {
|
|
|
4028
4067
|
return true;
|
|
4029
4068
|
});
|
|
4030
4069
|
const css = createMemo(() => {
|
|
4031
|
-
const processedBlock =
|
|
4032
|
-
block: props.block,
|
|
4033
|
-
localState: props.context.localState,
|
|
4034
|
-
rootState: props.context.rootState,
|
|
4035
|
-
rootSetState: props.context.rootSetState,
|
|
4036
|
-
context: props.context.context,
|
|
4037
|
-
shouldEvaluateBindings: true
|
|
4038
|
-
});
|
|
4070
|
+
const processedBlock = props.block;
|
|
4039
4071
|
const styles = processedBlock.responsiveStyles;
|
|
4040
4072
|
const content = props.context.content;
|
|
4041
4073
|
const sizesWithUpdatedBreakpoints = getSizesForBreakpoints(
|
|
@@ -4304,12 +4336,9 @@ var Repeated_block_default = RepeatedBlock;
|
|
|
4304
4336
|
|
|
4305
4337
|
// src/components/block/block.tsx
|
|
4306
4338
|
function Block(props) {
|
|
4307
|
-
const
|
|
4308
|
-
|
|
4309
|
-
|
|
4310
|
-
context: props.context,
|
|
4311
|
-
registeredComponents: props.registeredComponents
|
|
4312
|
-
});
|
|
4339
|
+
const [_processedBlock, set_processedBlock] = createSignal5({
|
|
4340
|
+
value: null,
|
|
4341
|
+
update: false
|
|
4313
4342
|
});
|
|
4314
4343
|
const repeatItem = createMemo5(() => {
|
|
4315
4344
|
return getRepeatItemData({
|
|
@@ -4318,7 +4347,7 @@ function Block(props) {
|
|
|
4318
4347
|
});
|
|
4319
4348
|
});
|
|
4320
4349
|
const processedBlock = createMemo5(() => {
|
|
4321
|
-
|
|
4350
|
+
const blockToUse = props.block.repeat?.collection ? props.block : getProcessedBlock({
|
|
4322
4351
|
block: props.block,
|
|
4323
4352
|
localState: props.context.localState,
|
|
4324
4353
|
rootState: props.context.rootState,
|
|
@@ -4326,6 +4355,13 @@ function Block(props) {
|
|
|
4326
4355
|
context: props.context.context,
|
|
4327
4356
|
shouldEvaluateBindings: true
|
|
4328
4357
|
});
|
|
4358
|
+
return blockToUse;
|
|
4359
|
+
});
|
|
4360
|
+
const blockComponent = createMemo5(() => {
|
|
4361
|
+
return getComponent({
|
|
4362
|
+
block: processedBlock(),
|
|
4363
|
+
registeredComponents: props.registeredComponents
|
|
4364
|
+
});
|
|
4329
4365
|
});
|
|
4330
4366
|
const Tag = createMemo5(() => {
|
|
4331
4367
|
const shouldUseLink = props.block.tagName === "a" || processedBlock().properties?.href || processedBlock().href;
|
|
@@ -4383,9 +4419,24 @@ function Block(props) {
|
|
|
4383
4419
|
}
|
|
4384
4420
|
});
|
|
4385
4421
|
return <><Show4 when={canShowBlock()}>
|
|
4386
|
-
<Block_styles_default
|
|
4422
|
+
<Block_styles_default
|
|
4423
|
+
block={processedBlock()}
|
|
4424
|
+
context={props.context}
|
|
4425
|
+
/>
|
|
4387
4426
|
<Show4
|
|
4388
|
-
fallback={<
|
|
4427
|
+
fallback={<Show4
|
|
4428
|
+
fallback={<For2 each={repeatItem()}>{(data, _index) => {
|
|
4429
|
+
const index = _index();
|
|
4430
|
+
return <Repeated_block_default
|
|
4431
|
+
key={index}
|
|
4432
|
+
repeatContext={data.context}
|
|
4433
|
+
block={data.block}
|
|
4434
|
+
registeredComponents={props.registeredComponents}
|
|
4435
|
+
linkComponent={props.linkComponent}
|
|
4436
|
+
/>;
|
|
4437
|
+
}}</For2>}
|
|
4438
|
+
when={!repeatItem()}
|
|
4439
|
+
><Component_ref_default
|
|
4389
4440
|
componentRef={componentRefProps().componentRef}
|
|
4390
4441
|
componentOptions={componentRefProps().componentOptions}
|
|
4391
4442
|
blockChildren={componentRefProps().blockChildren}
|
|
@@ -4395,7 +4446,7 @@ function Block(props) {
|
|
|
4395
4446
|
builderBlock={componentRefProps().builderBlock}
|
|
4396
4447
|
includeBlockProps={componentRefProps().includeBlockProps}
|
|
4397
4448
|
isInteractive={componentRefProps().isInteractive}
|
|
4398
|
-
|
|
4449
|
+
/></Show4>}
|
|
4399
4450
|
when={!blockComponent()?.noWrap}
|
|
4400
4451
|
><Show4
|
|
4401
4452
|
fallback={<For2 each={repeatItem()}>{(data, _index) => {
|
|
@@ -4441,7 +4492,7 @@ function Block(props) {
|
|
|
4441
4492
|
var Block_default = Block;
|
|
4442
4493
|
|
|
4443
4494
|
// src/components/blocks/blocks-wrapper.tsx
|
|
4444
|
-
import { createMemo as createMemo6 } from "solid-js";
|
|
4495
|
+
import { onMount as onMount2, createMemo as createMemo6 } from "solid-js";
|
|
4445
4496
|
import { Dynamic as Dynamic4 } from "solid-js/web";
|
|
4446
4497
|
function BlocksWrapper(props) {
|
|
4447
4498
|
const className = createMemo6(() => {
|
|
@@ -4475,9 +4526,13 @@ function BlocksWrapper(props) {
|
|
|
4475
4526
|
);
|
|
4476
4527
|
}
|
|
4477
4528
|
}
|
|
4529
|
+
let blocksWrapperRef;
|
|
4530
|
+
onMount2(() => {
|
|
4531
|
+
});
|
|
4478
4532
|
return <>
|
|
4479
4533
|
<Dynamic4
|
|
4480
|
-
class={className() + " dynamic-
|
|
4534
|
+
class={className() + " dynamic-4da8c6f4"}
|
|
4535
|
+
ref={blocksWrapperRef}
|
|
4481
4536
|
builder-path={props.path}
|
|
4482
4537
|
builder-parent-id={props.parent}
|
|
4483
4538
|
{...{}}
|
|
@@ -4488,7 +4543,7 @@ function BlocksWrapper(props) {
|
|
|
4488
4543
|
{...props.BlocksWrapperProps}
|
|
4489
4544
|
component={props.BlocksWrapper}
|
|
4490
4545
|
>{props.children}</Dynamic4>
|
|
4491
|
-
<style>{`.dynamic-
|
|
4546
|
+
<style>{`.dynamic-4da8c6f4 {
|
|
4492
4547
|
display: flex;
|
|
4493
4548
|
flex-direction: column;
|
|
4494
4549
|
align-items: stretch;
|
|
@@ -4692,7 +4747,7 @@ function FragmentComponent(props) {
|
|
|
4692
4747
|
var fragment_default = FragmentComponent;
|
|
4693
4748
|
|
|
4694
4749
|
// src/blocks/image/image.tsx
|
|
4695
|
-
import { Show as Show7, onMount as
|
|
4750
|
+
import { Show as Show7, onMount as onMount3, createMemo as createMemo8 } from "solid-js";
|
|
4696
4751
|
|
|
4697
4752
|
// src/blocks/image/image.helpers.ts
|
|
4698
4753
|
function removeProtocol(path) {
|
|
@@ -4781,7 +4836,7 @@ function Image(props) {
|
|
|
4781
4836
|
const out = props.aspectRatio ? aspectRatioStyles : void 0;
|
|
4782
4837
|
return out;
|
|
4783
4838
|
});
|
|
4784
|
-
|
|
4839
|
+
onMount3(() => {
|
|
4785
4840
|
});
|
|
4786
4841
|
return <>
|
|
4787
4842
|
<>
|
|
@@ -4857,10 +4912,10 @@ function SectionComponent(props) {
|
|
|
4857
4912
|
var section_default = SectionComponent;
|
|
4858
4913
|
|
|
4859
4914
|
// src/blocks/symbol/symbol.tsx
|
|
4860
|
-
import { onMount as
|
|
4915
|
+
import { onMount as onMount7, on as on4, createEffect as createEffect4, createMemo as createMemo20, createSignal as createSignal20 } from "solid-js";
|
|
4861
4916
|
|
|
4862
4917
|
// src/components/content-variants/content-variants.tsx
|
|
4863
|
-
import { Show as Show14, For as For9, onMount as
|
|
4918
|
+
import { Show as Show14, For as For9, onMount as onMount6, createSignal as createSignal19, createMemo as createMemo19 } from "solid-js";
|
|
4864
4919
|
|
|
4865
4920
|
// src/helpers/url.ts
|
|
4866
4921
|
var getTopLevelDomain = (host) => {
|
|
@@ -5799,7 +5854,8 @@ var componentInfo7 = {
|
|
|
5799
5854
|
defaultValue: "children"
|
|
5800
5855
|
}],
|
|
5801
5856
|
shouldReceiveBuilderProps: {
|
|
5802
|
-
builderContext: true
|
|
5857
|
+
builderContext: true,
|
|
5858
|
+
builderComponents: true
|
|
5803
5859
|
}
|
|
5804
5860
|
};
|
|
5805
5861
|
|
|
@@ -5816,6 +5872,7 @@ function Slot(props) {
|
|
|
5816
5872
|
parent={props.builderContext.context?.symbolId}
|
|
5817
5873
|
path={`symbol.data.${props.name}`}
|
|
5818
5874
|
context={props.builderContext}
|
|
5875
|
+
registeredComponents={props.builderComponents}
|
|
5819
5876
|
blocks={props.builderContext.rootState?.[props.name]}
|
|
5820
5877
|
/></div></>;
|
|
5821
5878
|
}
|
|
@@ -6148,12 +6205,12 @@ var componentInfo11 = {
|
|
|
6148
6205
|
};
|
|
6149
6206
|
|
|
6150
6207
|
// src/blocks/custom-code/custom-code.tsx
|
|
6151
|
-
import { onMount as
|
|
6208
|
+
import { onMount as onMount4, createSignal as createSignal12 } from "solid-js";
|
|
6152
6209
|
function CustomCode(props) {
|
|
6153
6210
|
const [scriptsInserted, setScriptsInserted] = createSignal12([]);
|
|
6154
6211
|
const [scriptsRun, setScriptsRun] = createSignal12([]);
|
|
6155
6212
|
let elementRef;
|
|
6156
|
-
|
|
6213
|
+
onMount4(() => {
|
|
6157
6214
|
if (!elementRef?.getElementsByTagName || typeof window === "undefined") {
|
|
6158
6215
|
return;
|
|
6159
6216
|
}
|
|
@@ -6212,7 +6269,7 @@ var componentInfo12 = {
|
|
|
6212
6269
|
};
|
|
6213
6270
|
|
|
6214
6271
|
// src/blocks/embed/embed.tsx
|
|
6215
|
-
import { on, createEffect, createMemo as createMemo13, createSignal as createSignal13 } from "solid-js";
|
|
6272
|
+
import { on as on2, createEffect as createEffect2, createMemo as createMemo13, createSignal as createSignal13 } from "solid-js";
|
|
6216
6273
|
|
|
6217
6274
|
// src/blocks/embed/helpers.ts
|
|
6218
6275
|
var SCRIPT_MIME_TYPES = ["text/javascript", "application/javascript", "application/ecmascript"];
|
|
@@ -6253,8 +6310,8 @@ function Embed(props) {
|
|
|
6253
6310
|
findAndRunScripts();
|
|
6254
6311
|
}
|
|
6255
6312
|
}
|
|
6256
|
-
|
|
6257
|
-
|
|
6313
|
+
createEffect2(
|
|
6314
|
+
on2(() => [onUpdateFn_0_elem(), onUpdateFn_0_ranInitFn__()], onUpdateFn_0)
|
|
6258
6315
|
);
|
|
6259
6316
|
return <><div class="builder-embed" ref={elem} innerHTML={props.content} /></>;
|
|
6260
6317
|
}
|
|
@@ -7245,14 +7302,14 @@ var getDefaultRegisteredComponents = () => [{
|
|
|
7245
7302
|
// src/functions/register-component.ts
|
|
7246
7303
|
var createRegisterComponentMessage = (info) => ({
|
|
7247
7304
|
type: "builder.registerComponent",
|
|
7248
|
-
data:
|
|
7305
|
+
data: serializeIncludingFunctions(info)
|
|
7249
7306
|
});
|
|
7250
7307
|
var serializeFn = (fnValue) => {
|
|
7251
7308
|
const fnStr = fnValue.toString().trim();
|
|
7252
7309
|
const appendFunction = !fnStr.startsWith("function") && !fnStr.startsWith("(");
|
|
7253
7310
|
return `return (${appendFunction ? "function " : ""}${fnStr}).apply(this, arguments)`;
|
|
7254
7311
|
};
|
|
7255
|
-
function
|
|
7312
|
+
function serializeIncludingFunctions(info) {
|
|
7256
7313
|
return JSON.parse(JSON.stringify(info, (key, value) => {
|
|
7257
7314
|
if (typeof value === "function") {
|
|
7258
7315
|
return serializeFn(value);
|
|
@@ -7320,9 +7377,9 @@ var Inlined_script_default = InlinedScript;
|
|
|
7320
7377
|
// src/components/content/components/enable-editor.tsx
|
|
7321
7378
|
import {
|
|
7322
7379
|
Show as Show12,
|
|
7323
|
-
onMount as
|
|
7324
|
-
on as
|
|
7325
|
-
createEffect as
|
|
7380
|
+
onMount as onMount5,
|
|
7381
|
+
on as on3,
|
|
7382
|
+
createEffect as createEffect3,
|
|
7326
7383
|
createMemo as createMemo16,
|
|
7327
7384
|
createSignal as createSignal16
|
|
7328
7385
|
} from "solid-js";
|
|
@@ -7429,7 +7486,7 @@ var generateContentUrl = (options) => {
|
|
|
7429
7486
|
locale,
|
|
7430
7487
|
apiVersion = DEFAULT_API_VERSION,
|
|
7431
7488
|
fields,
|
|
7432
|
-
omit,
|
|
7489
|
+
omit: omit2,
|
|
7433
7490
|
offset,
|
|
7434
7491
|
cacheSeconds,
|
|
7435
7492
|
staleCacheSeconds,
|
|
@@ -7452,7 +7509,7 @@ var generateContentUrl = (options) => {
|
|
|
7452
7509
|
url.searchParams.set("locale", locale);
|
|
7453
7510
|
if (enrich)
|
|
7454
7511
|
url.searchParams.set("enrich", String(enrich));
|
|
7455
|
-
url.searchParams.set("omit",
|
|
7512
|
+
url.searchParams.set("omit", omit2 || "meta.componentsUsed");
|
|
7456
7513
|
if (fields) {
|
|
7457
7514
|
url.searchParams.set("fields", fields);
|
|
7458
7515
|
}
|
|
@@ -7822,11 +7879,14 @@ function isFromTrustedHost(trustedHosts, e) {
|
|
|
7822
7879
|
}
|
|
7823
7880
|
|
|
7824
7881
|
// src/constants/sdk-version.ts
|
|
7825
|
-
var SDK_VERSION = "2.0.
|
|
7882
|
+
var SDK_VERSION = "2.0.13";
|
|
7826
7883
|
|
|
7827
7884
|
// src/functions/register.ts
|
|
7828
7885
|
var registry = {};
|
|
7829
7886
|
function register(type, info) {
|
|
7887
|
+
if (type === "plugin") {
|
|
7888
|
+
info = serializeIncludingFunctions(info);
|
|
7889
|
+
}
|
|
7830
7890
|
let typeList = registry[type];
|
|
7831
7891
|
if (!typeList) {
|
|
7832
7892
|
typeList = registry[type] = [];
|
|
@@ -8257,7 +8317,7 @@ function EnableEditor(props) {
|
|
|
8257
8317
|
}
|
|
8258
8318
|
}
|
|
8259
8319
|
let elementRef;
|
|
8260
|
-
|
|
8320
|
+
onMount5(() => {
|
|
8261
8321
|
if (isBrowser()) {
|
|
8262
8322
|
if (isEditing()) {
|
|
8263
8323
|
window.addEventListener("message", processMessage);
|
|
@@ -8318,7 +8378,7 @@ function EnableEditor(props) {
|
|
|
8318
8378
|
}
|
|
8319
8379
|
}
|
|
8320
8380
|
});
|
|
8321
|
-
|
|
8381
|
+
onMount5(() => {
|
|
8322
8382
|
if (!props.apiKey) {
|
|
8323
8383
|
logger.error(
|
|
8324
8384
|
"No API key provided to `Content` component. This can cause issues. Please provide an API key using the `apiKey` prop."
|
|
@@ -8334,13 +8394,13 @@ function EnableEditor(props) {
|
|
|
8334
8394
|
mergeNewContent(props.content);
|
|
8335
8395
|
}
|
|
8336
8396
|
}
|
|
8337
|
-
|
|
8397
|
+
createEffect3(on3(() => [onUpdateFn_0_props_content()], onUpdateFn_0));
|
|
8338
8398
|
const onUpdateFn_1_props_builderContextSignal_content__data__jsCode = createMemo16(() => props.builderContextSignal.content?.data?.jsCode);
|
|
8339
8399
|
function onUpdateFn_1() {
|
|
8340
8400
|
evaluateJsCode();
|
|
8341
8401
|
}
|
|
8342
|
-
|
|
8343
|
-
|
|
8402
|
+
createEffect3(
|
|
8403
|
+
on3(
|
|
8344
8404
|
() => [onUpdateFn_1_props_builderContextSignal_content__data__jsCode()],
|
|
8345
8405
|
onUpdateFn_1
|
|
8346
8406
|
)
|
|
@@ -8349,8 +8409,8 @@ function EnableEditor(props) {
|
|
|
8349
8409
|
function onUpdateFn_2() {
|
|
8350
8410
|
runHttpRequests();
|
|
8351
8411
|
}
|
|
8352
|
-
|
|
8353
|
-
|
|
8412
|
+
createEffect3(
|
|
8413
|
+
on3(
|
|
8354
8414
|
() => [
|
|
8355
8415
|
onUpdateFn_2_props_builderContextSignal_content__data__httpRequests()
|
|
8356
8416
|
],
|
|
@@ -8363,8 +8423,8 @@ function EnableEditor(props) {
|
|
|
8363
8423
|
function onUpdateFn_3() {
|
|
8364
8424
|
emitStateUpdate();
|
|
8365
8425
|
}
|
|
8366
|
-
|
|
8367
|
-
|
|
8426
|
+
createEffect3(
|
|
8427
|
+
on3(
|
|
8368
8428
|
() => [onUpdateFn_3_props_builderContextSignal_rootState()],
|
|
8369
8429
|
onUpdateFn_3
|
|
8370
8430
|
)
|
|
@@ -8375,7 +8435,7 @@ function EnableEditor(props) {
|
|
|
8375
8435
|
mergeNewRootState(props.data);
|
|
8376
8436
|
}
|
|
8377
8437
|
}
|
|
8378
|
-
|
|
8438
|
+
createEffect3(on3(() => [onUpdateFn_4_props_data()], onUpdateFn_4));
|
|
8379
8439
|
const onUpdateFn_5_props_locale = createMemo16(() => props.locale);
|
|
8380
8440
|
function onUpdateFn_5() {
|
|
8381
8441
|
if (props.locale) {
|
|
@@ -8384,7 +8444,7 @@ function EnableEditor(props) {
|
|
|
8384
8444
|
});
|
|
8385
8445
|
}
|
|
8386
8446
|
}
|
|
8387
|
-
|
|
8447
|
+
createEffect3(on3(() => [onUpdateFn_5_props_locale()], onUpdateFn_5));
|
|
8388
8448
|
return <><builder_context_default.Provider value={props.builderContextSignal}><Show12 when={props.builderContextSignal.content}><Dynamic5
|
|
8389
8449
|
class={getWrapperClassName(
|
|
8390
8450
|
props.content?.testVariationId || props.content?.id
|
|
@@ -8486,7 +8546,7 @@ function ContentComponent(props) {
|
|
|
8486
8546
|
...acc,
|
|
8487
8547
|
[info.name]: {
|
|
8488
8548
|
component,
|
|
8489
|
-
...
|
|
8549
|
+
...serializeIncludingFunctions(info)
|
|
8490
8550
|
}
|
|
8491
8551
|
}),
|
|
8492
8552
|
{}
|
|
@@ -8520,7 +8580,7 @@ function ContentComponent(props) {
|
|
|
8520
8580
|
].reduce(
|
|
8521
8581
|
(acc, { component: _, ...info }) => ({
|
|
8522
8582
|
...acc,
|
|
8523
|
-
[info.name]:
|
|
8583
|
+
[info.name]: serializeIncludingFunctions(info)
|
|
8524
8584
|
}),
|
|
8525
8585
|
{}
|
|
8526
8586
|
),
|
|
@@ -8609,7 +8669,7 @@ function ContentVariants(props) {
|
|
|
8609
8669
|
canTrack: getDefaultCanTrack(props.canTrack)
|
|
8610
8670
|
});
|
|
8611
8671
|
});
|
|
8612
|
-
|
|
8672
|
+
onMount6(() => {
|
|
8613
8673
|
setShouldRenderVariants(false);
|
|
8614
8674
|
});
|
|
8615
8675
|
return <><>
|
|
@@ -8737,13 +8797,13 @@ function Symbol2(props) {
|
|
|
8737
8797
|
}
|
|
8738
8798
|
});
|
|
8739
8799
|
}
|
|
8740
|
-
|
|
8800
|
+
onMount7(() => {
|
|
8741
8801
|
});
|
|
8742
8802
|
const onUpdateFn_0_props_symbol = createMemo20(() => props.symbol);
|
|
8743
8803
|
function onUpdateFn_0() {
|
|
8744
8804
|
setContent();
|
|
8745
8805
|
}
|
|
8746
|
-
|
|
8806
|
+
createEffect4(on4(() => [onUpdateFn_0_props_symbol()], onUpdateFn_0));
|
|
8747
8807
|
return <><div class={className()} {...{}} {...props.attributes} {...{}}><Content_variants_default
|
|
8748
8808
|
nonce={props.builderContext.nonce}
|
|
8749
8809
|
isNestedRender={true}
|