@builder.io/sdk-react 0.2.3-3 → 0.2.3-4
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/sdk/blocks/BaseText.d.ts +6 -0
- package/dist/sdk/blocks/BaseText.js +9 -0
- package/dist/sdk/blocks/button/button.d.ts +9 -0
- package/dist/sdk/blocks/button/button.js +14 -0
- package/dist/sdk/blocks/button/component-info.d.ts +2 -0
- package/dist/sdk/blocks/button/component-info.js +38 -0
- package/dist/sdk/blocks/columns/columns.d.ts +16 -0
- package/dist/sdk/blocks/columns/columns.js +127 -0
- package/dist/sdk/blocks/columns/component-info.d.ts +2 -0
- package/dist/sdk/blocks/columns/component-info.js +240 -0
- package/dist/sdk/blocks/custom-code/component-info.d.ts +2 -0
- package/dist/sdk/blocks/custom-code/component-info.js +27 -0
- package/dist/sdk/blocks/custom-code/custom-code.d.ts +7 -0
- package/dist/sdk/blocks/embed/component-info.d.ts +2 -0
- package/dist/sdk/blocks/embed/component-info.js +46 -0
- package/dist/sdk/blocks/embed/embed.d.ts +6 -0
- package/dist/sdk/blocks/embed/helpers.d.ts +1 -0
- package/dist/sdk/blocks/embed/helpers.js +6 -0
- package/dist/sdk/blocks/form/component-info.d.ts +2 -0
- package/dist/sdk/blocks/form/component-info.js +267 -0
- package/dist/sdk/blocks/form/form.d.ts +40 -0
- package/dist/sdk/blocks/form/form.js +203 -0
- package/dist/sdk/blocks/fragment/component-info.d.ts +2 -0
- package/dist/sdk/blocks/fragment/component-info.js +7 -0
- package/dist/sdk/blocks/fragment/fragment.d.ts +8 -0
- package/dist/sdk/blocks/image/component-info.d.ts +2 -0
- package/dist/sdk/blocks/image/component-info.js +152 -0
- package/dist/sdk/blocks/image/image.d.ts +22 -0
- package/dist/sdk/blocks/image/image.helpers.d.ts +1 -0
- package/dist/sdk/blocks/image/image.helpers.js +56 -0
- package/dist/sdk/blocks/image/image.js +81 -0
- package/dist/sdk/blocks/img/component-info.d.ts +2 -0
- package/dist/sdk/blocks/img/component-info.js +17 -0
- package/dist/sdk/blocks/img/img.d.ts +11 -0
- package/dist/sdk/blocks/input/component-info.d.ts +2 -0
- package/dist/sdk/blocks/input/component-info.js +71 -0
- package/dist/sdk/blocks/input/input.d.ts +12 -0
- package/dist/sdk/blocks/raw-text/component-info.d.ts +2 -0
- package/dist/sdk/blocks/raw-text/component-info.js +12 -0
- package/dist/sdk/blocks/raw-text/raw-text.d.ts +7 -0
- package/dist/sdk/blocks/section/component-info.d.ts +2 -0
- package/dist/sdk/blocks/section/component-info.js +45 -0
- package/dist/sdk/blocks/section/section.d.ts +9 -0
- package/dist/sdk/blocks/select/component-info.d.ts +2 -0
- package/dist/sdk/blocks/select/component-info.js +55 -0
- package/dist/sdk/blocks/select/select.d.ts +13 -0
- package/dist/sdk/blocks/submit-button/component-info.d.ts +2 -0
- package/dist/sdk/blocks/submit-button/component-info.js +28 -0
- package/dist/sdk/blocks/submit-button/submit-button.d.ts +7 -0
- package/dist/sdk/blocks/symbol/component-info.d.ts +2 -0
- package/dist/sdk/blocks/symbol/component-info.js +39 -0
- package/dist/sdk/blocks/symbol/symbol.d.ts +21 -0
- package/dist/sdk/blocks/symbol/symbol.js +68 -0
- package/dist/sdk/blocks/text/component-info.d.ts +2 -0
- package/dist/sdk/blocks/text/component-info.js +20 -0
- package/dist/sdk/blocks/text/text.d.ts +6 -0
- package/dist/sdk/blocks/textarea/component-info.d.ts +2 -0
- package/dist/sdk/blocks/textarea/component-info.js +43 -0
- package/dist/sdk/blocks/textarea/textarea.d.ts +10 -0
- package/dist/sdk/blocks/util.d.ts +4 -0
- package/dist/sdk/blocks/util.js +13 -0
- package/dist/sdk/blocks/video/component-info.d.ts +2 -0
- package/dist/sdk/blocks/video/component-info.js +102 -0
- package/dist/sdk/blocks/video/video.d.ts +19 -0
- package/dist/sdk/blocks/video/video.js +47 -0
- package/dist/sdk/components/render-block/block-styles.d.ts +9 -0
- package/dist/sdk/components/render-block/render-block.d.ts +9 -0
- package/dist/sdk/components/render-block/render-block.helpers.d.ts +13 -0
- package/dist/sdk/components/render-block/render-block.helpers.js +98 -0
- package/dist/sdk/components/render-block/render-block.js +130 -0
- package/dist/sdk/components/render-block/render-component.d.ts +17 -0
- package/dist/sdk/components/render-block/render-repeated-block.d.ts +9 -0
- package/dist/sdk/components/render-block/render-repeated-block.js +27 -0
- package/dist/sdk/components/render-block/types.d.ts +6 -0
- package/dist/sdk/components/render-blocks.d.ts +10 -0
- package/dist/sdk/components/render-blocks.js +45 -0
- package/dist/sdk/components/render-content/builder-editing.d.ts +3 -0
- package/dist/sdk/components/render-content/components/render-styles.d.ts +9 -0
- package/dist/sdk/components/render-content/components/render-styles.helpers.d.ts +15 -0
- package/dist/sdk/components/render-content/components/render-styles.helpers.js +59 -0
- package/dist/sdk/components/render-content/components/render-styles.js +32 -0
- package/dist/sdk/components/render-content/index.d.ts +1 -0
- package/dist/sdk/components/render-content/index.js +1 -0
- package/dist/sdk/components/render-content/render-content.d.ts +4 -0
- package/dist/sdk/components/render-content/render-content.helpers.d.ts +7 -0
- package/dist/sdk/components/render-content/render-content.helpers.js +30 -0
- package/dist/sdk/components/render-content/render-content.js +282 -0
- package/dist/sdk/components/render-content/render-content.types.d.ts +29 -0
- package/dist/sdk/components/render-inlined-styles.d.ts +6 -0
- package/dist/sdk/components/render-inlined-styles.js +17 -0
- package/dist/sdk/constants/builder-registered-components.d.ts +6 -0
- package/dist/sdk/constants/builder-registered-components.js +39 -0
- package/dist/sdk/constants/device-sizes.d.ts +13 -0
- package/dist/sdk/constants/device-sizes.js +44 -0
- package/dist/sdk/constants/target.d.ts +2 -0
- package/dist/sdk/constants/target.js +2 -0
- package/dist/sdk/context/builder.context.d.ts +3 -0
- package/dist/sdk/context/builder.context.js +11 -0
- package/dist/sdk/context/types.d.ts +20 -0
- package/dist/sdk/functions/camel-to-kebab-case.d.ts +1 -0
- package/dist/sdk/functions/camel-to-kebab-case.js +1 -0
- package/dist/sdk/functions/evaluate.d.ts +6 -0
- package/dist/sdk/functions/evaluate.js +28 -0
- package/dist/sdk/functions/event-handler-name.d.ts +1 -0
- package/dist/sdk/functions/event-handler-name.js +4 -0
- package/dist/sdk/functions/extract-text-styles.d.ts +4 -0
- package/dist/sdk/functions/extract-text-styles.js +34 -0
- package/dist/sdk/functions/fast-clone.d.ts +4 -0
- package/dist/sdk/functions/fast-clone.js +4 -0
- package/dist/sdk/functions/get-block-actions-handler.d.ts +8 -0
- package/dist/sdk/functions/get-block-actions-handler.js +8 -0
- package/dist/sdk/functions/get-block-actions.d.ts +9 -0
- package/dist/sdk/functions/get-block-actions.js +15 -0
- package/dist/sdk/functions/get-block-component-options.d.ts +2 -0
- package/dist/sdk/functions/get-block-component-options.js +10 -0
- package/dist/sdk/functions/get-block-properties.d.ts +7 -0
- package/dist/sdk/functions/get-block-properties.js +66 -0
- package/dist/sdk/functions/get-builder-search-params/fn.test.js +13 -0
- package/dist/sdk/functions/get-builder-search-params/index.d.ts +6 -0
- package/dist/sdk/functions/get-builder-search-params/index.js +36 -0
- package/dist/sdk/functions/get-content/ab-testing.d.ts +5 -0
- package/dist/sdk/functions/get-content/ab-testing.js +78 -0
- package/dist/sdk/functions/get-content/generate-content-url.d.ts +2 -0
- package/dist/sdk/functions/get-content/generate-content-url.js +31 -0
- package/dist/sdk/functions/get-content/generate-content-url.test.js +82 -0
- package/dist/sdk/functions/get-content/index.d.ts +11 -0
- package/dist/sdk/functions/get-content/index.js +40 -0
- package/dist/sdk/functions/get-content/types.d.ts +45 -0
- package/dist/sdk/functions/get-fetch.d.ts +1 -0
- package/dist/sdk/functions/get-fetch.js +11 -0
- package/dist/sdk/functions/get-global-this.d.ts +4 -0
- package/dist/sdk/functions/get-global-this.js +15 -0
- package/dist/sdk/functions/get-processed-block.d.ts +10 -0
- package/dist/sdk/functions/get-processed-block.js +30 -0
- package/dist/sdk/functions/get-processed-block.test.js +31 -0
- package/dist/sdk/functions/get-react-native-block-styles.d.ts +7 -0
- package/dist/sdk/functions/get-react-native-block-styles.js +17 -0
- package/dist/sdk/functions/if-target.d.ts +7 -0
- package/dist/sdk/functions/if-target.js +10 -0
- package/dist/sdk/functions/is-browser.d.ts +1 -0
- package/dist/sdk/functions/is-browser.js +3 -0
- package/dist/sdk/functions/is-editing.d.ts +1 -0
- package/dist/sdk/functions/is-editing.js +7 -0
- package/dist/sdk/functions/is-iframe.d.ts +1 -0
- package/dist/sdk/functions/is-iframe.js +4 -0
- package/dist/sdk/functions/is-previewing.d.ts +1 -0
- package/dist/sdk/functions/is-previewing.js +11 -0
- package/dist/sdk/functions/on-change.d.ts +7 -0
- package/dist/sdk/functions/on-change.js +28 -0
- package/dist/sdk/functions/on-change.test.js +20 -0
- package/dist/sdk/functions/register-component.d.ts +14 -0
- package/dist/sdk/functions/register-component.js +26 -0
- package/dist/sdk/functions/register.d.ts +16 -0
- package/dist/sdk/functions/register.js +27 -0
- package/dist/sdk/functions/sanitize-react-native-block-styles.d.ts +3 -0
- package/dist/sdk/functions/sanitize-react-native-block-styles.js +53 -0
- package/dist/sdk/functions/set-editor-settings.d.ts +4 -0
- package/dist/sdk/functions/set-editor-settings.js +12 -0
- package/dist/sdk/functions/set.d.ts +7 -0
- package/dist/sdk/functions/set.js +21 -0
- package/dist/sdk/functions/set.test.js +16 -0
- package/dist/sdk/functions/track/helpers.d.ts +5 -0
- package/dist/sdk/functions/track/helpers.js +56 -0
- package/dist/sdk/functions/track/index.d.ts +51 -0
- package/dist/sdk/functions/track/index.js +59 -0
- package/dist/sdk/functions/track/interaction.d.ts +13 -0
- package/dist/sdk/functions/track/interaction.js +54 -0
- package/dist/sdk/functions/transform-block-properties.d.ts +1 -0
- package/dist/sdk/functions/transform-block-properties.js +3 -0
- package/dist/sdk/functions/transform-block.d.ts +2 -0
- package/dist/sdk/functions/transform-block.js +4 -0
- package/dist/sdk/helpers/ab-tests.d.ts +8 -0
- package/dist/sdk/helpers/ab-tests.js +5 -0
- package/dist/sdk/helpers/cookie.d.ts +15 -0
- package/dist/sdk/helpers/cookie.js +65 -0
- package/dist/sdk/helpers/css.d.ts +7 -0
- package/dist/sdk/helpers/css.js +27 -0
- package/dist/sdk/helpers/flatten.d.ts +6 -0
- package/dist/sdk/helpers/flatten.js +19 -0
- package/dist/sdk/helpers/localStorage.d.ts +9 -0
- package/dist/sdk/helpers/localStorage.js +24 -0
- package/dist/sdk/helpers/logger.d.ts +5 -0
- package/dist/sdk/helpers/logger.js +6 -0
- package/dist/sdk/helpers/nullable.d.ts +2 -0
- package/dist/sdk/helpers/nullable.js +1 -0
- package/dist/sdk/helpers/sessionId.d.ts +6 -0
- package/dist/sdk/helpers/sessionId.js +23 -0
- package/dist/sdk/helpers/time.d.ts +1 -0
- package/dist/sdk/helpers/time.js +2 -0
- package/dist/sdk/helpers/url.d.ts +6 -0
- package/dist/sdk/helpers/url.js +15 -0
- package/dist/sdk/helpers/url.test.js +21 -0
- package/dist/sdk/helpers/uuid.d.ts +8 -0
- package/dist/sdk/helpers/uuid.js +15 -0
- package/dist/sdk/helpers/visitorId.d.ts +6 -0
- package/dist/sdk/helpers/visitorId.js +27 -0
- package/dist/sdk/index-helpers/blocks-exports.d.ts +10 -0
- package/dist/sdk/index-helpers/blocks-exports.js +10 -0
- package/dist/sdk/index-helpers/top-of-file.d.ts +1 -0
- package/dist/sdk/index-helpers/top-of-file.js +4 -0
- package/dist/sdk/index.d.ts +12 -0
- package/dist/sdk/index.js +10 -0
- package/dist/sdk/scripts/init-editing.d.ts +5 -0
- package/dist/sdk/scripts/init-editing.js +100 -0
- package/dist/sdk/types/api-version.d.ts +2 -0
- package/dist/sdk/types/api-version.js +1 -0
- package/dist/sdk/types/builder-block.d.ts +66 -0
- package/dist/sdk/types/builder-content.d.ts +46 -0
- package/dist/sdk/types/can-track.d.ts +3 -0
- package/dist/sdk/types/components.d.ts +105 -0
- package/dist/sdk/types/deep-partial.d.ts +3 -0
- package/dist/sdk/types/element.d.ts +59 -0
- package/dist/sdk/types/input.d.ts +121 -0
- package/dist/sdk/types/targets.d.ts +3 -0
- package/dist/sdk/types/typescript.d.ts +5 -0
- package/dist/sdk/types/typescript.js +1 -0
- package/dist/server/functions/get-builder-search-params/index.d.ts +6 -0
- package/dist/server/functions/get-builder-search-params/index.js +36 -0
- package/dist/server/functions/get-content/ab-testing.d.ts +5 -0
- package/dist/server/functions/get-content/ab-testing.js +78 -0
- package/dist/server/functions/get-content/generate-content-url.d.ts +2 -0
- package/dist/server/functions/get-content/generate-content-url.js +31 -0
- package/dist/server/functions/get-content/generate-content-url.test.d.ts +1 -0
- package/dist/server/functions/get-content/generate-content-url.test.js +82 -0
- package/dist/server/functions/get-content/index.d.ts +11 -0
- package/dist/server/functions/get-content/index.js +40 -0
- package/dist/server/functions/get-content/types.d.ts +45 -0
- package/dist/server/functions/get-content/types.js +1 -0
- package/dist/server/functions/get-fetch.d.ts +1 -0
- package/dist/server/functions/get-fetch.js +11 -0
- package/dist/server/functions/get-global-this.d.ts +4 -0
- package/dist/server/functions/get-global-this.js +15 -0
- package/dist/server/functions/is-browser.d.ts +1 -0
- package/dist/server/functions/is-browser.js +3 -0
- package/dist/server/helpers/ab-tests.d.ts +8 -0
- package/dist/server/helpers/ab-tests.js +5 -0
- package/dist/server/helpers/cookie.d.ts +15 -0
- package/dist/server/helpers/cookie.js +65 -0
- package/dist/server/helpers/flatten.d.ts +6 -0
- package/dist/server/helpers/flatten.js +19 -0
- package/dist/server/helpers/logger.d.ts +5 -0
- package/dist/server/helpers/logger.js +6 -0
- package/dist/server/helpers/nullable.d.ts +2 -0
- package/dist/server/helpers/nullable.js +1 -0
- package/dist/server/helpers/url.d.ts +6 -0
- package/dist/server/helpers/url.js +15 -0
- package/dist/server/types/api-version.d.ts +2 -0
- package/dist/server/types/api-version.js +1 -0
- package/dist/server/types/builder-block.d.ts +66 -0
- package/dist/server/types/builder-block.js +1 -0
- package/dist/server/types/builder-content.d.ts +46 -0
- package/dist/server/types/builder-content.js +1 -0
- package/dist/server/types/can-track.d.ts +3 -0
- package/dist/server/types/can-track.js +1 -0
- package/dist/server/types/input.d.ts +121 -0
- package/dist/server/types/input.js +1 -0
- package/dist/server/types/typescript.d.ts +5 -0
- package/dist/server/types/typescript.js +1 -0
- package/package.json +12 -13
- package/packages/react/src/blocks/BaseText.tsx +19 -0
- package/packages/react/src/blocks/button/button.tsx +45 -0
- package/packages/react/src/blocks/button/component-info.ts +42 -0
- package/packages/react/src/blocks/columns/columns.tsx +211 -0
- package/packages/react/src/blocks/columns/component-info.ts +254 -0
- package/packages/react/src/blocks/custom-code/component-info.ts +31 -0
- package/packages/react/src/blocks/custom-code/custom-code.tsx +76 -0
- package/packages/react/src/blocks/embed/component-info.ts +55 -0
- package/packages/react/src/blocks/embed/embed.tsx +59 -0
- package/packages/react/src/blocks/embed/helpers.ts +8 -0
- package/packages/react/src/blocks/form/component-info.ts +282 -0
- package/packages/react/src/blocks/form/form.tsx +320 -0
- package/packages/react/src/blocks/fragment/component-info.ts +10 -0
- package/packages/react/src/blocks/fragment/fragment.tsx +14 -0
- package/packages/react/src/blocks/image/component-info.ts +172 -0
- package/packages/react/src/blocks/image/image.helpers.ts +75 -0
- package/packages/react/src/blocks/image/image.tsx +144 -0
- package/packages/react/src/blocks/img/component-info.ts +21 -0
- package/packages/react/src/blocks/img/img.tsx +40 -0
- package/packages/react/src/blocks/input/component-info.ts +78 -0
- package/packages/react/src/blocks/input/input.tsx +33 -0
- package/packages/react/src/blocks/raw-text/component-info.ts +15 -0
- package/packages/react/src/blocks/raw-text/raw-text.tsx +18 -0
- package/packages/react/src/blocks/section/component-info.ts +50 -0
- package/packages/react/src/blocks/section/section.tsx +33 -0
- package/packages/react/src/blocks/select/component-info.ts +61 -0
- package/packages/react/src/blocks/select/select.tsx +35 -0
- package/packages/react/src/blocks/submit-button/component-info.ts +32 -0
- package/packages/react/src/blocks/submit-button/submit-button.tsx +17 -0
- package/packages/react/src/blocks/symbol/component-info.ts +43 -0
- package/packages/react/src/blocks/symbol/symbol.tsx +111 -0
- package/packages/react/src/blocks/text/component-info.ts +24 -0
- package/packages/react/src/blocks/text/text.tsx +20 -0
- package/packages/react/src/blocks/textarea/component-info.ts +48 -0
- package/packages/react/src/blocks/textarea/textarea.tsx +24 -0
- package/packages/react/src/blocks/util.ts +18 -0
- package/packages/react/src/blocks/video/component-info.ts +109 -0
- package/packages/react/src/blocks/video/video.tsx +84 -0
- package/packages/react/src/components/render-block/block-styles.tsx +98 -0
- package/packages/react/src/components/render-block/render-block.helpers.ts +138 -0
- package/packages/react/src/components/render-block/render-block.tsx +216 -0
- package/packages/react/src/components/render-block/render-component.tsx +52 -0
- package/packages/react/src/components/render-block/render-repeated-block.tsx +43 -0
- package/packages/react/src/components/render-block/types.ts +7 -0
- package/packages/react/src/components/render-blocks.tsx +97 -0
- package/packages/react/src/components/render-content/builder-editing.tsx +8 -0
- package/packages/react/src/components/render-content/components/render-styles.helpers.ts +79 -0
- package/packages/react/src/components/render-content/components/render-styles.tsx +45 -0
- package/packages/react/src/components/render-content/index.ts +1 -0
- package/packages/react/src/components/render-content/render-content.helpers.ts +48 -0
- package/packages/react/src/components/render-content/render-content.tsx +410 -0
- package/packages/react/src/components/render-content/render-content.types.ts +33 -0
- package/packages/react/src/components/render-inlined-styles.tsx +36 -0
- package/packages/react/src/constants/builder-registered-components.ts +42 -0
- package/packages/react/src/constants/device-sizes.ts +65 -0
- package/packages/react/src/constants/target.ts +2 -0
- package/packages/react/src/context/builder.context.ts +12 -0
- package/packages/react/src/context/types.ts +26 -0
- package/packages/react/src/functions/camel-to-kebab-case.ts +2 -0
- package/packages/react/src/functions/evaluate.ts +57 -0
- package/packages/react/src/functions/event-handler-name.ts +6 -0
- package/packages/react/src/functions/extract-text-styles.ts +39 -0
- package/packages/react/src/functions/fast-clone.ts +5 -0
- package/packages/react/src/functions/get-block-actions-handler.ts +20 -0
- package/packages/react/src/functions/get-block-actions.ts +25 -0
- package/packages/react/src/functions/get-block-component-options.ts +12 -0
- package/packages/react/src/functions/get-block-properties.ts +75 -0
- package/packages/react/src/functions/get-builder-search-params/fn.test.ts +19 -0
- package/packages/react/src/functions/get-builder-search-params/index.ts +50 -0
- package/packages/react/src/functions/get-content/ab-testing.ts +132 -0
- package/packages/react/src/functions/get-content/generate-content-url.test.ts +95 -0
- package/packages/react/src/functions/get-content/generate-content-url.ts +59 -0
- package/packages/react/src/functions/get-content/index.ts +62 -0
- package/packages/react/src/functions/get-content/types.ts +53 -0
- package/packages/react/src/functions/get-fetch.ts +18 -0
- package/packages/react/src/functions/get-global-this.ts +17 -0
- package/packages/react/src/functions/get-processed-block.test.ts +33 -0
- package/packages/react/src/functions/get-processed-block.ts +54 -0
- package/packages/react/src/functions/get-react-native-block-styles.ts +33 -0
- package/packages/react/src/functions/if-target.ts +20 -0
- package/packages/react/src/functions/is-browser.ts +3 -0
- package/packages/react/src/functions/is-editing.ts +10 -0
- package/packages/react/src/functions/is-iframe.ts +5 -0
- package/packages/react/src/functions/is-previewing.ts +14 -0
- package/packages/react/src/functions/on-change.test.ts +23 -0
- package/packages/react/src/functions/on-change.ts +29 -0
- package/packages/react/src/functions/register-component.ts +50 -0
- package/packages/react/src/functions/register.ts +46 -0
- package/packages/react/src/functions/sanitize-react-native-block-styles.ts +65 -0
- package/packages/react/src/functions/set-editor-settings.ts +16 -0
- package/packages/react/src/functions/set.test.ts +19 -0
- package/packages/react/src/functions/set.ts +26 -0
- package/packages/react/src/functions/track/helpers.ts +67 -0
- package/packages/react/src/functions/track/index.ts +136 -0
- package/packages/react/src/functions/track/interaction.ts +80 -0
- package/packages/react/src/functions/transform-block-properties.ts +3 -0
- package/packages/react/src/functions/transform-block.ts +6 -0
- package/packages/react/src/helpers/ab-tests.ts +22 -0
- package/packages/react/src/helpers/cookie.ts +107 -0
- package/packages/react/src/helpers/css.ts +42 -0
- package/packages/react/src/helpers/flatten.ts +24 -0
- package/packages/react/src/helpers/localStorage.ts +40 -0
- package/packages/react/src/helpers/logger.ts +6 -0
- package/packages/react/src/helpers/nullable.ts +4 -0
- package/packages/react/src/helpers/sessionId.ts +38 -0
- package/packages/react/src/helpers/time.ts +4 -0
- package/packages/react/src/helpers/url.test.ts +23 -0
- package/packages/react/src/helpers/url.ts +16 -0
- package/packages/react/src/helpers/uuid.ts +17 -0
- package/packages/react/src/helpers/visitorId.ts +40 -0
- package/packages/react/src/index-helpers/blocks-exports.ts +10 -0
- package/packages/react/src/index-helpers/top-of-file.ts +4 -0
- package/packages/react/src/index.ts +14 -0
- package/packages/react/src/scripts/init-editing.ts +123 -0
- package/packages/react/src/types/api-version.ts +2 -0
- package/packages/react/src/types/builder-block.ts +69 -0
- package/packages/react/src/types/builder-content.ts +46 -0
- package/packages/react/src/types/can-track.ts +3 -0
- package/packages/react/src/types/components.ts +117 -0
- package/packages/react/src/types/deep-partial.ts +7 -0
- package/packages/react/src/types/element.ts +60 -0
- package/packages/react/src/types/input.ts +125 -0
- package/packages/react/src/types/targets.ts +6 -0
- package/packages/react/src/types/typescript.ts +7 -0
- package/tsconfig.json +28 -0
- package/tsconfig.sdk.json +10 -0
- package/tsconfig.server.json +10 -0
- package/vite.config.ts +91 -0
- package/dist/react/cjs/blocks/BaseText.d.ts +0 -2
- package/dist/react/cjs/blocks/BaseText.js +0 -11
- package/dist/react/cjs/blocks/button/button.d.ts +0 -2
- package/dist/react/cjs/blocks/button/button.js +0 -15
- package/dist/react/cjs/blocks/button/component-info.d.ts +0 -38
- package/dist/react/cjs/blocks/button/component-info.js +0 -41
- package/dist/react/cjs/blocks/columns/columns.d.ts +0 -2
- package/dist/react/cjs/blocks/columns/columns.js +0 -133
- package/dist/react/cjs/blocks/columns/component-info.d.ts +0 -176
- package/dist/react/cjs/blocks/columns/component-info.js +0 -243
- package/dist/react/cjs/blocks/custom-code/component-info.d.ts +0 -31
- package/dist/react/cjs/blocks/custom-code/component-info.js +0 -31
- package/dist/react/cjs/blocks/custom-code/custom-code.d.ts +0 -2
- package/dist/react/cjs/blocks/custom-code/custom-code.js +0 -53
- package/dist/react/cjs/blocks/embed/component-info.d.ts +0 -22
- package/dist/react/cjs/blocks/embed/component-info.js +0 -46
- package/dist/react/cjs/blocks/embed/embed.d.ts +0 -2
- package/dist/react/cjs/blocks/embed/embed.js +0 -44
- package/dist/react/cjs/blocks/embed/helpers.d.ts +0 -1
- package/dist/react/cjs/blocks/embed/helpers.js +0 -10
- package/dist/react/cjs/blocks/form/component-info.d.ts +0 -235
- package/dist/react/cjs/blocks/form/component-info.js +0 -262
- package/dist/react/cjs/blocks/form/form.d.ts +0 -2
- package/dist/react/cjs/blocks/form/form.js +0 -205
- package/dist/react/cjs/blocks/fragment/component-info.d.ts +0 -8
- package/dist/react/cjs/blocks/fragment/component-info.js +0 -11
- package/dist/react/cjs/blocks/fragment/fragment.d.ts +0 -2
- package/dist/react/cjs/blocks/fragment/fragment.js +0 -8
- package/dist/react/cjs/blocks/image/component-info.d.ts +0 -114
- package/dist/react/cjs/blocks/image/component-info.js +0 -151
- package/dist/react/cjs/blocks/image/image.d.ts +0 -2
- package/dist/react/cjs/blocks/image/image.helpers.d.ts +0 -1
- package/dist/react/cjs/blocks/image/image.helpers.js +0 -49
- package/dist/react/cjs/blocks/image/image.js +0 -84
- package/dist/react/cjs/blocks/img/component-info.d.ts +0 -15
- package/dist/react/cjs/blocks/img/component-info.js +0 -20
- package/dist/react/cjs/blocks/img/img.d.ts +0 -2
- package/dist/react/cjs/blocks/img/img.js +0 -12
- package/dist/react/cjs/blocks/input/component-info.d.ts +0 -66
- package/dist/react/cjs/blocks/input/component-info.js +0 -74
- package/dist/react/cjs/blocks/input/input.d.ts +0 -2
- package/dist/react/cjs/blocks/input/input.js +0 -9
- package/dist/react/cjs/blocks/raw-text/component-info.d.ts +0 -10
- package/dist/react/cjs/blocks/raw-text/component-info.js +0 -16
- package/dist/react/cjs/blocks/raw-text/raw-text.d.ts +0 -2
- package/dist/react/cjs/blocks/raw-text/raw-text.js +0 -8
- package/dist/react/cjs/blocks/section/component-info.d.ts +0 -43
- package/dist/react/cjs/blocks/section/component-info.js +0 -49
- package/dist/react/cjs/blocks/section/section.d.ts +0 -2
- package/dist/react/cjs/blocks/section/section.js +0 -19
- package/dist/react/cjs/blocks/select/component-info.d.ts +0 -61
- package/dist/react/cjs/blocks/select/component-info.js +0 -59
- package/dist/react/cjs/blocks/select/select.d.ts +0 -2
- package/dist/react/cjs/blocks/select/select.js +0 -9
- package/dist/react/cjs/blocks/submit-button/component-info.d.ts +0 -23
- package/dist/react/cjs/blocks/submit-button/component-info.js +0 -28
- package/dist/react/cjs/blocks/submit-button/submit-button.d.ts +0 -2
- package/dist/react/cjs/blocks/submit-button/submit-button.js +0 -8
- package/dist/react/cjs/blocks/symbol/component-info.d.ts +0 -35
- package/dist/react/cjs/blocks/symbol/component-info.js +0 -43
- package/dist/react/cjs/blocks/symbol/symbol.d.ts +0 -2
- package/dist/react/cjs/blocks/symbol/symbol.js +0 -73
- package/dist/react/cjs/blocks/text/component-info.d.ts +0 -19
- package/dist/react/cjs/blocks/text/component-info.js +0 -24
- package/dist/react/cjs/blocks/text/text.d.ts +0 -2
- package/dist/react/cjs/blocks/text/text.js +0 -10
- package/dist/react/cjs/blocks/textarea/component-info.d.ts +0 -53
- package/dist/react/cjs/blocks/textarea/component-info.js +0 -47
- package/dist/react/cjs/blocks/textarea/textarea.d.ts +0 -2
- package/dist/react/cjs/blocks/textarea/textarea.js +0 -8
- package/dist/react/cjs/blocks/util.d.ts +0 -1
- package/dist/react/cjs/blocks/util.js +0 -9
- package/dist/react/cjs/blocks/video/component-info.d.ts +0 -80
- package/dist/react/cjs/blocks/video/component-info.js +0 -106
- package/dist/react/cjs/blocks/video/video.d.ts +0 -2
- package/dist/react/cjs/blocks/video/video.js +0 -52
- package/dist/react/cjs/components/render-block/block-styles.d.ts +0 -2
- package/dist/react/cjs/components/render-block/block-styles.js +0 -66
- package/dist/react/cjs/components/render-block/render-block.d.ts +0 -2
- package/dist/react/cjs/components/render-block/render-block.helpers.d.ts +0 -13
- package/dist/react/cjs/components/render-block/render-block.helpers.js +0 -125
- package/dist/react/cjs/components/render-block/render-block.js +0 -134
- package/dist/react/cjs/components/render-block/render-component.d.ts +0 -2
- package/dist/react/cjs/components/render-block/render-component.js +0 -14
- package/dist/react/cjs/components/render-block/render-repeated-block.d.ts +0 -2
- package/dist/react/cjs/components/render-block/render-repeated-block.js +0 -20
- package/dist/react/cjs/components/render-block/types.d.ts +0 -0
- package/dist/react/cjs/components/render-block/types.js +0 -1
- package/dist/react/cjs/components/render-blocks.d.ts +0 -2
- package/dist/react/cjs/components/render-blocks.js +0 -49
- package/dist/react/cjs/components/render-content/builder-editing.d.ts +0 -2
- package/dist/react/cjs/components/render-content/builder-editing.js +0 -8
- package/dist/react/cjs/components/render-content/components/render-styles.d.ts +0 -2
- package/dist/react/cjs/components/render-content/components/render-styles.helpers.d.ts +0 -7
- package/dist/react/cjs/components/render-content/components/render-styles.helpers.js +0 -55
- package/dist/react/cjs/components/render-content/components/render-styles.js +0 -34
- package/dist/react/cjs/components/render-content/index.d.ts +0 -2
- package/dist/react/cjs/components/render-content/index.js +0 -5
- package/dist/react/cjs/components/render-content/render-content.d.ts +0 -2
- package/dist/react/cjs/components/render-content/render-content.helpers.d.ts +0 -9
- package/dist/react/cjs/components/render-content/render-content.helpers.js +0 -42
- package/dist/react/cjs/components/render-content/render-content.js +0 -297
- package/dist/react/cjs/components/render-content/render-content.types.d.ts +0 -0
- package/dist/react/cjs/components/render-content/render-content.types.js +0 -1
- package/dist/react/cjs/components/render-inlined-styles.d.ts +0 -2
- package/dist/react/cjs/components/render-inlined-styles.js +0 -19
- package/dist/react/cjs/constants/builder-registered-components.d.ts +0 -1
- package/dist/react/cjs/constants/builder-registered-components.js +0 -55
- package/dist/react/cjs/constants/device-sizes.d.ts +0 -21
- package/dist/react/cjs/constants/device-sizes.js +0 -49
- package/dist/react/cjs/constants/target.d.ts +0 -1
- package/dist/react/cjs/constants/target.js +0 -5
- package/dist/react/cjs/context/builder.context.d.ts +0 -11
- package/dist/react/cjs/context/builder.context.js +0 -16
- package/dist/react/cjs/context/types.d.ts +0 -0
- package/dist/react/cjs/context/types.js +0 -1
- package/dist/react/cjs/functions/camel-to-kebab-case.d.ts +0 -1
- package/dist/react/cjs/functions/camel-to-kebab-case.js +0 -5
- package/dist/react/cjs/functions/evaluate.d.ts +0 -7
- package/dist/react/cjs/functions/evaluate.js +0 -25
- package/dist/react/cjs/functions/event-handler-name.d.ts +0 -1
- package/dist/react/cjs/functions/event-handler-name.js +0 -8
- package/dist/react/cjs/functions/extract-text-styles.d.ts +0 -1
- package/dist/react/cjs/functions/extract-text-styles.js +0 -23
- package/dist/react/cjs/functions/fast-clone.d.ts +0 -1
- package/dist/react/cjs/functions/fast-clone.js +0 -5
- package/dist/react/cjs/functions/get-block-actions-handler.d.ts +0 -1
- package/dist/react/cjs/functions/get-block-actions-handler.js +0 -12
- package/dist/react/cjs/functions/get-block-actions.d.ts +0 -1
- package/dist/react/cjs/functions/get-block-actions.js +0 -19
- package/dist/react/cjs/functions/get-block-component-options.d.ts +0 -1
- package/dist/react/cjs/functions/get-block-component-options.js +0 -29
- package/dist/react/cjs/functions/get-block-properties.d.ts +0 -1
- package/dist/react/cjs/functions/get-block-properties.js +0 -54
- package/dist/react/cjs/functions/get-builder-search-params/fn.test.js +0 -15
- package/dist/react/cjs/functions/get-builder-search-params/index.d.ts +0 -4
- package/dist/react/cjs/functions/get-builder-search-params/index.js +0 -39
- package/dist/react/cjs/functions/get-content/ab-testing.d.ts +0 -1
- package/dist/react/cjs/functions/get-content/ab-testing.js +0 -89
- package/dist/react/cjs/functions/get-content/generate-content-url.d.ts +0 -1
- package/dist/react/cjs/functions/get-content/generate-content-url.js +0 -48
- package/dist/react/cjs/functions/get-content/generate-content-url.test.js +0 -84
- package/dist/react/cjs/functions/get-content/index.cjs +0 -88
- package/dist/react/cjs/functions/get-content/index.d.ts +0 -2
- package/dist/react/cjs/functions/get-content/index.js +0 -88
- package/dist/react/cjs/functions/get-content/types.d.ts +0 -0
- package/dist/react/cjs/functions/get-content/types.js +0 -1
- package/dist/react/cjs/functions/get-fetch.d.ts +0 -1
- package/dist/react/cjs/functions/get-fetch.js +0 -15
- package/dist/react/cjs/functions/get-global-this.d.ts +0 -1
- package/dist/react/cjs/functions/get-global-this.js +0 -19
- package/dist/react/cjs/functions/get-processed-block.d.ts +0 -6
- package/dist/react/cjs/functions/get-processed-block.js +0 -52
- package/dist/react/cjs/functions/get-processed-block.test.js +0 -34
- package/dist/react/cjs/functions/get-react-native-block-styles.d.ts +0 -5
- package/dist/react/cjs/functions/get-react-native-block-styles.js +0 -30
- package/dist/react/cjs/functions/if-target.d.ts +0 -5
- package/dist/react/cjs/functions/if-target.js +0 -13
- package/dist/react/cjs/functions/is-browser.d.ts +0 -1
- package/dist/react/cjs/functions/is-browser.js +0 -7
- package/dist/react/cjs/functions/is-editing.d.ts +0 -1
- package/dist/react/cjs/functions/is-editing.js +0 -9
- package/dist/react/cjs/functions/is-iframe.d.ts +0 -1
- package/dist/react/cjs/functions/is-iframe.js +0 -8
- package/dist/react/cjs/functions/is-previewing.d.ts +0 -1
- package/dist/react/cjs/functions/is-previewing.js +0 -15
- package/dist/react/cjs/functions/on-change.d.ts +0 -2
- package/dist/react/cjs/functions/on-change.js +0 -28
- package/dist/react/cjs/functions/on-change.test.js +0 -21
- package/dist/react/cjs/functions/register-component.d.ts +0 -6
- package/dist/react/cjs/functions/register-component.js +0 -65
- package/dist/react/cjs/functions/register.d.ts +0 -1
- package/dist/react/cjs/functions/register.js +0 -31
- package/dist/react/cjs/functions/sanitize-react-native-block-styles.d.ts +0 -1
- package/dist/react/cjs/functions/sanitize-react-native-block-styles.js +0 -71
- package/dist/react/cjs/functions/set-editor-settings.d.ts +0 -1
- package/dist/react/cjs/functions/set-editor-settings.js +0 -16
- package/dist/react/cjs/functions/set.d.ts +0 -1
- package/dist/react/cjs/functions/set.js +0 -12
- package/dist/react/cjs/functions/set.test.js +0 -18
- package/dist/react/cjs/functions/track/helpers.d.ts +0 -5
- package/dist/react/cjs/functions/track/helpers.js +0 -53
- package/dist/react/cjs/functions/track/index.d.ts +0 -2
- package/dist/react/cjs/functions/track/index.js +0 -125
- package/dist/react/cjs/functions/track/interaction.d.ts +0 -14
- package/dist/react/cjs/functions/track/interaction.js +0 -51
- package/dist/react/cjs/functions/transform-block-properties.d.ts +0 -1
- package/dist/react/cjs/functions/transform-block-properties.js +0 -7
- package/dist/react/cjs/functions/transform-block.d.ts +0 -1
- package/dist/react/cjs/functions/transform-block.js +0 -7
- package/dist/react/cjs/helpers/ab-tests.d.ts +0 -9
- package/dist/react/cjs/helpers/ab-tests.js +0 -10
- package/dist/react/cjs/helpers/cookie.d.ts +0 -2
- package/dist/react/cjs/helpers/cookie.js +0 -74
- package/dist/react/cjs/helpers/css.d.ts +0 -7
- package/dist/react/cjs/helpers/css.js +0 -33
- package/dist/react/cjs/helpers/flatten.d.ts +0 -1
- package/dist/react/cjs/helpers/flatten.js +0 -35
- package/dist/react/cjs/helpers/localStorage.d.ts +0 -9
- package/dist/react/cjs/helpers/localStorage.js +0 -31
- package/dist/react/cjs/helpers/logger.d.ts +0 -5
- package/dist/react/cjs/helpers/logger.js +0 -10
- package/dist/react/cjs/helpers/nullable.d.ts +0 -1
- package/dist/react/cjs/helpers/nullable.js +0 -5
- package/dist/react/cjs/helpers/sessionId.d.ts +0 -6
- package/dist/react/cjs/helpers/sessionId.js +0 -51
- package/dist/react/cjs/helpers/time.d.ts +0 -1
- package/dist/react/cjs/helpers/time.js +0 -6
- package/dist/react/cjs/helpers/url.d.ts +0 -1
- package/dist/react/cjs/helpers/url.js +0 -14
- package/dist/react/cjs/helpers/url.test.js +0 -23
- package/dist/react/cjs/helpers/uuid.d.ts +0 -2
- package/dist/react/cjs/helpers/uuid.js +0 -14
- package/dist/react/cjs/helpers/visitorId.d.ts +0 -8
- package/dist/react/cjs/helpers/visitorId.js +0 -33
- package/dist/react/cjs/index-helpers/blocks-exports.d.ts +0 -11
- package/dist/react/cjs/index-helpers/blocks-exports.js +0 -23
- package/dist/react/cjs/index-helpers/top-of-file.d.ts +0 -2
- package/dist/react/cjs/index-helpers/top-of-file.js +0 -5
- package/dist/react/cjs/index.cjs +0 -28
- package/dist/react/cjs/index.d.ts +0 -11
- package/dist/react/cjs/index.js +0 -28
- package/dist/react/cjs/scripts/init-editing.d.ts +0 -2
- package/dist/react/cjs/scripts/init-editing.js +0 -97
- package/dist/react/cjs/types/api-version.d.ts +0 -1
- package/dist/react/cjs/types/api-version.js +0 -5
- package/dist/react/cjs/types/builder-block.d.ts +0 -0
- package/dist/react/cjs/types/builder-block.js +0 -1
- package/dist/react/cjs/types/builder-content.d.ts +0 -0
- package/dist/react/cjs/types/builder-content.js +0 -1
- package/dist/react/cjs/types/can-track.d.ts +0 -0
- package/dist/react/cjs/types/can-track.js +0 -1
- package/dist/react/cjs/types/components.d.ts +0 -0
- package/dist/react/cjs/types/components.js +0 -1
- package/dist/react/cjs/types/deep-partial.d.ts +0 -0
- package/dist/react/cjs/types/deep-partial.js +0 -1
- package/dist/react/cjs/types/element.d.ts +0 -0
- package/dist/react/cjs/types/element.js +0 -1
- package/dist/react/cjs/types/input.d.ts +0 -0
- package/dist/react/cjs/types/input.js +0 -1
- package/dist/react/cjs/types/targets.d.ts +0 -0
- package/dist/react/cjs/types/targets.js +0 -1
- package/dist/react/cjs/types/typescript.d.ts +0 -0
- package/dist/react/cjs/types/typescript.js +0 -1
- package/dist/react/esm/blocks/BaseText.d.ts +0 -2
- package/dist/react/esm/blocks/BaseText.js +0 -9
- package/dist/react/esm/blocks/button/button.d.ts +0 -2
- package/dist/react/esm/blocks/button/button.js +0 -13
- package/dist/react/esm/blocks/button/component-info.d.ts +0 -38
- package/dist/react/esm/blocks/button/component-info.js +0 -38
- package/dist/react/esm/blocks/columns/columns.d.ts +0 -2
- package/dist/react/esm/blocks/columns/columns.js +0 -131
- package/dist/react/esm/blocks/columns/component-info.d.ts +0 -176
- package/dist/react/esm/blocks/columns/component-info.js +0 -240
- package/dist/react/esm/blocks/custom-code/component-info.d.ts +0 -31
- package/dist/react/esm/blocks/custom-code/component-info.js +0 -28
- package/dist/react/esm/blocks/custom-code/custom-code.d.ts +0 -2
- package/dist/react/esm/blocks/embed/component-info.d.ts +0 -22
- package/dist/react/esm/blocks/embed/component-info.js +0 -43
- package/dist/react/esm/blocks/embed/embed.d.ts +0 -2
- package/dist/react/esm/blocks/embed/helpers.d.ts +0 -1
- package/dist/react/esm/blocks/embed/helpers.js +0 -7
- package/dist/react/esm/blocks/form/component-info.d.ts +0 -235
- package/dist/react/esm/blocks/form/component-info.js +0 -259
- package/dist/react/esm/blocks/form/form.d.ts +0 -2
- package/dist/react/esm/blocks/form/form.js +0 -203
- package/dist/react/esm/blocks/fragment/component-info.d.ts +0 -8
- package/dist/react/esm/blocks/fragment/component-info.js +0 -8
- package/dist/react/esm/blocks/fragment/fragment.d.ts +0 -2
- package/dist/react/esm/blocks/image/component-info.d.ts +0 -114
- package/dist/react/esm/blocks/image/component-info.js +0 -148
- package/dist/react/esm/blocks/image/image.d.ts +0 -2
- package/dist/react/esm/blocks/image/image.helpers.d.ts +0 -1
- package/dist/react/esm/blocks/image/image.helpers.js +0 -46
- package/dist/react/esm/blocks/image/image.js +0 -82
- package/dist/react/esm/blocks/img/component-info.d.ts +0 -15
- package/dist/react/esm/blocks/img/component-info.js +0 -17
- package/dist/react/esm/blocks/img/img.d.ts +0 -2
- package/dist/react/esm/blocks/input/component-info.d.ts +0 -66
- package/dist/react/esm/blocks/input/component-info.js +0 -71
- package/dist/react/esm/blocks/input/input.d.ts +0 -2
- package/dist/react/esm/blocks/raw-text/component-info.d.ts +0 -10
- package/dist/react/esm/blocks/raw-text/component-info.js +0 -13
- package/dist/react/esm/blocks/raw-text/raw-text.d.ts +0 -2
- package/dist/react/esm/blocks/section/component-info.d.ts +0 -43
- package/dist/react/esm/blocks/section/component-info.js +0 -46
- package/dist/react/esm/blocks/section/section.d.ts +0 -2
- package/dist/react/esm/blocks/select/component-info.d.ts +0 -61
- package/dist/react/esm/blocks/select/component-info.js +0 -56
- package/dist/react/esm/blocks/select/select.d.ts +0 -2
- package/dist/react/esm/blocks/submit-button/component-info.d.ts +0 -23
- package/dist/react/esm/blocks/submit-button/component-info.js +0 -25
- package/dist/react/esm/blocks/submit-button/submit-button.d.ts +0 -2
- package/dist/react/esm/blocks/symbol/component-info.d.ts +0 -35
- package/dist/react/esm/blocks/symbol/component-info.js +0 -40
- package/dist/react/esm/blocks/symbol/symbol.d.ts +0 -2
- package/dist/react/esm/blocks/symbol/symbol.js +0 -71
- package/dist/react/esm/blocks/text/component-info.d.ts +0 -19
- package/dist/react/esm/blocks/text/component-info.js +0 -21
- package/dist/react/esm/blocks/text/text.d.ts +0 -2
- package/dist/react/esm/blocks/textarea/component-info.d.ts +0 -53
- package/dist/react/esm/blocks/textarea/component-info.js +0 -44
- package/dist/react/esm/blocks/textarea/textarea.d.ts +0 -2
- package/dist/react/esm/blocks/util.d.ts +0 -1
- package/dist/react/esm/blocks/util.js +0 -6
- package/dist/react/esm/blocks/video/component-info.d.ts +0 -80
- package/dist/react/esm/blocks/video/component-info.js +0 -103
- package/dist/react/esm/blocks/video/video.d.ts +0 -2
- package/dist/react/esm/blocks/video/video.js +0 -50
- package/dist/react/esm/components/render-block/block-styles.d.ts +0 -2
- package/dist/react/esm/components/render-block/render-block.d.ts +0 -2
- package/dist/react/esm/components/render-block/render-block.helpers.d.ts +0 -13
- package/dist/react/esm/components/render-block/render-block.helpers.js +0 -119
- package/dist/react/esm/components/render-block/render-block.js +0 -132
- package/dist/react/esm/components/render-block/render-component.d.ts +0 -2
- package/dist/react/esm/components/render-block/render-repeated-block.d.ts +0 -2
- package/dist/react/esm/components/render-block/render-repeated-block.js +0 -18
- package/dist/react/esm/components/render-block/types.d.ts +0 -0
- package/dist/react/esm/components/render-block/types.js +0 -1
- package/dist/react/esm/components/render-blocks.d.ts +0 -2
- package/dist/react/esm/components/render-blocks.js +0 -47
- package/dist/react/esm/components/render-content/builder-editing.d.ts +0 -2
- package/dist/react/esm/components/render-content/components/render-styles.d.ts +0 -2
- package/dist/react/esm/components/render-content/components/render-styles.helpers.d.ts +0 -7
- package/dist/react/esm/components/render-content/components/render-styles.helpers.js +0 -51
- package/dist/react/esm/components/render-content/components/render-styles.js +0 -32
- package/dist/react/esm/components/render-content/index.d.ts +0 -2
- package/dist/react/esm/components/render-content/index.js +0 -2
- package/dist/react/esm/components/render-content/render-content.d.ts +0 -2
- package/dist/react/esm/components/render-content/render-content.helpers.d.ts +0 -9
- package/dist/react/esm/components/render-content/render-content.helpers.js +0 -38
- package/dist/react/esm/components/render-content/render-content.js +0 -295
- package/dist/react/esm/components/render-content/render-content.types.d.ts +0 -0
- package/dist/react/esm/components/render-content/render-content.types.js +0 -1
- package/dist/react/esm/components/render-inlined-styles.d.ts +0 -2
- package/dist/react/esm/components/render-inlined-styles.js +0 -17
- package/dist/react/esm/constants/builder-registered-components.d.ts +0 -1
- package/dist/react/esm/constants/builder-registered-components.js +0 -52
- package/dist/react/esm/constants/device-sizes.d.ts +0 -21
- package/dist/react/esm/constants/device-sizes.js +0 -45
- package/dist/react/esm/constants/target.d.ts +0 -1
- package/dist/react/esm/constants/target.js +0 -2
- package/dist/react/esm/context/builder.context.d.ts +0 -11
- package/dist/react/esm/context/builder.context.js +0 -13
- package/dist/react/esm/context/types.d.ts +0 -0
- package/dist/react/esm/context/types.js +0 -1
- package/dist/react/esm/functions/camel-to-kebab-case.d.ts +0 -1
- package/dist/react/esm/functions/camel-to-kebab-case.js +0 -2
- package/dist/react/esm/functions/evaluate.d.ts +0 -7
- package/dist/react/esm/functions/evaluate.js +0 -22
- package/dist/react/esm/functions/event-handler-name.d.ts +0 -1
- package/dist/react/esm/functions/event-handler-name.js +0 -5
- package/dist/react/esm/functions/extract-text-styles.d.ts +0 -1
- package/dist/react/esm/functions/extract-text-styles.js +0 -20
- package/dist/react/esm/functions/fast-clone.d.ts +0 -1
- package/dist/react/esm/functions/fast-clone.js +0 -2
- package/dist/react/esm/functions/get-block-actions-handler.d.ts +0 -1
- package/dist/react/esm/functions/get-block-actions-handler.js +0 -9
- package/dist/react/esm/functions/get-block-actions.d.ts +0 -1
- package/dist/react/esm/functions/get-block-actions.js +0 -16
- package/dist/react/esm/functions/get-block-component-options.d.ts +0 -1
- package/dist/react/esm/functions/get-block-component-options.js +0 -26
- package/dist/react/esm/functions/get-block-properties.d.ts +0 -1
- package/dist/react/esm/functions/get-block-properties.js +0 -51
- package/dist/react/esm/functions/get-builder-search-params/fn.test.js +0 -13
- package/dist/react/esm/functions/get-builder-search-params/index.d.ts +0 -4
- package/dist/react/esm/functions/get-builder-search-params/index.js +0 -33
- package/dist/react/esm/functions/get-content/ab-testing.d.ts +0 -1
- package/dist/react/esm/functions/get-content/ab-testing.js +0 -86
- package/dist/react/esm/functions/get-content/generate-content-url.d.ts +0 -1
- package/dist/react/esm/functions/get-content/generate-content-url.js +0 -45
- package/dist/react/esm/functions/get-content/generate-content-url.test.js +0 -82
- package/dist/react/esm/functions/get-content/index.d.ts +0 -2
- package/dist/react/esm/functions/get-content/index.js +0 -84
- package/dist/react/esm/functions/get-content/types.d.ts +0 -0
- package/dist/react/esm/functions/get-content/types.js +0 -1
- package/dist/react/esm/functions/get-fetch.d.ts +0 -1
- package/dist/react/esm/functions/get-fetch.js +0 -12
- package/dist/react/esm/functions/get-global-this.d.ts +0 -1
- package/dist/react/esm/functions/get-global-this.js +0 -16
- package/dist/react/esm/functions/get-processed-block.d.ts +0 -6
- package/dist/react/esm/functions/get-processed-block.js +0 -49
- package/dist/react/esm/functions/get-processed-block.test.js +0 -32
- package/dist/react/esm/functions/get-react-native-block-styles.d.ts +0 -5
- package/dist/react/esm/functions/get-react-native-block-styles.js +0 -27
- package/dist/react/esm/functions/if-target.d.ts +0 -5
- package/dist/react/esm/functions/if-target.js +0 -10
- package/dist/react/esm/functions/is-browser.d.ts +0 -1
- package/dist/react/esm/functions/is-browser.js +0 -4
- package/dist/react/esm/functions/is-editing.d.ts +0 -1
- package/dist/react/esm/functions/is-editing.js +0 -6
- package/dist/react/esm/functions/is-iframe.d.ts +0 -1
- package/dist/react/esm/functions/is-iframe.js +0 -5
- package/dist/react/esm/functions/is-previewing.d.ts +0 -1
- package/dist/react/esm/functions/is-previewing.js +0 -12
- package/dist/react/esm/functions/on-change.d.ts +0 -2
- package/dist/react/esm/functions/on-change.js +0 -24
- package/dist/react/esm/functions/on-change.test.js +0 -19
- package/dist/react/esm/functions/register-component.d.ts +0 -6
- package/dist/react/esm/functions/register-component.js +0 -60
- package/dist/react/esm/functions/register.d.ts +0 -1
- package/dist/react/esm/functions/register.js +0 -28
- package/dist/react/esm/functions/sanitize-react-native-block-styles.d.ts +0 -1
- package/dist/react/esm/functions/sanitize-react-native-block-styles.js +0 -68
- package/dist/react/esm/functions/set-editor-settings.d.ts +0 -1
- package/dist/react/esm/functions/set-editor-settings.js +0 -13
- package/dist/react/esm/functions/set.d.ts +0 -1
- package/dist/react/esm/functions/set.js +0 -9
- package/dist/react/esm/functions/set.test.js +0 -16
- package/dist/react/esm/functions/track/helpers.d.ts +0 -5
- package/dist/react/esm/functions/track/helpers.js +0 -50
- package/dist/react/esm/functions/track/index.d.ts +0 -2
- package/dist/react/esm/functions/track/index.js +0 -121
- package/dist/react/esm/functions/track/interaction.d.ts +0 -14
- package/dist/react/esm/functions/track/interaction.js +0 -48
- package/dist/react/esm/functions/transform-block-properties.d.ts +0 -1
- package/dist/react/esm/functions/transform-block-properties.js +0 -4
- package/dist/react/esm/functions/transform-block.d.ts +0 -1
- package/dist/react/esm/functions/transform-block.js +0 -4
- package/dist/react/esm/helpers/ab-tests.d.ts +0 -9
- package/dist/react/esm/helpers/ab-tests.js +0 -6
- package/dist/react/esm/helpers/cookie.d.ts +0 -2
- package/dist/react/esm/helpers/cookie.js +0 -70
- package/dist/react/esm/helpers/css.d.ts +0 -7
- package/dist/react/esm/helpers/css.js +0 -28
- package/dist/react/esm/helpers/flatten.d.ts +0 -1
- package/dist/react/esm/helpers/flatten.js +0 -32
- package/dist/react/esm/helpers/localStorage.d.ts +0 -9
- package/dist/react/esm/helpers/localStorage.js +0 -27
- package/dist/react/esm/helpers/logger.d.ts +0 -5
- package/dist/react/esm/helpers/logger.js +0 -7
- package/dist/react/esm/helpers/nullable.d.ts +0 -1
- package/dist/react/esm/helpers/nullable.js +0 -2
- package/dist/react/esm/helpers/sessionId.d.ts +0 -6
- package/dist/react/esm/helpers/sessionId.js +0 -46
- package/dist/react/esm/helpers/time.d.ts +0 -1
- package/dist/react/esm/helpers/time.js +0 -3
- package/dist/react/esm/helpers/url.d.ts +0 -1
- package/dist/react/esm/helpers/url.js +0 -11
- package/dist/react/esm/helpers/url.test.js +0 -21
- package/dist/react/esm/helpers/uuid.d.ts +0 -2
- package/dist/react/esm/helpers/uuid.js +0 -10
- package/dist/react/esm/helpers/visitorId.d.ts +0 -8
- package/dist/react/esm/helpers/visitorId.js +0 -28
- package/dist/react/esm/index-helpers/blocks-exports.d.ts +0 -11
- package/dist/react/esm/index-helpers/blocks-exports.js +0 -11
- package/dist/react/esm/index-helpers/top-of-file.d.ts +0 -2
- package/dist/react/esm/index-helpers/top-of-file.js +0 -2
- package/dist/react/esm/index.d.ts +0 -11
- package/dist/react/esm/index.js +0 -11
- package/dist/react/esm/scripts/init-editing.d.ts +0 -2
- package/dist/react/esm/scripts/init-editing.js +0 -93
- package/dist/react/esm/types/api-version.d.ts +0 -1
- package/dist/react/esm/types/api-version.js +0 -2
- package/dist/react/esm/types/builder-block.d.ts +0 -0
- package/dist/react/esm/types/builder-block.js +0 -1
- package/dist/react/esm/types/builder-content.d.ts +0 -0
- package/dist/react/esm/types/builder-content.js +0 -1
- package/dist/react/esm/types/can-track.d.ts +0 -0
- package/dist/react/esm/types/can-track.js +0 -1
- package/dist/react/esm/types/components.d.ts +0 -0
- package/dist/react/esm/types/components.js +0 -1
- package/dist/react/esm/types/deep-partial.d.ts +0 -0
- package/dist/react/esm/types/deep-partial.js +0 -1
- package/dist/react/esm/types/element.d.ts +0 -0
- package/dist/react/esm/types/element.js +0 -1
- package/dist/react/esm/types/input.d.ts +0 -0
- package/dist/react/esm/types/input.js +0 -1
- package/dist/react/esm/types/targets.d.ts +0 -0
- package/dist/react/esm/types/targets.js +0 -1
- package/dist/react/esm/types/typescript.d.ts +0 -0
- package/dist/react/esm/types/typescript.js +0 -1
- package/dist/rsc/blocks/BaseText.d.ts +0 -2
- package/dist/rsc/blocks/BaseText.js +0 -8
- package/dist/rsc/blocks/button/button.d.ts +0 -2
- package/dist/rsc/blocks/button/button.js +0 -13
- package/dist/rsc/blocks/button/component-info.d.ts +0 -38
- package/dist/rsc/blocks/button/component-info.js +0 -38
- package/dist/rsc/blocks/columns/columns.d.ts +0 -2
- package/dist/rsc/blocks/columns/columns.js +0 -132
- package/dist/rsc/blocks/columns/component-info.d.ts +0 -176
- package/dist/rsc/blocks/columns/component-info.js +0 -240
- package/dist/rsc/blocks/custom-code/component-info.d.ts +0 -31
- package/dist/rsc/blocks/custom-code/component-info.js +0 -28
- package/dist/rsc/blocks/custom-code/custom-code.d.ts +0 -2
- package/dist/rsc/blocks/custom-code/custom-code.js +0 -46
- package/dist/rsc/blocks/embed/component-info.d.ts +0 -22
- package/dist/rsc/blocks/embed/component-info.js +0 -43
- package/dist/rsc/blocks/embed/embed.d.ts +0 -2
- package/dist/rsc/blocks/embed/embed.js +0 -37
- package/dist/rsc/blocks/embed/helpers.d.ts +0 -1
- package/dist/rsc/blocks/embed/helpers.js +0 -7
- package/dist/rsc/blocks/form/component-info.d.ts +0 -235
- package/dist/rsc/blocks/form/component-info.js +0 -259
- package/dist/rsc/blocks/form/form.d.ts +0 -2
- package/dist/rsc/blocks/form/form.js +0 -205
- package/dist/rsc/blocks/fragment/component-info.d.ts +0 -8
- package/dist/rsc/blocks/fragment/component-info.js +0 -8
- package/dist/rsc/blocks/fragment/fragment.d.ts +0 -2
- package/dist/rsc/blocks/fragment/fragment.js +0 -6
- package/dist/rsc/blocks/image/component-info.d.ts +0 -114
- package/dist/rsc/blocks/image/component-info.js +0 -148
- package/dist/rsc/blocks/image/image.d.ts +0 -2
- package/dist/rsc/blocks/image/image.helpers.d.ts +0 -1
- package/dist/rsc/blocks/image/image.helpers.js +0 -46
- package/dist/rsc/blocks/image/image.js +0 -84
- package/dist/rsc/blocks/img/component-info.d.ts +0 -15
- package/dist/rsc/blocks/img/component-info.js +0 -17
- package/dist/rsc/blocks/img/img.d.ts +0 -2
- package/dist/rsc/blocks/img/img.js +0 -10
- package/dist/rsc/blocks/input/component-info.d.ts +0 -66
- package/dist/rsc/blocks/input/component-info.js +0 -71
- package/dist/rsc/blocks/input/input.d.ts +0 -2
- package/dist/rsc/blocks/input/input.js +0 -7
- package/dist/rsc/blocks/raw-text/component-info.d.ts +0 -10
- package/dist/rsc/blocks/raw-text/component-info.js +0 -13
- package/dist/rsc/blocks/raw-text/raw-text.d.ts +0 -2
- package/dist/rsc/blocks/raw-text/raw-text.js +0 -6
- package/dist/rsc/blocks/section/component-info.d.ts +0 -43
- package/dist/rsc/blocks/section/component-info.js +0 -46
- package/dist/rsc/blocks/section/section.d.ts +0 -2
- package/dist/rsc/blocks/section/section.js +0 -17
- package/dist/rsc/blocks/select/component-info.d.ts +0 -61
- package/dist/rsc/blocks/select/component-info.js +0 -56
- package/dist/rsc/blocks/select/select.d.ts +0 -2
- package/dist/rsc/blocks/select/select.js +0 -7
- package/dist/rsc/blocks/submit-button/component-info.d.ts +0 -23
- package/dist/rsc/blocks/submit-button/component-info.js +0 -25
- package/dist/rsc/blocks/submit-button/submit-button.d.ts +0 -2
- package/dist/rsc/blocks/submit-button/submit-button.js +0 -6
- package/dist/rsc/blocks/symbol/component-info.d.ts +0 -35
- package/dist/rsc/blocks/symbol/component-info.js +0 -40
- package/dist/rsc/blocks/symbol/symbol.d.ts +0 -2
- package/dist/rsc/blocks/symbol/symbol.js +0 -66
- package/dist/rsc/blocks/text/component-info.d.ts +0 -19
- package/dist/rsc/blocks/text/component-info.js +0 -21
- package/dist/rsc/blocks/text/text.d.ts +0 -2
- package/dist/rsc/blocks/text/text.js +0 -8
- package/dist/rsc/blocks/textarea/component-info.d.ts +0 -53
- package/dist/rsc/blocks/textarea/component-info.js +0 -44
- package/dist/rsc/blocks/textarea/textarea.d.ts +0 -2
- package/dist/rsc/blocks/textarea/textarea.js +0 -6
- package/dist/rsc/blocks/util.d.ts +0 -1
- package/dist/rsc/blocks/util.js +0 -6
- package/dist/rsc/blocks/video/component-info.d.ts +0 -80
- package/dist/rsc/blocks/video/component-info.js +0 -103
- package/dist/rsc/blocks/video/video.d.ts +0 -2
- package/dist/rsc/blocks/video/video.js +0 -52
- package/dist/rsc/components/render-block/block-styles.d.ts +0 -2
- package/dist/rsc/components/render-block/block-styles.js +0 -66
- package/dist/rsc/components/render-block/render-block.d.ts +0 -2
- package/dist/rsc/components/render-block/render-block.helpers.d.ts +0 -10
- package/dist/rsc/components/render-block/render-block.helpers.js +0 -119
- package/dist/rsc/components/render-block/render-block.js +0 -135
- package/dist/rsc/components/render-block/render-component-with-context.js +0 -27
- package/dist/rsc/components/render-block/render-component.d.ts +0 -2
- package/dist/rsc/components/render-block/render-component.js +0 -12
- package/dist/rsc/components/render-block/render-repeated-block.d.ts +0 -2
- package/dist/rsc/components/render-block/render-repeated-block.js +0 -17
- package/dist/rsc/components/render-block/types.d.ts +0 -0
- package/dist/rsc/components/render-block/types.js +0 -1
- package/dist/rsc/components/render-blocks.d.ts +0 -2
- package/dist/rsc/components/render-blocks.js +0 -48
- package/dist/rsc/components/render-content/builder-editing.d.ts +0 -27
- package/dist/rsc/components/render-content/builder-editing.js +0 -48
- package/dist/rsc/components/render-content/components/render-styles.d.ts +0 -2
- package/dist/rsc/components/render-content/components/render-styles.helpers.d.ts +0 -7
- package/dist/rsc/components/render-content/components/render-styles.helpers.js +0 -51
- package/dist/rsc/components/render-content/components/render-styles.js +0 -33
- package/dist/rsc/components/render-content/index.d.ts +0 -2
- package/dist/rsc/components/render-content/index.js +0 -2
- package/dist/rsc/components/render-content/render-content.d.ts +0 -2
- package/dist/rsc/components/render-content/render-content.helpers.d.ts +0 -9
- package/dist/rsc/components/render-content/render-content.helpers.js +0 -38
- package/dist/rsc/components/render-content/render-content.js +0 -205
- package/dist/rsc/components/render-content/render-content.types.d.ts +0 -0
- package/dist/rsc/components/render-content/render-content.types.js +0 -1
- package/dist/rsc/components/render-content-variants/helpers.js +0 -99
- package/dist/rsc/components/render-content-variants/render-content-variants.js +0 -45
- package/dist/rsc/components/render-inlined-styles.d.ts +0 -2
- package/dist/rsc/components/render-inlined-styles.js +0 -19
- package/dist/rsc/constants/builder-registered-components.d.ts +0 -1
- package/dist/rsc/constants/builder-registered-components.js +0 -52
- package/dist/rsc/constants/device-sizes.d.ts +0 -21
- package/dist/rsc/constants/device-sizes.js +0 -45
- package/dist/rsc/constants/target.d.ts +0 -1
- package/dist/rsc/constants/target.js +0 -2
- package/dist/rsc/context/builder.context.d.ts +0 -11
- package/dist/rsc/context/builder.context.js +0 -12
- package/dist/rsc/context/types.d.ts +0 -0
- package/dist/rsc/context/types.js +0 -1
- package/dist/rsc/functions/camel-to-kebab-case.d.ts +0 -1
- package/dist/rsc/functions/camel-to-kebab-case.js +0 -2
- package/dist/rsc/functions/evaluate.d.ts +0 -1
- package/dist/rsc/functions/evaluate.js +0 -4
- package/dist/rsc/functions/event-handler-name.d.ts +0 -1
- package/dist/rsc/functions/event-handler-name.js +0 -5
- package/dist/rsc/functions/extract-text-styles.d.ts +0 -1
- package/dist/rsc/functions/extract-text-styles.js +0 -20
- package/dist/rsc/functions/fast-clone.d.ts +0 -1
- package/dist/rsc/functions/fast-clone.js +0 -2
- package/dist/rsc/functions/get-block-actions-handler.d.ts +0 -1
- package/dist/rsc/functions/get-block-actions-handler.js +0 -9
- package/dist/rsc/functions/get-block-actions.d.ts +0 -1
- package/dist/rsc/functions/get-block-actions.js +0 -16
- package/dist/rsc/functions/get-block-component-options.d.ts +0 -1
- package/dist/rsc/functions/get-block-component-options.js +0 -26
- package/dist/rsc/functions/get-block-properties.d.ts +0 -1
- package/dist/rsc/functions/get-block-properties.js +0 -51
- package/dist/rsc/functions/get-block-tag.js +0 -4
- package/dist/rsc/functions/get-builder-search-params/fn.test.js +0 -13
- package/dist/rsc/functions/get-builder-search-params/index.d.ts +0 -4
- package/dist/rsc/functions/get-builder-search-params/index.js +0 -33
- package/dist/rsc/functions/get-content/ab-testing.d.ts +0 -1
- package/dist/rsc/functions/get-content/ab-testing.js +0 -86
- package/dist/rsc/functions/get-content/generate-content-url.d.ts +0 -1
- package/dist/rsc/functions/get-content/generate-content-url.js +0 -45
- package/dist/rsc/functions/get-content/generate-content-url.test.js +0 -82
- package/dist/rsc/functions/get-content/index.d.ts +0 -2
- package/dist/rsc/functions/get-content/index.js +0 -84
- package/dist/rsc/functions/get-content/types.d.ts +0 -0
- package/dist/rsc/functions/get-content/types.js +0 -1
- package/dist/rsc/functions/get-fetch.d.ts +0 -1
- package/dist/rsc/functions/get-fetch.js +0 -12
- package/dist/rsc/functions/get-global-this.d.ts +0 -1
- package/dist/rsc/functions/get-global-this.js +0 -16
- package/dist/rsc/functions/get-processed-block.d.ts +0 -6
- package/dist/rsc/functions/get-processed-block.js +0 -49
- package/dist/rsc/functions/get-processed-block.test.js +0 -32
- package/dist/rsc/functions/get-react-native-block-styles.d.ts +0 -5
- package/dist/rsc/functions/get-react-native-block-styles.js +0 -27
- package/dist/rsc/functions/if-target.d.ts +0 -5
- package/dist/rsc/functions/if-target.js +0 -10
- package/dist/rsc/functions/is-browser.d.ts +0 -1
- package/dist/rsc/functions/is-browser.js +0 -4
- package/dist/rsc/functions/is-editing.d.ts +0 -1
- package/dist/rsc/functions/is-editing.js +0 -6
- package/dist/rsc/functions/is-iframe.d.ts +0 -1
- package/dist/rsc/functions/is-iframe.js +0 -5
- package/dist/rsc/functions/is-previewing.d.ts +0 -1
- package/dist/rsc/functions/is-previewing.js +0 -12
- package/dist/rsc/functions/on-change.d.ts +0 -2
- package/dist/rsc/functions/on-change.js +0 -24
- package/dist/rsc/functions/on-change.test.js +0 -19
- package/dist/rsc/functions/register-component.d.ts +0 -6
- package/dist/rsc/functions/register-component.js +0 -60
- package/dist/rsc/functions/register.d.ts +0 -1
- package/dist/rsc/functions/register.js +0 -28
- package/dist/rsc/functions/sanitize-react-native-block-styles.d.ts +0 -1
- package/dist/rsc/functions/sanitize-react-native-block-styles.js +0 -68
- package/dist/rsc/functions/set-editor-settings.d.ts +0 -1
- package/dist/rsc/functions/set-editor-settings.js +0 -13
- package/dist/rsc/functions/set.d.ts +0 -1
- package/dist/rsc/functions/set.js +0 -9
- package/dist/rsc/functions/set.test.js +0 -16
- package/dist/rsc/functions/track/helpers.d.ts +0 -5
- package/dist/rsc/functions/track/helpers.js +0 -50
- package/dist/rsc/functions/track/index.d.ts +0 -2
- package/dist/rsc/functions/track/index.js +0 -121
- package/dist/rsc/functions/track/interaction.d.ts +0 -14
- package/dist/rsc/functions/track/interaction.js +0 -48
- package/dist/rsc/functions/track.js +0 -116
- package/dist/rsc/functions/transform-block-properties.d.ts +0 -1
- package/dist/rsc/functions/transform-block-properties.js +0 -4
- package/dist/rsc/functions/transform-block.d.ts +0 -1
- package/dist/rsc/functions/transform-block.js +0 -4
- package/dist/rsc/helpers/ab-tests.d.ts +0 -9
- package/dist/rsc/helpers/ab-tests.js +0 -6
- package/dist/rsc/helpers/cookie.d.ts +0 -2
- package/dist/rsc/helpers/cookie.js +0 -70
- package/dist/rsc/helpers/css.d.ts +0 -7
- package/dist/rsc/helpers/css.js +0 -28
- package/dist/rsc/helpers/flatten.d.ts +0 -1
- package/dist/rsc/helpers/flatten.js +0 -32
- package/dist/rsc/helpers/localStorage.d.ts +0 -9
- package/dist/rsc/helpers/localStorage.js +0 -27
- package/dist/rsc/helpers/logger.d.ts +0 -5
- package/dist/rsc/helpers/logger.js +0 -7
- package/dist/rsc/helpers/nullable.d.ts +0 -1
- package/dist/rsc/helpers/nullable.js +0 -2
- package/dist/rsc/helpers/sessionId.d.ts +0 -6
- package/dist/rsc/helpers/sessionId.js +0 -46
- package/dist/rsc/helpers/time.d.ts +0 -1
- package/dist/rsc/helpers/time.js +0 -3
- package/dist/rsc/helpers/url.d.ts +0 -1
- package/dist/rsc/helpers/url.js +0 -11
- package/dist/rsc/helpers/url.test.js +0 -21
- package/dist/rsc/helpers/uuid.d.ts +0 -2
- package/dist/rsc/helpers/uuid.js +0 -10
- package/dist/rsc/helpers/visitorId.d.ts +0 -8
- package/dist/rsc/helpers/visitorId.js +0 -28
- package/dist/rsc/index-helpers/blocks-exports.d.ts +0 -11
- package/dist/rsc/index-helpers/blocks-exports.js +0 -11
- package/dist/rsc/index-helpers/top-of-file.d.ts +0 -2
- package/dist/rsc/index-helpers/top-of-file.js +0 -2
- package/dist/rsc/index.d.ts +0 -11
- package/dist/rsc/index.js +0 -11
- package/dist/rsc/scripts/init-editing.d.ts +0 -2
- package/dist/rsc/scripts/init-editing.js +0 -93
- package/dist/rsc/types/api-version.d.ts +0 -1
- package/dist/rsc/types/api-version.js +0 -2
- package/dist/rsc/types/builder-block.d.ts +0 -0
- package/dist/rsc/types/builder-block.js +0 -1
- package/dist/rsc/types/builder-content.d.ts +0 -0
- package/dist/rsc/types/builder-content.js +0 -1
- package/dist/rsc/types/can-track.d.ts +0 -0
- package/dist/rsc/types/can-track.js +0 -1
- package/dist/rsc/types/components.d.ts +0 -0
- package/dist/rsc/types/components.js +0 -1
- package/dist/rsc/types/deep-partial.d.ts +0 -0
- package/dist/rsc/types/deep-partial.js +0 -1
- package/dist/rsc/types/element.d.ts +0 -0
- package/dist/rsc/types/element.js +0 -1
- package/dist/rsc/types/input.d.ts +0 -0
- package/dist/rsc/types/input.js +0 -1
- package/dist/rsc/types/targets.d.ts +0 -0
- package/dist/rsc/types/targets.js +0 -1
- package/dist/rsc/types/typescript.d.ts +0 -0
- package/dist/rsc/types/typescript.js +0 -1
- package/packages/react/src/blocks/BaseText.jsx +0 -12
- package/packages/react/src/blocks/button/button.jsx +0 -36
- package/packages/react/src/blocks/button/component-info.js +0 -40
- package/packages/react/src/blocks/columns/columns.jsx +0 -181
- package/packages/react/src/blocks/columns/component-info.js +0 -241
- package/packages/react/src/blocks/custom-code/component-info.js +0 -30
- package/packages/react/src/blocks/custom-code/custom-code.jsx +0 -67
- package/packages/react/src/blocks/embed/component-info.js +0 -43
- package/packages/react/src/blocks/embed/embed.jsx +0 -52
- package/packages/react/src/blocks/embed/helpers.js +0 -9
- package/packages/react/src/blocks/form/component-info.js +0 -261
- package/packages/react/src/blocks/form/form.jsx +0 -255
- package/packages/react/src/blocks/fragment/component-info.js +0 -10
- package/packages/react/src/blocks/fragment/fragment.jsx +0 -8
- package/packages/react/src/blocks/image/component-info.js +0 -150
- package/packages/react/src/blocks/image/image.helpers.js +0 -48
- package/packages/react/src/blocks/image/image.jsx +0 -121
- package/packages/react/src/blocks/img/component-info.js +0 -19
- package/packages/react/src/blocks/img/img.jsx +0 -20
- package/packages/react/src/blocks/input/component-info.js +0 -73
- package/packages/react/src/blocks/input/input.jsx +0 -22
- package/packages/react/src/blocks/raw-text/component-info.js +0 -15
- package/packages/react/src/blocks/raw-text/raw-text.jsx +0 -13
- package/packages/react/src/blocks/section/component-info.js +0 -48
- package/packages/react/src/blocks/section/section.jsx +0 -26
- package/packages/react/src/blocks/select/component-info.js +0 -58
- package/packages/react/src/blocks/select/select.jsx +0 -23
- package/packages/react/src/blocks/submit-button/component-info.js +0 -27
- package/packages/react/src/blocks/submit-button/submit-button.jsx +0 -12
- package/packages/react/src/blocks/symbol/component-info.js +0 -42
- package/packages/react/src/blocks/symbol/symbol.jsx +0 -98
- package/packages/react/src/blocks/text/component-info.js +0 -23
- package/packages/react/src/blocks/text/text.jsx +0 -16
- package/packages/react/src/blocks/textarea/component-info.js +0 -46
- package/packages/react/src/blocks/textarea/textarea.jsx +0 -16
- package/packages/react/src/blocks/util.js +0 -8
- package/packages/react/src/blocks/video/component-info.js +0 -105
- package/packages/react/src/blocks/video/video.jsx +0 -61
- package/packages/react/src/components/render-block/block-styles.jsx +0 -87
- package/packages/react/src/components/render-block/render-block.helpers.js +0 -129
- package/packages/react/src/components/render-block/render-block.jsx +0 -204
- package/packages/react/src/components/render-block/render-component.jsx +0 -36
- package/packages/react/src/components/render-block/render-repeated-block.jsx +0 -25
- package/packages/react/src/components/render-block/types.js +0 -0
- package/packages/react/src/components/render-blocks.jsx +0 -92
- package/packages/react/src/components/render-content/builder-editing.jsx +0 -8
- package/packages/react/src/components/render-content/components/render-styles.helpers.js +0 -57
- package/packages/react/src/components/render-content/components/render-styles.jsx +0 -37
- package/packages/react/src/components/render-content/index.js +0 -4
- package/packages/react/src/components/render-content/render-content.helpers.js +0 -48
- package/packages/react/src/components/render-content/render-content.jsx +0 -389
- package/packages/react/src/components/render-content/render-content.types.js +0 -0
- package/packages/react/src/components/render-inlined-styles.jsx +0 -31
- package/packages/react/src/constants/builder-registered-components.js +0 -54
- package/packages/react/src/constants/device-sizes.js +0 -48
- package/packages/react/src/constants/target.js +0 -4
- package/packages/react/src/context/builder.context.js +0 -15
- package/packages/react/src/context/types.js +0 -0
- package/packages/react/src/functions/camel-to-kebab-case.js +0 -4
- package/packages/react/src/functions/evaluate.js +0 -29
- package/packages/react/src/functions/event-handler-name.js +0 -7
- package/packages/react/src/functions/extract-text-styles.js +0 -22
- package/packages/react/src/functions/fast-clone.js +0 -4
- package/packages/react/src/functions/get-block-actions-handler.js +0 -11
- package/packages/react/src/functions/get-block-actions.js +0 -18
- package/packages/react/src/functions/get-block-component-options.js +0 -28
- package/packages/react/src/functions/get-block-properties.js +0 -53
- package/packages/react/src/functions/get-builder-search-params/fn.test.js +0 -13
- package/packages/react/src/functions/get-builder-search-params/index.js +0 -38
- package/packages/react/src/functions/get-content/ab-testing.js +0 -99
- package/packages/react/src/functions/get-content/generate-content-url.js +0 -60
- package/packages/react/src/functions/get-content/generate-content-url.test.js +0 -82
- package/packages/react/src/functions/get-content/index.js +0 -83
- package/packages/react/src/functions/get-content/types.js +0 -0
- package/packages/react/src/functions/get-fetch.js +0 -14
- package/packages/react/src/functions/get-global-this.js +0 -18
- package/packages/react/src/functions/get-processed-block.js +0 -59
- package/packages/react/src/functions/get-processed-block.test.js +0 -32
- package/packages/react/src/functions/get-react-native-block-styles.js +0 -33
- package/packages/react/src/functions/if-target.js +0 -15
- package/packages/react/src/functions/is-browser.js +0 -6
- package/packages/react/src/functions/is-editing.js +0 -8
- package/packages/react/src/functions/is-iframe.js +0 -7
- package/packages/react/src/functions/is-previewing.js +0 -14
- package/packages/react/src/functions/on-change.js +0 -27
- package/packages/react/src/functions/on-change.test.js +0 -19
- package/packages/react/src/functions/register-component.js +0 -68
- package/packages/react/src/functions/register.js +0 -29
- package/packages/react/src/functions/sanitize-react-native-block-styles.js +0 -66
- package/packages/react/src/functions/set-editor-settings.js +0 -15
- package/packages/react/src/functions/set.js +0 -11
- package/packages/react/src/functions/set.test.js +0 -16
- package/packages/react/src/functions/track/helpers.js +0 -50
- package/packages/react/src/functions/track/index.js +0 -129
- package/packages/react/src/functions/track/interaction.js +0 -53
- package/packages/react/src/functions/transform-block-properties.js +0 -6
- package/packages/react/src/functions/transform-block.js +0 -6
- package/packages/react/src/helpers/ab-tests.js +0 -16
- package/packages/react/src/helpers/cookie.js +0 -81
- package/packages/react/src/helpers/css.js +0 -34
- package/packages/react/src/helpers/flatten.js +0 -34
- package/packages/react/src/helpers/localStorage.js +0 -35
- package/packages/react/src/helpers/logger.js +0 -9
- package/packages/react/src/helpers/nullable.js +0 -4
- package/packages/react/src/helpers/sessionId.js +0 -52
- package/packages/react/src/helpers/time.js +0 -5
- package/packages/react/src/helpers/url.js +0 -13
- package/packages/react/src/helpers/url.test.js +0 -21
- package/packages/react/src/helpers/uuid.js +0 -13
- package/packages/react/src/helpers/visitorId.js +0 -34
- package/packages/react/src/index-helpers/blocks-exports.js +0 -22
- package/packages/react/src/index-helpers/top-of-file.js +0 -4
- package/packages/react/src/index.js +0 -13
- package/packages/react/src/scripts/init-editing.js +0 -93
- package/packages/react/src/types/api-version.js +0 -4
- 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/input.js +0 -0
- package/packages/react/src/types/targets.js +0 -0
- package/packages/react/src/types/typescript.js +0 -0
- package/tsconfig.base.json +0 -23
- package/tsconfig.react-cjs.json +0 -10
- package/tsconfig.react-esm.json +0 -10
- package/tsconfig.rsc.json +0 -7
- /package/dist/{react/esm → sdk}/blocks/custom-code/custom-code.js +0 -0
- /package/dist/{react/esm → sdk}/blocks/embed/embed.js +0 -0
- /package/dist/{react/esm → sdk}/blocks/fragment/fragment.js +0 -0
- /package/dist/{react/esm → sdk}/blocks/img/img.js +0 -0
- /package/dist/{react/esm → sdk}/blocks/input/input.js +0 -0
- /package/dist/{react/esm → sdk}/blocks/raw-text/raw-text.js +0 -0
- /package/dist/{react/esm → sdk}/blocks/section/section.js +0 -0
- /package/dist/{react/esm → sdk}/blocks/select/select.js +0 -0
- /package/dist/{react/esm → sdk}/blocks/submit-button/submit-button.js +0 -0
- /package/dist/{react/esm → sdk}/blocks/text/text.js +0 -0
- /package/dist/{react/esm → sdk}/blocks/textarea/textarea.js +0 -0
- /package/dist/{react/esm → sdk}/components/render-block/block-styles.js +0 -0
- /package/dist/{react/esm → sdk}/components/render-block/render-component.js +0 -0
- /package/dist/{react/cjs/functions/get-builder-search-params/fn.test.d.ts → sdk/components/render-block/types.js} +0 -0
- /package/dist/{react/esm → sdk}/components/render-content/builder-editing.js +0 -0
- /package/dist/{react/cjs/functions/get-content/generate-content-url.test.d.ts → sdk/components/render-content/render-content.types.js} +0 -0
- /package/dist/{react/cjs/functions/get-processed-block.test.d.ts → sdk/context/types.js} +0 -0
- /package/dist/{react/esm → sdk}/functions/get-builder-search-params/fn.test.d.ts +0 -0
- /package/dist/{react/esm → sdk}/functions/get-content/generate-content-url.test.d.ts +0 -0
- /package/dist/{react/cjs/functions/on-change.test.d.ts → sdk/functions/get-content/types.js} +0 -0
- /package/dist/{react/esm → sdk}/functions/get-processed-block.test.d.ts +0 -0
- /package/dist/{react/esm → sdk}/functions/on-change.test.d.ts +0 -0
- /package/dist/{react/cjs → sdk}/functions/set.test.d.ts +0 -0
- /package/dist/{react/cjs → sdk}/helpers/url.test.d.ts +0 -0
- /package/dist/{react/esm/functions/set.test.d.ts → sdk/types/builder-block.js} +0 -0
- /package/dist/{react/esm/helpers/url.test.d.ts → sdk/types/builder-content.js} +0 -0
- /package/dist/{rsc/functions/get-builder-search-params/fn.test.d.ts → sdk/types/can-track.js} +0 -0
- /package/dist/{rsc/functions/get-content/generate-content-url.test.d.ts → sdk/types/components.js} +0 -0
- /package/dist/{rsc/functions/get-processed-block.test.d.ts → sdk/types/deep-partial.js} +0 -0
- /package/dist/{rsc/functions/on-change.test.d.ts → sdk/types/element.js} +0 -0
- /package/dist/{rsc/functions/set.test.d.ts → sdk/types/input.js} +0 -0
- /package/dist/{rsc/helpers/url.test.d.ts → sdk/types/targets.js} +0 -0
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
function round(num: number) {
|
|
2
|
+
return Math.round(num * 1000) / 1000;
|
|
3
|
+
}
|
|
4
|
+
const findParentElement = (
|
|
5
|
+
target: HTMLElement,
|
|
6
|
+
callback: (element: HTMLElement) => boolean,
|
|
7
|
+
checkElement = true
|
|
8
|
+
): HTMLElement | null => {
|
|
9
|
+
if (!(target instanceof HTMLElement)) {
|
|
10
|
+
return null;
|
|
11
|
+
}
|
|
12
|
+
let parent: HTMLElement | null = checkElement ? target : target.parentElement;
|
|
13
|
+
do {
|
|
14
|
+
if (!parent) {
|
|
15
|
+
return null;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const matches = callback(parent);
|
|
19
|
+
if (matches) {
|
|
20
|
+
return parent;
|
|
21
|
+
}
|
|
22
|
+
} while ((parent = parent.parentElement));
|
|
23
|
+
|
|
24
|
+
return null;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
const findBuilderParent = (target: HTMLElement) =>
|
|
28
|
+
findParentElement(target, (el) => {
|
|
29
|
+
const id = el.getAttribute('builder-id') || el.id;
|
|
30
|
+
return Boolean(id?.indexOf('builder-') === 0);
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
type Offset = {
|
|
34
|
+
x: number;
|
|
35
|
+
y: number;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
const computeOffset = ({
|
|
39
|
+
event,
|
|
40
|
+
target,
|
|
41
|
+
}: {
|
|
42
|
+
event: MouseEvent;
|
|
43
|
+
target: HTMLElement;
|
|
44
|
+
}): Offset => {
|
|
45
|
+
const targetRect = target.getBoundingClientRect();
|
|
46
|
+
const xOffset = event.clientX - targetRect.left;
|
|
47
|
+
const yOffset = event.clientY - targetRect.top;
|
|
48
|
+
|
|
49
|
+
const xRatio = round(xOffset / targetRect.width);
|
|
50
|
+
const yRatio = round(yOffset / targetRect.height);
|
|
51
|
+
|
|
52
|
+
return {
|
|
53
|
+
x: xRatio,
|
|
54
|
+
y: yRatio,
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
export const getInteractionPropertiesForEvent = (event: MouseEvent) => {
|
|
59
|
+
const target = event.target as HTMLElement | null;
|
|
60
|
+
const targetBuilderElement = target && findBuilderParent(target);
|
|
61
|
+
const builderId =
|
|
62
|
+
targetBuilderElement?.getAttribute('builder-id') ||
|
|
63
|
+
targetBuilderElement?.id;
|
|
64
|
+
|
|
65
|
+
return {
|
|
66
|
+
targetBuilderElement: builderId || undefined,
|
|
67
|
+
metadata: {
|
|
68
|
+
targetOffset: target ? computeOffset({ event, target }) : undefined,
|
|
69
|
+
builderTargetOffset: targetBuilderElement
|
|
70
|
+
? computeOffset({ event, target: targetBuilderElement })
|
|
71
|
+
: undefined,
|
|
72
|
+
builderElementIndex:
|
|
73
|
+
targetBuilderElement && builderId
|
|
74
|
+
? ([] as Element[]).slice
|
|
75
|
+
.call(document.getElementsByClassName(builderId))
|
|
76
|
+
.indexOf(targetBuilderElement)
|
|
77
|
+
: undefined,
|
|
78
|
+
},
|
|
79
|
+
};
|
|
80
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { CanTrack } from '../types/can-track.js';
|
|
2
|
+
import { getCookie, setCookie } from './cookie.js';
|
|
3
|
+
|
|
4
|
+
const BUILDER_STORE_PREFIX = 'builderio.variations';
|
|
5
|
+
|
|
6
|
+
const getContentTestKey = (id: string) => `${BUILDER_STORE_PREFIX}.${id}`;
|
|
7
|
+
|
|
8
|
+
export const getContentVariationCookie = ({
|
|
9
|
+
contentId,
|
|
10
|
+
canTrack,
|
|
11
|
+
}: { contentId: string } & CanTrack) =>
|
|
12
|
+
getCookie({ name: getContentTestKey(contentId), canTrack });
|
|
13
|
+
|
|
14
|
+
export const setContentVariationCookie = ({
|
|
15
|
+
contentId,
|
|
16
|
+
canTrack,
|
|
17
|
+
value,
|
|
18
|
+
}: {
|
|
19
|
+
contentId: string;
|
|
20
|
+
value: string;
|
|
21
|
+
} & CanTrack) =>
|
|
22
|
+
setCookie({ name: getContentTestKey(contentId), value, canTrack });
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { isBrowser } from '../functions/is-browser.js';
|
|
2
|
+
import type { CanTrack } from '../types/can-track.js';
|
|
3
|
+
import { checkIsDefined } from './nullable.js';
|
|
4
|
+
import { getTopLevelDomain } from './url.js';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* NOTE: This function is `async` because its react-native override is async. Do not remove the `async` keyword!
|
|
8
|
+
*/
|
|
9
|
+
export const getCookie = async ({
|
|
10
|
+
name,
|
|
11
|
+
canTrack,
|
|
12
|
+
}: {
|
|
13
|
+
name: string;
|
|
14
|
+
} & CanTrack): Promise<string | undefined> => {
|
|
15
|
+
try {
|
|
16
|
+
if (!canTrack) {
|
|
17
|
+
return undefined;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Extracted from MDN docs
|
|
22
|
+
* https://developer.mozilla.org/en-US/docs/Web/API/Document/cookie#example_2_get_a_sample_cookie_named_test2
|
|
23
|
+
*/
|
|
24
|
+
return document.cookie
|
|
25
|
+
.split('; ')
|
|
26
|
+
.find((row) => row.startsWith(`${name}=`))
|
|
27
|
+
?.split('=')[1];
|
|
28
|
+
} catch (err) {
|
|
29
|
+
console.debug('[COOKIE] GET error: ', err);
|
|
30
|
+
return undefined;
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
type CookieConfiguration = Array<
|
|
35
|
+
| ['expires', string]
|
|
36
|
+
| ['path', '/']
|
|
37
|
+
| ['domain', string]
|
|
38
|
+
| ['secure', '']
|
|
39
|
+
| ['SameSite', 'None']
|
|
40
|
+
| [string, string]
|
|
41
|
+
| []
|
|
42
|
+
>;
|
|
43
|
+
|
|
44
|
+
const stringifyCookie = (cookie: CookieConfiguration): string =>
|
|
45
|
+
cookie
|
|
46
|
+
.map(([key, value]) => (value ? `${key}=${value}` : key))
|
|
47
|
+
.filter(checkIsDefined)
|
|
48
|
+
.join('; ');
|
|
49
|
+
|
|
50
|
+
const SECURE_CONFIG: CookieConfiguration = [
|
|
51
|
+
['secure', ''],
|
|
52
|
+
['SameSite', 'None'],
|
|
53
|
+
];
|
|
54
|
+
|
|
55
|
+
const createCookieString = ({
|
|
56
|
+
name,
|
|
57
|
+
value,
|
|
58
|
+
expires,
|
|
59
|
+
}: {
|
|
60
|
+
name: string;
|
|
61
|
+
value: string;
|
|
62
|
+
expires?: Date;
|
|
63
|
+
}) => {
|
|
64
|
+
const secure = isBrowser() ? location.protocol === 'https:' : true;
|
|
65
|
+
|
|
66
|
+
const secureObj: CookieConfiguration = secure ? SECURE_CONFIG : [[]];
|
|
67
|
+
|
|
68
|
+
// TODO: need to know if secure server side
|
|
69
|
+
const expiresObj: CookieConfiguration = expires
|
|
70
|
+
? [['expires', expires.toUTCString()]]
|
|
71
|
+
: [[]];
|
|
72
|
+
|
|
73
|
+
const cookieValue: CookieConfiguration = [
|
|
74
|
+
[name, value],
|
|
75
|
+
...expiresObj,
|
|
76
|
+
['path', '/'],
|
|
77
|
+
['domain', getTopLevelDomain(window.location.hostname)],
|
|
78
|
+
...secureObj,
|
|
79
|
+
];
|
|
80
|
+
const cookie = stringifyCookie(cookieValue);
|
|
81
|
+
|
|
82
|
+
return cookie;
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* NOTE: This function is `async` because its react-native override is async. Do not remove the `async` keyword!
|
|
87
|
+
*/
|
|
88
|
+
export const setCookie = async ({
|
|
89
|
+
name,
|
|
90
|
+
value,
|
|
91
|
+
expires,
|
|
92
|
+
canTrack,
|
|
93
|
+
}: {
|
|
94
|
+
name: string;
|
|
95
|
+
value: string;
|
|
96
|
+
expires?: Date;
|
|
97
|
+
} & CanTrack): Promise<void> => {
|
|
98
|
+
try {
|
|
99
|
+
if (!canTrack) {
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
const cookie = createCookieString({ name, value, expires });
|
|
103
|
+
document.cookie = cookie;
|
|
104
|
+
} catch (err) {
|
|
105
|
+
console.warn('[COOKIE] SET error: ', err);
|
|
106
|
+
}
|
|
107
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { camelToKebabCase } from '../functions/camel-to-kebab-case.js';
|
|
2
|
+
import { checkIsDefined } from './nullable.js';
|
|
3
|
+
|
|
4
|
+
export const convertStyleMapToCSSArray = (
|
|
5
|
+
style: Partial<CSSStyleDeclaration>
|
|
6
|
+
): string[] => {
|
|
7
|
+
const cssProps = Object.entries(style).map(([key, value]) => {
|
|
8
|
+
if (typeof value === 'string') {
|
|
9
|
+
return `${camelToKebabCase(key)}: ${value};`;
|
|
10
|
+
} else {
|
|
11
|
+
return undefined;
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
return cssProps.filter(checkIsDefined);
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export const convertStyleMapToCSS = (
|
|
19
|
+
style: Partial<CSSStyleDeclaration>
|
|
20
|
+
): string => convertStyleMapToCSSArray(style).join('\n');
|
|
21
|
+
|
|
22
|
+
export const createCssClass = ({
|
|
23
|
+
mediaQuery,
|
|
24
|
+
className,
|
|
25
|
+
styles,
|
|
26
|
+
}: {
|
|
27
|
+
mediaQuery?: string;
|
|
28
|
+
className: string;
|
|
29
|
+
styles: Partial<CSSStyleDeclaration>;
|
|
30
|
+
}) => {
|
|
31
|
+
const cssClass = `.${className} {
|
|
32
|
+
${convertStyleMapToCSS(styles)}
|
|
33
|
+
}`;
|
|
34
|
+
|
|
35
|
+
if (mediaQuery) {
|
|
36
|
+
return `${mediaQuery} {
|
|
37
|
+
${cssClass}
|
|
38
|
+
}`;
|
|
39
|
+
} else {
|
|
40
|
+
return cssClass;
|
|
41
|
+
}
|
|
42
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Convert deep object to a flat object with dots
|
|
3
|
+
*
|
|
4
|
+
* { foo: { bar: 'baz' }} -> { 'foo.bar': 'baz' }
|
|
5
|
+
*/
|
|
6
|
+
export function flatten<T extends Record<string, any>>(
|
|
7
|
+
object: T,
|
|
8
|
+
path: string | null = null,
|
|
9
|
+
separator = '.'
|
|
10
|
+
): T {
|
|
11
|
+
return Object.keys(object).reduce((acc: T, key: string): T => {
|
|
12
|
+
const value = object[key];
|
|
13
|
+
const newPath = [path, key].filter(Boolean).join(separator);
|
|
14
|
+
const isObject = [
|
|
15
|
+
typeof value === 'object',
|
|
16
|
+
value !== null,
|
|
17
|
+
!(Array.isArray(value) && value.length === 0),
|
|
18
|
+
].every(Boolean);
|
|
19
|
+
|
|
20
|
+
return isObject
|
|
21
|
+
? { ...acc, ...flatten(value, newPath, separator) }
|
|
22
|
+
: { ...acc, [newPath]: value };
|
|
23
|
+
}, {} as T);
|
|
24
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { isBrowser } from '../functions/is-browser.js';
|
|
2
|
+
import type { CanTrack } from '../types/can-track.js';
|
|
3
|
+
import type { Nullable } from './nullable.js';
|
|
4
|
+
|
|
5
|
+
const getLocalStorage = () =>
|
|
6
|
+
isBrowser() && typeof localStorage !== 'undefined' ? localStorage : undefined;
|
|
7
|
+
|
|
8
|
+
export const getLocalStorageItem = ({
|
|
9
|
+
key,
|
|
10
|
+
canTrack,
|
|
11
|
+
}: {
|
|
12
|
+
key: string;
|
|
13
|
+
} & CanTrack): Nullable<string> => {
|
|
14
|
+
try {
|
|
15
|
+
if (canTrack) {
|
|
16
|
+
return getLocalStorage()?.getItem(key);
|
|
17
|
+
}
|
|
18
|
+
return undefined;
|
|
19
|
+
} catch (err) {
|
|
20
|
+
console.debug('[LocalStorage] GET error: ', err);
|
|
21
|
+
return undefined;
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export const setLocalStorageItem = ({
|
|
26
|
+
key,
|
|
27
|
+
canTrack,
|
|
28
|
+
value,
|
|
29
|
+
}: {
|
|
30
|
+
key: string;
|
|
31
|
+
value: string;
|
|
32
|
+
} & CanTrack) => {
|
|
33
|
+
try {
|
|
34
|
+
if (canTrack) {
|
|
35
|
+
getLocalStorage()?.setItem(key, value);
|
|
36
|
+
}
|
|
37
|
+
} catch (err) {
|
|
38
|
+
console.debug('[LocalStorage] SET error: ', err);
|
|
39
|
+
}
|
|
40
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
const MSG_PREFIX = '[Builder.io]: ';
|
|
2
|
+
export const logger = {
|
|
3
|
+
log: (...message: any[]) => console.log(MSG_PREFIX, ...message),
|
|
4
|
+
error: (...message: any[]) => console.error(MSG_PREFIX, ...message),
|
|
5
|
+
warn: (...message: any[]) => console.warn(MSG_PREFIX, ...message),
|
|
6
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { CanTrack } from '../types/can-track.js';
|
|
2
|
+
import { getCookie, setCookie } from './cookie.js';
|
|
3
|
+
import { checkIsDefined } from './nullable.js';
|
|
4
|
+
import { uuid } from './uuid.js';
|
|
5
|
+
|
|
6
|
+
const SESSION_LOCAL_STORAGE_KEY = 'builderSessionId';
|
|
7
|
+
|
|
8
|
+
export const getSessionId = async ({
|
|
9
|
+
canTrack,
|
|
10
|
+
}: CanTrack): Promise<string | undefined> => {
|
|
11
|
+
if (!canTrack) {
|
|
12
|
+
return undefined;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const sessionId = await getCookie({
|
|
16
|
+
name: SESSION_LOCAL_STORAGE_KEY,
|
|
17
|
+
canTrack,
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
if (checkIsDefined(sessionId)) {
|
|
21
|
+
return sessionId;
|
|
22
|
+
} else {
|
|
23
|
+
const newSessionId = createSessionId();
|
|
24
|
+
setSessionId({ id: newSessionId, canTrack });
|
|
25
|
+
|
|
26
|
+
return newSessionId;
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export const createSessionId = () => uuid();
|
|
31
|
+
|
|
32
|
+
export const setSessionId = ({
|
|
33
|
+
id,
|
|
34
|
+
canTrack,
|
|
35
|
+
}: {
|
|
36
|
+
id: string;
|
|
37
|
+
} & CanTrack) =>
|
|
38
|
+
setCookie({ name: SESSION_LOCAL_STORAGE_KEY, value: id, canTrack });
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { getTopLevelDomain } from './url.js';
|
|
2
|
+
|
|
3
|
+
describe('getTopLevelDomain', () => {
|
|
4
|
+
test('handles root domain', () => {
|
|
5
|
+
const output = getTopLevelDomain('example.com');
|
|
6
|
+
expect(output).toBe('example.com');
|
|
7
|
+
});
|
|
8
|
+
test('handles subdomain', () => {
|
|
9
|
+
const output = getTopLevelDomain('wwww.example.com');
|
|
10
|
+
expect(output).toBe('example.com');
|
|
11
|
+
});
|
|
12
|
+
test('handles subdomain with long suffix', () => {
|
|
13
|
+
const output = getTopLevelDomain('www.example.co.uk');
|
|
14
|
+
expect(output).toBe('example.co.uk');
|
|
15
|
+
});
|
|
16
|
+
test('handles localhost', () => {
|
|
17
|
+
const output = getTopLevelDomain('localhost');
|
|
18
|
+
expect(output).toBe('localhost');
|
|
19
|
+
|
|
20
|
+
const output2 = getTopLevelDomain('127.0.0.1');
|
|
21
|
+
expect(output2).toBe('127.0.0.1');
|
|
22
|
+
});
|
|
23
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Only gets one level up from hostname
|
|
3
|
+
* wwww.example.com -> example.com
|
|
4
|
+
* www.example.co.uk -> example.co.uk
|
|
5
|
+
*/
|
|
6
|
+
export const getTopLevelDomain = (host: string) => {
|
|
7
|
+
if (host === 'localhost' || host === '127.0.0.1') {
|
|
8
|
+
return host;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const parts = host.split('.');
|
|
12
|
+
if (parts.length > 2) {
|
|
13
|
+
return parts.slice(1).join('.');
|
|
14
|
+
}
|
|
15
|
+
return host;
|
|
16
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @credit https://stackoverflow.com/a/2117523
|
|
3
|
+
*/
|
|
4
|
+
export function uuidv4() {
|
|
5
|
+
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
|
|
6
|
+
const r = (Math.random() * 16) | 0,
|
|
7
|
+
v = c == 'x' ? r : (r & 0x3) | 0x8;
|
|
8
|
+
return v.toString(16);
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Slightly cleaner and smaller UUIDs
|
|
14
|
+
*/
|
|
15
|
+
export function uuid() {
|
|
16
|
+
return uuidv4().replace(/-/g, '');
|
|
17
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { CanTrack } from '../types/can-track.js';
|
|
2
|
+
import { getLocalStorageItem, setLocalStorageItem } from './localStorage.js';
|
|
3
|
+
import { checkIsDefined } from './nullable.js';
|
|
4
|
+
import { uuid } from './uuid.js';
|
|
5
|
+
|
|
6
|
+
const VISITOR_LOCAL_STORAGE_KEY = 'builderVisitorId';
|
|
7
|
+
|
|
8
|
+
export const getVisitorId = ({ canTrack }: CanTrack): string | undefined => {
|
|
9
|
+
if (!canTrack) {
|
|
10
|
+
return undefined;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const visitorId = getLocalStorageItem({
|
|
14
|
+
key: VISITOR_LOCAL_STORAGE_KEY,
|
|
15
|
+
canTrack,
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
if (checkIsDefined(visitorId)) {
|
|
19
|
+
return visitorId;
|
|
20
|
+
} else {
|
|
21
|
+
const newVisitorId = createVisitorId();
|
|
22
|
+
setVisitorId({ id: newVisitorId, canTrack });
|
|
23
|
+
|
|
24
|
+
return newVisitorId;
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export const createVisitorId = () => uuid();
|
|
29
|
+
|
|
30
|
+
export const setVisitorId = ({
|
|
31
|
+
id,
|
|
32
|
+
canTrack,
|
|
33
|
+
}: {
|
|
34
|
+
id: string;
|
|
35
|
+
} & CanTrack) =>
|
|
36
|
+
setLocalStorageItem({
|
|
37
|
+
key: VISITOR_LOCAL_STORAGE_KEY,
|
|
38
|
+
value: id,
|
|
39
|
+
canTrack,
|
|
40
|
+
});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { default as Button } from '../blocks/button/button';
|
|
2
|
+
export { default as Columns } from '../blocks/columns/columns';
|
|
3
|
+
export { default as Fragment } from '../blocks/fragment/fragment';
|
|
4
|
+
export { default as Image } from '../blocks/image/image';
|
|
5
|
+
export { default as RenderBlocks } from '../components/render-blocks';
|
|
6
|
+
export { default as RenderContent } from '../components/render-content/render-content';
|
|
7
|
+
export { default as Section } from '../blocks/section/section';
|
|
8
|
+
export { default as Symbol } from '../blocks/symbol/symbol';
|
|
9
|
+
export { default as Text } from '../blocks/text/text';
|
|
10
|
+
export { default as Video } from '../blocks/video/video';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export * from './index-helpers/top-of-file.js';
|
|
2
|
+
|
|
3
|
+
export * from './index-helpers/blocks-exports.js';
|
|
4
|
+
|
|
5
|
+
export * from './functions/is-editing.js';
|
|
6
|
+
export * from './functions/is-previewing.js';
|
|
7
|
+
export * from './functions/register-component.js';
|
|
8
|
+
export * from './functions/register.js';
|
|
9
|
+
export * from './functions/set-editor-settings.js';
|
|
10
|
+
export * from './functions/get-content/index.js';
|
|
11
|
+
export * from './functions/get-builder-search-params/index.js';
|
|
12
|
+
export { track } from './functions/track/index.js';
|
|
13
|
+
export type { RegisteredComponent } from './context/types';
|
|
14
|
+
export type { ComponentInfo } from './types/components';
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { TARGET } from '../constants/target.js';
|
|
2
|
+
import { isBrowser } from '../functions/is-browser.js';
|
|
3
|
+
import { register } from '../functions/register.js';
|
|
4
|
+
|
|
5
|
+
export const registerInsertMenu = () => {
|
|
6
|
+
register('insertMenu', {
|
|
7
|
+
name: '_default',
|
|
8
|
+
default: true,
|
|
9
|
+
items: [
|
|
10
|
+
{ name: 'Box' },
|
|
11
|
+
{ name: 'Text' },
|
|
12
|
+
{ name: 'Image' },
|
|
13
|
+
{ name: 'Columns' },
|
|
14
|
+
...(TARGET === 'reactNative'
|
|
15
|
+
? []
|
|
16
|
+
: [
|
|
17
|
+
{ name: 'Core:Section' },
|
|
18
|
+
{ name: 'Core:Button' },
|
|
19
|
+
{ name: 'Embed' },
|
|
20
|
+
{ name: 'Custom Code' },
|
|
21
|
+
]),
|
|
22
|
+
],
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
let isSetupForEditing = false;
|
|
27
|
+
export const setupBrowserForEditing = (
|
|
28
|
+
options: {
|
|
29
|
+
includeRefs?: boolean;
|
|
30
|
+
locale?: string;
|
|
31
|
+
} = {}
|
|
32
|
+
) => {
|
|
33
|
+
if (isSetupForEditing) {
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
isSetupForEditing = true;
|
|
37
|
+
if (isBrowser()) {
|
|
38
|
+
window.parent?.postMessage(
|
|
39
|
+
{
|
|
40
|
+
type: 'builder.sdkInfo',
|
|
41
|
+
data: {
|
|
42
|
+
target: TARGET,
|
|
43
|
+
// TODO: compile these in
|
|
44
|
+
// type: process.env.SDK_TYPE,
|
|
45
|
+
// version: process.env.SDK_VERSION,
|
|
46
|
+
supportsPatchUpdates: false,
|
|
47
|
+
// Supports builder-model="..." attribute which is needed to
|
|
48
|
+
// scope our '+ add block' button styling
|
|
49
|
+
supportsAddBlockScoping: true,
|
|
50
|
+
supportsCustomBreakpoints: true,
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
'*'
|
|
54
|
+
);
|
|
55
|
+
|
|
56
|
+
window.parent?.postMessage(
|
|
57
|
+
{
|
|
58
|
+
type: 'builder.updateContent',
|
|
59
|
+
data: {
|
|
60
|
+
options,
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
'*'
|
|
64
|
+
);
|
|
65
|
+
|
|
66
|
+
window.addEventListener('message', ({ data }) => {
|
|
67
|
+
if (!data?.type) {
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
switch (data.type) {
|
|
72
|
+
case 'builder.evaluate': {
|
|
73
|
+
const text = data.data.text;
|
|
74
|
+
const args = data.data.arguments || [];
|
|
75
|
+
const id = data.data.id;
|
|
76
|
+
// tslint:disable-next-line:no-function-constructor-with-string-args
|
|
77
|
+
const fn = new Function(text);
|
|
78
|
+
let result: any;
|
|
79
|
+
let error: Error | null = null;
|
|
80
|
+
try {
|
|
81
|
+
// eslint-disable-next-line prefer-spread
|
|
82
|
+
result = fn.apply(null, args);
|
|
83
|
+
} catch (err) {
|
|
84
|
+
error = err as Error;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
if (error) {
|
|
88
|
+
window.parent?.postMessage(
|
|
89
|
+
{
|
|
90
|
+
type: 'builder.evaluateError',
|
|
91
|
+
data: { id, error: error.message },
|
|
92
|
+
},
|
|
93
|
+
'*'
|
|
94
|
+
);
|
|
95
|
+
} else {
|
|
96
|
+
if (result && typeof result.then === 'function') {
|
|
97
|
+
(result as Promise<any>)
|
|
98
|
+
.then((finalResult) => {
|
|
99
|
+
window.parent?.postMessage(
|
|
100
|
+
{
|
|
101
|
+
type: 'builder.evaluateResult',
|
|
102
|
+
data: { id, result: finalResult },
|
|
103
|
+
},
|
|
104
|
+
'*'
|
|
105
|
+
);
|
|
106
|
+
})
|
|
107
|
+
.catch(console.error);
|
|
108
|
+
} else {
|
|
109
|
+
window.parent?.postMessage(
|
|
110
|
+
{
|
|
111
|
+
type: 'builder.evaluateResult',
|
|
112
|
+
data: { result, id },
|
|
113
|
+
},
|
|
114
|
+
'*'
|
|
115
|
+
);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
break;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
};
|