@mercurjs/admin 2.3.4-canary.7 → 2.3.4-canary.8

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.
Files changed (2) hide show
  1. package/dist/index.js +11 -1
  2. package/package.json +6 -6
package/dist/index.js CHANGED
@@ -2775,6 +2775,15 @@ var createBranchRoute = (segment) => ({
2775
2775
  path: segment,
2776
2776
  children: []
2777
2777
  });
2778
+ var hoistBreadcrumb = (branch, handle, isIndex) => {
2779
+ const branchHandle = branch.handle;
2780
+ if (!isIndex || !handle?.breadcrumb || branchHandle?.breadcrumb) {
2781
+ return handle;
2782
+ }
2783
+ branch.handle = { ...branchHandle, breadcrumb: handle.breadcrumb };
2784
+ const { breadcrumb: _breadcrumb, ...rest } = handle;
2785
+ return Object.keys(rest).length ? rest : void 0;
2786
+ };
2778
2787
  var createLeafRoute = (Component, loader, handle, path = "") => ({
2779
2788
  path,
2780
2789
  ErrorBoundary,
@@ -2833,7 +2842,8 @@ var addRoute = (pathSegments, Component, currentLevel, loader, handle, parallelR
2833
2842
  leaf.children = processParallelRoutes(parallelRoutes, currentFullPath);
2834
2843
  Object.assign(route, leaf);
2835
2844
  } else {
2836
- const leaf = createLeafRoute(Component, loader, handle);
2845
+ const leafHandle = hoistBreadcrumb(route, handle, remainingSegments.length === 0);
2846
+ const leaf = createLeafRoute(Component, loader, leafHandle);
2837
2847
  leaf.children = processParallelRoutes(parallelRoutes, currentFullPath);
2838
2848
  route.children.push(leaf);
2839
2849
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mercurjs/admin",
3
- "version": "2.3.4-canary.7",
3
+ "version": "2.3.4-canary.8",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/mercurjs/mercur",
@@ -34,8 +34,8 @@
34
34
  "lint": "oxlint --max-warnings 0"
35
35
  },
36
36
  "dependencies": {
37
- "@mercurjs/dashboard-shared": "2.3.4-canary.7",
38
- "@mercurjs/client": "2.3.4-canary.7",
37
+ "@mercurjs/dashboard-shared": "2.3.4-canary.8",
38
+ "@mercurjs/client": "2.3.4-canary.8",
39
39
  "@ariakit/react": "^0.4.15",
40
40
  "@babel/runtime": "^8.0.0",
41
41
  "@dnd-kit/core": "^6.1.0",
@@ -88,9 +88,9 @@
88
88
  "tsup": "^8.0.2",
89
89
  "typescript": "5.9.3",
90
90
  "@medusajs/types": "2.20.1",
91
- "@mercurjs/core": "2.3.4-canary.7",
92
- "@mercurjs/dashboard-sdk": "2.3.4-canary.7",
93
- "@mercurjs/types": "2.3.4-canary.7",
91
+ "@mercurjs/core": "2.3.4-canary.8",
92
+ "@mercurjs/dashboard-sdk": "2.3.4-canary.8",
93
+ "@mercurjs/types": "2.3.4-canary.8",
94
94
  "react-router-dom": "7.18.1"
95
95
  }
96
96
  }