@parallelworks/tandem-web 0.175.4 → 0.177.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.
@@ -0,0 +1,213 @@
1
+ import { api as e, unwrap as t } from "../api/client.js";
2
+ import { docTemplatesQuery as n, teamsQuery as r } from "../api/queries.js";
3
+ import { fromIsoDate as i, isoDate as a } from "../lib/datePhrases.js";
4
+ import { spaceScope as o } from "../lib/docProperties.js";
5
+ import { docRef as s } from "../lib/docs.js";
6
+ import { useCan as c } from "../lib/roles.js";
7
+ import { DocIcon as l } from "./DocIcon.js";
8
+ import { useSpaceDocs as u } from "./DocTable.js";
9
+ import { AddIcon as d, ChevronRightIcon as f } from "./icons.js";
10
+ import { Button as p, cx as m } from "@parallelworks/ui";
11
+ import { Link as h, useNavigate as g } from "@tanstack/react-router";
12
+ import { useMemo as _, useState as v } from "react";
13
+ import { useFormatter as y, useLocale as b, useTranslations as x } from "use-intl";
14
+ import { jsx as S, jsxs as C } from "react/jsx-runtime";
15
+ import { useMutation as w, useQueryClient as T } from "@tanstack/react-query";
16
+ // src/components/DocCalendar.tsx
17
+ var E = (e, t) => new Date(e.getFullYear(), e.getMonth(), e.getDate() + t);
18
+ function D(e) {
19
+ let t = new Intl.Locale(e);
20
+ return (t.getWeekInfo?.().firstDay ?? t.weekInfo?.firstDay ?? 7) % 7;
21
+ }
22
+ var O = (e, t) => E(e, -((e.getDay() - t + 7) % 7));
23
+ function k(i, o, c) {
24
+ let l = x("docViews"), u = y(), d = T(), f = g();
25
+ return w({
26
+ mutationFn: async (s) => {
27
+ let [f, p] = await Promise.all([d.fetchQuery(n(i)), d.fetchQuery(r(i))]), m = o === "workspace" ? "" : p.find((e) => e.key === o)?.id ?? "", h = f.find((e) => e.spaceDefault && (e.teamId ?? "") === m), g = a(s), _ = t(await e.POST("/api/v1/workspaces/{workspace}/docs", {
28
+ params: { path: { workspace: i } },
29
+ body: {
30
+ title: l("meetingTitle", { date: u.dateTime(s, { dateStyle: "medium" }) }),
31
+ template: h?.id ?? "meeting-notes",
32
+ variables: { date: g },
33
+ ...o !== "workspace" && { team: o }
34
+ }
35
+ }));
36
+ return c && await e.PATCH("/api/v1/workspaces/{workspace}/docs/{doc}/properties", {
37
+ params: { path: {
38
+ workspace: i,
39
+ doc: _.key
40
+ } },
41
+ body: { values: { [c]: g } }
42
+ }), _;
43
+ },
44
+ onSuccess: (e) => {
45
+ d.invalidateQueries({ queryKey: [
46
+ "workspace",
47
+ i,
48
+ "docs"
49
+ ] }), f({
50
+ to: "/$workspace/docs/$doc",
51
+ params: {
52
+ workspace: i,
53
+ doc: s(e)
54
+ }
55
+ });
56
+ }
57
+ });
58
+ }
59
+ function A({ workspace: e, space: t, config: n, query: r = "" }) {
60
+ let g = x("docViews"), w = y(), T = D(b()), A = c(e, "edit_docs", o(t)), { docs: M, props: N, isPending: P } = u(e, t, n), F = r.trim().toLowerCase(), I = F ? M.filter((e) => e.title.toLowerCase().includes(F)) : M, L = N.find((e) => e.id === n.dateProperty && e.kind === "date"), R = k(e, t, L?.id), z = _(() => {
61
+ let e = /* @__PURE__ */ new Date();
62
+ return new Date(e.getFullYear(), e.getMonth(), e.getDate());
63
+ }, []), [B, V] = v(z), H = _(() => {
64
+ let e = /* @__PURE__ */ new Map();
65
+ if (!L) return e;
66
+ for (let t of I) {
67
+ let n = t.properties?.[L.id];
68
+ typeof n == "string" && i(n) && e.set(n, [...e.get(n) ?? [], t]);
69
+ }
70
+ return e;
71
+ }, [I, L]);
72
+ if (P) return /* @__PURE__ */ S("p", {
73
+ className: "p-4 text-sm text-muted-foreground",
74
+ children: g("loading")
75
+ });
76
+ if (!L) return /* @__PURE__ */ S("p", {
77
+ className: "p-4 text-sm text-muted-foreground",
78
+ children: g("pickDate")
79
+ });
80
+ let U = new Date(B.getFullYear(), B.getMonth(), 1), W = O(U, T), G = Math.ceil(((U.getTime() - W.getTime()) / 864e5 + j(U)) / 7), K = Array.from({ length: G * 7 }, (e, t) => E(W, t)), q = O(B, T), J = Array.from({ length: 7 }, (e, t) => E(q, t)), Y = (e) => V((t) => new Date(t.getFullYear(), t.getMonth() + e, Math.min(t.getDate(), 28))), X = (e) => V((t) => E(t, 7 * e)), Z = (t) => /* @__PURE__ */ C(h, {
81
+ to: "/$workspace/docs/$doc",
82
+ params: {
83
+ workspace: e,
84
+ doc: s(t)
85
+ },
86
+ className: "flex min-w-0 items-center gap-1 rounded bg-muted px-1.5 py-0.5 text-xs hover:bg-accent",
87
+ children: [/* @__PURE__ */ S(l, { icon: t.icon }), /* @__PURE__ */ S("span", {
88
+ className: "truncate",
89
+ children: t.title
90
+ })]
91
+ }, t.id), Q = (e) => A && /* @__PURE__ */ S("button", {
92
+ type: "button",
93
+ onClick: () => R.mutate(e),
94
+ disabled: R.isPending,
95
+ "aria-label": g("newMeetingOn", { date: w.dateTime(e, { dateStyle: "medium" }) }),
96
+ className: "rounded px-1 text-xs text-muted-foreground opacity-0 group-hover:opacity-100 max-sm:opacity-100 focus-visible:opacity-100 hover:bg-accent hover:text-foreground",
97
+ children: /* @__PURE__ */ S(d, { className: "size-3.5" })
98
+ });
99
+ return /* @__PURE__ */ C("div", {
100
+ className: "flex flex-col",
101
+ children: [
102
+ /* @__PURE__ */ C("div", {
103
+ className: "flex items-center gap-2 px-4 py-2 md:px-5",
104
+ children: [
105
+ /* @__PURE__ */ S("h2", {
106
+ className: "text-sm font-medium max-sm:hidden",
107
+ children: w.dateTime(U, {
108
+ month: "long",
109
+ year: "numeric"
110
+ })
111
+ }),
112
+ /* @__PURE__ */ S("h2", {
113
+ className: "text-sm font-medium sm:hidden",
114
+ children: w.dateTimeRange(J[0], J[6], { dateStyle: "medium" })
115
+ }),
116
+ /* @__PURE__ */ C("span", {
117
+ className: "ml-auto flex items-center gap-1",
118
+ children: [
119
+ /* @__PURE__ */ S(p, {
120
+ size: "xs",
121
+ variant: "ghost",
122
+ onClick: () => V(z),
123
+ children: g("today")
124
+ }),
125
+ /* @__PURE__ */ C("span", {
126
+ className: "flex gap-1 max-sm:hidden",
127
+ children: [/* @__PURE__ */ S(p, {
128
+ size: "xs",
129
+ variant: "ghost",
130
+ onClick: () => Y(-1),
131
+ "aria-label": g("previousMonth"),
132
+ children: /* @__PURE__ */ S(f, { className: "rotate-180" })
133
+ }), /* @__PURE__ */ S(p, {
134
+ size: "xs",
135
+ variant: "ghost",
136
+ onClick: () => Y(1),
137
+ "aria-label": g("nextMonth"),
138
+ children: /* @__PURE__ */ S(f, {})
139
+ })]
140
+ }),
141
+ /* @__PURE__ */ C("span", {
142
+ className: "flex gap-1 sm:hidden",
143
+ children: [/* @__PURE__ */ S(p, {
144
+ size: "xs",
145
+ variant: "ghost",
146
+ onClick: () => X(-1),
147
+ "aria-label": g("previousWeek"),
148
+ children: /* @__PURE__ */ S(f, { className: "rotate-180" })
149
+ }), /* @__PURE__ */ S(p, {
150
+ size: "xs",
151
+ variant: "ghost",
152
+ onClick: () => X(1),
153
+ "aria-label": g("nextWeek"),
154
+ children: /* @__PURE__ */ S(f, {})
155
+ })]
156
+ })
157
+ ]
158
+ })
159
+ ]
160
+ }),
161
+ /* @__PURE__ */ C("div", {
162
+ className: "max-sm:hidden",
163
+ children: [/* @__PURE__ */ S("div", {
164
+ className: "grid grid-cols-7 border-y border-border text-xs text-muted-foreground",
165
+ children: K.slice(0, 7).map((e) => /* @__PURE__ */ S("span", {
166
+ className: "px-2 py-1",
167
+ children: w.dateTime(e, { weekday: "short" })
168
+ }, e.getDay()))
169
+ }), /* @__PURE__ */ S("ol", {
170
+ className: "grid grid-cols-7",
171
+ "aria-label": g("calendar"),
172
+ children: K.map((e) => {
173
+ let t = a(e), n = H.get(t) ?? [], r = e.getMonth() === U.getMonth();
174
+ return /* @__PURE__ */ C("li", {
175
+ "aria-label": w.dateTime(e, { dateStyle: "full" }),
176
+ className: m("group flex min-h-24 min-w-0 flex-col gap-1 border-r border-b border-border p-1.5", !r && "bg-muted/30"),
177
+ children: [/* @__PURE__ */ C("span", {
178
+ className: "flex items-center justify-between",
179
+ children: [/* @__PURE__ */ S("span", {
180
+ className: m("flex size-6 items-center justify-center rounded-full text-xs tabular-nums", t === a(z) ? "bg-primary text-primary-foreground" : r ? "" : "text-muted-foreground"),
181
+ children: e.getDate()
182
+ }), Q(e)]
183
+ }), n.map(Z)]
184
+ }, t);
185
+ })
186
+ })]
187
+ }),
188
+ /* @__PURE__ */ S("ol", {
189
+ className: "divide-y divide-border border-y border-border sm:hidden",
190
+ "aria-label": g("calendar"),
191
+ children: J.map((e) => {
192
+ let t = a(e), n = H.get(t) ?? [];
193
+ return /* @__PURE__ */ C("li", {
194
+ className: "group flex flex-col gap-1 px-4 py-2",
195
+ children: [/* @__PURE__ */ C("span", {
196
+ className: "flex items-center justify-between text-xs",
197
+ children: [/* @__PURE__ */ S("span", {
198
+ className: m(t === a(z) ? "font-medium text-primary" : "text-muted-foreground"),
199
+ children: w.dateTime(e, {
200
+ weekday: "long",
201
+ month: "short",
202
+ day: "numeric"
203
+ })
204
+ }), Q(e)]
205
+ }), n.map(Z)]
206
+ }, t);
207
+ })
208
+ })
209
+ ]
210
+ });
211
+ }
212
+ var j = (e) => new Date(e.getFullYear(), e.getMonth() + 1, 0).getDate();
213
+ export { A as DocCalendar, k as useNewMeetingNotes };
@@ -3,24 +3,25 @@ import { docPropertiesQuery as t, spaceScope as n, useDocPropertyActions as r }
3
3
  import { docRef as i } from "../lib/docs.js";
4
4
  import { usePeople as a } from "../lib/people.js";
5
5
  import { useCan as o } from "../lib/roles.js";
6
- import { DocIcon as s } from "./DocIcon.js";
7
- import { usePropertyText as c } from "./DocProperties.js";
8
- import { cx as l } from "@parallelworks/ui";
9
- import { Link as u } from "@tanstack/react-router";
10
- import { useState as d } from "react";
11
- import { useFormatter as f, useTranslations as p } from "use-intl";
12
- import { jsx as m, jsxs as h } from "react/jsx-runtime";
13
- import { keepPreviousData as g, useQuery as _ } from "@tanstack/react-query";
6
+ import { DocCalendar as s } from "./DocCalendar.js";
7
+ import { DocIcon as c } from "./DocIcon.js";
8
+ import { usePropertyText as l } from "./DocProperties.js";
9
+ import { cx as u } from "@parallelworks/ui";
10
+ import { Link as d } from "@tanstack/react-router";
11
+ import { useState as f } from "react";
12
+ import { useFormatter as p, useTranslations as m } from "use-intl";
13
+ import { jsx as h, jsxs as g } from "react/jsx-runtime";
14
+ import { keepPreviousData as _, useQuery as v } from "@tanstack/react-query";
14
15
  // src/components/DocTable.tsx
15
- var v = (e) => e.kind === "select" || e.kind === "person";
16
- function y(n, r, i) {
17
- let a = Object.entries(i.filters ?? {}).map(([e, t]) => `${e}=${t}`), { data: o = [], isPending: s } = _({
16
+ var y = (e) => e.kind === "select" || e.kind === "person";
17
+ function b(n, r, i) {
18
+ let a = Object.entries(i.filters ?? {}).map(([e, t]) => `${e}=${t}`), { data: o = [], isPending: s } = v({
18
19
  ...e(n, {
19
20
  ...r === "workspace" ? { workspace: !0 } : { team: r },
20
21
  ...a.length > 0 && { property: a }
21
22
  }),
22
- placeholderData: g
23
- }), { data: l = [] } = _(t(n, r)), u = c(n), d = i.sort ?? "title", f = l.find((e) => e.id === d), p = (e) => {
23
+ placeholderData: _
24
+ }), { data: c = [] } = v(t(n, r)), u = l(n), d = i.sort ?? "title", f = c.find((e) => e.id === d), p = (e) => {
24
25
  if (d === "updated") return e.updatedAt;
25
26
  if (!f) return e.title.toLowerCase();
26
27
  let t = e.properties?.[f.id];
@@ -31,85 +32,91 @@ function y(n, r, i) {
31
32
  let n = p(e), r = p(t), a = n < r ? -1 : +(n > r);
32
33
  return i.desc ? -a : a;
33
34
  }),
34
- props: l,
35
+ props: c,
35
36
  isPending: s
36
37
  };
37
38
  }
38
- function b({ workspace: e, space: t, layout: n, config: r, query: o = "" }) {
39
- let l = p("docViews"), d = f(), { actorName: g } = a(e), { docs: _, props: b, isPending: S } = y(e, t, r), C = o.trim().toLowerCase(), w = C ? _.filter((e) => e.title.toLowerCase().includes(C)) : _, T = new Map(_.map((e) => [e.id, e.title])), E = c(e), D = (e, t) => e.properties?.[t.id];
40
- if (S) return /* @__PURE__ */ m("p", {
39
+ function x({ workspace: e, space: t, layout: n, config: r, query: o = "" }) {
40
+ let u = m("docViews"), f = p(), { actorName: _ } = a(e), { docs: v, props: x, isPending: C } = b(e, t, r), w = o.trim().toLowerCase(), T = w ? v.filter((e) => e.title.toLowerCase().includes(w)) : v, E = new Map(v.map((e) => [e.id, e.title])), D = l(e), O = (e, t) => e.properties?.[t.id];
41
+ if (C) return /* @__PURE__ */ h("p", {
41
42
  className: "p-4 text-sm text-muted-foreground",
42
- children: l("loading")
43
+ children: u("loading")
44
+ });
45
+ if (n === "calendar") return /* @__PURE__ */ h(s, {
46
+ workspace: e,
47
+ space: t,
48
+ config: r,
49
+ query: o
43
50
  });
44
51
  if (n === "board") {
45
- let n = b.find((e) => e.id === r.groupBy && v(e));
46
- return n ? /* @__PURE__ */ m(x, {
52
+ let n = x.find((e) => e.id === r.groupBy && y(e));
53
+ return n ? /* @__PURE__ */ h(S, {
47
54
  workspace: e,
48
55
  space: t,
49
- docs: w,
50
- props: b,
56
+ docs: T,
57
+ props: x,
51
58
  by: n
52
- }) : /* @__PURE__ */ m("p", {
59
+ }) : /* @__PURE__ */ h("p", {
53
60
  className: "p-4 text-sm text-muted-foreground",
54
- children: l("pickGroup")
61
+ children: u("pickGroup")
55
62
  });
56
63
  }
57
- let O = r.columns ? r.columns.flatMap((e) => b.filter((t) => t.id === e)) : b;
58
- return w.length === 0 ? /* @__PURE__ */ m("p", {
64
+ let k = r.columns ? r.columns.flatMap((e) => x.filter((t) => t.id === e)) : x;
65
+ return T.length === 0 ? /* @__PURE__ */ h("p", {
59
66
  className: "p-4 text-sm text-muted-foreground",
60
- children: l("none")
61
- }) : /* @__PURE__ */ m("div", {
67
+ children: u("none")
68
+ }) : /* @__PURE__ */ h("div", {
62
69
  className: "overflow-x-auto",
63
- children: /* @__PURE__ */ h("table", {
70
+ children: /* @__PURE__ */ g("table", {
64
71
  className: "doc-table w-full min-w-max text-sm",
65
- children: [/* @__PURE__ */ m("thead", { children: /* @__PURE__ */ h("tr", { children: [
66
- /* @__PURE__ */ m("th", {
72
+ children: [/* @__PURE__ */ h("thead", { children: /* @__PURE__ */ g("tr", { children: [
73
+ /* @__PURE__ */ h("th", {
67
74
  scope: "col",
68
- children: l("docTitle")
75
+ children: u("docTitle")
69
76
  }),
70
- O.map((e) => /* @__PURE__ */ m("th", {
77
+ k.map((e) => /* @__PURE__ */ h("th", {
71
78
  scope: "col",
72
79
  children: e.name
73
80
  }, e.id)),
74
- /* @__PURE__ */ m("th", {
81
+ /* @__PURE__ */ h("th", {
75
82
  scope: "col",
76
- children: l("author")
83
+ children: u("author")
77
84
  }),
78
- /* @__PURE__ */ m("th", {
85
+ /* @__PURE__ */ h("th", {
79
86
  scope: "col",
80
- children: l("updated")
87
+ children: u("updated")
81
88
  })
82
- ] }) }), /* @__PURE__ */ m("tbody", { children: w.map((t) => /* @__PURE__ */ h("tr", { children: [
83
- /* @__PURE__ */ h("td", { children: [/* @__PURE__ */ h(u, {
89
+ ] }) }), /* @__PURE__ */ h("tbody", { children: T.map((t) => /* @__PURE__ */ g("tr", { children: [
90
+ /* @__PURE__ */ g("td", { children: [/* @__PURE__ */ g(d, {
84
91
  to: "/$workspace/docs/$doc",
85
92
  params: {
86
93
  workspace: e,
87
94
  doc: i(t)
88
95
  },
89
96
  className: "flex items-center gap-2 font-medium hover:underline",
90
- children: [/* @__PURE__ */ m(s, { icon: t.icon }), /* @__PURE__ */ m("span", {
97
+ children: [/* @__PURE__ */ h(c, { icon: t.icon }), /* @__PURE__ */ h("span", {
91
98
  className: "truncate",
92
99
  children: t.title
93
100
  })]
94
- }), t.parentId && T.has(t.parentId) && /* @__PURE__ */ m("span", {
101
+ }), t.parentId && E.has(t.parentId) && /* @__PURE__ */ h("span", {
95
102
  className: "ml-6 block truncate text-xs text-muted-foreground",
96
- children: l("inParent", { parent: T.get(t.parentId) ?? "" })
103
+ children: u("inParent", { parent: E.get(t.parentId) ?? "" })
97
104
  })] }),
98
- O.map((e) => /* @__PURE__ */ m("td", { children: E(e, D(t, e)) }, e.id)),
99
- /* @__PURE__ */ m("td", {
105
+ k.map((e) => /* @__PURE__ */ h("td", { children: D(e, O(t, e)) }, e.id)),
106
+ /* @__PURE__ */ h("td", {
100
107
  className: "text-muted-foreground",
101
- children: g(t.creator)
108
+ children: _(t.creator)
102
109
  }),
103
- /* @__PURE__ */ m("td", {
110
+ /* @__PURE__ */ h("td", {
104
111
  className: "text-muted-foreground",
105
- children: d.dateTime(new Date(t.updatedAt), { dateStyle: "medium" })
112
+ children: f.dateTime(new Date(t.updatedAt), { dateStyle: "medium" })
106
113
  })
107
114
  ] }, t.id)) })]
108
115
  })
109
116
  });
110
117
  }
111
- function x({ workspace: e, space: t, docs: f, props: g, by: _ }) {
112
- let v = p("docViews"), { members: y } = a(e), b = c(e), x = o(e, "edit_docs", n(t)), S = r(e), [C, w] = d(null), [T, E] = d(null), D = [..._.kind === "select" ? _.options.map((e) => ({
118
+ function S({ workspace: e, space: t, docs: s, props: p, by: _ }) {
119
+ let v = m("docViews"), { members: y } = a(e), b = l(e), x = o(e, "edit_docs", n(t)), S = r(e), [C, w] = f(null), [T, E] = f(null), D = [..._.kind === "select" ? _.options.map((e) => ({
113
120
  key: e.id ?? "",
114
121
  label: e.name
115
122
  })) : y.map((e) => ({
@@ -121,13 +128,13 @@ function x({ workspace: e, space: t, docs: f, props: g, by: _ }) {
121
128
  }], O = (e) => {
122
129
  let t = e.properties?.[_.id];
123
130
  return typeof t == "string" ? t : "";
124
- }, k = D.filter((e) => _.kind === "select" || e.key === "" || f.some((t) => O(t) === e.key)), A = g.filter((e) => e.id !== _.id).slice(0, 2);
125
- return /* @__PURE__ */ m("ul", {
131
+ }, k = D.filter((e) => _.kind === "select" || e.key === "" || s.some((t) => O(t) === e.key)), A = p.filter((e) => e.id !== _.id).slice(0, 2);
132
+ return /* @__PURE__ */ h("ul", {
126
133
  className: "flex gap-3 overflow-x-auto p-3",
127
134
  "aria-label": v("board"),
128
135
  children: k.map((t) => {
129
- let n = f.filter((e) => O(e) === t.key);
130
- return /* @__PURE__ */ h("li", {
136
+ let n = s.filter((e) => O(e) === t.key);
137
+ return /* @__PURE__ */ g("li", {
131
138
  "aria-label": t.label,
132
139
  onDragOver: (e) => {
133
140
  C && (e.preventDefault(), E(t.key));
@@ -139,37 +146,37 @@ function x({ workspace: e, space: t, docs: f, props: g, by: _ }) {
139
146
  values: { [_.id]: t.key || null }
140
147
  }), w(null), E(null);
141
148
  },
142
- className: l("flex w-64 shrink-0 flex-col rounded-lg border bg-muted/30", T === t.key ? "border-primary" : "border-border"),
143
- children: [/* @__PURE__ */ h("p", {
149
+ className: u("flex w-64 shrink-0 flex-col rounded-lg border bg-muted/30", T === t.key ? "border-primary" : "border-border"),
150
+ children: [/* @__PURE__ */ g("p", {
144
151
  className: "flex items-center gap-2 px-3 py-2 text-xs font-medium",
145
- children: [/* @__PURE__ */ m("span", {
152
+ children: [/* @__PURE__ */ h("span", {
146
153
  className: "truncate",
147
154
  children: t.label
148
- }), /* @__PURE__ */ m("span", {
155
+ }), /* @__PURE__ */ h("span", {
149
156
  className: "text-muted-foreground tabular-nums",
150
157
  children: n.length
151
158
  })]
152
- }), /* @__PURE__ */ m("ul", {
159
+ }), /* @__PURE__ */ h("ul", {
153
160
  className: "flex flex-col gap-2 px-2 pb-2",
154
- children: n.map((t) => /* @__PURE__ */ h("li", {
161
+ children: n.map((t) => /* @__PURE__ */ g("li", {
155
162
  draggable: x,
156
163
  onDragStart: () => w(t.key),
157
164
  onDragEnd: () => w(null),
158
165
  className: "rounded-md border border-border bg-card p-2.5 text-sm shadow-xs",
159
- children: [/* @__PURE__ */ h(u, {
166
+ children: [/* @__PURE__ */ g(d, {
160
167
  to: "/$workspace/docs/$doc",
161
168
  params: {
162
169
  workspace: e,
163
170
  doc: i(t)
164
171
  },
165
172
  className: "flex items-center gap-2 font-medium hover:underline",
166
- children: [/* @__PURE__ */ m(s, { icon: t.icon }), /* @__PURE__ */ m("span", {
173
+ children: [/* @__PURE__ */ h(c, { icon: t.icon }), /* @__PURE__ */ h("span", {
167
174
  className: "truncate",
168
175
  children: t.title
169
176
  })]
170
177
  }), A.map((e) => {
171
178
  let n = b(e, t.properties?.[e.id]);
172
- return n ? /* @__PURE__ */ h("p", {
179
+ return n ? /* @__PURE__ */ g("p", {
173
180
  className: "mt-1 truncate text-xs text-muted-foreground",
174
181
  children: [
175
182
  e.name,
@@ -184,4 +191,4 @@ function x({ workspace: e, space: t, docs: f, props: g, by: _ }) {
184
191
  })
185
192
  });
186
193
  }
187
- export { b as DocTable, v as groupable, y as useSpaceDocs };
194
+ export { x as DocTable, y as groupable, b as useSpaceDocs };
@@ -0,0 +1,37 @@
1
+ import { Link as e } from "../lib/router.js";
2
+ import { CloudIcon as t, UsersIcon as n, WorkerIcon as r } from "./icons.js";
3
+ import { Tooltip as i, cx as a } from "@parallelworks/ui";
4
+ import { useTranslations as o } from "use-intl";
5
+ import { jsx as s, jsxs as c } from "react/jsx-runtime";
6
+ // src/components/RunnerBadge.tsx
7
+ var l = {
8
+ personal: r,
9
+ shared: n,
10
+ compute: t
11
+ };
12
+ function u({ workspace: t, name: n, kind: r, link: u = !0, className: d }) {
13
+ let f = o("runnerKind"), p = l[r ?? "personal"];
14
+ return u ? /* @__PURE__ */ s(i, {
15
+ content: f(r ?? "personal"),
16
+ children: /* @__PURE__ */ c(e, {
17
+ to: "/$workspace/settings/runners",
18
+ params: { workspace: t },
19
+ className: a("inline-flex min-w-0 items-center gap-1 hover:text-foreground hover:underline", d),
20
+ children: [/* @__PURE__ */ s(p, { className: "size-3.5 shrink-0" }), /* @__PURE__ */ s("span", {
21
+ className: "truncate",
22
+ children: n
23
+ })]
24
+ })
25
+ }) : /* @__PURE__ */ c("span", {
26
+ className: a("inline-flex min-w-0 items-center gap-1", d),
27
+ title: f(r ?? "personal"),
28
+ children: [/* @__PURE__ */ s(p, {
29
+ className: "size-3.5 shrink-0",
30
+ "aria-label": f(r ?? "personal")
31
+ }), /* @__PURE__ */ s("span", {
32
+ className: "truncate",
33
+ children: n
34
+ })]
35
+ });
36
+ }
37
+ export { u as RunnerBadge };
package/lib/agents.js CHANGED
@@ -16,5 +16,11 @@ var e = {
16
16
  value: "codex",
17
17
  label: "Codex"
18
18
  }
19
- ];
20
- export { e as harnessNames, n as harnessOptions, t as runnableHarnesses };
19
+ ], r = 12e4;
20
+ function i(e, t, n = Date.now()) {
21
+ return t.filter((t) => t.harnesses.includes(e.harness) && e.runnerLabels.every((e) => t.labels.includes(e))).map((e) => ({
22
+ runner: e,
23
+ online: !!e.lastSeenAt && n - new Date(e.lastSeenAt).getTime() < 12e4
24
+ })).sort((e, t) => Number(t.online) - Number(e.online) || e.runner.name.localeCompare(t.runner.name));
25
+ }
26
+ export { e as harnessNames, n as harnessOptions, t as runnableHarnesses, r as runnerOnlineWithin, i as runnersFor };
@@ -58,7 +58,7 @@ var a = (e) => e === "workspace" ? void 0 : { team: e }, o = [
58
58
  });
59
59
  function u(e) {
60
60
  let t = e ?? {}, n = {};
61
- if (Array.isArray(t.columns) && (n.columns = t.columns.filter((e) => typeof e == "string")), typeof t.sort == "string" && (n.sort = t.sort), t.desc === !0 && (n.desc = !0), typeof t.groupBy == "string" && (n.groupBy = t.groupBy), t.filters && typeof t.filters == "object") {
61
+ if (Array.isArray(t.columns) && (n.columns = t.columns.filter((e) => typeof e == "string")), typeof t.sort == "string" && (n.sort = t.sort), t.desc === !0 && (n.desc = !0), typeof t.groupBy == "string" && (n.groupBy = t.groupBy), typeof t.dateProperty == "string" && (n.dateProperty = t.dateProperty), t.filters && typeof t.filters == "object") {
62
62
  let e = {};
63
63
  for (let [n, r] of Object.entries(t.filters)) typeof r == "string" && (e[n] = r);
64
64
  Object.keys(e).length > 0 && (n.filters = e);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parallelworks/tandem-web",
3
- "version": "0.175.4",
3
+ "version": "0.177.0",
4
4
  "description": "Tandem's pages, for a host app to render in its own",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",