@pactor-app/app 1.48.0 → 1.48.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +6 -3
- package/dist/index.js +4 -1
- package/package.json +9 -9
package/dist/index.cjs
CHANGED
|
@@ -1010,7 +1010,7 @@ var defaultSitemapActions = {
|
|
|
1010
1010
|
|
|
1011
1011
|
// src/sitemap/SitemapApp.tsx
|
|
1012
1012
|
var import_core4 = require("@pactor-app/core");
|
|
1013
|
-
var
|
|
1013
|
+
var import_router4 = require("@pactor-app/router");
|
|
1014
1014
|
var import_runtime6 = require("@pactor-app/runtime");
|
|
1015
1015
|
var import_components2 = require("@pactor-app/ui/components");
|
|
1016
1016
|
var import_react8 = require("react");
|
|
@@ -1278,6 +1278,7 @@ function toSitemapNavItems(menuTree) {
|
|
|
1278
1278
|
}
|
|
1279
1279
|
|
|
1280
1280
|
// src/sitemap/route.ts
|
|
1281
|
+
var import_router3 = require("@pactor-app/router");
|
|
1281
1282
|
function resolveSitemapRoute(sitemap, registry, pathname) {
|
|
1282
1283
|
const match = registry.findByPath(pathname);
|
|
1283
1284
|
const menu = match?.menu ?? null;
|
|
@@ -1287,6 +1288,8 @@ function resolveSitemapRoute(sitemap, registry, pathname) {
|
|
|
1287
1288
|
const layoutName = menu.layout ?? sitemap.layout ?? Object.keys(sitemap.layouts)[0] ?? "";
|
|
1288
1289
|
const highlightId = menu.activeMenu ?? menu.id;
|
|
1289
1290
|
const highlightItem = registry.findById(highlightId);
|
|
1291
|
+
const page = sitemap.pages.find((p) => p.id === menu.pageId);
|
|
1292
|
+
const params = page !== void 0 && page.path !== menu.path ? (0, import_router3.match)(page.path, pathname)?.params ?? match.params : match.params;
|
|
1290
1293
|
return {
|
|
1291
1294
|
menu,
|
|
1292
1295
|
route: {
|
|
@@ -1294,7 +1297,7 @@ function resolveSitemapRoute(sitemap, registry, pathname) {
|
|
|
1294
1297
|
layoutName,
|
|
1295
1298
|
layoutChain: resolveLayoutChain(sitemap, layoutName),
|
|
1296
1299
|
highlightKey: highlightItem?.path ?? highlightId,
|
|
1297
|
-
params
|
|
1300
|
+
params
|
|
1298
1301
|
}
|
|
1299
1302
|
};
|
|
1300
1303
|
}
|
|
@@ -1397,7 +1400,7 @@ function SitemapAppInner(props) {
|
|
|
1397
1400
|
};
|
|
1398
1401
|
}, [fetcher, baseUrl, props.httpAdapter, JSON.stringify(sources)]);
|
|
1399
1402
|
const registry = (0, import_react8.useMemo)(
|
|
1400
|
-
() => state.status === "ready" ? new
|
|
1403
|
+
() => state.status === "ready" ? new import_router4.MenuRegistry(mergeSitemapMenus(state.sitemap)) : null,
|
|
1401
1404
|
[state]
|
|
1402
1405
|
);
|
|
1403
1406
|
const resolution = (0, import_react8.useMemo)(
|
package/dist/index.js
CHANGED
|
@@ -1279,6 +1279,7 @@ function toSitemapNavItems(menuTree) {
|
|
|
1279
1279
|
}
|
|
1280
1280
|
|
|
1281
1281
|
// src/sitemap/route.ts
|
|
1282
|
+
import { match as matchPath } from "@pactor-app/router";
|
|
1282
1283
|
function resolveSitemapRoute(sitemap, registry, pathname) {
|
|
1283
1284
|
const match = registry.findByPath(pathname);
|
|
1284
1285
|
const menu = match?.menu ?? null;
|
|
@@ -1288,6 +1289,8 @@ function resolveSitemapRoute(sitemap, registry, pathname) {
|
|
|
1288
1289
|
const layoutName = menu.layout ?? sitemap.layout ?? Object.keys(sitemap.layouts)[0] ?? "";
|
|
1289
1290
|
const highlightId = menu.activeMenu ?? menu.id;
|
|
1290
1291
|
const highlightItem = registry.findById(highlightId);
|
|
1292
|
+
const page = sitemap.pages.find((p) => p.id === menu.pageId);
|
|
1293
|
+
const params = page !== void 0 && page.path !== menu.path ? matchPath(page.path, pathname)?.params ?? match.params : match.params;
|
|
1291
1294
|
return {
|
|
1292
1295
|
menu,
|
|
1293
1296
|
route: {
|
|
@@ -1295,7 +1298,7 @@ function resolveSitemapRoute(sitemap, registry, pathname) {
|
|
|
1295
1298
|
layoutName,
|
|
1296
1299
|
layoutChain: resolveLayoutChain(sitemap, layoutName),
|
|
1297
1300
|
highlightKey: highlightItem?.path ?? highlightId,
|
|
1298
|
-
params
|
|
1301
|
+
params
|
|
1299
1302
|
}
|
|
1300
1303
|
};
|
|
1301
1304
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pactor-app/app",
|
|
3
|
-
"version": "1.48.
|
|
3
|
+
"version": "1.48.1",
|
|
4
4
|
"description": "Pactor application: one-stop composition layer (createPactorApplication) wiring loader, bootstrap, registries, router, layout, interaction and page runtimes",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pactor",
|
|
@@ -46,14 +46,14 @@
|
|
|
46
46
|
"access": "public"
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@pactor-app/core": "1.48.
|
|
50
|
-
"@pactor-app/
|
|
51
|
-
"@pactor-app/
|
|
52
|
-
"@pactor-app/
|
|
53
|
-
"@pactor-app/
|
|
54
|
-
"@pactor-app/
|
|
55
|
-
"@pactor-app/ui": "1.48.
|
|
56
|
-
"@pactor-app/
|
|
49
|
+
"@pactor-app/core": "1.48.1",
|
|
50
|
+
"@pactor-app/expression": "1.48.1",
|
|
51
|
+
"@pactor-app/resource": "1.48.1",
|
|
52
|
+
"@pactor-app/permission": "1.48.1",
|
|
53
|
+
"@pactor-app/schema": "1.48.1",
|
|
54
|
+
"@pactor-app/runtime": "1.48.1",
|
|
55
|
+
"@pactor-app/ui": "1.48.1",
|
|
56
|
+
"@pactor-app/router": "1.48.1"
|
|
57
57
|
},
|
|
58
58
|
"peerDependencies": {
|
|
59
59
|
"react": ">=18",
|