@deephaven/file-explorer 0.51.1-beta.0 → 0.52.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/dist/FileExplorerToolbar.d.ts +3 -3
- package/dist/FileExplorerToolbar.d.ts.map +1 -1
- package/dist/FileExplorerToolbar.js.map +1 -1
- package/dist/FileListItem.d.ts +4 -4
- package/dist/FileListItem.d.ts.map +1 -1
- package/dist/FileListItem.js +8 -40
- package/dist/FileListItem.js.map +1 -1
- package/dist/FileStorage.d.ts +11 -11
- package/dist/FileStorage.d.ts.map +1 -1
- package/dist/FileStorage.js.map +1 -1
- package/package.json +8 -8
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import './FileExplorerToolbar.scss';
|
|
3
3
|
type FileExplorerToolbarProps = {
|
|
4
|
-
createFile()
|
|
5
|
-
createFolder()
|
|
6
|
-
onSearchChange
|
|
4
|
+
createFile: () => void;
|
|
5
|
+
createFolder: () => void;
|
|
6
|
+
onSearchChange?: (text: string) => void;
|
|
7
7
|
defaultSearchText?: string;
|
|
8
8
|
};
|
|
9
9
|
export declare function FileExplorerToolbar({ createFile, createFolder, onSearchChange, defaultSearchText, }: FileExplorerToolbarProps): JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileExplorerToolbar.d.ts","sourceRoot":"","sources":["../src/FileExplorerToolbar.tsx"],"names":[],"mappings":";AAGA,OAAO,4BAA4B,CAAC;AAEpC,KAAK,wBAAwB,GAAG;IAC9B,UAAU,
|
|
1
|
+
{"version":3,"file":"FileExplorerToolbar.d.ts","sourceRoot":"","sources":["../src/FileExplorerToolbar.tsx"],"names":[],"mappings":";AAGA,OAAO,4BAA4B,CAAC;AAEpC,KAAK,wBAAwB,GAAG;IAC9B,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,cAAc,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B,CAAC;AAEF,wBAAgB,mBAAmB,CAAC,EAClC,UAAU,EACV,YAAY,EACZ,cAAc,EACd,iBAAsB,GACvB,EAAE,wBAAwB,GAAG,GAAG,CAAC,OAAO,CA8BxC;AAED,eAAe,mBAAmB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileExplorerToolbar.js","names":["React","Button","DebouncedSearchInput","vsNewFile","vsNewFolder","jsx","_jsx","jsxs","_jsxs","FileExplorerToolbar","_ref","createFile","createFolder","onSearchChange","defaultSearchText","className","children","kind","icon","tooltip","onClick","value","onChange","placeholder"],"sources":["../src/FileExplorerToolbar.tsx"],"sourcesContent":["import React from 'react';\nimport { Button, DebouncedSearchInput } from '@deephaven/components';\nimport { vsNewFile, vsNewFolder } from '@deephaven/icons';\nimport './FileExplorerToolbar.scss';\n\ntype FileExplorerToolbarProps = {\n createFile()
|
|
1
|
+
{"version":3,"file":"FileExplorerToolbar.js","names":["React","Button","DebouncedSearchInput","vsNewFile","vsNewFolder","jsx","_jsx","jsxs","_jsxs","FileExplorerToolbar","_ref","createFile","createFolder","onSearchChange","defaultSearchText","className","children","kind","icon","tooltip","onClick","value","onChange","placeholder"],"sources":["../src/FileExplorerToolbar.tsx"],"sourcesContent":["import React from 'react';\nimport { Button, DebouncedSearchInput } from '@deephaven/components';\nimport { vsNewFile, vsNewFolder } from '@deephaven/icons';\nimport './FileExplorerToolbar.scss';\n\ntype FileExplorerToolbarProps = {\n createFile: () => void;\n createFolder: () => void;\n onSearchChange?: (text: string) => void;\n defaultSearchText?: string;\n};\n\nexport function FileExplorerToolbar({\n createFile,\n createFolder,\n onSearchChange,\n defaultSearchText = '',\n}: FileExplorerToolbarProps): JSX.Element {\n return (\n <div className=\"file-explorer-toolbar\">\n <div className=\"file-explorer-toolbar-buttons\">\n <Button\n kind=\"ghost\"\n icon={vsNewFile}\n tooltip=\"New notebook\"\n onClick={createFile}\n aria-label=\"New notebook\"\n />\n <Button\n kind=\"ghost\"\n icon={vsNewFolder}\n tooltip=\"New folder\"\n onClick={createFolder}\n aria-label=\"New folder\"\n />\n </div>\n {onSearchChange && (\n <div className=\"file-explorer-toolbar-search\">\n <DebouncedSearchInput\n value={defaultSearchText}\n onChange={onSearchChange}\n placeholder=\"Search by name\"\n />\n </div>\n )}\n </div>\n );\n}\n\nexport default FileExplorerToolbar;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,MAAM,EAAEC,oBAAoB,QAAQ,uBAAuB;AACpE,SAASC,SAAS,EAAEC,WAAW,QAAQ,kBAAkB;AAAC;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAU1D,OAAO,SAASC,mBAAmBA,CAAAC,IAAA,EAKO;EAAA,IALN;IAClCC,UAAU;IACVC,YAAY;IACZC,cAAc;IACdC,iBAAiB,GAAG;EACI,CAAC,GAAAJ,IAAA;EACzB,oBACEF,KAAA;IAAKO,SAAS,EAAC,uBAAuB;IAAAC,QAAA,gBACpCR,KAAA;MAAKO,SAAS,EAAC,+BAA+B;MAAAC,QAAA,gBAC5CV,IAAA,CAACL,MAAM;QACLgB,IAAI,EAAC,OAAO;QACZC,IAAI,EAAEf,SAAU;QAChBgB,OAAO,EAAC,cAAc;QACtBC,OAAO,EAAET,UAAW;QACpB,cAAW;MAAc,CAC1B,CAAC,eACFL,IAAA,CAACL,MAAM;QACLgB,IAAI,EAAC,OAAO;QACZC,IAAI,EAAEd,WAAY;QAClBe,OAAO,EAAC,YAAY;QACpBC,OAAO,EAAER,YAAa;QACtB,cAAW;MAAY,CACxB,CAAC;IAAA,CACC,CAAC,EACLC,cAAc,iBACbP,IAAA;MAAKS,SAAS,EAAC,8BAA8B;MAAAC,QAAA,eAC3CV,IAAA,CAACJ,oBAAoB;QACnBmB,KAAK,EAAEP,iBAAkB;QACzBQ,QAAQ,EAAET,cAAe;QACzBU,WAAW,EAAC;MAAgB,CAC7B;IAAC,CACC,CACN;EAAA,CACE,CAAC;AAEV;AAEA,eAAed,mBAAmB"}
|
package/dist/FileListItem.d.ts
CHANGED
|
@@ -8,10 +8,10 @@ export type FileListRenderItemProps = RenderItemProps<FileStorageItem> & {
|
|
|
8
8
|
draggedItems?: FileStorageItem[];
|
|
9
9
|
isDragInProgress: boolean;
|
|
10
10
|
isDropTargetValid: boolean;
|
|
11
|
-
onDragStart(index: number, e: React.DragEvent<HTMLDivElement>)
|
|
12
|
-
onDragOver(index: number, e: React.DragEvent<HTMLDivElement>)
|
|
13
|
-
onDragEnd(index: number, e: React.DragEvent<HTMLDivElement>)
|
|
14
|
-
onDrop(index: number, e: React.DragEvent<HTMLDivElement>)
|
|
11
|
+
onDragStart: (index: number, e: React.DragEvent<HTMLDivElement>) => void;
|
|
12
|
+
onDragOver: (index: number, e: React.DragEvent<HTMLDivElement>) => void;
|
|
13
|
+
onDragEnd: (index: number, e: React.DragEvent<HTMLDivElement>) => void;
|
|
14
|
+
onDrop: (index: number, e: React.DragEvent<HTMLDivElement>) => void;
|
|
15
15
|
};
|
|
16
16
|
export declare function FileListItem(props: FileListRenderItemProps): JSX.Element;
|
|
17
17
|
export default FileListItem;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileListItem.d.ts","sourceRoot":"","sources":["../src/FileListItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAW,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAKjE,OAAO,EAAE,eAAe,EAAe,MAAM,eAAe,CAAC;AAC7D,OAAO,iBAAiB,CAAC;AAsBzB,MAAM,MAAM,uBAAuB,GAAG,eAAe,CAAC,eAAe,CAAC,GAAG;IACvE,QAAQ,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC;IACvB,cAAc,CAAC,EAAE,eAAe,CAAC;IACjC,Y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AC,OAAO,CA0ExE;AAED,eAAe,YAAY,CAAC"}
|
package/dist/FileListItem.js
CHANGED
|
@@ -38,10 +38,10 @@ export function FileListItem(props) {
|
|
|
38
38
|
item,
|
|
39
39
|
itemIndex,
|
|
40
40
|
dropTargetItem,
|
|
41
|
-
onDragStart,
|
|
42
|
-
onDragOver,
|
|
43
|
-
onDragEnd,
|
|
44
|
-
onDrop
|
|
41
|
+
onDragStart: _onDragStart,
|
|
42
|
+
onDragOver: _onDragOver,
|
|
43
|
+
onDragEnd: _onDragEnd,
|
|
44
|
+
onDrop: _onDrop
|
|
45
45
|
} = props;
|
|
46
46
|
var isDragged = (_draggedItems$some = draggedItems === null || draggedItems === void 0 ? void 0 : draggedItems.some(draggedItem => draggedItem.id === item.id)) !== null && _draggedItems$some !== void 0 ? _draggedItems$some : false;
|
|
47
47
|
var itemPath = getPathFromItem(item);
|
|
@@ -65,42 +65,10 @@ export function FileListItem(props) {
|
|
|
65
65
|
'is-invalid-drop-target': isInvalidDropTarget,
|
|
66
66
|
'is-selected': isSelected
|
|
67
67
|
}),
|
|
68
|
-
onDragStart:
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
onDragStart.toString = function () {
|
|
73
|
-
return _onDragStart.toString();
|
|
74
|
-
};
|
|
75
|
-
return onDragStart;
|
|
76
|
-
}(e => onDragStart(itemIndex, e)),
|
|
77
|
-
onDragOver: function (_onDragOver) {
|
|
78
|
-
function onDragOver(_x2) {
|
|
79
|
-
return _onDragOver.apply(this, arguments);
|
|
80
|
-
}
|
|
81
|
-
onDragOver.toString = function () {
|
|
82
|
-
return _onDragOver.toString();
|
|
83
|
-
};
|
|
84
|
-
return onDragOver;
|
|
85
|
-
}(e => onDragOver(itemIndex, e)),
|
|
86
|
-
onDragEnd: function (_onDragEnd) {
|
|
87
|
-
function onDragEnd(_x3) {
|
|
88
|
-
return _onDragEnd.apply(this, arguments);
|
|
89
|
-
}
|
|
90
|
-
onDragEnd.toString = function () {
|
|
91
|
-
return _onDragEnd.toString();
|
|
92
|
-
};
|
|
93
|
-
return onDragEnd;
|
|
94
|
-
}(e => onDragEnd(itemIndex, e)),
|
|
95
|
-
onDrop: function (_onDrop) {
|
|
96
|
-
function onDrop(_x4) {
|
|
97
|
-
return _onDrop.apply(this, arguments);
|
|
98
|
-
}
|
|
99
|
-
onDrop.toString = function () {
|
|
100
|
-
return _onDrop.toString();
|
|
101
|
-
};
|
|
102
|
-
return onDrop;
|
|
103
|
-
}(e => onDrop(itemIndex, e)),
|
|
68
|
+
onDragStart: e => _onDragStart(itemIndex, e),
|
|
69
|
+
onDragOver: e => _onDragOver(itemIndex, e),
|
|
70
|
+
onDragEnd: e => _onDragEnd(itemIndex, e),
|
|
71
|
+
onDrop: e => _onDrop(itemIndex, e),
|
|
104
72
|
draggable: true,
|
|
105
73
|
role: "presentation",
|
|
106
74
|
"aria-label": item.basename,
|
package/dist/FileListItem.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileListItem.js","names":["React","Tooltip","dhPython","vsCode","vsFolder","vsFolderOpened","FontAwesomeIcon","classNames","isDirectory","FileUtils","MIME_TYPE","getPathFromItem","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","getItemIcon","item","isExpanded","mimeType","getMimeType","basename","PYTHON","FileListItem","props","_draggedItems$some","children","draggedItems","isDragInProgress","isDropTargetValid","isSelected","itemIndex","dropTargetItem","onDragStart","onDragOver","onDragEnd","onDrop","isDragged","some","draggedItem","id","itemPath","dropTargetPath","isExactDropTarget","isInDropTarget","isInvalidDropTarget","icon","depth","getDepth","filename","depthLines","Array","fill","map","value","index","className","
|
|
1
|
+
{"version":3,"file":"FileListItem.js","names":["React","Tooltip","dhPython","vsCode","vsFolder","vsFolderOpened","FontAwesomeIcon","classNames","isDirectory","FileUtils","MIME_TYPE","getPathFromItem","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","getItemIcon","item","isExpanded","mimeType","getMimeType","basename","PYTHON","FileListItem","props","_draggedItems$some","children","draggedItems","isDragInProgress","isDropTargetValid","isSelected","itemIndex","dropTargetItem","onDragStart","onDragOver","onDragEnd","onDrop","isDragged","some","draggedItem","id","itemPath","dropTargetPath","isExactDropTarget","isInDropTarget","isInvalidDropTarget","icon","depth","getDepth","filename","depthLines","Array","fill","map","value","index","className","e","draggable","role","fixedWidth"],"sources":["../src/FileListItem.tsx"],"sourcesContent":["import React from 'react';\nimport { Tooltip, RenderItemProps } from '@deephaven/components';\nimport { dhPython, vsCode, vsFolder, vsFolderOpened } from '@deephaven/icons';\nimport { IconDefinition } from '@fortawesome/fontawesome-svg-core';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport classNames from 'classnames';\nimport { FileStorageItem, isDirectory } from './FileStorage';\nimport './FileList.scss';\nimport FileUtils, { MIME_TYPE } from './FileUtils';\nimport { getPathFromItem } from './FileListUtils';\n\n/**\n * Get the icon definition for a file or folder item\n * @param item Item to get the icon for\n * @returns Icon definition to pass in the FontAwesomeIcon icon prop\n */\nfunction getItemIcon(item: FileStorageItem): IconDefinition {\n if (isDirectory(item)) {\n return item.isExpanded ? vsFolderOpened : vsFolder;\n }\n const mimeType = FileUtils.getMimeType(item.basename);\n switch (mimeType) {\n case MIME_TYPE.PYTHON:\n return dhPython;\n default:\n return vsCode;\n }\n}\n\nexport type FileListRenderItemProps = RenderItemProps<FileStorageItem> & {\n children?: JSX.Element;\n dropTargetItem?: FileStorageItem;\n draggedItems?: FileStorageItem[];\n isDragInProgress: boolean;\n isDropTargetValid: boolean;\n\n onDragStart: (index: number, e: React.DragEvent<HTMLDivElement>) => void;\n onDragOver: (index: number, e: React.DragEvent<HTMLDivElement>) => void;\n onDragEnd: (index: number, e: React.DragEvent<HTMLDivElement>) => void;\n onDrop: (index: number, e: React.DragEvent<HTMLDivElement>) => void;\n};\n\nexport function FileListItem(props: FileListRenderItemProps): JSX.Element {\n const {\n children,\n draggedItems,\n isDragInProgress,\n isDropTargetValid,\n isSelected,\n item,\n itemIndex,\n dropTargetItem,\n onDragStart,\n onDragOver,\n onDragEnd,\n onDrop,\n } = props;\n\n const isDragged =\n draggedItems?.some(draggedItem => draggedItem.id === item.id) ?? false;\n const itemPath = getPathFromItem(item);\n const dropTargetPath =\n isDragInProgress && dropTargetItem ? getPathFromItem(dropTargetItem) : null;\n\n const isExactDropTarget =\n isDragInProgress &&\n isDropTargetValid &&\n isDirectory(item) &&\n dropTargetPath === itemPath;\n const isInDropTarget =\n isDragInProgress && isDropTargetValid && dropTargetPath === itemPath;\n const isInvalidDropTarget =\n isDragInProgress && !isDropTargetValid && dropTargetPath === itemPath;\n\n const icon = getItemIcon(item);\n const depth = FileUtils.getDepth(item.filename);\n const depthLines = Array(depth)\n .fill(null)\n .map((value, index) => (\n // eslint-disable-next-line react/no-array-index-key\n <span className=\"file-list-depth-line\" key={index} />\n ));\n\n return (\n <div\n className={classNames(\n 'd-flex w-100 align-items-center',\n 'file-list-item',\n {\n 'is-dragged': isDragged,\n 'is-exact-drop-target': isExactDropTarget,\n 'is-in-drop-target': isInDropTarget,\n 'is-invalid-drop-target': isInvalidDropTarget,\n 'is-selected': isSelected,\n }\n )}\n onDragStart={e => onDragStart(itemIndex, e)}\n onDragOver={e => onDragOver(itemIndex, e)}\n onDragEnd={e => onDragEnd(itemIndex, e)}\n onDrop={e => onDrop(itemIndex, e)}\n draggable\n role=\"presentation\"\n aria-label={item.basename}\n >\n {depthLines}{' '}\n <FontAwesomeIcon icon={icon} className=\"item-icon\" fixedWidth />{' '}\n <span className=\"truncation-wrapper\">\n {children ?? (\n <>\n {item.basename}\n <Tooltip>{item.basename}</Tooltip>\n </>\n )}\n </span>\n </div>\n );\n}\n\nexport default FileListItem;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,OAAO,QAAyB,uBAAuB;AAChE,SAASC,QAAQ,EAAEC,MAAM,EAAEC,QAAQ,EAAEC,cAAc,QAAQ,kBAAkB;AAE7E,SAASC,eAAe,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IAAAK,QAAA,GAEzBwB,UAAU,EAAE,GAAG,eAChBvC,IAAA,CAACP,eAAe;MAAC0C,IAAI,EAAEA,IAAK;MAACU,SAAS,EAAC,WAAW;MAACI,UAAU;IAAA,CAAE,CAAC,EAAC,GAAG,eACpEjD,IAAA;MAAM6C,SAAS,EAAC,oBAAoB;MAAA9B,QAAA,EACjCA,QAAQ,aAARA,QAAQ,cAARA,QAAQ,gBACPX,KAAA,CAAAF,SAAA;QAAAa,QAAA,GACGT,IAAI,CAACI,QAAQ,eACdV,IAAA,CAACZ,OAAO;UAAA2B,QAAA,EAAET,IAAI,CAACI;QAAQ,CAAU,CAAC;MAAA,CAClC;IAAC,CAED,CAAC;EAAA,CACJ,CAAC;AAEV;AAEA,eAAeE,YAAY"}
|
package/dist/FileStorage.d.ts
CHANGED
|
@@ -24,16 +24,16 @@ export interface File extends FileMetadata {
|
|
|
24
24
|
content: string;
|
|
25
25
|
}
|
|
26
26
|
export interface FileStorageTable extends StorageTable<FileStorageItem> {
|
|
27
|
-
setSearch(search: string)
|
|
27
|
+
setSearch: (search: string) => void;
|
|
28
28
|
/**
|
|
29
29
|
* @param path The path to expand
|
|
30
30
|
* @param expanded What expanded state to set
|
|
31
31
|
*/
|
|
32
|
-
setExpanded(path: string, expanded: boolean)
|
|
32
|
+
setExpanded: (path: string, expanded: boolean) => void;
|
|
33
33
|
/**
|
|
34
34
|
* Collapses all directories
|
|
35
35
|
*/
|
|
36
|
-
collapseAll()
|
|
36
|
+
collapseAll: () => void;
|
|
37
37
|
}
|
|
38
38
|
/**
|
|
39
39
|
* FileStorage abstraction. Has methods for managing files, and for retrieving a table to browse files.
|
|
@@ -42,46 +42,46 @@ export interface FileStorage {
|
|
|
42
42
|
/**
|
|
43
43
|
* Retrieve a table to view the file list
|
|
44
44
|
*/
|
|
45
|
-
getTable()
|
|
45
|
+
getTable: () => Promise<FileStorageTable>;
|
|
46
46
|
/**
|
|
47
47
|
* Save a file
|
|
48
48
|
* @param file The file to save
|
|
49
49
|
*/
|
|
50
|
-
saveFile(file: File)
|
|
50
|
+
saveFile: (file: File) => Promise<File>;
|
|
51
51
|
/**
|
|
52
52
|
* Load the contents of a file
|
|
53
53
|
* @param name The file to load, including the full path
|
|
54
54
|
*/
|
|
55
|
-
loadFile(name: string)
|
|
55
|
+
loadFile: (name: string) => Promise<File>;
|
|
56
56
|
/**
|
|
57
57
|
* Delete a file
|
|
58
58
|
* @param name The full name of the file to delete
|
|
59
59
|
*/
|
|
60
|
-
deleteFile(name: string)
|
|
60
|
+
deleteFile: (name: string) => Promise<void>;
|
|
61
61
|
/**
|
|
62
62
|
* Move a file to a new location
|
|
63
63
|
* @param name Source file name
|
|
64
64
|
* @param newName The new file name, including path
|
|
65
65
|
*/
|
|
66
|
-
moveFile(name: string, newName: string)
|
|
66
|
+
moveFile: (name: string, newName: string) => Promise<void>;
|
|
67
67
|
/**
|
|
68
68
|
* Copy a file to a new location
|
|
69
69
|
* @param name The name of the file to copy
|
|
70
70
|
* @param newName The new file name, including path
|
|
71
71
|
*/
|
|
72
|
-
copyFile(name: string, newName: string)
|
|
72
|
+
copyFile: (name: string, newName: string) => Promise<void>;
|
|
73
73
|
/**
|
|
74
74
|
* Get the info for the file at the specified path.
|
|
75
75
|
* If the file does not exists, rejects with a FileNotFoundError
|
|
76
76
|
* @param name The file name to check, including path
|
|
77
77
|
* @returns The FileStorageItem for the path specified, or reject with a FileNotFoundError if it does not exist.
|
|
78
78
|
*/
|
|
79
|
-
info(name: string)
|
|
79
|
+
info: (name: string) => Promise<FileStorageItem>;
|
|
80
80
|
/**
|
|
81
81
|
* Create the directory at the given path
|
|
82
82
|
* @param name The full directory path
|
|
83
83
|
*/
|
|
84
|
-
createDirectory(name: string)
|
|
84
|
+
createDirectory: (name: string) => Promise<FileStorageItem>;
|
|
85
85
|
}
|
|
86
86
|
export default FileStorage;
|
|
87
87
|
//# sourceMappingURL=FileStorage.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileStorage.d.ts","sourceRoot":"","sources":["../src/FileStorage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAE/D;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,4BAA4B;IAC5B,QAAQ,EAAE,MAAM,CAAC;IAEjB,oDAAoD;IACpD,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,WAAW,CAAC;AAE5C,MAAM,WAAW,eAAgB,SAAQ,WAAW,EAAE,YAAY;IAChE,IAAI,EAAE,QAAQ,CAAC;CAChB;AAED,MAAM,WAAW,oBAAqB,SAAQ,eAAe;IAC3D,IAAI,EAAE,WAAW,CAAC;IAClB,UAAU,EAAE,OAAO,CAAC;CACrB;AAED,wBAAgB,WAAW,CACzB,IAAI,EAAE,eAAe,GACpB,IAAI,IAAI,oBAAoB,CAE9B;AAED;;GAEG;AACH,MAAM,WAAW,IAAK,SAAQ,YAAY;IACxC,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,gBAAiB,SAAQ,YAAY,CAAC,eAAe,CAAC;IACrE,SAAS,CAAC,MAAM,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"FileStorage.d.ts","sourceRoot":"","sources":["../src/FileStorage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAE/D;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,4BAA4B;IAC5B,QAAQ,EAAE,MAAM,CAAC;IAEjB,oDAAoD;IACpD,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,WAAW,CAAC;AAE5C,MAAM,WAAW,eAAgB,SAAQ,WAAW,EAAE,YAAY;IAChE,IAAI,EAAE,QAAQ,CAAC;CAChB;AAED,MAAM,WAAW,oBAAqB,SAAQ,eAAe;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G;IACH,eAAe,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,eAAe,CAAC,CAAC;CAC7D;AAED,eAAe,WAAW,CAAC"}
|
package/dist/FileStorage.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileStorage.js","names":["isDirectory","file","type"],"sources":["../src/FileStorage.ts"],"sourcesContent":["import { StorageTable, StorageItem } from '@deephaven/storage';\n\n/**\n * Basic metadata of the file\n */\nexport interface FileMetadata {\n /** Full path of the file */\n filename: string;\n\n /** Just the file name part of the file (no path) */\n basename: string;\n}\n\nexport type FileType = 'file' | 'directory';\n\nexport interface FileStorageItem extends StorageItem, FileMetadata {\n type: FileType;\n}\n\nexport interface DirectoryStorageItem extends FileStorageItem {\n type: 'directory';\n isExpanded: boolean;\n}\n\nexport function isDirectory(\n file: FileStorageItem\n): file is DirectoryStorageItem {\n return file.type === 'directory';\n}\n\n/**\n * A file including it's contents\n */\nexport interface File extends FileMetadata {\n content: string;\n}\n\nexport interface FileStorageTable extends StorageTable<FileStorageItem> {\n setSearch(search: string)
|
|
1
|
+
{"version":3,"file":"FileStorage.js","names":["isDirectory","file","type"],"sources":["../src/FileStorage.ts"],"sourcesContent":["import { StorageTable, StorageItem } from '@deephaven/storage';\n\n/**\n * Basic metadata of the file\n */\nexport interface FileMetadata {\n /** Full path of the file */\n filename: string;\n\n /** Just the file name part of the file (no path) */\n basename: string;\n}\n\nexport type FileType = 'file' | 'directory';\n\nexport interface FileStorageItem extends StorageItem, FileMetadata {\n type: FileType;\n}\n\nexport interface DirectoryStorageItem extends FileStorageItem {\n type: 'directory';\n isExpanded: boolean;\n}\n\nexport function isDirectory(\n file: FileStorageItem\n): file is DirectoryStorageItem {\n return file.type === 'directory';\n}\n\n/**\n * A file including it's contents\n */\nexport interface File extends FileMetadata {\n content: string;\n}\n\nexport interface FileStorageTable extends StorageTable<FileStorageItem> {\n setSearch: (search: string) => void;\n\n /**\n * @param path The path to expand\n * @param expanded What expanded state to set\n */\n setExpanded: (path: string, expanded: boolean) => void;\n\n /**\n * Collapses all directories\n */\n collapseAll: () => void;\n}\n\n/**\n * FileStorage abstraction. Has methods for managing files, and for retrieving a table to browse files.\n */\nexport interface FileStorage {\n /**\n * Retrieve a table to view the file list\n */\n getTable: () => Promise<FileStorageTable>;\n\n /**\n * Save a file\n * @param file The file to save\n */\n saveFile: (file: File) => Promise<File>;\n\n /**\n * Load the contents of a file\n * @param name The file to load, including the full path\n */\n loadFile: (name: string) => Promise<File>;\n\n /**\n * Delete a file\n * @param name The full name of the file to delete\n */\n deleteFile: (name: string) => Promise<void>;\n\n /**\n * Move a file to a new location\n * @param name Source file name\n * @param newName The new file name, including path\n */\n moveFile: (name: string, newName: string) => Promise<void>;\n\n /**\n * Copy a file to a new location\n * @param name The name of the file to copy\n * @param newName The new file name, including path\n */\n copyFile: (name: string, newName: string) => Promise<void>;\n\n /**\n * Get the info for the file at the specified path.\n * If the file does not exists, rejects with a FileNotFoundError\n * @param name The file name to check, including path\n * @returns The FileStorageItem for the path specified, or reject with a FileNotFoundError if it does not exist.\n */\n info: (name: string) => Promise<FileStorageItem>;\n\n /**\n * Create the directory at the given path\n * @param name The full directory path\n */\n createDirectory: (name: string) => Promise<FileStorageItem>;\n}\n\nexport default FileStorage;\n"],"mappings":"AAEA;AACA;AACA;;AAoBA,OAAO,SAASA,WAAWA,CACzBC,IAAqB,EACS;EAC9B,OAAOA,IAAI,CAACC,IAAI,KAAK,WAAW;AAClC;;AAEA;AACA;AACA;;AAoBA;AACA;AACA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deephaven/file-explorer",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.52.0",
|
|
4
4
|
"description": "Deephaven File Explorer React component",
|
|
5
5
|
"author": "Deephaven Data Labs LLC",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -22,11 +22,11 @@
|
|
|
22
22
|
"build:sass": "sass --embed-sources --load-path=../../node_modules ./src:./dist"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@deephaven/components": "^0.
|
|
26
|
-
"@deephaven/icons": "^0.
|
|
27
|
-
"@deephaven/log": "^0.
|
|
28
|
-
"@deephaven/storage": "^0.
|
|
29
|
-
"@deephaven/utils": "^0.
|
|
25
|
+
"@deephaven/components": "^0.52.0",
|
|
26
|
+
"@deephaven/icons": "^0.52.0",
|
|
27
|
+
"@deephaven/log": "^0.52.0",
|
|
28
|
+
"@deephaven/storage": "^0.52.0",
|
|
29
|
+
"@deephaven/utils": "^0.52.0",
|
|
30
30
|
"@fortawesome/fontawesome-svg-core": "^6.2.1",
|
|
31
31
|
"@fortawesome/react-fontawesome": "^0.2.0",
|
|
32
32
|
"classnames": "^2.3.1",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"react": "^17.0.0"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@deephaven/mocks": "^0.
|
|
40
|
+
"@deephaven/mocks": "^0.52.0"
|
|
41
41
|
},
|
|
42
42
|
"files": [
|
|
43
43
|
"dist"
|
|
@@ -48,5 +48,5 @@
|
|
|
48
48
|
"publishConfig": {
|
|
49
49
|
"access": "public"
|
|
50
50
|
},
|
|
51
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "ba5b9627f3cbfc52207b1d14d9693bd30727ef42"
|
|
52
52
|
}
|