@builder.io/sdk-qwik 0.20.1 → 0.22.1
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/form/form/form.qwik.cjs +5 -1
- package/lib/browser/blocks/form/form/form.qwik.mjs +5 -1
- 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/symbol/symbol.qwik.cjs +13 -6
- package/lib/browser/blocks/symbol/symbol.qwik.mjs +13 -6
- package/lib/browser/blocks/tabs/tabs.qwik.cjs +5 -3
- package/lib/browser/blocks/tabs/tabs.qwik.mjs +5 -3
- 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/component-ref/component-ref.qwik.cjs +2 -9
- package/lib/browser/components/block/components/component-ref/component-ref.qwik.mjs +3 -10
- 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 +27 -9
- package/lib/browser/components/content/components/enable-editor.qwik.mjs +27 -9
- 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/helpers/subscribe-to-editor.qwik.cjs +4 -2
- package/lib/browser/helpers/subscribe-to-editor.qwik.mjs +4 -2
- package/lib/edge/blocks/form/form/form.qwik.cjs +5 -1
- package/lib/edge/blocks/form/form/form.qwik.mjs +5 -1
- 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/symbol/symbol.qwik.cjs +13 -6
- package/lib/edge/blocks/symbol/symbol.qwik.mjs +13 -6
- package/lib/edge/blocks/tabs/tabs.qwik.cjs +5 -3
- package/lib/edge/blocks/tabs/tabs.qwik.mjs +5 -3
- 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/component-ref/component-ref.qwik.cjs +2 -9
- package/lib/edge/components/block/components/component-ref/component-ref.qwik.mjs +3 -10
- 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 +27 -9
- package/lib/edge/components/content/components/enable-editor.qwik.mjs +27 -9
- 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/helpers/subscribe-to-editor.qwik.cjs +4 -2
- package/lib/edge/helpers/subscribe-to-editor.qwik.mjs +4 -2
- package/lib/node/blocks/form/form/form.qwik.cjs +5 -1
- package/lib/node/blocks/form/form/form.qwik.mjs +5 -1
- 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/symbol/symbol.qwik.cjs +13 -6
- package/lib/node/blocks/symbol/symbol.qwik.mjs +13 -6
- package/lib/node/blocks/tabs/tabs.qwik.cjs +5 -3
- package/lib/node/blocks/tabs/tabs.qwik.mjs +5 -3
- 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/component-ref/component-ref.qwik.cjs +2 -9
- package/lib/node/components/block/components/component-ref/component-ref.qwik.mjs +3 -10
- 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 +27 -9
- package/lib/node/components/content/components/enable-editor.qwik.mjs +27 -9
- 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/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/form/form/form.d.ts +1 -0
- package/types/src/blocks/img/img.d.ts +2 -0
- package/types/src/blocks/symbol/symbol.d.ts +1 -1
- package/types/src/blocks/symbol/symbol.types.d.ts +1 -2
- package/types/src/blocks/tabs/tabs.d.ts +1 -0
- package/types/src/components/awaiter.d.ts +1 -11
- package/types/src/components/awaiter.types.d.ts +7 -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/helpers/find-block.d.ts +18 -0
- package/types/src/helpers/subscribe-to-editor.d.ts +3 -2
|
@@ -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
|
}
|
|
@@ -126,11 +130,14 @@ const runHttpRequests = function runHttpRequests2(props, state, showContentProps
|
|
|
126
130
|
method: "GET"
|
|
127
131
|
};
|
|
128
132
|
logFetch.logFetch(JSON.stringify(fetchRequestObj));
|
|
129
|
-
|
|
133
|
+
const fetchOptions = {
|
|
130
134
|
method: fetchRequestObj.method,
|
|
131
135
|
headers: fetchRequestObj.headers,
|
|
132
136
|
body: fetchRequestObj.body
|
|
133
|
-
}
|
|
137
|
+
};
|
|
138
|
+
if (fetchRequestObj.method === "GET")
|
|
139
|
+
delete fetchOptions.body;
|
|
140
|
+
fetch(fetchRequestObj.url, fetchOptions).then((response) => response.json()).then((json) => {
|
|
134
141
|
mergeNewRootState(props, state, showContentProps, elementRef, {
|
|
135
142
|
[key]: json
|
|
136
143
|
});
|
|
@@ -169,9 +176,12 @@ const EnableEditor = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inli
|
|
|
169
176
|
const state = qwik.useStore({
|
|
170
177
|
ContentWrapper: props.contentWrapper || "div",
|
|
171
178
|
clicked: false,
|
|
179
|
+
contextValue: props.builderContextSignal,
|
|
172
180
|
hasExecuted: false,
|
|
173
181
|
httpReqsData: {},
|
|
174
|
-
httpReqsPending: {}
|
|
182
|
+
httpReqsPending: {},
|
|
183
|
+
prevData: null,
|
|
184
|
+
prevLocale: ""
|
|
175
185
|
}, {
|
|
176
186
|
deep: true
|
|
177
187
|
});
|
|
@@ -305,8 +315,12 @@ const EnableEditor = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inli
|
|
|
305
315
|
qwik.useTaskQrl(/* @__PURE__ */ qwik.inlinedQrl(({ track }) => {
|
|
306
316
|
const [elementRef2, props2, showContentProps2, state2] = qwik.useLexicalScope();
|
|
307
317
|
track(() => props2.data);
|
|
308
|
-
if (props2.data)
|
|
318
|
+
if (props2.data) {
|
|
319
|
+
if (state2.prevData === props2.data)
|
|
320
|
+
return;
|
|
309
321
|
mergeNewRootState(props2, state2, showContentProps2, elementRef2, props2.data);
|
|
322
|
+
state2.prevData = props2.data;
|
|
323
|
+
}
|
|
310
324
|
}, "EnableEditor_component_useTask_3_bQ0e5LHZwWE", [
|
|
311
325
|
elementRef,
|
|
312
326
|
props,
|
|
@@ -316,10 +330,14 @@ const EnableEditor = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inli
|
|
|
316
330
|
qwik.useTaskQrl(/* @__PURE__ */ qwik.inlinedQrl(({ track }) => {
|
|
317
331
|
const [elementRef2, props2, showContentProps2, state2] = qwik.useLexicalScope();
|
|
318
332
|
track(() => props2.locale);
|
|
319
|
-
if (props2.locale)
|
|
333
|
+
if (props2.locale) {
|
|
334
|
+
if (state2.prevLocale === props2.locale)
|
|
335
|
+
return;
|
|
320
336
|
mergeNewRootState(props2, state2, showContentProps2, elementRef2, {
|
|
321
337
|
locale: props2.locale
|
|
322
338
|
});
|
|
339
|
+
state2.prevLocale = props2.locale;
|
|
340
|
+
}
|
|
323
341
|
}, "EnableEditor_component_useTask_4_moHYZG8uNVU", [
|
|
324
342
|
elementRef,
|
|
325
343
|
props,
|
|
@@ -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
|
}
|
|
@@ -124,11 +128,14 @@ const runHttpRequests = function runHttpRequests2(props, state, showContentProps
|
|
|
124
128
|
method: "GET"
|
|
125
129
|
};
|
|
126
130
|
logFetch(JSON.stringify(fetchRequestObj));
|
|
127
|
-
|
|
131
|
+
const fetchOptions = {
|
|
128
132
|
method: fetchRequestObj.method,
|
|
129
133
|
headers: fetchRequestObj.headers,
|
|
130
134
|
body: fetchRequestObj.body
|
|
131
|
-
}
|
|
135
|
+
};
|
|
136
|
+
if (fetchRequestObj.method === "GET")
|
|
137
|
+
delete fetchOptions.body;
|
|
138
|
+
fetch(fetchRequestObj.url, fetchOptions).then((response) => response.json()).then((json) => {
|
|
132
139
|
mergeNewRootState(props, state, showContentProps, elementRef, {
|
|
133
140
|
[key]: json
|
|
134
141
|
});
|
|
@@ -167,9 +174,12 @@ const EnableEditor = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((pr
|
|
|
167
174
|
const state = useStore({
|
|
168
175
|
ContentWrapper: props.contentWrapper || "div",
|
|
169
176
|
clicked: false,
|
|
177
|
+
contextValue: props.builderContextSignal,
|
|
170
178
|
hasExecuted: false,
|
|
171
179
|
httpReqsData: {},
|
|
172
|
-
httpReqsPending: {}
|
|
180
|
+
httpReqsPending: {},
|
|
181
|
+
prevData: null,
|
|
182
|
+
prevLocale: ""
|
|
173
183
|
}, {
|
|
174
184
|
deep: true
|
|
175
185
|
});
|
|
@@ -303,8 +313,12 @@ const EnableEditor = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((pr
|
|
|
303
313
|
useTaskQrl(/* @__PURE__ */ inlinedQrl(({ track }) => {
|
|
304
314
|
const [elementRef2, props2, showContentProps2, state2] = useLexicalScope();
|
|
305
315
|
track(() => props2.data);
|
|
306
|
-
if (props2.data)
|
|
316
|
+
if (props2.data) {
|
|
317
|
+
if (state2.prevData === props2.data)
|
|
318
|
+
return;
|
|
307
319
|
mergeNewRootState(props2, state2, showContentProps2, elementRef2, props2.data);
|
|
320
|
+
state2.prevData = props2.data;
|
|
321
|
+
}
|
|
308
322
|
}, "EnableEditor_component_useTask_3_bQ0e5LHZwWE", [
|
|
309
323
|
elementRef,
|
|
310
324
|
props,
|
|
@@ -314,10 +328,14 @@ const EnableEditor = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((pr
|
|
|
314
328
|
useTaskQrl(/* @__PURE__ */ inlinedQrl(({ track }) => {
|
|
315
329
|
const [elementRef2, props2, showContentProps2, state2] = useLexicalScope();
|
|
316
330
|
track(() => props2.locale);
|
|
317
|
-
if (props2.locale)
|
|
331
|
+
if (props2.locale) {
|
|
332
|
+
if (state2.prevLocale === props2.locale)
|
|
333
|
+
return;
|
|
318
334
|
mergeNewRootState(props2, state2, showContentProps2, elementRef2, {
|
|
319
335
|
locale: props2.locale
|
|
320
336
|
});
|
|
337
|
+
state2.prevLocale = props2.locale;
|
|
338
|
+
}
|
|
321
339
|
}, "EnableEditor_component_useTask_4_moHYZG8uNVU", [
|
|
322
340
|
elementRef,
|
|
323
341
|
props,
|
|
@@ -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
|
|
@@ -8,6 +8,15 @@ import { isBrowser } from "../is-browser.qwik.mjs";
|
|
|
8
8
|
import { generateContentUrl } from "./generate-content-url.qwik.mjs";
|
|
9
9
|
const checkContentHasResults = (content) => "results" in content;
|
|
10
10
|
async function fetchOneEntry(options) {
|
|
11
|
+
var _a;
|
|
12
|
+
const finalLocale = options.locale || ((_a = options.userAttributes) == null ? void 0 : _a.locale);
|
|
13
|
+
if (finalLocale) {
|
|
14
|
+
options.locale = finalLocale;
|
|
15
|
+
options.userAttributes = {
|
|
16
|
+
locale: finalLocale,
|
|
17
|
+
...options.userAttributes
|
|
18
|
+
};
|
|
19
|
+
}
|
|
11
20
|
const allContent = await fetchEntries({
|
|
12
21
|
...options,
|
|
13
22
|
limit: 1
|
|
@@ -21,16 +21,18 @@ const createEditorListener = ({ model, trustedHosts, callbacks }) => {
|
|
|
21
21
|
const messageContent = data.data;
|
|
22
22
|
const modelName = messageContent.model;
|
|
23
23
|
const newState = messageContent == null ? void 0 : messageContent.state;
|
|
24
|
+
const editType = messageContent.editType;
|
|
24
25
|
if (modelName === model && newState)
|
|
25
|
-
callbacks.stateUpdate(newState);
|
|
26
|
+
callbacks.stateUpdate(newState, editType);
|
|
26
27
|
break;
|
|
27
28
|
}
|
|
28
29
|
case "builder.contentUpdate": {
|
|
29
30
|
const messageContent = data.data;
|
|
30
31
|
const key = messageContent.key || messageContent.alias || messageContent.entry || messageContent.modelName;
|
|
31
32
|
const contentData = messageContent.data;
|
|
33
|
+
const editType = messageContent.editType;
|
|
32
34
|
if (key === model)
|
|
33
|
-
callbacks.contentUpdate(contentData);
|
|
35
|
+
callbacks.contentUpdate(contentData, editType);
|
|
34
36
|
break;
|
|
35
37
|
}
|
|
36
38
|
}
|
|
@@ -19,16 +19,18 @@ const createEditorListener = ({ model, trustedHosts, callbacks }) => {
|
|
|
19
19
|
const messageContent = data.data;
|
|
20
20
|
const modelName = messageContent.model;
|
|
21
21
|
const newState = messageContent == null ? void 0 : messageContent.state;
|
|
22
|
+
const editType = messageContent.editType;
|
|
22
23
|
if (modelName === model && newState)
|
|
23
|
-
callbacks.stateUpdate(newState);
|
|
24
|
+
callbacks.stateUpdate(newState, editType);
|
|
24
25
|
break;
|
|
25
26
|
}
|
|
26
27
|
case "builder.contentUpdate": {
|
|
27
28
|
const messageContent = data.data;
|
|
28
29
|
const key = messageContent.key || messageContent.alias || messageContent.entry || messageContent.modelName;
|
|
29
30
|
const contentData = messageContent.data;
|
|
31
|
+
const editType = messageContent.editType;
|
|
30
32
|
if (key === model)
|
|
31
|
-
callbacks.contentUpdate(contentData);
|
|
33
|
+
callbacks.contentUpdate(contentData, editType);
|
|
32
34
|
break;
|
|
33
35
|
}
|
|
34
36
|
}
|
|
@@ -21,6 +21,9 @@ const mergeNewRootState = function mergeNewRootState2(props, state, formRef, new
|
|
|
21
21
|
const submissionState = function submissionState2(props, state, formRef) {
|
|
22
22
|
return isEditing.isEditing() && props.previewState || state.formState;
|
|
23
23
|
};
|
|
24
|
+
const errorResponse = function errorResponse2(props, state, formRef, response) {
|
|
25
|
+
return JSON.stringify(response, null, 2);
|
|
26
|
+
};
|
|
24
27
|
const onSubmit = function onSubmit2(props, state, formRef, event) {
|
|
25
28
|
var _a;
|
|
26
29
|
const sendWithJsProp = props.sendWithJs || props.sendSubmissionsTo === "email";
|
|
@@ -246,7 +249,7 @@ const FormComponent = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inl
|
|
|
246
249
|
}, 3, "0n_2") : null,
|
|
247
250
|
submissionState(props, state) === "error" && state.responseData ? /* @__PURE__ */ qwik._jsxQ("pre", null, {
|
|
248
251
|
class: "builder-form-error-text pre-FormComponent"
|
|
249
|
-
},
|
|
252
|
+
}, errorResponse(props, state, formRef, state.responseData), 1, "0n_3") : null,
|
|
250
253
|
submissionState(props, state) === "success" ? /* @__PURE__ */ qwik._jsxC(blocks.Blocks, {
|
|
251
254
|
path: "successMessage",
|
|
252
255
|
get blocks() {
|
|
@@ -297,6 +300,7 @@ const STYLES = `
|
|
|
297
300
|
exports.FormComponent = FormComponent;
|
|
298
301
|
exports.STYLES = STYLES;
|
|
299
302
|
exports.default = FormComponent;
|
|
303
|
+
exports.errorResponse = errorResponse;
|
|
300
304
|
exports.mergeNewRootState = mergeNewRootState;
|
|
301
305
|
exports.onSubmit = onSubmit;
|
|
302
306
|
exports.submissionState = submissionState;
|
|
@@ -19,6 +19,9 @@ const mergeNewRootState = function mergeNewRootState2(props, state, formRef, new
|
|
|
19
19
|
const submissionState = function submissionState2(props, state, formRef) {
|
|
20
20
|
return isEditing() && props.previewState || state.formState;
|
|
21
21
|
};
|
|
22
|
+
const errorResponse = function errorResponse2(props, state, formRef, response) {
|
|
23
|
+
return JSON.stringify(response, null, 2);
|
|
24
|
+
};
|
|
22
25
|
const onSubmit = function onSubmit2(props, state, formRef, event) {
|
|
23
26
|
var _a;
|
|
24
27
|
const sendWithJsProp = props.sendWithJs || props.sendSubmissionsTo === "email";
|
|
@@ -244,7 +247,7 @@ const FormComponent = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((p
|
|
|
244
247
|
}, 3, "0n_2") : null,
|
|
245
248
|
submissionState(props, state) === "error" && state.responseData ? /* @__PURE__ */ _jsxQ("pre", null, {
|
|
246
249
|
class: "builder-form-error-text pre-FormComponent"
|
|
247
|
-
},
|
|
250
|
+
}, errorResponse(props, state, formRef, state.responseData), 1, "0n_3") : null,
|
|
248
251
|
submissionState(props, state) === "success" ? /* @__PURE__ */ _jsxC(Blocks, {
|
|
249
252
|
path: "successMessage",
|
|
250
253
|
get blocks() {
|
|
@@ -296,6 +299,7 @@ export {
|
|
|
296
299
|
FormComponent,
|
|
297
300
|
STYLES,
|
|
298
301
|
FormComponent as default,
|
|
302
|
+
errorResponse,
|
|
299
303
|
mergeNewRootState,
|
|
300
304
|
onSubmit,
|
|
301
305
|
submissionState
|
|
@@ -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
|