@uniformdev/next-app-router 20.50.2-alpha.1 → 20.50.2-alpha.117
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 +112 -78
- package/dist/middleware.mjs +112 -78
- 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 -11
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",
|
|
@@ -3126,11 +3155,12 @@ function dequal(foo, bar) {
|
|
|
3126
3155
|
return foo !== foo && bar !== bar;
|
|
3127
3156
|
}
|
|
3128
3157
|
|
|
3129
|
-
// ../../node_modules/.pnpm/js-cookie@3.0.
|
|
3158
|
+
// ../../node_modules/.pnpm/js-cookie@3.0.7/node_modules/js-cookie/dist/js.cookie.mjs
|
|
3130
3159
|
function assign(target) {
|
|
3131
3160
|
for (var i = 1; i < arguments.length; i++) {
|
|
3132
3161
|
var source = arguments[i];
|
|
3133
3162
|
for (var key in source) {
|
|
3163
|
+
if (key === "__proto__") continue;
|
|
3134
3164
|
target[key] = source[key];
|
|
3135
3165
|
}
|
|
3136
3166
|
}
|
|
@@ -3187,7 +3217,7 @@ function init(converter, defaultAttributes) {
|
|
|
3187
3217
|
var value = parts.slice(1).join("=");
|
|
3188
3218
|
try {
|
|
3189
3219
|
var found = decodeURIComponent(parts[0]);
|
|
3190
|
-
jar[found] = converter.read(value, found);
|
|
3220
|
+
if (!(found in jar)) jar[found] = converter.read(value, found);
|
|
3191
3221
|
if (name === found) {
|
|
3192
3222
|
break;
|
|
3193
3223
|
}
|
|
@@ -3383,7 +3413,6 @@ var ManifestInstance = class {
|
|
|
3383
3413
|
constructor({
|
|
3384
3414
|
manifest,
|
|
3385
3415
|
evaluator = new GroupCriteriaEvaluator({}),
|
|
3386
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
3387
3416
|
onLogMessage = () => {
|
|
3388
3417
|
}
|
|
3389
3418
|
}) {
|
|
@@ -5414,7 +5443,8 @@ var retrieveRouteByPath = async ({
|
|
|
5414
5443
|
withComponentIDs: true,
|
|
5415
5444
|
withContentSourceMap: (_a = getServerConfig().experimental) == null ? void 0 : _a.vercelVisualEditing,
|
|
5416
5445
|
releaseId,
|
|
5417
|
-
locale
|
|
5446
|
+
locale,
|
|
5447
|
+
ignoreRedirects: shouldIgnoreRedirects({ state })
|
|
5418
5448
|
}
|
|
5419
5449
|
});
|
|
5420
5450
|
};
|
|
@@ -5541,7 +5571,7 @@ var handlePlaygroundRequest = async ({
|
|
|
5541
5571
|
})
|
|
5542
5572
|
});
|
|
5543
5573
|
const context = await onDemandContext.getContext();
|
|
5544
|
-
const { components, rules } = await extractAndEvaluateRunnables({
|
|
5574
|
+
const { components, rules, allComponentIds } = await extractAndEvaluateRunnables({
|
|
5545
5575
|
composition: composition.composition,
|
|
5546
5576
|
routePath: id,
|
|
5547
5577
|
state: composition.state,
|
|
@@ -5581,7 +5611,8 @@ var handlePlaygroundRequest = async ({
|
|
|
5581
5611
|
isPrefetch: void 0
|
|
5582
5612
|
};
|
|
5583
5613
|
const code = serializeEvaluationResult({
|
|
5584
|
-
payload: pageState
|
|
5614
|
+
payload: pageState,
|
|
5615
|
+
allComponentIds
|
|
5585
5616
|
});
|
|
5586
5617
|
let pathToRewriteTo = await (options.rewriteDestinationPath ? options.rewriteDestinationPath({ code, pageState, source: "playground" }) : void 0);
|
|
5587
5618
|
if (!pathToRewriteTo) {
|
|
@@ -5595,15 +5626,16 @@ var handleRouteRequest = async ({
|
|
|
5595
5626
|
dataClient,
|
|
5596
5627
|
options
|
|
5597
5628
|
}) => {
|
|
5598
|
-
var _a, _b, _c, _d, _e, _f, _g
|
|
5629
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
5630
|
+
const releaseId = (_b = (_a = options.release) == null ? void 0 : _a.id) != null ? _b : draftModeEnabled ? request.nextUrl.searchParams.get("releaseId") || void 0 : void 0;
|
|
5599
5631
|
const states = await determineState({
|
|
5600
5632
|
searchParams: request.nextUrl.searchParams,
|
|
5601
5633
|
draftModeEnabled
|
|
5602
5634
|
});
|
|
5603
|
-
const requestPath = (
|
|
5635
|
+
const requestPath = (_d = await ((_c = options.rewriteRequestPath) == null ? void 0 : _c.call(options, {
|
|
5604
5636
|
request,
|
|
5605
5637
|
url: new URL(request.url)
|
|
5606
|
-
}))) != null ?
|
|
5638
|
+
}))) != null ? _d : {
|
|
5607
5639
|
path: `${request.nextUrl.pathname}${request.nextUrl.search}`
|
|
5608
5640
|
};
|
|
5609
5641
|
const serverConfig = getServerConfig();
|
|
@@ -5614,7 +5646,7 @@ var handleRouteRequest = async ({
|
|
|
5614
5646
|
searchParams: request.nextUrl.searchParams,
|
|
5615
5647
|
draftModeEnabled,
|
|
5616
5648
|
dataClient,
|
|
5617
|
-
releaseId
|
|
5649
|
+
releaseId,
|
|
5618
5650
|
locale: options.locale
|
|
5619
5651
|
}),
|
|
5620
5652
|
createOnDemandContext({
|
|
@@ -5626,10 +5658,10 @@ var handleRouteRequest = async ({
|
|
|
5626
5658
|
})
|
|
5627
5659
|
})
|
|
5628
5660
|
]);
|
|
5629
|
-
if (!(routeResult == null ? void 0 : routeResult.route) || ((
|
|
5661
|
+
if (!(routeResult == null ? void 0 : routeResult.route) || ((_e = routeResult == null ? void 0 : routeResult.route) == null ? void 0 : _e.type) === "notFound") {
|
|
5630
5662
|
return NextResponse.rewrite(new URL("/404", request.url));
|
|
5631
5663
|
}
|
|
5632
|
-
if (((
|
|
5664
|
+
if (((_f = routeResult == null ? void 0 : routeResult.route) == null ? void 0 : _f.type) === "redirect") {
|
|
5633
5665
|
return handleRedirect({ request, route: routeResult.route });
|
|
5634
5666
|
}
|
|
5635
5667
|
const { route } = routeResult;
|
|
@@ -5663,14 +5695,14 @@ var handleRouteRequest = async ({
|
|
|
5663
5695
|
isDraftModeEnabled: draftModeEnabled
|
|
5664
5696
|
});
|
|
5665
5697
|
const isPrefetch = isPrefetchRequest(request);
|
|
5666
|
-
const { components, rules } = await extractAndEvaluateRunnables({
|
|
5698
|
+
const { components, rules, allComponentIds } = await extractAndEvaluateRunnables({
|
|
5667
5699
|
composition: route.compositionApiResponse.composition,
|
|
5668
5700
|
routePath,
|
|
5669
5701
|
state,
|
|
5670
5702
|
context,
|
|
5671
5703
|
matchedRoute: route.matchedRoute,
|
|
5672
|
-
dynamicInputs: (
|
|
5673
|
-
releaseId
|
|
5704
|
+
dynamicInputs: (_g = route.dynamicInputs) != null ? _g : {},
|
|
5705
|
+
releaseId,
|
|
5674
5706
|
defaultConsent: determineDefaultConsent({
|
|
5675
5707
|
serverConfig,
|
|
5676
5708
|
defaultConsent: options.defaultConsent
|
|
@@ -5688,7 +5720,7 @@ var handleRouteRequest = async ({
|
|
|
5688
5720
|
compositionState: state,
|
|
5689
5721
|
components,
|
|
5690
5722
|
keys: requestPath.keys,
|
|
5691
|
-
releaseId
|
|
5723
|
+
releaseId,
|
|
5692
5724
|
defaultConsent: determineDefaultConsent({
|
|
5693
5725
|
serverConfig,
|
|
5694
5726
|
defaultConsent: options.defaultConsent
|
|
@@ -5699,7 +5731,8 @@ var handleRouteRequest = async ({
|
|
|
5699
5731
|
isPrefetch: isPrefetch || void 0
|
|
5700
5732
|
};
|
|
5701
5733
|
const code = serializeEvaluationResult({
|
|
5702
|
-
payload: pageState
|
|
5734
|
+
payload: pageState,
|
|
5735
|
+
allComponentIds
|
|
5703
5736
|
});
|
|
5704
5737
|
let pathToRewriteTo = await (options.rewriteDestinationPath ? options.rewriteDestinationPath({ code, pageState, source: "route" }) : void 0);
|
|
5705
5738
|
if (!pathToRewriteTo) {
|
|
@@ -5759,7 +5792,8 @@ var extractAndEvaluateRunnables = async ({
|
|
|
5759
5792
|
}
|
|
5760
5793
|
}
|
|
5761
5794
|
});
|
|
5762
|
-
|
|
5795
|
+
const allComponentIds = extracted.filter((r) => r.type === "test" || r.type === "personalization").map((r) => r._id);
|
|
5796
|
+
return { ...result, allComponentIds };
|
|
5763
5797
|
};
|
|
5764
5798
|
var handleRedirect = ({ request, route }) => {
|
|
5765
5799
|
const href = resolveRedirectHref({
|
|
@@ -5857,5 +5891,5 @@ export {
|
|
|
5857
5891
|
/*! Bundled license information:
|
|
5858
5892
|
|
|
5859
5893
|
js-cookie/dist/js.cookie.mjs:
|
|
5860
|
-
(*! js-cookie v3.0.
|
|
5894
|
+
(*! js-cookie v3.0.7 | MIT *)
|
|
5861
5895
|
*/
|
|
@@ -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,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uniformdev/next-app-router",
|
|
3
|
-
"version": "20.50.2-alpha.
|
|
3
|
+
"version": "20.50.2-alpha.117+4eb2f1aa44",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "tsup",
|
|
7
7
|
"dev": "tsup --watch",
|
|
8
|
-
"
|
|
9
|
-
"test": "vitest"
|
|
8
|
+
"test": "vitest run"
|
|
10
9
|
},
|
|
11
10
|
"sideEffects": false,
|
|
12
11
|
"main": "dist/index.js",
|
|
@@ -91,7 +90,7 @@
|
|
|
91
90
|
"@types/node": "20.19.25",
|
|
92
91
|
"@types/react": "19.0.8",
|
|
93
92
|
"@types/react-dom": "19.0.3",
|
|
94
|
-
"next": "16.
|
|
93
|
+
"next": "16.2.3",
|
|
95
94
|
"react": "19.2.0",
|
|
96
95
|
"react-dom": "19.2.0",
|
|
97
96
|
"typescript": "5.9.2",
|
|
@@ -99,12 +98,12 @@
|
|
|
99
98
|
"vitest": "3.2.4"
|
|
100
99
|
},
|
|
101
100
|
"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.
|
|
101
|
+
"@uniformdev/canvas-react": "20.50.2-alpha.117+4eb2f1aa44",
|
|
102
|
+
"@uniformdev/next-app-router-client": "20.50.2-alpha.117+4eb2f1aa44",
|
|
103
|
+
"@uniformdev/next-app-router-shared": "20.50.2-alpha.117+4eb2f1aa44",
|
|
104
|
+
"@uniformdev/redirect": "20.50.2-alpha.117+4eb2f1aa44",
|
|
105
|
+
"@uniformdev/richtext": "20.50.2-alpha.117+4eb2f1aa44",
|
|
106
|
+
"@uniformdev/webhooks": "20.50.2-alpha.117+4eb2f1aa44",
|
|
108
107
|
"@vercel/functions": "^2.2.2",
|
|
109
108
|
"encoding": "^0.1.13",
|
|
110
109
|
"server-only": "^0.0.1",
|
|
@@ -121,5 +120,5 @@
|
|
|
121
120
|
"publishConfig": {
|
|
122
121
|
"access": "public"
|
|
123
122
|
},
|
|
124
|
-
"gitHead": "
|
|
123
|
+
"gitHead": "4eb2f1aa443ff87c7f365c70c1cf221f3ec07a78"
|
|
125
124
|
}
|