@builder.io/sdk-react 2.0.23 → 2.0.24-1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/browser/blocks-exports.cjs +6 -6
- package/lib/browser/blocks-exports.mjs +43 -38
- package/lib/browser/index.cjs +1 -1
- package/lib/browser/index.mjs +1 -1
- package/lib/browser/{server-entry-e7cbd2fc.js → server-entry-c147474a.js} +1 -1
- package/lib/browser/{server-entry-3855428f.cjs → server-entry-e66059f2.cjs} +1 -1
- package/lib/browser/server-entry.cjs +1 -1
- package/lib/browser/server-entry.mjs +1 -1
- package/lib/edge/{accordion-57df597a.js → accordion-5efe1f76.js} +1 -1
- package/lib/edge/{accordion-91147fe9.cjs → accordion-6cefa683.cjs} +1 -1
- package/lib/edge/{blocks-263c1bb6.js → blocks-47ceb648.js} +18 -13
- package/lib/edge/{blocks-98b19deb.cjs → blocks-ce41f8e2.cjs} +3 -3
- package/lib/edge/blocks-exports.cjs +1 -1
- package/lib/edge/blocks-exports.mjs +2 -2
- package/lib/edge/{button-ff78ab2a.cjs → button-375ad1e4.cjs} +1 -1
- package/lib/edge/{button-d681583e.js → button-68dc9c15.js} +2 -2
- package/lib/edge/{columns-d6892637.cjs → columns-2ced7464.cjs} +1 -1
- package/lib/edge/{columns-a50c2c9f.js → columns-fa195aa5.js} +4 -4
- package/lib/edge/{content-variants-83a1241a.cjs → content-variants-12e2c711.cjs} +1 -1
- package/lib/edge/{content-variants-978a8be6.js → content-variants-b2ab5645.js} +11 -11
- package/lib/edge/{evaluate-f8347208.cjs → evaluate-71f3ff34.cjs} +1 -1
- package/lib/edge/{evaluate-b7da3191.js → evaluate-822680d7.js} +1 -1
- package/lib/edge/{form-32085b13.js → form-785f87de.js} +4 -4
- package/lib/edge/{form-bb1f8672.cjs → form-eb6df3c0.cjs} +1 -1
- package/lib/edge/{get-class-prop-name-956dc1ac.cjs → get-class-prop-name-20feabab.cjs} +1 -1
- package/lib/edge/{get-class-prop-name-8c8a1b1c.js → get-class-prop-name-dba1cf23.js} +1 -1
- package/lib/edge/{img-ce324880.js → img-9409566a.js} +1 -1
- package/lib/edge/{img-9e702744.cjs → img-df10057c.cjs} +1 -1
- package/lib/edge/index.cjs +1 -1
- package/lib/edge/index.mjs +1 -1
- package/lib/edge/{input-c5dda333.js → input-175da017.js} +1 -1
- package/lib/edge/{input-09bbebbb.cjs → input-ad5251cd.cjs} +1 -1
- package/lib/edge/{select-235baf48.cjs → select-c59da945.cjs} +1 -1
- package/lib/edge/{select-8936ea79.js → select-e6904df2.js} +1 -1
- package/lib/edge/{server-entry-f0d7962f.cjs → server-entry-2d057cd0.cjs} +1 -1
- package/lib/edge/{server-entry-b3befa52.js → server-entry-7d728f1e.js} +1 -1
- package/lib/edge/server-entry.cjs +1 -1
- package/lib/edge/server-entry.mjs +1 -1
- package/lib/edge/{slot-375680d2.cjs → slot-27d61c78.cjs} +1 -1
- package/lib/edge/{slot-30e6c2aa.js → slot-a7fc3fa3.js} +4 -4
- package/lib/edge/{symbol-73a9d7cb.cjs → symbol-5cf11265.cjs} +1 -1
- package/lib/edge/{symbol-0deda8a7.js → symbol-d41cf7c4.js} +2 -2
- package/lib/edge/{tabs-ffc5ae5d.cjs → tabs-3a710ab1.cjs} +1 -1
- package/lib/edge/{tabs-577ba54e.js → tabs-81ccc6f8.js} +4 -4
- package/lib/edge/{text-0a14d566.js → text-345dd047.js} +2 -2
- package/lib/edge/{text-3dd73c6e.cjs → text-59e297e6.cjs} +1 -1
- package/lib/node/blocks-exports.cjs +21 -21
- package/lib/node/blocks-exports.mjs +52 -46
- package/lib/node/index.cjs +1 -1
- package/lib/node/index.mjs +26 -25
- package/lib/node/init.cjs +1 -1
- package/lib/node/init.mjs +8 -6
- package/lib/node/{server-entry-a7139d8f.cjs → server-entry-1c1c1459.cjs} +1 -1
- package/lib/node/{server-entry-fa11b353.js → server-entry-8956b57e.js} +1 -1
- package/lib/node/server-entry.cjs +1 -1
- package/lib/node/server-entry.mjs +1 -1
- package/lib/node/{should-force-browser-runtime-in-node-ddb84649.js → setIvm-2e562b9e.js} +41 -55
- package/lib/node/{should-force-browser-runtime-in-node-0bf7076b.cjs → setIvm-bf4f998d.cjs} +4 -4
- package/lib/node/setIvm.cjs +1 -0
- package/lib/node/setIvm.mjs +5 -0
- package/lib/node/should-force-browser-runtime-in-node-a23d3cc4.js +17 -0
- package/lib/node/should-force-browser-runtime-in-node-ce6ededa.cjs +1 -0
- package/package.json +3 -2
- package/types/blocks/textarea/component-info.d.ts +2 -0
- package/types/blocks/textarea/index.d.ts +1 -0
- package/types/blocks/textarea/textarea.d.ts +13 -0
- package/types/cjs/blocks/BaseText.d.cts +6 -0
- package/types/cjs/blocks/button/button.d.cts +4 -0
- package/types/cjs/blocks/button/button.types.d.cts +7 -0
- package/types/cjs/blocks/button/component-info.d.cts +2 -0
- package/types/cjs/blocks/button/index.d.cts +1 -0
- package/types/cjs/blocks/columns/columns.d.cts +4 -0
- package/types/cjs/blocks/columns/columns.types.d.cts +15 -0
- package/types/cjs/blocks/columns/component-info.d.cts +2 -0
- package/types/cjs/blocks/columns/helpers.d.cts +1 -0
- package/types/cjs/blocks/columns/index.d.cts +1 -0
- package/types/cjs/blocks/custom-code/component-info.d.cts +2 -0
- package/types/cjs/blocks/custom-code/custom-code.d.cts +7 -0
- package/types/cjs/blocks/custom-code/index.d.cts +1 -0
- package/types/cjs/blocks/embed/component-info.d.cts +2 -0
- package/types/cjs/blocks/embed/embed.d.cts +6 -0
- package/types/cjs/blocks/embed/helpers.d.cts +1 -0
- package/types/cjs/blocks/embed/index.d.cts +1 -0
- package/types/cjs/blocks/form/form/component-info.d.cts +2 -0
- package/types/cjs/blocks/form/form/form.d.cts +33 -0
- package/types/cjs/blocks/form/form/index.d.cts +1 -0
- package/types/cjs/blocks/form/input/component-info.d.cts +2 -0
- package/types/cjs/blocks/form/input/index.d.cts +1 -0
- package/types/cjs/blocks/form/input/input.d.cts +15 -0
- package/types/cjs/blocks/form/select/component-info.d.cts +2 -0
- package/types/cjs/blocks/form/select/index.d.cts +1 -0
- package/types/cjs/blocks/form/select/select.d.cts +16 -0
- package/types/cjs/blocks/form/submit-button/component-info.d.cts +2 -0
- package/types/cjs/blocks/form/submit-button/index.d.cts +1 -0
- package/types/cjs/blocks/form/submit-button/submit-button.d.cts +10 -0
- package/types/cjs/blocks/fragment/component-info.d.cts +2 -0
- package/types/cjs/blocks/fragment/fragment.d.cts +4 -0
- package/types/cjs/blocks/fragment/fragment.types.d.cts +5 -0
- package/types/cjs/blocks/fragment/index.d.cts +1 -0
- package/types/cjs/blocks/helpers.d.cts +13 -0
- package/types/cjs/blocks/image/component-info.d.cts +2 -0
- package/types/cjs/blocks/image/image.d.cts +4 -0
- package/types/cjs/blocks/image/image.helpers.d.cts +1 -0
- package/types/cjs/blocks/image/image.types.d.cts +19 -0
- package/types/cjs/blocks/image/index.d.cts +1 -0
- package/types/cjs/blocks/img/component-info.d.cts +2 -0
- package/types/cjs/blocks/img/img.d.cts +14 -0
- package/types/cjs/blocks/img/index.d.cts +1 -0
- package/types/cjs/blocks/raw-text/component-info.d.cts +2 -0
- package/types/cjs/blocks/raw-text/index.d.cts +1 -0
- package/types/cjs/blocks/raw-text/raw-text.d.cts +7 -0
- package/types/cjs/blocks/section/component-info.d.cts +2 -0
- package/types/cjs/blocks/section/index.d.cts +1 -0
- package/types/cjs/blocks/section/section.d.cts +4 -0
- package/types/cjs/blocks/section/section.types.d.cts +6 -0
- package/types/cjs/blocks/slot/component-info.d.cts +2 -0
- package/types/cjs/blocks/slot/index.d.cts +1 -0
- package/types/cjs/blocks/slot/slot.d.cts +8 -0
- package/types/cjs/blocks/symbol/component-info.d.cts +2 -0
- package/types/cjs/blocks/symbol/index.d.cts +1 -0
- package/types/cjs/blocks/symbol/symbol.d.cts +4 -0
- package/types/cjs/blocks/symbol/symbol.helpers.d.cts +14 -0
- package/types/cjs/blocks/symbol/symbol.types.d.cts +18 -0
- package/types/cjs/blocks/tabs/component-info.d.cts +2 -0
- package/types/cjs/blocks/tabs/index.d.cts +1 -0
- package/types/cjs/blocks/tabs/tabs.d.cts +4 -0
- package/types/cjs/blocks/tabs/tabs.types.d.cts +13 -0
- package/types/cjs/blocks/text/component-info.d.cts +2 -0
- package/types/cjs/blocks/text/index.d.cts +1 -0
- package/types/cjs/blocks/text/text.d.cts +4 -0
- package/types/cjs/blocks/text/text.types.d.cts +4 -0
- package/types/cjs/blocks/textarea/component-info.d.cts +2 -0
- package/types/cjs/blocks/textarea/index.d.cts +1 -0
- package/types/cjs/blocks/textarea/textarea.d.cts +13 -0
- package/types/cjs/blocks/video/component-info.d.cts +2 -0
- package/types/cjs/blocks/video/index.d.cts +1 -0
- package/types/cjs/blocks/video/video.d.cts +4 -0
- package/types/cjs/blocks/video/video.types.d.cts +21 -0
- package/types/cjs/components/block/animator.d.cts +5 -0
- package/types/cjs/components/block/block.d.cts +11 -0
- package/types/cjs/components/block/block.helpers.d.cts +18 -0
- package/types/cjs/components/block/components/block-styles.d.cts +9 -0
- package/types/cjs/components/block/components/block-wrapper.d.cts +15 -0
- package/types/cjs/components/block/components/component-ref/component-ref.d.cts +4 -0
- package/types/cjs/components/block/components/component-ref/component-ref.helpers.d.cts +31 -0
- package/types/cjs/components/block/components/interactive-element.d.cts +14 -0
- package/types/cjs/components/block/components/repeated-block.d.cts +8 -0
- package/types/cjs/components/block/types.d.cts +6 -0
- package/types/cjs/components/blocks/blocks-wrapper.d.cts +19 -0
- package/types/cjs/components/blocks/blocks.d.cts +4 -0
- package/types/cjs/components/blocks/blocks.types.d.cts +7 -0
- package/types/cjs/components/blocks/index.d.cts +1 -0
- package/types/cjs/components/content/components/enable-editor.d.cts +10 -0
- package/types/cjs/components/content/components/styles.d.cts +10 -0
- package/types/cjs/components/content/components/styles.helpers.d.cts +17 -0
- package/types/cjs/components/content/content.d.cts +4 -0
- package/types/cjs/components/content/content.helpers.d.cts +7 -0
- package/types/cjs/components/content/content.types.d.cts +13 -0
- package/types/cjs/components/content/contentProps.types.d.cts +17 -0
- package/types/cjs/components/content/index.d.cts +1 -0
- package/types/cjs/components/content/wrap-component-ref.d.cts +6 -0
- package/types/cjs/components/content-variants/content-variants.d.cts +10 -0
- package/types/cjs/components/content-variants/content-variants.types.d.cts +71 -0
- package/types/cjs/components/content-variants/helpers.d.cts +41 -0
- package/types/cjs/components/content-variants/index.d.cts +1 -0
- package/types/cjs/components/content-variants/inlined-fns.d.cts +14 -0
- package/types/cjs/components/dynamic-div.d.cts +15 -0
- package/types/cjs/components/dynamic-renderer/dynamic-renderer.d.cts +9 -0
- package/types/cjs/components/dynamic-renderer/dynamic-renderer.helpers.d.cts +1 -0
- package/types/cjs/components/error-boundary.d.cts +11 -0
- package/types/cjs/components/inlined-script.d.cts +7 -0
- package/types/cjs/components/inlined-styles.d.cts +7 -0
- package/types/cjs/constants/builder-registered-components.d.cts +6 -0
- package/types/cjs/constants/device-sizes.d.cts +13 -0
- package/types/cjs/constants/extra-components.d.cts +7 -0
- package/types/cjs/constants/sdk-version.d.cts +1 -0
- package/types/cjs/constants/target.d.cts +2 -0
- package/types/cjs/context/builder.context.d.cts +3 -0
- package/types/cjs/context/components.context.d.cts +3 -0
- package/types/cjs/context/index.d.cts +1 -0
- package/types/cjs/context/types.d.cts +36 -0
- package/types/cjs/functions/apply-patch-with-mutation.d.cts +10 -0
- package/types/cjs/functions/camel-to-kebab-case.d.cts +1 -0
- package/types/cjs/functions/deopt.d.cts +4 -0
- package/types/cjs/functions/evaluate/browser-runtime/browser.d.cts +8 -0
- package/types/cjs/functions/evaluate/browser-runtime/index.d.cts +1 -0
- package/types/cjs/functions/evaluate/choose-eval.d.cts +6 -0
- package/types/cjs/functions/evaluate/edge-runtime/acorn-interpreter.d.cts +2 -0
- package/types/cjs/functions/evaluate/edge-runtime/edge-runtime.d.cts +2 -0
- package/types/cjs/functions/evaluate/edge-runtime/index.d.cts +1 -0
- package/types/cjs/functions/evaluate/evaluate.d.cts +4 -0
- package/types/cjs/functions/evaluate/helpers.d.cts +25 -0
- package/types/cjs/functions/evaluate/index.d.cts +1 -0
- package/types/cjs/functions/evaluate/node-runtime/index.d.cts +1 -0
- package/types/cjs/functions/evaluate/node-runtime/init.d.cts +13 -0
- package/types/cjs/functions/evaluate/node-runtime/node-runtime.d.cts +11 -0
- package/types/cjs/functions/evaluate/node-runtime/safeDynamicRequire.d.cts +6 -0
- package/types/cjs/functions/evaluate/placeholder-runtime.d.cts +2 -0
- package/types/cjs/functions/evaluate/should-force-browser-runtime-in-node.d.cts +1 -0
- package/types/cjs/functions/event-handler-name.d.cts +1 -0
- package/types/cjs/functions/extract-text-styles.d.cts +4 -0
- package/types/cjs/functions/fast-clone.d.cts +4 -0
- package/types/cjs/functions/fetch-builder-props.d.cts +53 -0
- package/types/cjs/functions/get-block-actions-handler.d.cts +8 -0
- package/types/cjs/functions/get-block-actions.d.cts +10 -0
- package/types/cjs/functions/get-block-component-options.d.cts +2 -0
- package/types/cjs/functions/get-block-properties.d.cts +10 -0
- package/types/cjs/functions/get-builder-search-params/index.d.cts +9 -0
- package/types/cjs/functions/get-class-prop-name.d.cts +1 -0
- package/types/cjs/functions/get-content/generate-content-url.d.cts +2 -0
- package/types/cjs/functions/get-content/index.d.cts +18 -0
- package/types/cjs/functions/get-content/types.d.cts +139 -0
- package/types/cjs/functions/get-env.d.cts +2 -0
- package/types/cjs/functions/get-fetch.d.cts +1 -0
- package/types/cjs/functions/get-global-this.d.cts +4 -0
- package/types/cjs/functions/get-processed-block.d.cts +10 -0
- package/types/cjs/functions/get-style.d.cts +12 -0
- package/types/cjs/functions/get.d.cts +1 -0
- package/types/cjs/functions/is-browser.d.cts +1 -0
- package/types/cjs/functions/is-edge-runtime.d.cts +4 -0
- package/types/cjs/functions/is-editing.d.cts +2 -0
- package/types/cjs/functions/is-from-trusted-host.d.cts +3 -0
- package/types/cjs/functions/is-iframe.d.cts +1 -0
- package/types/cjs/functions/is-node-runtime.d.cts +4 -0
- package/types/cjs/functions/is-previewing.d.cts +2 -0
- package/types/cjs/functions/on-change.d.cts +7 -0
- package/types/cjs/functions/register-component.d.cts +6 -0
- package/types/cjs/functions/register.d.cts +16 -0
- package/types/cjs/functions/set-editor-settings.d.cts +4 -0
- package/types/cjs/functions/set.d.cts +7 -0
- package/types/cjs/functions/track/helpers.d.cts +5 -0
- package/types/cjs/functions/track/index.d.cts +51 -0
- package/types/cjs/functions/track/interaction.d.cts +13 -0
- package/types/cjs/functions/transform-block-properties.d.cts +7 -0
- package/types/cjs/functions/transform-block.d.cts +2 -0
- package/types/cjs/functions/transform-style-property.d.cts +7 -0
- package/types/cjs/helpers/ab-tests.d.cts +9 -0
- package/types/cjs/helpers/canTrack.d.cts +1 -0
- package/types/cjs/helpers/cookie.d.cts +19 -0
- package/types/cjs/helpers/css.d.cts +7 -0
- package/types/cjs/helpers/flatten.d.cts +16 -0
- package/types/cjs/helpers/localStorage.d.cts +9 -0
- package/types/cjs/helpers/logger.d.cts +7 -0
- package/types/cjs/helpers/nullable.d.cts +2 -0
- package/types/cjs/helpers/omit.d.cts +1 -0
- package/types/cjs/helpers/preview-lru-cache/get.d.cts +2 -0
- package/types/cjs/helpers/preview-lru-cache/helpers.d.cts +1 -0
- package/types/cjs/helpers/preview-lru-cache/init.d.cts +6 -0
- package/types/cjs/helpers/preview-lru-cache/set.d.cts +7 -0
- package/types/cjs/helpers/preview-lru-cache/types.d.cts +1 -0
- package/types/cjs/helpers/search/search.d.cts +5 -0
- package/types/cjs/helpers/sessionId.d.cts +6 -0
- package/types/cjs/helpers/subscribe-to-editor.d.cts +35 -0
- package/types/cjs/helpers/time.d.cts +1 -0
- package/types/cjs/helpers/url.d.cts +6 -0
- package/types/cjs/helpers/uuid.d.cts +8 -0
- package/types/cjs/helpers/visitorId.d.cts +6 -0
- package/types/cjs/index-helpers/blocks-exports.d.cts +14 -0
- package/types/cjs/index-helpers/top-of-file.d.cts +1 -0
- package/types/cjs/index.d.cts +10 -0
- package/types/cjs/scripts/init-editing.d.cts +7 -0
- package/types/cjs/server-index.d.cts +39 -0
- package/types/cjs/types/api-version.d.cts +2 -0
- package/types/cjs/types/builder-block.d.cts +84 -0
- package/types/cjs/types/builder-content.d.cts +44 -0
- package/types/cjs/types/builder-props.d.cts +12 -0
- package/types/cjs/types/can-track.d.cts +3 -0
- package/types/cjs/types/components.d.cts +110 -0
- package/types/cjs/types/deep-partial.d.cts +3 -0
- package/types/cjs/types/element.d.cts +59 -0
- package/types/cjs/types/enforced-partials.d.cts +26 -0
- package/types/cjs/types/input.d.cts +122 -0
- package/types/cjs/types/targets.d.cts +1 -0
- package/types/cjs/types/typescript.d.cts +8 -0
- package/types/components/blocks/blocks-wrapper.d.ts +1 -0
- package/types/components/blocks/blocks.types.d.ts +2 -1
- package/types/constants/sdk-version.d.ts +1 -1
- package/types/esm/blocks/BaseText.d.mts +6 -0
- package/types/esm/blocks/button/button.d.mts +4 -0
- package/types/esm/blocks/button/button.types.d.mts +7 -0
- package/types/esm/blocks/button/component-info.d.mts +2 -0
- package/types/esm/blocks/button/index.d.mts +1 -0
- package/types/esm/blocks/columns/columns.d.mts +4 -0
- package/types/esm/blocks/columns/columns.types.d.mts +15 -0
- package/types/esm/blocks/columns/component-info.d.mts +2 -0
- package/types/esm/blocks/columns/helpers.d.mts +1 -0
- package/types/esm/blocks/columns/index.d.mts +1 -0
- package/types/esm/blocks/custom-code/component-info.d.mts +2 -0
- package/types/esm/blocks/custom-code/custom-code.d.mts +7 -0
- package/types/esm/blocks/custom-code/index.d.mts +1 -0
- package/types/esm/blocks/embed/component-info.d.mts +2 -0
- package/types/esm/blocks/embed/embed.d.mts +6 -0
- package/types/esm/blocks/embed/helpers.d.mts +1 -0
- package/types/esm/blocks/embed/index.d.mts +1 -0
- package/types/esm/blocks/form/form/component-info.d.mts +2 -0
- package/types/esm/blocks/form/form/form.d.mts +33 -0
- package/types/esm/blocks/form/form/index.d.mts +1 -0
- package/types/esm/blocks/form/input/component-info.d.mts +2 -0
- package/types/esm/blocks/form/input/index.d.mts +1 -0
- package/types/esm/blocks/form/input/input.d.mts +15 -0
- package/types/esm/blocks/form/select/component-info.d.mts +2 -0
- package/types/esm/blocks/form/select/index.d.mts +1 -0
- package/types/esm/blocks/form/select/select.d.mts +16 -0
- package/types/esm/blocks/form/submit-button/component-info.d.mts +2 -0
- package/types/esm/blocks/form/submit-button/index.d.mts +1 -0
- package/types/esm/blocks/form/submit-button/submit-button.d.mts +10 -0
- package/types/esm/blocks/fragment/component-info.d.mts +2 -0
- package/types/esm/blocks/fragment/fragment.d.mts +4 -0
- package/types/esm/blocks/fragment/fragment.types.d.mts +5 -0
- package/types/esm/blocks/fragment/index.d.mts +1 -0
- package/types/esm/blocks/helpers.d.mts +13 -0
- package/types/esm/blocks/image/component-info.d.mts +2 -0
- package/types/esm/blocks/image/image.d.mts +4 -0
- package/types/esm/blocks/image/image.helpers.d.mts +1 -0
- package/types/esm/blocks/image/image.types.d.mts +19 -0
- package/types/esm/blocks/image/index.d.mts +1 -0
- package/types/esm/blocks/img/component-info.d.mts +2 -0
- package/types/esm/blocks/img/img.d.mts +14 -0
- package/types/esm/blocks/img/index.d.mts +1 -0
- package/types/esm/blocks/raw-text/component-info.d.mts +2 -0
- package/types/esm/blocks/raw-text/index.d.mts +1 -0
- package/types/esm/blocks/raw-text/raw-text.d.mts +7 -0
- package/types/esm/blocks/section/component-info.d.mts +2 -0
- package/types/esm/blocks/section/index.d.mts +1 -0
- package/types/esm/blocks/section/section.d.mts +4 -0
- package/types/esm/blocks/section/section.types.d.mts +6 -0
- package/types/esm/blocks/slot/component-info.d.mts +2 -0
- package/types/esm/blocks/slot/index.d.mts +1 -0
- package/types/esm/blocks/slot/slot.d.mts +8 -0
- package/types/esm/blocks/symbol/component-info.d.mts +2 -0
- package/types/esm/blocks/symbol/index.d.mts +1 -0
- package/types/esm/blocks/symbol/symbol.d.mts +4 -0
- package/types/esm/blocks/symbol/symbol.helpers.d.mts +14 -0
- package/types/esm/blocks/symbol/symbol.types.d.mts +18 -0
- package/types/esm/blocks/tabs/component-info.d.mts +2 -0
- package/types/esm/blocks/tabs/index.d.mts +1 -0
- package/types/esm/blocks/tabs/tabs.d.mts +4 -0
- package/types/esm/blocks/tabs/tabs.types.d.mts +13 -0
- package/types/esm/blocks/text/component-info.d.mts +2 -0
- package/types/esm/blocks/text/index.d.mts +1 -0
- package/types/esm/blocks/text/text.d.mts +4 -0
- package/types/esm/blocks/text/text.types.d.mts +4 -0
- package/types/esm/blocks/textarea/component-info.d.mts +2 -0
- package/types/esm/blocks/textarea/index.d.mts +1 -0
- package/types/esm/blocks/textarea/textarea.d.mts +13 -0
- package/types/esm/blocks/video/component-info.d.mts +2 -0
- package/types/esm/blocks/video/index.d.mts +1 -0
- package/types/esm/blocks/video/video.d.mts +4 -0
- package/types/esm/blocks/video/video.types.d.mts +21 -0
- package/types/esm/components/block/animator.d.mts +5 -0
- package/types/esm/components/block/block.d.mts +11 -0
- package/types/esm/components/block/block.helpers.d.mts +18 -0
- package/types/esm/components/block/components/block-styles.d.mts +9 -0
- package/types/esm/components/block/components/block-wrapper.d.mts +15 -0
- package/types/esm/components/block/components/component-ref/component-ref.d.mts +4 -0
- package/types/esm/components/block/components/component-ref/component-ref.helpers.d.mts +31 -0
- package/types/esm/components/block/components/interactive-element.d.mts +14 -0
- package/types/esm/components/block/components/repeated-block.d.mts +8 -0
- package/types/esm/components/block/types.d.mts +6 -0
- package/types/esm/components/blocks/blocks-wrapper.d.mts +19 -0
- package/types/esm/components/blocks/blocks.d.mts +4 -0
- package/types/esm/components/blocks/blocks.types.d.mts +7 -0
- package/types/esm/components/blocks/index.d.mts +1 -0
- package/types/esm/components/content/components/enable-editor.d.mts +10 -0
- package/types/esm/components/content/components/styles.d.mts +10 -0
- package/types/esm/components/content/components/styles.helpers.d.mts +17 -0
- package/types/esm/components/content/content.d.mts +4 -0
- package/types/esm/components/content/content.helpers.d.mts +7 -0
- package/types/esm/components/content/content.types.d.mts +13 -0
- package/types/esm/components/content/contentProps.types.d.mts +17 -0
- package/types/esm/components/content/index.d.mts +1 -0
- package/types/esm/components/content/wrap-component-ref.d.mts +6 -0
- package/types/esm/components/content-variants/content-variants.d.mts +10 -0
- package/types/esm/components/content-variants/content-variants.types.d.mts +71 -0
- package/types/esm/components/content-variants/helpers.d.mts +41 -0
- package/types/esm/components/content-variants/index.d.mts +1 -0
- package/types/esm/components/content-variants/inlined-fns.d.mts +14 -0
- package/types/esm/components/dynamic-div.d.mts +15 -0
- package/types/esm/components/dynamic-renderer/dynamic-renderer.d.mts +9 -0
- package/types/esm/components/dynamic-renderer/dynamic-renderer.helpers.d.mts +1 -0
- package/types/esm/components/error-boundary.d.mts +11 -0
- package/types/esm/components/inlined-script.d.mts +7 -0
- package/types/esm/components/inlined-styles.d.mts +7 -0
- package/types/esm/constants/builder-registered-components.d.mts +6 -0
- package/types/esm/constants/device-sizes.d.mts +13 -0
- package/types/esm/constants/extra-components.d.mts +7 -0
- package/types/esm/constants/sdk-version.d.mts +1 -0
- package/types/esm/constants/target.d.mts +2 -0
- package/types/esm/context/builder.context.d.mts +3 -0
- package/types/esm/context/components.context.d.mts +3 -0
- package/types/esm/context/index.d.mts +1 -0
- package/types/esm/context/types.d.mts +36 -0
- package/types/esm/functions/apply-patch-with-mutation.d.mts +10 -0
- package/types/esm/functions/camel-to-kebab-case.d.mts +1 -0
- package/types/esm/functions/deopt.d.mts +4 -0
- package/types/esm/functions/evaluate/browser-runtime/browser.d.mts +8 -0
- package/types/esm/functions/evaluate/browser-runtime/index.d.mts +1 -0
- package/types/esm/functions/evaluate/choose-eval.d.mts +6 -0
- package/types/esm/functions/evaluate/edge-runtime/acorn-interpreter.d.mts +2 -0
- package/types/esm/functions/evaluate/edge-runtime/edge-runtime.d.mts +2 -0
- package/types/esm/functions/evaluate/edge-runtime/index.d.mts +1 -0
- package/types/esm/functions/evaluate/evaluate.d.mts +4 -0
- package/types/esm/functions/evaluate/helpers.d.mts +25 -0
- package/types/esm/functions/evaluate/index.d.mts +1 -0
- package/types/esm/functions/evaluate/node-runtime/index.d.mts +1 -0
- package/types/esm/functions/evaluate/node-runtime/init.d.mts +13 -0
- package/types/esm/functions/evaluate/node-runtime/node-runtime.d.mts +11 -0
- package/types/esm/functions/evaluate/node-runtime/safeDynamicRequire.d.mts +6 -0
- package/types/esm/functions/evaluate/placeholder-runtime.d.mts +2 -0
- package/types/esm/functions/evaluate/should-force-browser-runtime-in-node.d.mts +1 -0
- package/types/esm/functions/event-handler-name.d.mts +1 -0
- package/types/esm/functions/extract-text-styles.d.mts +4 -0
- package/types/esm/functions/fast-clone.d.mts +4 -0
- package/types/esm/functions/fetch-builder-props.d.mts +53 -0
- package/types/esm/functions/get-block-actions-handler.d.mts +8 -0
- package/types/esm/functions/get-block-actions.d.mts +10 -0
- package/types/esm/functions/get-block-component-options.d.mts +2 -0
- package/types/esm/functions/get-block-properties.d.mts +10 -0
- package/types/esm/functions/get-builder-search-params/index.d.mts +9 -0
- package/types/esm/functions/get-class-prop-name.d.mts +1 -0
- package/types/esm/functions/get-content/generate-content-url.d.mts +2 -0
- package/types/esm/functions/get-content/index.d.mts +18 -0
- package/types/esm/functions/get-content/types.d.mts +139 -0
- package/types/esm/functions/get-env.d.mts +2 -0
- package/types/esm/functions/get-fetch.d.mts +1 -0
- package/types/esm/functions/get-global-this.d.mts +4 -0
- package/types/esm/functions/get-processed-block.d.mts +10 -0
- package/types/esm/functions/get-style.d.mts +12 -0
- package/types/esm/functions/get.d.mts +1 -0
- package/types/esm/functions/is-browser.d.mts +1 -0
- package/types/esm/functions/is-edge-runtime.d.mts +4 -0
- package/types/esm/functions/is-editing.d.mts +2 -0
- package/types/esm/functions/is-from-trusted-host.d.mts +3 -0
- package/types/esm/functions/is-iframe.d.mts +1 -0
- package/types/esm/functions/is-node-runtime.d.mts +4 -0
- package/types/esm/functions/is-previewing.d.mts +2 -0
- package/types/esm/functions/on-change.d.mts +7 -0
- package/types/esm/functions/register-component.d.mts +6 -0
- package/types/esm/functions/register.d.mts +16 -0
- package/types/esm/functions/set-editor-settings.d.mts +4 -0
- package/types/esm/functions/set.d.mts +7 -0
- package/types/esm/functions/track/helpers.d.mts +5 -0
- package/types/esm/functions/track/index.d.mts +51 -0
- package/types/esm/functions/track/interaction.d.mts +13 -0
- package/types/esm/functions/transform-block-properties.d.mts +7 -0
- package/types/esm/functions/transform-block.d.mts +2 -0
- package/types/esm/functions/transform-style-property.d.mts +7 -0
- package/types/esm/helpers/ab-tests.d.mts +9 -0
- package/types/esm/helpers/canTrack.d.mts +1 -0
- package/types/esm/helpers/cookie.d.mts +19 -0
- package/types/esm/helpers/css.d.mts +7 -0
- package/types/esm/helpers/flatten.d.mts +16 -0
- package/types/esm/helpers/localStorage.d.mts +9 -0
- package/types/esm/helpers/logger.d.mts +7 -0
- package/types/esm/helpers/nullable.d.mts +2 -0
- package/types/esm/helpers/omit.d.mts +1 -0
- package/types/esm/helpers/preview-lru-cache/get.d.mts +2 -0
- package/types/esm/helpers/preview-lru-cache/helpers.d.mts +1 -0
- package/types/esm/helpers/preview-lru-cache/init.d.mts +6 -0
- package/types/esm/helpers/preview-lru-cache/set.d.mts +7 -0
- package/types/esm/helpers/preview-lru-cache/types.d.mts +1 -0
- package/types/esm/helpers/search/search.d.mts +5 -0
- package/types/esm/helpers/sessionId.d.mts +6 -0
- package/types/esm/helpers/subscribe-to-editor.d.mts +35 -0
- package/types/esm/helpers/time.d.mts +1 -0
- package/types/esm/helpers/url.d.mts +6 -0
- package/types/esm/helpers/uuid.d.mts +8 -0
- package/types/esm/helpers/visitorId.d.mts +6 -0
- package/types/esm/index-helpers/blocks-exports.d.mts +14 -0
- package/types/esm/index-helpers/top-of-file.d.mts +1 -0
- package/types/esm/index.d.mts +10 -0
- package/types/esm/index.d.mts.d.mts +10 -0
- package/types/esm/scripts/init-editing.d.mts +7 -0
- package/types/esm/server-index.d.mts +39 -0
- package/types/esm/types/api-version.d.mts +2 -0
- package/types/esm/types/builder-block.d.mts +84 -0
- package/types/esm/types/builder-content.d.mts +44 -0
- package/types/esm/types/builder-props.d.mts +12 -0
- package/types/esm/types/can-track.d.mts +3 -0
- package/types/esm/types/components.d.mts +110 -0
- package/types/esm/types/deep-partial.d.mts +3 -0
- package/types/esm/types/element.d.mts +59 -0
- package/types/esm/types/enforced-partials.d.mts +26 -0
- package/types/esm/types/input.d.mts +122 -0
- package/types/esm/types/targets.d.mts +1 -0
- package/types/esm/types/typescript.d.mts +8 -0
- package/types/functions/evaluate/node-runtime/init.d.ts +2 -0
- package/types/functions/evaluate/node-runtime/setIvm.d.ts +1 -0
- package/types/helpers/sdk-headers.d.ts +5 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './content-variants.js';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WARNING: This file contains functions that get stringified and inlined into the HTML at build-time.
|
|
3
|
+
* They cannot import anything.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* For more information on how this works,
|
|
7
|
+
* see our [SSR A/B Test Docs](https://github.com/BuilderIO/builder/tree/main/packages/sdks/src/SSR_AB_TEST.md)
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* For more information on how this works,
|
|
11
|
+
* see our [SSR A/B Test Docs](https://github.com/BuilderIO/builder/tree/main/packages/sdks/src/SSR_AB_TEST.md)
|
|
12
|
+
*/
|
|
13
|
+
export declare const UPDATE_COOKIES_AND_STYLES_SCRIPT = "function updateCookiesAndStyles(contentId, variants, isHydrationTarget) {\n function getAndSetVariantId() {\n function setCookie(name, value, days) {\n let expires = '';\n if (days) {\n const date = new Date();\n date.setTime(date.getTime() + days * 24 * 60 * 60 * 1000);\n expires = '; expires=' + date.toUTCString();\n }\n document.cookie = name + '=' + (value || '') + expires + '; path=/' + '; Secure; SameSite=None';\n }\n function getCookie(name) {\n const nameEQ = name + '=';\n const ca = document.cookie.split(';');\n for (let i = 0; i < ca.length; i++) {\n let c = ca[i];\n while (c.charAt(0) === ' ') c = c.substring(1, c.length);\n if (c.indexOf(nameEQ) === 0) return c.substring(nameEQ.length, c.length);\n }\n return null;\n }\n const cookieName = `builder.tests.${contentId}`;\n const variantInCookie = getCookie(cookieName);\n const availableIDs = variants.map(vr => vr.id).concat(contentId);\n if (variantInCookie && availableIDs.includes(variantInCookie)) {\n return variantInCookie;\n }\n let n = 0;\n const random = Math.random();\n for (let i = 0; i < variants.length; i++) {\n const variant = variants[i];\n const testRatio = variant.testRatio;\n n += testRatio;\n if (random < n) {\n setCookie(cookieName, variant.id);\n return variant.id;\n }\n }\n setCookie(cookieName, contentId);\n return contentId;\n }\n const winningVariantId = getAndSetVariantId();\n const styleEl = document.currentScript?.previousElementSibling;\n if (isHydrationTarget) {\n styleEl.remove();\n const thisScriptEl = document.currentScript;\n thisScriptEl?.remove();\n } else {\n const newStyleStr = variants.concat({\n id: contentId\n }).filter(variant => variant.id !== winningVariantId).map(value => {\n return `.variant-${value.id} { display: none; }\n `;\n }).join('');\n styleEl.innerHTML = newStyleStr;\n }\n}";
|
|
14
|
+
export declare const UPDATE_VARIANT_VISIBILITY_SCRIPT = "function updateVariantVisibility(variantContentId, defaultContentId, isHydrationTarget) {\n if (!navigator.cookieEnabled) {\n return;\n }\n function getCookie(name) {\n const nameEQ = name + '=';\n const ca = document.cookie.split(';');\n for (let i = 0; i < ca.length; i++) {\n let c = ca[i];\n while (c.charAt(0) === ' ') c = c.substring(1, c.length);\n if (c.indexOf(nameEQ) === 0) return c.substring(nameEQ.length, c.length);\n }\n return null;\n }\n const cookieName = `builder.tests.${defaultContentId}`;\n const winningVariant = getCookie(cookieName);\n const parentDiv = document.currentScript?.parentElement;\n const isDefaultContent = variantContentId === defaultContentId;\n const isWinningVariant = winningVariant === variantContentId;\n if (isWinningVariant && !isDefaultContent) {\n parentDiv?.removeAttribute('hidden');\n parentDiv?.removeAttribute('aria-hidden');\n } else if (!isWinningVariant && isDefaultContent) {\n parentDiv?.setAttribute('hidden', 'true');\n parentDiv?.setAttribute('aria-hidden', 'true');\n }\n if (isHydrationTarget) {\n if (!isWinningVariant) {\n parentDiv?.remove();\n }\n const thisScriptEl = document.currentScript;\n thisScriptEl?.remove();\n }\n return;\n}";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export interface DynamicDivProps {
|
|
3
|
+
children?: any;
|
|
4
|
+
attributes: any;
|
|
5
|
+
actionAttributes: any;
|
|
6
|
+
BlockWrapperProps: any;
|
|
7
|
+
builderPath: any;
|
|
8
|
+
builderParentId: any;
|
|
9
|
+
BlocksWrapperProps: any;
|
|
10
|
+
contentWrapperProps: any;
|
|
11
|
+
builderModel: any;
|
|
12
|
+
ref: any;
|
|
13
|
+
}
|
|
14
|
+
declare function DynamicDiv(props: DynamicDivProps): React.JSX.Element;
|
|
15
|
+
export default DynamicDiv;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export interface DynamicRendererProps {
|
|
3
|
+
children?: any;
|
|
4
|
+
TagName: any;
|
|
5
|
+
attributes: any;
|
|
6
|
+
actionAttributes: any;
|
|
7
|
+
}
|
|
8
|
+
declare function DynamicRenderer(props: DynamicRendererProps): React.JSX.Element;
|
|
9
|
+
export default DynamicRenderer;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const isEmptyElement: (tagName: any) => boolean;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export default class ErrorBoundary extends React.Component<React.PropsWithChildren, {
|
|
3
|
+
hasError: boolean;
|
|
4
|
+
}> {
|
|
5
|
+
constructor(props: any);
|
|
6
|
+
static getDerivedStateFromError(_error: any): {
|
|
7
|
+
hasError: boolean;
|
|
8
|
+
};
|
|
9
|
+
componentDidCatch(error: any, info: any): void;
|
|
10
|
+
render(): string | number | boolean | React.JSX.Element | Iterable<React.ReactNode>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { RegisteredComponent } from '../context/types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Returns a list of all registered components.
|
|
4
|
+
* NOTE: This needs to be a function to work around ESM circular dependencies.
|
|
5
|
+
*/
|
|
6
|
+
export declare const getDefaultRegisteredComponents: () => RegisteredComponent[];
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export type SizeName = 'large' | 'medium' | 'small';
|
|
2
|
+
interface Size {
|
|
3
|
+
min: number;
|
|
4
|
+
default: number;
|
|
5
|
+
max: number;
|
|
6
|
+
}
|
|
7
|
+
export declare const getMaxWidthQueryForSize: (size: SizeName, sizeValues?: Record<SizeName, Size>) => string;
|
|
8
|
+
interface Breakpoints {
|
|
9
|
+
small?: number;
|
|
10
|
+
medium?: number;
|
|
11
|
+
}
|
|
12
|
+
export declare const getSizesForBreakpoints: ({ small, medium }: Breakpoints) => Record<SizeName, Size>;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* These are in a separate file because React Native does not support them (yet).
|
|
3
|
+
* Having them in a separate file allows us to override it to be empty in the
|
|
4
|
+
* React Native SDK.
|
|
5
|
+
*/
|
|
6
|
+
import type { RegisteredComponent } from '../context/types.js';
|
|
7
|
+
export declare const getExtraComponents: () => RegisteredComponent[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const SDK_VERSION = "1.0.27";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as BuilderContext } from './builder.context.js';
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { BlocksWrapperProps } from '../components/blocks/blocks-wrapper.js';
|
|
2
|
+
import type { ApiVersion } from '../types/api-version.js';
|
|
3
|
+
import type { BuilderContent } from '../types/builder-content.js';
|
|
4
|
+
import type { ComponentInfo } from '../types/components.js';
|
|
5
|
+
import type { Dictionary, Nullable } from '../types/typescript.js';
|
|
6
|
+
export type RegisteredComponent = ComponentInfo & {
|
|
7
|
+
component: any;
|
|
8
|
+
};
|
|
9
|
+
export type RegisteredComponents = Dictionary<RegisteredComponent>;
|
|
10
|
+
export type BuilderRenderState = Record<string, unknown>;
|
|
11
|
+
export type BuilderRenderContext = Record<string, unknown>;
|
|
12
|
+
export interface BuilderContextInterface extends Pick<BlocksWrapperProps, 'BlocksWrapper' | 'BlocksWrapperProps'> {
|
|
13
|
+
content: Nullable<BuilderContent>;
|
|
14
|
+
context: BuilderRenderContext;
|
|
15
|
+
/**
|
|
16
|
+
* The state of the application.
|
|
17
|
+
*
|
|
18
|
+
* NOTE: see `localState` below to understand how it is different from `rootState`.
|
|
19
|
+
*/
|
|
20
|
+
rootState: BuilderRenderState;
|
|
21
|
+
/**
|
|
22
|
+
* Some frameworks have a `setState` function which needs to be invoked to notify
|
|
23
|
+
* the framework of state change. (other frameworks don't in which case it is `undefined')
|
|
24
|
+
*/
|
|
25
|
+
rootSetState: ((rootState: BuilderRenderState) => void) | undefined;
|
|
26
|
+
/**
|
|
27
|
+
* The local state of the current component. This is different from `rootState` in that
|
|
28
|
+
* it can be a child state created by a repeater containing local state.
|
|
29
|
+
* The `rootState` is where all of the state mutations are actually stored.
|
|
30
|
+
*/
|
|
31
|
+
localState: BuilderRenderState | undefined;
|
|
32
|
+
apiKey: string | null;
|
|
33
|
+
apiVersion: ApiVersion | undefined;
|
|
34
|
+
componentInfos: Dictionary<ComponentInfo>;
|
|
35
|
+
inheritedStyles: Record<string, unknown>;
|
|
36
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type Patch = {
|
|
2
|
+
path: string;
|
|
3
|
+
op: 'add' | 'remove' | 'replace';
|
|
4
|
+
value: any;
|
|
5
|
+
};
|
|
6
|
+
export declare const applyPatchWithMinimalMutationChain: <T extends object>(obj: T, patch: {
|
|
7
|
+
path: string;
|
|
8
|
+
op: 'add' | 'remove' | 'replace';
|
|
9
|
+
value: any;
|
|
10
|
+
}, preserveRoot?: boolean) => T;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const camelToKebabCase: (string: string) => string;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { BuilderRenderState } from '../../../context/types.js';
|
|
2
|
+
import type { ExecutorArgs } from '../helpers.js';
|
|
3
|
+
export declare const runInBrowser: ({ code, builder, context, event, localState, rootSetState, rootState }: ExecutorArgs) => any;
|
|
4
|
+
export declare function flattenState({ rootState, localState, rootSetState }: {
|
|
5
|
+
rootState: Record<string | symbol, any>;
|
|
6
|
+
localState: Record<string | symbol, any> | undefined;
|
|
7
|
+
rootSetState: ((rootState: BuilderRenderState) => void) | undefined;
|
|
8
|
+
}): BuilderRenderState;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { runInBrowser as evaluator } from './browser.js';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ExecutorArgs } from './helpers.js';
|
|
2
|
+
/**
|
|
3
|
+
* Even though we have separate runtimes for browser/node/edge, sometimes frameworks will
|
|
4
|
+
* end up sending the server runtime code to the browser (most notably in dev mode).
|
|
5
|
+
*/
|
|
6
|
+
export declare const chooseBrowserOrServerEval: (args: ExecutorArgs) => any;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { runInEdge as evaluator } from './edge-runtime.js';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { BuilderContextInterface, BuilderRenderState } from '../../context/types.js';
|
|
2
|
+
import { getUserAttributes } from '../track/helpers.js';
|
|
3
|
+
export type EvaluatorArgs = Omit<ExecutorArgs, 'builder' | 'event'> & {
|
|
4
|
+
event?: Event;
|
|
5
|
+
isExpression?: boolean;
|
|
6
|
+
enableCache: boolean;
|
|
7
|
+
};
|
|
8
|
+
export type BuilderGlobals = {
|
|
9
|
+
isEditing: boolean | undefined;
|
|
10
|
+
isBrowser: boolean | undefined;
|
|
11
|
+
isServer: boolean | undefined;
|
|
12
|
+
getUserAttributes: typeof getUserAttributes;
|
|
13
|
+
};
|
|
14
|
+
export type ExecutorArgs = Pick<BuilderContextInterface, 'localState' | 'context' | 'rootState' | 'rootSetState'> & {
|
|
15
|
+
code: string;
|
|
16
|
+
builder: BuilderGlobals;
|
|
17
|
+
event: Event | undefined;
|
|
18
|
+
};
|
|
19
|
+
export type Executor = (args: ExecutorArgs) => any;
|
|
20
|
+
export type FunctionArguments = ReturnType<typeof getFunctionArguments>;
|
|
21
|
+
export declare const getFunctionArguments: ({ builder, context, event, state }: Pick<ExecutorArgs, "context" | "builder" | "event"> & {
|
|
22
|
+
state: BuilderRenderState;
|
|
23
|
+
}) => [string, Event | BuilderRenderState | import("../../context/types.js").BuilderRenderContext | BuilderGlobals][];
|
|
24
|
+
export declare const getBuilderGlobals: () => BuilderGlobals;
|
|
25
|
+
export declare const parseCode: (code: string, { isExpression }: Pick<EvaluatorArgs, 'isExpression'>) => string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { evaluate } from './evaluate.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { runInNode as evaluator } from './node-runtime.js';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { IsolateOptions } from 'isolated-vm';
|
|
2
|
+
/**
|
|
3
|
+
* This function initializes the SDK on a Node server. It handles importing the
|
|
4
|
+
* `isolated-vm` package which is needed for dynamic bindings.
|
|
5
|
+
*
|
|
6
|
+
* NOTE: this function cannot be called on the client. You must call this function
|
|
7
|
+
* from a server-only location, such as:
|
|
8
|
+
* - The NextJS Pages router's `_document.tsx`
|
|
9
|
+
* - Your Remix route's `loader`
|
|
10
|
+
*/
|
|
11
|
+
export declare const initializeNodeRuntime: (args?: {
|
|
12
|
+
ivmIsolateOptions?: IsolateOptions;
|
|
13
|
+
}) => void;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { IsolateOptions } from 'isolated-vm';
|
|
2
|
+
import type { ExecutorArgs } from '../helpers.js';
|
|
3
|
+
type IsolatedVMImport = typeof import('isolated-vm');
|
|
4
|
+
/**
|
|
5
|
+
* Set the `isolated-vm` instance to be used by the node runtime.
|
|
6
|
+
* This is useful for environments that are not able to rely on our
|
|
7
|
+
* `safeDynamicRequire` trick to import the `isolated-vm` package.
|
|
8
|
+
*/
|
|
9
|
+
export declare const setIvm: (ivm: IsolatedVMImport, options?: IsolateOptions) => void;
|
|
10
|
+
export declare const runInNode: ({ code, builder, context, event, localState, rootSetState, rootState }: ExecutorArgs) => any;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Overriding usage of `node:module` because of https://github.com/vercel/next.js/issues/60491
|
|
3
|
+
* This doesn't actually work in production, but it lets the tests pass...
|
|
4
|
+
* Mono-repo env seems to pull in the SDK differently which allows the eval('require') to work.
|
|
5
|
+
*/
|
|
6
|
+
export declare let safeDynamicRequire: typeof require;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const shouldForceBrowserRuntimeInNode: () => boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getEventHandlerName: (key: string) => string;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { ContentVariantsPrps } from '../components/content-variants/content-variants.types.js';
|
|
2
|
+
import type { Dictionary } from '../types/typescript.js';
|
|
3
|
+
import type { GetContentOptions } from './get-content/types.js';
|
|
4
|
+
type GetBuilderPropsOptions = (Omit<GetContentOptions, 'model'> & {
|
|
5
|
+
model?: string;
|
|
6
|
+
}) & ({
|
|
7
|
+
/**
|
|
8
|
+
* The current URL path. Used to determine the `urlPath` for targeting content.
|
|
9
|
+
*
|
|
10
|
+
* Cannot be used with `url`.
|
|
11
|
+
*/
|
|
12
|
+
path: string;
|
|
13
|
+
/**
|
|
14
|
+
* The current URL search params. Used to parse the `searchParams` for targeting content.
|
|
15
|
+
*
|
|
16
|
+
* Cannot be used with `url`.
|
|
17
|
+
*/
|
|
18
|
+
searchParams?: URLSearchParams | Dictionary<string | string[]>;
|
|
19
|
+
url?: undefined;
|
|
20
|
+
} | {
|
|
21
|
+
/**
|
|
22
|
+
* The current URL. Used to determine the `urlPath` for targeting content and
|
|
23
|
+
* to parse the `searchParams` for targeting content.
|
|
24
|
+
*
|
|
25
|
+
* Cannot be used with `path` or `searchParams`.
|
|
26
|
+
*/
|
|
27
|
+
url: URL;
|
|
28
|
+
path?: undefined;
|
|
29
|
+
searchParams?: undefined;
|
|
30
|
+
} | {
|
|
31
|
+
url?: undefined;
|
|
32
|
+
path?: undefined;
|
|
33
|
+
searchParams?: undefined;
|
|
34
|
+
});
|
|
35
|
+
/**
|
|
36
|
+
* Given an `apiKey` and `url` (or `path` + `searchParams`), provides all props that `Content` needs to render Builder Content.
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* ```jsx
|
|
40
|
+
* const builderProps = await fetchBuilderProps({
|
|
41
|
+
* apiKey: 'API_KEY',
|
|
42
|
+
* // provide `url`
|
|
43
|
+
* url: yourPageUrl,
|
|
44
|
+
* // OR provide `path` + `searchParams`
|
|
45
|
+
* path: yourPath,
|
|
46
|
+
* searchParams: yourSearchParams,
|
|
47
|
+
* });
|
|
48
|
+
*
|
|
49
|
+
* return <Content {...builderProps} />;
|
|
50
|
+
* ```
|
|
51
|
+
*/
|
|
52
|
+
export declare const fetchBuilderProps: (_args: GetBuilderPropsOptions) => Promise<ContentVariantsPrps>;
|
|
53
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { BuilderContextInterface } from '../context/types.js';
|
|
2
|
+
import type { BuilderBlock } from '../types/builder-block.js';
|
|
3
|
+
type Options = {
|
|
4
|
+
block: BuilderBlock;
|
|
5
|
+
} & Pick<BuilderContextInterface, 'localState' | 'context' | 'rootState' | 'rootSetState'>;
|
|
6
|
+
type EventHandler = (event: Event) => any;
|
|
7
|
+
export declare const createEventHandler: (value: string, options: Options) => EventHandler;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { BuilderContextInterface } from '../context/types.js';
|
|
2
|
+
import type { BuilderBlock } from '../types/builder-block.js';
|
|
3
|
+
type Actions = {
|
|
4
|
+
[index: string]: (event: Event) => any;
|
|
5
|
+
};
|
|
6
|
+
export declare function getBlockActions(options: {
|
|
7
|
+
block: BuilderBlock;
|
|
8
|
+
stripPrefix?: boolean;
|
|
9
|
+
} & Pick<BuilderContextInterface, 'localState' | 'context' | 'rootState' | 'rootSetState'>): Actions;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { BuilderContextInterface } from '../context/types.js';
|
|
2
|
+
import type { BuilderBlock } from '../types/builder-block.js';
|
|
3
|
+
export declare function getBlockProperties({ block, context }: {
|
|
4
|
+
block: BuilderBlock;
|
|
5
|
+
context: BuilderContextInterface;
|
|
6
|
+
}): {
|
|
7
|
+
'builder-id': string;
|
|
8
|
+
style: string | Partial<CSSStyleDeclaration>;
|
|
9
|
+
href: any;
|
|
10
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { QueryObject } from '../../helpers/search/search.js';
|
|
2
|
+
/**
|
|
3
|
+
* Receives a `URLSearchParams` object or a regular query object, and returns the subset of query params that are
|
|
4
|
+
* relevant to the Builder SDK.
|
|
5
|
+
*
|
|
6
|
+
* @returns
|
|
7
|
+
*/
|
|
8
|
+
export declare const getBuilderSearchParams: (_options: QueryObject | URLSearchParams | undefined) => QueryObject;
|
|
9
|
+
export declare const getBuilderSearchParamsFromWindow: () => QueryObject;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getClassPropName: () => "className" | "class";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { BuilderContent } from '../../types/builder-content.js';
|
|
2
|
+
import type { GetContentOptions } from './types.js';
|
|
3
|
+
/**
|
|
4
|
+
* Returns the first content entry that matches the given options.
|
|
5
|
+
*/
|
|
6
|
+
export declare function fetchOneEntry(options: GetContentOptions): Promise<BuilderContent | null>;
|
|
7
|
+
type ContentResults = {
|
|
8
|
+
results: BuilderContent[];
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* @internal Exported only for testing purposes. Do not use.
|
|
12
|
+
*/
|
|
13
|
+
export declare const _processContentResult: (options: GetContentOptions, content: ContentResults, url?: URL) => Promise<BuilderContent[]>;
|
|
14
|
+
/**
|
|
15
|
+
* Returns a paginated array of entries that match the given options.
|
|
16
|
+
*/
|
|
17
|
+
export declare function fetchEntries(options: GetContentOptions): Promise<BuilderContent[]>;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
export interface GetContentOptions {
|
|
2
|
+
/** The model to get content for (required) */
|
|
3
|
+
model: string;
|
|
4
|
+
/** Your public API key (required) */
|
|
5
|
+
apiKey: string;
|
|
6
|
+
/** Number of items to fetch. Default is 1 */
|
|
7
|
+
limit?: number;
|
|
8
|
+
/**
|
|
9
|
+
* Use to specify an offset for pagination of results. The default is 0.
|
|
10
|
+
*/
|
|
11
|
+
offset?: number;
|
|
12
|
+
/**
|
|
13
|
+
* User attribute key value pairs to be used for targeting
|
|
14
|
+
* https://www.builder.io/c/docs/custom-targeting-attributes
|
|
15
|
+
*
|
|
16
|
+
* e.g.
|
|
17
|
+
* ```js
|
|
18
|
+
* userAttributes: {
|
|
19
|
+
* urlPath: '/',
|
|
20
|
+
* returnVisitor: true,
|
|
21
|
+
* device: 'mobile'
|
|
22
|
+
* }
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
userAttributes?: (Record<string, any> & {
|
|
26
|
+
urlPath?: string;
|
|
27
|
+
}) | null;
|
|
28
|
+
/**
|
|
29
|
+
* Mongodb style query of your data. E.g.:
|
|
30
|
+
*
|
|
31
|
+
* ```js
|
|
32
|
+
* query: {
|
|
33
|
+
* id: 'abc123',
|
|
34
|
+
* data: {
|
|
35
|
+
* myCustomField: { $gt: 20 },
|
|
36
|
+
* }
|
|
37
|
+
* }
|
|
38
|
+
* ```
|
|
39
|
+
*
|
|
40
|
+
* See more info on MongoDB's query operators and format.
|
|
41
|
+
*
|
|
42
|
+
* @see {@link https://docs.mongodb.com/manual/reference/operator/query/}
|
|
43
|
+
*/
|
|
44
|
+
query?: Record<string, any>;
|
|
45
|
+
/**
|
|
46
|
+
* Any other API options.
|
|
47
|
+
* Accepts both a key/value object or a `URLSearchParams` instance
|
|
48
|
+
* */
|
|
49
|
+
options?: Record<string, any> | URLSearchParams;
|
|
50
|
+
/**
|
|
51
|
+
* If set to `false`, it will not use cookies to target content. Therefore, A/B Testing will be disabled and
|
|
52
|
+
* only the default variation will be returned to every user.
|
|
53
|
+
*
|
|
54
|
+
* Defaults to `true`.
|
|
55
|
+
*/
|
|
56
|
+
canTrack?: boolean;
|
|
57
|
+
/**
|
|
58
|
+
* Include multilevel references in the response.
|
|
59
|
+
*/
|
|
60
|
+
enrich?: boolean;
|
|
61
|
+
/**
|
|
62
|
+
* If provided, the API will auto-resolve localized objects to the value of this `locale` key.
|
|
63
|
+
*/
|
|
64
|
+
locale?: string;
|
|
65
|
+
/**
|
|
66
|
+
* If provided, sets the Builder API version used to fetch content.
|
|
67
|
+
*
|
|
68
|
+
* Currently, the only available API version is `v3`.
|
|
69
|
+
*/
|
|
70
|
+
apiVersion?: 'v3';
|
|
71
|
+
/**
|
|
72
|
+
* Only include these fields.
|
|
73
|
+
* Note: 'omit' takes precedence over 'fields'
|
|
74
|
+
*
|
|
75
|
+
* @example
|
|
76
|
+
* ```
|
|
77
|
+
* fields: 'id, name, data.customField'
|
|
78
|
+
* ```
|
|
79
|
+
*/
|
|
80
|
+
fields?: string;
|
|
81
|
+
/**
|
|
82
|
+
* Omit only these fields.
|
|
83
|
+
* Note: 'omit' takes precedence over 'fields'
|
|
84
|
+
*
|
|
85
|
+
* @example
|
|
86
|
+
* ```
|
|
87
|
+
* omit: 'data.bigField,data.blocks'
|
|
88
|
+
* ```
|
|
89
|
+
*/
|
|
90
|
+
omit?: string;
|
|
91
|
+
/**
|
|
92
|
+
* Seconds to cache content. Sets the max-age of the cache-control header
|
|
93
|
+
* response header.
|
|
94
|
+
*
|
|
95
|
+
* Use a higher value for better performance, lower for content that will change more frequently
|
|
96
|
+
*
|
|
97
|
+
* @see {@link https://www.builder.io/c/docs/query-api#__next:~:text=%26includeRefs%3Dtrue-,cacheSeconds,-No}
|
|
98
|
+
*/
|
|
99
|
+
cacheSeconds?: number;
|
|
100
|
+
/**
|
|
101
|
+
* Builder.io uses stale-while-revalidate caching at the CDN level. This means we always serve
|
|
102
|
+
* from edge cache and update caches in the background for maximum possible performance. This also
|
|
103
|
+
* means that the more frequently content is requested, the more fresh it will be. The longest we
|
|
104
|
+
* will ever hold something in stale cache is 1 day by default, and you can set this to be shorter
|
|
105
|
+
* yourself as well. We suggest keeping this high unless you have content that must change rapidly
|
|
106
|
+
* and gets very little traffic.
|
|
107
|
+
*
|
|
108
|
+
* @see {@link https://www.fastly.com/blog/prevent-application-network-instability-serve-stale-content}
|
|
109
|
+
*/
|
|
110
|
+
staleCacheSeconds?: number;
|
|
111
|
+
/**
|
|
112
|
+
* Property to order results by.
|
|
113
|
+
* Use 1 for ascending and -1 for descending.
|
|
114
|
+
*
|
|
115
|
+
* The key is what you're sorting on, so the following example sorts by createdDate
|
|
116
|
+
* and because the value is 1, the sort is ascending.
|
|
117
|
+
*
|
|
118
|
+
* @example
|
|
119
|
+
* ```
|
|
120
|
+
* createdDate: 1
|
|
121
|
+
* ```
|
|
122
|
+
*/
|
|
123
|
+
sort?: {
|
|
124
|
+
[key: string]: 1 | -1;
|
|
125
|
+
};
|
|
126
|
+
/**
|
|
127
|
+
* Include content entries in a response that are still in
|
|
128
|
+
* draft mode and un-archived. Default is false.
|
|
129
|
+
*/
|
|
130
|
+
includeUnpublished?: boolean;
|
|
131
|
+
/**
|
|
132
|
+
* Optional override of the `fetch` function. (Defaults to global `fetch`)
|
|
133
|
+
*/
|
|
134
|
+
fetch?: (input: string, init?: object) => Promise<any>;
|
|
135
|
+
/**
|
|
136
|
+
* Optional fetch options to be passed as the second argument to the `fetch` function.
|
|
137
|
+
*/
|
|
138
|
+
fetchOptions?: object;
|
|
139
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const fetch: typeof globalThis.fetch;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { BuilderContextInterface } from '../context/types.js';
|
|
2
|
+
import type { BuilderBlock } from '../types/builder-block.js';
|
|
3
|
+
export declare function getProcessedBlock({ block, context, shouldEvaluateBindings, localState, rootState, rootSetState }: {
|
|
4
|
+
block: BuilderBlock;
|
|
5
|
+
/**
|
|
6
|
+
* In some cases, we want to avoid evaluating bindings and only want framework-specific block transformation. It is
|
|
7
|
+
* also sometimes too early to consider bindings, e.g. when we might be looking at a repeated block.
|
|
8
|
+
*/
|
|
9
|
+
shouldEvaluateBindings: boolean;
|
|
10
|
+
} & Pick<BuilderContextInterface, 'localState' | 'context' | 'rootState' | 'rootSetState'>): BuilderBlock;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { BuilderContextInterface } from '../context/types.js';
|
|
2
|
+
import type { BuilderBlock } from '../types/builder-block.js';
|
|
3
|
+
export declare const getStyle: ({ block, context }: {
|
|
4
|
+
block: BuilderBlock;
|
|
5
|
+
context: BuilderContextInterface;
|
|
6
|
+
}) => string | Partial<CSSStyleDeclaration>;
|
|
7
|
+
/**
|
|
8
|
+
* Svelte does not support style attribute as an object so we need to flatten it.
|
|
9
|
+
*
|
|
10
|
+
* Additionally, Svelte, Vue and other frameworks use kebab-case styles, so we need to convert them.
|
|
11
|
+
*/
|
|
12
|
+
export declare function mapStyleObjToStrIfNeeded(style: Partial<CSSStyleDeclaration>): string | Partial<CSSStyleDeclaration>;
|