@parallelworks/tandem-web 0.139.0 → 0.139.2

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,10 +1,10 @@
1
- import { Link as e, useNavigate as t } from "../../../lib/router.js";
2
- import { areasQuery as n, knowledgeQuery as r } from "../../../api/queries.js";
3
- import { AddIcon as i, LibraryIcon as a } from "../../../components/icons.js";
4
- import { kinds as o, termRef as s } from "../../../lib/knowledgeKinds.js";
5
- import { Route as c } from "./index.js";
6
- import { useTime as l } from "../../../lib/time.js";
7
- import { usePageTitle as u } from "../../../lib/pageTitle.js";
1
+ import { usePageTitle as e } from "../../../lib/pageTitle.js";
2
+ import { Link as t, useNavigate as n } from "../../../lib/router.js";
3
+ import { areasQuery as r, knowledgeQuery as i } from "../../../api/queries.js";
4
+ import { AddIcon as a, LibraryIcon as o } from "../../../components/icons.js";
5
+ import { kinds as s, termRef as c } from "../../../lib/knowledgeKinds.js";
6
+ import { Route as l } from "./index.js";
7
+ import { useTime as u } from "../../../lib/time.js";
8
8
  import { EntryDialog as d, useKnowledgeMenu as f } from "../../../lib/knowledge.js";
9
9
  import { KnowledgeStatus as p } from "../../../components/HoverCards.js";
10
10
  import { FavoriteStar as m } from "../../../components/FavoriteStar.js";
@@ -16,18 +16,18 @@ import { useQuery as j, useSuspenseQuery as M } from "@tanstack/react-query";
16
16
  // src/routes/$workspace/knowledge/index.tsx?tsr-split=component
17
17
  var N = 5, P = 8;
18
18
  function F() {
19
- let { workspace: l } = c.useParams(), { archived: f, kind: p = "all" } = c.useSearch(), b = D("knowledge"), F = E();
20
- u(b("title"));
21
- let L = t(), [R, z] = T(""), [B, V] = T(""), [H, U] = T(null);
19
+ let { workspace: u } = l.useParams(), { archived: f, kind: p = "all" } = l.useSearch(), b = D("knowledge"), F = E();
20
+ e(b("title"));
21
+ let L = n(), [R, z] = T(""), [B, V] = T(""), [H, U] = T(null);
22
22
  C(() => {
23
23
  let e = setTimeout(() => V(R.trim()), 200);
24
24
  return () => clearTimeout(e);
25
25
  }, [R]);
26
- let { data: W } = M(r(l)), { data: G = [] } = j(n(l)), K = {
26
+ let { data: W } = M(i(u)), { data: G = [] } = j(r(u)), K = {
27
27
  ...B && { q: B },
28
28
  ...f && { archived: !0 }
29
29
  }, { data: q } = j({
30
- ...r(l, K),
30
+ ...i(u, K),
31
31
  enabled: !!B || !!f
32
32
  }), J = !!B || !!f, Y = J ? q ?? [] : W, X = p === "all" ? Y : Y.filter((e) => e.kind === p), Z = S((e) => U(e), []), Q = w(() => {
33
33
  let e = /* @__PURE__ */ new Map();
@@ -51,13 +51,13 @@ function F() {
51
51
  b
52
52
  ]), ne = (e) => L({
53
53
  to: "/$workspace/knowledge",
54
- params: { workspace: l },
54
+ params: { workspace: u },
55
55
  search: {
56
56
  ...f && { archived: f },
57
57
  ...e !== "all" && { kind: e }
58
58
  },
59
59
  replace: !0
60
- }), $ = o.filter((e) => Q.has(e) || e === p);
60
+ }), $ = s.filter((e) => Q.has(e) || e === p);
61
61
  return /* @__PURE__ */ A("div", {
62
62
  className: "flex h-full flex-col",
63
63
  children: [
@@ -69,7 +69,7 @@ function F() {
69
69
  children: b("title")
70
70
  }),
71
71
  /* @__PURE__ */ k(m, {
72
- workspace: l,
72
+ workspace: u,
73
73
  kind: "page",
74
74
  target: "knowledge"
75
75
  }),
@@ -77,9 +77,9 @@ function F() {
77
77
  className: "whitespace-nowrap text-xs text-muted-foreground tabular-nums",
78
78
  children: b("count", { count: W.length })
79
79
  }),
80
- /* @__PURE__ */ k(e, {
80
+ /* @__PURE__ */ k(t, {
81
81
  to: "/$workspace/graph",
82
- params: { workspace: l },
82
+ params: { workspace: u },
83
83
  className: `${y({ size: "sm" })} ml-auto`,
84
84
  children: b("graph")
85
85
  }),
@@ -88,7 +88,7 @@ function F() {
88
88
  variant: "primary",
89
89
  size: "sm",
90
90
  onClick: () => Z({ kind: "create" }),
91
- children: [/* @__PURE__ */ k(i, { className: "size-3.5" }), /* @__PURE__ */ k("span", {
91
+ children: [/* @__PURE__ */ k(a, { className: "size-3.5" }), /* @__PURE__ */ k("span", {
92
92
  className: "max-md:sr-only",
93
93
  children: b("new")
94
94
  })]
@@ -123,9 +123,9 @@ function F() {
123
123
  label: b(`kinds.${e}`),
124
124
  count: Q.get(e) ?? 0
125
125
  }))]
126
- }), /* @__PURE__ */ k(e, {
126
+ }), /* @__PURE__ */ k(t, {
127
127
  to: "/$workspace/knowledge",
128
- params: { workspace: l },
128
+ params: { workspace: u },
129
129
  search: {
130
130
  ...!f && { archived: !0 },
131
131
  ...p !== "all" && { kind: p }
@@ -139,7 +139,7 @@ function F() {
139
139
  })]
140
140
  }),
141
141
  X.length === 0 ? /* @__PURE__ */ k(g, {
142
- icon: /* @__PURE__ */ k(a, {}),
142
+ icon: /* @__PURE__ */ k(o, {}),
143
143
  title: b(J || p !== "all" ? "noMatches" : "emptyTitle"),
144
144
  description: J || p !== "all" ? void 0 : b("empty"),
145
145
  action: !J && p === "all" ? /* @__PURE__ */ k(h, {
@@ -150,18 +150,18 @@ function F() {
150
150
  }) : void 0,
151
151
  className: "mt-16"
152
152
  }) : J ? /* @__PURE__ */ k(I, {
153
- workspace: l,
153
+ workspace: u,
154
154
  title: b("results"),
155
155
  entries: X,
156
156
  onOpen: Z
157
157
  }) : /* @__PURE__ */ A(O, { children: [X.length >= P && /* @__PURE__ */ k(I, {
158
- workspace: l,
158
+ workspace: u,
159
159
  title: b("recent"),
160
160
  entries: ee,
161
161
  onOpen: Z,
162
162
  showTime: !0
163
163
  }), te.map((e) => /* @__PURE__ */ k(I, {
164
- workspace: l,
164
+ workspace: u,
165
165
  title: e.title,
166
166
  entries: e.entries,
167
167
  onOpen: Z
@@ -170,22 +170,22 @@ function F() {
170
170
  })
171
171
  }),
172
172
  H && /* @__PURE__ */ k(x, { children: /* @__PURE__ */ k(d, {
173
- workspace: l,
173
+ workspace: u,
174
174
  mode: H,
175
175
  onClose: () => U(null),
176
176
  onSaved: (e) => L({
177
177
  to: "/$workspace/knowledge/$term",
178
178
  params: {
179
- workspace: l,
180
- term: s(e)
179
+ workspace: u,
180
+ term: c(e)
181
181
  }
182
182
  })
183
183
  }) })
184
184
  ]
185
185
  });
186
186
  }
187
- function I({ workspace: t, title: n, entries: r, onOpen: i, showTime: a = !1 }) {
188
- let o = D("knowledge"), c = b(), u = f(t, i), d = l();
187
+ function I({ workspace: e, title: n, entries: r, onOpen: i, showTime: a = !1 }) {
188
+ let o = D("knowledge"), s = b(), l = f(e, i), d = u();
189
189
  return /* @__PURE__ */ A("section", {
190
190
  "aria-label": n,
191
191
  className: "mt-10",
@@ -197,13 +197,13 @@ function I({ workspace: t, title: n, entries: r, onOpen: i, showTime: a = !1 })
197
197
  })]
198
198
  }), /* @__PURE__ */ k("ul", {
199
199
  className: "mt-3 divide-y divide-border overflow-hidden rounded-xl border border-border bg-card",
200
- children: r.map((n) => /* @__PURE__ */ k("li", { children: /* @__PURE__ */ A(e, {
200
+ children: r.map((n) => /* @__PURE__ */ k("li", { children: /* @__PURE__ */ A(t, {
201
201
  to: "/$workspace/knowledge/$term",
202
202
  params: {
203
- workspace: t,
204
- term: s(n)
203
+ workspace: e,
204
+ term: c(n)
205
205
  },
206
- onContextMenu: (e) => c(e, u(n)),
206
+ onContextMenu: (e) => s(e, l(n)),
207
207
  className: "group flex flex-col gap-1 px-4 py-3 sm:flex-row sm:items-start sm:gap-3 transition-colors duration-150 hover:bg-muted focus-visible:outline-offset-[-2px]",
208
208
  children: [/* @__PURE__ */ A("span", {
209
209
  className: "min-w-0 flex-1",
@@ -1,8 +1,8 @@
1
- import { Link as e } from "../../lib/router.js";
2
- import { windows as t } from "./measures.js";
3
- import { Route as n } from "./measures2.js";
4
- import { measuresQuery as r } from "../../api/queries.js";
5
- import { usePageTitle as i } from "../../lib/pageTitle.js";
1
+ import { usePageTitle as e } from "../../lib/pageTitle.js";
2
+ import { Link as t } from "../../lib/router.js";
3
+ import { windows as n } from "./measures.js";
4
+ import { Route as r } from "./measures2.js";
5
+ import { measuresQuery as i } from "../../api/queries.js";
6
6
  import { useMoney as a } from "../../components/AgentWork.js";
7
7
  import { SegmentedControl as o } from "@parallelworks/ui";
8
8
  import { useFormatter as s, useTranslations as c } from "use-intl";
@@ -11,8 +11,8 @@ import { useSuspenseQuery as d } from "@tanstack/react-query";
11
11
  // src/routes/$workspace/measures.tsx?tsr-split=component
12
12
  function f() {
13
13
  let a = c("measures");
14
- i(a("title"));
15
- let { workspace: s } = n.useParams(), { days: f = "30" } = n.useSearch(), m = n.useNavigate(), { data: _ } = d(r(s, Number(f)));
14
+ e(a("title"));
15
+ let { workspace: s } = r.useParams(), { days: f = "30" } = r.useSearch(), m = r.useNavigate(), { data: _ } = d(i(s, Number(f)));
16
16
  return /* @__PURE__ */ u("div", {
17
17
  className: "w-full space-y-10 px-4 py-6 md:px-8 md:py-8",
18
18
  children: [
@@ -31,7 +31,7 @@ function f() {
31
31
  search: { days: e },
32
32
  replace: !0
33
33
  }),
34
- options: t.map((e) => ({
34
+ options: n.map((e) => ({
35
35
  value: e,
36
36
  label: a("days", { count: Number(e) })
37
37
  }))
@@ -50,47 +50,47 @@ function f() {
50
50
  /* @__PURE__ */ l(g, {
51
51
  title: a("byIssue"),
52
52
  rows: _.issues,
53
- link: (t) => /* @__PURE__ */ u(e, {
53
+ link: (e) => /* @__PURE__ */ u(t, {
54
54
  to: "/$workspace/issues/$identifier",
55
55
  params: {
56
56
  workspace: s,
57
- identifier: t.key
57
+ identifier: e.key
58
58
  },
59
59
  className: "hover:underline",
60
60
  children: [
61
61
  /* @__PURE__ */ l("span", {
62
62
  className: "text-muted-foreground",
63
- children: t.key
63
+ children: e.key
64
64
  }),
65
65
  " ",
66
- t.title
66
+ e.title
67
67
  ]
68
68
  })
69
69
  }),
70
70
  /* @__PURE__ */ l(g, {
71
71
  title: a("byArea"),
72
72
  rows: _.areas,
73
- link: (t) => /* @__PURE__ */ l(e, {
73
+ link: (e) => /* @__PURE__ */ l(t, {
74
74
  to: "/$workspace/areas/$area",
75
75
  params: {
76
76
  workspace: s,
77
- area: t.key
77
+ area: e.key
78
78
  },
79
79
  className: "hover:underline",
80
- children: t.title
80
+ children: e.title
81
81
  })
82
82
  }),
83
83
  /* @__PURE__ */ l(g, {
84
84
  title: a("byTeam"),
85
85
  rows: _.teams,
86
- link: (t) => /* @__PURE__ */ l(e, {
86
+ link: (e) => /* @__PURE__ */ l(t, {
87
87
  to: "/$workspace/teams/$key/settings",
88
88
  params: {
89
89
  workspace: s,
90
- key: t.key
90
+ key: e.key
91
91
  },
92
92
  className: "hover:underline",
93
- children: t.title
93
+ children: e.title
94
94
  })
95
95
  })
96
96
  ]