@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,13 +1,13 @@
|
|
|
1
|
-
import { default as default2 } from "../blocks/columns/columns.
|
|
2
|
-
import { default as default3 } from "../blocks/image/image.
|
|
3
|
-
import { default as default4 } from "../blocks/text/text.
|
|
4
|
-
import { default as default5 } from "../blocks/video/video.
|
|
5
|
-
import { default as default6 } from "../blocks/symbol/symbol.
|
|
6
|
-
import { default as default7 } from "../blocks/button/button.
|
|
7
|
-
import { default as default8 } from "../blocks/section/section.
|
|
8
|
-
import { default as default9 } from "../blocks/fragment/fragment.
|
|
9
|
-
import { default as default10 } from "../components/render-content/render-content.
|
|
10
|
-
import { default as default11 } from "../components/render-blocks.
|
|
1
|
+
import { default as default2 } from "../blocks/columns/columns.js";
|
|
2
|
+
import { default as default3 } from "../blocks/image/image.js";
|
|
3
|
+
import { default as default4 } from "../blocks/text/text.js";
|
|
4
|
+
import { default as default5 } from "../blocks/video/video.js";
|
|
5
|
+
import { default as default6 } from "../blocks/symbol/symbol.js";
|
|
6
|
+
import { default as default7 } from "../blocks/button/button.js";
|
|
7
|
+
import { default as default8 } from "../blocks/section/section.js";
|
|
8
|
+
import { default as default9 } from "../blocks/fragment/fragment.js";
|
|
9
|
+
import { default as default10 } from "../components/render-content/render-content.js";
|
|
10
|
+
import { default as default11 } from "../components/render-blocks.js";
|
|
11
11
|
export {
|
|
12
12
|
default7 as Button,
|
|
13
13
|
default2 as Columns,
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ESNext",
|
|
4
|
+
"useDefineForClassFields": true,
|
|
5
|
+
"lib": ["DOM", "DOM.Iterable", "ESNext"],
|
|
6
|
+
"allowJs": true,
|
|
7
|
+
"skipLibCheck": true,
|
|
8
|
+
"esModuleInterop": false,
|
|
9
|
+
"allowSyntheticDefaultImports": true,
|
|
10
|
+
"strict": true,
|
|
11
|
+
"forceConsistentCasingInFileNames": true,
|
|
12
|
+
"module": "ESNext",
|
|
13
|
+
"moduleResolution": "Node",
|
|
14
|
+
"resolveJsonModule": true,
|
|
15
|
+
"isolatedModules": true,
|
|
16
|
+
"jsx": "react"
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -1,35 +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 Button(props) {
|
|
22
|
-
const _context = __spreadValues({}, props["_context"]);
|
|
23
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null, props.link ? /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("a", __spreadProps(__spreadValues({
|
|
24
|
-
role: "button"
|
|
25
|
-
}, props.attributes), {
|
|
26
|
-
href: props.link,
|
|
27
|
-
target: props.openLinkInNewTab ? "_blank" : void 0
|
|
28
|
-
}), props.text)) : /* @__PURE__ */ React.createElement("button", __spreadValues({
|
|
29
|
-
className: "button-12870b9c"
|
|
30
|
-
}, props.attributes), props.text), /* @__PURE__ */ React.createElement("style", null, `.button-12870b9c {
|
|
31
|
-
all: unset; }`));
|
|
32
|
-
}
|
|
33
|
-
export {
|
|
34
|
-
Button as default
|
|
35
|
-
};
|
|
@@ -1,63 +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
|
-
function CustomCode(props) {
|
|
19
|
-
const _context = __spreadValues({}, props["_context"]);
|
|
20
|
-
const state = {
|
|
21
|
-
scriptsInserted: [],
|
|
22
|
-
scriptsRun: [],
|
|
23
|
-
findAndRunScripts() {
|
|
24
|
-
if (elem && elem.getElementsByTagName && typeof window !== "undefined") {
|
|
25
|
-
const scripts = elem.getElementsByTagName("script");
|
|
26
|
-
for (let i = 0; i < scripts.length; i++) {
|
|
27
|
-
const script = scripts[i];
|
|
28
|
-
if (script.src) {
|
|
29
|
-
if (state.scriptsInserted.includes(script.src)) {
|
|
30
|
-
continue;
|
|
31
|
-
}
|
|
32
|
-
state.scriptsInserted.push(script.src);
|
|
33
|
-
const newScript = document.createElement("script");
|
|
34
|
-
newScript.async = true;
|
|
35
|
-
newScript.src = script.src;
|
|
36
|
-
document.head.appendChild(newScript);
|
|
37
|
-
} else if (!script.type || [
|
|
38
|
-
"text/javascript",
|
|
39
|
-
"application/javascript",
|
|
40
|
-
"application/ecmascript"
|
|
41
|
-
].includes(script.type)) {
|
|
42
|
-
if (state.scriptsRun.includes(script.innerText)) {
|
|
43
|
-
continue;
|
|
44
|
-
}
|
|
45
|
-
try {
|
|
46
|
-
state.scriptsRun.push(script.innerText);
|
|
47
|
-
new Function(script.innerText)();
|
|
48
|
-
} catch (error) {
|
|
49
|
-
console.warn("`CustomCode`: Error running script:", error);
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
|
-
return /* @__PURE__ */ React.createElement("div", {
|
|
57
|
-
className: "builder-custom-code" + (props.replaceNodes ? " replace-nodes" : ""),
|
|
58
|
-
dangerouslySetInnerHTML: { __html: props.code }
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
export {
|
|
62
|
-
CustomCode as default
|
|
63
|
-
};
|
|
@@ -1,55 +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 { isJsScript } from "./helpers.js";
|
|
19
|
-
function Embed(props) {
|
|
20
|
-
const _context = __spreadValues({}, props["_context"]);
|
|
21
|
-
const state = {
|
|
22
|
-
scriptsInserted: [],
|
|
23
|
-
scriptsRun: [],
|
|
24
|
-
ranInitFn: false,
|
|
25
|
-
findAndRunScripts() {
|
|
26
|
-
if (!elem || !elem.getElementsByTagName)
|
|
27
|
-
return;
|
|
28
|
-
const scripts = elem.getElementsByTagName("script");
|
|
29
|
-
for (let i = 0; i < scripts.length; i++) {
|
|
30
|
-
const script = scripts[i];
|
|
31
|
-
if (script.src && !state.scriptsInserted.includes(script.src)) {
|
|
32
|
-
state.scriptsInserted.push(script.src);
|
|
33
|
-
const newScript = document.createElement("script");
|
|
34
|
-
newScript.async = true;
|
|
35
|
-
newScript.src = script.src;
|
|
36
|
-
document.head.appendChild(newScript);
|
|
37
|
-
} else if (isJsScript(script) && !state.scriptsRun.includes(script.innerText)) {
|
|
38
|
-
try {
|
|
39
|
-
state.scriptsRun.push(script.innerText);
|
|
40
|
-
new Function(script.innerText)();
|
|
41
|
-
} catch (error) {
|
|
42
|
-
console.warn("`Embed`: Error running script:", error);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
return /* @__PURE__ */ React.createElement("div", {
|
|
49
|
-
className: "builder-embed",
|
|
50
|
-
dangerouslySetInnerHTML: { __html: props.content }
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
export {
|
|
54
|
-
Embed as default
|
|
55
|
-
};
|
|
@@ -1,222 +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
|
-
var __async = (__this, __arguments, generator) => {
|
|
18
|
-
return new Promise((resolve, reject) => {
|
|
19
|
-
var fulfilled = (value) => {
|
|
20
|
-
try {
|
|
21
|
-
step(generator.next(value));
|
|
22
|
-
} catch (e) {
|
|
23
|
-
reject(e);
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
|
-
var rejected = (value) => {
|
|
27
|
-
try {
|
|
28
|
-
step(generator.throw(value));
|
|
29
|
-
} catch (e) {
|
|
30
|
-
reject(e);
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
34
|
-
step((generator = generator.apply(__this, __arguments)).next());
|
|
35
|
-
});
|
|
36
|
-
};
|
|
37
|
-
import * as React from "react";
|
|
38
|
-
import RenderBlock from "../../components/render-block/render-block.js";
|
|
39
|
-
import BuilderBlocks from "../../components/render-blocks.js";
|
|
40
|
-
import { isEditing } from "../../functions/is-editing.js";
|
|
41
|
-
function FormComponent(props) {
|
|
42
|
-
var _a, _b;
|
|
43
|
-
const _context = __spreadValues({}, props["_context"]);
|
|
44
|
-
const state = {
|
|
45
|
-
formState: "unsubmitted",
|
|
46
|
-
responseData: null,
|
|
47
|
-
formErrorMessage: "",
|
|
48
|
-
get submissionState() {
|
|
49
|
-
return isEditing() && props.previewState || state.formState;
|
|
50
|
-
},
|
|
51
|
-
onSubmit(event) {
|
|
52
|
-
var _a2;
|
|
53
|
-
const sendWithJs = props.sendWithJs || props.sendSubmissionsTo === "email";
|
|
54
|
-
if (props.sendSubmissionsTo === "zapier") {
|
|
55
|
-
event.preventDefault();
|
|
56
|
-
} else if (sendWithJs) {
|
|
57
|
-
if (!(props.action || props.sendSubmissionsTo === "email")) {
|
|
58
|
-
event.preventDefault();
|
|
59
|
-
return;
|
|
60
|
-
}
|
|
61
|
-
event.preventDefault();
|
|
62
|
-
const el = event.currentTarget;
|
|
63
|
-
const headers = props.customHeaders || {};
|
|
64
|
-
let body;
|
|
65
|
-
const formData = new FormData(el);
|
|
66
|
-
const formPairs = Array.from(event.currentTarget.querySelectorAll("input,select,textarea")).filter((el2) => !!el2.name).map((el2) => {
|
|
67
|
-
let value;
|
|
68
|
-
const key = el2.name;
|
|
69
|
-
if (el2 instanceof HTMLInputElement) {
|
|
70
|
-
if (el2.type === "radio") {
|
|
71
|
-
if (el2.checked) {
|
|
72
|
-
value = el2.name;
|
|
73
|
-
return {
|
|
74
|
-
key,
|
|
75
|
-
value
|
|
76
|
-
};
|
|
77
|
-
}
|
|
78
|
-
} else if (el2.type === "checkbox") {
|
|
79
|
-
value = el2.checked;
|
|
80
|
-
} else if (el2.type === "number" || el2.type === "range") {
|
|
81
|
-
const num = el2.valueAsNumber;
|
|
82
|
-
if (!isNaN(num)) {
|
|
83
|
-
value = num;
|
|
84
|
-
}
|
|
85
|
-
} else if (el2.type === "file") {
|
|
86
|
-
value = el2.files;
|
|
87
|
-
} else {
|
|
88
|
-
value = el2.value;
|
|
89
|
-
}
|
|
90
|
-
} else {
|
|
91
|
-
value = el2.value;
|
|
92
|
-
}
|
|
93
|
-
return {
|
|
94
|
-
key,
|
|
95
|
-
value
|
|
96
|
-
};
|
|
97
|
-
});
|
|
98
|
-
let contentType = props.contentType;
|
|
99
|
-
if (props.sendSubmissionsTo === "email") {
|
|
100
|
-
contentType = "multipart/form-data";
|
|
101
|
-
}
|
|
102
|
-
Array.from(formPairs).forEach(({ value }) => {
|
|
103
|
-
if (value instanceof File || Array.isArray(value) && value[0] instanceof File || value instanceof FileList) {
|
|
104
|
-
contentType = "multipart/form-data";
|
|
105
|
-
}
|
|
106
|
-
});
|
|
107
|
-
if (contentType !== "application/json") {
|
|
108
|
-
body = formData;
|
|
109
|
-
} else {
|
|
110
|
-
const json = {};
|
|
111
|
-
Array.from(formPairs).forEach(({ value, key }) => {
|
|
112
|
-
set(json, key, value);
|
|
113
|
-
});
|
|
114
|
-
body = JSON.stringify(json);
|
|
115
|
-
}
|
|
116
|
-
if (contentType && contentType !== "multipart/form-data") {
|
|
117
|
-
if (!(sendWithJs && ((_a2 = props.action) == null ? void 0 : _a2.includes("zapier.com")))) {
|
|
118
|
-
headers["content-type"] = contentType;
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
const presubmitEvent = new CustomEvent("presubmit", {
|
|
122
|
-
detail: { body }
|
|
123
|
-
});
|
|
124
|
-
if (formRef) {
|
|
125
|
-
formRef.dispatchEvent(presubmitEvent);
|
|
126
|
-
if (presubmitEvent.defaultPrevented) {
|
|
127
|
-
return;
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
state.formState = "sending";
|
|
131
|
-
const formUrl = `${builder.env === "dev" ? "http://localhost:5000" : "https://builder.io"}/api/v1/form-submit?apiKey=${builder.apiKey}&to=${btoa(props.sendSubmissionsToEmail || "")}&name=${encodeURIComponent(props.name || "")}`;
|
|
132
|
-
fetch(props.sendSubmissionsTo === "email" ? formUrl : props.action, { body, headers, method: props.method || "post" }).then((res) => __async(this, null, function* () {
|
|
133
|
-
let body2;
|
|
134
|
-
const contentType2 = res.headers.get("content-type");
|
|
135
|
-
if (contentType2 && contentType2.indexOf("application/json") !== -1) {
|
|
136
|
-
body2 = yield res.json();
|
|
137
|
-
} else {
|
|
138
|
-
body2 = yield res.text();
|
|
139
|
-
}
|
|
140
|
-
if (!res.ok && props.errorMessagePath) {
|
|
141
|
-
let message = get(body2, props.errorMessagePath);
|
|
142
|
-
if (message) {
|
|
143
|
-
if (typeof message !== "string") {
|
|
144
|
-
message = JSON.stringify(message);
|
|
145
|
-
}
|
|
146
|
-
state.formErrorMessage = message;
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
state.responseData = body2;
|
|
150
|
-
state.formState = res.ok ? "success" : "error";
|
|
151
|
-
if (res.ok) {
|
|
152
|
-
const submitSuccessEvent = new CustomEvent("submit:success", {
|
|
153
|
-
detail: { res, body: body2 }
|
|
154
|
-
});
|
|
155
|
-
if (formRef) {
|
|
156
|
-
formRef.dispatchEvent(submitSuccessEvent);
|
|
157
|
-
if (submitSuccessEvent.defaultPrevented) {
|
|
158
|
-
return;
|
|
159
|
-
}
|
|
160
|
-
if (props.resetFormOnSubmit !== false) {
|
|
161
|
-
formRef.reset();
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
if (props.successUrl) {
|
|
165
|
-
if (formRef) {
|
|
166
|
-
const event2 = new CustomEvent("route", {
|
|
167
|
-
detail: { url: props.successUrl }
|
|
168
|
-
});
|
|
169
|
-
formRef.dispatchEvent(event2);
|
|
170
|
-
if (!event2.defaultPrevented) {
|
|
171
|
-
location.href = props.successUrl;
|
|
172
|
-
}
|
|
173
|
-
} else {
|
|
174
|
-
location.href = props.successUrl;
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
}), (err) => {
|
|
179
|
-
const submitErrorEvent = new CustomEvent("submit:error", {
|
|
180
|
-
detail: { error: err }
|
|
181
|
-
});
|
|
182
|
-
if (formRef) {
|
|
183
|
-
formRef.dispatchEvent(submitErrorEvent);
|
|
184
|
-
if (submitErrorEvent.defaultPrevented) {
|
|
185
|
-
return;
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
state.responseData = err;
|
|
189
|
-
state.formState = "error";
|
|
190
|
-
});
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
};
|
|
194
|
-
const builderContext = _context["BuilderContext"];
|
|
195
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null, " ", /* @__PURE__ */ React.createElement("form", __spreadValues({
|
|
196
|
-
validate: props.validate,
|
|
197
|
-
action: !props.sendWithJs && props.action,
|
|
198
|
-
method: props.method,
|
|
199
|
-
name: props.name
|
|
200
|
-
}, props.attributes), " ", props.builderBlock && props.builderBlock.children ? /* @__PURE__ */ React.createElement(React.Fragment, null, (_b = (_a = props.builderBlock) == null ? void 0 : _a.children) == null ? void 0 : _b.map((block) => /* @__PURE__ */ React.createElement(RenderBlock, {
|
|
201
|
-
block,
|
|
202
|
-
context: builderContext,
|
|
203
|
-
_context
|
|
204
|
-
}))) : null, " ", state.submissionState === "error" ? /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(BuilderBlocks, {
|
|
205
|
-
dataPath: "errorMessage",
|
|
206
|
-
blocks: props.errorMessage,
|
|
207
|
-
_context
|
|
208
|
-
})) : null, " ", state.submissionState === "sending" ? /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(BuilderBlocks, {
|
|
209
|
-
dataPath: "sendingMessage",
|
|
210
|
-
blocks: props.sendingMessage,
|
|
211
|
-
_context
|
|
212
|
-
})) : null, " ", state.submissionState === "error" && state.responseData ? /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("pre", {
|
|
213
|
-
className: "builder-form-error-text pre-5cbf32b2"
|
|
214
|
-
}, " ", JSON.stringify(state.responseData, null, 2), " ")) : null, " ", state.submissionState === "success" ? /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(BuilderBlocks, {
|
|
215
|
-
dataPath: "successMessage",
|
|
216
|
-
blocks: props.successMessage,
|
|
217
|
-
_context
|
|
218
|
-
})) : null, " "), " ", /* @__PURE__ */ React.createElement("style", null, `.pre-5cbf32b2 { padding: 10px; color: red; text-align: center; }`), " ");
|
|
219
|
-
}
|
|
220
|
-
export {
|
|
221
|
-
FormComponent as default
|
|
222
|
-
};
|
|
@@ -1,24 +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
|
-
function FragmentComponent(props) {
|
|
19
|
-
const _context = __spreadValues({}, props["_context"]);
|
|
20
|
-
return /* @__PURE__ */ React.createElement("span", null, props.children);
|
|
21
|
-
}
|
|
22
|
-
export {
|
|
23
|
-
FragmentComponent as default
|
|
24
|
-
};
|
|
@@ -1,101 +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 { getSrcSet } from "./image.helpers.js";
|
|
19
|
-
function Image(props) {
|
|
20
|
-
var _a, _b, _c, _d;
|
|
21
|
-
const _context = __spreadValues({}, props["_context"]);
|
|
22
|
-
const state = {
|
|
23
|
-
get srcSetToUse() {
|
|
24
|
-
var _a2;
|
|
25
|
-
const imageToUse = props.image || props.src;
|
|
26
|
-
const url = imageToUse;
|
|
27
|
-
if (!url || !(url.match(/builder\.io/) || url.match(/cdn\.shopify\.com/))) {
|
|
28
|
-
return props.srcset;
|
|
29
|
-
}
|
|
30
|
-
if (props.srcset && ((_a2 = props.image) == null ? void 0 : _a2.includes("builder.io/api/v1/image"))) {
|
|
31
|
-
if (!props.srcset.includes(props.image.split("?")[0])) {
|
|
32
|
-
console.debug("Removed given srcset");
|
|
33
|
-
return getSrcSet(url);
|
|
34
|
-
}
|
|
35
|
-
} else if (props.image && !props.srcset) {
|
|
36
|
-
return getSrcSet(url);
|
|
37
|
-
}
|
|
38
|
-
return getSrcSet(url);
|
|
39
|
-
},
|
|
40
|
-
get webpSrcSet() {
|
|
41
|
-
var _a2;
|
|
42
|
-
if (((_a2 = state.srcSetToUse) == null ? void 0 : _a2.match(/builder\.io/)) && !props.noWebp) {
|
|
43
|
-
return state.srcSetToUse.replace(/\?/g, "?format=webp&");
|
|
44
|
-
} else {
|
|
45
|
-
return "";
|
|
46
|
-
}
|
|
47
|
-
},
|
|
48
|
-
get aspectRatioCss() {
|
|
49
|
-
const aspectRatioStyles = {
|
|
50
|
-
position: "absolute",
|
|
51
|
-
height: "100%",
|
|
52
|
-
width: "100%",
|
|
53
|
-
left: "0px",
|
|
54
|
-
top: "0px"
|
|
55
|
-
};
|
|
56
|
-
const out = props.aspectRatio ? aspectRatioStyles : void 0;
|
|
57
|
-
return out;
|
|
58
|
-
}
|
|
59
|
-
};
|
|
60
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("picture", null, state.webpSrcSet ? /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("source", {
|
|
61
|
-
type: "image/webp",
|
|
62
|
-
srcSet: state.webpSrcSet
|
|
63
|
-
})) : null, /* @__PURE__ */ React.createElement("img", {
|
|
64
|
-
loading: "lazy",
|
|
65
|
-
alt: props.altText,
|
|
66
|
-
role: props.altText ? "presentation" : void 0,
|
|
67
|
-
style: __spreadValues({
|
|
68
|
-
objectPosition: props.backgroundPosition || "center",
|
|
69
|
-
objectFit: props.backgroundSize || "cover"
|
|
70
|
-
}, state.aspectRatioCss),
|
|
71
|
-
className: "builder-image" + (props.className ? " " + props.className : "") + " img-03c4fd62",
|
|
72
|
-
src: props.image,
|
|
73
|
-
srcSet: state.srcSetToUse,
|
|
74
|
-
sizes: props.sizes
|
|
75
|
-
}), /* @__PURE__ */ React.createElement("source", {
|
|
76
|
-
srcSet: state.srcSetToUse
|
|
77
|
-
})), props.aspectRatio && !(((_b = (_a = props.builderBlock) == null ? void 0 : _a.children) == null ? void 0 : _b.length) && props.fitContent) ? /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("div", {
|
|
78
|
-
className: "builder-image-sizer div-03c4fd62",
|
|
79
|
-
style: {
|
|
80
|
-
paddingTop: props.aspectRatio * 100 + "%"
|
|
81
|
-
}
|
|
82
|
-
})) : null, ((_d = (_c = props.builderBlock) == null ? void 0 : _c.children) == null ? void 0 : _d.length) && props.fitContent ? /* @__PURE__ */ React.createElement(React.Fragment, null, props.children) : null, !props.fitContent && props.children ? /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("div", {
|
|
83
|
-
className: "div-03c4fd62-2"
|
|
84
|
-
}, props.children)) : null), /* @__PURE__ */ React.createElement("style", null, `.img-03c4fd62 {
|
|
85
|
-
opacity: 1;
|
|
86
|
-
transition: opacity 0.2s ease-in-out; }.div-03c4fd62 {
|
|
87
|
-
width: 100%;
|
|
88
|
-
pointer-events: none;
|
|
89
|
-
font-size: 0; }.div-03c4fd62-2 {
|
|
90
|
-
display: flex;
|
|
91
|
-
flex-direction: column;
|
|
92
|
-
align-items: stretch;
|
|
93
|
-
position: absolute;
|
|
94
|
-
top: 0;
|
|
95
|
-
left: 0;
|
|
96
|
-
width: 100%;
|
|
97
|
-
height: 100%; }`));
|
|
98
|
-
}
|
|
99
|
-
export {
|
|
100
|
-
Image as default
|
|
101
|
-
};
|
|
@@ -1,33 +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
|
-
function ImgComponent(props) {
|
|
20
|
-
const _context = __spreadValues({}, props["_context"]);
|
|
21
|
-
return /* @__PURE__ */ React.createElement("img", __spreadValues({
|
|
22
|
-
style: {
|
|
23
|
-
objectFit: props.backgroundSize || "cover",
|
|
24
|
-
objectPosition: props.backgroundPosition || "center"
|
|
25
|
-
},
|
|
26
|
-
key: isEditing() && props.imgSrc || "default-key",
|
|
27
|
-
alt: props.altText,
|
|
28
|
-
src: props.imgSrc || props.image
|
|
29
|
-
}, props.attributes));
|
|
30
|
-
}
|
|
31
|
-
export {
|
|
32
|
-
ImgComponent as default
|
|
33
|
-
};
|
|
@@ -1,36 +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 { isEditing } from "../../functions/is-editing.js";
|
|
22
|
-
function SelectComponent(props) {
|
|
23
|
-
var _a;
|
|
24
|
-
const _context = __spreadValues({}, props["_context"]);
|
|
25
|
-
return /* @__PURE__ */ React.createElement("select", __spreadProps(__spreadValues({}, props.attributes), {
|
|
26
|
-
value: props.value,
|
|
27
|
-
key: isEditing() && props.defaultValue ? props.defaultValue : "default-key",
|
|
28
|
-
defaultValue: props.defaultValue,
|
|
29
|
-
name: props.name
|
|
30
|
-
}), (_a = props.options) == null ? void 0 : _a.map((option) => /* @__PURE__ */ React.createElement("option", {
|
|
31
|
-
value: option.value
|
|
32
|
-
}, option.name || option.value)));
|
|
33
|
-
}
|
|
34
|
-
export {
|
|
35
|
-
SelectComponent as default
|
|
36
|
-
};
|
|
@@ -1,26 +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
|
-
function SubmitButton(props) {
|
|
19
|
-
const _context = __spreadValues({}, props["_context"]);
|
|
20
|
-
return /* @__PURE__ */ React.createElement("button", __spreadValues({
|
|
21
|
-
type: "submit"
|
|
22
|
-
}, props.attributes), props.text);
|
|
23
|
-
}
|
|
24
|
-
export {
|
|
25
|
-
SubmitButton as default
|
|
26
|
-
};
|