@builder.io/sdk-svelte 0.0.3 → 0.0.4
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/package/--package.json +159 -0
- package/package/blocks/BaseText.svelte +19 -0
- package/package/blocks/BaseText.svelte.d.ts +19 -0
- package/package/blocks/columns/columns.svelte +13 -4
- package/package/blocks/columns/columns.svelte.d.ts +1 -1
- package/package/blocks/custom-code/custom-code.svelte +1 -1
- package/package/blocks/embed/embed.svelte +2 -0
- package/package/blocks/form/form.svelte +7 -5
- package/package/blocks/image/image.svelte +48 -46
- package/package/blocks/image/image.svelte.d.ts +1 -1
- package/package/blocks/img/img.svelte +7 -2
- package/package/blocks/section/section.svelte +7 -2
- package/package/blocks/symbol/symbol.svelte +13 -13
- package/package/blocks/symbol/symbol.svelte.d.ts +3 -3
- package/package/blocks/video/video.svelte +14 -3
- package/package/components/render-block/block-styles.svelte +24 -19
- package/package/components/render-block/block-styles.svelte.d.ts +2 -2
- package/package/components/render-block/render-block.svelte +81 -58
- package/package/components/render-block/render-block.svelte.d.ts +2 -2
- package/package/components/render-block/render-component-with-context.svelte +32 -0
- package/package/components/render-block/render-component-with-context.svelte.d.ts +19 -0
- package/package/components/render-block/render-component.svelte +1 -3
- package/package/components/render-block/render-component.svelte.d.ts +2 -2
- package/package/components/render-block/render-repeated-block.svelte +3 -0
- package/package/components/render-block/types.d.ts +2 -2
- package/package/components/render-block/types.js +1 -2
- package/package/components/render-blocks.svelte +12 -1
- package/package/components/render-blocks.svelte.d.ts +3 -1
- package/package/components/render-content/components/render-styles.svelte +2 -1
- package/package/components/render-content/render-content.svelte +24 -8
- package/package/components/render-content/render-content.svelte.d.ts +2 -2
- package/package/constants/builder-registered-components.js +3 -0
- package/package/context/builder.context.d.ts +1 -0
- package/package/context/builder.context.js +1 -0
- package/package/context/types.d.ts +4 -3
- package/package/context/types.js +1 -3
- package/package/functions/extract-text-styles.d.ts +4 -0
- package/package/functions/extract-text-styles.js +34 -0
- package/package/functions/fast-clone.d.ts +4 -0
- package/package/functions/fast-clone.js +4 -0
- package/package/functions/get-block-actions-handler.d.ts +5 -0
- package/package/functions/get-block-actions-handler.js +9 -0
- package/package/functions/get-block-actions.d.ts +1 -1
- package/package/functions/get-block-actions.js +2 -8
- package/package/functions/get-block-component-options.d.ts +1 -1
- package/package/functions/get-block-component-options.js +0 -1
- package/package/functions/get-block-properties.d.ts +1 -1
- package/package/functions/get-block-properties.js +0 -1
- package/package/functions/get-block-tag.d.ts +1 -1
- package/package/functions/get-block-tag.js +0 -1
- package/package/functions/get-content/ab-testing.d.ts +5 -3
- package/package/functions/get-content/ab-testing.js +75 -37
- package/package/functions/get-content/index.d.ts +1 -1
- package/package/functions/get-content/index.js +4 -5
- package/package/functions/get-content/types.d.ts +7 -2
- package/package/functions/get-processed-block.d.ts +1 -1
- package/package/functions/get-processed-block.js +5 -4
- package/package/functions/get-processed-block.test.js +0 -1
- package/package/functions/get-react-native-block-styles.d.ts +6 -0
- package/package/functions/get-react-native-block-styles.js +16 -0
- package/package/functions/register-component.d.ts +2 -2
- package/package/functions/register-component.js +1 -5
- package/package/functions/register.d.ts +2 -2
- package/package/functions/register.js +0 -2
- package/package/functions/sanitize-react-native-block-styles.d.ts +3 -0
- package/package/functions/sanitize-react-native-block-styles.js +53 -0
- package/package/functions/track.d.ts +1 -1
- package/package/functions/track.js +5 -6
- package/package/functions/transform-block.d.ts +1 -1
- package/package/functions/transform-block.js +0 -1
- package/package/helpers/ab-tests.d.ts +8 -0
- package/package/helpers/ab-tests.js +5 -0
- package/package/helpers/cookie.d.ts +9 -3
- package/package/helpers/cookie.js +8 -3
- package/package/helpers/css.d.ts +5 -1
- package/package/helpers/css.js +14 -1
- package/package/helpers/localStorage.d.ts +3 -4
- package/package/helpers/sessionId.d.ts +3 -4
- package/package/helpers/sessionId.js +5 -3
- package/package/helpers/visitorId.d.ts +3 -5
- package/package/scripts/init-editing.js +42 -38
- package/package/types/builder-content.d.ts +1 -1
- package/package/types/builder-content.js +1 -1
- package/package/types/targets.d.ts +1 -1
- package/package/types/typescript.d.ts +1 -0
- package/package.json +8 -3
- package/package/blocks/button/button.lite.d.ts +0 -0
- package/package/blocks/button/button.lite.tsx +0 -36
- package/package/blocks/columns/columns.lite.d.ts +0 -0
- package/package/blocks/columns/columns.lite.tsx +0 -139
- package/package/blocks/custom-code/custom-code.lite.d.ts +0 -0
- package/package/blocks/custom-code/custom-code.lite.tsx +0 -70
- package/package/blocks/embed/embed.lite.d.ts +0 -0
- package/package/blocks/embed/embed.lite.tsx +0 -52
- package/package/blocks/form/form.lite.d.ts +0 -0
- package/package/blocks/form/form.lite.tsx +0 -351
- package/package/blocks/fragment/fragment.lite.d.ts +0 -0
- package/package/blocks/fragment/fragment.lite.tsx +0 -12
- package/package/blocks/image/image.lite.d.ts +0 -0
- package/package/blocks/image/image.lite.tsx +0 -148
- package/package/blocks/img/img.lite.d.ts +0 -0
- package/package/blocks/img/img.lite.tsx +0 -48
- package/package/blocks/input/input.lite.d.ts +0 -0
- package/package/blocks/input/input.lite.tsx +0 -34
- package/package/blocks/raw-text/raw-text.lite.d.ts +0 -0
- package/package/blocks/raw-text/raw-text.lite.tsx +0 -15
- package/package/blocks/section/section.lite.d.ts +0 -0
- package/package/blocks/section/section.lite.tsx +0 -30
- package/package/blocks/select/select.lite.d.ts +0 -0
- package/package/blocks/select/select.lite.tsx +0 -34
- package/package/blocks/submit-button/submit-button.lite.d.ts +0 -0
- package/package/blocks/submit-button/submit-button.lite.tsx +0 -15
- package/package/blocks/symbol/symbol.lite.d.ts +0 -0
- package/package/blocks/symbol/symbol.lite.tsx +0 -92
- package/package/blocks/text/text.lite.d.ts +0 -0
- package/package/blocks/text/text.lite.tsx +0 -11
- package/package/blocks/textarea/textarea.lite.d.ts +0 -0
- package/package/blocks/textarea/textarea.lite.tsx +0 -19
- package/package/blocks/video/video.lite.d.ts +0 -0
- package/package/blocks/video/video.lite.tsx +0 -92
- package/package/components/render-block/block-styles.lite.d.ts +0 -0
- package/package/components/render-block/block-styles.lite.tsx +0 -60
- package/package/components/render-block/render-block.lite.d.ts +0 -0
- package/package/components/render-block/render-block.lite.tsx +0 -216
- package/package/components/render-block/render-component.lite.d.ts +0 -0
- package/package/components/render-block/render-component.lite.tsx +0 -33
- package/package/components/render-block/render-repeated-block.lite.d.ts +0 -0
- package/package/components/render-block/render-repeated-block.lite.tsx +0 -49
- package/package/components/render-blocks.lite.d.ts +0 -0
- package/package/components/render-blocks.lite.tsx +0 -91
- package/package/components/render-content/components/render-styles.lite.d.ts +0 -0
- package/package/components/render-content/components/render-styles.lite.tsx +0 -86
- package/package/components/render-content/render-content.lite.d.ts +0 -0
- package/package/components/render-content/render-content.lite.tsx +0 -356
- package/package/components/render-inlined-styles.lite.d.ts +0 -0
- package/package/components/render-inlined-styles.lite.tsx +0 -27
- package/package/functions/convert-style-object.d.ts +0 -1
- package/package/functions/convert-style-object.js +0 -3
- package/package/functions/get-block-styles.d.ts +0 -2
- package/package/functions/get-block-styles.js +0 -21
- package/package/functions/sanitize-styles.d.ts +0 -4
- package/package/functions/sanitize-styles.js +0 -6
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@builder.io/sdk-svelte",
|
|
3
|
+
"description": "Builder.io SDK for Svelte",
|
|
4
|
+
"version": "0.0.3",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"files": [
|
|
7
|
+
"package"
|
|
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
|
+
},
|
|
15
|
+
"main": "./package/index.js",
|
|
16
|
+
"module": "./package/index.js",
|
|
17
|
+
"svelte": "./src/index.ts",
|
|
18
|
+
"exports": {
|
|
19
|
+
"./package.json": "./package.json",
|
|
20
|
+
"./src": {
|
|
21
|
+
"import": "./src/index.js",
|
|
22
|
+
"require": "./src/index.js"
|
|
23
|
+
},
|
|
24
|
+
".": {
|
|
25
|
+
"import": "./package/index.js",
|
|
26
|
+
"require": "./package/index.js"
|
|
27
|
+
},
|
|
28
|
+
"./blocks/BaseText.svelte": "./blocks/BaseText.svelte",
|
|
29
|
+
"./blocks/button/button.svelte": "./blocks/button/button.svelte",
|
|
30
|
+
"./blocks/button/component-info": "./blocks/button/component-info.js",
|
|
31
|
+
"./blocks/columns/columns.svelte": "./blocks/columns/columns.svelte",
|
|
32
|
+
"./blocks/columns/component-info": "./blocks/columns/component-info.js",
|
|
33
|
+
"./blocks/custom-code/component-info": "./blocks/custom-code/component-info.js",
|
|
34
|
+
"./blocks/custom-code/custom-code.svelte": "./blocks/custom-code/custom-code.svelte",
|
|
35
|
+
"./blocks/embed/component-info": "./blocks/embed/component-info.js",
|
|
36
|
+
"./blocks/embed/embed.svelte": "./blocks/embed/embed.svelte",
|
|
37
|
+
"./blocks/embed/helpers": "./blocks/embed/helpers.js",
|
|
38
|
+
"./blocks/form/component-info": "./blocks/form/component-info.js",
|
|
39
|
+
"./blocks/form/form.svelte": "./blocks/form/form.svelte",
|
|
40
|
+
"./blocks/fragment/component-info": "./blocks/fragment/component-info.js",
|
|
41
|
+
"./blocks/fragment/fragment.svelte": "./blocks/fragment/fragment.svelte",
|
|
42
|
+
"./blocks/image/component-info": "./blocks/image/component-info.js",
|
|
43
|
+
"./blocks/image/image.helpers": "./blocks/image/image.helpers.js",
|
|
44
|
+
"./blocks/image/image.svelte": "./blocks/image/image.svelte",
|
|
45
|
+
"./blocks/img/component-info": "./blocks/img/component-info.js",
|
|
46
|
+
"./blocks/img/img.svelte": "./blocks/img/img.svelte",
|
|
47
|
+
"./blocks/input/component-info": "./blocks/input/component-info.js",
|
|
48
|
+
"./blocks/input/input.svelte": "./blocks/input/input.svelte",
|
|
49
|
+
"./blocks/raw-text/component-info": "./blocks/raw-text/component-info.js",
|
|
50
|
+
"./blocks/raw-text/raw-text.svelte": "./blocks/raw-text/raw-text.svelte",
|
|
51
|
+
"./blocks/section/component-info": "./blocks/section/component-info.js",
|
|
52
|
+
"./blocks/section/section.svelte": "./blocks/section/section.svelte",
|
|
53
|
+
"./blocks/select/component-info": "./blocks/select/component-info.js",
|
|
54
|
+
"./blocks/select/select.svelte": "./blocks/select/select.svelte",
|
|
55
|
+
"./blocks/submit-button/component-info": "./blocks/submit-button/component-info.js",
|
|
56
|
+
"./blocks/submit-button/submit-button.svelte": "./blocks/submit-button/submit-button.svelte",
|
|
57
|
+
"./blocks/symbol/component-info": "./blocks/symbol/component-info.js",
|
|
58
|
+
"./blocks/symbol/symbol.svelte": "./blocks/symbol/symbol.svelte",
|
|
59
|
+
"./blocks/text/component-info": "./blocks/text/component-info.js",
|
|
60
|
+
"./blocks/text/text.svelte": "./blocks/text/text.svelte",
|
|
61
|
+
"./blocks/textarea/component-info": "./blocks/textarea/component-info.js",
|
|
62
|
+
"./blocks/textarea/textarea.svelte": "./blocks/textarea/textarea.svelte",
|
|
63
|
+
"./blocks/util": "./blocks/util.js",
|
|
64
|
+
"./blocks/video/component-info": "./blocks/video/component-info.js",
|
|
65
|
+
"./blocks/video/video.svelte": "./blocks/video/video.svelte",
|
|
66
|
+
"./components/render-block/block-styles.svelte": "./components/render-block/block-styles.svelte",
|
|
67
|
+
"./components/render-block/render-block.helpers": "./components/render-block/render-block.helpers.js",
|
|
68
|
+
"./components/render-block/render-block.svelte": "./components/render-block/render-block.svelte",
|
|
69
|
+
"./components/render-block/render-component-with-context.svelte": "./components/render-block/render-component-with-context.svelte",
|
|
70
|
+
"./components/render-block/render-component.svelte": "./components/render-block/render-component.svelte",
|
|
71
|
+
"./components/render-block/render-repeated-block.svelte": "./components/render-block/render-repeated-block.svelte",
|
|
72
|
+
"./components/render-block/types": "./components/render-block/types.js",
|
|
73
|
+
"./components/render-blocks.svelte": "./components/render-blocks.svelte",
|
|
74
|
+
"./components/render-content/components/render-styles.svelte": "./components/render-content/components/render-styles.svelte",
|
|
75
|
+
"./components/render-content": "./components/render-content/index.js",
|
|
76
|
+
"./components/render-content/render-content.svelte": "./components/render-content/render-content.svelte",
|
|
77
|
+
"./components/render-inlined-styles.svelte": "./components/render-inlined-styles.svelte",
|
|
78
|
+
"./constants/builder-registered-components": "./constants/builder-registered-components.js",
|
|
79
|
+
"./constants/device-sizes": "./constants/device-sizes.js",
|
|
80
|
+
"./constants/target": "./constants/target.js",
|
|
81
|
+
"./context/builder.context": "./context/builder.context.js",
|
|
82
|
+
"./context/types": "./context/types.js",
|
|
83
|
+
"./functions/camel-to-kebab-case": "./functions/camel-to-kebab-case.js",
|
|
84
|
+
"./functions/evaluate": "./functions/evaluate.js",
|
|
85
|
+
"./functions/event-handler-name": "./functions/event-handler-name.js",
|
|
86
|
+
"./functions/extract-text-styles": "./functions/extract-text-styles.js",
|
|
87
|
+
"./functions/fast-clone": "./functions/fast-clone.js",
|
|
88
|
+
"./functions/get-block-actions-handler": "./functions/get-block-actions-handler.js",
|
|
89
|
+
"./functions/get-block-actions": "./functions/get-block-actions.js",
|
|
90
|
+
"./functions/get-block-component-options": "./functions/get-block-component-options.js",
|
|
91
|
+
"./functions/get-block-properties": "./functions/get-block-properties.js",
|
|
92
|
+
"./functions/get-block-tag": "./functions/get-block-tag.js",
|
|
93
|
+
"./functions/get-builder-search-params/fn.test": "./functions/get-builder-search-params/fn.test.js",
|
|
94
|
+
"./functions/get-builder-search-params": "./functions/get-builder-search-params/index.js",
|
|
95
|
+
"./functions/get-content/ab-testing": "./functions/get-content/ab-testing.js",
|
|
96
|
+
"./functions/get-content/fn.test": "./functions/get-content/fn.test.js",
|
|
97
|
+
"./functions/get-content": "./functions/get-content/index.js",
|
|
98
|
+
"./functions/get-content/types": "./functions/get-content/types.js",
|
|
99
|
+
"./functions/get-fetch": "./functions/get-fetch.js",
|
|
100
|
+
"./functions/get-global-this": "./functions/get-global-this.js",
|
|
101
|
+
"./functions/get-processed-block.test": "./functions/get-processed-block.test.js",
|
|
102
|
+
"./functions/get-processed-block": "./functions/get-processed-block.js",
|
|
103
|
+
"./functions/get-react-native-block-styles": "./functions/get-react-native-block-styles.js",
|
|
104
|
+
"./functions/if-target": "./functions/if-target.js",
|
|
105
|
+
"./functions/is-browser": "./functions/is-browser.js",
|
|
106
|
+
"./functions/is-editing": "./functions/is-editing.js",
|
|
107
|
+
"./functions/is-iframe": "./functions/is-iframe.js",
|
|
108
|
+
"./functions/is-previewing": "./functions/is-previewing.js",
|
|
109
|
+
"./functions/mark-mutable": "./functions/mark-mutable.js",
|
|
110
|
+
"./functions/on-change.test": "./functions/on-change.test.js",
|
|
111
|
+
"./functions/on-change": "./functions/on-change.js",
|
|
112
|
+
"./functions/register-component": "./functions/register-component.js",
|
|
113
|
+
"./functions/register": "./functions/register.js",
|
|
114
|
+
"./functions/sanitize-react-native-block-styles": "./functions/sanitize-react-native-block-styles.js",
|
|
115
|
+
"./functions/set-editor-settings": "./functions/set-editor-settings.js",
|
|
116
|
+
"./functions/set.test": "./functions/set.test.js",
|
|
117
|
+
"./functions/set": "./functions/set.js",
|
|
118
|
+
"./functions/track": "./functions/track.js",
|
|
119
|
+
"./functions/transform-block": "./functions/transform-block.js",
|
|
120
|
+
"./helpers/ab-tests": "./helpers/ab-tests.js",
|
|
121
|
+
"./helpers/cookie": "./helpers/cookie.js",
|
|
122
|
+
"./helpers/css": "./helpers/css.js",
|
|
123
|
+
"./helpers/flatten": "./helpers/flatten.js",
|
|
124
|
+
"./helpers/localStorage": "./helpers/localStorage.js",
|
|
125
|
+
"./helpers/nullable": "./helpers/nullable.js",
|
|
126
|
+
"./helpers/sessionId": "./helpers/sessionId.js",
|
|
127
|
+
"./helpers/time": "./helpers/time.js",
|
|
128
|
+
"./helpers/url.test": "./helpers/url.test.js",
|
|
129
|
+
"./helpers/url": "./helpers/url.js",
|
|
130
|
+
"./helpers/uuid": "./helpers/uuid.js",
|
|
131
|
+
"./helpers/visitorId": "./helpers/visitorId.js",
|
|
132
|
+
"./index-helpers/blocks-exports": "./index-helpers/blocks-exports.js",
|
|
133
|
+
"./index-helpers/top-of-file": "./index-helpers/top-of-file.js",
|
|
134
|
+
"./scripts/init-editing": "./scripts/init-editing.js",
|
|
135
|
+
"./types/builder-block": "./types/builder-block.js",
|
|
136
|
+
"./types/builder-content": "./types/builder-content.js",
|
|
137
|
+
"./types/can-track": "./types/can-track.js",
|
|
138
|
+
"./types/components": "./types/components.js",
|
|
139
|
+
"./types/deep-partial": "./types/deep-partial.js",
|
|
140
|
+
"./types/element": "./types/element.js",
|
|
141
|
+
"./types/targets": "./types/targets.js",
|
|
142
|
+
"./types/typescript": "./types/typescript.js"
|
|
143
|
+
},
|
|
144
|
+
"types": "./package/index.d.ts",
|
|
145
|
+
"devDependencies": {
|
|
146
|
+
"@sveltejs/adapter-auto": "1.0.0-next.71",
|
|
147
|
+
"@sveltejs/kit": "1.0.0-next.474",
|
|
148
|
+
"@sveltejs/package": "1.0.0-next.1",
|
|
149
|
+
"svelte": "^3.44.0",
|
|
150
|
+
"svelte-check": "^2.7.1",
|
|
151
|
+
"svelte-preprocess": "^4.10.6",
|
|
152
|
+
"tslib": "^2.3.1",
|
|
153
|
+
"typescript": "^4",
|
|
154
|
+
"vite": "^3.0.4"
|
|
155
|
+
},
|
|
156
|
+
"dependencies": {
|
|
157
|
+
"node-fetch": "^2.6.1"
|
|
158
|
+
}
|
|
159
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<script context="module"></script>
|
|
2
|
+
|
|
3
|
+
<script>import { getContext } from "svelte";
|
|
4
|
+
import BuilderContext from "../context/builder.context.js";
|
|
5
|
+
export let text;
|
|
6
|
+
function mitosis_styling(node, vars) {
|
|
7
|
+
Object.entries(vars || {}).forEach(([p, v]) => {
|
|
8
|
+
if (p.startsWith("--")) {
|
|
9
|
+
node.style.setProperty(p, v);
|
|
10
|
+
}
|
|
11
|
+
else {
|
|
12
|
+
node.style[p] = v;
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
let builderContext = getContext(BuilderContext.key);
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
<span use:mitosis_styling={builderContext.inheritedStyles}>{text}</span>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
export interface BaseTextProps {
|
|
3
|
+
text: string;
|
|
4
|
+
}
|
|
5
|
+
declare const __propDef: {
|
|
6
|
+
props: {
|
|
7
|
+
text: BaseTextProps["text"];
|
|
8
|
+
};
|
|
9
|
+
events: {
|
|
10
|
+
[evt: string]: CustomEvent<any>;
|
|
11
|
+
};
|
|
12
|
+
slots: {};
|
|
13
|
+
};
|
|
14
|
+
export declare type BaseTextProps = typeof __propDef.props;
|
|
15
|
+
export declare type BaseTextEvents = typeof __propDef.events;
|
|
16
|
+
export declare type BaseTextSlots = typeof __propDef.slots;
|
|
17
|
+
export default class BaseText extends SvelteComponentTyped<BaseTextProps, BaseTextEvents, BaseTextSlots> {
|
|
18
|
+
}
|
|
19
|
+
export {};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
<script context="module"></script>
|
|
2
2
|
|
|
3
3
|
<script>import RenderBlocks from "../../components/render-blocks.svelte";
|
|
4
|
-
import "../../types/builder-block";
|
|
5
4
|
import { markMutable } from "../../functions/mark-mutable";
|
|
6
5
|
export let space;
|
|
7
6
|
export let columns;
|
|
@@ -9,8 +8,13 @@ export let stackColumnsAt;
|
|
|
9
8
|
export let reverseColumnsWhenStacked;
|
|
10
9
|
export let builderBlock;
|
|
11
10
|
function mitosis_styling(node, vars) {
|
|
12
|
-
Object.entries(vars).forEach(([p, v]) => {
|
|
13
|
-
|
|
11
|
+
Object.entries(vars || {}).forEach(([p, v]) => {
|
|
12
|
+
if (p.startsWith("--")) {
|
|
13
|
+
node.style.setProperty(p, v);
|
|
14
|
+
}
|
|
15
|
+
else {
|
|
16
|
+
node.style[p] = v;
|
|
17
|
+
}
|
|
14
18
|
});
|
|
15
19
|
}
|
|
16
20
|
function getGutterSize() {
|
|
@@ -70,6 +74,9 @@ $: columnCssVars = () => {
|
|
|
70
74
|
blocks={markMutable(column.blocks)}
|
|
71
75
|
path={`component.options.columns.${index}.blocks`}
|
|
72
76
|
parent={builderBlock.id}
|
|
77
|
+
styleProp={{
|
|
78
|
+
flexGrow: "1",
|
|
79
|
+
}}
|
|
73
80
|
/>
|
|
74
81
|
</div>
|
|
75
82
|
{/each}
|
|
@@ -92,7 +99,9 @@ $: columnCssVars = () => {
|
|
|
92
99
|
}
|
|
93
100
|
}
|
|
94
101
|
.div-2 {
|
|
95
|
-
|
|
102
|
+
display: flex;
|
|
103
|
+
flex-direction: column;
|
|
104
|
+
align-items: stretch;
|
|
96
105
|
}
|
|
97
106
|
@media (max-width: 991px) {
|
|
98
107
|
.div-2 {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import type { BuilderBlock } from "../../types/builder-block";
|
|
2
3
|
declare type Column = {
|
|
3
4
|
blocks: any;
|
|
4
5
|
width?: number;
|
|
@@ -11,7 +12,6 @@ export interface ColumnProps {
|
|
|
11
12
|
stackColumnsAt?: StackColumnsAt;
|
|
12
13
|
reverseColumnsWhenStacked?: boolean;
|
|
13
14
|
}
|
|
14
|
-
import { BuilderBlock } from "../../types/builder-block";
|
|
15
15
|
declare const __propDef: {
|
|
16
16
|
props: {
|
|
17
17
|
space: ColumnProps["space"];
|
|
@@ -5,7 +5,7 @@ export let replaceNodes;
|
|
|
5
5
|
export let code;
|
|
6
6
|
function findAndRunScripts() {
|
|
7
7
|
// TODO: Move this function to standalone one in '@builder.io/utils'
|
|
8
|
-
if (elem && typeof window !== "undefined") {
|
|
8
|
+
if (elem && elem.getElementsByTagName && typeof window !== "undefined") {
|
|
9
9
|
const scripts = elem.getElementsByTagName("script");
|
|
10
10
|
for (let i = 0; i < scripts.length; i++) {
|
|
11
11
|
const script = scripts[i];
|
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
import { isJsScript } from "./helpers.js";
|
|
5
5
|
export let content;
|
|
6
6
|
function findAndRunScripts() {
|
|
7
|
+
if (!elem || !elem.getElementsByTagName)
|
|
8
|
+
return;
|
|
7
9
|
const scripts = elem.getElementsByTagName("script");
|
|
8
10
|
for (let i = 0; i < scripts.length; i++) {
|
|
9
11
|
const script = scripts[i];
|
|
@@ -39,7 +39,8 @@ function onSubmit(event) {
|
|
|
39
39
|
const el = event.currentTarget;
|
|
40
40
|
const headers = customHeaders || {};
|
|
41
41
|
let body;
|
|
42
|
-
const formData = new FormData(el);
|
|
42
|
+
const formData = new FormData(el);
|
|
43
|
+
// TODO: maybe support null
|
|
43
44
|
const formPairs = Array.from(event.currentTarget.querySelectorAll("input,select,textarea"))
|
|
44
45
|
.filter((el) => !!el.name)
|
|
45
46
|
.map((el) => {
|
|
@@ -90,7 +91,8 @@ function onSubmit(event) {
|
|
|
90
91
|
value instanceof FileList) {
|
|
91
92
|
contentType = "multipart/form-data";
|
|
92
93
|
}
|
|
93
|
-
});
|
|
94
|
+
});
|
|
95
|
+
// TODO: send as urlEncoded or multipart by default
|
|
94
96
|
// because of ease of use and reliability in browser API
|
|
95
97
|
// for encoding the form?
|
|
96
98
|
if (contentType !== "application/json") {
|
|
@@ -124,9 +126,9 @@ function onSubmit(event) {
|
|
|
124
126
|
}
|
|
125
127
|
formState = "sending";
|
|
126
128
|
const formUrl = `${builder.env === "dev" ? "http://localhost:5000" : "https://builder.io"}/api/v1/form-submit?apiKey=${builder.apiKey}&to=${btoa(sendSubmissionsToEmail || "")}&name=${encodeURIComponent(name || "")}`;
|
|
127
|
-
fetch(sendSubmissionsTo === "email"
|
|
128
|
-
|
|
129
|
-
|
|
129
|
+
fetch(sendSubmissionsTo === "email"
|
|
130
|
+
? formUrl
|
|
131
|
+
: action /* TODO: throw error if no action URL */, {
|
|
130
132
|
body,
|
|
131
133
|
headers,
|
|
132
134
|
method: method || "post",
|
|
@@ -10,17 +10,23 @@ export let backgroundSize;
|
|
|
10
10
|
export let className;
|
|
11
11
|
export let sizes;
|
|
12
12
|
export let aspectRatio;
|
|
13
|
-
export let fitContent;
|
|
14
13
|
export let builderBlock;
|
|
14
|
+
export let fitContent;
|
|
15
15
|
function mitosis_styling(node, vars) {
|
|
16
|
-
Object.entries(vars).forEach(([p, v]) => {
|
|
17
|
-
|
|
16
|
+
Object.entries(vars || {}).forEach(([p, v]) => {
|
|
17
|
+
if (p.startsWith("--")) {
|
|
18
|
+
node.style.setProperty(p, v);
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
node.style[p] = v;
|
|
22
|
+
}
|
|
18
23
|
});
|
|
19
24
|
}
|
|
20
25
|
$: srcSetToUse = () => {
|
|
21
26
|
const imageToUse = image || src;
|
|
22
27
|
const url = imageToUse;
|
|
23
|
-
if (!url ||
|
|
28
|
+
if (!url ||
|
|
29
|
+
// We can auto add srcset for cdn.builder.io and shopify
|
|
24
30
|
// images, otherwise you can supply this prop manually
|
|
25
31
|
!(url.match(/builder\.io/) || url.match(/cdn\.shopify\.com/))) {
|
|
26
32
|
return srcset;
|
|
@@ -46,52 +52,48 @@ $: webpSrcSet = () => {
|
|
|
46
52
|
};
|
|
47
53
|
</script>
|
|
48
54
|
|
|
49
|
-
<
|
|
50
|
-
|
|
51
|
-
{
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
</picture>
|
|
55
|
+
<picture>
|
|
56
|
+
{#if webpSrcSet()}
|
|
57
|
+
<source type="image/webp" srcset={webpSrcSet()} />
|
|
58
|
+
{/if}
|
|
59
|
+
<img
|
|
60
|
+
use:mitosis_styling={{
|
|
61
|
+
objectPosition: backgroundSize || "center",
|
|
62
|
+
objectFit: backgroundSize || "cover",
|
|
63
|
+
}}
|
|
64
|
+
loading="lazy"
|
|
65
|
+
alt={altText}
|
|
66
|
+
role={altText ? "presentation" : undefined}
|
|
67
|
+
class={"builder-image" + (className ? " " + className : "") + " img"}
|
|
68
|
+
src={image}
|
|
69
|
+
srcset={srcSetToUse()}
|
|
70
|
+
{sizes}
|
|
71
|
+
/>
|
|
72
|
+
<source srcset={srcSetToUse()} />
|
|
73
|
+
</picture>
|
|
69
74
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
75
|
+
{#if aspectRatio && !(builderBlock?.children?.length && fitContent)}
|
|
76
|
+
<div
|
|
77
|
+
use:mitosis_styling={{
|
|
78
|
+
paddingTop:
|
|
73
79
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
80
|
+
aspectRatio * 100 + "%",
|
|
81
|
+
}}
|
|
82
|
+
class="builder-image-sizer div"
|
|
83
|
+
/>
|
|
84
|
+
{/if}
|
|
79
85
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
86
|
+
{#if builderBlock?.children?.length && fitContent}
|
|
87
|
+
<slot />
|
|
88
|
+
{/if}
|
|
83
89
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
</div>
|
|
90
|
+
{#if !fitContent && $$slots.default}
|
|
91
|
+
<div class="div-2">
|
|
92
|
+
<slot />
|
|
93
|
+
</div>
|
|
94
|
+
{/if}
|
|
90
95
|
|
|
91
96
|
<style>
|
|
92
|
-
.div {
|
|
93
|
-
position: relative;
|
|
94
|
-
}
|
|
95
97
|
.img {
|
|
96
98
|
opacity: 1;
|
|
97
99
|
transition: opacity 0.2s ease-in-out;
|
|
@@ -101,12 +103,12 @@ $: webpSrcSet = () => {
|
|
|
101
103
|
top: 0px;
|
|
102
104
|
left: 0px;
|
|
103
105
|
}
|
|
104
|
-
.div
|
|
106
|
+
.div {
|
|
105
107
|
width: 100%;
|
|
106
108
|
pointer-events: none;
|
|
107
109
|
font-size: 0;
|
|
108
110
|
}
|
|
109
|
-
.div-
|
|
111
|
+
.div-2 {
|
|
110
112
|
display: flex;
|
|
111
113
|
flex-direction: column;
|
|
112
114
|
align-items: stretch;
|
|
@@ -30,8 +30,8 @@ declare const __propDef: {
|
|
|
30
30
|
className: ImageProps["className"];
|
|
31
31
|
sizes: ImageProps["sizes"];
|
|
32
32
|
aspectRatio: ImageProps["aspectRatio"];
|
|
33
|
-
fitContent: ImageProps["fitContent"];
|
|
34
33
|
builderBlock: ImageProps["builderBlock"];
|
|
34
|
+
fitContent: ImageProps["fitContent"];
|
|
35
35
|
};
|
|
36
36
|
events: {
|
|
37
37
|
[evt: string]: CustomEvent<any>;
|
|
@@ -8,8 +8,13 @@ export let altText;
|
|
|
8
8
|
export let image;
|
|
9
9
|
export let attributes;
|
|
10
10
|
function mitosis_styling(node, vars) {
|
|
11
|
-
Object.entries(vars).forEach(([p, v]) => {
|
|
12
|
-
|
|
11
|
+
Object.entries(vars || {}).forEach(([p, v]) => {
|
|
12
|
+
if (p.startsWith("--")) {
|
|
13
|
+
node.style.setProperty(p, v);
|
|
14
|
+
}
|
|
15
|
+
else {
|
|
16
|
+
node.style[p] = v;
|
|
17
|
+
}
|
|
13
18
|
});
|
|
14
19
|
}
|
|
15
20
|
</script>
|
|
@@ -3,8 +3,13 @@
|
|
|
3
3
|
<script>export let attributes;
|
|
4
4
|
export let maxWidth;
|
|
5
5
|
function mitosis_styling(node, vars) {
|
|
6
|
-
Object.entries(vars).forEach(([p, v]) => {
|
|
7
|
-
|
|
6
|
+
Object.entries(vars || {}).forEach(([p, v]) => {
|
|
7
|
+
if (p.startsWith("--")) {
|
|
8
|
+
node.style.setProperty(p, v);
|
|
9
|
+
}
|
|
10
|
+
else {
|
|
11
|
+
node.style[p] = v;
|
|
12
|
+
}
|
|
8
13
|
});
|
|
9
14
|
}
|
|
10
15
|
</script>
|
|
@@ -1,21 +1,18 @@
|
|
|
1
1
|
<script context="module"></script>
|
|
2
2
|
|
|
3
|
-
<script>import { getContext
|
|
3
|
+
<script>import { getContext } from "svelte";
|
|
4
4
|
import RenderContent from "../../components/render-content/render-content.svelte";
|
|
5
5
|
import BuilderContext from "../../context/builder.context.js";
|
|
6
6
|
import { getContent } from "../../functions/get-content/index.js";
|
|
7
|
-
import "../../types/builder-content.js";
|
|
8
|
-
import "../../types/typescript.js";
|
|
9
|
-
import "../../types/builder-block.js";
|
|
10
7
|
import { markMutable } from "../../functions/mark-mutable";
|
|
11
|
-
export let attributes;
|
|
12
8
|
export let symbol;
|
|
9
|
+
export let attributes;
|
|
13
10
|
let builderContext = getContext(BuilderContext.key);
|
|
11
|
+
$: contentToUse = () => {
|
|
12
|
+
return symbol?.content || fetchedContent;
|
|
13
|
+
};
|
|
14
14
|
let className = "builder-symbol";
|
|
15
|
-
let
|
|
16
|
-
onMount(() => {
|
|
17
|
-
content = symbol?.content;
|
|
18
|
-
});
|
|
15
|
+
let fetchedContent = null;
|
|
19
16
|
function onUpdateFn_0() {
|
|
20
17
|
const symbolToUse = symbol;
|
|
21
18
|
/**
|
|
@@ -27,7 +24,10 @@ function onUpdateFn_0() {
|
|
|
27
24
|
*
|
|
28
25
|
* then we want to re-fetch the symbol content.
|
|
29
26
|
*/
|
|
30
|
-
if (symbolToUse &&
|
|
27
|
+
if (symbolToUse &&
|
|
28
|
+
!symbolToUse.content &&
|
|
29
|
+
!fetchedContent &&
|
|
30
|
+
symbolToUse.model) {
|
|
31
31
|
getContent({
|
|
32
32
|
model: symbolToUse.model,
|
|
33
33
|
apiKey: builderContext.apiKey,
|
|
@@ -35,11 +35,11 @@ function onUpdateFn_0() {
|
|
|
35
35
|
id: symbolToUse.entry,
|
|
36
36
|
},
|
|
37
37
|
}).then((response) => {
|
|
38
|
-
|
|
38
|
+
fetchedContent = response;
|
|
39
39
|
});
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
|
-
$: onUpdateFn_0(...[symbol,
|
|
42
|
+
$: onUpdateFn_0(...[symbol, fetchedContent]);
|
|
43
43
|
</script>
|
|
44
44
|
|
|
45
45
|
<div
|
|
@@ -61,6 +61,6 @@ $: onUpdateFn_0(...[symbol, content]);
|
|
|
61
61
|
...symbol?.content?.data?.state,
|
|
62
62
|
})}
|
|
63
63
|
model={symbol?.model}
|
|
64
|
-
content={markMutable(
|
|
64
|
+
content={markMutable(contentToUse())}
|
|
65
65
|
/>
|
|
66
66
|
</div>
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import type { BuilderContent } from "../../types/builder-content.js";
|
|
3
|
+
import type { BuilderBlock } from "../../types/builder-block.js";
|
|
2
4
|
export interface SymbolInfo {
|
|
3
5
|
model?: string;
|
|
4
6
|
entry?: string;
|
|
@@ -15,12 +17,10 @@ export interface SymbolProps {
|
|
|
15
17
|
attributes?: any;
|
|
16
18
|
inheritState?: boolean;
|
|
17
19
|
}
|
|
18
|
-
import { BuilderContent } from "../../types/builder-content.js";
|
|
19
|
-
import { BuilderBlock } from "../../types/builder-block.js";
|
|
20
20
|
declare const __propDef: {
|
|
21
21
|
props: {
|
|
22
|
-
attributes: SymbolProps["attributes"];
|
|
23
22
|
symbol: SymbolProps["symbol"];
|
|
23
|
+
attributes: SymbolProps["attributes"];
|
|
24
24
|
};
|
|
25
25
|
events: {
|
|
26
26
|
[evt: string]: CustomEvent<any>;
|
|
@@ -11,8 +11,13 @@ export let position;
|
|
|
11
11
|
export let video;
|
|
12
12
|
export let posterImage;
|
|
13
13
|
function mitosis_styling(node, vars) {
|
|
14
|
-
Object.entries(vars).forEach(([p, v]) => {
|
|
15
|
-
|
|
14
|
+
Object.entries(vars || {}).forEach(([p, v]) => {
|
|
15
|
+
if (p.startsWith("--")) {
|
|
16
|
+
node.style.setProperty(p, v);
|
|
17
|
+
}
|
|
18
|
+
else {
|
|
19
|
+
node.style[p] = v;
|
|
20
|
+
}
|
|
16
21
|
});
|
|
17
22
|
}
|
|
18
23
|
$: videoProps = () => {
|
|
@@ -44,10 +49,16 @@ $: videoProps = () => {
|
|
|
44
49
|
: {}),
|
|
45
50
|
};
|
|
46
51
|
};
|
|
52
|
+
$: spreadProps = () => {
|
|
53
|
+
return {
|
|
54
|
+
...attributes,
|
|
55
|
+
...videoProps(),
|
|
56
|
+
};
|
|
57
|
+
};
|
|
47
58
|
</script>
|
|
48
59
|
|
|
49
60
|
<video
|
|
50
|
-
{...
|
|
61
|
+
{...spreadProps()}
|
|
51
62
|
use:mitosis_styling={{
|
|
52
63
|
width: "100%",
|
|
53
64
|
height: "100%",
|