@floegence/floe-webapp-core 0.86.76 → 0.87.0
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/index.d.ts +2 -0
- package/dist/components/ui/Accordion.d.ts +16 -0
- package/dist/components/ui/Accordion.js +59 -0
- package/dist/components/ui/Breadcrumb.d.ts +14 -0
- package/dist/components/ui/Breadcrumb.js +72 -0
- package/dist/components/ui/Calendar.d.ts +17 -0
- package/dist/components/ui/Calendar.js +151 -0
- package/dist/components/ui/Checkbox.js +137 -130
- package/dist/components/ui/DataTable.d.ts +33 -0
- package/dist/components/ui/DataTable.js +269 -0
- package/dist/components/ui/DatePicker.d.ts +35 -0
- package/dist/components/ui/DatePicker.js +198 -0
- package/dist/components/ui/Dropdown.d.ts +4 -20
- package/dist/components/ui/Dropdown.js +195 -231
- package/dist/components/ui/Form.d.ts +24 -5
- package/dist/components/ui/Form.js +179 -128
- package/dist/components/ui/Input.d.ts +6 -0
- package/dist/components/ui/Input.js +237 -189
- package/dist/components/ui/Pagination.js +211 -162
- package/dist/components/ui/Popover.d.ts +6 -1
- package/dist/components/ui/Popover.js +75 -56
- package/dist/components/ui/Select.d.ts +46 -0
- package/dist/components/ui/Select.js +414 -0
- package/dist/components/ui/Slider.d.ts +7 -0
- package/dist/components/ui/Slider.js +28 -0
- package/dist/components/ui/Switch.js +41 -32
- package/dist/components/ui/Table.d.ts +9 -0
- package/dist/components/ui/Table.js +97 -0
- package/dist/components/ui/calendarModel.d.ts +6 -0
- package/dist/components/ui/calendarModel.js +37 -0
- package/dist/components/ui/controllable.d.ts +7 -0
- package/dist/components/ui/controllable.js +10 -0
- package/dist/components/ui/dataTableModel.d.ts +18 -0
- package/dist/components/ui/dataTableModel.js +18 -0
- package/dist/components/ui/formFieldContext.d.ts +26 -0
- package/dist/components/ui/formFieldContext.js +40 -0
- package/dist/components/ui/index.d.ts +13 -1
- package/dist/components/ui/picker/PickerBase.js +106 -112
- package/dist/context/LocaleContext.d.ts +55 -0
- package/dist/context/LocaleContext.js +80 -0
- package/dist/context/index.d.ts +1 -0
- package/dist/full.d.ts +2 -0
- package/dist/full.js +776 -737
- package/dist/index.js +111 -107
- package/dist/styles.css +1 -1
- package/dist/ui.js +223 -184
- package/package.json +1 -1
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
import { insert as s, createComponent as l, use as J, setAttribute as u, effect as p, className as fe, memo as
|
|
2
|
-
import { createSignal as
|
|
1
|
+
import { insert as s, createComponent as l, use as J, setAttribute as u, effect as p, className as fe, memo as D, spread as ie, mergeProps as Y, template as h, delegateEvents as ge } from "solid-js/web";
|
|
2
|
+
import { createSignal as V, createEffect as q, on as W, untrack as ce, createMemo as j, createUniqueId as de, Show as w, For as U, onCleanup as ne } from "solid-js";
|
|
3
3
|
import { cn as Q } from "../../../utils/cn.js";
|
|
4
4
|
import { FileItemIcon as ve } from "../../file-browser/FileIcons.js";
|
|
5
5
|
import { FolderOpen as he, ChevronRight as X, FolderPlus as ae } from "../../icons/index.js";
|
|
6
|
-
import { Button as
|
|
7
|
-
import { Input as
|
|
6
|
+
import { Button as R } from "../Button.js";
|
|
7
|
+
import { Input as Z } from "../Input.js";
|
|
8
8
|
import { Popover as me } from "../Popover.js";
|
|
9
9
|
import { PickerDirectoryRow as le, DirectoryFavoriteButton as be } from "./DirectoryFavorites.js";
|
|
10
10
|
import { resolveTabNavigationTargetId as xe } from "../Tabs.js";
|
|
11
|
-
import { createFilesystemPickerDataSource as we, parsePickerPath as
|
|
11
|
+
import { createFilesystemPickerDataSource as we, parsePickerPath as ee, defaultPickerCopy as ye, PickerNavigationError as ke } from "./PickerNavigation.js";
|
|
12
12
|
import { pickerParentPath as et } from "./PickerNavigation.js";
|
|
13
|
-
var $e = /* @__PURE__ */
|
|
14
|
-
function
|
|
13
|
+
var $e = /* @__PURE__ */ h('<div role=tablist class="mb-1 flex min-w-0 items-center gap-4 border-b border-[var(--floe-line)]">'), pe = /* @__PURE__ */ h('<div class="flex min-w-0 items-start gap-1.5"><div class="min-w-0 flex-1">'), Pe = /* @__PURE__ */ h('<div role=alert class="flex items-center gap-2 text-xs text-error"><span class="min-w-0 flex-1 break-words">'), _e = /* @__PURE__ */ h('<div class="flex items-start gap-2 rounded-xs border border-error/30 bg-error/5 px-2 py-1.5 text-xs"role=alert><span class="min-w-0 flex-1 break-words">'), se = /* @__PURE__ */ h("<div>"), Fe = /* @__PURE__ */ h('<div class="flex min-w-0 flex-col gap-2"data-filesystem-picker><div class="flex min-w-0 flex-col gap-2">'), Ce = /* @__PURE__ */ h('<div class="flex flex-wrap items-center gap-1">'), Ie = /* @__PURE__ */ h("<button type=button role=tab>"), Ee = /* @__PURE__ */ h('<div class="flex min-w-0 flex-wrap items-center justify-between gap-2"><nav class="flex min-w-0 flex-wrap items-center gap-0.5 text-xs">'), Ae = /* @__PURE__ */ h("<span role=status>"), Me = /* @__PURE__ */ h('<div class="flex flex-wrap items-center justify-between gap-2 text-xs text-[var(--floe-ink-soft)]"><label class="flex cursor-pointer items-center gap-1.5"><input type=checkbox class=cursor-pointer>'), ze = /* @__PURE__ */ h('<button type=button class="max-w-full cursor-pointer truncate rounded-xs px-1 py-0.5 hover:bg-[var(--floe-state-hover)] focus-visible:ring-1 focus-visible:ring-ring">'), oe = /* @__PURE__ */ h('<p class="px-3 py-6 text-center text-xs text-[var(--floe-ink-soft)]"role=status>'), De = /* @__PURE__ */ h('<p class="px-3 py-6 text-center text-xs text-[var(--floe-ink-soft)]">'), Se = /* @__PURE__ */ h('<button type=button class="flex min-h-8 min-w-0 flex-1 cursor-pointer items-center gap-2 px-2 py-1.5 text-left text-xs hover:bg-[var(--floe-state-selected)] focus:outline-none focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50"><span class="min-w-0 flex-1 truncate">'), Ne = /* @__PURE__ */ h('<button type=button class="flex min-h-14 min-w-0 flex-1 cursor-pointer items-center gap-3 rounded-sm px-2 py-2.5 text-left hover:bg-[var(--floe-state-selected)] focus:outline-none focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50"><span class="flex min-w-0 flex-1 flex-col gap-0.5"><span class="truncate text-xs font-medium"></span><span class="truncate text-caption text-[var(--floe-ink-soft)]">'), Ve = /* @__PURE__ */ h('<form data-picker-create-folder class="flex min-w-0 flex-col gap-4 p-4"><div class="flex min-w-0 items-start gap-2.5"><div class="min-w-0 flex-1"><h3 class="text-sm font-medium"></h3><p class="mt-1 truncate text-xs text-[var(--floe-ink-soft)]"></p></div></div><div class="flex min-w-0 flex-col gap-1.5"><label class="text-xs font-medium"></label></div><div class="flex flex-wrap items-center justify-end gap-2">');
|
|
14
|
+
function te(e) {
|
|
15
15
|
return {
|
|
16
16
|
...ye,
|
|
17
17
|
...e.copy
|
|
18
18
|
};
|
|
19
19
|
}
|
|
20
20
|
function ue(e, o) {
|
|
21
|
-
const i =
|
|
21
|
+
const i = te(e);
|
|
22
22
|
return o instanceof ke ? i[o.kind] : e.formatError?.(o) || (o instanceof Error ? o.message : "") || i.loadFailed;
|
|
23
23
|
}
|
|
24
24
|
function Je(e, o, i, k, P = () => "browse") {
|
|
25
|
-
const [b, _] =
|
|
26
|
-
return
|
|
25
|
+
const [b, _] = V("browse"), F = we(() => e, i);
|
|
26
|
+
return q(W(() => [o(), e.scopeKey], ([I]) => {
|
|
27
27
|
F.close(), I && (_(P()), e.directoryFavorites?.onRefresh?.(), k?.(), F.open(e.initialPath));
|
|
28
|
-
})),
|
|
28
|
+
})), q(() => e.onValidityChange?.(F.valid() && b() === "browse")), {
|
|
29
29
|
...F,
|
|
30
30
|
view: b,
|
|
31
31
|
setView: _
|
|
32
32
|
};
|
|
33
33
|
}
|
|
34
34
|
function Qe(e) {
|
|
35
|
-
const o = () =>
|
|
36
|
-
|
|
35
|
+
const o = () => te(e), i = ce(() => e.source), k = j(() => i.entries().filter((c) => c.type === "folder")), P = j(() => i.context()?.roots.filter((c) => !c.hidden) ?? []), b = de(), [_, F] = V(""), [I, y] = V(""), $ = () => i.view() !== "browse", S = () => !!(e.suggestions?.paths.length || e.directoryFavorites), B = j(() => [...new Set((e.directoryFavorites?.paths ?? []).map((c) => ee(c)).filter(Boolean))]), K = j(() => i.view() === "suggestions" ? e.suggestions?.paths ?? [] : B().filter((c) => c.toLocaleLowerCase().includes(_().trim().toLocaleLowerCase())));
|
|
36
|
+
q(W(() => e.scopeKey, () => {
|
|
37
37
|
F(""), y("");
|
|
38
38
|
}));
|
|
39
|
-
let
|
|
40
|
-
const
|
|
39
|
+
let L;
|
|
40
|
+
const T = j(() => [...e.suggestions?.paths.length ? [{
|
|
41
41
|
id: "suggestions",
|
|
42
42
|
label: e.suggestions.label,
|
|
43
43
|
disabled: e.disabled
|
|
@@ -50,16 +50,16 @@ function Qe(e) {
|
|
|
50
50
|
label: c.label,
|
|
51
51
|
path: c.pathAbs,
|
|
52
52
|
disabled: e.disabled || c.permissions?.read === !1
|
|
53
|
-
}))]),
|
|
53
|
+
}))]), N = () => {
|
|
54
54
|
if ($()) return i.view();
|
|
55
|
-
const c =
|
|
55
|
+
const c = ee(i.pathInput(), i.context()?.homePathAbs);
|
|
56
56
|
return `root:${P().filter((t) => c === t.pathAbs || c.startsWith(t.pathAbs.replace(/\/$/, "") + "/")).sort((t, r) => r.pathAbs.length - t.pathAbs.length)[0]?.id ?? i.context()?.defaultRootId ?? P()[0]?.id}`;
|
|
57
|
-
}, G = /* @__PURE__ */ new Map(),
|
|
57
|
+
}, G = /* @__PURE__ */ new Map(), m = [], x = (c, g, t, r) => {
|
|
58
58
|
let a;
|
|
59
59
|
c.key === "ArrowDown" && (a = Math.min(g + 1, r - 1)), c.key === "ArrowUp" && (a = Math.max(0, g - 1)), c.key === "Home" && (a = 0), c.key === "End" && (a = r - 1), a !== void 0 && (c.preventDefault(), c.stopPropagation(), t[a]?.focus(), t[a]?.scrollIntoView?.({
|
|
60
60
|
block: "nearest"
|
|
61
61
|
}));
|
|
62
|
-
},
|
|
62
|
+
}, E = j(() => {
|
|
63
63
|
const c = i.currentPath();
|
|
64
64
|
if (!c) return [];
|
|
65
65
|
let g = "";
|
|
@@ -70,14 +70,14 @@ function Qe(e) {
|
|
|
70
70
|
path: g,
|
|
71
71
|
name: t
|
|
72
72
|
}))];
|
|
73
|
-
}),
|
|
74
|
-
i.setView("browse"), i.navigate(c),
|
|
75
|
-
}, H = () =>
|
|
73
|
+
}), A = [], M = (c) => {
|
|
74
|
+
i.setView("browse"), i.navigate(c), L?.focus();
|
|
75
|
+
}, H = () => M(i.pathInput());
|
|
76
76
|
return (() => {
|
|
77
77
|
var c = Fe(), g = c.firstChild;
|
|
78
78
|
return s(c, l(w, {
|
|
79
79
|
get when() {
|
|
80
|
-
return
|
|
80
|
+
return S();
|
|
81
81
|
},
|
|
82
82
|
get fallback() {
|
|
83
83
|
return (() => {
|
|
@@ -86,7 +86,7 @@ function Qe(e) {
|
|
|
86
86
|
get each() {
|
|
87
87
|
return P();
|
|
88
88
|
},
|
|
89
|
-
children: (r) => l(
|
|
89
|
+
children: (r) => l(R, {
|
|
90
90
|
type: "button",
|
|
91
91
|
size: "sm",
|
|
92
92
|
get variant() {
|
|
@@ -112,18 +112,18 @@ function Qe(e) {
|
|
|
112
112
|
var t = $e();
|
|
113
113
|
return s(t, l(U, {
|
|
114
114
|
get each() {
|
|
115
|
-
return
|
|
115
|
+
return T();
|
|
116
116
|
},
|
|
117
117
|
children: (r) => (() => {
|
|
118
118
|
var a = Ie();
|
|
119
119
|
return a.$$keydown = (n) => {
|
|
120
|
-
const v = xe(
|
|
120
|
+
const v = xe(T(), r.id, n.key);
|
|
121
121
|
v && (n.preventDefault(), n.stopPropagation(), G.get(v)?.focus());
|
|
122
122
|
}, a.$$click = () => {
|
|
123
|
-
"path" in r ?
|
|
123
|
+
"path" in r ? M(r.path) : (i.setView(r.id), r.id === "favorites" && e.directoryFavorites?.onRefresh?.());
|
|
124
124
|
}, J((n) => G.set(r.id, n), a), u(a, "aria-controls", b), s(a, () => r.label), p((n) => {
|
|
125
|
-
var v = `${b}-${r.id}`, d =
|
|
126
|
-
return v !== n.e && u(a, "id", n.e = v), d !== n.t && u(a, "aria-selected", n.t = d), C !== n.a && u(a, "tabindex", n.a = C), f !== n.o && (a.disabled = n.o = f),
|
|
125
|
+
var v = `${b}-${r.id}`, d = N() === r.id, C = N() === r.id ? 0 : -1, f = r.disabled, z = "path" in r ? r.path : r.label, O = Q("min-w-0 cursor-pointer truncate border-b-2 px-0.5 py-2 text-xs font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50", N() === r.id ? "border-primary text-[var(--floe-accent-ink)]" : "border-transparent text-[var(--floe-ink-soft)] hover:text-foreground");
|
|
126
|
+
return v !== n.e && u(a, "id", n.e = v), d !== n.t && u(a, "aria-selected", n.t = d), C !== n.a && u(a, "tabindex", n.a = C), f !== n.o && (a.disabled = n.o = f), z !== n.i && u(a, "title", n.i = z), O !== n.n && fe(a, n.n = O), n;
|
|
127
127
|
}, {
|
|
128
128
|
e: void 0,
|
|
129
129
|
t: void 0,
|
|
@@ -141,10 +141,10 @@ function Qe(e) {
|
|
|
141
141
|
},
|
|
142
142
|
get children() {
|
|
143
143
|
var t = pe(), r = t.firstChild;
|
|
144
|
-
return s(r, l(
|
|
144
|
+
return s(r, l(Z, {
|
|
145
145
|
ref(a) {
|
|
146
|
-
var n =
|
|
147
|
-
typeof n == "function" ? n(a) :
|
|
146
|
+
var n = L;
|
|
147
|
+
typeof n == "function" ? n(a) : L = a;
|
|
148
148
|
},
|
|
149
149
|
size: "sm",
|
|
150
150
|
get "aria-label"() {
|
|
@@ -161,7 +161,7 @@ function Qe(e) {
|
|
|
161
161
|
onKeyDown: (a) => {
|
|
162
162
|
a.key === "Enter" && (a.preventDefault(), a.stopPropagation(), H());
|
|
163
163
|
}
|
|
164
|
-
})), s(t, l(
|
|
164
|
+
})), s(t, l(R, {
|
|
165
165
|
size: "sm",
|
|
166
166
|
variant: "outline",
|
|
167
167
|
onClick: H,
|
|
@@ -179,7 +179,7 @@ function Qe(e) {
|
|
|
179
179
|
},
|
|
180
180
|
get children() {
|
|
181
181
|
var t = Pe(), r = t.firstChild;
|
|
182
|
-
return s(r, () => I() || e.directoryFavorites?.error), s(t, l(
|
|
182
|
+
return s(r, () => I() || e.directoryFavorites?.error), s(t, l(R, {
|
|
183
183
|
size: "sm",
|
|
184
184
|
variant: "ghost",
|
|
185
185
|
get disabled() {
|
|
@@ -195,11 +195,11 @@ function Qe(e) {
|
|
|
195
195
|
}
|
|
196
196
|
}), null), s(g, l(w, {
|
|
197
197
|
get when() {
|
|
198
|
-
return
|
|
198
|
+
return D(() => !!i.error())() && !$();
|
|
199
199
|
},
|
|
200
200
|
get children() {
|
|
201
201
|
var t = _e(), r = t.firstChild;
|
|
202
|
-
return s(r, () => ue(e, i.error())), s(t, l(
|
|
202
|
+
return s(r, () => ue(e, i.error())), s(t, l(R, {
|
|
203
203
|
size: "sm",
|
|
204
204
|
variant: "ghost",
|
|
205
205
|
onClick: () => {
|
|
@@ -222,7 +222,7 @@ function Qe(e) {
|
|
|
222
222
|
var t = Ee(), r = t.firstChild;
|
|
223
223
|
return s(r, l(U, {
|
|
224
224
|
get each() {
|
|
225
|
-
return
|
|
225
|
+
return E();
|
|
226
226
|
},
|
|
227
227
|
children: (a, n) => [l(w, {
|
|
228
228
|
get when() {
|
|
@@ -238,8 +238,8 @@ function Qe(e) {
|
|
|
238
238
|
return v.$$click = () => {
|
|
239
239
|
i.navigate(a.path);
|
|
240
240
|
}, s(v, () => a.name), p((d) => {
|
|
241
|
-
var C = a.path, f = e.disabled,
|
|
242
|
-
return C !== d.e && u(v, "title", d.e = C), f !== d.t && (v.disabled = d.t = f),
|
|
241
|
+
var C = a.path, f = e.disabled, z = a.path === i.currentPath() ? "location" : void 0;
|
|
242
|
+
return C !== d.e && u(v, "title", d.e = C), f !== d.t && (v.disabled = d.t = f), z !== d.a && u(v, "aria-current", d.a = z), d;
|
|
243
243
|
}, {
|
|
244
244
|
e: void 0,
|
|
245
245
|
t: void 0,
|
|
@@ -277,7 +277,7 @@ function Qe(e) {
|
|
|
277
277
|
}), null), p(() => u(r, "aria-label", o().currentDirectory)), t;
|
|
278
278
|
})(), (() => {
|
|
279
279
|
var t = se();
|
|
280
|
-
return
|
|
280
|
+
return ie(t, Y(() => e.scrollViewportProps, {
|
|
281
281
|
get class() {
|
|
282
282
|
return Q("min-h-[120px] overflow-y-auto rounded-xs border border-[var(--floe-line)]", e.scrollViewportProps?.class);
|
|
283
283
|
},
|
|
@@ -336,11 +336,11 @@ function Qe(e) {
|
|
|
336
336
|
onError: y,
|
|
337
337
|
get children() {
|
|
338
338
|
var n = Se(), v = n.firstChild;
|
|
339
|
-
return n.$$keydown = (d) => x(d, a(),
|
|
339
|
+
return n.$$keydown = (d) => x(d, a(), A, k().length), n.$$click = () => {
|
|
340
340
|
i.navigate(r.path);
|
|
341
341
|
}, J((d) => {
|
|
342
|
-
|
|
343
|
-
|
|
342
|
+
q(() => {
|
|
343
|
+
A[a()] = d;
|
|
344
344
|
});
|
|
345
345
|
}, n), s(n, l(ve, {
|
|
346
346
|
item: r,
|
|
@@ -368,7 +368,7 @@ function Qe(e) {
|
|
|
368
368
|
i.setShowHidden(n.currentTarget.checked);
|
|
369
369
|
}), s(r, () => o().showHidden, null), s(t, l(w, {
|
|
370
370
|
get when() {
|
|
371
|
-
return
|
|
371
|
+
return D(() => !!i.pending())() && i.currentPath();
|
|
372
372
|
},
|
|
373
373
|
get children() {
|
|
374
374
|
var n = Ae();
|
|
@@ -383,7 +383,7 @@ function Qe(e) {
|
|
|
383
383
|
return i.view() === "favorites";
|
|
384
384
|
},
|
|
385
385
|
get children() {
|
|
386
|
-
return l(
|
|
386
|
+
return l(Z, {
|
|
387
387
|
size: "sm",
|
|
388
388
|
get "aria-label"() {
|
|
389
389
|
return o().favoritesFilter;
|
|
@@ -399,7 +399,7 @@ function Qe(e) {
|
|
|
399
399
|
}
|
|
400
400
|
}), (() => {
|
|
401
401
|
var t = se();
|
|
402
|
-
return
|
|
402
|
+
return ie(t, Y(() => e.scrollViewportProps, {
|
|
403
403
|
get "data-picker-suggestions"() {
|
|
404
404
|
return i.view() === "suggestions" ? "" : void 0;
|
|
405
405
|
},
|
|
@@ -407,10 +407,10 @@ function Qe(e) {
|
|
|
407
407
|
return i.view() === "favorites" ? "" : void 0;
|
|
408
408
|
},
|
|
409
409
|
get "aria-label"() {
|
|
410
|
-
return
|
|
410
|
+
return D(() => i.view() === "favorites")() ? o().favorites : e.suggestions?.label;
|
|
411
411
|
},
|
|
412
412
|
get "aria-busy"() {
|
|
413
|
-
return
|
|
413
|
+
return D(() => i.view() === "favorites")() && e.directoryFavorites?.loading;
|
|
414
414
|
},
|
|
415
415
|
get class() {
|
|
416
416
|
return Q("min-h-[180px] min-w-0 overflow-y-auto", e.scrollViewportProps?.class);
|
|
@@ -422,21 +422,21 @@ function Qe(e) {
|
|
|
422
422
|
}
|
|
423
423
|
}), !1, !0), s(t, l(w, {
|
|
424
424
|
get when() {
|
|
425
|
-
return
|
|
425
|
+
return K().length;
|
|
426
426
|
},
|
|
427
427
|
get fallback() {
|
|
428
428
|
return (() => {
|
|
429
429
|
var r = oe();
|
|
430
430
|
return s(r, (() => {
|
|
431
|
-
var a =
|
|
432
|
-
return () => a() ? o().loading :
|
|
431
|
+
var a = D(() => !!e.directoryFavorites?.loading);
|
|
432
|
+
return () => a() ? o().loading : D(() => !!e.directoryFavorites?.error)() ? o().favoritesLoadFailed : D(() => !!_().trim())() ? o().favoritesNoMatches : o().favoritesEmpty;
|
|
433
433
|
})()), r;
|
|
434
434
|
})();
|
|
435
435
|
},
|
|
436
436
|
get children() {
|
|
437
437
|
return l(U, {
|
|
438
438
|
get each() {
|
|
439
|
-
return
|
|
439
|
+
return K();
|
|
440
440
|
},
|
|
441
441
|
children: (r, a) => l(le, {
|
|
442
442
|
path: r,
|
|
@@ -455,19 +455,19 @@ function Qe(e) {
|
|
|
455
455
|
onError: y,
|
|
456
456
|
get children() {
|
|
457
457
|
var n = Ne(), v = n.firstChild, d = v.firstChild, C = d.nextSibling;
|
|
458
|
-
return n.$$keydown = (f) => x(f, a(),
|
|
459
|
-
|
|
458
|
+
return n.$$keydown = (f) => x(f, a(), m, K().length), n.$$click = () => {
|
|
459
|
+
M(r);
|
|
460
460
|
}, J((f) => {
|
|
461
|
-
|
|
462
|
-
|
|
461
|
+
q(() => {
|
|
462
|
+
m[a()] = f;
|
|
463
463
|
});
|
|
464
464
|
}, n), u(n, "title", r), u(n, "aria-label", r), s(n, l(he, {
|
|
465
465
|
class: "h-4 w-4 shrink-0 text-[var(--floe-ink-soft)]"
|
|
466
466
|
}), v), s(d, () => r.split("/").filter(Boolean).at(-1) ?? o().root), s(C, r), s(n, l(X, {
|
|
467
467
|
class: "h-3 w-3 shrink-0 text-[var(--floe-ink-quiet)]"
|
|
468
468
|
}), null), p((f) => {
|
|
469
|
-
var
|
|
470
|
-
return
|
|
469
|
+
var z = i.view() === "suggestions" ? r : void 0, O = i.view() === "favorites" ? r : void 0, re = e.disabled || !i.context();
|
|
470
|
+
return z !== f.e && u(n, "data-picker-suggested-path", f.e = z), O !== f.t && u(n, "data-picker-favorite-path", f.t = O), re !== f.a && (n.disabled = f.a = re), f;
|
|
471
471
|
}, {
|
|
472
472
|
e: void 0,
|
|
473
473
|
t: void 0,
|
|
@@ -481,7 +481,7 @@ function Qe(e) {
|
|
|
481
481
|
})()];
|
|
482
482
|
}
|
|
483
483
|
}), null), p((t) => {
|
|
484
|
-
var r = i.pending(), a =
|
|
484
|
+
var r = i.pending(), a = S() ? "tabpanel" : void 0, n = S() ? `${b}-${N()}` : void 0;
|
|
485
485
|
return r !== t.e && u(c, "aria-busy", t.e = r), a !== t.t && u(g, "role", t.t = a), n !== t.a && u(g, "aria-labelledby", t.a = n), t;
|
|
486
486
|
}, {
|
|
487
487
|
e: void 0,
|
|
@@ -491,29 +491,29 @@ function Qe(e) {
|
|
|
491
491
|
})();
|
|
492
492
|
}
|
|
493
493
|
function Re(e) {
|
|
494
|
-
const [o, i] =
|
|
495
|
-
let $ = 0,
|
|
496
|
-
const
|
|
494
|
+
const [o, i] = V(!1), [k, P] = V(""), [b, _] = V(!1), [F, I] = V(null), y = () => te(e);
|
|
495
|
+
let $ = 0, S, B;
|
|
496
|
+
const K = de(), L = () => !!k().trim() && ![".", ".."].includes(k().trim()) && !k().includes("/") && !k().includes("\0"), T = () => {
|
|
497
497
|
$++, i(!1), P(""), _(!1), I(null);
|
|
498
498
|
};
|
|
499
|
-
|
|
499
|
+
q(W(() => [e.scopeKey, e.source.context(), e.source.active(), e.source.pathInput()], T)), ne(() => {
|
|
500
500
|
$++;
|
|
501
|
-
}),
|
|
502
|
-
if (!
|
|
503
|
-
const x = requestAnimationFrame(() =>
|
|
501
|
+
}), q(W(o, (m) => {
|
|
502
|
+
if (!m) return;
|
|
503
|
+
const x = requestAnimationFrame(() => S?.focus());
|
|
504
504
|
ne(() => cancelAnimationFrame(x));
|
|
505
505
|
}));
|
|
506
|
-
const
|
|
507
|
-
|
|
506
|
+
const N = () => {
|
|
507
|
+
T(), queueMicrotask(() => B?.focus());
|
|
508
508
|
}, G = async () => {
|
|
509
|
-
if (e.disabled || !
|
|
510
|
-
const
|
|
509
|
+
if (e.disabled || !L() || !e.source.valid() || !e.onCreateFolder || b()) return;
|
|
510
|
+
const m = e.source.currentPath(), x = $, E = e.source.captureIntent(), A = () => $ === x && E();
|
|
511
511
|
_(!0), I(null);
|
|
512
512
|
try {
|
|
513
|
-
if (await e.onCreateFolder(
|
|
514
|
-
P(""), i(!1), await e.source.navigate(
|
|
515
|
-
} catch (
|
|
516
|
-
|
|
513
|
+
if (await e.onCreateFolder(m, k().trim()), !A()) return;
|
|
514
|
+
P(""), i(!1), await e.source.navigate(m), $ === x && e.source.active() && queueMicrotask(() => B?.focus());
|
|
515
|
+
} catch (M) {
|
|
516
|
+
A() && (I(M), queueMicrotask(() => S?.focus()));
|
|
517
517
|
} finally {
|
|
518
518
|
$ === x && _(!1);
|
|
519
519
|
}
|
|
@@ -527,45 +527,39 @@ function Re(e) {
|
|
|
527
527
|
return y().newFolder;
|
|
528
528
|
},
|
|
529
529
|
class: "w-80 overflow-hidden",
|
|
530
|
-
onOpenChange: (
|
|
531
|
-
b() || (
|
|
532
|
-
},
|
|
533
|
-
get trigger() {
|
|
534
|
-
return l(V, {
|
|
535
|
-
ref(h) {
|
|
536
|
-
var x = q;
|
|
537
|
-
typeof x == "function" ? x(h) : q = h;
|
|
538
|
-
},
|
|
539
|
-
size: "sm",
|
|
540
|
-
variant: "ghost",
|
|
541
|
-
icon: ae,
|
|
542
|
-
"aria-haspopup": "dialog",
|
|
543
|
-
get "aria-expanded"() {
|
|
544
|
-
return o();
|
|
545
|
-
},
|
|
546
|
-
get disabled() {
|
|
547
|
-
return e.disabled || !e.source.valid();
|
|
548
|
-
},
|
|
549
|
-
get children() {
|
|
550
|
-
return y().newFolder;
|
|
551
|
-
}
|
|
552
|
-
});
|
|
530
|
+
onOpenChange: (m) => {
|
|
531
|
+
b() || (m ? !e.disabled && e.source.valid() && i(!0) : T());
|
|
553
532
|
},
|
|
533
|
+
trigger: (m) => l(R, Y(m, {
|
|
534
|
+
ref(x) {
|
|
535
|
+
var E = B;
|
|
536
|
+
typeof E == "function" ? E(x) : B = x;
|
|
537
|
+
},
|
|
538
|
+
size: "sm",
|
|
539
|
+
variant: "ghost",
|
|
540
|
+
icon: ae,
|
|
541
|
+
get disabled() {
|
|
542
|
+
return e.disabled || !e.source.valid();
|
|
543
|
+
},
|
|
544
|
+
get children() {
|
|
545
|
+
return y().newFolder;
|
|
546
|
+
}
|
|
547
|
+
})),
|
|
554
548
|
get children() {
|
|
555
|
-
var
|
|
556
|
-
return
|
|
557
|
-
t.isComposing || t.key === "Escape" && (t.preventDefault(), t.stopPropagation(), b() ||
|
|
558
|
-
},
|
|
549
|
+
var m = Ve(), x = m.firstChild, E = x.firstChild, A = E.firstChild, M = A.nextSibling, H = x.nextSibling, c = H.firstChild, g = H.nextSibling;
|
|
550
|
+
return m.$$keydown = (t) => {
|
|
551
|
+
t.isComposing || t.key === "Escape" && (t.preventDefault(), t.stopPropagation(), b() || N());
|
|
552
|
+
}, m.addEventListener("submit", (t) => {
|
|
559
553
|
t.preventDefault(), G();
|
|
560
554
|
}), s(x, l(ae, {
|
|
561
555
|
class: "mt-0.5 h-4 w-4 shrink-0 text-[var(--floe-ink-soft)]"
|
|
562
|
-
}),
|
|
563
|
-
id:
|
|
556
|
+
}), E), s(A, () => y().newFolder), s(M, () => e.source.currentPath()), u(c, "for", K), s(c, () => y().folderName), s(H, l(Z, {
|
|
557
|
+
id: K,
|
|
564
558
|
get "aria-label"() {
|
|
565
559
|
return y().folderName;
|
|
566
560
|
},
|
|
567
561
|
ref: (t) => {
|
|
568
|
-
|
|
562
|
+
S = t, queueMicrotask(() => {
|
|
569
563
|
ce(o) && t.focus();
|
|
570
564
|
});
|
|
571
565
|
},
|
|
@@ -573,7 +567,7 @@ function Re(e) {
|
|
|
573
567
|
return k();
|
|
574
568
|
},
|
|
575
569
|
get error() {
|
|
576
|
-
return
|
|
570
|
+
return D(() => !!F())() ? ue(e, F()) : void 0;
|
|
577
571
|
},
|
|
578
572
|
onInput: (t) => {
|
|
579
573
|
P(t.currentTarget.value), I(null);
|
|
@@ -581,18 +575,18 @@ function Re(e) {
|
|
|
581
575
|
get disabled() {
|
|
582
576
|
return e.disabled || b();
|
|
583
577
|
}
|
|
584
|
-
}), null), s(g, l(
|
|
578
|
+
}), null), s(g, l(R, {
|
|
585
579
|
type: "button",
|
|
586
580
|
size: "sm",
|
|
587
581
|
variant: "ghost-destructive",
|
|
588
582
|
get disabled() {
|
|
589
583
|
return b();
|
|
590
584
|
},
|
|
591
|
-
onClick:
|
|
585
|
+
onClick: N,
|
|
592
586
|
get children() {
|
|
593
587
|
return y().cancel;
|
|
594
588
|
}
|
|
595
|
-
}), null), s(g, l(
|
|
589
|
+
}), null), s(g, l(R, {
|
|
596
590
|
type: "submit",
|
|
597
591
|
size: "sm",
|
|
598
592
|
variant: "primary",
|
|
@@ -600,22 +594,22 @@ function Re(e) {
|
|
|
600
594
|
return b();
|
|
601
595
|
},
|
|
602
596
|
get disabled() {
|
|
603
|
-
return e.disabled || b() || !
|
|
597
|
+
return e.disabled || b() || !L() || !e.source.valid();
|
|
604
598
|
},
|
|
605
599
|
get children() {
|
|
606
600
|
return y().create;
|
|
607
601
|
}
|
|
608
|
-
}), null), p(() => u(
|
|
602
|
+
}), null), p(() => u(M, "title", e.source.currentPath())), m;
|
|
609
603
|
}
|
|
610
604
|
});
|
|
611
605
|
}
|
|
612
|
-
const Xe =
|
|
606
|
+
const Xe = ee;
|
|
613
607
|
ge(["click", "keydown"]);
|
|
614
608
|
export {
|
|
615
609
|
Qe as PickerPanel,
|
|
616
610
|
et as getParentPath,
|
|
617
611
|
Xe as normalizePath,
|
|
618
|
-
|
|
612
|
+
te as pickerCopy,
|
|
619
613
|
ue as pickerErrorMessage,
|
|
620
614
|
Je as usePickerNavigation
|
|
621
615
|
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { type JSX } from 'solid-js';
|
|
2
|
+
export declare const defaultFloeMessages: {
|
|
3
|
+
readonly selectPlaceholder: "Select…";
|
|
4
|
+
readonly searchPlaceholder: "Search…";
|
|
5
|
+
readonly noResults: "No results";
|
|
6
|
+
readonly loading: "Loading…";
|
|
7
|
+
readonly retry: "Retry";
|
|
8
|
+
readonly clear: "Clear";
|
|
9
|
+
readonly close: "Close";
|
|
10
|
+
readonly pagination: "Pagination";
|
|
11
|
+
readonly firstPage: "First page";
|
|
12
|
+
readonly previousPage: "Previous page";
|
|
13
|
+
readonly nextPage: "Next page";
|
|
14
|
+
readonly lastPage: "Last page";
|
|
15
|
+
readonly page: "Page {page}";
|
|
16
|
+
readonly pageOf: "Page {page} of {total}";
|
|
17
|
+
readonly itemCount: "Items: {count}";
|
|
18
|
+
readonly pageSize: "Items per page";
|
|
19
|
+
readonly jumpTo: "Go to page";
|
|
20
|
+
readonly increase: "Increase value";
|
|
21
|
+
readonly decrease: "Decrease value";
|
|
22
|
+
readonly selectedCount: "{count} selected";
|
|
23
|
+
readonly selectAll: "Select all rows";
|
|
24
|
+
readonly selectRow: "Select row {row}";
|
|
25
|
+
readonly sortAscending: "Sort {column} ascending";
|
|
26
|
+
readonly sortDescending: "Sort {column} descending";
|
|
27
|
+
readonly columns: "Columns";
|
|
28
|
+
readonly emptyTable: "No data";
|
|
29
|
+
readonly breadcrumb: "Breadcrumb";
|
|
30
|
+
readonly previousMonth: "Previous month";
|
|
31
|
+
readonly nextMonth: "Next month";
|
|
32
|
+
readonly chooseDate: "Choose date";
|
|
33
|
+
readonly startDate: "Start date";
|
|
34
|
+
readonly endDate: "End date";
|
|
35
|
+
readonly today: "Today";
|
|
36
|
+
};
|
|
37
|
+
export type FloeMessageKey = keyof typeof defaultFloeMessages;
|
|
38
|
+
export type FloeMessages = Record<FloeMessageKey, string>;
|
|
39
|
+
export interface FloeLocale {
|
|
40
|
+
locale: string;
|
|
41
|
+
direction: 'ltr' | 'rtl';
|
|
42
|
+
/** Complete host-owned copy. Never silently fall back across languages. */
|
|
43
|
+
messages: FloeMessages;
|
|
44
|
+
}
|
|
45
|
+
export declare function LocaleProvider(props: {
|
|
46
|
+
value: FloeLocale;
|
|
47
|
+
children: JSX.Element;
|
|
48
|
+
}): JSX.Element;
|
|
49
|
+
export declare function useFloeLocale(): {
|
|
50
|
+
readonly locale: string;
|
|
51
|
+
readonly direction: "ltr" | "rtl";
|
|
52
|
+
t(key: FloeMessageKey, params?: Record<string, string | number>): string;
|
|
53
|
+
number(number: number, options?: Intl.NumberFormatOptions): string;
|
|
54
|
+
date(date: Date, options?: Intl.DateTimeFormatOptions): string;
|
|
55
|
+
};
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { createComponent as l } from "solid-js/web";
|
|
2
|
+
import { createMemo as s, useContext as c, createContext as i } from "solid-js";
|
|
3
|
+
const u = {
|
|
4
|
+
selectPlaceholder: "Select…",
|
|
5
|
+
searchPlaceholder: "Search…",
|
|
6
|
+
noResults: "No results",
|
|
7
|
+
loading: "Loading…",
|
|
8
|
+
retry: "Retry",
|
|
9
|
+
clear: "Clear",
|
|
10
|
+
close: "Close",
|
|
11
|
+
pagination: "Pagination",
|
|
12
|
+
firstPage: "First page",
|
|
13
|
+
previousPage: "Previous page",
|
|
14
|
+
nextPage: "Next page",
|
|
15
|
+
lastPage: "Last page",
|
|
16
|
+
page: "Page {page}",
|
|
17
|
+
pageOf: "Page {page} of {total}",
|
|
18
|
+
itemCount: "Items: {count}",
|
|
19
|
+
pageSize: "Items per page",
|
|
20
|
+
jumpTo: "Go to page",
|
|
21
|
+
increase: "Increase value",
|
|
22
|
+
decrease: "Decrease value",
|
|
23
|
+
selectedCount: "{count} selected",
|
|
24
|
+
selectAll: "Select all rows",
|
|
25
|
+
selectRow: "Select row {row}",
|
|
26
|
+
sortAscending: "Sort {column} ascending",
|
|
27
|
+
sortDescending: "Sort {column} descending",
|
|
28
|
+
columns: "Columns",
|
|
29
|
+
emptyTable: "No data",
|
|
30
|
+
breadcrumb: "Breadcrumb",
|
|
31
|
+
previousMonth: "Previous month",
|
|
32
|
+
nextMonth: "Next month",
|
|
33
|
+
chooseDate: "Choose date",
|
|
34
|
+
startDate: "Start date",
|
|
35
|
+
endDate: "End date",
|
|
36
|
+
today: "Today"
|
|
37
|
+
}, g = {
|
|
38
|
+
locale: "en-US",
|
|
39
|
+
direction: "ltr",
|
|
40
|
+
messages: u
|
|
41
|
+
}, n = i(() => g);
|
|
42
|
+
function f(e) {
|
|
43
|
+
const t = s(() => e.value);
|
|
44
|
+
return l(n.Provider, {
|
|
45
|
+
value: t,
|
|
46
|
+
get children() {
|
|
47
|
+
return e.children;
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
function h() {
|
|
52
|
+
const e = c(n);
|
|
53
|
+
return {
|
|
54
|
+
get locale() {
|
|
55
|
+
return e().locale;
|
|
56
|
+
},
|
|
57
|
+
get direction() {
|
|
58
|
+
return e().direction;
|
|
59
|
+
},
|
|
60
|
+
t(t, o = {}) {
|
|
61
|
+
const a = e().messages[t];
|
|
62
|
+
if (typeof a != "string") throw new Error(`Missing Floe message: ${t}`);
|
|
63
|
+
return a.replace(/\{(\w+)\}/g, (d, r) => {
|
|
64
|
+
if (!(r in o)) throw new Error(`Missing Floe message parameter: ${t}.${r}`);
|
|
65
|
+
return typeof o[r] == "number" ? new Intl.NumberFormat(e().locale).format(o[r]) : o[r];
|
|
66
|
+
});
|
|
67
|
+
},
|
|
68
|
+
number(t, o) {
|
|
69
|
+
return new Intl.NumberFormat(e().locale, o).format(t);
|
|
70
|
+
},
|
|
71
|
+
date(t, o) {
|
|
72
|
+
return new Intl.DateTimeFormat(e().locale, o).format(t);
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
export {
|
|
77
|
+
f as LocaleProvider,
|
|
78
|
+
u as defaultFloeMessages,
|
|
79
|
+
h as useFloeLocale
|
|
80
|
+
};
|
package/dist/context/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { createSimpleContext } from './createSimpleContext';
|
|
2
|
+
export { LocaleProvider, useFloeLocale, defaultFloeMessages, type FloeLocale, type FloeMessages, type FloeMessageKey } from './LocaleContext';
|
|
2
3
|
export { FloeConfigProvider, useFloeConfig, useResolvedFloeConfig, DEFAULT_FLOE_CONFIG, type FloeConfig, type FloeConfigValue, type DeepPartial, type FloeStorageAdapter, type PersistApi, } from './FloeConfigContext';
|
|
3
4
|
export { ThemeProvider, useTheme, createThemeService, type ThemeContextValue } from './ThemeContext';
|
|
4
5
|
export { LayoutProvider, useLayout, useMobileLayout, createLayoutService, type LayoutContextValue } from './LayoutContext';
|
package/dist/full.d.ts
CHANGED
|
@@ -12,3 +12,5 @@ export * from './notes';
|
|
|
12
12
|
export * from './widgets';
|
|
13
13
|
export * from './terminal';
|
|
14
14
|
export { Tag, type TagProps, type TagVariant, type TagSize } from './ui';
|
|
15
|
+
export { Calendar } from './components/icons';
|
|
16
|
+
export { Breadcrumb, type BreadcrumbProps } from './components/file-browser';
|