@builder.io/sdk-react-nextjs 0.7.1-2 → 0.7.1-4
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-11d41596.js → USE_CLIENT_BUNDLE-1cdce03b.cjs} +1 -1
- package/lib/{node/USE_CLIENT_BUNDLE-e041d92c.mjs → browser/USE_CLIENT_BUNDLE-2dd6963b.js} +2 -2
- package/lib/{edge/USE_SERVER_BUNDLE-66d4b8c4.mjs → browser/USE_SERVER_BUNDLE-97369f61.js} +1 -1
- package/lib/browser/USE_SERVER_BUNDLE-c110917b.cjs +1 -0
- package/lib/browser/{bundle-242ae8b5.mjs → bundle-31003427.js} +2 -2
- package/lib/browser/{bundle-05622db1.js → bundle-cbc690cf.cjs} +2 -2
- package/lib/browser/index.cjs +1 -1
- package/lib/browser/index.d.cts +1066 -0
- package/lib/browser/index.d.mts +1066 -0
- package/lib/browser/index.mjs +3 -3
- package/lib/{node/USE_CLIENT_BUNDLE-8147b412.js → edge/USE_CLIENT_BUNDLE-ba263633.cjs} +1 -1
- package/lib/{browser/USE_CLIENT_BUNDLE-48d9356f.mjs → edge/USE_CLIENT_BUNDLE-ee929cd6.js} +2 -2
- package/lib/edge/USE_SERVER_BUNDLE-133fe486.cjs +1 -0
- package/lib/{node/USE_SERVER_BUNDLE-1634816a.mjs → edge/USE_SERVER_BUNDLE-2a1fc947.js} +1 -1
- package/lib/edge/{bundle-3d31ba5d.mjs → bundle-1c5ceddb.js} +2 -2
- package/lib/edge/{bundle-1b9b93c7.js → bundle-cfdeec4b.cjs} +2 -2
- package/lib/edge/index.cjs +1 -1
- package/lib/edge/index.d.cts +1066 -0
- package/lib/edge/index.d.mts +1066 -0
- package/lib/edge/index.mjs +3 -3
- package/lib/{edge/USE_CLIENT_BUNDLE-6eb1ee54.mjs → node/USE_CLIENT_BUNDLE-32bb8c8f.js} +2 -2
- package/lib/{edge/USE_CLIENT_BUNDLE-bba76732.js → node/USE_CLIENT_BUNDLE-7a982d7c.cjs} +1 -1
- package/lib/node/USE_SERVER_BUNDLE-25f4a46f.cjs +1 -0
- package/lib/{browser/USE_SERVER_BUNDLE-3875256b.mjs → node/USE_SERVER_BUNDLE-86e8b7c7.js} +1 -1
- package/lib/node/{bundle-7ebcd79e.mjs → bundle-844e3979.js} +2 -2
- package/lib/node/{bundle-4203318d.js → bundle-b13f5899.cjs} +2 -2
- package/lib/node/index.cjs +1 -1
- package/lib/node/index.d.cts +1066 -0
- package/lib/node/index.d.mts +1066 -0
- package/lib/node/index.mjs +3 -3
- package/package.json +8 -26
- package/lib/browser/USE_SERVER_BUNDLE-568694d9.js +0 -1
- package/lib/edge/USE_SERVER_BUNDLE-305bf94a.js +0 -1
- package/lib/node/USE_SERVER_BUNDLE-8c1ae1f0.js +0 -1
- package/types/blocks/button/button.d.ts +0 -11
- package/types/blocks/button/component-info.d.ts +0 -2
- package/types/blocks/columns/columns.d.ts +0 -17
- package/types/blocks/columns/component-info.d.ts +0 -2
- package/types/blocks/custom-code/component-info.d.ts +0 -2
- package/types/blocks/custom-code/custom-code.d.ts +0 -7
- package/types/blocks/embed/component-info.d.ts +0 -2
- package/types/blocks/embed/embed.d.ts +0 -6
- package/types/blocks/embed/helpers.d.ts +0 -1
- package/types/blocks/fragment/component-info.d.ts +0 -2
- package/types/blocks/fragment/fragment.d.ts +0 -8
- package/types/blocks/helpers.d.ts +0 -13
- package/types/blocks/image/component-info.d.ts +0 -2
- package/types/blocks/image/image.d.ts +0 -22
- package/types/blocks/image/image.helpers.d.ts +0 -1
- package/types/blocks/img/component-info.d.ts +0 -2
- package/types/blocks/img/img.d.ts +0 -13
- package/types/blocks/section/component-info.d.ts +0 -2
- package/types/blocks/section/section.d.ts +0 -11
- package/types/blocks/symbol/component-info.d.ts +0 -2
- package/types/blocks/symbol/symbol.d.ts +0 -24
- package/types/blocks/symbol/symbol.helpers.d.ts +0 -14
- package/types/blocks/text/component-info.d.ts +0 -2
- package/types/blocks/text/text.d.ts +0 -6
- package/types/blocks/video/component-info.d.ts +0 -2
- package/types/blocks/video/video.d.ts +0 -20
- package/types/components/block/block.d.ts +0 -10
- package/types/components/block/block.helpers.d.ts +0 -13
- package/types/components/block/components/block-styles.d.ts +0 -9
- package/types/components/block/components/block-wrapper.d.ts +0 -17
- package/types/components/block/components/component-ref/component-ref.d.ts +0 -4
- package/types/components/block/components/component-ref/component-ref.helpers.d.ts +0 -28
- package/types/components/block/components/interactive-element.d.ts +0 -12
- package/types/components/block/components/repeated-block.d.ts +0 -10
- package/types/components/block/types.d.ts +0 -6
- package/types/components/blocks/blocks-wrapper.d.ts +0 -11
- package/types/components/blocks/blocks.d.ts +0 -9
- package/types/components/content/components/enable-editor.d.ts +0 -10
- package/types/components/content/components/styles.d.ts +0 -9
- package/types/components/content/components/styles.helpers.d.ts +0 -15
- package/types/components/content/content.d.ts +0 -4
- package/types/components/content/content.helpers.d.ts +0 -7
- package/types/components/content/content.types.d.ts +0 -24
- package/types/components/content/wrap-component-ref.d.ts +0 -6
- package/types/components/content-variants/content-variants.d.ts +0 -10
- package/types/components/content-variants/content-variants.types.d.ts +0 -20
- package/types/components/content-variants/helpers.d.ts +0 -41
- package/types/components/inlined-script.d.ts +0 -7
- package/types/components/inlined-styles.d.ts +0 -7
- package/types/constants/builder-registered-components.d.ts +0 -6
- package/types/constants/device-sizes.d.ts +0 -13
- package/types/constants/sdk-version.d.ts +0 -1
- package/types/constants/target.d.ts +0 -2
- package/types/context/builder.context.d.ts +0 -3
- package/types/context/components.context.d.ts +0 -3
- package/types/context/types.d.ts +0 -35
- package/types/functions/camel-to-kebab-case.d.ts +0 -1
- package/types/functions/deopt.d.ts +0 -4
- package/types/functions/evaluate/browser-runtime/browser.d.ts +0 -4
- package/types/functions/evaluate/browser-runtime/index.d.ts +0 -1
- package/types/functions/evaluate/choose-eval.d.ts +0 -6
- package/types/functions/evaluate/evaluate.d.ts +0 -2
- package/types/functions/evaluate/helpers.d.ts +0 -24
- package/types/functions/evaluate/index.d.ts +0 -1
- package/types/functions/event-handler-name.d.ts +0 -1
- package/types/functions/extract-text-styles.d.ts +0 -4
- package/types/functions/fast-clone.d.ts +0 -4
- package/types/functions/fetch-builder-props.d.ts +0 -53
- package/types/functions/get-block-actions-handler.d.ts +0 -8
- package/types/functions/get-block-actions.d.ts +0 -10
- package/types/functions/get-block-component-options.d.ts +0 -2
- package/types/functions/get-block-properties.d.ts +0 -6
- package/types/functions/get-builder-search-params/index.d.ts +0 -12
- package/types/functions/get-content/generate-content-url.d.ts +0 -2
- package/types/functions/get-content/index.d.ts +0 -28
- package/types/functions/get-content/types.d.ts +0 -142
- package/types/functions/get-fetch.d.ts +0 -1
- package/types/functions/get-global-this.d.ts +0 -4
- package/types/functions/get-processed-block.d.ts +0 -10
- package/types/functions/get-react-native-block-styles.d.ts +0 -7
- package/types/functions/is-browser.d.ts +0 -1
- package/types/functions/is-editing.d.ts +0 -1
- package/types/functions/is-iframe.d.ts +0 -1
- package/types/functions/is-previewing.d.ts +0 -1
- package/types/functions/register-component.d.ts +0 -15
- package/types/functions/register.d.ts +0 -16
- package/types/functions/sanitize-react-native-block-styles.d.ts +0 -3
- package/types/functions/set-editor-settings.d.ts +0 -4
- package/types/functions/set.d.ts +0 -7
- package/types/functions/track/helpers.d.ts +0 -5
- package/types/functions/track/index.d.ts +0 -51
- package/types/functions/track/interaction.d.ts +0 -13
- package/types/functions/transform-block-properties.d.ts +0 -1
- package/types/functions/transform-block.d.ts +0 -2
- package/types/helpers/ab-tests.d.ts +0 -9
- package/types/helpers/canTrack.d.ts +0 -1
- package/types/helpers/cookie.d.ts +0 -19
- package/types/helpers/css.d.ts +0 -7
- package/types/helpers/flatten.d.ts +0 -6
- package/types/helpers/localStorage.d.ts +0 -9
- package/types/helpers/logger.d.ts +0 -6
- package/types/helpers/nullable.d.ts +0 -2
- package/types/helpers/preview-lru-cache/get.d.ts +0 -1
- package/types/helpers/preview-lru-cache/helpers.d.ts +0 -1
- package/types/helpers/preview-lru-cache/init.d.ts +0 -6
- package/types/helpers/preview-lru-cache/set.d.ts +0 -7
- package/types/helpers/preview-lru-cache/types.d.ts +0 -12
- package/types/helpers/sessionId.d.ts +0 -6
- package/types/helpers/url.d.ts +0 -6
- package/types/helpers/uuid.d.ts +0 -8
- package/types/helpers/visitorId.d.ts +0 -6
- package/types/index-helpers/blocks-exports.d.ts +0 -19
- package/types/index-helpers/top-of-file.d.ts +0 -1
- package/types/index.d.ts +0 -7
- package/types/scripts/init-editing.d.ts +0 -6
- package/types/server-index.d.ts +0 -15
- package/types/types/api-version.d.ts +0 -2
- package/types/types/builder-block.d.ts +0 -66
- package/types/types/builder-content.d.ts +0 -44
- package/types/types/builder-props.d.ts +0 -9
- package/types/types/can-track.d.ts +0 -3
- package/types/types/components.d.ts +0 -110
- package/types/types/deep-partial.d.ts +0 -3
- package/types/types/element.d.ts +0 -59
- package/types/types/enforced-partials.d.ts +0 -21
- package/types/types/input.d.ts +0 -121
- package/types/types/targets.d.ts +0 -1
- package/types/types/typescript.d.ts +0 -11
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import type { CanTrack } from '../../types/can-track.js';
|
|
2
|
-
import type { Dictionary } from '../../types/typescript.js';
|
|
3
|
-
interface Event {
|
|
4
|
-
/**
|
|
5
|
-
* The type of your event.
|
|
6
|
-
*
|
|
7
|
-
* Examples: `click`, `conversion`, `pageview`, `impression`
|
|
8
|
-
*/
|
|
9
|
-
type: string;
|
|
10
|
-
data: {
|
|
11
|
-
/**
|
|
12
|
-
* (Optional) The content's ID. Useful if this event pertains to a specific piece of content.
|
|
13
|
-
*/
|
|
14
|
-
contentId?: string;
|
|
15
|
-
/**
|
|
16
|
-
* This is the ID of the space that the content belongs to.
|
|
17
|
-
*/
|
|
18
|
-
ownerId: string;
|
|
19
|
-
/**
|
|
20
|
-
* (Optional) metadata that you want to provide with your event.
|
|
21
|
-
*/
|
|
22
|
-
metadata?: Dictionary<any>;
|
|
23
|
-
/**
|
|
24
|
-
* Session ID of the user. This is provided by the SDK by checking session storage.
|
|
25
|
-
*/
|
|
26
|
-
sessionId: string | undefined;
|
|
27
|
-
/**
|
|
28
|
-
* Visitor ID of the user. This is provided by the SDK by checking cookies.
|
|
29
|
-
*/
|
|
30
|
-
visitorId: string | undefined;
|
|
31
|
-
/**
|
|
32
|
-
* (Optional) If running an A/B test, the ID of the variation that the user is in.
|
|
33
|
-
*/
|
|
34
|
-
variationId?: string;
|
|
35
|
-
[index: string]: any;
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
type EventProperties = Pick<Event, 'type'> & Pick<Event['data'], 'contentId' | 'variationId' | 'metadata'> & {
|
|
39
|
-
/**
|
|
40
|
-
* Your organization's API key.
|
|
41
|
-
*/
|
|
42
|
-
apiKey: Event['data']['ownerId'];
|
|
43
|
-
/**
|
|
44
|
-
* (Optional) Any additional (non-metadata) properties to add to the event.
|
|
45
|
-
*/
|
|
46
|
-
[index: string]: any;
|
|
47
|
-
};
|
|
48
|
-
export type EventProps = EventProperties & CanTrack;
|
|
49
|
-
export declare function _track(eventProps: EventProps): Promise<void | Response>;
|
|
50
|
-
export declare const track: (args: EventProperties) => Promise<void | Response>;
|
|
51
|
-
export {};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
type Offset = {
|
|
2
|
-
x: number;
|
|
3
|
-
y: number;
|
|
4
|
-
};
|
|
5
|
-
export declare const getInteractionPropertiesForEvent: (event: MouseEvent) => {
|
|
6
|
-
targetBuilderElement: string;
|
|
7
|
-
metadata: {
|
|
8
|
-
targetOffset: Offset;
|
|
9
|
-
builderTargetOffset: Offset;
|
|
10
|
-
builderElementIndex: any;
|
|
11
|
-
};
|
|
12
|
-
};
|
|
13
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function transformBlockProperties(properties: any): any;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { CanTrack } from '../types/can-track.js';
|
|
2
|
-
import type { BuilderContent } from '../types/builder-content.js';
|
|
3
|
-
import type { Nullable } from '../types/typescript.js';
|
|
4
|
-
export declare const handleABTestingSync: ({ item, canTrack }: {
|
|
5
|
-
item: Nullable<BuilderContent>;
|
|
6
|
-
} & CanTrack) => Nullable<BuilderContent>;
|
|
7
|
-
export declare const handleABTesting: ({ item, canTrack }: {
|
|
8
|
-
item: BuilderContent;
|
|
9
|
-
} & CanTrack) => Promise<BuilderContent>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const getDefaultCanTrack: (canTrack?: boolean) => boolean;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { CanTrack } from '../types/can-track.js';
|
|
2
|
-
type GetCookieArgs = {
|
|
3
|
-
name: string;
|
|
4
|
-
} & CanTrack;
|
|
5
|
-
export declare const getCookieSync: ({ name, canTrack }: GetCookieArgs) => string | undefined;
|
|
6
|
-
/**
|
|
7
|
-
* NOTE: This function is `async` because its react-native override is async. Do not remove the `async` keyword!
|
|
8
|
-
* The sync version is only safe to use in code blocks that `react-native` is guaranteed not to not run.
|
|
9
|
-
*/
|
|
10
|
-
export declare const getCookie: (args: GetCookieArgs) => Promise<string>;
|
|
11
|
-
/**
|
|
12
|
-
* NOTE: This function is `async` because its react-native override is async. Do not remove the `async` keyword!
|
|
13
|
-
*/
|
|
14
|
-
export declare const setCookie: ({ name, value, expires, canTrack }: {
|
|
15
|
-
name: string;
|
|
16
|
-
value: string;
|
|
17
|
-
expires?: Date;
|
|
18
|
-
} & CanTrack) => Promise<void>;
|
|
19
|
-
export {};
|
package/types/helpers/css.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export declare const convertStyleMapToCSSArray: (style: Partial<CSSStyleDeclaration>) => string[];
|
|
2
|
-
export declare const convertStyleMapToCSS: (style: Partial<CSSStyleDeclaration>) => string;
|
|
3
|
-
export declare const createCssClass: ({ mediaQuery, className, styles }: {
|
|
4
|
-
mediaQuery?: string;
|
|
5
|
-
className: string;
|
|
6
|
-
styles: Partial<CSSStyleDeclaration>;
|
|
7
|
-
}) => string;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { CanTrack } from '../types/can-track.js';
|
|
2
|
-
import type { Nullable } from './nullable.js';
|
|
3
|
-
export declare const getLocalStorageItem: ({ key, canTrack }: {
|
|
4
|
-
key: string;
|
|
5
|
-
} & CanTrack) => Nullable<string>;
|
|
6
|
-
export declare const setLocalStorageItem: ({ key, canTrack, value }: {
|
|
7
|
-
key: string;
|
|
8
|
-
value: string;
|
|
9
|
-
} & CanTrack) => void;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function getPreviewContent(searchParams: URLSearchParams): import("../../types/builder-content").BuilderContent;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const getIdFromSearchParams: (searchParams: URLSearchParams) => string;
|
|
@@ -1,12 +0,0 @@
|
|
|
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';
|
|
8
|
-
type BuilderLRUCache = LRUCache<string, BuilderContent>;
|
|
9
|
-
export type GlobalWCache = typeof globalThis & {
|
|
10
|
-
_BUILDER_PREVIEW_LRU_CACHE: BuilderLRUCache;
|
|
11
|
-
};
|
|
12
|
-
export {};
|
|
@@ -1,6 +0,0 @@
|
|
|
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>;
|
package/types/helpers/url.d.ts
DELETED
package/types/helpers/uuid.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
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;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
export { default as Button } from '../blocks/button/button';
|
|
2
|
-
export { default as Columns } from '../blocks/columns/columns';
|
|
3
|
-
export { default as Fragment } from '../blocks/fragment/fragment';
|
|
4
|
-
export { default as Image } from '../blocks/image/image';
|
|
5
|
-
export { default as Section } from '../blocks/section/section';
|
|
6
|
-
export { default as Symbol } from '../blocks/symbol/symbol';
|
|
7
|
-
export { default as Text } from '../blocks/text/text';
|
|
8
|
-
export { default as Video } from '../blocks/video/video';
|
|
9
|
-
import { default as Blocks } from '../components/blocks/blocks';
|
|
10
|
-
import { default as Content } from '../components/content-variants/content-variants';
|
|
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;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default undefined;
|
package/types/index.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
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';
|
package/types/server-index.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
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 { fetchEntries, fetchOneEntry, getAllContent, getContent, _processContentResult } 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 { RegisteredComponent } from './context/types.js';
|
|
13
|
-
export type { ComponentInfo } from './types/components.js';
|
|
14
|
-
export type { ContentProps } from './components/content/content.types.js';
|
|
15
|
-
export { fetchBuilderProps } from './functions/fetch-builder-props.js';
|
|
@@ -1,66 +0,0 @@
|
|
|
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 {};
|
|
@@ -1,44 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1,110 +0,0 @@
|
|
|
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 {};
|
package/types/types/element.d.ts
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
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 {};
|
|
@@ -1,21 +0,0 @@
|
|
|
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 {};
|