@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/dev.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";
|
|
@@ -3863,6 +3867,7 @@ function mapStyleObjToStrIfNeeded(style) {
|
|
|
3863
3867
|
case "svelte":
|
|
3864
3868
|
case "vue":
|
|
3865
3869
|
case "solid":
|
|
3870
|
+
case "angular":
|
|
3866
3871
|
return convertStyleMapToCSSArray(style).join(" ");
|
|
3867
3872
|
case "qwik":
|
|
3868
3873
|
case "reactNative":
|
|
@@ -3938,6 +3943,12 @@ var getRepeatItemData = ({
|
|
|
3938
3943
|
}));
|
|
3939
3944
|
return repeatArray;
|
|
3940
3945
|
};
|
|
3946
|
+
var shouldPassLinkComponent = (block) => {
|
|
3947
|
+
return block && (block.isRSC || ["Core:Button", "Symbol", "Columns", "Form:Form", "Builder: Tabs"].includes(block.name));
|
|
3948
|
+
};
|
|
3949
|
+
var shouldPassRegisteredComponents = (block) => {
|
|
3950
|
+
return block && (block.isRSC || ["Symbol", "Columns", "Form:Form", "Builder: Tabs"].includes(block.name));
|
|
3951
|
+
};
|
|
3941
3952
|
|
|
3942
3953
|
// src/constants/device-sizes.ts
|
|
3943
3954
|
var SIZES = {
|
|
@@ -4194,21 +4205,24 @@ function BlockWrapper(props) {
|
|
|
4194
4205
|
}
|
|
4195
4206
|
var block_wrapper_default = BlockWrapper;
|
|
4196
4207
|
function InteractiveElement(props) {
|
|
4208
|
+
const attributes = createMemo(() => {
|
|
4209
|
+
return props.includeBlockProps ? {
|
|
4210
|
+
...getBlockProperties({
|
|
4211
|
+
block: props.block,
|
|
4212
|
+
context: props.context
|
|
4213
|
+
}),
|
|
4214
|
+
...getBlockActions({
|
|
4215
|
+
block: props.block,
|
|
4216
|
+
rootState: props.context.rootState,
|
|
4217
|
+
rootSetState: props.context.rootSetState,
|
|
4218
|
+
localState: props.context.localState,
|
|
4219
|
+
context: props.context.context
|
|
4220
|
+
})
|
|
4221
|
+
} : {};
|
|
4222
|
+
});
|
|
4197
4223
|
return createComponent(Dynamic, mergeProps(() => props.wrapperProps, {
|
|
4198
4224
|
get attributes() {
|
|
4199
|
-
return
|
|
4200
|
-
...getBlockProperties({
|
|
4201
|
-
block: props.block,
|
|
4202
|
-
context: props.context
|
|
4203
|
-
}),
|
|
4204
|
-
...getBlockActions({
|
|
4205
|
-
block: props.block,
|
|
4206
|
-
rootState: props.context.rootState,
|
|
4207
|
-
rootSetState: props.context.rootSetState,
|
|
4208
|
-
localState: props.context.localState,
|
|
4209
|
-
context: props.context.context
|
|
4210
|
-
})
|
|
4211
|
-
} : {};
|
|
4225
|
+
return attributes();
|
|
4212
4226
|
},
|
|
4213
4227
|
get component() {
|
|
4214
4228
|
return props.Wrapper;
|
|
@@ -4383,10 +4397,10 @@ function Block(props) {
|
|
|
4383
4397
|
componentOptions: {
|
|
4384
4398
|
...getBlockComponentOptions(processedBlock()),
|
|
4385
4399
|
builderContext: props.context,
|
|
4386
|
-
...
|
|
4400
|
+
...shouldPassLinkComponent(blockComponent()) ? {
|
|
4387
4401
|
builderLinkComponent: props.linkComponent
|
|
4388
4402
|
} : {},
|
|
4389
|
-
...
|
|
4403
|
+
...shouldPassRegisteredComponents(blockComponent()) ? {
|
|
4390
4404
|
builderComponents: props.registeredComponents
|
|
4391
4405
|
} : {}
|
|
4392
4406
|
},
|
|
@@ -4678,6 +4692,11 @@ function Blocks(props) {
|
|
|
4678
4692
|
}
|
|
4679
4693
|
var blocks_default = Blocks;
|
|
4680
4694
|
|
|
4695
|
+
// src/blocks/columns/helpers.ts
|
|
4696
|
+
var getColumnsClass = (id2) => {
|
|
4697
|
+
return `builder-columns ${id2}-breakpoints`;
|
|
4698
|
+
};
|
|
4699
|
+
|
|
4681
4700
|
// src/blocks/columns/columns.tsx
|
|
4682
4701
|
var _tmpl$2 = /* @__PURE__ */ template(`<div>`);
|
|
4683
4702
|
function Columns(props) {
|
|
@@ -4685,6 +4704,9 @@ function Columns(props) {
|
|
|
4685
4704
|
const [cols, setCols] = createSignal(props.columns || []);
|
|
4686
4705
|
const [stackAt, setStackAt] = createSignal(props.stackColumnsAt || "tablet");
|
|
4687
4706
|
const [flexDir, setFlexDir] = createSignal(props.stackColumnsAt === "never" ? "row" : props.reverseColumnsWhenStacked ? "column-reverse" : "column");
|
|
4707
|
+
function getTagName(column) {
|
|
4708
|
+
return column.link ? props.builderLinkComponent || "a" : "div";
|
|
4709
|
+
}
|
|
4688
4710
|
function getWidth(index) {
|
|
4689
4711
|
return cols()[index]?.width || 100 / cols().length;
|
|
4690
4712
|
}
|
|
@@ -4704,7 +4726,7 @@ function Columns(props) {
|
|
|
4704
4726
|
}) {
|
|
4705
4727
|
return stackAt() === "never" ? desktopStyle : stackedStyle;
|
|
4706
4728
|
}
|
|
4707
|
-
|
|
4729
|
+
function columnsCssVars() {
|
|
4708
4730
|
return {
|
|
4709
4731
|
"--flex-dir": flexDir(),
|
|
4710
4732
|
"--flex-dir-tablet": getTabletStyle({
|
|
@@ -4712,7 +4734,7 @@ function Columns(props) {
|
|
|
4712
4734
|
desktopStyle: "row"
|
|
4713
4735
|
})
|
|
4714
4736
|
};
|
|
4715
|
-
}
|
|
4737
|
+
}
|
|
4716
4738
|
function columnCssVars(index) {
|
|
4717
4739
|
const gutter = index === 0 ? 0 : gutterSize();
|
|
4718
4740
|
const width = getColumnCssWidth(index);
|
|
@@ -4751,7 +4773,7 @@ function Columns(props) {
|
|
|
4751
4773
|
const breakpointSizes = getSizesForBreakpoints(props.builderContext.content?.meta?.breakpoints || {});
|
|
4752
4774
|
return breakpointSizes[size].max;
|
|
4753
4775
|
}
|
|
4754
|
-
|
|
4776
|
+
function columnsStyles() {
|
|
4755
4777
|
return `
|
|
4756
4778
|
@media (max-width: ${getWidthForBreakpointSize("medium")}px) {
|
|
4757
4779
|
.${props.builderBlock.id}-breakpoints {
|
|
@@ -4777,12 +4799,22 @@ function Columns(props) {
|
|
|
4777
4799
|
}
|
|
4778
4800
|
},
|
|
4779
4801
|
`;
|
|
4780
|
-
}
|
|
4802
|
+
}
|
|
4803
|
+
function getAttributes(column, index) {
|
|
4804
|
+
return {
|
|
4805
|
+
...{},
|
|
4806
|
+
...column.link ? {
|
|
4807
|
+
href: column.link
|
|
4808
|
+
} : {},
|
|
4809
|
+
[getClassPropName()]: "builder-column",
|
|
4810
|
+
style: mapStyleObjToStrIfNeeded(columnCssVars(index))
|
|
4811
|
+
};
|
|
4812
|
+
}
|
|
4781
4813
|
return (() => {
|
|
4782
4814
|
const _el$ = _tmpl$2();
|
|
4783
4815
|
spread(_el$, mergeProps({
|
|
4784
4816
|
get ["class"]() {
|
|
4785
|
-
return
|
|
4817
|
+
return getColumnsClass(props.builderBlock?.id) + " " + css({
|
|
4786
4818
|
display: "flex",
|
|
4787
4819
|
lineHeight: "normal"
|
|
4788
4820
|
});
|
|
@@ -4811,18 +4843,11 @@ function Columns(props) {
|
|
|
4811
4843
|
return createComponent(dynamic_renderer_default, {
|
|
4812
4844
|
key: index,
|
|
4813
4845
|
get TagName() {
|
|
4814
|
-
return column
|
|
4846
|
+
return getTagName(column);
|
|
4815
4847
|
},
|
|
4816
4848
|
actionAttributes: {},
|
|
4817
4849
|
get attributes() {
|
|
4818
|
-
return
|
|
4819
|
-
...{},
|
|
4820
|
-
...column.link ? {
|
|
4821
|
-
href: column.link
|
|
4822
|
-
} : {},
|
|
4823
|
-
[getClassPropName()]: "builder-column",
|
|
4824
|
-
style: mapStyleObjToStrIfNeeded(columnCssVars(index))
|
|
4825
|
-
};
|
|
4850
|
+
return getAttributes(column, index);
|
|
4826
4851
|
},
|
|
4827
4852
|
get children() {
|
|
4828
4853
|
return createComponent(blocks_default, {
|
|
@@ -5021,7 +5046,7 @@ function Image(props) {
|
|
|
5021
5046
|
}
|
|
5022
5047
|
}), createComponent(Show, {
|
|
5023
5048
|
get when() {
|
|
5024
|
-
return !props.fitContent && props.children;
|
|
5049
|
+
return !props.fitContent && props.builderBlock?.children?.length;
|
|
5025
5050
|
},
|
|
5026
5051
|
get children() {
|
|
5027
5052
|
const _el$5 = _tmpl$32();
|
|
@@ -5766,8 +5791,246 @@ var componentInfo7 = {
|
|
|
5766
5791
|
}]
|
|
5767
5792
|
};
|
|
5768
5793
|
|
|
5769
|
-
// src/blocks/
|
|
5794
|
+
// src/blocks/tabs/component-info.ts
|
|
5795
|
+
var defaultTab = {
|
|
5796
|
+
"@type": "@builder.io/sdk:Element",
|
|
5797
|
+
responsiveStyles: {
|
|
5798
|
+
large: {
|
|
5799
|
+
paddingLeft: "20px",
|
|
5800
|
+
paddingRight: "20px",
|
|
5801
|
+
paddingTop: "10px",
|
|
5802
|
+
paddingBottom: "10px",
|
|
5803
|
+
minWidth: "100px",
|
|
5804
|
+
textAlign: "center",
|
|
5805
|
+
display: "flex",
|
|
5806
|
+
flexDirection: "column",
|
|
5807
|
+
cursor: "pointer",
|
|
5808
|
+
userSelect: "none"
|
|
5809
|
+
}
|
|
5810
|
+
},
|
|
5811
|
+
component: {
|
|
5812
|
+
name: "Text",
|
|
5813
|
+
options: {
|
|
5814
|
+
text: "New tab"
|
|
5815
|
+
}
|
|
5816
|
+
}
|
|
5817
|
+
};
|
|
5818
|
+
var defaultElement = {
|
|
5819
|
+
"@type": "@builder.io/sdk:Element",
|
|
5820
|
+
responsiveStyles: {
|
|
5821
|
+
large: {
|
|
5822
|
+
height: "200px",
|
|
5823
|
+
display: "flex",
|
|
5824
|
+
marginTop: "20px",
|
|
5825
|
+
flexDirection: "column"
|
|
5826
|
+
}
|
|
5827
|
+
},
|
|
5828
|
+
component: {
|
|
5829
|
+
name: "Text",
|
|
5830
|
+
options: {
|
|
5831
|
+
text: "New tab content "
|
|
5832
|
+
}
|
|
5833
|
+
}
|
|
5834
|
+
};
|
|
5770
5835
|
var componentInfo8 = {
|
|
5836
|
+
name: "Builder: Tabs",
|
|
5837
|
+
inputs: [{
|
|
5838
|
+
name: "tabs",
|
|
5839
|
+
type: "list",
|
|
5840
|
+
broadcast: true,
|
|
5841
|
+
subFields: [{
|
|
5842
|
+
name: "label",
|
|
5843
|
+
type: "uiBlocks",
|
|
5844
|
+
hideFromUI: true,
|
|
5845
|
+
defaultValue: [defaultTab]
|
|
5846
|
+
}, {
|
|
5847
|
+
name: "content",
|
|
5848
|
+
type: "uiBlocks",
|
|
5849
|
+
hideFromUI: true,
|
|
5850
|
+
defaultValue: [defaultElement]
|
|
5851
|
+
}],
|
|
5852
|
+
defaultValue: [{
|
|
5853
|
+
label: [{
|
|
5854
|
+
...defaultTab,
|
|
5855
|
+
component: {
|
|
5856
|
+
name: "Text",
|
|
5857
|
+
options: {
|
|
5858
|
+
text: "Tab 1"
|
|
5859
|
+
}
|
|
5860
|
+
}
|
|
5861
|
+
}],
|
|
5862
|
+
content: [{
|
|
5863
|
+
...defaultElement,
|
|
5864
|
+
component: {
|
|
5865
|
+
name: "Text",
|
|
5866
|
+
options: {
|
|
5867
|
+
text: "Tab 1 content"
|
|
5868
|
+
}
|
|
5869
|
+
}
|
|
5870
|
+
}]
|
|
5871
|
+
}, {
|
|
5872
|
+
label: [{
|
|
5873
|
+
...defaultTab,
|
|
5874
|
+
component: {
|
|
5875
|
+
name: "Text",
|
|
5876
|
+
options: {
|
|
5877
|
+
text: "Tab 2"
|
|
5878
|
+
}
|
|
5879
|
+
}
|
|
5880
|
+
}],
|
|
5881
|
+
content: [{
|
|
5882
|
+
...defaultElement,
|
|
5883
|
+
component: {
|
|
5884
|
+
name: "Text",
|
|
5885
|
+
options: {
|
|
5886
|
+
text: "Tab 2 content"
|
|
5887
|
+
}
|
|
5888
|
+
}
|
|
5889
|
+
}]
|
|
5890
|
+
}]
|
|
5891
|
+
}, {
|
|
5892
|
+
name: "activeTabStyle",
|
|
5893
|
+
type: "uiStyle",
|
|
5894
|
+
helperText: "CSS styles for the active tab",
|
|
5895
|
+
defaultValue: {
|
|
5896
|
+
backgroundColor: "rgba(0, 0, 0, 0.1)"
|
|
5897
|
+
}
|
|
5898
|
+
}, {
|
|
5899
|
+
name: "defaultActiveTab",
|
|
5900
|
+
type: "number",
|
|
5901
|
+
helperText: 'Default tab to open to. Set to "1" for the first tab, "2" for the second, or choose "0" for none',
|
|
5902
|
+
defaultValue: 1,
|
|
5903
|
+
advanced: true
|
|
5904
|
+
}, {
|
|
5905
|
+
name: "collapsible",
|
|
5906
|
+
type: "boolean",
|
|
5907
|
+
helperText: "If on, clicking an open tab closes it so no tabs are active",
|
|
5908
|
+
defaultValue: false,
|
|
5909
|
+
advanced: true
|
|
5910
|
+
}, {
|
|
5911
|
+
name: "tabHeaderLayout",
|
|
5912
|
+
type: "enum",
|
|
5913
|
+
helperText: "Change the layout of the tab headers (uses justify-content)",
|
|
5914
|
+
defaultValue: "flex-start",
|
|
5915
|
+
enum: [{
|
|
5916
|
+
label: "Center",
|
|
5917
|
+
value: "center"
|
|
5918
|
+
}, {
|
|
5919
|
+
label: "Space between",
|
|
5920
|
+
value: "space-between"
|
|
5921
|
+
}, {
|
|
5922
|
+
label: "Space around",
|
|
5923
|
+
value: "space-around"
|
|
5924
|
+
}, {
|
|
5925
|
+
label: "Left",
|
|
5926
|
+
value: "flex-start"
|
|
5927
|
+
}, {
|
|
5928
|
+
label: "Right",
|
|
5929
|
+
value: "flex-end"
|
|
5930
|
+
}]
|
|
5931
|
+
}]
|
|
5932
|
+
};
|
|
5933
|
+
var _tmpl$7 = /* @__PURE__ */ template(`<div>`);
|
|
5934
|
+
var _tmpl$23 = /* @__PURE__ */ template(`<div><div class=builder-tabs-wrap>`);
|
|
5935
|
+
var _tmpl$33 = /* @__PURE__ */ template(`<span>`);
|
|
5936
|
+
function Tabs(props) {
|
|
5937
|
+
const [activeTab, setActiveTab] = createSignal(props.defaultActiveTab ? props.defaultActiveTab - 1 : 0);
|
|
5938
|
+
function activeTabContent(active) {
|
|
5939
|
+
return props.tabs && props.tabs[active].content;
|
|
5940
|
+
}
|
|
5941
|
+
function getActiveTabStyle(index) {
|
|
5942
|
+
return activeTab() === index ? props.activeTabStyle : {};
|
|
5943
|
+
}
|
|
5944
|
+
return (() => {
|
|
5945
|
+
const _el$ = _tmpl$23(), _el$2 = _el$.firstChild;
|
|
5946
|
+
_el$2.style.setProperty("display", "flex");
|
|
5947
|
+
_el$2.style.setProperty("flex-direction", "row");
|
|
5948
|
+
_el$2.style.setProperty("overflow", "auto");
|
|
5949
|
+
insert(_el$2, createComponent(For, {
|
|
5950
|
+
get each() {
|
|
5951
|
+
return props.tabs;
|
|
5952
|
+
},
|
|
5953
|
+
children: (tab, _index) => {
|
|
5954
|
+
const index = _index();
|
|
5955
|
+
return (() => {
|
|
5956
|
+
const _el$4 = _tmpl$33();
|
|
5957
|
+
_el$4.$$click = (event) => {
|
|
5958
|
+
if (index === activeTab() && props.collapsible) {
|
|
5959
|
+
setActiveTab(-1);
|
|
5960
|
+
} else {
|
|
5961
|
+
setActiveTab(index);
|
|
5962
|
+
}
|
|
5963
|
+
};
|
|
5964
|
+
setAttribute(_el$4, "key", index);
|
|
5965
|
+
insert(_el$4, createComponent(blocks_default, {
|
|
5966
|
+
get parent() {
|
|
5967
|
+
return props.builderBlock.id;
|
|
5968
|
+
},
|
|
5969
|
+
path: `component.options.tabs.${index}.label`,
|
|
5970
|
+
get blocks() {
|
|
5971
|
+
return tab.label;
|
|
5972
|
+
},
|
|
5973
|
+
get context() {
|
|
5974
|
+
return props.builderContext;
|
|
5975
|
+
},
|
|
5976
|
+
get registeredComponents() {
|
|
5977
|
+
return props.builderComponents;
|
|
5978
|
+
},
|
|
5979
|
+
get linkComponent() {
|
|
5980
|
+
return props.builderLinkComponent;
|
|
5981
|
+
}
|
|
5982
|
+
}));
|
|
5983
|
+
effect((_p$) => {
|
|
5984
|
+
const _v$ = `builder-tab-wrap ${activeTab() === index ? "builder-tab-active" : ""}`, _v$2 = getActiveTabStyle(index);
|
|
5985
|
+
_v$ !== _p$._v$ && className(_el$4, _p$._v$ = _v$);
|
|
5986
|
+
_p$._v$2 = style(_el$4, _v$2, _p$._v$2);
|
|
5987
|
+
return _p$;
|
|
5988
|
+
}, {
|
|
5989
|
+
_v$: void 0,
|
|
5990
|
+
_v$2: void 0
|
|
5991
|
+
});
|
|
5992
|
+
return _el$4;
|
|
5993
|
+
})();
|
|
5994
|
+
}
|
|
5995
|
+
}));
|
|
5996
|
+
insert(_el$, createComponent(Show, {
|
|
5997
|
+
get when() {
|
|
5998
|
+
return activeTabContent(activeTab());
|
|
5999
|
+
},
|
|
6000
|
+
get children() {
|
|
6001
|
+
const _el$3 = _tmpl$7();
|
|
6002
|
+
insert(_el$3, createComponent(blocks_default, {
|
|
6003
|
+
get parent() {
|
|
6004
|
+
return props.builderBlock.id;
|
|
6005
|
+
},
|
|
6006
|
+
get path() {
|
|
6007
|
+
return `component.options.tabs.${activeTab()}.content`;
|
|
6008
|
+
},
|
|
6009
|
+
get blocks() {
|
|
6010
|
+
return activeTabContent(activeTab());
|
|
6011
|
+
},
|
|
6012
|
+
get context() {
|
|
6013
|
+
return props.builderContext;
|
|
6014
|
+
},
|
|
6015
|
+
get registeredComponents() {
|
|
6016
|
+
return props.builderComponents;
|
|
6017
|
+
},
|
|
6018
|
+
get linkComponent() {
|
|
6019
|
+
return props.builderLinkComponent;
|
|
6020
|
+
}
|
|
6021
|
+
}));
|
|
6022
|
+
return _el$3;
|
|
6023
|
+
}
|
|
6024
|
+
}), null);
|
|
6025
|
+
effect(() => (props.tabHeaderLayout || "flex-start") != null ? _el$2.style.setProperty("justify-content", props.tabHeaderLayout || "flex-start") : _el$2.style.removeProperty("justify-content"));
|
|
6026
|
+
return _el$;
|
|
6027
|
+
})();
|
|
6028
|
+
}
|
|
6029
|
+
var tabs_default = Tabs;
|
|
6030
|
+
delegateEvents(["click"]);
|
|
6031
|
+
|
|
6032
|
+
// src/blocks/text/component-info.ts
|
|
6033
|
+
var componentInfo9 = {
|
|
5771
6034
|
name: "Text",
|
|
5772
6035
|
static: true,
|
|
5773
6036
|
isRSC: true,
|
|
@@ -5786,10 +6049,10 @@ var componentInfo8 = {
|
|
|
5786
6049
|
textAlign: "center"
|
|
5787
6050
|
}
|
|
5788
6051
|
};
|
|
5789
|
-
var _tmpl$
|
|
6052
|
+
var _tmpl$8 = /* @__PURE__ */ template(`<div class=builder-text>`);
|
|
5790
6053
|
function Text(props) {
|
|
5791
6054
|
return (() => {
|
|
5792
|
-
const _el$ = _tmpl$
|
|
6055
|
+
const _el$ = _tmpl$8();
|
|
5793
6056
|
_el$.style.setProperty("outline", "none");
|
|
5794
6057
|
effect(() => _el$.innerHTML = props.text?.toString() || "");
|
|
5795
6058
|
return _el$;
|
|
@@ -5798,7 +6061,7 @@ function Text(props) {
|
|
|
5798
6061
|
var text_default = Text;
|
|
5799
6062
|
|
|
5800
6063
|
// src/blocks/custom-code/component-info.ts
|
|
5801
|
-
var
|
|
6064
|
+
var componentInfo10 = {
|
|
5802
6065
|
name: "Custom Code",
|
|
5803
6066
|
static: true,
|
|
5804
6067
|
requiredPermissions: ["editCode"],
|
|
@@ -5821,7 +6084,7 @@ var componentInfo9 = {
|
|
|
5821
6084
|
advanced: true
|
|
5822
6085
|
}]
|
|
5823
6086
|
};
|
|
5824
|
-
var _tmpl$
|
|
6087
|
+
var _tmpl$9 = /* @__PURE__ */ template(`<div>`);
|
|
5825
6088
|
function CustomCode(props) {
|
|
5826
6089
|
const [scriptsInserted, setScriptsInserted] = createSignal([]);
|
|
5827
6090
|
const [scriptsRun, setScriptsRun] = createSignal([]);
|
|
@@ -5856,7 +6119,7 @@ function CustomCode(props) {
|
|
|
5856
6119
|
}
|
|
5857
6120
|
});
|
|
5858
6121
|
return (() => {
|
|
5859
|
-
const _el$ = _tmpl$
|
|
6122
|
+
const _el$ = _tmpl$9();
|
|
5860
6123
|
const _ref$ = elementRef;
|
|
5861
6124
|
typeof _ref$ === "function" ? use(_ref$, _el$) : elementRef = _el$;
|
|
5862
6125
|
effect((_p$) => {
|
|
@@ -5874,7 +6137,7 @@ function CustomCode(props) {
|
|
|
5874
6137
|
var custom_code_default = CustomCode;
|
|
5875
6138
|
|
|
5876
6139
|
// src/blocks/embed/component-info.ts
|
|
5877
|
-
var
|
|
6140
|
+
var componentInfo11 = {
|
|
5878
6141
|
name: "Embed",
|
|
5879
6142
|
static: true,
|
|
5880
6143
|
inputs: [{
|
|
@@ -5916,7 +6179,7 @@ var SCRIPT_MIME_TYPES = ["text/javascript", "application/javascript", "applicati
|
|
|
5916
6179
|
var isJsScript = (script) => SCRIPT_MIME_TYPES.includes(script.type);
|
|
5917
6180
|
|
|
5918
6181
|
// src/blocks/embed/embed.tsx
|
|
5919
|
-
var _tmpl$
|
|
6182
|
+
var _tmpl$10 = /* @__PURE__ */ template(`<div class=builder-embed>`);
|
|
5920
6183
|
function Embed(props) {
|
|
5921
6184
|
const [scriptsInserted, setScriptsInserted] = createSignal([]);
|
|
5922
6185
|
const [scriptsRun, setScriptsRun] = createSignal([]);
|
|
@@ -5954,7 +6217,7 @@ function Embed(props) {
|
|
|
5954
6217
|
}
|
|
5955
6218
|
createEffect(on(() => [onUpdateFn_0_elem(), onUpdateFn_0_ranInitFn__()], onUpdateFn_0));
|
|
5956
6219
|
return (() => {
|
|
5957
|
-
const _el$ = _tmpl$
|
|
6220
|
+
const _el$ = _tmpl$10();
|
|
5958
6221
|
const _ref$ = elem;
|
|
5959
6222
|
typeof _ref$ === "function" ? use(_ref$, _el$) : elem = _el$;
|
|
5960
6223
|
effect(() => _el$.innerHTML = props.content);
|
|
@@ -5964,7 +6227,7 @@ function Embed(props) {
|
|
|
5964
6227
|
var embed_default = Embed;
|
|
5965
6228
|
|
|
5966
6229
|
// src/blocks/form/form/component-info.ts
|
|
5967
|
-
var
|
|
6230
|
+
var componentInfo12 = {
|
|
5968
6231
|
name: "Form:Form",
|
|
5969
6232
|
// editableTags: ['builder-form-error']
|
|
5970
6233
|
defaults: {
|
|
@@ -6211,8 +6474,8 @@ var get = (obj, path, defaultValue) => {
|
|
|
6211
6474
|
};
|
|
6212
6475
|
|
|
6213
6476
|
// src/blocks/form/form/form.tsx
|
|
6214
|
-
var _tmpl$
|
|
6215
|
-
var _tmpl$
|
|
6477
|
+
var _tmpl$11 = /* @__PURE__ */ template(`<pre>`);
|
|
6478
|
+
var _tmpl$24 = /* @__PURE__ */ template(`<form>`);
|
|
6216
6479
|
function FormComponent(props) {
|
|
6217
6480
|
const [formState, setFormState] = createSignal("unsubmitted");
|
|
6218
6481
|
const [responseData, setResponseData] = createSignal(null);
|
|
@@ -6398,7 +6661,7 @@ function FormComponent(props) {
|
|
|
6398
6661
|
}
|
|
6399
6662
|
let formRef;
|
|
6400
6663
|
return (() => {
|
|
6401
|
-
const _el$ = _tmpl$
|
|
6664
|
+
const _el$ = _tmpl$24();
|
|
6402
6665
|
_el$.addEventListener("submit", (event) => onSubmit(event));
|
|
6403
6666
|
const _ref$ = formRef;
|
|
6404
6667
|
typeof _ref$ === "function" ? use(_ref$, _el$) : formRef = _el$;
|
|
@@ -6481,7 +6744,7 @@ function FormComponent(props) {
|
|
|
6481
6744
|
return memo(() => submissionState() === "error")() && responseData();
|
|
6482
6745
|
},
|
|
6483
6746
|
get children() {
|
|
6484
|
-
const _el$2 = _tmpl$
|
|
6747
|
+
const _el$2 = _tmpl$11();
|
|
6485
6748
|
insert(_el$2, () => JSON.stringify(responseData(), null, 2));
|
|
6486
6749
|
effect(() => className(_el$2, "builder-form-error-text " + css({
|
|
6487
6750
|
padding: "10px",
|
|
@@ -6513,7 +6776,7 @@ function FormComponent(props) {
|
|
|
6513
6776
|
var form_default = FormComponent;
|
|
6514
6777
|
|
|
6515
6778
|
// src/blocks/form/input/component-info.ts
|
|
6516
|
-
var
|
|
6779
|
+
var componentInfo13 = {
|
|
6517
6780
|
name: "Form:Input",
|
|
6518
6781
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fad6f37889d9e40bbbbc72cdb5875d6ca",
|
|
6519
6782
|
inputs: [
|
|
@@ -6565,10 +6828,10 @@ var componentInfo12 = {
|
|
|
6565
6828
|
borderColor: "#ccc"
|
|
6566
6829
|
}
|
|
6567
6830
|
};
|
|
6568
|
-
var _tmpl$
|
|
6831
|
+
var _tmpl$12 = /* @__PURE__ */ template(`<input>`);
|
|
6569
6832
|
function FormInputComponent(props) {
|
|
6570
6833
|
return (() => {
|
|
6571
|
-
const _el$ = _tmpl$
|
|
6834
|
+
const _el$ = _tmpl$12();
|
|
6572
6835
|
spread(_el$, mergeProps({}, () => props.attributes, {
|
|
6573
6836
|
get key() {
|
|
6574
6837
|
return isEditing() && props.defaultValue ? props.defaultValue : "default-key";
|
|
@@ -6598,7 +6861,7 @@ function FormInputComponent(props) {
|
|
|
6598
6861
|
var input_default = FormInputComponent;
|
|
6599
6862
|
|
|
6600
6863
|
// src/blocks/form/select/component-info.ts
|
|
6601
|
-
var
|
|
6864
|
+
var componentInfo14 = {
|
|
6602
6865
|
name: "Form:Select",
|
|
6603
6866
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F83acca093fb24aaf94dee136e9a4b045",
|
|
6604
6867
|
defaultStyles: {
|
|
@@ -6641,11 +6904,11 @@ var componentInfo13 = {
|
|
|
6641
6904
|
static: true,
|
|
6642
6905
|
noWrap: true
|
|
6643
6906
|
};
|
|
6644
|
-
var _tmpl$
|
|
6645
|
-
var _tmpl$
|
|
6907
|
+
var _tmpl$13 = /* @__PURE__ */ template(`<select>`);
|
|
6908
|
+
var _tmpl$25 = /* @__PURE__ */ template(`<option>`);
|
|
6646
6909
|
function SelectComponent(props) {
|
|
6647
6910
|
return (() => {
|
|
6648
|
-
const _el$ = _tmpl$
|
|
6911
|
+
const _el$ = _tmpl$13();
|
|
6649
6912
|
spread(_el$, mergeProps({}, () => props.attributes, {
|
|
6650
6913
|
get value() {
|
|
6651
6914
|
return props.value;
|
|
@@ -6667,7 +6930,7 @@ function SelectComponent(props) {
|
|
|
6667
6930
|
children: (option, _index) => {
|
|
6668
6931
|
const index = _index();
|
|
6669
6932
|
return (() => {
|
|
6670
|
-
const _el$2 = _tmpl$
|
|
6933
|
+
const _el$2 = _tmpl$25();
|
|
6671
6934
|
insert(_el$2, () => option.name || option.value);
|
|
6672
6935
|
effect(() => setAttribute(_el$2, "key", `${option.name}-${index}`));
|
|
6673
6936
|
effect(() => _el$2.value = option.value);
|
|
@@ -6681,7 +6944,7 @@ function SelectComponent(props) {
|
|
|
6681
6944
|
var select_default = SelectComponent;
|
|
6682
6945
|
|
|
6683
6946
|
// src/blocks/form/submit-button/component-info.ts
|
|
6684
|
-
var
|
|
6947
|
+
var componentInfo15 = {
|
|
6685
6948
|
name: "Form:SubmitButton",
|
|
6686
6949
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fdf2820ffed1f4349a94c40b3221f5b98",
|
|
6687
6950
|
defaultStyles: {
|
|
@@ -6707,10 +6970,10 @@ var componentInfo14 = {
|
|
|
6707
6970
|
// TODO: defaultChildren
|
|
6708
6971
|
// canHaveChildren: true,
|
|
6709
6972
|
};
|
|
6710
|
-
var _tmpl$
|
|
6973
|
+
var _tmpl$14 = /* @__PURE__ */ template(`<button type=submit>`);
|
|
6711
6974
|
function SubmitButton(props) {
|
|
6712
6975
|
return (() => {
|
|
6713
|
-
const _el$ = _tmpl$
|
|
6976
|
+
const _el$ = _tmpl$14();
|
|
6714
6977
|
spread(_el$, mergeProps({}, () => props.attributes), false, true);
|
|
6715
6978
|
insert(_el$, () => props.text);
|
|
6716
6979
|
return _el$;
|
|
@@ -6719,7 +6982,7 @@ function SubmitButton(props) {
|
|
|
6719
6982
|
var submit_button_default = SubmitButton;
|
|
6720
6983
|
|
|
6721
6984
|
// src/blocks/img/component-info.ts
|
|
6722
|
-
var
|
|
6985
|
+
var componentInfo16 = {
|
|
6723
6986
|
// friendlyName?
|
|
6724
6987
|
name: "Raw:Img",
|
|
6725
6988
|
hideFromInsertMenu: true,
|
|
@@ -6734,10 +6997,10 @@ var componentInfo15 = {
|
|
|
6734
6997
|
noWrap: true,
|
|
6735
6998
|
static: true
|
|
6736
6999
|
};
|
|
6737
|
-
var _tmpl$
|
|
7000
|
+
var _tmpl$15 = /* @__PURE__ */ template(`<img>`);
|
|
6738
7001
|
function ImgComponent(props) {
|
|
6739
7002
|
return (() => {
|
|
6740
|
-
const _el$ = _tmpl$
|
|
7003
|
+
const _el$ = _tmpl$15();
|
|
6741
7004
|
spread(_el$, mergeProps({
|
|
6742
7005
|
get style() {
|
|
6743
7006
|
return {
|
|
@@ -6761,7 +7024,7 @@ function ImgComponent(props) {
|
|
|
6761
7024
|
var img_default = ImgComponent;
|
|
6762
7025
|
|
|
6763
7026
|
// src/blocks/video/component-info.ts
|
|
6764
|
-
var
|
|
7027
|
+
var componentInfo17 = {
|
|
6765
7028
|
name: "Video",
|
|
6766
7029
|
canHaveChildren: true,
|
|
6767
7030
|
defaultStyles: {
|
|
@@ -6843,9 +7106,9 @@ var componentInfo16 = {
|
|
|
6843
7106
|
advanced: true
|
|
6844
7107
|
}]
|
|
6845
7108
|
};
|
|
6846
|
-
var _tmpl$
|
|
6847
|
-
var _tmpl$
|
|
6848
|
-
var _tmpl$
|
|
7109
|
+
var _tmpl$16 = /* @__PURE__ */ template(`<source type=video/mp4>`);
|
|
7110
|
+
var _tmpl$26 = /* @__PURE__ */ template(`<div>`);
|
|
7111
|
+
var _tmpl$34 = /* @__PURE__ */ template(`<div><video class=builder-video>`);
|
|
6849
7112
|
function Video(props) {
|
|
6850
7113
|
const videoProps = createMemo(() => {
|
|
6851
7114
|
return {
|
|
@@ -6872,7 +7135,7 @@ function Video(props) {
|
|
|
6872
7135
|
};
|
|
6873
7136
|
});
|
|
6874
7137
|
return (() => {
|
|
6875
|
-
const _el$ = _tmpl$
|
|
7138
|
+
const _el$ = _tmpl$34(), _el$2 = _el$.firstChild;
|
|
6876
7139
|
_el$.style.setProperty("position", "relative");
|
|
6877
7140
|
spread(_el$2, mergeProps(spreadProps, {
|
|
6878
7141
|
get preload() {
|
|
@@ -6906,7 +7169,7 @@ function Video(props) {
|
|
|
6906
7169
|
return !props.lazyLoad;
|
|
6907
7170
|
},
|
|
6908
7171
|
get children() {
|
|
6909
|
-
const _el$3 = _tmpl$
|
|
7172
|
+
const _el$3 = _tmpl$16();
|
|
6910
7173
|
effect(() => setAttribute(_el$3, "src", props.video));
|
|
6911
7174
|
return _el$3;
|
|
6912
7175
|
}
|
|
@@ -6916,7 +7179,7 @@ function Video(props) {
|
|
|
6916
7179
|
return props.aspectRatio && !(props.fitContent && props.builderBlock?.children?.length);
|
|
6917
7180
|
},
|
|
6918
7181
|
get children() {
|
|
6919
|
-
const _el$4 = _tmpl$
|
|
7182
|
+
const _el$4 = _tmpl$26();
|
|
6920
7183
|
_el$4.style.setProperty("width", "100%");
|
|
6921
7184
|
_el$4.style.setProperty("pointer-events", "none");
|
|
6922
7185
|
_el$4.style.setProperty("font-size", "0px");
|
|
@@ -6929,7 +7192,7 @@ function Video(props) {
|
|
|
6929
7192
|
return props.builderBlock?.children?.length && props.fitContent;
|
|
6930
7193
|
},
|
|
6931
7194
|
get children() {
|
|
6932
|
-
const _el$5 = _tmpl$
|
|
7195
|
+
const _el$5 = _tmpl$26();
|
|
6933
7196
|
_el$5.style.setProperty("display", "flex");
|
|
6934
7197
|
_el$5.style.setProperty("flex-direction", "column");
|
|
6935
7198
|
_el$5.style.setProperty("align-items", "stretch");
|
|
@@ -6942,7 +7205,7 @@ function Video(props) {
|
|
|
6942
7205
|
return props.builderBlock?.children?.length && !props.fitContent;
|
|
6943
7206
|
},
|
|
6944
7207
|
get children() {
|
|
6945
|
-
const _el$6 = _tmpl$
|
|
7208
|
+
const _el$6 = _tmpl$26();
|
|
6946
7209
|
_el$6.style.setProperty("pointer-events", "none");
|
|
6947
7210
|
_el$6.style.setProperty("display", "flex");
|
|
6948
7211
|
_el$6.style.setProperty("flex-direction", "column");
|
|
@@ -6964,28 +7227,28 @@ var video_default = Video;
|
|
|
6964
7227
|
// src/constants/extra-components.ts
|
|
6965
7228
|
var getExtraComponents = () => [{
|
|
6966
7229
|
component: custom_code_default,
|
|
6967
|
-
...
|
|
7230
|
+
...componentInfo10
|
|
6968
7231
|
}, {
|
|
6969
7232
|
component: embed_default,
|
|
6970
|
-
...
|
|
7233
|
+
...componentInfo11
|
|
6971
7234
|
}, ...TARGET === "rsc" ? [] : [{
|
|
6972
7235
|
component: form_default,
|
|
6973
|
-
...
|
|
7236
|
+
...componentInfo12
|
|
6974
7237
|
}, {
|
|
6975
7238
|
component: input_default,
|
|
6976
|
-
...
|
|
7239
|
+
...componentInfo13
|
|
6977
7240
|
}, {
|
|
6978
7241
|
component: submit_button_default,
|
|
6979
|
-
...
|
|
7242
|
+
...componentInfo15
|
|
6980
7243
|
}, {
|
|
6981
7244
|
component: select_default,
|
|
6982
|
-
...
|
|
7245
|
+
...componentInfo14
|
|
6983
7246
|
}], {
|
|
6984
7247
|
component: img_default,
|
|
6985
|
-
...
|
|
7248
|
+
...componentInfo16
|
|
6986
7249
|
}, {
|
|
6987
7250
|
component: video_default,
|
|
6988
|
-
...
|
|
7251
|
+
...componentInfo17
|
|
6989
7252
|
}];
|
|
6990
7253
|
|
|
6991
7254
|
// src/constants/builder-registered-components.ts
|
|
@@ -7012,8 +7275,11 @@ var getDefaultRegisteredComponents = () => [{
|
|
|
7012
7275
|
...componentInfo7
|
|
7013
7276
|
}, {
|
|
7014
7277
|
component: text_default,
|
|
7278
|
+
...componentInfo9
|
|
7279
|
+
}, ...TARGET === "rsc" ? [] : [{
|
|
7280
|
+
component: tabs_default,
|
|
7015
7281
|
...componentInfo8
|
|
7016
|
-
}, ...getExtraComponents()];
|
|
7282
|
+
}], ...getExtraComponents()];
|
|
7017
7283
|
|
|
7018
7284
|
// src/functions/register-component.ts
|
|
7019
7285
|
var createRegisterComponentMessage = (info) => ({
|
|
@@ -7082,10 +7348,10 @@ var getUpdateVariantVisibilityScript = ({
|
|
|
7082
7348
|
}) => `window.${UPDATE_VARIANT_VISIBILITY_SCRIPT_FN_NAME}(
|
|
7083
7349
|
"${variationId}", "${contentId}", ${isHydrationTarget}
|
|
7084
7350
|
)`;
|
|
7085
|
-
var _tmpl$
|
|
7351
|
+
var _tmpl$17 = /* @__PURE__ */ template(`<script>`);
|
|
7086
7352
|
function InlinedScript(props) {
|
|
7087
7353
|
return (() => {
|
|
7088
|
-
const _el$ = _tmpl$
|
|
7354
|
+
const _el$ = _tmpl$17();
|
|
7089
7355
|
effect((_p$) => {
|
|
7090
7356
|
const _v$ = props.scriptStr, _v$2 = props.id;
|
|
7091
7357
|
_v$ !== _p$._v$ && (_el$.innerHTML = _p$._v$ = _v$);
|
|
@@ -7584,7 +7850,7 @@ function isFromTrustedHost(trustedHosts, e) {
|
|
|
7584
7850
|
}
|
|
7585
7851
|
|
|
7586
7852
|
// src/constants/sdk-version.ts
|
|
7587
|
-
var SDK_VERSION = "1.0.
|
|
7853
|
+
var SDK_VERSION = "1.0.25";
|
|
7588
7854
|
|
|
7589
7855
|
// src/functions/register.ts
|
|
7590
7856
|
var registry = {};
|
|
@@ -7781,6 +8047,85 @@ var subscribeToEditor = (model, callback, options) => {
|
|
|
7781
8047
|
};
|
|
7782
8048
|
};
|
|
7783
8049
|
|
|
8050
|
+
// src/components/content/components/styles.helpers.ts
|
|
8051
|
+
var getCssFromFont = (font) => {
|
|
8052
|
+
const family = font.family + (font.kind && !font.kind.includes("#") ? ", " + font.kind : "");
|
|
8053
|
+
const name = family.split(",")[0];
|
|
8054
|
+
const url = font.fileUrl ?? font?.files?.regular;
|
|
8055
|
+
let str = "";
|
|
8056
|
+
if (url && family && name) {
|
|
8057
|
+
str += `
|
|
8058
|
+
@font-face {
|
|
8059
|
+
font-family: "${family}";
|
|
8060
|
+
src: local("${name}"), url('${url}') format('woff2');
|
|
8061
|
+
font-display: fallback;
|
|
8062
|
+
font-weight: 400;
|
|
8063
|
+
}
|
|
8064
|
+
`.trim();
|
|
8065
|
+
}
|
|
8066
|
+
if (font.files) {
|
|
8067
|
+
for (const weight in font.files) {
|
|
8068
|
+
const isNumber = String(Number(weight)) === weight;
|
|
8069
|
+
if (!isNumber) {
|
|
8070
|
+
continue;
|
|
8071
|
+
}
|
|
8072
|
+
const weightUrl = font.files[weight];
|
|
8073
|
+
if (weightUrl && weightUrl !== url) {
|
|
8074
|
+
str += `
|
|
8075
|
+
@font-face {
|
|
8076
|
+
font-family: "${family}";
|
|
8077
|
+
src: url('${weightUrl}') format('woff2');
|
|
8078
|
+
font-display: fallback;
|
|
8079
|
+
font-weight: ${weight};
|
|
8080
|
+
}
|
|
8081
|
+
`.trim();
|
|
8082
|
+
}
|
|
8083
|
+
}
|
|
8084
|
+
}
|
|
8085
|
+
return str;
|
|
8086
|
+
};
|
|
8087
|
+
var getFontCss = ({
|
|
8088
|
+
customFonts
|
|
8089
|
+
}) => {
|
|
8090
|
+
return customFonts?.map((font) => getCssFromFont(font))?.join(" ") || "";
|
|
8091
|
+
};
|
|
8092
|
+
var getCss = ({
|
|
8093
|
+
cssCode,
|
|
8094
|
+
contentId
|
|
8095
|
+
}) => {
|
|
8096
|
+
if (!cssCode) {
|
|
8097
|
+
return "";
|
|
8098
|
+
}
|
|
8099
|
+
if (!contentId) {
|
|
8100
|
+
return cssCode;
|
|
8101
|
+
}
|
|
8102
|
+
return cssCode?.replace(/&/g, `div[builder-content-id="${contentId}"]`) || "";
|
|
8103
|
+
};
|
|
8104
|
+
var DEFAULT_STYLES = `
|
|
8105
|
+
.builder-button {
|
|
8106
|
+
all: unset;
|
|
8107
|
+
}
|
|
8108
|
+
|
|
8109
|
+
.builder-text > p:first-of-type, .builder-text > .builder-paragraph:first-of-type {
|
|
8110
|
+
margin: 0;
|
|
8111
|
+
}
|
|
8112
|
+
.builder-text > p, .builder-text > .builder-paragraph {
|
|
8113
|
+
color: inherit;
|
|
8114
|
+
line-height: inherit;
|
|
8115
|
+
letter-spacing: inherit;
|
|
8116
|
+
font-weight: inherit;
|
|
8117
|
+
font-size: inherit;
|
|
8118
|
+
text-align: inherit;
|
|
8119
|
+
font-family: inherit;
|
|
8120
|
+
}
|
|
8121
|
+
`;
|
|
8122
|
+
var getDefaultStyles = (isNested) => {
|
|
8123
|
+
return !isNested ? DEFAULT_STYLES : "";
|
|
8124
|
+
};
|
|
8125
|
+
var getWrapperClassName = (variationId) => {
|
|
8126
|
+
return `variant-${variationId}`;
|
|
8127
|
+
};
|
|
8128
|
+
|
|
7784
8129
|
// src/components/content/components/enable-editor.tsx
|
|
7785
8130
|
function EnableEditor(props) {
|
|
7786
8131
|
const [ContentWrapper, setContentWrapper] = createSignal(props.contentWrapper || "div");
|
|
@@ -7820,6 +8165,12 @@ function EnableEditor(props) {
|
|
|
7820
8165
|
content: newContentValue
|
|
7821
8166
|
}));
|
|
7822
8167
|
}
|
|
8168
|
+
const showContentProps = createMemo(() => {
|
|
8169
|
+
return props.showContent ? {} : {
|
|
8170
|
+
hidden: true,
|
|
8171
|
+
"aria-hidden": true
|
|
8172
|
+
};
|
|
8173
|
+
});
|
|
7823
8174
|
function processMessage(event) {
|
|
7824
8175
|
return createEditorListener({
|
|
7825
8176
|
model: props.model,
|
|
@@ -8039,7 +8390,7 @@ function EnableEditor(props) {
|
|
|
8039
8390
|
get children() {
|
|
8040
8391
|
return createComponent(Dynamic, mergeProps({
|
|
8041
8392
|
get ["class"]() {
|
|
8042
|
-
return
|
|
8393
|
+
return getWrapperClassName(props.content?.testVariationId || props.content?.id);
|
|
8043
8394
|
}
|
|
8044
8395
|
}, {}, {
|
|
8045
8396
|
ref(r$) {
|
|
@@ -8053,10 +8404,7 @@ function EnableEditor(props) {
|
|
|
8053
8404
|
get ["builder-model"]() {
|
|
8054
8405
|
return props.model;
|
|
8055
8406
|
}
|
|
8056
|
-
}, {}, () => props.
|
|
8057
|
-
hidden: true,
|
|
8058
|
-
"aria-hidden": true
|
|
8059
|
-
}, () => props.contentWrapperProps, {
|
|
8407
|
+
}, {}, showContentProps, () => props.contentWrapperProps, {
|
|
8060
8408
|
get component() {
|
|
8061
8409
|
return ContentWrapper();
|
|
8062
8410
|
},
|
|
@@ -8070,84 +8418,6 @@ function EnableEditor(props) {
|
|
|
8070
8418
|
});
|
|
8071
8419
|
}
|
|
8072
8420
|
var enable_editor_default = EnableEditor;
|
|
8073
|
-
|
|
8074
|
-
// src/components/content/components/styles.helpers.ts
|
|
8075
|
-
var getCssFromFont = (font) => {
|
|
8076
|
-
const family = font.family + (font.kind && !font.kind.includes("#") ? ", " + font.kind : "");
|
|
8077
|
-
const name = family.split(",")[0];
|
|
8078
|
-
const url = font.fileUrl ?? font?.files?.regular;
|
|
8079
|
-
let str = "";
|
|
8080
|
-
if (url && family && name) {
|
|
8081
|
-
str += `
|
|
8082
|
-
@font-face {
|
|
8083
|
-
font-family: "${family}";
|
|
8084
|
-
src: local("${name}"), url('${url}') format('woff2');
|
|
8085
|
-
font-display: fallback;
|
|
8086
|
-
font-weight: 400;
|
|
8087
|
-
}
|
|
8088
|
-
`.trim();
|
|
8089
|
-
}
|
|
8090
|
-
if (font.files) {
|
|
8091
|
-
for (const weight in font.files) {
|
|
8092
|
-
const isNumber = String(Number(weight)) === weight;
|
|
8093
|
-
if (!isNumber) {
|
|
8094
|
-
continue;
|
|
8095
|
-
}
|
|
8096
|
-
const weightUrl = font.files[weight];
|
|
8097
|
-
if (weightUrl && weightUrl !== url) {
|
|
8098
|
-
str += `
|
|
8099
|
-
@font-face {
|
|
8100
|
-
font-family: "${family}";
|
|
8101
|
-
src: url('${weightUrl}') format('woff2');
|
|
8102
|
-
font-display: fallback;
|
|
8103
|
-
font-weight: ${weight};
|
|
8104
|
-
}
|
|
8105
|
-
`.trim();
|
|
8106
|
-
}
|
|
8107
|
-
}
|
|
8108
|
-
}
|
|
8109
|
-
return str;
|
|
8110
|
-
};
|
|
8111
|
-
var getFontCss = ({
|
|
8112
|
-
customFonts
|
|
8113
|
-
}) => {
|
|
8114
|
-
return customFonts?.map((font) => getCssFromFont(font))?.join(" ") || "";
|
|
8115
|
-
};
|
|
8116
|
-
var getCss = ({
|
|
8117
|
-
cssCode,
|
|
8118
|
-
contentId
|
|
8119
|
-
}) => {
|
|
8120
|
-
if (!cssCode) {
|
|
8121
|
-
return "";
|
|
8122
|
-
}
|
|
8123
|
-
if (!contentId) {
|
|
8124
|
-
return cssCode;
|
|
8125
|
-
}
|
|
8126
|
-
return cssCode?.replace(/&/g, `div[builder-content-id="${contentId}"]`) || "";
|
|
8127
|
-
};
|
|
8128
|
-
var DEFAULT_STYLES = `
|
|
8129
|
-
.builder-button {
|
|
8130
|
-
all: unset;
|
|
8131
|
-
}
|
|
8132
|
-
|
|
8133
|
-
.builder-text > p:first-of-type, .builder-text > .builder-paragraph:first-of-type {
|
|
8134
|
-
margin: 0;
|
|
8135
|
-
}
|
|
8136
|
-
.builder-text > p, .builder-text > .builder-paragraph {
|
|
8137
|
-
color: inherit;
|
|
8138
|
-
line-height: inherit;
|
|
8139
|
-
letter-spacing: inherit;
|
|
8140
|
-
font-weight: inherit;
|
|
8141
|
-
font-size: inherit;
|
|
8142
|
-
text-align: inherit;
|
|
8143
|
-
font-family: inherit;
|
|
8144
|
-
}
|
|
8145
|
-
`;
|
|
8146
|
-
var getDefaultStyles = (isNested) => {
|
|
8147
|
-
return !isNested ? DEFAULT_STYLES : "";
|
|
8148
|
-
};
|
|
8149
|
-
|
|
8150
|
-
// src/components/content/components/styles.tsx
|
|
8151
8421
|
function ContentStyles(props) {
|
|
8152
8422
|
const [injectedStyles, setInjectedStyles] = createSignal(`
|
|
8153
8423
|
${getCss({
|
|
@@ -8566,9 +8836,15 @@ var fetchSymbolContent = async ({
|
|
|
8566
8836
|
};
|
|
8567
8837
|
|
|
8568
8838
|
// src/blocks/symbol/symbol.tsx
|
|
8569
|
-
var _tmpl$
|
|
8839
|
+
var _tmpl$18 = /* @__PURE__ */ template(`<div>`);
|
|
8570
8840
|
function Symbol2(props) {
|
|
8571
8841
|
const [contentToUse, setContentToUse] = createSignal(props.symbol?.content);
|
|
8842
|
+
const blocksWrapper = createMemo(() => {
|
|
8843
|
+
return "div";
|
|
8844
|
+
});
|
|
8845
|
+
const contentWrapper = createMemo(() => {
|
|
8846
|
+
return "div";
|
|
8847
|
+
});
|
|
8572
8848
|
const className = createMemo(() => {
|
|
8573
8849
|
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(" ");
|
|
8574
8850
|
});
|
|
@@ -8592,7 +8868,7 @@ function Symbol2(props) {
|
|
|
8592
8868
|
}
|
|
8593
8869
|
createEffect(on(() => [onUpdateFn_0_props_symbol()], onUpdateFn_0));
|
|
8594
8870
|
return (() => {
|
|
8595
|
-
const _el$ = _tmpl$
|
|
8871
|
+
const _el$ = _tmpl$18();
|
|
8596
8872
|
spread(_el$, mergeProps({
|
|
8597
8873
|
get ["class"]() {
|
|
8598
8874
|
return className();
|
|
@@ -8631,8 +8907,12 @@ function Symbol2(props) {
|
|
|
8631
8907
|
get linkComponent() {
|
|
8632
8908
|
return props.builderLinkComponent;
|
|
8633
8909
|
},
|
|
8634
|
-
blocksWrapper
|
|
8635
|
-
|
|
8910
|
+
get blocksWrapper() {
|
|
8911
|
+
return blocksWrapper();
|
|
8912
|
+
},
|
|
8913
|
+
get contentWrapper() {
|
|
8914
|
+
return contentWrapper();
|
|
8915
|
+
}
|
|
8636
8916
|
}));
|
|
8637
8917
|
return _el$;
|
|
8638
8918
|
})();
|