@uniformdev/next-app-router 20.81.1-alpha.4.sha-de16ebeee7 → 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-T7CRvU1H.d.ts → UniformComposition-DBO-oo7J.d.ts} +8 -2
- package/dist/{UniformComposition-fq7Qfhvp.d.mts → UniformComposition-le6UEB_r.d.mts} +8 -2
- package/dist/cache.d.mts +3 -1
- package/dist/cache.d.ts +3 -1
- package/dist/cache.js +811 -127
- package/dist/cache.mjs +810 -126
- 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.js +616 -87
- package/dist/handler.mjs +614 -85
- package/dist/index.d.mts +36 -15
- package/dist/index.d.ts +36 -15
- package/dist/index.esm.js +5825 -2175
- package/dist/index.js +5839 -2189
- package/dist/index.mjs +5825 -2175
- 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 -24
- package/dist/edge.d.mts +0 -44
- package/dist/edge.d.ts +0 -44
- package/dist/edge.js +0 -751
- package/dist/edge.mjs +0 -720
- package/dist/resolveRouteFromCode-CId7aItt.d.mts +0 -48
- package/dist/resolveRouteFromCode-CId7aItt.d.ts +0 -48
package/dist/index.d.mts
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
import { CanvasClient, CompositionDeliveryClient, RouteClient } from '@uniformdev/canvas';
|
|
1
|
+
import { CanvasClient, CompositionDeliveryClient, RouteClient, ComponentInstance } from '@uniformdev/canvas';
|
|
2
2
|
import { CacheMode, CanvasCacheMode, ManifestCacheMode, ProjectMapCacheMode, RewriteRequestPathResult } from '@uniformdev/next-app-router-shared';
|
|
3
3
|
import { ManifestClient } from '@uniformdev/context/api';
|
|
4
4
|
import { ProjectMapClient } from '@uniformdev/project-map';
|
|
5
|
-
import { U as UniformCompositionProps } from './UniformComposition-
|
|
6
|
-
export { C as CompositionCache, a as ResolveComponentFunction, R as ResolveComponentResult, b as UniformComposition, c as createCompositionCache } from './UniformComposition-
|
|
5
|
+
import { U as UniformCompositionProps } from './UniformComposition-le6UEB_r.mjs';
|
|
6
|
+
export { C as CompositionCache, a as ResolveComponentFunction, R as ResolveComponentResult, b as UniformComposition, c as createCompositionCache } from './UniformComposition-le6UEB_r.mjs';
|
|
7
7
|
import React from 'react';
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
export { D as DataClient, a as DefaultDataClient, E as EnhanceRouteOptions, G as GetRouteFromMiddlewareOptions, b as GetRouteFromPageStateOptions, c as GetRouteOptions, R as RewriteRouteOptions, d as RewriteRouteResult, e as expireMiddlewareCacheTag } from './client-BElN_CWD.mjs';
|
|
9
|
+
import { a as ResolvedRouteResult } from './resolveRouteFromCode-CuJ4JHeb.mjs';
|
|
10
|
+
export { R as ResolveRouteFunction, r as resolveRouteFromCode } from './resolveRouteFromCode-CuJ4JHeb.mjs';
|
|
10
11
|
import '@uniformdev/next-app-router-client';
|
|
12
|
+
import '@uniformdev/context';
|
|
11
13
|
|
|
12
14
|
type SpecificCacheMode<TCacheMode extends CacheMode> = {
|
|
13
15
|
cache: TCacheMode;
|
|
@@ -220,25 +222,44 @@ type CreateStaticParamsOptions = {
|
|
|
220
222
|
locale?: string;
|
|
221
223
|
};
|
|
222
224
|
/**
|
|
223
|
-
*
|
|
224
|
-
*
|
|
225
|
+
* Function to generate all possible page states for the given paths in playground mode.
|
|
226
|
+
* @param options
|
|
227
|
+
* @returns
|
|
225
228
|
*/
|
|
226
229
|
declare const createUniformPlaygroundStaticParams: (options: CreateStaticParamsOptions) => Promise<{
|
|
227
230
|
code: string;
|
|
228
231
|
}[]>;
|
|
229
232
|
/**
|
|
230
|
-
*
|
|
231
|
-
*
|
|
232
|
-
*
|
|
233
|
+
* Function to generate all possible page states for the given paths.
|
|
234
|
+
* @param options
|
|
235
|
+
* @returns
|
|
233
236
|
*/
|
|
234
237
|
declare const createUniformStaticParams: (options: CreateStaticParamsOptions) => Promise<{
|
|
235
238
|
code: string;
|
|
236
239
|
}[]>;
|
|
237
240
|
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
241
|
+
type EvaluateTestsFunction = (test: {
|
|
242
|
+
name: string;
|
|
243
|
+
component: ComponentInstance;
|
|
244
|
+
}) => boolean;
|
|
245
|
+
type EvaluatePersonalizationsFunction = (personalization: {
|
|
246
|
+
name: string;
|
|
247
|
+
component: ComponentInstance;
|
|
248
|
+
}) => boolean;
|
|
249
|
+
type PrecomputeCompositionOptions = Pick<ResolvedRouteResult, 'pageState' | 'route'> & {
|
|
250
|
+
/**
|
|
251
|
+
* Whether to evaluate tests
|
|
252
|
+
* @defaultValue true
|
|
253
|
+
*/
|
|
254
|
+
evaluateTests?: boolean | EvaluateTestsFunction;
|
|
255
|
+
/**
|
|
256
|
+
* Whether to evaluate personalizations
|
|
257
|
+
* @defaultValue true
|
|
258
|
+
*/
|
|
259
|
+
evaluatePersonalizations?: boolean | EvaluatePersonalizationsFunction;
|
|
260
|
+
};
|
|
261
|
+
declare const precomputeComposition: ({ pageState, route, evaluatePersonalizations, evaluateTests, }: PrecomputeCompositionOptions) => Promise<void>;
|
|
262
|
+
|
|
242
263
|
declare const resolvePlaygroundRoute: ({ code }: {
|
|
243
264
|
code: string;
|
|
244
265
|
}) => Promise<ResolvedRouteResult>;
|
|
@@ -255,4 +276,4 @@ declare const findRouteMatch: (routes: CustomRoute[], path: string) => RouteMatc
|
|
|
255
276
|
|
|
256
277
|
declare const serverContext: <T>(defaultValue?: T) => [() => T | undefined, (v: T) => void];
|
|
257
278
|
|
|
258
|
-
export { type AwaitedUniformPageParameters, type CreateStaticParamsOptions, type CustomRoute, type GetCanvasClientOptions, type GetCompositionDeliveryClientOptions, type GetManifestClientOptions, type GetProjectMapClientOptions, type GetRouteClientOptions, type PlaygroundParameters, type RouteMatch, UniformCompositionProps, type UniformPageParameters, UniformPlayground, createUniformPlaygroundStaticParams, createUniformStaticParams, findRouteMatch, getCanvasClient, getCompositionDeliveryClient, getManifest, getManifestClient, getProjectMapClient, getRouteClient, resolvePlaygroundRoute, serverContext };
|
|
279
|
+
export { type AwaitedUniformPageParameters, type CreateStaticParamsOptions, type CustomRoute, type GetCanvasClientOptions, type GetCompositionDeliveryClientOptions, type GetManifestClientOptions, type GetProjectMapClientOptions, type GetRouteClientOptions, type PlaygroundParameters, type RouteMatch, UniformCompositionProps, type UniformPageParameters, UniformPlayground, createUniformPlaygroundStaticParams, createUniformStaticParams, findRouteMatch, getCanvasClient, getCompositionDeliveryClient, getManifest, getManifestClient, getProjectMapClient, getRouteClient, precomputeComposition, resolvePlaygroundRoute, serverContext };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
import { CanvasClient, CompositionDeliveryClient, RouteClient } from '@uniformdev/canvas';
|
|
1
|
+
import { CanvasClient, CompositionDeliveryClient, RouteClient, ComponentInstance } from '@uniformdev/canvas';
|
|
2
2
|
import { CacheMode, CanvasCacheMode, ManifestCacheMode, ProjectMapCacheMode, RewriteRequestPathResult } from '@uniformdev/next-app-router-shared';
|
|
3
3
|
import { ManifestClient } from '@uniformdev/context/api';
|
|
4
4
|
import { ProjectMapClient } from '@uniformdev/project-map';
|
|
5
|
-
import { U as UniformCompositionProps } from './UniformComposition-
|
|
6
|
-
export { C as CompositionCache, a as ResolveComponentFunction, R as ResolveComponentResult, b as UniformComposition, c as createCompositionCache } from './UniformComposition-
|
|
5
|
+
import { U as UniformCompositionProps } from './UniformComposition-DBO-oo7J.js';
|
|
6
|
+
export { C as CompositionCache, a as ResolveComponentFunction, R as ResolveComponentResult, b as UniformComposition, c as createCompositionCache } from './UniformComposition-DBO-oo7J.js';
|
|
7
7
|
import React from 'react';
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
export { D as DataClient, a as DefaultDataClient, E as EnhanceRouteOptions, G as GetRouteFromMiddlewareOptions, b as GetRouteFromPageStateOptions, c as GetRouteOptions, R as RewriteRouteOptions, d as RewriteRouteResult, e as expireMiddlewareCacheTag } from './client-BElN_CWD.js';
|
|
9
|
+
import { a as ResolvedRouteResult } from './resolveRouteFromCode-BOvjIvM2.js';
|
|
10
|
+
export { R as ResolveRouteFunction, r as resolveRouteFromCode } from './resolveRouteFromCode-BOvjIvM2.js';
|
|
10
11
|
import '@uniformdev/next-app-router-client';
|
|
12
|
+
import '@uniformdev/context';
|
|
11
13
|
|
|
12
14
|
type SpecificCacheMode<TCacheMode extends CacheMode> = {
|
|
13
15
|
cache: TCacheMode;
|
|
@@ -220,25 +222,44 @@ type CreateStaticParamsOptions = {
|
|
|
220
222
|
locale?: string;
|
|
221
223
|
};
|
|
222
224
|
/**
|
|
223
|
-
*
|
|
224
|
-
*
|
|
225
|
+
* Function to generate all possible page states for the given paths in playground mode.
|
|
226
|
+
* @param options
|
|
227
|
+
* @returns
|
|
225
228
|
*/
|
|
226
229
|
declare const createUniformPlaygroundStaticParams: (options: CreateStaticParamsOptions) => Promise<{
|
|
227
230
|
code: string;
|
|
228
231
|
}[]>;
|
|
229
232
|
/**
|
|
230
|
-
*
|
|
231
|
-
*
|
|
232
|
-
*
|
|
233
|
+
* Function to generate all possible page states for the given paths.
|
|
234
|
+
* @param options
|
|
235
|
+
* @returns
|
|
233
236
|
*/
|
|
234
237
|
declare const createUniformStaticParams: (options: CreateStaticParamsOptions) => Promise<{
|
|
235
238
|
code: string;
|
|
236
239
|
}[]>;
|
|
237
240
|
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
241
|
+
type EvaluateTestsFunction = (test: {
|
|
242
|
+
name: string;
|
|
243
|
+
component: ComponentInstance;
|
|
244
|
+
}) => boolean;
|
|
245
|
+
type EvaluatePersonalizationsFunction = (personalization: {
|
|
246
|
+
name: string;
|
|
247
|
+
component: ComponentInstance;
|
|
248
|
+
}) => boolean;
|
|
249
|
+
type PrecomputeCompositionOptions = Pick<ResolvedRouteResult, 'pageState' | 'route'> & {
|
|
250
|
+
/**
|
|
251
|
+
* Whether to evaluate tests
|
|
252
|
+
* @defaultValue true
|
|
253
|
+
*/
|
|
254
|
+
evaluateTests?: boolean | EvaluateTestsFunction;
|
|
255
|
+
/**
|
|
256
|
+
* Whether to evaluate personalizations
|
|
257
|
+
* @defaultValue true
|
|
258
|
+
*/
|
|
259
|
+
evaluatePersonalizations?: boolean | EvaluatePersonalizationsFunction;
|
|
260
|
+
};
|
|
261
|
+
declare const precomputeComposition: ({ pageState, route, evaluatePersonalizations, evaluateTests, }: PrecomputeCompositionOptions) => Promise<void>;
|
|
262
|
+
|
|
242
263
|
declare const resolvePlaygroundRoute: ({ code }: {
|
|
243
264
|
code: string;
|
|
244
265
|
}) => Promise<ResolvedRouteResult>;
|
|
@@ -255,4 +276,4 @@ declare const findRouteMatch: (routes: CustomRoute[], path: string) => RouteMatc
|
|
|
255
276
|
|
|
256
277
|
declare const serverContext: <T>(defaultValue?: T) => [() => T | undefined, (v: T) => void];
|
|
257
278
|
|
|
258
|
-
export { type AwaitedUniformPageParameters, type CreateStaticParamsOptions, type CustomRoute, type GetCanvasClientOptions, type GetCompositionDeliveryClientOptions, type GetManifestClientOptions, type GetProjectMapClientOptions, type GetRouteClientOptions, type PlaygroundParameters, type RouteMatch, UniformCompositionProps, type UniformPageParameters, UniformPlayground, createUniformPlaygroundStaticParams, createUniformStaticParams, findRouteMatch, getCanvasClient, getCompositionDeliveryClient, getManifest, getManifestClient, getProjectMapClient, getRouteClient, resolvePlaygroundRoute, serverContext };
|
|
279
|
+
export { type AwaitedUniformPageParameters, type CreateStaticParamsOptions, type CustomRoute, type GetCanvasClientOptions, type GetCompositionDeliveryClientOptions, type GetManifestClientOptions, type GetProjectMapClientOptions, type GetRouteClientOptions, type PlaygroundParameters, type RouteMatch, UniformCompositionProps, type UniformPageParameters, UniformPlayground, createUniformPlaygroundStaticParams, createUniformStaticParams, findRouteMatch, getCanvasClient, getCompositionDeliveryClient, getManifest, getManifestClient, getProjectMapClient, getRouteClient, precomputeComposition, resolvePlaygroundRoute, serverContext };
|