@builder.io/sdk-solid 0.12.2 → 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 +250 -166
- package/lib/browser/dev.jsx +199 -130
- package/lib/browser/index.js +250 -166
- package/lib/browser/index.jsx +199 -130
- package/lib/edge/dev.js +250 -166
- package/lib/edge/dev.jsx +199 -130
- package/lib/edge/index.js +250 -166
- package/lib/edge/index.jsx +199 -130
- package/lib/node/dev.js +250 -166
- package/lib/node/dev.jsx +199 -130
- package/lib/node/index.js +250 -166
- package/lib/node/index.jsx +199 -130
- package/package.json +1 -1
package/lib/node/index.js
CHANGED
|
@@ -1,47 +1,100 @@
|
|
|
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
|
import { createRequire } from 'node:module';
|
|
5
5
|
|
|
6
6
|
// src/blocks/button/button.tsx
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
|
|
8
|
+
// src/components/dynamic-renderer/dynamic-renderer.helpers.ts
|
|
9
|
+
var EMPTY_HTML_ELEMENTS = /* @__PURE__ */ new Set(["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen", "link", "meta", "param", "source", "track", "wbr"]);
|
|
10
|
+
var isEmptyElement = (tagName) => {
|
|
11
|
+
return typeof tagName === "string" && EMPTY_HTML_ELEMENTS.has(tagName.toLowerCase());
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
// src/components/dynamic-renderer/dynamic-renderer.tsx
|
|
15
|
+
function DynamicRenderer(props) {
|
|
10
16
|
return createComponent(Show, {
|
|
11
17
|
get fallback() {
|
|
12
|
-
return (() => {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
all: "unset"
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
}, {}, () => props.attributes, {
|
|
21
|
-
get style() {
|
|
22
|
-
return props.attributes.style;
|
|
23
|
-
}
|
|
24
|
-
}), false, true);
|
|
25
|
-
insert(_el$2, () => props.text);
|
|
26
|
-
return _el$2;
|
|
27
|
-
})();
|
|
18
|
+
return createComponent(Dynamic, mergeProps(() => props.attributes, () => props.actionAttributes, {
|
|
19
|
+
get component() {
|
|
20
|
+
return props.TagName;
|
|
21
|
+
}
|
|
22
|
+
}));
|
|
28
23
|
},
|
|
29
24
|
get when() {
|
|
30
|
-
return props.
|
|
25
|
+
return !isEmptyElement(props.TagName);
|
|
31
26
|
},
|
|
32
27
|
get children() {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
28
|
+
return createComponent(Show, {
|
|
29
|
+
get fallback() {
|
|
30
|
+
return createComponent(Dynamic, mergeProps(() => props.attributes, () => props.actionAttributes, {
|
|
31
|
+
get component() {
|
|
32
|
+
return props.TagName;
|
|
33
|
+
},
|
|
34
|
+
get children() {
|
|
35
|
+
return props.children;
|
|
36
|
+
}
|
|
37
|
+
}));
|
|
37
38
|
},
|
|
38
|
-
get
|
|
39
|
-
return props.
|
|
39
|
+
get when() {
|
|
40
|
+
return typeof props.TagName === "string";
|
|
40
41
|
},
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
42
|
+
get children() {
|
|
43
|
+
return createComponent(Dynamic, mergeProps(() => props.attributes, () => props.actionAttributes, {
|
|
44
|
+
get component() {
|
|
45
|
+
return props.TagName;
|
|
46
|
+
},
|
|
47
|
+
get children() {
|
|
48
|
+
return props.children;
|
|
49
|
+
}
|
|
50
|
+
}));
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
var dynamic_renderer_default = DynamicRenderer;
|
|
57
|
+
|
|
58
|
+
// src/constants/target.ts
|
|
59
|
+
var TARGET = "solid";
|
|
60
|
+
|
|
61
|
+
// src/functions/get-class-prop-name.ts
|
|
62
|
+
var getClassPropName = () => {
|
|
63
|
+
switch (TARGET) {
|
|
64
|
+
case "react":
|
|
65
|
+
case "reactNative":
|
|
66
|
+
case "rsc":
|
|
67
|
+
return "className";
|
|
68
|
+
case "svelte":
|
|
69
|
+
case "vue":
|
|
70
|
+
case "solid":
|
|
71
|
+
case "qwik":
|
|
72
|
+
return "class";
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
// src/blocks/button/button.tsx
|
|
77
|
+
function Button(props) {
|
|
78
|
+
return createComponent(dynamic_renderer_default, {
|
|
79
|
+
get TagName() {
|
|
80
|
+
return props.link ? props.builderLinkComponent || "a" : "button";
|
|
81
|
+
},
|
|
82
|
+
get attributes() {
|
|
83
|
+
return {
|
|
84
|
+
...props.attributes,
|
|
85
|
+
[getClassPropName()]: `${props.link ? "" : "builder-button"} ${props.attributes[getClassPropName()] || ""}`,
|
|
86
|
+
...props.link ? {
|
|
87
|
+
href: props.link,
|
|
88
|
+
target: props.openLinkInNewTab ? "_blank" : void 0,
|
|
89
|
+
role: "link"
|
|
90
|
+
} : {
|
|
91
|
+
role: "button"
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
},
|
|
95
|
+
actionAttributes: {},
|
|
96
|
+
get children() {
|
|
97
|
+
return props.text;
|
|
45
98
|
}
|
|
46
99
|
});
|
|
47
100
|
}
|
|
@@ -87,9 +140,6 @@ function isBrowser() {
|
|
|
87
140
|
return typeof window !== "undefined" && typeof document !== "undefined";
|
|
88
141
|
}
|
|
89
142
|
|
|
90
|
-
// src/constants/target.ts
|
|
91
|
-
var TARGET = "solid";
|
|
92
|
-
|
|
93
143
|
// src/functions/is-iframe.ts
|
|
94
144
|
function isIframe() {
|
|
95
145
|
return isBrowser() && window.self !== window.top;
|
|
@@ -599,10 +649,10 @@ var createCssClass = ({
|
|
|
599
649
|
return cssClass;
|
|
600
650
|
}
|
|
601
651
|
};
|
|
602
|
-
var _tmpl$
|
|
652
|
+
var _tmpl$ = /* @__PURE__ */ template(`<style>`);
|
|
603
653
|
function InlinedStyles(props) {
|
|
604
654
|
return (() => {
|
|
605
|
-
const _el$ = _tmpl$
|
|
655
|
+
const _el$ = _tmpl$();
|
|
606
656
|
effect((_p$) => {
|
|
607
657
|
const _v$ = props.styles, _v$2 = props.id;
|
|
608
658
|
_v$ !== _p$._v$ && (_el$.innerHTML = _p$._v$ = _v$);
|
|
@@ -636,7 +686,7 @@ function BlockStyles(props) {
|
|
|
636
686
|
}
|
|
637
687
|
return true;
|
|
638
688
|
}
|
|
639
|
-
function
|
|
689
|
+
function css4() {
|
|
640
690
|
const processedBlock = getProcessedBlock({
|
|
641
691
|
block: props.block,
|
|
642
692
|
localState: props.context.localState,
|
|
@@ -673,12 +723,12 @@ function BlockStyles(props) {
|
|
|
673
723
|
}
|
|
674
724
|
return createComponent(Show, {
|
|
675
725
|
get when() {
|
|
676
|
-
return memo(() => !!(TARGET !== "reactNative" &&
|
|
726
|
+
return memo(() => !!(TARGET !== "reactNative" && css4()))() && canShowBlock();
|
|
677
727
|
},
|
|
678
728
|
get children() {
|
|
679
729
|
return createComponent(inlined_styles_default, {
|
|
680
730
|
get styles() {
|
|
681
|
-
return
|
|
731
|
+
return css4();
|
|
682
732
|
}
|
|
683
733
|
});
|
|
684
734
|
}
|
|
@@ -728,6 +778,38 @@ function getBlockActions(options) {
|
|
|
728
778
|
return obj;
|
|
729
779
|
}
|
|
730
780
|
|
|
781
|
+
// src/functions/transform-style-property.ts
|
|
782
|
+
function transformStyleProperty({
|
|
783
|
+
style
|
|
784
|
+
}) {
|
|
785
|
+
return style;
|
|
786
|
+
}
|
|
787
|
+
|
|
788
|
+
// src/functions/get-style.ts
|
|
789
|
+
var getStyle = ({
|
|
790
|
+
block,
|
|
791
|
+
context
|
|
792
|
+
}) => {
|
|
793
|
+
return mapStyleObjToStrIfNeeded(transformStyleProperty({
|
|
794
|
+
style: block.style || {},
|
|
795
|
+
context,
|
|
796
|
+
block
|
|
797
|
+
}));
|
|
798
|
+
};
|
|
799
|
+
function mapStyleObjToStrIfNeeded(style) {
|
|
800
|
+
switch (TARGET) {
|
|
801
|
+
case "svelte":
|
|
802
|
+
case "vue":
|
|
803
|
+
case "solid":
|
|
804
|
+
return convertStyleMapToCSSArray(style).join(" ");
|
|
805
|
+
case "qwik":
|
|
806
|
+
case "reactNative":
|
|
807
|
+
case "react":
|
|
808
|
+
case "rsc":
|
|
809
|
+
return style;
|
|
810
|
+
}
|
|
811
|
+
}
|
|
812
|
+
|
|
731
813
|
// src/functions/transform-block-properties.ts
|
|
732
814
|
function transformBlockProperties({
|
|
733
815
|
properties
|
|
@@ -749,8 +831,11 @@ function getBlockProperties({
|
|
|
749
831
|
...extractRelevantRootBlockProperties(block),
|
|
750
832
|
...block.properties,
|
|
751
833
|
"builder-id": block.id,
|
|
752
|
-
style:
|
|
753
|
-
|
|
834
|
+
style: getStyle({
|
|
835
|
+
block,
|
|
836
|
+
context
|
|
837
|
+
}),
|
|
838
|
+
[getClassPropName()]: [block.id, "builder-block", block.class, block.properties?.class].filter(Boolean).join(" ")
|
|
754
839
|
};
|
|
755
840
|
return transformBlockProperties({
|
|
756
841
|
properties,
|
|
@@ -758,69 +843,6 @@ function getBlockProperties({
|
|
|
758
843
|
block
|
|
759
844
|
});
|
|
760
845
|
}
|
|
761
|
-
function getStyleAttribute(style) {
|
|
762
|
-
switch (TARGET) {
|
|
763
|
-
case "svelte":
|
|
764
|
-
case "vue":
|
|
765
|
-
case "solid":
|
|
766
|
-
return convertStyleMapToCSSArray(style).join(" ");
|
|
767
|
-
case "qwik":
|
|
768
|
-
case "reactNative":
|
|
769
|
-
case "react":
|
|
770
|
-
case "rsc":
|
|
771
|
-
return style;
|
|
772
|
-
}
|
|
773
|
-
}
|
|
774
|
-
|
|
775
|
-
// src/components/dynamic-renderer/dynamic-renderer.helpers.ts
|
|
776
|
-
var EMPTY_HTML_ELEMENTS = /* @__PURE__ */ new Set(["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen", "link", "meta", "param", "source", "track", "wbr"]);
|
|
777
|
-
var isEmptyElement = (tagName) => {
|
|
778
|
-
return typeof tagName === "string" && EMPTY_HTML_ELEMENTS.has(tagName.toLowerCase());
|
|
779
|
-
};
|
|
780
|
-
|
|
781
|
-
// src/components/dynamic-renderer/dynamic-renderer.tsx
|
|
782
|
-
function DynamicRenderer(props) {
|
|
783
|
-
return createComponent(Show, {
|
|
784
|
-
get fallback() {
|
|
785
|
-
return createComponent(Dynamic, mergeProps(() => props.attributes, () => props.actionAttributes, {
|
|
786
|
-
get component() {
|
|
787
|
-
return props.TagName;
|
|
788
|
-
}
|
|
789
|
-
}));
|
|
790
|
-
},
|
|
791
|
-
get when() {
|
|
792
|
-
return !isEmptyElement(props.TagName);
|
|
793
|
-
},
|
|
794
|
-
get children() {
|
|
795
|
-
return createComponent(Show, {
|
|
796
|
-
get fallback() {
|
|
797
|
-
return createComponent(Dynamic, mergeProps(() => props.attributes, () => props.actionAttributes, {
|
|
798
|
-
get component() {
|
|
799
|
-
return props.TagName;
|
|
800
|
-
},
|
|
801
|
-
get children() {
|
|
802
|
-
return props.children;
|
|
803
|
-
}
|
|
804
|
-
}));
|
|
805
|
-
},
|
|
806
|
-
get when() {
|
|
807
|
-
return typeof props.TagName === "string";
|
|
808
|
-
},
|
|
809
|
-
get children() {
|
|
810
|
-
return createComponent(Dynamic, mergeProps(() => props.attributes, () => props.actionAttributes, {
|
|
811
|
-
get component() {
|
|
812
|
-
return props.TagName;
|
|
813
|
-
},
|
|
814
|
-
get children() {
|
|
815
|
-
return props.children;
|
|
816
|
-
}
|
|
817
|
-
}));
|
|
818
|
-
}
|
|
819
|
-
});
|
|
820
|
-
}
|
|
821
|
-
});
|
|
822
|
-
}
|
|
823
|
-
var dynamic_renderer_default = DynamicRenderer;
|
|
824
846
|
|
|
825
847
|
// src/components/block/components/block-wrapper.tsx
|
|
826
848
|
function BlockWrapper(props) {
|
|
@@ -923,6 +945,7 @@ function ComponentRef(props) {
|
|
|
923
945
|
builderBlock: props.builderBlock,
|
|
924
946
|
context: props.context,
|
|
925
947
|
componentRef: props.componentRef,
|
|
948
|
+
linkComponent: props.linkComponent,
|
|
926
949
|
includeBlockProps: props.includeBlockProps,
|
|
927
950
|
isInteractive: props.isInteractive,
|
|
928
951
|
contextValue: props.context
|
|
@@ -947,6 +970,9 @@ function ComponentRef(props) {
|
|
|
947
970
|
},
|
|
948
971
|
get registeredComponents() {
|
|
949
972
|
return props.registeredComponents;
|
|
973
|
+
},
|
|
974
|
+
get linkComponent() {
|
|
975
|
+
return props.linkComponent;
|
|
950
976
|
}
|
|
951
977
|
});
|
|
952
978
|
}
|
|
@@ -973,6 +999,9 @@ function RepeatedBlock(props) {
|
|
|
973
999
|
},
|
|
974
1000
|
get registeredComponents() {
|
|
975
1001
|
return props.registeredComponents;
|
|
1002
|
+
},
|
|
1003
|
+
get linkComponent() {
|
|
1004
|
+
return props.linkComponent;
|
|
976
1005
|
}
|
|
977
1006
|
});
|
|
978
1007
|
}
|
|
@@ -1007,6 +1036,10 @@ function Block(props) {
|
|
|
1007
1036
|
});
|
|
1008
1037
|
}
|
|
1009
1038
|
function Tag() {
|
|
1039
|
+
const shouldUseLink = props.block.tagName === "a" || processedBlock().properties?.href || processedBlock().href;
|
|
1040
|
+
if (shouldUseLink) {
|
|
1041
|
+
return props.linkComponent || "a";
|
|
1042
|
+
}
|
|
1010
1043
|
return props.block.tagName || "div";
|
|
1011
1044
|
}
|
|
1012
1045
|
function canShowBlock() {
|
|
@@ -1030,11 +1063,15 @@ function Block(props) {
|
|
|
1030
1063
|
componentOptions: {
|
|
1031
1064
|
...getBlockComponentOptions(processedBlock()),
|
|
1032
1065
|
builderContext: props.context,
|
|
1066
|
+
...blockComponent()?.name === "Core:Button" || blockComponent()?.name === "Symbol" || blockComponent()?.name === "Columns" ? {
|
|
1067
|
+
builderLinkComponent: props.linkComponent
|
|
1068
|
+
} : {},
|
|
1033
1069
|
...blockComponent()?.name === "Symbol" || blockComponent()?.name === "Columns" ? {
|
|
1034
1070
|
builderComponents: props.registeredComponents
|
|
1035
1071
|
} : {}
|
|
1036
1072
|
},
|
|
1037
1073
|
context: childrenContext(),
|
|
1074
|
+
linkComponent: props.linkComponent,
|
|
1038
1075
|
registeredComponents: props.registeredComponents,
|
|
1039
1076
|
builderBlock: processedBlock(),
|
|
1040
1077
|
includeBlockProps: blockComponent()?.noWrap === true,
|
|
@@ -1071,6 +1108,9 @@ function Block(props) {
|
|
|
1071
1108
|
get registeredComponents() {
|
|
1072
1109
|
return componentRefProps().registeredComponents;
|
|
1073
1110
|
},
|
|
1111
|
+
get linkComponent() {
|
|
1112
|
+
return componentRefProps().linkComponent;
|
|
1113
|
+
},
|
|
1074
1114
|
get builderBlock() {
|
|
1075
1115
|
return componentRefProps().builderBlock;
|
|
1076
1116
|
},
|
|
@@ -1104,6 +1144,9 @@ function Block(props) {
|
|
|
1104
1144
|
},
|
|
1105
1145
|
get registeredComponents() {
|
|
1106
1146
|
return props.registeredComponents;
|
|
1147
|
+
},
|
|
1148
|
+
get linkComponent() {
|
|
1149
|
+
return props.linkComponent;
|
|
1107
1150
|
}
|
|
1108
1151
|
});
|
|
1109
1152
|
}
|
|
@@ -1123,6 +1166,9 @@ function Block(props) {
|
|
|
1123
1166
|
get context() {
|
|
1124
1167
|
return props.context;
|
|
1125
1168
|
},
|
|
1169
|
+
get linkComponent() {
|
|
1170
|
+
return props.linkComponent;
|
|
1171
|
+
},
|
|
1126
1172
|
get children() {
|
|
1127
1173
|
return [createComponent(component_ref_default, {
|
|
1128
1174
|
get componentRef() {
|
|
@@ -1140,6 +1186,9 @@ function Block(props) {
|
|
|
1140
1186
|
get registeredComponents() {
|
|
1141
1187
|
return componentRefProps().registeredComponents;
|
|
1142
1188
|
},
|
|
1189
|
+
get linkComponent() {
|
|
1190
|
+
return componentRefProps().linkComponent;
|
|
1191
|
+
},
|
|
1143
1192
|
get builderBlock() {
|
|
1144
1193
|
return componentRefProps().builderBlock;
|
|
1145
1194
|
},
|
|
@@ -1165,6 +1214,9 @@ function Block(props) {
|
|
|
1165
1214
|
},
|
|
1166
1215
|
get registeredComponents() {
|
|
1167
1216
|
return props.registeredComponents;
|
|
1217
|
+
},
|
|
1218
|
+
get linkComponent() {
|
|
1219
|
+
return props.linkComponent;
|
|
1168
1220
|
}
|
|
1169
1221
|
});
|
|
1170
1222
|
}
|
|
@@ -1277,6 +1329,9 @@ function Blocks(props) {
|
|
|
1277
1329
|
return block.id;
|
|
1278
1330
|
},
|
|
1279
1331
|
block,
|
|
1332
|
+
get linkComponent() {
|
|
1333
|
+
return props.linkComponent;
|
|
1334
|
+
},
|
|
1280
1335
|
get context() {
|
|
1281
1336
|
return props.context || builderContext;
|
|
1282
1337
|
},
|
|
@@ -1294,7 +1349,7 @@ function Blocks(props) {
|
|
|
1294
1349
|
var blocks_default = Blocks;
|
|
1295
1350
|
|
|
1296
1351
|
// src/blocks/columns/columns.tsx
|
|
1297
|
-
var _tmpl$
|
|
1352
|
+
var _tmpl$2 = /* @__PURE__ */ template(`<div>`);
|
|
1298
1353
|
function Columns(props) {
|
|
1299
1354
|
const [gutterSize, setGutterSize] = createSignal(typeof props.space === "number" ? props.space || 0 : 20);
|
|
1300
1355
|
const [cols, setCols] = createSignal(props.columns || []);
|
|
@@ -1335,7 +1390,13 @@ function Columns(props) {
|
|
|
1335
1390
|
const mobileWidth = "100%";
|
|
1336
1391
|
const mobileMarginLeft = 0;
|
|
1337
1392
|
const marginLeftKey = "margin-left";
|
|
1393
|
+
const sharedStyles = {
|
|
1394
|
+
display: "flex",
|
|
1395
|
+
flexDirection: "column",
|
|
1396
|
+
alignItems: "stretch"
|
|
1397
|
+
};
|
|
1338
1398
|
return {
|
|
1399
|
+
...sharedStyles,
|
|
1339
1400
|
width,
|
|
1340
1401
|
[marginLeftKey]: gutterPixels,
|
|
1341
1402
|
"--column-width-mobile": getMobileStyle({
|
|
@@ -1388,7 +1449,7 @@ function Columns(props) {
|
|
|
1388
1449
|
`;
|
|
1389
1450
|
}
|
|
1390
1451
|
return (() => {
|
|
1391
|
-
const _el$ = _tmpl$
|
|
1452
|
+
const _el$ = _tmpl$2();
|
|
1392
1453
|
spread(_el$, mergeProps({
|
|
1393
1454
|
get ["class"]() {
|
|
1394
1455
|
return `builder-columns ${props.builderBlock.id}-breakpoints ` + css({
|
|
@@ -1416,52 +1477,56 @@ function Columns(props) {
|
|
|
1416
1477
|
},
|
|
1417
1478
|
children: (column, _index) => {
|
|
1418
1479
|
const index = _index();
|
|
1419
|
-
return (
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
}
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
}
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1480
|
+
return createComponent(dynamic_renderer_default, {
|
|
1481
|
+
key: index,
|
|
1482
|
+
get TagName() {
|
|
1483
|
+
return column.link ? props.builderLinkComponent || "a" : "div";
|
|
1484
|
+
},
|
|
1485
|
+
actionAttributes: {},
|
|
1486
|
+
get attributes() {
|
|
1487
|
+
return {
|
|
1488
|
+
...{},
|
|
1489
|
+
...column.link ? {
|
|
1490
|
+
href: column.link
|
|
1491
|
+
} : {},
|
|
1492
|
+
[getClassPropName()]: "builder-column",
|
|
1493
|
+
style: mapStyleObjToStrIfNeeded(columnCssVars(index))
|
|
1494
|
+
};
|
|
1495
|
+
},
|
|
1496
|
+
get children() {
|
|
1497
|
+
return createComponent(blocks_default, {
|
|
1498
|
+
path: `component.options.columns.${index}.blocks`,
|
|
1499
|
+
get parent() {
|
|
1500
|
+
return props.builderBlock.id;
|
|
1501
|
+
},
|
|
1502
|
+
styleProp: {
|
|
1503
|
+
flexGrow: "1"
|
|
1504
|
+
},
|
|
1505
|
+
get context() {
|
|
1506
|
+
return props.builderContext;
|
|
1507
|
+
},
|
|
1508
|
+
get registeredComponents() {
|
|
1509
|
+
return props.builderComponents;
|
|
1510
|
+
},
|
|
1511
|
+
get linkComponent() {
|
|
1512
|
+
return props.builderLinkComponent;
|
|
1513
|
+
},
|
|
1514
|
+
get blocks() {
|
|
1515
|
+
return column.blocks;
|
|
1516
|
+
}
|
|
1517
|
+
});
|
|
1518
|
+
}
|
|
1519
|
+
});
|
|
1455
1520
|
}
|
|
1456
1521
|
}), null);
|
|
1457
1522
|
return _el$;
|
|
1458
1523
|
})();
|
|
1459
1524
|
}
|
|
1460
1525
|
var columns_default = Columns;
|
|
1461
|
-
var _tmpl$
|
|
1526
|
+
var _tmpl$3 = /* @__PURE__ */ template(`<span>`);
|
|
1462
1527
|
function FragmentComponent(props) {
|
|
1463
1528
|
return (() => {
|
|
1464
|
-
const _el$ = _tmpl$
|
|
1529
|
+
const _el$ = _tmpl$3();
|
|
1465
1530
|
insert(_el$, () => props.children);
|
|
1466
1531
|
return _el$;
|
|
1467
1532
|
})();
|
|
@@ -1516,7 +1581,7 @@ function getSrcSet(url) {
|
|
|
1516
1581
|
}
|
|
1517
1582
|
|
|
1518
1583
|
// src/blocks/image/image.tsx
|
|
1519
|
-
var _tmpl$
|
|
1584
|
+
var _tmpl$4 = /* @__PURE__ */ template(`<source type=image/webp>`);
|
|
1520
1585
|
var _tmpl$22 = /* @__PURE__ */ template(`<picture><img loading=lazy>`);
|
|
1521
1586
|
var _tmpl$32 = /* @__PURE__ */ template(`<div>`);
|
|
1522
1587
|
function Image(props) {
|
|
@@ -1562,7 +1627,7 @@ function Image(props) {
|
|
|
1562
1627
|
return webpSrcSet();
|
|
1563
1628
|
},
|
|
1564
1629
|
get children() {
|
|
1565
|
-
const _el$2 = _tmpl$
|
|
1630
|
+
const _el$2 = _tmpl$4();
|
|
1566
1631
|
effect(() => setAttribute(_el$2, "srcset", webpSrcSet()));
|
|
1567
1632
|
return _el$2;
|
|
1568
1633
|
}
|
|
@@ -1644,10 +1709,10 @@ function Image(props) {
|
|
|
1644
1709
|
})];
|
|
1645
1710
|
}
|
|
1646
1711
|
var image_default = Image;
|
|
1647
|
-
var _tmpl$
|
|
1712
|
+
var _tmpl$5 = /* @__PURE__ */ template(`<section>`);
|
|
1648
1713
|
function SectionComponent(props) {
|
|
1649
1714
|
return (() => {
|
|
1650
|
-
const _el$ = _tmpl$
|
|
1715
|
+
const _el$ = _tmpl$5();
|
|
1651
1716
|
spread(_el$, mergeProps({}, () => props.attributes, {
|
|
1652
1717
|
get style() {
|
|
1653
1718
|
return {
|
|
@@ -2141,7 +2206,7 @@ var componentInfo3 = {
|
|
|
2141
2206
|
advanced: true
|
|
2142
2207
|
}]
|
|
2143
2208
|
};
|
|
2144
|
-
var _tmpl$
|
|
2209
|
+
var _tmpl$6 = /* @__PURE__ */ template(`<div>`);
|
|
2145
2210
|
function CustomCode(props) {
|
|
2146
2211
|
const [scriptsInserted, setScriptsInserted] = createSignal([]);
|
|
2147
2212
|
const [scriptsRun, setScriptsRun] = createSignal([]);
|
|
@@ -2175,7 +2240,7 @@ function CustomCode(props) {
|
|
|
2175
2240
|
}
|
|
2176
2241
|
});
|
|
2177
2242
|
return (() => {
|
|
2178
|
-
const _el$ = _tmpl$
|
|
2243
|
+
const _el$ = _tmpl$6();
|
|
2179
2244
|
const _ref$ = elementRef;
|
|
2180
2245
|
typeof _ref$ === "function" ? use(_ref$, _el$) : elementRef = _el$;
|
|
2181
2246
|
effect((_p$) => {
|
|
@@ -2235,7 +2300,7 @@ var SCRIPT_MIME_TYPES = ["text/javascript", "application/javascript", "applicati
|
|
|
2235
2300
|
var isJsScript = (script) => SCRIPT_MIME_TYPES.includes(script.type);
|
|
2236
2301
|
|
|
2237
2302
|
// src/blocks/embed/embed.tsx
|
|
2238
|
-
var _tmpl$
|
|
2303
|
+
var _tmpl$7 = /* @__PURE__ */ template(`<div class=builder-embed>`);
|
|
2239
2304
|
function Embed(props) {
|
|
2240
2305
|
const [scriptsInserted, setScriptsInserted] = createSignal([]);
|
|
2241
2306
|
const [scriptsRun, setScriptsRun] = createSignal([]);
|
|
@@ -2270,7 +2335,7 @@ function Embed(props) {
|
|
|
2270
2335
|
}
|
|
2271
2336
|
createEffect(on(() => [elem, ranInitFn()], onUpdateFn_0));
|
|
2272
2337
|
return (() => {
|
|
2273
|
-
const _el$ = _tmpl$
|
|
2338
|
+
const _el$ = _tmpl$7();
|
|
2274
2339
|
const _ref$ = elem;
|
|
2275
2340
|
typeof _ref$ === "function" ? use(_ref$, _el$) : elem = _el$;
|
|
2276
2341
|
effect(() => _el$.innerHTML = props.content);
|
|
@@ -2426,10 +2491,10 @@ var componentInfo7 = {
|
|
|
2426
2491
|
noWrap: true,
|
|
2427
2492
|
static: true
|
|
2428
2493
|
};
|
|
2429
|
-
var _tmpl$
|
|
2494
|
+
var _tmpl$8 = /* @__PURE__ */ template(`<img>`);
|
|
2430
2495
|
function ImgComponent(props) {
|
|
2431
2496
|
return (() => {
|
|
2432
|
-
const _el$ = _tmpl$
|
|
2497
|
+
const _el$ = _tmpl$8();
|
|
2433
2498
|
spread(_el$, mergeProps({
|
|
2434
2499
|
get style() {
|
|
2435
2500
|
return {
|
|
@@ -2509,10 +2574,10 @@ var componentInfo9 = {
|
|
|
2509
2574
|
defaultValue: "children"
|
|
2510
2575
|
}]
|
|
2511
2576
|
};
|
|
2512
|
-
var _tmpl$
|
|
2577
|
+
var _tmpl$9 = /* @__PURE__ */ template(`<div>`);
|
|
2513
2578
|
function Slot(props) {
|
|
2514
2579
|
return (() => {
|
|
2515
|
-
const _el$ = _tmpl$
|
|
2580
|
+
const _el$ = _tmpl$9();
|
|
2516
2581
|
_el$.style.setProperty("pointer-events", "auto");
|
|
2517
2582
|
spread(_el$, mergeProps(() => !props.builderContext.context?.symbolId && {
|
|
2518
2583
|
"builder-slot": props.name
|
|
@@ -2592,10 +2657,10 @@ var componentInfo11 = {
|
|
|
2592
2657
|
textAlign: "center"
|
|
2593
2658
|
}
|
|
2594
2659
|
};
|
|
2595
|
-
var _tmpl$
|
|
2660
|
+
var _tmpl$10 = /* @__PURE__ */ template(`<div class=builder-text>`);
|
|
2596
2661
|
function Text(props) {
|
|
2597
2662
|
return (() => {
|
|
2598
|
-
const _el$ = _tmpl$
|
|
2663
|
+
const _el$ = _tmpl$10();
|
|
2599
2664
|
_el$.style.setProperty("outline", "none");
|
|
2600
2665
|
effect(() => _el$.innerHTML = props.text?.toString() || "");
|
|
2601
2666
|
return _el$;
|
|
@@ -2686,7 +2751,7 @@ var componentInfo12 = {
|
|
|
2686
2751
|
advanced: true
|
|
2687
2752
|
}]
|
|
2688
2753
|
};
|
|
2689
|
-
var _tmpl$
|
|
2754
|
+
var _tmpl$11 = /* @__PURE__ */ template(`<source type=video/mp4>`);
|
|
2690
2755
|
var _tmpl$23 = /* @__PURE__ */ template(`<div>`);
|
|
2691
2756
|
var _tmpl$33 = /* @__PURE__ */ template(`<div><video class=builder-video>`);
|
|
2692
2757
|
function Video(props) {
|
|
@@ -2749,7 +2814,7 @@ function Video(props) {
|
|
|
2749
2814
|
return !props.lazyLoad;
|
|
2750
2815
|
},
|
|
2751
2816
|
get children() {
|
|
2752
|
-
const _el$3 = _tmpl$
|
|
2817
|
+
const _el$3 = _tmpl$11();
|
|
2753
2818
|
effect(() => setAttribute(_el$3, "src", props.video));
|
|
2754
2819
|
return _el$3;
|
|
2755
2820
|
}
|
|
@@ -2911,10 +2976,10 @@ var getUpdateVariantVisibilityScript = ({
|
|
|
2911
2976
|
}) => `window.${UPDATE_VARIANT_VISIBILITY_SCRIPT_FN_NAME}(
|
|
2912
2977
|
"${variationId}", "${contentId}", ${isHydrationTarget}
|
|
2913
2978
|
)`;
|
|
2914
|
-
var _tmpl$
|
|
2979
|
+
var _tmpl$12 = /* @__PURE__ */ template(`<script>`);
|
|
2915
2980
|
function InlinedScript(props) {
|
|
2916
2981
|
return (() => {
|
|
2917
|
-
const _el$ = _tmpl$
|
|
2982
|
+
const _el$ = _tmpl$12();
|
|
2918
2983
|
effect((_p$) => {
|
|
2919
2984
|
const _v$ = props.scriptStr, _v$2 = props.id || "";
|
|
2920
2985
|
_v$ !== _p$._v$ && (_el$.innerHTML = _p$._v$ = _v$);
|
|
@@ -3416,7 +3481,7 @@ var getInteractionPropertiesForEvent = (event) => {
|
|
|
3416
3481
|
};
|
|
3417
3482
|
|
|
3418
3483
|
// src/constants/sdk-version.ts
|
|
3419
|
-
var SDK_VERSION = "0.12.
|
|
3484
|
+
var SDK_VERSION = "0.12.4";
|
|
3420
3485
|
|
|
3421
3486
|
// src/functions/register.ts
|
|
3422
3487
|
var registry = {};
|
|
@@ -3927,6 +3992,10 @@ ${getFontCss({
|
|
|
3927
3992
|
customFonts: props.customFonts
|
|
3928
3993
|
})}
|
|
3929
3994
|
|
|
3995
|
+
.builder-button {
|
|
3996
|
+
all: unset;
|
|
3997
|
+
}
|
|
3998
|
+
|
|
3930
3999
|
.builder-text > p:first-of-type, .builder-text > .builder-paragraph:first-of-type {
|
|
3931
4000
|
margin: 0;
|
|
3932
4001
|
}
|
|
@@ -4099,6 +4168,9 @@ function ContentComponent(props) {
|
|
|
4099
4168
|
get contentWrapperProps() {
|
|
4100
4169
|
return props.contentWrapperProps;
|
|
4101
4170
|
},
|
|
4171
|
+
get linkComponent() {
|
|
4172
|
+
return props.linkComponent;
|
|
4173
|
+
},
|
|
4102
4174
|
get trustedHosts() {
|
|
4103
4175
|
return props.trustedHosts;
|
|
4104
4176
|
}
|
|
@@ -4141,6 +4213,9 @@ function ContentComponent(props) {
|
|
|
4141
4213
|
},
|
|
4142
4214
|
get registeredComponents() {
|
|
4143
4215
|
return registeredComponents();
|
|
4216
|
+
},
|
|
4217
|
+
get linkComponent() {
|
|
4218
|
+
return props.linkComponent;
|
|
4144
4219
|
}
|
|
4145
4220
|
})];
|
|
4146
4221
|
}
|
|
@@ -4234,6 +4309,9 @@ function ContentVariants(props) {
|
|
|
4234
4309
|
get customComponents() {
|
|
4235
4310
|
return props.customComponents;
|
|
4236
4311
|
},
|
|
4312
|
+
get linkComponent() {
|
|
4313
|
+
return props.linkComponent;
|
|
4314
|
+
},
|
|
4237
4315
|
get canTrack() {
|
|
4238
4316
|
return props.canTrack;
|
|
4239
4317
|
},
|
|
@@ -4291,6 +4369,9 @@ function ContentVariants(props) {
|
|
|
4291
4369
|
get customComponents() {
|
|
4292
4370
|
return props.customComponents;
|
|
4293
4371
|
},
|
|
4372
|
+
get linkComponent() {
|
|
4373
|
+
return props.linkComponent;
|
|
4374
|
+
},
|
|
4294
4375
|
get canTrack() {
|
|
4295
4376
|
return props.canTrack;
|
|
4296
4377
|
},
|
|
@@ -4350,11 +4431,11 @@ var fetchSymbolContent = async ({
|
|
|
4350
4431
|
};
|
|
4351
4432
|
|
|
4352
4433
|
// src/blocks/symbol/symbol.tsx
|
|
4353
|
-
var _tmpl$
|
|
4434
|
+
var _tmpl$13 = /* @__PURE__ */ template(`<div>`);
|
|
4354
4435
|
function Symbol(props) {
|
|
4355
4436
|
const [contentToUse, setContentToUse] = createSignal(props.symbol?.content);
|
|
4356
4437
|
function className() {
|
|
4357
|
-
return [...[props.attributes
|
|
4438
|
+
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(" ");
|
|
4358
4439
|
}
|
|
4359
4440
|
function setContent() {
|
|
4360
4441
|
if (contentToUse())
|
|
@@ -4376,7 +4457,7 @@ function Symbol(props) {
|
|
|
4376
4457
|
}
|
|
4377
4458
|
createEffect(on(() => [props.symbol], onUpdateFn_0));
|
|
4378
4459
|
return (() => {
|
|
4379
|
-
const _el$ = _tmpl$
|
|
4460
|
+
const _el$ = _tmpl$13();
|
|
4380
4461
|
spread(_el$, mergeProps({
|
|
4381
4462
|
get ["class"]() {
|
|
4382
4463
|
return className();
|
|
@@ -4411,6 +4492,9 @@ function Symbol(props) {
|
|
|
4411
4492
|
},
|
|
4412
4493
|
get content() {
|
|
4413
4494
|
return contentToUse();
|
|
4495
|
+
},
|
|
4496
|
+
get linkComponent() {
|
|
4497
|
+
return props.builderLinkComponent;
|
|
4414
4498
|
}
|
|
4415
4499
|
}));
|
|
4416
4500
|
return _el$;
|