@opengeni/react 3.7.0-canary.7 → 3.8.0-canary.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.
- package/README.md +6 -0
- package/dist/chat.js +1 -1
- package/dist/chunk-5M6VTFJ5.js +171 -0
- package/dist/chunk-5M6VTFJ5.js.map +1 -0
- package/dist/{chunk-IOLVN74D.js → chunk-6J56T3MG.js} +15 -1
- package/dist/chunk-6J56T3MG.js.map +1 -0
- package/dist/{chunk-BQGIXRKV.js → chunk-7BWFU6H4.js} +22 -4
- package/dist/chunk-7BWFU6H4.js.map +1 -0
- package/dist/{chunk-3HIF5IFC.js → chunk-7W6PVVTK.js} +63 -18
- package/dist/chunk-7W6PVVTK.js.map +1 -0
- package/dist/{chunk-ZFOFY5ST.js → chunk-NLTS7JHI.js} +16 -31
- package/dist/chunk-NLTS7JHI.js.map +1 -0
- package/dist/chunk-NOSYBS2D.js +208 -0
- package/dist/chunk-NOSYBS2D.js.map +1 -0
- package/dist/{chunk-F2CFHN3Y.js → chunk-YAIPFO5D.js} +2 -1
- package/dist/chunk-YAIPFO5D.js.map +1 -0
- package/dist/chunk-YBM6CQRU.js +292 -0
- package/dist/chunk-YBM6CQRU.js.map +1 -0
- package/dist/chunk-ZYRGEKWS.js +216 -0
- package/dist/chunk-ZYRGEKWS.js.map +1 -0
- package/dist/components/composer.d.ts +4 -2
- package/dist/components/message-timeline.d.ts +9 -2
- package/dist/components/timeline-annotation-chrome.d.ts +25 -0
- package/dist/components/timeline-annotation-layout.d.ts +42 -0
- package/dist/components/timeline-annotation-markers.d.ts +8 -0
- package/dist/components/timeline-annotation-reveal-context.d.ts +4 -0
- package/dist/components/timeline-annotation-shared.d.ts +31 -0
- package/dist/components/timeline-annotations-dialog.d.ts +1 -1
- package/dist/components/timeline-annotations.d.ts +8 -2
- package/dist/composer.js +2 -2
- package/dist/hooks/use-composer.d.ts +2 -0
- package/dist/index.js +9 -6
- package/dist/index.js.map +1 -1
- package/dist/interaction.js +6 -6
- package/dist/machines.js +1 -1
- package/dist/{queue-surface-implementation-XL2A6PBM.js → queue-surface-implementation-LK3S4BIW.js} +5 -2
- package/dist/{queue-surface-implementation-XL2A6PBM.js.map → queue-surface-implementation-LK3S4BIW.js.map} +1 -1
- package/dist/session-ui.js +8 -5
- package/dist/session.js +1 -1
- package/dist/timeline-annotation-markers-DRSTLEM6.js +165 -0
- package/dist/timeline-annotation-markers-DRSTLEM6.js.map +1 -0
- package/dist/timeline-annotation-selection-IHLUGVND.js +236 -0
- package/dist/timeline-annotation-selection-IHLUGVND.js.map +1 -0
- package/dist/timeline-annotations-dialog-6Q53N5FG.js +262 -0
- package/dist/timeline-annotations-dialog-6Q53N5FG.js.map +1 -0
- package/package.json +2 -2
- package/src/components/chat-composer.tsx +5 -2
- package/src/components/composer.tsx +40 -5
- package/src/components/copy-button.tsx +1 -0
- package/src/components/machines-dashboard.tsx +1 -16
- package/src/components/message-timeline.tsx +357 -297
- package/src/components/timeline-annotation-chrome.tsx +183 -0
- package/src/components/timeline-annotation-layout.ts +268 -0
- package/src/components/timeline-annotation-markers.tsx +185 -0
- package/src/components/timeline-annotation-reveal-context.ts +9 -0
- package/src/components/timeline-annotation-selection.tsx +99 -54
- package/src/components/timeline-annotation-shared.ts +245 -0
- package/src/components/timeline-annotations-dialog.tsx +172 -128
- package/src/components/timeline-annotations.tsx +178 -45
- package/src/hooks/use-composer.ts +17 -0
- package/styles/compiled.css +86 -22
- package/dist/chunk-3HIF5IFC.js.map +0 -1
- package/dist/chunk-BQGIXRKV.js.map +0 -1
- package/dist/chunk-F2CFHN3Y.js.map +0 -1
- package/dist/chunk-IOLVN74D.js.map +0 -1
- package/dist/chunk-W3OUAH6M.js +0 -170
- package/dist/chunk-W3OUAH6M.js.map +0 -1
- package/dist/chunk-ZFOFY5ST.js.map +0 -1
- package/dist/timeline-annotation-selection-3L7LHGG2.js +0 -187
- package/dist/timeline-annotation-selection-3L7LHGG2.js.map +0 -1
- package/dist/timeline-annotations-dialog-U7EVLR75.js +0 -196
- package/dist/timeline-annotations-dialog-U7EVLR75.js.map +0 -1
|
@@ -74,7 +74,16 @@ function ComposerTip({
|
|
|
74
74
|
|
|
75
75
|
export type ComposerDelivery = Pick<
|
|
76
76
|
ComposerState,
|
|
77
|
-
|
|
77
|
+
| "value"
|
|
78
|
+
| "setValue"
|
|
79
|
+
| "send"
|
|
80
|
+
| "steer"
|
|
81
|
+
| "sending"
|
|
82
|
+
| "canSend"
|
|
83
|
+
| "error"
|
|
84
|
+
| "clearError"
|
|
85
|
+
| "annotations"
|
|
86
|
+
| "requestAnnotationReview"
|
|
78
87
|
>;
|
|
79
88
|
|
|
80
89
|
export type ComposerDraftState = Pick<
|
|
@@ -112,6 +121,7 @@ export type ChatComposerMessages = {
|
|
|
112
121
|
sendAndResumeAriaLabel: string;
|
|
113
122
|
sendTitle: string;
|
|
114
123
|
sendAndResumeTitle: string;
|
|
124
|
+
annotationNotesRequired: string;
|
|
115
125
|
workspacePaused: string;
|
|
116
126
|
pausedHere: string;
|
|
117
127
|
parentBlocker: string;
|
|
@@ -179,6 +189,7 @@ export const defaultChatComposerMessages: ChatComposerMessages = {
|
|
|
179
189
|
sendAndResumeAriaLabel: "Add message to queue",
|
|
180
190
|
sendTitle: "Queue message (Enter); steer with Cmd/Ctrl+Enter",
|
|
181
191
|
sendAndResumeTitle: "Add to queue (Enter); steer now with Cmd/Ctrl+Enter",
|
|
192
|
+
annotationNotesRequired: "Add a note to each quote before sending.",
|
|
182
193
|
workspacePaused: "Workspace paused",
|
|
183
194
|
pausedHere: "Paused here",
|
|
184
195
|
parentBlocker: "parent",
|
|
@@ -237,6 +248,7 @@ export type ComposerSubmitBlocker =
|
|
|
237
248
|
| "attachment"
|
|
238
249
|
| "sending"
|
|
239
250
|
| "command"
|
|
251
|
+
| "annotations"
|
|
240
252
|
| "empty"
|
|
241
253
|
| null;
|
|
242
254
|
|
|
@@ -547,6 +559,9 @@ export function useChatComposerController({
|
|
|
547
559
|
});
|
|
548
560
|
const paletteEnabled = commandContext !== undefined;
|
|
549
561
|
const commandDraftBlocked = paletteEnabled && palette.isCommandDraft;
|
|
562
|
+
const annotationsIncomplete = (delivery.annotations ?? []).some(
|
|
563
|
+
(annotation) => annotation.note.trim().length === 0,
|
|
564
|
+
);
|
|
550
565
|
|
|
551
566
|
const submitBlocker: ComposerSubmitBlocker = disabled
|
|
552
567
|
? "disabled"
|
|
@@ -556,9 +571,11 @@ export function useChatComposerController({
|
|
|
556
571
|
? "sending"
|
|
557
572
|
: commandDraftBlocked
|
|
558
573
|
? "command"
|
|
559
|
-
:
|
|
560
|
-
?
|
|
561
|
-
:
|
|
574
|
+
: annotationsIncomplete
|
|
575
|
+
? "annotations"
|
|
576
|
+
: delivery.canSend || hasReadyAttachment
|
|
577
|
+
? null
|
|
578
|
+
: "empty";
|
|
562
579
|
const canSubmit = submitBlocker === null;
|
|
563
580
|
|
|
564
581
|
const submit = useCallback(
|
|
@@ -570,6 +587,12 @@ export function useChatComposerController({
|
|
|
570
587
|
}
|
|
571
588
|
if (disabled || blockedByAttachment || delivery.sending || submittingRef.current)
|
|
572
589
|
return false;
|
|
590
|
+
if (annotationsIncomplete) {
|
|
591
|
+
setNotice({ tone: "error", message: messages.annotationNotesRequired });
|
|
592
|
+
delivery.clearError();
|
|
593
|
+
delivery.requestAnnotationReview?.();
|
|
594
|
+
return false;
|
|
595
|
+
}
|
|
573
596
|
if (!delivery.canSend && !hasReadyAttachment) return false;
|
|
574
597
|
submittingRef.current = true;
|
|
575
598
|
setSubmitting(true);
|
|
@@ -581,11 +604,13 @@ export function useChatComposerController({
|
|
|
581
604
|
}
|
|
582
605
|
},
|
|
583
606
|
[
|
|
607
|
+
annotationsIncomplete,
|
|
584
608
|
blockedByAttachment,
|
|
585
609
|
commandDraftBlocked,
|
|
586
610
|
delivery,
|
|
587
611
|
disabled,
|
|
588
612
|
hasReadyAttachment,
|
|
613
|
+
messages.annotationNotesRequired,
|
|
589
614
|
messages.slashCommandBlocked,
|
|
590
615
|
],
|
|
591
616
|
);
|
|
@@ -645,6 +670,12 @@ export function useChatComposerController({
|
|
|
645
670
|
);
|
|
646
671
|
return () => window.clearTimeout(timer);
|
|
647
672
|
}, [notice]);
|
|
673
|
+
useEffect(() => {
|
|
674
|
+
if (annotationsIncomplete) return;
|
|
675
|
+
setNotice((current) =>
|
|
676
|
+
current?.message === messages.annotationNotesRequired ? null : current,
|
|
677
|
+
);
|
|
678
|
+
}, [annotationsIncomplete, messages.annotationNotesRequired]);
|
|
648
679
|
|
|
649
680
|
const runControlOperation = useCallback(async (operation: () => Promise<void>) => {
|
|
650
681
|
if (controlOperationRef.current) return false;
|
|
@@ -1260,7 +1291,11 @@ export const SendButton = forwardRef<HTMLButtonElement, ComposerSendButtonProps>
|
|
|
1260
1291
|
const controller = useComposerController();
|
|
1261
1292
|
const tip =
|
|
1262
1293
|
title ??
|
|
1263
|
-
(controller.
|
|
1294
|
+
(controller.submitBlocker === "annotations"
|
|
1295
|
+
? controller.messages.annotationNotesRequired
|
|
1296
|
+
: controller.paused
|
|
1297
|
+
? controller.messages.sendAndResumeTitle
|
|
1298
|
+
: controller.messages.sendTitle);
|
|
1264
1299
|
return (
|
|
1265
1300
|
<ComposerTip tip={tip}>
|
|
1266
1301
|
<button
|
|
@@ -140,6 +140,7 @@ export function CopyHoverFrame({
|
|
|
140
140
|
{children}
|
|
141
141
|
{/* Sit under the body — top-right overlay collided with the first line. */}
|
|
142
142
|
<div
|
|
143
|
+
data-og-annotation-chrome=""
|
|
143
144
|
className={cn(
|
|
144
145
|
"mt-1 flex h-7 items-center gap-1.5",
|
|
145
146
|
align === "end" ? "justify-end" : "justify-start",
|
|
@@ -62,13 +62,9 @@ function EmptyState({ onEnroll }: { onEnroll?: (() => void) | undefined }) {
|
|
|
62
62
|
function Header({
|
|
63
63
|
count,
|
|
64
64
|
onEnroll,
|
|
65
|
-
onRefresh,
|
|
66
|
-
loading,
|
|
67
65
|
}: {
|
|
68
66
|
count: number;
|
|
69
67
|
onEnroll?: (() => void) | undefined;
|
|
70
|
-
onRefresh?: (() => void) | undefined;
|
|
71
|
-
loading?: boolean | undefined;
|
|
72
68
|
}): ReactNode {
|
|
73
69
|
return (
|
|
74
70
|
<div className="flex items-center justify-between gap-3">
|
|
@@ -77,17 +73,6 @@ function Header({
|
|
|
77
73
|
<span className="font-og-mono text-og-xs text-og-fg-subtle">{count}</span>
|
|
78
74
|
</div>
|
|
79
75
|
<div className="flex items-center gap-1.5">
|
|
80
|
-
{onRefresh ? (
|
|
81
|
-
<button
|
|
82
|
-
type="button"
|
|
83
|
-
data-refresh
|
|
84
|
-
onClick={onRefresh}
|
|
85
|
-
title="Refresh"
|
|
86
|
-
className="rounded-og-sm p-1.5 text-og-fg-subtle transition-colors hover:bg-og-surface-2 hover:text-og-fg"
|
|
87
|
-
>
|
|
88
|
-
<RefreshCwIcon className={cn("size-3.5", loading && "animate-og-spin")} aria-hidden />
|
|
89
|
-
</button>
|
|
90
|
-
) : null}
|
|
91
76
|
{onEnroll ? (
|
|
92
77
|
<button
|
|
93
78
|
type="button"
|
|
@@ -131,7 +116,7 @@ export function MachinesDashboard({
|
|
|
131
116
|
|
|
132
117
|
return (
|
|
133
118
|
<section data-machines-dashboard className={cn("og-root flex flex-col gap-3", className)}>
|
|
134
|
-
<Header count={machines.length} onEnroll={onEnroll}
|
|
119
|
+
<Header count={machines.length} onEnroll={onEnroll} />
|
|
135
120
|
|
|
136
121
|
{error ? (
|
|
137
122
|
<div
|