@builder.io/sdk-qwik 0.20.0 → 0.21.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 +7 -3
- package/lib/browser/blocks/form/form/form.qwik.mjs +7 -3
- 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/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/content/components/enable-editor.qwik.cjs +18 -5
- package/lib/browser/components/content/components/enable-editor.qwik.mjs +18 -5
- package/lib/browser/constants/sdk-version.qwik.cjs +1 -1
- package/lib/browser/constants/sdk-version.qwik.mjs +1 -1
- package/lib/browser/functions/register.qwik.cjs +13 -0
- package/lib/browser/functions/register.qwik.mjs +14 -1
- package/lib/browser/index.qwik.cjs +1 -0
- package/lib/browser/index.qwik.mjs +2 -1
- package/lib/edge/blocks/form/form/form.qwik.cjs +7 -3
- package/lib/edge/blocks/form/form/form.qwik.mjs +7 -3
- 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/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/content/components/enable-editor.qwik.cjs +18 -5
- package/lib/edge/components/content/components/enable-editor.qwik.mjs +18 -5
- package/lib/edge/constants/sdk-version.qwik.cjs +1 -1
- package/lib/edge/constants/sdk-version.qwik.mjs +1 -1
- package/lib/edge/functions/register.qwik.cjs +13 -0
- package/lib/edge/functions/register.qwik.mjs +14 -1
- package/lib/edge/index.qwik.cjs +1 -0
- package/lib/edge/index.qwik.mjs +2 -1
- package/lib/node/blocks/form/form/form.qwik.cjs +7 -3
- package/lib/node/blocks/form/form/form.qwik.mjs +7 -3
- 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/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/content/components/enable-editor.qwik.cjs +18 -5
- package/lib/node/components/content/components/enable-editor.qwik.mjs +18 -5
- package/lib/node/constants/sdk-version.qwik.cjs +1 -1
- package/lib/node/constants/sdk-version.qwik.mjs +1 -1
- package/lib/node/functions/register.qwik.cjs +13 -0
- package/lib/node/functions/register.qwik.mjs +14 -1
- package/lib/node/index.qwik.cjs +1 -0
- package/lib/node/index.qwik.mjs +2 -1
- package/package.json +1 -1
- package/types/src/blocks/form/form/form.d.ts +1 -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/constants/sdk-version.d.ts +1 -1
- package/types/src/functions/register.d.ts +18 -0
- package/types/src/server-index.d.ts +1 -1
|
@@ -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";
|
|
@@ -36,13 +39,13 @@ const onSubmit = function onSubmit2(props, state, formRef, event) {
|
|
|
36
39
|
const headers = props.customHeaders || {};
|
|
37
40
|
let body;
|
|
38
41
|
const formData = new FormData(el);
|
|
39
|
-
const formPairs = Array.from(el.querySelectorAll("input,select,textarea")).filter((el2) => !!el2.name).map((el2) => {
|
|
42
|
+
const formPairs = Array.from(el.querySelectorAll("input,select,textarea")).filter((el2) => !!el2.name).filter((el2) => !!el2.name && (el2.type !== "radio" || el2.checked)).map((el2) => {
|
|
40
43
|
let value;
|
|
41
44
|
const key = el2.name;
|
|
42
45
|
if (el2 instanceof HTMLInputElement) {
|
|
43
46
|
if (el2.type === "radio") {
|
|
44
47
|
if (el2.checked) {
|
|
45
|
-
value = el2.
|
|
48
|
+
value = el2.value;
|
|
46
49
|
return {
|
|
47
50
|
key,
|
|
48
51
|
value
|
|
@@ -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";
|
|
@@ -34,13 +37,13 @@ const onSubmit = function onSubmit2(props, state, formRef, event) {
|
|
|
34
37
|
const headers = props.customHeaders || {};
|
|
35
38
|
let body;
|
|
36
39
|
const formData = new FormData(el);
|
|
37
|
-
const formPairs = Array.from(el.querySelectorAll("input,select,textarea")).filter((el2) => !!el2.name).map((el2) => {
|
|
40
|
+
const formPairs = Array.from(el.querySelectorAll("input,select,textarea")).filter((el2) => !!el2.name).filter((el2) => !!el2.name && (el2.type !== "radio" || el2.checked)).map((el2) => {
|
|
38
41
|
let value;
|
|
39
42
|
const key = el2.name;
|
|
40
43
|
if (el2 instanceof HTMLInputElement) {
|
|
41
44
|
if (el2.type === "radio") {
|
|
42
45
|
if (el2.checked) {
|
|
43
|
-
value = el2.
|
|
46
|
+
value = el2.value;
|
|
44
47
|
return {
|
|
45
48
|
key,
|
|
46
49
|
value
|
|
@@ -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
|
|
@@ -4,7 +4,7 @@ const qwik = require("@builder.io/qwik");
|
|
|
4
4
|
const contentVariants = require("../../components/content-variants/content-variants.qwik.cjs");
|
|
5
5
|
const getClassPropName = require("../../functions/get-class-prop-name.qwik.cjs");
|
|
6
6
|
const symbol_helpers = require("./symbol.helpers.qwik.cjs");
|
|
7
|
-
const setContent = function setContent2(props, state, blocksWrapper, contentWrapper, className) {
|
|
7
|
+
const setContent = function setContent2(props, state, blocksWrapper, contentWrapper, customComponents, className) {
|
|
8
8
|
var _a;
|
|
9
9
|
if (state.contentToUse && state.symbolEntry === ((_a = props.symbol) == null ? void 0 : _a.entry))
|
|
10
10
|
return;
|
|
@@ -27,6 +27,12 @@ const Symbol$1 = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQ
|
|
|
27
27
|
const contentWrapper = qwik.useComputedQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
|
|
28
28
|
return "div";
|
|
29
29
|
}, "Symbol_component_contentWrapper_useComputed_EvmPpPj8JTo"));
|
|
30
|
+
const customComponents = qwik.useComputedQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
|
|
31
|
+
const [props2] = qwik.useLexicalScope();
|
|
32
|
+
return Object.values(props2.builderComponents);
|
|
33
|
+
}, "Symbol_component_customComponents_useComputed_lTCqaqHUrNw", [
|
|
34
|
+
props
|
|
35
|
+
]));
|
|
30
36
|
const className = qwik.useComputedQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
|
|
31
37
|
var _a2, _b2;
|
|
32
38
|
const [props2] = qwik.useLexicalScope();
|
|
@@ -44,13 +50,14 @@ const Symbol$1 = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQ
|
|
|
44
50
|
symbolEntry: (_b = props.symbol) == null ? void 0 : _b.entry
|
|
45
51
|
});
|
|
46
52
|
qwik.useTaskQrl(/* @__PURE__ */ qwik.inlinedQrl(({ track }) => {
|
|
47
|
-
const [blocksWrapper2, className2, contentWrapper2, props2, state2] = qwik.useLexicalScope();
|
|
53
|
+
const [blocksWrapper2, className2, contentWrapper2, customComponents2, props2, state2] = qwik.useLexicalScope();
|
|
48
54
|
track(() => props2.symbol);
|
|
49
55
|
setContent(props2, state2);
|
|
50
56
|
}, "Symbol_component_useTask_NIAWAC1bMBo", [
|
|
51
57
|
blocksWrapper,
|
|
52
58
|
className,
|
|
53
59
|
contentWrapper,
|
|
60
|
+
customComponents,
|
|
54
61
|
props,
|
|
55
62
|
state
|
|
56
63
|
]));
|
|
@@ -75,7 +82,7 @@ const Symbol$1 = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQ
|
|
|
75
82
|
};
|
|
76
83
|
},
|
|
77
84
|
get customComponents() {
|
|
78
|
-
return
|
|
85
|
+
return customComponents.value;
|
|
79
86
|
},
|
|
80
87
|
get data() {
|
|
81
88
|
var _a2, _b2, _c;
|
|
@@ -132,9 +139,9 @@ const Symbol$1 = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQ
|
|
|
132
139
|
}, [
|
|
133
140
|
props
|
|
134
141
|
], "{...p0.builderContext.context,symbolId:p0.builderBlock?.id}"),
|
|
135
|
-
customComponents: qwik._fnSignal((p0) =>
|
|
136
|
-
|
|
137
|
-
], "
|
|
142
|
+
customComponents: qwik._fnSignal((p0) => p0.value, [
|
|
143
|
+
customComponents
|
|
144
|
+
], "p0.value"),
|
|
138
145
|
data: qwik._fnSignal((p0, p1) => {
|
|
139
146
|
var _a2, _b2, _c;
|
|
140
147
|
return {
|
|
@@ -2,7 +2,7 @@ import { componentQrl, inlinedQrl, useComputedQrl, useLexicalScope, useStore, us
|
|
|
2
2
|
import { ContentVariants } from "../../components/content-variants/content-variants.qwik.mjs";
|
|
3
3
|
import { getClassPropName } from "../../functions/get-class-prop-name.qwik.mjs";
|
|
4
4
|
import { fetchSymbolContent } from "./symbol.helpers.qwik.mjs";
|
|
5
|
-
const setContent = function setContent2(props, state, blocksWrapper, contentWrapper, className) {
|
|
5
|
+
const setContent = function setContent2(props, state, blocksWrapper, contentWrapper, customComponents, className) {
|
|
6
6
|
var _a;
|
|
7
7
|
if (state.contentToUse && state.symbolEntry === ((_a = props.symbol) == null ? void 0 : _a.entry))
|
|
8
8
|
return;
|
|
@@ -25,6 +25,12 @@ const Symbol$1 = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props)
|
|
|
25
25
|
const contentWrapper = useComputedQrl(/* @__PURE__ */ inlinedQrl(() => {
|
|
26
26
|
return "div";
|
|
27
27
|
}, "Symbol_component_contentWrapper_useComputed_EvmPpPj8JTo"));
|
|
28
|
+
const customComponents = useComputedQrl(/* @__PURE__ */ inlinedQrl(() => {
|
|
29
|
+
const [props2] = useLexicalScope();
|
|
30
|
+
return Object.values(props2.builderComponents);
|
|
31
|
+
}, "Symbol_component_customComponents_useComputed_lTCqaqHUrNw", [
|
|
32
|
+
props
|
|
33
|
+
]));
|
|
28
34
|
const className = useComputedQrl(/* @__PURE__ */ inlinedQrl(() => {
|
|
29
35
|
var _a2, _b2;
|
|
30
36
|
const [props2] = useLexicalScope();
|
|
@@ -42,13 +48,14 @@ const Symbol$1 = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props)
|
|
|
42
48
|
symbolEntry: (_b = props.symbol) == null ? void 0 : _b.entry
|
|
43
49
|
});
|
|
44
50
|
useTaskQrl(/* @__PURE__ */ inlinedQrl(({ track }) => {
|
|
45
|
-
const [blocksWrapper2, className2, contentWrapper2, props2, state2] = useLexicalScope();
|
|
51
|
+
const [blocksWrapper2, className2, contentWrapper2, customComponents2, props2, state2] = useLexicalScope();
|
|
46
52
|
track(() => props2.symbol);
|
|
47
53
|
setContent(props2, state2);
|
|
48
54
|
}, "Symbol_component_useTask_NIAWAC1bMBo", [
|
|
49
55
|
blocksWrapper,
|
|
50
56
|
className,
|
|
51
57
|
contentWrapper,
|
|
58
|
+
customComponents,
|
|
52
59
|
props,
|
|
53
60
|
state
|
|
54
61
|
]));
|
|
@@ -73,7 +80,7 @@ const Symbol$1 = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props)
|
|
|
73
80
|
};
|
|
74
81
|
},
|
|
75
82
|
get customComponents() {
|
|
76
|
-
return
|
|
83
|
+
return customComponents.value;
|
|
77
84
|
},
|
|
78
85
|
get data() {
|
|
79
86
|
var _a2, _b2, _c;
|
|
@@ -130,9 +137,9 @@ const Symbol$1 = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props)
|
|
|
130
137
|
}, [
|
|
131
138
|
props
|
|
132
139
|
], "{...p0.builderContext.context,symbolId:p0.builderBlock?.id}"),
|
|
133
|
-
customComponents: _fnSignal((p0) =>
|
|
134
|
-
|
|
135
|
-
], "
|
|
140
|
+
customComponents: _fnSignal((p0) => p0.value, [
|
|
141
|
+
customComponents
|
|
142
|
+
], "p0.value"),
|
|
136
143
|
data: _fnSignal((p0, p1) => {
|
|
137
144
|
var _a2, _b2, _c;
|
|
138
145
|
return {
|
|
@@ -5,6 +5,9 @@ const blocks = require("../../components/blocks/blocks.qwik.cjs");
|
|
|
5
5
|
const activeTabContent = function activeTabContent2(props, state, active) {
|
|
6
6
|
return props.tabs && props.tabs[active].content;
|
|
7
7
|
};
|
|
8
|
+
const getTabStyle = function getTabStyle2(props, state, index) {
|
|
9
|
+
return index === state.activeTab ? props.activeTabStyle : {};
|
|
10
|
+
};
|
|
8
11
|
const onClick = function onClick2(props, state, index) {
|
|
9
12
|
if (index === state.activeTab && props.collapsible)
|
|
10
13
|
state.activeTab = -1;
|
|
@@ -38,9 +41,7 @@ const Tabs = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((
|
|
|
38
41
|
props,
|
|
39
42
|
state
|
|
40
43
|
]),
|
|
41
|
-
style:
|
|
42
|
-
...state.activeTab === index ? props.activeTabStyle : {}
|
|
43
|
-
}
|
|
44
|
+
style: getTabStyle(props, state, index)
|
|
44
45
|
}, null, /* @__PURE__ */ qwik._jsxC(blocks.Blocks, {
|
|
45
46
|
get parent() {
|
|
46
47
|
return props.builderBlock.id;
|
|
@@ -115,4 +116,5 @@ const Tabs = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((
|
|
|
115
116
|
exports.Tabs = Tabs;
|
|
116
117
|
exports.activeTabContent = activeTabContent;
|
|
117
118
|
exports.default = Tabs;
|
|
119
|
+
exports.getTabStyle = getTabStyle;
|
|
118
120
|
exports.onClick = onClick;
|
|
@@ -3,6 +3,9 @@ import { Blocks } from "../../components/blocks/blocks.qwik.mjs";
|
|
|
3
3
|
const activeTabContent = function activeTabContent2(props, state, active) {
|
|
4
4
|
return props.tabs && props.tabs[active].content;
|
|
5
5
|
};
|
|
6
|
+
const getTabStyle = function getTabStyle2(props, state, index) {
|
|
7
|
+
return index === state.activeTab ? props.activeTabStyle : {};
|
|
8
|
+
};
|
|
6
9
|
const onClick = function onClick2(props, state, index) {
|
|
7
10
|
if (index === state.activeTab && props.collapsible)
|
|
8
11
|
state.activeTab = -1;
|
|
@@ -36,9 +39,7 @@ const Tabs = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) =>
|
|
|
36
39
|
props,
|
|
37
40
|
state
|
|
38
41
|
]),
|
|
39
|
-
style:
|
|
40
|
-
...state.activeTab === index ? props.activeTabStyle : {}
|
|
41
|
-
}
|
|
42
|
+
style: getTabStyle(props, state, index)
|
|
42
43
|
}, null, /* @__PURE__ */ _jsxC(Blocks, {
|
|
43
44
|
get parent() {
|
|
44
45
|
return props.builderBlock.id;
|
|
@@ -114,5 +115,6 @@ export {
|
|
|
114
115
|
Tabs,
|
|
115
116
|
activeTabContent,
|
|
116
117
|
Tabs as default,
|
|
118
|
+
getTabStyle,
|
|
117
119
|
onClick
|
|
118
120
|
};
|
|
@@ -10,13 +10,6 @@ const ComponentRef = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inli
|
|
|
10
10
|
Wrapper: props.isInteractive ? interactiveElement.InteractiveElement : props.componentRef,
|
|
11
11
|
shouldUpdate: false
|
|
12
12
|
});
|
|
13
|
-
qwik.useTaskQrl(/* @__PURE__ */ qwik.inlinedQrl(({ track }) => {
|
|
14
|
-
const [props2] = qwik.useLexicalScope();
|
|
15
|
-
track(() => props2.componentOptions);
|
|
16
|
-
track(() => props2.blockChildren);
|
|
17
|
-
}, "ComponentRef_component_useTask_IpU82pM3MjU", [
|
|
18
|
-
props
|
|
19
|
-
]));
|
|
20
13
|
return /* @__PURE__ */ qwik._jsxC(jsxRuntime.Fragment, {
|
|
21
14
|
children: props.componentRef ? /* @__PURE__ */ qwik._jsxC(state.Wrapper, {
|
|
22
15
|
...componentRef_helpers.getWrapperProps({
|
|
@@ -29,7 +22,7 @@ const ComponentRef = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inli
|
|
|
29
22
|
isInteractive: props.isInteractive,
|
|
30
23
|
contextValue: props.context
|
|
31
24
|
}),
|
|
32
|
-
children: (props.blockChildren || []).map((child) => {
|
|
25
|
+
children: props.componentRef ? (props.blockChildren || []).map((child) => {
|
|
33
26
|
return /* @__PURE__ */ qwik._jsxC(block.Block, {
|
|
34
27
|
block: child,
|
|
35
28
|
get context() {
|
|
@@ -53,7 +46,7 @@ const ComponentRef = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inli
|
|
|
53
46
|
], "p0.registeredComponents")
|
|
54
47
|
}
|
|
55
48
|
}, 3, child.id);
|
|
56
|
-
})
|
|
49
|
+
}) : null
|
|
57
50
|
}, 0, "z6_0") : null
|
|
58
51
|
}, 1, "z6_1");
|
|
59
52
|
}, "ComponentRef_component_tFQoBV6UFdc"));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { componentQrl, inlinedQrl, useStore,
|
|
1
|
+
import { componentQrl, inlinedQrl, useStore, _jsxC, _IMMUTABLE, _fnSignal } from "@builder.io/qwik";
|
|
2
2
|
import { Fragment } from "@builder.io/qwik/jsx-runtime";
|
|
3
3
|
import { Block } from "../../block.qwik.mjs";
|
|
4
4
|
import { InteractiveElement } from "../interactive-element.qwik.mjs";
|
|
@@ -8,13 +8,6 @@ const ComponentRef = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((pr
|
|
|
8
8
|
Wrapper: props.isInteractive ? InteractiveElement : props.componentRef,
|
|
9
9
|
shouldUpdate: false
|
|
10
10
|
});
|
|
11
|
-
useTaskQrl(/* @__PURE__ */ inlinedQrl(({ track }) => {
|
|
12
|
-
const [props2] = useLexicalScope();
|
|
13
|
-
track(() => props2.componentOptions);
|
|
14
|
-
track(() => props2.blockChildren);
|
|
15
|
-
}, "ComponentRef_component_useTask_IpU82pM3MjU", [
|
|
16
|
-
props
|
|
17
|
-
]));
|
|
18
11
|
return /* @__PURE__ */ _jsxC(Fragment, {
|
|
19
12
|
children: props.componentRef ? /* @__PURE__ */ _jsxC(state.Wrapper, {
|
|
20
13
|
...getWrapperProps({
|
|
@@ -27,7 +20,7 @@ const ComponentRef = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((pr
|
|
|
27
20
|
isInteractive: props.isInteractive,
|
|
28
21
|
contextValue: props.context
|
|
29
22
|
}),
|
|
30
|
-
children: (props.blockChildren || []).map((child) => {
|
|
23
|
+
children: props.componentRef ? (props.blockChildren || []).map((child) => {
|
|
31
24
|
return /* @__PURE__ */ _jsxC(Block, {
|
|
32
25
|
block: child,
|
|
33
26
|
get context() {
|
|
@@ -51,7 +44,7 @@ const ComponentRef = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((pr
|
|
|
51
44
|
], "p0.registeredComponents")
|
|
52
45
|
}
|
|
53
46
|
}, 3, child.id);
|
|
54
|
-
})
|
|
47
|
+
}) : null
|
|
55
48
|
}, 0, "z6_0") : null
|
|
56
49
|
}, 1, "z6_1");
|
|
57
50
|
}, "ComponentRef_component_tFQoBV6UFdc"));
|
|
@@ -126,11 +126,14 @@ const runHttpRequests = function runHttpRequests2(props, state, showContentProps
|
|
|
126
126
|
method: "GET"
|
|
127
127
|
};
|
|
128
128
|
logFetch.logFetch(JSON.stringify(fetchRequestObj));
|
|
129
|
-
|
|
129
|
+
const fetchOptions = {
|
|
130
130
|
method: fetchRequestObj.method,
|
|
131
131
|
headers: fetchRequestObj.headers,
|
|
132
132
|
body: fetchRequestObj.body
|
|
133
|
-
}
|
|
133
|
+
};
|
|
134
|
+
if (fetchRequestObj.method === "GET")
|
|
135
|
+
delete fetchOptions.body;
|
|
136
|
+
fetch(fetchRequestObj.url, fetchOptions).then((response) => response.json()).then((json) => {
|
|
134
137
|
mergeNewRootState(props, state, showContentProps, elementRef, {
|
|
135
138
|
[key]: json
|
|
136
139
|
});
|
|
@@ -171,7 +174,9 @@ const EnableEditor = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inli
|
|
|
171
174
|
clicked: false,
|
|
172
175
|
hasExecuted: false,
|
|
173
176
|
httpReqsData: {},
|
|
174
|
-
httpReqsPending: {}
|
|
177
|
+
httpReqsPending: {},
|
|
178
|
+
prevData: null,
|
|
179
|
+
prevLocale: ""
|
|
175
180
|
}, {
|
|
176
181
|
deep: true
|
|
177
182
|
});
|
|
@@ -305,8 +310,12 @@ const EnableEditor = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inli
|
|
|
305
310
|
qwik.useTaskQrl(/* @__PURE__ */ qwik.inlinedQrl(({ track }) => {
|
|
306
311
|
const [elementRef2, props2, showContentProps2, state2] = qwik.useLexicalScope();
|
|
307
312
|
track(() => props2.data);
|
|
308
|
-
if (props2.data)
|
|
313
|
+
if (props2.data) {
|
|
314
|
+
if (state2.prevData === props2.data)
|
|
315
|
+
return;
|
|
309
316
|
mergeNewRootState(props2, state2, showContentProps2, elementRef2, props2.data);
|
|
317
|
+
state2.prevData = props2.data;
|
|
318
|
+
}
|
|
310
319
|
}, "EnableEditor_component_useTask_3_bQ0e5LHZwWE", [
|
|
311
320
|
elementRef,
|
|
312
321
|
props,
|
|
@@ -316,10 +325,14 @@ const EnableEditor = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inli
|
|
|
316
325
|
qwik.useTaskQrl(/* @__PURE__ */ qwik.inlinedQrl(({ track }) => {
|
|
317
326
|
const [elementRef2, props2, showContentProps2, state2] = qwik.useLexicalScope();
|
|
318
327
|
track(() => props2.locale);
|
|
319
|
-
if (props2.locale)
|
|
328
|
+
if (props2.locale) {
|
|
329
|
+
if (state2.prevLocale === props2.locale)
|
|
330
|
+
return;
|
|
320
331
|
mergeNewRootState(props2, state2, showContentProps2, elementRef2, {
|
|
321
332
|
locale: props2.locale
|
|
322
333
|
});
|
|
334
|
+
state2.prevLocale = props2.locale;
|
|
335
|
+
}
|
|
323
336
|
}, "EnableEditor_component_useTask_4_moHYZG8uNVU", [
|
|
324
337
|
elementRef,
|
|
325
338
|
props,
|
|
@@ -124,11 +124,14 @@ const runHttpRequests = function runHttpRequests2(props, state, showContentProps
|
|
|
124
124
|
method: "GET"
|
|
125
125
|
};
|
|
126
126
|
logFetch(JSON.stringify(fetchRequestObj));
|
|
127
|
-
|
|
127
|
+
const fetchOptions = {
|
|
128
128
|
method: fetchRequestObj.method,
|
|
129
129
|
headers: fetchRequestObj.headers,
|
|
130
130
|
body: fetchRequestObj.body
|
|
131
|
-
}
|
|
131
|
+
};
|
|
132
|
+
if (fetchRequestObj.method === "GET")
|
|
133
|
+
delete fetchOptions.body;
|
|
134
|
+
fetch(fetchRequestObj.url, fetchOptions).then((response) => response.json()).then((json) => {
|
|
132
135
|
mergeNewRootState(props, state, showContentProps, elementRef, {
|
|
133
136
|
[key]: json
|
|
134
137
|
});
|
|
@@ -169,7 +172,9 @@ const EnableEditor = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((pr
|
|
|
169
172
|
clicked: false,
|
|
170
173
|
hasExecuted: false,
|
|
171
174
|
httpReqsData: {},
|
|
172
|
-
httpReqsPending: {}
|
|
175
|
+
httpReqsPending: {},
|
|
176
|
+
prevData: null,
|
|
177
|
+
prevLocale: ""
|
|
173
178
|
}, {
|
|
174
179
|
deep: true
|
|
175
180
|
});
|
|
@@ -303,8 +308,12 @@ const EnableEditor = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((pr
|
|
|
303
308
|
useTaskQrl(/* @__PURE__ */ inlinedQrl(({ track }) => {
|
|
304
309
|
const [elementRef2, props2, showContentProps2, state2] = useLexicalScope();
|
|
305
310
|
track(() => props2.data);
|
|
306
|
-
if (props2.data)
|
|
311
|
+
if (props2.data) {
|
|
312
|
+
if (state2.prevData === props2.data)
|
|
313
|
+
return;
|
|
307
314
|
mergeNewRootState(props2, state2, showContentProps2, elementRef2, props2.data);
|
|
315
|
+
state2.prevData = props2.data;
|
|
316
|
+
}
|
|
308
317
|
}, "EnableEditor_component_useTask_3_bQ0e5LHZwWE", [
|
|
309
318
|
elementRef,
|
|
310
319
|
props,
|
|
@@ -314,10 +323,14 @@ const EnableEditor = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((pr
|
|
|
314
323
|
useTaskQrl(/* @__PURE__ */ inlinedQrl(({ track }) => {
|
|
315
324
|
const [elementRef2, props2, showContentProps2, state2] = useLexicalScope();
|
|
316
325
|
track(() => props2.locale);
|
|
317
|
-
if (props2.locale)
|
|
326
|
+
if (props2.locale) {
|
|
327
|
+
if (state2.prevLocale === props2.locale)
|
|
328
|
+
return;
|
|
318
329
|
mergeNewRootState(props2, state2, showContentProps2, elementRef2, {
|
|
319
330
|
locale: props2.locale
|
|
320
331
|
});
|
|
332
|
+
state2.prevLocale = props2.locale;
|
|
333
|
+
}
|
|
321
334
|
}, "EnableEditor_component_useTask_4_moHYZG8uNVU", [
|
|
322
335
|
elementRef,
|
|
323
336
|
props,
|
|
@@ -27,4 +27,17 @@ function register(type, info) {
|
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
|
+
function registerAction(action) {
|
|
31
|
+
var _a;
|
|
32
|
+
if (isBrowser.isBrowser()) {
|
|
33
|
+
const actionClone = JSON.parse(JSON.stringify(action));
|
|
34
|
+
if (action.action)
|
|
35
|
+
actionClone.action = action.action.toString();
|
|
36
|
+
(_a = window.parent) == null ? void 0 : _a.postMessage({
|
|
37
|
+
type: "builder.registerAction",
|
|
38
|
+
data: actionClone
|
|
39
|
+
}, "*");
|
|
40
|
+
}
|
|
41
|
+
}
|
|
30
42
|
exports.register = register;
|
|
43
|
+
exports.registerAction = registerAction;
|
|
@@ -25,6 +25,19 @@ function register(type, info) {
|
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
|
+
function registerAction(action) {
|
|
29
|
+
var _a;
|
|
30
|
+
if (isBrowser()) {
|
|
31
|
+
const actionClone = JSON.parse(JSON.stringify(action));
|
|
32
|
+
if (action.action)
|
|
33
|
+
actionClone.action = action.action.toString();
|
|
34
|
+
(_a = window.parent) == null ? void 0 : _a.postMessage({
|
|
35
|
+
type: "builder.registerAction",
|
|
36
|
+
data: actionClone
|
|
37
|
+
}, "*");
|
|
38
|
+
}
|
|
39
|
+
}
|
|
28
40
|
export {
|
|
29
|
-
register
|
|
41
|
+
register,
|
|
42
|
+
registerAction
|
|
30
43
|
};
|
|
@@ -38,6 +38,7 @@ exports.isEditing = isEditing.isEditing;
|
|
|
38
38
|
exports.isPreviewing = isPreviewing.isPreviewing;
|
|
39
39
|
exports.createRegisterComponentMessage = registerComponent.createRegisterComponentMessage;
|
|
40
40
|
exports.register = register.register;
|
|
41
|
+
exports.registerAction = register.registerAction;
|
|
41
42
|
exports.setEditorSettings = setEditorSettings.setEditorSettings;
|
|
42
43
|
exports.getBuilderSearchParams = index.getBuilderSearchParams;
|
|
43
44
|
exports.track = index$1.track;
|
|
@@ -13,7 +13,7 @@ import { setClientUserAttributes } from "./helpers/user-attributes.qwik.mjs";
|
|
|
13
13
|
import { isEditing } from "./functions/is-editing.qwik.mjs";
|
|
14
14
|
import { isPreviewing } from "./functions/is-previewing.qwik.mjs";
|
|
15
15
|
import { createRegisterComponentMessage } from "./functions/register-component.qwik.mjs";
|
|
16
|
-
import { register } from "./functions/register.qwik.mjs";
|
|
16
|
+
import { register, registerAction } from "./functions/register.qwik.mjs";
|
|
17
17
|
import { setEditorSettings } from "./functions/set-editor-settings.qwik.mjs";
|
|
18
18
|
import { getBuilderSearchParams } from "./functions/get-builder-search-params/index.qwik.mjs";
|
|
19
19
|
import { track } from "./functions/track/index.qwik.mjs";
|
|
@@ -41,6 +41,7 @@ export {
|
|
|
41
41
|
isEditing,
|
|
42
42
|
isPreviewing,
|
|
43
43
|
register,
|
|
44
|
+
registerAction,
|
|
44
45
|
setClientUserAttributes,
|
|
45
46
|
setEditorSettings,
|
|
46
47
|
subscribeToEditor,
|
|
@@ -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";
|
|
@@ -36,13 +39,13 @@ const onSubmit = function onSubmit2(props, state, formRef, event) {
|
|
|
36
39
|
const headers = props.customHeaders || {};
|
|
37
40
|
let body;
|
|
38
41
|
const formData = new FormData(el);
|
|
39
|
-
const formPairs = Array.from(el.querySelectorAll("input,select,textarea")).filter((el2) => !!el2.name).map((el2) => {
|
|
42
|
+
const formPairs = Array.from(el.querySelectorAll("input,select,textarea")).filter((el2) => !!el2.name).filter((el2) => !!el2.name && (el2.type !== "radio" || el2.checked)).map((el2) => {
|
|
40
43
|
let value;
|
|
41
44
|
const key = el2.name;
|
|
42
45
|
if (el2 instanceof HTMLInputElement) {
|
|
43
46
|
if (el2.type === "radio") {
|
|
44
47
|
if (el2.checked) {
|
|
45
|
-
value = el2.
|
|
48
|
+
value = el2.value;
|
|
46
49
|
return {
|
|
47
50
|
key,
|
|
48
51
|
value
|
|
@@ -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";
|
|
@@ -34,13 +37,13 @@ const onSubmit = function onSubmit2(props, state, formRef, event) {
|
|
|
34
37
|
const headers = props.customHeaders || {};
|
|
35
38
|
let body;
|
|
36
39
|
const formData = new FormData(el);
|
|
37
|
-
const formPairs = Array.from(el.querySelectorAll("input,select,textarea")).filter((el2) => !!el2.name).map((el2) => {
|
|
40
|
+
const formPairs = Array.from(el.querySelectorAll("input,select,textarea")).filter((el2) => !!el2.name).filter((el2) => !!el2.name && (el2.type !== "radio" || el2.checked)).map((el2) => {
|
|
38
41
|
let value;
|
|
39
42
|
const key = el2.name;
|
|
40
43
|
if (el2 instanceof HTMLInputElement) {
|
|
41
44
|
if (el2.type === "radio") {
|
|
42
45
|
if (el2.checked) {
|
|
43
|
-
value = el2.
|
|
46
|
+
value = el2.value;
|
|
44
47
|
return {
|
|
45
48
|
key,
|
|
46
49
|
value
|
|
@@ -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
|