@floegence/floe-webapp-core 0.35.19 → 0.35.21

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.
@@ -1,15 +1,15 @@
1
- import { createComponent as i, insert as a, effect as F, className as I, setAttribute as N, template as h, delegateEvents as E } from "solid-js/web";
2
- import { createSignal as $, createMemo as p, createEffect as D, on as B, Show as g, For as z } from "solid-js";
3
- import { cn as C } from "../../utils/cn.js";
4
- import { Dialog as T } from "./Dialog.js";
5
- import { Button as w } from "./Button.js";
6
- import { Input as K } from "./Input.js";
7
- import { getFileIcon as L } from "../file-browser/FileIcons.js";
8
- import { deferNonBlocking as O } from "../../utils/defer.js";
9
- import { usePickerTree as R, normalizePath as G, PathInputBar as M, PickerBreadcrumb as j, PickerFolderTree as q, NewFolderSection as A } from "./picker/PickerBase.js";
10
- var H = /* @__PURE__ */ h('<div class="flex flex-col gap-2 -mt-1"><div class="flex border border-border rounded overflow-hidden"style=height:260px><div class="w-1/2 min-w-0 overflow-y-auto">'), J = /* @__PURE__ */ h('<div class="flex flex-col w-full gap-2"><div class="flex items-center gap-1.5"><label class="text-xs text-muted-foreground flex-shrink-0">File name:</label><div class=flex-1></div></div><div class="flex items-center gap-2"><span class="flex-1 text-[11px] text-muted-foreground truncate">'), Q = /* @__PURE__ */ h('<div class="flex items-center justify-center h-full text-xs text-muted-foreground">No files in this directory'), U = /* @__PURE__ */ h('<span class="ml-auto text-[10px] text-muted-foreground/60 flex-shrink-0">'), V = /* @__PURE__ */ h("<button type=button><span class=truncate>");
11
- function ae(e) {
12
- const [u, f] = $(e.initialFileName ?? ""), [S, s] = $(""), r = R({
1
+ import { createComponent as i, insert as a, effect as b, className as y, setAttribute as I, template as m, delegateEvents as N } from "solid-js/web";
2
+ import { createSignal as F, createMemo as $, createEffect as E, on as D, Show as g, For as B } from "solid-js";
3
+ import { cn as p } from "../../utils/cn.js";
4
+ import { Dialog as z } from "./Dialog.js";
5
+ import { Button as C } from "./Button.js";
6
+ import { Input as T } from "./Input.js";
7
+ import { FileItemIcon as K } from "../file-browser/FileIcons.js";
8
+ import { deferNonBlocking as L } from "../../utils/defer.js";
9
+ import { usePickerTree as O, normalizePath as R, PathInputBar as G, PickerBreadcrumb as M, PickerFolderTree as j, NewFolderSection as q } from "./picker/PickerBase.js";
10
+ var A = /* @__PURE__ */ m('<div class="flex flex-col gap-2 -mt-1"><div class="flex border border-border rounded overflow-hidden"style=height:260px><div class="w-1/2 min-w-0 overflow-y-auto">'), H = /* @__PURE__ */ m('<div class="flex flex-col w-full gap-2"><div class="flex items-center gap-1.5"><label class="text-xs text-muted-foreground flex-shrink-0">File name:</label><div class=flex-1></div></div><div class="flex items-center gap-2"><span class="flex-1 text-[11px] text-muted-foreground truncate">'), J = /* @__PURE__ */ m('<div class="flex items-center justify-center h-full text-xs text-muted-foreground">No files in this directory'), Q = /* @__PURE__ */ m('<span class="ml-auto text-[10px] text-muted-foreground/60 flex-shrink-0">'), U = /* @__PURE__ */ m("<button type=button><span class=truncate>");
11
+ function ie(e) {
12
+ const [u, f] = F(e.initialFileName ?? ""), [w, s] = F(""), r = O({
13
13
  initialPath: e.initialPath,
14
14
  open: () => e.open,
15
15
  files: () => e.files,
@@ -22,17 +22,17 @@ function ae(e) {
22
22
  onReset: () => {
23
23
  f(e.initialFileName ?? ""), s("");
24
24
  }
25
- }), x = p(() => {
26
- const t = G(r.selectedPath());
25
+ }), x = $(() => {
26
+ const t = R(r.selectedPath());
27
27
  if (t === "/")
28
28
  return e.files.filter((o) => o.type === "file");
29
29
  const n = r.folderIndex().get(t);
30
30
  return n?.children ? n.children.filter((o) => o.type === "file") : [];
31
31
  });
32
- D(B(u, () => {
32
+ E(D(u, () => {
33
33
  s("");
34
34
  }));
35
- const k = (t) => {
35
+ const S = (t) => {
36
36
  f(t.name), s("");
37
37
  }, v = () => {
38
38
  const t = u().trim();
@@ -48,16 +48,16 @@ function ae(e) {
48
48
  }
49
49
  }
50
50
  const n = r.selectedPath(), o = e.onSave;
51
- e.onOpenChange(!1), O(() => o(n, t));
52
- }, _ = () => {
51
+ e.onOpenChange(!1), L(() => o(n, t));
52
+ }, k = () => {
53
53
  e.onOpenChange(!1);
54
- }, y = (t) => {
54
+ }, _ = (t) => {
55
55
  t.key === "Enter" && (t.preventDefault(), v());
56
- }, P = p(() => {
56
+ }, P = $(() => {
57
57
  const t = r.toDisplayPath(r.selectedPath()), n = u().trim();
58
58
  return n ? t === "/" ? `/${n}` : `${t}/${n}` : t;
59
59
  });
60
- return i(T, {
60
+ return i(z, {
61
61
  get open() {
62
62
  return e.open;
63
63
  },
@@ -68,30 +68,30 @@ function ae(e) {
68
68
  return e.title ?? "Save File";
69
69
  },
70
70
  get class() {
71
- return C("max-w-2xl", e.class);
71
+ return p("max-w-2xl", e.class);
72
72
  },
73
73
  get footer() {
74
74
  return (() => {
75
- var t = J(), n = t.firstChild, o = n.firstChild, l = o.nextSibling, d = n.nextSibling, c = d.firstChild;
76
- return a(l, i(K, {
75
+ var t = H(), n = t.firstChild, o = n.firstChild, l = o.nextSibling, c = n.nextSibling, d = c.firstChild;
76
+ return a(l, i(T, {
77
77
  size: "sm",
78
78
  get value() {
79
79
  return u();
80
80
  },
81
- onInput: (m) => f(m.currentTarget.value),
82
- onKeyDown: y,
81
+ onInput: (h) => f(h.currentTarget.value),
82
+ onKeyDown: _,
83
83
  placeholder: "filename.ext",
84
84
  get error() {
85
- return S();
85
+ return w();
86
86
  }
87
- })), a(c, P), a(d, i(w, {
87
+ })), a(d, P), a(c, i(C, {
88
88
  variant: "ghost",
89
89
  size: "sm",
90
- onClick: _,
90
+ onClick: k,
91
91
  get children() {
92
92
  return e.cancelText ?? "Cancel";
93
93
  }
94
- }), null), a(d, i(w, {
94
+ }), null), a(c, i(C, {
95
95
  variant: "primary",
96
96
  size: "sm",
97
97
  onClick: v,
@@ -101,12 +101,12 @@ function ae(e) {
101
101
  get children() {
102
102
  return e.confirmText ?? "Save";
103
103
  }
104
- }), null), F(() => N(c, "title", P())), t;
104
+ }), null), b(() => I(d, "title", P())), t;
105
105
  })();
106
106
  },
107
107
  get children() {
108
- var t = H(), n = t.firstChild, o = n.firstChild;
109
- return a(t, i(M, {
108
+ var t = A(), n = t.firstChild, o = n.firstChild;
109
+ return a(t, i(G, {
110
110
  get value() {
111
111
  return r.pathInput;
112
112
  },
@@ -122,14 +122,14 @@ function ae(e) {
122
122
  get onKeyDown() {
123
123
  return r.handlePathInputKeyDown;
124
124
  }
125
- }), n), a(t, i(j, {
125
+ }), n), a(t, i(M, {
126
126
  get segments() {
127
127
  return r.breadcrumbSegments;
128
128
  },
129
129
  get onClick() {
130
130
  return r.handleBreadcrumbClick;
131
131
  }
132
- }), n), a(n, i(q, {
132
+ }), n), a(n, i(j, {
133
133
  get rootFolders() {
134
134
  return r.rootFolders;
135
135
  },
@@ -164,30 +164,28 @@ function ae(e) {
164
164
  return x().length > 0;
165
165
  },
166
166
  get fallback() {
167
- return Q();
167
+ return J();
168
168
  },
169
169
  get children() {
170
- return i(z, {
170
+ return i(B, {
171
171
  get each() {
172
172
  return x();
173
173
  },
174
- children: (l) => {
175
- const d = L(l.extension);
176
- return (() => {
177
- var c = V(), m = c.firstChild;
178
- return c.$$click = () => k(l), a(c, i(d, {
179
- class: "w-4 h-4 flex-shrink-0"
180
- }), m), a(m, () => l.name), a(c, i(g, {
181
- get when() {
182
- return l.size != null;
183
- },
184
- get children() {
185
- var b = U();
186
- return a(b, () => W(l.size)), b;
187
- }
188
- }), null), F(() => I(c, C("flex items-center gap-1.5 w-full text-left text-xs py-1.5 px-2 cursor-pointer", "transition-colors duration-100", "hover:bg-accent/60", "focus:outline-none focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-ring", u() === l.name && "bg-accent text-accent-foreground font-medium"))), c;
189
- })();
190
- }
174
+ children: (l) => (() => {
175
+ var c = U(), d = c.firstChild;
176
+ return c.$$click = () => S(l), a(c, i(K, {
177
+ item: l,
178
+ class: "w-4 h-4 flex-shrink-0"
179
+ }), d), a(d, () => l.name), a(c, i(g, {
180
+ get when() {
181
+ return l.size != null;
182
+ },
183
+ get children() {
184
+ var h = Q();
185
+ return a(h, () => V(l.size)), h;
186
+ }
187
+ }), null), b(() => y(c, p("flex items-center gap-1.5 w-full text-left text-xs py-1.5 px-2 cursor-pointer", "transition-colors duration-100", "hover:bg-accent/60", "focus:outline-none focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-ring", u() === l.name && "bg-accent text-accent-foreground font-medium"))), c;
188
+ })()
191
189
  });
192
190
  }
193
191
  })), a(t, i(g, {
@@ -195,7 +193,7 @@ function ae(e) {
195
193
  return e.onCreateFolder;
196
194
  },
197
195
  get children() {
198
- return i(A, {
196
+ return i(q, {
199
197
  get parentPath() {
200
198
  return r.selectedPath;
201
199
  },
@@ -211,10 +209,10 @@ function ae(e) {
211
209
  }
212
210
  });
213
211
  }
214
- function W(e) {
212
+ function V(e) {
215
213
  return e < 1024 ? `${e} B` : e < 1024 * 1024 ? `${(e / 1024).toFixed(1)} KB` : `${(e / (1024 * 1024)).toFixed(1)} MB`;
216
214
  }
217
- E(["click"]);
215
+ N(["click"]);
218
216
  export {
219
- ae as FileSavePicker
217
+ ie as FileSavePicker
220
218
  };
@@ -1,30 +1,34 @@
1
1
  import { Breadcrumb as r } from "./components/file-browser/Breadcrumb.js";
2
- import { CodeFileIcon as l, ConfigFileIcon as t, DocumentFileIcon as F, FileIcon as n, FolderIcon as c, FolderOpenIcon as m, ImageFileIcon as p, ShellScriptFileIcon as I, StyleFileIcon as f, getFileIcon as x } from "./components/file-browser/FileIcons.js";
3
- import { DirectoryTree as s } from "./components/file-browser/DirectoryTree.js";
4
- import { FileBrowser as B } from "./components/file-browser/FileBrowser.js";
5
- import { FileBrowserProvider as a, useFileBrowser as g } from "./components/file-browser/FileBrowserContext.js";
6
- import { FileBrowserToolbar as S } from "./components/file-browser/FileBrowserToolbar.js";
7
- import { FileContextMenu as y } from "./components/file-browser/FileContextMenu.js";
8
- import { FileGridView as T } from "./components/file-browser/FileGridView.js";
9
- import { FileListView as h } from "./components/file-browser/FileListView.js";
2
+ import { CodeFileIcon as l, ConfigFileIcon as t, DocumentFileIcon as F, FileIcon as c, FileItemIcon as n, FolderIcon as I, FolderOpenIcon as m, ImageFileIcon as p, JavaScriptFileIcon as f, ShellScriptFileIcon as x, StyleFileIcon as s, TypeScriptFileIcon as d, getFileIcon as w, resolveFileItemIcon as a } from "./components/file-browser/FileIcons.js";
3
+ import { DirectoryTree as S } from "./components/file-browser/DirectoryTree.js";
4
+ import { FileBrowser as g } from "./components/file-browser/FileBrowser.js";
5
+ import { FileBrowserProvider as y, useFileBrowser as C } from "./components/file-browser/FileBrowserContext.js";
6
+ import { FileBrowserToolbar as b } from "./components/file-browser/FileBrowserToolbar.js";
7
+ import { FileContextMenu as V } from "./components/file-browser/FileContextMenu.js";
8
+ import { FileGridView as G } from "./components/file-browser/FileGridView.js";
9
+ import { FileListView as L } from "./components/file-browser/FileListView.js";
10
10
  export {
11
11
  r as Breadcrumb,
12
12
  l as CodeFileIcon,
13
13
  t as ConfigFileIcon,
14
- s as DirectoryTree,
14
+ S as DirectoryTree,
15
15
  F as DocumentFileIcon,
16
- B as FileBrowser,
17
- a as FileBrowserProvider,
18
- S as FileBrowserToolbar,
19
- y as FileContextMenu,
20
- T as FileGridView,
21
- n as FileIcon,
22
- h as FileListView,
23
- c as FolderIcon,
16
+ g as FileBrowser,
17
+ y as FileBrowserProvider,
18
+ b as FileBrowserToolbar,
19
+ V as FileContextMenu,
20
+ G as FileGridView,
21
+ c as FileIcon,
22
+ n as FileItemIcon,
23
+ L as FileListView,
24
+ I as FolderIcon,
24
25
  m as FolderOpenIcon,
25
26
  p as ImageFileIcon,
26
- I as ShellScriptFileIcon,
27
- f as StyleFileIcon,
28
- x as getFileIcon,
29
- g as useFileBrowser
27
+ f as JavaScriptFileIcon,
28
+ x as ShellScriptFileIcon,
29
+ s as StyleFileIcon,
30
+ d as TypeScriptFileIcon,
31
+ w as getFileIcon,
32
+ a as resolveFileItemIcon,
33
+ C as useFileBrowser
30
34
  };