@uniformdev/next-app-router 20.81.1-alpha.7.sha-91a5b13e0c → 20.81.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{UniformComposition-C00_YDOg.d.ts → UniformComposition-DBO-oo7J.d.ts} +31 -11
- package/dist/{UniformComposition-DiArCpVQ.d.mts → UniformComposition-le6UEB_r.d.mts} +31 -11
- package/dist/cache.d.mts +6 -24
- package/dist/cache.d.ts +6 -24
- package/dist/cache.js +831 -410
- package/dist/cache.mjs +829 -405
- package/dist/client-BElN_CWD.d.mts +786 -0
- package/dist/client-BElN_CWD.d.ts +786 -0
- package/dist/compat.d.mts +4 -2
- package/dist/compat.d.ts +4 -2
- package/dist/component.d.mts +1 -10
- package/dist/component.d.ts +1 -10
- package/dist/component.js +617 -113
- package/dist/component.mjs +640 -112
- package/dist/config/default.js +1 -0
- package/dist/config/default.mjs +1 -0
- package/dist/handler.d.mts +2 -15
- package/dist/handler.d.ts +2 -15
- package/dist/handler.js +628 -134
- package/dist/handler.mjs +626 -132
- package/dist/index.d.mts +42 -73
- package/dist/index.d.ts +42 -73
- package/dist/index.esm.js +5802 -2205
- package/dist/index.js +5615 -2022
- package/dist/index.mjs +5802 -2205
- package/dist/middleware.d.mts +13 -52
- package/dist/middleware.d.ts +13 -52
- package/dist/middleware.js +5741 -405
- package/dist/middleware.mjs +5774 -415
- package/dist/resolveRouteFromCode-BOvjIvM2.d.ts +18 -0
- package/dist/resolveRouteFromCode-CuJ4JHeb.d.mts +18 -0
- package/package.json +9 -37
- package/dist/composition-BvOM-LIW.d.mts +0 -28
- package/dist/composition-BvOM-LIW.d.ts +0 -28
- package/dist/createCachedManifestProvider-C7faGJJ8.d.mts +0 -69
- package/dist/createCachedManifestProvider-C7faGJJ8.d.ts +0 -69
- package/dist/edge.d.mts +0 -57
- package/dist/edge.d.ts +0 -57
- package/dist/edge.js +0 -1105
- package/dist/edge.mjs +0 -1073
- package/dist/resolveRouteFromPath-BHJGOpBN.d.ts +0 -82
- package/dist/resolveRouteFromPath-BsZUVkRX.d.mts +0 -82
- package/dist/vercel.d.mts +0 -24
- package/dist/vercel.d.ts +0 -24
- package/dist/vercel.js +0 -703
- package/dist/vercel.mjs +0 -675
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { RootComponentInstance, ComponentInstance } from '@uniformdev/canvas';
|
|
2
2
|
import { ComponentProps } from '@uniformdev/next-app-router-shared';
|
|
3
3
|
import React, { ComponentType } from 'react';
|
|
4
|
-
import {
|
|
4
|
+
import { D as DataClient } from './client-BElN_CWD.js';
|
|
5
|
+
import { a as ResolvedRouteResult, R as ResolveRouteFunction } from './resolveRouteFromCode-BOvjIvM2.js';
|
|
6
|
+
import { ClientContextComponent } from '@uniformdev/next-app-router-client';
|
|
5
7
|
|
|
6
8
|
type CompositionCache = {
|
|
7
9
|
getUniformComposition: ({ id }: {
|
|
@@ -15,6 +17,17 @@ type CompositionCache = {
|
|
|
15
17
|
};
|
|
16
18
|
declare const createCompositionCache: () => CompositionCache;
|
|
17
19
|
|
|
20
|
+
type UniformContextProps = {
|
|
21
|
+
/**
|
|
22
|
+
* Component to initialize Uniform context on the client.
|
|
23
|
+
*/
|
|
24
|
+
clientContextComponent?: ClientContextComponent;
|
|
25
|
+
/**
|
|
26
|
+
* The result of the route resolution.
|
|
27
|
+
*/
|
|
28
|
+
result: ResolvedRouteResult | undefined;
|
|
29
|
+
};
|
|
30
|
+
|
|
18
31
|
type ResolveComponentResult = {
|
|
19
32
|
component: ComponentType<ComponentProps<any, any>> | null;
|
|
20
33
|
includeContext?: boolean;
|
|
@@ -37,15 +50,26 @@ type ResolveComponentFunction = (options: {
|
|
|
37
50
|
type ResolveEmptyPlaceholderFunction = (options: ResolveEmptyPlaceholderOptions) => ResolveEmptyPlaceholderResult;
|
|
38
51
|
type UniformCompositionProps = {
|
|
39
52
|
/**
|
|
40
|
-
* The
|
|
41
|
-
* `resolveCompositionById`, `resolveCompositionBySlug` or a custom resolver, passed through
|
|
42
|
-
* `requireComposition` or narrowed on `route.type`.
|
|
53
|
+
* The code to resolve the route from.
|
|
43
54
|
*/
|
|
44
|
-
|
|
55
|
+
code: string;
|
|
56
|
+
/**
|
|
57
|
+
* Function to resolve the route from the code.
|
|
58
|
+
*/
|
|
59
|
+
resolveRoute: ResolveRouteFunction;
|
|
45
60
|
/**
|
|
46
61
|
* Function to map composition components to React components.
|
|
47
62
|
*/
|
|
48
63
|
resolveComponent: ResolveComponentFunction;
|
|
64
|
+
/**
|
|
65
|
+
* If provided, the composition will use the data client to retrieve data.
|
|
66
|
+
*
|
|
67
|
+
* Pass the same client here that you pass to `handleUniformRoute`. Without it, this component
|
|
68
|
+
* falls back to `DefaultDataClient` for the route it resolves and, on draft requests,
|
|
69
|
+
* for the manifest it evaluates personalization against - so a custom manifest source
|
|
70
|
+
* configured only on the middleware would not apply while the page renders.
|
|
71
|
+
*/
|
|
72
|
+
dataClient?: DataClient;
|
|
49
73
|
/**
|
|
50
74
|
* Function to map empty placeholders to React components.
|
|
51
75
|
*/
|
|
@@ -54,11 +78,7 @@ type UniformCompositionProps = {
|
|
|
54
78
|
* Composition cache, will be used to cache the composition.
|
|
55
79
|
*/
|
|
56
80
|
compositionCache?: CompositionCache;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
* Renders a resolved composition. Render `UniformContext` once on the page as well, which
|
|
60
|
-
* initializes Uniform context on the client and loads the contextual editing script.
|
|
61
|
-
*/
|
|
62
|
-
declare function UniformComposition(props: UniformCompositionProps): React.JSX.Element;
|
|
81
|
+
} & Pick<UniformContextProps, 'clientContextComponent'>;
|
|
82
|
+
declare function UniformComposition({ code, ...props }: UniformCompositionProps): React.JSX.Element;
|
|
63
83
|
|
|
64
84
|
export { type CompositionCache as C, type ResolveComponentResult as R, type UniformCompositionProps as U, type ResolveComponentFunction as a, UniformComposition as b, createCompositionCache as c };
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { RootComponentInstance, ComponentInstance } from '@uniformdev/canvas';
|
|
2
2
|
import { ComponentProps } from '@uniformdev/next-app-router-shared';
|
|
3
3
|
import React, { ComponentType } from 'react';
|
|
4
|
-
import {
|
|
4
|
+
import { D as DataClient } from './client-BElN_CWD.mjs';
|
|
5
|
+
import { a as ResolvedRouteResult, R as ResolveRouteFunction } from './resolveRouteFromCode-CuJ4JHeb.mjs';
|
|
6
|
+
import { ClientContextComponent } from '@uniformdev/next-app-router-client';
|
|
5
7
|
|
|
6
8
|
type CompositionCache = {
|
|
7
9
|
getUniformComposition: ({ id }: {
|
|
@@ -15,6 +17,17 @@ type CompositionCache = {
|
|
|
15
17
|
};
|
|
16
18
|
declare const createCompositionCache: () => CompositionCache;
|
|
17
19
|
|
|
20
|
+
type UniformContextProps = {
|
|
21
|
+
/**
|
|
22
|
+
* Component to initialize Uniform context on the client.
|
|
23
|
+
*/
|
|
24
|
+
clientContextComponent?: ClientContextComponent;
|
|
25
|
+
/**
|
|
26
|
+
* The result of the route resolution.
|
|
27
|
+
*/
|
|
28
|
+
result: ResolvedRouteResult | undefined;
|
|
29
|
+
};
|
|
30
|
+
|
|
18
31
|
type ResolveComponentResult = {
|
|
19
32
|
component: ComponentType<ComponentProps<any, any>> | null;
|
|
20
33
|
includeContext?: boolean;
|
|
@@ -37,15 +50,26 @@ type ResolveComponentFunction = (options: {
|
|
|
37
50
|
type ResolveEmptyPlaceholderFunction = (options: ResolveEmptyPlaceholderOptions) => ResolveEmptyPlaceholderResult;
|
|
38
51
|
type UniformCompositionProps = {
|
|
39
52
|
/**
|
|
40
|
-
* The
|
|
41
|
-
* `resolveCompositionById`, `resolveCompositionBySlug` or a custom resolver, passed through
|
|
42
|
-
* `requireComposition` or narrowed on `route.type`.
|
|
53
|
+
* The code to resolve the route from.
|
|
43
54
|
*/
|
|
44
|
-
|
|
55
|
+
code: string;
|
|
56
|
+
/**
|
|
57
|
+
* Function to resolve the route from the code.
|
|
58
|
+
*/
|
|
59
|
+
resolveRoute: ResolveRouteFunction;
|
|
45
60
|
/**
|
|
46
61
|
* Function to map composition components to React components.
|
|
47
62
|
*/
|
|
48
63
|
resolveComponent: ResolveComponentFunction;
|
|
64
|
+
/**
|
|
65
|
+
* If provided, the composition will use the data client to retrieve data.
|
|
66
|
+
*
|
|
67
|
+
* Pass the same client here that you pass to `handleUniformRoute`. Without it, this component
|
|
68
|
+
* falls back to `DefaultDataClient` for the route it resolves and, on draft requests,
|
|
69
|
+
* for the manifest it evaluates personalization against - so a custom manifest source
|
|
70
|
+
* configured only on the middleware would not apply while the page renders.
|
|
71
|
+
*/
|
|
72
|
+
dataClient?: DataClient;
|
|
49
73
|
/**
|
|
50
74
|
* Function to map empty placeholders to React components.
|
|
51
75
|
*/
|
|
@@ -54,11 +78,7 @@ type UniformCompositionProps = {
|
|
|
54
78
|
* Composition cache, will be used to cache the composition.
|
|
55
79
|
*/
|
|
56
80
|
compositionCache?: CompositionCache;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
* Renders a resolved composition. Render `UniformContext` once on the page as well, which
|
|
60
|
-
* initializes Uniform context on the client and loads the contextual editing script.
|
|
61
|
-
*/
|
|
62
|
-
declare function UniformComposition(props: UniformCompositionProps): React.JSX.Element;
|
|
81
|
+
} & Pick<UniformContextProps, 'clientContextComponent'>;
|
|
82
|
+
declare function UniformComposition({ code, ...props }: UniformCompositionProps): React.JSX.Element;
|
|
63
83
|
|
|
64
84
|
export { type CompositionCache as C, type ResolveComponentResult as R, type UniformCompositionProps as U, type ResolveComponentFunction as a, UniformComposition as b, createCompositionCache as c };
|
package/dist/cache.d.mts
CHANGED
|
@@ -1,27 +1,9 @@
|
|
|
1
|
-
import { R as
|
|
2
|
-
import { R as ResolvedRouteResult } from './composition-BvOM-LIW.mjs';
|
|
3
|
-
import '@uniformdev/next-app-router-shared';
|
|
1
|
+
import { R as ResolveRouteFunction } from './resolveRouteFromCode-CuJ4JHeb.mjs';
|
|
4
2
|
import '@uniformdev/canvas';
|
|
3
|
+
import '@uniformdev/next-app-router-shared';
|
|
4
|
+
import './client-BElN_CWD.mjs';
|
|
5
|
+
import '@uniformdev/context';
|
|
5
6
|
|
|
6
|
-
|
|
7
|
-
* `resolveRouteFromCode` inside a `'use cache'` scope for published content, tagged with the
|
|
8
|
-
* route path and the resolved composition id. Other states resolve uncached.
|
|
9
|
-
*/
|
|
10
|
-
declare const resolveRouteFromCode: ({ code, }: ResolveRouteFromCodeOptions) => Promise<ResolvedRouteResult>;
|
|
11
|
-
/**
|
|
12
|
-
* `resolveRouteFromPath` inside a `'use cache'` scope for published content, tagged with the path
|
|
13
|
-
* and the resolved composition id. Other states resolve uncached.
|
|
14
|
-
*/
|
|
15
|
-
declare const resolveRouteFromPath: ({ pageState, path, }: ResolveRouteFromPathOptions) => Promise<ResolvedRouteResult>;
|
|
16
|
-
/**
|
|
17
|
-
* `resolveCompositionById` inside a `'use cache'` scope for published content, tagged with the
|
|
18
|
-
* composition id. Other states resolve uncached.
|
|
19
|
-
*/
|
|
20
|
-
declare const resolveCompositionById: (options: ResolveCompositionByIdOptions) => Promise<ResolvedRouteResult>;
|
|
21
|
-
/**
|
|
22
|
-
* `resolveCompositionBySlug` inside a `'use cache'` scope for published content, tagged with the
|
|
23
|
-
* slug and the resolved composition id. Other states resolve uncached.
|
|
24
|
-
*/
|
|
25
|
-
declare const resolveCompositionBySlug: (options: ResolveCompositionBySlugOptions) => Promise<ResolvedRouteResult>;
|
|
7
|
+
declare const resolveRouteFromCode: ResolveRouteFunction;
|
|
26
8
|
|
|
27
|
-
export {
|
|
9
|
+
export { resolveRouteFromCode };
|
package/dist/cache.d.ts
CHANGED
|
@@ -1,27 +1,9 @@
|
|
|
1
|
-
import { R as
|
|
2
|
-
import { R as ResolvedRouteResult } from './composition-BvOM-LIW.js';
|
|
3
|
-
import '@uniformdev/next-app-router-shared';
|
|
1
|
+
import { R as ResolveRouteFunction } from './resolveRouteFromCode-BOvjIvM2.js';
|
|
4
2
|
import '@uniformdev/canvas';
|
|
3
|
+
import '@uniformdev/next-app-router-shared';
|
|
4
|
+
import './client-BElN_CWD.js';
|
|
5
|
+
import '@uniformdev/context';
|
|
5
6
|
|
|
6
|
-
|
|
7
|
-
* `resolveRouteFromCode` inside a `'use cache'` scope for published content, tagged with the
|
|
8
|
-
* route path and the resolved composition id. Other states resolve uncached.
|
|
9
|
-
*/
|
|
10
|
-
declare const resolveRouteFromCode: ({ code, }: ResolveRouteFromCodeOptions) => Promise<ResolvedRouteResult>;
|
|
11
|
-
/**
|
|
12
|
-
* `resolveRouteFromPath` inside a `'use cache'` scope for published content, tagged with the path
|
|
13
|
-
* and the resolved composition id. Other states resolve uncached.
|
|
14
|
-
*/
|
|
15
|
-
declare const resolveRouteFromPath: ({ pageState, path, }: ResolveRouteFromPathOptions) => Promise<ResolvedRouteResult>;
|
|
16
|
-
/**
|
|
17
|
-
* `resolveCompositionById` inside a `'use cache'` scope for published content, tagged with the
|
|
18
|
-
* composition id. Other states resolve uncached.
|
|
19
|
-
*/
|
|
20
|
-
declare const resolveCompositionById: (options: ResolveCompositionByIdOptions) => Promise<ResolvedRouteResult>;
|
|
21
|
-
/**
|
|
22
|
-
* `resolveCompositionBySlug` inside a `'use cache'` scope for published content, tagged with the
|
|
23
|
-
* slug and the resolved composition id. Other states resolve uncached.
|
|
24
|
-
*/
|
|
25
|
-
declare const resolveCompositionBySlug: (options: ResolveCompositionBySlugOptions) => Promise<ResolvedRouteResult>;
|
|
7
|
+
declare const resolveRouteFromCode: ResolveRouteFunction;
|
|
26
8
|
|
|
27
|
-
export {
|
|
9
|
+
export { resolveRouteFromCode };
|