@uniformdev/canvas-next-rsc 19.211.1-alpha.2 → 19.212.2-alpha.2

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.
@@ -1,6 +1,7 @@
1
+ import * as React$1 from 'react';
2
+ import { ComponentType, ReactNode } from 'react';
1
3
  import { ResolvedRouteGetResponse, ComponentInstance } from '@uniformdev/canvas';
2
4
  import { PageParameters, ComponentProps, CompositionContext, AppDirectoryServerContext } from '@uniformdev/canvas-next-rsc-shared';
3
- import React, { ComponentType, ReactNode } from 'react';
4
5
 
5
6
  type UniformStaticCompositionProps = {
6
7
  /**
@@ -56,7 +57,7 @@ type ResolveEmptyPlaceholderResult = {
56
57
  declare const resolveComposition: (props: Omit<ResolveComponentsOptions, "slotName" | "slotIndex" | "target"> & {
57
58
  composition: ComponentInstance;
58
59
  compositionContext: CompositionContext;
59
- }) => React.FunctionComponentElement<{
60
+ }) => React$1.FunctionComponentElement<{
60
61
  children?: ReactNode | undefined;
61
62
  }> | null;
62
63
  type ResolveComponentsOptions = {
@@ -1,6 +1,7 @@
1
+ import * as React$1 from 'react';
2
+ import { ComponentType, ReactNode } from 'react';
1
3
  import { ResolvedRouteGetResponse, ComponentInstance } from '@uniformdev/canvas';
2
4
  import { PageParameters, ComponentProps, CompositionContext, AppDirectoryServerContext } from '@uniformdev/canvas-next-rsc-shared';
3
- import React, { ComponentType, ReactNode } from 'react';
4
5
 
5
6
  type UniformStaticCompositionProps = {
6
7
  /**
@@ -56,7 +57,7 @@ type ResolveEmptyPlaceholderResult = {
56
57
  declare const resolveComposition: (props: Omit<ResolveComponentsOptions, "slotName" | "slotIndex" | "target"> & {
57
58
  composition: ComponentInstance;
58
59
  compositionContext: CompositionContext;
59
- }) => React.FunctionComponentElement<{
60
+ }) => React$1.FunctionComponentElement<{
60
61
  children?: ReactNode | undefined;
61
62
  }> | null;
62
63
  type ResolveComponentsOptions = {
@@ -1,18 +1,18 @@
1
1
  import { ComponentProps, CompositionContext, SlotDefinition } from '@uniformdev/canvas-next-rsc-shared';
2
2
  export { ComponentProps, CompositionContext } from '@uniformdev/canvas-next-rsc-shared';
3
- import React, { PropsWithChildren, ReactNode, Key, JSX } from 'react';
4
- export { R as ResolveComponentFunction, a as ResolveComponentResult } from './UniformComposition-D_HC6rSo.mjs';
3
+ import React__default, { PropsWithChildren, ReactNode, Key } from 'react';
4
+ export { R as ResolveComponentFunction, a as ResolveComponentResult } from './UniformComposition-IWWzoI_H.mjs';
5
5
  import { ComponentInstance } from '@uniformdev/canvas';
6
6
  import { RichTextNode } from '@uniformdev/richtext';
7
7
  import { PureUniformTextProps } from '@uniformdev/canvas-react/core';
8
8
  export { ClientContextComponent, createClientUniformContext, useInitUniformContext, useUniformContext } from '@uniformdev/canvas-next-rsc-client';
9
9
 
10
- declare const DefaultNotImplementedComponent: ({ component }: ComponentProps) => React.JSX.Element | null;
10
+ declare const DefaultNotImplementedComponent: ({ component }: ComponentProps) => React__default.JSX.Element | null;
11
11
 
12
12
  type RichTextComponentProps<TNode extends RichTextNode = RichTextNode> = {
13
13
  node: TNode;
14
14
  };
15
- type RichTextRendererComponent<TNode extends RichTextNode = RichTextNode> = React.ComponentType<PropsWithChildren<RichTextComponentProps<TNode>>>;
15
+ type RichTextRendererComponent<TNode extends RichTextNode = RichTextNode> = React__default.ComponentType<PropsWithChildren<RichTextComponentProps<TNode>>>;
16
16
  /**
17
17
  * Function that maps a Rich Text node instance to its React component to render it.
18
18
  * The resolver would commonly inspect the `type` of the component to decide.
@@ -24,7 +24,7 @@ type UniformRichTextProps = {
24
24
  * The name of the HTML tag to render.
25
25
  * @default "div"
26
26
  */
27
- as?: React.ElementType;
27
+ as?: React__default.ElementType;
28
28
  /** The ID of the parameter. */
29
29
  parameterId: string;
30
30
  /**
@@ -43,16 +43,16 @@ type UniformRichTextProps = {
43
43
  placeholder?: string | ((parameter: {
44
44
  id: string;
45
45
  }) => string | undefined);
46
- } & Omit<React.HTMLAttributes<HTMLDivElement>, 'children' | 'placeholder'>;
46
+ } & Omit<React__default.HTMLAttributes<HTMLDivElement>, 'children' | 'placeholder'>;
47
47
  /**
48
48
  * Adds rendering support for Uniform Rich Text parameters
49
49
  */
50
- declare const UniformRichText: React.ForwardRefExoticComponent<{
50
+ declare const UniformRichText: React__default.ForwardRefExoticComponent<{
51
51
  /**
52
52
  * The name of the HTML tag to render.
53
53
  * @default "div"
54
54
  */
55
- as?: React.ElementType;
55
+ as?: React__default.ElementType;
56
56
  /** The ID of the parameter. */
57
57
  parameterId: string;
58
58
  /**
@@ -71,7 +71,7 @@ declare const UniformRichText: React.ForwardRefExoticComponent<{
71
71
  placeholder?: string | ((parameter: {
72
72
  id: string;
73
73
  }) => string | undefined);
74
- } & Omit<React.HTMLAttributes<HTMLDivElement>, "children" | "placeholder"> & React.RefAttributes<unknown>>;
74
+ } & Omit<React__default.HTMLAttributes<HTMLDivElement>, "children" | "placeholder"> & React__default.RefAttributes<unknown>>;
75
75
 
76
76
  type UniformRichTextNodeProps = {
77
77
  node: RichTextNode;
@@ -80,7 +80,7 @@ type UniformRichTextNodeProps = {
80
80
  /**
81
81
  * Render a single RichText node
82
82
  */
83
- declare function UniformRichTextNode({ node, ...props }: UniformRichTextNodeProps): React.JSX.Element | null;
83
+ declare function UniformRichTextNode({ node, ...props }: UniformRichTextNodeProps): React__default.JSX.Element | null;
84
84
 
85
85
  type CustomSlotChildRenderFunc = (options: {
86
86
  child: ReactNode;
@@ -100,6 +100,6 @@ declare const UniformSlot: ({ data, slot, children }: UniformSlotProps) => React
100
100
  type UniformTextProps = {
101
101
  context: Pick<CompositionContext, 'isContextualEditing'>;
102
102
  } & Omit<PureUniformTextProps, 'skipCustomRendering' | 'isContextualEditing'>;
103
- declare const UniformText: ({ context, ...rest }: UniformTextProps) => React.JSX.Element;
103
+ declare const UniformText: ({ context, ...rest }: UniformTextProps) => React__default.JSX.Element;
104
104
 
105
105
  export { type CustomSlotChildRenderFunc, DefaultNotImplementedComponent, UniformRichText, UniformRichTextNode, type UniformRichTextNodeProps, type UniformRichTextProps, UniformSlot, type UniformSlotProps, UniformText, type UniformTextProps };
@@ -1,18 +1,18 @@
1
1
  import { ComponentProps, CompositionContext, SlotDefinition } from '@uniformdev/canvas-next-rsc-shared';
2
2
  export { ComponentProps, CompositionContext } from '@uniformdev/canvas-next-rsc-shared';
3
- import React, { PropsWithChildren, ReactNode, Key, JSX } from 'react';
4
- export { R as ResolveComponentFunction, a as ResolveComponentResult } from './UniformComposition-D_HC6rSo.js';
3
+ import React__default, { PropsWithChildren, ReactNode, Key } from 'react';
4
+ export { R as ResolveComponentFunction, a as ResolveComponentResult } from './UniformComposition-IWWzoI_H.js';
5
5
  import { ComponentInstance } from '@uniformdev/canvas';
6
6
  import { RichTextNode } from '@uniformdev/richtext';
7
7
  import { PureUniformTextProps } from '@uniformdev/canvas-react/core';
8
8
  export { ClientContextComponent, createClientUniformContext, useInitUniformContext, useUniformContext } from '@uniformdev/canvas-next-rsc-client';
9
9
 
10
- declare const DefaultNotImplementedComponent: ({ component }: ComponentProps) => React.JSX.Element | null;
10
+ declare const DefaultNotImplementedComponent: ({ component }: ComponentProps) => React__default.JSX.Element | null;
11
11
 
12
12
  type RichTextComponentProps<TNode extends RichTextNode = RichTextNode> = {
13
13
  node: TNode;
14
14
  };
15
- type RichTextRendererComponent<TNode extends RichTextNode = RichTextNode> = React.ComponentType<PropsWithChildren<RichTextComponentProps<TNode>>>;
15
+ type RichTextRendererComponent<TNode extends RichTextNode = RichTextNode> = React__default.ComponentType<PropsWithChildren<RichTextComponentProps<TNode>>>;
16
16
  /**
17
17
  * Function that maps a Rich Text node instance to its React component to render it.
18
18
  * The resolver would commonly inspect the `type` of the component to decide.
@@ -24,7 +24,7 @@ type UniformRichTextProps = {
24
24
  * The name of the HTML tag to render.
25
25
  * @default "div"
26
26
  */
27
- as?: React.ElementType;
27
+ as?: React__default.ElementType;
28
28
  /** The ID of the parameter. */
29
29
  parameterId: string;
30
30
  /**
@@ -43,16 +43,16 @@ type UniformRichTextProps = {
43
43
  placeholder?: string | ((parameter: {
44
44
  id: string;
45
45
  }) => string | undefined);
46
- } & Omit<React.HTMLAttributes<HTMLDivElement>, 'children' | 'placeholder'>;
46
+ } & Omit<React__default.HTMLAttributes<HTMLDivElement>, 'children' | 'placeholder'>;
47
47
  /**
48
48
  * Adds rendering support for Uniform Rich Text parameters
49
49
  */
50
- declare const UniformRichText: React.ForwardRefExoticComponent<{
50
+ declare const UniformRichText: React__default.ForwardRefExoticComponent<{
51
51
  /**
52
52
  * The name of the HTML tag to render.
53
53
  * @default "div"
54
54
  */
55
- as?: React.ElementType;
55
+ as?: React__default.ElementType;
56
56
  /** The ID of the parameter. */
57
57
  parameterId: string;
58
58
  /**
@@ -71,7 +71,7 @@ declare const UniformRichText: React.ForwardRefExoticComponent<{
71
71
  placeholder?: string | ((parameter: {
72
72
  id: string;
73
73
  }) => string | undefined);
74
- } & Omit<React.HTMLAttributes<HTMLDivElement>, "children" | "placeholder"> & React.RefAttributes<unknown>>;
74
+ } & Omit<React__default.HTMLAttributes<HTMLDivElement>, "children" | "placeholder"> & React__default.RefAttributes<unknown>>;
75
75
 
76
76
  type UniformRichTextNodeProps = {
77
77
  node: RichTextNode;
@@ -80,7 +80,7 @@ type UniformRichTextNodeProps = {
80
80
  /**
81
81
  * Render a single RichText node
82
82
  */
83
- declare function UniformRichTextNode({ node, ...props }: UniformRichTextNodeProps): React.JSX.Element | null;
83
+ declare function UniformRichTextNode({ node, ...props }: UniformRichTextNodeProps): React__default.JSX.Element | null;
84
84
 
85
85
  type CustomSlotChildRenderFunc = (options: {
86
86
  child: ReactNode;
@@ -100,6 +100,6 @@ declare const UniformSlot: ({ data, slot, children }: UniformSlotProps) => React
100
100
  type UniformTextProps = {
101
101
  context: Pick<CompositionContext, 'isContextualEditing'>;
102
102
  } & Omit<PureUniformTextProps, 'skipCustomRendering' | 'isContextualEditing'>;
103
- declare const UniformText: ({ context, ...rest }: UniformTextProps) => React.JSX.Element;
103
+ declare const UniformText: ({ context, ...rest }: UniformTextProps) => React__default.JSX.Element;
104
104
 
105
105
  export { type CustomSlotChildRenderFunc, DefaultNotImplementedComponent, UniformRichText, UniformRichTextNode, type UniformRichTextNodeProps, type UniformRichTextProps, UniformSlot, type UniformSlotProps, UniformText, type UniformTextProps };
package/dist/config.js CHANGED
@@ -28,58 +28,31 @@ var import_path = require("path");
28
28
  var getConfigPath = () => {
29
29
  const possibleExtensions = [".js", ".cjs", ".mjs", ".ts"];
30
30
  let configFilePath;
31
- let configFileName;
32
31
  for (const extension of possibleExtensions) {
33
- const fileName = `uniform.server.config${extension}`;
34
- const filePath = (0, import_path.join)(process.cwd(), fileName);
32
+ const filePath = (0, import_path.join)(process.cwd(), `uniform.server.config${extension}`);
35
33
  if ((0, import_fs.existsSync)(filePath)) {
36
34
  configFilePath = filePath;
37
- configFileName = fileName;
38
35
  break;
39
36
  }
40
37
  }
41
- if (!configFilePath) {
42
- return void 0;
43
- }
44
- return {
45
- filePath: configFilePath,
46
- fileName: configFileName
47
- };
38
+ return configFilePath;
48
39
  };
49
- var withUniformConfig = (nextConfig) => {
50
- var _a, _b, _c;
51
- const { fileName: uniformConfigFileName } = getConfigPath() || {};
52
- const turboResolveAliases = {
53
- ...((_b = (_a = nextConfig.experimental) == null ? void 0 : _a.turbo) == null ? void 0 : _b.resolveAlias) || {}
54
- };
55
- if (uniformConfigFileName) {
56
- console.log("(Turbo) Using Uniform config from", uniformConfigFileName);
57
- turboResolveAliases["uniform.server.config"] = `./${uniformConfigFileName}`;
58
- }
59
- return {
60
- ...nextConfig,
61
- experimental: {
62
- ...nextConfig.experimental || {},
63
- turbo: {
64
- ...((_c = nextConfig.experimental) == null ? void 0 : _c.turbo) || {},
65
- resolveAlias: turboResolveAliases
66
- }
67
- },
68
- webpack: (config, context) => {
69
- if (nextConfig.webpack) {
70
- nextConfig.webpack(config, context);
71
- }
72
- if (context.isServer) {
73
- const { filePath: uniformConfigPath } = getConfigPath() || {};
74
- if (uniformConfigPath) {
75
- console.log("Using Uniform config from", uniformConfigPath);
76
- config.resolve.alias["uniform.server.config"] = (0, import_path.resolve)(config.context, uniformConfigPath);
77
- }
40
+ var withUniformConfig = (nextConfig) => ({
41
+ ...nextConfig,
42
+ webpack: (config, context) => {
43
+ if (nextConfig.webpack) {
44
+ nextConfig.webpack(config, context);
45
+ }
46
+ if (context.isServer) {
47
+ const uniformConfigPath = getConfigPath();
48
+ if (uniformConfigPath) {
49
+ console.log("Using Uniform config from", uniformConfigPath);
50
+ config.resolve.alias["uniform.server.config"] = (0, import_path.resolve)(config.context, uniformConfigPath);
78
51
  }
79
- return config;
80
52
  }
81
- };
82
- };
53
+ return config;
54
+ }
55
+ });
83
56
  // Annotate the CommonJS export names for ESM import in node:
84
57
  0 && (module.exports = {
85
58
  withUniformConfig
package/dist/config.mjs CHANGED
@@ -4,58 +4,31 @@ import { join, resolve } from "path";
4
4
  var getConfigPath = () => {
5
5
  const possibleExtensions = [".js", ".cjs", ".mjs", ".ts"];
6
6
  let configFilePath;
7
- let configFileName;
8
7
  for (const extension of possibleExtensions) {
9
- const fileName = `uniform.server.config${extension}`;
10
- const filePath = join(process.cwd(), fileName);
8
+ const filePath = join(process.cwd(), `uniform.server.config${extension}`);
11
9
  if (existsSync(filePath)) {
12
10
  configFilePath = filePath;
13
- configFileName = fileName;
14
11
  break;
15
12
  }
16
13
  }
17
- if (!configFilePath) {
18
- return void 0;
19
- }
20
- return {
21
- filePath: configFilePath,
22
- fileName: configFileName
23
- };
14
+ return configFilePath;
24
15
  };
25
- var withUniformConfig = (nextConfig) => {
26
- var _a, _b, _c;
27
- const { fileName: uniformConfigFileName } = getConfigPath() || {};
28
- const turboResolveAliases = {
29
- ...((_b = (_a = nextConfig.experimental) == null ? void 0 : _a.turbo) == null ? void 0 : _b.resolveAlias) || {}
30
- };
31
- if (uniformConfigFileName) {
32
- console.log("(Turbo) Using Uniform config from", uniformConfigFileName);
33
- turboResolveAliases["uniform.server.config"] = `./${uniformConfigFileName}`;
34
- }
35
- return {
36
- ...nextConfig,
37
- experimental: {
38
- ...nextConfig.experimental || {},
39
- turbo: {
40
- ...((_c = nextConfig.experimental) == null ? void 0 : _c.turbo) || {},
41
- resolveAlias: turboResolveAliases
42
- }
43
- },
44
- webpack: (config, context) => {
45
- if (nextConfig.webpack) {
46
- nextConfig.webpack(config, context);
47
- }
48
- if (context.isServer) {
49
- const { filePath: uniformConfigPath } = getConfigPath() || {};
50
- if (uniformConfigPath) {
51
- console.log("Using Uniform config from", uniformConfigPath);
52
- config.resolve.alias["uniform.server.config"] = resolve(config.context, uniformConfigPath);
53
- }
16
+ var withUniformConfig = (nextConfig) => ({
17
+ ...nextConfig,
18
+ webpack: (config, context) => {
19
+ if (nextConfig.webpack) {
20
+ nextConfig.webpack(config, context);
21
+ }
22
+ if (context.isServer) {
23
+ const uniformConfigPath = getConfigPath();
24
+ if (uniformConfigPath) {
25
+ console.log("Using Uniform config from", uniformConfigPath);
26
+ config.resolve.alias["uniform.server.config"] = resolve(config.context, uniformConfigPath);
54
27
  }
55
- return config;
56
28
  }
57
- };
58
- };
29
+ return config;
30
+ }
31
+ });
59
32
  export {
60
33
  withUniformConfig
61
34
  };
package/dist/handler.js CHANGED
@@ -101,14 +101,14 @@ var createPreviewGETRouteHandler = (options) => {
101
101
  return new Response("Could not resolve the full path of the preview page", { status: 400 });
102
102
  }
103
103
  if (disable) {
104
- (await (0, import_headers.draftMode)()).disable();
104
+ (0, import_headers.draftMode)().disable();
105
105
  (0, import_navigation.redirect)(pathToRedirectTo);
106
106
  return;
107
107
  }
108
108
  if (secret !== process.env.UNIFORM_PREVIEW_SECRET) {
109
109
  return new Response("Invalid preview secret", { status: 401 });
110
110
  }
111
- (await (0, import_headers.draftMode)()).enable();
111
+ (0, import_headers.draftMode)().enable();
112
112
  const redirectionUrl = new URL(pathToRedirectTo, BASE_URL_EXAMPLE);
113
113
  assignRequestQueryToSearchParams(redirectionUrl.searchParams, searchParams);
114
114
  if (isPlayground || (options == null ? void 0 : options.playgroundPath) && pathToRedirectTo === options.playgroundPath) {
package/dist/handler.mjs CHANGED
@@ -68,14 +68,14 @@ var createPreviewGETRouteHandler = (options) => {
68
68
  return new Response("Could not resolve the full path of the preview page", { status: 400 });
69
69
  }
70
70
  if (disable) {
71
- (await draftMode()).disable();
71
+ draftMode().disable();
72
72
  redirect(pathToRedirectTo);
73
73
  return;
74
74
  }
75
75
  if (secret !== process.env.UNIFORM_PREVIEW_SECRET) {
76
76
  return new Response("Invalid preview secret", { status: 401 });
77
77
  }
78
- (await draftMode()).enable();
78
+ draftMode().enable();
79
79
  const redirectionUrl = new URL(pathToRedirectTo, BASE_URL_EXAMPLE);
80
80
  assignRequestQueryToSearchParams(redirectionUrl.searchParams, searchParams);
81
81
  if (isPlayground || (options == null ? void 0 : options.playgroundPath) && pathToRedirectTo === options.playgroundPath) {
package/dist/index.d.mts CHANGED
@@ -1,26 +1,32 @@
1
1
  import { CanvasClient, RouteClient, ResolvedRouteGetResponse, CompositionGetBySlugParameters, RouteGetParameters } from '@uniformdev/canvas';
2
- import { UniformServerConfig, CompositionContext, AppDirectoryContextState, AppDirectoryServerContext, PlaygroundParameters, AwaitedPageParameters, PageParameters } from '@uniformdev/canvas-next-rsc-shared';
2
+ import { UniformServerConfig, PageParameters, AppDirectoryContextState, AppDirectoryServerContext, PlaygroundParameters } from '@uniformdev/canvas-next-rsc-shared';
3
3
  export { PageParameters, PlaygroundParameters } from '@uniformdev/canvas-next-rsc-shared';
4
4
  import { ManifestClient } from '@uniformdev/context/api';
5
5
  import { ProjectMapClient, ProjectMapNode } from '@uniformdev/project-map';
6
6
  import { ContextState, ContextOptions } from '@uniformdev/context';
7
- import React, { PropsWithChildren } from 'react';
8
- import { U as UniformCompositionProps } from './UniformComposition-D_HC6rSo.mjs';
9
- export { b as UniformComposition, r as resolveComposition } from './UniformComposition-D_HC6rSo.mjs';
7
+ import React__default, { PropsWithChildren } from 'react';
8
+ import { U as UniformCompositionProps } from './UniformComposition-IWWzoI_H.mjs';
9
+ export { b as UniformComposition, r as resolveComposition } from './UniformComposition-IWWzoI_H.mjs';
10
10
  import { ClientContextComponent } from '@uniformdev/canvas-next-rsc-client';
11
11
 
12
12
  type GetCanvasClientOptions = {
13
13
  cache: NonNullable<UniformServerConfig['canvasCache']>;
14
14
  };
15
15
  declare const getCanvasClient: (options: GetCanvasClientOptions) => CanvasClient;
16
- declare const getDefaultCanvasClient: (options: Pick<CompositionContext, "searchParams">) => Promise<CanvasClient>;
16
+ declare const getDefaultCanvasClient: ({ searchParams, }: {
17
+ searchParams: PageParameters["searchParams"];
18
+ }) => CanvasClient;
17
19
 
18
20
  type GetManifestClientOptions = {
19
21
  cache: NonNullable<UniformServerConfig['manifestCache']>;
20
22
  };
21
23
  declare const getManifestClient: (options: GetManifestClientOptions) => ManifestClient;
22
- declare const getDefaultManifestClient: (options: Pick<CompositionContext, "searchParams">) => Promise<ManifestClient>;
23
- declare const getManifest: (options: Pick<CompositionContext, "searchParams">) => Promise<{
24
+ declare const getDefaultManifestClient: ({ searchParams, }: {
25
+ searchParams?: PageParameters["searchParams"];
26
+ }) => ManifestClient;
27
+ declare const getManifest: ({ searchParams }: {
28
+ searchParams: PageParameters["searchParams"];
29
+ }) => Promise<{
24
30
  project: {
25
31
  id?: string;
26
32
  name?: string;
@@ -180,19 +186,23 @@ type GetProjectMapClientOptions = {
180
186
  cache: NonNullable<UniformServerConfig['projectMapCache']>;
181
187
  };
182
188
  declare const getProjectMapClient: (options: GetProjectMapClientOptions) => ProjectMapClient;
183
- declare const getDefaultProjectMapClient: (options: Pick<CompositionContext, "searchParams">) => Promise<ProjectMapClient>;
189
+ declare const getDefaultProjectMapClient: ({ searchParams, }: {
190
+ searchParams: PageParameters["searchParams"];
191
+ }) => ProjectMapClient;
184
192
 
185
193
  type GetRouteClientOptions = {
186
194
  cache: NonNullable<UniformServerConfig['canvasCache']>;
187
195
  };
188
196
  declare const getRouteClient: (options: GetRouteClientOptions) => RouteClient;
189
- declare const getDefaultRouteClient: (options: Pick<CompositionContext, "searchParams">) => Promise<RouteClient>;
197
+ declare const getDefaultRouteClient: ({ searchParams }: {
198
+ searchParams: PageParameters["searchParams"];
199
+ }) => RouteClient;
190
200
 
191
201
  type ContextUpdateTransferProps = {
192
202
  update: Partial<AppDirectoryContextState> | (() => Promise<Partial<ContextState> | undefined>);
193
203
  serverContext: AppDirectoryServerContext | undefined;
194
204
  };
195
- declare const ContextUpdateTransfer: React.FC<ContextUpdateTransferProps>;
205
+ declare const ContextUpdateTransfer: React__default.FC<ContextUpdateTransferProps>;
196
206
 
197
207
  type CreateStaticParamsOptions = {
198
208
  expand?: (node: ProjectMapNode) => Promise<string[] | undefined> | string[] | undefined;
@@ -210,19 +220,21 @@ type UniformContextProps = {
210
220
  */
211
221
  clientContextComponent?: ClientContextComponent;
212
222
  };
213
- declare const UniformContext: React.FC<PropsWithChildren<UniformContextProps>>;
223
+ declare const UniformContext: React__default.FC<PropsWithChildren<UniformContextProps>>;
214
224
 
215
225
  type UniformPlaygroundProps = PlaygroundParameters & Omit<UniformCompositionProps, 'params' | 'searchParams' | 'route' | 'mode'>;
216
- declare const UniformPlayground: React.FC<UniformPlaygroundProps>;
226
+ declare const UniformPlayground: ({ searchParams, ...rest }: UniformPlaygroundProps) => Promise<React__default.JSX.Element>;
217
227
 
218
228
  type CreateServerUniformContextProps = Omit<ContextOptions, 'transitionStore' | 'manifest'> & {
219
- searchParams: AwaitedPageParameters['searchParams'];
229
+ searchParams: PageParameters['searchParams'];
220
230
  };
221
231
  declare const createServerUniformContext: (options: CreateServerUniformContextProps) => Promise<AppDirectoryServerContext>;
222
232
 
223
233
  declare const isDraftModeEnabled: ({ searchParams, }: {
224
- searchParams: AwaitedPageParameters["searchParams"];
225
- }) => Promise<boolean>;
234
+ searchParams: {
235
+ [key: string]: string | undefined;
236
+ } | undefined;
237
+ }) => boolean;
226
238
  declare const isIncontextEditingEnabled: ({ searchParams, }: {
227
239
  searchParams: {
228
240
  [key: string]: string | undefined;
@@ -250,6 +262,6 @@ type RetrieveSlugOptions = Pick<CompositionGetBySlugParameters, 'slug' | 'locale
250
262
  } & RetrieveCommonOptions;
251
263
  type RetrieveRouteFetchOptions = Omit<RouteGetParameters, 'projectId' | 'path' | 'withComponentIDs' | 'withContentSourceMap' | 'state'>;
252
264
  declare const retrieveCompositionBySlug: ({ slug, searchParams, skipPrefetch, locale, releaseId, versionId, }: RetrieveSlugOptions) => Promise<ResolvedRouteGetResponse>;
253
- declare const retrieveRoute: ({ params, searchParams: providedSearchParams, skipPrefetch }: RetrieveRouteOptions, fetchOptions?: RetrieveRouteFetchOptions) => Promise<ResolvedRouteGetResponse>;
265
+ declare const retrieveRoute: ({ params, searchParams, skipPrefetch }: RetrieveRouteOptions, fetchOptions?: RetrieveRouteFetchOptions) => Promise<ResolvedRouteGetResponse>;
254
266
 
255
267
  export { ContextUpdateTransfer, type ContextUpdateTransferProps, type CreateServerUniformContextProps, type CreateStaticParamsOptions, type GetCanvasClientOptions, type GetManifestClientOptions, type GetProjectMapClientOptions, type GetRouteClientOptions, UniformCompositionProps, UniformContext, type UniformContextProps, UniformPlayground, type UniformPlaygroundProps, createServerUniformContext, createStaticParams, generateStaticParams, getCanvasClient, getDefaultCanvasClient, getDefaultManifestClient, getDefaultProjectMapClient, getDefaultRouteClient, getManifest, getManifestClient, getProjectMapClient, getRouteClient, isDevelopmentEnvironment, isDraftModeEnabled, isIncontextEditingEnabled, isOnVercelPreviewEnvironment, retrieveCompositionBySlug, retrieveRoute };
package/dist/index.d.ts CHANGED
@@ -1,26 +1,32 @@
1
1
  import { CanvasClient, RouteClient, ResolvedRouteGetResponse, CompositionGetBySlugParameters, RouteGetParameters } from '@uniformdev/canvas';
2
- import { UniformServerConfig, CompositionContext, AppDirectoryContextState, AppDirectoryServerContext, PlaygroundParameters, AwaitedPageParameters, PageParameters } from '@uniformdev/canvas-next-rsc-shared';
2
+ import { UniformServerConfig, PageParameters, AppDirectoryContextState, AppDirectoryServerContext, PlaygroundParameters } from '@uniformdev/canvas-next-rsc-shared';
3
3
  export { PageParameters, PlaygroundParameters } from '@uniformdev/canvas-next-rsc-shared';
4
4
  import { ManifestClient } from '@uniformdev/context/api';
5
5
  import { ProjectMapClient, ProjectMapNode } from '@uniformdev/project-map';
6
6
  import { ContextState, ContextOptions } from '@uniformdev/context';
7
- import React, { PropsWithChildren } from 'react';
8
- import { U as UniformCompositionProps } from './UniformComposition-D_HC6rSo.js';
9
- export { b as UniformComposition, r as resolveComposition } from './UniformComposition-D_HC6rSo.js';
7
+ import React__default, { PropsWithChildren } from 'react';
8
+ import { U as UniformCompositionProps } from './UniformComposition-IWWzoI_H.js';
9
+ export { b as UniformComposition, r as resolveComposition } from './UniformComposition-IWWzoI_H.js';
10
10
  import { ClientContextComponent } from '@uniformdev/canvas-next-rsc-client';
11
11
 
12
12
  type GetCanvasClientOptions = {
13
13
  cache: NonNullable<UniformServerConfig['canvasCache']>;
14
14
  };
15
15
  declare const getCanvasClient: (options: GetCanvasClientOptions) => CanvasClient;
16
- declare const getDefaultCanvasClient: (options: Pick<CompositionContext, "searchParams">) => Promise<CanvasClient>;
16
+ declare const getDefaultCanvasClient: ({ searchParams, }: {
17
+ searchParams: PageParameters["searchParams"];
18
+ }) => CanvasClient;
17
19
 
18
20
  type GetManifestClientOptions = {
19
21
  cache: NonNullable<UniformServerConfig['manifestCache']>;
20
22
  };
21
23
  declare const getManifestClient: (options: GetManifestClientOptions) => ManifestClient;
22
- declare const getDefaultManifestClient: (options: Pick<CompositionContext, "searchParams">) => Promise<ManifestClient>;
23
- declare const getManifest: (options: Pick<CompositionContext, "searchParams">) => Promise<{
24
+ declare const getDefaultManifestClient: ({ searchParams, }: {
25
+ searchParams?: PageParameters["searchParams"];
26
+ }) => ManifestClient;
27
+ declare const getManifest: ({ searchParams }: {
28
+ searchParams: PageParameters["searchParams"];
29
+ }) => Promise<{
24
30
  project: {
25
31
  id?: string;
26
32
  name?: string;
@@ -180,19 +186,23 @@ type GetProjectMapClientOptions = {
180
186
  cache: NonNullable<UniformServerConfig['projectMapCache']>;
181
187
  };
182
188
  declare const getProjectMapClient: (options: GetProjectMapClientOptions) => ProjectMapClient;
183
- declare const getDefaultProjectMapClient: (options: Pick<CompositionContext, "searchParams">) => Promise<ProjectMapClient>;
189
+ declare const getDefaultProjectMapClient: ({ searchParams, }: {
190
+ searchParams: PageParameters["searchParams"];
191
+ }) => ProjectMapClient;
184
192
 
185
193
  type GetRouteClientOptions = {
186
194
  cache: NonNullable<UniformServerConfig['canvasCache']>;
187
195
  };
188
196
  declare const getRouteClient: (options: GetRouteClientOptions) => RouteClient;
189
- declare const getDefaultRouteClient: (options: Pick<CompositionContext, "searchParams">) => Promise<RouteClient>;
197
+ declare const getDefaultRouteClient: ({ searchParams }: {
198
+ searchParams: PageParameters["searchParams"];
199
+ }) => RouteClient;
190
200
 
191
201
  type ContextUpdateTransferProps = {
192
202
  update: Partial<AppDirectoryContextState> | (() => Promise<Partial<ContextState> | undefined>);
193
203
  serverContext: AppDirectoryServerContext | undefined;
194
204
  };
195
- declare const ContextUpdateTransfer: React.FC<ContextUpdateTransferProps>;
205
+ declare const ContextUpdateTransfer: React__default.FC<ContextUpdateTransferProps>;
196
206
 
197
207
  type CreateStaticParamsOptions = {
198
208
  expand?: (node: ProjectMapNode) => Promise<string[] | undefined> | string[] | undefined;
@@ -210,19 +220,21 @@ type UniformContextProps = {
210
220
  */
211
221
  clientContextComponent?: ClientContextComponent;
212
222
  };
213
- declare const UniformContext: React.FC<PropsWithChildren<UniformContextProps>>;
223
+ declare const UniformContext: React__default.FC<PropsWithChildren<UniformContextProps>>;
214
224
 
215
225
  type UniformPlaygroundProps = PlaygroundParameters & Omit<UniformCompositionProps, 'params' | 'searchParams' | 'route' | 'mode'>;
216
- declare const UniformPlayground: React.FC<UniformPlaygroundProps>;
226
+ declare const UniformPlayground: ({ searchParams, ...rest }: UniformPlaygroundProps) => Promise<React__default.JSX.Element>;
217
227
 
218
228
  type CreateServerUniformContextProps = Omit<ContextOptions, 'transitionStore' | 'manifest'> & {
219
- searchParams: AwaitedPageParameters['searchParams'];
229
+ searchParams: PageParameters['searchParams'];
220
230
  };
221
231
  declare const createServerUniformContext: (options: CreateServerUniformContextProps) => Promise<AppDirectoryServerContext>;
222
232
 
223
233
  declare const isDraftModeEnabled: ({ searchParams, }: {
224
- searchParams: AwaitedPageParameters["searchParams"];
225
- }) => Promise<boolean>;
234
+ searchParams: {
235
+ [key: string]: string | undefined;
236
+ } | undefined;
237
+ }) => boolean;
226
238
  declare const isIncontextEditingEnabled: ({ searchParams, }: {
227
239
  searchParams: {
228
240
  [key: string]: string | undefined;
@@ -250,6 +262,6 @@ type RetrieveSlugOptions = Pick<CompositionGetBySlugParameters, 'slug' | 'locale
250
262
  } & RetrieveCommonOptions;
251
263
  type RetrieveRouteFetchOptions = Omit<RouteGetParameters, 'projectId' | 'path' | 'withComponentIDs' | 'withContentSourceMap' | 'state'>;
252
264
  declare const retrieveCompositionBySlug: ({ slug, searchParams, skipPrefetch, locale, releaseId, versionId, }: RetrieveSlugOptions) => Promise<ResolvedRouteGetResponse>;
253
- declare const retrieveRoute: ({ params, searchParams: providedSearchParams, skipPrefetch }: RetrieveRouteOptions, fetchOptions?: RetrieveRouteFetchOptions) => Promise<ResolvedRouteGetResponse>;
265
+ declare const retrieveRoute: ({ params, searchParams, skipPrefetch }: RetrieveRouteOptions, fetchOptions?: RetrieveRouteFetchOptions) => Promise<ResolvedRouteGetResponse>;
254
266
 
255
267
  export { ContextUpdateTransfer, type ContextUpdateTransferProps, type CreateServerUniformContextProps, type CreateStaticParamsOptions, type GetCanvasClientOptions, type GetManifestClientOptions, type GetProjectMapClientOptions, type GetRouteClientOptions, UniformCompositionProps, UniformContext, type UniformContextProps, UniformPlayground, type UniformPlaygroundProps, createServerUniformContext, createStaticParams, generateStaticParams, getCanvasClient, getDefaultCanvasClient, getDefaultManifestClient, getDefaultProjectMapClient, getDefaultRouteClient, getManifest, getManifestClient, getProjectMapClient, getRouteClient, isDevelopmentEnvironment, isDraftModeEnabled, isIncontextEditingEnabled, isOnVercelPreviewEnvironment, retrieveCompositionBySlug, retrieveRoute };