@floegence/floe-webapp-core 0.48.4 → 0.48.6

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,9 +1,9 @@
1
1
  import { isTypingElement as s } from "../../utils/dom.js";
2
- const g = "data-floe-local-interaction-surface", i = `[${g}="true"]`, A = "data-floe-canvas-wheel-interactive", R = `[${A}="true"]`, m = "data-floe-workbench-widget-shell", f = `[${m}="true"]`, L = "data-floe-workbench-widget-activation-surface", S = `[${L}="true"]`, C = "data-floe-workbench-text-selection-surface", _ = `[${C}="true"]`;
2
+ const g = "data-floe-local-interaction-surface", i = `[${g}="true"]`, A = "data-floe-canvas-wheel-interactive", m = `[${A}="true"]`, R = "data-floe-workbench-widget-shell", f = `[${R}="true"]`, L = "data-floe-workbench-widget-activation-surface", S = `[${L}="true"]`, h = "data-floe-workbench-text-selection-surface", _ = `[${h}="true"]`;
3
3
  function u(e) {
4
4
  return typeof Element < "u" && e instanceof Element ? e : typeof Node < "u" && e instanceof Node ? e.parentElement : null;
5
5
  }
6
- function h(e) {
6
+ function C(e) {
7
7
  if (!e || typeof HTMLElement > "u" || !(e instanceof HTMLElement))
8
8
  return !1;
9
9
  if (e.matches("button, input, select, textarea, summary") || e.matches("a[href], area[href]") || e.matches('iframe, [contenteditable="true"]')) return !0;
@@ -13,7 +13,7 @@ function h(e) {
13
13
  function w(e, n) {
14
14
  let l = e;
15
15
  for (; l && l !== n; ) {
16
- if (s(l) || h(l))
16
+ if (s(l) || C(l))
17
17
  return !0;
18
18
  l = l.parentElement;
19
19
  }
@@ -33,7 +33,7 @@ function I(e) {
33
33
  const {
34
34
  target: n,
35
35
  localInteractionSurfaceSelector: l = i,
36
- wheelInteractiveSelector: o = R
36
+ wheelInteractiveSelector: o = m
37
37
  } = e, r = u(n);
38
38
  return r ? s(r) ? "typing_element" : r.closest(l) !== null ? "local_interaction_surface" : r.closest(o) !== null ? "wheel_interactive" : null : null;
39
39
  }
@@ -84,7 +84,7 @@ function H(e) {
84
84
  return null;
85
85
  let c = t;
86
86
  for (; c && c !== a; ) {
87
- if (c instanceof HTMLElement && s(c))
87
+ if (c instanceof HTMLElement && (s(c) || c.matches("iframe")))
88
88
  return c;
89
89
  c = c.parentElement;
90
90
  }
@@ -92,15 +92,15 @@ function H(e) {
92
92
  }
93
93
  export {
94
94
  A as CANVAS_WHEEL_INTERACTIVE_ATTR,
95
- R as DEFAULT_CANVAS_WHEEL_INTERACTIVE_SELECTOR,
95
+ m as DEFAULT_CANVAS_WHEEL_INTERACTIVE_SELECTOR,
96
96
  i as DEFAULT_LOCAL_INTERACTION_SURFACE_SELECTOR,
97
97
  _ as DEFAULT_WORKBENCH_TEXT_SELECTION_SURFACE_SELECTOR,
98
98
  S as DEFAULT_WORKBENCH_WIDGET_ACTIVATION_SURFACE_SELECTOR,
99
99
  f as DEFAULT_WORKBENCH_WIDGET_SHELL_SELECTOR,
100
100
  g as LOCAL_INTERACTION_SURFACE_ATTR,
101
- C as WORKBENCH_TEXT_SELECTION_SURFACE_ATTR,
101
+ h as WORKBENCH_TEXT_SELECTION_SURFACE_ATTR,
102
102
  L as WORKBENCH_WIDGET_ACTIVATION_SURFACE_ATTR,
103
- m as WORKBENCH_WIDGET_SHELL_ATTR,
103
+ R as WORKBENCH_WIDGET_SHELL_ATTR,
104
104
  N as isLocalInteractionSurfaceTarget,
105
105
  d as resolveSurfaceInteractionTargetRole,
106
106
  O as resolveSurfaceWheelRouting,
@@ -130,8 +130,8 @@ function Qe(i) {
130
130
  widgetRoot: w ?? null,
131
131
  interactiveSelector: h().interactiveSelector,
132
132
  panSurfaceSelector: h().panSurfaceSelector
133
- }), ae = () => {
134
- F(), w?.focus({
133
+ }), ae = (t) => {
134
+ F(), t?.focus !== !1 && w?.focus({
135
135
  preventScroll: !0
136
136
  });
137
137
  }, _t = (t) => {
@@ -103,7 +103,10 @@ export interface WorkbenchWidgetBodyProps<TWidgetType extends string = Workbench
103
103
  motion?: WorkbenchWidgetMotionIntent | null;
104
104
  selected?: boolean;
105
105
  filtered?: boolean;
106
- requestActivate?: () => void;
106
+ /** Select and raise the widget. Set focus to false for local or embedded input observations. */
107
+ requestActivate?: (options?: {
108
+ focus?: boolean;
109
+ }) => void;
107
110
  }
108
111
  export interface WorkbenchWidgetDefinition<TWidgetType extends string = WorkbenchWidgetType> {
109
112
  type: TWidgetType;
@@ -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
  };