@builder.io/sdk-svelte 1.0.19 → 1.0.21
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/lib/browser/blocks/BaseText.svelte +11 -11
- package/lib/browser/blocks/button/button.svelte +2 -2
- package/lib/browser/blocks/button/button.svelte.d.ts +1 -1
- package/lib/browser/blocks/button/button.types.d.ts +1 -1
- package/lib/browser/blocks/button/component-info.d.ts +1 -1
- package/lib/browser/blocks/columns/columns.svelte +15 -15
- package/lib/browser/blocks/columns/columns.svelte.d.ts +1 -1
- package/lib/browser/blocks/columns/columns.types.d.ts +2 -2
- package/lib/browser/blocks/columns/component-info.d.ts +1 -1
- package/lib/browser/blocks/custom-code/component-info.d.ts +1 -1
- package/lib/browser/blocks/embed/component-info.d.ts +1 -1
- package/lib/browser/blocks/embed/embed.svelte +1 -1
- package/lib/browser/blocks/form/form/component-info.d.ts +1 -1
- package/lib/browser/blocks/form/form/form.svelte +6 -7
- package/lib/browser/blocks/form/input/component-info.d.ts +1 -1
- package/lib/browser/blocks/form/input/input.svelte +3 -3
- package/lib/browser/blocks/form/select/component-info.d.ts +1 -1
- package/lib/browser/blocks/form/select/select.svelte +4 -4
- package/lib/browser/blocks/form/submit-button/component-info.d.ts +1 -1
- package/lib/browser/blocks/form/submit-button/submit-button.svelte +2 -2
- package/lib/browser/blocks/fragment/component-info.d.ts +1 -1
- package/lib/browser/blocks/fragment/fragment.svelte.d.ts +1 -1
- package/lib/browser/blocks/image/component-info.d.ts +1 -1
- package/lib/browser/blocks/image/image.svelte +14 -14
- package/lib/browser/blocks/image/image.svelte.d.ts +1 -1
- package/lib/browser/blocks/image/image.types.d.ts +1 -1
- package/lib/browser/blocks/img/component-info.d.ts +1 -1
- package/lib/browser/blocks/img/img.svelte +14 -14
- package/lib/browser/blocks/raw-text/component-info.d.ts +1 -1
- package/lib/browser/blocks/section/component-info.d.ts +1 -1
- package/lib/browser/blocks/section/section.svelte +13 -13
- package/lib/browser/blocks/section/section.svelte.d.ts +1 -1
- package/lib/browser/blocks/slot/component-info.d.ts +1 -1
- package/lib/browser/blocks/slot/slot.svelte +12 -13
- package/lib/browser/blocks/slot/slot.svelte.d.ts +1 -2
- package/lib/browser/blocks/symbol/component-info.d.ts +1 -1
- package/lib/browser/blocks/symbol/symbol.helpers.d.ts +2 -2
- package/lib/browser/blocks/symbol/symbol.helpers.js +2 -2
- package/lib/browser/blocks/symbol/symbol.svelte +6 -6
- package/lib/browser/blocks/symbol/symbol.svelte.d.ts +2 -2
- package/lib/browser/blocks/symbol/symbol.types.d.ts +2 -2
- package/lib/browser/blocks/text/component-info.d.ts +1 -1
- package/lib/browser/blocks/text/text.svelte +11 -11
- package/lib/browser/blocks/text/text.svelte.d.ts +1 -1
- package/lib/browser/blocks/textarea/component-info.d.ts +1 -1
- package/lib/browser/blocks/textarea/textarea.svelte +2 -2
- package/lib/browser/blocks/video/component-info.d.ts +1 -1
- package/lib/browser/blocks/video/video.svelte +19 -19
- package/lib/browser/blocks/video/video.svelte.d.ts +1 -1
- package/lib/browser/blocks/video/video.types.d.ts +1 -1
- package/lib/browser/components/block/animator.d.ts +1 -1
- package/lib/browser/components/block/block.helpers.d.ts +4 -4
- package/lib/browser/components/block/block.helpers.js +4 -4
- package/lib/browser/components/block/block.svelte +4 -4
- package/lib/browser/components/block/components/block-styles.svelte +5 -5
- package/lib/browser/components/block/components/block-wrapper.svelte +2 -2
- package/lib/browser/components/block/components/block-wrapper.svelte.d.ts +2 -2
- package/lib/browser/components/block/components/component-ref/component-ref.helpers.d.ts +3 -3
- package/lib/browser/components/block/components/component-ref/component-ref.helpers.js +1 -1
- package/lib/browser/components/block/components/component-ref/component-ref.svelte +2 -2
- package/lib/browser/components/block/components/component-ref/component-ref.svelte.d.ts +1 -1
- package/lib/browser/components/block/components/interactive-element.svelte +3 -3
- package/lib/browser/components/block/components/repeated-block.svelte +1 -1
- package/lib/browser/components/block/components/repeated-block.svelte.d.ts +1 -1
- package/lib/browser/components/block/types.d.ts +2 -2
- package/lib/browser/components/blocks/blocks-wrapper.svelte +12 -12
- package/lib/browser/components/blocks/blocks.svelte +2 -2
- package/lib/browser/components/blocks/blocks.svelte.d.ts +1 -1
- package/lib/browser/components/blocks/blocks.types.d.ts +1 -1
- package/lib/browser/components/content/components/enable-editor.svelte +22 -22
- package/lib/browser/components/content/components/enable-editor.svelte.d.ts +7 -7
- package/lib/browser/components/content/components/styles.svelte +1 -1
- package/lib/browser/components/content/components/styles.svelte.d.ts +1 -1
- package/lib/browser/components/content/content.helpers.d.ts +3 -3
- package/lib/browser/components/content/content.svelte +7 -7
- package/lib/browser/components/content/content.svelte.d.ts +1 -1
- package/lib/browser/components/content/content.types.d.ts +2 -2
- package/lib/browser/components/content/contentProps.types.d.ts +2 -2
- package/lib/browser/components/content-variants/content-variants.svelte +4 -4
- package/lib/browser/components/content-variants/content-variants.svelte.d.ts +1 -1
- package/lib/browser/components/content-variants/content-variants.types.d.ts +4 -4
- package/lib/browser/components/content-variants/helpers.d.ts +5 -5
- package/lib/browser/components/content-variants/helpers.js +3 -3
- package/lib/browser/components/dynamic-renderer/dynamic-renderer.svelte +3 -3
- package/lib/browser/constants/builder-registered-components.d.ts +1 -1
- package/lib/browser/constants/builder-registered-components.js +17 -17
- package/lib/browser/constants/device-sizes.js +1 -1
- package/lib/browser/constants/extra-components.d.ts +1 -1
- package/lib/browser/constants/extra-components.js +17 -17
- package/lib/browser/constants/sdk-version.d.ts +1 -1
- package/lib/browser/constants/sdk-version.js +1 -1
- package/lib/browser/constants/target.d.ts +1 -1
- package/lib/browser/context/index.d.ts +1 -1
- package/lib/browser/context/index.js +1 -1
- package/lib/browser/context/types.d.ts +4 -4
- package/lib/browser/functions/evaluate/browser-runtime/browser.d.ts +2 -2
- package/lib/browser/functions/evaluate/browser-runtime/browser.js +1 -1
- package/lib/browser/functions/evaluate/browser-runtime/index.d.ts +1 -1
- package/lib/browser/functions/evaluate/browser-runtime/index.js +1 -1
- package/lib/browser/functions/evaluate/choose-eval.d.ts +1 -1
- package/lib/browser/functions/evaluate/choose-eval.js +3 -3
- package/lib/browser/functions/evaluate/edge-runtime/edge-runtime.d.ts +1 -1
- package/lib/browser/functions/evaluate/edge-runtime/edge-runtime.js +4 -4
- package/lib/browser/functions/evaluate/edge-runtime/index.d.ts +1 -1
- package/lib/browser/functions/evaluate/edge-runtime/index.js +1 -1
- package/lib/browser/functions/evaluate/evaluate.d.ts +1 -1
- package/lib/browser/functions/evaluate/evaluate.js +3 -3
- package/lib/browser/functions/evaluate/helpers.d.ts +3 -3
- package/lib/browser/functions/evaluate/helpers.js +3 -3
- package/lib/browser/functions/evaluate/index.d.ts +1 -1
- package/lib/browser/functions/evaluate/index.js +1 -1
- package/lib/browser/functions/evaluate/node-runtime/index.d.ts +1 -1
- package/lib/browser/functions/evaluate/node-runtime/index.js +1 -1
- package/lib/browser/functions/evaluate/node-runtime/init.d.ts +10 -0
- package/lib/browser/functions/evaluate/node-runtime/init.js +26 -0
- package/lib/browser/functions/evaluate/node-runtime/node-runtime.d.ts +7 -1
- package/lib/browser/functions/evaluate/node-runtime/node-runtime.js +36 -10
- package/lib/browser/functions/evaluate/placeholder-runtime.d.ts +1 -1
- package/lib/browser/functions/evaluate/should-force-browser-runtime-in-node.js +2 -2
- package/lib/browser/functions/fetch-builder-props.d.ts +3 -3
- package/lib/browser/functions/fetch-builder-props.js +2 -2
- package/lib/browser/functions/get-block-actions-handler.d.ts +2 -2
- package/lib/browser/functions/get-block-actions-handler.js +1 -1
- package/lib/browser/functions/get-block-actions.d.ts +2 -2
- package/lib/browser/functions/get-block-actions.js +3 -3
- package/lib/browser/functions/get-block-component-options.d.ts +1 -1
- package/lib/browser/functions/get-block-properties.d.ts +2 -2
- package/lib/browser/functions/get-block-properties.js +3 -3
- package/lib/browser/functions/get-builder-search-params/index.d.ts +1 -1
- package/lib/browser/functions/get-builder-search-params/index.js +2 -2
- package/lib/browser/functions/get-class-prop-name.js +1 -1
- package/lib/browser/functions/get-content/generate-content-url.d.ts +1 -1
- package/lib/browser/functions/get-content/generate-content-url.js +4 -4
- package/lib/browser/functions/get-content/index.d.ts +2 -2
- package/lib/browser/functions/get-content/index.js +8 -8
- package/lib/browser/functions/get-content/types.d.ts +3 -3
- package/lib/browser/functions/get-fetch.js +1 -1
- package/lib/browser/functions/get-processed-block.d.ts +2 -2
- package/lib/browser/functions/get-processed-block.js +4 -4
- package/lib/browser/functions/get-style.d.ts +2 -2
- package/lib/browser/functions/get-style.js +3 -3
- package/lib/browser/functions/is-edge-runtime.js +2 -2
- package/lib/browser/functions/is-editing.d.ts +1 -1
- package/lib/browser/functions/is-editing.js +3 -3
- package/lib/browser/functions/is-iframe.js +1 -1
- package/lib/browser/functions/is-node-runtime.js +1 -1
- package/lib/browser/functions/is-previewing.d.ts +1 -1
- package/lib/browser/functions/is-previewing.js +3 -3
- package/lib/browser/functions/register-component.d.ts +1 -1
- package/lib/browser/functions/register-component.js +1 -1
- package/lib/browser/functions/register.d.ts +2 -2
- package/lib/browser/functions/register.js +1 -1
- package/lib/browser/functions/set-editor-settings.js +1 -1
- package/lib/browser/functions/track/helpers.js +2 -2
- package/lib/browser/functions/track/index.d.ts +2 -2
- package/lib/browser/functions/track/index.js +7 -7
- package/lib/browser/functions/transform-block-properties.d.ts +2 -2
- package/lib/browser/functions/transform-block.d.ts +1 -1
- package/lib/browser/functions/transform-style-property.d.ts +2 -2
- package/lib/browser/helpers/ab-tests.d.ts +3 -3
- package/lib/browser/helpers/ab-tests.js +4 -4
- package/lib/browser/helpers/canTrack.js +1 -1
- package/lib/browser/helpers/cookie.d.ts +1 -1
- package/lib/browser/helpers/cookie.js +4 -4
- package/lib/browser/helpers/css.js +2 -2
- package/lib/browser/helpers/localStorage.d.ts +2 -2
- package/lib/browser/helpers/localStorage.js +1 -1
- package/lib/browser/helpers/logger.d.ts +1 -0
- package/lib/browser/helpers/logger.js +1 -1
- package/lib/browser/helpers/preview-lru-cache/get.d.ts +1 -1
- package/lib/browser/helpers/preview-lru-cache/set.d.ts +1 -1
- package/lib/browser/helpers/sessionId.d.ts +1 -1
- package/lib/browser/helpers/sessionId.js +3 -3
- package/lib/browser/helpers/subscribe-to-editor.d.ts +3 -3
- package/lib/browser/helpers/subscribe-to-editor.js +4 -4
- package/lib/browser/helpers/visitorId.d.ts +1 -1
- package/lib/browser/helpers/visitorId.js +3 -3
- package/lib/browser/index-helpers/blocks-exports.d.ts +11 -11
- package/lib/browser/index-helpers/blocks-exports.js +11 -11
- package/lib/browser/index.d.ts +3 -3
- package/lib/browser/index.js +3 -3
- package/lib/browser/scripts/init-editing.js +5 -5
- package/lib/browser/server-index.d.ts +27 -27
- package/lib/browser/server-index.js +11 -11
- package/lib/browser/types/builder-content.d.ts +3 -3
- package/lib/browser/types/builder-props.d.ts +2 -2
- package/lib/browser/types/components.d.ts +2 -2
- package/lib/browser/types/enforced-partials.d.ts +1 -1
- package/lib/edge/blocks/BaseText.svelte +11 -11
- package/lib/edge/blocks/button/button.svelte +2 -2
- package/lib/edge/blocks/button/button.svelte.d.ts +1 -1
- package/lib/edge/blocks/button/button.types.d.ts +1 -1
- package/lib/edge/blocks/button/component-info.d.ts +1 -1
- package/lib/edge/blocks/columns/columns.svelte +15 -15
- package/lib/edge/blocks/columns/columns.svelte.d.ts +1 -1
- package/lib/edge/blocks/columns/columns.types.d.ts +2 -2
- package/lib/edge/blocks/columns/component-info.d.ts +1 -1
- package/lib/edge/blocks/custom-code/component-info.d.ts +1 -1
- package/lib/edge/blocks/embed/component-info.d.ts +1 -1
- package/lib/edge/blocks/embed/embed.svelte +1 -1
- package/lib/edge/blocks/form/form/component-info.d.ts +1 -1
- package/lib/edge/blocks/form/form/form.svelte +6 -7
- package/lib/edge/blocks/form/input/component-info.d.ts +1 -1
- package/lib/edge/blocks/form/input/input.svelte +3 -3
- package/lib/edge/blocks/form/select/component-info.d.ts +1 -1
- package/lib/edge/blocks/form/select/select.svelte +4 -4
- package/lib/edge/blocks/form/submit-button/component-info.d.ts +1 -1
- package/lib/edge/blocks/form/submit-button/submit-button.svelte +2 -2
- package/lib/edge/blocks/fragment/component-info.d.ts +1 -1
- package/lib/edge/blocks/fragment/fragment.svelte.d.ts +1 -1
- package/lib/edge/blocks/image/component-info.d.ts +1 -1
- package/lib/edge/blocks/image/image.svelte +14 -14
- package/lib/edge/blocks/image/image.svelte.d.ts +1 -1
- package/lib/edge/blocks/image/image.types.d.ts +1 -1
- package/lib/edge/blocks/img/component-info.d.ts +1 -1
- package/lib/edge/blocks/img/img.svelte +14 -14
- package/lib/edge/blocks/raw-text/component-info.d.ts +1 -1
- package/lib/edge/blocks/section/component-info.d.ts +1 -1
- package/lib/edge/blocks/section/section.svelte +13 -13
- package/lib/edge/blocks/section/section.svelte.d.ts +1 -1
- package/lib/edge/blocks/slot/component-info.d.ts +1 -1
- package/lib/edge/blocks/slot/slot.svelte +12 -13
- package/lib/edge/blocks/slot/slot.svelte.d.ts +1 -2
- package/lib/edge/blocks/symbol/component-info.d.ts +1 -1
- package/lib/edge/blocks/symbol/symbol.helpers.d.ts +2 -2
- package/lib/edge/blocks/symbol/symbol.helpers.js +2 -2
- package/lib/edge/blocks/symbol/symbol.svelte +6 -6
- package/lib/edge/blocks/symbol/symbol.svelte.d.ts +2 -2
- package/lib/edge/blocks/symbol/symbol.types.d.ts +2 -2
- package/lib/edge/blocks/text/component-info.d.ts +1 -1
- package/lib/edge/blocks/text/text.svelte +11 -11
- package/lib/edge/blocks/text/text.svelte.d.ts +1 -1
- package/lib/edge/blocks/textarea/component-info.d.ts +1 -1
- package/lib/edge/blocks/textarea/textarea.svelte +2 -2
- package/lib/edge/blocks/video/component-info.d.ts +1 -1
- package/lib/edge/blocks/video/video.svelte +19 -19
- package/lib/edge/blocks/video/video.svelte.d.ts +1 -1
- package/lib/edge/blocks/video/video.types.d.ts +1 -1
- package/lib/edge/components/block/animator.d.ts +1 -1
- package/lib/edge/components/block/block.helpers.d.ts +4 -4
- package/lib/edge/components/block/block.helpers.js +4 -4
- package/lib/edge/components/block/block.svelte +4 -4
- package/lib/edge/components/block/components/block-styles.svelte +5 -5
- package/lib/edge/components/block/components/block-wrapper.svelte +2 -2
- package/lib/edge/components/block/components/block-wrapper.svelte.d.ts +2 -2
- package/lib/edge/components/block/components/component-ref/component-ref.helpers.d.ts +3 -3
- package/lib/edge/components/block/components/component-ref/component-ref.helpers.js +1 -1
- package/lib/edge/components/block/components/component-ref/component-ref.svelte +2 -2
- package/lib/edge/components/block/components/component-ref/component-ref.svelte.d.ts +1 -1
- package/lib/edge/components/block/components/interactive-element.svelte +3 -3
- package/lib/edge/components/block/components/repeated-block.svelte +1 -1
- package/lib/edge/components/block/components/repeated-block.svelte.d.ts +1 -1
- package/lib/edge/components/block/types.d.ts +2 -2
- package/lib/edge/components/blocks/blocks-wrapper.svelte +12 -12
- package/lib/edge/components/blocks/blocks.svelte +2 -2
- package/lib/edge/components/blocks/blocks.svelte.d.ts +1 -1
- package/lib/edge/components/blocks/blocks.types.d.ts +1 -1
- package/lib/edge/components/content/components/enable-editor.svelte +22 -22
- package/lib/edge/components/content/components/enable-editor.svelte.d.ts +7 -7
- package/lib/edge/components/content/components/styles.svelte +1 -1
- package/lib/edge/components/content/components/styles.svelte.d.ts +1 -1
- package/lib/edge/components/content/content.helpers.d.ts +3 -3
- package/lib/edge/components/content/content.svelte +7 -7
- package/lib/edge/components/content/content.svelte.d.ts +1 -1
- package/lib/edge/components/content/content.types.d.ts +2 -2
- package/lib/edge/components/content/contentProps.types.d.ts +2 -2
- package/lib/edge/components/content-variants/content-variants.svelte +4 -4
- package/lib/edge/components/content-variants/content-variants.svelte.d.ts +1 -1
- package/lib/edge/components/content-variants/content-variants.types.d.ts +4 -4
- package/lib/edge/components/content-variants/helpers.d.ts +5 -5
- package/lib/edge/components/content-variants/helpers.js +3 -3
- package/lib/edge/components/dynamic-renderer/dynamic-renderer.svelte +3 -3
- package/lib/edge/constants/builder-registered-components.d.ts +1 -1
- package/lib/edge/constants/builder-registered-components.js +17 -17
- package/lib/edge/constants/device-sizes.js +1 -1
- package/lib/edge/constants/extra-components.d.ts +1 -1
- package/lib/edge/constants/extra-components.js +17 -17
- package/lib/edge/constants/sdk-version.d.ts +1 -1
- package/lib/edge/constants/sdk-version.js +1 -1
- package/lib/edge/constants/target.d.ts +1 -1
- package/lib/edge/context/index.d.ts +1 -1
- package/lib/edge/context/index.js +1 -1
- package/lib/edge/context/types.d.ts +4 -4
- package/lib/edge/functions/evaluate/browser-runtime/browser.d.ts +2 -2
- package/lib/edge/functions/evaluate/browser-runtime/browser.js +1 -1
- package/lib/edge/functions/evaluate/browser-runtime/index.d.ts +1 -1
- package/lib/edge/functions/evaluate/browser-runtime/index.js +1 -1
- package/lib/edge/functions/evaluate/choose-eval.d.ts +1 -1
- package/lib/edge/functions/evaluate/choose-eval.js +3 -3
- package/lib/edge/functions/evaluate/edge-runtime/edge-runtime.d.ts +1 -1
- package/lib/edge/functions/evaluate/edge-runtime/edge-runtime.js +4 -4
- package/lib/edge/functions/evaluate/edge-runtime/index.d.ts +1 -1
- package/lib/edge/functions/evaluate/edge-runtime/index.js +1 -1
- package/lib/edge/functions/evaluate/evaluate.d.ts +1 -1
- package/lib/edge/functions/evaluate/evaluate.js +3 -3
- package/lib/edge/functions/evaluate/helpers.d.ts +3 -3
- package/lib/edge/functions/evaluate/helpers.js +3 -3
- package/lib/edge/functions/evaluate/index.d.ts +1 -1
- package/lib/edge/functions/evaluate/index.js +1 -1
- package/lib/edge/functions/evaluate/node-runtime/index.d.ts +1 -1
- package/lib/edge/functions/evaluate/node-runtime/index.js +1 -1
- package/lib/edge/functions/evaluate/node-runtime/init.d.ts +10 -0
- package/lib/edge/functions/evaluate/node-runtime/init.js +26 -0
- package/lib/edge/functions/evaluate/node-runtime/node-runtime.d.ts +7 -1
- package/lib/edge/functions/evaluate/node-runtime/node-runtime.js +36 -10
- package/lib/edge/functions/evaluate/placeholder-runtime.d.ts +1 -1
- package/lib/edge/functions/evaluate/should-force-browser-runtime-in-node.js +2 -2
- package/lib/edge/functions/fetch-builder-props.d.ts +3 -3
- package/lib/edge/functions/fetch-builder-props.js +2 -2
- package/lib/edge/functions/get-block-actions-handler.d.ts +2 -2
- package/lib/edge/functions/get-block-actions-handler.js +1 -1
- package/lib/edge/functions/get-block-actions.d.ts +2 -2
- package/lib/edge/functions/get-block-actions.js +3 -3
- package/lib/edge/functions/get-block-component-options.d.ts +1 -1
- package/lib/edge/functions/get-block-properties.d.ts +2 -2
- package/lib/edge/functions/get-block-properties.js +3 -3
- package/lib/edge/functions/get-builder-search-params/index.d.ts +1 -1
- package/lib/edge/functions/get-builder-search-params/index.js +2 -2
- package/lib/edge/functions/get-class-prop-name.js +1 -1
- package/lib/edge/functions/get-content/generate-content-url.d.ts +1 -1
- package/lib/edge/functions/get-content/generate-content-url.js +4 -4
- package/lib/edge/functions/get-content/index.d.ts +2 -2
- package/lib/edge/functions/get-content/index.js +8 -8
- package/lib/edge/functions/get-content/types.d.ts +3 -3
- package/lib/edge/functions/get-fetch.js +1 -1
- package/lib/edge/functions/get-processed-block.d.ts +2 -2
- package/lib/edge/functions/get-processed-block.js +4 -4
- package/lib/edge/functions/get-style.d.ts +2 -2
- package/lib/edge/functions/get-style.js +3 -3
- package/lib/edge/functions/is-edge-runtime.js +2 -2
- package/lib/edge/functions/is-editing.d.ts +1 -1
- package/lib/edge/functions/is-editing.js +3 -3
- package/lib/edge/functions/is-iframe.js +1 -1
- package/lib/edge/functions/is-node-runtime.js +1 -1
- package/lib/edge/functions/is-previewing.d.ts +1 -1
- package/lib/edge/functions/is-previewing.js +3 -3
- package/lib/edge/functions/register-component.d.ts +1 -1
- package/lib/edge/functions/register-component.js +1 -1
- package/lib/edge/functions/register.d.ts +2 -2
- package/lib/edge/functions/register.js +1 -1
- package/lib/edge/functions/set-editor-settings.js +1 -1
- package/lib/edge/functions/track/helpers.js +2 -2
- package/lib/edge/functions/track/index.d.ts +2 -2
- package/lib/edge/functions/track/index.js +7 -7
- package/lib/edge/functions/transform-block-properties.d.ts +2 -2
- package/lib/edge/functions/transform-block.d.ts +1 -1
- package/lib/edge/functions/transform-style-property.d.ts +2 -2
- package/lib/edge/helpers/ab-tests.d.ts +3 -3
- package/lib/edge/helpers/ab-tests.js +4 -4
- package/lib/edge/helpers/canTrack.js +1 -1
- package/lib/edge/helpers/cookie.d.ts +1 -1
- package/lib/edge/helpers/cookie.js +4 -4
- package/lib/edge/helpers/css.js +2 -2
- package/lib/edge/helpers/localStorage.d.ts +2 -2
- package/lib/edge/helpers/localStorage.js +1 -1
- package/lib/edge/helpers/logger.d.ts +1 -0
- package/lib/edge/helpers/logger.js +1 -1
- package/lib/edge/helpers/preview-lru-cache/get.d.ts +1 -1
- package/lib/edge/helpers/preview-lru-cache/set.d.ts +1 -1
- package/lib/edge/helpers/sessionId.d.ts +1 -1
- package/lib/edge/helpers/sessionId.js +3 -3
- package/lib/edge/helpers/subscribe-to-editor.d.ts +3 -3
- package/lib/edge/helpers/subscribe-to-editor.js +4 -4
- package/lib/edge/helpers/visitorId.d.ts +1 -1
- package/lib/edge/helpers/visitorId.js +3 -3
- package/lib/edge/index-helpers/blocks-exports.d.ts +11 -11
- package/lib/edge/index-helpers/blocks-exports.js +11 -11
- package/lib/edge/index.d.ts +3 -3
- package/lib/edge/index.js +3 -3
- package/lib/edge/scripts/init-editing.js +5 -5
- package/lib/edge/server-index.d.ts +27 -27
- package/lib/edge/server-index.js +11 -11
- package/lib/edge/types/builder-content.d.ts +3 -3
- package/lib/edge/types/builder-props.d.ts +2 -2
- package/lib/edge/types/components.d.ts +2 -2
- package/lib/edge/types/enforced-partials.d.ts +1 -1
- package/lib/node/blocks/BaseText.svelte +11 -11
- package/lib/node/blocks/button/button.svelte +2 -2
- package/lib/node/blocks/button/button.svelte.d.ts +1 -1
- package/lib/node/blocks/button/button.types.d.ts +1 -1
- package/lib/node/blocks/button/component-info.d.ts +1 -1
- package/lib/node/blocks/columns/columns.svelte +15 -15
- package/lib/node/blocks/columns/columns.svelte.d.ts +1 -1
- package/lib/node/blocks/columns/columns.types.d.ts +2 -2
- package/lib/node/blocks/columns/component-info.d.ts +1 -1
- package/lib/node/blocks/custom-code/component-info.d.ts +1 -1
- package/lib/node/blocks/embed/component-info.d.ts +1 -1
- package/lib/node/blocks/embed/embed.svelte +1 -1
- package/lib/node/blocks/form/form/component-info.d.ts +1 -1
- package/lib/node/blocks/form/form/form.svelte +6 -7
- package/lib/node/blocks/form/input/component-info.d.ts +1 -1
- package/lib/node/blocks/form/input/input.svelte +3 -3
- package/lib/node/blocks/form/select/component-info.d.ts +1 -1
- package/lib/node/blocks/form/select/select.svelte +4 -4
- package/lib/node/blocks/form/submit-button/component-info.d.ts +1 -1
- package/lib/node/blocks/form/submit-button/submit-button.svelte +2 -2
- package/lib/node/blocks/fragment/component-info.d.ts +1 -1
- package/lib/node/blocks/fragment/fragment.svelte.d.ts +1 -1
- package/lib/node/blocks/image/component-info.d.ts +1 -1
- package/lib/node/blocks/image/image.svelte +14 -14
- package/lib/node/blocks/image/image.svelte.d.ts +1 -1
- package/lib/node/blocks/image/image.types.d.ts +1 -1
- package/lib/node/blocks/img/component-info.d.ts +1 -1
- package/lib/node/blocks/img/img.svelte +14 -14
- package/lib/node/blocks/raw-text/component-info.d.ts +1 -1
- package/lib/node/blocks/section/component-info.d.ts +1 -1
- package/lib/node/blocks/section/section.svelte +13 -13
- package/lib/node/blocks/section/section.svelte.d.ts +1 -1
- package/lib/node/blocks/slot/component-info.d.ts +1 -1
- package/lib/node/blocks/slot/slot.svelte +12 -13
- package/lib/node/blocks/slot/slot.svelte.d.ts +1 -2
- package/lib/node/blocks/symbol/component-info.d.ts +1 -1
- package/lib/node/blocks/symbol/symbol.helpers.d.ts +2 -2
- package/lib/node/blocks/symbol/symbol.helpers.js +2 -2
- package/lib/node/blocks/symbol/symbol.svelte +6 -6
- package/lib/node/blocks/symbol/symbol.svelte.d.ts +2 -2
- package/lib/node/blocks/symbol/symbol.types.d.ts +2 -2
- package/lib/node/blocks/text/component-info.d.ts +1 -1
- package/lib/node/blocks/text/text.svelte +11 -11
- package/lib/node/blocks/text/text.svelte.d.ts +1 -1
- package/lib/node/blocks/textarea/component-info.d.ts +1 -1
- package/lib/node/blocks/textarea/textarea.svelte +2 -2
- package/lib/node/blocks/video/component-info.d.ts +1 -1
- package/lib/node/blocks/video/video.svelte +19 -19
- package/lib/node/blocks/video/video.svelte.d.ts +1 -1
- package/lib/node/blocks/video/video.types.d.ts +1 -1
- package/lib/node/components/block/animator.d.ts +1 -1
- package/lib/node/components/block/block.helpers.d.ts +4 -4
- package/lib/node/components/block/block.helpers.js +4 -4
- package/lib/node/components/block/block.svelte +4 -4
- package/lib/node/components/block/components/block-styles.svelte +5 -5
- package/lib/node/components/block/components/block-wrapper.svelte +2 -2
- package/lib/node/components/block/components/block-wrapper.svelte.d.ts +2 -2
- package/lib/node/components/block/components/component-ref/component-ref.helpers.d.ts +3 -3
- package/lib/node/components/block/components/component-ref/component-ref.helpers.js +1 -1
- package/lib/node/components/block/components/component-ref/component-ref.svelte +2 -2
- package/lib/node/components/block/components/component-ref/component-ref.svelte.d.ts +1 -1
- package/lib/node/components/block/components/interactive-element.svelte +3 -3
- package/lib/node/components/block/components/repeated-block.svelte +1 -1
- package/lib/node/components/block/components/repeated-block.svelte.d.ts +1 -1
- package/lib/node/components/block/types.d.ts +2 -2
- package/lib/node/components/blocks/blocks-wrapper.svelte +12 -12
- package/lib/node/components/blocks/blocks.svelte +2 -2
- package/lib/node/components/blocks/blocks.svelte.d.ts +1 -1
- package/lib/node/components/blocks/blocks.types.d.ts +1 -1
- package/lib/node/components/content/components/enable-editor.svelte +22 -22
- package/lib/node/components/content/components/enable-editor.svelte.d.ts +7 -7
- package/lib/node/components/content/components/styles.svelte +1 -1
- package/lib/node/components/content/components/styles.svelte.d.ts +1 -1
- package/lib/node/components/content/content.helpers.d.ts +3 -3
- package/lib/node/components/content/content.svelte +7 -7
- package/lib/node/components/content/content.svelte.d.ts +1 -1
- package/lib/node/components/content/content.types.d.ts +2 -2
- package/lib/node/components/content/contentProps.types.d.ts +2 -2
- package/lib/node/components/content-variants/content-variants.svelte +4 -4
- package/lib/node/components/content-variants/content-variants.svelte.d.ts +1 -1
- package/lib/node/components/content-variants/content-variants.types.d.ts +4 -4
- package/lib/node/components/content-variants/helpers.d.ts +5 -5
- package/lib/node/components/content-variants/helpers.js +3 -3
- package/lib/node/components/dynamic-renderer/dynamic-renderer.svelte +3 -3
- package/lib/node/constants/builder-registered-components.d.ts +1 -1
- package/lib/node/constants/builder-registered-components.js +17 -17
- package/lib/node/constants/device-sizes.js +1 -1
- package/lib/node/constants/extra-components.d.ts +1 -1
- package/lib/node/constants/extra-components.js +17 -17
- package/lib/node/constants/sdk-version.d.ts +1 -1
- package/lib/node/constants/sdk-version.js +1 -1
- package/lib/node/constants/target.d.ts +1 -1
- package/lib/node/context/index.d.ts +1 -1
- package/lib/node/context/index.js +1 -1
- package/lib/node/context/types.d.ts +4 -4
- package/lib/node/functions/evaluate/browser-runtime/browser.d.ts +2 -2
- package/lib/node/functions/evaluate/browser-runtime/browser.js +1 -1
- package/lib/node/functions/evaluate/browser-runtime/index.d.ts +1 -1
- package/lib/node/functions/evaluate/browser-runtime/index.js +1 -1
- package/lib/node/functions/evaluate/choose-eval.d.ts +1 -1
- package/lib/node/functions/evaluate/choose-eval.js +3 -3
- package/lib/node/functions/evaluate/edge-runtime/edge-runtime.d.ts +1 -1
- package/lib/node/functions/evaluate/edge-runtime/edge-runtime.js +4 -4
- package/lib/node/functions/evaluate/edge-runtime/index.d.ts +1 -1
- package/lib/node/functions/evaluate/edge-runtime/index.js +1 -1
- package/lib/node/functions/evaluate/evaluate.d.ts +1 -1
- package/lib/node/functions/evaluate/evaluate.js +3 -3
- package/lib/node/functions/evaluate/helpers.d.ts +3 -3
- package/lib/node/functions/evaluate/helpers.js +3 -3
- package/lib/node/functions/evaluate/index.d.ts +1 -1
- package/lib/node/functions/evaluate/index.js +1 -1
- package/lib/node/functions/evaluate/node-runtime/index.d.ts +1 -1
- package/lib/node/functions/evaluate/node-runtime/index.js +1 -1
- package/lib/node/functions/evaluate/node-runtime/init.d.ts +10 -0
- package/lib/node/functions/evaluate/node-runtime/init.js +26 -0
- package/lib/node/functions/evaluate/node-runtime/node-runtime.d.ts +7 -1
- package/lib/node/functions/evaluate/node-runtime/node-runtime.js +36 -10
- package/lib/node/functions/evaluate/placeholder-runtime.d.ts +1 -1
- package/lib/node/functions/evaluate/should-force-browser-runtime-in-node.js +2 -2
- package/lib/node/functions/fetch-builder-props.d.ts +3 -3
- package/lib/node/functions/fetch-builder-props.js +2 -2
- package/lib/node/functions/get-block-actions-handler.d.ts +2 -2
- package/lib/node/functions/get-block-actions-handler.js +1 -1
- package/lib/node/functions/get-block-actions.d.ts +2 -2
- package/lib/node/functions/get-block-actions.js +3 -3
- package/lib/node/functions/get-block-component-options.d.ts +1 -1
- package/lib/node/functions/get-block-properties.d.ts +2 -2
- package/lib/node/functions/get-block-properties.js +3 -3
- package/lib/node/functions/get-builder-search-params/index.d.ts +1 -1
- package/lib/node/functions/get-builder-search-params/index.js +2 -2
- package/lib/node/functions/get-class-prop-name.js +1 -1
- package/lib/node/functions/get-content/generate-content-url.d.ts +1 -1
- package/lib/node/functions/get-content/generate-content-url.js +4 -4
- package/lib/node/functions/get-content/index.d.ts +2 -2
- package/lib/node/functions/get-content/index.js +8 -8
- package/lib/node/functions/get-content/types.d.ts +3 -3
- package/lib/node/functions/get-fetch.js +1 -1
- package/lib/node/functions/get-processed-block.d.ts +2 -2
- package/lib/node/functions/get-processed-block.js +4 -4
- package/lib/node/functions/get-style.d.ts +2 -2
- package/lib/node/functions/get-style.js +3 -3
- package/lib/node/functions/is-edge-runtime.js +2 -2
- package/lib/node/functions/is-editing.d.ts +1 -1
- package/lib/node/functions/is-editing.js +3 -3
- package/lib/node/functions/is-iframe.js +1 -1
- package/lib/node/functions/is-node-runtime.js +1 -1
- package/lib/node/functions/is-previewing.d.ts +1 -1
- package/lib/node/functions/is-previewing.js +3 -3
- package/lib/node/functions/register-component.d.ts +1 -1
- package/lib/node/functions/register-component.js +1 -1
- package/lib/node/functions/register.d.ts +2 -2
- package/lib/node/functions/register.js +1 -1
- package/lib/node/functions/set-editor-settings.js +1 -1
- package/lib/node/functions/track/helpers.js +2 -2
- package/lib/node/functions/track/index.d.ts +2 -2
- package/lib/node/functions/track/index.js +7 -7
- package/lib/node/functions/transform-block-properties.d.ts +2 -2
- package/lib/node/functions/transform-block.d.ts +1 -1
- package/lib/node/functions/transform-style-property.d.ts +2 -2
- package/lib/node/helpers/ab-tests.d.ts +3 -3
- package/lib/node/helpers/ab-tests.js +4 -4
- package/lib/node/helpers/canTrack.js +1 -1
- package/lib/node/helpers/cookie.d.ts +1 -1
- package/lib/node/helpers/cookie.js +4 -4
- package/lib/node/helpers/css.js +2 -2
- package/lib/node/helpers/localStorage.d.ts +2 -2
- package/lib/node/helpers/localStorage.js +1 -1
- package/lib/node/helpers/logger.d.ts +1 -0
- package/lib/node/helpers/logger.js +1 -1
- package/lib/node/helpers/preview-lru-cache/get.d.ts +1 -1
- package/lib/node/helpers/preview-lru-cache/set.d.ts +1 -1
- package/lib/node/helpers/sessionId.d.ts +1 -1
- package/lib/node/helpers/sessionId.js +3 -3
- package/lib/node/helpers/subscribe-to-editor.d.ts +3 -3
- package/lib/node/helpers/subscribe-to-editor.js +4 -4
- package/lib/node/helpers/visitorId.d.ts +1 -1
- package/lib/node/helpers/visitorId.js +3 -3
- package/lib/node/index-helpers/blocks-exports.d.ts +11 -11
- package/lib/node/index-helpers/blocks-exports.js +11 -11
- package/lib/node/index.d.ts +3 -3
- package/lib/node/index.js +3 -3
- package/lib/node/scripts/init-editing.js +5 -5
- package/lib/node/server-index.d.ts +27 -27
- package/lib/node/server-index.js +11 -11
- package/lib/node/types/builder-content.d.ts +3 -3
- package/lib/node/types/builder-props.d.ts +2 -2
- package/lib/node/types/components.d.ts +2 -2
- package/lib/node/types/enforced-partials.d.ts +1 -1
- package/package.json +1 -1
- package/src/blocks/BaseText.svelte +11 -12
- package/src/blocks/button/button.svelte +3 -3
- package/src/blocks/button/button.types.ts +1 -1
- package/src/blocks/button/component-info.ts +1 -1
- package/src/blocks/columns/columns.svelte +18 -18
- package/src/blocks/columns/columns.types.ts +2 -2
- package/src/blocks/columns/component-info.ts +1 -1
- package/src/blocks/custom-code/component-info.ts +1 -1
- package/src/blocks/embed/component-info.ts +1 -1
- package/src/blocks/embed/embed.svelte +1 -1
- package/src/blocks/form/form/component-info.ts +1 -1
- package/src/blocks/form/form/form.svelte +9 -10
- package/src/blocks/form/input/component-info.ts +1 -1
- package/src/blocks/form/input/input.svelte +3 -3
- package/src/blocks/form/select/component-info.ts +1 -1
- package/src/blocks/form/select/select.svelte +4 -4
- package/src/blocks/form/submit-button/component-info.ts +1 -1
- package/src/blocks/form/submit-button/submit-button.svelte +2 -2
- package/src/blocks/fragment/component-info.ts +1 -1
- package/src/blocks/fragment/fragment.svelte +1 -1
- package/src/blocks/image/component-info.ts +1 -1
- package/src/blocks/image/image.svelte +15 -14
- package/src/blocks/image/image.types.ts +1 -1
- package/src/blocks/img/component-info.ts +1 -1
- package/src/blocks/img/img.svelte +14 -14
- package/src/blocks/raw-text/component-info.ts +1 -1
- package/src/blocks/section/component-info.ts +1 -1
- package/src/blocks/section/section.svelte +14 -13
- package/src/blocks/slot/component-info.ts +1 -1
- package/src/blocks/slot/slot.svelte +14 -15
- package/src/blocks/symbol/component-info.ts +1 -1
- package/src/blocks/symbol/symbol.helpers.ts +4 -4
- package/src/blocks/symbol/symbol.svelte +9 -9
- package/src/blocks/symbol/symbol.types.ts +2 -2
- package/src/blocks/text/component-info.ts +1 -1
- package/src/blocks/text/text.svelte +12 -12
- package/src/blocks/textarea/component-info.ts +1 -1
- package/src/blocks/textarea/textarea.svelte +2 -2
- package/src/blocks/video/component-info.ts +1 -1
- package/src/blocks/video/video.svelte +20 -19
- package/src/blocks/video/video.types.ts +1 -1
- package/src/components/block/animator.ts +1 -1
- package/src/components/block/block.helpers.ts +7 -7
- package/src/components/block/block.svelte +7 -7
- package/src/components/block/components/block-styles.svelte +7 -7
- package/src/components/block/components/block-wrapper.svelte +4 -4
- package/src/components/block/components/component-ref/component-ref.helpers.ts +4 -4
- package/src/components/block/components/component-ref/component-ref.svelte +3 -3
- package/src/components/block/components/interactive-element.svelte +6 -6
- package/src/components/block/components/repeated-block.svelte +2 -2
- package/src/components/block/types.ts +2 -2
- package/src/components/blocks/blocks-wrapper.svelte +13 -12
- package/src/components/blocks/blocks.svelte +3 -3
- package/src/components/blocks/blocks.types.ts +1 -1
- package/src/components/content/components/enable-editor.svelte +27 -28
- package/src/components/content/components/styles.svelte +2 -2
- package/src/components/content/content.helpers.ts +4 -4
- package/src/components/content/content.svelte +11 -11
- package/src/components/content/content.types.ts +2 -2
- package/src/components/content/contentProps.types.ts +2 -2
- package/src/components/content-variants/content-variants.svelte +5 -5
- package/src/components/content-variants/content-variants.types.ts +4 -4
- package/src/components/content-variants/helpers.ts +6 -6
- package/src/components/dynamic-renderer/dynamic-renderer.svelte +3 -3
- package/src/constants/builder-registered-components.ts +18 -18
- package/src/constants/device-sizes.ts +1 -1
- package/src/constants/extra-components.ts +18 -18
- package/src/constants/sdk-version.ts +1 -1
- package/src/constants/target.ts +1 -1
- package/src/context/index.ts +1 -1
- package/src/context/types.ts +4 -4
- package/src/functions/evaluate/browser-runtime/browser.ts +3 -3
- package/src/functions/evaluate/browser-runtime/index.ts +1 -1
- package/src/functions/evaluate/choose-eval.ts +4 -4
- package/src/functions/evaluate/edge-runtime/edge-runtime.ts +5 -5
- package/src/functions/evaluate/edge-runtime/index.ts +1 -1
- package/src/functions/evaluate/evaluate.ts +4 -4
- package/src/functions/evaluate/helpers.ts +4 -4
- package/src/functions/evaluate/index.ts +1 -1
- package/src/functions/evaluate/node-runtime/index.ts +1 -1
- package/src/functions/evaluate/node-runtime/init.ts +27 -0
- package/src/functions/evaluate/node-runtime/node-runtime.ts +35 -11
- package/src/functions/evaluate/placeholder-runtime.ts +1 -1
- package/src/functions/evaluate/should-force-browser-runtime-in-node.ts +2 -2
- package/src/functions/fetch-builder-props.ts +5 -5
- package/src/functions/get-block-actions-handler.ts +3 -3
- package/src/functions/get-block-actions.ts +5 -5
- package/src/functions/get-block-component-options.ts +1 -1
- package/src/functions/get-block-properties.ts +5 -5
- package/src/functions/get-builder-search-params/index.ts +3 -3
- package/src/functions/get-class-prop-name.ts +1 -1
- package/src/functions/get-content/generate-content-url.ts +5 -5
- package/src/functions/get-content/index.ts +10 -10
- package/src/functions/get-content/types.ts +3 -3
- package/src/functions/get-fetch.ts +1 -1
- package/src/functions/get-processed-block.ts +6 -6
- package/src/functions/get-style.ts +5 -5
- package/src/functions/is-edge-runtime.ts +2 -2
- package/src/functions/is-editing.ts +3 -3
- package/src/functions/is-iframe.ts +1 -1
- package/src/functions/is-node-runtime.ts +1 -1
- package/src/functions/is-previewing.ts +4 -4
- package/src/functions/register-component.ts +3 -3
- package/src/functions/register.ts +3 -3
- package/src/functions/set-editor-settings.ts +1 -1
- package/src/functions/track/helpers.ts +3 -3
- package/src/functions/track/index.ts +9 -9
- package/src/functions/transform-block-properties.ts +2 -2
- package/src/functions/transform-block.ts +1 -1
- package/src/functions/transform-style-property.ts +2 -2
- package/src/helpers/ab-tests.ts +7 -7
- package/src/helpers/canTrack.ts +1 -1
- package/src/helpers/cookie.ts +5 -5
- package/src/helpers/css.ts +2 -2
- package/src/helpers/localStorage.ts +3 -3
- package/src/helpers/logger.ts +1 -1
- package/src/helpers/preview-lru-cache/get.ts +1 -1
- package/src/helpers/preview-lru-cache/set.ts +1 -1
- package/src/helpers/sessionId.ts +4 -4
- package/src/helpers/subscribe-to-editor.ts +7 -7
- package/src/helpers/visitorId.ts +4 -4
- package/src/index-helpers/blocks-exports.ts +11 -11
- package/src/index.ts +3 -3
- package/src/scripts/init-editing.ts +5 -5
- package/src/server-index.ts +27 -27
- package/src/types/builder-content.ts +3 -3
- package/src/types/builder-props.ts +2 -2
- package/src/types/components.ts +2 -2
- package/src/types/enforced-partials.ts +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { BuilderRenderState } from '../../context/types
|
|
2
|
-
import type { BuilderContent } from '../../types/builder-content
|
|
3
|
-
import type { Nullable } from '../../types/typescript
|
|
4
|
-
import type { ContentProps } from './content.types
|
|
1
|
+
import type { BuilderRenderState } from '../../context/types';
|
|
2
|
+
import type { BuilderContent } from '../../types/builder-content';
|
|
3
|
+
import type { Nullable } from '../../types/typescript';
|
|
4
|
+
import type { ContentProps } from './content.types';
|
|
5
5
|
export const getRootStateInitialValue = ({
|
|
6
6
|
content,
|
|
7
7
|
data,
|
|
@@ -2,28 +2,28 @@
|
|
|
2
2
|
import { setContext } from "svelte";
|
|
3
3
|
import { writable } from "svelte/store";
|
|
4
4
|
|
|
5
|
-
import { getDefaultRegisteredComponents } from "../../constants/builder-registered-components
|
|
6
|
-
import { TARGET } from "../../constants/target
|
|
7
|
-
import ComponentsContext from "../../context/components.context
|
|
5
|
+
import { getDefaultRegisteredComponents } from "../../constants/builder-registered-components";
|
|
6
|
+
import { TARGET } from "../../constants/target";
|
|
7
|
+
import ComponentsContext from "../../context/components.context";
|
|
8
8
|
import type {
|
|
9
9
|
BuilderContextInterface,
|
|
10
10
|
BuilderRenderState,
|
|
11
11
|
RegisteredComponents,
|
|
12
|
-
} from "../../context/types
|
|
13
|
-
import { serializeComponentInfo } from "../../functions/register-component
|
|
14
|
-
import type { ComponentInfo } from "../../types/components
|
|
15
|
-
import type { Dictionary } from "../../types/typescript
|
|
12
|
+
} from "../../context/types";
|
|
13
|
+
import { serializeComponentInfo } from "../../functions/register-component";
|
|
14
|
+
import type { ComponentInfo } from "../../types/components";
|
|
15
|
+
import type { Dictionary } from "../../types/typescript";
|
|
16
16
|
import Blocks from "../blocks/blocks.svelte";
|
|
17
|
-
import { getUpdateVariantVisibilityScript } from "../content-variants/helpers
|
|
17
|
+
import { getUpdateVariantVisibilityScript } from "../content-variants/helpers";
|
|
18
18
|
import InlinedScript from "../inlined-script.svelte";
|
|
19
19
|
import EnableEditor from "./components/enable-editor.svelte";
|
|
20
20
|
import ContentStyles from "./components/styles.svelte";
|
|
21
21
|
import {
|
|
22
22
|
getContentInitialValue,
|
|
23
23
|
getRootStateInitialValue,
|
|
24
|
-
} from "./content.helpers
|
|
25
|
-
import type { ContentProps } from "./content.types
|
|
26
|
-
import { wrapComponentRef } from "./wrap-component-ref
|
|
24
|
+
} from "./content.helpers";
|
|
25
|
+
import type { ContentProps } from "./content.types";
|
|
26
|
+
import { wrapComponentRef } from "./wrap-component-ref";
|
|
27
27
|
|
|
28
28
|
export let content: ContentProps["content"] = undefined;
|
|
29
29
|
export let customComponents: ContentProps["customComponents"] = undefined;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { BuilderRenderState } from '../../context/types
|
|
2
|
-
export type { ContentProps } from './contentProps.types
|
|
1
|
+
import type { BuilderRenderState } from '../../context/types';
|
|
2
|
+
export type { ContentProps } from './contentProps.types';
|
|
3
3
|
export interface BuilderComponentStateChange {
|
|
4
4
|
state: BuilderRenderState;
|
|
5
5
|
ref: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { EnforcePartials } from '../../types/enforced-partials
|
|
2
|
-
import type { ContentVariantsPrps } from '../content-variants/content-variants.types
|
|
1
|
+
import type { EnforcePartials } from '../../types/enforced-partials';
|
|
2
|
+
import type { ContentVariantsPrps } from '../content-variants/content-variants.types';
|
|
3
3
|
interface InternalRenderProps {
|
|
4
4
|
showContent: boolean;
|
|
5
5
|
isSsrAbTest: boolean;
|
|
@@ -10,19 +10,19 @@
|
|
|
10
10
|
<script lang="ts">
|
|
11
11
|
import { onMount } from "svelte";
|
|
12
12
|
|
|
13
|
-
import { TARGET } from "../../constants/target
|
|
14
|
-
import { handleABTestingSync } from "../../helpers/ab-tests
|
|
15
|
-
import { getDefaultCanTrack } from "../../helpers/canTrack
|
|
13
|
+
import { TARGET } from "../../constants/target";
|
|
14
|
+
import { handleABTestingSync } from "../../helpers/ab-tests";
|
|
15
|
+
import { getDefaultCanTrack } from "../../helpers/canTrack";
|
|
16
16
|
import ContentComponent from "../content/content.svelte";
|
|
17
17
|
import InlinedScript from "../inlined-script.svelte";
|
|
18
18
|
import InlinedStyles from "../inlined-styles.svelte";
|
|
19
|
-
import type { ContentVariantsPrps } from "./content-variants.types
|
|
19
|
+
import type { ContentVariantsPrps } from "./content-variants.types";
|
|
20
20
|
import {
|
|
21
21
|
checkShouldRenderVariants,
|
|
22
22
|
getInitVariantsFnsScriptString,
|
|
23
23
|
getUpdateCookieAndStylesScript,
|
|
24
24
|
getVariants,
|
|
25
|
-
} from "./helpers
|
|
25
|
+
} from "./helpers";
|
|
26
26
|
|
|
27
27
|
export let canTrack: VariantsProviderProps["canTrack"] = undefined;
|
|
28
28
|
export let content: VariantsProviderProps["content"] = undefined;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { BuilderRenderContext, RegisteredComponent } from '../../context/types
|
|
2
|
-
import type { ApiVersion } from '../../types/api-version
|
|
3
|
-
import type { BuilderContent } from '../../types/builder-content
|
|
4
|
-
import type { Nullable } from '../../types/typescript
|
|
1
|
+
import type { BuilderRenderContext, RegisteredComponent } from '../../context/types';
|
|
2
|
+
import type { ApiVersion } from '../../types/api-version';
|
|
3
|
+
import type { BuilderContent } from '../../types/builder-content';
|
|
4
|
+
import type { Nullable } from '../../types/typescript';
|
|
5
5
|
export interface ContentVariantsPrps {
|
|
6
6
|
/**
|
|
7
7
|
* The Builder content JSON to render (required).
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { TARGET } from '../../constants/target
|
|
2
|
-
import { isBrowser } from '../../functions/is-browser
|
|
3
|
-
import type { Nullable } from '../../helpers/nullable
|
|
4
|
-
import type { BuilderContent } from '../../types/builder-content
|
|
5
|
-
import type { Target } from '../../types/targets
|
|
6
|
-
import { UPDATE_COOKIES_AND_STYLES_SCRIPT, UPDATE_VARIANT_VISIBILITY_SCRIPT } from './inlined-fns
|
|
1
|
+
import { TARGET } from '../../constants/target';
|
|
2
|
+
import { isBrowser } from '../../functions/is-browser';
|
|
3
|
+
import type { Nullable } from '../../helpers/nullable';
|
|
4
|
+
import type { BuilderContent } from '../../types/builder-content';
|
|
5
|
+
import type { Target } from '../../types/targets';
|
|
6
|
+
import { UPDATE_COOKIES_AND_STYLES_SCRIPT, UPDATE_VARIANT_VISIBILITY_SCRIPT } from './inlined-fns';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* We hardcode explicit function names here, because the `.toString()` of a function can change depending on the bundler.
|
|
@@ -8,11 +8,11 @@
|
|
|
8
8
|
</script>
|
|
9
9
|
|
|
10
10
|
<script lang="ts">
|
|
11
|
-
import { isEmptyElement } from "./dynamic-renderer.helpers
|
|
12
|
-
import { setAttrs } from "../../blocks/helpers
|
|
11
|
+
import { isEmptyElement } from "./dynamic-renderer.helpers";
|
|
12
|
+
import { setAttrs } from "../../blocks/helpers";
|
|
13
13
|
|
|
14
|
-
export let attributes: DynamicRendererProps["attributes"];
|
|
15
14
|
export let TagName: DynamicRendererProps["TagName"];
|
|
15
|
+
export let attributes: DynamicRendererProps["attributes"];
|
|
16
16
|
export let actionAttributes: DynamicRendererProps["actionAttributes"];
|
|
17
17
|
</script>
|
|
18
18
|
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { componentInfo as buttonComponentInfo } from '../blocks/button/component-info
|
|
2
|
-
import { default as Button } from '../blocks/button/index
|
|
3
|
-
import { componentInfo as columnsComponentInfo } from '../blocks/columns/component-info
|
|
4
|
-
import { default as Columns } from '../blocks/columns/index
|
|
5
|
-
import { componentInfo as fragmentComponentInfo } from '../blocks/fragment/component-info
|
|
6
|
-
import { default as Fragment } from '../blocks/fragment/index
|
|
7
|
-
import { componentInfo as imageComponentInfo } from '../blocks/image/component-info
|
|
8
|
-
import { default as Image } from '../blocks/image/index
|
|
9
|
-
import { componentInfo as sectionComponentInfo } from '../blocks/section/component-info
|
|
10
|
-
import { default as Section } from '../blocks/section/index
|
|
11
|
-
import { componentInfo as slotComponentInfo } from '../blocks/slot/component-info
|
|
12
|
-
import { default as Slot } from '../blocks/slot/index
|
|
13
|
-
import { componentInfo as symbolComponentInfo } from '../blocks/symbol/component-info
|
|
14
|
-
import { default as Symbol } from '../blocks/symbol/index
|
|
15
|
-
import { componentInfo as textComponentInfo } from '../blocks/text/component-info
|
|
16
|
-
import { default as Text } from '../blocks/text/index
|
|
17
|
-
import type { RegisteredComponent } from '../context/types
|
|
18
|
-
import { getExtraComponents } from './extra-components
|
|
1
|
+
import { componentInfo as buttonComponentInfo } from '../blocks/button/component-info';
|
|
2
|
+
import { default as Button } from '../blocks/button/index';
|
|
3
|
+
import { componentInfo as columnsComponentInfo } from '../blocks/columns/component-info';
|
|
4
|
+
import { default as Columns } from '../blocks/columns/index';
|
|
5
|
+
import { componentInfo as fragmentComponentInfo } from '../blocks/fragment/component-info';
|
|
6
|
+
import { default as Fragment } from '../blocks/fragment/index';
|
|
7
|
+
import { componentInfo as imageComponentInfo } from '../blocks/image/component-info';
|
|
8
|
+
import { default as Image } from '../blocks/image/index';
|
|
9
|
+
import { componentInfo as sectionComponentInfo } from '../blocks/section/component-info';
|
|
10
|
+
import { default as Section } from '../blocks/section/index';
|
|
11
|
+
import { componentInfo as slotComponentInfo } from '../blocks/slot/component-info';
|
|
12
|
+
import { default as Slot } from '../blocks/slot/index';
|
|
13
|
+
import { componentInfo as symbolComponentInfo } from '../blocks/symbol/component-info';
|
|
14
|
+
import { default as Symbol } from '../blocks/symbol/index';
|
|
15
|
+
import { componentInfo as textComponentInfo } from '../blocks/text/component-info';
|
|
16
|
+
import { default as Text } from '../blocks/text/index';
|
|
17
|
+
import type { RegisteredComponent } from '../context/types';
|
|
18
|
+
import { getExtraComponents } from './extra-components';
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
21
|
* Returns a list of all registered components.
|
|
@@ -4,24 +4,24 @@
|
|
|
4
4
|
* React Native SDK.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import { componentInfo as customCodeInfo } from '../blocks/custom-code/component-info
|
|
8
|
-
import { default as customCode } from '../blocks/custom-code/index
|
|
9
|
-
import { componentInfo as embedComponentInfo } from '../blocks/embed/component-info
|
|
10
|
-
import { default as embed } from '../blocks/embed/index
|
|
11
|
-
import { componentInfo as formComponentInfo } from '../blocks/form/form/component-info
|
|
12
|
-
import { default as Form } from '../blocks/form/form/index
|
|
13
|
-
import { componentInfo as formInputComponentInfo } from '../blocks/form/input/component-info
|
|
14
|
-
import { default as FormInput } from '../blocks/form/input/index
|
|
15
|
-
import { componentInfo as formSelectComponentInfo } from '../blocks/form/select/component-info
|
|
16
|
-
import { default as FormSelect } from '../blocks/form/select/index
|
|
17
|
-
import { componentInfo as formSubmitButtonComponentInfo } from '../blocks/form/submit-button/component-info
|
|
18
|
-
import { default as FormSubmitButton } from '../blocks/form/submit-button/index
|
|
19
|
-
import { componentInfo as imgComponentInfo } from '../blocks/img/component-info
|
|
20
|
-
import { default as Img } from '../blocks/img/index
|
|
21
|
-
import { componentInfo as videoComponentInfo } from '../blocks/video/component-info
|
|
22
|
-
import { default as Video } from '../blocks/video/index
|
|
23
|
-
import type { RegisteredComponent } from '../context/types
|
|
24
|
-
import { TARGET } from './target
|
|
7
|
+
import { componentInfo as customCodeInfo } from '../blocks/custom-code/component-info';
|
|
8
|
+
import { default as customCode } from '../blocks/custom-code/index';
|
|
9
|
+
import { componentInfo as embedComponentInfo } from '../blocks/embed/component-info';
|
|
10
|
+
import { default as embed } from '../blocks/embed/index';
|
|
11
|
+
import { componentInfo as formComponentInfo } from '../blocks/form/form/component-info';
|
|
12
|
+
import { default as Form } from '../blocks/form/form/index';
|
|
13
|
+
import { componentInfo as formInputComponentInfo } from '../blocks/form/input/component-info';
|
|
14
|
+
import { default as FormInput } from '../blocks/form/input/index';
|
|
15
|
+
import { componentInfo as formSelectComponentInfo } from '../blocks/form/select/component-info';
|
|
16
|
+
import { default as FormSelect } from '../blocks/form/select/index';
|
|
17
|
+
import { componentInfo as formSubmitButtonComponentInfo } from '../blocks/form/submit-button/component-info';
|
|
18
|
+
import { default as FormSubmitButton } from '../blocks/form/submit-button/index';
|
|
19
|
+
import { componentInfo as imgComponentInfo } from '../blocks/img/component-info';
|
|
20
|
+
import { default as Img } from '../blocks/img/index';
|
|
21
|
+
import { componentInfo as videoComponentInfo } from '../blocks/video/component-info';
|
|
22
|
+
import { default as Video } from '../blocks/video/index';
|
|
23
|
+
import type { RegisteredComponent } from '../context/types';
|
|
24
|
+
import { TARGET } from './target';
|
|
25
25
|
export const getExtraComponents: () => RegisteredComponent[] = () => [{
|
|
26
26
|
component: customCode,
|
|
27
27
|
...customCodeInfo
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "1.0.
|
|
1
|
+
export const SDK_VERSION = "1.0.21"
|
package/src/constants/target.ts
CHANGED
package/src/context/index.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default as BuilderContext } from './builder.context
|
|
1
|
+
export { default as BuilderContext } from './builder.context'
|
package/src/context/types.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { BlocksWrapperProps } from '../components/blocks/blocks-wrapper.svelte';
|
|
2
|
-
import type { ApiVersion } from '../types/api-version
|
|
3
|
-
import type { BuilderContent } from '../types/builder-content
|
|
4
|
-
import type { ComponentInfo } from '../types/components
|
|
5
|
-
import type { Dictionary, Nullable } from '../types/typescript
|
|
2
|
+
import type { ApiVersion } from '../types/api-version';
|
|
3
|
+
import type { BuilderContent } from '../types/builder-content';
|
|
4
|
+
import type { ComponentInfo } from '../types/components';
|
|
5
|
+
import type { Dictionary, Nullable } from '../types/typescript';
|
|
6
6
|
export type RegisteredComponent = ComponentInfo & {
|
|
7
7
|
component: any;
|
|
8
8
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { BuilderRenderState } from '../../../context/types
|
|
2
|
-
import type { ExecutorArgs } from '../helpers
|
|
3
|
-
import { getFunctionArguments } from '../helpers
|
|
1
|
+
import type { BuilderRenderState } from '../../../context/types';
|
|
2
|
+
import type { ExecutorArgs } from '../helpers';
|
|
3
|
+
import { getFunctionArguments } from '../helpers';
|
|
4
4
|
export const runInBrowser = ({
|
|
5
5
|
code,
|
|
6
6
|
builder,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { runInBrowser as evaluator } from './browser
|
|
1
|
+
export { runInBrowser as evaluator } from './browser'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { isBrowser } from '../is-browser
|
|
2
|
-
import { runInBrowser } from './browser-runtime/browser
|
|
3
|
-
import type { ExecutorArgs } from './helpers
|
|
1
|
+
import { isBrowser } from '../is-browser';
|
|
2
|
+
import { runInBrowser } from './browser-runtime/browser';
|
|
3
|
+
import type { ExecutorArgs } from './helpers';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* THIS IS A MAGICAL IMPORT. It is aliased by the build process of every SDK configuration, so that
|
|
@@ -14,7 +14,7 @@ import type { ExecutorArgs } from './helpers.js';
|
|
|
14
14
|
* types can be resolved correctly.
|
|
15
15
|
*/
|
|
16
16
|
import { evaluator } from 'placeholder-runtime';
|
|
17
|
-
import { shouldForceBrowserRuntimeInNode } from './should-force-browser-runtime-in-node
|
|
17
|
+
import { shouldForceBrowserRuntimeInNode } from './should-force-browser-runtime-in-node';
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
20
|
* Even though we have separate runtimes for browser/node/edge, sometimes frameworks will
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { logger } from '../../../helpers/logger
|
|
2
|
-
import { set } from '../../set
|
|
3
|
-
import type { ExecutorArgs } from '../helpers
|
|
4
|
-
import { getFunctionArguments } from '../helpers
|
|
5
|
-
import Interpreter from './acorn-interpreter
|
|
1
|
+
import { logger } from '../../../helpers/logger';
|
|
2
|
+
import { set } from '../../set';
|
|
3
|
+
import type { ExecutorArgs } from '../helpers';
|
|
4
|
+
import { getFunctionArguments } from '../helpers';
|
|
5
|
+
import Interpreter from './acorn-interpreter';
|
|
6
6
|
const processCode = (code: string) => {
|
|
7
7
|
return code.split('\n').map(line => {
|
|
8
8
|
const trimmed = line.trim();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { runInEdge as evaluator } from './edge-runtime
|
|
1
|
+
export { runInEdge as evaluator } from './edge-runtime'
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { logger } from '../../helpers/logger
|
|
2
|
-
import { chooseBrowserOrServerEval } from './choose-eval
|
|
3
|
-
import type { EvaluatorArgs, ExecutorArgs } from './helpers
|
|
4
|
-
import { getBuilderGlobals, parseCode } from './helpers
|
|
1
|
+
import { logger } from '../../helpers/logger';
|
|
2
|
+
import { chooseBrowserOrServerEval } from './choose-eval';
|
|
3
|
+
import type { EvaluatorArgs, ExecutorArgs } from './helpers';
|
|
4
|
+
import { getBuilderGlobals, parseCode } from './helpers';
|
|
5
5
|
type EvalValue = unknown;
|
|
6
6
|
class EvalCache {
|
|
7
7
|
static cacheLimit = 20;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { BuilderContextInterface, BuilderRenderState } from '../../context/types
|
|
2
|
-
import { isBrowser } from '../is-browser
|
|
3
|
-
import { isEditing } from '../is-editing
|
|
4
|
-
import { getUserAttributes } from '../track/helpers
|
|
1
|
+
import type { BuilderContextInterface, BuilderRenderState } from '../../context/types';
|
|
2
|
+
import { isBrowser } from '../is-browser';
|
|
3
|
+
import { isEditing } from '../is-editing';
|
|
4
|
+
import { getUserAttributes } from '../track/helpers';
|
|
5
5
|
export type EvaluatorArgs = Omit<ExecutorArgs, 'builder' | 'event'> & {
|
|
6
6
|
event?: Event;
|
|
7
7
|
isExpression?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { evaluate } from './evaluate
|
|
1
|
+
export { evaluate } from './evaluate'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { runInNode as evaluator } from './node-runtime
|
|
1
|
+
export { runInNode as evaluator } from './node-runtime'
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file:
|
|
3
|
+
* - imports `isolated-vm`, which can only be made from a file that never runs
|
|
4
|
+
* on the client (e.g. Next's `_document.tsx`)
|
|
5
|
+
* - stores the ivm instance in a global variable using `setIvm`
|
|
6
|
+
*
|
|
7
|
+
* This is needed for when bundlers/meta-frameworks are not able to reliably
|
|
8
|
+
* import the `isolated-vm` package using our `safeDynamicRequire` trick.
|
|
9
|
+
*
|
|
10
|
+
* The `isolated-vm` import must exist in this separate file, or it will end up
|
|
11
|
+
* in the SDK's main entry point, causing errors for users.
|
|
12
|
+
*/
|
|
13
|
+
import ivm from 'isolated-vm';
|
|
14
|
+
import { setIvm } from './node-runtime';
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* This function initializes the SDK on a Node server. It handles importing the
|
|
18
|
+
* `isolated-vm` package which is needed for dynamic bindings.
|
|
19
|
+
*
|
|
20
|
+
* NOTE: this function cannot be called on the client. You must call this function
|
|
21
|
+
* from a server-only location, such as:
|
|
22
|
+
* - The NextJS Pages router's `_document.tsx`
|
|
23
|
+
* - Your Remix route's `loader`
|
|
24
|
+
*/
|
|
25
|
+
export const initializeNodeRuntime = () => {
|
|
26
|
+
setIvm(ivm);
|
|
27
|
+
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { MSG_PREFIX, logger } from '../../../helpers/logger';
|
|
2
|
+
import { fastClone } from '../../fast-clone';
|
|
3
|
+
import { set } from '../../set';
|
|
4
|
+
import type { BuilderGlobals, ExecutorArgs, FunctionArguments } from '../helpers';
|
|
5
|
+
import { getFunctionArguments } from '../helpers';
|
|
6
|
+
import { safeDynamicRequire } from './safeDynamicRequire';
|
|
6
7
|
const getSyncValName = (key: string) => `bldr_${key}_sync`;
|
|
7
8
|
const BUILDER_SET_STATE_NAME = 'BUILDER_SET_STATE';
|
|
8
9
|
const INJECTED_IVM_GLOBAL = 'BUILDER_IVM';
|
|
@@ -62,12 +63,35 @@ if (typeof output === 'object' && output !== null) {
|
|
|
62
63
|
output;
|
|
63
64
|
`;
|
|
64
65
|
};
|
|
66
|
+
let IVM_INSTANCE: typeof import('isolated-vm') | null = null;
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Set the `isolated-vm` instance to be used by the node runtime.
|
|
70
|
+
* This is useful for environments that are not able to rely on our
|
|
71
|
+
* `safeDynamicRequire` trick to import the `isolated-vm` package.
|
|
72
|
+
*/
|
|
73
|
+
export const setIvm = (ivm: typeof import('isolated-vm')) => {
|
|
74
|
+
IVM_INSTANCE = ivm;
|
|
75
|
+
};
|
|
76
|
+
const getIvm = (): typeof import('isolated-vm') => {
|
|
77
|
+
try {
|
|
78
|
+
if (IVM_INSTANCE) return IVM_INSTANCE;
|
|
79
|
+
const dynRequiredIvm = safeDynamicRequire('isolated-vm');
|
|
80
|
+
if (dynRequiredIvm) return dynRequiredIvm;
|
|
81
|
+
} catch (error) {
|
|
82
|
+
logger.error('isolated-vm import error.', error);
|
|
83
|
+
}
|
|
84
|
+
throw new Error(`${MSG_PREFIX}could not import \`isolated-vm\` module for safe script execution on Node server.
|
|
85
|
+
|
|
86
|
+
In certain Node environments, the SDK requires additional initialization steps. This can be achieved by
|
|
87
|
+
importing and calling \`initializeNodeRuntime()\` from "@builder.io/sdk-react/node/init". This must be done in
|
|
88
|
+
a server-only execution path within your application.
|
|
89
|
+
|
|
90
|
+
Please see the documentation for more information: https://builder.io/c/docs/integration-tips#enabling-data-bindings-in-node-environments
|
|
91
|
+
`);
|
|
92
|
+
};
|
|
65
93
|
const getIsolateContext = () => {
|
|
66
|
-
|
|
67
|
-
// return Builder.serverContext;
|
|
68
|
-
// }
|
|
69
|
-
// Builder.setServerContext(isolate.createContextSync());
|
|
70
|
-
const ivm: typeof import('isolated-vm') = safeDynamicRequire('isolated-vm');
|
|
94
|
+
const ivm = getIvm();
|
|
71
95
|
const isolate = new ivm.Isolate({
|
|
72
96
|
memoryLimit: 128
|
|
73
97
|
});
|
|
@@ -82,7 +106,7 @@ export const runInNode = ({
|
|
|
82
106
|
rootSetState,
|
|
83
107
|
rootState
|
|
84
108
|
}: ExecutorArgs) => {
|
|
85
|
-
const ivm
|
|
109
|
+
const ivm = getIvm();
|
|
86
110
|
const state = fastClone({
|
|
87
111
|
...rootState,
|
|
88
112
|
...localState
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ExecutorArgs } from './helpers
|
|
1
|
+
import type { ExecutorArgs } from './helpers';
|
|
2
2
|
export const evaluator = (_args: ExecutorArgs) => {
|
|
3
3
|
throw new Error('Placeholder evaluator not implemented. Make sure the SDK is properly replacing the import to the evaluator with one of edge/node/browser runtime evaluators.');
|
|
4
4
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { logger } from '../../helpers/logger
|
|
2
|
-
import { isNodeRuntime } from '../is-node-runtime
|
|
1
|
+
import { logger } from '../../helpers/logger';
|
|
2
|
+
import { isNodeRuntime } from '../is-node-runtime';
|
|
3
3
|
export const shouldForceBrowserRuntimeInNode = () => {
|
|
4
4
|
if (!isNodeRuntime()) return false;
|
|
5
5
|
const isArm64 = process.arch === 'arm64';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { ContentVariantsPrps } from '../components/content-variants/content-variants.types
|
|
2
|
-
import type { Dictionary } from '../types/typescript
|
|
3
|
-
import { getBuilderSearchParams } from './get-builder-search-params/index
|
|
4
|
-
import { fetchOneEntry } from './get-content/index
|
|
5
|
-
import type { GetContentOptions } from './get-content/types
|
|
1
|
+
import type { ContentVariantsPrps } from '../components/content-variants/content-variants.types';
|
|
2
|
+
import type { Dictionary } from '../types/typescript';
|
|
3
|
+
import { getBuilderSearchParams } from './get-builder-search-params/index';
|
|
4
|
+
import { fetchOneEntry } from './get-content/index';
|
|
5
|
+
import type { GetContentOptions } from './get-content/types';
|
|
6
6
|
type GetBuilderPropsOptions = (Omit<GetContentOptions, 'model'> & {
|
|
7
7
|
model?: string;
|
|
8
8
|
}) & ({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { BuilderContextInterface } from '../context/types
|
|
2
|
-
import type { BuilderBlock } from '../types/builder-block
|
|
3
|
-
import { evaluate } from './evaluate/index
|
|
1
|
+
import type { BuilderContextInterface } from '../context/types';
|
|
2
|
+
import type { BuilderBlock } from '../types/builder-block';
|
|
3
|
+
import { evaluate } from './evaluate/index';
|
|
4
4
|
type Options = {
|
|
5
5
|
block: BuilderBlock;
|
|
6
6
|
} & Pick<BuilderContextInterface, 'localState' | 'context' | 'rootState' | 'rootSetState'>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { TARGET } from '../constants/target
|
|
2
|
-
import type { BuilderContextInterface } from '../context/types
|
|
3
|
-
import type { BuilderBlock } from '../types/builder-block
|
|
4
|
-
import { getEventHandlerName } from './event-handler-name
|
|
5
|
-
import { createEventHandler } from './get-block-actions-handler
|
|
1
|
+
import { TARGET } from '../constants/target';
|
|
2
|
+
import type { BuilderContextInterface } from '../context/types';
|
|
3
|
+
import type { BuilderBlock } from '../types/builder-block';
|
|
4
|
+
import { getEventHandlerName } from './event-handler-name';
|
|
5
|
+
import { createEventHandler } from './get-block-actions-handler';
|
|
6
6
|
type Actions = {
|
|
7
7
|
[index: string]: (event: Event) => any;
|
|
8
8
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { BuilderContextInterface } from '../context/types
|
|
2
|
-
import type { BuilderBlock } from '../types/builder-block
|
|
3
|
-
import { getClassPropName } from './get-class-prop-name
|
|
4
|
-
import { getStyle } from './get-style
|
|
5
|
-
import { transformBlockProperties } from './transform-block-properties
|
|
1
|
+
import type { BuilderContextInterface } from '../context/types';
|
|
2
|
+
import type { BuilderBlock } from '../types/builder-block';
|
|
3
|
+
import { getClassPropName } from './get-class-prop-name';
|
|
4
|
+
import { getStyle } from './get-style';
|
|
5
|
+
import { transformBlockProperties } from './transform-block-properties';
|
|
6
6
|
const extractRelevantRootBlockProperties = (block: BuilderBlock) => {
|
|
7
7
|
// currently we are only spreading the `href` property
|
|
8
8
|
// TO-DO: potentially spread all properties from block, but only if they are not already defined by BuilderBlock
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { QueryObject } from '../../helpers/search/search
|
|
2
|
-
import { normalizeSearchParams } from '../../helpers/search/search
|
|
3
|
-
import { isBrowser } from '../is-browser
|
|
1
|
+
import type { QueryObject } from '../../helpers/search/search';
|
|
2
|
+
import { normalizeSearchParams } from '../../helpers/search/search';
|
|
3
|
+
import { isBrowser } from '../is-browser';
|
|
4
4
|
const BUILDER_SEARCHPARAMS_PREFIX = 'builder.';
|
|
5
5
|
const BUILDER_OPTIONS_PREFIX = 'options.';
|
|
6
6
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { flatten } from '../../helpers/flatten
|
|
2
|
-
import { normalizeSearchParams } from '../../helpers/search/search
|
|
3
|
-
import { DEFAULT_API_VERSION } from '../../types/api-version
|
|
4
|
-
import { getBuilderSearchParamsFromWindow } from '../get-builder-search-params/index
|
|
5
|
-
import type { GetContentOptions } from './types
|
|
1
|
+
import { flatten } from '../../helpers/flatten';
|
|
2
|
+
import { normalizeSearchParams } from '../../helpers/search/search';
|
|
3
|
+
import { DEFAULT_API_VERSION } from '../../types/api-version';
|
|
4
|
+
import { getBuilderSearchParamsFromWindow } from '../get-builder-search-params/index';
|
|
5
|
+
import type { GetContentOptions } from './types';
|
|
6
6
|
const isPositiveNumber = (thing: unknown) => typeof thing === 'number' && !isNaN(thing) && thing >= 0;
|
|
7
7
|
export const generateContentUrl = (options: GetContentOptions): URL => {
|
|
8
8
|
const {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { TARGET } from '../../constants/target
|
|
2
|
-
import { handleABTesting } from '../../helpers/ab-tests
|
|
3
|
-
import { getDefaultCanTrack } from '../../helpers/canTrack
|
|
4
|
-
import { logger } from '../../helpers/logger
|
|
5
|
-
import { getPreviewContent } from '../../helpers/preview-lru-cache/get
|
|
6
|
-
import type { BuilderContent } from '../../types/builder-content
|
|
7
|
-
import { fetch } from '../get-fetch
|
|
8
|
-
import { isBrowser } from '../is-browser
|
|
9
|
-
import { generateContentUrl } from './generate-content-url
|
|
10
|
-
import type { GetContentOptions } from './types
|
|
1
|
+
import { TARGET } from '../../constants/target';
|
|
2
|
+
import { handleABTesting } from '../../helpers/ab-tests';
|
|
3
|
+
import { getDefaultCanTrack } from '../../helpers/canTrack';
|
|
4
|
+
import { logger } from '../../helpers/logger';
|
|
5
|
+
import { getPreviewContent } from '../../helpers/preview-lru-cache/get';
|
|
6
|
+
import type { BuilderContent } from '../../types/builder-content';
|
|
7
|
+
import { fetch } from '../get-fetch';
|
|
8
|
+
import { isBrowser } from '../is-browser';
|
|
9
|
+
import { generateContentUrl } from './generate-content-url';
|
|
10
|
+
import type { GetContentOptions } from './types';
|
|
11
11
|
const checkContentHasResults = (content: ContentResponse): content is ContentResults => 'results' in content;
|
|
12
12
|
|
|
13
13
|
/**
|
|
@@ -148,10 +148,10 @@ export interface GetContentOptions {
|
|
|
148
148
|
/**
|
|
149
149
|
* Optional override of the `fetch` function. (Defaults to global `fetch`)
|
|
150
150
|
*/
|
|
151
|
-
fetch?:
|
|
151
|
+
fetch?: (input: string, init?: object) => Promise<any>;
|
|
152
152
|
|
|
153
153
|
/**
|
|
154
|
-
* Optional fetch options to be passed to the `fetch` function.
|
|
154
|
+
* Optional fetch options to be passed as the second argument to the `fetch` function.
|
|
155
155
|
*/
|
|
156
|
-
fetchOptions?:
|
|
156
|
+
fetchOptions?: object;
|
|
157
157
|
}
|