@builder.io/sdk-react 2.0.24-4 → 2.0.24
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-exports.cjs +2 -2
- package/lib/browser/blocks-exports.mjs +4 -4
- package/lib/browser/index.cjs +1 -1
- package/lib/browser/index.mjs +1 -1
- package/lib/browser/{server-entry-416ffa04.cjs → server-entry-0dfca5e0.cjs} +1 -1
- package/lib/browser/{server-entry-9d006173.js → server-entry-578cd6e2.js} +1 -1
- package/lib/browser/server-entry.cjs +1 -1
- package/lib/browser/server-entry.mjs +1 -1
- package/lib/edge/{accordion-f69d6e22.js → accordion-5b929fba.js} +1 -1
- package/lib/edge/{accordion-985d80e5.cjs → accordion-bb9fa8d9.cjs} +1 -1
- package/lib/edge/{blocks-a9dfda85.cjs → blocks-cff95ab8.cjs} +5 -5
- package/lib/edge/{blocks-08df0336.js → blocks-e8701f70.js} +25 -25
- package/lib/edge/blocks-exports.cjs +1 -1
- package/lib/edge/blocks-exports.mjs +2 -2
- package/lib/edge/{button-ae1b9d7b.cjs → button-89adbac2.cjs} +1 -1
- package/lib/edge/{button-286bd20e.js → button-dd9c397c.js} +2 -2
- package/lib/edge/{columns-f1c4af32.js → columns-acd49f06.js} +4 -4
- package/lib/edge/{columns-5319c0d2.cjs → columns-b0cfdce7.cjs} +1 -1
- package/lib/edge/{content-variants-582c8283.js → content-variants-2cbf3c83.js} +11 -11
- package/lib/edge/{content-variants-0eb27f48.cjs → content-variants-56c457f6.cjs} +1 -1
- package/lib/edge/{evaluate-322711e6.js → evaluate-68711886.js} +1 -1
- package/lib/edge/{evaluate-8ba3acb6.cjs → evaluate-efa88e4b.cjs} +1 -1
- package/lib/edge/{form-3aa4916c.js → form-060579d1.js} +4 -4
- package/lib/edge/{form-67f85cf1.cjs → form-85e86f80.cjs} +1 -1
- package/lib/edge/{get-class-prop-name-e91f3997.js → get-class-prop-name-bb0664a1.js} +1 -1
- package/lib/edge/{get-class-prop-name-a62b4faa.cjs → get-class-prop-name-d6d04e54.cjs} +1 -1
- package/lib/edge/{img-dff54673.cjs → img-7267e34a.cjs} +1 -1
- package/lib/edge/{img-faea3d08.js → img-cb9a2e73.js} +1 -1
- package/lib/edge/index.cjs +1 -1
- package/lib/edge/index.mjs +1 -1
- package/lib/edge/{input-d2659b98.cjs → input-0a7941d1.cjs} +1 -1
- package/lib/edge/{input-6e519eca.js → input-99f775bd.js} +1 -1
- package/lib/edge/{select-2d29658c.js → select-88a74342.js} +1 -1
- package/lib/edge/{select-4bd3e6f1.cjs → select-9791ad44.cjs} +1 -1
- package/lib/edge/{server-entry-cb45c291.js → server-entry-a7db0ef9.js} +1 -1
- package/lib/edge/{server-entry-bfd03b60.cjs → server-entry-cb6fb618.cjs} +1 -1
- package/lib/edge/server-entry.cjs +1 -1
- package/lib/edge/server-entry.mjs +1 -1
- package/lib/edge/{slot-04b4ef3f.js → slot-28b25c84.js} +4 -4
- package/lib/edge/{slot-bd7569c2.cjs → slot-d3b5cdb8.cjs} +1 -1
- package/lib/edge/{symbol-55cb3d28.js → symbol-1ab0fb76.js} +2 -2
- package/lib/edge/{symbol-36f8ff9a.cjs → symbol-f0ba82bf.cjs} +1 -1
- package/lib/edge/{tabs-d16dc29a.js → tabs-a04af934.js} +4 -4
- package/lib/edge/{tabs-edb19af7.cjs → tabs-fad92db1.cjs} +1 -1
- package/lib/edge/{text-e93b2e5f.js → text-3c4c2e24.js} +2 -2
- package/lib/edge/{text-d43cb037.cjs → text-ee3d6be2.cjs} +1 -1
- package/lib/node/blocks-exports.cjs +21 -21
- package/lib/node/blocks-exports.mjs +9 -10
- package/lib/node/index.cjs +1 -1
- package/lib/node/index.mjs +25 -26
- package/lib/node/init.cjs +1 -1
- package/lib/node/init.mjs +5 -6
- package/lib/node/{server-entry-2dc8afb6.cjs → server-entry-2ce603a9.cjs} +1 -1
- package/lib/node/{server-entry-2b6abd6c.js → server-entry-bf8bf121.js} +1 -1
- package/lib/node/server-entry.cjs +1 -1
- package/lib/node/server-entry.mjs +1 -1
- package/lib/node/{setIvm-ef48cefa.js → should-force-browser-runtime-in-node-2251f2e6.js} +57 -45
- package/lib/node/should-force-browser-runtime-in-node-411c24f8.cjs +48 -0
- package/package.json +3 -9
- package/types/constants/sdk-version.d.ts +1 -1
- package/lib/node/setIvm-3ef2ce91.cjs +0 -48
- package/lib/node/setIvm.cjs +0 -1
- package/lib/node/setIvm.mjs +0 -5
- package/lib/node/should-force-browser-runtime-in-node-5098dffa.cjs +0 -1
- package/lib/node/should-force-browser-runtime-in-node-eb0799a1.js +0 -17
- package/types/blocks/textarea/component-info.d.ts +0 -2
- package/types/blocks/textarea/index.d.ts +0 -1
- package/types/blocks/textarea/textarea.d.ts +0 -13
- package/types/cjs/blocks/BaseText.d.cts +0 -6
- package/types/cjs/blocks/button/button.d.cts +0 -4
- package/types/cjs/blocks/button/button.types.d.cts +0 -7
- package/types/cjs/blocks/button/component-info.d.cts +0 -2
- package/types/cjs/blocks/button/index.d.cts +0 -1
- package/types/cjs/blocks/columns/columns.d.cts +0 -4
- package/types/cjs/blocks/columns/columns.types.d.cts +0 -15
- package/types/cjs/blocks/columns/component-info.d.cts +0 -2
- package/types/cjs/blocks/columns/helpers.d.cts +0 -1
- package/types/cjs/blocks/columns/index.d.cts +0 -1
- package/types/cjs/blocks/custom-code/component-info.d.cts +0 -2
- package/types/cjs/blocks/custom-code/custom-code.d.cts +0 -7
- package/types/cjs/blocks/custom-code/index.d.cts +0 -1
- package/types/cjs/blocks/embed/component-info.d.cts +0 -2
- package/types/cjs/blocks/embed/embed.d.cts +0 -6
- package/types/cjs/blocks/embed/helpers.d.cts +0 -1
- package/types/cjs/blocks/embed/index.d.cts +0 -1
- package/types/cjs/blocks/form/form/component-info.d.cts +0 -2
- package/types/cjs/blocks/form/form/form.d.cts +0 -33
- package/types/cjs/blocks/form/form/index.d.cts +0 -1
- package/types/cjs/blocks/form/input/component-info.d.cts +0 -2
- package/types/cjs/blocks/form/input/index.d.cts +0 -1
- package/types/cjs/blocks/form/input/input.d.cts +0 -15
- package/types/cjs/blocks/form/select/component-info.d.cts +0 -2
- package/types/cjs/blocks/form/select/index.d.cts +0 -1
- package/types/cjs/blocks/form/select/select.d.cts +0 -16
- package/types/cjs/blocks/form/submit-button/component-info.d.cts +0 -2
- package/types/cjs/blocks/form/submit-button/index.d.cts +0 -1
- package/types/cjs/blocks/form/submit-button/submit-button.d.cts +0 -10
- package/types/cjs/blocks/fragment/component-info.d.cts +0 -2
- package/types/cjs/blocks/fragment/fragment.d.cts +0 -4
- package/types/cjs/blocks/fragment/fragment.types.d.cts +0 -5
- package/types/cjs/blocks/fragment/index.d.cts +0 -1
- package/types/cjs/blocks/helpers.d.cts +0 -13
- package/types/cjs/blocks/image/component-info.d.cts +0 -2
- package/types/cjs/blocks/image/image.d.cts +0 -4
- package/types/cjs/blocks/image/image.helpers.d.cts +0 -1
- package/types/cjs/blocks/image/image.types.d.cts +0 -19
- package/types/cjs/blocks/image/index.d.cts +0 -1
- package/types/cjs/blocks/img/component-info.d.cts +0 -2
- package/types/cjs/blocks/img/img.d.cts +0 -14
- package/types/cjs/blocks/img/index.d.cts +0 -1
- package/types/cjs/blocks/raw-text/component-info.d.cts +0 -2
- package/types/cjs/blocks/raw-text/index.d.cts +0 -1
- package/types/cjs/blocks/raw-text/raw-text.d.cts +0 -7
- package/types/cjs/blocks/section/component-info.d.cts +0 -2
- package/types/cjs/blocks/section/index.d.cts +0 -1
- package/types/cjs/blocks/section/section.d.cts +0 -4
- package/types/cjs/blocks/section/section.types.d.cts +0 -6
- package/types/cjs/blocks/slot/component-info.d.cts +0 -2
- package/types/cjs/blocks/slot/index.d.cts +0 -1
- package/types/cjs/blocks/slot/slot.d.cts +0 -8
- package/types/cjs/blocks/symbol/component-info.d.cts +0 -2
- package/types/cjs/blocks/symbol/index.d.cts +0 -1
- package/types/cjs/blocks/symbol/symbol.d.cts +0 -4
- package/types/cjs/blocks/symbol/symbol.helpers.d.cts +0 -14
- package/types/cjs/blocks/symbol/symbol.types.d.cts +0 -18
- package/types/cjs/blocks/tabs/component-info.d.cts +0 -2
- package/types/cjs/blocks/tabs/index.d.cts +0 -1
- package/types/cjs/blocks/tabs/tabs.d.cts +0 -4
- package/types/cjs/blocks/tabs/tabs.types.d.cts +0 -13
- package/types/cjs/blocks/text/component-info.d.cts +0 -2
- package/types/cjs/blocks/text/index.d.cts +0 -1
- package/types/cjs/blocks/text/text.d.cts +0 -4
- package/types/cjs/blocks/text/text.types.d.cts +0 -4
- package/types/cjs/blocks/textarea/component-info.d.cts +0 -2
- package/types/cjs/blocks/textarea/index.d.cts +0 -1
- package/types/cjs/blocks/textarea/textarea.d.cts +0 -13
- package/types/cjs/blocks/video/component-info.d.cts +0 -2
- package/types/cjs/blocks/video/index.d.cts +0 -1
- package/types/cjs/blocks/video/video.d.cts +0 -4
- package/types/cjs/blocks/video/video.types.d.cts +0 -21
- package/types/cjs/components/block/animator.d.cts +0 -5
- package/types/cjs/components/block/block.d.cts +0 -11
- package/types/cjs/components/block/block.helpers.d.cts +0 -18
- package/types/cjs/components/block/components/block-styles.d.cts +0 -9
- package/types/cjs/components/block/components/block-wrapper.d.cts +0 -15
- package/types/cjs/components/block/components/component-ref/component-ref.d.cts +0 -4
- package/types/cjs/components/block/components/component-ref/component-ref.helpers.d.cts +0 -31
- package/types/cjs/components/block/components/interactive-element.d.cts +0 -14
- package/types/cjs/components/block/components/repeated-block.d.cts +0 -8
- package/types/cjs/components/block/types.d.cts +0 -6
- package/types/cjs/components/blocks/blocks-wrapper.d.cts +0 -19
- package/types/cjs/components/blocks/blocks.d.cts +0 -4
- package/types/cjs/components/blocks/blocks.types.d.cts +0 -7
- package/types/cjs/components/blocks/index.d.cts +0 -1
- package/types/cjs/components/content/components/enable-editor.d.cts +0 -10
- package/types/cjs/components/content/components/styles.d.cts +0 -10
- package/types/cjs/components/content/components/styles.helpers.d.cts +0 -17
- package/types/cjs/components/content/content.d.cts +0 -4
- package/types/cjs/components/content/content.helpers.d.cts +0 -7
- package/types/cjs/components/content/content.types.d.cts +0 -13
- package/types/cjs/components/content/contentProps.types.d.cts +0 -17
- package/types/cjs/components/content/index.d.cts +0 -1
- package/types/cjs/components/content/wrap-component-ref.d.cts +0 -6
- package/types/cjs/components/content-variants/content-variants.d.cts +0 -10
- package/types/cjs/components/content-variants/content-variants.types.d.cts +0 -71
- package/types/cjs/components/content-variants/helpers.d.cts +0 -41
- package/types/cjs/components/content-variants/index.d.cts +0 -1
- package/types/cjs/components/content-variants/inlined-fns.d.cts +0 -14
- package/types/cjs/components/dynamic-div.d.cts +0 -15
- package/types/cjs/components/dynamic-renderer/dynamic-renderer.d.cts +0 -9
- package/types/cjs/components/dynamic-renderer/dynamic-renderer.helpers.d.cts +0 -1
- package/types/cjs/components/error-boundary.d.cts +0 -11
- package/types/cjs/components/inlined-script.d.cts +0 -7
- package/types/cjs/components/inlined-styles.d.cts +0 -7
- package/types/cjs/constants/builder-registered-components.d.cts +0 -6
- package/types/cjs/constants/device-sizes.d.cts +0 -13
- package/types/cjs/constants/extra-components.d.cts +0 -7
- package/types/cjs/constants/sdk-version.d.cts +0 -1
- package/types/cjs/constants/target.d.cts +0 -2
- package/types/cjs/context/builder.context.d.cts +0 -3
- package/types/cjs/context/components.context.d.cts +0 -3
- package/types/cjs/context/index.d.cts +0 -1
- package/types/cjs/context/types.d.cts +0 -36
- package/types/cjs/functions/apply-patch-with-mutation.d.cts +0 -10
- package/types/cjs/functions/camel-to-kebab-case.d.cts +0 -1
- package/types/cjs/functions/deopt.d.cts +0 -4
- package/types/cjs/functions/evaluate/browser-runtime/browser.d.cts +0 -8
- package/types/cjs/functions/evaluate/browser-runtime/index.d.cts +0 -1
- package/types/cjs/functions/evaluate/choose-eval.d.cts +0 -6
- package/types/cjs/functions/evaluate/edge-runtime/acorn-interpreter.d.cts +0 -2
- package/types/cjs/functions/evaluate/edge-runtime/edge-runtime.d.cts +0 -2
- package/types/cjs/functions/evaluate/edge-runtime/index.d.cts +0 -1
- package/types/cjs/functions/evaluate/evaluate.d.cts +0 -4
- package/types/cjs/functions/evaluate/helpers.d.cts +0 -25
- package/types/cjs/functions/evaluate/index.d.cts +0 -1
- package/types/cjs/functions/evaluate/node-runtime/index.d.cts +0 -1
- package/types/cjs/functions/evaluate/node-runtime/init.d.cts +0 -13
- package/types/cjs/functions/evaluate/node-runtime/node-runtime.d.cts +0 -11
- package/types/cjs/functions/evaluate/node-runtime/safeDynamicRequire.d.cts +0 -6
- package/types/cjs/functions/evaluate/placeholder-runtime.d.cts +0 -2
- package/types/cjs/functions/evaluate/should-force-browser-runtime-in-node.d.cts +0 -1
- package/types/cjs/functions/event-handler-name.d.cts +0 -1
- package/types/cjs/functions/extract-text-styles.d.cts +0 -4
- package/types/cjs/functions/fast-clone.d.cts +0 -4
- package/types/cjs/functions/fetch-builder-props.d.cts +0 -53
- package/types/cjs/functions/get-block-actions-handler.d.cts +0 -8
- package/types/cjs/functions/get-block-actions.d.cts +0 -10
- package/types/cjs/functions/get-block-component-options.d.cts +0 -2
- package/types/cjs/functions/get-block-properties.d.cts +0 -10
- package/types/cjs/functions/get-builder-search-params/index.d.cts +0 -9
- package/types/cjs/functions/get-class-prop-name.d.cts +0 -1
- package/types/cjs/functions/get-content/generate-content-url.d.cts +0 -2
- package/types/cjs/functions/get-content/index.d.cts +0 -18
- package/types/cjs/functions/get-content/types.d.cts +0 -139
- package/types/cjs/functions/get-env.d.cts +0 -2
- package/types/cjs/functions/get-fetch.d.cts +0 -1
- package/types/cjs/functions/get-global-this.d.cts +0 -4
- package/types/cjs/functions/get-processed-block.d.cts +0 -10
- package/types/cjs/functions/get-style.d.cts +0 -12
- package/types/cjs/functions/get.d.cts +0 -1
- package/types/cjs/functions/is-browser.d.cts +0 -1
- package/types/cjs/functions/is-edge-runtime.d.cts +0 -4
- package/types/cjs/functions/is-editing.d.cts +0 -2
- package/types/cjs/functions/is-from-trusted-host.d.cts +0 -3
- package/types/cjs/functions/is-iframe.d.cts +0 -1
- package/types/cjs/functions/is-node-runtime.d.cts +0 -4
- package/types/cjs/functions/is-previewing.d.cts +0 -2
- package/types/cjs/functions/on-change.d.cts +0 -7
- package/types/cjs/functions/register-component.d.cts +0 -6
- package/types/cjs/functions/register.d.cts +0 -16
- package/types/cjs/functions/set-editor-settings.d.cts +0 -4
- package/types/cjs/functions/set.d.cts +0 -7
- package/types/cjs/functions/track/helpers.d.cts +0 -5
- package/types/cjs/functions/track/index.d.cts +0 -51
- package/types/cjs/functions/track/interaction.d.cts +0 -13
- package/types/cjs/functions/transform-block-properties.d.cts +0 -7
- package/types/cjs/functions/transform-block.d.cts +0 -2
- package/types/cjs/functions/transform-style-property.d.cts +0 -7
- package/types/cjs/helpers/ab-tests.d.cts +0 -9
- package/types/cjs/helpers/canTrack.d.cts +0 -1
- package/types/cjs/helpers/cookie.d.cts +0 -19
- package/types/cjs/helpers/css.d.cts +0 -7
- package/types/cjs/helpers/flatten.d.cts +0 -16
- package/types/cjs/helpers/localStorage.d.cts +0 -9
- package/types/cjs/helpers/logger.d.cts +0 -7
- package/types/cjs/helpers/nullable.d.cts +0 -2
- package/types/cjs/helpers/omit.d.cts +0 -1
- package/types/cjs/helpers/preview-lru-cache/get.d.cts +0 -2
- package/types/cjs/helpers/preview-lru-cache/helpers.d.cts +0 -1
- package/types/cjs/helpers/preview-lru-cache/init.d.cts +0 -6
- package/types/cjs/helpers/preview-lru-cache/set.d.cts +0 -7
- package/types/cjs/helpers/preview-lru-cache/types.d.cts +0 -1
- package/types/cjs/helpers/search/search.d.cts +0 -5
- package/types/cjs/helpers/sessionId.d.cts +0 -6
- package/types/cjs/helpers/subscribe-to-editor.d.cts +0 -35
- package/types/cjs/helpers/time.d.cts +0 -1
- package/types/cjs/helpers/url.d.cts +0 -6
- package/types/cjs/helpers/uuid.d.cts +0 -8
- package/types/cjs/helpers/visitorId.d.cts +0 -6
- package/types/cjs/index-helpers/blocks-exports.d.cts +0 -14
- package/types/cjs/index-helpers/top-of-file.d.cts +0 -1
- package/types/cjs/index.d.cts +0 -10
- package/types/cjs/scripts/init-editing.d.cts +0 -7
- package/types/cjs/server-index.d.cts +0 -39
- package/types/cjs/types/api-version.d.cts +0 -2
- package/types/cjs/types/builder-block.d.cts +0 -84
- package/types/cjs/types/builder-content.d.cts +0 -44
- package/types/cjs/types/builder-props.d.cts +0 -12
- package/types/cjs/types/can-track.d.cts +0 -3
- package/types/cjs/types/components.d.cts +0 -110
- package/types/cjs/types/deep-partial.d.cts +0 -3
- package/types/cjs/types/element.d.cts +0 -59
- package/types/cjs/types/enforced-partials.d.cts +0 -26
- package/types/cjs/types/input.d.cts +0 -122
- package/types/cjs/types/targets.d.cts +0 -1
- package/types/cjs/types/typescript.d.cts +0 -8
- package/types/esm/blocks/BaseText.d.mts +0 -6
- package/types/esm/blocks/button/button.d.mts +0 -4
- package/types/esm/blocks/button/button.types.d.mts +0 -7
- package/types/esm/blocks/button/component-info.d.mts +0 -2
- package/types/esm/blocks/button/index.d.mts +0 -1
- package/types/esm/blocks/columns/columns.d.mts +0 -4
- package/types/esm/blocks/columns/columns.types.d.mts +0 -15
- package/types/esm/blocks/columns/component-info.d.mts +0 -2
- package/types/esm/blocks/columns/helpers.d.mts +0 -1
- package/types/esm/blocks/columns/index.d.mts +0 -1
- package/types/esm/blocks/custom-code/component-info.d.mts +0 -2
- package/types/esm/blocks/custom-code/custom-code.d.mts +0 -7
- package/types/esm/blocks/custom-code/index.d.mts +0 -1
- package/types/esm/blocks/embed/component-info.d.mts +0 -2
- package/types/esm/blocks/embed/embed.d.mts +0 -6
- package/types/esm/blocks/embed/helpers.d.mts +0 -1
- package/types/esm/blocks/embed/index.d.mts +0 -1
- package/types/esm/blocks/form/form/component-info.d.mts +0 -2
- package/types/esm/blocks/form/form/form.d.mts +0 -33
- package/types/esm/blocks/form/form/index.d.mts +0 -1
- package/types/esm/blocks/form/input/component-info.d.mts +0 -2
- package/types/esm/blocks/form/input/index.d.mts +0 -1
- package/types/esm/blocks/form/input/input.d.mts +0 -15
- package/types/esm/blocks/form/select/component-info.d.mts +0 -2
- package/types/esm/blocks/form/select/index.d.mts +0 -1
- package/types/esm/blocks/form/select/select.d.mts +0 -16
- package/types/esm/blocks/form/submit-button/component-info.d.mts +0 -2
- package/types/esm/blocks/form/submit-button/index.d.mts +0 -1
- package/types/esm/blocks/form/submit-button/submit-button.d.mts +0 -10
- package/types/esm/blocks/fragment/component-info.d.mts +0 -2
- package/types/esm/blocks/fragment/fragment.d.mts +0 -4
- package/types/esm/blocks/fragment/fragment.types.d.mts +0 -5
- package/types/esm/blocks/fragment/index.d.mts +0 -1
- package/types/esm/blocks/helpers.d.mts +0 -13
- package/types/esm/blocks/image/component-info.d.mts +0 -2
- package/types/esm/blocks/image/image.d.mts +0 -4
- package/types/esm/blocks/image/image.helpers.d.mts +0 -1
- package/types/esm/blocks/image/image.types.d.mts +0 -19
- package/types/esm/blocks/image/index.d.mts +0 -1
- package/types/esm/blocks/img/component-info.d.mts +0 -2
- package/types/esm/blocks/img/img.d.mts +0 -14
- package/types/esm/blocks/img/index.d.mts +0 -1
- package/types/esm/blocks/raw-text/component-info.d.mts +0 -2
- package/types/esm/blocks/raw-text/index.d.mts +0 -1
- package/types/esm/blocks/raw-text/raw-text.d.mts +0 -7
- package/types/esm/blocks/section/component-info.d.mts +0 -2
- package/types/esm/blocks/section/index.d.mts +0 -1
- package/types/esm/blocks/section/section.d.mts +0 -4
- package/types/esm/blocks/section/section.types.d.mts +0 -6
- package/types/esm/blocks/slot/component-info.d.mts +0 -2
- package/types/esm/blocks/slot/index.d.mts +0 -1
- package/types/esm/blocks/slot/slot.d.mts +0 -8
- package/types/esm/blocks/symbol/component-info.d.mts +0 -2
- package/types/esm/blocks/symbol/index.d.mts +0 -1
- package/types/esm/blocks/symbol/symbol.d.mts +0 -4
- package/types/esm/blocks/symbol/symbol.helpers.d.mts +0 -14
- package/types/esm/blocks/symbol/symbol.types.d.mts +0 -18
- package/types/esm/blocks/tabs/component-info.d.mts +0 -2
- package/types/esm/blocks/tabs/index.d.mts +0 -1
- package/types/esm/blocks/tabs/tabs.d.mts +0 -4
- package/types/esm/blocks/tabs/tabs.types.d.mts +0 -13
- package/types/esm/blocks/text/component-info.d.mts +0 -2
- package/types/esm/blocks/text/index.d.mts +0 -1
- package/types/esm/blocks/text/text.d.mts +0 -4
- package/types/esm/blocks/text/text.types.d.mts +0 -4
- package/types/esm/blocks/textarea/component-info.d.mts +0 -2
- package/types/esm/blocks/textarea/index.d.mts +0 -1
- package/types/esm/blocks/textarea/textarea.d.mts +0 -13
- package/types/esm/blocks/video/component-info.d.mts +0 -2
- package/types/esm/blocks/video/index.d.mts +0 -1
- package/types/esm/blocks/video/video.d.mts +0 -4
- package/types/esm/blocks/video/video.types.d.mts +0 -21
- package/types/esm/components/block/animator.d.mts +0 -5
- package/types/esm/components/block/block.d.mts +0 -11
- package/types/esm/components/block/block.helpers.d.mts +0 -18
- package/types/esm/components/block/components/block-styles.d.mts +0 -9
- package/types/esm/components/block/components/block-wrapper.d.mts +0 -15
- package/types/esm/components/block/components/component-ref/component-ref.d.mts +0 -4
- package/types/esm/components/block/components/component-ref/component-ref.helpers.d.mts +0 -31
- package/types/esm/components/block/components/interactive-element.d.mts +0 -14
- package/types/esm/components/block/components/repeated-block.d.mts +0 -8
- package/types/esm/components/block/types.d.mts +0 -6
- package/types/esm/components/blocks/blocks-wrapper.d.mts +0 -19
- package/types/esm/components/blocks/blocks.d.mts +0 -4
- package/types/esm/components/blocks/blocks.types.d.mts +0 -7
- package/types/esm/components/blocks/index.d.mts +0 -1
- package/types/esm/components/content/components/enable-editor.d.mts +0 -10
- package/types/esm/components/content/components/styles.d.mts +0 -10
- package/types/esm/components/content/components/styles.helpers.d.mts +0 -17
- package/types/esm/components/content/content.d.mts +0 -4
- package/types/esm/components/content/content.helpers.d.mts +0 -7
- package/types/esm/components/content/content.types.d.mts +0 -13
- package/types/esm/components/content/contentProps.types.d.mts +0 -17
- package/types/esm/components/content/index.d.mts +0 -1
- package/types/esm/components/content/wrap-component-ref.d.mts +0 -6
- package/types/esm/components/content-variants/content-variants.d.mts +0 -10
- package/types/esm/components/content-variants/content-variants.types.d.mts +0 -71
- package/types/esm/components/content-variants/helpers.d.mts +0 -41
- package/types/esm/components/content-variants/index.d.mts +0 -1
- package/types/esm/components/content-variants/inlined-fns.d.mts +0 -14
- package/types/esm/components/dynamic-div.d.mts +0 -15
- package/types/esm/components/dynamic-renderer/dynamic-renderer.d.mts +0 -9
- package/types/esm/components/dynamic-renderer/dynamic-renderer.helpers.d.mts +0 -1
- package/types/esm/components/error-boundary.d.mts +0 -11
- package/types/esm/components/inlined-script.d.mts +0 -7
- package/types/esm/components/inlined-styles.d.mts +0 -7
- package/types/esm/constants/builder-registered-components.d.mts +0 -6
- package/types/esm/constants/device-sizes.d.mts +0 -13
- package/types/esm/constants/extra-components.d.mts +0 -7
- package/types/esm/constants/sdk-version.d.mts +0 -1
- package/types/esm/constants/target.d.mts +0 -2
- package/types/esm/context/builder.context.d.mts +0 -3
- package/types/esm/context/components.context.d.mts +0 -3
- package/types/esm/context/index.d.mts +0 -1
- package/types/esm/context/types.d.mts +0 -36
- package/types/esm/functions/apply-patch-with-mutation.d.mts +0 -10
- package/types/esm/functions/camel-to-kebab-case.d.mts +0 -1
- package/types/esm/functions/deopt.d.mts +0 -4
- package/types/esm/functions/evaluate/browser-runtime/browser.d.mts +0 -8
- package/types/esm/functions/evaluate/browser-runtime/index.d.mts +0 -1
- package/types/esm/functions/evaluate/choose-eval.d.mts +0 -6
- package/types/esm/functions/evaluate/edge-runtime/acorn-interpreter.d.mts +0 -2
- package/types/esm/functions/evaluate/edge-runtime/edge-runtime.d.mts +0 -2
- package/types/esm/functions/evaluate/edge-runtime/index.d.mts +0 -1
- package/types/esm/functions/evaluate/evaluate.d.mts +0 -4
- package/types/esm/functions/evaluate/helpers.d.mts +0 -25
- package/types/esm/functions/evaluate/index.d.mts +0 -1
- package/types/esm/functions/evaluate/node-runtime/index.d.mts +0 -1
- package/types/esm/functions/evaluate/node-runtime/init.d.mts +0 -13
- package/types/esm/functions/evaluate/node-runtime/node-runtime.d.mts +0 -11
- package/types/esm/functions/evaluate/node-runtime/safeDynamicRequire.d.mts +0 -6
- package/types/esm/functions/evaluate/placeholder-runtime.d.mts +0 -2
- package/types/esm/functions/evaluate/should-force-browser-runtime-in-node.d.mts +0 -1
- package/types/esm/functions/event-handler-name.d.mts +0 -1
- package/types/esm/functions/extract-text-styles.d.mts +0 -4
- package/types/esm/functions/fast-clone.d.mts +0 -4
- package/types/esm/functions/fetch-builder-props.d.mts +0 -53
- package/types/esm/functions/get-block-actions-handler.d.mts +0 -8
- package/types/esm/functions/get-block-actions.d.mts +0 -10
- package/types/esm/functions/get-block-component-options.d.mts +0 -2
- package/types/esm/functions/get-block-properties.d.mts +0 -10
- package/types/esm/functions/get-builder-search-params/index.d.mts +0 -9
- package/types/esm/functions/get-class-prop-name.d.mts +0 -1
- package/types/esm/functions/get-content/generate-content-url.d.mts +0 -2
- package/types/esm/functions/get-content/index.d.mts +0 -18
- package/types/esm/functions/get-content/types.d.mts +0 -139
- package/types/esm/functions/get-env.d.mts +0 -2
- package/types/esm/functions/get-fetch.d.mts +0 -1
- package/types/esm/functions/get-global-this.d.mts +0 -4
- package/types/esm/functions/get-processed-block.d.mts +0 -10
- package/types/esm/functions/get-style.d.mts +0 -12
- package/types/esm/functions/get.d.mts +0 -1
- package/types/esm/functions/is-browser.d.mts +0 -1
- package/types/esm/functions/is-edge-runtime.d.mts +0 -4
- package/types/esm/functions/is-editing.d.mts +0 -2
- package/types/esm/functions/is-from-trusted-host.d.mts +0 -3
- package/types/esm/functions/is-iframe.d.mts +0 -1
- package/types/esm/functions/is-node-runtime.d.mts +0 -4
- package/types/esm/functions/is-previewing.d.mts +0 -2
- package/types/esm/functions/on-change.d.mts +0 -7
- package/types/esm/functions/register-component.d.mts +0 -6
- package/types/esm/functions/register.d.mts +0 -16
- package/types/esm/functions/set-editor-settings.d.mts +0 -4
- package/types/esm/functions/set.d.mts +0 -7
- package/types/esm/functions/track/helpers.d.mts +0 -5
- package/types/esm/functions/track/index.d.mts +0 -51
- package/types/esm/functions/track/interaction.d.mts +0 -13
- package/types/esm/functions/transform-block-properties.d.mts +0 -7
- package/types/esm/functions/transform-block.d.mts +0 -2
- package/types/esm/functions/transform-style-property.d.mts +0 -7
- package/types/esm/helpers/ab-tests.d.mts +0 -9
- package/types/esm/helpers/canTrack.d.mts +0 -1
- package/types/esm/helpers/cookie.d.mts +0 -19
- package/types/esm/helpers/css.d.mts +0 -7
- package/types/esm/helpers/flatten.d.mts +0 -16
- package/types/esm/helpers/localStorage.d.mts +0 -9
- package/types/esm/helpers/logger.d.mts +0 -7
- package/types/esm/helpers/nullable.d.mts +0 -2
- package/types/esm/helpers/omit.d.mts +0 -1
- package/types/esm/helpers/preview-lru-cache/get.d.mts +0 -2
- package/types/esm/helpers/preview-lru-cache/helpers.d.mts +0 -1
- package/types/esm/helpers/preview-lru-cache/init.d.mts +0 -6
- package/types/esm/helpers/preview-lru-cache/set.d.mts +0 -7
- package/types/esm/helpers/preview-lru-cache/types.d.mts +0 -1
- package/types/esm/helpers/search/search.d.mts +0 -5
- package/types/esm/helpers/sessionId.d.mts +0 -6
- package/types/esm/helpers/subscribe-to-editor.d.mts +0 -35
- package/types/esm/helpers/time.d.mts +0 -1
- package/types/esm/helpers/url.d.mts +0 -6
- package/types/esm/helpers/uuid.d.mts +0 -8
- package/types/esm/helpers/visitorId.d.mts +0 -6
- package/types/esm/index-helpers/blocks-exports.d.mts +0 -14
- package/types/esm/index-helpers/top-of-file.d.mts +0 -1
- package/types/esm/index.d.mts +0 -10
- package/types/esm/index.d.mts.d.mts +0 -10
- package/types/esm/scripts/init-editing.d.mts +0 -7
- package/types/esm/server-index.d.mts +0 -39
- package/types/esm/types/api-version.d.mts +0 -2
- package/types/esm/types/builder-block.d.mts +0 -84
- package/types/esm/types/builder-content.d.mts +0 -44
- package/types/esm/types/builder-props.d.mts +0 -12
- package/types/esm/types/can-track.d.mts +0 -3
- package/types/esm/types/components.d.mts +0 -110
- package/types/esm/types/deep-partial.d.mts +0 -3
- package/types/esm/types/element.d.mts +0 -59
- package/types/esm/types/enforced-partials.d.mts +0 -26
- package/types/esm/types/input.d.mts +0 -122
- package/types/esm/types/targets.d.mts +0 -1
- package/types/esm/types/typescript.d.mts +0 -8
- package/types/functions/evaluate/node-runtime/setIvm.d.ts +0 -1
- package/types/helpers/sdk-headers.d.ts +0 -5
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as l, Fragment as w, jsxs as V } from "react/jsx-runtime";
|
|
3
|
-
import { TARGET as D, isBrowser as H, logger as ne, checkIsDefined as Z, isPreviewing as xe, isEditing as N, registerInsertMenu as Le, setupBrowserForEditing as Oe, createRegisterComponentMessage as Ue, getDefaultCanTrack as q, _track as le, fetchOneEntry as ve, createEditorListener as je, serializeIncludingFunctions as se, handleABTestingSync as Me } from "./server-entry-
|
|
3
|
+
import { TARGET as D, isBrowser as H, logger as ne, checkIsDefined as Z, isPreviewing as xe, isEditing as N, registerInsertMenu as Le, setupBrowserForEditing as Oe, createRegisterComponentMessage as Ue, getDefaultCanTrack as q, _track as le, fetchOneEntry as ve, createEditorListener as je, serializeIncludingFunctions as se, handleABTestingSync as Me } from "./server-entry-bf8bf121.js";
|
|
4
4
|
import { createContext as Se, useEffect as B, useState as T, useRef as $, useContext as ce, createElement as ke } from "react";
|
|
5
|
-
import { getFunctionArguments as _e, flattenState as He,
|
|
6
|
-
import { shouldForceBrowserRuntimeInNode as Je } from "./should-force-browser-runtime-in-node-eb0799a1.js";
|
|
5
|
+
import { getFunctionArguments as _e, flattenState as He, shouldForceBrowserRuntimeInNode as qe, runInNode as Ke, parseCode as ze, getBuilderGlobals as Je, set as Ce, fastClone as ie } from "./should-force-browser-runtime-in-node-2251f2e6.js";
|
|
7
6
|
const Ge = /* @__PURE__ */ new Set(["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen", "link", "meta", "param", "source", "track", "wbr"]), Ye = (e) => typeof e == "string" && Ge.has(e.toLowerCase());
|
|
8
7
|
function oe(e) {
|
|
9
8
|
return /* @__PURE__ */ l(w, { children: Ye(e.TagName) ? /* @__PURE__ */ l(w, { children: /* @__PURE__ */ l(e.TagName, { ...e.attributes, ...e.actionAttributes }) }) : /* @__PURE__ */ l(w, { children: typeof e.TagName == "string" ? /* @__PURE__ */ l(e.TagName, { ...e.attributes, ...e.actionAttributes, children: e.children }) : /* @__PURE__ */ l(e.TagName, { ...e.attributes, ...e.actionAttributes, children: e.children }) }) });
|
|
@@ -97,9 +96,9 @@ const Ie = (e, t, n) => {
|
|
|
97
96
|
})
|
|
98
97
|
});
|
|
99
98
|
return new Function(...s.map(([d]) => d), e)(...s.map(([, d]) => d));
|
|
100
|
-
}, tt = (e) => H() ||
|
|
99
|
+
}, tt = (e) => H() || qe({
|
|
101
100
|
shouldLogWarning: !0
|
|
102
|
-
}) ? et(e) :
|
|
101
|
+
}) ? et(e) : Ke(e), nt = /^(return )?(\s*)?state(?<getPath>(\.\w+)+)(\s*);?$/, it = /(\s)*var(\s)+_virtual_index(\s)*=(\s)*state(?<getPath>(\.\w+)+)(\s*);?(\s)*return(\s)*_virtual_index(\s)*/, ot = (e) => {
|
|
103
102
|
var t, n, i, o, a, r;
|
|
104
103
|
return ((i = (n = (t = nt.exec(e.trim())) == null ? void 0 : t.groups) == null ? void 0 : n.getPath) == null ? void 0 : i.slice(1)) || ((r = (a = (o = it.exec(e.trim())) == null ? void 0 : o.groups) == null ? void 0 : a.getPath) == null ? void 0 : r.slice(1));
|
|
105
104
|
};
|
|
@@ -121,10 +120,10 @@ function L({
|
|
|
121
120
|
...n
|
|
122
121
|
}, s);
|
|
123
122
|
const d = {
|
|
124
|
-
code:
|
|
123
|
+
code: ze(e, {
|
|
125
124
|
isExpression: r
|
|
126
125
|
}),
|
|
127
|
-
builder:
|
|
126
|
+
builder: Je(),
|
|
128
127
|
context: t,
|
|
129
128
|
event: a,
|
|
130
129
|
rootSetState: o,
|
|
@@ -946,15 +945,15 @@ function F(e) {
|
|
|
946
945
|
path: e.path,
|
|
947
946
|
styleProp: e.styleProp,
|
|
948
947
|
classNameProp: e.className,
|
|
949
|
-
BlocksWrapper: ((i = e.context) == null ? void 0 : i.BlocksWrapper) || t.BlocksWrapper,
|
|
950
|
-
BlocksWrapperProps: ((o = e.context) == null ? void 0 : o.BlocksWrapperProps) || t.BlocksWrapperProps,
|
|
948
|
+
BlocksWrapper: ((i = e.context) == null ? void 0 : i.BlocksWrapper) || (t == null ? void 0 : t.BlocksWrapper),
|
|
949
|
+
BlocksWrapperProps: ((o = e.context) == null ? void 0 : o.BlocksWrapperProps) || (t == null ? void 0 : t.BlocksWrapperProps),
|
|
951
950
|
children: e.blocks ? /* @__PURE__ */ l(w, { children: (a = e.blocks) == null ? void 0 : a.map((r) => /* @__PURE__ */ l(
|
|
952
951
|
j,
|
|
953
952
|
{
|
|
954
953
|
block: r,
|
|
955
954
|
linkComponent: e.linkComponent,
|
|
956
955
|
context: e.context || t,
|
|
957
|
-
registeredComponents: e.registeredComponents || n.registeredComponents
|
|
956
|
+
registeredComponents: e.registeredComponents || (n == null ? void 0 : n.registeredComponents)
|
|
958
957
|
},
|
|
959
958
|
r.id
|
|
960
959
|
)) }) : null
|
package/lib/node/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./blocks-exports.cjs"),e=require("./server-entry-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./blocks-exports.cjs"),e=require("./server-entry-2ce603a9.cjs");require("react/jsx-runtime");require("react");require("./should-force-browser-runtime-in-node-411c24f8.cjs");exports.Blocks=t.Blocks;exports.BuilderContext=t.BuilderContext;exports.Button=t.Button;exports.Columns=t.Columns;exports.Content=t.Content;exports.Fragment=t.Fragment;exports.Image=t.Image;exports.Section=t.Section;exports.Symbol=t.Symbol;exports.Text=t.Text;exports.Video=t.Video;exports._processContentResult=e._processContentResult;exports.createRegisterComponentMessage=e.createRegisterComponentMessage;exports.fetchBuilderProps=e.fetchBuilderProps;exports.fetchEntries=e.fetchEntries;exports.fetchOneEntry=e.fetchOneEntry;exports.getBuilderSearchParams=e.getBuilderSearchParams;exports.isEditing=e.isEditing;exports.isPreviewing=e.isPreviewing;exports.register=e.register;exports.setEditorSettings=e.setEditorSettings;exports.subscribeToEditor=e.subscribeToEditor;exports.track=e.track;
|
package/lib/node/index.mjs
CHANGED
|
@@ -1,31 +1,30 @@
|
|
|
1
|
-
import { Blocks as
|
|
2
|
-
import { _processContentResult as
|
|
1
|
+
import { Blocks as s, BuilderContext as n, Button as m, Columns as c, Content as g, Fragment as a, Image as p, Section as d, Symbol as l, Text as u, Video as f } from "./blocks-exports.mjs";
|
|
2
|
+
import { _processContentResult as C, createRegisterComponentMessage as E, fetchBuilderProps as h, fetchEntries as x, fetchOneEntry as S, getBuilderSearchParams as b, isEditing as P, isPreviewing as k, register as y, setEditorSettings as R, subscribeToEditor as T, track as v } from "./server-entry-bf8bf121.js";
|
|
3
3
|
import "react/jsx-runtime";
|
|
4
4
|
import "react";
|
|
5
|
-
import "./
|
|
6
|
-
import "./should-force-browser-runtime-in-node-eb0799a1.js";
|
|
5
|
+
import "./should-force-browser-runtime-in-node-2251f2e6.js";
|
|
7
6
|
export {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
s as Blocks,
|
|
8
|
+
n as BuilderContext,
|
|
9
|
+
m as Button,
|
|
10
|
+
c as Columns,
|
|
11
|
+
g as Content,
|
|
13
12
|
a as Fragment,
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
13
|
+
p as Image,
|
|
14
|
+
d as Section,
|
|
15
|
+
l as Symbol,
|
|
16
|
+
u as Text,
|
|
17
|
+
f as Video,
|
|
18
|
+
C as _processContentResult,
|
|
19
|
+
E as createRegisterComponentMessage,
|
|
20
|
+
h as fetchBuilderProps,
|
|
21
|
+
x as fetchEntries,
|
|
22
|
+
S as fetchOneEntry,
|
|
23
|
+
b as getBuilderSearchParams,
|
|
24
|
+
P as isEditing,
|
|
25
|
+
k as isPreviewing,
|
|
26
|
+
y as register,
|
|
27
|
+
R as setEditorSettings,
|
|
28
|
+
T as subscribeToEditor,
|
|
29
|
+
v as track
|
|
31
30
|
};
|
package/lib/node/init.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./should-force-browser-runtime-in-node-411c24f8.cjs"),t=require("isolated-vm");require("./server-entry-2ce603a9.cjs");const r=i=>{if(e.shouldForceBrowserRuntimeInNode({shouldLogWarning:!0}))return;const{ivmIsolateOptions:o}=i||{};e.setIvm(t,o)};exports.initializeNodeRuntime=r;
|
package/lib/node/init.mjs
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
import { shouldForceBrowserRuntimeInNode as r } from "./should-force-browser-runtime-in-node-
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import "./server-entry-2b6abd6c.js";
|
|
1
|
+
import { shouldForceBrowserRuntimeInNode as t, setIvm as r } from "./should-force-browser-runtime-in-node-2251f2e6.js";
|
|
2
|
+
import e from "isolated-vm";
|
|
3
|
+
import "./server-entry-bf8bf121.js";
|
|
5
4
|
const u = (o) => {
|
|
6
|
-
if (
|
|
5
|
+
if (t({
|
|
7
6
|
shouldLogWarning: !0
|
|
8
7
|
}))
|
|
9
8
|
return;
|
|
10
9
|
const {
|
|
11
10
|
ivmIsolateOptions: i
|
|
12
11
|
} = o || {};
|
|
13
|
-
e
|
|
12
|
+
r(e, i);
|
|
14
13
|
};
|
|
15
14
|
export {
|
|
16
15
|
u as initializeNodeRuntime
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const I="react",b="[Builder.io]: ",d={log:(...e)=>console.log(b,...e),error:(...e)=>console.error(b,...e),warn:(...e)=>console.warn(b,...e),debug:(...e)=>console.debug(b,...e)};function c(){return typeof window!="undefined"&&typeof document!="undefined"}const ae=e=>{const t={};return e.forEach((n,r)=>{t[r]=n}),t},M=e=>e instanceof URLSearchParams?ae(e):e,U=e=>typeof e=="string"?e:e instanceof URLSearchParams?e.toString():new URLSearchParams(e).toString();function ce(){return c()&&window.self!==window.top}function F(e){return ce()&&U(e||window.location.search).indexOf("builder.frameEditing=")!==-1}const ue=()=>{if(c()){const e=new URL(location.href);return e.pathname===""&&(e.pathname="/"),e}else return console.warn("Cannot get location for tracking in non-browser environment"),null},de=()=>typeof navigator=="object"&&navigator.userAgent||"",N=()=>{const e=de(),t={Android(){return e.match(/Android/i)},BlackBerry(){return e.match(/BlackBerry/i)},iOS(){return e.match(/iPhone|iPod/i)},Opera(){return e.match(/Opera Mini/i)},Windows(){return e.match(/IEMobile/i)||e.match(/WPDesktop/i)},any(){return t.Android()||t.BlackBerry()||t.iOS()||t.Opera()||t.Windows()||I==="reactNative"}},n=e.match(/Tablet|iPad/i),r=ue();return{urlPath:r==null?void 0:r.pathname,host:(r==null?void 0:r.host)||(r==null?void 0:r.hostname),device:n?"tablet":t.any()?"mobile":"desktop"}},p=e=>e!=null;function le(e){const t=e||(c()?window.location.search:void 0);return t?U(t).indexOf("builder.preview=")!==-1:!1}const fe=e=>({type:"builder.registerComponent",data:k(e)}),ge=e=>{const t=e.toString().trim();return`return (${!t.startsWith("function")&&!t.startsWith("(")?"function ":""}${t}).apply(this, arguments)`};function k(e){return JSON.parse(JSON.stringify(e,(t,n)=>typeof n=="function"?ge(n):n))}const x={};function D(e,t){e==="plugin"&&(t=k(t));let n=x[e];if(n||(n=x[e]=[]),n.push(t),c()){const r={type:"builder.register",data:{type:e,info:t}};try{parent.postMessage(r,"*"),parent!==window&&window.postMessage(r,"*")}catch(o){console.debug("Could not postmessage",o)}}}const R={};function he(e){if(c()){Object.assign(R,e);const t={type:"builder.settingsChange",data:R};parent.postMessage(t,"*")}}const B="builder.",pe="options.",P=e=>{if(!e)return{};const t=M(e),n={};return Object.keys(t).forEach(r=>{if(r.startsWith(B)){const o=r.replace(B,"").replace(pe,"");n[o]=t[r]}}),n},me=()=>{if(!c())return{};const e=new URLSearchParams(window.location.search);return P(e)},ye=e=>{if(e==="localhost"||e==="127.0.0.1")return e;const t=e.split(".");return t.length>2?t.slice(1).join("."):e},j=({name:e,canTrack:t})=>{var n;try{return t?(n=document.cookie.split("; ").find(r=>r.startsWith(`${e}=`)))==null?void 0:n.split("=")[1]:void 0}catch(r){d.warn("[COOKIE] GET error: ",(r==null?void 0:r.message)||r);return}},K=async e=>j(e),Se=e=>e.map(([t,n])=>n?`${t}=${n}`:t).filter(p).join("; "),we=[["secure",""],["SameSite","None"]],be=({name:e,value:t,expires:n})=>{const o=(c()?location.protocol==="https:":!0)?we:[[]],s=n?[["expires",n.toUTCString()]]:[[]],a=[[e,t],...s,["path","/"],["domain",ye(window.location.hostname)],...o];return Se(a)},_=async({name:e,value:t,expires:n,canTrack:r})=>{try{if(!r)return;const o=be({name:e,value:t,expires:n});document.cookie=o}catch(o){d.warn("[COOKIE] SET error: ",(o==null?void 0:o.message)||o)}};function Ie(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){const t=Math.random()*16|0;return(e=="x"?t:t&3|8).toString(16)})}function W(){return Ie().replace(/-/g,"")}const $="builderSessionId",ve=async({canTrack:e})=>{if(!e)return;const t=await K({name:$,canTrack:e});if(p(t))return t;{const n=Ee();return ke({id:n,canTrack:e}),n}},Ee=()=>W(),ke=({id:e,canTrack:t})=>_({name:$,value:e,canTrack:t}),G=()=>c()&&typeof localStorage!="undefined"?localStorage:void 0,Pe=({key:e,canTrack:t})=>{var n;try{return t?(n=G())==null?void 0:n.getItem(e):void 0}catch(r){console.debug("[LocalStorage] GET error: ",r);return}},Ce=({key:e,canTrack:t,value:n})=>{var r;try{t&&((r=G())==null||r.setItem(e,n))}catch(o){console.debug("[LocalStorage] SET error: ",o)}},z="builderVisitorId",Oe=({canTrack:e})=>{if(!e)return;const t=Pe({key:z,canTrack:e});if(p(t))return t;{const n=Ae();return Te({id:n,canTrack:e}),n}},Ae=()=>W(),Te=({id:e,canTrack:t})=>Ce({key:z,value:e,canTrack:t}),xe=async({canTrack:e})=>{if(!e)return{visitorId:void 0,sessionId:void 0};const t=await ve({canTrack:e}),n=Oe({canTrack:e});return{sessionId:t,visitorId:n}},Re=async({type:e,canTrack:t,apiKey:n,metadata:r,...o})=>({type:e,data:{...o,metadata:{url:location.href,...r},...await xe({canTrack:t}),userAttributes:N(),ownerId:n}});async function J(e){if(!e.apiKey){d.error("Missing API key for track call. Please provide your API key.");return}if(e.canTrack&&!F()&&(c()||I==="reactNative"))return fetch("https://cdn.builder.io/api/v1/track",{method:"POST",body:JSON.stringify({events:[await Re(e)]}),headers:{"content-type":"application/json"},mode:"cors"}).catch(t=>{console.error("Failed to track: ",t)})}const Be=e=>J({...e,canTrack:!0}),Le=["*.beta.builder.io","beta.builder.io","builder.io","localhost","qa.builder.io"];function H(e,t){if(!t.origin.startsWith("http")&&!t.origin.startsWith("https"))return!1;const n=new URL(t.origin),r=n.hostname;return(e||Le).findIndex(o=>o.startsWith("*.")?r.endsWith(o.slice(1)):o===r)>-1}const Ve="2.0.24
|
|
1
|
+
"use strict";const I="react",b="[Builder.io]: ",d={log:(...e)=>console.log(b,...e),error:(...e)=>console.error(b,...e),warn:(...e)=>console.warn(b,...e),debug:(...e)=>console.debug(b,...e)};function c(){return typeof window!="undefined"&&typeof document!="undefined"}const ae=e=>{const t={};return e.forEach((n,r)=>{t[r]=n}),t},M=e=>e instanceof URLSearchParams?ae(e):e,U=e=>typeof e=="string"?e:e instanceof URLSearchParams?e.toString():new URLSearchParams(e).toString();function ce(){return c()&&window.self!==window.top}function F(e){return ce()&&U(e||window.location.search).indexOf("builder.frameEditing=")!==-1}const ue=()=>{if(c()){const e=new URL(location.href);return e.pathname===""&&(e.pathname="/"),e}else return console.warn("Cannot get location for tracking in non-browser environment"),null},de=()=>typeof navigator=="object"&&navigator.userAgent||"",N=()=>{const e=de(),t={Android(){return e.match(/Android/i)},BlackBerry(){return e.match(/BlackBerry/i)},iOS(){return e.match(/iPhone|iPod/i)},Opera(){return e.match(/Opera Mini/i)},Windows(){return e.match(/IEMobile/i)||e.match(/WPDesktop/i)},any(){return t.Android()||t.BlackBerry()||t.iOS()||t.Opera()||t.Windows()||I==="reactNative"}},n=e.match(/Tablet|iPad/i),r=ue();return{urlPath:r==null?void 0:r.pathname,host:(r==null?void 0:r.host)||(r==null?void 0:r.hostname),device:n?"tablet":t.any()?"mobile":"desktop"}},p=e=>e!=null;function le(e){const t=e||(c()?window.location.search:void 0);return t?U(t).indexOf("builder.preview=")!==-1:!1}const fe=e=>({type:"builder.registerComponent",data:k(e)}),ge=e=>{const t=e.toString().trim();return`return (${!t.startsWith("function")&&!t.startsWith("(")?"function ":""}${t}).apply(this, arguments)`};function k(e){return JSON.parse(JSON.stringify(e,(t,n)=>typeof n=="function"?ge(n):n))}const x={};function D(e,t){e==="plugin"&&(t=k(t));let n=x[e];if(n||(n=x[e]=[]),n.push(t),c()){const r={type:"builder.register",data:{type:e,info:t}};try{parent.postMessage(r,"*"),parent!==window&&window.postMessage(r,"*")}catch(o){console.debug("Could not postmessage",o)}}}const R={};function he(e){if(c()){Object.assign(R,e);const t={type:"builder.settingsChange",data:R};parent.postMessage(t,"*")}}const B="builder.",pe="options.",P=e=>{if(!e)return{};const t=M(e),n={};return Object.keys(t).forEach(r=>{if(r.startsWith(B)){const o=r.replace(B,"").replace(pe,"");n[o]=t[r]}}),n},me=()=>{if(!c())return{};const e=new URLSearchParams(window.location.search);return P(e)},ye=e=>{if(e==="localhost"||e==="127.0.0.1")return e;const t=e.split(".");return t.length>2?t.slice(1).join("."):e},j=({name:e,canTrack:t})=>{var n;try{return t?(n=document.cookie.split("; ").find(r=>r.startsWith(`${e}=`)))==null?void 0:n.split("=")[1]:void 0}catch(r){d.warn("[COOKIE] GET error: ",(r==null?void 0:r.message)||r);return}},K=async e=>j(e),Se=e=>e.map(([t,n])=>n?`${t}=${n}`:t).filter(p).join("; "),we=[["secure",""],["SameSite","None"]],be=({name:e,value:t,expires:n})=>{const o=(c()?location.protocol==="https:":!0)?we:[[]],s=n?[["expires",n.toUTCString()]]:[[]],a=[[e,t],...s,["path","/"],["domain",ye(window.location.hostname)],...o];return Se(a)},_=async({name:e,value:t,expires:n,canTrack:r})=>{try{if(!r)return;const o=be({name:e,value:t,expires:n});document.cookie=o}catch(o){d.warn("[COOKIE] SET error: ",(o==null?void 0:o.message)||o)}};function Ie(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){const t=Math.random()*16|0;return(e=="x"?t:t&3|8).toString(16)})}function W(){return Ie().replace(/-/g,"")}const $="builderSessionId",ve=async({canTrack:e})=>{if(!e)return;const t=await K({name:$,canTrack:e});if(p(t))return t;{const n=Ee();return ke({id:n,canTrack:e}),n}},Ee=()=>W(),ke=({id:e,canTrack:t})=>_({name:$,value:e,canTrack:t}),G=()=>c()&&typeof localStorage!="undefined"?localStorage:void 0,Pe=({key:e,canTrack:t})=>{var n;try{return t?(n=G())==null?void 0:n.getItem(e):void 0}catch(r){console.debug("[LocalStorage] GET error: ",r);return}},Ce=({key:e,canTrack:t,value:n})=>{var r;try{t&&((r=G())==null||r.setItem(e,n))}catch(o){console.debug("[LocalStorage] SET error: ",o)}},z="builderVisitorId",Oe=({canTrack:e})=>{if(!e)return;const t=Pe({key:z,canTrack:e});if(p(t))return t;{const n=Ae();return Te({id:n,canTrack:e}),n}},Ae=()=>W(),Te=({id:e,canTrack:t})=>Ce({key:z,value:e,canTrack:t}),xe=async({canTrack:e})=>{if(!e)return{visitorId:void 0,sessionId:void 0};const t=await ve({canTrack:e}),n=Oe({canTrack:e});return{sessionId:t,visitorId:n}},Re=async({type:e,canTrack:t,apiKey:n,metadata:r,...o})=>({type:e,data:{...o,metadata:{url:location.href,...r},...await xe({canTrack:t}),userAttributes:N(),ownerId:n}});async function J(e){if(!e.apiKey){d.error("Missing API key for track call. Please provide your API key.");return}if(e.canTrack&&!F()&&(c()||I==="reactNative"))return fetch("https://cdn.builder.io/api/v1/track",{method:"POST",body:JSON.stringify({events:[await Re(e)]}),headers:{"content-type":"application/json"},mode:"cors"}).catch(t=>{console.error("Failed to track: ",t)})}const Be=e=>J({...e,canTrack:!0}),Le=["*.beta.builder.io","beta.builder.io","builder.io","localhost","qa.builder.io"];function H(e,t){if(!t.origin.startsWith("http")&&!t.origin.startsWith("https"))return!1;const n=new URL(t.origin),r=n.hostname;return(e||Le).findIndex(o=>o.startsWith("*.")?r.endsWith(o.slice(1)):o===r)>-1}const Ve="2.0.24",Me=()=>{D("insertMenu",{name:"_default",default:!0,items:[{name:"Box"},{name:"Text"},{name:"Image"},{name:"Columns"},{name:"Core:Section"},{name:"Core:Button"},{name:"Embed"},{name:"Custom Code"}]})};let L=!1;const X=(e={})=>{var t,n;L||(L=!0,c()&&((t=window.parent)==null||t.postMessage({type:"builder.sdkInfo",data:{target:I,version:Ve,supportsPatchUpdates:!1,supportsAddBlockScoping:!0,supportsCustomBreakpoints:!0}},"*"),(n=window.parent)==null||n.postMessage({type:"builder.updateContent",data:{options:e}},"*"),window.addEventListener("message",r=>{var s,a;if(!H(e.trustedHosts,r))return;const{data:o}=r;if(o!=null&&o.type)switch(o.type){case"builder.evaluate":{const l=o.data.text,y=o.data.arguments||[],m=o.data.id,v=new Function(l);let u,g=null;try{u=v.apply(null,y)}catch(h){g=h}g?(s=window.parent)==null||s.postMessage({type:"builder.evaluateError",data:{id:m,error:g.message}},"*"):u&&typeof u.then=="function"?u.then(h=>{var S;(S=window.parent)==null||S.postMessage({type:"builder.evaluateResult",data:{id:m,result:h}},"*")}).catch(console.error):(a=window.parent)==null||a.postMessage({type:"builder.evaluateResult",data:{result:u,id:m}},"*");break}}})))},q=({model:e,trustedHosts:t,callbacks:n})=>r=>{if(!H(t,r))return;const{data:o}=r;if(o)switch(o.type){case"builder.configureSdk":{n.configureSdk(o.data);break}case"builder.triggerAnimation":{n.animation(o.data);break}case"builder.contentUpdate":{const s=o.data,a=s.key||s.alias||s.entry||s.modelName,l=s.data;a===e&&n.contentUpdate(l);break}}},Ue=(e,t,n)=>{if(!c)return d.warn("`subscribeToEditor` only works in the browser. It currently seems to be running on the server."),()=>{};X();const r=q({callbacks:{contentUpdate:t,animation:()=>{},configureSdk:()=>{}},model:e,trustedHosts:n==null?void 0:n.trustedHosts});return window.addEventListener("message",r),()=>{window.removeEventListener("message",r)}},Fe="builder.tests",C=e=>`${Fe}.${e}`,Ne=({contentId:e})=>K({name:C(e),canTrack:!0}),De=({contentId:e})=>j({name:C(e),canTrack:!0}),je=({contentId:e,value:t})=>_({name:C(e),value:t,canTrack:!0}),Q=e=>p(e.id)&&p(e.variations)&&Object.keys(e.variations).length>0,Ke=({id:e,variations:t})=>{var o;let n=0;const r=Math.random();for(const s in t){const a=(o=t[s])==null?void 0:o.testRatio;if(n+=a,r<n)return s}return e},Y=e=>{const t=Ke(e);return je({contentId:e.id,value:t}).catch(n=>{d.error("could not store A/B test variation: ",n)}),t},Z=({item:e,testGroupId:t})=>{const n=e.variations[t];return t===e.id||!n?{testVariationId:e.id,testVariationName:"Default"}:{data:n.data,testVariationId:n.id,testVariationName:n.name||(n.id===e.id?"Default":"")}},_e=({item:e,canTrack:t})=>{if(!t)return e;if(!e)return;if(!Q(e))return e;const n=De({contentId:e.id})||Y({variations:e.variations,id:e.id}),r=Z({item:e,testGroupId:n});return{...e,...r}},We=async({item:e,canTrack:t})=>{if(!t||!Q(e))return e;const r=await Ne({contentId:e.id})||Y({variations:e.variations,id:e.id}),o=Z({item:e,testGroupId:r});return{...e,...o}},ee=e=>p(e)?e:!0;function $e(){return typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:globalThis}function Ge(){const e=$e().fetch;if(typeof e=="undefined")throw console.warn(`Builder SDK could not find a global fetch function. Make sure you have a polyfill for fetch in your project.
|
|
2
2
|
For more information, read https://github.com/BuilderIO/this-package-uses-fetch`),new Error("Builder SDK could not find a global `fetch` function");return e}const ze=Ge();function E(e,t=null,n="."){return Object.keys(e).reduce((r,o)=>{const s=e[o],a=[t,o].filter(Boolean).join(n);return[typeof s=="object",s!==null,!(Array.isArray(s)&&s.length===0)].every(Boolean)?{...r,...E(s,a,n)}:{...r,[a]:s}},{})}function te(e,t,n={}){for(const r in e){const o=e[r],s=t?t+"."+r:r;o&&typeof o=="object"&&!Array.isArray(o)&&!Object.keys(o).find(a=>a.startsWith("$"))?te(o,s,n):n[s]=o}return n}const Je="v3",V=e=>typeof e=="number"&&!isNaN(e)&&e>=0,O=e=>{const{limit:t=30,userAttributes:n,query:r,model:o,apiKey:s,enrich:a,locale:l,apiVersion:y=Je,fields:m,omit:v,offset:u,cacheSeconds:g,staleCacheSeconds:h,sort:S,includeUnpublished:A}=e;if(!s)throw new Error("Missing API key");if(!["v3"].includes(y))throw new Error(`Invalid apiVersion: expected 'v3', received '${y}'`);const se=t!==1,i=new URL(`https://cdn.builder.io/api/${y}/content/${o}`);if(i.searchParams.set("apiKey",s),i.searchParams.set("limit",String(t)),i.searchParams.set("noTraverse",String(se)),i.searchParams.set("includeRefs",String(!0)),l&&i.searchParams.set("locale",l),a&&i.searchParams.set("enrich",String(a)),i.searchParams.set("omit",v||"meta.componentsUsed"),m&&i.searchParams.set("fields",m),Number.isFinite(u)&&u>-1&&i.searchParams.set("offset",String(Math.floor(u))),typeof A=="boolean"&&i.searchParams.set("includeUnpublished",String(A)),g&&V(g)&&i.searchParams.set("cacheSeconds",String(g)),h&&V(h)&&i.searchParams.set("staleCacheSeconds",String(h)),S){const f=E({sort:S});for(const w in f)i.searchParams.set(w,JSON.stringify(f[w]))}const ie={...me(),...M(e.options||{})},T=E(ie);for(const f in T)i.searchParams.set(f,String(T[f]));if(n&&i.searchParams.set("userAttributes",JSON.stringify(n)),r){const f=te({query:r});for(const w in f)i.searchParams.set(w,JSON.stringify(f[w]))}return i},He=e=>"results"in e;async function ne(e){const t=await oe({...e,limit:1});return t&&t[0]||null}const Xe=async e=>{var s;const t=O(e);return await(await((s=e.fetch)!=null?s:ze)(t.href,e.fetchOptions)).json()},re=async(e,t,n=O(e))=>{const r=ee(e.canTrack);if(n.search.includes("preview="),!r||!(c()||I==="reactNative"))return t.results;try{const o=[];for(const s of t.results)o.push(await We({item:s,canTrack:r}));t.results=o}catch(o){d.error("Could not process A/B tests. ",o)}return t.results};async function oe(e){try{const t=O(e),n=await Xe(e);return He(n)?re(e,n):(d.error("Error fetching data. ",{url:t,content:n,options:e}),null)}catch(t){return d.error("Error fetching data. ",t),null}}const qe=async e=>{var r,o,s;const t=e.path||((r=e.url)==null?void 0:r.pathname)||((o=e.userAttributes)==null?void 0:o.urlPath),n={...e,apiKey:e.apiKey,model:e.model||"page",userAttributes:{...e.userAttributes,...t?{urlPath:t}:{}},options:P(e.searchParams||((s=e.url)==null?void 0:s.searchParams)||e.options)};return{apiKey:n.apiKey,model:n.model,content:await ne(n)}};exports.MSG_PREFIX=b;exports.TARGET=I;exports._processContentResult=re;exports._track=J;exports.checkIsDefined=p;exports.createEditorListener=q;exports.createRegisterComponentMessage=fe;exports.fetchBuilderProps=qe;exports.fetchEntries=oe;exports.fetchOneEntry=ne;exports.getBuilderSearchParams=P;exports.getDefaultCanTrack=ee;exports.getUserAttributes=N;exports.handleABTestingSync=_e;exports.isBrowser=c;exports.isEditing=F;exports.isPreviewing=le;exports.logger=d;exports.register=D;exports.registerInsertMenu=Me;exports.serializeIncludingFunctions=k;exports.setEditorSettings=he;exports.setupBrowserForEditing=X;exports.subscribeToEditor=Ue;exports.track=Be;
|
|
@@ -302,7 +302,7 @@ function $(t, e) {
|
|
|
302
302
|
const n = new URL(e.origin), r = n.hostname;
|
|
303
303
|
return (t || kt).findIndex((o) => o.startsWith("*.") ? r.endsWith(o.slice(1)) : o === r) > -1;
|
|
304
304
|
}
|
|
305
|
-
const Et = "2.0.24
|
|
305
|
+
const Et = "2.0.24", zt = () => {
|
|
306
306
|
ot("insertMenu", {
|
|
307
307
|
name: "_default",
|
|
308
308
|
default: !0,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./server-entry-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./server-entry-2ce603a9.cjs");exports._processContentResult=e._processContentResult;exports.createRegisterComponentMessage=e.createRegisterComponentMessage;exports.fetchBuilderProps=e.fetchBuilderProps;exports.fetchEntries=e.fetchEntries;exports.fetchOneEntry=e.fetchOneEntry;exports.getBuilderSearchParams=e.getBuilderSearchParams;exports.isEditing=e.isEditing;exports.isPreviewing=e.isPreviewing;exports.register=e.register;exports.setEditorSettings=e.setEditorSettings;exports.subscribeToEditor=e.subscribeToEditor;exports.track=e.track;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _processContentResult as r, createRegisterComponentMessage as s, fetchBuilderProps as i, fetchEntries as n, fetchOneEntry as o, getBuilderSearchParams as c, isEditing as g, isPreviewing as a, register as d, setEditorSettings as E, subscribeToEditor as f, track as h } from "./server-entry-
|
|
1
|
+
import { _processContentResult as r, createRegisterComponentMessage as s, fetchBuilderProps as i, fetchEntries as n, fetchOneEntry as o, getBuilderSearchParams as c, isEditing as g, isPreviewing as a, register as d, setEditorSettings as E, subscribeToEditor as f, track as h } from "./server-entry-bf8bf121.js";
|
|
2
2
|
export {
|
|
3
3
|
r as _processContentResult,
|
|
4
4
|
s as createRegisterComponentMessage,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { isEditing, isBrowser, getUserAttributes, TARGET, logger, MSG_PREFIX } from "./server-entry-
|
|
1
|
+
import { isEditing, isBrowser, getUserAttributes, TARGET, logger, MSG_PREFIX, checkIsDefined } from "./server-entry-bf8bf121.js";
|
|
2
2
|
const getFunctionArguments = ({
|
|
3
3
|
builder: e,
|
|
4
4
|
context: t,
|
|
5
|
-
event:
|
|
5
|
+
event: r,
|
|
6
6
|
state: n
|
|
7
7
|
}) => Object.entries({
|
|
8
8
|
state: n,
|
|
@@ -10,7 +10,7 @@ const getFunctionArguments = ({
|
|
|
10
10
|
// legacy
|
|
11
11
|
builder: e,
|
|
12
12
|
context: t,
|
|
13
|
-
event:
|
|
13
|
+
event: r
|
|
14
14
|
}), getBuilderGlobals = () => ({
|
|
15
15
|
isEditing: isEditing(),
|
|
16
16
|
isBrowser: isBrowser(),
|
|
@@ -22,25 +22,25 @@ const getFunctionArguments = ({
|
|
|
22
22
|
function flattenState({
|
|
23
23
|
rootState: e,
|
|
24
24
|
localState: t,
|
|
25
|
-
rootSetState:
|
|
25
|
+
rootSetState: r
|
|
26
26
|
}) {
|
|
27
27
|
return new Proxy(e, {
|
|
28
|
-
get: (n,
|
|
29
|
-
if (t &&
|
|
30
|
-
return t[
|
|
31
|
-
const
|
|
32
|
-
return typeof
|
|
33
|
-
rootState:
|
|
28
|
+
get: (n, o) => {
|
|
29
|
+
if (t && o in t)
|
|
30
|
+
return t[o];
|
|
31
|
+
const s = n[o];
|
|
32
|
+
return typeof s == "object" && s !== null ? flattenState({
|
|
33
|
+
rootState: s,
|
|
34
34
|
localState: void 0,
|
|
35
|
-
rootSetState:
|
|
36
|
-
n[
|
|
35
|
+
rootSetState: r ? (i) => {
|
|
36
|
+
n[o] = i, r(n);
|
|
37
37
|
} : void 0
|
|
38
|
-
}) :
|
|
38
|
+
}) : s;
|
|
39
39
|
},
|
|
40
|
-
set: (n,
|
|
41
|
-
if (t &&
|
|
40
|
+
set: (n, o, s) => {
|
|
41
|
+
if (t && o in t)
|
|
42
42
|
throw new Error("Writing to local state is not allowed as it is read-only.");
|
|
43
|
-
return n[
|
|
43
|
+
return n[o] = s, r == null || r(n), !0;
|
|
44
44
|
}
|
|
45
45
|
});
|
|
46
46
|
}
|
|
@@ -53,11 +53,11 @@ const SDK_NAME_FOR_TARGET = (() => {
|
|
|
53
53
|
default:
|
|
54
54
|
return TARGET;
|
|
55
55
|
}
|
|
56
|
-
})(), SDK_NAME = `@builder.io/sdk-${SDK_NAME_FOR_TARGET}`, fastClone = (e) => JSON.parse(JSON.stringify(e)), set = (e, t,
|
|
56
|
+
})(), SDK_NAME = `@builder.io/sdk-${SDK_NAME_FOR_TARGET}`, fastClone = (e) => JSON.parse(JSON.stringify(e)), set = (e, t, r) => {
|
|
57
57
|
if (Object(e) !== e)
|
|
58
58
|
return e;
|
|
59
59
|
const n = Array.isArray(t) ? t : t.toString().match(/[^.[\]]+/g);
|
|
60
|
-
return n.slice(0, -1).reduce((
|
|
60
|
+
return n.slice(0, -1).reduce((o, s, i) => Object(o[s]) === o[s] ? o[s] : o[s] = Math.abs(Number(n[i + 1])) >> 0 === +n[i + 1] ? [] : {}, e)[n[n.length - 1]] = r, e;
|
|
61
61
|
}, noop = () => {
|
|
62
62
|
};
|
|
63
63
|
let safeDynamicRequire = noop;
|
|
@@ -95,10 +95,10 @@ var refToProxy = (obj) => {
|
|
|
95
95
|
code: e,
|
|
96
96
|
args: t
|
|
97
97
|
}) => {
|
|
98
|
-
const
|
|
98
|
+
const r = t.map(([n]) => `var ${n} = refToProxy(${getSyncValName(n)}); `).join("");
|
|
99
99
|
return `
|
|
100
100
|
${REF_TO_PROXY_FN}
|
|
101
|
-
${
|
|
101
|
+
${r}
|
|
102
102
|
function theFunction() {
|
|
103
103
|
${e}
|
|
104
104
|
}
|
|
@@ -114,7 +114,7 @@ if (typeof output === 'object' && output !== null) {
|
|
|
114
114
|
};
|
|
115
115
|
let IVM_INSTANCE = null, IVM_CONTEXT = null;
|
|
116
116
|
const setIvm = (e, t = {}) => {
|
|
117
|
-
IVM_INSTANCE
|
|
117
|
+
IVM_INSTANCE = e, setIsolateContext(t);
|
|
118
118
|
}, SHOULD_MENTION_INITIALIZE_SCRIPT = SDK_NAME === "@builder.io/sdk-react-nextjs" || SDK_NAME === "@builder.io/sdk-react" || SDK_NAME === "@builder.io/sdk-qwik" || SDK_NAME === "@builder.io/sdk-vue", getIvm = () => {
|
|
119
119
|
try {
|
|
120
120
|
if (IVM_INSTANCE)
|
|
@@ -138,53 +138,64 @@ const setIvm = (e, t = {}) => {
|
|
|
138
138
|
function setIsolateContext(e = {
|
|
139
139
|
memoryLimit: 128
|
|
140
140
|
}) {
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
console.log(...o);
|
|
146
|
-
}), r.setSync(INJECTED_IVM_GLOBAL, t), IVM_CONTEXT = n, n;
|
|
141
|
+
const t = getIvm(), n = new t.Isolate(e).createContextSync(), o = n.global;
|
|
142
|
+
return o.setSync("global", o.derefInto()), o.setSync("log", function(...s) {
|
|
143
|
+
console.log(...s);
|
|
144
|
+
}), o.setSync(INJECTED_IVM_GLOBAL, t), IVM_CONTEXT = n, n;
|
|
147
145
|
}
|
|
148
|
-
const getIsolateContext = () => setIsolateContext(), runInNode = ({
|
|
146
|
+
const getIsolateContext = () => IVM_CONTEXT || setIsolateContext(), runInNode = ({
|
|
149
147
|
code: e,
|
|
150
148
|
builder: t,
|
|
151
|
-
context:
|
|
149
|
+
context: r,
|
|
152
150
|
event: n,
|
|
153
|
-
localState:
|
|
154
|
-
rootSetState:
|
|
151
|
+
localState: o,
|
|
152
|
+
rootSetState: s,
|
|
155
153
|
rootState: i
|
|
156
154
|
}) => {
|
|
157
|
-
const
|
|
155
|
+
const E = getIvm(), I = fastClone({
|
|
158
156
|
...i,
|
|
159
|
-
...
|
|
157
|
+
...o
|
|
160
158
|
}), l = getFunctionArguments({
|
|
161
159
|
builder: t,
|
|
162
|
-
context:
|
|
160
|
+
context: r,
|
|
163
161
|
event: n,
|
|
164
|
-
state:
|
|
165
|
-
}), a = getIsolateContext(),
|
|
166
|
-
|
|
167
|
-
set(i, c, u),
|
|
162
|
+
state: I
|
|
163
|
+
}), a = getIsolateContext(), d = a.global;
|
|
164
|
+
d.setSync(BUILDER_SET_STATE_NAME, function(c, u) {
|
|
165
|
+
set(i, c, u), s == null || s(i);
|
|
168
166
|
}), l.forEach(([c, u]) => {
|
|
169
|
-
const
|
|
167
|
+
const y = typeof u == "object" ? new E.Reference(
|
|
170
168
|
// workaround: methods with default values for arguments is not being cloned over
|
|
171
169
|
c === "builder" ? {
|
|
172
170
|
...u,
|
|
173
171
|
getUserAttributes: () => u.getUserAttributes()
|
|
174
172
|
} : u
|
|
175
173
|
) : null;
|
|
176
|
-
|
|
174
|
+
d.setSync(getSyncValName(c), y);
|
|
177
175
|
});
|
|
178
|
-
const
|
|
176
|
+
const N = processCode({
|
|
179
177
|
code: e,
|
|
180
178
|
args: l
|
|
181
|
-
}),
|
|
179
|
+
}), f = a.evalClosureSync(N);
|
|
182
180
|
try {
|
|
183
|
-
return JSON.parse(
|
|
181
|
+
return JSON.parse(f);
|
|
184
182
|
} catch {
|
|
185
|
-
return
|
|
183
|
+
return f;
|
|
186
184
|
}
|
|
187
185
|
};
|
|
186
|
+
function isNodeRuntime() {
|
|
187
|
+
var e;
|
|
188
|
+
return typeof process != "undefined" && checkIsDefined((e = process == null ? void 0 : process.versions) == null ? void 0 : e.node);
|
|
189
|
+
}
|
|
190
|
+
const shouldForceBrowserRuntimeInNode = ({
|
|
191
|
+
shouldLogWarning: e
|
|
192
|
+
}) => {
|
|
193
|
+
var o;
|
|
194
|
+
if (!isNodeRuntime())
|
|
195
|
+
return !1;
|
|
196
|
+
const t = process.arch === "arm64", r = process.version.startsWith("v20"), n = (o = process.env.NODE_OPTIONS) == null ? void 0 : o.includes("--no-node-snapshot");
|
|
197
|
+
return t && r && !n ? (e && logger.log("Skipping usage of `isolated-vm` to avoid crashes in Node v20 on an arm64 machine.\n If you would like to use the `isolated-vm` package on this machine, please provide the `NODE_OPTIONS=--no-node-snapshot` config to your Node process.\n See https://github.com/BuilderIO/builder/blob/main/packages/sdks/README.md#node-v20--m1-macs-apple-silicon-support for more information.\n "), !0) : !1;
|
|
198
|
+
};
|
|
188
199
|
export {
|
|
189
200
|
fastClone,
|
|
190
201
|
flattenState,
|
|
@@ -193,5 +204,6 @@ export {
|
|
|
193
204
|
parseCode,
|
|
194
205
|
runInNode,
|
|
195
206
|
set,
|
|
196
|
-
setIvm
|
|
207
|
+
setIvm,
|
|
208
|
+
shouldForceBrowserRuntimeInNode
|
|
197
209
|
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";const serverEntry=require("./server-entry-2ce603a9.cjs"),getFunctionArguments=({builder:e,context:t,event:o,state:n})=>Object.entries({state:n,Builder:e,builder:e,context:t,event:o}),getBuilderGlobals=()=>({isEditing:serverEntry.isEditing(),isBrowser:serverEntry.isBrowser(),isServer:!serverEntry.isBrowser(),getUserAttributes:()=>serverEntry.getUserAttributes()}),parseCode=(e,{isExpression:t=!0})=>t&&!(e.includes(";")||e.includes(" return ")||e.trim().startsWith("return "))?`return (${e});`:e;function flattenState({rootState:e,localState:t,rootSetState:o}){return new Proxy(e,{get:(n,r)=>{if(t&&r in t)return t[r];const s=n[r];return typeof s=="object"&&s!==null?flattenState({rootState:s,localState:void 0,rootSetState:o?i=>{n[r]=i,o(n)}:void 0}):s},set:(n,r,s)=>{if(t&&r in t)throw new Error("Writing to local state is not allowed as it is read-only.");return n[r]=s,o==null||o(n),!0}})}const SDK_NAME_FOR_TARGET=(()=>{switch(serverEntry.TARGET){case"rsc":return"react-nextjs";case"reactNative":return"react-native";default:return serverEntry.TARGET}})(),SDK_NAME=`@builder.io/sdk-${SDK_NAME_FOR_TARGET}`,fastClone=e=>JSON.parse(JSON.stringify(e)),set=(e,t,o)=>{if(Object(e)!==e)return e;const n=Array.isArray(t)?t:t.toString().match(/[^.[\]]+/g);return n.slice(0,-1).reduce((r,s,i)=>Object(r[s])===r[s]?r[s]:r[s]=Math.abs(Number(n[i+1]))>>0===+n[i+1]?[]:{},e)[n[n.length-1]]=o,e},noop=()=>{};let safeDynamicRequire=noop;try{safeDynamicRequire=eval("require")}catch(e){}const getSyncValName=e=>`bldr_${e}_sync`,BUILDER_SET_STATE_NAME="BUILDER_SET_STATE",INJECTED_IVM_GLOBAL="BUILDER_IVM",REF_TO_PROXY_FN=`
|
|
2
|
+
var refToProxy = (obj) => {
|
|
3
|
+
if (typeof obj !== 'object' || obj === null) {
|
|
4
|
+
return obj;
|
|
5
|
+
}
|
|
6
|
+
return new Proxy({}, {
|
|
7
|
+
get(target, key) {
|
|
8
|
+
if (key === 'copySync') {
|
|
9
|
+
return () => obj.copySync();
|
|
10
|
+
}
|
|
11
|
+
const val = obj.getSync(key);
|
|
12
|
+
if (typeof val?.getSync === 'function') {
|
|
13
|
+
return refToProxy(val);
|
|
14
|
+
}
|
|
15
|
+
return val;
|
|
16
|
+
},
|
|
17
|
+
set(target, key, value) {
|
|
18
|
+
const v = typeof value === 'object' ? new ${INJECTED_IVM_GLOBAL}.Reference(value) : value;
|
|
19
|
+
obj.setSync(key, v);
|
|
20
|
+
${BUILDER_SET_STATE_NAME}(key, value)
|
|
21
|
+
},
|
|
22
|
+
deleteProperty(target, key) {
|
|
23
|
+
obj.deleteSync(key);
|
|
24
|
+
}
|
|
25
|
+
})
|
|
26
|
+
}
|
|
27
|
+
`,processCode=({code:e,args:t})=>{const o=t.map(([n])=>`var ${n} = refToProxy(${getSyncValName(n)}); `).join("");return`
|
|
28
|
+
${REF_TO_PROXY_FN}
|
|
29
|
+
${o}
|
|
30
|
+
function theFunction() {
|
|
31
|
+
${e}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const output = theFunction()
|
|
35
|
+
|
|
36
|
+
if (typeof output === 'object' && output !== null) {
|
|
37
|
+
return JSON.stringify(output.copySync ? output.copySync() : output);
|
|
38
|
+
} else {
|
|
39
|
+
return output;
|
|
40
|
+
}
|
|
41
|
+
`};let IVM_INSTANCE=null,IVM_CONTEXT=null;const setIvm=(e,t={})=>{IVM_INSTANCE=e,setIsolateContext(t)},SHOULD_MENTION_INITIALIZE_SCRIPT=SDK_NAME==="@builder.io/sdk-react-nextjs"||SDK_NAME==="@builder.io/sdk-react"||SDK_NAME==="@builder.io/sdk-qwik"||SDK_NAME==="@builder.io/sdk-vue",getIvm=()=>{try{if(IVM_INSTANCE)return IVM_INSTANCE;const t=safeDynamicRequire("isolated-vm");if(t)return t}catch(t){serverEntry.logger.error("isolated-vm import error.",t)}const e=`${serverEntry.MSG_PREFIX}could not import \`isolated-vm\` module for safe script execution on a Node server.
|
|
42
|
+
|
|
43
|
+
SOLUTION: In a server-only execution path within your application, do one of the following:
|
|
44
|
+
|
|
45
|
+
${SHOULD_MENTION_INITIALIZE_SCRIPT?`- import and call \`initializeNodeRuntime()\` from "${SDK_NAME}/node/init".`:""}
|
|
46
|
+
- add the following import: \`await import('isolated-vm')\`.
|
|
47
|
+
|
|
48
|
+
For more information, visit https://builder.io/c/docs/integration-tips#enabling-data-bindings-in-node-environments`;throw new Error(e)};function setIsolateContext(e={memoryLimit:128}){const t=getIvm(),n=new t.Isolate(e).createContextSync(),r=n.global;return r.setSync("global",r.derefInto()),r.setSync("log",function(...s){console.log(...s)}),r.setSync(INJECTED_IVM_GLOBAL,t),IVM_CONTEXT=n,n}const getIsolateContext=()=>IVM_CONTEXT||setIsolateContext(),runInNode=({code:e,builder:t,context:o,event:n,localState:r,rootSetState:s,rootState:i})=>{const y=getIvm(),f=fastClone({...i,...r}),l=getFunctionArguments({builder:t,context:o,event:n,state:f}),a=getIsolateContext(),d=a.global;d.setSync(BUILDER_SET_STATE_NAME,function(c,u){set(i,c,u),s==null||s(i)}),l.forEach(([c,u])=>{const N=typeof u=="object"?new y.Reference(c==="builder"?{...u,getUserAttributes:()=>u.getUserAttributes()}:u):null;d.setSync(getSyncValName(c),N)});const I=processCode({code:e,args:l}),E=a.evalClosureSync(I);try{return JSON.parse(E)}catch{return E}};function isNodeRuntime(){var e;return typeof process!="undefined"&&serverEntry.checkIsDefined((e=process==null?void 0:process.versions)==null?void 0:e.node)}const shouldForceBrowserRuntimeInNode=({shouldLogWarning:e})=>{var r;if(!isNodeRuntime())return!1;const t=process.arch==="arm64",o=process.version.startsWith("v20"),n=(r=process.env.NODE_OPTIONS)==null?void 0:r.includes("--no-node-snapshot");return t&&o&&!n?(e&&serverEntry.logger.log("Skipping usage of `isolated-vm` to avoid crashes in Node v20 on an arm64 machine.\n If you would like to use the `isolated-vm` package on this machine, please provide the `NODE_OPTIONS=--no-node-snapshot` config to your Node process.\n See https://github.com/BuilderIO/builder/blob/main/packages/sdks/README.md#node-v20--m1-macs-apple-silicon-support for more information.\n "),!0):!1};exports.fastClone=fastClone;exports.flattenState=flattenState;exports.getBuilderGlobals=getBuilderGlobals;exports.getFunctionArguments=getFunctionArguments;exports.parseCode=parseCode;exports.runInNode=runInNode;exports.set=set;exports.setIvm=setIvm;exports.shouldForceBrowserRuntimeInNode=shouldForceBrowserRuntimeInNode;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@builder.io/sdk-react",
|
|
3
3
|
"description": "Builder.io SDK for React",
|
|
4
|
-
"version": "2.0.24
|
|
4
|
+
"version": "2.0.24",
|
|
5
5
|
"homepage": "https://github.com/BuilderIO/builder/tree/main/packages/sdks/output/react",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"repository": {
|
|
@@ -85,11 +85,6 @@
|
|
|
85
85
|
"import": "./lib/node/init.mjs",
|
|
86
86
|
"require": "./lib/node/init.cjs"
|
|
87
87
|
},
|
|
88
|
-
"./node/setIvm": {
|
|
89
|
-
"types": "./types/functions/evaluate/node-runtime/setIvm.d.ts",
|
|
90
|
-
"import": "./lib/node/setIvm.mjs",
|
|
91
|
-
"require": "./lib/node/setIvm.cjs"
|
|
92
|
-
},
|
|
93
88
|
"./edge": {
|
|
94
89
|
"types": "./types/index.d.ts",
|
|
95
90
|
"import": "./lib/edge/edge-entry.mjs",
|
|
@@ -121,7 +116,7 @@
|
|
|
121
116
|
"build:browser": "SDK_ENV=browser vite build --mode lib"
|
|
122
117
|
},
|
|
123
118
|
"peerDependencies": {
|
|
124
|
-
"react": ">=16"
|
|
119
|
+
"react": ">=16 || ^19.0.0-rc"
|
|
125
120
|
},
|
|
126
121
|
"dependencies": {
|
|
127
122
|
"isolated-vm": "^5.0.0"
|
|
@@ -153,6 +148,5 @@
|
|
|
153
148
|
]
|
|
154
149
|
}
|
|
155
150
|
}
|
|
156
|
-
}
|
|
157
|
-
"stableVersion": "2.0.23"
|
|
151
|
+
}
|
|
158
152
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "2.0.24
|
|
1
|
+
export declare const SDK_VERSION = "2.0.24";
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
"use strict";const serverEntry=require("./server-entry-2dc8afb6.cjs"),getFunctionArguments=({builder:e,context:t,event:s,state:r})=>Object.entries({state:r,Builder:e,builder:e,context:t,event:s}),getBuilderGlobals=()=>({isEditing:serverEntry.isEditing(),isBrowser:serverEntry.isBrowser(),isServer:!serverEntry.isBrowser(),getUserAttributes:()=>serverEntry.getUserAttributes()}),parseCode=(e,{isExpression:t=!0})=>t&&!(e.includes(";")||e.includes(" return ")||e.trim().startsWith("return "))?`return (${e});`:e;function flattenState({rootState:e,localState:t,rootSetState:s}){return new Proxy(e,{get:(r,n)=>{if(t&&n in t)return t[n];const o=r[n];return typeof o=="object"&&o!==null?flattenState({rootState:o,localState:void 0,rootSetState:s?i=>{r[n]=i,s(r)}:void 0}):o},set:(r,n,o)=>{if(t&&n in t)throw new Error("Writing to local state is not allowed as it is read-only.");return r[n]=o,s==null||s(r),!0}})}const SDK_NAME_FOR_TARGET=(()=>{switch(serverEntry.TARGET){case"rsc":return"react-nextjs";case"reactNative":return"react-native";default:return serverEntry.TARGET}})(),SDK_NAME=`@builder.io/sdk-${SDK_NAME_FOR_TARGET}`,fastClone=e=>JSON.parse(JSON.stringify(e)),set=(e,t,s)=>{if(Object(e)!==e)return e;const r=Array.isArray(t)?t:t.toString().match(/[^.[\]]+/g);return r.slice(0,-1).reduce((n,o,i)=>Object(n[o])===n[o]?n[o]:n[o]=Math.abs(Number(r[i+1]))>>0===+r[i+1]?[]:{},e)[r[r.length-1]]=s,e},noop=()=>{};let safeDynamicRequire=noop;try{safeDynamicRequire=eval("require")}catch(e){}const getSyncValName=e=>`bldr_${e}_sync`,BUILDER_SET_STATE_NAME="BUILDER_SET_STATE",INJECTED_IVM_GLOBAL="BUILDER_IVM",REF_TO_PROXY_FN=`
|
|
2
|
-
var refToProxy = (obj) => {
|
|
3
|
-
if (typeof obj !== 'object' || obj === null) {
|
|
4
|
-
return obj;
|
|
5
|
-
}
|
|
6
|
-
return new Proxy({}, {
|
|
7
|
-
get(target, key) {
|
|
8
|
-
if (key === 'copySync') {
|
|
9
|
-
return () => obj.copySync();
|
|
10
|
-
}
|
|
11
|
-
const val = obj.getSync(key);
|
|
12
|
-
if (typeof val?.getSync === 'function') {
|
|
13
|
-
return refToProxy(val);
|
|
14
|
-
}
|
|
15
|
-
return val;
|
|
16
|
-
},
|
|
17
|
-
set(target, key, value) {
|
|
18
|
-
const v = typeof value === 'object' ? new ${INJECTED_IVM_GLOBAL}.Reference(value) : value;
|
|
19
|
-
obj.setSync(key, v);
|
|
20
|
-
${BUILDER_SET_STATE_NAME}(key, value)
|
|
21
|
-
},
|
|
22
|
-
deleteProperty(target, key) {
|
|
23
|
-
obj.deleteSync(key);
|
|
24
|
-
}
|
|
25
|
-
})
|
|
26
|
-
}
|
|
27
|
-
`,processCode=({code:e,args:t})=>{const s=t.map(([r])=>`var ${r} = refToProxy(${getSyncValName(r)}); `).join("");return`
|
|
28
|
-
${REF_TO_PROXY_FN}
|
|
29
|
-
${s}
|
|
30
|
-
function theFunction() {
|
|
31
|
-
${e}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
const output = theFunction()
|
|
35
|
-
|
|
36
|
-
if (typeof output === 'object' && output !== null) {
|
|
37
|
-
return JSON.stringify(output.copySync ? output.copySync() : output);
|
|
38
|
-
} else {
|
|
39
|
-
return output;
|
|
40
|
-
}
|
|
41
|
-
`};let IVM_INSTANCE=null,IVM_CONTEXT=null;const setIvm=(e,t={})=>{IVM_INSTANCE||(IVM_INSTANCE=e,setIsolateContext(t))},SHOULD_MENTION_INITIALIZE_SCRIPT=SDK_NAME==="@builder.io/sdk-react-nextjs"||SDK_NAME==="@builder.io/sdk-react"||SDK_NAME==="@builder.io/sdk-qwik"||SDK_NAME==="@builder.io/sdk-vue",getIvm=()=>{try{if(IVM_INSTANCE)return IVM_INSTANCE;const t=safeDynamicRequire("isolated-vm");if(t)return t}catch(t){serverEntry.logger.error("isolated-vm import error.",t)}const e=`${serverEntry.MSG_PREFIX}could not import \`isolated-vm\` module for safe script execution on a Node server.
|
|
42
|
-
|
|
43
|
-
SOLUTION: In a server-only execution path within your application, do one of the following:
|
|
44
|
-
|
|
45
|
-
${SHOULD_MENTION_INITIALIZE_SCRIPT?`- import and call \`initializeNodeRuntime()\` from "${SDK_NAME}/node/init".`:""}
|
|
46
|
-
- add the following import: \`await import('isolated-vm')\`.
|
|
47
|
-
|
|
48
|
-
For more information, visit https://builder.io/c/docs/integration-tips#enabling-data-bindings-in-node-environments`;throw new Error(e)};function setIsolateContext(e={memoryLimit:128}){if(IVM_CONTEXT)return IVM_CONTEXT;const t=getIvm(),r=new t.Isolate(e).createContextSync(),n=r.global;return n.setSync("global",n.derefInto()),n.setSync("log",function(...o){console.log(...o)}),n.setSync(INJECTED_IVM_GLOBAL,t),IVM_CONTEXT=r,r}const getIsolateContext=()=>setIsolateContext(),runInNode=({code:e,builder:t,context:s,event:r,localState:n,rootSetState:o,rootState:i})=>{const I=getIvm(),d=fastClone({...i,...n}),l=getFunctionArguments({builder:t,context:s,event:r,state:d}),a=getIsolateContext(),E=a.global;E.setSync(BUILDER_SET_STATE_NAME,function(u,c){set(i,u,c),o==null||o(i)}),l.forEach(([u,c])=>{const f=typeof c=="object"?new I.Reference(u==="builder"?{...c,getUserAttributes:()=>c.getUserAttributes()}:c):null;E.setSync(getSyncValName(u),f)});const _=processCode({code:e,args:l}),y=a.evalClosureSync(_);try{return JSON.parse(y)}catch{return y}};exports.fastClone=fastClone;exports.flattenState=flattenState;exports.getBuilderGlobals=getBuilderGlobals;exports.getFunctionArguments=getFunctionArguments;exports.parseCode=parseCode;exports.runInNode=runInNode;exports.set=set;exports.setIvm=setIvm;
|
package/lib/node/setIvm.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./setIvm-3ef2ce91.cjs");require("./server-entry-2dc8afb6.cjs");exports.setIvm=e.setIvm;
|
package/lib/node/setIvm.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const s=require("./server-entry-2dc8afb6.cjs");function t(){var e;return typeof process!="undefined"&&s.checkIsDefined((e=process==null?void 0:process.versions)==null?void 0:e.node)}const c=({shouldLogWarning:e})=>{var o;if(!t())return!1;const n=process.arch==="arm64",r=process.version.startsWith("v20"),i=(o=process.env.NODE_OPTIONS)==null?void 0:o.includes("--no-node-snapshot");return n&&r&&!i?(e&&s.logger.log("Skipping usage of `isolated-vm` to avoid crashes in Node v20 on an arm64 machine.\n If you would like to use the `isolated-vm` package on this machine, please provide the `NODE_OPTIONS=--no-node-snapshot` config to your Node process.\n See https://github.com/BuilderIO/builder/blob/main/packages/sdks/README.md#node-v20--m1-macs-apple-silicon-support for more information.\n "),!0):!1};exports.shouldForceBrowserRuntimeInNode=c;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { checkIsDefined as i, logger as t } from "./server-entry-2b6abd6c.js";
|
|
2
|
-
function a() {
|
|
3
|
-
var o;
|
|
4
|
-
return typeof process != "undefined" && i((o = process == null ? void 0 : process.versions) == null ? void 0 : o.node);
|
|
5
|
-
}
|
|
6
|
-
const d = ({
|
|
7
|
-
shouldLogWarning: o
|
|
8
|
-
}) => {
|
|
9
|
-
var e;
|
|
10
|
-
if (!a())
|
|
11
|
-
return !1;
|
|
12
|
-
const s = process.arch === "arm64", n = process.version.startsWith("v20"), r = (e = process.env.NODE_OPTIONS) == null ? void 0 : e.includes("--no-node-snapshot");
|
|
13
|
-
return s && n && !r ? (o && t.log("Skipping usage of `isolated-vm` to avoid crashes in Node v20 on an arm64 machine.\n If you would like to use the `isolated-vm` package on this machine, please provide the `NODE_OPTIONS=--no-node-snapshot` config to your Node process.\n See https://github.com/BuilderIO/builder/blob/main/packages/sdks/README.md#node-v20--m1-macs-apple-silicon-support for more information.\n "), !0) : !1;
|
|
14
|
-
};
|
|
15
|
-
export {
|
|
16
|
-
d as shouldForceBrowserRuntimeInNode
|
|
17
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from './textarea';
|