@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/browser/index.js
CHANGED
|
@@ -1,46 +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
|
-
all: "unset"
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
}, {}, () => props.attributes, {
|
|
20
|
-
get style() {
|
|
21
|
-
return props.attributes.style;
|
|
22
|
-
}
|
|
23
|
-
}), false, true);
|
|
24
|
-
insert(_el$2, () => props.text);
|
|
25
|
-
return _el$2;
|
|
26
|
-
})();
|
|
17
|
+
return createComponent(Dynamic, mergeProps(() => props.attributes, () => props.actionAttributes, {
|
|
18
|
+
get component() {
|
|
19
|
+
return props.TagName;
|
|
20
|
+
}
|
|
21
|
+
}));
|
|
27
22
|
},
|
|
28
23
|
get when() {
|
|
29
|
-
return props.
|
|
24
|
+
return !isEmptyElement(props.TagName);
|
|
30
25
|
},
|
|
31
26
|
get children() {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
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
|
+
}));
|
|
36
37
|
},
|
|
37
|
-
get
|
|
38
|
-
return props.
|
|
38
|
+
get when() {
|
|
39
|
+
return typeof props.TagName === "string";
|
|
39
40
|
},
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
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;
|
|
44
97
|
}
|
|
45
98
|
});
|
|
46
99
|
}
|
|
@@ -86,9 +139,6 @@ function isBrowser() {
|
|
|
86
139
|
return typeof window !== "undefined" && typeof document !== "undefined";
|
|
87
140
|
}
|
|
88
141
|
|
|
89
|
-
// src/constants/target.ts
|
|
90
|
-
var TARGET = "solid";
|
|
91
|
-
|
|
92
142
|
// src/functions/is-iframe.ts
|
|
93
143
|
function isIframe() {
|
|
94
144
|
return isBrowser() && window.self !== window.top;
|
|
@@ -476,10 +526,10 @@ var createCssClass = ({
|
|
|
476
526
|
return cssClass;
|
|
477
527
|
}
|
|
478
528
|
};
|
|
479
|
-
var _tmpl$
|
|
529
|
+
var _tmpl$ = /* @__PURE__ */ template(`<style>`);
|
|
480
530
|
function InlinedStyles(props) {
|
|
481
531
|
return (() => {
|
|
482
|
-
const _el$ = _tmpl$
|
|
532
|
+
const _el$ = _tmpl$();
|
|
483
533
|
effect((_p$) => {
|
|
484
534
|
const _v$ = props.styles, _v$2 = props.id;
|
|
485
535
|
_v$ !== _p$._v$ && (_el$.innerHTML = _p$._v$ = _v$);
|
|
@@ -513,7 +563,7 @@ function BlockStyles(props) {
|
|
|
513
563
|
}
|
|
514
564
|
return true;
|
|
515
565
|
}
|
|
516
|
-
function
|
|
566
|
+
function css4() {
|
|
517
567
|
const processedBlock = getProcessedBlock({
|
|
518
568
|
block: props.block,
|
|
519
569
|
localState: props.context.localState,
|
|
@@ -550,12 +600,12 @@ function BlockStyles(props) {
|
|
|
550
600
|
}
|
|
551
601
|
return createComponent(Show, {
|
|
552
602
|
get when() {
|
|
553
|
-
return memo(() => !!(TARGET !== "reactNative" &&
|
|
603
|
+
return memo(() => !!(TARGET !== "reactNative" && css4()))() && canShowBlock();
|
|
554
604
|
},
|
|
555
605
|
get children() {
|
|
556
606
|
return createComponent(inlined_styles_default, {
|
|
557
607
|
get styles() {
|
|
558
|
-
return
|
|
608
|
+
return css4();
|
|
559
609
|
}
|
|
560
610
|
});
|
|
561
611
|
}
|
|
@@ -605,6 +655,38 @@ function getBlockActions(options) {
|
|
|
605
655
|
return obj;
|
|
606
656
|
}
|
|
607
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
|
+
|
|
608
690
|
// src/functions/transform-block-properties.ts
|
|
609
691
|
function transformBlockProperties({
|
|
610
692
|
properties
|
|
@@ -626,8 +708,11 @@ function getBlockProperties({
|
|
|
626
708
|
...extractRelevantRootBlockProperties(block),
|
|
627
709
|
...block.properties,
|
|
628
710
|
"builder-id": block.id,
|
|
629
|
-
style:
|
|
630
|
-
|
|
711
|
+
style: getStyle({
|
|
712
|
+
block,
|
|
713
|
+
context
|
|
714
|
+
}),
|
|
715
|
+
[getClassPropName()]: [block.id, "builder-block", block.class, block.properties?.class].filter(Boolean).join(" ")
|
|
631
716
|
};
|
|
632
717
|
return transformBlockProperties({
|
|
633
718
|
properties,
|
|
@@ -635,69 +720,6 @@ function getBlockProperties({
|
|
|
635
720
|
block
|
|
636
721
|
});
|
|
637
722
|
}
|
|
638
|
-
function getStyleAttribute(style) {
|
|
639
|
-
switch (TARGET) {
|
|
640
|
-
case "svelte":
|
|
641
|
-
case "vue":
|
|
642
|
-
case "solid":
|
|
643
|
-
return convertStyleMapToCSSArray(style).join(" ");
|
|
644
|
-
case "qwik":
|
|
645
|
-
case "reactNative":
|
|
646
|
-
case "react":
|
|
647
|
-
case "rsc":
|
|
648
|
-
return style;
|
|
649
|
-
}
|
|
650
|
-
}
|
|
651
|
-
|
|
652
|
-
// src/components/dynamic-renderer/dynamic-renderer.helpers.ts
|
|
653
|
-
var EMPTY_HTML_ELEMENTS = /* @__PURE__ */ new Set(["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen", "link", "meta", "param", "source", "track", "wbr"]);
|
|
654
|
-
var isEmptyElement = (tagName) => {
|
|
655
|
-
return typeof tagName === "string" && EMPTY_HTML_ELEMENTS.has(tagName.toLowerCase());
|
|
656
|
-
};
|
|
657
|
-
|
|
658
|
-
// src/components/dynamic-renderer/dynamic-renderer.tsx
|
|
659
|
-
function DynamicRenderer(props) {
|
|
660
|
-
return createComponent(Show, {
|
|
661
|
-
get fallback() {
|
|
662
|
-
return createComponent(Dynamic, mergeProps(() => props.attributes, () => props.actionAttributes, {
|
|
663
|
-
get component() {
|
|
664
|
-
return props.TagName;
|
|
665
|
-
}
|
|
666
|
-
}));
|
|
667
|
-
},
|
|
668
|
-
get when() {
|
|
669
|
-
return !isEmptyElement(props.TagName);
|
|
670
|
-
},
|
|
671
|
-
get children() {
|
|
672
|
-
return createComponent(Show, {
|
|
673
|
-
get fallback() {
|
|
674
|
-
return createComponent(Dynamic, mergeProps(() => props.attributes, () => props.actionAttributes, {
|
|
675
|
-
get component() {
|
|
676
|
-
return props.TagName;
|
|
677
|
-
},
|
|
678
|
-
get children() {
|
|
679
|
-
return props.children;
|
|
680
|
-
}
|
|
681
|
-
}));
|
|
682
|
-
},
|
|
683
|
-
get when() {
|
|
684
|
-
return typeof props.TagName === "string";
|
|
685
|
-
},
|
|
686
|
-
get children() {
|
|
687
|
-
return createComponent(Dynamic, mergeProps(() => props.attributes, () => props.actionAttributes, {
|
|
688
|
-
get component() {
|
|
689
|
-
return props.TagName;
|
|
690
|
-
},
|
|
691
|
-
get children() {
|
|
692
|
-
return props.children;
|
|
693
|
-
}
|
|
694
|
-
}));
|
|
695
|
-
}
|
|
696
|
-
});
|
|
697
|
-
}
|
|
698
|
-
});
|
|
699
|
-
}
|
|
700
|
-
var dynamic_renderer_default = DynamicRenderer;
|
|
701
723
|
|
|
702
724
|
// src/components/block/components/block-wrapper.tsx
|
|
703
725
|
function BlockWrapper(props) {
|
|
@@ -800,6 +822,7 @@ function ComponentRef(props) {
|
|
|
800
822
|
builderBlock: props.builderBlock,
|
|
801
823
|
context: props.context,
|
|
802
824
|
componentRef: props.componentRef,
|
|
825
|
+
linkComponent: props.linkComponent,
|
|
803
826
|
includeBlockProps: props.includeBlockProps,
|
|
804
827
|
isInteractive: props.isInteractive,
|
|
805
828
|
contextValue: props.context
|
|
@@ -824,6 +847,9 @@ function ComponentRef(props) {
|
|
|
824
847
|
},
|
|
825
848
|
get registeredComponents() {
|
|
826
849
|
return props.registeredComponents;
|
|
850
|
+
},
|
|
851
|
+
get linkComponent() {
|
|
852
|
+
return props.linkComponent;
|
|
827
853
|
}
|
|
828
854
|
});
|
|
829
855
|
}
|
|
@@ -850,6 +876,9 @@ function RepeatedBlock(props) {
|
|
|
850
876
|
},
|
|
851
877
|
get registeredComponents() {
|
|
852
878
|
return props.registeredComponents;
|
|
879
|
+
},
|
|
880
|
+
get linkComponent() {
|
|
881
|
+
return props.linkComponent;
|
|
853
882
|
}
|
|
854
883
|
});
|
|
855
884
|
}
|
|
@@ -884,6 +913,10 @@ function Block(props) {
|
|
|
884
913
|
});
|
|
885
914
|
}
|
|
886
915
|
function Tag() {
|
|
916
|
+
const shouldUseLink = props.block.tagName === "a" || processedBlock().properties?.href || processedBlock().href;
|
|
917
|
+
if (shouldUseLink) {
|
|
918
|
+
return props.linkComponent || "a";
|
|
919
|
+
}
|
|
887
920
|
return props.block.tagName || "div";
|
|
888
921
|
}
|
|
889
922
|
function canShowBlock() {
|
|
@@ -907,11 +940,15 @@ function Block(props) {
|
|
|
907
940
|
componentOptions: {
|
|
908
941
|
...getBlockComponentOptions(processedBlock()),
|
|
909
942
|
builderContext: props.context,
|
|
943
|
+
...blockComponent()?.name === "Core:Button" || blockComponent()?.name === "Symbol" || blockComponent()?.name === "Columns" ? {
|
|
944
|
+
builderLinkComponent: props.linkComponent
|
|
945
|
+
} : {},
|
|
910
946
|
...blockComponent()?.name === "Symbol" || blockComponent()?.name === "Columns" ? {
|
|
911
947
|
builderComponents: props.registeredComponents
|
|
912
948
|
} : {}
|
|
913
949
|
},
|
|
914
950
|
context: childrenContext(),
|
|
951
|
+
linkComponent: props.linkComponent,
|
|
915
952
|
registeredComponents: props.registeredComponents,
|
|
916
953
|
builderBlock: processedBlock(),
|
|
917
954
|
includeBlockProps: blockComponent()?.noWrap === true,
|
|
@@ -948,6 +985,9 @@ function Block(props) {
|
|
|
948
985
|
get registeredComponents() {
|
|
949
986
|
return componentRefProps().registeredComponents;
|
|
950
987
|
},
|
|
988
|
+
get linkComponent() {
|
|
989
|
+
return componentRefProps().linkComponent;
|
|
990
|
+
},
|
|
951
991
|
get builderBlock() {
|
|
952
992
|
return componentRefProps().builderBlock;
|
|
953
993
|
},
|
|
@@ -981,6 +1021,9 @@ function Block(props) {
|
|
|
981
1021
|
},
|
|
982
1022
|
get registeredComponents() {
|
|
983
1023
|
return props.registeredComponents;
|
|
1024
|
+
},
|
|
1025
|
+
get linkComponent() {
|
|
1026
|
+
return props.linkComponent;
|
|
984
1027
|
}
|
|
985
1028
|
});
|
|
986
1029
|
}
|
|
@@ -1000,6 +1043,9 @@ function Block(props) {
|
|
|
1000
1043
|
get context() {
|
|
1001
1044
|
return props.context;
|
|
1002
1045
|
},
|
|
1046
|
+
get linkComponent() {
|
|
1047
|
+
return props.linkComponent;
|
|
1048
|
+
},
|
|
1003
1049
|
get children() {
|
|
1004
1050
|
return [createComponent(component_ref_default, {
|
|
1005
1051
|
get componentRef() {
|
|
@@ -1017,6 +1063,9 @@ function Block(props) {
|
|
|
1017
1063
|
get registeredComponents() {
|
|
1018
1064
|
return componentRefProps().registeredComponents;
|
|
1019
1065
|
},
|
|
1066
|
+
get linkComponent() {
|
|
1067
|
+
return componentRefProps().linkComponent;
|
|
1068
|
+
},
|
|
1020
1069
|
get builderBlock() {
|
|
1021
1070
|
return componentRefProps().builderBlock;
|
|
1022
1071
|
},
|
|
@@ -1042,6 +1091,9 @@ function Block(props) {
|
|
|
1042
1091
|
},
|
|
1043
1092
|
get registeredComponents() {
|
|
1044
1093
|
return props.registeredComponents;
|
|
1094
|
+
},
|
|
1095
|
+
get linkComponent() {
|
|
1096
|
+
return props.linkComponent;
|
|
1045
1097
|
}
|
|
1046
1098
|
});
|
|
1047
1099
|
}
|
|
@@ -1154,6 +1206,9 @@ function Blocks(props) {
|
|
|
1154
1206
|
return block.id;
|
|
1155
1207
|
},
|
|
1156
1208
|
block,
|
|
1209
|
+
get linkComponent() {
|
|
1210
|
+
return props.linkComponent;
|
|
1211
|
+
},
|
|
1157
1212
|
get context() {
|
|
1158
1213
|
return props.context || builderContext;
|
|
1159
1214
|
},
|
|
@@ -1171,7 +1226,7 @@ function Blocks(props) {
|
|
|
1171
1226
|
var blocks_default = Blocks;
|
|
1172
1227
|
|
|
1173
1228
|
// src/blocks/columns/columns.tsx
|
|
1174
|
-
var _tmpl$
|
|
1229
|
+
var _tmpl$2 = /* @__PURE__ */ template(`<div>`);
|
|
1175
1230
|
function Columns(props) {
|
|
1176
1231
|
const [gutterSize, setGutterSize] = createSignal(typeof props.space === "number" ? props.space || 0 : 20);
|
|
1177
1232
|
const [cols, setCols] = createSignal(props.columns || []);
|
|
@@ -1212,7 +1267,13 @@ function Columns(props) {
|
|
|
1212
1267
|
const mobileWidth = "100%";
|
|
1213
1268
|
const mobileMarginLeft = 0;
|
|
1214
1269
|
const marginLeftKey = "margin-left";
|
|
1270
|
+
const sharedStyles = {
|
|
1271
|
+
display: "flex",
|
|
1272
|
+
flexDirection: "column",
|
|
1273
|
+
alignItems: "stretch"
|
|
1274
|
+
};
|
|
1215
1275
|
return {
|
|
1276
|
+
...sharedStyles,
|
|
1216
1277
|
width,
|
|
1217
1278
|
[marginLeftKey]: gutterPixels,
|
|
1218
1279
|
"--column-width-mobile": getMobileStyle({
|
|
@@ -1265,7 +1326,7 @@ function Columns(props) {
|
|
|
1265
1326
|
`;
|
|
1266
1327
|
}
|
|
1267
1328
|
return (() => {
|
|
1268
|
-
const _el$ = _tmpl$
|
|
1329
|
+
const _el$ = _tmpl$2();
|
|
1269
1330
|
spread(_el$, mergeProps({
|
|
1270
1331
|
get ["class"]() {
|
|
1271
1332
|
return `builder-columns ${props.builderBlock.id}-breakpoints ` + css({
|
|
@@ -1293,52 +1354,56 @@ function Columns(props) {
|
|
|
1293
1354
|
},
|
|
1294
1355
|
children: (column, _index) => {
|
|
1295
1356
|
const index = _index();
|
|
1296
|
-
return (
|
|
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
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
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
|
+
});
|
|
1332
1397
|
}
|
|
1333
1398
|
}), null);
|
|
1334
1399
|
return _el$;
|
|
1335
1400
|
})();
|
|
1336
1401
|
}
|
|
1337
1402
|
var columns_default = Columns;
|
|
1338
|
-
var _tmpl$
|
|
1403
|
+
var _tmpl$3 = /* @__PURE__ */ template(`<span>`);
|
|
1339
1404
|
function FragmentComponent(props) {
|
|
1340
1405
|
return (() => {
|
|
1341
|
-
const _el$ = _tmpl$
|
|
1406
|
+
const _el$ = _tmpl$3();
|
|
1342
1407
|
insert(_el$, () => props.children);
|
|
1343
1408
|
return _el$;
|
|
1344
1409
|
})();
|
|
@@ -1393,7 +1458,7 @@ function getSrcSet(url) {
|
|
|
1393
1458
|
}
|
|
1394
1459
|
|
|
1395
1460
|
// src/blocks/image/image.tsx
|
|
1396
|
-
var _tmpl$
|
|
1461
|
+
var _tmpl$4 = /* @__PURE__ */ template(`<source type=image/webp>`);
|
|
1397
1462
|
var _tmpl$22 = /* @__PURE__ */ template(`<picture><img loading=lazy>`);
|
|
1398
1463
|
var _tmpl$32 = /* @__PURE__ */ template(`<div>`);
|
|
1399
1464
|
function Image(props) {
|
|
@@ -1439,7 +1504,7 @@ function Image(props) {
|
|
|
1439
1504
|
return webpSrcSet();
|
|
1440
1505
|
},
|
|
1441
1506
|
get children() {
|
|
1442
|
-
const _el$2 = _tmpl$
|
|
1507
|
+
const _el$2 = _tmpl$4();
|
|
1443
1508
|
effect(() => setAttribute(_el$2, "srcset", webpSrcSet()));
|
|
1444
1509
|
return _el$2;
|
|
1445
1510
|
}
|
|
@@ -1521,10 +1586,10 @@ function Image(props) {
|
|
|
1521
1586
|
})];
|
|
1522
1587
|
}
|
|
1523
1588
|
var image_default = Image;
|
|
1524
|
-
var _tmpl$
|
|
1589
|
+
var _tmpl$5 = /* @__PURE__ */ template(`<section>`);
|
|
1525
1590
|
function SectionComponent(props) {
|
|
1526
1591
|
return (() => {
|
|
1527
|
-
const _el$ = _tmpl$
|
|
1592
|
+
const _el$ = _tmpl$5();
|
|
1528
1593
|
spread(_el$, mergeProps({}, () => props.attributes, {
|
|
1529
1594
|
get style() {
|
|
1530
1595
|
return {
|
|
@@ -2018,7 +2083,7 @@ var componentInfo3 = {
|
|
|
2018
2083
|
advanced: true
|
|
2019
2084
|
}]
|
|
2020
2085
|
};
|
|
2021
|
-
var _tmpl$
|
|
2086
|
+
var _tmpl$6 = /* @__PURE__ */ template(`<div>`);
|
|
2022
2087
|
function CustomCode(props) {
|
|
2023
2088
|
const [scriptsInserted, setScriptsInserted] = createSignal([]);
|
|
2024
2089
|
const [scriptsRun, setScriptsRun] = createSignal([]);
|
|
@@ -2052,7 +2117,7 @@ function CustomCode(props) {
|
|
|
2052
2117
|
}
|
|
2053
2118
|
});
|
|
2054
2119
|
return (() => {
|
|
2055
|
-
const _el$ = _tmpl$
|
|
2120
|
+
const _el$ = _tmpl$6();
|
|
2056
2121
|
const _ref$ = elementRef;
|
|
2057
2122
|
typeof _ref$ === "function" ? use(_ref$, _el$) : elementRef = _el$;
|
|
2058
2123
|
effect((_p$) => {
|
|
@@ -2112,7 +2177,7 @@ var SCRIPT_MIME_TYPES = ["text/javascript", "application/javascript", "applicati
|
|
|
2112
2177
|
var isJsScript = (script) => SCRIPT_MIME_TYPES.includes(script.type);
|
|
2113
2178
|
|
|
2114
2179
|
// src/blocks/embed/embed.tsx
|
|
2115
|
-
var _tmpl$
|
|
2180
|
+
var _tmpl$7 = /* @__PURE__ */ template(`<div class=builder-embed>`);
|
|
2116
2181
|
function Embed(props) {
|
|
2117
2182
|
const [scriptsInserted, setScriptsInserted] = createSignal([]);
|
|
2118
2183
|
const [scriptsRun, setScriptsRun] = createSignal([]);
|
|
@@ -2147,7 +2212,7 @@ function Embed(props) {
|
|
|
2147
2212
|
}
|
|
2148
2213
|
createEffect(on(() => [elem, ranInitFn()], onUpdateFn_0));
|
|
2149
2214
|
return (() => {
|
|
2150
|
-
const _el$ = _tmpl$
|
|
2215
|
+
const _el$ = _tmpl$7();
|
|
2151
2216
|
const _ref$ = elem;
|
|
2152
2217
|
typeof _ref$ === "function" ? use(_ref$, _el$) : elem = _el$;
|
|
2153
2218
|
effect(() => _el$.innerHTML = props.content);
|
|
@@ -2303,10 +2368,10 @@ var componentInfo7 = {
|
|
|
2303
2368
|
noWrap: true,
|
|
2304
2369
|
static: true
|
|
2305
2370
|
};
|
|
2306
|
-
var _tmpl$
|
|
2371
|
+
var _tmpl$8 = /* @__PURE__ */ template(`<img>`);
|
|
2307
2372
|
function ImgComponent(props) {
|
|
2308
2373
|
return (() => {
|
|
2309
|
-
const _el$ = _tmpl$
|
|
2374
|
+
const _el$ = _tmpl$8();
|
|
2310
2375
|
spread(_el$, mergeProps({
|
|
2311
2376
|
get style() {
|
|
2312
2377
|
return {
|
|
@@ -2386,10 +2451,10 @@ var componentInfo9 = {
|
|
|
2386
2451
|
defaultValue: "children"
|
|
2387
2452
|
}]
|
|
2388
2453
|
};
|
|
2389
|
-
var _tmpl$
|
|
2454
|
+
var _tmpl$9 = /* @__PURE__ */ template(`<div>`);
|
|
2390
2455
|
function Slot(props) {
|
|
2391
2456
|
return (() => {
|
|
2392
|
-
const _el$ = _tmpl$
|
|
2457
|
+
const _el$ = _tmpl$9();
|
|
2393
2458
|
_el$.style.setProperty("pointer-events", "auto");
|
|
2394
2459
|
spread(_el$, mergeProps(() => !props.builderContext.context?.symbolId && {
|
|
2395
2460
|
"builder-slot": props.name
|
|
@@ -2469,10 +2534,10 @@ var componentInfo11 = {
|
|
|
2469
2534
|
textAlign: "center"
|
|
2470
2535
|
}
|
|
2471
2536
|
};
|
|
2472
|
-
var _tmpl$
|
|
2537
|
+
var _tmpl$10 = /* @__PURE__ */ template(`<div class=builder-text>`);
|
|
2473
2538
|
function Text(props) {
|
|
2474
2539
|
return (() => {
|
|
2475
|
-
const _el$ = _tmpl$
|
|
2540
|
+
const _el$ = _tmpl$10();
|
|
2476
2541
|
_el$.style.setProperty("outline", "none");
|
|
2477
2542
|
effect(() => _el$.innerHTML = props.text?.toString() || "");
|
|
2478
2543
|
return _el$;
|
|
@@ -2563,7 +2628,7 @@ var componentInfo12 = {
|
|
|
2563
2628
|
advanced: true
|
|
2564
2629
|
}]
|
|
2565
2630
|
};
|
|
2566
|
-
var _tmpl$
|
|
2631
|
+
var _tmpl$11 = /* @__PURE__ */ template(`<source type=video/mp4>`);
|
|
2567
2632
|
var _tmpl$23 = /* @__PURE__ */ template(`<div>`);
|
|
2568
2633
|
var _tmpl$33 = /* @__PURE__ */ template(`<div><video class=builder-video>`);
|
|
2569
2634
|
function Video(props) {
|
|
@@ -2626,7 +2691,7 @@ function Video(props) {
|
|
|
2626
2691
|
return !props.lazyLoad;
|
|
2627
2692
|
},
|
|
2628
2693
|
get children() {
|
|
2629
|
-
const _el$3 = _tmpl$
|
|
2694
|
+
const _el$3 = _tmpl$11();
|
|
2630
2695
|
effect(() => setAttribute(_el$3, "src", props.video));
|
|
2631
2696
|
return _el$3;
|
|
2632
2697
|
}
|
|
@@ -2788,10 +2853,10 @@ var getUpdateVariantVisibilityScript = ({
|
|
|
2788
2853
|
}) => `window.${UPDATE_VARIANT_VISIBILITY_SCRIPT_FN_NAME}(
|
|
2789
2854
|
"${variationId}", "${contentId}", ${isHydrationTarget}
|
|
2790
2855
|
)`;
|
|
2791
|
-
var _tmpl$
|
|
2856
|
+
var _tmpl$12 = /* @__PURE__ */ template(`<script>`);
|
|
2792
2857
|
function InlinedScript(props) {
|
|
2793
2858
|
return (() => {
|
|
2794
|
-
const _el$ = _tmpl$
|
|
2859
|
+
const _el$ = _tmpl$12();
|
|
2795
2860
|
effect((_p$) => {
|
|
2796
2861
|
const _v$ = props.scriptStr, _v$2 = props.id || "";
|
|
2797
2862
|
_v$ !== _p$._v$ && (_el$.innerHTML = _p$._v$ = _v$);
|
|
@@ -3293,7 +3358,7 @@ var getInteractionPropertiesForEvent = (event) => {
|
|
|
3293
3358
|
};
|
|
3294
3359
|
|
|
3295
3360
|
// src/constants/sdk-version.ts
|
|
3296
|
-
var SDK_VERSION = "0.12.
|
|
3361
|
+
var SDK_VERSION = "0.12.4";
|
|
3297
3362
|
|
|
3298
3363
|
// src/functions/register.ts
|
|
3299
3364
|
var registry = {};
|
|
@@ -3804,6 +3869,10 @@ ${getFontCss({
|
|
|
3804
3869
|
customFonts: props.customFonts
|
|
3805
3870
|
})}
|
|
3806
3871
|
|
|
3872
|
+
.builder-button {
|
|
3873
|
+
all: unset;
|
|
3874
|
+
}
|
|
3875
|
+
|
|
3807
3876
|
.builder-text > p:first-of-type, .builder-text > .builder-paragraph:first-of-type {
|
|
3808
3877
|
margin: 0;
|
|
3809
3878
|
}
|
|
@@ -3976,6 +4045,9 @@ function ContentComponent(props) {
|
|
|
3976
4045
|
get contentWrapperProps() {
|
|
3977
4046
|
return props.contentWrapperProps;
|
|
3978
4047
|
},
|
|
4048
|
+
get linkComponent() {
|
|
4049
|
+
return props.linkComponent;
|
|
4050
|
+
},
|
|
3979
4051
|
get trustedHosts() {
|
|
3980
4052
|
return props.trustedHosts;
|
|
3981
4053
|
}
|
|
@@ -4018,6 +4090,9 @@ function ContentComponent(props) {
|
|
|
4018
4090
|
},
|
|
4019
4091
|
get registeredComponents() {
|
|
4020
4092
|
return registeredComponents();
|
|
4093
|
+
},
|
|
4094
|
+
get linkComponent() {
|
|
4095
|
+
return props.linkComponent;
|
|
4021
4096
|
}
|
|
4022
4097
|
})];
|
|
4023
4098
|
}
|
|
@@ -4111,6 +4186,9 @@ function ContentVariants(props) {
|
|
|
4111
4186
|
get customComponents() {
|
|
4112
4187
|
return props.customComponents;
|
|
4113
4188
|
},
|
|
4189
|
+
get linkComponent() {
|
|
4190
|
+
return props.linkComponent;
|
|
4191
|
+
},
|
|
4114
4192
|
get canTrack() {
|
|
4115
4193
|
return props.canTrack;
|
|
4116
4194
|
},
|
|
@@ -4168,6 +4246,9 @@ function ContentVariants(props) {
|
|
|
4168
4246
|
get customComponents() {
|
|
4169
4247
|
return props.customComponents;
|
|
4170
4248
|
},
|
|
4249
|
+
get linkComponent() {
|
|
4250
|
+
return props.linkComponent;
|
|
4251
|
+
},
|
|
4171
4252
|
get canTrack() {
|
|
4172
4253
|
return props.canTrack;
|
|
4173
4254
|
},
|
|
@@ -4227,11 +4308,11 @@ var fetchSymbolContent = async ({
|
|
|
4227
4308
|
};
|
|
4228
4309
|
|
|
4229
4310
|
// src/blocks/symbol/symbol.tsx
|
|
4230
|
-
var _tmpl$
|
|
4311
|
+
var _tmpl$13 = /* @__PURE__ */ template(`<div>`);
|
|
4231
4312
|
function Symbol(props) {
|
|
4232
4313
|
const [contentToUse, setContentToUse] = createSignal(props.symbol?.content);
|
|
4233
4314
|
function className() {
|
|
4234
|
-
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(" ");
|
|
4235
4316
|
}
|
|
4236
4317
|
function setContent() {
|
|
4237
4318
|
if (contentToUse())
|
|
@@ -4253,7 +4334,7 @@ function Symbol(props) {
|
|
|
4253
4334
|
}
|
|
4254
4335
|
createEffect(on(() => [props.symbol], onUpdateFn_0));
|
|
4255
4336
|
return (() => {
|
|
4256
|
-
const _el$ = _tmpl$
|
|
4337
|
+
const _el$ = _tmpl$13();
|
|
4257
4338
|
spread(_el$, mergeProps({
|
|
4258
4339
|
get ["class"]() {
|
|
4259
4340
|
return className();
|
|
@@ -4288,6 +4369,9 @@ function Symbol(props) {
|
|
|
4288
4369
|
},
|
|
4289
4370
|
get content() {
|
|
4290
4371
|
return contentToUse();
|
|
4372
|
+
},
|
|
4373
|
+
get linkComponent() {
|
|
4374
|
+
return props.builderLinkComponent;
|
|
4291
4375
|
}
|
|
4292
4376
|
}));
|
|
4293
4377
|
return _el$;
|