@builder.io/sdk-solid 0.12.3 → 0.12.4
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 +23 -14
- package/lib/browser/dev.js +243 -161
- package/lib/browser/dev.jsx +185 -118
- package/lib/browser/index.js +243 -161
- package/lib/browser/index.jsx +185 -118
- package/lib/edge/dev.js +243 -161
- package/lib/edge/dev.jsx +185 -118
- package/lib/edge/index.js +243 -161
- package/lib/edge/index.jsx +185 -118
- package/lib/node/dev.js +243 -161
- package/lib/node/dev.jsx +185 -118
- package/lib/node/index.js +243 -161
- package/lib/node/index.jsx +185 -118
- package/package.json +1 -1
package/lib/browser/index.js
CHANGED
|
@@ -1,44 +1,99 @@
|
|
|
1
1
|
import { createComponent, spread, mergeProps, insert, effect, setAttribute, className, style, template, Dynamic, memo, use } from 'solid-js/web';
|
|
2
|
-
import { createContext,
|
|
2
|
+
import { createContext, useContext, Show, For, createSignal, onMount, createEffect, on } from 'solid-js';
|
|
3
3
|
import { css } from 'solid-styled-components';
|
|
4
4
|
|
|
5
5
|
// src/blocks/button/button.tsx
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
|
|
7
|
+
// src/components/dynamic-renderer/dynamic-renderer.helpers.ts
|
|
8
|
+
var EMPTY_HTML_ELEMENTS = /* @__PURE__ */ new Set(["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen", "link", "meta", "param", "source", "track", "wbr"]);
|
|
9
|
+
var isEmptyElement = (tagName) => {
|
|
10
|
+
return typeof tagName === "string" && EMPTY_HTML_ELEMENTS.has(tagName.toLowerCase());
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
// src/components/dynamic-renderer/dynamic-renderer.tsx
|
|
14
|
+
function DynamicRenderer(props) {
|
|
9
15
|
return createComponent(Show, {
|
|
10
16
|
get fallback() {
|
|
11
|
-
return (() => {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
}, {}, () => props.attributes, {
|
|
18
|
-
get style() {
|
|
19
|
-
return props.attributes.style;
|
|
20
|
-
}
|
|
21
|
-
}), false, true);
|
|
22
|
-
insert(_el$2, () => props.text);
|
|
23
|
-
return _el$2;
|
|
24
|
-
})();
|
|
17
|
+
return createComponent(Dynamic, mergeProps(() => props.attributes, () => props.actionAttributes, {
|
|
18
|
+
get component() {
|
|
19
|
+
return props.TagName;
|
|
20
|
+
}
|
|
21
|
+
}));
|
|
25
22
|
},
|
|
26
23
|
get when() {
|
|
27
|
-
return props.
|
|
24
|
+
return !isEmptyElement(props.TagName);
|
|
28
25
|
},
|
|
29
26
|
get children() {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
27
|
+
return createComponent(Show, {
|
|
28
|
+
get fallback() {
|
|
29
|
+
return createComponent(Dynamic, mergeProps(() => props.attributes, () => props.actionAttributes, {
|
|
30
|
+
get component() {
|
|
31
|
+
return props.TagName;
|
|
32
|
+
},
|
|
33
|
+
get children() {
|
|
34
|
+
return props.children;
|
|
35
|
+
}
|
|
36
|
+
}));
|
|
34
37
|
},
|
|
35
|
-
get
|
|
36
|
-
return props.
|
|
38
|
+
get when() {
|
|
39
|
+
return typeof props.TagName === "string";
|
|
37
40
|
},
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
41
|
+
get children() {
|
|
42
|
+
return createComponent(Dynamic, mergeProps(() => props.attributes, () => props.actionAttributes, {
|
|
43
|
+
get component() {
|
|
44
|
+
return props.TagName;
|
|
45
|
+
},
|
|
46
|
+
get children() {
|
|
47
|
+
return props.children;
|
|
48
|
+
}
|
|
49
|
+
}));
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
var dynamic_renderer_default = DynamicRenderer;
|
|
56
|
+
|
|
57
|
+
// src/constants/target.ts
|
|
58
|
+
var TARGET = "solid";
|
|
59
|
+
|
|
60
|
+
// src/functions/get-class-prop-name.ts
|
|
61
|
+
var getClassPropName = () => {
|
|
62
|
+
switch (TARGET) {
|
|
63
|
+
case "react":
|
|
64
|
+
case "reactNative":
|
|
65
|
+
case "rsc":
|
|
66
|
+
return "className";
|
|
67
|
+
case "svelte":
|
|
68
|
+
case "vue":
|
|
69
|
+
case "solid":
|
|
70
|
+
case "qwik":
|
|
71
|
+
return "class";
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
// src/blocks/button/button.tsx
|
|
76
|
+
function Button(props) {
|
|
77
|
+
return createComponent(dynamic_renderer_default, {
|
|
78
|
+
get TagName() {
|
|
79
|
+
return props.link ? props.builderLinkComponent || "a" : "button";
|
|
80
|
+
},
|
|
81
|
+
get attributes() {
|
|
82
|
+
return {
|
|
83
|
+
...props.attributes,
|
|
84
|
+
[getClassPropName()]: `${props.link ? "" : "builder-button"} ${props.attributes[getClassPropName()] || ""}`,
|
|
85
|
+
...props.link ? {
|
|
86
|
+
href: props.link,
|
|
87
|
+
target: props.openLinkInNewTab ? "_blank" : void 0,
|
|
88
|
+
role: "link"
|
|
89
|
+
} : {
|
|
90
|
+
role: "button"
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
},
|
|
94
|
+
actionAttributes: {},
|
|
95
|
+
get children() {
|
|
96
|
+
return props.text;
|
|
42
97
|
}
|
|
43
98
|
});
|
|
44
99
|
}
|
|
@@ -84,9 +139,6 @@ function isBrowser() {
|
|
|
84
139
|
return typeof window !== "undefined" && typeof document !== "undefined";
|
|
85
140
|
}
|
|
86
141
|
|
|
87
|
-
// src/constants/target.ts
|
|
88
|
-
var TARGET = "solid";
|
|
89
|
-
|
|
90
142
|
// src/functions/is-iframe.ts
|
|
91
143
|
function isIframe() {
|
|
92
144
|
return isBrowser() && window.self !== window.top;
|
|
@@ -474,10 +526,10 @@ var createCssClass = ({
|
|
|
474
526
|
return cssClass;
|
|
475
527
|
}
|
|
476
528
|
};
|
|
477
|
-
var _tmpl$
|
|
529
|
+
var _tmpl$ = /* @__PURE__ */ template(`<style>`);
|
|
478
530
|
function InlinedStyles(props) {
|
|
479
531
|
return (() => {
|
|
480
|
-
const _el$ = _tmpl$
|
|
532
|
+
const _el$ = _tmpl$();
|
|
481
533
|
effect((_p$) => {
|
|
482
534
|
const _v$ = props.styles, _v$2 = props.id;
|
|
483
535
|
_v$ !== _p$._v$ && (_el$.innerHTML = _p$._v$ = _v$);
|
|
@@ -603,6 +655,38 @@ function getBlockActions(options) {
|
|
|
603
655
|
return obj;
|
|
604
656
|
}
|
|
605
657
|
|
|
658
|
+
// src/functions/transform-style-property.ts
|
|
659
|
+
function transformStyleProperty({
|
|
660
|
+
style
|
|
661
|
+
}) {
|
|
662
|
+
return style;
|
|
663
|
+
}
|
|
664
|
+
|
|
665
|
+
// src/functions/get-style.ts
|
|
666
|
+
var getStyle = ({
|
|
667
|
+
block,
|
|
668
|
+
context
|
|
669
|
+
}) => {
|
|
670
|
+
return mapStyleObjToStrIfNeeded(transformStyleProperty({
|
|
671
|
+
style: block.style || {},
|
|
672
|
+
context,
|
|
673
|
+
block
|
|
674
|
+
}));
|
|
675
|
+
};
|
|
676
|
+
function mapStyleObjToStrIfNeeded(style) {
|
|
677
|
+
switch (TARGET) {
|
|
678
|
+
case "svelte":
|
|
679
|
+
case "vue":
|
|
680
|
+
case "solid":
|
|
681
|
+
return convertStyleMapToCSSArray(style).join(" ");
|
|
682
|
+
case "qwik":
|
|
683
|
+
case "reactNative":
|
|
684
|
+
case "react":
|
|
685
|
+
case "rsc":
|
|
686
|
+
return style;
|
|
687
|
+
}
|
|
688
|
+
}
|
|
689
|
+
|
|
606
690
|
// src/functions/transform-block-properties.ts
|
|
607
691
|
function transformBlockProperties({
|
|
608
692
|
properties
|
|
@@ -624,8 +708,11 @@ function getBlockProperties({
|
|
|
624
708
|
...extractRelevantRootBlockProperties(block),
|
|
625
709
|
...block.properties,
|
|
626
710
|
"builder-id": block.id,
|
|
627
|
-
style:
|
|
628
|
-
|
|
711
|
+
style: getStyle({
|
|
712
|
+
block,
|
|
713
|
+
context
|
|
714
|
+
}),
|
|
715
|
+
[getClassPropName()]: [block.id, "builder-block", block.class, block.properties?.class].filter(Boolean).join(" ")
|
|
629
716
|
};
|
|
630
717
|
return transformBlockProperties({
|
|
631
718
|
properties,
|
|
@@ -633,69 +720,6 @@ function getBlockProperties({
|
|
|
633
720
|
block
|
|
634
721
|
});
|
|
635
722
|
}
|
|
636
|
-
function getStyleAttribute(style) {
|
|
637
|
-
switch (TARGET) {
|
|
638
|
-
case "svelte":
|
|
639
|
-
case "vue":
|
|
640
|
-
case "solid":
|
|
641
|
-
return convertStyleMapToCSSArray(style).join(" ");
|
|
642
|
-
case "qwik":
|
|
643
|
-
case "reactNative":
|
|
644
|
-
case "react":
|
|
645
|
-
case "rsc":
|
|
646
|
-
return style;
|
|
647
|
-
}
|
|
648
|
-
}
|
|
649
|
-
|
|
650
|
-
// src/components/dynamic-renderer/dynamic-renderer.helpers.ts
|
|
651
|
-
var EMPTY_HTML_ELEMENTS = /* @__PURE__ */ new Set(["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen", "link", "meta", "param", "source", "track", "wbr"]);
|
|
652
|
-
var isEmptyElement = (tagName) => {
|
|
653
|
-
return typeof tagName === "string" && EMPTY_HTML_ELEMENTS.has(tagName.toLowerCase());
|
|
654
|
-
};
|
|
655
|
-
|
|
656
|
-
// src/components/dynamic-renderer/dynamic-renderer.tsx
|
|
657
|
-
function DynamicRenderer(props) {
|
|
658
|
-
return createComponent(Show, {
|
|
659
|
-
get fallback() {
|
|
660
|
-
return createComponent(Dynamic, mergeProps(() => props.attributes, () => props.actionAttributes, {
|
|
661
|
-
get component() {
|
|
662
|
-
return props.TagName;
|
|
663
|
-
}
|
|
664
|
-
}));
|
|
665
|
-
},
|
|
666
|
-
get when() {
|
|
667
|
-
return !isEmptyElement(props.TagName);
|
|
668
|
-
},
|
|
669
|
-
get children() {
|
|
670
|
-
return createComponent(Show, {
|
|
671
|
-
get fallback() {
|
|
672
|
-
return createComponent(Dynamic, mergeProps(() => props.attributes, () => props.actionAttributes, {
|
|
673
|
-
get component() {
|
|
674
|
-
return props.TagName;
|
|
675
|
-
},
|
|
676
|
-
get children() {
|
|
677
|
-
return props.children;
|
|
678
|
-
}
|
|
679
|
-
}));
|
|
680
|
-
},
|
|
681
|
-
get when() {
|
|
682
|
-
return typeof props.TagName === "string";
|
|
683
|
-
},
|
|
684
|
-
get children() {
|
|
685
|
-
return createComponent(Dynamic, mergeProps(() => props.attributes, () => props.actionAttributes, {
|
|
686
|
-
get component() {
|
|
687
|
-
return props.TagName;
|
|
688
|
-
},
|
|
689
|
-
get children() {
|
|
690
|
-
return props.children;
|
|
691
|
-
}
|
|
692
|
-
}));
|
|
693
|
-
}
|
|
694
|
-
});
|
|
695
|
-
}
|
|
696
|
-
});
|
|
697
|
-
}
|
|
698
|
-
var dynamic_renderer_default = DynamicRenderer;
|
|
699
723
|
|
|
700
724
|
// src/components/block/components/block-wrapper.tsx
|
|
701
725
|
function BlockWrapper(props) {
|
|
@@ -798,6 +822,7 @@ function ComponentRef(props) {
|
|
|
798
822
|
builderBlock: props.builderBlock,
|
|
799
823
|
context: props.context,
|
|
800
824
|
componentRef: props.componentRef,
|
|
825
|
+
linkComponent: props.linkComponent,
|
|
801
826
|
includeBlockProps: props.includeBlockProps,
|
|
802
827
|
isInteractive: props.isInteractive,
|
|
803
828
|
contextValue: props.context
|
|
@@ -822,6 +847,9 @@ function ComponentRef(props) {
|
|
|
822
847
|
},
|
|
823
848
|
get registeredComponents() {
|
|
824
849
|
return props.registeredComponents;
|
|
850
|
+
},
|
|
851
|
+
get linkComponent() {
|
|
852
|
+
return props.linkComponent;
|
|
825
853
|
}
|
|
826
854
|
});
|
|
827
855
|
}
|
|
@@ -848,6 +876,9 @@ function RepeatedBlock(props) {
|
|
|
848
876
|
},
|
|
849
877
|
get registeredComponents() {
|
|
850
878
|
return props.registeredComponents;
|
|
879
|
+
},
|
|
880
|
+
get linkComponent() {
|
|
881
|
+
return props.linkComponent;
|
|
851
882
|
}
|
|
852
883
|
});
|
|
853
884
|
}
|
|
@@ -882,6 +913,10 @@ function Block(props) {
|
|
|
882
913
|
});
|
|
883
914
|
}
|
|
884
915
|
function Tag() {
|
|
916
|
+
const shouldUseLink = props.block.tagName === "a" || processedBlock().properties?.href || processedBlock().href;
|
|
917
|
+
if (shouldUseLink) {
|
|
918
|
+
return props.linkComponent || "a";
|
|
919
|
+
}
|
|
885
920
|
return props.block.tagName || "div";
|
|
886
921
|
}
|
|
887
922
|
function canShowBlock() {
|
|
@@ -905,11 +940,15 @@ function Block(props) {
|
|
|
905
940
|
componentOptions: {
|
|
906
941
|
...getBlockComponentOptions(processedBlock()),
|
|
907
942
|
builderContext: props.context,
|
|
943
|
+
...blockComponent()?.name === "Core:Button" || blockComponent()?.name === "Symbol" || blockComponent()?.name === "Columns" ? {
|
|
944
|
+
builderLinkComponent: props.linkComponent
|
|
945
|
+
} : {},
|
|
908
946
|
...blockComponent()?.name === "Symbol" || blockComponent()?.name === "Columns" ? {
|
|
909
947
|
builderComponents: props.registeredComponents
|
|
910
948
|
} : {}
|
|
911
949
|
},
|
|
912
950
|
context: childrenContext(),
|
|
951
|
+
linkComponent: props.linkComponent,
|
|
913
952
|
registeredComponents: props.registeredComponents,
|
|
914
953
|
builderBlock: processedBlock(),
|
|
915
954
|
includeBlockProps: blockComponent()?.noWrap === true,
|
|
@@ -946,6 +985,9 @@ function Block(props) {
|
|
|
946
985
|
get registeredComponents() {
|
|
947
986
|
return componentRefProps().registeredComponents;
|
|
948
987
|
},
|
|
988
|
+
get linkComponent() {
|
|
989
|
+
return componentRefProps().linkComponent;
|
|
990
|
+
},
|
|
949
991
|
get builderBlock() {
|
|
950
992
|
return componentRefProps().builderBlock;
|
|
951
993
|
},
|
|
@@ -979,6 +1021,9 @@ function Block(props) {
|
|
|
979
1021
|
},
|
|
980
1022
|
get registeredComponents() {
|
|
981
1023
|
return props.registeredComponents;
|
|
1024
|
+
},
|
|
1025
|
+
get linkComponent() {
|
|
1026
|
+
return props.linkComponent;
|
|
982
1027
|
}
|
|
983
1028
|
});
|
|
984
1029
|
}
|
|
@@ -998,6 +1043,9 @@ function Block(props) {
|
|
|
998
1043
|
get context() {
|
|
999
1044
|
return props.context;
|
|
1000
1045
|
},
|
|
1046
|
+
get linkComponent() {
|
|
1047
|
+
return props.linkComponent;
|
|
1048
|
+
},
|
|
1001
1049
|
get children() {
|
|
1002
1050
|
return [createComponent(component_ref_default, {
|
|
1003
1051
|
get componentRef() {
|
|
@@ -1015,6 +1063,9 @@ function Block(props) {
|
|
|
1015
1063
|
get registeredComponents() {
|
|
1016
1064
|
return componentRefProps().registeredComponents;
|
|
1017
1065
|
},
|
|
1066
|
+
get linkComponent() {
|
|
1067
|
+
return componentRefProps().linkComponent;
|
|
1068
|
+
},
|
|
1018
1069
|
get builderBlock() {
|
|
1019
1070
|
return componentRefProps().builderBlock;
|
|
1020
1071
|
},
|
|
@@ -1040,6 +1091,9 @@ function Block(props) {
|
|
|
1040
1091
|
},
|
|
1041
1092
|
get registeredComponents() {
|
|
1042
1093
|
return props.registeredComponents;
|
|
1094
|
+
},
|
|
1095
|
+
get linkComponent() {
|
|
1096
|
+
return props.linkComponent;
|
|
1043
1097
|
}
|
|
1044
1098
|
});
|
|
1045
1099
|
}
|
|
@@ -1152,6 +1206,9 @@ function Blocks(props) {
|
|
|
1152
1206
|
return block.id;
|
|
1153
1207
|
},
|
|
1154
1208
|
block,
|
|
1209
|
+
get linkComponent() {
|
|
1210
|
+
return props.linkComponent;
|
|
1211
|
+
},
|
|
1155
1212
|
get context() {
|
|
1156
1213
|
return props.context || builderContext;
|
|
1157
1214
|
},
|
|
@@ -1169,7 +1226,7 @@ function Blocks(props) {
|
|
|
1169
1226
|
var blocks_default = Blocks;
|
|
1170
1227
|
|
|
1171
1228
|
// src/blocks/columns/columns.tsx
|
|
1172
|
-
var _tmpl$
|
|
1229
|
+
var _tmpl$2 = /* @__PURE__ */ template(`<div>`);
|
|
1173
1230
|
function Columns(props) {
|
|
1174
1231
|
const [gutterSize, setGutterSize] = createSignal(typeof props.space === "number" ? props.space || 0 : 20);
|
|
1175
1232
|
const [cols, setCols] = createSignal(props.columns || []);
|
|
@@ -1210,7 +1267,13 @@ function Columns(props) {
|
|
|
1210
1267
|
const mobileWidth = "100%";
|
|
1211
1268
|
const mobileMarginLeft = 0;
|
|
1212
1269
|
const marginLeftKey = "margin-left";
|
|
1270
|
+
const sharedStyles = {
|
|
1271
|
+
display: "flex",
|
|
1272
|
+
flexDirection: "column",
|
|
1273
|
+
alignItems: "stretch"
|
|
1274
|
+
};
|
|
1213
1275
|
return {
|
|
1276
|
+
...sharedStyles,
|
|
1214
1277
|
width,
|
|
1215
1278
|
[marginLeftKey]: gutterPixels,
|
|
1216
1279
|
"--column-width-mobile": getMobileStyle({
|
|
@@ -1263,7 +1326,7 @@ function Columns(props) {
|
|
|
1263
1326
|
`;
|
|
1264
1327
|
}
|
|
1265
1328
|
return (() => {
|
|
1266
|
-
const _el$ = _tmpl$
|
|
1329
|
+
const _el$ = _tmpl$2();
|
|
1267
1330
|
spread(_el$, mergeProps({
|
|
1268
1331
|
get ["class"]() {
|
|
1269
1332
|
return `builder-columns ${props.builderBlock.id}-breakpoints ` + css({
|
|
@@ -1291,52 +1354,56 @@ function Columns(props) {
|
|
|
1291
1354
|
},
|
|
1292
1355
|
children: (column, _index) => {
|
|
1293
1356
|
const index = _index();
|
|
1294
|
-
return (
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
}
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
}
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1357
|
+
return createComponent(dynamic_renderer_default, {
|
|
1358
|
+
key: index,
|
|
1359
|
+
get TagName() {
|
|
1360
|
+
return column.link ? props.builderLinkComponent || "a" : "div";
|
|
1361
|
+
},
|
|
1362
|
+
actionAttributes: {},
|
|
1363
|
+
get attributes() {
|
|
1364
|
+
return {
|
|
1365
|
+
...{},
|
|
1366
|
+
...column.link ? {
|
|
1367
|
+
href: column.link
|
|
1368
|
+
} : {},
|
|
1369
|
+
[getClassPropName()]: "builder-column",
|
|
1370
|
+
style: mapStyleObjToStrIfNeeded(columnCssVars(index))
|
|
1371
|
+
};
|
|
1372
|
+
},
|
|
1373
|
+
get children() {
|
|
1374
|
+
return createComponent(blocks_default, {
|
|
1375
|
+
path: `component.options.columns.${index}.blocks`,
|
|
1376
|
+
get parent() {
|
|
1377
|
+
return props.builderBlock.id;
|
|
1378
|
+
},
|
|
1379
|
+
styleProp: {
|
|
1380
|
+
flexGrow: "1"
|
|
1381
|
+
},
|
|
1382
|
+
get context() {
|
|
1383
|
+
return props.builderContext;
|
|
1384
|
+
},
|
|
1385
|
+
get registeredComponents() {
|
|
1386
|
+
return props.builderComponents;
|
|
1387
|
+
},
|
|
1388
|
+
get linkComponent() {
|
|
1389
|
+
return props.builderLinkComponent;
|
|
1390
|
+
},
|
|
1391
|
+
get blocks() {
|
|
1392
|
+
return column.blocks;
|
|
1393
|
+
}
|
|
1394
|
+
});
|
|
1395
|
+
}
|
|
1396
|
+
});
|
|
1330
1397
|
}
|
|
1331
1398
|
}), null);
|
|
1332
1399
|
return _el$;
|
|
1333
1400
|
})();
|
|
1334
1401
|
}
|
|
1335
1402
|
var columns_default = Columns;
|
|
1336
|
-
var _tmpl$
|
|
1403
|
+
var _tmpl$3 = /* @__PURE__ */ template(`<span>`);
|
|
1337
1404
|
function FragmentComponent(props) {
|
|
1338
1405
|
return (() => {
|
|
1339
|
-
const _el$ = _tmpl$
|
|
1406
|
+
const _el$ = _tmpl$3();
|
|
1340
1407
|
insert(_el$, () => props.children);
|
|
1341
1408
|
return _el$;
|
|
1342
1409
|
})();
|
|
@@ -1391,7 +1458,7 @@ function getSrcSet(url) {
|
|
|
1391
1458
|
}
|
|
1392
1459
|
|
|
1393
1460
|
// src/blocks/image/image.tsx
|
|
1394
|
-
var _tmpl$
|
|
1461
|
+
var _tmpl$4 = /* @__PURE__ */ template(`<source type=image/webp>`);
|
|
1395
1462
|
var _tmpl$22 = /* @__PURE__ */ template(`<picture><img loading=lazy>`);
|
|
1396
1463
|
var _tmpl$32 = /* @__PURE__ */ template(`<div>`);
|
|
1397
1464
|
function Image(props) {
|
|
@@ -1437,7 +1504,7 @@ function Image(props) {
|
|
|
1437
1504
|
return webpSrcSet();
|
|
1438
1505
|
},
|
|
1439
1506
|
get children() {
|
|
1440
|
-
const _el$2 = _tmpl$
|
|
1507
|
+
const _el$2 = _tmpl$4();
|
|
1441
1508
|
effect(() => setAttribute(_el$2, "srcset", webpSrcSet()));
|
|
1442
1509
|
return _el$2;
|
|
1443
1510
|
}
|
|
@@ -1519,10 +1586,10 @@ function Image(props) {
|
|
|
1519
1586
|
})];
|
|
1520
1587
|
}
|
|
1521
1588
|
var image_default = Image;
|
|
1522
|
-
var _tmpl$
|
|
1589
|
+
var _tmpl$5 = /* @__PURE__ */ template(`<section>`);
|
|
1523
1590
|
function SectionComponent(props) {
|
|
1524
1591
|
return (() => {
|
|
1525
|
-
const _el$ = _tmpl$
|
|
1592
|
+
const _el$ = _tmpl$5();
|
|
1526
1593
|
spread(_el$, mergeProps({}, () => props.attributes, {
|
|
1527
1594
|
get style() {
|
|
1528
1595
|
return {
|
|
@@ -2016,7 +2083,7 @@ var componentInfo3 = {
|
|
|
2016
2083
|
advanced: true
|
|
2017
2084
|
}]
|
|
2018
2085
|
};
|
|
2019
|
-
var _tmpl$
|
|
2086
|
+
var _tmpl$6 = /* @__PURE__ */ template(`<div>`);
|
|
2020
2087
|
function CustomCode(props) {
|
|
2021
2088
|
const [scriptsInserted, setScriptsInserted] = createSignal([]);
|
|
2022
2089
|
const [scriptsRun, setScriptsRun] = createSignal([]);
|
|
@@ -2050,7 +2117,7 @@ function CustomCode(props) {
|
|
|
2050
2117
|
}
|
|
2051
2118
|
});
|
|
2052
2119
|
return (() => {
|
|
2053
|
-
const _el$ = _tmpl$
|
|
2120
|
+
const _el$ = _tmpl$6();
|
|
2054
2121
|
const _ref$ = elementRef;
|
|
2055
2122
|
typeof _ref$ === "function" ? use(_ref$, _el$) : elementRef = _el$;
|
|
2056
2123
|
effect((_p$) => {
|
|
@@ -2110,7 +2177,7 @@ var SCRIPT_MIME_TYPES = ["text/javascript", "application/javascript", "applicati
|
|
|
2110
2177
|
var isJsScript = (script) => SCRIPT_MIME_TYPES.includes(script.type);
|
|
2111
2178
|
|
|
2112
2179
|
// src/blocks/embed/embed.tsx
|
|
2113
|
-
var _tmpl$
|
|
2180
|
+
var _tmpl$7 = /* @__PURE__ */ template(`<div class=builder-embed>`);
|
|
2114
2181
|
function Embed(props) {
|
|
2115
2182
|
const [scriptsInserted, setScriptsInserted] = createSignal([]);
|
|
2116
2183
|
const [scriptsRun, setScriptsRun] = createSignal([]);
|
|
@@ -2145,7 +2212,7 @@ function Embed(props) {
|
|
|
2145
2212
|
}
|
|
2146
2213
|
createEffect(on(() => [elem, ranInitFn()], onUpdateFn_0));
|
|
2147
2214
|
return (() => {
|
|
2148
|
-
const _el$ = _tmpl$
|
|
2215
|
+
const _el$ = _tmpl$7();
|
|
2149
2216
|
const _ref$ = elem;
|
|
2150
2217
|
typeof _ref$ === "function" ? use(_ref$, _el$) : elem = _el$;
|
|
2151
2218
|
effect(() => _el$.innerHTML = props.content);
|
|
@@ -2301,10 +2368,10 @@ var componentInfo7 = {
|
|
|
2301
2368
|
noWrap: true,
|
|
2302
2369
|
static: true
|
|
2303
2370
|
};
|
|
2304
|
-
var _tmpl$
|
|
2371
|
+
var _tmpl$8 = /* @__PURE__ */ template(`<img>`);
|
|
2305
2372
|
function ImgComponent(props) {
|
|
2306
2373
|
return (() => {
|
|
2307
|
-
const _el$ = _tmpl$
|
|
2374
|
+
const _el$ = _tmpl$8();
|
|
2308
2375
|
spread(_el$, mergeProps({
|
|
2309
2376
|
get style() {
|
|
2310
2377
|
return {
|
|
@@ -2384,10 +2451,10 @@ var componentInfo9 = {
|
|
|
2384
2451
|
defaultValue: "children"
|
|
2385
2452
|
}]
|
|
2386
2453
|
};
|
|
2387
|
-
var _tmpl$
|
|
2454
|
+
var _tmpl$9 = /* @__PURE__ */ template(`<div>`);
|
|
2388
2455
|
function Slot(props) {
|
|
2389
2456
|
return (() => {
|
|
2390
|
-
const _el$ = _tmpl$
|
|
2457
|
+
const _el$ = _tmpl$9();
|
|
2391
2458
|
_el$.style.setProperty("pointer-events", "auto");
|
|
2392
2459
|
spread(_el$, mergeProps(() => !props.builderContext.context?.symbolId && {
|
|
2393
2460
|
"builder-slot": props.name
|
|
@@ -2467,10 +2534,10 @@ var componentInfo11 = {
|
|
|
2467
2534
|
textAlign: "center"
|
|
2468
2535
|
}
|
|
2469
2536
|
};
|
|
2470
|
-
var _tmpl$
|
|
2537
|
+
var _tmpl$10 = /* @__PURE__ */ template(`<div class=builder-text>`);
|
|
2471
2538
|
function Text(props) {
|
|
2472
2539
|
return (() => {
|
|
2473
|
-
const _el$ = _tmpl$
|
|
2540
|
+
const _el$ = _tmpl$10();
|
|
2474
2541
|
_el$.style.setProperty("outline", "none");
|
|
2475
2542
|
effect(() => _el$.innerHTML = props.text?.toString() || "");
|
|
2476
2543
|
return _el$;
|
|
@@ -2561,7 +2628,7 @@ var componentInfo12 = {
|
|
|
2561
2628
|
advanced: true
|
|
2562
2629
|
}]
|
|
2563
2630
|
};
|
|
2564
|
-
var _tmpl$
|
|
2631
|
+
var _tmpl$11 = /* @__PURE__ */ template(`<source type=video/mp4>`);
|
|
2565
2632
|
var _tmpl$23 = /* @__PURE__ */ template(`<div>`);
|
|
2566
2633
|
var _tmpl$33 = /* @__PURE__ */ template(`<div><video class=builder-video>`);
|
|
2567
2634
|
function Video(props) {
|
|
@@ -2624,7 +2691,7 @@ function Video(props) {
|
|
|
2624
2691
|
return !props.lazyLoad;
|
|
2625
2692
|
},
|
|
2626
2693
|
get children() {
|
|
2627
|
-
const _el$3 = _tmpl$
|
|
2694
|
+
const _el$3 = _tmpl$11();
|
|
2628
2695
|
effect(() => setAttribute(_el$3, "src", props.video));
|
|
2629
2696
|
return _el$3;
|
|
2630
2697
|
}
|
|
@@ -2786,10 +2853,10 @@ var getUpdateVariantVisibilityScript = ({
|
|
|
2786
2853
|
}) => `window.${UPDATE_VARIANT_VISIBILITY_SCRIPT_FN_NAME}(
|
|
2787
2854
|
"${variationId}", "${contentId}", ${isHydrationTarget}
|
|
2788
2855
|
)`;
|
|
2789
|
-
var _tmpl$
|
|
2856
|
+
var _tmpl$12 = /* @__PURE__ */ template(`<script>`);
|
|
2790
2857
|
function InlinedScript(props) {
|
|
2791
2858
|
return (() => {
|
|
2792
|
-
const _el$ = _tmpl$
|
|
2859
|
+
const _el$ = _tmpl$12();
|
|
2793
2860
|
effect((_p$) => {
|
|
2794
2861
|
const _v$ = props.scriptStr, _v$2 = props.id || "";
|
|
2795
2862
|
_v$ !== _p$._v$ && (_el$.innerHTML = _p$._v$ = _v$);
|
|
@@ -3291,7 +3358,7 @@ var getInteractionPropertiesForEvent = (event) => {
|
|
|
3291
3358
|
};
|
|
3292
3359
|
|
|
3293
3360
|
// src/constants/sdk-version.ts
|
|
3294
|
-
var SDK_VERSION = "0.12.
|
|
3361
|
+
var SDK_VERSION = "0.12.4";
|
|
3295
3362
|
|
|
3296
3363
|
// src/functions/register.ts
|
|
3297
3364
|
var registry = {};
|
|
@@ -3978,6 +4045,9 @@ function ContentComponent(props) {
|
|
|
3978
4045
|
get contentWrapperProps() {
|
|
3979
4046
|
return props.contentWrapperProps;
|
|
3980
4047
|
},
|
|
4048
|
+
get linkComponent() {
|
|
4049
|
+
return props.linkComponent;
|
|
4050
|
+
},
|
|
3981
4051
|
get trustedHosts() {
|
|
3982
4052
|
return props.trustedHosts;
|
|
3983
4053
|
}
|
|
@@ -4020,6 +4090,9 @@ function ContentComponent(props) {
|
|
|
4020
4090
|
},
|
|
4021
4091
|
get registeredComponents() {
|
|
4022
4092
|
return registeredComponents();
|
|
4093
|
+
},
|
|
4094
|
+
get linkComponent() {
|
|
4095
|
+
return props.linkComponent;
|
|
4023
4096
|
}
|
|
4024
4097
|
})];
|
|
4025
4098
|
}
|
|
@@ -4113,6 +4186,9 @@ function ContentVariants(props) {
|
|
|
4113
4186
|
get customComponents() {
|
|
4114
4187
|
return props.customComponents;
|
|
4115
4188
|
},
|
|
4189
|
+
get linkComponent() {
|
|
4190
|
+
return props.linkComponent;
|
|
4191
|
+
},
|
|
4116
4192
|
get canTrack() {
|
|
4117
4193
|
return props.canTrack;
|
|
4118
4194
|
},
|
|
@@ -4170,6 +4246,9 @@ function ContentVariants(props) {
|
|
|
4170
4246
|
get customComponents() {
|
|
4171
4247
|
return props.customComponents;
|
|
4172
4248
|
},
|
|
4249
|
+
get linkComponent() {
|
|
4250
|
+
return props.linkComponent;
|
|
4251
|
+
},
|
|
4173
4252
|
get canTrack() {
|
|
4174
4253
|
return props.canTrack;
|
|
4175
4254
|
},
|
|
@@ -4229,11 +4308,11 @@ var fetchSymbolContent = async ({
|
|
|
4229
4308
|
};
|
|
4230
4309
|
|
|
4231
4310
|
// src/blocks/symbol/symbol.tsx
|
|
4232
|
-
var _tmpl$
|
|
4311
|
+
var _tmpl$13 = /* @__PURE__ */ template(`<div>`);
|
|
4233
4312
|
function Symbol(props) {
|
|
4234
4313
|
const [contentToUse, setContentToUse] = createSignal(props.symbol?.content);
|
|
4235
4314
|
function className() {
|
|
4236
|
-
return [...[props.attributes
|
|
4315
|
+
return [...[props.attributes[getClassPropName()]], "builder-symbol", props.symbol?.inline ? "builder-inline-symbol" : void 0, props.symbol?.dynamic || props.dynamic ? "builder-dynamic-symbol" : void 0].filter(Boolean).join(" ");
|
|
4237
4316
|
}
|
|
4238
4317
|
function setContent() {
|
|
4239
4318
|
if (contentToUse())
|
|
@@ -4255,7 +4334,7 @@ function Symbol(props) {
|
|
|
4255
4334
|
}
|
|
4256
4335
|
createEffect(on(() => [props.symbol], onUpdateFn_0));
|
|
4257
4336
|
return (() => {
|
|
4258
|
-
const _el$ = _tmpl$
|
|
4337
|
+
const _el$ = _tmpl$13();
|
|
4259
4338
|
spread(_el$, mergeProps({
|
|
4260
4339
|
get ["class"]() {
|
|
4261
4340
|
return className();
|
|
@@ -4290,6 +4369,9 @@ function Symbol(props) {
|
|
|
4290
4369
|
},
|
|
4291
4370
|
get content() {
|
|
4292
4371
|
return contentToUse();
|
|
4372
|
+
},
|
|
4373
|
+
get linkComponent() {
|
|
4374
|
+
return props.builderLinkComponent;
|
|
4293
4375
|
}
|
|
4294
4376
|
}));
|
|
4295
4377
|
return _el$;
|