@floegence/floe-webapp-core 0.35.49 → 0.35.51
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/FileContextMenu.d.ts +7 -0
- package/dist/components/file-browser/FileContextMenu.js +185 -157
- package/dist/components/file-browser/FileGridView.js +64 -63
- package/dist/components/file-browser/FileListView.js +27 -26
- package/dist/components/file-browser/useFileBrowserMarqueeSelection.d.ts +23 -1
- package/dist/components/file-browser/useFileBrowserMarqueeSelection.js +79 -55
- package/dist/components/notes/NotesBoardNote.js +66 -63
- package/dist/components/notes/useNotesOverlayModel.js +390 -339
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { addEventListener as te, use as z, insert as
|
|
1
|
+
import { addEventListener as te, use as z, insert as S, createComponent as D, effect as N, setStyleProperty as Y, className as p, style as ue, template as y, spread as ge, mergeProps as me, memo as fe, delegateEvents as he } from "solid-js/web";
|
|
2
2
|
import { createSignal as ie, createMemo as W, createEffect as ne, onCleanup as oe, Show as q, For as ae, untrack as ve } from "solid-js";
|
|
3
|
-
import { cn as
|
|
3
|
+
import { cn as H } from "../../utils/cn.js";
|
|
4
4
|
import { useResizeObserver as xe } from "../../hooks/useResizeObserver.js";
|
|
5
5
|
import { useVirtualWindow as Ie } from "../../hooks/useVirtualWindow.js";
|
|
6
6
|
import { useFileBrowser as le } from "./FileBrowserContext.js";
|
|
@@ -8,11 +8,11 @@ import { useFileBrowserDrag as we } from "../../context/FileBrowserDragContext.j
|
|
|
8
8
|
import { FileItemIcon as be } from "./FileIcons.js";
|
|
9
9
|
import { createLongPressContextMenuHandlers as Ce } from "./longPressContextMenu.js";
|
|
10
10
|
import { fileBrowserTouchTargetAttrs as De } from "./touchInteractionGuard.js";
|
|
11
|
-
import { createItemContextMenuEvent as
|
|
12
|
-
import { createFileBrowserMarqueeSelection as
|
|
11
|
+
import { createItemContextMenuEvent as ye } from "./contextMenuEvent.js";
|
|
12
|
+
import { createFileBrowserMarqueeSelection as Se, FILE_BROWSER_MARQUEE_OVERLAY_CLASS as Me } from "./useFileBrowserMarqueeSelection.js";
|
|
13
13
|
import { isPrimaryModKeyPressed as re } from "../../utils/keybind.js";
|
|
14
|
-
var Te = /* @__PURE__ */
|
|
15
|
-
function
|
|
14
|
+
var Te = /* @__PURE__ */ y('<mark class="bg-warning/40 text-inherit rounded-sm">'), Pe = /* @__PURE__ */ y('<div class="grid gap-2">'), _e = /* @__PURE__ */ y('<div><div class=p-3><div class="w-full h-0"aria-hidden=true>'), Ee = /* @__PURE__ */ y('<span>No files matching "<!>"'), Fe = /* @__PURE__ */ y('<button type=button class="px-2 py-1 rounded bg-muted hover:bg-muted/80 transition-colors">Clear Filter'), Le = /* @__PURE__ */ y('<div class="flex flex-col items-center justify-center h-32 gap-2 text-xs text-muted-foreground">'), Re = /* @__PURE__ */ y("<span>This folder is empty"), $e = /* @__PURE__ */ y("<div>"), ke = /* @__PURE__ */ y('<div class="absolute top-1.5 right-1.5 w-4 h-4 rounded-full bg-primary flex items-center justify-center"><svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=3 stroke-linecap=round stroke-linejoin=round class="w-2.5 h-2.5 text-primary-foreground"><polyline points="20 6 9 17 4 12">'), Ae = /* @__PURE__ */ y("<button type=button><div></div><span></span><div>");
|
|
15
|
+
function He(e) {
|
|
16
16
|
const r = W(() => {
|
|
17
17
|
if (!e.match || e.match.matchedIndices.length === 0)
|
|
18
18
|
return [{
|
|
@@ -20,17 +20,17 @@ function pe(e) {
|
|
|
20
20
|
highlight: !1
|
|
21
21
|
}];
|
|
22
22
|
const s = [], M = new Set(e.match.matchedIndices);
|
|
23
|
-
let C = "",
|
|
23
|
+
let C = "", m = !1;
|
|
24
24
|
for (let d = 0; d < e.name.length; d++) {
|
|
25
25
|
const v = M.has(d);
|
|
26
|
-
d === 0 ? (
|
|
26
|
+
d === 0 ? (m = v, C = e.name[d]) : v === m ? C += e.name[d] : (s.push({
|
|
27
27
|
text: C,
|
|
28
|
-
highlight:
|
|
29
|
-
}), C = e.name[d],
|
|
28
|
+
highlight: m
|
|
29
|
+
}), C = e.name[d], m = v);
|
|
30
30
|
}
|
|
31
31
|
return C && s.push({
|
|
32
32
|
text: C,
|
|
33
|
-
highlight:
|
|
33
|
+
highlight: m
|
|
34
34
|
}), s;
|
|
35
35
|
});
|
|
36
36
|
return D(ae, {
|
|
@@ -46,47 +46,47 @@ function pe(e) {
|
|
|
46
46
|
},
|
|
47
47
|
get children() {
|
|
48
48
|
var M = Te();
|
|
49
|
-
return
|
|
49
|
+
return S(M, () => s.text), M;
|
|
50
50
|
}
|
|
51
51
|
})
|
|
52
52
|
});
|
|
53
53
|
}
|
|
54
54
|
function Ke(e) {
|
|
55
|
-
const r = le(), s = we(), M = () => (e.enableDragDrop ?? !0) && !!s, C = () => e.instanceId ?? "default",
|
|
55
|
+
const r = le(), s = we(), M = () => (e.enableDragDrop ?? !0) && !!s, C = () => e.instanceId ?? "default", m = 112, d = 8, v = 180, T = 2, R = 6, [f, V] = ie(null), U = xe(f), x = W(() => {
|
|
56
56
|
const n = U()?.width ?? 0;
|
|
57
57
|
if (n <= 0) return T;
|
|
58
58
|
const l = Math.floor((n + d) / (v + d));
|
|
59
59
|
return Math.max(T, Math.min(R, l));
|
|
60
|
-
}), F = () =>
|
|
60
|
+
}), F = () => m + d, c = Ie({
|
|
61
61
|
count: () => Math.ceil(r.currentFiles().length / Math.max(1, x())),
|
|
62
62
|
itemSize: F,
|
|
63
63
|
overscan: 2
|
|
64
|
-
}), Q = () => c.range().start * x(), $ = () => Math.min(r.currentFiles().length, c.range().end * x()), k = W(() => r.currentFiles().slice(Q(), $())), P = /* @__PURE__ */ new Map(),
|
|
64
|
+
}), Q = () => c.range().start * x(), $ = () => Math.min(r.currentFiles().length, c.range().end * x()), k = W(() => r.currentFiles().slice(Q(), $())), P = /* @__PURE__ */ new Map(), O = (n, l) => {
|
|
65
65
|
if (l) {
|
|
66
66
|
P.set(n, l);
|
|
67
67
|
return;
|
|
68
68
|
}
|
|
69
69
|
P.delete(n);
|
|
70
70
|
};
|
|
71
|
-
let
|
|
71
|
+
let g = null, L = T, I = 0;
|
|
72
72
|
ne(() => {
|
|
73
73
|
const n = x();
|
|
74
|
-
if (!
|
|
74
|
+
if (!g) {
|
|
75
75
|
L = n;
|
|
76
76
|
return;
|
|
77
77
|
}
|
|
78
78
|
if (n === L) return;
|
|
79
|
-
const l = F(), o = Math.floor(
|
|
80
|
-
|
|
79
|
+
const l = F(), o = Math.floor(g.scrollTop / Math.max(1, l)) * Math.max(1, L), i = Math.floor(o / Math.max(1, n));
|
|
80
|
+
g.scrollTop = i * l, c.onScroll(), L = n;
|
|
81
81
|
});
|
|
82
|
-
const
|
|
83
|
-
if (!
|
|
84
|
-
const b = Math.floor(n / Math.max(1, x())) * F(), o = b + F(), i =
|
|
82
|
+
const B = (n) => {
|
|
83
|
+
if (!g) return;
|
|
84
|
+
const b = Math.floor(n / Math.max(1, x())) * F(), o = b + F(), i = g.scrollTop, w = i + g.clientHeight;
|
|
85
85
|
if (b < i) {
|
|
86
|
-
|
|
86
|
+
g.scrollTop = b, c.onScroll();
|
|
87
87
|
return;
|
|
88
88
|
}
|
|
89
|
-
o > w && (
|
|
89
|
+
o > w && (g.scrollTop = Math.max(0, o - g.clientHeight), c.onScroll());
|
|
90
90
|
};
|
|
91
91
|
ne(() => {
|
|
92
92
|
const n = r.revealRequest(), l = r.currentFiles();
|
|
@@ -94,7 +94,7 @@ function Ke(e) {
|
|
|
94
94
|
const b = l.findIndex((w) => w.id === n.targetId);
|
|
95
95
|
if (b < 0) return;
|
|
96
96
|
if (!P.get(n.targetId)) {
|
|
97
|
-
|
|
97
|
+
B(b);
|
|
98
98
|
return;
|
|
99
99
|
}
|
|
100
100
|
typeof cancelAnimationFrame == "function" && I && (cancelAnimationFrame(I), I = 0);
|
|
@@ -114,8 +114,9 @@ function Ke(e) {
|
|
|
114
114
|
}), oe(() => {
|
|
115
115
|
typeof cancelAnimationFrame == "function" && I && cancelAnimationFrame(I);
|
|
116
116
|
});
|
|
117
|
-
const A =
|
|
118
|
-
getContainer: () =>
|
|
117
|
+
const A = Se({
|
|
118
|
+
getContainer: () => g,
|
|
119
|
+
getOverlayHost: () => g,
|
|
119
120
|
getVisibleItemIdsInOrder: () => r.currentFiles().map((n) => n.id),
|
|
120
121
|
getElementForId: (n) => P.get(n) ?? null,
|
|
121
122
|
getSelectedIds: () => [...r.selectedItems()],
|
|
@@ -125,15 +126,15 @@ function Ke(e) {
|
|
|
125
126
|
return (() => {
|
|
126
127
|
var n = _e(), l = n.firstChild, b = l.firstChild;
|
|
127
128
|
return te(n, "pointerdown", A.onPointerDown, !0), te(n, "scroll", c.onScroll), z((o) => {
|
|
128
|
-
|
|
129
|
-
}, n), z((o) => V(o), b),
|
|
129
|
+
g = o, c.scrollRef(o), r.setScrollContainer(o);
|
|
130
|
+
}, n), z((o) => V(o), b), S(l, D(q, {
|
|
130
131
|
get when() {
|
|
131
132
|
return r.currentFiles().length > 0;
|
|
132
133
|
},
|
|
133
134
|
get fallback() {
|
|
134
135
|
return (() => {
|
|
135
136
|
var o = Le();
|
|
136
|
-
return
|
|
137
|
+
return S(o, D(q, {
|
|
137
138
|
get when() {
|
|
138
139
|
return r.filterQueryApplied().trim();
|
|
139
140
|
},
|
|
@@ -143,7 +144,7 @@ function Ke(e) {
|
|
|
143
144
|
get children() {
|
|
144
145
|
return [(() => {
|
|
145
146
|
var i = Ee(), w = i.firstChild, _ = w.nextSibling;
|
|
146
|
-
return _.nextSibling,
|
|
147
|
+
return _.nextSibling, S(i, () => r.filterQueryApplied(), _), i;
|
|
147
148
|
})(), (() => {
|
|
148
149
|
var i = Fe();
|
|
149
150
|
return i.$$click = () => r.setFilterQuery(""), i;
|
|
@@ -154,11 +155,11 @@ function Ke(e) {
|
|
|
154
155
|
},
|
|
155
156
|
get children() {
|
|
156
157
|
var o = Pe();
|
|
157
|
-
return
|
|
158
|
+
return S(o, D(ae, {
|
|
158
159
|
get each() {
|
|
159
160
|
return k();
|
|
160
161
|
},
|
|
161
|
-
children: (i) => D(
|
|
162
|
+
children: (i) => D(pe, {
|
|
162
163
|
item: i,
|
|
163
164
|
get instanceId() {
|
|
164
165
|
return C();
|
|
@@ -167,7 +168,7 @@ function Ke(e) {
|
|
|
167
168
|
return M();
|
|
168
169
|
},
|
|
169
170
|
dragContext: s,
|
|
170
|
-
registerTile:
|
|
171
|
+
registerTile: O
|
|
171
172
|
})
|
|
172
173
|
})), N((i) => {
|
|
173
174
|
var w = `repeat(${x()}, minmax(0, 1fr))`, _ = `${c.paddingTop()}px`, X = `${c.paddingBottom()}px`;
|
|
@@ -178,22 +179,22 @@ function Ke(e) {
|
|
|
178
179
|
a: void 0
|
|
179
180
|
}), o;
|
|
180
181
|
}
|
|
181
|
-
}), null),
|
|
182
|
+
}), null), S(l, D(q, {
|
|
182
183
|
get when() {
|
|
183
184
|
return A.overlayStyle();
|
|
184
185
|
},
|
|
185
186
|
children: (o) => (() => {
|
|
186
187
|
var i = $e();
|
|
187
|
-
return
|
|
188
|
+
return p(i, Me), N((w) => ue(i, o(), w)), i;
|
|
188
189
|
})()
|
|
189
|
-
}), null), N(() =>
|
|
190
|
+
}), null), N(() => p(n, H("relative h-full min-h-0 overflow-auto", e.class))), n;
|
|
190
191
|
})();
|
|
191
192
|
}
|
|
192
|
-
function
|
|
193
|
-
const r = le(), s = () => r.isSelected(e.item.id), M = () => r.getFilterMatchForId(e.item.id), C = ve(() => e.item),
|
|
193
|
+
function pe(e) {
|
|
194
|
+
const r = le(), s = () => r.isSelected(e.item.id), M = () => r.getFilterMatchForId(e.item.id), C = ve(() => e.item), m = Ce(r, C, {
|
|
194
195
|
source: "grid"
|
|
195
196
|
});
|
|
196
|
-
let d, v = null, T = 0, R = 0,
|
|
197
|
+
let d, v = null, T = 0, R = 0, f = !1;
|
|
197
198
|
const V = 5, U = 500;
|
|
198
199
|
let x = null;
|
|
199
200
|
const [F, j] = ie(!1), c = () => d === "touch" || d === "pen", Q = () => e.item.type === "folder", $ = () => Q() && e.enableDragDrop && e.dragContext, k = () => {
|
|
@@ -204,21 +205,21 @@ function He(e) {
|
|
|
204
205
|
if (!e.dragContext) return !1;
|
|
205
206
|
const t = e.dragContext.dragState();
|
|
206
207
|
return t.isDragging ? t.draggedItems.some((a) => a.item.id === e.item.id) : !1;
|
|
207
|
-
},
|
|
208
|
+
}, O = () => {
|
|
208
209
|
x !== null && (clearTimeout(x), x = null);
|
|
209
|
-
},
|
|
210
|
+
}, g = () => {
|
|
210
211
|
typeof document > "u" || (document.removeEventListener("pointermove", A, !0), document.removeEventListener("pointerup", n, !0), document.removeEventListener("pointercancel", l, !0));
|
|
211
212
|
}, L = () => {
|
|
212
213
|
typeof document > "u" || (document.addEventListener("pointermove", A, !0), document.addEventListener("pointerup", n, !0), document.addEventListener("pointercancel", l, !0));
|
|
213
214
|
}, I = (t) => {
|
|
214
|
-
|
|
215
|
+
O(), g(), f && e.dragContext && e.dragContext.endDrag(t), v = null, f = !1;
|
|
215
216
|
};
|
|
216
217
|
oe(() => {
|
|
217
218
|
e.registerTile(e.item.id, null), I(!1);
|
|
218
219
|
});
|
|
219
|
-
const
|
|
220
|
-
if (!e.enableDragDrop || !e.dragContext ||
|
|
221
|
-
|
|
220
|
+
const B = (t, a) => {
|
|
221
|
+
if (!e.enableDragDrop || !e.dragContext || f) return;
|
|
222
|
+
f = !0, s() || r.selectItem(e.item.id, !1);
|
|
222
223
|
const h = r.getSelectedItemsList(), u = (h.length > 0 && s() ? h : [e.item]).map((G) => ({
|
|
223
224
|
item: G,
|
|
224
225
|
sourceInstanceId: e.instanceId,
|
|
@@ -233,21 +234,21 @@ function He(e) {
|
|
|
233
234
|
}, A = (t) => {
|
|
234
235
|
if (v !== t.pointerId) return;
|
|
235
236
|
const a = t.clientX - T, h = t.clientY - R, E = Math.sqrt(a * a + h * h);
|
|
236
|
-
if (c() && !
|
|
237
|
+
if (c() && !f && E > 10) {
|
|
237
238
|
I(!1);
|
|
238
239
|
return;
|
|
239
240
|
}
|
|
240
|
-
!c() && !
|
|
241
|
+
!c() && !f && E > V && B(t.clientX, t.clientY), f && e.dragContext && e.dragContext.updateDrag(t.clientX, t.clientY);
|
|
241
242
|
}, n = (t) => {
|
|
242
|
-
v === t.pointerId && (
|
|
243
|
+
v === t.pointerId && (m.onPointerUp(), I(!0));
|
|
243
244
|
}, l = (t) => {
|
|
244
|
-
v === t.pointerId && (
|
|
245
|
+
v === t.pointerId && (m.onPointerCancel(), I(!1));
|
|
245
246
|
}, b = (t) => {
|
|
246
|
-
d = t.pointerType,
|
|
247
|
-
v !== null && !
|
|
247
|
+
d = t.pointerType, m.onPointerDown(t), !(t.pointerType === "mouse" && t.button !== 0) && (!e.enableDragDrop || !e.dragContext || (v = t.pointerId, T = t.clientX, R = t.clientY, f = !1, L(), c() && (O(), x = setTimeout(() => {
|
|
248
|
+
v !== null && !f && B(T, R);
|
|
248
249
|
}, U))));
|
|
249
250
|
}, o = (t) => {
|
|
250
|
-
d = t.pointerType,
|
|
251
|
+
d = t.pointerType, m.onPointerMove(t);
|
|
251
252
|
}, i = (t) => {
|
|
252
253
|
if (!$() || !e.dragContext) return;
|
|
253
254
|
const a = e.dragContext.dragState();
|
|
@@ -265,11 +266,11 @@ function He(e) {
|
|
|
265
266
|
const a = e.dragContext.dragState();
|
|
266
267
|
a.isDragging && a.dropTarget?.targetPath === e.item.path && e.dragContext.setDropTarget(null, !1);
|
|
267
268
|
}, _ = (t) => {
|
|
268
|
-
if (
|
|
269
|
-
|
|
269
|
+
if (f) {
|
|
270
|
+
f = !1;
|
|
270
271
|
return;
|
|
271
272
|
}
|
|
272
|
-
if (!
|
|
273
|
+
if (!m.consumeClickSuppression(t)) {
|
|
273
274
|
if (c()) {
|
|
274
275
|
r.openItem(e.item);
|
|
275
276
|
return;
|
|
@@ -286,7 +287,7 @@ function He(e) {
|
|
|
286
287
|
if (t.preventDefault(), t.stopPropagation(), c()) return;
|
|
287
288
|
r.ensureContextMenuSelection(e.item.id);
|
|
288
289
|
const a = r.getSelectedItemsList(), h = a.length > 0 ? a : [e.item];
|
|
289
|
-
r.showContextMenu(
|
|
290
|
+
r.showContextMenu(ye({
|
|
290
291
|
x: t.clientX,
|
|
291
292
|
y: t.clientY,
|
|
292
293
|
triggerItem: e.item,
|
|
@@ -317,7 +318,7 @@ function He(e) {
|
|
|
317
318
|
onPointerEnter: i,
|
|
318
319
|
onPointerLeave: w,
|
|
319
320
|
get class() {
|
|
320
|
-
return
|
|
321
|
+
return H(
|
|
321
322
|
"group relative flex flex-col items-center gap-2 p-3 rounded-lg cursor-pointer h-28",
|
|
322
323
|
"transition-all duration-150 ease-out",
|
|
323
324
|
"hover:bg-accent/50 hover:scale-[1.02]",
|
|
@@ -331,19 +332,19 @@ function He(e) {
|
|
|
331
332
|
K() && !k() && ["bg-destructive/10 ring-2 ring-dashed ring-destructive/50"]
|
|
332
333
|
);
|
|
333
334
|
}
|
|
334
|
-
}), !1, !0),
|
|
335
|
+
}), !1, !0), S(t, D(q, {
|
|
335
336
|
get when() {
|
|
336
337
|
return s();
|
|
337
338
|
},
|
|
338
339
|
get children() {
|
|
339
340
|
return ke();
|
|
340
341
|
}
|
|
341
|
-
}), a),
|
|
342
|
+
}), a), S(a, D(be, {
|
|
342
343
|
get item() {
|
|
343
344
|
return e.item;
|
|
344
345
|
},
|
|
345
346
|
class: "w-8 h-8"
|
|
346
|
-
})),
|
|
347
|
+
})), S(h, D(He, {
|
|
347
348
|
get name() {
|
|
348
349
|
return e.item.name;
|
|
349
350
|
},
|
|
@@ -351,8 +352,8 @@ function He(e) {
|
|
|
351
352
|
return M();
|
|
352
353
|
}
|
|
353
354
|
})), N((u) => {
|
|
354
|
-
var G =
|
|
355
|
-
return G !== u.e &&
|
|
355
|
+
var G = H("w-12 h-12 flex items-center justify-center rounded-lg", "transition-transform duration-200", "group-hover:scale-110", e.item.type === "folder" ? "bg-warning/10" : "bg-muted/50"), J = H("block w-full min-w-0 truncate px-1 text-xs text-center", "transition-colors duration-150", s() && "font-medium"), Z = H("absolute inset-0 rounded-lg opacity-0 transition-opacity duration-300", "group-hover:opacity-100", "pointer-events-none"), ee = e.item.type === "folder" ? "radial-gradient(circle at 50% 30%, color-mix(in srgb, var(--warning) 8%, transparent), transparent 70%)" : "radial-gradient(circle at 50% 30%, color-mix(in srgb, var(--primary) 5%, transparent), transparent 70%)";
|
|
356
|
+
return G !== u.e && p(a, u.e = G), J !== u.t && p(h, u.t = J), Z !== u.a && p(E, u.a = Z), ee !== u.o && Y(E, "background", u.o = ee), u;
|
|
356
357
|
}, {
|
|
357
358
|
e: void 0,
|
|
358
359
|
t: void 0,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { use as ee, insert as f, createComponent as m, effect as p, className as N, setStyleProperty as L, addEventListener as ie, style as Ce, template as
|
|
1
|
+
import { use as ee, insert as f, createComponent as m, effect as p, className as N, setStyleProperty as L, addEventListener as ie, style as Ce, template as z, spread as be, mergeProps as Me, memo as ce, delegateEvents as De } from "solid-js/web";
|
|
2
2
|
import { createMemo as te, createEffect as Ie, onCleanup as de, createSignal as ue, Show as P, For as me, untrack as $e } from "solid-js";
|
|
3
3
|
import { cn as E } from "../../utils/cn.js";
|
|
4
4
|
import { useMediaQuery as re } from "../../hooks/useMediaQuery.js";
|
|
@@ -14,7 +14,7 @@ import { fileBrowserTouchTargetAttrs as Fe } from "./touchInteractionGuard.js";
|
|
|
14
14
|
import { createItemContextMenuEvent as ke } from "./contextMenuEvent.js";
|
|
15
15
|
import { createFileBrowserMarqueeSelection as pe, FILE_BROWSER_MARQUEE_OVERLAY_CLASS as Ae } from "./useFileBrowserMarqueeSelection.js";
|
|
16
16
|
import { isPrimaryModKeyPressed as ae } from "../../utils/keybind.js";
|
|
17
|
-
var Ee = /* @__PURE__ */
|
|
17
|
+
var Ee = /* @__PURE__ */ z("<span class=truncate>"), Le = /* @__PURE__ */ z('<mark class="bg-warning/40 text-inherit rounded-sm">'), We = /* @__PURE__ */ z("<span>"), He = /* @__PURE__ */ z('<div><button type=button class="group w-full flex items-center justify-start text-left px-3 py-2 cursor-pointer hover:bg-muted/50 transition-colors">Modified'), Be = /* @__PURE__ */ z('<div class=shrink-0><button type=button class="group w-full flex items-center justify-start text-left px-3 py-2 cursor-pointer hover:bg-muted/50 transition-colors">Size'), le = /* @__PURE__ */ z("<div>"), qe = /* @__PURE__ */ z('<div><div class="flex items-center border-b border-border text-[11px] text-muted-foreground font-medium"><div><button type=button class="group w-full flex items-center min-w-0 px-3 py-2 cursor-pointer hover:bg-muted/50 transition-colors"><span class="flex items-center gap-2 min-w-0"><span class="flex-shrink-0 w-4 h-4"aria-hidden=true></span><span class="flex items-center min-w-0"><span class=truncate>Name</span></span></span></button></div></div><div class="relative flex-1 min-h-0 overflow-auto">'), Ne = /* @__PURE__ */ z('<span>No files matching "<!>"'), Oe = /* @__PURE__ */ z('<button type=button class="px-2 py-1 rounded bg-muted hover:bg-muted/80 transition-colors">Clear Filter'), Xe = /* @__PURE__ */ z('<div class="flex flex-col items-center justify-center h-32 gap-2 text-xs text-muted-foreground">'), Ye = /* @__PURE__ */ z("<span>This folder is empty"), se = /* @__PURE__ */ z('<div class="shrink-0 px-3 py-1.5 text-left text-muted-foreground truncate">'), Ge = /* @__PURE__ */ z('<button type=button><div class="flex items-center gap-2 flex-1 min-w-0 px-3 py-1.5"><span class="flex-shrink-0 w-4 h-4">');
|
|
18
18
|
function Ve(t) {
|
|
19
19
|
const o = te(() => {
|
|
20
20
|
if (!t.match || t.match.matchedIndices.length === 0)
|
|
@@ -69,7 +69,7 @@ function ut(t) {
|
|
|
69
69
|
} = g.range();
|
|
70
70
|
return o.currentFiles().slice(n, i);
|
|
71
71
|
}), T = /* @__PURE__ */ new Map();
|
|
72
|
-
let
|
|
72
|
+
let _ = null, x = 0;
|
|
73
73
|
const U = (n, i) => {
|
|
74
74
|
if (i) {
|
|
75
75
|
T.set(n, i);
|
|
@@ -77,13 +77,13 @@ function ut(t) {
|
|
|
77
77
|
}
|
|
78
78
|
T.delete(n);
|
|
79
79
|
}, Q = (n) => {
|
|
80
|
-
if (!
|
|
81
|
-
const i = n * C, l = i + C, c =
|
|
80
|
+
if (!_) return;
|
|
81
|
+
const i = n * C, l = i + C, c = _.scrollTop, h = c + _.clientHeight;
|
|
82
82
|
if (i < c) {
|
|
83
|
-
|
|
83
|
+
_.scrollTop = i, g.onScroll();
|
|
84
84
|
return;
|
|
85
85
|
}
|
|
86
|
-
l > h && (
|
|
86
|
+
l > h && (_.scrollTop = Math.max(0, l - _.clientHeight), g.onScroll());
|
|
87
87
|
};
|
|
88
88
|
Ie(() => {
|
|
89
89
|
const n = o.revealRequest(), i = o.currentFiles();
|
|
@@ -122,7 +122,8 @@ function ut(t) {
|
|
|
122
122
|
day: "numeric",
|
|
123
123
|
year: "numeric"
|
|
124
124
|
}) : "-", y = pe({
|
|
125
|
-
getContainer: () =>
|
|
125
|
+
getContainer: () => _,
|
|
126
|
+
getOverlayHost: () => _,
|
|
126
127
|
getVisibleItemIdsInOrder: () => o.currentFiles().map((n) => n.id),
|
|
127
128
|
getElementForId: (n) => T.get(n) ?? null,
|
|
128
129
|
getSelectedIds: () => [...o.selectedItems()],
|
|
@@ -138,8 +139,8 @@ function ut(t) {
|
|
|
138
139
|
}
|
|
139
140
|
})), p(() => N(c, E("ml-1 transition-all duration-150", l() ? "opacity-100" : "opacity-0 group-hover:opacity-40"))), c;
|
|
140
141
|
})();
|
|
141
|
-
},
|
|
142
|
-
const n = J()?.width ?? 0, i =
|
|
142
|
+
}, H = re("(min-width: 640px)"), X = re("(min-width: 768px)"), [K, Y] = ue(null), J = _e(K), A = (n, i, l) => Math.max(i, Math.min(l, n)), S = te(() => {
|
|
143
|
+
const n = J()?.width ?? 0, i = H(), l = X(), c = o.listColumnRatios(), h = 160, v = 120, b = 80, M = 128, a = 96;
|
|
143
144
|
if (!i || n <= 0)
|
|
144
145
|
return {
|
|
145
146
|
width: n,
|
|
@@ -181,7 +182,7 @@ function ut(t) {
|
|
|
181
182
|
modifiedWidth: r,
|
|
182
183
|
sizeWidth: e
|
|
183
184
|
};
|
|
184
|
-
}),
|
|
185
|
+
}), B = () => S().modifiedWidth, q = () => S().sizeWidth, G = (n) => {
|
|
185
186
|
const i = S();
|
|
186
187
|
if (!i.showModified || i.width <= 0) return;
|
|
187
188
|
if (!i.showSize) {
|
|
@@ -238,7 +239,7 @@ function ut(t) {
|
|
|
238
239
|
return S().showModified;
|
|
239
240
|
},
|
|
240
241
|
get children() {
|
|
241
|
-
var a =
|
|
242
|
+
var a = He(), r = a.firstChild;
|
|
242
243
|
return r.firstChild, r.$$click = () => k("modifiedAt"), f(r, m(W, {
|
|
243
244
|
field: "modifiedAt"
|
|
244
245
|
}), null), f(a, m(P, {
|
|
@@ -252,7 +253,7 @@ function ut(t) {
|
|
|
252
253
|
});
|
|
253
254
|
}
|
|
254
255
|
}), null), p((e) => {
|
|
255
|
-
var s = E("relative shrink-0", S().showSize && "border-r border-border"), u = `${
|
|
256
|
+
var s = E("relative shrink-0", S().showSize && "border-r border-border"), u = `${B()}px`;
|
|
256
257
|
return s !== e.e && N(a, e.e = s), u !== e.t && L(a, "width", e.t = u), e;
|
|
257
258
|
}, {
|
|
258
259
|
e: void 0,
|
|
@@ -264,13 +265,13 @@ function ut(t) {
|
|
|
264
265
|
return S().showSize;
|
|
265
266
|
},
|
|
266
267
|
get children() {
|
|
267
|
-
var a =
|
|
268
|
+
var a = Be(), r = a.firstChild;
|
|
268
269
|
return r.firstChild, r.$$click = () => k("size"), f(r, m(W, {
|
|
269
270
|
field: "size"
|
|
270
271
|
}), null), p((e) => L(a, "width", `${q()}px`)), a;
|
|
271
272
|
}
|
|
272
273
|
}), null), ie(M, "pointerdown", y.onPointerDown, !0), ie(M, "scroll", g.onScroll), ee((a) => {
|
|
273
|
-
|
|
274
|
+
_ = a, g.scrollRef(a), o.setScrollContainer(a);
|
|
274
275
|
}, M), f(M, m(P, {
|
|
275
276
|
get when() {
|
|
276
277
|
return o.currentFiles().length > 0;
|
|
@@ -314,7 +315,7 @@ function ut(t) {
|
|
|
314
315
|
return S().showSize;
|
|
315
316
|
},
|
|
316
317
|
get modifiedWidthPx() {
|
|
317
|
-
return
|
|
318
|
+
return B();
|
|
318
319
|
},
|
|
319
320
|
get sizeWidthPx() {
|
|
320
321
|
return q();
|
|
@@ -357,11 +358,11 @@ function Ue(t) {
|
|
|
357
358
|
const o = fe(), D = () => o.isSelected(t.item.id), R = () => o.getFilterMatchForId(t.item.id), I = $e(() => t.item), C = Te(o, I, {
|
|
358
359
|
source: "list"
|
|
359
360
|
});
|
|
360
|
-
let g, $ = null, T = 0,
|
|
361
|
+
let g, $ = null, T = 0, _ = 0, x = !1;
|
|
361
362
|
const U = 5, Q = 500;
|
|
362
363
|
let k = null;
|
|
363
|
-
const [j, O] = ue(!1), y = () => g === "touch" || g === "pen", W = () => t.item.type === "folder",
|
|
364
|
-
if (!
|
|
364
|
+
const [j, O] = ue(!1), y = () => g === "touch" || g === "pen", W = () => t.item.type === "folder", H = () => W() && t.enableDragDrop && t.dragContext, X = () => {
|
|
365
|
+
if (!H() || !t.dragContext) return !1;
|
|
365
366
|
const e = t.dragContext.dragState();
|
|
366
367
|
return e.isDragging ? t.dragContext.canDropOn(e.draggedItems, t.item.path, t.item, t.instanceId) : !1;
|
|
367
368
|
}, K = () => {
|
|
@@ -380,7 +381,7 @@ function Ue(t) {
|
|
|
380
381
|
de(() => {
|
|
381
382
|
t.registerRow(t.item.id, null), S(!1);
|
|
382
383
|
});
|
|
383
|
-
const
|
|
384
|
+
const B = (e, s) => {
|
|
384
385
|
if (!t.enableDragDrop || !t.dragContext || x) return;
|
|
385
386
|
x = !0, D() || o.selectItem(t.item.id, !1);
|
|
386
387
|
const u = o.getSelectedItemsList(), w = (u.length > 0 && D() ? u : [t.item]).map((F) => ({
|
|
@@ -396,24 +397,24 @@ function Ue(t) {
|
|
|
396
397
|
t.dragContext.startDrag(w, e, s);
|
|
397
398
|
}, q = (e) => {
|
|
398
399
|
if ($ !== e.pointerId) return;
|
|
399
|
-
const s = e.clientX - T, u = e.clientY -
|
|
400
|
+
const s = e.clientX - T, u = e.clientY - _, d = Math.sqrt(s * s + u * u);
|
|
400
401
|
if (y() && !x && d > 10) {
|
|
401
402
|
S(!1);
|
|
402
403
|
return;
|
|
403
404
|
}
|
|
404
|
-
!y() && !x && d > U &&
|
|
405
|
+
!y() && !x && d > U && B(e.clientX, e.clientY), x && t.dragContext && t.dragContext.updateDrag(e.clientX, e.clientY);
|
|
405
406
|
}, G = (e) => {
|
|
406
407
|
$ === e.pointerId && (C.onPointerUp(), S(!0));
|
|
407
408
|
}, V = (e) => {
|
|
408
409
|
$ === e.pointerId && (C.onPointerCancel(), S(!1));
|
|
409
410
|
}, n = (e) => {
|
|
410
|
-
g = e.pointerType, C.onPointerDown(e), !(e.pointerType === "mouse" && e.button !== 0) && (!t.enableDragDrop || !t.dragContext || ($ = e.pointerId, T = e.clientX,
|
|
411
|
-
$ !== null && !x &&
|
|
411
|
+
g = e.pointerType, C.onPointerDown(e), !(e.pointerType === "mouse" && e.button !== 0) && (!t.enableDragDrop || !t.dragContext || ($ = e.pointerId, T = e.clientX, _ = e.clientY, x = !1, A(), y() && (Y(), k = setTimeout(() => {
|
|
412
|
+
$ !== null && !x && B(T, _);
|
|
412
413
|
}, Q))));
|
|
413
414
|
}, i = (e) => {
|
|
414
415
|
g = e.pointerType, C.onPointerMove(e);
|
|
415
416
|
}, l = (e) => {
|
|
416
|
-
if (!
|
|
417
|
+
if (!H() || !t.dragContext) return;
|
|
417
418
|
const s = t.dragContext.dragState();
|
|
418
419
|
if (!s.isDragging) return;
|
|
419
420
|
O(!0);
|
|
@@ -457,7 +458,7 @@ function Ue(t) {
|
|
|
457
458
|
items: u,
|
|
458
459
|
source: "list"
|
|
459
460
|
}));
|
|
460
|
-
}, M = () => t.dragContext?.dragState(), a = () => M()?.isDragging ?? !1, r = () => j() && a() &&
|
|
461
|
+
}, M = () => t.dragContext?.dragState(), a = () => M()?.isDragging ?? !1, r = () => j() && a() && H();
|
|
461
462
|
return (() => {
|
|
462
463
|
var e = Ge(), s = e.firstChild, u = s.firstChild;
|
|
463
464
|
return ee((d) => {
|
|
@@ -1,7 +1,28 @@
|
|
|
1
1
|
import { type Accessor } from 'solid-js';
|
|
2
2
|
import type { ReplaceSelectionOptions } from './types';
|
|
3
|
+
export type ViewportRect = {
|
|
4
|
+
left: number;
|
|
5
|
+
top: number;
|
|
6
|
+
width: number;
|
|
7
|
+
height: number;
|
|
8
|
+
};
|
|
9
|
+
export type LocalOverlayRect = {
|
|
10
|
+
left: number;
|
|
11
|
+
top: number;
|
|
12
|
+
width: number;
|
|
13
|
+
height: number;
|
|
14
|
+
};
|
|
15
|
+
export interface OverlayHostGeometry {
|
|
16
|
+
left: number;
|
|
17
|
+
top: number;
|
|
18
|
+
scrollLeft: number;
|
|
19
|
+
scrollTop: number;
|
|
20
|
+
clientLeft: number;
|
|
21
|
+
clientTop: number;
|
|
22
|
+
}
|
|
3
23
|
export interface FileBrowserMarqueeSelectionOptions {
|
|
4
24
|
getContainer: () => HTMLElement | null;
|
|
25
|
+
getOverlayHost?: () => HTMLElement | null;
|
|
5
26
|
getVisibleItemIdsInOrder: () => string[];
|
|
6
27
|
getElementForId: (id: string) => HTMLElement | null | undefined;
|
|
7
28
|
getSelectedIds: () => string[];
|
|
@@ -12,5 +33,6 @@ export interface FileBrowserMarqueeSelectionResult {
|
|
|
12
33
|
overlayStyle: Accessor<Record<string, string> | null>;
|
|
13
34
|
onPointerDown: (event: PointerEvent) => void;
|
|
14
35
|
}
|
|
15
|
-
export declare const FILE_BROWSER_MARQUEE_OVERLAY_CLASS = "pointer-events-none
|
|
36
|
+
export declare const FILE_BROWSER_MARQUEE_OVERLAY_CLASS = "pointer-events-none absolute z-40 rounded-md floe-file-browser-marquee-overlay";
|
|
37
|
+
export declare function projectViewportRectToOverlayHost(rect: ViewportRect, geometry: OverlayHostGeometry): LocalOverlayRect;
|
|
16
38
|
export declare function createFileBrowserMarqueeSelection(options: FileBrowserMarqueeSelectionOptions): FileBrowserMarqueeSelectionResult;
|