@floegence/floe-webapp-core 0.35.32 → 0.35.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/file-browser/DirectoryTree.js +41 -37
- package/dist/components/file-browser/FileContextMenu.d.ts +2 -2
- package/dist/components/file-browser/FileContextMenu.js +300 -142
- package/dist/components/file-browser/FileGridView.js +50 -45
- package/dist/components/file-browser/FileListView.js +99 -94
- package/dist/components/file-browser/contextMenuEvent.d.ts +10 -0
- package/dist/components/file-browser/contextMenuEvent.js +19 -0
- package/dist/components/file-browser/index.d.ts +1 -1
- package/dist/components/file-browser/longPressContextMenu.d.ts +1 -0
- package/dist/components/file-browser/longPressContextMenu.js +45 -32
- package/dist/components/file-browser/types.d.ts +15 -1
- package/dist/components/layout/Shell.d.ts +8 -0
- package/dist/components/layout/Shell.js +157 -138
- package/dist/components/layout/Sidebar.d.ts +2 -0
- package/dist/components/layout/Sidebar.js +39 -38
- package/dist/components/layout/sidebarVisibilityMotion.d.ts +22 -0
- package/dist/components/layout/sidebarVisibilityMotion.js +16 -0
- package/dist/components/ui/Dropdown.d.ts +0 -1
- package/dist/components/ui/Dropdown.js +150 -204
- package/dist/components/ui/menuUtils.d.ts +15 -0
- package/dist/components/ui/menuUtils.js +60 -0
- package/dist/context/LayoutContext.d.ts +5 -0
- package/dist/context/LayoutContext.js +58 -46
- package/package.json +1 -1
|
@@ -1,20 +1,21 @@
|
|
|
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
|
|
2
|
-
import { createMemo as
|
|
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 S, 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 v } from "solid-js";
|
|
3
3
|
import { cn as m } from "../../utils/cn.js";
|
|
4
|
-
import { useFileBrowser as
|
|
4
|
+
import { useFileBrowser as _ } from "./FileBrowserContext.js";
|
|
5
5
|
import { useFileBrowserDrag as ee } from "../../context/FileBrowserDragContext.js";
|
|
6
6
|
import { FolderOpenIcon as te, FolderIcon as ne } from "./FileIcons.js";
|
|
7
7
|
import { ChevronRight as re } from "../icons/index.js";
|
|
8
8
|
import { createLongPressContextMenuHandlers as ie } from "./longPressContextMenu.js";
|
|
9
9
|
import { fileBrowserTouchTargetAttrs as ae } from "./touchInteractionGuard.js";
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
import { createItemContextMenuEvent as oe } from "./contextMenuEvent.js";
|
|
11
|
+
var M = /* @__PURE__ */ h("<div>"), le = /* @__PURE__ */ h("<button type=button>"), se = /* @__PURE__ */ h('<span class="ml-auto mr-2 text-[10px] text-muted-foreground/60 opacity-0 group-hover:opacity-100 transition-opacity">'), ce = /* @__PURE__ */ h('<div class="flex flex-col"><div><button type=button><span class="flex-shrink-0 w-4 h-4"></span><span class=truncate>'), ge = /* @__PURE__ */ h('<span class="flex-shrink-0 w-3.5 h-3.5">');
|
|
12
|
+
function we(e) {
|
|
13
|
+
const l = _(), i = ee(), C = () => (e.enableDragDrop ?? !0) && !!i, x = () => e.instanceId ?? "default", g = I(() => l.files().filter((r) => r.type === "folder"));
|
|
13
14
|
return (() => {
|
|
14
15
|
var r = M();
|
|
15
16
|
return r.$$contextmenu = (y) => y.preventDefault(), s(r, o(F, {
|
|
16
17
|
get items() {
|
|
17
|
-
return
|
|
18
|
+
return g();
|
|
18
19
|
},
|
|
19
20
|
depth: 0,
|
|
20
21
|
get instanceId() {
|
|
@@ -28,7 +29,7 @@ function Ce(e) {
|
|
|
28
29
|
})();
|
|
29
30
|
}
|
|
30
31
|
function F(e) {
|
|
31
|
-
const l =
|
|
32
|
+
const l = I(() => e.items.filter((i) => i.type === "folder"));
|
|
32
33
|
return o(Q, {
|
|
33
34
|
get each() {
|
|
34
35
|
return l();
|
|
@@ -51,71 +52,74 @@ function F(e) {
|
|
|
51
52
|
});
|
|
52
53
|
}
|
|
53
54
|
function de(e) {
|
|
54
|
-
const l =
|
|
55
|
-
selectOnOpen: !1
|
|
55
|
+
const l = _(), i = () => l.isExpanded(e.item.path), C = () => l.currentPath() === e.item.path, x = W(() => e.item), g = ie(l, x, {
|
|
56
|
+
selectOnOpen: !1,
|
|
57
|
+
source: "tree"
|
|
56
58
|
});
|
|
57
59
|
let r;
|
|
58
|
-
const [y,
|
|
60
|
+
const [y, T] = Z(!1), L = () => r === "touch" || r === "pen", $ = I(() => e.item.children?.filter((t) => t.type === "folder").length ?? 0), u = () => $() > 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
64
|
}, O = () => e.dragContext?.dragState(), A = () => O()?.isDragging ?? !1, k = () => y() && A() && e.enableDragDrop, B = (t) => {
|
|
63
|
-
r = t.pointerType,
|
|
65
|
+
r = t.pointerType, g.onPointerDown(t);
|
|
64
66
|
}, H = (t) => {
|
|
65
|
-
r = t.pointerType,
|
|
67
|
+
r = t.pointerType, g.onPointerMove(t);
|
|
66
68
|
}, N = (t) => {
|
|
67
|
-
r = t.pointerType,
|
|
69
|
+
r = t.pointerType, g.onPointerUp();
|
|
68
70
|
}, R = (t) => {
|
|
69
|
-
r = t.pointerType,
|
|
71
|
+
r = t.pointerType, g.onPointerCancel();
|
|
70
72
|
}, U = (t) => {
|
|
71
73
|
if (!e.enableDragDrop || !e.dragContext) return;
|
|
72
74
|
const a = e.dragContext.dragState();
|
|
73
75
|
if (!a.isDragging) return;
|
|
74
|
-
|
|
75
|
-
const
|
|
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
|
-
},
|
|
82
|
+
}, d, P);
|
|
81
83
|
}, V = (t) => {
|
|
82
84
|
if (!e.dragContext) return;
|
|
83
|
-
|
|
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);
|
|
86
88
|
}, j = (t) => {
|
|
87
|
-
|
|
89
|
+
g.consumeClickSuppression(t) || l.navigateTo(x);
|
|
88
90
|
}, G = (t) => {
|
|
89
|
-
t.preventDefault(), t.stopPropagation(), !L() && l.showContextMenu({
|
|
91
|
+
t.preventDefault(), t.stopPropagation(), !L() && l.showContextMenu(oe({
|
|
90
92
|
x: t.clientX,
|
|
91
93
|
y: t.clientY,
|
|
92
|
-
|
|
93
|
-
|
|
94
|
+
triggerItem: e.item,
|
|
95
|
+
items: [e.item],
|
|
96
|
+
source: "tree"
|
|
97
|
+
}));
|
|
94
98
|
}, X = () => {
|
|
95
99
|
u() && l.toggleFolder(e.item.path);
|
|
96
100
|
};
|
|
97
101
|
return (() => {
|
|
98
|
-
var t =
|
|
102
|
+
var t = ce(), a = t.firstChild, d = a.firstChild, w = d.firstChild, P = w.nextSibling;
|
|
99
103
|
return a.addEventListener("pointerleave", V), a.addEventListener("pointerenter", U), s(a, o(v, {
|
|
100
104
|
get when() {
|
|
101
105
|
return u();
|
|
102
106
|
},
|
|
103
107
|
get fallback() {
|
|
104
|
-
return
|
|
108
|
+
return ge();
|
|
105
109
|
},
|
|
106
110
|
get children() {
|
|
107
|
-
var n =
|
|
111
|
+
var n = le();
|
|
108
112
|
return n.$$click = X, s(n, o(re, {
|
|
109
113
|
class: "w-3 h-3 opacity-50"
|
|
110
114
|
})), 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"),
|
|
112
|
-
return f !== c.e && b(n, c.e = f),
|
|
115
|
+
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"), E = i() ? "Collapse folder" : "Expand folder";
|
|
116
|
+
return f !== c.e && b(n, c.e = f), E !== c.t && Y(n, "aria-label", c.t = E), c;
|
|
113
117
|
}, {
|
|
114
118
|
e: void 0,
|
|
115
119
|
t: void 0
|
|
116
120
|
}), n;
|
|
117
121
|
}
|
|
118
|
-
}),
|
|
122
|
+
}), d), q(d, z(ae, {
|
|
119
123
|
onClick: j,
|
|
120
124
|
onContextMenu: G,
|
|
121
125
|
onPointerDown: B,
|
|
@@ -127,7 +131,7 @@ function de(e) {
|
|
|
127
131
|
}
|
|
128
132
|
}), !1, !0), s(w, o(v, {
|
|
129
133
|
get when() {
|
|
130
|
-
return
|
|
134
|
+
return S(() => !!u())() && i();
|
|
131
135
|
},
|
|
132
136
|
get fallback() {
|
|
133
137
|
return o(ne, {
|
|
@@ -139,17 +143,17 @@ function de(e) {
|
|
|
139
143
|
class: "w-4 h-4"
|
|
140
144
|
});
|
|
141
145
|
}
|
|
142
|
-
})), s(P, () => e.item.name), s(
|
|
146
|
+
})), s(P, () => e.item.name), s(d, o(v, {
|
|
143
147
|
get when() {
|
|
144
148
|
return u();
|
|
145
149
|
},
|
|
146
150
|
get children() {
|
|
147
|
-
var n =
|
|
148
|
-
return s(n,
|
|
151
|
+
var n = se();
|
|
152
|
+
return s(n, $), n;
|
|
149
153
|
}
|
|
150
154
|
}), null), s(t, o(v, {
|
|
151
155
|
get when() {
|
|
152
|
-
return
|
|
156
|
+
return S(() => !!i())() && u();
|
|
153
157
|
},
|
|
154
158
|
get children() {
|
|
155
159
|
var n = M();
|
|
@@ -178,8 +182,8 @@ function de(e) {
|
|
|
178
182
|
"hover:bg-sidebar-accent/60",
|
|
179
183
|
C() && "bg-sidebar-accent text-sidebar-accent-foreground font-medium",
|
|
180
184
|
// Drop target styling - enhanced visual feedback
|
|
181
|
-
k() &&
|
|
182
|
-
k() &&
|
|
185
|
+
k() && p() && ["bg-primary/15 outline outline-2 outline-primary/60", "shadow-sm shadow-primary/10"],
|
|
186
|
+
k() && !p() && ["bg-destructive/10 outline outline-2 outline-dashed outline-destructive/50"]
|
|
183
187
|
), f = `${8 + e.depth * 12}px`;
|
|
184
188
|
return c !== n.e && b(a, n.e = c), f !== n.t && J(a, "padding-left", n.t = f), n;
|
|
185
189
|
}, {
|
|
@@ -190,5 +194,5 @@ function de(e) {
|
|
|
190
194
|
}
|
|
191
195
|
K(["contextmenu", "click"]);
|
|
192
196
|
export {
|
|
193
|
-
|
|
197
|
+
we as DirectoryTree
|
|
194
198
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
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
|
*/
|