@builder.io/sdk-qwik 0.21.1 → 0.22.2
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/img/component-info.qwik.cjs +51 -3
- package/lib/browser/blocks/img/component-info.qwik.mjs +51 -3
- package/lib/browser/blocks/img/img.qwik.cjs +23 -10
- package/lib/browser/blocks/img/img.qwik.mjs +23 -10
- package/lib/browser/blocks/text/component-info.qwik.cjs +0 -1
- package/lib/browser/blocks/text/component-info.qwik.mjs +0 -1
- package/lib/browser/components/block/block.qwik.cjs +9 -3
- package/lib/browser/components/block/block.qwik.mjs +9 -3
- package/lib/browser/components/block/components/interactive-element.qwik.cjs +5 -2
- package/lib/browser/components/block/components/interactive-element.qwik.mjs +5 -2
- package/lib/browser/components/block/components/style-wrapper.qwik.cjs +52 -0
- package/lib/browser/components/block/components/style-wrapper.qwik.mjs +52 -0
- package/lib/browser/components/content/components/enable-editor.qwik.cjs +9 -4
- package/lib/browser/components/content/components/enable-editor.qwik.mjs +9 -4
- 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 +2 -8
- package/lib/browser/functions/get-content/generate-content-url.qwik.mjs +2 -8
- package/lib/browser/functions/get-content/index.qwik.cjs +9 -0
- package/lib/browser/functions/get-content/index.qwik.mjs +9 -0
- package/lib/browser/functions/is-previewing.qwik.cjs +4 -4
- package/lib/browser/functions/is-previewing.qwik.mjs +4 -4
- package/lib/browser/helpers/subscribe-to-editor.qwik.cjs +4 -2
- package/lib/browser/helpers/subscribe-to-editor.qwik.mjs +4 -2
- package/lib/edge/blocks/img/component-info.qwik.cjs +51 -3
- package/lib/edge/blocks/img/component-info.qwik.mjs +51 -3
- package/lib/edge/blocks/img/img.qwik.cjs +23 -10
- package/lib/edge/blocks/img/img.qwik.mjs +23 -10
- package/lib/edge/blocks/text/component-info.qwik.cjs +0 -1
- package/lib/edge/blocks/text/component-info.qwik.mjs +0 -1
- package/lib/edge/components/block/block.qwik.cjs +9 -3
- package/lib/edge/components/block/block.qwik.mjs +9 -3
- package/lib/edge/components/block/components/interactive-element.qwik.cjs +5 -2
- package/lib/edge/components/block/components/interactive-element.qwik.mjs +5 -2
- package/lib/edge/components/block/components/style-wrapper.qwik.cjs +53 -0
- package/lib/edge/components/block/components/style-wrapper.qwik.mjs +53 -0
- package/lib/edge/components/content/components/enable-editor.qwik.cjs +9 -4
- package/lib/edge/components/content/components/enable-editor.qwik.mjs +9 -4
- 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 +2 -8
- package/lib/edge/functions/get-content/generate-content-url.qwik.mjs +2 -8
- package/lib/edge/functions/get-content/index.qwik.cjs +9 -0
- package/lib/edge/functions/get-content/index.qwik.mjs +9 -0
- package/lib/edge/functions/is-previewing.qwik.cjs +4 -4
- package/lib/edge/functions/is-previewing.qwik.mjs +4 -4
- package/lib/edge/helpers/subscribe-to-editor.qwik.cjs +4 -2
- package/lib/edge/helpers/subscribe-to-editor.qwik.mjs +4 -2
- package/lib/node/blocks/img/component-info.qwik.cjs +51 -3
- package/lib/node/blocks/img/component-info.qwik.mjs +51 -3
- package/lib/node/blocks/img/img.qwik.cjs +23 -10
- package/lib/node/blocks/img/img.qwik.mjs +23 -10
- package/lib/node/blocks/text/component-info.qwik.cjs +0 -1
- package/lib/node/blocks/text/component-info.qwik.mjs +0 -1
- package/lib/node/components/block/block.qwik.cjs +9 -3
- package/lib/node/components/block/block.qwik.mjs +9 -3
- package/lib/node/components/block/components/interactive-element.qwik.cjs +5 -2
- package/lib/node/components/block/components/interactive-element.qwik.mjs +5 -2
- package/lib/node/components/block/components/style-wrapper.qwik.cjs +53 -0
- package/lib/node/components/block/components/style-wrapper.qwik.mjs +53 -0
- package/lib/node/components/content/components/enable-editor.qwik.cjs +9 -4
- package/lib/node/components/content/components/enable-editor.qwik.mjs +9 -4
- package/lib/node/constants/sdk-version.qwik.cjs +1 -1
- package/lib/node/constants/sdk-version.qwik.mjs +1 -1
- package/lib/node/functions/get-content/generate-content-url.qwik.cjs +2 -8
- package/lib/node/functions/get-content/generate-content-url.qwik.mjs +2 -8
- package/lib/node/functions/get-content/index.qwik.cjs +9 -0
- package/lib/node/functions/get-content/index.qwik.mjs +9 -0
- package/lib/node/functions/is-previewing.qwik.cjs +4 -4
- package/lib/node/functions/is-previewing.qwik.mjs +4 -4
- package/lib/node/helpers/subscribe-to-editor.qwik.cjs +4 -2
- package/lib/node/helpers/subscribe-to-editor.qwik.mjs +4 -2
- package/package.json +1 -1
- package/types/src/blocks/img/img.d.ts +2 -0
- package/types/src/components/block/components/live-edit-block-styles.d.ts +7 -0
- package/types/src/components/block/components/style-wrapper.d.ts +8 -0
- package/types/src/components/content/components/enable-editor.d.ts +3 -2
- package/types/src/components/live-edit.d.ts +8 -0
- package/types/src/constants/sdk-version.d.ts +1 -1
- package/types/src/functions/get-builder-search-params/index.d.ts +8 -2
- package/types/src/functions/is-previewing.d.ts +11 -1
- package/types/src/helpers/find-block.d.ts +18 -0
- package/types/src/helpers/subscribe-to-editor.d.ts +3 -2
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const fileTypes = require("../../constants/file-types.qwik.cjs");
|
|
4
4
|
const componentInfo = {
|
|
5
|
-
// friendlyName?
|
|
6
5
|
name: "Raw:Img",
|
|
7
6
|
hideFromInsertMenu: true,
|
|
8
7
|
image: "https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-insert_photo-24px.svg?alt=media&token=4e5d0ef4-f5e8-4e57-b3a9-38d63a9b9dc4",
|
|
@@ -13,9 +12,58 @@ const componentInfo = {
|
|
|
13
12
|
type: "file",
|
|
14
13
|
allowedFileTypes: fileTypes.IMAGE_FILE_TYPES,
|
|
15
14
|
required: true
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
name: "backgroundSize",
|
|
18
|
+
type: "text",
|
|
19
|
+
defaultValue: "cover",
|
|
20
|
+
enum: [
|
|
21
|
+
{
|
|
22
|
+
label: "contain",
|
|
23
|
+
value: "contain",
|
|
24
|
+
helperText: "The image should never get cropped"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
label: "cover",
|
|
28
|
+
value: "cover",
|
|
29
|
+
helperText: "The image should fill it's box, cropping when needed"
|
|
30
|
+
}
|
|
31
|
+
]
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
name: "backgroundPosition",
|
|
35
|
+
type: "text",
|
|
36
|
+
defaultValue: "center",
|
|
37
|
+
enum: [
|
|
38
|
+
"center",
|
|
39
|
+
"top",
|
|
40
|
+
"left",
|
|
41
|
+
"right",
|
|
42
|
+
"bottom",
|
|
43
|
+
"top left",
|
|
44
|
+
"top right",
|
|
45
|
+
"bottom left",
|
|
46
|
+
"bottom right"
|
|
47
|
+
]
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
name: "altText",
|
|
51
|
+
type: "string",
|
|
52
|
+
helperText: "Text to display when the user has images off"
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
name: "title",
|
|
56
|
+
type: "string",
|
|
57
|
+
helperText: "Text to display when hovering over the asset"
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
name: "aspectRatio",
|
|
61
|
+
type: "number",
|
|
62
|
+
helperText: "This is the ratio of height/width, e.g. set to 1.5 for a 300px wide and 200px tall photo. Set to 0 to not force the image to maintain it's aspect ratio",
|
|
63
|
+
advanced: true,
|
|
64
|
+
defaultValue: 0.7041
|
|
16
65
|
}
|
|
17
66
|
],
|
|
18
|
-
noWrap: true
|
|
19
|
-
static: true
|
|
67
|
+
noWrap: true
|
|
20
68
|
};
|
|
21
69
|
exports.componentInfo = componentInfo;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { IMAGE_FILE_TYPES } from "../../constants/file-types.qwik.mjs";
|
|
2
2
|
const componentInfo = {
|
|
3
|
-
// friendlyName?
|
|
4
3
|
name: "Raw:Img",
|
|
5
4
|
hideFromInsertMenu: true,
|
|
6
5
|
image: "https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-insert_photo-24px.svg?alt=media&token=4e5d0ef4-f5e8-4e57-b3a9-38d63a9b9dc4",
|
|
@@ -11,10 +10,59 @@ const componentInfo = {
|
|
|
11
10
|
type: "file",
|
|
12
11
|
allowedFileTypes: IMAGE_FILE_TYPES,
|
|
13
12
|
required: true
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
name: "backgroundSize",
|
|
16
|
+
type: "text",
|
|
17
|
+
defaultValue: "cover",
|
|
18
|
+
enum: [
|
|
19
|
+
{
|
|
20
|
+
label: "contain",
|
|
21
|
+
value: "contain",
|
|
22
|
+
helperText: "The image should never get cropped"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
label: "cover",
|
|
26
|
+
value: "cover",
|
|
27
|
+
helperText: "The image should fill it's box, cropping when needed"
|
|
28
|
+
}
|
|
29
|
+
]
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
name: "backgroundPosition",
|
|
33
|
+
type: "text",
|
|
34
|
+
defaultValue: "center",
|
|
35
|
+
enum: [
|
|
36
|
+
"center",
|
|
37
|
+
"top",
|
|
38
|
+
"left",
|
|
39
|
+
"right",
|
|
40
|
+
"bottom",
|
|
41
|
+
"top left",
|
|
42
|
+
"top right",
|
|
43
|
+
"bottom left",
|
|
44
|
+
"bottom right"
|
|
45
|
+
]
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
name: "altText",
|
|
49
|
+
type: "string",
|
|
50
|
+
helperText: "Text to display when the user has images off"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
name: "title",
|
|
54
|
+
type: "string",
|
|
55
|
+
helperText: "Text to display when hovering over the asset"
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
name: "aspectRatio",
|
|
59
|
+
type: "number",
|
|
60
|
+
helperText: "This is the ratio of height/width, e.g. set to 1.5 for a 300px wide and 200px tall photo. Set to 0 to not force the image to maintain it's aspect ratio",
|
|
61
|
+
advanced: true,
|
|
62
|
+
defaultValue: 0.7041
|
|
14
63
|
}
|
|
15
64
|
],
|
|
16
|
-
noWrap: true
|
|
17
|
-
static: true
|
|
65
|
+
noWrap: true
|
|
18
66
|
};
|
|
19
67
|
export {
|
|
20
68
|
componentInfo
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
3
|
const qwik = require("@builder.io/qwik");
|
|
4
|
+
const getClassPropName = require("../../functions/get-class-prop-name.qwik.cjs");
|
|
4
5
|
const isEditing = require("../../functions/is-editing.qwik.cjs");
|
|
5
6
|
const image_helpers = require("../image/image.helpers.qwik.cjs");
|
|
6
7
|
const ImgComponent = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
|
|
7
|
-
|
|
8
|
+
var _a;
|
|
9
|
+
qwik.useComputedQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
|
|
8
10
|
const [props2] = qwik.useLexicalScope();
|
|
9
11
|
const url = props2.imgSrc || props2.image;
|
|
10
12
|
if (!url || typeof url !== "string")
|
|
@@ -15,8 +17,25 @@ const ImgComponent = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inli
|
|
|
15
17
|
}, "ImgComponent_component_srcSetToUse_useComputed_z7PUtkds7Q0", [
|
|
16
18
|
props
|
|
17
19
|
]));
|
|
20
|
+
const imgAttrs = qwik.useComputedQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
|
|
21
|
+
const [props2] = qwik.useLexicalScope();
|
|
22
|
+
const attrs = {
|
|
23
|
+
...props2.attributes,
|
|
24
|
+
[getClassPropName.getClassPropName()]: `builder-raw-img ${props2.attributes[getClassPropName.getClassPropName()] || ""}`
|
|
25
|
+
};
|
|
26
|
+
delete attrs.style;
|
|
27
|
+
return attrs;
|
|
28
|
+
}, "ImgComponent_component_imgAttrs_useComputed_VIloKDVy6OI", [
|
|
29
|
+
props
|
|
30
|
+
]));
|
|
18
31
|
return /* @__PURE__ */ qwik._jsxS("img", {
|
|
19
|
-
...
|
|
32
|
+
...imgAttrs.value,
|
|
33
|
+
style: {
|
|
34
|
+
objectFit: props.backgroundSize || "cover",
|
|
35
|
+
objectPosition: props.backgroundPosition || "center",
|
|
36
|
+
aspectRatio: props.aspectRatio || void 0,
|
|
37
|
+
...((_a = props.attributes) == null ? void 0 : _a.style) || {}
|
|
38
|
+
}
|
|
20
39
|
}, {
|
|
21
40
|
alt: qwik._fnSignal((p0) => p0.altText, [
|
|
22
41
|
props
|
|
@@ -25,15 +44,9 @@ const ImgComponent = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inli
|
|
|
25
44
|
src: qwik._fnSignal((p0) => p0.imgSrc || p0.image, [
|
|
26
45
|
props
|
|
27
46
|
], "p0.imgSrc||p0.image"),
|
|
28
|
-
|
|
29
|
-
srcSetToUse
|
|
30
|
-
], "p0.value"),
|
|
31
|
-
style: qwik._fnSignal((p0) => ({
|
|
32
|
-
objectFit: p0.backgroundSize || "cover",
|
|
33
|
-
objectPosition: p0.backgroundPosition || "center"
|
|
34
|
-
}), [
|
|
47
|
+
title: qwik._fnSignal((p0) => p0.title, [
|
|
35
48
|
props
|
|
36
|
-
],
|
|
49
|
+
], "p0.title")
|
|
37
50
|
}, 0, isEditing.isEditing() && props.imgSrc || "default-key");
|
|
38
51
|
}, "ImgComponent_component_FXvIDBSffO8"));
|
|
39
52
|
exports.ImgComponent = ImgComponent;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { componentQrl, inlinedQrl, useComputedQrl, useLexicalScope, _jsxS, _fnSignal } from "@builder.io/qwik";
|
|
2
|
+
import { getClassPropName } from "../../functions/get-class-prop-name.qwik.mjs";
|
|
2
3
|
import { isEditing } from "../../functions/is-editing.qwik.mjs";
|
|
3
4
|
import { getSrcSet } from "../image/image.helpers.qwik.mjs";
|
|
4
5
|
const ImgComponent = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) => {
|
|
5
|
-
|
|
6
|
+
var _a;
|
|
7
|
+
useComputedQrl(/* @__PURE__ */ inlinedQrl(() => {
|
|
6
8
|
const [props2] = useLexicalScope();
|
|
7
9
|
const url = props2.imgSrc || props2.image;
|
|
8
10
|
if (!url || typeof url !== "string")
|
|
@@ -13,8 +15,25 @@ const ImgComponent = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((pr
|
|
|
13
15
|
}, "ImgComponent_component_srcSetToUse_useComputed_z7PUtkds7Q0", [
|
|
14
16
|
props
|
|
15
17
|
]));
|
|
18
|
+
const imgAttrs = useComputedQrl(/* @__PURE__ */ inlinedQrl(() => {
|
|
19
|
+
const [props2] = useLexicalScope();
|
|
20
|
+
const attrs = {
|
|
21
|
+
...props2.attributes,
|
|
22
|
+
[getClassPropName()]: `builder-raw-img ${props2.attributes[getClassPropName()] || ""}`
|
|
23
|
+
};
|
|
24
|
+
delete attrs.style;
|
|
25
|
+
return attrs;
|
|
26
|
+
}, "ImgComponent_component_imgAttrs_useComputed_VIloKDVy6OI", [
|
|
27
|
+
props
|
|
28
|
+
]));
|
|
16
29
|
return /* @__PURE__ */ _jsxS("img", {
|
|
17
|
-
...
|
|
30
|
+
...imgAttrs.value,
|
|
31
|
+
style: {
|
|
32
|
+
objectFit: props.backgroundSize || "cover",
|
|
33
|
+
objectPosition: props.backgroundPosition || "center",
|
|
34
|
+
aspectRatio: props.aspectRatio || void 0,
|
|
35
|
+
...((_a = props.attributes) == null ? void 0 : _a.style) || {}
|
|
36
|
+
}
|
|
18
37
|
}, {
|
|
19
38
|
alt: _fnSignal((p0) => p0.altText, [
|
|
20
39
|
props
|
|
@@ -23,15 +42,9 @@ const ImgComponent = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((pr
|
|
|
23
42
|
src: _fnSignal((p0) => p0.imgSrc || p0.image, [
|
|
24
43
|
props
|
|
25
44
|
], "p0.imgSrc||p0.image"),
|
|
26
|
-
|
|
27
|
-
srcSetToUse
|
|
28
|
-
], "p0.value"),
|
|
29
|
-
style: _fnSignal((p0) => ({
|
|
30
|
-
objectFit: p0.backgroundSize || "cover",
|
|
31
|
-
objectPosition: p0.backgroundPosition || "center"
|
|
32
|
-
}), [
|
|
45
|
+
title: _fnSignal((p0) => p0.title, [
|
|
33
46
|
props
|
|
34
|
-
],
|
|
47
|
+
], "p0.title")
|
|
35
48
|
}, 0, isEditing() && props.imgSrc || "default-key");
|
|
36
49
|
}, "ImgComponent_component_FXvIDBSffO8"));
|
|
37
50
|
export {
|
|
@@ -4,7 +4,6 @@ const componentInfo = {
|
|
|
4
4
|
shouldReceiveBuilderProps: {},
|
|
5
5
|
name: "Text",
|
|
6
6
|
static: true,
|
|
7
|
-
isRSC: true,
|
|
8
7
|
image: "https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-text_fields-24px%20(1).svg?alt=media&token=12177b73-0ee3-42ca-98c6-0dd003de1929",
|
|
9
8
|
inputs: [
|
|
10
9
|
{
|
|
@@ -2,7 +2,6 @@ const componentInfo = {
|
|
|
2
2
|
shouldReceiveBuilderProps: {},
|
|
3
3
|
name: "Text",
|
|
4
4
|
static: true,
|
|
5
|
-
isRSC: true,
|
|
6
5
|
image: "https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-text_fields-24px%20(1).svg?alt=media&token=12177b73-0ee3-42ca-98c6-0dd003de1929",
|
|
7
6
|
inputs: [
|
|
8
7
|
{
|
|
@@ -7,10 +7,10 @@ const getBlockComponentOptions = require("../../functions/get-block-component-op
|
|
|
7
7
|
const getProcessedBlock = require("../../functions/get-processed-block.qwik.cjs");
|
|
8
8
|
const animator = require("./animator.qwik.cjs");
|
|
9
9
|
const block_helpers = require("./block.helpers.qwik.cjs");
|
|
10
|
-
const blockStyles = require("./components/block-styles.qwik.cjs");
|
|
11
10
|
const blockWrapper = require("./components/block-wrapper.qwik.cjs");
|
|
12
11
|
const componentRef = require("./components/component-ref/component-ref.qwik.cjs");
|
|
13
12
|
const repeatedBlock = require("./components/repeated-block.qwik.cjs");
|
|
13
|
+
const styleWrapper = require("./components/style-wrapper.qwik.cjs");
|
|
14
14
|
const Block = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
|
|
15
15
|
var _a;
|
|
16
16
|
qwik._jsxBranch();
|
|
@@ -133,20 +133,26 @@ const Block = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl(
|
|
|
133
133
|
return /* @__PURE__ */ qwik._jsxC(jsxRuntime.Fragment, {
|
|
134
134
|
children: canShowBlock.value ? /* @__PURE__ */ qwik._jsxC(jsxRuntime.Fragment, {
|
|
135
135
|
children: [
|
|
136
|
-
/* @__PURE__ */ qwik._jsxC(
|
|
136
|
+
/* @__PURE__ */ qwik._jsxC(styleWrapper.StyleWrapper, {
|
|
137
137
|
get block() {
|
|
138
138
|
return processedBlock.value;
|
|
139
139
|
},
|
|
140
140
|
get context() {
|
|
141
141
|
return props.context;
|
|
142
142
|
},
|
|
143
|
+
get id() {
|
|
144
|
+
return props.block.id;
|
|
145
|
+
},
|
|
143
146
|
[qwik._IMMUTABLE]: {
|
|
144
147
|
block: qwik._fnSignal((p0) => p0.value, [
|
|
145
148
|
processedBlock
|
|
146
149
|
], "p0.value"),
|
|
147
150
|
context: qwik._fnSignal((p0) => p0.context, [
|
|
148
151
|
props
|
|
149
|
-
], "p0.context")
|
|
152
|
+
], "p0.context"),
|
|
153
|
+
id: qwik._fnSignal((p0) => p0.block.id, [
|
|
154
|
+
props
|
|
155
|
+
], "p0.block.id")
|
|
150
156
|
}
|
|
151
157
|
}, 3, "jN_0"),
|
|
152
158
|
!((_a = blockComponent.value) == null ? void 0 : _a.noWrap) ? !repeatItem.value ? /* @__PURE__ */ qwik._jsxC(blockWrapper.BlockWrapper, {
|
|
@@ -5,10 +5,10 @@ import { getBlockComponentOptions } from "../../functions/get-block-component-op
|
|
|
5
5
|
import { getProcessedBlock } from "../../functions/get-processed-block.qwik.mjs";
|
|
6
6
|
import { bindAnimations } from "./animator.qwik.mjs";
|
|
7
7
|
import { getRepeatItemData, getComponent, provideBuilderBlock, provideBuilderContext, provideLinkComponent, provideRegisteredComponents, generateKey } from "./block.helpers.qwik.mjs";
|
|
8
|
-
import { BlockStyles } from "./components/block-styles.qwik.mjs";
|
|
9
8
|
import { BlockWrapper } from "./components/block-wrapper.qwik.mjs";
|
|
10
9
|
import { ComponentRef } from "./components/component-ref/component-ref.qwik.mjs";
|
|
11
10
|
import { RepeatedBlock } from "./components/repeated-block.qwik.mjs";
|
|
11
|
+
import { StyleWrapper } from "./components/style-wrapper.qwik.mjs";
|
|
12
12
|
const Block = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) => {
|
|
13
13
|
var _a;
|
|
14
14
|
_jsxBranch();
|
|
@@ -131,20 +131,26 @@ const Block = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) =>
|
|
|
131
131
|
return /* @__PURE__ */ _jsxC(Fragment, {
|
|
132
132
|
children: canShowBlock.value ? /* @__PURE__ */ _jsxC(Fragment, {
|
|
133
133
|
children: [
|
|
134
|
-
/* @__PURE__ */ _jsxC(
|
|
134
|
+
/* @__PURE__ */ _jsxC(StyleWrapper, {
|
|
135
135
|
get block() {
|
|
136
136
|
return processedBlock.value;
|
|
137
137
|
},
|
|
138
138
|
get context() {
|
|
139
139
|
return props.context;
|
|
140
140
|
},
|
|
141
|
+
get id() {
|
|
142
|
+
return props.block.id;
|
|
143
|
+
},
|
|
141
144
|
[_IMMUTABLE]: {
|
|
142
145
|
block: _fnSignal((p0) => p0.value, [
|
|
143
146
|
processedBlock
|
|
144
147
|
], "p0.value"),
|
|
145
148
|
context: _fnSignal((p0) => p0.context, [
|
|
146
149
|
props
|
|
147
|
-
], "p0.context")
|
|
150
|
+
], "p0.context"),
|
|
151
|
+
id: _fnSignal((p0) => p0.block.id, [
|
|
152
|
+
props
|
|
153
|
+
], "p0.block.id")
|
|
148
154
|
}
|
|
149
155
|
}, 3, "jN_0"),
|
|
150
156
|
!((_a = blockComponent.value) == null ? void 0 : _a.noWrap) ? !repeatItem.value ? /* @__PURE__ */ _jsxC(BlockWrapper, {
|
|
@@ -4,7 +4,10 @@ const qwik = require("@builder.io/qwik");
|
|
|
4
4
|
const jsxRuntime = require("@builder.io/qwik/jsx-runtime");
|
|
5
5
|
const getBlockActions = require("../../../functions/get-block-actions.qwik.cjs");
|
|
6
6
|
const getBlockProperties = require("../../../functions/get-block-properties.qwik.cjs");
|
|
7
|
+
require("../../../helpers/user-attributes.qwik.cjs");
|
|
8
|
+
require("../../../functions/get-fetch.qwik.cjs");
|
|
7
9
|
const awaiter = require("../../awaiter.qwik.cjs");
|
|
10
|
+
require("../../../context/builder.context.qwik.cjs");
|
|
8
11
|
const InteractiveElement = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
|
|
9
12
|
qwik._jsxBranch();
|
|
10
13
|
const attributes = qwik.useComputedQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
|
|
@@ -79,8 +82,8 @@ const InteractiveElement = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwi
|
|
|
79
82
|
...targetWrapperProps.value,
|
|
80
83
|
attributes: attributes.value,
|
|
81
84
|
key: "wrapper-" + state.forceRenderCount
|
|
82
|
-
}, /* @__PURE__ */ qwik._jsxC(qwik.Slot, null, 3, "
|
|
83
|
-
}, 1, "
|
|
85
|
+
}, /* @__PURE__ */ qwik._jsxC(qwik.Slot, null, 3, "q0_4"))
|
|
86
|
+
}, 1, "q0_5");
|
|
84
87
|
}, "InteractiveElement_component_0UqfJpjhn0g"));
|
|
85
88
|
exports.InteractiveElement = InteractiveElement;
|
|
86
89
|
exports.default = InteractiveElement;
|
|
@@ -2,7 +2,10 @@ import { componentQrl, inlinedQrl, _jsxBranch, useComputedQrl, useLexicalScope,
|
|
|
2
2
|
import { Fragment } from "@builder.io/qwik/jsx-runtime";
|
|
3
3
|
import { getBlockActions } from "../../../functions/get-block-actions.qwik.mjs";
|
|
4
4
|
import { getBlockProperties } from "../../../functions/get-block-properties.qwik.mjs";
|
|
5
|
+
import "../../../helpers/user-attributes.qwik.mjs";
|
|
6
|
+
import "../../../functions/get-fetch.qwik.mjs";
|
|
5
7
|
import { Awaiter } from "../../awaiter.qwik.mjs";
|
|
8
|
+
import "../../../context/builder.context.qwik.mjs";
|
|
6
9
|
const InteractiveElement = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) => {
|
|
7
10
|
_jsxBranch();
|
|
8
11
|
const attributes = useComputedQrl(/* @__PURE__ */ inlinedQrl(() => {
|
|
@@ -77,8 +80,8 @@ const InteractiveElement = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQ
|
|
|
77
80
|
...targetWrapperProps.value,
|
|
78
81
|
attributes: attributes.value,
|
|
79
82
|
key: "wrapper-" + state.forceRenderCount
|
|
80
|
-
}, /* @__PURE__ */ _jsxC(Slot, null, 3, "
|
|
81
|
-
}, 1, "
|
|
83
|
+
}, /* @__PURE__ */ _jsxC(Slot, null, 3, "q0_4"))
|
|
84
|
+
}, 1, "q0_5");
|
|
82
85
|
}, "InteractiveElement_component_0UqfJpjhn0g"));
|
|
83
86
|
export {
|
|
84
87
|
InteractiveElement,
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
|
+
const qwik = require("@builder.io/qwik");
|
|
4
|
+
const jsxRuntime = require("@builder.io/qwik/jsx-runtime");
|
|
5
|
+
const builder_context = require("../../../context/builder.context.qwik.cjs");
|
|
6
|
+
const blockStyles = require("./block-styles.qwik.cjs");
|
|
7
|
+
require("@builder.io/qwik/build");
|
|
8
|
+
const StyleWrapper = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
|
|
9
|
+
qwik._jsxBranch();
|
|
10
|
+
qwik.useContext(builder_context);
|
|
11
|
+
const state = qwik.useStore({
|
|
12
|
+
isClientEditing: false,
|
|
13
|
+
isHydrated: false
|
|
14
|
+
});
|
|
15
|
+
qwik.useVisibleTaskQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
|
|
16
|
+
}, "StyleWrapper_component_useVisibleTask_7i19DZr5064"));
|
|
17
|
+
return /* @__PURE__ */ qwik._jsxC(jsxRuntime.Fragment, {
|
|
18
|
+
children: state.isHydrated ? /* @__PURE__ */ qwik._jsxC(blockStyles.BlockStyles, {
|
|
19
|
+
get block() {
|
|
20
|
+
return props.block;
|
|
21
|
+
},
|
|
22
|
+
get context() {
|
|
23
|
+
return props.context;
|
|
24
|
+
},
|
|
25
|
+
[qwik._IMMUTABLE]: {
|
|
26
|
+
block: qwik._fnSignal((p0) => p0.block, [
|
|
27
|
+
props
|
|
28
|
+
], "p0.block"),
|
|
29
|
+
context: qwik._fnSignal((p0) => p0.context, [
|
|
30
|
+
props
|
|
31
|
+
], "p0.context")
|
|
32
|
+
}
|
|
33
|
+
}, 3, "Ei_1") : /* @__PURE__ */ qwik._jsxC(blockStyles.BlockStyles, {
|
|
34
|
+
get block() {
|
|
35
|
+
return props.block;
|
|
36
|
+
},
|
|
37
|
+
get context() {
|
|
38
|
+
return props.context;
|
|
39
|
+
},
|
|
40
|
+
[qwik._IMMUTABLE]: {
|
|
41
|
+
block: qwik._fnSignal((p0) => p0.block, [
|
|
42
|
+
props
|
|
43
|
+
], "p0.block"),
|
|
44
|
+
context: qwik._fnSignal((p0) => p0.context, [
|
|
45
|
+
props
|
|
46
|
+
], "p0.context")
|
|
47
|
+
}
|
|
48
|
+
}, 3, "Ei_2")
|
|
49
|
+
}, 1, "Ei_3");
|
|
50
|
+
}, "StyleWrapper_component_LTSEjsY8B70"));
|
|
51
|
+
exports.StyleWrapper = StyleWrapper;
|
|
52
|
+
exports.default = StyleWrapper;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { componentQrl, inlinedQrl, _jsxBranch, useContext, useStore, useVisibleTaskQrl, _jsxC, _IMMUTABLE, _fnSignal } from "@builder.io/qwik";
|
|
2
|
+
import { Fragment } from "@builder.io/qwik/jsx-runtime";
|
|
3
|
+
import builderContext from "../../../context/builder.context.qwik.mjs";
|
|
4
|
+
import { BlockStyles } from "./block-styles.qwik.mjs";
|
|
5
|
+
import "@builder.io/qwik/build";
|
|
6
|
+
const StyleWrapper = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) => {
|
|
7
|
+
_jsxBranch();
|
|
8
|
+
useContext(builderContext);
|
|
9
|
+
const state = useStore({
|
|
10
|
+
isClientEditing: false,
|
|
11
|
+
isHydrated: false
|
|
12
|
+
});
|
|
13
|
+
useVisibleTaskQrl(/* @__PURE__ */ inlinedQrl(() => {
|
|
14
|
+
}, "StyleWrapper_component_useVisibleTask_7i19DZr5064"));
|
|
15
|
+
return /* @__PURE__ */ _jsxC(Fragment, {
|
|
16
|
+
children: state.isHydrated ? /* @__PURE__ */ _jsxC(BlockStyles, {
|
|
17
|
+
get block() {
|
|
18
|
+
return props.block;
|
|
19
|
+
},
|
|
20
|
+
get context() {
|
|
21
|
+
return props.context;
|
|
22
|
+
},
|
|
23
|
+
[_IMMUTABLE]: {
|
|
24
|
+
block: _fnSignal((p0) => p0.block, [
|
|
25
|
+
props
|
|
26
|
+
], "p0.block"),
|
|
27
|
+
context: _fnSignal((p0) => p0.context, [
|
|
28
|
+
props
|
|
29
|
+
], "p0.context")
|
|
30
|
+
}
|
|
31
|
+
}, 3, "Ei_1") : /* @__PURE__ */ _jsxC(BlockStyles, {
|
|
32
|
+
get block() {
|
|
33
|
+
return props.block;
|
|
34
|
+
},
|
|
35
|
+
get context() {
|
|
36
|
+
return props.context;
|
|
37
|
+
},
|
|
38
|
+
[_IMMUTABLE]: {
|
|
39
|
+
block: _fnSignal((p0) => p0.block, [
|
|
40
|
+
props
|
|
41
|
+
], "p0.block"),
|
|
42
|
+
context: _fnSignal((p0) => p0.context, [
|
|
43
|
+
props
|
|
44
|
+
], "p0.context")
|
|
45
|
+
}
|
|
46
|
+
}, 3, "Ei_2")
|
|
47
|
+
}, 1, "Ei_3");
|
|
48
|
+
}, "StyleWrapper_component_LTSEjsY8B70"));
|
|
49
|
+
export {
|
|
50
|
+
StyleWrapper,
|
|
51
|
+
StyleWrapper as default
|
|
52
|
+
};
|
|
@@ -20,7 +20,7 @@ const initEditing = require("../../../scripts/init-editing.qwik.cjs");
|
|
|
20
20
|
const animator = require("../../block/animator.qwik.cjs");
|
|
21
21
|
const enableEditor_helpers = require("./enable-editor.helpers.qwik.cjs");
|
|
22
22
|
const styles_helpers = require("./styles.helpers.qwik.cjs");
|
|
23
|
-
const mergeNewRootState = function mergeNewRootState2(props, state, showContentProps, elementRef, newData) {
|
|
23
|
+
const mergeNewRootState = function mergeNewRootState2(props, state, showContentProps, elementRef, newData, editType) {
|
|
24
24
|
var _a, _b;
|
|
25
25
|
const combinedState = {
|
|
26
26
|
...props.builderContextSignal.rootState,
|
|
@@ -30,8 +30,12 @@ const mergeNewRootState = function mergeNewRootState2(props, state, showContentP
|
|
|
30
30
|
(_b = (_a = props.builderContextSignal).rootSetState) == null ? void 0 : _b.call(_a, combinedState);
|
|
31
31
|
else
|
|
32
32
|
props.builderContextSignal.rootState = combinedState;
|
|
33
|
+
if (props.builderContextSignal.rootSetState)
|
|
34
|
+
props.builderContextSignal.rootSetState(combinedState);
|
|
35
|
+
else
|
|
36
|
+
props.builderContextSignal.rootState = combinedState;
|
|
33
37
|
};
|
|
34
|
-
const mergeNewContent = function mergeNewContent2(props, state, showContentProps, elementRef, newContent) {
|
|
38
|
+
const mergeNewContent = function mergeNewContent2(props, state, showContentProps, elementRef, newContent, editType) {
|
|
35
39
|
var _a, _b, _c, _d, _e;
|
|
36
40
|
const newContentValue = {
|
|
37
41
|
...props.builderContextSignal.content,
|
|
@@ -68,10 +72,10 @@ const processMessage = function processMessage2(props, state, showContentProps,
|
|
|
68
72
|
animation: (animation) => {
|
|
69
73
|
animator.triggerAnimation(animation);
|
|
70
74
|
},
|
|
71
|
-
contentUpdate: (newContent) => {
|
|
75
|
+
contentUpdate: (newContent, editType) => {
|
|
72
76
|
mergeNewContent(props, state, showContentProps, elementRef, newContent);
|
|
73
77
|
},
|
|
74
|
-
stateUpdate: (newState) => {
|
|
78
|
+
stateUpdate: (newState, editType) => {
|
|
75
79
|
mergeNewRootState(props, state, showContentProps, elementRef, newState);
|
|
76
80
|
}
|
|
77
81
|
}
|
|
@@ -172,6 +176,7 @@ const EnableEditor = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inli
|
|
|
172
176
|
const state = qwik.useStore({
|
|
173
177
|
ContentWrapper: props.contentWrapper || "div",
|
|
174
178
|
clicked: false,
|
|
179
|
+
contextValue: props.builderContextSignal,
|
|
175
180
|
hasExecuted: false,
|
|
176
181
|
httpReqsData: {},
|
|
177
182
|
httpReqsPending: {},
|
|
@@ -18,7 +18,7 @@ import { setupBrowserForEditing } from "../../../scripts/init-editing.qwik.mjs";
|
|
|
18
18
|
import { triggerAnimation } from "../../block/animator.qwik.mjs";
|
|
19
19
|
import { needsElementRefDivForEditing } from "./enable-editor.helpers.qwik.mjs";
|
|
20
20
|
import { getWrapperClassName } from "./styles.helpers.qwik.mjs";
|
|
21
|
-
const mergeNewRootState = function mergeNewRootState2(props, state, showContentProps, elementRef, newData) {
|
|
21
|
+
const mergeNewRootState = function mergeNewRootState2(props, state, showContentProps, elementRef, newData, editType) {
|
|
22
22
|
var _a, _b;
|
|
23
23
|
const combinedState = {
|
|
24
24
|
...props.builderContextSignal.rootState,
|
|
@@ -28,8 +28,12 @@ const mergeNewRootState = function mergeNewRootState2(props, state, showContentP
|
|
|
28
28
|
(_b = (_a = props.builderContextSignal).rootSetState) == null ? void 0 : _b.call(_a, combinedState);
|
|
29
29
|
else
|
|
30
30
|
props.builderContextSignal.rootState = combinedState;
|
|
31
|
+
if (props.builderContextSignal.rootSetState)
|
|
32
|
+
props.builderContextSignal.rootSetState(combinedState);
|
|
33
|
+
else
|
|
34
|
+
props.builderContextSignal.rootState = combinedState;
|
|
31
35
|
};
|
|
32
|
-
const mergeNewContent = function mergeNewContent2(props, state, showContentProps, elementRef, newContent) {
|
|
36
|
+
const mergeNewContent = function mergeNewContent2(props, state, showContentProps, elementRef, newContent, editType) {
|
|
33
37
|
var _a, _b, _c, _d, _e;
|
|
34
38
|
const newContentValue = {
|
|
35
39
|
...props.builderContextSignal.content,
|
|
@@ -66,10 +70,10 @@ const processMessage = function processMessage2(props, state, showContentProps,
|
|
|
66
70
|
animation: (animation) => {
|
|
67
71
|
triggerAnimation(animation);
|
|
68
72
|
},
|
|
69
|
-
contentUpdate: (newContent) => {
|
|
73
|
+
contentUpdate: (newContent, editType) => {
|
|
70
74
|
mergeNewContent(props, state, showContentProps, elementRef, newContent);
|
|
71
75
|
},
|
|
72
|
-
stateUpdate: (newState) => {
|
|
76
|
+
stateUpdate: (newState, editType) => {
|
|
73
77
|
mergeNewRootState(props, state, showContentProps, elementRef, newState);
|
|
74
78
|
}
|
|
75
79
|
}
|
|
@@ -170,6 +174,7 @@ const EnableEditor = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((pr
|
|
|
170
174
|
const state = useStore({
|
|
171
175
|
ContentWrapper: props.contentWrapper || "div",
|
|
172
176
|
clicked: false,
|
|
177
|
+
contextValue: props.builderContextSignal,
|
|
173
178
|
hasExecuted: false,
|
|
174
179
|
httpReqsData: {},
|
|
175
180
|
httpReqsPending: {},
|
|
@@ -21,15 +21,9 @@ const generateContentUrl = (options) => {
|
|
|
21
21
|
url.searchParams.set("limit", String(limit));
|
|
22
22
|
url.searchParams.set("noTraverse", String(noTraverse));
|
|
23
23
|
url.searchParams.set("includeRefs", String(true));
|
|
24
|
-
|
|
24
|
+
if (locale)
|
|
25
|
+
url.searchParams.set("locale", locale);
|
|
25
26
|
let finalUserAttributes = userAttributes || {};
|
|
26
|
-
if (finalLocale) {
|
|
27
|
-
url.searchParams.set("locale", finalLocale);
|
|
28
|
-
finalUserAttributes = {
|
|
29
|
-
locale: finalLocale,
|
|
30
|
-
...finalUserAttributes
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
27
|
if (enrich)
|
|
34
28
|
url.searchParams.set("enrich", String(enrich));
|
|
35
29
|
url.searchParams.set("omit", omit ?? "meta.componentsUsed");
|
|
@@ -19,15 +19,9 @@ const generateContentUrl = (options) => {
|
|
|
19
19
|
url.searchParams.set("limit", String(limit));
|
|
20
20
|
url.searchParams.set("noTraverse", String(noTraverse));
|
|
21
21
|
url.searchParams.set("includeRefs", String(true));
|
|
22
|
-
|
|
22
|
+
if (locale)
|
|
23
|
+
url.searchParams.set("locale", locale);
|
|
23
24
|
let finalUserAttributes = userAttributes || {};
|
|
24
|
-
if (finalLocale) {
|
|
25
|
-
url.searchParams.set("locale", finalLocale);
|
|
26
|
-
finalUserAttributes = {
|
|
27
|
-
locale: finalLocale,
|
|
28
|
-
...finalUserAttributes
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
25
|
if (enrich)
|
|
32
26
|
url.searchParams.set("enrich", String(enrich));
|
|
33
27
|
url.searchParams.set("omit", omit ?? "meta.componentsUsed");
|
|
@@ -10,6 +10,15 @@ const isBrowser = require("../is-browser.qwik.cjs");
|
|
|
10
10
|
const generateContentUrl = require("./generate-content-url.qwik.cjs");
|
|
11
11
|
const checkContentHasResults = (content) => "results" in content;
|
|
12
12
|
async function fetchOneEntry(options) {
|
|
13
|
+
var _a;
|
|
14
|
+
const finalLocale = options.locale || ((_a = options.userAttributes) == null ? void 0 : _a.locale);
|
|
15
|
+
if (finalLocale) {
|
|
16
|
+
options.locale = finalLocale;
|
|
17
|
+
options.userAttributes = {
|
|
18
|
+
locale: finalLocale,
|
|
19
|
+
...options.userAttributes
|
|
20
|
+
};
|
|
21
|
+
}
|
|
13
22
|
const allContent = await fetchEntries({
|
|
14
23
|
...options,
|
|
15
24
|
limit: 1
|