gatsby-theme-carbon 4.1.0 → 4.1.2
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gatsby-theme-carbon",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.2",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"author": "vpicone <vp@vincepic.one> (@vpicone)",
|
|
6
6
|
"repository": {
|
|
@@ -25,11 +25,11 @@
|
|
|
25
25
|
"@babel/core": "^7.24.7",
|
|
26
26
|
"@babel/plugin-proposal-class-properties": "^7.18.6",
|
|
27
27
|
"@babel/plugin-syntax-jsx": "^7.24.7",
|
|
28
|
-
"@carbon/elements": "^11.
|
|
29
|
-
"@carbon/grid": "^11.
|
|
30
|
-
"@carbon/pictograms-react": "^11.
|
|
31
|
-
"@carbon/react": "^1.
|
|
32
|
-
"@carbon/themes": "^11.
|
|
28
|
+
"@carbon/elements": "^11.53.0",
|
|
29
|
+
"@carbon/grid": "^11.27.0",
|
|
30
|
+
"@carbon/pictograms-react": "^11.66.0",
|
|
31
|
+
"@carbon/react": "^1.66.0",
|
|
32
|
+
"@carbon/themes": "^11.40.0",
|
|
33
33
|
"@garcia-enterprise/gatsby-plugin-sass-resources": "^4.0.2",
|
|
34
34
|
"@mdx-js/mdx": "^3.0.1",
|
|
35
35
|
"@mdx-js/react": "^3.0.1",
|
|
@@ -85,9 +85,10 @@ const LeftNavTree = ({ items, theme, pathPrefix }) => {
|
|
|
85
85
|
const isTabActive = useCallback(
|
|
86
86
|
(node) => {
|
|
87
87
|
const pathname = removeHashAndQuery(activePath);
|
|
88
|
+
const tabRootPath = pathname.split('/').slice(0, -1).join('/');
|
|
89
|
+
|
|
88
90
|
const isActive =
|
|
89
|
-
|
|
90
|
-
`${pathname.split('/')[1]}/${pathname.split('/')[2]}`;
|
|
91
|
+
node.path?.split('/').slice(0, -1).join('/') === tabRootPath;
|
|
91
92
|
|
|
92
93
|
return isActive;
|
|
93
94
|
},
|
|
@@ -95,12 +96,14 @@ const LeftNavTree = ({ items, theme, pathPrefix }) => {
|
|
|
95
96
|
);
|
|
96
97
|
|
|
97
98
|
useEffect(() => {
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
99
|
+
if (activePath) {
|
|
100
|
+
let activeNode = dfs(itemNodes, isTreeNodeActive);
|
|
101
|
+
if (!activeNode) {
|
|
102
|
+
activeNode = dfs(itemNodes, isTabActive);
|
|
103
|
+
}
|
|
104
|
+
setTreeActiveItem(activeNode);
|
|
101
105
|
}
|
|
102
|
-
|
|
103
|
-
}, [isTreeNodeActive, itemNodes, isTabActive]);
|
|
106
|
+
}, [isTreeNodeActive, itemNodes, isTabActive, activePath]);
|
|
104
107
|
|
|
105
108
|
const isTreeNodeExpanded = (node) =>
|
|
106
109
|
!!dfs([node], (evalNode) =>
|