@floegence/floe-webapp-core 0.1.5 → 0.1.7

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 (87) hide show
  1. package/dist/components/file-browser/Breadcrumb.d.ts +7 -0
  2. package/dist/components/file-browser/DirectoryTree.d.ts +7 -0
  3. package/dist/components/file-browser/FileBrowser.d.ts +35 -0
  4. package/dist/components/file-browser/FileBrowserContext.d.ts +18 -0
  5. package/dist/components/file-browser/FileBrowserToolbar.d.ts +8 -0
  6. package/dist/components/file-browser/FileContextMenu.d.ts +15 -0
  7. package/dist/components/file-browser/FileGridView.d.ts +7 -0
  8. package/dist/components/file-browser/FileIcons.d.ts +14 -0
  9. package/dist/components/file-browser/FileListView.d.ts +7 -0
  10. package/dist/components/file-browser/index.d.ts +10 -0
  11. package/dist/components/file-browser/types.d.ts +104 -0
  12. package/dist/components/index.d.ts +1 -0
  13. package/dist/components/layout/Sidebar.d.ts +18 -0
  14. package/dist/components/layout/index.d.ts +1 -1
  15. package/dist/components/layout/mobileTabs.d.ts +8 -3
  16. package/dist/index.js +249 -220
  17. package/dist/index10.js +2 -2
  18. package/dist/index11.js +4 -4
  19. package/dist/index12.js +2 -2
  20. package/dist/index13.js +4 -4
  21. package/dist/index14.js +4 -4
  22. package/dist/index15.js +4 -4
  23. package/dist/index16.js +3 -3
  24. package/dist/index17.js +5 -5
  25. package/dist/index18.js +2 -2
  26. package/dist/index19.js +1 -1
  27. package/dist/index2.js +39 -39
  28. package/dist/index20.js +1 -1
  29. package/dist/index21.js +3 -3
  30. package/dist/index22.js +2 -2
  31. package/dist/index23.js +2 -2
  32. package/dist/index24.js +1 -1
  33. package/dist/index25.js +4 -4
  34. package/dist/index26.js +1 -1
  35. package/dist/index27.js +1 -1
  36. package/dist/index28.js +1 -1
  37. package/dist/index29.js +1 -1
  38. package/dist/index3.js +1 -1
  39. package/dist/index36.js +138 -42
  40. package/dist/index37.js +102 -32
  41. package/dist/index38.js +90 -23
  42. package/dist/index39.js +107 -170
  43. package/dist/index4.js +48 -34
  44. package/dist/index40.js +86 -40
  45. package/dist/index41.js +176 -64
  46. package/dist/index42.js +64 -94
  47. package/dist/index43.js +64 -110
  48. package/dist/index44.js +39 -138
  49. package/dist/index45.js +44 -35
  50. package/dist/index46.js +34 -379
  51. package/dist/index47.js +25 -13
  52. package/dist/index48.js +173 -10
  53. package/dist/index49.js +40 -16
  54. package/dist/index5.js +3 -3
  55. package/dist/index50.js +65 -9
  56. package/dist/index51.js +96 -8
  57. package/dist/index52.js +113 -52
  58. package/dist/index53.js +138 -5
  59. package/dist/index54.js +39 -3
  60. package/dist/index55.js +382 -44
  61. package/dist/index56.js +13 -26
  62. package/dist/index57.js +10 -32
  63. package/dist/index58.js +17 -92
  64. package/dist/index59.js +10 -22
  65. package/dist/index6.js +2 -2
  66. package/dist/index60.js +8 -46
  67. package/dist/index61.js +56 -14
  68. package/dist/index62.js +5 -35
  69. package/dist/index63.js +3 -64
  70. package/dist/index64.js +45 -84
  71. package/dist/index65.js +25 -13
  72. package/dist/index66.js +27 -2258
  73. package/dist/index67.js +92 -8
  74. package/dist/index68.js +25 -0
  75. package/dist/index69.js +49 -0
  76. package/dist/index7.js +1 -1
  77. package/dist/index70.js +17 -0
  78. package/dist/index71.js +38 -0
  79. package/dist/index72.js +67 -0
  80. package/dist/index73.js +87 -0
  81. package/dist/index74.js +17 -0
  82. package/dist/index75.js +2266 -0
  83. package/dist/index76.js +10 -0
  84. package/dist/index8.js +2 -2
  85. package/dist/index9.js +1 -1
  86. package/dist/styles.css +1 -1
  87. package/package.json +1 -1
package/dist/index37.js CHANGED
@@ -1,41 +1,111 @@
1
- import { createComponent as t, memo as n, mergeProps as f } from "solid-js/web";
2
- import { onMount as u, onCleanup as C } from "solid-js";
3
- import { useComponentRegistry as g, useComponentContextFactory as h } from "./index44.js";
4
- import { NotificationContainer as d } from "./index43.js";
5
- import { Shell as A } from "./index2.js";
6
- import { CommandPalette as x } from "./index25.js";
7
- import { FloeProvider as P } from "./index36.js";
8
- function F(e) {
9
- var r, m;
10
- const o = g(), c = h(), a = (r = e.getProtocol) == null ? void 0 : r.call(e);
11
- return (m = e.components) != null && m.length && o.registerAll(e.components), u(() => {
12
- o.mountAll((i) => {
13
- const l = c(i, {
14
- protocol: a
15
- });
16
- return e.createComponentContext ? e.createComponentContext(i, l) : l;
1
+ import { createComponent as A } from "solid-js/web";
2
+ import { createContext as V, createSignal as c, createMemo as U, useContext as j } from "solid-js";
3
+ const y = V();
4
+ function W(n) {
5
+ const [u, B] = c(n.initialPath ?? "/"), [h, x] = c(/* @__PURE__ */ new Set()), [I, b] = c(n.initialViewMode ?? "list"), [m, k] = c({
6
+ field: "name",
7
+ direction: "asc"
8
+ }), [g, S] = c(/* @__PURE__ */ new Set(["/"])), [E, P] = c(!1), [T, C] = c(null), F = () => n.files, v = U(() => {
9
+ const e = u(), t = F(), o = (r, i) => {
10
+ if (i === "/" || i === "")
11
+ return r;
12
+ for (const s of r)
13
+ if (s.type === "folder") {
14
+ if (s.path === i)
15
+ return s.children ?? [];
16
+ if (s.children) {
17
+ const a = o(s.children, i);
18
+ if (a) return a;
19
+ }
20
+ }
21
+ }, f = o(t, e) ?? [], l = m();
22
+ return [...f].sort((r, i) => {
23
+ var a, M;
24
+ if (r.type !== i.type)
25
+ return r.type === "folder" ? -1 : 1;
26
+ let s = 0;
27
+ switch (l.field) {
28
+ case "name":
29
+ s = r.name.localeCompare(i.name);
30
+ break;
31
+ case "size":
32
+ s = (r.size ?? 0) - (i.size ?? 0);
33
+ break;
34
+ case "modifiedAt":
35
+ s = (((a = r.modifiedAt) == null ? void 0 : a.getTime()) ?? 0) - (((M = i.modifiedAt) == null ? void 0 : M.getTime()) ?? 0);
36
+ break;
37
+ case "type":
38
+ s = (r.extension ?? "").localeCompare(i.extension ?? "");
39
+ break;
40
+ }
41
+ return l.direction === "asc" ? s : -s;
17
42
  });
18
- }), C(() => {
19
- o.unmountAll();
20
- }), [t(A, f(() => e.shell, {
21
- get children() {
22
- return e.children;
23
- }
24
- })), n(() => n(() => e.enableCommandPalette !== !1)() && t(x, {})), n(() => n(() => e.enableNotifications !== !1)() && t(d, {}))];
25
- }
26
- function I(e) {
27
- return t(P, {
28
- get config() {
29
- return e.config;
43
+ }), w = (e) => {
44
+ var t;
45
+ B(e), (t = n.onNavigate) == null || t.call(n, e);
46
+ }, z = {
47
+ currentPath: u,
48
+ setCurrentPath: w,
49
+ navigateUp: () => {
50
+ const e = u();
51
+ if (e === "/" || e === "") return;
52
+ const t = e.split("/").filter(Boolean);
53
+ t.pop(), w(t.length ? "/" + t.join("/") : "/");
54
+ },
55
+ navigateTo: (e) => {
56
+ e.type === "folder" && (w(e.path), S((t) => {
57
+ const o = new Set(t);
58
+ return o.add(e.path), o;
59
+ }));
30
60
  },
31
- get wrapAfterTheme() {
32
- return e.wrapAfterTheme;
61
+ selectedItems: () => h(),
62
+ selectItem: (e, t = !1) => {
63
+ var f;
64
+ x((l) => {
65
+ const d = t ? new Set(l) : /* @__PURE__ */ new Set();
66
+ return d.has(e) ? d.delete(e) : d.add(e), d;
67
+ });
68
+ const o = v().filter((l) => h().has(l.id));
69
+ (f = n.onSelect) == null || f.call(n, o);
70
+ },
71
+ clearSelection: () => {
72
+ x(/* @__PURE__ */ new Set());
33
73
  },
74
+ isSelected: (e) => h().has(e),
75
+ viewMode: I,
76
+ setViewMode: b,
77
+ sortConfig: m,
78
+ setSortConfig: k,
79
+ expandedFolders: g,
80
+ toggleFolder: (e) => {
81
+ S((t) => {
82
+ const o = new Set(t);
83
+ return o.has(e) ? o.delete(e) : o.add(e), o;
84
+ });
85
+ },
86
+ isExpanded: (e) => g().has(e),
87
+ files: F,
88
+ currentFiles: v,
89
+ sidebarCollapsed: E,
90
+ toggleSidebar: () => P((e) => !e),
91
+ contextMenu: T,
92
+ showContextMenu: (e) => C(e),
93
+ hideContextMenu: () => C(null)
94
+ };
95
+ return A(y.Provider, {
96
+ value: z,
34
97
  get children() {
35
- return t(F, e);
98
+ return n.children;
36
99
  }
37
100
  });
38
101
  }
102
+ function X() {
103
+ const n = j(y);
104
+ if (!n)
105
+ throw new Error("useFileBrowser must be used within a FileBrowserProvider");
106
+ return n;
107
+ }
39
108
  export {
40
- I as FloeApp
109
+ W as FileBrowserProvider,
110
+ X as useFileBrowser
41
111
  };
package/dist/index38.js CHANGED
@@ -1,28 +1,95 @@
1
- import { createComponent as i } from "solid-js/web";
2
- import { createContext as u, useContext as m } from "solid-js";
3
- function x(t) {
4
- const r = u();
5
- function n(e) {
6
- const c = t.init();
7
- return i(r.Provider, {
8
- value: c,
9
- get children() {
10
- return e.children;
1
+ import { delegateEvents as S, template as g, insert as o, createComponent as n, effect as h, className as s, memo as E, setStyleProperty as I } from "solid-js/web";
2
+ import { createMemo as p, For as P, Show as m } from "solid-js";
3
+ import { cn as d } from "./index62.js";
4
+ import { useFileBrowser as $ } from "./index37.js";
5
+ import { FolderOpenIcon as T, FolderIcon as N } from "./index44.js";
6
+ import { ChevronRight as j } from "./index30.js";
7
+ var _ = /* @__PURE__ */ g("<div>"), A = /* @__PURE__ */ g('<span class="ml-auto mr-2 text-[10px] text-muted-foreground/60 opacity-0 group-hover:opacity-100 transition-opacity">'), B = /* @__PURE__ */ g('<div class="flex flex-col"><button type=button><span></span><span class="flex-shrink-0 w-4 h-4"></span><span class=truncate>');
8
+ function H(e) {
9
+ const i = $(), r = p(() => i.files().filter((l) => l.type === "folder"));
10
+ return (() => {
11
+ var l = _();
12
+ return o(l, n(C, {
13
+ get items() {
14
+ return r();
15
+ },
16
+ depth: 0
17
+ })), h(() => s(l, d("flex flex-col", e.class))), l;
18
+ })();
19
+ }
20
+ function C(e) {
21
+ const i = p(() => e.items.filter((r) => r.type === "folder"));
22
+ return n(P, {
23
+ get each() {
24
+ return i();
25
+ },
26
+ children: (r) => n(D, {
27
+ item: r,
28
+ get depth() {
29
+ return e.depth;
11
30
  }
12
- });
13
- }
14
- function o() {
15
- const e = m(r);
16
- if (!e)
17
- throw new Error(`${t.name}Context not found. Make sure to wrap your component with ${t.name}Provider.`);
18
- return e;
19
- }
20
- return {
21
- Provider: n,
22
- use: o,
23
- Context: r
31
+ })
32
+ });
33
+ }
34
+ function D(e) {
35
+ const i = $(), r = () => i.isExpanded(e.item.path), l = () => i.currentPath() === e.item.path, v = p(() => {
36
+ var c;
37
+ return ((c = e.item.children) == null ? void 0 : c.filter((a) => a.type === "folder").length) ?? 0;
38
+ }), u = () => v() > 0, k = () => {
39
+ i.toggleFolder(e.item.path), i.setCurrentPath(e.item.path);
24
40
  };
41
+ return (() => {
42
+ var c = B(), a = c.firstChild, f = a.firstChild, x = f.nextSibling, F = x.nextSibling;
43
+ return a.$$click = k, o(f, n(j, {
44
+ class: "w-3 h-3 opacity-50"
45
+ })), o(x, n(m, {
46
+ get when() {
47
+ return r();
48
+ },
49
+ get fallback() {
50
+ return n(N, {
51
+ class: "w-4 h-4"
52
+ });
53
+ },
54
+ get children() {
55
+ return n(T, {
56
+ class: "w-4 h-4"
57
+ });
58
+ }
59
+ })), o(F, () => e.item.name), o(a, n(m, {
60
+ get when() {
61
+ return u();
62
+ },
63
+ get children() {
64
+ var t = A();
65
+ return o(t, v), t;
66
+ }
67
+ }), null), o(c, n(m, {
68
+ get when() {
69
+ return E(() => !!r())() && u();
70
+ },
71
+ get children() {
72
+ var t = _();
73
+ return o(t, n(C, {
74
+ get items() {
75
+ return e.item.children ?? [];
76
+ },
77
+ get depth() {
78
+ return e.depth + 1;
79
+ }
80
+ })), h(() => s(t, d("overflow-hidden transition-all duration-200", r() ? "opacity-100" : "opacity-0"))), t;
81
+ }
82
+ }), null), h((t) => {
83
+ var b = d("group flex items-center gap-1 w-full py-1 text-xs cursor-pointer", "transition-all duration-100", "hover:bg-sidebar-accent/60", "focus:outline-none focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-sidebar-ring", l() && "bg-sidebar-accent text-sidebar-accent-foreground font-medium"), y = `${8 + e.depth * 12}px`, w = d("flex-shrink-0 w-3.5 h-3.5 flex items-center justify-center", "transition-transform duration-150", r() && "rotate-90", !u() && "opacity-0");
84
+ return b !== t.e && s(a, t.e = b), y !== t.t && I(a, "padding-left", t.t = y), w !== t.a && s(f, t.a = w), t;
85
+ }, {
86
+ e: void 0,
87
+ t: void 0,
88
+ a: void 0
89
+ }), c;
90
+ })();
25
91
  }
92
+ S(["click"]);
26
93
  export {
27
- x as createSimpleContext
94
+ H as DirectoryTree
28
95
  };
package/dist/index39.js CHANGED
@@ -1,176 +1,113 @@
1
- import { createComponent as v } from "solid-js/web";
2
- import { createContext as C, useContext as g, createMemo as m } from "solid-js";
3
- const d = {
4
- storage: {
5
- namespace: "floe",
6
- enabled: !0,
7
- adapter: void 0
8
- },
9
- commands: {
10
- enableGlobalKeybinds: !0,
11
- ignoreWhenTyping: !0,
12
- allowWhenTypingWithin: '[data-floe-hotkeys="allow"]',
13
- palette: {
14
- enabled: !0,
15
- keybind: "mod+k"
16
- },
17
- save: {
18
- enabled: !0,
19
- keybind: "mod+s",
20
- commandId: "file.save",
21
- preventDefaultWhenNoHandler: !0
22
- }
23
- },
24
- layout: {
25
- storageKey: "layout",
26
- mobileQuery: "(max-width: 767px)",
27
- sidebar: {
28
- defaultWidth: 350,
29
- clamp: {
30
- min: 220,
31
- max: 480
32
- },
33
- defaultActiveTab: "",
34
- defaultCollapsed: !1
35
- },
36
- terminal: {
37
- defaultOpened: !1,
38
- defaultHeight: 280,
39
- clamp: {
40
- min: 150,
41
- max: 600
42
- }
43
- }
44
- },
45
- theme: {
46
- storageKey: "theme",
47
- defaultTheme: "system"
48
- },
49
- deck: {
50
- storageKey: "deck"
51
- },
52
- strings: {
53
- topBar: {
54
- searchPlaceholder: "Search commands..."
55
- },
56
- commandPalette: {
57
- placeholder: "Type a command or search...",
58
- empty: "No commands found",
59
- esc: "esc"
60
- },
61
- confirmDialog: {
62
- cancel: "Cancel",
63
- confirm: "Confirm"
64
- },
65
- statusIndicator: {
66
- connected: "Connected",
67
- disconnected: "Disconnected",
68
- connecting: "Connecting",
69
- error: "Error"
70
- }
71
- }
72
- };
73
- function I() {
74
- if (!(typeof window > "u"))
75
- return {
76
- getItem: (e) => localStorage.getItem(e),
77
- setItem: (e, t) => localStorage.setItem(e, t),
78
- removeItem: (e) => localStorage.removeItem(e),
79
- keys: () => Object.keys(localStorage)
80
- };
81
- }
82
- function y(e) {
83
- const t = e.adapter ?? I(), i = e.namespace ? `${e.namespace}-` : "", o = (r) => `${i}${r}`, n = () => e.enabled && !!t, s = /* @__PURE__ */ new Map();
84
- return {
85
- key: o,
86
- load: (r, c) => {
87
- if (!n()) return c;
88
- try {
89
- const a = t.getItem(o(r));
90
- return a === null ? c : JSON.parse(a);
91
- } catch {
92
- return c;
93
- }
94
- },
95
- save: (r, c) => {
96
- if (n())
97
- try {
98
- t.setItem(o(r), JSON.stringify(c));
99
- } catch (a) {
100
- console.warn(`Failed to save ${o(r)}:`, a);
101
- }
102
- },
103
- debouncedSave: (r, c, a = 300) => {
104
- if (!n()) return;
105
- const l = o(r), u = s.get(l);
106
- u && clearTimeout(u), s.set(l, setTimeout(() => {
107
- try {
108
- t.setItem(l, JSON.stringify(c)), s.delete(l);
109
- } catch (h) {
110
- console.warn(`Failed to save ${l}:`, h);
1
+ import { delegateEvents as S, template as x, insert as c, createComponent as s, effect as $, className as b, Dynamic as C, memo as _, setStyleProperty as k } from "solid-js/web";
2
+ import { Show as F, For as I } from "solid-js";
3
+ import { cn as f } from "./index62.js";
4
+ import { useFileBrowser as w } from "./index37.js";
5
+ import { FolderIcon as z, getFileIcon as D } from "./index44.js";
6
+ import { ChevronDown as M } from "./index30.js";
7
+ var A = /* @__PURE__ */ x("<span>"), B = /* @__PURE__ */ x('<div><div class="flex items-center border-b border-border text-[11px] text-muted-foreground font-medium"><button type=button class="group flex items-center flex-1 min-w-0 px-3 py-2 cursor-pointer hover:bg-muted/50 transition-colors">Name</button><button type=button class="group hidden sm:flex items-center w-32 px-3 py-2 cursor-pointer hover:bg-muted/50 transition-colors">Modified</button><button type=button class="group hidden md:flex items-center w-24 px-3 py-2 text-right justify-end cursor-pointer hover:bg-muted/50 transition-colors">Size</button></div><div class="flex-1 min-h-0 overflow-auto">'), K = /* @__PURE__ */ x('<div class="flex items-center justify-center h-32 text-xs text-muted-foreground">This folder is empty'), L = /* @__PURE__ */ x('<button type=button style=animation-fill-mode:backwards><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"></span><span class=truncate></span></div><div class="hidden sm:block w-32 px-3 py-1.5 text-muted-foreground truncate"></div><div class="hidden md:block w-24 px-3 py-1.5 text-right text-muted-foreground">');
8
+ function X(i) {
9
+ const n = w(), d = (t) => {
10
+ const e = n.sortConfig();
11
+ n.setSortConfig({
12
+ field: t,
13
+ direction: e.field === t && e.direction === "asc" ? "desc" : "asc"
14
+ });
15
+ }, g = (t) => t === void 0 ? "-" : t < 1024 ? `${t} B` : t < 1024 * 1024 ? `${(t / 1024).toFixed(1)} KB` : `${(t / (1024 * 1024)).toFixed(1)} MB`, h = (t) => t ? t.toLocaleDateString("en-US", {
16
+ month: "short",
17
+ day: "numeric",
18
+ year: "numeric"
19
+ }) : "-", u = (t) => {
20
+ const e = () => n.sortConfig(), r = () => e().field === t.field;
21
+ return (() => {
22
+ var o = A();
23
+ return c(o, s(M, {
24
+ get class() {
25
+ return f("w-3 h-3 transition-transform duration-150", r() && e().direction === "asc" && "rotate-180");
111
26
  }
112
- }, a));
113
- },
114
- remove: (r) => {
115
- if (n())
116
- try {
117
- t.removeItem(o(r));
118
- } catch {
119
- }
120
- },
121
- clearAll: () => {
122
- var c;
123
- if (!n()) return;
124
- const r = ((c = t.keys) == null ? void 0 : c.call(t)) ?? [];
125
- for (const a of r)
126
- a.startsWith(i) && t.removeItem(a);
127
- }
128
- };
129
- }
130
- function p(e, t) {
131
- if (!t) return e;
132
- if (typeof e != "object" || e === null || Array.isArray(e)) return t ?? e;
133
- const i = {
134
- ...e
27
+ })), $(() => b(o, f("ml-1 transition-all duration-150", r() ? "opacity-100" : "opacity-0 group-hover:opacity-40"))), o;
28
+ })();
135
29
  };
136
- for (const [o, n] of Object.entries(t)) {
137
- if (n === void 0) continue;
138
- const s = e[o];
139
- typeof s == "object" && s !== null && typeof n == "object" && n !== null && !Array.isArray(n) ? i[o] = p(s, n) : i[o] = n;
140
- }
141
- return i;
142
- }
143
- const f = C();
144
- function x(e) {
145
- const t = m(() => p(d, e.config)), i = m(() => y(t().storage)), o = m(() => ({
146
- config: t(),
147
- persist: i()
148
- }));
149
- return v(f.Provider, {
150
- get value() {
151
- return o();
152
- },
153
- get children() {
154
- return e.children;
155
- }
156
- });
157
- }
158
- function S() {
159
- const e = g(f);
160
- if (!e)
161
- throw new Error("FloeConfigContext not found. Make sure to wrap your app with FloeConfigProvider (or FloeProvider).");
162
- return e;
30
+ return (() => {
31
+ var t = B(), e = t.firstChild, r = e.firstChild;
32
+ r.firstChild;
33
+ var o = r.nextSibling;
34
+ o.firstChild;
35
+ var a = o.nextSibling;
36
+ a.firstChild;
37
+ var m = e.nextSibling;
38
+ return r.$$click = () => d("name"), c(r, s(u, {
39
+ field: "name"
40
+ }), null), o.$$click = () => d("modifiedAt"), c(o, s(u, {
41
+ field: "modifiedAt"
42
+ }), null), a.$$click = () => d("size"), c(a, s(u, {
43
+ field: "size"
44
+ }), null), c(m, s(F, {
45
+ get when() {
46
+ return n.currentFiles().length > 0;
47
+ },
48
+ get fallback() {
49
+ return K();
50
+ },
51
+ get children() {
52
+ return s(I, {
53
+ get each() {
54
+ return n.currentFiles();
55
+ },
56
+ children: (v, l) => s(T, {
57
+ item: v,
58
+ formatSize: g,
59
+ formatDate: h,
60
+ get index() {
61
+ return l();
62
+ }
63
+ })
64
+ });
65
+ }
66
+ })), $(() => b(t, f("flex flex-col h-full min-h-0", i.class))), t;
67
+ })();
163
68
  }
164
- const F = y(d.storage), k = {
165
- config: d,
166
- persist: F
167
- };
168
- function T() {
169
- return g(f) ?? k;
69
+ function T(i) {
70
+ const n = w(), d = () => n.isSelected(i.item.id), g = (e) => {
71
+ i.item.type === "folder" ? n.navigateTo(i.item) : n.selectItem(i.item.id, e.metaKey || e.ctrlKey);
72
+ }, h = () => {
73
+ i.item.type === "folder" && n.navigateTo(i.item);
74
+ }, u = (e) => {
75
+ e.preventDefault(), e.stopPropagation(), d() || n.selectItem(i.item.id, !1);
76
+ const r = n.selectedItems(), o = n.currentFiles(), a = r.size > 0 ? o.filter((m) => r.has(m.id)) : [i.item];
77
+ n.showContextMenu({
78
+ x: e.clientX,
79
+ y: e.clientY,
80
+ items: a
81
+ });
82
+ }, t = () => i.item.type === "folder" ? z : D(i.item.extension);
83
+ return (() => {
84
+ var e = L(), r = e.firstChild, o = r.firstChild, a = o.nextSibling, m = r.nextSibling, v = m.nextSibling;
85
+ return e.$$contextmenu = u, e.$$dblclick = h, e.$$click = g, c(o, s(C, {
86
+ get component() {
87
+ return t();
88
+ },
89
+ class: "w-4 h-4"
90
+ })), c(a, () => i.item.name), c(m, () => i.formatDate(i.item.modifiedAt)), c(v, (() => {
91
+ var l = _(() => i.item.type === "folder");
92
+ return () => l() ? "-" : i.formatSize(i.item.size);
93
+ })()), $((l) => {
94
+ var y = f(
95
+ "group w-full flex items-center text-xs cursor-pointer",
96
+ "transition-all duration-100",
97
+ "hover:bg-accent/50",
98
+ "focus:outline-none focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-ring",
99
+ d() && "bg-accent text-accent-foreground",
100
+ // Staggered animation on mount
101
+ "animate-in fade-in slide-in-from-top-2"
102
+ ), p = `${Math.min(i.index * 20, 200)}ms`;
103
+ return y !== l.e && b(e, l.e = y), p !== l.t && k(e, "animation-delay", l.t = p), l;
104
+ }, {
105
+ e: void 0,
106
+ t: void 0
107
+ }), e;
108
+ })();
170
109
  }
110
+ S(["click", "dblclick", "contextmenu"]);
171
111
  export {
172
- d as DEFAULT_FLOE_CONFIG,
173
- x as FloeConfigProvider,
174
- S as useFloeConfig,
175
- T as useResolvedFloeConfig
112
+ X as FileListView
176
113
  };
package/dist/index4.js CHANGED
@@ -1,55 +1,69 @@
1
- import { delegateEvents as v, template as c, insert as n, effect as d, className as o, setStyleProperty as f, memo as u } from "solid-js/web";
1
+ import { delegateEvents as b, template as c, insert as n, effect as d, className as s, setStyleProperty as u, memo as f } from "solid-js/web";
2
2
  import "solid-js";
3
- import { cn as s } from "./index53.js";
4
- var b = /* @__PURE__ */ c('<aside><div class="flex-1 overflow-auto overscroll-contain">'), x = /* @__PURE__ */ c("<section><div class=flex-1>"), m = /* @__PURE__ */ c('<div class="flex items-center justify-between px-2.5 py-2 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground/60"><span>'), h = /* @__PURE__ */ c('<button type=button><span class="flex-1 truncate text-left">'), $ = /* @__PURE__ */ c('<span class="flex-shrink-0 w-4 h-4 opacity-60">');
5
- function y(e) {
3
+ import { cn as o } from "./index62.js";
4
+ var m = /* @__PURE__ */ c('<aside><div class="flex-1 overflow-auto overscroll-contain">'), v = /* @__PURE__ */ c("<div>"), x = /* @__PURE__ */ c("<section><div class=flex-1>"), h = /* @__PURE__ */ c('<div class="flex items-center justify-between px-2.5 py-2 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground/60"><span>'), $ = /* @__PURE__ */ c('<button type=button><span class="flex-1 truncate text-left">'), g = /* @__PURE__ */ c('<span class="flex-shrink-0 w-4 h-4 opacity-60">');
5
+ function S(e) {
6
6
  return (() => {
7
- var i = b(), l = i.firstChild;
8
- return n(l, () => e.children), n(i, () => e.resizer, null), d((t) => {
9
- var r = s("relative h-full flex flex-col shrink-0 min-h-0", "bg-sidebar text-sidebar-foreground", "border-r border-sidebar-border", "overflow-hidden", e.class), a = `${e.width ?? 350}px`;
10
- return r !== t.e && o(i, t.e = r), a !== t.t && f(i, "width", t.t = a), t;
7
+ var t = m(), l = t.firstChild;
8
+ return n(l, () => e.children), n(t, () => e.resizer, null), d((r) => {
9
+ var i = o("relative h-full flex flex-col shrink-0 min-h-0", "bg-sidebar text-sidebar-foreground", "border-r border-sidebar-border", "overflow-hidden", e.class), a = `${e.width ?? 350}px`;
10
+ return i !== r.e && s(t, r.e = i), a !== r.t && u(t, "width", r.t = a), r;
11
11
  }, {
12
12
  e: void 0,
13
13
  t: void 0
14
- }), i;
14
+ }), t;
15
15
  })();
16
16
  }
17
17
  function k(e) {
18
18
  return (() => {
19
- var i = x(), l = i.firstChild;
20
- return n(i, (() => {
21
- var t = u(() => !!e.title);
22
- return () => t() && (() => {
23
- var r = m(), a = r.firstChild;
24
- return n(a, () => e.title), n(r, () => e.actions, null), r;
25
- })();
26
- })(), l), n(l, () => e.children), d(() => o(i, s("flex flex-col", e.class))), i;
19
+ var t = v();
20
+ return n(t, () => e.children), d(() => s(t, o("p-2.5 space-y-3", e.class))), t;
27
21
  })();
28
22
  }
29
23
  function C(e) {
30
24
  return (() => {
31
- var i = h(), l = i.firstChild;
32
- return i.$$click = () => {
33
- var t;
34
- return (t = e.onClick) == null ? void 0 : t.call(e);
35
- }, n(i, (() => {
36
- var t = u(() => !!e.icon);
37
- return () => t() && (() => {
38
- var r = $();
39
- return n(r, () => e.icon), r;
25
+ var t = v();
26
+ return n(t, () => e.children), d(() => s(t, o("space-y-0.5", e.class))), t;
27
+ })();
28
+ }
29
+ function I(e) {
30
+ return (() => {
31
+ var t = x(), l = t.firstChild;
32
+ return n(t, (() => {
33
+ var r = f(() => !!e.title);
34
+ return () => r() && (() => {
35
+ var i = h(), a = i.firstChild;
36
+ return n(a, () => e.title), n(i, () => e.actions, null), i;
37
+ })();
38
+ })(), l), n(l, () => e.children), d(() => s(t, o("flex flex-col", e.class))), t;
39
+ })();
40
+ }
41
+ function j(e) {
42
+ return (() => {
43
+ var t = $(), l = t.firstChild;
44
+ return t.$$click = () => {
45
+ var r;
46
+ return (r = e.onClick) == null ? void 0 : r.call(e);
47
+ }, n(t, (() => {
48
+ var r = f(() => !!e.icon);
49
+ return () => r() && (() => {
50
+ var i = g();
51
+ return n(i, () => e.icon), i;
40
52
  })();
41
- })(), l), n(l, () => e.children), d((t) => {
42
- var r = s("w-full flex items-center gap-2 px-2.5 py-1.5 text-xs cursor-pointer", "transition-colors duration-75", "hover:bg-sidebar-accent/80 hover:text-sidebar-accent-foreground", "focus:outline-none focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-sidebar-ring", e.active && "bg-sidebar-accent text-sidebar-accent-foreground font-medium", e.class), a = e.indent ? `${10 + e.indent * 10}px` : void 0;
43
- return r !== t.e && o(i, t.e = r), a !== t.t && f(i, "padding-left", t.t = a), t;
53
+ })(), l), n(l, () => e.children), d((r) => {
54
+ var i = o("w-full flex items-center gap-2 px-2.5 py-1.5 text-xs cursor-pointer", "transition-colors duration-75", "hover:bg-sidebar-accent/80 hover:text-sidebar-accent-foreground", "focus:outline-none focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-sidebar-ring", e.active && "bg-sidebar-accent text-sidebar-accent-foreground font-medium", e.class), a = e.indent ? `${10 + e.indent * 10}px` : void 0;
55
+ return i !== r.e && s(t, r.e = i), a !== r.t && u(t, "padding-left", r.t = a), r;
44
56
  }, {
45
57
  e: void 0,
46
58
  t: void 0
47
- }), i;
59
+ }), t;
48
60
  })();
49
61
  }
50
- v(["click"]);
62
+ b(["click"]);
51
63
  export {
52
- y as Sidebar,
53
- C as SidebarItem,
54
- k as SidebarSection
64
+ S as Sidebar,
65
+ k as SidebarContent,
66
+ j as SidebarItem,
67
+ C as SidebarItemList,
68
+ I as SidebarSection
55
69
  };