@floegence/floe-webapp-core 0.48.3 → 0.48.5

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.
@@ -0,0 +1,9 @@
1
+ export type ArchiveFileFormat = 'zip' | '7z' | 'rar' | 'tar' | 'tar.gz' | 'tar.bz2' | 'tar.xz' | 'tar.zst' | 'gz' | 'bz2' | 'xz' | 'zst';
2
+ export type ArchiveFileKind = 'archive' | 'compressed-file' | 'multipart';
3
+ export interface ArchiveFileClassification {
4
+ format: ArchiveFileFormat;
5
+ kind: ArchiveFileKind;
6
+ defaultOutputName: string;
7
+ }
8
+ /** Classifies common archive and single-file compression names without reading file contents. */
9
+ export declare function classifyArchiveFileName(input: string): ArchiveFileClassification | undefined;
@@ -0,0 +1,73 @@
1
+ const e = [
2
+ { suffix: ".tar.gz", format: "tar.gz", kind: "archive" },
3
+ { suffix: ".tar.bz2", format: "tar.bz2", kind: "archive" },
4
+ { suffix: ".tar.xz", format: "tar.xz", kind: "archive" },
5
+ { suffix: ".tar.zst", format: "tar.zst", kind: "archive" },
6
+ { suffix: ".tgz", format: "tar.gz", kind: "archive" },
7
+ { suffix: ".tbz2", format: "tar.bz2", kind: "archive" },
8
+ { suffix: ".txz", format: "tar.xz", kind: "archive" },
9
+ { suffix: ".tzst", format: "tar.zst", kind: "archive" },
10
+ { suffix: ".zip", format: "zip", kind: "archive" },
11
+ { suffix: ".7z", format: "7z", kind: "archive" },
12
+ { suffix: ".rar", format: "rar", kind: "archive" },
13
+ { suffix: ".tar", format: "tar", kind: "archive" },
14
+ { suffix: ".gz", format: "gz", kind: "compressed-file" },
15
+ { suffix: ".bz2", format: "bz2", kind: "compressed-file" },
16
+ { suffix: ".xz", format: "xz", kind: "compressed-file" },
17
+ { suffix: ".zst", format: "zst", kind: "compressed-file" }
18
+ ];
19
+ function d(t) {
20
+ const i = t.trim().split(/[\\/]/);
21
+ return i[i.length - 1] ?? "";
22
+ }
23
+ function n(t, i) {
24
+ return t.slice(0, -i).trim() || t;
25
+ }
26
+ function m(t, i) {
27
+ const f = i.match(/^(.*)\.part\d+\.rar$/u);
28
+ if (f)
29
+ return {
30
+ format: "rar",
31
+ kind: "multipart",
32
+ defaultOutputName: t.slice(0, f[1].length) || t
33
+ };
34
+ const a = i.match(/^(.*)\.r\d{2,3}$/u);
35
+ if (a)
36
+ return {
37
+ format: "rar",
38
+ kind: "multipart",
39
+ defaultOutputName: t.slice(0, a[1].length) || t
40
+ };
41
+ const r = i.match(/^(.*)\.z\d{2,3}$/u);
42
+ if (r)
43
+ return {
44
+ format: "zip",
45
+ kind: "multipart",
46
+ defaultOutputName: t.slice(0, r[1].length) || t
47
+ };
48
+ const u = i.match(/^(.*)\.(\d{3,})$/u);
49
+ if (!u) return;
50
+ const o = u[1] ?? "", s = e.find((c) => o.endsWith(c.suffix));
51
+ if (s)
52
+ return {
53
+ format: s.format,
54
+ kind: "multipart",
55
+ defaultOutputName: n(t, u[2].length + 1 + s.suffix.length)
56
+ };
57
+ }
58
+ function l(t) {
59
+ const i = d(t);
60
+ if (!i) return;
61
+ const f = i.toLowerCase(), a = m(i, f);
62
+ if (a) return a;
63
+ const r = e.find((u) => f.endsWith(u.suffix));
64
+ if (r)
65
+ return {
66
+ format: r.format,
67
+ kind: r.kind,
68
+ defaultOutputName: n(i, r.suffix.length)
69
+ };
70
+ }
71
+ export {
72
+ l as classifyArchiveFileName
73
+ };
@@ -1,12 +1,13 @@
1
1
  export { FileBrowser, type FileBrowserProps } from './FileBrowser';
2
- export { FileBrowserProvider, useFileBrowser, type FileBrowserProviderProps } from './FileBrowserContext';
2
+ export { FileBrowserProvider, useFileBrowser, type FileBrowserProviderProps, } from './FileBrowserContext';
3
3
  export { DirectoryTree, type DirectoryTreeProps } from './DirectoryTree';
4
4
  export { FileListView, type FileListViewProps } from './FileListView';
5
5
  export { FileGridView, type FileGridViewProps } from './FileGridView';
6
- export { FileContextMenu, type FileContextMenuProps, type BuiltinContextMenuAction, type HideItemsValue } from './FileContextMenu';
6
+ export { FileContextMenu, type FileContextMenuProps, type BuiltinContextMenuAction, type HideItemsValue, } from './FileContextMenu';
7
7
  export { Breadcrumb, type BreadcrumbProps } from './Breadcrumb';
8
8
  export { FileBrowserToolbar, type FileBrowserToolbarProps } from './FileBrowserToolbar';
9
9
  export { FileBrowserStatusBar, type FileBrowserStatusBarProps } from './FileBrowserStatusBar';
10
10
  export { FileBrowserDragPreview } from './DragPreview';
11
- export { FolderIcon, FolderOpenIcon, SymlinkFolderIcon, SymlinkFolderOpenIcon, FileIcon, SymlinkFileIcon, BrokenSymlinkIcon, CodeFileIcon, JavaScriptFileIcon, TypeScriptFileIcon, ShellScriptFileIcon, ImageFileIcon, VideoFileIcon, AudioFileIcon, DocumentFileIcon, ConfigFileIcon, StyleFileIcon, FileItemIcon, getFileIcon, resolveFileItemIcon, } from './FileIcons';
11
+ export { FolderIcon, FolderOpenIcon, SymlinkFolderIcon, SymlinkFolderOpenIcon, FileIcon, SymlinkFileIcon, BrokenSymlinkIcon, ArchiveFileIcon, CodeFileIcon, JavaScriptFileIcon, TypeScriptFileIcon, ShellScriptFileIcon, ImageFileIcon, VideoFileIcon, AudioFileIcon, DocumentFileIcon, ConfigFileIcon, StyleFileIcon, FileItemIcon, getFileIcon, resolveFileItemIcon, } from './FileIcons';
12
+ export { classifyArchiveFileName, type ArchiveFileClassification, type ArchiveFileFormat, type ArchiveFileKind, } from './archiveFiles';
12
13
  export type { FileItem, FileItemIconOverride, FileItemDecoration, FileItemDecorationBadge, FileItemDecorationTone, FileItemLinkKind, FileItemLinkTargetType, FileItemLinkMeta, FileBrowserRevealClearFilter, FileBrowserRevealRequest, ViewMode, SortField, SortDirection, SortConfig, FileListColumnRatios, FileBrowserContextValue, ContextMenuActionType, ContextMenuTargetKind, ContextMenuSource, ContextMenuDirectory, ContextMenuItem, ContextMenuEvent, ContextMenuCallbacks, OptimisticUpdateType, OptimisticRemove, OptimisticUpdate, OptimisticInsert, OptimisticOperation, ReplaceSelectionOptions, ScrollPosition, } from './types';
@@ -1,44 +1,47 @@
1
- import { AudioFileIcon as r, BrokenSymlinkIcon as i, CodeFileIcon as l, ConfigFileIcon as n, DocumentFileIcon as F, FileIcon as c, FileItemIcon as t, FolderIcon as I, FolderOpenIcon as m, ImageFileIcon as p, JavaScriptFileIcon as f, ShellScriptFileIcon as x, StyleFileIcon as d, SymlinkFileIcon as s, SymlinkFolderIcon as S, SymlinkFolderOpenIcon as w, TypeScriptFileIcon as B, VideoFileIcon as a, getFileIcon as y, resolveFileItemIcon as u } from "./components/file-browser/FileIcons.js";
1
+ import { ArchiveFileIcon as r, AudioFileIcon as i, BrokenSymlinkIcon as l, CodeFileIcon as n, ConfigFileIcon as c, DocumentFileIcon as F, FileIcon as t, FileItemIcon as I, FolderIcon as m, FolderOpenIcon as p, ImageFileIcon as f, JavaScriptFileIcon as x, ShellScriptFileIcon as s, StyleFileIcon as a, SymlinkFileIcon as d, SymlinkFolderIcon as S, SymlinkFolderOpenIcon as w, TypeScriptFileIcon as B, VideoFileIcon as y, getFileIcon as u, resolveFileItemIcon as v } from "./components/file-browser/FileIcons.js";
2
2
  import { Breadcrumb as g } from "./components/file-browser/Breadcrumb.js";
3
- import { DirectoryTree as C } from "./components/file-browser/DirectoryTree.js";
4
- import { FileBrowser as T } from "./components/file-browser/FileBrowser.js";
5
- import { FileBrowserDragPreview as b } from "./components/file-browser/DragPreview.js";
6
- import { FileBrowserProvider as P, useFileBrowser as h } from "./components/file-browser/FileBrowserContext.js";
7
- import { FileBrowserStatusBar as G } from "./components/file-browser/FileBrowserStatusBar.js";
8
- import { FileBrowserToolbar as L } from "./components/file-browser/FileBrowserToolbar.js";
3
+ import { DirectoryTree as A } from "./components/file-browser/DirectoryTree.js";
4
+ import { FileBrowser as D } from "./components/file-browser/FileBrowser.js";
5
+ import { FileBrowserDragPreview as V } from "./components/file-browser/DragPreview.js";
6
+ import { FileBrowserProvider as O, useFileBrowser as P } from "./components/file-browser/FileBrowserContext.js";
7
+ import { FileBrowserStatusBar as J } from "./components/file-browser/FileBrowserStatusBar.js";
8
+ import { FileBrowserToolbar as M } from "./components/file-browser/FileBrowserToolbar.js";
9
9
  import { FileContextMenu as j } from "./components/file-browser/FileContextMenu.js";
10
10
  import { FileGridView as z } from "./components/file-browser/FileGridView.js";
11
11
  import { FileListView as H } from "./components/file-browser/FileListView.js";
12
+ import { classifyArchiveFileName as Q } from "./components/file-browser/archiveFiles.js";
12
13
  export {
13
- r as AudioFileIcon,
14
+ r as ArchiveFileIcon,
15
+ i as AudioFileIcon,
14
16
  g as Breadcrumb,
15
- i as BrokenSymlinkIcon,
16
- l as CodeFileIcon,
17
- n as ConfigFileIcon,
18
- C as DirectoryTree,
17
+ l as BrokenSymlinkIcon,
18
+ n as CodeFileIcon,
19
+ c as ConfigFileIcon,
20
+ A as DirectoryTree,
19
21
  F as DocumentFileIcon,
20
- T as FileBrowser,
21
- b as FileBrowserDragPreview,
22
- P as FileBrowserProvider,
23
- G as FileBrowserStatusBar,
24
- L as FileBrowserToolbar,
22
+ D as FileBrowser,
23
+ V as FileBrowserDragPreview,
24
+ O as FileBrowserProvider,
25
+ J as FileBrowserStatusBar,
26
+ M as FileBrowserToolbar,
25
27
  j as FileContextMenu,
26
28
  z as FileGridView,
27
- c as FileIcon,
28
- t as FileItemIcon,
29
+ t as FileIcon,
30
+ I as FileItemIcon,
29
31
  H as FileListView,
30
- I as FolderIcon,
31
- m as FolderOpenIcon,
32
- p as ImageFileIcon,
33
- f as JavaScriptFileIcon,
34
- x as ShellScriptFileIcon,
35
- d as StyleFileIcon,
36
- s as SymlinkFileIcon,
32
+ m as FolderIcon,
33
+ p as FolderOpenIcon,
34
+ f as ImageFileIcon,
35
+ x as JavaScriptFileIcon,
36
+ s as ShellScriptFileIcon,
37
+ a as StyleFileIcon,
38
+ d as SymlinkFileIcon,
37
39
  S as SymlinkFolderIcon,
38
40
  w as SymlinkFolderOpenIcon,
39
41
  B as TypeScriptFileIcon,
40
- a as VideoFileIcon,
41
- y as getFileIcon,
42
- u as resolveFileItemIcon,
43
- h as useFileBrowser
42
+ y as VideoFileIcon,
43
+ Q as classifyArchiveFileName,
44
+ u as getFileIcon,
45
+ v as resolveFileItemIcon,
46
+ P as useFileBrowser
44
47
  };