@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/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";
|
|
@@ -3860,6 +3864,7 @@ function mapStyleObjToStrIfNeeded(style) {
|
|
|
3860
3864
|
case "svelte":
|
|
3861
3865
|
case "vue":
|
|
3862
3866
|
case "solid":
|
|
3867
|
+
case "angular":
|
|
3863
3868
|
return convertStyleMapToCSSArray(style).join(" ");
|
|
3864
3869
|
case "qwik":
|
|
3865
3870
|
case "reactNative":
|
|
@@ -3932,6 +3937,12 @@ var getRepeatItemData = ({
|
|
|
3932
3937
|
}));
|
|
3933
3938
|
return repeatArray;
|
|
3934
3939
|
};
|
|
3940
|
+
var shouldPassLinkComponent = (block) => {
|
|
3941
|
+
return block && (block.isRSC || ["Core:Button", "Symbol", "Columns", "Form:Form", "Builder: Tabs"].includes(block.name));
|
|
3942
|
+
};
|
|
3943
|
+
var shouldPassRegisteredComponents = (block) => {
|
|
3944
|
+
return block && (block.isRSC || ["Symbol", "Columns", "Form:Form", "Builder: Tabs"].includes(block.name));
|
|
3945
|
+
};
|
|
3935
3946
|
|
|
3936
3947
|
// src/constants/device-sizes.ts
|
|
3937
3948
|
var SIZES = {
|
|
@@ -4188,21 +4199,24 @@ function BlockWrapper(props) {
|
|
|
4188
4199
|
}
|
|
4189
4200
|
var block_wrapper_default = BlockWrapper;
|
|
4190
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
|
+
});
|
|
4191
4217
|
return createComponent(Dynamic, mergeProps(() => props.wrapperProps, {
|
|
4192
4218
|
get attributes() {
|
|
4193
|
-
return
|
|
4194
|
-
...getBlockProperties({
|
|
4195
|
-
block: props.block,
|
|
4196
|
-
context: props.context
|
|
4197
|
-
}),
|
|
4198
|
-
...getBlockActions({
|
|
4199
|
-
block: props.block,
|
|
4200
|
-
rootState: props.context.rootState,
|
|
4201
|
-
rootSetState: props.context.rootSetState,
|
|
4202
|
-
localState: props.context.localState,
|
|
4203
|
-
context: props.context.context
|
|
4204
|
-
})
|
|
4205
|
-
} : {};
|
|
4219
|
+
return attributes();
|
|
4206
4220
|
},
|
|
4207
4221
|
get component() {
|
|
4208
4222
|
return props.Wrapper;
|
|
@@ -4377,10 +4391,10 @@ function Block(props) {
|
|
|
4377
4391
|
componentOptions: {
|
|
4378
4392
|
...getBlockComponentOptions(processedBlock()),
|
|
4379
4393
|
builderContext: props.context,
|
|
4380
|
-
...
|
|
4394
|
+
...shouldPassLinkComponent(blockComponent()) ? {
|
|
4381
4395
|
builderLinkComponent: props.linkComponent
|
|
4382
4396
|
} : {},
|
|
4383
|
-
...
|
|
4397
|
+
...shouldPassRegisteredComponents(blockComponent()) ? {
|
|
4384
4398
|
builderComponents: props.registeredComponents
|
|
4385
4399
|
} : {}
|
|
4386
4400
|
},
|
|
@@ -4672,6 +4686,11 @@ function Blocks(props) {
|
|
|
4672
4686
|
}
|
|
4673
4687
|
var blocks_default = Blocks;
|
|
4674
4688
|
|
|
4689
|
+
// src/blocks/columns/helpers.ts
|
|
4690
|
+
var getColumnsClass = (id2) => {
|
|
4691
|
+
return `builder-columns ${id2}-breakpoints`;
|
|
4692
|
+
};
|
|
4693
|
+
|
|
4675
4694
|
// src/blocks/columns/columns.tsx
|
|
4676
4695
|
var _tmpl$2 = /* @__PURE__ */ template(`<div>`);
|
|
4677
4696
|
function Columns(props) {
|
|
@@ -4679,6 +4698,9 @@ function Columns(props) {
|
|
|
4679
4698
|
const [cols, setCols] = createSignal(props.columns || []);
|
|
4680
4699
|
const [stackAt, setStackAt] = createSignal(props.stackColumnsAt || "tablet");
|
|
4681
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
|
+
}
|
|
4682
4704
|
function getWidth(index) {
|
|
4683
4705
|
return cols()[index]?.width || 100 / cols().length;
|
|
4684
4706
|
}
|
|
@@ -4698,7 +4720,7 @@ function Columns(props) {
|
|
|
4698
4720
|
}) {
|
|
4699
4721
|
return stackAt() === "never" ? desktopStyle : stackedStyle;
|
|
4700
4722
|
}
|
|
4701
|
-
|
|
4723
|
+
function columnsCssVars() {
|
|
4702
4724
|
return {
|
|
4703
4725
|
"--flex-dir": flexDir(),
|
|
4704
4726
|
"--flex-dir-tablet": getTabletStyle({
|
|
@@ -4706,7 +4728,7 @@ function Columns(props) {
|
|
|
4706
4728
|
desktopStyle: "row"
|
|
4707
4729
|
})
|
|
4708
4730
|
};
|
|
4709
|
-
}
|
|
4731
|
+
}
|
|
4710
4732
|
function columnCssVars(index) {
|
|
4711
4733
|
const gutter = index === 0 ? 0 : gutterSize();
|
|
4712
4734
|
const width = getColumnCssWidth(index);
|
|
@@ -4745,7 +4767,7 @@ function Columns(props) {
|
|
|
4745
4767
|
const breakpointSizes = getSizesForBreakpoints(props.builderContext.content?.meta?.breakpoints || {});
|
|
4746
4768
|
return breakpointSizes[size].max;
|
|
4747
4769
|
}
|
|
4748
|
-
|
|
4770
|
+
function columnsStyles() {
|
|
4749
4771
|
return `
|
|
4750
4772
|
@media (max-width: ${getWidthForBreakpointSize("medium")}px) {
|
|
4751
4773
|
.${props.builderBlock.id}-breakpoints {
|
|
@@ -4771,12 +4793,22 @@ function Columns(props) {
|
|
|
4771
4793
|
}
|
|
4772
4794
|
},
|
|
4773
4795
|
`;
|
|
4774
|
-
}
|
|
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
|
+
}
|
|
4775
4807
|
return (() => {
|
|
4776
4808
|
const _el$ = _tmpl$2();
|
|
4777
4809
|
spread(_el$, mergeProps({
|
|
4778
4810
|
get ["class"]() {
|
|
4779
|
-
return
|
|
4811
|
+
return getColumnsClass(props.builderBlock?.id) + " " + css({
|
|
4780
4812
|
display: "flex",
|
|
4781
4813
|
lineHeight: "normal"
|
|
4782
4814
|
});
|
|
@@ -4805,18 +4837,11 @@ function Columns(props) {
|
|
|
4805
4837
|
return createComponent(dynamic_renderer_default, {
|
|
4806
4838
|
key: index,
|
|
4807
4839
|
get TagName() {
|
|
4808
|
-
return column
|
|
4840
|
+
return getTagName(column);
|
|
4809
4841
|
},
|
|
4810
4842
|
actionAttributes: {},
|
|
4811
4843
|
get attributes() {
|
|
4812
|
-
return
|
|
4813
|
-
...{},
|
|
4814
|
-
...column.link ? {
|
|
4815
|
-
href: column.link
|
|
4816
|
-
} : {},
|
|
4817
|
-
[getClassPropName()]: "builder-column",
|
|
4818
|
-
style: mapStyleObjToStrIfNeeded(columnCssVars(index))
|
|
4819
|
-
};
|
|
4844
|
+
return getAttributes(column, index);
|
|
4820
4845
|
},
|
|
4821
4846
|
get children() {
|
|
4822
4847
|
return createComponent(blocks_default, {
|
|
@@ -5014,7 +5039,7 @@ function Image(props) {
|
|
|
5014
5039
|
}
|
|
5015
5040
|
}), createComponent(Show, {
|
|
5016
5041
|
get when() {
|
|
5017
|
-
return !props.fitContent && props.children;
|
|
5042
|
+
return !props.fitContent && props.builderBlock?.children?.length;
|
|
5018
5043
|
},
|
|
5019
5044
|
get children() {
|
|
5020
5045
|
const _el$5 = _tmpl$32();
|
|
@@ -5758,8 +5783,246 @@ var componentInfo7 = {
|
|
|
5758
5783
|
}]
|
|
5759
5784
|
};
|
|
5760
5785
|
|
|
5761
|
-
// 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
|
+
};
|
|
5762
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 = {
|
|
5763
6026
|
name: "Text",
|
|
5764
6027
|
static: true,
|
|
5765
6028
|
isRSC: true,
|
|
@@ -5778,10 +6041,10 @@ var componentInfo8 = {
|
|
|
5778
6041
|
textAlign: "center"
|
|
5779
6042
|
}
|
|
5780
6043
|
};
|
|
5781
|
-
var _tmpl$
|
|
6044
|
+
var _tmpl$8 = /* @__PURE__ */ template(`<div class=builder-text>`);
|
|
5782
6045
|
function Text(props) {
|
|
5783
6046
|
return (() => {
|
|
5784
|
-
const _el$ = _tmpl$
|
|
6047
|
+
const _el$ = _tmpl$8();
|
|
5785
6048
|
_el$.style.setProperty("outline", "none");
|
|
5786
6049
|
effect(() => _el$.innerHTML = props.text?.toString() || "");
|
|
5787
6050
|
return _el$;
|
|
@@ -5790,7 +6053,7 @@ function Text(props) {
|
|
|
5790
6053
|
var text_default = Text;
|
|
5791
6054
|
|
|
5792
6055
|
// src/blocks/custom-code/component-info.ts
|
|
5793
|
-
var
|
|
6056
|
+
var componentInfo10 = {
|
|
5794
6057
|
name: "Custom Code",
|
|
5795
6058
|
static: true,
|
|
5796
6059
|
requiredPermissions: ["editCode"],
|
|
@@ -5813,7 +6076,7 @@ var componentInfo9 = {
|
|
|
5813
6076
|
advanced: true
|
|
5814
6077
|
}]
|
|
5815
6078
|
};
|
|
5816
|
-
var _tmpl$
|
|
6079
|
+
var _tmpl$9 = /* @__PURE__ */ template(`<div>`);
|
|
5817
6080
|
function CustomCode(props) {
|
|
5818
6081
|
const [scriptsInserted, setScriptsInserted] = createSignal([]);
|
|
5819
6082
|
const [scriptsRun, setScriptsRun] = createSignal([]);
|
|
@@ -5847,7 +6110,7 @@ function CustomCode(props) {
|
|
|
5847
6110
|
}
|
|
5848
6111
|
});
|
|
5849
6112
|
return (() => {
|
|
5850
|
-
const _el$ = _tmpl$
|
|
6113
|
+
const _el$ = _tmpl$9();
|
|
5851
6114
|
const _ref$ = elementRef;
|
|
5852
6115
|
typeof _ref$ === "function" ? use(_ref$, _el$) : elementRef = _el$;
|
|
5853
6116
|
effect((_p$) => {
|
|
@@ -5865,7 +6128,7 @@ function CustomCode(props) {
|
|
|
5865
6128
|
var custom_code_default = CustomCode;
|
|
5866
6129
|
|
|
5867
6130
|
// src/blocks/embed/component-info.ts
|
|
5868
|
-
var
|
|
6131
|
+
var componentInfo11 = {
|
|
5869
6132
|
name: "Embed",
|
|
5870
6133
|
static: true,
|
|
5871
6134
|
inputs: [{
|
|
@@ -5907,7 +6170,7 @@ var SCRIPT_MIME_TYPES = ["text/javascript", "application/javascript", "applicati
|
|
|
5907
6170
|
var isJsScript = (script) => SCRIPT_MIME_TYPES.includes(script.type);
|
|
5908
6171
|
|
|
5909
6172
|
// src/blocks/embed/embed.tsx
|
|
5910
|
-
var _tmpl$
|
|
6173
|
+
var _tmpl$10 = /* @__PURE__ */ template(`<div class=builder-embed>`);
|
|
5911
6174
|
function Embed(props) {
|
|
5912
6175
|
const [scriptsInserted, setScriptsInserted] = createSignal([]);
|
|
5913
6176
|
const [scriptsRun, setScriptsRun] = createSignal([]);
|
|
@@ -5944,7 +6207,7 @@ function Embed(props) {
|
|
|
5944
6207
|
}
|
|
5945
6208
|
createEffect(on(() => [onUpdateFn_0_elem(), onUpdateFn_0_ranInitFn__()], onUpdateFn_0));
|
|
5946
6209
|
return (() => {
|
|
5947
|
-
const _el$ = _tmpl$
|
|
6210
|
+
const _el$ = _tmpl$10();
|
|
5948
6211
|
const _ref$ = elem;
|
|
5949
6212
|
typeof _ref$ === "function" ? use(_ref$, _el$) : elem = _el$;
|
|
5950
6213
|
effect(() => _el$.innerHTML = props.content);
|
|
@@ -5954,7 +6217,7 @@ function Embed(props) {
|
|
|
5954
6217
|
var embed_default = Embed;
|
|
5955
6218
|
|
|
5956
6219
|
// src/blocks/form/form/component-info.ts
|
|
5957
|
-
var
|
|
6220
|
+
var componentInfo12 = {
|
|
5958
6221
|
name: "Form:Form",
|
|
5959
6222
|
// editableTags: ['builder-form-error']
|
|
5960
6223
|
defaults: {
|
|
@@ -6201,8 +6464,8 @@ var get = (obj, path, defaultValue) => {
|
|
|
6201
6464
|
};
|
|
6202
6465
|
|
|
6203
6466
|
// src/blocks/form/form/form.tsx
|
|
6204
|
-
var _tmpl$
|
|
6205
|
-
var _tmpl$
|
|
6467
|
+
var _tmpl$11 = /* @__PURE__ */ template(`<pre>`);
|
|
6468
|
+
var _tmpl$24 = /* @__PURE__ */ template(`<form>`);
|
|
6206
6469
|
function FormComponent(props) {
|
|
6207
6470
|
const [formState, setFormState] = createSignal("unsubmitted");
|
|
6208
6471
|
const [responseData, setResponseData] = createSignal(null);
|
|
@@ -6388,7 +6651,7 @@ function FormComponent(props) {
|
|
|
6388
6651
|
}
|
|
6389
6652
|
let formRef;
|
|
6390
6653
|
return (() => {
|
|
6391
|
-
const _el$ = _tmpl$
|
|
6654
|
+
const _el$ = _tmpl$24();
|
|
6392
6655
|
_el$.addEventListener("submit", (event) => onSubmit(event));
|
|
6393
6656
|
const _ref$ = formRef;
|
|
6394
6657
|
typeof _ref$ === "function" ? use(_ref$, _el$) : formRef = _el$;
|
|
@@ -6471,7 +6734,7 @@ function FormComponent(props) {
|
|
|
6471
6734
|
return memo(() => submissionState() === "error")() && responseData();
|
|
6472
6735
|
},
|
|
6473
6736
|
get children() {
|
|
6474
|
-
const _el$2 = _tmpl$
|
|
6737
|
+
const _el$2 = _tmpl$11();
|
|
6475
6738
|
insert(_el$2, () => JSON.stringify(responseData(), null, 2));
|
|
6476
6739
|
effect(() => className(_el$2, "builder-form-error-text " + css({
|
|
6477
6740
|
padding: "10px",
|
|
@@ -6503,7 +6766,7 @@ function FormComponent(props) {
|
|
|
6503
6766
|
var form_default = FormComponent;
|
|
6504
6767
|
|
|
6505
6768
|
// src/blocks/form/input/component-info.ts
|
|
6506
|
-
var
|
|
6769
|
+
var componentInfo13 = {
|
|
6507
6770
|
name: "Form:Input",
|
|
6508
6771
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fad6f37889d9e40bbbbc72cdb5875d6ca",
|
|
6509
6772
|
inputs: [
|
|
@@ -6555,10 +6818,10 @@ var componentInfo12 = {
|
|
|
6555
6818
|
borderColor: "#ccc"
|
|
6556
6819
|
}
|
|
6557
6820
|
};
|
|
6558
|
-
var _tmpl$
|
|
6821
|
+
var _tmpl$12 = /* @__PURE__ */ template(`<input>`);
|
|
6559
6822
|
function FormInputComponent(props) {
|
|
6560
6823
|
return (() => {
|
|
6561
|
-
const _el$ = _tmpl$
|
|
6824
|
+
const _el$ = _tmpl$12();
|
|
6562
6825
|
spread(_el$, mergeProps({}, () => props.attributes, {
|
|
6563
6826
|
get key() {
|
|
6564
6827
|
return isEditing() && props.defaultValue ? props.defaultValue : "default-key";
|
|
@@ -6588,7 +6851,7 @@ function FormInputComponent(props) {
|
|
|
6588
6851
|
var input_default = FormInputComponent;
|
|
6589
6852
|
|
|
6590
6853
|
// src/blocks/form/select/component-info.ts
|
|
6591
|
-
var
|
|
6854
|
+
var componentInfo14 = {
|
|
6592
6855
|
name: "Form:Select",
|
|
6593
6856
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F83acca093fb24aaf94dee136e9a4b045",
|
|
6594
6857
|
defaultStyles: {
|
|
@@ -6631,11 +6894,11 @@ var componentInfo13 = {
|
|
|
6631
6894
|
static: true,
|
|
6632
6895
|
noWrap: true
|
|
6633
6896
|
};
|
|
6634
|
-
var _tmpl$
|
|
6635
|
-
var _tmpl$
|
|
6897
|
+
var _tmpl$13 = /* @__PURE__ */ template(`<select>`);
|
|
6898
|
+
var _tmpl$25 = /* @__PURE__ */ template(`<option>`);
|
|
6636
6899
|
function SelectComponent(props) {
|
|
6637
6900
|
return (() => {
|
|
6638
|
-
const _el$ = _tmpl$
|
|
6901
|
+
const _el$ = _tmpl$13();
|
|
6639
6902
|
spread(_el$, mergeProps({}, () => props.attributes, {
|
|
6640
6903
|
get value() {
|
|
6641
6904
|
return props.value;
|
|
@@ -6657,7 +6920,7 @@ function SelectComponent(props) {
|
|
|
6657
6920
|
children: (option, _index) => {
|
|
6658
6921
|
const index = _index();
|
|
6659
6922
|
return (() => {
|
|
6660
|
-
const _el$2 = _tmpl$
|
|
6923
|
+
const _el$2 = _tmpl$25();
|
|
6661
6924
|
insert(_el$2, () => option.name || option.value);
|
|
6662
6925
|
effect(() => setAttribute(_el$2, "key", `${option.name}-${index}`));
|
|
6663
6926
|
effect(() => _el$2.value = option.value);
|
|
@@ -6671,7 +6934,7 @@ function SelectComponent(props) {
|
|
|
6671
6934
|
var select_default = SelectComponent;
|
|
6672
6935
|
|
|
6673
6936
|
// src/blocks/form/submit-button/component-info.ts
|
|
6674
|
-
var
|
|
6937
|
+
var componentInfo15 = {
|
|
6675
6938
|
name: "Form:SubmitButton",
|
|
6676
6939
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fdf2820ffed1f4349a94c40b3221f5b98",
|
|
6677
6940
|
defaultStyles: {
|
|
@@ -6697,10 +6960,10 @@ var componentInfo14 = {
|
|
|
6697
6960
|
// TODO: defaultChildren
|
|
6698
6961
|
// canHaveChildren: true,
|
|
6699
6962
|
};
|
|
6700
|
-
var _tmpl$
|
|
6963
|
+
var _tmpl$14 = /* @__PURE__ */ template(`<button type=submit>`);
|
|
6701
6964
|
function SubmitButton(props) {
|
|
6702
6965
|
return (() => {
|
|
6703
|
-
const _el$ = _tmpl$
|
|
6966
|
+
const _el$ = _tmpl$14();
|
|
6704
6967
|
spread(_el$, mergeProps({}, () => props.attributes), false, true);
|
|
6705
6968
|
insert(_el$, () => props.text);
|
|
6706
6969
|
return _el$;
|
|
@@ -6709,7 +6972,7 @@ function SubmitButton(props) {
|
|
|
6709
6972
|
var submit_button_default = SubmitButton;
|
|
6710
6973
|
|
|
6711
6974
|
// src/blocks/img/component-info.ts
|
|
6712
|
-
var
|
|
6975
|
+
var componentInfo16 = {
|
|
6713
6976
|
// friendlyName?
|
|
6714
6977
|
name: "Raw:Img",
|
|
6715
6978
|
hideFromInsertMenu: true,
|
|
@@ -6724,10 +6987,10 @@ var componentInfo15 = {
|
|
|
6724
6987
|
noWrap: true,
|
|
6725
6988
|
static: true
|
|
6726
6989
|
};
|
|
6727
|
-
var _tmpl$
|
|
6990
|
+
var _tmpl$15 = /* @__PURE__ */ template(`<img>`);
|
|
6728
6991
|
function ImgComponent(props) {
|
|
6729
6992
|
return (() => {
|
|
6730
|
-
const _el$ = _tmpl$
|
|
6993
|
+
const _el$ = _tmpl$15();
|
|
6731
6994
|
spread(_el$, mergeProps({
|
|
6732
6995
|
get style() {
|
|
6733
6996
|
return {
|
|
@@ -6751,7 +7014,7 @@ function ImgComponent(props) {
|
|
|
6751
7014
|
var img_default = ImgComponent;
|
|
6752
7015
|
|
|
6753
7016
|
// src/blocks/video/component-info.ts
|
|
6754
|
-
var
|
|
7017
|
+
var componentInfo17 = {
|
|
6755
7018
|
name: "Video",
|
|
6756
7019
|
canHaveChildren: true,
|
|
6757
7020
|
defaultStyles: {
|
|
@@ -6833,9 +7096,9 @@ var componentInfo16 = {
|
|
|
6833
7096
|
advanced: true
|
|
6834
7097
|
}]
|
|
6835
7098
|
};
|
|
6836
|
-
var _tmpl$
|
|
6837
|
-
var _tmpl$
|
|
6838
|
-
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>`);
|
|
6839
7102
|
function Video(props) {
|
|
6840
7103
|
const videoProps = createMemo(() => {
|
|
6841
7104
|
return {
|
|
@@ -6862,7 +7125,7 @@ function Video(props) {
|
|
|
6862
7125
|
};
|
|
6863
7126
|
});
|
|
6864
7127
|
return (() => {
|
|
6865
|
-
const _el$ = _tmpl$
|
|
7128
|
+
const _el$ = _tmpl$34(), _el$2 = _el$.firstChild;
|
|
6866
7129
|
_el$.style.setProperty("position", "relative");
|
|
6867
7130
|
spread(_el$2, mergeProps(spreadProps, {
|
|
6868
7131
|
get preload() {
|
|
@@ -6896,7 +7159,7 @@ function Video(props) {
|
|
|
6896
7159
|
return !props.lazyLoad;
|
|
6897
7160
|
},
|
|
6898
7161
|
get children() {
|
|
6899
|
-
const _el$3 = _tmpl$
|
|
7162
|
+
const _el$3 = _tmpl$16();
|
|
6900
7163
|
effect(() => setAttribute(_el$3, "src", props.video));
|
|
6901
7164
|
return _el$3;
|
|
6902
7165
|
}
|
|
@@ -6906,7 +7169,7 @@ function Video(props) {
|
|
|
6906
7169
|
return props.aspectRatio && !(props.fitContent && props.builderBlock?.children?.length);
|
|
6907
7170
|
},
|
|
6908
7171
|
get children() {
|
|
6909
|
-
const _el$4 = _tmpl$
|
|
7172
|
+
const _el$4 = _tmpl$26();
|
|
6910
7173
|
_el$4.style.setProperty("width", "100%");
|
|
6911
7174
|
_el$4.style.setProperty("pointer-events", "none");
|
|
6912
7175
|
_el$4.style.setProperty("font-size", "0px");
|
|
@@ -6919,7 +7182,7 @@ function Video(props) {
|
|
|
6919
7182
|
return props.builderBlock?.children?.length && props.fitContent;
|
|
6920
7183
|
},
|
|
6921
7184
|
get children() {
|
|
6922
|
-
const _el$5 = _tmpl$
|
|
7185
|
+
const _el$5 = _tmpl$26();
|
|
6923
7186
|
_el$5.style.setProperty("display", "flex");
|
|
6924
7187
|
_el$5.style.setProperty("flex-direction", "column");
|
|
6925
7188
|
_el$5.style.setProperty("align-items", "stretch");
|
|
@@ -6932,7 +7195,7 @@ function Video(props) {
|
|
|
6932
7195
|
return props.builderBlock?.children?.length && !props.fitContent;
|
|
6933
7196
|
},
|
|
6934
7197
|
get children() {
|
|
6935
|
-
const _el$6 = _tmpl$
|
|
7198
|
+
const _el$6 = _tmpl$26();
|
|
6936
7199
|
_el$6.style.setProperty("pointer-events", "none");
|
|
6937
7200
|
_el$6.style.setProperty("display", "flex");
|
|
6938
7201
|
_el$6.style.setProperty("flex-direction", "column");
|
|
@@ -6954,28 +7217,28 @@ var video_default = Video;
|
|
|
6954
7217
|
// src/constants/extra-components.ts
|
|
6955
7218
|
var getExtraComponents = () => [{
|
|
6956
7219
|
component: custom_code_default,
|
|
6957
|
-
...
|
|
7220
|
+
...componentInfo10
|
|
6958
7221
|
}, {
|
|
6959
7222
|
component: embed_default,
|
|
6960
|
-
...
|
|
7223
|
+
...componentInfo11
|
|
6961
7224
|
}, ...TARGET === "rsc" ? [] : [{
|
|
6962
7225
|
component: form_default,
|
|
6963
|
-
...
|
|
7226
|
+
...componentInfo12
|
|
6964
7227
|
}, {
|
|
6965
7228
|
component: input_default,
|
|
6966
|
-
...
|
|
7229
|
+
...componentInfo13
|
|
6967
7230
|
}, {
|
|
6968
7231
|
component: submit_button_default,
|
|
6969
|
-
...
|
|
7232
|
+
...componentInfo15
|
|
6970
7233
|
}, {
|
|
6971
7234
|
component: select_default,
|
|
6972
|
-
...
|
|
7235
|
+
...componentInfo14
|
|
6973
7236
|
}], {
|
|
6974
7237
|
component: img_default,
|
|
6975
|
-
...
|
|
7238
|
+
...componentInfo16
|
|
6976
7239
|
}, {
|
|
6977
7240
|
component: video_default,
|
|
6978
|
-
...
|
|
7241
|
+
...componentInfo17
|
|
6979
7242
|
}];
|
|
6980
7243
|
|
|
6981
7244
|
// src/constants/builder-registered-components.ts
|
|
@@ -7002,8 +7265,11 @@ var getDefaultRegisteredComponents = () => [{
|
|
|
7002
7265
|
...componentInfo7
|
|
7003
7266
|
}, {
|
|
7004
7267
|
component: text_default,
|
|
7268
|
+
...componentInfo9
|
|
7269
|
+
}, ...TARGET === "rsc" ? [] : [{
|
|
7270
|
+
component: tabs_default,
|
|
7005
7271
|
...componentInfo8
|
|
7006
|
-
}, ...getExtraComponents()];
|
|
7272
|
+
}], ...getExtraComponents()];
|
|
7007
7273
|
|
|
7008
7274
|
// src/functions/register-component.ts
|
|
7009
7275
|
var createRegisterComponentMessage = (info) => ({
|
|
@@ -7072,10 +7338,10 @@ var getUpdateVariantVisibilityScript = ({
|
|
|
7072
7338
|
}) => `window.${UPDATE_VARIANT_VISIBILITY_SCRIPT_FN_NAME}(
|
|
7073
7339
|
"${variationId}", "${contentId}", ${isHydrationTarget}
|
|
7074
7340
|
)`;
|
|
7075
|
-
var _tmpl$
|
|
7341
|
+
var _tmpl$17 = /* @__PURE__ */ template(`<script>`);
|
|
7076
7342
|
function InlinedScript(props) {
|
|
7077
7343
|
return (() => {
|
|
7078
|
-
const _el$ = _tmpl$
|
|
7344
|
+
const _el$ = _tmpl$17();
|
|
7079
7345
|
effect((_p$) => {
|
|
7080
7346
|
const _v$ = props.scriptStr, _v$2 = props.id;
|
|
7081
7347
|
_v$ !== _p$._v$ && (_el$.innerHTML = _p$._v$ = _v$);
|
|
@@ -7569,7 +7835,7 @@ function isFromTrustedHost(trustedHosts, e) {
|
|
|
7569
7835
|
}
|
|
7570
7836
|
|
|
7571
7837
|
// src/constants/sdk-version.ts
|
|
7572
|
-
var SDK_VERSION = "1.0.
|
|
7838
|
+
var SDK_VERSION = "1.0.25";
|
|
7573
7839
|
|
|
7574
7840
|
// src/functions/register.ts
|
|
7575
7841
|
var registry = {};
|
|
@@ -7765,6 +8031,85 @@ var subscribeToEditor = (model, callback, options) => {
|
|
|
7765
8031
|
};
|
|
7766
8032
|
};
|
|
7767
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
|
+
|
|
7768
8113
|
// src/components/content/components/enable-editor.tsx
|
|
7769
8114
|
function EnableEditor(props) {
|
|
7770
8115
|
const [ContentWrapper, setContentWrapper] = createSignal(props.contentWrapper || "div");
|
|
@@ -7804,6 +8149,12 @@ function EnableEditor(props) {
|
|
|
7804
8149
|
content: newContentValue
|
|
7805
8150
|
}));
|
|
7806
8151
|
}
|
|
8152
|
+
const showContentProps = createMemo(() => {
|
|
8153
|
+
return props.showContent ? {} : {
|
|
8154
|
+
hidden: true,
|
|
8155
|
+
"aria-hidden": true
|
|
8156
|
+
};
|
|
8157
|
+
});
|
|
7807
8158
|
function processMessage(event) {
|
|
7808
8159
|
return createEditorListener({
|
|
7809
8160
|
model: props.model,
|
|
@@ -8022,7 +8373,7 @@ function EnableEditor(props) {
|
|
|
8022
8373
|
get children() {
|
|
8023
8374
|
return createComponent(Dynamic, mergeProps({
|
|
8024
8375
|
get ["class"]() {
|
|
8025
|
-
return
|
|
8376
|
+
return getWrapperClassName(props.content?.testVariationId || props.content?.id);
|
|
8026
8377
|
}
|
|
8027
8378
|
}, {}, {
|
|
8028
8379
|
ref(r$) {
|
|
@@ -8036,10 +8387,7 @@ function EnableEditor(props) {
|
|
|
8036
8387
|
get ["builder-model"]() {
|
|
8037
8388
|
return props.model;
|
|
8038
8389
|
}
|
|
8039
|
-
}, {}, () => props.
|
|
8040
|
-
hidden: true,
|
|
8041
|
-
"aria-hidden": true
|
|
8042
|
-
}, () => props.contentWrapperProps, {
|
|
8390
|
+
}, {}, showContentProps, () => props.contentWrapperProps, {
|
|
8043
8391
|
get component() {
|
|
8044
8392
|
return ContentWrapper();
|
|
8045
8393
|
},
|
|
@@ -8053,84 +8401,6 @@ function EnableEditor(props) {
|
|
|
8053
8401
|
});
|
|
8054
8402
|
}
|
|
8055
8403
|
var enable_editor_default = EnableEditor;
|
|
8056
|
-
|
|
8057
|
-
// src/components/content/components/styles.helpers.ts
|
|
8058
|
-
var getCssFromFont = (font) => {
|
|
8059
|
-
const family = font.family + (font.kind && !font.kind.includes("#") ? ", " + font.kind : "");
|
|
8060
|
-
const name = family.split(",")[0];
|
|
8061
|
-
const url = font.fileUrl ?? font?.files?.regular;
|
|
8062
|
-
let str = "";
|
|
8063
|
-
if (url && family && name) {
|
|
8064
|
-
str += `
|
|
8065
|
-
@font-face {
|
|
8066
|
-
font-family: "${family}";
|
|
8067
|
-
src: local("${name}"), url('${url}') format('woff2');
|
|
8068
|
-
font-display: fallback;
|
|
8069
|
-
font-weight: 400;
|
|
8070
|
-
}
|
|
8071
|
-
`.trim();
|
|
8072
|
-
}
|
|
8073
|
-
if (font.files) {
|
|
8074
|
-
for (const weight in font.files) {
|
|
8075
|
-
const isNumber = String(Number(weight)) === weight;
|
|
8076
|
-
if (!isNumber) {
|
|
8077
|
-
continue;
|
|
8078
|
-
}
|
|
8079
|
-
const weightUrl = font.files[weight];
|
|
8080
|
-
if (weightUrl && weightUrl !== url) {
|
|
8081
|
-
str += `
|
|
8082
|
-
@font-face {
|
|
8083
|
-
font-family: "${family}";
|
|
8084
|
-
src: url('${weightUrl}') format('woff2');
|
|
8085
|
-
font-display: fallback;
|
|
8086
|
-
font-weight: ${weight};
|
|
8087
|
-
}
|
|
8088
|
-
`.trim();
|
|
8089
|
-
}
|
|
8090
|
-
}
|
|
8091
|
-
}
|
|
8092
|
-
return str;
|
|
8093
|
-
};
|
|
8094
|
-
var getFontCss = ({
|
|
8095
|
-
customFonts
|
|
8096
|
-
}) => {
|
|
8097
|
-
return customFonts?.map((font) => getCssFromFont(font))?.join(" ") || "";
|
|
8098
|
-
};
|
|
8099
|
-
var getCss = ({
|
|
8100
|
-
cssCode,
|
|
8101
|
-
contentId
|
|
8102
|
-
}) => {
|
|
8103
|
-
if (!cssCode) {
|
|
8104
|
-
return "";
|
|
8105
|
-
}
|
|
8106
|
-
if (!contentId) {
|
|
8107
|
-
return cssCode;
|
|
8108
|
-
}
|
|
8109
|
-
return cssCode?.replace(/&/g, `div[builder-content-id="${contentId}"]`) || "";
|
|
8110
|
-
};
|
|
8111
|
-
var DEFAULT_STYLES = `
|
|
8112
|
-
.builder-button {
|
|
8113
|
-
all: unset;
|
|
8114
|
-
}
|
|
8115
|
-
|
|
8116
|
-
.builder-text > p:first-of-type, .builder-text > .builder-paragraph:first-of-type {
|
|
8117
|
-
margin: 0;
|
|
8118
|
-
}
|
|
8119
|
-
.builder-text > p, .builder-text > .builder-paragraph {
|
|
8120
|
-
color: inherit;
|
|
8121
|
-
line-height: inherit;
|
|
8122
|
-
letter-spacing: inherit;
|
|
8123
|
-
font-weight: inherit;
|
|
8124
|
-
font-size: inherit;
|
|
8125
|
-
text-align: inherit;
|
|
8126
|
-
font-family: inherit;
|
|
8127
|
-
}
|
|
8128
|
-
`;
|
|
8129
|
-
var getDefaultStyles = (isNested) => {
|
|
8130
|
-
return !isNested ? DEFAULT_STYLES : "";
|
|
8131
|
-
};
|
|
8132
|
-
|
|
8133
|
-
// src/components/content/components/styles.tsx
|
|
8134
8404
|
function ContentStyles(props) {
|
|
8135
8405
|
const [injectedStyles, setInjectedStyles] = createSignal(`
|
|
8136
8406
|
${getCss({
|
|
@@ -8549,9 +8819,15 @@ var fetchSymbolContent = async ({
|
|
|
8549
8819
|
};
|
|
8550
8820
|
|
|
8551
8821
|
// src/blocks/symbol/symbol.tsx
|
|
8552
|
-
var _tmpl$
|
|
8822
|
+
var _tmpl$18 = /* @__PURE__ */ template(`<div>`);
|
|
8553
8823
|
function Symbol2(props) {
|
|
8554
8824
|
const [contentToUse, setContentToUse] = createSignal(props.symbol?.content);
|
|
8825
|
+
const blocksWrapper = createMemo(() => {
|
|
8826
|
+
return "div";
|
|
8827
|
+
});
|
|
8828
|
+
const contentWrapper = createMemo(() => {
|
|
8829
|
+
return "div";
|
|
8830
|
+
});
|
|
8555
8831
|
const className = createMemo(() => {
|
|
8556
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(" ");
|
|
8557
8833
|
});
|
|
@@ -8575,7 +8851,7 @@ function Symbol2(props) {
|
|
|
8575
8851
|
}
|
|
8576
8852
|
createEffect(on(() => [onUpdateFn_0_props_symbol()], onUpdateFn_0));
|
|
8577
8853
|
return (() => {
|
|
8578
|
-
const _el$ = _tmpl$
|
|
8854
|
+
const _el$ = _tmpl$18();
|
|
8579
8855
|
spread(_el$, mergeProps({
|
|
8580
8856
|
get ["class"]() {
|
|
8581
8857
|
return className();
|
|
@@ -8614,8 +8890,12 @@ function Symbol2(props) {
|
|
|
8614
8890
|
get linkComponent() {
|
|
8615
8891
|
return props.builderLinkComponent;
|
|
8616
8892
|
},
|
|
8617
|
-
blocksWrapper
|
|
8618
|
-
|
|
8893
|
+
get blocksWrapper() {
|
|
8894
|
+
return blocksWrapper();
|
|
8895
|
+
},
|
|
8896
|
+
get contentWrapper() {
|
|
8897
|
+
return contentWrapper();
|
|
8898
|
+
}
|
|
8619
8899
|
}));
|
|
8620
8900
|
return _el$;
|
|
8621
8901
|
})();
|