@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.
Files changed (106) hide show
  1. package/README.md +65 -2
  2. package/lib/index.qwik.cjs +104 -7
  3. package/lib/index.qwik.mjs +104 -7
  4. package/package.json +1 -1
  5. package/src/blocks/button/button.jsx +197 -0
  6. package/src/blocks/button/component-info.js +41 -0
  7. package/src/blocks/columns/columns.jsx +267 -0
  8. package/src/blocks/columns/component-info.js +242 -0
  9. package/src/blocks/custom-code/component-info.js +31 -0
  10. package/src/blocks/custom-code/custom-code.jsx +130 -0
  11. package/src/blocks/embed/component-info.js +44 -0
  12. package/src/blocks/embed/embed.jsx +130 -0
  13. package/src/blocks/embed/helpers.js +9 -0
  14. package/src/blocks/form/builder-blocks.jsx +86 -0
  15. package/src/blocks/form/component-info.js +262 -0
  16. package/src/blocks/form/form.jsx +782 -0
  17. package/src/blocks/fragment/component-info.js +11 -0
  18. package/src/blocks/fragment/fragment.jsx +59 -0
  19. package/src/blocks/image/component-info.js +151 -0
  20. package/src/blocks/image/image.helpers.js +48 -0
  21. package/src/blocks/image/image.jsx +554 -0
  22. package/src/blocks/img/component-info.js +20 -0
  23. package/src/blocks/img/img.jsx +76 -0
  24. package/src/blocks/input/component-info.js +74 -0
  25. package/src/blocks/input/input.jsx +87 -0
  26. package/src/blocks/raw-text/component-info.js +16 -0
  27. package/src/blocks/raw-text/raw-text.jsx +53 -0
  28. package/src/blocks/section/component-info.js +49 -0
  29. package/src/blocks/section/section.jsx +97 -0
  30. package/src/blocks/select/component-info.js +59 -0
  31. package/src/blocks/select/select.jsx +149 -0
  32. package/src/blocks/submit-button/component-info.js +28 -0
  33. package/src/blocks/submit-button/submit-button.jsx +87 -0
  34. package/src/blocks/symbol/component-info.js +43 -0
  35. package/src/blocks/symbol/symbol.jsx +211 -0
  36. package/src/blocks/text/component-info.js +24 -0
  37. package/src/blocks/text/text.jsx +46 -0
  38. package/src/blocks/textarea/component-info.js +47 -0
  39. package/src/blocks/textarea/textarea.jsx +65 -0
  40. package/src/blocks/util.js +7 -0
  41. package/src/blocks/video/component-info.js +106 -0
  42. package/src/blocks/video/video.jsx +103 -0
  43. package/src/components/render-block/block-styles.jsx +174 -0
  44. package/src/components/render-block/render-block.helpers.js +23 -0
  45. package/src/components/render-block/render-block.jsx +733 -0
  46. package/src/components/render-block/render-component.jsx +245 -0
  47. package/src/components/render-block/render-repeated-block.jsx +104 -0
  48. package/src/components/render-block/types.js +0 -0
  49. package/src/components/render-blocks.jsx +387 -0
  50. package/src/components/render-content/components/render-styles.jsx +126 -0
  51. package/src/components/render-content/index.js +4 -0
  52. package/src/components/render-content/render-content.jsx +650 -0
  53. package/src/components/render-inlined-styles.jsx +141 -0
  54. package/src/constants/builder-registered-components.js +48 -0
  55. package/src/constants/device-sizes.js +21 -0
  56. package/src/constants/target.js +4 -0
  57. package/src/context/builder.context.js +5 -0
  58. package/src/functions/camel-to-kebab-case.js +4 -0
  59. package/src/functions/convert-style-object.js +6 -0
  60. package/src/functions/evaluate.js +28 -0
  61. package/src/functions/event-handler-name.js +7 -0
  62. package/src/functions/get-block-actions.js +23 -0
  63. package/src/functions/get-block-component-options.js +28 -0
  64. package/src/functions/get-block-properties.js +29 -0
  65. package/src/functions/get-block-styles.js +34 -0
  66. package/src/functions/get-block-tag.js +6 -0
  67. package/src/functions/get-builder-search-params/fn.test.js +13 -0
  68. package/src/functions/get-builder-search-params/index.js +33 -0
  69. package/src/functions/get-content/ab-testing.js +38 -0
  70. package/src/functions/get-content/fn.test.js +31 -0
  71. package/src/functions/get-content/index.js +96 -0
  72. package/src/functions/get-content/types.js +0 -0
  73. package/src/functions/get-fetch.js +34 -0
  74. package/src/functions/get-global-this.js +18 -0
  75. package/src/functions/get-processed-block.js +53 -0
  76. package/src/functions/get-processed-block.test.js +32 -0
  77. package/src/functions/if-target.js +15 -0
  78. package/src/functions/is-browser.js +6 -0
  79. package/src/functions/is-editing.js +7 -0
  80. package/src/functions/is-iframe.js +7 -0
  81. package/src/functions/is-previewing.js +14 -0
  82. package/src/functions/on-change.js +27 -0
  83. package/src/functions/on-change.test.js +19 -0
  84. package/src/functions/register-component.js +72 -0
  85. package/src/functions/register.js +29 -0
  86. package/src/functions/sanitize-styles.js +5 -0
  87. package/src/functions/set-editor-settings.js +15 -0
  88. package/src/functions/set.js +11 -0
  89. package/src/functions/set.test.js +16 -0
  90. package/src/functions/track.js +22 -0
  91. package/src/functions/transform-block.js +6 -0
  92. package/src/helpers/css.js +12 -0
  93. package/src/helpers/flatten.js +34 -0
  94. package/src/index-helpers/blocks-exports.js +22 -0
  95. package/src/index-helpers/top-of-file.js +4 -0
  96. package/src/index.js +10 -0
  97. package/src/scripts/init-editing.js +79 -0
  98. package/src/types/builder-block.js +0 -0
  99. package/src/types/builder-content.js +0 -0
  100. package/src/types/components.js +0 -0
  101. package/src/types/deep-partial.js +0 -0
  102. package/src/types/element.js +0 -0
  103. package/src/types/targets.js +0 -0
  104. package/src/types/typescript.js +0 -0
  105. package/types.d.ts +7 -12
  106. package/root.json +0 -1176
@@ -0,0 +1,782 @@
1
+ // GENERATED BY MITOSIS
2
+
3
+ import RenderBlock from "../../components/render-block/render-block";
4
+ import { isEditing } from "../../functions/is-editing.js";
5
+ import BuilderBlocks from "./builder-blocks";
6
+ import {
7
+ Fragment,
8
+ Host,
9
+ component$,
10
+ h,
11
+ useContext,
12
+ useRef,
13
+ useStore,
14
+ useStylesScoped$,
15
+ } from "@builder.io/qwik";
16
+ export const submissionState = function submissionState(
17
+ props,
18
+ state,
19
+ formRef,
20
+ builderContext
21
+ ) {
22
+ return (isEditing() && props.previewState) || state.formState;
23
+ };
24
+ export const onSubmit = function onSubmit(
25
+ props,
26
+ state,
27
+ formRef,
28
+ builderContext,
29
+ event
30
+ ) {
31
+ const sendWithJs = props.sendWithJs || props.sendSubmissionsTo === "email";
32
+
33
+ if (props.sendSubmissionsTo === "zapier") {
34
+ event.preventDefault();
35
+ } else if (sendWithJs) {
36
+ if (!(props.action || props.sendSubmissionsTo === "email")) {
37
+ event.preventDefault();
38
+ return;
39
+ }
40
+
41
+ event.preventDefault();
42
+ const el = event.currentTarget;
43
+ const headers = props.customHeaders || {};
44
+ let body;
45
+ const formData = new FormData(el); // TODO: maybe support null
46
+
47
+ const formPairs = Array.from(
48
+ event.currentTarget.querySelectorAll("input,select,textarea")
49
+ )
50
+ .filter((el) => !!el.name)
51
+ .map((el) => {
52
+ let value;
53
+ const key = el.name;
54
+
55
+ if (el instanceof HTMLInputElement) {
56
+ if (el.type === "radio") {
57
+ if (el.checked) {
58
+ value = el.name;
59
+ return {
60
+ key,
61
+ value,
62
+ };
63
+ }
64
+ } else if (el.type === "checkbox") {
65
+ value = el.checked;
66
+ } else if (el.type === "number" || el.type === "range") {
67
+ const num = el.valueAsNumber;
68
+
69
+ if (!isNaN(num)) {
70
+ value = num;
71
+ }
72
+ } else if (el.type === "file") {
73
+ // TODO: one vs multiple files
74
+ value = el.files;
75
+ } else {
76
+ value = el.value;
77
+ }
78
+ } else {
79
+ value = el.value;
80
+ }
81
+
82
+ return {
83
+ key,
84
+ value,
85
+ };
86
+ });
87
+ let contentType = props.contentType;
88
+
89
+ if (props.sendSubmissionsTo === "email") {
90
+ contentType = "multipart/form-data";
91
+ }
92
+
93
+ Array.from(formPairs).forEach(({ value }) => {
94
+ if (
95
+ value instanceof File ||
96
+ (Array.isArray(value) && value[0] instanceof File) ||
97
+ value instanceof FileList
98
+ ) {
99
+ contentType = "multipart/form-data";
100
+ }
101
+ }); // TODO: send as urlEncoded or multipart by default
102
+ // because of ease of use and reliability in browser API
103
+ // for encoding the form?
104
+
105
+ if (contentType !== "application/json") {
106
+ body = formData;
107
+ } else {
108
+ // Json
109
+ const json = {};
110
+ Array.from(formPairs).forEach(({ value, key }) => {
111
+ set(json, key, value);
112
+ });
113
+ body = JSON.stringify(json);
114
+ }
115
+
116
+ if (contentType && contentType !== "multipart/form-data") {
117
+ if (
118
+ /* Zapier doesn't allow content-type header to be sent from browsers */
119
+ !(sendWithJs && props.action?.includes("zapier.com"))
120
+ ) {
121
+ headers["content-type"] = contentType;
122
+ }
123
+ }
124
+
125
+ const presubmitEvent = new CustomEvent("presubmit", {
126
+ detail: {
127
+ body,
128
+ },
129
+ });
130
+
131
+ if (formRef) {
132
+ formRef.dispatchEvent(presubmitEvent);
133
+
134
+ if (presubmitEvent.defaultPrevented) {
135
+ return;
136
+ }
137
+ }
138
+
139
+ state.formState = "sending";
140
+ const formUrl = `${
141
+ builder.env === "dev" ? "http://localhost:5000" : "https://builder.io"
142
+ }/api/v1/form-submit?apiKey=${builder.apiKey}&to=${btoa(
143
+ props.sendSubmissionsToEmail || ""
144
+ )}&name=${encodeURIComponent(props.name || "")}`;
145
+ fetch(
146
+ props.sendSubmissionsTo === "email" ? formUrl : props.action,
147
+ /* TODO: throw error if no action URL */
148
+ {
149
+ body,
150
+ headers,
151
+ method: props.method || "post",
152
+ }
153
+ ).then(
154
+ async (res) => {
155
+ let body;
156
+ const contentType = res.headers.get("content-type");
157
+
158
+ if (contentType && contentType.indexOf("application/json") !== -1) {
159
+ body = await res.json();
160
+ } else {
161
+ body = await res.text();
162
+ }
163
+
164
+ if (!res.ok && props.errorMessagePath) {
165
+ /* TODO: allow supplying an error formatter function */
166
+ let message = get(body, props.errorMessagePath);
167
+
168
+ if (message) {
169
+ if (typeof message !== "string") {
170
+ /* TODO: ideally convert json to yaml so it woul dbe like
171
+ error: - email has been taken */
172
+ message = JSON.stringify(message);
173
+ }
174
+
175
+ state.formErrorMessage = message;
176
+ }
177
+ }
178
+
179
+ state.responseData = body;
180
+ state.formState = res.ok ? "success" : "error";
181
+
182
+ if (res.ok) {
183
+ const submitSuccessEvent = new CustomEvent("submit:success", {
184
+ detail: {
185
+ res,
186
+ body,
187
+ },
188
+ });
189
+
190
+ if (formRef) {
191
+ formRef.dispatchEvent(submitSuccessEvent);
192
+
193
+ if (submitSuccessEvent.defaultPrevented) {
194
+ return;
195
+ }
196
+ /* TODO: option to turn this on/off? */
197
+
198
+ if (props.resetFormOnSubmit !== false) {
199
+ formRef.reset();
200
+ }
201
+ }
202
+ /* TODO: client side route event first that can be preventDefaulted */
203
+
204
+ if (props.successUrl) {
205
+ if (formRef) {
206
+ const event = new CustomEvent("route", {
207
+ detail: {
208
+ url: props.successUrl,
209
+ },
210
+ });
211
+ formRef.dispatchEvent(event);
212
+
213
+ if (!event.defaultPrevented) {
214
+ location.href = props.successUrl;
215
+ }
216
+ } else {
217
+ location.href = props.successUrl;
218
+ }
219
+ }
220
+ }
221
+ },
222
+ (err) => {
223
+ const submitErrorEvent = new CustomEvent("submit:error", {
224
+ detail: {
225
+ error: err,
226
+ },
227
+ });
228
+
229
+ if (formRef) {
230
+ formRef.dispatchEvent(submitErrorEvent);
231
+
232
+ if (submitErrorEvent.defaultPrevented) {
233
+ return;
234
+ }
235
+ }
236
+
237
+ state.responseData = err;
238
+ state.formState = "error";
239
+ }
240
+ );
241
+ }
242
+ };
243
+ export const FormComponent = component$(
244
+ (props) => {
245
+ useStylesScoped$(STYLES);
246
+ const builderContext = useContext(BuilderContext);
247
+ const formRef = useRef();
248
+ const state = useStore({
249
+ formState: "unsubmitted",
250
+ responseData: null,
251
+ formErrorMessage: "",
252
+ });
253
+ return (
254
+ <Host
255
+ validate={props.validate}
256
+ ref={formRef}
257
+ action={(() => {
258
+ !props.sendWithJs && props.action;
259
+ })()}
260
+ method={props.method}
261
+ name={props.name}
262
+ onSubmit$={(event) =>
263
+ onSubmit(props, state, formRef, builderContext, event)
264
+ }
265
+ {...props.attributes}
266
+ >
267
+ <>
268
+ {props.builderBlock && props.builderBlock.children
269
+ ? (props.builderBlock?.children || []).map((block) => {
270
+ return (
271
+ <RenderBlock
272
+ block={block}
273
+ context={builderContext}
274
+ ></RenderBlock>
275
+ );
276
+ })
277
+ : null}
278
+ {submissionState(props, state, formRef, builderContext) ===
279
+ "error" ? (
280
+ <BuilderBlocks
281
+ dataPath="errorMessage"
282
+ blocks={props.errorMessage}
283
+ ></BuilderBlocks>
284
+ ) : null}
285
+ {submissionState(props, state, formRef, builderContext) ===
286
+ "sending" ? (
287
+ <BuilderBlocks
288
+ dataPath="sendingMessage"
289
+ blocks={props.sendingMessage}
290
+ ></BuilderBlocks>
291
+ ) : null}
292
+ {submissionState(props, state, formRef, builderContext) === "error" &&
293
+ state.responseData ? (
294
+ <pre class="builder-form-error-text pre-FormComponent">
295
+ {JSON.stringify(state.responseData, null, 2)}
296
+ </pre>
297
+ ) : null}
298
+ {submissionState(props, state, formRef, builderContext) ===
299
+ "success" ? (
300
+ <BuilderBlocks
301
+ dataPath="successMessage"
302
+ blocks={props.successMessage}
303
+ ></BuilderBlocks>
304
+ ) : null}
305
+ </>
306
+ </Host>
307
+ );
308
+ },
309
+ { tagName: "form" }
310
+ );
311
+ export default FormComponent;
312
+ export const STYLES = `.pre-FormComponent {
313
+ padding: 10px;
314
+ color: red;
315
+ text-align: center; }`;
316
+ export const COMPONENT = {
317
+ "@type": "@builder.io/mitosis/component",
318
+ imports: [
319
+ {
320
+ imports: {
321
+ RenderBlock: "default",
322
+ },
323
+ path: "../../components/render-block/render-block.lite",
324
+ },
325
+ {
326
+ imports: {
327
+ isEditing: "isEditing",
328
+ },
329
+ path: "../../functions/is-editing.js",
330
+ },
331
+ {
332
+ imports: {
333
+ BuilderBlocks: "default",
334
+ },
335
+ path: "./builder-blocks.lite",
336
+ },
337
+ ],
338
+ exports: {},
339
+ inputs: [],
340
+ meta: {},
341
+ refs: {
342
+ formRef: {
343
+ argument: "",
344
+ },
345
+ },
346
+ state: {
347
+ formState: "unsubmitted",
348
+ responseData: null,
349
+ formErrorMessage: "",
350
+ submissionState:
351
+ "@builder.io/mitosis/method:get submissionState() {\n return isEditing() && props.previewState || state.formState;\n}",
352
+ onSubmit:
353
+ "@builder.io/mitosis/method:onSubmit(event: Event & {\n currentTarget: HTMLFormElement;\n}) {\n const sendWithJs = props.sendWithJs || props.sendSubmissionsTo === 'email';\n\n if (props.sendSubmissionsTo === 'zapier') {\n event.preventDefault();\n } else if (sendWithJs) {\n if (!(props.action || props.sendSubmissionsTo === 'email')) {\n event.preventDefault();\n return;\n }\n\n event.preventDefault();\n const el = event.currentTarget;\n const headers = props.customHeaders || {};\n let body: any;\n const formData = new FormData(el); // TODO: maybe support null\n\n const formPairs: {\n key: string;\n value: File | boolean | number | string | FileList;\n }[] = Array.from(event.currentTarget.querySelectorAll('input,select,textarea')).filter(el => !!(el as HTMLInputElement).name).map(el => {\n let value: any;\n const key = (el as HTMLImageElement).name;\n\n if (el instanceof HTMLInputElement) {\n if (el.type === 'radio') {\n if (el.checked) {\n value = el.name;\n return {\n key,\n value\n };\n }\n } else if (el.type === 'checkbox') {\n value = el.checked;\n } else if (el.type === 'number' || el.type === 'range') {\n const num = el.valueAsNumber;\n\n if (!isNaN(num)) {\n value = num;\n }\n } else if (el.type === 'file') {\n // TODO: one vs multiple files\n value = el.files;\n } else {\n value = el.value;\n }\n } else {\n value = (el as HTMLInputElement).value;\n }\n\n return {\n key,\n value\n };\n });\n let contentType = props.contentType;\n\n if (props.sendSubmissionsTo === 'email') {\n contentType = 'multipart/form-data';\n }\n\n Array.from(formPairs).forEach(({\n value\n }) => {\n if (value instanceof File || Array.isArray(value) && value[0] instanceof File || value instanceof FileList) {\n contentType = 'multipart/form-data';\n }\n }); // TODO: send as urlEncoded or multipart by default\n // because of ease of use and reliability in browser API\n // for encoding the form?\n\n if (contentType !== 'application/json') {\n body = formData;\n } else {\n // Json\n const json = {};\n Array.from(formPairs).forEach(({\n value,\n key\n }) => {\n set(json, key, value);\n });\n body = JSON.stringify(json);\n }\n\n if (contentType && contentType !== 'multipart/form-data') {\n if (\n /* Zapier doesn't allow content-type header to be sent from browsers */\n !(sendWithJs && props.action?.includes('zapier.com'))) {\n headers['content-type'] = contentType;\n }\n }\n\n const presubmitEvent = new CustomEvent('presubmit', {\n detail: {\n body\n }\n });\n\n if (formRef) {\n formRef.dispatchEvent(presubmitEvent);\n\n if (presubmitEvent.defaultPrevented) {\n return;\n }\n }\n\n state.formState = 'sending';\n const formUrl = `${builder.env === 'dev' ? 'http://localhost:5000' : 'https://builder.io'}/api/v1/form-submit?apiKey=${builder.apiKey}&to=${btoa(props.sendSubmissionsToEmail || '')}&name=${encodeURIComponent(props.name || '')}`;\n fetch(props.sendSubmissionsTo === 'email' ? formUrl : props.action!\n /* TODO: throw error if no action URL */\n , {\n body,\n headers,\n method: props.method || 'post'\n }).then(async res => {\n let body;\n const contentType = res.headers.get('content-type');\n\n if (contentType && contentType.indexOf('application/json') !== -1) {\n body = await res.json();\n } else {\n body = await res.text();\n }\n\n if (!res.ok && props.errorMessagePath) {\n /* TODO: allow supplying an error formatter function */\n let message = get(body, props.errorMessagePath);\n\n if (message) {\n if (typeof message !== 'string') {\n /* TODO: ideally convert json to yaml so it woul dbe like\n error: - email has been taken */\n message = JSON.stringify(message);\n }\n\n state.formErrorMessage = message;\n }\n }\n\n state.responseData = body;\n state.formState = res.ok ? 'success' : 'error';\n\n if (res.ok) {\n const submitSuccessEvent = new CustomEvent('submit:success', {\n detail: {\n res,\n body\n }\n });\n\n if (formRef) {\n formRef.dispatchEvent(submitSuccessEvent);\n\n if (submitSuccessEvent.defaultPrevented) {\n return;\n }\n /* TODO: option to turn this on/off? */\n\n\n if (props.resetFormOnSubmit !== false) {\n formRef.reset();\n }\n }\n /* TODO: client side route event first that can be preventDefaulted */\n\n\n if (props.successUrl) {\n if (formRef) {\n const event = new CustomEvent('route', {\n detail: {\n url: props.successUrl\n }\n });\n formRef.dispatchEvent(event);\n\n if (!event.defaultPrevented) {\n location.href = props.successUrl;\n }\n } else {\n location.href = props.successUrl;\n }\n }\n }\n }, err => {\n const submitErrorEvent = new CustomEvent('submit:error', {\n detail: {\n error: err\n }\n });\n\n if (formRef) {\n formRef.dispatchEvent(submitErrorEvent);\n\n if (submitErrorEvent.defaultPrevented) {\n return;\n }\n }\n\n state.responseData = err;\n state.formState = 'error';\n });\n }\n}",
354
+ },
355
+ children: [
356
+ {
357
+ "@type": "@builder.io/mitosis/node",
358
+ name: "Host",
359
+ meta: {},
360
+ scope: {},
361
+ properties: {},
362
+ bindings: {
363
+ validate: {
364
+ code: "props.validate",
365
+ },
366
+ ref: {
367
+ code: "formRef",
368
+ },
369
+ action: {
370
+ code: "!props.sendWithJs && props.action",
371
+ },
372
+ method: {
373
+ code: "props.method",
374
+ },
375
+ name: {
376
+ code: "props.name",
377
+ },
378
+ onSubmit: {
379
+ code: "onSubmit(props,state,formRef,builderContext,event)",
380
+ arguments: ["event"],
381
+ },
382
+ _spread: {
383
+ code: "props.attributes",
384
+ },
385
+ },
386
+ children: [
387
+ {
388
+ "@type": "@builder.io/mitosis/node",
389
+ name: "div",
390
+ meta: {},
391
+ scope: {},
392
+ properties: {
393
+ _text: "\n ",
394
+ },
395
+ bindings: {},
396
+ children: [],
397
+ },
398
+ {
399
+ "@type": "@builder.io/mitosis/node",
400
+ name: "Show",
401
+ meta: {},
402
+ scope: {},
403
+ properties: {},
404
+ bindings: {
405
+ when: {
406
+ code: "props.builderBlock && props.builderBlock.children",
407
+ },
408
+ },
409
+ children: [
410
+ {
411
+ "@type": "@builder.io/mitosis/node",
412
+ name: "div",
413
+ meta: {},
414
+ scope: {},
415
+ properties: {
416
+ _text: "\n ",
417
+ },
418
+ bindings: {},
419
+ children: [],
420
+ },
421
+ {
422
+ "@type": "@builder.io/mitosis/node",
423
+ name: "For",
424
+ meta: {},
425
+ scope: {
426
+ For: ["block"],
427
+ },
428
+ properties: {
429
+ _forName: "block",
430
+ },
431
+ bindings: {
432
+ each: {
433
+ code: "props.builderBlock?.children",
434
+ },
435
+ },
436
+ children: [
437
+ {
438
+ "@type": "@builder.io/mitosis/node",
439
+ name: "RenderBlock",
440
+ meta: {},
441
+ scope: {},
442
+ properties: {},
443
+ bindings: {
444
+ block: {
445
+ code: "block",
446
+ },
447
+ context: {
448
+ code: "builderContext",
449
+ },
450
+ },
451
+ children: [],
452
+ },
453
+ ],
454
+ },
455
+ {
456
+ "@type": "@builder.io/mitosis/node",
457
+ name: "div",
458
+ meta: {},
459
+ scope: {},
460
+ properties: {
461
+ _text: "\n ",
462
+ },
463
+ bindings: {},
464
+ children: [],
465
+ },
466
+ ],
467
+ },
468
+ {
469
+ "@type": "@builder.io/mitosis/node",
470
+ name: "div",
471
+ meta: {},
472
+ scope: {},
473
+ properties: {
474
+ _text: "\n\n ",
475
+ },
476
+ bindings: {},
477
+ children: [],
478
+ },
479
+ {
480
+ "@type": "@builder.io/mitosis/node",
481
+ name: "Show",
482
+ meta: {},
483
+ scope: {},
484
+ properties: {},
485
+ bindings: {
486
+ when: {
487
+ code: "submissionState(props,state,formRef,builderContext) === 'error'",
488
+ },
489
+ },
490
+ children: [
491
+ {
492
+ "@type": "@builder.io/mitosis/node",
493
+ name: "div",
494
+ meta: {},
495
+ scope: {},
496
+ properties: {
497
+ _text: "\n ",
498
+ },
499
+ bindings: {},
500
+ children: [],
501
+ },
502
+ {
503
+ "@type": "@builder.io/mitosis/node",
504
+ name: "BuilderBlocks",
505
+ meta: {},
506
+ scope: {},
507
+ properties: {
508
+ dataPath: "errorMessage",
509
+ },
510
+ bindings: {
511
+ blocks: {
512
+ code: "props.errorMessage",
513
+ },
514
+ },
515
+ children: [],
516
+ },
517
+ {
518
+ "@type": "@builder.io/mitosis/node",
519
+ name: "div",
520
+ meta: {},
521
+ scope: {},
522
+ properties: {
523
+ _text: "\n ",
524
+ },
525
+ bindings: {},
526
+ children: [],
527
+ },
528
+ ],
529
+ },
530
+ {
531
+ "@type": "@builder.io/mitosis/node",
532
+ name: "div",
533
+ meta: {},
534
+ scope: {},
535
+ properties: {
536
+ _text: "\n\n ",
537
+ },
538
+ bindings: {},
539
+ children: [],
540
+ },
541
+ {
542
+ "@type": "@builder.io/mitosis/node",
543
+ name: "Show",
544
+ meta: {},
545
+ scope: {},
546
+ properties: {},
547
+ bindings: {
548
+ when: {
549
+ code: "submissionState(props,state,formRef,builderContext) === 'sending'",
550
+ },
551
+ },
552
+ children: [
553
+ {
554
+ "@type": "@builder.io/mitosis/node",
555
+ name: "div",
556
+ meta: {},
557
+ scope: {},
558
+ properties: {
559
+ _text: "\n ",
560
+ },
561
+ bindings: {},
562
+ children: [],
563
+ },
564
+ {
565
+ "@type": "@builder.io/mitosis/node",
566
+ name: "BuilderBlocks",
567
+ meta: {},
568
+ scope: {},
569
+ properties: {
570
+ dataPath: "sendingMessage",
571
+ },
572
+ bindings: {
573
+ blocks: {
574
+ code: "props.sendingMessage",
575
+ },
576
+ },
577
+ children: [],
578
+ },
579
+ {
580
+ "@type": "@builder.io/mitosis/node",
581
+ name: "div",
582
+ meta: {},
583
+ scope: {},
584
+ properties: {
585
+ _text: "\n ",
586
+ },
587
+ bindings: {},
588
+ children: [],
589
+ },
590
+ ],
591
+ },
592
+ {
593
+ "@type": "@builder.io/mitosis/node",
594
+ name: "div",
595
+ meta: {},
596
+ scope: {},
597
+ properties: {
598
+ _text: "\n\n ",
599
+ },
600
+ bindings: {},
601
+ children: [],
602
+ },
603
+ {
604
+ "@type": "@builder.io/mitosis/node",
605
+ name: "Show",
606
+ meta: {},
607
+ scope: {},
608
+ properties: {},
609
+ bindings: {
610
+ when: {
611
+ code: "submissionState(props,state,formRef,builderContext) === 'error' && state.responseData",
612
+ },
613
+ },
614
+ children: [
615
+ {
616
+ "@type": "@builder.io/mitosis/node",
617
+ name: "div",
618
+ meta: {},
619
+ scope: {},
620
+ properties: {
621
+ _text: "\n ",
622
+ },
623
+ bindings: {},
624
+ children: [],
625
+ },
626
+ {
627
+ "@type": "@builder.io/mitosis/node",
628
+ name: "pre",
629
+ meta: {},
630
+ scope: {},
631
+ properties: {
632
+ class: "builder-form-error-text pre-FormComponent",
633
+ },
634
+ bindings: {},
635
+ children: [
636
+ {
637
+ "@type": "@builder.io/mitosis/node",
638
+ name: "div",
639
+ meta: {},
640
+ scope: {},
641
+ properties: {
642
+ _text: "\n ",
643
+ },
644
+ bindings: {},
645
+ children: [],
646
+ },
647
+ {
648
+ "@type": "@builder.io/mitosis/node",
649
+ name: "div",
650
+ meta: {},
651
+ scope: {},
652
+ properties: {},
653
+ bindings: {
654
+ _text: {
655
+ code: "JSON.stringify(state.responseData, null, 2)",
656
+ },
657
+ },
658
+ children: [],
659
+ },
660
+ {
661
+ "@type": "@builder.io/mitosis/node",
662
+ name: "div",
663
+ meta: {},
664
+ scope: {},
665
+ properties: {
666
+ _text: "\n ",
667
+ },
668
+ bindings: {},
669
+ children: [],
670
+ },
671
+ ],
672
+ },
673
+ {
674
+ "@type": "@builder.io/mitosis/node",
675
+ name: "div",
676
+ meta: {},
677
+ scope: {},
678
+ properties: {
679
+ _text: "\n ",
680
+ },
681
+ bindings: {},
682
+ children: [],
683
+ },
684
+ ],
685
+ },
686
+ {
687
+ "@type": "@builder.io/mitosis/node",
688
+ name: "div",
689
+ meta: {},
690
+ scope: {},
691
+ properties: {
692
+ _text: "\n\n ",
693
+ },
694
+ bindings: {},
695
+ children: [],
696
+ },
697
+ {
698
+ "@type": "@builder.io/mitosis/node",
699
+ name: "Show",
700
+ meta: {},
701
+ scope: {},
702
+ properties: {},
703
+ bindings: {
704
+ when: {
705
+ code: "submissionState(props,state,formRef,builderContext) === 'success'",
706
+ },
707
+ },
708
+ children: [
709
+ {
710
+ "@type": "@builder.io/mitosis/node",
711
+ name: "div",
712
+ meta: {},
713
+ scope: {},
714
+ properties: {
715
+ _text: "\n ",
716
+ },
717
+ bindings: {},
718
+ children: [],
719
+ },
720
+ {
721
+ "@type": "@builder.io/mitosis/node",
722
+ name: "BuilderBlocks",
723
+ meta: {},
724
+ scope: {},
725
+ properties: {
726
+ dataPath: "successMessage",
727
+ },
728
+ bindings: {
729
+ blocks: {
730
+ code: "props.successMessage",
731
+ },
732
+ },
733
+ children: [],
734
+ },
735
+ {
736
+ "@type": "@builder.io/mitosis/node",
737
+ name: "div",
738
+ meta: {},
739
+ scope: {},
740
+ properties: {
741
+ _text: "\n ",
742
+ },
743
+ bindings: {},
744
+ children: [],
745
+ },
746
+ ],
747
+ },
748
+ {
749
+ "@type": "@builder.io/mitosis/node",
750
+ name: "div",
751
+ meta: {},
752
+ scope: {},
753
+ properties: {
754
+ _text: "\n ",
755
+ },
756
+ bindings: {},
757
+ children: [],
758
+ },
759
+ ],
760
+ },
761
+ ],
762
+ hooks: {},
763
+ context: {
764
+ get: {
765
+ builderContext: {
766
+ name: "BuilderContext",
767
+ path: null,
768
+ },
769
+ },
770
+ set: {},
771
+ },
772
+ name: "FormComponent",
773
+ subComponents: [],
774
+ interfaces: [
775
+ "// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-nocheck\n\n/* eslint-disable */\n\n/**\n * This component was copied over from the old SDKs and has a lot of code pointing to invalid functions/env vars. It needs\n * to be cleaned up before the component can actually be usable.\n */\ninterface BuilderElement {}",
776
+ "// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-nocheck\n\n/* eslint-disable */\n\n/**\n * This component was copied over from the old SDKs and has a lot of code pointing to invalid functions/env vars. It needs\n * to be cleaned up before the component can actually be usable.\n */\nexport interface FormProps {\n attributes?: any;\n name?: string;\n action?: string;\n validate?: boolean;\n method?: string;\n builderBlock?: BuilderElement;\n sendSubmissionsTo?: string;\n sendSubmissionsToEmail?: string;\n sendWithJs?: boolean;\n contentType?: string;\n customHeaders?: {\n [key: string]: string;\n };\n successUrl?: string;\n previewState?: FormState;\n successMessage?: BuilderElement[];\n errorMessage?: BuilderElement[];\n sendingMessage?: BuilderElement[];\n resetFormOnSubmit?: boolean;\n errorMessagePath?: string;\n}",
777
+ ],
778
+ types: [
779
+ "// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-nocheck\n\n/* eslint-disable */\n\n/**\n * This component was copied over from the old SDKs and has a lot of code pointing to invalid functions/env vars. It needs\n * to be cleaned up before the component can actually be usable.\n */\nexport type FormState = 'unsubmitted' | 'sending' | 'success' | 'error';",
780
+ ],
781
+ propsTypeRef: "FormProps",
782
+ };