@opengeni/react 3.8.0-canary.0 → 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.
Files changed (72) hide show
  1. package/README.md +6 -0
  2. package/dist/chat.js +1 -1
  3. package/dist/chunk-5M6VTFJ5.js +171 -0
  4. package/dist/chunk-5M6VTFJ5.js.map +1 -0
  5. package/dist/{chunk-IOLVN74D.js → chunk-6J56T3MG.js} +15 -1
  6. package/dist/chunk-6J56T3MG.js.map +1 -0
  7. package/dist/{chunk-BQGIXRKV.js → chunk-7BWFU6H4.js} +22 -4
  8. package/dist/chunk-7BWFU6H4.js.map +1 -0
  9. package/dist/{chunk-3HIF5IFC.js → chunk-7W6PVVTK.js} +63 -18
  10. package/dist/chunk-7W6PVVTK.js.map +1 -0
  11. package/dist/{chunk-ZFOFY5ST.js → chunk-NLTS7JHI.js} +16 -31
  12. package/dist/chunk-NLTS7JHI.js.map +1 -0
  13. package/dist/chunk-NOSYBS2D.js +208 -0
  14. package/dist/chunk-NOSYBS2D.js.map +1 -0
  15. package/dist/{chunk-F2CFHN3Y.js → chunk-YAIPFO5D.js} +2 -1
  16. package/dist/chunk-YAIPFO5D.js.map +1 -0
  17. package/dist/chunk-YBM6CQRU.js +292 -0
  18. package/dist/chunk-YBM6CQRU.js.map +1 -0
  19. package/dist/chunk-ZYRGEKWS.js +216 -0
  20. package/dist/chunk-ZYRGEKWS.js.map +1 -0
  21. package/dist/components/composer.d.ts +4 -2
  22. package/dist/components/message-timeline.d.ts +9 -2
  23. package/dist/components/timeline-annotation-chrome.d.ts +25 -0
  24. package/dist/components/timeline-annotation-layout.d.ts +42 -0
  25. package/dist/components/timeline-annotation-markers.d.ts +8 -0
  26. package/dist/components/timeline-annotation-reveal-context.d.ts +4 -0
  27. package/dist/components/timeline-annotation-shared.d.ts +31 -0
  28. package/dist/components/timeline-annotations-dialog.d.ts +1 -1
  29. package/dist/components/timeline-annotations.d.ts +8 -2
  30. package/dist/composer.js +2 -2
  31. package/dist/hooks/use-composer.d.ts +2 -0
  32. package/dist/index.js +9 -6
  33. package/dist/index.js.map +1 -1
  34. package/dist/interaction.js +6 -6
  35. package/dist/machines.js +1 -1
  36. package/dist/{queue-surface-implementation-XL2A6PBM.js → queue-surface-implementation-LK3S4BIW.js} +5 -2
  37. package/dist/{queue-surface-implementation-XL2A6PBM.js.map → queue-surface-implementation-LK3S4BIW.js.map} +1 -1
  38. package/dist/session-ui.js +8 -5
  39. package/dist/session.js +1 -1
  40. package/dist/timeline-annotation-markers-DRSTLEM6.js +165 -0
  41. package/dist/timeline-annotation-markers-DRSTLEM6.js.map +1 -0
  42. package/dist/timeline-annotation-selection-IHLUGVND.js +236 -0
  43. package/dist/timeline-annotation-selection-IHLUGVND.js.map +1 -0
  44. package/dist/timeline-annotations-dialog-6Q53N5FG.js +262 -0
  45. package/dist/timeline-annotations-dialog-6Q53N5FG.js.map +1 -0
  46. package/package.json +2 -2
  47. package/src/components/chat-composer.tsx +5 -2
  48. package/src/components/composer.tsx +40 -5
  49. package/src/components/copy-button.tsx +1 -0
  50. package/src/components/machines-dashboard.tsx +1 -16
  51. package/src/components/message-timeline.tsx +357 -297
  52. package/src/components/timeline-annotation-chrome.tsx +183 -0
  53. package/src/components/timeline-annotation-layout.ts +268 -0
  54. package/src/components/timeline-annotation-markers.tsx +185 -0
  55. package/src/components/timeline-annotation-reveal-context.ts +9 -0
  56. package/src/components/timeline-annotation-selection.tsx +99 -54
  57. package/src/components/timeline-annotation-shared.ts +245 -0
  58. package/src/components/timeline-annotations-dialog.tsx +172 -128
  59. package/src/components/timeline-annotations.tsx +178 -45
  60. package/src/hooks/use-composer.ts +17 -0
  61. package/styles/compiled.css +86 -22
  62. package/dist/chunk-3HIF5IFC.js.map +0 -1
  63. package/dist/chunk-BQGIXRKV.js.map +0 -1
  64. package/dist/chunk-F2CFHN3Y.js.map +0 -1
  65. package/dist/chunk-IOLVN74D.js.map +0 -1
  66. package/dist/chunk-W3OUAH6M.js +0 -170
  67. package/dist/chunk-W3OUAH6M.js.map +0 -1
  68. package/dist/chunk-ZFOFY5ST.js.map +0 -1
  69. package/dist/timeline-annotation-selection-3L7LHGG2.js +0 -187
  70. package/dist/timeline-annotation-selection-3L7LHGG2.js.map +0 -1
  71. package/dist/timeline-annotations-dialog-U7EVLR75.js +0 -196
  72. package/dist/timeline-annotations-dialog-U7EVLR75.js.map +0 -1
@@ -0,0 +1,25 @@
1
+ import type { DraftTimelineAnnotation, TimelineAnnotation, TimelineAnnotationSource } from "@opengeni/sdk";
2
+ import { type ReactNode } from "react";
3
+ export type TimelineAnnotationLike = DraftTimelineAnnotation | TimelineAnnotation;
4
+ export declare function AnnotationQuoteSourceButton({ annotation, lines, onRevealSource, onUnavailable, }: {
5
+ annotation: TimelineAnnotationLike;
6
+ lines?: 2 | 3;
7
+ onRevealSource?: ((source: TimelineAnnotationSource) => boolean) | undefined;
8
+ onUnavailable: (id: string | null) => void;
9
+ }): import("react").JSX.Element;
10
+ export declare function AnnotationAccentRow({ children, className, }: {
11
+ children: ReactNode;
12
+ className?: string | undefined;
13
+ }): import("react").JSX.Element;
14
+ export declare function AnnotationNotePreview({ note, annotationId, ordinal, className, }: {
15
+ note: string;
16
+ annotationId: string;
17
+ ordinal: number;
18
+ className?: string | undefined;
19
+ }): import("react").JSX.Element | null;
20
+ export declare function AnnotationNoteField({ annotation, inputRef, onUpdate, onCommit, }: {
21
+ annotation: TimelineAnnotationLike;
22
+ inputRef?: ((node: HTMLTextAreaElement | null) => void) | undefined;
23
+ onUpdate: (id: string, note: string) => void;
24
+ onCommit?: (() => void) | undefined;
25
+ }): import("react").JSX.Element;
@@ -0,0 +1,42 @@
1
+ export type AnnotationBox = {
2
+ left: number;
3
+ right: number;
4
+ top: number;
5
+ bottom: number;
6
+ };
7
+ export type AnnotationBadgeAnchor = {
8
+ id: string;
9
+ ordinal: number;
10
+ left: number;
11
+ top: number;
12
+ incomplete: boolean;
13
+ };
14
+ export declare const ANNOTATION_BADGE_GAP_PX = 32;
15
+ export declare const ANNOTATION_BADGE_MIN_GAP_PX = 12;
16
+ export declare const ANNOTATION_REVIEW_DIALOG_WIDTH_PX = 400;
17
+ export declare const ANNOTATION_REVIEW_DIALOG_MAX_HEIGHT_PX: number;
18
+ export declare const ANNOTATION_REVIEW_DIALOG_MIN_HEIGHT_PX = 160;
19
+ export declare const ANNOTATION_REVIEW_DIALOG_FLOOR_HEIGHT_PX = 80;
20
+ export declare const ANNOTATION_REVIEW_MARGIN_PX = 12;
21
+ export declare const ANNOTATION_NOTE_PREVIEW_CHARS = 280;
22
+ export declare const ANNOTATION_CARD_STACK_SCROLL_AT = 4;
23
+ export declare function annotationBoxIntersects(a: AnnotationBox, b: AnnotationBox): boolean;
24
+ export declare function annotationViewportBox(viewportWidth: number, viewportHeight: number, scroller?: AnnotationBox | null): AnnotationBox;
25
+ export declare function annotationNoteNeedsDisclosure(note: string): boolean;
26
+ export declare function annotationBadgePackGap(viewport: AnnotationBox, count: number, preferred?: number): number;
27
+ export declare function layoutAnnotationBadges(anchors: readonly AnnotationBadgeAnchor[], viewport: AnnotationBox, preferredGap?: number): AnnotationBadgeAnchor[];
28
+ export declare function scrollAnnotationRowIntoList(list: HTMLElement | null | undefined, row: HTMLElement | null | undefined): void;
29
+ export declare function clampAnnotationDialogPlacement(input: {
30
+ triggerLeft: number;
31
+ triggerTop: number;
32
+ triggerBottom: number;
33
+ contentHeight: number;
34
+ viewportWidth: number;
35
+ viewportHeight: number;
36
+ panelWidth?: number;
37
+ }): {
38
+ left: number;
39
+ top: number;
40
+ maxHeight: number;
41
+ above: boolean;
42
+ };
@@ -0,0 +1,8 @@
1
+ import type { DraftTimelineAnnotation } from "@opengeni/sdk";
2
+ import { type RefObject } from "react";
3
+ export declare function TimelineAnnotationMarkers({ annotations, onSelect, rootRef, }: {
4
+ annotations: readonly DraftTimelineAnnotation[];
5
+ onSelect?: ((id: string) => void) | undefined;
6
+ rootRef: RefObject<HTMLElement | null>;
7
+ }): import("react").ReactPortal | null;
8
+ export default TimelineAnnotationMarkers;
@@ -0,0 +1,4 @@
1
+ import { type RefObject } from "react";
2
+ /** Owning timeline scroller for quote-source navigation. */
3
+ export declare const TimelineAnnotationSourceRootContext: import("react").Context<RefObject<HTMLElement | null> | null>;
4
+ export declare function useTimelineAnnotationSourceRoot(): RefObject<HTMLElement | null> | null;
@@ -0,0 +1,31 @@
1
+ import type { TimelineAnnotationSource } from "@opengeni/sdk";
2
+ export declare const ANNOTATION_CHROME_SELECTOR = "[data-og-annotation-chrome], [data-og-annotation-badge], [data-og-annotation-popover]";
3
+ export declare function annotationHasNote(note: string): boolean;
4
+ export declare function annotationDisplayOrdinal(annotation: {
5
+ readonly id?: string;
6
+ readonly ordinal?: number | undefined;
7
+ }, index: number): number;
8
+ export declare function sourceKindLabel(kind: TimelineAnnotationSource["kind"]): string;
9
+ export declare function annotationSourceLabel(source: TimelineAnnotationSource): string;
10
+ export declare function truncateAnnotationQuote(quote: string, maxChars?: number): string;
11
+ export declare function cssEscapeAttribute(value: string): string;
12
+ export declare function isAnnotationChromeNode(node: Node | null): boolean;
13
+ export declare function occurrenceOffsets(text: string, quote: string): number[];
14
+ export declare function matchingQuoteInSource(sourceText: string, quote: string): string | null;
15
+ type AnnotatableSpan = {
16
+ node: Text;
17
+ start: number;
18
+ length: number;
19
+ };
20
+ export declare function annotatableText(root: HTMLElement): {
21
+ text: string;
22
+ spans: AnnotatableSpan[];
23
+ };
24
+ export declare function rangeFromOffsets(spans: AnnotatableSpan[], startOffset: number, endOffset: number): Range | null;
25
+ export declare function buildQuoteRange(sourceEl: HTMLElement, quote: string, occurrenceIndex?: number): Range | null;
26
+ export declare function quoteOccurrenceIndex(sourceEl: HTMLElement, range: Range, quote: string): number;
27
+ export declare function clipRangeToSource(range: Range, sourceEl: HTMLElement): Range | null;
28
+ export declare function visibleClientRect(range: Range): DOMRect | null;
29
+ export declare function resolveAnnotationRevealRoot(from: Element | null | undefined): HTMLElement | null;
30
+ export declare function revealLoadedAnnotationSource(source: TimelineAnnotationSource, root?: ParentNode | null): boolean;
31
+ export {};
@@ -1,6 +1,6 @@
1
1
  import type { TimelineAnnotationSource } from "@opengeni/sdk";
2
2
  import { type RefObject } from "react";
3
- import type { TimelineAnnotationLike } from "./timeline-annotations.js";
3
+ import { type TimelineAnnotationLike } from "./timeline-annotation-chrome.js";
4
4
  export declare function TimelineAnnotationsDialog({ annotations, editable, focusAnnotationId, onFocusConsumed, onUpdate, onRemove, onRevealSource, triggerRef, countLabel, onDismiss, }: {
5
5
  annotations: readonly TimelineAnnotationLike[];
6
6
  editable: boolean;
@@ -1,5 +1,11 @@
1
- import type { DraftTimelineAnnotation, TimelineAnnotation, TimelineAnnotationSource } from "@opengeni/sdk";
2
- export type TimelineAnnotationLike = DraftTimelineAnnotation | TimelineAnnotation;
1
+ import type { TimelineAnnotationSource } from "@opengeni/sdk";
2
+ import { type TimelineAnnotationLike } from "./timeline-annotation-chrome.js";
3
+ export type { TimelineAnnotationLike } from "./timeline-annotation-chrome.js";
4
+ export declare function TimelineAnnotationCards({ annotations, onRevealSource, className, }: {
5
+ annotations: readonly TimelineAnnotationLike[];
6
+ onRevealSource?: ((source: TimelineAnnotationSource) => boolean) | undefined;
7
+ className?: string | undefined;
8
+ }): import("react").JSX.Element | null;
3
9
  export declare function TimelineAnnotationsChip({ annotations, editable, focusAnnotationId, onFocusConsumed, onUpdate, onRemove, onRevealSource, className, }: {
4
10
  annotations: readonly TimelineAnnotationLike[];
5
11
  editable?: boolean | undefined;
package/dist/composer.js CHANGED
@@ -40,7 +40,7 @@ import {
40
40
  useChatComposer,
41
41
  useChatComposerController,
42
42
  useVoiceInput
43
- } from "./chunk-BQGIXRKV.js";
43
+ } from "./chunk-7BWFU6H4.js";
44
44
  import {
45
45
  BillingClassMark,
46
46
  ModelPolicyPicker,
@@ -49,7 +49,7 @@ import {
49
49
  PickerNavRow,
50
50
  defaultModelPolicyPickerMessages
51
51
  } from "./chunk-R4KRSFGA.js";
52
- import "./chunk-IOLVN74D.js";
52
+ import "./chunk-6J56T3MG.js";
53
53
  import "./chunk-PLYRL5ER.js";
54
54
  import "./chunk-KZ73RL76.js";
55
55
  import "./chunk-NEXLLTP4.js";
@@ -59,6 +59,8 @@ export type ComposerState = {
59
59
  /** Newly captured annotation the review surface should focus. */
60
60
  annotationReviewTargetId?: string | null | undefined;
61
61
  clearAnnotationReviewTarget?: (() => void) | undefined;
62
+ /** Focus an annotation, or the first incomplete note when omitted. */
63
+ requestAnnotationReview?: ((id?: string) => void) | undefined;
62
64
  /** Read the current draft synchronously before a destructive replacement. */
63
65
  hasDraftContent: () => boolean;
64
66
  /** Append the draft behind prompts already visible in the queue. */
package/dist/index.js CHANGED
@@ -28,7 +28,7 @@ import {
28
28
  healthPulses,
29
29
  pointsFor,
30
30
  useMachines
31
- } from "./chunk-ZFOFY5ST.js";
31
+ } from "./chunk-NLTS7JHI.js";
32
32
  import {
33
33
  DesktopViewer,
34
34
  useDesktopStream,
@@ -99,8 +99,11 @@ import {
99
99
  useWorkspaceModelCatalog,
100
100
  userMessageLikelyNeedsDisclosure,
101
101
  v4aToGitFileDiff
102
- } from "./chunk-3HIF5IFC.js";
103
- import "./chunk-W3OUAH6M.js";
102
+ } from "./chunk-7W6PVVTK.js";
103
+ import "./chunk-YBM6CQRU.js";
104
+ import "./chunk-5M6VTFJ5.js";
105
+ import "./chunk-ZYRGEKWS.js";
106
+ import "./chunk-NOSYBS2D.js";
104
107
  import {
105
108
  OpenGeniProvider
106
109
  } from "./chunk-PAJU5KKL.js";
@@ -139,7 +142,7 @@ import {
139
142
  useSlashCommands,
140
143
  useTranscription,
141
144
  useVoiceInput
142
- } from "./chunk-BQGIXRKV.js";
145
+ } from "./chunk-7BWFU6H4.js";
143
146
  import {
144
147
  BillingClassMark,
145
148
  ModelPolicyPicker,
@@ -191,7 +194,7 @@ import {
191
194
  shouldSteerOnKey,
192
195
  shouldSubmitOnKey,
193
196
  useComposer
194
- } from "./chunk-IOLVN74D.js";
197
+ } from "./chunk-6J56T3MG.js";
195
198
  import {
196
199
  COMPOSER_PAYMENT_REQUIRED_MESSAGE,
197
200
  CREDIT_EXHAUSTION_MESSAGE,
@@ -226,7 +229,7 @@ import {
226
229
  prefersReducedMotion,
227
230
  sandboxFileLocationFromHref,
228
231
  sandboxFilePathFromHref
229
- } from "./chunk-F2CFHN3Y.js";
232
+ } from "./chunk-YAIPFO5D.js";
230
233
  import {
231
234
  copyTextToClipboard,
232
235
  tableElementToTsv