@burdenoff/microfe-planmagnet 2026.925.17 → 2026.925.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,17 @@
1
+ import { brand as e, isBranded as t } from "./utils.js";
2
+ //#region node_modules/@apollo/client/errors/ServerError.js
3
+ var n = class n extends Error {
4
+ static is(e) {
5
+ return t(e, "ServerError");
6
+ }
7
+ response;
8
+ statusCode;
9
+ bodyText;
10
+ constructor(t, r) {
11
+ super(t), this.name = "ServerError", this.response = r.response, this.statusCode = r.response.status, this.bodyText = r.bodyText, e(this), Object.setPrototypeOf(this, n.prototype);
12
+ }
13
+ };
14
+ //#endregion
15
+ export { n as ServerError };
16
+
17
+ //# sourceMappingURL=ServerError.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ServerError.js","names":[],"sources":["../../../../../node_modules/@apollo/client/errors/ServerError.js"],"sourcesContent":["import { brand, isBranded } from \"./utils.js\";\n/**\n * Represents an error when a non-200 HTTP status code is returned from the\n * server according to the [GraphQL Over HTTP specification](https://graphql.github.io/graphql-over-http/draft/). This error\n * contains the full server response, including status code and body text.\n *\n * @remarks\n *\n * This error occurs when your GraphQL server responds with an HTTP status code\n * other than 200 (such as 4xx or 5xx status codes) with any media type other\n * than [`application/graphql-response+json`](https://graphql.github.io/graphql-over-http/draft/#sec-application-graphql-response-json).\n *\n * Servers that return non-200 status codes with other media types are not\n * guaranteed to contain a well-formed GraphQL response and may indicate issues\n * at the HTTP level, such as authentication failures, server unavailability,\n * or other HTTP-level problems.\n *\n * @example\n *\n * ```ts\n * import { ServerError } from \"@apollo/client/errors\";\n *\n * // Check if an error is a ServerError instance\n * if (ServerError.is(error)) {\n * console.log(`Server returned status: ${error.statusCode}`);\n * console.log(`Response body: ${error.bodyText}`);\n *\n * // Handle specific status codes\n * if (error.statusCode === 401) {\n * // Handle unauthorized access\n * }\n * }\n * ```\n */\nexport class ServerError extends Error {\n /**\n * A method that determines whether an error is a `ServerError` object. This\n * method enables TypeScript to narrow the error type.\n *\n * @example\n *\n * ```ts\n * if (ServerError.is(error)) {\n * // TypeScript now knows `error` is a ServerError object\n * console.log(error.errors);\n * }\n * ```\n */\n static is(error) {\n return isBranded(error, \"ServerError\");\n }\n /**\n * The raw [`Response`](https://developer.mozilla.org/en-US/docs/Web/API/Response) object provided by the [Fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API).\n */\n response;\n /**\n * The status code returned by the server in the response. This is provided as\n * a shortcut for `response.status`.\n */\n statusCode;\n /**\n * The raw response body text.\n */\n bodyText;\n constructor(message, options) {\n super(message);\n this.name = \"ServerError\";\n this.response = options.response;\n this.statusCode = options.response.status;\n this.bodyText = options.bodyText;\n brand(this);\n Object.setPrototypeOf(this, ServerError.prototype);\n }\n}\n//# sourceMappingURL=ServerError.js.map\n"],"x_google_ignoreList":[0],"mappings":";;AAkCA,IAAa,IAAb,MAAa,UAAoB,MAAM;CAcnC,OAAO,GAAG,GAAO;AACb,SAAO,EAAU,GAAO,cAAc;;CAK1C;CAKA;CAIA;CACA,YAAY,GAAS,GAAS;AAO1B,EANA,MAAM,EAAQ,EACd,KAAK,OAAO,eACZ,KAAK,WAAW,EAAQ,UACxB,KAAK,aAAa,EAAQ,SAAS,QACnC,KAAK,WAAW,EAAQ,UACxB,EAAM,KAAK,EACX,OAAO,eAAe,MAAM,EAAY,UAAU"}
@@ -1 +1 @@
1
- {"version":3,"file":"DocsDocDetailPagePage.d.ts","sourceRoot":"","sources":["../../../src/planmagnet/pages/DocsDocDetailPagePage.tsx"],"names":[],"mappings":"AA2HA,wBAAgB,qBAAqB,4CAoZpC"}
1
+ {"version":3,"file":"DocsDocDetailPagePage.d.ts","sourceRoot":"","sources":["../../../src/planmagnet/pages/DocsDocDetailPagePage.tsx"],"names":[],"mappings":"AA4HA,wBAAgB,qBAAqB,4CAwZpC"}
@@ -4,15 +4,16 @@ import { MarkdownEditor as n } from "../../components/MarkdownEditor.js";
4
4
  import { throwOnError as ee } from "../utils/mutationResult.js";
5
5
  import { DOC_STATUSES as te, DocStatusBadge as ne } from "../docs/DocStatusBadge.js";
6
6
  import { useState as r } from "react";
7
- import { ArrowLeft as i, History as re, Link2 as a, X as ie } from "lucide-react";
8
- import { useSearchParams as o } from "react-router";
9
- import { gql as s } from "@apollo/client";
10
- import { useApolloClient as ae, useMutation as c, useQuery as oe } from "@apollo/client/react";
11
- import { jsx as l, jsxs as u } from "react/jsx-runtime";
12
- import { AlertDialog as d, AlertDialogAction as f, AlertDialogCancel as p, AlertDialogContent as m, AlertDialogDescription as h, AlertDialogFooter as g, AlertDialogHeader as _, AlertDialogTitle as v, AlertDialogTrigger as y, Button as b, Card as x, CardContent as S, CardHeader as C, CardTitle as w, Input as T } from "@burdenoff/fe-libs/ui";
13
- import { Markdown as E } from "@burdenoff/fe-libs/shared/components";
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";
14
15
  //#region src/planmagnet/pages/DocsDocDetailPagePage.tsx
15
- var D = s`
16
+ var w = i`
16
17
  query DocDetail($id: ID!) {
17
18
  planmagnetDoc(id: $id) {
18
19
  id
@@ -40,7 +41,7 @@ var D = s`
40
41
  }
41
42
  }
42
43
  }
43
- `, se = s`
44
+ `, T = i`
44
45
  mutation DocUpdate($id: ID!, $input: PlanmagnetUpdateDocInput!) {
45
46
  planmagnetUpdateDoc(id: $id, input: $input) {
46
47
  id
@@ -48,119 +49,119 @@ var D = s`
48
49
  status
49
50
  }
50
51
  }
51
- `, ce = s`
52
+ `, E = i`
52
53
  mutation DocRevert($id: ID!, $toVersion: Int!, $expectedVersion: Int) {
53
54
  planmagnetRevertDoc(id: $id, toVersion: $toVersion, expectedVersion: $expectedVersion) {
54
55
  id
55
56
  version
56
57
  }
57
58
  }
58
- `, le = s`
59
+ `, D = i`
59
60
  mutation DocDelete($id: ID!) {
60
61
  planmagnetDeleteDoc(id: $id)
61
62
  }
62
- `, ue = s`
63
+ `, de = i`
63
64
  mutation DocUnlinkWorkItem($docId: ID!, $workItemId: ID!) {
64
65
  planmagnetUnlinkDocFromWorkItem(docId: $docId, workItemId: $workItemId)
65
66
  }
66
- `, de = (e, t) => e instanceof Error ? e.message : t, O = (e) => new Date(e).toLocaleString();
67
- function k() {
68
- let [s] = o(), k = s.get("docId") ?? "", A = e(), [j, M] = r(!1), [N, P] = r(""), [F, I] = r(""), [L, R] = r(""), [z, B] = r(null), [V, fe] = r(null), [H, pe] = r(null), { data: U, loading: me, error: W } = oe(D, {
69
- variables: { id: k },
70
- skip: !k,
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,
71
72
  fetchPolicy: "cache-and-network"
72
- }), he = ae(), G = {
73
+ }), he = ce(), K = {
73
74
  refetchQueries: ["DocDetail"],
74
75
  awaitRefetchQueries: !0
75
- }, [K, q] = c(se, G), [ge, _e] = c(ce, G), [ve, ye] = c(le, { refetchQueries: ["DocsList"] }), [be, J] = c(ue, G), Y = U?.planmagnetDoc, X = q.loading || _e.loading || ye.loading, Z = async (e, t) => {
76
- B(null);
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);
77
78
  try {
78
79
  return await ee(e()), !0;
79
80
  } catch (e) {
80
- return B(de(e, t)), await he.query({
81
- query: D,
82
- variables: { id: k },
81
+ return V(O(e, t)), ue(), await he.query({
82
+ query: w,
83
+ variables: { id: A },
83
84
  fetchPolicy: "network-only"
84
85
  }).catch(() => void 0), !1;
85
86
  }
86
87
  };
87
- if (!k) return /* @__PURE__ */ l("div", {
88
+ if (!A) return /* @__PURE__ */ o("div", {
88
89
  className: "p-6 text-sm text-muted-foreground",
89
90
  children: "No doc selected."
90
91
  });
91
- if (me && !U) return /* @__PURE__ */ l("div", {
92
+ if (me && !W) return /* @__PURE__ */ o("div", {
92
93
  className: "p-6 text-sm text-muted-foreground",
93
94
  children: "Loading doc…"
94
95
  });
95
- if (W && !Y) return /* @__PURE__ */ u("p", {
96
+ if (G && !Y) return /* @__PURE__ */ s("p", {
96
97
  role: "alert",
97
98
  className: "p-6 text-sm text-destructive",
98
- children: ["The doc could not be loaded: ", W.message]
99
+ children: ["The doc could not be loaded: ", G.message]
99
100
  });
100
- if (!Y) return /* @__PURE__ */ u("div", {
101
+ if (!Y) return /* @__PURE__ */ s("div", {
101
102
  className: "space-y-3 p-6",
102
- children: [/* @__PURE__ */ l("p", {
103
+ children: [/* @__PURE__ */ o("p", {
103
104
  className: "text-sm text-muted-foreground",
104
105
  children: "This doc does not exist in this workspace, or it was deleted."
105
- }), /* @__PURE__ */ l(b, {
106
+ }), /* @__PURE__ */ o(_, {
106
107
  size: "sm",
107
108
  variant: "outline",
108
- onClick: () => A("/docs/docs-page"),
109
+ onClick: () => j("/docs/docs-page"),
109
110
  children: "Back to docs"
110
111
  })]
111
112
  });
112
- let xe = () => {
113
- P(Y.title), I(Y.content), R(""), B(null), pe(Y.version), M(!0);
114
- }, Se = async () => {
115
- await Z(() => K({ variables: {
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: {
116
117
  id: Y.id,
117
118
  input: {
118
- title: N.trim(),
119
- content: F,
120
- ...L.trim() ? { changeNote: L.trim() } : {},
121
- expectedVersion: H
119
+ title: P.trim(),
120
+ content: I,
121
+ ...R.trim() ? { changeNote: R.trim() } : {},
122
+ expectedVersion: U
122
123
  }
123
- } }), "The doc could not be saved.") && M(!1);
124
- }, Q = [...Y.revisions].sort((e, t) => t.version - e.version), $ = V === null ? null : Q.find((e) => e.version === V);
125
- return /* @__PURE__ */ u("div", {
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", {
126
127
  className: "space-y-6 p-6",
127
128
  "data-testid": "doc-detail",
128
129
  children: [
129
- /* @__PURE__ */ u(b, {
130
+ /* @__PURE__ */ s(_, {
130
131
  size: "sm",
131
132
  variant: "ghost",
132
- onClick: () => A("/docs/docs-page"),
133
- children: [/* @__PURE__ */ l(i, { className: "mr-1 h-4 w-4" }), "All docs"]
133
+ onClick: () => j("/docs/docs-page"),
134
+ children: [/* @__PURE__ */ o(re, { className: "mr-1 h-4 w-4" }), "All docs"]
134
135
  }),
135
- /* @__PURE__ */ u("div", {
136
+ /* @__PURE__ */ s("div", {
136
137
  className: "flex flex-wrap items-start justify-between gap-3",
137
- children: [/* @__PURE__ */ u("div", {
138
+ children: [/* @__PURE__ */ s("div", {
138
139
  className: "min-w-0 space-y-1",
139
- children: [/* @__PURE__ */ l("h1", {
140
+ children: [/* @__PURE__ */ o("h1", {
140
141
  className: "text-2xl font-semibold break-words",
141
142
  "data-testid": "doc-title",
142
143
  children: Y.title
143
- }), /* @__PURE__ */ u("p", {
144
+ }), /* @__PURE__ */ s("p", {
144
145
  className: "text-xs text-muted-foreground",
145
146
  children: [
146
- /* @__PURE__ */ l(ne, { status: Y.status }),
147
+ /* @__PURE__ */ o(ne, { status: Y.status }),
147
148
  " · version ",
148
149
  Y.version,
149
150
  " · updated",
150
151
  " ",
151
- O(Y.updatedAt),
152
+ k(Y.updatedAt),
152
153
  " by ",
153
- /* @__PURE__ */ l(t, { id: Y.updatedBy ?? Y.createdBy })
154
+ /* @__PURE__ */ o(t, { id: Y.updatedBy ?? Y.createdBy })
154
155
  ]
155
156
  })]
156
- }), !j && /* @__PURE__ */ u("div", {
157
+ }), !M && /* @__PURE__ */ s("div", {
157
158
  className: "flex flex-wrap gap-2",
158
159
  children: [
159
- te.filter((e) => e !== Y.status).map((e) => /* @__PURE__ */ l(b, {
160
+ te.filter((e) => e !== Y.status).map((e) => /* @__PURE__ */ o(_, {
160
161
  size: "sm",
161
162
  variant: "outline",
162
163
  disabled: X,
163
- onClick: () => Z(() => K({ variables: {
164
+ onClick: () => Z(() => q({ variables: {
164
165
  id: Y.id,
165
166
  input: {
166
167
  status: e,
@@ -169,144 +170,144 @@ function k() {
169
170
  } }), "The status could not be changed."),
170
171
  children: e === "PUBLISHED" ? "Publish" : e === "ARCHIVED" ? "Archive" : "Back to draft"
171
172
  }, e)),
172
- /* @__PURE__ */ l(b, {
173
+ /* @__PURE__ */ o(_, {
173
174
  size: "sm",
174
- onClick: xe,
175
+ onClick: Se,
175
176
  "data-testid": "doc-edit",
176
177
  children: "Edit"
177
178
  }),
178
- /* @__PURE__ */ u(d, { children: [/* @__PURE__ */ l(y, {
179
+ /* @__PURE__ */ s(c, { children: [/* @__PURE__ */ o(g, {
179
180
  asChild: !0,
180
- children: /* @__PURE__ */ l(b, {
181
+ children: /* @__PURE__ */ o(_, {
181
182
  size: "sm",
182
183
  variant: "outline",
183
184
  disabled: X,
184
185
  children: "Delete"
185
186
  })
186
- }), /* @__PURE__ */ u(m, { children: [/* @__PURE__ */ u(_, { children: [/* @__PURE__ */ u(v, { children: [
187
+ }), /* @__PURE__ */ s(d, { children: [/* @__PURE__ */ s(m, { children: [/* @__PURE__ */ s(h, { children: [
187
188
  "Delete “",
188
189
  Y.title,
189
190
  "”?"
190
- ] }), /* @__PURE__ */ u(h, { children: [
191
+ ] }), /* @__PURE__ */ s(f, { children: [
191
192
  "The doc and its history are removed for everyone, and it is unlinked from",
192
193
  " ",
193
194
  Y.linkedWorkItems.length,
194
195
  " work item",
195
196
  Y.linkedWorkItems.length === 1 ? "" : "s",
196
197
  "."
197
- ] })] }), /* @__PURE__ */ u(g, { children: [/* @__PURE__ */ l(p, { children: "Keep it" }), /* @__PURE__ */ l(f, {
198
+ ] })] }), /* @__PURE__ */ s(p, { children: [/* @__PURE__ */ o(u, { children: "Keep it" }), /* @__PURE__ */ o(l, {
198
199
  className: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
199
200
  onClick: async () => {
200
- await Z(() => ve({ variables: { id: Y.id } }), "The doc could not be deleted.") && A("/docs/docs-page");
201
+ await Z(() => ve({ variables: { id: Y.id } }), "The doc could not be deleted.") && j("/docs/docs-page");
201
202
  },
202
203
  children: "Delete"
203
204
  })] })] })] })
204
205
  ]
205
206
  })]
206
207
  }),
207
- z && /* @__PURE__ */ l("p", {
208
+ B && /* @__PURE__ */ o("p", {
208
209
  role: "alert",
209
210
  className: "text-sm text-destructive",
210
211
  "data-testid": "doc-error",
211
- children: z
212
+ children: B
212
213
  }),
213
- j && H !== Y.version && /* @__PURE__ */ u("p", {
214
+ M && U !== Y.version && /* @__PURE__ */ s("p", {
214
215
  className: "text-sm text-status-warning-text",
215
216
  "data-testid": "doc-moved-on",
216
217
  children: [
217
218
  "Someone saved version ",
218
219
  Y.version,
219
220
  " after you started editing version ",
220
- H,
221
+ U,
221
222
  ". Your text is kept below; copy what you need, then discard and edit the latest."
222
223
  ]
223
224
  }),
224
- j ? /* @__PURE__ */ l(x, { children: /* @__PURE__ */ u(S, {
225
+ M ? /* @__PURE__ */ o(v, { children: /* @__PURE__ */ s(y, {
225
226
  className: "space-y-3 pt-6",
226
227
  children: [
227
- /* @__PURE__ */ l(T, {
228
+ /* @__PURE__ */ o(S, {
228
229
  "aria-label": "Doc title",
229
- value: N,
230
- onChange: (e) => P(e.target.value)
230
+ value: P,
231
+ onChange: (e) => F(e.target.value)
231
232
  }),
232
- /* @__PURE__ */ l(n, {
233
- value: F,
234
- onChange: I,
233
+ /* @__PURE__ */ o(n, {
234
+ value: I,
235
+ onChange: L,
235
236
  minHeight: 240
236
237
  }),
237
- /* @__PURE__ */ l(T, {
238
+ /* @__PURE__ */ o(S, {
238
239
  "aria-label": "Change note",
239
240
  placeholder: "What changed? (optional, shown in the history)",
240
- value: L,
241
- onChange: (e) => R(e.target.value)
241
+ value: R,
242
+ onChange: (e) => z(e.target.value)
242
243
  }),
243
- /* @__PURE__ */ u("div", {
244
+ /* @__PURE__ */ s("div", {
244
245
  className: "flex justify-end gap-2",
245
- children: [/* @__PURE__ */ l(b, {
246
+ children: [/* @__PURE__ */ o(_, {
246
247
  size: "sm",
247
248
  variant: "ghost",
248
249
  onClick: () => {
249
- M(!1), B(null);
250
+ N(!1), V(null);
250
251
  },
251
- children: H === Y.version ? "Cancel" : "Discard my edits"
252
- }), /* @__PURE__ */ l(b, {
252
+ children: U === Y.version ? "Cancel" : "Discard my edits"
253
+ }), /* @__PURE__ */ o(_, {
253
254
  size: "sm",
254
- onClick: Se,
255
- disabled: q.loading || H !== Y.version,
255
+ onClick: Ce,
256
+ disabled: J.loading || U !== Y.version,
256
257
  "data-testid": "doc-save",
257
- children: q.loading ? "Saving…" : "Save new version"
258
+ children: J.loading ? "Saving…" : "Save new version"
258
259
  })]
259
260
  })
260
261
  ]
261
- }) }) : /* @__PURE__ */ l(x, { children: /* @__PURE__ */ l(S, {
262
+ }) }) : /* @__PURE__ */ o(v, { children: /* @__PURE__ */ o(y, {
262
263
  className: "prose prose-sm max-w-none pt-6 dark:prose-invert",
263
- children: Y.content.trim() ? /* @__PURE__ */ l(E, { children: Y.content }) : /* @__PURE__ */ l("p", {
264
+ children: Y.content.trim() ? /* @__PURE__ */ o(C, { children: Y.content }) : /* @__PURE__ */ o("p", {
264
265
  className: "text-sm text-muted-foreground",
265
266
  children: "This doc is empty."
266
267
  })
267
268
  }) }),
268
- /* @__PURE__ */ u("div", {
269
+ /* @__PURE__ */ s("div", {
269
270
  className: "grid grid-cols-1 gap-6 lg:grid-cols-2",
270
- children: [/* @__PURE__ */ u(x, {
271
+ children: [/* @__PURE__ */ s(v, {
271
272
  "data-testid": "doc-history",
272
- children: [/* @__PURE__ */ l(C, { children: /* @__PURE__ */ u(w, {
273
+ children: [/* @__PURE__ */ o(b, { children: /* @__PURE__ */ s(x, {
273
274
  className: "flex items-center gap-2",
274
275
  children: [
275
- /* @__PURE__ */ l(re, { className: "h-4 w-4" }),
276
+ /* @__PURE__ */ o(ie, { className: "h-4 w-4" }),
276
277
  " History (",
277
278
  Q.length,
278
279
  ")"
279
280
  ]
280
- }) }), /* @__PURE__ */ u(S, {
281
+ }) }), /* @__PURE__ */ s(y, {
281
282
  className: "space-y-2",
282
- children: [/* @__PURE__ */ l("ol", {
283
+ children: [/* @__PURE__ */ o("ol", {
283
284
  className: "space-y-2",
284
285
  children: Q.map((e) => {
285
286
  let n = e.version === Y.version;
286
- return /* @__PURE__ */ u("li", {
287
+ return /* @__PURE__ */ s("li", {
287
288
  className: "space-y-1 rounded-md border p-2",
288
289
  "data-testid": "doc-revision",
289
- children: [/* @__PURE__ */ u("div", {
290
+ children: [/* @__PURE__ */ s("div", {
290
291
  className: "flex flex-wrap items-center justify-between gap-2",
291
- children: [/* @__PURE__ */ u("span", {
292
+ children: [/* @__PURE__ */ s("span", {
292
293
  className: "text-sm font-medium",
293
294
  children: [
294
295
  "Version ",
295
296
  e.version,
296
297
  n ? " (current)" : ""
297
298
  ]
298
- }), /* @__PURE__ */ u("span", {
299
+ }), /* @__PURE__ */ s("span", {
299
300
  className: "flex gap-1",
300
- children: [/* @__PURE__ */ l(b, {
301
+ children: [/* @__PURE__ */ o(_, {
301
302
  size: "sm",
302
303
  variant: "ghost",
303
304
  className: "h-7 text-xs",
304
- "aria-expanded": V === e.version,
305
- onClick: () => fe(V === e.version ? null : e.version),
306
- children: V === e.version ? "Hide" : "View"
307
- }), !n && !j && /* @__PURE__ */ u(d, { children: [/* @__PURE__ */ l(y, {
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, {
308
309
  asChild: !0,
309
- children: /* @__PURE__ */ l(b, {
310
+ children: /* @__PURE__ */ o(_, {
310
311
  size: "sm",
311
312
  variant: "outline",
312
313
  className: "h-7 text-xs",
@@ -314,17 +315,17 @@ function k() {
314
315
  "data-testid": "doc-restore",
315
316
  children: "Restore"
316
317
  })
317
- }), /* @__PURE__ */ u(m, { children: [/* @__PURE__ */ u(_, { children: [/* @__PURE__ */ u(v, { children: [
318
+ }), /* @__PURE__ */ s(d, { children: [/* @__PURE__ */ s(m, { children: [/* @__PURE__ */ s(h, { children: [
318
319
  "Restore version ",
319
320
  e.version,
320
321
  "?"
321
- ] }), /* @__PURE__ */ u(h, { children: [
322
+ ] }), /* @__PURE__ */ s(f, { children: [
322
323
  "Its title and text become version ",
323
324
  Y.version + 1,
324
325
  ". Nothing is deleted: version ",
325
326
  Y.version,
326
327
  " stays in the history."
327
- ] })] }), /* @__PURE__ */ u(g, { children: [/* @__PURE__ */ l(p, { children: "Cancel" }), /* @__PURE__ */ l(f, {
328
+ ] })] }), /* @__PURE__ */ s(p, { children: [/* @__PURE__ */ o(u, { children: "Cancel" }), /* @__PURE__ */ o(l, {
328
329
  onClick: () => Z(() => ge({ variables: {
329
330
  id: Y.id,
330
331
  toVersion: e.version,
@@ -333,21 +334,21 @@ function k() {
333
334
  children: "Restore"
334
335
  })] })] })] })]
335
336
  })]
336
- }), /* @__PURE__ */ u("p", {
337
+ }), /* @__PURE__ */ s("p", {
337
338
  className: "text-xs text-muted-foreground",
338
339
  children: [
339
- O(e.createdAt),
340
+ k(e.createdAt),
340
341
  " · ",
341
- /* @__PURE__ */ l(t, { id: e.createdBy }),
342
+ /* @__PURE__ */ o(t, { id: e.createdBy }),
342
343
  e.changeNote ? ` · ${e.changeNote}` : ""
343
344
  ]
344
345
  })]
345
346
  }, e.id);
346
347
  })
347
- }), $ && /* @__PURE__ */ u("div", {
348
+ }), $ && /* @__PURE__ */ s("div", {
348
349
  className: "space-y-1 rounded-md border bg-muted/40 p-3",
349
350
  "data-testid": "doc-revision-view",
350
- children: [/* @__PURE__ */ u("p", {
351
+ children: [/* @__PURE__ */ s("p", {
351
352
  className: "text-sm font-medium",
352
353
  children: [
353
354
  "Version ",
@@ -355,51 +356,51 @@ function k() {
355
356
  ": ",
356
357
  $.title
357
358
  ]
358
- }), /* @__PURE__ */ l("div", {
359
+ }), /* @__PURE__ */ o("div", {
359
360
  className: "prose prose-sm max-w-none dark:prose-invert",
360
- children: /* @__PURE__ */ l(E, { children: $.content })
361
+ children: /* @__PURE__ */ o(C, { children: $.content })
361
362
  })]
362
363
  })]
363
364
  })]
364
- }), /* @__PURE__ */ u(x, {
365
+ }), /* @__PURE__ */ s(v, {
365
366
  "data-testid": "doc-linked-items",
366
- children: [/* @__PURE__ */ l(C, { children: /* @__PURE__ */ u(w, {
367
+ children: [/* @__PURE__ */ o(b, { children: /* @__PURE__ */ s(x, {
367
368
  className: "flex items-center gap-2",
368
369
  children: [
369
- /* @__PURE__ */ l(a, { className: "h-4 w-4" }),
370
+ /* @__PURE__ */ o(ae, { className: "h-4 w-4" }),
370
371
  " Linked work items (",
371
372
  Y.linkedWorkItems.length,
372
373
  ")"
373
374
  ]
374
- }) }), /* @__PURE__ */ u(S, {
375
+ }) }), /* @__PURE__ */ s(y, {
375
376
  className: "space-y-2",
376
- children: [Y.linkedWorkItems.length === 0 && /* @__PURE__ */ l("p", {
377
+ children: [Y.linkedWorkItems.length === 0 && /* @__PURE__ */ o("p", {
377
378
  className: "text-sm text-muted-foreground",
378
379
  children: "Not linked to any work item. Link docs from a task's “Linked Docs” panel."
379
- }), Y.linkedWorkItems.map((e) => /* @__PURE__ */ u("div", {
380
+ }), Y.linkedWorkItems.map((e) => /* @__PURE__ */ s("div", {
380
381
  className: "flex items-center justify-between gap-2 rounded-md border p-2",
381
- children: [/* @__PURE__ */ u("button", {
382
+ children: [/* @__PURE__ */ s("button", {
382
383
  type: "button",
383
384
  className: "min-w-0 truncate text-left text-sm hover:underline",
384
- onClick: () => A(`/tasks/task-detail-page?taskId=${encodeURIComponent(e.id)}`),
385
+ onClick: () => j(`/tasks/task-detail-page?taskId=${encodeURIComponent(e.id)}`),
385
386
  children: [
386
- /* @__PURE__ */ l("span", {
387
+ /* @__PURE__ */ o("span", {
387
388
  className: "text-muted-foreground",
388
389
  children: e.key
389
390
  }),
390
391
  " ",
391
392
  e.title
392
393
  ]
393
- }), /* @__PURE__ */ l(b, {
394
+ }), /* @__PURE__ */ o(_, {
394
395
  size: "icon",
395
396
  variant: "ghost",
396
- disabled: J.loading,
397
+ disabled: xe.loading,
397
398
  "aria-label": `Unlink ${e.title}`,
398
399
  onClick: () => Z(() => be({ variables: {
399
400
  docId: Y.id,
400
401
  workItemId: e.id
401
402
  } }), "The work item could not be unlinked."),
402
- children: /* @__PURE__ */ l(ie, { className: "h-4 w-4" })
403
+ children: /* @__PURE__ */ o(oe, { className: "h-4 w-4" })
403
404
  })]
404
405
  }, e.id))]
405
406
  })]
@@ -409,6 +410,6 @@ function k() {
409
410
  });
410
411
  }
411
412
  //#endregion
412
- export { k as DocsDocDetailPagePage };
413
+ export { A as DocsDocDetailPagePage };
413
414
 
414
415
  //# sourceMappingURL=DocsDocDetailPagePage.js.map