@builder.io/sdk-react-native 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/dist/blocks/button/button.js +6 -2
- package/dist/blocks/button/component-info.js +4 -8
- package/dist/blocks/columns/columns.js +19 -23
- package/dist/blocks/columns/component-info.js +27 -48
- package/dist/blocks/custom-code/component-info.js +4 -8
- package/dist/blocks/custom-code/custom-code.js +1 -1
- package/dist/blocks/embed/component-info.js +7 -11
- package/dist/blocks/embed/embed.js +1 -1
- package/dist/blocks/embed/helpers.js +2 -6
- package/dist/blocks/form/component-info.js +33 -69
- package/dist/blocks/form/form.js +2 -203
- package/dist/blocks/fragment/fragment.js +1 -1
- package/dist/blocks/helpers.js +33 -0
- package/dist/blocks/image/component-info.js +21 -47
- package/dist/blocks/image/image.helpers.js +2 -2
- package/dist/blocks/img/component-info.js +2 -4
- package/dist/blocks/img/img.js +2 -1
- package/dist/blocks/input/component-info.js +8 -34
- package/dist/blocks/input/input.js +2 -1
- package/dist/blocks/raw-text/component-info.js +2 -4
- package/dist/blocks/raw-text/raw-text.js +3 -2
- package/dist/blocks/section/component-info.js +5 -10
- package/dist/blocks/section/section.js +2 -1
- package/dist/blocks/select/component-info.js +12 -24
- package/dist/blocks/select/select.js +2 -1
- package/dist/blocks/submit-button/component-info.js +2 -4
- package/dist/blocks/submit-button/submit-button.js +2 -1
- package/dist/blocks/symbol/component-info.js +7 -12
- package/dist/blocks/symbol/symbol.helpers.js +66 -0
- package/dist/blocks/symbol/symbol.js +23 -50
- package/dist/blocks/text/component-info.js +3 -4
- package/dist/blocks/textarea/component-info.js +6 -12
- package/dist/blocks/textarea/textarea.js +2 -1
- package/dist/blocks/video/component-info.js +21 -41
- package/dist/components/block/block.helpers.js +102 -0
- package/dist/components/block/block.js +141 -0
- package/dist/components/block/components/block-styles.js +95 -0
- package/dist/components/block/components/block-wrapper/block-wrapper.js +41 -0
- package/dist/components/block/components/block-wrapper.js +56 -0
- package/dist/components/block/components/component-ref/component-ref.helpers.js +40 -0
- package/dist/components/block/components/component-ref/component-ref.js +63 -0
- package/dist/components/block/components/component-ref.js +81 -0
- package/dist/components/block/components/component.js +41 -0
- package/dist/components/block/components/interactive-element/interactive-element.helpers.js +35 -0
- package/dist/components/block/components/interactive-element/interactive-element.js +36 -0
- package/dist/components/block/components/interactive-element.js +46 -0
- package/dist/components/block/components/repeated-block.js +40 -0
- package/dist/components/block/types.js +1 -0
- package/dist/components/blocks/blocks-wrapper.js +69 -0
- package/dist/components/blocks/blocks.js +41 -0
- package/dist/components/content/builder-editing.js +32 -0
- package/dist/components/content/components/content-styles.helpers.js +55 -0
- package/dist/components/content/components/content-styles.js +61 -0
- package/dist/components/content/components/enable-editor.js +310 -0
- package/dist/components/content/components/styles.helpers.js +55 -0
- package/dist/components/content/components/styles.js +61 -0
- package/dist/components/content/content.helpers.js +49 -0
- package/dist/components/content/content.js +110 -0
- package/dist/components/content/content.types.js +1 -0
- package/dist/components/content/index.js +8 -0
- package/dist/components/content/wrap-component-ref.js +5 -0
- package/dist/components/content-variants/content-variants.js +77 -0
- package/dist/components/content-variants/content-variants.types.js +1 -0
- package/dist/components/content-variants/helpers.js +175 -0
- package/dist/components/inlined-script.js +32 -0
- package/dist/components/{render-inlined-styles.js → inlined-styles.js} +3 -3
- package/dist/components/render-block/block-styles.js +2 -2
- package/dist/components/render-content/components/render-styles.js +2 -2
- package/dist/components/render-content/render-content.js +10 -8
- package/dist/components/render-content-variants/helpers.js +49 -20
- package/dist/components/render-content-variants/render-content-variants.js +29 -24
- package/dist/components/render-content-variants/render-content-variants.types.js +1 -0
- package/dist/constants/device-sizes.js +2 -2
- package/dist/constants/sdk-version.js +1 -1
- package/dist/context/builder.context.js +1 -1
- package/dist/functions/apply-patch-with-mutation.js +75 -0
- package/dist/functions/apply-patch-with-mutation.test.js +55 -0
- package/dist/functions/camel-to-kebab-case.js +1 -1
- package/dist/functions/evaluate/acorn.js +1691 -0
- package/dist/functions/evaluate/evaluate.js +72 -0
- package/dist/functions/evaluate/index.js +5 -0
- package/dist/functions/evaluate/interpreter.js +2903 -0
- package/dist/functions/evaluate/non-node-runtime.js +97 -0
- package/dist/functions/evaluate/types.js +1 -0
- package/dist/functions/evaluate.test.js +12 -6
- package/dist/functions/event-handler-name.js +1 -1
- package/dist/functions/extract-text-styles.js +3 -9
- package/dist/functions/fast-clone.js +1 -1
- package/dist/functions/get-block-actions-handler.js +2 -2
- package/dist/functions/get-block-actions.js +14 -1
- package/dist/functions/get-block-component-options.js +6 -1
- package/dist/functions/get-block-properties.js +21 -8
- package/dist/functions/get-builder-search-params/fn.test.js +3 -3
- package/dist/functions/get-builder-search-params/index.js +4 -4
- package/dist/functions/get-content/generate-content-url.js +12 -5
- package/dist/functions/get-content/generate-content-url.test.js +31 -17
- package/dist/functions/get-content/index.js +36 -12
- package/dist/functions/get-content/processCookies.js +7 -0
- package/dist/functions/get-processed-block.js +8 -3
- package/dist/functions/get-processed-block.test.js +3 -1
- package/dist/functions/get-react-native-block-styles.js +6 -1
- package/dist/functions/is-non-node-server.js +12 -0
- package/dist/functions/on-change.test.js +13 -3
- package/dist/functions/register-component.js +24 -19
- package/dist/functions/sanitize-react-native-block-styles.js +17 -6
- package/dist/functions/set.test.js +9 -3
- package/dist/functions/track/helpers.js +5 -5
- package/dist/functions/track/index.js +29 -18
- package/dist/functions/track/interaction.js +10 -4
- package/dist/functions/transform-block-properties.js +2 -0
- package/dist/helpers/ab-tests.js +38 -14
- package/dist/helpers/canTrack.js +2 -2
- package/dist/helpers/css.js +2 -2
- package/dist/helpers/flatten.js +10 -7
- package/dist/helpers/nullable.js +1 -1
- package/dist/helpers/preview-lru-cache/get.js +11 -0
- package/dist/helpers/preview-lru-cache/helpers.js +13 -0
- package/dist/helpers/preview-lru-cache/init.js +13 -0
- package/dist/helpers/preview-lru-cache/set.js +37 -0
- package/dist/helpers/preview-lru-cache/types.js +1 -0
- package/dist/helpers/sessionId.js +13 -6
- package/dist/helpers/url.js +1 -1
- package/dist/helpers/visitorId.js +4 -1
- package/dist/index-helpers/blocks-exports.js +2 -2
- package/dist/scripts/init-editing.js +61 -46
- package/dist/types/builder-props.js +1 -0
- package/dist/types/enforced-partials.js +1 -0
- package/package.json +2 -2
- package/src/blocks/button/button.jsx +11 -2
- package/src/blocks/button/component-info.js +16 -22
- package/src/blocks/columns/columns.jsx +29 -28
- package/src/blocks/columns/component-info.js +203 -226
- package/src/blocks/custom-code/component-info.js +19 -25
- package/src/blocks/custom-code/custom-code.jsx +1 -1
- package/src/blocks/embed/component-info.js +31 -37
- package/src/blocks/embed/embed.jsx +1 -1
- package/src/blocks/embed/helpers.js +3 -9
- package/src/blocks/form/component-info.js +174 -212
- package/src/blocks/form/form.jsx +3 -247
- package/src/blocks/fragment/component-info.js +1 -3
- package/src/blocks/fragment/fragment.jsx +1 -1
- package/src/blocks/helpers.js +27 -0
- package/src/blocks/image/component-info.js +105 -133
- package/src/blocks/image/image.helpers.js +3 -5
- package/src/blocks/img/component-info.js +8 -12
- package/src/blocks/img/img.jsx +3 -1
- package/src/blocks/input/component-info.js +29 -57
- package/src/blocks/input/input.jsx +3 -1
- package/src/blocks/raw-text/component-info.js +7 -11
- package/src/blocks/raw-text/raw-text.jsx +4 -2
- package/src/blocks/section/component-info.js +24 -31
- package/src/blocks/section/section.jsx +3 -1
- package/src/blocks/select/component-info.js +34 -48
- package/src/blocks/select/select.jsx +3 -1
- package/src/blocks/submit-button/component-info.js +6 -10
- package/src/blocks/submit-button/submit-button.jsx +3 -2
- package/src/blocks/symbol/component-info.js +30 -37
- package/src/blocks/symbol/symbol.helpers.js +60 -0
- package/src/blocks/symbol/symbol.jsx +34 -59
- package/src/blocks/text/component-info.js +10 -13
- package/src/blocks/textarea/component-info.js +22 -30
- package/src/blocks/textarea/textarea.jsx +3 -1
- package/src/blocks/video/component-info.js +74 -96
- package/src/components/{render-block/render-block.helpers.js → block/block.helpers.js} +26 -44
- package/src/components/{render-block/render-block.jsx → block/block.jsx} +68 -81
- package/src/components/{render-block → block/components}/block-styles.jsx +19 -18
- package/src/components/block/components/block-wrapper.jsx +58 -0
- package/src/components/block/components/component-ref/component-ref.helpers.js +41 -0
- package/src/components/block/components/component-ref/component-ref.jsx +72 -0
- package/src/components/block/components/interactive-element.jsx +37 -0
- package/src/components/{render-block/render-repeated-block.jsx → block/components/repeated-block.jsx} +10 -6
- package/src/components/blocks/blocks-wrapper.jsx +74 -0
- package/src/components/blocks/blocks.jsx +51 -0
- package/src/components/{render-content/render-content.jsx → content/components/enable-editor.jsx} +81 -165
- package/src/components/{render-content/components/render-styles.helpers.js → content/components/styles.helpers.js} +6 -7
- package/src/components/{render-content/components/render-styles.jsx → content/components/styles.jsx} +7 -7
- package/src/components/{render-content/render-content.helpers.js → content/content.helpers.js} +15 -15
- package/src/components/content/content.jsx +141 -0
- package/src/components/content/content.types.js +0 -0
- package/src/components/content/index.js +2 -0
- package/src/components/content/wrap-component-ref.js +2 -0
- package/src/components/content-variants/content-variants.jsx +120 -0
- package/src/components/{render-content-variants → content-variants}/helpers.js +58 -41
- package/src/components/inlined-script.jsx +18 -0
- package/src/components/{render-inlined-styles.jsx → inlined-styles.jsx} +3 -3
- package/src/constants/device-sizes.js +6 -6
- package/src/constants/sdk-version.js +1 -1
- package/src/context/builder.context.js +1 -1
- package/src/functions/apply-patch-with-mutation.js +66 -0
- package/src/functions/camel-to-kebab-case.js +2 -4
- package/src/functions/evaluate/acorn.js +1595 -0
- package/src/functions/{evaluate.js → evaluate/evaluate.js} +36 -10
- package/src/functions/evaluate/index.js +2 -0
- package/src/functions/evaluate/interpreter.js +2801 -0
- package/src/functions/evaluate/non-node-runtime.js +92 -0
- package/src/functions/evaluate/types.js +0 -0
- package/src/functions/event-handler-name.js +2 -4
- package/src/functions/extract-text-styles.js +4 -12
- package/src/functions/fast-clone.js +2 -4
- package/src/functions/get-block-actions-handler.js +3 -5
- package/src/functions/get-block-actions.js +15 -4
- package/src/functions/get-block-component-options.js +11 -12
- package/src/functions/get-block-properties.js +29 -19
- package/src/functions/get-builder-search-params/index.js +5 -10
- package/src/functions/get-content/generate-content-url.js +17 -19
- package/src/functions/get-content/index.js +43 -29
- package/src/functions/get-fetch.js +1 -3
- package/src/functions/get-global-this.js +1 -3
- package/src/functions/get-processed-block.js +12 -13
- package/src/functions/get-react-native-block-styles.js +11 -12
- package/src/functions/if-target.js +1 -3
- package/src/functions/is-browser.js +1 -3
- package/src/functions/is-editing.js +1 -3
- package/src/functions/is-iframe.js +1 -3
- package/src/functions/is-non-node-server.js +9 -0
- package/src/functions/is-previewing.js +1 -3
- package/src/functions/on-change.js +1 -4
- package/src/functions/register-component.js +34 -42
- package/src/functions/register.js +1 -3
- package/src/functions/sanitize-react-native-block-styles.js +22 -17
- package/src/functions/set-editor-settings.js +1 -3
- package/src/functions/set.js +1 -3
- package/src/functions/track/helpers.js +3 -5
- package/src/functions/track/index.js +45 -43
- package/src/functions/track/interaction.js +11 -7
- package/src/functions/transform-block-properties.js +2 -0
- package/src/helpers/ab-tests.js +46 -26
- package/src/helpers/canTrack.js +3 -5
- package/src/helpers/css.js +3 -7
- package/src/helpers/flatten.js +15 -18
- package/src/helpers/localStorage.js +1 -4
- package/src/helpers/logger.js +1 -3
- package/src/helpers/nullable.js +2 -4
- package/src/helpers/preview-lru-cache/get.js +8 -0
- package/src/helpers/preview-lru-cache/helpers.js +10 -0
- package/src/helpers/preview-lru-cache/init.js +10 -0
- package/src/helpers/preview-lru-cache/set.js +35 -0
- package/src/helpers/preview-lru-cache/types.js +0 -0
- package/src/helpers/sessionId.js +14 -11
- package/src/helpers/time.js +1 -3
- package/src/helpers/url.js +2 -4
- package/src/helpers/uuid.js +4 -6
- package/src/helpers/visitorId.js +8 -7
- package/src/index-helpers/blocks-exports.js +1 -1
- package/src/index.js +2 -17
- package/src/scripts/init-editing.js +62 -48
- package/src/types/api-version.js +1 -3
- package/src/types/builder-props.js +0 -0
- package/src/types/enforced-partials.js +0 -0
- package/dist/blocks/BaseText.d.ts +0 -6
- package/dist/blocks/button/button.d.ts +0 -9
- package/dist/blocks/button/component-info.d.ts +0 -2
- package/dist/blocks/columns/columns.d.ts +0 -16
- package/dist/blocks/columns/component-info.d.ts +0 -2
- package/dist/blocks/custom-code/component-info.d.ts +0 -2
- package/dist/blocks/custom-code/custom-code.d.ts +0 -5
- package/dist/blocks/embed/component-info.d.ts +0 -2
- package/dist/blocks/embed/embed.d.ts +0 -5
- package/dist/blocks/embed/helpers.d.ts +0 -1
- package/dist/blocks/form/component-info.d.ts +0 -2
- package/dist/blocks/form/form.d.ts +0 -28
- package/dist/blocks/fragment/component-info.d.ts +0 -2
- package/dist/blocks/fragment/fragment.d.ts +0 -8
- package/dist/blocks/image/component-info.d.ts +0 -2
- package/dist/blocks/image/image.d.ts +0 -17
- package/dist/blocks/image/image.helpers.d.ts +0 -1
- package/dist/blocks/img/component-info.d.ts +0 -2
- package/dist/blocks/img/img.d.ts +0 -11
- package/dist/blocks/input/component-info.d.ts +0 -2
- package/dist/blocks/input/input.d.ts +0 -12
- package/dist/blocks/raw-text/component-info.d.ts +0 -2
- package/dist/blocks/raw-text/raw-text.d.ts +0 -5
- package/dist/blocks/section/component-info.d.ts +0 -2
- package/dist/blocks/section/section.d.ts +0 -9
- package/dist/blocks/select/component-info.d.ts +0 -2
- package/dist/blocks/select/select.d.ts +0 -13
- package/dist/blocks/submit-button/component-info.d.ts +0 -2
- package/dist/blocks/submit-button/submit-button.d.ts +0 -7
- package/dist/blocks/symbol/component-info.d.ts +0 -2
- package/dist/blocks/symbol/symbol.d.ts +0 -21
- package/dist/blocks/text/component-info.d.ts +0 -2
- package/dist/blocks/text/text.d.ts +0 -7
- package/dist/blocks/textarea/component-info.d.ts +0 -2
- package/dist/blocks/textarea/textarea.d.ts +0 -10
- package/dist/blocks/util.d.ts +0 -4
- package/dist/blocks/video/component-info.d.ts +0 -2
- package/dist/blocks/video/video.d.ts +0 -31
- package/dist/components/render-block/block-styles.d.ts +0 -9
- package/dist/components/render-block/render-block.d.ts +0 -9
- package/dist/components/render-block/render-block.helpers.d.ts +0 -12
- package/dist/components/render-block/render-component.d.ts +0 -17
- package/dist/components/render-block/render-repeated-block.d.ts +0 -9
- package/dist/components/render-block/types.d.ts +0 -6
- package/dist/components/render-blocks.d.ts +0 -10
- package/dist/components/render-content/builder-editing.d.ts +0 -3
- package/dist/components/render-content/components/render-styles.d.ts +0 -9
- package/dist/components/render-content/components/render-styles.helpers.d.ts +0 -15
- package/dist/components/render-content/index.d.ts +0 -1
- package/dist/components/render-content/render-content.d.ts +0 -4
- package/dist/components/render-content/render-content.helpers.d.ts +0 -7
- package/dist/components/render-content/render-content.types.d.ts +0 -38
- package/dist/components/render-content/wrap-component-ref.d.ts +0 -6
- package/dist/components/render-content-variants/helpers.d.ts +0 -17
- package/dist/components/render-content-variants/render-content-variants.d.ts +0 -5
- package/dist/components/render-inlined-styles.d.ts +0 -7
- package/dist/constants/builder-registered-components.d.ts +0 -6
- package/dist/constants/device-sizes.d.ts +0 -13
- package/dist/constants/sdk-version.d.ts +0 -1
- package/dist/constants/target.d.ts +0 -3
- package/dist/context/builder.context.d.ts +0 -3
- package/dist/context/types.d.ts +0 -35
- package/dist/functions/camel-to-kebab-case.d.ts +0 -1
- package/dist/functions/evaluate.d.ts +0 -7
- package/dist/functions/evaluate.test.d.ts +0 -1
- package/dist/functions/event-handler-name.d.ts +0 -1
- package/dist/functions/extract-text-styles.d.ts +0 -4
- package/dist/functions/fast-clone.d.ts +0 -4
- package/dist/functions/get-block-actions-handler.d.ts +0 -8
- package/dist/functions/get-block-actions.d.ts +0 -9
- package/dist/functions/get-block-component-options.d.ts +0 -2
- package/dist/functions/get-block-properties.d.ts +0 -2
- package/dist/functions/get-builder-search-params/fn.test.d.ts +0 -1
- package/dist/functions/get-builder-search-params/index.d.ts +0 -12
- package/dist/functions/get-content/generate-content-url.d.ts +0 -2
- package/dist/functions/get-content/generate-content-url.test.d.ts +0 -1
- package/dist/functions/get-content/index.d.ts +0 -16
- package/dist/functions/get-content/types.d.ts +0 -51
- package/dist/functions/get-fetch.d.ts +0 -1
- package/dist/functions/get-processed-block.d.ts +0 -10
- package/dist/functions/get-processed-block.test.d.ts +0 -1
- package/dist/functions/get-react-native-block-styles.d.ts +0 -7
- package/dist/functions/if-target.d.ts +0 -7
- package/dist/functions/is-browser.d.ts +0 -1
- package/dist/functions/is-editing.d.ts +0 -1
- package/dist/functions/is-iframe.d.ts +0 -1
- package/dist/functions/is-previewing.d.ts +0 -1
- package/dist/functions/on-change.d.ts +0 -7
- package/dist/functions/on-change.test.d.ts +0 -1
- package/dist/functions/register-component.d.ts +0 -14
- package/dist/functions/register.d.ts +0 -16
- package/dist/functions/sanitize-react-native-block-styles.d.ts +0 -3
- package/dist/functions/set-editor-settings.d.ts +0 -4
- package/dist/functions/set.d.ts +0 -7
- package/dist/functions/set.test.d.ts +0 -1
- package/dist/functions/track/helpers.d.ts +0 -5
- package/dist/functions/track/index.d.ts +0 -51
- package/dist/functions/track/interaction.d.ts +0 -13
- package/dist/functions/transform-block-properties.d.ts +0 -3
- package/dist/functions/transform-block.d.ts +0 -2
- package/dist/helpers/ab-tests.d.ts +0 -9
- package/dist/helpers/canTrack.d.ts +0 -1
- package/dist/helpers/cookie.d.ts +0 -9
- package/dist/helpers/css.d.ts +0 -7
- package/dist/helpers/flatten.d.ts +0 -6
- package/dist/helpers/localStorage.d.ts +0 -9
- package/dist/helpers/logger.d.ts +0 -6
- package/dist/helpers/nullable.d.ts +0 -2
- package/dist/helpers/sessionId.d.ts +0 -6
- package/dist/helpers/time.d.ts +0 -1
- package/dist/helpers/url.d.ts +0 -6
- package/dist/helpers/url.test.d.ts +0 -1
- package/dist/helpers/uuid.d.ts +0 -8
- package/dist/helpers/visitorId.d.ts +0 -6
- package/dist/index-helpers/blocks-exports.d.ts +0 -8
- package/dist/index-helpers/top-of-file.d.ts +0 -1
- package/dist/index.d.ts +0 -15
- package/dist/scripts/init-editing.d.ts +0 -6
- package/dist/types/api-version.d.ts +0 -2
- package/dist/types/builder-block.d.ts +0 -66
- package/dist/types/builder-content.d.ts +0 -44
- package/dist/types/can-track.d.ts +0 -3
- package/dist/types/components.d.ts +0 -105
- package/dist/types/deep-partial.d.ts +0 -3
- package/dist/types/element.d.ts +0 -59
- package/dist/types/input.d.ts +0 -121
- package/dist/types/targets.d.ts +0 -3
- package/dist/types/typescript.d.ts +0 -5
- package/src/blocks/util.js +0 -8
- package/src/components/render-block/render-component.jsx +0 -55
- package/src/components/render-blocks.jsx +0 -101
- package/src/components/render-content/builder-editing.jsx +0 -16
- package/src/components/render-content/index.js +0 -4
- package/src/components/render-content/wrap-component-ref.js +0 -4
- package/src/components/render-content-variants/render-content-variants.jsx +0 -101
- package/src/functions/evaluate.test.js +0 -17
- package/src/functions/get-builder-search-params/fn.test.js +0 -13
- package/src/functions/get-content/generate-content-url.test.js +0 -97
- package/src/functions/get-processed-block.test.js +0 -34
- package/src/functions/on-change.test.js +0 -19
- package/src/functions/set.test.js +0 -16
- package/src/helpers/url.test.js +0 -21
- /package/src/components/{render-block → block}/types.js +0 -0
- /package/src/components/{render-content/render-content.types.js → content-variants/content-variants.types.js} +0 -0
|
@@ -6,100 +6,78 @@ const componentInfo = {
|
|
|
6
6
|
minWidth: "20px"
|
|
7
7
|
},
|
|
8
8
|
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",
|
|
9
|
-
inputs: [
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
},
|
|
83
|
-
{
|
|
84
|
-
name: "width",
|
|
85
|
-
type: "number",
|
|
86
|
-
advanced: true
|
|
87
|
-
},
|
|
88
|
-
{
|
|
89
|
-
name: "aspectRatio",
|
|
90
|
-
type: "number",
|
|
91
|
-
advanced: true,
|
|
92
|
-
defaultValue: 0.7004048582995948
|
|
93
|
-
},
|
|
94
|
-
{
|
|
95
|
-
name: "lazyLoad",
|
|
96
|
-
type: "boolean",
|
|
97
|
-
helperText: 'Load this video "lazily" - as in only when a user scrolls near the video. Recommended for optmized performance and bandwidth consumption',
|
|
98
|
-
defaultValue: true,
|
|
99
|
-
advanced: true
|
|
100
|
-
}
|
|
101
|
-
]
|
|
102
|
-
};
|
|
103
|
-
export {
|
|
104
|
-
componentInfo
|
|
9
|
+
inputs: [{
|
|
10
|
+
name: "video",
|
|
11
|
+
type: "file",
|
|
12
|
+
allowedFileTypes: ["mp4"],
|
|
13
|
+
bubble: true,
|
|
14
|
+
defaultValue: "https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/assets%2FKQlEmWDxA0coC3PK6UvkrjwkIGI2%2F28cb070609f546cdbe5efa20e931aa4b?alt=media&token=912e9551-7a7c-4dfb-86b6-3da1537d1a7f",
|
|
15
|
+
required: true
|
|
16
|
+
}, {
|
|
17
|
+
name: "posterImage",
|
|
18
|
+
type: "file",
|
|
19
|
+
allowedFileTypes: ["jpeg", "png"],
|
|
20
|
+
helperText: "Image to show before the video plays"
|
|
21
|
+
}, {
|
|
22
|
+
name: "autoPlay",
|
|
23
|
+
type: "boolean",
|
|
24
|
+
defaultValue: true
|
|
25
|
+
}, {
|
|
26
|
+
name: "controls",
|
|
27
|
+
type: "boolean",
|
|
28
|
+
defaultValue: false
|
|
29
|
+
}, {
|
|
30
|
+
name: "muted",
|
|
31
|
+
type: "boolean",
|
|
32
|
+
defaultValue: true
|
|
33
|
+
}, {
|
|
34
|
+
name: "loop",
|
|
35
|
+
type: "boolean",
|
|
36
|
+
defaultValue: true
|
|
37
|
+
}, {
|
|
38
|
+
name: "playsInline",
|
|
39
|
+
type: "boolean",
|
|
40
|
+
defaultValue: true
|
|
41
|
+
}, {
|
|
42
|
+
name: "fit",
|
|
43
|
+
type: "text",
|
|
44
|
+
defaultValue: "cover",
|
|
45
|
+
enum: ["contain", "cover", "fill", "auto"]
|
|
46
|
+
}, {
|
|
47
|
+
name: "preload",
|
|
48
|
+
type: "text",
|
|
49
|
+
defaultValue: "metadata",
|
|
50
|
+
enum: ["auto", "metadata", "none"]
|
|
51
|
+
}, {
|
|
52
|
+
name: "fitContent",
|
|
53
|
+
type: "boolean",
|
|
54
|
+
helperText: "When child blocks are provided, fit to them instead of using the aspect ratio",
|
|
55
|
+
defaultValue: true,
|
|
56
|
+
advanced: true
|
|
57
|
+
}, {
|
|
58
|
+
name: "position",
|
|
59
|
+
type: "text",
|
|
60
|
+
defaultValue: "center",
|
|
61
|
+
enum: ["center", "top", "left", "right", "bottom", "top left", "top right", "bottom left", "bottom right"]
|
|
62
|
+
}, {
|
|
63
|
+
name: "height",
|
|
64
|
+
type: "number",
|
|
65
|
+
advanced: true
|
|
66
|
+
}, {
|
|
67
|
+
name: "width",
|
|
68
|
+
type: "number",
|
|
69
|
+
advanced: true
|
|
70
|
+
}, {
|
|
71
|
+
name: "aspectRatio",
|
|
72
|
+
type: "number",
|
|
73
|
+
advanced: true,
|
|
74
|
+
defaultValue: 0.7004048582995948
|
|
75
|
+
}, {
|
|
76
|
+
name: "lazyLoad",
|
|
77
|
+
type: "boolean",
|
|
78
|
+
helperText: 'Load this video "lazily" - as in only when a user scrolls near the video. Recommended for optmized performance and bandwidth consumption',
|
|
79
|
+
defaultValue: true,
|
|
80
|
+
advanced: true
|
|
81
|
+
}]
|
|
105
82
|
};
|
|
83
|
+
export { componentInfo }
|
|
@@ -4,56 +4,38 @@ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
|
4
4
|
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
6
|
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, {
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
configurable: true,
|
|
10
|
+
writable: true,
|
|
11
|
+
value
|
|
12
|
+
}) : obj[key] = value;
|
|
8
13
|
var __spreadValues = (a, b) => {
|
|
9
|
-
for (var prop in b || (b = {}))
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
-
if (__propIsEnum.call(b, prop))
|
|
15
|
-
__defNormalProp(a, prop, b[prop]);
|
|
16
|
-
}
|
|
14
|
+
for (var prop in b || (b = {})) if (__hasOwnProp.call(b, prop)) __defNormalProp(a, prop, b[prop]);
|
|
15
|
+
if (__getOwnPropSymbols) for (var prop of __getOwnPropSymbols(b)) {
|
|
16
|
+
if (__propIsEnum.call(b, prop)) __defNormalProp(a, prop, b[prop]);
|
|
17
|
+
}
|
|
17
18
|
return a;
|
|
18
19
|
};
|
|
19
20
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
21
|
var __objRest = (source, exclude) => {
|
|
21
22
|
var target = {};
|
|
22
|
-
for (var prop in source)
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
for (var prop of __getOwnPropSymbols(source)) {
|
|
27
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
28
|
-
target[prop] = source[prop];
|
|
29
|
-
}
|
|
23
|
+
for (var prop in source) if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0) target[prop] = source[prop];
|
|
24
|
+
if (source != null && __getOwnPropSymbols) for (var prop of __getOwnPropSymbols(source)) {
|
|
25
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop)) target[prop] = source[prop];
|
|
26
|
+
}
|
|
30
27
|
return target;
|
|
31
28
|
};
|
|
32
29
|
import { evaluate } from "../../functions/evaluate";
|
|
33
|
-
import { getProcessedBlock } from "../../functions/get-processed-block";
|
|
34
|
-
const EMPTY_HTML_ELEMENTS = [
|
|
35
|
-
|
|
36
|
-
"base",
|
|
37
|
-
"br",
|
|
38
|
-
"col",
|
|
39
|
-
"embed",
|
|
40
|
-
"hr",
|
|
41
|
-
"img",
|
|
42
|
-
"input",
|
|
43
|
-
"keygen",
|
|
44
|
-
"link",
|
|
45
|
-
"meta",
|
|
46
|
-
"param",
|
|
47
|
-
"source",
|
|
48
|
-
"track",
|
|
49
|
-
"wbr"
|
|
50
|
-
];
|
|
51
|
-
const isEmptyHtmlElement = (tagName) => {
|
|
30
|
+
import { getProcessedBlock } from "../../functions/get-processed-block.js";
|
|
31
|
+
const EMPTY_HTML_ELEMENTS = ["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen", "link", "meta", "param", "source", "track", "wbr"];
|
|
32
|
+
const isEmptyHtmlElement = tagName => {
|
|
52
33
|
return typeof tagName === "string" && EMPTY_HTML_ELEMENTS.includes(tagName.toLowerCase());
|
|
53
34
|
};
|
|
54
35
|
const getComponent = ({
|
|
55
36
|
block,
|
|
56
|
-
context
|
|
37
|
+
context,
|
|
38
|
+
registeredComponents
|
|
57
39
|
}) => {
|
|
58
40
|
var _a;
|
|
59
41
|
const componentName = (_a = getProcessedBlock({
|
|
@@ -67,7 +49,7 @@ const getComponent = ({
|
|
|
67
49
|
if (!componentName) {
|
|
68
50
|
return null;
|
|
69
51
|
}
|
|
70
|
-
const ref =
|
|
52
|
+
const ref = registeredComponents[componentName];
|
|
71
53
|
if (!ref) {
|
|
72
54
|
console.warn(`
|
|
73
55
|
Could not find a registered component named "${componentName}".
|
|
@@ -81,7 +63,11 @@ const getRepeatItemData = ({
|
|
|
81
63
|
block,
|
|
82
64
|
context
|
|
83
65
|
}) => {
|
|
84
|
-
const _a = block,
|
|
66
|
+
const _a = block,
|
|
67
|
+
{
|
|
68
|
+
repeat
|
|
69
|
+
} = _a,
|
|
70
|
+
blockWithoutRepeat = __objRest(_a, ["repeat"]);
|
|
85
71
|
if (!(repeat == null ? void 0 : repeat.collection)) {
|
|
86
72
|
return void 0;
|
|
87
73
|
}
|
|
@@ -110,8 +96,4 @@ const getRepeatItemData = ({
|
|
|
110
96
|
}));
|
|
111
97
|
return repeatArray;
|
|
112
98
|
};
|
|
113
|
-
export {
|
|
114
|
-
getComponent,
|
|
115
|
-
getRepeatItemData,
|
|
116
|
-
isEmptyHtmlElement
|
|
117
|
-
};
|
|
99
|
+
export { getComponent, getRepeatItemData, isEmptyHtmlElement }
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
"use client";
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import {
|
|
4
4
|
FlatList,
|
|
@@ -9,29 +9,28 @@ import {
|
|
|
9
9
|
Text,
|
|
10
10
|
} from "react-native";
|
|
11
11
|
import { useState } from "react";
|
|
12
|
-
import { getBlockActions } from "../../functions/get-block-actions.js";
|
|
13
12
|
import { getBlockComponentOptions } from "../../functions/get-block-component-options.js";
|
|
14
13
|
import { getBlockProperties } from "../../functions/get-block-properties.js";
|
|
15
14
|
import { getProcessedBlock } from "../../functions/get-processed-block.js";
|
|
16
|
-
import BlockStyles from "./block-styles";
|
|
15
|
+
import BlockStyles from "./components/block-styles";
|
|
17
16
|
import {
|
|
18
17
|
getComponent,
|
|
19
18
|
getRepeatItemData,
|
|
20
19
|
isEmptyHtmlElement,
|
|
21
|
-
} from "./
|
|
22
|
-
import
|
|
23
|
-
import { TARGET } from "../../constants/target.js";
|
|
20
|
+
} from "./block.helpers.js";
|
|
21
|
+
import RepeatedBlock from "./components/repeated-block";
|
|
24
22
|
import { extractTextStyles } from "../../functions/extract-text-styles.js";
|
|
25
|
-
import
|
|
26
|
-
import
|
|
23
|
+
import ComponentRef from "./components/component-ref/component-ref";
|
|
24
|
+
import BlockWrapper from "./components/block-wrapper";
|
|
27
25
|
|
|
28
|
-
function
|
|
29
|
-
|
|
30
|
-
getComponent({
|
|
26
|
+
function Block(props) {
|
|
27
|
+
function blockComponent() {
|
|
28
|
+
return getComponent({
|
|
31
29
|
block: props.block,
|
|
32
30
|
context: props.context,
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
registeredComponents: props.registeredComponents,
|
|
32
|
+
});
|
|
33
|
+
}
|
|
35
34
|
|
|
36
35
|
function repeatItem() {
|
|
37
36
|
return getRepeatItemData({
|
|
@@ -40,7 +39,7 @@ function RenderBlock(props) {
|
|
|
40
39
|
});
|
|
41
40
|
}
|
|
42
41
|
|
|
43
|
-
function
|
|
42
|
+
function processedBlock() {
|
|
44
43
|
return repeatItem()
|
|
45
44
|
? props.block
|
|
46
45
|
: getProcessedBlock({
|
|
@@ -53,44 +52,20 @@ function RenderBlock(props) {
|
|
|
53
52
|
});
|
|
54
53
|
}
|
|
55
54
|
|
|
56
|
-
|
|
55
|
+
function Tag() {
|
|
56
|
+
return props.block.tagName || "div";
|
|
57
|
+
}
|
|
57
58
|
|
|
58
59
|
function canShowBlock() {
|
|
59
|
-
if ("hide" in
|
|
60
|
-
return !
|
|
60
|
+
if ("hide" in processedBlock()) {
|
|
61
|
+
return !processedBlock().hide;
|
|
61
62
|
}
|
|
62
|
-
if ("show" in
|
|
63
|
-
return
|
|
63
|
+
if ("show" in processedBlock()) {
|
|
64
|
+
return processedBlock().show;
|
|
64
65
|
}
|
|
65
66
|
return true;
|
|
66
67
|
}
|
|
67
68
|
|
|
68
|
-
function actions() {
|
|
69
|
-
return getBlockActions({
|
|
70
|
-
block: useBlock(),
|
|
71
|
-
rootState: props.context.rootState,
|
|
72
|
-
rootSetState: props.context.rootSetState,
|
|
73
|
-
localState: props.context.localState,
|
|
74
|
-
context: props.context.context,
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
function attributes() {
|
|
79
|
-
const blockProperties = getBlockProperties(useBlock());
|
|
80
|
-
return {
|
|
81
|
-
...blockProperties,
|
|
82
|
-
...(TARGET === "reactNative"
|
|
83
|
-
? {
|
|
84
|
-
style: getReactNativeBlockStyles({
|
|
85
|
-
block: useBlock(),
|
|
86
|
-
context: props.context,
|
|
87
|
-
blockStyles: blockProperties.style,
|
|
88
|
-
}),
|
|
89
|
-
}
|
|
90
|
-
: {}),
|
|
91
|
-
};
|
|
92
|
-
}
|
|
93
|
-
|
|
94
69
|
function childrenWithoutParentComponent() {
|
|
95
70
|
/**
|
|
96
71
|
* When there is no `componentRef`, there might still be children that need to be rendered. In this case,
|
|
@@ -99,30 +74,31 @@ function RenderBlock(props) {
|
|
|
99
74
|
* blocks, and the children will be repeated within those blocks.
|
|
100
75
|
*/
|
|
101
76
|
const shouldRenderChildrenOutsideRef =
|
|
102
|
-
!
|
|
103
|
-
return shouldRenderChildrenOutsideRef
|
|
77
|
+
!blockComponent?.()?.component && !repeatItem();
|
|
78
|
+
return shouldRenderChildrenOutsideRef
|
|
79
|
+
? processedBlock().children ?? []
|
|
80
|
+
: [];
|
|
104
81
|
}
|
|
105
82
|
|
|
106
|
-
function
|
|
83
|
+
function componentRefProps() {
|
|
107
84
|
return {
|
|
108
|
-
blockChildren:
|
|
109
|
-
componentRef:
|
|
85
|
+
blockChildren: processedBlock().children ?? [],
|
|
86
|
+
componentRef: blockComponent?.()?.component,
|
|
110
87
|
componentOptions: {
|
|
111
|
-
...getBlockComponentOptions(
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
: {
|
|
119
|
-
attributes: {
|
|
120
|
-
...attributes(),
|
|
121
|
-
...actions(),
|
|
122
|
-
},
|
|
123
|
-
}),
|
|
88
|
+
...getBlockComponentOptions(processedBlock()),
|
|
89
|
+
builderContext: props.context,
|
|
90
|
+
...(blockComponent?.()?.name === "Symbol" ||
|
|
91
|
+
blockComponent?.()?.name === "Columns"
|
|
92
|
+
? {
|
|
93
|
+
builderComponents: props.registeredComponents,
|
|
94
|
+
}
|
|
95
|
+
: {}),
|
|
124
96
|
},
|
|
125
97
|
context: childrenContext,
|
|
98
|
+
registeredComponents: props.registeredComponents,
|
|
99
|
+
builderBlock: processedBlock(),
|
|
100
|
+
includeBlockProps: blockComponent?.()?.noWrap === true,
|
|
101
|
+
isInteractive: !blockComponent?.()?.isRSC,
|
|
126
102
|
};
|
|
127
103
|
}
|
|
128
104
|
|
|
@@ -134,13 +110,12 @@ function RenderBlock(props) {
|
|
|
134
110
|
rootSetState: props.context.rootSetState,
|
|
135
111
|
content: props.context.content,
|
|
136
112
|
context: props.context.context,
|
|
137
|
-
|
|
113
|
+
componentInfos: props.context.componentInfos,
|
|
138
114
|
inheritedStyles: extractTextStyles(
|
|
139
|
-
|
|
140
|
-
block:
|
|
115
|
+
getBlockProperties({
|
|
116
|
+
block: processedBlock(),
|
|
141
117
|
context: props.context,
|
|
142
|
-
|
|
143
|
-
})
|
|
118
|
+
}).style || {}
|
|
144
119
|
),
|
|
145
120
|
}));
|
|
146
121
|
|
|
@@ -148,34 +123,46 @@ function RenderBlock(props) {
|
|
|
148
123
|
<>
|
|
149
124
|
{canShowBlock() ? (
|
|
150
125
|
<>
|
|
151
|
-
{!
|
|
126
|
+
{!blockComponent?.()?.noWrap ? (
|
|
152
127
|
<>
|
|
153
|
-
{isEmptyHtmlElement(Tag) ? (
|
|
128
|
+
{isEmptyHtmlElement(Tag()) ? (
|
|
154
129
|
<>
|
|
155
|
-
<
|
|
130
|
+
<BlockWrapper
|
|
131
|
+
Wrapper={Tag()}
|
|
132
|
+
block={processedBlock()}
|
|
133
|
+
context={props.context}
|
|
134
|
+
hasChildren={false}
|
|
135
|
+
/>
|
|
156
136
|
</>
|
|
157
137
|
) : null}
|
|
158
|
-
{!isEmptyHtmlElement(Tag) && repeatItem() ? (
|
|
138
|
+
{!isEmptyHtmlElement(Tag()) && repeatItem() ? (
|
|
159
139
|
<>
|
|
160
140
|
{repeatItem()?.map((data, index) => (
|
|
161
|
-
<
|
|
141
|
+
<RepeatedBlock
|
|
162
142
|
key={index}
|
|
163
143
|
repeatContext={data.context}
|
|
164
144
|
block={data.block}
|
|
145
|
+
registeredComponents={props.registeredComponents}
|
|
165
146
|
/>
|
|
166
147
|
))}
|
|
167
148
|
</>
|
|
168
149
|
) : null}
|
|
169
|
-
{!isEmptyHtmlElement(Tag) && !repeatItem() ? (
|
|
150
|
+
{!isEmptyHtmlElement(Tag()) && !repeatItem() ? (
|
|
170
151
|
<>
|
|
171
|
-
<
|
|
172
|
-
|
|
152
|
+
<BlockWrapper
|
|
153
|
+
Wrapper={Tag()}
|
|
154
|
+
block={processedBlock()}
|
|
155
|
+
context={props.context}
|
|
156
|
+
hasChildren={true}
|
|
157
|
+
>
|
|
158
|
+
<ComponentRef {...componentRefProps()} />
|
|
173
159
|
|
|
174
160
|
{childrenWithoutParentComponent()?.map((child) => (
|
|
175
|
-
<
|
|
176
|
-
key={"
|
|
161
|
+
<Block
|
|
162
|
+
key={"block-" + child.id}
|
|
177
163
|
block={child}
|
|
178
164
|
context={childrenContext}
|
|
165
|
+
registeredComponents={props.registeredComponents}
|
|
179
166
|
/>
|
|
180
167
|
))}
|
|
181
168
|
|
|
@@ -186,13 +173,13 @@ function RenderBlock(props) {
|
|
|
186
173
|
context={childrenContext}
|
|
187
174
|
/>
|
|
188
175
|
))}
|
|
189
|
-
</
|
|
176
|
+
</BlockWrapper>
|
|
190
177
|
</>
|
|
191
178
|
) : null}
|
|
192
179
|
</>
|
|
193
180
|
) : (
|
|
194
181
|
<>
|
|
195
|
-
<
|
|
182
|
+
<ComponentRef {...componentRefProps()} />
|
|
196
183
|
</>
|
|
197
184
|
)}
|
|
198
185
|
</>
|
|
@@ -201,4 +188,4 @@ function RenderBlock(props) {
|
|
|
201
188
|
);
|
|
202
189
|
}
|
|
203
190
|
|
|
204
|
-
export default
|
|
191
|
+
export default Block;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
"use client";
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import {
|
|
4
4
|
FlatList,
|
|
@@ -8,41 +8,42 @@ import {
|
|
|
8
8
|
Image,
|
|
9
9
|
Text,
|
|
10
10
|
} from "react-native";
|
|
11
|
+
import { useState } from "react";
|
|
11
12
|
import {
|
|
12
13
|
getMaxWidthQueryForSize,
|
|
13
14
|
getSizesForBreakpoints,
|
|
14
|
-
} from "
|
|
15
|
-
import { TARGET } from "
|
|
16
|
-
import { getProcessedBlock } from "
|
|
17
|
-
import { createCssClass } from "
|
|
18
|
-
import { checkIsDefined } from "
|
|
19
|
-
import
|
|
15
|
+
} from "../../../constants/device-sizes.js";
|
|
16
|
+
import { TARGET } from "../../../constants/target.js";
|
|
17
|
+
import { getProcessedBlock } from "../../../functions/get-processed-block.js";
|
|
18
|
+
import { createCssClass } from "../../../helpers/css.js";
|
|
19
|
+
import { checkIsDefined } from "../../../helpers/nullable.js";
|
|
20
|
+
import InlinedStyles from "../../inlined-styles";
|
|
20
21
|
|
|
21
22
|
function BlockStyles(props) {
|
|
22
|
-
|
|
23
|
-
|
|
23
|
+
const [processedBlock, setProcessedBlock] = useState(() =>
|
|
24
|
+
getProcessedBlock({
|
|
24
25
|
block: props.block,
|
|
25
26
|
localState: props.context.localState,
|
|
26
27
|
rootState: props.context.rootState,
|
|
27
28
|
rootSetState: props.context.rootSetState,
|
|
28
29
|
context: props.context.context,
|
|
29
30
|
shouldEvaluateBindings: true,
|
|
30
|
-
})
|
|
31
|
-
|
|
31
|
+
})
|
|
32
|
+
);
|
|
32
33
|
|
|
33
34
|
function canShowBlock() {
|
|
34
35
|
// only render styles for blocks that are visible
|
|
35
|
-
if (checkIsDefined(
|
|
36
|
-
return !
|
|
36
|
+
if (checkIsDefined(processedBlock.hide)) {
|
|
37
|
+
return !processedBlock.hide;
|
|
37
38
|
}
|
|
38
|
-
if (checkIsDefined(
|
|
39
|
-
return
|
|
39
|
+
if (checkIsDefined(processedBlock.show)) {
|
|
40
|
+
return processedBlock.show;
|
|
40
41
|
}
|
|
41
42
|
return true;
|
|
42
43
|
}
|
|
43
44
|
|
|
44
45
|
function css() {
|
|
45
|
-
const styles =
|
|
46
|
+
const styles = processedBlock.responsiveStyles;
|
|
46
47
|
const content = props.context.content;
|
|
47
48
|
const sizesWithUpdatedBreakpoints = getSizesForBreakpoints(
|
|
48
49
|
content?.meta?.breakpoints || {}
|
|
@@ -50,7 +51,7 @@ function BlockStyles(props) {
|
|
|
50
51
|
const largeStyles = styles?.large;
|
|
51
52
|
const mediumStyles = styles?.medium;
|
|
52
53
|
const smallStyles = styles?.small;
|
|
53
|
-
const className =
|
|
54
|
+
const className = processedBlock.id;
|
|
54
55
|
if (!className) {
|
|
55
56
|
return "";
|
|
56
57
|
}
|
|
@@ -87,7 +88,7 @@ function BlockStyles(props) {
|
|
|
87
88
|
<>
|
|
88
89
|
{TARGET !== "reactNative" && css() && canShowBlock() ? (
|
|
89
90
|
<>
|
|
90
|
-
<
|
|
91
|
+
<InlinedStyles styles={css()} />
|
|
91
92
|
</>
|
|
92
93
|
) : null}
|
|
93
94
|
</>
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import {
|
|
4
|
+
FlatList,
|
|
5
|
+
ScrollView,
|
|
6
|
+
View,
|
|
7
|
+
StyleSheet,
|
|
8
|
+
Image,
|
|
9
|
+
Text,
|
|
10
|
+
} from "react-native";
|
|
11
|
+
import { getBlockActions } from "../../../functions/get-block-actions.js";
|
|
12
|
+
import { getBlockProperties } from "../../../functions/get-block-properties.js";
|
|
13
|
+
|
|
14
|
+
function BlockWrapper(props) {
|
|
15
|
+
return (
|
|
16
|
+
<>
|
|
17
|
+
{props.hasChildren ? (
|
|
18
|
+
<>
|
|
19
|
+
<props.Wrapper
|
|
20
|
+
{...getBlockProperties({
|
|
21
|
+
block: props.block,
|
|
22
|
+
context: props.context,
|
|
23
|
+
})}
|
|
24
|
+
{...getBlockActions({
|
|
25
|
+
block: props.block,
|
|
26
|
+
rootState: props.context.rootState,
|
|
27
|
+
rootSetState: props.context.rootSetState,
|
|
28
|
+
localState: props.context.localState,
|
|
29
|
+
context: props.context.context,
|
|
30
|
+
stripPrefix: true,
|
|
31
|
+
})}
|
|
32
|
+
>
|
|
33
|
+
{props.children}
|
|
34
|
+
</props.Wrapper>
|
|
35
|
+
</>
|
|
36
|
+
) : (
|
|
37
|
+
<>
|
|
38
|
+
<props.Wrapper
|
|
39
|
+
{...getBlockProperties({
|
|
40
|
+
block: props.block,
|
|
41
|
+
context: props.context,
|
|
42
|
+
})}
|
|
43
|
+
{...getBlockActions({
|
|
44
|
+
block: props.block,
|
|
45
|
+
rootState: props.context.rootState,
|
|
46
|
+
rootSetState: props.context.rootSetState,
|
|
47
|
+
localState: props.context.localState,
|
|
48
|
+
context: props.context.context,
|
|
49
|
+
stripPrefix: true,
|
|
50
|
+
})}
|
|
51
|
+
/>
|
|
52
|
+
</>
|
|
53
|
+
)}
|
|
54
|
+
</>
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export default BlockWrapper;
|