@parallelworks/tandem-web 0.160.0 → 0.161.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.
@@ -1,7 +1,7 @@
1
1
  import { api as e, unwrap as t } from "../api/client.js";
2
2
  import { useNavigate as n } from "../lib/router.js";
3
- import { projectsQuery as r, teamsQuery as ee, workspaceQuery as te } from "../api/queries.js";
4
- import { AddIcon as ne, CalendarIcon as re, ChevronRightIcon as ie, CloseIcon as i, PriorityIcon as a, ProjectIcon as ae, UserIcon as o, UsersIcon as s, usePriorityNames as oe } from "./icons.js";
3
+ import { myTeamsQuery as r, projectsQuery as i, workspaceQuery as ee } from "../api/queries.js";
4
+ import { AddIcon as te, CalendarIcon as ne, ChevronRightIcon as re, CloseIcon as a, PriorityIcon as o, ProjectIcon as ie, UserIcon as ae, UsersIcon as s, usePriorityNames as oe } from "./icons.js";
5
5
  import { usePeople as se } from "../lib/people.js";
6
6
  import { useTime as ce } from "../lib/time.js";
7
7
  import { ProjectStatusIcon as c } from "./Planning.js";
@@ -19,37 +19,37 @@ import { useQuery as x, useQueryClient as ye } from "@tanstack/react-query";
19
19
  // src/components/NewProjectDialog.tsx
20
20
  var S = h({ size: "sm" });
21
21
  function C({ workspace: h, teamId: C, onClose: w }) {
22
- let T = _("planning"), E = _("common"), be = ve(), xe = ce(), D = oe(), Se = ye(), O = n(), { members: k, person: Ce } = se(h), { data: A } = x(te(h)), { data: we = [] } = x(ee(h)), { data: Te = [] } = x(r(h)), j = Te.filter((e) => e.template), [M, Ee] = g(""), [N, De] = g(""), [P, Oe] = g(""), [F, ke] = g(""), [I, Ae] = g(""), [L, je] = g("planned"), [R, Me] = g(0), [z, Ne] = g(""), [B, Pe] = g([]), [V, Fe] = g(C ? [C] : []), [H, Ie] = g(""), [U, Le] = g(""), [W, G] = g([]), [K, q] = g(null), [J, Y] = g(!1), [Re, X] = g(null), Z = we.filter((e) => !e.archivedAt), Q = (e, t, n) => /* @__PURE__ */ y(me, {
22
+ let T = _("planning"), E = _("common"), be = ve(), xe = ce(), D = oe(), Se = ye(), Ce = n(), { members: O, person: we } = se(h), { data: k } = x(ee(h)), { data: Te = [] } = x(r(h)), { data: Ee = [] } = x(i(h)), A = Ee.filter((e) => e.template), [j, De] = g(""), [M, Oe] = g(""), [N, ke] = g(""), [P, Ae] = g(""), [F, je] = g(""), [I, Me] = g("planned"), [L, Ne] = g(0), [R, Pe] = g(""), [z, Fe] = g([]), [B, Ie] = g(C ? [C] : []), [V, Le] = g(""), [H, U] = g(""), [W, G] = g([]), [K, q] = g(null), [J, Y] = g(!1), [Re, X] = g(null), Z = Te.filter((e) => !e.archivedAt), Q = (e, t, n) => /* @__PURE__ */ y(me, {
23
23
  value: t,
24
24
  onValueChange: n,
25
25
  "aria-label": e,
26
26
  trigger: /* @__PURE__ */ b("button", {
27
27
  type: "button",
28
28
  className: S,
29
- children: [/* @__PURE__ */ y(re, { className: "size-3.5 text-muted-foreground" }), /* @__PURE__ */ y("span", {
29
+ children: [/* @__PURE__ */ y(ne, { className: "size-3.5 text-muted-foreground" }), /* @__PURE__ */ y("span", {
30
30
  className: t ? "" : "text-muted-foreground",
31
31
  children: t ? xe.day(t) : e
32
32
  })]
33
33
  })
34
34
  }), ze = async (n) => {
35
- if (n.preventDefault(), P.trim()) {
35
+ if (n.preventDefault(), N.trim()) {
36
36
  Y(!0), X(null);
37
37
  try {
38
38
  let n = t(await e.POST("/api/v1/workspaces/{workspace}/projects", {
39
39
  params: { path: { workspace: h } },
40
40
  body: {
41
- name: P.trim(),
42
- status: L,
43
- ...M && { from: M },
44
- ...F.trim() && { summary: F.trim() },
45
- ...I && { description: I },
46
- ...R && { priority: R },
47
- ...N && { icon: N },
48
- ...z && { lead: z },
49
- ...B.length > 0 && { members: B },
50
- ...V.length > 0 && { teamIds: V },
51
- ...H && { startDate: H },
52
- ...U && { targetDate: U }
41
+ name: N.trim(),
42
+ status: I,
43
+ ...j && { from: j },
44
+ ...P.trim() && { summary: P.trim() },
45
+ ...F && { description: F },
46
+ ...L && { priority: L },
47
+ ...M && { icon: M },
48
+ ...R && { lead: R },
49
+ ...z.length > 0 && { members: z },
50
+ ...B.length > 0 && { teamIds: B },
51
+ ...V && { startDate: V },
52
+ ...H && { targetDate: H }
53
53
  }
54
54
  }));
55
55
  for (let r of W.filter((e) => e.name.trim())) t(await e.POST("/api/v1/workspaces/{workspace}/projects/{projectId}/milestones", {
@@ -62,7 +62,7 @@ function C({ workspace: h, teamId: C, onClose: w }) {
62
62
  ...r.targetDate && { targetDate: r.targetDate }
63
63
  }
64
64
  }));
65
- Se.invalidateQueries({ queryKey: r(h).queryKey }), w(), O({
65
+ Se.invalidateQueries({ queryKey: i(h).queryKey }), w(), Ce({
66
66
  to: "/$workspace/projects/$projectId",
67
67
  params: {
68
68
  workspace: h,
@@ -75,7 +75,7 @@ function C({ workspace: h, teamId: C, onClose: w }) {
75
75
  Y(!1);
76
76
  }
77
77
  }
78
- }, $ = z ? Ce(z) : void 0;
78
+ }, $ = R ? we(R) : void 0;
79
79
  return /* @__PURE__ */ y(ge, {
80
80
  open: !0,
81
81
  onClose: w,
@@ -87,15 +87,15 @@ function C({ workspace: h, teamId: C, onClose: w }) {
87
87
  /* @__PURE__ */ b("div", {
88
88
  className: "flex items-center gap-2 px-5 pt-4 text-sm",
89
89
  children: [
90
- A && /* @__PURE__ */ b("span", {
90
+ k && /* @__PURE__ */ b("span", {
91
91
  className: "flex items-center gap-1.5 rounded-md border border-border px-2 py-0.5",
92
92
  children: [/* @__PURE__ */ y(l, {
93
- icon: A.icon,
94
- color: A.color,
95
- name: A.name
96
- }), A.name]
93
+ icon: k.icon,
94
+ color: k.color,
95
+ name: k.name
96
+ }), k.name]
97
97
  }),
98
- /* @__PURE__ */ y(ie, { className: "size-3.5 text-muted-foreground" }),
98
+ /* @__PURE__ */ y(re, { className: "size-3.5 text-muted-foreground" }),
99
99
  /* @__PURE__ */ y(_e, {
100
100
  className: "text-sm",
101
101
  children: T("newProject")
@@ -103,7 +103,7 @@ function C({ workspace: h, teamId: C, onClose: w }) {
103
103
  /* @__PURE__ */ y(p, {
104
104
  variant: "ghost",
105
105
  size: "sm",
106
- icon: /* @__PURE__ */ y(i, {}),
106
+ icon: /* @__PURE__ */ y(a, {}),
107
107
  label: E("close"),
108
108
  onClick: w,
109
109
  className: "ml-auto"
@@ -115,14 +115,14 @@ function C({ workspace: h, teamId: C, onClose: w }) {
115
115
  children: [
116
116
  /* @__PURE__ */ y(fe, {
117
117
  workspace: h,
118
- icon: N,
119
- name: P || T("project"),
120
- onChange: De,
118
+ icon: M,
119
+ name: N || T("project"),
120
+ onChange: Oe,
121
121
  size: 40
122
122
  }),
123
123
  /* @__PURE__ */ y("input", {
124
- value: P,
125
- onChange: (e) => Oe(e.target.value),
124
+ value: N,
125
+ onChange: (e) => ke(e.target.value),
126
126
  autoFocus: !0,
127
127
  required: !0,
128
128
  maxLength: 200,
@@ -131,8 +131,8 @@ function C({ workspace: h, teamId: C, onClose: w }) {
131
131
  className: "mt-3 w-full bg-transparent text-2xl font-semibold tracking-tight outline-none placeholder:text-muted-foreground/60"
132
132
  }),
133
133
  /* @__PURE__ */ y("input", {
134
- value: F,
135
- onChange: (e) => ke(e.target.value),
134
+ value: P,
135
+ onChange: (e) => Ae(e.target.value),
136
136
  maxLength: 200,
137
137
  "aria-label": T("summary"),
138
138
  placeholder: T("summaryPlaceholder"),
@@ -142,7 +142,7 @@ function C({ workspace: h, teamId: C, onClose: w }) {
142
142
  className: "mt-4",
143
143
  children: /* @__PURE__ */ y(ue, {
144
144
  value: "",
145
- onChange: Ae,
145
+ onChange: je,
146
146
  placeholder: T("projectBrief"),
147
147
  label: E("description"),
148
148
  className: "min-h-32"
@@ -159,7 +159,7 @@ function C({ workspace: h, teamId: C, onClose: w }) {
159
159
  className: "text-sm font-medium",
160
160
  children: T("milestones")
161
161
  }), /* @__PURE__ */ y(p, {
162
- icon: /* @__PURE__ */ y(ne, { className: "size-3.5" }),
162
+ icon: /* @__PURE__ */ y(te, { className: "size-3.5" }),
163
163
  label: T("addMilestone"),
164
164
  size: "xs",
165
165
  onClick: () => G((e) => [...e, {
@@ -190,7 +190,7 @@ function C({ workspace: h, teamId: C, onClose: w }) {
190
190
  /* @__PURE__ */ y(p, {
191
191
  variant: "ghost",
192
192
  size: "sm",
193
- icon: /* @__PURE__ */ y(i, {}),
193
+ icon: /* @__PURE__ */ y(a, {}),
194
194
  label: T("removeMilestone"),
195
195
  onClick: () => G((t) => t.filter((t) => t.key !== e.key))
196
196
  })
@@ -202,27 +202,27 @@ function C({ workspace: h, teamId: C, onClose: w }) {
202
202
  /* @__PURE__ */ b("div", {
203
203
  className: "flex flex-wrap items-center gap-1.5 border-t border-border px-5 pt-3",
204
204
  children: [
205
- j.length > 0 && /* @__PURE__ */ y(m, {
205
+ A.length > 0 && /* @__PURE__ */ y(m, {
206
206
  "aria-label": T("startFrom"),
207
- value: M,
208
- onValueChange: (e) => Ee(e ?? ""),
207
+ value: j,
208
+ onValueChange: (e) => De(e ?? ""),
209
209
  items: [{
210
210
  value: "",
211
211
  label: T("blankProject")
212
- }, ...j.map((e) => ({
212
+ }, ...A.map((e) => ({
213
213
  value: e.id,
214
214
  label: e.name
215
215
  }))],
216
216
  trigger: /* @__PURE__ */ b("button", {
217
217
  type: "button",
218
218
  className: S,
219
- children: [/* @__PURE__ */ y(ae, { className: "size-3.5 text-muted-foreground" }), M ? T("fromTemplate", { name: j.find((e) => e.id === M)?.name ?? "" }) : T("blankProject")]
219
+ children: [/* @__PURE__ */ y(ie, { className: "size-3.5 text-muted-foreground" }), j ? T("fromTemplate", { name: A.find((e) => e.id === j)?.name ?? "" }) : T("blankProject")]
220
220
  })
221
221
  }),
222
222
  /* @__PURE__ */ y(m, {
223
223
  "aria-label": T("statusLabel"),
224
- value: L,
225
- onValueChange: (e) => e && je(e),
224
+ value: I,
225
+ onValueChange: (e) => e && Me(e),
226
226
  items: de.map((e) => ({
227
227
  value: e,
228
228
  label: T(`status.${e}`),
@@ -231,32 +231,32 @@ function C({ workspace: h, teamId: C, onClose: w }) {
231
231
  trigger: /* @__PURE__ */ b("button", {
232
232
  type: "button",
233
233
  className: S,
234
- children: [/* @__PURE__ */ y(c, { status: L }), T(`status.${L}`)]
234
+ children: [/* @__PURE__ */ y(c, { status: I }), T(`status.${I}`)]
235
235
  })
236
236
  }),
237
237
  /* @__PURE__ */ y(m, {
238
238
  "aria-label": T("priority"),
239
- value: String(R),
240
- onValueChange: (e) => e && Me(Number(e)),
239
+ value: String(L),
240
+ onValueChange: (e) => e && Ne(Number(e)),
241
241
  items: D.map((e, t) => ({
242
242
  value: String(t),
243
243
  label: e,
244
- icon: /* @__PURE__ */ y(a, { priority: t })
244
+ icon: /* @__PURE__ */ y(o, { priority: t })
245
245
  })),
246
246
  trigger: /* @__PURE__ */ b("button", {
247
247
  type: "button",
248
248
  className: S,
249
- children: [/* @__PURE__ */ y(a, { priority: R }), R ? D[R] : T("noPriority")]
249
+ children: [/* @__PURE__ */ y(o, { priority: L }), L ? D[L] : T("noPriority")]
250
250
  })
251
251
  }),
252
252
  /* @__PURE__ */ y(f, {
253
253
  "aria-label": T("lead"),
254
- value: z,
255
- onValueChange: (e) => Ne(e ?? ""),
254
+ value: R,
255
+ onValueChange: (e) => Pe(e ?? ""),
256
256
  items: [{
257
257
  value: "",
258
258
  label: T("noLead")
259
- }, ...k.map((e) => ({
259
+ }, ...O.map((e) => ({
260
260
  value: e.user.username,
261
261
  label: e.user.name,
262
262
  icon: /* @__PURE__ */ y(u, {
@@ -274,7 +274,7 @@ function C({ workspace: h, teamId: C, onClose: w }) {
274
274
  src: $.avatarUrl,
275
275
  size: "xs",
276
276
  decorative: !0
277
- }), $.name] }) : /* @__PURE__ */ b(v, { children: [/* @__PURE__ */ y(o, { className: "size-3.5 text-muted-foreground" }), /* @__PURE__ */ y("span", {
277
+ }), $.name] }) : /* @__PURE__ */ b(v, { children: [/* @__PURE__ */ y(ae, { className: "size-3.5 text-muted-foreground" }), /* @__PURE__ */ y("span", {
278
278
  className: "text-muted-foreground",
279
279
  children: T("lead")
280
280
  })] })
@@ -284,7 +284,7 @@ function C({ workspace: h, teamId: C, onClose: w }) {
284
284
  open: K === "members",
285
285
  onOpenChange: (e) => q(e ? "members" : null),
286
286
  multiple: !0,
287
- items: k.map((e) => ({
287
+ items: O.map((e) => ({
288
288
  value: e.user.username,
289
289
  label: e.user.name,
290
290
  icon: /* @__PURE__ */ y(u, {
@@ -294,20 +294,20 @@ function C({ workspace: h, teamId: C, onClose: w }) {
294
294
  decorative: !0
295
295
  })
296
296
  })),
297
- value: B,
298
- onValueChange: Pe,
297
+ value: z,
298
+ onValueChange: Fe,
299
299
  placeholder: T("members"),
300
300
  trigger: /* @__PURE__ */ b("button", {
301
301
  type: "button",
302
302
  className: S,
303
303
  children: [/* @__PURE__ */ y(s, { className: "size-3.5 text-muted-foreground" }), /* @__PURE__ */ y("span", {
304
- className: B.length ? "" : "text-muted-foreground",
305
- children: B.length ? T("memberCount", { count: B.length }) : T("members")
304
+ className: z.length ? "" : "text-muted-foreground",
305
+ children: z.length ? T("memberCount", { count: z.length }) : T("members")
306
306
  })]
307
307
  })
308
308
  }),
309
- Q(T("startDate"), H, Ie),
310
- Q(T("targetDate"), U, Le),
309
+ Q(T("startDate"), V, Le),
310
+ Q(T("targetDate"), H, U),
311
311
  /* @__PURE__ */ y(f, {
312
312
  open: K === "teams",
313
313
  onOpenChange: (e) => q(e ? "teams" : null),
@@ -322,15 +322,15 @@ function C({ workspace: h, teamId: C, onClose: w }) {
322
322
  name: e.name
323
323
  })
324
324
  })),
325
- value: V,
326
- onValueChange: Fe,
325
+ value: B,
326
+ onValueChange: Ie,
327
327
  placeholder: T("teams"),
328
328
  trigger: /* @__PURE__ */ b("button", {
329
329
  type: "button",
330
330
  className: S,
331
331
  children: [/* @__PURE__ */ y(s, { className: "size-3.5 text-muted-foreground" }), /* @__PURE__ */ y("span", {
332
- className: V.length ? "" : "text-muted-foreground",
333
- children: V.length ? Z.filter((e) => V.includes(e.id)).map((e) => e.key).join(", ") : T("teams")
332
+ className: B.length ? "" : "text-muted-foreground",
333
+ children: B.length ? Z.filter((e) => B.includes(e.id)).map((e) => e.key).join(", ") : T("teams")
334
334
  })]
335
335
  })
336
336
  })
@@ -353,7 +353,7 @@ function C({ workspace: h, teamId: C, onClose: w }) {
353
353
  /* @__PURE__ */ y(d, {
354
354
  type: "submit",
355
355
  variant: "primary",
356
- disabled: J || !P.trim(),
356
+ disabled: J || !N.trim(),
357
357
  children: T(J ? "creating" : "createProject")
358
358
  })
359
359
  ]
package/lib/boardMove.js CHANGED
@@ -87,15 +87,25 @@ function d(d, f) {
87
87
  labels: []
88
88
  };
89
89
  }
90
- let b = { queryKey: [
90
+ let b = (e) => ({
91
+ ...e,
92
+ issues: e.issues.map((e) => e.id === r.id ? y : e)
93
+ }), x = { queryKey: [
91
94
  "workspace",
92
95
  d,
93
96
  "issues",
94
97
  "list"
95
98
  ] };
96
- p.setQueriesData(b, (e) => e && {
99
+ p.setQueriesData(x, (e) => e && b(e));
100
+ let S = { queryKey: [
101
+ "workspace",
102
+ d,
103
+ "issues",
104
+ "pages"
105
+ ] };
106
+ p.setQueriesData(S, (e) => e && {
97
107
  ...e,
98
- issues: e.issues.map((e) => e.id === r.id ? y : e)
108
+ pages: e.pages.map(b)
99
109
  });
100
110
  try {
101
111
  let i = v ? await a(d, r.identifier, v) : t(await e.PATCH("/api/v1/workspaces/{workspace}/issues/{identifier}", {
@@ -0,0 +1,14 @@
1
+ // src/lib/groupList.ts
2
+ function e(e, t) {
3
+ return e.flatMap((e) => [{
4
+ kind: "group",
5
+ group: e
6
+ }, ...t.has(e.key) ? [] : e.issues.map((e) => ({
7
+ kind: "row",
8
+ issue: e
9
+ }))]);
10
+ }
11
+ function t(e, t) {
12
+ return e.findLast((e) => e <= t) ?? 0;
13
+ }
14
+ export { e as groupItems, t as headingOf };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parallelworks/tandem-web",
3
- "version": "0.160.0",
3
+ "version": "0.161.0",
4
4
  "description": "Tandem's pages, for a host app to render in its own",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",
@@ -21,6 +21,7 @@
21
21
  "@parallelworks/i18n": "^0.3.0",
22
22
  "@parallelworks/problem": "^0.6.0",
23
23
  "@tanstack/react-query": "^5.104.5",
24
+ "@tanstack/react-virtual": "3.14.24",
24
25
  "@tiptap/extension-blockquote": "3.32.0",
25
26
  "@tiptap/extension-code-block-lowlight": "3.32.0",
26
27
  "@tiptap/extension-collaboration": "^3.32.0",