vfs-kit 1.0.0 → 1.0.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.
Files changed (52) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +145 -2
  3. package/dist/VfsAdapter-BWjniD9Y.d.mts +57 -0
  4. package/dist/VfsAdapter-DOBt_TyL.d.ts +57 -0
  5. package/dist/VfsEngine-B6nhgyjQ.d.mts +152 -0
  6. package/dist/VfsEngine-DLx0iUpi.d.ts +152 -0
  7. package/dist/VfsNode-D10gxL5W.d.mts +48 -0
  8. package/dist/VfsNode-D10gxL5W.d.ts +48 -0
  9. package/dist/adapters/index.d.mts +201 -0
  10. package/dist/adapters/index.d.ts +201 -0
  11. package/dist/adapters/index.js +1159 -0
  12. package/dist/adapters/index.js.map +1 -0
  13. package/dist/adapters/index.mjs +1159 -0
  14. package/dist/adapters/index.mjs.map +1 -0
  15. package/dist/chunk-2FEJBM4N.js +60 -0
  16. package/dist/chunk-2FEJBM4N.js.map +1 -0
  17. package/dist/chunk-7OQI6PNM.mjs +60 -0
  18. package/dist/chunk-7OQI6PNM.mjs.map +1 -0
  19. package/dist/chunk-ALWOZGZI.mjs +23 -0
  20. package/dist/chunk-ALWOZGZI.mjs.map +1 -0
  21. package/dist/chunk-POSVS4C7.mjs +531 -0
  22. package/dist/chunk-POSVS4C7.mjs.map +1 -0
  23. package/dist/chunk-R3ROYAMW.js +23 -0
  24. package/dist/chunk-R3ROYAMW.js.map +1 -0
  25. package/dist/chunk-SWRBVSS6.mjs +16 -0
  26. package/dist/chunk-SWRBVSS6.mjs.map +1 -0
  27. package/dist/chunk-U2CKTXY7.js +16 -0
  28. package/dist/chunk-U2CKTXY7.js.map +1 -0
  29. package/dist/chunk-WZVVI3HX.js +531 -0
  30. package/dist/chunk-WZVVI3HX.js.map +1 -0
  31. package/dist/components/index.d.mts +193 -0
  32. package/dist/components/index.d.ts +193 -0
  33. package/dist/components/index.js +1197 -0
  34. package/dist/components/index.js.map +1 -0
  35. package/dist/components/index.mjs +1197 -0
  36. package/dist/components/index.mjs.map +1 -0
  37. package/dist/hooks/index.d.mts +120 -0
  38. package/dist/hooks/index.d.ts +120 -0
  39. package/dist/hooks/index.js +51 -0
  40. package/dist/hooks/index.js.map +1 -0
  41. package/dist/hooks/index.mjs +51 -0
  42. package/dist/hooks/index.mjs.map +1 -0
  43. package/dist/index.d.mts +42 -0
  44. package/dist/index.d.ts +42 -0
  45. package/dist/index.js +530 -0
  46. package/dist/index.js.map +1 -0
  47. package/dist/index.mjs +530 -0
  48. package/dist/index.mjs.map +1 -0
  49. package/dist/useVfsTabs-ZHDaLrM1.d.mts +39 -0
  50. package/dist/useVfsTabs-ZHDaLrM1.d.ts +39 -0
  51. package/package.json +63 -30
  52. package/index.js +0 -7
@@ -0,0 +1,39 @@
1
+ interface VfsTab {
2
+ id: string;
3
+ nodeId: string;
4
+ workspaceId: string;
5
+ title: string;
6
+ isDirty: boolean;
7
+ isLocked: boolean;
8
+ savedContent: Uint8Array | null;
9
+ currentContent: Uint8Array | null;
10
+ lastSavedAt: number | null;
11
+ }
12
+ type DirtyChecker = (params: {
13
+ nodeId: string;
14
+ savedContent: Uint8Array | null;
15
+ currentContent: Uint8Array | null;
16
+ lastSavedAt: number | null;
17
+ }) => boolean;
18
+ interface UseVfsTabsOptions {
19
+ workspaceIds?: string[];
20
+ dirtyChecker?: DirtyChecker;
21
+ }
22
+ interface VfsTabsApi {
23
+ tabs: VfsTab[];
24
+ activeTabId: string | null;
25
+ activeTab: VfsTab | null;
26
+ open: (nodeId: string, workspaceId: string) => Promise<void>;
27
+ close: (tabId: string) => void;
28
+ closeOthers: (tabId: string) => void;
29
+ closeAll: (workspaceId?: string) => void;
30
+ setActive: (tabId: string) => void;
31
+ reorder: (activeId: string, overId: string) => void;
32
+ lock: (tabId: string) => void;
33
+ unlock: (tabId: string) => void;
34
+ markDirty: (tabId: string, currentContent: Uint8Array) => void;
35
+ markSaved: (tabId: string) => void;
36
+ }
37
+ declare function useVfsTabs(options?: UseVfsTabsOptions): VfsTabsApi;
38
+
39
+ export { type DirtyChecker as D, type UseVfsTabsOptions as U, type VfsTabsApi as V, type VfsTab as a, useVfsTabs as u };
package/package.json CHANGED
@@ -1,37 +1,70 @@
1
1
  {
2
2
  "name": "vfs-kit",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "A headless-first Virtual File System for React. Complete with drag-and-drop hierarchy, tab management and pluggable storage adapters.",
5
- "main": "index.js",
5
+ "main": "./dist/index.js",
6
+ "module": "./dist/index.mjs",
7
+ "types": "./dist/index.d.ts",
8
+ "files": ["dist"],
9
+ "exports": {
10
+ ".": {
11
+ "types": "./dist/index.d.ts",
12
+ "import": "./dist/index.mjs",
13
+ "require": "./dist/index.js"
14
+ },
15
+ "./hooks": {
16
+ "types": "./dist/hooks/index.d.ts",
17
+ "import": "./dist/hooks/index.mjs",
18
+ "require": "./dist/hooks/index.js"
19
+ },
20
+ "./adapters": {
21
+ "types": "./dist/adapters/index.d.ts",
22
+ "import": "./dist/adapters/index.mjs",
23
+ "require": "./dist/adapters/index.js"
24
+ },
25
+ "./components": {
26
+ "types": "./dist/components/index.d.ts",
27
+ "import": "./dist/components/index.mjs",
28
+ "require": "./dist/components/index.js"
29
+ }
30
+ },
6
31
  "scripts": {
7
- "test": "echo \"Error: no test specified\" && exit 1"
32
+ "build": "tsup",
33
+ "dev": "tsup --watch",
34
+ "typecheck": "tsc --noEmit"
35
+ },
36
+ "peerDependencies": {
37
+ "@dnd-kit/core": ">=6.0.0",
38
+ "@dnd-kit/modifiers": ">=6.0.0",
39
+ "@dnd-kit/sortable": ">=7.0.0",
40
+ "@dnd-kit/utilities": ">=3.0.0",
41
+ "@tanstack/react-virtual": ">=3.0.0",
42
+ "react": ">=18.0.0",
43
+ "react-dom": ">=18.0.0"
8
44
  },
9
- "repository": {
10
- "type": "git",
11
- "url": "git+https://github.com/bengru07/vfs-kit.git"
45
+ "peerDependenciesMeta": {
46
+ "@dnd-kit/core": { "optional": true },
47
+ "@dnd-kit/modifiers": { "optional": true },
48
+ "@dnd-kit/sortable": { "optional": true },
49
+ "@dnd-kit/utilities": { "optional": true },
50
+ "@tanstack/react-virtual": { "optional": true }
12
51
  },
13
- "keywords": [
14
- "react",
15
- "typescript",
16
- "tailwind",
17
- "shadcn",
18
- "file-system",
19
- "vfs",
20
- "file-explorer",
21
- "file-manager",
22
- "tree-view",
23
- "drag-and-drop",
24
- "dnd",
25
- "tabs",
26
- "state-management",
27
- "headless",
28
- "virtual-fs",
29
- "history"
30
- ],
31
- "author": "Benjamin Gruber",
32
- "license": "ISC",
33
- "bugs": {
34
- "url": "https://github.com/bengru07/vfs-kit/issues"
52
+ "dependencies": {
53
+ "idb": "^8.0.3",
54
+ "nanoid": "^5.0.0"
35
55
  },
36
- "homepage": "https://github.com/bengru07/vfs-kit#readme"
37
- }
56
+ "devDependencies": {
57
+ "@dnd-kit/core": "^6.3.1",
58
+ "@dnd-kit/modifiers": "^9.0.0",
59
+ "@dnd-kit/sortable": "^10.0.0",
60
+ "@dnd-kit/utilities": "^3.2.2",
61
+ "@tanstack/react-virtual": "^3.13.21",
62
+ "@types/node": "^22.0.0",
63
+ "@types/react": "^19.2.14",
64
+ "@types/react-dom": "^19.0.0",
65
+ "react": "^19.0.0",
66
+ "react-dom": "^19.0.0",
67
+ "tsup": "^8.5.1",
68
+ "typescript": "^5.7.0"
69
+ }
70
+ }
package/index.js DELETED
@@ -1,7 +0,0 @@
1
- function test(a, b) {
2
- console.log("Hello, world!");
3
-
4
- return a * b;
5
- }
6
-
7
- module.exports = test;