@builder.io/sdk-solid 0.12.3 → 0.12.5
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 +269 -165
- package/lib/browser/dev.jsx +211 -122
- package/lib/browser/index.js +269 -165
- package/lib/browser/index.jsx +211 -122
- package/lib/edge/dev.js +269 -165
- package/lib/edge/dev.jsx +211 -122
- package/lib/edge/index.js +269 -165
- package/lib/edge/index.jsx +211 -122
- package/lib/node/dev.js +269 -165
- package/lib/node/dev.jsx +211 -122
- package/lib/node/index.js +269 -165
- package/lib/node/index.jsx +211 -122
- 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;
|
|
@@ -216,8 +268,33 @@ function flattenState(rootState, localState, rootSetState) {
|
|
|
216
268
|
});
|
|
217
269
|
}
|
|
218
270
|
|
|
271
|
+
// src/helpers/nullable.ts
|
|
272
|
+
var checkIsDefined = (maybeT) => maybeT !== null && maybeT !== void 0;
|
|
273
|
+
|
|
274
|
+
// src/functions/is-node-runtime.ts
|
|
275
|
+
function isNodeRuntime() {
|
|
276
|
+
return typeof process !== "undefined" && checkIsDefined(process?.versions?.node);
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
// src/functions/evaluate/should-force-browser-runtime-in-node.ts
|
|
280
|
+
var shouldForceBrowserRuntimeInNode = () => {
|
|
281
|
+
if (!isNodeRuntime())
|
|
282
|
+
return false;
|
|
283
|
+
const isArm64 = process.arch === "arm64";
|
|
284
|
+
const isNode20 = process.version.startsWith("v20");
|
|
285
|
+
const hasNoNodeSnapshotNodeOption = process.env.NODE_OPTIONS?.includes("--no-node-snapshot");
|
|
286
|
+
if (isArm64 && isNode20 && !hasNoNodeSnapshotNodeOption) {
|
|
287
|
+
logger.log(`Skipping usage of \`isolated-vm\` to avoid crashes in Node v20 on an arm64 machine.
|
|
288
|
+
If you would like to use the \`isolated-vm\` package on this machine, please provide the \`NODE_OPTIONS=--no-node-snapshot\` config to your Node process.
|
|
289
|
+
See https://github.com/BuilderIO/builder/blob/main/packages/sdks/README.md#node-v20--m1-macs-apple-silicon-support for more information.
|
|
290
|
+
`);
|
|
291
|
+
return true;
|
|
292
|
+
}
|
|
293
|
+
return false;
|
|
294
|
+
};
|
|
295
|
+
|
|
219
296
|
// src/functions/evaluate/choose-eval.ts
|
|
220
|
-
var chooseBrowserOrServerEval = (args) => isBrowser() ? runInBrowser(args) : runInBrowser(args);
|
|
297
|
+
var chooseBrowserOrServerEval = (args) => isBrowser() || shouldForceBrowserRuntimeInNode() ? runInBrowser(args) : runInBrowser(args);
|
|
221
298
|
|
|
222
299
|
// src/functions/evaluate/evaluate.ts
|
|
223
300
|
function evaluate({
|
|
@@ -443,9 +520,6 @@ var getSizesForBreakpoints = ({
|
|
|
443
520
|
// src/functions/camel-to-kebab-case.ts
|
|
444
521
|
var camelToKebabCase = (string) => string.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase();
|
|
445
522
|
|
|
446
|
-
// src/helpers/nullable.ts
|
|
447
|
-
var checkIsDefined = (maybeT) => maybeT !== null && maybeT !== void 0;
|
|
448
|
-
|
|
449
523
|
// src/helpers/css.ts
|
|
450
524
|
var convertStyleMapToCSSArray = (style) => {
|
|
451
525
|
const cssProps = Object.entries(style).map(([key, value]) => {
|
|
@@ -474,10 +548,10 @@ var createCssClass = ({
|
|
|
474
548
|
return cssClass;
|
|
475
549
|
}
|
|
476
550
|
};
|
|
477
|
-
var _tmpl$
|
|
551
|
+
var _tmpl$ = /* @__PURE__ */ template(`<style>`);
|
|
478
552
|
function InlinedStyles(props) {
|
|
479
553
|
return (() => {
|
|
480
|
-
const _el$ = _tmpl$
|
|
554
|
+
const _el$ = _tmpl$();
|
|
481
555
|
effect((_p$) => {
|
|
482
556
|
const _v$ = props.styles, _v$2 = props.id;
|
|
483
557
|
_v$ !== _p$._v$ && (_el$.innerHTML = _p$._v$ = _v$);
|
|
@@ -603,6 +677,38 @@ function getBlockActions(options) {
|
|
|
603
677
|
return obj;
|
|
604
678
|
}
|
|
605
679
|
|
|
680
|
+
// src/functions/transform-style-property.ts
|
|
681
|
+
function transformStyleProperty({
|
|
682
|
+
style
|
|
683
|
+
}) {
|
|
684
|
+
return style;
|
|
685
|
+
}
|
|
686
|
+
|
|
687
|
+
// src/functions/get-style.ts
|
|
688
|
+
var getStyle = ({
|
|
689
|
+
block,
|
|
690
|
+
context
|
|
691
|
+
}) => {
|
|
692
|
+
return mapStyleObjToStrIfNeeded(transformStyleProperty({
|
|
693
|
+
style: block.style || {},
|
|
694
|
+
context,
|
|
695
|
+
block
|
|
696
|
+
}));
|
|
697
|
+
};
|
|
698
|
+
function mapStyleObjToStrIfNeeded(style) {
|
|
699
|
+
switch (TARGET) {
|
|
700
|
+
case "svelte":
|
|
701
|
+
case "vue":
|
|
702
|
+
case "solid":
|
|
703
|
+
return convertStyleMapToCSSArray(style).join(" ");
|
|
704
|
+
case "qwik":
|
|
705
|
+
case "reactNative":
|
|
706
|
+
case "react":
|
|
707
|
+
case "rsc":
|
|
708
|
+
return style;
|
|
709
|
+
}
|
|
710
|
+
}
|
|
711
|
+
|
|
606
712
|
// src/functions/transform-block-properties.ts
|
|
607
713
|
function transformBlockProperties({
|
|
608
714
|
properties
|
|
@@ -624,8 +730,11 @@ function getBlockProperties({
|
|
|
624
730
|
...extractRelevantRootBlockProperties(block),
|
|
625
731
|
...block.properties,
|
|
626
732
|
"builder-id": block.id,
|
|
627
|
-
style:
|
|
628
|
-
|
|
733
|
+
style: getStyle({
|
|
734
|
+
block,
|
|
735
|
+
context
|
|
736
|
+
}),
|
|
737
|
+
[getClassPropName()]: [block.id, "builder-block", block.class, block.properties?.class].filter(Boolean).join(" ")
|
|
629
738
|
};
|
|
630
739
|
return transformBlockProperties({
|
|
631
740
|
properties,
|
|
@@ -633,69 +742,6 @@ function getBlockProperties({
|
|
|
633
742
|
block
|
|
634
743
|
});
|
|
635
744
|
}
|
|
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
745
|
|
|
700
746
|
// src/components/block/components/block-wrapper.tsx
|
|
701
747
|
function BlockWrapper(props) {
|
|
@@ -798,6 +844,7 @@ function ComponentRef(props) {
|
|
|
798
844
|
builderBlock: props.builderBlock,
|
|
799
845
|
context: props.context,
|
|
800
846
|
componentRef: props.componentRef,
|
|
847
|
+
linkComponent: props.linkComponent,
|
|
801
848
|
includeBlockProps: props.includeBlockProps,
|
|
802
849
|
isInteractive: props.isInteractive,
|
|
803
850
|
contextValue: props.context
|
|
@@ -822,6 +869,9 @@ function ComponentRef(props) {
|
|
|
822
869
|
},
|
|
823
870
|
get registeredComponents() {
|
|
824
871
|
return props.registeredComponents;
|
|
872
|
+
},
|
|
873
|
+
get linkComponent() {
|
|
874
|
+
return props.linkComponent;
|
|
825
875
|
}
|
|
826
876
|
});
|
|
827
877
|
}
|
|
@@ -848,6 +898,9 @@ function RepeatedBlock(props) {
|
|
|
848
898
|
},
|
|
849
899
|
get registeredComponents() {
|
|
850
900
|
return props.registeredComponents;
|
|
901
|
+
},
|
|
902
|
+
get linkComponent() {
|
|
903
|
+
return props.linkComponent;
|
|
851
904
|
}
|
|
852
905
|
});
|
|
853
906
|
}
|
|
@@ -882,6 +935,10 @@ function Block(props) {
|
|
|
882
935
|
});
|
|
883
936
|
}
|
|
884
937
|
function Tag() {
|
|
938
|
+
const shouldUseLink = props.block.tagName === "a" || processedBlock().properties?.href || processedBlock().href;
|
|
939
|
+
if (shouldUseLink) {
|
|
940
|
+
return props.linkComponent || "a";
|
|
941
|
+
}
|
|
885
942
|
return props.block.tagName || "div";
|
|
886
943
|
}
|
|
887
944
|
function canShowBlock() {
|
|
@@ -905,11 +962,15 @@ function Block(props) {
|
|
|
905
962
|
componentOptions: {
|
|
906
963
|
...getBlockComponentOptions(processedBlock()),
|
|
907
964
|
builderContext: props.context,
|
|
965
|
+
...blockComponent()?.name === "Core:Button" || blockComponent()?.name === "Symbol" || blockComponent()?.name === "Columns" ? {
|
|
966
|
+
builderLinkComponent: props.linkComponent
|
|
967
|
+
} : {},
|
|
908
968
|
...blockComponent()?.name === "Symbol" || blockComponent()?.name === "Columns" ? {
|
|
909
969
|
builderComponents: props.registeredComponents
|
|
910
970
|
} : {}
|
|
911
971
|
},
|
|
912
972
|
context: childrenContext(),
|
|
973
|
+
linkComponent: props.linkComponent,
|
|
913
974
|
registeredComponents: props.registeredComponents,
|
|
914
975
|
builderBlock: processedBlock(),
|
|
915
976
|
includeBlockProps: blockComponent()?.noWrap === true,
|
|
@@ -946,6 +1007,9 @@ function Block(props) {
|
|
|
946
1007
|
get registeredComponents() {
|
|
947
1008
|
return componentRefProps().registeredComponents;
|
|
948
1009
|
},
|
|
1010
|
+
get linkComponent() {
|
|
1011
|
+
return componentRefProps().linkComponent;
|
|
1012
|
+
},
|
|
949
1013
|
get builderBlock() {
|
|
950
1014
|
return componentRefProps().builderBlock;
|
|
951
1015
|
},
|
|
@@ -979,6 +1043,9 @@ function Block(props) {
|
|
|
979
1043
|
},
|
|
980
1044
|
get registeredComponents() {
|
|
981
1045
|
return props.registeredComponents;
|
|
1046
|
+
},
|
|
1047
|
+
get linkComponent() {
|
|
1048
|
+
return props.linkComponent;
|
|
982
1049
|
}
|
|
983
1050
|
});
|
|
984
1051
|
}
|
|
@@ -998,6 +1065,9 @@ function Block(props) {
|
|
|
998
1065
|
get context() {
|
|
999
1066
|
return props.context;
|
|
1000
1067
|
},
|
|
1068
|
+
get linkComponent() {
|
|
1069
|
+
return props.linkComponent;
|
|
1070
|
+
},
|
|
1001
1071
|
get children() {
|
|
1002
1072
|
return [createComponent(component_ref_default, {
|
|
1003
1073
|
get componentRef() {
|
|
@@ -1015,6 +1085,9 @@ function Block(props) {
|
|
|
1015
1085
|
get registeredComponents() {
|
|
1016
1086
|
return componentRefProps().registeredComponents;
|
|
1017
1087
|
},
|
|
1088
|
+
get linkComponent() {
|
|
1089
|
+
return componentRefProps().linkComponent;
|
|
1090
|
+
},
|
|
1018
1091
|
get builderBlock() {
|
|
1019
1092
|
return componentRefProps().builderBlock;
|
|
1020
1093
|
},
|
|
@@ -1040,6 +1113,9 @@ function Block(props) {
|
|
|
1040
1113
|
},
|
|
1041
1114
|
get registeredComponents() {
|
|
1042
1115
|
return props.registeredComponents;
|
|
1116
|
+
},
|
|
1117
|
+
get linkComponent() {
|
|
1118
|
+
return props.linkComponent;
|
|
1043
1119
|
}
|
|
1044
1120
|
});
|
|
1045
1121
|
}
|
|
@@ -1152,6 +1228,9 @@ function Blocks(props) {
|
|
|
1152
1228
|
return block.id;
|
|
1153
1229
|
},
|
|
1154
1230
|
block,
|
|
1231
|
+
get linkComponent() {
|
|
1232
|
+
return props.linkComponent;
|
|
1233
|
+
},
|
|
1155
1234
|
get context() {
|
|
1156
1235
|
return props.context || builderContext;
|
|
1157
1236
|
},
|
|
@@ -1169,7 +1248,7 @@ function Blocks(props) {
|
|
|
1169
1248
|
var blocks_default = Blocks;
|
|
1170
1249
|
|
|
1171
1250
|
// src/blocks/columns/columns.tsx
|
|
1172
|
-
var _tmpl$
|
|
1251
|
+
var _tmpl$2 = /* @__PURE__ */ template(`<div>`);
|
|
1173
1252
|
function Columns(props) {
|
|
1174
1253
|
const [gutterSize, setGutterSize] = createSignal(typeof props.space === "number" ? props.space || 0 : 20);
|
|
1175
1254
|
const [cols, setCols] = createSignal(props.columns || []);
|
|
@@ -1210,7 +1289,13 @@ function Columns(props) {
|
|
|
1210
1289
|
const mobileWidth = "100%";
|
|
1211
1290
|
const mobileMarginLeft = 0;
|
|
1212
1291
|
const marginLeftKey = "margin-left";
|
|
1292
|
+
const sharedStyles = {
|
|
1293
|
+
display: "flex",
|
|
1294
|
+
flexDirection: "column",
|
|
1295
|
+
alignItems: "stretch"
|
|
1296
|
+
};
|
|
1213
1297
|
return {
|
|
1298
|
+
...sharedStyles,
|
|
1214
1299
|
width,
|
|
1215
1300
|
[marginLeftKey]: gutterPixels,
|
|
1216
1301
|
"--column-width-mobile": getMobileStyle({
|
|
@@ -1263,7 +1348,7 @@ function Columns(props) {
|
|
|
1263
1348
|
`;
|
|
1264
1349
|
}
|
|
1265
1350
|
return (() => {
|
|
1266
|
-
const _el$ = _tmpl$
|
|
1351
|
+
const _el$ = _tmpl$2();
|
|
1267
1352
|
spread(_el$, mergeProps({
|
|
1268
1353
|
get ["class"]() {
|
|
1269
1354
|
return `builder-columns ${props.builderBlock.id}-breakpoints ` + css({
|
|
@@ -1291,52 +1376,56 @@ function Columns(props) {
|
|
|
1291
1376
|
},
|
|
1292
1377
|
children: (column, _index) => {
|
|
1293
1378
|
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
|
-
|
|
1379
|
+
return createComponent(dynamic_renderer_default, {
|
|
1380
|
+
key: index,
|
|
1381
|
+
get TagName() {
|
|
1382
|
+
return column.link ? props.builderLinkComponent || "a" : "div";
|
|
1383
|
+
},
|
|
1384
|
+
actionAttributes: {},
|
|
1385
|
+
get attributes() {
|
|
1386
|
+
return {
|
|
1387
|
+
...{},
|
|
1388
|
+
...column.link ? {
|
|
1389
|
+
href: column.link
|
|
1390
|
+
} : {},
|
|
1391
|
+
[getClassPropName()]: "builder-column",
|
|
1392
|
+
style: mapStyleObjToStrIfNeeded(columnCssVars(index))
|
|
1393
|
+
};
|
|
1394
|
+
},
|
|
1395
|
+
get children() {
|
|
1396
|
+
return createComponent(blocks_default, {
|
|
1397
|
+
path: `component.options.columns.${index}.blocks`,
|
|
1398
|
+
get parent() {
|
|
1399
|
+
return props.builderBlock.id;
|
|
1400
|
+
},
|
|
1401
|
+
styleProp: {
|
|
1402
|
+
flexGrow: "1"
|
|
1403
|
+
},
|
|
1404
|
+
get context() {
|
|
1405
|
+
return props.builderContext;
|
|
1406
|
+
},
|
|
1407
|
+
get registeredComponents() {
|
|
1408
|
+
return props.builderComponents;
|
|
1409
|
+
},
|
|
1410
|
+
get linkComponent() {
|
|
1411
|
+
return props.builderLinkComponent;
|
|
1412
|
+
},
|
|
1413
|
+
get blocks() {
|
|
1414
|
+
return column.blocks;
|
|
1415
|
+
}
|
|
1416
|
+
});
|
|
1417
|
+
}
|
|
1418
|
+
});
|
|
1330
1419
|
}
|
|
1331
1420
|
}), null);
|
|
1332
1421
|
return _el$;
|
|
1333
1422
|
})();
|
|
1334
1423
|
}
|
|
1335
1424
|
var columns_default = Columns;
|
|
1336
|
-
var _tmpl$
|
|
1425
|
+
var _tmpl$3 = /* @__PURE__ */ template(`<span>`);
|
|
1337
1426
|
function FragmentComponent(props) {
|
|
1338
1427
|
return (() => {
|
|
1339
|
-
const _el$ = _tmpl$
|
|
1428
|
+
const _el$ = _tmpl$3();
|
|
1340
1429
|
insert(_el$, () => props.children);
|
|
1341
1430
|
return _el$;
|
|
1342
1431
|
})();
|
|
@@ -1391,7 +1480,7 @@ function getSrcSet(url) {
|
|
|
1391
1480
|
}
|
|
1392
1481
|
|
|
1393
1482
|
// src/blocks/image/image.tsx
|
|
1394
|
-
var _tmpl$
|
|
1483
|
+
var _tmpl$4 = /* @__PURE__ */ template(`<source type=image/webp>`);
|
|
1395
1484
|
var _tmpl$22 = /* @__PURE__ */ template(`<picture><img loading=lazy>`);
|
|
1396
1485
|
var _tmpl$32 = /* @__PURE__ */ template(`<div>`);
|
|
1397
1486
|
function Image(props) {
|
|
@@ -1437,7 +1526,7 @@ function Image(props) {
|
|
|
1437
1526
|
return webpSrcSet();
|
|
1438
1527
|
},
|
|
1439
1528
|
get children() {
|
|
1440
|
-
const _el$2 = _tmpl$
|
|
1529
|
+
const _el$2 = _tmpl$4();
|
|
1441
1530
|
effect(() => setAttribute(_el$2, "srcset", webpSrcSet()));
|
|
1442
1531
|
return _el$2;
|
|
1443
1532
|
}
|
|
@@ -1519,10 +1608,10 @@ function Image(props) {
|
|
|
1519
1608
|
})];
|
|
1520
1609
|
}
|
|
1521
1610
|
var image_default = Image;
|
|
1522
|
-
var _tmpl$
|
|
1611
|
+
var _tmpl$5 = /* @__PURE__ */ template(`<section>`);
|
|
1523
1612
|
function SectionComponent(props) {
|
|
1524
1613
|
return (() => {
|
|
1525
|
-
const _el$ = _tmpl$
|
|
1614
|
+
const _el$ = _tmpl$5();
|
|
1526
1615
|
spread(_el$, mergeProps({}, () => props.attributes, {
|
|
1527
1616
|
get style() {
|
|
1528
1617
|
return {
|
|
@@ -2016,7 +2105,7 @@ var componentInfo3 = {
|
|
|
2016
2105
|
advanced: true
|
|
2017
2106
|
}]
|
|
2018
2107
|
};
|
|
2019
|
-
var _tmpl$
|
|
2108
|
+
var _tmpl$6 = /* @__PURE__ */ template(`<div>`);
|
|
2020
2109
|
function CustomCode(props) {
|
|
2021
2110
|
const [scriptsInserted, setScriptsInserted] = createSignal([]);
|
|
2022
2111
|
const [scriptsRun, setScriptsRun] = createSignal([]);
|
|
@@ -2050,7 +2139,7 @@ function CustomCode(props) {
|
|
|
2050
2139
|
}
|
|
2051
2140
|
});
|
|
2052
2141
|
return (() => {
|
|
2053
|
-
const _el$ = _tmpl$
|
|
2142
|
+
const _el$ = _tmpl$6();
|
|
2054
2143
|
const _ref$ = elementRef;
|
|
2055
2144
|
typeof _ref$ === "function" ? use(_ref$, _el$) : elementRef = _el$;
|
|
2056
2145
|
effect((_p$) => {
|
|
@@ -2110,7 +2199,7 @@ var SCRIPT_MIME_TYPES = ["text/javascript", "application/javascript", "applicati
|
|
|
2110
2199
|
var isJsScript = (script) => SCRIPT_MIME_TYPES.includes(script.type);
|
|
2111
2200
|
|
|
2112
2201
|
// src/blocks/embed/embed.tsx
|
|
2113
|
-
var _tmpl$
|
|
2202
|
+
var _tmpl$7 = /* @__PURE__ */ template(`<div class=builder-embed>`);
|
|
2114
2203
|
function Embed(props) {
|
|
2115
2204
|
const [scriptsInserted, setScriptsInserted] = createSignal([]);
|
|
2116
2205
|
const [scriptsRun, setScriptsRun] = createSignal([]);
|
|
@@ -2145,7 +2234,7 @@ function Embed(props) {
|
|
|
2145
2234
|
}
|
|
2146
2235
|
createEffect(on(() => [elem, ranInitFn()], onUpdateFn_0));
|
|
2147
2236
|
return (() => {
|
|
2148
|
-
const _el$ = _tmpl$
|
|
2237
|
+
const _el$ = _tmpl$7();
|
|
2149
2238
|
const _ref$ = elem;
|
|
2150
2239
|
typeof _ref$ === "function" ? use(_ref$, _el$) : elem = _el$;
|
|
2151
2240
|
effect(() => _el$.innerHTML = props.content);
|
|
@@ -2301,10 +2390,10 @@ var componentInfo7 = {
|
|
|
2301
2390
|
noWrap: true,
|
|
2302
2391
|
static: true
|
|
2303
2392
|
};
|
|
2304
|
-
var _tmpl$
|
|
2393
|
+
var _tmpl$8 = /* @__PURE__ */ template(`<img>`);
|
|
2305
2394
|
function ImgComponent(props) {
|
|
2306
2395
|
return (() => {
|
|
2307
|
-
const _el$ = _tmpl$
|
|
2396
|
+
const _el$ = _tmpl$8();
|
|
2308
2397
|
spread(_el$, mergeProps({
|
|
2309
2398
|
get style() {
|
|
2310
2399
|
return {
|
|
@@ -2384,10 +2473,10 @@ var componentInfo9 = {
|
|
|
2384
2473
|
defaultValue: "children"
|
|
2385
2474
|
}]
|
|
2386
2475
|
};
|
|
2387
|
-
var _tmpl$
|
|
2476
|
+
var _tmpl$9 = /* @__PURE__ */ template(`<div>`);
|
|
2388
2477
|
function Slot(props) {
|
|
2389
2478
|
return (() => {
|
|
2390
|
-
const _el$ = _tmpl$
|
|
2479
|
+
const _el$ = _tmpl$9();
|
|
2391
2480
|
_el$.style.setProperty("pointer-events", "auto");
|
|
2392
2481
|
spread(_el$, mergeProps(() => !props.builderContext.context?.symbolId && {
|
|
2393
2482
|
"builder-slot": props.name
|
|
@@ -2467,10 +2556,10 @@ var componentInfo11 = {
|
|
|
2467
2556
|
textAlign: "center"
|
|
2468
2557
|
}
|
|
2469
2558
|
};
|
|
2470
|
-
var _tmpl$
|
|
2559
|
+
var _tmpl$10 = /* @__PURE__ */ template(`<div class=builder-text>`);
|
|
2471
2560
|
function Text(props) {
|
|
2472
2561
|
return (() => {
|
|
2473
|
-
const _el$ = _tmpl$
|
|
2562
|
+
const _el$ = _tmpl$10();
|
|
2474
2563
|
_el$.style.setProperty("outline", "none");
|
|
2475
2564
|
effect(() => _el$.innerHTML = props.text?.toString() || "");
|
|
2476
2565
|
return _el$;
|
|
@@ -2561,7 +2650,7 @@ var componentInfo12 = {
|
|
|
2561
2650
|
advanced: true
|
|
2562
2651
|
}]
|
|
2563
2652
|
};
|
|
2564
|
-
var _tmpl$
|
|
2653
|
+
var _tmpl$11 = /* @__PURE__ */ template(`<source type=video/mp4>`);
|
|
2565
2654
|
var _tmpl$23 = /* @__PURE__ */ template(`<div>`);
|
|
2566
2655
|
var _tmpl$33 = /* @__PURE__ */ template(`<div><video class=builder-video>`);
|
|
2567
2656
|
function Video(props) {
|
|
@@ -2624,7 +2713,7 @@ function Video(props) {
|
|
|
2624
2713
|
return !props.lazyLoad;
|
|
2625
2714
|
},
|
|
2626
2715
|
get children() {
|
|
2627
|
-
const _el$3 = _tmpl$
|
|
2716
|
+
const _el$3 = _tmpl$11();
|
|
2628
2717
|
effect(() => setAttribute(_el$3, "src", props.video));
|
|
2629
2718
|
return _el$3;
|
|
2630
2719
|
}
|
|
@@ -2786,10 +2875,10 @@ var getUpdateVariantVisibilityScript = ({
|
|
|
2786
2875
|
}) => `window.${UPDATE_VARIANT_VISIBILITY_SCRIPT_FN_NAME}(
|
|
2787
2876
|
"${variationId}", "${contentId}", ${isHydrationTarget}
|
|
2788
2877
|
)`;
|
|
2789
|
-
var _tmpl$
|
|
2878
|
+
var _tmpl$12 = /* @__PURE__ */ template(`<script>`);
|
|
2790
2879
|
function InlinedScript(props) {
|
|
2791
2880
|
return (() => {
|
|
2792
|
-
const _el$ = _tmpl$
|
|
2881
|
+
const _el$ = _tmpl$12();
|
|
2793
2882
|
effect((_p$) => {
|
|
2794
2883
|
const _v$ = props.scriptStr, _v$2 = props.id || "";
|
|
2795
2884
|
_v$ !== _p$._v$ && (_el$.innerHTML = _p$._v$ = _v$);
|
|
@@ -3291,7 +3380,7 @@ var getInteractionPropertiesForEvent = (event) => {
|
|
|
3291
3380
|
};
|
|
3292
3381
|
|
|
3293
3382
|
// src/constants/sdk-version.ts
|
|
3294
|
-
var SDK_VERSION = "0.12.
|
|
3383
|
+
var SDK_VERSION = "0.12.5";
|
|
3295
3384
|
|
|
3296
3385
|
// src/functions/register.ts
|
|
3297
3386
|
var registry = {};
|
|
@@ -3978,6 +4067,9 @@ function ContentComponent(props) {
|
|
|
3978
4067
|
get contentWrapperProps() {
|
|
3979
4068
|
return props.contentWrapperProps;
|
|
3980
4069
|
},
|
|
4070
|
+
get linkComponent() {
|
|
4071
|
+
return props.linkComponent;
|
|
4072
|
+
},
|
|
3981
4073
|
get trustedHosts() {
|
|
3982
4074
|
return props.trustedHosts;
|
|
3983
4075
|
}
|
|
@@ -4020,6 +4112,9 @@ function ContentComponent(props) {
|
|
|
4020
4112
|
},
|
|
4021
4113
|
get registeredComponents() {
|
|
4022
4114
|
return registeredComponents();
|
|
4115
|
+
},
|
|
4116
|
+
get linkComponent() {
|
|
4117
|
+
return props.linkComponent;
|
|
4023
4118
|
}
|
|
4024
4119
|
})];
|
|
4025
4120
|
}
|
|
@@ -4113,6 +4208,9 @@ function ContentVariants(props) {
|
|
|
4113
4208
|
get customComponents() {
|
|
4114
4209
|
return props.customComponents;
|
|
4115
4210
|
},
|
|
4211
|
+
get linkComponent() {
|
|
4212
|
+
return props.linkComponent;
|
|
4213
|
+
},
|
|
4116
4214
|
get canTrack() {
|
|
4117
4215
|
return props.canTrack;
|
|
4118
4216
|
},
|
|
@@ -4170,6 +4268,9 @@ function ContentVariants(props) {
|
|
|
4170
4268
|
get customComponents() {
|
|
4171
4269
|
return props.customComponents;
|
|
4172
4270
|
},
|
|
4271
|
+
get linkComponent() {
|
|
4272
|
+
return props.linkComponent;
|
|
4273
|
+
},
|
|
4173
4274
|
get canTrack() {
|
|
4174
4275
|
return props.canTrack;
|
|
4175
4276
|
},
|
|
@@ -4229,11 +4330,11 @@ var fetchSymbolContent = async ({
|
|
|
4229
4330
|
};
|
|
4230
4331
|
|
|
4231
4332
|
// src/blocks/symbol/symbol.tsx
|
|
4232
|
-
var _tmpl$
|
|
4333
|
+
var _tmpl$13 = /* @__PURE__ */ template(`<div>`);
|
|
4233
4334
|
function Symbol(props) {
|
|
4234
4335
|
const [contentToUse, setContentToUse] = createSignal(props.symbol?.content);
|
|
4235
4336
|
function className() {
|
|
4236
|
-
return [...[props.attributes
|
|
4337
|
+
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
4338
|
}
|
|
4238
4339
|
function setContent() {
|
|
4239
4340
|
if (contentToUse())
|
|
@@ -4255,7 +4356,7 @@ function Symbol(props) {
|
|
|
4255
4356
|
}
|
|
4256
4357
|
createEffect(on(() => [props.symbol], onUpdateFn_0));
|
|
4257
4358
|
return (() => {
|
|
4258
|
-
const _el$ = _tmpl$
|
|
4359
|
+
const _el$ = _tmpl$13();
|
|
4259
4360
|
spread(_el$, mergeProps({
|
|
4260
4361
|
get ["class"]() {
|
|
4261
4362
|
return className();
|
|
@@ -4290,6 +4391,9 @@ function Symbol(props) {
|
|
|
4290
4391
|
},
|
|
4291
4392
|
get content() {
|
|
4292
4393
|
return contentToUse();
|
|
4394
|
+
},
|
|
4395
|
+
get linkComponent() {
|
|
4396
|
+
return props.builderLinkComponent;
|
|
4293
4397
|
}
|
|
4294
4398
|
}));
|
|
4295
4399
|
return _el$;
|