@builder.io/sdk-vue 0.0.1-72 → 0.0.1-73
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 +1 -1
- package/vue2/.vscode/extensions.json +0 -3
- package/vue2/README.md +0 -40
- package/vue2/env.d.ts +0 -1
- package/vue2/package.json +0 -27
- package/vue2/src/blocks/button/button.vue +0 -52
- package/vue2/src/blocks/button/component-info.js +0 -41
- package/vue2/src/blocks/columns/columns.vue +0 -131
- package/vue2/src/blocks/columns/component-info.js +0 -242
- package/vue2/src/blocks/custom-code/component-info.js +0 -31
- package/vue2/src/blocks/custom-code/custom-code.vue +0 -88
- package/vue2/src/blocks/embed/component-info.js +0 -44
- package/vue2/src/blocks/embed/embed.vue +0 -73
- package/vue2/src/blocks/embed/helpers.js +0 -9
- package/vue2/src/blocks/form/component-info.js +0 -262
- package/vue2/src/blocks/form/form.vue +0 -343
- package/vue2/src/blocks/fragment/component-info.js +0 -11
- package/vue2/src/blocks/fragment/fragment.vue +0 -35
- package/vue2/src/blocks/image/component-info.js +0 -151
- package/vue2/src/blocks/image/image.helpers.js +0 -48
- package/vue2/src/blocks/image/image.vue +0 -156
- package/vue2/src/blocks/img/component-info.js +0 -20
- package/vue2/src/blocks/img/img.vue +0 -50
- package/vue2/src/blocks/input/component-info.js +0 -74
- package/vue2/src/blocks/input/input.vue +0 -50
- package/vue2/src/blocks/raw-text/component-info.js +0 -16
- package/vue2/src/blocks/raw-text/raw-text.vue +0 -48
- package/vue2/src/blocks/section/component-info.js +0 -49
- package/vue2/src/blocks/section/section.vue +0 -47
- package/vue2/src/blocks/select/component-info.js +0 -59
- package/vue2/src/blocks/select/select.vue +0 -56
- package/vue2/src/blocks/submit-button/component-info.js +0 -28
- package/vue2/src/blocks/submit-button/submit-button.vue +0 -36
- package/vue2/src/blocks/symbol/component-info.js +0 -43
- package/vue2/src/blocks/symbol/symbol.vue +0 -118
- package/vue2/src/blocks/text/component-info.js +0 -24
- package/vue2/src/blocks/text/text.vue +0 -33
- package/vue2/src/blocks/textarea/component-info.js +0 -47
- package/vue2/src/blocks/textarea/textarea.vue +0 -43
- package/vue2/src/blocks/util.js +0 -7
- package/vue2/src/blocks/video/component-info.js +0 -106
- package/vue2/src/blocks/video/video.vue +0 -79
- package/vue2/src/components/render-block/block-styles.vue +0 -66
- package/vue2/src/components/render-block/render-block.helpers.js +0 -23
- package/vue2/src/components/render-block/render-block.vue +0 -212
- package/vue2/src/components/render-block/render-component.vue +0 -50
- package/vue2/src/components/render-block/render-repeated-block.vue +0 -60
- package/vue2/src/components/render-block/types.js +0 -0
- package/vue2/src/components/render-blocks.vue +0 -106
- package/vue2/src/components/render-content/components/render-styles.vue +0 -104
- package/vue2/src/components/render-content/index.js +0 -4
- package/vue2/src/components/render-content/render-content.vue +0 -301
- package/vue2/src/components/render-inlined-styles.vue +0 -44
- package/vue2/src/constants/builder-registered-components.js +0 -51
- package/vue2/src/constants/device-sizes.js +0 -21
- package/vue2/src/constants/target.js +0 -4
- package/vue2/src/context/builder.context.js +0 -4
- package/vue2/src/functions/camel-to-kebab-case.js +0 -4
- package/vue2/src/functions/convert-style-object.js +0 -6
- package/vue2/src/functions/evaluate.js +0 -28
- package/vue2/src/functions/event-handler-name.js +0 -4
- package/vue2/src/functions/get-block-actions.js +0 -23
- package/vue2/src/functions/get-block-component-options.js +0 -28
- package/vue2/src/functions/get-block-properties.js +0 -40
- package/vue2/src/functions/get-block-styles.js +0 -6
- package/vue2/src/functions/get-block-tag.js +0 -6
- package/vue2/src/functions/get-builder-search-params/fn.test.js +0 -13
- package/vue2/src/functions/get-builder-search-params/index.js +0 -33
- package/vue2/src/functions/get-content/ab-testing.js +0 -38
- package/vue2/src/functions/get-content/fn.test.js +0 -31
- package/vue2/src/functions/get-content/index.js +0 -96
- package/vue2/src/functions/get-content/types.js +0 -0
- package/vue2/src/functions/get-fetch.js +0 -34
- package/vue2/src/functions/get-global-this.js +0 -18
- package/vue2/src/functions/get-processed-block.js +0 -57
- package/vue2/src/functions/get-processed-block.test.js +0 -32
- package/vue2/src/functions/if-target.js +0 -15
- package/vue2/src/functions/is-browser.js +0 -6
- package/vue2/src/functions/is-editing.js +0 -7
- package/vue2/src/functions/is-iframe.js +0 -7
- package/vue2/src/functions/is-previewing.js +0 -14
- package/vue2/src/functions/on-change.js +0 -27
- package/vue2/src/functions/on-change.test.js +0 -19
- package/vue2/src/functions/register-component.js +0 -72
- package/vue2/src/functions/register.js +0 -29
- package/vue2/src/functions/sanitize-styles.js +0 -5
- package/vue2/src/functions/set-editor-settings.js +0 -15
- package/vue2/src/functions/set.js +0 -11
- package/vue2/src/functions/set.test.js +0 -16
- package/vue2/src/functions/track.js +0 -115
- package/vue2/src/functions/transform-block.js +0 -6
- package/vue2/src/helpers/cookie.js +0 -59
- package/vue2/src/helpers/css.js +0 -12
- package/vue2/src/helpers/flatten.js +0 -34
- package/vue2/src/helpers/localStorage.js +0 -34
- package/vue2/src/helpers/nullable.js +0 -4
- package/vue2/src/helpers/sessionId.js +0 -26
- package/vue2/src/helpers/time.js +0 -5
- package/vue2/src/helpers/url.js +0 -10
- package/vue2/src/helpers/url.test.js +0 -15
- package/vue2/src/helpers/uuid.js +0 -13
- package/vue2/src/helpers/visitorId.js +0 -33
- package/vue2/src/index-helpers/blocks-exports.js +0 -22
- package/vue2/src/index-helpers/top-of-file.js +0 -4
- package/vue2/src/index.js +0 -10
- package/vue2/src/scripts/init-editing.js +0 -79
- package/vue2/src/types/builder-block.js +0 -0
- package/vue2/src/types/builder-content.js +0 -0
- package/vue2/src/types/can-track.js +0 -0
- package/vue2/src/types/components.js +0 -0
- package/vue2/src/types/deep-partial.js +0 -0
- package/vue2/src/types/element.js +0 -0
- package/vue2/src/types/targets.js +0 -0
- package/vue2/src/types/typescript.js +0 -0
- package/vue2/tsconfig.config.json +0 -8
- package/vue2/tsconfig.json +0 -16
- package/vue2/vite.config.ts +0 -27
- package/vue3/.vscode/extensions.json +0 -3
- package/vue3/README.md +0 -40
- package/vue3/env.d.ts +0 -1
- package/vue3/package.json +0 -25
- package/vue3/src/blocks/button/button.vue +0 -56
- package/vue3/src/blocks/button/component-info.js +0 -41
- package/vue3/src/blocks/columns/columns.vue +0 -131
- package/vue3/src/blocks/columns/component-info.js +0 -242
- package/vue3/src/blocks/custom-code/component-info.js +0 -31
- package/vue3/src/blocks/custom-code/custom-code.vue +0 -88
- package/vue3/src/blocks/embed/component-info.js +0 -44
- package/vue3/src/blocks/embed/embed.vue +0 -73
- package/vue3/src/blocks/embed/helpers.js +0 -9
- package/vue3/src/blocks/form/component-info.js +0 -262
- package/vue3/src/blocks/form/form.vue +0 -343
- package/vue3/src/blocks/fragment/component-info.js +0 -11
- package/vue3/src/blocks/fragment/fragment.vue +0 -35
- package/vue3/src/blocks/image/component-info.js +0 -151
- package/vue3/src/blocks/image/image.helpers.js +0 -48
- package/vue3/src/blocks/image/image.vue +0 -165
- package/vue3/src/blocks/img/component-info.js +0 -20
- package/vue3/src/blocks/img/img.vue +0 -50
- package/vue3/src/blocks/input/component-info.js +0 -74
- package/vue3/src/blocks/input/input.vue +0 -50
- package/vue3/src/blocks/raw-text/component-info.js +0 -16
- package/vue3/src/blocks/raw-text/raw-text.vue +0 -48
- package/vue3/src/blocks/section/component-info.js +0 -49
- package/vue3/src/blocks/section/section.vue +0 -47
- package/vue3/src/blocks/select/component-info.js +0 -59
- package/vue3/src/blocks/select/select.vue +0 -52
- package/vue3/src/blocks/submit-button/component-info.js +0 -28
- package/vue3/src/blocks/submit-button/submit-button.vue +0 -36
- package/vue3/src/blocks/symbol/component-info.js +0 -43
- package/vue3/src/blocks/symbol/symbol.vue +0 -118
- package/vue3/src/blocks/text/component-info.js +0 -24
- package/vue3/src/blocks/text/text.vue +0 -33
- package/vue3/src/blocks/textarea/component-info.js +0 -47
- package/vue3/src/blocks/textarea/textarea.vue +0 -43
- package/vue3/src/blocks/util.js +0 -7
- package/vue3/src/blocks/video/component-info.js +0 -106
- package/vue3/src/blocks/video/video.vue +0 -79
- package/vue3/src/components/render-block/block-styles.vue +0 -67
- package/vue3/src/components/render-block/render-block.helpers.js +0 -23
- package/vue3/src/components/render-block/render-block.vue +0 -215
- package/vue3/src/components/render-block/render-component.vue +0 -52
- package/vue3/src/components/render-block/render-repeated-block.vue +0 -60
- package/vue3/src/components/render-block/types.js +0 -0
- package/vue3/src/components/render-blocks.vue +0 -108
- package/vue3/src/components/render-content/components/render-styles.vue +0 -104
- package/vue3/src/components/render-content/index.js +0 -4
- package/vue3/src/components/render-content/render-content.vue +0 -303
- package/vue3/src/components/render-inlined-styles.vue +0 -49
- package/vue3/src/constants/builder-registered-components.js +0 -51
- package/vue3/src/constants/device-sizes.js +0 -21
- package/vue3/src/constants/target.js +0 -4
- package/vue3/src/context/builder.context.js +0 -4
- package/vue3/src/functions/camel-to-kebab-case.js +0 -4
- package/vue3/src/functions/convert-style-object.js +0 -6
- package/vue3/src/functions/evaluate.js +0 -28
- package/vue3/src/functions/event-handler-name.js +0 -4
- package/vue3/src/functions/get-block-actions.js +0 -23
- package/vue3/src/functions/get-block-component-options.js +0 -28
- package/vue3/src/functions/get-block-properties.js +0 -40
- package/vue3/src/functions/get-block-styles.js +0 -6
- package/vue3/src/functions/get-block-tag.js +0 -6
- package/vue3/src/functions/get-builder-search-params/fn.test.js +0 -13
- package/vue3/src/functions/get-builder-search-params/index.js +0 -33
- package/vue3/src/functions/get-content/ab-testing.js +0 -38
- package/vue3/src/functions/get-content/fn.test.js +0 -31
- package/vue3/src/functions/get-content/index.js +0 -96
- package/vue3/src/functions/get-content/types.js +0 -0
- package/vue3/src/functions/get-fetch.js +0 -34
- package/vue3/src/functions/get-global-this.js +0 -18
- package/vue3/src/functions/get-processed-block.js +0 -57
- package/vue3/src/functions/get-processed-block.test.js +0 -32
- package/vue3/src/functions/if-target.js +0 -15
- package/vue3/src/functions/is-browser.js +0 -6
- package/vue3/src/functions/is-editing.js +0 -7
- package/vue3/src/functions/is-iframe.js +0 -7
- package/vue3/src/functions/is-previewing.js +0 -14
- package/vue3/src/functions/on-change.js +0 -27
- package/vue3/src/functions/on-change.test.js +0 -19
- package/vue3/src/functions/register-component.js +0 -72
- package/vue3/src/functions/register.js +0 -29
- package/vue3/src/functions/sanitize-styles.js +0 -5
- package/vue3/src/functions/set-editor-settings.js +0 -15
- package/vue3/src/functions/set.js +0 -11
- package/vue3/src/functions/set.test.js +0 -16
- package/vue3/src/functions/track.js +0 -115
- package/vue3/src/functions/transform-block.js +0 -6
- package/vue3/src/helpers/cookie.js +0 -59
- package/vue3/src/helpers/css.js +0 -12
- package/vue3/src/helpers/flatten.js +0 -34
- package/vue3/src/helpers/localStorage.js +0 -34
- package/vue3/src/helpers/nullable.js +0 -4
- package/vue3/src/helpers/sessionId.js +0 -26
- package/vue3/src/helpers/time.js +0 -5
- package/vue3/src/helpers/url.js +0 -10
- package/vue3/src/helpers/url.test.js +0 -15
- package/vue3/src/helpers/uuid.js +0 -13
- package/vue3/src/helpers/visitorId.js +0 -33
- package/vue3/src/index-helpers/blocks-exports.js +0 -22
- package/vue3/src/index-helpers/top-of-file.js +0 -4
- package/vue3/src/index.js +0 -10
- package/vue3/src/scripts/init-editing.js +0 -79
- package/vue3/src/types/builder-block.js +0 -0
- package/vue3/src/types/builder-content.js +0 -0
- package/vue3/src/types/can-track.js +0 -0
- package/vue3/src/types/components.js +0 -0
- package/vue3/src/types/deep-partial.js +0 -0
- package/vue3/src/types/element.js +0 -0
- package/vue3/src/types/targets.js +0 -0
- package/vue3/src/types/typescript.js +0 -0
- package/vue3/tsconfig.config.json +0 -8
- package/vue3/tsconfig.json +0 -16
- package/vue3/vite.config.ts +0 -27
package/package.json
CHANGED
package/vue2/README.md
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
# .
|
|
2
|
-
|
|
3
|
-
This template should help get you started developing with Vue 3 in Vite.
|
|
4
|
-
|
|
5
|
-
## Recommended IDE Setup
|
|
6
|
-
|
|
7
|
-
[VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur) + [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin).
|
|
8
|
-
|
|
9
|
-
## Type Support for `.vue` Imports in TS
|
|
10
|
-
|
|
11
|
-
TypeScript cannot handle type information for `.vue` imports by default, so we replace the `tsc` CLI with `vue-tsc` for type checking. In editors, we need [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin) to make the TypeScript language service aware of `.vue` types.
|
|
12
|
-
|
|
13
|
-
If the standalone TypeScript plugin doesn't feel fast enough to you, Volar has also implemented a [Take Over Mode](https://github.com/johnsoncodehk/volar/discussions/471#discussioncomment-1361669) that is more performant. You can enable it by the following steps:
|
|
14
|
-
|
|
15
|
-
1. Disable the built-in TypeScript Extension
|
|
16
|
-
1) Run `Extensions: Show Built-in Extensions` from VSCode's command palette
|
|
17
|
-
2) Find `TypeScript and JavaScript Language Features`, right click and select `Disable (Workspace)`
|
|
18
|
-
2. Reload the VSCode window by running `Developer: Reload Window` from the command palette.
|
|
19
|
-
|
|
20
|
-
## Customize configuration
|
|
21
|
-
|
|
22
|
-
See [Vite Configuration Reference](https://vitejs.dev/config/).
|
|
23
|
-
|
|
24
|
-
## Project Setup
|
|
25
|
-
|
|
26
|
-
```sh
|
|
27
|
-
npm install
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
### Compile and Hot-Reload for Development
|
|
31
|
-
|
|
32
|
-
```sh
|
|
33
|
-
npm run dev
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
### Type-Check, Compile and Minify for Production
|
|
37
|
-
|
|
38
|
-
```sh
|
|
39
|
-
npm run build
|
|
40
|
-
```
|
package/vue2/env.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
/// <reference types="vite/client" />
|
package/vue2/package.json
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@builder.io/sdk-vue-2",
|
|
3
|
-
"version": "0.0.0",
|
|
4
|
-
"type": "module",
|
|
5
|
-
"scripts": {
|
|
6
|
-
"dev": "vite",
|
|
7
|
-
"build": "run-p type-check build-only",
|
|
8
|
-
"preview": "vite preview --port 4173",
|
|
9
|
-
"build-only": "vite build",
|
|
10
|
-
"type-check": "vue-tsc --noEmit",
|
|
11
|
-
"copy": "cp -r dist ../dist/vue-2"
|
|
12
|
-
},
|
|
13
|
-
"dependencies": {
|
|
14
|
-
"vue": "^2.7.7"
|
|
15
|
-
},
|
|
16
|
-
"devDependencies": {
|
|
17
|
-
"@types/node": "^16.11.45",
|
|
18
|
-
"@vitejs/plugin-legacy": "^2.0.0",
|
|
19
|
-
"@vitejs/plugin-vue2": "^1.1.2",
|
|
20
|
-
"@vue/tsconfig": "^0.1.3",
|
|
21
|
-
"npm-run-all": "^4.1.5",
|
|
22
|
-
"terser": "^5.14.2",
|
|
23
|
-
"typescript": "~4.7.4",
|
|
24
|
-
"vite": "^3.0.2",
|
|
25
|
-
"vue-tsc": "^0.38.8"
|
|
26
|
-
}
|
|
27
|
-
}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<a
|
|
3
|
-
v-bind="attributes"
|
|
4
|
-
role="button"
|
|
5
|
-
v-if="link"
|
|
6
|
-
:href="link"
|
|
7
|
-
:target="openLinkInNewTab ? '_blank' : undefined"
|
|
8
|
-
>
|
|
9
|
-
{{ text }}
|
|
10
|
-
</a>
|
|
11
|
-
<button v-bind="attributes" class="button-1be3j8m9ewb" v-else>
|
|
12
|
-
{{ text }}
|
|
13
|
-
</button>
|
|
14
|
-
</template>
|
|
15
|
-
<script lang="ts">
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
export interface ButtonProps {
|
|
24
|
-
attributes?: any;
|
|
25
|
-
text?: string;
|
|
26
|
-
link?: string;
|
|
27
|
-
openLinkInNewTab?: boolean;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export default {
|
|
31
|
-
name: 'builder-button',
|
|
32
|
-
|
|
33
|
-
props: ["attributes","text","link","openLinkInNewTab"],
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}
|
|
47
|
-
</script>
|
|
48
|
-
<style scoped>
|
|
49
|
-
.button-1be3j8m9ewb {
|
|
50
|
-
all: unset;
|
|
51
|
-
}
|
|
52
|
-
</style>
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
const componentInfo = {
|
|
2
|
-
name: "Core:Button",
|
|
3
|
-
builtIn: true,
|
|
4
|
-
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F81a15681c3e74df09677dfc57a615b13",
|
|
5
|
-
defaultStyles: {
|
|
6
|
-
appearance: "none",
|
|
7
|
-
paddingTop: "15px",
|
|
8
|
-
paddingBottom: "15px",
|
|
9
|
-
paddingLeft: "25px",
|
|
10
|
-
paddingRight: "25px",
|
|
11
|
-
backgroundColor: "#000000",
|
|
12
|
-
color: "white",
|
|
13
|
-
borderRadius: "4px",
|
|
14
|
-
textAlign: "center",
|
|
15
|
-
cursor: "pointer"
|
|
16
|
-
},
|
|
17
|
-
inputs: [
|
|
18
|
-
{
|
|
19
|
-
name: "text",
|
|
20
|
-
type: "text",
|
|
21
|
-
defaultValue: "Click me!",
|
|
22
|
-
bubble: true
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
name: "link",
|
|
26
|
-
type: "url",
|
|
27
|
-
bubble: true
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
name: "openLinkInNewTab",
|
|
31
|
-
type: "boolean",
|
|
32
|
-
defaultValue: false,
|
|
33
|
-
friendlyName: "Open link in new tab"
|
|
34
|
-
}
|
|
35
|
-
],
|
|
36
|
-
static: true,
|
|
37
|
-
noWrap: true
|
|
38
|
-
};
|
|
39
|
-
export {
|
|
40
|
-
componentInfo
|
|
41
|
-
};
|
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="builder-columns div-20351ewpue7" :style="columnsCssVars">
|
|
3
|
-
<div
|
|
4
|
-
class="builder-column div-20351ewpue7-2"
|
|
5
|
-
v-for="(column, index) in columns"
|
|
6
|
-
:style="{
|
|
7
|
-
width: getColumnCssWidth(index),
|
|
8
|
-
marginLeft: `${index === 0 ? 0 : getGutterSize()}px`,
|
|
9
|
-
...columnCssVars,
|
|
10
|
-
}"
|
|
11
|
-
:key="index"
|
|
12
|
-
>
|
|
13
|
-
<render-blocks
|
|
14
|
-
:blocks="column.blocks"
|
|
15
|
-
:path="`component.options.columns.${index}.blocks`"
|
|
16
|
-
:parent="builderBlock.id"
|
|
17
|
-
></render-blocks>
|
|
18
|
-
</div>
|
|
19
|
-
</div>
|
|
20
|
-
</template>
|
|
21
|
-
<script lang="ts">
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
const RenderBlocks = () => import('../../components/render-blocks.vue')
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
import type { BuilderBlock } from '../../types/builder-block';
|
|
30
|
-
type Column = {
|
|
31
|
-
blocks: any; // TODO: Implement this when support for dynamic CSS lands
|
|
32
|
-
|
|
33
|
-
width?: number;
|
|
34
|
-
};
|
|
35
|
-
type StackColumnsAt = 'tablet' | 'mobile' | 'never';
|
|
36
|
-
export interface ColumnProps {
|
|
37
|
-
columns?: Column[];
|
|
38
|
-
builderBlock: BuilderBlock; // TODO: Implement this when support for dynamic CSS lands
|
|
39
|
-
|
|
40
|
-
space?: number; // TODO: Implement this when support for dynamic CSS lands
|
|
41
|
-
|
|
42
|
-
stackColumnsAt?: StackColumnsAt; // TODO: Implement this when support for dynamic CSS lands
|
|
43
|
-
|
|
44
|
-
reverseColumnsWhenStacked?: boolean;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
export default {
|
|
48
|
-
name: 'builder-columns',
|
|
49
|
-
components: { 'render-blocks': RenderBlocks },
|
|
50
|
-
props: ["space","columns","stackColumnsAt","reverseColumnsWhenStacked","builderBlock"],
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
computed: { columnsCssVars() {
|
|
63
|
-
const flexDir = this.stackColumnsAt === 'never' ? 'inherit' : this.reverseColumnsWhenStacked ? 'column-reverse' : 'column';
|
|
64
|
-
return {
|
|
65
|
-
'--flex-dir': flexDir,
|
|
66
|
-
'--flex-dir-tablet': this.maybeApplyForTablet(flexDir)
|
|
67
|
-
};
|
|
68
|
-
}, columnCssVars() {
|
|
69
|
-
const width = '100%';
|
|
70
|
-
const marginLeft = '0';
|
|
71
|
-
return {
|
|
72
|
-
'--column-width': width,
|
|
73
|
-
'--column-margin-left': marginLeft,
|
|
74
|
-
'--column-width-tablet': this.maybeApplyForTablet(width),
|
|
75
|
-
'--column-margin-left-tablet': this.maybeApplyForTablet(marginLeft)
|
|
76
|
-
};
|
|
77
|
-
},},
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
methods: { getGutterSize() {
|
|
81
|
-
return typeof this.space === 'number' ? this.space || 0 : 20;
|
|
82
|
-
}, getColumns() {
|
|
83
|
-
return this.columns || [];
|
|
84
|
-
}, getWidth(index) {
|
|
85
|
-
const columns = this.getColumns();
|
|
86
|
-
return columns[index]?.width || 100 / columns.length;
|
|
87
|
-
}, getColumnCssWidth(index) {
|
|
88
|
-
const columns = this.getColumns();
|
|
89
|
-
const gutterSize = this.getGutterSize();
|
|
90
|
-
const subtractWidth = gutterSize * (columns.length - 1) / columns.length;
|
|
91
|
-
return `calc(${this.getWidth(index)}% - ${subtractWidth}px)`;
|
|
92
|
-
}, maybeApplyForTablet(prop) {
|
|
93
|
-
const _stackColumnsAt = this.stackColumnsAt || 'tablet';
|
|
94
|
-
|
|
95
|
-
return _stackColumnsAt === 'tablet' ? prop : 'inherit';
|
|
96
|
-
},},
|
|
97
|
-
|
|
98
|
-
}
|
|
99
|
-
</script>
|
|
100
|
-
<style scoped>
|
|
101
|
-
.div-20351ewpue7 {
|
|
102
|
-
display: flex;
|
|
103
|
-
align-items: stretch;
|
|
104
|
-
line-height: normal;
|
|
105
|
-
}
|
|
106
|
-
@media (max-width: 991px) {
|
|
107
|
-
.div-20351ewpue7 {
|
|
108
|
-
flex-direction: var(--flex-dir-tablet);
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
@media (max-width: 639px) {
|
|
112
|
-
.div-20351ewpue7 {
|
|
113
|
-
flex-direction: var(--flex-dir);
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
.div-20351ewpue7-2 {
|
|
117
|
-
flex-grow: 1;
|
|
118
|
-
}
|
|
119
|
-
@media (max-width: 991px) {
|
|
120
|
-
.div-20351ewpue7-2 {
|
|
121
|
-
width: var(--column-width-tablet) !important;
|
|
122
|
-
margin-left: var(--column-margin-left-tablet) !important;
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
@media (max-width: 639px) {
|
|
126
|
-
.div-20351ewpue7-2 {
|
|
127
|
-
width: var(--column-width) !important;
|
|
128
|
-
margin-left: var(--column-margin-left) !important;
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
</style>
|
|
@@ -1,242 +0,0 @@
|
|
|
1
|
-
import { markSerializable } from "../util.js";
|
|
2
|
-
const componentInfo = {
|
|
3
|
-
name: "Columns",
|
|
4
|
-
builtIn: true,
|
|
5
|
-
inputs: [
|
|
6
|
-
{
|
|
7
|
-
name: "columns",
|
|
8
|
-
type: "array",
|
|
9
|
-
broadcast: true,
|
|
10
|
-
subFields: [
|
|
11
|
-
{
|
|
12
|
-
name: "blocks",
|
|
13
|
-
type: "array",
|
|
14
|
-
hideFromUI: true,
|
|
15
|
-
defaultValue: [
|
|
16
|
-
{
|
|
17
|
-
"@type": "@builder.io/sdk:Element",
|
|
18
|
-
responsiveStyles: {
|
|
19
|
-
large: {
|
|
20
|
-
display: "flex",
|
|
21
|
-
flexDirection: "column",
|
|
22
|
-
alignItems: "stretch",
|
|
23
|
-
flexShrink: "0",
|
|
24
|
-
position: "relative",
|
|
25
|
-
marginTop: "30px",
|
|
26
|
-
textAlign: "center",
|
|
27
|
-
lineHeight: "normal",
|
|
28
|
-
height: "auto",
|
|
29
|
-
minHeight: "20px",
|
|
30
|
-
minWidth: "20px",
|
|
31
|
-
overflow: "hidden"
|
|
32
|
-
}
|
|
33
|
-
},
|
|
34
|
-
component: {
|
|
35
|
-
name: "Image",
|
|
36
|
-
options: {
|
|
37
|
-
image: "https://builder.io/api/v1/image/assets%2Fpwgjf0RoYWbdnJSbpBAjXNRMe9F2%2Ffb27a7c790324294af8be1c35fe30f4d",
|
|
38
|
-
backgroundPosition: "center",
|
|
39
|
-
backgroundSize: "cover",
|
|
40
|
-
aspectRatio: 0.7004048582995948
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
"@type": "@builder.io/sdk:Element",
|
|
46
|
-
responsiveStyles: {
|
|
47
|
-
large: {
|
|
48
|
-
display: "flex",
|
|
49
|
-
flexDirection: "column",
|
|
50
|
-
alignItems: "stretch",
|
|
51
|
-
flexShrink: "0",
|
|
52
|
-
position: "relative",
|
|
53
|
-
marginTop: "30px",
|
|
54
|
-
textAlign: "center",
|
|
55
|
-
lineHeight: "normal",
|
|
56
|
-
height: "auto"
|
|
57
|
-
}
|
|
58
|
-
},
|
|
59
|
-
component: {
|
|
60
|
-
name: "Text",
|
|
61
|
-
options: {
|
|
62
|
-
text: "<p>Enter some text...</p>"
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
]
|
|
67
|
-
},
|
|
68
|
-
{
|
|
69
|
-
name: "width",
|
|
70
|
-
type: "number",
|
|
71
|
-
hideFromUI: true,
|
|
72
|
-
helperText: "Width %, e.g. set to 50 to fill half of the space"
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
name: "link",
|
|
76
|
-
type: "url",
|
|
77
|
-
helperText: "Optionally set a url that clicking this column will link to"
|
|
78
|
-
}
|
|
79
|
-
],
|
|
80
|
-
defaultValue: [
|
|
81
|
-
{
|
|
82
|
-
blocks: [
|
|
83
|
-
{
|
|
84
|
-
"@type": "@builder.io/sdk:Element",
|
|
85
|
-
responsiveStyles: {
|
|
86
|
-
large: {
|
|
87
|
-
display: "flex",
|
|
88
|
-
flexDirection: "column",
|
|
89
|
-
alignItems: "stretch",
|
|
90
|
-
flexShrink: "0",
|
|
91
|
-
position: "relative",
|
|
92
|
-
marginTop: "30px",
|
|
93
|
-
textAlign: "center",
|
|
94
|
-
lineHeight: "normal",
|
|
95
|
-
height: "auto",
|
|
96
|
-
minHeight: "20px",
|
|
97
|
-
minWidth: "20px",
|
|
98
|
-
overflow: "hidden"
|
|
99
|
-
}
|
|
100
|
-
},
|
|
101
|
-
component: {
|
|
102
|
-
name: "Image",
|
|
103
|
-
options: {
|
|
104
|
-
image: "https://builder.io/api/v1/image/assets%2Fpwgjf0RoYWbdnJSbpBAjXNRMe9F2%2Ffb27a7c790324294af8be1c35fe30f4d",
|
|
105
|
-
backgroundPosition: "center",
|
|
106
|
-
backgroundSize: "cover",
|
|
107
|
-
aspectRatio: 0.7004048582995948
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
},
|
|
111
|
-
{
|
|
112
|
-
"@type": "@builder.io/sdk:Element",
|
|
113
|
-
responsiveStyles: {
|
|
114
|
-
large: {
|
|
115
|
-
display: "flex",
|
|
116
|
-
flexDirection: "column",
|
|
117
|
-
alignItems: "stretch",
|
|
118
|
-
flexShrink: "0",
|
|
119
|
-
position: "relative",
|
|
120
|
-
marginTop: "30px",
|
|
121
|
-
textAlign: "center",
|
|
122
|
-
lineHeight: "normal",
|
|
123
|
-
height: "auto"
|
|
124
|
-
}
|
|
125
|
-
},
|
|
126
|
-
component: {
|
|
127
|
-
name: "Text",
|
|
128
|
-
options: {
|
|
129
|
-
text: "<p>Enter some text...</p>"
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
]
|
|
134
|
-
},
|
|
135
|
-
{
|
|
136
|
-
blocks: [
|
|
137
|
-
{
|
|
138
|
-
"@type": "@builder.io/sdk:Element",
|
|
139
|
-
responsiveStyles: {
|
|
140
|
-
large: {
|
|
141
|
-
display: "flex",
|
|
142
|
-
flexDirection: "column",
|
|
143
|
-
alignItems: "stretch",
|
|
144
|
-
flexShrink: "0",
|
|
145
|
-
position: "relative",
|
|
146
|
-
marginTop: "30px",
|
|
147
|
-
textAlign: "center",
|
|
148
|
-
lineHeight: "normal",
|
|
149
|
-
height: "auto",
|
|
150
|
-
minHeight: "20px",
|
|
151
|
-
minWidth: "20px",
|
|
152
|
-
overflow: "hidden"
|
|
153
|
-
}
|
|
154
|
-
},
|
|
155
|
-
component: {
|
|
156
|
-
name: "Image",
|
|
157
|
-
options: {
|
|
158
|
-
image: "https://builder.io/api/v1/image/assets%2Fpwgjf0RoYWbdnJSbpBAjXNRMe9F2%2Ffb27a7c790324294af8be1c35fe30f4d",
|
|
159
|
-
backgroundPosition: "center",
|
|
160
|
-
backgroundSize: "cover",
|
|
161
|
-
aspectRatio: 0.7004048582995948
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
},
|
|
165
|
-
{
|
|
166
|
-
"@type": "@builder.io/sdk:Element",
|
|
167
|
-
responsiveStyles: {
|
|
168
|
-
large: {
|
|
169
|
-
display: "flex",
|
|
170
|
-
flexDirection: "column",
|
|
171
|
-
alignItems: "stretch",
|
|
172
|
-
flexShrink: "0",
|
|
173
|
-
position: "relative",
|
|
174
|
-
marginTop: "30px",
|
|
175
|
-
textAlign: "center",
|
|
176
|
-
lineHeight: "normal",
|
|
177
|
-
height: "auto"
|
|
178
|
-
}
|
|
179
|
-
},
|
|
180
|
-
component: {
|
|
181
|
-
name: "Text",
|
|
182
|
-
options: {
|
|
183
|
-
text: "<p>Enter some text...</p>"
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
]
|
|
188
|
-
}
|
|
189
|
-
],
|
|
190
|
-
onChange: markSerializable((options) => {
|
|
191
|
-
function clearWidths() {
|
|
192
|
-
columns.forEach((col) => {
|
|
193
|
-
col.delete("width");
|
|
194
|
-
});
|
|
195
|
-
}
|
|
196
|
-
const columns = options.get("columns");
|
|
197
|
-
if (Array.isArray(columns)) {
|
|
198
|
-
const containsColumnWithWidth = !!columns.find((col) => col.get("width"));
|
|
199
|
-
if (containsColumnWithWidth) {
|
|
200
|
-
const containsColumnWithoutWidth = !!columns.find((col) => !col.get("width"));
|
|
201
|
-
if (containsColumnWithoutWidth) {
|
|
202
|
-
clearWidths();
|
|
203
|
-
} else {
|
|
204
|
-
const sumWidths = columns.reduce((memo, col) => {
|
|
205
|
-
return memo + col.get("width");
|
|
206
|
-
}, 0);
|
|
207
|
-
const widthsDontAddUp = sumWidths !== 100;
|
|
208
|
-
if (widthsDontAddUp) {
|
|
209
|
-
clearWidths();
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
})
|
|
215
|
-
},
|
|
216
|
-
{
|
|
217
|
-
name: "space",
|
|
218
|
-
type: "number",
|
|
219
|
-
defaultValue: 20,
|
|
220
|
-
helperText: "Size of gap between columns",
|
|
221
|
-
advanced: true
|
|
222
|
-
},
|
|
223
|
-
{
|
|
224
|
-
name: "stackColumnsAt",
|
|
225
|
-
type: "string",
|
|
226
|
-
defaultValue: "tablet",
|
|
227
|
-
helperText: "Convert horizontal columns to vertical at what device size",
|
|
228
|
-
enum: ["tablet", "mobile", "never"],
|
|
229
|
-
advanced: true
|
|
230
|
-
},
|
|
231
|
-
{
|
|
232
|
-
name: "reverseColumnsWhenStacked",
|
|
233
|
-
type: "boolean",
|
|
234
|
-
defaultValue: false,
|
|
235
|
-
helperText: "When stacking columns for mobile devices, reverse the ordering",
|
|
236
|
-
advanced: true
|
|
237
|
-
}
|
|
238
|
-
]
|
|
239
|
-
};
|
|
240
|
-
export {
|
|
241
|
-
componentInfo
|
|
242
|
-
};
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
const componentInfo = {
|
|
2
|
-
name: "Custom Code",
|
|
3
|
-
static: true,
|
|
4
|
-
builtIn: true,
|
|
5
|
-
requiredPermissions: ["editCode"],
|
|
6
|
-
inputs: [
|
|
7
|
-
{
|
|
8
|
-
name: "code",
|
|
9
|
-
type: "html",
|
|
10
|
-
required: true,
|
|
11
|
-
defaultValue: "<p>Hello there, I am custom HTML code!</p>",
|
|
12
|
-
code: true
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
name: "replaceNodes",
|
|
16
|
-
type: "boolean",
|
|
17
|
-
helperText: "Preserve server rendered dom nodes",
|
|
18
|
-
advanced: true
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
name: "scriptsClientOnly",
|
|
22
|
-
type: "boolean",
|
|
23
|
-
defaultValue: false,
|
|
24
|
-
helperText: "Only print and run scripts on the client. Important when scripts influence DOM that could be replaced when client loads",
|
|
25
|
-
advanced: true
|
|
26
|
-
}
|
|
27
|
-
]
|
|
28
|
-
};
|
|
29
|
-
export {
|
|
30
|
-
componentInfo
|
|
31
|
-
};
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div
|
|
3
|
-
ref="elem"
|
|
4
|
-
:class="
|
|
5
|
-
_classStringToObject(
|
|
6
|
-
'builder-custom-code' + (replaceNodes ? ' replace-nodes' : '')
|
|
7
|
-
)
|
|
8
|
-
"
|
|
9
|
-
v-html="code"
|
|
10
|
-
></div>
|
|
11
|
-
</template>
|
|
12
|
-
<script lang="ts">
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
export interface CustomCodeProps {
|
|
21
|
-
code: string;
|
|
22
|
-
replaceNodes?: boolean;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export default {
|
|
26
|
-
name: 'builder-custom-code',
|
|
27
|
-
|
|
28
|
-
props: ["replaceNodes","code"],
|
|
29
|
-
|
|
30
|
-
data: () => ({ scriptsInserted: [], scriptsRun: [],}),
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
mounted() {
|
|
37
|
-
this.findAndRunScripts()
|
|
38
|
-
},
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
methods: { findAndRunScripts() {
|
|
46
|
-
// TODO: Move this function to standalone one in '@builder.io/utils'
|
|
47
|
-
if (this.$refs.elem && typeof window !== 'undefined') {
|
|
48
|
-
const scripts = this.$refs.elem.getElementsByTagName('script');
|
|
49
|
-
|
|
50
|
-
for (let i = 0; i < scripts.length; i++) {
|
|
51
|
-
const script = scripts[i];
|
|
52
|
-
|
|
53
|
-
if (script.src) {
|
|
54
|
-
if (this.scriptsInserted.includes(script.src)) {
|
|
55
|
-
continue;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
this.scriptsInserted.push(script.src);
|
|
59
|
-
const newScript = document.createElement('script');
|
|
60
|
-
newScript.async = true;
|
|
61
|
-
newScript.src = script.src;
|
|
62
|
-
document.head.appendChild(newScript);
|
|
63
|
-
} else if (!script.type || ['text/javascript', 'application/javascript', 'application/ecmascript'].includes(script.type)) {
|
|
64
|
-
if (this.scriptsRun.includes(script.innerText)) {
|
|
65
|
-
continue;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
try {
|
|
69
|
-
this.scriptsRun.push(script.innerText);
|
|
70
|
-
new Function(script.innerText)();
|
|
71
|
-
} catch (error) {
|
|
72
|
-
console.warn('`CustomCode`: Error running script:', error);
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
},_classStringToObject(str) {
|
|
78
|
-
const obj = {};
|
|
79
|
-
if (typeof str !== 'string') { return obj }
|
|
80
|
-
const classNames = str.trim().split(/\s+/);
|
|
81
|
-
for (const name of classNames) {
|
|
82
|
-
obj[name] = true;
|
|
83
|
-
}
|
|
84
|
-
return obj;
|
|
85
|
-
} },
|
|
86
|
-
|
|
87
|
-
}
|
|
88
|
-
</script>
|