@builder.io/sdk-solid 1.0.22 → 1.0.24
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 -179
- package/lib/browser/dev.jsx +463 -228
- package/lib/browser/index.js +458 -179
- package/lib/browser/index.jsx +463 -228
- package/lib/edge/dev.js +458 -179
- package/lib/edge/dev.jsx +463 -228
- package/lib/edge/index.js +458 -179
- package/lib/edge/index.jsx +463 -228
- package/lib/node/dev.js +458 -179
- package/lib/node/dev.jsx +463 -228
- package/lib/node/index.js +458 -179
- package/lib/node/index.jsx +463 -228
- package/package.json +1 -1
package/lib/edge/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
|
|
|
@@ -74,25 +74,29 @@ var getClassPropName = () => {
|
|
|
74
74
|
case "vue":
|
|
75
75
|
case "solid":
|
|
76
76
|
case "qwik":
|
|
77
|
+
case "angular":
|
|
77
78
|
return "class";
|
|
78
79
|
}
|
|
79
80
|
};
|
|
80
81
|
|
|
81
82
|
// src/blocks/button/button.tsx
|
|
82
83
|
function Button(props) {
|
|
84
|
+
function attrs() {
|
|
85
|
+
return {
|
|
86
|
+
...props.attributes,
|
|
87
|
+
[getClassPropName()]: `${props.link ? "" : "builder-button"} ${props.attributes[getClassPropName()] || ""}`,
|
|
88
|
+
...props.link ? {
|
|
89
|
+
href: props.link,
|
|
90
|
+
target: props.openLinkInNewTab ? "_blank" : void 0,
|
|
91
|
+
role: "link"
|
|
92
|
+
} : {
|
|
93
|
+
role: "button"
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
}
|
|
83
97
|
return createComponent(dynamic_renderer_default, {
|
|
84
98
|
get attributes() {
|
|
85
|
-
return
|
|
86
|
-
...props.attributes,
|
|
87
|
-
[getClassPropName()]: `${props.link ? "" : "builder-button"} ${props.attributes[getClassPropName()] || ""}`,
|
|
88
|
-
...props.link ? {
|
|
89
|
-
href: props.link,
|
|
90
|
-
target: props.openLinkInNewTab ? "_blank" : void 0,
|
|
91
|
-
role: "link"
|
|
92
|
-
} : {
|
|
93
|
-
role: "button"
|
|
94
|
-
}
|
|
95
|
-
};
|
|
99
|
+
return attrs();
|
|
96
100
|
},
|
|
97
101
|
get TagName() {
|
|
98
102
|
return props.link ? props.builderLinkComponent || "a" : "button";
|
|
@@ -3530,7 +3534,6 @@ function evaluate({
|
|
|
3530
3534
|
enableCache
|
|
3531
3535
|
}) {
|
|
3532
3536
|
if (code === "") {
|
|
3533
|
-
logger.warn("Skipping evaluation of empty code block.");
|
|
3534
3537
|
return void 0;
|
|
3535
3538
|
}
|
|
3536
3539
|
const args = {
|
|
@@ -3861,6 +3864,7 @@ function mapStyleObjToStrIfNeeded(style) {
|
|
|
3861
3864
|
case "svelte":
|
|
3862
3865
|
case "vue":
|
|
3863
3866
|
case "solid":
|
|
3867
|
+
case "angular":
|
|
3864
3868
|
return convertStyleMapToCSSArray(style).join(" ");
|
|
3865
3869
|
case "qwik":
|
|
3866
3870
|
case "reactNative":
|
|
@@ -3933,6 +3937,12 @@ var getRepeatItemData = ({
|
|
|
3933
3937
|
}));
|
|
3934
3938
|
return repeatArray;
|
|
3935
3939
|
};
|
|
3940
|
+
var shouldPassLinkComponent = (blockName) => {
|
|
3941
|
+
return blockName && ["Core:Button", "Symbol", "Columns", "Form:Form", "Builder: Tabs"].includes(blockName);
|
|
3942
|
+
};
|
|
3943
|
+
var shouldPassRegisteredComponents = (blockName) => {
|
|
3944
|
+
return blockName && ["Symbol", "Columns", "Form:Form", "Builder: Tabs"].includes(blockName);
|
|
3945
|
+
};
|
|
3936
3946
|
|
|
3937
3947
|
// src/constants/device-sizes.ts
|
|
3938
3948
|
var SIZES = {
|
|
@@ -4189,21 +4199,24 @@ function BlockWrapper(props) {
|
|
|
4189
4199
|
}
|
|
4190
4200
|
var block_wrapper_default = BlockWrapper;
|
|
4191
4201
|
function InteractiveElement(props) {
|
|
4202
|
+
const attributes = createMemo(() => {
|
|
4203
|
+
return props.includeBlockProps ? {
|
|
4204
|
+
...getBlockProperties({
|
|
4205
|
+
block: props.block,
|
|
4206
|
+
context: props.context
|
|
4207
|
+
}),
|
|
4208
|
+
...getBlockActions({
|
|
4209
|
+
block: props.block,
|
|
4210
|
+
rootState: props.context.rootState,
|
|
4211
|
+
rootSetState: props.context.rootSetState,
|
|
4212
|
+
localState: props.context.localState,
|
|
4213
|
+
context: props.context.context
|
|
4214
|
+
})
|
|
4215
|
+
} : {};
|
|
4216
|
+
});
|
|
4192
4217
|
return createComponent(Dynamic, mergeProps(() => props.wrapperProps, {
|
|
4193
4218
|
get attributes() {
|
|
4194
|
-
return
|
|
4195
|
-
...getBlockProperties({
|
|
4196
|
-
block: props.block,
|
|
4197
|
-
context: props.context
|
|
4198
|
-
}),
|
|
4199
|
-
...getBlockActions({
|
|
4200
|
-
block: props.block,
|
|
4201
|
-
rootState: props.context.rootState,
|
|
4202
|
-
rootSetState: props.context.rootSetState,
|
|
4203
|
-
localState: props.context.localState,
|
|
4204
|
-
context: props.context.context
|
|
4205
|
-
})
|
|
4206
|
-
} : {};
|
|
4219
|
+
return attributes();
|
|
4207
4220
|
},
|
|
4208
4221
|
get component() {
|
|
4209
4222
|
return props.Wrapper;
|
|
@@ -4378,10 +4391,10 @@ function Block(props) {
|
|
|
4378
4391
|
componentOptions: {
|
|
4379
4392
|
...getBlockComponentOptions(processedBlock()),
|
|
4380
4393
|
builderContext: props.context,
|
|
4381
|
-
...
|
|
4394
|
+
...shouldPassLinkComponent(blockComponent()?.name) ? {
|
|
4382
4395
|
builderLinkComponent: props.linkComponent
|
|
4383
4396
|
} : {},
|
|
4384
|
-
...
|
|
4397
|
+
...shouldPassRegisteredComponents(blockComponent()?.name) ? {
|
|
4385
4398
|
builderComponents: props.registeredComponents
|
|
4386
4399
|
} : {}
|
|
4387
4400
|
},
|
|
@@ -4673,6 +4686,11 @@ function Blocks(props) {
|
|
|
4673
4686
|
}
|
|
4674
4687
|
var blocks_default = Blocks;
|
|
4675
4688
|
|
|
4689
|
+
// src/blocks/columns/helpers.ts
|
|
4690
|
+
var getColumnsClass = (id2) => {
|
|
4691
|
+
return `builder-columns ${id2}-breakpoints`;
|
|
4692
|
+
};
|
|
4693
|
+
|
|
4676
4694
|
// src/blocks/columns/columns.tsx
|
|
4677
4695
|
var _tmpl$2 = /* @__PURE__ */ template(`<div>`);
|
|
4678
4696
|
function Columns(props) {
|
|
@@ -4680,6 +4698,9 @@ function Columns(props) {
|
|
|
4680
4698
|
const [cols, setCols] = createSignal(props.columns || []);
|
|
4681
4699
|
const [stackAt, setStackAt] = createSignal(props.stackColumnsAt || "tablet");
|
|
4682
4700
|
const [flexDir, setFlexDir] = createSignal(props.stackColumnsAt === "never" ? "row" : props.reverseColumnsWhenStacked ? "column-reverse" : "column");
|
|
4701
|
+
function getTagName(column) {
|
|
4702
|
+
return column.link ? props.builderLinkComponent || "a" : "div";
|
|
4703
|
+
}
|
|
4683
4704
|
function getWidth(index) {
|
|
4684
4705
|
return cols()[index]?.width || 100 / cols().length;
|
|
4685
4706
|
}
|
|
@@ -4699,7 +4720,7 @@ function Columns(props) {
|
|
|
4699
4720
|
}) {
|
|
4700
4721
|
return stackAt() === "never" ? desktopStyle : stackedStyle;
|
|
4701
4722
|
}
|
|
4702
|
-
|
|
4723
|
+
function columnsCssVars() {
|
|
4703
4724
|
return {
|
|
4704
4725
|
"--flex-dir": flexDir(),
|
|
4705
4726
|
"--flex-dir-tablet": getTabletStyle({
|
|
@@ -4707,7 +4728,7 @@ function Columns(props) {
|
|
|
4707
4728
|
desktopStyle: "row"
|
|
4708
4729
|
})
|
|
4709
4730
|
};
|
|
4710
|
-
}
|
|
4731
|
+
}
|
|
4711
4732
|
function columnCssVars(index) {
|
|
4712
4733
|
const gutter = index === 0 ? 0 : gutterSize();
|
|
4713
4734
|
const width = getColumnCssWidth(index);
|
|
@@ -4746,7 +4767,7 @@ function Columns(props) {
|
|
|
4746
4767
|
const breakpointSizes = getSizesForBreakpoints(props.builderContext.content?.meta?.breakpoints || {});
|
|
4747
4768
|
return breakpointSizes[size].max;
|
|
4748
4769
|
}
|
|
4749
|
-
|
|
4770
|
+
function columnsStyles() {
|
|
4750
4771
|
return `
|
|
4751
4772
|
@media (max-width: ${getWidthForBreakpointSize("medium")}px) {
|
|
4752
4773
|
.${props.builderBlock.id}-breakpoints {
|
|
@@ -4772,12 +4793,22 @@ function Columns(props) {
|
|
|
4772
4793
|
}
|
|
4773
4794
|
},
|
|
4774
4795
|
`;
|
|
4775
|
-
}
|
|
4796
|
+
}
|
|
4797
|
+
function getAttributes(column, index) {
|
|
4798
|
+
return {
|
|
4799
|
+
...{},
|
|
4800
|
+
...column.link ? {
|
|
4801
|
+
href: column.link
|
|
4802
|
+
} : {},
|
|
4803
|
+
[getClassPropName()]: "builder-column",
|
|
4804
|
+
style: mapStyleObjToStrIfNeeded(columnCssVars(index))
|
|
4805
|
+
};
|
|
4806
|
+
}
|
|
4776
4807
|
return (() => {
|
|
4777
4808
|
const _el$ = _tmpl$2();
|
|
4778
4809
|
spread(_el$, mergeProps({
|
|
4779
4810
|
get ["class"]() {
|
|
4780
|
-
return
|
|
4811
|
+
return getColumnsClass(props.builderBlock?.id) + " " + css({
|
|
4781
4812
|
display: "flex",
|
|
4782
4813
|
lineHeight: "normal"
|
|
4783
4814
|
});
|
|
@@ -4806,18 +4837,11 @@ function Columns(props) {
|
|
|
4806
4837
|
return createComponent(dynamic_renderer_default, {
|
|
4807
4838
|
key: index,
|
|
4808
4839
|
get TagName() {
|
|
4809
|
-
return column
|
|
4840
|
+
return getTagName(column);
|
|
4810
4841
|
},
|
|
4811
4842
|
actionAttributes: {},
|
|
4812
4843
|
get attributes() {
|
|
4813
|
-
return
|
|
4814
|
-
...{},
|
|
4815
|
-
...column.link ? {
|
|
4816
|
-
href: column.link
|
|
4817
|
-
} : {},
|
|
4818
|
-
[getClassPropName()]: "builder-column",
|
|
4819
|
-
style: mapStyleObjToStrIfNeeded(columnCssVars(index))
|
|
4820
|
-
};
|
|
4844
|
+
return getAttributes(column, index);
|
|
4821
4845
|
},
|
|
4822
4846
|
get children() {
|
|
4823
4847
|
return createComponent(blocks_default, {
|
|
@@ -5015,7 +5039,7 @@ function Image(props) {
|
|
|
5015
5039
|
}
|
|
5016
5040
|
}), createComponent(Show, {
|
|
5017
5041
|
get when() {
|
|
5018
|
-
return !props.fitContent && props.children;
|
|
5042
|
+
return !props.fitContent && props.builderBlock?.children?.length;
|
|
5019
5043
|
},
|
|
5020
5044
|
get children() {
|
|
5021
5045
|
const _el$5 = _tmpl$32();
|
|
@@ -5759,8 +5783,246 @@ var componentInfo7 = {
|
|
|
5759
5783
|
}]
|
|
5760
5784
|
};
|
|
5761
5785
|
|
|
5762
|
-
// src/blocks/
|
|
5786
|
+
// src/blocks/tabs/component-info.ts
|
|
5787
|
+
var defaultTab = {
|
|
5788
|
+
"@type": "@builder.io/sdk:Element",
|
|
5789
|
+
responsiveStyles: {
|
|
5790
|
+
large: {
|
|
5791
|
+
paddingLeft: "20px",
|
|
5792
|
+
paddingRight: "20px",
|
|
5793
|
+
paddingTop: "10px",
|
|
5794
|
+
paddingBottom: "10px",
|
|
5795
|
+
minWidth: "100px",
|
|
5796
|
+
textAlign: "center",
|
|
5797
|
+
display: "flex",
|
|
5798
|
+
flexDirection: "column",
|
|
5799
|
+
cursor: "pointer",
|
|
5800
|
+
userSelect: "none"
|
|
5801
|
+
}
|
|
5802
|
+
},
|
|
5803
|
+
component: {
|
|
5804
|
+
name: "Text",
|
|
5805
|
+
options: {
|
|
5806
|
+
text: "New tab"
|
|
5807
|
+
}
|
|
5808
|
+
}
|
|
5809
|
+
};
|
|
5810
|
+
var defaultElement = {
|
|
5811
|
+
"@type": "@builder.io/sdk:Element",
|
|
5812
|
+
responsiveStyles: {
|
|
5813
|
+
large: {
|
|
5814
|
+
height: "200px",
|
|
5815
|
+
display: "flex",
|
|
5816
|
+
marginTop: "20px",
|
|
5817
|
+
flexDirection: "column"
|
|
5818
|
+
}
|
|
5819
|
+
},
|
|
5820
|
+
component: {
|
|
5821
|
+
name: "Text",
|
|
5822
|
+
options: {
|
|
5823
|
+
text: "New tab content "
|
|
5824
|
+
}
|
|
5825
|
+
}
|
|
5826
|
+
};
|
|
5763
5827
|
var componentInfo8 = {
|
|
5828
|
+
name: "Builder: Tabs",
|
|
5829
|
+
inputs: [{
|
|
5830
|
+
name: "tabs",
|
|
5831
|
+
type: "list",
|
|
5832
|
+
broadcast: true,
|
|
5833
|
+
subFields: [{
|
|
5834
|
+
name: "label",
|
|
5835
|
+
type: "uiBlocks",
|
|
5836
|
+
hideFromUI: true,
|
|
5837
|
+
defaultValue: [defaultTab]
|
|
5838
|
+
}, {
|
|
5839
|
+
name: "content",
|
|
5840
|
+
type: "uiBlocks",
|
|
5841
|
+
hideFromUI: true,
|
|
5842
|
+
defaultValue: [defaultElement]
|
|
5843
|
+
}],
|
|
5844
|
+
defaultValue: [{
|
|
5845
|
+
label: [{
|
|
5846
|
+
...defaultTab,
|
|
5847
|
+
component: {
|
|
5848
|
+
name: "Text",
|
|
5849
|
+
options: {
|
|
5850
|
+
text: "Tab 1"
|
|
5851
|
+
}
|
|
5852
|
+
}
|
|
5853
|
+
}],
|
|
5854
|
+
content: [{
|
|
5855
|
+
...defaultElement,
|
|
5856
|
+
component: {
|
|
5857
|
+
name: "Text",
|
|
5858
|
+
options: {
|
|
5859
|
+
text: "Tab 1 content"
|
|
5860
|
+
}
|
|
5861
|
+
}
|
|
5862
|
+
}]
|
|
5863
|
+
}, {
|
|
5864
|
+
label: [{
|
|
5865
|
+
...defaultTab,
|
|
5866
|
+
component: {
|
|
5867
|
+
name: "Text",
|
|
5868
|
+
options: {
|
|
5869
|
+
text: "Tab 2"
|
|
5870
|
+
}
|
|
5871
|
+
}
|
|
5872
|
+
}],
|
|
5873
|
+
content: [{
|
|
5874
|
+
...defaultElement,
|
|
5875
|
+
component: {
|
|
5876
|
+
name: "Text",
|
|
5877
|
+
options: {
|
|
5878
|
+
text: "Tab 2 content"
|
|
5879
|
+
}
|
|
5880
|
+
}
|
|
5881
|
+
}]
|
|
5882
|
+
}]
|
|
5883
|
+
}, {
|
|
5884
|
+
name: "activeTabStyle",
|
|
5885
|
+
type: "uiStyle",
|
|
5886
|
+
helperText: "CSS styles for the active tab",
|
|
5887
|
+
defaultValue: {
|
|
5888
|
+
backgroundColor: "rgba(0, 0, 0, 0.1)"
|
|
5889
|
+
}
|
|
5890
|
+
}, {
|
|
5891
|
+
name: "defaultActiveTab",
|
|
5892
|
+
type: "number",
|
|
5893
|
+
helperText: 'Default tab to open to. Set to "1" for the first tab, "2" for the second, or choose "0" for none',
|
|
5894
|
+
defaultValue: 1,
|
|
5895
|
+
advanced: true
|
|
5896
|
+
}, {
|
|
5897
|
+
name: "collapsible",
|
|
5898
|
+
type: "boolean",
|
|
5899
|
+
helperText: "If on, clicking an open tab closes it so no tabs are active",
|
|
5900
|
+
defaultValue: false,
|
|
5901
|
+
advanced: true
|
|
5902
|
+
}, {
|
|
5903
|
+
name: "tabHeaderLayout",
|
|
5904
|
+
type: "enum",
|
|
5905
|
+
helperText: "Change the layout of the tab headers (uses justify-content)",
|
|
5906
|
+
defaultValue: "flex-start",
|
|
5907
|
+
enum: [{
|
|
5908
|
+
label: "Center",
|
|
5909
|
+
value: "center"
|
|
5910
|
+
}, {
|
|
5911
|
+
label: "Space between",
|
|
5912
|
+
value: "space-between"
|
|
5913
|
+
}, {
|
|
5914
|
+
label: "Space around",
|
|
5915
|
+
value: "space-around"
|
|
5916
|
+
}, {
|
|
5917
|
+
label: "Left",
|
|
5918
|
+
value: "flex-start"
|
|
5919
|
+
}, {
|
|
5920
|
+
label: "Right",
|
|
5921
|
+
value: "flex-end"
|
|
5922
|
+
}]
|
|
5923
|
+
}]
|
|
5924
|
+
};
|
|
5925
|
+
var _tmpl$7 = /* @__PURE__ */ template(`<div>`);
|
|
5926
|
+
var _tmpl$23 = /* @__PURE__ */ template(`<div><div class=builder-tabs-wrap>`);
|
|
5927
|
+
var _tmpl$33 = /* @__PURE__ */ template(`<span>`);
|
|
5928
|
+
function Tabs(props) {
|
|
5929
|
+
const [activeTab, setActiveTab] = createSignal(props.defaultActiveTab ? props.defaultActiveTab - 1 : 0);
|
|
5930
|
+
function activeTabContent(active) {
|
|
5931
|
+
return props.tabs && props.tabs[active].content;
|
|
5932
|
+
}
|
|
5933
|
+
function getActiveTabStyle(index) {
|
|
5934
|
+
return activeTab() === index ? props.activeTabStyle : {};
|
|
5935
|
+
}
|
|
5936
|
+
return (() => {
|
|
5937
|
+
const _el$ = _tmpl$23(), _el$2 = _el$.firstChild;
|
|
5938
|
+
_el$2.style.setProperty("display", "flex");
|
|
5939
|
+
_el$2.style.setProperty("flex-direction", "row");
|
|
5940
|
+
_el$2.style.setProperty("overflow", "auto");
|
|
5941
|
+
insert(_el$2, createComponent(For, {
|
|
5942
|
+
get each() {
|
|
5943
|
+
return props.tabs;
|
|
5944
|
+
},
|
|
5945
|
+
children: (tab, _index) => {
|
|
5946
|
+
const index = _index();
|
|
5947
|
+
return (() => {
|
|
5948
|
+
const _el$4 = _tmpl$33();
|
|
5949
|
+
_el$4.$$click = (event) => {
|
|
5950
|
+
if (index === activeTab() && props.collapsible) {
|
|
5951
|
+
setActiveTab(-1);
|
|
5952
|
+
} else {
|
|
5953
|
+
setActiveTab(index);
|
|
5954
|
+
}
|
|
5955
|
+
};
|
|
5956
|
+
setAttribute(_el$4, "key", index);
|
|
5957
|
+
insert(_el$4, createComponent(blocks_default, {
|
|
5958
|
+
get parent() {
|
|
5959
|
+
return props.builderBlock.id;
|
|
5960
|
+
},
|
|
5961
|
+
path: `component.options.tabs.${index}.label`,
|
|
5962
|
+
get blocks() {
|
|
5963
|
+
return tab.label;
|
|
5964
|
+
},
|
|
5965
|
+
get context() {
|
|
5966
|
+
return props.builderContext;
|
|
5967
|
+
},
|
|
5968
|
+
get registeredComponents() {
|
|
5969
|
+
return props.builderComponents;
|
|
5970
|
+
},
|
|
5971
|
+
get linkComponent() {
|
|
5972
|
+
return props.builderLinkComponent;
|
|
5973
|
+
}
|
|
5974
|
+
}));
|
|
5975
|
+
effect((_p$) => {
|
|
5976
|
+
const _v$ = `builder-tab-wrap ${activeTab() === index ? "builder-tab-active" : ""}`, _v$2 = getActiveTabStyle(index);
|
|
5977
|
+
_v$ !== _p$._v$ && className(_el$4, _p$._v$ = _v$);
|
|
5978
|
+
_p$._v$2 = style(_el$4, _v$2, _p$._v$2);
|
|
5979
|
+
return _p$;
|
|
5980
|
+
}, {
|
|
5981
|
+
_v$: void 0,
|
|
5982
|
+
_v$2: void 0
|
|
5983
|
+
});
|
|
5984
|
+
return _el$4;
|
|
5985
|
+
})();
|
|
5986
|
+
}
|
|
5987
|
+
}));
|
|
5988
|
+
insert(_el$, createComponent(Show, {
|
|
5989
|
+
get when() {
|
|
5990
|
+
return activeTabContent(activeTab());
|
|
5991
|
+
},
|
|
5992
|
+
get children() {
|
|
5993
|
+
const _el$3 = _tmpl$7();
|
|
5994
|
+
insert(_el$3, createComponent(blocks_default, {
|
|
5995
|
+
get parent() {
|
|
5996
|
+
return props.builderBlock.id;
|
|
5997
|
+
},
|
|
5998
|
+
get path() {
|
|
5999
|
+
return `component.options.tabs.${activeTab()}.content`;
|
|
6000
|
+
},
|
|
6001
|
+
get blocks() {
|
|
6002
|
+
return activeTabContent(activeTab());
|
|
6003
|
+
},
|
|
6004
|
+
get context() {
|
|
6005
|
+
return props.builderContext;
|
|
6006
|
+
},
|
|
6007
|
+
get registeredComponents() {
|
|
6008
|
+
return props.builderComponents;
|
|
6009
|
+
},
|
|
6010
|
+
get linkComponent() {
|
|
6011
|
+
return props.builderLinkComponent;
|
|
6012
|
+
}
|
|
6013
|
+
}));
|
|
6014
|
+
return _el$3;
|
|
6015
|
+
}
|
|
6016
|
+
}), null);
|
|
6017
|
+
effect(() => (props.tabHeaderLayout || "flex-start") != null ? _el$2.style.setProperty("justify-content", props.tabHeaderLayout || "flex-start") : _el$2.style.removeProperty("justify-content"));
|
|
6018
|
+
return _el$;
|
|
6019
|
+
})();
|
|
6020
|
+
}
|
|
6021
|
+
var tabs_default = Tabs;
|
|
6022
|
+
delegateEvents(["click"]);
|
|
6023
|
+
|
|
6024
|
+
// src/blocks/text/component-info.ts
|
|
6025
|
+
var componentInfo9 = {
|
|
5764
6026
|
name: "Text",
|
|
5765
6027
|
static: true,
|
|
5766
6028
|
isRSC: true,
|
|
@@ -5779,10 +6041,10 @@ var componentInfo8 = {
|
|
|
5779
6041
|
textAlign: "center"
|
|
5780
6042
|
}
|
|
5781
6043
|
};
|
|
5782
|
-
var _tmpl$
|
|
6044
|
+
var _tmpl$8 = /* @__PURE__ */ template(`<div class=builder-text>`);
|
|
5783
6045
|
function Text(props) {
|
|
5784
6046
|
return (() => {
|
|
5785
|
-
const _el$ = _tmpl$
|
|
6047
|
+
const _el$ = _tmpl$8();
|
|
5786
6048
|
_el$.style.setProperty("outline", "none");
|
|
5787
6049
|
effect(() => _el$.innerHTML = props.text?.toString() || "");
|
|
5788
6050
|
return _el$;
|
|
@@ -5791,7 +6053,7 @@ function Text(props) {
|
|
|
5791
6053
|
var text_default = Text;
|
|
5792
6054
|
|
|
5793
6055
|
// src/blocks/custom-code/component-info.ts
|
|
5794
|
-
var
|
|
6056
|
+
var componentInfo10 = {
|
|
5795
6057
|
name: "Custom Code",
|
|
5796
6058
|
static: true,
|
|
5797
6059
|
requiredPermissions: ["editCode"],
|
|
@@ -5814,7 +6076,7 @@ var componentInfo9 = {
|
|
|
5814
6076
|
advanced: true
|
|
5815
6077
|
}]
|
|
5816
6078
|
};
|
|
5817
|
-
var _tmpl$
|
|
6079
|
+
var _tmpl$9 = /* @__PURE__ */ template(`<div>`);
|
|
5818
6080
|
function CustomCode(props) {
|
|
5819
6081
|
const [scriptsInserted, setScriptsInserted] = createSignal([]);
|
|
5820
6082
|
const [scriptsRun, setScriptsRun] = createSignal([]);
|
|
@@ -5848,7 +6110,7 @@ function CustomCode(props) {
|
|
|
5848
6110
|
}
|
|
5849
6111
|
});
|
|
5850
6112
|
return (() => {
|
|
5851
|
-
const _el$ = _tmpl$
|
|
6113
|
+
const _el$ = _tmpl$9();
|
|
5852
6114
|
const _ref$ = elementRef;
|
|
5853
6115
|
typeof _ref$ === "function" ? use(_ref$, _el$) : elementRef = _el$;
|
|
5854
6116
|
effect((_p$) => {
|
|
@@ -5866,7 +6128,7 @@ function CustomCode(props) {
|
|
|
5866
6128
|
var custom_code_default = CustomCode;
|
|
5867
6129
|
|
|
5868
6130
|
// src/blocks/embed/component-info.ts
|
|
5869
|
-
var
|
|
6131
|
+
var componentInfo11 = {
|
|
5870
6132
|
name: "Embed",
|
|
5871
6133
|
static: true,
|
|
5872
6134
|
inputs: [{
|
|
@@ -5908,7 +6170,7 @@ var SCRIPT_MIME_TYPES = ["text/javascript", "application/javascript", "applicati
|
|
|
5908
6170
|
var isJsScript = (script) => SCRIPT_MIME_TYPES.includes(script.type);
|
|
5909
6171
|
|
|
5910
6172
|
// src/blocks/embed/embed.tsx
|
|
5911
|
-
var _tmpl$
|
|
6173
|
+
var _tmpl$10 = /* @__PURE__ */ template(`<div class=builder-embed>`);
|
|
5912
6174
|
function Embed(props) {
|
|
5913
6175
|
const [scriptsInserted, setScriptsInserted] = createSignal([]);
|
|
5914
6176
|
const [scriptsRun, setScriptsRun] = createSignal([]);
|
|
@@ -5945,7 +6207,7 @@ function Embed(props) {
|
|
|
5945
6207
|
}
|
|
5946
6208
|
createEffect(on(() => [onUpdateFn_0_elem(), onUpdateFn_0_ranInitFn__()], onUpdateFn_0));
|
|
5947
6209
|
return (() => {
|
|
5948
|
-
const _el$ = _tmpl$
|
|
6210
|
+
const _el$ = _tmpl$10();
|
|
5949
6211
|
const _ref$ = elem;
|
|
5950
6212
|
typeof _ref$ === "function" ? use(_ref$, _el$) : elem = _el$;
|
|
5951
6213
|
effect(() => _el$.innerHTML = props.content);
|
|
@@ -5955,7 +6217,7 @@ function Embed(props) {
|
|
|
5955
6217
|
var embed_default = Embed;
|
|
5956
6218
|
|
|
5957
6219
|
// src/blocks/form/form/component-info.ts
|
|
5958
|
-
var
|
|
6220
|
+
var componentInfo12 = {
|
|
5959
6221
|
name: "Form:Form",
|
|
5960
6222
|
// editableTags: ['builder-form-error']
|
|
5961
6223
|
defaults: {
|
|
@@ -6202,8 +6464,8 @@ var get = (obj, path, defaultValue) => {
|
|
|
6202
6464
|
};
|
|
6203
6465
|
|
|
6204
6466
|
// src/blocks/form/form/form.tsx
|
|
6205
|
-
var _tmpl$
|
|
6206
|
-
var _tmpl$
|
|
6467
|
+
var _tmpl$11 = /* @__PURE__ */ template(`<pre>`);
|
|
6468
|
+
var _tmpl$24 = /* @__PURE__ */ template(`<form>`);
|
|
6207
6469
|
function FormComponent(props) {
|
|
6208
6470
|
const [formState, setFormState] = createSignal("unsubmitted");
|
|
6209
6471
|
const [responseData, setResponseData] = createSignal(null);
|
|
@@ -6389,7 +6651,7 @@ function FormComponent(props) {
|
|
|
6389
6651
|
}
|
|
6390
6652
|
let formRef;
|
|
6391
6653
|
return (() => {
|
|
6392
|
-
const _el$ = _tmpl$
|
|
6654
|
+
const _el$ = _tmpl$24();
|
|
6393
6655
|
_el$.addEventListener("submit", (event) => onSubmit(event));
|
|
6394
6656
|
const _ref$ = formRef;
|
|
6395
6657
|
typeof _ref$ === "function" ? use(_ref$, _el$) : formRef = _el$;
|
|
@@ -6472,7 +6734,7 @@ function FormComponent(props) {
|
|
|
6472
6734
|
return memo(() => submissionState() === "error")() && responseData();
|
|
6473
6735
|
},
|
|
6474
6736
|
get children() {
|
|
6475
|
-
const _el$2 = _tmpl$
|
|
6737
|
+
const _el$2 = _tmpl$11();
|
|
6476
6738
|
insert(_el$2, () => JSON.stringify(responseData(), null, 2));
|
|
6477
6739
|
effect(() => className(_el$2, "builder-form-error-text " + css({
|
|
6478
6740
|
padding: "10px",
|
|
@@ -6504,7 +6766,7 @@ function FormComponent(props) {
|
|
|
6504
6766
|
var form_default = FormComponent;
|
|
6505
6767
|
|
|
6506
6768
|
// src/blocks/form/input/component-info.ts
|
|
6507
|
-
var
|
|
6769
|
+
var componentInfo13 = {
|
|
6508
6770
|
name: "Form:Input",
|
|
6509
6771
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fad6f37889d9e40bbbbc72cdb5875d6ca",
|
|
6510
6772
|
inputs: [
|
|
@@ -6556,10 +6818,10 @@ var componentInfo12 = {
|
|
|
6556
6818
|
borderColor: "#ccc"
|
|
6557
6819
|
}
|
|
6558
6820
|
};
|
|
6559
|
-
var _tmpl$
|
|
6821
|
+
var _tmpl$12 = /* @__PURE__ */ template(`<input>`);
|
|
6560
6822
|
function FormInputComponent(props) {
|
|
6561
6823
|
return (() => {
|
|
6562
|
-
const _el$ = _tmpl$
|
|
6824
|
+
const _el$ = _tmpl$12();
|
|
6563
6825
|
spread(_el$, mergeProps({}, () => props.attributes, {
|
|
6564
6826
|
get key() {
|
|
6565
6827
|
return isEditing() && props.defaultValue ? props.defaultValue : "default-key";
|
|
@@ -6589,7 +6851,7 @@ function FormInputComponent(props) {
|
|
|
6589
6851
|
var input_default = FormInputComponent;
|
|
6590
6852
|
|
|
6591
6853
|
// src/blocks/form/select/component-info.ts
|
|
6592
|
-
var
|
|
6854
|
+
var componentInfo14 = {
|
|
6593
6855
|
name: "Form:Select",
|
|
6594
6856
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F83acca093fb24aaf94dee136e9a4b045",
|
|
6595
6857
|
defaultStyles: {
|
|
@@ -6632,11 +6894,11 @@ var componentInfo13 = {
|
|
|
6632
6894
|
static: true,
|
|
6633
6895
|
noWrap: true
|
|
6634
6896
|
};
|
|
6635
|
-
var _tmpl$
|
|
6636
|
-
var _tmpl$
|
|
6897
|
+
var _tmpl$13 = /* @__PURE__ */ template(`<select>`);
|
|
6898
|
+
var _tmpl$25 = /* @__PURE__ */ template(`<option>`);
|
|
6637
6899
|
function SelectComponent(props) {
|
|
6638
6900
|
return (() => {
|
|
6639
|
-
const _el$ = _tmpl$
|
|
6901
|
+
const _el$ = _tmpl$13();
|
|
6640
6902
|
spread(_el$, mergeProps({}, () => props.attributes, {
|
|
6641
6903
|
get value() {
|
|
6642
6904
|
return props.value;
|
|
@@ -6658,7 +6920,7 @@ function SelectComponent(props) {
|
|
|
6658
6920
|
children: (option, _index) => {
|
|
6659
6921
|
const index = _index();
|
|
6660
6922
|
return (() => {
|
|
6661
|
-
const _el$2 = _tmpl$
|
|
6923
|
+
const _el$2 = _tmpl$25();
|
|
6662
6924
|
insert(_el$2, () => option.name || option.value);
|
|
6663
6925
|
effect(() => setAttribute(_el$2, "key", `${option.name}-${index}`));
|
|
6664
6926
|
effect(() => _el$2.value = option.value);
|
|
@@ -6672,7 +6934,7 @@ function SelectComponent(props) {
|
|
|
6672
6934
|
var select_default = SelectComponent;
|
|
6673
6935
|
|
|
6674
6936
|
// src/blocks/form/submit-button/component-info.ts
|
|
6675
|
-
var
|
|
6937
|
+
var componentInfo15 = {
|
|
6676
6938
|
name: "Form:SubmitButton",
|
|
6677
6939
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fdf2820ffed1f4349a94c40b3221f5b98",
|
|
6678
6940
|
defaultStyles: {
|
|
@@ -6698,10 +6960,10 @@ var componentInfo14 = {
|
|
|
6698
6960
|
// TODO: defaultChildren
|
|
6699
6961
|
// canHaveChildren: true,
|
|
6700
6962
|
};
|
|
6701
|
-
var _tmpl$
|
|
6963
|
+
var _tmpl$14 = /* @__PURE__ */ template(`<button type=submit>`);
|
|
6702
6964
|
function SubmitButton(props) {
|
|
6703
6965
|
return (() => {
|
|
6704
|
-
const _el$ = _tmpl$
|
|
6966
|
+
const _el$ = _tmpl$14();
|
|
6705
6967
|
spread(_el$, mergeProps({}, () => props.attributes), false, true);
|
|
6706
6968
|
insert(_el$, () => props.text);
|
|
6707
6969
|
return _el$;
|
|
@@ -6710,7 +6972,7 @@ function SubmitButton(props) {
|
|
|
6710
6972
|
var submit_button_default = SubmitButton;
|
|
6711
6973
|
|
|
6712
6974
|
// src/blocks/img/component-info.ts
|
|
6713
|
-
var
|
|
6975
|
+
var componentInfo16 = {
|
|
6714
6976
|
// friendlyName?
|
|
6715
6977
|
name: "Raw:Img",
|
|
6716
6978
|
hideFromInsertMenu: true,
|
|
@@ -6725,10 +6987,10 @@ var componentInfo15 = {
|
|
|
6725
6987
|
noWrap: true,
|
|
6726
6988
|
static: true
|
|
6727
6989
|
};
|
|
6728
|
-
var _tmpl$
|
|
6990
|
+
var _tmpl$15 = /* @__PURE__ */ template(`<img>`);
|
|
6729
6991
|
function ImgComponent(props) {
|
|
6730
6992
|
return (() => {
|
|
6731
|
-
const _el$ = _tmpl$
|
|
6993
|
+
const _el$ = _tmpl$15();
|
|
6732
6994
|
spread(_el$, mergeProps({
|
|
6733
6995
|
get style() {
|
|
6734
6996
|
return {
|
|
@@ -6752,7 +7014,7 @@ function ImgComponent(props) {
|
|
|
6752
7014
|
var img_default = ImgComponent;
|
|
6753
7015
|
|
|
6754
7016
|
// src/blocks/video/component-info.ts
|
|
6755
|
-
var
|
|
7017
|
+
var componentInfo17 = {
|
|
6756
7018
|
name: "Video",
|
|
6757
7019
|
canHaveChildren: true,
|
|
6758
7020
|
defaultStyles: {
|
|
@@ -6834,9 +7096,9 @@ var componentInfo16 = {
|
|
|
6834
7096
|
advanced: true
|
|
6835
7097
|
}]
|
|
6836
7098
|
};
|
|
6837
|
-
var _tmpl$
|
|
6838
|
-
var _tmpl$
|
|
6839
|
-
var _tmpl$
|
|
7099
|
+
var _tmpl$16 = /* @__PURE__ */ template(`<source type=video/mp4>`);
|
|
7100
|
+
var _tmpl$26 = /* @__PURE__ */ template(`<div>`);
|
|
7101
|
+
var _tmpl$34 = /* @__PURE__ */ template(`<div><video class=builder-video>`);
|
|
6840
7102
|
function Video(props) {
|
|
6841
7103
|
const videoProps = createMemo(() => {
|
|
6842
7104
|
return {
|
|
@@ -6863,7 +7125,7 @@ function Video(props) {
|
|
|
6863
7125
|
};
|
|
6864
7126
|
});
|
|
6865
7127
|
return (() => {
|
|
6866
|
-
const _el$ = _tmpl$
|
|
7128
|
+
const _el$ = _tmpl$34(), _el$2 = _el$.firstChild;
|
|
6867
7129
|
_el$.style.setProperty("position", "relative");
|
|
6868
7130
|
spread(_el$2, mergeProps(spreadProps, {
|
|
6869
7131
|
get preload() {
|
|
@@ -6897,7 +7159,7 @@ function Video(props) {
|
|
|
6897
7159
|
return !props.lazyLoad;
|
|
6898
7160
|
},
|
|
6899
7161
|
get children() {
|
|
6900
|
-
const _el$3 = _tmpl$
|
|
7162
|
+
const _el$3 = _tmpl$16();
|
|
6901
7163
|
effect(() => setAttribute(_el$3, "src", props.video));
|
|
6902
7164
|
return _el$3;
|
|
6903
7165
|
}
|
|
@@ -6907,7 +7169,7 @@ function Video(props) {
|
|
|
6907
7169
|
return props.aspectRatio && !(props.fitContent && props.builderBlock?.children?.length);
|
|
6908
7170
|
},
|
|
6909
7171
|
get children() {
|
|
6910
|
-
const _el$4 = _tmpl$
|
|
7172
|
+
const _el$4 = _tmpl$26();
|
|
6911
7173
|
_el$4.style.setProperty("width", "100%");
|
|
6912
7174
|
_el$4.style.setProperty("pointer-events", "none");
|
|
6913
7175
|
_el$4.style.setProperty("font-size", "0px");
|
|
@@ -6920,7 +7182,7 @@ function Video(props) {
|
|
|
6920
7182
|
return props.builderBlock?.children?.length && props.fitContent;
|
|
6921
7183
|
},
|
|
6922
7184
|
get children() {
|
|
6923
|
-
const _el$5 = _tmpl$
|
|
7185
|
+
const _el$5 = _tmpl$26();
|
|
6924
7186
|
_el$5.style.setProperty("display", "flex");
|
|
6925
7187
|
_el$5.style.setProperty("flex-direction", "column");
|
|
6926
7188
|
_el$5.style.setProperty("align-items", "stretch");
|
|
@@ -6933,7 +7195,7 @@ function Video(props) {
|
|
|
6933
7195
|
return props.builderBlock?.children?.length && !props.fitContent;
|
|
6934
7196
|
},
|
|
6935
7197
|
get children() {
|
|
6936
|
-
const _el$6 = _tmpl$
|
|
7198
|
+
const _el$6 = _tmpl$26();
|
|
6937
7199
|
_el$6.style.setProperty("pointer-events", "none");
|
|
6938
7200
|
_el$6.style.setProperty("display", "flex");
|
|
6939
7201
|
_el$6.style.setProperty("flex-direction", "column");
|
|
@@ -6955,28 +7217,28 @@ var video_default = Video;
|
|
|
6955
7217
|
// src/constants/extra-components.ts
|
|
6956
7218
|
var getExtraComponents = () => [{
|
|
6957
7219
|
component: custom_code_default,
|
|
6958
|
-
...
|
|
7220
|
+
...componentInfo10
|
|
6959
7221
|
}, {
|
|
6960
7222
|
component: embed_default,
|
|
6961
|
-
...
|
|
7223
|
+
...componentInfo11
|
|
6962
7224
|
}, ...TARGET === "rsc" ? [] : [{
|
|
6963
7225
|
component: form_default,
|
|
6964
|
-
...
|
|
7226
|
+
...componentInfo12
|
|
6965
7227
|
}, {
|
|
6966
7228
|
component: input_default,
|
|
6967
|
-
...
|
|
7229
|
+
...componentInfo13
|
|
6968
7230
|
}, {
|
|
6969
7231
|
component: submit_button_default,
|
|
6970
|
-
...
|
|
7232
|
+
...componentInfo15
|
|
6971
7233
|
}, {
|
|
6972
7234
|
component: select_default,
|
|
6973
|
-
...
|
|
7235
|
+
...componentInfo14
|
|
6974
7236
|
}], {
|
|
6975
7237
|
component: img_default,
|
|
6976
|
-
...
|
|
7238
|
+
...componentInfo16
|
|
6977
7239
|
}, {
|
|
6978
7240
|
component: video_default,
|
|
6979
|
-
...
|
|
7241
|
+
...componentInfo17
|
|
6980
7242
|
}];
|
|
6981
7243
|
|
|
6982
7244
|
// src/constants/builder-registered-components.ts
|
|
@@ -7003,8 +7265,11 @@ var getDefaultRegisteredComponents = () => [{
|
|
|
7003
7265
|
...componentInfo7
|
|
7004
7266
|
}, {
|
|
7005
7267
|
component: text_default,
|
|
7268
|
+
...componentInfo9
|
|
7269
|
+
}, ...TARGET === "rsc" ? [] : [{
|
|
7270
|
+
component: tabs_default,
|
|
7006
7271
|
...componentInfo8
|
|
7007
|
-
}, ...getExtraComponents()];
|
|
7272
|
+
}], ...getExtraComponents()];
|
|
7008
7273
|
|
|
7009
7274
|
// src/functions/register-component.ts
|
|
7010
7275
|
var createRegisterComponentMessage = (info) => ({
|
|
@@ -7073,10 +7338,10 @@ var getUpdateVariantVisibilityScript = ({
|
|
|
7073
7338
|
}) => `window.${UPDATE_VARIANT_VISIBILITY_SCRIPT_FN_NAME}(
|
|
7074
7339
|
"${variationId}", "${contentId}", ${isHydrationTarget}
|
|
7075
7340
|
)`;
|
|
7076
|
-
var _tmpl$
|
|
7341
|
+
var _tmpl$17 = /* @__PURE__ */ template(`<script>`);
|
|
7077
7342
|
function InlinedScript(props) {
|
|
7078
7343
|
return (() => {
|
|
7079
|
-
const _el$ = _tmpl$
|
|
7344
|
+
const _el$ = _tmpl$17();
|
|
7080
7345
|
effect((_p$) => {
|
|
7081
7346
|
const _v$ = props.scriptStr, _v$2 = props.id;
|
|
7082
7347
|
_v$ !== _p$._v$ && (_el$.innerHTML = _p$._v$ = _v$);
|
|
@@ -7570,7 +7835,7 @@ function isFromTrustedHost(trustedHosts, e) {
|
|
|
7570
7835
|
}
|
|
7571
7836
|
|
|
7572
7837
|
// src/constants/sdk-version.ts
|
|
7573
|
-
var SDK_VERSION = "1.0.
|
|
7838
|
+
var SDK_VERSION = "1.0.24";
|
|
7574
7839
|
|
|
7575
7840
|
// src/functions/register.ts
|
|
7576
7841
|
var registry = {};
|
|
@@ -7766,6 +8031,85 @@ var subscribeToEditor = (model, callback, options) => {
|
|
|
7766
8031
|
};
|
|
7767
8032
|
};
|
|
7768
8033
|
|
|
8034
|
+
// src/components/content/components/styles.helpers.ts
|
|
8035
|
+
var getCssFromFont = (font) => {
|
|
8036
|
+
const family = font.family + (font.kind && !font.kind.includes("#") ? ", " + font.kind : "");
|
|
8037
|
+
const name = family.split(",")[0];
|
|
8038
|
+
const url = font.fileUrl ?? font?.files?.regular;
|
|
8039
|
+
let str = "";
|
|
8040
|
+
if (url && family && name) {
|
|
8041
|
+
str += `
|
|
8042
|
+
@font-face {
|
|
8043
|
+
font-family: "${family}";
|
|
8044
|
+
src: local("${name}"), url('${url}') format('woff2');
|
|
8045
|
+
font-display: fallback;
|
|
8046
|
+
font-weight: 400;
|
|
8047
|
+
}
|
|
8048
|
+
`.trim();
|
|
8049
|
+
}
|
|
8050
|
+
if (font.files) {
|
|
8051
|
+
for (const weight in font.files) {
|
|
8052
|
+
const isNumber = String(Number(weight)) === weight;
|
|
8053
|
+
if (!isNumber) {
|
|
8054
|
+
continue;
|
|
8055
|
+
}
|
|
8056
|
+
const weightUrl = font.files[weight];
|
|
8057
|
+
if (weightUrl && weightUrl !== url) {
|
|
8058
|
+
str += `
|
|
8059
|
+
@font-face {
|
|
8060
|
+
font-family: "${family}";
|
|
8061
|
+
src: url('${weightUrl}') format('woff2');
|
|
8062
|
+
font-display: fallback;
|
|
8063
|
+
font-weight: ${weight};
|
|
8064
|
+
}
|
|
8065
|
+
`.trim();
|
|
8066
|
+
}
|
|
8067
|
+
}
|
|
8068
|
+
}
|
|
8069
|
+
return str;
|
|
8070
|
+
};
|
|
8071
|
+
var getFontCss = ({
|
|
8072
|
+
customFonts
|
|
8073
|
+
}) => {
|
|
8074
|
+
return customFonts?.map((font) => getCssFromFont(font))?.join(" ") || "";
|
|
8075
|
+
};
|
|
8076
|
+
var getCss = ({
|
|
8077
|
+
cssCode,
|
|
8078
|
+
contentId
|
|
8079
|
+
}) => {
|
|
8080
|
+
if (!cssCode) {
|
|
8081
|
+
return "";
|
|
8082
|
+
}
|
|
8083
|
+
if (!contentId) {
|
|
8084
|
+
return cssCode;
|
|
8085
|
+
}
|
|
8086
|
+
return cssCode?.replace(/&/g, `div[builder-content-id="${contentId}"]`) || "";
|
|
8087
|
+
};
|
|
8088
|
+
var DEFAULT_STYLES = `
|
|
8089
|
+
.builder-button {
|
|
8090
|
+
all: unset;
|
|
8091
|
+
}
|
|
8092
|
+
|
|
8093
|
+
.builder-text > p:first-of-type, .builder-text > .builder-paragraph:first-of-type {
|
|
8094
|
+
margin: 0;
|
|
8095
|
+
}
|
|
8096
|
+
.builder-text > p, .builder-text > .builder-paragraph {
|
|
8097
|
+
color: inherit;
|
|
8098
|
+
line-height: inherit;
|
|
8099
|
+
letter-spacing: inherit;
|
|
8100
|
+
font-weight: inherit;
|
|
8101
|
+
font-size: inherit;
|
|
8102
|
+
text-align: inherit;
|
|
8103
|
+
font-family: inherit;
|
|
8104
|
+
}
|
|
8105
|
+
`;
|
|
8106
|
+
var getDefaultStyles = (isNested) => {
|
|
8107
|
+
return !isNested ? DEFAULT_STYLES : "";
|
|
8108
|
+
};
|
|
8109
|
+
var getWrapperClassName = (variationId) => {
|
|
8110
|
+
return `variant-${variationId}`;
|
|
8111
|
+
};
|
|
8112
|
+
|
|
7769
8113
|
// src/components/content/components/enable-editor.tsx
|
|
7770
8114
|
function EnableEditor(props) {
|
|
7771
8115
|
const [ContentWrapper, setContentWrapper] = createSignal(props.contentWrapper || "div");
|
|
@@ -7805,6 +8149,12 @@ function EnableEditor(props) {
|
|
|
7805
8149
|
content: newContentValue
|
|
7806
8150
|
}));
|
|
7807
8151
|
}
|
|
8152
|
+
const showContentProps = createMemo(() => {
|
|
8153
|
+
return props.showContent ? {} : {
|
|
8154
|
+
hidden: true,
|
|
8155
|
+
"aria-hidden": true
|
|
8156
|
+
};
|
|
8157
|
+
});
|
|
7808
8158
|
function processMessage(event) {
|
|
7809
8159
|
return createEditorListener({
|
|
7810
8160
|
model: props.model,
|
|
@@ -8023,7 +8373,7 @@ function EnableEditor(props) {
|
|
|
8023
8373
|
get children() {
|
|
8024
8374
|
return createComponent(Dynamic, mergeProps({
|
|
8025
8375
|
get ["class"]() {
|
|
8026
|
-
return
|
|
8376
|
+
return getWrapperClassName(props.content?.testVariationId || props.content?.id);
|
|
8027
8377
|
}
|
|
8028
8378
|
}, {}, {
|
|
8029
8379
|
ref(r$) {
|
|
@@ -8037,10 +8387,7 @@ function EnableEditor(props) {
|
|
|
8037
8387
|
get ["builder-model"]() {
|
|
8038
8388
|
return props.model;
|
|
8039
8389
|
}
|
|
8040
|
-
}, {}, () => props.
|
|
8041
|
-
hidden: true,
|
|
8042
|
-
"aria-hidden": true
|
|
8043
|
-
}, () => props.contentWrapperProps, {
|
|
8390
|
+
}, {}, showContentProps, () => props.contentWrapperProps, {
|
|
8044
8391
|
get component() {
|
|
8045
8392
|
return ContentWrapper();
|
|
8046
8393
|
},
|
|
@@ -8054,84 +8401,6 @@ function EnableEditor(props) {
|
|
|
8054
8401
|
});
|
|
8055
8402
|
}
|
|
8056
8403
|
var enable_editor_default = EnableEditor;
|
|
8057
|
-
|
|
8058
|
-
// src/components/content/components/styles.helpers.ts
|
|
8059
|
-
var getCssFromFont = (font) => {
|
|
8060
|
-
const family = font.family + (font.kind && !font.kind.includes("#") ? ", " + font.kind : "");
|
|
8061
|
-
const name = family.split(",")[0];
|
|
8062
|
-
const url = font.fileUrl ?? font?.files?.regular;
|
|
8063
|
-
let str = "";
|
|
8064
|
-
if (url && family && name) {
|
|
8065
|
-
str += `
|
|
8066
|
-
@font-face {
|
|
8067
|
-
font-family: "${family}";
|
|
8068
|
-
src: local("${name}"), url('${url}') format('woff2');
|
|
8069
|
-
font-display: fallback;
|
|
8070
|
-
font-weight: 400;
|
|
8071
|
-
}
|
|
8072
|
-
`.trim();
|
|
8073
|
-
}
|
|
8074
|
-
if (font.files) {
|
|
8075
|
-
for (const weight in font.files) {
|
|
8076
|
-
const isNumber = String(Number(weight)) === weight;
|
|
8077
|
-
if (!isNumber) {
|
|
8078
|
-
continue;
|
|
8079
|
-
}
|
|
8080
|
-
const weightUrl = font.files[weight];
|
|
8081
|
-
if (weightUrl && weightUrl !== url) {
|
|
8082
|
-
str += `
|
|
8083
|
-
@font-face {
|
|
8084
|
-
font-family: "${family}";
|
|
8085
|
-
src: url('${weightUrl}') format('woff2');
|
|
8086
|
-
font-display: fallback;
|
|
8087
|
-
font-weight: ${weight};
|
|
8088
|
-
}
|
|
8089
|
-
`.trim();
|
|
8090
|
-
}
|
|
8091
|
-
}
|
|
8092
|
-
}
|
|
8093
|
-
return str;
|
|
8094
|
-
};
|
|
8095
|
-
var getFontCss = ({
|
|
8096
|
-
customFonts
|
|
8097
|
-
}) => {
|
|
8098
|
-
return customFonts?.map((font) => getCssFromFont(font))?.join(" ") || "";
|
|
8099
|
-
};
|
|
8100
|
-
var getCss = ({
|
|
8101
|
-
cssCode,
|
|
8102
|
-
contentId
|
|
8103
|
-
}) => {
|
|
8104
|
-
if (!cssCode) {
|
|
8105
|
-
return "";
|
|
8106
|
-
}
|
|
8107
|
-
if (!contentId) {
|
|
8108
|
-
return cssCode;
|
|
8109
|
-
}
|
|
8110
|
-
return cssCode?.replace(/&/g, `div[builder-content-id="${contentId}"]`) || "";
|
|
8111
|
-
};
|
|
8112
|
-
var DEFAULT_STYLES = `
|
|
8113
|
-
.builder-button {
|
|
8114
|
-
all: unset;
|
|
8115
|
-
}
|
|
8116
|
-
|
|
8117
|
-
.builder-text > p:first-of-type, .builder-text > .builder-paragraph:first-of-type {
|
|
8118
|
-
margin: 0;
|
|
8119
|
-
}
|
|
8120
|
-
.builder-text > p, .builder-text > .builder-paragraph {
|
|
8121
|
-
color: inherit;
|
|
8122
|
-
line-height: inherit;
|
|
8123
|
-
letter-spacing: inherit;
|
|
8124
|
-
font-weight: inherit;
|
|
8125
|
-
font-size: inherit;
|
|
8126
|
-
text-align: inherit;
|
|
8127
|
-
font-family: inherit;
|
|
8128
|
-
}
|
|
8129
|
-
`;
|
|
8130
|
-
var getDefaultStyles = (isNested) => {
|
|
8131
|
-
return !isNested ? DEFAULT_STYLES : "";
|
|
8132
|
-
};
|
|
8133
|
-
|
|
8134
|
-
// src/components/content/components/styles.tsx
|
|
8135
8404
|
function ContentStyles(props) {
|
|
8136
8405
|
const [injectedStyles, setInjectedStyles] = createSignal(`
|
|
8137
8406
|
${getCss({
|
|
@@ -8550,9 +8819,15 @@ var fetchSymbolContent = async ({
|
|
|
8550
8819
|
};
|
|
8551
8820
|
|
|
8552
8821
|
// src/blocks/symbol/symbol.tsx
|
|
8553
|
-
var _tmpl$
|
|
8822
|
+
var _tmpl$18 = /* @__PURE__ */ template(`<div>`);
|
|
8554
8823
|
function Symbol2(props) {
|
|
8555
8824
|
const [contentToUse, setContentToUse] = createSignal(props.symbol?.content);
|
|
8825
|
+
const blocksWrapper = createMemo(() => {
|
|
8826
|
+
return "div";
|
|
8827
|
+
});
|
|
8828
|
+
const contentWrapper = createMemo(() => {
|
|
8829
|
+
return "div";
|
|
8830
|
+
});
|
|
8556
8831
|
const className = createMemo(() => {
|
|
8557
8832
|
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(" ");
|
|
8558
8833
|
});
|
|
@@ -8576,7 +8851,7 @@ function Symbol2(props) {
|
|
|
8576
8851
|
}
|
|
8577
8852
|
createEffect(on(() => [onUpdateFn_0_props_symbol()], onUpdateFn_0));
|
|
8578
8853
|
return (() => {
|
|
8579
|
-
const _el$ = _tmpl$
|
|
8854
|
+
const _el$ = _tmpl$18();
|
|
8580
8855
|
spread(_el$, mergeProps({
|
|
8581
8856
|
get ["class"]() {
|
|
8582
8857
|
return className();
|
|
@@ -8615,8 +8890,12 @@ function Symbol2(props) {
|
|
|
8615
8890
|
get linkComponent() {
|
|
8616
8891
|
return props.builderLinkComponent;
|
|
8617
8892
|
},
|
|
8618
|
-
blocksWrapper
|
|
8619
|
-
|
|
8893
|
+
get blocksWrapper() {
|
|
8894
|
+
return blocksWrapper();
|
|
8895
|
+
},
|
|
8896
|
+
get contentWrapper() {
|
|
8897
|
+
return contentWrapper();
|
|
8898
|
+
}
|
|
8620
8899
|
}));
|
|
8621
8900
|
return _el$;
|
|
8622
8901
|
})();
|