@builder.io/sdk-react 0.2.2 → 0.2.3-1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/react/cjs/blocks/BaseText.d.ts +2 -0
- package/dist/react/cjs/blocks/BaseText.js +11 -0
- package/dist/react/cjs/blocks/button/button.d.ts +2 -0
- package/dist/react/cjs/blocks/button/button.js +15 -0
- package/dist/react/cjs/blocks/button/component-info.d.ts +38 -0
- package/dist/react/cjs/blocks/button/component-info.js +41 -0
- package/dist/react/cjs/blocks/columns/columns.d.ts +2 -0
- package/dist/react/cjs/blocks/columns/columns.js +133 -0
- package/dist/react/cjs/blocks/columns/component-info.d.ts +176 -0
- package/dist/react/cjs/blocks/columns/component-info.js +243 -0
- package/dist/react/cjs/blocks/custom-code/component-info.d.ts +31 -0
- package/dist/react/cjs/blocks/custom-code/component-info.js +31 -0
- package/dist/react/cjs/blocks/custom-code/custom-code.d.ts +2 -0
- package/dist/react/cjs/blocks/custom-code/custom-code.js +53 -0
- package/dist/react/cjs/blocks/embed/component-info.d.ts +22 -0
- package/dist/react/cjs/blocks/embed/component-info.js +46 -0
- package/dist/react/cjs/blocks/embed/embed.d.ts +2 -0
- package/dist/react/cjs/blocks/embed/embed.js +44 -0
- package/dist/react/cjs/blocks/embed/helpers.d.ts +1 -0
- package/dist/react/cjs/blocks/embed/helpers.js +10 -0
- package/dist/react/cjs/blocks/form/component-info.d.ts +235 -0
- package/dist/react/cjs/blocks/form/component-info.js +262 -0
- package/dist/react/cjs/blocks/form/form.d.ts +2 -0
- package/dist/react/cjs/blocks/form/form.js +205 -0
- package/dist/react/cjs/blocks/fragment/component-info.d.ts +8 -0
- package/dist/react/cjs/blocks/fragment/component-info.js +11 -0
- package/dist/react/cjs/blocks/fragment/fragment.d.ts +2 -0
- package/dist/react/cjs/blocks/fragment/fragment.js +8 -0
- package/dist/react/cjs/blocks/image/component-info.d.ts +114 -0
- package/dist/react/cjs/blocks/image/component-info.js +151 -0
- package/dist/react/cjs/blocks/image/image.d.ts +2 -0
- package/dist/react/cjs/blocks/image/image.helpers.d.ts +1 -0
- package/dist/react/cjs/blocks/image/image.helpers.js +49 -0
- package/dist/react/cjs/blocks/image/image.js +84 -0
- package/dist/react/cjs/blocks/img/component-info.d.ts +15 -0
- package/dist/react/cjs/blocks/img/component-info.js +20 -0
- package/dist/react/cjs/blocks/img/img.d.ts +2 -0
- package/dist/react/cjs/blocks/img/img.js +12 -0
- package/dist/react/cjs/blocks/input/component-info.d.ts +66 -0
- package/dist/react/cjs/blocks/input/component-info.js +74 -0
- package/dist/react/cjs/blocks/input/input.d.ts +2 -0
- package/dist/react/cjs/blocks/input/input.js +9 -0
- package/dist/react/cjs/blocks/raw-text/component-info.d.ts +10 -0
- package/dist/react/cjs/blocks/raw-text/component-info.js +16 -0
- package/dist/react/cjs/blocks/raw-text/raw-text.d.ts +2 -0
- package/dist/react/cjs/blocks/raw-text/raw-text.js +8 -0
- package/dist/react/cjs/blocks/section/component-info.d.ts +43 -0
- package/dist/react/cjs/blocks/section/component-info.js +49 -0
- package/dist/react/cjs/blocks/section/section.d.ts +2 -0
- package/dist/react/cjs/blocks/section/section.js +19 -0
- package/dist/react/cjs/blocks/select/component-info.d.ts +61 -0
- package/dist/react/cjs/blocks/select/component-info.js +59 -0
- package/dist/react/cjs/blocks/select/select.d.ts +2 -0
- package/dist/react/cjs/blocks/select/select.js +9 -0
- package/dist/react/cjs/blocks/submit-button/component-info.d.ts +23 -0
- package/dist/react/cjs/blocks/submit-button/component-info.js +28 -0
- package/dist/react/cjs/blocks/submit-button/submit-button.d.ts +2 -0
- package/dist/react/cjs/blocks/submit-button/submit-button.js +8 -0
- package/dist/react/cjs/blocks/symbol/component-info.d.ts +35 -0
- package/dist/react/cjs/blocks/symbol/component-info.js +43 -0
- package/dist/react/cjs/blocks/symbol/symbol.d.ts +2 -0
- package/dist/react/cjs/blocks/symbol/symbol.js +73 -0
- package/dist/react/cjs/blocks/text/component-info.d.ts +19 -0
- package/dist/react/cjs/blocks/text/component-info.js +24 -0
- package/dist/react/cjs/blocks/text/text.d.ts +2 -0
- package/dist/react/cjs/blocks/text/text.js +10 -0
- package/dist/react/cjs/blocks/textarea/component-info.d.ts +53 -0
- package/dist/react/cjs/blocks/textarea/component-info.js +47 -0
- package/dist/react/cjs/blocks/textarea/textarea.d.ts +2 -0
- package/dist/react/cjs/blocks/textarea/textarea.js +8 -0
- package/dist/react/cjs/blocks/util.d.ts +1 -0
- package/dist/react/cjs/blocks/util.js +9 -0
- package/dist/react/cjs/blocks/video/component-info.d.ts +80 -0
- package/dist/react/cjs/blocks/video/component-info.js +106 -0
- package/dist/react/cjs/blocks/video/video.d.ts +2 -0
- package/dist/react/cjs/blocks/video/video.js +52 -0
- package/dist/react/cjs/components/render-block/block-styles.d.ts +2 -0
- package/dist/react/cjs/components/render-block/block-styles.js +66 -0
- package/dist/react/cjs/components/render-block/render-block.d.ts +2 -0
- package/dist/react/cjs/components/render-block/render-block.helpers.d.ts +13 -0
- package/dist/react/cjs/components/render-block/render-block.helpers.js +125 -0
- package/dist/react/cjs/components/render-block/render-block.js +134 -0
- package/dist/react/cjs/components/render-block/render-component.d.ts +2 -0
- package/dist/react/cjs/components/render-block/render-component.js +14 -0
- package/dist/react/cjs/components/render-block/render-repeated-block.d.ts +2 -0
- package/dist/react/cjs/components/render-block/render-repeated-block.js +20 -0
- package/dist/react/cjs/components/render-block/types.d.ts +0 -0
- package/dist/react/cjs/components/render-blocks.d.ts +2 -0
- package/dist/react/cjs/components/render-blocks.js +49 -0
- package/dist/react/cjs/components/render-content/builder-editing.d.ts +2 -0
- package/dist/react/cjs/components/render-content/builder-editing.js +8 -0
- package/dist/react/cjs/components/render-content/components/render-styles.d.ts +2 -0
- package/dist/react/cjs/components/render-content/components/render-styles.helpers.d.ts +7 -0
- package/dist/react/cjs/components/render-content/components/render-styles.helpers.js +55 -0
- package/dist/react/cjs/components/render-content/components/render-styles.js +34 -0
- package/dist/react/cjs/components/render-content/index.d.ts +2 -0
- package/dist/react/cjs/components/render-content/index.js +5 -0
- package/dist/react/cjs/components/render-content/render-content.d.ts +2 -0
- package/dist/react/cjs/components/render-content/render-content.helpers.d.ts +9 -0
- package/dist/react/cjs/components/render-content/render-content.helpers.js +42 -0
- package/dist/react/cjs/components/render-content/render-content.js +297 -0
- package/dist/react/cjs/components/render-content/render-content.types.d.ts +0 -0
- package/dist/react/cjs/components/render-inlined-styles.d.ts +2 -0
- package/dist/react/cjs/components/render-inlined-styles.js +19 -0
- package/dist/react/cjs/constants/builder-registered-components.d.ts +1 -0
- package/dist/react/cjs/constants/builder-registered-components.js +55 -0
- package/dist/react/cjs/constants/device-sizes.d.ts +21 -0
- package/dist/react/cjs/constants/device-sizes.js +49 -0
- package/dist/react/cjs/constants/target.d.ts +1 -0
- package/dist/react/cjs/constants/target.js +5 -0
- package/dist/react/cjs/context/builder.context.d.ts +11 -0
- package/dist/react/cjs/context/builder.context.js +16 -0
- package/dist/react/cjs/context/types.d.ts +0 -0
- package/dist/react/cjs/functions/camel-to-kebab-case.d.ts +1 -0
- package/dist/react/cjs/functions/camel-to-kebab-case.js +5 -0
- package/dist/react/cjs/functions/evaluate.d.ts +7 -0
- package/dist/react/cjs/functions/evaluate.js +25 -0
- package/dist/react/cjs/functions/event-handler-name.d.ts +1 -0
- package/dist/react/cjs/functions/event-handler-name.js +8 -0
- package/dist/react/cjs/functions/extract-text-styles.d.ts +1 -0
- package/dist/react/cjs/functions/extract-text-styles.js +23 -0
- package/dist/react/cjs/functions/fast-clone.d.ts +1 -0
- package/dist/react/cjs/functions/fast-clone.js +5 -0
- package/dist/react/cjs/functions/get-block-actions-handler.d.ts +1 -0
- package/dist/react/cjs/functions/get-block-actions-handler.js +12 -0
- package/dist/react/cjs/functions/get-block-actions.d.ts +1 -0
- package/dist/react/cjs/functions/get-block-actions.js +19 -0
- package/dist/react/cjs/functions/get-block-component-options.d.ts +1 -0
- package/dist/react/cjs/functions/get-block-component-options.js +29 -0
- package/dist/react/cjs/functions/get-block-properties.d.ts +1 -0
- package/dist/react/cjs/functions/get-block-properties.js +54 -0
- package/dist/react/cjs/functions/get-builder-search-params/fn.test.d.ts +1 -0
- package/dist/react/cjs/functions/get-builder-search-params/fn.test.js +15 -0
- package/dist/react/cjs/functions/get-builder-search-params/index.d.ts +4 -0
- package/dist/react/cjs/functions/get-builder-search-params/index.js +39 -0
- package/dist/react/cjs/functions/get-content/ab-testing.d.ts +1 -0
- package/dist/react/cjs/functions/get-content/ab-testing.js +89 -0
- package/dist/react/cjs/functions/get-content/generate-content-url.d.ts +1 -0
- package/dist/react/cjs/functions/get-content/generate-content-url.js +48 -0
- package/dist/react/cjs/functions/get-content/generate-content-url.test.d.ts +1 -0
- package/dist/react/cjs/functions/get-content/generate-content-url.test.js +84 -0
- package/dist/react/cjs/functions/get-content/index.d.ts +2 -0
- package/dist/react/cjs/functions/get-content/index.js +88 -0
- package/dist/react/cjs/functions/get-content/types.d.ts +0 -0
- package/dist/react/cjs/functions/get-fetch.d.ts +1 -0
- package/dist/react/cjs/functions/get-fetch.js +15 -0
- package/dist/react/cjs/functions/get-global-this.d.ts +1 -0
- package/dist/react/cjs/functions/get-global-this.js +19 -0
- package/dist/react/cjs/functions/get-processed-block.d.ts +6 -0
- package/dist/react/cjs/functions/get-processed-block.js +52 -0
- package/dist/react/cjs/functions/get-processed-block.test.d.ts +1 -0
- package/dist/react/cjs/functions/get-processed-block.test.js +34 -0
- package/dist/react/cjs/functions/get-react-native-block-styles.d.ts +5 -0
- package/dist/react/cjs/functions/get-react-native-block-styles.js +30 -0
- package/dist/react/cjs/functions/if-target.d.ts +5 -0
- package/dist/react/cjs/functions/if-target.js +13 -0
- package/dist/react/cjs/functions/is-browser.d.ts +1 -0
- package/dist/react/cjs/functions/is-browser.js +7 -0
- package/dist/react/cjs/functions/is-editing.d.ts +1 -0
- package/dist/react/cjs/functions/is-editing.js +9 -0
- package/dist/react/cjs/functions/is-iframe.d.ts +1 -0
- package/dist/react/cjs/functions/is-iframe.js +8 -0
- package/dist/react/cjs/functions/is-previewing.d.ts +1 -0
- package/dist/react/cjs/functions/is-previewing.js +15 -0
- package/dist/react/cjs/functions/on-change.d.ts +2 -0
- package/dist/react/cjs/functions/on-change.js +28 -0
- package/dist/react/cjs/functions/on-change.test.d.ts +1 -0
- package/dist/react/cjs/functions/on-change.test.js +21 -0
- package/dist/react/cjs/functions/register-component.d.ts +6 -0
- package/dist/react/cjs/functions/register-component.js +65 -0
- package/dist/react/cjs/functions/register.d.ts +1 -0
- package/dist/react/cjs/functions/register.js +31 -0
- package/dist/react/cjs/functions/sanitize-react-native-block-styles.d.ts +1 -0
- package/dist/react/cjs/functions/sanitize-react-native-block-styles.js +71 -0
- package/dist/react/cjs/functions/set-editor-settings.d.ts +1 -0
- package/dist/react/cjs/functions/set-editor-settings.js +16 -0
- package/dist/react/cjs/functions/set.d.ts +1 -0
- package/dist/react/cjs/functions/set.js +12 -0
- package/dist/react/cjs/functions/set.test.d.ts +1 -0
- package/dist/react/cjs/functions/set.test.js +18 -0
- package/dist/react/cjs/functions/track/helpers.d.ts +5 -0
- package/dist/react/cjs/functions/track/helpers.js +53 -0
- package/dist/react/cjs/functions/track/index.d.ts +2 -0
- package/dist/react/{functions/track.js → cjs/functions/track/index.js} +21 -12
- package/dist/react/cjs/functions/track/interaction.d.ts +14 -0
- package/dist/react/cjs/functions/track/interaction.js +51 -0
- package/dist/react/cjs/functions/transform-block-properties.d.ts +1 -0
- package/dist/react/cjs/functions/transform-block-properties.js +7 -0
- package/dist/react/cjs/functions/transform-block.d.ts +1 -0
- package/dist/react/cjs/functions/transform-block.js +7 -0
- package/dist/react/cjs/helpers/ab-tests.d.ts +9 -0
- package/dist/react/cjs/helpers/ab-tests.js +10 -0
- package/dist/react/cjs/helpers/cookie.d.ts +2 -0
- package/dist/react/cjs/helpers/cookie.js +74 -0
- package/dist/react/cjs/helpers/css.d.ts +7 -0
- package/dist/react/cjs/helpers/css.js +33 -0
- package/dist/react/cjs/helpers/flatten.d.ts +1 -0
- package/dist/react/cjs/helpers/flatten.js +35 -0
- package/dist/react/cjs/helpers/localStorage.d.ts +9 -0
- package/dist/react/cjs/helpers/localStorage.js +31 -0
- package/dist/react/cjs/helpers/logger.d.ts +5 -0
- package/dist/react/cjs/helpers/logger.js +10 -0
- package/dist/react/cjs/helpers/nullable.d.ts +1 -0
- package/dist/react/cjs/helpers/nullable.js +5 -0
- package/dist/react/cjs/helpers/sessionId.d.ts +6 -0
- package/dist/react/cjs/helpers/sessionId.js +51 -0
- package/dist/react/cjs/helpers/time.d.ts +1 -0
- package/dist/react/cjs/helpers/time.js +6 -0
- package/dist/react/cjs/helpers/url.d.ts +1 -0
- package/dist/react/cjs/helpers/url.js +14 -0
- package/dist/react/cjs/helpers/url.test.d.ts +1 -0
- package/dist/react/cjs/helpers/url.test.js +23 -0
- package/dist/react/cjs/helpers/uuid.d.ts +2 -0
- package/dist/react/cjs/helpers/uuid.js +14 -0
- package/dist/react/cjs/helpers/visitorId.d.ts +8 -0
- package/dist/react/cjs/helpers/visitorId.js +33 -0
- package/dist/react/cjs/index-helpers/blocks-exports.js +23 -0
- package/dist/react/cjs/index-helpers/top-of-file.d.ts +2 -0
- package/dist/react/cjs/index-helpers/top-of-file.js +5 -0
- package/dist/react/cjs/index.d.ts +11 -0
- package/dist/react/cjs/index.js +28 -0
- package/dist/react/cjs/scripts/init-editing.d.ts +2 -0
- package/dist/react/cjs/scripts/init-editing.js +97 -0
- package/dist/react/cjs/types/api-version.d.ts +1 -0
- package/dist/react/cjs/types/api-version.js +5 -0
- package/dist/react/cjs/types/builder-block.d.ts +0 -0
- package/dist/react/cjs/types/builder-content.d.ts +0 -0
- package/dist/react/cjs/types/can-track.d.ts +0 -0
- package/dist/react/cjs/types/components.d.ts +0 -0
- package/dist/react/cjs/types/deep-partial.d.ts +0 -0
- package/dist/react/cjs/types/element.d.ts +0 -0
- package/dist/react/cjs/types/input.d.ts +0 -0
- package/dist/react/cjs/types/targets.d.ts +0 -0
- package/dist/react/cjs/types/typescript.d.ts +0 -0
- package/dist/react/esm/blocks/BaseText.d.ts +2 -0
- package/dist/react/{blocks → esm/blocks}/BaseText.js +1 -0
- package/dist/react/esm/blocks/button/button.d.ts +2 -0
- package/dist/react/{blocks → esm/blocks}/button/button.js +1 -0
- package/dist/react/esm/blocks/button/component-info.d.ts +38 -0
- package/dist/react/esm/blocks/columns/columns.d.ts +2 -0
- package/dist/react/{blocks → esm/blocks}/columns/columns.js +1 -0
- package/dist/react/esm/blocks/columns/component-info.d.ts +176 -0
- package/dist/react/esm/blocks/custom-code/component-info.d.ts +31 -0
- package/dist/react/esm/blocks/custom-code/custom-code.d.ts +2 -0
- package/dist/react/{blocks → esm/blocks}/custom-code/custom-code.js +1 -0
- package/dist/react/esm/blocks/embed/component-info.d.ts +22 -0
- package/dist/react/esm/blocks/embed/embed.d.ts +2 -0
- package/dist/react/{blocks → esm/blocks}/embed/embed.js +1 -0
- package/dist/react/esm/blocks/embed/helpers.d.ts +1 -0
- package/dist/react/esm/blocks/form/component-info.d.ts +235 -0
- package/dist/react/esm/blocks/form/form.d.ts +2 -0
- package/dist/react/{blocks → esm/blocks}/form/form.js +1 -0
- package/dist/react/esm/blocks/fragment/component-info.d.ts +8 -0
- package/dist/react/esm/blocks/fragment/fragment.d.ts +2 -0
- package/dist/react/{blocks → esm/blocks}/fragment/fragment.js +1 -0
- package/dist/react/esm/blocks/image/component-info.d.ts +114 -0
- package/dist/react/esm/blocks/image/image.d.ts +2 -0
- package/dist/react/esm/blocks/image/image.helpers.d.ts +1 -0
- package/dist/react/{blocks → esm/blocks}/image/image.js +1 -0
- package/dist/react/esm/blocks/img/component-info.d.ts +15 -0
- package/dist/react/esm/blocks/img/img.d.ts +2 -0
- package/dist/react/{blocks → esm/blocks}/img/img.js +1 -0
- package/dist/react/esm/blocks/input/component-info.d.ts +66 -0
- package/dist/react/esm/blocks/input/input.d.ts +2 -0
- package/dist/react/{blocks → esm/blocks}/input/input.js +1 -0
- package/dist/react/esm/blocks/raw-text/component-info.d.ts +10 -0
- package/dist/react/esm/blocks/raw-text/raw-text.d.ts +2 -0
- package/dist/react/{blocks → esm/blocks}/raw-text/raw-text.js +1 -0
- package/dist/react/esm/blocks/section/component-info.d.ts +43 -0
- package/dist/react/esm/blocks/section/section.d.ts +2 -0
- package/dist/react/{blocks → esm/blocks}/section/section.js +1 -0
- package/dist/react/esm/blocks/select/component-info.d.ts +61 -0
- package/dist/react/esm/blocks/select/select.d.ts +2 -0
- package/dist/react/{blocks → esm/blocks}/select/select.js +1 -0
- package/dist/react/esm/blocks/submit-button/component-info.d.ts +23 -0
- package/dist/react/esm/blocks/submit-button/submit-button.d.ts +2 -0
- package/dist/react/{blocks → esm/blocks}/submit-button/submit-button.js +1 -0
- package/dist/react/esm/blocks/symbol/component-info.d.ts +35 -0
- package/dist/react/esm/blocks/symbol/symbol.d.ts +2 -0
- package/dist/react/{blocks → esm/blocks}/symbol/symbol.js +1 -0
- package/dist/react/esm/blocks/text/component-info.d.ts +19 -0
- package/dist/react/esm/blocks/text/text.d.ts +2 -0
- package/dist/react/{blocks → esm/blocks}/text/text.js +1 -0
- package/dist/react/esm/blocks/textarea/component-info.d.ts +53 -0
- package/dist/react/esm/blocks/textarea/textarea.d.ts +2 -0
- package/dist/react/{blocks → esm/blocks}/textarea/textarea.js +1 -0
- package/dist/react/esm/blocks/util.d.ts +1 -0
- package/dist/react/esm/blocks/video/component-info.d.ts +80 -0
- package/dist/react/esm/blocks/video/video.d.ts +2 -0
- package/dist/react/{blocks → esm/blocks}/video/video.js +1 -0
- package/dist/react/esm/components/render-block/block-styles.d.ts +2 -0
- package/dist/react/{components → esm/components}/render-block/block-styles.js +1 -0
- package/dist/react/esm/components/render-block/render-block.d.ts +2 -0
- package/dist/react/esm/components/render-block/render-block.helpers.d.ts +13 -0
- package/dist/react/{components → esm/components}/render-block/render-block.js +1 -0
- package/dist/react/esm/components/render-block/render-component.d.ts +2 -0
- package/dist/react/{components → esm/components}/render-block/render-component.js +1 -0
- package/dist/react/esm/components/render-block/render-repeated-block.d.ts +2 -0
- package/dist/react/{components → esm/components}/render-block/render-repeated-block.js +1 -0
- package/dist/react/esm/components/render-block/types.d.ts +0 -0
- package/dist/react/esm/components/render-block/types.js +1 -0
- package/dist/react/esm/components/render-blocks.d.ts +2 -0
- package/dist/react/{components → esm/components}/render-blocks.js +1 -0
- package/dist/react/esm/components/render-content/builder-editing.d.ts +2 -0
- package/dist/react/{components → esm/components}/render-content/builder-editing.js +1 -0
- package/dist/react/esm/components/render-content/components/render-styles.d.ts +2 -0
- package/dist/react/esm/components/render-content/components/render-styles.helpers.d.ts +7 -0
- package/dist/react/{components → esm/components}/render-content/components/render-styles.js +1 -0
- package/dist/react/esm/components/render-content/index.d.ts +2 -0
- package/dist/react/esm/components/render-content/render-content.d.ts +2 -0
- package/dist/react/esm/components/render-content/render-content.helpers.d.ts +9 -0
- package/dist/react/{components → esm/components}/render-content/render-content.js +1 -0
- 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 +1 -0
- package/dist/react/esm/components/render-inlined-styles.d.ts +2 -0
- package/dist/react/{components → esm/components}/render-inlined-styles.js +1 -0
- package/dist/react/esm/constants/builder-registered-components.d.ts +1 -0
- package/dist/react/esm/constants/device-sizes.d.ts +21 -0
- package/dist/react/esm/constants/target.d.ts +1 -0
- package/dist/react/esm/context/builder.context.d.ts +11 -0
- package/dist/react/esm/context/types.d.ts +0 -0
- package/dist/react/esm/context/types.js +1 -0
- package/dist/react/esm/functions/camel-to-kebab-case.d.ts +1 -0
- package/dist/react/esm/functions/evaluate.d.ts +7 -0
- package/dist/react/esm/functions/event-handler-name.d.ts +1 -0
- package/dist/react/esm/functions/extract-text-styles.d.ts +1 -0
- package/dist/react/esm/functions/fast-clone.d.ts +1 -0
- package/dist/react/esm/functions/get-block-actions-handler.d.ts +1 -0
- package/dist/react/esm/functions/get-block-actions.d.ts +1 -0
- package/dist/react/esm/functions/get-block-component-options.d.ts +1 -0
- package/dist/react/esm/functions/get-block-properties.d.ts +1 -0
- package/dist/react/esm/functions/get-builder-search-params/fn.test.d.ts +1 -0
- package/dist/react/esm/functions/get-builder-search-params/index.d.ts +4 -0
- package/dist/react/esm/functions/get-content/ab-testing.d.ts +1 -0
- package/dist/react/esm/functions/get-content/generate-content-url.d.ts +1 -0
- package/dist/react/esm/functions/get-content/generate-content-url.test.d.ts +1 -0
- package/dist/react/esm/functions/get-content/index.d.ts +2 -0
- package/dist/react/{functions → esm/functions}/get-content/index.js +1 -1
- package/dist/react/esm/functions/get-content/types.d.ts +0 -0
- package/dist/react/esm/functions/get-content/types.js +1 -0
- package/dist/react/esm/functions/get-fetch.d.ts +1 -0
- package/dist/react/esm/functions/get-global-this.d.ts +1 -0
- package/dist/react/esm/functions/get-processed-block.d.ts +6 -0
- package/dist/react/esm/functions/get-processed-block.test.d.ts +1 -0
- package/dist/react/esm/functions/get-react-native-block-styles.d.ts +5 -0
- package/dist/react/esm/functions/if-target.d.ts +5 -0
- package/dist/react/esm/functions/is-browser.d.ts +1 -0
- package/dist/react/esm/functions/is-editing.d.ts +1 -0
- package/dist/react/esm/functions/is-iframe.d.ts +1 -0
- package/dist/react/esm/functions/is-previewing.d.ts +1 -0
- package/dist/react/esm/functions/on-change.d.ts +2 -0
- package/dist/react/esm/functions/on-change.test.d.ts +1 -0
- package/dist/react/esm/functions/register-component.d.ts +6 -0
- package/dist/react/esm/functions/register.d.ts +1 -0
- package/dist/react/esm/functions/sanitize-react-native-block-styles.d.ts +1 -0
- package/dist/react/esm/functions/set-editor-settings.d.ts +1 -0
- package/dist/react/esm/functions/set.d.ts +1 -0
- package/dist/react/esm/functions/set.test.d.ts +1 -0
- package/dist/react/esm/functions/track/helpers.d.ts +5 -0
- package/dist/react/esm/functions/track/index.d.ts +2 -0
- package/dist/react/esm/functions/track/interaction.d.ts +14 -0
- package/dist/react/esm/functions/transform-block-properties.d.ts +1 -0
- package/dist/react/esm/functions/transform-block.d.ts +1 -0
- package/dist/react/esm/helpers/ab-tests.d.ts +9 -0
- package/dist/react/esm/helpers/cookie.d.ts +2 -0
- package/dist/react/esm/helpers/css.d.ts +7 -0
- package/dist/react/esm/helpers/flatten.d.ts +1 -0
- package/dist/react/esm/helpers/localStorage.d.ts +9 -0
- package/dist/react/esm/helpers/logger.d.ts +5 -0
- package/dist/react/esm/helpers/nullable.d.ts +1 -0
- package/dist/react/esm/helpers/sessionId.d.ts +6 -0
- package/dist/react/esm/helpers/time.d.ts +1 -0
- package/dist/react/esm/helpers/url.d.ts +1 -0
- package/dist/react/esm/helpers/url.test.d.ts +1 -0
- package/dist/react/esm/helpers/uuid.d.ts +2 -0
- package/dist/react/esm/helpers/visitorId.d.ts +8 -0
- package/dist/react/esm/index-helpers/blocks-exports.d.ts +11 -0
- package/dist/react/esm/index-helpers/blocks-exports.js +11 -0
- package/dist/react/esm/index-helpers/top-of-file.d.ts +2 -0
- package/dist/react/esm/index.d.ts +11 -0
- package/dist/react/esm/scripts/init-editing.d.ts +2 -0
- package/dist/react/esm/types/api-version.d.ts +1 -0
- package/dist/react/esm/types/builder-block.d.ts +0 -0
- package/dist/react/esm/types/builder-block.js +1 -0
- package/dist/react/esm/types/builder-content.d.ts +0 -0
- package/dist/react/esm/types/builder-content.js +1 -0
- package/dist/react/esm/types/can-track.d.ts +0 -0
- package/dist/react/esm/types/can-track.js +1 -0
- package/dist/react/esm/types/components.d.ts +0 -0
- package/dist/react/esm/types/components.js +1 -0
- package/dist/react/esm/types/deep-partial.d.ts +0 -0
- package/dist/react/esm/types/deep-partial.js +1 -0
- package/dist/react/esm/types/element.d.ts +0 -0
- package/dist/react/esm/types/element.js +1 -0
- package/dist/react/esm/types/input.d.ts +0 -0
- package/dist/react/esm/types/input.js +1 -0
- package/dist/react/esm/types/targets.d.ts +0 -0
- package/dist/react/esm/types/targets.js +1 -0
- package/dist/react/esm/types/typescript.d.ts +0 -0
- package/dist/react/esm/types/typescript.js +1 -0
- package/dist/rsc/blocks/BaseText.d.ts +2 -0
- package/dist/rsc/blocks/button/button.d.ts +2 -0
- package/dist/rsc/blocks/button/component-info.d.ts +38 -0
- package/dist/rsc/blocks/columns/columns.d.ts +2 -0
- package/dist/rsc/blocks/columns/component-info.d.ts +176 -0
- package/dist/rsc/blocks/custom-code/component-info.d.ts +31 -0
- package/dist/rsc/blocks/custom-code/custom-code.d.ts +2 -0
- package/dist/rsc/blocks/embed/component-info.d.ts +22 -0
- package/dist/rsc/blocks/embed/embed.d.ts +2 -0
- package/dist/rsc/blocks/embed/helpers.d.ts +1 -0
- package/dist/rsc/blocks/form/component-info.d.ts +235 -0
- package/dist/rsc/blocks/form/form.d.ts +2 -0
- package/dist/rsc/blocks/fragment/component-info.d.ts +8 -0
- package/dist/rsc/blocks/fragment/fragment.d.ts +2 -0
- package/dist/rsc/blocks/image/component-info.d.ts +114 -0
- package/dist/rsc/blocks/image/image.d.ts +2 -0
- package/dist/rsc/blocks/image/image.helpers.d.ts +1 -0
- package/dist/rsc/blocks/img/component-info.d.ts +15 -0
- package/dist/rsc/blocks/img/img.d.ts +2 -0
- package/dist/rsc/blocks/input/component-info.d.ts +66 -0
- package/dist/rsc/blocks/input/input.d.ts +2 -0
- package/dist/rsc/blocks/raw-text/component-info.d.ts +10 -0
- package/dist/rsc/blocks/raw-text/raw-text.d.ts +2 -0
- package/dist/rsc/blocks/section/component-info.d.ts +43 -0
- package/dist/rsc/blocks/section/section.d.ts +2 -0
- package/dist/rsc/blocks/select/component-info.d.ts +61 -0
- package/dist/rsc/blocks/select/select.d.ts +2 -0
- package/dist/rsc/blocks/submit-button/component-info.d.ts +23 -0
- package/dist/rsc/blocks/submit-button/submit-button.d.ts +2 -0
- package/dist/rsc/blocks/symbol/component-info.d.ts +35 -0
- package/dist/rsc/blocks/symbol/symbol.d.ts +2 -0
- package/dist/rsc/blocks/text/component-info.d.ts +19 -0
- package/dist/rsc/blocks/text/text.d.ts +2 -0
- package/dist/rsc/blocks/textarea/component-info.d.ts +53 -0
- package/dist/rsc/blocks/textarea/textarea.d.ts +2 -0
- package/dist/rsc/blocks/util.d.ts +1 -0
- package/dist/rsc/blocks/video/component-info.d.ts +80 -0
- package/dist/rsc/blocks/video/video.d.ts +2 -0
- package/dist/rsc/components/render-block/block-styles.d.ts +2 -0
- package/dist/rsc/components/render-block/render-block.d.ts +2 -0
- package/dist/rsc/components/render-block/render-block.helpers.d.ts +10 -0
- package/dist/rsc/components/render-block/render-component.d.ts +2 -0
- package/dist/rsc/components/render-block/render-repeated-block.d.ts +2 -0
- package/dist/rsc/components/render-block/types.d.ts +0 -0
- package/dist/rsc/components/render-blocks.d.ts +2 -0
- package/dist/rsc/components/render-content/builder-editing.d.ts +27 -0
- package/dist/rsc/components/render-content/components/render-styles.d.ts +2 -0
- package/dist/rsc/components/render-content/components/render-styles.helpers.d.ts +7 -0
- package/dist/rsc/components/render-content/index.d.ts +2 -0
- package/dist/rsc/components/render-content/render-content.d.ts +2 -0
- package/dist/rsc/components/render-content/render-content.helpers.d.ts +9 -0
- package/dist/rsc/components/render-content/render-content.types.d.ts +0 -0
- package/dist/rsc/components/render-inlined-styles.d.ts +2 -0
- package/dist/rsc/constants/builder-registered-components.d.ts +1 -0
- package/dist/rsc/constants/device-sizes.d.ts +21 -0
- package/dist/rsc/constants/target.d.ts +1 -0
- package/dist/rsc/context/builder.context.d.ts +11 -0
- package/dist/rsc/context/types.d.ts +0 -0
- package/dist/rsc/functions/camel-to-kebab-case.d.ts +1 -0
- package/dist/rsc/functions/evaluate.d.ts +1 -0
- package/dist/rsc/functions/event-handler-name.d.ts +1 -0
- package/dist/rsc/functions/extract-text-styles.d.ts +1 -0
- package/dist/rsc/functions/fast-clone.d.ts +1 -0
- package/dist/rsc/functions/get-block-actions-handler.d.ts +1 -0
- package/dist/rsc/functions/get-block-actions.d.ts +1 -0
- package/dist/rsc/functions/get-block-component-options.d.ts +1 -0
- package/dist/rsc/functions/get-block-properties.d.ts +1 -0
- package/dist/rsc/functions/get-builder-search-params/fn.test.d.ts +1 -0
- package/dist/rsc/functions/get-builder-search-params/index.d.ts +4 -0
- package/dist/rsc/functions/get-content/ab-testing.d.ts +1 -0
- package/dist/rsc/functions/get-content/generate-content-url.d.ts +1 -0
- package/dist/rsc/functions/get-content/generate-content-url.test.d.ts +1 -0
- package/dist/rsc/functions/get-content/index.d.ts +2 -0
- package/dist/rsc/functions/get-content/index.js +1 -1
- package/dist/rsc/functions/get-content/types.d.ts +0 -0
- package/dist/rsc/functions/get-fetch.d.ts +1 -0
- package/dist/rsc/functions/get-global-this.d.ts +1 -0
- package/dist/rsc/functions/get-processed-block.d.ts +6 -0
- package/dist/rsc/functions/get-processed-block.test.d.ts +1 -0
- package/dist/rsc/functions/get-react-native-block-styles.d.ts +5 -0
- package/dist/rsc/functions/if-target.d.ts +5 -0
- package/dist/rsc/functions/is-browser.d.ts +1 -0
- package/dist/rsc/functions/is-editing.d.ts +1 -0
- package/dist/rsc/functions/is-iframe.d.ts +1 -0
- package/dist/rsc/functions/is-previewing.d.ts +1 -0
- package/dist/rsc/functions/on-change.d.ts +2 -0
- package/dist/rsc/functions/on-change.test.d.ts +1 -0
- package/dist/rsc/functions/register-component.d.ts +6 -0
- package/dist/rsc/functions/register.d.ts +1 -0
- package/dist/rsc/functions/sanitize-react-native-block-styles.d.ts +1 -0
- package/dist/rsc/functions/set-editor-settings.d.ts +1 -0
- package/dist/rsc/functions/set.d.ts +1 -0
- package/dist/rsc/functions/set.test.d.ts +1 -0
- package/dist/rsc/functions/track/helpers.d.ts +5 -0
- package/dist/rsc/functions/track/index.d.ts +2 -0
- package/dist/rsc/functions/track/interaction.d.ts +14 -0
- package/dist/rsc/functions/transform-block-properties.d.ts +1 -0
- package/dist/rsc/functions/transform-block.d.ts +1 -0
- package/dist/rsc/helpers/ab-tests.d.ts +9 -0
- package/dist/rsc/helpers/cookie.d.ts +2 -0
- package/dist/rsc/helpers/css.d.ts +7 -0
- package/dist/rsc/helpers/flatten.d.ts +1 -0
- package/dist/rsc/helpers/localStorage.d.ts +9 -0
- package/dist/rsc/helpers/logger.d.ts +5 -0
- package/dist/rsc/helpers/nullable.d.ts +1 -0
- package/dist/rsc/helpers/sessionId.d.ts +6 -0
- package/dist/rsc/helpers/time.d.ts +1 -0
- package/dist/rsc/helpers/url.d.ts +1 -0
- package/dist/rsc/helpers/url.test.d.ts +1 -0
- package/dist/rsc/helpers/uuid.d.ts +2 -0
- package/dist/rsc/helpers/visitorId.d.ts +8 -0
- package/dist/rsc/index-helpers/blocks-exports.d.ts +11 -0
- package/dist/rsc/index-helpers/top-of-file.d.ts +2 -0
- package/dist/rsc/index.d.ts +11 -0
- package/dist/rsc/scripts/init-editing.d.ts +2 -0
- package/dist/rsc/types/api-version.d.ts +1 -0
- package/dist/rsc/types/builder-block.d.ts +0 -0
- package/dist/rsc/types/builder-content.d.ts +0 -0
- package/dist/rsc/types/can-track.d.ts +0 -0
- package/dist/rsc/types/components.d.ts +0 -0
- package/dist/rsc/types/deep-partial.d.ts +0 -0
- package/dist/rsc/types/element.d.ts +0 -0
- package/dist/rsc/types/input.d.ts +0 -0
- package/dist/rsc/types/targets.d.ts +0 -0
- package/dist/rsc/types/typescript.d.ts +0 -0
- package/package.json +8 -9
- package/packages/react/src/blocks/BaseText.jsx +1 -0
- package/packages/react/src/blocks/button/button.jsx +1 -0
- package/packages/react/src/blocks/columns/columns.jsx +1 -0
- package/packages/react/src/blocks/custom-code/custom-code.jsx +1 -0
- package/packages/react/src/blocks/embed/embed.jsx +1 -0
- package/packages/react/src/blocks/form/form.jsx +1 -0
- package/packages/react/src/blocks/fragment/fragment.jsx +1 -0
- package/packages/react/src/blocks/image/image.jsx +1 -0
- package/packages/react/src/blocks/img/img.jsx +1 -0
- package/packages/react/src/blocks/input/input.jsx +1 -0
- package/packages/react/src/blocks/raw-text/raw-text.jsx +1 -0
- package/packages/react/src/blocks/section/section.jsx +1 -0
- package/packages/react/src/blocks/select/select.jsx +1 -0
- package/packages/react/src/blocks/submit-button/submit-button.jsx +1 -0
- package/packages/react/src/blocks/symbol/symbol.jsx +1 -0
- package/packages/react/src/blocks/text/text.jsx +1 -0
- package/packages/react/src/blocks/textarea/textarea.jsx +1 -0
- package/packages/react/src/blocks/video/video.jsx +1 -0
- package/packages/react/src/components/render-block/block-styles.jsx +1 -0
- package/packages/react/src/components/render-block/render-block.jsx +1 -0
- package/packages/react/src/components/render-block/render-component.jsx +1 -0
- package/packages/react/src/components/render-block/render-repeated-block.jsx +1 -0
- package/packages/react/src/components/render-blocks.jsx +1 -0
- package/packages/react/src/components/render-content/builder-editing.jsx +1 -0
- package/packages/react/src/components/render-content/components/render-styles.jsx +1 -0
- package/packages/react/src/components/render-content/render-content.jsx +1 -0
- package/packages/react/src/components/render-inlined-styles.jsx +1 -0
- package/packages/react/src/functions/get-content/index.js +1 -1
- package/packages/rsc/src/functions/get-content/index.js +1 -1
- package/tsconfig.base.json +8 -3
- package/tsconfig.react-cjs.json +10 -0
- package/tsconfig.react-esm.json +10 -0
- package/dist/react/components/render-block/render-component-with-context.js +0 -27
- package/dist/react/components/render-content-variants/helpers.js +0 -98
- package/dist/react/components/render-content-variants/render-content-variants.js +0 -45
- package/dist/react/functions/get-block-tag.js +0 -4
- package/tsconfig.react.json +0 -7
- /package/dist/react/{components → cjs/components}/render-block/types.js +0 -0
- /package/dist/react/{components → cjs/components}/render-content/render-content.types.js +0 -0
- /package/dist/react/{context → cjs/context}/types.js +0 -0
- /package/dist/react/{functions → cjs/functions}/get-content/types.js +0 -0
- /package/dist/react/{index-helpers/blocks-exports.js → cjs/index-helpers/blocks-exports.d.ts} +0 -0
- /package/dist/react/{types → cjs/types}/builder-block.js +0 -0
- /package/dist/react/{types → cjs/types}/builder-content.js +0 -0
- /package/dist/react/{types → cjs/types}/can-track.js +0 -0
- /package/dist/react/{types → cjs/types}/components.js +0 -0
- /package/dist/react/{types → cjs/types}/deep-partial.js +0 -0
- /package/dist/react/{types → cjs/types}/element.js +0 -0
- /package/dist/react/{types → cjs/types}/input.js +0 -0
- /package/dist/react/{types → cjs/types}/targets.js +0 -0
- /package/dist/react/{types → cjs/types}/typescript.js +0 -0
- /package/dist/react/{blocks → esm/blocks}/button/component-info.js +0 -0
- /package/dist/react/{blocks → esm/blocks}/columns/component-info.js +0 -0
- /package/dist/react/{blocks → esm/blocks}/custom-code/component-info.js +0 -0
- /package/dist/react/{blocks → esm/blocks}/embed/component-info.js +0 -0
- /package/dist/react/{blocks → esm/blocks}/embed/helpers.js +0 -0
- /package/dist/react/{blocks → esm/blocks}/form/component-info.js +0 -0
- /package/dist/react/{blocks → esm/blocks}/fragment/component-info.js +0 -0
- /package/dist/react/{blocks → esm/blocks}/image/component-info.js +0 -0
- /package/dist/react/{blocks → esm/blocks}/image/image.helpers.js +0 -0
- /package/dist/react/{blocks → esm/blocks}/img/component-info.js +0 -0
- /package/dist/react/{blocks → esm/blocks}/input/component-info.js +0 -0
- /package/dist/react/{blocks → esm/blocks}/raw-text/component-info.js +0 -0
- /package/dist/react/{blocks → esm/blocks}/section/component-info.js +0 -0
- /package/dist/react/{blocks → esm/blocks}/select/component-info.js +0 -0
- /package/dist/react/{blocks → esm/blocks}/submit-button/component-info.js +0 -0
- /package/dist/react/{blocks → esm/blocks}/symbol/component-info.js +0 -0
- /package/dist/react/{blocks → esm/blocks}/text/component-info.js +0 -0
- /package/dist/react/{blocks → esm/blocks}/textarea/component-info.js +0 -0
- /package/dist/react/{blocks → esm/blocks}/util.js +0 -0
- /package/dist/react/{blocks → esm/blocks}/video/component-info.js +0 -0
- /package/dist/react/{components → esm/components}/render-block/render-block.helpers.js +0 -0
- /package/dist/react/{components → esm/components}/render-content/components/render-styles.helpers.js +0 -0
- /package/dist/react/{components → esm/components}/render-content/index.js +0 -0
- /package/dist/react/{components → esm/components}/render-content/render-content.helpers.js +0 -0
- /package/dist/react/{constants → esm/constants}/builder-registered-components.js +0 -0
- /package/dist/react/{constants → esm/constants}/device-sizes.js +0 -0
- /package/dist/react/{constants → esm/constants}/target.js +0 -0
- /package/dist/react/{context → esm/context}/builder.context.js +0 -0
- /package/dist/react/{functions → esm/functions}/camel-to-kebab-case.js +0 -0
- /package/dist/react/{functions → esm/functions}/evaluate.js +0 -0
- /package/dist/react/{functions → esm/functions}/event-handler-name.js +0 -0
- /package/dist/react/{functions → esm/functions}/extract-text-styles.js +0 -0
- /package/dist/react/{functions → esm/functions}/fast-clone.js +0 -0
- /package/dist/react/{functions → esm/functions}/get-block-actions-handler.js +0 -0
- /package/dist/react/{functions → esm/functions}/get-block-actions.js +0 -0
- /package/dist/react/{functions → esm/functions}/get-block-component-options.js +0 -0
- /package/dist/react/{functions → esm/functions}/get-block-properties.js +0 -0
- /package/dist/react/{functions → esm/functions}/get-builder-search-params/fn.test.js +0 -0
- /package/dist/react/{functions → esm/functions}/get-builder-search-params/index.js +0 -0
- /package/dist/react/{functions → esm/functions}/get-content/ab-testing.js +0 -0
- /package/dist/react/{functions → esm/functions}/get-content/generate-content-url.js +0 -0
- /package/dist/react/{functions → esm/functions}/get-content/generate-content-url.test.js +0 -0
- /package/dist/react/{functions → esm/functions}/get-fetch.js +0 -0
- /package/dist/react/{functions → esm/functions}/get-global-this.js +0 -0
- /package/dist/react/{functions → esm/functions}/get-processed-block.js +0 -0
- /package/dist/react/{functions → esm/functions}/get-processed-block.test.js +0 -0
- /package/dist/react/{functions → esm/functions}/get-react-native-block-styles.js +0 -0
- /package/dist/react/{functions → esm/functions}/if-target.js +0 -0
- /package/dist/react/{functions → esm/functions}/is-browser.js +0 -0
- /package/dist/react/{functions → esm/functions}/is-editing.js +0 -0
- /package/dist/react/{functions → esm/functions}/is-iframe.js +0 -0
- /package/dist/react/{functions → esm/functions}/is-previewing.js +0 -0
- /package/dist/react/{functions → esm/functions}/on-change.js +0 -0
- /package/dist/react/{functions → esm/functions}/on-change.test.js +0 -0
- /package/dist/react/{functions → esm/functions}/register-component.js +0 -0
- /package/dist/react/{functions → esm/functions}/register.js +0 -0
- /package/dist/react/{functions → esm/functions}/sanitize-react-native-block-styles.js +0 -0
- /package/dist/react/{functions → esm/functions}/set-editor-settings.js +0 -0
- /package/dist/react/{functions → esm/functions}/set.js +0 -0
- /package/dist/react/{functions → esm/functions}/set.test.js +0 -0
- /package/dist/react/{functions → esm/functions}/track/helpers.js +0 -0
- /package/dist/react/{functions → esm/functions}/track/index.js +0 -0
- /package/dist/react/{functions → esm/functions}/track/interaction.js +0 -0
- /package/dist/react/{functions → esm/functions}/transform-block-properties.js +0 -0
- /package/dist/react/{functions → esm/functions}/transform-block.js +0 -0
- /package/dist/react/{helpers → esm/helpers}/ab-tests.js +0 -0
- /package/dist/react/{helpers → esm/helpers}/cookie.js +0 -0
- /package/dist/react/{helpers → esm/helpers}/css.js +0 -0
- /package/dist/react/{helpers → esm/helpers}/flatten.js +0 -0
- /package/dist/react/{helpers → esm/helpers}/localStorage.js +0 -0
- /package/dist/react/{helpers → esm/helpers}/logger.js +0 -0
- /package/dist/react/{helpers → esm/helpers}/nullable.js +0 -0
- /package/dist/react/{helpers → esm/helpers}/sessionId.js +0 -0
- /package/dist/react/{helpers → esm/helpers}/time.js +0 -0
- /package/dist/react/{helpers → esm/helpers}/url.js +0 -0
- /package/dist/react/{helpers → esm/helpers}/url.test.js +0 -0
- /package/dist/react/{helpers → esm/helpers}/uuid.js +0 -0
- /package/dist/react/{helpers → esm/helpers}/visitorId.js +0 -0
- /package/dist/react/{index-helpers → esm/index-helpers}/top-of-file.js +0 -0
- /package/dist/react/{index.js → esm/index.js} +0 -0
- /package/dist/react/{scripts → esm/scripts}/init-editing.js +0 -0
- /package/dist/react/{types → esm/types}/api-version.js +0 -0
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getFontCss = exports.getCss = void 0;
|
|
4
|
+
const getCssFromFont = (font) => {
|
|
5
|
+
var _a, _b;
|
|
6
|
+
const family = font.family + (font.kind && !font.kind.includes("#") ? ", " + font.kind : "");
|
|
7
|
+
const name = family.split(",")[0];
|
|
8
|
+
const url = (_b = font.fileUrl) != null ? _b : (_a = font == null ? void 0 : font.files) == null ? void 0 : _a.regular;
|
|
9
|
+
let str = "";
|
|
10
|
+
if (url && family && name) {
|
|
11
|
+
str += `
|
|
12
|
+
@font-face {
|
|
13
|
+
font-family: "${family}";
|
|
14
|
+
src: local("${name}"), url('${url}') format('woff2');
|
|
15
|
+
font-display: fallback;
|
|
16
|
+
font-weight: 400;
|
|
17
|
+
}
|
|
18
|
+
`.trim();
|
|
19
|
+
}
|
|
20
|
+
if (font.files) {
|
|
21
|
+
for (const weight in font.files) {
|
|
22
|
+
const isNumber = String(Number(weight)) === weight;
|
|
23
|
+
if (!isNumber) {
|
|
24
|
+
continue;
|
|
25
|
+
}
|
|
26
|
+
const weightUrl = font.files[weight];
|
|
27
|
+
if (weightUrl && weightUrl !== url) {
|
|
28
|
+
str += `
|
|
29
|
+
@font-face {
|
|
30
|
+
font-family: "${family}";
|
|
31
|
+
src: url('${weightUrl}') format('woff2');
|
|
32
|
+
font-display: fallback;
|
|
33
|
+
font-weight: ${weight};
|
|
34
|
+
}
|
|
35
|
+
`.trim();
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return str;
|
|
40
|
+
};
|
|
41
|
+
const getFontCss = ({ customFonts }) => {
|
|
42
|
+
var _a;
|
|
43
|
+
return ((_a = customFonts == null ? void 0 : customFonts.map((font) => getCssFromFont(font))) == null ? void 0 : _a.join(" ")) || "";
|
|
44
|
+
};
|
|
45
|
+
exports.getFontCss = getFontCss;
|
|
46
|
+
const getCss = ({ cssCode, contentId }) => {
|
|
47
|
+
if (!cssCode) {
|
|
48
|
+
return "";
|
|
49
|
+
}
|
|
50
|
+
if (!contentId) {
|
|
51
|
+
return cssCode;
|
|
52
|
+
}
|
|
53
|
+
return (cssCode == null ? void 0 : cssCode.replace(/&/g, `div[builder-content-id="${contentId}"]`)) || "";
|
|
54
|
+
};
|
|
55
|
+
exports.getCss = getCss;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
const React = require("react");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const render_inlined_styles_1 = require("../../render-inlined-styles");
|
|
7
|
+
const render_styles_helpers_1 = require("./render-styles.helpers");
|
|
8
|
+
const render_styles_helpers_2 = require("./render-styles.helpers");
|
|
9
|
+
function RenderContentStyles(props) {
|
|
10
|
+
const [injectedStyles, setInjectedStyles] = (0, react_1.useState)(() => `
|
|
11
|
+
${(0, render_styles_helpers_1.getCss)({
|
|
12
|
+
cssCode: props.cssCode,
|
|
13
|
+
contentId: props.contentId,
|
|
14
|
+
})}
|
|
15
|
+
${(0, render_styles_helpers_2.getFontCss)({
|
|
16
|
+
customFonts: props.customFonts,
|
|
17
|
+
})}
|
|
18
|
+
|
|
19
|
+
.builder-text > p:first-of-type, .builder-text > .builder-paragraph:first-of-type {
|
|
20
|
+
margin: 0;
|
|
21
|
+
}
|
|
22
|
+
.builder-text > p, .builder-text > .builder-paragraph {
|
|
23
|
+
color: inherit;
|
|
24
|
+
line-height: inherit;
|
|
25
|
+
letter-spacing: inherit;
|
|
26
|
+
font-weight: inherit;
|
|
27
|
+
font-size: inherit;
|
|
28
|
+
text-align: inherit;
|
|
29
|
+
font-family: inherit;
|
|
30
|
+
}
|
|
31
|
+
`);
|
|
32
|
+
return React.createElement(render_inlined_styles_1.default, { styles: injectedStyles });
|
|
33
|
+
}
|
|
34
|
+
exports.default = RenderContentStyles;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = void 0;
|
|
4
|
+
const render_content_1 = require("./render-content");
|
|
5
|
+
Object.defineProperty(exports, "default", { enumerable: true, get: function () { return render_content_1.default; } });
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getContextStateInitialValue = exports.getContentInitialValue = void 0;
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __defProps = Object.defineProperties;
|
|
6
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
7
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
10
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
11
|
+
var __spreadValues = (a, b) => {
|
|
12
|
+
for (var prop in b || (b = {}))
|
|
13
|
+
if (__hasOwnProp.call(b, prop))
|
|
14
|
+
__defNormalProp(a, prop, b[prop]);
|
|
15
|
+
if (__getOwnPropSymbols)
|
|
16
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
17
|
+
if (__propIsEnum.call(b, prop))
|
|
18
|
+
__defNormalProp(a, prop, b[prop]);
|
|
19
|
+
}
|
|
20
|
+
return a;
|
|
21
|
+
};
|
|
22
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
23
|
+
const getContextStateInitialValue = ({ content, data, locale }) => {
|
|
24
|
+
var _a, _b, _c;
|
|
25
|
+
const defaultValues = {};
|
|
26
|
+
(_b = (_a = content == null ? void 0 : content.data) == null ? void 0 : _a.inputs) == null ? void 0 : _b.forEach((input) => {
|
|
27
|
+
var _a2;
|
|
28
|
+
if (input.name && input.defaultValue !== void 0 && ((_a2 = content == null ? void 0 : content.data) == null ? void 0 : _a2.state) && content.data.state[input.name] === void 0) {
|
|
29
|
+
defaultValues[input.name] = input.defaultValue;
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
const stateToUse = __spreadValues(__spreadValues(__spreadValues({}, (_c = content == null ? void 0 : content.data) == null ? void 0 : _c.state), data), locale ? { locale } : {});
|
|
33
|
+
return __spreadValues(__spreadValues({}, defaultValues), stateToUse);
|
|
34
|
+
};
|
|
35
|
+
exports.getContextStateInitialValue = getContextStateInitialValue;
|
|
36
|
+
const getContentInitialValue = ({ content, data }) => {
|
|
37
|
+
return !content ? void 0 : __spreadProps(__spreadValues({}, content), {
|
|
38
|
+
data: __spreadValues(__spreadValues({}, content == null ? void 0 : content.data), data),
|
|
39
|
+
meta: content == null ? void 0 : content.meta
|
|
40
|
+
});
|
|
41
|
+
};
|
|
42
|
+
exports.getContentInitialValue = getContentInitialValue;
|
|
@@ -0,0 +1,297 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
const React = require("react");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const builder_registered_components_js_1 = require("../../constants/builder-registered-components.js");
|
|
7
|
+
const evaluate_js_1 = require("../../functions/evaluate.js");
|
|
8
|
+
const index_js_1 = require("../../functions/get-content/index.js");
|
|
9
|
+
const get_fetch_js_1 = require("../../functions/get-fetch.js");
|
|
10
|
+
const is_browser_js_1 = require("../../functions/is-browser.js");
|
|
11
|
+
const is_editing_js_1 = require("../../functions/is-editing.js");
|
|
12
|
+
const is_previewing_js_1 = require("../../functions/is-previewing.js");
|
|
13
|
+
const register_component_js_1 = require("../../functions/register-component.js");
|
|
14
|
+
const index_js_2 = require("../../functions/track/index.js");
|
|
15
|
+
const render_blocks_1 = require("../render-blocks");
|
|
16
|
+
const render_styles_1 = require("./components/render-styles");
|
|
17
|
+
const builder_context_js_1 = require("../../context/builder.context.js");
|
|
18
|
+
const init_editing_js_1 = require("../../scripts/init-editing.js");
|
|
19
|
+
const nullable_js_1 = require("../../helpers/nullable.js");
|
|
20
|
+
const interaction_js_1 = require("../../functions/track/interaction.js");
|
|
21
|
+
const render_content_helpers_js_1 = require("./render-content.helpers.js");
|
|
22
|
+
const target_js_1 = require("../../constants/target.js");
|
|
23
|
+
const logger_js_1 = require("../../helpers/logger.js");
|
|
24
|
+
function RenderContent(props) {
|
|
25
|
+
const elementRef = (0, react_1.useRef)(null);
|
|
26
|
+
const [forceReRenderCount, setForceReRenderCount] = (0, react_1.useState)(() => 0);
|
|
27
|
+
const [overrideContent, setOverrideContent] = (0, react_1.useState)(() => null);
|
|
28
|
+
const [useContent, setUseContent] = (0, react_1.useState)(() => (0, render_content_helpers_js_1.getContentInitialValue)({
|
|
29
|
+
content: props.content,
|
|
30
|
+
data: props.data,
|
|
31
|
+
}));
|
|
32
|
+
function mergeNewContent(newContent) {
|
|
33
|
+
setUseContent({
|
|
34
|
+
...useContent,
|
|
35
|
+
...newContent,
|
|
36
|
+
data: {
|
|
37
|
+
...useContent?.data,
|
|
38
|
+
...newContent?.data,
|
|
39
|
+
},
|
|
40
|
+
meta: {
|
|
41
|
+
...useContent?.meta,
|
|
42
|
+
...newContent?.meta,
|
|
43
|
+
breakpoints: newContent?.meta?.breakpoints || useContent?.meta?.breakpoints,
|
|
44
|
+
},
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
function setBreakpoints(breakpoints) {
|
|
48
|
+
setUseContent({
|
|
49
|
+
...useContent,
|
|
50
|
+
meta: {
|
|
51
|
+
...useContent?.meta,
|
|
52
|
+
breakpoints,
|
|
53
|
+
},
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
const [update, setUpdate] = (0, react_1.useState)(() => 0);
|
|
57
|
+
const [canTrackToUse, setCanTrackToUse] = (0, react_1.useState)(() => (0, nullable_js_1.checkIsDefined)(props.canTrack) ? props.canTrack : true);
|
|
58
|
+
const [contentState, setContentState] = (0, react_1.useState)(() => (0, render_content_helpers_js_1.getContextStateInitialValue)({
|
|
59
|
+
content: props.content,
|
|
60
|
+
data: props.data,
|
|
61
|
+
locale: props.locale,
|
|
62
|
+
}));
|
|
63
|
+
function setContextState(newState) {
|
|
64
|
+
setContentState(newState);
|
|
65
|
+
}
|
|
66
|
+
const [allRegisteredComponents, setAllRegisteredComponents] = (0, react_1.useState)(() => [
|
|
67
|
+
...(0, builder_registered_components_js_1.getDefaultRegisteredComponents)(),
|
|
68
|
+
// While this `components` object is deprecated, we must maintain support for it.
|
|
69
|
+
// Since users are able to override our default components, we need to make sure that we do not break such
|
|
70
|
+
// existing usage.
|
|
71
|
+
// This is why we spread `components` after the default Builder.io components, but before the `props.customComponents`,
|
|
72
|
+
// which is the new standard way of providing custom components, and must therefore take precedence.
|
|
73
|
+
...register_component_js_1.components,
|
|
74
|
+
...(props.customComponents || []),
|
|
75
|
+
].reduce((acc, curr) => ({
|
|
76
|
+
...acc,
|
|
77
|
+
[curr.name]: curr,
|
|
78
|
+
}), {}));
|
|
79
|
+
function processMessage(event) {
|
|
80
|
+
const { data } = event;
|
|
81
|
+
if (data) {
|
|
82
|
+
switch (data.type) {
|
|
83
|
+
case "builder.configureSdk": {
|
|
84
|
+
const messageContent = data.data;
|
|
85
|
+
const { breakpoints, contentId } = messageContent;
|
|
86
|
+
if (!contentId || contentId !== useContent?.id) {
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
if (breakpoints) {
|
|
90
|
+
setBreakpoints(breakpoints);
|
|
91
|
+
}
|
|
92
|
+
setForceReRenderCount(forceReRenderCount + 1); // This is a hack to force Qwik to re-render.
|
|
93
|
+
break;
|
|
94
|
+
}
|
|
95
|
+
case "builder.contentUpdate": {
|
|
96
|
+
const messageContent = data.data;
|
|
97
|
+
const key = messageContent.key ||
|
|
98
|
+
messageContent.alias ||
|
|
99
|
+
messageContent.entry ||
|
|
100
|
+
messageContent.modelName;
|
|
101
|
+
const contentData = messageContent.data;
|
|
102
|
+
if (key === props.model) {
|
|
103
|
+
mergeNewContent(contentData);
|
|
104
|
+
setForceReRenderCount(forceReRenderCount + 1); // This is a hack to force Qwik to re-render.
|
|
105
|
+
}
|
|
106
|
+
break;
|
|
107
|
+
}
|
|
108
|
+
case "builder.patchUpdates": {
|
|
109
|
+
// TODO
|
|
110
|
+
break;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
function evaluateJsCode() {
|
|
116
|
+
// run any dynamic JS code attached to content
|
|
117
|
+
const jsCode = useContent?.data?.jsCode;
|
|
118
|
+
if (jsCode) {
|
|
119
|
+
(0, evaluate_js_1.evaluate)({
|
|
120
|
+
code: jsCode,
|
|
121
|
+
context: props.context || {},
|
|
122
|
+
state: contentState,
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
const [httpReqsData, setHttpReqsData] = (0, react_1.useState)(() => ({}));
|
|
127
|
+
const [clicked, setClicked] = (0, react_1.useState)(() => false);
|
|
128
|
+
function onClick(event) {
|
|
129
|
+
if (useContent) {
|
|
130
|
+
const variationId = useContent?.testVariationId;
|
|
131
|
+
const contentId = useContent?.id;
|
|
132
|
+
(0, index_js_2._track)({
|
|
133
|
+
type: "click",
|
|
134
|
+
canTrack: canTrackToUse,
|
|
135
|
+
contentId,
|
|
136
|
+
apiKey: props.apiKey,
|
|
137
|
+
variationId: variationId !== contentId ? variationId : undefined,
|
|
138
|
+
...(0, interaction_js_1.getInteractionPropertiesForEvent)(event),
|
|
139
|
+
unique: !clicked,
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
if (!clicked) {
|
|
143
|
+
setClicked(true);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
function evalExpression(expression) {
|
|
147
|
+
return expression.replace(/{{([^}]+)}}/g, (_match, group) => (0, evaluate_js_1.evaluate)({
|
|
148
|
+
code: group,
|
|
149
|
+
context: props.context || {},
|
|
150
|
+
state: contentState,
|
|
151
|
+
}));
|
|
152
|
+
}
|
|
153
|
+
function handleRequest({ url, key }) {
|
|
154
|
+
(0, get_fetch_js_1.fetch)(url)
|
|
155
|
+
.then((response) => response.json())
|
|
156
|
+
.then((json) => {
|
|
157
|
+
const newState = {
|
|
158
|
+
...contentState,
|
|
159
|
+
[key]: json,
|
|
160
|
+
};
|
|
161
|
+
setContextState(newState);
|
|
162
|
+
})
|
|
163
|
+
.catch((err) => {
|
|
164
|
+
console.error("error fetching dynamic data", url, err);
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
function runHttpRequests() {
|
|
168
|
+
const requests = useContent?.data?.httpRequests ?? {};
|
|
169
|
+
Object.entries(requests).forEach(([key, url]) => {
|
|
170
|
+
if (url && (!httpReqsData[key] || (0, is_editing_js_1.isEditing)())) {
|
|
171
|
+
const evaluatedUrl = evalExpression(url);
|
|
172
|
+
handleRequest({
|
|
173
|
+
url: evaluatedUrl,
|
|
174
|
+
key,
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
function emitStateUpdate() {
|
|
180
|
+
if ((0, is_editing_js_1.isEditing)()) {
|
|
181
|
+
window.dispatchEvent(new CustomEvent("builder:component:stateChange", {
|
|
182
|
+
detail: {
|
|
183
|
+
state: contentState,
|
|
184
|
+
ref: {
|
|
185
|
+
name: props.model,
|
|
186
|
+
},
|
|
187
|
+
},
|
|
188
|
+
}));
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
(0, react_1.useEffect)(() => {
|
|
192
|
+
if (!props.apiKey) {
|
|
193
|
+
logger_js_1.logger.error("No API key provided to `RenderContent` component. This can cause issues. Please provide an API key using the `apiKey` prop.");
|
|
194
|
+
}
|
|
195
|
+
if ((0, is_browser_js_1.isBrowser)()) {
|
|
196
|
+
if ((0, is_editing_js_1.isEditing)()) {
|
|
197
|
+
setForceReRenderCount(forceReRenderCount + 1);
|
|
198
|
+
(0, init_editing_js_1.registerInsertMenu)();
|
|
199
|
+
(0, init_editing_js_1.setupBrowserForEditing)({
|
|
200
|
+
...(props.locale
|
|
201
|
+
? {
|
|
202
|
+
locale: props.locale,
|
|
203
|
+
}
|
|
204
|
+
: {}),
|
|
205
|
+
...(props.includeRefs
|
|
206
|
+
? {
|
|
207
|
+
includeRefs: props.includeRefs,
|
|
208
|
+
}
|
|
209
|
+
: {}),
|
|
210
|
+
});
|
|
211
|
+
Object.values(allRegisteredComponents).forEach((registeredComponent) => {
|
|
212
|
+
const message = (0, register_component_js_1.createRegisterComponentMessage)(registeredComponent);
|
|
213
|
+
window.parent?.postMessage(message, "*");
|
|
214
|
+
});
|
|
215
|
+
window.addEventListener("message", processMessage);
|
|
216
|
+
window.addEventListener("builder:component:stateChangeListenerActivated", emitStateUpdate);
|
|
217
|
+
}
|
|
218
|
+
if (useContent) {
|
|
219
|
+
const variationId = useContent?.testVariationId;
|
|
220
|
+
const contentId = useContent?.id;
|
|
221
|
+
(0, index_js_2._track)({
|
|
222
|
+
type: "impression",
|
|
223
|
+
canTrack: canTrackToUse,
|
|
224
|
+
contentId,
|
|
225
|
+
apiKey: props.apiKey,
|
|
226
|
+
variationId: variationId !== contentId ? variationId : undefined,
|
|
227
|
+
});
|
|
228
|
+
}
|
|
229
|
+
// override normal content in preview mode
|
|
230
|
+
if ((0, is_previewing_js_1.isPreviewing)()) {
|
|
231
|
+
const searchParams = new URL(location.href).searchParams;
|
|
232
|
+
const searchParamPreviewModel = searchParams.get("builder.preview");
|
|
233
|
+
const searchParamPreviewId = searchParams.get(`builder.preview.${searchParamPreviewModel}`);
|
|
234
|
+
const previewApiKey = searchParams.get("apiKey") || searchParams.get("builder.space");
|
|
235
|
+
/**
|
|
236
|
+
* Make sure that:
|
|
237
|
+
* - the preview model name is the same as the one we're rendering, since there can be multiple models rendered * at the same time, e.g. header/page/footer. * - the API key is the same, since we don't want to preview content from other organizations.
|
|
238
|
+
* - if there is content, that the preview ID is the same as that of the one we receive.
|
|
239
|
+
*
|
|
240
|
+
* TO-DO: should we only update the state when there is a change?
|
|
241
|
+
**/
|
|
242
|
+
if (searchParamPreviewModel === props.model &&
|
|
243
|
+
previewApiKey === props.apiKey &&
|
|
244
|
+
(!props.content || searchParamPreviewId === props.content.id)) {
|
|
245
|
+
(0, index_js_1.getContent)({
|
|
246
|
+
model: props.model,
|
|
247
|
+
apiKey: props.apiKey,
|
|
248
|
+
apiVersion: props.apiVersion,
|
|
249
|
+
}).then((content) => {
|
|
250
|
+
if (content) {
|
|
251
|
+
mergeNewContent(content);
|
|
252
|
+
}
|
|
253
|
+
});
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
evaluateJsCode();
|
|
257
|
+
runHttpRequests();
|
|
258
|
+
emitStateUpdate();
|
|
259
|
+
}
|
|
260
|
+
}, []);
|
|
261
|
+
(0, react_1.useEffect)(() => {
|
|
262
|
+
if (props.content) {
|
|
263
|
+
mergeNewContent(props.content);
|
|
264
|
+
}
|
|
265
|
+
}, [props.content]);
|
|
266
|
+
(0, react_1.useEffect)(() => {
|
|
267
|
+
evaluateJsCode();
|
|
268
|
+
}, [useContent?.data?.jsCode, contentState]);
|
|
269
|
+
(0, react_1.useEffect)(() => {
|
|
270
|
+
runHttpRequests();
|
|
271
|
+
}, [useContent?.data?.httpRequests]);
|
|
272
|
+
(0, react_1.useEffect)(() => {
|
|
273
|
+
emitStateUpdate();
|
|
274
|
+
}, [contentState]);
|
|
275
|
+
(0, react_1.useEffect)(() => {
|
|
276
|
+
return () => {
|
|
277
|
+
if ((0, is_browser_js_1.isBrowser)()) {
|
|
278
|
+
window.removeEventListener("message", processMessage);
|
|
279
|
+
window.removeEventListener("builder:component:stateChangeListenerActivated", emitStateUpdate);
|
|
280
|
+
}
|
|
281
|
+
};
|
|
282
|
+
}, []);
|
|
283
|
+
return (React.createElement(builder_context_js_1.default.Provider, { value: {
|
|
284
|
+
content: useContent,
|
|
285
|
+
state: contentState,
|
|
286
|
+
setState: setContextState,
|
|
287
|
+
context: props.context || {},
|
|
288
|
+
apiKey: props.apiKey,
|
|
289
|
+
apiVersion: props.apiVersion,
|
|
290
|
+
registeredComponents: allRegisteredComponents,
|
|
291
|
+
} }, useContent ? (React.createElement(React.Fragment, null,
|
|
292
|
+
React.createElement("div", { ref: elementRef, onClick: (event) => onClick(event), "builder-content-id": useContent?.id, "builder-model": props.model },
|
|
293
|
+
target_js_1.TARGET !== "reactNative" ? (React.createElement(React.Fragment, null,
|
|
294
|
+
React.createElement(render_styles_1.default, { contentId: useContent?.id, cssCode: useContent?.data?.cssCode, customFonts: useContent?.data?.customFonts }))) : null,
|
|
295
|
+
React.createElement(render_blocks_1.default, { blocks: useContent?.data?.blocks, key: forceReRenderCount })))) : null));
|
|
296
|
+
}
|
|
297
|
+
exports.default = RenderContent;
|
|
File without changes
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
const React = require("react");
|
|
5
|
+
const target_js_1 = require("../constants/target.js");
|
|
6
|
+
function RenderInlinedStyles(props) {
|
|
7
|
+
function tag() {
|
|
8
|
+
// NOTE: we have to obfusctate the name of the tag due to a limitation in the svelte-preprocessor plugin.
|
|
9
|
+
// https://github.com/sveltejs/vite-plugin-svelte/issues/315#issuecomment-1109000027
|
|
10
|
+
return "sty" + "le";
|
|
11
|
+
}
|
|
12
|
+
function injectedStyleScript() {
|
|
13
|
+
return `<${tag()}>${props.styles}</${tag()}>`;
|
|
14
|
+
}
|
|
15
|
+
const TagRef = tag();
|
|
16
|
+
return (React.createElement(React.Fragment, null, target_js_1.TARGET === "svelte" || target_js_1.TARGET === "qwik" ? (React.createElement(React.Fragment, null,
|
|
17
|
+
React.createElement(TagRef, { dangerouslySetInnerHTML: { __html: props.styles } }))) : (React.createElement(TagRef, null, props.styles))));
|
|
18
|
+
}
|
|
19
|
+
exports.default = RenderInlinedStyles;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function getDefaultRegisteredComponents(): any[];
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getDefaultRegisteredComponents = void 0;
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
8
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
9
|
+
var __spreadValues = (a, b) => {
|
|
10
|
+
for (var prop in b || (b = {}))
|
|
11
|
+
if (__hasOwnProp.call(b, prop))
|
|
12
|
+
__defNormalProp(a, prop, b[prop]);
|
|
13
|
+
if (__getOwnPropSymbols)
|
|
14
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
15
|
+
if (__propIsEnum.call(b, prop))
|
|
16
|
+
__defNormalProp(a, prop, b[prop]);
|
|
17
|
+
}
|
|
18
|
+
return a;
|
|
19
|
+
};
|
|
20
|
+
const button_1 = require("../blocks/button/button");
|
|
21
|
+
const component_info_js_1 = require("../blocks/button/component-info.js");
|
|
22
|
+
const columns_1 = require("../blocks/columns/columns");
|
|
23
|
+
const component_info_js_2 = require("../blocks/columns/component-info.js");
|
|
24
|
+
const component_info_js_3 = require("../blocks/fragment/component-info.js");
|
|
25
|
+
const fragment_1 = require("../blocks/fragment/fragment");
|
|
26
|
+
const component_info_js_4 = require("../blocks/image/component-info.js");
|
|
27
|
+
const image_1 = require("../blocks/image/image");
|
|
28
|
+
const component_info_js_5 = require("../blocks/section/component-info.js");
|
|
29
|
+
const section_1 = require("../blocks/section/section");
|
|
30
|
+
const component_info_js_6 = require("../blocks/symbol/component-info.js");
|
|
31
|
+
const symbol_1 = require("../blocks/symbol/symbol");
|
|
32
|
+
const component_info_js_7 = require("../blocks/text/component-info.js");
|
|
33
|
+
const text_1 = require("../blocks/text/text");
|
|
34
|
+
const component_info_js_8 = require("../blocks/video/component-info.js");
|
|
35
|
+
const video_1 = require("../blocks/video/video");
|
|
36
|
+
const component_info_js_9 = require("../blocks/embed/component-info.js");
|
|
37
|
+
const embed_1 = require("../blocks/embed/embed");
|
|
38
|
+
const img_1 = require("../blocks/img/img");
|
|
39
|
+
const component_info_js_10 = require("../blocks/img/component-info.js");
|
|
40
|
+
const custom_code_1 = require("../blocks/custom-code/custom-code");
|
|
41
|
+
const component_info_js_11 = require("../blocks/custom-code/component-info.js");
|
|
42
|
+
const getDefaultRegisteredComponents = () => [
|
|
43
|
+
__spreadValues({ component: button_1.default }, component_info_js_1.componentInfo),
|
|
44
|
+
__spreadValues({ component: columns_1.default }, component_info_js_2.componentInfo),
|
|
45
|
+
__spreadValues({ component: custom_code_1.default }, component_info_js_11.componentInfo),
|
|
46
|
+
__spreadValues({ component: embed_1.default }, component_info_js_9.componentInfo),
|
|
47
|
+
__spreadValues({ component: fragment_1.default }, component_info_js_3.componentInfo),
|
|
48
|
+
__spreadValues({ component: image_1.default }, component_info_js_4.componentInfo),
|
|
49
|
+
__spreadValues({ component: img_1.default }, component_info_js_10.componentInfo),
|
|
50
|
+
__spreadValues({ component: section_1.default }, component_info_js_5.componentInfo),
|
|
51
|
+
__spreadValues({ component: symbol_1.default }, component_info_js_6.componentInfo),
|
|
52
|
+
__spreadValues({ component: text_1.default }, component_info_js_7.componentInfo),
|
|
53
|
+
__spreadValues({ component: video_1.default }, component_info_js_8.componentInfo)
|
|
54
|
+
];
|
|
55
|
+
exports.getDefaultRegisteredComponents = getDefaultRegisteredComponents;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export function getMaxWidthQueryForSize(size: any, sizeValues?: {
|
|
2
|
+
small: {
|
|
3
|
+
min: number;
|
|
4
|
+
default: number;
|
|
5
|
+
max: number;
|
|
6
|
+
};
|
|
7
|
+
medium: {
|
|
8
|
+
min: number;
|
|
9
|
+
default: number;
|
|
10
|
+
max: number;
|
|
11
|
+
};
|
|
12
|
+
large: {
|
|
13
|
+
min: number;
|
|
14
|
+
default: number;
|
|
15
|
+
max: number;
|
|
16
|
+
};
|
|
17
|
+
}): string;
|
|
18
|
+
export function getSizesForBreakpoints({ small, medium }: {
|
|
19
|
+
small: any;
|
|
20
|
+
medium: any;
|
|
21
|
+
}): any;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getSizesForBreakpoints = exports.getMaxWidthQueryForSize = void 0;
|
|
4
|
+
const fast_clone_1 = require("../functions/fast-clone");
|
|
5
|
+
const SIZES = {
|
|
6
|
+
small: {
|
|
7
|
+
min: 320,
|
|
8
|
+
default: 321,
|
|
9
|
+
max: 640
|
|
10
|
+
},
|
|
11
|
+
medium: {
|
|
12
|
+
min: 641,
|
|
13
|
+
default: 642,
|
|
14
|
+
max: 991
|
|
15
|
+
},
|
|
16
|
+
large: {
|
|
17
|
+
min: 990,
|
|
18
|
+
default: 991,
|
|
19
|
+
max: 1200
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
const getMaxWidthQueryForSize = (size, sizeValues = SIZES) => `@media (max-width: ${sizeValues[size].max}px)`;
|
|
23
|
+
exports.getMaxWidthQueryForSize = getMaxWidthQueryForSize;
|
|
24
|
+
const getSizesForBreakpoints = ({ small, medium }) => {
|
|
25
|
+
const newSizes = (0, fast_clone_1.fastClone)(SIZES);
|
|
26
|
+
if (!small || !medium) {
|
|
27
|
+
return newSizes;
|
|
28
|
+
}
|
|
29
|
+
const smallMin = Math.floor(small / 2);
|
|
30
|
+
newSizes.small = {
|
|
31
|
+
max: small,
|
|
32
|
+
min: smallMin,
|
|
33
|
+
default: smallMin + 1
|
|
34
|
+
};
|
|
35
|
+
const mediumMin = newSizes.small.max + 1;
|
|
36
|
+
newSizes.medium = {
|
|
37
|
+
max: medium,
|
|
38
|
+
min: mediumMin,
|
|
39
|
+
default: mediumMin + 1
|
|
40
|
+
};
|
|
41
|
+
const largeMin = newSizes.medium.max + 1;
|
|
42
|
+
newSizes.large = {
|
|
43
|
+
max: 2e3,
|
|
44
|
+
min: largeMin,
|
|
45
|
+
default: largeMin + 1
|
|
46
|
+
};
|
|
47
|
+
return newSizes;
|
|
48
|
+
};
|
|
49
|
+
exports.getSizesForBreakpoints = getSizesForBreakpoints;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const TARGET: "react";
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = void 0;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
var stdin_default = (0, react_1.createContext)({
|
|
6
|
+
content: null,
|
|
7
|
+
context: {},
|
|
8
|
+
state: {},
|
|
9
|
+
setState() {
|
|
10
|
+
},
|
|
11
|
+
apiKey: null,
|
|
12
|
+
apiVersion: void 0,
|
|
13
|
+
registeredComponents: {},
|
|
14
|
+
inheritedStyles: {}
|
|
15
|
+
});
|
|
16
|
+
exports.default = stdin_default;
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function camelToKebabCase(string: any): any;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.camelToKebabCase = void 0;
|
|
4
|
+
const camelToKebabCase = (string) => string.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase();
|
|
5
|
+
exports.camelToKebabCase = camelToKebabCase;
|