camox 0.75.0 → 0.76.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/features/provider/AuthenticatedCamoxProvider.js +75 -63
- package/dist/features/routes/pageRuntime.d.ts +6 -4
- package/dist/features/routes/pageRuntime.js +5 -1
- package/dist/features/studio/components/ChatWidget.js +137 -121
- package/dist/features/studio/components/ClearThread.js +121 -0
- package/dist/features/studio/components/DeleteDraftDialog.js +67 -65
- package/dist/features/studio/components/DraftBar.js +60 -49
- package/dist/features/studio/components/DraftNotices.js +149 -0
- package/dist/features/studio/components/DraftsControl.js +217 -180
- package/dist/features/studio/components/DraftsSheet.js +387 -0
- package/dist/features/studio/components/PublishedTab.js +511 -0
- package/dist/features/studio/components/ReviewDraftDialog.js +104 -89
- package/dist/features/studio/components/SheetTable.js +46 -0
- package/dist/features/studio/components/Specialists.js +1 -1
- package/dist/features/studio/components/ThreadMessages.js +222 -167
- package/dist/features/studio/draftLabel.js +15 -1
- package/dist/features/studio/draftNotice.js +1 -0
- package/dist/features/studio/studioStore.js +5 -5
- package/dist/features/studio/useArchiveDraft.js +60 -0
- package/dist/features/studio/useRestoreDraft.js +70 -0
- package/dist/features/studio/viewSwitch.js +19 -11
- package/dist/lib/draft-scope.d.ts +1 -1
- package/dist/lib/draft-scope.js +6 -3
- package/dist/lib/queries.js +12 -1
- package/dist/lib/studio-reads.js +22 -0
- package/dist/lib/use-project-room.js +19 -13
- package/dist/lib/use-thread.js +1 -1
- package/dist/package.js +1 -1
- package/dist/studio.css +1 -1
- package/package.json +4 -4
|
@@ -0,0 +1,511 @@
|
|
|
1
|
+
import { useNavigate } from "../../navigation/navigation.js";
|
|
2
|
+
import { reads, useReadQuery } from "../../../lib/studio-reads.js";
|
|
3
|
+
import { publicationMutations } from "../../../lib/queries.js";
|
|
4
|
+
import { useSwitchView } from "../viewSwitch.js";
|
|
5
|
+
import { publicationLabel, timeAgo } from "../draftLabel.js";
|
|
6
|
+
import { ClearThread } from "./ClearThread.js";
|
|
7
|
+
import { Td, Th } from "./SheetTable.js";
|
|
8
|
+
import { ThreadMessages } from "./ThreadMessages.js";
|
|
9
|
+
import { c } from "react/compiler-runtime";
|
|
10
|
+
import * as React from "react";
|
|
11
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
12
|
+
import { useMutation } from "@tanstack/react-query";
|
|
13
|
+
import { Button } from "@camox/ui/button";
|
|
14
|
+
import { ArrowLeft } from "lucide-react";
|
|
15
|
+
import { toast } from "@camox/ui/toaster";
|
|
16
|
+
import { Spinner } from "@camox/ui/spinner";
|
|
17
|
+
|
|
18
|
+
//#region src/features/studio/components/PublishedTab.tsx
|
|
19
|
+
/**
|
|
20
|
+
* The Publications (ADR 0045), the latest first. Opening one shows its overview and its thread,
|
|
21
|
+
* read-only: how a member finds out why Live changed. Reverting one takes the member into the
|
|
22
|
+
* draft it starts, once `onEntered` closed the sheet.
|
|
23
|
+
*/
|
|
24
|
+
function PublishedTab(t0) {
|
|
25
|
+
const $ = c(7);
|
|
26
|
+
const { projectId, onEntered } = t0;
|
|
27
|
+
const [opened, setOpened] = React.useState(null);
|
|
28
|
+
if (opened) {
|
|
29
|
+
let t1;
|
|
30
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
31
|
+
t1 = () => setOpened(null);
|
|
32
|
+
$[0] = t1;
|
|
33
|
+
} else t1 = $[0];
|
|
34
|
+
let t2;
|
|
35
|
+
if ($[1] !== onEntered || $[2] !== opened || $[3] !== projectId) {
|
|
36
|
+
t2 = /* @__PURE__ */ jsx(PublicationView, {
|
|
37
|
+
projectId,
|
|
38
|
+
id: opened,
|
|
39
|
+
onBack: t1,
|
|
40
|
+
onEntered
|
|
41
|
+
});
|
|
42
|
+
$[1] = onEntered;
|
|
43
|
+
$[2] = opened;
|
|
44
|
+
$[3] = projectId;
|
|
45
|
+
$[4] = t2;
|
|
46
|
+
} else t2 = $[4];
|
|
47
|
+
return t2;
|
|
48
|
+
}
|
|
49
|
+
let t1;
|
|
50
|
+
if ($[5] !== projectId) {
|
|
51
|
+
t1 = /* @__PURE__ */ jsx(PublicationList, {
|
|
52
|
+
projectId,
|
|
53
|
+
onOpen: setOpened
|
|
54
|
+
});
|
|
55
|
+
$[5] = projectId;
|
|
56
|
+
$[6] = t1;
|
|
57
|
+
} else t1 = $[6];
|
|
58
|
+
return t1;
|
|
59
|
+
}
|
|
60
|
+
function PublicationList(t0) {
|
|
61
|
+
const $ = c(16);
|
|
62
|
+
const { projectId, onOpen } = t0;
|
|
63
|
+
let t1;
|
|
64
|
+
if ($[0] !== projectId) {
|
|
65
|
+
t1 = reads.publications({ projectId });
|
|
66
|
+
$[0] = projectId;
|
|
67
|
+
$[1] = t1;
|
|
68
|
+
} else t1 = $[1];
|
|
69
|
+
const publications = useReadQuery(t1);
|
|
70
|
+
if (!publications.data) {
|
|
71
|
+
let t2;
|
|
72
|
+
if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
|
|
73
|
+
t2 = /* @__PURE__ */ jsx(Loading, {});
|
|
74
|
+
$[2] = t2;
|
|
75
|
+
} else t2 = $[2];
|
|
76
|
+
return t2;
|
|
77
|
+
}
|
|
78
|
+
if (publications.data.length === 0) {
|
|
79
|
+
let t2;
|
|
80
|
+
if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
|
|
81
|
+
t2 = /* @__PURE__ */ jsx("p", {
|
|
82
|
+
className: "text-muted-foreground py-6 text-sm",
|
|
83
|
+
children: "Nothing published yet."
|
|
84
|
+
});
|
|
85
|
+
$[3] = t2;
|
|
86
|
+
} else t2 = $[3];
|
|
87
|
+
return t2;
|
|
88
|
+
}
|
|
89
|
+
let t2;
|
|
90
|
+
let t3;
|
|
91
|
+
let t4;
|
|
92
|
+
let t5;
|
|
93
|
+
if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
|
|
94
|
+
t2 = /* @__PURE__ */ jsx(Th, { children: "Name" });
|
|
95
|
+
t3 = /* @__PURE__ */ jsx(Th, { children: "Overview" });
|
|
96
|
+
t4 = /* @__PURE__ */ jsx(Th, { children: "Published by" });
|
|
97
|
+
t5 = /* @__PURE__ */ jsx(Th, { children: "Published" });
|
|
98
|
+
$[4] = t2;
|
|
99
|
+
$[5] = t3;
|
|
100
|
+
$[6] = t4;
|
|
101
|
+
$[7] = t5;
|
|
102
|
+
} else {
|
|
103
|
+
t2 = $[4];
|
|
104
|
+
t3 = $[5];
|
|
105
|
+
t4 = $[6];
|
|
106
|
+
t5 = $[7];
|
|
107
|
+
}
|
|
108
|
+
let t6;
|
|
109
|
+
if ($[8] === Symbol.for("react.memo_cache_sentinel")) {
|
|
110
|
+
t6 = /* @__PURE__ */ jsx("thead", {
|
|
111
|
+
className: "text-muted-foreground text-xs",
|
|
112
|
+
children: /* @__PURE__ */ jsxs("tr", { children: [
|
|
113
|
+
t2,
|
|
114
|
+
t3,
|
|
115
|
+
t4,
|
|
116
|
+
t5,
|
|
117
|
+
/* @__PURE__ */ jsx(Th, { children: /* @__PURE__ */ jsx("span", {
|
|
118
|
+
className: "sr-only",
|
|
119
|
+
children: "Actions"
|
|
120
|
+
}) })
|
|
121
|
+
] })
|
|
122
|
+
});
|
|
123
|
+
$[8] = t6;
|
|
124
|
+
} else t6 = $[8];
|
|
125
|
+
let t7;
|
|
126
|
+
if ($[9] !== onOpen || $[10] !== publications.data) {
|
|
127
|
+
let t8;
|
|
128
|
+
if ($[12] !== onOpen) {
|
|
129
|
+
t8 = (publication) => /* @__PURE__ */ jsx(PublicationRow, {
|
|
130
|
+
publication,
|
|
131
|
+
onOpen: () => onOpen(publication.id)
|
|
132
|
+
}, publication.id);
|
|
133
|
+
$[12] = onOpen;
|
|
134
|
+
$[13] = t8;
|
|
135
|
+
} else t8 = $[13];
|
|
136
|
+
t7 = publications.data.map(t8);
|
|
137
|
+
$[9] = onOpen;
|
|
138
|
+
$[10] = publications.data;
|
|
139
|
+
$[11] = t7;
|
|
140
|
+
} else t7 = $[11];
|
|
141
|
+
let t8;
|
|
142
|
+
if ($[14] !== t7) {
|
|
143
|
+
t8 = /* @__PURE__ */ jsxs("table", {
|
|
144
|
+
className: "w-full text-left text-sm",
|
|
145
|
+
children: [t6, /* @__PURE__ */ jsx("tbody", { children: t7 })]
|
|
146
|
+
});
|
|
147
|
+
$[14] = t7;
|
|
148
|
+
$[15] = t8;
|
|
149
|
+
} else t8 = $[15];
|
|
150
|
+
return t8;
|
|
151
|
+
}
|
|
152
|
+
function PublicationRow(t0) {
|
|
153
|
+
const $ = c(20);
|
|
154
|
+
const { publication, onOpen } = t0;
|
|
155
|
+
let t1;
|
|
156
|
+
if ($[0] !== publication) {
|
|
157
|
+
t1 = publicationLabel(publication);
|
|
158
|
+
$[0] = publication;
|
|
159
|
+
$[1] = t1;
|
|
160
|
+
} else t1 = $[1];
|
|
161
|
+
let t2;
|
|
162
|
+
if ($[2] !== t1) {
|
|
163
|
+
t2 = /* @__PURE__ */ jsx(Td, {
|
|
164
|
+
className: "font-medium",
|
|
165
|
+
children: t1
|
|
166
|
+
});
|
|
167
|
+
$[2] = t1;
|
|
168
|
+
$[3] = t2;
|
|
169
|
+
} else t2 = $[3];
|
|
170
|
+
const t3 = publication.overviewHeadline ?? "";
|
|
171
|
+
let t4;
|
|
172
|
+
if ($[4] !== t3) {
|
|
173
|
+
t4 = /* @__PURE__ */ jsx(Td, {
|
|
174
|
+
className: "text-muted-foreground",
|
|
175
|
+
children: t3
|
|
176
|
+
});
|
|
177
|
+
$[4] = t3;
|
|
178
|
+
$[5] = t4;
|
|
179
|
+
} else t4 = $[5];
|
|
180
|
+
let t5;
|
|
181
|
+
if ($[6] !== publication.publishedBy.name) {
|
|
182
|
+
t5 = /* @__PURE__ */ jsx(Td, { children: publication.publishedBy.name });
|
|
183
|
+
$[6] = publication.publishedBy.name;
|
|
184
|
+
$[7] = t5;
|
|
185
|
+
} else t5 = $[7];
|
|
186
|
+
let t6;
|
|
187
|
+
if ($[8] !== publication.publishedAt) {
|
|
188
|
+
t6 = timeAgo(publication.publishedAt);
|
|
189
|
+
$[8] = publication.publishedAt;
|
|
190
|
+
$[9] = t6;
|
|
191
|
+
} else t6 = $[9];
|
|
192
|
+
let t7;
|
|
193
|
+
if ($[10] !== t6) {
|
|
194
|
+
t7 = /* @__PURE__ */ jsx(Td, { children: t6 });
|
|
195
|
+
$[10] = t6;
|
|
196
|
+
$[11] = t7;
|
|
197
|
+
} else t7 = $[11];
|
|
198
|
+
let t8;
|
|
199
|
+
if ($[12] !== onOpen) {
|
|
200
|
+
t8 = /* @__PURE__ */ jsx(Td, { children: /* @__PURE__ */ jsx("div", {
|
|
201
|
+
className: "flex justify-end",
|
|
202
|
+
children: /* @__PURE__ */ jsx(Button, {
|
|
203
|
+
type: "button",
|
|
204
|
+
variant: "outline",
|
|
205
|
+
size: "sm",
|
|
206
|
+
onClick: onOpen,
|
|
207
|
+
children: "Open"
|
|
208
|
+
})
|
|
209
|
+
}) });
|
|
210
|
+
$[12] = onOpen;
|
|
211
|
+
$[13] = t8;
|
|
212
|
+
} else t8 = $[13];
|
|
213
|
+
let t9;
|
|
214
|
+
if ($[14] !== t2 || $[15] !== t4 || $[16] !== t5 || $[17] !== t7 || $[18] !== t8) {
|
|
215
|
+
t9 = /* @__PURE__ */ jsxs("tr", {
|
|
216
|
+
className: "border-t align-top",
|
|
217
|
+
children: [
|
|
218
|
+
t2,
|
|
219
|
+
t4,
|
|
220
|
+
t5,
|
|
221
|
+
t7,
|
|
222
|
+
t8
|
|
223
|
+
]
|
|
224
|
+
});
|
|
225
|
+
$[14] = t2;
|
|
226
|
+
$[15] = t4;
|
|
227
|
+
$[16] = t5;
|
|
228
|
+
$[17] = t7;
|
|
229
|
+
$[18] = t8;
|
|
230
|
+
$[19] = t9;
|
|
231
|
+
} else t9 = $[19];
|
|
232
|
+
return t9;
|
|
233
|
+
}
|
|
234
|
+
/** One Publication: who published it and when, its overview, and its thread, read-only. */
|
|
235
|
+
function PublicationView(t0) {
|
|
236
|
+
const $ = c(25);
|
|
237
|
+
const { projectId, id, onBack, onEntered } = t0;
|
|
238
|
+
let t1;
|
|
239
|
+
if ($[0] !== id || $[1] !== projectId) {
|
|
240
|
+
t1 = reads.publication({
|
|
241
|
+
projectId,
|
|
242
|
+
id
|
|
243
|
+
});
|
|
244
|
+
$[0] = id;
|
|
245
|
+
$[1] = projectId;
|
|
246
|
+
$[2] = t1;
|
|
247
|
+
} else t1 = $[2];
|
|
248
|
+
const publication = useReadQuery(t1);
|
|
249
|
+
let t2;
|
|
250
|
+
if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
|
|
251
|
+
t2 = /* @__PURE__ */ jsx(ArrowLeft, {
|
|
252
|
+
"aria-hidden": true,
|
|
253
|
+
className: "size-4"
|
|
254
|
+
});
|
|
255
|
+
$[3] = t2;
|
|
256
|
+
} else t2 = $[3];
|
|
257
|
+
let t3;
|
|
258
|
+
if ($[4] !== onBack) {
|
|
259
|
+
t3 = /* @__PURE__ */ jsxs(Button, {
|
|
260
|
+
type: "button",
|
|
261
|
+
variant: "ghost",
|
|
262
|
+
size: "sm",
|
|
263
|
+
onClick: onBack,
|
|
264
|
+
children: [t2, "Back"]
|
|
265
|
+
});
|
|
266
|
+
$[4] = onBack;
|
|
267
|
+
$[5] = t3;
|
|
268
|
+
} else t3 = $[5];
|
|
269
|
+
let t4;
|
|
270
|
+
if ($[6] !== id || $[7] !== onEntered || $[8] !== projectId) {
|
|
271
|
+
t4 = /* @__PURE__ */ jsx(RevertButton, {
|
|
272
|
+
projectId,
|
|
273
|
+
id,
|
|
274
|
+
onEntered
|
|
275
|
+
});
|
|
276
|
+
$[6] = id;
|
|
277
|
+
$[7] = onEntered;
|
|
278
|
+
$[8] = projectId;
|
|
279
|
+
$[9] = t4;
|
|
280
|
+
} else t4 = $[9];
|
|
281
|
+
let t5;
|
|
282
|
+
if ($[10] !== id || $[11] !== projectId || $[12] !== publication.data) {
|
|
283
|
+
t5 = publication.data && !publication.data.threadCleared && /* @__PURE__ */ jsx(ClearThread, {
|
|
284
|
+
projectId,
|
|
285
|
+
id
|
|
286
|
+
});
|
|
287
|
+
$[10] = id;
|
|
288
|
+
$[11] = projectId;
|
|
289
|
+
$[12] = publication.data;
|
|
290
|
+
$[13] = t5;
|
|
291
|
+
} else t5 = $[13];
|
|
292
|
+
let t6;
|
|
293
|
+
if ($[14] !== t4 || $[15] !== t5) {
|
|
294
|
+
t6 = /* @__PURE__ */ jsxs("div", {
|
|
295
|
+
className: "flex items-center gap-2",
|
|
296
|
+
children: [t4, t5]
|
|
297
|
+
});
|
|
298
|
+
$[14] = t4;
|
|
299
|
+
$[15] = t5;
|
|
300
|
+
$[16] = t6;
|
|
301
|
+
} else t6 = $[16];
|
|
302
|
+
let t7;
|
|
303
|
+
if ($[17] !== t3 || $[18] !== t6) {
|
|
304
|
+
t7 = /* @__PURE__ */ jsxs("div", {
|
|
305
|
+
className: "flex items-center justify-between gap-2",
|
|
306
|
+
children: [t3, t6]
|
|
307
|
+
});
|
|
308
|
+
$[17] = t3;
|
|
309
|
+
$[18] = t6;
|
|
310
|
+
$[19] = t7;
|
|
311
|
+
} else t7 = $[19];
|
|
312
|
+
let t8;
|
|
313
|
+
if ($[20] !== publication.data) {
|
|
314
|
+
t8 = publication.data ? /* @__PURE__ */ jsx(PublicationContent, { publication: publication.data }) : /* @__PURE__ */ jsx(Loading, {});
|
|
315
|
+
$[20] = publication.data;
|
|
316
|
+
$[21] = t8;
|
|
317
|
+
} else t8 = $[21];
|
|
318
|
+
let t9;
|
|
319
|
+
if ($[22] !== t7 || $[23] !== t8) {
|
|
320
|
+
t9 = /* @__PURE__ */ jsxs("div", {
|
|
321
|
+
className: "flex h-full flex-col gap-4 py-2",
|
|
322
|
+
children: [t7, t8]
|
|
323
|
+
});
|
|
324
|
+
$[22] = t7;
|
|
325
|
+
$[23] = t8;
|
|
326
|
+
$[24] = t9;
|
|
327
|
+
} else t9 = $[24];
|
|
328
|
+
return t9;
|
|
329
|
+
}
|
|
330
|
+
/**
|
|
331
|
+
* Starts a draft reverting the Publication, then takes the member into it on the same page, to
|
|
332
|
+
* review and publish it like any draft. A refusal, such as for a Publication with code, says why.
|
|
333
|
+
*/
|
|
334
|
+
function RevertButton(t0) {
|
|
335
|
+
const $ = c(11);
|
|
336
|
+
const { projectId, id, onEntered } = t0;
|
|
337
|
+
const navigate = useNavigate();
|
|
338
|
+
const switchView = useSwitchView();
|
|
339
|
+
let t1;
|
|
340
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
341
|
+
t1 = {
|
|
342
|
+
...publicationMutations.revert(),
|
|
343
|
+
onError: _temp
|
|
344
|
+
};
|
|
345
|
+
$[0] = t1;
|
|
346
|
+
} else t1 = $[0];
|
|
347
|
+
const revert = useMutation(t1);
|
|
348
|
+
let t2;
|
|
349
|
+
if ($[1] !== id || $[2] !== navigate || $[3] !== onEntered || $[4] !== projectId || $[5] !== revert || $[6] !== switchView) {
|
|
350
|
+
t2 = () => revert.mutate({
|
|
351
|
+
projectId,
|
|
352
|
+
id
|
|
353
|
+
}, { onSuccess: (t3) => {
|
|
354
|
+
const { draftId } = t3;
|
|
355
|
+
onEntered();
|
|
356
|
+
switchView(() => navigate({
|
|
357
|
+
to: window.location.href,
|
|
358
|
+
draft: draftId
|
|
359
|
+
}), {
|
|
360
|
+
loading: "Starting a draft reverting this publish…",
|
|
361
|
+
success: "Started a draft reverting this publish. You're now viewing it."
|
|
362
|
+
});
|
|
363
|
+
} });
|
|
364
|
+
$[1] = id;
|
|
365
|
+
$[2] = navigate;
|
|
366
|
+
$[3] = onEntered;
|
|
367
|
+
$[4] = projectId;
|
|
368
|
+
$[5] = revert;
|
|
369
|
+
$[6] = switchView;
|
|
370
|
+
$[7] = t2;
|
|
371
|
+
} else t2 = $[7];
|
|
372
|
+
const start = t2;
|
|
373
|
+
let t3;
|
|
374
|
+
if ($[8] !== revert.isPending || $[9] !== start) {
|
|
375
|
+
t3 = /* @__PURE__ */ jsx(Button, {
|
|
376
|
+
type: "button",
|
|
377
|
+
variant: "outline",
|
|
378
|
+
size: "sm",
|
|
379
|
+
disabled: revert.isPending,
|
|
380
|
+
onClick: start,
|
|
381
|
+
children: "Revert"
|
|
382
|
+
});
|
|
383
|
+
$[8] = revert.isPending;
|
|
384
|
+
$[9] = start;
|
|
385
|
+
$[10] = t3;
|
|
386
|
+
} else t3 = $[10];
|
|
387
|
+
return t3;
|
|
388
|
+
}
|
|
389
|
+
function _temp(error) {
|
|
390
|
+
return toast.error(error.message || "Could not revert this publish");
|
|
391
|
+
}
|
|
392
|
+
function PublicationContent(t0) {
|
|
393
|
+
const $ = c(21);
|
|
394
|
+
const { publication } = t0;
|
|
395
|
+
const { overview, thread } = publication;
|
|
396
|
+
let t1;
|
|
397
|
+
if ($[0] !== publication) {
|
|
398
|
+
t1 = publicationLabel(publication);
|
|
399
|
+
$[0] = publication;
|
|
400
|
+
$[1] = t1;
|
|
401
|
+
} else t1 = $[1];
|
|
402
|
+
let t2;
|
|
403
|
+
if ($[2] !== t1) {
|
|
404
|
+
t2 = /* @__PURE__ */ jsx("h3", {
|
|
405
|
+
className: "font-medium",
|
|
406
|
+
children: t1
|
|
407
|
+
});
|
|
408
|
+
$[2] = t1;
|
|
409
|
+
$[3] = t2;
|
|
410
|
+
} else t2 = $[3];
|
|
411
|
+
const t3 = publication.publishedBy.name;
|
|
412
|
+
let t4;
|
|
413
|
+
if ($[4] !== publication.publishedAt) {
|
|
414
|
+
t4 = timeAgo(publication.publishedAt);
|
|
415
|
+
$[4] = publication.publishedAt;
|
|
416
|
+
$[5] = t4;
|
|
417
|
+
} else t4 = $[5];
|
|
418
|
+
let t5;
|
|
419
|
+
if ($[6] !== publication.publishedBy.name || $[7] !== t4) {
|
|
420
|
+
t5 = /* @__PURE__ */ jsxs("p", {
|
|
421
|
+
className: "text-muted-foreground text-xs",
|
|
422
|
+
children: [
|
|
423
|
+
"Published by ",
|
|
424
|
+
t3,
|
|
425
|
+
" ",
|
|
426
|
+
t4
|
|
427
|
+
]
|
|
428
|
+
});
|
|
429
|
+
$[6] = publication.publishedBy.name;
|
|
430
|
+
$[7] = t4;
|
|
431
|
+
$[8] = t5;
|
|
432
|
+
} else t5 = $[8];
|
|
433
|
+
let t6;
|
|
434
|
+
if ($[9] !== t2 || $[10] !== t5) {
|
|
435
|
+
t6 = /* @__PURE__ */ jsxs("div", {
|
|
436
|
+
className: "flex flex-col gap-1",
|
|
437
|
+
children: [t2, t5]
|
|
438
|
+
});
|
|
439
|
+
$[9] = t2;
|
|
440
|
+
$[10] = t5;
|
|
441
|
+
$[11] = t6;
|
|
442
|
+
} else t6 = $[11];
|
|
443
|
+
let t7;
|
|
444
|
+
if ($[12] !== overview) {
|
|
445
|
+
t7 = overview && /* @__PURE__ */ jsxs("div", {
|
|
446
|
+
"data-overview": true,
|
|
447
|
+
className: "flex flex-col gap-2 text-sm",
|
|
448
|
+
children: [/* @__PURE__ */ jsx("p", {
|
|
449
|
+
className: "font-medium",
|
|
450
|
+
children: overview.headline
|
|
451
|
+
}), /* @__PURE__ */ jsx("ul", {
|
|
452
|
+
className: "text-foreground/85 flex list-disc flex-col gap-1.5 pl-5 leading-relaxed",
|
|
453
|
+
children: overview.bullets.map(_temp2)
|
|
454
|
+
})]
|
|
455
|
+
});
|
|
456
|
+
$[12] = overview;
|
|
457
|
+
$[13] = t7;
|
|
458
|
+
} else t7 = $[13];
|
|
459
|
+
let t8;
|
|
460
|
+
if ($[14] !== publication.threadCleared || $[15] !== thread) {
|
|
461
|
+
t8 = /* @__PURE__ */ jsx("div", {
|
|
462
|
+
className: "flex min-h-0 flex-1 flex-col border-t pt-2",
|
|
463
|
+
children: publication.threadCleared ? /* @__PURE__ */ jsxs("p", {
|
|
464
|
+
className: "text-muted-foreground py-6 text-sm",
|
|
465
|
+
children: [
|
|
466
|
+
"Thread cleared by ",
|
|
467
|
+
publication.threadCleared.by.name,
|
|
468
|
+
" ",
|
|
469
|
+
timeAgo(publication.threadCleared.at)
|
|
470
|
+
]
|
|
471
|
+
}) : thread.messages.length === 0 ? /* @__PURE__ */ jsx("p", {
|
|
472
|
+
className: "text-muted-foreground py-6 text-sm",
|
|
473
|
+
children: "No messages in this thread."
|
|
474
|
+
}) : /* @__PURE__ */ jsx(ThreadMessages, { view: thread })
|
|
475
|
+
});
|
|
476
|
+
$[14] = publication.threadCleared;
|
|
477
|
+
$[15] = thread;
|
|
478
|
+
$[16] = t8;
|
|
479
|
+
} else t8 = $[16];
|
|
480
|
+
let t9;
|
|
481
|
+
if ($[17] !== t6 || $[18] !== t7 || $[19] !== t8) {
|
|
482
|
+
t9 = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
483
|
+
t6,
|
|
484
|
+
t7,
|
|
485
|
+
t8
|
|
486
|
+
] });
|
|
487
|
+
$[17] = t6;
|
|
488
|
+
$[18] = t7;
|
|
489
|
+
$[19] = t8;
|
|
490
|
+
$[20] = t9;
|
|
491
|
+
} else t9 = $[20];
|
|
492
|
+
return t9;
|
|
493
|
+
}
|
|
494
|
+
function _temp2(bullet, index) {
|
|
495
|
+
return /* @__PURE__ */ jsx("li", { children: bullet }, index);
|
|
496
|
+
}
|
|
497
|
+
const Loading = () => {
|
|
498
|
+
const $ = c(1);
|
|
499
|
+
let t0;
|
|
500
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
501
|
+
t0 = /* @__PURE__ */ jsxs("div", {
|
|
502
|
+
className: "text-muted-foreground flex items-center gap-2 py-6 text-sm",
|
|
503
|
+
children: [/* @__PURE__ */ jsx(Spinner, { className: "size-3.5" }), " Loading..."]
|
|
504
|
+
});
|
|
505
|
+
$[0] = t0;
|
|
506
|
+
} else t0 = $[0];
|
|
507
|
+
return t0;
|
|
508
|
+
};
|
|
509
|
+
|
|
510
|
+
//#endregion
|
|
511
|
+
export { PublishedTab };
|