@uniformdev/next-app-router 20.80.2 → 20.81.1-alpha.4.sha-de16ebeee7
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-DBO-oo7J.d.ts → UniformComposition-T7CRvU1H.d.ts} +2 -8
- package/dist/{UniformComposition-le6UEB_r.d.mts → UniformComposition-fq7Qfhvp.d.mts} +2 -8
- package/dist/cache.d.mts +1 -3
- package/dist/cache.d.ts +1 -3
- package/dist/cache.js +127 -811
- package/dist/cache.mjs +126 -810
- package/dist/compat.d.mts +2 -4
- package/dist/compat.d.ts +2 -4
- package/dist/component.d.mts +10 -1
- package/dist/component.d.ts +10 -1
- package/dist/component.js +113 -617
- package/dist/component.mjs +112 -640
- package/dist/config/default.js +0 -1
- package/dist/config/default.mjs +0 -1
- package/dist/edge.d.mts +44 -0
- package/dist/edge.d.ts +44 -0
- package/dist/edge.js +751 -0
- package/dist/edge.mjs +720 -0
- package/dist/handler.js +87 -616
- package/dist/handler.mjs +85 -614
- package/dist/index.d.mts +15 -36
- package/dist/index.d.ts +15 -36
- package/dist/index.esm.js +1935 -5585
- package/dist/index.js +1929 -5579
- package/dist/index.mjs +1935 -5585
- package/dist/middleware.d.mts +52 -13
- package/dist/middleware.d.ts +52 -13
- package/dist/middleware.js +410 -5746
- package/dist/middleware.mjs +417 -5776
- package/dist/resolveRouteFromCode-CId7aItt.d.mts +48 -0
- package/dist/resolveRouteFromCode-CId7aItt.d.ts +48 -0
- package/package.json +24 -9
- package/dist/client-BElN_CWD.d.mts +0 -786
- package/dist/client-BElN_CWD.d.ts +0 -786
- package/dist/resolveRouteFromCode-BOvjIvM2.d.ts +0 -18
- package/dist/resolveRouteFromCode-CuJ4JHeb.d.mts +0 -18
package/dist/index.d.mts
CHANGED
|
@@ -1,15 +1,13 @@
|
|
|
1
|
-
import { CanvasClient, CompositionDeliveryClient, RouteClient
|
|
1
|
+
import { CanvasClient, CompositionDeliveryClient, RouteClient } 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-fq7Qfhvp.mjs';
|
|
6
|
+
export { C as CompositionCache, a as ResolveComponentFunction, R as ResolveComponentResult, b as UniformComposition, c as createCompositionCache } from './UniformComposition-fq7Qfhvp.mjs';
|
|
7
7
|
import React from 'react';
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
export { R as ResolveRouteFunction, r as resolveRouteFromCode } from './resolveRouteFromCode-CuJ4JHeb.mjs';
|
|
8
|
+
import { a as ResolvedRouteResult } from './resolveRouteFromCode-CId7aItt.mjs';
|
|
9
|
+
export { D as DataClient, b as DefaultDataClient, E as EnhanceRouteOptions, G as GetRouteOptions, c as GetRouteResult, R as ResolveRouteFunction, r as resolveRouteFromCode } from './resolveRouteFromCode-CId7aItt.mjs';
|
|
11
10
|
import '@uniformdev/next-app-router-client';
|
|
12
|
-
import '@uniformdev/context';
|
|
13
11
|
|
|
14
12
|
type SpecificCacheMode<TCacheMode extends CacheMode> = {
|
|
15
13
|
cache: TCacheMode;
|
|
@@ -222,44 +220,25 @@ type CreateStaticParamsOptions = {
|
|
|
222
220
|
locale?: string;
|
|
223
221
|
};
|
|
224
222
|
/**
|
|
225
|
-
*
|
|
226
|
-
*
|
|
227
|
-
* @returns
|
|
223
|
+
* Generates the playground code for the first of the given paths. Playground requests are drafts,
|
|
224
|
+
* which evaluate while the page renders, so there is one code per composition.
|
|
228
225
|
*/
|
|
229
226
|
declare const createUniformPlaygroundStaticParams: (options: CreateStaticParamsOptions) => Promise<{
|
|
230
227
|
code: string;
|
|
231
228
|
}[]>;
|
|
232
229
|
/**
|
|
233
|
-
*
|
|
234
|
-
*
|
|
235
|
-
*
|
|
230
|
+
* Generates one code per published composition among the given paths, for `generateStaticParams`
|
|
231
|
+
* of the `[code]` route. Codes carry the route, not an evaluation, so each path has one static page
|
|
232
|
+
* whose variants are chosen in the browser or at the edge.
|
|
236
233
|
*/
|
|
237
234
|
declare const createUniformStaticParams: (options: CreateStaticParamsOptions) => Promise<{
|
|
238
235
|
code: string;
|
|
239
236
|
}[]>;
|
|
240
237
|
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
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
|
-
|
|
238
|
+
/**
|
|
239
|
+
* Resolves the composition of a playground code. The code carries the composition id, and the
|
|
240
|
+
* composition resolves in the editor state, falling back to the draft state.
|
|
241
|
+
*/
|
|
263
242
|
declare const resolvePlaygroundRoute: ({ code }: {
|
|
264
243
|
code: string;
|
|
265
244
|
}) => Promise<ResolvedRouteResult>;
|
|
@@ -276,4 +255,4 @@ declare const findRouteMatch: (routes: CustomRoute[], path: string) => RouteMatc
|
|
|
276
255
|
|
|
277
256
|
declare const serverContext: <T>(defaultValue?: T) => [() => T | undefined, (v: T) => void];
|
|
278
257
|
|
|
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,
|
|
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 };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,15 +1,13 @@
|
|
|
1
|
-
import { CanvasClient, CompositionDeliveryClient, RouteClient
|
|
1
|
+
import { CanvasClient, CompositionDeliveryClient, RouteClient } 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-T7CRvU1H.js';
|
|
6
|
+
export { C as CompositionCache, a as ResolveComponentFunction, R as ResolveComponentResult, b as UniformComposition, c as createCompositionCache } from './UniformComposition-T7CRvU1H.js';
|
|
7
7
|
import React from 'react';
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
export { R as ResolveRouteFunction, r as resolveRouteFromCode } from './resolveRouteFromCode-BOvjIvM2.js';
|
|
8
|
+
import { a as ResolvedRouteResult } from './resolveRouteFromCode-CId7aItt.js';
|
|
9
|
+
export { D as DataClient, b as DefaultDataClient, E as EnhanceRouteOptions, G as GetRouteOptions, c as GetRouteResult, R as ResolveRouteFunction, r as resolveRouteFromCode } from './resolveRouteFromCode-CId7aItt.js';
|
|
11
10
|
import '@uniformdev/next-app-router-client';
|
|
12
|
-
import '@uniformdev/context';
|
|
13
11
|
|
|
14
12
|
type SpecificCacheMode<TCacheMode extends CacheMode> = {
|
|
15
13
|
cache: TCacheMode;
|
|
@@ -222,44 +220,25 @@ type CreateStaticParamsOptions = {
|
|
|
222
220
|
locale?: string;
|
|
223
221
|
};
|
|
224
222
|
/**
|
|
225
|
-
*
|
|
226
|
-
*
|
|
227
|
-
* @returns
|
|
223
|
+
* Generates the playground code for the first of the given paths. Playground requests are drafts,
|
|
224
|
+
* which evaluate while the page renders, so there is one code per composition.
|
|
228
225
|
*/
|
|
229
226
|
declare const createUniformPlaygroundStaticParams: (options: CreateStaticParamsOptions) => Promise<{
|
|
230
227
|
code: string;
|
|
231
228
|
}[]>;
|
|
232
229
|
/**
|
|
233
|
-
*
|
|
234
|
-
*
|
|
235
|
-
*
|
|
230
|
+
* Generates one code per published composition among the given paths, for `generateStaticParams`
|
|
231
|
+
* of the `[code]` route. Codes carry the route, not an evaluation, so each path has one static page
|
|
232
|
+
* whose variants are chosen in the browser or at the edge.
|
|
236
233
|
*/
|
|
237
234
|
declare const createUniformStaticParams: (options: CreateStaticParamsOptions) => Promise<{
|
|
238
235
|
code: string;
|
|
239
236
|
}[]>;
|
|
240
237
|
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
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
|
-
|
|
238
|
+
/**
|
|
239
|
+
* Resolves the composition of a playground code. The code carries the composition id, and the
|
|
240
|
+
* composition resolves in the editor state, falling back to the draft state.
|
|
241
|
+
*/
|
|
263
242
|
declare const resolvePlaygroundRoute: ({ code }: {
|
|
264
243
|
code: string;
|
|
265
244
|
}) => Promise<ResolvedRouteResult>;
|
|
@@ -276,4 +255,4 @@ declare const findRouteMatch: (routes: CustomRoute[], path: string) => RouteMatc
|
|
|
276
255
|
|
|
277
256
|
declare const serverContext: <T>(defaultValue?: T) => [() => T | undefined, (v: T) => void];
|
|
278
257
|
|
|
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,
|
|
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 };
|