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

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 (77) hide show
  1. package/README.md +19 -0
  2. package/package.json +8 -1
  3. package/src/blocks/button/button.svelte +25 -47
  4. package/src/blocks/columns/columns.svelte +115 -102
  5. package/src/blocks/columns/component-info.js +25 -1
  6. package/src/blocks/custom-code/custom-code.svelte +59 -61
  7. package/src/blocks/embed/component-info.js +20 -1
  8. package/src/blocks/embed/embed.svelte +38 -56
  9. package/src/blocks/embed/helpers.js +9 -0
  10. package/src/blocks/form/form.svelte +264 -294
  11. package/src/blocks/fragment/fragment.svelte +1 -25
  12. package/src/blocks/image/component-info.js +47 -1
  13. package/src/blocks/image/image.helpers.js +48 -0
  14. package/src/blocks/image/image.svelte +126 -116
  15. package/src/blocks/img/img.svelte +25 -35
  16. package/src/blocks/input/input.svelte +17 -30
  17. package/src/blocks/raw-text/raw-text.svelte +4 -25
  18. package/src/blocks/section/section.svelte +20 -35
  19. package/src/blocks/select/select.svelte +16 -36
  20. package/src/blocks/submit-button/submit-button.svelte +4 -29
  21. package/src/blocks/symbol/component-info.js +1 -0
  22. package/src/blocks/symbol/symbol.svelte +67 -52
  23. package/src/blocks/text/text.svelte +1 -24
  24. package/src/blocks/textarea/textarea.svelte +5 -28
  25. package/src/blocks/video/video.svelte +60 -41
  26. package/src/components/render-block/block-styles.svelte +54 -50
  27. package/src/components/render-block/render-block.helpers.js +23 -0
  28. package/src/components/render-block/render-block.svelte +199 -159
  29. package/src/components/render-block/render-component.svelte +20 -0
  30. package/src/components/render-block/render-repeated-block.svelte +29 -0
  31. package/src/components/render-block/types.js +0 -0
  32. package/src/components/render-blocks.svelte +74 -79
  33. package/src/components/render-content/components/render-styles.svelte +43 -63
  34. package/src/components/render-content/index.js +4 -0
  35. package/src/components/render-content/render-content.svelte +266 -207
  36. package/src/components/render-inlined-styles.svelte +15 -43
  37. package/src/constants/builder-registered-components.js +48 -0
  38. package/src/constants/device-sizes.js +3 -21
  39. package/src/context/builder.context.js +7 -1
  40. package/src/functions/camel-to-kebab-case.js +4 -0
  41. package/src/functions/convert-style-object.js +6 -0
  42. package/src/functions/get-block-component-options.js +6 -1
  43. package/src/functions/get-block-styles.js +7 -4
  44. package/src/functions/get-builder-search-params/index.js +12 -1
  45. package/src/functions/get-content/ab-testing.js +38 -0
  46. package/src/functions/get-content/fn.test.js +1 -1
  47. package/src/functions/get-content/index.js +16 -58
  48. package/src/functions/get-content/types.js +0 -0
  49. package/src/functions/get-processed-block.js +15 -8
  50. package/src/functions/get-processed-block.test.js +2 -1
  51. package/src/functions/register-component.js +45 -26
  52. package/src/functions/sanitize-styles.js +5 -0
  53. package/src/helpers/css.js +12 -0
  54. package/src/helpers/flatten.js +34 -0
  55. package/src/index-helpers/blocks-exports.js +10 -8
  56. package/src/types/components.js +0 -0
  57. package/src/types/element.js +0 -0
  58. package/src/blocks/button/index.js +0 -7
  59. package/src/blocks/columns/index.js +0 -7
  60. package/src/blocks/custom-code/index.js +0 -7
  61. package/src/blocks/embed/index.js +0 -7
  62. package/src/blocks/form/index.js +0 -7
  63. package/src/blocks/fragment/index.js +0 -7
  64. package/src/blocks/image/index.js +0 -7
  65. package/src/blocks/img/index.js +0 -7
  66. package/src/blocks/input/index.js +0 -7
  67. package/src/blocks/raw-text/index.js +0 -7
  68. package/src/blocks/section/index.js +0 -7
  69. package/src/blocks/select/index.js +0 -7
  70. package/src/blocks/submit-button/index.js +0 -7
  71. package/src/blocks/symbol/index.js +0 -7
  72. package/src/blocks/text/index.js +0 -7
  73. package/src/blocks/textarea/index.js +0 -7
  74. package/src/blocks/video/index.js +0 -7
  75. package/src/components/error-boundary.svelte +0 -26
  76. package/src/functions/macro-eval.js +0 -5
  77. package/src/functions/previewing-model-name.js +0 -11
package/README.md ADDED
@@ -0,0 +1,19 @@
1
+ # Builder.io Svelte SDK (BETA)
2
+
3
+ This is the Svelte SDK. It is currently in beta.
4
+
5
+ ## Mitosis
6
+
7
+ This SDK is generated by [Mitosis](https://github.com/BuilderIO/mitosis). To see the Mitosis source-code, go [here](../../).
8
+
9
+ ## Feature Support
10
+
11
+ To check the status of the SDK, look at [these tables](../../README.md#feature-implementation).
12
+
13
+ ## Getting Started
14
+
15
+ ```
16
+ npm install @builder.io/sdk-svelte@dev
17
+ ```
18
+
19
+ Take a look at [our example repo](/examples/svelte/sveltekit) for how to use this SDK.
package/package.json CHANGED
@@ -1,13 +1,20 @@
1
1
  {
2
2
  "name": "@builder.io/sdk-svelte",
3
3
  "description": "Builder.io SDK for Svelte",
4
- "version": "0.0.1-3",
4
+ "version": "0.0.1-30",
5
5
  "type": "module",
6
6
  "files": [
7
7
  "src"
8
8
  ],
9
+ "homepage": "https://github.com/BuilderIO/builder/tree/main/packages/sdks/output/svelte#readme",
10
+ "repository": {
11
+ "type": "git",
12
+ "url": "https://github.com/BuilderIO/builder.git",
13
+ "directory": "packages/sdks/output/svelte"
14
+ },
9
15
  "main": "./src/index.js",
10
16
  "module": "./src/index.js",
17
+ "svelte": "./src/index.js",
11
18
  "exports": {
12
19
  ".": {
13
20
  "import": "./src/index.js",
@@ -1,49 +1,27 @@
1
1
  <script>
2
-
3
-
4
-
5
-
6
-
7
-
8
-
9
-
10
-
11
-
12
- export let attributes;
13
- export let text;
14
- export let link;
15
- export let openLinkInNewTab;
16
-
17
-
18
-
19
-
20
-
21
-
22
-
23
-
24
-
25
-
26
-
27
-
28
-
29
- </script>
30
-
31
-
32
-
33
-
34
- {#if link }
35
-
36
-
37
- <a {...attributes} role="button" href={link} target={openLinkInNewTab ? '_blank' : undefined} >
38
-
39
- {text}
40
-
41
- </a>
42
-
43
-
44
-
45
-
2
+ export let attributes;
3
+ export let text;
4
+ export let link;
5
+ export let openLinkInNewTab;
6
+ </script>
7
+
8
+ {#if link}
9
+ <a
10
+ {...attributes}
11
+ role="button"
12
+ href={link}
13
+ target={openLinkInNewTab ? "_blank" : undefined}
14
+ >
15
+ {text}
16
+ </a>
46
17
  {:else}
47
- <span {...attributes}>{text}</span>
48
-
49
- {/if}
18
+ <button {...attributes} class="button">
19
+ {text}
20
+ </button>
21
+ {/if}
22
+
23
+ <style>
24
+ .button {
25
+ all: unset;
26
+ }
27
+ </style>
@@ -1,103 +1,116 @@
1
1
  <script>
2
-
3
-
4
-
5
-
6
- import RenderBlocks, { } from '../../components/render-blocks.svelte';
7
-
8
-
9
-
10
-
11
-
12
-
13
- export let space;
14
- export let columns;
15
- export let stackColumnsAt;
16
- export let reverseColumnsWhenStacked;
17
-
18
- function getGutterSize() {
19
- return typeof space === 'number' ? space || 0 : 20;
20
- }
21
-
22
- function getColumns() {
23
- return columns || [];
24
- }
25
-
26
- function getWidth(index) {
27
- const columns = getColumns();
28
- return columns[index]?.width || 100 / columns.length;
29
- }
30
-
31
- function getColumnCssWidth(index) {
32
- const columns = getColumns();
33
- const gutterSize = getGutterSize();
34
- const subtractWidth = gutterSize * (columns.length - 1) / columns.length;
35
- return `calc(${getWidth(index)}% - ${subtractWidth}px)`;
36
- }
37
-
38
- function maybeApplyForTablet(prop) {
39
- const _stackColumnsAt = stackColumnsAt || 'tablet';
40
-
41
- return _stackColumnsAt === 'tablet' ? prop : 'inherit';
42
- }
43
- $: columnsCssVars = () => {
44
- const flexDir = stackColumnsAt === 'never' ? 'inherit' : reverseColumnsWhenStacked ? 'column-reverse' : 'column';
45
- return {
46
- '--flex-dir': flexDir,
47
- '--flex-dir-tablet': maybeApplyForTablet(flexDir)
48
- };
49
- };
50
-
51
- $: columnCssVars = () => {
52
- const width = '100%';
53
- const marginLeft = '0';
54
- return {
55
- '--column-width': width,
56
- '--column-margin-left': marginLeft,
57
- '--column-width-tablet': maybeApplyForTablet(width),
58
- '--column-margin-left-tablet': maybeApplyForTablet(marginLeft)
59
- };
60
- };
61
-
62
-
63
-
64
-
65
-
66
-
67
-
68
-
69
-
70
-
71
- </script>
72
-
73
- <div class="builder-columns div" style={columnsCssVars()} >
74
-
75
-
76
- {#each columns as column, index }
77
- <div class="builder-column div-2" style={{
78
- width: getColumnCssWidth(index),
79
- marginLeft: `${index === 0 ? 0 : getGutterSize()}px`,
80
- ...columnCssVars()
81
- }} >
82
-
83
- <RenderBlocks blocks={column.blocks} ></RenderBlocks>
84
-
85
- </div>
86
- {/each}
87
-
88
-
89
- </div>
90
-
91
- <style>
92
- .div {
93
- display: flex;
94
- align-items: stretch;
95
- line-height: normal; }@media (max-width: 999px) { .div {
96
- flex-direction: var(--flex-dir-tablet); } }@media (max-width: 639px) { .div {
97
- flex-direction: var(--flex-dir); } }.div-2 {
98
- flex-grow: 1; }@media (max-width: 999px) { .div-2 {
99
- width: var(--column-width-tablet) !important;
100
- margin-left: var(--column-margin-left-tablet) !important; } }@media (max-width: 639px) { .div-2 {
101
- width: var(--column-width) !important;
102
- margin-left: var(--column-margin-left) !important; } }
103
- </style>
2
+ import RenderBlocks from "../../components/render-blocks.svelte";
3
+
4
+ export let space;
5
+ export let columns;
6
+ export let stackColumnsAt;
7
+ export let reverseColumnsWhenStacked;
8
+ export let builderBlock;
9
+
10
+ function mitosis_styling(node, vars) {
11
+ Object.entries(vars).forEach(([p, v]) => {
12
+ node.style[p] = v;
13
+ });
14
+ }
15
+
16
+ const getGutterSize = function getGutterSize() {
17
+ return typeof space === "number" ? space || 0 : 20;
18
+ };
19
+
20
+ const getColumns = function getColumns() {
21
+ return columns || [];
22
+ };
23
+
24
+ const getWidth = function getWidth(index) {
25
+ const columns = getColumns();
26
+ return columns[index]?.width || 100 / columns.length;
27
+ };
28
+
29
+ const getColumnCssWidth = function getColumnCssWidth(index) {
30
+ const columns = getColumns();
31
+ const gutterSize = getGutterSize();
32
+ const subtractWidth = (gutterSize * (columns.length - 1)) / columns.length;
33
+ return `calc(${getWidth(index)}% - ${subtractWidth}px)`;
34
+ };
35
+
36
+ const maybeApplyForTablet = function maybeApplyForTablet(prop) {
37
+ const _stackColumnsAt = stackColumnsAt || "tablet";
38
+
39
+ return _stackColumnsAt === "tablet" ? prop : "inherit";
40
+ };
41
+ $: columnsCssVars = () => {
42
+ const flexDir =
43
+ stackColumnsAt === "never"
44
+ ? "inherit"
45
+ : reverseColumnsWhenStacked
46
+ ? "column-reverse"
47
+ : "column";
48
+ return {
49
+ "--flex-dir": flexDir,
50
+ "--flex-dir-tablet": maybeApplyForTablet(flexDir),
51
+ };
52
+ };
53
+
54
+ $: columnCssVars = () => {
55
+ const width = "100%";
56
+ const marginLeft = "0";
57
+ return {
58
+ "--column-width": width,
59
+ "--column-margin-left": marginLeft,
60
+ "--column-width-tablet": maybeApplyForTablet(width),
61
+ "--column-margin-left-tablet": maybeApplyForTablet(marginLeft),
62
+ };
63
+ };
64
+ </script>
65
+
66
+ <div use:mitosis_styling={columnsCssVars()} class="builder-columns div">
67
+ {#each columns as column, index (index)}
68
+ <div
69
+ use:mitosis_styling={{
70
+ width: getColumnCssWidth(index),
71
+ marginLeft: `${index === 0 ? 0 : getGutterSize()}px`,
72
+ ...columnCssVars(),
73
+ }}
74
+ class="builder-column div-2"
75
+ >
76
+ <RenderBlocks
77
+ blocks={column.blocks}
78
+ path={`component.options.columns.${index}.blocks`}
79
+ parent={builderBlock.id}
80
+ />
81
+ </div>
82
+ {/each}
83
+ </div>
84
+
85
+ <style>
86
+ .div {
87
+ display: flex;
88
+ align-items: stretch;
89
+ line-height: normal;
90
+ }
91
+ @media (max-width: 991px) {
92
+ .div {
93
+ flex-direction: var(--flex-dir-tablet);
94
+ }
95
+ }
96
+ @media (max-width: 639px) {
97
+ .div {
98
+ flex-direction: var(--flex-dir);
99
+ }
100
+ }
101
+ .div-2 {
102
+ flex-grow: 1;
103
+ }
104
+ @media (max-width: 991px) {
105
+ .div-2 {
106
+ width: var(--column-width-tablet) !important;
107
+ margin-left: var(--column-margin-left-tablet) !important;
108
+ }
109
+ }
110
+ @media (max-width: 639px) {
111
+ .div-2 {
112
+ width: var(--column-width) !important;
113
+ margin-left: var(--column-margin-left) !important;
114
+ }
115
+ }
116
+ </style>
@@ -186,7 +186,31 @@ const componentInfo = {
186
186
  ]
187
187
  }
188
188
  ],
189
- onChange: " function clearWidths() { columns.forEach(col => { col.delete('width'); }); } const columns = options.get('columns') as Array<Map<String, any>>; if (Array.isArray(columns)) { const containsColumnWithWidth = !!columns.find(col => col.get('width')); if (containsColumnWithWidth) { const containsColumnWithoutWidth = !!columns.find(col => !col.get('width')); if (containsColumnWithoutWidth) { clearWidths(); } else { const sumWidths = columns.reduce((memo, col) => { return memo + col.get('width'); }, 0); const widthsDontAddUp = sumWidths !== 100; if (widthsDontAddUp) { clearWidths(); } } } } "
189
+ onChange(options) {
190
+ function clearWidths() {
191
+ columns.forEach((col) => {
192
+ col.delete("width");
193
+ });
194
+ }
195
+ const columns = options.get("columns");
196
+ if (Array.isArray(columns)) {
197
+ const containsColumnWithWidth = !!columns.find((col) => col.get("width"));
198
+ if (containsColumnWithWidth) {
199
+ const containsColumnWithoutWidth = !!columns.find((col) => !col.get("width"));
200
+ if (containsColumnWithoutWidth) {
201
+ clearWidths();
202
+ } else {
203
+ const sumWidths = columns.reduce((memo, col) => {
204
+ return memo + col.get("width");
205
+ }, 0);
206
+ const widthsDontAddUp = sumWidths !== 100;
207
+ if (widthsDontAddUp) {
208
+ clearWidths();
209
+ }
210
+ }
211
+ }
212
+ }
213
+ }
190
214
  },
191
215
  {
192
216
  name: "space",
@@ -1,64 +1,62 @@
1
1
  <script>
2
- import { onMount } from 'svelte'
3
-
4
-
5
-
6
-
7
-
8
-
9
-
10
-
11
-
12
- export let elem;
13
- export let replaceNodes;
14
- export let code;
15
-
16
- function findAndRunScripts() {
17
- // TODO: Move this function to standalone one in '@builder.io/utils'
18
- if (elem && typeof window !== 'undefined') {
19
- /** @type {HTMLScriptElement[]} */
20
- const scripts = elem.getElementsByTagName('script');
21
-
22
- for (let i = 0; i < scripts.length; i++) {
23
- const script = scripts[i];
24
-
25
- if (script.src) {
26
- if (scriptsInserted.includes(script.src)) {
27
- continue;
28
- }
29
-
30
- scriptsInserted.push(script.src);
31
- const newScript = document.createElement('script');
32
- newScript.async = true;
33
- newScript.src = script.src;
34
- document.head.appendChild(newScript);
35
- } else if (!script.type || ['text/javascript', 'application/javascript', 'application/ecmascript'].includes(script.type)) {
36
- if (scriptsRun.includes(script.innerText)) {
37
- continue;
38
- }
39
-
40
- try {
41
- scriptsRun.push(script.innerText);
42
- new Function(script.innerText)();
43
- } catch (error) {
44
- console.warn('`CustomCode`: Error running script:', error);
2
+ import { onMount } from "svelte";
3
+
4
+ export let elem;
5
+ export let replaceNodes;
6
+ export let code;
7
+
8
+ const findAndRunScripts = function findAndRunScripts() {
9
+ // TODO: Move this function to standalone one in '@builder.io/utils'
10
+ if (elem && typeof window !== "undefined") {
11
+ const scripts = elem.getElementsByTagName("script");
12
+
13
+ for (let i = 0; i < scripts.length; i++) {
14
+ const script = scripts[i];
15
+
16
+ if (script.src) {
17
+ if (scriptsInserted.includes(script.src)) {
18
+ continue;
19
+ }
20
+
21
+ scriptsInserted.push(script.src);
22
+ const newScript = document.createElement("script");
23
+ newScript.async = true;
24
+ newScript.src = script.src;
25
+ document.head.appendChild(newScript);
26
+ } else if (
27
+ !script.type ||
28
+ [
29
+ "text/javascript",
30
+ "application/javascript",
31
+ "application/ecmascript",
32
+ ].includes(script.type)
33
+ ) {
34
+ if (scriptsRun.includes(script.innerText)) {
35
+ continue;
36
+ }
37
+
38
+ try {
39
+ scriptsRun.push(script.innerText);
40
+ new Function(script.innerText)();
41
+ } catch (error) {
42
+ console.warn("`CustomCode`: Error running script:", error);
43
+ }
44
+ }
45
45
  }
46
46
  }
47
- }
48
- }
49
- }
50
-
51
-
52
-
53
-
54
- let scriptsInserted = [];
55
- let scriptsRun = [];
56
-
57
- onMount(() => { findAndRunScripts(); });
58
-
59
-
60
-
61
-
62
- </script>
63
-
64
- <div bind:this={elem} class={'builder-custom-code' + (replaceNodes ? ' replace-nodes' : '')} >{@html code}</div>
47
+ };
48
+
49
+ let scriptsInserted = [];
50
+ let scriptsRun = [];
51
+
52
+ onMount(() => {
53
+ findAndRunScripts();
54
+ });
55
+ </script>
56
+
57
+ <div
58
+ bind:this={elem}
59
+ class={"builder-custom-code" + (replaceNodes ? " replace-nodes" : "")}
60
+ >
61
+ {@html code}
62
+ </div>
@@ -9,7 +9,26 @@ const componentInfo = {
9
9
  required: true,
10
10
  defaultValue: "",
11
11
  helperText: "e.g. enter a youtube url, google map, etc",
12
- onChange: " const url = options.get('url'); if (url) { options.set('content', 'Loading...'); // TODO: get this out of here! const apiKey = 'ae0e60e78201a3f2b0de4b'; return fetch(`https://iframe.ly/api/iframely?url=${url}&api_key=${apiKey}`) .then(res => res.json()) .then(data => { if (options.get('url') === url) { if (data.html) { options.set('content', data.html); } else { options.set('content', 'Invalid url, please try another'); } } }) .catch(err => { options.set( 'content', 'There was an error embedding this URL, please try again or another URL' ); }); } else { options.delete('content'); } "
12
+ onChange(options) {
13
+ const url = options.get("url");
14
+ if (url) {
15
+ options.set("content", "Loading...");
16
+ const apiKey = "ae0e60e78201a3f2b0de4b";
17
+ return fetch(`https://iframe.ly/api/iframely?url=${url}&api_key=${apiKey}`).then((res) => res.json()).then((data) => {
18
+ if (options.get("url") === url) {
19
+ if (data.html) {
20
+ options.set("content", data.html);
21
+ } else {
22
+ options.set("content", "Invalid url, please try another");
23
+ }
24
+ }
25
+ }).catch((_err) => {
26
+ options.set("content", "There was an error embedding this URL, please try again or another URL");
27
+ });
28
+ } else {
29
+ options.delete("content");
30
+ }
31
+ }
13
32
  },
14
33
  {
15
34
  name: "content",
@@ -1,63 +1,45 @@
1
1
  <script>
2
- import { onMount } from 'svelte'
3
-
4
-
5
-
6
-
7
-
8
-
9
-
10
-
11
-
12
- export let elem;
13
- export let content;
14
-
15
- function findAndRunScripts() {
16
- // TODO: Move this function to standalone one in '@builder.io/utils'
17
- if (elem && typeof window !== 'undefined') {
18
- /** @type {HTMLScriptElement[]} */
19
- const scripts = elem.getElementsByTagName('script');
20
-
21
- for (let i = 0; i < scripts.length; i++) {
22
- const script = scripts[i];
23
-
24
- if (script.src) {
25
- if (scriptsInserted.includes(script.src)) {
26
- continue;
2
+ import { afterUpdate } from "svelte";
3
+
4
+ import { isJsScript } from "./helpers";
5
+
6
+ export let elem;
7
+ export let content;
8
+
9
+ const findAndRunScripts = function findAndRunScripts() {
10
+ const scripts = elem.getElementsByTagName("script");
11
+
12
+ for (let i = 0; i < scripts.length; i++) {
13
+ const script = scripts[i];
14
+
15
+ if (script.src && !scriptsInserted.includes(script.src)) {
16
+ scriptsInserted.push(script.src);
17
+ const newScript = document.createElement("script");
18
+ newScript.async = true;
19
+ newScript.src = script.src;
20
+ document.head.appendChild(newScript);
21
+ } else if (isJsScript(script) && !scriptsRun.includes(script.innerText)) {
22
+ try {
23
+ scriptsRun.push(script.innerText);
24
+ new Function(script.innerText)();
25
+ } catch (error) {
26
+ console.warn("`Embed`: Error running script:", error);
27
+ }
27
28
  }
29
+ }
30
+ };
28
31
 
29
- scriptsInserted.push(script.src);
30
- const newScript = document.createElement('script');
31
- newScript.async = true;
32
- newScript.src = script.src;
33
- document.head.appendChild(newScript);
34
- } else if (!script.type || ['text/javascript', 'application/javascript', 'application/ecmascript'].includes(script.type)) {
35
- if (scriptsRun.includes(script.innerText)) {
36
- continue;
37
- }
32
+ let scriptsInserted = [];
33
+ let scriptsRun = [];
34
+ let ranInitFn = false;
38
35
 
39
- try {
40
- scriptsRun.push(script.innerText);
41
- new Function(script.innerText)();
42
- } catch (error) {
43
- console.warn('`Embed`: Error running script:', error);
44
- }
36
+ function onUpdateFn_0() {
37
+ if (elem && !ranInitFn) {
38
+ ranInitFn = true;
39
+ findAndRunScripts();
45
40
  }
46
41
  }
47
- }
48
- }
49
-
50
-
51
-
52
-
53
- let scriptsInserted = [];
54
- let scriptsRun = [];
55
-
56
- onMount(() => { findAndRunScripts(); });
57
-
58
-
59
-
60
-
61
- </script>
42
+ $: onUpdateFn_0(...[elem, ranInitFn]);
43
+ </script>
62
44
 
63
- <div class="builder-embed" bind:this={elem} >{@html content}</div>
45
+ <div class="builder-embed" bind:this={elem}>{@html content}</div>
@@ -0,0 +1,9 @@
1
+ const SCRIPT_MIME_TYPES = [
2
+ "text/javascript",
3
+ "application/javascript",
4
+ "application/ecmascript"
5
+ ];
6
+ const isJsScript = (script) => SCRIPT_MIME_TYPES.includes(script.type);
7
+ export {
8
+ isJsScript
9
+ };