@builder.io/sdk-vue 0.0.1-7 → 0.0.1-70
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 +53 -0
- package/README.md +44 -0
- package/nuxt.js +24 -0
- package/package.json +30 -4
- package/vue2/src/blocks/button/button.vue +52 -0
- package/vue2/src/blocks/button/component-info.js +41 -0
- package/vue2/src/blocks/columns/columns.vue +130 -0
- package/vue2/src/blocks/columns/component-info.js +242 -0
- package/vue2/src/blocks/custom-code/component-info.js +31 -0
- package/{src/blocks/custom-code.original.vue → vue2/src/blocks/custom-code/custom-code.vue} +39 -23
- package/vue2/src/blocks/embed/component-info.js +44 -0
- package/vue2/src/blocks/embed/embed.vue +73 -0
- package/vue2/src/blocks/embed/helpers.js +9 -0
- package/vue2/src/blocks/form/component-info.js +262 -0
- package/vue2/src/blocks/form/form.vue +343 -0
- package/vue2/src/blocks/fragment/component-info.js +11 -0
- package/vue2/src/blocks/fragment/fragment.vue +35 -0
- package/vue2/src/blocks/image/component-info.js +151 -0
- package/vue2/src/blocks/image/image.helpers.js +48 -0
- package/vue2/src/blocks/image/image.vue +155 -0
- package/vue2/src/blocks/img/component-info.js +20 -0
- package/vue2/src/blocks/img/img.vue +50 -0
- package/vue2/src/blocks/input/component-info.js +74 -0
- package/vue2/src/blocks/input/input.vue +50 -0
- package/vue2/src/blocks/raw-text/component-info.js +16 -0
- package/vue2/src/blocks/raw-text/raw-text.vue +48 -0
- package/vue2/src/blocks/section/component-info.js +49 -0
- package/vue2/src/blocks/section/section.vue +47 -0
- package/vue2/src/blocks/select/component-info.js +59 -0
- package/vue2/src/blocks/select/select.vue +56 -0
- package/vue2/src/blocks/submit-button/component-info.js +28 -0
- package/vue2/src/blocks/submit-button/submit-button.vue +36 -0
- package/vue2/src/blocks/symbol/component-info.js +43 -0
- package/vue2/src/blocks/symbol/symbol.vue +118 -0
- package/vue2/src/blocks/text/component-info.js +24 -0
- package/vue2/src/blocks/text/text.vue +33 -0
- package/vue2/src/blocks/textarea/component-info.js +47 -0
- package/vue2/src/blocks/textarea/textarea.vue +43 -0
- package/vue2/src/blocks/util.js +7 -0
- package/vue2/src/blocks/video/component-info.js +106 -0
- package/vue2/src/blocks/video/video.vue +79 -0
- package/vue2/src/components/render-block/block-styles.vue +66 -0
- package/vue2/src/components/render-block/render-block.helpers.js +23 -0
- package/vue2/src/components/render-block/render-block.vue +212 -0
- package/vue2/src/components/render-block/render-component.vue +50 -0
- package/vue2/src/components/render-block/render-repeated-block.vue +59 -0
- package/{src/blocks/button_styles.js → vue2/src/components/render-block/types.js} +0 -0
- package/vue2/src/components/render-blocks.vue +106 -0
- package/vue2/src/components/render-content/components/render-styles.vue +104 -0
- package/vue2/src/components/render-content/index.js +4 -0
- package/vue2/src/components/render-content/render-content.vue +301 -0
- package/vue2/src/components/render-inlined-styles.vue +44 -0
- package/vue2/src/constants/builder-registered-components.js +51 -0
- package/vue2/src/constants/device-sizes.js +21 -0
- package/vue2/src/constants/target.js +4 -0
- package/vue2/src/context/builder.context.js +4 -0
- package/vue2/src/functions/camel-to-kebab-case.js +4 -0
- package/vue2/src/functions/convert-style-object.js +6 -0
- package/vue2/src/functions/evaluate.js +28 -0
- package/vue2/src/functions/event-handler-name.js +4 -0
- package/vue2/src/functions/get-block-actions.js +23 -0
- package/vue2/src/functions/get-block-component-options.js +28 -0
- package/{src → vue2/src}/functions/get-block-properties.js +3 -9
- package/vue2/src/functions/get-block-styles.js +6 -0
- package/vue2/src/functions/get-block-tag.js +6 -0
- package/vue2/src/functions/get-builder-search-params/fn.test.js +13 -0
- package/vue2/src/functions/get-builder-search-params/index.js +33 -0
- package/vue2/src/functions/get-content/ab-testing.js +38 -0
- package/vue2/src/functions/get-content/fn.test.js +31 -0
- package/vue2/src/functions/get-content/index.js +96 -0
- package/{src/blocks/custom-code_styles.js → vue2/src/functions/get-content/types.js} +0 -0
- package/vue2/src/functions/get-fetch.js +34 -0
- package/vue2/src/functions/get-global-this.js +18 -0
- package/vue2/src/functions/get-processed-block.js +57 -0
- package/vue2/src/functions/get-processed-block.test.js +32 -0
- package/vue2/src/functions/if-target.js +15 -0
- package/vue2/src/functions/is-browser.js +6 -0
- package/vue2/src/functions/is-editing.js +7 -0
- package/vue2/src/functions/is-iframe.js +7 -0
- package/vue2/src/functions/is-previewing.js +14 -0
- package/{src → vue2/src}/functions/on-change.js +4 -11
- package/vue2/src/functions/on-change.test.js +19 -0
- package/vue2/src/functions/register-component.js +72 -0
- package/vue2/src/functions/register.js +29 -0
- package/vue2/src/functions/sanitize-styles.js +5 -0
- package/vue2/src/functions/set-editor-settings.js +15 -0
- package/{src → vue2/src}/functions/set.js +3 -10
- package/vue2/src/functions/set.test.js +16 -0
- package/vue2/src/functions/track.js +91 -0
- package/vue2/src/functions/transform-block.js +6 -0
- package/vue2/src/helpers/cookie.js +59 -0
- package/vue2/src/helpers/css.js +12 -0
- package/vue2/src/helpers/flatten.js +34 -0
- package/vue2/src/helpers/localStorage.js +34 -0
- package/vue2/src/helpers/nullable.js +4 -0
- package/vue2/src/helpers/sessionId.js +26 -0
- package/vue2/src/helpers/time.js +5 -0
- package/vue2/src/helpers/url.js +10 -0
- package/vue2/src/helpers/url.test.js +15 -0
- package/vue2/src/helpers/uuid.js +13 -0
- package/vue2/src/helpers/visitorId.js +33 -0
- package/vue2/src/index-helpers/blocks-exports.js +22 -0
- package/vue2/src/index-helpers/top-of-file.js +4 -0
- package/vue2/src/index.js +10 -0
- package/vue2/src/scripts/init-editing.js +79 -0
- package/{src/blocks/embed_styles.js → vue2/src/types/builder-block.js} +0 -0
- package/{src/blocks/fragment_styles.js → vue2/src/types/builder-content.js} +0 -0
- package/{src/blocks/img_styles.js → vue2/src/types/can-track.js} +0 -0
- package/{src/blocks/input_styles.js → vue2/src/types/components.js} +0 -0
- package/{src/blocks/raw-text_styles.js → vue2/src/types/deep-partial.js} +0 -0
- package/{src/blocks/section_styles.js → vue2/src/types/element.js} +0 -0
- package/{src/blocks/select_styles.js → vue2/src/types/targets.js} +0 -0
- package/{src/blocks/submit-button_styles.js → vue2/src/types/typescript.js} +0 -0
- package/vue3/src/blocks/button/button.vue +56 -0
- package/vue3/src/blocks/button/component-info.js +41 -0
- package/vue3/src/blocks/columns/columns.vue +130 -0
- package/vue3/src/blocks/columns/component-info.js +242 -0
- package/vue3/src/blocks/custom-code/component-info.js +31 -0
- package/{src/blocks/embed.original.vue → vue3/src/blocks/custom-code/custom-code.vue} +47 -23
- package/vue3/src/blocks/embed/component-info.js +44 -0
- package/vue3/src/blocks/embed/embed.vue +73 -0
- package/vue3/src/blocks/embed/helpers.js +9 -0
- package/vue3/src/blocks/form/component-info.js +262 -0
- package/vue3/src/blocks/form/form.vue +343 -0
- package/vue3/src/blocks/fragment/component-info.js +11 -0
- package/vue3/src/blocks/fragment/fragment.vue +35 -0
- package/vue3/src/blocks/image/component-info.js +151 -0
- package/vue3/src/blocks/image/image.helpers.js +48 -0
- package/vue3/src/blocks/image/image.vue +164 -0
- package/vue3/src/blocks/img/component-info.js +20 -0
- package/vue3/src/blocks/img/img.vue +50 -0
- package/vue3/src/blocks/input/component-info.js +74 -0
- package/vue3/src/blocks/input/input.vue +50 -0
- package/vue3/src/blocks/raw-text/component-info.js +16 -0
- package/vue3/src/blocks/raw-text/raw-text.vue +48 -0
- package/vue3/src/blocks/section/component-info.js +49 -0
- package/vue3/src/blocks/section/section.vue +47 -0
- package/vue3/src/blocks/select/component-info.js +59 -0
- package/vue3/src/blocks/select/select.vue +52 -0
- package/vue3/src/blocks/submit-button/component-info.js +28 -0
- package/vue3/src/blocks/submit-button/submit-button.vue +36 -0
- package/vue3/src/blocks/symbol/component-info.js +43 -0
- package/vue3/src/blocks/symbol/symbol.vue +118 -0
- package/vue3/src/blocks/text/component-info.js +24 -0
- package/vue3/src/blocks/text/text.vue +33 -0
- package/vue3/src/blocks/textarea/component-info.js +47 -0
- package/vue3/src/blocks/textarea/textarea.vue +43 -0
- package/vue3/src/blocks/util.js +7 -0
- package/vue3/src/blocks/video/component-info.js +106 -0
- package/vue3/src/blocks/video/video.vue +79 -0
- package/vue3/src/components/render-block/block-styles.vue +67 -0
- package/vue3/src/components/render-block/render-block.helpers.js +23 -0
- package/vue3/src/components/render-block/render-block.vue +215 -0
- package/vue3/src/components/render-block/render-component.vue +52 -0
- package/vue3/src/components/render-block/render-repeated-block.vue +59 -0
- package/{src/blocks/symbol_styles.js → vue3/src/components/render-block/types.js} +0 -0
- package/vue3/src/components/render-blocks.vue +108 -0
- package/vue3/src/components/render-content/components/render-styles.vue +104 -0
- package/vue3/src/components/render-content/index.js +4 -0
- package/vue3/src/components/render-content/render-content.vue +303 -0
- package/vue3/src/components/render-inlined-styles.vue +49 -0
- package/vue3/src/constants/builder-registered-components.js +51 -0
- package/vue3/src/constants/device-sizes.js +21 -0
- package/vue3/src/constants/target.js +4 -0
- package/vue3/src/context/builder.context.js +4 -0
- package/vue3/src/functions/camel-to-kebab-case.js +4 -0
- package/vue3/src/functions/convert-style-object.js +6 -0
- package/vue3/src/functions/evaluate.js +28 -0
- package/vue3/src/functions/event-handler-name.js +4 -0
- package/vue3/src/functions/get-block-actions.js +23 -0
- package/vue3/src/functions/get-block-component-options.js +28 -0
- package/vue3/src/functions/get-block-properties.js +40 -0
- package/vue3/src/functions/get-block-styles.js +6 -0
- package/vue3/src/functions/get-block-tag.js +6 -0
- package/vue3/src/functions/get-builder-search-params/fn.test.js +13 -0
- package/vue3/src/functions/get-builder-search-params/index.js +33 -0
- package/vue3/src/functions/get-content/ab-testing.js +38 -0
- package/vue3/src/functions/get-content/fn.test.js +31 -0
- package/vue3/src/functions/get-content/index.js +96 -0
- package/{src/blocks/text_styles.js → vue3/src/functions/get-content/types.js} +0 -0
- package/vue3/src/functions/get-fetch.js +34 -0
- package/vue3/src/functions/get-global-this.js +18 -0
- package/vue3/src/functions/get-processed-block.js +57 -0
- package/vue3/src/functions/get-processed-block.test.js +32 -0
- package/vue3/src/functions/if-target.js +15 -0
- package/vue3/src/functions/is-browser.js +6 -0
- package/vue3/src/functions/is-editing.js +7 -0
- package/vue3/src/functions/is-iframe.js +7 -0
- package/vue3/src/functions/is-previewing.js +14 -0
- package/vue3/src/functions/on-change.js +27 -0
- package/vue3/src/functions/on-change.test.js +19 -0
- package/vue3/src/functions/register-component.js +72 -0
- package/vue3/src/functions/register.js +29 -0
- package/vue3/src/functions/sanitize-styles.js +5 -0
- package/vue3/src/functions/set-editor-settings.js +15 -0
- package/vue3/src/functions/set.js +11 -0
- package/vue3/src/functions/set.test.js +16 -0
- package/vue3/src/functions/track.js +91 -0
- package/vue3/src/functions/transform-block.js +6 -0
- package/vue3/src/helpers/cookie.js +59 -0
- package/vue3/src/helpers/css.js +12 -0
- package/vue3/src/helpers/flatten.js +34 -0
- package/vue3/src/helpers/localStorage.js +34 -0
- package/vue3/src/helpers/nullable.js +4 -0
- package/vue3/src/helpers/sessionId.js +26 -0
- package/vue3/src/helpers/time.js +5 -0
- package/vue3/src/helpers/url.js +10 -0
- package/vue3/src/helpers/url.test.js +15 -0
- package/vue3/src/helpers/uuid.js +13 -0
- package/vue3/src/helpers/visitorId.js +33 -0
- package/vue3/src/index-helpers/blocks-exports.js +22 -0
- package/vue3/src/index-helpers/top-of-file.js +4 -0
- package/vue3/src/index.js +10 -0
- package/vue3/src/scripts/init-editing.js +79 -0
- package/{src/blocks/textarea_styles.js → vue3/src/types/builder-block.js} +0 -0
- package/{src/blocks/video_styles.js → vue3/src/types/builder-content.js} +0 -0
- package/{src/components/block-styles_styles.js → vue3/src/types/can-track.js} +0 -0
- package/{src/components/error-boundary_styles.js → vue3/src/types/components.js} +0 -0
- package/{src/components/render-block_styles.js → vue3/src/types/deep-partial.js} +0 -0
- package/{src/components/render-content_styles.js → vue3/src/types/element.js} +0 -0
- package/vue3/src/types/targets.js +0 -0
- package/vue3/src/types/typescript.js +0 -0
- package/src/blocks/button.js +0 -31
- package/src/blocks/button.original.vue +0 -48
- package/src/blocks/button_script.js +0 -21
- package/src/blocks/columns.js +0 -31
- package/src/blocks/columns.original.vue +0 -59
- package/src/blocks/columns_script.js +0 -58
- package/src/blocks/columns_styles.js +0 -14
- package/src/blocks/custom-code.js +0 -31
- package/src/blocks/custom-code_script.js +0 -63
- package/src/blocks/embed.js +0 -31
- package/src/blocks/embed_script.js +0 -53
- package/src/blocks/form.js +0 -31
- package/src/blocks/form.original.vue +0 -289
- package/src/blocks/form_script.js +0 -231
- package/src/blocks/form_styles.js +0 -12
- package/src/blocks/fragment.js +0 -31
- package/src/blocks/fragment.original.vue +0 -28
- package/src/blocks/fragment_script.js +0 -40
- package/src/blocks/image.js +0 -31
- package/src/blocks/image.original.vue +0 -52
- package/src/blocks/image_script.js +0 -32
- package/src/blocks/image_styles.js +0 -13
- package/src/blocks/img.js +0 -31
- package/src/blocks/img.original.vue +0 -31
- package/src/blocks/img_script.js +0 -42
- package/src/blocks/input.js +0 -31
- package/src/blocks/input.original.vue +0 -28
- package/src/blocks/input_script.js +0 -39
- package/src/blocks/raw-text.js +0 -31
- package/src/blocks/raw-text.original.vue +0 -35
- package/src/blocks/raw-text_script.js +0 -32
- package/src/blocks/section.js +0 -31
- package/src/blocks/section.original.vue +0 -29
- package/src/blocks/section_script.js +0 -23
- package/src/blocks/select.js +0 -31
- package/src/blocks/select.original.vue +0 -32
- package/src/blocks/select_script.js +0 -41
- package/src/blocks/submit-button.js +0 -31
- package/src/blocks/submit-button.original.vue +0 -27
- package/src/blocks/submit-button_script.js +0 -21
- package/src/blocks/symbol.js +0 -29
- package/src/blocks/symbol.original.vue +0 -33
- package/src/blocks/symbol_script.js +0 -44
- package/src/blocks/text.js +0 -31
- package/src/blocks/text.original.vue +0 -25
- package/src/blocks/text_script.js +0 -21
- package/src/blocks/textarea.js +0 -31
- package/src/blocks/textarea.original.vue +0 -25
- package/src/blocks/textarea_script.js +0 -21
- package/src/blocks/video.js +0 -31
- package/src/blocks/video.original.vue +0 -34
- package/src/blocks/video_script.js +0 -28
- package/src/components/block-styles.js +0 -29
- package/src/components/block-styles.original.vue +0 -25
- package/src/components/block-styles.vue +0 -34
- package/src/components/block-styles_script.js +0 -20
- package/src/components/error-boundary.js +0 -29
- package/src/components/error-boundary.original.vue +0 -25
- package/src/components/error-boundary.vue +0 -15
- package/src/components/error-boundary_script.js +0 -20
- package/src/components/render-block.js +0 -29
- package/src/components/render-block.original.vue +0 -116
- package/src/components/render-block_script.js +0 -91
- package/src/components/render-blocks.js +0 -29
- package/src/components/render-blocks.original.vue +0 -75
- package/src/components/render-blocks_script.js +0 -76
- package/src/components/render-blocks_styles.js +0 -12
- package/src/components/render-content.js +0 -29
- package/src/components/render-content.original.vue +0 -95
- package/src/components/render-content_script.js +0 -92
- package/src/constants/device-sizes.js +0 -46
- package/src/context/builder.context.js +0 -11
- package/src/functions/evaluate.js +0 -42
- package/src/functions/get-block-actions.js +0 -45
- package/src/functions/get-block-component-options.js +0 -14
- package/src/functions/get-block-styles.js +0 -13
- package/src/functions/get-block-tag.js +0 -13
- package/src/functions/get-content.js +0 -123
- package/src/functions/get-processed-block.js +0 -65
- package/src/functions/get-processed-block.test.js +0 -44
- package/src/functions/get-target.js +0 -13
- package/src/functions/if-target.js +0 -13
- package/src/functions/is-browser.js +0 -30
- package/src/functions/is-editing.js +0 -30
- package/src/functions/is-iframe.js +0 -30
- package/src/functions/is-react-native.js +0 -13
- package/src/functions/macro-eval.js +0 -12
- package/src/functions/on-change.test.js +0 -38
- package/src/functions/register-component.js +0 -73
- package/src/functions/register.js +0 -52
- package/src/functions/set-editor-settings.js +0 -38
- package/src/functions/set.test.js +0 -35
- package/src/functions/track.js +0 -41
- package/src/index.js +0 -51
- package/src/scripts/init-editing.js +0 -78
- 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/CHANGELOG.md
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
### 0.0.1-56
|
|
2
|
+
|
|
3
|
+
- Feature: We now provide initial support for Vue 3.
|
|
4
|
+
|
|
5
|
+
🧨 Breaking change: you must now explicitly import the Vue SDK version that you want (for Vue 2 or Vue 3) e.g.
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
// imports Vue 2 SDK
|
|
9
|
+
import * as BuilderSDK from '@builder.io/sdk-vue/vue2';
|
|
10
|
+
// fallback to Vue 2 SDK
|
|
11
|
+
import * as BuilderSDK from '@builder.io/sdk-vue';
|
|
12
|
+
|
|
13
|
+
// imports Vue 3 SDK
|
|
14
|
+
import * as BuilderSDK from '@builder.io/sdk-vue/vue3';
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
### 0.0.1-54
|
|
18
|
+
|
|
19
|
+
🐛 Fix: custom components were not rendering correctly
|
|
20
|
+
🐛 Fix: Image component's `srcSet` was not being set correctly
|
|
21
|
+
|
|
22
|
+
### 0.0.1-52
|
|
23
|
+
|
|
24
|
+
🧨 Breaking change: the format of the `customComponents` prop has changed from `[{ component, info }]` to `[{ component, ...info }]`.
|
|
25
|
+
See [builder-registered-components.ts](/packages/sdks/src/constants/builder-registered-components.ts) for examples of how to do so, or see the example provided for this SDK.
|
|
26
|
+
|
|
27
|
+
### 0.0.1-51
|
|
28
|
+
|
|
29
|
+
⚠️ Deprecation notice: Registering components via `registerComponent(component, info)` is now deprecated.
|
|
30
|
+
To register your custom components in Builder, you must now provide a `customComponents` array to the `RenderContent` component containing `[{ component, info }]`.
|
|
31
|
+
See [builder-registered-components.ts](/packages/sdks/src/constants/builder-registered-components.ts) for examples of how to do so, or see the example provided for this SDK.
|
|
32
|
+
|
|
33
|
+
### 0.0.1-50
|
|
34
|
+
|
|
35
|
+
- feat: 🎸 export `isPreviewing()` (https://github.com/BuilderIO/builder/pull/951)
|
|
36
|
+
- feat: 🎸 Add support for Symbols (https://github.com/BuilderIO/builder/pull/951)
|
|
37
|
+
- feat: 🎸 Add support for Data Bindings https://github.com/BuilderIO/builder/pull/970
|
|
38
|
+
|
|
39
|
+
- BREAKING CHANGE: 🧨 RenderContent must now be provided the `apiKey` as a prop (https://github.com/BuilderIO/builder/pull/951)
|
|
40
|
+
|
|
41
|
+
### 0.0.1-49
|
|
42
|
+
|
|
43
|
+
- Fix: show the "+ add block" button on empty pages https://github.com/BuilderIO/builder/pull/934
|
|
44
|
+
- Add `getBuilderSearchParams` helper export to easily view current drafts on your production site. https://github.com/BuilderIO/builder/pull/883
|
|
45
|
+
|
|
46
|
+
### 0.0.1-48
|
|
47
|
+
|
|
48
|
+
Changes:
|
|
49
|
+
|
|
50
|
+
- Adds support for Columns https://github.com/BuilderIO/builder/pull/717
|
|
51
|
+
- Add preliminary support for Children within custom components https://github.com/BuilderIO/builder/pull/753
|
|
52
|
+
- Seeds classnames to reduce variation in changes https://github.com/BuilderIO/builder/pull/703
|
|
53
|
+
- Fixes `getAllContent` to traverse all symbols/references https://github.com/BuilderIO/builder/pull/718
|
package/README.md
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# Builder.io Vue 2.0 SDK (BETA)
|
|
2
|
+
|
|
3
|
+
This is the 2.0 Vue SDK. It is currently in beta.
|
|
4
|
+
|
|
5
|
+
NOTE: If you are looking for the stable 1.0 Vue SDK, you can find it [here](/packages/vue)
|
|
6
|
+
|
|
7
|
+
## Mitosis
|
|
8
|
+
|
|
9
|
+
This SDK is generated by [Mitosis](https://github.com/BuilderIO/mitosis). To see the Mitosis source-code, go [here](../../).
|
|
10
|
+
|
|
11
|
+
## Feature Support
|
|
12
|
+
|
|
13
|
+
To check the status of the SDK, look at [these tables](../../README.md#feature-implementation).
|
|
14
|
+
|
|
15
|
+
## Version Support
|
|
16
|
+
|
|
17
|
+
Legend:
|
|
18
|
+
|
|
19
|
+
- ✅: implemented
|
|
20
|
+
- 🏗: currently in progress
|
|
21
|
+
- ⚠️: not-yet implemented
|
|
22
|
+
- N/A : does not apply
|
|
23
|
+
|
|
24
|
+
| Platform | Support |
|
|
25
|
+
| -------- | ------- |
|
|
26
|
+
| Vue 2 | 🏗 |
|
|
27
|
+
| Nuxt 2 | 🏗 |
|
|
28
|
+
| Vue 3 | 🏗 |
|
|
29
|
+
| Nuxt 3 | ✅ |
|
|
30
|
+
|
|
31
|
+
## Getting Started
|
|
32
|
+
|
|
33
|
+
```
|
|
34
|
+
npm install @builder.io/sdk-vue@dev
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Usage
|
|
38
|
+
|
|
39
|
+
You can see examples of using Builder.io:
|
|
40
|
+
|
|
41
|
+
- with Vue 2 [here](/examples/vue/vue-2/)
|
|
42
|
+
- with Nuxt 2 [here](/examples/vue/nuxt-2/)
|
|
43
|
+
- with Vue Storefront 2 [here](/examples/vue/vue-storefront-2)
|
|
44
|
+
- with Vue 3 [here](/examples/vue/vue-3/)
|
package/nuxt.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { join } from 'path';
|
|
2
|
+
|
|
3
|
+
export default function () {
|
|
4
|
+
// Make sure components is enabled
|
|
5
|
+
if (!this.nuxt.options.components) {
|
|
6
|
+
throw new Error(
|
|
7
|
+
'Please set `components: true` inside `nuxt.config` and ensure using `nuxt >= 2.13.0`'
|
|
8
|
+
);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
this.nuxt.hook('components:dirs', (dirs) => {
|
|
12
|
+
// Add ./components dir to the list
|
|
13
|
+
dirs.push({
|
|
14
|
+
path: join(__dirname, 'vue2/src/components'),
|
|
15
|
+
prefix: 'builder',
|
|
16
|
+
});
|
|
17
|
+
// Add ./blocks dir to the list
|
|
18
|
+
dirs.push({
|
|
19
|
+
path: join(__dirname, 'vue2/src/blocks'),
|
|
20
|
+
prefix: 'builder',
|
|
21
|
+
pattern: '**/index.*',
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
}
|
package/package.json
CHANGED
|
@@ -1,9 +1,35 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@builder.io/sdk-vue",
|
|
3
3
|
"description": "Builder.io SDK for Vue",
|
|
4
|
-
"version": "0.0.1-
|
|
5
|
-
"dependencies": {
|
|
6
|
-
|
|
4
|
+
"version": "0.0.1-70",
|
|
5
|
+
"dependencies": {
|
|
6
|
+
"node-fetch": "^2.6.1"
|
|
7
|
+
},
|
|
8
|
+
"main": "./vue2/src/index.js",
|
|
9
|
+
"module": "./vue2/src/index.js",
|
|
10
|
+
"type": "module",
|
|
11
|
+
"exports": {
|
|
12
|
+
".": {
|
|
13
|
+
"import": "./vue2/src/index.js",
|
|
14
|
+
"require": "./vue2/src/index.js"
|
|
15
|
+
},
|
|
16
|
+
"./vue2": {
|
|
17
|
+
"import": "./vue2/src/index.js",
|
|
18
|
+
"require": "./vue2/src/index.js"
|
|
19
|
+
},
|
|
20
|
+
"./vue3": {
|
|
21
|
+
"import": "./vue3/src/index.js",
|
|
22
|
+
"require": "./vue3/src/index.js"
|
|
23
|
+
},
|
|
24
|
+
"./nuxt": {
|
|
25
|
+
"import": "./nuxt.js",
|
|
26
|
+
"require": "./nuxt.js"
|
|
27
|
+
},
|
|
28
|
+
"./nuxt2": {
|
|
29
|
+
"import": "./nuxt.js",
|
|
30
|
+
"require": "./nuxt.js"
|
|
31
|
+
}
|
|
32
|
+
},
|
|
7
33
|
"scripts": {
|
|
8
34
|
"release:dev": "npm version prerelease --no-git-tag-version && npm publish --tag dev --access public"
|
|
9
35
|
},
|
|
@@ -11,6 +37,6 @@
|
|
|
11
37
|
"vue": ">= 2"
|
|
12
38
|
},
|
|
13
39
|
"devDependencies": {
|
|
14
|
-
"vue": "^2.
|
|
40
|
+
"vue": "^2.7"
|
|
15
41
|
}
|
|
16
42
|
}
|
|
@@ -0,0 +1,52 @@
|
|
|
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-16nol0lwi20" 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-16nol0lwi20 {
|
|
50
|
+
all: unset;
|
|
51
|
+
}
|
|
52
|
+
</style>
|
|
@@ -0,0 +1,41 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="builder-columns div-2fnk003dqad" :style="columnsCssVars">
|
|
3
|
+
<div
|
|
4
|
+
class="builder-column div-2fnk003dqad-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
|
+
type Column = {
|
|
30
|
+
blocks: any; // TODO: Implement this when support for dynamic CSS lands
|
|
31
|
+
|
|
32
|
+
width?: number;
|
|
33
|
+
};
|
|
34
|
+
type StackColumnsAt = 'tablet' | 'mobile' | 'never';
|
|
35
|
+
export interface ColumnProps {
|
|
36
|
+
columns?: Column[];
|
|
37
|
+
builderBlock: BuilderBlock; // TODO: Implement this when support for dynamic CSS lands
|
|
38
|
+
|
|
39
|
+
space?: number; // TODO: Implement this when support for dynamic CSS lands
|
|
40
|
+
|
|
41
|
+
stackColumnsAt?: StackColumnsAt; // TODO: Implement this when support for dynamic CSS lands
|
|
42
|
+
|
|
43
|
+
reverseColumnsWhenStacked?: boolean;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export default {
|
|
47
|
+
name: 'builder-columns',
|
|
48
|
+
components: { 'render-blocks': RenderBlocks },
|
|
49
|
+
props: ["space","columns","stackColumnsAt","reverseColumnsWhenStacked","builderBlock"],
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
computed: { columnsCssVars() {
|
|
62
|
+
const flexDir = this.stackColumnsAt === 'never' ? 'inherit' : this.reverseColumnsWhenStacked ? 'column-reverse' : 'column';
|
|
63
|
+
return {
|
|
64
|
+
'--flex-dir': flexDir,
|
|
65
|
+
'--flex-dir-tablet': this.maybeApplyForTablet(flexDir)
|
|
66
|
+
};
|
|
67
|
+
}, columnCssVars() {
|
|
68
|
+
const width = '100%';
|
|
69
|
+
const marginLeft = '0';
|
|
70
|
+
return {
|
|
71
|
+
'--column-width': width,
|
|
72
|
+
'--column-margin-left': marginLeft,
|
|
73
|
+
'--column-width-tablet': this.maybeApplyForTablet(width),
|
|
74
|
+
'--column-margin-left-tablet': this.maybeApplyForTablet(marginLeft)
|
|
75
|
+
};
|
|
76
|
+
},},
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
methods: { getGutterSize() {
|
|
80
|
+
return typeof this.space === 'number' ? this.space || 0 : 20;
|
|
81
|
+
}, getColumns() {
|
|
82
|
+
return this.columns || [];
|
|
83
|
+
}, getWidth(index) {
|
|
84
|
+
const columns = this.getColumns();
|
|
85
|
+
return columns[index]?.width || 100 / columns.length;
|
|
86
|
+
}, getColumnCssWidth(index) {
|
|
87
|
+
const columns = this.getColumns();
|
|
88
|
+
const gutterSize = this.getGutterSize();
|
|
89
|
+
const subtractWidth = gutterSize * (columns.length - 1) / columns.length;
|
|
90
|
+
return `calc(${this.getWidth(index)}% - ${subtractWidth}px)`;
|
|
91
|
+
}, maybeApplyForTablet(prop) {
|
|
92
|
+
const _stackColumnsAt = this.stackColumnsAt || 'tablet';
|
|
93
|
+
|
|
94
|
+
return _stackColumnsAt === 'tablet' ? prop : 'inherit';
|
|
95
|
+
},},
|
|
96
|
+
|
|
97
|
+
}
|
|
98
|
+
</script>
|
|
99
|
+
<style scoped>
|
|
100
|
+
.div-2fnk003dqad {
|
|
101
|
+
display: flex;
|
|
102
|
+
align-items: stretch;
|
|
103
|
+
line-height: normal;
|
|
104
|
+
}
|
|
105
|
+
@media (max-width: 991px) {
|
|
106
|
+
.div-2fnk003dqad {
|
|
107
|
+
flex-direction: var(--flex-dir-tablet);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
@media (max-width: 639px) {
|
|
111
|
+
.div-2fnk003dqad {
|
|
112
|
+
flex-direction: var(--flex-dir);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
.div-2fnk003dqad-2 {
|
|
116
|
+
flex-grow: 1;
|
|
117
|
+
}
|
|
118
|
+
@media (max-width: 991px) {
|
|
119
|
+
.div-2fnk003dqad-2 {
|
|
120
|
+
width: var(--column-width-tablet) !important;
|
|
121
|
+
margin-left: var(--column-margin-left-tablet) !important;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
@media (max-width: 639px) {
|
|
125
|
+
.div-2fnk003dqad-2 {
|
|
126
|
+
width: var(--column-width) !important;
|
|
127
|
+
margin-left: var(--column-margin-left) !important;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
</style>
|
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
import { markSerializable } from "../util";
|
|
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
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
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
|
+
};
|