@builder.io/sdk-qwik 0.0.8 → 0.0.9
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/README.md +65 -2
- package/lib/index.qwik.cjs +104 -7
- package/lib/index.qwik.mjs +104 -7
- package/package.json +1 -1
- package/src/blocks/button/button.jsx +197 -0
- package/src/blocks/button/component-info.js +41 -0
- package/src/blocks/columns/columns.jsx +267 -0
- package/src/blocks/columns/component-info.js +242 -0
- package/src/blocks/custom-code/component-info.js +31 -0
- package/src/blocks/custom-code/custom-code.jsx +130 -0
- package/src/blocks/embed/component-info.js +44 -0
- package/src/blocks/embed/embed.jsx +130 -0
- package/src/blocks/embed/helpers.js +9 -0
- package/src/blocks/form/builder-blocks.jsx +86 -0
- package/src/blocks/form/component-info.js +262 -0
- package/src/blocks/form/form.jsx +782 -0
- package/src/blocks/fragment/component-info.js +11 -0
- package/src/blocks/fragment/fragment.jsx +59 -0
- package/src/blocks/image/component-info.js +151 -0
- package/src/blocks/image/image.helpers.js +48 -0
- package/src/blocks/image/image.jsx +554 -0
- package/src/blocks/img/component-info.js +20 -0
- package/src/blocks/img/img.jsx +76 -0
- package/src/blocks/input/component-info.js +74 -0
- package/src/blocks/input/input.jsx +87 -0
- package/src/blocks/raw-text/component-info.js +16 -0
- package/src/blocks/raw-text/raw-text.jsx +53 -0
- package/src/blocks/section/component-info.js +49 -0
- package/src/blocks/section/section.jsx +97 -0
- package/src/blocks/select/component-info.js +59 -0
- package/src/blocks/select/select.jsx +149 -0
- package/src/blocks/submit-button/component-info.js +28 -0
- package/src/blocks/submit-button/submit-button.jsx +87 -0
- package/src/blocks/symbol/component-info.js +43 -0
- package/src/blocks/symbol/symbol.jsx +211 -0
- package/src/blocks/text/component-info.js +24 -0
- package/src/blocks/text/text.jsx +46 -0
- package/src/blocks/textarea/component-info.js +47 -0
- package/src/blocks/textarea/textarea.jsx +65 -0
- package/src/blocks/util.js +7 -0
- package/src/blocks/video/component-info.js +106 -0
- package/src/blocks/video/video.jsx +103 -0
- package/src/components/render-block/block-styles.jsx +174 -0
- package/src/components/render-block/render-block.helpers.js +23 -0
- package/src/components/render-block/render-block.jsx +733 -0
- package/src/components/render-block/render-component.jsx +245 -0
- package/src/components/render-block/render-repeated-block.jsx +104 -0
- package/src/components/render-block/types.js +0 -0
- package/src/components/render-blocks.jsx +387 -0
- package/src/components/render-content/components/render-styles.jsx +126 -0
- package/src/components/render-content/index.js +4 -0
- package/src/components/render-content/render-content.jsx +650 -0
- package/src/components/render-inlined-styles.jsx +141 -0
- package/src/constants/builder-registered-components.js +48 -0
- package/src/constants/device-sizes.js +21 -0
- package/src/constants/target.js +4 -0
- package/src/context/builder.context.js +5 -0
- package/src/functions/camel-to-kebab-case.js +4 -0
- package/src/functions/convert-style-object.js +6 -0
- package/src/functions/evaluate.js +28 -0
- package/src/functions/event-handler-name.js +7 -0
- package/src/functions/get-block-actions.js +23 -0
- package/src/functions/get-block-component-options.js +28 -0
- package/src/functions/get-block-properties.js +29 -0
- package/src/functions/get-block-styles.js +34 -0
- package/src/functions/get-block-tag.js +6 -0
- package/src/functions/get-builder-search-params/fn.test.js +13 -0
- package/src/functions/get-builder-search-params/index.js +33 -0
- package/src/functions/get-content/ab-testing.js +38 -0
- package/src/functions/get-content/fn.test.js +31 -0
- package/src/functions/get-content/index.js +96 -0
- package/src/functions/get-content/types.js +0 -0
- package/src/functions/get-fetch.js +34 -0
- package/src/functions/get-global-this.js +18 -0
- package/src/functions/get-processed-block.js +53 -0
- package/src/functions/get-processed-block.test.js +32 -0
- package/src/functions/if-target.js +15 -0
- package/src/functions/is-browser.js +6 -0
- package/src/functions/is-editing.js +7 -0
- package/src/functions/is-iframe.js +7 -0
- package/src/functions/is-previewing.js +14 -0
- package/src/functions/on-change.js +27 -0
- package/src/functions/on-change.test.js +19 -0
- package/src/functions/register-component.js +72 -0
- package/src/functions/register.js +29 -0
- package/src/functions/sanitize-styles.js +5 -0
- package/src/functions/set-editor-settings.js +15 -0
- package/src/functions/set.js +11 -0
- package/src/functions/set.test.js +16 -0
- package/src/functions/track.js +22 -0
- package/src/functions/transform-block.js +6 -0
- package/src/helpers/css.js +12 -0
- package/src/helpers/flatten.js +34 -0
- package/src/index-helpers/blocks-exports.js +22 -0
- package/src/index-helpers/top-of-file.js +4 -0
- package/src/index.js +10 -0
- package/src/scripts/init-editing.js +79 -0
- package/src/types/builder-block.js +0 -0
- package/src/types/builder-content.js +0 -0
- package/src/types/components.js +0 -0
- package/src/types/deep-partial.js +0 -0
- package/src/types/element.js +0 -0
- package/src/types/targets.js +0 -0
- package/src/types/typescript.js +0 -0
- package/types.d.ts +7 -12
- package/root.json +0 -1176
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { markSerializable } from "../util";
|
|
2
|
+
const componentInfo = {
|
|
3
|
+
name: "Embed",
|
|
4
|
+
static: true,
|
|
5
|
+
builtIn: true,
|
|
6
|
+
inputs: [
|
|
7
|
+
{
|
|
8
|
+
name: "url",
|
|
9
|
+
type: "url",
|
|
10
|
+
required: true,
|
|
11
|
+
defaultValue: "",
|
|
12
|
+
helperText: "e.g. enter a youtube url, google map, etc",
|
|
13
|
+
onChange: markSerializable((options) => {
|
|
14
|
+
const url = options.get("url");
|
|
15
|
+
if (url) {
|
|
16
|
+
options.set("content", "Loading...");
|
|
17
|
+
const apiKey = "ae0e60e78201a3f2b0de4b";
|
|
18
|
+
return fetch(`https://iframe.ly/api/iframely?url=${url}&api_key=${apiKey}`).then((res) => res.json()).then((data) => {
|
|
19
|
+
if (options.get("url") === url) {
|
|
20
|
+
if (data.html) {
|
|
21
|
+
options.set("content", data.html);
|
|
22
|
+
} else {
|
|
23
|
+
options.set("content", "Invalid url, please try another");
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}).catch((_err) => {
|
|
27
|
+
options.set("content", "There was an error embedding this URL, please try again or another URL");
|
|
28
|
+
});
|
|
29
|
+
} else {
|
|
30
|
+
options.delete("content");
|
|
31
|
+
}
|
|
32
|
+
})
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
name: "content",
|
|
36
|
+
type: "html",
|
|
37
|
+
defaultValue: '<div style="padding: 20px; text-align: center">(Choose an embed URL)<div>',
|
|
38
|
+
hideFromUI: true
|
|
39
|
+
}
|
|
40
|
+
]
|
|
41
|
+
};
|
|
42
|
+
export {
|
|
43
|
+
componentInfo
|
|
44
|
+
};
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
// GENERATED BY MITOSIS
|
|
2
|
+
|
|
3
|
+
import { isJsScript } from "./helpers";
|
|
4
|
+
import {
|
|
5
|
+
Fragment,
|
|
6
|
+
Host,
|
|
7
|
+
component$,
|
|
8
|
+
h,
|
|
9
|
+
useRef,
|
|
10
|
+
useStore,
|
|
11
|
+
useWatch$,
|
|
12
|
+
} from "@builder.io/qwik";
|
|
13
|
+
export const findAndRunScripts = function findAndRunScripts(
|
|
14
|
+
props,
|
|
15
|
+
state,
|
|
16
|
+
elem
|
|
17
|
+
) {
|
|
18
|
+
const scripts = elem.getElementsByTagName("script");
|
|
19
|
+
|
|
20
|
+
for (let i = 0; i < scripts.length; i++) {
|
|
21
|
+
const script = scripts[i];
|
|
22
|
+
|
|
23
|
+
if (script.src && !state.scriptsInserted.includes(script.src)) {
|
|
24
|
+
state.scriptsInserted.push(script.src);
|
|
25
|
+
const newScript = document.createElement("script");
|
|
26
|
+
newScript.async = true;
|
|
27
|
+
newScript.src = script.src;
|
|
28
|
+
document.head.appendChild(newScript);
|
|
29
|
+
} else if (
|
|
30
|
+
isJsScript(script) &&
|
|
31
|
+
!state.scriptsRun.includes(script.innerText)
|
|
32
|
+
) {
|
|
33
|
+
try {
|
|
34
|
+
state.scriptsRun.push(script.innerText);
|
|
35
|
+
new Function(script.innerText)();
|
|
36
|
+
} catch (error) {
|
|
37
|
+
console.warn("`Embed`: Error running script:", error);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
export const Embed = component$(
|
|
43
|
+
(props) => {
|
|
44
|
+
const elem = useRef();
|
|
45
|
+
const state = useStore({
|
|
46
|
+
scriptsInserted: [],
|
|
47
|
+
scriptsRun: [],
|
|
48
|
+
ranInitFn: false,
|
|
49
|
+
});
|
|
50
|
+
useWatch$(({ track }) => {
|
|
51
|
+
state && track(state, "ranInitFn");
|
|
52
|
+
if (elem && !state.ranInitFn) {
|
|
53
|
+
state.ranInitFn = true;
|
|
54
|
+
findAndRunScripts(props, state, elem);
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
return (
|
|
58
|
+
<Host
|
|
59
|
+
class="builder-embed"
|
|
60
|
+
ref={elem}
|
|
61
|
+
dangerouslySetInnerHTML={props.content}
|
|
62
|
+
></Host>
|
|
63
|
+
);
|
|
64
|
+
},
|
|
65
|
+
{ tagName: "div" }
|
|
66
|
+
);
|
|
67
|
+
export default Embed;
|
|
68
|
+
export const COMPONENT = {
|
|
69
|
+
"@type": "@builder.io/mitosis/component",
|
|
70
|
+
imports: [
|
|
71
|
+
{
|
|
72
|
+
imports: {
|
|
73
|
+
isJsScript: "isJsScript",
|
|
74
|
+
},
|
|
75
|
+
path: "./helpers",
|
|
76
|
+
},
|
|
77
|
+
],
|
|
78
|
+
exports: {},
|
|
79
|
+
inputs: [],
|
|
80
|
+
meta: {},
|
|
81
|
+
refs: {
|
|
82
|
+
elem: {
|
|
83
|
+
argument: "",
|
|
84
|
+
typeParameter: "HTMLDivElement",
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
state: {
|
|
88
|
+
scriptsInserted: [],
|
|
89
|
+
scriptsRun: [],
|
|
90
|
+
ranInitFn: false,
|
|
91
|
+
findAndRunScripts:
|
|
92
|
+
"@builder.io/mitosis/method:findAndRunScripts() {\n const scripts = elem.getElementsByTagName('script');\n\n for (let i = 0; i < scripts.length; i++) {\n const script = scripts[i];\n\n if (script.src && !state.scriptsInserted.includes(script.src)) {\n state.scriptsInserted.push(script.src);\n const newScript = document.createElement('script');\n newScript.async = true;\n newScript.src = script.src;\n document.head.appendChild(newScript);\n } else if (isJsScript(script) && !state.scriptsRun.includes(script.innerText)) {\n try {\n state.scriptsRun.push(script.innerText);\n new Function(script.innerText)();\n } catch (error) {\n console.warn('`Embed`: Error running script:', error);\n }\n }\n }\n}",
|
|
93
|
+
},
|
|
94
|
+
children: [
|
|
95
|
+
{
|
|
96
|
+
"@type": "@builder.io/mitosis/node",
|
|
97
|
+
name: "Host",
|
|
98
|
+
meta: {},
|
|
99
|
+
scope: {},
|
|
100
|
+
properties: {
|
|
101
|
+
class: "builder-embed",
|
|
102
|
+
},
|
|
103
|
+
bindings: {
|
|
104
|
+
ref: {
|
|
105
|
+
code: "elem",
|
|
106
|
+
},
|
|
107
|
+
innerHTML: {
|
|
108
|
+
code: "props.content",
|
|
109
|
+
},
|
|
110
|
+
},
|
|
111
|
+
children: [],
|
|
112
|
+
},
|
|
113
|
+
],
|
|
114
|
+
hooks: {
|
|
115
|
+
onUpdate: [
|
|
116
|
+
{
|
|
117
|
+
code: "\n if (elem && !state.ranInitFn) {\n state.ranInitFn = true;\n findAndRunScripts(props,state,elem,);\n }\n",
|
|
118
|
+
deps: "[elem, state.ranInitFn]",
|
|
119
|
+
},
|
|
120
|
+
],
|
|
121
|
+
},
|
|
122
|
+
context: {
|
|
123
|
+
get: {},
|
|
124
|
+
set: {},
|
|
125
|
+
},
|
|
126
|
+
name: "Embed",
|
|
127
|
+
subComponents: [],
|
|
128
|
+
interfaces: ["export interface EmbedProps {\n content: string;\n}"],
|
|
129
|
+
propsTypeRef: "EmbedProps",
|
|
130
|
+
};
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
// GENERATED BY MITOSIS
|
|
2
|
+
|
|
3
|
+
import { Fragment, component$, h } from "@builder.io/qwik";
|
|
4
|
+
export const BuilderBlocks = component$((props) => {
|
|
5
|
+
return (
|
|
6
|
+
<Fragment>
|
|
7
|
+
NOT YET IMPLEMENTED: <code>BuilderBlocks</code>
|
|
8
|
+
</Fragment>
|
|
9
|
+
);
|
|
10
|
+
});
|
|
11
|
+
export default BuilderBlocks;
|
|
12
|
+
export const COMPONENT = {
|
|
13
|
+
"@type": "@builder.io/mitosis/component",
|
|
14
|
+
imports: [],
|
|
15
|
+
exports: {},
|
|
16
|
+
inputs: [],
|
|
17
|
+
meta: {},
|
|
18
|
+
refs: {},
|
|
19
|
+
state: {},
|
|
20
|
+
children: [
|
|
21
|
+
{
|
|
22
|
+
"@type": "@builder.io/mitosis/node",
|
|
23
|
+
name: "Fragment",
|
|
24
|
+
meta: {},
|
|
25
|
+
scope: {},
|
|
26
|
+
properties: {},
|
|
27
|
+
bindings: {},
|
|
28
|
+
children: [
|
|
29
|
+
{
|
|
30
|
+
"@type": "@builder.io/mitosis/node",
|
|
31
|
+
name: "div",
|
|
32
|
+
meta: {},
|
|
33
|
+
scope: {},
|
|
34
|
+
properties: {
|
|
35
|
+
_text: "\n NOT YET IMPLEMENTED: ",
|
|
36
|
+
},
|
|
37
|
+
bindings: {},
|
|
38
|
+
children: [],
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"@type": "@builder.io/mitosis/node",
|
|
42
|
+
name: "code",
|
|
43
|
+
meta: {},
|
|
44
|
+
scope: {},
|
|
45
|
+
properties: {},
|
|
46
|
+
bindings: {},
|
|
47
|
+
children: [
|
|
48
|
+
{
|
|
49
|
+
"@type": "@builder.io/mitosis/node",
|
|
50
|
+
name: "div",
|
|
51
|
+
meta: {},
|
|
52
|
+
scope: {},
|
|
53
|
+
properties: {
|
|
54
|
+
_text: "BuilderBlocks",
|
|
55
|
+
},
|
|
56
|
+
bindings: {},
|
|
57
|
+
children: [],
|
|
58
|
+
},
|
|
59
|
+
],
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"@type": "@builder.io/mitosis/node",
|
|
63
|
+
name: "div",
|
|
64
|
+
meta: {},
|
|
65
|
+
scope: {},
|
|
66
|
+
properties: {
|
|
67
|
+
_text: "\n ",
|
|
68
|
+
},
|
|
69
|
+
bindings: {},
|
|
70
|
+
children: [],
|
|
71
|
+
},
|
|
72
|
+
],
|
|
73
|
+
},
|
|
74
|
+
],
|
|
75
|
+
hooks: {},
|
|
76
|
+
context: {
|
|
77
|
+
get: {},
|
|
78
|
+
set: {},
|
|
79
|
+
},
|
|
80
|
+
name: "BuilderBlocks",
|
|
81
|
+
subComponents: [],
|
|
82
|
+
interfaces: [
|
|
83
|
+
"export interface BuilderBlocksProps {\n dataPath: string;\n blocks: any;\n}",
|
|
84
|
+
],
|
|
85
|
+
propsTypeRef: "BuilderBlocksProps",
|
|
86
|
+
};
|
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
const componentInfo = {
|
|
2
|
+
name: "Form:Form",
|
|
3
|
+
builtIn: true,
|
|
4
|
+
defaults: {
|
|
5
|
+
responsiveStyles: {
|
|
6
|
+
large: {
|
|
7
|
+
marginTop: "15px",
|
|
8
|
+
paddingBottom: "15px"
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fef36d2a846134910b64b88e6d18c5ca5",
|
|
13
|
+
inputs: [
|
|
14
|
+
{
|
|
15
|
+
name: "sendSubmissionsTo",
|
|
16
|
+
type: "string",
|
|
17
|
+
enum: [
|
|
18
|
+
{
|
|
19
|
+
label: "Send to email",
|
|
20
|
+
value: "email",
|
|
21
|
+
helperText: "Send form submissions to the email address of your choosing"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
label: "Custom",
|
|
25
|
+
value: "custom",
|
|
26
|
+
helperText: "Handle where the form requests go manually with a little code, e.g. to your own custom backend"
|
|
27
|
+
}
|
|
28
|
+
],
|
|
29
|
+
defaultValue: "email"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
name: "sendSubmissionsToEmail",
|
|
33
|
+
type: "string",
|
|
34
|
+
required: true,
|
|
35
|
+
defaultValue: "your@email.com",
|
|
36
|
+
showIf: 'options.get("sendSubmissionsTo") === "email"'
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
name: "sendWithJs",
|
|
40
|
+
type: "boolean",
|
|
41
|
+
helperText: "Set to false to use basic html form action",
|
|
42
|
+
defaultValue: true,
|
|
43
|
+
showIf: 'options.get("sendSubmissionsTo") === "custom"'
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
name: "name",
|
|
47
|
+
type: "string",
|
|
48
|
+
defaultValue: "My form"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
name: "action",
|
|
52
|
+
type: "string",
|
|
53
|
+
helperText: "URL to send the form data to",
|
|
54
|
+
showIf: 'options.get("sendSubmissionsTo") === "custom"'
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
name: "contentType",
|
|
58
|
+
type: "string",
|
|
59
|
+
defaultValue: "application/json",
|
|
60
|
+
advanced: true,
|
|
61
|
+
enum: [
|
|
62
|
+
"application/json",
|
|
63
|
+
"multipart/form-data",
|
|
64
|
+
"application/x-www-form-urlencoded"
|
|
65
|
+
],
|
|
66
|
+
showIf: 'options.get("sendSubmissionsTo") === "custom" && options.get("sendWithJs") === true'
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
name: "method",
|
|
70
|
+
type: "string",
|
|
71
|
+
showIf: 'options.get("sendSubmissionsTo") === "custom"',
|
|
72
|
+
defaultValue: "POST",
|
|
73
|
+
advanced: true
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
name: "previewState",
|
|
77
|
+
type: "string",
|
|
78
|
+
enum: ["unsubmitted", "sending", "success", "error"],
|
|
79
|
+
defaultValue: "unsubmitted",
|
|
80
|
+
helperText: 'Choose a state to edit, e.g. choose "success" to show what users see on success and edit the message',
|
|
81
|
+
showIf: 'options.get("sendSubmissionsTo") !== "zapier" && options.get("sendWithJs") === true'
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
name: "successUrl",
|
|
85
|
+
type: "url",
|
|
86
|
+
helperText: "Optional URL to redirect the user to on form submission success",
|
|
87
|
+
showIf: 'options.get("sendSubmissionsTo") !== "zapier" && options.get("sendWithJs") === true'
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
name: "resetFormOnSubmit",
|
|
91
|
+
type: "boolean",
|
|
92
|
+
showIf: "options.get('sendSubmissionsTo') === 'custom' && options.get('sendWithJs') === true",
|
|
93
|
+
advanced: true
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
name: "successMessage",
|
|
97
|
+
type: "uiBlocks",
|
|
98
|
+
hideFromUI: true,
|
|
99
|
+
defaultValue: [
|
|
100
|
+
{
|
|
101
|
+
"@type": "@builder.io/sdk:Element",
|
|
102
|
+
responsiveStyles: {
|
|
103
|
+
large: {
|
|
104
|
+
marginTop: "10px"
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
component: {
|
|
108
|
+
name: "Text",
|
|
109
|
+
options: {
|
|
110
|
+
text: "<span>Thanks!</span>"
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
]
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
name: "validate",
|
|
118
|
+
type: "boolean",
|
|
119
|
+
defaultValue: true,
|
|
120
|
+
advanced: true
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
name: "errorMessagePath",
|
|
124
|
+
type: "text",
|
|
125
|
+
advanced: true,
|
|
126
|
+
helperText: 'Path to where to get the error message from in a JSON response to display to the user, e.g. "error.message" for a response like { "error": { "message": "this username is taken" }}'
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
name: "errorMessage",
|
|
130
|
+
type: "uiBlocks",
|
|
131
|
+
hideFromUI: true,
|
|
132
|
+
defaultValue: [
|
|
133
|
+
{
|
|
134
|
+
"@type": "@builder.io/sdk:Element",
|
|
135
|
+
responsiveStyles: {
|
|
136
|
+
large: {
|
|
137
|
+
marginTop: "10px"
|
|
138
|
+
}
|
|
139
|
+
},
|
|
140
|
+
bindings: {
|
|
141
|
+
"component.options.text": "state.formErrorMessage || block.component.options.text"
|
|
142
|
+
},
|
|
143
|
+
component: {
|
|
144
|
+
name: "Text",
|
|
145
|
+
options: {
|
|
146
|
+
text: "<span>Form submission error :( Please check your answers and try again</span>"
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
]
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
name: "sendingMessage",
|
|
154
|
+
type: "uiBlocks",
|
|
155
|
+
hideFromUI: true,
|
|
156
|
+
defaultValue: [
|
|
157
|
+
{
|
|
158
|
+
"@type": "@builder.io/sdk:Element",
|
|
159
|
+
responsiveStyles: {
|
|
160
|
+
large: {
|
|
161
|
+
marginTop: "10px"
|
|
162
|
+
}
|
|
163
|
+
},
|
|
164
|
+
component: {
|
|
165
|
+
name: "Text",
|
|
166
|
+
options: {
|
|
167
|
+
text: "<span>Sending...</span>"
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
]
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
name: "customHeaders",
|
|
175
|
+
type: "map",
|
|
176
|
+
valueType: {
|
|
177
|
+
type: "string"
|
|
178
|
+
},
|
|
179
|
+
advanced: true,
|
|
180
|
+
showIf: 'options.get("sendSubmissionsTo") === "custom" && options.get("sendWithJs") === true'
|
|
181
|
+
}
|
|
182
|
+
],
|
|
183
|
+
noWrap: true,
|
|
184
|
+
canHaveChildren: true,
|
|
185
|
+
defaultChildren: [
|
|
186
|
+
{
|
|
187
|
+
"@type": "@builder.io/sdk:Element",
|
|
188
|
+
responsiveStyles: {
|
|
189
|
+
large: {
|
|
190
|
+
marginTop: "10px"
|
|
191
|
+
}
|
|
192
|
+
},
|
|
193
|
+
component: {
|
|
194
|
+
name: "Text",
|
|
195
|
+
options: {
|
|
196
|
+
text: "<span>Enter your name</span>"
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
"@type": "@builder.io/sdk:Element",
|
|
202
|
+
responsiveStyles: {
|
|
203
|
+
large: {
|
|
204
|
+
marginTop: "10px"
|
|
205
|
+
}
|
|
206
|
+
},
|
|
207
|
+
component: {
|
|
208
|
+
name: "Form:Input",
|
|
209
|
+
options: {
|
|
210
|
+
name: "name",
|
|
211
|
+
placeholder: "Jane Doe"
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
"@type": "@builder.io/sdk:Element",
|
|
217
|
+
responsiveStyles: {
|
|
218
|
+
large: {
|
|
219
|
+
marginTop: "10px"
|
|
220
|
+
}
|
|
221
|
+
},
|
|
222
|
+
component: {
|
|
223
|
+
name: "Text",
|
|
224
|
+
options: {
|
|
225
|
+
text: "<span>Enter your email</span>"
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
"@type": "@builder.io/sdk:Element",
|
|
231
|
+
responsiveStyles: {
|
|
232
|
+
large: {
|
|
233
|
+
marginTop: "10px"
|
|
234
|
+
}
|
|
235
|
+
},
|
|
236
|
+
component: {
|
|
237
|
+
name: "Form:Input",
|
|
238
|
+
options: {
|
|
239
|
+
name: "email",
|
|
240
|
+
placeholder: "jane@doe.com"
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
},
|
|
244
|
+
{
|
|
245
|
+
"@type": "@builder.io/sdk:Element",
|
|
246
|
+
responsiveStyles: {
|
|
247
|
+
large: {
|
|
248
|
+
marginTop: "10px"
|
|
249
|
+
}
|
|
250
|
+
},
|
|
251
|
+
component: {
|
|
252
|
+
name: "Form:SubmitButton",
|
|
253
|
+
options: {
|
|
254
|
+
text: "Submit"
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
]
|
|
259
|
+
};
|
|
260
|
+
export {
|
|
261
|
+
componentInfo
|
|
262
|
+
};
|