@builder.io/sdk-qwik 0.16.18 → 0.16.20
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/lib/browser/blocks/columns/columns.qwik.cjs +44 -37
- package/lib/browser/blocks/columns/columns.qwik.mjs +45 -38
- package/lib/browser/components/content/components/enable-editor.qwik.cjs +3 -1
- package/lib/browser/components/content/components/enable-editor.qwik.mjs +3 -1
- package/lib/browser/components/content/content.qwik.cjs +2 -0
- package/lib/browser/components/content/content.qwik.mjs +2 -0
- package/lib/browser/components/content-variants/content-variants.qwik.cjs +2 -0
- package/lib/browser/components/content-variants/content-variants.qwik.mjs +2 -0
- package/lib/browser/constants/sdk-version.qwik.cjs +1 -1
- package/lib/browser/constants/sdk-version.qwik.mjs +1 -1
- package/lib/browser/functions/get-content/generate-content-url.qwik.cjs +3 -2
- package/lib/browser/functions/get-content/generate-content-url.qwik.mjs +3 -2
- package/lib/browser/functions/track/index.qwik.cjs +3 -2
- package/lib/browser/functions/track/index.qwik.mjs +3 -2
- package/lib/edge/blocks/columns/columns.qwik.cjs +44 -37
- package/lib/edge/blocks/columns/columns.qwik.mjs +45 -38
- package/lib/edge/components/content/components/enable-editor.qwik.cjs +3 -1
- package/lib/edge/components/content/components/enable-editor.qwik.mjs +3 -1
- package/lib/edge/components/content/content.qwik.cjs +2 -0
- package/lib/edge/components/content/content.qwik.mjs +2 -0
- package/lib/edge/components/content-variants/content-variants.qwik.cjs +2 -0
- package/lib/edge/components/content-variants/content-variants.qwik.mjs +2 -0
- package/lib/edge/constants/sdk-version.qwik.cjs +1 -1
- package/lib/edge/constants/sdk-version.qwik.mjs +1 -1
- package/lib/edge/functions/get-content/generate-content-url.qwik.cjs +3 -2
- package/lib/edge/functions/get-content/generate-content-url.qwik.mjs +3 -2
- package/lib/edge/functions/track/index.qwik.cjs +3 -2
- package/lib/edge/functions/track/index.qwik.mjs +3 -2
- package/lib/node/blocks/columns/columns.qwik.cjs +44 -37
- package/lib/node/blocks/columns/columns.qwik.mjs +45 -38
- package/lib/node/components/content/components/enable-editor.qwik.cjs +3 -1
- package/lib/node/components/content/components/enable-editor.qwik.mjs +3 -1
- package/lib/node/components/content/content.qwik.cjs +2 -0
- package/lib/node/components/content/content.qwik.mjs +2 -0
- package/lib/node/components/content-variants/content-variants.qwik.cjs +2 -0
- package/lib/node/components/content-variants/content-variants.qwik.mjs +2 -0
- package/lib/node/constants/sdk-version.qwik.cjs +1 -1
- package/lib/node/constants/sdk-version.qwik.mjs +1 -1
- package/lib/node/functions/evaluate/node-runtime/node-runtime.qwik.cjs +5 -4
- package/lib/node/functions/evaluate/node-runtime/node-runtime.qwik.mjs +5 -4
- package/lib/node/functions/get-content/generate-content-url.qwik.cjs +3 -2
- package/lib/node/functions/get-content/generate-content-url.qwik.mjs +3 -2
- package/lib/node/functions/track/index.qwik.cjs +3 -2
- package/lib/node/functions/track/index.qwik.mjs +3 -2
- package/package.json +1 -1
- package/types/src/blocks/columns/columns.d.ts +10 -10
- package/types/src/components/content/components/enable-editor.d.ts +1 -1
- package/types/src/components/content-variants/content-variants.types.d.ts +4 -0
- package/types/src/constants/sdk-version.d.ts +1 -1
- package/types/src/functions/evaluate/node-runtime/setIvm.d.ts +1 -0
- package/types/src/functions/get-content/types.d.ts +4 -0
- package/types/src/functions/track/index.d.ts +3 -1
|
@@ -10,36 +10,36 @@ const getClassPropName = require("../../functions/get-class-prop-name.qwik.cjs")
|
|
|
10
10
|
const getStyle = require("../../functions/get-style.qwik.cjs");
|
|
11
11
|
const helpers = require("./helpers.qwik.cjs");
|
|
12
12
|
const qwik = require("@builder.io/qwik");
|
|
13
|
-
const getTagName = function getTagName2(props, state, column) {
|
|
13
|
+
const getTagName = function getTagName2(props, state, gutterSize, cols, stackAt, flexDir, column) {
|
|
14
14
|
return column.link ? props.builderLinkComponent || "a" : "div";
|
|
15
15
|
};
|
|
16
|
-
const getWidth = function getWidth2(props, state, index) {
|
|
16
|
+
const getWidth = function getWidth2(props, state, gutterSize, cols, stackAt, flexDir, index) {
|
|
17
17
|
var _a;
|
|
18
|
-
return ((_a =
|
|
18
|
+
return ((_a = cols.value[index]) == null ? void 0 : _a.width) || 100 / cols.value.length;
|
|
19
19
|
};
|
|
20
|
-
const getColumnCssWidth = function getColumnCssWidth2(props, state, index) {
|
|
21
|
-
const width = getWidth(props, state, index);
|
|
22
|
-
const subtractWidth =
|
|
20
|
+
const getColumnCssWidth = function getColumnCssWidth2(props, state, gutterSize, cols, stackAt, flexDir, index) {
|
|
21
|
+
const width = getWidth(props, state, gutterSize, cols, stackAt, flexDir, index);
|
|
22
|
+
const subtractWidth = gutterSize.value * (cols.value.length - 1) * (width / 100);
|
|
23
23
|
return `calc(${width}% - ${subtractWidth}px)`;
|
|
24
24
|
};
|
|
25
|
-
const getTabletStyle = function getTabletStyle2(props, state, { stackedStyle, desktopStyle }) {
|
|
26
|
-
return
|
|
25
|
+
const getTabletStyle = function getTabletStyle2(props, state, gutterSize, cols, stackAt, flexDir, { stackedStyle, desktopStyle }) {
|
|
26
|
+
return stackAt.value === "tablet" ? stackedStyle : desktopStyle;
|
|
27
27
|
};
|
|
28
|
-
const getMobileStyle = function getMobileStyle2(props, state, { stackedStyle, desktopStyle }) {
|
|
29
|
-
return
|
|
28
|
+
const getMobileStyle = function getMobileStyle2(props, state, gutterSize, cols, stackAt, flexDir, { stackedStyle, desktopStyle }) {
|
|
29
|
+
return stackAt.value === "never" ? desktopStyle : stackedStyle;
|
|
30
30
|
};
|
|
31
|
-
const columnsCssVars = function columnsCssVars2(props, state) {
|
|
31
|
+
const columnsCssVars = function columnsCssVars2(props, state, gutterSize, cols, stackAt, flexDir) {
|
|
32
32
|
return {
|
|
33
|
-
"--flex-dir":
|
|
34
|
-
"--flex-dir-tablet": getTabletStyle(props, state, {
|
|
35
|
-
stackedStyle:
|
|
33
|
+
"--flex-dir": flexDir.value,
|
|
34
|
+
"--flex-dir-tablet": getTabletStyle(props, state, gutterSize, cols, stackAt, flexDir, {
|
|
35
|
+
stackedStyle: flexDir.value,
|
|
36
36
|
desktopStyle: "row"
|
|
37
37
|
})
|
|
38
38
|
};
|
|
39
39
|
};
|
|
40
|
-
const columnCssVars = function columnCssVars2(props, state, index) {
|
|
41
|
-
const gutter = index === 0 ? 0 :
|
|
42
|
-
const width = getColumnCssWidth(props, state, index);
|
|
40
|
+
const columnCssVars = function columnCssVars2(props, state, gutterSize, cols, stackAt, flexDir, index) {
|
|
41
|
+
const gutter = index === 0 ? 0 : gutterSize.value;
|
|
42
|
+
const width = getColumnCssWidth(props, state, gutterSize, cols, stackAt, flexDir, index);
|
|
43
43
|
const gutterPixels = `${gutter}px`;
|
|
44
44
|
const mobileWidth = "100%";
|
|
45
45
|
const mobileMarginLeft = 0;
|
|
@@ -53,33 +53,33 @@ const columnCssVars = function columnCssVars2(props, state, index) {
|
|
|
53
53
|
...sharedStyles,
|
|
54
54
|
width,
|
|
55
55
|
[marginLeftKey]: gutterPixels,
|
|
56
|
-
"--column-width-mobile": getMobileStyle(props, state, {
|
|
56
|
+
"--column-width-mobile": getMobileStyle(props, state, gutterSize, cols, stackAt, flexDir, {
|
|
57
57
|
stackedStyle: mobileWidth,
|
|
58
58
|
desktopStyle: width
|
|
59
59
|
}),
|
|
60
|
-
"--column-margin-left-mobile": getMobileStyle(props, state, {
|
|
60
|
+
"--column-margin-left-mobile": getMobileStyle(props, state, gutterSize, cols, stackAt, flexDir, {
|
|
61
61
|
stackedStyle: mobileMarginLeft,
|
|
62
62
|
desktopStyle: gutterPixels
|
|
63
63
|
}),
|
|
64
|
-
"--column-width-tablet": getTabletStyle(props, state, {
|
|
64
|
+
"--column-width-tablet": getTabletStyle(props, state, gutterSize, cols, stackAt, flexDir, {
|
|
65
65
|
stackedStyle: mobileWidth,
|
|
66
66
|
desktopStyle: width
|
|
67
67
|
}),
|
|
68
|
-
"--column-margin-left-tablet": getTabletStyle(props, state, {
|
|
68
|
+
"--column-margin-left-tablet": getTabletStyle(props, state, gutterSize, cols, stackAt, flexDir, {
|
|
69
69
|
stackedStyle: mobileMarginLeft,
|
|
70
70
|
desktopStyle: gutterPixels
|
|
71
71
|
})
|
|
72
72
|
};
|
|
73
73
|
};
|
|
74
|
-
const getWidthForBreakpointSize = function getWidthForBreakpointSize2(props, state, size) {
|
|
74
|
+
const getWidthForBreakpointSize = function getWidthForBreakpointSize2(props, state, gutterSize, cols, stackAt, flexDir, size) {
|
|
75
75
|
var _a, _b;
|
|
76
76
|
const breakpointSizes = deviceSizes.getSizesForBreakpoints(((_b = (_a = props.builderContext.content) == null ? void 0 : _a.meta) == null ? void 0 : _b.breakpoints) || {});
|
|
77
77
|
return breakpointSizes[size].max;
|
|
78
78
|
};
|
|
79
|
-
const columnsStyles = function columnsStyles2(props, state) {
|
|
79
|
+
const columnsStyles = function columnsStyles2(props, state, gutterSize, cols, stackAt, flexDir) {
|
|
80
80
|
const childColumnDiv = `.${props.builderBlock.id}-breakpoints > .builder-column`;
|
|
81
81
|
return `
|
|
82
|
-
@media (max-width: ${getWidthForBreakpointSize(props, state, "medium")}px) {
|
|
82
|
+
@media (max-width: ${getWidthForBreakpointSize(props, state, gutterSize, cols, stackAt, flexDir, "medium")}px) {
|
|
83
83
|
.${props.builderBlock.id}-breakpoints {
|
|
84
84
|
flex-direction: var(--flex-dir-tablet);
|
|
85
85
|
align-items: stretch;
|
|
@@ -91,7 +91,7 @@ const columnsStyles = function columnsStyles2(props, state) {
|
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
93
|
|
|
94
|
-
@media (max-width: ${getWidthForBreakpointSize(props, state, "small")}px) {
|
|
94
|
+
@media (max-width: ${getWidthForBreakpointSize(props, state, gutterSize, cols, stackAt, flexDir, "small")}px) {
|
|
95
95
|
.${props.builderBlock.id}-breakpoints {
|
|
96
96
|
flex-direction: var(--flex-dir);
|
|
97
97
|
align-items: stretch;
|
|
@@ -104,39 +104,46 @@ const columnsStyles = function columnsStyles2(props, state) {
|
|
|
104
104
|
},
|
|
105
105
|
`;
|
|
106
106
|
};
|
|
107
|
-
const getAttributes = function getAttributes2(props, state, column, index) {
|
|
107
|
+
const getAttributes = function getAttributes2(props, state, gutterSize, cols, stackAt, flexDir, column, index) {
|
|
108
108
|
return {
|
|
109
109
|
...{},
|
|
110
110
|
...column.link ? {
|
|
111
111
|
href: column.link
|
|
112
112
|
} : {},
|
|
113
113
|
[getClassPropName.getClassPropName()]: "builder-column",
|
|
114
|
-
style: getStyle.mapStyleObjToStrIfNeeded(columnCssVars(props, state, index))
|
|
114
|
+
style: getStyle.mapStyleObjToStrIfNeeded(columnCssVars(props, state, gutterSize, cols, stackAt, flexDir, index))
|
|
115
115
|
};
|
|
116
116
|
};
|
|
117
117
|
const Columns = qwik.component$((props) => {
|
|
118
118
|
var _a;
|
|
119
|
-
const state =
|
|
120
|
-
cols: props.columns || [],
|
|
121
|
-
flexDir: props.stackColumnsAt === "never" ? "row" : props.reverseColumnsWhenStacked ? "column-reverse" : "column",
|
|
122
|
-
gutterSize: typeof props.space === "number" ? props.space || 0 : 20,
|
|
123
|
-
stackAt: props.stackColumnsAt || "tablet"
|
|
124
|
-
});
|
|
119
|
+
const state = {};
|
|
125
120
|
qwik.useStylesScoped$(STYLES);
|
|
121
|
+
const gutterSize = qwik.useComputed$(() => {
|
|
122
|
+
return typeof props.space === "number" ? props.space || 0 : 20;
|
|
123
|
+
});
|
|
124
|
+
const cols = qwik.useComputed$(() => {
|
|
125
|
+
return props.columns || [];
|
|
126
|
+
});
|
|
127
|
+
const stackAt = qwik.useComputed$(() => {
|
|
128
|
+
return props.stackColumnsAt || "tablet";
|
|
129
|
+
});
|
|
130
|
+
const flexDir = qwik.useComputed$(() => {
|
|
131
|
+
return props.stackColumnsAt === "never" ? "row" : props.reverseColumnsWhenStacked ? "column-reverse" : "column";
|
|
132
|
+
});
|
|
126
133
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", {
|
|
127
134
|
class: helpers.getColumnsClass((_a = props.builderBlock) == null ? void 0 : _a.id) + " div-Columns",
|
|
128
|
-
style: columnsCssVars(props, state),
|
|
135
|
+
style: columnsCssVars(props, state, gutterSize, cols, stackAt, flexDir),
|
|
129
136
|
children: [
|
|
130
137
|
/* @__PURE__ */ jsxRuntime.jsx(inlinedStyles.InlinedStyles, {
|
|
131
138
|
id: "builderio-columns",
|
|
132
|
-
styles: columnsStyles(props, state),
|
|
139
|
+
styles: columnsStyles(props, state, gutterSize, cols, stackAt, flexDir),
|
|
133
140
|
nonce: props.builderContext.nonce
|
|
134
141
|
}),
|
|
135
142
|
(props.columns || []).map((column, index) => {
|
|
136
143
|
return /* @__PURE__ */ jsxRuntime.jsx(dynamicRenderer.DynamicRenderer, {
|
|
137
|
-
TagName: getTagName(props, state, column),
|
|
144
|
+
TagName: getTagName(props, state, gutterSize, cols, stackAt, flexDir, column),
|
|
138
145
|
actionAttributes: {},
|
|
139
|
-
attributes: getAttributes(props, state, column, index),
|
|
146
|
+
attributes: getAttributes(props, state, gutterSize, cols, stackAt, flexDir, column, index),
|
|
140
147
|
children: /* @__PURE__ */ jsxRuntime.jsx(blocks.Blocks, {
|
|
141
148
|
path: `component.options.columns.${index}.blocks`,
|
|
142
149
|
parent: props.builderBlock.id,
|
|
@@ -7,37 +7,37 @@ import { deoptSignal } from "../../functions/deopt.qwik.mjs";
|
|
|
7
7
|
import { getClassPropName } from "../../functions/get-class-prop-name.qwik.mjs";
|
|
8
8
|
import { mapStyleObjToStrIfNeeded } from "../../functions/get-style.qwik.mjs";
|
|
9
9
|
import { getColumnsClass } from "./helpers.qwik.mjs";
|
|
10
|
-
import { component$,
|
|
11
|
-
const getTagName = function getTagName2(props, state, column) {
|
|
10
|
+
import { component$, useStylesScoped$, useComputed$ } from "@builder.io/qwik";
|
|
11
|
+
const getTagName = function getTagName2(props, state, gutterSize, cols, stackAt, flexDir, column) {
|
|
12
12
|
return column.link ? props.builderLinkComponent || "a" : "div";
|
|
13
13
|
};
|
|
14
|
-
const getWidth = function getWidth2(props, state, index) {
|
|
14
|
+
const getWidth = function getWidth2(props, state, gutterSize, cols, stackAt, flexDir, index) {
|
|
15
15
|
var _a;
|
|
16
|
-
return ((_a =
|
|
16
|
+
return ((_a = cols.value[index]) == null ? void 0 : _a.width) || 100 / cols.value.length;
|
|
17
17
|
};
|
|
18
|
-
const getColumnCssWidth = function getColumnCssWidth2(props, state, index) {
|
|
19
|
-
const width = getWidth(props, state, index);
|
|
20
|
-
const subtractWidth =
|
|
18
|
+
const getColumnCssWidth = function getColumnCssWidth2(props, state, gutterSize, cols, stackAt, flexDir, index) {
|
|
19
|
+
const width = getWidth(props, state, gutterSize, cols, stackAt, flexDir, index);
|
|
20
|
+
const subtractWidth = gutterSize.value * (cols.value.length - 1) * (width / 100);
|
|
21
21
|
return `calc(${width}% - ${subtractWidth}px)`;
|
|
22
22
|
};
|
|
23
|
-
const getTabletStyle = function getTabletStyle2(props, state, { stackedStyle, desktopStyle }) {
|
|
24
|
-
return
|
|
23
|
+
const getTabletStyle = function getTabletStyle2(props, state, gutterSize, cols, stackAt, flexDir, { stackedStyle, desktopStyle }) {
|
|
24
|
+
return stackAt.value === "tablet" ? stackedStyle : desktopStyle;
|
|
25
25
|
};
|
|
26
|
-
const getMobileStyle = function getMobileStyle2(props, state, { stackedStyle, desktopStyle }) {
|
|
27
|
-
return
|
|
26
|
+
const getMobileStyle = function getMobileStyle2(props, state, gutterSize, cols, stackAt, flexDir, { stackedStyle, desktopStyle }) {
|
|
27
|
+
return stackAt.value === "never" ? desktopStyle : stackedStyle;
|
|
28
28
|
};
|
|
29
|
-
const columnsCssVars = function columnsCssVars2(props, state) {
|
|
29
|
+
const columnsCssVars = function columnsCssVars2(props, state, gutterSize, cols, stackAt, flexDir) {
|
|
30
30
|
return {
|
|
31
|
-
"--flex-dir":
|
|
32
|
-
"--flex-dir-tablet": getTabletStyle(props, state, {
|
|
33
|
-
stackedStyle:
|
|
31
|
+
"--flex-dir": flexDir.value,
|
|
32
|
+
"--flex-dir-tablet": getTabletStyle(props, state, gutterSize, cols, stackAt, flexDir, {
|
|
33
|
+
stackedStyle: flexDir.value,
|
|
34
34
|
desktopStyle: "row"
|
|
35
35
|
})
|
|
36
36
|
};
|
|
37
37
|
};
|
|
38
|
-
const columnCssVars = function columnCssVars2(props, state, index) {
|
|
39
|
-
const gutter = index === 0 ? 0 :
|
|
40
|
-
const width = getColumnCssWidth(props, state, index);
|
|
38
|
+
const columnCssVars = function columnCssVars2(props, state, gutterSize, cols, stackAt, flexDir, index) {
|
|
39
|
+
const gutter = index === 0 ? 0 : gutterSize.value;
|
|
40
|
+
const width = getColumnCssWidth(props, state, gutterSize, cols, stackAt, flexDir, index);
|
|
41
41
|
const gutterPixels = `${gutter}px`;
|
|
42
42
|
const mobileWidth = "100%";
|
|
43
43
|
const mobileMarginLeft = 0;
|
|
@@ -51,33 +51,33 @@ const columnCssVars = function columnCssVars2(props, state, index) {
|
|
|
51
51
|
...sharedStyles,
|
|
52
52
|
width,
|
|
53
53
|
[marginLeftKey]: gutterPixels,
|
|
54
|
-
"--column-width-mobile": getMobileStyle(props, state, {
|
|
54
|
+
"--column-width-mobile": getMobileStyle(props, state, gutterSize, cols, stackAt, flexDir, {
|
|
55
55
|
stackedStyle: mobileWidth,
|
|
56
56
|
desktopStyle: width
|
|
57
57
|
}),
|
|
58
|
-
"--column-margin-left-mobile": getMobileStyle(props, state, {
|
|
58
|
+
"--column-margin-left-mobile": getMobileStyle(props, state, gutterSize, cols, stackAt, flexDir, {
|
|
59
59
|
stackedStyle: mobileMarginLeft,
|
|
60
60
|
desktopStyle: gutterPixels
|
|
61
61
|
}),
|
|
62
|
-
"--column-width-tablet": getTabletStyle(props, state, {
|
|
62
|
+
"--column-width-tablet": getTabletStyle(props, state, gutterSize, cols, stackAt, flexDir, {
|
|
63
63
|
stackedStyle: mobileWidth,
|
|
64
64
|
desktopStyle: width
|
|
65
65
|
}),
|
|
66
|
-
"--column-margin-left-tablet": getTabletStyle(props, state, {
|
|
66
|
+
"--column-margin-left-tablet": getTabletStyle(props, state, gutterSize, cols, stackAt, flexDir, {
|
|
67
67
|
stackedStyle: mobileMarginLeft,
|
|
68
68
|
desktopStyle: gutterPixels
|
|
69
69
|
})
|
|
70
70
|
};
|
|
71
71
|
};
|
|
72
|
-
const getWidthForBreakpointSize = function getWidthForBreakpointSize2(props, state, size) {
|
|
72
|
+
const getWidthForBreakpointSize = function getWidthForBreakpointSize2(props, state, gutterSize, cols, stackAt, flexDir, size) {
|
|
73
73
|
var _a, _b;
|
|
74
74
|
const breakpointSizes = getSizesForBreakpoints(((_b = (_a = props.builderContext.content) == null ? void 0 : _a.meta) == null ? void 0 : _b.breakpoints) || {});
|
|
75
75
|
return breakpointSizes[size].max;
|
|
76
76
|
};
|
|
77
|
-
const columnsStyles = function columnsStyles2(props, state) {
|
|
77
|
+
const columnsStyles = function columnsStyles2(props, state, gutterSize, cols, stackAt, flexDir) {
|
|
78
78
|
const childColumnDiv = `.${props.builderBlock.id}-breakpoints > .builder-column`;
|
|
79
79
|
return `
|
|
80
|
-
@media (max-width: ${getWidthForBreakpointSize(props, state, "medium")}px) {
|
|
80
|
+
@media (max-width: ${getWidthForBreakpointSize(props, state, gutterSize, cols, stackAt, flexDir, "medium")}px) {
|
|
81
81
|
.${props.builderBlock.id}-breakpoints {
|
|
82
82
|
flex-direction: var(--flex-dir-tablet);
|
|
83
83
|
align-items: stretch;
|
|
@@ -89,7 +89,7 @@ const columnsStyles = function columnsStyles2(props, state) {
|
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
91
|
|
|
92
|
-
@media (max-width: ${getWidthForBreakpointSize(props, state, "small")}px) {
|
|
92
|
+
@media (max-width: ${getWidthForBreakpointSize(props, state, gutterSize, cols, stackAt, flexDir, "small")}px) {
|
|
93
93
|
.${props.builderBlock.id}-breakpoints {
|
|
94
94
|
flex-direction: var(--flex-dir);
|
|
95
95
|
align-items: stretch;
|
|
@@ -102,39 +102,46 @@ const columnsStyles = function columnsStyles2(props, state) {
|
|
|
102
102
|
},
|
|
103
103
|
`;
|
|
104
104
|
};
|
|
105
|
-
const getAttributes = function getAttributes2(props, state, column, index) {
|
|
105
|
+
const getAttributes = function getAttributes2(props, state, gutterSize, cols, stackAt, flexDir, column, index) {
|
|
106
106
|
return {
|
|
107
107
|
...{},
|
|
108
108
|
...column.link ? {
|
|
109
109
|
href: column.link
|
|
110
110
|
} : {},
|
|
111
111
|
[getClassPropName()]: "builder-column",
|
|
112
|
-
style: mapStyleObjToStrIfNeeded(columnCssVars(props, state, index))
|
|
112
|
+
style: mapStyleObjToStrIfNeeded(columnCssVars(props, state, gutterSize, cols, stackAt, flexDir, index))
|
|
113
113
|
};
|
|
114
114
|
};
|
|
115
115
|
const Columns = component$((props) => {
|
|
116
116
|
var _a;
|
|
117
|
-
const state =
|
|
118
|
-
cols: props.columns || [],
|
|
119
|
-
flexDir: props.stackColumnsAt === "never" ? "row" : props.reverseColumnsWhenStacked ? "column-reverse" : "column",
|
|
120
|
-
gutterSize: typeof props.space === "number" ? props.space || 0 : 20,
|
|
121
|
-
stackAt: props.stackColumnsAt || "tablet"
|
|
122
|
-
});
|
|
117
|
+
const state = {};
|
|
123
118
|
useStylesScoped$(STYLES);
|
|
119
|
+
const gutterSize = useComputed$(() => {
|
|
120
|
+
return typeof props.space === "number" ? props.space || 0 : 20;
|
|
121
|
+
});
|
|
122
|
+
const cols = useComputed$(() => {
|
|
123
|
+
return props.columns || [];
|
|
124
|
+
});
|
|
125
|
+
const stackAt = useComputed$(() => {
|
|
126
|
+
return props.stackColumnsAt || "tablet";
|
|
127
|
+
});
|
|
128
|
+
const flexDir = useComputed$(() => {
|
|
129
|
+
return props.stackColumnsAt === "never" ? "row" : props.reverseColumnsWhenStacked ? "column-reverse" : "column";
|
|
130
|
+
});
|
|
124
131
|
return /* @__PURE__ */ jsxs("div", {
|
|
125
132
|
class: getColumnsClass((_a = props.builderBlock) == null ? void 0 : _a.id) + " div-Columns",
|
|
126
|
-
style: columnsCssVars(props, state),
|
|
133
|
+
style: columnsCssVars(props, state, gutterSize, cols, stackAt, flexDir),
|
|
127
134
|
children: [
|
|
128
135
|
/* @__PURE__ */ jsx(InlinedStyles, {
|
|
129
136
|
id: "builderio-columns",
|
|
130
|
-
styles: columnsStyles(props, state),
|
|
137
|
+
styles: columnsStyles(props, state, gutterSize, cols, stackAt, flexDir),
|
|
131
138
|
nonce: props.builderContext.nonce
|
|
132
139
|
}),
|
|
133
140
|
(props.columns || []).map((column, index) => {
|
|
134
141
|
return /* @__PURE__ */ jsx(DynamicRenderer, {
|
|
135
|
-
TagName: getTagName(props, state, column),
|
|
142
|
+
TagName: getTagName(props, state, gutterSize, cols, stackAt, flexDir, column),
|
|
136
143
|
actionAttributes: {},
|
|
137
|
-
attributes: getAttributes(props, state, column, index),
|
|
144
|
+
attributes: getAttributes(props, state, gutterSize, cols, stackAt, flexDir, column, index),
|
|
138
145
|
children: /* @__PURE__ */ jsx(Blocks, {
|
|
139
146
|
path: `component.options.columns.${index}.blocks`,
|
|
140
147
|
parent: props.builderBlock.id,
|
|
@@ -80,6 +80,7 @@ const onClick = function onClick2(props, state, showContentProps, elementRef, ev
|
|
|
80
80
|
const variationId = (_a = props.builderContextSignal.content) == null ? void 0 : _a.testVariationId;
|
|
81
81
|
const contentId = (_b = props.builderContextSignal.content) == null ? void 0 : _b.id;
|
|
82
82
|
index$1._track({
|
|
83
|
+
apiHost: props.apiHost,
|
|
83
84
|
type: "click",
|
|
84
85
|
canTrack: canTrack.getDefaultCanTrack(props.canTrack),
|
|
85
86
|
contentId,
|
|
@@ -193,7 +194,7 @@ const EnableEditor = qwik.component$((props) => {
|
|
|
193
194
|
qwik.useOn("qvisible", qwik.$((event, element) => {
|
|
194
195
|
var _a2, _b2, _c2, _d2;
|
|
195
196
|
if (isBrowser.isBrowser()) {
|
|
196
|
-
if (isEditing.isEditing()) {
|
|
197
|
+
if (isEditing.isEditing() && !props.isNestedRender) {
|
|
197
198
|
if (element) {
|
|
198
199
|
element.dispatchEvent(new CustomEvent("initeditingbldr"));
|
|
199
200
|
}
|
|
@@ -204,6 +205,7 @@ const EnableEditor = qwik.component$((props) => {
|
|
|
204
205
|
const contentId = (_c2 = element.attributes.getNamedItem("contentId")) == null ? void 0 : _c2.value;
|
|
205
206
|
const apiKeyProp = (_d2 = element.attributes.getNamedItem("apiKey")) == null ? void 0 : _d2.value;
|
|
206
207
|
index$1._track({
|
|
208
|
+
apiHost: props.apiHost,
|
|
207
209
|
type: "impression",
|
|
208
210
|
canTrack: true,
|
|
209
211
|
contentId,
|
|
@@ -78,6 +78,7 @@ const onClick = function onClick2(props, state, showContentProps, elementRef, ev
|
|
|
78
78
|
const variationId = (_a = props.builderContextSignal.content) == null ? void 0 : _a.testVariationId;
|
|
79
79
|
const contentId = (_b = props.builderContextSignal.content) == null ? void 0 : _b.id;
|
|
80
80
|
_track({
|
|
81
|
+
apiHost: props.apiHost,
|
|
81
82
|
type: "click",
|
|
82
83
|
canTrack: getDefaultCanTrack(props.canTrack),
|
|
83
84
|
contentId,
|
|
@@ -191,7 +192,7 @@ const EnableEditor = component$((props) => {
|
|
|
191
192
|
useOn("qvisible", $((event, element) => {
|
|
192
193
|
var _a2, _b2, _c2, _d2;
|
|
193
194
|
if (isBrowser()) {
|
|
194
|
-
if (isEditing()) {
|
|
195
|
+
if (isEditing() && !props.isNestedRender) {
|
|
195
196
|
if (element) {
|
|
196
197
|
element.dispatchEvent(new CustomEvent("initeditingbldr"));
|
|
197
198
|
}
|
|
@@ -202,6 +203,7 @@ const EnableEditor = component$((props) => {
|
|
|
202
203
|
const contentId = (_c2 = element.attributes.getNamedItem("contentId")) == null ? void 0 : _c2.value;
|
|
203
204
|
const apiKeyProp = (_d2 = element.attributes.getNamedItem("apiKey")) == null ? void 0 : _d2.value;
|
|
204
205
|
_track({
|
|
206
|
+
apiHost: props.apiHost,
|
|
205
207
|
type: "impression",
|
|
206
208
|
canTrack: true,
|
|
207
209
|
contentId,
|
|
@@ -99,6 +99,7 @@ const ContentComponent = qwik.component$((props) => {
|
|
|
99
99
|
}
|
|
100
100
|
});
|
|
101
101
|
return /* @__PURE__ */ jsxRuntime.jsxs(enableEditor.EnableEditor, {
|
|
102
|
+
apiHost: props.apiHost,
|
|
102
103
|
nonce: props.nonce,
|
|
103
104
|
content: props.content,
|
|
104
105
|
data: props.data,
|
|
@@ -113,6 +114,7 @@ const ContentComponent = qwik.component$((props) => {
|
|
|
113
114
|
contentWrapper: props.contentWrapper,
|
|
114
115
|
contentWrapperProps: props.contentWrapperProps,
|
|
115
116
|
trustedHosts: props.trustedHosts,
|
|
117
|
+
isNestedRender: props.isNestedRender,
|
|
116
118
|
children: [
|
|
117
119
|
props.isSsrAbTest ? /* @__PURE__ */ jsxRuntime.jsx(inlinedScript.InlinedScript, {
|
|
118
120
|
id: "builderio-variant-visibility",
|
|
@@ -97,6 +97,7 @@ const ContentComponent = component$((props) => {
|
|
|
97
97
|
}
|
|
98
98
|
});
|
|
99
99
|
return /* @__PURE__ */ jsxs(EnableEditor, {
|
|
100
|
+
apiHost: props.apiHost,
|
|
100
101
|
nonce: props.nonce,
|
|
101
102
|
content: props.content,
|
|
102
103
|
data: props.data,
|
|
@@ -111,6 +112,7 @@ const ContentComponent = component$((props) => {
|
|
|
111
112
|
contentWrapper: props.contentWrapper,
|
|
112
113
|
contentWrapperProps: props.contentWrapperProps,
|
|
113
114
|
trustedHosts: props.trustedHosts,
|
|
115
|
+
isNestedRender: props.isNestedRender,
|
|
114
116
|
children: [
|
|
115
117
|
props.isSsrAbTest ? /* @__PURE__ */ jsx(InlinedScript, {
|
|
116
118
|
id: "builderio-variant-visibility",
|
|
@@ -57,6 +57,7 @@ const ContentVariants = qwik.component$((props) => {
|
|
|
57
57
|
}),
|
|
58
58
|
(helpers.getVariants(props.content) || []).map((variant) => {
|
|
59
59
|
return /* @__PURE__ */ jsxRuntime.jsx(content.ContentComponent, {
|
|
60
|
+
apiHost: props.apiHost,
|
|
60
61
|
isNestedRender: props.isNestedRender,
|
|
61
62
|
nonce: props.nonce,
|
|
62
63
|
content: variant,
|
|
@@ -82,6 +83,7 @@ const ContentVariants = qwik.component$((props) => {
|
|
|
82
83
|
]
|
|
83
84
|
}) : null,
|
|
84
85
|
/* @__PURE__ */ jsxRuntime.jsx(content.ContentComponent, {
|
|
86
|
+
apiHost: props.apiHost,
|
|
85
87
|
nonce: props.nonce,
|
|
86
88
|
isNestedRender: props.isNestedRender,
|
|
87
89
|
content: defaultContent.value,
|
|
@@ -55,6 +55,7 @@ const ContentVariants = component$((props) => {
|
|
|
55
55
|
}),
|
|
56
56
|
(getVariants(props.content) || []).map((variant) => {
|
|
57
57
|
return /* @__PURE__ */ jsx(ContentComponent, {
|
|
58
|
+
apiHost: props.apiHost,
|
|
58
59
|
isNestedRender: props.isNestedRender,
|
|
59
60
|
nonce: props.nonce,
|
|
60
61
|
content: variant,
|
|
@@ -80,6 +81,7 @@ const ContentVariants = component$((props) => {
|
|
|
80
81
|
]
|
|
81
82
|
}) : null,
|
|
82
83
|
/* @__PURE__ */ jsx(ContentComponent, {
|
|
84
|
+
apiHost: props.apiHost,
|
|
83
85
|
nonce: props.nonce,
|
|
84
86
|
isNestedRender: props.isNestedRender,
|
|
85
87
|
content: defaultContent.value,
|
|
@@ -6,7 +6,7 @@ const apiVersion = require("../../types/api-version.qwik.cjs");
|
|
|
6
6
|
const index = require("../get-builder-search-params/index.qwik.cjs");
|
|
7
7
|
const isPositiveNumber = (thing) => typeof thing === "number" && !isNaN(thing) && thing >= 0;
|
|
8
8
|
const generateContentUrl = (options) => {
|
|
9
|
-
const { limit = 30, userAttributes, query, model, apiKey, enrich, locale, apiVersion: apiVersion$1 = apiVersion.DEFAULT_API_VERSION, fields, omit, offset, cacheSeconds, staleCacheSeconds, sort, includeUnpublished } = options;
|
|
9
|
+
const { limit = 30, userAttributes, query, model, apiKey, enrich, locale, apiVersion: apiVersion$1 = apiVersion.DEFAULT_API_VERSION, fields, omit, offset, cacheSeconds, staleCacheSeconds, sort, includeUnpublished, apiHost } = options;
|
|
10
10
|
if (!apiKey) {
|
|
11
11
|
throw new Error("Missing API key");
|
|
12
12
|
}
|
|
@@ -16,7 +16,8 @@ const generateContentUrl = (options) => {
|
|
|
16
16
|
throw new Error(`Invalid apiVersion: expected 'v3', received '${apiVersion$1}'`);
|
|
17
17
|
}
|
|
18
18
|
const noTraverse = limit !== 1;
|
|
19
|
-
const
|
|
19
|
+
const baseUrl = apiHost || "https://cdn.builder.io";
|
|
20
|
+
const url = new URL(`${baseUrl}/api/${apiVersion$1}/content/${model}`);
|
|
20
21
|
url.searchParams.set("apiKey", apiKey);
|
|
21
22
|
url.searchParams.set("limit", String(limit));
|
|
22
23
|
url.searchParams.set("noTraverse", String(noTraverse));
|
|
@@ -4,7 +4,7 @@ import { DEFAULT_API_VERSION } from "../../types/api-version.qwik.mjs";
|
|
|
4
4
|
import { getBuilderSearchParamsFromWindow } from "../get-builder-search-params/index.qwik.mjs";
|
|
5
5
|
const isPositiveNumber = (thing) => typeof thing === "number" && !isNaN(thing) && thing >= 0;
|
|
6
6
|
const generateContentUrl = (options) => {
|
|
7
|
-
const { limit = 30, userAttributes, query, model, apiKey, enrich, locale, apiVersion = DEFAULT_API_VERSION, fields, omit, offset, cacheSeconds, staleCacheSeconds, sort, includeUnpublished } = options;
|
|
7
|
+
const { limit = 30, userAttributes, query, model, apiKey, enrich, locale, apiVersion = DEFAULT_API_VERSION, fields, omit, offset, cacheSeconds, staleCacheSeconds, sort, includeUnpublished, apiHost } = options;
|
|
8
8
|
if (!apiKey) {
|
|
9
9
|
throw new Error("Missing API key");
|
|
10
10
|
}
|
|
@@ -14,7 +14,8 @@ const generateContentUrl = (options) => {
|
|
|
14
14
|
throw new Error(`Invalid apiVersion: expected 'v3', received '${apiVersion}'`);
|
|
15
15
|
}
|
|
16
16
|
const noTraverse = limit !== 1;
|
|
17
|
-
const
|
|
17
|
+
const baseUrl = apiHost || "https://cdn.builder.io";
|
|
18
|
+
const url = new URL(`${baseUrl}/api/${apiVersion}/content/${model}`);
|
|
18
19
|
url.searchParams.set("apiKey", apiKey);
|
|
19
20
|
url.searchParams.set("limit", String(limit));
|
|
20
21
|
url.searchParams.set("noTraverse", String(noTraverse));
|
|
@@ -41,7 +41,7 @@ const createEvent = async ({ type: eventType, canTrack, apiKey, metadata, ...pro
|
|
|
41
41
|
ownerId: apiKey
|
|
42
42
|
}
|
|
43
43
|
});
|
|
44
|
-
async function _track(eventProps) {
|
|
44
|
+
async function _track({ apiHost, ...eventProps }) {
|
|
45
45
|
if (!eventProps.apiKey) {
|
|
46
46
|
logger.logger.error("Missing API key for track call. Please provide your API key.");
|
|
47
47
|
return;
|
|
@@ -55,7 +55,8 @@ async function _track(eventProps) {
|
|
|
55
55
|
if (!(isBrowser.isBrowser() || target.TARGET === "reactNative")) {
|
|
56
56
|
return;
|
|
57
57
|
}
|
|
58
|
-
|
|
58
|
+
const baseUrl = apiHost || "https://cdn.builder.io";
|
|
59
|
+
return fetch(`${baseUrl}/api/v1/track`, {
|
|
59
60
|
method: "POST",
|
|
60
61
|
body: JSON.stringify({
|
|
61
62
|
events: [
|
|
@@ -39,7 +39,7 @@ const createEvent = async ({ type: eventType, canTrack, apiKey, metadata, ...pro
|
|
|
39
39
|
ownerId: apiKey
|
|
40
40
|
}
|
|
41
41
|
});
|
|
42
|
-
async function _track(eventProps) {
|
|
42
|
+
async function _track({ apiHost, ...eventProps }) {
|
|
43
43
|
if (!eventProps.apiKey) {
|
|
44
44
|
logger.error("Missing API key for track call. Please provide your API key.");
|
|
45
45
|
return;
|
|
@@ -53,7 +53,8 @@ async function _track(eventProps) {
|
|
|
53
53
|
if (!(isBrowser() || TARGET === "reactNative")) {
|
|
54
54
|
return;
|
|
55
55
|
}
|
|
56
|
-
|
|
56
|
+
const baseUrl = apiHost || "https://cdn.builder.io";
|
|
57
|
+
return fetch(`${baseUrl}/api/v1/track`, {
|
|
57
58
|
method: "POST",
|
|
58
59
|
body: JSON.stringify({
|
|
59
60
|
events: [
|