@builder.io/sdk-vue 0.0.1-48 → 0.0.1-50
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/CHANGELOG.md +13 -0
- package/README.md +20 -4
- package/nuxt2/src/blocks/button.vue +20 -20
- package/nuxt2/src/blocks/columns.vue +137 -137
- package/nuxt2/src/blocks/custom-code.vue +22 -22
- package/nuxt2/src/blocks/embed.vue +17 -17
- package/nuxt2/src/blocks/form.vue +143 -143
- package/nuxt2/src/blocks/fragment.vue +3 -3
- package/nuxt2/src/blocks/image.vue +55 -63
- package/nuxt2/src/blocks/img.vue +13 -13
- package/nuxt2/src/blocks/input.vue +52 -52
- package/nuxt2/src/blocks/raw-text.vue +7 -12
- package/nuxt2/src/blocks/section.vue +19 -19
- package/nuxt2/src/blocks/select.vue +17 -17
- package/nuxt2/src/blocks/submit-button.vue +15 -15
- package/nuxt2/src/blocks/symbol.vue +110 -13
- package/nuxt2/src/blocks/text.vue +11 -11
- package/nuxt2/src/blocks/textarea.vue +19 -19
- package/nuxt2/src/blocks/video.vue +61 -61
- package/nuxt2/src/components/render-block.vue +21 -24
- package/nuxt2/src/components/render-blocks.vue +25 -21
- package/nuxt2/src/components/render-content.vue +169 -75
- package/nuxt2/src/constants/device-sizes.js +9 -10
- package/nuxt2/src/context/builder.context.js +2 -3
- package/nuxt2/src/functions/apply-patch-with-mutation.js +87 -0
- package/nuxt2/src/functions/evaluate.js +23 -44
- package/nuxt2/src/functions/event-handler-name.js +2 -3
- package/nuxt2/src/functions/get-block-actions.js +20 -40
- package/nuxt2/src/functions/get-block-component-options.js +8 -18
- package/nuxt2/src/functions/get-block-properties.js +10 -26
- package/nuxt2/src/functions/get-block-styles.js +2 -3
- package/nuxt2/src/functions/get-block-tag.js +3 -4
- package/nuxt2/src/functions/get-builder-search-params/fn.test.js +31 -0
- package/nuxt2/src/functions/get-builder-search-params/index.js +29 -0
- package/nuxt2/src/functions/get-content/fn.test.js +49 -0
- package/nuxt2/src/functions/get-content/index.js +158 -0
- package/nuxt2/src/functions/get-fetch.js +10 -29
- package/nuxt2/src/functions/get-global-this.js +6 -7
- package/nuxt2/src/functions/get-processed-block.js +16 -41
- package/nuxt2/src/functions/get-processed-block.test.js +23 -43
- package/nuxt2/src/functions/get-target.js +3 -4
- package/nuxt2/src/functions/if-target.js +2 -3
- package/nuxt2/src/functions/is-browser.js +3 -4
- package/nuxt2/src/functions/is-editing.js +8 -30
- package/nuxt2/src/functions/is-iframe.js +7 -26
- package/nuxt2/src/functions/is-previewing.js +9 -28
- package/nuxt2/src/functions/is-react-native.js +2 -3
- package/nuxt2/src/functions/macro-eval.js +4 -4
- package/nuxt2/src/functions/on-change.js +5 -6
- package/nuxt2/src/functions/on-change.test.js +20 -52
- package/nuxt2/src/functions/previewing-model-name.js +8 -27
- package/nuxt2/src/functions/register-component.js +29 -62
- package/nuxt2/src/functions/register.js +13 -32
- package/nuxt2/src/functions/set-editor-settings.js +10 -29
- package/nuxt2/src/functions/set.js +4 -16
- package/nuxt2/src/functions/set.test.js +18 -38
- package/nuxt2/src/functions/track.js +16 -36
- package/nuxt2/src/functions/transform-block.js +2 -3
- package/nuxt2/src/index-helpers/blocks-exports.js +11 -0
- package/nuxt2/src/index-helpers/top-of-file.js +11 -0
- package/nuxt2/src/index.js +16 -31
- package/nuxt2/src/scripts/init-editing.js +45 -88
- package/nuxt2/src/types/builder-block.js +1 -2
- package/nuxt2/src/types/builder-content.js +1 -2
- package/nuxt2/src/types/deep-partial.js +1 -2
- package/nuxt2/src/types/typescript.js +3 -0
- package/package.json +1 -1
- package/vue2/src/constants/device-sizes.js +9 -10
- package/vue2/src/context/builder.context.js +2 -3
- package/vue2/src/functions/apply-patch-with-mutation.js +87 -0
- package/vue2/src/functions/evaluate.js +23 -44
- package/vue2/src/functions/event-handler-name.js +2 -3
- package/vue2/src/functions/get-block-actions.js +20 -40
- package/vue2/src/functions/get-block-component-options.js +8 -18
- package/vue2/src/functions/get-block-properties.js +10 -26
- package/vue2/src/functions/get-block-styles.js +2 -3
- package/vue2/src/functions/get-block-tag.js +3 -4
- package/vue2/src/functions/get-builder-search-params/fn.test.js +31 -0
- package/vue2/src/functions/get-builder-search-params/index.js +29 -0
- package/vue2/src/functions/get-content/fn.test.js +49 -0
- package/vue2/src/functions/get-content/index.js +158 -0
- package/vue2/src/functions/get-fetch.js +10 -29
- package/vue2/src/functions/get-global-this.js +6 -7
- package/vue2/src/functions/get-processed-block.js +16 -41
- package/vue2/src/functions/get-processed-block.test.js +23 -43
- package/vue2/src/functions/get-target.js +3 -4
- package/vue2/src/functions/if-target.js +2 -3
- package/vue2/src/functions/is-browser.js +3 -4
- package/vue2/src/functions/is-editing.js +8 -30
- package/vue2/src/functions/is-iframe.js +7 -26
- package/vue2/src/functions/is-previewing.js +9 -28
- package/vue2/src/functions/is-react-native.js +2 -3
- package/vue2/src/functions/macro-eval.js +4 -4
- package/vue2/src/functions/on-change.js +5 -6
- package/vue2/src/functions/on-change.test.js +20 -52
- package/vue2/src/functions/previewing-model-name.js +8 -27
- package/vue2/src/functions/register-component.js +29 -62
- package/vue2/src/functions/register.js +13 -32
- package/vue2/src/functions/set-editor-settings.js +10 -29
- package/vue2/src/functions/set.js +4 -16
- package/vue2/src/functions/set.test.js +18 -38
- package/vue2/src/functions/track.js +16 -36
- package/vue2/src/functions/transform-block.js +2 -3
- package/vue2/src/index-helpers/blocks-exports.js +11 -0
- package/vue2/src/index-helpers/top-of-file.js +11 -0
- package/vue2/src/index.js +16 -31
- package/vue2/src/scripts/init-editing.js +45 -88
- package/vue2/src/types/builder-block.js +1 -2
- package/vue2/src/types/builder-content.js +1 -2
- package/vue2/src/types/deep-partial.js +1 -2
- package/vue2/src/types/typescript.js +3 -0
- package/vue3/src/constants/device-sizes.js +9 -10
- package/vue3/src/context/builder.context.js +2 -3
- package/vue3/src/functions/apply-patch-with-mutation.js +87 -0
- package/vue3/src/functions/evaluate.js +23 -44
- package/vue3/src/functions/event-handler-name.js +2 -3
- package/vue3/src/functions/get-block-actions.js +20 -40
- package/vue3/src/functions/get-block-component-options.js +8 -18
- package/vue3/src/functions/get-block-properties.js +10 -26
- package/vue3/src/functions/get-block-styles.js +2 -3
- package/vue3/src/functions/get-block-tag.js +3 -4
- package/vue3/src/functions/get-builder-search-params/fn.test.js +31 -0
- package/vue3/src/functions/get-builder-search-params/index.js +29 -0
- package/vue3/src/functions/get-content/fn.test.js +49 -0
- package/vue3/src/functions/get-content/index.js +158 -0
- package/vue3/src/functions/get-fetch.js +10 -29
- package/vue3/src/functions/get-global-this.js +6 -7
- package/vue3/src/functions/get-processed-block.js +16 -41
- package/vue3/src/functions/get-processed-block.test.js +23 -43
- package/vue3/src/functions/get-target.js +3 -4
- package/vue3/src/functions/if-target.js +2 -3
- package/vue3/src/functions/is-browser.js +3 -4
- package/vue3/src/functions/is-editing.js +8 -30
- package/vue3/src/functions/is-iframe.js +7 -26
- package/vue3/src/functions/is-previewing.js +9 -28
- package/vue3/src/functions/is-react-native.js +2 -3
- package/vue3/src/functions/macro-eval.js +4 -4
- package/vue3/src/functions/on-change.js +5 -6
- package/vue3/src/functions/on-change.test.js +20 -52
- package/vue3/src/functions/previewing-model-name.js +8 -27
- package/vue3/src/functions/register-component.js +29 -62
- package/vue3/src/functions/register.js +13 -32
- package/vue3/src/functions/set-editor-settings.js +10 -29
- package/vue3/src/functions/set.js +4 -16
- package/vue3/src/functions/set.test.js +18 -38
- package/vue3/src/functions/track.js +16 -36
- package/vue3/src/functions/transform-block.js +2 -3
- package/vue3/src/index-helpers/blocks-exports.js +11 -0
- package/vue3/src/index-helpers/top-of-file.js +11 -0
- package/vue3/src/index.js +16 -31
- package/vue3/src/scripts/init-editing.js +45 -88
- package/vue3/src/types/builder-block.js +1 -2
- package/vue3/src/types/builder-content.js +1 -2
- package/vue3/src/types/deep-partial.js +1 -2
- package/vue3/src/types/typescript.js +3 -0
- package/nuxt2/src/functions/get-content.js +0 -194
- package/nuxt2/src/functions/get-content.test.js +0 -95
- package/vue2/src/functions/get-content.js +0 -194
- package/vue2/src/functions/get-content.test.js +0 -95
- package/vue3/src/functions/get-content.js +0 -194
- package/vue3/src/functions/get-content.test.js +0 -95
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
### 0.0.1-49
|
|
2
|
+
|
|
3
|
+
- Fix: show the "+ add block" button on empty pages https://github.com/BuilderIO/builder/pull/934
|
|
4
|
+
- Add `getBuilderSearchParams` helper export to easily view current drafts on your production site. https://github.com/BuilderIO/builder/pull/883
|
|
5
|
+
|
|
6
|
+
### 0.0.1-48
|
|
7
|
+
|
|
8
|
+
Changes:
|
|
9
|
+
|
|
10
|
+
- Adds support for Columns https://github.com/BuilderIO/builder/pull/717
|
|
11
|
+
- Add preliminary support for Children within custom components https://github.com/BuilderIO/builder/pull/753
|
|
12
|
+
- Seeds classnames to reduce variation in changes https://github.com/BuilderIO/builder/pull/703
|
|
13
|
+
- Fixes `getAllContent` to traverse all symbols/references https://github.com/BuilderIO/builder/pull/718
|
package/README.md
CHANGED
|
@@ -2,12 +2,28 @@
|
|
|
2
2
|
|
|
3
3
|
This is the 2.0 Vue SDK. It is currently in beta.
|
|
4
4
|
|
|
5
|
-
NOTE: If you are looking for the stable 1.0 Vue SDK, you can find it [here](
|
|
5
|
+
NOTE: If you are looking for the stable 1.0 Vue SDK, you can find it [here](/packages/vue)
|
|
6
6
|
|
|
7
7
|
## Feature Support
|
|
8
8
|
|
|
9
9
|
To check the status of the SDK, look at [these tables](../../README.md#feature-implementation).
|
|
10
10
|
|
|
11
|
+
## Version Support
|
|
12
|
+
|
|
13
|
+
Legend:
|
|
14
|
+
|
|
15
|
+
- ✅: implemented
|
|
16
|
+
- 🏗: currently in progress
|
|
17
|
+
- ⚠️: not-yet implemented
|
|
18
|
+
- N/A : does not apply
|
|
19
|
+
|
|
20
|
+
| Platform | Support |
|
|
21
|
+
| -------- | ------- |
|
|
22
|
+
| Vue 2 | 🏗 |
|
|
23
|
+
| Nuxt 2 | 🏗 |
|
|
24
|
+
| Vue 3 | ⚠️ |
|
|
25
|
+
| Nuxt 3 | ⚠️ |
|
|
26
|
+
|
|
11
27
|
## Getting Started
|
|
12
28
|
|
|
13
29
|
```
|
|
@@ -24,9 +40,9 @@ Add to your `nuxt.config.js`:
|
|
|
24
40
|
buildModules: ['@builder.io/sdk-vue/nuxt'];
|
|
25
41
|
```
|
|
26
42
|
|
|
27
|
-
Then register built in and custom components as seen [here](/examples/vue-
|
|
43
|
+
Then register built in and custom components as seen [here](/examples/vue/nuxt-2/scripts/register-builder-components.js)
|
|
28
44
|
|
|
29
45
|
You can see examples of using Builder.io:
|
|
30
46
|
|
|
31
|
-
- with Nuxt [here](/examples/vue-
|
|
32
|
-
- with Vue Storefront [here](/examples/vue/vue-storefront
|
|
47
|
+
- with Nuxt [here](/examples/vue/nuxt-2/)
|
|
48
|
+
- with Vue Storefront [here](/examples/vue/vue-storefront-2)
|
|
@@ -11,39 +11,39 @@
|
|
|
11
11
|
<span v-bind="attributes" v-else="">{{ text }}</span>
|
|
12
12
|
</template>
|
|
13
13
|
<script>
|
|
14
|
-
import { registerComponent } from
|
|
14
|
+
import { registerComponent } from "../functions/register-component";
|
|
15
15
|
|
|
16
16
|
export default registerComponent(
|
|
17
17
|
{
|
|
18
|
-
name:
|
|
18
|
+
name: "builder-button",
|
|
19
19
|
|
|
20
|
-
props: [
|
|
20
|
+
props: ["attributes", "text", "link", "openLinkInNewTab"],
|
|
21
21
|
},
|
|
22
22
|
{
|
|
23
|
-
name:
|
|
23
|
+
name: "Core:Button",
|
|
24
24
|
builtIn: true,
|
|
25
25
|
image:
|
|
26
|
-
|
|
26
|
+
"https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F81a15681c3e74df09677dfc57a615b13",
|
|
27
27
|
defaultStyles: {
|
|
28
|
-
appearance:
|
|
29
|
-
paddingTop:
|
|
30
|
-
paddingBottom:
|
|
31
|
-
paddingLeft:
|
|
32
|
-
paddingRight:
|
|
33
|
-
backgroundColor:
|
|
34
|
-
color:
|
|
35
|
-
borderRadius:
|
|
36
|
-
textAlign:
|
|
37
|
-
cursor:
|
|
28
|
+
appearance: "none",
|
|
29
|
+
paddingTop: "15px",
|
|
30
|
+
paddingBottom: "15px",
|
|
31
|
+
paddingLeft: "25px",
|
|
32
|
+
paddingRight: "25px",
|
|
33
|
+
backgroundColor: "#000000",
|
|
34
|
+
color: "white",
|
|
35
|
+
borderRadius: "4px",
|
|
36
|
+
textAlign: "center",
|
|
37
|
+
cursor: "pointer",
|
|
38
38
|
},
|
|
39
39
|
inputs: [
|
|
40
|
-
{ name:
|
|
41
|
-
{ name:
|
|
40
|
+
{ name: "text", type: "text", defaultValue: "Click me!", bubble: true },
|
|
41
|
+
{ name: "link", type: "url", bubble: true },
|
|
42
42
|
{
|
|
43
|
-
name:
|
|
44
|
-
type:
|
|
43
|
+
name: "openLinkInNewTab",
|
|
44
|
+
type: "boolean",
|
|
45
45
|
defaultValue: false,
|
|
46
|
-
friendlyName:
|
|
46
|
+
friendlyName: "Open link in new tab",
|
|
47
47
|
},
|
|
48
48
|
],
|
|
49
49
|
static: true,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="builder-columns div-
|
|
2
|
+
<div class="builder-columns div-21azgz5avex" :style="columnsCssVars">
|
|
3
3
|
<div
|
|
4
|
-
class="builder-column div-
|
|
4
|
+
class="builder-column div-21azgz5avex-2"
|
|
5
5
|
v-for="(column, index) in columns"
|
|
6
6
|
:style="{
|
|
7
7
|
width: getColumnCssWidth(index),
|
|
@@ -15,44 +15,44 @@
|
|
|
15
15
|
</div>
|
|
16
16
|
</template>
|
|
17
17
|
<script>
|
|
18
|
-
import RenderBlocks from
|
|
18
|
+
import RenderBlocks from "../components/render-blocks";
|
|
19
19
|
|
|
20
|
-
import { registerComponent } from
|
|
20
|
+
import { registerComponent } from "../functions/register-component";
|
|
21
21
|
|
|
22
22
|
export default registerComponent(
|
|
23
23
|
{
|
|
24
|
-
name:
|
|
25
|
-
components: {
|
|
26
|
-
props: [
|
|
24
|
+
name: "builder-columns",
|
|
25
|
+
components: { "render-blocks": async () => RenderBlocks },
|
|
26
|
+
props: ["space", "columns", "stackColumnsAt", "reverseColumnsWhenStacked"],
|
|
27
27
|
|
|
28
28
|
computed: {
|
|
29
29
|
columnsCssVars() {
|
|
30
30
|
const flexDir =
|
|
31
|
-
this.stackColumnsAt ===
|
|
32
|
-
?
|
|
31
|
+
this.stackColumnsAt === "never"
|
|
32
|
+
? "inherit"
|
|
33
33
|
: this.reverseColumnsWhenStacked
|
|
34
|
-
?
|
|
35
|
-
:
|
|
34
|
+
? "column-reverse"
|
|
35
|
+
: "column";
|
|
36
36
|
return {
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
"--flex-dir": flexDir,
|
|
38
|
+
"--flex-dir-tablet": this.maybeApplyForTablet(flexDir),
|
|
39
39
|
};
|
|
40
40
|
},
|
|
41
41
|
columnCssVars() {
|
|
42
|
-
const width =
|
|
43
|
-
const marginLeft =
|
|
42
|
+
const width = "100%";
|
|
43
|
+
const marginLeft = "0";
|
|
44
44
|
return {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
45
|
+
"--column-width": width,
|
|
46
|
+
"--column-margin-left": marginLeft,
|
|
47
|
+
"--column-width-tablet": this.maybeApplyForTablet(width),
|
|
48
|
+
"--column-margin-left-tablet": this.maybeApplyForTablet(marginLeft),
|
|
49
49
|
};
|
|
50
50
|
},
|
|
51
51
|
},
|
|
52
52
|
|
|
53
53
|
methods: {
|
|
54
54
|
getGutterSize() {
|
|
55
|
-
return typeof this.space ===
|
|
55
|
+
return typeof this.space === "number" ? this.space || 0 : 20;
|
|
56
56
|
},
|
|
57
57
|
getColumns() {
|
|
58
58
|
return this.columns || [];
|
|
@@ -69,139 +69,139 @@ export default registerComponent(
|
|
|
69
69
|
return `calc(${this.getWidth(index)}% - ${subtractWidth}px)`;
|
|
70
70
|
},
|
|
71
71
|
maybeApplyForTablet(prop) {
|
|
72
|
-
const stackColumnsAt = this.stackColumnsAt ||
|
|
73
|
-
return stackColumnsAt ===
|
|
72
|
+
const stackColumnsAt = this.stackColumnsAt || "tablet";
|
|
73
|
+
return stackColumnsAt === "tablet" ? prop : "inherit";
|
|
74
74
|
},
|
|
75
75
|
},
|
|
76
76
|
},
|
|
77
77
|
{
|
|
78
|
-
name:
|
|
78
|
+
name: "Columns",
|
|
79
79
|
builtIn: true,
|
|
80
80
|
inputs: [
|
|
81
81
|
{
|
|
82
|
-
name:
|
|
83
|
-
type:
|
|
82
|
+
name: "columns",
|
|
83
|
+
type: "array",
|
|
84
84
|
broadcast: true,
|
|
85
85
|
subFields: [
|
|
86
86
|
{
|
|
87
|
-
name:
|
|
88
|
-
type:
|
|
87
|
+
name: "blocks",
|
|
88
|
+
type: "array",
|
|
89
89
|
hideFromUI: true,
|
|
90
90
|
defaultValue: [
|
|
91
91
|
{
|
|
92
|
-
|
|
92
|
+
"@type": "@builder.io/sdk:Element",
|
|
93
93
|
responsiveStyles: {
|
|
94
94
|
large: {
|
|
95
|
-
display:
|
|
96
|
-
flexDirection:
|
|
97
|
-
alignItems:
|
|
98
|
-
flexShrink:
|
|
99
|
-
position:
|
|
100
|
-
marginTop:
|
|
101
|
-
textAlign:
|
|
102
|
-
lineHeight:
|
|
103
|
-
height:
|
|
104
|
-
minHeight:
|
|
105
|
-
minWidth:
|
|
106
|
-
overflow:
|
|
95
|
+
display: "flex",
|
|
96
|
+
flexDirection: "column",
|
|
97
|
+
alignItems: "stretch",
|
|
98
|
+
flexShrink: "0",
|
|
99
|
+
position: "relative",
|
|
100
|
+
marginTop: "30px",
|
|
101
|
+
textAlign: "center",
|
|
102
|
+
lineHeight: "normal",
|
|
103
|
+
height: "auto",
|
|
104
|
+
minHeight: "20px",
|
|
105
|
+
minWidth: "20px",
|
|
106
|
+
overflow: "hidden",
|
|
107
107
|
},
|
|
108
108
|
},
|
|
109
109
|
component: {
|
|
110
|
-
name:
|
|
110
|
+
name: "Image",
|
|
111
111
|
options: {
|
|
112
112
|
image:
|
|
113
|
-
|
|
114
|
-
backgroundPosition:
|
|
115
|
-
backgroundSize:
|
|
113
|
+
"https://builder.io/api/v1/image/assets%2Fpwgjf0RoYWbdnJSbpBAjXNRMe9F2%2Ffb27a7c790324294af8be1c35fe30f4d",
|
|
114
|
+
backgroundPosition: "center",
|
|
115
|
+
backgroundSize: "cover",
|
|
116
116
|
aspectRatio: 0.7004048582995948,
|
|
117
117
|
},
|
|
118
118
|
},
|
|
119
119
|
},
|
|
120
120
|
{
|
|
121
|
-
|
|
121
|
+
"@type": "@builder.io/sdk:Element",
|
|
122
122
|
responsiveStyles: {
|
|
123
123
|
large: {
|
|
124
|
-
display:
|
|
125
|
-
flexDirection:
|
|
126
|
-
alignItems:
|
|
127
|
-
flexShrink:
|
|
128
|
-
position:
|
|
129
|
-
marginTop:
|
|
130
|
-
textAlign:
|
|
131
|
-
lineHeight:
|
|
132
|
-
height:
|
|
124
|
+
display: "flex",
|
|
125
|
+
flexDirection: "column",
|
|
126
|
+
alignItems: "stretch",
|
|
127
|
+
flexShrink: "0",
|
|
128
|
+
position: "relative",
|
|
129
|
+
marginTop: "30px",
|
|
130
|
+
textAlign: "center",
|
|
131
|
+
lineHeight: "normal",
|
|
132
|
+
height: "auto",
|
|
133
133
|
},
|
|
134
134
|
},
|
|
135
135
|
component: {
|
|
136
|
-
name:
|
|
137
|
-
options: { text:
|
|
136
|
+
name: "Text",
|
|
137
|
+
options: { text: "<p>Enter some text...</p>" },
|
|
138
138
|
},
|
|
139
139
|
},
|
|
140
140
|
],
|
|
141
141
|
},
|
|
142
142
|
{
|
|
143
|
-
name:
|
|
144
|
-
type:
|
|
143
|
+
name: "width",
|
|
144
|
+
type: "number",
|
|
145
145
|
hideFromUI: true,
|
|
146
|
-
helperText:
|
|
146
|
+
helperText: "Width %, e.g. set to 50 to fill half of the space",
|
|
147
147
|
},
|
|
148
148
|
{
|
|
149
|
-
name:
|
|
150
|
-
type:
|
|
149
|
+
name: "link",
|
|
150
|
+
type: "url",
|
|
151
151
|
helperText:
|
|
152
|
-
|
|
152
|
+
"Optionally set a url that clicking this column will link to",
|
|
153
153
|
},
|
|
154
154
|
],
|
|
155
155
|
defaultValue: [
|
|
156
156
|
{
|
|
157
157
|
blocks: [
|
|
158
158
|
{
|
|
159
|
-
|
|
159
|
+
"@type": "@builder.io/sdk:Element",
|
|
160
160
|
responsiveStyles: {
|
|
161
161
|
large: {
|
|
162
|
-
display:
|
|
163
|
-
flexDirection:
|
|
164
|
-
alignItems:
|
|
165
|
-
flexShrink:
|
|
166
|
-
position:
|
|
167
|
-
marginTop:
|
|
168
|
-
textAlign:
|
|
169
|
-
lineHeight:
|
|
170
|
-
height:
|
|
171
|
-
minHeight:
|
|
172
|
-
minWidth:
|
|
173
|
-
overflow:
|
|
162
|
+
display: "flex",
|
|
163
|
+
flexDirection: "column",
|
|
164
|
+
alignItems: "stretch",
|
|
165
|
+
flexShrink: "0",
|
|
166
|
+
position: "relative",
|
|
167
|
+
marginTop: "30px",
|
|
168
|
+
textAlign: "center",
|
|
169
|
+
lineHeight: "normal",
|
|
170
|
+
height: "auto",
|
|
171
|
+
minHeight: "20px",
|
|
172
|
+
minWidth: "20px",
|
|
173
|
+
overflow: "hidden",
|
|
174
174
|
},
|
|
175
175
|
},
|
|
176
176
|
component: {
|
|
177
|
-
name:
|
|
177
|
+
name: "Image",
|
|
178
178
|
options: {
|
|
179
179
|
image:
|
|
180
|
-
|
|
181
|
-
backgroundPosition:
|
|
182
|
-
backgroundSize:
|
|
180
|
+
"https://builder.io/api/v1/image/assets%2Fpwgjf0RoYWbdnJSbpBAjXNRMe9F2%2Ffb27a7c790324294af8be1c35fe30f4d",
|
|
181
|
+
backgroundPosition: "center",
|
|
182
|
+
backgroundSize: "cover",
|
|
183
183
|
aspectRatio: 0.7004048582995948,
|
|
184
184
|
},
|
|
185
185
|
},
|
|
186
186
|
},
|
|
187
187
|
{
|
|
188
|
-
|
|
188
|
+
"@type": "@builder.io/sdk:Element",
|
|
189
189
|
responsiveStyles: {
|
|
190
190
|
large: {
|
|
191
|
-
display:
|
|
192
|
-
flexDirection:
|
|
193
|
-
alignItems:
|
|
194
|
-
flexShrink:
|
|
195
|
-
position:
|
|
196
|
-
marginTop:
|
|
197
|
-
textAlign:
|
|
198
|
-
lineHeight:
|
|
199
|
-
height:
|
|
191
|
+
display: "flex",
|
|
192
|
+
flexDirection: "column",
|
|
193
|
+
alignItems: "stretch",
|
|
194
|
+
flexShrink: "0",
|
|
195
|
+
position: "relative",
|
|
196
|
+
marginTop: "30px",
|
|
197
|
+
textAlign: "center",
|
|
198
|
+
lineHeight: "normal",
|
|
199
|
+
height: "auto",
|
|
200
200
|
},
|
|
201
201
|
},
|
|
202
202
|
component: {
|
|
203
|
-
name:
|
|
204
|
-
options: { text:
|
|
203
|
+
name: "Text",
|
|
204
|
+
options: { text: "<p>Enter some text...</p>" },
|
|
205
205
|
},
|
|
206
206
|
},
|
|
207
207
|
],
|
|
@@ -209,52 +209,52 @@ export default registerComponent(
|
|
|
209
209
|
{
|
|
210
210
|
blocks: [
|
|
211
211
|
{
|
|
212
|
-
|
|
212
|
+
"@type": "@builder.io/sdk:Element",
|
|
213
213
|
responsiveStyles: {
|
|
214
214
|
large: {
|
|
215
|
-
display:
|
|
216
|
-
flexDirection:
|
|
217
|
-
alignItems:
|
|
218
|
-
flexShrink:
|
|
219
|
-
position:
|
|
220
|
-
marginTop:
|
|
221
|
-
textAlign:
|
|
222
|
-
lineHeight:
|
|
223
|
-
height:
|
|
224
|
-
minHeight:
|
|
225
|
-
minWidth:
|
|
226
|
-
overflow:
|
|
215
|
+
display: "flex",
|
|
216
|
+
flexDirection: "column",
|
|
217
|
+
alignItems: "stretch",
|
|
218
|
+
flexShrink: "0",
|
|
219
|
+
position: "relative",
|
|
220
|
+
marginTop: "30px",
|
|
221
|
+
textAlign: "center",
|
|
222
|
+
lineHeight: "normal",
|
|
223
|
+
height: "auto",
|
|
224
|
+
minHeight: "20px",
|
|
225
|
+
minWidth: "20px",
|
|
226
|
+
overflow: "hidden",
|
|
227
227
|
},
|
|
228
228
|
},
|
|
229
229
|
component: {
|
|
230
|
-
name:
|
|
230
|
+
name: "Image",
|
|
231
231
|
options: {
|
|
232
232
|
image:
|
|
233
|
-
|
|
234
|
-
backgroundPosition:
|
|
235
|
-
backgroundSize:
|
|
233
|
+
"https://builder.io/api/v1/image/assets%2Fpwgjf0RoYWbdnJSbpBAjXNRMe9F2%2Ffb27a7c790324294af8be1c35fe30f4d",
|
|
234
|
+
backgroundPosition: "center",
|
|
235
|
+
backgroundSize: "cover",
|
|
236
236
|
aspectRatio: 0.7004048582995948,
|
|
237
237
|
},
|
|
238
238
|
},
|
|
239
239
|
},
|
|
240
240
|
{
|
|
241
|
-
|
|
241
|
+
"@type": "@builder.io/sdk:Element",
|
|
242
242
|
responsiveStyles: {
|
|
243
243
|
large: {
|
|
244
|
-
display:
|
|
245
|
-
flexDirection:
|
|
246
|
-
alignItems:
|
|
247
|
-
flexShrink:
|
|
248
|
-
position:
|
|
249
|
-
marginTop:
|
|
250
|
-
textAlign:
|
|
251
|
-
lineHeight:
|
|
252
|
-
height:
|
|
244
|
+
display: "flex",
|
|
245
|
+
flexDirection: "column",
|
|
246
|
+
alignItems: "stretch",
|
|
247
|
+
flexShrink: "0",
|
|
248
|
+
position: "relative",
|
|
249
|
+
marginTop: "30px",
|
|
250
|
+
textAlign: "center",
|
|
251
|
+
lineHeight: "normal",
|
|
252
|
+
height: "auto",
|
|
253
253
|
},
|
|
254
254
|
},
|
|
255
255
|
component: {
|
|
256
|
-
name:
|
|
257
|
-
options: { text:
|
|
256
|
+
name: "Text",
|
|
257
|
+
options: { text: "<p>Enter some text...</p>" },
|
|
258
258
|
},
|
|
259
259
|
},
|
|
260
260
|
],
|
|
@@ -264,27 +264,27 @@ export default registerComponent(
|
|
|
264
264
|
" 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(); } } } } ",
|
|
265
265
|
},
|
|
266
266
|
{
|
|
267
|
-
name:
|
|
268
|
-
type:
|
|
267
|
+
name: "space",
|
|
268
|
+
type: "number",
|
|
269
269
|
defaultValue: 20,
|
|
270
|
-
helperText:
|
|
270
|
+
helperText: "Size of gap between columns",
|
|
271
271
|
advanced: true,
|
|
272
272
|
},
|
|
273
273
|
{
|
|
274
|
-
name:
|
|
275
|
-
type:
|
|
276
|
-
defaultValue:
|
|
274
|
+
name: "stackColumnsAt",
|
|
275
|
+
type: "string",
|
|
276
|
+
defaultValue: "tablet",
|
|
277
277
|
helperText:
|
|
278
|
-
|
|
279
|
-
enum: [
|
|
278
|
+
"Convert horizontal columns to vertical at what device size",
|
|
279
|
+
enum: ["tablet", "mobile", "never"],
|
|
280
280
|
advanced: true,
|
|
281
281
|
},
|
|
282
282
|
{
|
|
283
|
-
name:
|
|
284
|
-
type:
|
|
283
|
+
name: "reverseColumnsWhenStacked",
|
|
284
|
+
type: "boolean",
|
|
285
285
|
defaultValue: false,
|
|
286
286
|
helperText:
|
|
287
|
-
|
|
287
|
+
"When stacking columns for mobile devices, reverse the ordering",
|
|
288
288
|
advanced: true,
|
|
289
289
|
},
|
|
290
290
|
],
|
|
@@ -292,32 +292,32 @@ export default registerComponent(
|
|
|
292
292
|
);
|
|
293
293
|
</script>
|
|
294
294
|
<style scoped>
|
|
295
|
-
.div-
|
|
295
|
+
.div-21azgz5avex {
|
|
296
296
|
display: flex;
|
|
297
297
|
align-items: stretch;
|
|
298
298
|
line-height: normal;
|
|
299
299
|
}
|
|
300
300
|
@media (max-width: 999px) {
|
|
301
|
-
.div-
|
|
301
|
+
.div-21azgz5avex {
|
|
302
302
|
flex-direction: var(--flex-dir-tablet);
|
|
303
303
|
}
|
|
304
304
|
}
|
|
305
305
|
@media (max-width: 639px) {
|
|
306
|
-
.div-
|
|
306
|
+
.div-21azgz5avex {
|
|
307
307
|
flex-direction: var(--flex-dir);
|
|
308
308
|
}
|
|
309
309
|
}
|
|
310
|
-
.div-
|
|
310
|
+
.div-21azgz5avex-2 {
|
|
311
311
|
flex-grow: 1;
|
|
312
312
|
}
|
|
313
313
|
@media (max-width: 999px) {
|
|
314
|
-
.div-
|
|
314
|
+
.div-21azgz5avex-2 {
|
|
315
315
|
width: var(--column-width-tablet) !important;
|
|
316
316
|
margin-left: var(--column-margin-left-tablet) !important;
|
|
317
317
|
}
|
|
318
318
|
}
|
|
319
319
|
@media (max-width: 639px) {
|
|
320
|
-
.div-
|
|
320
|
+
.div-21azgz5avex-2 {
|
|
321
321
|
width: var(--column-width) !important;
|
|
322
322
|
margin-left: var(--column-margin-left) !important;
|
|
323
323
|
}
|