@builder.io/sdk-react 0.1.1 → 0.1.3
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/react/blocks/BaseText.js +7 -0
- package/dist/react/blocks/button/button.js +9 -0
- package/dist/react/blocks/button/component-info.js +39 -0
- package/dist/react/blocks/columns/columns.js +131 -0
- package/dist/react/blocks/columns/component-info.js +241 -0
- package/dist/react/blocks/custom-code/component-info.js +29 -0
- package/dist/react/blocks/custom-code/custom-code.js +49 -0
- package/dist/react/blocks/embed/component-info.js +44 -0
- package/dist/react/blocks/embed/embed.js +40 -0
- package/dist/react/blocks/embed/helpers.js +7 -0
- package/dist/react/blocks/form/component-info.js +260 -0
- package/dist/react/blocks/form/form.js +201 -0
- package/dist/react/blocks/fragment/component-info.js +9 -0
- package/dist/react/blocks/fragment/fragment.js +4 -0
- package/dist/react/blocks/image/component-info.js +149 -0
- package/dist/react/blocks/image/image.helpers.js +46 -0
- package/dist/react/blocks/image/image.js +82 -0
- package/dist/react/blocks/img/component-info.js +18 -0
- package/dist/react/blocks/img/img.js +8 -0
- package/dist/react/blocks/input/component-info.js +72 -0
- package/dist/react/blocks/input/input.js +5 -0
- package/dist/react/blocks/raw-text/component-info.js +14 -0
- package/dist/react/blocks/raw-text/raw-text.js +4 -0
- package/dist/react/blocks/section/component-info.js +47 -0
- package/dist/react/blocks/section/section.js +17 -0
- package/dist/react/blocks/select/component-info.js +57 -0
- package/dist/react/blocks/select/select.js +5 -0
- package/dist/react/blocks/submit-button/component-info.js +26 -0
- package/dist/react/blocks/submit-button/submit-button.js +4 -0
- package/dist/react/blocks/symbol/component-info.js +41 -0
- package/dist/react/blocks/symbol/symbol.js +63 -0
- package/dist/react/blocks/text/component-info.js +22 -0
- package/dist/react/blocks/text/text.js +4 -0
- package/dist/react/blocks/textarea/component-info.js +45 -0
- package/dist/react/blocks/textarea/textarea.js +4 -0
- package/dist/react/blocks/util.js +6 -0
- package/dist/react/blocks/video/component-info.js +104 -0
- package/dist/react/blocks/video/video.js +48 -0
- package/dist/react/components/render-block/block-styles.js +48 -0
- package/dist/react/components/render-block/render-block.helpers.js +104 -0
- package/dist/react/components/render-block/render-block.js +122 -0
- package/dist/react/components/render-block/render-component-with-context.js +27 -0
- package/dist/react/components/render-block/render-component.js +10 -0
- package/dist/react/components/render-block/render-repeated-block.js +15 -0
- package/dist/react/components/render-block/types.js +1 -0
- package/dist/react/components/render-blocks.js +45 -0
- package/dist/react/components/render-content/builder-editing.js +4 -0
- package/dist/react/components/render-content/components/render-styles.js +59 -0
- package/dist/react/components/render-content/index.js +2 -0
- package/dist/react/components/render-content/render-content.js +285 -0
- package/dist/react/components/render-inlined-styles.js +15 -0
- package/dist/react/constants/builder-registered-components.js +52 -0
- package/dist/react/constants/device-sizes.js +45 -0
- package/dist/react/constants/target.js +2 -0
- package/dist/react/context/builder.context.js +10 -0
- package/dist/react/context/types.js +1 -0
- package/dist/react/functions/camel-to-kebab-case.js +2 -0
- package/dist/react/functions/evaluate.js +22 -0
- package/dist/react/functions/event-handler-name.js +5 -0
- package/dist/react/functions/extract-text-styles.js +20 -0
- package/dist/react/functions/fast-clone.js +2 -0
- package/dist/react/functions/get-block-actions-handler.js +9 -0
- package/dist/react/functions/get-block-actions.js +16 -0
- package/dist/react/functions/get-block-component-options.js +26 -0
- package/dist/react/functions/get-block-properties.js +48 -0
- package/dist/react/functions/get-block-tag.js +4 -0
- package/dist/react/functions/get-builder-search-params/fn.test.js +13 -0
- package/dist/react/functions/get-builder-search-params/index.js +33 -0
- package/dist/react/functions/get-content/ab-testing.js +86 -0
- package/dist/react/functions/get-content/generate-content-url.js +41 -0
- package/dist/react/functions/get-content/generate-content-url.test.js +31 -0
- package/dist/react/functions/get-content/index.js +64 -0
- package/dist/react/functions/get-content/types.js +1 -0
- package/dist/react/functions/get-fetch.js +12 -0
- package/dist/react/functions/get-global-this.js +16 -0
- package/dist/react/functions/get-processed-block.js +49 -0
- package/dist/react/functions/get-processed-block.test.js +32 -0
- package/dist/react/functions/get-react-native-block-styles.js +27 -0
- package/dist/react/functions/if-target.js +10 -0
- package/dist/react/functions/is-browser.js +4 -0
- package/dist/react/functions/is-editing.js +5 -0
- package/dist/react/functions/is-iframe.js +5 -0
- package/dist/react/functions/is-previewing.js +12 -0
- package/dist/react/functions/on-change.js +24 -0
- package/dist/react/functions/on-change.test.js +19 -0
- package/dist/react/functions/register-component.js +60 -0
- package/dist/react/functions/register.js +28 -0
- package/dist/react/functions/sanitize-react-native-block-styles.js +68 -0
- package/dist/react/functions/set-editor-settings.js +13 -0
- package/dist/react/functions/set.js +9 -0
- package/dist/react/functions/set.test.js +16 -0
- package/dist/react/functions/track/helpers.js +50 -0
- package/dist/react/functions/track/index.js +120 -0
- package/dist/react/functions/track/interaction.js +48 -0
- package/dist/react/functions/track.js +116 -0
- package/dist/react/functions/transform-block-properties.js +4 -0
- package/dist/react/functions/transform-block.js +4 -0
- package/dist/react/helpers/ab-tests.js +6 -0
- package/dist/react/helpers/cookie.js +70 -0
- package/dist/react/helpers/css.js +28 -0
- package/dist/react/helpers/flatten.js +32 -0
- package/dist/react/helpers/localStorage.js +27 -0
- package/dist/react/helpers/nullable.js +2 -0
- package/dist/react/helpers/sessionId.js +46 -0
- package/dist/react/helpers/time.js +3 -0
- package/dist/react/helpers/url.js +11 -0
- package/dist/react/helpers/url.test.js +21 -0
- package/dist/react/helpers/uuid.js +10 -0
- package/dist/react/helpers/visitorId.js +28 -0
- package/dist/react/index-helpers/blocks-exports.js +11 -0
- package/dist/react/index-helpers/top-of-file.js +2 -0
- package/dist/react/index.js +12 -0
- package/dist/react/scripts/init-editing.js +93 -0
- package/dist/react/types/builder-block.js +1 -0
- package/dist/react/types/builder-content.js +1 -0
- package/dist/react/types/can-track.js +1 -0
- package/dist/react/types/components.js +1 -0
- package/dist/react/types/deep-partial.js +1 -0
- package/dist/react/types/element.js +1 -0
- package/dist/react/types/targets.js +1 -0
- package/dist/react/types/typescript.js +1 -0
- package/dist/rsc/blocks/BaseText.js +7 -0
- package/dist/rsc/blocks/button/button.js +10 -0
- package/dist/rsc/blocks/button/component-info.js +39 -0
- package/dist/rsc/blocks/columns/columns.js +136 -0
- package/dist/rsc/blocks/columns/component-info.js +241 -0
- package/dist/rsc/blocks/custom-code/component-info.js +29 -0
- package/dist/rsc/blocks/custom-code/custom-code.js +45 -0
- package/dist/rsc/blocks/embed/component-info.js +44 -0
- package/dist/rsc/blocks/embed/embed.js +36 -0
- package/dist/rsc/blocks/embed/helpers.js +7 -0
- package/dist/rsc/blocks/form/component-info.js +260 -0
- package/dist/rsc/blocks/form/form.js +204 -0
- package/dist/rsc/blocks/fragment/component-info.js +9 -0
- package/dist/rsc/blocks/fragment/fragment.js +5 -0
- package/dist/rsc/blocks/image/component-info.js +149 -0
- package/dist/rsc/blocks/image/image.helpers.js +46 -0
- package/dist/rsc/blocks/image/image.js +85 -0
- package/dist/rsc/blocks/img/component-info.js +18 -0
- package/dist/rsc/blocks/img/img.js +9 -0
- package/dist/rsc/blocks/input/component-info.js +72 -0
- package/dist/rsc/blocks/input/input.js +6 -0
- package/dist/rsc/blocks/raw-text/component-info.js +14 -0
- package/dist/rsc/blocks/raw-text/raw-text.js +5 -0
- package/dist/rsc/blocks/section/component-info.js +47 -0
- package/dist/rsc/blocks/section/section.js +18 -0
- package/dist/rsc/blocks/select/component-info.js +57 -0
- package/dist/rsc/blocks/select/select.js +6 -0
- package/dist/rsc/blocks/submit-button/component-info.js +26 -0
- package/dist/rsc/blocks/submit-button/submit-button.js +5 -0
- package/dist/rsc/blocks/symbol/component-info.js +41 -0
- package/dist/rsc/blocks/symbol/symbol.js +37 -0
- package/dist/rsc/blocks/text/component-info.js +22 -0
- package/dist/rsc/blocks/text/text.js +5 -0
- package/dist/rsc/blocks/textarea/component-info.js +45 -0
- package/dist/rsc/blocks/textarea/textarea.js +5 -0
- package/dist/rsc/blocks/util.js +6 -0
- package/dist/rsc/blocks/video/component-info.js +104 -0
- package/dist/rsc/blocks/video/video.js +51 -0
- package/dist/rsc/components/render-block/block-styles.js +51 -0
- package/dist/rsc/components/render-block/render-block.helpers.js +104 -0
- package/dist/rsc/components/render-block/render-block.js +126 -0
- package/dist/rsc/components/render-block/render-component-with-context.js +27 -0
- package/dist/rsc/components/render-block/render-component.js +11 -0
- package/dist/rsc/components/render-block/render-repeated-block.js +15 -0
- package/dist/rsc/components/render-block/types.js +1 -0
- package/dist/rsc/components/render-blocks.js +47 -0
- package/dist/rsc/components/render-content/builder-editing.js +5 -0
- package/dist/rsc/components/render-content/components/render-styles.js +62 -0
- package/dist/rsc/components/render-content/index.js +2 -0
- package/dist/rsc/components/render-content/render-content.js +201 -0
- package/dist/rsc/components/render-inlined-styles.js +18 -0
- package/dist/rsc/constants/builder-registered-components.js +52 -0
- package/dist/rsc/constants/device-sizes.js +45 -0
- package/dist/rsc/constants/target.js +2 -0
- package/dist/rsc/context/builder.context.js +9 -0
- package/dist/rsc/context/types.js +1 -0
- package/dist/rsc/functions/camel-to-kebab-case.js +2 -0
- package/dist/rsc/functions/evaluate.js +4 -0
- package/dist/rsc/functions/event-handler-name.js +5 -0
- package/dist/rsc/functions/extract-text-styles.js +20 -0
- package/dist/rsc/functions/fast-clone.js +2 -0
- package/dist/rsc/functions/get-block-actions-handler.js +9 -0
- package/dist/rsc/functions/get-block-actions.js +16 -0
- package/dist/rsc/functions/get-block-component-options.js +26 -0
- package/dist/rsc/functions/get-block-properties.js +48 -0
- package/dist/rsc/functions/get-block-tag.js +4 -0
- package/dist/rsc/functions/get-builder-search-params/fn.test.js +13 -0
- package/dist/rsc/functions/get-builder-search-params/index.js +33 -0
- package/dist/rsc/functions/get-content/ab-testing.js +86 -0
- package/dist/rsc/functions/get-content/generate-content-url.js +41 -0
- package/dist/rsc/functions/get-content/generate-content-url.test.js +31 -0
- package/dist/rsc/functions/get-content/index.js +64 -0
- package/dist/rsc/functions/get-content/types.js +1 -0
- package/dist/rsc/functions/get-fetch.js +12 -0
- package/dist/rsc/functions/get-global-this.js +16 -0
- package/dist/rsc/functions/get-processed-block.js +49 -0
- package/dist/rsc/functions/get-processed-block.test.js +32 -0
- package/dist/rsc/functions/get-react-native-block-styles.js +27 -0
- package/dist/rsc/functions/if-target.js +10 -0
- package/dist/rsc/functions/is-browser.js +4 -0
- package/dist/rsc/functions/is-editing.js +5 -0
- package/dist/rsc/functions/is-iframe.js +5 -0
- package/dist/rsc/functions/is-previewing.js +12 -0
- package/dist/rsc/functions/on-change.js +24 -0
- package/dist/rsc/functions/on-change.test.js +19 -0
- package/dist/rsc/functions/register-component.js +60 -0
- package/dist/rsc/functions/register.js +28 -0
- package/dist/rsc/functions/sanitize-react-native-block-styles.js +68 -0
- package/dist/rsc/functions/set-editor-settings.js +13 -0
- package/dist/rsc/functions/set.js +9 -0
- package/dist/rsc/functions/set.test.js +16 -0
- package/dist/rsc/functions/track/helpers.js +50 -0
- package/dist/rsc/functions/track/index.js +120 -0
- package/dist/rsc/functions/track/interaction.js +48 -0
- package/dist/rsc/functions/track.js +116 -0
- package/dist/rsc/functions/transform-block-properties.js +4 -0
- package/dist/rsc/functions/transform-block.js +4 -0
- package/dist/rsc/helpers/ab-tests.js +6 -0
- package/dist/rsc/helpers/cookie.js +70 -0
- package/dist/rsc/helpers/css.js +28 -0
- package/dist/rsc/helpers/flatten.js +32 -0
- package/dist/rsc/helpers/localStorage.js +27 -0
- package/dist/rsc/helpers/nullable.js +2 -0
- package/dist/rsc/helpers/sessionId.js +46 -0
- package/dist/rsc/helpers/time.js +3 -0
- package/dist/rsc/helpers/url.js +11 -0
- package/dist/rsc/helpers/url.test.js +21 -0
- package/dist/rsc/helpers/uuid.js +10 -0
- package/dist/rsc/helpers/visitorId.js +28 -0
- package/dist/rsc/index-helpers/blocks-exports.js +11 -0
- package/dist/rsc/index-helpers/top-of-file.js +2 -0
- package/dist/rsc/index.js +12 -0
- package/dist/rsc/scripts/init-editing.js +93 -0
- package/dist/rsc/types/builder-block.js +1 -0
- package/dist/rsc/types/builder-content.js +1 -0
- package/dist/rsc/types/can-track.js +1 -0
- package/dist/rsc/types/components.js +1 -0
- package/dist/rsc/types/deep-partial.js +1 -0
- package/dist/rsc/types/element.js +1 -0
- package/dist/rsc/types/targets.js +1 -0
- package/dist/rsc/types/typescript.js +1 -0
- package/package.json +11 -6
- package/packages/_rsc/src/blocks/BaseText.jsx +10 -0
- package/packages/_rsc/src/blocks/button/button.jsx +29 -0
- package/packages/_rsc/src/blocks/columns/{columns.js → columns.jsx} +80 -61
- package/packages/_rsc/src/blocks/custom-code/custom-code.jsx +55 -0
- package/packages/_rsc/src/blocks/embed/embed.jsx +43 -0
- package/packages/_rsc/src/blocks/form/form.jsx +259 -0
- package/packages/_rsc/src/blocks/fragment/fragment.jsx +7 -0
- package/packages/_rsc/src/blocks/image/image.jsx +124 -0
- package/packages/_rsc/src/blocks/img/img.jsx +19 -0
- package/packages/_rsc/src/blocks/input/input.jsx +21 -0
- package/packages/_rsc/src/blocks/raw-text/raw-text.jsx +12 -0
- package/packages/_rsc/src/blocks/section/section.jsx +29 -0
- package/packages/_rsc/src/blocks/select/select.jsx +22 -0
- package/packages/_rsc/src/blocks/submit-button/submit-button.jsx +11 -0
- package/packages/_rsc/src/blocks/symbol/symbol.jsx +56 -0
- package/packages/_rsc/src/blocks/text/text.jsx +12 -0
- package/packages/_rsc/src/blocks/textarea/textarea.jsx +15 -0
- package/packages/_rsc/src/blocks/video/video.jsx +61 -0
- package/packages/_rsc/src/components/render-block/block-styles.jsx +72 -0
- package/packages/_rsc/src/components/render-block/render-block.jsx +251 -0
- package/packages/_rsc/src/components/render-block/render-component-with-context.jsx +38 -0
- package/packages/_rsc/src/components/render-block/render-component.jsx +37 -0
- package/packages/_rsc/src/components/render-block/render-repeated-block.jsx +36 -0
- package/packages/_rsc/src/components/render-blocks.jsx +90 -0
- package/packages/_rsc/src/components/render-content/builder-editing.jsx +7 -0
- package/packages/_rsc/src/components/render-content/components/render-styles.jsx +70 -0
- package/packages/_rsc/src/components/render-content/render-content.jsx +259 -0
- package/packages/_rsc/src/components/render-inlined-styles.jsx +33 -0
- package/packages/_rsc/src/helpers/cookie.js +4 -2
- package/packages/_rsc/src/helpers/localStorage.js +1 -0
- package/packages/_rsc/src/helpers/sessionId.js +4 -1
- package/packages/_rsc/src/helpers/url.js +3 -0
- package/packages/_rsc/src/helpers/url.test.js +6 -0
- package/packages/_rsc/src/helpers/visitorId.js +1 -0
- package/packages/react/src/blocks/BaseText.jsx +9 -0
- package/packages/react/src/blocks/button/button.jsx +27 -0
- package/packages/react/src/blocks/button/component-info.js +41 -0
- package/packages/react/src/blocks/columns/columns.jsx +172 -0
- package/packages/react/src/blocks/columns/component-info.js +242 -0
- package/packages/react/src/blocks/custom-code/component-info.js +31 -0
- package/packages/react/src/blocks/custom-code/custom-code.jsx +64 -0
- package/packages/react/src/blocks/embed/component-info.js +44 -0
- package/packages/react/src/blocks/embed/embed.jsx +49 -0
- package/packages/react/src/blocks/embed/helpers.js +9 -0
- package/packages/react/src/blocks/form/component-info.js +262 -0
- package/packages/react/src/blocks/form/form.jsx +253 -0
- package/packages/react/src/blocks/fragment/component-info.js +11 -0
- package/packages/react/src/blocks/fragment/fragment.jsx +5 -0
- package/packages/react/src/blocks/image/component-info.js +151 -0
- package/packages/react/src/blocks/image/image.helpers.js +48 -0
- package/packages/react/src/blocks/image/image.jsx +120 -0
- package/packages/react/src/blocks/img/component-info.js +20 -0
- package/packages/react/src/blocks/img/img.jsx +17 -0
- package/packages/react/src/blocks/input/component-info.js +74 -0
- package/packages/react/src/blocks/input/input.jsx +19 -0
- package/packages/react/src/blocks/raw-text/component-info.js +16 -0
- package/packages/react/src/blocks/raw-text/raw-text.jsx +10 -0
- package/packages/react/src/blocks/section/component-info.js +49 -0
- package/packages/react/src/blocks/section/section.jsx +27 -0
- package/packages/react/src/blocks/select/component-info.js +59 -0
- package/packages/react/src/blocks/select/select.jsx +20 -0
- package/packages/react/src/blocks/submit-button/component-info.js +28 -0
- package/packages/react/src/blocks/submit-button/submit-button.jsx +9 -0
- package/packages/react/src/blocks/symbol/component-info.js +43 -0
- package/packages/react/src/blocks/symbol/symbol.jsx +86 -0
- package/packages/react/src/blocks/text/component-info.js +24 -0
- package/packages/react/src/blocks/text/text.jsx +10 -0
- package/packages/react/src/blocks/textarea/component-info.js +47 -0
- package/packages/react/src/blocks/textarea/textarea.jsx +13 -0
- package/packages/react/src/blocks/util.js +8 -0
- package/packages/react/src/blocks/video/component-info.js +106 -0
- package/packages/react/src/blocks/video/video.jsx +58 -0
- package/packages/react/src/components/render-block/block-styles.jsx +69 -0
- package/packages/react/src/components/render-block/render-block.helpers.js +113 -0
- package/packages/react/src/components/render-block/render-block.jsx +184 -0
- package/packages/react/src/components/render-block/render-component.jsx +33 -0
- package/packages/react/src/components/render-block/render-repeated-block.jsx +21 -0
- package/packages/react/src/components/render-block/types.js +0 -0
- package/packages/react/src/components/render-blocks.jsx +89 -0
- package/packages/react/src/components/render-content/builder-editing.jsx +5 -0
- package/packages/react/src/components/render-content/components/render-styles.jsx +64 -0
- package/packages/react/src/components/render-content/index.js +4 -0
- package/packages/react/src/components/render-content/render-content.jsx +372 -0
- package/packages/react/src/components/render-inlined-styles.jsx +28 -0
- package/packages/react/src/constants/builder-registered-components.js +54 -0
- package/packages/react/src/constants/device-sizes.js +48 -0
- package/packages/react/src/constants/target.js +4 -0
- package/packages/react/src/context/builder.context.js +12 -0
- package/packages/react/src/context/types.js +0 -0
- package/packages/react/src/functions/camel-to-kebab-case.js +4 -0
- package/packages/react/src/functions/evaluate.js +29 -0
- package/packages/react/src/functions/event-handler-name.js +7 -0
- package/packages/react/src/functions/extract-text-styles.js +22 -0
- package/packages/react/src/functions/fast-clone.js +4 -0
- package/packages/react/src/functions/get-block-actions-handler.js +11 -0
- package/packages/react/src/functions/get-block-actions.js +18 -0
- package/packages/{_rsc/src/blocks/textarea/textarea.js → react/src/functions/get-block-component-options.js} +6 -10
- package/packages/react/src/functions/get-block-properties.js +50 -0
- package/packages/react/src/functions/get-block-tag.js +6 -0
- package/packages/react/src/functions/get-builder-search-params/fn.test.js +13 -0
- package/packages/react/src/functions/get-builder-search-params/index.js +38 -0
- package/packages/react/src/functions/get-content/ab-testing.js +99 -0
- package/packages/react/src/functions/get-content/generate-content-url.js +55 -0
- package/packages/react/src/functions/get-content/generate-content-url.test.js +31 -0
- package/packages/react/src/functions/get-content/index.js +65 -0
- package/packages/react/src/functions/get-content/types.js +0 -0
- package/packages/react/src/functions/get-fetch.js +14 -0
- package/packages/react/src/functions/get-global-this.js +18 -0
- package/packages/react/src/functions/get-processed-block.js +59 -0
- package/packages/react/src/functions/get-processed-block.test.js +32 -0
- package/packages/{_rsc/src/blocks/BaseText.js → react/src/functions/get-react-native-block-styles.js} +14 -8
- package/packages/react/src/functions/if-target.js +15 -0
- package/packages/react/src/functions/is-browser.js +6 -0
- package/packages/react/src/functions/is-editing.js +7 -0
- package/packages/react/src/functions/is-iframe.js +7 -0
- package/packages/react/src/functions/is-previewing.js +14 -0
- package/packages/react/src/functions/on-change.js +27 -0
- package/packages/react/src/functions/on-change.test.js +19 -0
- package/packages/react/src/functions/register-component.js +68 -0
- package/packages/react/src/functions/register.js +29 -0
- package/packages/react/src/functions/sanitize-react-native-block-styles.js +66 -0
- package/packages/react/src/functions/set-editor-settings.js +15 -0
- package/packages/react/src/functions/set.js +11 -0
- package/packages/react/src/functions/set.test.js +16 -0
- package/packages/react/src/functions/track/helpers.js +50 -0
- package/packages/react/src/functions/track/index.js +128 -0
- package/packages/react/src/functions/track/interaction.js +53 -0
- package/packages/react/src/functions/transform-block-properties.js +6 -0
- package/packages/react/src/functions/transform-block.js +6 -0
- package/packages/react/src/helpers/ab-tests.js +16 -0
- package/packages/react/src/helpers/cookie.js +81 -0
- package/packages/react/src/helpers/css.js +34 -0
- package/packages/{_rsc/src/blocks/input/input.js → react/src/helpers/flatten.js} +12 -14
- package/packages/react/src/helpers/localStorage.js +35 -0
- package/packages/react/src/helpers/nullable.js +4 -0
- package/packages/react/src/helpers/sessionId.js +52 -0
- package/packages/react/src/helpers/time.js +5 -0
- package/packages/react/src/helpers/url.js +13 -0
- package/packages/react/src/helpers/url.test.js +21 -0
- package/packages/react/src/helpers/uuid.js +13 -0
- package/packages/react/src/helpers/visitorId.js +34 -0
- package/packages/react/src/index-helpers/blocks-exports.js +22 -0
- package/packages/react/src/index-helpers/top-of-file.js +4 -0
- package/packages/react/src/index.js +14 -0
- package/packages/react/src/scripts/init-editing.js +93 -0
- package/packages/react/src/types/builder-block.js +0 -0
- package/packages/react/src/types/builder-content.js +0 -0
- package/packages/react/src/types/can-track.js +0 -0
- package/packages/react/src/types/components.js +0 -0
- package/packages/react/src/types/deep-partial.js +0 -0
- package/packages/react/src/types/element.js +0 -0
- package/packages/react/src/types/targets.js +0 -0
- package/packages/react/src/types/typescript.js +0 -0
- package/packages/rsc/src/blocks/BaseText.jsx +10 -0
- package/packages/rsc/src/blocks/button/button.jsx +29 -0
- package/packages/rsc/src/blocks/button/component-info.js +41 -0
- package/packages/rsc/src/blocks/columns/columns.jsx +172 -0
- package/packages/rsc/src/blocks/columns/component-info.js +242 -0
- package/packages/rsc/src/blocks/custom-code/component-info.js +31 -0
- package/packages/rsc/src/blocks/custom-code/custom-code.jsx +55 -0
- package/packages/rsc/src/blocks/embed/component-info.js +44 -0
- package/packages/rsc/src/blocks/embed/embed.jsx +43 -0
- package/packages/rsc/src/blocks/embed/helpers.js +9 -0
- package/packages/rsc/src/blocks/form/component-info.js +262 -0
- package/packages/rsc/src/blocks/form/form.jsx +259 -0
- package/packages/rsc/src/blocks/fragment/component-info.js +11 -0
- package/packages/rsc/src/blocks/fragment/fragment.jsx +7 -0
- package/packages/rsc/src/blocks/image/component-info.js +151 -0
- package/packages/rsc/src/blocks/image/image.helpers.js +48 -0
- package/packages/rsc/src/blocks/image/image.jsx +122 -0
- package/packages/rsc/src/blocks/img/component-info.js +20 -0
- package/packages/rsc/src/blocks/img/img.jsx +19 -0
- package/packages/rsc/src/blocks/input/component-info.js +74 -0
- package/packages/rsc/src/blocks/input/input.jsx +21 -0
- package/packages/rsc/src/blocks/raw-text/component-info.js +16 -0
- package/packages/rsc/src/blocks/raw-text/raw-text.jsx +12 -0
- package/packages/rsc/src/blocks/section/component-info.js +49 -0
- package/packages/rsc/src/blocks/section/section.jsx +29 -0
- package/packages/rsc/src/blocks/select/component-info.js +59 -0
- package/packages/rsc/src/blocks/select/select.jsx +22 -0
- package/packages/rsc/src/blocks/submit-button/component-info.js +28 -0
- package/packages/rsc/src/blocks/submit-button/submit-button.jsx +11 -0
- package/packages/rsc/src/blocks/symbol/component-info.js +43 -0
- package/packages/rsc/src/blocks/symbol/symbol.jsx +56 -0
- package/packages/rsc/src/blocks/text/component-info.js +24 -0
- package/packages/rsc/src/blocks/text/text.jsx +12 -0
- package/packages/rsc/src/blocks/textarea/component-info.js +47 -0
- package/packages/rsc/src/blocks/textarea/textarea.jsx +15 -0
- package/packages/rsc/src/blocks/util.js +8 -0
- package/packages/rsc/src/blocks/video/component-info.js +106 -0
- package/packages/rsc/src/blocks/video/video.jsx +61 -0
- package/packages/rsc/src/components/render-block/block-styles.jsx +72 -0
- package/packages/rsc/src/components/render-block/render-block.helpers.js +113 -0
- package/packages/rsc/src/components/render-block/render-block.jsx +183 -0
- package/packages/rsc/src/components/render-block/render-component.jsx +37 -0
- package/packages/rsc/src/components/render-block/render-repeated-block.jsx +24 -0
- package/packages/rsc/src/components/render-block/types.js +0 -0
- package/packages/rsc/src/components/render-blocks.jsx +90 -0
- package/packages/rsc/src/components/render-content/builder-editing.jsx +7 -0
- package/packages/rsc/src/components/render-content/components/render-styles.jsx +70 -0
- package/packages/rsc/src/components/render-content/index.js +4 -0
- package/packages/rsc/src/components/render-content/render-content.jsx +245 -0
- package/packages/rsc/src/components/render-inlined-styles.jsx +33 -0
- package/packages/rsc/src/constants/builder-registered-components.js +54 -0
- package/packages/rsc/src/constants/device-sizes.js +48 -0
- package/packages/rsc/src/constants/target.js +4 -0
- package/packages/rsc/src/context/builder.context.js +11 -0
- package/packages/rsc/src/context/types.js +0 -0
- package/packages/rsc/src/functions/camel-to-kebab-case.js +4 -0
- package/packages/rsc/src/functions/evaluate.js +6 -0
- package/packages/rsc/src/functions/event-handler-name.js +7 -0
- package/packages/rsc/src/functions/extract-text-styles.js +22 -0
- package/packages/rsc/src/functions/fast-clone.js +4 -0
- package/packages/rsc/src/functions/get-block-actions-handler.js +11 -0
- package/packages/rsc/src/functions/get-block-actions.js +18 -0
- package/packages/{_rsc/src/blocks/text/text.js → rsc/src/functions/get-block-component-options.js} +8 -7
- package/packages/rsc/src/functions/get-block-properties.js +50 -0
- package/packages/rsc/src/functions/get-block-tag.js +6 -0
- package/packages/rsc/src/functions/get-builder-search-params/fn.test.js +13 -0
- package/packages/rsc/src/functions/get-builder-search-params/index.js +38 -0
- package/packages/rsc/src/functions/get-content/ab-testing.js +99 -0
- package/packages/rsc/src/functions/get-content/generate-content-url.js +55 -0
- package/packages/rsc/src/functions/get-content/generate-content-url.test.js +31 -0
- package/packages/rsc/src/functions/get-content/index.js +65 -0
- package/packages/rsc/src/functions/get-content/types.js +0 -0
- package/packages/rsc/src/functions/get-fetch.js +14 -0
- package/packages/rsc/src/functions/get-global-this.js +18 -0
- package/packages/rsc/src/functions/get-processed-block.js +59 -0
- package/packages/rsc/src/functions/get-processed-block.test.js +32 -0
- package/packages/{_rsc/src/blocks/raw-text/raw-text.js → rsc/src/functions/get-react-native-block-styles.js} +14 -9
- package/packages/rsc/src/functions/if-target.js +15 -0
- package/packages/rsc/src/functions/is-browser.js +6 -0
- package/packages/rsc/src/functions/is-editing.js +7 -0
- package/packages/rsc/src/functions/is-iframe.js +7 -0
- package/packages/rsc/src/functions/is-previewing.js +14 -0
- package/packages/rsc/src/functions/on-change.js +27 -0
- package/packages/rsc/src/functions/on-change.test.js +19 -0
- package/packages/rsc/src/functions/register-component.js +68 -0
- package/packages/rsc/src/functions/register.js +29 -0
- package/packages/rsc/src/functions/sanitize-react-native-block-styles.js +66 -0
- package/packages/rsc/src/functions/set-editor-settings.js +15 -0
- package/packages/rsc/src/functions/set.js +11 -0
- package/packages/rsc/src/functions/set.test.js +16 -0
- package/packages/rsc/src/functions/track/helpers.js +50 -0
- package/packages/rsc/src/functions/track/index.js +128 -0
- package/packages/rsc/src/functions/track/interaction.js +53 -0
- package/packages/rsc/src/functions/transform-block-properties.js +6 -0
- package/packages/rsc/src/functions/transform-block.js +6 -0
- package/packages/rsc/src/helpers/ab-tests.js +16 -0
- package/packages/rsc/src/helpers/cookie.js +81 -0
- package/packages/rsc/src/helpers/css.js +34 -0
- package/packages/{_rsc/src/blocks/section/section.js → rsc/src/helpers/flatten.js} +12 -18
- package/packages/rsc/src/helpers/localStorage.js +35 -0
- package/packages/rsc/src/helpers/nullable.js +4 -0
- package/packages/rsc/src/helpers/sessionId.js +52 -0
- package/packages/rsc/src/helpers/time.js +5 -0
- package/packages/rsc/src/helpers/url.js +13 -0
- package/packages/rsc/src/helpers/url.test.js +21 -0
- package/packages/rsc/src/helpers/uuid.js +13 -0
- package/packages/rsc/src/helpers/visitorId.js +34 -0
- package/packages/rsc/src/index-helpers/blocks-exports.js +22 -0
- package/packages/rsc/src/index-helpers/top-of-file.js +2 -0
- package/packages/rsc/src/index.js +14 -0
- package/packages/rsc/src/scripts/init-editing.js +93 -0
- package/packages/rsc/src/types/builder-block.js +0 -0
- package/packages/rsc/src/types/builder-content.js +0 -0
- package/packages/rsc/src/types/can-track.js +0 -0
- package/packages/rsc/src/types/components.js +0 -0
- package/packages/rsc/src/types/deep-partial.js +0 -0
- package/packages/rsc/src/types/element.js +0 -0
- package/packages/rsc/src/types/targets.js +0 -0
- package/packages/rsc/src/types/typescript.js +0 -0
- package/src/blocks/BaseText.jsx +4 -7
- package/src/blocks/button/button.jsx +25 -32
- package/src/blocks/columns/columns.jsx +83 -59
- package/src/blocks/custom-code/custom-code.jsx +29 -15
- package/src/blocks/embed/embed.jsx +15 -11
- package/src/blocks/form/form.jsx +184 -148
- package/src/blocks/fragment/fragment.jsx +3 -5
- package/src/blocks/image/image.jsx +80 -56
- package/src/blocks/img/img.jsx +14 -29
- package/src/blocks/input/input.jsx +16 -32
- package/src/blocks/raw-text/raw-text.jsx +8 -9
- package/src/blocks/section/section.jsx +25 -37
- package/src/blocks/select/select.jsx +17 -32
- package/src/blocks/submit-button/submit-button.jsx +7 -23
- package/src/blocks/symbol/symbol.jsx +59 -48
- package/src/blocks/text/text.jsx +8 -8
- package/src/blocks/textarea/textarea.jsx +11 -29
- package/src/blocks/video/video.jsx +52 -48
- package/src/components/render-block/block-styles.jsx +48 -29
- package/src/components/render-block/render-block.jsx +150 -100
- package/src/components/render-block/render-component-with-context.jsx +35 -32
- package/src/components/render-block/render-component.jsx +30 -32
- package/src/components/render-block/render-repeated-block.jsx +30 -30
- package/src/components/render-blocks.jsx +73 -47
- package/src/components/render-content/builder-editing.jsx +3 -5
- package/src/components/render-content/components/render-styles.jsx +21 -15
- package/src/components/render-content/index.js +1 -1
- package/src/components/render-content/render-content.jsx +209 -134
- package/src/components/render-inlined-styles.jsx +19 -8
- package/src/constants/builder-registered-components.js +11 -11
- package/src/helpers/cookie.js +4 -2
- package/src/helpers/localStorage.js +1 -0
- package/src/helpers/sessionId.js +4 -1
- package/src/helpers/url.js +3 -0
- package/src/helpers/url.test.js +6 -0
- package/src/helpers/visitorId.js +1 -0
- package/src/index-helpers/blocks-exports.js +10 -10
- package/tsconfig.base.json +18 -0
- package/tsconfig.react.json +7 -0
- package/tsconfig.rsc.json +7 -0
- package/packages/_rsc/src/blocks/button/button.js +0 -35
- package/packages/_rsc/src/blocks/custom-code/custom-code.js +0 -63
- package/packages/_rsc/src/blocks/embed/embed.js +0 -55
- package/packages/_rsc/src/blocks/form/form.js +0 -222
- package/packages/_rsc/src/blocks/fragment/fragment.js +0 -24
- package/packages/_rsc/src/blocks/image/image.js +0 -101
- package/packages/_rsc/src/blocks/img/img.js +0 -33
- package/packages/_rsc/src/blocks/select/select.js +0 -36
- package/packages/_rsc/src/blocks/submit-button/submit-button.js +0 -26
- package/packages/_rsc/src/blocks/symbol/symbol.js +0 -60
- package/packages/_rsc/src/blocks/video/video.js +0 -57
- package/packages/_rsc/src/components/render-block/block-styles.js +0 -70
- package/packages/_rsc/src/components/render-block/render-block.js +0 -211
- package/packages/_rsc/src/components/render-block/render-component-with-context.js +0 -51
- package/packages/_rsc/src/components/render-block/render-component.js +0 -43
- package/packages/_rsc/src/components/render-block/render-repeated-block.js +0 -49
- package/packages/_rsc/src/components/render-blocks.js +0 -80
- package/packages/_rsc/src/components/render-content/builder-editing.js +0 -35
- package/packages/_rsc/src/components/render-content/components/render-styles.js +0 -78
- package/packages/_rsc/src/components/render-content/render-content.js +0 -215
- package/packages/_rsc/src/components/render-inlined-styles.js +0 -36
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __defProps = Object.defineProperties;
|
|
3
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
-
var __spreadValues = (a, b) => {
|
|
9
|
-
for (var prop in b || (b = {}))
|
|
10
|
-
if (__hasOwnProp.call(b, prop))
|
|
11
|
-
__defNormalProp(a, prop, b[prop]);
|
|
12
|
-
if (__getOwnPropSymbols)
|
|
13
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
-
if (__propIsEnum.call(b, prop))
|
|
15
|
-
__defNormalProp(a, prop, b[prop]);
|
|
16
|
-
}
|
|
17
|
-
return a;
|
|
18
|
-
};
|
|
19
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
-
import * as React from "react";
|
|
21
|
-
import RenderContent from "../../components/render-content/render-content.js";
|
|
22
|
-
import { TARGET } from "../../constants/target";
|
|
23
|
-
function Symbol(props) {
|
|
24
|
-
var _a, _b, _c, _d, _e;
|
|
25
|
-
const _context = __spreadValues({}, props["_context"]);
|
|
26
|
-
const state = {
|
|
27
|
-
get className() {
|
|
28
|
-
var _a2, _b2;
|
|
29
|
-
return [
|
|
30
|
-
...TARGET === "vue2" || TARGET === "vue3" ? Object.keys(props.attributes.class) : [props.attributes.class],
|
|
31
|
-
"builder-symbol",
|
|
32
|
-
((_a2 = props.symbol) == null ? void 0 : _a2.inline) ? "builder-inline-symbol" : void 0,
|
|
33
|
-
((_b2 = props.symbol) == null ? void 0 : _b2.dynamic) || props.dynamic ? "builder-dynamic-symbol" : void 0
|
|
34
|
-
].filter(Boolean).join(" ");
|
|
35
|
-
},
|
|
36
|
-
fetchedContent: null,
|
|
37
|
-
get contentToUse() {
|
|
38
|
-
var _a2;
|
|
39
|
-
return ((_a2 = props.symbol) == null ? void 0 : _a2.content) || state.fetchedContent;
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
const builderContext = _context["BuilderContext"];
|
|
43
|
-
return /* @__PURE__ */ React.createElement("div", __spreadProps(__spreadValues({}, props.attributes), {
|
|
44
|
-
dataSet: {
|
|
45
|
-
class: state.className
|
|
46
|
-
},
|
|
47
|
-
className: state.className
|
|
48
|
-
}), /* @__PURE__ */ React.createElement(RenderContent, {
|
|
49
|
-
apiKey: builderContext.apiKey,
|
|
50
|
-
context: builderContext.context,
|
|
51
|
-
customComponents: Object.values(builderContext.registeredComponents),
|
|
52
|
-
data: __spreadValues(__spreadValues(__spreadValues({}, (_a = props.symbol) == null ? void 0 : _a.data), builderContext.state), (_d = (_c = (_b = props.symbol) == null ? void 0 : _b.content) == null ? void 0 : _c.data) == null ? void 0 : _d.state),
|
|
53
|
-
model: (_e = props.symbol) == null ? void 0 : _e.model,
|
|
54
|
-
content: state.contentToUse,
|
|
55
|
-
_context
|
|
56
|
-
}));
|
|
57
|
-
}
|
|
58
|
-
export {
|
|
59
|
-
Symbol as default
|
|
60
|
-
};
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __defProps = Object.defineProperties;
|
|
3
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
-
var __spreadValues = (a, b) => {
|
|
9
|
-
for (var prop in b || (b = {}))
|
|
10
|
-
if (__hasOwnProp.call(b, prop))
|
|
11
|
-
__defNormalProp(a, prop, b[prop]);
|
|
12
|
-
if (__getOwnPropSymbols)
|
|
13
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
-
if (__propIsEnum.call(b, prop))
|
|
15
|
-
__defNormalProp(a, prop, b[prop]);
|
|
16
|
-
}
|
|
17
|
-
return a;
|
|
18
|
-
};
|
|
19
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
-
import * as React from "react";
|
|
21
|
-
function Video(props) {
|
|
22
|
-
var _a;
|
|
23
|
-
const _context = __spreadValues({}, props["_context"]);
|
|
24
|
-
const state = {
|
|
25
|
-
get videoProps() {
|
|
26
|
-
return __spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({}, props.autoPlay === true ? {
|
|
27
|
-
autoPlay: true
|
|
28
|
-
} : {}), props.muted === true ? {
|
|
29
|
-
muted: true
|
|
30
|
-
} : {}), props.controls === true ? {
|
|
31
|
-
controls: true
|
|
32
|
-
} : {}), props.loop === true ? {
|
|
33
|
-
loop: true
|
|
34
|
-
} : {}), props.playsInline === true ? {
|
|
35
|
-
playsInline: true
|
|
36
|
-
} : {});
|
|
37
|
-
},
|
|
38
|
-
get spreadProps() {
|
|
39
|
-
return __spreadValues(__spreadValues({}, props.attributes), state.videoProps);
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
return /* @__PURE__ */ React.createElement("video", __spreadProps(__spreadValues({}, state.spreadProps), {
|
|
43
|
-
style: __spreadProps(__spreadValues({
|
|
44
|
-
width: "100%",
|
|
45
|
-
height: "100%"
|
|
46
|
-
}, (_a = props.attributes) == null ? void 0 : _a.style), {
|
|
47
|
-
objectFit: props.fit,
|
|
48
|
-
objectPosition: props.position,
|
|
49
|
-
borderRadius: 1
|
|
50
|
-
}),
|
|
51
|
-
src: props.video || "no-src",
|
|
52
|
-
poster: props.posterImage
|
|
53
|
-
}));
|
|
54
|
-
}
|
|
55
|
-
export {
|
|
56
|
-
Video as default
|
|
57
|
-
};
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
3
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
5
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
-
var __spreadValues = (a, b) => {
|
|
7
|
-
for (var prop in b || (b = {}))
|
|
8
|
-
if (__hasOwnProp.call(b, prop))
|
|
9
|
-
__defNormalProp(a, prop, b[prop]);
|
|
10
|
-
if (__getOwnPropSymbols)
|
|
11
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
12
|
-
if (__propIsEnum.call(b, prop))
|
|
13
|
-
__defNormalProp(a, prop, b[prop]);
|
|
14
|
-
}
|
|
15
|
-
return a;
|
|
16
|
-
};
|
|
17
|
-
import * as React from "react";
|
|
18
|
-
import {
|
|
19
|
-
getMaxWidthQueryForSize,
|
|
20
|
-
getSizesForBreakpoints
|
|
21
|
-
} from "../../constants/device-sizes.js";
|
|
22
|
-
import { TARGET } from "../../constants/target.js";
|
|
23
|
-
import { getProcessedBlock } from "../../functions/get-processed-block.js";
|
|
24
|
-
import { createCssClass } from "../../helpers/css.js";
|
|
25
|
-
import RenderInlinedStyles from "../render-inlined-styles.js";
|
|
26
|
-
function BlockStyles(props) {
|
|
27
|
-
const _context = __spreadValues({}, props["_context"]);
|
|
28
|
-
const state = {
|
|
29
|
-
get useBlock() {
|
|
30
|
-
return getProcessedBlock({
|
|
31
|
-
block: props.block,
|
|
32
|
-
state: props.context.state,
|
|
33
|
-
context: props.context.context,
|
|
34
|
-
shouldEvaluateBindings: true
|
|
35
|
-
});
|
|
36
|
-
},
|
|
37
|
-
get css() {
|
|
38
|
-
var _a;
|
|
39
|
-
const styles = state.useBlock.responsiveStyles;
|
|
40
|
-
const content = props.context.content;
|
|
41
|
-
const sizesWithUpdatedBreakpoints = getSizesForBreakpoints(((_a = content == null ? void 0 : content.meta) == null ? void 0 : _a.breakpoints) || {});
|
|
42
|
-
const largeStyles = styles == null ? void 0 : styles.large;
|
|
43
|
-
const mediumStyles = styles == null ? void 0 : styles.medium;
|
|
44
|
-
const smallStyles = styles == null ? void 0 : styles.small;
|
|
45
|
-
const className = state.useBlock.id;
|
|
46
|
-
const largeStylesClass = largeStyles ? createCssClass({
|
|
47
|
-
className,
|
|
48
|
-
styles: largeStyles
|
|
49
|
-
}) : "";
|
|
50
|
-
const mediumStylesClass = mediumStyles ? createCssClass({
|
|
51
|
-
className,
|
|
52
|
-
styles: mediumStyles,
|
|
53
|
-
mediaQuery: getMaxWidthQueryForSize("medium", sizesWithUpdatedBreakpoints)
|
|
54
|
-
}) : "";
|
|
55
|
-
const smallStylesClass = smallStyles ? createCssClass({
|
|
56
|
-
className,
|
|
57
|
-
styles: smallStyles,
|
|
58
|
-
mediaQuery: getMaxWidthQueryForSize("small", sizesWithUpdatedBreakpoints)
|
|
59
|
-
}) : "";
|
|
60
|
-
return [largeStylesClass, mediumStylesClass, smallStylesClass].join(" ");
|
|
61
|
-
}
|
|
62
|
-
};
|
|
63
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null, TARGET !== "reactNative" && state.css ? /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(RenderInlinedStyles, {
|
|
64
|
-
styles: state.css,
|
|
65
|
-
_context
|
|
66
|
-
})) : null);
|
|
67
|
-
}
|
|
68
|
-
export {
|
|
69
|
-
BlockStyles as default
|
|
70
|
-
};
|
|
@@ -1,211 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __defProps = Object.defineProperties;
|
|
3
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
-
var __spreadValues = (a, b) => {
|
|
9
|
-
for (var prop in b || (b = {}))
|
|
10
|
-
if (__hasOwnProp.call(b, prop))
|
|
11
|
-
__defNormalProp(a, prop, b[prop]);
|
|
12
|
-
if (__getOwnPropSymbols)
|
|
13
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
-
if (__propIsEnum.call(b, prop))
|
|
15
|
-
__defNormalProp(a, prop, b[prop]);
|
|
16
|
-
}
|
|
17
|
-
return a;
|
|
18
|
-
};
|
|
19
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
-
var __objRest = (source, exclude) => {
|
|
21
|
-
var target = {};
|
|
22
|
-
for (var prop in source)
|
|
23
|
-
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
24
|
-
target[prop] = source[prop];
|
|
25
|
-
if (source != null && __getOwnPropSymbols)
|
|
26
|
-
for (var prop of __getOwnPropSymbols(source)) {
|
|
27
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
28
|
-
target[prop] = source[prop];
|
|
29
|
-
}
|
|
30
|
-
return target;
|
|
31
|
-
};
|
|
32
|
-
import * as React from "react";
|
|
33
|
-
import { getBlockActions } from "../../functions/get-block-actions.js";
|
|
34
|
-
import { getBlockComponentOptions } from "../../functions/get-block-component-options.js";
|
|
35
|
-
import { getBlockProperties } from "../../functions/get-block-properties.js";
|
|
36
|
-
import { getBlockTag } from "../../functions/get-block-tag.js";
|
|
37
|
-
import { getProcessedBlock } from "../../functions/get-processed-block.js";
|
|
38
|
-
import { evaluate } from "../../functions/evaluate.js";
|
|
39
|
-
import BlockStyles from "./block-styles.js";
|
|
40
|
-
import { isEmptyHtmlElement } from "./render-block.helpers.js";
|
|
41
|
-
import RenderRepeatedBlock from "./render-repeated-block.js";
|
|
42
|
-
import { TARGET } from "../../constants/target.js";
|
|
43
|
-
import { extractTextStyles } from "../../functions/extract-text-styles.js";
|
|
44
|
-
import RenderComponentWithContext from "./render-component-with-context.js";
|
|
45
|
-
import RenderComponent from "./render-component.js";
|
|
46
|
-
import { getReactNativeBlockStyles } from "../../functions/get-react-native-block-styles.js";
|
|
47
|
-
function RenderBlock(props) {
|
|
48
|
-
var _a, _b, _c;
|
|
49
|
-
const _context = __spreadValues({}, props["_context"]);
|
|
50
|
-
const state = {
|
|
51
|
-
get component() {
|
|
52
|
-
var _a2;
|
|
53
|
-
const componentName = (_a2 = getProcessedBlock({
|
|
54
|
-
block: props.block,
|
|
55
|
-
state: props.context.state,
|
|
56
|
-
context: props.context.context,
|
|
57
|
-
shouldEvaluateBindings: false
|
|
58
|
-
}).component) == null ? void 0 : _a2.name;
|
|
59
|
-
if (!componentName) {
|
|
60
|
-
return null;
|
|
61
|
-
}
|
|
62
|
-
const ref = props.context.registeredComponents[componentName];
|
|
63
|
-
if (!ref) {
|
|
64
|
-
console.warn(`
|
|
65
|
-
Could not find a registered component named "${componentName}".
|
|
66
|
-
If you registered it, is the file that registered it imported by the file that needs to render it?`);
|
|
67
|
-
return void 0;
|
|
68
|
-
} else {
|
|
69
|
-
return ref;
|
|
70
|
-
}
|
|
71
|
-
},
|
|
72
|
-
get tag() {
|
|
73
|
-
return getBlockTag(state.useBlock);
|
|
74
|
-
},
|
|
75
|
-
get useBlock() {
|
|
76
|
-
return state.repeatItemData ? props.block : getProcessedBlock({
|
|
77
|
-
block: props.block,
|
|
78
|
-
state: props.context.state,
|
|
79
|
-
context: props.context.context,
|
|
80
|
-
shouldEvaluateBindings: true
|
|
81
|
-
});
|
|
82
|
-
},
|
|
83
|
-
get actions() {
|
|
84
|
-
return getBlockActions({
|
|
85
|
-
block: state.useBlock,
|
|
86
|
-
state: props.context.state,
|
|
87
|
-
context: props.context.context
|
|
88
|
-
});
|
|
89
|
-
},
|
|
90
|
-
get attributes() {
|
|
91
|
-
const blockProperties = getBlockProperties(state.useBlock);
|
|
92
|
-
return __spreadValues(__spreadValues({}, blockProperties), TARGET === "reactNative" ? {
|
|
93
|
-
style: getReactNativeBlockStyles({
|
|
94
|
-
block: state.useBlock,
|
|
95
|
-
context: props.context,
|
|
96
|
-
blockStyles: blockProperties.style
|
|
97
|
-
})
|
|
98
|
-
} : {});
|
|
99
|
-
},
|
|
100
|
-
get shouldWrap() {
|
|
101
|
-
var _a2;
|
|
102
|
-
return !((_a2 = state.component) == null ? void 0 : _a2.noWrap);
|
|
103
|
-
},
|
|
104
|
-
get renderComponentProps() {
|
|
105
|
-
var _a2, _b2, _c2, _d;
|
|
106
|
-
return {
|
|
107
|
-
blockChildren: state.useChildren,
|
|
108
|
-
componentRef: (_a2 = state.component) == null ? void 0 : _a2.component,
|
|
109
|
-
componentOptions: __spreadProps(__spreadValues(__spreadValues({}, getBlockComponentOptions(state.useBlock)), state.shouldWrap ? {} : {
|
|
110
|
-
attributes: __spreadValues(__spreadValues({}, state.attributes), state.actions)
|
|
111
|
-
}), {
|
|
112
|
-
customBreakpoints: (_d = (_c2 = (_b2 = state.childrenContext) == null ? void 0 : _b2.content) == null ? void 0 : _c2.meta) == null ? void 0 : _d.breakpoints
|
|
113
|
-
}),
|
|
114
|
-
context: state.childrenContext
|
|
115
|
-
};
|
|
116
|
-
},
|
|
117
|
-
get useChildren() {
|
|
118
|
-
var _a2;
|
|
119
|
-
return (_a2 = state.useBlock.children) != null ? _a2 : [];
|
|
120
|
-
},
|
|
121
|
-
get childrenWithoutParentComponent() {
|
|
122
|
-
var _a2;
|
|
123
|
-
const shouldRenderChildrenOutsideRef = !((_a2 = state.component) == null ? void 0 : _a2.component) && !state.repeatItemData;
|
|
124
|
-
return shouldRenderChildrenOutsideRef ? state.useChildren : [];
|
|
125
|
-
},
|
|
126
|
-
get repeatItemData() {
|
|
127
|
-
const _a2 = props.block, { repeat } = _a2, blockWithoutRepeat = __objRest(_a2, ["repeat"]);
|
|
128
|
-
if (!(repeat == null ? void 0 : repeat.collection)) {
|
|
129
|
-
return void 0;
|
|
130
|
-
}
|
|
131
|
-
const itemsArray = evaluate({
|
|
132
|
-
code: repeat.collection,
|
|
133
|
-
state: props.context.state,
|
|
134
|
-
context: props.context.context
|
|
135
|
-
});
|
|
136
|
-
if (!Array.isArray(itemsArray)) {
|
|
137
|
-
return void 0;
|
|
138
|
-
}
|
|
139
|
-
const collectionName = repeat.collection.split(".").pop();
|
|
140
|
-
const itemNameToUse = repeat.itemName || (collectionName ? collectionName + "Item" : "item");
|
|
141
|
-
const repeatArray = itemsArray.map((item, index) => ({
|
|
142
|
-
context: __spreadProps(__spreadValues({}, props.context), {
|
|
143
|
-
state: __spreadProps(__spreadValues({}, props.context.state), {
|
|
144
|
-
$index: index,
|
|
145
|
-
$item: item,
|
|
146
|
-
[itemNameToUse]: item,
|
|
147
|
-
[`$${itemNameToUse}Index`]: index
|
|
148
|
-
})
|
|
149
|
-
}),
|
|
150
|
-
block: blockWithoutRepeat
|
|
151
|
-
}));
|
|
152
|
-
return repeatArray;
|
|
153
|
-
},
|
|
154
|
-
get inheritedTextStyles() {
|
|
155
|
-
if (TARGET !== "reactNative") {
|
|
156
|
-
return {};
|
|
157
|
-
}
|
|
158
|
-
const styles = getReactNativeBlockStyles({
|
|
159
|
-
block: state.useBlock,
|
|
160
|
-
context: props.context,
|
|
161
|
-
blockStyles: state.attributes.style
|
|
162
|
-
});
|
|
163
|
-
return extractTextStyles(styles);
|
|
164
|
-
},
|
|
165
|
-
get childrenContext() {
|
|
166
|
-
return {
|
|
167
|
-
apiKey: props.context.apiKey,
|
|
168
|
-
state: props.context.state,
|
|
169
|
-
content: props.context.content,
|
|
170
|
-
context: props.context.context,
|
|
171
|
-
registeredComponents: props.context.registeredComponents,
|
|
172
|
-
inheritedStyles: state.inheritedTextStyles
|
|
173
|
-
};
|
|
174
|
-
},
|
|
175
|
-
get renderComponentTag() {
|
|
176
|
-
if (TARGET === "reactNative") {
|
|
177
|
-
return RenderComponentWithContext;
|
|
178
|
-
} else if (TARGET === "vue3") {
|
|
179
|
-
return "RenderComponent";
|
|
180
|
-
} else {
|
|
181
|
-
return RenderComponent;
|
|
182
|
-
}
|
|
183
|
-
},
|
|
184
|
-
componentInfo: null
|
|
185
|
-
};
|
|
186
|
-
const RenderComponentTagRef = state.renderComponentTag;
|
|
187
|
-
const TagRef = state.tag;
|
|
188
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null, state.shouldWrap ? /* @__PURE__ */ React.createElement(React.Fragment, null, isEmptyHtmlElement(state.tag) ? /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(TagRef, __spreadValues(__spreadValues({}, state.attributes), state.actions))) : null, !isEmptyHtmlElement(state.tag) && state.repeatItemData ? /* @__PURE__ */ React.createElement(React.Fragment, null, (_a = state.repeatItemData) == null ? void 0 : _a.map((data, index) => /* @__PURE__ */ React.createElement(RenderRepeatedBlock, {
|
|
189
|
-
key: index,
|
|
190
|
-
repeatContext: data.context,
|
|
191
|
-
block: data.block,
|
|
192
|
-
_context
|
|
193
|
-
}))) : null, !isEmptyHtmlElement(state.tag) && !state.repeatItemData ? /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(TagRef, __spreadValues(__spreadValues({}, state.attributes), state.actions), /* @__PURE__ */ React.createElement(RenderComponentTagRef, __spreadProps(__spreadValues({}, state.renderComponentProps), {
|
|
194
|
-
_context
|
|
195
|
-
})), (_b = state.childrenWithoutParentComponent) == null ? void 0 : _b.map((child) => /* @__PURE__ */ React.createElement(RenderBlock, {
|
|
196
|
-
key: "render-block-" + child.id,
|
|
197
|
-
block: child,
|
|
198
|
-
context: state.childrenContext,
|
|
199
|
-
_context
|
|
200
|
-
})), (_c = state.childrenWithoutParentComponent) == null ? void 0 : _c.map((child) => /* @__PURE__ */ React.createElement(BlockStyles, {
|
|
201
|
-
key: "block-style-" + child.id,
|
|
202
|
-
block: child,
|
|
203
|
-
context: state.childrenContext,
|
|
204
|
-
_context
|
|
205
|
-
})))) : null) : /* @__PURE__ */ React.createElement(RenderComponentTagRef, __spreadProps(__spreadValues({}, state.renderComponentProps), {
|
|
206
|
-
_context
|
|
207
|
-
})));
|
|
208
|
-
}
|
|
209
|
-
export {
|
|
210
|
-
RenderBlock as default
|
|
211
|
-
};
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
3
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
5
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
-
var __spreadValues = (a, b) => {
|
|
7
|
-
for (var prop in b || (b = {}))
|
|
8
|
-
if (__hasOwnProp.call(b, prop))
|
|
9
|
-
__defNormalProp(a, prop, b[prop]);
|
|
10
|
-
if (__getOwnPropSymbols)
|
|
11
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
12
|
-
if (__propIsEnum.call(b, prop))
|
|
13
|
-
__defNormalProp(a, prop, b[prop]);
|
|
14
|
-
}
|
|
15
|
-
return a;
|
|
16
|
-
};
|
|
17
|
-
import * as React from "react";
|
|
18
|
-
import RenderComponent from "./render-component.js";
|
|
19
|
-
function RenderComponentWithContext(props) {
|
|
20
|
-
const _context = __spreadValues({}, props["_context"]);
|
|
21
|
-
_context.BuilderContext = {
|
|
22
|
-
get content() {
|
|
23
|
-
return props.context.content;
|
|
24
|
-
},
|
|
25
|
-
get state() {
|
|
26
|
-
return props.context.state;
|
|
27
|
-
},
|
|
28
|
-
get context() {
|
|
29
|
-
return props.context.context;
|
|
30
|
-
},
|
|
31
|
-
get apiKey() {
|
|
32
|
-
return props.context.apiKey;
|
|
33
|
-
},
|
|
34
|
-
get registeredComponents() {
|
|
35
|
-
return props.context.registeredComponents;
|
|
36
|
-
},
|
|
37
|
-
get inheritedStyles() {
|
|
38
|
-
return props.context.inheritedStyles;
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
return /* @__PURE__ */ React.createElement(RenderComponent, {
|
|
42
|
-
componentRef: props.componentRef,
|
|
43
|
-
componentOptions: props.componentOptions,
|
|
44
|
-
blockChildren: props.blockChildren,
|
|
45
|
-
context: props.context,
|
|
46
|
-
_context
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
export {
|
|
50
|
-
RenderComponentWithContext as default
|
|
51
|
-
};
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __defProps = Object.defineProperties;
|
|
3
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
-
var __spreadValues = (a, b) => {
|
|
9
|
-
for (var prop in b || (b = {}))
|
|
10
|
-
if (__hasOwnProp.call(b, prop))
|
|
11
|
-
__defNormalProp(a, prop, b[prop]);
|
|
12
|
-
if (__getOwnPropSymbols)
|
|
13
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
-
if (__propIsEnum.call(b, prop))
|
|
15
|
-
__defNormalProp(a, prop, b[prop]);
|
|
16
|
-
}
|
|
17
|
-
return a;
|
|
18
|
-
};
|
|
19
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
-
import * as React from "react";
|
|
21
|
-
import BlockStyles from "./block-styles.js";
|
|
22
|
-
import RenderBlock from "./render-block.js";
|
|
23
|
-
function RenderComponent(props) {
|
|
24
|
-
var _a, _b;
|
|
25
|
-
const _context = __spreadValues({}, props["_context"]);
|
|
26
|
-
const ComponentRefRef = props.componentRef;
|
|
27
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null, props.componentRef ? /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(ComponentRefRef, __spreadProps(__spreadValues({}, props.componentOptions), {
|
|
28
|
-
_context
|
|
29
|
-
}), (_a = props.blockChildren) == null ? void 0 : _a.map((child) => /* @__PURE__ */ React.createElement(RenderBlock, {
|
|
30
|
-
key: "render-block-" + child.id,
|
|
31
|
-
block: child,
|
|
32
|
-
context: props.context,
|
|
33
|
-
_context
|
|
34
|
-
})), (_b = props.blockChildren) == null ? void 0 : _b.map((child) => /* @__PURE__ */ React.createElement(BlockStyles, {
|
|
35
|
-
key: "block-style-" + child.id,
|
|
36
|
-
block: child,
|
|
37
|
-
context: props.context,
|
|
38
|
-
_context
|
|
39
|
-
})))) : null);
|
|
40
|
-
}
|
|
41
|
-
export {
|
|
42
|
-
RenderComponent as default
|
|
43
|
-
};
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
3
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
5
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
-
var __spreadValues = (a, b) => {
|
|
7
|
-
for (var prop in b || (b = {}))
|
|
8
|
-
if (__hasOwnProp.call(b, prop))
|
|
9
|
-
__defNormalProp(a, prop, b[prop]);
|
|
10
|
-
if (__getOwnPropSymbols)
|
|
11
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
12
|
-
if (__propIsEnum.call(b, prop))
|
|
13
|
-
__defNormalProp(a, prop, b[prop]);
|
|
14
|
-
}
|
|
15
|
-
return a;
|
|
16
|
-
};
|
|
17
|
-
import * as React from "react";
|
|
18
|
-
import RenderBlock from "./render-block.js";
|
|
19
|
-
function RenderRepeatedBlock(props) {
|
|
20
|
-
const _context = __spreadValues({}, props["_context"]);
|
|
21
|
-
_context.BuilderContext = {
|
|
22
|
-
get content() {
|
|
23
|
-
return props.repeatContext.content;
|
|
24
|
-
},
|
|
25
|
-
get state() {
|
|
26
|
-
return props.repeatContext.state;
|
|
27
|
-
},
|
|
28
|
-
get context() {
|
|
29
|
-
return props.repeatContext.context;
|
|
30
|
-
},
|
|
31
|
-
get apiKey() {
|
|
32
|
-
return props.repeatContext.apiKey;
|
|
33
|
-
},
|
|
34
|
-
get registeredComponents() {
|
|
35
|
-
return props.repeatContext.registeredComponents;
|
|
36
|
-
},
|
|
37
|
-
get inheritedStyles() {
|
|
38
|
-
return props.repeatContext.inheritedStyles;
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
return /* @__PURE__ */ React.createElement(RenderBlock, {
|
|
42
|
-
block: props.block,
|
|
43
|
-
context: props.repeatContext,
|
|
44
|
-
_context
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
export {
|
|
48
|
-
RenderRepeatedBlock as default
|
|
49
|
-
};
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
3
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
5
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
-
var __spreadValues = (a, b) => {
|
|
7
|
-
for (var prop in b || (b = {}))
|
|
8
|
-
if (__hasOwnProp.call(b, prop))
|
|
9
|
-
__defNormalProp(a, prop, b[prop]);
|
|
10
|
-
if (__getOwnPropSymbols)
|
|
11
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
12
|
-
if (__propIsEnum.call(b, prop))
|
|
13
|
-
__defNormalProp(a, prop, b[prop]);
|
|
14
|
-
}
|
|
15
|
-
return a;
|
|
16
|
-
};
|
|
17
|
-
import * as React from "react";
|
|
18
|
-
import { isEditing } from "../functions/is-editing.js";
|
|
19
|
-
import BlockStyles from "./render-block/block-styles.js";
|
|
20
|
-
import RenderBlock from "./render-block/render-block.js";
|
|
21
|
-
function RenderBlocks(props) {
|
|
22
|
-
var _a, _b;
|
|
23
|
-
const _context = __spreadValues({}, props["_context"]);
|
|
24
|
-
const state = {
|
|
25
|
-
get className() {
|
|
26
|
-
var _a2;
|
|
27
|
-
return "builder-blocks" + (!((_a2 = props.blocks) == null ? void 0 : _a2.length) ? " no-blocks" : "");
|
|
28
|
-
},
|
|
29
|
-
onClick() {
|
|
30
|
-
var _a2, _b2;
|
|
31
|
-
if (isEditing() && !((_a2 = props.blocks) == null ? void 0 : _a2.length)) {
|
|
32
|
-
(_b2 = window.parent) == null ? void 0 : _b2.postMessage({
|
|
33
|
-
type: "builder.clickEmptyBlocks",
|
|
34
|
-
data: {
|
|
35
|
-
parentElementId: props.parent,
|
|
36
|
-
dataPath: props.path
|
|
37
|
-
}
|
|
38
|
-
}, "*");
|
|
39
|
-
}
|
|
40
|
-
},
|
|
41
|
-
onMouseEnter() {
|
|
42
|
-
var _a2, _b2;
|
|
43
|
-
if (isEditing() && !((_a2 = props.blocks) == null ? void 0 : _a2.length)) {
|
|
44
|
-
(_b2 = window.parent) == null ? void 0 : _b2.postMessage({
|
|
45
|
-
type: "builder.hoverEmptyBlocks",
|
|
46
|
-
data: {
|
|
47
|
-
parentElementId: props.parent,
|
|
48
|
-
dataPath: props.path
|
|
49
|
-
}
|
|
50
|
-
}, "*");
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
};
|
|
54
|
-
const builderContext = _context["BuilderContext"];
|
|
55
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("div", {
|
|
56
|
-
className: state.className + " div-4f307ff9",
|
|
57
|
-
"builder-path": props.path,
|
|
58
|
-
"builder-parent-id": props.parent,
|
|
59
|
-
dataSet: {
|
|
60
|
-
class: state.className
|
|
61
|
-
},
|
|
62
|
-
style: props.styleProp
|
|
63
|
-
}, props.blocks ? /* @__PURE__ */ React.createElement(React.Fragment, null, (_a = props.blocks) == null ? void 0 : _a.map((block) => /* @__PURE__ */ React.createElement(RenderBlock, {
|
|
64
|
-
key: "render-block-" + block.id,
|
|
65
|
-
block,
|
|
66
|
-
context: builderContext,
|
|
67
|
-
_context
|
|
68
|
-
}))) : null, props.blocks ? /* @__PURE__ */ React.createElement(React.Fragment, null, (_b = props.blocks) == null ? void 0 : _b.map((block) => /* @__PURE__ */ React.createElement(BlockStyles, {
|
|
69
|
-
key: "block-style-" + block.id,
|
|
70
|
-
block,
|
|
71
|
-
context: builderContext,
|
|
72
|
-
_context
|
|
73
|
-
}))) : null), /* @__PURE__ */ React.createElement("style", null, `.div-4f307ff9 {
|
|
74
|
-
display: flex;
|
|
75
|
-
flex-direction: column;
|
|
76
|
-
align-items: stretch; }`));
|
|
77
|
-
}
|
|
78
|
-
export {
|
|
79
|
-
RenderBlocks as default
|
|
80
|
-
};
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import React, { useEffect } from "react";
|
|
2
|
-
import { setupBrowserForEditing } from "../../scripts/init-editing.js";
|
|
3
|
-
function BuilderEditingWrapper(props) {
|
|
4
|
-
useEffect(() => {
|
|
5
|
-
setupBrowserForEditing();
|
|
6
|
-
if (props.components) {
|
|
7
|
-
for (const component of props.components) {
|
|
8
|
-
window.parent.postMessage({
|
|
9
|
-
type: "builder.registerComponent",
|
|
10
|
-
data: component
|
|
11
|
-
}, "*");
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
function onMessage(e) {
|
|
15
|
-
var _a, _b;
|
|
16
|
-
switch ((_a = e.data) == null ? void 0 : _a.type) {
|
|
17
|
-
case "builder.contentUpdate": {
|
|
18
|
-
(_b = props.onUpdate) == null ? void 0 : _b.call(props, e.data.data);
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
addEventListener("message", onMessage);
|
|
23
|
-
return () => window.removeEventListener("message", onMessage);
|
|
24
|
-
}, [props.model]);
|
|
25
|
-
return /* @__PURE__ */ React.createElement("div", {
|
|
26
|
-
onMouseDown: (e) => e.preventDefault(),
|
|
27
|
-
onClickCapture: (e) => {
|
|
28
|
-
e.stopPropagation();
|
|
29
|
-
e.preventDefault();
|
|
30
|
-
}
|
|
31
|
-
}, props.children);
|
|
32
|
-
}
|
|
33
|
-
export {
|
|
34
|
-
BuilderEditingWrapper
|
|
35
|
-
};
|