vlite3 1.4.34 → 1.4.37

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,4 +1,4 @@
1
- import { defineComponent as Q, ref as L, shallowRef as E, watch as T, computed as v, openBlock as p, createElementBlock as k, normalizeClass as $, Fragment as q, renderList as V, isMemoSame as z, createBlock as F, createSlots as P, withCtx as A, renderSlot as R, mergeProps as U, toDisplayString as j } from "vue";
1
+ import { defineComponent as Q, ref as L, shallowRef as E, watch as T, computed as p, openBlock as w, createElementBlock as b, normalizeClass as $, Fragment as q, renderList as V, isMemoSame as z, createBlock as F, createSlots as P, withCtx as A, renderSlot as R, mergeProps as U, toDisplayString as j } from "vue";
2
2
  import G from "./FileTreeNode.vue.js";
3
3
  import { $t as x } from "../../utils/i18n.js";
4
4
  const H = {
@@ -23,54 +23,54 @@ const H = {
23
23
  },
24
24
  emits: ["update:modelValue", "select", "expand", "node-click"],
25
25
  setup(o, { emit: C }) {
26
- const s = o, m = C, u = L(new Set(s.defaultExpandedKeys)), f = L(/* @__PURE__ */ new Set()), g = E(/* @__PURE__ */ new Map()), b = E(/* @__PURE__ */ new Map()), I = (t, l) => {
27
- const e = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), a = (n, c) => {
28
- for (const r of n)
29
- e.set(r.id, r), c && i.set(r.id, c), r.children && a(r.children, r.id);
26
+ const i = o, m = C, u = L(new Set(i.defaultExpandedKeys)), f = L(/* @__PURE__ */ new Set()), g = E(/* @__PURE__ */ new Map()), S = E(/* @__PURE__ */ new Map()), I = (t, l) => {
27
+ const e = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map(), a = (s, c) => {
28
+ for (const r of s)
29
+ e.set(r.id, r), c && n.set(r.id, c), r.children && a(r.children, r.id);
30
30
  };
31
- a(t, l), g.value = e, b.value = i;
31
+ a(t, l), g.value = e, S.value = n;
32
32
  };
33
33
  T(
34
- () => s.data,
34
+ () => i.data,
35
35
  (t) => {
36
36
  I(t);
37
37
  },
38
38
  { immediate: !0, deep: !0 }
39
39
  );
40
- const w = (t) => {
40
+ const k = (t) => {
41
41
  let l = [];
42
42
  if (t.children)
43
43
  for (const e of t.children)
44
- l.push(e.id), l = l.concat(w(e));
44
+ l.push(e.id), l = l.concat(k(e));
45
45
  return l;
46
- }, y = v(() => new Set(s.modelValue)), S = v(() => {
46
+ }, v = p(() => new Set(i.modelValue)), M = p(() => {
47
47
  const t = /* @__PURE__ */ new Set();
48
- if (s.selectionMode !== "multiple") return t;
48
+ if (i.selectionMode !== "multiple") return t;
49
49
  const l = (e) => {
50
50
  if (!e.children || e.children.length === 0)
51
- return y.value.has(e.id) ? { status: "checked" } : { status: "unchecked" };
52
- let i = !1, a = !1, n = !1;
51
+ return v.value.has(e.id) ? { status: "checked" } : { status: "unchecked" };
52
+ let n = !1, a = !1, s = !1;
53
53
  for (const c of e.children) {
54
54
  const r = l(c);
55
- r.status === "checked" && (i = !0), r.status === "unchecked" && (a = !0), r.status === "indeterminate" && (n = !0);
55
+ r.status === "checked" && (n = !0), r.status === "unchecked" && (a = !0), r.status === "indeterminate" && (s = !0);
56
56
  }
57
- return n || i && a ? (t.add(e.id), { status: "indeterminate" }) : i ? { status: "checked" } : { status: "unchecked" };
57
+ return s || n && a ? (t.add(e.id), { status: "indeterminate" }) : n ? { status: "checked" } : { status: "unchecked" };
58
58
  };
59
- return s.data.forEach(l), t;
59
+ return i.data.forEach(l), t;
60
60
  }), D = async (t) => {
61
61
  if (t.disabled) return;
62
62
  if (u.value.has(t.id)) {
63
63
  const e = new Set(u.value);
64
64
  e.delete(t.id);
65
- const i = g.value.get(t.id) || t;
66
- w(i).forEach((n) => e.delete(n)), u.value = e, m("expand", t, !1);
65
+ const n = g.value.get(t.id) || t;
66
+ k(n).forEach((s) => e.delete(s)), u.value = e, m("expand", t, !1);
67
67
  } else {
68
68
  const e = new Set(u.value);
69
- if (e.add(t.id), u.value = e, m("expand", t, !0), s.loadData && !t.isLoaded && (!t.children || t.children.length === 0)) {
70
- const i = new Set(f.value);
71
- i.add(t.id), f.value = i;
69
+ if (e.add(t.id), u.value = e, m("expand", t, !0), i.loadData && !t.isLoaded && (!t.children || t.children.length === 0)) {
70
+ const n = new Set(f.value);
71
+ n.add(t.id), f.value = n;
72
72
  try {
73
- await s.loadData(t);
73
+ await i.loadData(t);
74
74
  } finally {
75
75
  const a = new Set(f.value);
76
76
  a.delete(t.id), f.value = a;
@@ -80,76 +80,78 @@ const H = {
80
80
  }, K = (t) => {
81
81
  if (t.disabled) return;
82
82
  const l = g.value.get(t.id) || t;
83
- let e = new Set(y.value);
84
- const i = e.has(t.id);
85
- if (s.selectionMode === "single")
86
- e.clear(), i || e.add(t.id);
87
- else if (s.selectionMode === "multiple") {
88
- const a = w(l), n = !i, c = (d, h) => {
83
+ let e = new Set(v.value);
84
+ const n = e.has(t.id);
85
+ if (i.selectionMode === "single")
86
+ e.clear(), n || e.add(t.id);
87
+ else if (i.selectionMode === "multiple") {
88
+ const a = k(l), s = !n, c = (d, h) => {
89
89
  h ? e.add(d) : e.delete(d);
90
90
  };
91
- c(t.id, n), a.forEach((d) => c(d, n));
91
+ c(t.id, s), a.forEach((d) => c(d, s));
92
92
  let r = l;
93
93
  for (; ; ) {
94
- const d = b.value.get(r.id);
94
+ const d = S.value.get(r.id);
95
95
  if (!d) break;
96
96
  const h = g.value.get(d);
97
97
  if (!h || !h.children) break;
98
98
  h.children.every((N) => e.has(N.id)) ? e.add(h.id) : e.delete(h.id), r = h;
99
99
  }
100
100
  }
101
- m("update:modelValue", Array.from(e)), m("select", l, !i);
102
- }, M = v(() => {
103
- if (!s.searchQuery) return s.data;
104
- const t = s.searchQuery.toLowerCase(), l = (e) => {
105
- const a = (e.labelI18n ? x(e.labelI18n) : e.label).toLowerCase().includes(t), n = !!e.searchMatch;
101
+ m("update:modelValue", Array.from(e)), m("select", l, !n);
102
+ }, y = p(() => {
103
+ if (!i.searchQuery) return i.data;
104
+ const t = i.searchQuery.toLowerCase(), l = (e) => {
105
+ const a = (e.labelI18n ? x(e.labelI18n) : e.label).toLowerCase().includes(t), s = !!e.searchMatch;
106
106
  let c = [];
107
- return e.children && (c = e.children.map(l).filter((r) => r !== null)), a || n || c.length > 0 ? {
107
+ return e.children && (c = e.children.map(l).filter((r) => r !== null)), a || s || c.length > 0 ? {
108
108
  ...e,
109
109
  children: c
110
110
  } : null;
111
111
  };
112
- return s.data.map(l).filter((e) => e !== null);
112
+ return i.data.map(l).filter((e) => e !== null);
113
113
  });
114
114
  T(
115
- () => [s.searchQuery, s.data],
115
+ () => [i.searchQuery, i.data],
116
116
  ([t]) => {
117
117
  if (t) {
118
- const l = t.toLowerCase(), e = /* @__PURE__ */ new Set(), i = (a) => {
119
- let n = !1;
118
+ const l = t.toLowerCase(), e = /* @__PURE__ */ new Set(), n = (a) => {
119
+ let s = !1;
120
120
  if (a.children)
121
121
  for (const d of a.children)
122
- i(d) && (n = !0);
122
+ n(d) && (s = !0);
123
123
  const r = (a.labelI18n ? x(a.labelI18n) : a.label).toLowerCase().includes(l) || !!a.searchMatch;
124
- return n && e.add(a.id), r || n;
124
+ return s && e.add(a.id), r || s;
125
125
  };
126
- if (s.data.forEach(i), e.size > 0) {
126
+ if (i.data.forEach(n), e.size > 0) {
127
127
  const a = new Set(u.value);
128
- e.forEach((n) => a.add(n)), u.value = a;
128
+ e.forEach((s) => a.add(s)), u.value = a;
129
129
  }
130
130
  }
131
131
  },
132
132
  { deep: !0 }
133
133
  );
134
- const B = v(() => {
135
- if (s.emptyTextI18n) return x(s.emptyTextI18n);
136
- if (s.emptyText) return s.emptyText;
134
+ const B = p(() => {
135
+ if (i.emptyTextI18n) return x(i.emptyTextI18n);
136
+ if (i.emptyText) return i.emptyText;
137
137
  const t = x("vlite.fileTree.emptyText");
138
138
  return t !== "vlite.fileTree.emptyText" ? t : "No results found.";
139
139
  });
140
- return (t, l) => (p(), k("div", {
141
- class: $(["w-full h-full overflow-y-auto file-tree-container", s.class])
140
+ return (t, l) => (w(), b("div", {
141
+ class: $(["w-full h-full overflow-y-auto file-tree-container", i.class])
142
142
  }, [
143
- M.value.length > 0 ? (p(!0), k(q, { key: 0 }, V(M.value, (e, i, a, n) => {
144
- const c = [e, y.value, u.value, S.value, f.value, o.highlightSearch, o.searchQuery, o.showCheckboxes, o.variant, o.maxLabelLength, !!t.$slots.actions];
145
- if (n && n.key === e.id && z(n, c)) return n;
146
- const r = (p(), F(G, {
143
+ y.value.length > 0 ? (w(!0), b(q, { key: 0 }, V(y.value, (e, n, a, s) => {
144
+ const c = [e, v.value, u.value, M.value, f.value, o.highlightSearch, o.searchQuery, o.showCheckboxes, o.variant, o.maxLabelLength, n === y.value.length - 1, !!t.$slots.actions];
145
+ if (s && s.key === e.id && z(s, c)) return s;
146
+ const r = (w(), F(G, {
147
147
  key: e.id,
148
148
  node: e,
149
+ "is-last": n === y.value.length - 1,
150
+ "ancestor-last-flags": [],
149
151
  "selection-mode": o.selectionMode,
150
- "selected-keys": y.value,
152
+ "selected-keys": v.value,
151
153
  "expanded-keys": u.value,
152
- "indeterminate-keys": S.value,
154
+ "indeterminate-keys": M.value,
153
155
  "loading-keys": f.value,
154
156
  "show-checkboxes": o.showCheckboxes,
155
157
  "highlight-search": o.highlightSearch,
@@ -167,9 +169,9 @@ const H = {
167
169
  ]),
168
170
  key: "0"
169
171
  } : void 0
170
- ]), 1032, ["node", "selection-mode", "selected-keys", "expanded-keys", "indeterminate-keys", "loading-keys", "show-checkboxes", "highlight-search", "search-query", "variant", "max-label-length"]));
172
+ ]), 1032, ["node", "is-last", "selection-mode", "selected-keys", "expanded-keys", "indeterminate-keys", "loading-keys", "show-checkboxes", "highlight-search", "search-query", "variant", "max-label-length"]));
171
173
  return r.memo = c, r;
172
- }, l, 1), 128)) : (p(), k("div", H, j(B.value), 1))
174
+ }, l, 1), 128)) : (w(), b("div", H, j(B.value), 1))
173
175
  ], 2));
174
176
  }
175
177
  });
@@ -12,6 +12,10 @@ interface Props {
12
12
  searchQuery?: string;
13
13
  variant?: FileTreeVariant;
14
14
  maxLabelLength?: number;
15
+ /** Whether this node is the last child of its parent. */
16
+ isLast?: boolean;
17
+ /** `isLast` of every ancestor, ordered root → immediate parent. */
18
+ ancestorLastFlags?: boolean[];
15
19
  }
16
20
  declare function __VLS_template(): {
17
21
  attrs: Partial<{}>;
@@ -35,7 +39,9 @@ declare const __VLS_component: import('vue').DefineComponent<Props, {}, {}, {},
35
39
  "onClick-node"?: (node: FileNode) => any;
36
40
  }>, {
37
41
  variant: FileTreeVariant;
42
+ isLast: boolean;
38
43
  depth: number;
44
+ ancestorLastFlags: boolean[];
39
45
  selectionMode: FileTreeSelectionMode;
40
46
  showCheckboxes: boolean;
41
47
  highlightSearch: boolean;
@@ -1,14 +1,15 @@
1
- import { defineComponent as U, computed as d, resolveComponent as A, openBlock as i, createElementBlock as a, createElementVNode as c, normalizeClass as m, normalizeStyle as x, createCommentVNode as u, withModifiers as L, createVNode as E, createBlock as y, Fragment as C, renderList as K, toDisplayString as M, renderSlot as I, isMemoSame as G, createSlots as H, withCtx as J, mergeProps as R } from "vue";
2
- import f from "../Icon.vue.js";
3
- import W from "../CheckBox.vue.js";
4
- import { $t as X } from "../../utils/i18n.js";
5
- const Y = { class: "flex flex-col select-none" }, Z = ["title"], p = {
1
+ import { defineComponent as U, computed as d, resolveComponent as G, openBlock as a, createElementBlock as o, createElementVNode as g, normalizeClass as m, normalizeStyle as k, createCommentVNode as u, createVNode as w, unref as H, withModifiers as C, createBlock as f, Fragment as K, renderList as M, toDisplayString as S, renderSlot as I, isMemoSame as J, createSlots as W, withCtx as X, mergeProps as Y } from "vue";
2
+ import y from "../Icon.vue.js";
3
+ import Z from "../CheckBox.vue.js";
4
+ import p from "../TreeConnectors/TreeConnectors.vue.js";
5
+ import { $t as _ } from "../../utils/i18n.js";
6
+ const ee = { class: "flex flex-col select-none" }, te = ["title"], ne = {
6
7
  key: 1,
7
- class: "w-6 mr-1"
8
- }, _ = { class: "mr-2 text-muted-foreground shrink-0" }, ee = { class: "flex-1 truncate text-sm font-medium" }, te = { class: "mr-2 text-gray-400 select-none shrink-0" }, ne = { class: "truncate" }, le = {
8
+ class: "relative z-10 w-6 mr-1"
9
+ }, le = { class: "mr-2 text-muted-foreground shrink-0" }, se = { class: "flex-1 truncate text-sm font-medium" }, ae = { class: "mr-2 text-gray-400 select-none shrink-0" }, ie = { class: "truncate" }, oe = {
9
10
  key: 0,
10
11
  class: "relative flex flex-col"
11
- }, de = /* @__PURE__ */ U({
12
+ }, P = 20, ue = /* @__PURE__ */ U({
12
13
  name: "FileTreeNode",
13
14
  __name: "FileTreeNode",
14
15
  props: {
@@ -23,162 +24,170 @@ const Y = { class: "flex flex-col select-none" }, Z = ["title"], p = {
23
24
  highlightSearch: { type: Boolean, default: !1 },
24
25
  searchQuery: {},
25
26
  variant: { default: "default" },
26
- maxLabelLength: { default: 35 }
27
+ maxLabelLength: { default: 35 },
28
+ isLast: { type: Boolean, default: !0 },
29
+ ancestorLastFlags: { default: () => [] }
27
30
  },
28
31
  emits: ["toggle-expand", "toggle-select", "click-node"],
29
- setup(e, { emit: P }) {
30
- const n = e, b = P, w = d(() => n.selectedKeys.has(n.node.id)), Q = d(() => n.indeterminateKeys.has(n.node.id)), v = d(() => n.expandedKeys.has(n.node.id)), S = d(() => n.loadingKeys.has(n.node.id)), g = d(
31
- () => n.node.isFolder || n.node.children && n.node.children.length > 0
32
- ), q = d(() => n.depth * 20 + "px"), $ = d(() => n.node.labelI18n ? X(n.node.labelI18n) : n.node.label), z = d(() => {
33
- const t = $.value, l = n.maxLabelLength;
32
+ setup(e, { emit: Q }) {
33
+ const n = e, x = Q, L = d(() => n.selectedKeys.has(n.node.id)), q = d(() => n.indeterminateKeys.has(n.node.id)), v = d(() => n.expandedKeys.has(n.node.id)), $ = d(() => n.loadingKeys.has(n.node.id)), h = d(
34
+ () => !!(n.node.isFolder || n.node.children && n.node.children.length > 0)
35
+ ), F = d(() => [...n.ancestorLastFlags, n.isLast]), D = d(() => n.depth * P + "px"), N = d(() => n.node.labelI18n ? _(n.node.labelI18n) : n.node.label), V = d(() => {
36
+ const t = N.value, l = n.maxLabelLength;
34
37
  if (t.length <= l) return t;
35
- const o = t.lastIndexOf(".");
36
- if (o === -1 || t.length - o > 10)
38
+ const s = t.lastIndexOf(".");
39
+ if (s === -1 || t.length - s > 10)
37
40
  return t.substring(0, l) + "...";
38
- const s = t.substring(o), h = t.substring(0, o), F = Math.max(0, l - s.length - 3);
39
- return h.substring(0, F) + "..." + s;
40
- }), V = d(() => {
41
- const t = z.value;
41
+ const i = t.substring(s), r = t.substring(0, s), E = Math.max(0, l - i.length - 3);
42
+ return r.substring(0, E) + "..." + i;
43
+ }), O = d(() => {
44
+ const t = V.value;
42
45
  if (!n.highlightSearch || !n.searchQuery)
43
46
  return [{ text: t, highlight: !1 }];
44
- const l = n.searchQuery.toLowerCase(), o = t.toLowerCase().indexOf(l);
45
- return o === -1 ? [{ text: t, highlight: !1 }] : [
46
- { text: t.slice(0, o), highlight: !1 },
47
+ const l = n.searchQuery.toLowerCase(), s = t.toLowerCase().indexOf(l);
48
+ return s === -1 ? [{ text: t, highlight: !1 }] : [
49
+ { text: t.slice(0, s), highlight: !1 },
47
50
  {
48
- text: t.slice(o, o + l.length),
51
+ text: t.slice(s, s + l.length),
49
52
  highlight: !0
50
53
  },
51
- { text: t.slice(o + l.length), highlight: !1 }
54
+ { text: t.slice(s + l.length), highlight: !1 }
52
55
  ];
53
- }), D = d(() => {
56
+ }), j = d(() => {
54
57
  const t = n.node.searchMatch;
55
58
  if (!t) return [];
56
- const l = t.line_content, o = t.match_start, s = t.match_length;
57
- return o < 0 || o >= l.length ? [{ text: l, highlight: !1 }] : [
58
- { text: l.substring(0, o), highlight: !1 },
59
- { text: l.substring(o, o + s), highlight: !0 },
60
- { text: l.substring(o + s), highlight: !1 }
59
+ const l = t.line_content, s = t.match_start, i = t.match_length;
60
+ return s < 0 || s >= l.length ? [{ text: l, highlight: !1 }] : [
61
+ { text: l.substring(0, s), highlight: !1 },
62
+ { text: l.substring(s, s + i), highlight: !0 },
63
+ { text: l.substring(s + i), highlight: !1 }
61
64
  ];
62
- }), N = (t) => {
63
- t && t.stopPropagation(), b("toggle-expand", n.node);
64
- }, O = () => {
65
- b("toggle-select", n.node);
66
- }, j = (t) => {
67
- t.stopPropagation(), g.value ? N() : n.selectionMode !== "none" && b("toggle-select", n.node), b("click-node", n.node);
65
+ }), T = (t) => {
66
+ t && t.stopPropagation(), x("toggle-expand", n.node);
67
+ }, A = () => {
68
+ x("toggle-select", n.node);
69
+ }, R = (t) => {
70
+ t.stopPropagation(), h.value ? T() : n.selectionMode !== "none" && x("toggle-select", n.node), x("click-node", n.node);
68
71
  };
69
72
  return (t, l) => {
70
- const o = A("FileTreeNode", !0);
71
- return i(), a("div", Y, [
72
- c("div", {
73
+ const s = G("FileTreeNode", !0);
74
+ return a(), o("div", ee, [
75
+ g("div", {
73
76
  class: m(["group flex flex-col transition-colors cursor-pointer relative", {
74
- "bg-accent/50 text-accent-foreground": w.value && e.selectionMode === "single" && !e.showCheckboxes,
75
- "hover:bg-accent/50": !w.value || e.selectionMode !== "single",
77
+ "bg-accent/50 text-accent-foreground": L.value && e.selectionMode === "single" && !e.showCheckboxes,
78
+ "hover:bg-accent/50": !L.value || e.selectionMode !== "single",
76
79
  "opacity-50 pointer-events-none": e.node.disabled,
77
80
  "rounded-none": e.variant === "bordered",
78
81
  "rounded-md": e.variant === "default"
79
82
  }]),
80
- onClick: j,
81
- title: $.value
83
+ onClick: R,
84
+ title: N.value
82
85
  }, [
83
- e.variant === "bordered" ? (i(), a("div", {
86
+ e.variant === "bordered" ? (a(), o("div", {
84
87
  key: 0,
85
88
  class: "absolute bottom-0 right-0 h-[1px] bg-border pointer-events-none",
86
- style: x({ left: e.depth * 20 + "px" })
89
+ style: k({ left: e.depth * 20 + "px" })
87
90
  }, null, 4)) : u("", !0),
88
- c("div", {
89
- class: m(["flex items-center pr-2", e.variant === "bordered" ? "py-2 min-h-[40px]" : "py-1 min-h-[32px]"]),
90
- style: x({ paddingLeft: q.value })
91
+ g("div", {
92
+ class: m(["relative flex items-center pr-2", e.variant === "bordered" ? "py-2 min-h-[40px]" : "py-1 min-h-[32px]"]),
93
+ style: k({ paddingLeft: D.value })
91
94
  }, [
92
- g.value ? (i(), a("button", {
95
+ w(H(p), {
96
+ depth: e.depth,
97
+ "is-last-sibling": e.isLast,
98
+ "ancestor-last-flags": e.ancestorLastFlags,
99
+ "has-toggle": h.value,
100
+ indent: P,
101
+ "line-class": "bg-border"
102
+ }, null, 8, ["depth", "is-last-sibling", "ancestor-last-flags", "has-toggle"]),
103
+ h.value ? (a(), o("button", {
93
104
  key: 0,
94
105
  type: "button",
95
- class: m(["p-1 mr-1 rounded-sm hover:bg-muted text-muted-foreground transition-transform duration-200 focus:outline-none", { "rotate-90": v.value }]),
96
- onClick: L(N, ["stop"])
106
+ class: m(["relative z-10 p-1 mr-1 rounded-sm hover:bg-muted text-muted-foreground transition-transform duration-200 focus:outline-none", { "rotate-90": v.value }]),
107
+ onClick: C(T, ["stop"])
97
108
  }, [
98
- E(f, {
109
+ w(y, {
99
110
  icon: "lucide:chevron-right",
100
111
  class: "w-4 h-4"
101
112
  })
102
- ], 2)) : (i(), a("div", p)),
103
- e.showCheckboxes && e.selectionMode !== "none" ? (i(), a("div", {
113
+ ], 2)) : (a(), o("div", ne)),
114
+ e.showCheckboxes && e.selectionMode !== "none" ? (a(), o("div", {
104
115
  key: 2,
105
116
  class: "mr-2 flex items-center justify-center bg-transparent",
106
- onClick: l[0] || (l[0] = L(() => {
117
+ onClick: l[0] || (l[0] = C(() => {
107
118
  }, ["stop"]))
108
119
  }, [
109
- E(W, {
110
- checked: w.value,
111
- indeterminate: Q.value,
120
+ w(Z, {
121
+ checked: L.value,
122
+ indeterminate: q.value,
112
123
  disabled: e.node.disabled,
113
- "onUpdate:checked": O,
124
+ "onUpdate:checked": A,
114
125
  rounded: "sm",
115
126
  size: "sm"
116
127
  }, null, 8, ["checked", "indeterminate", "disabled"])
117
128
  ])) : u("", !0),
118
- c("div", _, [
119
- S.value ? (i(), y(f, {
129
+ g("div", le, [
130
+ $.value ? (a(), f(y, {
120
131
  key: 0,
121
132
  icon: "lucide:loader-2",
122
133
  class: "w-4 h-4 animate-spin"
123
- })) : e.node.icon ? (i(), y(f, {
134
+ })) : e.node.icon ? (a(), f(y, {
124
135
  key: 1,
125
136
  icon: e.node.icon,
126
137
  class: "w-4 h-4"
127
- }, null, 8, ["icon"])) : g.value ? (i(), y(f, {
138
+ }, null, 8, ["icon"])) : h.value ? (a(), f(y, {
128
139
  key: 2,
129
140
  icon: v.value ? "lucide:folder-open" : "lucide:folder",
130
141
  class: "w-4 h-4"
131
- }, null, 8, ["icon"])) : (i(), y(f, {
142
+ }, null, 8, ["icon"])) : (a(), f(y, {
132
143
  key: 3,
133
144
  icon: "lucide:file",
134
145
  class: "w-4 h-4"
135
146
  }))
136
147
  ]),
137
- c("div", ee, [
138
- (i(!0), a(C, null, K(V.value, (s, h) => (i(), a("span", {
139
- key: h,
148
+ g("div", se, [
149
+ (a(!0), o(K, null, M(O.value, (i, r) => (a(), o("span", {
150
+ key: r,
140
151
  class: m({
141
- "bg-yellow-100 text-yellow-900 rounded-sm px-0.5": s.highlight
152
+ "bg-yellow-100 text-yellow-900 rounded-sm px-0.5": i.highlight
142
153
  })
143
- }, M(s.text), 3))), 128))
154
+ }, S(i.text), 3))), 128))
144
155
  ]),
145
- t.$slots.actions ? (i(), a("div", {
156
+ t.$slots.actions ? (a(), o("div", {
146
157
  key: 3,
147
158
  class: "ml-2 flex items-center shrink-0",
148
- onClick: l[1] || (l[1] = L(() => {
159
+ onClick: l[1] || (l[1] = C(() => {
149
160
  }, ["stop"]))
150
161
  }, [
151
162
  I(t.$slots, "actions", { node: e.node })
152
163
  ])) : u("", !0)
153
164
  ], 6),
154
- e.node.searchMatch ? (i(), a("div", {
165
+ e.node.searchMatch ? (a(), o("div", {
155
166
  key: 1,
156
167
  class: "flex items-center text-[11px] text-gray-500 font-mono pr-2 pb-1.5 truncate",
157
- style: x({ paddingLeft: e.depth * 20 + 28 + "px" })
168
+ style: k({ paddingLeft: e.depth * 20 + 28 + "px" })
158
169
  }, [
159
- c("span", te, "L" + M(e.node.searchMatch.line_number), 1),
160
- c("div", ne, [
161
- (i(!0), a(C, null, K(D.value, (s, h) => (i(), a("span", {
162
- key: h,
170
+ g("span", ae, "L" + S(e.node.searchMatch.line_number), 1),
171
+ g("div", ie, [
172
+ (a(!0), o(K, null, M(j.value, (i, r) => (a(), o("span", {
173
+ key: r,
163
174
  class: m({
164
- "bg-yellow-500/20 text-gray-900 px-0.5 rounded-[1px] font-medium border border-yellow-600/30": s.highlight
175
+ "bg-yellow-500/20 text-gray-900 px-0.5 rounded-[1px] font-medium border border-yellow-600/30": i.highlight
165
176
  })
166
- }, M(s.text), 3))), 128))
177
+ }, S(i.text), 3))), 128))
167
178
  ])
168
179
  ], 4)) : u("", !0)
169
- ], 10, Z),
170
- v.value && g.value && !S.value ? (i(), a("div", le, [
171
- c("div", {
172
- class: "absolute top-1 bottom-1 border-l border-border",
173
- style: x({ left: e.depth * 20 + 10 + "px" })
174
- }, null, 4),
175
- e.node.children && e.node.children.length > 0 ? (i(!0), a(C, { key: 0 }, K(e.node.children, (s, h, F, k) => {
176
- const T = [s, e.selectedKeys, e.expandedKeys, e.indeterminateKeys, e.loadingKeys, e.highlightSearch, e.searchQuery, e.showCheckboxes, e.variant, e.maxLabelLength, !!t.$slots.actions];
177
- if (k && k.key === s.id && G(k, T)) return k;
178
- const B = (i(), y(o, {
179
- key: s.id,
180
- node: s,
180
+ ], 10, te),
181
+ v.value && h.value && !$.value ? (a(), o("div", oe, [
182
+ e.node.children && e.node.children.length > 0 ? (a(!0), o(K, { key: 0 }, M(e.node.children, (i, r, E, b) => {
183
+ const B = [i, e.selectedKeys, e.expandedKeys, e.indeterminateKeys, e.loadingKeys, e.highlightSearch, e.searchQuery, e.showCheckboxes, e.variant, e.maxLabelLength, F.value, r === e.node.children.length - 1, !!t.$slots.actions];
184
+ if (b && b.key === i.id && J(b, B)) return b;
185
+ const z = (a(), f(s, {
186
+ key: i.id,
187
+ node: i,
181
188
  depth: e.depth + 1,
189
+ "is-last": r === e.node.children.length - 1,
190
+ "ancestor-last-flags": F.value,
182
191
  "selection-mode": e.selectionMode,
183
192
  "selected-keys": e.selectedKeys,
184
193
  "expanded-keys": e.expandedKeys,
@@ -189,23 +198,23 @@ const Y = { class: "flex flex-col select-none" }, Z = ["title"], p = {
189
198
  "search-query": e.searchQuery,
190
199
  variant: e.variant,
191
200
  "max-label-length": e.maxLabelLength,
192
- onToggleExpand: l[2] || (l[2] = (r) => t.$emit("toggle-expand", r)),
193
- onToggleSelect: l[3] || (l[3] = (r) => t.$emit("toggle-select", r)),
194
- onClickNode: l[4] || (l[4] = (r) => t.$emit("click-node", r))
195
- }, H({ _: 2 }, [
201
+ onToggleExpand: l[2] || (l[2] = (c) => t.$emit("toggle-expand", c)),
202
+ onToggleSelect: l[3] || (l[3] = (c) => t.$emit("toggle-select", c)),
203
+ onClickNode: l[4] || (l[4] = (c) => t.$emit("click-node", c))
204
+ }, W({ _: 2 }, [
196
205
  t.$slots.actions ? {
197
206
  name: "actions",
198
- fn: J((r) => [
199
- I(t.$slots, "actions", R({ ref_for: !0 }, r))
207
+ fn: X((c) => [
208
+ I(t.$slots, "actions", Y({ ref_for: !0 }, c))
200
209
  ]),
201
210
  key: "0"
202
211
  } : void 0
203
- ]), 1032, ["node", "depth", "selection-mode", "selected-keys", "expanded-keys", "indeterminate-keys", "loading-keys", "show-checkboxes", "highlight-search", "search-query", "variant", "max-label-length"]));
204
- return B.memo = T, B;
205
- }, l, 5), 128)) : v.value && g.value && (!e.node.children || e.node.children.length === 0) ? (i(), a("div", {
212
+ ]), 1032, ["node", "depth", "is-last", "ancestor-last-flags", "selection-mode", "selected-keys", "expanded-keys", "indeterminate-keys", "loading-keys", "show-checkboxes", "highlight-search", "search-query", "variant", "max-label-length"]));
213
+ return z.memo = B, z;
214
+ }, l, 5), 128)) : v.value && h.value && (!e.node.children || e.node.children.length === 0) ? (a(), o("div", {
206
215
  key: 1,
207
216
  class: "py-0.5 text-xs text-muted-foreground italic",
208
- style: x({ paddingLeft: (e.depth + 1) * 20 + 26 + "px" })
217
+ style: k({ paddingLeft: (e.depth + 1) * 20 + 26 + "px" })
209
218
  }, null, 4)) : u("", !0)
210
219
  ])) : u("", !0)
211
220
  ]);
@@ -213,5 +222,5 @@ const Y = { class: "flex flex-col select-none" }, Z = ["title"], p = {
213
222
  }
214
223
  });
215
224
  export {
216
- de as default
225
+ ue as default
217
226
  };
@@ -3,7 +3,7 @@ import L from "./Icon.vue.js";
3
3
  import v from "./Modal.vue.js";
4
4
  import N from "./CommandPalette/CommandPaletteContent.vue.js";
5
5
  import { $t as U } from "../utils/i18n.js";
6
- /* empty css */
6
+ /* empty css */
7
7
  const V = { class: "block truncate -text-fs-1.5" }, S = { class: "ml-auto inline-flex items-center gap-0.5 px-1.5 py-0.5 rounded text-[10px] font-mono font-medium border border-border/80 bg-background text-muted-foreground ml-1" }, A = /* @__PURE__ */ x({
8
8
  __name: "NavbarCommandPalette",
9
9
  props: {