@builder.io/sdk-react 0.2.1 → 0.2.3-0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/react/blocks/BaseText.d.ts +2 -0
- package/dist/react/blocks/BaseText.js +1 -0
- package/dist/react/blocks/button/button.d.ts +2 -0
- package/dist/react/blocks/button/button.js +1 -0
- package/dist/react/blocks/button/component-info.d.ts +38 -0
- package/dist/react/blocks/columns/columns.d.ts +2 -0
- package/dist/react/blocks/columns/columns.js +1 -0
- package/dist/react/blocks/columns/component-info.d.ts +176 -0
- package/dist/react/blocks/custom-code/component-info.d.ts +31 -0
- package/dist/react/blocks/custom-code/custom-code.d.ts +2 -0
- package/dist/react/blocks/custom-code/custom-code.js +1 -0
- package/dist/react/blocks/embed/component-info.d.ts +22 -0
- package/dist/react/blocks/embed/embed.d.ts +2 -0
- package/dist/react/blocks/embed/embed.js +1 -0
- package/dist/react/blocks/embed/helpers.d.ts +1 -0
- package/dist/react/blocks/form/component-info.d.ts +235 -0
- package/dist/react/blocks/form/form.d.ts +2 -0
- package/dist/react/blocks/form/form.js +1 -0
- package/dist/react/blocks/fragment/component-info.d.ts +8 -0
- package/dist/react/blocks/fragment/fragment.d.ts +2 -0
- package/dist/react/blocks/fragment/fragment.js +1 -0
- package/dist/react/blocks/image/component-info.d.ts +114 -0
- package/dist/react/blocks/image/image.d.ts +2 -0
- package/dist/react/blocks/image/image.helpers.d.ts +1 -0
- package/dist/react/blocks/image/image.js +1 -0
- package/dist/react/blocks/img/component-info.d.ts +15 -0
- package/dist/react/blocks/img/img.d.ts +2 -0
- package/dist/react/blocks/img/img.js +1 -0
- package/dist/react/blocks/input/component-info.d.ts +66 -0
- package/dist/react/blocks/input/input.d.ts +2 -0
- package/dist/react/blocks/input/input.js +1 -0
- package/dist/react/blocks/raw-text/component-info.d.ts +10 -0
- package/dist/react/blocks/raw-text/raw-text.d.ts +2 -0
- package/dist/react/blocks/raw-text/raw-text.js +1 -0
- package/dist/react/blocks/section/component-info.d.ts +43 -0
- package/dist/react/blocks/section/section.d.ts +2 -0
- package/dist/react/blocks/section/section.js +1 -0
- package/dist/react/blocks/select/component-info.d.ts +61 -0
- package/dist/react/blocks/select/select.d.ts +2 -0
- package/dist/react/blocks/select/select.js +1 -0
- package/dist/react/blocks/submit-button/component-info.d.ts +23 -0
- package/dist/react/blocks/submit-button/submit-button.d.ts +2 -0
- package/dist/react/blocks/submit-button/submit-button.js +1 -0
- package/dist/react/blocks/symbol/component-info.d.ts +35 -0
- package/dist/react/blocks/symbol/symbol.d.ts +2 -0
- package/dist/react/blocks/symbol/symbol.js +3 -1
- package/dist/react/blocks/text/component-info.d.ts +19 -0
- package/dist/react/blocks/text/text.d.ts +2 -0
- package/dist/react/blocks/text/text.js +1 -0
- package/dist/react/blocks/textarea/component-info.d.ts +53 -0
- package/dist/react/blocks/textarea/textarea.d.ts +2 -0
- package/dist/react/blocks/textarea/textarea.js +1 -0
- package/dist/react/blocks/util.d.ts +1 -0
- package/dist/react/blocks/video/component-info.d.ts +80 -0
- package/dist/react/blocks/video/video.d.ts +2 -0
- package/dist/react/blocks/video/video.js +1 -0
- package/dist/react/components/render-block/block-styles.d.ts +2 -0
- package/dist/react/components/render-block/block-styles.js +1 -0
- package/dist/react/components/render-block/render-block.d.ts +2 -0
- package/dist/react/components/render-block/render-block.helpers.d.ts +13 -0
- package/dist/react/components/render-block/render-block.js +3 -3
- package/dist/react/components/render-block/render-component.d.ts +2 -0
- package/dist/react/components/render-block/render-component.js +1 -0
- package/dist/react/components/render-block/render-repeated-block.d.ts +2 -0
- package/dist/react/components/render-block/render-repeated-block.js +1 -0
- package/dist/react/components/render-blocks.d.ts +2 -0
- package/dist/react/components/render-blocks.js +1 -0
- package/dist/react/components/render-content/builder-editing.d.ts +2 -0
- package/dist/react/components/render-content/builder-editing.js +1 -0
- package/dist/react/components/render-content/components/render-styles.d.ts +2 -0
- package/dist/react/components/render-content/components/render-styles.helpers.d.ts +7 -0
- package/dist/react/components/render-content/components/render-styles.js +1 -0
- package/dist/react/components/render-content/index.d.ts +2 -0
- package/dist/react/components/render-content/render-content.d.ts +2 -0
- package/dist/react/components/render-content/render-content.helpers.d.ts +9 -0
- package/dist/react/components/render-content/render-content.js +9 -7
- package/dist/react/components/render-content-variants/helpers.js +98 -0
- package/dist/react/components/render-content-variants/render-content-variants.js +45 -0
- package/dist/react/components/render-inlined-styles.d.ts +2 -0
- package/dist/react/components/render-inlined-styles.js +1 -0
- package/dist/react/constants/builder-registered-components.d.ts +1 -0
- package/dist/react/constants/device-sizes.d.ts +21 -0
- package/dist/react/constants/target.d.ts +1 -0
- package/dist/react/context/builder.context.d.ts +11 -0
- package/dist/react/functions/camel-to-kebab-case.d.ts +1 -0
- package/dist/react/functions/evaluate.d.ts +7 -0
- package/dist/react/functions/event-handler-name.d.ts +1 -0
- package/dist/react/functions/extract-text-styles.d.ts +1 -0
- package/dist/react/functions/fast-clone.d.ts +1 -0
- package/dist/react/functions/get-block-actions-handler.d.ts +1 -0
- package/dist/react/functions/get-block-actions.d.ts +1 -0
- package/dist/react/functions/get-block-component-options.d.ts +1 -0
- package/dist/react/functions/get-block-properties.d.ts +1 -0
- package/dist/react/functions/get-block-properties.js +4 -1
- package/dist/react/functions/get-builder-search-params/fn.test.d.ts +1 -0
- package/dist/react/functions/get-builder-search-params/index.d.ts +4 -0
- package/dist/react/functions/get-content/ab-testing.d.ts +1 -0
- package/dist/react/functions/get-content/generate-content-url.d.ts +1 -0
- package/dist/react/functions/get-content/generate-content-url.test.d.ts +1 -0
- package/dist/react/functions/get-content/index.d.ts +2 -0
- package/dist/react/functions/get-content/index.js +22 -15
- package/dist/react/functions/get-fetch.d.ts +1 -0
- package/dist/react/functions/get-global-this.d.ts +1 -0
- package/dist/react/functions/get-processed-block.d.ts +6 -0
- package/dist/react/functions/get-processed-block.test.d.ts +1 -0
- package/dist/react/functions/get-react-native-block-styles.d.ts +5 -0
- package/dist/react/functions/if-target.d.ts +5 -0
- package/dist/react/functions/is-browser.d.ts +1 -0
- package/dist/react/functions/is-editing.d.ts +1 -0
- package/dist/react/functions/is-iframe.d.ts +1 -0
- package/dist/react/functions/is-previewing.d.ts +1 -0
- package/dist/react/functions/on-change.d.ts +2 -0
- package/dist/react/functions/on-change.test.d.ts +1 -0
- package/dist/react/functions/register-component.d.ts +6 -0
- package/dist/react/functions/register.d.ts +1 -0
- package/dist/react/functions/sanitize-react-native-block-styles.d.ts +1 -0
- package/dist/react/functions/set-editor-settings.d.ts +1 -0
- package/dist/react/functions/set.d.ts +1 -0
- package/dist/react/functions/set.test.d.ts +1 -0
- package/dist/react/functions/track/helpers.d.ts +5 -0
- package/dist/react/functions/track/index.d.ts +2 -0
- package/dist/react/functions/track/index.js +2 -1
- package/dist/react/functions/track/interaction.d.ts +14 -0
- package/dist/react/functions/transform-block-properties.d.ts +1 -0
- package/dist/react/functions/transform-block.d.ts +1 -0
- package/dist/react/helpers/ab-tests.d.ts +9 -0
- package/dist/react/helpers/cookie.d.ts +2 -0
- package/dist/react/helpers/css.d.ts +7 -0
- package/dist/react/helpers/flatten.d.ts +1 -0
- package/dist/react/helpers/localStorage.d.ts +9 -0
- package/dist/react/helpers/logger.d.ts +5 -0
- package/dist/react/helpers/logger.js +7 -0
- package/dist/react/helpers/nullable.d.ts +1 -0
- package/dist/react/helpers/sessionId.d.ts +6 -0
- package/dist/react/helpers/time.d.ts +1 -0
- package/dist/react/helpers/url.d.ts +1 -0
- package/dist/react/helpers/url.test.d.ts +1 -0
- package/dist/react/helpers/uuid.d.ts +2 -0
- package/dist/react/helpers/visitorId.d.ts +8 -0
- package/dist/react/index-helpers/blocks-exports.d.ts +11 -0
- package/dist/react/index-helpers/top-of-file.d.ts +2 -0
- package/{src/index.js → dist/react/index.d.ts} +2 -5
- package/dist/react/scripts/init-editing.d.ts +2 -0
- package/dist/react/types/api-version.d.ts +1 -0
- package/dist/react/types/targets.d.ts +0 -0
- package/dist/react/types/typescript.d.ts +0 -0
- package/dist/rsc/blocks/BaseText.d.ts +2 -0
- package/dist/rsc/blocks/button/button.d.ts +2 -0
- package/dist/rsc/blocks/button/component-info.d.ts +38 -0
- package/dist/rsc/blocks/columns/columns.d.ts +2 -0
- package/dist/rsc/blocks/columns/component-info.d.ts +176 -0
- package/dist/rsc/blocks/custom-code/component-info.d.ts +31 -0
- package/dist/rsc/blocks/custom-code/custom-code.d.ts +2 -0
- package/dist/rsc/blocks/embed/component-info.d.ts +22 -0
- package/dist/rsc/blocks/embed/embed.d.ts +2 -0
- package/dist/rsc/blocks/embed/helpers.d.ts +1 -0
- package/dist/rsc/blocks/form/component-info.d.ts +235 -0
- package/dist/rsc/blocks/form/form.d.ts +2 -0
- package/dist/rsc/blocks/fragment/component-info.d.ts +8 -0
- package/dist/rsc/blocks/fragment/fragment.d.ts +2 -0
- package/dist/rsc/blocks/image/component-info.d.ts +114 -0
- package/dist/rsc/blocks/image/image.d.ts +2 -0
- package/dist/rsc/blocks/image/image.helpers.d.ts +1 -0
- package/dist/rsc/blocks/img/component-info.d.ts +15 -0
- package/dist/rsc/blocks/img/img.d.ts +2 -0
- package/dist/rsc/blocks/input/component-info.d.ts +66 -0
- package/dist/rsc/blocks/input/input.d.ts +2 -0
- package/dist/rsc/blocks/raw-text/component-info.d.ts +10 -0
- package/dist/rsc/blocks/raw-text/raw-text.d.ts +2 -0
- package/dist/rsc/blocks/section/component-info.d.ts +43 -0
- package/dist/rsc/blocks/section/section.d.ts +2 -0
- package/dist/rsc/blocks/select/component-info.d.ts +61 -0
- package/dist/rsc/blocks/select/select.d.ts +2 -0
- package/dist/rsc/blocks/submit-button/component-info.d.ts +23 -0
- package/dist/rsc/blocks/submit-button/submit-button.d.ts +2 -0
- package/dist/rsc/blocks/symbol/component-info.d.ts +35 -0
- package/dist/rsc/blocks/symbol/symbol.d.ts +2 -0
- package/dist/rsc/blocks/symbol/symbol.js +2 -1
- package/dist/rsc/blocks/text/component-info.d.ts +19 -0
- package/dist/rsc/blocks/text/text.d.ts +2 -0
- package/dist/rsc/blocks/textarea/component-info.d.ts +53 -0
- package/dist/rsc/blocks/textarea/textarea.d.ts +2 -0
- package/dist/rsc/blocks/util.d.ts +1 -0
- package/dist/rsc/blocks/video/component-info.d.ts +80 -0
- package/dist/rsc/blocks/video/video.d.ts +2 -0
- package/dist/rsc/components/render-block/block-styles.d.ts +2 -0
- package/dist/rsc/components/render-block/render-block.d.ts +2 -0
- package/dist/rsc/components/render-block/render-block.helpers.d.ts +10 -0
- package/dist/rsc/components/render-block/render-block.js +2 -3
- package/dist/rsc/components/render-block/render-component.d.ts +2 -0
- package/dist/rsc/components/render-block/render-repeated-block.d.ts +2 -0
- package/dist/rsc/components/render-block/types.d.ts +0 -0
- package/dist/rsc/components/render-blocks.d.ts +2 -0
- package/dist/rsc/components/render-content/builder-editing.d.ts +27 -0
- package/dist/rsc/components/render-content/components/render-styles.d.ts +2 -0
- package/dist/rsc/components/render-content/components/render-styles.helpers.d.ts +7 -0
- package/dist/rsc/components/render-content/index.d.ts +2 -0
- package/dist/rsc/components/render-content/render-content.d.ts +2 -0
- package/dist/rsc/components/render-content/render-content.helpers.d.ts +9 -0
- package/dist/rsc/components/render-content/render-content.js +1 -0
- package/dist/rsc/components/render-content/render-content.types.d.ts +0 -0
- package/dist/rsc/components/render-content-variants/helpers.js +99 -0
- package/dist/rsc/components/render-content-variants/render-content-variants.js +45 -0
- package/dist/rsc/components/render-inlined-styles.d.ts +2 -0
- package/dist/rsc/constants/builder-registered-components.d.ts +1 -0
- package/dist/rsc/constants/device-sizes.d.ts +21 -0
- package/dist/rsc/constants/target.d.ts +1 -0
- package/dist/rsc/context/builder.context.d.ts +11 -0
- package/dist/rsc/context/types.d.ts +0 -0
- package/dist/rsc/functions/camel-to-kebab-case.d.ts +1 -0
- package/dist/rsc/functions/evaluate.d.ts +1 -0
- package/dist/rsc/functions/event-handler-name.d.ts +1 -0
- package/dist/rsc/functions/extract-text-styles.d.ts +1 -0
- package/dist/rsc/functions/fast-clone.d.ts +1 -0
- package/dist/rsc/functions/get-block-actions-handler.d.ts +1 -0
- package/dist/rsc/functions/get-block-actions.d.ts +1 -0
- package/dist/rsc/functions/get-block-component-options.d.ts +1 -0
- package/dist/rsc/functions/get-block-properties.d.ts +1 -0
- package/dist/rsc/functions/get-block-properties.js +4 -1
- package/dist/rsc/functions/get-builder-search-params/fn.test.d.ts +1 -0
- package/dist/rsc/functions/get-builder-search-params/index.d.ts +4 -0
- package/dist/rsc/functions/get-content/ab-testing.d.ts +1 -0
- package/dist/rsc/functions/get-content/generate-content-url.d.ts +1 -0
- package/dist/rsc/functions/get-content/generate-content-url.test.d.ts +1 -0
- package/dist/rsc/functions/get-content/index.d.ts +2 -0
- package/dist/rsc/functions/get-content/index.js +22 -15
- package/dist/rsc/functions/get-content/types.d.ts +0 -0
- package/dist/rsc/functions/get-fetch.d.ts +1 -0
- package/dist/rsc/functions/get-global-this.d.ts +1 -0
- package/dist/rsc/functions/get-processed-block.d.ts +6 -0
- package/dist/rsc/functions/get-processed-block.test.d.ts +1 -0
- package/dist/rsc/functions/get-react-native-block-styles.d.ts +5 -0
- package/dist/rsc/functions/if-target.d.ts +5 -0
- package/dist/rsc/functions/is-browser.d.ts +1 -0
- package/dist/rsc/functions/is-editing.d.ts +1 -0
- package/dist/rsc/functions/is-iframe.d.ts +1 -0
- package/dist/rsc/functions/is-previewing.d.ts +1 -0
- package/dist/rsc/functions/on-change.d.ts +2 -0
- package/dist/rsc/functions/on-change.test.d.ts +1 -0
- package/dist/rsc/functions/register-component.d.ts +6 -0
- package/dist/rsc/functions/register.d.ts +1 -0
- package/dist/rsc/functions/sanitize-react-native-block-styles.d.ts +1 -0
- package/dist/rsc/functions/set-editor-settings.d.ts +1 -0
- package/dist/rsc/functions/set.d.ts +1 -0
- package/dist/rsc/functions/set.test.d.ts +1 -0
- package/dist/rsc/functions/track/helpers.d.ts +5 -0
- package/dist/rsc/functions/track/index.d.ts +2 -0
- package/dist/rsc/functions/track/index.js +2 -1
- package/dist/rsc/functions/track/interaction.d.ts +14 -0
- package/dist/rsc/functions/transform-block-properties.d.ts +1 -0
- package/dist/rsc/functions/transform-block.d.ts +1 -0
- package/dist/rsc/helpers/ab-tests.d.ts +9 -0
- package/dist/rsc/helpers/cookie.d.ts +2 -0
- package/dist/rsc/helpers/css.d.ts +7 -0
- package/dist/rsc/helpers/flatten.d.ts +1 -0
- package/dist/rsc/helpers/localStorage.d.ts +9 -0
- package/dist/rsc/helpers/logger.d.ts +5 -0
- package/dist/rsc/helpers/logger.js +7 -0
- package/dist/rsc/helpers/nullable.d.ts +1 -0
- package/dist/rsc/helpers/sessionId.d.ts +6 -0
- package/dist/rsc/helpers/time.d.ts +1 -0
- package/dist/rsc/helpers/url.d.ts +1 -0
- package/dist/rsc/helpers/url.test.d.ts +1 -0
- package/dist/rsc/helpers/uuid.d.ts +2 -0
- package/dist/rsc/helpers/visitorId.d.ts +8 -0
- package/dist/rsc/index-helpers/blocks-exports.d.ts +11 -0
- package/dist/rsc/index-helpers/top-of-file.d.ts +2 -0
- package/dist/rsc/index.d.ts +11 -0
- package/dist/rsc/scripts/init-editing.d.ts +2 -0
- package/dist/rsc/types/api-version.d.ts +1 -0
- package/dist/rsc/types/builder-block.d.ts +0 -0
- package/dist/rsc/types/builder-content.d.ts +0 -0
- package/dist/rsc/types/can-track.d.ts +0 -0
- package/dist/rsc/types/components.d.ts +0 -0
- package/dist/rsc/types/deep-partial.d.ts +0 -0
- package/dist/rsc/types/element.d.ts +0 -0
- package/dist/rsc/types/input.d.ts +0 -0
- package/dist/rsc/types/targets.d.ts +0 -0
- package/dist/rsc/types/typescript.d.ts +0 -0
- package/package.json +4 -10
- package/packages/react/src/blocks/BaseText.jsx +1 -0
- package/packages/react/src/blocks/button/button.jsx +1 -0
- package/packages/react/src/blocks/columns/columns.jsx +1 -0
- package/packages/react/src/blocks/custom-code/custom-code.jsx +1 -0
- package/packages/react/src/blocks/embed/embed.jsx +1 -0
- package/packages/react/src/blocks/form/form.jsx +1 -0
- package/packages/react/src/blocks/fragment/fragment.jsx +1 -0
- package/packages/react/src/blocks/image/image.jsx +1 -0
- package/packages/react/src/blocks/img/img.jsx +1 -0
- package/packages/react/src/blocks/input/input.jsx +1 -0
- package/packages/react/src/blocks/raw-text/raw-text.jsx +1 -0
- package/packages/react/src/blocks/section/section.jsx +1 -0
- package/packages/react/src/blocks/select/select.jsx +1 -0
- package/packages/react/src/blocks/submit-button/submit-button.jsx +1 -0
- package/packages/react/src/blocks/symbol/symbol.jsx +3 -1
- package/packages/react/src/blocks/text/text.jsx +1 -0
- package/packages/react/src/blocks/textarea/textarea.jsx +1 -0
- package/packages/react/src/blocks/video/video.jsx +1 -0
- package/packages/react/src/components/render-block/block-styles.jsx +1 -0
- package/packages/react/src/components/render-block/render-block.jsx +3 -3
- package/packages/react/src/components/render-block/render-component.jsx +1 -0
- package/packages/react/src/components/render-block/render-repeated-block.jsx +1 -0
- package/packages/react/src/components/render-blocks.jsx +1 -0
- package/packages/react/src/components/render-content/builder-editing.jsx +1 -0
- package/packages/react/src/components/render-content/components/render-styles.jsx +1 -0
- package/packages/react/src/components/render-content/render-content.jsx +12 -8
- package/packages/react/src/components/render-inlined-styles.jsx +1 -0
- package/packages/react/src/functions/get-block-properties.js +4 -1
- package/packages/react/src/functions/get-content/index.js +21 -15
- package/packages/react/src/functions/track/index.js +2 -1
- package/packages/react/src/helpers/logger.js +9 -0
- package/packages/rsc/src/blocks/symbol/symbol.jsx +2 -4
- package/packages/rsc/src/components/render-block/render-block.jsx +2 -3
- package/packages/rsc/src/components/render-content/render-content.jsx +1 -0
- package/packages/rsc/src/functions/get-block-properties.js +4 -1
- package/packages/rsc/src/functions/get-content/index.js +21 -15
- package/packages/rsc/src/functions/track/index.js +2 -1
- package/packages/rsc/src/helpers/logger.js +9 -0
- package/tsconfig.base.json +8 -3
- package/src/blocks/BaseText.jsx +0 -9
- package/src/blocks/button/button.jsx +0 -27
- package/src/blocks/button/component-info.js +0 -41
- package/src/blocks/columns/columns.jsx +0 -172
- package/src/blocks/columns/component-info.js +0 -242
- package/src/blocks/custom-code/component-info.js +0 -31
- package/src/blocks/custom-code/custom-code.jsx +0 -64
- package/src/blocks/embed/component-info.js +0 -44
- package/src/blocks/embed/embed.jsx +0 -49
- package/src/blocks/embed/helpers.js +0 -9
- package/src/blocks/form/component-info.js +0 -262
- package/src/blocks/form/form.jsx +0 -253
- package/src/blocks/fragment/component-info.js +0 -11
- package/src/blocks/fragment/fragment.jsx +0 -5
- package/src/blocks/image/component-info.js +0 -151
- package/src/blocks/image/image.helpers.js +0 -48
- package/src/blocks/image/image.jsx +0 -122
- package/src/blocks/img/component-info.js +0 -20
- package/src/blocks/img/img.jsx +0 -17
- package/src/blocks/input/component-info.js +0 -74
- package/src/blocks/input/input.jsx +0 -19
- package/src/blocks/raw-text/component-info.js +0 -16
- package/src/blocks/raw-text/raw-text.jsx +0 -10
- package/src/blocks/section/component-info.js +0 -49
- package/src/blocks/section/section.jsx +0 -27
- package/src/blocks/select/component-info.js +0 -59
- package/src/blocks/select/select.jsx +0 -20
- package/src/blocks/submit-button/component-info.js +0 -28
- package/src/blocks/submit-button/submit-button.jsx +0 -9
- package/src/blocks/symbol/component-info.js +0 -43
- package/src/blocks/symbol/symbol.jsx +0 -84
- package/src/blocks/text/component-info.js +0 -24
- package/src/blocks/text/text.jsx +0 -10
- package/src/blocks/textarea/component-info.js +0 -47
- package/src/blocks/textarea/textarea.jsx +0 -13
- package/src/blocks/util.js +0 -8
- package/src/blocks/video/component-info.js +0 -106
- package/src/blocks/video/video.jsx +0 -58
- package/src/components/render-block/block-styles.jsx +0 -69
- package/src/components/render-block/render-block.helpers.js +0 -23
- package/src/components/render-block/render-block.jsx +0 -252
- package/src/components/render-block/render-component-with-context.jsx +0 -38
- package/src/components/render-block/render-component.jsx +0 -33
- package/src/components/render-block/render-repeated-block.jsx +0 -33
- package/src/components/render-blocks.jsx +0 -89
- package/src/components/render-content/builder-editing.jsx +0 -5
- package/src/components/render-content/components/render-styles.jsx +0 -64
- package/src/components/render-content/index.js +0 -4
- package/src/components/render-content/render-content.jsx +0 -370
- package/src/components/render-inlined-styles.jsx +0 -28
- package/src/constants/builder-registered-components.js +0 -54
- package/src/constants/device-sizes.js +0 -48
- package/src/constants/target.js +0 -4
- package/src/context/builder.context.js +0 -12
- package/src/functions/camel-to-kebab-case.js +0 -4
- package/src/functions/evaluate.js +0 -29
- package/src/functions/event-handler-name.js +0 -7
- package/src/functions/extract-text-styles.js +0 -22
- package/src/functions/fast-clone.js +0 -4
- package/src/functions/get-block-actions-handler.js +0 -11
- package/src/functions/get-block-actions.js +0 -18
- package/src/functions/get-block-component-options.js +0 -28
- package/src/functions/get-block-properties.js +0 -50
- package/src/functions/get-block-tag.js +0 -6
- package/src/functions/get-builder-search-params/fn.test.js +0 -13
- package/src/functions/get-builder-search-params/index.js +0 -38
- package/src/functions/get-content/ab-testing.js +0 -99
- package/src/functions/get-content/generate-content-url.js +0 -55
- package/src/functions/get-content/generate-content-url.test.js +0 -31
- package/src/functions/get-content/index.js +0 -65
- package/src/functions/get-fetch.js +0 -14
- package/src/functions/get-global-this.js +0 -18
- package/src/functions/get-processed-block.js +0 -59
- package/src/functions/get-processed-block.test.js +0 -32
- package/src/functions/get-react-native-block-styles.js +0 -33
- package/src/functions/if-target.js +0 -15
- package/src/functions/is-browser.js +0 -6
- package/src/functions/is-editing.js +0 -7
- package/src/functions/is-iframe.js +0 -7
- package/src/functions/is-previewing.js +0 -14
- package/src/functions/on-change.js +0 -27
- package/src/functions/on-change.test.js +0 -19
- package/src/functions/register-component.js +0 -68
- package/src/functions/register.js +0 -29
- package/src/functions/sanitize-react-native-block-styles.js +0 -66
- package/src/functions/set-editor-settings.js +0 -15
- package/src/functions/set.js +0 -11
- package/src/functions/set.test.js +0 -16
- package/src/functions/track.js +0 -124
- package/src/functions/transform-block-properties.js +0 -6
- package/src/functions/transform-block.js +0 -6
- package/src/helpers/ab-tests.js +0 -16
- package/src/helpers/cookie.js +0 -81
- package/src/helpers/css.js +0 -34
- package/src/helpers/flatten.js +0 -34
- package/src/helpers/localStorage.js +0 -35
- package/src/helpers/nullable.js +0 -4
- package/src/helpers/sessionId.js +0 -52
- package/src/helpers/time.js +0 -5
- package/src/helpers/url.js +0 -13
- package/src/helpers/url.test.js +0 -21
- package/src/helpers/uuid.js +0 -13
- package/src/helpers/visitorId.js +0 -34
- package/src/index-helpers/blocks-exports.js +0 -22
- package/src/index-helpers/top-of-file.js +0 -4
- package/src/scripts/init-editing.js +0 -93
- /package/{src/components/render-block/types.js → dist/react/components/render-block/types.d.ts} +0 -0
- /package/{src/context/types.js → dist/react/components/render-content/render-content.types.d.ts} +0 -0
- /package/{src/functions/get-content/types.js → dist/react/context/types.d.ts} +0 -0
- /package/{src/types/builder-block.js → dist/react/functions/get-content/types.d.ts} +0 -0
- /package/{src/types/builder-content.js → dist/react/types/builder-block.d.ts} +0 -0
- /package/{src/types/can-track.js → dist/react/types/builder-content.d.ts} +0 -0
- /package/{src/types/components.js → dist/react/types/can-track.d.ts} +0 -0
- /package/{src/types/deep-partial.js → dist/react/types/components.d.ts} +0 -0
- /package/{src/types/element.js → dist/react/types/deep-partial.d.ts} +0 -0
- /package/{src/types/targets.js → dist/react/types/element.d.ts} +0 -0
- /package/{src/types/typescript.js → dist/react/types/input.d.ts} +0 -0
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
function removeProtocol(path) {
|
|
2
|
-
return path.replace(/http(s)?:/, "");
|
|
3
|
-
}
|
|
4
|
-
function updateQueryParam(uri = "", key, value) {
|
|
5
|
-
const re = new RegExp("([?&])" + key + "=.*?(&|$)", "i");
|
|
6
|
-
const separator = uri.indexOf("?") !== -1 ? "&" : "?";
|
|
7
|
-
if (uri.match(re)) {
|
|
8
|
-
return uri.replace(re, "$1" + key + "=" + encodeURIComponent(value) + "$2");
|
|
9
|
-
}
|
|
10
|
-
return uri + separator + key + "=" + encodeURIComponent(value);
|
|
11
|
-
}
|
|
12
|
-
function getShopifyImageUrl(src, size) {
|
|
13
|
-
if (!src || !(src == null ? void 0 : src.match(/cdn\.shopify\.com/)) || !size) {
|
|
14
|
-
return src;
|
|
15
|
-
}
|
|
16
|
-
if (size === "master") {
|
|
17
|
-
return removeProtocol(src);
|
|
18
|
-
}
|
|
19
|
-
const match = src.match(/(_\d+x(\d+)?)?(\.(jpg|jpeg|gif|png|bmp|bitmap|tiff|tif)(\?v=\d+)?)/i);
|
|
20
|
-
if (match) {
|
|
21
|
-
const prefix = src.split(match[0]);
|
|
22
|
-
const suffix = match[3];
|
|
23
|
-
const useSize = size.match("x") ? size : `${size}x`;
|
|
24
|
-
return removeProtocol(`${prefix[0]}_${useSize}${suffix}`);
|
|
25
|
-
}
|
|
26
|
-
return null;
|
|
27
|
-
}
|
|
28
|
-
function getSrcSet(url) {
|
|
29
|
-
if (!url) {
|
|
30
|
-
return url;
|
|
31
|
-
}
|
|
32
|
-
const sizes = [100, 200, 400, 800, 1200, 1600, 2e3];
|
|
33
|
-
if (url.match(/builder\.io/)) {
|
|
34
|
-
let srcUrl = url;
|
|
35
|
-
const widthInSrc = Number(url.split("?width=")[1]);
|
|
36
|
-
if (!isNaN(widthInSrc)) {
|
|
37
|
-
srcUrl = `${srcUrl} ${widthInSrc}w`;
|
|
38
|
-
}
|
|
39
|
-
return sizes.filter((size) => size !== widthInSrc).map((size) => `${updateQueryParam(url, "width", size)} ${size}w`).concat([srcUrl]).join(", ");
|
|
40
|
-
}
|
|
41
|
-
if (url.match(/cdn\.shopify\.com/)) {
|
|
42
|
-
return sizes.map((size) => [getShopifyImageUrl(url, `${size}x${size}`), size]).filter(([sizeUrl]) => !!sizeUrl).map(([sizeUrl, size]) => `${sizeUrl} ${size}w`).concat([url]).join(", ");
|
|
43
|
-
}
|
|
44
|
-
return url;
|
|
45
|
-
}
|
|
46
|
-
export {
|
|
47
|
-
getSrcSet
|
|
48
|
-
};
|
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { getSrcSet } from "./image.helpers.js";
|
|
3
|
-
|
|
4
|
-
export default function Image(props) {
|
|
5
|
-
function srcSetToUse() {
|
|
6
|
-
const imageToUse = props.image || props.src;
|
|
7
|
-
const url = imageToUse;
|
|
8
|
-
if (
|
|
9
|
-
!url ||
|
|
10
|
-
// We can auto add srcset for cdn.builder.io and shopify
|
|
11
|
-
// images, otherwise you can supply this prop manually
|
|
12
|
-
!(url.match(/builder\.io/) || url.match(/cdn\.shopify\.com/))
|
|
13
|
-
) {
|
|
14
|
-
return props.srcset;
|
|
15
|
-
}
|
|
16
|
-
if (props.srcset && props.image?.includes("builder.io/api/v1/image")) {
|
|
17
|
-
if (!props.srcset.includes(props.image.split("?")[0])) {
|
|
18
|
-
console.debug("Removed given srcset");
|
|
19
|
-
return getSrcSet(url);
|
|
20
|
-
}
|
|
21
|
-
} else if (props.image && !props.srcset) {
|
|
22
|
-
return getSrcSet(url);
|
|
23
|
-
}
|
|
24
|
-
return getSrcSet(url);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
function webpSrcSet() {
|
|
28
|
-
if (srcSetToUse?.()?.match(/builder\.io/) && !props.noWebp) {
|
|
29
|
-
return srcSetToUse().replace(/\?/g, "?format=webp&");
|
|
30
|
-
} else {
|
|
31
|
-
return "";
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
function aspectRatioCss() {
|
|
36
|
-
const aspectRatioStyles = {
|
|
37
|
-
position: "absolute",
|
|
38
|
-
height: "100%",
|
|
39
|
-
width: "100%",
|
|
40
|
-
left: "0px",
|
|
41
|
-
top: "0px",
|
|
42
|
-
};
|
|
43
|
-
const out = props.aspectRatio ? aspectRatioStyles : undefined;
|
|
44
|
-
return out;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
return (
|
|
48
|
-
<>
|
|
49
|
-
<>
|
|
50
|
-
<picture>
|
|
51
|
-
{webpSrcSet() ? (
|
|
52
|
-
<>
|
|
53
|
-
<source type="image/webp" srcSet={webpSrcSet()} />
|
|
54
|
-
</>
|
|
55
|
-
) : null}
|
|
56
|
-
|
|
57
|
-
<img
|
|
58
|
-
loading="lazy"
|
|
59
|
-
alt={props.altText}
|
|
60
|
-
role={props.altText ? "presentation" : undefined}
|
|
61
|
-
style={{
|
|
62
|
-
objectPosition: props.backgroundPosition || "center",
|
|
63
|
-
objectFit: props.backgroundSize || "cover",
|
|
64
|
-
...aspectRatioCss(),
|
|
65
|
-
}}
|
|
66
|
-
className={
|
|
67
|
-
"builder-image" +
|
|
68
|
-
(props.className ? " " + props.className : "") +
|
|
69
|
-
" img-35d6dc22"
|
|
70
|
-
}
|
|
71
|
-
src={props.image}
|
|
72
|
-
srcSet={srcSetToUse()}
|
|
73
|
-
sizes={props.sizes}
|
|
74
|
-
/>
|
|
75
|
-
|
|
76
|
-
<source srcSet={srcSetToUse()} />
|
|
77
|
-
</picture>
|
|
78
|
-
|
|
79
|
-
{props.aspectRatio &&
|
|
80
|
-
!(props.builderBlock?.children?.length && props.fitContent) ? (
|
|
81
|
-
<>
|
|
82
|
-
<div
|
|
83
|
-
className="builder-image-sizer div-35d6dc22"
|
|
84
|
-
style={{
|
|
85
|
-
paddingTop:
|
|
86
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
87
|
-
props.aspectRatio * 100 + "%",
|
|
88
|
-
}}
|
|
89
|
-
/>
|
|
90
|
-
</>
|
|
91
|
-
) : null}
|
|
92
|
-
|
|
93
|
-
{props.builderBlock?.children?.length && props.fitContent ? (
|
|
94
|
-
<>{props.children}</>
|
|
95
|
-
) : null}
|
|
96
|
-
|
|
97
|
-
{!props.fitContent && props.children ? (
|
|
98
|
-
<>
|
|
99
|
-
<div className="div-35d6dc22-2">{props.children}</div>
|
|
100
|
-
</>
|
|
101
|
-
) : null}
|
|
102
|
-
</>
|
|
103
|
-
<style>{`.img-35d6dc22 {
|
|
104
|
-
opacity: 1;
|
|
105
|
-
transition: opacity 0.2s ease-in-out;
|
|
106
|
-
}.div-35d6dc22 {
|
|
107
|
-
width: 100%;
|
|
108
|
-
pointer-events: none;
|
|
109
|
-
font-size: 0;
|
|
110
|
-
}.div-35d6dc22-2 {
|
|
111
|
-
display: flex;
|
|
112
|
-
flex-direction: column;
|
|
113
|
-
align-items: stretch;
|
|
114
|
-
position: absolute;
|
|
115
|
-
top: 0;
|
|
116
|
-
left: 0;
|
|
117
|
-
width: 100%;
|
|
118
|
-
height: 100%;
|
|
119
|
-
}`}</style>
|
|
120
|
-
</>
|
|
121
|
-
);
|
|
122
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
const componentInfo = {
|
|
2
|
-
name: "Raw:Img",
|
|
3
|
-
hideFromInsertMenu: true,
|
|
4
|
-
builtIn: true,
|
|
5
|
-
image: "https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-insert_photo-24px.svg?alt=media&token=4e5d0ef4-f5e8-4e57-b3a9-38d63a9b9dc4",
|
|
6
|
-
inputs: [
|
|
7
|
-
{
|
|
8
|
-
name: "image",
|
|
9
|
-
bubble: true,
|
|
10
|
-
type: "file",
|
|
11
|
-
allowedFileTypes: ["jpeg", "jpg", "png", "svg"],
|
|
12
|
-
required: true
|
|
13
|
-
}
|
|
14
|
-
],
|
|
15
|
-
noWrap: true,
|
|
16
|
-
static: true
|
|
17
|
-
};
|
|
18
|
-
export {
|
|
19
|
-
componentInfo
|
|
20
|
-
};
|
package/src/blocks/img/img.jsx
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { isEditing } from "../../functions/is-editing.js";
|
|
3
|
-
|
|
4
|
-
export default function ImgComponent(props) {
|
|
5
|
-
return (
|
|
6
|
-
<img
|
|
7
|
-
style={{
|
|
8
|
-
objectFit: props.backgroundSize || "cover",
|
|
9
|
-
objectPosition: props.backgroundPosition || "center",
|
|
10
|
-
}}
|
|
11
|
-
key={(isEditing() && props.imgSrc) || "default-key"}
|
|
12
|
-
alt={props.altText}
|
|
13
|
-
src={props.imgSrc || props.image}
|
|
14
|
-
{...props.attributes}
|
|
15
|
-
/>
|
|
16
|
-
);
|
|
17
|
-
}
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
const componentInfo = {
|
|
2
|
-
name: "Form:Input",
|
|
3
|
-
builtIn: true,
|
|
4
|
-
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fad6f37889d9e40bbbbc72cdb5875d6ca",
|
|
5
|
-
inputs: [
|
|
6
|
-
{
|
|
7
|
-
name: "type",
|
|
8
|
-
type: "text",
|
|
9
|
-
enum: [
|
|
10
|
-
"text",
|
|
11
|
-
"number",
|
|
12
|
-
"email",
|
|
13
|
-
"url",
|
|
14
|
-
"checkbox",
|
|
15
|
-
"radio",
|
|
16
|
-
"range",
|
|
17
|
-
"date",
|
|
18
|
-
"datetime-local",
|
|
19
|
-
"search",
|
|
20
|
-
"tel",
|
|
21
|
-
"time",
|
|
22
|
-
"file",
|
|
23
|
-
"month",
|
|
24
|
-
"week",
|
|
25
|
-
"password",
|
|
26
|
-
"color",
|
|
27
|
-
"hidden"
|
|
28
|
-
],
|
|
29
|
-
defaultValue: "text"
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
name: "name",
|
|
33
|
-
type: "string",
|
|
34
|
-
required: true,
|
|
35
|
-
helperText: 'Every input in a form needs a unique name describing what it takes, e.g. "email"'
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
name: "placeholder",
|
|
39
|
-
type: "string",
|
|
40
|
-
defaultValue: "Hello there",
|
|
41
|
-
helperText: "Text to display when there is no value"
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
name: "defaultValue",
|
|
45
|
-
type: "string"
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
name: "value",
|
|
49
|
-
type: "string",
|
|
50
|
-
advanced: true
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
name: "required",
|
|
54
|
-
type: "boolean",
|
|
55
|
-
helperText: "Is this input required to be filled out to submit a form",
|
|
56
|
-
defaultValue: false
|
|
57
|
-
}
|
|
58
|
-
],
|
|
59
|
-
noWrap: true,
|
|
60
|
-
static: true,
|
|
61
|
-
defaultStyles: {
|
|
62
|
-
paddingTop: "10px",
|
|
63
|
-
paddingBottom: "10px",
|
|
64
|
-
paddingLeft: "10px",
|
|
65
|
-
paddingRight: "10px",
|
|
66
|
-
borderRadius: "3px",
|
|
67
|
-
borderWidth: "1px",
|
|
68
|
-
borderStyle: "solid",
|
|
69
|
-
borderColor: "#ccc"
|
|
70
|
-
}
|
|
71
|
-
};
|
|
72
|
-
export {
|
|
73
|
-
componentInfo
|
|
74
|
-
};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { isEditing } from "../../functions/is-editing.js";
|
|
3
|
-
|
|
4
|
-
export default function FormInputComponent(props) {
|
|
5
|
-
return (
|
|
6
|
-
<input
|
|
7
|
-
{...props.attributes}
|
|
8
|
-
key={
|
|
9
|
-
isEditing() && props.defaultValue ? props.defaultValue : "default-key"
|
|
10
|
-
}
|
|
11
|
-
placeholder={props.placeholder}
|
|
12
|
-
type={props.type}
|
|
13
|
-
name={props.name}
|
|
14
|
-
value={props.value}
|
|
15
|
-
defaultValue={props.defaultValue}
|
|
16
|
-
required={props.required}
|
|
17
|
-
/>
|
|
18
|
-
);
|
|
19
|
-
}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
const componentInfo = {
|
|
2
|
-
name: "Core:Section",
|
|
3
|
-
static: true,
|
|
4
|
-
builtIn: true,
|
|
5
|
-
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F682efef23ace49afac61748dd305c70a",
|
|
6
|
-
inputs: [
|
|
7
|
-
{
|
|
8
|
-
name: "maxWidth",
|
|
9
|
-
type: "number",
|
|
10
|
-
defaultValue: 1200
|
|
11
|
-
},
|
|
12
|
-
{
|
|
13
|
-
name: "lazyLoad",
|
|
14
|
-
type: "boolean",
|
|
15
|
-
defaultValue: false,
|
|
16
|
-
advanced: true,
|
|
17
|
-
description: "Only render this section when in view"
|
|
18
|
-
}
|
|
19
|
-
],
|
|
20
|
-
defaultStyles: {
|
|
21
|
-
paddingLeft: "20px",
|
|
22
|
-
paddingRight: "20px",
|
|
23
|
-
paddingTop: "50px",
|
|
24
|
-
paddingBottom: "50px",
|
|
25
|
-
marginTop: "0px",
|
|
26
|
-
width: "100vw",
|
|
27
|
-
marginLeft: "calc(50% - 50vw)"
|
|
28
|
-
},
|
|
29
|
-
canHaveChildren: true,
|
|
30
|
-
defaultChildren: [
|
|
31
|
-
{
|
|
32
|
-
"@type": "@builder.io/sdk:Element",
|
|
33
|
-
responsiveStyles: {
|
|
34
|
-
large: {
|
|
35
|
-
textAlign: "center"
|
|
36
|
-
}
|
|
37
|
-
},
|
|
38
|
-
component: {
|
|
39
|
-
name: "Text",
|
|
40
|
-
options: {
|
|
41
|
-
text: "<p><b>I am a section! My content keeps from getting too wide, so that it's easy to read even on big screens.</b></p><p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur</p>"
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
]
|
|
46
|
-
};
|
|
47
|
-
export {
|
|
48
|
-
componentInfo
|
|
49
|
-
};
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
|
|
3
|
-
export default function SectionComponent(props) {
|
|
4
|
-
return (
|
|
5
|
-
<section
|
|
6
|
-
{...props.attributes}
|
|
7
|
-
style={{
|
|
8
|
-
width: "100%",
|
|
9
|
-
alignSelf: "stretch",
|
|
10
|
-
flexGrow: "1",
|
|
11
|
-
boxSizing: "border-box",
|
|
12
|
-
maxWidth: `${
|
|
13
|
-
props.maxWidth && typeof props.maxWidth === "number"
|
|
14
|
-
? props.maxWidth
|
|
15
|
-
: 1200
|
|
16
|
-
}px`,
|
|
17
|
-
display: "flex",
|
|
18
|
-
flexDirection: "column",
|
|
19
|
-
alignItems: "stretch",
|
|
20
|
-
marginLeft: "auto",
|
|
21
|
-
marginRight: "auto",
|
|
22
|
-
}}
|
|
23
|
-
>
|
|
24
|
-
{props.children}
|
|
25
|
-
</section>
|
|
26
|
-
);
|
|
27
|
-
}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
const componentInfo = {
|
|
2
|
-
name: "Form:Select",
|
|
3
|
-
builtIn: true,
|
|
4
|
-
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F83acca093fb24aaf94dee136e9a4b045",
|
|
5
|
-
defaultStyles: {
|
|
6
|
-
alignSelf: "flex-start"
|
|
7
|
-
},
|
|
8
|
-
inputs: [
|
|
9
|
-
{
|
|
10
|
-
name: "options",
|
|
11
|
-
type: "list",
|
|
12
|
-
required: true,
|
|
13
|
-
subFields: [
|
|
14
|
-
{
|
|
15
|
-
name: "value",
|
|
16
|
-
type: "text",
|
|
17
|
-
required: true
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
name: "name",
|
|
21
|
-
type: "text"
|
|
22
|
-
}
|
|
23
|
-
],
|
|
24
|
-
defaultValue: [
|
|
25
|
-
{
|
|
26
|
-
value: "option 1"
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
value: "option 2"
|
|
30
|
-
}
|
|
31
|
-
]
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
name: "name",
|
|
35
|
-
type: "string",
|
|
36
|
-
required: true,
|
|
37
|
-
helperText: 'Every select in a form needs a unique name describing what it gets, e.g. "email"'
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
name: "defaultValue",
|
|
41
|
-
type: "string"
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
name: "value",
|
|
45
|
-
type: "string",
|
|
46
|
-
advanced: true
|
|
47
|
-
},
|
|
48
|
-
{
|
|
49
|
-
name: "required",
|
|
50
|
-
type: "boolean",
|
|
51
|
-
defaultValue: false
|
|
52
|
-
}
|
|
53
|
-
],
|
|
54
|
-
static: true,
|
|
55
|
-
noWrap: true
|
|
56
|
-
};
|
|
57
|
-
export {
|
|
58
|
-
componentInfo
|
|
59
|
-
};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { isEditing } from "../../functions/is-editing.js";
|
|
3
|
-
|
|
4
|
-
export default function SelectComponent(props) {
|
|
5
|
-
return (
|
|
6
|
-
<select
|
|
7
|
-
{...props.attributes}
|
|
8
|
-
value={props.value}
|
|
9
|
-
key={
|
|
10
|
-
isEditing() && props.defaultValue ? props.defaultValue : "default-key"
|
|
11
|
-
}
|
|
12
|
-
defaultValue={props.defaultValue}
|
|
13
|
-
name={props.name}
|
|
14
|
-
>
|
|
15
|
-
{props.options?.map((option) => (
|
|
16
|
-
<option value={option.value}>{option.name || option.value}</option>
|
|
17
|
-
))}
|
|
18
|
-
</select>
|
|
19
|
-
);
|
|
20
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
const componentInfo = {
|
|
2
|
-
name: "Form:SubmitButton",
|
|
3
|
-
builtIn: true,
|
|
4
|
-
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fdf2820ffed1f4349a94c40b3221f5b98",
|
|
5
|
-
defaultStyles: {
|
|
6
|
-
appearance: "none",
|
|
7
|
-
paddingTop: "15px",
|
|
8
|
-
paddingBottom: "15px",
|
|
9
|
-
paddingLeft: "25px",
|
|
10
|
-
paddingRight: "25px",
|
|
11
|
-
backgroundColor: "#3898EC",
|
|
12
|
-
color: "white",
|
|
13
|
-
borderRadius: "4px",
|
|
14
|
-
cursor: "pointer"
|
|
15
|
-
},
|
|
16
|
-
inputs: [
|
|
17
|
-
{
|
|
18
|
-
name: "text",
|
|
19
|
-
type: "text",
|
|
20
|
-
defaultValue: "Click me"
|
|
21
|
-
}
|
|
22
|
-
],
|
|
23
|
-
static: true,
|
|
24
|
-
noWrap: true
|
|
25
|
-
};
|
|
26
|
-
export {
|
|
27
|
-
componentInfo
|
|
28
|
-
};
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
const componentInfo = {
|
|
2
|
-
name: "Symbol",
|
|
3
|
-
noWrap: true,
|
|
4
|
-
static: true,
|
|
5
|
-
builtIn: true,
|
|
6
|
-
inputs: [
|
|
7
|
-
{
|
|
8
|
-
name: "symbol",
|
|
9
|
-
type: "uiSymbol"
|
|
10
|
-
},
|
|
11
|
-
{
|
|
12
|
-
name: "dataOnly",
|
|
13
|
-
helperText: "Make this a data symbol that doesn't display any UI",
|
|
14
|
-
type: "boolean",
|
|
15
|
-
defaultValue: false,
|
|
16
|
-
advanced: true,
|
|
17
|
-
hideFromUI: true
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
name: "inheritState",
|
|
21
|
-
helperText: "Inherit the parent component state and data",
|
|
22
|
-
type: "boolean",
|
|
23
|
-
defaultValue: false,
|
|
24
|
-
advanced: true
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
name: "renderToLiquid",
|
|
28
|
-
helperText: "Render this symbols contents to liquid. Turn off to fetch with javascript and use custom targeting",
|
|
29
|
-
type: "boolean",
|
|
30
|
-
defaultValue: false,
|
|
31
|
-
advanced: true,
|
|
32
|
-
hideFromUI: true
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
name: "useChildren",
|
|
36
|
-
hideFromUI: true,
|
|
37
|
-
type: "boolean"
|
|
38
|
-
}
|
|
39
|
-
]
|
|
40
|
-
};
|
|
41
|
-
export {
|
|
42
|
-
componentInfo
|
|
43
|
-
};
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { useState, useContext, useEffect } from "react";
|
|
3
|
-
import RenderContent from "../../components/render-content/render-content.js";
|
|
4
|
-
import BuilderContext from "../../context/builder.context.js";
|
|
5
|
-
import { getContent } from "../../functions/get-content/index.js";
|
|
6
|
-
import { TARGET } from "../../constants/target";
|
|
7
|
-
|
|
8
|
-
export default function Symbol(props) {
|
|
9
|
-
function className() {
|
|
10
|
-
return [
|
|
11
|
-
...(TARGET === "vue2" || TARGET === "vue3"
|
|
12
|
-
? Object.keys(props.attributes.class)
|
|
13
|
-
: [props.attributes.class]),
|
|
14
|
-
"builder-symbol",
|
|
15
|
-
props.symbol?.inline ? "builder-inline-symbol" : undefined,
|
|
16
|
-
props.symbol?.dynamic || props.dynamic
|
|
17
|
-
? "builder-dynamic-symbol"
|
|
18
|
-
: undefined,
|
|
19
|
-
]
|
|
20
|
-
.filter(Boolean)
|
|
21
|
-
.join(" ");
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
const [fetchedContent, setFetchedContent] = useState(() => null);
|
|
25
|
-
|
|
26
|
-
function contentToUse() {
|
|
27
|
-
return props.symbol?.content || fetchedContent;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
const builderContext = useContext(BuilderContext);
|
|
31
|
-
|
|
32
|
-
useEffect(() => {
|
|
33
|
-
const symbolToUse = props.symbol;
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* If:
|
|
37
|
-
* - we have a symbol prop
|
|
38
|
-
* - yet it does not have any content
|
|
39
|
-
* - and we have not already stored content from before
|
|
40
|
-
* - and it has a model name
|
|
41
|
-
*
|
|
42
|
-
* then we want to re-fetch the symbol content.
|
|
43
|
-
*/
|
|
44
|
-
if (
|
|
45
|
-
symbolToUse &&
|
|
46
|
-
!symbolToUse.content &&
|
|
47
|
-
!fetchedContent &&
|
|
48
|
-
symbolToUse.model
|
|
49
|
-
) {
|
|
50
|
-
getContent({
|
|
51
|
-
model: symbolToUse.model,
|
|
52
|
-
apiKey: builderContext.apiKey,
|
|
53
|
-
query: {
|
|
54
|
-
id: symbolToUse.entry,
|
|
55
|
-
},
|
|
56
|
-
}).then((response) => {
|
|
57
|
-
setFetchedContent(response);
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
}, [props.symbol, fetchedContent]);
|
|
61
|
-
|
|
62
|
-
return (
|
|
63
|
-
<div
|
|
64
|
-
{...props.attributes}
|
|
65
|
-
dataSet={{
|
|
66
|
-
class: className(),
|
|
67
|
-
}}
|
|
68
|
-
className={className()}
|
|
69
|
-
>
|
|
70
|
-
<RenderContent
|
|
71
|
-
apiKey={builderContext.apiKey}
|
|
72
|
-
context={builderContext.context}
|
|
73
|
-
customComponents={Object.values(builderContext.registeredComponents)}
|
|
74
|
-
data={{
|
|
75
|
-
...props.symbol?.data,
|
|
76
|
-
...builderContext.state,
|
|
77
|
-
...props.symbol?.content?.data?.state,
|
|
78
|
-
}}
|
|
79
|
-
model={props.symbol?.model}
|
|
80
|
-
content={contentToUse()}
|
|
81
|
-
/>
|
|
82
|
-
</div>
|
|
83
|
-
);
|
|
84
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
const componentInfo = {
|
|
2
|
-
name: "Text",
|
|
3
|
-
static: true,
|
|
4
|
-
builtIn: true,
|
|
5
|
-
image: "https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-text_fields-24px%20(1).svg?alt=media&token=12177b73-0ee3-42ca-98c6-0dd003de1929",
|
|
6
|
-
inputs: [
|
|
7
|
-
{
|
|
8
|
-
name: "text",
|
|
9
|
-
type: "html",
|
|
10
|
-
required: true,
|
|
11
|
-
autoFocus: true,
|
|
12
|
-
bubble: true,
|
|
13
|
-
defaultValue: "Enter some text..."
|
|
14
|
-
}
|
|
15
|
-
],
|
|
16
|
-
defaultStyles: {
|
|
17
|
-
lineHeight: "normal",
|
|
18
|
-
height: "auto",
|
|
19
|
-
textAlign: "center"
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
export {
|
|
23
|
-
componentInfo
|
|
24
|
-
};
|