@floegence/floe-webapp-core 0.60.0 → 0.60.1

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.
@@ -2,7 +2,7 @@ import { type BasePickerProps } from './picker/PickerBase';
2
2
  export interface DirectoryPickerProps extends BasePickerProps {
3
3
  /** Ordered absolute navigation suggestions. They never grant filesystem access or auto-confirm. */
4
4
  suggestedPaths?: readonly string[];
5
- /** Localized heading for host-provided suggestions. */
5
+ /** Localized tab label for host-provided suggestions. */
6
6
  suggestedPathsLabel?: string;
7
7
  /** Receives the validated absolute directory path. */
8
8
  onSelect: (path: string) => void;
@@ -1,19 +1,18 @@
1
- import { createComponent as a, insert as i, setAttribute as o, effect as u, mergeProps as C, template as d, delegateEvents as w } from "solid-js/web";
2
- import { createMemo as $, Show as _, For as S } from "solid-js";
3
- import { cn as y } from "../../utils/cn.js";
4
- import { FolderOpen as p } from "../icons/index.js";
5
- import { Button as v } from "./Button.js";
6
- import { Dialog as O } from "./Dialog.js";
7
- import { usePickerNavigation as B, pickerCopy as b, PickerPanel as D } from "./picker/PickerBase.js";
8
- import { parsePickerPath as z } from "./picker/PickerNavigation.js";
9
- var F = /* @__PURE__ */ d('<section data-picker-suggestions class="mb-3 min-w-0"><p class="mb-1 px-2 text-[11px] font-medium text-muted-foreground">'), L = /* @__PURE__ */ d('<div class="flex w-full items-center gap-2"><span class="min-w-0 flex-1 truncate text-[11px] text-muted-foreground">'), T = /* @__PURE__ */ d('<button type=button class="flex min-h-10 w-full cursor-pointer items-center gap-2 rounded-md px-2 py-1.5 text-left hover:bg-accent/60 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"><span class="truncate text-xs font-medium"></span><span class="truncate text-[11px] text-muted-foreground">');
10
- function I(e) {
11
- const r = B(e, () => e.open), g = $(() => [...new Set((e.suggestedPaths ?? []).map((t) => z(t)).filter(Boolean))]), P = () => {
12
- if (!r.valid()) return;
13
- const t = r.currentPath();
1
+ import { createComponent as r, mergeProps as m, insert as a, effect as f, setAttribute as d, template as h } from "solid-js/web";
2
+ import { createMemo as P, createSignal as b } from "solid-js";
3
+ import { cn as v } from "../../utils/cn.js";
4
+ import { Button as o } from "./Button.js";
5
+ import { Dialog as C } from "./Dialog.js";
6
+ import { usePickerNavigation as x, PickerPanel as S, pickerCopy as k } from "./picker/PickerBase.js";
7
+ import { parsePickerPath as w } from "./picker/PickerNavigation.js";
8
+ var y = /* @__PURE__ */ h('<div class="flex w-full items-center gap-2"><span class="min-w-0 flex-1 truncate text-[11px] text-muted-foreground">');
9
+ function T(e) {
10
+ const l = P(() => [...new Set((e.suggestedPaths ?? []).map((t) => w(t)).filter(Boolean))]), [g, s] = b(!0), i = () => l().length > 0 && g(), n = x(e, () => e.open, void 0, () => s(!0)), u = () => {
11
+ if (e.disabled || i() || !n.valid()) return;
12
+ const t = n.currentPath();
14
13
  e.onSelect(t), e.onOpenChange(!1);
15
14
  };
16
- return a(O, {
15
+ return r(C, {
17
16
  get open() {
18
17
  return e.open;
19
18
  },
@@ -24,65 +23,50 @@ function I(e) {
24
23
  return e.title ?? "Select Directory";
25
24
  },
26
25
  get class() {
27
- return y("max-w-lg", e.class);
26
+ return v("max-w-lg", e.class);
28
27
  },
29
28
  get footer() {
30
29
  return (() => {
31
- var t = L(), s = t.firstChild;
32
- return i(s, () => r.currentPath()), i(t, a(v, {
30
+ var t = y(), c = t.firstChild;
31
+ return a(c, () => n.currentPath()), a(t, r(o, {
33
32
  variant: "ghost",
34
33
  size: "sm",
35
34
  onClick: () => e.onOpenChange(!1),
36
35
  get children() {
37
- return e.cancelText ?? b(e).cancel;
36
+ return e.cancelText ?? k(e).cancel;
38
37
  }
39
- }), null), i(t, a(v, {
38
+ }), null), a(t, r(o, {
40
39
  variant: "primary",
41
40
  size: "sm",
42
- onClick: P,
41
+ onClick: u,
43
42
  get disabled() {
44
- return !r.valid();
43
+ return e.disabled || i() || !n.valid();
45
44
  },
46
45
  get children() {
47
46
  return e.confirmText ?? "Select";
48
47
  }
49
- }), null), u(() => o(s, "title", r.currentPath())), t;
48
+ }), null), f(() => d(c, "title", n.currentPath())), t;
50
49
  })();
51
50
  },
52
51
  get children() {
53
- return [a(_, {
54
- get when() {
55
- return g().length > 0;
56
- },
57
- get children() {
58
- var t = F(), s = t.firstChild;
59
- return i(s, () => e.suggestedPathsLabel ?? "Suggested directories"), i(t, a(S, {
60
- get each() {
61
- return g();
62
- },
63
- children: (l) => (() => {
64
- var n = T(), m = n.firstChild, f = m.firstChild, k = f.nextSibling;
65
- return n.$$click = () => {
66
- r.navigate(l);
67
- }, o(n, "data-picker-suggested-path", l), o(n, "title", l), o(n, "aria-label", l), i(n, a(p, {
68
- class: "h-4 w-4 shrink-0 text-muted-foreground"
69
- }), m), i(f, () => l.split("/").filter(Boolean).at(-1) ?? b(e).root), i(k, l), u((c) => {
70
- var h = r.currentPath() === l ? "location" : void 0, x = e.disabled || !r.context();
71
- return h !== c.e && o(n, "aria-current", c.e = h), x !== c.t && (n.disabled = c.t = x), c;
72
- }, {
73
- e: void 0,
74
- t: void 0
75
- }), n;
76
- })()
77
- }), null), u(() => o(t, "aria-label", e.suggestedPathsLabel ?? "Suggested directories")), t;
52
+ return r(S, m(e, {
53
+ source: n,
54
+ suggestions: {
55
+ get paths() {
56
+ return l();
57
+ },
58
+ get label() {
59
+ return e.suggestedPathsLabel ?? "Suggested directories";
60
+ },
61
+ get visible() {
62
+ return i();
63
+ },
64
+ onVisibilityChange: s
78
65
  }
79
- }), a(D, C(e, {
80
- source: r
81
- }))];
66
+ }));
82
67
  }
83
68
  });
84
69
  }
85
- w(["click"]);
86
70
  export {
87
- I as DirectoryPicker
71
+ T as DirectoryPicker
88
72
  };
@@ -62,6 +62,12 @@ export declare function usePickerNavigation(props: PickerDataProps, open: Access
62
62
  /** Absolute directory navigation shared by all picker presentations. */
63
63
  export declare function PickerPanel(props: PickerPanelProps & {
64
64
  source: FilesystemPickerDataSource;
65
+ suggestions?: {
66
+ paths: readonly string[];
67
+ label: string;
68
+ visible: boolean;
69
+ onVisibilityChange: (visible: boolean) => void;
70
+ };
65
71
  }): JSX.Element;
66
72
  export declare const normalizePath: typeof parsePickerPath;
67
73
  export { pickerParentPath as getParentPath } from './PickerNavigation';