@floegence/floe-webapp-core 0.59.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.
@@ -1,5 +1,9 @@
1
1
  import { type BasePickerProps } from './picker/PickerBase';
2
2
  export interface DirectoryPickerProps extends BasePickerProps {
3
+ /** Ordered absolute navigation suggestions. They never grant filesystem access or auto-confirm. */
4
+ suggestedPaths?: readonly string[];
5
+ /** Localized tab label for host-provided suggestions. */
6
+ suggestedPathsLabel?: string;
3
7
  /** Receives the validated absolute directory path. */
4
8
  onSelect: (path: string) => void;
5
9
  }
@@ -1,16 +1,18 @@
1
- import { createComponent as r, mergeProps as o, insert as i, effect as u, setAttribute as m, template as g } from "solid-js/web";
2
- import { cn as f } from "../../utils/cn.js";
3
- import { Button as c } from "./Button.js";
4
- import { Dialog as s } from "./Dialog.js";
5
- import { usePickerNavigation as h, PickerPanel as d, pickerCopy as x } from "./picker/PickerBase.js";
6
- var C = /* @__PURE__ */ g('<div class="flex w-full items-center gap-2"><span class="min-w-0 flex-1 truncate text-[11px] text-muted-foreground">');
7
- function w(e) {
8
- const t = h(e, () => e.open), a = () => {
9
- if (!t.valid()) return;
10
- const n = t.currentPath();
11
- e.onSelect(n), e.onOpenChange(!1);
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();
13
+ e.onSelect(t), e.onOpenChange(!1);
12
14
  };
13
- return r(s, {
15
+ return r(C, {
14
16
  get open() {
15
17
  return e.open;
16
18
  },
@@ -21,38 +23,50 @@ function w(e) {
21
23
  return e.title ?? "Select Directory";
22
24
  },
23
25
  get class() {
24
- return f("max-w-lg", e.class);
26
+ return v("max-w-lg", e.class);
25
27
  },
26
28
  get footer() {
27
29
  return (() => {
28
- var n = C(), l = n.firstChild;
29
- return i(l, () => t.currentPath()), i(n, r(c, {
30
+ var t = y(), c = t.firstChild;
31
+ return a(c, () => n.currentPath()), a(t, r(o, {
30
32
  variant: "ghost",
31
33
  size: "sm",
32
34
  onClick: () => e.onOpenChange(!1),
33
35
  get children() {
34
- return e.cancelText ?? x(e).cancel;
36
+ return e.cancelText ?? k(e).cancel;
35
37
  }
36
- }), null), i(n, r(c, {
38
+ }), null), a(t, r(o, {
37
39
  variant: "primary",
38
40
  size: "sm",
39
- onClick: a,
41
+ onClick: u,
40
42
  get disabled() {
41
- return !t.valid();
43
+ return e.disabled || i() || !n.valid();
42
44
  },
43
45
  get children() {
44
46
  return e.confirmText ?? "Select";
45
47
  }
46
- }), null), u(() => m(l, "title", t.currentPath())), n;
48
+ }), null), f(() => d(c, "title", n.currentPath())), t;
47
49
  })();
48
50
  },
49
51
  get children() {
50
- return r(d, o(e, {
51
- source: 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
65
+ }
52
66
  }));
53
67
  }
54
68
  });
55
69
  }
56
70
  export {
57
- w as DirectoryPicker
71
+ T as DirectoryPicker
58
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';