@builder.io/sdk-solid 0.8.0 → 0.9.0
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 +48 -19
- package/lib/browser/dev.js +118 -149
- package/lib/browser/dev.jsx +40 -93
- package/lib/browser/index.js +118 -142
- package/lib/browser/index.jsx +40 -91
- package/lib/edge/dev.js +118 -149
- package/lib/edge/dev.jsx +40 -93
- package/lib/edge/index.js +118 -142
- package/lib/edge/index.jsx +40 -91
- package/lib/node/dev.js +134 -160
- package/lib/node/dev.jsx +56 -104
- package/lib/node/index.js +132 -151
- package/lib/node/index.jsx +54 -100
- package/package.json +1 -1
package/lib/node/dev.js
CHANGED
|
@@ -56,7 +56,9 @@ var builder_context_default = createContext({
|
|
|
56
56
|
apiKey: null,
|
|
57
57
|
apiVersion: void 0,
|
|
58
58
|
componentInfos: {},
|
|
59
|
-
inheritedStyles: {}
|
|
59
|
+
inheritedStyles: {},
|
|
60
|
+
BlocksWrapper: "div",
|
|
61
|
+
BlocksWrapperProps: {}
|
|
60
62
|
});
|
|
61
63
|
var components_context_default = createContext({ registeredComponents: {} });
|
|
62
64
|
|
|
@@ -231,11 +233,16 @@ var set = (obj, _path, value) => {
|
|
|
231
233
|
path.slice(0, -1).reduce((a, c, i) => Object(a[c]) === a[c] ? a[c] : a[c] = Math.abs(Number(path[i + 1])) >> 0 === +path[i + 1] ? [] : {}, obj)[path[path.length - 1]] = value;
|
|
232
234
|
return obj;
|
|
233
235
|
};
|
|
234
|
-
var noop = () =>
|
|
236
|
+
var noop = () => {
|
|
237
|
+
};
|
|
235
238
|
var safeDynamicRequire = noop;
|
|
236
239
|
try {
|
|
237
240
|
safeDynamicRequire = createRequire(import.meta.url);
|
|
238
241
|
} catch (error) {
|
|
242
|
+
try {
|
|
243
|
+
safeDynamicRequire = eval("require");
|
|
244
|
+
} catch (error2) {
|
|
245
|
+
}
|
|
239
246
|
}
|
|
240
247
|
|
|
241
248
|
// src/functions/evaluate/node-runtime/node-runtime.ts
|
|
@@ -732,85 +739,10 @@ function getBlockActions(options) {
|
|
|
732
739
|
return obj;
|
|
733
740
|
}
|
|
734
741
|
|
|
735
|
-
// src/functions/sanitize-react-native-block-styles.ts
|
|
736
|
-
var propertiesThatMustBeNumber = /* @__PURE__ */ new Set(["lineHeight"]);
|
|
737
|
-
var displayValues = /* @__PURE__ */ new Set(["flex", "none"]);
|
|
738
|
-
var SHOW_WARNINGS = false;
|
|
739
|
-
var normalizeNumber = (value) => {
|
|
740
|
-
if (Number.isNaN(value)) {
|
|
741
|
-
return void 0;
|
|
742
|
-
} else if (value < 0) {
|
|
743
|
-
return 0;
|
|
744
|
-
} else {
|
|
745
|
-
return value;
|
|
746
|
-
}
|
|
747
|
-
};
|
|
748
|
-
var sanitizeReactNativeBlockStyles = (styles) => {
|
|
749
|
-
return Object.keys(styles).reduce((acc, key) => {
|
|
750
|
-
const propertyValue = styles[key];
|
|
751
|
-
if (key === "display" && !displayValues.has(propertyValue)) {
|
|
752
|
-
if (SHOW_WARNINGS) {
|
|
753
|
-
console.warn(`Style value for key "display" must be "flex" or "none" but had ${propertyValue}`);
|
|
754
|
-
}
|
|
755
|
-
return acc;
|
|
756
|
-
}
|
|
757
|
-
if (propertiesThatMustBeNumber.has(key) && typeof propertyValue !== "number") {
|
|
758
|
-
if (SHOW_WARNINGS) {
|
|
759
|
-
console.warn(`Style key ${key} must be a number, but had value \`${styles[key]}\``);
|
|
760
|
-
}
|
|
761
|
-
return acc;
|
|
762
|
-
}
|
|
763
|
-
if (typeof propertyValue === "string") {
|
|
764
|
-
const isPixelUnit = propertyValue.match(/^-?(\d*)(\.?)(\d*)*px$/);
|
|
765
|
-
if (isPixelUnit) {
|
|
766
|
-
const newValue = parseFloat(propertyValue);
|
|
767
|
-
const normalizedValue = normalizeNumber(newValue);
|
|
768
|
-
if (normalizedValue) {
|
|
769
|
-
return {
|
|
770
|
-
...acc,
|
|
771
|
-
[key]: normalizedValue
|
|
772
|
-
};
|
|
773
|
-
} else {
|
|
774
|
-
return acc;
|
|
775
|
-
}
|
|
776
|
-
} else if (propertyValue === "0") {
|
|
777
|
-
return {
|
|
778
|
-
...acc,
|
|
779
|
-
[key]: 0
|
|
780
|
-
};
|
|
781
|
-
}
|
|
782
|
-
}
|
|
783
|
-
return {
|
|
784
|
-
...acc,
|
|
785
|
-
[key]: propertyValue
|
|
786
|
-
};
|
|
787
|
-
}, {});
|
|
788
|
-
};
|
|
789
|
-
|
|
790
|
-
// src/functions/get-react-native-block-styles.ts
|
|
791
|
-
function getReactNativeBlockStyles({
|
|
792
|
-
block,
|
|
793
|
-
context,
|
|
794
|
-
blockStyles
|
|
795
|
-
}) {
|
|
796
|
-
const responsiveStyles = block.responsiveStyles;
|
|
797
|
-
if (!responsiveStyles) {
|
|
798
|
-
return {};
|
|
799
|
-
}
|
|
800
|
-
const styles = {
|
|
801
|
-
// recursively apply inherited styles so that they can be passed down to children `Text` blocks
|
|
802
|
-
...context.inheritedStyles,
|
|
803
|
-
...responsiveStyles.large || {},
|
|
804
|
-
...responsiveStyles.medium || {},
|
|
805
|
-
...responsiveStyles.small || {},
|
|
806
|
-
...blockStyles
|
|
807
|
-
};
|
|
808
|
-
const newStyles = sanitizeReactNativeBlockStyles(styles);
|
|
809
|
-
return newStyles;
|
|
810
|
-
}
|
|
811
|
-
|
|
812
742
|
// src/functions/transform-block-properties.ts
|
|
813
|
-
function transformBlockProperties(
|
|
743
|
+
function transformBlockProperties({
|
|
744
|
+
properties
|
|
745
|
+
}) {
|
|
814
746
|
return properties;
|
|
815
747
|
}
|
|
816
748
|
|
|
@@ -831,14 +763,11 @@ function getBlockProperties({
|
|
|
831
763
|
style: block.style ? getStyleAttribute(block.style) : void 0,
|
|
832
764
|
class: [block.id, "builder-block", block.class, block.properties?.class].filter(Boolean).join(" ")
|
|
833
765
|
};
|
|
834
|
-
|
|
835
|
-
properties
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
});
|
|
840
|
-
}
|
|
841
|
-
return transformBlockProperties(properties);
|
|
766
|
+
return transformBlockProperties({
|
|
767
|
+
properties,
|
|
768
|
+
context,
|
|
769
|
+
block
|
|
770
|
+
});
|
|
842
771
|
}
|
|
843
772
|
function getStyleAttribute(style) {
|
|
844
773
|
switch (TARGET) {
|
|
@@ -1276,7 +1205,6 @@ function Block(props) {
|
|
|
1276
1205
|
});
|
|
1277
1206
|
}
|
|
1278
1207
|
var block_default = Block;
|
|
1279
|
-
var _tmpl$4 = /* @__PURE__ */ template(`<div>`);
|
|
1280
1208
|
function BlocksWrapper(props) {
|
|
1281
1209
|
function className() {
|
|
1282
1210
|
return "builder-blocks" + (!props.blocks?.length ? " no-blocks" : "");
|
|
@@ -1303,33 +1231,35 @@ function BlocksWrapper(props) {
|
|
|
1303
1231
|
}, "*");
|
|
1304
1232
|
}
|
|
1305
1233
|
}
|
|
1306
|
-
return ((
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1234
|
+
return createComponent(Dynamic, mergeProps({
|
|
1235
|
+
get ["class"]() {
|
|
1236
|
+
return className() + " " + css({
|
|
1237
|
+
display: "flex",
|
|
1238
|
+
flexDirection: "column",
|
|
1239
|
+
alignItems: "stretch"
|
|
1240
|
+
});
|
|
1241
|
+
},
|
|
1242
|
+
get ["builder-path"]() {
|
|
1243
|
+
return props.path;
|
|
1244
|
+
},
|
|
1245
|
+
get ["builder-parent-id"]() {
|
|
1246
|
+
return props.parent;
|
|
1247
|
+
}
|
|
1248
|
+
}, {}, {
|
|
1249
|
+
get style() {
|
|
1250
|
+
return props.styleProp;
|
|
1251
|
+
},
|
|
1252
|
+
onClick: (event) => onClick(),
|
|
1253
|
+
onMouseEnter: (event) => onMouseEnter(),
|
|
1254
|
+
onKeyPress: (event) => onClick()
|
|
1255
|
+
}, () => props.BlocksWrapperProps, {
|
|
1256
|
+
get component() {
|
|
1257
|
+
return props.BlocksWrapper;
|
|
1258
|
+
},
|
|
1259
|
+
get children() {
|
|
1260
|
+
return props.children;
|
|
1261
|
+
}
|
|
1262
|
+
}));
|
|
1333
1263
|
}
|
|
1334
1264
|
var blocks_wrapper_default = BlocksWrapper;
|
|
1335
1265
|
|
|
@@ -1350,6 +1280,12 @@ function Blocks(props) {
|
|
|
1350
1280
|
get styleProp() {
|
|
1351
1281
|
return props.styleProp;
|
|
1352
1282
|
},
|
|
1283
|
+
get BlocksWrapper() {
|
|
1284
|
+
return props.context?.BlocksWrapper;
|
|
1285
|
+
},
|
|
1286
|
+
get BlocksWrapperProps() {
|
|
1287
|
+
return props.context?.BlocksWrapperProps;
|
|
1288
|
+
},
|
|
1353
1289
|
get children() {
|
|
1354
1290
|
return [createComponent(Show, {
|
|
1355
1291
|
get when() {
|
|
@@ -1407,7 +1343,7 @@ function Blocks(props) {
|
|
|
1407
1343
|
var blocks_default = Blocks;
|
|
1408
1344
|
|
|
1409
1345
|
// src/blocks/columns/columns.tsx
|
|
1410
|
-
var _tmpl$
|
|
1346
|
+
var _tmpl$4 = /* @__PURE__ */ template(`<div>`);
|
|
1411
1347
|
function Columns(props) {
|
|
1412
1348
|
const [gutterSize, setGutterSize] = createSignal(typeof props.space === "number" ? props.space || 0 : 20);
|
|
1413
1349
|
const [cols, setCols] = createSignal(props.columns || []);
|
|
@@ -1501,7 +1437,7 @@ function Columns(props) {
|
|
|
1501
1437
|
`;
|
|
1502
1438
|
}
|
|
1503
1439
|
return (() => {
|
|
1504
|
-
const _el$ = _tmpl$
|
|
1440
|
+
const _el$ = _tmpl$4();
|
|
1505
1441
|
spread(_el$, mergeProps({
|
|
1506
1442
|
get ["class"]() {
|
|
1507
1443
|
return `builder-columns ${props.builderBlock.id}-breakpoints ` + css({
|
|
@@ -1530,7 +1466,7 @@ function Columns(props) {
|
|
|
1530
1466
|
children: (column, _index) => {
|
|
1531
1467
|
const index = _index();
|
|
1532
1468
|
return (() => {
|
|
1533
|
-
const _el$2 = _tmpl$
|
|
1469
|
+
const _el$2 = _tmpl$4();
|
|
1534
1470
|
spread(_el$2, mergeProps({
|
|
1535
1471
|
get ["class"]() {
|
|
1536
1472
|
return "builder-column " + css({
|
|
@@ -1571,10 +1507,10 @@ function Columns(props) {
|
|
|
1571
1507
|
})();
|
|
1572
1508
|
}
|
|
1573
1509
|
var columns_default = Columns;
|
|
1574
|
-
var _tmpl$
|
|
1510
|
+
var _tmpl$5 = /* @__PURE__ */ template(`<span>`);
|
|
1575
1511
|
function FragmentComponent(props) {
|
|
1576
1512
|
return (() => {
|
|
1577
|
-
const _el$ = _tmpl$
|
|
1513
|
+
const _el$ = _tmpl$5();
|
|
1578
1514
|
insert(_el$, () => props.children);
|
|
1579
1515
|
return _el$;
|
|
1580
1516
|
})();
|
|
@@ -1629,7 +1565,7 @@ function getSrcSet(url) {
|
|
|
1629
1565
|
}
|
|
1630
1566
|
|
|
1631
1567
|
// src/blocks/image/image.tsx
|
|
1632
|
-
var _tmpl$
|
|
1568
|
+
var _tmpl$6 = /* @__PURE__ */ template(`<source type=image/webp>`);
|
|
1633
1569
|
var _tmpl$22 = /* @__PURE__ */ template(`<picture><img loading=lazy>`);
|
|
1634
1570
|
var _tmpl$32 = /* @__PURE__ */ template(`<div>`);
|
|
1635
1571
|
function Image(props) {
|
|
@@ -1676,7 +1612,7 @@ function Image(props) {
|
|
|
1676
1612
|
return webpSrcSet();
|
|
1677
1613
|
},
|
|
1678
1614
|
get children() {
|
|
1679
|
-
const _el$2 = _tmpl$
|
|
1615
|
+
const _el$2 = _tmpl$6();
|
|
1680
1616
|
effect(() => setAttribute(_el$2, "srcset", webpSrcSet()));
|
|
1681
1617
|
return _el$2;
|
|
1682
1618
|
}
|
|
@@ -1758,10 +1694,10 @@ function Image(props) {
|
|
|
1758
1694
|
})];
|
|
1759
1695
|
}
|
|
1760
1696
|
var image_default = Image;
|
|
1761
|
-
var _tmpl$
|
|
1697
|
+
var _tmpl$7 = /* @__PURE__ */ template(`<section>`);
|
|
1762
1698
|
function SectionComponent(props) {
|
|
1763
1699
|
return (() => {
|
|
1764
|
-
const _el$ = _tmpl$
|
|
1700
|
+
const _el$ = _tmpl$7();
|
|
1765
1701
|
spread(_el$, mergeProps({}, () => props.attributes, {
|
|
1766
1702
|
get style() {
|
|
1767
1703
|
return {
|
|
@@ -2255,7 +2191,7 @@ var componentInfo3 = {
|
|
|
2255
2191
|
advanced: true
|
|
2256
2192
|
}]
|
|
2257
2193
|
};
|
|
2258
|
-
var _tmpl$
|
|
2194
|
+
var _tmpl$8 = /* @__PURE__ */ template(`<div>`);
|
|
2259
2195
|
function CustomCode(props) {
|
|
2260
2196
|
const [scriptsInserted, setScriptsInserted] = createSignal([]);
|
|
2261
2197
|
const [scriptsRun, setScriptsRun] = createSignal([]);
|
|
@@ -2283,14 +2219,14 @@ function CustomCode(props) {
|
|
|
2283
2219
|
try {
|
|
2284
2220
|
scriptsRun().push(script.innerText);
|
|
2285
2221
|
new Function(script.innerText)();
|
|
2286
|
-
} catch (
|
|
2287
|
-
console.warn("`CustomCode`: Error running script:",
|
|
2222
|
+
} catch (error2) {
|
|
2223
|
+
console.warn("`CustomCode`: Error running script:", error2);
|
|
2288
2224
|
}
|
|
2289
2225
|
}
|
|
2290
2226
|
}
|
|
2291
2227
|
});
|
|
2292
2228
|
return (() => {
|
|
2293
|
-
const _el$ = _tmpl$
|
|
2229
|
+
const _el$ = _tmpl$8();
|
|
2294
2230
|
const _ref$ = elementRef;
|
|
2295
2231
|
typeof _ref$ === "function" ? use(_ref$, _el$) : elementRef = _el$;
|
|
2296
2232
|
effect((_p$) => {
|
|
@@ -2350,7 +2286,7 @@ var SCRIPT_MIME_TYPES = ["text/javascript", "application/javascript", "applicati
|
|
|
2350
2286
|
var isJsScript = (script) => SCRIPT_MIME_TYPES.includes(script.type);
|
|
2351
2287
|
|
|
2352
2288
|
// src/blocks/embed/embed.tsx
|
|
2353
|
-
var _tmpl$
|
|
2289
|
+
var _tmpl$9 = /* @__PURE__ */ template(`<div class=builder-embed>`);
|
|
2354
2290
|
function Embed(props) {
|
|
2355
2291
|
const [scriptsInserted, setScriptsInserted] = createSignal([]);
|
|
2356
2292
|
const [scriptsRun, setScriptsRun] = createSignal([]);
|
|
@@ -2371,8 +2307,8 @@ function Embed(props) {
|
|
|
2371
2307
|
try {
|
|
2372
2308
|
scriptsRun().push(script.innerText);
|
|
2373
2309
|
new Function(script.innerText)();
|
|
2374
|
-
} catch (
|
|
2375
|
-
console.warn("`Embed`: Error running script:",
|
|
2310
|
+
} catch (error2) {
|
|
2311
|
+
console.warn("`Embed`: Error running script:", error2);
|
|
2376
2312
|
}
|
|
2377
2313
|
}
|
|
2378
2314
|
}
|
|
@@ -2386,7 +2322,7 @@ function Embed(props) {
|
|
|
2386
2322
|
}
|
|
2387
2323
|
createEffect(on(() => [elem, ranInitFn()], onUpdateFn_0));
|
|
2388
2324
|
return (() => {
|
|
2389
|
-
const _el$ = _tmpl$
|
|
2325
|
+
const _el$ = _tmpl$9();
|
|
2390
2326
|
const _ref$ = elem;
|
|
2391
2327
|
typeof _ref$ === "function" ? use(_ref$, _el$) : elem = _el$;
|
|
2392
2328
|
effect(() => _el$.innerHTML = props.content);
|
|
@@ -2543,10 +2479,10 @@ var componentInfo7 = {
|
|
|
2543
2479
|
noWrap: true,
|
|
2544
2480
|
static: true
|
|
2545
2481
|
};
|
|
2546
|
-
var _tmpl$
|
|
2482
|
+
var _tmpl$10 = /* @__PURE__ */ template(`<img>`);
|
|
2547
2483
|
function ImgComponent(props) {
|
|
2548
2484
|
return (() => {
|
|
2549
|
-
const _el$ = _tmpl$
|
|
2485
|
+
const _el$ = _tmpl$10();
|
|
2550
2486
|
spread(_el$, mergeProps({
|
|
2551
2487
|
get style() {
|
|
2552
2488
|
return {
|
|
@@ -2667,10 +2603,10 @@ var componentInfo10 = {
|
|
|
2667
2603
|
textAlign: "center"
|
|
2668
2604
|
}
|
|
2669
2605
|
};
|
|
2670
|
-
var _tmpl$
|
|
2606
|
+
var _tmpl$11 = /* @__PURE__ */ template(`<div class=builder-text>`);
|
|
2671
2607
|
function Text(props) {
|
|
2672
2608
|
return (() => {
|
|
2673
|
-
const _el$ = _tmpl$
|
|
2609
|
+
const _el$ = _tmpl$11();
|
|
2674
2610
|
_el$.style.setProperty("outline", "none");
|
|
2675
2611
|
effect(() => _el$.innerHTML = props.text?.toString() || "");
|
|
2676
2612
|
return _el$;
|
|
@@ -2761,7 +2697,7 @@ var componentInfo11 = {
|
|
|
2761
2697
|
advanced: true
|
|
2762
2698
|
}]
|
|
2763
2699
|
};
|
|
2764
|
-
var _tmpl$
|
|
2700
|
+
var _tmpl$12 = /* @__PURE__ */ template(`<source type=video/mp4>`);
|
|
2765
2701
|
var _tmpl$23 = /* @__PURE__ */ template(`<div>`);
|
|
2766
2702
|
var _tmpl$33 = /* @__PURE__ */ template(`<div><video class=builder-video>`);
|
|
2767
2703
|
function Video(props) {
|
|
@@ -2824,7 +2760,7 @@ function Video(props) {
|
|
|
2824
2760
|
return !props.lazyLoad;
|
|
2825
2761
|
},
|
|
2826
2762
|
get children() {
|
|
2827
|
-
const _el$3 = _tmpl$
|
|
2763
|
+
const _el$3 = _tmpl$12();
|
|
2828
2764
|
effect(() => setAttribute(_el$3, "src", props.video));
|
|
2829
2765
|
return _el$3;
|
|
2830
2766
|
}
|
|
@@ -2983,10 +2919,10 @@ var getUpdateVariantVisibilityScript = ({
|
|
|
2983
2919
|
}) => `window.${UPDATE_VARIANT_VISIBILITY_SCRIPT_FN_NAME}(
|
|
2984
2920
|
"${variationId}", "${contentId}", ${isHydrationTarget}
|
|
2985
2921
|
)`;
|
|
2986
|
-
var _tmpl$
|
|
2922
|
+
var _tmpl$13 = /* @__PURE__ */ template(`<script>`);
|
|
2987
2923
|
function InlinedScript(props) {
|
|
2988
2924
|
return (() => {
|
|
2989
|
-
const _el$ = _tmpl$
|
|
2925
|
+
const _el$ = _tmpl$13();
|
|
2990
2926
|
effect((_p$) => {
|
|
2991
2927
|
const _v$ = props.scriptStr, _v$2 = props.id || "";
|
|
2992
2928
|
_v$ !== _p$._v$ && (_el$.innerHTML = _p$._v$ = _v$);
|
|
@@ -3228,8 +3164,8 @@ async function fetchEntries(options) {
|
|
|
3228
3164
|
return null;
|
|
3229
3165
|
}
|
|
3230
3166
|
return _processContentResult(options, content);
|
|
3231
|
-
} catch (
|
|
3232
|
-
logger.error("Error fetching data. ",
|
|
3167
|
+
} catch (error2) {
|
|
3168
|
+
logger.error("Error fetching data. ", error2);
|
|
3233
3169
|
return null;
|
|
3234
3170
|
}
|
|
3235
3171
|
}
|
|
@@ -3486,7 +3422,7 @@ var getInteractionPropertiesForEvent = (event) => {
|
|
|
3486
3422
|
};
|
|
3487
3423
|
|
|
3488
3424
|
// src/constants/sdk-version.ts
|
|
3489
|
-
var SDK_VERSION = "0.
|
|
3425
|
+
var SDK_VERSION = "0.9.0";
|
|
3490
3426
|
|
|
3491
3427
|
// src/functions/register.ts
|
|
3492
3428
|
var registry = {};
|
|
@@ -3577,18 +3513,18 @@ var setupBrowserForEditing = (options = {}) => {
|
|
|
3577
3513
|
const id = data.data.id;
|
|
3578
3514
|
const fn = new Function(text);
|
|
3579
3515
|
let result;
|
|
3580
|
-
let
|
|
3516
|
+
let error2 = null;
|
|
3581
3517
|
try {
|
|
3582
3518
|
result = fn.apply(null, args);
|
|
3583
3519
|
} catch (err) {
|
|
3584
|
-
|
|
3520
|
+
error2 = err;
|
|
3585
3521
|
}
|
|
3586
|
-
if (
|
|
3522
|
+
if (error2) {
|
|
3587
3523
|
window.parent?.postMessage({
|
|
3588
3524
|
type: "builder.evaluateError",
|
|
3589
3525
|
data: {
|
|
3590
3526
|
id,
|
|
3591
|
-
error:
|
|
3527
|
+
error: error2.message
|
|
3592
3528
|
}
|
|
3593
3529
|
}, "*");
|
|
3594
3530
|
} else {
|
|
@@ -3620,11 +3556,11 @@ var setupBrowserForEditing = (options = {}) => {
|
|
|
3620
3556
|
};
|
|
3621
3557
|
|
|
3622
3558
|
// src/components/content/components/enable-editor.tsx
|
|
3623
|
-
var _tmpl$15 = /* @__PURE__ */ template(`<div>`);
|
|
3624
3559
|
function EnableEditor(props) {
|
|
3625
3560
|
const [forceReRenderCount, setForceReRenderCount] = createSignal(0);
|
|
3626
3561
|
createSignal(0);
|
|
3627
3562
|
const [shouldSendResetCookie, setShouldSendResetCookie] = createSignal(false);
|
|
3563
|
+
const [ContentWrapper, setContentWrapper] = createSignal(props.contentWrapper || "div");
|
|
3628
3564
|
const [httpReqsData, setHttpReqsData] = createSignal({});
|
|
3629
3565
|
const [clicked, setClicked] = createSignal(false);
|
|
3630
3566
|
function mergeNewContent(newContent) {
|
|
@@ -3857,10 +3793,7 @@ function EnableEditor(props) {
|
|
|
3857
3793
|
return props.builderContextSignal.content;
|
|
3858
3794
|
},
|
|
3859
3795
|
get children() {
|
|
3860
|
-
|
|
3861
|
-
const _ref$ = elementRef;
|
|
3862
|
-
typeof _ref$ === "function" ? use(_ref$, _el$) : elementRef = _el$;
|
|
3863
|
-
spread(_el$, mergeProps({
|
|
3796
|
+
return createComponent(Dynamic, mergeProps({
|
|
3864
3797
|
get ["class"]() {
|
|
3865
3798
|
return `variant-${props.content?.testVariationId || props.content?.id}`;
|
|
3866
3799
|
}
|
|
@@ -3868,7 +3801,11 @@ function EnableEditor(props) {
|
|
|
3868
3801
|
get key() {
|
|
3869
3802
|
return forceReRenderCount();
|
|
3870
3803
|
},
|
|
3871
|
-
|
|
3804
|
+
ref(r$) {
|
|
3805
|
+
const _ref$ = elementRef;
|
|
3806
|
+
typeof _ref$ === "function" ? _ref$(r$) : elementRef = r$;
|
|
3807
|
+
},
|
|
3808
|
+
onClick: (event) => onClick(event),
|
|
3872
3809
|
get ["builder-content-id"]() {
|
|
3873
3810
|
return props.builderContextSignal.content?.id;
|
|
3874
3811
|
},
|
|
@@ -3878,9 +3815,14 @@ function EnableEditor(props) {
|
|
|
3878
3815
|
}, {}, () => props.showContent ? {} : {
|
|
3879
3816
|
hidden: true,
|
|
3880
3817
|
"aria-hidden": true
|
|
3881
|
-
}
|
|
3882
|
-
|
|
3883
|
-
|
|
3818
|
+
}, () => props.contentWrapperProps, {
|
|
3819
|
+
get component() {
|
|
3820
|
+
return ContentWrapper();
|
|
3821
|
+
},
|
|
3822
|
+
get children() {
|
|
3823
|
+
return props.children;
|
|
3824
|
+
}
|
|
3825
|
+
}));
|
|
3884
3826
|
}
|
|
3885
3827
|
});
|
|
3886
3828
|
}
|
|
@@ -4069,7 +4011,9 @@ function ContentComponent(props) {
|
|
|
4069
4011
|
...acc,
|
|
4070
4012
|
[info.name]: serializeComponentInfo(info)
|
|
4071
4013
|
}), {}),
|
|
4072
|
-
inheritedStyles: {}
|
|
4014
|
+
inheritedStyles: {},
|
|
4015
|
+
BlocksWrapper: props.blocksWrapper || "div",
|
|
4016
|
+
BlocksWrapperProps: props.blocksWrapperProps || {}
|
|
4073
4017
|
});
|
|
4074
4018
|
function contentSetState(newRootState) {
|
|
4075
4019
|
setBuilderContextSignal((PREVIOUS_VALUE) => ({
|
|
@@ -4114,6 +4058,12 @@ function ContentComponent(props) {
|
|
|
4114
4058
|
},
|
|
4115
4059
|
get builderContextSignal() {
|
|
4116
4060
|
return builderContextSignal();
|
|
4061
|
+
},
|
|
4062
|
+
get contentWrapper() {
|
|
4063
|
+
return props.contentWrapper;
|
|
4064
|
+
},
|
|
4065
|
+
get contentWrapperProps() {
|
|
4066
|
+
return props.contentWrapperProps;
|
|
4117
4067
|
}
|
|
4118
4068
|
}, {
|
|
4119
4069
|
setBuilderContextSignal
|
|
@@ -4261,6 +4211,18 @@ function ContentVariants(props) {
|
|
|
4261
4211
|
},
|
|
4262
4212
|
get isSsrAbTest() {
|
|
4263
4213
|
return shouldRenderVariants();
|
|
4214
|
+
},
|
|
4215
|
+
get blocksWrapper() {
|
|
4216
|
+
return props.blocksWrapper;
|
|
4217
|
+
},
|
|
4218
|
+
get blocksWrapperProps() {
|
|
4219
|
+
return props.blocksWrapperProps;
|
|
4220
|
+
},
|
|
4221
|
+
get contentWrapper() {
|
|
4222
|
+
return props.contentWrapper;
|
|
4223
|
+
},
|
|
4224
|
+
get contentWrapperProps() {
|
|
4225
|
+
return props.contentWrapperProps;
|
|
4264
4226
|
}
|
|
4265
4227
|
});
|
|
4266
4228
|
}
|
|
@@ -4303,6 +4265,18 @@ function ContentVariants(props) {
|
|
|
4303
4265
|
},
|
|
4304
4266
|
get isSsrAbTest() {
|
|
4305
4267
|
return shouldRenderVariants();
|
|
4268
|
+
},
|
|
4269
|
+
get blocksWrapper() {
|
|
4270
|
+
return props.blocksWrapper;
|
|
4271
|
+
},
|
|
4272
|
+
get blocksWrapperProps() {
|
|
4273
|
+
return props.blocksWrapperProps;
|
|
4274
|
+
},
|
|
4275
|
+
get contentWrapper() {
|
|
4276
|
+
return props.contentWrapper;
|
|
4277
|
+
},
|
|
4278
|
+
get contentWrapperProps() {
|
|
4279
|
+
return props.contentWrapperProps;
|
|
4306
4280
|
}
|
|
4307
4281
|
}))];
|
|
4308
4282
|
}
|
|
@@ -4333,7 +4307,7 @@ var fetchSymbolContent = async ({
|
|
|
4333
4307
|
};
|
|
4334
4308
|
|
|
4335
4309
|
// src/blocks/symbol/symbol.tsx
|
|
4336
|
-
var _tmpl$
|
|
4310
|
+
var _tmpl$14 = /* @__PURE__ */ template(`<div>`);
|
|
4337
4311
|
function Symbol(props) {
|
|
4338
4312
|
const [contentToUse, setContentToUse] = createSignal(props.symbol?.content);
|
|
4339
4313
|
function className() {
|
|
@@ -4359,7 +4333,7 @@ function Symbol(props) {
|
|
|
4359
4333
|
}
|
|
4360
4334
|
createEffect(on(() => [props.symbol], onUpdateFn_0));
|
|
4361
4335
|
return (() => {
|
|
4362
|
-
const _el$ = _tmpl$
|
|
4336
|
+
const _el$ = _tmpl$14();
|
|
4363
4337
|
spread(_el$, mergeProps({
|
|
4364
4338
|
get ["class"]() {
|
|
4365
4339
|
return className();
|