@principal-ade/dynamic-file-tree 0.2.13 → 0.2.14
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.mjs
CHANGED
|
@@ -1952,7 +1952,7 @@ var MultiFileTree = ({
|
|
|
1952
1952
|
};
|
|
1953
1953
|
// src/components/StoryboardWorkflowsTree/StoryboardWorkflowsTreeCore.tsx
|
|
1954
1954
|
import { Package, FolderKanban, LayoutDashboard, Workflow, BookOpen, FolderOpen, GitCommit, ExternalLink, List, ListX, Eye as Eye2, EyeOff as EyeOff2 } from "lucide-react";
|
|
1955
|
-
import React13, { useMemo as useMemo9, useRef as useRef5 } from "react";
|
|
1955
|
+
import React13, { useMemo as useMemo9, useRef as useRef5, useLayoutEffect } from "react";
|
|
1956
1956
|
import { Tree as Tree3 } from "react-arborist";
|
|
1957
1957
|
|
|
1958
1958
|
// src/utils/gitStatus.tsx
|
|
@@ -2768,6 +2768,27 @@ var StoryboardWorkflowsTreeCoreInner = ({
|
|
|
2768
2768
|
const initialHeight = 600;
|
|
2769
2769
|
const [containerRef, containerHeight] = useContainerHeight(initialHeight);
|
|
2770
2770
|
const treeRef = useRef5(null);
|
|
2771
|
+
const scrollTopRef = useRef5(0);
|
|
2772
|
+
const listElementRef = useRef5(null);
|
|
2773
|
+
useLayoutEffect(() => {
|
|
2774
|
+
if (containerRef.current && !listElementRef.current) {
|
|
2775
|
+
const listElement = containerRef.current.querySelector('[role="tree"]')?.parentElement;
|
|
2776
|
+
if (listElement) {
|
|
2777
|
+
listElementRef.current = listElement;
|
|
2778
|
+
const handleScroll = () => {
|
|
2779
|
+
scrollTopRef.current = listElement.scrollTop;
|
|
2780
|
+
};
|
|
2781
|
+
listElement.addEventListener("scroll", handleScroll);
|
|
2782
|
+
return () => listElement.removeEventListener("scroll", handleScroll);
|
|
2783
|
+
}
|
|
2784
|
+
}
|
|
2785
|
+
return;
|
|
2786
|
+
});
|
|
2787
|
+
useLayoutEffect(() => {
|
|
2788
|
+
if (listElementRef.current && scrollTopRef.current > 0) {
|
|
2789
|
+
listElementRef.current.scrollTop = scrollTopRef.current;
|
|
2790
|
+
}
|
|
2791
|
+
});
|
|
2771
2792
|
const handleToggle = (id) => {
|
|
2772
2793
|
if (onToggle && treeRef.current) {
|
|
2773
2794
|
const node = treeRef.current.get(id);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StoryboardWorkflowsTreeCore.d.ts","sourceRoot":"","sources":["../../../../src/components/StoryboardWorkflowsTree/StoryboardWorkflowsTreeCore.tsx"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"StoryboardWorkflowsTreeCore.d.ts","sourceRoot":"","sources":["../../../../src/components/StoryboardWorkflowsTree/StoryboardWorkflowsTreeCore.tsx"],"names":[],"mappings":"AACA,OAAO,KAA2C,MAAM,OAAO,CAAC;AAShE,OAAO,KAAK,EAEV,4BAA4B,EAQ7B,MAAM,SAAS,CAAC;AAk+BjB,eAAO,MAAM,2BAA2B,0DA8BtC,CAAC"}
|
package/package.json
CHANGED