@parallelworks/tandem-web 0.164.0 → 0.165.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.
@@ -2,14 +2,15 @@ import { Link as e } from "../lib/router.js";
2
2
  import { ChevronRightIcon as t } from "./icons.js";
3
3
  import { termRef as n } from "../lib/knowledgeKinds.js";
4
4
  import { AnsweredDecision as r } from "./AgentWork.js";
5
- import { useState as i } from "react";
6
- import { useTranslations as a } from "use-intl";
7
- import { jsx as o, jsxs as s } from "react/jsx-runtime";
5
+ import { KnowledgeStatus as i } from "./HoverCards.js";
6
+ import { useState as a } from "react";
7
+ import { useTranslations as o } from "use-intl";
8
+ import { jsx as s, jsxs as c } from "react/jsx-runtime";
8
9
  // src/components/AreaWork.tsx
9
- var c = (...e) => e.filter(Boolean).join(" ");
10
- function l({ workspace: t, entry: r, isNew: i }) {
11
- let l = a("knowledge"), u = a("areaPage");
12
- return /* @__PURE__ */ o("li", { children: /* @__PURE__ */ s(e, {
10
+ var l = (...e) => e.filter(Boolean).join(" ");
11
+ function u({ workspace: t, entry: r, isNew: a }) {
12
+ let l = o("knowledge"), u = o("areaPage");
13
+ return /* @__PURE__ */ s("li", { children: /* @__PURE__ */ c(e, {
13
14
  to: "/$workspace/knowledge/$term",
14
15
  params: {
15
16
  workspace: t,
@@ -17,89 +18,89 @@ function l({ workspace: t, entry: r, isNew: i }) {
17
18
  },
18
19
  className: "flex min-w-0 items-baseline gap-2 px-3 py-2 text-sm hover:bg-muted",
19
20
  children: [
20
- /* @__PURE__ */ o("span", {
21
+ /* @__PURE__ */ s("span", {
21
22
  className: "shrink-0 font-medium",
22
23
  children: r.name
23
24
  }),
24
- /* @__PURE__ */ o("span", {
25
+ /* @__PURE__ */ s("span", {
25
26
  className: "shrink-0 text-xs text-muted-foreground",
26
27
  children: l(`kind.${r.kind}`)
27
28
  }),
28
- r.definition !== r.name && /* @__PURE__ */ o("span", {
29
+ r.definition !== r.name && /* @__PURE__ */ s("span", {
29
30
  className: "min-w-0 truncate text-muted-foreground",
30
31
  children: r.definition
31
32
  }),
32
- r.status === "proposed" && /* @__PURE__ */ o("span", {
33
- className: "ml-auto shrink-0 rounded border border-warning/60 px-1.5 text-[11px] text-warning",
34
- children: l("status.proposed")
33
+ r.status === "added" && /* @__PURE__ */ s("span", {
34
+ className: "ml-auto shrink-0",
35
+ children: /* @__PURE__ */ s(i, { status: r.status })
35
36
  }),
36
- i && /* @__PURE__ */ o("span", {
37
- className: c("shrink-0 text-[11px] font-medium text-primary", r.status !== "proposed" && "ml-auto"),
37
+ a && /* @__PURE__ */ s("span", {
38
+ className: "ml-auto shrink-0 text-[11px] font-medium text-primary",
38
39
  children: u("new")
39
40
  })
40
41
  ]
41
42
  }) });
42
43
  }
43
- var u = (e) => e.replace(/[*_`#>[\]]/g, "").replace(/\s+/g, " ").trim();
44
- function d({ workspace: e, decision: n, isNew: l, notInDocs: d }) {
45
- let f = a("areaPage"), [p, m] = i(!1), h = [n.options.find((e) => e.id === n.answer?.optionId)?.label, n.answer?.text && u(n.answer.text)].filter(Boolean).join(". ");
46
- return /* @__PURE__ */ s("li", { children: [/* @__PURE__ */ s("button", {
44
+ var d = (e) => e.replace(/[*_`#>[\]]/g, "").replace(/\s+/g, " ").trim();
45
+ function f({ workspace: e, decision: n, isNew: i, notInDocs: u }) {
46
+ let f = o("areaPage"), [p, m] = a(!1), h = [n.options.find((e) => e.id === n.answer?.optionId)?.label, n.answer?.text && d(n.answer.text)].filter(Boolean).join(". ");
47
+ return /* @__PURE__ */ c("li", { children: [/* @__PURE__ */ c("button", {
47
48
  type: "button",
48
49
  "aria-expanded": p,
49
50
  onClick: () => m((e) => !e),
50
51
  className: "flex w-full min-w-0 items-baseline gap-2 px-3 py-2 text-left text-sm hover:bg-muted",
51
52
  children: [
52
- /* @__PURE__ */ o(t, { className: c("size-3 shrink-0 self-center text-muted-foreground", p && "rotate-90") }),
53
- /* @__PURE__ */ o("span", {
53
+ /* @__PURE__ */ s(t, { className: l("size-3 shrink-0 self-center text-muted-foreground", p && "rotate-90") }),
54
+ /* @__PURE__ */ s("span", {
54
55
  className: "min-w-0 truncate text-muted-foreground",
55
- children: u(n.prompt)
56
+ children: d(n.prompt)
56
57
  }),
57
- /* @__PURE__ */ o("span", {
58
+ /* @__PURE__ */ s("span", {
58
59
  className: "min-w-0 shrink-0 truncate font-medium max-sm:hidden",
59
60
  children: h
60
61
  }),
61
- /* @__PURE__ */ s("span", {
62
+ /* @__PURE__ */ c("span", {
62
63
  className: "ml-auto flex shrink-0 items-center gap-2",
63
- children: [d && /* @__PURE__ */ o("span", {
64
+ children: [u && /* @__PURE__ */ s("span", {
64
65
  className: "rounded border border-border px-1.5 text-[11px] text-muted-foreground",
65
66
  children: f("notInDocs")
66
- }), l && /* @__PURE__ */ o("span", {
67
+ }), i && /* @__PURE__ */ s("span", {
67
68
  className: "text-[11px] font-medium text-primary",
68
69
  children: f("new")
69
70
  })]
70
71
  })
71
72
  ]
72
- }), p && /* @__PURE__ */ o("div", {
73
+ }), p && /* @__PURE__ */ s("div", {
73
74
  className: "px-3 pb-3",
74
- children: /* @__PURE__ */ o(r, {
75
+ children: /* @__PURE__ */ s(r, {
75
76
  workspace: e,
76
77
  decision: n,
77
78
  showIssue: !0
78
79
  })
79
80
  })] });
80
81
  }
81
- function f({ title: e, count: t, icon: n, extra: r, action: i, bare: a = !1, children: c }) {
82
- return /* @__PURE__ */ s("section", {
82
+ function p({ title: e, count: t, icon: n, extra: r, action: i, bare: a = !1, children: o }) {
83
+ return /* @__PURE__ */ c("section", {
83
84
  "aria-label": e,
84
- children: [/* @__PURE__ */ s("h2", {
85
+ children: [/* @__PURE__ */ c("h2", {
85
86
  className: "sticky top-0 z-10 flex h-9 items-center gap-2 border-b border-border bg-background px-4 text-xs font-medium md:px-5",
86
87
  children: [
87
88
  n,
88
- /* @__PURE__ */ o("span", {
89
+ /* @__PURE__ */ s("span", {
89
90
  className: "truncate",
90
91
  children: e
91
92
  }),
92
- /* @__PURE__ */ o("span", {
93
+ /* @__PURE__ */ s("span", {
93
94
  className: "text-muted-foreground tabular-nums",
94
95
  children: t
95
96
  }),
96
97
  r,
97
- i && /* @__PURE__ */ o("span", {
98
+ i && /* @__PURE__ */ s("span", {
98
99
  className: "ml-auto flex",
99
100
  children: i
100
101
  })
101
102
  ]
102
- }), t > 0 && (a ? c : /* @__PURE__ */ o("ul", { children: c }))]
103
+ }), t > 0 && (a ? o : /* @__PURE__ */ s("ul", { children: o }))]
103
104
  });
104
105
  }
105
- export { f as AreaGroup, d as FoldedAnswer, l as KnowledgeRow };
106
+ export { p as AreaGroup, f as FoldedAnswer, u as KnowledgeRow };
@@ -13,7 +13,7 @@ import w from "@dagrejs/dagre";
13
13
  import { Handle as T, MarkerType as E, Position as D, ReactFlow as O, ReactFlowProvider as k, useReactFlow as A } from "@xyflow/react";
14
14
  import "@xyflow/react/dist/style.css";
15
15
  // src/components/Graph.tsx
16
- var j = 196, M = 48, N = 22, P = (e) => e.kind === "doc" ? "bg-primary" : e.kind === "issue" ? e.status === "completed" || e.status === "canceled" ? "bg-muted-foreground/50" : "bg-primary" : e.status === "decided" ? "bg-success" : e.status === "proposed" ? "bg-warning" : "bg-muted-foreground/50", F = {
16
+ var j = 196, M = 48, N = 22, P = (e) => e.kind === "doc" ? "bg-primary" : e.kind === "issue" ? e.status === "completed" || e.status === "canceled" ? "bg-muted-foreground/50" : "bg-primary" : e.status === "decided" ? "bg-success" : e.status === "added" ? "bg-warning" : "bg-muted-foreground/50", F = {
17
17
  doc: s,
18
18
  issue: l,
19
19
  entry: c
@@ -177,8 +177,8 @@ function z({ workspace: n }) {
177
177
  });
178
178
  }
179
179
  var B = {
180
- proposed: "info",
181
- decided: "success"
180
+ decided: "success",
181
+ added: "info"
182
182
  };
183
183
  function V({ status: e }) {
184
184
  let t = k("knowledge.status");
@@ -216,7 +216,7 @@ function H({ workspace: e, entry: t }) {
216
216
  className: "text-xs text-muted-foreground",
217
217
  children: r(`kind.${t.kind}`)
218
218
  }),
219
- (t.kind !== "term" || t.status === "superseded") && /* @__PURE__ */ j("span", {
219
+ (t.kind !== "term" || t.status !== "decided") && /* @__PURE__ */ j("span", {
220
220
  className: "ml-auto",
221
221
  children: /* @__PURE__ */ j(V, { status: t.status })
222
222
  })
@@ -0,0 +1,142 @@
1
+ import { Kbd as e, Modal as t } from "@parallelworks/ui";
2
+ import { useTranslations as n } from "use-intl";
3
+ import { jsx as r, jsxs as i } from "react/jsx-runtime";
4
+ // src/components/ShortcutSheet.tsx
5
+ function a({ open: a, onClose: o }) {
6
+ let s = n("shortcuts"), c = [
7
+ {
8
+ title: s("lists"),
9
+ lines: [
10
+ {
11
+ keys: ["J", "K"],
12
+ label: s("move")
13
+ },
14
+ {
15
+ keys: "Enter",
16
+ label: s("open")
17
+ },
18
+ {
19
+ keys: "/",
20
+ label: s("search")
21
+ },
22
+ {
23
+ keys: "Escape",
24
+ label: s("clear")
25
+ }
26
+ ]
27
+ },
28
+ {
29
+ title: s("selecting"),
30
+ lines: [
31
+ {
32
+ keys: "X",
33
+ label: s("pick")
34
+ },
35
+ {
36
+ keys: "Shift+J",
37
+ label: s("pickRange")
38
+ },
39
+ {
40
+ keys: "Shift+X",
41
+ label: s("pickTo")
42
+ },
43
+ {
44
+ keys: "Mod+A",
45
+ label: s("pickAll")
46
+ },
47
+ {
48
+ keys: "Shift+Mod+A",
49
+ label: s("pickNone")
50
+ },
51
+ {
52
+ keys: "Mod+Click",
53
+ label: s("pickClick")
54
+ }
55
+ ]
56
+ },
57
+ {
58
+ title: s("changing"),
59
+ lines: [
60
+ {
61
+ keys: "S",
62
+ label: s("status")
63
+ },
64
+ {
65
+ keys: "P",
66
+ label: s("priority")
67
+ },
68
+ {
69
+ keys: "A",
70
+ label: s("assignees")
71
+ },
72
+ {
73
+ keys: "L",
74
+ label: s("labels")
75
+ },
76
+ {
77
+ keys: "M",
78
+ label: s("project")
79
+ },
80
+ {
81
+ keys: "D",
82
+ label: s("dueDate")
83
+ },
84
+ {
85
+ keys: "Backspace",
86
+ label: s("archive")
87
+ }
88
+ ]
89
+ },
90
+ {
91
+ title: s("anywhere"),
92
+ lines: [
93
+ {
94
+ keys: "C",
95
+ label: s("newIssue")
96
+ },
97
+ {
98
+ keys: "Mod+K",
99
+ label: s("palette")
100
+ },
101
+ {
102
+ keys: "Mod+F",
103
+ label: s("find")
104
+ },
105
+ {
106
+ keys: "Mod+Enter",
107
+ label: s("submit")
108
+ },
109
+ {
110
+ keys: "?",
111
+ label: s("sheet")
112
+ }
113
+ ]
114
+ }
115
+ ];
116
+ return /* @__PURE__ */ r(t, {
117
+ open: a,
118
+ onClose: o,
119
+ title: s("title"),
120
+ size: "xl",
121
+ children: /* @__PURE__ */ r("div", {
122
+ className: "grid gap-6 sm:grid-cols-2",
123
+ children: c.map((t) => /* @__PURE__ */ i("section", { children: [/* @__PURE__ */ r("h3", {
124
+ className: "mb-2 text-xs font-medium text-muted-foreground uppercase",
125
+ children: t.title
126
+ }), /* @__PURE__ */ r("dl", {
127
+ className: "space-y-1.5 text-sm",
128
+ children: t.lines.map((t) => /* @__PURE__ */ i("div", {
129
+ className: "flex items-center justify-between gap-4",
130
+ children: [/* @__PURE__ */ r("dt", { children: t.label }), /* @__PURE__ */ r("dd", {
131
+ className: "shrink-0",
132
+ children: /* @__PURE__ */ r(e, {
133
+ keys: t.keys,
134
+ size: "xs"
135
+ })
136
+ })]
137
+ }, t.label))
138
+ })] }, t.title))
139
+ })
140
+ });
141
+ }
142
+ export { a as ShortcutSheet };
@@ -12,7 +12,7 @@ function s({ counts: s, teamId: c, className: l = "" }) {
12
12
  enabled: !!d
13
13
  });
14
14
  if (!s) return null;
15
- let p = f.find((e) => e.id === c)?.key, m = s.proposedEntries + s.proposedAreas, h = [
15
+ let p = f.find((e) => e.id === c)?.key, m = s.proposedAreas, h = [
16
16
  s.decisions > 0 && {
17
17
  key: "decisions",
18
18
  label: u("decisions", { count: s.decisions }),
@@ -0,0 +1,15 @@
1
+ // src/lib/eachLimited.ts
2
+ async function e(e, t, n = 8) {
3
+ let r = 0, i = [];
4
+ return await Promise.all(Array.from({ length: Math.min(n, e.length) }, async () => {
5
+ for (; r < e.length;) {
6
+ let n = e[r++];
7
+ try {
8
+ await t(n);
9
+ } catch (e) {
10
+ i.push(e);
11
+ }
12
+ }
13
+ })), i;
14
+ }
15
+ export { e as eachLimited };