@floegence/floe-webapp-core 0.35.33 → 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.
@@ -1,40 +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 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
- import { cn as m } from "../../utils/cn.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
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
- 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"));
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"));
14
14
  return (() => {
15
- var r = M();
16
- 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, {
17
17
  get items() {
18
18
  return g();
19
19
  },
20
20
  depth: 0,
21
21
  get instanceId() {
22
- return x();
22
+ return h();
23
23
  },
24
24
  get enableDragDrop() {
25
- return C();
25
+ return b();
26
26
  },
27
27
  dragContext: i
28
- })), D(() => b(r, m("flex flex-col", e.class))), r;
28
+ })), v(() => D(r, f("flex flex-col", e.class))), r;
29
29
  })();
30
30
  }
31
- function F(e) {
32
- const l = I(() => e.items.filter((i) => i.type === "folder"));
33
- return o(Q, {
31
+ function M(e) {
32
+ const o = I(() => e.items.filter((i) => i.type === "folder"));
33
+ return s(Q, {
34
34
  get each() {
35
- return l();
35
+ return o();
36
36
  },
37
- children: (i) => o(de, {
37
+ children: (i) => s(ge, {
38
38
  item: i,
39
39
  get depth() {
40
40
  return e.depth;
@@ -51,25 +51,25 @@ function F(e) {
51
51
  })
52
52
  });
53
53
  }
54
- function de(e) {
55
- const l = _(), i = () => l.isExpanded(e.item.path), C = () => l.currentPath() === e.item.path, x = W(() => e.item), g = ie(l, x, {
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
56
  selectOnOpen: !1,
57
57
  source: "tree"
58
58
  });
59
59
  let r;
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 = () => {
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 = () => {
61
61
  if (!e.enableDragDrop || !e.dragContext) return !1;
62
62
  const t = e.dragContext.dragState();
63
63
  return t.isDragging ? e.dragContext.canDropOn(t.draggedItems, e.item.path, e.item, e.instanceId) : !1;
64
- }, O = () => e.dragContext?.dragState(), A = () => O()?.isDragging ?? !1, k = () => y() && A() && e.enableDragDrop, B = (t) => {
64
+ }, L = () => e.dragContext?.dragState(), A = () => L()?.isDragging ?? !1, E = () => C() && A() && e.enableDragDrop, B = (t) => {
65
65
  r = t.pointerType, g.onPointerDown(t);
66
- }, H = (t) => {
66
+ }, O = (t) => {
67
67
  r = t.pointerType, g.onPointerMove(t);
68
- }, N = (t) => {
68
+ }, H = (t) => {
69
69
  r = t.pointerType, g.onPointerUp();
70
- }, R = (t) => {
70
+ }, N = (t) => {
71
71
  r = t.pointerType, g.onPointerCancel();
72
- }, U = (t) => {
72
+ }, R = (t) => {
73
73
  if (!e.enableDragDrop || !e.dragContext) return;
74
74
  const a = e.dragContext.dragState();
75
75
  if (!a.isDragging) return;
@@ -80,84 +80,78 @@ function de(e) {
80
80
  targetPath: e.item.path,
81
81
  targetItem: e.item
82
82
  }, d, P);
83
- }, V = (t) => {
83
+ }, U = (t) => {
84
84
  if (!e.dragContext) return;
85
85
  T(!1);
86
86
  const a = e.dragContext.dragState();
87
87
  a.isDragging && a.dropTarget?.targetPath === e.item.path && e.dragContext.setDropTarget(null, !1);
88
+ }, V = (t) => {
89
+ g.consumeClickSuppression(t) || o.navigateTo(h);
88
90
  }, j = (t) => {
89
- g.consumeClickSuppression(t) || l.navigateTo(x);
90
- }, G = (t) => {
91
- t.preventDefault(), t.stopPropagation(), !L() && l.showContextMenu(oe({
91
+ t.preventDefault(), t.stopPropagation(), !F() && o.showContextMenu(ae({
92
92
  x: t.clientX,
93
93
  y: t.clientY,
94
94
  triggerItem: e.item,
95
95
  items: [e.item],
96
96
  source: "tree"
97
97
  }));
98
- }, X = () => {
99
- u() && l.toggleFolder(e.item.path);
98
+ }, G = () => {
99
+ x() && o.toggleFolder(e.item.path);
100
100
  };
101
101
  return (() => {
102
- var t = ce(), a = t.firstChild, d = a.firstChild, w = d.firstChild, P = w.nextSibling;
103
- 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, {
104
104
  get when() {
105
- return u();
105
+ return x();
106
106
  },
107
107
  get fallback() {
108
- return ge();
108
+ return ce();
109
109
  },
110
110
  get children() {
111
- var n = le();
112
- return n.$$click = X, s(n, o(re, {
111
+ var n = oe();
112
+ return n.$$click = G, l(n, s(ne, {
113
113
  class: "w-3 h-3 opacity-50"
114
- })), D((c) => {
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;
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;
117
117
  }, {
118
118
  e: void 0,
119
119
  t: void 0
120
120
  }), n;
121
121
  }
122
- }), d), q(d, z(ae, {
123
- onClick: j,
124
- onContextMenu: G,
122
+ }), d), Y(d, q(ie, {
123
+ onClick: V,
124
+ onContextMenu: j,
125
125
  onPointerDown: B,
126
- onPointerMove: H,
127
- onPointerUp: N,
128
- onPointerCancel: R,
126
+ onPointerMove: O,
127
+ onPointerUp: H,
128
+ onPointerCancel: N,
129
129
  get class() {
130
- 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");
131
131
  }
132
- }), !1, !0), s(w, o(v, {
133
- get when() {
134
- return S(() => !!u())() && i();
132
+ }), !1, !0), l(y, s(te, {
133
+ get item() {
134
+ return e.item;
135
135
  },
136
- get fallback() {
137
- return o(ne, {
138
- class: "w-4 h-4"
139
- });
136
+ get open() {
137
+ return i();
140
138
  },
141
- get children() {
142
- return o(te, {
143
- class: "w-4 h-4"
144
- });
145
- }
146
- })), s(P, () => e.item.name), s(d, o(v, {
139
+ class: "w-4 h-4"
140
+ })), l(P, () => e.item.name), l(d, s(w, {
147
141
  get when() {
148
- return u();
142
+ return x();
149
143
  },
150
144
  get children() {
151
- var n = se();
152
- return s(n, $), n;
145
+ var n = le();
146
+ return l(n, $), n;
153
147
  }
154
- }), null), s(t, o(v, {
148
+ }), null), l(t, s(w, {
155
149
  get when() {
156
- return S(() => !!i())() && u();
150
+ return z(() => !!i())() && x();
157
151
  },
158
152
  get children() {
159
- var n = M();
160
- return s(n, o(F, {
153
+ var n = k();
154
+ return l(n, s(M, {
161
155
  get items() {
162
156
  return e.item.children ?? [];
163
157
  },
@@ -173,19 +167,19 @@ function de(e) {
173
167
  get dragContext() {
174
168
  return e.dragContext;
175
169
  }
176
- })), 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;
177
171
  }
178
- }), null), D((n) => {
179
- var c = m(
172
+ }), null), v((n) => {
173
+ var c = f(
180
174
  "group flex items-center w-full py-1 text-xs",
181
175
  "transition-all duration-150 ease-out",
182
176
  "hover:bg-sidebar-accent/60",
183
- C() && "bg-sidebar-accent text-sidebar-accent-foreground font-medium",
177
+ b() && "bg-sidebar-accent text-sidebar-accent-foreground font-medium",
184
178
  // Drop target styling - enhanced visual feedback
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"]
187
- ), f = `${8 + e.depth * 12}px`;
188
- 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;
189
183
  }, {
190
184
  e: void 0,
191
185
  t: void 0
@@ -194,5 +188,5 @@ function de(e) {
194
188
  }
195
189
  K(["contextmenu", "click"]);
196
190
  export {
197
- we as DirectoryTree
191
+ ye as DirectoryTree
198
192
  };
@@ -4,11 +4,18 @@ export interface FileIconProps {
4
4
  class?: string;
5
5
  }
6
6
  type FileIconComponent = Component<FileIconProps>;
7
- type ResolvableFileIcon = Pick<FileItem, 'name' | 'type' | 'extension' | 'icon'>;
7
+ type ResolvableFileIcon = Pick<FileItem, 'name' | 'type' | 'extension' | 'icon' | 'link'>;
8
8
  export type FileItemIconRenderer = FileIconComponent | JSX.Element;
9
+ export interface ResolveFileItemIconOptions {
10
+ open?: boolean;
11
+ }
9
12
  export declare const FolderIcon: (props: FileIconProps) => JSX.Element;
10
13
  export declare const FolderOpenIcon: (props: FileIconProps) => JSX.Element;
14
+ export declare const SymlinkFolderIcon: (props: FileIconProps) => JSX.Element;
15
+ export declare const SymlinkFolderOpenIcon: (props: FileIconProps) => JSX.Element;
11
16
  export declare const FileIcon: (props: FileIconProps) => JSX.Element;
17
+ export declare const SymlinkFileIcon: (props: FileIconProps) => JSX.Element;
18
+ export declare const BrokenSymlinkIcon: (props: FileIconProps) => JSX.Element;
12
19
  export declare const CodeFileIcon: (props: FileIconProps) => JSX.Element;
13
20
  export declare const JavaScriptFileIcon: FileIconComponent;
14
21
  export declare const TypeScriptFileIcon: FileIconComponent;
@@ -18,9 +25,10 @@ export declare const DocumentFileIcon: (props: FileIconProps) => JSX.Element;
18
25
  export declare const ConfigFileIcon: (props: FileIconProps) => JSX.Element;
19
26
  export declare const StyleFileIcon: (props: FileIconProps) => JSX.Element;
20
27
  export declare function getFileIcon(extension?: string): FileIconComponent;
21
- export declare function resolveFileItemIcon(item: ResolvableFileIcon): FileItemIconRenderer;
28
+ export declare function resolveFileItemIcon(item: ResolvableFileIcon, options?: ResolveFileItemIconOptions): FileItemIconRenderer;
22
29
  export declare function FileItemIcon(props: {
23
30
  item: ResolvableFileIcon;
24
31
  class?: string;
32
+ open?: boolean;
25
33
  }): JSX.Element;
26
34
  export {};