@burdenoff/microfe-planmagnet 2026.1001.7 → 2026.1002.1

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 (62) hide show
  1. package/dist/generated/global-types.d.ts +5 -0
  2. package/dist/generated/global-types.d.ts.map +1 -1
  3. package/dist/planmagnet/comments/CommentAttachmentUpload.d.ts +16 -0
  4. package/dist/planmagnet/comments/CommentAttachmentUpload.d.ts.map +1 -0
  5. package/dist/planmagnet/comments/CommentAttachmentUpload.js +218 -0
  6. package/dist/planmagnet/comments/CommentAttachmentUpload.js.map +1 -0
  7. package/dist/planmagnet/comments/CommentAttachments.d.ts +15 -0
  8. package/dist/planmagnet/comments/CommentAttachments.d.ts.map +1 -0
  9. package/dist/planmagnet/comments/CommentAttachments.js +74 -0
  10. package/dist/planmagnet/comments/CommentAttachments.js.map +1 -0
  11. package/dist/planmagnet/comments/CommentBody.d.ts +11 -0
  12. package/dist/planmagnet/comments/CommentBody.d.ts.map +1 -0
  13. package/dist/planmagnet/comments/CommentBody.js +130 -0
  14. package/dist/planmagnet/comments/CommentBody.js.map +1 -0
  15. package/dist/planmagnet/comments/CommentThread.d.ts +7 -2
  16. package/dist/planmagnet/comments/CommentThread.d.ts.map +1 -1
  17. package/dist/planmagnet/comments/CommentThread.js +288 -233
  18. package/dist/planmagnet/comments/CommentThread.js.map +1 -1
  19. package/dist/planmagnet/comments/MentionComposer.d.ts +0 -7
  20. package/dist/planmagnet/comments/MentionComposer.d.ts.map +1 -1
  21. package/dist/planmagnet/comments/MentionComposer.js +225 -86
  22. package/dist/planmagnet/comments/MentionComposer.js.map +1 -1
  23. package/dist/planmagnet/comments/TargetComments.d.ts.map +1 -1
  24. package/dist/planmagnet/comments/TargetComments.js +44 -6
  25. package/dist/planmagnet/comments/TargetComments.js.map +1 -1
  26. package/dist/planmagnet/comments/WorkItemComments.d.ts.map +1 -1
  27. package/dist/planmagnet/comments/WorkItemComments.js +22 -3
  28. package/dist/planmagnet/comments/WorkItemComments.js.map +1 -1
  29. package/dist/planmagnet/comments/commentAttachmentUploadClient.d.ts +102 -0
  30. package/dist/planmagnet/comments/commentAttachmentUploadClient.d.ts.map +1 -0
  31. package/dist/planmagnet/comments/commentAttachmentUploadClient.js +298 -0
  32. package/dist/planmagnet/comments/commentAttachmentUploadClient.js.map +1 -0
  33. package/dist/planmagnet/comments/commentImageTokens.d.ts +5 -0
  34. package/dist/planmagnet/comments/commentImageTokens.d.ts.map +1 -0
  35. package/dist/planmagnet/comments/commentImageTokens.js +14 -0
  36. package/dist/planmagnet/comments/commentImageTokens.js.map +1 -0
  37. package/dist/planmagnet/comments/commentTokens.d.ts +31 -0
  38. package/dist/planmagnet/comments/commentTokens.d.ts.map +1 -0
  39. package/dist/planmagnet/comments/commentTokens.js +142 -0
  40. package/dist/planmagnet/comments/commentTokens.js.map +1 -0
  41. package/dist/planmagnet/comments/fileDisplay.d.ts +22 -0
  42. package/dist/planmagnet/comments/fileDisplay.d.ts.map +1 -0
  43. package/dist/planmagnet/comments/fileDisplay.js +48 -0
  44. package/dist/planmagnet/comments/fileDisplay.js.map +1 -0
  45. package/dist/planmagnet/comments/useCommentFileUrl.d.ts +22 -0
  46. package/dist/planmagnet/comments/useCommentFileUrl.d.ts.map +1 -0
  47. package/dist/planmagnet/comments/useCommentFileUrl.js +54 -0
  48. package/dist/planmagnet/comments/useCommentFileUrl.js.map +1 -0
  49. package/dist/planmagnet/hooks/useLiveRefresh.d.ts +33 -2
  50. package/dist/planmagnet/hooks/useLiveRefresh.d.ts.map +1 -1
  51. package/dist/planmagnet/hooks/useLiveRefresh.js +71 -42
  52. package/dist/planmagnet/hooks/useLiveRefresh.js.map +1 -1
  53. package/dist/planmagnet/pages/ProductsRoadmapAnalyticsPagePage.d.ts.map +1 -1
  54. package/dist/planmagnet/pages/ProductsRoadmapAnalyticsPagePage.js +153 -117
  55. package/dist/planmagnet/pages/ProductsRoadmapAnalyticsPagePage.js.map +1 -1
  56. package/dist/planmagnet/pages/ProductsRoadmapDetailPagePage.d.ts.map +1 -1
  57. package/dist/planmagnet/pages/ProductsRoadmapDetailPagePage.js +173 -138
  58. package/dist/planmagnet/pages/ProductsRoadmapDetailPagePage.js.map +1 -1
  59. package/dist/planmagnet/roadmaps/RoadmapNowNextLater.d.ts.map +1 -1
  60. package/dist/planmagnet/roadmaps/RoadmapNowNextLater.js +171 -153
  61. package/dist/planmagnet/roadmaps/RoadmapNowNextLater.js.map +1 -1
  62. package/package.json +3 -2
@@ -2,15 +2,17 @@ import { usePlanMagnet as e } from "../providers/PlanMagnetProvider.js";
2
2
  import { isForbidden as t, mutationErrorMessage as n } from "../utils/graphqlErrors.js";
3
3
  import { throwOnError as r } from "../utils/mutationResult.js";
4
4
  import { enumLabel as i } from "../controls/WorkItemControls.js";
5
- import { RoadmapItemCommentsButton as a } from "../comments/RoadmapComments.js";
6
- import { useEffect as o, useMemo as s, useState as c } from "react";
7
- import { AlertTriangle as l, Calendar as u, Gauge as d, Inbox as f, Loader2 as p, ShieldAlert as m, ShieldCheck as h } from "lucide-react";
8
- import { gql as g } from "@apollo/client";
9
- import { useMutation as _, useQuery as v } from "@apollo/client/react";
10
- import { jsx as y, jsxs as b } from "react/jsx-runtime";
11
- import { Tooltip as x, TooltipContent as S, TooltipProvider as C, TooltipTrigger as w } from "@burdenoff/fe-libs/ui";
5
+ import { useLiveRefresh as a } from "../hooks/useLiveRefresh.js";
6
+ import { LiveStatus as o } from "../controls/LiveStatus.js";
7
+ import { RoadmapItemCommentsButton as s } from "../comments/RoadmapComments.js";
8
+ import { useEffect as c, useMemo as l, useState as u } from "react";
9
+ import { AlertTriangle as d, Calendar as f, Gauge as p, Inbox as m, Loader2 as h, ShieldAlert as g, ShieldCheck as _ } from "lucide-react";
10
+ import { gql as v } from "@apollo/client";
11
+ import { useMutation as y, useQuery as b } from "@apollo/client/react";
12
+ import { jsx as x, jsxs as S } from "react/jsx-runtime";
13
+ import { Tooltip as C, TooltipContent as w, TooltipProvider as T, TooltipTrigger as E } from "@burdenoff/fe-libs/ui";
12
14
  //#region src/planmagnet/roadmaps/RoadmapNowNextLater.tsx
13
- var T = "\n id\n title\n status\n startDate\n endDate\n horizon\n swimlane\n sortOrder\n confidence\n riskLevel\n riskNote\n featureRequestDemand {\n requests\n votes\n }\n", E = g`
15
+ var D = ["RoadmapNowNextLaterItems"], O = "\n id\n title\n status\n startDate\n endDate\n horizon\n swimlane\n sortOrder\n confidence\n riskLevel\n riskNote\n featureRequestDemand {\n requests\n votes\n }\n", k = v`
14
16
  query RoadmapNowNextLaterItems(
15
17
  $workspaceId: ID!
16
18
  $filter: PlanmagnetRoadmapItemFilter
@@ -18,7 +20,7 @@ var T = "\n id\n title\n status\n startDate\n endDate\n horizon\n swimlan
18
20
  ) {
19
21
  planmagnetRoadmapItems(workspaceId: $workspaceId, filter: $filter, pagination: $pagination) {
20
22
  items {
21
- ${T}
23
+ ${O}
22
24
  }
23
25
  pageInfo {
24
26
  hasNextPage
@@ -27,13 +29,13 @@ var T = "\n id\n title\n status\n startDate\n endDate\n horizon\n swimlan
27
29
  totalCount
28
30
  }
29
31
  }
30
- `, D = g`
32
+ `, ee = v`
31
33
  mutation RoadmapNowNextLaterMove($id: ID!, $input: PlanmagnetMoveRoadmapItemInput!) {
32
34
  planmagnetMoveRoadmapItem(id: $id, input: $input) {
33
- ${T}
35
+ ${O}
34
36
  }
35
37
  }
36
- `, O = [
38
+ `, A = [
37
39
  {
38
40
  key: "UNPLACED",
39
41
  label: "Not placed",
@@ -54,20 +56,20 @@ var T = "\n id\n title\n status\n startDate\n endDate\n horizon\n swimlan
54
56
  label: "Later",
55
57
  horizon: "LATER"
56
58
  }
57
- ], k = (e) => e ?? "UNPLACED", A = 200, j = 2e3;
58
- function M(e, t) {
59
- let { data: n, loading: r, error: i, fetchMore: a } = v(E, {
59
+ ], j = (e) => e ?? "UNPLACED", M = 200, N = 2e3;
60
+ function P(e, t) {
61
+ let { data: n, loading: r, error: i, fetchMore: a } = b(k, {
60
62
  variables: {
61
63
  workspaceId: e ?? "",
62
64
  filter: { roadmapId: t },
63
- pagination: { first: A }
65
+ pagination: { first: M }
64
66
  },
65
67
  skip: !e || !t
66
- }), s = n?.planmagnetRoadmapItems.items ?? [], c = n?.planmagnetRoadmapItems.pageInfo.hasNextPage ?? !1, l = n?.planmagnetRoadmapItems.pageInfo.endCursor ?? null, u = n?.planmagnetRoadmapItems.totalCount ?? 0;
67
- return o(() => {
68
- !c || !l || s.length >= j || a({
68
+ }), o = n?.planmagnetRoadmapItems.items ?? [], s = n?.planmagnetRoadmapItems.pageInfo.hasNextPage ?? !1, l = n?.planmagnetRoadmapItems.pageInfo.endCursor ?? null, d = n?.planmagnetRoadmapItems.totalCount ?? 0;
69
+ c(() => {
70
+ !s || !l || o.length >= N || a({
69
71
  variables: { pagination: {
70
- first: A,
72
+ first: M,
71
73
  after: l
72
74
  } },
73
75
  updateQuery: (e, { fetchMoreResult: t }) => ({ planmagnetRoadmapItems: {
@@ -76,70 +78,77 @@ function M(e, t) {
76
78
  } })
77
79
  }).catch(() => {});
78
80
  }, [
79
- c,
81
+ s,
80
82
  l,
81
- s.length,
83
+ o.length,
82
84
  a
83
- ]), {
84
- items: s,
85
+ ]);
86
+ let f = !!n && (!s || o.length >= N), p = `${e ?? ""}:${t}`, [m, h] = u(null);
87
+ return m && m.key !== p ? h(null) : f && m?.items !== o && h({
88
+ key: p,
89
+ items: o,
90
+ totalCount: d,
91
+ truncated: s && o.length >= N
92
+ }), {
93
+ items: m && m.key === p ? m.items : o,
85
94
  loading: r && !n,
86
95
  error: i,
87
- totalCount: u,
88
- truncated: c && s.length >= j
96
+ totalCount: m && m.key === p ? m.totalCount : d,
97
+ truncated: m && m.key === p ? m.truncated : !1
89
98
  };
90
99
  }
91
- var N = (e) => e.swimlane ?? "", P = (e) => e || "Uncategorized";
92
- function F(e, t, n) {
100
+ var F = (e) => e.swimlane ?? "", I = (e) => e || "Uncategorized";
101
+ function L(e, t, n) {
93
102
  let r = e.filter((e) => e.id !== t);
94
103
  if (n === null) return r.length;
95
104
  let i = r.findIndex((e) => e.id === n);
96
105
  return i === -1 ? r.length : i;
97
106
  }
98
- var I = {
107
+ var R = {
99
108
  LOW: {
100
- Icon: h,
109
+ Icon: _,
101
110
  label: "Low risk",
102
111
  className: "text-muted-foreground"
103
112
  },
104
113
  MEDIUM: {
105
- Icon: l,
114
+ Icon: d,
106
115
  label: "Medium risk",
107
116
  className: "text-status-warning-text"
108
117
  },
109
118
  HIGH: {
110
- Icon: m,
119
+ Icon: g,
111
120
  label: "High risk",
112
121
  className: "text-status-error-text"
113
122
  }
114
123
  };
115
- function L({ level: e, note: t }) {
124
+ function z({ level: e, note: t }) {
116
125
  if (!e) return null;
117
- let n = I[e], r = /* @__PURE__ */ b("span", {
126
+ let n = R[e], r = /* @__PURE__ */ S("span", {
118
127
  "data-testid": "nnl-risk",
119
128
  className: `inline-flex items-center gap-1 text-xs ${n.className}`,
120
- children: [/* @__PURE__ */ y(n.Icon, {
129
+ children: [/* @__PURE__ */ x(n.Icon, {
121
130
  className: "h-3.5 w-3.5",
122
131
  "aria-hidden": "true"
123
132
  }), n.label]
124
133
  });
125
- return t ? /* @__PURE__ */ y(C, { children: /* @__PURE__ */ b(x, { children: [/* @__PURE__ */ y(w, {
134
+ return t ? /* @__PURE__ */ x(T, { children: /* @__PURE__ */ S(C, { children: [/* @__PURE__ */ x(E, {
126
135
  asChild: !0,
127
- children: /* @__PURE__ */ y("button", {
136
+ children: /* @__PURE__ */ x("button", {
128
137
  type: "button",
129
138
  className: "rounded focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
130
139
  children: r
131
140
  })
132
- }), /* @__PURE__ */ y(S, {
141
+ }), /* @__PURE__ */ x(w, {
133
142
  className: "max-w-xs",
134
143
  children: t
135
144
  })] }) }) : r;
136
145
  }
137
- function R({ confidence: e }) {
138
- return e === null ? null : /* @__PURE__ */ b("span", {
146
+ function B({ confidence: e }) {
147
+ return e === null ? null : /* @__PURE__ */ S("span", {
139
148
  "data-testid": "nnl-confidence",
140
149
  className: "inline-flex items-center gap-1 text-xs text-muted-foreground",
141
150
  children: [
142
- /* @__PURE__ */ y(d, {
151
+ /* @__PURE__ */ x(p, {
143
152
  className: "h-3.5 w-3.5",
144
153
  "aria-hidden": "true"
145
154
  }),
@@ -148,9 +157,9 @@ function R({ confidence: e }) {
148
157
  ]
149
158
  });
150
159
  }
151
- function z({ item: e, columnKey: t, laneItems: n, disabled: r, onMoveTo: i, onShift: a }) {
160
+ function V({ item: e, columnKey: t, laneItems: n, disabled: r, onMoveTo: i, onShift: a }) {
152
161
  let o = n.findIndex((t) => t.id === e.id), s = o > 0, c = o !== -1 && o < n.length - 1;
153
- return /* @__PURE__ */ b("select", {
162
+ return /* @__PURE__ */ S("select", {
154
163
  id: `nnl-move-${e.id}`,
155
164
  "aria-label": `Move ${e.title}`,
156
165
  "data-testid": "nnl-card-move",
@@ -162,20 +171,20 @@ function z({ item: e, columnKey: t, laneItems: n, disabled: r, onMoveTo: i, onSh
162
171
  t === "up" ? a(-1) : t === "down" ? a(1) : t && i(t);
163
172
  },
164
173
  children: [
165
- /* @__PURE__ */ y("option", {
174
+ /* @__PURE__ */ x("option", {
166
175
  value: "",
167
176
  children: "Move…"
168
177
  }),
169
- O.filter((e) => e.key !== t).map((e) => /* @__PURE__ */ b("option", {
178
+ A.filter((e) => e.key !== t).map((e) => /* @__PURE__ */ S("option", {
170
179
  value: e.key,
171
180
  children: ["Move to ", e.label]
172
181
  }, e.key)),
173
- /* @__PURE__ */ y("option", {
182
+ /* @__PURE__ */ x("option", {
174
183
  value: "up",
175
184
  disabled: !s,
176
185
  children: "Move up"
177
186
  }),
178
- /* @__PURE__ */ y("option", {
187
+ /* @__PURE__ */ x("option", {
179
188
  value: "down",
180
189
  disabled: !c,
181
190
  children: "Move down"
@@ -183,35 +192,35 @@ function z({ item: e, columnKey: t, laneItems: n, disabled: r, onMoveTo: i, onSh
183
192
  ]
184
193
  });
185
194
  }
186
- function B({ roadmapId: e, item: t, columnKey: n, laneItems: r, draggable: o, dragging: s, dropIndicator: c, moveDisabled: l, onDragStart: d, onDragEnd: f, onDragOverCard: p, onDropOnCard: m, onMoveTo: h, onShift: g }) {
195
+ function H({ roadmapId: e, item: t, columnKey: n, laneItems: r, draggable: a, dragging: o, dropIndicator: c, moveDisabled: l, onDragStart: u, onDragEnd: d, onDragOverCard: p, onDropOnCard: m, onMoveTo: h, onShift: g }) {
187
196
  let _ = t.featureRequestDemand;
188
- return /* @__PURE__ */ b("li", {
189
- draggable: o,
197
+ return /* @__PURE__ */ S("li", {
198
+ draggable: a,
190
199
  onDragStart: (e) => {
191
- e.dataTransfer.setData("text/plain", t.id), e.dataTransfer.effectAllowed = "move", d(t.id);
200
+ e.dataTransfer.setData("text/plain", t.id), e.dataTransfer.effectAllowed = "move", u(t.id);
192
201
  },
193
- onDragEnd: f,
202
+ onDragEnd: d,
194
203
  onDragOver: p,
195
204
  onDrop: m,
196
205
  "data-testid": "nnl-card",
197
206
  className: [
198
207
  "space-y-1.5 rounded-md border bg-background p-2 text-sm",
199
- o ? "cursor-grab" : "",
200
- s ? "opacity-50" : "",
208
+ a ? "cursor-grab" : "",
209
+ o ? "opacity-50" : "",
201
210
  c === "before" ? "border-t-2 border-t-primary" : "",
202
211
  c === "after" ? "border-b-2 border-b-primary" : ""
203
212
  ].filter(Boolean).join(" "),
204
213
  children: [
205
- /* @__PURE__ */ y("p", {
214
+ /* @__PURE__ */ x("p", {
206
215
  className: "font-medium leading-tight",
207
216
  children: t.title
208
217
  }),
209
- /* @__PURE__ */ b("div", {
218
+ /* @__PURE__ */ S("div", {
210
219
  className: "flex flex-wrap items-center gap-x-2 gap-y-1 text-xs text-muted-foreground",
211
- children: [/* @__PURE__ */ y("span", { children: i(t.status) }), (t.startDate || t.endDate) && /* @__PURE__ */ b("span", {
220
+ children: [/* @__PURE__ */ x("span", { children: i(t.status) }), (t.startDate || t.endDate) && /* @__PURE__ */ S("span", {
212
221
  className: "flex items-center gap-1",
213
222
  children: [
214
- /* @__PURE__ */ y(u, {
223
+ /* @__PURE__ */ x(f, {
215
224
  className: "h-3 w-3",
216
225
  "aria-hidden": "true"
217
226
  }),
@@ -221,7 +230,7 @@ function B({ roadmapId: e, item: t, columnKey: n, laneItems: r, draggable: o, dr
221
230
  ]
222
231
  })]
223
232
  }),
224
- _ && _.requests > 0 && /* @__PURE__ */ b("p", {
233
+ _ && _.requests > 0 && /* @__PURE__ */ S("p", {
225
234
  className: "text-xs text-muted-foreground",
226
235
  "data-testid": "roadmap-item-demand",
227
236
  children: [
@@ -234,20 +243,20 @@ function B({ roadmapId: e, item: t, columnKey: n, laneItems: r, draggable: o, dr
234
243
  _.votes === 1 ? "" : "s"
235
244
  ]
236
245
  }),
237
- /* @__PURE__ */ b("div", {
246
+ /* @__PURE__ */ S("div", {
238
247
  className: "flex flex-wrap items-center gap-x-3 gap-y-1",
239
- children: [/* @__PURE__ */ y(R, { confidence: t.confidence }), /* @__PURE__ */ y(L, {
248
+ children: [/* @__PURE__ */ x(B, { confidence: t.confidence }), /* @__PURE__ */ x(z, {
240
249
  level: t.riskLevel,
241
250
  note: t.riskNote
242
251
  })]
243
252
  }),
244
- /* @__PURE__ */ b("div", {
253
+ /* @__PURE__ */ S("div", {
245
254
  className: "flex items-center justify-between gap-1 pt-0.5",
246
- children: [/* @__PURE__ */ y(a, {
255
+ children: [/* @__PURE__ */ x(s, {
247
256
  roadmapId: e,
248
257
  itemId: t.id,
249
258
  itemTitle: t.title
250
- }), /* @__PURE__ */ y(z, {
259
+ }), /* @__PURE__ */ x(V, {
251
260
  item: t,
252
261
  columnKey: n,
253
262
  laneItems: r,
@@ -259,8 +268,8 @@ function B({ roadmapId: e, item: t, columnKey: n, laneItems: r, draggable: o, dr
259
268
  ]
260
269
  });
261
270
  }
262
- function V({ roadmapId: i }) {
263
- let { workspaceId: a } = e(), { items: l, loading: u, error: d, totalCount: m, truncated: h } = M(a, i), [g, v] = _(D, {
271
+ function U({ roadmapId: i }) {
272
+ let { workspaceId: s } = e(), { items: d, loading: f, error: p, totalCount: g, truncated: _ } = P(s, i), [v, b] = y(ee, {
264
273
  refetchQueries: [
265
274
  "GetRoadmapDetailPage",
266
275
  "GetRoadmapDetail",
@@ -268,156 +277,165 @@ function V({ roadmapId: i }) {
268
277
  "RoadmapNowNextLaterItems"
269
278
  ],
270
279
  awaitRefetchQueries: !0
271
- }), [x, S] = c(null), [C, w] = c(!1), [T, E] = c(""), [A, I] = c(null), [L, R] = c(null), [z, V] = c(null), H = s(() => {
280
+ }), [C, w] = u(null), [T, E] = u(!1), [O, k] = u(""), [M, R] = u(null), [z, B] = u(null), [V, U] = u(null), W = a({
281
+ kind: "roadmap",
282
+ roadmapId: i,
283
+ queries: D,
284
+ paused: M !== null
285
+ }), G = l(() => {
272
286
  let e = /* @__PURE__ */ new Set(), t = [];
273
- for (let n of l) {
274
- let r = N(n);
287
+ for (let n of d) {
288
+ let r = F(n);
275
289
  e.has(r) || (e.add(r), t.push(r));
276
290
  }
277
291
  return t;
278
- }, [l]), U = H.length > 1, W = s(() => {
292
+ }, [d]), K = G.length > 1, q = l(() => {
279
293
  let e = {
280
294
  UNPLACED: [],
281
295
  NOW: [],
282
296
  NEXT: [],
283
297
  LATER: []
284
298
  };
285
- for (let t of l) e[k(t.horizon)].push(t);
299
+ for (let t of d) e[j(t.horizon)].push(t);
286
300
  return e;
287
- }, [l]), G = s(() => {
301
+ }, [d]), J = l(() => {
288
302
  let e = {
289
303
  UNPLACED: {},
290
304
  NOW: {},
291
305
  NEXT: {},
292
306
  LATER: {}
293
307
  };
294
- for (let t of H) e.UNPLACED[t] = [], e.NOW[t] = [], e.NEXT[t] = [], e.LATER[t] = [];
295
- for (let t of l) {
296
- let n = k(t.horizon), r = N(t);
308
+ for (let t of G) e.UNPLACED[t] = [], e.NOW[t] = [], e.NEXT[t] = [], e.LATER[t] = [];
309
+ for (let t of d) {
310
+ let n = j(t.horizon), r = F(t);
297
311
  (e[n][r] ??= []).push(t);
298
312
  }
299
313
  return e;
300
- }, [l, H]);
301
- o(() => {
302
- if (!z) return;
303
- let e = z, t = requestAnimationFrame(() => {
304
- document.getElementById(`nnl-move-${e}`)?.focus(), V(null);
314
+ }, [d, G]);
315
+ c(() => {
316
+ if (!V) return;
317
+ let e = V, t = requestAnimationFrame(() => {
318
+ document.getElementById(`nnl-move-${e}`)?.focus(), U(null);
305
319
  });
306
320
  return () => cancelAnimationFrame(t);
307
- }, [l]);
308
- let K = v.loading, q = !C, J = A ? l.find((e) => e.id === A) ?? null : null, Y = async (e, i, a, o, s) => {
309
- S(null), s && V(e.id);
321
+ }, [d]);
322
+ let Y = b.loading, X = !T, Z = M ? d.find((e) => e.id === M) ?? null : null, Q = async (e, i, a, o, s) => {
323
+ w(null), s && U(e.id);
310
324
  try {
311
- await r(g({ variables: {
325
+ await r(v({ variables: {
312
326
  id: e.id,
313
327
  input: {
314
328
  horizon: i,
315
329
  index: a
316
330
  }
317
- } })), E(`Moved "${e.title}" to ${o}.`);
331
+ } })), k(`Moved "${e.title}" to ${o}.`);
318
332
  } catch (e) {
319
- if (t(e)) w(!0), S("Your role cannot reorder this roadmap."), E("Move refused: your role cannot reorder this roadmap.");
333
+ if (t(e)) E(!0), w("Your role cannot reorder this roadmap."), k("Move refused: your role cannot reorder this roadmap.");
320
334
  else {
321
335
  let t = n(e, "The item could not be moved.");
322
- S(t), E(`Move failed: ${t}`);
336
+ w(t), k(`Move failed: ${t}`);
323
337
  }
324
338
  }
325
- }, X = (e, t, n, r, i) => {
326
- if (!q || K) return;
327
- let a = l.find((e) => e.id === r);
328
- if (!a || N(a) !== t) return;
329
- let o = O.find((t) => t.key === e);
339
+ }, te = (e, t, n, r, i) => {
340
+ if (!X || Y) return;
341
+ let a = d.find((e) => e.id === r);
342
+ if (!a || F(a) !== t) return;
343
+ let o = A.find((t) => t.key === e);
330
344
  if (!o) return;
331
- let s = F(n, a.id, i);
332
- k(a.horizon) === e && n.findIndex((e) => e.id === a.id) === s || Y(a, o.horizon, s, o.label, !1);
333
- }, Z = (e, t, n) => (r, i, a) => {
334
- if (!q || K || !J || N(J) !== t) return;
345
+ let s = L(n, a.id, i);
346
+ j(a.horizon) === e && n.findIndex((e) => e.id === a.id) === s || Q(a, o.horizon, s, o.label, !1);
347
+ }, ne = (e, t, n) => (r, i, a) => {
348
+ if (!X || Y || !Z || F(Z) !== t) return;
335
349
  r.preventDefault(), r.stopPropagation(), r.dataTransfer.dropEffect = "move";
336
350
  let o = r.currentTarget.getBoundingClientRect();
337
- R({
351
+ B({
338
352
  columnKey: e,
339
353
  laneKey: t,
340
354
  beforeId: r.clientY < o.top + o.height / 2 ? i.id : n[a + 1]?.id ?? null
341
355
  });
342
- }, Q = (e, t, n) => (r) => {
356
+ }, $ = (e, t, n) => (r) => {
343
357
  r.preventDefault(), r.stopPropagation();
344
- let i = r.dataTransfer.getData("text/plain"), a = L?.columnKey === e && L.laneKey === t ? L.beforeId : null;
345
- R(null), I(null), i && X(e, t, n, i, a);
358
+ let i = r.dataTransfer.getData("text/plain"), a = z?.columnKey === e && z.laneKey === t ? z.beforeId : null;
359
+ B(null), R(null), i && te(e, t, n, i, a);
346
360
  };
347
- return u ? /* @__PURE__ */ y("div", {
361
+ return f ? /* @__PURE__ */ x("div", {
348
362
  className: "flex items-center justify-center p-12",
349
363
  "data-testid": "nnl-board",
350
- children: /* @__PURE__ */ y(p, {
364
+ children: /* @__PURE__ */ x(h, {
351
365
  className: "h-8 w-8 animate-spin text-muted-foreground",
352
366
  "aria-hidden": "true"
353
367
  })
354
- }) : d ? /* @__PURE__ */ b("div", {
368
+ }) : p ? /* @__PURE__ */ S("div", {
355
369
  className: "p-6 text-destructive",
356
370
  "data-testid": "nnl-board",
357
- children: ["Failed to load roadmap items: ", d.message]
358
- }) : /* @__PURE__ */ b("div", {
371
+ children: ["Failed to load roadmap items: ", p.message]
372
+ }) : /* @__PURE__ */ S("div", {
359
373
  className: "space-y-3",
360
374
  "data-testid": "nnl-board",
361
375
  children: [
362
- /* @__PURE__ */ y("p", {
376
+ /* @__PURE__ */ x("p", {
363
377
  className: "sr-only",
364
378
  role: "status",
365
379
  "aria-live": "polite",
366
- children: T
380
+ children: O
367
381
  }),
368
- C && /* @__PURE__ */ y("p", {
382
+ /* @__PURE__ */ x("div", {
383
+ className: "flex justify-end",
384
+ children: /* @__PURE__ */ x(o, { mode: W.mode })
385
+ }),
386
+ T && /* @__PURE__ */ x("p", {
369
387
  role: "alert",
370
388
  className: "rounded-md border border-destructive/40 p-2 text-sm text-destructive",
371
389
  children: "Your role can view this roadmap but not reorder it. Moves are disabled below."
372
390
  }),
373
- !C && x && /* @__PURE__ */ y("p", {
391
+ !T && C && /* @__PURE__ */ x("p", {
374
392
  role: "alert",
375
393
  className: "rounded-md border border-destructive/40 p-2 text-sm text-destructive",
376
- children: x
394
+ children: C
377
395
  }),
378
- h && /* @__PURE__ */ b("p", {
396
+ _ && /* @__PURE__ */ S("p", {
379
397
  className: "text-xs text-muted-foreground",
380
398
  children: [
381
399
  "Showing the first ",
382
- j,
400
+ N,
383
401
  " of ",
384
- m,
402
+ g,
385
403
  " items."
386
404
  ]
387
405
  }),
388
- /* @__PURE__ */ y("div", {
406
+ /* @__PURE__ */ x("div", {
389
407
  className: "grid grid-cols-1 gap-3 md:grid-cols-4",
390
- children: O.map((e) => {
391
- let t = W[e.key], n = H.map((t) => ({
408
+ children: A.map((e) => {
409
+ let t = q[e.key], n = G.map((t) => ({
392
410
  lane: t,
393
- laneItems: G[e.key][t] ?? []
394
- })).filter(({ lane: e, laneItems: t }) => !U || t.length > 0 || J && N(J) === e);
395
- return /* @__PURE__ */ b("section", {
411
+ laneItems: J[e.key][t] ?? []
412
+ })).filter(({ lane: e, laneItems: t }) => !K || t.length > 0 || Z && F(Z) === e);
413
+ return /* @__PURE__ */ S("section", {
396
414
  "aria-label": `${e.label} column`,
397
415
  "data-testid": `nnl-column-${e.key}`,
398
416
  className: "min-h-[120px] rounded-md border bg-muted/30 p-2",
399
417
  onDragOver: (t) => {
400
- !q || K || !J || (t.preventDefault(), t.dataTransfer.dropEffect = "move", R({
418
+ !X || Y || !Z || (t.preventDefault(), t.dataTransfer.dropEffect = "move", B({
401
419
  columnKey: e.key,
402
- laneKey: N(J),
420
+ laneKey: F(Z),
403
421
  beforeId: null
404
422
  }));
405
423
  },
406
424
  onDrop: (t) => {
407
- if (!J) return;
408
- let n = N(J);
409
- Q(e.key, n, G[e.key][n] ?? [])(t);
425
+ if (!Z) return;
426
+ let n = F(Z);
427
+ $(e.key, n, J[e.key][n] ?? [])(t);
410
428
  },
411
429
  children: [
412
- /* @__PURE__ */ b("h3", {
430
+ /* @__PURE__ */ S("h3", {
413
431
  className: "mb-2 flex items-center gap-1.5 text-sm font-medium",
414
432
  children: [
415
- e.key === "UNPLACED" && /* @__PURE__ */ y(f, {
433
+ e.key === "UNPLACED" && /* @__PURE__ */ x(m, {
416
434
  className: "h-3.5 w-3.5 text-muted-foreground",
417
435
  "aria-hidden": "true"
418
436
  }),
419
437
  e.label,
420
- /* @__PURE__ */ b("span", {
438
+ /* @__PURE__ */ S("span", {
421
439
  className: "text-xs text-muted-foreground",
422
440
  children: [
423
441
  "(",
@@ -427,23 +445,23 @@ function V({ roadmapId: i }) {
427
445
  })
428
446
  ]
429
447
  }),
430
- n.length === 0 && /* @__PURE__ */ y("p", {
448
+ n.length === 0 && /* @__PURE__ */ x("p", {
431
449
  className: "py-4 text-center text-xs text-muted-foreground",
432
450
  children: "No items"
433
451
  }),
434
- /* @__PURE__ */ y("div", {
452
+ /* @__PURE__ */ x("div", {
435
453
  className: "space-y-3",
436
454
  children: n.map(({ lane: t, laneItems: n }) => {
437
- let r = L?.columnKey === e.key && L.laneKey === t;
438
- return /* @__PURE__ */ b("div", {
455
+ let r = z?.columnKey === e.key && z.laneKey === t;
456
+ return /* @__PURE__ */ S("div", {
439
457
  className: "space-y-1",
440
- children: [U && /* @__PURE__ */ b("p", {
458
+ children: [K && /* @__PURE__ */ S("p", {
441
459
  "data-testid": "nnl-lane-label",
442
460
  className: "text-[11px] font-medium text-muted-foreground",
443
461
  children: [
444
- P(t),
462
+ I(t),
445
463
  " ",
446
- /* @__PURE__ */ b("span", {
464
+ /* @__PURE__ */ S("span", {
447
465
  className: "text-muted-foreground/70",
448
466
  children: [
449
467
  "(",
@@ -452,46 +470,46 @@ function V({ roadmapId: i }) {
452
470
  ]
453
471
  })
454
472
  ]
455
- }), /* @__PURE__ */ b("ul", {
456
- className: `min-h-[48px] space-y-2 rounded-sm p-1 ${r && !L.beforeId ? "ring-2 ring-primary" : ""}`,
473
+ }), /* @__PURE__ */ S("ul", {
474
+ className: `min-h-[48px] space-y-2 rounded-sm p-1 ${r && !z.beforeId ? "ring-2 ring-primary" : ""}`,
457
475
  onDragOver: (n) => {
458
- !q || K || !J || N(J) !== t || (n.preventDefault(), n.dataTransfer.dropEffect = "move", R({
476
+ !X || Y || !Z || F(Z) !== t || (n.preventDefault(), n.dataTransfer.dropEffect = "move", B({
459
477
  columnKey: e.key,
460
478
  laneKey: t,
461
479
  beforeId: null
462
480
  }));
463
481
  },
464
- onDrop: Q(e.key, t, n),
465
- children: [n.length === 0 && /* @__PURE__ */ y("li", {
482
+ onDrop: $(e.key, t, n),
483
+ children: [n.length === 0 && /* @__PURE__ */ x("li", {
466
484
  className: "py-2 text-center text-[11px] text-muted-foreground",
467
485
  "aria-hidden": "true",
468
486
  children: "Drop here"
469
487
  }), n.map((a, o) => {
470
- let s = r ? L.beforeId === a.id ? "before" : L.beforeId === null && o === n.length - 1 ? "after" : null : null;
471
- return /* @__PURE__ */ y(B, {
488
+ let s = r ? z.beforeId === a.id ? "before" : z.beforeId === null && o === n.length - 1 ? "after" : null : null;
489
+ return /* @__PURE__ */ x(H, {
472
490
  roadmapId: i,
473
491
  item: a,
474
492
  columnKey: e.key,
475
493
  laneItems: n,
476
- draggable: q && !K,
477
- dragging: A === a.id,
494
+ draggable: X && !Y,
495
+ dragging: M === a.id,
478
496
  dropIndicator: s,
479
- moveDisabled: !q || K,
480
- onDragStart: I,
497
+ moveDisabled: !X || Y,
498
+ onDragStart: R,
481
499
  onDragEnd: () => {
482
- I(null), R(null);
500
+ R(null), B(null);
483
501
  },
484
- onDragOverCard: (r) => Z(e.key, t, n)(r, a, o),
485
- onDropOnCard: Q(e.key, t, n),
502
+ onDragOverCard: (r) => ne(e.key, t, n)(r, a, o),
503
+ onDropOnCard: $(e.key, t, n),
486
504
  onMoveTo: (e) => {
487
- let t = O.find((t) => t.key === e);
505
+ let t = A.find((t) => t.key === e);
488
506
  if (!t) return;
489
- let n = F(G[e][N(a)] ?? [], a.id, null);
490
- Y(a, t.horizon, n, t.label, !0);
507
+ let n = L(J[e][F(a)] ?? [], a.id, null);
508
+ Q(a, t.horizon, n, t.label, !0);
491
509
  },
492
510
  onShift: (t) => {
493
511
  let r = n.findIndex((e) => e.id === a.id), i = r + t;
494
- r === -1 || i < 0 || i >= n.length || Y(a, a.horizon, i, e.label, !0);
512
+ r === -1 || i < 0 || i >= n.length || Q(a, a.horizon, i, e.label, !0);
495
513
  }
496
514
  }, a.id);
497
515
  })]
@@ -507,6 +525,6 @@ function V({ roadmapId: i }) {
507
525
  });
508
526
  }
509
527
  //#endregion
510
- export { R as ConfidenceBadge, L as RiskIndicator, V as RoadmapNowNextLater };
528
+ export { B as ConfidenceBadge, z as RiskIndicator, U as RoadmapNowNextLater };
511
529
 
512
530
  //# sourceMappingURL=RoadmapNowNextLater.js.map