@builder.io/sdk-qwik 0.17.7 → 0.18.0
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/blocks/symbol/symbol.qwik.cjs +3 -3
- package/lib/browser/blocks/symbol/symbol.qwik.mjs +3 -3
- package/lib/browser/blocks/video/video.qwik.cjs +49 -14
- package/lib/browser/blocks/video/video.qwik.mjs +50 -15
- 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/content/components/enable-editor.qwik.cjs +7 -5
- package/lib/browser/components/content/components/enable-editor.qwik.mjs +8 -6
- package/lib/browser/components/content/content.qwik.cjs +1 -1
- package/lib/browser/components/content/content.qwik.mjs +1 -1
- 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/subscribe-to-editor.qwik.cjs +6 -3
- package/lib/browser/helpers/subscribe-to-editor.qwik.mjs +6 -3
- package/lib/browser/scripts/init-editing.qwik.cjs +4 -1
- package/lib/browser/scripts/init-editing.qwik.mjs +4 -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/blocks/symbol/symbol.qwik.cjs +3 -3
- package/lib/edge/blocks/symbol/symbol.qwik.mjs +3 -3
- package/lib/edge/blocks/video/video.qwik.cjs +49 -14
- package/lib/edge/blocks/video/video.qwik.mjs +50 -15
- 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/content/components/enable-editor.qwik.cjs +7 -5
- package/lib/edge/components/content/components/enable-editor.qwik.mjs +8 -6
- package/lib/edge/components/content/content.qwik.cjs +1 -1
- package/lib/edge/components/content/content.qwik.mjs +1 -1
- 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/subscribe-to-editor.qwik.cjs +6 -3
- package/lib/edge/helpers/subscribe-to-editor.qwik.mjs +6 -3
- package/lib/edge/scripts/init-editing.qwik.cjs +4 -1
- package/lib/edge/scripts/init-editing.qwik.mjs +4 -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/blocks/symbol/symbol.qwik.cjs +3 -3
- package/lib/node/blocks/symbol/symbol.qwik.mjs +3 -3
- package/lib/node/blocks/video/video.qwik.cjs +49 -14
- package/lib/node/blocks/video/video.qwik.mjs +50 -15
- 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/content/components/enable-editor.qwik.cjs +7 -5
- package/lib/node/components/content/components/enable-editor.qwik.mjs +8 -6
- package/lib/node/components/content/content.qwik.cjs +1 -1
- package/lib/node/components/content/content.qwik.mjs +1 -1
- 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/subscribe-to-editor.qwik.cjs +6 -3
- package/lib/node/helpers/subscribe-to-editor.qwik.mjs +6 -3
- package/lib/node/scripts/init-editing.qwik.cjs +4 -1
- package/lib/node/scripts/init-editing.qwik.mjs +4 -1
- package/package.json +1 -1
- package/types/src/components/content-variants/content-variants.types.d.ts +2 -2
- package/types/src/constants/device-sizes.d.ts +3 -2
- package/types/src/constants/sdk-version.d.ts +1 -1
- package/types/src/helpers/subscribe-to-editor.d.ts +13 -13
- package/types/src/scripts/init-editing.d.ts +3 -1
- package/types/src/types/builder-block.d.ts +0 -1
- package/types/src/types/builder-content.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;
|
|
@@ -85,7 +85,7 @@ const Symbol$1 = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQ
|
|
|
85
85
|
},
|
|
86
86
|
get model() {
|
|
87
87
|
var _a2;
|
|
88
|
-
return (_a2 = props.symbol) == null ? void 0 : _a2.model;
|
|
88
|
+
return ((_a2 = props.symbol) == null ? void 0 : _a2.model) ?? "";
|
|
89
89
|
},
|
|
90
90
|
get content() {
|
|
91
91
|
return state.contentToUse;
|
|
@@ -147,10 +147,10 @@ const Symbol$1 = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQ
|
|
|
147
147
|
], "p0.builderLinkComponent"),
|
|
148
148
|
model: qwik._fnSignal((p0) => {
|
|
149
149
|
var _a2;
|
|
150
|
-
return (_a2 = p0.symbol) == null ? void 0 : _a2.model;
|
|
150
|
+
return ((_a2 = p0.symbol) == null ? void 0 : _a2.model) ?? "";
|
|
151
151
|
}, [
|
|
152
152
|
props
|
|
153
|
-
],
|
|
153
|
+
], 'p0.symbol?.model??""'),
|
|
154
154
|
nonce: qwik._fnSignal((p0) => p0.builderContext.nonce, [
|
|
155
155
|
props
|
|
156
156
|
], "p0.builderContext.nonce")
|
|
@@ -83,7 +83,7 @@ const Symbol$1 = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props)
|
|
|
83
83
|
},
|
|
84
84
|
get model() {
|
|
85
85
|
var _a2;
|
|
86
|
-
return (_a2 = props.symbol) == null ? void 0 : _a2.model;
|
|
86
|
+
return ((_a2 = props.symbol) == null ? void 0 : _a2.model) ?? "";
|
|
87
87
|
},
|
|
88
88
|
get content() {
|
|
89
89
|
return state.contentToUse;
|
|
@@ -145,10 +145,10 @@ const Symbol$1 = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props)
|
|
|
145
145
|
], "p0.builderLinkComponent"),
|
|
146
146
|
model: _fnSignal((p0) => {
|
|
147
147
|
var _a2;
|
|
148
|
-
return (_a2 = p0.symbol) == null ? void 0 : _a2.model;
|
|
148
|
+
return ((_a2 = p0.symbol) == null ? void 0 : _a2.model) ?? "";
|
|
149
149
|
}, [
|
|
150
150
|
props
|
|
151
|
-
],
|
|
151
|
+
], 'p0.symbol?.model??""'),
|
|
152
152
|
nonce: _fnSignal((p0) => p0.builderContext.nonce, [
|
|
153
153
|
props
|
|
154
154
|
], "p0.builderContext.nonce")
|
|
@@ -34,6 +34,40 @@ const Video = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl(
|
|
|
34
34
|
}, "Video_component_spreadProps_useComputed_ZdLsx18NYH4", [
|
|
35
35
|
videoProps
|
|
36
36
|
]));
|
|
37
|
+
const videoRef = qwik.useSignal();
|
|
38
|
+
const state = qwik.useStore({
|
|
39
|
+
lazyVideoObserver: void 0
|
|
40
|
+
});
|
|
41
|
+
qwik.useVisibleTaskQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
|
|
42
|
+
const [props2, state2, videoRef2] = qwik.useLexicalScope();
|
|
43
|
+
if (props2.lazyLoad) {
|
|
44
|
+
const oberver = new IntersectionObserver(function(entries) {
|
|
45
|
+
entries.forEach(function(entry) {
|
|
46
|
+
if (!entry.isIntersecting)
|
|
47
|
+
return;
|
|
48
|
+
const videoElement = entry.target;
|
|
49
|
+
try {
|
|
50
|
+
Array.from(videoElement.children).filter((child) => child instanceof HTMLElement && child.tagName === "SOURCE").forEach((source) => {
|
|
51
|
+
const src = source.dataset.src;
|
|
52
|
+
if (src)
|
|
53
|
+
source.src = src;
|
|
54
|
+
});
|
|
55
|
+
videoElement.load();
|
|
56
|
+
oberver.unobserve(videoElement);
|
|
57
|
+
} catch (error) {
|
|
58
|
+
console.error("Error loading lazy video:", error);
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
});
|
|
62
|
+
if (videoRef2.value)
|
|
63
|
+
oberver.observe(videoRef2.value);
|
|
64
|
+
state2.lazyVideoObserver = oberver;
|
|
65
|
+
}
|
|
66
|
+
}, "Video_component_useVisibleTask_LdYTuni7vo4", [
|
|
67
|
+
props,
|
|
68
|
+
state,
|
|
69
|
+
videoRef
|
|
70
|
+
]));
|
|
37
71
|
return /* @__PURE__ */ qwik._jsxQ("div", null, {
|
|
38
72
|
style: {
|
|
39
73
|
position: "relative"
|
|
@@ -41,12 +75,16 @@ const Video = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl(
|
|
|
41
75
|
}, [
|
|
42
76
|
/* @__PURE__ */ qwik._jsxS("video", {
|
|
43
77
|
...spreadProps.value,
|
|
44
|
-
children:
|
|
45
|
-
|
|
46
|
-
props
|
|
47
|
-
|
|
78
|
+
children: /* @__PURE__ */ qwik._jsxS("source", {
|
|
79
|
+
...props.lazyLoad ? {
|
|
80
|
+
"data-src": props.video
|
|
81
|
+
} : {
|
|
82
|
+
src: props.video
|
|
83
|
+
}
|
|
84
|
+
}, {
|
|
48
85
|
type: "video/mp4"
|
|
49
|
-
},
|
|
86
|
+
}, 0, null),
|
|
87
|
+
ref: videoRef,
|
|
50
88
|
style: {
|
|
51
89
|
width: "100%",
|
|
52
90
|
height: "100%",
|
|
@@ -65,12 +103,9 @@ const Video = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl(
|
|
|
65
103
|
poster: qwik._fnSignal((p0) => p0.posterImage, [
|
|
66
104
|
props
|
|
67
105
|
], "p0.posterImage"),
|
|
68
|
-
preload: qwik._fnSignal((p0) => p0.preload || "metadata", [
|
|
69
|
-
props
|
|
70
|
-
], 'p0.preload||"metadata"'),
|
|
71
|
-
src: qwik._fnSignal((p0) => p0.video || "no-src", [
|
|
106
|
+
preload: qwik._fnSignal((p0) => p0.lazyLoad ? "none" : p0.preload || "metadata", [
|
|
72
107
|
props
|
|
73
|
-
], 'p0.
|
|
108
|
+
], 'p0.lazyLoad?"none":p0.preload||"metadata"')
|
|
74
109
|
}, 0, null),
|
|
75
110
|
props.aspectRatio && !(props.fitContent && ((_c = (_b = props.builderBlock) == null ? void 0 : _b.children) == null ? void 0 : _c.length)) ? /* @__PURE__ */ qwik._jsxQ("div", null, {
|
|
76
111
|
style: qwik._fnSignal((p0) => ({
|
|
@@ -81,14 +116,14 @@ const Video = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl(
|
|
|
81
116
|
}), [
|
|
82
117
|
props
|
|
83
118
|
], '{width:"100%",paddingTop:p0.aspectRatio*100+"%",pointerEvents:"none",fontSize:"0px"}')
|
|
84
|
-
}, null, 3, "
|
|
119
|
+
}, null, 3, "j7_0") : null,
|
|
85
120
|
((_e = (_d = props.builderBlock) == null ? void 0 : _d.children) == null ? void 0 : _e.length) && props.fitContent ? /* @__PURE__ */ qwik._jsxQ("div", null, {
|
|
86
121
|
style: {
|
|
87
122
|
display: "flex",
|
|
88
123
|
flexDirection: "column",
|
|
89
124
|
alignItems: "stretch"
|
|
90
125
|
}
|
|
91
|
-
}, /* @__PURE__ */ qwik._jsxC(qwik.Slot, null, 3, "
|
|
126
|
+
}, /* @__PURE__ */ qwik._jsxC(qwik.Slot, null, 3, "j7_1"), 1, "j7_2") : null,
|
|
92
127
|
((_g = (_f = props.builderBlock) == null ? void 0 : _f.children) == null ? void 0 : _g.length) && !props.fitContent ? /* @__PURE__ */ qwik._jsxQ("div", null, {
|
|
93
128
|
style: {
|
|
94
129
|
pointerEvents: "none",
|
|
@@ -101,8 +136,8 @@ const Video = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl(
|
|
|
101
136
|
width: "100%",
|
|
102
137
|
height: "100%"
|
|
103
138
|
}
|
|
104
|
-
}, /* @__PURE__ */ qwik._jsxC(qwik.Slot, null, 3, "
|
|
105
|
-
], 1, "
|
|
139
|
+
}, /* @__PURE__ */ qwik._jsxC(qwik.Slot, null, 3, "j7_3"), 1, "j7_4") : null
|
|
140
|
+
], 1, "j7_5");
|
|
106
141
|
}, "Video_component_qdcTZflYyoQ"));
|
|
107
142
|
exports.Video = Video;
|
|
108
143
|
exports.default = Video;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { componentQrl, inlinedQrl, _jsxBranch, useComputedQrl, useLexicalScope, _jsxQ, _jsxS, _fnSignal, _jsxC, Slot } from "@builder.io/qwik";
|
|
1
|
+
import { componentQrl, inlinedQrl, _jsxBranch, useComputedQrl, useLexicalScope, useSignal, useStore, useVisibleTaskQrl, _jsxQ, _jsxS, _fnSignal, _jsxC, Slot } from "@builder.io/qwik";
|
|
2
2
|
const Video = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) => {
|
|
3
3
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
4
4
|
_jsxBranch();
|
|
@@ -32,6 +32,40 @@ const Video = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) =>
|
|
|
32
32
|
}, "Video_component_spreadProps_useComputed_ZdLsx18NYH4", [
|
|
33
33
|
videoProps
|
|
34
34
|
]));
|
|
35
|
+
const videoRef = useSignal();
|
|
36
|
+
const state = useStore({
|
|
37
|
+
lazyVideoObserver: void 0
|
|
38
|
+
});
|
|
39
|
+
useVisibleTaskQrl(/* @__PURE__ */ inlinedQrl(() => {
|
|
40
|
+
const [props2, state2, videoRef2] = useLexicalScope();
|
|
41
|
+
if (props2.lazyLoad) {
|
|
42
|
+
const oberver = new IntersectionObserver(function(entries) {
|
|
43
|
+
entries.forEach(function(entry) {
|
|
44
|
+
if (!entry.isIntersecting)
|
|
45
|
+
return;
|
|
46
|
+
const videoElement = entry.target;
|
|
47
|
+
try {
|
|
48
|
+
Array.from(videoElement.children).filter((child) => child instanceof HTMLElement && child.tagName === "SOURCE").forEach((source) => {
|
|
49
|
+
const src = source.dataset.src;
|
|
50
|
+
if (src)
|
|
51
|
+
source.src = src;
|
|
52
|
+
});
|
|
53
|
+
videoElement.load();
|
|
54
|
+
oberver.unobserve(videoElement);
|
|
55
|
+
} catch (error) {
|
|
56
|
+
console.error("Error loading lazy video:", error);
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
});
|
|
60
|
+
if (videoRef2.value)
|
|
61
|
+
oberver.observe(videoRef2.value);
|
|
62
|
+
state2.lazyVideoObserver = oberver;
|
|
63
|
+
}
|
|
64
|
+
}, "Video_component_useVisibleTask_LdYTuni7vo4", [
|
|
65
|
+
props,
|
|
66
|
+
state,
|
|
67
|
+
videoRef
|
|
68
|
+
]));
|
|
35
69
|
return /* @__PURE__ */ _jsxQ("div", null, {
|
|
36
70
|
style: {
|
|
37
71
|
position: "relative"
|
|
@@ -39,12 +73,16 @@ const Video = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) =>
|
|
|
39
73
|
}, [
|
|
40
74
|
/* @__PURE__ */ _jsxS("video", {
|
|
41
75
|
...spreadProps.value,
|
|
42
|
-
children:
|
|
43
|
-
|
|
44
|
-
props
|
|
45
|
-
|
|
76
|
+
children: /* @__PURE__ */ _jsxS("source", {
|
|
77
|
+
...props.lazyLoad ? {
|
|
78
|
+
"data-src": props.video
|
|
79
|
+
} : {
|
|
80
|
+
src: props.video
|
|
81
|
+
}
|
|
82
|
+
}, {
|
|
46
83
|
type: "video/mp4"
|
|
47
|
-
},
|
|
84
|
+
}, 0, null),
|
|
85
|
+
ref: videoRef,
|
|
48
86
|
style: {
|
|
49
87
|
width: "100%",
|
|
50
88
|
height: "100%",
|
|
@@ -63,12 +101,9 @@ const Video = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) =>
|
|
|
63
101
|
poster: _fnSignal((p0) => p0.posterImage, [
|
|
64
102
|
props
|
|
65
103
|
], "p0.posterImage"),
|
|
66
|
-
preload: _fnSignal((p0) => p0.preload || "metadata", [
|
|
67
|
-
props
|
|
68
|
-
], 'p0.preload||"metadata"'),
|
|
69
|
-
src: _fnSignal((p0) => p0.video || "no-src", [
|
|
104
|
+
preload: _fnSignal((p0) => p0.lazyLoad ? "none" : p0.preload || "metadata", [
|
|
70
105
|
props
|
|
71
|
-
], 'p0.
|
|
106
|
+
], 'p0.lazyLoad?"none":p0.preload||"metadata"')
|
|
72
107
|
}, 0, null),
|
|
73
108
|
props.aspectRatio && !(props.fitContent && ((_c = (_b = props.builderBlock) == null ? void 0 : _b.children) == null ? void 0 : _c.length)) ? /* @__PURE__ */ _jsxQ("div", null, {
|
|
74
109
|
style: _fnSignal((p0) => ({
|
|
@@ -79,14 +114,14 @@ const Video = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) =>
|
|
|
79
114
|
}), [
|
|
80
115
|
props
|
|
81
116
|
], '{width:"100%",paddingTop:p0.aspectRatio*100+"%",pointerEvents:"none",fontSize:"0px"}')
|
|
82
|
-
}, null, 3, "
|
|
117
|
+
}, null, 3, "j7_0") : null,
|
|
83
118
|
((_e = (_d = props.builderBlock) == null ? void 0 : _d.children) == null ? void 0 : _e.length) && props.fitContent ? /* @__PURE__ */ _jsxQ("div", null, {
|
|
84
119
|
style: {
|
|
85
120
|
display: "flex",
|
|
86
121
|
flexDirection: "column",
|
|
87
122
|
alignItems: "stretch"
|
|
88
123
|
}
|
|
89
|
-
}, /* @__PURE__ */ _jsxC(Slot, null, 3, "
|
|
124
|
+
}, /* @__PURE__ */ _jsxC(Slot, null, 3, "j7_1"), 1, "j7_2") : null,
|
|
90
125
|
((_g = (_f = props.builderBlock) == null ? void 0 : _f.children) == null ? void 0 : _g.length) && !props.fitContent ? /* @__PURE__ */ _jsxQ("div", null, {
|
|
91
126
|
style: {
|
|
92
127
|
pointerEvents: "none",
|
|
@@ -99,8 +134,8 @@ const Video = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) =>
|
|
|
99
134
|
width: "100%",
|
|
100
135
|
height: "100%"
|
|
101
136
|
}
|
|
102
|
-
}, /* @__PURE__ */ _jsxC(Slot, null, 3, "
|
|
103
|
-
], 1, "
|
|
137
|
+
}, /* @__PURE__ */ _jsxC(Slot, null, 3, "j7_3"), 1, "j7_4") : null
|
|
138
|
+
], 1, "j7_5");
|
|
104
139
|
}, "Video_component_qdcTZflYyoQ"));
|
|
105
140
|
export {
|
|
106
141
|
Video,
|
|
@@ -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", [
|
|
@@ -168,11 +168,13 @@ const EnableEditor = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inli
|
|
|
168
168
|
} : {},
|
|
169
169
|
...props2.trustedHosts ? {
|
|
170
170
|
trustedHosts: props2.trustedHosts
|
|
171
|
-
} : {}
|
|
171
|
+
} : {},
|
|
172
|
+
modelName: props2.model ?? "",
|
|
173
|
+
apiKey: props2.apiKey
|
|
172
174
|
});
|
|
173
175
|
Object.values(props2.builderContextSignal.componentInfos).forEach((registeredComponent) => {
|
|
174
176
|
var _a2, _b2;
|
|
175
|
-
if (!
|
|
177
|
+
if (!((_a2 = registeredComponent.models) == null ? void 0 : _a2.length) || registeredComponent.models.includes(props2.model)) {
|
|
176
178
|
const message = registerComponent.createRegisterComponentMessage(registeredComponent);
|
|
177
179
|
(_b2 = window.parent) == null ? void 0 : _b2.postMessage(message, "*");
|
|
178
180
|
}
|
|
@@ -193,7 +195,7 @@ const EnableEditor = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inli
|
|
|
193
195
|
const previewApiKey = searchParams.get("apiKey") || searchParams.get("builder.space");
|
|
194
196
|
if (searchParamPreviewModel === "BUILDER_STUDIO" || searchParamPreviewModel === props2.model && previewApiKey === props2.apiKey && (!props2.content || searchParamPreviewId === props2.content.id))
|
|
195
197
|
index.fetchOneEntry({
|
|
196
|
-
model: props2.model
|
|
198
|
+
model: props2.model,
|
|
197
199
|
apiKey: props2.apiKey,
|
|
198
200
|
apiVersion: props2.builderContextSignal.apiVersion,
|
|
199
201
|
...searchParamPreviewModel === "BUILDER_STUDIO" && ((_a2 = props2.context) == null ? void 0 : _a2.symbolId) ? {
|
|
@@ -211,7 +213,7 @@ const EnableEditor = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inli
|
|
|
211
213
|
showContentProps,
|
|
212
214
|
state
|
|
213
215
|
]));
|
|
214
|
-
qwik.
|
|
216
|
+
qwik.useOnDocument("readystatechange", /* @__PURE__ */ qwik.inlinedQrl((event, element) => {
|
|
215
217
|
var _a2, _b2, _c, _d;
|
|
216
218
|
const [props2] = qwik.useLexicalScope();
|
|
217
219
|
if (isBrowser.isBrowser()) {
|
|
@@ -238,7 +240,7 @@ const EnableEditor = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inli
|
|
|
238
240
|
element.dispatchEvent(new CustomEvent("initpreviewingbldr"));
|
|
239
241
|
}
|
|
240
242
|
}
|
|
241
|
-
}, "
|
|
243
|
+
}, "EnableEditor_component_useOnDocument_H7syEGJXM4Y", [
|
|
242
244
|
props
|
|
243
245
|
]));
|
|
244
246
|
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";
|
|
@@ -166,11 +166,13 @@ const EnableEditor = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((pr
|
|
|
166
166
|
} : {},
|
|
167
167
|
...props2.trustedHosts ? {
|
|
168
168
|
trustedHosts: props2.trustedHosts
|
|
169
|
-
} : {}
|
|
169
|
+
} : {},
|
|
170
|
+
modelName: props2.model ?? "",
|
|
171
|
+
apiKey: props2.apiKey
|
|
170
172
|
});
|
|
171
173
|
Object.values(props2.builderContextSignal.componentInfos).forEach((registeredComponent) => {
|
|
172
174
|
var _a2, _b2;
|
|
173
|
-
if (!
|
|
175
|
+
if (!((_a2 = registeredComponent.models) == null ? void 0 : _a2.length) || registeredComponent.models.includes(props2.model)) {
|
|
174
176
|
const message = createRegisterComponentMessage(registeredComponent);
|
|
175
177
|
(_b2 = window.parent) == null ? void 0 : _b2.postMessage(message, "*");
|
|
176
178
|
}
|
|
@@ -191,7 +193,7 @@ const EnableEditor = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((pr
|
|
|
191
193
|
const previewApiKey = searchParams.get("apiKey") || searchParams.get("builder.space");
|
|
192
194
|
if (searchParamPreviewModel === "BUILDER_STUDIO" || searchParamPreviewModel === props2.model && previewApiKey === props2.apiKey && (!props2.content || searchParamPreviewId === props2.content.id))
|
|
193
195
|
fetchOneEntry({
|
|
194
|
-
model: props2.model
|
|
196
|
+
model: props2.model,
|
|
195
197
|
apiKey: props2.apiKey,
|
|
196
198
|
apiVersion: props2.builderContextSignal.apiVersion,
|
|
197
199
|
...searchParamPreviewModel === "BUILDER_STUDIO" && ((_a2 = props2.context) == null ? void 0 : _a2.symbolId) ? {
|
|
@@ -209,7 +211,7 @@ const EnableEditor = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((pr
|
|
|
209
211
|
showContentProps,
|
|
210
212
|
state
|
|
211
213
|
]));
|
|
212
|
-
|
|
214
|
+
useOnDocument("readystatechange", /* @__PURE__ */ inlinedQrl((event, element) => {
|
|
213
215
|
var _a2, _b2, _c, _d;
|
|
214
216
|
const [props2] = useLexicalScope();
|
|
215
217
|
if (isBrowser()) {
|
|
@@ -236,7 +238,7 @@ const EnableEditor = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((pr
|
|
|
236
238
|
element.dispatchEvent(new CustomEvent("initpreviewingbldr"));
|
|
237
239
|
}
|
|
238
240
|
}
|
|
239
|
-
}, "
|
|
241
|
+
}, "EnableEditor_component_useOnDocument_H7syEGJXM4Y", [
|
|
240
242
|
props
|
|
241
243
|
]));
|
|
242
244
|
useContextProvider(builderContext, props.builderContextSignal);
|
|
@@ -43,7 +43,7 @@ const ContentComponent = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.
|
|
|
43
43
|
BlocksWrapper: props.blocksWrapper || "div",
|
|
44
44
|
BlocksWrapperProps: props.blocksWrapperProps || {},
|
|
45
45
|
nonce: props.nonce || "",
|
|
46
|
-
model: props.model
|
|
46
|
+
model: props.model
|
|
47
47
|
},
|
|
48
48
|
registeredComponents: [
|
|
49
49
|
...builderRegisteredComponents.getDefaultRegisteredComponents(),
|
|
@@ -41,7 +41,7 @@ const ContentComponent = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl
|
|
|
41
41
|
BlocksWrapper: props.blocksWrapper || "div",
|
|
42
42
|
BlocksWrapperProps: props.blocksWrapperProps || {},
|
|
43
43
|
nonce: props.nonce || "",
|
|
44
|
-
model: props.model
|
|
44
|
+
model: props.model
|
|
45
45
|
},
|
|
46
46
|
registeredComponents: [
|
|
47
47
|
...getDefaultRegisteredComponents(),
|
|
@@ -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,
|
|
@@ -28,13 +28,16 @@ const createEditorListener = ({ model, trustedHosts, callbacks }) => {
|
|
|
28
28
|
}
|
|
29
29
|
};
|
|
30
30
|
};
|
|
31
|
-
const subscribeToEditor = (model, callback,
|
|
31
|
+
const subscribeToEditor = ({ model, apiKey, callback, trustedHosts }) => {
|
|
32
32
|
if (!isBrowser.isBrowser) {
|
|
33
33
|
logger.logger.warn("`subscribeToEditor` only works in the browser. It currently seems to be running on the server.");
|
|
34
34
|
return () => {
|
|
35
35
|
};
|
|
36
36
|
}
|
|
37
|
-
initEditing.setupBrowserForEditing(
|
|
37
|
+
initEditing.setupBrowserForEditing({
|
|
38
|
+
modelName: model,
|
|
39
|
+
apiKey
|
|
40
|
+
});
|
|
38
41
|
const listener = createEditorListener({
|
|
39
42
|
callbacks: {
|
|
40
43
|
contentUpdate: callback,
|
|
@@ -44,7 +47,7 @@ const subscribeToEditor = (model, callback, options) => {
|
|
|
44
47
|
}
|
|
45
48
|
},
|
|
46
49
|
model,
|
|
47
|
-
trustedHosts
|
|
50
|
+
trustedHosts
|
|
48
51
|
});
|
|
49
52
|
window.addEventListener("message", listener);
|
|
50
53
|
return () => {
|
|
@@ -26,13 +26,16 @@ const createEditorListener = ({ model, trustedHosts, callbacks }) => {
|
|
|
26
26
|
}
|
|
27
27
|
};
|
|
28
28
|
};
|
|
29
|
-
const subscribeToEditor = (model, callback,
|
|
29
|
+
const subscribeToEditor = ({ model, apiKey, callback, trustedHosts }) => {
|
|
30
30
|
if (!isBrowser) {
|
|
31
31
|
logger.warn("`subscribeToEditor` only works in the browser. It currently seems to be running on the server.");
|
|
32
32
|
return () => {
|
|
33
33
|
};
|
|
34
34
|
}
|
|
35
|
-
setupBrowserForEditing(
|
|
35
|
+
setupBrowserForEditing({
|
|
36
|
+
modelName: model,
|
|
37
|
+
apiKey
|
|
38
|
+
});
|
|
36
39
|
const listener = createEditorListener({
|
|
37
40
|
callbacks: {
|
|
38
41
|
contentUpdate: callback,
|
|
@@ -42,7 +45,7 @@ const subscribeToEditor = (model, callback, options) => {
|
|
|
42
45
|
}
|
|
43
46
|
},
|
|
44
47
|
model,
|
|
45
|
-
trustedHosts
|
|
48
|
+
trustedHosts
|
|
46
49
|
});
|
|
47
50
|
window.addEventListener("message", listener);
|
|
48
51
|
return () => {
|
|
@@ -40,7 +40,7 @@ const registerInsertMenu = () => {
|
|
|
40
40
|
});
|
|
41
41
|
};
|
|
42
42
|
let isSetupForEditing = false;
|
|
43
|
-
const setupBrowserForEditing = (options
|
|
43
|
+
const setupBrowserForEditing = (options) => {
|
|
44
44
|
var _a, _b;
|
|
45
45
|
if (isSetupForEditing)
|
|
46
46
|
return;
|
|
@@ -56,6 +56,9 @@ const setupBrowserForEditing = (options = {}) => {
|
|
|
56
56
|
// scope our '+ add block' button styling
|
|
57
57
|
supportsAddBlockScoping: true,
|
|
58
58
|
supportsCustomBreakpoints: true,
|
|
59
|
+
modelName: options.modelName,
|
|
60
|
+
apiKey: options.apiKey,
|
|
61
|
+
supportsXSmallBreakpoint: true,
|
|
59
62
|
blockLevelPersonalization: true
|
|
60
63
|
}
|
|
61
64
|
}, "*");
|