@uniformdev/next-app-router 20.7.1-alpha.118 → 20.7.1-alpha.121
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-Bekn8k24.d.mts → UniformComposition-CHUPULqc.d.mts} +1 -1
- package/dist/{UniformComposition-CdXfLiaB.d.ts → UniformComposition-r8a9xGZn.d.ts} +1 -1
- package/dist/cache.d.mts +1 -1
- package/dist/cache.d.ts +1 -1
- package/dist/cache.js +3 -4
- package/dist/cache.mjs +3 -4
- package/dist/compat.d.mts +2 -2
- package/dist/compat.d.ts +2 -2
- package/dist/index.d.mts +19 -10
- package/dist/index.d.ts +19 -10
- package/dist/index.esm.js +7 -16
- package/dist/index.js +7 -16
- package/dist/index.mjs +7 -16
- package/dist/middleware.js +2 -8
- package/dist/middleware.mjs +2 -8
- package/dist/{resolveRouteFromCode-CA63-EPp.d.mts → resolveRouteFromCode-CKaYNXte.d.mts} +3 -11
- package/dist/{resolveRouteFromCode-B2rqnHgJ.d.ts → resolveRouteFromCode-DgTsfMK8.d.ts} +3 -11
- package/package.json +8 -8
|
@@ -1,7 +1,7 @@
|
|
|
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 { a as ResolvedRouteResult, R as ResolveRouteFunction } from './resolveRouteFromCode-
|
|
4
|
+
import { a as ResolvedRouteResult, R as ResolveRouteFunction } from './resolveRouteFromCode-CKaYNXte.mjs';
|
|
5
5
|
import { ClientContextComponent } from '@uniformdev/next-app-router-client';
|
|
6
6
|
|
|
7
7
|
type CompositionCache = {
|
|
@@ -1,7 +1,7 @@
|
|
|
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 { a as ResolvedRouteResult, R as ResolveRouteFunction } from './resolveRouteFromCode-
|
|
4
|
+
import { a as ResolvedRouteResult, R as ResolveRouteFunction } from './resolveRouteFromCode-DgTsfMK8.js';
|
|
5
5
|
import { ClientContextComponent } from '@uniformdev/next-app-router-client';
|
|
6
6
|
|
|
7
7
|
type CompositionCache = {
|
package/dist/cache.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { R as ResolveRouteFunction } from './resolveRouteFromCode-
|
|
1
|
+
import { R as ResolveRouteFunction } from './resolveRouteFromCode-CKaYNXte.mjs';
|
|
2
2
|
import '@uniformdev/canvas';
|
|
3
3
|
import '@uniformdev/next-app-router-shared';
|
|
4
4
|
import './client-BCGVjYM-.mjs';
|
package/dist/cache.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { R as ResolveRouteFunction } from './resolveRouteFromCode-
|
|
1
|
+
import { R as ResolveRouteFunction } from './resolveRouteFromCode-DgTsfMK8.js';
|
|
2
2
|
import '@uniformdev/canvas';
|
|
3
3
|
import '@uniformdev/next-app-router-shared';
|
|
4
4
|
import './client-BCGVjYM-.js';
|
package/dist/cache.js
CHANGED
|
@@ -1871,10 +1871,9 @@ var DefaultDataClient = class {
|
|
|
1871
1871
|
|
|
1872
1872
|
// src/data/resolveRouteFromCode.ts
|
|
1873
1873
|
var resolveRouteFromCode = async ({
|
|
1874
|
-
|
|
1874
|
+
code,
|
|
1875
1875
|
dataClient: providedDataClient
|
|
1876
1876
|
}) => {
|
|
1877
|
-
const { code } = await params;
|
|
1878
1877
|
const pageState = (0, import_next_app_router_shared.deserializeEvaluationResult)({ input: code });
|
|
1879
1878
|
const dataClient = providedDataClient != null ? providedDataClient : new DefaultDataClient();
|
|
1880
1879
|
const { route } = await dataClient.getRoute({
|
|
@@ -1892,12 +1891,12 @@ var resolveRouteFromCode = async ({
|
|
|
1892
1891
|
|
|
1893
1892
|
// src/cache.ts
|
|
1894
1893
|
var resolveRouteFromCode2 = async ({
|
|
1895
|
-
|
|
1894
|
+
code,
|
|
1896
1895
|
dataClient: providedDataClient
|
|
1897
1896
|
}) => {
|
|
1898
1897
|
"use cache";
|
|
1899
1898
|
const result = await resolveRouteFromCode({
|
|
1900
|
-
|
|
1899
|
+
code,
|
|
1901
1900
|
dataClient: providedDataClient
|
|
1902
1901
|
});
|
|
1903
1902
|
if (process.env.NODE_ENV === "development") {
|
package/dist/cache.mjs
CHANGED
|
@@ -1860,10 +1860,9 @@ var DefaultDataClient = class {
|
|
|
1860
1860
|
|
|
1861
1861
|
// src/data/resolveRouteFromCode.ts
|
|
1862
1862
|
var resolveRouteFromCode = async ({
|
|
1863
|
-
|
|
1863
|
+
code,
|
|
1864
1864
|
dataClient: providedDataClient
|
|
1865
1865
|
}) => {
|
|
1866
|
-
const { code } = await params;
|
|
1867
1866
|
const pageState = deserializeEvaluationResult({ input: code });
|
|
1868
1867
|
const dataClient = providedDataClient != null ? providedDataClient : new DefaultDataClient();
|
|
1869
1868
|
const { route } = await dataClient.getRoute({
|
|
@@ -1881,12 +1880,12 @@ var resolveRouteFromCode = async ({
|
|
|
1881
1880
|
|
|
1882
1881
|
// src/cache.ts
|
|
1883
1882
|
var resolveRouteFromCode2 = async ({
|
|
1884
|
-
|
|
1883
|
+
code,
|
|
1885
1884
|
dataClient: providedDataClient
|
|
1886
1885
|
}) => {
|
|
1887
1886
|
"use cache";
|
|
1888
1887
|
const result = await resolveRouteFromCode({
|
|
1889
|
-
|
|
1888
|
+
code,
|
|
1890
1889
|
dataClient: providedDataClient
|
|
1891
1890
|
});
|
|
1892
1891
|
if (process.env.NODE_ENV === "development") {
|
package/dist/compat.d.mts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React, { ComponentType } from 'react';
|
|
2
2
|
import { ComponentProps as ComponentProps$1, ComponentParameter } from '@uniformdev/next-app-router-shared';
|
|
3
3
|
import { U as UniformTextProps$1 } from './UniformText-ChMwHBw4.mjs';
|
|
4
|
-
import { R as ResolveComponentResult, a as ResolveComponentFunction } from './UniformComposition-
|
|
4
|
+
import { R as ResolveComponentResult, a as ResolveComponentFunction } from './UniformComposition-CHUPULqc.mjs';
|
|
5
5
|
import '@uniformdev/next-app-router-client';
|
|
6
6
|
import '@uniformdev/canvas';
|
|
7
|
-
import './resolveRouteFromCode-
|
|
7
|
+
import './resolveRouteFromCode-CKaYNXte.mjs';
|
|
8
8
|
import './client-BCGVjYM-.mjs';
|
|
9
9
|
import '@uniformdev/context';
|
|
10
10
|
|
package/dist/compat.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React, { ComponentType } from 'react';
|
|
2
2
|
import { ComponentProps as ComponentProps$1, ComponentParameter } from '@uniformdev/next-app-router-shared';
|
|
3
3
|
import { U as UniformTextProps$1 } from './UniformText-ChMwHBw4.js';
|
|
4
|
-
import { R as ResolveComponentResult, a as ResolveComponentFunction } from './UniformComposition-
|
|
4
|
+
import { R as ResolveComponentResult, a as ResolveComponentFunction } from './UniformComposition-r8a9xGZn.js';
|
|
5
5
|
import '@uniformdev/next-app-router-client';
|
|
6
6
|
import '@uniformdev/canvas';
|
|
7
|
-
import './resolveRouteFromCode-
|
|
7
|
+
import './resolveRouteFromCode-DgTsfMK8.js';
|
|
8
8
|
import './client-BCGVjYM-.js';
|
|
9
9
|
import '@uniformdev/context';
|
|
10
10
|
|
package/dist/index.d.mts
CHANGED
|
@@ -2,12 +2,12 @@ import { CanvasClient, 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-
|
|
7
|
-
import { a as ResolvedRouteResult } from './resolveRouteFromCode-CA63-EPp.mjs';
|
|
8
|
-
export { A as AwaitedUniformPageParameters, R as ResolveRouteFunction, U as UniformPageParameters, r as resolveRouteFromCode } from './resolveRouteFromCode-CA63-EPp.mjs';
|
|
5
|
+
import { U as UniformCompositionProps } from './UniformComposition-CHUPULqc.mjs';
|
|
6
|
+
export { C as CompositionCache, a as ResolveComponentFunction, R as ResolveComponentResult, b as UniformComposition, c as createCompositionCache } from './UniformComposition-CHUPULqc.mjs';
|
|
9
7
|
import React from 'react';
|
|
10
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-BCGVjYM-.mjs';
|
|
9
|
+
import { a as ResolvedRouteResult } from './resolveRouteFromCode-CKaYNXte.mjs';
|
|
10
|
+
export { R as ResolveRouteFunction, r as resolveRouteFromCode } from './resolveRouteFromCode-CKaYNXte.mjs';
|
|
11
11
|
import '@uniformdev/next-app-router-client';
|
|
12
12
|
import '@uniformdev/context';
|
|
13
13
|
|
|
@@ -197,6 +197,15 @@ type PlaygroundParameters = {
|
|
|
197
197
|
}>;
|
|
198
198
|
};
|
|
199
199
|
|
|
200
|
+
type UniformPageParameters = {
|
|
201
|
+
params: Promise<{
|
|
202
|
+
code: string;
|
|
203
|
+
}>;
|
|
204
|
+
};
|
|
205
|
+
type AwaitedUniformPageParameters = {
|
|
206
|
+
params: Awaited<UniformPageParameters['params']>;
|
|
207
|
+
};
|
|
208
|
+
|
|
200
209
|
type UniformPlaygroundProps = UniformCompositionProps;
|
|
201
210
|
declare const UniformPlayground: ({ resolveRoute, ...rest }: UniformPlaygroundProps) => Promise<React.JSX.Element>;
|
|
202
211
|
|
|
@@ -207,8 +216,7 @@ type CreateStaticParamsOptions = {
|
|
|
207
216
|
}) => Promise<RewriteRequestPathResult | undefined>;
|
|
208
217
|
};
|
|
209
218
|
/**
|
|
210
|
-
*
|
|
211
|
-
* Experimental function to generate all possible page states for the given paths.
|
|
219
|
+
* Function to generate all possible page states for the given paths in playground mode.
|
|
212
220
|
* @param options
|
|
213
221
|
* @returns
|
|
214
222
|
*/
|
|
@@ -216,8 +224,7 @@ declare const createUniformPlaygroundStaticParams: (options: CreateStaticParamsO
|
|
|
216
224
|
code: string;
|
|
217
225
|
}[]>;
|
|
218
226
|
/**
|
|
219
|
-
*
|
|
220
|
-
* Experimental function to generate all possible page states for the given paths.
|
|
227
|
+
* Function to generate all possible page states for the given paths.
|
|
221
228
|
* @param options
|
|
222
229
|
* @returns
|
|
223
230
|
*/
|
|
@@ -247,7 +254,9 @@ type PrecomputeCompositionOptions = Pick<ResolvedRouteResult, 'pageState' | 'rou
|
|
|
247
254
|
};
|
|
248
255
|
declare const precomputeComposition: ({ pageState, route, evaluatePersonalizations, evaluateTests, }: PrecomputeCompositionOptions) => Promise<void>;
|
|
249
256
|
|
|
250
|
-
declare const resolvePlaygroundRoute: ({
|
|
257
|
+
declare const resolvePlaygroundRoute: ({ code }: {
|
|
258
|
+
code: string;
|
|
259
|
+
}) => Promise<ResolvedRouteResult>;
|
|
251
260
|
|
|
252
261
|
type CustomRoute = {
|
|
253
262
|
id: string;
|
|
@@ -261,4 +270,4 @@ declare const findRouteMatch: (routes: CustomRoute[], path: string) => RouteMatc
|
|
|
261
270
|
|
|
262
271
|
declare const serverContext: <T>(defaultValue?: T) => [() => T | undefined, (v: T) => void];
|
|
263
272
|
|
|
264
|
-
export { type CreateStaticParamsOptions, type CustomRoute, type GetCanvasClientOptions, type GetManifestClientOptions, type GetProjectMapClientOptions, type GetRouteClientOptions, type PlaygroundParameters, type RouteMatch, UniformCompositionProps, UniformPlayground, createUniformPlaygroundStaticParams, createUniformStaticParams, findRouteMatch, getCanvasClient, getManifest, getManifestClient, getProjectMapClient, getRouteClient, precomputeComposition, resolvePlaygroundRoute, serverContext };
|
|
273
|
+
export { type AwaitedUniformPageParameters, type CreateStaticParamsOptions, type CustomRoute, type GetCanvasClientOptions, type GetManifestClientOptions, type GetProjectMapClientOptions, type GetRouteClientOptions, type PlaygroundParameters, type RouteMatch, UniformCompositionProps, type UniformPageParameters, UniformPlayground, createUniformPlaygroundStaticParams, createUniformStaticParams, findRouteMatch, getCanvasClient, getManifest, getManifestClient, getProjectMapClient, getRouteClient, precomputeComposition, resolvePlaygroundRoute, serverContext };
|
package/dist/index.d.ts
CHANGED
|
@@ -2,12 +2,12 @@ import { CanvasClient, 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-
|
|
7
|
-
import { a as ResolvedRouteResult } from './resolveRouteFromCode-B2rqnHgJ.js';
|
|
8
|
-
export { A as AwaitedUniformPageParameters, R as ResolveRouteFunction, U as UniformPageParameters, r as resolveRouteFromCode } from './resolveRouteFromCode-B2rqnHgJ.js';
|
|
5
|
+
import { U as UniformCompositionProps } from './UniformComposition-r8a9xGZn.js';
|
|
6
|
+
export { C as CompositionCache, a as ResolveComponentFunction, R as ResolveComponentResult, b as UniformComposition, c as createCompositionCache } from './UniformComposition-r8a9xGZn.js';
|
|
9
7
|
import React from 'react';
|
|
10
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-BCGVjYM-.js';
|
|
9
|
+
import { a as ResolvedRouteResult } from './resolveRouteFromCode-DgTsfMK8.js';
|
|
10
|
+
export { R as ResolveRouteFunction, r as resolveRouteFromCode } from './resolveRouteFromCode-DgTsfMK8.js';
|
|
11
11
|
import '@uniformdev/next-app-router-client';
|
|
12
12
|
import '@uniformdev/context';
|
|
13
13
|
|
|
@@ -197,6 +197,15 @@ type PlaygroundParameters = {
|
|
|
197
197
|
}>;
|
|
198
198
|
};
|
|
199
199
|
|
|
200
|
+
type UniformPageParameters = {
|
|
201
|
+
params: Promise<{
|
|
202
|
+
code: string;
|
|
203
|
+
}>;
|
|
204
|
+
};
|
|
205
|
+
type AwaitedUniformPageParameters = {
|
|
206
|
+
params: Awaited<UniformPageParameters['params']>;
|
|
207
|
+
};
|
|
208
|
+
|
|
200
209
|
type UniformPlaygroundProps = UniformCompositionProps;
|
|
201
210
|
declare const UniformPlayground: ({ resolveRoute, ...rest }: UniformPlaygroundProps) => Promise<React.JSX.Element>;
|
|
202
211
|
|
|
@@ -207,8 +216,7 @@ type CreateStaticParamsOptions = {
|
|
|
207
216
|
}) => Promise<RewriteRequestPathResult | undefined>;
|
|
208
217
|
};
|
|
209
218
|
/**
|
|
210
|
-
*
|
|
211
|
-
* Experimental function to generate all possible page states for the given paths.
|
|
219
|
+
* Function to generate all possible page states for the given paths in playground mode.
|
|
212
220
|
* @param options
|
|
213
221
|
* @returns
|
|
214
222
|
*/
|
|
@@ -216,8 +224,7 @@ declare const createUniformPlaygroundStaticParams: (options: CreateStaticParamsO
|
|
|
216
224
|
code: string;
|
|
217
225
|
}[]>;
|
|
218
226
|
/**
|
|
219
|
-
*
|
|
220
|
-
* Experimental function to generate all possible page states for the given paths.
|
|
227
|
+
* Function to generate all possible page states for the given paths.
|
|
221
228
|
* @param options
|
|
222
229
|
* @returns
|
|
223
230
|
*/
|
|
@@ -247,7 +254,9 @@ type PrecomputeCompositionOptions = Pick<ResolvedRouteResult, 'pageState' | 'rou
|
|
|
247
254
|
};
|
|
248
255
|
declare const precomputeComposition: ({ pageState, route, evaluatePersonalizations, evaluateTests, }: PrecomputeCompositionOptions) => Promise<void>;
|
|
249
256
|
|
|
250
|
-
declare const resolvePlaygroundRoute: ({
|
|
257
|
+
declare const resolvePlaygroundRoute: ({ code }: {
|
|
258
|
+
code: string;
|
|
259
|
+
}) => Promise<ResolvedRouteResult>;
|
|
251
260
|
|
|
252
261
|
type CustomRoute = {
|
|
253
262
|
id: string;
|
|
@@ -261,4 +270,4 @@ declare const findRouteMatch: (routes: CustomRoute[], path: string) => RouteMatc
|
|
|
261
270
|
|
|
262
271
|
declare const serverContext: <T>(defaultValue?: T) => [() => T | undefined, (v: T) => void];
|
|
263
272
|
|
|
264
|
-
export { type CreateStaticParamsOptions, type CustomRoute, type GetCanvasClientOptions, type GetManifestClientOptions, type GetProjectMapClientOptions, type GetRouteClientOptions, type PlaygroundParameters, type RouteMatch, UniformCompositionProps, UniformPlayground, createUniformPlaygroundStaticParams, createUniformStaticParams, findRouteMatch, getCanvasClient, getManifest, getManifestClient, getProjectMapClient, getRouteClient, precomputeComposition, resolvePlaygroundRoute, serverContext };
|
|
273
|
+
export { type AwaitedUniformPageParameters, type CreateStaticParamsOptions, type CustomRoute, type GetCanvasClientOptions, type GetManifestClientOptions, type GetProjectMapClientOptions, type GetRouteClientOptions, type PlaygroundParameters, type RouteMatch, UniformCompositionProps, type UniformPageParameters, UniformPlayground, createUniformPlaygroundStaticParams, createUniformStaticParams, findRouteMatch, getCanvasClient, getManifest, getManifestClient, getProjectMapClient, getRouteClient, precomputeComposition, resolvePlaygroundRoute, serverContext };
|
package/dist/index.esm.js
CHANGED
|
@@ -2884,7 +2884,7 @@ async function UniformCompositionInner({
|
|
|
2884
2884
|
}) {
|
|
2885
2885
|
var _a, _b;
|
|
2886
2886
|
const result = await resolveRoute({
|
|
2887
|
-
|
|
2887
|
+
code
|
|
2888
2888
|
});
|
|
2889
2889
|
if (!(result == null ? void 0 : result.route) || ((_a = result == null ? void 0 : result.route) == null ? void 0 : _a.type) !== "composition") {
|
|
2890
2890
|
notFound();
|
|
@@ -3182,10 +3182,7 @@ import React6 from "react";
|
|
|
3182
3182
|
|
|
3183
3183
|
// src/data/resolvePlaygroundRoute.ts
|
|
3184
3184
|
import { deserializeEvaluationResult as deserializeEvaluationResult2 } from "@uniformdev/next-app-router-shared";
|
|
3185
|
-
var resolvePlaygroundRoute = async ({
|
|
3186
|
-
params
|
|
3187
|
-
}) => {
|
|
3188
|
-
const { code } = await params;
|
|
3185
|
+
var resolvePlaygroundRoute = async ({ code }) => {
|
|
3189
3186
|
const pageState = deserializeEvaluationResult2({ input: code });
|
|
3190
3187
|
const canvasClient = getCanvasClient({
|
|
3191
3188
|
cache: {
|
|
@@ -3283,18 +3280,12 @@ var extractPersonalization = ({
|
|
|
3283
3280
|
|
|
3284
3281
|
// src/data/extract/extractRunnables.ts
|
|
3285
3282
|
var findAncestorVariant = (ancestorsAndSelf) => {
|
|
3286
|
-
let
|
|
3287
|
-
for (let i = 1; i < ancestorsAndSelf.length; i++) {
|
|
3283
|
+
for (let i = 0; i < ancestorsAndSelf.length; i++) {
|
|
3288
3284
|
const node = ancestorsAndSelf[i];
|
|
3289
3285
|
if (node.type === "slot" && (node.parentSlot === CANVAS_PERSONALIZE_SLOT || node.parentSlot === CANVAS_TEST_SLOT)) {
|
|
3290
|
-
|
|
3291
|
-
break;
|
|
3286
|
+
return node.node._id;
|
|
3292
3287
|
}
|
|
3293
3288
|
}
|
|
3294
|
-
if (nodeIndex !== -1) {
|
|
3295
|
-
const node = ancestorsAndSelf[nodeIndex];
|
|
3296
|
-
return node.node._id;
|
|
3297
|
-
}
|
|
3298
3289
|
return void 0;
|
|
3299
3290
|
};
|
|
3300
3291
|
var extractRunnables = (composition) => {
|
|
@@ -3514,7 +3505,8 @@ var generateStatesRecursively = (dependencyMap, parentVariantId, currentState) =
|
|
|
3514
3505
|
const mergedState = applyChoicesToPageState(currentState, groups, permutation);
|
|
3515
3506
|
const selectedVariantIds = extractSelectedVariantIds(groups, permutation);
|
|
3516
3507
|
let subResults = [mergedState];
|
|
3517
|
-
|
|
3508
|
+
const uniqueVariantIds = [...new Set(selectedVariantIds)].filter((id) => id !== void 0);
|
|
3509
|
+
for (const variantId of uniqueVariantIds) {
|
|
3518
3510
|
if (dependencyMap.has(variantId)) {
|
|
3519
3511
|
subResults = subResults.flatMap(
|
|
3520
3512
|
(state) => generateStatesRecursively(dependencyMap, variantId, state)
|
|
@@ -3818,10 +3810,9 @@ var precomputeComposition = ({
|
|
|
3818
3810
|
// src/data/resolveRouteFromCode.ts
|
|
3819
3811
|
import { deserializeEvaluationResult as deserializeEvaluationResult3 } from "@uniformdev/next-app-router-shared";
|
|
3820
3812
|
var resolveRouteFromCode = async ({
|
|
3821
|
-
|
|
3813
|
+
code,
|
|
3822
3814
|
dataClient: providedDataClient
|
|
3823
3815
|
}) => {
|
|
3824
|
-
const { code } = await params;
|
|
3825
3816
|
const pageState = deserializeEvaluationResult3({ input: code });
|
|
3826
3817
|
const dataClient = providedDataClient != null ? providedDataClient : new DefaultDataClient();
|
|
3827
3818
|
const { route } = await dataClient.getRoute({
|
package/dist/index.js
CHANGED
|
@@ -2907,7 +2907,7 @@ async function UniformCompositionInner({
|
|
|
2907
2907
|
}) {
|
|
2908
2908
|
var _a, _b;
|
|
2909
2909
|
const result = await resolveRoute({
|
|
2910
|
-
|
|
2910
|
+
code
|
|
2911
2911
|
});
|
|
2912
2912
|
if (!(result == null ? void 0 : result.route) || ((_a = result == null ? void 0 : result.route) == null ? void 0 : _a.type) !== "composition") {
|
|
2913
2913
|
(0, import_navigation.notFound)();
|
|
@@ -3205,10 +3205,7 @@ var import_react7 = __toESM(require("react"));
|
|
|
3205
3205
|
|
|
3206
3206
|
// src/data/resolvePlaygroundRoute.ts
|
|
3207
3207
|
var import_next_app_router_shared5 = require("@uniformdev/next-app-router-shared");
|
|
3208
|
-
var resolvePlaygroundRoute = async ({
|
|
3209
|
-
params
|
|
3210
|
-
}) => {
|
|
3211
|
-
const { code } = await params;
|
|
3208
|
+
var resolvePlaygroundRoute = async ({ code }) => {
|
|
3212
3209
|
const pageState = (0, import_next_app_router_shared5.deserializeEvaluationResult)({ input: code });
|
|
3213
3210
|
const canvasClient = getCanvasClient({
|
|
3214
3211
|
cache: {
|
|
@@ -3304,18 +3301,12 @@ var extractPersonalization = ({
|
|
|
3304
3301
|
|
|
3305
3302
|
// src/data/extract/extractRunnables.ts
|
|
3306
3303
|
var findAncestorVariant = (ancestorsAndSelf) => {
|
|
3307
|
-
let
|
|
3308
|
-
for (let i = 1; i < ancestorsAndSelf.length; i++) {
|
|
3304
|
+
for (let i = 0; i < ancestorsAndSelf.length; i++) {
|
|
3309
3305
|
const node = ancestorsAndSelf[i];
|
|
3310
3306
|
if (node.type === "slot" && (node.parentSlot === CANVAS_PERSONALIZE_SLOT || node.parentSlot === CANVAS_TEST_SLOT)) {
|
|
3311
|
-
|
|
3312
|
-
break;
|
|
3307
|
+
return node.node._id;
|
|
3313
3308
|
}
|
|
3314
3309
|
}
|
|
3315
|
-
if (nodeIndex !== -1) {
|
|
3316
|
-
const node = ancestorsAndSelf[nodeIndex];
|
|
3317
|
-
return node.node._id;
|
|
3318
|
-
}
|
|
3319
3310
|
return void 0;
|
|
3320
3311
|
};
|
|
3321
3312
|
var extractRunnables = (composition) => {
|
|
@@ -3535,7 +3526,8 @@ var generateStatesRecursively = (dependencyMap, parentVariantId, currentState) =
|
|
|
3535
3526
|
const mergedState = applyChoicesToPageState(currentState, groups, permutation);
|
|
3536
3527
|
const selectedVariantIds = extractSelectedVariantIds(groups, permutation);
|
|
3537
3528
|
let subResults = [mergedState];
|
|
3538
|
-
|
|
3529
|
+
const uniqueVariantIds = [...new Set(selectedVariantIds)].filter((id) => id !== void 0);
|
|
3530
|
+
for (const variantId of uniqueVariantIds) {
|
|
3539
3531
|
if (dependencyMap.has(variantId)) {
|
|
3540
3532
|
subResults = subResults.flatMap(
|
|
3541
3533
|
(state) => generateStatesRecursively(dependencyMap, variantId, state)
|
|
@@ -3835,10 +3827,9 @@ var precomputeComposition = ({
|
|
|
3835
3827
|
// src/data/resolveRouteFromCode.ts
|
|
3836
3828
|
var import_next_app_router_shared10 = require("@uniformdev/next-app-router-shared");
|
|
3837
3829
|
var resolveRouteFromCode = async ({
|
|
3838
|
-
|
|
3830
|
+
code,
|
|
3839
3831
|
dataClient: providedDataClient
|
|
3840
3832
|
}) => {
|
|
3841
|
-
const { code } = await params;
|
|
3842
3833
|
const pageState = (0, import_next_app_router_shared10.deserializeEvaluationResult)({ input: code });
|
|
3843
3834
|
const dataClient = providedDataClient != null ? providedDataClient : new DefaultDataClient();
|
|
3844
3835
|
const { route } = await dataClient.getRoute({
|
package/dist/index.mjs
CHANGED
|
@@ -2884,7 +2884,7 @@ async function UniformCompositionInner({
|
|
|
2884
2884
|
}) {
|
|
2885
2885
|
var _a, _b;
|
|
2886
2886
|
const result = await resolveRoute({
|
|
2887
|
-
|
|
2887
|
+
code
|
|
2888
2888
|
});
|
|
2889
2889
|
if (!(result == null ? void 0 : result.route) || ((_a = result == null ? void 0 : result.route) == null ? void 0 : _a.type) !== "composition") {
|
|
2890
2890
|
notFound();
|
|
@@ -3182,10 +3182,7 @@ import React6 from "react";
|
|
|
3182
3182
|
|
|
3183
3183
|
// src/data/resolvePlaygroundRoute.ts
|
|
3184
3184
|
import { deserializeEvaluationResult as deserializeEvaluationResult2 } from "@uniformdev/next-app-router-shared";
|
|
3185
|
-
var resolvePlaygroundRoute = async ({
|
|
3186
|
-
params
|
|
3187
|
-
}) => {
|
|
3188
|
-
const { code } = await params;
|
|
3185
|
+
var resolvePlaygroundRoute = async ({ code }) => {
|
|
3189
3186
|
const pageState = deserializeEvaluationResult2({ input: code });
|
|
3190
3187
|
const canvasClient = getCanvasClient({
|
|
3191
3188
|
cache: {
|
|
@@ -3283,18 +3280,12 @@ var extractPersonalization = ({
|
|
|
3283
3280
|
|
|
3284
3281
|
// src/data/extract/extractRunnables.ts
|
|
3285
3282
|
var findAncestorVariant = (ancestorsAndSelf) => {
|
|
3286
|
-
let
|
|
3287
|
-
for (let i = 1; i < ancestorsAndSelf.length; i++) {
|
|
3283
|
+
for (let i = 0; i < ancestorsAndSelf.length; i++) {
|
|
3288
3284
|
const node = ancestorsAndSelf[i];
|
|
3289
3285
|
if (node.type === "slot" && (node.parentSlot === CANVAS_PERSONALIZE_SLOT || node.parentSlot === CANVAS_TEST_SLOT)) {
|
|
3290
|
-
|
|
3291
|
-
break;
|
|
3286
|
+
return node.node._id;
|
|
3292
3287
|
}
|
|
3293
3288
|
}
|
|
3294
|
-
if (nodeIndex !== -1) {
|
|
3295
|
-
const node = ancestorsAndSelf[nodeIndex];
|
|
3296
|
-
return node.node._id;
|
|
3297
|
-
}
|
|
3298
3289
|
return void 0;
|
|
3299
3290
|
};
|
|
3300
3291
|
var extractRunnables = (composition) => {
|
|
@@ -3514,7 +3505,8 @@ var generateStatesRecursively = (dependencyMap, parentVariantId, currentState) =
|
|
|
3514
3505
|
const mergedState = applyChoicesToPageState(currentState, groups, permutation);
|
|
3515
3506
|
const selectedVariantIds = extractSelectedVariantIds(groups, permutation);
|
|
3516
3507
|
let subResults = [mergedState];
|
|
3517
|
-
|
|
3508
|
+
const uniqueVariantIds = [...new Set(selectedVariantIds)].filter((id) => id !== void 0);
|
|
3509
|
+
for (const variantId of uniqueVariantIds) {
|
|
3518
3510
|
if (dependencyMap.has(variantId)) {
|
|
3519
3511
|
subResults = subResults.flatMap(
|
|
3520
3512
|
(state) => generateStatesRecursively(dependencyMap, variantId, state)
|
|
@@ -3818,10 +3810,9 @@ var precomputeComposition = ({
|
|
|
3818
3810
|
// src/data/resolveRouteFromCode.ts
|
|
3819
3811
|
import { deserializeEvaluationResult as deserializeEvaluationResult3 } from "@uniformdev/next-app-router-shared";
|
|
3820
3812
|
var resolveRouteFromCode = async ({
|
|
3821
|
-
|
|
3813
|
+
code,
|
|
3822
3814
|
dataClient: providedDataClient
|
|
3823
3815
|
}) => {
|
|
3824
|
-
const { code } = await params;
|
|
3825
3816
|
const pageState = deserializeEvaluationResult3({ input: code });
|
|
3826
3817
|
const dataClient = providedDataClient != null ? providedDataClient : new DefaultDataClient();
|
|
3827
3818
|
const { route } = await dataClient.getRoute({
|
package/dist/middleware.js
CHANGED
|
@@ -5108,18 +5108,12 @@ var extractTest = ({ component }) => {
|
|
|
5108
5108
|
|
|
5109
5109
|
// src/data/extract/extractRunnables.ts
|
|
5110
5110
|
var findAncestorVariant = (ancestorsAndSelf) => {
|
|
5111
|
-
let
|
|
5112
|
-
for (let i = 1; i < ancestorsAndSelf.length; i++) {
|
|
5111
|
+
for (let i = 0; i < ancestorsAndSelf.length; i++) {
|
|
5113
5112
|
const node = ancestorsAndSelf[i];
|
|
5114
5113
|
if (node.type === "slot" && (node.parentSlot === CANVAS_PERSONALIZE_SLOT || node.parentSlot === CANVAS_TEST_SLOT)) {
|
|
5115
|
-
|
|
5116
|
-
break;
|
|
5114
|
+
return node.node._id;
|
|
5117
5115
|
}
|
|
5118
5116
|
}
|
|
5119
|
-
if (nodeIndex !== -1) {
|
|
5120
|
-
const node = ancestorsAndSelf[nodeIndex];
|
|
5121
|
-
return node.node._id;
|
|
5122
|
-
}
|
|
5123
5117
|
return void 0;
|
|
5124
5118
|
};
|
|
5125
5119
|
var extractRunnables = (composition) => {
|
package/dist/middleware.mjs
CHANGED
|
@@ -5100,18 +5100,12 @@ var extractTest = ({ component }) => {
|
|
|
5100
5100
|
|
|
5101
5101
|
// src/data/extract/extractRunnables.ts
|
|
5102
5102
|
var findAncestorVariant = (ancestorsAndSelf) => {
|
|
5103
|
-
let
|
|
5104
|
-
for (let i = 1; i < ancestorsAndSelf.length; i++) {
|
|
5103
|
+
for (let i = 0; i < ancestorsAndSelf.length; i++) {
|
|
5105
5104
|
const node = ancestorsAndSelf[i];
|
|
5106
5105
|
if (node.type === "slot" && (node.parentSlot === CANVAS_PERSONALIZE_SLOT || node.parentSlot === CANVAS_TEST_SLOT)) {
|
|
5107
|
-
|
|
5108
|
-
break;
|
|
5106
|
+
return node.node._id;
|
|
5109
5107
|
}
|
|
5110
5108
|
}
|
|
5111
|
-
if (nodeIndex !== -1) {
|
|
5112
|
-
const node = ancestorsAndSelf[nodeIndex];
|
|
5113
|
-
return node.node._id;
|
|
5114
|
-
}
|
|
5115
5109
|
return void 0;
|
|
5116
5110
|
};
|
|
5117
5111
|
var extractRunnables = (composition) => {
|
|
@@ -2,15 +2,6 @@ import { RouteGetResponseEdgehancedComposition } from '@uniformdev/canvas';
|
|
|
2
2
|
import { PageState } from '@uniformdev/next-app-router-shared';
|
|
3
3
|
import { D as DataClient } from './client-BCGVjYM-.mjs';
|
|
4
4
|
|
|
5
|
-
type UniformPageParameters = {
|
|
6
|
-
params: Promise<{
|
|
7
|
-
code: string;
|
|
8
|
-
}>;
|
|
9
|
-
};
|
|
10
|
-
type AwaitedUniformPageParameters = {
|
|
11
|
-
params: Awaited<UniformPageParameters['params']>;
|
|
12
|
-
};
|
|
13
|
-
|
|
14
5
|
type ResolvedRouteResult = {
|
|
15
6
|
pageState: PageState;
|
|
16
7
|
route: RouteGetResponseEdgehancedComposition | undefined;
|
|
@@ -18,9 +9,10 @@ type ResolvedRouteResult = {
|
|
|
18
9
|
};
|
|
19
10
|
|
|
20
11
|
type ResolveRouteFunction = (options: ResolveRouteFromCodeOptions) => Promise<ResolvedRouteResult>;
|
|
21
|
-
type ResolveRouteFromCodeOptions =
|
|
12
|
+
type ResolveRouteFromCodeOptions = {
|
|
13
|
+
code: string;
|
|
22
14
|
dataClient?: DataClient;
|
|
23
15
|
};
|
|
24
16
|
declare const resolveRouteFromCode: ResolveRouteFunction;
|
|
25
17
|
|
|
26
|
-
export { type
|
|
18
|
+
export { type ResolveRouteFunction as R, type ResolvedRouteResult as a, resolveRouteFromCode as r };
|
|
@@ -2,15 +2,6 @@ import { RouteGetResponseEdgehancedComposition } from '@uniformdev/canvas';
|
|
|
2
2
|
import { PageState } from '@uniformdev/next-app-router-shared';
|
|
3
3
|
import { D as DataClient } from './client-BCGVjYM-.js';
|
|
4
4
|
|
|
5
|
-
type UniformPageParameters = {
|
|
6
|
-
params: Promise<{
|
|
7
|
-
code: string;
|
|
8
|
-
}>;
|
|
9
|
-
};
|
|
10
|
-
type AwaitedUniformPageParameters = {
|
|
11
|
-
params: Awaited<UniformPageParameters['params']>;
|
|
12
|
-
};
|
|
13
|
-
|
|
14
5
|
type ResolvedRouteResult = {
|
|
15
6
|
pageState: PageState;
|
|
16
7
|
route: RouteGetResponseEdgehancedComposition | undefined;
|
|
@@ -18,9 +9,10 @@ type ResolvedRouteResult = {
|
|
|
18
9
|
};
|
|
19
10
|
|
|
20
11
|
type ResolveRouteFunction = (options: ResolveRouteFromCodeOptions) => Promise<ResolvedRouteResult>;
|
|
21
|
-
type ResolveRouteFromCodeOptions =
|
|
12
|
+
type ResolveRouteFromCodeOptions = {
|
|
13
|
+
code: string;
|
|
22
14
|
dataClient?: DataClient;
|
|
23
15
|
};
|
|
24
16
|
declare const resolveRouteFromCode: ResolveRouteFunction;
|
|
25
17
|
|
|
26
|
-
export { type
|
|
18
|
+
export { type ResolveRouteFunction as R, type ResolvedRouteResult as a, resolveRouteFromCode as r };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uniformdev/next-app-router",
|
|
3
|
-
"version": "20.7.1-alpha.
|
|
3
|
+
"version": "20.7.1-alpha.121+a4f284458c",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "tsup",
|
|
@@ -86,12 +86,12 @@
|
|
|
86
86
|
"typescript": "5.9.2"
|
|
87
87
|
},
|
|
88
88
|
"dependencies": {
|
|
89
|
-
"@uniformdev/canvas-react": "20.7.1-alpha.
|
|
90
|
-
"@uniformdev/next-app-router-client": "20.7.1-alpha.
|
|
91
|
-
"@uniformdev/next-app-router-shared": "20.7.1-alpha.
|
|
92
|
-
"@uniformdev/redirect": "20.7.1-alpha.
|
|
93
|
-
"@uniformdev/richtext": "20.7.1-alpha.
|
|
94
|
-
"@uniformdev/webhooks": "20.7.1-alpha.
|
|
89
|
+
"@uniformdev/canvas-react": "20.7.1-alpha.121+a4f284458c",
|
|
90
|
+
"@uniformdev/next-app-router-client": "20.7.1-alpha.121+a4f284458c",
|
|
91
|
+
"@uniformdev/next-app-router-shared": "20.7.1-alpha.121+a4f284458c",
|
|
92
|
+
"@uniformdev/redirect": "20.7.1-alpha.121+a4f284458c",
|
|
93
|
+
"@uniformdev/richtext": "20.7.1-alpha.121+a4f284458c",
|
|
94
|
+
"@uniformdev/webhooks": "20.7.1-alpha.121+a4f284458c",
|
|
95
95
|
"@vercel/functions": "^2.2.2",
|
|
96
96
|
"encoding": "^0.1.13",
|
|
97
97
|
"server-only": "^0.0.1",
|
|
@@ -108,5 +108,5 @@
|
|
|
108
108
|
"publishConfig": {
|
|
109
109
|
"access": "public"
|
|
110
110
|
},
|
|
111
|
-
"gitHead": "
|
|
111
|
+
"gitHead": "a4f284458cffb24442299a5210bdad47c05aada3"
|
|
112
112
|
}
|