@burdenoff/microfe-planmagnet 2026.927.2 → 2026.927.4

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 (106) hide show
  1. package/dist/planmagnet/admin/PlanMagnetAdminRoot.d.ts.map +1 -1
  2. package/dist/planmagnet/admin/PlanMagnetAdminRoot.js +128 -124
  3. package/dist/planmagnet/admin/PlanMagnetAdminRoot.js.map +1 -1
  4. package/dist/planmagnet/controls/ConfirmButton.d.ts +25 -0
  5. package/dist/planmagnet/controls/ConfirmButton.d.ts.map +1 -0
  6. package/dist/planmagnet/controls/ConfirmButton.js +30 -0
  7. package/dist/planmagnet/controls/ConfirmButton.js.map +1 -0
  8. package/dist/planmagnet/controls/FeatureControls.d.ts +26 -0
  9. package/dist/planmagnet/controls/FeatureControls.d.ts.map +1 -0
  10. package/dist/planmagnet/controls/FeatureControls.js +318 -0
  11. package/dist/planmagnet/controls/FeatureControls.js.map +1 -0
  12. package/dist/planmagnet/controls/MilestoneControls.d.ts +17 -0
  13. package/dist/planmagnet/controls/MilestoneControls.d.ts.map +1 -0
  14. package/dist/planmagnet/controls/MilestoneControls.js +200 -0
  15. package/dist/planmagnet/controls/MilestoneControls.js.map +1 -0
  16. package/dist/planmagnet/controls/ObjectiveControls.d.ts +31 -0
  17. package/dist/planmagnet/controls/ObjectiveControls.d.ts.map +1 -0
  18. package/dist/planmagnet/controls/ObjectiveControls.js +296 -0
  19. package/dist/planmagnet/controls/ObjectiveControls.js.map +1 -0
  20. package/dist/planmagnet/controls/Pickers.d.ts +26 -0
  21. package/dist/planmagnet/controls/Pickers.d.ts.map +1 -0
  22. package/dist/planmagnet/controls/Pickers.js +171 -0
  23. package/dist/planmagnet/controls/Pickers.js.map +1 -0
  24. package/dist/planmagnet/controls/ProjectControls.d.ts +13 -0
  25. package/dist/planmagnet/controls/ProjectControls.d.ts.map +1 -0
  26. package/dist/planmagnet/controls/ProjectControls.js +104 -0
  27. package/dist/planmagnet/controls/ProjectControls.js.map +1 -0
  28. package/dist/planmagnet/controls/ReleaseControls.d.ts +14 -0
  29. package/dist/planmagnet/controls/ReleaseControls.d.ts.map +1 -0
  30. package/dist/planmagnet/controls/ReleaseControls.js +108 -0
  31. package/dist/planmagnet/controls/ReleaseControls.js.map +1 -0
  32. package/dist/planmagnet/controls/WorkItemControls.d.ts +52 -0
  33. package/dist/planmagnet/controls/WorkItemControls.d.ts.map +1 -0
  34. package/dist/planmagnet/controls/WorkItemControls.js +198 -0
  35. package/dist/planmagnet/controls/WorkItemControls.js.map +1 -0
  36. package/dist/planmagnet/pages/DocsDocDetailPagePage.d.ts.map +1 -1
  37. package/dist/planmagnet/pages/DocsDocDetailPagePage.js +188 -154
  38. package/dist/planmagnet/pages/DocsDocDetailPagePage.js.map +1 -1
  39. package/dist/planmagnet/pages/DocsDocsPagePage.js +4 -4
  40. package/dist/planmagnet/pages/GoalsCreateObjectivePagePage.d.ts.map +1 -1
  41. package/dist/planmagnet/pages/GoalsCreateObjectivePagePage.js +63 -56
  42. package/dist/planmagnet/pages/GoalsCreateObjectivePagePage.js.map +1 -1
  43. package/dist/planmagnet/pages/GoalsObjectiveDetailPagePage.d.ts.map +1 -1
  44. package/dist/planmagnet/pages/GoalsObjectiveDetailPagePage.js +229 -214
  45. package/dist/planmagnet/pages/GoalsObjectiveDetailPagePage.js.map +1 -1
  46. package/dist/planmagnet/pages/ProductsEditProductPagePage.d.ts.map +1 -1
  47. package/dist/planmagnet/pages/ProductsEditProductPagePage.js +142 -114
  48. package/dist/planmagnet/pages/ProductsEditProductPagePage.js.map +1 -1
  49. package/dist/planmagnet/pages/ProductsEditReleasePagePage.d.ts.map +1 -1
  50. package/dist/planmagnet/pages/ProductsEditReleasePagePage.js +134 -105
  51. package/dist/planmagnet/pages/ProductsEditReleasePagePage.js.map +1 -1
  52. package/dist/planmagnet/pages/ProductsFeatureDetailPagePage.d.ts.map +1 -1
  53. package/dist/planmagnet/pages/ProductsFeatureDetailPagePage.js +102 -108
  54. package/dist/planmagnet/pages/ProductsFeatureDetailPagePage.js.map +1 -1
  55. package/dist/planmagnet/pages/ProductsNewFeaturePagePage.d.ts.map +1 -1
  56. package/dist/planmagnet/pages/ProductsNewFeaturePagePage.js +119 -94
  57. package/dist/planmagnet/pages/ProductsNewFeaturePagePage.js.map +1 -1
  58. package/dist/planmagnet/pages/ProductsProductDetailPagePage.d.ts.map +1 -1
  59. package/dist/planmagnet/pages/ProductsProductDetailPagePage.js +97 -90
  60. package/dist/planmagnet/pages/ProductsProductDetailPagePage.js.map +1 -1
  61. package/dist/planmagnet/pages/ProductsReleaseDetailPagePage.d.ts.map +1 -1
  62. package/dist/planmagnet/pages/ProductsReleaseDetailPagePage.js +107 -106
  63. package/dist/planmagnet/pages/ProductsReleaseDetailPagePage.js.map +1 -1
  64. package/dist/planmagnet/pages/ProductsReleasesPagePage.d.ts.map +1 -1
  65. package/dist/planmagnet/pages/ProductsReleasesPagePage.js +2 -0
  66. package/dist/planmagnet/pages/ProductsReleasesPagePage.js.map +1 -1
  67. package/dist/planmagnet/pages/ProductsRoadmapDetailPagePage.d.ts.map +1 -1
  68. package/dist/planmagnet/pages/ProductsRoadmapDetailPagePage.js +150 -111
  69. package/dist/planmagnet/pages/ProductsRoadmapDetailPagePage.js.map +1 -1
  70. package/dist/planmagnet/pages/ProjectsEditProjectPagePage.d.ts.map +1 -1
  71. package/dist/planmagnet/pages/ProjectsEditProjectPagePage.js +116 -93
  72. package/dist/planmagnet/pages/ProjectsEditProjectPagePage.js.map +1 -1
  73. package/dist/planmagnet/pages/ProjectsMilestoneDetailPagePage.d.ts.map +1 -1
  74. package/dist/planmagnet/pages/ProjectsMilestoneDetailPagePage.js +55 -63
  75. package/dist/planmagnet/pages/ProjectsMilestoneDetailPagePage.js.map +1 -1
  76. package/dist/planmagnet/pages/ProjectsPlanningEditPagePage.js +4 -4
  77. package/dist/planmagnet/pages/ProjectsProjectDetailPagePage.d.ts.map +1 -1
  78. package/dist/planmagnet/pages/ProjectsProjectDetailPagePage.js +134 -132
  79. package/dist/planmagnet/pages/ProjectsProjectDetailPagePage.js.map +1 -1
  80. package/dist/planmagnet/pages/SprintsStartSprintPagePage.d.ts.map +1 -1
  81. package/dist/planmagnet/pages/SprintsStartSprintPagePage.js +6 -5
  82. package/dist/planmagnet/pages/SprintsStartSprintPagePage.js.map +1 -1
  83. package/dist/planmagnet/pages/TasksCreateTaskPagePage.d.ts.map +1 -1
  84. package/dist/planmagnet/pages/TasksCreateTaskPagePage.js +167 -116
  85. package/dist/planmagnet/pages/TasksCreateTaskPagePage.js.map +1 -1
  86. package/dist/planmagnet/pages/TasksEditTaskPagePage.d.ts.map +1 -1
  87. package/dist/planmagnet/pages/TasksEditTaskPagePage.js +139 -107
  88. package/dist/planmagnet/pages/TasksEditTaskPagePage.js.map +1 -1
  89. package/dist/planmagnet/pages/TasksTaskDetailPagePage.d.ts.map +1 -1
  90. package/dist/planmagnet/pages/TasksTaskDetailPagePage.js +205 -158
  91. package/dist/planmagnet/pages/TasksTaskDetailPagePage.js.map +1 -1
  92. package/dist/planmagnet/pages/TasksTasksPagePage.d.ts.map +1 -1
  93. package/dist/planmagnet/pages/TasksTasksPagePage.js +1 -0
  94. package/dist/planmagnet/pages/TasksTasksPagePage.js.map +1 -1
  95. package/dist/planmagnet/pages/TeamTeamPagePage.d.ts.map +1 -1
  96. package/dist/planmagnet/pages/TeamTeamPagePage.js +1 -1
  97. package/dist/planmagnet/pages/TeamTeamPagePage.js.map +1 -1
  98. package/dist/planmagnet/people/People.js +1 -1
  99. package/dist/planmagnet/roadmaps/RoadmapControls.d.ts +34 -0
  100. package/dist/planmagnet/roadmaps/RoadmapControls.d.ts.map +1 -0
  101. package/dist/planmagnet/roadmaps/RoadmapControls.js +301 -0
  102. package/dist/planmagnet/roadmaps/RoadmapControls.js.map +1 -0
  103. package/dist/planmagnet/sprints/SprintControls.d.ts.map +1 -1
  104. package/dist/planmagnet/sprints/SprintControls.js +194 -215
  105. package/dist/planmagnet/sprints/SprintControls.js.map +1 -1
  106. package/package.json +1 -1
@@ -1,19 +1,20 @@
1
1
  import { usePlanMagnetNavigate as e } from "../providers/PlanMagnetProvider.js";
2
2
  import { PersonName as t } from "../people/People.js";
3
- import { MarkdownEditor as n } from "../../components/MarkdownEditor.js";
4
- import { throwOnError as ee } from "../utils/mutationResult.js";
5
- import { DOC_STATUSES as te, DocStatusBadge as ne } from "../docs/DocStatusBadge.js";
6
- import { useState as r } from "react";
7
- import { ArrowLeft as re, History as ie, Link2 as ae, X as oe } from "lucide-react";
8
- import { useSearchParams as se } from "react-router";
9
- import { gql as i } from "@apollo/client";
10
- import { useApolloClient as ce, useMutation as a, useQuery as le } from "@apollo/client/react";
11
- import { jsx as o, jsxs as s } from "react/jsx-runtime";
12
- import { AlertDialog as c, AlertDialogAction as l, AlertDialogCancel as u, AlertDialogContent as d, AlertDialogDescription as f, AlertDialogFooter as p, AlertDialogHeader as m, AlertDialogTitle as h, AlertDialogTrigger as g, Button as _, Card as v, CardContent as y, CardHeader as b, CardTitle as x, Input as S } from "@burdenoff/fe-libs/ui";
13
- import { Markdown as C } from "@burdenoff/fe-libs/shared/components";
14
- import { clearGraphqlFetchResponseCache as ue } from "@burdenoff/fe-libs/shared/graphql";
3
+ import { throwOnError as n } from "../utils/mutationResult.js";
4
+ import { WorkItemSearchSelect as ee } from "../controls/Pickers.js";
5
+ import { MarkdownEditor as te } from "../../components/MarkdownEditor.js";
6
+ import { DOC_STATUSES as ne, DocStatusBadge as r } from "../docs/DocStatusBadge.js";
7
+ import { useState as i } from "react";
8
+ import { ArrowLeft as re, History as ie, Link2 as a, X as ae } from "lucide-react";
9
+ import { useSearchParams as oe } from "react-router";
10
+ import { gql as o } from "@apollo/client";
11
+ import { useApolloClient as se, useMutation as s, useQuery as ce } from "@apollo/client/react";
12
+ import { jsx as c, jsxs as l } from "react/jsx-runtime";
13
+ import { AlertDialog as u, AlertDialogAction as d, AlertDialogCancel as f, AlertDialogContent as p, AlertDialogDescription as m, AlertDialogFooter as h, AlertDialogHeader as g, AlertDialogTitle as _, AlertDialogTrigger as v, Button as y, Card as b, CardContent as x, CardHeader as S, CardTitle as C, Input as w } from "@burdenoff/fe-libs/ui";
14
+ import { Markdown as T } from "@burdenoff/fe-libs/shared/components";
15
+ import { clearGraphqlFetchResponseCache as le } from "@burdenoff/fe-libs/shared/graphql";
15
16
  //#region src/planmagnet/pages/DocsDocDetailPagePage.tsx
16
- var w = i`
17
+ var E = o`
17
18
  query DocDetail($id: ID!) {
18
19
  planmagnetDoc(id: $id) {
19
20
  id
@@ -41,7 +42,7 @@ var w = i`
41
42
  }
42
43
  }
43
44
  }
44
- `, T = i`
45
+ `, ue = o`
45
46
  mutation DocUpdate($id: ID!, $input: PlanmagnetUpdateDocInput!) {
46
47
  planmagnetUpdateDoc(id: $id, input: $input) {
47
48
  id
@@ -49,119 +50,128 @@ var w = i`
49
50
  status
50
51
  }
51
52
  }
52
- `, E = i`
53
+ `, de = o`
53
54
  mutation DocRevert($id: ID!, $toVersion: Int!, $expectedVersion: Int) {
54
55
  planmagnetRevertDoc(id: $id, toVersion: $toVersion, expectedVersion: $expectedVersion) {
55
56
  id
56
57
  version
57
58
  }
58
59
  }
59
- `, D = i`
60
+ `, fe = o`
60
61
  mutation DocDelete($id: ID!) {
61
62
  planmagnetDeleteDoc(id: $id)
62
63
  }
63
- `, de = i`
64
+ `, pe = o`
65
+ mutation DocLinkWorkItem($docId: ID!, $workItemId: ID!) {
66
+ planmagnetLinkDocToWorkItem(docId: $docId, workItemId: $workItemId) {
67
+ id
68
+ }
69
+ }
70
+ `, me = o`
64
71
  mutation DocUnlinkWorkItem($docId: ID!, $workItemId: ID!) {
65
72
  planmagnetUnlinkDocFromWorkItem(docId: $docId, workItemId: $workItemId)
66
73
  }
67
- `, O = (e, t) => e instanceof Error ? e.message : t, k = (e) => new Date(e).toLocaleString();
68
- function A() {
69
- let [i] = se(), A = i.get("docId") ?? "", j = e(), [M, N] = r(!1), [P, F] = r(""), [I, L] = r(""), [R, z] = r(""), [B, V] = r(null), [H, fe] = r(null), [U, pe] = r(null), { data: W, loading: me, error: G } = le(w, {
70
- variables: { id: A },
71
- skip: !A,
74
+ `, he = (e, t) => e instanceof Error ? e.message : t, D = (e) => new Date(e).toLocaleString();
75
+ function O() {
76
+ let [o] = oe(), O = o.get("docId") ?? "", k = e(), [A, j] = i(!1), [M, N] = i(""), [P, F] = i(""), [I, L] = i(""), [R, z] = i(null), [B, ge] = i(null), [V, _e] = i(null), { data: H, loading: ve, error: U } = ce(E, {
77
+ variables: { id: O },
78
+ skip: !O,
72
79
  fetchPolicy: "cache-and-network"
73
- }), he = ce(), K = {
80
+ }), ye = se(), W = {
74
81
  refetchQueries: ["DocDetail"],
75
82
  awaitRefetchQueries: !0
76
- }, [q, J] = a(T, K), [ge, _e] = a(E, K), [ve, ye] = a(D, { refetchQueries: ["DocsList"] }), [be, xe] = a(de, K), Y = W?.planmagnetDoc, X = J.loading || _e.loading || ye.loading, Z = async (e, t) => {
77
- V(null);
83
+ }, [G, K] = s(ue, W), [be, xe] = s(de, W), [Se, Ce] = s(fe, { refetchQueries: ["DocsList"] }), [we, Te] = s(me, W), [Ee, De] = s(pe, {
84
+ ...W,
85
+ refetchQueries: ["DocDetail", "GetWorkItemDocs"]
86
+ }), [q, J] = i(""), Y = H?.planmagnetDoc, X = K.loading || xe.loading || Ce.loading, Z = async (e, t) => {
87
+ z(null);
78
88
  try {
79
- return await ee(e()), !0;
89
+ return await n(e()), !0;
80
90
  } catch (e) {
81
- return V(O(e, t)), ue(), await he.query({
82
- query: w,
83
- variables: { id: A },
91
+ return z(he(e, t)), le(), await ye.query({
92
+ query: E,
93
+ variables: { id: O },
84
94
  fetchPolicy: "network-only"
85
95
  }).catch(() => void 0), !1;
86
96
  }
87
97
  };
88
- if (!A) return /* @__PURE__ */ o("div", {
98
+ if (!O) return /* @__PURE__ */ c("div", {
89
99
  className: "p-6 text-sm text-muted-foreground",
90
100
  children: "No doc selected."
91
101
  });
92
- if (me && !W) return /* @__PURE__ */ o("div", {
102
+ if (ve && !H) return /* @__PURE__ */ c("div", {
93
103
  className: "p-6 text-sm text-muted-foreground",
94
104
  children: "Loading doc…"
95
105
  });
96
- if (G && !Y) return /* @__PURE__ */ s("p", {
106
+ if (U && !Y) return /* @__PURE__ */ l("p", {
97
107
  role: "alert",
98
108
  className: "p-6 text-sm text-destructive",
99
- children: ["The doc could not be loaded: ", G.message]
109
+ children: ["The doc could not be loaded: ", U.message]
100
110
  });
101
- if (!Y) return /* @__PURE__ */ s("div", {
111
+ if (!Y) return /* @__PURE__ */ l("div", {
102
112
  className: "space-y-3 p-6",
103
- children: [/* @__PURE__ */ o("p", {
113
+ children: [/* @__PURE__ */ c("p", {
104
114
  className: "text-sm text-muted-foreground",
105
115
  children: "This doc does not exist in this workspace, or it was deleted."
106
- }), /* @__PURE__ */ o(_, {
116
+ }), /* @__PURE__ */ c(y, {
107
117
  size: "sm",
108
118
  variant: "outline",
109
- onClick: () => j("/docs/docs-page"),
119
+ onClick: () => k("/docs/docs-page"),
110
120
  children: "Back to docs"
111
121
  })]
112
122
  });
113
- let Se = () => {
114
- F(Y.title), L(Y.content), z(""), V(null), pe(Y.version), N(!0);
115
- }, Ce = async () => {
116
- await Z(() => q({ variables: {
123
+ let Oe = () => {
124
+ N(Y.title), F(Y.content), L(""), z(null), _e(Y.version), j(!0);
125
+ }, ke = async () => {
126
+ await Z(() => G({ variables: {
117
127
  id: Y.id,
118
128
  input: {
119
- title: P.trim(),
120
- content: I,
121
- ...R.trim() ? { changeNote: R.trim() } : {},
122
- expectedVersion: U
129
+ title: M.trim(),
130
+ content: P,
131
+ ...I.trim() ? { changeNote: I.trim() } : {},
132
+ expectedVersion: V
123
133
  }
124
- } }), "The doc could not be saved.") && N(!1);
125
- }, Q = [...Y.revisions].sort((e, t) => t.version - e.version), $ = H === null ? null : Q.find((e) => e.version === H);
126
- return /* @__PURE__ */ s("div", {
134
+ } }), "The doc could not be saved.") && j(!1);
135
+ }, Q = [...Y.revisions].sort((e, t) => t.version - e.version), $ = B === null ? null : Q.find((e) => e.version === B);
136
+ return /* @__PURE__ */ l("div", {
127
137
  className: "space-y-6 p-6",
128
138
  "data-testid": "doc-detail",
129
139
  children: [
130
- /* @__PURE__ */ s(_, {
140
+ /* @__PURE__ */ l(y, {
131
141
  size: "sm",
132
142
  variant: "ghost",
133
- onClick: () => j("/docs/docs-page"),
134
- children: [/* @__PURE__ */ o(re, { className: "mr-1 h-4 w-4" }), "All docs"]
143
+ onClick: () => k("/docs/docs-page"),
144
+ children: [/* @__PURE__ */ c(re, { className: "mr-1 h-4 w-4" }), "All docs"]
135
145
  }),
136
- /* @__PURE__ */ s("div", {
146
+ /* @__PURE__ */ l("div", {
137
147
  className: "flex flex-wrap items-start justify-between gap-3",
138
- children: [/* @__PURE__ */ s("div", {
148
+ children: [/* @__PURE__ */ l("div", {
139
149
  className: "min-w-0 space-y-1",
140
- children: [/* @__PURE__ */ o("h1", {
150
+ children: [/* @__PURE__ */ c("h1", {
141
151
  className: "text-2xl font-semibold break-words",
142
152
  "data-testid": "doc-title",
143
153
  children: Y.title
144
- }), /* @__PURE__ */ s("p", {
154
+ }), /* @__PURE__ */ l("p", {
145
155
  className: "text-xs text-muted-foreground",
146
156
  children: [
147
- /* @__PURE__ */ o(ne, { status: Y.status }),
157
+ /* @__PURE__ */ c(r, { status: Y.status }),
148
158
  " · version ",
149
159
  Y.version,
150
160
  " · updated",
151
161
  " ",
152
- k(Y.updatedAt),
162
+ D(Y.updatedAt),
153
163
  " by ",
154
- /* @__PURE__ */ o(t, { id: Y.updatedBy ?? Y.createdBy })
164
+ /* @__PURE__ */ c(t, { id: Y.updatedBy ?? Y.createdBy })
155
165
  ]
156
166
  })]
157
- }), !M && /* @__PURE__ */ s("div", {
167
+ }), !A && /* @__PURE__ */ l("div", {
158
168
  className: "flex flex-wrap gap-2",
159
169
  children: [
160
- te.filter((e) => e !== Y.status).map((e) => /* @__PURE__ */ o(_, {
170
+ ne.filter((e) => e !== Y.status).map((e) => /* @__PURE__ */ c(y, {
161
171
  size: "sm",
162
172
  variant: "outline",
163
173
  disabled: X,
164
- onClick: () => Z(() => q({ variables: {
174
+ onClick: () => Z(() => G({ variables: {
165
175
  id: Y.id,
166
176
  input: {
167
177
  status: e,
@@ -170,144 +180,144 @@ function A() {
170
180
  } }), "The status could not be changed."),
171
181
  children: e === "PUBLISHED" ? "Publish" : e === "ARCHIVED" ? "Archive" : "Back to draft"
172
182
  }, e)),
173
- /* @__PURE__ */ o(_, {
183
+ /* @__PURE__ */ c(y, {
174
184
  size: "sm",
175
- onClick: Se,
185
+ onClick: Oe,
176
186
  "data-testid": "doc-edit",
177
187
  children: "Edit"
178
188
  }),
179
- /* @__PURE__ */ s(c, { children: [/* @__PURE__ */ o(g, {
189
+ /* @__PURE__ */ l(u, { children: [/* @__PURE__ */ c(v, {
180
190
  asChild: !0,
181
- children: /* @__PURE__ */ o(_, {
191
+ children: /* @__PURE__ */ c(y, {
182
192
  size: "sm",
183
193
  variant: "outline",
184
194
  disabled: X,
185
195
  children: "Delete"
186
196
  })
187
- }), /* @__PURE__ */ s(d, { children: [/* @__PURE__ */ s(m, { children: [/* @__PURE__ */ s(h, { children: [
197
+ }), /* @__PURE__ */ l(p, { children: [/* @__PURE__ */ l(g, { children: [/* @__PURE__ */ l(_, { children: [
188
198
  "Delete “",
189
199
  Y.title,
190
200
  "”?"
191
- ] }), /* @__PURE__ */ s(f, { children: [
201
+ ] }), /* @__PURE__ */ l(m, { children: [
192
202
  "The doc and its history are removed for everyone, and it is unlinked from",
193
203
  " ",
194
204
  Y.linkedWorkItems.length,
195
205
  " work item",
196
206
  Y.linkedWorkItems.length === 1 ? "" : "s",
197
207
  "."
198
- ] })] }), /* @__PURE__ */ s(p, { children: [/* @__PURE__ */ o(u, { children: "Keep it" }), /* @__PURE__ */ o(l, {
208
+ ] })] }), /* @__PURE__ */ l(h, { children: [/* @__PURE__ */ c(f, { children: "Keep it" }), /* @__PURE__ */ c(d, {
199
209
  className: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
200
210
  onClick: async () => {
201
- await Z(() => ve({ variables: { id: Y.id } }), "The doc could not be deleted.") && j("/docs/docs-page");
211
+ await Z(() => Se({ variables: { id: Y.id } }), "The doc could not be deleted.") && k("/docs/docs-page");
202
212
  },
203
213
  children: "Delete"
204
214
  })] })] })] })
205
215
  ]
206
216
  })]
207
217
  }),
208
- B && /* @__PURE__ */ o("p", {
218
+ R && /* @__PURE__ */ c("p", {
209
219
  role: "alert",
210
220
  className: "text-sm text-destructive",
211
221
  "data-testid": "doc-error",
212
- children: B
222
+ children: R
213
223
  }),
214
- M && U !== Y.version && /* @__PURE__ */ s("p", {
224
+ A && V !== Y.version && /* @__PURE__ */ l("p", {
215
225
  className: "text-sm text-status-warning-text",
216
226
  "data-testid": "doc-moved-on",
217
227
  children: [
218
228
  "Someone saved version ",
219
229
  Y.version,
220
230
  " after you started editing version ",
221
- U,
231
+ V,
222
232
  ". Your text is kept below; copy what you need, then discard and edit the latest."
223
233
  ]
224
234
  }),
225
- M ? /* @__PURE__ */ o(v, { children: /* @__PURE__ */ s(y, {
235
+ A ? /* @__PURE__ */ c(b, { children: /* @__PURE__ */ l(x, {
226
236
  className: "space-y-3 pt-6",
227
237
  children: [
228
- /* @__PURE__ */ o(S, {
238
+ /* @__PURE__ */ c(w, {
229
239
  "aria-label": "Doc title",
230
- value: P,
231
- onChange: (e) => F(e.target.value)
240
+ value: M,
241
+ onChange: (e) => N(e.target.value)
232
242
  }),
233
- /* @__PURE__ */ o(n, {
234
- value: I,
235
- onChange: L,
243
+ /* @__PURE__ */ c(te, {
244
+ value: P,
245
+ onChange: F,
236
246
  minHeight: 240
237
247
  }),
238
- /* @__PURE__ */ o(S, {
248
+ /* @__PURE__ */ c(w, {
239
249
  "aria-label": "Change note",
240
250
  placeholder: "What changed? (optional, shown in the history)",
241
- value: R,
242
- onChange: (e) => z(e.target.value)
251
+ value: I,
252
+ onChange: (e) => L(e.target.value)
243
253
  }),
244
- /* @__PURE__ */ s("div", {
254
+ /* @__PURE__ */ l("div", {
245
255
  className: "flex justify-end gap-2",
246
- children: [/* @__PURE__ */ o(_, {
256
+ children: [/* @__PURE__ */ c(y, {
247
257
  size: "sm",
248
258
  variant: "ghost",
249
259
  onClick: () => {
250
- N(!1), V(null);
260
+ j(!1), z(null);
251
261
  },
252
- children: U === Y.version ? "Cancel" : "Discard my edits"
253
- }), /* @__PURE__ */ o(_, {
262
+ children: V === Y.version ? "Cancel" : "Discard my edits"
263
+ }), /* @__PURE__ */ c(y, {
254
264
  size: "sm",
255
- onClick: Ce,
256
- disabled: J.loading || U !== Y.version,
265
+ onClick: ke,
266
+ disabled: K.loading || V !== Y.version,
257
267
  "data-testid": "doc-save",
258
- children: J.loading ? "Saving…" : "Save new version"
268
+ children: K.loading ? "Saving…" : "Save new version"
259
269
  })]
260
270
  })
261
271
  ]
262
- }) }) : /* @__PURE__ */ o(v, { children: /* @__PURE__ */ o(y, {
272
+ }) }) : /* @__PURE__ */ c(b, { children: /* @__PURE__ */ c(x, {
263
273
  className: "prose prose-sm max-w-none pt-6 dark:prose-invert",
264
- children: Y.content.trim() ? /* @__PURE__ */ o(C, { children: Y.content }) : /* @__PURE__ */ o("p", {
274
+ children: Y.content.trim() ? /* @__PURE__ */ c(T, { children: Y.content }) : /* @__PURE__ */ c("p", {
265
275
  className: "text-sm text-muted-foreground",
266
276
  children: "This doc is empty."
267
277
  })
268
278
  }) }),
269
- /* @__PURE__ */ s("div", {
279
+ /* @__PURE__ */ l("div", {
270
280
  className: "grid grid-cols-1 gap-6 lg:grid-cols-2",
271
- children: [/* @__PURE__ */ s(v, {
281
+ children: [/* @__PURE__ */ l(b, {
272
282
  "data-testid": "doc-history",
273
- children: [/* @__PURE__ */ o(b, { children: /* @__PURE__ */ s(x, {
283
+ children: [/* @__PURE__ */ c(S, { children: /* @__PURE__ */ l(C, {
274
284
  className: "flex items-center gap-2",
275
285
  children: [
276
- /* @__PURE__ */ o(ie, { className: "h-4 w-4" }),
286
+ /* @__PURE__ */ c(ie, { className: "h-4 w-4" }),
277
287
  " History (",
278
288
  Q.length,
279
289
  ")"
280
290
  ]
281
- }) }), /* @__PURE__ */ s(y, {
291
+ }) }), /* @__PURE__ */ l(x, {
282
292
  className: "space-y-2",
283
- children: [/* @__PURE__ */ o("ol", {
293
+ children: [/* @__PURE__ */ c("ol", {
284
294
  className: "space-y-2",
285
295
  children: Q.map((e) => {
286
296
  let n = e.version === Y.version;
287
- return /* @__PURE__ */ s("li", {
297
+ return /* @__PURE__ */ l("li", {
288
298
  className: "space-y-1 rounded-md border p-2",
289
299
  "data-testid": "doc-revision",
290
- children: [/* @__PURE__ */ s("div", {
300
+ children: [/* @__PURE__ */ l("div", {
291
301
  className: "flex flex-wrap items-center justify-between gap-2",
292
- children: [/* @__PURE__ */ s("span", {
302
+ children: [/* @__PURE__ */ l("span", {
293
303
  className: "text-sm font-medium",
294
304
  children: [
295
305
  "Version ",
296
306
  e.version,
297
307
  n ? " (current)" : ""
298
308
  ]
299
- }), /* @__PURE__ */ s("span", {
309
+ }), /* @__PURE__ */ l("span", {
300
310
  className: "flex gap-1",
301
- children: [/* @__PURE__ */ o(_, {
311
+ children: [/* @__PURE__ */ c(y, {
302
312
  size: "sm",
303
313
  variant: "ghost",
304
314
  className: "h-7 text-xs",
305
- "aria-expanded": H === e.version,
306
- onClick: () => fe(H === e.version ? null : e.version),
307
- children: H === e.version ? "Hide" : "View"
308
- }), !n && !M && /* @__PURE__ */ s(c, { children: [/* @__PURE__ */ o(g, {
315
+ "aria-expanded": B === e.version,
316
+ onClick: () => ge(B === e.version ? null : e.version),
317
+ children: B === e.version ? "Hide" : "View"
318
+ }), !n && !A && /* @__PURE__ */ l(u, { children: [/* @__PURE__ */ c(v, {
309
319
  asChild: !0,
310
- children: /* @__PURE__ */ o(_, {
320
+ children: /* @__PURE__ */ c(y, {
311
321
  size: "sm",
312
322
  variant: "outline",
313
323
  className: "h-7 text-xs",
@@ -315,18 +325,18 @@ function A() {
315
325
  "data-testid": "doc-restore",
316
326
  children: "Restore"
317
327
  })
318
- }), /* @__PURE__ */ s(d, { children: [/* @__PURE__ */ s(m, { children: [/* @__PURE__ */ s(h, { children: [
328
+ }), /* @__PURE__ */ l(p, { children: [/* @__PURE__ */ l(g, { children: [/* @__PURE__ */ l(_, { children: [
319
329
  "Restore version ",
320
330
  e.version,
321
331
  "?"
322
- ] }), /* @__PURE__ */ s(f, { children: [
332
+ ] }), /* @__PURE__ */ l(m, { children: [
323
333
  "Its title and text become version ",
324
334
  Y.version + 1,
325
335
  ". Nothing is deleted: version ",
326
336
  Y.version,
327
337
  " stays in the history."
328
- ] })] }), /* @__PURE__ */ s(p, { children: [/* @__PURE__ */ o(u, { children: "Cancel" }), /* @__PURE__ */ o(l, {
329
- onClick: () => Z(() => ge({ variables: {
338
+ ] })] }), /* @__PURE__ */ l(h, { children: [/* @__PURE__ */ c(f, { children: "Cancel" }), /* @__PURE__ */ c(d, {
339
+ onClick: () => Z(() => be({ variables: {
330
340
  id: Y.id,
331
341
  toVersion: e.version,
332
342
  expectedVersion: Y.version
@@ -334,21 +344,21 @@ function A() {
334
344
  children: "Restore"
335
345
  })] })] })] })]
336
346
  })]
337
- }), /* @__PURE__ */ s("p", {
347
+ }), /* @__PURE__ */ l("p", {
338
348
  className: "text-xs text-muted-foreground",
339
349
  children: [
340
- k(e.createdAt),
350
+ D(e.createdAt),
341
351
  " · ",
342
- /* @__PURE__ */ o(t, { id: e.createdBy }),
352
+ /* @__PURE__ */ c(t, { id: e.createdBy }),
343
353
  e.changeNote ? ` · ${e.changeNote}` : ""
344
354
  ]
345
355
  })]
346
356
  }, e.id);
347
357
  })
348
- }), $ && /* @__PURE__ */ s("div", {
358
+ }), $ && /* @__PURE__ */ l("div", {
349
359
  className: "space-y-1 rounded-md border bg-muted/40 p-3",
350
360
  "data-testid": "doc-revision-view",
351
- children: [/* @__PURE__ */ s("p", {
361
+ children: [/* @__PURE__ */ l("p", {
352
362
  className: "text-sm font-medium",
353
363
  children: [
354
364
  "Version ",
@@ -356,53 +366,77 @@ function A() {
356
366
  ": ",
357
367
  $.title
358
368
  ]
359
- }), /* @__PURE__ */ o("div", {
369
+ }), /* @__PURE__ */ c("div", {
360
370
  className: "prose prose-sm max-w-none dark:prose-invert",
361
- children: /* @__PURE__ */ o(C, { children: $.content })
371
+ children: /* @__PURE__ */ c(T, { children: $.content })
362
372
  })]
363
373
  })]
364
374
  })]
365
- }), /* @__PURE__ */ s(v, {
375
+ }), /* @__PURE__ */ l(b, {
366
376
  "data-testid": "doc-linked-items",
367
- children: [/* @__PURE__ */ o(b, { children: /* @__PURE__ */ s(x, {
377
+ children: [/* @__PURE__ */ c(S, { children: /* @__PURE__ */ l(C, {
368
378
  className: "flex items-center gap-2",
369
379
  children: [
370
- /* @__PURE__ */ o(ae, { className: "h-4 w-4" }),
380
+ /* @__PURE__ */ c(a, { className: "h-4 w-4" }),
371
381
  " Linked work items (",
372
382
  Y.linkedWorkItems.length,
373
383
  ")"
374
384
  ]
375
- }) }), /* @__PURE__ */ s(y, {
385
+ }) }), /* @__PURE__ */ l(x, {
376
386
  className: "space-y-2",
377
- children: [Y.linkedWorkItems.length === 0 && /* @__PURE__ */ o("p", {
378
- className: "text-sm text-muted-foreground",
379
- children: "Not linked to any work item. A doc created from a task's “Linked Docs” panel is linked to that task; linking an existing doc is not available yet."
380
- }), Y.linkedWorkItems.map((e) => /* @__PURE__ */ s("div", {
381
- className: "flex items-center justify-between gap-2 rounded-md border p-2",
382
- children: [/* @__PURE__ */ s("button", {
383
- type: "button",
384
- className: "min-w-0 truncate text-left text-sm hover:underline",
385
- onClick: () => j(`/tasks/task-detail-page?taskId=${encodeURIComponent(e.id)}`),
386
- children: [
387
- /* @__PURE__ */ o("span", {
388
- className: "text-muted-foreground",
389
- children: e.key
390
- }),
391
- " ",
392
- e.title
393
- ]
394
- }), /* @__PURE__ */ o(_, {
395
- size: "icon",
396
- variant: "ghost",
397
- disabled: xe.loading,
398
- "aria-label": `Unlink ${e.title}`,
399
- onClick: () => Z(() => be({ variables: {
400
- docId: Y.id,
401
- workItemId: e.id
402
- } }), "The work item could not be unlinked."),
403
- children: /* @__PURE__ */ o(oe, { className: "h-4 w-4" })
404
- })]
405
- }, e.id))]
387
+ children: [
388
+ Y.linkedWorkItems.length === 0 && /* @__PURE__ */ c("p", {
389
+ className: "text-sm text-muted-foreground",
390
+ children: "Not linked to any work item yet. Pick one below, or use “Link existing doc” on the task."
391
+ }),
392
+ Y.linkedWorkItems.map((e) => /* @__PURE__ */ l("div", {
393
+ className: "flex items-center justify-between gap-2 rounded-md border p-2",
394
+ children: [/* @__PURE__ */ l("button", {
395
+ type: "button",
396
+ className: "min-w-0 truncate text-left text-sm hover:underline",
397
+ onClick: () => k(`/tasks/task-detail-page?taskId=${encodeURIComponent(e.id)}`),
398
+ children: [
399
+ /* @__PURE__ */ c("span", {
400
+ className: "text-muted-foreground",
401
+ children: e.key
402
+ }),
403
+ " ",
404
+ e.title
405
+ ]
406
+ }), /* @__PURE__ */ c(y, {
407
+ size: "icon",
408
+ variant: "ghost",
409
+ disabled: Te.loading,
410
+ "aria-label": `Unlink ${e.title}`,
411
+ onClick: () => Z(() => we({ variables: {
412
+ docId: Y.id,
413
+ workItemId: e.id
414
+ } }), "The work item could not be unlinked."),
415
+ children: /* @__PURE__ */ c(ae, { className: "h-4 w-4" })
416
+ })]
417
+ }, e.id)),
418
+ /* @__PURE__ */ l("div", {
419
+ className: "space-y-2 pt-2",
420
+ "data-testid": "doc-link-work-item",
421
+ children: [/* @__PURE__ */ c(ee, {
422
+ id: "doc-link-work-item-select",
423
+ value: q,
424
+ onChange: J,
425
+ exclude: Y.linkedWorkItems.map((e) => e.id)
426
+ }), /* @__PURE__ */ l(y, {
427
+ size: "sm",
428
+ variant: "outline",
429
+ disabled: !q || De.loading,
430
+ onClick: async () => {
431
+ await Z(() => Ee({ variables: {
432
+ docId: Y.id,
433
+ workItemId: q
434
+ } }), "The work item could not be linked.") && J("");
435
+ },
436
+ children: [/* @__PURE__ */ c(a, { className: "mr-1 h-4 w-4" }), "Link work item"]
437
+ })]
438
+ })
439
+ ]
406
440
  })]
407
441
  })]
408
442
  })
@@ -410,6 +444,6 @@ function A() {
410
444
  });
411
445
  }
412
446
  //#endregion
413
- export { A as DocsDocDetailPagePage };
447
+ export { O as DocsDocDetailPagePage };
414
448
 
415
449
  //# sourceMappingURL=DocsDocDetailPagePage.js.map