@builder.io/sdk-solid 1.0.23 → 1.0.25
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 +1 -1
- package/lib/browser/dev.js +458 -178
- package/lib/browser/dev.jsx +463 -227
- package/lib/browser/index.js +458 -178
- package/lib/browser/index.jsx +463 -227
- package/lib/edge/dev.js +458 -178
- package/lib/edge/dev.jsx +463 -227
- package/lib/edge/index.js +458 -178
- package/lib/edge/index.jsx +463 -227
- package/lib/node/dev.js +482 -192
- package/lib/node/dev.jsx +487 -241
- package/lib/node/index.js +481 -191
- package/lib/node/index.jsx +486 -240
- package/package.json +1 -1
package/lib/node/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createComponent, spread, mergeProps, insert, effect, setAttribute, className, style, template, Dynamic, memo, use } from 'solid-js/web';
|
|
1
|
+
import { delegateEvents, createComponent, spread, mergeProps, insert, effect, setAttribute, className, style, template, Dynamic, memo, use } from 'solid-js/web';
|
|
2
2
|
import { createContext, useContext, Show, For, createSignal, createMemo, onMount, createEffect, on } from 'solid-js';
|
|
3
3
|
import { css } from 'solid-styled-components';
|
|
4
4
|
import { createRequire } from 'node:module';
|
|
@@ -69,25 +69,29 @@ var getClassPropName = () => {
|
|
|
69
69
|
case "vue":
|
|
70
70
|
case "solid":
|
|
71
71
|
case "qwik":
|
|
72
|
+
case "angular":
|
|
72
73
|
return "class";
|
|
73
74
|
}
|
|
74
75
|
};
|
|
75
76
|
|
|
76
77
|
// src/blocks/button/button.tsx
|
|
77
78
|
function Button(props) {
|
|
79
|
+
function attrs() {
|
|
80
|
+
return {
|
|
81
|
+
...props.attributes,
|
|
82
|
+
[getClassPropName()]: `${props.link ? "" : "builder-button"} ${props.attributes[getClassPropName()] || ""}`,
|
|
83
|
+
...props.link ? {
|
|
84
|
+
href: props.link,
|
|
85
|
+
target: props.openLinkInNewTab ? "_blank" : void 0,
|
|
86
|
+
role: "link"
|
|
87
|
+
} : {
|
|
88
|
+
role: "button"
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
}
|
|
78
92
|
return createComponent(dynamic_renderer_default, {
|
|
79
93
|
get attributes() {
|
|
80
|
-
return
|
|
81
|
-
...props.attributes,
|
|
82
|
-
[getClassPropName()]: `${props.link ? "" : "builder-button"} ${props.attributes[getClassPropName()] || ""}`,
|
|
83
|
-
...props.link ? {
|
|
84
|
-
href: props.link,
|
|
85
|
-
target: props.openLinkInNewTab ? "_blank" : void 0,
|
|
86
|
-
role: "link"
|
|
87
|
-
} : {
|
|
88
|
-
role: "button"
|
|
89
|
-
}
|
|
90
|
-
};
|
|
94
|
+
return attrs();
|
|
91
95
|
},
|
|
92
96
|
get TagName() {
|
|
93
97
|
return props.link ? props.builderLinkComponent || "a" : "button";
|
|
@@ -372,16 +376,17 @@ function theFunction() {
|
|
|
372
376
|
${code}
|
|
373
377
|
}
|
|
374
378
|
|
|
375
|
-
|
|
379
|
+
const output = theFunction()
|
|
376
380
|
|
|
377
381
|
if (typeof output === 'object' && output !== null) {
|
|
378
|
-
|
|
382
|
+
return JSON.stringify(output.copySync ? output.copySync() : output);
|
|
383
|
+
} else {
|
|
384
|
+
return output;
|
|
379
385
|
}
|
|
380
|
-
|
|
381
|
-
output;
|
|
382
386
|
`;
|
|
383
387
|
};
|
|
384
388
|
var IVM_INSTANCE = null;
|
|
389
|
+
var IVM_CONTEXT = null;
|
|
385
390
|
var getIvm = () => {
|
|
386
391
|
try {
|
|
387
392
|
if (IVM_INSTANCE)
|
|
@@ -401,12 +406,25 @@ var getIvm = () => {
|
|
|
401
406
|
Please see the documentation for more information: https://builder.io/c/docs/integration-tips#enabling-data-bindings-in-node-environments
|
|
402
407
|
`);
|
|
403
408
|
};
|
|
404
|
-
|
|
409
|
+
function setIsolateContext(options = {
|
|
410
|
+
memoryLimit: 128
|
|
411
|
+
}) {
|
|
405
412
|
const ivm = getIvm();
|
|
406
|
-
const isolate = new ivm.Isolate(
|
|
407
|
-
|
|
413
|
+
const isolate = new ivm.Isolate(options);
|
|
414
|
+
const context = isolate.createContextSync();
|
|
415
|
+
const jail = context.global;
|
|
416
|
+
jail.setSync("global", jail.derefInto());
|
|
417
|
+
jail.setSync("log", function(...logArgs) {
|
|
408
418
|
});
|
|
409
|
-
|
|
419
|
+
jail.setSync(INJECTED_IVM_GLOBAL, ivm);
|
|
420
|
+
IVM_CONTEXT = context;
|
|
421
|
+
return context;
|
|
422
|
+
}
|
|
423
|
+
var getIsolateContext = () => {
|
|
424
|
+
if (IVM_CONTEXT)
|
|
425
|
+
return IVM_CONTEXT;
|
|
426
|
+
const context = setIsolateContext();
|
|
427
|
+
return context;
|
|
410
428
|
};
|
|
411
429
|
var runInNode = ({
|
|
412
430
|
code,
|
|
@@ -430,9 +448,6 @@ var runInNode = ({
|
|
|
430
448
|
});
|
|
431
449
|
const isolateContext = getIsolateContext();
|
|
432
450
|
const jail = isolateContext.global;
|
|
433
|
-
jail.setSync("global", jail.derefInto());
|
|
434
|
-
jail.setSync("log", function(...logArgs) {
|
|
435
|
-
});
|
|
436
451
|
jail.setSync(BUILDER_SET_STATE_NAME, function(key, value) {
|
|
437
452
|
set(rootState, key, value);
|
|
438
453
|
rootSetState?.(rootState);
|
|
@@ -447,12 +462,11 @@ var runInNode = ({
|
|
|
447
462
|
) : null;
|
|
448
463
|
jail.setSync(getSyncValName(key), val);
|
|
449
464
|
});
|
|
450
|
-
jail.setSync(INJECTED_IVM_GLOBAL, ivm);
|
|
451
465
|
const evalStr = processCode({
|
|
452
466
|
code,
|
|
453
467
|
args
|
|
454
468
|
});
|
|
455
|
-
const resultStr = isolateContext.
|
|
469
|
+
const resultStr = isolateContext.evalClosureSync(evalStr);
|
|
456
470
|
try {
|
|
457
471
|
const res = JSON.parse(resultStr);
|
|
458
472
|
return res;
|
|
@@ -852,6 +866,7 @@ function mapStyleObjToStrIfNeeded(style) {
|
|
|
852
866
|
case "svelte":
|
|
853
867
|
case "vue":
|
|
854
868
|
case "solid":
|
|
869
|
+
case "angular":
|
|
855
870
|
return convertStyleMapToCSSArray(style).join(" ");
|
|
856
871
|
case "qwik":
|
|
857
872
|
case "reactNative":
|
|
@@ -924,6 +939,12 @@ var getRepeatItemData = ({
|
|
|
924
939
|
}));
|
|
925
940
|
return repeatArray;
|
|
926
941
|
};
|
|
942
|
+
var shouldPassLinkComponent = (block) => {
|
|
943
|
+
return block && (block.isRSC || ["Core:Button", "Symbol", "Columns", "Form:Form", "Builder: Tabs"].includes(block.name));
|
|
944
|
+
};
|
|
945
|
+
var shouldPassRegisteredComponents = (block) => {
|
|
946
|
+
return block && (block.isRSC || ["Symbol", "Columns", "Form:Form", "Builder: Tabs"].includes(block.name));
|
|
947
|
+
};
|
|
927
948
|
|
|
928
949
|
// src/constants/device-sizes.ts
|
|
929
950
|
var SIZES = {
|
|
@@ -1180,21 +1201,24 @@ function BlockWrapper(props) {
|
|
|
1180
1201
|
}
|
|
1181
1202
|
var block_wrapper_default = BlockWrapper;
|
|
1182
1203
|
function InteractiveElement(props) {
|
|
1204
|
+
const attributes = createMemo(() => {
|
|
1205
|
+
return props.includeBlockProps ? {
|
|
1206
|
+
...getBlockProperties({
|
|
1207
|
+
block: props.block,
|
|
1208
|
+
context: props.context
|
|
1209
|
+
}),
|
|
1210
|
+
...getBlockActions({
|
|
1211
|
+
block: props.block,
|
|
1212
|
+
rootState: props.context.rootState,
|
|
1213
|
+
rootSetState: props.context.rootSetState,
|
|
1214
|
+
localState: props.context.localState,
|
|
1215
|
+
context: props.context.context
|
|
1216
|
+
})
|
|
1217
|
+
} : {};
|
|
1218
|
+
});
|
|
1183
1219
|
return createComponent(Dynamic, mergeProps(() => props.wrapperProps, {
|
|
1184
1220
|
get attributes() {
|
|
1185
|
-
return
|
|
1186
|
-
...getBlockProperties({
|
|
1187
|
-
block: props.block,
|
|
1188
|
-
context: props.context
|
|
1189
|
-
}),
|
|
1190
|
-
...getBlockActions({
|
|
1191
|
-
block: props.block,
|
|
1192
|
-
rootState: props.context.rootState,
|
|
1193
|
-
rootSetState: props.context.rootSetState,
|
|
1194
|
-
localState: props.context.localState,
|
|
1195
|
-
context: props.context.context
|
|
1196
|
-
})
|
|
1197
|
-
} : {};
|
|
1221
|
+
return attributes();
|
|
1198
1222
|
},
|
|
1199
1223
|
get component() {
|
|
1200
1224
|
return props.Wrapper;
|
|
@@ -1369,10 +1393,10 @@ function Block(props) {
|
|
|
1369
1393
|
componentOptions: {
|
|
1370
1394
|
...getBlockComponentOptions(processedBlock()),
|
|
1371
1395
|
builderContext: props.context,
|
|
1372
|
-
...
|
|
1396
|
+
...shouldPassLinkComponent(blockComponent()) ? {
|
|
1373
1397
|
builderLinkComponent: props.linkComponent
|
|
1374
1398
|
} : {},
|
|
1375
|
-
...
|
|
1399
|
+
...shouldPassRegisteredComponents(blockComponent()) ? {
|
|
1376
1400
|
builderComponents: props.registeredComponents
|
|
1377
1401
|
} : {}
|
|
1378
1402
|
},
|
|
@@ -1664,6 +1688,11 @@ function Blocks(props) {
|
|
|
1664
1688
|
}
|
|
1665
1689
|
var blocks_default = Blocks;
|
|
1666
1690
|
|
|
1691
|
+
// src/blocks/columns/helpers.ts
|
|
1692
|
+
var getColumnsClass = (id) => {
|
|
1693
|
+
return `builder-columns ${id}-breakpoints`;
|
|
1694
|
+
};
|
|
1695
|
+
|
|
1667
1696
|
// src/blocks/columns/columns.tsx
|
|
1668
1697
|
var _tmpl$2 = /* @__PURE__ */ template(`<div>`);
|
|
1669
1698
|
function Columns(props) {
|
|
@@ -1671,6 +1700,9 @@ function Columns(props) {
|
|
|
1671
1700
|
const [cols, setCols] = createSignal(props.columns || []);
|
|
1672
1701
|
const [stackAt, setStackAt] = createSignal(props.stackColumnsAt || "tablet");
|
|
1673
1702
|
const [flexDir, setFlexDir] = createSignal(props.stackColumnsAt === "never" ? "row" : props.reverseColumnsWhenStacked ? "column-reverse" : "column");
|
|
1703
|
+
function getTagName(column) {
|
|
1704
|
+
return column.link ? props.builderLinkComponent || "a" : "div";
|
|
1705
|
+
}
|
|
1674
1706
|
function getWidth(index) {
|
|
1675
1707
|
return cols()[index]?.width || 100 / cols().length;
|
|
1676
1708
|
}
|
|
@@ -1690,7 +1722,7 @@ function Columns(props) {
|
|
|
1690
1722
|
}) {
|
|
1691
1723
|
return stackAt() === "never" ? desktopStyle : stackedStyle;
|
|
1692
1724
|
}
|
|
1693
|
-
|
|
1725
|
+
function columnsCssVars() {
|
|
1694
1726
|
return {
|
|
1695
1727
|
"--flex-dir": flexDir(),
|
|
1696
1728
|
"--flex-dir-tablet": getTabletStyle({
|
|
@@ -1698,7 +1730,7 @@ function Columns(props) {
|
|
|
1698
1730
|
desktopStyle: "row"
|
|
1699
1731
|
})
|
|
1700
1732
|
};
|
|
1701
|
-
}
|
|
1733
|
+
}
|
|
1702
1734
|
function columnCssVars(index) {
|
|
1703
1735
|
const gutter = index === 0 ? 0 : gutterSize();
|
|
1704
1736
|
const width = getColumnCssWidth(index);
|
|
@@ -1737,7 +1769,7 @@ function Columns(props) {
|
|
|
1737
1769
|
const breakpointSizes = getSizesForBreakpoints(props.builderContext.content?.meta?.breakpoints || {});
|
|
1738
1770
|
return breakpointSizes[size].max;
|
|
1739
1771
|
}
|
|
1740
|
-
|
|
1772
|
+
function columnsStyles() {
|
|
1741
1773
|
return `
|
|
1742
1774
|
@media (max-width: ${getWidthForBreakpointSize("medium")}px) {
|
|
1743
1775
|
.${props.builderBlock.id}-breakpoints {
|
|
@@ -1763,12 +1795,22 @@ function Columns(props) {
|
|
|
1763
1795
|
}
|
|
1764
1796
|
},
|
|
1765
1797
|
`;
|
|
1766
|
-
}
|
|
1798
|
+
}
|
|
1799
|
+
function getAttributes(column, index) {
|
|
1800
|
+
return {
|
|
1801
|
+
...{},
|
|
1802
|
+
...column.link ? {
|
|
1803
|
+
href: column.link
|
|
1804
|
+
} : {},
|
|
1805
|
+
[getClassPropName()]: "builder-column",
|
|
1806
|
+
style: mapStyleObjToStrIfNeeded(columnCssVars(index))
|
|
1807
|
+
};
|
|
1808
|
+
}
|
|
1767
1809
|
return (() => {
|
|
1768
1810
|
const _el$ = _tmpl$2();
|
|
1769
1811
|
spread(_el$, mergeProps({
|
|
1770
1812
|
get ["class"]() {
|
|
1771
|
-
return
|
|
1813
|
+
return getColumnsClass(props.builderBlock?.id) + " " + css({
|
|
1772
1814
|
display: "flex",
|
|
1773
1815
|
lineHeight: "normal"
|
|
1774
1816
|
});
|
|
@@ -1797,18 +1839,11 @@ function Columns(props) {
|
|
|
1797
1839
|
return createComponent(dynamic_renderer_default, {
|
|
1798
1840
|
key: index,
|
|
1799
1841
|
get TagName() {
|
|
1800
|
-
return column
|
|
1842
|
+
return getTagName(column);
|
|
1801
1843
|
},
|
|
1802
1844
|
actionAttributes: {},
|
|
1803
1845
|
get attributes() {
|
|
1804
|
-
return
|
|
1805
|
-
...{},
|
|
1806
|
-
...column.link ? {
|
|
1807
|
-
href: column.link
|
|
1808
|
-
} : {},
|
|
1809
|
-
[getClassPropName()]: "builder-column",
|
|
1810
|
-
style: mapStyleObjToStrIfNeeded(columnCssVars(index))
|
|
1811
|
-
};
|
|
1846
|
+
return getAttributes(column, index);
|
|
1812
1847
|
},
|
|
1813
1848
|
get children() {
|
|
1814
1849
|
return createComponent(blocks_default, {
|
|
@@ -2006,7 +2041,7 @@ function Image(props) {
|
|
|
2006
2041
|
}
|
|
2007
2042
|
}), createComponent(Show, {
|
|
2008
2043
|
get when() {
|
|
2009
|
-
return !props.fitContent && props.children;
|
|
2044
|
+
return !props.fitContent && props.builderBlock?.children?.length;
|
|
2010
2045
|
},
|
|
2011
2046
|
get children() {
|
|
2012
2047
|
const _el$5 = _tmpl$32();
|
|
@@ -2750,8 +2785,246 @@ var componentInfo7 = {
|
|
|
2750
2785
|
}]
|
|
2751
2786
|
};
|
|
2752
2787
|
|
|
2753
|
-
// src/blocks/
|
|
2788
|
+
// src/blocks/tabs/component-info.ts
|
|
2789
|
+
var defaultTab = {
|
|
2790
|
+
"@type": "@builder.io/sdk:Element",
|
|
2791
|
+
responsiveStyles: {
|
|
2792
|
+
large: {
|
|
2793
|
+
paddingLeft: "20px",
|
|
2794
|
+
paddingRight: "20px",
|
|
2795
|
+
paddingTop: "10px",
|
|
2796
|
+
paddingBottom: "10px",
|
|
2797
|
+
minWidth: "100px",
|
|
2798
|
+
textAlign: "center",
|
|
2799
|
+
display: "flex",
|
|
2800
|
+
flexDirection: "column",
|
|
2801
|
+
cursor: "pointer",
|
|
2802
|
+
userSelect: "none"
|
|
2803
|
+
}
|
|
2804
|
+
},
|
|
2805
|
+
component: {
|
|
2806
|
+
name: "Text",
|
|
2807
|
+
options: {
|
|
2808
|
+
text: "New tab"
|
|
2809
|
+
}
|
|
2810
|
+
}
|
|
2811
|
+
};
|
|
2812
|
+
var defaultElement = {
|
|
2813
|
+
"@type": "@builder.io/sdk:Element",
|
|
2814
|
+
responsiveStyles: {
|
|
2815
|
+
large: {
|
|
2816
|
+
height: "200px",
|
|
2817
|
+
display: "flex",
|
|
2818
|
+
marginTop: "20px",
|
|
2819
|
+
flexDirection: "column"
|
|
2820
|
+
}
|
|
2821
|
+
},
|
|
2822
|
+
component: {
|
|
2823
|
+
name: "Text",
|
|
2824
|
+
options: {
|
|
2825
|
+
text: "New tab content "
|
|
2826
|
+
}
|
|
2827
|
+
}
|
|
2828
|
+
};
|
|
2754
2829
|
var componentInfo8 = {
|
|
2830
|
+
name: "Builder: Tabs",
|
|
2831
|
+
inputs: [{
|
|
2832
|
+
name: "tabs",
|
|
2833
|
+
type: "list",
|
|
2834
|
+
broadcast: true,
|
|
2835
|
+
subFields: [{
|
|
2836
|
+
name: "label",
|
|
2837
|
+
type: "uiBlocks",
|
|
2838
|
+
hideFromUI: true,
|
|
2839
|
+
defaultValue: [defaultTab]
|
|
2840
|
+
}, {
|
|
2841
|
+
name: "content",
|
|
2842
|
+
type: "uiBlocks",
|
|
2843
|
+
hideFromUI: true,
|
|
2844
|
+
defaultValue: [defaultElement]
|
|
2845
|
+
}],
|
|
2846
|
+
defaultValue: [{
|
|
2847
|
+
label: [{
|
|
2848
|
+
...defaultTab,
|
|
2849
|
+
component: {
|
|
2850
|
+
name: "Text",
|
|
2851
|
+
options: {
|
|
2852
|
+
text: "Tab 1"
|
|
2853
|
+
}
|
|
2854
|
+
}
|
|
2855
|
+
}],
|
|
2856
|
+
content: [{
|
|
2857
|
+
...defaultElement,
|
|
2858
|
+
component: {
|
|
2859
|
+
name: "Text",
|
|
2860
|
+
options: {
|
|
2861
|
+
text: "Tab 1 content"
|
|
2862
|
+
}
|
|
2863
|
+
}
|
|
2864
|
+
}]
|
|
2865
|
+
}, {
|
|
2866
|
+
label: [{
|
|
2867
|
+
...defaultTab,
|
|
2868
|
+
component: {
|
|
2869
|
+
name: "Text",
|
|
2870
|
+
options: {
|
|
2871
|
+
text: "Tab 2"
|
|
2872
|
+
}
|
|
2873
|
+
}
|
|
2874
|
+
}],
|
|
2875
|
+
content: [{
|
|
2876
|
+
...defaultElement,
|
|
2877
|
+
component: {
|
|
2878
|
+
name: "Text",
|
|
2879
|
+
options: {
|
|
2880
|
+
text: "Tab 2 content"
|
|
2881
|
+
}
|
|
2882
|
+
}
|
|
2883
|
+
}]
|
|
2884
|
+
}]
|
|
2885
|
+
}, {
|
|
2886
|
+
name: "activeTabStyle",
|
|
2887
|
+
type: "uiStyle",
|
|
2888
|
+
helperText: "CSS styles for the active tab",
|
|
2889
|
+
defaultValue: {
|
|
2890
|
+
backgroundColor: "rgba(0, 0, 0, 0.1)"
|
|
2891
|
+
}
|
|
2892
|
+
}, {
|
|
2893
|
+
name: "defaultActiveTab",
|
|
2894
|
+
type: "number",
|
|
2895
|
+
helperText: 'Default tab to open to. Set to "1" for the first tab, "2" for the second, or choose "0" for none',
|
|
2896
|
+
defaultValue: 1,
|
|
2897
|
+
advanced: true
|
|
2898
|
+
}, {
|
|
2899
|
+
name: "collapsible",
|
|
2900
|
+
type: "boolean",
|
|
2901
|
+
helperText: "If on, clicking an open tab closes it so no tabs are active",
|
|
2902
|
+
defaultValue: false,
|
|
2903
|
+
advanced: true
|
|
2904
|
+
}, {
|
|
2905
|
+
name: "tabHeaderLayout",
|
|
2906
|
+
type: "enum",
|
|
2907
|
+
helperText: "Change the layout of the tab headers (uses justify-content)",
|
|
2908
|
+
defaultValue: "flex-start",
|
|
2909
|
+
enum: [{
|
|
2910
|
+
label: "Center",
|
|
2911
|
+
value: "center"
|
|
2912
|
+
}, {
|
|
2913
|
+
label: "Space between",
|
|
2914
|
+
value: "space-between"
|
|
2915
|
+
}, {
|
|
2916
|
+
label: "Space around",
|
|
2917
|
+
value: "space-around"
|
|
2918
|
+
}, {
|
|
2919
|
+
label: "Left",
|
|
2920
|
+
value: "flex-start"
|
|
2921
|
+
}, {
|
|
2922
|
+
label: "Right",
|
|
2923
|
+
value: "flex-end"
|
|
2924
|
+
}]
|
|
2925
|
+
}]
|
|
2926
|
+
};
|
|
2927
|
+
var _tmpl$7 = /* @__PURE__ */ template(`<div>`);
|
|
2928
|
+
var _tmpl$23 = /* @__PURE__ */ template(`<div><div class=builder-tabs-wrap>`);
|
|
2929
|
+
var _tmpl$33 = /* @__PURE__ */ template(`<span>`);
|
|
2930
|
+
function Tabs(props) {
|
|
2931
|
+
const [activeTab, setActiveTab] = createSignal(props.defaultActiveTab ? props.defaultActiveTab - 1 : 0);
|
|
2932
|
+
function activeTabContent(active) {
|
|
2933
|
+
return props.tabs && props.tabs[active].content;
|
|
2934
|
+
}
|
|
2935
|
+
function getActiveTabStyle(index) {
|
|
2936
|
+
return activeTab() === index ? props.activeTabStyle : {};
|
|
2937
|
+
}
|
|
2938
|
+
return (() => {
|
|
2939
|
+
const _el$ = _tmpl$23(), _el$2 = _el$.firstChild;
|
|
2940
|
+
_el$2.style.setProperty("display", "flex");
|
|
2941
|
+
_el$2.style.setProperty("flex-direction", "row");
|
|
2942
|
+
_el$2.style.setProperty("overflow", "auto");
|
|
2943
|
+
insert(_el$2, createComponent(For, {
|
|
2944
|
+
get each() {
|
|
2945
|
+
return props.tabs;
|
|
2946
|
+
},
|
|
2947
|
+
children: (tab, _index) => {
|
|
2948
|
+
const index = _index();
|
|
2949
|
+
return (() => {
|
|
2950
|
+
const _el$4 = _tmpl$33();
|
|
2951
|
+
_el$4.$$click = (event) => {
|
|
2952
|
+
if (index === activeTab() && props.collapsible) {
|
|
2953
|
+
setActiveTab(-1);
|
|
2954
|
+
} else {
|
|
2955
|
+
setActiveTab(index);
|
|
2956
|
+
}
|
|
2957
|
+
};
|
|
2958
|
+
setAttribute(_el$4, "key", index);
|
|
2959
|
+
insert(_el$4, createComponent(blocks_default, {
|
|
2960
|
+
get parent() {
|
|
2961
|
+
return props.builderBlock.id;
|
|
2962
|
+
},
|
|
2963
|
+
path: `component.options.tabs.${index}.label`,
|
|
2964
|
+
get blocks() {
|
|
2965
|
+
return tab.label;
|
|
2966
|
+
},
|
|
2967
|
+
get context() {
|
|
2968
|
+
return props.builderContext;
|
|
2969
|
+
},
|
|
2970
|
+
get registeredComponents() {
|
|
2971
|
+
return props.builderComponents;
|
|
2972
|
+
},
|
|
2973
|
+
get linkComponent() {
|
|
2974
|
+
return props.builderLinkComponent;
|
|
2975
|
+
}
|
|
2976
|
+
}));
|
|
2977
|
+
effect((_p$) => {
|
|
2978
|
+
const _v$ = `builder-tab-wrap ${activeTab() === index ? "builder-tab-active" : ""}`, _v$2 = getActiveTabStyle(index);
|
|
2979
|
+
_v$ !== _p$._v$ && className(_el$4, _p$._v$ = _v$);
|
|
2980
|
+
_p$._v$2 = style(_el$4, _v$2, _p$._v$2);
|
|
2981
|
+
return _p$;
|
|
2982
|
+
}, {
|
|
2983
|
+
_v$: void 0,
|
|
2984
|
+
_v$2: void 0
|
|
2985
|
+
});
|
|
2986
|
+
return _el$4;
|
|
2987
|
+
})();
|
|
2988
|
+
}
|
|
2989
|
+
}));
|
|
2990
|
+
insert(_el$, createComponent(Show, {
|
|
2991
|
+
get when() {
|
|
2992
|
+
return activeTabContent(activeTab());
|
|
2993
|
+
},
|
|
2994
|
+
get children() {
|
|
2995
|
+
const _el$3 = _tmpl$7();
|
|
2996
|
+
insert(_el$3, createComponent(blocks_default, {
|
|
2997
|
+
get parent() {
|
|
2998
|
+
return props.builderBlock.id;
|
|
2999
|
+
},
|
|
3000
|
+
get path() {
|
|
3001
|
+
return `component.options.tabs.${activeTab()}.content`;
|
|
3002
|
+
},
|
|
3003
|
+
get blocks() {
|
|
3004
|
+
return activeTabContent(activeTab());
|
|
3005
|
+
},
|
|
3006
|
+
get context() {
|
|
3007
|
+
return props.builderContext;
|
|
3008
|
+
},
|
|
3009
|
+
get registeredComponents() {
|
|
3010
|
+
return props.builderComponents;
|
|
3011
|
+
},
|
|
3012
|
+
get linkComponent() {
|
|
3013
|
+
return props.builderLinkComponent;
|
|
3014
|
+
}
|
|
3015
|
+
}));
|
|
3016
|
+
return _el$3;
|
|
3017
|
+
}
|
|
3018
|
+
}), null);
|
|
3019
|
+
effect(() => (props.tabHeaderLayout || "flex-start") != null ? _el$2.style.setProperty("justify-content", props.tabHeaderLayout || "flex-start") : _el$2.style.removeProperty("justify-content"));
|
|
3020
|
+
return _el$;
|
|
3021
|
+
})();
|
|
3022
|
+
}
|
|
3023
|
+
var tabs_default = Tabs;
|
|
3024
|
+
delegateEvents(["click"]);
|
|
3025
|
+
|
|
3026
|
+
// src/blocks/text/component-info.ts
|
|
3027
|
+
var componentInfo9 = {
|
|
2755
3028
|
name: "Text",
|
|
2756
3029
|
static: true,
|
|
2757
3030
|
isRSC: true,
|
|
@@ -2770,10 +3043,10 @@ var componentInfo8 = {
|
|
|
2770
3043
|
textAlign: "center"
|
|
2771
3044
|
}
|
|
2772
3045
|
};
|
|
2773
|
-
var _tmpl$
|
|
3046
|
+
var _tmpl$8 = /* @__PURE__ */ template(`<div class=builder-text>`);
|
|
2774
3047
|
function Text(props) {
|
|
2775
3048
|
return (() => {
|
|
2776
|
-
const _el$ = _tmpl$
|
|
3049
|
+
const _el$ = _tmpl$8();
|
|
2777
3050
|
_el$.style.setProperty("outline", "none");
|
|
2778
3051
|
effect(() => _el$.innerHTML = props.text?.toString() || "");
|
|
2779
3052
|
return _el$;
|
|
@@ -2782,7 +3055,7 @@ function Text(props) {
|
|
|
2782
3055
|
var text_default = Text;
|
|
2783
3056
|
|
|
2784
3057
|
// src/blocks/custom-code/component-info.ts
|
|
2785
|
-
var
|
|
3058
|
+
var componentInfo10 = {
|
|
2786
3059
|
name: "Custom Code",
|
|
2787
3060
|
static: true,
|
|
2788
3061
|
requiredPermissions: ["editCode"],
|
|
@@ -2805,7 +3078,7 @@ var componentInfo9 = {
|
|
|
2805
3078
|
advanced: true
|
|
2806
3079
|
}]
|
|
2807
3080
|
};
|
|
2808
|
-
var _tmpl$
|
|
3081
|
+
var _tmpl$9 = /* @__PURE__ */ template(`<div>`);
|
|
2809
3082
|
function CustomCode(props) {
|
|
2810
3083
|
const [scriptsInserted, setScriptsInserted] = createSignal([]);
|
|
2811
3084
|
const [scriptsRun, setScriptsRun] = createSignal([]);
|
|
@@ -2839,7 +3112,7 @@ function CustomCode(props) {
|
|
|
2839
3112
|
}
|
|
2840
3113
|
});
|
|
2841
3114
|
return (() => {
|
|
2842
|
-
const _el$ = _tmpl$
|
|
3115
|
+
const _el$ = _tmpl$9();
|
|
2843
3116
|
const _ref$ = elementRef;
|
|
2844
3117
|
typeof _ref$ === "function" ? use(_ref$, _el$) : elementRef = _el$;
|
|
2845
3118
|
effect((_p$) => {
|
|
@@ -2857,7 +3130,7 @@ function CustomCode(props) {
|
|
|
2857
3130
|
var custom_code_default = CustomCode;
|
|
2858
3131
|
|
|
2859
3132
|
// src/blocks/embed/component-info.ts
|
|
2860
|
-
var
|
|
3133
|
+
var componentInfo11 = {
|
|
2861
3134
|
name: "Embed",
|
|
2862
3135
|
static: true,
|
|
2863
3136
|
inputs: [{
|
|
@@ -2899,7 +3172,7 @@ var SCRIPT_MIME_TYPES = ["text/javascript", "application/javascript", "applicati
|
|
|
2899
3172
|
var isJsScript = (script) => SCRIPT_MIME_TYPES.includes(script.type);
|
|
2900
3173
|
|
|
2901
3174
|
// src/blocks/embed/embed.tsx
|
|
2902
|
-
var _tmpl$
|
|
3175
|
+
var _tmpl$10 = /* @__PURE__ */ template(`<div class=builder-embed>`);
|
|
2903
3176
|
function Embed(props) {
|
|
2904
3177
|
const [scriptsInserted, setScriptsInserted] = createSignal([]);
|
|
2905
3178
|
const [scriptsRun, setScriptsRun] = createSignal([]);
|
|
@@ -2936,7 +3209,7 @@ function Embed(props) {
|
|
|
2936
3209
|
}
|
|
2937
3210
|
createEffect(on(() => [onUpdateFn_0_elem(), onUpdateFn_0_ranInitFn__()], onUpdateFn_0));
|
|
2938
3211
|
return (() => {
|
|
2939
|
-
const _el$ = _tmpl$
|
|
3212
|
+
const _el$ = _tmpl$10();
|
|
2940
3213
|
const _ref$ = elem;
|
|
2941
3214
|
typeof _ref$ === "function" ? use(_ref$, _el$) : elem = _el$;
|
|
2942
3215
|
effect(() => _el$.innerHTML = props.content);
|
|
@@ -2946,7 +3219,7 @@ function Embed(props) {
|
|
|
2946
3219
|
var embed_default = Embed;
|
|
2947
3220
|
|
|
2948
3221
|
// src/blocks/form/form/component-info.ts
|
|
2949
|
-
var
|
|
3222
|
+
var componentInfo12 = {
|
|
2950
3223
|
name: "Form:Form",
|
|
2951
3224
|
// editableTags: ['builder-form-error']
|
|
2952
3225
|
defaults: {
|
|
@@ -3193,8 +3466,8 @@ var get = (obj, path, defaultValue) => {
|
|
|
3193
3466
|
};
|
|
3194
3467
|
|
|
3195
3468
|
// src/blocks/form/form/form.tsx
|
|
3196
|
-
var _tmpl$
|
|
3197
|
-
var _tmpl$
|
|
3469
|
+
var _tmpl$11 = /* @__PURE__ */ template(`<pre>`);
|
|
3470
|
+
var _tmpl$24 = /* @__PURE__ */ template(`<form>`);
|
|
3198
3471
|
function FormComponent(props) {
|
|
3199
3472
|
const [formState, setFormState] = createSignal("unsubmitted");
|
|
3200
3473
|
const [responseData, setResponseData] = createSignal(null);
|
|
@@ -3380,7 +3653,7 @@ function FormComponent(props) {
|
|
|
3380
3653
|
}
|
|
3381
3654
|
let formRef;
|
|
3382
3655
|
return (() => {
|
|
3383
|
-
const _el$ = _tmpl$
|
|
3656
|
+
const _el$ = _tmpl$24();
|
|
3384
3657
|
_el$.addEventListener("submit", (event) => onSubmit(event));
|
|
3385
3658
|
const _ref$ = formRef;
|
|
3386
3659
|
typeof _ref$ === "function" ? use(_ref$, _el$) : formRef = _el$;
|
|
@@ -3463,7 +3736,7 @@ function FormComponent(props) {
|
|
|
3463
3736
|
return memo(() => submissionState() === "error")() && responseData();
|
|
3464
3737
|
},
|
|
3465
3738
|
get children() {
|
|
3466
|
-
const _el$2 = _tmpl$
|
|
3739
|
+
const _el$2 = _tmpl$11();
|
|
3467
3740
|
insert(_el$2, () => JSON.stringify(responseData(), null, 2));
|
|
3468
3741
|
effect(() => className(_el$2, "builder-form-error-text " + css({
|
|
3469
3742
|
padding: "10px",
|
|
@@ -3495,7 +3768,7 @@ function FormComponent(props) {
|
|
|
3495
3768
|
var form_default = FormComponent;
|
|
3496
3769
|
|
|
3497
3770
|
// src/blocks/form/input/component-info.ts
|
|
3498
|
-
var
|
|
3771
|
+
var componentInfo13 = {
|
|
3499
3772
|
name: "Form:Input",
|
|
3500
3773
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fad6f37889d9e40bbbbc72cdb5875d6ca",
|
|
3501
3774
|
inputs: [
|
|
@@ -3547,10 +3820,10 @@ var componentInfo12 = {
|
|
|
3547
3820
|
borderColor: "#ccc"
|
|
3548
3821
|
}
|
|
3549
3822
|
};
|
|
3550
|
-
var _tmpl$
|
|
3823
|
+
var _tmpl$12 = /* @__PURE__ */ template(`<input>`);
|
|
3551
3824
|
function FormInputComponent(props) {
|
|
3552
3825
|
return (() => {
|
|
3553
|
-
const _el$ = _tmpl$
|
|
3826
|
+
const _el$ = _tmpl$12();
|
|
3554
3827
|
spread(_el$, mergeProps({}, () => props.attributes, {
|
|
3555
3828
|
get key() {
|
|
3556
3829
|
return isEditing() && props.defaultValue ? props.defaultValue : "default-key";
|
|
@@ -3580,7 +3853,7 @@ function FormInputComponent(props) {
|
|
|
3580
3853
|
var input_default = FormInputComponent;
|
|
3581
3854
|
|
|
3582
3855
|
// src/blocks/form/select/component-info.ts
|
|
3583
|
-
var
|
|
3856
|
+
var componentInfo14 = {
|
|
3584
3857
|
name: "Form:Select",
|
|
3585
3858
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F83acca093fb24aaf94dee136e9a4b045",
|
|
3586
3859
|
defaultStyles: {
|
|
@@ -3623,11 +3896,11 @@ var componentInfo13 = {
|
|
|
3623
3896
|
static: true,
|
|
3624
3897
|
noWrap: true
|
|
3625
3898
|
};
|
|
3626
|
-
var _tmpl$
|
|
3627
|
-
var _tmpl$
|
|
3899
|
+
var _tmpl$13 = /* @__PURE__ */ template(`<select>`);
|
|
3900
|
+
var _tmpl$25 = /* @__PURE__ */ template(`<option>`);
|
|
3628
3901
|
function SelectComponent(props) {
|
|
3629
3902
|
return (() => {
|
|
3630
|
-
const _el$ = _tmpl$
|
|
3903
|
+
const _el$ = _tmpl$13();
|
|
3631
3904
|
spread(_el$, mergeProps({}, () => props.attributes, {
|
|
3632
3905
|
get value() {
|
|
3633
3906
|
return props.value;
|
|
@@ -3649,7 +3922,7 @@ function SelectComponent(props) {
|
|
|
3649
3922
|
children: (option, _index) => {
|
|
3650
3923
|
const index = _index();
|
|
3651
3924
|
return (() => {
|
|
3652
|
-
const _el$2 = _tmpl$
|
|
3925
|
+
const _el$2 = _tmpl$25();
|
|
3653
3926
|
insert(_el$2, () => option.name || option.value);
|
|
3654
3927
|
effect(() => setAttribute(_el$2, "key", `${option.name}-${index}`));
|
|
3655
3928
|
effect(() => _el$2.value = option.value);
|
|
@@ -3663,7 +3936,7 @@ function SelectComponent(props) {
|
|
|
3663
3936
|
var select_default = SelectComponent;
|
|
3664
3937
|
|
|
3665
3938
|
// src/blocks/form/submit-button/component-info.ts
|
|
3666
|
-
var
|
|
3939
|
+
var componentInfo15 = {
|
|
3667
3940
|
name: "Form:SubmitButton",
|
|
3668
3941
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fdf2820ffed1f4349a94c40b3221f5b98",
|
|
3669
3942
|
defaultStyles: {
|
|
@@ -3689,10 +3962,10 @@ var componentInfo14 = {
|
|
|
3689
3962
|
// TODO: defaultChildren
|
|
3690
3963
|
// canHaveChildren: true,
|
|
3691
3964
|
};
|
|
3692
|
-
var _tmpl$
|
|
3965
|
+
var _tmpl$14 = /* @__PURE__ */ template(`<button type=submit>`);
|
|
3693
3966
|
function SubmitButton(props) {
|
|
3694
3967
|
return (() => {
|
|
3695
|
-
const _el$ = _tmpl$
|
|
3968
|
+
const _el$ = _tmpl$14();
|
|
3696
3969
|
spread(_el$, mergeProps({}, () => props.attributes), false, true);
|
|
3697
3970
|
insert(_el$, () => props.text);
|
|
3698
3971
|
return _el$;
|
|
@@ -3701,7 +3974,7 @@ function SubmitButton(props) {
|
|
|
3701
3974
|
var submit_button_default = SubmitButton;
|
|
3702
3975
|
|
|
3703
3976
|
// src/blocks/img/component-info.ts
|
|
3704
|
-
var
|
|
3977
|
+
var componentInfo16 = {
|
|
3705
3978
|
// friendlyName?
|
|
3706
3979
|
name: "Raw:Img",
|
|
3707
3980
|
hideFromInsertMenu: true,
|
|
@@ -3716,10 +3989,10 @@ var componentInfo15 = {
|
|
|
3716
3989
|
noWrap: true,
|
|
3717
3990
|
static: true
|
|
3718
3991
|
};
|
|
3719
|
-
var _tmpl$
|
|
3992
|
+
var _tmpl$15 = /* @__PURE__ */ template(`<img>`);
|
|
3720
3993
|
function ImgComponent(props) {
|
|
3721
3994
|
return (() => {
|
|
3722
|
-
const _el$ = _tmpl$
|
|
3995
|
+
const _el$ = _tmpl$15();
|
|
3723
3996
|
spread(_el$, mergeProps({
|
|
3724
3997
|
get style() {
|
|
3725
3998
|
return {
|
|
@@ -3743,7 +4016,7 @@ function ImgComponent(props) {
|
|
|
3743
4016
|
var img_default = ImgComponent;
|
|
3744
4017
|
|
|
3745
4018
|
// src/blocks/video/component-info.ts
|
|
3746
|
-
var
|
|
4019
|
+
var componentInfo17 = {
|
|
3747
4020
|
name: "Video",
|
|
3748
4021
|
canHaveChildren: true,
|
|
3749
4022
|
defaultStyles: {
|
|
@@ -3825,9 +4098,9 @@ var componentInfo16 = {
|
|
|
3825
4098
|
advanced: true
|
|
3826
4099
|
}]
|
|
3827
4100
|
};
|
|
3828
|
-
var _tmpl$
|
|
3829
|
-
var _tmpl$
|
|
3830
|
-
var _tmpl$
|
|
4101
|
+
var _tmpl$16 = /* @__PURE__ */ template(`<source type=video/mp4>`);
|
|
4102
|
+
var _tmpl$26 = /* @__PURE__ */ template(`<div>`);
|
|
4103
|
+
var _tmpl$34 = /* @__PURE__ */ template(`<div><video class=builder-video>`);
|
|
3831
4104
|
function Video(props) {
|
|
3832
4105
|
const videoProps = createMemo(() => {
|
|
3833
4106
|
return {
|
|
@@ -3854,7 +4127,7 @@ function Video(props) {
|
|
|
3854
4127
|
};
|
|
3855
4128
|
});
|
|
3856
4129
|
return (() => {
|
|
3857
|
-
const _el$ = _tmpl$
|
|
4130
|
+
const _el$ = _tmpl$34(), _el$2 = _el$.firstChild;
|
|
3858
4131
|
_el$.style.setProperty("position", "relative");
|
|
3859
4132
|
spread(_el$2, mergeProps(spreadProps, {
|
|
3860
4133
|
get preload() {
|
|
@@ -3888,7 +4161,7 @@ function Video(props) {
|
|
|
3888
4161
|
return !props.lazyLoad;
|
|
3889
4162
|
},
|
|
3890
4163
|
get children() {
|
|
3891
|
-
const _el$3 = _tmpl$
|
|
4164
|
+
const _el$3 = _tmpl$16();
|
|
3892
4165
|
effect(() => setAttribute(_el$3, "src", props.video));
|
|
3893
4166
|
return _el$3;
|
|
3894
4167
|
}
|
|
@@ -3898,7 +4171,7 @@ function Video(props) {
|
|
|
3898
4171
|
return props.aspectRatio && !(props.fitContent && props.builderBlock?.children?.length);
|
|
3899
4172
|
},
|
|
3900
4173
|
get children() {
|
|
3901
|
-
const _el$4 = _tmpl$
|
|
4174
|
+
const _el$4 = _tmpl$26();
|
|
3902
4175
|
_el$4.style.setProperty("width", "100%");
|
|
3903
4176
|
_el$4.style.setProperty("pointer-events", "none");
|
|
3904
4177
|
_el$4.style.setProperty("font-size", "0px");
|
|
@@ -3911,7 +4184,7 @@ function Video(props) {
|
|
|
3911
4184
|
return props.builderBlock?.children?.length && props.fitContent;
|
|
3912
4185
|
},
|
|
3913
4186
|
get children() {
|
|
3914
|
-
const _el$5 = _tmpl$
|
|
4187
|
+
const _el$5 = _tmpl$26();
|
|
3915
4188
|
_el$5.style.setProperty("display", "flex");
|
|
3916
4189
|
_el$5.style.setProperty("flex-direction", "column");
|
|
3917
4190
|
_el$5.style.setProperty("align-items", "stretch");
|
|
@@ -3924,7 +4197,7 @@ function Video(props) {
|
|
|
3924
4197
|
return props.builderBlock?.children?.length && !props.fitContent;
|
|
3925
4198
|
},
|
|
3926
4199
|
get children() {
|
|
3927
|
-
const _el$6 = _tmpl$
|
|
4200
|
+
const _el$6 = _tmpl$26();
|
|
3928
4201
|
_el$6.style.setProperty("pointer-events", "none");
|
|
3929
4202
|
_el$6.style.setProperty("display", "flex");
|
|
3930
4203
|
_el$6.style.setProperty("flex-direction", "column");
|
|
@@ -3946,28 +4219,28 @@ var video_default = Video;
|
|
|
3946
4219
|
// src/constants/extra-components.ts
|
|
3947
4220
|
var getExtraComponents = () => [{
|
|
3948
4221
|
component: custom_code_default,
|
|
3949
|
-
...
|
|
4222
|
+
...componentInfo10
|
|
3950
4223
|
}, {
|
|
3951
4224
|
component: embed_default,
|
|
3952
|
-
...
|
|
4225
|
+
...componentInfo11
|
|
3953
4226
|
}, ...TARGET === "rsc" ? [] : [{
|
|
3954
4227
|
component: form_default,
|
|
3955
|
-
...
|
|
4228
|
+
...componentInfo12
|
|
3956
4229
|
}, {
|
|
3957
4230
|
component: input_default,
|
|
3958
|
-
...
|
|
4231
|
+
...componentInfo13
|
|
3959
4232
|
}, {
|
|
3960
4233
|
component: submit_button_default,
|
|
3961
|
-
...
|
|
4234
|
+
...componentInfo15
|
|
3962
4235
|
}, {
|
|
3963
4236
|
component: select_default,
|
|
3964
|
-
...
|
|
4237
|
+
...componentInfo14
|
|
3965
4238
|
}], {
|
|
3966
4239
|
component: img_default,
|
|
3967
|
-
...
|
|
4240
|
+
...componentInfo16
|
|
3968
4241
|
}, {
|
|
3969
4242
|
component: video_default,
|
|
3970
|
-
...
|
|
4243
|
+
...componentInfo17
|
|
3971
4244
|
}];
|
|
3972
4245
|
|
|
3973
4246
|
// src/constants/builder-registered-components.ts
|
|
@@ -3994,8 +4267,11 @@ var getDefaultRegisteredComponents = () => [{
|
|
|
3994
4267
|
...componentInfo7
|
|
3995
4268
|
}, {
|
|
3996
4269
|
component: text_default,
|
|
4270
|
+
...componentInfo9
|
|
4271
|
+
}, ...TARGET === "rsc" ? [] : [{
|
|
4272
|
+
component: tabs_default,
|
|
3997
4273
|
...componentInfo8
|
|
3998
|
-
}, ...getExtraComponents()];
|
|
4274
|
+
}], ...getExtraComponents()];
|
|
3999
4275
|
|
|
4000
4276
|
// src/functions/register-component.ts
|
|
4001
4277
|
var createRegisterComponentMessage = (info) => ({
|
|
@@ -4064,10 +4340,10 @@ var getUpdateVariantVisibilityScript = ({
|
|
|
4064
4340
|
}) => `window.${UPDATE_VARIANT_VISIBILITY_SCRIPT_FN_NAME}(
|
|
4065
4341
|
"${variationId}", "${contentId}", ${isHydrationTarget}
|
|
4066
4342
|
)`;
|
|
4067
|
-
var _tmpl$
|
|
4343
|
+
var _tmpl$17 = /* @__PURE__ */ template(`<script>`);
|
|
4068
4344
|
function InlinedScript(props) {
|
|
4069
4345
|
return (() => {
|
|
4070
|
-
const _el$ = _tmpl$
|
|
4346
|
+
const _el$ = _tmpl$17();
|
|
4071
4347
|
effect((_p$) => {
|
|
4072
4348
|
const _v$ = props.scriptStr, _v$2 = props.id;
|
|
4073
4349
|
_v$ !== _p$._v$ && (_el$.innerHTML = _p$._v$ = _v$);
|
|
@@ -4561,7 +4837,7 @@ function isFromTrustedHost(trustedHosts, e) {
|
|
|
4561
4837
|
}
|
|
4562
4838
|
|
|
4563
4839
|
// src/constants/sdk-version.ts
|
|
4564
|
-
var SDK_VERSION = "1.0.
|
|
4840
|
+
var SDK_VERSION = "1.0.25";
|
|
4565
4841
|
|
|
4566
4842
|
// src/functions/register.ts
|
|
4567
4843
|
var registry = {};
|
|
@@ -4757,6 +5033,85 @@ var subscribeToEditor = (model, callback, options) => {
|
|
|
4757
5033
|
};
|
|
4758
5034
|
};
|
|
4759
5035
|
|
|
5036
|
+
// src/components/content/components/styles.helpers.ts
|
|
5037
|
+
var getCssFromFont = (font) => {
|
|
5038
|
+
const family = font.family + (font.kind && !font.kind.includes("#") ? ", " + font.kind : "");
|
|
5039
|
+
const name = family.split(",")[0];
|
|
5040
|
+
const url = font.fileUrl ?? font?.files?.regular;
|
|
5041
|
+
let str = "";
|
|
5042
|
+
if (url && family && name) {
|
|
5043
|
+
str += `
|
|
5044
|
+
@font-face {
|
|
5045
|
+
font-family: "${family}";
|
|
5046
|
+
src: local("${name}"), url('${url}') format('woff2');
|
|
5047
|
+
font-display: fallback;
|
|
5048
|
+
font-weight: 400;
|
|
5049
|
+
}
|
|
5050
|
+
`.trim();
|
|
5051
|
+
}
|
|
5052
|
+
if (font.files) {
|
|
5053
|
+
for (const weight in font.files) {
|
|
5054
|
+
const isNumber = String(Number(weight)) === weight;
|
|
5055
|
+
if (!isNumber) {
|
|
5056
|
+
continue;
|
|
5057
|
+
}
|
|
5058
|
+
const weightUrl = font.files[weight];
|
|
5059
|
+
if (weightUrl && weightUrl !== url) {
|
|
5060
|
+
str += `
|
|
5061
|
+
@font-face {
|
|
5062
|
+
font-family: "${family}";
|
|
5063
|
+
src: url('${weightUrl}') format('woff2');
|
|
5064
|
+
font-display: fallback;
|
|
5065
|
+
font-weight: ${weight};
|
|
5066
|
+
}
|
|
5067
|
+
`.trim();
|
|
5068
|
+
}
|
|
5069
|
+
}
|
|
5070
|
+
}
|
|
5071
|
+
return str;
|
|
5072
|
+
};
|
|
5073
|
+
var getFontCss = ({
|
|
5074
|
+
customFonts
|
|
5075
|
+
}) => {
|
|
5076
|
+
return customFonts?.map((font) => getCssFromFont(font))?.join(" ") || "";
|
|
5077
|
+
};
|
|
5078
|
+
var getCss = ({
|
|
5079
|
+
cssCode,
|
|
5080
|
+
contentId
|
|
5081
|
+
}) => {
|
|
5082
|
+
if (!cssCode) {
|
|
5083
|
+
return "";
|
|
5084
|
+
}
|
|
5085
|
+
if (!contentId) {
|
|
5086
|
+
return cssCode;
|
|
5087
|
+
}
|
|
5088
|
+
return cssCode?.replace(/&/g, `div[builder-content-id="${contentId}"]`) || "";
|
|
5089
|
+
};
|
|
5090
|
+
var DEFAULT_STYLES = `
|
|
5091
|
+
.builder-button {
|
|
5092
|
+
all: unset;
|
|
5093
|
+
}
|
|
5094
|
+
|
|
5095
|
+
.builder-text > p:first-of-type, .builder-text > .builder-paragraph:first-of-type {
|
|
5096
|
+
margin: 0;
|
|
5097
|
+
}
|
|
5098
|
+
.builder-text > p, .builder-text > .builder-paragraph {
|
|
5099
|
+
color: inherit;
|
|
5100
|
+
line-height: inherit;
|
|
5101
|
+
letter-spacing: inherit;
|
|
5102
|
+
font-weight: inherit;
|
|
5103
|
+
font-size: inherit;
|
|
5104
|
+
text-align: inherit;
|
|
5105
|
+
font-family: inherit;
|
|
5106
|
+
}
|
|
5107
|
+
`;
|
|
5108
|
+
var getDefaultStyles = (isNested) => {
|
|
5109
|
+
return !isNested ? DEFAULT_STYLES : "";
|
|
5110
|
+
};
|
|
5111
|
+
var getWrapperClassName = (variationId) => {
|
|
5112
|
+
return `variant-${variationId}`;
|
|
5113
|
+
};
|
|
5114
|
+
|
|
4760
5115
|
// src/components/content/components/enable-editor.tsx
|
|
4761
5116
|
function EnableEditor(props) {
|
|
4762
5117
|
const [ContentWrapper, setContentWrapper] = createSignal(props.contentWrapper || "div");
|
|
@@ -4796,6 +5151,12 @@ function EnableEditor(props) {
|
|
|
4796
5151
|
content: newContentValue
|
|
4797
5152
|
}));
|
|
4798
5153
|
}
|
|
5154
|
+
const showContentProps = createMemo(() => {
|
|
5155
|
+
return props.showContent ? {} : {
|
|
5156
|
+
hidden: true,
|
|
5157
|
+
"aria-hidden": true
|
|
5158
|
+
};
|
|
5159
|
+
});
|
|
4799
5160
|
function processMessage(event) {
|
|
4800
5161
|
return createEditorListener({
|
|
4801
5162
|
model: props.model,
|
|
@@ -5014,7 +5375,7 @@ function EnableEditor(props) {
|
|
|
5014
5375
|
get children() {
|
|
5015
5376
|
return createComponent(Dynamic, mergeProps({
|
|
5016
5377
|
get ["class"]() {
|
|
5017
|
-
return
|
|
5378
|
+
return getWrapperClassName(props.content?.testVariationId || props.content?.id);
|
|
5018
5379
|
}
|
|
5019
5380
|
}, {}, {
|
|
5020
5381
|
ref(r$) {
|
|
@@ -5028,10 +5389,7 @@ function EnableEditor(props) {
|
|
|
5028
5389
|
get ["builder-model"]() {
|
|
5029
5390
|
return props.model;
|
|
5030
5391
|
}
|
|
5031
|
-
}, {}, () => props.
|
|
5032
|
-
hidden: true,
|
|
5033
|
-
"aria-hidden": true
|
|
5034
|
-
}, () => props.contentWrapperProps, {
|
|
5392
|
+
}, {}, showContentProps, () => props.contentWrapperProps, {
|
|
5035
5393
|
get component() {
|
|
5036
5394
|
return ContentWrapper();
|
|
5037
5395
|
},
|
|
@@ -5045,84 +5403,6 @@ function EnableEditor(props) {
|
|
|
5045
5403
|
});
|
|
5046
5404
|
}
|
|
5047
5405
|
var enable_editor_default = EnableEditor;
|
|
5048
|
-
|
|
5049
|
-
// src/components/content/components/styles.helpers.ts
|
|
5050
|
-
var getCssFromFont = (font) => {
|
|
5051
|
-
const family = font.family + (font.kind && !font.kind.includes("#") ? ", " + font.kind : "");
|
|
5052
|
-
const name = family.split(",")[0];
|
|
5053
|
-
const url = font.fileUrl ?? font?.files?.regular;
|
|
5054
|
-
let str = "";
|
|
5055
|
-
if (url && family && name) {
|
|
5056
|
-
str += `
|
|
5057
|
-
@font-face {
|
|
5058
|
-
font-family: "${family}";
|
|
5059
|
-
src: local("${name}"), url('${url}') format('woff2');
|
|
5060
|
-
font-display: fallback;
|
|
5061
|
-
font-weight: 400;
|
|
5062
|
-
}
|
|
5063
|
-
`.trim();
|
|
5064
|
-
}
|
|
5065
|
-
if (font.files) {
|
|
5066
|
-
for (const weight in font.files) {
|
|
5067
|
-
const isNumber = String(Number(weight)) === weight;
|
|
5068
|
-
if (!isNumber) {
|
|
5069
|
-
continue;
|
|
5070
|
-
}
|
|
5071
|
-
const weightUrl = font.files[weight];
|
|
5072
|
-
if (weightUrl && weightUrl !== url) {
|
|
5073
|
-
str += `
|
|
5074
|
-
@font-face {
|
|
5075
|
-
font-family: "${family}";
|
|
5076
|
-
src: url('${weightUrl}') format('woff2');
|
|
5077
|
-
font-display: fallback;
|
|
5078
|
-
font-weight: ${weight};
|
|
5079
|
-
}
|
|
5080
|
-
`.trim();
|
|
5081
|
-
}
|
|
5082
|
-
}
|
|
5083
|
-
}
|
|
5084
|
-
return str;
|
|
5085
|
-
};
|
|
5086
|
-
var getFontCss = ({
|
|
5087
|
-
customFonts
|
|
5088
|
-
}) => {
|
|
5089
|
-
return customFonts?.map((font) => getCssFromFont(font))?.join(" ") || "";
|
|
5090
|
-
};
|
|
5091
|
-
var getCss = ({
|
|
5092
|
-
cssCode,
|
|
5093
|
-
contentId
|
|
5094
|
-
}) => {
|
|
5095
|
-
if (!cssCode) {
|
|
5096
|
-
return "";
|
|
5097
|
-
}
|
|
5098
|
-
if (!contentId) {
|
|
5099
|
-
return cssCode;
|
|
5100
|
-
}
|
|
5101
|
-
return cssCode?.replace(/&/g, `div[builder-content-id="${contentId}"]`) || "";
|
|
5102
|
-
};
|
|
5103
|
-
var DEFAULT_STYLES = `
|
|
5104
|
-
.builder-button {
|
|
5105
|
-
all: unset;
|
|
5106
|
-
}
|
|
5107
|
-
|
|
5108
|
-
.builder-text > p:first-of-type, .builder-text > .builder-paragraph:first-of-type {
|
|
5109
|
-
margin: 0;
|
|
5110
|
-
}
|
|
5111
|
-
.builder-text > p, .builder-text > .builder-paragraph {
|
|
5112
|
-
color: inherit;
|
|
5113
|
-
line-height: inherit;
|
|
5114
|
-
letter-spacing: inherit;
|
|
5115
|
-
font-weight: inherit;
|
|
5116
|
-
font-size: inherit;
|
|
5117
|
-
text-align: inherit;
|
|
5118
|
-
font-family: inherit;
|
|
5119
|
-
}
|
|
5120
|
-
`;
|
|
5121
|
-
var getDefaultStyles = (isNested) => {
|
|
5122
|
-
return !isNested ? DEFAULT_STYLES : "";
|
|
5123
|
-
};
|
|
5124
|
-
|
|
5125
|
-
// src/components/content/components/styles.tsx
|
|
5126
5406
|
function ContentStyles(props) {
|
|
5127
5407
|
const [injectedStyles, setInjectedStyles] = createSignal(`
|
|
5128
5408
|
${getCss({
|
|
@@ -5541,9 +5821,15 @@ var fetchSymbolContent = async ({
|
|
|
5541
5821
|
};
|
|
5542
5822
|
|
|
5543
5823
|
// src/blocks/symbol/symbol.tsx
|
|
5544
|
-
var _tmpl$
|
|
5824
|
+
var _tmpl$18 = /* @__PURE__ */ template(`<div>`);
|
|
5545
5825
|
function Symbol(props) {
|
|
5546
5826
|
const [contentToUse, setContentToUse] = createSignal(props.symbol?.content);
|
|
5827
|
+
const blocksWrapper = createMemo(() => {
|
|
5828
|
+
return "div";
|
|
5829
|
+
});
|
|
5830
|
+
const contentWrapper = createMemo(() => {
|
|
5831
|
+
return "div";
|
|
5832
|
+
});
|
|
5547
5833
|
const className = createMemo(() => {
|
|
5548
5834
|
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(" ");
|
|
5549
5835
|
});
|
|
@@ -5567,7 +5853,7 @@ function Symbol(props) {
|
|
|
5567
5853
|
}
|
|
5568
5854
|
createEffect(on(() => [onUpdateFn_0_props_symbol()], onUpdateFn_0));
|
|
5569
5855
|
return (() => {
|
|
5570
|
-
const _el$ = _tmpl$
|
|
5856
|
+
const _el$ = _tmpl$18();
|
|
5571
5857
|
spread(_el$, mergeProps({
|
|
5572
5858
|
get ["class"]() {
|
|
5573
5859
|
return className();
|
|
@@ -5606,8 +5892,12 @@ function Symbol(props) {
|
|
|
5606
5892
|
get linkComponent() {
|
|
5607
5893
|
return props.builderLinkComponent;
|
|
5608
5894
|
},
|
|
5609
|
-
blocksWrapper
|
|
5610
|
-
|
|
5895
|
+
get blocksWrapper() {
|
|
5896
|
+
return blocksWrapper();
|
|
5897
|
+
},
|
|
5898
|
+
get contentWrapper() {
|
|
5899
|
+
return contentWrapper();
|
|
5900
|
+
}
|
|
5611
5901
|
}));
|
|
5612
5902
|
return _el$;
|
|
5613
5903
|
})();
|