@builder.io/sdk-react-nextjs 0.7.1-4 → 0.7.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/USE_CLIENT_BUNDLE-059d1502.cjs +23 -0
- package/lib/{node/USE_CLIENT_BUNDLE-32bb8c8f.js → browser/USE_CLIENT_BUNDLE-b256b942.js} +142 -142
- package/lib/{edge/USE_SERVER_BUNDLE-2a1fc947.js → browser/USE_SERVER_BUNDLE-1aa7d195.js} +1 -1
- package/lib/{edge/USE_SERVER_BUNDLE-133fe486.cjs → browser/USE_SERVER_BUNDLE-d96aeaff.cjs} +1 -1
- package/lib/browser/{bundle-31003427.js → bundle-0a946b39.js} +953 -928
- package/lib/browser/bundle-3a5994f4.cjs +76 -0
- package/lib/browser/index.cjs +1 -1
- package/lib/browser/index.d.cts +1 -1066
- package/lib/browser/index.d.mts +1 -1066
- package/lib/browser/index.mjs +3 -3
- package/lib/edge/USE_CLIENT_BUNDLE-210385b8.cjs +23 -0
- package/lib/{browser/USE_CLIENT_BUNDLE-2dd6963b.js → edge/USE_CLIENT_BUNDLE-736c38f3.js} +142 -142
- package/lib/{node/USE_SERVER_BUNDLE-86e8b7c7.js → edge/USE_SERVER_BUNDLE-14516672.js} +1 -1
- package/lib/{node/USE_SERVER_BUNDLE-25f4a46f.cjs → edge/USE_SERVER_BUNDLE-8c86a267.cjs} +1 -1
- package/lib/edge/{bundle-1c5ceddb.js → bundle-46eb4735.js} +1237 -1211
- package/lib/edge/{bundle-cfdeec4b.cjs → bundle-57428492.cjs} +30 -30
- package/lib/edge/index.cjs +1 -1
- package/lib/edge/index.d.cts +1 -1066
- package/lib/edge/index.d.mts +1 -1066
- package/lib/edge/index.mjs +3 -3
- package/lib/{edge/USE_CLIENT_BUNDLE-ee929cd6.js → node/USE_CLIENT_BUNDLE-2ae32ced.js} +142 -142
- package/lib/node/USE_CLIENT_BUNDLE-85a396bb.cjs +23 -0
- package/lib/{browser/USE_SERVER_BUNDLE-97369f61.js → node/USE_SERVER_BUNDLE-cd1f2a07.js} +1 -1
- package/lib/{browser/USE_SERVER_BUNDLE-c110917b.cjs → node/USE_SERVER_BUNDLE-e2ad5ce3.cjs} +1 -1
- package/lib/node/bundle-3d88f873.cjs +116 -0
- package/lib/node/{bundle-844e3979.js → bundle-d37c53b5.js} +794 -769
- package/lib/node/index.cjs +1 -1
- package/lib/node/index.d.cts +1 -1066
- package/lib/node/index.d.mts +1 -1066
- package/lib/node/index.mjs +3 -3
- package/package.json +9 -5
- package/types/cjs/blocks/button/button.d.ts +12 -0
- package/types/cjs/blocks/button/component-info.d.ts +2 -0
- package/types/cjs/blocks/columns/columns.d.ts +17 -0
- package/types/cjs/blocks/columns/component-info.d.ts +2 -0
- package/types/cjs/blocks/custom-code/component-info.d.ts +2 -0
- package/types/cjs/blocks/custom-code/custom-code.d.ts +7 -0
- package/types/cjs/blocks/embed/component-info.d.ts +2 -0
- package/types/cjs/blocks/embed/embed.d.ts +6 -0
- package/types/cjs/blocks/embed/helpers.d.ts +1 -0
- package/types/cjs/blocks/fragment/component-info.d.ts +2 -0
- package/types/cjs/blocks/fragment/fragment.d.ts +8 -0
- package/types/cjs/blocks/helpers.d.ts +13 -0
- package/types/cjs/blocks/image/component-info.d.ts +2 -0
- package/types/cjs/blocks/image/image.d.ts +22 -0
- package/types/cjs/blocks/image/image.helpers.d.ts +1 -0
- package/types/cjs/blocks/img/component-info.d.ts +2 -0
- package/types/cjs/blocks/img/img.d.ts +14 -0
- package/types/cjs/blocks/section/component-info.d.ts +2 -0
- package/types/cjs/blocks/section/section.d.ts +12 -0
- package/types/cjs/blocks/symbol/component-info.d.ts +2 -0
- package/types/cjs/blocks/symbol/symbol.d.ts +26 -0
- package/types/cjs/blocks/symbol/symbol.helpers.d.ts +14 -0
- package/types/cjs/blocks/text/component-info.d.ts +2 -0
- package/types/cjs/blocks/text/text.d.ts +6 -0
- package/types/cjs/blocks/video/component-info.d.ts +2 -0
- package/types/cjs/blocks/video/video.d.ts +20 -0
- package/types/cjs/components/block/block.d.ts +10 -0
- package/types/cjs/components/block/block.helpers.d.ts +13 -0
- package/types/cjs/components/block/components/block-styles.d.ts +9 -0
- package/types/cjs/components/block/components/block-wrapper.d.ts +18 -0
- package/types/cjs/components/block/components/component-ref/component-ref.d.ts +4 -0
- package/types/cjs/components/block/components/component-ref/component-ref.helpers.d.ts +28 -0
- package/types/cjs/components/block/components/interactive-element.d.ts +12 -0
- package/types/cjs/components/block/components/repeated-block.d.ts +10 -0
- package/types/cjs/components/block/types.d.ts +6 -0
- package/types/cjs/components/blocks/blocks-wrapper.d.ts +11 -0
- package/types/cjs/components/blocks/blocks.d.ts +9 -0
- package/types/cjs/components/content/components/enable-editor.d.ts +10 -0
- package/types/cjs/components/content/components/styles.d.ts +9 -0
- package/types/cjs/components/content/components/styles.helpers.d.ts +15 -0
- package/types/cjs/components/content/content.d.ts +4 -0
- package/types/cjs/components/content/content.helpers.d.ts +7 -0
- package/types/cjs/components/content/content.types.d.ts +24 -0
- package/types/cjs/components/content/wrap-component-ref.d.ts +6 -0
- package/types/cjs/components/content-variants/content-variants.d.ts +10 -0
- package/types/cjs/components/content-variants/content-variants.types.d.ts +20 -0
- package/types/cjs/components/content-variants/helpers.d.ts +41 -0
- package/types/cjs/components/inlined-script.d.ts +7 -0
- package/types/cjs/components/inlined-styles.d.ts +7 -0
- package/types/cjs/constants/builder-registered-components.d.ts +6 -0
- package/types/cjs/constants/device-sizes.d.ts +13 -0
- package/types/cjs/constants/sdk-version.d.ts +1 -0
- package/types/cjs/constants/target.d.ts +2 -0
- package/types/cjs/context/builder.context.d.ts +3 -0
- package/types/cjs/context/components.context.d.ts +3 -0
- package/types/cjs/context/types.d.ts +35 -0
- package/types/cjs/functions/camel-to-kebab-case.d.ts +1 -0
- package/types/cjs/functions/deopt.d.ts +4 -0
- package/types/cjs/functions/evaluate/browser-runtime/browser.d.ts +4 -0
- package/types/cjs/functions/evaluate/browser-runtime/index.d.ts +1 -0
- package/types/cjs/functions/evaluate/choose-eval.d.ts +6 -0
- package/types/cjs/functions/evaluate/evaluate.d.ts +2 -0
- package/types/cjs/functions/evaluate/helpers.d.ts +24 -0
- package/types/cjs/functions/evaluate/index.d.ts +1 -0
- package/types/cjs/functions/event-handler-name.d.ts +1 -0
- package/types/cjs/functions/extract-text-styles.d.ts +4 -0
- package/types/cjs/functions/fast-clone.d.ts +4 -0
- package/types/cjs/functions/fetch-builder-props.d.ts +53 -0
- package/types/cjs/functions/get-block-actions-handler.d.ts +8 -0
- package/types/cjs/functions/get-block-actions.d.ts +10 -0
- package/types/cjs/functions/get-block-component-options.d.ts +2 -0
- package/types/cjs/functions/get-block-properties.d.ts +6 -0
- package/types/cjs/functions/get-builder-search-params/index.d.ts +12 -0
- package/types/cjs/functions/get-content/generate-content-url.d.ts +2 -0
- package/types/cjs/functions/get-content/index.d.ts +28 -0
- package/types/cjs/functions/get-content/types.d.ts +142 -0
- package/types/cjs/functions/get-fetch.d.ts +1 -0
- package/types/cjs/functions/get-global-this.d.ts +4 -0
- package/types/cjs/functions/get-processed-block.d.ts +10 -0
- package/types/cjs/functions/get-react-native-block-styles.d.ts +7 -0
- package/types/cjs/functions/is-browser.d.ts +1 -0
- package/types/cjs/functions/is-editing.d.ts +1 -0
- package/types/cjs/functions/is-iframe.d.ts +1 -0
- package/types/cjs/functions/is-previewing.d.ts +1 -0
- package/types/cjs/functions/register-component.d.ts +15 -0
- package/types/cjs/functions/register.d.ts +16 -0
- package/types/cjs/functions/sanitize-react-native-block-styles.d.ts +3 -0
- package/types/cjs/functions/set-editor-settings.d.ts +4 -0
- package/types/cjs/functions/set.d.ts +7 -0
- package/types/cjs/functions/track/helpers.d.ts +5 -0
- package/types/cjs/functions/track/index.d.ts +51 -0
- package/types/cjs/functions/track/interaction.d.ts +13 -0
- package/types/cjs/functions/transform-block-properties.d.ts +1 -0
- package/types/cjs/functions/transform-block.d.ts +2 -0
- package/types/cjs/helpers/ab-tests.d.ts +9 -0
- package/types/cjs/helpers/canTrack.d.ts +1 -0
- package/types/cjs/helpers/cookie.d.ts +19 -0
- package/types/cjs/helpers/css.d.ts +7 -0
- package/types/cjs/helpers/flatten.d.ts +6 -0
- package/types/cjs/helpers/localStorage.d.ts +9 -0
- package/types/cjs/helpers/logger.d.ts +6 -0
- package/types/cjs/helpers/nullable.d.ts +2 -0
- package/types/cjs/helpers/preview-lru-cache/get.d.ts +1 -0
- package/types/cjs/helpers/preview-lru-cache/helpers.d.ts +1 -0
- package/types/cjs/helpers/preview-lru-cache/init.d.ts +6 -0
- package/types/cjs/helpers/preview-lru-cache/set.d.ts +7 -0
- package/types/cjs/helpers/preview-lru-cache/types.d.ts +12 -0
- package/types/cjs/helpers/sessionId.d.ts +6 -0
- package/types/cjs/helpers/url.d.ts +6 -0
- package/types/cjs/helpers/uuid.d.ts +8 -0
- package/types/cjs/helpers/visitorId.d.ts +6 -0
- package/types/cjs/index-helpers/blocks-exports.d.ts +19 -0
- package/types/cjs/index-helpers/top-of-file.d.ts +1 -0
- package/types/cjs/index.d.ts +7 -0
- package/types/cjs/scripts/init-editing.d.ts +6 -0
- package/types/cjs/server-index.d.ts +15 -0
- package/types/cjs/types/api-version.d.ts +2 -0
- package/types/cjs/types/builder-block.d.ts +66 -0
- package/types/cjs/types/builder-content.d.ts +44 -0
- package/types/cjs/types/builder-props.d.ts +9 -0
- package/types/cjs/types/can-track.d.ts +3 -0
- package/types/cjs/types/components.d.ts +110 -0
- package/types/cjs/types/deep-partial.d.ts +3 -0
- package/types/cjs/types/element.d.ts +59 -0
- package/types/cjs/types/enforced-partials.d.ts +21 -0
- package/types/cjs/types/input.d.ts +121 -0
- package/types/cjs/types/targets.d.ts +1 -0
- package/types/cjs/types/typescript.d.ts +11 -0
- package/types/esm/blocks/button/button.d.ts +12 -0
- package/types/esm/blocks/button/component-info.d.ts +2 -0
- package/types/esm/blocks/columns/columns.d.ts +17 -0
- package/types/esm/blocks/columns/component-info.d.ts +2 -0
- package/types/esm/blocks/custom-code/component-info.d.ts +2 -0
- package/types/esm/blocks/custom-code/custom-code.d.ts +7 -0
- package/types/esm/blocks/embed/component-info.d.ts +2 -0
- package/types/esm/blocks/embed/embed.d.ts +6 -0
- package/types/esm/blocks/embed/helpers.d.ts +1 -0
- package/types/esm/blocks/fragment/component-info.d.ts +2 -0
- package/types/esm/blocks/fragment/fragment.d.ts +8 -0
- package/types/esm/blocks/helpers.d.ts +13 -0
- package/types/esm/blocks/image/component-info.d.ts +2 -0
- package/types/esm/blocks/image/image.d.ts +22 -0
- package/types/esm/blocks/image/image.helpers.d.ts +1 -0
- package/types/esm/blocks/img/component-info.d.ts +2 -0
- package/types/esm/blocks/img/img.d.ts +14 -0
- package/types/esm/blocks/section/component-info.d.ts +2 -0
- package/types/esm/blocks/section/section.d.ts +12 -0
- package/types/esm/blocks/symbol/component-info.d.ts +2 -0
- package/types/esm/blocks/symbol/symbol.d.ts +26 -0
- package/types/esm/blocks/symbol/symbol.helpers.d.ts +14 -0
- package/types/esm/blocks/text/component-info.d.ts +2 -0
- package/types/esm/blocks/text/text.d.ts +6 -0
- package/types/esm/blocks/video/component-info.d.ts +2 -0
- package/types/esm/blocks/video/video.d.ts +20 -0
- package/types/esm/components/block/block.d.ts +10 -0
- package/types/esm/components/block/block.helpers.d.ts +13 -0
- package/types/esm/components/block/components/block-styles.d.ts +9 -0
- package/types/esm/components/block/components/block-wrapper.d.ts +18 -0
- package/types/esm/components/block/components/component-ref/component-ref.d.ts +4 -0
- package/types/esm/components/block/components/component-ref/component-ref.helpers.d.ts +28 -0
- package/types/esm/components/block/components/interactive-element.d.ts +12 -0
- package/types/esm/components/block/components/repeated-block.d.ts +10 -0
- package/types/esm/components/block/types.d.ts +6 -0
- package/types/esm/components/blocks/blocks-wrapper.d.ts +11 -0
- package/types/esm/components/blocks/blocks.d.ts +9 -0
- package/types/esm/components/content/components/enable-editor.d.ts +10 -0
- package/types/esm/components/content/components/styles.d.ts +9 -0
- package/types/esm/components/content/components/styles.helpers.d.ts +15 -0
- package/types/esm/components/content/content.d.ts +4 -0
- package/types/esm/components/content/content.helpers.d.ts +7 -0
- package/types/esm/components/content/content.types.d.ts +24 -0
- package/types/esm/components/content/wrap-component-ref.d.ts +6 -0
- package/types/esm/components/content-variants/content-variants.d.ts +10 -0
- package/types/esm/components/content-variants/content-variants.types.d.ts +20 -0
- package/types/esm/components/content-variants/helpers.d.ts +41 -0
- package/types/esm/components/inlined-script.d.ts +7 -0
- package/types/esm/components/inlined-styles.d.ts +7 -0
- package/types/esm/constants/builder-registered-components.d.ts +6 -0
- package/types/esm/constants/device-sizes.d.ts +13 -0
- package/types/esm/constants/sdk-version.d.ts +1 -0
- package/types/esm/constants/target.d.ts +2 -0
- package/types/esm/context/builder.context.d.ts +3 -0
- package/types/esm/context/components.context.d.ts +3 -0
- package/types/esm/context/types.d.ts +35 -0
- package/types/esm/functions/camel-to-kebab-case.d.ts +1 -0
- package/types/esm/functions/deopt.d.ts +4 -0
- package/types/esm/functions/evaluate/browser-runtime/browser.d.ts +4 -0
- package/types/esm/functions/evaluate/browser-runtime/index.d.ts +1 -0
- package/types/esm/functions/evaluate/choose-eval.d.ts +6 -0
- package/types/esm/functions/evaluate/evaluate.d.ts +2 -0
- package/types/esm/functions/evaluate/helpers.d.ts +24 -0
- package/types/esm/functions/evaluate/index.d.ts +1 -0
- package/types/esm/functions/event-handler-name.d.ts +1 -0
- package/types/esm/functions/extract-text-styles.d.ts +4 -0
- package/types/esm/functions/fast-clone.d.ts +4 -0
- package/types/esm/functions/fetch-builder-props.d.ts +53 -0
- package/types/esm/functions/get-block-actions-handler.d.ts +8 -0
- package/types/esm/functions/get-block-actions.d.ts +10 -0
- package/types/esm/functions/get-block-component-options.d.ts +2 -0
- package/types/esm/functions/get-block-properties.d.ts +6 -0
- package/types/esm/functions/get-builder-search-params/index.d.ts +12 -0
- package/types/esm/functions/get-content/generate-content-url.d.ts +2 -0
- package/types/esm/functions/get-content/index.d.ts +28 -0
- package/types/esm/functions/get-content/types.d.ts +142 -0
- package/types/esm/functions/get-fetch.d.ts +1 -0
- package/types/esm/functions/get-global-this.d.ts +4 -0
- package/types/esm/functions/get-processed-block.d.ts +10 -0
- package/types/esm/functions/get-react-native-block-styles.d.ts +7 -0
- package/types/esm/functions/is-browser.d.ts +1 -0
- package/types/esm/functions/is-editing.d.ts +1 -0
- package/types/esm/functions/is-iframe.d.ts +1 -0
- package/types/esm/functions/is-previewing.d.ts +1 -0
- package/types/esm/functions/register-component.d.ts +15 -0
- package/types/esm/functions/register.d.ts +16 -0
- package/types/esm/functions/sanitize-react-native-block-styles.d.ts +3 -0
- package/types/esm/functions/set-editor-settings.d.ts +4 -0
- package/types/esm/functions/set.d.ts +7 -0
- package/types/esm/functions/track/helpers.d.ts +5 -0
- package/types/esm/functions/track/index.d.ts +51 -0
- package/types/esm/functions/track/interaction.d.ts +13 -0
- package/types/esm/functions/transform-block-properties.d.ts +1 -0
- package/types/esm/functions/transform-block.d.ts +2 -0
- package/types/esm/helpers/ab-tests.d.ts +9 -0
- package/types/esm/helpers/canTrack.d.ts +1 -0
- package/types/esm/helpers/cookie.d.ts +19 -0
- package/types/esm/helpers/css.d.ts +7 -0
- package/types/esm/helpers/flatten.d.ts +6 -0
- package/types/esm/helpers/localStorage.d.ts +9 -0
- package/types/esm/helpers/logger.d.ts +6 -0
- package/types/esm/helpers/nullable.d.ts +2 -0
- package/types/esm/helpers/preview-lru-cache/get.d.ts +1 -0
- package/types/esm/helpers/preview-lru-cache/helpers.d.ts +1 -0
- package/types/esm/helpers/preview-lru-cache/init.d.ts +6 -0
- package/types/esm/helpers/preview-lru-cache/set.d.ts +7 -0
- package/types/esm/helpers/preview-lru-cache/types.d.ts +12 -0
- package/types/esm/helpers/sessionId.d.ts +6 -0
- package/types/esm/helpers/url.d.ts +6 -0
- package/types/esm/helpers/uuid.d.ts +8 -0
- package/types/esm/helpers/visitorId.d.ts +6 -0
- package/types/esm/index-helpers/blocks-exports.d.ts +19 -0
- package/types/esm/index-helpers/top-of-file.d.ts +1 -0
- package/types/esm/index.d.ts +7 -0
- package/types/esm/scripts/init-editing.d.ts +6 -0
- package/types/esm/server-index.d.ts +15 -0
- package/types/esm/types/api-version.d.ts +2 -0
- package/types/esm/types/builder-block.d.ts +66 -0
- package/types/esm/types/builder-content.d.ts +44 -0
- package/types/esm/types/builder-props.d.ts +9 -0
- package/types/esm/types/can-track.d.ts +3 -0
- package/types/esm/types/components.d.ts +110 -0
- package/types/esm/types/deep-partial.d.ts +3 -0
- package/types/esm/types/element.d.ts +59 -0
- package/types/esm/types/enforced-partials.d.ts +21 -0
- package/types/esm/types/input.d.ts +121 -0
- package/types/esm/types/targets.d.ts +1 -0
- package/types/esm/types/typescript.d.ts +11 -0
- package/lib/browser/USE_CLIENT_BUNDLE-1cdce03b.cjs +0 -23
- package/lib/browser/bundle-cbc690cf.cjs +0 -76
- package/lib/edge/USE_CLIENT_BUNDLE-ba263633.cjs +0 -23
- package/lib/node/USE_CLIENT_BUNDLE-7a982d7c.cjs +0 -23
- package/lib/node/bundle-b13f5899.cjs +0 -116
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getIdFromSearchParams: (searchParams: URLSearchParams) => string;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This is an LRU cache to hold preview content on the server-side.
|
|
3
|
+
*
|
|
4
|
+
* Note: This logic is only used by the NextJS SDK.
|
|
5
|
+
*/
|
|
6
|
+
import type { LRUCache } from 'lru-cache';
|
|
7
|
+
import type { BuilderContent } from '../../types/builder-content.js';
|
|
8
|
+
type BuilderLRUCache = LRUCache<string, BuilderContent>;
|
|
9
|
+
export type GlobalWCache = typeof globalThis & {
|
|
10
|
+
_BUILDER_PREVIEW_LRU_CACHE: BuilderLRUCache;
|
|
11
|
+
};
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { CanTrack } from '../types/can-track.js';
|
|
2
|
+
export declare const getSessionId: ({ canTrack }: CanTrack) => Promise<string | undefined>;
|
|
3
|
+
export declare const createSessionId: () => string;
|
|
4
|
+
export declare const setSessionId: ({ id, canTrack }: {
|
|
5
|
+
id: string;
|
|
6
|
+
} & CanTrack) => Promise<void>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { CanTrack } from '../types/can-track.js';
|
|
2
|
+
export declare const getVisitorId: ({ canTrack }: CanTrack) => string | undefined;
|
|
3
|
+
export declare const createVisitorId: () => string;
|
|
4
|
+
export declare const setVisitorId: ({ id, canTrack }: {
|
|
5
|
+
id: string;
|
|
6
|
+
} & CanTrack) => void;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export { default as Button } from '../blocks/button/button.js';
|
|
2
|
+
export { default as Columns } from '../blocks/columns/columns.js';
|
|
3
|
+
export { default as Fragment } from '../blocks/fragment/fragment.js';
|
|
4
|
+
export { default as Image } from '../blocks/image/image.js';
|
|
5
|
+
export { default as Section } from '../blocks/section/section.js';
|
|
6
|
+
export { default as Symbol } from '../blocks/symbol/symbol.js';
|
|
7
|
+
export { default as Text } from '../blocks/text/text.js';
|
|
8
|
+
export { default as Video } from '../blocks/video/video.js';
|
|
9
|
+
import { default as Blocks } from '../components/blocks/blocks.js';
|
|
10
|
+
import { default as Content } from '../components/content-variants/content-variants.js';
|
|
11
|
+
export { Blocks, Content };
|
|
12
|
+
/**
|
|
13
|
+
* @deprecated Renamed to `Blocks`.
|
|
14
|
+
*/
|
|
15
|
+
export declare const RenderBlocks: typeof Blocks;
|
|
16
|
+
/**
|
|
17
|
+
* @deprecated Renamed to `Content`.
|
|
18
|
+
*/
|
|
19
|
+
export declare const RenderContent: typeof Content;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default undefined;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * from './index-helpers/top-of-file.js';
|
|
2
|
+
export * from './index-helpers/blocks-exports.js';
|
|
3
|
+
/**
|
|
4
|
+
* We have a separate entry point to the SDKs that guarantees no components are being imported. This is useful
|
|
5
|
+
* for React SDK, which would break in the NextJS App directory because the component imports have `use client` in them.
|
|
6
|
+
*/
|
|
7
|
+
export * from './server-index.js';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export * from './index-helpers/top-of-file.js';
|
|
2
|
+
export { isEditing } from './functions/is-editing.js';
|
|
3
|
+
export { isPreviewing } from './functions/is-previewing.js';
|
|
4
|
+
export { createRegisterComponentMessage } from './functions/register-component.js';
|
|
5
|
+
export { register } from './functions/register.js';
|
|
6
|
+
export type { InsertMenuConfig, InsertMenuItem } from './functions/register.js';
|
|
7
|
+
export { setEditorSettings } from './functions/set-editor-settings.js';
|
|
8
|
+
export type { Settings } from './functions/set-editor-settings.js';
|
|
9
|
+
export { _processContentResult, fetchEntries, fetchOneEntry, getAllContent, getContent } from './functions/get-content/index.js';
|
|
10
|
+
export { getBuilderSearchParams } from './functions/get-builder-search-params/index.js';
|
|
11
|
+
export { track } from './functions/track/index.js';
|
|
12
|
+
export type { ContentProps } from './components/content/content.types.js';
|
|
13
|
+
export type { RegisteredComponent } from './context/types.js';
|
|
14
|
+
export type { ComponentInfo } from './types/components.js';
|
|
15
|
+
export { fetchBuilderProps } from './functions/fetch-builder-props.js';
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
type JSONValue = string | number | boolean | JSONObject | JSONArray;
|
|
2
|
+
interface JSONObject {
|
|
3
|
+
[x: string]: JSONValue;
|
|
4
|
+
}
|
|
5
|
+
interface JSONArray extends Array<JSONValue> {
|
|
6
|
+
}
|
|
7
|
+
/** @todo typedoc this */
|
|
8
|
+
export interface BuilderBlock {
|
|
9
|
+
'@type': '@builder.io/sdk:Element';
|
|
10
|
+
'@version'?: number;
|
|
11
|
+
id?: string;
|
|
12
|
+
tagName?: string;
|
|
13
|
+
layerName?: string;
|
|
14
|
+
groupLocked?: boolean;
|
|
15
|
+
layerLocked?: boolean;
|
|
16
|
+
/** @todo make alias for properties.class */
|
|
17
|
+
class?: string;
|
|
18
|
+
children?: BuilderBlock[];
|
|
19
|
+
responsiveStyles?: {
|
|
20
|
+
large?: Partial<CSSStyleDeclaration>;
|
|
21
|
+
medium?: Partial<CSSStyleDeclaration>;
|
|
22
|
+
small?: Partial<CSSStyleDeclaration>;
|
|
23
|
+
/** @deprecated */
|
|
24
|
+
xsmall?: Partial<CSSStyleDeclaration>;
|
|
25
|
+
};
|
|
26
|
+
component?: {
|
|
27
|
+
name: string;
|
|
28
|
+
options?: any;
|
|
29
|
+
tag?: string;
|
|
30
|
+
};
|
|
31
|
+
bindings?: {
|
|
32
|
+
[key: string]: string;
|
|
33
|
+
};
|
|
34
|
+
meta?: {
|
|
35
|
+
[key: string]: JSONValue;
|
|
36
|
+
};
|
|
37
|
+
actions?: {
|
|
38
|
+
[key: string]: string;
|
|
39
|
+
};
|
|
40
|
+
properties?: {
|
|
41
|
+
[key: string]: string;
|
|
42
|
+
};
|
|
43
|
+
code?: {
|
|
44
|
+
bindings?: {
|
|
45
|
+
[key: string]: string;
|
|
46
|
+
};
|
|
47
|
+
actions?: {
|
|
48
|
+
[key: string]: string;
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
repeat?: {
|
|
52
|
+
collection: string;
|
|
53
|
+
itemName?: string;
|
|
54
|
+
} | null;
|
|
55
|
+
animations?: any[];
|
|
56
|
+
style?: Partial<CSSStyleDeclaration>;
|
|
57
|
+
/**
|
|
58
|
+
* generated by the "Hide If" binding
|
|
59
|
+
*/
|
|
60
|
+
hide?: boolean;
|
|
61
|
+
/**
|
|
62
|
+
* generated by the "Show If" binding
|
|
63
|
+
*/
|
|
64
|
+
show?: boolean;
|
|
65
|
+
}
|
|
66
|
+
export {};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { BuilderBlock } from './builder-block.js';
|
|
2
|
+
import type { Input } from './input.js';
|
|
3
|
+
import type { Nullable } from './typescript.js';
|
|
4
|
+
export interface Breakpoints {
|
|
5
|
+
small: number;
|
|
6
|
+
medium: number;
|
|
7
|
+
}
|
|
8
|
+
export interface BuilderContentVariation {
|
|
9
|
+
data?: {
|
|
10
|
+
title?: string;
|
|
11
|
+
blocks?: BuilderBlock[];
|
|
12
|
+
inputs?: Input[];
|
|
13
|
+
state?: {
|
|
14
|
+
[key: string]: any;
|
|
15
|
+
};
|
|
16
|
+
jsCode?: string;
|
|
17
|
+
tsCode?: string;
|
|
18
|
+
httpRequests?: {
|
|
19
|
+
[key: string]: string;
|
|
20
|
+
};
|
|
21
|
+
[key: string]: any;
|
|
22
|
+
};
|
|
23
|
+
name?: string;
|
|
24
|
+
testRatio?: number;
|
|
25
|
+
id?: string;
|
|
26
|
+
meta?: {
|
|
27
|
+
breakpoints?: Nullable<Breakpoints>;
|
|
28
|
+
[key: string]: any;
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
export interface BuilderContent extends BuilderContentVariation {
|
|
32
|
+
'@version'?: number;
|
|
33
|
+
published?: 'published' | 'draft' | 'archived';
|
|
34
|
+
modelId?: string;
|
|
35
|
+
priority?: number;
|
|
36
|
+
lastUpdated?: number;
|
|
37
|
+
startDate?: number;
|
|
38
|
+
endDate?: number;
|
|
39
|
+
variations?: {
|
|
40
|
+
[id: string]: BuilderContentVariation;
|
|
41
|
+
};
|
|
42
|
+
testVariationId?: string;
|
|
43
|
+
testVariationName?: string;
|
|
44
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { BuilderContextInterface, RegisteredComponents } from '../context/types.js';
|
|
2
|
+
import type { BuilderBlock } from './builder-block.js';
|
|
3
|
+
export type PropsWithBuilderData<T> = T & {
|
|
4
|
+
builderBlock: BuilderBlock;
|
|
5
|
+
builderContext: BuilderContextInterface;
|
|
6
|
+
};
|
|
7
|
+
export type BuilderComponentsProp = {
|
|
8
|
+
builderComponents: RegisteredComponents;
|
|
9
|
+
};
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import type { BuilderElement } from './element.js';
|
|
2
|
+
import type { Input } from './input.js';
|
|
3
|
+
export interface ComponentInfo {
|
|
4
|
+
/**
|
|
5
|
+
* Name your component something unique, e.g. 'MyButton'. You can override built-in components
|
|
6
|
+
* by registering a component with the same name, e.g. 'Text', to replace the built-in text component
|
|
7
|
+
*/
|
|
8
|
+
name: string;
|
|
9
|
+
description?: string;
|
|
10
|
+
/**
|
|
11
|
+
* Link to a documentation page for this component
|
|
12
|
+
*/
|
|
13
|
+
docsLink?: string;
|
|
14
|
+
image?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Input schema for your component for users to fill in the options
|
|
17
|
+
*/
|
|
18
|
+
inputs?: Input[];
|
|
19
|
+
class?: any;
|
|
20
|
+
type?: 'angular' | 'webcomponent' | 'react' | 'vue';
|
|
21
|
+
defaultStyles?: {
|
|
22
|
+
[key: string]: string;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Turn on if your component can accept children. Be sure to use in combination with
|
|
26
|
+
* withChildren(YourComponent) like here
|
|
27
|
+
* github.com/BuilderIO/builder/blob/master/examples/react-design-system/src/components/HeroWithChildren/HeroWithChildren.builder.js#L5
|
|
28
|
+
*/
|
|
29
|
+
canHaveChildren?: boolean;
|
|
30
|
+
fragment?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Do not wrap a component in a dom element. Be sure to use {...props.attributes} with this option
|
|
33
|
+
* like here github.com/BuilderIO/builder/blob/master/packages/react/src/blocks/forms/Input.tsx#L34
|
|
34
|
+
*/
|
|
35
|
+
noWrap?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* TO-DO: make this optional only for RSC SDK.
|
|
38
|
+
*
|
|
39
|
+
* Set this to `true` if your component is a React Server Component (RSC).
|
|
40
|
+
*/
|
|
41
|
+
isRSC?: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Default children
|
|
44
|
+
*/
|
|
45
|
+
defaultChildren?: BuilderElement[];
|
|
46
|
+
defaults?: Partial<BuilderElement>;
|
|
47
|
+
hooks?: {
|
|
48
|
+
[key: string]: string | Function;
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* Hide your component in editor, useful for gradually deprecating components
|
|
52
|
+
*/
|
|
53
|
+
hideFromInsertMenu?: boolean;
|
|
54
|
+
tag?: string;
|
|
55
|
+
static?: boolean;
|
|
56
|
+
/**
|
|
57
|
+
* Passing a list of model names will restrict using the component to only the models listed here, otherwise it'll be available for all models
|
|
58
|
+
*/
|
|
59
|
+
models?: string[];
|
|
60
|
+
/**
|
|
61
|
+
* Specify restrictions direct children must match
|
|
62
|
+
*/
|
|
63
|
+
childRequirements?: {
|
|
64
|
+
/** Message to show when this doesn't match, e.g. "Children of 'Columns' must be a 'Column'" */
|
|
65
|
+
message: string;
|
|
66
|
+
/** Simple way to say children must be a specific component name */
|
|
67
|
+
component?: string;
|
|
68
|
+
/**
|
|
69
|
+
* More advanced - specify a MongoDB-style query (using sift.js github.com/crcn/sift.js)
|
|
70
|
+
* of what the children objects should match, e.g.
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* query: {
|
|
74
|
+
* // Child of this element must be a 'Button' or 'Text' component
|
|
75
|
+
* 'component.name': { $in: ['Button', 'Text'] }
|
|
76
|
+
* }
|
|
77
|
+
*/
|
|
78
|
+
query?: any;
|
|
79
|
+
};
|
|
80
|
+
/**
|
|
81
|
+
* Specify restrictions any parent must match
|
|
82
|
+
*/
|
|
83
|
+
requiresParent?: {
|
|
84
|
+
/** Message to show when this doesn't match, e.g. "'Add to cart' buttons must be within a 'Product box'" */
|
|
85
|
+
message: string;
|
|
86
|
+
/** Simple way to say a parent must be a specific component name, e.g. 'Product box' */
|
|
87
|
+
component?: string;
|
|
88
|
+
/**
|
|
89
|
+
* More advanced - specify a MongoDB-style query (using sift.js github.com/crcn/sift.js)
|
|
90
|
+
* of what at least one parent in the parents hierarchy should match, e.g.
|
|
91
|
+
*
|
|
92
|
+
* @example
|
|
93
|
+
* query: {
|
|
94
|
+
* // Thils element must be somewhere inside either a 'Product box' or 'Collection' component
|
|
95
|
+
* 'component.name': { $in: ['Product Box', 'Collection'] }
|
|
96
|
+
* }
|
|
97
|
+
*/
|
|
98
|
+
query?: any;
|
|
99
|
+
};
|
|
100
|
+
friendlyName?: string;
|
|
101
|
+
/**
|
|
102
|
+
* Use to restrict access to your component based on a the current user permissions
|
|
103
|
+
* By default components will show to all users
|
|
104
|
+
* for more information on permissions in builder check https://www.builder.io/c/docs/guides/roles-and-permissions
|
|
105
|
+
*/
|
|
106
|
+
requiredPermissions?: Array<Permission>;
|
|
107
|
+
hidden?: boolean;
|
|
108
|
+
}
|
|
109
|
+
type Permission = 'read' | 'publish' | 'editCode' | 'editDesigns' | 'admin' | 'create';
|
|
110
|
+
export {};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
type JSONValue = string | number | boolean | JSONObject | JSONArray;
|
|
2
|
+
interface JSONObject {
|
|
3
|
+
[x: string]: JSONValue;
|
|
4
|
+
}
|
|
5
|
+
interface JSONArray extends Array<JSONValue> {
|
|
6
|
+
}
|
|
7
|
+
/** @todo typedoc this */
|
|
8
|
+
export interface BuilderElement {
|
|
9
|
+
'@type': '@builder.io/sdk:Element';
|
|
10
|
+
'@version'?: number;
|
|
11
|
+
id?: string;
|
|
12
|
+
tagName?: string;
|
|
13
|
+
layerName?: string;
|
|
14
|
+
groupLocked?: boolean;
|
|
15
|
+
layerLocked?: boolean;
|
|
16
|
+
/** @todo make alias for properties.class */
|
|
17
|
+
class?: string;
|
|
18
|
+
children?: BuilderElement[];
|
|
19
|
+
responsiveStyles?: {
|
|
20
|
+
large?: Partial<CSSStyleDeclaration>;
|
|
21
|
+
medium?: Partial<CSSStyleDeclaration>;
|
|
22
|
+
small?: Partial<CSSStyleDeclaration>;
|
|
23
|
+
/** @deprecated */
|
|
24
|
+
xsmall?: Partial<CSSStyleDeclaration>;
|
|
25
|
+
};
|
|
26
|
+
component?: {
|
|
27
|
+
name: string;
|
|
28
|
+
options?: any;
|
|
29
|
+
tag?: string;
|
|
30
|
+
};
|
|
31
|
+
bindings?: {
|
|
32
|
+
[key: string]: string;
|
|
33
|
+
};
|
|
34
|
+
meta?: {
|
|
35
|
+
[key: string]: JSONValue;
|
|
36
|
+
};
|
|
37
|
+
actions?: {
|
|
38
|
+
[key: string]: string;
|
|
39
|
+
};
|
|
40
|
+
properties?: {
|
|
41
|
+
[key: string]: string;
|
|
42
|
+
};
|
|
43
|
+
code?: {
|
|
44
|
+
bindings?: {
|
|
45
|
+
[key: string]: string;
|
|
46
|
+
};
|
|
47
|
+
actions?: {
|
|
48
|
+
[key: string]: string;
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
repeat?: {
|
|
52
|
+
collection: string;
|
|
53
|
+
itemName?: string;
|
|
54
|
+
} | null;
|
|
55
|
+
animations?: Animation[];
|
|
56
|
+
}
|
|
57
|
+
interface Animation {
|
|
58
|
+
}
|
|
59
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { Prettify } from './typescript.js';
|
|
2
|
+
type OptionalFieldsOnly<T> = {
|
|
3
|
+
[K in keyof T as T[K] extends Required<T>[K] ? never : K]: T[K];
|
|
4
|
+
};
|
|
5
|
+
type RequiredFieldsOnly<T> = {
|
|
6
|
+
[K in keyof T as T[K] extends Required<T>[K] ? K : never]: T[K];
|
|
7
|
+
};
|
|
8
|
+
type Enforced<T> = {
|
|
9
|
+
[K in keyof T]-?: T[K];
|
|
10
|
+
};
|
|
11
|
+
type AndUndefined<T> = {
|
|
12
|
+
[K in keyof T]: T[K] | undefined;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Enforce that all optional fields are undefined
|
|
16
|
+
* @example
|
|
17
|
+
* type Foo = { a: string, b?: number }
|
|
18
|
+
* type Bar = EnforcePartials<Foo> // { a: string, b: number | undefined }
|
|
19
|
+
*/
|
|
20
|
+
export type EnforcePartials<From> = Prettify<AndUndefined<Enforced<OptionalFieldsOnly<From>>> & RequiredFieldsOnly<From>>;
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
export interface Input {
|
|
2
|
+
/** This is the name of the component prop this input represents */
|
|
3
|
+
name: string;
|
|
4
|
+
/** A friendlier name to show in the UI if the component prop name is not ideal for end users */
|
|
5
|
+
friendlyName?: string;
|
|
6
|
+
/** @hidden @deprecated */
|
|
7
|
+
description?: string;
|
|
8
|
+
/** A default value to use */
|
|
9
|
+
defaultValue?: any;
|
|
10
|
+
/**
|
|
11
|
+
* The type of input to use, such as 'text'
|
|
12
|
+
*
|
|
13
|
+
* See all available inputs [here](https://www.builder.io/c/docs/custom-react-components#input-types)
|
|
14
|
+
* and you can create your own custom input types and associated editor UIs with [plugins](https://www.builder.io/c/docs/extending/plugins)
|
|
15
|
+
*/
|
|
16
|
+
type: string;
|
|
17
|
+
/** Is this input mandatory or not */
|
|
18
|
+
required?: boolean;
|
|
19
|
+
/** @hidden */
|
|
20
|
+
autoFocus?: boolean;
|
|
21
|
+
subFields?: Input[];
|
|
22
|
+
/**
|
|
23
|
+
* Additional text to render in the UI to give guidance on how to use this
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```js
|
|
27
|
+
* helperText: 'Be sure to use a proper URL, starting with "https://"'
|
|
28
|
+
* 111
|
|
29
|
+
*/
|
|
30
|
+
helperText?: string;
|
|
31
|
+
/** @hidden */
|
|
32
|
+
allowedFileTypes?: string[];
|
|
33
|
+
/** @hidden */
|
|
34
|
+
imageHeight?: number;
|
|
35
|
+
/** @hidden */
|
|
36
|
+
imageWidth?: number;
|
|
37
|
+
/** @hidden */
|
|
38
|
+
mediaHeight?: number;
|
|
39
|
+
/** @hidden */
|
|
40
|
+
mediaWidth?: number;
|
|
41
|
+
/** @hidden */
|
|
42
|
+
hideFromUI?: boolean;
|
|
43
|
+
/** @hidden */
|
|
44
|
+
modelId?: string;
|
|
45
|
+
/**
|
|
46
|
+
* Number field type validation maximum accepted input
|
|
47
|
+
*/
|
|
48
|
+
max?: number;
|
|
49
|
+
/**
|
|
50
|
+
* Number field type validation minimum accepted input
|
|
51
|
+
*/
|
|
52
|
+
min?: number;
|
|
53
|
+
/**
|
|
54
|
+
* Number field type step size when using arrows
|
|
55
|
+
*/
|
|
56
|
+
step?: number;
|
|
57
|
+
/**
|
|
58
|
+
* Set this to `true` to show the editor for this input when
|
|
59
|
+
* children of this component are selected. This is useful for things
|
|
60
|
+
* like Tabs, such that users may not always select the Tabs component
|
|
61
|
+
* directly but will still be looking for how to add additional tabs
|
|
62
|
+
*/
|
|
63
|
+
broadcast?: boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Set this to `true` to show the editor for this input when
|
|
66
|
+
* group locked parents of this component are selected. This is useful
|
|
67
|
+
* to bubble up important inputs for locked groups, like text and images
|
|
68
|
+
*/
|
|
69
|
+
bubble?: boolean;
|
|
70
|
+
/**
|
|
71
|
+
* Set this to `true` if you want this component to be translatable
|
|
72
|
+
*/
|
|
73
|
+
localized?: boolean;
|
|
74
|
+
/** @hidden */
|
|
75
|
+
options?: {
|
|
76
|
+
[key: string]: any;
|
|
77
|
+
};
|
|
78
|
+
/**
|
|
79
|
+
* For "text" input type, specifying an enum will show a dropdown of options instead
|
|
80
|
+
*/
|
|
81
|
+
enum?: string[] | {
|
|
82
|
+
label: string;
|
|
83
|
+
value: any;
|
|
84
|
+
helperText?: string;
|
|
85
|
+
}[];
|
|
86
|
+
/** Regex field validation for all string types (text, longText, html, url, etc) */
|
|
87
|
+
regex?: {
|
|
88
|
+
/** pattern to test, like "^\/[a-z]$" */
|
|
89
|
+
pattern: string;
|
|
90
|
+
/** flags for the RegExp constructor, e.g. "gi" */
|
|
91
|
+
options?: string;
|
|
92
|
+
/**
|
|
93
|
+
* Friendly message to display to end-users if the regex fails, e.g.
|
|
94
|
+
* "You must use a relative url starting with '/...' "
|
|
95
|
+
*/
|
|
96
|
+
message: string;
|
|
97
|
+
};
|
|
98
|
+
/**
|
|
99
|
+
* Set this to `true` to put this under the "show more" section of
|
|
100
|
+
* the options editor. Useful for things that are more advanced
|
|
101
|
+
* or more rarely used and don't need to be too prominent
|
|
102
|
+
*/
|
|
103
|
+
advanced?: boolean;
|
|
104
|
+
/** @hidden */
|
|
105
|
+
/** @hidden */
|
|
106
|
+
code?: boolean;
|
|
107
|
+
/** @hidden */
|
|
108
|
+
richText?: boolean;
|
|
109
|
+
/** @hidden */
|
|
110
|
+
showIf?: ((options: Map<string, any>) => boolean) | string;
|
|
111
|
+
/** @hidden */
|
|
112
|
+
copyOnAdd?: boolean;
|
|
113
|
+
/**
|
|
114
|
+
* Use optionally with inputs of type `reference`. Restricts the content entry picker to a specific model by name.
|
|
115
|
+
*/
|
|
116
|
+
model?: string;
|
|
117
|
+
valueType?: {
|
|
118
|
+
type?: string;
|
|
119
|
+
};
|
|
120
|
+
onChange?: ((options: Map<string, any>) => void | Promise<void>) | string;
|
|
121
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type Target = 'vue3' | 'vue2' | 'reactNative' | 'svelte' | 'qwik' | 'react' | 'solid' | 'rsc';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export type Nullable<T> = T | null | undefined;
|
|
2
|
+
export type Dictionary<T> = {
|
|
3
|
+
[key: string]: T;
|
|
4
|
+
};
|
|
5
|
+
export type Overwrite<T, U> = keyof U extends keyof T ? Pick<T, Exclude<keyof T, keyof U>> & U : never;
|
|
6
|
+
export type Prettify<T> = {
|
|
7
|
+
[K in keyof T]: T[K];
|
|
8
|
+
} & {};
|
|
9
|
+
export type PropsWithChildren<P> = P & {
|
|
10
|
+
children?: any;
|
|
11
|
+
};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use client";"use strict";const t=require("react/jsx-runtime"),c=require("./bundle-cbc690cf.cjs"),o=require("react"),_=require("./USE_SERVER_BUNDLE-c110917b.cjs"),M=require("next/navigation");function W(e){return t.jsxs(t.Fragment,{children:[e.link?t.jsx(t.Fragment,{children:t.jsx("a",{role:"button",...e.attributes,href:e.link,target:e.openLinkInNewTab?"_blank":void 0,children:e.text})}):t.jsx(t.Fragment,{children:t.jsx("button",{...e.attributes,style:e.attributes.style,className:e.attributes.className+" button-35669e6c",children:e.text})}),t.jsx("style",{children:`.button-35669e6c {
|
|
2
|
-
all: unset;
|
|
3
|
-
}`})]})}function A(e){return t.jsx(e.Wrapper,{...e.wrapperProps,attributes:{...c.getBlockProperties({block:e.block,context:e.context}),...c.getBlockActions({block:e.block,rootState:e.context.rootState,rootSetState:e.context.rootSetState,localState:e.context.localState,context:e.context.context})},children:e.children})}function V(e){return t.jsxs(t.Fragment,{children:[" ",e.hasChildren?t.jsx(t.Fragment,{children:t.jsxs(e.Wrapper,{...c.getBlockProperties({block:e.block,context:e.context}),...c.getBlockActions({block:e.block,rootState:e.context.rootState,rootSetState:e.context.rootSetState,localState:e.context.localState,context:e.context.context,stripPrefix:!0}),children:[" ",e.children," "]})}):t.jsx(t.Fragment,{children:t.jsx(e.Wrapper,{...c.getBlockProperties({block:e.block,context:e.context}),...c.getBlockActions({block:e.block,rootState:e.context.rootState,rootSetState:e.context.rootSetState,localState:e.context.localState,context:e.context.context,stripPrefix:!0})})})," "]})}function z(e){function a(){var s;return"builder-blocks"+((s=e.blocks)!=null&&s.length?"":" no-blocks")}function g(){var s,x;c.isEditing()&&!((s=e.blocks)!=null&&s.length)&&((x=window.parent)==null||x.postMessage({type:"builder.clickEmptyBlocks",data:{parentElementId:e.parent,dataPath:e.path}},"*"))}function h(){var s,x;c.isEditing()&&!((s=e.blocks)!=null&&s.length)&&((x=window.parent)==null||x.postMessage({type:"builder.hoverEmptyBlocks",data:{parentElementId:e.parent,dataPath:e.path}},"*"))}return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:a()+" div-02c7a115","builder-path":e.path,"builder-parent-id":e.parent,style:e.styleProp,onClick:s=>g(),onMouseEnter:s=>h(),onKeyPress:s=>g(),children:e.children}),t.jsx("style",{children:`.div-02c7a115 {
|
|
4
|
-
display: flex;
|
|
5
|
-
flex-direction: column;
|
|
6
|
-
align-items: stretch;
|
|
7
|
-
}`})]})}function D(e){return t.jsx("span",{children:e.children})}function U(e){var s,x,k,S;function a(){var b;const d=e.image||e.src;if(!d||!(d.match(/builder\.io/)||d.match(/cdn\.shopify\.com/)))return e.srcset;if(e.srcset&&((b=e.image)!=null&&b.includes("builder.io/api/v1/image"))){if(!e.srcset.includes(e.image.split("?")[0]))return console.debug("Removed given srcset"),c.getSrcSet(d)}else if(e.image&&!e.srcset)return c.getSrcSet(d);return c.getSrcSet(d)}function g(){var f;return(f=a==null?void 0:a())!=null&&f.match(/builder\.io/)&&!e.noWebp?a().replace(/\?/g,"?format=webp&"):""}function h(){const f={position:"absolute",height:"100%",width:"100%",left:"0px",top:"0px"};return e.aspectRatio?f:void 0}return t.jsxs(t.Fragment,{children:[t.jsxs(t.Fragment,{children:[t.jsxs("picture",{children:[g()?t.jsx(t.Fragment,{children:t.jsx("source",{type:"image/webp",srcSet:g()})}):null,t.jsx("img",{loading:"lazy",alt:e.altText,role:e.altText?"presentation":void 0,style:{objectPosition:e.backgroundPosition||"center",objectFit:e.backgroundSize||"cover",...h()},className:"builder-image"+(e.className?" "+e.className:"")+" img-497e0136",src:e.image,srcSet:a(),sizes:e.sizes})]}),e.aspectRatio&&!((x=(s=e.builderBlock)==null?void 0:s.children)!=null&&x.length&&e.fitContent)?t.jsx(t.Fragment,{children:t.jsx("div",{className:"builder-image-sizer div-497e0136",style:{paddingTop:e.aspectRatio*100+"%"}})}):null,(S=(k=e.builderBlock)==null?void 0:k.children)!=null&&S.length&&e.fitContent?t.jsx(t.Fragment,{children:e.children}):null,!e.fitContent&&e.children?t.jsx(t.Fragment,{children:t.jsx("div",{className:"div-497e0136-2",children:e.children})}):null]}),t.jsx("style",{children:`.img-497e0136 {
|
|
8
|
-
opacity: 1;
|
|
9
|
-
transition: opacity 0.2s ease-in-out;
|
|
10
|
-
}.div-497e0136 {
|
|
11
|
-
width: 100%;
|
|
12
|
-
pointer-events: none;
|
|
13
|
-
font-size: 0;
|
|
14
|
-
}.div-497e0136-2 {
|
|
15
|
-
display: flex;
|
|
16
|
-
flex-direction: column;
|
|
17
|
-
align-items: stretch;
|
|
18
|
-
position: absolute;
|
|
19
|
-
top: 0;
|
|
20
|
-
left: 0;
|
|
21
|
-
width: 100%;
|
|
22
|
-
height: 100%;
|
|
23
|
-
}`})]})}function H(e){return t.jsx("section",{...e.attributes,style:{width:"100%",alignSelf:"stretch",flexGrow:1,boxSizing:"border-box",maxWidth:e.maxWidth||1200,display:"flex",flexDirection:"column",alignItems:"stretch",marginLeft:"auto",marginRight:"auto"},children:e.children})}function O(e){var h;function a(){return{...e.autoPlay===!0?{autoPlay:!0}:{},...e.muted===!0?{muted:!0}:{},...e.controls===!0?{controls:!0}:{},...e.loop===!0?{loop:!0}:{},...e.playsInline===!0?{playsInline:!0}:{}}}function g(){return{...e.attributes,...a()}}return t.jsx("video",{...g(),preload:e.preload||"metadata",style:{width:"100%",height:"100%",...(h=e.attributes)==null?void 0:h.style,objectFit:e.fit,objectPosition:e.position,borderRadius:1},src:e.video||"no-src",poster:e.posterImage})}function J(e){const a=o.useRef(null),[g,h]=o.useState(()=>[]),[s,x]=o.useState(()=>[]),[k,S]=o.useState(()=>!1);function f(){if(!a.current||!a.current.getElementsByTagName)return;const d=a.current.getElementsByTagName("script");for(let b=0;b<d.length;b++){const v=d[b];if(v.src&&!g.includes(v.src)){g.push(v.src);const y=document.createElement("script");y.async=!0,y.src=v.src,document.head.appendChild(y)}else if(c.isJsScript(v)&&!s.includes(v.innerText))try{s.push(v.innerText),new Function(v.innerText)()}catch(y){console.warn("`Embed`: Error running script:",y)}}}return o.useEffect(()=>{a.current&&!k&&(S(!0),f())},[a.current,k]),t.jsx("div",{className:"builder-embed",ref:a,dangerouslySetInnerHTML:{__html:e.content}})}function G(e){return t.jsx("img",{style:{objectFit:e.backgroundSize||"cover",objectPosition:e.backgroundPosition||"center"},alt:e.altText,src:e.imgSrc||e.image,...e.attributes},c.isEditing()&&e.imgSrc||"default-key")}function $(e){const a=o.useRef(null),[g,h]=o.useState(()=>[]),[s,x]=o.useState(()=>[]);return o.useEffect(()=>{var S;if(!((S=a.current)!=null&&S.getElementsByTagName)||typeof window>"u")return;const k=a.current.getElementsByTagName("script");for(let f=0;f<k.length;f++){const d=k[f];if(d.src){if(g.includes(d.src))continue;g.push(d.src);const b=document.createElement("script");b.async=!0,b.src=d.src,document.head.appendChild(b)}else if(!d.type||["text/javascript","application/javascript","application/ecmascript"].includes(d.type)){if(s.includes(d.innerText))continue;try{s.push(d.innerText),new Function(d.innerText)()}catch(b){console.warn("`CustomCode`: Error running script:",b)}}}},[]),t.jsx("div",{ref:a,className:"builder-custom-code"+(e.replaceNodes?" replace-nodes":""),dangerouslySetInnerHTML:{__html:e.code}})}const Q=o.createContext({content:null,context:{},localState:void 0,rootSetState(){},rootState:{},apiKey:null,apiVersion:void 0,componentInfos:{},inheritedStyles:{}});function X(e){var R,I,P,T,F;const a=o.useRef(null),[g,h]=o.useState(()=>0);function s(n){var r,l,u,m,B;const i={...e.builderContextSignal.content,...n,data:{...(r=e.builderContextSignal.content)==null?void 0:r.data,...n==null?void 0:n.data},meta:{...(l=e.builderContextSignal.content)==null?void 0:l.meta,...n==null?void 0:n.meta,breakpoints:((u=n==null?void 0:n.meta)==null?void 0:u.breakpoints)||((B=(m=e.builderContextSignal.content)==null?void 0:m.meta)==null?void 0:B.breakpoints)}};_.postPreviewContent({value:i,key:i.id}).then(()=>{q.refresh()})}o.useState(()=>0);const[x,k]=o.useState(()=>!1);function S(n){var r;const{data:i}=n;if(i)switch(i.type){case"builder.configureSdk":{const l=i.data,{breakpoints:u,contentId:m}=l;if(!m||m!==((r=e.builderContextSignal.content)==null?void 0:r.id))return;u&&s({meta:{breakpoints:u}}),h(g+1);break}case"builder.contentUpdate":{const l=i.data,u=l.key||l.alias||l.entry||l.modelName,m=l.data;u===e.model&&(s(m),h(g+1));break}}}function f(){var i,r;const n=(r=(i=e.builderContextSignal.content)==null?void 0:i.data)==null?void 0:r.jsCode;n&&c.evaluate({code:n,context:e.context||{},localState:void 0,rootState:e.builderContextSignal.rootState,rootSetState:e.builderContextSignal.rootSetState})}const[d,b]=o.useState(()=>({})),[v,y]=o.useState(()=>!1);function N(n){var i,r;if(e.builderContextSignal.content){const l=(i=e.builderContextSignal.content)==null?void 0:i.testVariationId,u=(r=e.builderContextSignal.content)==null?void 0:r.id;c._track({type:"click",canTrack:c.getDefaultCanTrack(e.canTrack),contentId:u,apiKey:e.apiKey,variationId:l!==u?l:void 0,...c.getInteractionPropertiesForEvent(n),unique:!v})}v||y(!0)}function L(n){return n.replace(/{{([^}]+)}}/g,(i,r)=>c.evaluate({code:r,context:e.context||{},localState:void 0,rootState:e.builderContextSignal.rootState,rootSetState:e.builderContextSignal.rootSetState}))}function K({url:n,key:i}){c.fetch(n).then(r=>r.json()).then(r=>{var u,m;const l={...e.builderContextSignal.rootState,[i]:r};(m=(u=e.builderContextSignal).rootSetState)==null||m.call(u,l),d[i]=!0}).catch(r=>{console.error("error fetching dynamic data",n,r)})}function C(){var i,r;const n=((r=(i=e.builderContextSignal.content)==null?void 0:i.data)==null?void 0:r.httpRequests)??{};Object.entries(n).forEach(([l,u])=>{if(u&&(!d[l]||c.isEditing())){const m=L(u);K({url:m,key:l})}})}function E(){c.isEditing()&&window.dispatchEvent(new CustomEvent("builder:component:stateChange",{detail:{state:c.fastClone(e.builderContextSignal.rootState),ref:{name:e.model}}}))}function j(n){h(g+1),window.addEventListener("message",S),c.registerInsertMenu(),c.setupBrowserForEditing({...e.locale?{locale:e.locale}:{},...e.includeRefs?{includeRefs:e.includeRefs}:{},...e.enrich?{enrich:e.enrich}:{}}),Object.values(e.builderContextSignal.componentInfos).forEach(i=>{var l;const r=c.createRegisterComponentMessage(i);(l=window.parent)==null||l.postMessage(r,"*")}),window.addEventListener("builder:component:stateChangeListenerActivated",E)}function w(n){const i=new URL(location.href).searchParams,r=i.get("builder.preview"),l=i.get(`builder.preview.${r}`),u=i.get("apiKey")||i.get("builder.space");r===e.model&&u===e.apiKey&&(!e.content||l===e.content.id)&&c.fetchOneEntry({model:e.model,apiKey:e.apiKey,apiVersion:e.builderContextSignal.apiVersion}).then(m=>{m&&s(m)})}const q=M.useRouter();return o.useEffect(()=>{var n;return(n=a.current)==null||n.addEventListener("initeditingbldr",j),()=>{var i;return(i=a.current)==null?void 0:i.removeEventListener("initeditingbldr",j)}},[]),o.useEffect(()=>{var n;return(n=a.current)==null||n.addEventListener("initpreviewingbldr",w),()=>{var i;return(i=a.current)==null?void 0:i.removeEventListener("initpreviewingbldr",w)}},[]),o.useEffect(()=>{var n,i;if(c.isBrowser()){if(c.isEditing()&&a.current&&a.current.dispatchEvent(new CustomEvent("initeditingbldr")),e.builderContextSignal.content&&c.getDefaultCanTrack(e.canTrack)){const l=(n=e.builderContextSignal.content)==null?void 0:n.testVariationId,u=(i=e.builderContextSignal.content)==null?void 0:i.id,m=e.apiKey;c._track({type:"impression",canTrack:!0,contentId:u,apiKey:m,variationId:l!==u?l:void 0})}c.isPreviewing()&&a.current}},[]),o.useEffect(()=>{e.apiKey||c.logger.error("No API key provided to `RenderContent` component. This can cause issues. Please provide an API key using the `apiKey` prop."),f(),C(),E()},[]),o.useEffect(()=>{},[e.content]),o.useEffect(()=>{c.isBrowser()&&(window.removeEventListener("message",S),window.addEventListener("message",S))},[x]),o.useEffect(()=>{f()},[(I=(R=e.builderContextSignal.content)==null?void 0:R.data)==null?void 0:I.jsCode,e.builderContextSignal.rootState]),o.useEffect(()=>{C()},[(T=(P=e.builderContextSignal.content)==null?void 0:P.data)==null?void 0:T.httpRequests]),o.useEffect(()=>{E()},[e.builderContextSignal.rootState]),o.useEffect(()=>()=>{c.isBrowser()&&(window.removeEventListener("message",S),window.removeEventListener("builder:component:stateChangeListenerActivated",E))},[]),t.jsx(Q.Provider,{value:e.builderContextSignal,children:e.builderContextSignal.content?t.jsx(t.Fragment,{children:o.createElement("div",{key:g,ref:a,onClick:n=>N(n),"builder-content-id":(F=e.builderContextSignal.content)==null?void 0:F.id,"builder-model":e.model,...e.showContent?{}:{hidden:!0,"aria-hidden":!0},className:e.classNameProp},e.children)}):null})}exports.BlockWrapper=V;exports.BlocksWrapper=z;exports.Button=W;exports.CustomCode=$;exports.Embed=J;exports.EnableEditor=X;exports.FragmentComponent=D;exports.Image=U;exports.ImgComponent=G;exports.InteractiveElement=A;exports.SectionComponent=H;exports.Video=O;
|