@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/browser/index.jsx
CHANGED
|
@@ -103,7 +103,13 @@ import { createContext as createContext2 } from "solid-js";
|
|
|
103
103
|
var components_context_default = createContext2({ registeredComponents: {} });
|
|
104
104
|
|
|
105
105
|
// src/components/block/block.tsx
|
|
106
|
-
import {
|
|
106
|
+
import {
|
|
107
|
+
Show as Show4,
|
|
108
|
+
For as For2,
|
|
109
|
+
onMount,
|
|
110
|
+
createMemo as createMemo5,
|
|
111
|
+
createSignal as createSignal5
|
|
112
|
+
} from "solid-js";
|
|
107
113
|
|
|
108
114
|
// src/functions/get-block-component-options.ts
|
|
109
115
|
function getBlockComponentOptions(block) {
|
|
@@ -113,6 +119,15 @@ function getBlockComponentOptions(block) {
|
|
|
113
119
|
};
|
|
114
120
|
}
|
|
115
121
|
|
|
122
|
+
// src/helpers/omit.ts
|
|
123
|
+
function omit(obj, ...values) {
|
|
124
|
+
const newObject = Object.assign({}, obj);
|
|
125
|
+
for (const key of values) {
|
|
126
|
+
delete newObject[key];
|
|
127
|
+
}
|
|
128
|
+
return newObject;
|
|
129
|
+
}
|
|
130
|
+
|
|
116
131
|
// src/helpers/logger.ts
|
|
117
132
|
var logger = {
|
|
118
133
|
log: (...message) => void 0,
|
|
@@ -319,6 +334,7 @@ var shouldForceBrowserRuntimeInNode = () => {
|
|
|
319
334
|
var chooseBrowserOrServerEval = (args) => isBrowser() || shouldForceBrowserRuntimeInNode() ? runInBrowser(args) : runInBrowser(args);
|
|
320
335
|
|
|
321
336
|
// src/functions/evaluate/evaluate.ts
|
|
337
|
+
var DISABLE_CACHE = true;
|
|
322
338
|
var EvalCache = class _EvalCache {
|
|
323
339
|
static cacheLimit = 20;
|
|
324
340
|
static cache = /* @__PURE__ */ new Map();
|
|
@@ -367,7 +383,7 @@ function evaluate({
|
|
|
367
383
|
rootState,
|
|
368
384
|
localState
|
|
369
385
|
};
|
|
370
|
-
if (enableCache) {
|
|
386
|
+
if (enableCache && !DISABLE_CACHE) {
|
|
371
387
|
const cacheKey = EvalCache.getCacheKey(args);
|
|
372
388
|
const cachedValue = EvalCache.getCachedValue(cacheKey);
|
|
373
389
|
if (cachedValue) {
|
|
@@ -408,6 +424,53 @@ function transformBlock(block) {
|
|
|
408
424
|
}
|
|
409
425
|
|
|
410
426
|
// src/functions/get-processed-block.ts
|
|
427
|
+
function deepCloneWithConditions(obj) {
|
|
428
|
+
if (obj === null || typeof obj !== "object") {
|
|
429
|
+
return obj;
|
|
430
|
+
}
|
|
431
|
+
if (Array.isArray(obj)) {
|
|
432
|
+
return obj.map((item) => deepCloneWithConditions(item));
|
|
433
|
+
}
|
|
434
|
+
if (obj["@type"] === "@builder.io/sdk:Element") {
|
|
435
|
+
return obj;
|
|
436
|
+
}
|
|
437
|
+
const clonedObj = {};
|
|
438
|
+
for (const key in obj) {
|
|
439
|
+
if (key !== "meta" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
440
|
+
clonedObj[key] = deepCloneWithConditions(obj[key]);
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
return clonedObj;
|
|
444
|
+
}
|
|
445
|
+
var IS_SDK_WITHOUT_CACHED_PROCESSED_BLOCK = ["svelte", "vue", "angular", "qwik", "solid"].includes(TARGET);
|
|
446
|
+
var getCopy = (block) => {
|
|
447
|
+
if (IS_SDK_WITHOUT_CACHED_PROCESSED_BLOCK) {
|
|
448
|
+
const copy = fastClone(block);
|
|
449
|
+
const copied = {
|
|
450
|
+
...copy,
|
|
451
|
+
properties: {
|
|
452
|
+
...copy.properties
|
|
453
|
+
},
|
|
454
|
+
actions: {
|
|
455
|
+
...copy.actions
|
|
456
|
+
}
|
|
457
|
+
};
|
|
458
|
+
return copied;
|
|
459
|
+
} else {
|
|
460
|
+
const copy = deepCloneWithConditions(omit(block, "children", "meta"));
|
|
461
|
+
return {
|
|
462
|
+
...copy,
|
|
463
|
+
properties: {
|
|
464
|
+
...copy.properties
|
|
465
|
+
},
|
|
466
|
+
actions: {
|
|
467
|
+
...copy.actions
|
|
468
|
+
},
|
|
469
|
+
children: block.children,
|
|
470
|
+
meta: block.meta
|
|
471
|
+
};
|
|
472
|
+
}
|
|
473
|
+
};
|
|
411
474
|
var evaluateBindings = ({
|
|
412
475
|
block,
|
|
413
476
|
context,
|
|
@@ -418,16 +481,7 @@ var evaluateBindings = ({
|
|
|
418
481
|
if (!block.bindings) {
|
|
419
482
|
return block;
|
|
420
483
|
}
|
|
421
|
-
const
|
|
422
|
-
const copied = {
|
|
423
|
-
...copy,
|
|
424
|
-
properties: {
|
|
425
|
-
...copy.properties
|
|
426
|
-
},
|
|
427
|
-
actions: {
|
|
428
|
-
...copy.actions
|
|
429
|
-
}
|
|
430
|
-
};
|
|
484
|
+
const copied = getCopy(block);
|
|
431
485
|
for (const binding in block.bindings) {
|
|
432
486
|
const expression = block.bindings[binding];
|
|
433
487
|
const value = evaluate({
|
|
@@ -709,17 +763,9 @@ function mapStyleObjToStrIfNeeded(style) {
|
|
|
709
763
|
// src/components/block/block.helpers.ts
|
|
710
764
|
var getComponent = ({
|
|
711
765
|
block,
|
|
712
|
-
context,
|
|
713
766
|
registeredComponents
|
|
714
767
|
}) => {
|
|
715
|
-
const componentName =
|
|
716
|
-
block,
|
|
717
|
-
localState: context.localState,
|
|
718
|
-
rootState: context.rootState,
|
|
719
|
-
rootSetState: context.rootSetState,
|
|
720
|
-
context: context.context,
|
|
721
|
-
shouldEvaluateBindings: false
|
|
722
|
-
}).component?.name;
|
|
768
|
+
const componentName = block.component?.name;
|
|
723
769
|
if (!componentName) {
|
|
724
770
|
return null;
|
|
725
771
|
}
|
|
@@ -863,14 +909,7 @@ var Inlined_styles_default = InlinedStyles;
|
|
|
863
909
|
// src/components/block/components/block-styles.tsx
|
|
864
910
|
function BlockStyles(props) {
|
|
865
911
|
const canShowBlock = createMemo(() => {
|
|
866
|
-
const processedBlock =
|
|
867
|
-
block: props.block,
|
|
868
|
-
localState: props.context.localState,
|
|
869
|
-
rootState: props.context.rootState,
|
|
870
|
-
rootSetState: props.context.rootSetState,
|
|
871
|
-
context: props.context.context,
|
|
872
|
-
shouldEvaluateBindings: true
|
|
873
|
-
});
|
|
912
|
+
const processedBlock = props.block;
|
|
874
913
|
if (checkIsDefined(processedBlock.hide)) {
|
|
875
914
|
return !processedBlock.hide;
|
|
876
915
|
}
|
|
@@ -880,14 +919,7 @@ function BlockStyles(props) {
|
|
|
880
919
|
return true;
|
|
881
920
|
});
|
|
882
921
|
const css = createMemo(() => {
|
|
883
|
-
const processedBlock =
|
|
884
|
-
block: props.block,
|
|
885
|
-
localState: props.context.localState,
|
|
886
|
-
rootState: props.context.rootState,
|
|
887
|
-
rootSetState: props.context.rootSetState,
|
|
888
|
-
context: props.context.context,
|
|
889
|
-
shouldEvaluateBindings: true
|
|
890
|
-
});
|
|
922
|
+
const processedBlock = props.block;
|
|
891
923
|
const styles = processedBlock.responsiveStyles;
|
|
892
924
|
const content = props.context.content;
|
|
893
925
|
const sizesWithUpdatedBreakpoints = getSizesForBreakpoints(
|
|
@@ -1156,12 +1188,9 @@ var Repeated_block_default = RepeatedBlock;
|
|
|
1156
1188
|
|
|
1157
1189
|
// src/components/block/block.tsx
|
|
1158
1190
|
function Block(props) {
|
|
1159
|
-
const
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
context: props.context,
|
|
1163
|
-
registeredComponents: props.registeredComponents
|
|
1164
|
-
});
|
|
1191
|
+
const [_processedBlock, set_processedBlock] = createSignal5({
|
|
1192
|
+
value: null,
|
|
1193
|
+
update: false
|
|
1165
1194
|
});
|
|
1166
1195
|
const repeatItem = createMemo5(() => {
|
|
1167
1196
|
return getRepeatItemData({
|
|
@@ -1170,7 +1199,7 @@ function Block(props) {
|
|
|
1170
1199
|
});
|
|
1171
1200
|
});
|
|
1172
1201
|
const processedBlock = createMemo5(() => {
|
|
1173
|
-
|
|
1202
|
+
const blockToUse = props.block.repeat?.collection ? props.block : getProcessedBlock({
|
|
1174
1203
|
block: props.block,
|
|
1175
1204
|
localState: props.context.localState,
|
|
1176
1205
|
rootState: props.context.rootState,
|
|
@@ -1178,6 +1207,13 @@ function Block(props) {
|
|
|
1178
1207
|
context: props.context.context,
|
|
1179
1208
|
shouldEvaluateBindings: true
|
|
1180
1209
|
});
|
|
1210
|
+
return blockToUse;
|
|
1211
|
+
});
|
|
1212
|
+
const blockComponent = createMemo5(() => {
|
|
1213
|
+
return getComponent({
|
|
1214
|
+
block: processedBlock(),
|
|
1215
|
+
registeredComponents: props.registeredComponents
|
|
1216
|
+
});
|
|
1181
1217
|
});
|
|
1182
1218
|
const Tag = createMemo5(() => {
|
|
1183
1219
|
const shouldUseLink = props.block.tagName === "a" || processedBlock().properties?.href || processedBlock().href;
|
|
@@ -1235,9 +1271,24 @@ function Block(props) {
|
|
|
1235
1271
|
}
|
|
1236
1272
|
});
|
|
1237
1273
|
return <><Show4 when={canShowBlock()}>
|
|
1238
|
-
<Block_styles_default
|
|
1274
|
+
<Block_styles_default
|
|
1275
|
+
block={processedBlock()}
|
|
1276
|
+
context={props.context}
|
|
1277
|
+
/>
|
|
1239
1278
|
<Show4
|
|
1240
|
-
fallback={<
|
|
1279
|
+
fallback={<Show4
|
|
1280
|
+
fallback={<For2 each={repeatItem()}>{(data, _index) => {
|
|
1281
|
+
const index = _index();
|
|
1282
|
+
return <Repeated_block_default
|
|
1283
|
+
key={index}
|
|
1284
|
+
repeatContext={data.context}
|
|
1285
|
+
block={data.block}
|
|
1286
|
+
registeredComponents={props.registeredComponents}
|
|
1287
|
+
linkComponent={props.linkComponent}
|
|
1288
|
+
/>;
|
|
1289
|
+
}}</For2>}
|
|
1290
|
+
when={!repeatItem()}
|
|
1291
|
+
><Component_ref_default
|
|
1241
1292
|
componentRef={componentRefProps().componentRef}
|
|
1242
1293
|
componentOptions={componentRefProps().componentOptions}
|
|
1243
1294
|
blockChildren={componentRefProps().blockChildren}
|
|
@@ -1247,7 +1298,7 @@ function Block(props) {
|
|
|
1247
1298
|
builderBlock={componentRefProps().builderBlock}
|
|
1248
1299
|
includeBlockProps={componentRefProps().includeBlockProps}
|
|
1249
1300
|
isInteractive={componentRefProps().isInteractive}
|
|
1250
|
-
|
|
1301
|
+
/></Show4>}
|
|
1251
1302
|
when={!blockComponent()?.noWrap}
|
|
1252
1303
|
><Show4
|
|
1253
1304
|
fallback={<For2 each={repeatItem()}>{(data, _index) => {
|
|
@@ -1293,7 +1344,7 @@ function Block(props) {
|
|
|
1293
1344
|
var Block_default = Block;
|
|
1294
1345
|
|
|
1295
1346
|
// src/components/blocks/blocks-wrapper.tsx
|
|
1296
|
-
import { createMemo as createMemo6 } from "solid-js";
|
|
1347
|
+
import { onMount as onMount2, createMemo as createMemo6 } from "solid-js";
|
|
1297
1348
|
import { Dynamic as Dynamic4 } from "solid-js/web";
|
|
1298
1349
|
function BlocksWrapper(props) {
|
|
1299
1350
|
const className = createMemo6(() => {
|
|
@@ -1327,9 +1378,13 @@ function BlocksWrapper(props) {
|
|
|
1327
1378
|
);
|
|
1328
1379
|
}
|
|
1329
1380
|
}
|
|
1381
|
+
let blocksWrapperRef;
|
|
1382
|
+
onMount2(() => {
|
|
1383
|
+
});
|
|
1330
1384
|
return <>
|
|
1331
1385
|
<Dynamic4
|
|
1332
|
-
class={className() + " dynamic-
|
|
1386
|
+
class={className() + " dynamic-4da8c6f4"}
|
|
1387
|
+
ref={blocksWrapperRef}
|
|
1333
1388
|
builder-path={props.path}
|
|
1334
1389
|
builder-parent-id={props.parent}
|
|
1335
1390
|
{...{}}
|
|
@@ -1340,7 +1395,7 @@ function BlocksWrapper(props) {
|
|
|
1340
1395
|
{...props.BlocksWrapperProps}
|
|
1341
1396
|
component={props.BlocksWrapper}
|
|
1342
1397
|
>{props.children}</Dynamic4>
|
|
1343
|
-
<style>{`.dynamic-
|
|
1398
|
+
<style>{`.dynamic-4da8c6f4 {
|
|
1344
1399
|
display: flex;
|
|
1345
1400
|
flex-direction: column;
|
|
1346
1401
|
align-items: stretch;
|
|
@@ -1544,7 +1599,7 @@ function FragmentComponent(props) {
|
|
|
1544
1599
|
var fragment_default = FragmentComponent;
|
|
1545
1600
|
|
|
1546
1601
|
// src/blocks/image/image.tsx
|
|
1547
|
-
import { Show as Show7, onMount as
|
|
1602
|
+
import { Show as Show7, onMount as onMount3, createMemo as createMemo8 } from "solid-js";
|
|
1548
1603
|
|
|
1549
1604
|
// src/blocks/image/image.helpers.ts
|
|
1550
1605
|
function removeProtocol(path) {
|
|
@@ -1633,7 +1688,7 @@ function Image(props) {
|
|
|
1633
1688
|
const out = props.aspectRatio ? aspectRatioStyles : void 0;
|
|
1634
1689
|
return out;
|
|
1635
1690
|
});
|
|
1636
|
-
|
|
1691
|
+
onMount3(() => {
|
|
1637
1692
|
});
|
|
1638
1693
|
return <>
|
|
1639
1694
|
<>
|
|
@@ -1709,10 +1764,10 @@ function SectionComponent(props) {
|
|
|
1709
1764
|
var section_default = SectionComponent;
|
|
1710
1765
|
|
|
1711
1766
|
// src/blocks/symbol/symbol.tsx
|
|
1712
|
-
import { onMount as
|
|
1767
|
+
import { onMount as onMount7, on as on4, createEffect as createEffect4, createMemo as createMemo20, createSignal as createSignal20 } from "solid-js";
|
|
1713
1768
|
|
|
1714
1769
|
// src/components/content-variants/content-variants.tsx
|
|
1715
|
-
import { Show as Show14, For as For9, onMount as
|
|
1770
|
+
import { Show as Show14, For as For9, onMount as onMount6, createSignal as createSignal19, createMemo as createMemo19 } from "solid-js";
|
|
1716
1771
|
|
|
1717
1772
|
// src/helpers/url.ts
|
|
1718
1773
|
var getTopLevelDomain = (host) => {
|
|
@@ -2651,7 +2706,8 @@ var componentInfo7 = {
|
|
|
2651
2706
|
defaultValue: "children"
|
|
2652
2707
|
}],
|
|
2653
2708
|
shouldReceiveBuilderProps: {
|
|
2654
|
-
builderContext: true
|
|
2709
|
+
builderContext: true,
|
|
2710
|
+
builderComponents: true
|
|
2655
2711
|
}
|
|
2656
2712
|
};
|
|
2657
2713
|
|
|
@@ -2668,6 +2724,7 @@ function Slot(props) {
|
|
|
2668
2724
|
parent={props.builderContext.context?.symbolId}
|
|
2669
2725
|
path={`symbol.data.${props.name}`}
|
|
2670
2726
|
context={props.builderContext}
|
|
2727
|
+
registeredComponents={props.builderComponents}
|
|
2671
2728
|
blocks={props.builderContext.rootState?.[props.name]}
|
|
2672
2729
|
/></div></>;
|
|
2673
2730
|
}
|
|
@@ -3000,12 +3057,12 @@ var componentInfo11 = {
|
|
|
3000
3057
|
};
|
|
3001
3058
|
|
|
3002
3059
|
// src/blocks/custom-code/custom-code.tsx
|
|
3003
|
-
import { onMount as
|
|
3060
|
+
import { onMount as onMount4, createSignal as createSignal12 } from "solid-js";
|
|
3004
3061
|
function CustomCode(props) {
|
|
3005
3062
|
const [scriptsInserted, setScriptsInserted] = createSignal12([]);
|
|
3006
3063
|
const [scriptsRun, setScriptsRun] = createSignal12([]);
|
|
3007
3064
|
let elementRef;
|
|
3008
|
-
|
|
3065
|
+
onMount4(() => {
|
|
3009
3066
|
if (!elementRef?.getElementsByTagName || typeof window === "undefined") {
|
|
3010
3067
|
return;
|
|
3011
3068
|
}
|
|
@@ -3064,7 +3121,7 @@ var componentInfo12 = {
|
|
|
3064
3121
|
};
|
|
3065
3122
|
|
|
3066
3123
|
// src/blocks/embed/embed.tsx
|
|
3067
|
-
import { on, createEffect, createMemo as createMemo13, createSignal as createSignal13 } from "solid-js";
|
|
3124
|
+
import { on as on2, createEffect as createEffect2, createMemo as createMemo13, createSignal as createSignal13 } from "solid-js";
|
|
3068
3125
|
|
|
3069
3126
|
// src/blocks/embed/helpers.ts
|
|
3070
3127
|
var SCRIPT_MIME_TYPES = ["text/javascript", "application/javascript", "application/ecmascript"];
|
|
@@ -3105,8 +3162,8 @@ function Embed(props) {
|
|
|
3105
3162
|
findAndRunScripts();
|
|
3106
3163
|
}
|
|
3107
3164
|
}
|
|
3108
|
-
|
|
3109
|
-
|
|
3165
|
+
createEffect2(
|
|
3166
|
+
on2(() => [onUpdateFn_0_elem(), onUpdateFn_0_ranInitFn__()], onUpdateFn_0)
|
|
3110
3167
|
);
|
|
3111
3168
|
return <><div class="builder-embed" ref={elem} innerHTML={props.content} /></>;
|
|
3112
3169
|
}
|
|
@@ -4097,14 +4154,14 @@ var getDefaultRegisteredComponents = () => [{
|
|
|
4097
4154
|
// src/functions/register-component.ts
|
|
4098
4155
|
var createRegisterComponentMessage = (info) => ({
|
|
4099
4156
|
type: "builder.registerComponent",
|
|
4100
|
-
data:
|
|
4157
|
+
data: serializeIncludingFunctions(info)
|
|
4101
4158
|
});
|
|
4102
4159
|
var serializeFn = (fnValue) => {
|
|
4103
4160
|
const fnStr = fnValue.toString().trim();
|
|
4104
4161
|
const appendFunction = !fnStr.startsWith("function") && !fnStr.startsWith("(");
|
|
4105
4162
|
return `return (${appendFunction ? "function " : ""}${fnStr}).apply(this, arguments)`;
|
|
4106
4163
|
};
|
|
4107
|
-
function
|
|
4164
|
+
function serializeIncludingFunctions(info) {
|
|
4108
4165
|
return JSON.parse(JSON.stringify(info, (key, value) => {
|
|
4109
4166
|
if (typeof value === "function") {
|
|
4110
4167
|
return serializeFn(value);
|
|
@@ -4172,9 +4229,9 @@ var Inlined_script_default = InlinedScript;
|
|
|
4172
4229
|
// src/components/content/components/enable-editor.tsx
|
|
4173
4230
|
import {
|
|
4174
4231
|
Show as Show12,
|
|
4175
|
-
onMount as
|
|
4176
|
-
on as
|
|
4177
|
-
createEffect as
|
|
4232
|
+
onMount as onMount5,
|
|
4233
|
+
on as on3,
|
|
4234
|
+
createEffect as createEffect3,
|
|
4178
4235
|
createMemo as createMemo16,
|
|
4179
4236
|
createSignal as createSignal16
|
|
4180
4237
|
} from "solid-js";
|
|
@@ -4281,7 +4338,7 @@ var generateContentUrl = (options) => {
|
|
|
4281
4338
|
locale,
|
|
4282
4339
|
apiVersion = DEFAULT_API_VERSION,
|
|
4283
4340
|
fields,
|
|
4284
|
-
omit,
|
|
4341
|
+
omit: omit2,
|
|
4285
4342
|
offset,
|
|
4286
4343
|
cacheSeconds,
|
|
4287
4344
|
staleCacheSeconds,
|
|
@@ -4304,7 +4361,7 @@ var generateContentUrl = (options) => {
|
|
|
4304
4361
|
url.searchParams.set("locale", locale);
|
|
4305
4362
|
if (enrich)
|
|
4306
4363
|
url.searchParams.set("enrich", String(enrich));
|
|
4307
|
-
url.searchParams.set("omit",
|
|
4364
|
+
url.searchParams.set("omit", omit2 || "meta.componentsUsed");
|
|
4308
4365
|
if (fields) {
|
|
4309
4366
|
url.searchParams.set("fields", fields);
|
|
4310
4367
|
}
|
|
@@ -4674,11 +4731,14 @@ function isFromTrustedHost(trustedHosts, e) {
|
|
|
4674
4731
|
}
|
|
4675
4732
|
|
|
4676
4733
|
// src/constants/sdk-version.ts
|
|
4677
|
-
var SDK_VERSION = "2.0.
|
|
4734
|
+
var SDK_VERSION = "2.0.13";
|
|
4678
4735
|
|
|
4679
4736
|
// src/functions/register.ts
|
|
4680
4737
|
var registry = {};
|
|
4681
4738
|
function register(type, info) {
|
|
4739
|
+
if (type === "plugin") {
|
|
4740
|
+
info = serializeIncludingFunctions(info);
|
|
4741
|
+
}
|
|
4682
4742
|
let typeList = registry[type];
|
|
4683
4743
|
if (!typeList) {
|
|
4684
4744
|
typeList = registry[type] = [];
|
|
@@ -5109,7 +5169,7 @@ function EnableEditor(props) {
|
|
|
5109
5169
|
}
|
|
5110
5170
|
}
|
|
5111
5171
|
let elementRef;
|
|
5112
|
-
|
|
5172
|
+
onMount5(() => {
|
|
5113
5173
|
if (isBrowser()) {
|
|
5114
5174
|
if (isEditing()) {
|
|
5115
5175
|
window.addEventListener("message", processMessage);
|
|
@@ -5170,7 +5230,7 @@ function EnableEditor(props) {
|
|
|
5170
5230
|
}
|
|
5171
5231
|
}
|
|
5172
5232
|
});
|
|
5173
|
-
|
|
5233
|
+
onMount5(() => {
|
|
5174
5234
|
if (!props.apiKey) {
|
|
5175
5235
|
logger.error(
|
|
5176
5236
|
"No API key provided to `Content` component. This can cause issues. Please provide an API key using the `apiKey` prop."
|
|
@@ -5186,13 +5246,13 @@ function EnableEditor(props) {
|
|
|
5186
5246
|
mergeNewContent(props.content);
|
|
5187
5247
|
}
|
|
5188
5248
|
}
|
|
5189
|
-
|
|
5249
|
+
createEffect3(on3(() => [onUpdateFn_0_props_content()], onUpdateFn_0));
|
|
5190
5250
|
const onUpdateFn_1_props_builderContextSignal_content__data__jsCode = createMemo16(() => props.builderContextSignal.content?.data?.jsCode);
|
|
5191
5251
|
function onUpdateFn_1() {
|
|
5192
5252
|
evaluateJsCode();
|
|
5193
5253
|
}
|
|
5194
|
-
|
|
5195
|
-
|
|
5254
|
+
createEffect3(
|
|
5255
|
+
on3(
|
|
5196
5256
|
() => [onUpdateFn_1_props_builderContextSignal_content__data__jsCode()],
|
|
5197
5257
|
onUpdateFn_1
|
|
5198
5258
|
)
|
|
@@ -5201,8 +5261,8 @@ function EnableEditor(props) {
|
|
|
5201
5261
|
function onUpdateFn_2() {
|
|
5202
5262
|
runHttpRequests();
|
|
5203
5263
|
}
|
|
5204
|
-
|
|
5205
|
-
|
|
5264
|
+
createEffect3(
|
|
5265
|
+
on3(
|
|
5206
5266
|
() => [
|
|
5207
5267
|
onUpdateFn_2_props_builderContextSignal_content__data__httpRequests()
|
|
5208
5268
|
],
|
|
@@ -5215,8 +5275,8 @@ function EnableEditor(props) {
|
|
|
5215
5275
|
function onUpdateFn_3() {
|
|
5216
5276
|
emitStateUpdate();
|
|
5217
5277
|
}
|
|
5218
|
-
|
|
5219
|
-
|
|
5278
|
+
createEffect3(
|
|
5279
|
+
on3(
|
|
5220
5280
|
() => [onUpdateFn_3_props_builderContextSignal_rootState()],
|
|
5221
5281
|
onUpdateFn_3
|
|
5222
5282
|
)
|
|
@@ -5227,7 +5287,7 @@ function EnableEditor(props) {
|
|
|
5227
5287
|
mergeNewRootState(props.data);
|
|
5228
5288
|
}
|
|
5229
5289
|
}
|
|
5230
|
-
|
|
5290
|
+
createEffect3(on3(() => [onUpdateFn_4_props_data()], onUpdateFn_4));
|
|
5231
5291
|
const onUpdateFn_5_props_locale = createMemo16(() => props.locale);
|
|
5232
5292
|
function onUpdateFn_5() {
|
|
5233
5293
|
if (props.locale) {
|
|
@@ -5236,7 +5296,7 @@ function EnableEditor(props) {
|
|
|
5236
5296
|
});
|
|
5237
5297
|
}
|
|
5238
5298
|
}
|
|
5239
|
-
|
|
5299
|
+
createEffect3(on3(() => [onUpdateFn_5_props_locale()], onUpdateFn_5));
|
|
5240
5300
|
return <><builder_context_default.Provider value={props.builderContextSignal}><Show12 when={props.builderContextSignal.content}><Dynamic5
|
|
5241
5301
|
class={getWrapperClassName(
|
|
5242
5302
|
props.content?.testVariationId || props.content?.id
|
|
@@ -5338,7 +5398,7 @@ function ContentComponent(props) {
|
|
|
5338
5398
|
...acc,
|
|
5339
5399
|
[info.name]: {
|
|
5340
5400
|
component,
|
|
5341
|
-
...
|
|
5401
|
+
...serializeIncludingFunctions(info)
|
|
5342
5402
|
}
|
|
5343
5403
|
}),
|
|
5344
5404
|
{}
|
|
@@ -5372,7 +5432,7 @@ function ContentComponent(props) {
|
|
|
5372
5432
|
].reduce(
|
|
5373
5433
|
(acc, { component: _, ...info }) => ({
|
|
5374
5434
|
...acc,
|
|
5375
|
-
[info.name]:
|
|
5435
|
+
[info.name]: serializeIncludingFunctions(info)
|
|
5376
5436
|
}),
|
|
5377
5437
|
{}
|
|
5378
5438
|
),
|
|
@@ -5461,7 +5521,7 @@ function ContentVariants(props) {
|
|
|
5461
5521
|
canTrack: getDefaultCanTrack(props.canTrack)
|
|
5462
5522
|
});
|
|
5463
5523
|
});
|
|
5464
|
-
|
|
5524
|
+
onMount6(() => {
|
|
5465
5525
|
setShouldRenderVariants(false);
|
|
5466
5526
|
});
|
|
5467
5527
|
return <><>
|
|
@@ -5589,13 +5649,13 @@ function Symbol(props) {
|
|
|
5589
5649
|
}
|
|
5590
5650
|
});
|
|
5591
5651
|
}
|
|
5592
|
-
|
|
5652
|
+
onMount7(() => {
|
|
5593
5653
|
});
|
|
5594
5654
|
const onUpdateFn_0_props_symbol = createMemo20(() => props.symbol);
|
|
5595
5655
|
function onUpdateFn_0() {
|
|
5596
5656
|
setContent();
|
|
5597
5657
|
}
|
|
5598
|
-
|
|
5658
|
+
createEffect4(on4(() => [onUpdateFn_0_props_symbol()], onUpdateFn_0));
|
|
5599
5659
|
return <><div class={className()} {...{}} {...props.attributes} {...{}}><Content_variants_default
|
|
5600
5660
|
nonce={props.builderContext.nonce}
|
|
5601
5661
|
isNestedRender={true}
|