@builder.io/sdk-react-native 0.4.4 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/blocks/button/button.js +6 -2
- package/dist/blocks/button/component-info.js +4 -8
- package/dist/blocks/columns/columns.js +19 -23
- package/dist/blocks/columns/component-info.js +27 -48
- package/dist/blocks/custom-code/component-info.js +4 -8
- package/dist/blocks/custom-code/custom-code.js +1 -1
- package/dist/blocks/embed/component-info.js +7 -11
- package/dist/blocks/embed/embed.js +1 -1
- package/dist/blocks/embed/helpers.js +2 -6
- package/dist/blocks/form/component-info.js +33 -69
- package/dist/blocks/form/form.js +2 -203
- package/dist/blocks/fragment/fragment.js +1 -1
- package/dist/blocks/helpers.js +33 -0
- package/dist/blocks/image/component-info.js +21 -47
- package/dist/blocks/image/image.helpers.js +2 -2
- package/dist/blocks/img/component-info.js +2 -4
- package/dist/blocks/img/img.js +2 -1
- package/dist/blocks/input/component-info.js +8 -34
- package/dist/blocks/input/input.js +2 -1
- package/dist/blocks/raw-text/component-info.js +2 -4
- package/dist/blocks/raw-text/raw-text.js +3 -2
- package/dist/blocks/section/component-info.js +5 -10
- package/dist/blocks/section/section.js +2 -1
- package/dist/blocks/select/component-info.js +12 -24
- package/dist/blocks/select/select.js +2 -1
- package/dist/blocks/submit-button/component-info.js +2 -4
- package/dist/blocks/submit-button/submit-button.js +2 -1
- package/dist/blocks/symbol/component-info.js +7 -12
- package/dist/blocks/symbol/symbol.helpers.js +66 -0
- package/dist/blocks/symbol/symbol.js +23 -50
- package/dist/blocks/text/component-info.js +3 -4
- package/dist/blocks/textarea/component-info.js +6 -12
- package/dist/blocks/textarea/textarea.js +2 -1
- package/dist/blocks/video/component-info.js +21 -41
- package/dist/components/block/block.helpers.js +102 -0
- package/dist/components/block/block.js +141 -0
- package/dist/components/block/components/block-styles.js +95 -0
- package/dist/components/block/components/block-wrapper/block-wrapper.js +41 -0
- package/dist/components/block/components/block-wrapper.js +56 -0
- package/dist/components/block/components/component-ref/component-ref.helpers.js +40 -0
- package/dist/components/block/components/component-ref/component-ref.js +63 -0
- package/dist/components/block/components/component-ref.js +81 -0
- package/dist/components/block/components/component.js +41 -0
- package/dist/components/block/components/interactive-element/interactive-element.helpers.js +35 -0
- package/dist/components/block/components/interactive-element/interactive-element.js +36 -0
- package/dist/components/block/components/interactive-element.js +46 -0
- package/dist/components/block/components/repeated-block.js +40 -0
- package/dist/components/block/types.js +1 -0
- package/dist/components/blocks/blocks-wrapper.js +69 -0
- package/dist/components/blocks/blocks.js +41 -0
- package/dist/components/content/builder-editing.js +32 -0
- package/dist/components/content/components/content-styles.helpers.js +55 -0
- package/dist/components/content/components/content-styles.js +61 -0
- package/dist/components/content/components/enable-editor.js +310 -0
- package/dist/components/content/components/styles.helpers.js +55 -0
- package/dist/components/content/components/styles.js +61 -0
- package/dist/components/content/content.helpers.js +49 -0
- package/dist/components/content/content.js +110 -0
- package/dist/components/content/content.types.js +1 -0
- package/dist/components/content/index.js +8 -0
- package/dist/components/content/wrap-component-ref.js +5 -0
- package/dist/components/content-variants/content-variants.js +77 -0
- package/dist/components/content-variants/content-variants.types.js +1 -0
- package/dist/components/content-variants/helpers.js +175 -0
- package/dist/components/inlined-script.js +32 -0
- package/dist/components/{render-inlined-styles.js → inlined-styles.js} +3 -3
- package/dist/components/render-block/block-styles.js +2 -2
- package/dist/components/render-content/components/render-styles.js +2 -2
- package/dist/components/render-content/render-content.js +10 -8
- package/dist/components/render-content-variants/helpers.js +49 -20
- package/dist/components/render-content-variants/render-content-variants.js +29 -24
- package/dist/components/render-content-variants/render-content-variants.types.js +1 -0
- package/dist/constants/device-sizes.js +2 -2
- package/dist/constants/sdk-version.js +1 -1
- package/dist/context/builder.context.js +1 -1
- package/dist/functions/apply-patch-with-mutation.js +75 -0
- package/dist/functions/apply-patch-with-mutation.test.js +55 -0
- package/dist/functions/camel-to-kebab-case.js +1 -1
- package/dist/functions/evaluate/acorn.js +1691 -0
- package/dist/functions/evaluate/evaluate.js +72 -0
- package/dist/functions/evaluate/index.js +5 -0
- package/dist/functions/evaluate/interpreter.js +2903 -0
- package/dist/functions/evaluate/non-node-runtime.js +97 -0
- package/dist/functions/evaluate/types.js +1 -0
- package/dist/functions/evaluate.test.js +12 -6
- package/dist/functions/event-handler-name.js +1 -1
- package/dist/functions/extract-text-styles.js +3 -9
- package/dist/functions/fast-clone.js +1 -1
- package/dist/functions/get-block-actions-handler.js +2 -2
- package/dist/functions/get-block-actions.js +14 -1
- package/dist/functions/get-block-component-options.js +6 -1
- package/dist/functions/get-block-properties.js +21 -8
- package/dist/functions/get-builder-search-params/fn.test.js +3 -3
- package/dist/functions/get-builder-search-params/index.js +4 -4
- package/dist/functions/get-content/generate-content-url.js +12 -5
- package/dist/functions/get-content/generate-content-url.test.js +31 -17
- package/dist/functions/get-content/index.js +36 -12
- package/dist/functions/get-content/processCookies.js +7 -0
- package/dist/functions/get-processed-block.js +8 -3
- package/dist/functions/get-processed-block.test.js +3 -1
- package/dist/functions/get-react-native-block-styles.js +6 -1
- package/dist/functions/is-non-node-server.js +12 -0
- package/dist/functions/on-change.test.js +13 -3
- package/dist/functions/register-component.js +24 -19
- package/dist/functions/sanitize-react-native-block-styles.js +17 -6
- package/dist/functions/set.test.js +9 -3
- package/dist/functions/track/helpers.js +5 -5
- package/dist/functions/track/index.js +29 -18
- package/dist/functions/track/interaction.js +10 -4
- package/dist/functions/transform-block-properties.js +2 -0
- package/dist/helpers/ab-tests.js +38 -14
- package/dist/helpers/canTrack.js +2 -2
- package/dist/helpers/css.js +2 -2
- package/dist/helpers/flatten.js +10 -7
- package/dist/helpers/nullable.js +1 -1
- package/dist/helpers/preview-lru-cache/get.js +11 -0
- package/dist/helpers/preview-lru-cache/helpers.js +13 -0
- package/dist/helpers/preview-lru-cache/init.js +13 -0
- package/dist/helpers/preview-lru-cache/set.js +37 -0
- package/dist/helpers/preview-lru-cache/types.js +1 -0
- package/dist/helpers/sessionId.js +13 -6
- package/dist/helpers/url.js +1 -1
- package/dist/helpers/visitorId.js +4 -1
- package/dist/index-helpers/blocks-exports.js +2 -2
- package/dist/scripts/init-editing.js +61 -46
- package/dist/types/builder-props.js +1 -0
- package/dist/types/enforced-partials.js +1 -0
- package/package.json +2 -2
- package/src/blocks/button/button.jsx +11 -2
- package/src/blocks/button/component-info.js +16 -22
- package/src/blocks/columns/columns.jsx +29 -28
- package/src/blocks/columns/component-info.js +203 -226
- package/src/blocks/custom-code/component-info.js +19 -25
- package/src/blocks/custom-code/custom-code.jsx +1 -1
- package/src/blocks/embed/component-info.js +31 -37
- package/src/blocks/embed/embed.jsx +1 -1
- package/src/blocks/embed/helpers.js +3 -9
- package/src/blocks/form/component-info.js +174 -212
- package/src/blocks/form/form.jsx +3 -247
- package/src/blocks/fragment/component-info.js +1 -3
- package/src/blocks/fragment/fragment.jsx +1 -1
- package/src/blocks/helpers.js +27 -0
- package/src/blocks/image/component-info.js +105 -133
- package/src/blocks/image/image.helpers.js +3 -5
- package/src/blocks/img/component-info.js +8 -12
- package/src/blocks/img/img.jsx +3 -1
- package/src/blocks/input/component-info.js +29 -57
- package/src/blocks/input/input.jsx +3 -1
- package/src/blocks/raw-text/component-info.js +7 -11
- package/src/blocks/raw-text/raw-text.jsx +4 -2
- package/src/blocks/section/component-info.js +24 -31
- package/src/blocks/section/section.jsx +3 -1
- package/src/blocks/select/component-info.js +34 -48
- package/src/blocks/select/select.jsx +3 -1
- package/src/blocks/submit-button/component-info.js +6 -10
- package/src/blocks/submit-button/submit-button.jsx +3 -2
- package/src/blocks/symbol/component-info.js +30 -37
- package/src/blocks/symbol/symbol.helpers.js +60 -0
- package/src/blocks/symbol/symbol.jsx +34 -59
- package/src/blocks/text/component-info.js +10 -13
- package/src/blocks/textarea/component-info.js +22 -30
- package/src/blocks/textarea/textarea.jsx +3 -1
- package/src/blocks/video/component-info.js +74 -96
- package/src/components/{render-block/render-block.helpers.js → block/block.helpers.js} +26 -44
- package/src/components/{render-block/render-block.jsx → block/block.jsx} +68 -81
- package/src/components/{render-block → block/components}/block-styles.jsx +19 -18
- package/src/components/block/components/block-wrapper.jsx +58 -0
- package/src/components/block/components/component-ref/component-ref.helpers.js +41 -0
- package/src/components/block/components/component-ref/component-ref.jsx +72 -0
- package/src/components/block/components/interactive-element.jsx +37 -0
- package/src/components/{render-block/render-repeated-block.jsx → block/components/repeated-block.jsx} +10 -6
- package/src/components/blocks/blocks-wrapper.jsx +74 -0
- package/src/components/blocks/blocks.jsx +51 -0
- package/src/components/{render-content/render-content.jsx → content/components/enable-editor.jsx} +81 -165
- package/src/components/{render-content/components/render-styles.helpers.js → content/components/styles.helpers.js} +6 -7
- package/src/components/{render-content/components/render-styles.jsx → content/components/styles.jsx} +7 -7
- package/src/components/{render-content/render-content.helpers.js → content/content.helpers.js} +15 -15
- package/src/components/content/content.jsx +141 -0
- package/src/components/content/content.types.js +0 -0
- package/src/components/content/index.js +2 -0
- package/src/components/content/wrap-component-ref.js +2 -0
- package/src/components/content-variants/content-variants.jsx +120 -0
- package/src/components/{render-content-variants → content-variants}/helpers.js +58 -41
- package/src/components/inlined-script.jsx +18 -0
- package/src/components/{render-inlined-styles.jsx → inlined-styles.jsx} +3 -3
- package/src/constants/device-sizes.js +6 -6
- package/src/constants/sdk-version.js +1 -1
- package/src/context/builder.context.js +1 -1
- package/src/functions/apply-patch-with-mutation.js +66 -0
- package/src/functions/camel-to-kebab-case.js +2 -4
- package/src/functions/evaluate/acorn.js +1595 -0
- package/src/functions/{evaluate.js → evaluate/evaluate.js} +36 -10
- package/src/functions/evaluate/index.js +2 -0
- package/src/functions/evaluate/interpreter.js +2801 -0
- package/src/functions/evaluate/non-node-runtime.js +92 -0
- package/src/functions/evaluate/types.js +0 -0
- package/src/functions/event-handler-name.js +2 -4
- package/src/functions/extract-text-styles.js +4 -12
- package/src/functions/fast-clone.js +2 -4
- package/src/functions/get-block-actions-handler.js +3 -5
- package/src/functions/get-block-actions.js +15 -4
- package/src/functions/get-block-component-options.js +11 -12
- package/src/functions/get-block-properties.js +29 -19
- package/src/functions/get-builder-search-params/index.js +5 -10
- package/src/functions/get-content/generate-content-url.js +17 -19
- package/src/functions/get-content/index.js +43 -29
- package/src/functions/get-fetch.js +1 -3
- package/src/functions/get-global-this.js +1 -3
- package/src/functions/get-processed-block.js +12 -13
- package/src/functions/get-react-native-block-styles.js +11 -12
- package/src/functions/if-target.js +1 -3
- package/src/functions/is-browser.js +1 -3
- package/src/functions/is-editing.js +1 -3
- package/src/functions/is-iframe.js +1 -3
- package/src/functions/is-non-node-server.js +9 -0
- package/src/functions/is-previewing.js +1 -3
- package/src/functions/on-change.js +1 -4
- package/src/functions/register-component.js +34 -42
- package/src/functions/register.js +1 -3
- package/src/functions/sanitize-react-native-block-styles.js +22 -17
- package/src/functions/set-editor-settings.js +1 -3
- package/src/functions/set.js +1 -3
- package/src/functions/track/helpers.js +3 -5
- package/src/functions/track/index.js +45 -43
- package/src/functions/track/interaction.js +11 -7
- package/src/functions/transform-block-properties.js +2 -0
- package/src/helpers/ab-tests.js +46 -26
- package/src/helpers/canTrack.js +3 -5
- package/src/helpers/css.js +3 -7
- package/src/helpers/flatten.js +15 -18
- package/src/helpers/localStorage.js +1 -4
- package/src/helpers/logger.js +1 -3
- package/src/helpers/nullable.js +2 -4
- package/src/helpers/preview-lru-cache/get.js +8 -0
- package/src/helpers/preview-lru-cache/helpers.js +10 -0
- package/src/helpers/preview-lru-cache/init.js +10 -0
- package/src/helpers/preview-lru-cache/set.js +35 -0
- package/src/helpers/preview-lru-cache/types.js +0 -0
- package/src/helpers/sessionId.js +14 -11
- package/src/helpers/time.js +1 -3
- package/src/helpers/url.js +2 -4
- package/src/helpers/uuid.js +4 -6
- package/src/helpers/visitorId.js +8 -7
- package/src/index-helpers/blocks-exports.js +1 -1
- package/src/index.js +2 -17
- package/src/scripts/init-editing.js +62 -48
- package/src/types/api-version.js +1 -3
- package/src/types/builder-props.js +0 -0
- package/src/types/enforced-partials.js +0 -0
- package/dist/blocks/BaseText.d.ts +0 -6
- package/dist/blocks/button/button.d.ts +0 -9
- package/dist/blocks/button/component-info.d.ts +0 -2
- package/dist/blocks/columns/columns.d.ts +0 -16
- package/dist/blocks/columns/component-info.d.ts +0 -2
- package/dist/blocks/custom-code/component-info.d.ts +0 -2
- package/dist/blocks/custom-code/custom-code.d.ts +0 -5
- package/dist/blocks/embed/component-info.d.ts +0 -2
- package/dist/blocks/embed/embed.d.ts +0 -5
- package/dist/blocks/embed/helpers.d.ts +0 -1
- package/dist/blocks/form/component-info.d.ts +0 -2
- package/dist/blocks/form/form.d.ts +0 -28
- package/dist/blocks/fragment/component-info.d.ts +0 -2
- package/dist/blocks/fragment/fragment.d.ts +0 -8
- package/dist/blocks/image/component-info.d.ts +0 -2
- package/dist/blocks/image/image.d.ts +0 -17
- package/dist/blocks/image/image.helpers.d.ts +0 -1
- package/dist/blocks/img/component-info.d.ts +0 -2
- package/dist/blocks/img/img.d.ts +0 -11
- package/dist/blocks/input/component-info.d.ts +0 -2
- package/dist/blocks/input/input.d.ts +0 -12
- package/dist/blocks/raw-text/component-info.d.ts +0 -2
- package/dist/blocks/raw-text/raw-text.d.ts +0 -5
- package/dist/blocks/section/component-info.d.ts +0 -2
- package/dist/blocks/section/section.d.ts +0 -9
- package/dist/blocks/select/component-info.d.ts +0 -2
- package/dist/blocks/select/select.d.ts +0 -13
- package/dist/blocks/submit-button/component-info.d.ts +0 -2
- package/dist/blocks/submit-button/submit-button.d.ts +0 -7
- package/dist/blocks/symbol/component-info.d.ts +0 -2
- package/dist/blocks/symbol/symbol.d.ts +0 -21
- package/dist/blocks/text/component-info.d.ts +0 -2
- package/dist/blocks/text/text.d.ts +0 -7
- package/dist/blocks/textarea/component-info.d.ts +0 -2
- package/dist/blocks/textarea/textarea.d.ts +0 -10
- package/dist/blocks/util.d.ts +0 -4
- package/dist/blocks/video/component-info.d.ts +0 -2
- package/dist/blocks/video/video.d.ts +0 -31
- package/dist/components/render-block/block-styles.d.ts +0 -9
- package/dist/components/render-block/render-block.d.ts +0 -9
- package/dist/components/render-block/render-block.helpers.d.ts +0 -12
- package/dist/components/render-block/render-component.d.ts +0 -17
- package/dist/components/render-block/render-repeated-block.d.ts +0 -9
- package/dist/components/render-block/types.d.ts +0 -6
- package/dist/components/render-blocks.d.ts +0 -10
- package/dist/components/render-content/builder-editing.d.ts +0 -3
- package/dist/components/render-content/components/render-styles.d.ts +0 -9
- package/dist/components/render-content/components/render-styles.helpers.d.ts +0 -15
- package/dist/components/render-content/index.d.ts +0 -1
- package/dist/components/render-content/render-content.d.ts +0 -4
- package/dist/components/render-content/render-content.helpers.d.ts +0 -7
- package/dist/components/render-content/render-content.types.d.ts +0 -38
- package/dist/components/render-content/wrap-component-ref.d.ts +0 -6
- package/dist/components/render-content-variants/helpers.d.ts +0 -17
- package/dist/components/render-content-variants/render-content-variants.d.ts +0 -5
- package/dist/components/render-inlined-styles.d.ts +0 -7
- package/dist/constants/builder-registered-components.d.ts +0 -6
- package/dist/constants/device-sizes.d.ts +0 -13
- package/dist/constants/sdk-version.d.ts +0 -1
- package/dist/constants/target.d.ts +0 -3
- package/dist/context/builder.context.d.ts +0 -3
- package/dist/context/types.d.ts +0 -35
- package/dist/functions/camel-to-kebab-case.d.ts +0 -1
- package/dist/functions/evaluate.d.ts +0 -7
- package/dist/functions/evaluate.test.d.ts +0 -1
- package/dist/functions/event-handler-name.d.ts +0 -1
- package/dist/functions/extract-text-styles.d.ts +0 -4
- package/dist/functions/fast-clone.d.ts +0 -4
- package/dist/functions/get-block-actions-handler.d.ts +0 -8
- package/dist/functions/get-block-actions.d.ts +0 -9
- package/dist/functions/get-block-component-options.d.ts +0 -2
- package/dist/functions/get-block-properties.d.ts +0 -2
- package/dist/functions/get-builder-search-params/fn.test.d.ts +0 -1
- package/dist/functions/get-builder-search-params/index.d.ts +0 -12
- package/dist/functions/get-content/generate-content-url.d.ts +0 -2
- package/dist/functions/get-content/generate-content-url.test.d.ts +0 -1
- package/dist/functions/get-content/index.d.ts +0 -16
- package/dist/functions/get-content/types.d.ts +0 -51
- package/dist/functions/get-fetch.d.ts +0 -1
- package/dist/functions/get-processed-block.d.ts +0 -10
- package/dist/functions/get-processed-block.test.d.ts +0 -1
- package/dist/functions/get-react-native-block-styles.d.ts +0 -7
- package/dist/functions/if-target.d.ts +0 -7
- package/dist/functions/is-browser.d.ts +0 -1
- package/dist/functions/is-editing.d.ts +0 -1
- package/dist/functions/is-iframe.d.ts +0 -1
- package/dist/functions/is-previewing.d.ts +0 -1
- package/dist/functions/on-change.d.ts +0 -7
- package/dist/functions/on-change.test.d.ts +0 -1
- package/dist/functions/register-component.d.ts +0 -14
- package/dist/functions/register.d.ts +0 -16
- package/dist/functions/sanitize-react-native-block-styles.d.ts +0 -3
- package/dist/functions/set-editor-settings.d.ts +0 -4
- package/dist/functions/set.d.ts +0 -7
- package/dist/functions/set.test.d.ts +0 -1
- package/dist/functions/track/helpers.d.ts +0 -5
- package/dist/functions/track/index.d.ts +0 -51
- package/dist/functions/track/interaction.d.ts +0 -13
- package/dist/functions/transform-block-properties.d.ts +0 -3
- package/dist/functions/transform-block.d.ts +0 -2
- package/dist/helpers/ab-tests.d.ts +0 -9
- package/dist/helpers/canTrack.d.ts +0 -1
- package/dist/helpers/cookie.d.ts +0 -9
- package/dist/helpers/css.d.ts +0 -7
- package/dist/helpers/flatten.d.ts +0 -6
- package/dist/helpers/localStorage.d.ts +0 -9
- package/dist/helpers/logger.d.ts +0 -6
- package/dist/helpers/nullable.d.ts +0 -2
- package/dist/helpers/sessionId.d.ts +0 -6
- package/dist/helpers/time.d.ts +0 -1
- package/dist/helpers/url.d.ts +0 -6
- package/dist/helpers/url.test.d.ts +0 -1
- package/dist/helpers/uuid.d.ts +0 -8
- package/dist/helpers/visitorId.d.ts +0 -6
- package/dist/index-helpers/blocks-exports.d.ts +0 -8
- package/dist/index-helpers/top-of-file.d.ts +0 -1
- package/dist/index.d.ts +0 -15
- package/dist/scripts/init-editing.d.ts +0 -6
- package/dist/types/api-version.d.ts +0 -2
- package/dist/types/builder-block.d.ts +0 -66
- package/dist/types/builder-content.d.ts +0 -44
- package/dist/types/can-track.d.ts +0 -3
- package/dist/types/components.d.ts +0 -105
- package/dist/types/deep-partial.d.ts +0 -3
- package/dist/types/element.d.ts +0 -59
- package/dist/types/input.d.ts +0 -121
- package/dist/types/targets.d.ts +0 -3
- package/dist/types/typescript.d.ts +0 -5
- package/src/blocks/util.js +0 -8
- package/src/components/render-block/render-component.jsx +0 -55
- package/src/components/render-blocks.jsx +0 -101
- package/src/components/render-content/builder-editing.jsx +0 -16
- package/src/components/render-content/index.js +0 -4
- package/src/components/render-content/wrap-component-ref.js +0 -4
- package/src/components/render-content-variants/render-content-variants.jsx +0 -101
- package/src/functions/evaluate.test.js +0 -17
- package/src/functions/get-builder-search-params/fn.test.js +0 -13
- package/src/functions/get-content/generate-content-url.test.js +0 -97
- package/src/functions/get-processed-block.test.js +0 -34
- package/src/functions/on-change.test.js +0 -19
- package/src/functions/set.test.js +0 -16
- package/src/helpers/url.test.js +0 -21
- /package/src/components/{render-block → block}/types.js +0 -0
- /package/src/components/{render-content/render-content.types.js → content-variants/content-variants.types.js} +0 -0
package/src/blocks/util.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
const serializeFn = (fnValue) => {
|
|
2
|
-
const fnStr = fnValue.toString().trim();
|
|
3
|
-
const appendFunction = !fnStr.startsWith("function") && !fnStr.startsWith("(");
|
|
4
|
-
return `return (${appendFunction ? "function " : ""}${fnStr}).apply(this, arguments)`;
|
|
5
|
-
};
|
|
6
|
-
export {
|
|
7
|
-
serializeFn
|
|
8
|
-
};
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import * as React from "react";
|
|
3
|
-
import {
|
|
4
|
-
FlatList,
|
|
5
|
-
ScrollView,
|
|
6
|
-
View,
|
|
7
|
-
StyleSheet,
|
|
8
|
-
Image,
|
|
9
|
-
Text,
|
|
10
|
-
} from "react-native";
|
|
11
|
-
import { useContext } from "react";
|
|
12
|
-
import BlockStyles from "./block-styles";
|
|
13
|
-
import RenderBlock from "./render-block";
|
|
14
|
-
import BuilderContext from "../../context/builder.context.js";
|
|
15
|
-
|
|
16
|
-
function RenderComponent(props) {
|
|
17
|
-
return (
|
|
18
|
-
<BuilderContext.Provider
|
|
19
|
-
value={{
|
|
20
|
-
content: props.context.content,
|
|
21
|
-
rootState: props.context.rootState,
|
|
22
|
-
localState: props.context.localState,
|
|
23
|
-
context: props.context.context,
|
|
24
|
-
apiKey: props.context.apiKey,
|
|
25
|
-
registeredComponents: props.context.registeredComponents,
|
|
26
|
-
inheritedStyles: props.context.inheritedStyles,
|
|
27
|
-
apiVersion: props.context.apiVersion,
|
|
28
|
-
}}
|
|
29
|
-
>
|
|
30
|
-
{props.componentRef ? (
|
|
31
|
-
<>
|
|
32
|
-
<props.componentRef {...props.componentOptions}>
|
|
33
|
-
{props.blockChildren?.map((child) => (
|
|
34
|
-
<RenderBlock
|
|
35
|
-
key={"render-block-" + child.id}
|
|
36
|
-
block={child}
|
|
37
|
-
context={props.context}
|
|
38
|
-
/>
|
|
39
|
-
))}
|
|
40
|
-
|
|
41
|
-
{props.blockChildren?.map((child) => (
|
|
42
|
-
<BlockStyles
|
|
43
|
-
key={"block-style-" + child.id}
|
|
44
|
-
block={child}
|
|
45
|
-
context={props.context}
|
|
46
|
-
/>
|
|
47
|
-
))}
|
|
48
|
-
</props.componentRef>
|
|
49
|
-
</>
|
|
50
|
-
) : null}
|
|
51
|
-
</BuilderContext.Provider>
|
|
52
|
-
);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
export default RenderComponent;
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import * as React from "react";
|
|
3
|
-
import {
|
|
4
|
-
FlatList,
|
|
5
|
-
ScrollView,
|
|
6
|
-
View,
|
|
7
|
-
StyleSheet,
|
|
8
|
-
Image,
|
|
9
|
-
Text,
|
|
10
|
-
} from "react-native";
|
|
11
|
-
import { useContext } from "react";
|
|
12
|
-
import BuilderContext from "../context/builder.context.js";
|
|
13
|
-
import { isEditing } from "../functions/is-editing.js";
|
|
14
|
-
import BlockStyles from "./render-block/block-styles";
|
|
15
|
-
import RenderBlock from "./render-block/render-block";
|
|
16
|
-
|
|
17
|
-
function RenderBlocks(props) {
|
|
18
|
-
function className() {
|
|
19
|
-
return "builder-blocks" + (!props.blocks?.length ? " no-blocks" : "");
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
function onClick() {
|
|
23
|
-
if (isEditing() && !props.blocks?.length) {
|
|
24
|
-
window.parent?.postMessage(
|
|
25
|
-
{
|
|
26
|
-
type: "builder.clickEmptyBlocks",
|
|
27
|
-
data: {
|
|
28
|
-
parentElementId: props.parent,
|
|
29
|
-
dataPath: props.path,
|
|
30
|
-
},
|
|
31
|
-
},
|
|
32
|
-
"*"
|
|
33
|
-
);
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
function onMouseEnter() {
|
|
38
|
-
if (isEditing() && !props.blocks?.length) {
|
|
39
|
-
window.parent?.postMessage(
|
|
40
|
-
{
|
|
41
|
-
type: "builder.hoverEmptyBlocks",
|
|
42
|
-
data: {
|
|
43
|
-
parentElementId: props.parent,
|
|
44
|
-
dataPath: props.path,
|
|
45
|
-
},
|
|
46
|
-
},
|
|
47
|
-
"*"
|
|
48
|
-
);
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
const builderContext = useContext(BuilderContext);
|
|
53
|
-
|
|
54
|
-
return (
|
|
55
|
-
<ScrollView
|
|
56
|
-
builder-path={props.path}
|
|
57
|
-
builder-parent-id={props.parent}
|
|
58
|
-
dataSet={{
|
|
59
|
-
class: className(),
|
|
60
|
-
}}
|
|
61
|
-
contentContainerStyle={props.styleProp}
|
|
62
|
-
onClick={(event) => onClick()}
|
|
63
|
-
onMouseEnter={(event) => onMouseEnter()}
|
|
64
|
-
onKeyPress={(event) => onClick()}
|
|
65
|
-
>
|
|
66
|
-
{props.blocks ? (
|
|
67
|
-
<>
|
|
68
|
-
{props.blocks?.map((block) => (
|
|
69
|
-
<RenderBlock
|
|
70
|
-
key={"render-block-" + block.id}
|
|
71
|
-
block={block}
|
|
72
|
-
context={builderContext}
|
|
73
|
-
/>
|
|
74
|
-
))}
|
|
75
|
-
</>
|
|
76
|
-
) : null}
|
|
77
|
-
|
|
78
|
-
{props.blocks ? (
|
|
79
|
-
<>
|
|
80
|
-
{props.blocks?.map((block) => (
|
|
81
|
-
<BlockStyles
|
|
82
|
-
key={"block-style-" + block.id}
|
|
83
|
-
block={block}
|
|
84
|
-
context={builderContext}
|
|
85
|
-
/>
|
|
86
|
-
))}
|
|
87
|
-
</>
|
|
88
|
-
) : null}
|
|
89
|
-
</ScrollView>
|
|
90
|
-
);
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
const styles = StyleSheet.create({
|
|
94
|
-
scrollView1: {
|
|
95
|
-
display: "flex",
|
|
96
|
-
flexDirection: "column",
|
|
97
|
-
alignItems: "stretch",
|
|
98
|
-
},
|
|
99
|
-
});
|
|
100
|
-
|
|
101
|
-
export default RenderBlocks;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import * as React from "react";
|
|
3
|
-
import {
|
|
4
|
-
FlatList,
|
|
5
|
-
ScrollView,
|
|
6
|
-
View,
|
|
7
|
-
StyleSheet,
|
|
8
|
-
Image,
|
|
9
|
-
Text,
|
|
10
|
-
} from "react-native";
|
|
11
|
-
|
|
12
|
-
function BuilderEditing(props) {
|
|
13
|
-
return <View />;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export default BuilderEditing;
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import * as React from "react";
|
|
3
|
-
import {
|
|
4
|
-
FlatList,
|
|
5
|
-
ScrollView,
|
|
6
|
-
View,
|
|
7
|
-
StyleSheet,
|
|
8
|
-
Image,
|
|
9
|
-
Text,
|
|
10
|
-
} from "react-native";
|
|
11
|
-
import { useState } from "react";
|
|
12
|
-
import {
|
|
13
|
-
checkShouldRunVariants,
|
|
14
|
-
getVariants,
|
|
15
|
-
getVariantsScriptString,
|
|
16
|
-
} from "./helpers";
|
|
17
|
-
import RenderContent from "../render-content/render-content";
|
|
18
|
-
import { getDefaultCanTrack } from "../../helpers/canTrack";
|
|
19
|
-
import RenderInlinedStyles from "../render-inlined-styles";
|
|
20
|
-
import { handleABTestingSync } from "../../helpers/ab-tests";
|
|
21
|
-
|
|
22
|
-
function RenderContentVariants(props) {
|
|
23
|
-
const [variantScriptStr, setVariantScriptStr] = useState(() =>
|
|
24
|
-
getVariantsScriptString(
|
|
25
|
-
getVariants(props.content).map((value) => ({
|
|
26
|
-
id: value.id,
|
|
27
|
-
testRatio: value.testRatio,
|
|
28
|
-
})),
|
|
29
|
-
props.content?.id || ""
|
|
30
|
-
)
|
|
31
|
-
);
|
|
32
|
-
|
|
33
|
-
const [shouldRenderVariants, setShouldRenderVariants] = useState(() =>
|
|
34
|
-
checkShouldRunVariants({
|
|
35
|
-
canTrack: getDefaultCanTrack(props.canTrack),
|
|
36
|
-
content: props.content,
|
|
37
|
-
})
|
|
38
|
-
);
|
|
39
|
-
|
|
40
|
-
const [hideVariantsStyleString, setHideVariantsStyleString] = useState(() =>
|
|
41
|
-
getVariants(props.content)
|
|
42
|
-
.map((value) => `.variant-${value.id} { display: none; } `)
|
|
43
|
-
.join("")
|
|
44
|
-
);
|
|
45
|
-
|
|
46
|
-
const [contentToRender, setContentToRender] = useState(() =>
|
|
47
|
-
checkShouldRunVariants({
|
|
48
|
-
canTrack: getDefaultCanTrack(props.canTrack),
|
|
49
|
-
content: props.content,
|
|
50
|
-
})
|
|
51
|
-
? props.content
|
|
52
|
-
: handleABTestingSync({
|
|
53
|
-
item: props.content,
|
|
54
|
-
canTrack: getDefaultCanTrack(props.canTrack),
|
|
55
|
-
})
|
|
56
|
-
);
|
|
57
|
-
|
|
58
|
-
return (
|
|
59
|
-
<>
|
|
60
|
-
{shouldRenderVariants ? (
|
|
61
|
-
<>
|
|
62
|
-
<RenderInlinedStyles
|
|
63
|
-
id={`variants-styles-${props.content?.id}`}
|
|
64
|
-
styles={hideVariantsStyleString}
|
|
65
|
-
/>
|
|
66
|
-
<View
|
|
67
|
-
id={`variants-script-${props.content?.id}`}
|
|
68
|
-
dangerouslySetInnerHTML={{ __html: variantScriptStr }}
|
|
69
|
-
/>
|
|
70
|
-
{getVariants(props.content)?.map((variant) => (
|
|
71
|
-
<RenderContent
|
|
72
|
-
key={variant.id}
|
|
73
|
-
content={variant}
|
|
74
|
-
apiKey={props.apiKey}
|
|
75
|
-
apiVersion={props.apiVersion}
|
|
76
|
-
canTrack={props.canTrack}
|
|
77
|
-
customComponents={props.customComponents}
|
|
78
|
-
hideContent={true}
|
|
79
|
-
parentContentId={props.content?.id}
|
|
80
|
-
isSsrAbTest={shouldRenderVariants}
|
|
81
|
-
/>
|
|
82
|
-
))}
|
|
83
|
-
</>
|
|
84
|
-
) : null}
|
|
85
|
-
|
|
86
|
-
<RenderContent
|
|
87
|
-
model={props.model}
|
|
88
|
-
content={contentToRender}
|
|
89
|
-
apiKey={props.apiKey}
|
|
90
|
-
apiVersion={props.apiVersion}
|
|
91
|
-
canTrack={props.canTrack}
|
|
92
|
-
customComponents={props.customComponents}
|
|
93
|
-
classNameProp={`variant-${props.content?.id}`}
|
|
94
|
-
parentContentId={props.content?.id}
|
|
95
|
-
isSsrAbTest={shouldRenderVariants}
|
|
96
|
-
/>
|
|
97
|
-
</>
|
|
98
|
-
);
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
export default RenderContentVariants;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { flattenState } from "./evaluate";
|
|
2
|
-
describe("flatten state", () => {
|
|
3
|
-
it("should behave normally when no PROTO_STATE", () => {
|
|
4
|
-
const localState = {};
|
|
5
|
-
const rootState = { foo: "bar" };
|
|
6
|
-
const flattened = flattenState(rootState, localState, void 0);
|
|
7
|
-
expect(flattened.foo).toEqual("bar");
|
|
8
|
-
flattened.foo = "baz";
|
|
9
|
-
expect(rootState.foo).toEqual("baz");
|
|
10
|
-
});
|
|
11
|
-
it("should shadow write ", () => {
|
|
12
|
-
const rootState = { foo: "foo" };
|
|
13
|
-
const localState = { foo: "baz" };
|
|
14
|
-
const flattened = flattenState(rootState, localState, void 0);
|
|
15
|
-
expect(() => flattened.foo = "bar").toThrow("Writing to local state is not allowed as it is read-only.");
|
|
16
|
-
});
|
|
17
|
-
});
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { convertSearchParamsToQueryObject, getBuilderSearchParams } from ".";
|
|
2
|
-
const querystring = "someotherValue=jklsjfdal&abc=klfdjklgfds&builder.cachebust=true&builder.preview=page&builder.noCache=true&__builder_editing__=true&builder.overrides.page=037948e52eaf4743afed464f02c70da4&builder.overrides.037948e52eaf4743afed464f02c70da4=037948e52eaf4743afed464f02c70da4&builder.overrides.page%3A%2F=037948e52eaf4743afed464f02c70da4&preview_theme_id=128854393017";
|
|
3
|
-
const url = new URL(`localhost:3000/about-us?${querystring}`);
|
|
4
|
-
describe("Get Builder SearchParams", () => {
|
|
5
|
-
test("correctly converts URLSearchParams to object", () => {
|
|
6
|
-
const output = convertSearchParamsToQueryObject(url.searchParams);
|
|
7
|
-
expect(output).toMatchSnapshot();
|
|
8
|
-
});
|
|
9
|
-
test("correctly extracts all builder params from a query object", () => {
|
|
10
|
-
const output = getBuilderSearchParams(convertSearchParamsToQueryObject(url.searchParams));
|
|
11
|
-
expect(output).toMatchSnapshot();
|
|
12
|
-
});
|
|
13
|
-
});
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
import { generateContentUrl } from "./generate-content-url";
|
|
2
|
-
const testKey = "YJIGb4i01jvw0SRdL5Bt";
|
|
3
|
-
const testModel = "page";
|
|
4
|
-
const testId = "c1b81bab59704599b997574eb0736def";
|
|
5
|
-
const options = {
|
|
6
|
-
cachebust: "true",
|
|
7
|
-
noCache: "true",
|
|
8
|
-
"overrides.037948e52eaf4743afed464f02c70da4": "037948e52eaf4743afed464f02c70da4",
|
|
9
|
-
"overrides.page": "037948e52eaf4743afed464f02c70da4",
|
|
10
|
-
"overrides.page:/": "037948e52eaf4743afed464f02c70da4",
|
|
11
|
-
preview: "page"
|
|
12
|
-
};
|
|
13
|
-
describe("Generate Content URL", () => {
|
|
14
|
-
test("generates the proper value for a simple query", () => {
|
|
15
|
-
const output = generateContentUrl({
|
|
16
|
-
apiKey: testKey,
|
|
17
|
-
model: testModel,
|
|
18
|
-
query: { id: testId }
|
|
19
|
-
});
|
|
20
|
-
expect(output).toMatchSnapshot();
|
|
21
|
-
});
|
|
22
|
-
test("Handles overrides correctly", () => {
|
|
23
|
-
const output = generateContentUrl({
|
|
24
|
-
apiKey: testKey,
|
|
25
|
-
model: testModel,
|
|
26
|
-
query: { id: testId },
|
|
27
|
-
options
|
|
28
|
-
});
|
|
29
|
-
expect(output).toMatchSnapshot();
|
|
30
|
-
});
|
|
31
|
-
test("generate content url with apiVersion as default", () => {
|
|
32
|
-
const output = generateContentUrl({
|
|
33
|
-
apiKey: testKey,
|
|
34
|
-
model: testModel,
|
|
35
|
-
query: { id: testId },
|
|
36
|
-
options
|
|
37
|
-
});
|
|
38
|
-
expect(output).toMatchSnapshot();
|
|
39
|
-
});
|
|
40
|
-
test("generate content url with apiVersion as v2", () => {
|
|
41
|
-
const output = generateContentUrl({
|
|
42
|
-
apiKey: testKey,
|
|
43
|
-
model: testModel,
|
|
44
|
-
query: { id: testId },
|
|
45
|
-
options,
|
|
46
|
-
apiVersion: "v2"
|
|
47
|
-
});
|
|
48
|
-
expect(output).toMatchSnapshot();
|
|
49
|
-
});
|
|
50
|
-
test("generate content url with apiVersion as v3", () => {
|
|
51
|
-
const output = generateContentUrl({
|
|
52
|
-
apiKey: testKey,
|
|
53
|
-
model: testModel,
|
|
54
|
-
query: { id: testId },
|
|
55
|
-
options,
|
|
56
|
-
apiVersion: "v3"
|
|
57
|
-
});
|
|
58
|
-
expect(output).toMatchSnapshot();
|
|
59
|
-
});
|
|
60
|
-
test("throw error when trying to generate content url with apiVersion as v1", () => {
|
|
61
|
-
expect(() => {
|
|
62
|
-
generateContentUrl({
|
|
63
|
-
apiKey: testKey,
|
|
64
|
-
model: testModel,
|
|
65
|
-
query: { id: testId },
|
|
66
|
-
options,
|
|
67
|
-
apiVersion: "v1"
|
|
68
|
-
});
|
|
69
|
-
}).toThrow(`Invalid apiVersion: expected 'v2' or 'v3', received 'v1'`);
|
|
70
|
-
});
|
|
71
|
-
test("throw error when trying to generate content url with an invalid apiVersion value", () => {
|
|
72
|
-
expect(() => {
|
|
73
|
-
generateContentUrl({
|
|
74
|
-
apiKey: testKey,
|
|
75
|
-
model: testModel,
|
|
76
|
-
query: { id: testId },
|
|
77
|
-
options,
|
|
78
|
-
apiVersion: "INVALID_API_VERSION"
|
|
79
|
-
});
|
|
80
|
-
}).toThrow(`Invalid apiVersion: expected 'v2' or 'v3', received 'INVALID_API_VERSION'`);
|
|
81
|
-
});
|
|
82
|
-
test("generate content url with enrich option true", () => {
|
|
83
|
-
const output = generateContentUrl({
|
|
84
|
-
apiKey: testKey,
|
|
85
|
-
model: testModel,
|
|
86
|
-
enrich: true
|
|
87
|
-
});
|
|
88
|
-
expect(output).toMatchSnapshot();
|
|
89
|
-
});
|
|
90
|
-
test("generate content url with enrich option not present", () => {
|
|
91
|
-
const output = generateContentUrl({
|
|
92
|
-
apiKey: testKey,
|
|
93
|
-
model: testModel
|
|
94
|
-
});
|
|
95
|
-
expect(output).toMatchSnapshot();
|
|
96
|
-
});
|
|
97
|
-
});
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { getProcessedBlock } from "./get-processed-block.js";
|
|
2
|
-
test("Can process bindings", () => {
|
|
3
|
-
var _a, _b, _c, _d, _e, _f;
|
|
4
|
-
const block = {
|
|
5
|
-
"@type": "@builder.io/sdk:Element",
|
|
6
|
-
properties: {
|
|
7
|
-
foo: "bar"
|
|
8
|
-
},
|
|
9
|
-
bindings: {
|
|
10
|
-
"properties.foo": '"baz"',
|
|
11
|
-
"responsiveStyles.large.zIndex": "1 + 1",
|
|
12
|
-
"properties.test": "state.test",
|
|
13
|
-
"properties.block": `
|
|
14
|
-
const foo = 'bar';
|
|
15
|
-
return foo;
|
|
16
|
-
`,
|
|
17
|
-
"properties.isEditing": "builder.isEditing"
|
|
18
|
-
}
|
|
19
|
-
};
|
|
20
|
-
const processed = getProcessedBlock({
|
|
21
|
-
block,
|
|
22
|
-
context: {},
|
|
23
|
-
rootState: { test: "hello" },
|
|
24
|
-
rootSetState: void 0,
|
|
25
|
-
localState: void 0,
|
|
26
|
-
shouldEvaluateBindings: true
|
|
27
|
-
});
|
|
28
|
-
expect(processed).not.toEqual(block);
|
|
29
|
-
expect((_a = processed.properties) == null ? void 0 : _a.foo).toEqual("baz");
|
|
30
|
-
expect((_b = processed.properties) == null ? void 0 : _b.test).toEqual("hello");
|
|
31
|
-
expect((_c = processed.properties) == null ? void 0 : _c.block).toEqual("bar");
|
|
32
|
-
expect((_d = processed.properties) == null ? void 0 : _d.isEditing).toEqual(false);
|
|
33
|
-
expect((_f = (_e = processed.responsiveStyles) == null ? void 0 : _e.large) == null ? void 0 : _f.zIndex).toEqual(2);
|
|
34
|
-
});
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { onChange } from "./on-change.js";
|
|
2
|
-
test("onChange can observe a shallow change", () => {
|
|
3
|
-
let changeHappend = false;
|
|
4
|
-
const obj = onChange({ foo: "hi" }, () => changeHappend = true);
|
|
5
|
-
obj.foo = "yo";
|
|
6
|
-
expect(changeHappend).toBe(true);
|
|
7
|
-
});
|
|
8
|
-
test("onChange can observe a deep change", () => {
|
|
9
|
-
let changeHappend = false;
|
|
10
|
-
const obj = onChange({ foo: { bar: "hi" } }, () => changeHappend = true);
|
|
11
|
-
obj.foo.bar = "yo";
|
|
12
|
-
expect(changeHappend).toBe(true);
|
|
13
|
-
});
|
|
14
|
-
test("Smoke test: callback is not fired if no properties updated", () => {
|
|
15
|
-
let changeHappend = false;
|
|
16
|
-
const obj = onChange({ foo: { bar: "hi" } }, () => changeHappend = true);
|
|
17
|
-
obj.foo.bar;
|
|
18
|
-
expect(changeHappend).toBe(false);
|
|
19
|
-
});
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { set } from "./set.js";
|
|
2
|
-
test("can shallow set a property", () => {
|
|
3
|
-
const obj = { foo: "bar" };
|
|
4
|
-
set(obj, "foo", "baz");
|
|
5
|
-
expect(obj.foo).toBe("baz");
|
|
6
|
-
});
|
|
7
|
-
test("can deeply set a property", () => {
|
|
8
|
-
const obj = { foo: "bar" };
|
|
9
|
-
set(obj, "foo.bar", "baz");
|
|
10
|
-
expect(obj.foo.bar).toBe("baz");
|
|
11
|
-
});
|
|
12
|
-
test("can deeply create arrays", () => {
|
|
13
|
-
const obj = { foo: "bar" };
|
|
14
|
-
set(obj, "foo.bar.0", "hi");
|
|
15
|
-
expect(obj.foo.bar).toEqual(["hi"]);
|
|
16
|
-
});
|
package/src/helpers/url.test.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { getTopLevelDomain } from "./url.js";
|
|
2
|
-
describe("getTopLevelDomain", () => {
|
|
3
|
-
test("handles root domain", () => {
|
|
4
|
-
const output = getTopLevelDomain("example.com");
|
|
5
|
-
expect(output).toBe("example.com");
|
|
6
|
-
});
|
|
7
|
-
test("handles subdomain", () => {
|
|
8
|
-
const output = getTopLevelDomain("wwww.example.com");
|
|
9
|
-
expect(output).toBe("example.com");
|
|
10
|
-
});
|
|
11
|
-
test("handles subdomain with long suffix", () => {
|
|
12
|
-
const output = getTopLevelDomain("www.example.co.uk");
|
|
13
|
-
expect(output).toBe("example.co.uk");
|
|
14
|
-
});
|
|
15
|
-
test("handles localhost", () => {
|
|
16
|
-
const output = getTopLevelDomain("localhost");
|
|
17
|
-
expect(output).toBe("localhost");
|
|
18
|
-
const output2 = getTopLevelDomain("127.0.0.1");
|
|
19
|
-
expect(output2).toBe("127.0.0.1");
|
|
20
|
-
});
|
|
21
|
-
});
|
|
File without changes
|
|
File without changes
|