@builder.io/sdk-svelte 0.0.1-3 → 0.0.1-32

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 (91) hide show
  1. package/README.md +19 -0
  2. package/package.json +8 -1
  3. package/src/blocks/button/button.svelte +35 -48
  4. package/src/blocks/columns/columns.svelte +137 -103
  5. package/src/blocks/columns/component-info.js +26 -1
  6. package/src/blocks/custom-code/custom-code.svelte +58 -53
  7. package/src/blocks/embed/component-info.js +21 -1
  8. package/src/blocks/embed/embed.svelte +45 -57
  9. package/src/blocks/embed/helpers.js +9 -0
  10. package/src/blocks/form/form.svelte +313 -296
  11. package/src/blocks/fragment/fragment.svelte +9 -25
  12. package/src/blocks/image/component-info.js +48 -1
  13. package/src/blocks/image/image.helpers.js +48 -0
  14. package/src/blocks/image/image.svelte +146 -117
  15. package/src/blocks/img/img.svelte +48 -36
  16. package/src/blocks/input/input.svelte +30 -31
  17. package/src/blocks/raw-text/raw-text.svelte +12 -26
  18. package/src/blocks/section/section.svelte +30 -36
  19. package/src/blocks/select/select.svelte +30 -37
  20. package/src/blocks/submit-button/submit-button.svelte +12 -30
  21. package/src/blocks/symbol/component-info.js +1 -0
  22. package/src/blocks/symbol/symbol.svelte +88 -53
  23. package/src/blocks/text/text.svelte +8 -25
  24. package/src/blocks/textarea/textarea.svelte +16 -29
  25. package/src/blocks/util.js +7 -0
  26. package/src/blocks/video/video.svelte +88 -41
  27. package/src/components/render-block/block-styles.svelte +58 -51
  28. package/src/components/render-block/render-block.helpers.js +23 -0
  29. package/src/components/render-block/render-block.svelte +204 -160
  30. package/src/components/render-block/render-component.svelte +30 -0
  31. package/src/components/render-block/render-repeated-block.svelte +45 -0
  32. package/src/components/render-block/types.js +0 -0
  33. package/src/components/render-blocks.svelte +88 -80
  34. package/src/components/render-content/components/render-styles.svelte +59 -63
  35. package/src/components/render-content/index.js +4 -0
  36. package/src/components/render-content/render-content.svelte +316 -207
  37. package/src/components/render-inlined-styles.svelte +26 -48
  38. package/src/constants/builder-registered-components.js +51 -0
  39. package/src/constants/device-sizes.js +3 -21
  40. package/src/context/builder.context.js +7 -1
  41. package/src/functions/camel-to-kebab-case.js +4 -0
  42. package/src/functions/convert-style-object.js +6 -0
  43. package/src/functions/get-block-component-options.js +6 -1
  44. package/src/functions/get-block-styles.js +7 -4
  45. package/src/functions/get-builder-search-params/index.js +12 -1
  46. package/src/functions/get-content/ab-testing.js +38 -0
  47. package/src/functions/get-content/fn.test.js +1 -1
  48. package/src/functions/get-content/index.js +16 -58
  49. package/src/functions/get-content/types.js +0 -0
  50. package/src/functions/get-fetch.js +2 -2
  51. package/src/functions/get-processed-block.js +19 -8
  52. package/src/functions/get-processed-block.test.js +2 -1
  53. package/src/functions/register-component.js +45 -26
  54. package/src/functions/sanitize-styles.js +5 -0
  55. package/src/functions/track.js +71 -2
  56. package/src/helpers/cookie.js +59 -0
  57. package/src/helpers/css.js +12 -0
  58. package/src/helpers/flatten.js +34 -0
  59. package/src/helpers/localStorage.js +34 -0
  60. package/src/helpers/nullable.js +4 -0
  61. package/src/helpers/sessionId.js +26 -0
  62. package/src/helpers/time.js +5 -0
  63. package/src/helpers/url.js +10 -0
  64. package/src/helpers/url.test.js +15 -0
  65. package/src/helpers/uuid.js +13 -0
  66. package/src/helpers/visitorId.js +33 -0
  67. package/src/index-helpers/blocks-exports.js +10 -8
  68. package/src/scripts/init-editing.js +4 -5
  69. package/src/types/can-track.js +0 -0
  70. package/src/types/components.js +0 -0
  71. package/src/types/element.js +0 -0
  72. package/src/blocks/button/index.js +0 -7
  73. package/src/blocks/columns/index.js +0 -7
  74. package/src/blocks/custom-code/index.js +0 -7
  75. package/src/blocks/embed/index.js +0 -7
  76. package/src/blocks/form/index.js +0 -7
  77. package/src/blocks/fragment/index.js +0 -7
  78. package/src/blocks/image/index.js +0 -7
  79. package/src/blocks/img/index.js +0 -7
  80. package/src/blocks/input/index.js +0 -7
  81. package/src/blocks/raw-text/index.js +0 -7
  82. package/src/blocks/section/index.js +0 -7
  83. package/src/blocks/select/index.js +0 -7
  84. package/src/blocks/submit-button/index.js +0 -7
  85. package/src/blocks/symbol/index.js +0 -7
  86. package/src/blocks/text/index.js +0 -7
  87. package/src/blocks/textarea/index.js +0 -7
  88. package/src/blocks/video/index.js +0 -7
  89. package/src/components/error-boundary.svelte +0 -26
  90. package/src/functions/macro-eval.js +0 -5
  91. package/src/functions/previewing-model-name.js +0 -11
@@ -1,333 +1,350 @@
1
- <script>
2
-
3
-
4
-
5
-
6
- import RenderBlock, { } from '../../components/render-block/render-block.svelte';
7
- import { isEditing } from '../../functions/is-editing.js';
8
-
9
-
10
-
11
-
12
-
13
-
14
- export let formRef;
15
- export let previewState;
16
- export let sendWithJs;
17
- export let sendSubmissionsTo;
18
- export let action;
19
- export let customHeaders;
20
- export let contentType;
21
- export let sendSubmissionsToEmail;
22
- export let name;
23
- export let method;
24
- export let errorMessagePath;
25
- export let resetFormOnSubmit;
26
- export let successUrl;
27
- export let validate;
28
- export let attributes;
29
- export let builderBlock;
30
- export let errorMessage;
31
- export let sendingMessage;
32
- export let successMessage;
33
-
34
- function onSubmit(event) {
35
- const sendWithJs = sendWithJs || sendSubmissionsTo === 'email';
36
-
37
- if (sendSubmissionsTo === 'zapier') {
38
- event.preventDefault();
39
- } else if (sendWithJs) {
40
- if (!(action || sendSubmissionsTo === 'email')) {
41
- event.preventDefault();
42
- return;
1
+ <script context="module" lang="ts">
2
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
3
+ // @ts-nocheck
4
+
5
+ /* eslint-disable */
6
+
7
+ /**
8
+ * This component was copied over from the old SDKs and has a lot of code pointing to invalid functions/env vars. It needs
9
+ * to be cleaned up before the component can actually be usable.
10
+ */
11
+ interface BuilderElement {}
12
+
13
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
14
+ // @ts-nocheck
15
+
16
+ /* eslint-disable */
17
+
18
+ /**
19
+ * This component was copied over from the old SDKs and has a lot of code pointing to invalid functions/env vars. It needs
20
+ * to be cleaned up before the component can actually be usable.
21
+ */
22
+ export interface FormProps {
23
+ attributes?: any;
24
+ name?: string;
25
+ action?: string;
26
+ validate?: boolean;
27
+ method?: string;
28
+ builderBlock?: BuilderElement;
29
+ sendSubmissionsTo?: string;
30
+ sendSubmissionsToEmail?: string;
31
+ sendWithJs?: boolean;
32
+ contentType?: string;
33
+ customHeaders?: {
34
+ [key: string]: string;
35
+ };
36
+ successUrl?: string;
37
+ previewState?: FormState;
38
+ successMessage?: BuilderElement[];
39
+ errorMessage?: BuilderElement[];
40
+ sendingMessage?: BuilderElement[];
41
+ resetFormOnSubmit?: boolean;
42
+ errorMessagePath?: string;
43
43
  }
44
44
 
45
- event.preventDefault();
46
- const el = event.currentTarget;
47
- const headers = customHeaders || {};
48
- let body;
49
- const formData = new FormData(el); // TODO: maybe support null
45
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
46
+ // @ts-nocheck
47
+
48
+ /* eslint-disable */
49
+
50
+ /**
51
+ * This component was copied over from the old SDKs and has a lot of code pointing to invalid functions/env vars. It needs
52
+ * to be cleaned up before the component can actually be usable.
53
+ */
54
+ export type FormState = "unsubmitted" | "sending" | "success" | "error";
55
+ </script>
56
+
57
+ <script lang="ts">
58
+ import RenderBlock from "../../components/render-block/render-block.svelte";
59
+ import BuilderBlocks from "../../components/render-blocks.svelte";
60
+ import { isEditing } from "../../functions/is-editing.js";
61
+
62
+ import { getContext, setContext } from "svelte";
63
+
64
+ export let formRef: FormProps["formRef"];
65
+ export let previewState: FormProps["previewState"];
66
+ export let sendWithJs: FormProps["sendWithJs"];
67
+ export let sendSubmissionsTo: FormProps["sendSubmissionsTo"];
68
+ export let action: FormProps["action"];
69
+ export let customHeaders: FormProps["customHeaders"];
70
+ export let contentType: FormProps["contentType"];
71
+ export let sendSubmissionsToEmail: FormProps["sendSubmissionsToEmail"];
72
+ export let name: FormProps["name"];
73
+ export let method: FormProps["method"];
74
+ export let errorMessagePath: FormProps["errorMessagePath"];
75
+ export let resetFormOnSubmit: FormProps["resetFormOnSubmit"];
76
+ export let successUrl: FormProps["successUrl"];
77
+ export let validate: FormProps["validate"];
78
+ export let attributes: FormProps["attributes"];
79
+ export let builderBlock: FormProps["builderBlock"];
80
+ export let errorMessage: FormProps["errorMessage"];
81
+ export let sendingMessage: FormProps["sendingMessage"];
82
+ export let successMessage: FormProps["successMessage"];
83
+
84
+ let builderContext = getContext(BuilderContext.key);
85
+
86
+ const onSubmit = function onSubmit(event) {
87
+ const sendWithJs = sendWithJs || sendSubmissionsTo === "email";
88
+
89
+ if (sendSubmissionsTo === "zapier") {
90
+ event.preventDefault();
91
+ } else if (sendWithJs) {
92
+ if (!(action || sendSubmissionsTo === "email")) {
93
+ event.preventDefault();
94
+ return;
95
+ }
50
96
 
51
- const formPairs = Array.from(event.currentTarget.querySelectorAll('input,select,textarea')).filter(el => !!el.name).map(el => {
52
- let value;
53
- const key = el.name;
97
+ event.preventDefault();
98
+ const el = event.currentTarget;
99
+ const headers = customHeaders || {};
100
+ let body;
101
+ const formData = new FormData(el); // TODO: maybe support null
102
+
103
+ const formPairs = Array.from(
104
+ event.currentTarget.querySelectorAll("input,select,textarea")
105
+ )
106
+ .filter((el) => !!el.name)
107
+ .map((el) => {
108
+ let value;
109
+ const key = el.name;
110
+
111
+ if (el instanceof HTMLInputElement) {
112
+ if (el.type === "radio") {
113
+ if (el.checked) {
114
+ value = el.name;
115
+ return {
116
+ key,
117
+ value,
118
+ };
119
+ }
120
+ } else if (el.type === "checkbox") {
121
+ value = el.checked;
122
+ } else if (el.type === "number" || el.type === "range") {
123
+ const num = el.valueAsNumber;
124
+
125
+ if (!isNaN(num)) {
126
+ value = num;
127
+ }
128
+ } else if (el.type === "file") {
129
+ // TODO: one vs multiple files
130
+ value = el.files;
131
+ } else {
132
+ value = el.value;
133
+ }
134
+ } else {
135
+ value = el.value;
136
+ }
54
137
 
55
- if (el instanceof HTMLInputElement) {
56
- if (el.type === 'radio') {
57
- if (el.checked) {
58
- value = el.name;
59
138
  return {
60
139
  key,
61
- value
140
+ value,
62
141
  };
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;
142
+ });
143
+ let contentType = contentType;
68
144
 
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;
145
+ if (sendSubmissionsTo === "email") {
146
+ contentType = "multipart/form-data";
77
147
  }
78
- } else {
79
- value = el.value;
80
- }
81
-
82
- return {
83
- key,
84
- value
85
- };
86
- });
87
- let contentType = contentType;
88
-
89
- if (sendSubmissionsTo === 'email') {
90
- contentType = 'multipart/form-data';
91
- }
92
-
93
- Array.from(formPairs).forEach(({
94
- value
95
- }) => {
96
- if (value instanceof File || Array.isArray(value) && value[0] instanceof File || value instanceof FileList) {
97
- contentType = 'multipart/form-data';
98
- }
99
- }); // TODO: send as urlEncoded or multipart by default
100
- // because of ease of use and reliability in browser API
101
- // for encoding the form?
102
-
103
- if (contentType !== 'application/json') {
104
- body = formData;
105
- } else {
106
- // Json
107
- const json = {};
108
- Array.from(formPairs).forEach(({
109
- value,
110
- key
111
- }) => {
112
- set(json, key, value);
113
- });
114
- body = JSON.stringify(json);
115
- }
116
-
117
- if (contentType && contentType !== 'multipart/form-data') {
118
- if (
119
- /* Zapier doesn't allow content-type header to be sent from browsers */
120
- !(sendWithJs && action?.includes('zapier.com'))) {
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
148
 
139
- formState = 'sending';
140
- const formUrl = `${builder.env === 'dev' ? 'http://localhost:5000' : 'https://builder.io'}/api/v1/form-submit?apiKey=${builder.apiKey}&to=${btoa(sendSubmissionsToEmail || '')}&name=${encodeURIComponent(name || '')}`;
141
- fetch(sendSubmissionsTo === 'email' ? formUrl : action
142
- /* TODO: throw error if no action URL */
143
- , {
144
- body,
145
- headers,
146
- method: method || 'post'
147
- }).then(async res => {
148
- let body;
149
- const contentType = res.headers.get('content-type');
150
-
151
- if (contentType && contentType.indexOf('application/json') !== -1) {
152
- body = await res.json();
153
- } else {
154
- body = await res.text();
155
- }
156
-
157
- if (!res.ok && errorMessagePath) {
158
- /* TODO: allow supplying an error formatter function */
159
- let message = get(body, errorMessagePath);
160
-
161
- if (message) {
162
- if (typeof message !== 'string') {
163
- /* TODO: ideally convert json to yaml so it woul dbe like
164
- error: - email has been taken */
165
- message = JSON.stringify(message);
149
+ Array.from(formPairs).forEach(({ value }) => {
150
+ if (
151
+ value instanceof File ||
152
+ (Array.isArray(value) && value[0] instanceof File) ||
153
+ value instanceof FileList
154
+ ) {
155
+ contentType = "multipart/form-data";
166
156
  }
157
+ }); // TODO: send as urlEncoded or multipart by default
158
+ // because of ease of use and reliability in browser API
159
+ // for encoding the form?
167
160
 
168
- formErrorMessage = message;
161
+ if (contentType !== "application/json") {
162
+ body = formData;
163
+ } else {
164
+ // Json
165
+ const json = {};
166
+ Array.from(formPairs).forEach(({ value, key }) => {
167
+ set(json, key, value);
168
+ });
169
+ body = JSON.stringify(json);
169
170
  }
170
- }
171
171
 
172
- responseData = body;
173
- formState = res.ok ? 'success' : 'error';
172
+ if (contentType && contentType !== "multipart/form-data") {
173
+ if (
174
+ /* Zapier doesn't allow content-type header to be sent from browsers */
175
+ !(sendWithJs && action?.includes("zapier.com"))
176
+ ) {
177
+ headers["content-type"] = contentType;
178
+ }
179
+ }
174
180
 
175
- if (res.ok) {
176
- const submitSuccessEvent = new CustomEvent('submit:success', {
181
+ const presubmitEvent = new CustomEvent("presubmit", {
177
182
  detail: {
178
- res,
179
- body
180
- }
183
+ body,
184
+ },
181
185
  });
182
186
 
183
187
  if (formRef) {
184
- formRef.dispatchEvent(submitSuccessEvent);
188
+ formRef.dispatchEvent(presubmitEvent);
185
189
 
186
- if (submitSuccessEvent.defaultPrevented) {
190
+ if (presubmitEvent.defaultPrevented) {
187
191
  return;
188
192
  }
189
- /* TODO: option to turn this on/off? */
190
-
191
-
192
- if (resetFormOnSubmit !== false) {
193
- formRef.reset();
194
- }
195
193
  }
196
- /* TODO: client side route event first that can be preventDefaulted */
197
194
 
198
-
199
- if (successUrl) {
200
- if (formRef) {
201
- const event = new CustomEvent('route', {
202
- detail: {
203
- url: successUrl
204
- }
205
- });
206
- formRef.dispatchEvent(event);
207
-
208
- if (!event.defaultPrevented) {
209
- location.href = successUrl;
210
- }
211
- } else {
212
- location.href = successUrl;
195
+ formState = "sending";
196
+ const formUrl = `${
197
+ builder.env === "dev" ? "http://localhost:5000" : "https://builder.io"
198
+ }/api/v1/form-submit?apiKey=${builder.apiKey}&to=${btoa(
199
+ sendSubmissionsToEmail || ""
200
+ )}&name=${encodeURIComponent(name || "")}`;
201
+ fetch(
202
+ sendSubmissionsTo === "email" ? formUrl : action,
203
+ /* TODO: throw error if no action URL */
204
+ {
205
+ body,
206
+ headers,
207
+ method: method || "post",
213
208
  }
214
- }
215
- }
216
- }, err => {
217
- const submitErrorEvent = new CustomEvent('submit:error', {
218
- detail: {
219
- error: err
220
- }
221
- });
222
-
223
- if (formRef) {
224
- formRef.dispatchEvent(submitErrorEvent);
225
-
226
- if (submitErrorEvent.defaultPrevented) {
227
- return;
228
- }
229
- }
230
-
231
- responseData = err;
232
- formState = 'error';
233
- });
234
- }
235
- }
236
- $: submissionState = () => {
237
- return isEditing() && previewState || formState;
238
- };
239
-
240
-
241
-
242
- let formState = 'unsubmitted';
243
- let responseData = null;
244
- let formErrorMessage = '';
245
-
246
-
247
-
248
-
249
-
250
-
251
- </script>
252
-
253
- <form {...attributes} validate={validate} bind:this={formRef} action={!sendWithJs && action} method={method} name={name} on:submit="{event => onSubmit(event)}" >
254
-
255
-
256
- {#if builderBlock && builderBlock.children }
257
-
258
-
259
-
260
- {#each builderBlock?.children as block, index }
261
- <RenderBlock block={block} ></RenderBlock>
262
- {/each}
263
-
264
-
265
-
266
-
267
-
268
- {/if}
269
-
270
-
271
-
272
-
273
- {#if submissionState() === 'error' }
274
-
275
-
276
- <svelte:component dataPath="errorMessage" blocks={errorMessage} this={BuilderBlocks} ></svelte:component>
277
-
278
-
279
-
280
-
281
- {/if}
282
-
209
+ ).then(
210
+ async (res) => {
211
+ let body;
212
+ const contentType = res.headers.get("content-type");
213
+
214
+ if (contentType && contentType.indexOf("application/json") !== -1) {
215
+ body = await res.json();
216
+ } else {
217
+ body = await res.text();
218
+ }
283
219
 
284
-
220
+ if (!res.ok && errorMessagePath) {
221
+ /* TODO: allow supplying an error formatter function */
222
+ let message = get(body, errorMessagePath);
285
223
 
286
- {#if submissionState() === 'sending' }
224
+ if (message) {
225
+ if (typeof message !== "string") {
226
+ /* TODO: ideally convert json to yaml so it woul dbe like
227
+ error: - email has been taken */
228
+ message = JSON.stringify(message);
229
+ }
287
230
 
288
-
289
- <svelte:component dataPath="sendingMessage" blocks={sendingMessage} this={BuilderBlocks} ></svelte:component>
231
+ formErrorMessage = message;
232
+ }
233
+ }
290
234
 
291
-
235
+ responseData = body;
236
+ formState = res.ok ? "success" : "error";
292
237
 
238
+ if (res.ok) {
239
+ const submitSuccessEvent = new CustomEvent("submit:success", {
240
+ detail: {
241
+ res,
242
+ body,
243
+ },
244
+ });
293
245
 
294
- {/if}
246
+ if (formRef) {
247
+ formRef.dispatchEvent(submitSuccessEvent);
295
248
 
249
+ if (submitSuccessEvent.defaultPrevented) {
250
+ return;
251
+ }
252
+ /* TODO: option to turn this on/off? */
296
253
 
297
-
254
+ if (resetFormOnSubmit !== false) {
255
+ formRef.reset();
256
+ }
257
+ }
258
+ /* TODO: client side route event first that can be preventDefaulted */
259
+
260
+ if (successUrl) {
261
+ if (formRef) {
262
+ const event = new CustomEvent("route", {
263
+ detail: {
264
+ url: successUrl,
265
+ },
266
+ });
267
+ formRef.dispatchEvent(event);
268
+
269
+ if (!event.defaultPrevented) {
270
+ location.href = successUrl;
271
+ }
272
+ } else {
273
+ location.href = successUrl;
274
+ }
275
+ }
276
+ }
277
+ },
278
+ (err) => {
279
+ const submitErrorEvent = new CustomEvent("submit:error", {
280
+ detail: {
281
+ error: err,
282
+ },
283
+ });
298
284
 
299
- {#if submissionState() === 'error' && responseData }
285
+ if (formRef) {
286
+ formRef.dispatchEvent(submitErrorEvent);
300
287
 
301
-
302
- <pre class="builder-form-error-text pre" >
303
-
304
- {JSON.stringify(responseData, null, 2)}
288
+ if (submitErrorEvent.defaultPrevented) {
289
+ return;
290
+ }
291
+ }
305
292
 
293
+ responseData = err;
294
+ formState = "error";
295
+ }
296
+ );
297
+ }
298
+ };
299
+ $: submissionState = () => {
300
+ return (isEditing() && previewState) || formState;
301
+ };
302
+
303
+ let formState = "unsubmitted";
304
+ let responseData = null;
305
+ let formErrorMessage = "";
306
+ </script>
307
+
308
+ <form
309
+ {...attributes}
310
+ {validate}
311
+ bind:this={formRef}
312
+ action={!sendWithJs && action}
313
+ {method}
314
+ {name}
315
+ on:submit={(event) => {
316
+ onSubmit(event);
317
+ }}
318
+ >
319
+ {#if builderBlock && builderBlock.children}
320
+ {#each builderBlock?.children as block}
321
+ <RenderBlock {block} context={builderContext} />
322
+ {/each}
323
+ {/if}
324
+
325
+ {#if submissionState() === "error"}
326
+ <BuilderBlocks dataPath="errorMessage" blocks={errorMessage} />
327
+ {/if}
328
+
329
+ {#if submissionState() === "sending"}
330
+ <BuilderBlocks dataPath="sendingMessage" blocks={sendingMessage} />
331
+ {/if}
332
+
333
+ {#if submissionState() === "error" && responseData}
334
+ <pre class="builder-form-error-text pre">
335
+ {JSON.stringify(responseData, null, 2)}
306
336
  </pre>
307
-
308
-
309
-
310
-
311
- {/if}
312
-
313
-
314
-
315
-
316
- {#if submissionState() === 'success' }
317
-
318
-
319
- <svelte:component dataPath="successMessage" blocks={successMessage} this={BuilderBlocks} ></svelte:component>
320
-
321
-
322
-
323
-
324
- {/if}
325
-
326
- </form>
327
-
328
- <style>
329
- .pre {
330
- padding: 10px;
331
- color: red;
332
- text-align: center; }
333
- </style>
337
+ {/if}
338
+
339
+ {#if submissionState() === "success"}
340
+ <BuilderBlocks dataPath="successMessage" blocks={successMessage} />
341
+ {/if}
342
+ </form>
343
+
344
+ <style>
345
+ .pre {
346
+ padding: 10px;
347
+ color: red;
348
+ text-align: center;
349
+ }
350
+ </style>
@@ -1,28 +1,12 @@
1
- <script>
2
-
3
-
4
-
5
-
6
-
7
-
8
-
9
-
10
-
11
-
12
-
13
-
14
-
15
-
16
-
17
-
18
-
19
-
20
-
21
-
22
-
23
-
1
+ <script context="module" lang="ts">
2
+ export interface FragmentProps {
3
+ maxWidth?: number;
4
+ attributes?: any;
5
+ children?: any;
6
+ }
7
+ </script>
24
8
 
25
-
9
+ <script lang="ts">
26
10
  </script>
27
11
 
28
- <span ><slot></slot></span>
12
+ <span><slot /></span>