@deephaven/file-explorer 0.32.0 → 0.32.1-auth-plugins.7

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.
@@ -4,7 +4,7 @@ import { BasicModal } from '@deephaven/components';
4
4
  import Log from '@deephaven/log';
5
5
  import { PromiseUtils } from '@deephaven/utils';
6
6
  import React, { useCallback, useEffect, useMemo, useState } from 'react';
7
- import { DEFAULT_ROW_HEIGHT } from "./FileList.js";
7
+ import { DEFAULT_ROW_HEIGHT } from "./FileListUtils.js";
8
8
  import { isDirectory } from "./FileStorage.js";
9
9
  import "./FileExplorer.css";
10
10
  import FileListContainer from "./FileListContainer.js";
@@ -1 +1 @@
1
- {"version":3,"file":"FileExplorer.js","names":["BasicModal","Log","PromiseUtils","React","useCallback","useEffect","useMemo","useState","DEFAULT_ROW_HEIGHT","isDirectory","FileListContainer","FileUtils","FileExistsError","FileNotFoundError","log","module","FileExplorer","props","storage","isMultiSelect","focusedPath","onDelete","undefined","onRename","onSelect","onSelectionChange","rowHeight","itemsToDelete","setItemsToDelete","table","setTable","initializeTable","tablePromise","initTable","debug","makeCancelable","getTable","t","close","e","isCanceled","error","cancel","handleError","handleDelete","files","handleDeleteConfirm","forEach","file","deleteFile","makePath","filename","handleDeleteCancel","handleMove","path","filesToMove","reducePaths","map","newFile","isPath","getBaseName","substring","length","moveFile","then","catch","handleRename","item","newName","name","isDir","endsWith","destination","getParent","debug2","handleValidateRename","renameItem","basename","validateName","newValue","getPath","fileInfo","info","isDeleteConfirmationShown","deleteConfirmationMessage","displayName"],"sources":["../src/FileExplorer.tsx"],"sourcesContent":["import { BasicModal } from '@deephaven/components';\nimport Log from '@deephaven/log';\nimport { CancelablePromise, PromiseUtils } from '@deephaven/utils';\nimport React, { useCallback, useEffect, useMemo, useState } from 'react';\nimport { DEFAULT_ROW_HEIGHT } from './FileList';\nimport FileStorage, {\n FileStorageItem,\n FileStorageTable,\n isDirectory,\n} from './FileStorage';\nimport './FileExplorer.scss';\nimport FileListContainer from './FileListContainer';\nimport FileUtils from './FileUtils';\nimport FileExistsError from './FileExistsError';\nimport FileNotFoundError from './FileNotFoundError';\n\nconst log = Log.module('FileExplorer');\n\nexport interface FileExplorerProps {\n storage: FileStorage;\n\n isMultiSelect?: boolean;\n focusedPath?: string;\n\n onDelete?: (files: FileStorageItem[]) => void;\n onRename?: (oldName: string, newName: string) => void;\n onSelect: (file: FileStorageItem, event: React.SyntheticEvent) => void;\n onSelectionChange?: (selectedItems: FileStorageItem[]) => void;\n\n /** Height of each item in the list */\n rowHeight?: number;\n}\n\n/**\n * Component that displays and allows interaction with the file system in the provided FileStorage.\n */\nexport function FileExplorer(props: FileExplorerProps): JSX.Element {\n const {\n storage,\n isMultiSelect = false,\n focusedPath,\n onDelete = () => undefined,\n onRename = () => undefined,\n onSelect,\n onSelectionChange,\n rowHeight = DEFAULT_ROW_HEIGHT,\n } = props;\n const [itemsToDelete, setItemsToDelete] = useState<FileStorageItem[]>([]);\n const [table, setTable] = useState<FileStorageTable>();\n\n useEffect(\n function initializeTable() {\n let tablePromise: CancelablePromise<FileStorageTable>;\n async function initTable() {\n log.debug('initTable');\n\n tablePromise = PromiseUtils.makeCancelable(storage.getTable(), t =>\n t.close()\n );\n\n try {\n setTable(await tablePromise);\n } catch (e) {\n if (!PromiseUtils.isCanceled(e)) {\n log.error('Unable to initialize table', e);\n }\n }\n }\n initTable();\n return () => {\n tablePromise.cancel();\n };\n },\n [storage]\n );\n\n const handleError = useCallback((e: Error) => {\n if (!PromiseUtils.isCanceled(e)) {\n log.error(e);\n }\n }, []);\n\n const handleDelete = useCallback((files: FileStorageItem[]) => {\n log.debug('handleDelete, pending confirmation', files);\n setItemsToDelete(files);\n }, []);\n\n const handleDeleteConfirm = useCallback(() => {\n log.debug('handleDeleteConfirm', itemsToDelete);\n itemsToDelete.forEach(file =>\n storage.deleteFile(\n isDirectory(file) ? FileUtils.makePath(file.filename) : file.filename\n )\n );\n onDelete(itemsToDelete);\n setItemsToDelete([]);\n }, [itemsToDelete, onDelete, storage]);\n\n const handleDeleteCancel = useCallback(() => {\n log.debug('handleDeleteCancel');\n setItemsToDelete([]);\n }, []);\n\n const handleMove = useCallback(\n (files: FileStorageItem[], path: string) => {\n const filesToMove = FileUtils.reducePaths(\n files.map(file =>\n isDirectory(file) ? FileUtils.makePath(file.filename) : file.filename\n )\n );\n\n filesToMove.forEach(file => {\n const newFile = FileUtils.isPath(file)\n ? `${path}${FileUtils.getBaseName(\n file.substring(0, file.length - 1)\n )}/`\n : `${path}${FileUtils.getBaseName(file)}`;\n storage\n .moveFile(file, newFile)\n .then(() => {\n // Each moved file triggers a rename so parent knows something has happened\n // We signal each individually if for some reason there's an error moving one of the files\n onRename(file, newFile);\n })\n .catch(handleError);\n });\n },\n [handleError, onRename, storage]\n );\n\n const handleRename = useCallback(\n (item: FileStorageItem, newName: string) => {\n let name = item.filename;\n const isDir = isDirectory(item);\n if (isDir && !name.endsWith('/')) {\n name = `${name}/`;\n }\n let destination = `${FileUtils.getParent(name)}${newName}`;\n if (isDir && !destination.endsWith('/')) {\n destination = `${destination}/`;\n }\n log.debug2('handleRename', name, destination);\n storage.moveFile(name, destination).catch(handleError);\n onRename(name, destination);\n },\n [handleError, onRename, storage]\n );\n\n const handleValidateRename = useCallback(\n async (renameItem: FileStorageItem, newName: string): Promise<void> => {\n if (newName === renameItem.basename) {\n // Same name is fine\n return undefined;\n }\n FileUtils.validateName(newName);\n\n const newValue = `${FileUtils.getPath(renameItem.filename)}${newName}`;\n try {\n const fileInfo = await storage.info(newValue);\n throw new FileExistsError(fileInfo);\n } catch (e) {\n if (!(e instanceof FileNotFoundError)) {\n throw e;\n }\n // The file does not exist, fine to save at that path\n }\n },\n [storage]\n );\n\n const isDeleteConfirmationShown = itemsToDelete.length > 0;\n const deleteConfirmationMessage = useMemo(() => {\n if (itemsToDelete.length === 1) {\n return `Are you sure you want to delete \"${itemsToDelete[0].filename}\"?`;\n }\n return `Are you sure you want to delete the selected files?`;\n }, [itemsToDelete]);\n\n return (\n <div className=\"file-explorer\">\n {table && (\n <FileListContainer\n isMultiSelect={isMultiSelect}\n focusedPath={focusedPath}\n showContextMenu\n onMove={handleMove}\n onDelete={handleDelete}\n onRename={handleRename}\n onSelect={onSelect}\n onSelectionChange={onSelectionChange}\n rowHeight={rowHeight}\n table={table}\n validateRename={handleValidateRename}\n />\n )}\n <BasicModal\n isOpen={isDeleteConfirmationShown}\n headerText={deleteConfirmationMessage}\n bodyText=\"You cannot undo this action.\"\n onCancel={handleDeleteCancel}\n onConfirm={handleDeleteConfirm}\n confirmButtonText=\"Delete\"\n />\n </div>\n );\n}\n\nFileExplorer.displayName = 'FileExplorer';\n\nexport default FileExplorer;\n"],"mappings":";;AAAA,SAASA,UAAU,QAAQ,uBAAuB;AAClD,OAAOC,GAAG,MAAM,gBAAgB;AAChC,SAA4BC,YAAY,QAAQ,kBAAkB;AAClE,OAAOC,KAAK,IAAIC,WAAW,EAAEC,SAAS,EAAEC,OAAO,EAAEC,QAAQ,QAAQ,OAAO;AAAC,SAChEC,kBAAkB;AAAA,SAIzBC,WAAW;AAAA;AAAA,OAGNC,iBAAiB;AAAA,OACjBC,SAAS;AAAA,OACTC,eAAe;AAAA,OACfC,iBAAiB;AAExB,IAAMC,GAAG,GAAGb,GAAG,CAACc,MAAM,CAAC,cAAc,CAAC;AAiBtC;AACA;AACA;AACA,OAAO,SAASC,YAAY,CAACC,KAAwB,EAAe;EAClE,IAAM;IACJC,OAAO;IACPC,aAAa,GAAG,KAAK;IACrBC,WAAW;IACXC,QAAQ,GAAG,MAAMC,SAAS;IAC1BC,QAAQ,GAAG,MAAMD,SAAS;IAC1BE,QAAQ;IACRC,iBAAiB;IACjBC,SAAS,GAAGlB;EACd,CAAC,GAAGS,KAAK;EACT,IAAM,CAACU,aAAa,EAAEC,gBAAgB,CAAC,GAAGrB,QAAQ,CAAoB,EAAE,CAAC;EACzE,IAAM,CAACsB,KAAK,EAAEC,QAAQ,CA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useMemo","useState","DEFAULT_ROW_HEIGHT","isDirectory","FileListContainer","FileUtils","FileExistsError","FileNotFoundError","log","module","FileExplorer","props","storage","isMultiSelect","focusedPath","onDelete","undefined","onRename","onSelect","onSelectionChange","rowHeight","itemsToDelete","setItemsToDelete","table","setTable","initializeTable","tablePromise","initTable","debug","makeCancelable","getTable","t","close","e","isCanceled","error","cancel","handleError","handleDelete","files","handleDeleteConfirm","forEach","file","deleteFile","makePath","filename","handleDeleteCancel","handleMove","path","filesToMove","reducePaths","map","newFile","isPath","getBaseName","substring","length","moveFile","then","catch","handleRename","item","newName","name","isDir","endsWith","destination","getParent","debug2","handleValidateRename","renameItem","basename","validateName","newValue","getPath","fileInfo","info","isDeleteConfirmationShown","deleteConfirmationMessage","displayName"],"sources":["../src/FileExplorer.tsx"],"sourcesContent":["import { BasicModal } from '@deephaven/components';\nimport Log from '@deephaven/log';\nimport { CancelablePromise, PromiseUtils } from '@deephaven/utils';\nimport React, { useCallback, useEffect, useMemo, useState } from 'react';\nimport { DEFAULT_ROW_HEIGHT } from './FileListUtils';\nimport FileStorage, {\n FileStorageItem,\n FileStorageTable,\n isDirectory,\n} from './FileStorage';\nimport './FileExplorer.scss';\nimport FileListContainer from './FileListContainer';\nimport FileUtils from './FileUtils';\nimport FileExistsError from './FileExistsError';\nimport FileNotFoundError from './FileNotFoundError';\n\nconst log = Log.module('FileExplorer');\n\nexport interface FileExplorerProps {\n storage: FileStorage;\n\n isMultiSelect?: boolean;\n focusedPath?: string;\n\n onDelete?: (files: FileStorageItem[]) => void;\n onRename?: (oldName: string, newName: string) => void;\n onSelect: (file: FileStorageItem, event: React.SyntheticEvent) => void;\n onSelectionChange?: (selectedItems: FileStorageItem[]) => void;\n\n /** Height of each item in the list */\n rowHeight?: number;\n}\n\n/**\n * Component that displays and allows interaction with the file system in the provided FileStorage.\n */\nexport function FileExplorer(props: FileExplorerProps): JSX.Element {\n const {\n storage,\n isMultiSelect = false,\n focusedPath,\n onDelete = () => undefined,\n onRename = () => undefined,\n onSelect,\n onSelectionChange,\n rowHeight = DEFAULT_ROW_HEIGHT,\n } = props;\n const [itemsToDelete, setItemsToDelete] = useState<FileStorageItem[]>([]);\n const [table, setTable] = useState<FileStorageTable>();\n\n useEffect(\n function initializeTable() {\n let tablePromise: CancelablePromise<FileStorageTable>;\n async function initTable() {\n log.debug('initTable');\n\n tablePromise = PromiseUtils.makeCancelable(storage.getTable(), t =>\n t.close()\n );\n\n try {\n setTable(await tablePromise);\n } catch (e) {\n if (!PromiseUtils.isCanceled(e)) {\n log.error('Unable to initialize table', e);\n }\n }\n }\n initTable();\n return () => {\n tablePromise.cancel();\n };\n },\n [storage]\n );\n\n const handleError = useCallback((e: Error) => {\n if (!PromiseUtils.isCanceled(e)) {\n log.error(e);\n }\n }, []);\n\n const handleDelete = useCallback((files: FileStorageItem[]) => {\n log.debug('handleDelete, pending confirmation', files);\n setItemsToDelete(files);\n }, []);\n\n const handleDeleteConfirm = useCallback(() => {\n log.debug('handleDeleteConfirm', itemsToDelete);\n itemsToDelete.forEach(file =>\n storage.deleteFile(\n isDirectory(file) ? FileUtils.makePath(file.filename) : file.filename\n )\n );\n onDelete(itemsToDelete);\n setItemsToDelete([]);\n }, [itemsToDelete, onDelete, storage]);\n\n const handleDeleteCancel = useCallback(() => {\n log.debug('handleDeleteCancel');\n setItemsToDelete([]);\n }, []);\n\n const handleMove = useCallback(\n (files: FileStorageItem[], path: string) => {\n const filesToMove = FileUtils.reducePaths(\n files.map(file =>\n isDirectory(file) ? FileUtils.makePath(file.filename) : file.filename\n )\n );\n\n filesToMove.forEach(file => {\n const newFile = FileUtils.isPath(file)\n ? `${path}${FileUtils.getBaseName(\n file.substring(0, file.length - 1)\n )}/`\n : `${path}${FileUtils.getBaseName(file)}`;\n storage\n .moveFile(file, newFile)\n .then(() => {\n // Each moved file triggers a rename so parent knows something has happened\n // We signal each individually if for some reason there's an error moving one of the files\n onRename(file, newFile);\n })\n .catch(handleError);\n });\n },\n [handleError, onRename, storage]\n );\n\n const handleRename = useCallback(\n (item: FileStorageItem, newName: string) => {\n let name = item.filename;\n const isDir = isDirectory(item);\n if (isDir && !name.endsWith('/')) {\n name = `${name}/`;\n }\n let destination = `${FileUtils.getParent(name)}${newName}`;\n if (isDir && !destination.endsWith('/')) {\n destination = `${destination}/`;\n }\n log.debug2('handleRename', name, destination);\n storage.moveFile(name, destination).catch(handleError);\n onRename(name, destination);\n },\n [handleError, onRename, storage]\n );\n\n const handleValidateRename = useCallback(\n async (renameItem: FileStorageItem, newName: string): Promise<void> => {\n if (newName === renameItem.basename) {\n // Same name is fine\n return undefined;\n }\n FileUtils.validateName(newName);\n\n const newValue = `${FileUtils.getPath(renameItem.filename)}${newName}`;\n try {\n const fileInfo = await storage.info(newValue);\n throw new FileExistsError(fileInfo);\n } catch (e) {\n if (!(e instanceof FileNotFoundError)) {\n throw e;\n }\n // The file does not exist, fine to save at that path\n }\n },\n [storage]\n );\n\n const isDeleteConfirmationShown = itemsToDelete.length > 0;\n const deleteConfirmationMessage = useMemo(() => {\n if (itemsToDelete.length === 1) {\n return `Are you sure you want to delete \"${itemsToDelete[0].filename}\"?`;\n }\n return `Are you sure you want to delete the selected files?`;\n }, [itemsToDelete]);\n\n return (\n <div className=\"file-explorer\">\n {table && (\n <FileListContainer\n isMultiSelect={isMultiSelect}\n focusedPath={focusedPath}\n showContextMenu\n onMove={handleMove}\n onDelete={handleDelete}\n onRename={handleRename}\n onSelect={onSelect}\n onSelectionChange={onSelectionChange}\n rowHeight={rowHeight}\n table={table}\n validateRename={handleValidateRename}\n />\n )}\n <BasicModal\n isOpen={isDeleteConfirmationShown}\n headerText={deleteConfirmationMessage}\n bodyText=\"You cannot undo this action.\"\n onCancel={handleDeleteCancel}\n onConfirm={handleDeleteConfirm}\n confirmButtonText=\"Delete\"\n />\n </div>\n );\n}\n\nFileExplorer.displayName = 'FileExplorer';\n\nexport default FileExplorer;\n"],"mappings":";;AAAA,SAASA,UAAU,QAAQ,uBAAuB;AAClD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AC,EAAE,CAACxB,aAAa,CAAC,CAAC;EAEnB,oBACE;IAAK,SAAS,EAAC;EAAe,GAC3BE,KAAK,iBACJ,oBAAC,iBAAiB;IAChB,aAAa,EAAEV,aAAc;IAC7B,WAAW,EAAEC,WAAY;IACzB,eAAe;IACf,MAAM,EAAEiC,UAAW;IACnB,QAAQ,EAAET,YAAa;IACvB,QAAQ,EAAEsB,YAAa;IACvB,QAAQ,EAAE1C,QAAS;IACnB,iBAAiB,EAAEC,iBAAkB;IACrC,SAAS,EAAEC,SAAU;IACrB,KAAK,EAAEG,KAAM;IACb,cAAc,EAAE8C;EAAqB,EAExC,eACD,oBAAC,UAAU;IACT,MAAM,EAAEQ,yBAA0B;IAClC,UAAU,EAAEC,yBAA0B;IACtC,QAAQ,EAAC,8BAA8B;IACvC,QAAQ,EAAEhC,kBAAmB;IAC7B,SAAS,EAAEN,mBAAoB;IAC/B,iBAAiB,EAAC;EAAQ,EAC1B,CACE;AAEV;AAEA9B,YAAY,CAACqE,WAAW,GAAG,cAAc;AAEzC,eAAerE,YAAY"}
@@ -1,8 +1,7 @@
1
- import { RenderItemProps } from '@deephaven/components';
2
- import { IconDefinition } from '@fortawesome/fontawesome-svg-core';
3
1
  import React from 'react';
4
2
  import { FileStorageItem, FileStorageTable } from './FileStorage';
5
3
  import './FileList.scss';
4
+ import { FileListRenderItemProps } from './FileListItem';
6
5
  export type LoadedViewport = {
7
6
  items: FileStorageItem[];
8
7
  offset: number;
@@ -12,17 +11,6 @@ export type ListViewport = {
12
11
  top: number;
13
12
  bottom: number;
14
13
  };
15
- export type FileListRenderItemProps = RenderItemProps<FileStorageItem> & {
16
- children?: JSX.Element;
17
- dropTargetItem?: FileStorageItem;
18
- draggedItems?: FileStorageItem[];
19
- isDragInProgress: boolean;
20
- isDropTargetValid: boolean;
21
- onDragStart(index: number, e: React.DragEvent<HTMLDivElement>): void;
22
- onDragOver(index: number, e: React.DragEvent<HTMLDivElement>): void;
23
- onDragEnd(index: number, e: React.DragEvent<HTMLDivElement>): void;
24
- onDrop(index: number, e: React.DragEvent<HTMLDivElement>): void;
25
- };
26
14
  export interface FileListProps {
27
15
  table: FileStorageTable;
28
16
  isMultiSelect?: boolean;
@@ -36,23 +24,6 @@ export interface FileListProps {
36
24
  rowHeight?: number;
37
25
  overscanCount?: number;
38
26
  }
39
- export declare const getPathFromItem: (file: FileStorageItem) => string;
40
- export declare const DEFAULT_ROW_HEIGHT = 26;
41
- export declare const DRAG_HOVER_TIMEOUT = 500;
42
- export declare const renderFileListItem: (props: FileListRenderItemProps) => JSX.Element;
43
- /**
44
- * Get the icon definition for a file or folder item
45
- * @param item Item to get the icon for
46
- * @returns Icon definition to pass in the FontAwesomeIcon icon prop
47
- */
48
- export declare function getItemIcon(item: FileStorageItem): IconDefinition;
49
- /**
50
- * Get the move operation for the current selection and the given target. Throws if the operation is invalid.
51
- */
52
- export declare function getMoveOperation(draggedItems: FileStorageItem[], targetItem: FileStorageItem): {
53
- files: FileStorageItem[];
54
- targetPath: string;
55
- };
56
27
  /**
57
28
  * Component that displays and allows interaction with the file system in the provided FileStorageTable.
58
29
  */
@@ -1 +1 @@
1
- {"version":3,"file":"FileList.d.ts","sourceRoot":"","sources":["../src/FileList.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,eAAe,EAEhB,MAAM,uBAAuB,CAAC;AAK/B,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AAEnE,OAAO,KAMN,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAe,MAAM,eAAe,CAAC;AAC/E,OAAO,iBAAiB,CAAC;AAKzB,MAAM,MAAM,cAAc,GAAG;IAC3B,KAAK,EAAE,eAAe,EAAE,CAAC;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CA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EAAE,gBAAgB,CAAC;IAExB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,aAAa,CAAC,EAAE,CAAC,WAAW,CAAC,EAAE,eAAe,KAAK,IAAI,CAAC;IACxD,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,eAAe,EAAE,EAAE,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1D,QAAQ,EAAE,CAAC,IAAI,EAAE,eAAe,EAAE,KAAK,EAAE,KAAK,CAAC,cAAc,KAAK,IAAI,CAAC;IACvE,iBAAiB,CAAC,EAAE,CAAC,aAAa,EAAE,eAAe,EAAE,KAAK,IAAI,CAAC;IAE/D,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,uBAAuB,KAAK,GAAG,CAAC,OAAO,CAAC;IAE7D,sCAAsC;IACtC,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAOD;;GAEG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,aAAa,GAAG,GAAG,CAAC,OAAO,CAsY1D;AAED,eAAe,QAAQ,CAAC"}
package/dist/FileList.js CHANGED
@@ -3,158 +3,19 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
3
3
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
4
4
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
5
5
  function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
6
- import { ItemList, Tooltip } from '@deephaven/components';
7
- import { dhPython, vsCode, vsFolder, vsFolderOpened } from '@deephaven/icons';
6
+ import { ItemList } from '@deephaven/components';
8
7
  import Log from '@deephaven/log';
9
8
  import { RangeUtils } from '@deephaven/utils';
10
- import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
11
9
  import classNames from 'classnames';
12
10
  import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
13
11
  import { isDirectory } from "./FileStorage.js";
14
12
  import "./FileList.css";
15
- import FileUtils, { MIME_TYPE } from "./FileUtils.js";
13
+ import { DEFAULT_ROW_HEIGHT, getMoveOperation } from "./FileListUtils.js";
14
+ import { FileListItem } from "./FileListItem.js";
16
15
  var log = Log.module('FileList');
17
- export var getPathFromItem = file => isDirectory(file) ? FileUtils.makePath(file.filename) : FileUtils.getPath(file.filename);
18
- export var DEFAULT_ROW_HEIGHT = 26;
19
-
20
16
  // How long you need to hover over a directory before it expands
21
- export var DRAG_HOVER_TIMEOUT = 500;
17
+ var DRAG_HOVER_TIMEOUT = 500;
22
18
  var ITEM_LIST_CLASS_NAME = 'item-list-scroll-pane';
23
- export var renderFileListItem = props => {
24
- var _draggedItems$some;
25
- var {
26
- children,
27
- draggedItems,
28
- isDragInProgress,
29
- isDropTargetValid,
30
- isSelected,
31
- item,
32
- itemIndex,
33
- dropTargetItem,
34
- onDragStart,
35
- onDragOver,
36
- onDragEnd,
37
- onDrop
38
- } = props;
39
- 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;
40
- var itemPath = getPathFromItem(item);
41
- var dropTargetPath = isDragInProgress && dropTargetItem ? getPathFromItem(dropTargetItem) : null;
42
- var isExactDropTarget = isDragInProgress && isDropTargetValid && isDirectory(item) && dropTargetPath === itemPath;
43
- var isInDropTarget = isDragInProgress && isDropTargetValid && dropTargetPath === itemPath;
44
- var isInvalidDropTarget = isDragInProgress && !isDropTargetValid && dropTargetPath === itemPath;
45
- var icon = getItemIcon(item);
46
- var depth = FileUtils.getDepth(item.filename);
47
- var depthLines = Array(depth).fill(null).map((value, index) =>
48
- /*#__PURE__*/
49
- // eslint-disable-next-line react/no-array-index-key
50
- React.createElement("span", {
51
- className: "file-list-depth-line",
52
- key: index
53
- }));
54
- return /*#__PURE__*/React.createElement("div", {
55
- className: classNames('d-flex w-100 align-items-center', 'file-list-item', {
56
- 'is-dragged': isDragged,
57
- 'is-exact-drop-target': isExactDropTarget,
58
- 'is-in-drop-target': isInDropTarget,
59
- 'is-invalid-drop-target': isInvalidDropTarget,
60
- 'is-selected': isSelected
61
- }),
62
- onDragStart: function (_onDragStart) {
63
- function onDragStart(_x) {
64
- return _onDragStart.apply(this, arguments);
65
- }
66
- onDragStart.toString = function () {
67
- return _onDragStart.toString();
68
- };
69
- return onDragStart;
70
- }(e => onDragStart(itemIndex, e)),
71
- onDragOver: function (_onDragOver) {
72
- function onDragOver(_x2) {
73
- return _onDragOver.apply(this, arguments);
74
- }
75
- onDragOver.toString = function () {
76
- return _onDragOver.toString();
77
- };
78
- return onDragOver;
79
- }(e => onDragOver(itemIndex, e)),
80
- onDragEnd: function (_onDragEnd) {
81
- function onDragEnd(_x3) {
82
- return _onDragEnd.apply(this, arguments);
83
- }
84
- onDragEnd.toString = function () {
85
- return _onDragEnd.toString();
86
- };
87
- return onDragEnd;
88
- }(e => onDragEnd(itemIndex, e)),
89
- onDrop: function (_onDrop) {
90
- function onDrop(_x4) {
91
- return _onDrop.apply(this, arguments);
92
- }
93
- onDrop.toString = function () {
94
- return _onDrop.toString();
95
- };
96
- return onDrop;
97
- }(e => onDrop(itemIndex, e)),
98
- draggable: true,
99
- role: "presentation",
100
- "aria-label": item.basename
101
- }, depthLines, ' ', /*#__PURE__*/React.createElement(FontAwesomeIcon, {
102
- icon: icon,
103
- className: "item-icon",
104
- fixedWidth: true
105
- }), ' ', /*#__PURE__*/React.createElement("span", {
106
- className: "truncation-wrapper"
107
- }, children !== null && children !== void 0 ? children : item.basename, /*#__PURE__*/React.createElement(Tooltip, {
108
- options: {
109
- placement: 'left'
110
- }
111
- }, children !== null && children !== void 0 ? children : item.basename)));
112
- };
113
-
114
- /**
115
- * Get the icon definition for a file or folder item
116
- * @param item Item to get the icon for
117
- * @returns Icon definition to pass in the FontAwesomeIcon icon prop
118
- */
119
- export function getItemIcon(item) {
120
- if (isDirectory(item)) {
121
- return item.isExpanded ? vsFolderOpened : vsFolder;
122
- }
123
- var mimeType = FileUtils.getMimeType(item.basename);
124
- switch (mimeType) {
125
- case MIME_TYPE.PYTHON:
126
- return dhPython;
127
- default:
128
- return vsCode;
129
- }
130
- }
131
-
132
- /**
133
- * Get the move operation for the current selection and the given target. Throws if the operation is invalid.
134
- */
135
- export function getMoveOperation(draggedItems, targetItem) {
136
- if (draggedItems.length === 0 || targetItem == null) {
137
- throw new Error('No items to move');
138
- }
139
- var targetPath = getPathFromItem(targetItem);
140
- if (draggedItems.some(_ref => {
141
- var {
142
- filename
143
- } = _ref;
144
- return FileUtils.getPath(filename) === targetPath;
145
- })) {
146
- // Cannot drop if target is one of the dragged items is already in the target folder
147
- throw new Error('File already in the destination folder');
148
- }
149
- if (draggedItems.some(item => isDirectory(item) && targetPath.startsWith(FileUtils.makePath(item.filename)))) {
150
- // Cannot drop if target is a child of one of the directories being moved
151
- throw new Error('Destination folder cannot be a child of a dragged folder');
152
- }
153
- return {
154
- files: draggedItems,
155
- targetPath
156
- };
157
- }
158
19
 
159
20
  /**
160
21
  * Component that displays and allows interaction with the file system in the provided FileStorageTable.
@@ -167,7 +28,7 @@ export function FileList(props) {
167
28
  onMove,
168
29
  onSelect,
169
30
  onSelectionChange = () => undefined,
170
- renderItem = renderFileListItem,
31
+ renderItem = FileListItem,
171
32
  rowHeight = DEFAULT_ROW_HEIGHT,
172
33
  overscanCount = ItemList.DEFAULT_OVERSCAN
173
34
  } = props;
@@ -217,8 +78,8 @@ export function FileList(props) {
217
78
  return null;
218
79
  }
219
80
  if (count === 1) {
220
- var _index = selectedRanges[0][0];
221
- var item = getItem(_index);
81
+ var index = selectedRanges[0][0];
82
+ var item = getItem(index);
222
83
  if (item != null) {
223
84
  return item.filename;
224
85
  }
@@ -1 +1 @@
1
- {"version":3,"file":"FileList.js","names":["ItemList","Tooltip","dhPython","vsCode","vsFolder","vsFolderOpened","Log","RangeUtils","FontAwesomeIcon","classNames","React","useCallback","useEffect","useMemo","useRef","useState","isDirectory","FileUtils","MIME_TYPE","log","module","getPathFromItem","file","makePath","filename","getPath","DEFAULT_ROW_HEIGHT","DRAG_HOVER_TIMEOUT","ITEM_LIST_CLASS_NAME","renderFileListItem","props","children","draggedItems","isDragInProgress","isDropTargetValid","isSelected","item","itemIndex","dropTargetItem","onDragStart","onDragOver","onDragEnd","onDrop","isDragged","some","draggedItem","id","itemPath","dropTargetPath","isExactDropTarget","isInDropTarget","isInvalidDropTarget","icon","getItemIcon","depth","getDepth","depthLines","Array","fill","map","value","index","e","basename","placement","isExpanded","mimeType","getMimeType","PYTHON","getMoveOperation","targetItem","length","Error","targetPath","startsWith","files","FileList","isMultiSelect","table","onFocusChange","undefined","onMove","onSelect","onSelectionChange","renderItem","rowHeight","overscanCount","DEFAULT_OVERSCAN","loadedViewport","setLoadedViewport","items","offset","itemCount","viewport","setViewport","top","bottom","setDropTargetItem","setDraggedItems","dragPlaceholder","setDragPlaceholder","selectedRanges","setSelectedRanges","itemList","fileList","getItems","ranges","i","range","j","push","getItem","getDragPlaceholderText","count","dropItems","debug","current","focusItem","err","error","handleSelect","event","setExpanded","handleItemDragStart","debug2","draggedRanges","resetMouseState","newDragPlaceholder","document","createElement","innerHTML","className","body","appendChild","dataTransfer","setDragImage","effectAllowed","handleItemDragOver","preventDefault","handleItemDragEnd","remove","handleItemDrop","handleItemDragExit","handleListDragOver","target","Element","classList","contains","type","handleListDrop","handleSelectionChange","newSelectedRanges","selectedItems","handleFocusChange","focusIndex","focusedItem","handleViewportChange","focusedPath","collapseAll","updateTableViewport","Math","max","setLoadedViewportAndReturnCleanup","listenerRemover","onUpdate","newViewport","itemName","size","expandFolderOnHover","timeout","setTimeout","clearTimeout","renderWrapper","itemProps","onDragExit"],"sources":["../src/FileList.tsx"],"sourcesContent":["import {\n ItemList,\n Range,\n RenderItemProps,\n Tooltip,\n} from '@deephaven/components';\nimport { dhPython, vsCode, vsFolder, vsFolderOpened } from '@deephaven/icons';\nimport Log from '@deephaven/log';\nimport { RangeUtils } from '@deephaven/utils';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { IconDefinition } from '@fortawesome/fontawesome-svg-core';\nimport classNames from 'classnames';\nimport React, {\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport { FileStorageItem, FileStorageTable, isDirectory } from './FileStorage';\nimport './FileList.scss';\nimport FileUtils, { MIME_TYPE } from './FileUtils';\n\nconst log = Log.module('FileList');\n\nexport type LoadedViewport = {\n items: FileStorageItem[];\n offset: number;\n itemCount: number;\n};\n\nexport type ListViewport = {\n top: number;\n bottom: number;\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 interface FileListProps {\n table: FileStorageTable;\n\n isMultiSelect?: boolean;\n focusedPath?: string;\n\n onFocusChange?: (focusedItem?: FileStorageItem) => void;\n onMove?: (files: FileStorageItem[], path: string) => void;\n onSelect: (file: FileStorageItem, event: React.SyntheticEvent) => void;\n onSelectionChange?: (selectedItems: FileStorageItem[]) => void;\n\n renderItem?: (props: FileListRenderItemProps) => JSX.Element;\n\n /** Height of each item in the list */\n rowHeight?: number;\n\n overscanCount?: number;\n}\n\nexport const getPathFromItem = (file: FileStorageItem): string =>\n isDirectory(file)\n ? FileUtils.makePath(file.filename)\n : FileUtils.getPath(file.filename);\n\nexport const DEFAULT_ROW_HEIGHT = 26;\n\n// How long you need to hover over a directory before it expands\nexport const DRAG_HOVER_TIMEOUT = 500;\n\nconst ITEM_LIST_CLASS_NAME = 'item-list-scroll-pane';\n\nexport const renderFileListItem = (\n props: FileListRenderItemProps\n): 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 ?? item.basename}\n <Tooltip\n options={{\n placement: 'left',\n }}\n >\n {children ?? item.basename}\n </Tooltip>\n </span>\n </div>\n );\n};\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 */\nexport function 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\n/**\n * Get the move operation for the current selection and the given target. Throws if the operation is invalid.\n */\nexport function getMoveOperation(\n draggedItems: FileStorageItem[],\n targetItem: FileStorageItem\n): { files: FileStorageItem[]; targetPath: string } {\n if (draggedItems.length === 0 || targetItem == null) {\n throw new Error('No items to move');\n }\n\n const targetPath = getPathFromItem(targetItem);\n if (\n draggedItems.some(\n ({ filename }) => FileUtils.getPath(filename) === targetPath\n )\n ) {\n // Cannot drop if target is one of the dragged items is already in the target folder\n throw new Error('File already in the destination folder');\n }\n if (\n draggedItems.some(\n item =>\n isDirectory(item) &&\n targetPath.startsWith(FileUtils.makePath(item.filename))\n )\n ) {\n // Cannot drop if target is a child of one of the directories being moved\n throw new Error('Destination folder cannot be a child of a dragged folder');\n }\n return { files: draggedItems, targetPath };\n}\n\n/**\n * Component that displays and allows interaction with the file system in the provided FileStorageTable.\n */\nexport function FileList(props: FileListProps): JSX.Element {\n const {\n isMultiSelect = false,\n table,\n onFocusChange = () => undefined,\n onMove,\n onSelect,\n onSelectionChange = () => undefined,\n renderItem = renderFileListItem,\n rowHeight = DEFAULT_ROW_HEIGHT,\n overscanCount = ItemList.DEFAULT_OVERSCAN,\n } = props;\n const [loadedViewport, setLoadedViewport] = useState<LoadedViewport>(() => ({\n items: [],\n offset: 0,\n itemCount: 0,\n }));\n const [viewport, setViewport] = useState<ListViewport>({\n top: 0,\n bottom: 0,\n });\n\n const [dropTargetItem, setDropTargetItem] = useState<FileStorageItem>();\n const [draggedItems, setDraggedItems] = useState<FileStorageItem[]>();\n const [dragPlaceholder, setDragPlaceholder] = useState<HTMLDivElement>();\n const [selectedRanges, setSelectedRanges] = useState([] as Range[]);\n\n const itemList = useRef<ItemList<FileStorageItem>>(null);\n const fileList = useRef<HTMLDivElement>(null);\n\n const getItems = useCallback(\n (ranges: Range[]): FileStorageItem[] => {\n if (ranges.length === 0 || loadedViewport == null) {\n return [];\n }\n\n const items = [] as FileStorageItem[];\n for (let i = 0; i < ranges.length; i += 1) {\n const range = ranges[i];\n for (let j = range[0]; j <= range[1]; j += 1) {\n if (\n j >= loadedViewport.offset &&\n j < loadedViewport.offset + loadedViewport.items.length\n ) {\n items.push(loadedViewport.items[j - loadedViewport.offset]);\n }\n }\n }\n return items;\n },\n [loadedViewport]\n );\n\n const getItem = useCallback(\n (itemIndex: number): FileStorageItem | undefined => {\n const items = getItems([[itemIndex, itemIndex]]);\n if (items.length > 0) {\n return items[0];\n }\n },\n [getItems]\n );\n\n /**\n * Get the placeholder text to show when a drag operation is in progress\n */\n const getDragPlaceholderText = useCallback(() => {\n const count = RangeUtils.count(selectedRanges);\n if (count === 0) {\n return null;\n }\n\n if (count === 1) {\n const index = selectedRanges[0][0];\n const item = getItem(index);\n if (item != null) {\n return item.filename;\n }\n }\n return `${count} items`;\n }, [getItem, selectedRanges]);\n\n /**\n * Drop the currently dragged items at the currently set drop target.\n * If an itemIndex is provided, focus that index after the drop.\n */\n const dropItems = useCallback(\n (itemIndex?: number) => {\n if (!draggedItems || !dropTargetItem) {\n return;\n }\n\n log.debug('dropItems', draggedItems, 'to', itemIndex);\n\n try {\n const { files, targetPath } = getMoveOperation(\n draggedItems,\n dropTargetItem\n );\n onMove?.(files, targetPath);\n if (itemIndex != null) {\n setSelectedRanges([[itemIndex, itemIndex]]);\n itemList.current?.focusItem(itemIndex);\n }\n } catch (err) {\n log.error('Unable to complete move', err);\n }\n },\n [draggedItems, dropTargetItem, onMove]\n );\n\n const handleSelect = useCallback(\n (itemIndex: number, event: React.SyntheticEvent) => {\n const item = loadedViewport.items[itemIndex - loadedViewport.offset];\n if (item !== undefined) {\n log.debug('handleItemClick', item);\n\n onSelect(item, event);\n if (isDirectory(item)) {\n table?.setExpanded(item.filename, !item.isExpanded);\n }\n }\n },\n [loadedViewport, onSelect, table]\n );\n\n const handleItemDragStart = useCallback(\n (itemIndex: number, e: React.DragEvent<HTMLDivElement>) => {\n log.debug2('handleItemDragStart', itemIndex, selectedRanges);\n\n let draggedRanges = selectedRanges;\n if (!RangeUtils.isSelected(selectedRanges, itemIndex)) {\n draggedRanges = [[itemIndex, itemIndex]];\n setSelectedRanges(draggedRanges);\n }\n\n setDraggedItems(getItems(draggedRanges));\n\n // We need to reset reset the mouse state since we steal the drag\n itemList.current?.resetMouseState();\n\n const newDragPlaceholder = document.createElement('div');\n newDragPlaceholder.innerHTML = `<div class=\"dnd-placeholder-content\">${getDragPlaceholderText()}</div>`;\n newDragPlaceholder.className = 'file-list-dnd-placeholder';\n document.body.appendChild(newDragPlaceholder);\n e.dataTransfer.setDragImage(newDragPlaceholder, 0, 0);\n e.dataTransfer.effectAllowed = 'move';\n setDragPlaceholder(newDragPlaceholder);\n },\n [getDragPlaceholderText, getItems, selectedRanges]\n );\n\n const handleItemDragOver = useCallback(\n (itemIndex: number, e: React.DragEvent<HTMLDivElement>) => {\n e.preventDefault();\n\n log.debug2('handleItemDragOver', e);\n setDropTargetItem(getItem(itemIndex));\n },\n [getItem]\n );\n\n const handleItemDragEnd = useCallback(\n (itemIndex: number, e: React.DragEvent<HTMLDivElement>) => {\n log.debug('handleItemDragEnd', itemIndex);\n\n dragPlaceholder?.remove();\n\n // Drag end is triggered after drop\n // Also drop isn't triggered if drag end is outside of the list\n setDraggedItems(undefined);\n setDropTargetItem(undefined);\n setDragPlaceholder(undefined);\n },\n [dragPlaceholder]\n );\n\n const handleItemDrop = useCallback(\n (itemIndex: number, e: React.DragEvent<HTMLDivElement>) => {\n dropItems(itemIndex);\n },\n [dropItems]\n );\n\n const handleItemDragExit = useCallback(() => {\n log.debug2('handleItemDragExit');\n setDropTargetItem(undefined);\n }, []);\n\n const handleListDragOver = useCallback(\n (e: React.DragEvent<HTMLDivElement>) => {\n if (\n e.target instanceof Element &&\n e.target.classList.contains(ITEM_LIST_CLASS_NAME)\n ) {\n // Need to prevent default to enable drop\n // https://developer.mozilla.org/en-US/docs/Web/API/HTML_Drag_and_Drop_API/Drag_operations#droptargets\n e.preventDefault();\n\n log.debug2('handleListDragOver', e);\n setDropTargetItem({\n type: 'directory',\n filename: '/',\n basename: '/',\n id: '/',\n });\n }\n },\n []\n );\n\n const handleListDrop = useCallback(\n (e: React.DragEvent<HTMLDivElement>) => {\n if (\n e.target instanceof Element &&\n e.target.classList.contains(ITEM_LIST_CLASS_NAME)\n ) {\n log.debug('handleListDrop');\n dropItems();\n }\n },\n [dropItems]\n );\n\n const handleSelectionChange = useCallback(\n newSelectedRanges => {\n log.debug2('handleSelectionChange', newSelectedRanges);\n if (newSelectedRanges !== selectedRanges) {\n setSelectedRanges(newSelectedRanges);\n const selectedItems = getItems(newSelectedRanges);\n onSelectionChange(selectedItems);\n }\n },\n [getItems, onSelectionChange, selectedRanges]\n );\n\n const handleFocusChange = useCallback(\n focusIndex => {\n log.debug2('handleFocusChange', focusIndex);\n if (focusIndex != null) {\n const [focusedItem] = getItems([[focusIndex, focusIndex]]);\n onFocusChange(focusedItem);\n } else {\n onFocusChange();\n }\n },\n [getItems, onFocusChange]\n );\n\n const handleViewportChange = useCallback(\n (top: number, bottom: number) => {\n log.debug('handleViewportChange', top, bottom);\n if (top !== viewport.top || bottom !== viewport.bottom) {\n setViewport({ top, bottom });\n }\n },\n [viewport]\n );\n\n const isDropTargetValid = useMemo(() => {\n if (!draggedItems || !dropTargetItem) {\n return false;\n }\n\n try {\n getMoveOperation(draggedItems, dropTargetItem);\n log.debug('handleValidateDropTarget true');\n return true;\n } catch (e) {\n log.debug('handleValidateDropTarget false');\n return false;\n }\n }, [draggedItems, dropTargetItem]);\n\n const { focusedPath } = props;\n useEffect(() => {\n if (focusedPath !== undefined) {\n if (focusedPath === '/') {\n table.collapseAll();\n } else {\n table.setExpanded(focusedPath, false);\n table.setExpanded(focusedPath, true);\n }\n }\n }, [table, focusedPath]);\n\n useEffect(\n function updateTableViewport() {\n log.debug('updating table viewport', viewport);\n table?.setViewport({\n top: Math.max(0, viewport.top - overscanCount),\n bottom: viewport.bottom + overscanCount,\n });\n },\n [overscanCount, table, viewport]\n );\n\n // Listen for table updates\n useEffect(\n function setLoadedViewportAndReturnCleanup() {\n const listenerRemover = table.onUpdate(newViewport => {\n setLoadedViewport({\n items: newViewport.items.map(item => ({\n ...item,\n itemName: item.basename,\n })),\n offset: newViewport.offset,\n itemCount: table.size,\n });\n });\n return () => {\n listenerRemover();\n };\n },\n [table]\n );\n\n // Expand a folder if hovering over it\n useEffect(\n function expandFolderOnHover() {\n if (\n dropTargetItem != null &&\n isDirectory(dropTargetItem) &&\n dropTargetItem.filename !== '/'\n ) {\n const timeout = setTimeout(() => {\n if (!dropTargetItem.isExpanded) {\n table?.setExpanded(dropTargetItem.filename, true);\n }\n }, DRAG_HOVER_TIMEOUT);\n return () => clearTimeout(timeout);\n }\n },\n [dropTargetItem, table]\n );\n\n const renderWrapper = useCallback(\n itemProps =>\n renderItem({\n ...itemProps,\n isDragInProgress: draggedItems != null,\n dropTargetItem,\n draggedItems,\n isDropTargetValid,\n onDragStart: handleItemDragStart,\n onDragEnd: handleItemDragEnd,\n onDragOver: handleItemDragOver,\n onDragExit: handleItemDragExit,\n onDrop: handleItemDrop,\n }),\n [\n handleItemDragEnd,\n handleItemDragExit,\n handleItemDragOver,\n handleItemDragStart,\n handleItemDrop,\n draggedItems,\n dropTargetItem,\n isDropTargetValid,\n renderItem,\n ]\n );\n\n return (\n <div\n ref={fileList}\n className={classNames('file-list', {\n 'is-dragging': draggedItems != null,\n })}\n onDragOver={handleListDragOver}\n onDrop={handleListDrop}\n >\n <ItemList\n ref={itemList}\n items={loadedViewport.items}\n itemCount={loadedViewport.itemCount}\n offset={loadedViewport.offset}\n onFocusChange={handleFocusChange}\n onSelect={handleSelect}\n onSelectionChange={handleSelectionChange}\n onViewportChange={handleViewportChange}\n selectedRanges={selectedRanges}\n renderItem={renderWrapper}\n rowHeight={rowHeight}\n isMultiSelect={isMultiSelect}\n isDragSelect={false}\n isDeselectOnClick={false}\n />\n </div>\n );\n}\n\nexport default FileList;\n"],"mappings":";;;;;AAAA,SACEA,QAAQ,EAGRC,OAAO,QACF,uBAAuB;AAC9B,SAASC,QAAQ,EAAEC,MAAM,EAAEC,QAAQ,EAAEC,cAAc,QAAQ,kBAAkB;AAC7E,OAAOC,GAAG,MAAM,gBAAgB;AAChC,SAASC,UAAU,QAAQ,kBAAkB;AAC7C,SAASC,eAAe,QAAQ,gCAAgC;AAEhE,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,KAAK,IACVC,WAAW,EACXC,SAAS,EACTC,OAAO,EACPC,MAAM,EACNC,QAAQ,QACH,OAAO;AAAC,SAC6BC,WAAW;AAAA;AAAA,OAEhDC,SAAS,IAAIC,SAAS;AAE7B,IAAMC,GAAG,GAAGb,GAAG,CAACc,MAAM,CAAC,UAAU,CAAC;AA6ClC,OAAO,IAAMC,eAAe,GAAIC,IAAqB,IACnDN,WAAW,CAACM,IAAI,CAAC,GACbL,SAAS,CAACM,QAAQ,CAACD,IAAI,CAACE,QAAQ,CAAC,GACjCP,SAAS,CAACQ,OAAO,CAACH,IAAI,CAACE,QAAQ,CAAC;AAEtC,OAAO,IAAME,kBAAkB,GAAG,EAAE;;AAEpC;AACA,OAAO,IAAMC,kBAAkB,GAAG,GAAG;AAErC,IAAMC,oBAAoB,GAAG,uBAAuB;AAEpD,OAAO,IAAMC,kBAAkB,GAC7BC,KAA8B,IACd;EAAA;EAChB,IAAM;IACJC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EAAED,YAAY,IAAI,IAAI;IACtCM,cAAc;IACdN,YAAY;IACZE,iBAAiB;IACjBK,WAAW,EAAEoF,mBAAmB;IAChClF,SAAS,EAAEkG,iBAAiB;IAC5BnG,UAAU,EAAEiG,kBAAkB;IAC9BqC,UAAU,EAAEhC,kBAAkB;IAC9BpG,MAAM,EAAEmG;EAAc,GACtB,EACJ,CACEF,iBAAiB,EACjBG,kBAAkB,EAClBL,kBAAkB,EAClBd,mBAAmB,EACnBkB,cAAc,EACd7G,YAAY,EACZM,cAAc,EACdJ,iBAAiB,EACjBkD,UAAU,CACX,CACF;EAED,oBACE;IACE,GAAG,EAAEoB,QAAS;IACd,SAAS,EAAE/F,UAAU,CAAC,WAAW,EAAE;MACjC,aAAa,EAAEuB,YAAY,IAAI;IACjC,CAAC,CAAE;IACH,UAAU,EAAE+G,kBAAmB;IAC/B,MAAM,EAAEM;EAAe,gBAEvB,oBAAC,QAAQ;IACP,GAAG,EAAE9C,QAAS;IACd,KAAK,EAAEf,cAAc,CAACE,KAAM;IAC5B,SAAS,EAAEF,cAAc,CAACI,SAAU;IACpC,MAAM,EAAEJ,cAAc,CAACG,MAAO;IAC9B,aAAa,EAAE8D,iBAAkB;IACjC,QAAQ,EAAEjC,YAAa;IACvB,iBAAiB,EAAE8B,qBAAsB;IACzC,gBAAgB,EAAEM,oBAAqB;IACvC,cAAc,EAAEvD,cAAe;IAC/B,UAAU,EAAEuE,aAAc;IAC1B,SAAS,EAAEvF,SAAU;IACrB,aAAa,EAAER,aAAc;IAC7B,YAAY,EAAE,KAAM;IACpB,iBAAiB,EAAE;EAAM,EACzB,CACE;AAEV;AAEA,eAAeD,QAAQ"}
1
+ {"version":3,"file":"FileList.js","names":["ItemList","Log","RangeUtils","classNames","React","useCallback","useEffect","useMemo","useRef","useState","isDirectory","DEFAULT_ROW_HEIGHT","getMoveOperation","FileListItem","log","module","DRAG_HOVER_TIMEOUT","ITEM_LIST_CLASS_NAME","FileList","props","isMultiSelect","table","onFocusChange","undefined","onMove","onSelect","onSelectionChange","renderItem","rowHeight","overscanCount","DEFAULT_OVERSCAN","loadedViewport","setLoadedViewport","items","offset","itemCount","viewport","setViewport","top","bottom","dropTargetItem","setDropTargetItem","draggedItems","setDraggedItems","dragPlaceholder","setDragPlaceholder","selectedRanges","setSelectedRanges","itemList","fileList","getItems","ranges","length","i","range","j","push","getItem","itemIndex","getDragPlaceholderText","count","index","item","filename","dropItems","debug","files","targetPath","current","focusItem","err","error","handleSelect","event","setExpanded","isExpanded","handleItemDragStart","e","debug2","draggedRanges","isSelected","resetMouseState","newDragPlaceholder","document","createElement","innerHTML","className","body","appendChild","dataTransfer","setDragImage","effectAllowed","handleItemDragOver","preventDefault","handleItemDragEnd","remove","handleItemDrop","handleItemDragExit","handleListDragOver","target","Element","classList","contains","type","basename","id","handleListDrop","handleSelectionChange","newSelectedRanges","selectedItems","handleFocusChange","focusIndex","focusedItem","handleViewportChange","isDropTargetValid","focusedPath","collapseAll","updateTableViewport","Math","max","setLoadedViewportAndReturnCleanup","listenerRemover","onUpdate","newViewport","map","itemName","size","expandFolderOnHover","timeout","setTimeout","clearTimeout","renderWrapper","itemProps","isDragInProgress","onDragStart","onDragEnd","onDragOver","onDragExit","onDrop"],"sources":["../src/FileList.tsx"],"sourcesContent":["import { ItemList, Range } from '@deephaven/components';\nimport Log from '@deephaven/log';\nimport { RangeUtils } from '@deephaven/utils';\nimport classNames from 'classnames';\nimport React, {\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport { FileStorageItem, FileStorageTable, isDirectory } from './FileStorage';\nimport './FileList.scss';\nimport { DEFAULT_ROW_HEIGHT, getMoveOperation } from './FileListUtils';\nimport { FileListItem, FileListRenderItemProps } from './FileListItem';\n\nconst log = Log.module('FileList');\n\nexport type LoadedViewport = {\n items: FileStorageItem[];\n offset: number;\n itemCount: number;\n};\n\nexport type ListViewport = {\n top: number;\n bottom: number;\n};\n\nexport interface FileListProps {\n table: FileStorageTable;\n\n isMultiSelect?: boolean;\n focusedPath?: string;\n\n onFocusChange?: (focusedItem?: FileStorageItem) => void;\n onMove?: (files: FileStorageItem[], path: string) => void;\n onSelect: (file: FileStorageItem, event: React.SyntheticEvent) => void;\n onSelectionChange?: (selectedItems: FileStorageItem[]) => void;\n\n renderItem?: (props: FileListRenderItemProps) => JSX.Element;\n\n /** Height of each item in the list */\n rowHeight?: number;\n\n overscanCount?: number;\n}\n\n// How long you need to hover over a directory before it expands\nconst DRAG_HOVER_TIMEOUT = 500;\n\nconst ITEM_LIST_CLASS_NAME = 'item-list-scroll-pane';\n\n/**\n * Component that displays and allows interaction with the file system in the provided FileStorageTable.\n */\nexport function FileList(props: FileListProps): JSX.Element {\n const {\n isMultiSelect = false,\n table,\n onFocusChange = () => undefined,\n onMove,\n onSelect,\n onSelectionChange = () => undefined,\n renderItem = FileListItem,\n rowHeight = DEFAULT_ROW_HEIGHT,\n overscanCount = ItemList.DEFAULT_OVERSCAN,\n } = props;\n const [loadedViewport, setLoadedViewport] = useState<LoadedViewport>(() => ({\n items: [],\n offset: 0,\n itemCount: 0,\n }));\n const [viewport, setViewport] = useState<ListViewport>({\n top: 0,\n bottom: 0,\n });\n\n const [dropTargetItem, setDropTargetItem] = useState<FileStorageItem>();\n const [draggedItems, setDraggedItems] = useState<FileStorageItem[]>();\n const [dragPlaceholder, setDragPlaceholder] = useState<HTMLDivElement>();\n const [selectedRanges, setSelectedRanges] = useState([] as Range[]);\n\n const itemList = useRef<ItemList<FileStorageItem>>(null);\n const fileList = useRef<HTMLDivElement>(null);\n\n const getItems = useCallback(\n (ranges: Range[]): FileStorageItem[] => {\n if (ranges.length === 0 || loadedViewport == null) {\n return [];\n }\n\n const items = [] as FileStorageItem[];\n for (let i = 0; i < ranges.length; i += 1) {\n const range = ranges[i];\n for (let j = range[0]; j <= range[1]; j += 1) {\n if (\n j >= loadedViewport.offset &&\n j < loadedViewport.offset + loadedViewport.items.length\n ) {\n items.push(loadedViewport.items[j - loadedViewport.offset]);\n }\n }\n }\n return items;\n },\n [loadedViewport]\n );\n\n const getItem = useCallback(\n (itemIndex: number): FileStorageItem | undefined => {\n const items = getItems([[itemIndex, itemIndex]]);\n if (items.length > 0) {\n return items[0];\n }\n },\n [getItems]\n );\n\n /**\n * Get the placeholder text to show when a drag operation is in progress\n */\n const getDragPlaceholderText = useCallback(() => {\n const count = RangeUtils.count(selectedRanges);\n if (count === 0) {\n return null;\n }\n\n if (count === 1) {\n const index = selectedRanges[0][0];\n const item = getItem(index);\n if (item != null) {\n return item.filename;\n }\n }\n return `${count} items`;\n }, [getItem, selectedRanges]);\n\n /**\n * Drop the currently dragged items at the currently set drop target.\n * If an itemIndex is provided, focus that index after the drop.\n */\n const dropItems = useCallback(\n (itemIndex?: number) => {\n if (!draggedItems || !dropTargetItem) {\n return;\n }\n\n log.debug('dropItems', draggedItems, 'to', itemIndex);\n\n try {\n const { files, targetPath } = getMoveOperation(\n draggedItems,\n dropTargetItem\n );\n onMove?.(files, targetPath);\n if (itemIndex != null) {\n setSelectedRanges([[itemIndex, itemIndex]]);\n itemList.current?.focusItem(itemIndex);\n }\n } catch (err) {\n log.error('Unable to complete move', err);\n }\n },\n [draggedItems, dropTargetItem, onMove]\n );\n\n const handleSelect = useCallback(\n (itemIndex: number, event: React.SyntheticEvent) => {\n const item = loadedViewport.items[itemIndex - loadedViewport.offset];\n if (item !== undefined) {\n log.debug('handleItemClick', item);\n\n onSelect(item, event);\n if (isDirectory(item)) {\n table?.setExpanded(item.filename, !item.isExpanded);\n }\n }\n },\n [loadedViewport, onSelect, table]\n );\n\n const handleItemDragStart = useCallback(\n (itemIndex: number, e: React.DragEvent<HTMLDivElement>) => {\n log.debug2('handleItemDragStart', itemIndex, selectedRanges);\n\n let draggedRanges = selectedRanges;\n if (!RangeUtils.isSelected(selectedRanges, itemIndex)) {\n draggedRanges = [[itemIndex, itemIndex]];\n setSelectedRanges(draggedRanges);\n }\n\n setDraggedItems(getItems(draggedRanges));\n\n // We need to reset reset the mouse state since we steal the drag\n itemList.current?.resetMouseState();\n\n const newDragPlaceholder = document.createElement('div');\n newDragPlaceholder.innerHTML = `<div class=\"dnd-placeholder-content\">${getDragPlaceholderText()}</div>`;\n newDragPlaceholder.className = 'file-list-dnd-placeholder';\n document.body.appendChild(newDragPlaceholder);\n e.dataTransfer.setDragImage(newDragPlaceholder, 0, 0);\n e.dataTransfer.effectAllowed = 'move';\n setDragPlaceholder(newDragPlaceholder);\n },\n [getDragPlaceholderText, getItems, selectedRanges]\n );\n\n const handleItemDragOver = useCallback(\n (itemIndex: number, e: React.DragEvent<HTMLDivElement>) => {\n e.preventDefault();\n\n log.debug2('handleItemDragOver', e);\n setDropTargetItem(getItem(itemIndex));\n },\n [getItem]\n );\n\n const handleItemDragEnd = useCallback(\n (itemIndex: number, e: React.DragEvent<HTMLDivElement>) => {\n log.debug('handleItemDragEnd', itemIndex);\n\n dragPlaceholder?.remove();\n\n // Drag end is triggered after drop\n // Also drop isn't triggered if drag end is outside of the list\n setDraggedItems(undefined);\n setDropTargetItem(undefined);\n setDragPlaceholder(undefined);\n },\n [dragPlaceholder]\n );\n\n const handleItemDrop = useCallback(\n (itemIndex: number, e: React.DragEvent<HTMLDivElement>) => {\n dropItems(itemIndex);\n },\n [dropItems]\n );\n\n const handleItemDragExit = useCallback(() => {\n log.debug2('handleItemDragExit');\n setDropTargetItem(undefined);\n }, []);\n\n const handleListDragOver = useCallback(\n (e: React.DragEvent<HTMLDivElement>) => {\n if (\n e.target instanceof Element &&\n e.target.classList.contains(ITEM_LIST_CLASS_NAME)\n ) {\n // Need to prevent default to enable drop\n // https://developer.mozilla.org/en-US/docs/Web/API/HTML_Drag_and_Drop_API/Drag_operations#droptargets\n e.preventDefault();\n\n log.debug2('handleListDragOver', e);\n setDropTargetItem({\n type: 'directory',\n filename: '/',\n basename: '/',\n id: '/',\n });\n }\n },\n []\n );\n\n const handleListDrop = useCallback(\n (e: React.DragEvent<HTMLDivElement>) => {\n if (\n e.target instanceof Element &&\n e.target.classList.contains(ITEM_LIST_CLASS_NAME)\n ) {\n log.debug('handleListDrop');\n dropItems();\n }\n },\n [dropItems]\n );\n\n const handleSelectionChange = useCallback(\n newSelectedRanges => {\n log.debug2('handleSelectionChange', newSelectedRanges);\n if (newSelectedRanges !== selectedRanges) {\n setSelectedRanges(newSelectedRanges);\n const selectedItems = getItems(newSelectedRanges);\n onSelectionChange(selectedItems);\n }\n },\n [getItems, onSelectionChange, selectedRanges]\n );\n\n const handleFocusChange = useCallback(\n focusIndex => {\n log.debug2('handleFocusChange', focusIndex);\n if (focusIndex != null) {\n const [focusedItem] = getItems([[focusIndex, focusIndex]]);\n onFocusChange(focusedItem);\n } else {\n onFocusChange();\n }\n },\n [getItems, onFocusChange]\n );\n\n const handleViewportChange = useCallback(\n (top: number, bottom: number) => {\n log.debug('handleViewportChange', top, bottom);\n if (top !== viewport.top || bottom !== viewport.bottom) {\n setViewport({ top, bottom });\n }\n },\n [viewport]\n );\n\n const isDropTargetValid = useMemo(() => {\n if (!draggedItems || !dropTargetItem) {\n return false;\n }\n\n try {\n getMoveOperation(draggedItems, dropTargetItem);\n log.debug('handleValidateDropTarget true');\n return true;\n } catch (e) {\n log.debug('handleValidateDropTarget false');\n return false;\n }\n }, [draggedItems, dropTargetItem]);\n\n const { focusedPath } = props;\n useEffect(() => {\n if (focusedPath !== undefined) {\n if (focusedPath === '/') {\n table.collapseAll();\n } else {\n table.setExpanded(focusedPath, false);\n table.setExpanded(focusedPath, true);\n }\n }\n }, [table, focusedPath]);\n\n useEffect(\n function updateTableViewport() {\n log.debug('updating table viewport', viewport);\n table?.setViewport({\n top: Math.max(0, viewport.top - overscanCount),\n bottom: viewport.bottom + overscanCount,\n });\n },\n [overscanCount, table, viewport]\n );\n\n // Listen for table updates\n useEffect(\n function setLoadedViewportAndReturnCleanup() {\n const listenerRemover = table.onUpdate(newViewport => {\n setLoadedViewport({\n items: newViewport.items.map(item => ({\n ...item,\n itemName: item.basename,\n })),\n offset: newViewport.offset,\n itemCount: table.size,\n });\n });\n return () => {\n listenerRemover();\n };\n },\n [table]\n );\n\n // Expand a folder if hovering over it\n useEffect(\n function expandFolderOnHover() {\n if (\n dropTargetItem != null &&\n isDirectory(dropTargetItem) &&\n dropTargetItem.filename !== '/'\n ) {\n const timeout = setTimeout(() => {\n if (!dropTargetItem.isExpanded) {\n table?.setExpanded(dropTargetItem.filename, true);\n }\n }, DRAG_HOVER_TIMEOUT);\n return () => clearTimeout(timeout);\n }\n },\n [dropTargetItem, table]\n );\n\n const renderWrapper = useCallback(\n itemProps =>\n renderItem({\n ...itemProps,\n isDragInProgress: draggedItems != null,\n dropTargetItem,\n draggedItems,\n isDropTargetValid,\n onDragStart: handleItemDragStart,\n onDragEnd: handleItemDragEnd,\n onDragOver: handleItemDragOver,\n onDragExit: handleItemDragExit,\n onDrop: handleItemDrop,\n }),\n [\n handleItemDragEnd,\n handleItemDragExit,\n handleItemDragOver,\n handleItemDragStart,\n handleItemDrop,\n draggedItems,\n dropTargetItem,\n isDropTargetValid,\n renderItem,\n ]\n );\n\n return (\n <div\n ref={fileList}\n className={classNames('file-list', {\n 'is-dragging': draggedItems != null,\n })}\n onDragOver={handleListDragOver}\n onDrop={handleListDrop}\n >\n <ItemList\n ref={itemList}\n items={loadedViewport.items}\n itemCount={loadedViewport.itemCount}\n offset={loadedViewport.offset}\n onFocusChange={handleFocusChange}\n onSelect={handleSelect}\n onSelectionChange={handleSelectionChange}\n onViewportChange={handleViewportChange}\n selectedRanges={selectedRanges}\n renderItem={renderWrapper}\n rowHeight={rowHeight}\n isMultiSelect={isMultiSelect}\n isDragSelect={false}\n isDeselectOnClick={false}\n />\n </div>\n );\n}\n\nexport default FileList;\n"],"mappings":";;;;;AAAA,SAASA,QAAQ,QAAe,uBAAuB;AACvD,OAAOC,GAAG,MAAM,gBAAgB;AAChC,SAASC,UAAU,QAAQ,kBAAkB;AAC7C,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,KAAK,IACVC,WAAW,EAC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,EAAE,CAAC,IAAI,EAAE,eAAe,EAAE,KAAK,EAAE,KAAK,CAAC,cAAc,KAAK,IAAI,CAAC;IACvE,cAAc,CAAC,EAAE,CAAC,IAAI,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3E,iBAAiB,CAAC,EAAE,CAAC,aAAa,EAAE,eAAe,EAAE,KAAK,IAAI,CAAC;IAE/D,sCAAsC;IACtC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,GAAG,GAAG,CAAC,OAAO,CA+L5E;yBA/Le,iBAAiB;;;AAmMjC,eAAe,iBAAiB,CAAC"}
@@ -1,12 +1,9 @@
1
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
2
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
3
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
4
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
5
- function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
6
1
  import { ContextActions } from '@deephaven/components';
7
2
  import { assertNotNull } from '@deephaven/utils';
8
3
  import React, { useCallback, useMemo, useState } from 'react';
9
- import FileList, { renderFileListItem, DEFAULT_ROW_HEIGHT } from "./FileList.js";
4
+ import FileList from "./FileList.js";
5
+ import { FileListItem } from "./FileListItem.js";
6
+ import { DEFAULT_ROW_HEIGHT } from "./FileListUtils.js";
10
7
  import { isDirectory } from "./FileStorage.js";
11
8
  import SHORTCUTS from "./FileExplorerShortcuts.js";
12
9
  import "./FileExplorer.css";
@@ -135,16 +132,19 @@ export function FileListContainer(props) {
135
132
  item
136
133
  } = itemProps;
137
134
  if (renameItem && renameItem.filename === item.filename) {
138
- return renderFileListItem(_objectSpread(_objectSpread({}, itemProps), {}, {
139
- children: /*#__PURE__*/React.createElement(FileListItemEditor, {
135
+ return (
136
+ /*#__PURE__*/
137
+ // eslint-disable-next-line react/jsx-props-no-spreading
138
+ React.createElement(FileListItem, itemProps, /*#__PURE__*/React.createElement(FileListItemEditor, {
140
139
  item: item,
141
140
  validate: validateRenameItem,
142
141
  onSubmit: handleRenameSubmit,
143
142
  onCancel: handleRenameCancel
144
- })
145
- }));
143
+ }))
144
+ );
146
145
  }
147
- return renderFileListItem(itemProps);
146
+ // eslint-disable-next-line react/jsx-props-no-spreading
147
+ return /*#__PURE__*/React.createElement(FileListItem, itemProps);
148
148
  }, [handleRenameCancel, handleRenameSubmit, renameItem, validateRenameItem]);
149
149
  return /*#__PURE__*/React.createElement("div", {
150
150
  className: "file-list-container"
@@ -1 +1 @@
1
- {"version":3,"file":"FileListContainer.js","names":["ContextActions","assertNotNull","React","useCallback","useMemo","useState","FileList","renderFileListItem","DEFAULT_ROW_HEIGHT","isDirectory","SHORTCUTS","FileUtils","FileListItemEditor","FileListContainer","props","isMultiSelect","focusedPath","showContextMenu","onCreateFile","onCreateFolder","onCopy","onDelete","onMove","onRename","onSelect","onSelectionChange","table","rowHeight","validateRename","Promise","resolve","renameItem","setRenameItem","selectedItems","setSelectedItems","focusedItem","setFocusedItem","handleSelectionChange","newSelectedItems","handleFocusChange","newFocusedItem","handleCopyAction","handleDeleteAction","length","handleNewFileAction","handleNewFolderAction","getPath","filename","handleRenameAction","handleRenameCancel","undefined","handleRenameSubmit","newName","actions","result","push","title","description","action","group","groups","medium","low","disabled","shortcut","FILE_EXPLORER","DELETE","RENAME","validateRenameItem","renderItem","itemProps","item","children","displayName"],"sources":["../src/FileListContainer.tsx"],"sourcesContent":["import { ContextAction, ContextActions } from '@deephaven/components';\nimport { assertNotNull } from '@deephaven/utils';\nimport React, { useCallback, useMemo, useState } from 'react';\nimport FileList, {\n renderFileListItem,\n DEFAULT_ROW_HEIGHT,\n FileListRenderItemProps,\n} from './FileList';\nimport { FileStorageItem, FileStorageTable, isDirectory } from './FileStorage';\nimport SHORTCUTS from './FileExplorerShortcuts';\nimport './FileExplorer.scss';\nimport FileUtils from './FileUtils';\nimport FileListItemEditor from './FileListItemEditor';\n\nexport interface FileListContainerProps {\n showContextMenu?: boolean;\n table: FileStorageTable;\n\n isMultiSelect?: boolean;\n focusedPath?: string;\n\n onCreateFile?: (path?: string) => void;\n onCreateFolder?: (path?: string) => void;\n onCopy?: (file: FileStorageItem) => void;\n onDelete?: (files: FileStorageItem[]) => void;\n onMove?: (files: FileStorageItem[], path: string) => void;\n onRename?: (file: FileStorageItem, newName: string) => void;\n onSelect: (file: FileStorageItem, event: React.SyntheticEvent) => void;\n validateRename?: (file: FileStorageItem, newName: string) => Promise<void>;\n onSelectionChange?: (selectedItems: FileStorageItem[]) => void;\n\n /** Height of each item in the list */\n rowHeight?: number;\n}\n\n/**\n * Component that displays and allows interaction with the file system in the provided FileStorage.\n */\nexport function FileListContainer(props: FileListContainerProps): JSX.Element {\n const {\n isMultiSelect = false,\n focusedPath,\n showContextMenu = false,\n onCreateFile,\n onCreateFolder,\n onCopy,\n onDelete,\n onMove,\n onRename,\n onSelect,\n onSelectionChange,\n table,\n rowHeight = DEFAULT_ROW_HEIGHT,\n validateRename = () => Promise.resolve(),\n } = props;\n const [renameItem, setRenameItem] = useState<FileStorageItem>();\n const [selectedItems, setSelectedItems] = useState([] as FileStorageItem[]);\n const [focusedItem, setFocusedItem] = useState<FileStorageItem>();\n\n const handleSelectionChange = useCallback(\n newSelectedItems => {\n setSelectedItems(newSelectedItems);\n onSelectionChange?.(newSelectedItems);\n },\n [onSelectionChange]\n );\n\n const handleFocusChange = useCallback(newFocusedItem => {\n setFocusedItem(newFocusedItem);\n }, []);\n\n const handleCopyAction = useCallback(() => {\n if (focusedItem) {\n onCopy?.(focusedItem);\n }\n }, [focusedItem, onCopy]);\n\n const handleDeleteAction = useCallback(() => {\n if (selectedItems.length > 0) {\n onDelete?.(selectedItems);\n }\n }, [onDelete, selectedItems]);\n\n const handleNewFileAction = useCallback(() => {\n onCreateFile?.();\n }, [onCreateFile]);\n\n const handleNewFolderAction = useCallback(() => {\n if (focusedItem) {\n onCreateFolder?.(FileUtils.getPath(focusedItem.filename));\n }\n }, [focusedItem, onCreateFolder]);\n\n const handleRenameAction = useCallback(() => {\n if (focusedItem) {\n setRenameItem(focusedItem);\n }\n }, [focusedItem]);\n\n const handleRenameCancel = useCallback((): void => {\n setRenameItem(undefined);\n }, []);\n\n const handleRenameSubmit = useCallback(\n (newName: string): void => {\n if (renameItem) {\n onRename?.(renameItem, newName);\n setRenameItem(undefined);\n }\n },\n [onRename, renameItem]\n );\n\n const actions = useMemo(() => {\n if (renameItem) {\n // While renaming, we don't want to enable any of the context actions or it may interfere with renaming input\n return [];\n }\n\n const result = [] as ContextAction[];\n if (onCreateFile) {\n result.push({\n title: 'New File',\n description: 'Create new file',\n action: handleNewFileAction,\n group: ContextActions.groups.medium,\n });\n }\n if (onCreateFolder) {\n result.push({\n title: 'New Folder',\n description: 'Create new folder',\n action: handleNewFolderAction,\n group: ContextActions.groups.medium,\n });\n }\n if (onCopy) {\n result.push({\n title: 'Copy',\n description: 'Copy',\n action: handleCopyAction,\n group: ContextActions.groups.low,\n disabled: focusedItem == null || isDirectory(focusedItem),\n });\n }\n if (onDelete && selectedItems.length > 0) {\n result.push({\n title: 'Delete',\n description: 'Delete',\n shortcut: SHORTCUTS.FILE_EXPLORER.DELETE,\n action: handleDeleteAction,\n group: ContextActions.groups.low,\n });\n }\n if (onRename) {\n result.push({\n title: 'Rename',\n description: 'Rename',\n shortcut: SHORTCUTS.FILE_EXPLORER.RENAME,\n action: handleRenameAction,\n group: ContextActions.groups.low,\n disabled: focusedItem == null,\n });\n }\n return result;\n }, [\n handleCopyAction,\n handleDeleteAction,\n handleNewFileAction,\n handleNewFolderAction,\n handleRenameAction,\n focusedItem,\n onCopy,\n onCreateFile,\n onCreateFolder,\n onDelete,\n onRename,\n selectedItems,\n renameItem,\n ]);\n\n const validateRenameItem = useCallback(\n (newName: string): Promise<void> => {\n assertNotNull(renameItem);\n return validateRename(renameItem, newName);\n },\n [renameItem, validateRename]\n );\n\n const renderItem = useCallback(\n (itemProps: FileListRenderItemProps): JSX.Element => {\n const { item } = itemProps;\n if (renameItem && renameItem.filename === item.filename) {\n return renderFileListItem({\n ...itemProps,\n children: (\n <FileListItemEditor\n item={item}\n validate={validateRenameItem}\n onSubmit={handleRenameSubmit}\n onCancel={handleRenameCancel}\n />\n ),\n });\n }\n return renderFileListItem(itemProps);\n },\n [handleRenameCancel, handleRenameSubmit, renameItem, validateRenameItem]\n );\n\n return (\n <div className=\"file-list-container\">\n {table != null && (\n <FileList\n onMove={onMove}\n onSelect={onSelect}\n onSelectionChange={handleSelectionChange}\n onFocusChange={handleFocusChange}\n renderItem={renderItem}\n rowHeight={rowHeight}\n table={table}\n isMultiSelect={isMultiSelect}\n focusedPath={focusedPath}\n />\n )}\n {showContextMenu && <ContextActions actions={actions} />}\n </div>\n );\n}\n\nFileListContainer.displayName = 'FileListContainer';\n\nexport default FileListContainer;\n"],"mappings":";;;;;AAAA,SAAwBA,cAAc,QA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,EAAC;EAAqB,GACjC1C,KAAK,IAAI,IAAI,iBACZ,oBAAC,QAAQ;IACP,MAAM,EAAEJ,MAAO;IACf,QAAQ,EAAEE,QAAS;IACnB,iBAAiB,EAAEa,qBAAsB;IACzC,aAAa,EAAEE,iBAAkB;IACjC,UAAU,EAAE8B,UAAW;IACvB,SAAS,EAAE1C,SAAU;IACrB,KAAK,EAAED,KAAM;IACb,aAAa,EAAEX,aAAc;IAC7B,WAAW,EAAEC;EAAY,EAE5B,EACAC,eAAe,iBAAI,oBAAC,cAAc;IAAC,OAAO,EAAEoC;EAAQ,EAAG,CACpD;AAEV;AAEAxC,iBAAiB,CAAC4D,WAAW,GAAG,mBAAmB;AAEnD,eAAe5D,iBAAiB"}
1
+ {"version":3,"file":"FileListContainer.js","names":["ContextActions","assertNotNull","React","useCallback","useMemo","useState","FileList","FileListItem","DEFAULT_ROW_HEIGHT","isDirectory","SHORTCUTS","FileUtils","FileListItemEditor","FileListContainer","props","isMultiSelect","focusedPath","showContextMenu","onCreateFile","onCreateFolder","onCopy","onDelete","onMove","onRename","onSelect","onSelectionChange","table","rowHeight","validateRename","Promise","resolve","renameItem","setRenameItem","selectedItems","setSelectedItems","focusedItem","setFocusedItem","handleSelectionChange","newSelectedItems","handleFocusChange","newFocusedItem","handleCopyAction","handleDeleteAction","length","handleNewFileAction","handleNewFolderAction","getPath","filename","handleRenameAction","handleRenameCancel","undefined","handleRenameSubmit","newName","actions","result","push","title","description","action","group","groups","medium","low","disabled","shortcut","FILE_EXPLORER","DELETE","RENAME","validateRenameItem","renderItem","itemProps","item","displayName"],"sources":["../src/FileListContainer.tsx"],"sourcesContent":["import { ContextAction, ContextActions } from '@deephaven/components';\nimport { assertNotNull } from '@deephaven/utils';\nimport React, { useCallback, useMemo, useState } from 'react';\nimport FileList from './FileList';\nimport { FileListItem, FileListRenderItemProps } from './FileListItem';\nimport { DEFAULT_ROW_HEIGHT } from './FileListUtils';\nimport { FileStorageItem, FileStorageTable, isDirectory } from './FileStorage';\nimport SHORTCUTS from './FileExplorerShortcuts';\nimport './FileExplorer.scss';\nimport FileUtils from './FileUtils';\nimport FileListItemEditor from './FileListItemEditor';\n\nexport interface FileListContainerProps {\n showContextMenu?: boolean;\n table: FileStorageTable;\n\n isMultiSelect?: boolean;\n focusedPath?: string;\n\n onCreateFile?: (path?: string) => void;\n onCreateFolder?: (path?: string) => void;\n onCopy?: (file: FileStorageItem) => void;\n onDelete?: (files: FileStorageItem[]) => void;\n onMove?: (files: FileStorageItem[], path: string) => void;\n onRename?: (file: FileStorageItem, newName: string) => void;\n onSelect: (file: FileStorageItem, event: React.SyntheticEvent) => void;\n validateRename?: (file: FileStorageItem, newName: string) => Promise<void>;\n onSelectionChange?: (selectedItems: FileStorageItem[]) => void;\n\n /** Height of each item in the list */\n rowHeight?: number;\n}\n\n/**\n * Component that displays and allows interaction with the file system in the provided FileStorage.\n */\nexport function FileListContainer(props: FileListContainerProps): JSX.Element {\n const {\n isMultiSelect = false,\n focusedPath,\n showContextMenu = false,\n onCreateFile,\n onCreateFolder,\n onCopy,\n onDelete,\n onMove,\n onRename,\n onSelect,\n onSelectionChange,\n table,\n rowHeight = DEFAULT_ROW_HEIGHT,\n validateRename = () => Promise.resolve(),\n } = props;\n const [renameItem, setRenameItem] = useState<FileStorageItem>();\n const [selectedItems, setSelectedItems] = useState([] as FileStorageItem[]);\n const [focusedItem, setFocusedItem] = useState<FileStorageItem>();\n\n const handleSelectionChange = useCallback(\n newSelectedItems => {\n setSelectedItems(newSelectedItems);\n onSelectionChange?.(newSelectedItems);\n },\n [onSelectionChange]\n );\n\n const handleFocusChange = useCallback(newFocusedItem => {\n setFocusedItem(newFocusedItem);\n }, []);\n\n const handleCopyAction = useCallback(() => {\n if (focusedItem) {\n onCopy?.(focusedItem);\n }\n }, [focusedItem, onCopy]);\n\n const handleDeleteAction = useCallback(() => {\n if (selectedItems.length > 0) {\n onDelete?.(selectedItems);\n }\n }, [onDelete, selectedItems]);\n\n const handleNewFileAction = useCallback(() => {\n onCreateFile?.();\n }, [onCreateFile]);\n\n const handleNewFolderAction = useCallback(() => {\n if (focusedItem) {\n onCreateFolder?.(FileUtils.getPath(focusedItem.filename));\n }\n }, [focusedItem, onCreateFolder]);\n\n const handleRenameAction = useCallback(() => {\n if (focusedItem) {\n setRenameItem(focusedItem);\n }\n }, [focusedItem]);\n\n const handleRenameCancel = useCallback((): void => {\n setRenameItem(undefined);\n }, []);\n\n const handleRenameSubmit = useCallback(\n (newName: string): void => {\n if (renameItem) {\n onRename?.(renameItem, newName);\n setRenameItem(undefined);\n }\n },\n [onRename, renameItem]\n );\n\n const actions = useMemo(() => {\n if (renameItem) {\n // While renaming, we don't want to enable any of the context actions or it may interfere with renaming input\n return [];\n }\n\n const result = [] as ContextAction[];\n if (onCreateFile) {\n result.push({\n title: 'New File',\n description: 'Create new file',\n action: handleNewFileAction,\n group: ContextActions.groups.medium,\n });\n }\n if (onCreateFolder) {\n result.push({\n title: 'New Folder',\n description: 'Create new folder',\n action: handleNewFolderAction,\n group: ContextActions.groups.medium,\n });\n }\n if (onCopy) {\n result.push({\n title: 'Copy',\n description: 'Copy',\n action: handleCopyAction,\n group: ContextActions.groups.low,\n disabled: focusedItem == null || isDirectory(focusedItem),\n });\n }\n if (onDelete && selectedItems.length > 0) {\n result.push({\n title: 'Delete',\n description: 'Delete',\n shortcut: SHORTCUTS.FILE_EXPLORER.DELETE,\n action: handleDeleteAction,\n group: ContextActions.groups.low,\n });\n }\n if (onRename) {\n result.push({\n title: 'Rename',\n description: 'Rename',\n shortcut: SHORTCUTS.FILE_EXPLORER.RENAME,\n action: handleRenameAction,\n group: ContextActions.groups.low,\n disabled: focusedItem == null,\n });\n }\n return result;\n }, [\n handleCopyAction,\n handleDeleteAction,\n handleNewFileAction,\n handleNewFolderAction,\n handleRenameAction,\n focusedItem,\n onCopy,\n onCreateFile,\n onCreateFolder,\n onDelete,\n onRename,\n selectedItems,\n renameItem,\n ]);\n\n const validateRenameItem = useCallback(\n (newName: string): Promise<void> => {\n assertNotNull(renameItem);\n return validateRename(renameItem, newName);\n },\n [renameItem, validateRename]\n );\n\n const renderItem = useCallback(\n (itemProps: FileListRenderItemProps): JSX.Element => {\n const { item } = itemProps;\n if (renameItem && renameItem.filename === item.filename) {\n return (\n // eslint-disable-next-line react/jsx-props-no-spreading\n <FileListItem {...itemProps}>\n <FileListItemEditor\n item={item}\n validate={validateRenameItem}\n onSubmit={handleRenameSubmit}\n onCancel={handleRenameCancel}\n />\n </FileListItem>\n );\n }\n // eslint-disable-next-line react/jsx-props-no-spreading\n return <FileListItem {...itemProps} />;\n },\n [handleRenameCancel, handleRenameSubmit, renameItem, validateRenameItem]\n );\n\n return (\n <div className=\"file-list-container\">\n {table != null && (\n <FileList\n onMove={onMove}\n onSelect={onSelect}\n onSelectionChange={handleSelectionChange}\n onFocusChange={handleFocusChange}\n renderItem={renderItem}\n rowHeight={rowHeight}\n table={table}\n isMultiSelect={isMultiSelect}\n focusedPath={focusedPath}\n />\n )}\n {showContextMenu && <ContextActions actions={actions} />}\n </div>\n );\n}\n\nFileListContainer.displayName = 'FileListContainer';\n\nexport default FileListContainer;\n"],"mappings":"AAAA,SAAwBA,cAAc,QAAQ,uBAAuB;AACrE,SAASC,aAAa,QAAQ,kBAAkB;AAChD,OAAOC,KAAK,IAAIC,WAAW,EAAEC,OAAO,EAAEC,QAAQ,QAAQ,OAAO;AAAC,OACvDC,QAAQ;AAAA,SACNC,YAAY;AAAA,SACZC,kBAAkB;AAAA,SACiBC,WAAW;AAAA,OAChDC,SAAS;AAAA;AAAA,OAETC,SAAS;AAAA,OACTC,kBAAkB;AAuBzB;AACA;AACA;AACA,OAAO,SAASC,iBAAiB,CAACC,KAA6B,EAAe;EAC5E,IAAM;IACJC,aAAa,GAAG,KAAK;IACrBC,WAAW;IACXC,eAAe,GAAG,KAAK;IACvBC,YAAY;IACZC,cAAc;IACdC,MAAM;IACNC,QAAQ;IACRC,MAAM;IACNC,QAAQ;IACRC,QAAQ;I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@
1
+ import React from 'react';
2
+ import { RenderItemProps } from '@deephaven/components';
3
+ import { FileStorageItem } from './FileStorage';
4
+ import './FileList.scss';
5
+ export type FileListRenderItemProps = RenderItemProps<FileStorageItem> & {
6
+ children?: JSX.Element;
7
+ dropTargetItem?: FileStorageItem;
8
+ draggedItems?: FileStorageItem[];
9
+ isDragInProgress: boolean;
10
+ isDropTargetValid: boolean;
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
+ };
16
+ export declare function FileListItem(props: FileListRenderItemProps): JSX.Element;
17
+ export default FileListItem;
18
+ //# sourceMappingURL=FileListItem.d.ts.map
@@ -0,0 +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,YAAY,CAAC,EAAE,eAAe,EAAE,CAAC;IACjC,gBAAgB,EAAE,OAAO,CAAC;IAC1B,iBAAiB,EAAE,OAAO,CAAC;IAE3B,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,GAAG,IAAI,CAAC;IACrE,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,GAAG,IAAI,CAAC;IACpE,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,GAAG,IAAI,CAAC;IACnE,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,GAAG,IAAI,CAAC;CACjE,CAAC;AAEF,wBAAgB,YAAY,CAAC,KAAK,EAAE,uBAAuB,GAAG,GAAG,CAAC,OAAO,CA4ExE;AAED,eAAe,YAAY,CAAC"}
@@ -0,0 +1,118 @@
1
+ import React from 'react';
2
+ import { Tooltip } from '@deephaven/components';
3
+ import { dhPython, vsCode, vsFolder, vsFolderOpened } from '@deephaven/icons';
4
+ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
5
+ import classNames from 'classnames';
6
+ import { isDirectory } from "./FileStorage.js";
7
+ import "./FileList.css";
8
+ import FileUtils, { MIME_TYPE } from "./FileUtils.js";
9
+ import { getPathFromItem } from "./FileListUtils.js";
10
+ /**
11
+ * Get the icon definition for a file or folder item
12
+ * @param item Item to get the icon for
13
+ * @returns Icon definition to pass in the FontAwesomeIcon icon prop
14
+ */
15
+ function getItemIcon(item) {
16
+ if (isDirectory(item)) {
17
+ return item.isExpanded ? vsFolderOpened : vsFolder;
18
+ }
19
+ var mimeType = FileUtils.getMimeType(item.basename);
20
+ switch (mimeType) {
21
+ case MIME_TYPE.PYTHON:
22
+ return dhPython;
23
+ default:
24
+ return vsCode;
25
+ }
26
+ }
27
+ export function FileListItem(props) {
28
+ var _draggedItems$some;
29
+ var {
30
+ children,
31
+ draggedItems,
32
+ isDragInProgress,
33
+ isDropTargetValid,
34
+ isSelected,
35
+ item,
36
+ itemIndex,
37
+ dropTargetItem,
38
+ onDragStart,
39
+ onDragOver,
40
+ onDragEnd,
41
+ onDrop
42
+ } = props;
43
+ 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;
44
+ var itemPath = getPathFromItem(item);
45
+ var dropTargetPath = isDragInProgress && dropTargetItem ? getPathFromItem(dropTargetItem) : null;
46
+ var isExactDropTarget = isDragInProgress && isDropTargetValid && isDirectory(item) && dropTargetPath === itemPath;
47
+ var isInDropTarget = isDragInProgress && isDropTargetValid && dropTargetPath === itemPath;
48
+ var isInvalidDropTarget = isDragInProgress && !isDropTargetValid && dropTargetPath === itemPath;
49
+ var icon = getItemIcon(item);
50
+ var depth = FileUtils.getDepth(item.filename);
51
+ var depthLines = Array(depth).fill(null).map((value, index) =>
52
+ /*#__PURE__*/
53
+ // eslint-disable-next-line react/no-array-index-key
54
+ React.createElement("span", {
55
+ className: "file-list-depth-line",
56
+ key: index
57
+ }));
58
+ return /*#__PURE__*/React.createElement("div", {
59
+ className: classNames('d-flex w-100 align-items-center', 'file-list-item', {
60
+ 'is-dragged': isDragged,
61
+ 'is-exact-drop-target': isExactDropTarget,
62
+ 'is-in-drop-target': isInDropTarget,
63
+ 'is-invalid-drop-target': isInvalidDropTarget,
64
+ 'is-selected': isSelected
65
+ }),
66
+ onDragStart: function (_onDragStart) {
67
+ function onDragStart(_x) {
68
+ return _onDragStart.apply(this, arguments);
69
+ }
70
+ onDragStart.toString = function () {
71
+ return _onDragStart.toString();
72
+ };
73
+ return onDragStart;
74
+ }(e => onDragStart(itemIndex, e)),
75
+ onDragOver: function (_onDragOver) {
76
+ function onDragOver(_x2) {
77
+ return _onDragOver.apply(this, arguments);
78
+ }
79
+ onDragOver.toString = function () {
80
+ return _onDragOver.toString();
81
+ };
82
+ return onDragOver;
83
+ }(e => onDragOver(itemIndex, e)),
84
+ onDragEnd: function (_onDragEnd) {
85
+ function onDragEnd(_x3) {
86
+ return _onDragEnd.apply(this, arguments);
87
+ }
88
+ onDragEnd.toString = function () {
89
+ return _onDragEnd.toString();
90
+ };
91
+ return onDragEnd;
92
+ }(e => onDragEnd(itemIndex, e)),
93
+ onDrop: function (_onDrop) {
94
+ function onDrop(_x4) {
95
+ return _onDrop.apply(this, arguments);
96
+ }
97
+ onDrop.toString = function () {
98
+ return _onDrop.toString();
99
+ };
100
+ return onDrop;
101
+ }(e => onDrop(itemIndex, e)),
102
+ draggable: true,
103
+ role: "presentation",
104
+ "aria-label": item.basename
105
+ }, depthLines, ' ', /*#__PURE__*/React.createElement(FontAwesomeIcon, {
106
+ icon: icon,
107
+ className: "item-icon",
108
+ fixedWidth: true
109
+ }), ' ', /*#__PURE__*/React.createElement("span", {
110
+ className: "truncation-wrapper"
111
+ }, children !== null && children !== void 0 ? children : item.basename, /*#__PURE__*/React.createElement(Tooltip, {
112
+ options: {
113
+ placement: 'left'
114
+ }
115
+ }, children !== null && children !== void 0 ? children : item.basename)));
116
+ }
117
+ export default FileListItem;
118
+ //# sourceMappingURL=FileListItem.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FileListItem.js","names":["React","Tooltip","dhPython","vsCode","vsFolder","vsFolderOpened","FontAwesomeIcon","classNames","isDirectory","FileUtils","MIME_TYPE","getPathFromItem","getItemIcon","item","isExpanded","mimeType","getMimeType","basename","PYTHON","FileListItem","props","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","e","placement"],"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 ?? item.basename}\n <Tooltip\n options={{\n placement: 'left',\n }}\n >\n {children ?? item.basename}\n </Tooltip>\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,QAAQ,gCAAgC;AAChE,OAAOC,UAAU,MAAM,YAAY;AAAC,SACVC,WAAW;AAAA;AAAA,OAE9BC,SAAS,IAAIC,SAAS;AAAA,SACpBC,eAAe;AAExB;AACA;AACA;AACA;AACA;AACA,SAASC,WAAW,CAACC,IAAqB,EAAkB;EAC1D,IAAIL,WAAW,CAACK,IAAI,CAAC,EAAE;IACrB,OAAOA,IAAI,CAACC,UAAU,GAAGT,cAAc,GAAGD,QAAQ;EACpD;EACA,IAAMW,QAAQ,GAAGN,SAAS,CAACO,WAAW,CAACH,IAAI,CAACI,QAAQ,CAAC;EACrD,QAAQF,QAAQ;IACd,KAAKL,SAAS,CAACQ,MAAM;MACnB,OAAOhB,QAAQ;IACjB;MACE,OAAOC,MAAM;EAAC;AAEpB;AAeA,OAAO,SAASgB,YAAY,CAAC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,SAAS;MACvB,sBAAsB,EAAEM,iBAAiB;MACzC,mBAAmB,EAAEC,cAAc;MACnC,wBAAwB,EAAEC,mBAAmB;MAC7C,aAAa,EAAEf;IACjB,CAAC,CACD;IACF,WAAW;MAAA;QAAA;MAAA;MAAA;QAAA;MAAA;MAAA;IAAA,EAAE0B,CAAC,IAAIvB,WAAW,CAACF,SAAS,EAAEyB,CAAC,CAAC,CAAC;IAC5C,UAAU;MAAA;QAAA;MAAA;MAAA;QAAA;MAAA;MAAA;IAAA,EAAEA,CAAC,IAAItB,UAAU,CAACH,SAAS,EAAEyB,CAAC,CAAC,CAAC;IAC1C,SAAS;MAAA;QAAA;MAAA;MAAA;QAAA;MAAA;MAAA;IAAA,EAAEA,CAAC,IAAIrB,SAAS,CAACJ,SAAS,EAAEyB,CAAC,CAAC,CAAC;IACxC,MAAM;MAAA;QAAA;MAAA;MAAA;QAAA;MAAA;MAAA;IAAA,EAAEA,CAAC,IAAIpB,MAAM,CAACL,SAAS,EAAEyB,CAAC,CAAC,CAAC;IAClC,SAAS;IACT,IAAI,EAAC,cAAc;IACnB,cAAYtC,IAAI,CAACI;EAAS,GAEzB4B,UAAU,EAAE,GAAG,eAChB,oBAAC,eAAe;IAAC,IAAI,EAAEJ,IAAK;IAAC,SAAS,EAAC,WAAW;IAAC,UAAU;EAAA,EAAG,EAAC,GAAG,eACpE;IAAM,SAAS,EAAC;EAAoB,GACjCpB,QAAQ,aAARA,QAAQ,cAARA,QAAQ,GAAIR,IAAI,CAACI,QAAQ,eAC1B,oBAAC,OAAO;IACN,OAAO,EAAE;MACPmC,SAAS,EAAE;IACb;EAAE,GAED/B,QAAQ,aAARA,QAAQ,cAARA,QAAQ,GAAIR,IAAI,CAACI,QAAQ,CAClB,CACL,CACH;AAEV;AAEA,eAAeE,YAAY"}
@@ -0,0 +1,11 @@
1
+ import type { FileStorageItem } from './FileStorage';
2
+ export declare const DEFAULT_ROW_HEIGHT = 26;
3
+ export declare function getPathFromItem(file: FileStorageItem): string;
4
+ /**
5
+ * Get the move operation for the current selection and the given target. Throws if the operation is invalid.
6
+ */
7
+ export declare function getMoveOperation(draggedItems: FileStorageItem[], targetItem: FileStorageItem): {
8
+ files: FileStorageItem[];
9
+ targetPath: string;
10
+ };
11
+ //# sourceMappingURL=FileListUtils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FileListUtils.d.ts","sourceRoot":"","sources":["../src/FileListUtils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAGrD,eAAO,MAAM,kBAAkB,KAAK,CAAC;AAErC,wBAAgB,eAAe,CAAC,IAAI,EAAE,eAAe,GAAG,MAAM,CAI7D;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,YAAY,EAAE,eAAe,EAAE,EAC/B,UAAU,EAAE,eAAe,GAC1B;IAAE,KAAK,EAAE,eAAe,EAAE,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,CAyBlD"}
@@ -0,0 +1,34 @@
1
+ import { isDirectory } from "./FileStorage.js";
2
+ import FileUtils from "./FileUtils.js";
3
+ export var DEFAULT_ROW_HEIGHT = 26;
4
+ export function getPathFromItem(file) {
5
+ return isDirectory(file) ? FileUtils.makePath(file.filename) : FileUtils.getPath(file.filename);
6
+ }
7
+
8
+ /**
9
+ * Get the move operation for the current selection and the given target. Throws if the operation is invalid.
10
+ */
11
+ export function getMoveOperation(draggedItems, targetItem) {
12
+ if (draggedItems.length === 0 || targetItem == null) {
13
+ throw new Error('No items to move');
14
+ }
15
+ var targetPath = getPathFromItem(targetItem);
16
+ if (draggedItems.some(_ref => {
17
+ var {
18
+ filename
19
+ } = _ref;
20
+ return FileUtils.getPath(filename) === targetPath;
21
+ })) {
22
+ // Cannot drop if target is one of the dragged items is already in the target folder
23
+ throw new Error('File already in the destination folder');
24
+ }
25
+ if (draggedItems.some(item => isDirectory(item) && targetPath.startsWith(FileUtils.makePath(item.filename)))) {
26
+ // Cannot drop if target is a child of one of the directories being moved
27
+ throw new Error('Destination folder cannot be a child of a dragged folder');
28
+ }
29
+ return {
30
+ files: draggedItems,
31
+ targetPath
32
+ };
33
+ }
34
+ //# sourceMappingURL=FileListUtils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FileListUtils.js","names":["isDirectory","FileUtils","DEFAULT_ROW_HEIGHT","getPathFromItem","file","makePath","filename","getPath","getMoveOperation","draggedItems","targetItem","length","Error","targetPath","some","item","startsWith","files"],"sources":["../src/FileListUtils.ts"],"sourcesContent":["import { isDirectory } from './FileStorage';\nimport type { FileStorageItem } from './FileStorage';\nimport FileUtils from './FileUtils';\n\nexport const DEFAULT_ROW_HEIGHT = 26;\n\nexport function getPathFromItem(file: FileStorageItem): string {\n return isDirectory(file)\n ? FileUtils.makePath(file.filename)\n : FileUtils.getPath(file.filename);\n}\n\n/**\n * Get the move operation for the current selection and the given target. Throws if the operation is invalid.\n */\nexport function getMoveOperation(\n draggedItems: FileStorageItem[],\n targetItem: FileStorageItem\n): { files: FileStorageItem[]; targetPath: string } {\n if (draggedItems.length === 0 || targetItem == null) {\n throw new Error('No items to move');\n }\n\n const targetPath = getPathFromItem(targetItem);\n if (\n draggedItems.some(\n ({ filename }) => FileUtils.getPath(filename) === targetPath\n )\n ) {\n // Cannot drop if target is one of the dragged items is already in the target folder\n throw new Error('File already in the destination folder');\n }\n if (\n draggedItems.some(\n item =>\n isDirectory(item) &&\n targetPath.startsWith(FileUtils.makePath(item.filename))\n )\n ) {\n // Cannot drop if target is a child of one of the directories being moved\n throw new Error('Destination folder cannot be a child of a dragged folder');\n }\n return { files: draggedItems, targetPath };\n}\n"],"mappings":"SAASA,WAAW;AAAA,OAEbC,SAAS;AAEhB,OAAO,IAAMC,kBAAkB,GAAG,EAAE;AAEpC,OAAO,SAASC,eAAe,CAACC,IAAqB,EAAU;EAC7D,OAAOJ,WAAW,CAACI,IAAI,CAAC,GACpBH,SAAS,CAACI,QAAQ,CAACD,IAAI,CAACE,QAAQ,CAAC,GACjCL,SAAS,CAACM,OAAO,CAACH,IAAI,CAACE,QAAQ,CAAC;AACtC;;AAEA;AACA;AACA;AACA,OAAO,SAASE,gBAAgB,CAC9BC,YAA+B,EAC/BC,UAA2B,EACuB;EAClD,IAAID,YAAY,CAACE,MAAM,KAAK,CAAC,IAAID,UAAU,IAAI,IAAI,EAAE;IACnD,MAAM,IAAIE,KAAK,CAAC,kBAAkB,CAAC;EACrC;EAEA,IAAMC,UAAU,GAAGV,eAAe,CAACO,UAAU,CAAC;EAC9C,IACED,YAAY,CAACK,IAAI,CACf;IAAA,IAAC;MAAER;IAAS,CAAC;IAAA,OAAKL,SAAS,CAACM,OAAO,CAACD,QAAQ,CAAC,KAAKO,UAAU;EAAA,EAC7D,EACD;IACA;IACA,MAAM,IAAID,KAAK,CAAC,wCAAwC,CAAC;EAC3D;EACA,IACEH,YAAY,CAACK,IAAI,CACfC,IAAI,IACFf,WAAW,CAACe,IAAI,CAAC,IACjBF,UAAU,CAACG,UAAU,CAACf,SAAS,CAACI,QAAQ,CAACU,IAAI,CAACT,QAAQ,CAAC,CAAC,CAC3D,EACD;IACA;IACA,MAAM,IAAIM,KAAK,CAAC,0DAA0D,CAAC;EAC7E;EACA,OAAO;IAAEK,KAAK,EAAER,YAAY;IAAEI;EAAW,CAAC;AAC5C"}
package/dist/index.d.ts CHANGED
@@ -2,6 +2,8 @@ import FileExplorer from './FileExplorer';
2
2
  export * from './FileExplorer';
3
3
  export * from './FileListContainer';
4
4
  export * from './FileList';
5
+ export * from './FileListItem';
6
+ export * from './FileListUtils';
5
7
  export * from './FileStorage';
6
8
  export { default as FileExistsError } from './FileExistsError';
7
9
  export { default as FileNotFoundError } from './FileNotFoundError';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAE1C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qBAAqB,CAAC;AACpC,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACvE,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,aAAa,CAAC;AAEnD,eAAe,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAE1C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qBAAqB,CAAC;AACpC,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACvE,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,aAAa,CAAC;AAEnD,eAAe,YAAY,CAAC"}
package/dist/index.js CHANGED
@@ -2,6 +2,8 @@ import FileExplorer from "./FileExplorer.js";
2
2
  export * from "./FileExplorer.js";
3
3
  export * from "./FileListContainer.js";
4
4
  export * from "./FileList.js";
5
+ export * from "./FileListItem.js";
6
+ export * from "./FileListUtils.js";
5
7
  export * from "./FileStorage.js";
6
8
  export { default as FileExistsError } from "./FileExistsError.js";
7
9
  export { default as FileNotFoundError } from "./FileNotFoundError.js";
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["FileExplorer","default","FileExistsError","FileNotFoundError","SHORTCUTS","NewItemModal","FileExplorerToolbar","FileUtils"],"sources":["../src/index.ts"],"sourcesContent":["import FileExplorer from './FileExplorer';\n\nexport * from './FileExplorer';\nexport * from './FileListContainer';\nexport * from './FileList';\nexport * from './FileStorage';\nexport { default as FileExistsError } from './FileExistsError';\nexport { default as FileNotFoundError } from './FileNotFoundError';\nexport { default as SHORTCUTS } from './FileExplorerShortcuts';\nexport { default as NewItemModal } from './NewItemModal';\nexport { default as FileExplorerToolbar } from './FileExplorerToolbar';\nexport { default as FileUtils } from './FileUtils';\n\nexport default FileExplorer;\n"],"mappings":"OAAOA,YAAY;AAAA;AAAA;AAAA;AAAA;AAAA,SAMVC,OAAO,IAAIC,eAAe;AAAA,SAC1BD,OAAO,IAAIE,iBAAiB;AAAA,SAC5BF,OAAO,IAAIG,SAAS;AAAA,SACpBH,OAAO,IAAII,YAAY;AAAA,SACvBJ,OAAO,IAAIK,mBAAmB;AAAA,SAC9BL,OAAO,IAAIM,SAAS;AAE7B,eAAeP,YAAY"}
1
+ {"version":3,"file":"index.js","names":["FileExplorer","default","FileExistsError","FileNotFoundError","SHORTCUTS","NewItemModal","FileExplorerToolbar","FileUtils"],"sources":["../src/index.ts"],"sourcesContent":["import FileExplorer from './FileExplorer';\n\nexport * from './FileExplorer';\nexport * from './FileListContainer';\nexport * from './FileList';\nexport * from './FileListItem';\nexport * from './FileListUtils';\nexport * from './FileStorage';\nexport { default as FileExistsError } from './FileExistsError';\nexport { default as FileNotFoundError } from './FileNotFoundError';\nexport { default as SHORTCUTS } from './FileExplorerShortcuts';\nexport { default as NewItemModal } from './NewItemModal';\nexport { default as FileExplorerToolbar } from './FileExplorerToolbar';\nexport { default as FileUtils } from './FileUtils';\n\nexport default FileExplorer;\n"],"mappings":"OAAOA,YAAY;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,SAQVC,OAAO,IAAIC,eAAe;AAAA,SAC1BD,OAAO,IAAIE,iBAAiB;AAAA,SAC5BF,OAAO,IAAIG,SAAS;AAAA,SACpBH,OAAO,IAAII,YAAY;AAAA,SACvBJ,OAAO,IAAIK,mBAAmB;AAAA,SAC9BL,OAAO,IAAIM,SAAS;AAE7B,eAAeP,YAAY"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deephaven/file-explorer",
3
- "version": "0.32.0",
3
+ "version": "0.32.1-auth-plugins.7+ac63f536",
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.32.0",
26
- "@deephaven/icons": "^0.32.0",
27
- "@deephaven/log": "^0.32.0",
28
- "@deephaven/storage": "^0.32.0",
29
- "@deephaven/utils": "^0.32.0",
25
+ "@deephaven/components": "^0.32.1-auth-plugins.7+ac63f536",
26
+ "@deephaven/icons": "^0.32.1-auth-plugins.7+ac63f536",
27
+ "@deephaven/log": "^0.32.1-auth-plugins.7+ac63f536",
28
+ "@deephaven/storage": "^0.32.1-auth-plugins.7+ac63f536",
29
+ "@deephaven/utils": "^0.32.1-auth-plugins.7+ac63f536",
30
30
  "@fortawesome/fontawesome-svg-core": "^6.2.1",
31
31
  "@fortawesome/react-fontawesome": "^0.2.0",
32
32
  "classnames": "^2.3.1",
@@ -37,8 +37,8 @@
37
37
  "react": "^17.0.0"
38
38
  },
39
39
  "devDependencies": {
40
- "@deephaven/mocks": "^0.32.0",
41
- "@deephaven/tsconfig": "^0.32.0"
40
+ "@deephaven/mocks": "^0.32.1-auth-plugins.7+ac63f536",
41
+ "@deephaven/tsconfig": "^0.32.1-auth-plugins.7+ac63f536"
42
42
  },
43
43
  "files": [
44
44
  "dist"
@@ -46,5 +46,5 @@
46
46
  "publishConfig": {
47
47
  "access": "public"
48
48
  },
49
- "gitHead": "a60bda5c1eae60835987b3ced6d0d8f61ea23f19"
49
+ "gitHead": "ac63f5369c73a01cb1e4e1ac6825138535e91bc1"
50
50
  }