@builder.io/sdk-svelte 0.0.1-8 → 0.0.1
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/README.md +4 -0
- package/package/CHANGELOG.md +19 -0
- package/package/README.md +19 -0
- package/{src/types/builder-block.js → package/blocks/button/button.lite.d.ts} +0 -0
- package/package/blocks/button/button.lite.tsx +36 -0
- package/package/blocks/button/button.svelte +28 -0
- package/package/blocks/button/button.svelte.d.ts +25 -0
- package/package/blocks/button/component-info.d.ts +2 -0
- package/package/blocks/button/component-info.js +39 -0
- package/{src/types/builder-content.js → package/blocks/columns/columns.lite.d.ts} +0 -0
- package/package/blocks/columns/columns.lite.tsx +139 -0
- package/package/blocks/columns/columns.svelte +109 -0
- package/package/blocks/columns/columns.svelte.d.ts +33 -0
- package/package/blocks/columns/component-info.d.ts +2 -0
- package/package/blocks/columns/component-info.js +241 -0
- package/package/blocks/custom-code/component-info.d.ts +2 -0
- package/package/blocks/custom-code/component-info.js +28 -0
- package/{src/types/components.js → package/blocks/custom-code/custom-code.lite.d.ts} +0 -0
- package/package/blocks/custom-code/custom-code.lite.tsx +70 -0
- package/package/blocks/custom-code/custom-code.svelte +55 -0
- package/package/blocks/custom-code/custom-code.svelte.d.ts +21 -0
- package/package/blocks/embed/component-info.d.ts +2 -0
- package/package/blocks/embed/component-info.js +47 -0
- package/{src/types/deep-partial.js → package/blocks/embed/embed.lite.d.ts} +0 -0
- package/package/blocks/embed/embed.lite.tsx +52 -0
- package/package/blocks/embed/embed.svelte +41 -0
- package/package/blocks/embed/embed.svelte.d.ts +19 -0
- package/package/blocks/embed/helpers.d.ts +1 -0
- package/package/blocks/embed/helpers.js +6 -0
- package/package/blocks/form/component-info.d.ts +2 -0
- package/package/blocks/form/component-info.js +268 -0
- package/{src/types/element.js → package/blocks/form/form.lite.d.ts} +0 -0
- package/package/blocks/form/form.lite.tsx +351 -0
- package/package/blocks/form/form.svelte +259 -0
- package/package/blocks/form/form.svelte.d.ts +70 -0
- package/package/blocks/fragment/component-info.d.ts +2 -0
- package/package/blocks/fragment/component-info.js +8 -0
- package/{src/types/targets.js → package/blocks/fragment/fragment.lite.d.ts} +0 -0
- package/package/blocks/fragment/fragment.lite.tsx +12 -0
- package/package/blocks/fragment/fragment.svelte +5 -0
- package/package/blocks/fragment/fragment.svelte.d.ts +21 -0
- package/package/blocks/image/component-info.d.ts +2 -0
- package/package/blocks/image/component-info.js +153 -0
- package/package/blocks/image/image.helpers.d.ts +1 -0
- package/package/blocks/image/image.helpers.js +56 -0
- package/{src/types/typescript.js → package/blocks/image/image.lite.d.ts} +0 -0
- package/package/blocks/image/image.lite.tsx +148 -0
- package/package/blocks/image/image.svelte +119 -0
- package/package/blocks/image/image.svelte.d.ts +48 -0
- package/package/blocks/img/component-info.d.ts +2 -0
- package/package/blocks/img/component-info.js +18 -0
- package/package/blocks/img/img.lite.d.ts +0 -0
- package/package/blocks/img/img.lite.tsx +48 -0
- package/package/blocks/img/img.svelte +26 -0
- package/package/blocks/img/img.svelte.d.ts +29 -0
- package/package/blocks/input/component-info.d.ts +2 -0
- package/package/blocks/input/component-info.js +72 -0
- package/package/blocks/input/input.lite.d.ts +0 -0
- package/package/blocks/input/input.lite.tsx +34 -0
- package/package/blocks/input/input.svelte +22 -0
- package/package/blocks/input/input.svelte.d.ts +31 -0
- package/package/blocks/raw-text/component-info.d.ts +2 -0
- package/package/blocks/raw-text/component-info.js +13 -0
- package/package/blocks/raw-text/raw-text.lite.d.ts +0 -0
- package/package/blocks/raw-text/raw-text.lite.tsx +15 -0
- package/package/blocks/raw-text/raw-text.svelte +9 -0
- package/package/blocks/raw-text/raw-text.svelte.d.ts +21 -0
- package/package/blocks/section/component-info.d.ts +2 -0
- package/package/blocks/section/component-info.js +46 -0
- package/package/blocks/section/section.lite.d.ts +0 -0
- package/package/blocks/section/section.lite.tsx +30 -0
- package/package/blocks/section/section.svelte +21 -0
- package/package/blocks/section/section.svelte.d.ts +25 -0
- package/package/blocks/select/component-info.d.ts +2 -0
- package/package/blocks/select/component-info.js +56 -0
- package/package/blocks/select/select.lite.d.ts +0 -0
- package/package/blocks/select/select.lite.tsx +34 -0
- package/package/blocks/select/select.svelte +21 -0
- package/package/blocks/select/select.svelte.d.ts +30 -0
- package/package/blocks/submit-button/component-info.d.ts +2 -0
- package/package/blocks/submit-button/component-info.js +29 -0
- package/package/blocks/submit-button/submit-button.lite.d.ts +0 -0
- package/package/blocks/submit-button/submit-button.lite.tsx +15 -0
- package/package/blocks/submit-button/submit-button.svelte +9 -0
- package/package/blocks/submit-button/submit-button.svelte.d.ts +21 -0
- package/package/blocks/symbol/component-info.d.ts +2 -0
- package/package/blocks/symbol/component-info.js +40 -0
- package/package/blocks/symbol/symbol.lite.d.ts +0 -0
- package/package/blocks/symbol/symbol.lite.tsx +92 -0
- package/package/blocks/symbol/symbol.svelte +66 -0
- package/package/blocks/symbol/symbol.svelte.d.ts +35 -0
- package/package/blocks/text/component-info.d.ts +2 -0
- package/package/blocks/text/component-info.js +21 -0
- package/package/blocks/text/text.lite.d.ts +0 -0
- package/package/blocks/text/text.lite.tsx +11 -0
- package/package/blocks/text/text.svelte +6 -0
- package/package/blocks/text/text.svelte.d.ts +19 -0
- package/package/blocks/textarea/component-info.d.ts +2 -0
- package/package/blocks/textarea/component-info.js +44 -0
- package/package/blocks/textarea/textarea.lite.d.ts +0 -0
- package/package/blocks/textarea/textarea.lite.tsx +19 -0
- package/package/blocks/textarea/textarea.svelte +10 -0
- package/package/blocks/textarea/textarea.svelte.d.ts +27 -0
- package/package/blocks/util.d.ts +1 -0
- package/package/blocks/util.js +4 -0
- package/package/blocks/video/component-info.d.ts +2 -0
- package/package/blocks/video/component-info.js +103 -0
- package/package/blocks/video/video.lite.d.ts +0 -0
- package/package/blocks/video/video.lite.tsx +92 -0
- package/package/blocks/video/video.svelte +63 -0
- package/package/blocks/video/video.svelte.d.ts +41 -0
- package/package/components/render-block/block-styles.lite.d.ts +0 -0
- package/package/components/render-block/block-styles.lite.tsx +60 -0
- package/package/components/render-block/block-styles.svelte +45 -0
- package/package/components/render-block/block-styles.svelte.d.ts +23 -0
- package/package/components/render-block/render-block.helpers.d.ts +1 -0
- package/package/components/render-block/render-block.helpers.js +24 -0
- package/package/components/render-block/render-block.lite.d.ts +0 -0
- package/package/components/render-block/render-block.lite.tsx +216 -0
- package/package/components/render-block/render-block.svelte +185 -0
- package/package/components/render-block/render-block.svelte.d.ts +23 -0
- package/package/components/render-block/render-component.lite.d.ts +0 -0
- package/package/components/render-block/render-component.lite.tsx +33 -0
- package/package/components/render-block/render-component.svelte +24 -0
- package/package/components/render-block/render-component.svelte.d.ts +27 -0
- package/package/components/render-block/render-repeated-block.lite.d.ts +0 -0
- package/package/components/render-block/render-repeated-block.lite.tsx +49 -0
- package/package/components/render-block/render-repeated-block.svelte +36 -0
- package/package/components/render-block/render-repeated-block.svelte.d.ts +23 -0
- package/package/components/render-block/types.d.ts +6 -0
- package/package/components/render-block/types.js +2 -0
- package/package/components/render-blocks.lite.d.ts +0 -0
- package/package/components/render-blocks.lite.tsx +91 -0
- package/package/components/render-blocks.svelte +73 -0
- package/package/components/render-blocks.svelte.d.ts +24 -0
- package/package/components/render-content/components/render-styles.lite.d.ts +0 -0
- package/package/components/render-content/components/render-styles.lite.tsx +86 -0
- package/package/components/render-content/components/render-styles.svelte +61 -0
- package/package/components/render-content/components/render-styles.svelte.d.ts +29 -0
- package/package/components/render-content/index.d.ts +1 -0
- package/package/components/render-content/index.js +1 -0
- package/package/components/render-content/render-content.lite.d.ts +0 -0
- package/package/components/render-content/render-content.lite.tsx +356 -0
- package/package/components/render-content/render-content.svelte +260 -0
- package/package/components/render-content/render-content.svelte.d.ts +36 -0
- package/package/components/render-inlined-styles.lite.d.ts +0 -0
- package/package/components/render-inlined-styles.lite.tsx +27 -0
- package/package/components/render-inlined-styles.svelte +19 -0
- package/package/components/render-inlined-styles.svelte.d.ts +19 -0
- package/package/constants/builder-registered-components.d.ts +6 -0
- package/package/constants/builder-registered-components.js +36 -0
- package/package/constants/device-sizes.d.ts +2 -0
- package/package/constants/device-sizes.js +18 -0
- package/package/constants/target.d.ts +2 -0
- package/package/constants/target.js +2 -0
- package/package/context/builder.context.d.ts +11 -0
- package/package/context/builder.context.js +11 -0
- package/package/context/types.d.ts +16 -0
- package/package/context/types.js +3 -0
- package/package/functions/camel-to-kebab-case.d.ts +1 -0
- package/package/functions/camel-to-kebab-case.js +1 -0
- package/package/functions/convert-style-object.d.ts +1 -0
- package/package/functions/convert-style-object.js +3 -0
- package/package/functions/evaluate.d.ts +5 -0
- package/package/functions/evaluate.js +25 -0
- package/package/functions/event-handler-name.d.ts +1 -0
- package/package/functions/event-handler-name.js +4 -0
- package/package/functions/get-block-actions.d.ts +9 -0
- package/package/functions/get-block-actions.js +21 -0
- package/package/functions/get-block-component-options.d.ts +2 -0
- package/package/functions/get-block-component-options.js +11 -0
- package/package/functions/get-block-properties.d.ts +5 -0
- package/package/functions/get-block-properties.js +10 -0
- package/package/functions/get-block-styles.d.ts +2 -0
- package/package/functions/get-block-styles.js +21 -0
- package/package/functions/get-block-tag.d.ts +10 -0
- package/package/functions/get-block-tag.js +9 -0
- package/package/functions/get-builder-search-params/fn.test.d.ts +1 -0
- package/package/functions/get-builder-search-params/fn.test.js +13 -0
- package/package/functions/get-builder-search-params/index.d.ts +6 -0
- package/package/functions/get-builder-search-params/index.js +29 -0
- package/package/functions/get-content/ab-testing.d.ts +3 -0
- package/package/functions/get-content/ab-testing.js +40 -0
- package/package/functions/get-content/fn.test.d.ts +1 -0
- package/package/functions/get-content/fn.test.js +31 -0
- package/package/functions/get-content/index.d.ts +9 -0
- package/package/functions/get-content/index.js +42 -0
- package/package/functions/get-content/types.d.ts +26 -0
- package/package/functions/get-content/types.js +1 -0
- package/package/functions/get-fetch.d.ts +1 -0
- package/package/functions/get-fetch.js +9 -0
- package/package/functions/get-global-this.d.ts +1 -0
- package/package/functions/get-global-this.js +15 -0
- package/package/functions/get-processed-block.d.ts +10 -0
- package/package/functions/get-processed-block.js +29 -0
- package/package/functions/get-processed-block.test.d.ts +1 -0
- package/package/functions/get-processed-block.test.js +32 -0
- package/package/functions/if-target.d.ts +7 -0
- package/package/functions/if-target.js +10 -0
- package/package/functions/is-browser.d.ts +1 -0
- package/package/functions/is-browser.js +3 -0
- package/package/functions/is-editing.d.ts +1 -0
- package/package/functions/is-editing.js +4 -0
- package/package/functions/is-iframe.d.ts +1 -0
- package/package/functions/is-iframe.js +4 -0
- package/package/functions/is-previewing.d.ts +1 -0
- package/package/functions/is-previewing.js +11 -0
- package/package/functions/mark-mutable.d.ts +2 -0
- package/package/functions/mark-mutable.js +6 -0
- package/package/functions/on-change.d.ts +7 -0
- package/package/functions/on-change.js +28 -0
- package/package/functions/on-change.test.d.ts +1 -0
- package/package/functions/on-change.test.js +20 -0
- package/package/functions/register-component.d.ts +14 -0
- package/package/functions/register-component.js +42 -0
- package/package/functions/register.d.ts +16 -0
- package/package/functions/register.js +29 -0
- package/package/functions/sanitize-styles.d.ts +4 -0
- package/package/functions/sanitize-styles.js +6 -0
- package/package/functions/set-editor-settings.d.ts +4 -0
- package/package/functions/set-editor-settings.js +12 -0
- package/package/functions/set.d.ts +7 -0
- package/package/functions/set.js +21 -0
- package/package/functions/set.test.d.ts +1 -0
- package/package/functions/set.test.js +16 -0
- package/package/functions/track.d.ts +21 -0
- package/package/functions/track.js +49 -0
- package/package/functions/transform-block.d.ts +2 -0
- package/package/functions/transform-block.js +5 -0
- package/package/helpers/cookie.d.ts +9 -0
- package/package/helpers/cookie.js +55 -0
- package/package/helpers/css.d.ts +1 -0
- package/package/helpers/css.js +9 -0
- package/package/helpers/flatten.d.ts +6 -0
- package/package/helpers/flatten.js +19 -0
- package/package/helpers/localStorage.d.ts +9 -0
- package/package/helpers/localStorage.js +23 -0
- package/package/helpers/nullable.d.ts +2 -0
- package/package/helpers/nullable.js +1 -0
- package/package/helpers/sessionId.d.ts +7 -0
- package/package/helpers/sessionId.js +20 -0
- package/package/helpers/time.d.ts +1 -0
- package/package/helpers/time.js +2 -0
- package/package/helpers/url.d.ts +6 -0
- package/package/helpers/url.js +12 -0
- package/package/helpers/url.test.d.ts +1 -0
- package/package/helpers/url.test.js +15 -0
- package/package/helpers/uuid.d.ts +8 -0
- package/package/helpers/uuid.js +15 -0
- package/package/helpers/visitorId.d.ts +8 -0
- package/package/helpers/visitorId.js +26 -0
- package/package/index-helpers/blocks-exports.d.ts +10 -0
- package/package/index-helpers/blocks-exports.js +10 -0
- package/package/index-helpers/top-of-file.d.ts +1 -0
- package/package/index-helpers/top-of-file.js +4 -0
- package/package/index.d.ts +10 -0
- package/package/index.js +10 -0
- package/package/scripts/init-editing.d.ts +2 -0
- package/package/scripts/init-editing.js +84 -0
- package/package/types/builder-block.d.ts +57 -0
- package/package/types/builder-block.js +1 -0
- package/package/types/builder-content.d.ts +38 -0
- package/package/types/builder-content.js +1 -0
- package/package/types/can-track.d.ts +3 -0
- package/package/types/can-track.js +1 -0
- package/package/types/components.d.ts +177 -0
- package/package/types/components.js +1 -0
- package/package/types/deep-partial.d.ts +3 -0
- package/package/types/deep-partial.js +1 -0
- package/package/types/element.d.ts +59 -0
- package/package/types/element.js +1 -0
- package/package/types/targets.d.ts +3 -0
- package/package/types/targets.js +1 -0
- package/package/types/typescript.d.ts +4 -0
- package/package/types/typescript.js +1 -0
- package/package.json +31 -8
- package/src/blocks/button/button.svelte +0 -49
- package/src/blocks/button/component-info.js +0 -41
- package/src/blocks/columns/columns.svelte +0 -103
- package/src/blocks/columns/component-info.js +0 -217
- package/src/blocks/custom-code/component-info.js +0 -31
- package/src/blocks/custom-code/custom-code.svelte +0 -64
- package/src/blocks/embed/component-info.js +0 -24
- package/src/blocks/embed/embed.svelte +0 -63
- package/src/blocks/form/component-info.js +0 -262
- package/src/blocks/form/form.svelte +0 -333
- package/src/blocks/fragment/component-info.js +0 -11
- package/src/blocks/fragment/fragment.svelte +0 -28
- package/src/blocks/image/component-info.js +0 -104
- package/src/blocks/image/image.svelte +0 -117
- package/src/blocks/img/component-info.js +0 -20
- package/src/blocks/img/img.svelte +0 -36
- package/src/blocks/input/component-info.js +0 -74
- package/src/blocks/input/input.svelte +0 -35
- package/src/blocks/raw-text/component-info.js +0 -16
- package/src/blocks/raw-text/raw-text.svelte +0 -29
- package/src/blocks/section/component-info.js +0 -49
- package/src/blocks/section/section.svelte +0 -36
- package/src/blocks/select/component-info.js +0 -59
- package/src/blocks/select/select.svelte +0 -41
- package/src/blocks/submit-button/component-info.js +0 -28
- package/src/blocks/submit-button/submit-button.svelte +0 -33
- package/src/blocks/symbol/component-info.js +0 -42
- package/src/blocks/symbol/symbol.svelte +0 -54
- package/src/blocks/text/component-info.js +0 -24
- package/src/blocks/text/text.svelte +0 -28
- package/src/blocks/textarea/component-info.js +0 -47
- package/src/blocks/textarea/textarea.svelte +0 -32
- package/src/blocks/video/component-info.js +0 -106
- package/src/blocks/video/video.svelte +0 -45
- package/src/components/error-boundary.svelte +0 -26
- package/src/components/render-block/block-styles.svelte +0 -51
- package/src/components/render-block/render-block.helpers.js +0 -23
- package/src/components/render-block/render-block.svelte +0 -174
- package/src/components/render-blocks.svelte +0 -82
- package/src/components/render-content/components/render-styles.svelte +0 -90
- package/src/components/render-content/index.js +0 -4
- package/src/components/render-content/render-content.svelte +0 -252
- package/src/components/render-inlined-styles.svelte +0 -51
- package/src/constants/builder-registered-components.js +0 -45
- package/src/constants/device-sizes.js +0 -39
- package/src/constants/target.js +0 -4
- package/src/context/builder.context.js +0 -8
- package/src/functions/evaluate.js +0 -28
- package/src/functions/event-handler-name.js +0 -7
- package/src/functions/fast-clone.js +0 -4
- package/src/functions/get-block-actions.js +0 -23
- package/src/functions/get-block-component-options.js +0 -23
- package/src/functions/get-block-properties.js +0 -29
- package/src/functions/get-block-styles.js +0 -31
- package/src/functions/get-block-tag.js +0 -6
- package/src/functions/get-builder-search-params/fn.test.js +0 -13
- package/src/functions/get-builder-search-params/index.js +0 -22
- package/src/functions/get-content/fn.test.js +0 -31
- package/src/functions/get-content/index.js +0 -138
- package/src/functions/get-fetch.js +0 -34
- package/src/functions/get-global-this.js +0 -18
- package/src/functions/get-processed-block.js +0 -46
- package/src/functions/get-processed-block.test.js +0 -31
- package/src/functions/if-target.js +0 -15
- package/src/functions/is-browser.js +0 -6
- package/src/functions/is-editing.js +0 -7
- package/src/functions/is-iframe.js +0 -7
- package/src/functions/is-previewing.js +0 -14
- package/src/functions/macro-eval.js +0 -5
- package/src/functions/on-change.js +0 -27
- package/src/functions/on-change.test.js +0 -19
- package/src/functions/previewing-model-name.js +0 -11
- package/src/functions/register-component.js +0 -70
- package/src/functions/register.js +0 -29
- package/src/functions/set-editor-settings.js +0 -15
- package/src/functions/set.js +0 -11
- package/src/functions/set.test.js +0 -16
- package/src/functions/track.js +0 -22
- package/src/functions/transform-block.js +0 -6
- package/src/index-helpers/blocks-exports.js +0 -20
- package/src/index-helpers/top-of-file.js +0 -4
- package/src/index.js +0 -10
- package/src/scripts/init-editing.js +0 -80
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
export const componentInfo = {
|
|
2
|
+
name: 'Form:TextArea',
|
|
3
|
+
builtIn: true,
|
|
4
|
+
image: 'https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Ff74a2f3de58c4c3e939204e5b6b8f6c3',
|
|
5
|
+
inputs: [
|
|
6
|
+
{
|
|
7
|
+
advanced: true,
|
|
8
|
+
name: 'value',
|
|
9
|
+
type: 'string',
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
name: 'name',
|
|
13
|
+
type: 'string',
|
|
14
|
+
required: true,
|
|
15
|
+
helperText: 'Every input in a form needs a unique name describing what it gets, e.g. "email"',
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
name: 'defaultValue',
|
|
19
|
+
type: 'string',
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
name: 'placeholder',
|
|
23
|
+
type: 'string',
|
|
24
|
+
defaultValue: 'Hello there',
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
name: 'required',
|
|
28
|
+
type: 'boolean',
|
|
29
|
+
defaultValue: false,
|
|
30
|
+
},
|
|
31
|
+
],
|
|
32
|
+
defaultStyles: {
|
|
33
|
+
paddingTop: '10px',
|
|
34
|
+
paddingBottom: '10px',
|
|
35
|
+
paddingLeft: '10px',
|
|
36
|
+
paddingRight: '10px',
|
|
37
|
+
borderRadius: '3px',
|
|
38
|
+
borderWidth: '1px',
|
|
39
|
+
borderStyle: 'solid',
|
|
40
|
+
borderColor: '#ccc',
|
|
41
|
+
},
|
|
42
|
+
static: true,
|
|
43
|
+
noWrap: true,
|
|
44
|
+
};
|
|
File without changes
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<script context="module" lang="ts">
|
|
2
|
+
export interface TextareaProps {
|
|
3
|
+
attributes?: any;
|
|
4
|
+
name?: string;
|
|
5
|
+
value?: string;
|
|
6
|
+
defaultValue?: string;
|
|
7
|
+
placeholder?: string;
|
|
8
|
+
}
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<script lang="ts">
|
|
12
|
+
export let attributes: TextareaProps["attributes"];
|
|
13
|
+
export let placeholder: TextareaProps["placeholder"];
|
|
14
|
+
export let name: TextareaProps["name"];
|
|
15
|
+
export let value: TextareaProps["value"];
|
|
16
|
+
export let defaultValue: TextareaProps["defaultValue"];
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
<textarea {...attributes} {placeholder} {name} {value} {defaultValue} />
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
export interface TextareaProps {
|
|
3
|
+
attributes?: any;
|
|
4
|
+
name?: string;
|
|
5
|
+
value?: string;
|
|
6
|
+
defaultValue?: string;
|
|
7
|
+
placeholder?: string;
|
|
8
|
+
}
|
|
9
|
+
declare const __propDef: {
|
|
10
|
+
props: {
|
|
11
|
+
attributes: TextareaProps["attributes"];
|
|
12
|
+
placeholder: TextareaProps["placeholder"];
|
|
13
|
+
name: TextareaProps["name"];
|
|
14
|
+
value: TextareaProps["value"];
|
|
15
|
+
defaultValue: TextareaProps["defaultValue"];
|
|
16
|
+
};
|
|
17
|
+
events: {
|
|
18
|
+
[evt: string]: CustomEvent<any>;
|
|
19
|
+
};
|
|
20
|
+
slots: {};
|
|
21
|
+
};
|
|
22
|
+
export declare type TextareaProps = typeof __propDef.props;
|
|
23
|
+
export declare type TextareaEvents = typeof __propDef.events;
|
|
24
|
+
export declare type TextareaSlots = typeof __propDef.slots;
|
|
25
|
+
export default class Textarea extends SvelteComponentTyped<TextareaProps, TextareaEvents, TextareaSlots> {
|
|
26
|
+
}
|
|
27
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function markSerializable<FN extends (...args: any[]) => any>(fn: FN): FN;
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
export const componentInfo = {
|
|
2
|
+
name: 'Video',
|
|
3
|
+
canHaveChildren: true,
|
|
4
|
+
builtIn: true,
|
|
5
|
+
defaultStyles: {
|
|
6
|
+
minHeight: '20px',
|
|
7
|
+
minWidth: '20px',
|
|
8
|
+
},
|
|
9
|
+
image: 'https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-videocam-24px%20(1).svg?alt=media&token=49a84e4a-b20e-4977-a650-047f986874bb',
|
|
10
|
+
inputs: [
|
|
11
|
+
{
|
|
12
|
+
name: 'video',
|
|
13
|
+
type: 'file',
|
|
14
|
+
allowedFileTypes: ['mp4'],
|
|
15
|
+
bubble: true,
|
|
16
|
+
defaultValue: 'https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/assets%2FKQlEmWDxA0coC3PK6UvkrjwkIGI2%2F28cb070609f546cdbe5efa20e931aa4b?alt=media&token=912e9551-7a7c-4dfb-86b6-3da1537d1a7f',
|
|
17
|
+
required: true,
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
name: 'posterImage',
|
|
21
|
+
type: 'file',
|
|
22
|
+
allowedFileTypes: ['jpeg', 'png'],
|
|
23
|
+
helperText: 'Image to show before the video plays',
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
name: 'autoPlay',
|
|
27
|
+
type: 'boolean',
|
|
28
|
+
defaultValue: true,
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
name: 'controls',
|
|
32
|
+
type: 'boolean',
|
|
33
|
+
defaultValue: false,
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
name: 'muted',
|
|
37
|
+
type: 'boolean',
|
|
38
|
+
defaultValue: true,
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
name: 'loop',
|
|
42
|
+
type: 'boolean',
|
|
43
|
+
defaultValue: true,
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
name: 'playsInline',
|
|
47
|
+
type: 'boolean',
|
|
48
|
+
defaultValue: true,
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
name: 'fit',
|
|
52
|
+
type: 'text',
|
|
53
|
+
defaultValue: 'cover',
|
|
54
|
+
enum: ['contain', 'cover', 'fill', 'auto'],
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
name: 'fitContent',
|
|
58
|
+
type: 'boolean',
|
|
59
|
+
helperText: 'When child blocks are provided, fit to them instead of using the aspect ratio',
|
|
60
|
+
defaultValue: true,
|
|
61
|
+
advanced: true,
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
name: 'position',
|
|
65
|
+
type: 'text',
|
|
66
|
+
defaultValue: 'center',
|
|
67
|
+
enum: [
|
|
68
|
+
'center',
|
|
69
|
+
'top',
|
|
70
|
+
'left',
|
|
71
|
+
'right',
|
|
72
|
+
'bottom',
|
|
73
|
+
'top left',
|
|
74
|
+
'top right',
|
|
75
|
+
'bottom left',
|
|
76
|
+
'bottom right',
|
|
77
|
+
],
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
name: 'height',
|
|
81
|
+
type: 'number',
|
|
82
|
+
advanced: true,
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
name: 'width',
|
|
86
|
+
type: 'number',
|
|
87
|
+
advanced: true,
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
name: 'aspectRatio',
|
|
91
|
+
type: 'number',
|
|
92
|
+
advanced: true,
|
|
93
|
+
defaultValue: 0.7004048582995948,
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
name: 'lazyLoad',
|
|
97
|
+
type: 'boolean',
|
|
98
|
+
helperText: 'Load this video "lazily" - as in only when a user scrolls near the video. Recommended for optmized performance and bandwidth consumption',
|
|
99
|
+
defaultValue: true,
|
|
100
|
+
advanced: true,
|
|
101
|
+
},
|
|
102
|
+
],
|
|
103
|
+
};
|
|
File without changes
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
<script context="module" lang="ts">
|
|
2
|
+
export interface VideoProps {
|
|
3
|
+
attributes?: any;
|
|
4
|
+
video?: string;
|
|
5
|
+
autoPlay?: boolean;
|
|
6
|
+
controls?: boolean;
|
|
7
|
+
muted?: boolean;
|
|
8
|
+
loop?: boolean;
|
|
9
|
+
playsInline?: boolean;
|
|
10
|
+
aspectRatio?: number;
|
|
11
|
+
width?: number;
|
|
12
|
+
height?: number;
|
|
13
|
+
fit?: "contain" | "cover" | "fill";
|
|
14
|
+
position?:
|
|
15
|
+
| "center"
|
|
16
|
+
| "top"
|
|
17
|
+
| "left"
|
|
18
|
+
| "right"
|
|
19
|
+
| "bottom"
|
|
20
|
+
| "top left"
|
|
21
|
+
| "top right"
|
|
22
|
+
| "bottom left"
|
|
23
|
+
| "bottom right";
|
|
24
|
+
posterImage?: string;
|
|
25
|
+
lazyLoad?: boolean;
|
|
26
|
+
}
|
|
27
|
+
</script>
|
|
28
|
+
|
|
29
|
+
<script lang="ts">
|
|
30
|
+
export let autoPlay: VideoProps["autoPlay"];
|
|
31
|
+
export let muted: VideoProps["muted"];
|
|
32
|
+
export let controls: VideoProps["controls"];
|
|
33
|
+
export let loop: VideoProps["loop"];
|
|
34
|
+
export let playsInline: VideoProps["playsInline"];
|
|
35
|
+
export let attributes: VideoProps["attributes"];
|
|
36
|
+
export let fit: VideoProps["fit"];
|
|
37
|
+
export let position: VideoProps["position"];
|
|
38
|
+
export let video: VideoProps["video"];
|
|
39
|
+
export let posterImage: VideoProps["posterImage"];
|
|
40
|
+
|
|
41
|
+
function mitosis_styling(node, vars) {
|
|
42
|
+
Object.entries(vars).forEach(([p, v]) => {
|
|
43
|
+
node.style[p] = v;
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
$: videoProps = () => {
|
|
48
|
+
return {
|
|
49
|
+
...(autoPlay === true
|
|
50
|
+
? {
|
|
51
|
+
autoPlay: true,
|
|
52
|
+
}
|
|
53
|
+
: {}),
|
|
54
|
+
...(muted === true
|
|
55
|
+
? {
|
|
56
|
+
muted: true,
|
|
57
|
+
}
|
|
58
|
+
: {}),
|
|
59
|
+
...(controls === true
|
|
60
|
+
? {
|
|
61
|
+
controls: true,
|
|
62
|
+
}
|
|
63
|
+
: {}),
|
|
64
|
+
...(loop === true
|
|
65
|
+
? {
|
|
66
|
+
loop: true,
|
|
67
|
+
}
|
|
68
|
+
: {}),
|
|
69
|
+
...(playsInline === true
|
|
70
|
+
? {
|
|
71
|
+
playsInline: true,
|
|
72
|
+
}
|
|
73
|
+
: {}),
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
</script>
|
|
77
|
+
|
|
78
|
+
<video
|
|
79
|
+
{...videoProps()}
|
|
80
|
+
use:mitosis_styling={{
|
|
81
|
+
width: "100%",
|
|
82
|
+
height: "100%",
|
|
83
|
+
...attributes?.style,
|
|
84
|
+
objectFit: fit,
|
|
85
|
+
objectPosition: position,
|
|
86
|
+
// Hack to get object fit to work as expected and
|
|
87
|
+
// not have the video overflow
|
|
88
|
+
borderRadius: 1,
|
|
89
|
+
}}
|
|
90
|
+
src={video || "no-src"}
|
|
91
|
+
poster={posterImage}
|
|
92
|
+
/>
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
<script context="module"></script>
|
|
2
|
+
|
|
3
|
+
<script>export let autoPlay;
|
|
4
|
+
export let muted;
|
|
5
|
+
export let controls;
|
|
6
|
+
export let loop;
|
|
7
|
+
export let playsInline;
|
|
8
|
+
export let attributes;
|
|
9
|
+
export let fit;
|
|
10
|
+
export let position;
|
|
11
|
+
export let video;
|
|
12
|
+
export let posterImage;
|
|
13
|
+
function mitosis_styling(node, vars) {
|
|
14
|
+
Object.entries(vars).forEach(([p, v]) => {
|
|
15
|
+
node.style[p] = v;
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
$: videoProps = () => {
|
|
19
|
+
return {
|
|
20
|
+
...(autoPlay === true
|
|
21
|
+
? {
|
|
22
|
+
autoPlay: true,
|
|
23
|
+
}
|
|
24
|
+
: {}),
|
|
25
|
+
...(muted === true
|
|
26
|
+
? {
|
|
27
|
+
muted: true,
|
|
28
|
+
}
|
|
29
|
+
: {}),
|
|
30
|
+
...(controls === true
|
|
31
|
+
? {
|
|
32
|
+
controls: true,
|
|
33
|
+
}
|
|
34
|
+
: {}),
|
|
35
|
+
...(loop === true
|
|
36
|
+
? {
|
|
37
|
+
loop: true,
|
|
38
|
+
}
|
|
39
|
+
: {}),
|
|
40
|
+
...(playsInline === true
|
|
41
|
+
? {
|
|
42
|
+
playsInline: true,
|
|
43
|
+
}
|
|
44
|
+
: {}),
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
</script>
|
|
48
|
+
|
|
49
|
+
<video
|
|
50
|
+
{...videoProps()}
|
|
51
|
+
use:mitosis_styling={{
|
|
52
|
+
width: "100%",
|
|
53
|
+
height: "100%",
|
|
54
|
+
...attributes?.style,
|
|
55
|
+
objectFit: fit,
|
|
56
|
+
objectPosition: position,
|
|
57
|
+
// Hack to get object fit to work as expected and
|
|
58
|
+
// not have the video overflow
|
|
59
|
+
borderRadius: 1,
|
|
60
|
+
}}
|
|
61
|
+
src={video || "no-src"}
|
|
62
|
+
poster={posterImage}
|
|
63
|
+
/>
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
export interface VideoProps {
|
|
3
|
+
attributes?: any;
|
|
4
|
+
video?: string;
|
|
5
|
+
autoPlay?: boolean;
|
|
6
|
+
controls?: boolean;
|
|
7
|
+
muted?: boolean;
|
|
8
|
+
loop?: boolean;
|
|
9
|
+
playsInline?: boolean;
|
|
10
|
+
aspectRatio?: number;
|
|
11
|
+
width?: number;
|
|
12
|
+
height?: number;
|
|
13
|
+
fit?: "contain" | "cover" | "fill";
|
|
14
|
+
position?: "center" | "top" | "left" | "right" | "bottom" | "top left" | "top right" | "bottom left" | "bottom right";
|
|
15
|
+
posterImage?: string;
|
|
16
|
+
lazyLoad?: boolean;
|
|
17
|
+
}
|
|
18
|
+
declare const __propDef: {
|
|
19
|
+
props: {
|
|
20
|
+
autoPlay: VideoProps["autoPlay"];
|
|
21
|
+
muted: VideoProps["muted"];
|
|
22
|
+
controls: VideoProps["controls"];
|
|
23
|
+
loop: VideoProps["loop"];
|
|
24
|
+
playsInline: VideoProps["playsInline"];
|
|
25
|
+
attributes: VideoProps["attributes"];
|
|
26
|
+
fit: VideoProps["fit"];
|
|
27
|
+
position: VideoProps["position"];
|
|
28
|
+
video: VideoProps["video"];
|
|
29
|
+
posterImage: VideoProps["posterImage"];
|
|
30
|
+
};
|
|
31
|
+
events: {
|
|
32
|
+
[evt: string]: CustomEvent<any>;
|
|
33
|
+
};
|
|
34
|
+
slots: {};
|
|
35
|
+
};
|
|
36
|
+
export declare type VideoProps = typeof __propDef.props;
|
|
37
|
+
export declare type VideoEvents = typeof __propDef.events;
|
|
38
|
+
export declare type VideoSlots = typeof __propDef.slots;
|
|
39
|
+
export default class Video extends SvelteComponentTyped<VideoProps, VideoEvents, VideoSlots> {
|
|
40
|
+
}
|
|
41
|
+
export {};
|
|
File without changes
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
<script context="module" lang="ts">
|
|
2
|
+
export type BlockStylesProps = {
|
|
3
|
+
block: BuilderBlock;
|
|
4
|
+
context: BuilderContextInterface;
|
|
5
|
+
};
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<script lang="ts">
|
|
9
|
+
import { getMaxWidthQueryForSize } from "../../constants/device-sizes.js";
|
|
10
|
+
import { TARGET } from "../../constants/target.js";
|
|
11
|
+
import { BuilderContextInterface } from "../../context/types.js";
|
|
12
|
+
import { getProcessedBlock } from "../../functions/get-processed-block.js";
|
|
13
|
+
import { convertStyleMaptoCSS } from "../../helpers/css.js";
|
|
14
|
+
import { BuilderBlock } from "../../types/builder-block.js";
|
|
15
|
+
import RenderInlinedStyles from "../render-inlined-styles.svelte";
|
|
16
|
+
|
|
17
|
+
export let block: BlockStylesProps["block"];
|
|
18
|
+
export let context: BlockStylesProps["context"];
|
|
19
|
+
|
|
20
|
+
$: useBlock = () => {
|
|
21
|
+
return getProcessedBlock({
|
|
22
|
+
block: block,
|
|
23
|
+
state: context.state,
|
|
24
|
+
context: context.context,
|
|
25
|
+
shouldEvaluateBindings: true,
|
|
26
|
+
});
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
$: css = () => {
|
|
30
|
+
const styles = useBlock().responsiveStyles;
|
|
31
|
+
const largeStyles = styles?.large;
|
|
32
|
+
const mediumStyles = styles?.medium;
|
|
33
|
+
const smallStyles = styles?.small;
|
|
34
|
+
return `
|
|
35
|
+
${
|
|
36
|
+
largeStyles
|
|
37
|
+
? `.${useBlock().id} {${convertStyleMaptoCSS(largeStyles)}}`
|
|
38
|
+
: ""
|
|
39
|
+
}
|
|
40
|
+
${
|
|
41
|
+
mediumStyles
|
|
42
|
+
? `${getMaxWidthQueryForSize("medium")} {
|
|
43
|
+
.${useBlock().id} {${convertStyleMaptoCSS(mediumStyles)}}
|
|
44
|
+
}`
|
|
45
|
+
: ""
|
|
46
|
+
}
|
|
47
|
+
${
|
|
48
|
+
smallStyles
|
|
49
|
+
? `${getMaxWidthQueryForSize("small")} {
|
|
50
|
+
.${useBlock().id} {${convertStyleMaptoCSS(smallStyles)}}
|
|
51
|
+
}`
|
|
52
|
+
: ""
|
|
53
|
+
}
|
|
54
|
+
}`;
|
|
55
|
+
};
|
|
56
|
+
</script>
|
|
57
|
+
|
|
58
|
+
{#if TARGET === "vue2" || TARGET === "vue3" || TARGET === "svelte"}
|
|
59
|
+
<RenderInlinedStyles styles={css()} />
|
|
60
|
+
{/if}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
<script context="module"></script>
|
|
2
|
+
|
|
3
|
+
<script>import { getMaxWidthQueryForSize } from "../../constants/device-sizes.js";
|
|
4
|
+
import { TARGET } from "../../constants/target.js";
|
|
5
|
+
import "../../context/types.js";
|
|
6
|
+
import { getProcessedBlock } from "../../functions/get-processed-block.js";
|
|
7
|
+
import { convertStyleMaptoCSS } from "../../helpers/css.js";
|
|
8
|
+
import "../../types/builder-block.js";
|
|
9
|
+
import RenderInlinedStyles from "../render-inlined-styles.svelte";
|
|
10
|
+
export let block;
|
|
11
|
+
export let context;
|
|
12
|
+
$: useBlock = () => {
|
|
13
|
+
return getProcessedBlock({
|
|
14
|
+
block: block,
|
|
15
|
+
state: context.state,
|
|
16
|
+
context: context.context,
|
|
17
|
+
shouldEvaluateBindings: true,
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
$: css = () => {
|
|
21
|
+
const styles = useBlock().responsiveStyles;
|
|
22
|
+
const largeStyles = styles?.large;
|
|
23
|
+
const mediumStyles = styles?.medium;
|
|
24
|
+
const smallStyles = styles?.small;
|
|
25
|
+
return `
|
|
26
|
+
${largeStyles
|
|
27
|
+
? `.${useBlock().id} {${convertStyleMaptoCSS(largeStyles)}}`
|
|
28
|
+
: ""}
|
|
29
|
+
${mediumStyles
|
|
30
|
+
? `${getMaxWidthQueryForSize("medium")} {
|
|
31
|
+
.${useBlock().id} {${convertStyleMaptoCSS(mediumStyles)}}
|
|
32
|
+
}`
|
|
33
|
+
: ""}
|
|
34
|
+
${smallStyles
|
|
35
|
+
? `${getMaxWidthQueryForSize("small")} {
|
|
36
|
+
.${useBlock().id} {${convertStyleMaptoCSS(smallStyles)}}
|
|
37
|
+
}`
|
|
38
|
+
: ""}
|
|
39
|
+
}`;
|
|
40
|
+
};
|
|
41
|
+
</script>
|
|
42
|
+
|
|
43
|
+
{#if TARGET === "vue2" || TARGET === "vue3" || TARGET === "svelte"}
|
|
44
|
+
<RenderInlinedStyles styles={css()} />
|
|
45
|
+
{/if}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
export declare type BlockStylesProps = {
|
|
3
|
+
block: BuilderBlock;
|
|
4
|
+
context: BuilderContextInterface;
|
|
5
|
+
};
|
|
6
|
+
import { BuilderContextInterface } from "../../context/types.js";
|
|
7
|
+
import { BuilderBlock } from "../../types/builder-block.js";
|
|
8
|
+
declare const __propDef: {
|
|
9
|
+
props: {
|
|
10
|
+
block: BlockStylesProps["block"];
|
|
11
|
+
context: BlockStylesProps["context"];
|
|
12
|
+
};
|
|
13
|
+
events: {
|
|
14
|
+
[evt: string]: CustomEvent<any>;
|
|
15
|
+
};
|
|
16
|
+
slots: {};
|
|
17
|
+
};
|
|
18
|
+
export declare type BlockStylesProps = typeof __propDef.props;
|
|
19
|
+
export declare type BlockStylesEvents = typeof __propDef.events;
|
|
20
|
+
export declare type BlockStylesSlots = typeof __propDef.slots;
|
|
21
|
+
export default class BlockStyles extends SvelteComponentTyped<BlockStylesProps, BlockStylesEvents, BlockStylesSlots> {
|
|
22
|
+
}
|
|
23
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const isEmptyHtmlElement: (tagName: unknown) => boolean;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* https://developer.mozilla.org/en-US/docs/Glossary/Empty_element
|
|
3
|
+
*/
|
|
4
|
+
const EMPTY_HTML_ELEMENTS = [
|
|
5
|
+
'area',
|
|
6
|
+
'base',
|
|
7
|
+
'br',
|
|
8
|
+
'col',
|
|
9
|
+
'embed',
|
|
10
|
+
'hr',
|
|
11
|
+
'img',
|
|
12
|
+
'input',
|
|
13
|
+
'keygen',
|
|
14
|
+
'link',
|
|
15
|
+
'meta',
|
|
16
|
+
'param',
|
|
17
|
+
'source',
|
|
18
|
+
'track',
|
|
19
|
+
'wbr',
|
|
20
|
+
];
|
|
21
|
+
export const isEmptyHtmlElement = (tagName) => {
|
|
22
|
+
return (typeof tagName === 'string' &&
|
|
23
|
+
EMPTY_HTML_ELEMENTS.includes(tagName.toLowerCase()));
|
|
24
|
+
};
|
|
File without changes
|