@builder.io/sdk-svelte 0.0.1-0 → 0.0.1-3
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.json +15 -4
- package/src/blocks/{button.svelte → button/button.svelte} +29 -18
- package/src/blocks/button/component-info.js +41 -0
- package/src/blocks/button/index.js +7 -0
- package/src/blocks/{columns.svelte → columns/columns.svelte} +21 -13
- package/src/blocks/columns/component-info.js +217 -0
- package/src/blocks/columns/index.js +7 -0
- package/src/blocks/custom-code/component-info.js +31 -0
- package/src/blocks/custom-code/custom-code.svelte +64 -0
- package/src/blocks/custom-code/index.js +7 -0
- package/src/blocks/embed/component-info.js +24 -0
- package/src/blocks/embed/embed.svelte +63 -0
- package/src/blocks/embed/index.js +7 -0
- package/src/blocks/form/component-info.js +262 -0
- package/src/blocks/{form.svelte → form/form.svelte} +49 -16
- package/src/blocks/form/index.js +7 -0
- package/src/blocks/fragment/component-info.js +11 -0
- package/src/blocks/{fragment.svelte → fragment/fragment.svelte} +5 -2
- package/src/blocks/fragment/index.js +7 -0
- package/src/blocks/image/component-info.js +104 -0
- package/src/blocks/{image.svelte → image/image.svelte} +27 -9
- package/src/blocks/image/index.js +7 -0
- package/src/blocks/img/component-info.js +20 -0
- package/src/blocks/{img.svelte → img/img.svelte} +5 -2
- package/src/blocks/img/index.js +7 -0
- package/src/blocks/input/component-info.js +74 -0
- package/src/blocks/input/index.js +7 -0
- package/src/blocks/{input.svelte → input/input.svelte} +5 -2
- package/src/blocks/raw-text/component-info.js +16 -0
- package/src/blocks/raw-text/index.js +7 -0
- package/src/blocks/{raw-text.svelte → raw-text/raw-text.svelte} +4 -1
- package/src/blocks/section/component-info.js +49 -0
- package/src/blocks/section/index.js +7 -0
- package/src/blocks/{section.svelte → section/section.svelte} +4 -1
- package/src/blocks/select/component-info.js +59 -0
- package/src/blocks/select/index.js +7 -0
- package/src/blocks/{select.svelte → select/select.svelte} +10 -3
- package/src/blocks/submit-button/component-info.js +28 -0
- package/src/blocks/submit-button/index.js +7 -0
- package/src/blocks/{submit-button.svelte → submit-button/submit-button.svelte} +4 -1
- package/src/blocks/symbol/component-info.js +42 -0
- package/src/blocks/symbol/index.js +7 -0
- package/src/blocks/symbol/symbol.svelte +54 -0
- package/src/blocks/text/component-info.js +24 -0
- package/src/blocks/text/index.js +7 -0
- package/src/blocks/{text.svelte → text/text.svelte} +4 -1
- package/src/blocks/textarea/component-info.js +47 -0
- package/src/blocks/textarea/index.js +7 -0
- package/src/blocks/{textarea.svelte → textarea/textarea.svelte} +4 -1
- package/src/blocks/video/component-info.js +106 -0
- package/src/blocks/video/index.js +7 -0
- package/src/blocks/{video.svelte → video/video.svelte} +4 -1
- package/src/components/error-boundary.svelte +4 -1
- package/src/components/render-block/block-styles.svelte +51 -0
- package/src/components/{render-block.svelte → render-block/render-block.svelte} +60 -18
- package/src/components/render-blocks.svelte +18 -6
- package/src/components/render-content/components/render-styles.svelte +8 -13
- package/src/components/render-content/render-content.svelte +186 -174
- package/src/components/render-inlined-styles.svelte +49 -0
- package/src/constants/device-sizes.js +4 -11
- package/src/constants/target.js +3 -10
- package/src/context/builder.context.js +6 -31
- package/src/functions/evaluate.js +8 -31
- package/src/functions/event-handler-name.js +3 -10
- package/src/functions/get-block-actions.js +6 -29
- package/src/functions/get-block-component-options.js +3 -9
- package/src/functions/get-block-properties.js +3 -9
- package/src/functions/get-block-styles.js +6 -27
- package/src/functions/get-block-tag.js +3 -10
- package/src/functions/get-builder-search-params/fn.test.js +3 -21
- package/src/functions/get-builder-search-params/index.js +4 -11
- package/src/functions/get-content/fn.test.js +3 -21
- package/src/functions/get-content/index.js +8 -28
- package/src/functions/get-fetch.js +31 -32
- package/src/functions/get-global-this.js +3 -10
- package/src/functions/get-processed-block.js +9 -30
- package/src/functions/get-processed-block.test.js +2 -20
- package/src/functions/if-target.js +5 -28
- package/src/functions/is-browser.js +3 -10
- package/src/functions/is-editing.js +5 -28
- package/src/functions/is-iframe.js +5 -28
- package/src/functions/is-previewing.js +7 -30
- package/src/functions/macro-eval.js +3 -10
- package/src/functions/on-change.js +4 -11
- package/src/functions/on-change.test.js +4 -22
- package/src/functions/previewing-model-name.js +5 -28
- package/src/functions/register-component.js +6 -27
- package/src/functions/register.js +5 -28
- package/src/functions/set-editor-settings.js +5 -28
- package/src/functions/set.js +3 -10
- package/src/functions/set.test.js +4 -22
- package/src/functions/track.js +8 -31
- package/src/functions/transform-block.js +3 -10
- package/src/index-helpers/blocks-exports.js +19 -42
- package/src/index-helpers/top-of-file.js +3 -10
- package/src/index.js +10 -32
- package/src/scripts/init-editing.js +72 -81
- package/src/types/builder-block.js +0 -3
- package/src/types/builder-content.js +0 -3
- package/src/types/deep-partial.js +0 -3
- package/src/types/targets.js +0 -3
- package/src/types/typescript.js +0 -3
- package/src/blocks/custom-code.svelte +0 -63
- package/src/blocks/embed.svelte +0 -62
- package/src/blocks/symbol.svelte +0 -55
- package/src/components/block-styles.svelte +0 -23
|
@@ -3,10 +3,11 @@
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
import { isEditing } from '
|
|
6
|
+
import { isEditing } from '../../functions/is-editing.js';
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
+
|
|
10
11
|
|
|
11
12
|
|
|
12
13
|
export let backgroundSize;
|
|
@@ -14,11 +15,13 @@ export let backgroundPosition;
|
|
|
14
15
|
export let attributes;
|
|
15
16
|
export let imgSrc;
|
|
16
17
|
export let altText;
|
|
17
|
-
|
|
18
|
+
|
|
18
19
|
|
|
19
20
|
|
|
20
21
|
|
|
21
22
|
|
|
23
|
+
|
|
24
|
+
|
|
22
25
|
|
|
23
26
|
|
|
24
27
|
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { registerComponent } from "../../functions/register-component.js";
|
|
2
|
+
import { componentInfo } from "./component-info.js";
|
|
3
|
+
import component from "./img.svelte";
|
|
4
|
+
var stdin_default = registerComponent(component, componentInfo);
|
|
5
|
+
export {
|
|
6
|
+
stdin_default as default
|
|
7
|
+
};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
const componentInfo = {
|
|
2
|
+
name: "Form:Input",
|
|
3
|
+
builtIn: true,
|
|
4
|
+
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fad6f37889d9e40bbbbc72cdb5875d6ca",
|
|
5
|
+
inputs: [
|
|
6
|
+
{
|
|
7
|
+
name: "type",
|
|
8
|
+
type: "text",
|
|
9
|
+
enum: [
|
|
10
|
+
"text",
|
|
11
|
+
"number",
|
|
12
|
+
"email",
|
|
13
|
+
"url",
|
|
14
|
+
"checkbox",
|
|
15
|
+
"radio",
|
|
16
|
+
"range",
|
|
17
|
+
"date",
|
|
18
|
+
"datetime-local",
|
|
19
|
+
"search",
|
|
20
|
+
"tel",
|
|
21
|
+
"time",
|
|
22
|
+
"file",
|
|
23
|
+
"month",
|
|
24
|
+
"week",
|
|
25
|
+
"password",
|
|
26
|
+
"color",
|
|
27
|
+
"hidden"
|
|
28
|
+
],
|
|
29
|
+
defaultValue: "text"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
name: "name",
|
|
33
|
+
type: "string",
|
|
34
|
+
required: true,
|
|
35
|
+
helperText: 'Every input in a form needs a unique name describing what it takes, e.g. "email"'
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
name: "placeholder",
|
|
39
|
+
type: "string",
|
|
40
|
+
defaultValue: "Hello there",
|
|
41
|
+
helperText: "Text to display when there is no value"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
name: "defaultValue",
|
|
45
|
+
type: "string"
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
name: "value",
|
|
49
|
+
type: "string",
|
|
50
|
+
advanced: true
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
name: "required",
|
|
54
|
+
type: "boolean",
|
|
55
|
+
helperText: "Is this input required to be filled out to submit a form",
|
|
56
|
+
defaultValue: false
|
|
57
|
+
}
|
|
58
|
+
],
|
|
59
|
+
noWrap: true,
|
|
60
|
+
static: true,
|
|
61
|
+
defaultStyles: {
|
|
62
|
+
paddingTop: "10px",
|
|
63
|
+
paddingBottom: "10px",
|
|
64
|
+
paddingLeft: "10px",
|
|
65
|
+
paddingRight: "10px",
|
|
66
|
+
borderRadius: "3px",
|
|
67
|
+
borderWidth: "1px",
|
|
68
|
+
borderStyle: "solid",
|
|
69
|
+
borderColor: "#ccc"
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
export {
|
|
73
|
+
componentInfo
|
|
74
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { registerComponent } from "../../functions/register-component.js";
|
|
2
|
+
import { componentInfo } from "./component-info.js";
|
|
3
|
+
import component from "./input.svelte";
|
|
4
|
+
var stdin_default = registerComponent(component, componentInfo);
|
|
5
|
+
export {
|
|
6
|
+
stdin_default as default
|
|
7
|
+
};
|
|
@@ -3,10 +3,11 @@
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
import { isEditing } from '
|
|
6
|
+
import { isEditing } from '../../functions/is-editing.js';
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
+
|
|
10
11
|
|
|
11
12
|
|
|
12
13
|
export let attributes;
|
|
@@ -16,11 +17,13 @@ export let type;
|
|
|
16
17
|
export let name;
|
|
17
18
|
export let value;
|
|
18
19
|
export let required;
|
|
19
|
-
|
|
20
|
+
|
|
20
21
|
|
|
21
22
|
|
|
22
23
|
|
|
23
24
|
|
|
25
|
+
|
|
26
|
+
|
|
24
27
|
|
|
25
28
|
|
|
26
29
|
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { registerComponent } from "../../functions/register-component.js";
|
|
2
|
+
import { componentInfo } from "./component-info.js";
|
|
3
|
+
import component from "./raw-text.svelte";
|
|
4
|
+
var stdin_default = registerComponent(component, componentInfo);
|
|
5
|
+
export {
|
|
6
|
+
stdin_default as default
|
|
7
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
const componentInfo = {
|
|
2
|
+
name: "Core:Section",
|
|
3
|
+
static: true,
|
|
4
|
+
builtIn: true,
|
|
5
|
+
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F682efef23ace49afac61748dd305c70a",
|
|
6
|
+
inputs: [
|
|
7
|
+
{
|
|
8
|
+
name: "maxWidth",
|
|
9
|
+
type: "number",
|
|
10
|
+
defaultValue: 1200
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
name: "lazyLoad",
|
|
14
|
+
type: "boolean",
|
|
15
|
+
defaultValue: false,
|
|
16
|
+
advanced: true,
|
|
17
|
+
description: "Only render this section when in view"
|
|
18
|
+
}
|
|
19
|
+
],
|
|
20
|
+
defaultStyles: {
|
|
21
|
+
paddingLeft: "20px",
|
|
22
|
+
paddingRight: "20px",
|
|
23
|
+
paddingTop: "50px",
|
|
24
|
+
paddingBottom: "50px",
|
|
25
|
+
marginTop: "0px",
|
|
26
|
+
width: "100vw",
|
|
27
|
+
marginLeft: "calc(50% - 50vw)"
|
|
28
|
+
},
|
|
29
|
+
canHaveChildren: true,
|
|
30
|
+
defaultChildren: [
|
|
31
|
+
{
|
|
32
|
+
"@type": "@builder.io/sdk:Element",
|
|
33
|
+
responsiveStyles: {
|
|
34
|
+
large: {
|
|
35
|
+
textAlign: "center"
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
component: {
|
|
39
|
+
name: "Text",
|
|
40
|
+
options: {
|
|
41
|
+
text: "<p><b>I am a section! My content keeps from getting too wide, so that it's easy to read even on big screens.</b></p><p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur</p>"
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
]
|
|
46
|
+
};
|
|
47
|
+
export {
|
|
48
|
+
componentInfo
|
|
49
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { registerComponent } from "../../functions/register-component.js";
|
|
2
|
+
import { componentInfo } from "./component-info.js";
|
|
3
|
+
import component from "./section.svelte";
|
|
4
|
+
var stdin_default = registerComponent(component, componentInfo);
|
|
5
|
+
export {
|
|
6
|
+
stdin_default as default
|
|
7
|
+
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
const componentInfo = {
|
|
2
|
+
name: "Form:Select",
|
|
3
|
+
builtIn: true,
|
|
4
|
+
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F83acca093fb24aaf94dee136e9a4b045",
|
|
5
|
+
defaultStyles: {
|
|
6
|
+
alignSelf: "flex-start"
|
|
7
|
+
},
|
|
8
|
+
inputs: [
|
|
9
|
+
{
|
|
10
|
+
name: "options",
|
|
11
|
+
type: "list",
|
|
12
|
+
required: true,
|
|
13
|
+
subFields: [
|
|
14
|
+
{
|
|
15
|
+
name: "value",
|
|
16
|
+
type: "text",
|
|
17
|
+
required: true
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
name: "name",
|
|
21
|
+
type: "text"
|
|
22
|
+
}
|
|
23
|
+
],
|
|
24
|
+
defaultValue: [
|
|
25
|
+
{
|
|
26
|
+
value: "option 1"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
value: "option 2"
|
|
30
|
+
}
|
|
31
|
+
]
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
name: "name",
|
|
35
|
+
type: "string",
|
|
36
|
+
required: true,
|
|
37
|
+
helperText: 'Every select in a form needs a unique name describing what it gets, e.g. "email"'
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
name: "defaultValue",
|
|
41
|
+
type: "string"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
name: "value",
|
|
45
|
+
type: "string",
|
|
46
|
+
advanced: true
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
name: "required",
|
|
50
|
+
type: "boolean",
|
|
51
|
+
defaultValue: false
|
|
52
|
+
}
|
|
53
|
+
],
|
|
54
|
+
static: true,
|
|
55
|
+
noWrap: true
|
|
56
|
+
};
|
|
57
|
+
export {
|
|
58
|
+
componentInfo
|
|
59
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { registerComponent } from "../../functions/register-component.js";
|
|
2
|
+
import { componentInfo } from "./component-info.js";
|
|
3
|
+
import component from "./select.svelte";
|
|
4
|
+
var stdin_default = registerComponent(component, componentInfo);
|
|
5
|
+
export {
|
|
6
|
+
stdin_default as default
|
|
7
|
+
};
|
|
@@ -3,10 +3,11 @@
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
import { isEditing } from '
|
|
6
|
+
import { isEditing } from '../../functions/is-editing.js';
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
+
|
|
10
11
|
|
|
11
12
|
|
|
12
13
|
export let attributes;
|
|
@@ -14,11 +15,13 @@ export let value;
|
|
|
14
15
|
export let defaultValue;
|
|
15
16
|
export let name;
|
|
16
17
|
export let options;
|
|
17
|
-
|
|
18
|
+
|
|
18
19
|
|
|
19
20
|
|
|
20
21
|
|
|
21
22
|
|
|
23
|
+
|
|
24
|
+
|
|
22
25
|
|
|
23
26
|
|
|
24
27
|
|
|
@@ -29,6 +32,10 @@ export let options;
|
|
|
29
32
|
|
|
30
33
|
<select {...attributes} value={value} key={isEditing() && defaultValue ? defaultValue : 'default-key'} defaultValue={defaultValue} name={name} >
|
|
31
34
|
|
|
32
|
-
|
|
35
|
+
|
|
36
|
+
{#each options as option, index }
|
|
37
|
+
<option value={option.value} >{option.name || option.value}</option>
|
|
38
|
+
{/each}
|
|
39
|
+
|
|
33
40
|
|
|
34
41
|
</select>
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
const componentInfo = {
|
|
2
|
+
name: "Form:SubmitButton",
|
|
3
|
+
builtIn: true,
|
|
4
|
+
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fdf2820ffed1f4349a94c40b3221f5b98",
|
|
5
|
+
defaultStyles: {
|
|
6
|
+
appearance: "none",
|
|
7
|
+
paddingTop: "15px",
|
|
8
|
+
paddingBottom: "15px",
|
|
9
|
+
paddingLeft: "25px",
|
|
10
|
+
paddingRight: "25px",
|
|
11
|
+
backgroundColor: "#3898EC",
|
|
12
|
+
color: "white",
|
|
13
|
+
borderRadius: "4px",
|
|
14
|
+
cursor: "pointer"
|
|
15
|
+
},
|
|
16
|
+
inputs: [
|
|
17
|
+
{
|
|
18
|
+
name: "text",
|
|
19
|
+
type: "text",
|
|
20
|
+
defaultValue: "Click me"
|
|
21
|
+
}
|
|
22
|
+
],
|
|
23
|
+
static: true,
|
|
24
|
+
noWrap: true
|
|
25
|
+
};
|
|
26
|
+
export {
|
|
27
|
+
componentInfo
|
|
28
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { registerComponent } from "../../functions/register-component.js";
|
|
2
|
+
import { componentInfo } from "./component-info.js";
|
|
3
|
+
import component from "./submit-button.svelte";
|
|
4
|
+
var stdin_default = registerComponent(component, componentInfo);
|
|
5
|
+
export {
|
|
6
|
+
stdin_default as default
|
|
7
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
const componentInfo = {
|
|
2
|
+
name: "Symbol",
|
|
3
|
+
noWrap: true,
|
|
4
|
+
static: true,
|
|
5
|
+
inputs: [
|
|
6
|
+
{
|
|
7
|
+
name: "symbol",
|
|
8
|
+
type: "uiSymbol"
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
name: "dataOnly",
|
|
12
|
+
helperText: "Make this a data symbol that doesn't display any UI",
|
|
13
|
+
type: "boolean",
|
|
14
|
+
defaultValue: false,
|
|
15
|
+
advanced: true,
|
|
16
|
+
hideFromUI: true
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
name: "inheritState",
|
|
20
|
+
helperText: "Inherit the parent component state and data",
|
|
21
|
+
type: "boolean",
|
|
22
|
+
defaultValue: false,
|
|
23
|
+
advanced: true
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
name: "renderToLiquid",
|
|
27
|
+
helperText: "Render this symbols contents to liquid. Turn off to fetch with javascript and use custom targeting",
|
|
28
|
+
type: "boolean",
|
|
29
|
+
defaultValue: false,
|
|
30
|
+
advanced: true,
|
|
31
|
+
hideFromUI: true
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
name: "useChildren",
|
|
35
|
+
hideFromUI: true,
|
|
36
|
+
type: "boolean"
|
|
37
|
+
}
|
|
38
|
+
]
|
|
39
|
+
};
|
|
40
|
+
export {
|
|
41
|
+
componentInfo
|
|
42
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { registerComponent } from "../../functions/register-component.js";
|
|
2
|
+
import { componentInfo } from "./component-info.js";
|
|
3
|
+
import component from "./symbol.svelte";
|
|
4
|
+
var stdin_default = registerComponent(component, componentInfo);
|
|
5
|
+
export {
|
|
6
|
+
stdin_default as default
|
|
7
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import { onMount } from 'svelte'
|
|
3
|
+
import { afterUpdate } from 'svelte'
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
import RenderContent, { } from '../../components/render-content/render-content.svelte';
|
|
7
|
+
import BuilderContext, { } from '../../context/builder.context';
|
|
8
|
+
import { getContent } from '../../functions/get-content/index.js';
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
import { getContext, setContext } from "svelte";
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
export let attributes;
|
|
16
|
+
export let symbol;
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
let builderContext = getContext(BuilderContext.key);
|
|
22
|
+
|
|
23
|
+
let className = 'builder-symbol';
|
|
24
|
+
let content = null;
|
|
25
|
+
|
|
26
|
+
onMount(() => { content = symbol?.content; });
|
|
27
|
+
|
|
28
|
+
afterUpdate(() => { const symbolToUse = symbol;
|
|
29
|
+
|
|
30
|
+
if (symbolToUse && !symbolToUse.content && !content && symbolToUse.model) {
|
|
31
|
+
getContent({
|
|
32
|
+
model: symbolToUse.model,
|
|
33
|
+
apiKey: builderContext.apiKey,
|
|
34
|
+
options: {
|
|
35
|
+
entry: symbolToUse.entry
|
|
36
|
+
}
|
|
37
|
+
}).then(response => {
|
|
38
|
+
content = response;
|
|
39
|
+
});
|
|
40
|
+
} })
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
</script>
|
|
44
|
+
|
|
45
|
+
<div {...attributes} dataSet={{
|
|
46
|
+
class: className
|
|
47
|
+
}} class={className} >
|
|
48
|
+
|
|
49
|
+
<RenderContent apiKey={builderContext.apiKey} context={builderContext.context} data={{ ...symbol?.data,
|
|
50
|
+
...builderContext.state,
|
|
51
|
+
...symbol?.content?.data?.state
|
|
52
|
+
}} model={symbol?.model} content={content} ></RenderContent>
|
|
53
|
+
|
|
54
|
+
</div>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
const componentInfo = {
|
|
2
|
+
name: "Text",
|
|
3
|
+
static: true,
|
|
4
|
+
builtIn: true,
|
|
5
|
+
image: "https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-text_fields-24px%20(1).svg?alt=media&token=12177b73-0ee3-42ca-98c6-0dd003de1929",
|
|
6
|
+
inputs: [
|
|
7
|
+
{
|
|
8
|
+
name: "text",
|
|
9
|
+
type: "html",
|
|
10
|
+
required: true,
|
|
11
|
+
autoFocus: true,
|
|
12
|
+
bubble: true,
|
|
13
|
+
defaultValue: "Enter some text..."
|
|
14
|
+
}
|
|
15
|
+
],
|
|
16
|
+
defaultStyles: {
|
|
17
|
+
lineHeight: "normal",
|
|
18
|
+
height: "auto",
|
|
19
|
+
textAlign: "center"
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
export {
|
|
23
|
+
componentInfo
|
|
24
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { registerComponent } from "../../functions/register-component.js";
|
|
2
|
+
import { componentInfo } from "./component-info.js";
|
|
3
|
+
import component from "./text.svelte";
|
|
4
|
+
var stdin_default = registerComponent(component, componentInfo);
|
|
5
|
+
export {
|
|
6
|
+
stdin_default as default
|
|
7
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
const componentInfo = {
|
|
2
|
+
name: "Form:TextArea",
|
|
3
|
+
builtIn: true,
|
|
4
|
+
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Ff74a2f3de58c4c3e939204e5b6b8f6c3",
|
|
5
|
+
inputs: [
|
|
6
|
+
{
|
|
7
|
+
advanced: true,
|
|
8
|
+
name: "value",
|
|
9
|
+
type: "string"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
name: "name",
|
|
13
|
+
type: "string",
|
|
14
|
+
required: true,
|
|
15
|
+
helperText: 'Every input in a form needs a unique name describing what it gets, e.g. "email"'
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
name: "defaultValue",
|
|
19
|
+
type: "string"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
name: "placeholder",
|
|
23
|
+
type: "string",
|
|
24
|
+
defaultValue: "Hello there"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
name: "required",
|
|
28
|
+
type: "boolean",
|
|
29
|
+
defaultValue: false
|
|
30
|
+
}
|
|
31
|
+
],
|
|
32
|
+
defaultStyles: {
|
|
33
|
+
paddingTop: "10px",
|
|
34
|
+
paddingBottom: "10px",
|
|
35
|
+
paddingLeft: "10px",
|
|
36
|
+
paddingRight: "10px",
|
|
37
|
+
borderRadius: "3px",
|
|
38
|
+
borderWidth: "1px",
|
|
39
|
+
borderStyle: "solid",
|
|
40
|
+
borderColor: "#ccc"
|
|
41
|
+
},
|
|
42
|
+
static: true,
|
|
43
|
+
noWrap: true
|
|
44
|
+
};
|
|
45
|
+
export {
|
|
46
|
+
componentInfo
|
|
47
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { registerComponent } from "../../functions/register-component.js";
|
|
2
|
+
import { componentInfo } from "./component-info.js";
|
|
3
|
+
import component from "./textarea.svelte";
|
|
4
|
+
var stdin_default = registerComponent(component, componentInfo);
|
|
5
|
+
export {
|
|
6
|
+
stdin_default as default
|
|
7
|
+
};
|