@builder.io/sdk-qwik 0.7.1-6 → 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.
Files changed (181) hide show
  1. package/lib/browser/index.qwik.cjs +332 -234
  2. package/lib/browser/index.qwik.mjs +333 -235
  3. package/lib/edge/index.qwik.cjs +339 -241
  4. package/lib/edge/index.qwik.mjs +340 -242
  5. package/lib/node/index.qwik.cjs +341 -243
  6. package/lib/node/index.qwik.mjs +341 -243
  7. package/lib/node/{node-evaluate-fc9f27d1.cjs → node-evaluate-1a278bf5.cjs} +2 -1
  8. package/package.json +2 -3
  9. package/types/src/blocks/button/button.d.ts +2 -1
  10. package/types/src/blocks/img/img.d.ts +2 -1
  11. package/types/src/blocks/input/input.d.ts +2 -1
  12. package/types/src/blocks/section/section.d.ts +2 -1
  13. package/types/src/blocks/select/select.d.ts +2 -1
  14. package/types/src/blocks/submit-button/submit-button.d.ts +2 -1
  15. package/types/src/blocks/symbol/symbol.d.ts +4 -2
  16. package/types/src/blocks/textarea/textarea.d.ts +2 -1
  17. package/types/src/components/block/components/block-wrapper.d.ts +2 -1
  18. package/types/src/constants/sdk-version.d.ts +1 -1
  19. package/types/src/context/types.d.ts +1 -1
  20. package/types/src/functions/evaluate/node-runtime/safeDynamicRequire.d.ts +2 -4
  21. package/types/src/helpers/ab-tests.d.ts +1 -1
  22. package/types/src/server-index.d.ts +2 -2
  23. package/lib/index.qwik.js +0 -7609
  24. package/types/blocks/BaseText.d.ts +0 -5
  25. package/types/blocks/button/button.d.ts +0 -11
  26. package/types/blocks/button/component-info.d.ts +0 -2
  27. package/types/blocks/columns/columns.d.ts +0 -32
  28. package/types/blocks/columns/component-info.d.ts +0 -2
  29. package/types/blocks/custom-code/component-info.d.ts +0 -2
  30. package/types/blocks/custom-code/custom-code.d.ts +0 -7
  31. package/types/blocks/embed/component-info.d.ts +0 -2
  32. package/types/blocks/embed/embed.d.ts +0 -6
  33. package/types/blocks/embed/helpers.d.ts +0 -1
  34. package/types/blocks/form/component-info.d.ts +0 -2
  35. package/types/blocks/fragment/component-info.d.ts +0 -2
  36. package/types/blocks/fragment/fragment.d.ts +0 -7
  37. package/types/blocks/helpers.d.ts +0 -13
  38. package/types/blocks/image/component-info.d.ts +0 -2
  39. package/types/blocks/image/image.d.ts +0 -23
  40. package/types/blocks/image/image.helpers.d.ts +0 -1
  41. package/types/blocks/img/component-info.d.ts +0 -2
  42. package/types/blocks/img/img.d.ts +0 -12
  43. package/types/blocks/input/component-info.d.ts +0 -2
  44. package/types/blocks/input/input.d.ts +0 -13
  45. package/types/blocks/raw-text/component-info.d.ts +0 -2
  46. package/types/blocks/raw-text/raw-text.d.ts +0 -6
  47. package/types/blocks/section/component-info.d.ts +0 -2
  48. package/types/blocks/section/section.d.ts +0 -10
  49. package/types/blocks/select/component-info.d.ts +0 -2
  50. package/types/blocks/select/select.d.ts +0 -14
  51. package/types/blocks/submit-button/component-info.d.ts +0 -2
  52. package/types/blocks/submit-button/submit-button.d.ts +0 -8
  53. package/types/blocks/symbol/component-info.d.ts +0 -2
  54. package/types/blocks/symbol/symbol.d.ts +0 -24
  55. package/types/blocks/symbol/symbol.helpers.d.ts +0 -14
  56. package/types/blocks/text/component-info.d.ts +0 -2
  57. package/types/blocks/text/text.d.ts +0 -5
  58. package/types/blocks/textarea/component-info.d.ts +0 -2
  59. package/types/blocks/textarea/textarea.d.ts +0 -11
  60. package/types/blocks/video/component-info.d.ts +0 -2
  61. package/types/blocks/video/video.d.ts +0 -19
  62. package/types/components/block/block.d.ts +0 -9
  63. package/types/components/block/block.helpers.d.ts +0 -13
  64. package/types/components/block/components/block-styles.d.ts +0 -8
  65. package/types/components/block/components/block-wrapper.d.ts +0 -20
  66. package/types/components/block/components/component-ref/component-ref.d.ts +0 -3
  67. package/types/components/block/components/component-ref/component-ref.helpers.d.ts +0 -35
  68. package/types/components/block/components/interactive-element.d.ts +0 -11
  69. package/types/components/block/components/repeated-block.d.ts +0 -9
  70. package/types/components/block/types.d.ts +0 -6
  71. package/types/components/blocks/blocks-wrapper.d.ts +0 -13
  72. package/types/components/blocks/blocks.d.ts +0 -8
  73. package/types/components/blocks/deopt.d.ts +0 -4
  74. package/types/components/content/components/enable-editor.d.ts +0 -21
  75. package/types/components/content/components/styles.d.ts +0 -8
  76. package/types/components/content/components/styles.helpers.d.ts +0 -15
  77. package/types/components/content/content.d.ts +0 -5
  78. package/types/components/content/content.helpers.d.ts +0 -7
  79. package/types/components/content/content.types.d.ts +0 -24
  80. package/types/components/content/index.d.ts +0 -1
  81. package/types/components/content/wrap-component-ref.d.ts +0 -6
  82. package/types/components/content-variants/content-variants.d.ts +0 -9
  83. package/types/components/content-variants/content-variants.types.d.ts +0 -20
  84. package/types/components/content-variants/helpers.d.ts +0 -41
  85. package/types/components/inlined-script.d.ts +0 -6
  86. package/types/components/inlined-styles.d.ts +0 -6
  87. package/types/constants/builder-registered-components.d.ts +0 -6
  88. package/types/constants/device-sizes.d.ts +0 -13
  89. package/types/constants/sdk-version.d.ts +0 -1
  90. package/types/constants/target.d.ts +0 -2
  91. package/types/context/builder.context.d.ts +0 -2
  92. package/types/context/components.context.d.ts +0 -2
  93. package/types/context/types.d.ts +0 -35
  94. package/types/functions/apply-patch-with-mutation.d.ts +0 -10
  95. package/types/functions/camel-to-kebab-case.d.ts +0 -1
  96. package/types/functions/evaluate/browser-runtime/browser.d.ts +0 -4
  97. package/types/functions/evaluate/browser-runtime/index.d.ts +0 -1
  98. package/types/functions/evaluate/edge-runtime/acorn-interpreter.d.ts +0 -2
  99. package/types/functions/evaluate/edge-runtime/edge-runtime.d.ts +0 -2
  100. package/types/functions/evaluate/edge-runtime/index.d.ts +0 -1
  101. package/types/functions/evaluate/evaluate.d.ts +0 -6
  102. package/types/functions/evaluate/helpers.d.ts +0 -18
  103. package/types/functions/evaluate/index.d.ts +0 -1
  104. package/types/functions/evaluate/node-runtime/index.d.ts +0 -1
  105. package/types/functions/evaluate/non-node-runtime/acorn-interpreter.d.ts +0 -2
  106. package/types/functions/evaluate/non-node-runtime/index.d.ts +0 -1
  107. package/types/functions/evaluate/non-node-runtime/non-node-runtime.d.ts +0 -2
  108. package/types/functions/evaluate/placeholder-runtime.d.ts +0 -2
  109. package/types/functions/event-handler-name.d.ts +0 -1
  110. package/types/functions/extract-text-styles.d.ts +0 -4
  111. package/types/functions/fast-clone.d.ts +0 -4
  112. package/types/functions/fetch-builder-props.d.ts +0 -40
  113. package/types/functions/get-block-actions-handler.d.ts +0 -5
  114. package/types/functions/get-block-actions.d.ts +0 -10
  115. package/types/functions/get-block-component-options.d.ts +0 -2
  116. package/types/functions/get-block-properties.d.ts +0 -11
  117. package/types/functions/get-builder-search-params/index.d.ts +0 -12
  118. package/types/functions/get-content/generate-content-url.d.ts +0 -2
  119. package/types/functions/get-content/index.d.ts +0 -28
  120. package/types/functions/get-content/types.d.ts +0 -51
  121. package/types/functions/get-fetch.d.ts +0 -1
  122. package/types/functions/get-global-this.d.ts +0 -4
  123. package/types/functions/get-processed-block.d.ts +0 -10
  124. package/types/functions/get-react-native-block-styles.d.ts +0 -7
  125. package/types/functions/is-browser.d.ts +0 -1
  126. package/types/functions/is-edge-runtime.d.ts +0 -4
  127. package/types/functions/is-editing.d.ts +0 -1
  128. package/types/functions/is-iframe.d.ts +0 -1
  129. package/types/functions/is-non-node-server.d.ts +0 -4
  130. package/types/functions/is-previewing.d.ts +0 -1
  131. package/types/functions/on-change.d.ts +0 -7
  132. package/types/functions/register-component.d.ts +0 -15
  133. package/types/functions/register.d.ts +0 -16
  134. package/types/functions/sanitize-react-native-block-styles.d.ts +0 -3
  135. package/types/functions/set-editor-settings.d.ts +0 -4
  136. package/types/functions/set.d.ts +0 -7
  137. package/types/functions/track/helpers.d.ts +0 -5
  138. package/types/functions/track/index.d.ts +0 -51
  139. package/types/functions/track/interaction.d.ts +0 -13
  140. package/types/functions/transform-block-properties.d.ts +0 -1
  141. package/types/functions/transform-block.d.ts +0 -2
  142. package/types/helpers/ab-tests.d.ts +0 -9
  143. package/types/helpers/canTrack.d.ts +0 -1
  144. package/types/helpers/cookie.d.ts +0 -19
  145. package/types/helpers/css.d.ts +0 -7
  146. package/types/helpers/flatten.d.ts +0 -6
  147. package/types/helpers/localStorage.d.ts +0 -9
  148. package/types/helpers/logger.d.ts +0 -6
  149. package/types/helpers/nullable.d.ts +0 -2
  150. package/types/helpers/preview-lru-cache/get.d.ts +0 -2
  151. package/types/helpers/preview-lru-cache/helpers.d.ts +0 -0
  152. package/types/helpers/preview-lru-cache/init.d.ts +0 -6
  153. package/types/helpers/preview-lru-cache/set.d.ts +0 -7
  154. package/types/helpers/preview-lru-cache/types.d.ts +0 -0
  155. package/types/helpers/sessionId.d.ts +0 -6
  156. package/types/helpers/time.d.ts +0 -1
  157. package/types/helpers/url.d.ts +0 -6
  158. package/types/helpers/uuid.d.ts +0 -8
  159. package/types/helpers/visitorId.d.ts +0 -6
  160. package/types/index-helpers/blocks-exports.d.ts +0 -21
  161. package/types/index-helpers/top-of-file.d.ts +0 -1
  162. package/types/index.d.ts +0 -7
  163. package/types/scripts/init-editing.d.ts +0 -6
  164. package/types/server-index.d.ts +0 -15
  165. package/types/src/components/blocks/deopt.d.ts +0 -4
  166. package/types/src/functions/evaluate/non-node-runtime/acorn-interpreter.d.ts +0 -2
  167. package/types/src/functions/evaluate/non-node-runtime/index.d.ts +0 -1
  168. package/types/src/functions/evaluate/non-node-runtime/non-node-runtime.d.ts +0 -2
  169. package/types/src/functions/is-non-node-server.d.ts +0 -4
  170. package/types/types/api-version.d.ts +0 -2
  171. package/types/types/builder-block.d.ts +0 -66
  172. package/types/types/builder-content.d.ts +0 -44
  173. package/types/types/builder-props.d.ts +0 -9
  174. package/types/types/can-track.d.ts +0 -3
  175. package/types/types/components.d.ts +0 -111
  176. package/types/types/deep-partial.d.ts +0 -3
  177. package/types/types/element.d.ts +0 -59
  178. package/types/types/enforced-partials.d.ts +0 -21
  179. package/types/types/input.d.ts +0 -121
  180. package/types/types/targets.d.ts +0 -1
  181. package/types/types/typescript.d.ts +0 -11
@@ -1,20 +0,0 @@
1
- import type { BuilderRenderContext, RegisteredComponent } from '../../context/types.js';
2
- import type { ApiVersion } from '../../types/api-version.js';
3
- import type { BuilderContent } from '../../types/builder-content.js';
4
- import type { Nullable } from '../../types/typescript.js';
5
- export interface ContentVariantsPrps {
6
- content?: Nullable<BuilderContent>;
7
- model?: string;
8
- data?: {
9
- [key: string]: any;
10
- };
11
- context?: BuilderRenderContext;
12
- apiKey: string;
13
- apiVersion?: ApiVersion;
14
- customComponents?: RegisteredComponent[];
15
- canTrack?: boolean;
16
- locale?: string;
17
- /** @deprecated use `enrich` instead **/
18
- includeRefs?: boolean;
19
- enrich?: boolean;
20
- }
@@ -1,41 +0,0 @@
1
- import type { Nullable } from '../../helpers/nullable.js';
2
- import type { BuilderContent } from '../../types/builder-content.js';
3
- export declare const getVariants: (content: Nullable<BuilderContent>) => {
4
- testVariationId: string | undefined;
5
- id: string | undefined;
6
- data?: {
7
- [key: string]: any;
8
- title?: string | undefined;
9
- blocks?: import("../../types/builder-block.js").BuilderBlock[] | undefined;
10
- inputs?: import("../../types/input.js").Input[] | undefined;
11
- state?: {
12
- [key: string]: any;
13
- } | undefined;
14
- jsCode?: string | undefined;
15
- tsCode?: string | undefined;
16
- httpRequests?: {
17
- [key: string]: string;
18
- } | undefined;
19
- } | undefined;
20
- name?: string | undefined;
21
- testRatio?: number | undefined;
22
- meta?: {
23
- [key: string]: any;
24
- breakpoints?: import("../../types/typescript.js").Nullable<import("../../types/builder-content.js").Breakpoints>;
25
- } | undefined;
26
- }[];
27
- export declare const checkShouldRunVariants: ({ canTrack, content }: {
28
- canTrack: Nullable<boolean>;
29
- content: Nullable<BuilderContent>;
30
- }) => boolean;
31
- type VariantData = {
32
- id: string;
33
- testRatio?: number;
34
- };
35
- export declare const getScriptString: () => string;
36
- export declare const getVariantsScriptString: (variants: VariantData[], contentId: string) => string;
37
- export declare const getRenderContentScriptString: ({ contentId, variationId }: {
38
- variationId: string;
39
- contentId: string;
40
- }) => string;
41
- export {};
@@ -1,6 +0,0 @@
1
- interface Props {
2
- scriptStr: string;
3
- id?: string;
4
- }
5
- export declare const InlinedScript: import("@builder.io/qwik").Component<Props>;
6
- export default InlinedScript;
@@ -1,6 +0,0 @@
1
- interface Props {
2
- styles: string;
3
- id?: string;
4
- }
5
- export declare const InlinedStyles: import("@builder.io/qwik").Component<Props>;
6
- export default InlinedStyles;
@@ -1,6 +0,0 @@
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[];
@@ -1,13 +0,0 @@
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 {};
@@ -1 +0,0 @@
1
- export declare const SDK_VERSION = "0.5.8";
@@ -1,2 +0,0 @@
1
- /** This file should be overriden for each framework. Ideally this would be implemented in Mitosis. */
2
- export declare const TARGET: import("../types/targets.js").Target;
@@ -1,2 +0,0 @@
1
- declare const _default: import("@builder.io/qwik").ContextId<any>;
2
- export default _default;
@@ -1,2 +0,0 @@
1
- declare const _default: import("@builder.io/qwik").ContextId<any>;
2
- export default _default;
@@ -1,35 +0,0 @@
1
- import type { BuilderContent } from '../types/builder-content.js';
2
- import type { ComponentInfo } from '../types/components.js';
3
- import type { Dictionary, Nullable } from '../types/typescript.js';
4
- import type { ApiVersion } from '../types/api-version.js';
5
- export type RegisteredComponent = ComponentInfo & {
6
- component: any;
7
- };
8
- export type RegisteredComponents = Dictionary<RegisteredComponent>;
9
- export type BuilderRenderState = Record<string, unknown>;
10
- export type BuilderRenderContext = Record<string, unknown>;
11
- export interface BuilderContextInterface {
12
- content: Nullable<BuilderContent>;
13
- context: BuilderRenderContext;
14
- /**
15
- * The state of the application.
16
- *
17
- * NOTE: see `localState` below to understand how it is different from `rootState`.
18
- */
19
- rootState: BuilderRenderState;
20
- /**
21
- * Some frameworks have a `setState` function which needs to be invoked to notify
22
- * the framework of state change. (other frameworks don't in which case it is `undefined')
23
- */
24
- rootSetState: ((rootState: BuilderRenderState) => void) | undefined;
25
- /**
26
- * The local state of the current component. This is different from `rootState` in that
27
- * it can be a child state created by a repeater containing local state.
28
- * The `rootState` is where all of the state mutations are actually stored.
29
- */
30
- localState: BuilderRenderState | undefined;
31
- apiKey: string | null;
32
- apiVersion: ApiVersion | undefined;
33
- componentInfos: Dictionary<ComponentInfo>;
34
- inheritedStyles: Record<string, unknown>;
35
- }
@@ -1,10 +0,0 @@
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;
@@ -1 +0,0 @@
1
- export declare const camelToKebabCase: (string: string) => string;
@@ -1,4 +0,0 @@
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: Record<string | symbol, any>, localState: Record<string | symbol, any> | undefined, rootSetState: ((rootState: BuilderRenderState) => void) | undefined): BuilderRenderState;
@@ -1 +0,0 @@
1
- export { runInBrowser as evaluator } from './browser.js';
@@ -1,2 +0,0 @@
1
- declare const _default: Class;
2
- export default _default;
@@ -1,2 +0,0 @@
1
- import type { ExecutorArgs } from '../helpers.js';
2
- export declare const runInEdge: ({ builder, context, event, rootState, localState, rootSetState, code }: ExecutorArgs) => any;
@@ -1 +0,0 @@
1
- export { runInEdge as evaluator } from './edge-runtime.js';
@@ -1,6 +0,0 @@
1
- import type { ExecutorArgs } from './helpers.js';
2
- export type EvaluatorArgs = Omit<ExecutorArgs, 'builder' | 'event'> & {
3
- event?: Event;
4
- isExpression?: boolean;
5
- };
6
- export declare function evaluate({ code, context, localState, rootState, rootSetState, event, isExpression }: EvaluatorArgs): any;
@@ -1,18 +0,0 @@
1
- import type { BuilderContextInterface, BuilderRenderState } from '../../context/types.js';
2
- import type { getUserAttributes } from '../track/helpers.js';
3
- export type BuilderGlobals = {
4
- isEditing: boolean | undefined;
5
- isBrowser: boolean | undefined;
6
- isServer: boolean | undefined;
7
- getUserAttributes: typeof getUserAttributes;
8
- };
9
- export type ExecutorArgs = Pick<BuilderContextInterface, 'localState' | 'context' | 'rootState' | 'rootSetState'> & {
10
- code: string;
11
- builder: BuilderGlobals;
12
- event: Event | undefined;
13
- };
14
- export type Executor = (args: ExecutorArgs) => any;
15
- export type FunctionArguments = ReturnType<typeof getFunctionArguments>;
16
- export declare const getFunctionArguments: ({ builder, context, event, state }: Pick<ExecutorArgs, "context" | "builder" | "event"> & {
17
- state: BuilderRenderState;
18
- }) => [string, Event | import("../../context/types.js").BuilderRenderContext | BuilderRenderState | BuilderGlobals | undefined][];
@@ -1 +0,0 @@
1
- export { evaluate } from './evaluate.js';
@@ -1 +0,0 @@
1
- export { evaluator } from '../browser-runtime/index.js';
@@ -1,2 +0,0 @@
1
- declare const _default: Class;
2
- export default _default;
@@ -1 +0,0 @@
1
- export { runInNonNode } from './non-node-runtime.js';
@@ -1,2 +0,0 @@
1
- import type { ExecutorArgs } from '../helpers.js';
2
- export declare const runInNonNode: ({ builder, context, event, rootState, localState, rootSetState, code }: ExecutorArgs) => any;
@@ -1,2 +0,0 @@
1
- import type { ExecutorArgs } from './helpers.js';
2
- export declare const evaluator: (_args: ExecutorArgs) => never;
@@ -1 +0,0 @@
1
- export declare const getEventHandlerName: (key: string) => string;
@@ -1,4 +0,0 @@
1
- /**
2
- * Extract styles that apply to text from a style object.
3
- */
4
- export declare const extractTextStyles: (styles: Partial<CSSStyleDeclaration>) => Partial<CSSStyleDeclaration>;
@@ -1,4 +0,0 @@
1
- /**
2
- * We need to serialize values to a string in case there are Proxy values, as is the case with SolidJS etc.
3
- */
4
- export declare const fastClone: <T extends object>(obj: T) => T;
@@ -1,40 +0,0 @@
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
- */
39
- export declare const fetchBuilderProps: (_args: GetBuilderPropsOptions) => Promise<ContentVariantsPrps>;
40
- export {};
@@ -1,5 +0,0 @@
1
- import type { BuilderContextInterface } from '../context/types.js';
2
- import type { BuilderBlock } from '../types/builder-block.js';
3
- export declare function createEventHandler(value: string, options: {
4
- block: BuilderBlock;
5
- } & Pick<BuilderContextInterface, 'localState' | 'context' | 'rootState' | 'rootSetState'>): (event: Event) => any;
@@ -1,10 +0,0 @@
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 {};
@@ -1,2 +0,0 @@
1
- import type { BuilderBlock } from '../types/builder-block.js';
2
- export declare function getBlockComponentOptions(block: BuilderBlock): any;
@@ -1,11 +0,0 @@
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 | undefined;
8
- style: string | Partial<CSSStyleDeclaration> | undefined;
9
- class: string;
10
- href: any;
11
- };
@@ -1,12 +0,0 @@
1
- type QueryObject = Record<string, string | string[]>;
2
- export declare const convertSearchParamsToQueryObject: (searchParams: URLSearchParams) => QueryObject;
3
- /**
4
- * Receives a `URLSearchParams` object or a regular query object, and returns the subset of query params that are
5
- * relevant to the Builder SDK.
6
- *
7
- * @returns
8
- */
9
- export declare const getBuilderSearchParams: (_options: QueryObject | URLSearchParams | undefined) => QueryObject;
10
- export declare const getBuilderSearchParamsFromWindow: () => QueryObject;
11
- export declare const normalizeSearchParams: (searchParams: QueryObject | URLSearchParams) => QueryObject;
12
- export {};
@@ -1,2 +0,0 @@
1
- import type { GetContentOptions } from './types.js';
2
- export declare const generateContentUrl: (options: GetContentOptions) => URL;
@@ -1,28 +0,0 @@
1
- import type { BuilderContent } from '../../types/builder-content.js';
2
- import type { GetContentOptions } from './types.js';
3
- /**
4
- * Returns a the first entry that matches the given options.
5
- */
6
- export declare function fetchOneEntry(options: GetContentOptions): Promise<BuilderContent | null>;
7
- /**
8
- * @deprecated `getContent` was renamed to `fetchOneEntry`. This is a temporary alias to avoid breaking changes.
9
- *
10
- * NOTE: consider using `fetchBuilderProps` instead for easier setup.
11
- */
12
- export declare const getContent: typeof fetchOneEntry;
13
- type ContentResults = {
14
- results: BuilderContent[];
15
- };
16
- /**
17
- * @internal Exported only for testing purposes. Do not use.
18
- */
19
- export declare const _processContentResult: (options: GetContentOptions, content: ContentResults, url?: URL) => Promise<ContentResults>;
20
- /**
21
- * Returns a paginated array of entries that match the given options.
22
- */
23
- export declare function fetchEntries(options: GetContentOptions): Promise<ContentResults | null>;
24
- /**
25
- * @deprecated `getAllContent` was renamed to `fetchEntries`. This is a temporary alias to avoid breaking changes.
26
- */
27
- export declare const getAllContent: typeof fetchEntries;
28
- export {};
@@ -1,51 +0,0 @@
1
- export interface GetContentOptions {
2
- /** The model to get content for */
3
- model: string;
4
- /** Your public API key */
5
- apiKey: string;
6
- /** Number of items to fetch. Default is 1 */
7
- limit?: number;
8
- /** User attributes to target on, such as { urlPath: '/foo', device: 'mobile', ...etc } */
9
- userAttributes?: (Record<string, string> & {
10
- urlPath?: string;
11
- }) | null;
12
- /** Custom query */
13
- query?: Record<string, any>;
14
- /**
15
- * Any other API options.
16
- * Accepts both a key/value object or a `URLSearchParams` instance
17
- * */
18
- options?: Record<string, any> | URLSearchParams;
19
- /**
20
- * If set to `true`, it will lazy load symbols/references.
21
- * If set to `false`, it will render the entire content tree eagerly.
22
- * @deprecated use `enrich` instead
23
- */
24
- noTraverse?: boolean;
25
- /**
26
- * If set to `false`, it will not use cookies to target content. Therefore, A/B Testing will be disabled and
27
- * only the default variation will be returned to every user.
28
- *
29
- * Defaults to `true`.
30
- */
31
- canTrack?: boolean;
32
- /**
33
- * Include references in the response. Defaults to `true`.
34
- * @deprecated use `enrich` instead
35
- */
36
- includeRefs?: boolean;
37
- /**
38
- * Include multilevel references in the response.
39
- */
40
- enrich?: boolean;
41
- /**
42
- * If provided, the API will auto-resolve localized objects to the value of this `locale` key.
43
- */
44
- locale?: string;
45
- /**
46
- * If provided, sets the Builder API version used to fetch content.
47
- *
48
- * Defaults to `v3`.
49
- */
50
- apiVersion?: 'v2' | 'v3';
51
- }
@@ -1 +0,0 @@
1
- export declare const fetch: typeof globalThis.fetch;
@@ -1,4 +0,0 @@
1
- /// <reference types="node" />
2
- type Global = typeof global | typeof window | typeof self | typeof globalThis;
3
- export declare function getGlobalThis(): Global;
4
- export {};
@@ -1,10 +0,0 @@
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;
@@ -1,7 +0,0 @@
1
- import type { BuilderContextInterface } from '../context/types.js';
2
- import type { BuilderBlock } from '../types/builder-block.js';
3
- export declare function getReactNativeBlockStyles({ block, context, blockStyles }: {
4
- block: BuilderBlock;
5
- context: BuilderContextInterface;
6
- blockStyles: any;
7
- }): CSSStyleDeclaration | Record<string, string | undefined>;
@@ -1 +0,0 @@
1
- export declare function isBrowser(): boolean;
@@ -1,4 +0,0 @@
1
- /**
2
- * Identifies edge runtimes (edge, workers, serverless, etc.)
3
- */
4
- export declare function isEdgeRuntime(): boolean;
@@ -1 +0,0 @@
1
- export declare function isEditing(): boolean;
@@ -1 +0,0 @@
1
- export declare function isIframe(): boolean;
@@ -1,4 +0,0 @@
1
- /**
2
- * Identifies non-node server runtimes (edge, workers, serverless, etc.)
3
- */
4
- export declare function isNonNodeServer(): boolean;
@@ -1 +0,0 @@
1
- export declare function isPreviewing(): boolean;
@@ -1,7 +0,0 @@
1
- export declare const onChangeProxySymbol: unique symbol;
2
- /**
3
- * Deeply observe an object and run a callback when it changes
4
- *
5
- * See ./on-change.test.ts for more info
6
- */
7
- export declare function onChange<T extends object = any>(obj: T, cb: () => void): T;
@@ -1,15 +0,0 @@
1
- import type { RegisteredComponent } from '../context/types.js';
2
- import type { ComponentInfo } from '../types/components.js';
3
- /**
4
- * @deprecated. Use the `customComponents` prop in RenderContent instead to provide your custom components to the builder SDK.
5
- */
6
- export declare const components: RegisteredComponent[];
7
- /**
8
- * @deprecated. Use the `customComponents` prop in RenderContent instead to provide your custom components to the builder SDK.
9
- */
10
- export declare function registerComponent(component: any, info: ComponentInfo): void;
11
- export declare const createRegisterComponentMessage: (info: ComponentInfo) => {
12
- type: string;
13
- data: ComponentInfo;
14
- };
15
- export declare const serializeComponentInfo: ({ inputs, ...info }: ComponentInfo) => ComponentInfo;
@@ -1,16 +0,0 @@
1
- import type { BuilderBlock } from '../types/builder-block.js';
2
- import type { DeepPartial } from '../types/deep-partial.js';
3
- export interface InsertMenuItem {
4
- name: string;
5
- icon?: string;
6
- item: DeepPartial<BuilderBlock>;
7
- }
8
- export interface InsertMenuConfig {
9
- name: string;
10
- priority?: number;
11
- persist?: boolean;
12
- advanced?: boolean;
13
- items: InsertMenuItem[];
14
- }
15
- export declare function register(type: 'insertMenu', info: InsertMenuConfig): void;
16
- export declare function register(type: string, info: any): void;
@@ -1,3 +0,0 @@
1
- type Styles = Record<string, string | number>;
2
- export declare const sanitizeReactNativeBlockStyles: (styles: Styles) => Styles;
3
- export {};
@@ -1,4 +0,0 @@
1
- export type Settings = {
2
- customInsertMenu?: boolean;
3
- };
4
- export declare function setEditorSettings(newSettings: Settings): void;
@@ -1,7 +0,0 @@
1
- /**
2
- * Minimal implementation of lodash's _.set
3
- * https://lodash.com/docs/4.17.15#set
4
- *
5
- * See ./set.test.ts for usage examples
6
- */
7
- export declare const set: (obj: any, _path: string | string[], value: any) => any;
@@ -1,5 +0,0 @@
1
- export declare const getUserAttributes: () => {
2
- urlPath: string | undefined;
3
- host: string | undefined;
4
- device: string;
5
- };
@@ -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 | undefined;
7
- metadata: {
8
- targetOffset: Offset | undefined;
9
- builderTargetOffset: Offset | undefined;
10
- builderElementIndex: number | undefined;
11
- };
12
- };
13
- export {};
@@ -1 +0,0 @@
1
- export declare function transformBlockProperties<T>(properties: T): T;
@@ -1,2 +0,0 @@
1
- import type { BuilderBlock } from '../types/builder-block.js';
2
- export declare function transformBlock(block: BuilderBlock): BuilderBlock;