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
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { reads, useReadQuery } from "../../../lib/studio-reads.js";
|
|
2
|
+
import { cn } from "../../../lib/utils.js";
|
|
2
3
|
import { draftMutations } from "../../../lib/queries.js";
|
|
3
4
|
import { studioStore } from "../studioStore.js";
|
|
4
5
|
import { localeName } from "../localeOptions.js";
|
|
5
6
|
import { fixMessage, whereSentence } from "../fixMessage.js";
|
|
6
|
-
import { draftLabel, plural } from "../draftLabel.js";
|
|
7
7
|
import { useLeaveDraft } from "../viewSwitch.js";
|
|
8
|
+
import { draftLabel, plural } from "../draftLabel.js";
|
|
8
9
|
import { useShowInCanvas } from "../showInCanvas.js";
|
|
9
10
|
import { c } from "react/compiler-runtime";
|
|
10
11
|
import { useState } from "react";
|
|
@@ -424,12 +425,17 @@ function _temp4(error) {
|
|
|
424
425
|
return toast.error(error.message || "Could not summarize the draft");
|
|
425
426
|
}
|
|
426
427
|
/**
|
|
428
|
+
* The review's body is tall enough for a typical overview from the start, so the dialog doesn't
|
|
429
|
+
* grow once it's written. A longer one scrolls within the dialog's own limit.
|
|
430
|
+
*/
|
|
431
|
+
const REVIEW_BODY_HEIGHT = "min-h-52";
|
|
432
|
+
/**
|
|
427
433
|
* Reviews a draft before publishing it whole (ADR 0009, ADR 0043). Publish is held only by
|
|
428
434
|
* blockers or an empty draft, never by work Camox still runs. Once the draft ends, the studio
|
|
429
435
|
* switches to Live.
|
|
430
436
|
*/
|
|
431
437
|
function ReviewDraftDialog(t0) {
|
|
432
|
-
const $ = c(
|
|
438
|
+
const $ = c(66);
|
|
433
439
|
const { projectId, draftId, open, onOpenChange } = t0;
|
|
434
440
|
let t1;
|
|
435
441
|
if ($[0] !== draftId || $[1] !== projectId) {
|
|
@@ -482,10 +488,7 @@ function ReviewDraftDialog(t0) {
|
|
|
482
488
|
let t7;
|
|
483
489
|
if ($[12] !== leaveDraft || $[13] !== onOpenChange || $[14] !== preview) {
|
|
484
490
|
t7 = (result) => {
|
|
485
|
-
if ("publishing" in result && result.publishing)
|
|
486
|
-
preview.refetch();
|
|
487
|
-
return;
|
|
488
|
-
}
|
|
491
|
+
if ("publishing" in result && result.publishing) return preview.refetch();
|
|
489
492
|
if (!result.empty) {
|
|
490
493
|
onOpenChange(false);
|
|
491
494
|
return leaveDraft(result.ended);
|
|
@@ -531,33 +534,40 @@ function ReviewDraftDialog(t0) {
|
|
|
531
534
|
let t12;
|
|
532
535
|
let t13;
|
|
533
536
|
let t14;
|
|
534
|
-
|
|
537
|
+
let t15;
|
|
538
|
+
if ($[21] !== data || $[22] !== draft.data || $[23] !== failed || $[24] !== onOpenChange || $[25] !== open || $[26] !== projectId || $[27] !== publishing || $[28] !== showInCanvas) {
|
|
535
539
|
const lines = data ? reviewLines(data) : [];
|
|
536
540
|
if (failed && !lines.includes(PUBLISH_FAILED)) lines.push(PUBLISH_FAILED);
|
|
537
541
|
T1 = Dialog;
|
|
538
|
-
|
|
539
|
-
|
|
542
|
+
t14 = open;
|
|
543
|
+
if ($[37] !== onOpenChange || $[38] !== publishing) {
|
|
544
|
+
t15 = (next) => (next || !publishing) && onOpenChange(next);
|
|
545
|
+
$[37] = onOpenChange;
|
|
546
|
+
$[38] = publishing;
|
|
547
|
+
$[39] = t15;
|
|
548
|
+
} else t15 = $[39];
|
|
540
549
|
T0 = DialogContent;
|
|
541
|
-
t10 = "flex max-h-[85vh] flex-col gap-4 sm:max-w-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
$[
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
+
t10 = "flex max-h-[85vh] flex-col gap-4 sm:max-w-xl";
|
|
551
|
+
t11 = !publishing;
|
|
552
|
+
let t16;
|
|
553
|
+
if ($[40] !== draft.data) {
|
|
554
|
+
t16 = draft.data ? draftLabel(draft.data) : "Draft";
|
|
555
|
+
$[40] = draft.data;
|
|
556
|
+
$[41] = t16;
|
|
557
|
+
} else t16 = $[41];
|
|
558
|
+
if ($[42] !== t16) {
|
|
559
|
+
t12 = /* @__PURE__ */ jsx(DialogHeader, {
|
|
550
560
|
className: "pr-8",
|
|
551
561
|
children: /* @__PURE__ */ jsx(DialogTitle, {
|
|
552
562
|
className: "truncate text-base",
|
|
553
|
-
children:
|
|
563
|
+
children: t16
|
|
554
564
|
})
|
|
555
565
|
});
|
|
556
|
-
$[
|
|
557
|
-
$[
|
|
558
|
-
} else
|
|
559
|
-
|
|
560
|
-
className: "-mx-6 flex
|
|
566
|
+
$[42] = t16;
|
|
567
|
+
$[43] = t12;
|
|
568
|
+
} else t12 = $[43];
|
|
569
|
+
t13 = data ? /* @__PURE__ */ jsxs("div", {
|
|
570
|
+
className: cn("-mx-6 flex flex-col gap-4 overflow-y-auto px-6", REVIEW_BODY_HEIGHT),
|
|
561
571
|
children: [
|
|
562
572
|
/* @__PURE__ */ jsx(DraftOverview, {
|
|
563
573
|
projectId,
|
|
@@ -573,7 +583,7 @@ function ReviewDraftDialog(t0) {
|
|
|
573
583
|
lines.map(_temp7)
|
|
574
584
|
]
|
|
575
585
|
}) : /* @__PURE__ */ jsx("div", {
|
|
576
|
-
className: "flex items-center justify-center
|
|
586
|
+
className: cn("flex items-center justify-center", REVIEW_BODY_HEIGHT),
|
|
577
587
|
children: /* @__PURE__ */ jsx(Spinner, { className: "text-muted-foreground" })
|
|
578
588
|
});
|
|
579
589
|
$[21] = data;
|
|
@@ -582,81 +592,86 @@ function ReviewDraftDialog(t0) {
|
|
|
582
592
|
$[24] = onOpenChange;
|
|
583
593
|
$[25] = open;
|
|
584
594
|
$[26] = projectId;
|
|
585
|
-
$[27] =
|
|
586
|
-
$[28] =
|
|
587
|
-
$[29] =
|
|
588
|
-
$[30] =
|
|
589
|
-
$[31] =
|
|
590
|
-
$[32] =
|
|
591
|
-
$[33] =
|
|
592
|
-
$[34] =
|
|
595
|
+
$[27] = publishing;
|
|
596
|
+
$[28] = showInCanvas;
|
|
597
|
+
$[29] = T0;
|
|
598
|
+
$[30] = T1;
|
|
599
|
+
$[31] = t10;
|
|
600
|
+
$[32] = t11;
|
|
601
|
+
$[33] = t12;
|
|
602
|
+
$[34] = t13;
|
|
603
|
+
$[35] = t14;
|
|
604
|
+
$[36] = t15;
|
|
593
605
|
} else {
|
|
594
|
-
T0 = $[
|
|
595
|
-
T1 = $[
|
|
596
|
-
t10 = $[
|
|
597
|
-
t11 = $[
|
|
598
|
-
t12 = $[
|
|
599
|
-
t13 = $[
|
|
600
|
-
t14 = $[
|
|
606
|
+
T0 = $[29];
|
|
607
|
+
T1 = $[30];
|
|
608
|
+
t10 = $[31];
|
|
609
|
+
t11 = $[32];
|
|
610
|
+
t12 = $[33];
|
|
611
|
+
t13 = $[34];
|
|
612
|
+
t14 = $[35];
|
|
613
|
+
t15 = $[36];
|
|
601
614
|
}
|
|
602
|
-
const
|
|
603
|
-
let t16;
|
|
604
|
-
if ($[39] !== data || $[40] !== projectId || $[41] !== publish) {
|
|
605
|
-
t16 = () => data && publish.mutate(publishInput(projectId, data));
|
|
606
|
-
$[39] = data;
|
|
607
|
-
$[40] = projectId;
|
|
608
|
-
$[41] = publish;
|
|
609
|
-
$[42] = t16;
|
|
610
|
-
} else t16 = $[42];
|
|
615
|
+
const t16 = !data || data.blockers.length > 0 || empty || publishing;
|
|
611
616
|
let t17;
|
|
612
|
-
if ($[
|
|
613
|
-
t17 =
|
|
614
|
-
$[
|
|
615
|
-
$[
|
|
616
|
-
|
|
617
|
-
let t18;
|
|
618
|
-
if ($[45] !== t15 || $[46] !== t16 || $[47] !== t17) {
|
|
619
|
-
t18 = /* @__PURE__ */ jsx(DialogFooter, { children: /* @__PURE__ */ jsxs(Button, {
|
|
620
|
-
disabled: t15,
|
|
621
|
-
onClick: t16,
|
|
622
|
-
children: [t17, "Publish"]
|
|
623
|
-
}) });
|
|
624
|
-
$[45] = t15;
|
|
625
|
-
$[46] = t16;
|
|
617
|
+
if ($[44] !== data || $[45] !== projectId || $[46] !== publish) {
|
|
618
|
+
t17 = () => data && publish.mutate(publishInput(projectId, data));
|
|
619
|
+
$[44] = data;
|
|
620
|
+
$[45] = projectId;
|
|
621
|
+
$[46] = publish;
|
|
626
622
|
$[47] = t17;
|
|
627
|
-
|
|
628
|
-
|
|
623
|
+
} else t17 = $[47];
|
|
624
|
+
let t18;
|
|
625
|
+
if ($[48] !== publishing) {
|
|
626
|
+
t18 = publishing ? /* @__PURE__ */ jsx(Spinner, {}) : null;
|
|
627
|
+
$[48] = publishing;
|
|
628
|
+
$[49] = t18;
|
|
629
|
+
} else t18 = $[49];
|
|
629
630
|
let t19;
|
|
630
|
-
if ($[
|
|
631
|
-
t19 = /* @__PURE__ */ jsxs(
|
|
631
|
+
if ($[50] !== t16 || $[51] !== t17 || $[52] !== t18) {
|
|
632
|
+
t19 = /* @__PURE__ */ jsx(DialogFooter, { children: /* @__PURE__ */ jsxs(Button, {
|
|
633
|
+
disabled: t16,
|
|
634
|
+
onClick: t17,
|
|
635
|
+
children: [t18, "Publish"]
|
|
636
|
+
}) });
|
|
637
|
+
$[50] = t16;
|
|
638
|
+
$[51] = t17;
|
|
639
|
+
$[52] = t18;
|
|
640
|
+
$[53] = t19;
|
|
641
|
+
} else t19 = $[53];
|
|
642
|
+
let t20;
|
|
643
|
+
if ($[54] !== T0 || $[55] !== t10 || $[56] !== t11 || $[57] !== t12 || $[58] !== t13 || $[59] !== t19) {
|
|
644
|
+
t20 = /* @__PURE__ */ jsxs(T0, {
|
|
632
645
|
className: t10,
|
|
646
|
+
showCloseButton: t11,
|
|
633
647
|
children: [
|
|
634
|
-
t11,
|
|
635
648
|
t12,
|
|
636
|
-
|
|
649
|
+
t13,
|
|
650
|
+
t19
|
|
637
651
|
]
|
|
638
652
|
});
|
|
639
|
-
$[
|
|
640
|
-
$[
|
|
641
|
-
$[
|
|
642
|
-
$[
|
|
643
|
-
$[
|
|
644
|
-
$[
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
653
|
+
$[54] = T0;
|
|
654
|
+
$[55] = t10;
|
|
655
|
+
$[56] = t11;
|
|
656
|
+
$[57] = t12;
|
|
657
|
+
$[58] = t13;
|
|
658
|
+
$[59] = t19;
|
|
659
|
+
$[60] = t20;
|
|
660
|
+
} else t20 = $[60];
|
|
661
|
+
let t21;
|
|
662
|
+
if ($[61] !== T1 || $[62] !== t14 || $[63] !== t15 || $[64] !== t20) {
|
|
663
|
+
t21 = /* @__PURE__ */ jsx(T1, {
|
|
664
|
+
open: t14,
|
|
665
|
+
onOpenChange: t15,
|
|
666
|
+
children: t20
|
|
652
667
|
});
|
|
653
|
-
$[
|
|
654
|
-
$[
|
|
655
|
-
$[
|
|
656
|
-
$[
|
|
657
|
-
$[
|
|
658
|
-
} else
|
|
659
|
-
return
|
|
668
|
+
$[61] = T1;
|
|
669
|
+
$[62] = t14;
|
|
670
|
+
$[63] = t15;
|
|
671
|
+
$[64] = t20;
|
|
672
|
+
$[65] = t21;
|
|
673
|
+
} else t21 = $[65];
|
|
674
|
+
return t21;
|
|
660
675
|
}
|
|
661
676
|
function _temp7(line) {
|
|
662
677
|
return /* @__PURE__ */ jsx("p", {
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { cn } from "../../../lib/utils.js";
|
|
2
|
+
import { c } from "react/compiler-runtime";
|
|
3
|
+
import "react";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
|
|
6
|
+
//#region src/features/studio/components/SheetTable.tsx
|
|
7
|
+
/** A header cell of the drafts sheet's tables. */
|
|
8
|
+
const Th = (t0) => {
|
|
9
|
+
const $ = c(2);
|
|
10
|
+
const { children } = t0;
|
|
11
|
+
let t1;
|
|
12
|
+
if ($[0] !== children) {
|
|
13
|
+
t1 = /* @__PURE__ */ jsx("th", {
|
|
14
|
+
className: "px-2 py-2 font-medium",
|
|
15
|
+
children
|
|
16
|
+
});
|
|
17
|
+
$[0] = children;
|
|
18
|
+
$[1] = t1;
|
|
19
|
+
} else t1 = $[1];
|
|
20
|
+
return t1;
|
|
21
|
+
};
|
|
22
|
+
/** A cell of the drafts sheet's tables. */
|
|
23
|
+
const Td = (t0) => {
|
|
24
|
+
const $ = c(5);
|
|
25
|
+
const { children, className } = t0;
|
|
26
|
+
let t1;
|
|
27
|
+
if ($[0] !== className) {
|
|
28
|
+
t1 = cn("px-2 py-2", className);
|
|
29
|
+
$[0] = className;
|
|
30
|
+
$[1] = t1;
|
|
31
|
+
} else t1 = $[1];
|
|
32
|
+
let t2;
|
|
33
|
+
if ($[2] !== children || $[3] !== t1) {
|
|
34
|
+
t2 = /* @__PURE__ */ jsx("td", {
|
|
35
|
+
className: t1,
|
|
36
|
+
children
|
|
37
|
+
});
|
|
38
|
+
$[2] = children;
|
|
39
|
+
$[3] = t1;
|
|
40
|
+
$[4] = t2;
|
|
41
|
+
} else t2 = $[4];
|
|
42
|
+
return t2;
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
//#endregion
|
|
46
|
+
export { Td, Th };
|
|
@@ -11,8 +11,8 @@ import { BOTTOM_CARD_EDGES, CARD_BODY_EDGES } from "../../preview/components/Sid
|
|
|
11
11
|
import { editCollectionItemPath } from "../routes.js";
|
|
12
12
|
import { studioStore } from "../studioStore.js";
|
|
13
13
|
import { dismissLabel, dismissedSentence, findingSentence, fixWithAgentMessage } from "../findingSentence.js";
|
|
14
|
-
import { useShowInCanvas } from "../showInCanvas.js";
|
|
15
14
|
import { Squareling } from "./Squareling.js";
|
|
15
|
+
import { useShowInCanvas } from "../showInCanvas.js";
|
|
16
16
|
import { moreSentence, reportSentence, shortTimeAgo, whereReportLeads } from "../reportSentence.js";
|
|
17
17
|
import { aboutSentence, whenTag } from "../specialistBio.js";
|
|
18
18
|
import { workingSentence } from "../workingSentence.js";
|