@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/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";
|
|
@@ -3532,7 +3536,6 @@ function evaluate({
|
|
|
3532
3536
|
enableCache
|
|
3533
3537
|
}) {
|
|
3534
3538
|
if (code === "") {
|
|
3535
|
-
logger.warn("Skipping evaluation of empty code block.");
|
|
3536
3539
|
return void 0;
|
|
3537
3540
|
}
|
|
3538
3541
|
const args = {
|
|
@@ -3864,6 +3867,7 @@ function mapStyleObjToStrIfNeeded(style) {
|
|
|
3864
3867
|
case "svelte":
|
|
3865
3868
|
case "vue":
|
|
3866
3869
|
case "solid":
|
|
3870
|
+
case "angular":
|
|
3867
3871
|
return convertStyleMapToCSSArray(style).join(" ");
|
|
3868
3872
|
case "qwik":
|
|
3869
3873
|
case "reactNative":
|
|
@@ -3939,6 +3943,12 @@ var getRepeatItemData = ({
|
|
|
3939
3943
|
}));
|
|
3940
3944
|
return repeatArray;
|
|
3941
3945
|
};
|
|
3946
|
+
var shouldPassLinkComponent = (blockName) => {
|
|
3947
|
+
return blockName && ["Core:Button", "Symbol", "Columns", "Form:Form", "Builder: Tabs"].includes(blockName);
|
|
3948
|
+
};
|
|
3949
|
+
var shouldPassRegisteredComponents = (blockName) => {
|
|
3950
|
+
return blockName && ["Symbol", "Columns", "Form:Form", "Builder: Tabs"].includes(blockName);
|
|
3951
|
+
};
|
|
3942
3952
|
|
|
3943
3953
|
// src/constants/device-sizes.ts
|
|
3944
3954
|
var SIZES = {
|
|
@@ -4195,21 +4205,24 @@ function BlockWrapper(props) {
|
|
|
4195
4205
|
}
|
|
4196
4206
|
var block_wrapper_default = BlockWrapper;
|
|
4197
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
|
+
});
|
|
4198
4223
|
return createComponent(Dynamic, mergeProps(() => props.wrapperProps, {
|
|
4199
4224
|
get attributes() {
|
|
4200
|
-
return
|
|
4201
|
-
...getBlockProperties({
|
|
4202
|
-
block: props.block,
|
|
4203
|
-
context: props.context
|
|
4204
|
-
}),
|
|
4205
|
-
...getBlockActions({
|
|
4206
|
-
block: props.block,
|
|
4207
|
-
rootState: props.context.rootState,
|
|
4208
|
-
rootSetState: props.context.rootSetState,
|
|
4209
|
-
localState: props.context.localState,
|
|
4210
|
-
context: props.context.context
|
|
4211
|
-
})
|
|
4212
|
-
} : {};
|
|
4225
|
+
return attributes();
|
|
4213
4226
|
},
|
|
4214
4227
|
get component() {
|
|
4215
4228
|
return props.Wrapper;
|
|
@@ -4384,10 +4397,10 @@ function Block(props) {
|
|
|
4384
4397
|
componentOptions: {
|
|
4385
4398
|
...getBlockComponentOptions(processedBlock()),
|
|
4386
4399
|
builderContext: props.context,
|
|
4387
|
-
...
|
|
4400
|
+
...shouldPassLinkComponent(blockComponent()?.name) ? {
|
|
4388
4401
|
builderLinkComponent: props.linkComponent
|
|
4389
4402
|
} : {},
|
|
4390
|
-
...
|
|
4403
|
+
...shouldPassRegisteredComponents(blockComponent()?.name) ? {
|
|
4391
4404
|
builderComponents: props.registeredComponents
|
|
4392
4405
|
} : {}
|
|
4393
4406
|
},
|
|
@@ -4679,6 +4692,11 @@ function Blocks(props) {
|
|
|
4679
4692
|
}
|
|
4680
4693
|
var blocks_default = Blocks;
|
|
4681
4694
|
|
|
4695
|
+
// src/blocks/columns/helpers.ts
|
|
4696
|
+
var getColumnsClass = (id2) => {
|
|
4697
|
+
return `builder-columns ${id2}-breakpoints`;
|
|
4698
|
+
};
|
|
4699
|
+
|
|
4682
4700
|
// src/blocks/columns/columns.tsx
|
|
4683
4701
|
var _tmpl$2 = /* @__PURE__ */ template(`<div>`);
|
|
4684
4702
|
function Columns(props) {
|
|
@@ -4686,6 +4704,9 @@ function Columns(props) {
|
|
|
4686
4704
|
const [cols, setCols] = createSignal(props.columns || []);
|
|
4687
4705
|
const [stackAt, setStackAt] = createSignal(props.stackColumnsAt || "tablet");
|
|
4688
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
|
+
}
|
|
4689
4710
|
function getWidth(index) {
|
|
4690
4711
|
return cols()[index]?.width || 100 / cols().length;
|
|
4691
4712
|
}
|
|
@@ -4705,7 +4726,7 @@ function Columns(props) {
|
|
|
4705
4726
|
}) {
|
|
4706
4727
|
return stackAt() === "never" ? desktopStyle : stackedStyle;
|
|
4707
4728
|
}
|
|
4708
|
-
|
|
4729
|
+
function columnsCssVars() {
|
|
4709
4730
|
return {
|
|
4710
4731
|
"--flex-dir": flexDir(),
|
|
4711
4732
|
"--flex-dir-tablet": getTabletStyle({
|
|
@@ -4713,7 +4734,7 @@ function Columns(props) {
|
|
|
4713
4734
|
desktopStyle: "row"
|
|
4714
4735
|
})
|
|
4715
4736
|
};
|
|
4716
|
-
}
|
|
4737
|
+
}
|
|
4717
4738
|
function columnCssVars(index) {
|
|
4718
4739
|
const gutter = index === 0 ? 0 : gutterSize();
|
|
4719
4740
|
const width = getColumnCssWidth(index);
|
|
@@ -4752,7 +4773,7 @@ function Columns(props) {
|
|
|
4752
4773
|
const breakpointSizes = getSizesForBreakpoints(props.builderContext.content?.meta?.breakpoints || {});
|
|
4753
4774
|
return breakpointSizes[size].max;
|
|
4754
4775
|
}
|
|
4755
|
-
|
|
4776
|
+
function columnsStyles() {
|
|
4756
4777
|
return `
|
|
4757
4778
|
@media (max-width: ${getWidthForBreakpointSize("medium")}px) {
|
|
4758
4779
|
.${props.builderBlock.id}-breakpoints {
|
|
@@ -4778,12 +4799,22 @@ function Columns(props) {
|
|
|
4778
4799
|
}
|
|
4779
4800
|
},
|
|
4780
4801
|
`;
|
|
4781
|
-
}
|
|
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
|
+
}
|
|
4782
4813
|
return (() => {
|
|
4783
4814
|
const _el$ = _tmpl$2();
|
|
4784
4815
|
spread(_el$, mergeProps({
|
|
4785
4816
|
get ["class"]() {
|
|
4786
|
-
return
|
|
4817
|
+
return getColumnsClass(props.builderBlock?.id) + " " + css({
|
|
4787
4818
|
display: "flex",
|
|
4788
4819
|
lineHeight: "normal"
|
|
4789
4820
|
});
|
|
@@ -4812,18 +4843,11 @@ function Columns(props) {
|
|
|
4812
4843
|
return createComponent(dynamic_renderer_default, {
|
|
4813
4844
|
key: index,
|
|
4814
4845
|
get TagName() {
|
|
4815
|
-
return column
|
|
4846
|
+
return getTagName(column);
|
|
4816
4847
|
},
|
|
4817
4848
|
actionAttributes: {},
|
|
4818
4849
|
get attributes() {
|
|
4819
|
-
return
|
|
4820
|
-
...{},
|
|
4821
|
-
...column.link ? {
|
|
4822
|
-
href: column.link
|
|
4823
|
-
} : {},
|
|
4824
|
-
[getClassPropName()]: "builder-column",
|
|
4825
|
-
style: mapStyleObjToStrIfNeeded(columnCssVars(index))
|
|
4826
|
-
};
|
|
4850
|
+
return getAttributes(column, index);
|
|
4827
4851
|
},
|
|
4828
4852
|
get children() {
|
|
4829
4853
|
return createComponent(blocks_default, {
|
|
@@ -5022,7 +5046,7 @@ function Image(props) {
|
|
|
5022
5046
|
}
|
|
5023
5047
|
}), createComponent(Show, {
|
|
5024
5048
|
get when() {
|
|
5025
|
-
return !props.fitContent && props.children;
|
|
5049
|
+
return !props.fitContent && props.builderBlock?.children?.length;
|
|
5026
5050
|
},
|
|
5027
5051
|
get children() {
|
|
5028
5052
|
const _el$5 = _tmpl$32();
|
|
@@ -5767,8 +5791,246 @@ var componentInfo7 = {
|
|
|
5767
5791
|
}]
|
|
5768
5792
|
};
|
|
5769
5793
|
|
|
5770
|
-
// 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
|
+
};
|
|
5771
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 = {
|
|
5772
6034
|
name: "Text",
|
|
5773
6035
|
static: true,
|
|
5774
6036
|
isRSC: true,
|
|
@@ -5787,10 +6049,10 @@ var componentInfo8 = {
|
|
|
5787
6049
|
textAlign: "center"
|
|
5788
6050
|
}
|
|
5789
6051
|
};
|
|
5790
|
-
var _tmpl$
|
|
6052
|
+
var _tmpl$8 = /* @__PURE__ */ template(`<div class=builder-text>`);
|
|
5791
6053
|
function Text(props) {
|
|
5792
6054
|
return (() => {
|
|
5793
|
-
const _el$ = _tmpl$
|
|
6055
|
+
const _el$ = _tmpl$8();
|
|
5794
6056
|
_el$.style.setProperty("outline", "none");
|
|
5795
6057
|
effect(() => _el$.innerHTML = props.text?.toString() || "");
|
|
5796
6058
|
return _el$;
|
|
@@ -5799,7 +6061,7 @@ function Text(props) {
|
|
|
5799
6061
|
var text_default = Text;
|
|
5800
6062
|
|
|
5801
6063
|
// src/blocks/custom-code/component-info.ts
|
|
5802
|
-
var
|
|
6064
|
+
var componentInfo10 = {
|
|
5803
6065
|
name: "Custom Code",
|
|
5804
6066
|
static: true,
|
|
5805
6067
|
requiredPermissions: ["editCode"],
|
|
@@ -5822,7 +6084,7 @@ var componentInfo9 = {
|
|
|
5822
6084
|
advanced: true
|
|
5823
6085
|
}]
|
|
5824
6086
|
};
|
|
5825
|
-
var _tmpl$
|
|
6087
|
+
var _tmpl$9 = /* @__PURE__ */ template(`<div>`);
|
|
5826
6088
|
function CustomCode(props) {
|
|
5827
6089
|
const [scriptsInserted, setScriptsInserted] = createSignal([]);
|
|
5828
6090
|
const [scriptsRun, setScriptsRun] = createSignal([]);
|
|
@@ -5857,7 +6119,7 @@ function CustomCode(props) {
|
|
|
5857
6119
|
}
|
|
5858
6120
|
});
|
|
5859
6121
|
return (() => {
|
|
5860
|
-
const _el$ = _tmpl$
|
|
6122
|
+
const _el$ = _tmpl$9();
|
|
5861
6123
|
const _ref$ = elementRef;
|
|
5862
6124
|
typeof _ref$ === "function" ? use(_ref$, _el$) : elementRef = _el$;
|
|
5863
6125
|
effect((_p$) => {
|
|
@@ -5875,7 +6137,7 @@ function CustomCode(props) {
|
|
|
5875
6137
|
var custom_code_default = CustomCode;
|
|
5876
6138
|
|
|
5877
6139
|
// src/blocks/embed/component-info.ts
|
|
5878
|
-
var
|
|
6140
|
+
var componentInfo11 = {
|
|
5879
6141
|
name: "Embed",
|
|
5880
6142
|
static: true,
|
|
5881
6143
|
inputs: [{
|
|
@@ -5917,7 +6179,7 @@ var SCRIPT_MIME_TYPES = ["text/javascript", "application/javascript", "applicati
|
|
|
5917
6179
|
var isJsScript = (script) => SCRIPT_MIME_TYPES.includes(script.type);
|
|
5918
6180
|
|
|
5919
6181
|
// src/blocks/embed/embed.tsx
|
|
5920
|
-
var _tmpl$
|
|
6182
|
+
var _tmpl$10 = /* @__PURE__ */ template(`<div class=builder-embed>`);
|
|
5921
6183
|
function Embed(props) {
|
|
5922
6184
|
const [scriptsInserted, setScriptsInserted] = createSignal([]);
|
|
5923
6185
|
const [scriptsRun, setScriptsRun] = createSignal([]);
|
|
@@ -5955,7 +6217,7 @@ function Embed(props) {
|
|
|
5955
6217
|
}
|
|
5956
6218
|
createEffect(on(() => [onUpdateFn_0_elem(), onUpdateFn_0_ranInitFn__()], onUpdateFn_0));
|
|
5957
6219
|
return (() => {
|
|
5958
|
-
const _el$ = _tmpl$
|
|
6220
|
+
const _el$ = _tmpl$10();
|
|
5959
6221
|
const _ref$ = elem;
|
|
5960
6222
|
typeof _ref$ === "function" ? use(_ref$, _el$) : elem = _el$;
|
|
5961
6223
|
effect(() => _el$.innerHTML = props.content);
|
|
@@ -5965,7 +6227,7 @@ function Embed(props) {
|
|
|
5965
6227
|
var embed_default = Embed;
|
|
5966
6228
|
|
|
5967
6229
|
// src/blocks/form/form/component-info.ts
|
|
5968
|
-
var
|
|
6230
|
+
var componentInfo12 = {
|
|
5969
6231
|
name: "Form:Form",
|
|
5970
6232
|
// editableTags: ['builder-form-error']
|
|
5971
6233
|
defaults: {
|
|
@@ -6212,8 +6474,8 @@ var get = (obj, path, defaultValue) => {
|
|
|
6212
6474
|
};
|
|
6213
6475
|
|
|
6214
6476
|
// src/blocks/form/form/form.tsx
|
|
6215
|
-
var _tmpl$
|
|
6216
|
-
var _tmpl$
|
|
6477
|
+
var _tmpl$11 = /* @__PURE__ */ template(`<pre>`);
|
|
6478
|
+
var _tmpl$24 = /* @__PURE__ */ template(`<form>`);
|
|
6217
6479
|
function FormComponent(props) {
|
|
6218
6480
|
const [formState, setFormState] = createSignal("unsubmitted");
|
|
6219
6481
|
const [responseData, setResponseData] = createSignal(null);
|
|
@@ -6399,7 +6661,7 @@ function FormComponent(props) {
|
|
|
6399
6661
|
}
|
|
6400
6662
|
let formRef;
|
|
6401
6663
|
return (() => {
|
|
6402
|
-
const _el$ = _tmpl$
|
|
6664
|
+
const _el$ = _tmpl$24();
|
|
6403
6665
|
_el$.addEventListener("submit", (event) => onSubmit(event));
|
|
6404
6666
|
const _ref$ = formRef;
|
|
6405
6667
|
typeof _ref$ === "function" ? use(_ref$, _el$) : formRef = _el$;
|
|
@@ -6482,7 +6744,7 @@ function FormComponent(props) {
|
|
|
6482
6744
|
return memo(() => submissionState() === "error")() && responseData();
|
|
6483
6745
|
},
|
|
6484
6746
|
get children() {
|
|
6485
|
-
const _el$2 = _tmpl$
|
|
6747
|
+
const _el$2 = _tmpl$11();
|
|
6486
6748
|
insert(_el$2, () => JSON.stringify(responseData(), null, 2));
|
|
6487
6749
|
effect(() => className(_el$2, "builder-form-error-text " + css({
|
|
6488
6750
|
padding: "10px",
|
|
@@ -6514,7 +6776,7 @@ function FormComponent(props) {
|
|
|
6514
6776
|
var form_default = FormComponent;
|
|
6515
6777
|
|
|
6516
6778
|
// src/blocks/form/input/component-info.ts
|
|
6517
|
-
var
|
|
6779
|
+
var componentInfo13 = {
|
|
6518
6780
|
name: "Form:Input",
|
|
6519
6781
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fad6f37889d9e40bbbbc72cdb5875d6ca",
|
|
6520
6782
|
inputs: [
|
|
@@ -6566,10 +6828,10 @@ var componentInfo12 = {
|
|
|
6566
6828
|
borderColor: "#ccc"
|
|
6567
6829
|
}
|
|
6568
6830
|
};
|
|
6569
|
-
var _tmpl$
|
|
6831
|
+
var _tmpl$12 = /* @__PURE__ */ template(`<input>`);
|
|
6570
6832
|
function FormInputComponent(props) {
|
|
6571
6833
|
return (() => {
|
|
6572
|
-
const _el$ = _tmpl$
|
|
6834
|
+
const _el$ = _tmpl$12();
|
|
6573
6835
|
spread(_el$, mergeProps({}, () => props.attributes, {
|
|
6574
6836
|
get key() {
|
|
6575
6837
|
return isEditing() && props.defaultValue ? props.defaultValue : "default-key";
|
|
@@ -6599,7 +6861,7 @@ function FormInputComponent(props) {
|
|
|
6599
6861
|
var input_default = FormInputComponent;
|
|
6600
6862
|
|
|
6601
6863
|
// src/blocks/form/select/component-info.ts
|
|
6602
|
-
var
|
|
6864
|
+
var componentInfo14 = {
|
|
6603
6865
|
name: "Form:Select",
|
|
6604
6866
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F83acca093fb24aaf94dee136e9a4b045",
|
|
6605
6867
|
defaultStyles: {
|
|
@@ -6642,11 +6904,11 @@ var componentInfo13 = {
|
|
|
6642
6904
|
static: true,
|
|
6643
6905
|
noWrap: true
|
|
6644
6906
|
};
|
|
6645
|
-
var _tmpl$
|
|
6646
|
-
var _tmpl$
|
|
6907
|
+
var _tmpl$13 = /* @__PURE__ */ template(`<select>`);
|
|
6908
|
+
var _tmpl$25 = /* @__PURE__ */ template(`<option>`);
|
|
6647
6909
|
function SelectComponent(props) {
|
|
6648
6910
|
return (() => {
|
|
6649
|
-
const _el$ = _tmpl$
|
|
6911
|
+
const _el$ = _tmpl$13();
|
|
6650
6912
|
spread(_el$, mergeProps({}, () => props.attributes, {
|
|
6651
6913
|
get value() {
|
|
6652
6914
|
return props.value;
|
|
@@ -6668,7 +6930,7 @@ function SelectComponent(props) {
|
|
|
6668
6930
|
children: (option, _index) => {
|
|
6669
6931
|
const index = _index();
|
|
6670
6932
|
return (() => {
|
|
6671
|
-
const _el$2 = _tmpl$
|
|
6933
|
+
const _el$2 = _tmpl$25();
|
|
6672
6934
|
insert(_el$2, () => option.name || option.value);
|
|
6673
6935
|
effect(() => setAttribute(_el$2, "key", `${option.name}-${index}`));
|
|
6674
6936
|
effect(() => _el$2.value = option.value);
|
|
@@ -6682,7 +6944,7 @@ function SelectComponent(props) {
|
|
|
6682
6944
|
var select_default = SelectComponent;
|
|
6683
6945
|
|
|
6684
6946
|
// src/blocks/form/submit-button/component-info.ts
|
|
6685
|
-
var
|
|
6947
|
+
var componentInfo15 = {
|
|
6686
6948
|
name: "Form:SubmitButton",
|
|
6687
6949
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fdf2820ffed1f4349a94c40b3221f5b98",
|
|
6688
6950
|
defaultStyles: {
|
|
@@ -6708,10 +6970,10 @@ var componentInfo14 = {
|
|
|
6708
6970
|
// TODO: defaultChildren
|
|
6709
6971
|
// canHaveChildren: true,
|
|
6710
6972
|
};
|
|
6711
|
-
var _tmpl$
|
|
6973
|
+
var _tmpl$14 = /* @__PURE__ */ template(`<button type=submit>`);
|
|
6712
6974
|
function SubmitButton(props) {
|
|
6713
6975
|
return (() => {
|
|
6714
|
-
const _el$ = _tmpl$
|
|
6976
|
+
const _el$ = _tmpl$14();
|
|
6715
6977
|
spread(_el$, mergeProps({}, () => props.attributes), false, true);
|
|
6716
6978
|
insert(_el$, () => props.text);
|
|
6717
6979
|
return _el$;
|
|
@@ -6720,7 +6982,7 @@ function SubmitButton(props) {
|
|
|
6720
6982
|
var submit_button_default = SubmitButton;
|
|
6721
6983
|
|
|
6722
6984
|
// src/blocks/img/component-info.ts
|
|
6723
|
-
var
|
|
6985
|
+
var componentInfo16 = {
|
|
6724
6986
|
// friendlyName?
|
|
6725
6987
|
name: "Raw:Img",
|
|
6726
6988
|
hideFromInsertMenu: true,
|
|
@@ -6735,10 +6997,10 @@ var componentInfo15 = {
|
|
|
6735
6997
|
noWrap: true,
|
|
6736
6998
|
static: true
|
|
6737
6999
|
};
|
|
6738
|
-
var _tmpl$
|
|
7000
|
+
var _tmpl$15 = /* @__PURE__ */ template(`<img>`);
|
|
6739
7001
|
function ImgComponent(props) {
|
|
6740
7002
|
return (() => {
|
|
6741
|
-
const _el$ = _tmpl$
|
|
7003
|
+
const _el$ = _tmpl$15();
|
|
6742
7004
|
spread(_el$, mergeProps({
|
|
6743
7005
|
get style() {
|
|
6744
7006
|
return {
|
|
@@ -6762,7 +7024,7 @@ function ImgComponent(props) {
|
|
|
6762
7024
|
var img_default = ImgComponent;
|
|
6763
7025
|
|
|
6764
7026
|
// src/blocks/video/component-info.ts
|
|
6765
|
-
var
|
|
7027
|
+
var componentInfo17 = {
|
|
6766
7028
|
name: "Video",
|
|
6767
7029
|
canHaveChildren: true,
|
|
6768
7030
|
defaultStyles: {
|
|
@@ -6844,9 +7106,9 @@ var componentInfo16 = {
|
|
|
6844
7106
|
advanced: true
|
|
6845
7107
|
}]
|
|
6846
7108
|
};
|
|
6847
|
-
var _tmpl$
|
|
6848
|
-
var _tmpl$
|
|
6849
|
-
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>`);
|
|
6850
7112
|
function Video(props) {
|
|
6851
7113
|
const videoProps = createMemo(() => {
|
|
6852
7114
|
return {
|
|
@@ -6873,7 +7135,7 @@ function Video(props) {
|
|
|
6873
7135
|
};
|
|
6874
7136
|
});
|
|
6875
7137
|
return (() => {
|
|
6876
|
-
const _el$ = _tmpl$
|
|
7138
|
+
const _el$ = _tmpl$34(), _el$2 = _el$.firstChild;
|
|
6877
7139
|
_el$.style.setProperty("position", "relative");
|
|
6878
7140
|
spread(_el$2, mergeProps(spreadProps, {
|
|
6879
7141
|
get preload() {
|
|
@@ -6907,7 +7169,7 @@ function Video(props) {
|
|
|
6907
7169
|
return !props.lazyLoad;
|
|
6908
7170
|
},
|
|
6909
7171
|
get children() {
|
|
6910
|
-
const _el$3 = _tmpl$
|
|
7172
|
+
const _el$3 = _tmpl$16();
|
|
6911
7173
|
effect(() => setAttribute(_el$3, "src", props.video));
|
|
6912
7174
|
return _el$3;
|
|
6913
7175
|
}
|
|
@@ -6917,7 +7179,7 @@ function Video(props) {
|
|
|
6917
7179
|
return props.aspectRatio && !(props.fitContent && props.builderBlock?.children?.length);
|
|
6918
7180
|
},
|
|
6919
7181
|
get children() {
|
|
6920
|
-
const _el$4 = _tmpl$
|
|
7182
|
+
const _el$4 = _tmpl$26();
|
|
6921
7183
|
_el$4.style.setProperty("width", "100%");
|
|
6922
7184
|
_el$4.style.setProperty("pointer-events", "none");
|
|
6923
7185
|
_el$4.style.setProperty("font-size", "0px");
|
|
@@ -6930,7 +7192,7 @@ function Video(props) {
|
|
|
6930
7192
|
return props.builderBlock?.children?.length && props.fitContent;
|
|
6931
7193
|
},
|
|
6932
7194
|
get children() {
|
|
6933
|
-
const _el$5 = _tmpl$
|
|
7195
|
+
const _el$5 = _tmpl$26();
|
|
6934
7196
|
_el$5.style.setProperty("display", "flex");
|
|
6935
7197
|
_el$5.style.setProperty("flex-direction", "column");
|
|
6936
7198
|
_el$5.style.setProperty("align-items", "stretch");
|
|
@@ -6943,7 +7205,7 @@ function Video(props) {
|
|
|
6943
7205
|
return props.builderBlock?.children?.length && !props.fitContent;
|
|
6944
7206
|
},
|
|
6945
7207
|
get children() {
|
|
6946
|
-
const _el$6 = _tmpl$
|
|
7208
|
+
const _el$6 = _tmpl$26();
|
|
6947
7209
|
_el$6.style.setProperty("pointer-events", "none");
|
|
6948
7210
|
_el$6.style.setProperty("display", "flex");
|
|
6949
7211
|
_el$6.style.setProperty("flex-direction", "column");
|
|
@@ -6965,28 +7227,28 @@ var video_default = Video;
|
|
|
6965
7227
|
// src/constants/extra-components.ts
|
|
6966
7228
|
var getExtraComponents = () => [{
|
|
6967
7229
|
component: custom_code_default,
|
|
6968
|
-
...
|
|
7230
|
+
...componentInfo10
|
|
6969
7231
|
}, {
|
|
6970
7232
|
component: embed_default,
|
|
6971
|
-
...
|
|
7233
|
+
...componentInfo11
|
|
6972
7234
|
}, ...TARGET === "rsc" ? [] : [{
|
|
6973
7235
|
component: form_default,
|
|
6974
|
-
...
|
|
7236
|
+
...componentInfo12
|
|
6975
7237
|
}, {
|
|
6976
7238
|
component: input_default,
|
|
6977
|
-
...
|
|
7239
|
+
...componentInfo13
|
|
6978
7240
|
}, {
|
|
6979
7241
|
component: submit_button_default,
|
|
6980
|
-
...
|
|
7242
|
+
...componentInfo15
|
|
6981
7243
|
}, {
|
|
6982
7244
|
component: select_default,
|
|
6983
|
-
...
|
|
7245
|
+
...componentInfo14
|
|
6984
7246
|
}], {
|
|
6985
7247
|
component: img_default,
|
|
6986
|
-
...
|
|
7248
|
+
...componentInfo16
|
|
6987
7249
|
}, {
|
|
6988
7250
|
component: video_default,
|
|
6989
|
-
...
|
|
7251
|
+
...componentInfo17
|
|
6990
7252
|
}];
|
|
6991
7253
|
|
|
6992
7254
|
// src/constants/builder-registered-components.ts
|
|
@@ -7013,8 +7275,11 @@ var getDefaultRegisteredComponents = () => [{
|
|
|
7013
7275
|
...componentInfo7
|
|
7014
7276
|
}, {
|
|
7015
7277
|
component: text_default,
|
|
7278
|
+
...componentInfo9
|
|
7279
|
+
}, ...TARGET === "rsc" ? [] : [{
|
|
7280
|
+
component: tabs_default,
|
|
7016
7281
|
...componentInfo8
|
|
7017
|
-
}, ...getExtraComponents()];
|
|
7282
|
+
}], ...getExtraComponents()];
|
|
7018
7283
|
|
|
7019
7284
|
// src/functions/register-component.ts
|
|
7020
7285
|
var createRegisterComponentMessage = (info) => ({
|
|
@@ -7083,10 +7348,10 @@ var getUpdateVariantVisibilityScript = ({
|
|
|
7083
7348
|
}) => `window.${UPDATE_VARIANT_VISIBILITY_SCRIPT_FN_NAME}(
|
|
7084
7349
|
"${variationId}", "${contentId}", ${isHydrationTarget}
|
|
7085
7350
|
)`;
|
|
7086
|
-
var _tmpl$
|
|
7351
|
+
var _tmpl$17 = /* @__PURE__ */ template(`<script>`);
|
|
7087
7352
|
function InlinedScript(props) {
|
|
7088
7353
|
return (() => {
|
|
7089
|
-
const _el$ = _tmpl$
|
|
7354
|
+
const _el$ = _tmpl$17();
|
|
7090
7355
|
effect((_p$) => {
|
|
7091
7356
|
const _v$ = props.scriptStr, _v$2 = props.id;
|
|
7092
7357
|
_v$ !== _p$._v$ && (_el$.innerHTML = _p$._v$ = _v$);
|
|
@@ -7585,7 +7850,7 @@ function isFromTrustedHost(trustedHosts, e) {
|
|
|
7585
7850
|
}
|
|
7586
7851
|
|
|
7587
7852
|
// src/constants/sdk-version.ts
|
|
7588
|
-
var SDK_VERSION = "1.0.
|
|
7853
|
+
var SDK_VERSION = "1.0.24";
|
|
7589
7854
|
|
|
7590
7855
|
// src/functions/register.ts
|
|
7591
7856
|
var registry = {};
|
|
@@ -7782,6 +8047,85 @@ var subscribeToEditor = (model, callback, options) => {
|
|
|
7782
8047
|
};
|
|
7783
8048
|
};
|
|
7784
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
|
+
|
|
7785
8129
|
// src/components/content/components/enable-editor.tsx
|
|
7786
8130
|
function EnableEditor(props) {
|
|
7787
8131
|
const [ContentWrapper, setContentWrapper] = createSignal(props.contentWrapper || "div");
|
|
@@ -7821,6 +8165,12 @@ function EnableEditor(props) {
|
|
|
7821
8165
|
content: newContentValue
|
|
7822
8166
|
}));
|
|
7823
8167
|
}
|
|
8168
|
+
const showContentProps = createMemo(() => {
|
|
8169
|
+
return props.showContent ? {} : {
|
|
8170
|
+
hidden: true,
|
|
8171
|
+
"aria-hidden": true
|
|
8172
|
+
};
|
|
8173
|
+
});
|
|
7824
8174
|
function processMessage(event) {
|
|
7825
8175
|
return createEditorListener({
|
|
7826
8176
|
model: props.model,
|
|
@@ -8040,7 +8390,7 @@ function EnableEditor(props) {
|
|
|
8040
8390
|
get children() {
|
|
8041
8391
|
return createComponent(Dynamic, mergeProps({
|
|
8042
8392
|
get ["class"]() {
|
|
8043
|
-
return
|
|
8393
|
+
return getWrapperClassName(props.content?.testVariationId || props.content?.id);
|
|
8044
8394
|
}
|
|
8045
8395
|
}, {}, {
|
|
8046
8396
|
ref(r$) {
|
|
@@ -8054,10 +8404,7 @@ function EnableEditor(props) {
|
|
|
8054
8404
|
get ["builder-model"]() {
|
|
8055
8405
|
return props.model;
|
|
8056
8406
|
}
|
|
8057
|
-
}, {}, () => props.
|
|
8058
|
-
hidden: true,
|
|
8059
|
-
"aria-hidden": true
|
|
8060
|
-
}, () => props.contentWrapperProps, {
|
|
8407
|
+
}, {}, showContentProps, () => props.contentWrapperProps, {
|
|
8061
8408
|
get component() {
|
|
8062
8409
|
return ContentWrapper();
|
|
8063
8410
|
},
|
|
@@ -8071,84 +8418,6 @@ function EnableEditor(props) {
|
|
|
8071
8418
|
});
|
|
8072
8419
|
}
|
|
8073
8420
|
var enable_editor_default = EnableEditor;
|
|
8074
|
-
|
|
8075
|
-
// src/components/content/components/styles.helpers.ts
|
|
8076
|
-
var getCssFromFont = (font) => {
|
|
8077
|
-
const family = font.family + (font.kind && !font.kind.includes("#") ? ", " + font.kind : "");
|
|
8078
|
-
const name = family.split(",")[0];
|
|
8079
|
-
const url = font.fileUrl ?? font?.files?.regular;
|
|
8080
|
-
let str = "";
|
|
8081
|
-
if (url && family && name) {
|
|
8082
|
-
str += `
|
|
8083
|
-
@font-face {
|
|
8084
|
-
font-family: "${family}";
|
|
8085
|
-
src: local("${name}"), url('${url}') format('woff2');
|
|
8086
|
-
font-display: fallback;
|
|
8087
|
-
font-weight: 400;
|
|
8088
|
-
}
|
|
8089
|
-
`.trim();
|
|
8090
|
-
}
|
|
8091
|
-
if (font.files) {
|
|
8092
|
-
for (const weight in font.files) {
|
|
8093
|
-
const isNumber = String(Number(weight)) === weight;
|
|
8094
|
-
if (!isNumber) {
|
|
8095
|
-
continue;
|
|
8096
|
-
}
|
|
8097
|
-
const weightUrl = font.files[weight];
|
|
8098
|
-
if (weightUrl && weightUrl !== url) {
|
|
8099
|
-
str += `
|
|
8100
|
-
@font-face {
|
|
8101
|
-
font-family: "${family}";
|
|
8102
|
-
src: url('${weightUrl}') format('woff2');
|
|
8103
|
-
font-display: fallback;
|
|
8104
|
-
font-weight: ${weight};
|
|
8105
|
-
}
|
|
8106
|
-
`.trim();
|
|
8107
|
-
}
|
|
8108
|
-
}
|
|
8109
|
-
}
|
|
8110
|
-
return str;
|
|
8111
|
-
};
|
|
8112
|
-
var getFontCss = ({
|
|
8113
|
-
customFonts
|
|
8114
|
-
}) => {
|
|
8115
|
-
return customFonts?.map((font) => getCssFromFont(font))?.join(" ") || "";
|
|
8116
|
-
};
|
|
8117
|
-
var getCss = ({
|
|
8118
|
-
cssCode,
|
|
8119
|
-
contentId
|
|
8120
|
-
}) => {
|
|
8121
|
-
if (!cssCode) {
|
|
8122
|
-
return "";
|
|
8123
|
-
}
|
|
8124
|
-
if (!contentId) {
|
|
8125
|
-
return cssCode;
|
|
8126
|
-
}
|
|
8127
|
-
return cssCode?.replace(/&/g, `div[builder-content-id="${contentId}"]`) || "";
|
|
8128
|
-
};
|
|
8129
|
-
var DEFAULT_STYLES = `
|
|
8130
|
-
.builder-button {
|
|
8131
|
-
all: unset;
|
|
8132
|
-
}
|
|
8133
|
-
|
|
8134
|
-
.builder-text > p:first-of-type, .builder-text > .builder-paragraph:first-of-type {
|
|
8135
|
-
margin: 0;
|
|
8136
|
-
}
|
|
8137
|
-
.builder-text > p, .builder-text > .builder-paragraph {
|
|
8138
|
-
color: inherit;
|
|
8139
|
-
line-height: inherit;
|
|
8140
|
-
letter-spacing: inherit;
|
|
8141
|
-
font-weight: inherit;
|
|
8142
|
-
font-size: inherit;
|
|
8143
|
-
text-align: inherit;
|
|
8144
|
-
font-family: inherit;
|
|
8145
|
-
}
|
|
8146
|
-
`;
|
|
8147
|
-
var getDefaultStyles = (isNested) => {
|
|
8148
|
-
return !isNested ? DEFAULT_STYLES : "";
|
|
8149
|
-
};
|
|
8150
|
-
|
|
8151
|
-
// src/components/content/components/styles.tsx
|
|
8152
8421
|
function ContentStyles(props) {
|
|
8153
8422
|
const [injectedStyles, setInjectedStyles] = createSignal(`
|
|
8154
8423
|
${getCss({
|
|
@@ -8567,9 +8836,15 @@ var fetchSymbolContent = async ({
|
|
|
8567
8836
|
};
|
|
8568
8837
|
|
|
8569
8838
|
// src/blocks/symbol/symbol.tsx
|
|
8570
|
-
var _tmpl$
|
|
8839
|
+
var _tmpl$18 = /* @__PURE__ */ template(`<div>`);
|
|
8571
8840
|
function Symbol2(props) {
|
|
8572
8841
|
const [contentToUse, setContentToUse] = createSignal(props.symbol?.content);
|
|
8842
|
+
const blocksWrapper = createMemo(() => {
|
|
8843
|
+
return "div";
|
|
8844
|
+
});
|
|
8845
|
+
const contentWrapper = createMemo(() => {
|
|
8846
|
+
return "div";
|
|
8847
|
+
});
|
|
8573
8848
|
const className = createMemo(() => {
|
|
8574
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(" ");
|
|
8575
8850
|
});
|
|
@@ -8593,7 +8868,7 @@ function Symbol2(props) {
|
|
|
8593
8868
|
}
|
|
8594
8869
|
createEffect(on(() => [onUpdateFn_0_props_symbol()], onUpdateFn_0));
|
|
8595
8870
|
return (() => {
|
|
8596
|
-
const _el$ = _tmpl$
|
|
8871
|
+
const _el$ = _tmpl$18();
|
|
8597
8872
|
spread(_el$, mergeProps({
|
|
8598
8873
|
get ["class"]() {
|
|
8599
8874
|
return className();
|
|
@@ -8632,8 +8907,12 @@ function Symbol2(props) {
|
|
|
8632
8907
|
get linkComponent() {
|
|
8633
8908
|
return props.builderLinkComponent;
|
|
8634
8909
|
},
|
|
8635
|
-
blocksWrapper
|
|
8636
|
-
|
|
8910
|
+
get blocksWrapper() {
|
|
8911
|
+
return blocksWrapper();
|
|
8912
|
+
},
|
|
8913
|
+
get contentWrapper() {
|
|
8914
|
+
return contentWrapper();
|
|
8915
|
+
}
|
|
8637
8916
|
}));
|
|
8638
8917
|
return _el$;
|
|
8639
8918
|
})();
|