@builder.io/sdk-qwik 0.5.7 → 0.5.9

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 (39) hide show
  1. package/lib/index.qwik.cjs +127 -137
  2. package/lib/index.qwik.mjs +128 -138
  3. package/package.json +1 -1
  4. package/types/components/content/content.types.d.ts +2 -2
  5. package/types/components/content-variants/content-variants.d.ts +2 -2
  6. package/types/components/content-variants/content-variants.types.d.ts +1 -1
  7. package/types/constants/sdk-version.d.ts +1 -1
  8. package/types/functions/evaluate/browser-runtime/browser.d.ts +4 -0
  9. package/types/functions/evaluate/browser-runtime/index.d.ts +1 -0
  10. package/types/functions/evaluate/evaluate.d.ts +4 -8
  11. package/types/functions/evaluate/helpers.d.ts +18 -0
  12. package/types/functions/evaluate/index.d.ts +1 -1
  13. package/types/functions/evaluate/node-runtime/index.d.ts +1 -0
  14. package/types/functions/evaluate/non-node-runtime/acorn-interpreter.d.ts +2 -0
  15. package/types/functions/evaluate/non-node-runtime/non-node-runtime.d.ts +2 -2
  16. package/types/functions/fetch-builder-props.d.ts +2 -2
  17. package/types/index-helpers/blocks-exports.d.ts +1 -1
  18. package/types/index.d.ts +5 -14
  19. package/types/server-index.d.ts +15 -0
  20. package/types/src/components/block/components/component-ref/component-ref.helpers.d.ts +1 -1
  21. package/types/src/components/blocks/blocks.d.ts +1 -1
  22. package/types/src/components/content/content.types.d.ts +2 -2
  23. package/types/src/components/content/index.d.ts +1 -1
  24. package/types/src/components/content-variants/content-variants.d.ts +2 -2
  25. package/types/src/components/content-variants/content-variants.types.d.ts +1 -1
  26. package/types/src/constants/sdk-version.d.ts +1 -1
  27. package/types/src/constants/target.d.ts +1 -1
  28. package/types/src/functions/evaluate/evaluate.d.ts +4 -8
  29. package/types/src/functions/evaluate/index.d.ts +1 -1
  30. package/types/src/functions/evaluate/node-runtime/index.d.ts +1 -1
  31. package/types/src/functions/evaluate/non-node-runtime/index.d.ts +1 -1
  32. package/types/src/functions/evaluate/non-node-runtime/non-node-runtime.d.ts +2 -2
  33. package/types/src/functions/evaluate/placeholder-runtime.d.ts +1 -1
  34. package/types/src/functions/fetch-builder-props.d.ts +4 -4
  35. package/types/src/helpers/preview-lru-cache/get.d.ts +1 -1
  36. package/types/src/helpers/preview-lru-cache/set.d.ts +1 -1
  37. package/types/src/index-helpers/blocks-exports.d.ts +12 -12
  38. package/types/src/index.d.ts +5 -14
  39. package/types/src/server-index.d.ts +15 -0
@@ -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 { 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,7 +1,7 @@
1
1
  import type { BuilderContextInterface, RegisteredComponents } from '../../../../context/types.js';
2
2
  import type { BuilderBlock } from '../../../../types/builder-block.js';
3
3
  import type { PropsWithBuilderData } from '../../../../types/builder-props.js';
4
- import type { InteractiveElementProps } from '../interactive-element';
4
+ import type { InteractiveElementProps } from '../interactive-element.jsx';
5
5
  type ComponentOptions = PropsWithBuilderData<{
6
6
  [index: string]: any;
7
7
  attributes?: {
@@ -1,5 +1,5 @@
1
1
  import { BuilderContextInterface, RegisteredComponents } from "../../context/types.js";
2
- import { BlocksWrapperProps } from "./blocks-wrapper";
2
+ import { BlocksWrapperProps } from "./blocks-wrapper.jsx";
3
3
  export type BlocksProps = Partial<BlocksWrapperProps> & {
4
4
  context?: BuilderContextInterface;
5
5
  registeredComponents?: RegisteredComponents;
@@ -1,6 +1,6 @@
1
1
  import type { BuilderRenderState } from '../../context/types.js';
2
2
  import type { EnforcePartials } from '../../types/enforced-partials.js';
3
- import type { ContentVariantsProps } from '../content-variants/content-variants.types.js';
3
+ import type { ContentVariantsPrps } from '../content-variants/content-variants.types.js';
4
4
  interface InternalRenderProps {
5
5
  /**
6
6
  * TO-DO: improve qwik generator to not remap this name for non-HTML tags, then name it `className`
@@ -9,7 +9,7 @@ interface InternalRenderProps {
9
9
  showContent: boolean;
10
10
  isSsrAbTest: boolean;
11
11
  }
12
- export type ContentProps = InternalRenderProps & EnforcePartials<ContentVariantsProps>;
12
+ export type ContentProps = InternalRenderProps & EnforcePartials<ContentVariantsPrps>;
13
13
  export interface BuilderComponentStateChange {
14
14
  state: BuilderRenderState;
15
15
  ref: {
@@ -1 +1 @@
1
- export { default } from './content';
1
+ export { default } from './content.jsx';
@@ -1,5 +1,5 @@
1
- import { ContentVariantsProps } from "./content-variants.types.js";
2
- type VariantsProviderProps = ContentVariantsProps & {
1
+ import { ContentVariantsPrps } from "./content-variants.types.js";
2
+ type VariantsProviderProps = ContentVariantsPrps & {
3
3
  /**
4
4
  * For internal use only. Do not provide this prop.
5
5
  */
@@ -2,7 +2,7 @@ import type { BuilderRenderContext, RegisteredComponent } from '../../context/ty
2
2
  import type { ApiVersion } from '../../types/api-version.js';
3
3
  import type { BuilderContent } from '../../types/builder-content.js';
4
4
  import type { Nullable } from '../../types/typescript.js';
5
- export interface ContentVariantsProps {
5
+ export interface ContentVariantsPrps {
6
6
  content?: Nullable<BuilderContent>;
7
7
  model?: string;
8
8
  data?: {
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "UNKNOWN_VERSION";
1
+ export declare const SDK_VERSION = "0.5.8";
@@ -1,2 +1,2 @@
1
1
  /** This file should be overriden for each framework. Ideally this would be implemented in Mitosis. */
2
- export declare const TARGET: import("../types/targets").Target;
2
+ export declare const TARGET: import("../types/targets.js").Target;
@@ -1,10 +1,6 @@
1
- import type { BuilderContextInterface, BuilderRenderState } from '../../context/types.js';
2
- import type { ExecutorArgs } from './types.js';
3
- export declare function evaluate({ code, context, localState, rootState, rootSetState, event, isExpression }: {
4
- code: string;
1
+ import type { ExecutorArgs } from './helpers.js';
2
+ export type EvaluatorArgs = Omit<ExecutorArgs, 'builder' | 'event'> & {
5
3
  event?: Event;
6
4
  isExpression?: boolean;
7
- } & Pick<BuilderContextInterface, 'localState' | 'context' | 'rootState' | 'rootSetState'>): any;
8
- export declare const runInBrowser: ({ useCode, builder, context, event, localState, rootSetState, rootState }: ExecutorArgs) => any;
9
- export declare const runInNode: (args: ExecutorArgs) => any;
10
- export declare function flattenState(rootState: Record<string | symbol, any>, localState: Record<string | symbol, any> | undefined, rootSetState: ((rootState: BuilderRenderState) => void) | undefined): BuilderRenderState;
5
+ };
6
+ export declare function evaluate({ code, context, localState, rootState, rootSetState, event, isExpression }: EvaluatorArgs): any;
@@ -1 +1 @@
1
- export { evaluate } from './evaluate';
1
+ export { evaluate } from './evaluate.js';
@@ -1 +1 @@
1
- export { runInNode as evaluator } from './node-runtime.js';
1
+ export { evaluator } from '../browser-runtime/index.js';
@@ -1 +1 @@
1
- export { runInNonNode } from './non-node-runtime.js';
1
+ export { runInNonNode as evaluator } from './non-node-runtime.js';
@@ -1,2 +1,2 @@
1
- import type { ExecutorArgs } from '../types';
2
- export declare const runInNonNode: ({ builder, context, event, rootState, localState, rootSetState, useCode }: ExecutorArgs) => any;
1
+ import type { ExecutorArgs } from '../helpers.js';
2
+ export declare const runInNonNode: ({ builder, context, event, rootState, localState, rootSetState, code }: ExecutorArgs) => any;
@@ -1,2 +1,2 @@
1
- import type { ExecutorArgs } from './helpers';
1
+ import type { ExecutorArgs } from './helpers.js';
2
2
  export declare const evaluator: (_args: ExecutorArgs) => never;
@@ -1,6 +1,6 @@
1
- import type { ContentVariantsProps } from '../components/content-variants/content-variants.types';
2
- import type { Dictionary } from '../types/typescript';
3
- import type { GetContentOptions } from './get-content/types';
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
4
  type GetBuilderPropsOptions = (Omit<GetContentOptions, 'model'> & {
5
5
  model?: string;
6
6
  }) & ({
@@ -35,5 +35,5 @@ type GetBuilderPropsOptions = (Omit<GetContentOptions, 'model'> & {
35
35
  /**
36
36
  * Fetches builder content, and returns it along with sensible defaults for other props that `Content` needs to render.
37
37
  */
38
- export declare const fetchBuilderProps: (_args: GetBuilderPropsOptions) => Promise<ContentVariantsProps>;
38
+ export declare const fetchBuilderProps: (_args: GetBuilderPropsOptions) => Promise<ContentVariantsPrps>;
39
39
  export {};
@@ -1,2 +1,2 @@
1
- import type { BuilderContent } from '../../types/builder-content';
1
+ import type { BuilderContent } from '../../types/builder-content.js';
2
2
  export declare function getPreviewContent(_searchParams: URLSearchParams): BuilderContent | undefined;
@@ -1,4 +1,4 @@
1
- import type { BuilderContent } from '../../types/builder-content';
1
+ import type { BuilderContent } from '../../types/builder-content.js';
2
2
  export declare function postPreviewContent({ key, value }: {
3
3
  key: string;
4
4
  value: BuilderContent;
@@ -1,21 +1,21 @@
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';
1
+ export { default as Button } from '../blocks/button/button.jsx';
2
+ export { default as Columns } from '../blocks/columns/columns.jsx';
3
+ export { default as Fragment } from '../blocks/fragment/fragment.jsx';
4
+ export { default as Image } from '../blocks/image/image.jsx';
5
+ export { default as Section } from '../blocks/section/section.jsx';
6
+ export { default as Symbol } from '../blocks/symbol/symbol.jsx';
7
+ export { default as Text } from '../blocks/text/text.jsx';
8
+ export { default as Video } from '../blocks/video/video.jsx';
9
+ import { default as Blocks } from '../components/blocks/blocks.jsx';
10
+ import { default as Content } from '../components/content-variants/content-variants.jsx';
11
11
  export { Blocks, Content };
12
12
  /**
13
13
  * @deprecated Use `Blocks` instead.
14
14
  */
15
- export declare const RenderBlocks: import("@builder.io/qwik").Component<import("../components/blocks/blocks").BlocksProps>;
15
+ export declare const RenderBlocks: import("@builder.io/qwik").Component<import("../components/blocks/blocks.jsx").BlocksProps>;
16
16
  /**
17
17
  * @deprecated Use `Content` instead.
18
18
  */
19
- export declare const RenderContent: import("@builder.io/qwik").Component<import("../components/content-variants/content-variants.types").ContentVariantsProps & {
19
+ export declare const RenderContent: import("@builder.io/qwik").Component<import("../components/content-variants/content-variants.types.js").ContentVariantsPrps & {
20
20
  __isNestedRender?: boolean | undefined;
21
21
  }>;
@@ -1,16 +1,7 @@
1
1
  export * from './index-helpers/top-of-file.js';
2
2
  export * from './index-helpers/blocks-exports.js';
3
- export { isEditing } from './functions/is-editing.js';
4
- export { isPreviewing } from './functions/is-previewing.js';
5
- export { createRegisterComponentMessage } from './functions/register-component.js';
6
- export { register } from './functions/register.js';
7
- export type { InsertMenuConfig, InsertMenuItem } from './functions/register.js';
8
- export { setEditorSettings } from './functions/set-editor-settings.js';
9
- export type { Settings } from './functions/set-editor-settings.js';
10
- export { fetchEntries, fetchOneEntry, getAllContent, getContent, _processContentResult } from './functions/get-content/index.js';
11
- export { getBuilderSearchParams } from './functions/get-builder-search-params/index.js';
12
- export { track } from './functions/track/index.js';
13
- export type { RegisteredComponent } from './context/types';
14
- export type { ComponentInfo } from './types/components';
15
- export type { ContentProps } from './components/content/content.types.js';
16
- export { fetchBuilderProps } from './functions/fetch-builder-props.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 { 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';