@floegence/floe-webapp-core 0.86.49 → 0.86.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/chat/markdown/incremental.js +51 -55
- package/dist/components/ui/DirectoryPicker.js +25 -29
- package/dist/components/ui/FileOpenPicker.js +106 -98
- package/dist/components/ui/FileSavePicker.js +74 -66
- package/dist/components/ui/index.d.ts +2 -0
- package/dist/components/ui/picker/DirectoryFavorites.d.ts +29 -0
- package/dist/components/ui/picker/DirectoryFavorites.js +163 -0
- package/dist/components/ui/picker/PickerBase.d.ts +16 -5
- package/dist/components/ui/picker/PickerBase.js +366 -225
- package/dist/components/ui/picker/PickerNavigation.d.ts +7 -0
- package/dist/components/ui/picker/PickerNavigation.js +73 -66
- package/dist/full.js +465 -463
- package/dist/styles.css +1 -1
- package/dist/ui.js +128 -126
- package/package.json +1 -1
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
import { createComponent as a, insert as n, mergeProps as _, spread as z, effect as
|
|
2
|
-
import { createSignal as
|
|
3
|
-
import { cn as
|
|
1
|
+
import { createComponent as a, insert as n, mergeProps as _, spread as z, effect as b, className as B, setAttribute as E, template as u, delegateEvents as D } from "solid-js/web";
|
|
2
|
+
import { createSignal as F, createMemo as k, createEffect as I, on as O, Show as x, For as K } from "solid-js";
|
|
3
|
+
import { cn as C } from "../../utils/cn.js";
|
|
4
4
|
import { Dialog as T } from "./Dialog.js";
|
|
5
|
-
import { Button as
|
|
5
|
+
import { Button as N } from "./Button.js";
|
|
6
6
|
import { Input as M } from "./Input.js";
|
|
7
7
|
import { FileItemIcon as j } from "../file-browser/FileIcons.js";
|
|
8
8
|
import { deferNonBlocking as q } from "../../utils/defer.js";
|
|
9
9
|
import { usePickerNavigation as A, PickerPanel as R, pickerCopy as g } from "./picker/PickerBase.js";
|
|
10
|
-
var V = /* @__PURE__ */
|
|
11
|
-
function
|
|
12
|
-
const [
|
|
13
|
-
|
|
14
|
-
}), h = k(() =>
|
|
15
|
-
I(O(
|
|
16
|
-
|
|
10
|
+
var V = /* @__PURE__ */ u('<div class="flex min-h-[100px] overflow-hidden rounded border border-border"><div>'), G = /* @__PURE__ */ u('<div class="flex flex-col gap-2 -mt-1">'), H = /* @__PURE__ */ u('<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"></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__ */ u('<div class="flex items-center justify-center h-full text-xs text-muted-foreground">'), L = /* @__PURE__ */ u('<span class="ml-auto text-[10px] text-muted-foreground/60 flex-shrink-0">'), Q = /* @__PURE__ */ u("<button type=button><span class=truncate>");
|
|
11
|
+
function ie(e) {
|
|
12
|
+
const [s, v] = F(e.initialFileName ?? ""), [p, m] = F(""), o = A(e, () => e.open, void 0, () => {
|
|
13
|
+
v(e.initialFileName ?? ""), m("");
|
|
14
|
+
}), h = k(() => o.entries().filter((t) => t.type === "file"));
|
|
15
|
+
I(O(s, () => {
|
|
16
|
+
m("");
|
|
17
17
|
}));
|
|
18
18
|
const S = (t) => {
|
|
19
|
-
|
|
20
|
-
},
|
|
21
|
-
if (!
|
|
22
|
-
const t =
|
|
19
|
+
v(t.name), m("");
|
|
20
|
+
}, $ = () => {
|
|
21
|
+
if (e.disabled || o.view() !== "browse" || !o.valid()) return;
|
|
22
|
+
const t = s().trim();
|
|
23
23
|
if (!t) {
|
|
24
|
-
|
|
24
|
+
m(g(e).fileNameRequired);
|
|
25
25
|
return;
|
|
26
26
|
}
|
|
27
27
|
if (e.validateFileName) {
|
|
28
28
|
const r = e.validateFileName(t);
|
|
29
29
|
if (r) {
|
|
30
|
-
|
|
30
|
+
m(r);
|
|
31
31
|
return;
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
|
-
const l =
|
|
35
|
-
e.onOpenChange(!1), q(() =>
|
|
34
|
+
const l = o.currentPath(), c = e.onSave;
|
|
35
|
+
e.onOpenChange(!1), q(() => c(l, t));
|
|
36
36
|
}, P = () => {
|
|
37
37
|
e.onOpenChange(!1);
|
|
38
38
|
}, y = (t) => {
|
|
39
|
-
t.key === "Enter" && (t.preventDefault(),
|
|
40
|
-
},
|
|
41
|
-
const t =
|
|
39
|
+
t.key === "Enter" && (t.preventDefault(), $());
|
|
40
|
+
}, w = k(() => {
|
|
41
|
+
const t = o.currentPath(), l = s().trim();
|
|
42
42
|
return l ? t === "/" ? `/${l}` : `${t}/${l}` : t;
|
|
43
43
|
});
|
|
44
44
|
return a(T, {
|
|
@@ -52,89 +52,97 @@ function le(e) {
|
|
|
52
52
|
return e.title ?? "Save File";
|
|
53
53
|
},
|
|
54
54
|
get class() {
|
|
55
|
-
return
|
|
55
|
+
return C("max-w-2xl", e.class);
|
|
56
56
|
},
|
|
57
57
|
get footer() {
|
|
58
58
|
return (() => {
|
|
59
|
-
var t =
|
|
60
|
-
return n(
|
|
59
|
+
var t = H(), l = t.firstChild, c = l.firstChild, r = c.nextSibling, i = l.nextSibling, f = i.firstChild;
|
|
60
|
+
return n(c, () => g(e).fileName), n(r, a(M, {
|
|
61
61
|
size: "sm",
|
|
62
62
|
get value() {
|
|
63
|
-
return
|
|
63
|
+
return s();
|
|
64
64
|
},
|
|
65
|
-
onInput: (d) =>
|
|
65
|
+
onInput: (d) => v(d.currentTarget.value),
|
|
66
66
|
onKeyDown: y,
|
|
67
67
|
placeholder: "filename.ext",
|
|
68
68
|
get error() {
|
|
69
69
|
return p();
|
|
70
70
|
}
|
|
71
|
-
})), n(f,
|
|
71
|
+
})), n(f, w), n(i, a(N, {
|
|
72
72
|
variant: "ghost",
|
|
73
73
|
size: "sm",
|
|
74
74
|
onClick: P,
|
|
75
75
|
get children() {
|
|
76
76
|
return e.cancelText ?? g(e).cancel;
|
|
77
77
|
}
|
|
78
|
-
}), null), n(i, a(
|
|
78
|
+
}), null), n(i, a(N, {
|
|
79
79
|
variant: "primary",
|
|
80
80
|
size: "sm",
|
|
81
|
-
onClick:
|
|
81
|
+
onClick: $,
|
|
82
82
|
get disabled() {
|
|
83
|
-
return !
|
|
83
|
+
return !s().trim() || o.view() !== "browse" || !o.valid();
|
|
84
84
|
},
|
|
85
85
|
get children() {
|
|
86
86
|
return e.confirmText ?? "Save";
|
|
87
87
|
}
|
|
88
|
-
}), null),
|
|
88
|
+
}), null), b(() => E(f, "title", w())), t;
|
|
89
89
|
})();
|
|
90
90
|
},
|
|
91
91
|
get children() {
|
|
92
|
-
var t =
|
|
92
|
+
var t = G();
|
|
93
93
|
return n(t, a(R, _(e, {
|
|
94
|
-
source:
|
|
95
|
-
})),
|
|
96
|
-
class: "max-h-[160px] w-full min-w-0 overflow-y-auto"
|
|
97
|
-
}), !1, !0), n(o, a(w, {
|
|
94
|
+
source: o
|
|
95
|
+
})), null), n(t, a(x, {
|
|
98
96
|
get when() {
|
|
99
|
-
return
|
|
100
|
-
},
|
|
101
|
-
get fallback() {
|
|
102
|
-
return (() => {
|
|
103
|
-
var r = H();
|
|
104
|
-
return n(r, () => g(e).emptyFiles), r;
|
|
105
|
-
})();
|
|
97
|
+
return o.view() === "browse";
|
|
106
98
|
},
|
|
107
99
|
get children() {
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
100
|
+
var l = V(), c = l.firstChild;
|
|
101
|
+
return z(c, _(() => e.scrollViewportProps, {
|
|
102
|
+
class: "max-h-[160px] w-full min-w-0 overflow-y-auto"
|
|
103
|
+
}), !1, !0), n(c, a(x, {
|
|
104
|
+
get when() {
|
|
105
|
+
return h().length > 0;
|
|
106
|
+
},
|
|
107
|
+
get fallback() {
|
|
108
|
+
return (() => {
|
|
109
|
+
var r = J();
|
|
110
|
+
return n(r, () => g(e).emptyFiles), r;
|
|
111
|
+
})();
|
|
111
112
|
},
|
|
112
|
-
children
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
size: 16,
|
|
117
|
-
class: "w-4 h-4 flex-shrink-0"
|
|
118
|
-
}), f), n(f, () => r.name), n(i, a(w, {
|
|
119
|
-
get when() {
|
|
120
|
-
return r.size != null;
|
|
113
|
+
get children() {
|
|
114
|
+
return a(K, {
|
|
115
|
+
get each() {
|
|
116
|
+
return h();
|
|
121
117
|
},
|
|
122
|
-
|
|
123
|
-
var
|
|
124
|
-
return
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
118
|
+
children: (r) => (() => {
|
|
119
|
+
var i = Q(), f = i.firstChild;
|
|
120
|
+
return i.$$click = () => S(r), n(i, a(j, {
|
|
121
|
+
item: r,
|
|
122
|
+
size: 16,
|
|
123
|
+
class: "w-4 h-4 flex-shrink-0"
|
|
124
|
+
}), f), n(f, () => r.name), n(i, a(x, {
|
|
125
|
+
get when() {
|
|
126
|
+
return r.size != null;
|
|
127
|
+
},
|
|
128
|
+
get children() {
|
|
129
|
+
var d = L();
|
|
130
|
+
return n(d, () => U(r.size)), d;
|
|
131
|
+
}
|
|
132
|
+
}), null), b(() => B(i, 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", s() === r.name && "bg-accent text-accent-foreground font-medium"))), i;
|
|
133
|
+
})()
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
})), l;
|
|
129
137
|
}
|
|
130
|
-
})), t;
|
|
138
|
+
}), null), t;
|
|
131
139
|
}
|
|
132
140
|
});
|
|
133
141
|
}
|
|
134
|
-
function
|
|
142
|
+
function U(e) {
|
|
135
143
|
return e < 1024 ? `${e} B` : e < 1024 * 1024 ? `${(e / 1024).toFixed(1)} KB` : `${(e / (1024 * 1024)).toFixed(1)} MB`;
|
|
136
144
|
}
|
|
137
145
|
D(["click"]);
|
|
138
146
|
export {
|
|
139
|
-
|
|
147
|
+
ie as FileSavePicker
|
|
140
148
|
};
|
|
@@ -47,3 +47,5 @@ export { SurfaceAnchoredLayer, type SurfaceAnchoredLayerProps } from './SurfaceA
|
|
|
47
47
|
export { PersistentHorizontalScrollbar, type PersistentHorizontalScrollbarProps } from './PersistentHorizontalScrollbar';
|
|
48
48
|
export { SettingsLayout, SettingsNavigation, SettingsSection, SettingsList, SettingRow, type SettingsNavigationItem, type SettingsNavigationGroup, type SettingsNavigationProps, type SettingsSectionProps, type SettingRowProps, } from './Settings';
|
|
49
49
|
export { KeyedFor, type KeyedForProps } from './KeyedFor';
|
|
50
|
+
export { DirectoryFavoriteButton } from './picker/DirectoryFavorites';
|
|
51
|
+
export type { DirectoryFavorites } from './picker/DirectoryFavorites';
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { type JSX } from 'solid-js';
|
|
2
|
+
import type { PickerCopy } from './PickerNavigation';
|
|
3
|
+
/** Controlled navigation metadata. The host owns authentication, persistence and refresh. */
|
|
4
|
+
export interface DirectoryFavorites {
|
|
5
|
+
paths: readonly string[];
|
|
6
|
+
loading?: boolean;
|
|
7
|
+
error?: string;
|
|
8
|
+
editable?: boolean;
|
|
9
|
+
pendingPaths?: readonly string[];
|
|
10
|
+
onRefresh?: () => void | Promise<void>;
|
|
11
|
+
onSetFavorite?: (path: string, favorite: boolean) => Promise<void>;
|
|
12
|
+
}
|
|
13
|
+
export declare function DirectoryFavoriteButton(props: {
|
|
14
|
+
path: string;
|
|
15
|
+
favorites: DirectoryFavorites;
|
|
16
|
+
copy: PickerCopy;
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
onError?: (message: string) => void;
|
|
19
|
+
}): JSX.Element;
|
|
20
|
+
/** A navigation button and favorite action are siblings; the menu captures its target on open. */
|
|
21
|
+
export declare function PickerDirectoryRow(props: {
|
|
22
|
+
path: string;
|
|
23
|
+
favorites?: DirectoryFavorites;
|
|
24
|
+
copy: PickerCopy;
|
|
25
|
+
disabled?: boolean;
|
|
26
|
+
scopeKey?: string;
|
|
27
|
+
children: JSX.Element;
|
|
28
|
+
onError: (message: string) => void;
|
|
29
|
+
}): JSX.Element;
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import { createComponent as l, insert as m, memo as S, effect as p, template as k, use as g, delegateEvents as D } from "solid-js/web";
|
|
2
|
+
import { createSignal as E, createEffect as b, on as L, onCleanup as B, Show as w } from "solid-js";
|
|
3
|
+
import { Star as F } from "../../icons/index.js";
|
|
4
|
+
import { Button as C } from "../Button.js";
|
|
5
|
+
import { SurfaceFloatingLayer as M } from "../SurfaceFloatingLayer.js";
|
|
6
|
+
import { useOverlayMask as P } from "../../../hooks/useOverlayMask.js";
|
|
7
|
+
var _ = /* @__PURE__ */ k('<div class="flex min-w-0 items-center">'), R = /* @__PURE__ */ k('<button type=button role=menuitem class="flex w-full cursor-pointer items-center gap-2 rounded px-2 py-1.5 text-left text-xs hover:bg-accent focus:bg-accent focus:outline-none">');
|
|
8
|
+
function z(e) {
|
|
9
|
+
const [s, f] = E(!1), a = () => e.favorites.paths.includes(e.path), u = () => a() ? e.copy.unfavoriteDirectory : e.copy.favoriteDirectory, v = async () => {
|
|
10
|
+
const n = e.favorites, d = e.path;
|
|
11
|
+
if (!(!n.editable || !n.onSetFavorite || s() || e.disabled || n.pendingPaths?.includes(d))) {
|
|
12
|
+
f(!0), e.onError?.("");
|
|
13
|
+
try {
|
|
14
|
+
await n.onSetFavorite(d, !a());
|
|
15
|
+
} catch (o) {
|
|
16
|
+
e.onError?.(o instanceof Error ? o.message : e.copy.favoritesLoadFailed);
|
|
17
|
+
} finally {
|
|
18
|
+
f(!1);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
return l(C, {
|
|
23
|
+
type: "button",
|
|
24
|
+
size: "sm",
|
|
25
|
+
variant: "ghost",
|
|
26
|
+
class: "shrink-0",
|
|
27
|
+
get "aria-label"() {
|
|
28
|
+
return u() + ": " + e.path;
|
|
29
|
+
},
|
|
30
|
+
get title() {
|
|
31
|
+
return u();
|
|
32
|
+
},
|
|
33
|
+
get "aria-pressed"() {
|
|
34
|
+
return a();
|
|
35
|
+
},
|
|
36
|
+
get loading() {
|
|
37
|
+
return s() || e.favorites.pendingPaths?.includes(e.path);
|
|
38
|
+
},
|
|
39
|
+
icon: () => l(F, {
|
|
40
|
+
get class() {
|
|
41
|
+
return a() ? "h-3.5 w-3.5 fill-current text-warning" : "h-3.5 w-3.5";
|
|
42
|
+
}
|
|
43
|
+
}),
|
|
44
|
+
get disabled() {
|
|
45
|
+
return e.disabled || !e.favorites.editable || !e.favorites.onSetFavorite;
|
|
46
|
+
},
|
|
47
|
+
onClick: () => {
|
|
48
|
+
v();
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
function Y(e) {
|
|
53
|
+
const [s, f] = E();
|
|
54
|
+
let a, u, v;
|
|
55
|
+
const n = (o = !1) => {
|
|
56
|
+
const r = s()?.owner;
|
|
57
|
+
f(void 0), o && r?.isConnected && r.focus();
|
|
58
|
+
}, d = (o) => {
|
|
59
|
+
if (!e.favorites?.editable || e.disabled) return;
|
|
60
|
+
o.preventDefault(), o.stopPropagation();
|
|
61
|
+
const r = o.target instanceof HTMLElement ? o.target.closest("button") ?? a : a, t = r.getBoundingClientRect();
|
|
62
|
+
f({
|
|
63
|
+
path: e.path,
|
|
64
|
+
favorites: e.favorites,
|
|
65
|
+
favorite: !e.favorites.paths.includes(e.path),
|
|
66
|
+
owner: r,
|
|
67
|
+
x: o instanceof MouseEvent ? o.clientX : t.left,
|
|
68
|
+
y: o instanceof MouseEvent ? o.clientY : t.bottom
|
|
69
|
+
}), queueMicrotask(() => u?.focus());
|
|
70
|
+
};
|
|
71
|
+
return b(L(() => e.scopeKey, () => n())), P({
|
|
72
|
+
open: () => !!s(),
|
|
73
|
+
root: () => v,
|
|
74
|
+
onClose: () => n(!0),
|
|
75
|
+
closeOnEscape: !0,
|
|
76
|
+
lockBodyScroll: !1,
|
|
77
|
+
trapFocus: !1,
|
|
78
|
+
autoFocus: !1,
|
|
79
|
+
restoreFocus: !1,
|
|
80
|
+
blockHotkeys: !1
|
|
81
|
+
}), b(() => {
|
|
82
|
+
if (!s()) return;
|
|
83
|
+
const o = (t) => {
|
|
84
|
+
(!(t.target instanceof Element) || !t.target.closest("[data-picker-favorite-menu]")) && n();
|
|
85
|
+
}, r = (t) => {
|
|
86
|
+
(t.key === "Escape" || t.key === "Tab") && (t.key === "Escape" && (t.preventDefault(), t.stopPropagation()), n(t.key === "Escape"));
|
|
87
|
+
};
|
|
88
|
+
document.addEventListener("pointerdown", o, !0), document.addEventListener("keydown", r, !0), B(() => {
|
|
89
|
+
document.removeEventListener("pointerdown", o, !0), document.removeEventListener("keydown", r, !0);
|
|
90
|
+
});
|
|
91
|
+
}), (() => {
|
|
92
|
+
var o = _();
|
|
93
|
+
o.$$keydown = (t) => {
|
|
94
|
+
(t.key === "ContextMenu" || t.shiftKey && t.key === "F10") && d(t);
|
|
95
|
+
}, o.$$contextmenu = d;
|
|
96
|
+
var r = a;
|
|
97
|
+
return typeof r == "function" ? g(r, o) : a = o, m(o, () => e.children, null), m(o, l(w, {
|
|
98
|
+
get when() {
|
|
99
|
+
return e.favorites;
|
|
100
|
+
},
|
|
101
|
+
children: (t) => l(z, {
|
|
102
|
+
get path() {
|
|
103
|
+
return e.path;
|
|
104
|
+
},
|
|
105
|
+
get favorites() {
|
|
106
|
+
return t();
|
|
107
|
+
},
|
|
108
|
+
get copy() {
|
|
109
|
+
return e.copy;
|
|
110
|
+
},
|
|
111
|
+
get disabled() {
|
|
112
|
+
return e.disabled;
|
|
113
|
+
},
|
|
114
|
+
get onError() {
|
|
115
|
+
return e.onError;
|
|
116
|
+
}
|
|
117
|
+
})
|
|
118
|
+
}), null), m(o, l(w, {
|
|
119
|
+
get when() {
|
|
120
|
+
return s();
|
|
121
|
+
},
|
|
122
|
+
children: (t) => l(M, {
|
|
123
|
+
get position() {
|
|
124
|
+
return t();
|
|
125
|
+
},
|
|
126
|
+
get owner() {
|
|
127
|
+
return t().owner;
|
|
128
|
+
},
|
|
129
|
+
estimatedSize: {
|
|
130
|
+
width: 250,
|
|
131
|
+
height: 40
|
|
132
|
+
},
|
|
133
|
+
layerRef: (i) => {
|
|
134
|
+
v = i;
|
|
135
|
+
},
|
|
136
|
+
"data-picker-favorite-menu": "",
|
|
137
|
+
role: "menu",
|
|
138
|
+
class: "z-50 rounded-md border border-border bg-background p-1 shadow-lg",
|
|
139
|
+
get children() {
|
|
140
|
+
var i = R();
|
|
141
|
+
i.$$click = () => {
|
|
142
|
+
const c = t();
|
|
143
|
+
if (!c.favorites.editable || c.favorites.pendingPaths?.includes(c.path)) return;
|
|
144
|
+
const $ = e.onError, x = e.copy.favoritesLoadFailed;
|
|
145
|
+
n(!0), c.favorites.onSetFavorite?.(c.path, c.favorite).catch((h) => $(h instanceof Error ? h.message : x));
|
|
146
|
+
};
|
|
147
|
+
var y = u;
|
|
148
|
+
return typeof y == "function" ? g(y, i) : u = i, m(i, l(F, {
|
|
149
|
+
class: "h-3.5 w-3.5"
|
|
150
|
+
}), null), m(i, (() => {
|
|
151
|
+
var c = S(() => !!t().favorite);
|
|
152
|
+
return () => c() ? e.copy.favoriteDirectory : e.copy.unfavoriteDirectory;
|
|
153
|
+
})(), null), p(() => i.disabled = !t().favorites.editable || !t().favorites.onSetFavorite || t().favorites.pendingPaths?.includes(t().path)), i;
|
|
154
|
+
}
|
|
155
|
+
})
|
|
156
|
+
}), null), o;
|
|
157
|
+
})();
|
|
158
|
+
}
|
|
159
|
+
D(["contextmenu", "keydown", "click"]);
|
|
160
|
+
export {
|
|
161
|
+
z as DirectoryFavoriteButton,
|
|
162
|
+
Y as PickerDirectoryRow
|
|
163
|
+
};
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { type Accessor, type JSX } from 'solid-js';
|
|
2
|
-
import {
|
|
2
|
+
import { type DirectoryFavorites } from './DirectoryFavorites';
|
|
3
|
+
import { parsePickerPath, type PickerDataProps } from './PickerNavigation';
|
|
3
4
|
export interface PickerPanelProps extends PickerDataProps {
|
|
5
|
+
/** Host-owned directory navigation metadata for the current authenticated environment. */
|
|
6
|
+
directoryFavorites?: DirectoryFavorites;
|
|
4
7
|
disabled?: boolean;
|
|
5
8
|
/** Props for the actual constrained scrolling viewport, including host interaction markers. */
|
|
6
9
|
scrollViewportProps?: JSX.HTMLAttributes<HTMLDivElement>;
|
|
@@ -16,6 +19,13 @@ export interface BasePickerProps extends PickerPanelProps {
|
|
|
16
19
|
class?: string;
|
|
17
20
|
}
|
|
18
21
|
export declare function pickerCopy(config: PickerDataProps): {
|
|
22
|
+
favorites: string;
|
|
23
|
+
favoriteDirectory: string;
|
|
24
|
+
unfavoriteDirectory: string;
|
|
25
|
+
favoritesEmpty: string;
|
|
26
|
+
favoritesFilter: string;
|
|
27
|
+
favoritesNoMatches: string;
|
|
28
|
+
favoritesLoadFailed: string;
|
|
19
29
|
path: string;
|
|
20
30
|
go: string;
|
|
21
31
|
roots: string;
|
|
@@ -42,7 +52,9 @@ export declare function pickerCopy(config: PickerDataProps): {
|
|
|
42
52
|
};
|
|
43
53
|
export declare function pickerErrorMessage(props: PickerDataProps, error: unknown): string;
|
|
44
54
|
/** One owner for dialog and embedded pickers. Identity changes close the previous session first. */
|
|
45
|
-
export declare function usePickerNavigation(props:
|
|
55
|
+
export declare function usePickerNavigation(props: PickerPanelProps, open: Accessor<boolean>, onValidated?: (path: string) => void, onReset?: () => void, initialView?: Accessor<PickerLocation>): {
|
|
56
|
+
view: Accessor<PickerLocation>;
|
|
57
|
+
setView: import("solid-js").Setter<PickerLocation>;
|
|
46
58
|
context: Accessor<import("./PickerNavigation").PickerPathContext | null>;
|
|
47
59
|
currentPath: Accessor<string>;
|
|
48
60
|
entries: Accessor<readonly import("../..").FileItem[]>;
|
|
@@ -59,14 +71,13 @@ export declare function usePickerNavigation(props: PickerDataProps, open: Access
|
|
|
59
71
|
setShowHidden(value: boolean): Promise<void>;
|
|
60
72
|
retry(): Promise<void>;
|
|
61
73
|
};
|
|
74
|
+
export type PickerLocation = 'browse' | 'suggestions' | 'favorites';
|
|
62
75
|
/** Absolute directory navigation shared by all picker presentations. */
|
|
63
76
|
export declare function PickerPanel(props: PickerPanelProps & {
|
|
64
|
-
source:
|
|
77
|
+
source: ReturnType<typeof usePickerNavigation>;
|
|
65
78
|
suggestions?: {
|
|
66
79
|
paths: readonly string[];
|
|
67
80
|
label: string;
|
|
68
|
-
visible: boolean;
|
|
69
|
-
onVisibilityChange: (visible: boolean) => void;
|
|
70
81
|
};
|
|
71
82
|
}): JSX.Element;
|
|
72
83
|
export declare const normalizePath: typeof parsePickerPath;
|