@uniformdev/next-app-router 20.50.2-alpha.9 → 20.50.2-alpha.96
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-d7_93l3F.d.ts → UniformComposition-BV6YnA2a.d.ts} +2 -2
- package/dist/{UniformComposition-hhRIBHmn.d.mts → UniformComposition-scIgVvIH.d.mts} +2 -2
- package/dist/cache.d.mts +2 -2
- package/dist/cache.d.ts +2 -2
- package/dist/cache.js +47 -21
- package/dist/cache.mjs +47 -21
- package/dist/{client-BCGVjYM-.d.mts → client-BlKZeE6C.d.mts} +1 -1
- package/dist/{client-BCGVjYM-.d.ts → client-BlKZeE6C.d.ts} +1 -1
- package/dist/compat.d.mts +3 -3
- package/dist/compat.d.ts +3 -3
- package/dist/component.js +27 -15
- package/dist/component.mjs +27 -15
- package/dist/handler.js +34 -17
- package/dist/handler.mjs +34 -17
- package/dist/index.d.mts +5 -5
- package/dist/index.d.ts +5 -5
- package/dist/index.esm.js +91 -61
- package/dist/index.js +91 -61
- package/dist/index.mjs +91 -61
- package/dist/middleware.d.mts +2 -2
- package/dist/middleware.d.ts +2 -2
- package/dist/middleware.js +108 -75
- package/dist/middleware.mjs +108 -75
- package/dist/{resolveRouteFromCode-DgTsfMK8.d.ts → resolveRouteFromCode-3u61IwOW.d.ts} +1 -1
- package/dist/{resolveRouteFromCode-CKaYNXte.d.mts → resolveRouteFromCode-_CdAMtVM.d.mts} +1 -1
- package/package.json +10 -10
package/dist/middleware.mjs
CHANGED
|
@@ -515,6 +515,20 @@ async function handleRateLimits(callApi) {
|
|
|
515
515
|
}
|
|
516
516
|
return response;
|
|
517
517
|
}
|
|
518
|
+
var isPlainObject = (obj) => typeof obj === "object" && obj !== null && !Array.isArray(obj);
|
|
519
|
+
function rewriteFiltersForApi(filters) {
|
|
520
|
+
return Object.entries(filters != null ? filters : {}).reduce(
|
|
521
|
+
(acc, [key, value]) => {
|
|
522
|
+
const lhs = `filters.${key}` + (isPlainObject(value) ? `[${Object.keys(value)[0]}]` : "");
|
|
523
|
+
const rhs = isPlainObject(value) ? Object.values(value)[0] : value;
|
|
524
|
+
return {
|
|
525
|
+
...acc,
|
|
526
|
+
[lhs]: Array.isArray(rhs) ? rhs.map((v) => `${v}`.trim()).join(",") : `${rhs}`.trim()
|
|
527
|
+
};
|
|
528
|
+
},
|
|
529
|
+
{}
|
|
530
|
+
);
|
|
531
|
+
}
|
|
518
532
|
var _url;
|
|
519
533
|
var _AggregateClient = class _AggregateClient2 extends ApiClient {
|
|
520
534
|
constructor(options) {
|
|
@@ -1298,20 +1312,6 @@ function createLimitPolicy({
|
|
|
1298
1312
|
return currentFunc();
|
|
1299
1313
|
};
|
|
1300
1314
|
}
|
|
1301
|
-
var isPlainObject = (obj) => typeof obj === "object" && obj !== null && !Array.isArray(obj);
|
|
1302
|
-
function rewriteFilters(filters) {
|
|
1303
|
-
return Object.entries(filters != null ? filters : {}).reduce(
|
|
1304
|
-
(acc, [key, value]) => {
|
|
1305
|
-
const lhs = `filters.${key}` + (isPlainObject(value) ? `[${Object.keys(value)[0]}]` : "");
|
|
1306
|
-
const rhs = isPlainObject(value) ? Object.values(value)[0] : value;
|
|
1307
|
-
return {
|
|
1308
|
-
...acc,
|
|
1309
|
-
[lhs]: Array.isArray(rhs) ? rhs.map((v) => `${v}`.trim()).join(",") : `${rhs}`.trim()
|
|
1310
|
-
};
|
|
1311
|
-
},
|
|
1312
|
-
{}
|
|
1313
|
-
);
|
|
1314
|
-
}
|
|
1315
1315
|
var CANVAS_URL = "/api/v1/canvas";
|
|
1316
1316
|
var CanvasClient = class extends ApiClient {
|
|
1317
1317
|
constructor(options) {
|
|
@@ -1327,7 +1327,7 @@ var CanvasClient = class extends ApiClient {
|
|
|
1327
1327
|
async getCompositionList(params = {}) {
|
|
1328
1328
|
const { projectId } = this.options;
|
|
1329
1329
|
const { resolveData, filters, ...originParams } = params;
|
|
1330
|
-
const rewrittenFilters =
|
|
1330
|
+
const rewrittenFilters = rewriteFiltersForApi(filters);
|
|
1331
1331
|
if (!resolveData) {
|
|
1332
1332
|
const fetchUri = this.createUrl(CANVAS_URL, { ...originParams, projectId, ...rewrittenFilters });
|
|
1333
1333
|
return this.apiClient(fetchUri);
|
|
@@ -1447,7 +1447,7 @@ var _ContentClient = class _ContentClient2 extends ApiClient {
|
|
|
1447
1447
|
getEntries(options) {
|
|
1448
1448
|
const { projectId } = this.options;
|
|
1449
1449
|
const { skipDataResolution, filters, ...params } = options;
|
|
1450
|
-
const rewrittenFilters =
|
|
1450
|
+
const rewrittenFilters = rewriteFiltersForApi(filters);
|
|
1451
1451
|
if (skipDataResolution) {
|
|
1452
1452
|
const url = this.createUrl(__privateGet3(_ContentClient2, _entriesUrl), { ...params, ...rewrittenFilters, projectId });
|
|
1453
1453
|
return this.apiClient(url);
|
|
@@ -1694,7 +1694,7 @@ function hasReferencedVariables(value) {
|
|
|
1694
1694
|
return variableTokenCount;
|
|
1695
1695
|
}
|
|
1696
1696
|
function walkNodeTree(node, visitor, options) {
|
|
1697
|
-
var _a, _b;
|
|
1697
|
+
var _a, _b, _c;
|
|
1698
1698
|
const componentQueue = [
|
|
1699
1699
|
{
|
|
1700
1700
|
ancestorsAndSelf: Array.isArray(node) ? node : [{ node, type: "root" }],
|
|
@@ -1702,12 +1702,14 @@ function walkNodeTree(node, visitor, options) {
|
|
|
1702
1702
|
}
|
|
1703
1703
|
];
|
|
1704
1704
|
const childContexts = /* @__PURE__ */ new Map();
|
|
1705
|
+
const order = (_a = options == null ? void 0 : options.order) != null ? _a : "dfs";
|
|
1706
|
+
const takeNext = () => order === "bfs" ? componentQueue.shift() : componentQueue.pop();
|
|
1705
1707
|
do {
|
|
1706
|
-
const currentQueueEntry =
|
|
1708
|
+
const currentQueueEntry = takeNext();
|
|
1707
1709
|
if (!currentQueueEntry) continue;
|
|
1708
1710
|
const currentComponent = currentQueueEntry.ancestorsAndSelf[0];
|
|
1709
1711
|
let visitDescendants = true;
|
|
1710
|
-
let descendantContext = (
|
|
1712
|
+
let descendantContext = (_b = childContexts.get(currentComponent.node)) != null ? _b : currentQueueEntry.context;
|
|
1711
1713
|
let visitorInfo;
|
|
1712
1714
|
if (currentComponent.type === "root" && isRootEntryReference(currentComponent) || currentComponent.type === "block") {
|
|
1713
1715
|
visitorInfo = {
|
|
@@ -1894,39 +1896,11 @@ function walkNodeTree(node, visitor, options) {
|
|
|
1894
1896
|
continue;
|
|
1895
1897
|
}
|
|
1896
1898
|
const slots = "slots" in currentComponent.node && currentComponent.node.slots;
|
|
1897
|
-
|
|
1898
|
-
const slotKeys = Object.keys(slots);
|
|
1899
|
-
for (let slotIndex = slotKeys.length - 1; slotIndex >= 0; slotIndex--) {
|
|
1900
|
-
const slotKey = slotKeys[slotIndex];
|
|
1901
|
-
const components = slots[slotKey];
|
|
1902
|
-
for (let componentIndex = components.length - 1; componentIndex >= 0; componentIndex--) {
|
|
1903
|
-
const enqueueingComponent = components[componentIndex];
|
|
1904
|
-
const parentSlotIndexFn = () => {
|
|
1905
|
-
const result = currentComponent.node.slots[slotKey].findIndex(
|
|
1906
|
-
(x) => x === enqueueingComponent
|
|
1907
|
-
);
|
|
1908
|
-
return result;
|
|
1909
|
-
};
|
|
1910
|
-
componentQueue.push({
|
|
1911
|
-
ancestorsAndSelf: [
|
|
1912
|
-
{
|
|
1913
|
-
type: "slot",
|
|
1914
|
-
node: enqueueingComponent,
|
|
1915
|
-
parentSlot: slotKey,
|
|
1916
|
-
parentSlotIndexFn
|
|
1917
|
-
},
|
|
1918
|
-
...currentQueueEntry.ancestorsAndSelf
|
|
1919
|
-
],
|
|
1920
|
-
context: descendantContext
|
|
1921
|
-
});
|
|
1922
|
-
}
|
|
1923
|
-
}
|
|
1924
|
-
}
|
|
1899
|
+
const childEntries = [];
|
|
1925
1900
|
const properties = getPropertiesValue(currentComponent.node);
|
|
1926
1901
|
if (properties) {
|
|
1927
1902
|
const propertyEntries = Object.entries(properties);
|
|
1928
|
-
for (
|
|
1929
|
-
const [propKey, propObject] = propertyEntries[propIndex];
|
|
1903
|
+
for (const [propKey, propObject] of propertyEntries) {
|
|
1930
1904
|
if (!isNestedNodeType(propObject.type)) {
|
|
1931
1905
|
continue;
|
|
1932
1906
|
}
|
|
@@ -1946,13 +1920,12 @@ function walkNodeTree(node, visitor, options) {
|
|
|
1946
1920
|
continue;
|
|
1947
1921
|
}
|
|
1948
1922
|
}
|
|
1949
|
-
const blocks = (
|
|
1950
|
-
for (
|
|
1951
|
-
const enqueueingBlock = blocks[blockIndex];
|
|
1923
|
+
const blocks = (_c = propObject.value) != null ? _c : [];
|
|
1924
|
+
for (const enqueueingBlock of blocks) {
|
|
1952
1925
|
const blockIndexFn = () => {
|
|
1953
1926
|
return getBlockValue(currentComponent.node, propKey).findIndex((x) => x === enqueueingBlock);
|
|
1954
1927
|
};
|
|
1955
|
-
|
|
1928
|
+
childEntries.push({
|
|
1956
1929
|
ancestorsAndSelf: [
|
|
1957
1930
|
{
|
|
1958
1931
|
type: "block",
|
|
@@ -1967,6 +1940,36 @@ function walkNodeTree(node, visitor, options) {
|
|
|
1967
1940
|
}
|
|
1968
1941
|
}
|
|
1969
1942
|
}
|
|
1943
|
+
if (slots) {
|
|
1944
|
+
const slotKeys = Object.keys(slots);
|
|
1945
|
+
for (const slotKey of slotKeys) {
|
|
1946
|
+
const components = slots[slotKey];
|
|
1947
|
+
for (const enqueueingComponent of components) {
|
|
1948
|
+
const parentSlotIndexFn = () => {
|
|
1949
|
+
const result = currentComponent.node.slots[slotKey].findIndex(
|
|
1950
|
+
(x) => x === enqueueingComponent
|
|
1951
|
+
);
|
|
1952
|
+
return result;
|
|
1953
|
+
};
|
|
1954
|
+
childEntries.push({
|
|
1955
|
+
ancestorsAndSelf: [
|
|
1956
|
+
{
|
|
1957
|
+
type: "slot",
|
|
1958
|
+
node: enqueueingComponent,
|
|
1959
|
+
parentSlot: slotKey,
|
|
1960
|
+
parentSlotIndexFn
|
|
1961
|
+
},
|
|
1962
|
+
...currentQueueEntry.ancestorsAndSelf
|
|
1963
|
+
],
|
|
1964
|
+
context: descendantContext
|
|
1965
|
+
});
|
|
1966
|
+
}
|
|
1967
|
+
}
|
|
1968
|
+
}
|
|
1969
|
+
if (order === "dfs") {
|
|
1970
|
+
childEntries.reverse();
|
|
1971
|
+
}
|
|
1972
|
+
componentQueue.push(...childEntries);
|
|
1970
1973
|
} while (componentQueue.length > 0);
|
|
1971
1974
|
}
|
|
1972
1975
|
function isNestedNodeType(type) {
|
|
@@ -2182,6 +2185,7 @@ var _IntegrationPropertyEditorsClient = class _IntegrationPropertyEditorsClient2
|
|
|
2182
2185
|
_baseUrl = /* @__PURE__ */ new WeakMap();
|
|
2183
2186
|
__privateAdd3(_IntegrationPropertyEditorsClient, _baseUrl, "/api/v1/integration-property-editors");
|
|
2184
2187
|
var _url22;
|
|
2188
|
+
var _projectsUrl;
|
|
2185
2189
|
var _ProjectClient = class _ProjectClient2 extends ApiClient {
|
|
2186
2190
|
constructor(options) {
|
|
2187
2191
|
super({ ...options, bypassCache: true });
|
|
@@ -2191,6 +2195,15 @@ var _ProjectClient = class _ProjectClient2 extends ApiClient {
|
|
|
2191
2195
|
const fetchUri = this.createUrl(__privateGet3(_ProjectClient2, _url22), { ...options });
|
|
2192
2196
|
return await this.apiClient(fetchUri);
|
|
2193
2197
|
}
|
|
2198
|
+
/**
|
|
2199
|
+
* Fetches projects grouped by team.
|
|
2200
|
+
* When teamId is provided, returns a single team with its projects.
|
|
2201
|
+
* When omitted, returns all accessible teams and their projects.
|
|
2202
|
+
*/
|
|
2203
|
+
async getProjects(options) {
|
|
2204
|
+
const fetchUri = this.createUrl(__privateGet3(_ProjectClient2, _projectsUrl), options ? { ...options } : {});
|
|
2205
|
+
return await this.apiClient(fetchUri);
|
|
2206
|
+
}
|
|
2194
2207
|
/** Updates or creates (based on id) a Project */
|
|
2195
2208
|
async upsert(body) {
|
|
2196
2209
|
const fetchUri = this.createUrl(__privateGet3(_ProjectClient2, _url22));
|
|
@@ -2210,7 +2223,9 @@ var _ProjectClient = class _ProjectClient2 extends ApiClient {
|
|
|
2210
2223
|
}
|
|
2211
2224
|
};
|
|
2212
2225
|
_url22 = /* @__PURE__ */ new WeakMap();
|
|
2226
|
+
_projectsUrl = /* @__PURE__ */ new WeakMap();
|
|
2213
2227
|
__privateAdd3(_ProjectClient, _url22, "/api/v1/project");
|
|
2228
|
+
__privateAdd3(_ProjectClient, _projectsUrl, "/api/v1/projects");
|
|
2214
2229
|
var ROUTE_URL = "/api/v1/route";
|
|
2215
2230
|
var RouteClient = class extends ApiClient {
|
|
2216
2231
|
constructor(options) {
|
|
@@ -2326,8 +2341,15 @@ var isIncontextEditingEnabled = ({
|
|
|
2326
2341
|
var isDevelopmentEnvironment = () => {
|
|
2327
2342
|
return process.env.NODE_ENV === "development" || process.env.NODE_ENV === "test";
|
|
2328
2343
|
};
|
|
2344
|
+
var shouldIgnoreRedirects = ({ state }) => {
|
|
2345
|
+
const isNotPublished = state !== CANVAS_PUBLISHED_STATE;
|
|
2346
|
+
return isNotPublished ? true : void 0;
|
|
2347
|
+
};
|
|
2329
2348
|
|
|
2330
2349
|
// src/clients/cache.ts
|
|
2350
|
+
var isSpecificCacheMode = (options) => {
|
|
2351
|
+
return "cache" in options;
|
|
2352
|
+
};
|
|
2331
2353
|
var isStateCacheMode = (options) => {
|
|
2332
2354
|
return "state" in options;
|
|
2333
2355
|
};
|
|
@@ -2349,7 +2371,9 @@ var resolveCache = ({
|
|
|
2349
2371
|
}) => {
|
|
2350
2372
|
let cache = void 0;
|
|
2351
2373
|
if (options) {
|
|
2352
|
-
if (
|
|
2374
|
+
if (isSpecificCacheMode(options)) {
|
|
2375
|
+
cache = options.cache;
|
|
2376
|
+
} else if (isStateCacheMode(options)) {
|
|
2353
2377
|
if (options.state === CANVAS_DRAFT_STATE || options.state === CANVAS_EDITOR_STATE) {
|
|
2354
2378
|
cache = {
|
|
2355
2379
|
type: "no-cache",
|
|
@@ -2744,7 +2768,10 @@ var DefaultDataClient = class {
|
|
|
2744
2768
|
}
|
|
2745
2769
|
}
|
|
2746
2770
|
const manifest = await getManifest({
|
|
2747
|
-
cache: {
|
|
2771
|
+
cache: isDevelopmentEnvironment() ? {
|
|
2772
|
+
type: "no-cache",
|
|
2773
|
+
bypassCache: true
|
|
2774
|
+
} : {
|
|
2748
2775
|
type: "force-cache"
|
|
2749
2776
|
}
|
|
2750
2777
|
});
|
|
@@ -2847,12 +2874,13 @@ var DefaultDataClient = class {
|
|
|
2847
2874
|
};
|
|
2848
2875
|
}
|
|
2849
2876
|
async getRoutePageState(options) {
|
|
2877
|
+
const shouldBypassCache = options.pageState.compositionState !== CANVAS_PUBLISHED_STATE || isDevelopmentEnvironment();
|
|
2850
2878
|
const routeClient = getRouteClient({
|
|
2851
|
-
cache:
|
|
2852
|
-
type: "force-cache"
|
|
2853
|
-
} : {
|
|
2879
|
+
cache: shouldBypassCache ? {
|
|
2854
2880
|
type: "no-cache",
|
|
2855
2881
|
bypassCache: true
|
|
2882
|
+
} : {
|
|
2883
|
+
type: "force-cache"
|
|
2856
2884
|
}
|
|
2857
2885
|
});
|
|
2858
2886
|
const originalRoute = {
|
|
@@ -2860,7 +2888,8 @@ var DefaultDataClient = class {
|
|
|
2860
2888
|
state: options.pageState.compositionState,
|
|
2861
2889
|
withComponentIDs: true,
|
|
2862
2890
|
releaseId: options.pageState.releaseId,
|
|
2863
|
-
locale: options.pageState.locale
|
|
2891
|
+
locale: options.pageState.locale,
|
|
2892
|
+
ignoreRedirects: shouldIgnoreRedirects({ state: options.pageState.compositionState })
|
|
2864
2893
|
};
|
|
2865
2894
|
const resolvedRoute = await this.getRouteFromApi({
|
|
2866
2895
|
source: "pageState",
|
|
@@ -3383,7 +3412,6 @@ var ManifestInstance = class {
|
|
|
3383
3412
|
constructor({
|
|
3384
3413
|
manifest,
|
|
3385
3414
|
evaluator = new GroupCriteriaEvaluator({}),
|
|
3386
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
3387
3415
|
onLogMessage = () => {
|
|
3388
3416
|
}
|
|
3389
3417
|
}) {
|
|
@@ -5414,7 +5442,8 @@ var retrieveRouteByPath = async ({
|
|
|
5414
5442
|
withComponentIDs: true,
|
|
5415
5443
|
withContentSourceMap: (_a = getServerConfig().experimental) == null ? void 0 : _a.vercelVisualEditing,
|
|
5416
5444
|
releaseId,
|
|
5417
|
-
locale
|
|
5445
|
+
locale,
|
|
5446
|
+
ignoreRedirects: shouldIgnoreRedirects({ state })
|
|
5418
5447
|
}
|
|
5419
5448
|
});
|
|
5420
5449
|
};
|
|
@@ -5541,7 +5570,7 @@ var handlePlaygroundRequest = async ({
|
|
|
5541
5570
|
})
|
|
5542
5571
|
});
|
|
5543
5572
|
const context = await onDemandContext.getContext();
|
|
5544
|
-
const { components, rules } = await extractAndEvaluateRunnables({
|
|
5573
|
+
const { components, rules, allComponentIds } = await extractAndEvaluateRunnables({
|
|
5545
5574
|
composition: composition.composition,
|
|
5546
5575
|
routePath: id,
|
|
5547
5576
|
state: composition.state,
|
|
@@ -5581,7 +5610,8 @@ var handlePlaygroundRequest = async ({
|
|
|
5581
5610
|
isPrefetch: void 0
|
|
5582
5611
|
};
|
|
5583
5612
|
const code = serializeEvaluationResult({
|
|
5584
|
-
payload: pageState
|
|
5613
|
+
payload: pageState,
|
|
5614
|
+
allComponentIds
|
|
5585
5615
|
});
|
|
5586
5616
|
let pathToRewriteTo = await (options.rewriteDestinationPath ? options.rewriteDestinationPath({ code, pageState, source: "playground" }) : void 0);
|
|
5587
5617
|
if (!pathToRewriteTo) {
|
|
@@ -5595,15 +5625,16 @@ var handleRouteRequest = async ({
|
|
|
5595
5625
|
dataClient,
|
|
5596
5626
|
options
|
|
5597
5627
|
}) => {
|
|
5598
|
-
var _a, _b, _c, _d, _e, _f, _g
|
|
5628
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
5629
|
+
const releaseId = (_b = (_a = options.release) == null ? void 0 : _a.id) != null ? _b : draftModeEnabled ? request.nextUrl.searchParams.get("releaseId") || void 0 : void 0;
|
|
5599
5630
|
const states = await determineState({
|
|
5600
5631
|
searchParams: request.nextUrl.searchParams,
|
|
5601
5632
|
draftModeEnabled
|
|
5602
5633
|
});
|
|
5603
|
-
const requestPath = (
|
|
5634
|
+
const requestPath = (_d = await ((_c = options.rewriteRequestPath) == null ? void 0 : _c.call(options, {
|
|
5604
5635
|
request,
|
|
5605
5636
|
url: new URL(request.url)
|
|
5606
|
-
}))) != null ?
|
|
5637
|
+
}))) != null ? _d : {
|
|
5607
5638
|
path: `${request.nextUrl.pathname}${request.nextUrl.search}`
|
|
5608
5639
|
};
|
|
5609
5640
|
const serverConfig = getServerConfig();
|
|
@@ -5614,7 +5645,7 @@ var handleRouteRequest = async ({
|
|
|
5614
5645
|
searchParams: request.nextUrl.searchParams,
|
|
5615
5646
|
draftModeEnabled,
|
|
5616
5647
|
dataClient,
|
|
5617
|
-
releaseId
|
|
5648
|
+
releaseId,
|
|
5618
5649
|
locale: options.locale
|
|
5619
5650
|
}),
|
|
5620
5651
|
createOnDemandContext({
|
|
@@ -5626,10 +5657,10 @@ var handleRouteRequest = async ({
|
|
|
5626
5657
|
})
|
|
5627
5658
|
})
|
|
5628
5659
|
]);
|
|
5629
|
-
if (!(routeResult == null ? void 0 : routeResult.route) || ((
|
|
5660
|
+
if (!(routeResult == null ? void 0 : routeResult.route) || ((_e = routeResult == null ? void 0 : routeResult.route) == null ? void 0 : _e.type) === "notFound") {
|
|
5630
5661
|
return NextResponse.rewrite(new URL("/404", request.url));
|
|
5631
5662
|
}
|
|
5632
|
-
if (((
|
|
5663
|
+
if (((_f = routeResult == null ? void 0 : routeResult.route) == null ? void 0 : _f.type) === "redirect") {
|
|
5633
5664
|
return handleRedirect({ request, route: routeResult.route });
|
|
5634
5665
|
}
|
|
5635
5666
|
const { route } = routeResult;
|
|
@@ -5663,14 +5694,14 @@ var handleRouteRequest = async ({
|
|
|
5663
5694
|
isDraftModeEnabled: draftModeEnabled
|
|
5664
5695
|
});
|
|
5665
5696
|
const isPrefetch = isPrefetchRequest(request);
|
|
5666
|
-
const { components, rules } = await extractAndEvaluateRunnables({
|
|
5697
|
+
const { components, rules, allComponentIds } = await extractAndEvaluateRunnables({
|
|
5667
5698
|
composition: route.compositionApiResponse.composition,
|
|
5668
5699
|
routePath,
|
|
5669
5700
|
state,
|
|
5670
5701
|
context,
|
|
5671
5702
|
matchedRoute: route.matchedRoute,
|
|
5672
|
-
dynamicInputs: (
|
|
5673
|
-
releaseId
|
|
5703
|
+
dynamicInputs: (_g = route.dynamicInputs) != null ? _g : {},
|
|
5704
|
+
releaseId,
|
|
5674
5705
|
defaultConsent: determineDefaultConsent({
|
|
5675
5706
|
serverConfig,
|
|
5676
5707
|
defaultConsent: options.defaultConsent
|
|
@@ -5688,7 +5719,7 @@ var handleRouteRequest = async ({
|
|
|
5688
5719
|
compositionState: state,
|
|
5689
5720
|
components,
|
|
5690
5721
|
keys: requestPath.keys,
|
|
5691
|
-
releaseId
|
|
5722
|
+
releaseId,
|
|
5692
5723
|
defaultConsent: determineDefaultConsent({
|
|
5693
5724
|
serverConfig,
|
|
5694
5725
|
defaultConsent: options.defaultConsent
|
|
@@ -5699,7 +5730,8 @@ var handleRouteRequest = async ({
|
|
|
5699
5730
|
isPrefetch: isPrefetch || void 0
|
|
5700
5731
|
};
|
|
5701
5732
|
const code = serializeEvaluationResult({
|
|
5702
|
-
payload: pageState
|
|
5733
|
+
payload: pageState,
|
|
5734
|
+
allComponentIds
|
|
5703
5735
|
});
|
|
5704
5736
|
let pathToRewriteTo = await (options.rewriteDestinationPath ? options.rewriteDestinationPath({ code, pageState, source: "route" }) : void 0);
|
|
5705
5737
|
if (!pathToRewriteTo) {
|
|
@@ -5759,7 +5791,8 @@ var extractAndEvaluateRunnables = async ({
|
|
|
5759
5791
|
}
|
|
5760
5792
|
}
|
|
5761
5793
|
});
|
|
5762
|
-
|
|
5794
|
+
const allComponentIds = extracted.filter((r) => r.type === "test" || r.type === "personalization").map((r) => r._id);
|
|
5795
|
+
return { ...result, allComponentIds };
|
|
5763
5796
|
};
|
|
5764
5797
|
var handleRedirect = ({ request, route }) => {
|
|
5765
5798
|
const href = resolveRedirectHref({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { RouteGetResponseEdgehancedComposition } from '@uniformdev/canvas';
|
|
2
2
|
import { PageState } from '@uniformdev/next-app-router-shared';
|
|
3
|
-
import { D as DataClient } from './client-
|
|
3
|
+
import { D as DataClient } from './client-BlKZeE6C.js';
|
|
4
4
|
|
|
5
5
|
type ResolvedRouteResult = {
|
|
6
6
|
pageState: PageState;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { RouteGetResponseEdgehancedComposition } from '@uniformdev/canvas';
|
|
2
2
|
import { PageState } from '@uniformdev/next-app-router-shared';
|
|
3
|
-
import { D as DataClient } from './client-
|
|
3
|
+
import { D as DataClient } from './client-BlKZeE6C.mjs';
|
|
4
4
|
|
|
5
5
|
type ResolvedRouteResult = {
|
|
6
6
|
pageState: PageState;
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uniformdev/next-app-router",
|
|
3
|
-
"version": "20.50.2-alpha.
|
|
3
|
+
"version": "20.50.2-alpha.96+3f982d48ba",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "tsup",
|
|
7
7
|
"dev": "tsup --watch",
|
|
8
8
|
"lint": "eslint \"src/**/*.{ts,tsx}\" --fix",
|
|
9
|
-
"test": "vitest"
|
|
9
|
+
"test": "vitest run"
|
|
10
10
|
},
|
|
11
11
|
"sideEffects": false,
|
|
12
12
|
"main": "dist/index.js",
|
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
"@types/node": "20.19.25",
|
|
92
92
|
"@types/react": "19.0.8",
|
|
93
93
|
"@types/react-dom": "19.0.3",
|
|
94
|
-
"next": "16.
|
|
94
|
+
"next": "16.2.3",
|
|
95
95
|
"react": "19.2.0",
|
|
96
96
|
"react-dom": "19.2.0",
|
|
97
97
|
"typescript": "5.9.2",
|
|
@@ -99,12 +99,12 @@
|
|
|
99
99
|
"vitest": "3.2.4"
|
|
100
100
|
},
|
|
101
101
|
"dependencies": {
|
|
102
|
-
"@uniformdev/canvas-react": "20.50.2-alpha.
|
|
103
|
-
"@uniformdev/next-app-router-client": "20.50.2-alpha.
|
|
104
|
-
"@uniformdev/next-app-router-shared": "20.50.2-alpha.
|
|
105
|
-
"@uniformdev/redirect": "20.50.2-alpha.
|
|
106
|
-
"@uniformdev/richtext": "20.50.2-alpha.
|
|
107
|
-
"@uniformdev/webhooks": "20.50.2-alpha.
|
|
102
|
+
"@uniformdev/canvas-react": "20.50.2-alpha.96+3f982d48ba",
|
|
103
|
+
"@uniformdev/next-app-router-client": "20.50.2-alpha.96+3f982d48ba",
|
|
104
|
+
"@uniformdev/next-app-router-shared": "20.50.2-alpha.96+3f982d48ba",
|
|
105
|
+
"@uniformdev/redirect": "20.50.2-alpha.96+3f982d48ba",
|
|
106
|
+
"@uniformdev/richtext": "20.50.2-alpha.96+3f982d48ba",
|
|
107
|
+
"@uniformdev/webhooks": "20.50.2-alpha.96+3f982d48ba",
|
|
108
108
|
"@vercel/functions": "^2.2.2",
|
|
109
109
|
"encoding": "^0.1.13",
|
|
110
110
|
"server-only": "^0.0.1",
|
|
@@ -121,5 +121,5 @@
|
|
|
121
121
|
"publishConfig": {
|
|
122
122
|
"access": "public"
|
|
123
123
|
},
|
|
124
|
-
"gitHead": "
|
|
124
|
+
"gitHead": "3f982d48baf7aad200f687938b7f2e7c8796f759"
|
|
125
125
|
}
|