@aiquants/directory-tree 3.11.1 → 3.12.0
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/README.md +77 -0
- package/dist/DirectoryTree.d.ts +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.d.ts +1 -0
- package/dist/index.js +970 -900
- package/dist/labels.d.ts +23 -0
- package/dist/types.d.ts +7 -1
- package/package.json +3 -3
package/dist/labels.d.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { VirtualScrollLabels, VirtualScrollLocale } from "@aiquants/virtualscroll";
|
|
2
|
+
export type DirectoryTreeLocale = VirtualScrollLocale;
|
|
3
|
+
export type DirectoryTreeLabels = VirtualScrollLabels & {
|
|
4
|
+
readonly entryKindDirectory: string;
|
|
5
|
+
readonly entryKindFile: string;
|
|
6
|
+
};
|
|
7
|
+
export type DirectoryTreeLabelOverrides = {
|
|
8
|
+
readonly [K in keyof DirectoryTreeLabels]?: DirectoryTreeLabels[K];
|
|
9
|
+
};
|
|
10
|
+
export declare const DIRECTORY_TREE_LABEL_KEYS: readonly [
|
|
11
|
+
"scrollUp",
|
|
12
|
+
"scrollDown",
|
|
13
|
+
"scrollLeft",
|
|
14
|
+
"scrollRight",
|
|
15
|
+
"scrollToTop",
|
|
16
|
+
"scrollToBottom",
|
|
17
|
+
"noItems",
|
|
18
|
+
"entryKindDirectory",
|
|
19
|
+
"entryKindFile"
|
|
20
|
+
];
|
|
21
|
+
export declare const DIRECTORY_TREE_LABEL_CATALOGS: Readonly<Record<DirectoryTreeLocale, DirectoryTreeLabels>>;
|
|
22
|
+
export declare const resolveDirectoryTreeLabels: (locale: DirectoryTreeLocale | undefined, overrides: DirectoryTreeLabelOverrides | undefined) => DirectoryTreeLabels;
|
|
23
|
+
export declare const pickEngineLabels: (labels: DirectoryTreeLabels) => VirtualScrollLabels;
|
package/dist/types.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { VirtualScroll } from "@aiquants/virtualscroll";
|
|
2
2
|
import { ComponentProps, CSSProperties, ReactNode } from "react";
|
|
3
|
+
import { DirectoryTreeLabelOverrides, DirectoryTreeLocale } from "./labels.ts";
|
|
3
4
|
export type DirectoryEntry = {
|
|
4
5
|
name: string;
|
|
5
6
|
label?: ReactNode;
|
|
@@ -45,12 +46,13 @@ export type DirectoryTreeClickEvent = {
|
|
|
45
46
|
isExpanded: boolean;
|
|
46
47
|
preventDefault: () => void;
|
|
47
48
|
};
|
|
48
|
-
export type DirectoryTreeVirtualScrollOptions = Omit<ComponentProps<typeof VirtualScroll>, "itemCount" | "getItem" | "getItemHeight" | "children" | "viewportSize" | "onWheelHorizontal" | "horizontalKeyInputs" | "horizontalKeyStep" | "ref"> & {
|
|
49
|
+
export type DirectoryTreeVirtualScrollOptions = Omit<ComponentProps<typeof VirtualScroll>, "itemCount" | "getItem" | "getItemHeight" | "children" | "viewportSize" | "onWheelHorizontal" | "horizontalKeyInputs" | "horizontalKeyStep" | "ref" | "locale" | "labels"> & {
|
|
49
50
|
viewportHeightOverride?: number;
|
|
50
51
|
preserveScrollAnchor?: boolean;
|
|
51
52
|
};
|
|
52
53
|
type MustBeNever<T extends never> = T;
|
|
53
54
|
export type HorizontalSeamSealGuard = MustBeNever<Extract<keyof DirectoryTreeVirtualScrollOptions, "onWheelHorizontal" | "horizontalKeyInputs" | "horizontalKeyStep" | "ref">>;
|
|
55
|
+
export type ChromeLanguageSealGuard = MustBeNever<Extract<keyof DirectoryTreeVirtualScrollOptions, "locale" | "labels">>;
|
|
54
56
|
export type DirectoryTreeColumn = {
|
|
55
57
|
key: string;
|
|
56
58
|
header?: ReactNode;
|
|
@@ -132,6 +134,8 @@ export type DirectoryTreeProps = {
|
|
|
132
134
|
virtualScroll?: DirectoryTreeVirtualScrollOptions;
|
|
133
135
|
grid?: DirectoryTreeGrid;
|
|
134
136
|
sort?: DirectoryEntryComparator;
|
|
137
|
+
locale?: DirectoryTreeLocale;
|
|
138
|
+
labels?: DirectoryTreeLabelOverrides;
|
|
135
139
|
};
|
|
136
140
|
export type UseDirectoryTreeStateProps = {
|
|
137
141
|
initialExpanded?: Set<string>;
|
|
@@ -149,6 +153,8 @@ export type DirectoryEntryItemProps = {
|
|
|
149
153
|
positionInSet: number;
|
|
150
154
|
setSize: number;
|
|
151
155
|
rowHeight: number;
|
|
156
|
+
entryKindDirectory: string;
|
|
157
|
+
entryKindFile: string;
|
|
152
158
|
isDirOpen: (path: string) => boolean;
|
|
153
159
|
expansion: {
|
|
154
160
|
toggleDirectory: (path: string) => void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aiquants/directory-tree",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.12.0",
|
|
4
4
|
"description": "High-performance directory tree component for React with virtual scrolling and file selection",
|
|
5
5
|
"sideEffects": [
|
|
6
6
|
"**/*.css"
|
|
@@ -30,12 +30,12 @@
|
|
|
30
30
|
"tailwind-merge": "^3.4.0"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
|
-
"@aiquants/virtualscroll": "^3.
|
|
33
|
+
"@aiquants/virtualscroll": "^3.7.0",
|
|
34
34
|
"react": "^19.2.7",
|
|
35
35
|
"react-dom": "^19.2.7"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@aiquants/virtualscroll": "3.
|
|
38
|
+
"@aiquants/virtualscroll": "3.7.0",
|
|
39
39
|
"@tailwindcss/cli": "^4.1.18",
|
|
40
40
|
"@tailwindcss/vite": "^4.1.18",
|
|
41
41
|
"@testing-library/jest-dom": "^6.9.1",
|