@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.
package/pages/triage.js CHANGED
@@ -61,6 +61,8 @@ function z() {
61
61
  identifier: G.identifier
62
62
  }
63
63
  }),
64
+ "Mod+a": () => _(new Set(d.map((e) => e.id))),
65
+ "Shift+Mod+a": () => _(/* @__PURE__ */ new Set()),
64
66
  Escape: () => g.size > 0 ? _(/* @__PURE__ */ new Set()) : K(void 0)
65
67
  }), D(() => {
66
68
  let e = G && document.getElementById(`triage-${G.id}`);
@@ -5,7 +5,7 @@ var e = [
5
5
  "entry"
6
6
  ], t = [
7
7
  "decided",
8
- "proposed",
8
+ "added",
9
9
  "superseded"
10
10
  ];
11
11
  export { e as kinds, t as statuses };
@@ -12,8 +12,8 @@ import { uploadKnowledgeAttachment as _ } from "../../../lib/attachments.js";
12
12
  import { useCan as v } from "../../../lib/roles.js";
13
13
  import { AttachButton as y, UploadStatus as b, useFileUpload as x } from "../../../components/Attachments.js";
14
14
  import { Editor as S } from "../../../components/Editor.js";
15
- import { Route as C } from "./_term.js";
16
- import { KnowledgeStatus as w } from "../../../components/HoverCards.js";
15
+ import { KnowledgeStatus as C } from "../../../components/HoverCards.js";
16
+ import { Route as w } from "./_term.js";
17
17
  import { Timeline as T, TimelineItem as E, activityIcon as D } from "../../../components/ActivityTimeline.js";
18
18
  import { Button as O, ErrorText as k, PageHeader as A, Section as j, TitleInput as M, useOpenMenu as N } from "@parallelworks/ui";
19
19
  import { Suspense as P, useCallback as F, useMemo as I, useRef as L, useState as R } from "react";
@@ -24,9 +24,9 @@ import { useQuery as W, useSuspenseQuery as G } from "@tanstack/react-query";
24
24
  import { MoreButton as K } from "@parallelworks/ui/list";
25
25
  // src/routes/$workspace/knowledge/$term.tsx?tsr-split=component
26
26
  function q() {
27
- let { workspace: r, term: a } = C.useParams(), o = B("knowledge"), c = B("common"), l = n(), d = N(), f = z(), { data: h } = G(i(r, a)), { data: g } = G(s(r)), w = m(r), T = v(r, "edit_docs"), E = T && !h.archivedAt, [D, j] = R(null), W = F((e) => j(e), []), q = te(r, W), X = L(null), Z = x((e) => _(r, h.id, e));
27
+ let { workspace: r, term: a } = w.useParams(), o = B("knowledge"), c = B("common"), l = n(), d = N(), f = z(), { data: h } = G(i(r, a)), { data: g } = G(s(r)), C = m(r), T = v(r, "edit_docs"), E = T && !h.archivedAt, [D, j] = R(null), W = F((e) => j(e), []), q = te(r, W), X = L(null), Z = x((e) => _(r, h.id, e));
28
28
  e(h.name);
29
- let Q = I(() => g.filter((e) => e.supersededBy === h.id), [g, h.id]), $ = (e) => w.update.mutate({
29
+ let Q = I(() => g.filter((e) => e.supersededBy === h.id), [g, h.id]), $ = (e) => C.update.mutate({
30
30
  id: h.id,
31
31
  ...e,
32
32
  ifVersion: h.version
@@ -48,7 +48,7 @@ function q() {
48
48
  label: c("moreActionsFor", { name: h.name }),
49
49
  visible: !0
50
50
  }),
51
- actions: /* @__PURE__ */ U(V, { children: [w.update.isPending && /* @__PURE__ */ H("span", {
51
+ actions: /* @__PURE__ */ U(V, { children: [C.update.isPending && /* @__PURE__ */ H("span", {
52
52
  className: "text-xs text-muted-foreground",
53
53
  role: "status",
54
54
  children: c("saving")
@@ -78,7 +78,7 @@ function q() {
78
78
  }), T && /* @__PURE__ */ H(O, {
79
79
  type: "button",
80
80
  size: "sm",
81
- onClick: () => w.restore.mutate(h.id),
81
+ onClick: () => C.restore.mutate(h.id),
82
82
  children: o("restore")
83
83
  })]
84
84
  }),
@@ -168,9 +168,9 @@ function q() {
168
168
  })
169
169
  ]
170
170
  }),
171
- w.update.isError && /* @__PURE__ */ H(k, {
171
+ C.update.isError && /* @__PURE__ */ H(k, {
172
172
  className: "mt-2",
173
- children: f(w.update.error)
173
+ children: f(C.update.error)
174
174
  })
175
175
  ]
176
176
  }),
@@ -216,7 +216,7 @@ function J({ workspace: e, entry: n }) {
216
216
  className: "space-y-1 text-xs text-muted-foreground",
217
217
  children: [/* @__PURE__ */ U("p", {
218
218
  className: "flex flex-wrap items-center gap-x-1.5 gap-y-1",
219
- children: [(n.kind !== "term" || n.status === "superseded") && /* @__PURE__ */ H(w, { status: n.status }), p.map((e, t) => /* @__PURE__ */ U("span", {
219
+ children: [(n.kind !== "term" || n.status !== "decided") && /* @__PURE__ */ H(C, { status: n.status }), p.map((e, t) => /* @__PURE__ */ U("span", {
220
220
  className: "inline-flex items-center gap-1.5",
221
221
  children: [t > 0 && /* @__PURE__ */ H("span", {
222
222
  "aria-hidden": "true",
@@ -5,8 +5,8 @@ import { AddIcon as a, LibraryIcon as o } from "../../../components/icons.js";
5
5
  import { kinds as s, termRef as c } from "../../../lib/knowledgeKinds.js";
6
6
  import { EntryDialog as l, useKnowledgeMenu as u } from "../../../lib/knowledge.js";
7
7
  import { useTime as d } from "../../../lib/time.js";
8
- import { Route as f } from "./index.js";
9
- import { KnowledgeStatus as p } from "../../../components/HoverCards.js";
8
+ import { KnowledgeStatus as f } from "../../../components/HoverCards.js";
9
+ import { Route as p } from "./index.js";
10
10
  import { FavoriteStar as m } from "../../../components/FavoriteStar.js";
11
11
  import { Button as h, EmptyState as g, SearchInput as _, SegmentedControl as v, buttonClasses as y, useOpenMenu as b } from "@parallelworks/ui";
12
12
  import { Suspense as x, useCallback as S, useEffect as C, useMemo as w, useState as T } from "react";
@@ -16,7 +16,7 @@ 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: u } = f.useParams(), { archived: d, kind: p = "all" } = f.useSearch(), b = D("knowledge"), F = E();
19
+ let { workspace: u } = p.useParams(), { archived: d, kind: f = "all" } = p.useSearch(), b = D("knowledge"), F = E();
20
20
  e(b("title"));
21
21
  let L = n(), [R, z] = T(""), [B, V] = T(""), [H, U] = T(null);
22
22
  C(() => {
@@ -29,7 +29,7 @@ function F() {
29
29
  }, { data: q } = j({
30
30
  ...i(u, K),
31
31
  enabled: !!B || !!d
32
- }), J = !!B || !!d, Y = J ? q ?? [] : W, X = p === "all" ? Y : Y.filter((e) => e.kind === p), Z = S((e) => U(e), []), Q = w(() => {
32
+ }), J = !!B || !!d, Y = J ? q ?? [] : W, X = f === "all" ? Y : Y.filter((e) => e.kind === f), Z = S((e) => U(e), []), Q = w(() => {
33
33
  let e = /* @__PURE__ */ new Map();
34
34
  for (let t of Y) e.set(t.kind, (e.get(t.kind) ?? 0) + 1);
35
35
  return e;
@@ -57,7 +57,7 @@ function F() {
57
57
  ...e !== "all" && { kind: e }
58
58
  },
59
59
  replace: !0
60
- }), $ = s.filter((e) => Q.has(e) || e === p);
60
+ }), $ = s.filter((e) => Q.has(e) || e === f);
61
61
  return /* @__PURE__ */ A("div", {
62
62
  className: "flex h-full flex-col",
63
63
  children: [
@@ -112,7 +112,7 @@ function F() {
112
112
  children: [$.length > 1 && /* @__PURE__ */ k(v, {
113
113
  label: b("kindLabel"),
114
114
  size: "sm",
115
- value: p,
115
+ value: f,
116
116
  onValueChange: ne,
117
117
  options: [{
118
118
  value: "all",
@@ -128,7 +128,7 @@ function F() {
128
128
  params: { workspace: u },
129
129
  search: {
130
130
  ...!d && { archived: !0 },
131
- ...p !== "all" && { kind: p }
131
+ ...f !== "all" && { kind: f }
132
132
  },
133
133
  "aria-current": d || void 0,
134
134
  className: `${y({
@@ -140,9 +140,9 @@ function F() {
140
140
  }),
141
141
  X.length === 0 ? /* @__PURE__ */ k(g, {
142
142
  icon: /* @__PURE__ */ k(o, {}),
143
- title: b(J || p !== "all" ? "noMatches" : "emptyTitle"),
144
- description: J || p !== "all" ? void 0 : b("empty"),
145
- action: !J && p === "all" ? /* @__PURE__ */ k(h, {
143
+ title: b(J || f !== "all" ? "noMatches" : "emptyTitle"),
144
+ description: J || f !== "all" ? void 0 : b("empty"),
145
+ action: !J && f === "all" ? /* @__PURE__ */ k(h, {
146
146
  type: "button",
147
147
  variant: "primary",
148
148
  onClick: () => Z({ kind: "create" }),
@@ -185,7 +185,7 @@ function F() {
185
185
  });
186
186
  }
187
187
  function I({ workspace: e, title: n, entries: r, onOpen: i, showTime: a = !1 }) {
188
- let o = D("knowledge"), s = b(), l = u(e, i), f = d();
188
+ let o = D("knowledge"), s = b(), l = u(e, i), p = d();
189
189
  return /* @__PURE__ */ A("section", {
190
190
  "aria-label": n,
191
191
  className: "mt-10",
@@ -214,16 +214,16 @@ function I({ workspace: e, title: n, entries: r, onOpen: i, showTime: a = !1 })
214
214
  className: "mt-0.5 line-clamp-2 text-xs leading-5 text-muted-foreground",
215
215
  children: n.definition
216
216
  })]
217
- }), (n.kind !== "term" || a) && /* @__PURE__ */ A("span", {
217
+ }), (n.kind !== "term" || n.status === "added" || a) && /* @__PURE__ */ A("span", {
218
218
  className: "flex items-center gap-2 text-xs text-muted-foreground sm:shrink-0 sm:pt-0.5",
219
219
  children: [
220
220
  n.kind !== "term" && /* @__PURE__ */ k("span", { children: o(`kind.${n.kind}`) }),
221
- n.kind !== "term" && n.status === "proposed" && /* @__PURE__ */ k(p, { status: n.status }),
221
+ n.status === "added" && /* @__PURE__ */ k(f, { status: n.status }),
222
222
  a && /* @__PURE__ */ k("time", {
223
223
  dateTime: n.updatedAt,
224
- title: f.full(n.updatedAt),
224
+ title: p.full(n.updatedAt),
225
225
  className: "tabular-nums",
226
- children: f.relative(n.updatedAt)
226
+ children: p.relative(n.updatedAt)
227
227
  })
228
228
  ]
229
229
  })]