@burdenoff/microfe-healthybowl 2026.703.1 → 2026.703.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.
Files changed (101) hide show
  1. package/dist/node_modules/@burdenoff/planmagnet-fe-sdk/dist/index.js +1331 -557
  2. package/dist/node_modules/@burdenoff/planmagnet-fe-sdk/dist/index.js.map +1 -1
  3. package/dist/node_modules/date-fns/_lib/addLeadingZeros.js +8 -0
  4. package/dist/node_modules/date-fns/_lib/addLeadingZeros.js.map +1 -0
  5. package/dist/node_modules/date-fns/_lib/defaultOptions.js +9 -0
  6. package/dist/node_modules/date-fns/_lib/defaultOptions.js.map +1 -0
  7. package/dist/node_modules/date-fns/_lib/format/formatters.js +384 -0
  8. package/dist/node_modules/date-fns/_lib/format/formatters.js.map +1 -0
  9. package/dist/node_modules/date-fns/_lib/format/lightFormatters.js +45 -0
  10. package/dist/node_modules/date-fns/_lib/format/lightFormatters.js.map +1 -0
  11. package/dist/node_modules/date-fns/_lib/format/longFormatters.js +42 -0
  12. package/dist/node_modules/date-fns/_lib/format/longFormatters.js.map +1 -0
  13. package/dist/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.js +10 -0
  14. package/dist/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.js.map +1 -0
  15. package/dist/node_modules/date-fns/_lib/normalizeDates.js +10 -0
  16. package/dist/node_modules/date-fns/_lib/normalizeDates.js.map +1 -0
  17. package/dist/node_modules/date-fns/_lib/normalizeInterval.js +13 -0
  18. package/dist/node_modules/date-fns/_lib/normalizeInterval.js.map +1 -0
  19. package/dist/node_modules/date-fns/_lib/protectedTokens.js +25 -0
  20. package/dist/node_modules/date-fns/_lib/protectedTokens.js.map +1 -0
  21. package/dist/node_modules/date-fns/addDays.js +11 -0
  22. package/dist/node_modules/date-fns/addDays.js.map +1 -0
  23. package/dist/node_modules/date-fns/addMonths.js +14 -0
  24. package/dist/node_modules/date-fns/addMonths.js.map +1 -0
  25. package/dist/node_modules/date-fns/addWeeks.js +9 -0
  26. package/dist/node_modules/date-fns/addWeeks.js.map +1 -0
  27. package/dist/node_modules/date-fns/constants.js +8 -0
  28. package/dist/node_modules/date-fns/constants.js.map +1 -0
  29. package/dist/node_modules/date-fns/constructFrom.js +9 -0
  30. package/dist/node_modules/date-fns/constructFrom.js.map +1 -0
  31. package/dist/node_modules/date-fns/constructNow.js +9 -0
  32. package/dist/node_modules/date-fns/constructNow.js.map +1 -0
  33. package/dist/node_modules/date-fns/differenceInCalendarDays.js +13 -0
  34. package/dist/node_modules/date-fns/differenceInCalendarDays.js.map +1 -0
  35. package/dist/node_modules/date-fns/eachDayOfInterval.js +17 -0
  36. package/dist/node_modules/date-fns/eachDayOfInterval.js.map +1 -0
  37. package/dist/node_modules/date-fns/endOfMonth.js +10 -0
  38. package/dist/node_modules/date-fns/endOfMonth.js.map +1 -0
  39. package/dist/node_modules/date-fns/endOfWeek.js +11 -0
  40. package/dist/node_modules/date-fns/endOfWeek.js.map +1 -0
  41. package/dist/node_modules/date-fns/format.js +61 -0
  42. package/dist/node_modules/date-fns/format.js.map +1 -0
  43. package/dist/node_modules/date-fns/getDayOfYear.js +12 -0
  44. package/dist/node_modules/date-fns/getDayOfYear.js.map +1 -0
  45. package/dist/node_modules/date-fns/getISOWeek.js +13 -0
  46. package/dist/node_modules/date-fns/getISOWeek.js.map +1 -0
  47. package/dist/node_modules/date-fns/getISOWeekYear.js +16 -0
  48. package/dist/node_modules/date-fns/getISOWeekYear.js.map +1 -0
  49. package/dist/node_modules/date-fns/getWeek.js +13 -0
  50. package/dist/node_modules/date-fns/getWeek.js.map +1 -0
  51. package/dist/node_modules/date-fns/getWeekYear.js +17 -0
  52. package/dist/node_modules/date-fns/getWeekYear.js.map +1 -0
  53. package/dist/node_modules/date-fns/isDate.js +8 -0
  54. package/dist/node_modules/date-fns/isDate.js.map +1 -0
  55. package/dist/node_modules/date-fns/isSameDay.js +11 -0
  56. package/dist/node_modules/date-fns/isSameDay.js.map +1 -0
  57. package/dist/node_modules/date-fns/isSameMonth.js +10 -0
  58. package/dist/node_modules/date-fns/isSameMonth.js.map +1 -0
  59. package/dist/node_modules/date-fns/isToday.js +11 -0
  60. package/dist/node_modules/date-fns/isToday.js.map +1 -0
  61. package/dist/node_modules/date-fns/isValid.js +10 -0
  62. package/dist/node_modules/date-fns/isValid.js.map +1 -0
  63. package/dist/node_modules/date-fns/locale/_lib/buildFormatLongFn.js +11 -0
  64. package/dist/node_modules/date-fns/locale/_lib/buildFormatLongFn.js.map +1 -0
  65. package/dist/node_modules/date-fns/locale/_lib/buildLocalizeFn.js +19 -0
  66. package/dist/node_modules/date-fns/locale/_lib/buildLocalizeFn.js.map +1 -0
  67. package/dist/node_modules/date-fns/locale/_lib/buildMatchFn.js +24 -0
  68. package/dist/node_modules/date-fns/locale/_lib/buildMatchFn.js.map +1 -0
  69. package/dist/node_modules/date-fns/locale/_lib/buildMatchPatternFn.js +20 -0
  70. package/dist/node_modules/date-fns/locale/_lib/buildMatchPatternFn.js.map +1 -0
  71. package/dist/node_modules/date-fns/locale/en-US/_lib/formatDistance.js +71 -0
  72. package/dist/node_modules/date-fns/locale/en-US/_lib/formatDistance.js.map +1 -0
  73. package/dist/node_modules/date-fns/locale/en-US/_lib/formatLong.js +34 -0
  74. package/dist/node_modules/date-fns/locale/en-US/_lib/formatLong.js.map +1 -0
  75. package/dist/node_modules/date-fns/locale/en-US/_lib/formatRelative.js +13 -0
  76. package/dist/node_modules/date-fns/locale/en-US/_lib/formatRelative.js.map +1 -0
  77. package/dist/node_modules/date-fns/locale/en-US/_lib/localize.js +204 -0
  78. package/dist/node_modules/date-fns/locale/en-US/_lib/localize.js.map +1 -0
  79. package/dist/node_modules/date-fns/locale/en-US/_lib/match.js +126 -0
  80. package/dist/node_modules/date-fns/locale/en-US/_lib/match.js.map +1 -0
  81. package/dist/node_modules/date-fns/locale/en-US.js +22 -0
  82. package/dist/node_modules/date-fns/locale/en-US.js.map +1 -0
  83. package/dist/node_modules/date-fns/parseISO.js +119 -0
  84. package/dist/node_modules/date-fns/parseISO.js.map +1 -0
  85. package/dist/node_modules/date-fns/startOfDay.js +10 -0
  86. package/dist/node_modules/date-fns/startOfDay.js.map +1 -0
  87. package/dist/node_modules/date-fns/startOfISOWeek.js +12 -0
  88. package/dist/node_modules/date-fns/startOfISOWeek.js.map +1 -0
  89. package/dist/node_modules/date-fns/startOfISOWeekYear.js +12 -0
  90. package/dist/node_modules/date-fns/startOfISOWeekYear.js.map +1 -0
  91. package/dist/node_modules/date-fns/startOfMonth.js +10 -0
  92. package/dist/node_modules/date-fns/startOfMonth.js.map +1 -0
  93. package/dist/node_modules/date-fns/startOfWeek.js +11 -0
  94. package/dist/node_modules/date-fns/startOfWeek.js.map +1 -0
  95. package/dist/node_modules/date-fns/startOfWeekYear.js +13 -0
  96. package/dist/node_modules/date-fns/startOfWeekYear.js.map +1 -0
  97. package/dist/node_modules/date-fns/startOfYear.js +10 -0
  98. package/dist/node_modules/date-fns/startOfYear.js.map +1 -0
  99. package/dist/node_modules/date-fns/toDate.js +9 -0
  100. package/dist/node_modules/date-fns/toDate.js.map +1 -0
  101. package/package.json +2 -2
@@ -1,31 +1,44 @@
1
1
  import e from "../../../clsx/dist/clsx.js";
2
2
  import { twMerge as t } from "../../../tailwind-merge/dist/bundle-mjs.js";
3
- import { cva as n } from "../../../class-variance-authority/dist/index.js";
4
- import { createContext as r, useCallback as i, useContext as a, useEffect as o, useMemo as s, useState as c } from "react";
5
- import { Filter as l } from "lucide-react";
6
- import { jsx as u, jsxs as d } from "react/jsx-runtime";
7
- import { Card as f, CardContent as p } from "@burdenoff/fe-libs/ui";
8
- import { gql as m } from "@apollo/client";
9
- import { useApolloClient as h, useMutation as g, useQuery as _ } from "@apollo/client/react";
3
+ import n from "../../../date-fns/addMonths.js";
4
+ import r from "../../../date-fns/startOfWeek.js";
5
+ import i from "../../../date-fns/startOfDay.js";
6
+ import a from "../../../date-fns/addWeeks.js";
7
+ import o from "../../../date-fns/isValid.js";
8
+ import s from "../../../date-fns/endOfMonth.js";
9
+ import c from "../../../date-fns/eachDayOfInterval.js";
10
+ import l from "../../../date-fns/startOfMonth.js";
11
+ import u from "../../../date-fns/endOfWeek.js";
12
+ import d from "../../../date-fns/format.js";
13
+ import f from "../../../date-fns/isSameMonth.js";
14
+ import p from "../../../date-fns/isToday.js";
15
+ import m from "../../../date-fns/parseISO.js";
16
+ import { cva as h } from "../../../class-variance-authority/dist/index.js";
17
+ import { createContext as g, useCallback as _, useContext as v, useEffect as y, useMemo as b, useState as x } from "react";
18
+ import { CalendarDays as S, CalendarRange as C, ChevronDown as w, ChevronLeft as T, ChevronRight as E, ChevronUp as D, Circle as O, CircleCheckBig as k, CircleDashed as A, CircleDot as j, CircleDotDashed as M, CircleX as N, LayoutGrid as P, List as F, Plus as I, Search as L, User as R } from "lucide-react";
19
+ import { jsx as z, jsxs as B } from "react/jsx-runtime";
20
+ import { Card as V, CardContent as H } from "@burdenoff/fe-libs/ui";
21
+ import { gql as U } from "@apollo/client";
22
+ import { useApolloClient as ee, useMutation as W, useQuery as te } from "@apollo/client/react";
10
23
  import "@apollo/client/core";
11
24
  import "@apollo/client/link/context";
12
25
  import "@apollo/client/link/error";
13
26
  //#region node_modules/@burdenoff/planmagnet-fe-sdk/dist/index.js
14
- var v = {
27
+ var ne = {
15
28
  apiGatewayUrl: "",
16
29
  workspaceId: ""
17
30
  };
18
31
  new Proxy({}, { get(e, t) {
19
- return v[t];
32
+ return ne[t];
20
33
  } });
21
- function y() {
22
- return { ...v };
34
+ function re() {
35
+ return { ...ne };
23
36
  }
24
- var b = r(null);
25
- function x() {
26
- return a(b);
37
+ var ie = g(null);
38
+ function G() {
39
+ return v(ie);
27
40
  }
28
- var S = m`
41
+ var ae = U`
29
42
  fragment WorkItemSummaryFields on WorkItem {
30
43
  id
31
44
  key
@@ -39,7 +52,7 @@ var S = m`
39
52
  dueDate
40
53
  labels
41
54
  }
42
- `, C = m`
55
+ `, oe = U`
43
56
  fragment WorkItemFields on WorkItem {
44
57
  id
45
58
  workspaceId
@@ -68,7 +81,7 @@ var S = m`
68
81
  updatedBy
69
82
  deletedAt
70
83
  }
71
- `, w = m`
84
+ `, se = U`
72
85
  fragment ProjectSummaryFields on Project {
73
86
  id
74
87
  name
@@ -80,7 +93,7 @@ var S = m`
80
93
  endDate
81
94
  tags
82
95
  }
83
- `, T = m`
96
+ `, ce = U`
84
97
  query ListWorkItems(
85
98
  $workspaceId: ID!
86
99
  $filter: PlanmagnetWorkItemFilter
@@ -104,16 +117,16 @@ var S = m`
104
117
  totalCount
105
118
  }
106
119
  }
107
- ${S}
108
- `, E = m`
120
+ ${ae}
121
+ `, le = U`
109
122
  query GetWorkItem($id: ID!) {
110
123
  planmagnetWorkItem(id: $id) {
111
124
  ...WorkItemFields
112
125
  }
113
126
  }
114
- ${C}
127
+ ${oe}
115
128
  `;
116
- m`
129
+ U`
117
130
  query GetProjects(
118
131
  $workspaceId: ID!
119
132
  $filter: PlanmagnetProjectFilter
@@ -137,35 +150,109 @@ m`
137
150
  totalCount
138
151
  }
139
152
  }
140
- ${w}
153
+ ${se}
141
154
  `;
142
- var D = m`
155
+ var ue = U`
143
156
  mutation CreateWorkItem($input: PlanmagnetCreateWorkItemInput!) {
144
157
  planmagnetCreateWorkItem(input: $input) {
145
158
  ...WorkItemFields
146
159
  }
147
160
  }
148
- ${C}
149
- `, O = m`
161
+ ${oe}
162
+ `, de = U`
150
163
  mutation UpdateWorkItem($id: ID!, $input: PlanmagnetUpdateWorkItemInput!) {
151
164
  planmagnetUpdateWorkItem(id: $id, input: $input) {
152
165
  ...WorkItemFields
153
166
  }
154
167
  }
155
- ${C}
168
+ ${oe}
156
169
  `;
157
- m`
170
+ U`
158
171
  mutation MoveWorkItem($id: ID!, $input: PlanmagnetMoveWorkItemInput!) {
159
172
  planmagnetMoveWorkItem(id: $id, input: $input) {
160
173
  ...WorkItemFields
161
174
  }
162
175
  }
163
- ${C}
176
+ ${oe}
164
177
  `;
165
- function k(...n) {
178
+ function K(...n) {
166
179
  return t(e(n));
167
180
  }
168
- var A = [
181
+ var fe = /* @__PURE__ */ new Set(["DONE", "CANCELLED"]);
182
+ function pe(e) {
183
+ if (!e) return null;
184
+ let t = m(e);
185
+ return o(t) ? t : null;
186
+ }
187
+ function me(e) {
188
+ let t = pe(e);
189
+ if (!t) return null;
190
+ let n = /* @__PURE__ */ new Date();
191
+ return d(t, t.getFullYear() === n.getFullYear() ? "MMM d" : "MMM d yyyy");
192
+ }
193
+ function he(e, t) {
194
+ let n = pe(e);
195
+ return !n || t && fe.has(t) ? !1 : i(n).getTime() < i(/* @__PURE__ */ new Date()).getTime();
196
+ }
197
+ var ge = h("inline-flex items-center rounded-full px-2 py-0.5 text-[10px] font-medium capitalize transition-colors", {
198
+ variants: { variant: {
199
+ default: "bg-primary/10 text-primary",
200
+ muted: "bg-muted text-muted-foreground",
201
+ secondary: "bg-secondary text-secondary-foreground",
202
+ accent: "bg-accent text-accent-foreground",
203
+ destructive: "bg-destructive/15 text-destructive"
204
+ } },
205
+ defaultVariants: { variant: "default" }
206
+ });
207
+ function _e({ className: e, variant: t, ...n }) {
208
+ return /* @__PURE__ */ z("span", {
209
+ className: K(ge({ variant: t }), e),
210
+ ...n
211
+ });
212
+ }
213
+ var ve = [
214
+ "bg-primary/15 text-primary",
215
+ "bg-secondary text-secondary-foreground",
216
+ "bg-accent text-accent-foreground",
217
+ "bg-muted text-muted-foreground",
218
+ "bg-destructive/15 text-destructive"
219
+ ], ye = {
220
+ sm: "h-5 w-5 text-[9px]",
221
+ md: "h-6 w-6 text-[10px]",
222
+ lg: "h-8 w-8 text-xs"
223
+ };
224
+ function be(e) {
225
+ let t = 0;
226
+ for (let n = 0; n < e.length; n++) t = t * 31 + e.charCodeAt(n) >>> 0;
227
+ return t % ve.length;
228
+ }
229
+ function xe(e, t) {
230
+ let n = (e ?? "").trim();
231
+ if (n) {
232
+ let e = n.split(/\s+/);
233
+ return ((e[0]?.[0] ?? "") + (e.length > 1 ? e[e.length - 1]?.[0] ?? "" : "")).toUpperCase() || "?";
234
+ }
235
+ return (t ?? "").replace(/[^a-zA-Z0-9]/g, "").slice(0, 2).toUpperCase() || "?";
236
+ }
237
+ function Se({ id: e, name: t, size: n = "md", className: r }) {
238
+ if (!e && !t) return /* @__PURE__ */ z("span", {
239
+ className: K("inline-flex items-center justify-center rounded-full border border-dashed border-border text-muted-foreground", ye[n], r),
240
+ title: "Unassigned",
241
+ "aria-label": "Unassigned",
242
+ children: /* @__PURE__ */ z(R, {
243
+ className: "h-1/2 w-1/2",
244
+ "aria-hidden": "true"
245
+ })
246
+ });
247
+ let i = ve[be(t || e || "")];
248
+ return /* @__PURE__ */ z("span", {
249
+ className: K("inline-flex items-center justify-center rounded-full font-medium", ye[n], i, r),
250
+ title: t ?? e ?? void 0,
251
+ "aria-label": t ?? e ?? void 0,
252
+ children: xe(t, e)
253
+ });
254
+ }
255
+ var Ce = [
169
256
  {
170
257
  status: "BACKLOG",
171
258
  label: "Backlog"
@@ -190,19 +277,19 @@ var A = [
190
277
  status: "DONE",
191
278
  label: "Done"
192
279
  }
193
- ], j = [
280
+ ], we = [
194
281
  "NONE",
195
282
  "LOW",
196
283
  "MEDIUM",
197
284
  "HIGH",
198
285
  "CRITICAL"
199
- ], ee = [
286
+ ], Te = [
200
287
  "TASK",
201
288
  "STORY",
202
289
  "BUG",
203
290
  "EPIC",
204
291
  "SUB_TASK"
205
- ], M = [
292
+ ], Ee = [
206
293
  "BACKLOG",
207
294
  "TODO",
208
295
  "IN_PROGRESS",
@@ -211,162 +298,327 @@ var A = [
211
298
  "DONE",
212
299
  "CANCELLED"
213
300
  ];
214
- function N(e) {
301
+ function q(e) {
215
302
  return e.toLowerCase().replace(/_/g, " ");
216
303
  }
217
- var P = {
218
- BACKLOG: "border-t-muted-foreground/40",
219
- TODO: "border-t-primary/50",
220
- IN_PROGRESS: "border-t-primary",
221
- IN_REVIEW: "border-t-secondary-foreground/50",
222
- TESTING: "border-t-accent-foreground/50",
223
- DONE: "border-t-primary/70",
224
- CANCELLED: "border-t-destructive/60"
225
- }, F = {
226
- NONE: "bg-muted text-muted-foreground",
227
- LOW: "bg-muted text-muted-foreground",
228
- MEDIUM: "bg-secondary text-secondary-foreground",
229
- HIGH: "bg-accent text-accent-foreground",
230
- CRITICAL: "bg-destructive/15 text-destructive"
231
- }, I = {
232
- TASK: "bg-secondary text-secondary-foreground",
233
- STORY: "bg-primary/10 text-primary",
234
- BUG: "bg-destructive/15 text-destructive",
235
- EPIC: "bg-accent text-accent-foreground",
236
- SUB_TASK: "bg-muted text-muted-foreground"
304
+ var De = {
305
+ BACKLOG: {
306
+ icon: A,
307
+ tone: "text-muted-foreground/60"
308
+ },
309
+ TODO: {
310
+ icon: O,
311
+ tone: "text-muted-foreground"
312
+ },
313
+ IN_PROGRESS: {
314
+ icon: j,
315
+ tone: "text-primary"
316
+ },
317
+ IN_REVIEW: {
318
+ icon: M,
319
+ tone: "text-accent-foreground"
320
+ },
321
+ TESTING: {
322
+ icon: M,
323
+ tone: "text-secondary-foreground"
324
+ },
325
+ DONE: {
326
+ icon: k,
327
+ tone: "text-primary"
328
+ },
329
+ CANCELLED: {
330
+ icon: N,
331
+ tone: "text-destructive/70"
332
+ }
237
333
  };
238
- function L({ projectId: e, columns: t = A, readonly: n, hideHeader: r, hideFilters: i, hiddenFields: a, onTaskClick: o, className: m, workspaceId: h }) {
239
- let g = x(), v = h ?? g?.workspaceId, [y, b] = c("ALL"), [S, C] = c("ALL"), w = s(() => new Set(a ?? []), [a]), { data: E, loading: D, error: O } = _(T, {
334
+ function Oe({ status: e, className: t }) {
335
+ let n = De[e] ?? De.TODO, r = n.icon;
336
+ return /* @__PURE__ */ z(r, {
337
+ className: K("h-3.5 w-3.5 shrink-0", n.tone, t),
338
+ "aria-hidden": "true"
339
+ });
340
+ }
341
+ function ke({ status: e, className: t }) {
342
+ return /* @__PURE__ */ B("span", {
343
+ className: K("inline-flex items-center gap-1.5 rounded-md border border-border bg-muted/40 px-2 py-0.5 text-xs font-medium capitalize text-foreground", t),
344
+ children: [/* @__PURE__ */ z(Oe, { status: e }), q(e)]
345
+ });
346
+ }
347
+ var Ae = {
348
+ NONE: {
349
+ level: 0,
350
+ tone: "text-muted-foreground/50"
351
+ },
352
+ LOW: {
353
+ level: 1,
354
+ tone: "text-muted-foreground"
355
+ },
356
+ MEDIUM: {
357
+ level: 2,
358
+ tone: "text-accent-foreground"
359
+ },
360
+ HIGH: {
361
+ level: 3,
362
+ tone: "text-accent-foreground"
363
+ },
364
+ CRITICAL: {
365
+ level: 3,
366
+ tone: "text-destructive"
367
+ }
368
+ }, je = [
369
+ "h-1.5",
370
+ "h-2.5",
371
+ "h-3.5"
372
+ ];
373
+ function Me({ priority: e, showLabel: t = !1, className: n }) {
374
+ let r = Ae[e] ?? Ae.NONE;
375
+ return /* @__PURE__ */ B("span", {
376
+ className: K("inline-flex items-center gap-1.5", r.tone, n),
377
+ title: `Priority: ${q(e)}`,
378
+ children: [/* @__PURE__ */ z("span", {
379
+ className: "flex items-end gap-0.5",
380
+ "aria-hidden": "true",
381
+ children: je.map((e, t) => /* @__PURE__ */ z("span", { className: K("w-1 rounded-[1px]", e, t < r.level ? "bg-current" : "bg-current/25") }, e))
382
+ }), t && /* @__PURE__ */ z("span", {
383
+ className: "text-xs font-medium capitalize",
384
+ children: q(e)
385
+ })]
386
+ });
387
+ }
388
+ var Ne = {
389
+ TASK: "secondary",
390
+ STORY: "default",
391
+ BUG: "destructive",
392
+ EPIC: "accent",
393
+ SUB_TASK: "muted"
394
+ };
395
+ function Pe({ type: e, className: t }) {
396
+ return /* @__PURE__ */ z(_e, {
397
+ variant: Ne[e],
398
+ className: t,
399
+ children: q(e)
400
+ });
401
+ }
402
+ function Fe({ open: e, onClose: t, children: n, ariaLabel: r, className: i, variant: a }) {
403
+ if (y(() => {
404
+ if (!e) return;
405
+ let n = (e) => {
406
+ e.key === "Escape" && t();
407
+ };
408
+ return document.addEventListener("keydown", n), () => document.removeEventListener("keydown", n);
409
+ }, [e, t]), !e) return null;
410
+ let o = a === "modal";
411
+ return /* @__PURE__ */ z("div", {
412
+ className: K("fixed inset-0 z-50 flex bg-foreground/40", o ? "items-center justify-center p-4" : "justify-end"),
413
+ onClick: t,
414
+ children: /* @__PURE__ */ B("div", {
415
+ role: "dialog",
416
+ "aria-modal": "true",
417
+ "aria-label": r,
418
+ className: K("relative overflow-y-auto bg-background text-foreground shadow-lg", o ? "max-h-[90vh] w-full max-w-2xl rounded-lg" : "h-full w-full max-w-lg", i),
419
+ onClick: (e) => e.stopPropagation(),
420
+ children: [/* @__PURE__ */ z("button", {
421
+ type: "button",
422
+ "aria-label": "Close",
423
+ onClick: t,
424
+ className: "absolute right-3 top-3 z-10 rounded-md bg-muted px-2 py-1 text-sm font-medium text-muted-foreground hover:bg-muted/70",
425
+ children: "✕"
426
+ }), n]
427
+ })
428
+ });
429
+ }
430
+ function Ie(e) {
431
+ return /* @__PURE__ */ z(Fe, {
432
+ variant: "modal",
433
+ ...e
434
+ });
435
+ }
436
+ function Le(e) {
437
+ return /* @__PURE__ */ z(Fe, {
438
+ variant: "drawer",
439
+ ...e
440
+ });
441
+ }
442
+ var Re = /* @__PURE__ */ new Set();
443
+ function ze({ task: e, hidden: t = Re, onClick: n, draggable: r, onDragStart: i, onDragEnd: a, dragging: o, resolveAssignee: s, className: c }) {
444
+ let l = he(e.dueDate, e.status), u = me(e.dueDate), d = e.assigneeId ? s?.(e.assigneeId) : null, f = !t.has("key") || !t.has("type"), p = !t.has("labels") && (e.labels?.length ?? 0) > 0, m = !t.has("priority"), h = !t.has("storyPoints") && e.storyPoints != null, g = m || h, _ = !t.has("assignee"), v = !t.has("dueDate") && !!u, y = _ || v, b = !!n;
445
+ return /* @__PURE__ */ B("div", {
446
+ role: b ? "button" : void 0,
447
+ tabIndex: b ? 0 : void 0,
448
+ draggable: r,
449
+ onDragStart: r ? (t) => i?.(e, t) : void 0,
450
+ onDragEnd: r ? (t) => a?.(e, t) : void 0,
451
+ onClick: n ? () => n(e) : void 0,
452
+ onKeyDown: n ? (t) => {
453
+ (t.key === "Enter" || t.key === " ") && (t.preventDefault(), n(e));
454
+ } : void 0,
455
+ className: K("group rounded-lg border border-border bg-card p-2.5 shadow-sm transition", "focus:outline-none focus-visible:ring-2 focus-visible:ring-ring", b && "cursor-pointer hover:border-primary/50 hover:shadow-md", r && "active:cursor-grabbing", o && "opacity-50 ring-2 ring-primary/40", c),
456
+ children: [
457
+ f && /* @__PURE__ */ B("div", {
458
+ className: "mb-1 flex items-center justify-between gap-2",
459
+ children: [t.has("key") ? /* @__PURE__ */ z("span", {}) : /* @__PURE__ */ z("span", {
460
+ className: "font-mono text-[10px] uppercase tracking-wide text-muted-foreground",
461
+ children: e.key
462
+ }), !t.has("type") && /* @__PURE__ */ z(Pe, { type: e.type })]
463
+ }),
464
+ /* @__PURE__ */ z("p", {
465
+ className: "line-clamp-2 text-sm font-medium leading-snug text-foreground",
466
+ children: e.title
467
+ }),
468
+ p && /* @__PURE__ */ B("div", {
469
+ className: "mt-1.5 flex flex-wrap gap-1",
470
+ children: [e.labels.slice(0, 3).map((e) => /* @__PURE__ */ z("span", {
471
+ className: "rounded bg-muted px-1.5 py-0.5 text-[10px] text-muted-foreground",
472
+ children: e
473
+ }, e)), e.labels.length > 3 && /* @__PURE__ */ B("span", {
474
+ className: "text-[10px] text-muted-foreground",
475
+ children: ["+", e.labels.length - 3]
476
+ })]
477
+ }),
478
+ g && /* @__PURE__ */ B("div", {
479
+ className: "mt-2 flex items-center justify-between",
480
+ children: [m ? /* @__PURE__ */ z(Me, {
481
+ priority: e.priority,
482
+ showLabel: !0
483
+ }) : /* @__PURE__ */ z("span", {}), h && /* @__PURE__ */ z("span", {
484
+ className: "flex h-5 min-w-5 items-center justify-center rounded-full bg-primary/10 px-1 text-[10px] font-semibold text-primary",
485
+ title: `${e.storyPoints} story points`,
486
+ children: e.storyPoints
487
+ })]
488
+ }),
489
+ y && /* @__PURE__ */ B("div", {
490
+ className: "mt-2 flex items-center justify-between gap-2",
491
+ children: [_ ? /* @__PURE__ */ B("span", {
492
+ className: "flex min-w-0 items-center gap-1.5",
493
+ children: [/* @__PURE__ */ z(Se, {
494
+ id: e.assigneeId,
495
+ name: d?.name,
496
+ size: "sm"
497
+ }), d?.name && /* @__PURE__ */ z("span", {
498
+ className: "truncate text-[11px] text-muted-foreground",
499
+ children: d.name
500
+ })]
501
+ }) : /* @__PURE__ */ z("span", {}), v && /* @__PURE__ */ B("span", {
502
+ className: K("flex shrink-0 items-center gap-1 text-[11px]", l ? "font-medium text-destructive" : "text-muted-foreground"),
503
+ title: l ? "Overdue" : "Due date",
504
+ children: [/* @__PURE__ */ z(S, {
505
+ className: "h-3 w-3",
506
+ "aria-hidden": "true"
507
+ }), u]
508
+ })]
509
+ })
510
+ ]
511
+ });
512
+ }
513
+ function Be({ projectId: e, columns: t = Ce, readonly: n, hideHeader: r, priority: i = "ALL", type: a = "ALL", search: o = "", assigneeId: s, hiddenFields: c, resolveAssignee: l, onTaskClick: u, className: d, workspaceId: f }) {
514
+ let p = G(), m = f ?? p?.workspaceId, h = ee(), g = b(() => new Set(c ?? []), [c]), [v, y] = x(null), [S, C] = x(null), [w, T] = x(null), [E] = W(de), { data: D, loading: O, error: k } = te(ce, {
240
515
  variables: {
241
- workspaceId: v,
516
+ workspaceId: m,
242
517
  ...e ? { filter: { projectId: e } } : {},
243
518
  pagination: { first: 200 }
244
519
  },
245
- skip: !v
246
- });
247
- if (!v) return /* @__PURE__ */ u("div", {
248
- className: k("p-6 text-sm text-destructive", m),
520
+ skip: !m
521
+ }), A = _((e, t) => {
522
+ let n = e.status;
523
+ if (n === t) return;
524
+ let r = h.cache.identify({
525
+ __typename: "WorkItem",
526
+ id: e.id
527
+ });
528
+ r && (T(null), h.cache.modify({
529
+ id: r,
530
+ fields: { status: () => t }
531
+ }), E({ variables: {
532
+ id: e.id,
533
+ input: { status: t }
534
+ } }).catch(() => {
535
+ h.cache.modify({
536
+ id: r,
537
+ fields: { status: () => n }
538
+ }), T("Couldn't move the task. Please try again.");
539
+ }));
540
+ }, [h, E]);
541
+ if (!m) return /* @__PURE__ */ z("div", {
542
+ className: K("p-6 text-sm text-destructive", d),
249
543
  children: "TaskBoard: no workspaceId provided (prop or PlanMagnetProvider)."
250
544
  });
251
- if (D && !E) return /* @__PURE__ */ u("div", {
252
- className: k("flex items-center justify-center p-12", m),
253
- children: /* @__PURE__ */ u("div", { className: "h-8 w-8 animate-spin rounded-full border-2 border-primary border-t-transparent" })
545
+ if (O && !D) return /* @__PURE__ */ z("div", {
546
+ className: K("flex items-center justify-center p-12", d),
547
+ children: /* @__PURE__ */ z("div", { className: "h-8 w-8 animate-spin rounded-full border-2 border-primary border-t-transparent" })
254
548
  });
255
- if (O && !E) return /* @__PURE__ */ d("div", {
256
- className: k("p-6 text-sm text-destructive", m),
257
- children: ["Error loading tasks: ", O.message]
549
+ if (k && !D) return /* @__PURE__ */ B("div", {
550
+ className: K("p-6 text-sm text-destructive", d),
551
+ children: ["Error loading tasks: ", k.message]
258
552
  });
259
- let M = E?.planmagnetWorkItems?.items ?? [], N = M.filter((e) => (y === "ALL" || e.priority === y) && (S === "ALL" || e.type === S)), L = t.length <= 4 ? "md:grid-cols-4" : t.length === 5 ? "md:grid-cols-5" : "md:grid-cols-6";
260
- return /* @__PURE__ */ d("div", {
261
- className: k("space-y-4 p-6", m),
553
+ let j = D?.planmagnetWorkItems?.items ?? [], M = o.trim().toLowerCase(), N = j.filter((e) => !(i !== "ALL" && e.priority !== i || a !== "ALL" && e.type !== a || s && e.assigneeId !== s || M && ![
554
+ e.title,
555
+ e.key,
556
+ ...e.labels ?? []
557
+ ].join(" ").toLowerCase().includes(M))), P = !n, F = (e) => (t) => {
558
+ !P || !v || (t.preventDefault(), S !== e && C(e));
559
+ }, I = (e) => (t) => {
560
+ if (!P) return;
561
+ t.preventDefault();
562
+ let n = j.find((e) => e.id === v);
563
+ C(null), y(null), n && A(n, e);
564
+ };
565
+ return /* @__PURE__ */ B("div", {
566
+ className: K("space-y-3", d),
262
567
  children: [
263
- !r && /* @__PURE__ */ u("div", {
264
- className: "flex items-center justify-between",
265
- children: /* @__PURE__ */ d("div", { children: [/* @__PURE__ */ u("h1", {
266
- className: "text-2xl font-semibold text-foreground",
267
- children: "Task Board"
268
- }), /* @__PURE__ */ d("p", {
568
+ !r && /* @__PURE__ */ B("div", {
569
+ className: "flex items-baseline justify-between",
570
+ children: [/* @__PURE__ */ z("h2", {
571
+ className: "text-lg font-semibold text-foreground",
572
+ children: "Board"
573
+ }), /* @__PURE__ */ B("span", {
269
574
  className: "text-sm text-muted-foreground",
270
575
  children: [
271
- M.length,
576
+ N.length,
272
577
  " ",
273
- M.length === 1 ? "task" : "tasks"
578
+ N.length === 1 ? "task" : "tasks"
274
579
  ]
275
- })] })
580
+ })]
276
581
  }),
277
- !i && /* @__PURE__ */ d("div", {
278
- className: "flex flex-wrap items-center gap-4",
279
- children: [
280
- /* @__PURE__ */ u(l, { className: "h-4 w-4 text-muted-foreground" }),
281
- /* @__PURE__ */ d("div", {
282
- className: "flex flex-wrap gap-1",
283
- children: [/* @__PURE__ */ u(R, {
284
- active: y === "ALL",
285
- label: "all",
286
- onClick: () => b("ALL")
287
- }), j.map((e) => /* @__PURE__ */ u(R, {
288
- active: y === e,
289
- label: e.toLowerCase(),
290
- onClick: () => b(e)
291
- }, e))]
292
- }),
293
- /* @__PURE__ */ d("div", {
294
- className: "flex flex-wrap gap-1",
295
- children: [/* @__PURE__ */ u(R, {
296
- active: S === "ALL",
297
- label: "all",
298
- onClick: () => C("ALL")
299
- }), ee.map((e) => /* @__PURE__ */ u(R, {
300
- active: S === e,
301
- label: e.toLowerCase().replace("_", " "),
302
- onClick: () => C(e)
303
- }, e))]
304
- })
305
- ]
582
+ w && /* @__PURE__ */ z("div", {
583
+ className: "rounded-md border border-destructive/40 bg-destructive/10 px-3 py-1.5 text-xs text-destructive",
584
+ children: w
306
585
  }),
307
- /* @__PURE__ */ u("div", {
308
- className: k("grid grid-cols-1 gap-3 overflow-x-auto", L),
586
+ /* @__PURE__ */ z("div", {
587
+ className: "flex gap-3 overflow-x-auto pb-2",
309
588
  children: t.map((e) => {
310
- let t = N.filter((t) => t.status === e.status);
311
- return /* @__PURE__ */ d("div", {
312
- className: "min-w-[200px]",
313
- children: [/* @__PURE__ */ u("div", {
314
- className: k("rounded-t-md border-t-2 bg-muted/50 p-2", P[e.status] ?? "border-t-muted-foreground/40"),
315
- children: /* @__PURE__ */ d("div", {
316
- className: "flex items-center justify-between",
317
- children: [/* @__PURE__ */ u("span", {
318
- className: "text-sm font-medium text-foreground",
319
- children: e.label
320
- }), /* @__PURE__ */ u("span", {
321
- className: "rounded-full bg-muted px-1.5 text-xs text-muted-foreground",
322
- children: t.length
323
- })]
324
- })
325
- }), /* @__PURE__ */ u("div", {
326
- className: "mt-2 space-y-2",
327
- children: t.map((e) => /* @__PURE__ */ u(f, {
328
- className: k("shadow-sm", o && "cursor-pointer hover:border-primary"),
329
- onClick: o ? () => o(e) : void 0,
330
- children: /* @__PURE__ */ d(p, {
331
- className: "space-y-2 p-3",
332
- children: [
333
- /* @__PURE__ */ u("p", {
334
- className: "text-sm font-medium leading-tight text-foreground",
335
- children: e.title
336
- }),
337
- !w.has("key") && /* @__PURE__ */ u("p", {
338
- className: "text-xs text-muted-foreground",
339
- children: e.key
340
- }),
341
- /* @__PURE__ */ d("div", {
342
- className: "flex flex-wrap gap-1",
343
- children: [!w.has("priority") && /* @__PURE__ */ u("span", {
344
- className: k("rounded-full px-1.5 py-0.5 text-[10px] capitalize", F[e.priority]),
345
- children: e.priority.toLowerCase()
346
- }), !w.has("type") && /* @__PURE__ */ u("span", {
347
- className: k("rounded-full px-1.5 py-0.5 text-[10px] capitalize", I[e.type]),
348
- children: e.type.toLowerCase().replace("_", " ")
349
- })]
350
- }),
351
- /* @__PURE__ */ d("div", {
352
- className: "flex items-center justify-between",
353
- children: [!w.has("labels") && /* @__PURE__ */ u("div", {
354
- className: "flex gap-1",
355
- children: (e.labels ?? []).slice(0, 2).map((e) => /* @__PURE__ */ u("span", {
356
- className: "rounded bg-muted px-1 py-0.5 text-[9px] text-muted-foreground",
357
- children: e
358
- }, e))
359
- }), !w.has("storyPoints") && /* @__PURE__ */ u("span", {
360
- className: "flex h-5 w-5 items-center justify-center rounded-full bg-primary/10 text-[10px] font-medium text-primary",
361
- children: e.storyPoints ?? 0
362
- })]
363
- }),
364
- /* @__PURE__ */ d("div", {
365
- className: "flex justify-between text-[10px] text-muted-foreground",
366
- children: [!w.has("assignee") && /* @__PURE__ */ u("span", { children: e.assigneeId ?? "Unassigned" }), !w.has("dueDate") && /* @__PURE__ */ u("span", { children: e.dueDate ?? "" })]
367
- })
368
- ]
369
- })
589
+ let t = N.filter((t) => t.status === e.status), n = S === e.status;
590
+ return /* @__PURE__ */ B("div", {
591
+ onDragOver: F(e.status),
592
+ onDragLeave: () => S === e.status && C(null),
593
+ onDrop: I(e.status),
594
+ className: K("flex w-72 shrink-0 flex-col rounded-lg border transition-colors", n ? "border-primary/50 bg-primary/5" : "border-transparent bg-muted/40"),
595
+ children: [/* @__PURE__ */ B("div", {
596
+ className: "flex items-center justify-between gap-2 px-3 py-2",
597
+ children: [/* @__PURE__ */ B("span", {
598
+ className: "flex items-center gap-2 text-sm font-medium text-foreground",
599
+ children: [/* @__PURE__ */ z(Oe, { status: e.status }), e.label]
600
+ }), /* @__PURE__ */ z("span", {
601
+ className: "rounded-full bg-muted px-1.5 text-xs font-medium text-muted-foreground",
602
+ children: t.length
603
+ })]
604
+ }), /* @__PURE__ */ z("div", {
605
+ className: "flex flex-col gap-2 px-2 pb-2",
606
+ children: t.length === 0 ? /* @__PURE__ */ z("div", {
607
+ className: "rounded-md border border-dashed border-border/70 px-3 py-6 text-center text-xs text-muted-foreground",
608
+ children: n ? "Drop here" : "No tasks"
609
+ }) : t.map((e) => /* @__PURE__ */ z(ze, {
610
+ task: e,
611
+ hidden: g,
612
+ onClick: u,
613
+ draggable: P,
614
+ dragging: v === e.id,
615
+ resolveAssignee: l,
616
+ onDragStart: (e, t) => {
617
+ y(e.id), t.dataTransfer.effectAllowed = "move", t.dataTransfer.setData("text/plain", e.id);
618
+ },
619
+ onDragEnd: () => {
620
+ y(null), C(null);
621
+ }
370
622
  }, e.id))
371
623
  })]
372
624
  }, e.status);
@@ -375,34 +627,26 @@ function L({ projectId: e, columns: t = A, readonly: n, hideHeader: r, hideFilte
375
627
  ]
376
628
  });
377
629
  }
378
- function R({ active: e, label: t, onClick: n }) {
379
- return /* @__PURE__ */ u("button", {
380
- type: "button",
381
- onClick: n,
382
- className: k("rounded px-2 py-1 text-xs capitalize", e ? "bg-primary text-primary-foreground" : "bg-muted text-muted-foreground hover:bg-muted/70"),
383
- children: t
384
- });
385
- }
386
- var z = "TASK", B = "BACKLOG", V = "NONE", H = "w-full rounded-md border border-input bg-background px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring", U = "text-sm font-medium text-foreground";
387
- function W({ projectId: e, hiddenFields: t, defaultValues: n, hideHeader: r, submitLabel: i = "Create task", onCreated: a, onError: o, onCancel: l, className: m, workspaceId: h }) {
388
- let _ = x(), v = h ?? _?.workspaceId, b = e ?? n?.projectId, S = s(() => new Set(t ?? []), [t]), [C, w] = c(n?.title ?? ""), [T, E] = c(n?.description ?? ""), [O, A] = c(n?.type ?? z), [P, F] = c(n?.status ?? B), [I, L] = c(n?.priority ?? V), [R, W] = c(n?.assigneeId ?? ""), [G, K] = c(n?.dueDate ?? ""), [q, J] = c((n?.labels ?? []).join(", ")), [Y, X] = c(n?.storyPoints == null ? "" : String(n.storyPoints)), [Z, { loading: te, error: Q }] = g(D), $ = !!(v && b && C.trim()), ne = async (e) => {
389
- if (e.preventDefault(), !$ || !b) return;
390
- let t = q.split(",").map((e) => e.trim()).filter(Boolean), n = Y.trim() ? Number(Y) : void 0, r = {
391
- projectId: b,
392
- title: C.trim(),
393
- type: O,
394
- ...S.has("status") ? {} : { status: P },
395
- ...S.has("priority") ? {} : { priority: I },
396
- ...S.has("description") || !T.trim() ? {} : { description: T.trim() },
397
- ...S.has("assignee") || !R.trim() ? {} : { assigneeId: R.trim() },
398
- ...S.has("dueDate") || !G.trim() ? {} : { dueDate: G },
399
- ...S.has("labels") || t.length === 0 ? {} : { labels: t },
400
- ...S.has("storyPoints") || n == null || Number.isNaN(n) ? {} : { storyPoints: n }
630
+ var Ve = "TASK", He = "BACKLOG", Ue = "NONE", J = "w-full rounded-md border border-input bg-background px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring", Y = "text-sm font-medium text-foreground";
631
+ function We({ projectId: e, hiddenFields: t, defaultValues: n, hideHeader: r, submitLabel: i = "Create task", onCreated: a, onError: o, onCancel: s, className: c, workspaceId: l }) {
632
+ let u = G(), d = l ?? u?.workspaceId, f = e ?? n?.projectId, p = b(() => new Set(t ?? []), [t]), [m, h] = x(n?.title ?? ""), [g, _] = x(n?.description ?? ""), [v, y] = x(n?.type ?? Ve), [S, C] = x(n?.status ?? He), [w, T] = x(n?.priority ?? Ue), [E, D] = x(n?.assigneeId ?? ""), [O, k] = x(n?.dueDate ?? ""), [A, j] = x((n?.labels ?? []).join(", ")), [M, N] = x(n?.storyPoints == null ? "" : String(n.storyPoints)), [P, { loading: F, error: I }] = W(ue), L = !!(d && f && m.trim()), R = async (e) => {
633
+ if (e.preventDefault(), !L || !f) return;
634
+ let t = A.split(",").map((e) => e.trim()).filter(Boolean), n = M.trim() ? Number(M) : void 0, r = {
635
+ projectId: f,
636
+ title: m.trim(),
637
+ type: v,
638
+ ...p.has("status") ? {} : { status: S },
639
+ ...p.has("priority") ? {} : { priority: w },
640
+ ...p.has("description") || !g.trim() ? {} : { description: g.trim() },
641
+ ...p.has("assignee") || !E.trim() ? {} : { assigneeId: E.trim() },
642
+ ...p.has("dueDate") || !O.trim() ? {} : { dueDate: O },
643
+ ...p.has("labels") || t.length === 0 ? {} : { labels: t },
644
+ ...p.has("storyPoints") || n == null || Number.isNaN(n) ? {} : { storyPoints: n }
401
645
  };
402
646
  try {
403
- let e = (await Z({ variables: { input: r } })).data?.planmagnetCreateWorkItem;
647
+ let e = (await P({ variables: { input: r } })).data?.planmagnetCreateWorkItem;
404
648
  if (e) {
405
- let t = y();
649
+ let t = re();
406
650
  try {
407
651
  await t.onTaskSaved?.({
408
652
  id: e.id,
@@ -412,294 +656,800 @@ function W({ projectId: e, hiddenFields: t, defaultValues: n, hideHeader: r, sub
412
656
  operation: "created"
413
657
  });
414
658
  } catch {}
415
- a?.(e), re();
659
+ a?.(e), U();
416
660
  }
417
661
  } catch (e) {
418
662
  o?.(e instanceof Error ? e : Error(String(e)));
419
663
  }
420
664
  };
421
- function re() {
422
- w(""), E(""), A(z), F(B), L(V), W(""), K(""), J(""), X("");
665
+ function U() {
666
+ h(""), _(""), y(Ve), C(He), T(Ue), D(""), k(""), j(""), N("");
423
667
  }
424
- return v ? /* @__PURE__ */ u(f, {
425
- className: k("shadow-sm", m),
426
- children: /* @__PURE__ */ u(p, {
668
+ return d ? /* @__PURE__ */ z(V, {
669
+ className: K("shadow-sm", c),
670
+ children: /* @__PURE__ */ z(H, {
427
671
  className: "p-6",
428
- children: /* @__PURE__ */ d("form", {
429
- onSubmit: ne,
672
+ children: /* @__PURE__ */ B("form", {
673
+ onSubmit: R,
430
674
  className: "space-y-4",
431
675
  children: [
432
- !r && /* @__PURE__ */ d("div", { children: [/* @__PURE__ */ u("h2", {
676
+ !r && /* @__PURE__ */ B("div", { children: [/* @__PURE__ */ z("h2", {
433
677
  className: "text-xl font-semibold text-foreground",
434
678
  children: "New task"
435
- }), /* @__PURE__ */ u("p", {
679
+ }), /* @__PURE__ */ z("p", {
436
680
  className: "text-sm text-muted-foreground",
437
681
  children: "Create a work item in this workspace."
438
682
  })] }),
439
- !b && /* @__PURE__ */ u("p", {
683
+ !f && /* @__PURE__ */ z("p", {
440
684
  className: "rounded-md bg-destructive/10 p-2 text-xs text-destructive",
441
685
  children: "A projectId is required to create a task."
442
686
  }),
443
- /* @__PURE__ */ d("div", {
687
+ /* @__PURE__ */ B("div", {
444
688
  className: "space-y-1",
445
- children: [/* @__PURE__ */ u("label", {
689
+ children: [/* @__PURE__ */ z("label", {
446
690
  htmlFor: "pm-title",
447
- className: U,
691
+ className: Y,
448
692
  children: "Title"
449
- }), /* @__PURE__ */ u("input", {
693
+ }), /* @__PURE__ */ z("input", {
450
694
  id: "pm-title",
451
- className: H,
452
- value: C,
453
- onChange: (e) => w(e.target.value),
695
+ className: J,
696
+ value: m,
697
+ onChange: (e) => h(e.target.value),
454
698
  placeholder: "What needs doing?",
455
699
  required: !0
456
700
  })]
457
701
  }),
458
- !S.has("description") && /* @__PURE__ */ d("div", {
702
+ !p.has("description") && /* @__PURE__ */ B("div", {
459
703
  className: "space-y-1",
460
- children: [/* @__PURE__ */ u("label", {
704
+ children: [/* @__PURE__ */ z("label", {
461
705
  htmlFor: "pm-description",
462
- className: U,
706
+ className: Y,
463
707
  children: "Description"
464
- }), /* @__PURE__ */ u("textarea", {
708
+ }), /* @__PURE__ */ z("textarea", {
465
709
  id: "pm-description",
466
- className: k(H, "min-h-[80px]"),
467
- value: T,
468
- onChange: (e) => E(e.target.value),
710
+ className: K(J, "min-h-[80px]"),
711
+ value: g,
712
+ onChange: (e) => _(e.target.value),
469
713
  placeholder: "Add more detail (optional)"
470
714
  })]
471
715
  }),
472
- /* @__PURE__ */ d("div", {
716
+ /* @__PURE__ */ B("div", {
473
717
  className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
474
718
  children: [
475
- !S.has("type") && /* @__PURE__ */ d("div", {
719
+ !p.has("type") && /* @__PURE__ */ B("div", {
476
720
  className: "space-y-1",
477
- children: [/* @__PURE__ */ u("label", {
721
+ children: [/* @__PURE__ */ z("label", {
478
722
  htmlFor: "pm-type",
479
- className: U,
723
+ className: Y,
480
724
  children: "Type"
481
- }), /* @__PURE__ */ u("select", {
725
+ }), /* @__PURE__ */ z("select", {
482
726
  id: "pm-type",
483
- className: k(H, "capitalize"),
484
- value: O,
485
- onChange: (e) => A(e.target.value),
486
- children: ee.map((e) => /* @__PURE__ */ u("option", {
727
+ className: K(J, "capitalize"),
728
+ value: v,
729
+ onChange: (e) => y(e.target.value),
730
+ children: Te.map((e) => /* @__PURE__ */ z("option", {
487
731
  value: e,
488
- children: N(e)
732
+ children: q(e)
489
733
  }, e))
490
734
  })]
491
735
  }),
492
- !S.has("status") && /* @__PURE__ */ d("div", {
736
+ !p.has("status") && /* @__PURE__ */ B("div", {
493
737
  className: "space-y-1",
494
- children: [/* @__PURE__ */ u("label", {
738
+ children: [/* @__PURE__ */ z("label", {
495
739
  htmlFor: "pm-status",
496
- className: U,
740
+ className: Y,
497
741
  children: "Status"
498
- }), /* @__PURE__ */ u("select", {
742
+ }), /* @__PURE__ */ z("select", {
499
743
  id: "pm-status",
500
- className: k(H, "capitalize"),
501
- value: P,
502
- onChange: (e) => F(e.target.value),
503
- children: M.map((e) => /* @__PURE__ */ u("option", {
744
+ className: K(J, "capitalize"),
745
+ value: S,
746
+ onChange: (e) => C(e.target.value),
747
+ children: Ee.map((e) => /* @__PURE__ */ z("option", {
504
748
  value: e,
505
- children: N(e)
749
+ children: q(e)
506
750
  }, e))
507
751
  })]
508
752
  }),
509
- !S.has("priority") && /* @__PURE__ */ d("div", {
753
+ !p.has("priority") && /* @__PURE__ */ B("div", {
510
754
  className: "space-y-1",
511
- children: [/* @__PURE__ */ u("label", {
755
+ children: [/* @__PURE__ */ z("label", {
512
756
  htmlFor: "pm-priority",
513
- className: U,
757
+ className: Y,
514
758
  children: "Priority"
515
- }), /* @__PURE__ */ u("select", {
759
+ }), /* @__PURE__ */ z("select", {
516
760
  id: "pm-priority",
517
- className: k(H, "capitalize"),
518
- value: I,
519
- onChange: (e) => L(e.target.value),
520
- children: j.map((e) => /* @__PURE__ */ u("option", {
761
+ className: K(J, "capitalize"),
762
+ value: w,
763
+ onChange: (e) => T(e.target.value),
764
+ children: we.map((e) => /* @__PURE__ */ z("option", {
521
765
  value: e,
522
- children: N(e)
766
+ children: q(e)
523
767
  }, e))
524
768
  })]
525
769
  }),
526
- !S.has("assignee") && /* @__PURE__ */ d("div", {
770
+ !p.has("assignee") && /* @__PURE__ */ B("div", {
527
771
  className: "space-y-1",
528
- children: [/* @__PURE__ */ u("label", {
772
+ children: [/* @__PURE__ */ z("label", {
529
773
  htmlFor: "pm-assignee",
530
- className: U,
774
+ className: Y,
531
775
  children: "Assignee"
532
- }), /* @__PURE__ */ u("input", {
776
+ }), /* @__PURE__ */ z("input", {
533
777
  id: "pm-assignee",
534
- className: H,
535
- value: R,
536
- onChange: (e) => W(e.target.value),
778
+ className: J,
779
+ value: E,
780
+ onChange: (e) => D(e.target.value),
537
781
  placeholder: "Actor ID (optional)"
538
782
  })]
539
783
  }),
540
- !S.has("dueDate") && /* @__PURE__ */ d("div", {
784
+ !p.has("dueDate") && /* @__PURE__ */ B("div", {
541
785
  className: "space-y-1",
542
- children: [/* @__PURE__ */ u("label", {
786
+ children: [/* @__PURE__ */ z("label", {
543
787
  htmlFor: "pm-due",
544
- className: U,
788
+ className: Y,
545
789
  children: "Due date"
546
- }), /* @__PURE__ */ u("input", {
790
+ }), /* @__PURE__ */ z("input", {
547
791
  id: "pm-due",
548
792
  type: "date",
549
- className: H,
550
- value: G,
551
- onChange: (e) => K(e.target.value)
793
+ className: J,
794
+ value: O,
795
+ onChange: (e) => k(e.target.value)
552
796
  })]
553
797
  }),
554
- !S.has("storyPoints") && /* @__PURE__ */ d("div", {
798
+ !p.has("storyPoints") && /* @__PURE__ */ B("div", {
555
799
  className: "space-y-1",
556
- children: [/* @__PURE__ */ u("label", {
800
+ children: [/* @__PURE__ */ z("label", {
557
801
  htmlFor: "pm-points",
558
- className: U,
802
+ className: Y,
559
803
  children: "Story points"
560
- }), /* @__PURE__ */ u("input", {
804
+ }), /* @__PURE__ */ z("input", {
561
805
  id: "pm-points",
562
806
  type: "number",
563
807
  min: 0,
564
- className: H,
565
- value: Y,
566
- onChange: (e) => X(e.target.value),
808
+ className: J,
809
+ value: M,
810
+ onChange: (e) => N(e.target.value),
567
811
  placeholder: "0"
568
812
  })]
569
813
  })
570
814
  ]
571
815
  }),
572
- !S.has("labels") && /* @__PURE__ */ d("div", {
816
+ !p.has("labels") && /* @__PURE__ */ B("div", {
573
817
  className: "space-y-1",
574
- children: [/* @__PURE__ */ u("label", {
818
+ children: [/* @__PURE__ */ z("label", {
575
819
  htmlFor: "pm-labels",
576
- className: U,
820
+ className: Y,
577
821
  children: "Labels"
578
- }), /* @__PURE__ */ u("input", {
822
+ }), /* @__PURE__ */ z("input", {
579
823
  id: "pm-labels",
580
- className: H,
581
- value: q,
582
- onChange: (e) => J(e.target.value),
824
+ className: J,
825
+ value: A,
826
+ onChange: (e) => j(e.target.value),
583
827
  placeholder: "comma, separated, labels"
584
828
  })]
585
829
  }),
586
- Q && /* @__PURE__ */ d("p", {
830
+ I && /* @__PURE__ */ B("p", {
587
831
  className: "text-sm text-destructive",
588
- children: ["Failed to create task: ", Q.message]
832
+ children: ["Failed to create task: ", I.message]
589
833
  }),
590
- /* @__PURE__ */ d("div", {
834
+ /* @__PURE__ */ B("div", {
591
835
  className: "flex items-center justify-end gap-2",
592
- children: [l && /* @__PURE__ */ u("button", {
836
+ children: [s && /* @__PURE__ */ z("button", {
593
837
  type: "button",
594
- onClick: l,
838
+ onClick: s,
595
839
  className: "rounded-md bg-muted px-4 py-2 text-sm font-medium text-muted-foreground hover:bg-muted/70",
596
840
  children: "Cancel"
597
- }), /* @__PURE__ */ u("button", {
841
+ }), /* @__PURE__ */ z("button", {
598
842
  type: "submit",
599
- disabled: !$ || te,
600
- className: k("rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground", (!$ || te) && "cursor-not-allowed opacity-50"),
601
- children: te ? "Creating…" : i
843
+ disabled: !L || F,
844
+ className: K("rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground", (!L || F) && "cursor-not-allowed opacity-50"),
845
+ children: F ? "Creating…" : i
602
846
  })]
603
847
  })
604
848
  ]
605
849
  })
606
850
  })
607
- }) : /* @__PURE__ */ u("div", {
608
- className: k("p-6 text-sm text-destructive", m),
851
+ }) : /* @__PURE__ */ z("div", {
852
+ className: K("p-6 text-sm text-destructive", c),
609
853
  children: "CreateTask: no workspaceId provided (prop or PlanMagnetProvider)."
610
854
  });
611
855
  }
612
- var G = n("inline-flex items-center rounded-full px-2 py-0.5 text-[10px] font-medium capitalize transition-colors", {
613
- variants: { variant: {
614
- default: "bg-primary/10 text-primary",
615
- muted: "bg-muted text-muted-foreground",
616
- secondary: "bg-secondary text-secondary-foreground",
617
- accent: "bg-accent text-accent-foreground",
618
- destructive: "bg-destructive/15 text-destructive"
619
- } },
620
- defaultVariants: { variant: "default" }
621
- });
622
- function K({ className: e, variant: t, ...n }) {
623
- return /* @__PURE__ */ u("span", {
624
- className: k(G({ variant: t }), e),
625
- ...n
856
+ var Ge = [
857
+ "title",
858
+ "status",
859
+ "priority",
860
+ "assignee",
861
+ "dueDate",
862
+ "storyPoints"
863
+ ], Ke = {
864
+ CRITICAL: 0,
865
+ HIGH: 1,
866
+ MEDIUM: 2,
867
+ LOW: 3,
868
+ NONE: 4
869
+ }, qe = {
870
+ BACKLOG: 0,
871
+ TODO: 1,
872
+ IN_PROGRESS: 2,
873
+ IN_REVIEW: 3,
874
+ TESTING: 4,
875
+ DONE: 5,
876
+ CANCELLED: 6
877
+ }, Je = {
878
+ key: "Key",
879
+ title: "Task",
880
+ type: "Type",
881
+ status: "Status",
882
+ priority: "Priority",
883
+ assignee: "Assignee",
884
+ dueDate: "Due Date",
885
+ storyPoints: "Points",
886
+ labels: "Labels"
887
+ }, Ye = {
888
+ title: "title",
889
+ type: "type",
890
+ status: "status",
891
+ priority: "priority",
892
+ dueDate: "dueDate",
893
+ storyPoints: "storyPoints"
894
+ };
895
+ function Xe({ projectId: e, status: t, type: n, priority: r, assigneeId: i, search: a, columns: o = Ge, sortBy: s, sortDir: c = "asc", hideHeader: l, onSelect: u, resolveAssignee: d, limit: f = 200, className: p, workspaceId: m }) {
896
+ let h = G(), g = m ?? h?.workspaceId, [_, v] = x({
897
+ by: s ?? null,
898
+ dir: c
899
+ }), y = b(() => {
900
+ let o = {};
901
+ return e && (o.projectId = e), t && (o.status = t), n && (o.type = n), r && (o.priority = r), i && (o.assigneeId = i), a && (o.search = a), o;
902
+ }, [
903
+ e,
904
+ t,
905
+ n,
906
+ r,
907
+ i,
908
+ a
909
+ ]), { data: S, loading: C, error: T } = te(ce, {
910
+ variables: {
911
+ workspaceId: g,
912
+ ...Object.keys(y).length ? { filter: y } : {},
913
+ pagination: { first: f }
914
+ },
915
+ skip: !g
916
+ }), E = b(() => {
917
+ let e = S?.planmagnetWorkItems?.items ?? [];
918
+ if (!_.by) return e;
919
+ let t = _.dir === "desc" ? -1 : 1, n = _.by;
920
+ return [...e].sort((e, r) => t * Qe(e, r, n));
921
+ }, [S, _]), O = (e) => {
922
+ let t = Ye[e];
923
+ t && v((e) => e.by === t ? {
924
+ by: t,
925
+ dir: e.dir === "asc" ? "desc" : "asc"
926
+ } : {
927
+ by: t,
928
+ dir: "asc"
929
+ });
930
+ };
931
+ return g ? C && !S ? /* @__PURE__ */ z("div", {
932
+ className: K("flex items-center justify-center p-12", p),
933
+ children: /* @__PURE__ */ z("div", { className: "h-8 w-8 animate-spin rounded-full border-2 border-primary border-t-transparent" })
934
+ }) : T && !S ? /* @__PURE__ */ B("div", {
935
+ className: K("p-6 text-sm text-destructive", p),
936
+ children: ["Error loading tasks: ", T.message]
937
+ }) : /* @__PURE__ */ B("div", {
938
+ className: K("space-y-3", p),
939
+ children: [!l && /* @__PURE__ */ B("div", {
940
+ className: "flex items-baseline justify-between",
941
+ children: [/* @__PURE__ */ z("h2", {
942
+ className: "text-lg font-semibold text-foreground",
943
+ children: "List"
944
+ }), /* @__PURE__ */ B("span", {
945
+ className: "text-sm text-muted-foreground",
946
+ children: [
947
+ E.length,
948
+ " ",
949
+ E.length === 1 ? "task" : "tasks"
950
+ ]
951
+ })]
952
+ }), /* @__PURE__ */ z("div", {
953
+ className: "overflow-x-auto rounded-lg border border-border",
954
+ children: /* @__PURE__ */ B("table", {
955
+ className: "w-full border-collapse text-sm",
956
+ children: [/* @__PURE__ */ z("thead", { children: /* @__PURE__ */ z("tr", {
957
+ className: "border-b border-border bg-muted/50 text-left",
958
+ children: o.map((e) => {
959
+ let t = !!Ye[e], n = _.by === Ye[e];
960
+ return /* @__PURE__ */ z("th", {
961
+ onClick: t ? () => O(e) : void 0,
962
+ className: K("px-3 py-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground", t && "cursor-pointer select-none hover:text-foreground"),
963
+ children: /* @__PURE__ */ B("span", {
964
+ className: "inline-flex items-center gap-1",
965
+ children: [Je[e], n && (_.dir === "asc" ? /* @__PURE__ */ z(D, {
966
+ className: "h-3 w-3",
967
+ "aria-hidden": "true"
968
+ }) : /* @__PURE__ */ z(w, {
969
+ className: "h-3 w-3",
970
+ "aria-hidden": "true"
971
+ }))]
972
+ })
973
+ }, e);
974
+ })
975
+ }) }), /* @__PURE__ */ B("tbody", { children: [E.length === 0 && /* @__PURE__ */ z("tr", { children: /* @__PURE__ */ z("td", {
976
+ colSpan: o.length,
977
+ className: "px-3 py-8 text-center text-muted-foreground",
978
+ children: "No tasks found."
979
+ }) }), E.map((e) => /* @__PURE__ */ z("tr", {
980
+ onClick: u ? () => u(e.id) : void 0,
981
+ className: K("border-b border-border last:border-0", u && "cursor-pointer hover:bg-muted/40"),
982
+ children: o.map((t) => /* @__PURE__ */ z("td", {
983
+ className: "px-3 py-2 align-middle text-foreground",
984
+ children: Ze(t, e, d)
985
+ }, t))
986
+ }, e.id))] })]
987
+ })
988
+ })]
989
+ }) : /* @__PURE__ */ z("div", {
990
+ className: K("p-6 text-sm text-destructive", p),
991
+ children: "TaskList: no workspaceId provided (prop or PlanMagnetProvider)."
626
992
  });
627
993
  }
628
- function q({ open: e, onClose: t, children: n, ariaLabel: r, className: i, variant: a }) {
629
- if (o(() => {
630
- if (!e) return;
631
- let n = (e) => {
632
- e.key === "Escape" && t();
994
+ function Ze(e, t, n) {
995
+ switch (e) {
996
+ case "key": return /* @__PURE__ */ z("span", {
997
+ className: "font-mono text-xs text-muted-foreground",
998
+ children: t.key
999
+ });
1000
+ case "title": return /* @__PURE__ */ B("div", {
1001
+ className: "flex flex-col",
1002
+ children: [/* @__PURE__ */ z("span", {
1003
+ className: "font-medium text-foreground",
1004
+ children: t.title
1005
+ }), /* @__PURE__ */ z("span", {
1006
+ className: "font-mono text-[10px] uppercase text-muted-foreground",
1007
+ children: t.key
1008
+ })]
1009
+ });
1010
+ case "type": return /* @__PURE__ */ z(Pe, { type: t.type });
1011
+ case "status": return /* @__PURE__ */ z(ke, { status: t.status });
1012
+ case "priority": return /* @__PURE__ */ z(Me, {
1013
+ priority: t.priority,
1014
+ showLabel: !0
1015
+ });
1016
+ case "assignee": {
1017
+ let e = t.assigneeId ? n?.(t.assigneeId) : null;
1018
+ return /* @__PURE__ */ B("span", {
1019
+ className: "flex items-center gap-1.5",
1020
+ children: [/* @__PURE__ */ z(Se, {
1021
+ id: t.assigneeId,
1022
+ name: e?.name,
1023
+ size: "sm"
1024
+ }), /* @__PURE__ */ z("span", {
1025
+ className: "text-xs text-muted-foreground",
1026
+ children: e?.name ?? (t.assigneeId ? "" : "Unassigned")
1027
+ })]
1028
+ });
1029
+ }
1030
+ case "dueDate": {
1031
+ let e = me(t.dueDate);
1032
+ return e ? /* @__PURE__ */ z("span", {
1033
+ className: K("text-xs", he(t.dueDate, t.status) ? "font-medium text-destructive" : "text-muted-foreground"),
1034
+ children: e
1035
+ }) : /* @__PURE__ */ z("span", {
1036
+ className: "text-muted-foreground",
1037
+ children: "—"
1038
+ });
1039
+ }
1040
+ case "storyPoints": return t.storyPoints == null ? /* @__PURE__ */ z("span", {
1041
+ className: "text-muted-foreground",
1042
+ children: "—"
1043
+ }) : /* @__PURE__ */ z("span", {
1044
+ className: "flex h-5 min-w-5 items-center justify-center rounded-full bg-primary/10 px-1 text-[10px] font-semibold text-primary",
1045
+ children: t.storyPoints
1046
+ });
1047
+ case "labels": return /* @__PURE__ */ z("div", {
1048
+ className: "flex flex-wrap gap-1",
1049
+ children: (t.labels ?? []).slice(0, 3).map((e) => /* @__PURE__ */ z("span", {
1050
+ className: "rounded bg-muted px-1.5 py-0.5 text-[10px] text-muted-foreground",
1051
+ children: e
1052
+ }, e))
1053
+ });
1054
+ default: return null;
1055
+ }
1056
+ }
1057
+ function Qe(e, t, n) {
1058
+ switch (n) {
1059
+ case "priority": return Ke[e.priority] - Ke[t.priority];
1060
+ case "status": return qe[e.status] - qe[t.status];
1061
+ case "title": return e.title.localeCompare(t.title);
1062
+ case "type": return e.type.localeCompare(t.type);
1063
+ case "dueDate": return (e.dueDate ?? "").localeCompare(t.dueDate ?? "");
1064
+ case "storyPoints": return (e.storyPoints ?? 0) - (t.storyPoints ?? 0);
1065
+ default: return 0;
1066
+ }
1067
+ }
1068
+ var $e = { weekStartsOn: 1 };
1069
+ function X(e) {
1070
+ return d(e, "yyyy-MM-dd");
1071
+ }
1072
+ function et({ projectId: e, priority: t = "ALL", type: i = "ALL", search: o = "", assigneeId: m, defaultMode: h = "week", onSelect: g, resolveAssignee: _, className: v, workspaceId: y }) {
1073
+ let S = G(), C = y ?? S?.workspaceId, [w, D] = x(h), [O, k] = x(0), { data: A, loading: j, error: M } = te(ce, {
1074
+ variables: {
1075
+ workspaceId: C,
1076
+ ...e ? { filter: { projectId: e } } : {},
1077
+ pagination: { first: 200 }
1078
+ },
1079
+ skip: !C
1080
+ }), N = b(() => {
1081
+ let e = A?.planmagnetWorkItems?.items ?? [], n = o.trim().toLowerCase();
1082
+ return e.filter((e) => !(t !== "ALL" && e.priority !== t || i !== "ALL" && e.type !== i || m && e.assigneeId !== m || n && ![
1083
+ e.title,
1084
+ e.key,
1085
+ ...e.labels ?? []
1086
+ ].join(" ").toLowerCase().includes(n)));
1087
+ }, [
1088
+ A,
1089
+ t,
1090
+ i,
1091
+ o,
1092
+ m
1093
+ ]), { anchor: P, rangeStart: F, rangeEnd: I, days: L } = b(() => {
1094
+ let e = /* @__PURE__ */ new Date();
1095
+ if (w === "week") {
1096
+ let t = a(e, O), n = r(t, $e), i = u(t, $e);
1097
+ return {
1098
+ anchor: t,
1099
+ rangeStart: n,
1100
+ rangeEnd: i,
1101
+ days: c({
1102
+ start: n,
1103
+ end: i
1104
+ })
1105
+ };
1106
+ }
1107
+ let t = n(e, O), i = r(l(t), $e), o = u(s(t), $e);
1108
+ return {
1109
+ anchor: t,
1110
+ rangeStart: i,
1111
+ rangeEnd: o,
1112
+ days: c({
1113
+ start: i,
1114
+ end: o
1115
+ })
633
1116
  };
634
- return document.addEventListener("keydown", n), () => document.removeEventListener("keydown", n);
635
- }, [e, t]), !e) return null;
636
- let s = a === "modal";
637
- return /* @__PURE__ */ u("div", {
638
- className: k("fixed inset-0 z-50 flex bg-foreground/40", s ? "items-center justify-center p-4" : "justify-end"),
639
- onClick: t,
640
- children: /* @__PURE__ */ d("div", {
641
- role: "dialog",
642
- "aria-modal": "true",
643
- "aria-label": r,
644
- className: k("relative overflow-y-auto bg-background text-foreground shadow-lg", s ? "max-h-[90vh] w-full max-w-2xl rounded-lg" : "h-full w-full max-w-lg", i),
645
- onClick: (e) => e.stopPropagation(),
646
- children: [/* @__PURE__ */ u("button", {
647
- type: "button",
648
- "aria-label": "Close",
649
- onClick: t,
650
- className: "absolute right-3 top-3 z-10 rounded-md bg-muted px-2 py-1 text-sm font-medium text-muted-foreground hover:bg-muted/70",
651
- children: "✕"
652
- }), n]
653
- })
1117
+ }, [w, O]), { byDay: R, overdue: V, undated: H } = b(() => {
1118
+ let e = /* @__PURE__ */ new Map(), t = [], n = [];
1119
+ for (let r of N) {
1120
+ let i = pe(r.dueDate);
1121
+ if (!i) {
1122
+ n.push(r);
1123
+ continue;
1124
+ }
1125
+ if (he(r.dueDate, r.status)) {
1126
+ t.push(r);
1127
+ continue;
1128
+ }
1129
+ let a = X(i), o = e.get(a);
1130
+ o ? o.push(r) : e.set(a, [r]);
1131
+ }
1132
+ return {
1133
+ byDay: e,
1134
+ overdue: t,
1135
+ undated: n
1136
+ };
1137
+ }, [N]);
1138
+ if (!C) return /* @__PURE__ */ z("div", {
1139
+ className: K("p-6 text-sm text-destructive", v),
1140
+ children: "Timeline: no workspaceId provided (prop or PlanMagnetProvider)."
1141
+ });
1142
+ if (j && !A) return /* @__PURE__ */ z("div", {
1143
+ className: K("flex items-center justify-center p-12", v),
1144
+ children: /* @__PURE__ */ z("div", { className: "h-8 w-8 animate-spin rounded-full border-2 border-primary border-t-transparent" })
1145
+ });
1146
+ if (M && !A) return /* @__PURE__ */ B("div", {
1147
+ className: K("p-6 text-sm text-destructive", v),
1148
+ children: ["Error loading timeline: ", M.message]
1149
+ });
1150
+ let U = w === "week" ? `${d(F, "MMM d")} \u2013 ${d(I, "MMM d")}` : d(P, "MMMM yyyy");
1151
+ return /* @__PURE__ */ B("div", {
1152
+ className: K("space-y-3", v),
1153
+ children: [
1154
+ /* @__PURE__ */ B("div", {
1155
+ className: "flex flex-wrap items-center justify-between gap-2",
1156
+ children: [/* @__PURE__ */ B("div", {
1157
+ className: "flex items-center gap-1",
1158
+ children: [
1159
+ /* @__PURE__ */ z("button", {
1160
+ type: "button",
1161
+ onClick: () => k((e) => e - 1),
1162
+ "aria-label": "Previous",
1163
+ className: "flex h-8 w-8 items-center justify-center rounded-md border border-border text-muted-foreground hover:bg-muted/50",
1164
+ children: /* @__PURE__ */ z(T, { className: "h-4 w-4" })
1165
+ }),
1166
+ /* @__PURE__ */ z("button", {
1167
+ type: "button",
1168
+ onClick: () => k(0),
1169
+ className: "h-8 rounded-md border border-border px-3 text-xs font-medium text-foreground hover:bg-muted/50",
1170
+ children: "Today"
1171
+ }),
1172
+ /* @__PURE__ */ z("button", {
1173
+ type: "button",
1174
+ onClick: () => k((e) => e + 1),
1175
+ "aria-label": "Next",
1176
+ className: "flex h-8 w-8 items-center justify-center rounded-md border border-border text-muted-foreground hover:bg-muted/50",
1177
+ children: /* @__PURE__ */ z(E, { className: "h-4 w-4" })
1178
+ }),
1179
+ /* @__PURE__ */ z("span", {
1180
+ className: "ml-2 text-sm font-medium text-foreground",
1181
+ children: U
1182
+ })
1183
+ ]
1184
+ }), /* @__PURE__ */ z("div", {
1185
+ className: "inline-flex rounded-md border border-border p-0.5",
1186
+ children: ["week", "month"].map((e) => /* @__PURE__ */ z("button", {
1187
+ type: "button",
1188
+ onClick: () => {
1189
+ D(e), k(0);
1190
+ },
1191
+ className: K("rounded px-3 py-1 text-xs font-medium capitalize transition-colors", w === e ? "bg-primary text-primary-foreground" : "text-muted-foreground hover:text-foreground"),
1192
+ children: e
1193
+ }, e))
1194
+ })]
1195
+ }),
1196
+ V.length > 0 && /* @__PURE__ */ B("div", {
1197
+ className: "rounded-md border border-destructive/40 bg-destructive/10 px-3 py-2",
1198
+ children: [/* @__PURE__ */ B("p", {
1199
+ className: "mb-1 text-xs font-semibold text-destructive",
1200
+ children: [V.length, " overdue"]
1201
+ }), /* @__PURE__ */ z("div", {
1202
+ className: "flex flex-wrap gap-1.5",
1203
+ children: V.map((e) => /* @__PURE__ */ z(tt, {
1204
+ task: e,
1205
+ onSelect: g,
1206
+ resolveAssignee: _,
1207
+ tone: "destructive"
1208
+ }, e.id))
1209
+ })]
1210
+ }),
1211
+ w === "week" ? /* @__PURE__ */ z("div", {
1212
+ className: "grid grid-cols-7 gap-2",
1213
+ children: L.map((e) => {
1214
+ let t = R.get(X(e)) ?? [], n = p(e);
1215
+ return /* @__PURE__ */ B("div", {
1216
+ className: K("flex min-h-32 flex-col rounded-lg border p-2", n ? "border-primary/50 bg-primary/5" : "border-border bg-muted/20"),
1217
+ children: [/* @__PURE__ */ B("div", {
1218
+ className: "mb-2 flex items-baseline justify-between",
1219
+ children: [/* @__PURE__ */ z("span", {
1220
+ className: K("text-xs font-semibold uppercase", n ? "text-primary" : "text-muted-foreground"),
1221
+ children: d(e, "EEE")
1222
+ }), /* @__PURE__ */ z("span", {
1223
+ className: K("text-sm font-semibold", n ? "text-primary" : "text-foreground"),
1224
+ children: d(e, "d")
1225
+ })]
1226
+ }), /* @__PURE__ */ z("div", {
1227
+ className: "flex flex-col gap-1.5",
1228
+ children: t.map((e) => /* @__PURE__ */ z(tt, {
1229
+ task: e,
1230
+ onSelect: g,
1231
+ resolveAssignee: _
1232
+ }, e.id))
1233
+ })]
1234
+ }, X(e));
1235
+ })
1236
+ }) : /* @__PURE__ */ B("div", {
1237
+ className: "grid grid-cols-7 gap-1",
1238
+ children: [[
1239
+ "Mon",
1240
+ "Tue",
1241
+ "Wed",
1242
+ "Thu",
1243
+ "Fri",
1244
+ "Sat",
1245
+ "Sun"
1246
+ ].map((e) => /* @__PURE__ */ z("div", {
1247
+ className: "px-1 pb-1 text-center text-[10px] font-semibold uppercase text-muted-foreground",
1248
+ children: e
1249
+ }, e)), L.map((e) => {
1250
+ let t = R.get(X(e)) ?? [], n = p(e), r = f(e, P);
1251
+ return /* @__PURE__ */ B("div", {
1252
+ className: K("flex min-h-20 flex-col gap-1 rounded-md border p-1", n ? "border-primary/50 bg-primary/5" : "border-border/60 bg-muted/10", !r && "opacity-40"),
1253
+ children: [
1254
+ /* @__PURE__ */ z("span", {
1255
+ className: K("text-[10px] font-semibold", n ? "text-primary" : "text-muted-foreground"),
1256
+ children: d(e, "d")
1257
+ }),
1258
+ t.slice(0, 3).map((e) => /* @__PURE__ */ z(tt, {
1259
+ task: e,
1260
+ onSelect: g,
1261
+ resolveAssignee: _,
1262
+ compact: !0
1263
+ }, e.id)),
1264
+ t.length > 3 && /* @__PURE__ */ B("span", {
1265
+ className: "text-[10px] text-muted-foreground",
1266
+ children: [
1267
+ "+",
1268
+ t.length - 3,
1269
+ " more"
1270
+ ]
1271
+ })
1272
+ ]
1273
+ }, X(e));
1274
+ })]
1275
+ }),
1276
+ H.length > 0 && /* @__PURE__ */ B("div", {
1277
+ className: "rounded-md border border-border bg-muted/20 px-3 py-2",
1278
+ children: [/* @__PURE__ */ B("p", {
1279
+ className: "mb-1 text-xs font-semibold text-muted-foreground",
1280
+ children: [
1281
+ "No due date (",
1282
+ H.length,
1283
+ ")"
1284
+ ]
1285
+ }), /* @__PURE__ */ z("div", {
1286
+ className: "flex flex-wrap gap-1.5",
1287
+ children: H.map((e) => /* @__PURE__ */ z(tt, {
1288
+ task: e,
1289
+ onSelect: g,
1290
+ resolveAssignee: _
1291
+ }, e.id))
1292
+ })]
1293
+ })
1294
+ ]
654
1295
  });
655
1296
  }
656
- function J(e) {
657
- return /* @__PURE__ */ u(q, {
658
- variant: "modal",
659
- ...e
1297
+ function tt({ task: e, onSelect: t, resolveAssignee: n, tone: r, compact: i }) {
1298
+ let a = e.assigneeId ? n?.(e.assigneeId) : null, o = !!t;
1299
+ return /* @__PURE__ */ B("button", {
1300
+ type: "button",
1301
+ disabled: !o,
1302
+ onClick: o ? () => t?.(e.id) : void 0,
1303
+ title: e.title,
1304
+ className: K("flex w-full items-center gap-1.5 rounded-md border px-1.5 py-1 text-left transition-colors", r === "destructive" ? "border-destructive/40 bg-card hover:bg-destructive/5" : "border-border bg-card hover:border-primary/50", o ? "cursor-pointer" : "cursor-default"),
1305
+ children: [
1306
+ /* @__PURE__ */ z(Me, { priority: e.priority }),
1307
+ /* @__PURE__ */ z("span", {
1308
+ className: "min-w-0 flex-1 truncate text-[11px] font-medium text-foreground",
1309
+ children: e.title
1310
+ }),
1311
+ !i && /* @__PURE__ */ z(Se, {
1312
+ id: e.assigneeId,
1313
+ name: a?.name,
1314
+ size: "sm"
1315
+ })
1316
+ ]
660
1317
  });
661
1318
  }
662
- function Y(e) {
663
- return /* @__PURE__ */ u(q, {
664
- variant: "drawer",
665
- ...e
1319
+ var nt = {
1320
+ board: {
1321
+ label: "Board",
1322
+ icon: P
1323
+ },
1324
+ list: {
1325
+ label: "List",
1326
+ icon: F
1327
+ },
1328
+ timeline: {
1329
+ label: "Timeline",
1330
+ icon: C
1331
+ }
1332
+ }, rt = "h-8 rounded-md border border-border bg-background px-2 text-xs font-medium text-foreground capitalize transition-colors hover:bg-muted/50 focus:outline-none focus-visible:ring-2 focus-visible:ring-ring";
1333
+ function it({ view: e, onViewChange: t, views: n = [
1334
+ "board",
1335
+ "list",
1336
+ "timeline"
1337
+ ], search: r, onSearchChange: i, priority: a, onPriorityChange: o, type: s, onTypeChange: c, onNewTask: l, canCreate: u, className: d }) {
1338
+ return /* @__PURE__ */ B("div", {
1339
+ className: K("flex flex-wrap items-center justify-between gap-3 border-b border-border pb-2", d),
1340
+ children: [/* @__PURE__ */ z("div", {
1341
+ className: "flex items-center gap-1",
1342
+ role: "tablist",
1343
+ "aria-label": "Task views",
1344
+ children: n.map((n) => {
1345
+ let r = nt[n], i = r.icon, a = n === e;
1346
+ return /* @__PURE__ */ B("button", {
1347
+ type: "button",
1348
+ role: "tab",
1349
+ "aria-selected": a,
1350
+ onClick: () => t(n),
1351
+ className: K("relative flex items-center gap-1.5 rounded-t-md px-2.5 py-1.5 text-sm font-medium transition-colors", a ? "text-foreground" : "text-muted-foreground hover:text-foreground"),
1352
+ children: [
1353
+ /* @__PURE__ */ z(i, {
1354
+ className: "h-4 w-4",
1355
+ "aria-hidden": "true"
1356
+ }),
1357
+ r.label,
1358
+ a && /* @__PURE__ */ z("span", { className: "absolute inset-x-1 -bottom-[9px] h-0.5 rounded-full bg-primary" })
1359
+ ]
1360
+ }, n);
1361
+ })
1362
+ }), /* @__PURE__ */ B("div", {
1363
+ className: "flex flex-wrap items-center gap-2",
1364
+ children: [
1365
+ /* @__PURE__ */ B("div", {
1366
+ className: "relative",
1367
+ children: [/* @__PURE__ */ z(L, {
1368
+ className: "pointer-events-none absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground",
1369
+ "aria-hidden": "true"
1370
+ }), /* @__PURE__ */ z("input", {
1371
+ type: "search",
1372
+ value: r,
1373
+ onChange: (e) => i(e.target.value),
1374
+ placeholder: "Search tasks…",
1375
+ "aria-label": "Search tasks",
1376
+ className: "h-8 w-40 rounded-md border border-border bg-background pl-7 pr-2 text-xs text-foreground placeholder:text-muted-foreground focus:outline-none focus-visible:ring-2 focus-visible:ring-ring"
1377
+ })]
1378
+ }),
1379
+ /* @__PURE__ */ B("select", {
1380
+ value: a,
1381
+ onChange: (e) => o(e.target.value),
1382
+ "aria-label": "Filter by priority",
1383
+ className: rt,
1384
+ children: [/* @__PURE__ */ z("option", {
1385
+ value: "ALL",
1386
+ children: "All priorities"
1387
+ }), we.map((e) => /* @__PURE__ */ z("option", {
1388
+ value: e,
1389
+ children: q(e)
1390
+ }, e))]
1391
+ }),
1392
+ /* @__PURE__ */ B("select", {
1393
+ value: s,
1394
+ onChange: (e) => c(e.target.value),
1395
+ "aria-label": "Filter by type",
1396
+ className: rt,
1397
+ children: [/* @__PURE__ */ z("option", {
1398
+ value: "ALL",
1399
+ children: "All types"
1400
+ }), Te.map((e) => /* @__PURE__ */ z("option", {
1401
+ value: e,
1402
+ children: q(e)
1403
+ }, e))]
1404
+ }),
1405
+ u && l && /* @__PURE__ */ B("button", {
1406
+ type: "button",
1407
+ onClick: l,
1408
+ className: "flex h-8 items-center gap-1.5 rounded-md bg-primary px-3 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/90",
1409
+ children: [/* @__PURE__ */ z(I, {
1410
+ className: "h-4 w-4",
1411
+ "aria-hidden": "true"
1412
+ }), "New task"]
1413
+ })
1414
+ ]
1415
+ })]
666
1416
  });
667
1417
  }
668
- var X = "w-full rounded-md border border-input bg-background px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring", Z = "text-xs font-medium uppercase tracking-wide text-muted-foreground", te = {
1418
+ var Z = "w-full rounded-md border border-input bg-background px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring", Q = "text-xs font-medium uppercase tracking-wide text-muted-foreground", at = {
669
1419
  NONE: "muted",
670
1420
  LOW: "muted",
671
1421
  MEDIUM: "secondary",
672
1422
  HIGH: "accent",
673
1423
  CRITICAL: "destructive"
674
1424
  };
675
- function Q({ id: e, readonly: t, hiddenFields: n, hideHeader: r, onUpdated: i, onError: a, className: l }) {
676
- let m = s(() => new Set(n ?? []), [n]), { data: h, loading: v, error: b } = _(E, {
1425
+ function ot({ id: e, readonly: t, hiddenFields: n, hideHeader: r, onUpdated: i, onError: a, className: o }) {
1426
+ let s = b(() => new Set(n ?? []), [n]), { data: c, loading: l, error: u } = te(le, {
677
1427
  variables: { id: e },
678
1428
  skip: !e
679
- }), x = h?.planmagnetWorkItem ?? null, [S, C] = c(!1), [w, T] = c(""), [D, A] = c(""), [P, F] = c("TASK"), [I, L] = c("BACKLOG"), [R, z] = c("NONE"), [B, V] = c(""), [H, U] = c(""), [W, G] = c(""), [q, J] = c("");
680
- o(() => {
681
- x && (T(x.title), A(x.description ?? ""), F(x.type), L(x.status), z(x.priority), V(x.assigneeId ?? ""), U(x.dueDate ? String(x.dueDate).slice(0, 10) : ""), G((x.labels ?? []).join(", ")), J(x.storyPoints == null ? "" : String(x.storyPoints)));
682
- }, [x]);
683
- let [Y, { loading: Q, error: ne }] = g(O), re = async (e) => {
684
- if (e.preventDefault(), !x) return;
685
- let t = W.split(",").map((e) => e.trim()).filter(Boolean), n = q.trim() ? Number(q) : void 0, r = {
686
- title: w.trim(),
687
- ...m.has("description") ? {} : { description: D.trim() },
688
- ...m.has("type") ? {} : { type: P },
689
- ...m.has("status") ? {} : { status: I },
690
- ...m.has("priority") ? {} : { priority: R },
691
- ...m.has("assignee") ? {} : { assigneeId: B.trim() },
692
- ...m.has("dueDate") ? {} : { dueDate: H || void 0 },
693
- ...m.has("labels") ? {} : { labels: t },
694
- ...m.has("storyPoints") || n == null || Number.isNaN(n) ? {} : { storyPoints: n }
1429
+ }), d = c?.planmagnetWorkItem ?? null, [f, p] = x(!1), [m, h] = x(""), [g, _] = x(""), [v, S] = x("TASK"), [C, w] = x("BACKLOG"), [T, E] = x("NONE"), [D, O] = x(""), [k, A] = x(""), [j, M] = x(""), [N, P] = x("");
1430
+ y(() => {
1431
+ d && (h(d.title), _(d.description ?? ""), S(d.type), w(d.status), E(d.priority), O(d.assigneeId ?? ""), A(d.dueDate ? String(d.dueDate).slice(0, 10) : ""), M((d.labels ?? []).join(", ")), P(d.storyPoints == null ? "" : String(d.storyPoints)));
1432
+ }, [d]);
1433
+ let [F, { loading: I, error: L }] = W(de), R = async (e) => {
1434
+ if (e.preventDefault(), !d) return;
1435
+ let t = j.split(",").map((e) => e.trim()).filter(Boolean), n = N.trim() ? Number(N) : void 0, r = {
1436
+ title: m.trim(),
1437
+ ...s.has("description") ? {} : { description: g.trim() },
1438
+ ...s.has("type") ? {} : { type: v },
1439
+ ...s.has("status") ? {} : { status: C },
1440
+ ...s.has("priority") ? {} : { priority: T },
1441
+ ...s.has("assignee") ? {} : { assigneeId: D.trim() },
1442
+ ...s.has("dueDate") ? {} : { dueDate: k || void 0 },
1443
+ ...s.has("labels") ? {} : { labels: t },
1444
+ ...s.has("storyPoints") || n == null || Number.isNaN(n) ? {} : { storyPoints: n }
695
1445
  };
696
1446
  try {
697
- let e = (await Y({ variables: {
698
- id: x.id,
1447
+ let e = (await F({ variables: {
1448
+ id: d.id,
699
1449
  input: r
700
1450
  } })).data?.planmagnetUpdateWorkItem;
701
1451
  if (e) {
702
- let t = y();
1452
+ let t = re();
703
1453
  try {
704
1454
  await t.onTaskSaved?.({
705
1455
  id: e.id,
@@ -709,276 +1459,276 @@ function Q({ id: e, readonly: t, hiddenFields: n, hideHeader: r, onUpdated: i, o
709
1459
  operation: "updated"
710
1460
  });
711
1461
  } catch {}
712
- i?.(e), C(!1);
1462
+ i?.(e), p(!1);
713
1463
  }
714
1464
  } catch (e) {
715
1465
  a?.(e instanceof Error ? e : Error(String(e)));
716
1466
  }
717
1467
  };
718
- if (!e) return /* @__PURE__ */ u("div", {
719
- className: k("p-6 text-sm text-destructive", l),
1468
+ if (!e) return /* @__PURE__ */ z("div", {
1469
+ className: K("p-6 text-sm text-destructive", o),
720
1470
  children: "TaskDetail: no work-item id provided."
721
1471
  });
722
- if (v && !h) return /* @__PURE__ */ u("div", {
723
- className: k("flex items-center justify-center p-12", l),
724
- children: /* @__PURE__ */ u("div", { className: "h-8 w-8 animate-spin rounded-full border-2 border-primary border-t-transparent" })
1472
+ if (l && !c) return /* @__PURE__ */ z("div", {
1473
+ className: K("flex items-center justify-center p-12", o),
1474
+ children: /* @__PURE__ */ z("div", { className: "h-8 w-8 animate-spin rounded-full border-2 border-primary border-t-transparent" })
725
1475
  });
726
- if (b && !h) return /* @__PURE__ */ d("div", {
727
- className: k("p-6 text-sm text-destructive", l),
728
- children: ["Error loading task: ", b.message]
1476
+ if (u && !c) return /* @__PURE__ */ B("div", {
1477
+ className: K("p-6 text-sm text-destructive", o),
1478
+ children: ["Error loading task: ", u.message]
729
1479
  });
730
- if (!x) return /* @__PURE__ */ u("div", {
731
- className: k("p-6 text-sm text-muted-foreground", l),
1480
+ if (!d) return /* @__PURE__ */ z("div", {
1481
+ className: K("p-6 text-sm text-muted-foreground", o),
732
1482
  children: "Task not found."
733
1483
  });
734
- let ie = !t;
735
- return /* @__PURE__ */ u(f, {
736
- className: k("shadow-sm", l),
737
- children: /* @__PURE__ */ d(p, {
1484
+ let U = !t;
1485
+ return /* @__PURE__ */ z(V, {
1486
+ className: K("shadow-sm", o),
1487
+ children: /* @__PURE__ */ B(H, {
738
1488
  className: "space-y-4 p-6",
739
- children: [!r && /* @__PURE__ */ d("div", {
1489
+ children: [!r && /* @__PURE__ */ B("div", {
740
1490
  className: "flex items-start justify-between gap-4",
741
- children: [/* @__PURE__ */ d("div", { children: [/* @__PURE__ */ u("p", {
1491
+ children: [/* @__PURE__ */ B("div", { children: [/* @__PURE__ */ z("p", {
742
1492
  className: "text-xs text-muted-foreground",
743
- children: x.key
744
- }), /* @__PURE__ */ u("h2", {
1493
+ children: d.key
1494
+ }), /* @__PURE__ */ z("h2", {
745
1495
  className: "text-xl font-semibold text-foreground",
746
- children: x.title
747
- })] }), ie && !S && /* @__PURE__ */ u("button", {
1496
+ children: d.title
1497
+ })] }), U && !f && /* @__PURE__ */ z("button", {
748
1498
  type: "button",
749
- onClick: () => C(!0),
1499
+ onClick: () => p(!0),
750
1500
  className: "rounded-md bg-primary px-3 py-1.5 text-sm font-medium text-primary-foreground",
751
1501
  children: "Edit"
752
1502
  })]
753
- }), S ? /* @__PURE__ */ d("form", {
754
- onSubmit: re,
1503
+ }), f ? /* @__PURE__ */ B("form", {
1504
+ onSubmit: R,
755
1505
  className: "space-y-4",
756
1506
  children: [
757
- /* @__PURE__ */ d("div", {
1507
+ /* @__PURE__ */ B("div", {
758
1508
  className: "space-y-1",
759
- children: [/* @__PURE__ */ u("label", {
1509
+ children: [/* @__PURE__ */ z("label", {
760
1510
  htmlFor: "pm-detail-title",
761
- className: Z,
1511
+ className: Q,
762
1512
  children: "Title"
763
- }), /* @__PURE__ */ u("input", {
1513
+ }), /* @__PURE__ */ z("input", {
764
1514
  id: "pm-detail-title",
765
- className: X,
766
- value: w,
767
- onChange: (e) => T(e.target.value),
1515
+ className: Z,
1516
+ value: m,
1517
+ onChange: (e) => h(e.target.value),
768
1518
  required: !0
769
1519
  })]
770
1520
  }),
771
- !m.has("description") && /* @__PURE__ */ d("div", {
1521
+ !s.has("description") && /* @__PURE__ */ B("div", {
772
1522
  className: "space-y-1",
773
- children: [/* @__PURE__ */ u("label", {
1523
+ children: [/* @__PURE__ */ z("label", {
774
1524
  htmlFor: "pm-detail-desc",
775
- className: Z,
1525
+ className: Q,
776
1526
  children: "Description"
777
- }), /* @__PURE__ */ u("textarea", {
1527
+ }), /* @__PURE__ */ z("textarea", {
778
1528
  id: "pm-detail-desc",
779
- className: k(X, "min-h-[80px]"),
780
- value: D,
781
- onChange: (e) => A(e.target.value)
1529
+ className: K(Z, "min-h-[80px]"),
1530
+ value: g,
1531
+ onChange: (e) => _(e.target.value)
782
1532
  })]
783
1533
  }),
784
- /* @__PURE__ */ d("div", {
1534
+ /* @__PURE__ */ B("div", {
785
1535
  className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
786
1536
  children: [
787
- !m.has("type") && /* @__PURE__ */ d("div", {
1537
+ !s.has("type") && /* @__PURE__ */ B("div", {
788
1538
  className: "space-y-1",
789
- children: [/* @__PURE__ */ u("label", {
1539
+ children: [/* @__PURE__ */ z("label", {
790
1540
  htmlFor: "pm-detail-type",
791
- className: Z,
1541
+ className: Q,
792
1542
  children: "Type"
793
- }), /* @__PURE__ */ u("select", {
1543
+ }), /* @__PURE__ */ z("select", {
794
1544
  id: "pm-detail-type",
795
- className: k(X, "capitalize"),
796
- value: P,
797
- onChange: (e) => F(e.target.value),
798
- children: ee.map((e) => /* @__PURE__ */ u("option", {
1545
+ className: K(Z, "capitalize"),
1546
+ value: v,
1547
+ onChange: (e) => S(e.target.value),
1548
+ children: Te.map((e) => /* @__PURE__ */ z("option", {
799
1549
  value: e,
800
- children: N(e)
1550
+ children: q(e)
801
1551
  }, e))
802
1552
  })]
803
1553
  }),
804
- !m.has("status") && /* @__PURE__ */ d("div", {
1554
+ !s.has("status") && /* @__PURE__ */ B("div", {
805
1555
  className: "space-y-1",
806
- children: [/* @__PURE__ */ u("label", {
1556
+ children: [/* @__PURE__ */ z("label", {
807
1557
  htmlFor: "pm-detail-status",
808
- className: Z,
1558
+ className: Q,
809
1559
  children: "Status"
810
- }), /* @__PURE__ */ u("select", {
1560
+ }), /* @__PURE__ */ z("select", {
811
1561
  id: "pm-detail-status",
812
- className: k(X, "capitalize"),
813
- value: I,
814
- onChange: (e) => L(e.target.value),
815
- children: M.map((e) => /* @__PURE__ */ u("option", {
1562
+ className: K(Z, "capitalize"),
1563
+ value: C,
1564
+ onChange: (e) => w(e.target.value),
1565
+ children: Ee.map((e) => /* @__PURE__ */ z("option", {
816
1566
  value: e,
817
- children: N(e)
1567
+ children: q(e)
818
1568
  }, e))
819
1569
  })]
820
1570
  }),
821
- !m.has("priority") && /* @__PURE__ */ d("div", {
1571
+ !s.has("priority") && /* @__PURE__ */ B("div", {
822
1572
  className: "space-y-1",
823
- children: [/* @__PURE__ */ u("label", {
1573
+ children: [/* @__PURE__ */ z("label", {
824
1574
  htmlFor: "pm-detail-priority",
825
- className: Z,
1575
+ className: Q,
826
1576
  children: "Priority"
827
- }), /* @__PURE__ */ u("select", {
1577
+ }), /* @__PURE__ */ z("select", {
828
1578
  id: "pm-detail-priority",
829
- className: k(X, "capitalize"),
830
- value: R,
831
- onChange: (e) => z(e.target.value),
832
- children: j.map((e) => /* @__PURE__ */ u("option", {
1579
+ className: K(Z, "capitalize"),
1580
+ value: T,
1581
+ onChange: (e) => E(e.target.value),
1582
+ children: we.map((e) => /* @__PURE__ */ z("option", {
833
1583
  value: e,
834
- children: N(e)
1584
+ children: q(e)
835
1585
  }, e))
836
1586
  })]
837
1587
  }),
838
- !m.has("assignee") && /* @__PURE__ */ d("div", {
1588
+ !s.has("assignee") && /* @__PURE__ */ B("div", {
839
1589
  className: "space-y-1",
840
- children: [/* @__PURE__ */ u("label", {
1590
+ children: [/* @__PURE__ */ z("label", {
841
1591
  htmlFor: "pm-detail-assignee",
842
- className: Z,
1592
+ className: Q,
843
1593
  children: "Assignee"
844
- }), /* @__PURE__ */ u("input", {
1594
+ }), /* @__PURE__ */ z("input", {
845
1595
  id: "pm-detail-assignee",
846
- className: X,
847
- value: B,
848
- onChange: (e) => V(e.target.value),
1596
+ className: Z,
1597
+ value: D,
1598
+ onChange: (e) => O(e.target.value),
849
1599
  placeholder: "Actor ID"
850
1600
  })]
851
1601
  }),
852
- !m.has("dueDate") && /* @__PURE__ */ d("div", {
1602
+ !s.has("dueDate") && /* @__PURE__ */ B("div", {
853
1603
  className: "space-y-1",
854
- children: [/* @__PURE__ */ u("label", {
1604
+ children: [/* @__PURE__ */ z("label", {
855
1605
  htmlFor: "pm-detail-due",
856
- className: Z,
1606
+ className: Q,
857
1607
  children: "Due date"
858
- }), /* @__PURE__ */ u("input", {
1608
+ }), /* @__PURE__ */ z("input", {
859
1609
  id: "pm-detail-due",
860
1610
  type: "date",
861
- className: X,
862
- value: H,
863
- onChange: (e) => U(e.target.value)
1611
+ className: Z,
1612
+ value: k,
1613
+ onChange: (e) => A(e.target.value)
864
1614
  })]
865
1615
  }),
866
- !m.has("storyPoints") && /* @__PURE__ */ d("div", {
1616
+ !s.has("storyPoints") && /* @__PURE__ */ B("div", {
867
1617
  className: "space-y-1",
868
- children: [/* @__PURE__ */ u("label", {
1618
+ children: [/* @__PURE__ */ z("label", {
869
1619
  htmlFor: "pm-detail-points",
870
- className: Z,
1620
+ className: Q,
871
1621
  children: "Story points"
872
- }), /* @__PURE__ */ u("input", {
1622
+ }), /* @__PURE__ */ z("input", {
873
1623
  id: "pm-detail-points",
874
1624
  type: "number",
875
1625
  min: 0,
876
- className: X,
877
- value: q,
878
- onChange: (e) => J(e.target.value)
1626
+ className: Z,
1627
+ value: N,
1628
+ onChange: (e) => P(e.target.value)
879
1629
  })]
880
1630
  })
881
1631
  ]
882
1632
  }),
883
- !m.has("labels") && /* @__PURE__ */ d("div", {
1633
+ !s.has("labels") && /* @__PURE__ */ B("div", {
884
1634
  className: "space-y-1",
885
- children: [/* @__PURE__ */ u("label", {
1635
+ children: [/* @__PURE__ */ z("label", {
886
1636
  htmlFor: "pm-detail-labels",
887
- className: Z,
1637
+ className: Q,
888
1638
  children: "Labels"
889
- }), /* @__PURE__ */ u("input", {
1639
+ }), /* @__PURE__ */ z("input", {
890
1640
  id: "pm-detail-labels",
891
- className: X,
892
- value: W,
893
- onChange: (e) => G(e.target.value),
1641
+ className: Z,
1642
+ value: j,
1643
+ onChange: (e) => M(e.target.value),
894
1644
  placeholder: "comma, separated, labels"
895
1645
  })]
896
1646
  }),
897
- ne && /* @__PURE__ */ d("p", {
1647
+ L && /* @__PURE__ */ B("p", {
898
1648
  className: "text-sm text-destructive",
899
- children: ["Failed to save: ", ne.message]
1649
+ children: ["Failed to save: ", L.message]
900
1650
  }),
901
- /* @__PURE__ */ d("div", {
1651
+ /* @__PURE__ */ B("div", {
902
1652
  className: "flex items-center justify-end gap-2",
903
- children: [/* @__PURE__ */ u("button", {
1653
+ children: [/* @__PURE__ */ z("button", {
904
1654
  type: "button",
905
- onClick: () => C(!1),
1655
+ onClick: () => p(!1),
906
1656
  className: "rounded-md bg-muted px-4 py-2 text-sm font-medium text-muted-foreground hover:bg-muted/70",
907
1657
  children: "Cancel"
908
- }), /* @__PURE__ */ u("button", {
1658
+ }), /* @__PURE__ */ z("button", {
909
1659
  type: "submit",
910
- disabled: Q || !w.trim(),
911
- className: k("rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground", (Q || !w.trim()) && "cursor-not-allowed opacity-50"),
912
- children: Q ? "Saving…" : "Save changes"
1660
+ disabled: I || !m.trim(),
1661
+ className: K("rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground", (I || !m.trim()) && "cursor-not-allowed opacity-50"),
1662
+ children: I ? "Saving…" : "Save changes"
913
1663
  })]
914
1664
  })
915
1665
  ]
916
- }) : /* @__PURE__ */ d("dl", {
1666
+ }) : /* @__PURE__ */ B("dl", {
917
1667
  className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
918
1668
  children: [
919
- !m.has("type") && /* @__PURE__ */ u($, {
1669
+ !s.has("type") && /* @__PURE__ */ z($, {
920
1670
  label: "Type",
921
- children: /* @__PURE__ */ u(K, {
1671
+ children: /* @__PURE__ */ z(_e, {
922
1672
  variant: "secondary",
923
- children: N(x.type)
1673
+ children: q(d.type)
924
1674
  })
925
1675
  }),
926
- !m.has("status") && /* @__PURE__ */ u($, {
1676
+ !s.has("status") && /* @__PURE__ */ z($, {
927
1677
  label: "Status",
928
- children: /* @__PURE__ */ u("span", {
1678
+ children: /* @__PURE__ */ z("span", {
929
1679
  className: "capitalize text-foreground",
930
- children: N(x.status)
1680
+ children: q(d.status)
931
1681
  })
932
1682
  }),
933
- !m.has("priority") && /* @__PURE__ */ u($, {
1683
+ !s.has("priority") && /* @__PURE__ */ z($, {
934
1684
  label: "Priority",
935
- children: /* @__PURE__ */ u(K, {
936
- variant: te[x.priority],
937
- children: N(x.priority)
1685
+ children: /* @__PURE__ */ z(_e, {
1686
+ variant: at[d.priority],
1687
+ children: q(d.priority)
938
1688
  })
939
1689
  }),
940
- !m.has("assignee") && /* @__PURE__ */ u($, {
1690
+ !s.has("assignee") && /* @__PURE__ */ z($, {
941
1691
  label: "Assignee",
942
- children: /* @__PURE__ */ u("span", {
1692
+ children: /* @__PURE__ */ z("span", {
943
1693
  className: "text-foreground",
944
- children: x.assigneeId ?? "Unassigned"
1694
+ children: d.assigneeId ?? "Unassigned"
945
1695
  })
946
1696
  }),
947
- !m.has("dueDate") && /* @__PURE__ */ u($, {
1697
+ !s.has("dueDate") && /* @__PURE__ */ z($, {
948
1698
  label: "Due date",
949
- children: /* @__PURE__ */ u("span", {
1699
+ children: /* @__PURE__ */ z("span", {
950
1700
  className: "text-foreground",
951
- children: x.dueDate ?? "—"
1701
+ children: d.dueDate ?? "—"
952
1702
  })
953
1703
  }),
954
- !m.has("storyPoints") && /* @__PURE__ */ u($, {
1704
+ !s.has("storyPoints") && /* @__PURE__ */ z($, {
955
1705
  label: "Story points",
956
- children: /* @__PURE__ */ u("span", {
1706
+ children: /* @__PURE__ */ z("span", {
957
1707
  className: "text-foreground",
958
- children: x.storyPoints ?? 0
1708
+ children: d.storyPoints ?? 0
959
1709
  })
960
1710
  }),
961
- !m.has("description") && /* @__PURE__ */ d("div", {
1711
+ !s.has("description") && /* @__PURE__ */ B("div", {
962
1712
  className: "sm:col-span-2",
963
- children: [/* @__PURE__ */ u("dt", {
964
- className: Z,
1713
+ children: [/* @__PURE__ */ z("dt", {
1714
+ className: Q,
965
1715
  children: "Description"
966
- }), /* @__PURE__ */ u("dd", {
1716
+ }), /* @__PURE__ */ z("dd", {
967
1717
  className: "mt-1 whitespace-pre-wrap text-sm text-foreground",
968
- children: x.description || "—"
1718
+ children: d.description || "—"
969
1719
  })]
970
1720
  }),
971
- !m.has("labels") && /* @__PURE__ */ d("div", {
1721
+ !s.has("labels") && /* @__PURE__ */ B("div", {
972
1722
  className: "sm:col-span-2",
973
- children: [/* @__PURE__ */ u("dt", {
974
- className: Z,
1723
+ children: [/* @__PURE__ */ z("dt", {
1724
+ className: Q,
975
1725
  children: "Labels"
976
- }), /* @__PURE__ */ u("dd", {
1726
+ }), /* @__PURE__ */ z("dd", {
977
1727
  className: "mt-1 flex flex-wrap gap-1",
978
- children: (x.labels ?? []).length === 0 ? /* @__PURE__ */ u("span", {
1728
+ children: (d.labels ?? []).length === 0 ? /* @__PURE__ */ z("span", {
979
1729
  className: "text-sm text-muted-foreground",
980
1730
  children: "—"
981
- }) : x.labels.map((e) => /* @__PURE__ */ u("span", {
1731
+ }) : d.labels.map((e) => /* @__PURE__ */ z("span", {
982
1732
  className: "rounded bg-muted px-1.5 py-0.5 text-xs text-muted-foreground",
983
1733
  children: e
984
1734
  }, e))
@@ -990,105 +1740,129 @@ function Q({ id: e, readonly: t, hiddenFields: n, hideHeader: r, onUpdated: i, o
990
1740
  });
991
1741
  }
992
1742
  function $({ label: e, children: t }) {
993
- return /* @__PURE__ */ d("div", { children: [/* @__PURE__ */ u("dt", {
994
- className: Z,
1743
+ return /* @__PURE__ */ B("div", { children: [/* @__PURE__ */ z("dt", {
1744
+ className: Q,
995
1745
  children: e
996
- }), /* @__PURE__ */ u("dd", {
1746
+ }), /* @__PURE__ */ z("dd", {
997
1747
  className: "mt-1 text-sm",
998
1748
  children: t
999
1749
  })] });
1000
1750
  }
1001
- function ne({ workspaceId: e, projectId: t, boardProjectId: n, columns: r, readonly: a, hiddenFields: o, hideFilters: s, header: l, onTaskSaved: f, createSurface: p = "modal", detailSurface: m = "drawer", className: g }) {
1002
- let _ = x(), v = e ?? _?.workspaceId, y = h(), [b, S] = c(!1), [C, w] = c(null), E = i(() => {
1003
- y.refetchQueries({ include: [T] }).catch(() => {});
1004
- }, [y]), D = i((e) => {
1005
- E(), S(!1), f?.({
1751
+ function st({ workspaceId: e, projectId: t, boardProjectId: n, columns: r, readonly: i, hiddenFields: a, views: o, defaultView: s = "board", resolveAssignee: c, header: l, onTaskSaved: u, createSurface: d = "modal", detailSurface: f = "drawer", className: p }) {
1752
+ let m = G(), h = e ?? m?.workspaceId, g = ee(), [v, y] = x(s), [b, S] = x(""), [C, w] = x("ALL"), [T, E] = x("ALL"), [D, O] = x(!1), [k, A] = x(null), j = _(() => {
1753
+ g.refetchQueries({ include: [ce] }).catch(() => {});
1754
+ }, [g]), M = _((e) => {
1755
+ j(), O(!1), u?.({
1006
1756
  workItem: e,
1007
1757
  operation: "created"
1008
1758
  });
1009
- }, [E, f]), O = i((e) => {
1010
- E(), f?.({
1759
+ }, [j, u]), N = _((e) => {
1760
+ j(), u?.({
1011
1761
  workItem: e,
1012
1762
  operation: "updated"
1013
1763
  });
1014
- }, [E, f]), A = i((e) => {
1015
- w(e.id);
1016
- }, []);
1017
- if (!v) return /* @__PURE__ */ u("div", {
1018
- className: k("p-6 text-sm text-destructive", g),
1764
+ }, [j, u]), P = _((e) => {
1765
+ A(e.id);
1766
+ }, []), F = _((e) => A(e), []);
1767
+ if (!h) return /* @__PURE__ */ z("div", {
1768
+ className: K("p-6 text-sm text-destructive", p),
1019
1769
  children: "TasksPage: no workspaceId provided (prop or PlanMagnetProvider)."
1020
1770
  });
1021
- let j = !a && !!t, ee = b && p === "inline", M = C != null && m === "inline", N = /* @__PURE__ */ u(W, {
1022
- workspaceId: v,
1771
+ let I = !i && !!t, L = D && d === "inline", R = k != null && f === "inline", V = /* @__PURE__ */ z(We, {
1772
+ workspaceId: h,
1023
1773
  projectId: t,
1024
- hiddenFields: o,
1025
- onCreated: D,
1026
- onCancel: () => S(!1)
1027
- }), P = C == null ? null : /* @__PURE__ */ u(Q, {
1028
- id: C,
1029
- readonly: a,
1030
- hiddenFields: o,
1031
- onUpdated: O
1032
- });
1033
- return /* @__PURE__ */ d("div", {
1034
- className: k("space-y-4", g),
1774
+ hiddenFields: a,
1775
+ onCreated: M,
1776
+ onCancel: () => O(!1)
1777
+ }), H = k == null ? null : /* @__PURE__ */ z(ot, {
1778
+ id: k,
1779
+ readonly: i,
1780
+ hiddenFields: a,
1781
+ onUpdated: N
1782
+ }), U = C === "ALL" ? void 0 : C, W = T === "ALL" ? void 0 : T;
1783
+ return /* @__PURE__ */ B("div", {
1784
+ className: K("space-y-4 p-6", p),
1035
1785
  children: [
1036
- (l || j) && /* @__PURE__ */ d("div", {
1037
- className: "flex items-center justify-between gap-4 px-6 pt-6",
1038
- children: [/* @__PURE__ */ u("div", {
1039
- className: "min-w-0",
1040
- children: typeof l == "string" ? /* @__PURE__ */ u("h1", {
1041
- className: "truncate text-2xl font-semibold text-foreground",
1042
- children: l
1043
- }) : l
1044
- }), j && /* @__PURE__ */ u("button", {
1045
- type: "button",
1046
- onClick: () => S(!0),
1047
- className: "shrink-0 rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground hover:bg-primary/90",
1048
- children: "New task"
1049
- })]
1786
+ l && /* @__PURE__ */ z("div", {
1787
+ className: "min-w-0",
1788
+ children: typeof l == "string" ? /* @__PURE__ */ z("h1", {
1789
+ className: "truncate text-2xl font-semibold text-foreground",
1790
+ children: l
1791
+ }) : l
1050
1792
  }),
1051
- ee && /* @__PURE__ */ u("div", {
1052
- className: "px-6",
1053
- children: N
1793
+ /* @__PURE__ */ z(it, {
1794
+ view: v,
1795
+ onViewChange: y,
1796
+ views: o,
1797
+ search: b,
1798
+ onSearchChange: S,
1799
+ priority: C,
1800
+ onPriorityChange: w,
1801
+ type: T,
1802
+ onTypeChange: E,
1803
+ onNewTask: () => O(!0),
1804
+ canCreate: I
1054
1805
  }),
1055
- /* @__PURE__ */ u(L, {
1056
- workspaceId: v,
1806
+ L && /* @__PURE__ */ z("div", { children: V }),
1807
+ v === "board" && /* @__PURE__ */ z(Be, {
1808
+ workspaceId: h,
1057
1809
  projectId: n,
1058
1810
  columns: r,
1059
- readonly: a,
1060
- hideHeader: !!l,
1061
- hideFilters: s,
1062
- hiddenFields: o,
1063
- onTaskClick: A
1811
+ readonly: i,
1812
+ hideHeader: !0,
1813
+ priority: C,
1814
+ type: T,
1815
+ search: b,
1816
+ hiddenFields: a,
1817
+ resolveAssignee: c,
1818
+ onTaskClick: P
1819
+ }),
1820
+ v === "list" && /* @__PURE__ */ z(Xe, {
1821
+ workspaceId: h,
1822
+ projectId: n,
1823
+ priority: U,
1824
+ type: W,
1825
+ search: b || void 0,
1826
+ hideHeader: !0,
1827
+ resolveAssignee: c,
1828
+ onSelect: F
1829
+ }),
1830
+ v === "timeline" && /* @__PURE__ */ z(et, {
1831
+ workspaceId: h,
1832
+ projectId: n,
1833
+ priority: C,
1834
+ type: T,
1835
+ search: b,
1836
+ resolveAssignee: c,
1837
+ onSelect: F
1064
1838
  }),
1065
- M && /* @__PURE__ */ u("div", {
1066
- className: "px-6 pb-6",
1067
- children: P
1839
+ R && /* @__PURE__ */ z("div", {
1840
+ className: "pb-6",
1841
+ children: H
1068
1842
  }),
1069
- p === "modal" && /* @__PURE__ */ u(J, {
1070
- open: b,
1071
- onClose: () => S(!1),
1843
+ d === "modal" && /* @__PURE__ */ z(Ie, {
1844
+ open: D,
1845
+ onClose: () => O(!1),
1072
1846
  ariaLabel: "Create task",
1073
1847
  className: "max-w-xl",
1074
- children: /* @__PURE__ */ u("div", {
1848
+ children: /* @__PURE__ */ z("div", {
1075
1849
  className: "p-2 pt-8",
1076
- children: N
1850
+ children: V
1077
1851
  })
1078
1852
  }),
1079
- m === "drawer" && /* @__PURE__ */ u(Y, {
1080
- open: C != null,
1081
- onClose: () => w(null),
1853
+ f === "drawer" && /* @__PURE__ */ z(Le, {
1854
+ open: k != null,
1855
+ onClose: () => A(null),
1082
1856
  ariaLabel: "Task detail",
1083
- children: /* @__PURE__ */ u("div", {
1857
+ children: /* @__PURE__ */ z("div", {
1084
1858
  className: "p-2 pt-8",
1085
- children: P
1859
+ children: H
1086
1860
  })
1087
1861
  })
1088
1862
  ]
1089
1863
  });
1090
1864
  }
1091
1865
  //#endregion
1092
- export { ne as TasksPageCore };
1866
+ export { st as TasksPageCore };
1093
1867
 
1094
1868
  //# sourceMappingURL=index.js.map