@builder.io/sdk-svelte 0.4.4 → 0.5.0
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/--package.json +43 -29
- package/package/CHANGELOG.md +13 -0
- package/package/blocks/BaseText.svelte +1 -1
- package/package/blocks/button/button.svelte +18 -33
- package/package/blocks/button/button.svelte.d.ts +3 -1
- package/package/blocks/button/component-info.d.ts +1 -1
- package/package/blocks/button/component-info.js +9 -13
- package/package/blocks/columns/columns.svelte +14 -20
- package/package/blocks/columns/columns.svelte.d.ts +11 -7
- package/package/blocks/columns/component-info.d.ts +1 -1
- package/package/blocks/columns/component-info.js +62 -83
- package/package/blocks/custom-code/component-info.d.ts +1 -1
- package/package/blocks/custom-code/component-info.js +7 -11
- package/package/blocks/embed/component-info.d.ts +1 -1
- package/package/blocks/embed/component-info.js +8 -15
- package/package/blocks/embed/helpers.js +1 -5
- package/package/blocks/form/component-info.d.ts +1 -1
- package/package/blocks/form/component-info.js +94 -129
- package/package/blocks/form/form.svelte +2 -289
- package/package/blocks/form/form.svelte.d.ts +1 -57
- package/package/blocks/fragment/component-info.d.ts +1 -1
- package/package/blocks/fragment/component-info.js +1 -1
- package/package/blocks/helpers.d.ts +13 -0
- package/package/blocks/helpers.js +40 -0
- package/package/blocks/image/component-info.d.ts +1 -1
- package/package/blocks/image/component-info.js +33 -63
- package/package/blocks/image/image.helpers.js +2 -11
- package/package/blocks/image/image.svelte.d.ts +0 -1
- package/package/blocks/img/component-info.d.ts +1 -1
- package/package/blocks/img/component-info.js +4 -6
- package/package/blocks/img/img.svelte +4 -29
- package/package/blocks/img/img.svelte.d.ts +3 -1
- package/package/blocks/input/component-info.d.ts +1 -1
- package/package/blocks/input/component-info.js +15 -40
- package/package/blocks/input/input.svelte +4 -29
- package/package/blocks/input/input.svelte.d.ts +3 -1
- package/package/blocks/raw-text/component-info.d.ts +1 -1
- package/package/blocks/raw-text/component-info.js +3 -5
- package/package/blocks/raw-text/raw-text.svelte +3 -5
- package/package/blocks/raw-text/raw-text.svelte.d.ts +1 -1
- package/package/blocks/section/component-info.d.ts +1 -1
- package/package/blocks/section/component-info.js +13 -18
- package/package/blocks/section/section.svelte +4 -29
- package/package/blocks/section/section.svelte.d.ts +3 -1
- package/package/blocks/select/component-info.d.ts +1 -1
- package/package/blocks/select/component-info.js +22 -34
- package/package/blocks/select/select.svelte +4 -29
- package/package/blocks/select/select.svelte.d.ts +3 -1
- package/package/blocks/submit-button/component-info.d.ts +1 -1
- package/package/blocks/submit-button/component-info.js +5 -7
- package/package/blocks/submit-button/submit-button.svelte +4 -29
- package/package/blocks/submit-button/submit-button.svelte.d.ts +3 -1
- package/package/blocks/symbol/component-info.d.ts +1 -1
- package/package/blocks/symbol/component-info.js +12 -17
- package/package/blocks/symbol/symbol.helpers.d.ts +14 -0
- package/package/blocks/symbol/symbol.helpers.js +31 -0
- package/package/blocks/symbol/symbol.svelte +38 -85
- package/package/blocks/symbol/symbol.svelte.d.ts +13 -7
- package/package/blocks/text/component-info.d.ts +1 -1
- package/package/blocks/text/component-info.js +6 -7
- package/package/blocks/text/text.svelte +1 -1
- package/package/blocks/text/text.svelte.d.ts +1 -1
- package/package/blocks/textarea/component-info.d.ts +1 -1
- package/package/blocks/textarea/component-info.js +13 -19
- package/package/blocks/textarea/textarea.svelte +4 -29
- package/package/blocks/textarea/textarea.svelte.d.ts +3 -1
- package/package/blocks/video/component-info.d.ts +1 -1
- package/package/blocks/video/component-info.js +35 -55
- package/package/blocks/video/video.svelte +4 -30
- package/package/blocks/video/video.svelte.d.ts +2 -0
- package/package/components/block/block.helpers.d.ts +13 -0
- package/package/components/{render-block/render-block.helpers.js → block/block.helpers.js} +12 -29
- package/package/components/block/block.svelte +135 -0
- package/package/components/block/block.svelte.d.ts +26 -0
- package/package/components/{render-block → block/components}/block-styles.svelte +21 -23
- package/package/components/{render-block → block/components}/block-styles.svelte.d.ts +2 -2
- package/package/components/block/components/block-wrapper.svelte +53 -0
- package/package/components/block/components/block-wrapper.svelte.d.ts +33 -0
- package/package/components/block/components/component-ref/component-ref.helpers.d.ts +36 -0
- package/package/components/block/components/component-ref/component-ref.helpers.js +22 -0
- package/package/components/block/components/component-ref/component-ref.svelte +37 -0
- package/package/components/block/components/component-ref/component-ref.svelte.d.ts +24 -0
- package/package/components/block/components/interactive-element.svelte +29 -0
- package/package/components/block/components/interactive-element.svelte.d.ts +31 -0
- package/package/components/{render-block/render-repeated-block.svelte → block/components/repeated-block.svelte} +4 -3
- package/package/components/block/components/repeated-block.svelte.d.ts +25 -0
- package/package/components/{render-blocks.svelte → blocks/blocks-wrapper.svelte} +3 -20
- package/package/components/blocks/blocks-wrapper.svelte.d.ts +29 -0
- package/package/components/blocks/blocks.svelte +26 -0
- package/package/components/blocks/blocks.svelte.d.ts +28 -0
- package/package/components/{render-content/render-content.svelte → content/components/enable-editor.svelte} +51 -169
- package/package/components/content/components/enable-editor.svelte.d.ts +36 -0
- package/package/components/{render-content/components/render-styles.helpers.d.ts → content/components/styles.helpers.d.ts} +1 -1
- package/package/components/{render-content/components/render-styles.helpers.js → content/components/styles.helpers.js} +3 -4
- package/package/components/{render-content/components/render-styles.svelte → content/components/styles.svelte} +4 -4
- package/package/components/{render-content/components/render-styles.svelte.d.ts → content/components/styles.svelte.d.ts} +5 -5
- package/package/components/content/content.helpers.d.ts +7 -0
- package/package/components/content/content.helpers.js +30 -0
- package/package/components/content/content.svelte +113 -0
- package/package/components/content/content.svelte.d.ts +30 -0
- package/package/components/content/content.types.d.ts +24 -0
- package/package/components/content/index.d.ts +1 -0
- package/package/components/content/index.js +1 -0
- package/package/components/content-variants/content-variants.svelte +98 -0
- package/package/components/content-variants/content-variants.svelte.d.ts +34 -0
- package/package/components/content-variants/content-variants.types.d.ts +20 -0
- package/package/components/content-variants/helpers.d.ts +41 -0
- package/package/components/{render-content-variants → content-variants}/helpers.js +46 -41
- package/package/components/inlined-script.svelte +7 -0
- package/package/components/inlined-script.svelte.d.ts +21 -0
- package/package/components/inlined-styles.svelte.d.ts +21 -0
- package/package/constants/builder-registered-components.js +34 -13
- package/package/constants/device-sizes.js +9 -8
- package/package/constants/sdk-version.d.ts +1 -1
- package/package/constants/sdk-version.js +1 -1
- package/package/constants/target.d.ts +1 -1
- package/package/context/builder.context.d.ts +1 -1
- package/package/context/builder.context.js +1 -1
- package/package/context/types.d.ts +1 -1
- package/package/functions/apply-patch-with-mutation.d.ts +10 -0
- package/package/functions/apply-patch-with-mutation.js +54 -0
- package/package/functions/evaluate/acorn.d.ts +0 -0
- package/package/functions/evaluate/acorn.js +2433 -0
- package/package/functions/{evaluate.d.ts → evaluate/evaluate.d.ts} +5 -2
- package/package/functions/{evaluate.js → evaluate/evaluate.js} +34 -13
- package/package/functions/evaluate/index.d.ts +1 -0
- package/package/functions/evaluate/index.js +1 -0
- package/package/functions/evaluate/interpreter.d.ts +2 -0
- package/package/functions/evaluate/interpreter.js +3853 -0
- package/package/functions/evaluate/non-node-runtime.d.ts +2 -0
- package/package/functions/evaluate/non-node-runtime.js +84 -0
- package/package/functions/evaluate/types.d.ts +10 -0
- package/package/functions/extract-text-styles.js +2 -14
- package/package/functions/get-block-actions-handler.js +3 -3
- package/package/functions/get-block-actions.d.ts +1 -0
- package/package/functions/get-block-actions.js +14 -1
- package/package/functions/get-block-component-options.js +1 -1
- package/package/functions/get-block-properties.d.ts +5 -1
- package/package/functions/get-block-properties.js +15 -9
- package/package/functions/get-builder-search-params/index.js +3 -7
- package/package/functions/get-content/generate-content-url.js +7 -5
- package/package/functions/get-content/index.d.ts +2 -6
- package/package/functions/get-content/index.js +26 -6
- package/package/functions/get-processed-block.d.ts +1 -1
- package/package/functions/get-processed-block.js +11 -7
- package/package/functions/get-react-native-block-styles.d.ts +1 -1
- package/package/functions/get-react-native-block-styles.js +2 -2
- package/package/functions/if-target.d.ts +1 -1
- package/package/functions/if-target.js +1 -1
- package/package/functions/is-editing.js +1 -3
- package/package/functions/is-non-node-server.d.ts +4 -0
- package/package/functions/is-non-node-server.js +8 -0
- package/package/functions/on-change.js +1 -1
- package/package/functions/register-component.d.ts +2 -1
- package/package/functions/register-component.js +20 -8
- package/package/functions/register.js +2 -2
- package/package/functions/sanitize-react-native-block-styles.js +13 -5
- package/package/functions/set-editor-settings.js +1 -1
- package/package/functions/set.js +2 -9
- package/package/functions/track/helpers.js +6 -11
- package/package/functions/track/index.js +26 -14
- package/package/functions/track/interaction.js +15 -16
- package/package/helpers/ab-tests.d.ts +2 -2
- package/package/helpers/ab-tests.js +48 -30
- package/package/helpers/canTrack.js +1 -1
- package/package/helpers/cookie.d.ts +2 -2
- package/package/helpers/cookie.js +13 -26
- package/package/helpers/css.d.ts +1 -1
- package/package/helpers/css.js +1 -1
- package/package/helpers/flatten.js +8 -8
- package/package/helpers/localStorage.d.ts +2 -2
- package/package/helpers/localStorage.js +2 -2
- package/package/helpers/logger.js +1 -1
- package/package/helpers/preview-lru-cache/get.d.ts +1 -0
- package/package/helpers/preview-lru-cache/get.js +7 -0
- package/package/helpers/preview-lru-cache/helpers.d.ts +1 -0
- package/package/helpers/preview-lru-cache/helpers.js +9 -0
- package/package/helpers/preview-lru-cache/init.d.ts +6 -0
- package/package/helpers/preview-lru-cache/init.js +15 -0
- package/package/helpers/preview-lru-cache/set.d.ts +7 -0
- package/package/helpers/preview-lru-cache/set.js +9 -0
- package/package/helpers/preview-lru-cache/types.d.ts +12 -0
- package/package/helpers/preview-lru-cache/types.js +6 -0
- package/package/helpers/sessionId.d.ts +2 -2
- package/package/helpers/sessionId.js +11 -4
- package/package/helpers/uuid.js +1 -1
- package/package/helpers/visitorId.d.ts +1 -1
- package/package/helpers/visitorId.js +7 -4
- package/package/index-helpers/blocks-exports.d.ts +2 -2
- package/package/index-helpers/blocks-exports.js +2 -2
- package/package/index.d.ts +2 -2
- package/package/index.js +1 -1
- package/package/scripts/init-editing.js +65 -57
- package/package/types/builder-props.d.ts +10 -0
- package/package/types/components.d.ts +8 -2
- package/package/types/enforced-partials.d.ts +21 -0
- package/package/types/targets.d.ts +1 -3
- package/package/types/typescript.d.ts +6 -0
- package/package.json +2 -2
- package/src/blocks/BaseText.svelte +1 -1
- package/src/blocks/button/button.svelte +21 -34
- package/src/blocks/button/component-info.ts +20 -27
- package/src/blocks/columns/columns.svelte +28 -32
- package/src/blocks/columns/component-info.ts +205 -240
- package/src/blocks/custom-code/component-info.ts +20 -27
- package/src/blocks/embed/component-info.ts +34 -51
- package/src/blocks/embed/helpers.ts +2 -8
- package/src/blocks/form/component-info.ts +204 -253
- package/src/blocks/form/form.svelte +1 -368
- package/src/blocks/fragment/component-info.ts +3 -5
- package/src/blocks/helpers.ts +43 -0
- package/src/blocks/image/component-info.ts +113 -161
- package/src/blocks/image/image.helpers.ts +5 -33
- package/src/blocks/img/component-info.ts +11 -16
- package/src/blocks/img/img.svelte +7 -31
- package/src/blocks/input/component-info.ts +35 -66
- package/src/blocks/input/input.svelte +7 -31
- package/src/blocks/raw-text/component-info.ts +8 -12
- package/src/blocks/raw-text/raw-text.svelte +2 -5
- package/src/blocks/section/component-info.ts +28 -37
- package/src/blocks/section/section.svelte +7 -30
- package/src/blocks/select/component-info.ts +38 -55
- package/src/blocks/select/select.svelte +7 -31
- package/src/blocks/submit-button/component-info.ts +10 -15
- package/src/blocks/submit-button/submit-button.svelte +7 -30
- package/src/blocks/symbol/component-info.ts +31 -39
- package/src/blocks/symbol/symbol.helpers.ts +47 -0
- package/src/blocks/symbol/symbol.svelte +51 -95
- package/src/blocks/text/component-info.ts +14 -18
- package/src/blocks/text/text.svelte +2 -2
- package/src/blocks/textarea/component-info.ts +26 -36
- package/src/blocks/textarea/textarea.svelte +7 -30
- package/src/blocks/video/component-info.ts +77 -103
- package/src/blocks/video/video.svelte +4 -31
- package/src/components/{render-block/render-block.helpers.ts → block/block.helpers.ts} +22 -49
- package/src/components/block/block.svelte +158 -0
- package/src/components/{render-block → block/components}/block-styles.svelte +24 -25
- package/src/components/block/components/block-wrapper.svelte +70 -0
- package/src/components/block/components/component-ref/component-ref.helpers.ts +53 -0
- package/src/components/block/components/component-ref/component-ref.svelte +41 -0
- package/src/components/block/components/interactive-element.svelte +42 -0
- package/src/components/block/components/repeated-block.svelte +30 -0
- package/src/components/{render-block → block}/types.ts +1 -2
- package/src/components/{render-blocks.svelte → blocks/blocks-wrapper.svelte} +14 -32
- package/src/components/blocks/blocks.svelte +39 -0
- package/src/components/{render-content/render-content.svelte → content/components/enable-editor.svelte} +75 -202
- package/src/components/{render-content/components/render-styles.helpers.ts → content/components/styles.helpers.ts} +9 -11
- package/src/components/{render-content/components/render-styles.svelte → content/components/styles.svelte} +5 -5
- package/src/components/content/content.helpers.ts +42 -0
- package/src/components/content/content.svelte +138 -0
- package/src/components/content/content.types.ts +23 -0
- package/src/components/content/index.ts +1 -0
- package/src/components/{render-content → content}/wrap-component-ref.ts +1 -1
- package/src/components/content-variants/content-variants.svelte +120 -0
- package/src/components/content-variants/content-variants.types.ts +20 -0
- package/src/components/{render-content-variants → content-variants}/helpers.ts +53 -94
- package/src/components/inlined-script.svelte +13 -0
- package/src/constants/builder-registered-components.ts +34 -14
- package/src/constants/device-sizes.ts +16 -22
- package/src/constants/sdk-version.ts +1 -1
- package/src/constants/target.ts +3 -1
- package/src/context/builder.context.ts +1 -1
- package/src/context/types.ts +2 -7
- package/src/functions/apply-patch-with-mutation.ts +61 -0
- package/src/functions/camel-to-kebab-case.ts +1 -2
- package/src/functions/evaluate/acorn.ts +2501 -0
- package/src/functions/evaluate/evaluate.ts +90 -0
- package/src/functions/evaluate/index.ts +1 -0
- package/src/functions/evaluate/interpreter.ts +3887 -0
- package/src/functions/evaluate/non-node-runtime.ts +94 -0
- package/src/functions/evaluate/types.ts +10 -0
- package/src/functions/extract-text-styles.ts +3 -18
- package/src/functions/fast-clone.ts +1 -2
- package/src/functions/get-block-actions-handler.ts +11 -20
- package/src/functions/get-block-actions.ts +22 -14
- package/src/functions/get-block-component-options.ts +2 -3
- package/src/functions/get-block-properties.ts +24 -17
- package/src/functions/get-builder-search-params/index.ts +5 -21
- package/src/functions/get-content/generate-content-url.ts +10 -25
- package/src/functions/get-content/index.ts +34 -37
- package/src/functions/get-content/types.ts +4 -2
- package/src/functions/get-fetch.ts +3 -10
- package/src/functions/get-global-this.ts +1 -2
- package/src/functions/get-processed-block.ts +14 -21
- package/src/functions/get-react-native-block-styles.ts +6 -12
- package/src/functions/if-target.ts +2 -3
- package/src/functions/is-browser.ts +1 -1
- package/src/functions/is-editing.ts +2 -7
- package/src/functions/is-iframe.ts +1 -2
- package/src/functions/is-non-node-server.ts +9 -0
- package/src/functions/is-previewing.ts +1 -4
- package/src/functions/on-change.ts +2 -2
- package/src/functions/register-component.ts +24 -26
- package/src/functions/register.ts +6 -8
- package/src/functions/sanitize-react-native-block-styles.ts +17 -24
- package/src/functions/set-editor-settings.ts +5 -6
- package/src/functions/set.ts +3 -15
- package/src/functions/track/helpers.ts +8 -24
- package/src/functions/track/index.ts +37 -42
- package/src/functions/track/interaction.ts +21 -38
- package/src/functions/transform-block-properties.ts +1 -1
- package/src/functions/transform-block.ts +1 -1
- package/src/helpers/ab-tests.ts +69 -78
- package/src/helpers/canTrack.ts +2 -4
- package/src/helpers/cookie.ts +15 -46
- package/src/helpers/css.ts +4 -13
- package/src/helpers/flatten.ts +11 -16
- package/src/helpers/localStorage.ts +4 -8
- package/src/helpers/logger.ts +2 -2
- package/src/helpers/nullable.ts +1 -3
- package/src/helpers/preview-lru-cache/get.ts +8 -0
- package/src/helpers/preview-lru-cache/helpers.ts +9 -0
- package/src/helpers/preview-lru-cache/init.ts +17 -0
- package/src/helpers/preview-lru-cache/set.ts +18 -0
- package/src/helpers/preview-lru-cache/types.ts +12 -0
- package/src/helpers/sessionId.ts +12 -13
- package/src/helpers/time.ts +1 -3
- package/src/helpers/url.ts +1 -2
- package/src/helpers/uuid.ts +3 -3
- package/src/helpers/visitorId.ts +14 -17
- package/src/index-helpers/blocks-exports.ts +2 -2
- package/src/index-helpers/top-of-file.ts +1 -1
- package/src/index.ts +2 -13
- package/src/scripts/init-editing.ts +85 -98
- package/src/types/api-version.ts +1 -1
- package/src/types/builder-block.ts +1 -3
- package/src/types/builder-content.ts +7 -4
- package/src/types/builder-props.ts +10 -0
- package/src/types/can-track.ts +1 -1
- package/src/types/components.ts +17 -13
- package/src/types/deep-partial.ts +1 -7
- package/src/types/element.ts +1 -3
- package/src/types/enforced-partials.ts +13 -0
- package/src/types/input.ts +6 -9
- package/src/types/targets.ts +1 -6
- package/src/types/typescript.ts +10 -5
- package/package/blocks/util.d.ts +0 -4
- package/package/blocks/util.js +0 -13
- package/package/components/render-block/render-block.helpers.d.ts +0 -12
- package/package/components/render-block/render-block.svelte +0 -152
- package/package/components/render-block/render-block.svelte.d.ts +0 -24
- package/package/components/render-block/render-component.svelte +0 -21
- package/package/components/render-block/render-component.svelte.d.ts +0 -34
- package/package/components/render-block/render-repeated-block.svelte.d.ts +0 -23
- package/package/components/render-blocks.svelte.d.ts +0 -26
- package/package/components/render-content/builder-editing.svelte +0 -4
- package/package/components/render-content/builder-editing.svelte.d.ts +0 -14
- package/package/components/render-content/index.d.ts +0 -1
- package/package/components/render-content/index.js +0 -1
- package/package/components/render-content/render-content.helpers.d.ts +0 -7
- package/package/components/render-content/render-content.helpers.js +0 -30
- package/package/components/render-content/render-content.svelte.d.ts +0 -31
- package/package/components/render-content/render-content.types.d.ts +0 -38
- package/package/components/render-content-variants/helpers.d.ts +0 -17
- package/package/components/render-content-variants/render-content-variants.svelte +0 -70
- package/package/components/render-content-variants/render-content-variants.svelte.d.ts +0 -23
- package/package/components/render-inlined-styles.svelte.d.ts +0 -21
- package/package/functions/evaluate.test.js +0 -17
- package/package/functions/get-builder-search-params/fn.test.js +0 -13
- package/package/functions/get-content/generate-content-url.test.js +0 -97
- package/package/functions/get-processed-block.test.js +0 -33
- package/package/functions/on-change.test.d.ts +0 -1
- package/package/functions/on-change.test.js +0 -20
- package/package/functions/set.test.d.ts +0 -1
- package/package/functions/set.test.js +0 -16
- package/package/helpers/url.test.d.ts +0 -1
- package/package/helpers/url.test.js +0 -21
- package/src/blocks/util.ts +0 -18
- package/src/components/render-block/render-block.svelte +0 -173
- package/src/components/render-block/render-component.svelte +0 -40
- package/src/components/render-block/render-repeated-block.svelte +0 -25
- package/src/components/render-content/builder-editing.svelte +0 -4
- package/src/components/render-content/index.ts +0 -1
- package/src/components/render-content/render-content.helpers.ts +0 -48
- package/src/components/render-content/render-content.types.ts +0 -42
- package/src/components/render-content-variants/render-content-variants.svelte +0 -83
- package/src/functions/evaluate.test.ts +0 -21
- package/src/functions/evaluate.ts +0 -99
- package/src/functions/get-builder-search-params/fn.test.ts +0 -19
- package/src/functions/get-content/generate-content-url.test.ts +0 -112
- package/src/functions/get-processed-block.test.ts +0 -35
- package/src/functions/on-change.test.ts +0 -23
- package/src/functions/set.test.ts +0 -19
- package/src/helpers/url.test.ts +0 -23
- /package/package/components/{render-block → block}/types.d.ts +0 -0
- /package/package/components/{render-block → block}/types.js +0 -0
- /package/package/{functions/evaluate.test.d.ts → components/content/content.types.js} +0 -0
- /package/package/components/{render-content → content}/wrap-component-ref.d.ts +0 -0
- /package/package/components/{render-content → content}/wrap-component-ref.js +0 -0
- /package/package/components/{render-content/render-content.types.js → content-variants/content-variants.types.js} +0 -0
- /package/package/components/{render-inlined-styles.svelte → inlined-styles.svelte} +0 -0
- /package/package/functions/{get-builder-search-params/fn.test.d.ts → evaluate/types.js} +0 -0
- /package/package/{functions/get-content/generate-content-url.test.d.ts → types/builder-props.js} +0 -0
- /package/package/{functions/get-processed-block.test.d.ts → types/enforced-partials.js} +0 -0
- /package/src/components/{render-inlined-styles.svelte → inlined-styles.svelte} +0 -0
|
@@ -1,41 +1,31 @@
|
|
|
1
1
|
<script context="module"></script>
|
|
2
2
|
|
|
3
|
-
<script>import { getMaxWidthQueryForSize, getSizesForBreakpoints, } from "
|
|
4
|
-
import { TARGET } from "
|
|
5
|
-
import { getProcessedBlock } from "
|
|
6
|
-
import { createCssClass } from "
|
|
7
|
-
import { checkIsDefined } from "
|
|
8
|
-
import
|
|
3
|
+
<script>import { getMaxWidthQueryForSize, getSizesForBreakpoints, } from "../../../constants/device-sizes.js";
|
|
4
|
+
import { TARGET } from "../../../constants/target.js";
|
|
5
|
+
import { getProcessedBlock } from "../../../functions/get-processed-block.js";
|
|
6
|
+
import { createCssClass } from "../../../helpers/css.js";
|
|
7
|
+
import { checkIsDefined } from "../../../helpers/nullable.js";
|
|
8
|
+
import InlinedStyles from "../../inlined-styles.svelte";
|
|
9
9
|
export let block;
|
|
10
10
|
export let context;
|
|
11
|
-
$: useBlock = () => {
|
|
12
|
-
return getProcessedBlock({
|
|
13
|
-
block: block,
|
|
14
|
-
localState: context.localState,
|
|
15
|
-
rootState: context.rootState,
|
|
16
|
-
rootSetState: context.rootSetState,
|
|
17
|
-
context: context.context,
|
|
18
|
-
shouldEvaluateBindings: true,
|
|
19
|
-
});
|
|
20
|
-
};
|
|
21
11
|
$: canShowBlock = () => {
|
|
22
12
|
// only render styles for blocks that are visible
|
|
23
|
-
if (checkIsDefined(
|
|
24
|
-
return !
|
|
13
|
+
if (checkIsDefined(processedBlock.hide)) {
|
|
14
|
+
return !processedBlock.hide;
|
|
25
15
|
}
|
|
26
|
-
if (checkIsDefined(
|
|
27
|
-
return
|
|
16
|
+
if (checkIsDefined(processedBlock.show)) {
|
|
17
|
+
return processedBlock.show;
|
|
28
18
|
}
|
|
29
19
|
return true;
|
|
30
20
|
};
|
|
31
21
|
$: css = () => {
|
|
32
|
-
const styles =
|
|
22
|
+
const styles = processedBlock.responsiveStyles;
|
|
33
23
|
const content = context.content;
|
|
34
24
|
const sizesWithUpdatedBreakpoints = getSizesForBreakpoints(content?.meta?.breakpoints || {});
|
|
35
25
|
const largeStyles = styles?.large;
|
|
36
26
|
const mediumStyles = styles?.medium;
|
|
37
27
|
const smallStyles = styles?.small;
|
|
38
|
-
const className =
|
|
28
|
+
const className = processedBlock.id;
|
|
39
29
|
if (!className) {
|
|
40
30
|
return "";
|
|
41
31
|
}
|
|
@@ -61,8 +51,16 @@ $: css = () => {
|
|
|
61
51
|
: "";
|
|
62
52
|
return [largeStylesClass, mediumStylesClass, smallStylesClass].join(" ");
|
|
63
53
|
};
|
|
54
|
+
let processedBlock = getProcessedBlock({
|
|
55
|
+
block: block,
|
|
56
|
+
localState: context.localState,
|
|
57
|
+
rootState: context.rootState,
|
|
58
|
+
rootSetState: context.rootSetState,
|
|
59
|
+
context: context.context,
|
|
60
|
+
shouldEvaluateBindings: true,
|
|
61
|
+
});
|
|
64
62
|
</script>
|
|
65
63
|
|
|
66
64
|
{#if TARGET !== "reactNative" && css() && canShowBlock()}
|
|
67
|
-
<
|
|
65
|
+
<InlinedStyles styles={css()} />
|
|
68
66
|
{/if}
|
|
@@ -3,8 +3,8 @@ export type BlockStylesProps = {
|
|
|
3
3
|
block: BuilderBlock;
|
|
4
4
|
context: BuilderContextInterface;
|
|
5
5
|
};
|
|
6
|
-
import type { BuilderContextInterface } from "
|
|
7
|
-
import type { BuilderBlock } from "
|
|
6
|
+
import type { BuilderContextInterface } from "../../../context/types.js";
|
|
7
|
+
import type { BuilderBlock } from "../../../types/builder-block.js";
|
|
8
8
|
declare const __propDef: {
|
|
9
9
|
props: {
|
|
10
10
|
block: BlockStylesProps["block"];
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
<script context="module">/**
|
|
2
|
+
* This component renders a block's wrapper HTML element (from the block's `tagName` property).
|
|
3
|
+
* It reuses the exact same logic as the `InteractiveElement` component, but we need to have 2 separate components for
|
|
4
|
+
* Svelte's sake, as it needs to know at compile-time whether to use:
|
|
5
|
+
* - `<svelte:element>` (for HTML element) or
|
|
6
|
+
* - `<svelte:component>` (for custom components)
|
|
7
|
+
*/
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<script>import { getBlockActions } from "../../../functions/get-block-actions.js";
|
|
11
|
+
import { getBlockProperties } from "../../../functions/get-block-properties.js";
|
|
12
|
+
import { setAttrs } from "../../../blocks/helpers.js";
|
|
13
|
+
export let Wrapper;
|
|
14
|
+
export let block;
|
|
15
|
+
export let context;
|
|
16
|
+
export let hasChildren;
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
{#if hasChildren}
|
|
20
|
+
<svelte:element
|
|
21
|
+
this={Wrapper}
|
|
22
|
+
{...getBlockProperties({
|
|
23
|
+
block: block,
|
|
24
|
+
context: $context,
|
|
25
|
+
})}
|
|
26
|
+
use:setAttrs={getBlockActions({
|
|
27
|
+
block: block,
|
|
28
|
+
rootState: $context.rootState,
|
|
29
|
+
rootSetState: $context.rootSetState,
|
|
30
|
+
localState: $context.localState,
|
|
31
|
+
context: $context.context,
|
|
32
|
+
stripPrefix: true,
|
|
33
|
+
})}
|
|
34
|
+
>
|
|
35
|
+
<slot />
|
|
36
|
+
</svelte:element>
|
|
37
|
+
{:else}
|
|
38
|
+
<svelte:element
|
|
39
|
+
this={Wrapper}
|
|
40
|
+
{...getBlockProperties({
|
|
41
|
+
block: block,
|
|
42
|
+
context: $context,
|
|
43
|
+
})}
|
|
44
|
+
use:setAttrs={getBlockActions({
|
|
45
|
+
block: block,
|
|
46
|
+
rootState: $context.rootState,
|
|
47
|
+
rootSetState: $context.rootSetState,
|
|
48
|
+
localState: $context.localState,
|
|
49
|
+
context: $context.context,
|
|
50
|
+
stripPrefix: true,
|
|
51
|
+
})}
|
|
52
|
+
/>
|
|
53
|
+
{/if}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
/**
|
|
3
|
+
* This import is used by the Svelte SDK. Do not remove.
|
|
4
|
+
*/ type BlockWrapperProps = {
|
|
5
|
+
Wrapper: string;
|
|
6
|
+
block: BuilderBlock;
|
|
7
|
+
context: Writable<BuilderContextInterface>;
|
|
8
|
+
hasChildren: boolean;
|
|
9
|
+
};
|
|
10
|
+
import type { PropsWithChildren } from "../../../types/typescript.js";
|
|
11
|
+
import type { BuilderBlock } from "../../../types/builder-block.js";
|
|
12
|
+
import type { BuilderContextInterface } from "../../../context/types.js";
|
|
13
|
+
import type { Writable } from "svelte/store";
|
|
14
|
+
declare const __propDef: {
|
|
15
|
+
props: {
|
|
16
|
+
Wrapper: PropsWithChildren<BlockWrapperProps>["Wrapper"];
|
|
17
|
+
block: PropsWithChildren<BlockWrapperProps>["block"];
|
|
18
|
+
context: PropsWithChildren<BlockWrapperProps>["context"];
|
|
19
|
+
hasChildren: PropsWithChildren<BlockWrapperProps>["hasChildren"];
|
|
20
|
+
};
|
|
21
|
+
events: {
|
|
22
|
+
[evt: string]: CustomEvent<any>;
|
|
23
|
+
};
|
|
24
|
+
slots: {
|
|
25
|
+
default: {};
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
export type BlockWrapperProps = typeof __propDef.props;
|
|
29
|
+
export type BlockWrapperEvents = typeof __propDef.events;
|
|
30
|
+
export type BlockWrapperSlots = typeof __propDef.slots;
|
|
31
|
+
export default class BlockWrapper extends SvelteComponentTyped<BlockWrapperProps, BlockWrapperEvents, BlockWrapperSlots> {
|
|
32
|
+
}
|
|
33
|
+
export {};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { Writable } from "svelte/store";
|
|
2
|
+
import type { BuilderContextInterface, RegisteredComponents } from '../../../../context/types.js';
|
|
3
|
+
import type { BuilderBlock } from '../../../../types/builder-block.js';
|
|
4
|
+
import type { PropsWithBuilderData } from '../../../../types/builder-props.js';
|
|
5
|
+
import type { InteractiveElementProps } from '../interactive-element.svelte';
|
|
6
|
+
type ComponentOptions = PropsWithBuilderData<{
|
|
7
|
+
[index: string]: any;
|
|
8
|
+
attributes?: {
|
|
9
|
+
[index: string]: any;
|
|
10
|
+
};
|
|
11
|
+
}>;
|
|
12
|
+
export interface ComponentProps {
|
|
13
|
+
componentRef: any;
|
|
14
|
+
componentOptions: ComponentOptions;
|
|
15
|
+
blockChildren: BuilderBlock[];
|
|
16
|
+
context: Writable<BuilderContextInterface>;
|
|
17
|
+
registeredComponents: RegisteredComponents;
|
|
18
|
+
builderBlock: BuilderBlock;
|
|
19
|
+
includeBlockProps: boolean;
|
|
20
|
+
isInteractive: boolean | undefined;
|
|
21
|
+
}
|
|
22
|
+
export declare const getWrapperProps: ({ componentOptions, builderBlock, context, componentRef, includeBlockProps, isInteractive, contextValue }: Omit<ComponentProps, "registeredComponents" | "blockChildren"> & {
|
|
23
|
+
contextValue: BuilderContextInterface;
|
|
24
|
+
}) => InteractiveElementProps | {
|
|
25
|
+
attributes?: {
|
|
26
|
+
'builder-id': string | undefined;
|
|
27
|
+
style: string | Partial<CSSStyleDeclaration> | undefined;
|
|
28
|
+
class: string;
|
|
29
|
+
href: any;
|
|
30
|
+
} | {
|
|
31
|
+
[index: string]: any;
|
|
32
|
+
} | undefined;
|
|
33
|
+
builderBlock: BuilderBlock;
|
|
34
|
+
builderContext: Writable<BuilderContextInterface>;
|
|
35
|
+
};
|
|
36
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { getBlockProperties } from '../../../../functions/get-block-properties.js';
|
|
2
|
+
export const getWrapperProps = ({ componentOptions, builderBlock, context, componentRef, includeBlockProps, isInteractive, contextValue }) => {
|
|
3
|
+
const interactiveElementProps = {
|
|
4
|
+
Wrapper: componentRef,
|
|
5
|
+
block: builderBlock,
|
|
6
|
+
context,
|
|
7
|
+
wrapperProps: componentOptions
|
|
8
|
+
};
|
|
9
|
+
return isInteractive ? interactiveElementProps : {
|
|
10
|
+
...componentOptions,
|
|
11
|
+
/**
|
|
12
|
+
* If `noWrap` is set to `true`, then the block's props/attributes are provided to the
|
|
13
|
+
* component itself directly. Otherwise, they are provided to the wrapper element.
|
|
14
|
+
*/
|
|
15
|
+
...(includeBlockProps ? {
|
|
16
|
+
attributes: getBlockProperties({
|
|
17
|
+
block: builderBlock,
|
|
18
|
+
context: contextValue
|
|
19
|
+
})
|
|
20
|
+
} : {})
|
|
21
|
+
};
|
|
22
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
<script>import BlockStyles from "../block-styles.svelte";
|
|
2
|
+
import Block from "../../block.svelte";
|
|
3
|
+
import InteractiveElement from "../interactive-element.svelte";
|
|
4
|
+
import { getWrapperProps } from "./component-ref.helpers.js";
|
|
5
|
+
export let isInteractive;
|
|
6
|
+
export let componentRef;
|
|
7
|
+
export let componentOptions;
|
|
8
|
+
export let builderBlock;
|
|
9
|
+
export let context;
|
|
10
|
+
export let includeBlockProps;
|
|
11
|
+
export let blockChildren;
|
|
12
|
+
export let registeredComponents;
|
|
13
|
+
let Wrapper = isInteractive ? InteractiveElement : componentRef;
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
{#if componentRef}
|
|
17
|
+
<svelte:component
|
|
18
|
+
this={Wrapper}
|
|
19
|
+
{...getWrapperProps({
|
|
20
|
+
componentOptions: componentOptions,
|
|
21
|
+
builderBlock: builderBlock,
|
|
22
|
+
context: context,
|
|
23
|
+
componentRef: componentRef,
|
|
24
|
+
includeBlockProps: includeBlockProps,
|
|
25
|
+
isInteractive: isInteractive,
|
|
26
|
+
contextValue: $context,
|
|
27
|
+
})}
|
|
28
|
+
>
|
|
29
|
+
{#each blockChildren as child ("block-" + child.id)}
|
|
30
|
+
<Block block={child} {context} {registeredComponents} />
|
|
31
|
+
{/each}
|
|
32
|
+
|
|
33
|
+
{#each blockChildren as child ("block-style-" + child.id)}
|
|
34
|
+
<BlockStyles block={child} context={$context} />
|
|
35
|
+
{/each}
|
|
36
|
+
</svelte:component>
|
|
37
|
+
{/if}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import type { ComponentProps } from "./component-ref.helpers.js";
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
isInteractive: ComponentProps["isInteractive"];
|
|
6
|
+
componentRef: ComponentProps["componentRef"];
|
|
7
|
+
componentOptions: ComponentProps["componentOptions"];
|
|
8
|
+
builderBlock: ComponentProps["builderBlock"];
|
|
9
|
+
context: ComponentProps["context"];
|
|
10
|
+
includeBlockProps: ComponentProps["includeBlockProps"];
|
|
11
|
+
blockChildren: ComponentProps["blockChildren"];
|
|
12
|
+
registeredComponents: ComponentProps["registeredComponents"];
|
|
13
|
+
};
|
|
14
|
+
events: {
|
|
15
|
+
[evt: string]: CustomEvent<any>;
|
|
16
|
+
};
|
|
17
|
+
slots: {};
|
|
18
|
+
};
|
|
19
|
+
export type ComponentRefProps = typeof __propDef.props;
|
|
20
|
+
export type ComponentRefEvents = typeof __propDef.events;
|
|
21
|
+
export type ComponentRefSlots = typeof __propDef.slots;
|
|
22
|
+
export default class ComponentRef extends SvelteComponentTyped<ComponentRefProps, ComponentRefEvents, ComponentRefSlots> {
|
|
23
|
+
}
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<script context="module"></script>
|
|
2
|
+
|
|
3
|
+
<script>import { getBlockActions } from "../../../functions/get-block-actions.js";
|
|
4
|
+
import { getBlockProperties } from "../../../functions/get-block-properties.js";
|
|
5
|
+
export let Wrapper;
|
|
6
|
+
export let wrapperProps;
|
|
7
|
+
export let block;
|
|
8
|
+
export let context;
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<svelte:component
|
|
12
|
+
this={Wrapper}
|
|
13
|
+
{...wrapperProps}
|
|
14
|
+
attributes={{
|
|
15
|
+
...getBlockProperties({
|
|
16
|
+
block: block,
|
|
17
|
+
context: $context,
|
|
18
|
+
}),
|
|
19
|
+
...getBlockActions({
|
|
20
|
+
block: block,
|
|
21
|
+
rootState: $context.rootState,
|
|
22
|
+
rootSetState: $context.rootSetState,
|
|
23
|
+
localState: $context.localState,
|
|
24
|
+
context: $context.context,
|
|
25
|
+
}),
|
|
26
|
+
}}
|
|
27
|
+
>
|
|
28
|
+
<slot />
|
|
29
|
+
</svelte:component>
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
export type InteractiveElementProps = {
|
|
3
|
+
Wrapper: any;
|
|
4
|
+
block: BuilderBlock;
|
|
5
|
+
context: Writable<BuilderContextInterface>;
|
|
6
|
+
wrapperProps: object;
|
|
7
|
+
};
|
|
8
|
+
import type { BuilderContextInterface } from "../../../context/types.js";
|
|
9
|
+
import type { BuilderBlock } from "../../../types/builder-block.js";
|
|
10
|
+
import type { PropsWithChildren } from "../../../types/typescript.js";
|
|
11
|
+
import type { Writable } from "svelte/store";
|
|
12
|
+
declare const __propDef: {
|
|
13
|
+
props: {
|
|
14
|
+
Wrapper: PropsWithChildren<InteractiveElementProps>["Wrapper"];
|
|
15
|
+
wrapperProps: PropsWithChildren<InteractiveElementProps>["wrapperProps"];
|
|
16
|
+
block: PropsWithChildren<InteractiveElementProps>["block"];
|
|
17
|
+
context: PropsWithChildren<InteractiveElementProps>["context"];
|
|
18
|
+
};
|
|
19
|
+
events: {
|
|
20
|
+
[evt: string]: CustomEvent<any>;
|
|
21
|
+
};
|
|
22
|
+
slots: {
|
|
23
|
+
default: {};
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
export type InteractiveElementProps = typeof __propDef.props;
|
|
27
|
+
export type InteractiveElementEvents = typeof __propDef.events;
|
|
28
|
+
export type InteractiveElementSlots = typeof __propDef.slots;
|
|
29
|
+
export default class InteractiveElement extends SvelteComponentTyped<InteractiveElementProps, InteractiveElementEvents, InteractiveElementSlots> {
|
|
30
|
+
}
|
|
31
|
+
export {};
|
|
@@ -2,12 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
<script>import { setContext } from "svelte";
|
|
4
4
|
import { writable } from "svelte/store";
|
|
5
|
-
import BuilderContext from "
|
|
6
|
-
import
|
|
5
|
+
import BuilderContext from "../../../context/builder.context";
|
|
6
|
+
import Block from "../block.svelte";
|
|
7
7
|
export let repeatContext;
|
|
8
8
|
export let block;
|
|
9
|
+
export let registeredComponents;
|
|
9
10
|
let store = writable(repeatContext);
|
|
10
11
|
setContext(BuilderContext.key, store);
|
|
11
12
|
</script>
|
|
12
13
|
|
|
13
|
-
<
|
|
14
|
+
<Block {block} context={store} {registeredComponents} />
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
type Props = {
|
|
3
|
+
block: BuilderBlock;
|
|
4
|
+
repeatContext: BuilderContextInterface;
|
|
5
|
+
registeredComponents: RegisteredComponents;
|
|
6
|
+
};
|
|
7
|
+
import type { BuilderContextInterface, RegisteredComponents } from "../../../context/types.js";
|
|
8
|
+
import type { BuilderBlock } from "../../../types/builder-block.js";
|
|
9
|
+
declare const __propDef: {
|
|
10
|
+
props: {
|
|
11
|
+
repeatContext: Props["repeatContext"];
|
|
12
|
+
block: Props["block"];
|
|
13
|
+
registeredComponents: Props["registeredComponents"];
|
|
14
|
+
};
|
|
15
|
+
events: {
|
|
16
|
+
[evt: string]: CustomEvent<any>;
|
|
17
|
+
};
|
|
18
|
+
slots: {};
|
|
19
|
+
};
|
|
20
|
+
export type RepeatedBlockProps = typeof __propDef.props;
|
|
21
|
+
export type RepeatedBlockEvents = typeof __propDef.events;
|
|
22
|
+
export type RepeatedBlockSlots = typeof __propDef.slots;
|
|
23
|
+
export default class RepeatedBlock extends SvelteComponentTyped<RepeatedBlockProps, RepeatedBlockEvents, RepeatedBlockSlots> {
|
|
24
|
+
}
|
|
25
|
+
export {};
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
<script context="module"></script>
|
|
2
2
|
|
|
3
|
-
<script>import {
|
|
4
|
-
import BuilderContext from "../context/builder.context.js";
|
|
5
|
-
import { isEditing } from "../functions/is-editing.js";
|
|
6
|
-
import BlockStyles from "./render-block/block-styles.svelte";
|
|
7
|
-
import RenderBlock from "./render-block/render-block.svelte";
|
|
3
|
+
<script>import { isEditing } from "../../functions/is-editing.js";
|
|
8
4
|
export let blocks;
|
|
9
5
|
export let parent;
|
|
10
6
|
export let path;
|
|
@@ -19,7 +15,6 @@ function mitosis_styling(node, vars) {
|
|
|
19
15
|
}
|
|
20
16
|
});
|
|
21
17
|
}
|
|
22
|
-
let builderContext = getContext(BuilderContext.key);
|
|
23
18
|
function onClick() {
|
|
24
19
|
if (isEditing() && !blocks?.length) {
|
|
25
20
|
window.parent?.postMessage({
|
|
@@ -52,9 +47,7 @@ $: className = () => {
|
|
|
52
47
|
class={className() + " div"}
|
|
53
48
|
builder-path={path}
|
|
54
49
|
builder-parent-id={parent}
|
|
55
|
-
|
|
56
|
-
class: className(),
|
|
57
|
-
}}
|
|
50
|
+
{...{}}
|
|
58
51
|
on:click={(event) => {
|
|
59
52
|
onClick();
|
|
60
53
|
}}
|
|
@@ -65,17 +58,7 @@ $: className = () => {
|
|
|
65
58
|
onClick();
|
|
66
59
|
}}
|
|
67
60
|
>
|
|
68
|
-
|
|
69
|
-
{#each blocks as block ("render-block-" + block.id)}
|
|
70
|
-
<RenderBlock {block} context={builderContext} />
|
|
71
|
-
{/each}
|
|
72
|
-
{/if}
|
|
73
|
-
|
|
74
|
-
{#if blocks}
|
|
75
|
-
{#each blocks as block ("block-style-" + block.id)}
|
|
76
|
-
<BlockStyles {block} context={$builderContext} />
|
|
77
|
-
{/each}
|
|
78
|
-
{/if}
|
|
61
|
+
<slot />
|
|
79
62
|
</div>
|
|
80
63
|
|
|
81
64
|
<style>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
export type BlocksWrapperProps = {
|
|
3
|
+
blocks: BuilderBlock[] | undefined;
|
|
4
|
+
parent: string | undefined;
|
|
5
|
+
path: string | undefined;
|
|
6
|
+
styleProp: Record<string, any> | undefined;
|
|
7
|
+
};
|
|
8
|
+
import type { BuilderBlock } from "../../types/builder-block.js";
|
|
9
|
+
import type { PropsWithChildren } from "../../types/typescript.js";
|
|
10
|
+
declare const __propDef: {
|
|
11
|
+
props: {
|
|
12
|
+
blocks: PropsWithChildren<BlocksWrapperProps>["blocks"];
|
|
13
|
+
parent: PropsWithChildren<BlocksWrapperProps>["parent"];
|
|
14
|
+
path: PropsWithChildren<BlocksWrapperProps>["path"];
|
|
15
|
+
styleProp: PropsWithChildren<BlocksWrapperProps>["styleProp"];
|
|
16
|
+
};
|
|
17
|
+
events: {
|
|
18
|
+
[evt: string]: CustomEvent<any>;
|
|
19
|
+
};
|
|
20
|
+
slots: {
|
|
21
|
+
default: {};
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
export type BlocksWrapperProps = typeof __propDef.props;
|
|
25
|
+
export type BlocksWrapperEvents = typeof __propDef.events;
|
|
26
|
+
export type BlocksWrapperSlots = typeof __propDef.slots;
|
|
27
|
+
export default class BlocksWrapper extends SvelteComponentTyped<BlocksWrapperProps, BlocksWrapperEvents, BlocksWrapperSlots> {
|
|
28
|
+
}
|
|
29
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<script context="module"></script>
|
|
2
|
+
|
|
3
|
+
<script>import BlockStyles from "../block/components/block-styles.svelte";
|
|
4
|
+
import Block from "../block/block.svelte";
|
|
5
|
+
import BlocksWrapper from "./blocks-wrapper.svelte";
|
|
6
|
+
export let blocks;
|
|
7
|
+
export let parent;
|
|
8
|
+
export let path;
|
|
9
|
+
export let styleProp;
|
|
10
|
+
export let context;
|
|
11
|
+
export let registeredComponents;
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<BlocksWrapper {blocks} {parent} {path} {styleProp}>
|
|
15
|
+
{#if blocks}
|
|
16
|
+
{#each blocks as block ("render-block-" + block.id)}
|
|
17
|
+
<Block {block} {context} {registeredComponents} />
|
|
18
|
+
{/each}
|
|
19
|
+
{/if}
|
|
20
|
+
|
|
21
|
+
{#if blocks}
|
|
22
|
+
{#each blocks as block ("block-style-" + block.id)}
|
|
23
|
+
<BlockStyles {block} context={$context} />
|
|
24
|
+
{/each}
|
|
25
|
+
{/if}
|
|
26
|
+
</BlocksWrapper>
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
export type BlocksProps = Partial<BlocksWrapperProps> & {
|
|
3
|
+
context: Writable<BuilderContextInterface>;
|
|
4
|
+
registeredComponents: RegisteredComponents;
|
|
5
|
+
};
|
|
6
|
+
import type { BlocksWrapperProps } from "./blocks-wrapper.svelte";
|
|
7
|
+
import type { BuilderContextInterface, RegisteredComponents } from "../../context/types.js";
|
|
8
|
+
import type { Writable } from "svelte/store";
|
|
9
|
+
declare const __propDef: {
|
|
10
|
+
props: {
|
|
11
|
+
blocks: BlocksProps["blocks"];
|
|
12
|
+
parent: BlocksProps["parent"];
|
|
13
|
+
path: BlocksProps["path"];
|
|
14
|
+
styleProp: BlocksProps["styleProp"];
|
|
15
|
+
context: BlocksProps["context"];
|
|
16
|
+
registeredComponents: BlocksProps["registeredComponents"];
|
|
17
|
+
};
|
|
18
|
+
events: {
|
|
19
|
+
[evt: string]: CustomEvent<any>;
|
|
20
|
+
};
|
|
21
|
+
slots: {};
|
|
22
|
+
};
|
|
23
|
+
export type BlocksProps = typeof __propDef.props;
|
|
24
|
+
export type BlocksEvents = typeof __propDef.events;
|
|
25
|
+
export type BlocksSlots = typeof __propDef.slots;
|
|
26
|
+
export default class Blocks extends SvelteComponentTyped<BlocksProps, BlocksEvents, BlocksSlots> {
|
|
27
|
+
}
|
|
28
|
+
export {};
|