@floegence/floe-webapp-core 0.35.32 → 0.35.34

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. package/dist/components/file-browser/DirectoryTree.js +84 -86
  2. package/dist/components/file-browser/FileContextMenu.d.ts +2 -2
  3. package/dist/components/file-browser/FileContextMenu.js +300 -142
  4. package/dist/components/file-browser/FileGridView.js +50 -45
  5. package/dist/components/file-browser/FileIcons.d.ts +10 -2
  6. package/dist/components/file-browser/FileIcons.js +289 -181
  7. package/dist/components/file-browser/FileListView.js +99 -94
  8. package/dist/components/file-browser/contextMenuEvent.d.ts +10 -0
  9. package/dist/components/file-browser/contextMenuEvent.js +19 -0
  10. package/dist/components/file-browser/index.d.ts +2 -2
  11. package/dist/components/file-browser/longPressContextMenu.d.ts +1 -0
  12. package/dist/components/file-browser/longPressContextMenu.js +45 -32
  13. package/dist/components/file-browser/types.d.ts +23 -1
  14. package/dist/components/layout/Shell.d.ts +8 -0
  15. package/dist/components/layout/Shell.js +157 -138
  16. package/dist/components/layout/Sidebar.d.ts +2 -0
  17. package/dist/components/layout/Sidebar.js +39 -38
  18. package/dist/components/layout/sidebarVisibilityMotion.d.ts +22 -0
  19. package/dist/components/layout/sidebarVisibilityMotion.js +16 -0
  20. package/dist/components/ui/Dropdown.d.ts +0 -1
  21. package/dist/components/ui/Dropdown.js +150 -204
  22. package/dist/components/ui/menuUtils.d.ts +15 -0
  23. package/dist/components/ui/menuUtils.js +60 -0
  24. package/dist/components/ui/picker/PickerBase.js +90 -96
  25. package/dist/context/LayoutContext.d.ts +5 -0
  26. package/dist/context/LayoutContext.js +58 -46
  27. package/dist/file-browser.js +35 -31
  28. package/dist/full.js +411 -407
  29. package/package.json +1 -1
@@ -1,39 +1,40 @@
1
- import { insert as s, createComponent as o, effect as D, className as b, template as h, setAttribute as Y, spread as q, mergeProps as z, memo as _, setStyleProperty as J, delegateEvents as K } from "solid-js/web";
2
- import { createMemo as T, For as Q, untrack as W, createSignal as Z, Show as v } from "solid-js";
3
- import { cn as m } from "../../utils/cn.js";
4
- import { useFileBrowser as E } from "./FileBrowserContext.js";
1
+ import { insert as l, createComponent as s, effect as v, className as D, template as m, setAttribute as X, spread as Y, mergeProps as q, memo as z, setStyleProperty as J, delegateEvents as K } from "solid-js/web";
2
+ import { createMemo as I, For as Q, untrack as W, createSignal as Z, Show as w } from "solid-js";
3
+ import { cn as f } from "../../utils/cn.js";
4
+ import { useFileBrowser as _ } from "./FileBrowserContext.js";
5
5
  import { useFileBrowserDrag as ee } from "../../context/FileBrowserDragContext.js";
6
- import { FolderOpenIcon as te, FolderIcon as ne } from "./FileIcons.js";
7
- import { ChevronRight as re } from "../icons/index.js";
8
- import { createLongPressContextMenuHandlers as ie } from "./longPressContextMenu.js";
9
- import { fileBrowserTouchTargetAttrs as ae } from "./touchInteractionGuard.js";
10
- var M = /* @__PURE__ */ h("<div>"), oe = /* @__PURE__ */ h("<button type=button>"), le = /* @__PURE__ */ h('<span class="ml-auto mr-2 text-[10px] text-muted-foreground/60 opacity-0 group-hover:opacity-100 transition-opacity">'), se = /* @__PURE__ */ h('<div class="flex flex-col"><div><button type=button><span class="flex-shrink-0 w-4 h-4"></span><span class=truncate>'), ce = /* @__PURE__ */ h('<span class="flex-shrink-0 w-3.5 h-3.5">');
11
- function Ce(e) {
12
- const l = E(), i = ee(), C = () => (e.enableDragDrop ?? !0) && !!i, x = () => e.instanceId ?? "default", d = T(() => l.files().filter((r) => r.type === "folder"));
6
+ import { FileItemIcon as te } from "./FileIcons.js";
7
+ import { ChevronRight as ne } from "../icons/index.js";
8
+ import { createLongPressContextMenuHandlers as re } from "./longPressContextMenu.js";
9
+ import { fileBrowserTouchTargetAttrs as ie } from "./touchInteractionGuard.js";
10
+ import { createItemContextMenuEvent as ae } from "./contextMenuEvent.js";
11
+ var k = /* @__PURE__ */ m("<div>"), oe = /* @__PURE__ */ m("<button type=button>"), le = /* @__PURE__ */ m('<span class="ml-auto mr-2 text-[10px] text-muted-foreground/60 opacity-0 group-hover:opacity-100 transition-opacity">'), se = /* @__PURE__ */ m('<div class="flex flex-col"><div><button type=button><span class="flex-shrink-0 w-4 h-4"></span><span class=truncate>'), ce = /* @__PURE__ */ m('<span class="flex-shrink-0 w-3.5 h-3.5">');
12
+ function ye(e) {
13
+ const o = _(), i = ee(), b = () => (e.enableDragDrop ?? !0) && !!i, h = () => e.instanceId ?? "default", g = I(() => o.files().filter((r) => r.type === "folder"));
13
14
  return (() => {
14
- var r = M();
15
- return r.$$contextmenu = (y) => y.preventDefault(), s(r, o(F, {
15
+ var r = k();
16
+ return r.$$contextmenu = (C) => C.preventDefault(), l(r, s(M, {
16
17
  get items() {
17
- return d();
18
+ return g();
18
19
  },
19
20
  depth: 0,
20
21
  get instanceId() {
21
- return x();
22
+ return h();
22
23
  },
23
24
  get enableDragDrop() {
24
- return C();
25
+ return b();
25
26
  },
26
27
  dragContext: i
27
- })), D(() => b(r, m("flex flex-col", e.class))), r;
28
+ })), v(() => D(r, f("flex flex-col", e.class))), r;
28
29
  })();
29
30
  }
30
- function F(e) {
31
- const l = T(() => e.items.filter((i) => i.type === "folder"));
32
- return o(Q, {
31
+ function M(e) {
32
+ const o = I(() => e.items.filter((i) => i.type === "folder"));
33
+ return s(Q, {
33
34
  get each() {
34
- return l();
35
+ return o();
35
36
  },
36
- children: (i) => o(de, {
37
+ children: (i) => s(ge, {
37
38
  item: i,
38
39
  get depth() {
39
40
  return e.depth;
@@ -50,110 +51,107 @@ function F(e) {
50
51
  })
51
52
  });
52
53
  }
53
- function de(e) {
54
- const l = E(), i = () => l.isExpanded(e.item.path), C = () => l.currentPath() === e.item.path, x = W(() => e.item), d = ie(l, x, {
55
- selectOnOpen: !1
54
+ function ge(e) {
55
+ const o = _(), i = () => o.isExpanded(e.item.path), b = () => o.currentPath() === e.item.path, h = W(() => e.item), g = re(o, h, {
56
+ selectOnOpen: !1,
57
+ source: "tree"
56
58
  });
57
59
  let r;
58
- const [y, I] = Z(!1), L = () => r === "touch" || r === "pen", p = T(() => e.item.children?.filter((t) => t.type === "folder").length ?? 0), u = () => p() > 0, $ = () => {
60
+ const [C, T] = Z(!1), F = () => r === "touch" || r === "pen", $ = I(() => e.item.children?.filter((t) => t.type === "folder").length ?? 0), x = () => $() > 0, p = () => {
59
61
  if (!e.enableDragDrop || !e.dragContext) return !1;
60
62
  const t = e.dragContext.dragState();
61
63
  return t.isDragging ? e.dragContext.canDropOn(t.draggedItems, e.item.path, e.item, e.instanceId) : !1;
62
- }, O = () => e.dragContext?.dragState(), A = () => O()?.isDragging ?? !1, k = () => y() && A() && e.enableDragDrop, B = (t) => {
63
- r = t.pointerType, d.onPointerDown(t);
64
+ }, L = () => e.dragContext?.dragState(), A = () => L()?.isDragging ?? !1, E = () => C() && A() && e.enableDragDrop, B = (t) => {
65
+ r = t.pointerType, g.onPointerDown(t);
66
+ }, O = (t) => {
67
+ r = t.pointerType, g.onPointerMove(t);
64
68
  }, H = (t) => {
65
- r = t.pointerType, d.onPointerMove(t);
69
+ r = t.pointerType, g.onPointerUp();
66
70
  }, N = (t) => {
67
- r = t.pointerType, d.onPointerUp();
71
+ r = t.pointerType, g.onPointerCancel();
68
72
  }, R = (t) => {
69
- r = t.pointerType, d.onPointerCancel();
70
- }, U = (t) => {
71
73
  if (!e.enableDragDrop || !e.dragContext) return;
72
74
  const a = e.dragContext.dragState();
73
75
  if (!a.isDragging) return;
74
- I(!0);
75
- const g = e.dragContext.canDropOn(a.draggedItems, e.item.path, e.item, e.instanceId), P = t.currentTarget?.getBoundingClientRect() ?? null;
76
+ T(!0);
77
+ const d = e.dragContext.canDropOn(a.draggedItems, e.item.path, e.item, e.instanceId), P = t.currentTarget?.getBoundingClientRect() ?? null;
76
78
  e.dragContext.setDropTarget({
77
79
  instanceId: e.instanceId,
78
80
  targetPath: e.item.path,
79
81
  targetItem: e.item
80
- }, g, P);
81
- }, V = (t) => {
82
+ }, d, P);
83
+ }, U = (t) => {
82
84
  if (!e.dragContext) return;
83
- I(!1);
85
+ T(!1);
84
86
  const a = e.dragContext.dragState();
85
87
  a.isDragging && a.dropTarget?.targetPath === e.item.path && e.dragContext.setDropTarget(null, !1);
88
+ }, V = (t) => {
89
+ g.consumeClickSuppression(t) || o.navigateTo(h);
86
90
  }, j = (t) => {
87
- d.consumeClickSuppression(t) || l.navigateTo(x);
88
- }, G = (t) => {
89
- t.preventDefault(), t.stopPropagation(), !L() && l.showContextMenu({
91
+ t.preventDefault(), t.stopPropagation(), !F() && o.showContextMenu(ae({
90
92
  x: t.clientX,
91
93
  y: t.clientY,
92
- items: [e.item]
93
- });
94
- }, X = () => {
95
- u() && l.toggleFolder(e.item.path);
94
+ triggerItem: e.item,
95
+ items: [e.item],
96
+ source: "tree"
97
+ }));
98
+ }, G = () => {
99
+ x() && o.toggleFolder(e.item.path);
96
100
  };
97
101
  return (() => {
98
- var t = se(), a = t.firstChild, g = a.firstChild, w = g.firstChild, P = w.nextSibling;
99
- return a.addEventListener("pointerleave", V), a.addEventListener("pointerenter", U), s(a, o(v, {
102
+ var t = se(), a = t.firstChild, d = a.firstChild, y = d.firstChild, P = y.nextSibling;
103
+ return a.addEventListener("pointerleave", U), a.addEventListener("pointerenter", R), l(a, s(w, {
100
104
  get when() {
101
- return u();
105
+ return x();
102
106
  },
103
107
  get fallback() {
104
108
  return ce();
105
109
  },
106
110
  get children() {
107
111
  var n = oe();
108
- return n.$$click = X, s(n, o(re, {
112
+ return n.$$click = G, l(n, s(ne, {
109
113
  class: "w-3 h-3 opacity-50"
110
- })), D((c) => {
111
- var f = m("flex-shrink-0 w-3.5 h-3.5 flex items-center justify-center cursor-pointer", "transition-transform duration-150", i() && "rotate-90", "focus:outline-none focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-sidebar-ring"), S = i() ? "Collapse folder" : "Expand folder";
112
- return f !== c.e && b(n, c.e = f), S !== c.t && Y(n, "aria-label", c.t = S), c;
114
+ })), v((c) => {
115
+ var u = f("flex-shrink-0 w-3.5 h-3.5 flex items-center justify-center cursor-pointer", "transition-transform duration-150", i() && "rotate-90", "focus:outline-none focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-sidebar-ring"), S = i() ? "Collapse folder" : "Expand folder";
116
+ return u !== c.e && D(n, c.e = u), S !== c.t && X(n, "aria-label", c.t = S), c;
113
117
  }, {
114
118
  e: void 0,
115
119
  t: void 0
116
120
  }), n;
117
121
  }
118
- }), g), q(g, z(ae, {
119
- onClick: j,
120
- onContextMenu: G,
122
+ }), d), Y(d, q(ie, {
123
+ onClick: V,
124
+ onContextMenu: j,
121
125
  onPointerDown: B,
122
- onPointerMove: H,
123
- onPointerUp: N,
124
- onPointerCancel: R,
126
+ onPointerMove: O,
127
+ onPointerUp: H,
128
+ onPointerCancel: N,
125
129
  get class() {
126
- return m("flex items-center gap-1 flex-1 min-w-0 text-left cursor-pointer pl-1", "focus:outline-none focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-sidebar-ring");
130
+ return f("flex items-center gap-1 flex-1 min-w-0 text-left cursor-pointer pl-1", "focus:outline-none focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-sidebar-ring");
127
131
  }
128
- }), !1, !0), s(w, o(v, {
129
- get when() {
130
- return _(() => !!u())() && i();
132
+ }), !1, !0), l(y, s(te, {
133
+ get item() {
134
+ return e.item;
131
135
  },
132
- get fallback() {
133
- return o(ne, {
134
- class: "w-4 h-4"
135
- });
136
+ get open() {
137
+ return i();
136
138
  },
137
- get children() {
138
- return o(te, {
139
- class: "w-4 h-4"
140
- });
141
- }
142
- })), s(P, () => e.item.name), s(g, o(v, {
139
+ class: "w-4 h-4"
140
+ })), l(P, () => e.item.name), l(d, s(w, {
143
141
  get when() {
144
- return u();
142
+ return x();
145
143
  },
146
144
  get children() {
147
145
  var n = le();
148
- return s(n, p), n;
146
+ return l(n, $), n;
149
147
  }
150
- }), null), s(t, o(v, {
148
+ }), null), l(t, s(w, {
151
149
  get when() {
152
- return _(() => !!i())() && u();
150
+ return z(() => !!i())() && x();
153
151
  },
154
152
  get children() {
155
- var n = M();
156
- return s(n, o(F, {
153
+ var n = k();
154
+ return l(n, s(M, {
157
155
  get items() {
158
156
  return e.item.children ?? [];
159
157
  },
@@ -169,19 +167,19 @@ function de(e) {
169
167
  get dragContext() {
170
168
  return e.dragContext;
171
169
  }
172
- })), D(() => b(n, m("overflow-hidden transition-all duration-200", i() ? "opacity-100" : "opacity-0"))), n;
170
+ })), v(() => D(n, f("overflow-hidden transition-all duration-200", i() ? "opacity-100" : "opacity-0"))), n;
173
171
  }
174
- }), null), D((n) => {
175
- var c = m(
172
+ }), null), v((n) => {
173
+ var c = f(
176
174
  "group flex items-center w-full py-1 text-xs",
177
175
  "transition-all duration-150 ease-out",
178
176
  "hover:bg-sidebar-accent/60",
179
- C() && "bg-sidebar-accent text-sidebar-accent-foreground font-medium",
177
+ b() && "bg-sidebar-accent text-sidebar-accent-foreground font-medium",
180
178
  // Drop target styling - enhanced visual feedback
181
- k() && $() && ["bg-primary/15 outline outline-2 outline-primary/60", "shadow-sm shadow-primary/10"],
182
- k() && !$() && ["bg-destructive/10 outline outline-2 outline-dashed outline-destructive/50"]
183
- ), f = `${8 + e.depth * 12}px`;
184
- return c !== n.e && b(a, n.e = c), f !== n.t && J(a, "padding-left", n.t = f), n;
179
+ E() && p() && ["bg-primary/15 outline outline-2 outline-primary/60", "shadow-sm shadow-primary/10"],
180
+ E() && !p() && ["bg-destructive/10 outline outline-2 outline-dashed outline-destructive/50"]
181
+ ), u = `${8 + e.depth * 12}px`;
182
+ return c !== n.e && D(a, n.e = c), u !== n.t && J(a, "padding-left", n.t = u), n;
185
183
  }, {
186
184
  e: void 0,
187
185
  t: void 0
@@ -190,5 +188,5 @@ function de(e) {
190
188
  }
191
189
  K(["contextmenu", "click"]);
192
190
  export {
193
- Ce as DirectoryTree
191
+ ye as DirectoryTree
194
192
  };
@@ -1,4 +1,4 @@
1
- import type { ContextMenuItem, ContextMenuCallbacks, FileItem, ContextMenuActionType } from './types';
1
+ import type { ContextMenuActionType, ContextMenuCallbacks, ContextMenuEvent, ContextMenuItem, FileItem } from './types';
2
2
  /**
3
3
  * Built-in menu action types (excluding 'custom').
4
4
  */
@@ -29,7 +29,7 @@ export interface FileContextMenuProps {
29
29
  hideItems?: HideItemsValue;
30
30
  }
31
31
  export declare function createDefaultContextMenuItems(callbacks?: ContextMenuCallbacks): ContextMenuItem[];
32
- export declare function dispatchContextMenuAction(item: ContextMenuItem, items: FileItem[], callbacks?: ContextMenuCallbacks): void;
32
+ export declare function dispatchContextMenuAction(item: ContextMenuItem, items: FileItem[], callbacks?: ContextMenuCallbacks, event?: ContextMenuEvent): void;
33
33
  /**
34
34
  * Context menu for file browser items
35
35
  */