@builder.io/sdk-qwik 0.17.6 → 0.17.8
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/custom-code/custom-code.qwik.cjs +1 -1
- package/lib/browser/blocks/custom-code/custom-code.qwik.mjs +1 -1
- package/lib/browser/components/block/components/block-styles.qwik.cjs +10 -2
- package/lib/browser/components/block/components/block-styles.qwik.mjs +10 -2
- package/lib/browser/components/blocks/blocks-wrapper.qwik.cjs +2 -1
- package/lib/browser/components/blocks/blocks-wrapper.qwik.mjs +2 -1
- package/lib/browser/components/content/components/enable-editor.qwik.cjs +2 -2
- package/lib/browser/components/content/components/enable-editor.qwik.mjs +3 -3
- package/lib/browser/constants/builder-registered-components.qwik.cjs +6 -0
- package/lib/browser/constants/builder-registered-components.qwik.mjs +6 -0
- package/lib/browser/constants/device-sizes.qwik.cjs +19 -3
- package/lib/browser/constants/device-sizes.qwik.mjs +19 -3
- package/lib/browser/constants/sdk-version.qwik.cjs +1 -1
- package/lib/browser/constants/sdk-version.qwik.mjs +1 -1
- package/lib/browser/helpers/canTrack.qwik.cjs +6 -1
- package/lib/browser/helpers/canTrack.qwik.mjs +6 -1
- package/lib/browser/helpers/user-attributes.qwik.cjs +50 -0
- package/lib/browser/helpers/user-attributes.qwik.mjs +50 -0
- package/lib/browser/index.qwik.cjs +2 -0
- package/lib/browser/index.qwik.mjs +2 -0
- package/lib/browser/scripts/init-editing.qwik.cjs +3 -1
- package/lib/browser/scripts/init-editing.qwik.mjs +3 -1
- package/lib/edge/blocks/custom-code/custom-code.qwik.cjs +1 -1
- package/lib/edge/blocks/custom-code/custom-code.qwik.mjs +1 -1
- package/lib/edge/components/block/components/block-styles.qwik.cjs +10 -2
- package/lib/edge/components/block/components/block-styles.qwik.mjs +10 -2
- package/lib/edge/components/blocks/blocks-wrapper.qwik.cjs +2 -1
- package/lib/edge/components/blocks/blocks-wrapper.qwik.mjs +2 -1
- package/lib/edge/components/content/components/enable-editor.qwik.cjs +2 -2
- package/lib/edge/components/content/components/enable-editor.qwik.mjs +3 -3
- package/lib/edge/constants/builder-registered-components.qwik.cjs +7 -0
- package/lib/edge/constants/builder-registered-components.qwik.mjs +7 -0
- package/lib/edge/constants/device-sizes.qwik.cjs +19 -3
- package/lib/edge/constants/device-sizes.qwik.mjs +19 -3
- package/lib/edge/constants/sdk-version.qwik.cjs +1 -1
- package/lib/edge/constants/sdk-version.qwik.mjs +1 -1
- package/lib/edge/helpers/canTrack.qwik.cjs +6 -1
- package/lib/edge/helpers/canTrack.qwik.mjs +6 -1
- package/lib/edge/helpers/user-attributes.qwik.cjs +50 -0
- package/lib/edge/helpers/user-attributes.qwik.mjs +50 -0
- package/lib/edge/index.qwik.cjs +2 -0
- package/lib/edge/index.qwik.mjs +2 -0
- package/lib/edge/scripts/init-editing.qwik.cjs +3 -1
- package/lib/edge/scripts/init-editing.qwik.mjs +3 -1
- package/lib/node/blocks/custom-code/custom-code.qwik.cjs +1 -1
- package/lib/node/blocks/custom-code/custom-code.qwik.mjs +1 -1
- package/lib/node/components/block/components/block-styles.qwik.cjs +10 -2
- package/lib/node/components/block/components/block-styles.qwik.mjs +10 -2
- package/lib/node/components/blocks/blocks-wrapper.qwik.cjs +2 -1
- package/lib/node/components/blocks/blocks-wrapper.qwik.mjs +2 -1
- package/lib/node/components/content/components/enable-editor.qwik.cjs +2 -2
- package/lib/node/components/content/components/enable-editor.qwik.mjs +3 -3
- package/lib/node/constants/builder-registered-components.qwik.cjs +7 -0
- package/lib/node/constants/builder-registered-components.qwik.mjs +7 -0
- package/lib/node/constants/device-sizes.qwik.cjs +19 -3
- package/lib/node/constants/device-sizes.qwik.mjs +19 -3
- package/lib/node/constants/sdk-version.qwik.cjs +1 -1
- package/lib/node/constants/sdk-version.qwik.mjs +1 -1
- package/lib/node/helpers/canTrack.qwik.cjs +6 -1
- package/lib/node/helpers/canTrack.qwik.mjs +6 -1
- package/lib/node/helpers/user-attributes.qwik.cjs +50 -0
- package/lib/node/helpers/user-attributes.qwik.mjs +50 -0
- package/lib/node/index.qwik.cjs +2 -0
- package/lib/node/index.qwik.mjs +2 -0
- package/lib/node/scripts/init-editing.qwik.cjs +3 -1
- package/lib/node/scripts/init-editing.qwik.mjs +3 -1
- package/package.json +1 -1
- package/types/src/blocks/personalization-container/component-info.d.ts +2 -0
- package/types/src/blocks/personalization-container/helpers/inlined-fns.d.ts +8 -0
- package/types/src/blocks/personalization-container/helpers.d.ts +27 -0
- package/types/src/blocks/personalization-container/index.d.ts +1 -0
- package/types/src/blocks/personalization-container/personalization-container.d.ts +3 -0
- package/types/src/blocks/personalization-container/personalization-container.types.d.ts +14 -0
- package/types/src/constants/device-sizes.d.ts +3 -2
- package/types/src/constants/sdk-version.d.ts +1 -1
- package/types/src/helpers/user-attributes.d.ts +17 -0
- package/types/src/index-helpers/blocks-exports.d.ts +1 -0
- package/types/src/types/builder-block.d.ts +0 -1
- package/types/src/types/builder-content.d.ts +1 -0
- package/types/src/types/input.d.ts +1 -0
|
@@ -7,7 +7,7 @@ const CustomCode = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inline
|
|
|
7
7
|
scriptsInserted: [],
|
|
8
8
|
scriptsRun: []
|
|
9
9
|
});
|
|
10
|
-
qwik.useOn("
|
|
10
|
+
qwik.useOn("readystatechange", /* @__PURE__ */ qwik.inlinedQrl((event, element) => {
|
|
11
11
|
const [state2] = qwik.useLexicalScope();
|
|
12
12
|
if (!(element == null ? void 0 : element.getElementsByTagName) || typeof window === "undefined")
|
|
13
13
|
return;
|
|
@@ -5,7 +5,7 @@ const CustomCode = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((prop
|
|
|
5
5
|
scriptsInserted: [],
|
|
6
6
|
scriptsRun: []
|
|
7
7
|
});
|
|
8
|
-
useOn("
|
|
8
|
+
useOn("readystatechange", /* @__PURE__ */ inlinedQrl((event, element) => {
|
|
9
9
|
const [state2] = useLexicalScope();
|
|
10
10
|
if (!(element == null ? void 0 : element.getElementsByTagName) || typeof window === "undefined")
|
|
11
11
|
return;
|
|
@@ -21,15 +21,17 @@ const BlockStyles = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlin
|
|
|
21
21
|
props
|
|
22
22
|
]));
|
|
23
23
|
const css$1 = qwik.useComputedQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
|
|
24
|
-
var _a, _b, _c;
|
|
24
|
+
var _a, _b, _c, _d, _e;
|
|
25
25
|
const [props2] = qwik.useLexicalScope();
|
|
26
26
|
const processedBlock = props2.block;
|
|
27
27
|
const styles = processedBlock.responsiveStyles;
|
|
28
28
|
const content = props2.context.content;
|
|
29
29
|
const sizesWithUpdatedBreakpoints = deviceSizes.getSizesForBreakpoints(((_a = content == null ? void 0 : content.meta) == null ? void 0 : _a.breakpoints) || {});
|
|
30
|
+
const contentHasXSmallBreakpoint = Boolean((_c = (_b = content == null ? void 0 : content.meta) == null ? void 0 : _b.breakpoints) == null ? void 0 : _c.xsmall);
|
|
30
31
|
const largeStyles = styles == null ? void 0 : styles.large;
|
|
31
32
|
const mediumStyles = styles == null ? void 0 : styles.medium;
|
|
32
33
|
const smallStyles = styles == null ? void 0 : styles.small;
|
|
34
|
+
const xsmallStyles = styles == null ? void 0 : styles.xsmall;
|
|
33
35
|
const className = processedBlock.id;
|
|
34
36
|
if (!className)
|
|
35
37
|
return "";
|
|
@@ -47,10 +49,15 @@ const BlockStyles = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlin
|
|
|
47
49
|
styles: smallStyles,
|
|
48
50
|
mediaQuery: deviceSizes.getMaxWidthQueryForSize("small", sizesWithUpdatedBreakpoints)
|
|
49
51
|
}) : "";
|
|
52
|
+
const xsmallStylesClass = xsmallStyles && contentHasXSmallBreakpoint ? css.createCssClass({
|
|
53
|
+
className,
|
|
54
|
+
styles: xsmallStyles,
|
|
55
|
+
mediaQuery: deviceSizes.getMaxWidthQueryForSize("xsmall", sizesWithUpdatedBreakpoints)
|
|
56
|
+
}) : "";
|
|
50
57
|
const hoverAnimation = processedBlock.animations && processedBlock.animations.find((item) => item.trigger === "hover");
|
|
51
58
|
let hoverStylesClass = "";
|
|
52
59
|
if (hoverAnimation) {
|
|
53
|
-
const hoverStyles = ((
|
|
60
|
+
const hoverStyles = ((_e = (_d = hoverAnimation.steps) == null ? void 0 : _d[1]) == null ? void 0 : _e.styles) || {};
|
|
54
61
|
hoverStylesClass = css.createCssClass({
|
|
55
62
|
className: `${className}:hover`,
|
|
56
63
|
styles: {
|
|
@@ -64,6 +71,7 @@ const BlockStyles = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlin
|
|
|
64
71
|
largeStylesClass,
|
|
65
72
|
mediumStylesClass,
|
|
66
73
|
smallStylesClass,
|
|
74
|
+
xsmallStylesClass,
|
|
67
75
|
hoverStylesClass
|
|
68
76
|
].join(" ");
|
|
69
77
|
}, "BlockStyles_component_css_useComputed_b9Ru8qTcNik", [
|
|
@@ -19,15 +19,17 @@ const BlockStyles = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((pro
|
|
|
19
19
|
props
|
|
20
20
|
]));
|
|
21
21
|
const css = useComputedQrl(/* @__PURE__ */ inlinedQrl(() => {
|
|
22
|
-
var _a, _b, _c;
|
|
22
|
+
var _a, _b, _c, _d, _e;
|
|
23
23
|
const [props2] = useLexicalScope();
|
|
24
24
|
const processedBlock = props2.block;
|
|
25
25
|
const styles = processedBlock.responsiveStyles;
|
|
26
26
|
const content = props2.context.content;
|
|
27
27
|
const sizesWithUpdatedBreakpoints = getSizesForBreakpoints(((_a = content == null ? void 0 : content.meta) == null ? void 0 : _a.breakpoints) || {});
|
|
28
|
+
const contentHasXSmallBreakpoint = Boolean((_c = (_b = content == null ? void 0 : content.meta) == null ? void 0 : _b.breakpoints) == null ? void 0 : _c.xsmall);
|
|
28
29
|
const largeStyles = styles == null ? void 0 : styles.large;
|
|
29
30
|
const mediumStyles = styles == null ? void 0 : styles.medium;
|
|
30
31
|
const smallStyles = styles == null ? void 0 : styles.small;
|
|
32
|
+
const xsmallStyles = styles == null ? void 0 : styles.xsmall;
|
|
31
33
|
const className = processedBlock.id;
|
|
32
34
|
if (!className)
|
|
33
35
|
return "";
|
|
@@ -45,10 +47,15 @@ const BlockStyles = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((pro
|
|
|
45
47
|
styles: smallStyles,
|
|
46
48
|
mediaQuery: getMaxWidthQueryForSize("small", sizesWithUpdatedBreakpoints)
|
|
47
49
|
}) : "";
|
|
50
|
+
const xsmallStylesClass = xsmallStyles && contentHasXSmallBreakpoint ? createCssClass({
|
|
51
|
+
className,
|
|
52
|
+
styles: xsmallStyles,
|
|
53
|
+
mediaQuery: getMaxWidthQueryForSize("xsmall", sizesWithUpdatedBreakpoints)
|
|
54
|
+
}) : "";
|
|
48
55
|
const hoverAnimation = processedBlock.animations && processedBlock.animations.find((item) => item.trigger === "hover");
|
|
49
56
|
let hoverStylesClass = "";
|
|
50
57
|
if (hoverAnimation) {
|
|
51
|
-
const hoverStyles = ((
|
|
58
|
+
const hoverStyles = ((_e = (_d = hoverAnimation.steps) == null ? void 0 : _d[1]) == null ? void 0 : _e.styles) || {};
|
|
52
59
|
hoverStylesClass = createCssClass({
|
|
53
60
|
className: `${className}:hover`,
|
|
54
61
|
styles: {
|
|
@@ -62,6 +69,7 @@ const BlockStyles = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((pro
|
|
|
62
69
|
largeStylesClass,
|
|
63
70
|
mediumStylesClass,
|
|
64
71
|
smallStylesClass,
|
|
72
|
+
xsmallStylesClass,
|
|
65
73
|
hoverStylesClass
|
|
66
74
|
].join(" ");
|
|
67
75
|
}, "BlockStyles_component_css_useComputed_b9Ru8qTcNik", [
|
|
@@ -41,8 +41,9 @@ const BlocksWrapper = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inl
|
|
|
41
41
|
const [props2] = qwik.useLexicalScope();
|
|
42
42
|
if (!props2.path)
|
|
43
43
|
return void 0;
|
|
44
|
+
const thisPrefix = "this.";
|
|
44
45
|
const pathPrefix = "component.options.";
|
|
45
|
-
return props2.path.startsWith(pathPrefix) ? props2.path : `${pathPrefix}${props2.path || ""}`;
|
|
46
|
+
return props2.path.startsWith(thisPrefix) ? props2.path.replace(thisPrefix, "") : props2.path.startsWith(pathPrefix) ? props2.path : `${pathPrefix}${props2.path || ""}`;
|
|
46
47
|
}, "BlocksWrapper_component_dataPath_useComputed_csBNeJbWH7k", [
|
|
47
48
|
props
|
|
48
49
|
]));
|
|
@@ -39,8 +39,9 @@ const BlocksWrapper = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((p
|
|
|
39
39
|
const [props2] = useLexicalScope();
|
|
40
40
|
if (!props2.path)
|
|
41
41
|
return void 0;
|
|
42
|
+
const thisPrefix = "this.";
|
|
42
43
|
const pathPrefix = "component.options.";
|
|
43
|
-
return props2.path.startsWith(pathPrefix) ? props2.path : `${pathPrefix}${props2.path || ""}`;
|
|
44
|
+
return props2.path.startsWith(thisPrefix) ? props2.path.replace(thisPrefix, "") : props2.path.startsWith(pathPrefix) ? props2.path : `${pathPrefix}${props2.path || ""}`;
|
|
44
45
|
}, "BlocksWrapper_component_dataPath_useComputed_csBNeJbWH7k", [
|
|
45
46
|
props
|
|
46
47
|
]));
|
|
@@ -211,7 +211,7 @@ const EnableEditor = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inli
|
|
|
211
211
|
showContentProps,
|
|
212
212
|
state
|
|
213
213
|
]));
|
|
214
|
-
qwik.
|
|
214
|
+
qwik.useOnDocument("readystatechange", /* @__PURE__ */ qwik.inlinedQrl((event, element) => {
|
|
215
215
|
var _a2, _b2, _c, _d;
|
|
216
216
|
const [props2] = qwik.useLexicalScope();
|
|
217
217
|
if (isBrowser.isBrowser()) {
|
|
@@ -238,7 +238,7 @@ const EnableEditor = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inli
|
|
|
238
238
|
element.dispatchEvent(new CustomEvent("initpreviewingbldr"));
|
|
239
239
|
}
|
|
240
240
|
}
|
|
241
|
-
}, "
|
|
241
|
+
}, "EnableEditor_component_useOnDocument_H7syEGJXM4Y", [
|
|
242
242
|
props
|
|
243
243
|
]));
|
|
244
244
|
qwik.useContextProvider(builder_context, props.builderContextSignal);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { componentQrl, inlinedQrl, _jsxBranch, useComputedQrl, useLexicalScope, useSignal, useStore, useOn, useContextProvider, useTaskQrl, _jsxC, Slot, _IMMUTABLE, _fnSignal } from "@builder.io/qwik";
|
|
1
|
+
import { componentQrl, inlinedQrl, _jsxBranch, useComputedQrl, useLexicalScope, useSignal, useStore, useOn, useOnDocument, useContextProvider, useTaskQrl, _jsxC, Slot, _IMMUTABLE, _fnSignal } from "@builder.io/qwik";
|
|
2
2
|
import { Fragment } from "@builder.io/qwik/jsx-runtime";
|
|
3
3
|
import builderContext from "../../../context/builder.context.qwik.mjs";
|
|
4
4
|
import { evaluate } from "../../../functions/evaluate/evaluate.qwik.mjs";
|
|
@@ -209,7 +209,7 @@ const EnableEditor = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((pr
|
|
|
209
209
|
showContentProps,
|
|
210
210
|
state
|
|
211
211
|
]));
|
|
212
|
-
|
|
212
|
+
useOnDocument("readystatechange", /* @__PURE__ */ inlinedQrl((event, element) => {
|
|
213
213
|
var _a2, _b2, _c, _d;
|
|
214
214
|
const [props2] = useLexicalScope();
|
|
215
215
|
if (isBrowser()) {
|
|
@@ -236,7 +236,7 @@ const EnableEditor = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((pr
|
|
|
236
236
|
element.dispatchEvent(new CustomEvent("initpreviewingbldr"));
|
|
237
237
|
}
|
|
238
238
|
}
|
|
239
|
-
}, "
|
|
239
|
+
}, "EnableEditor_component_useOnDocument_H7syEGJXM4Y", [
|
|
240
240
|
props
|
|
241
241
|
]));
|
|
242
242
|
useContextProvider(builderContext, props.builderContextSignal);
|
|
@@ -10,6 +10,11 @@ const componentInfo$2 = require("../blocks/fragment/component-info.qwik.cjs");
|
|
|
10
10
|
const fragment = require("../blocks/fragment/fragment.qwik.cjs");
|
|
11
11
|
const componentInfo$3 = require("../blocks/image/component-info.qwik.cjs");
|
|
12
12
|
const image = require("../blocks/image/image.qwik.cjs");
|
|
13
|
+
require("@builder.io/qwik");
|
|
14
|
+
require("@builder.io/qwik/jsx-runtime");
|
|
15
|
+
require("../context/builder.context.qwik.cjs");
|
|
16
|
+
require("../context/components.context.qwik.cjs");
|
|
17
|
+
require("@builder.io/qwik/build");
|
|
13
18
|
const componentInfo$4 = require("../blocks/section/component-info.qwik.cjs");
|
|
14
19
|
const section = require("../blocks/section/section.qwik.cjs");
|
|
15
20
|
const componentInfo$5 = require("../blocks/slot/component-info.qwik.cjs");
|
|
@@ -54,6 +59,7 @@ const getDefaultRegisteredComponents = () => [
|
|
|
54
59
|
component: text.Text,
|
|
55
60
|
...componentInfo$7.componentInfo
|
|
56
61
|
},
|
|
62
|
+
...[],
|
|
57
63
|
...[
|
|
58
64
|
{
|
|
59
65
|
component: tabs.Tabs,
|
|
@@ -8,6 +8,11 @@ import { componentInfo as componentInfo$2 } from "../blocks/fragment/component-i
|
|
|
8
8
|
import { FragmentComponent } from "../blocks/fragment/fragment.qwik.mjs";
|
|
9
9
|
import { componentInfo as componentInfo$3 } from "../blocks/image/component-info.qwik.mjs";
|
|
10
10
|
import { Image } from "../blocks/image/image.qwik.mjs";
|
|
11
|
+
import "@builder.io/qwik";
|
|
12
|
+
import "@builder.io/qwik/jsx-runtime";
|
|
13
|
+
import "../context/builder.context.qwik.mjs";
|
|
14
|
+
import "../context/components.context.qwik.mjs";
|
|
15
|
+
import "@builder.io/qwik/build";
|
|
11
16
|
import { componentInfo as componentInfo$4 } from "../blocks/section/component-info.qwik.mjs";
|
|
12
17
|
import { SectionComponent } from "../blocks/section/section.qwik.mjs";
|
|
13
18
|
import { componentInfo as componentInfo$5 } from "../blocks/slot/component-info.qwik.mjs";
|
|
@@ -52,6 +57,7 @@ const getDefaultRegisteredComponents = () => [
|
|
|
52
57
|
component: Text,
|
|
53
58
|
...componentInfo$7
|
|
54
59
|
},
|
|
60
|
+
...[],
|
|
55
61
|
...[
|
|
56
62
|
{
|
|
57
63
|
component: Tabs,
|
|
@@ -2,8 +2,13 @@
|
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const fastClone = require("../functions/fast-clone.qwik.cjs");
|
|
4
4
|
const SIZES = {
|
|
5
|
+
xsmall: {
|
|
6
|
+
min: 0,
|
|
7
|
+
default: 160,
|
|
8
|
+
max: 320
|
|
9
|
+
},
|
|
5
10
|
small: {
|
|
6
|
-
min:
|
|
11
|
+
min: 321,
|
|
7
12
|
default: 321,
|
|
8
13
|
max: 640
|
|
9
14
|
},
|
|
@@ -19,11 +24,22 @@ const SIZES = {
|
|
|
19
24
|
}
|
|
20
25
|
};
|
|
21
26
|
const getMaxWidthQueryForSize = (size, sizeValues = SIZES) => `@media (max-width: ${sizeValues[size].max}px)`;
|
|
22
|
-
const getSizesForBreakpoints = (
|
|
27
|
+
const getSizesForBreakpoints = (breakpoints) => {
|
|
23
28
|
const newSizes = fastClone.fastClone(SIZES);
|
|
29
|
+
if (!breakpoints)
|
|
30
|
+
return newSizes;
|
|
31
|
+
const { xsmall, small, medium } = breakpoints;
|
|
32
|
+
if (xsmall) {
|
|
33
|
+
const xsmallMin = Math.floor(xsmall / 2);
|
|
34
|
+
newSizes.xsmall = {
|
|
35
|
+
max: xsmall,
|
|
36
|
+
min: xsmallMin,
|
|
37
|
+
default: xsmallMin + 1
|
|
38
|
+
};
|
|
39
|
+
}
|
|
24
40
|
if (!small || !medium)
|
|
25
41
|
return newSizes;
|
|
26
|
-
const smallMin = Math.floor(small / 2);
|
|
42
|
+
const smallMin = xsmall ? newSizes.xsmall.max + 1 : Math.floor(small / 2);
|
|
27
43
|
newSizes.small = {
|
|
28
44
|
max: small,
|
|
29
45
|
min: smallMin,
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import { fastClone } from "../functions/fast-clone.qwik.mjs";
|
|
2
2
|
const SIZES = {
|
|
3
|
+
xsmall: {
|
|
4
|
+
min: 0,
|
|
5
|
+
default: 160,
|
|
6
|
+
max: 320
|
|
7
|
+
},
|
|
3
8
|
small: {
|
|
4
|
-
min:
|
|
9
|
+
min: 321,
|
|
5
10
|
default: 321,
|
|
6
11
|
max: 640
|
|
7
12
|
},
|
|
@@ -17,11 +22,22 @@ const SIZES = {
|
|
|
17
22
|
}
|
|
18
23
|
};
|
|
19
24
|
const getMaxWidthQueryForSize = (size, sizeValues = SIZES) => `@media (max-width: ${sizeValues[size].max}px)`;
|
|
20
|
-
const getSizesForBreakpoints = (
|
|
25
|
+
const getSizesForBreakpoints = (breakpoints) => {
|
|
21
26
|
const newSizes = fastClone(SIZES);
|
|
27
|
+
if (!breakpoints)
|
|
28
|
+
return newSizes;
|
|
29
|
+
const { xsmall, small, medium } = breakpoints;
|
|
30
|
+
if (xsmall) {
|
|
31
|
+
const xsmallMin = Math.floor(xsmall / 2);
|
|
32
|
+
newSizes.xsmall = {
|
|
33
|
+
max: xsmall,
|
|
34
|
+
min: xsmallMin,
|
|
35
|
+
default: xsmallMin + 1
|
|
36
|
+
};
|
|
37
|
+
}
|
|
22
38
|
if (!small || !medium)
|
|
23
39
|
return newSizes;
|
|
24
|
-
const smallMin = Math.floor(small / 2);
|
|
40
|
+
const smallMin = xsmall ? newSizes.xsmall.max + 1 : Math.floor(small / 2);
|
|
25
41
|
newSizes.small = {
|
|
26
42
|
max: small,
|
|
27
43
|
min: smallMin,
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const nullable = require("./nullable.qwik.cjs");
|
|
4
|
-
const
|
|
4
|
+
const userAttributes = require("./user-attributes.qwik.cjs");
|
|
5
|
+
const getDefaultCanTrack = (canTrack) => {
|
|
6
|
+
const result = nullable.checkIsDefined(canTrack) ? canTrack : true;
|
|
7
|
+
userAttributes.userAttributesService.setCanTrack(result);
|
|
8
|
+
return result;
|
|
9
|
+
};
|
|
5
10
|
exports.getDefaultCanTrack = getDefaultCanTrack;
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { checkIsDefined } from "./nullable.qwik.mjs";
|
|
2
|
-
|
|
2
|
+
import { userAttributesService } from "./user-attributes.qwik.mjs";
|
|
3
|
+
const getDefaultCanTrack = (canTrack) => {
|
|
4
|
+
const result = checkIsDefined(canTrack) ? canTrack : true;
|
|
5
|
+
userAttributesService.setCanTrack(result);
|
|
6
|
+
return result;
|
|
7
|
+
};
|
|
3
8
|
export {
|
|
4
9
|
getDefaultCanTrack
|
|
5
10
|
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const isBrowser = require("../functions/is-browser.qwik.cjs");
|
|
4
|
+
const cookie = require("./cookie.qwik.cjs");
|
|
5
|
+
const USER_ATTRIBUTES_COOKIE_NAME = "builder.userAttributes";
|
|
6
|
+
function createUserAttributesService() {
|
|
7
|
+
let canTrack = true;
|
|
8
|
+
const subscribers = /* @__PURE__ */ new Set();
|
|
9
|
+
return {
|
|
10
|
+
setUserAttributes(newAttrs) {
|
|
11
|
+
if (!isBrowser.isBrowser())
|
|
12
|
+
return;
|
|
13
|
+
const userAttributes = {
|
|
14
|
+
...this.getUserAttributes(),
|
|
15
|
+
...newAttrs
|
|
16
|
+
};
|
|
17
|
+
cookie.setCookie({
|
|
18
|
+
name: USER_ATTRIBUTES_COOKIE_NAME,
|
|
19
|
+
value: JSON.stringify(userAttributes),
|
|
20
|
+
canTrack
|
|
21
|
+
});
|
|
22
|
+
subscribers.forEach((callback) => callback(userAttributes));
|
|
23
|
+
},
|
|
24
|
+
getUserAttributes() {
|
|
25
|
+
if (!isBrowser.isBrowser())
|
|
26
|
+
return {};
|
|
27
|
+
return JSON.parse(cookie.getCookieSync({
|
|
28
|
+
name: USER_ATTRIBUTES_COOKIE_NAME,
|
|
29
|
+
canTrack
|
|
30
|
+
}) || "{}");
|
|
31
|
+
},
|
|
32
|
+
subscribeOnUserAttributesChange(callback) {
|
|
33
|
+
subscribers.add(callback);
|
|
34
|
+
return () => {
|
|
35
|
+
subscribers.delete(callback);
|
|
36
|
+
};
|
|
37
|
+
},
|
|
38
|
+
setCanTrack(value) {
|
|
39
|
+
canTrack = value;
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
const userAttributesService = createUserAttributesService();
|
|
44
|
+
const setClientUserAttributes = (attributes) => {
|
|
45
|
+
userAttributesService.setUserAttributes(attributes);
|
|
46
|
+
};
|
|
47
|
+
exports.USER_ATTRIBUTES_COOKIE_NAME = USER_ATTRIBUTES_COOKIE_NAME;
|
|
48
|
+
exports.createUserAttributesService = createUserAttributesService;
|
|
49
|
+
exports.setClientUserAttributes = setClientUserAttributes;
|
|
50
|
+
exports.userAttributesService = userAttributesService;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { isBrowser } from "../functions/is-browser.qwik.mjs";
|
|
2
|
+
import { setCookie, getCookieSync } from "./cookie.qwik.mjs";
|
|
3
|
+
const USER_ATTRIBUTES_COOKIE_NAME = "builder.userAttributes";
|
|
4
|
+
function createUserAttributesService() {
|
|
5
|
+
let canTrack = true;
|
|
6
|
+
const subscribers = /* @__PURE__ */ new Set();
|
|
7
|
+
return {
|
|
8
|
+
setUserAttributes(newAttrs) {
|
|
9
|
+
if (!isBrowser())
|
|
10
|
+
return;
|
|
11
|
+
const userAttributes = {
|
|
12
|
+
...this.getUserAttributes(),
|
|
13
|
+
...newAttrs
|
|
14
|
+
};
|
|
15
|
+
setCookie({
|
|
16
|
+
name: USER_ATTRIBUTES_COOKIE_NAME,
|
|
17
|
+
value: JSON.stringify(userAttributes),
|
|
18
|
+
canTrack
|
|
19
|
+
});
|
|
20
|
+
subscribers.forEach((callback) => callback(userAttributes));
|
|
21
|
+
},
|
|
22
|
+
getUserAttributes() {
|
|
23
|
+
if (!isBrowser())
|
|
24
|
+
return {};
|
|
25
|
+
return JSON.parse(getCookieSync({
|
|
26
|
+
name: USER_ATTRIBUTES_COOKIE_NAME,
|
|
27
|
+
canTrack
|
|
28
|
+
}) || "{}");
|
|
29
|
+
},
|
|
30
|
+
subscribeOnUserAttributesChange(callback) {
|
|
31
|
+
subscribers.add(callback);
|
|
32
|
+
return () => {
|
|
33
|
+
subscribers.delete(callback);
|
|
34
|
+
};
|
|
35
|
+
},
|
|
36
|
+
setCanTrack(value) {
|
|
37
|
+
canTrack = value;
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
const userAttributesService = createUserAttributesService();
|
|
42
|
+
const setClientUserAttributes = (attributes) => {
|
|
43
|
+
userAttributesService.setUserAttributes(attributes);
|
|
44
|
+
};
|
|
45
|
+
export {
|
|
46
|
+
USER_ATTRIBUTES_COOKIE_NAME,
|
|
47
|
+
createUserAttributesService,
|
|
48
|
+
setClientUserAttributes,
|
|
49
|
+
userAttributesService
|
|
50
|
+
};
|
|
@@ -11,6 +11,7 @@ const video = require("./blocks/video/video.qwik.cjs");
|
|
|
11
11
|
const blocks = require("./components/blocks/blocks.qwik.cjs");
|
|
12
12
|
const contentVariants = require("./components/content-variants/content-variants.qwik.cjs");
|
|
13
13
|
const builder_context = require("./context/builder.context.qwik.cjs");
|
|
14
|
+
const userAttributes = require("./helpers/user-attributes.qwik.cjs");
|
|
14
15
|
const isEditing = require("./functions/is-editing.qwik.cjs");
|
|
15
16
|
const isPreviewing = require("./functions/is-previewing.qwik.cjs");
|
|
16
17
|
const registerComponent = require("./functions/register-component.qwik.cjs");
|
|
@@ -32,6 +33,7 @@ exports.Video = video.Video;
|
|
|
32
33
|
exports.Blocks = blocks.Blocks;
|
|
33
34
|
exports.Content = contentVariants.ContentVariants;
|
|
34
35
|
exports.BuilderContext = builder_context;
|
|
36
|
+
exports.setClientUserAttributes = userAttributes.setClientUserAttributes;
|
|
35
37
|
exports.isEditing = isEditing.isEditing;
|
|
36
38
|
exports.isPreviewing = isPreviewing.isPreviewing;
|
|
37
39
|
exports.createRegisterComponentMessage = registerComponent.createRegisterComponentMessage;
|
|
@@ -9,6 +9,7 @@ import { Video } from "./blocks/video/video.qwik.mjs";
|
|
|
9
9
|
import { Blocks } from "./components/blocks/blocks.qwik.mjs";
|
|
10
10
|
import { ContentVariants } from "./components/content-variants/content-variants.qwik.mjs";
|
|
11
11
|
import { default as default2 } from "./context/builder.context.qwik.mjs";
|
|
12
|
+
import { setClientUserAttributes } from "./helpers/user-attributes.qwik.mjs";
|
|
12
13
|
import { isEditing } from "./functions/is-editing.qwik.mjs";
|
|
13
14
|
import { isPreviewing } from "./functions/is-previewing.qwik.mjs";
|
|
14
15
|
import { createRegisterComponentMessage } from "./functions/register-component.qwik.mjs";
|
|
@@ -40,6 +41,7 @@ export {
|
|
|
40
41
|
isEditing,
|
|
41
42
|
isPreviewing,
|
|
42
43
|
register,
|
|
44
|
+
setClientUserAttributes,
|
|
43
45
|
setEditorSettings,
|
|
44
46
|
subscribeToEditor,
|
|
45
47
|
track
|
|
@@ -55,7 +55,9 @@ const setupBrowserForEditing = (options = {}) => {
|
|
|
55
55
|
// Supports builder-model="..." attribute which is needed to
|
|
56
56
|
// scope our '+ add block' button styling
|
|
57
57
|
supportsAddBlockScoping: true,
|
|
58
|
-
supportsCustomBreakpoints: true
|
|
58
|
+
supportsCustomBreakpoints: true,
|
|
59
|
+
supportsXSmallBreakpoint: true,
|
|
60
|
+
blockLevelPersonalization: true
|
|
59
61
|
}
|
|
60
62
|
}, "*");
|
|
61
63
|
(_b = window.parent) == null ? void 0 : _b.postMessage({
|
|
@@ -53,7 +53,9 @@ const setupBrowserForEditing = (options = {}) => {
|
|
|
53
53
|
// Supports builder-model="..." attribute which is needed to
|
|
54
54
|
// scope our '+ add block' button styling
|
|
55
55
|
supportsAddBlockScoping: true,
|
|
56
|
-
supportsCustomBreakpoints: true
|
|
56
|
+
supportsCustomBreakpoints: true,
|
|
57
|
+
supportsXSmallBreakpoint: true,
|
|
58
|
+
blockLevelPersonalization: true
|
|
57
59
|
}
|
|
58
60
|
}, "*");
|
|
59
61
|
(_b = window.parent) == null ? void 0 : _b.postMessage({
|
|
@@ -7,7 +7,7 @@ const CustomCode = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inline
|
|
|
7
7
|
scriptsInserted: [],
|
|
8
8
|
scriptsRun: []
|
|
9
9
|
});
|
|
10
|
-
qwik.useOn("
|
|
10
|
+
qwik.useOn("readystatechange", /* @__PURE__ */ qwik.inlinedQrl((event, element) => {
|
|
11
11
|
const [state2] = qwik.useLexicalScope();
|
|
12
12
|
if (!(element == null ? void 0 : element.getElementsByTagName) || typeof window === "undefined")
|
|
13
13
|
return;
|
|
@@ -5,7 +5,7 @@ const CustomCode = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((prop
|
|
|
5
5
|
scriptsInserted: [],
|
|
6
6
|
scriptsRun: []
|
|
7
7
|
});
|
|
8
|
-
useOn("
|
|
8
|
+
useOn("readystatechange", /* @__PURE__ */ inlinedQrl((event, element) => {
|
|
9
9
|
const [state2] = useLexicalScope();
|
|
10
10
|
if (!(element == null ? void 0 : element.getElementsByTagName) || typeof window === "undefined")
|
|
11
11
|
return;
|
|
@@ -21,15 +21,17 @@ const BlockStyles = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlin
|
|
|
21
21
|
props
|
|
22
22
|
]));
|
|
23
23
|
const css$1 = qwik.useComputedQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
|
|
24
|
-
var _a, _b, _c;
|
|
24
|
+
var _a, _b, _c, _d, _e;
|
|
25
25
|
const [props2] = qwik.useLexicalScope();
|
|
26
26
|
const processedBlock = props2.block;
|
|
27
27
|
const styles = processedBlock.responsiveStyles;
|
|
28
28
|
const content = props2.context.content;
|
|
29
29
|
const sizesWithUpdatedBreakpoints = deviceSizes.getSizesForBreakpoints(((_a = content == null ? void 0 : content.meta) == null ? void 0 : _a.breakpoints) || {});
|
|
30
|
+
const contentHasXSmallBreakpoint = Boolean((_c = (_b = content == null ? void 0 : content.meta) == null ? void 0 : _b.breakpoints) == null ? void 0 : _c.xsmall);
|
|
30
31
|
const largeStyles = styles == null ? void 0 : styles.large;
|
|
31
32
|
const mediumStyles = styles == null ? void 0 : styles.medium;
|
|
32
33
|
const smallStyles = styles == null ? void 0 : styles.small;
|
|
34
|
+
const xsmallStyles = styles == null ? void 0 : styles.xsmall;
|
|
33
35
|
const className = processedBlock.id;
|
|
34
36
|
if (!className)
|
|
35
37
|
return "";
|
|
@@ -47,10 +49,15 @@ const BlockStyles = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlin
|
|
|
47
49
|
styles: smallStyles,
|
|
48
50
|
mediaQuery: deviceSizes.getMaxWidthQueryForSize("small", sizesWithUpdatedBreakpoints)
|
|
49
51
|
}) : "";
|
|
52
|
+
const xsmallStylesClass = xsmallStyles && contentHasXSmallBreakpoint ? css.createCssClass({
|
|
53
|
+
className,
|
|
54
|
+
styles: xsmallStyles,
|
|
55
|
+
mediaQuery: deviceSizes.getMaxWidthQueryForSize("xsmall", sizesWithUpdatedBreakpoints)
|
|
56
|
+
}) : "";
|
|
50
57
|
const hoverAnimation = processedBlock.animations && processedBlock.animations.find((item) => item.trigger === "hover");
|
|
51
58
|
let hoverStylesClass = "";
|
|
52
59
|
if (hoverAnimation) {
|
|
53
|
-
const hoverStyles = ((
|
|
60
|
+
const hoverStyles = ((_e = (_d = hoverAnimation.steps) == null ? void 0 : _d[1]) == null ? void 0 : _e.styles) || {};
|
|
54
61
|
hoverStylesClass = css.createCssClass({
|
|
55
62
|
className: `${className}:hover`,
|
|
56
63
|
styles: {
|
|
@@ -64,6 +71,7 @@ const BlockStyles = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlin
|
|
|
64
71
|
largeStylesClass,
|
|
65
72
|
mediumStylesClass,
|
|
66
73
|
smallStylesClass,
|
|
74
|
+
xsmallStylesClass,
|
|
67
75
|
hoverStylesClass
|
|
68
76
|
].join(" ");
|
|
69
77
|
}, "BlockStyles_component_css_useComputed_b9Ru8qTcNik", [
|
|
@@ -19,15 +19,17 @@ const BlockStyles = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((pro
|
|
|
19
19
|
props
|
|
20
20
|
]));
|
|
21
21
|
const css = useComputedQrl(/* @__PURE__ */ inlinedQrl(() => {
|
|
22
|
-
var _a, _b, _c;
|
|
22
|
+
var _a, _b, _c, _d, _e;
|
|
23
23
|
const [props2] = useLexicalScope();
|
|
24
24
|
const processedBlock = props2.block;
|
|
25
25
|
const styles = processedBlock.responsiveStyles;
|
|
26
26
|
const content = props2.context.content;
|
|
27
27
|
const sizesWithUpdatedBreakpoints = getSizesForBreakpoints(((_a = content == null ? void 0 : content.meta) == null ? void 0 : _a.breakpoints) || {});
|
|
28
|
+
const contentHasXSmallBreakpoint = Boolean((_c = (_b = content == null ? void 0 : content.meta) == null ? void 0 : _b.breakpoints) == null ? void 0 : _c.xsmall);
|
|
28
29
|
const largeStyles = styles == null ? void 0 : styles.large;
|
|
29
30
|
const mediumStyles = styles == null ? void 0 : styles.medium;
|
|
30
31
|
const smallStyles = styles == null ? void 0 : styles.small;
|
|
32
|
+
const xsmallStyles = styles == null ? void 0 : styles.xsmall;
|
|
31
33
|
const className = processedBlock.id;
|
|
32
34
|
if (!className)
|
|
33
35
|
return "";
|
|
@@ -45,10 +47,15 @@ const BlockStyles = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((pro
|
|
|
45
47
|
styles: smallStyles,
|
|
46
48
|
mediaQuery: getMaxWidthQueryForSize("small", sizesWithUpdatedBreakpoints)
|
|
47
49
|
}) : "";
|
|
50
|
+
const xsmallStylesClass = xsmallStyles && contentHasXSmallBreakpoint ? createCssClass({
|
|
51
|
+
className,
|
|
52
|
+
styles: xsmallStyles,
|
|
53
|
+
mediaQuery: getMaxWidthQueryForSize("xsmall", sizesWithUpdatedBreakpoints)
|
|
54
|
+
}) : "";
|
|
48
55
|
const hoverAnimation = processedBlock.animations && processedBlock.animations.find((item) => item.trigger === "hover");
|
|
49
56
|
let hoverStylesClass = "";
|
|
50
57
|
if (hoverAnimation) {
|
|
51
|
-
const hoverStyles = ((
|
|
58
|
+
const hoverStyles = ((_e = (_d = hoverAnimation.steps) == null ? void 0 : _d[1]) == null ? void 0 : _e.styles) || {};
|
|
52
59
|
hoverStylesClass = createCssClass({
|
|
53
60
|
className: `${className}:hover`,
|
|
54
61
|
styles: {
|
|
@@ -62,6 +69,7 @@ const BlockStyles = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((pro
|
|
|
62
69
|
largeStylesClass,
|
|
63
70
|
mediumStylesClass,
|
|
64
71
|
smallStylesClass,
|
|
72
|
+
xsmallStylesClass,
|
|
65
73
|
hoverStylesClass
|
|
66
74
|
].join(" ");
|
|
67
75
|
}, "BlockStyles_component_css_useComputed_b9Ru8qTcNik", [
|
|
@@ -41,8 +41,9 @@ const BlocksWrapper = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inl
|
|
|
41
41
|
const [props2] = qwik.useLexicalScope();
|
|
42
42
|
if (!props2.path)
|
|
43
43
|
return void 0;
|
|
44
|
+
const thisPrefix = "this.";
|
|
44
45
|
const pathPrefix = "component.options.";
|
|
45
|
-
return props2.path.startsWith(pathPrefix) ? props2.path : `${pathPrefix}${props2.path || ""}`;
|
|
46
|
+
return props2.path.startsWith(thisPrefix) ? props2.path.replace(thisPrefix, "") : props2.path.startsWith(pathPrefix) ? props2.path : `${pathPrefix}${props2.path || ""}`;
|
|
46
47
|
}, "BlocksWrapper_component_dataPath_useComputed_csBNeJbWH7k", [
|
|
47
48
|
props
|
|
48
49
|
]));
|
|
@@ -39,8 +39,9 @@ const BlocksWrapper = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((p
|
|
|
39
39
|
const [props2] = useLexicalScope();
|
|
40
40
|
if (!props2.path)
|
|
41
41
|
return void 0;
|
|
42
|
+
const thisPrefix = "this.";
|
|
42
43
|
const pathPrefix = "component.options.";
|
|
43
|
-
return props2.path.startsWith(pathPrefix) ? props2.path : `${pathPrefix}${props2.path || ""}`;
|
|
44
|
+
return props2.path.startsWith(thisPrefix) ? props2.path.replace(thisPrefix, "") : props2.path.startsWith(pathPrefix) ? props2.path : `${pathPrefix}${props2.path || ""}`;
|
|
44
45
|
}, "BlocksWrapper_component_dataPath_useComputed_csBNeJbWH7k", [
|
|
45
46
|
props
|
|
46
47
|
]));
|
|
@@ -211,7 +211,7 @@ const EnableEditor = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inli
|
|
|
211
211
|
showContentProps,
|
|
212
212
|
state
|
|
213
213
|
]));
|
|
214
|
-
qwik.
|
|
214
|
+
qwik.useOnDocument("readystatechange", /* @__PURE__ */ qwik.inlinedQrl((event, element) => {
|
|
215
215
|
var _a2, _b2, _c, _d;
|
|
216
216
|
const [props2] = qwik.useLexicalScope();
|
|
217
217
|
if (isBrowser.isBrowser()) {
|
|
@@ -238,7 +238,7 @@ const EnableEditor = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inli
|
|
|
238
238
|
element.dispatchEvent(new CustomEvent("initpreviewingbldr"));
|
|
239
239
|
}
|
|
240
240
|
}
|
|
241
|
-
}, "
|
|
241
|
+
}, "EnableEditor_component_useOnDocument_H7syEGJXM4Y", [
|
|
242
242
|
props
|
|
243
243
|
]));
|
|
244
244
|
qwik.useContextProvider(builder_context, props.builderContextSignal);
|