@arbidocs/blocks 0.4.150 → 0.4.151

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 (107) hide show
  1. package/dist/{ConnectedNativeDocxComparison-XQSXVGHR.js → ConnectedNativeDocxComparison-OFPIXNJB.js} +6 -6
  2. package/dist/{ConnectedStreamedWordArtifact-UZVNBKQB.js.map → ConnectedNativeDocxComparison-OFPIXNJB.js.map} +1 -1
  3. package/dist/{ConnectedNativeDocxComparison-3XQSINPQ.cjs → ConnectedNativeDocxComparison-Y5BNLNH6.cjs} +7 -7
  4. package/dist/{ConnectedNativeDocxComparison-3XQSINPQ.cjs.map → ConnectedNativeDocxComparison-Y5BNLNH6.cjs.map} +1 -1
  5. package/dist/{ConnectedNativeDocxEditor-OUWFMIPH.cjs → ConnectedNativeDocxEditor-HTEW5JAH.cjs} +7 -7
  6. package/dist/{ConnectedNativeDocxEditor-OUWFMIPH.cjs.map → ConnectedNativeDocxEditor-HTEW5JAH.cjs.map} +1 -1
  7. package/dist/{ConnectedNativeDocxEditor-IPEZDERL.js → ConnectedNativeDocxEditor-LRYU5HPA.js} +5 -5
  8. package/dist/{ConnectedNativeDocxEditor-IPEZDERL.js.map → ConnectedNativeDocxEditor-LRYU5HPA.js.map} +1 -1
  9. package/dist/{ConnectedStreamedWordArtifact-UZVNBKQB.js → ConnectedStreamedWordArtifact-QAUVUCSX.js} +6 -6
  10. package/dist/{ConnectedNativeDocxComparison-XQSXVGHR.js.map → ConnectedStreamedWordArtifact-QAUVUCSX.js.map} +1 -1
  11. package/dist/{ConnectedStreamedWordArtifact-D5LSMDO4.cjs → ConnectedStreamedWordArtifact-QW74LKHN.cjs} +7 -7
  12. package/dist/ConnectedStreamedWordArtifact-QW74LKHN.cjs.map +1 -0
  13. package/dist/agents/index.cjs +238 -238
  14. package/dist/agents/index.js +4 -4
  15. package/dist/calls/index.cjs +3 -3
  16. package/dist/calls/index.js +2 -2
  17. package/dist/{chunk-IPQ5MJ4Z.cjs → chunk-2FLWPM3B.cjs} +5 -5
  18. package/dist/{chunk-IPQ5MJ4Z.cjs.map → chunk-2FLWPM3B.cjs.map} +1 -1
  19. package/dist/{chunk-CQPFW64W.js → chunk-3PCBYOIZ.js} +3 -3
  20. package/dist/{chunk-CQPFW64W.js.map → chunk-3PCBYOIZ.js.map} +1 -1
  21. package/dist/{chunk-Q6N6MZKO.js → chunk-4236BRZK.js} +3 -3
  22. package/dist/{chunk-Q6N6MZKO.js.map → chunk-4236BRZK.js.map} +1 -1
  23. package/dist/{chunk-KLPRAQCE.cjs → chunk-6I6CVX5G.cjs} +2 -2
  24. package/dist/{chunk-KLPRAQCE.cjs.map → chunk-6I6CVX5G.cjs.map} +1 -1
  25. package/dist/{chunk-TAWPVD6C.cjs → chunk-B3FMUFAW.cjs} +3 -3
  26. package/dist/{chunk-TAWPVD6C.cjs.map → chunk-B3FMUFAW.cjs.map} +1 -1
  27. package/dist/{chunk-3E2F4AHD.js → chunk-CROTH2BS.js} +5 -5
  28. package/dist/{chunk-3E2F4AHD.js.map → chunk-CROTH2BS.js.map} +1 -1
  29. package/dist/{chunk-ILM42LE6.cjs → chunk-CU2O32Z4.cjs} +25 -25
  30. package/dist/{chunk-ILM42LE6.cjs.map → chunk-CU2O32Z4.cjs.map} +1 -1
  31. package/dist/{chunk-TL45OJQE.js → chunk-DB2OXRQC.js} +3 -3
  32. package/dist/{chunk-TL45OJQE.js.map → chunk-DB2OXRQC.js.map} +1 -1
  33. package/dist/{chunk-ZAVEMQ37.cjs → chunk-DWZXSPMB.cjs} +3 -3
  34. package/dist/{chunk-ZAVEMQ37.cjs.map → chunk-DWZXSPMB.cjs.map} +1 -1
  35. package/dist/{chunk-XRWHFMHK.js → chunk-EYJMMGXF.js} +2 -2
  36. package/dist/{chunk-XRWHFMHK.js.map → chunk-EYJMMGXF.js.map} +1 -1
  37. package/dist/{chunk-NWNAYXC7.cjs → chunk-GFOEWPAP.cjs} +3 -3
  38. package/dist/{chunk-NWNAYXC7.cjs.map → chunk-GFOEWPAP.cjs.map} +1 -1
  39. package/dist/{chunk-YIFCLNII.cjs → chunk-HALD6ZB5.cjs} +4 -4
  40. package/dist/{chunk-YIFCLNII.cjs.map → chunk-HALD6ZB5.cjs.map} +1 -1
  41. package/dist/{chunk-TC25LGIM.js → chunk-HUJF2XM2.js} +4 -4
  42. package/dist/chunk-HUJF2XM2.js.map +1 -0
  43. package/dist/{chunk-GGTUMLCT.cjs → chunk-Q4BY2CQQ.cjs} +3 -3
  44. package/dist/{chunk-GGTUMLCT.cjs.map → chunk-Q4BY2CQQ.cjs.map} +1 -1
  45. package/dist/{chunk-AXTDDWMR.js → chunk-QN47Q4N7.js} +3 -3
  46. package/dist/{chunk-AXTDDWMR.js.map → chunk-QN47Q4N7.js.map} +1 -1
  47. package/dist/{chunk-V4YZXGXR.cjs → chunk-T74Q3MCZ.cjs} +4 -4
  48. package/dist/chunk-T74Q3MCZ.cjs.map +1 -0
  49. package/dist/{chunk-3FSXWVHW.cjs → chunk-U6JQ4KMX.cjs} +3 -3
  50. package/dist/{chunk-3FSXWVHW.cjs.map → chunk-U6JQ4KMX.cjs.map} +1 -1
  51. package/dist/{chunk-ECERC6TI.js → chunk-VHJHY7TT.js} +3 -3
  52. package/dist/{chunk-ECERC6TI.js.map → chunk-VHJHY7TT.js.map} +1 -1
  53. package/dist/{chunk-UTVY63DG.js → chunk-WFA2GVZJ.js} +3 -3
  54. package/dist/{chunk-UTVY63DG.js.map → chunk-WFA2GVZJ.js.map} +1 -1
  55. package/dist/{chunk-ZO7PJMCO.js → chunk-WU34CHU5.js} +3 -3
  56. package/dist/{chunk-ZO7PJMCO.js.map → chunk-WU34CHU5.js.map} +1 -1
  57. package/dist/{chunk-HGLC566X.js → chunk-YXNNNP57.js} +3 -3
  58. package/dist/{chunk-HGLC566X.js.map → chunk-YXNNNP57.js.map} +1 -1
  59. package/dist/{chunk-EDV7CYG6.cjs → chunk-ZP6Q3KXU.cjs} +4 -4
  60. package/dist/{chunk-EDV7CYG6.cjs.map → chunk-ZP6Q3KXU.cjs.map} +1 -1
  61. package/dist/collaboration/index.cjs +1 -1
  62. package/dist/collaboration/index.js +1 -1
  63. package/dist/connect/docx.cjs +9 -9
  64. package/dist/connect/docx.js +5 -5
  65. package/dist/connect/index.cjs +292 -292
  66. package/dist/connect/index.d.ts +1 -1
  67. package/dist/connect/index.js +13 -13
  68. package/dist/connect/viewer.cjs +1249 -121
  69. package/dist/connect/viewer.cjs.map +1 -1
  70. package/dist/connect/viewer.js +1145 -21
  71. package/dist/connect/viewer.js.map +1 -1
  72. package/dist/connection/viewer/parsed/ParsedPassage.d.ts +48 -0
  73. package/dist/connection/viewer/parsed/ParsedTextView.d.ts +17 -0
  74. package/dist/connection/viewer/parsed/PassageTagPanel.d.ts +18 -0
  75. package/dist/connection/viewer/parsed/citation-line.d.ts +17 -0
  76. package/dist/connection/viewer/parsed/document-tags.d.ts +8 -0
  77. package/dist/connection/viewer/parsed/useChunkTagging.d.ts +46 -0
  78. package/dist/connection/viewer/parsed/useCitationSelection.d.ts +27 -0
  79. package/dist/connection/viewer/parsed/useDocumentLabels.d.ts +38 -0
  80. package/dist/connection/viewer/parsed/useLazyPages.d.ts +18 -0
  81. package/dist/connection/viewer/parsed/usePageScrollSync.d.ts +17 -0
  82. package/dist/connection/viewer/parsed/usePassageCopy.d.ts +25 -0
  83. package/dist/connection/viewer/support.d.ts +27 -9
  84. package/dist/facts/index.cjs +55 -55
  85. package/dist/facts/index.js +5 -5
  86. package/dist/files/TagPassagePanel.d.ts +2 -1
  87. package/dist/files/index.cjs +169 -169
  88. package/dist/files/index.js +3 -3
  89. package/dist/home/index.cjs +2 -2
  90. package/dist/home/index.js +2 -2
  91. package/dist/index.cjs +355 -355
  92. package/dist/index.js +8 -8
  93. package/dist/retrieval/index.cjs +1 -1
  94. package/dist/retrieval/index.js +1 -1
  95. package/dist/settings/index.cjs +164 -164
  96. package/dist/settings/index.js +3 -3
  97. package/dist/shell/index.cjs +2 -2
  98. package/dist/shell/index.js +2 -2
  99. package/dist/studio/index.cjs +2 -2
  100. package/dist/studio/index.js +2 -2
  101. package/dist/workflow-canvas/index.cjs +16 -16
  102. package/dist/workflow-canvas/index.js +4 -4
  103. package/node_modules/@arbidocs/coedit/package.json +1 -1
  104. package/package.json +5 -5
  105. package/dist/ConnectedStreamedWordArtifact-D5LSMDO4.cjs.map +0 -1
  106. package/dist/chunk-TC25LGIM.js.map +0 -1
  107. package/dist/chunk-V4YZXGXR.cjs.map +0 -1
@@ -0,0 +1,48 @@
1
+ /**
2
+ * ParsedPassage: binds one parsed chunk to the `HtmlPassage` block (markdown body, citation
3
+ * entity pills, copy/link/label/navigator actions). Memoized so selecting one passage does not
4
+ * re-parse the markdown of the others.
5
+ */
6
+ import type { ProcessedChunk } from '@arbidocs/react/viewers';
7
+ import type { PassageLabel } from './useDocumentLabels';
8
+ export interface ParsedPassageProps {
9
+ chunk: ProcessedChunk;
10
+ pageNumber: number | null;
11
+ isHighlighted: boolean;
12
+ isSelected: boolean;
13
+ /** One of a fact's cited passages, listed in an open Citation popover. */
14
+ isCitationHighlight: boolean;
15
+ /** The cited passage currently being read from the Citation popover. */
16
+ isActiveCitation: boolean;
17
+ /** A fact's Citation popover drives the highlights; its shades win over the selection fill. */
18
+ factCitationActive: boolean;
19
+ isCitationMode: boolean;
20
+ runIsStart: boolean;
21
+ runIsEnd: boolean;
22
+ /** Last passage index of the run; set only on the run's first member. */
23
+ runEndIndex: number | undefined;
24
+ onChunkClick: ((chunkId: string, extendFromAnchor: boolean) => void) | undefined;
25
+ formatChunkWithCitation: (content: string, pageNumber: number | undefined, chunkExtId: string | undefined) => string;
26
+ getPassageDeepLink: (chunkExtId: string | undefined) => string | null;
27
+ copyToClipboard: (text: string, metadata: {
28
+ type: 'passage' | 'link';
29
+ documentTitle: string;
30
+ pageNumber: number | undefined;
31
+ passageIndex: number | undefined;
32
+ passageContent: string;
33
+ href?: string;
34
+ }) => void;
35
+ /** Open the document's passages in the host's navigator. Absent: not offered. */
36
+ onOpenNavigator: (() => void) | undefined;
37
+ /** Labels applied to this passage. */
38
+ labels: PassageLabel[];
39
+ /** The label currently being walked, when it marks this passage. */
40
+ activeTagColor: string | undefined;
41
+ /** Open the tagging panel for this passage. */
42
+ onTagPassage: ((chunkExtId: string) => void) | undefined;
43
+ /** Walk a label's passages (the label mark's Show row). */
44
+ onShowLabel: ((tagExtId: string) => void) | undefined;
45
+ /** Take a label off this passage (the label mark's Remove row). */
46
+ onRemoveLabel: ((chunkExtId: string, tagExtId: string) => void) | undefined;
47
+ }
48
+ export declare const ParsedPassage: import("react").NamedExoticComponent<ParsedPassageProps>;
@@ -0,0 +1,17 @@
1
+ /**
2
+ * The text view of a document: its parsed passages, page by page, with labels, citation picking,
3
+ * passage links and copying, and the passage a citation opened it at. Data and behaviour live in
4
+ * the hooks (labels, citation selection, lazy pages); the markup is the blocks HtmlViewer parts.
5
+ */
6
+ export interface ParsedTextViewProps {
7
+ documentId: string;
8
+ stage?: 'marker' | 'subchunk' | 'final';
9
+ onLoadSuccess?: (totalPages: number) => void;
10
+ /** Incremented to trigger scroll to current page */
11
+ scrollTrigger?: number;
12
+ /** Text zoom, a multiplier of the normal size (1 = 100%). */
13
+ zoom?: number;
14
+ /** Called by pinch and double-tap. */
15
+ onZoomChange?: (zoom: number) => void;
16
+ }
17
+ export declare function ParsedTextView({ documentId, stage, onLoadSuccess, scrollTrigger, zoom, onZoomChange, }: ParsedTextViewProps): import("react").JSX.Element;
@@ -0,0 +1,18 @@
1
+ /**
2
+ * The passage tagging panel: the `TagPassagePanel` block bound to the passage's labels and fields
3
+ * (apply, remove, a note per passage).
4
+ */
5
+ import type { components } from '@arbidocs/client';
6
+ type DocTag = components['schemas']['DocTagResponse'];
7
+ interface PassageTagPanelProps {
8
+ documentId: string;
9
+ chunkExtId: string;
10
+ chunkContent: string;
11
+ pageNumber?: number;
12
+ documentDoctags: DocTag[];
13
+ onClose: () => void;
14
+ /** Called when a tag is selected to show all chunks with that tag */
15
+ onViewTaggedChunks?: (tagExtId: string) => void;
16
+ }
17
+ export declare function PassageTagPanel({ documentId, chunkExtId, chunkContent, pageNumber, documentDoctags, onClose, onViewTaggedChunks, }: PassageTagPanelProps): import("react").JSX.Element;
18
+ export {};
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Utility functions for formatting citations
3
+ */
4
+ interface ChunkCopyData {
5
+ content: string;
6
+ documentTitle?: string;
7
+ documentDate?: string;
8
+ pageNumber?: number;
9
+ chunkId?: string;
10
+ }
11
+ /**
12
+ * Formats a citation in basic academic format
13
+ * @param data - The chunk and document data
14
+ * @returns Formatted citation string
15
+ */
16
+ export declare function formatCitation(data: ChunkCopyData): string;
17
+ export {};
@@ -0,0 +1,8 @@
1
+ import type { components } from '@arbidocs/client';
2
+ type ScopedTag = Pick<components['schemas']['TagResponse'], 'kind' | 'doctag_count' | 'facttag_count'>;
3
+ /**
4
+ * A tag of the documents' vocabulary: not a saved search, and used on documents or not used
5
+ * anywhere yet (a tag used only on facts belongs to the facts').
6
+ */
7
+ export declare function isDocumentTag(tag: ScopedTag): boolean;
8
+ export {};
@@ -0,0 +1,46 @@
1
+ /**
2
+ * Hook for managing chunk-level tagging
3
+ *
4
+ * Provides utilities for applying/removing tags to specific chunks
5
+ * within a document, and determining which tags apply to a chunk.
6
+ *
7
+ * Citations format: CitedDocument[] — a doc-first, best-first list of the
8
+ * documents (each with its cited chunks) backing the doctag's note. A doctag
9
+ * is grounded in passages, so a document that loses its last chunk drops out,
10
+ * and the doctag itself becomes ungrounded (null) once no documents remain.
11
+ */
12
+ import type { components } from '@arbidocs/client';
13
+ type CitationSources = components['schemas']['CitationSources'];
14
+ type DocTag = components['schemas']['DocTagResponse'];
15
+ type Tag = Pick<components['schemas']['TagResponse'], 'external_id'>;
16
+ type Citations = CitationSources | null | undefined;
17
+ interface UseChunkTaggingProps {
18
+ documentId: string;
19
+ documentDoctags: DocTag[];
20
+ }
21
+ interface ChunkTagState {
22
+ /** Tags that are applied to this specific chunk */
23
+ appliedTags: DocTag[];
24
+ /** Check if a specific tag is applied to this chunk */
25
+ isTagApplied: (tagExtId: string) => boolean;
26
+ /** Get the doctag for a specific tag if it applies to this chunk */
27
+ getDoctagForChunk: (tagExtId: string) => DocTag | undefined;
28
+ }
29
+ /** Every passage backing the doctag, document order then chunk order. */
30
+ export declare function getAllChunkIdsFromCitations(citations: Citations): string[];
31
+ /**
32
+ * Drop a passage. A doctag is grounded in passages, not whole documents, so a
33
+ * document that loses its last passage goes too; null once none remain, so an
34
+ * emptied doctag is ungrounded rather than grounded-in-nothing.
35
+ */
36
+ export declare function removeChunkFromCitations(citations: Citations, chunkExtId: string): Citations;
37
+ /** Add a passage under its document, ignoring duplicates. Order is the ranking. */
38
+ export declare function addChunkToCitations(citations: Citations, documentId: string, chunkExtId: string): CitationSources;
39
+ export declare function useChunkTagging({ documentId, documentDoctags }: UseChunkTaggingProps): {
40
+ getChunkTagState: (chunkExtId: string) => ChunkTagState;
41
+ toggleChunkTag: (chunkExtId: string, tag: Tag, note?: string) => Promise<void>;
42
+ updateChunkTagNote: (_chunkExtId: string, tag: Tag, note: string | null) => Promise<void>;
43
+ getChunkTagColors: (chunkExtId: string, workspaceTags: Tag[]) => string[];
44
+ isLoading: boolean;
45
+ };
46
+ export {};
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Passage selection for citations in the parsed viewer: drag-to-select, click / shift-click
3
+ * ranges, contiguous runs, the cited-run stepper, and the fact-citation highlight set.
4
+ */
5
+ import type { RefObject } from 'react';
6
+ import type { ProcessedPage } from '@arbidocs/react/viewers';
7
+ interface Options {
8
+ documentId: string;
9
+ containerRef: RefObject<HTMLDivElement | null>;
10
+ processedChunks: ProcessedPage[];
11
+ orderedChunkIds: string[];
12
+ pageOf: (id: string) => number | undefined;
13
+ }
14
+ export declare function useCitationSelection({ documentId, containerRef, processedChunks, orderedChunkIds, pageOf, }: Options): {
15
+ isCitationMode: boolean;
16
+ selectedChunks: Set<string>;
17
+ selectionRuns: Map<string, import("@arbidocs/react/viewers").ChunkRunInfo>;
18
+ runStartIds: string[];
19
+ runCursor: number;
20
+ gotoRun: (delta: number) => void;
21
+ handleSelectionEnd: () => void;
22
+ handleChunkClick: (chunkId: string, extendFromAnchor: boolean) => void;
23
+ factCitationSet: Set<string>;
24
+ factCitationActive: boolean;
25
+ viewingPassageId: string | null;
26
+ };
27
+ export {};
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Labels (doctags) on the parsed document: summaries, per-passage colours, the label being
3
+ * walked, and the passage being labelled. A doctag is anchored to the document, so its passages
4
+ * come with the document itself; no reverse lookup.
5
+ */
6
+ import type { components } from '@arbidocs/client';
7
+ type DocTag = components['schemas']['DocTagResponse'];
8
+ /** One label marking a passage. */
9
+ export interface PassageLabel {
10
+ tagExtId: string;
11
+ name: string;
12
+ color: string;
13
+ }
14
+ export declare function useDocumentLabels(documentId: string, doctags: DocTag[] | undefined, orderedChunkIds: string[]): {
15
+ documentDoctags: {
16
+ note?: string | null;
17
+ citations?: components["schemas"]["CitationSources"] | null;
18
+ external_id: string;
19
+ doc_ext_id: string;
20
+ tag_ext_id: string;
21
+ created_by_ext_id: string;
22
+ updated_by_ext_id?: string | null;
23
+ created_at: string;
24
+ updated_at: string;
25
+ }[];
26
+ labelSummaries: import("../../../files").DocTagSummary[];
27
+ labelsByChunk: Map<string, PassageLabel[]>;
28
+ removeLabel: (chunkExtId: string, tagExtId: string) => Promise<void>;
29
+ activeTagExtId: string | null;
30
+ activeTagColor: string | undefined;
31
+ activeChunkIds: Set<string>;
32
+ tagCursor: number;
33
+ gotoTagged: (delta: number) => void;
34
+ selectTag: (tagExtId: string | null) => void;
35
+ taggingChunkId: string | null;
36
+ setTaggingChunkId: import("react").Dispatch<import("react").SetStateAction<string | null>>;
37
+ };
38
+ export {};
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Lazy page rendering for the parsed viewer: only pages near the viewport render their chunks;
3
+ * the rest idle-fill, and a target page/passage (deep link, search, citation) is pre-rendered and
4
+ * scrolled into view.
5
+ */
6
+ import type { RefObject } from 'react';
7
+ import type { ProcessedPage } from '@arbidocs/react/viewers';
8
+ interface Options {
9
+ containerRef: RefObject<HTMLDivElement | null>;
10
+ processedChunks: ProcessedPage[];
11
+ scrollTrigger?: number;
12
+ }
13
+ export declare function useLazyPages({ containerRef, processedChunks, scrollTrigger }: Options): {
14
+ renderedPages: Set<number>;
15
+ isChunkHighlighted: (chunkId: string) => boolean;
16
+ placeholderHeight: number;
17
+ };
18
+ export {};
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Page Scroll Sync Hook
3
+ *
4
+ * Handles bidirectional page synchronization between HTML viewer and page controls.
5
+ * Manages tab switch scrolling, passage highlighting, and manual page navigation.
6
+ */
7
+ interface UsePageScrollSyncProps {
8
+ containerRef: React.RefObject<HTMLDivElement | null>;
9
+ processedChunksLength: number;
10
+ scrollTrigger?: number;
11
+ /** Optional callback with visibility data for lazy loading */
12
+ onVisibilityUpdate?: (visibilityMap: Map<number, number>) => void;
13
+ }
14
+ export declare function usePageScrollSync({ containerRef, processedChunksLength, scrollTrigger, onVisibilityUpdate, }: UsePageScrollSyncProps): {
15
+ isChunkHighlighted: (chunkId: string) => boolean;
16
+ };
17
+ export {};
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Passage Copy Hook
3
+ *
4
+ * Handles citation formatting and clipboard operations for document passages.
5
+ */
6
+ import type { ViewerDocumentRecord } from '../support';
7
+ interface PassageInfo {
8
+ type: 'link' | 'passage';
9
+ documentTitle: string;
10
+ pageNumber?: number;
11
+ passageIndex?: number;
12
+ passageContent: string;
13
+ href?: string;
14
+ }
15
+ interface UsePassageCopyProps {
16
+ documentId: string;
17
+ documentData: ViewerDocumentRecord | null | undefined;
18
+ selectedWorkspaceId: string | null;
19
+ }
20
+ export declare function usePassageCopy({ documentId, documentData, selectedWorkspaceId, }: UsePassageCopyProps): {
21
+ formatChunkWithCitation: (chunkContent: string, pageNumber?: number, chunkExtId?: string) => string;
22
+ getPassageDeepLink: (chunkExtId?: string) => string;
23
+ copyToClipboard: (text: string, passageInfo?: PassageInfo) => Promise<void>;
24
+ };
25
+ export {};
@@ -57,20 +57,38 @@ export interface DocumentViewerSupport {
57
57
  translate?: (documentRef: string) => void;
58
58
  /** Start an image generation from the image on screen. Absent: not offered. */
59
59
  useImageAsReference?: (documentId: string) => void;
60
- /** The text (parsed) view of the document; the viewer gives it the page and zoom. */
61
- renderParsedView?: (props: ParsedViewProps) => ReactNode;
60
+ /**
61
+ * A citation being edited elsewhere (a fact's sources, a field's) picks its passages in the text
62
+ * view: clicks and selections there are handed to it. Absent: passages are not pickable.
63
+ */
64
+ passageCitation?: PassageCitation;
65
+ /** Open the document's passages in the host's navigator (a passage's menu). Absent: not offered. */
66
+ openInNavigator?: (documentId: string) => void;
67
+ /** Start a new label or field in the host's editor (the passage tagging panel). Absent: not offered. */
68
+ createTag?: () => void;
62
69
  /** How dates read (versions, signatures). Default: `fmtDate`. */
63
70
  formatDate?: (iso: string) => string;
64
71
  /** The viewer is shown in another window: PDF pages render without the page's web fonts. */
65
72
  isDetached?: boolean;
66
73
  }
67
- /** What the viewer hands the text view. */
68
- export interface ParsedViewProps {
69
- documentId: string;
70
- onLoadSuccess: (totalPages: number) => void;
71
- scrollTrigger: number;
72
- zoom: number;
73
- onZoomChange: (zoom: number) => void;
74
+ /** A passage picked for a citation: its chunk and, when known, its page. */
75
+ export interface PickedPassage {
76
+ chunk_id: string;
77
+ page?: number;
78
+ }
79
+ /** The citation a host is editing, as the text view sees it. */
80
+ export interface PassageCitation {
81
+ /** The citation picking passages now, and the document it picks in; null when none is. */
82
+ active: {
83
+ documentId: string;
84
+ key: string | null;
85
+ } | null;
86
+ /** Passages to light (a fact's cited passages while its sources are open). */
87
+ highlighted: readonly string[];
88
+ /** Passages added to the citation. */
89
+ pick: (passages: PickedPassage[]) => void;
90
+ /** Passages taken off it. */
91
+ unpick: (chunkIds: string[]) => void;
74
92
  }
75
93
  export declare function DocumentViewerSupportProvider({ value, children, }: {
76
94
  value: DocumentViewerSupport;
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  'use strict';
3
3
 
4
- var chunkTAWPVD6C_cjs = require('../chunk-TAWPVD6C.cjs');
4
+ var chunkB3FMUFAW_cjs = require('../chunk-B3FMUFAW.cjs');
5
5
  require('../chunk-2WLXQGWC.cjs');
6
6
  var chunk5FYU7ZIU_cjs = require('../chunk-5FYU7ZIU.cjs');
7
7
  var chunkUTTTJSQU_cjs = require('../chunk-UTTTJSQU.cjs');
@@ -10,13 +10,13 @@ var chunkRC25WMVB_cjs = require('../chunk-RC25WMVB.cjs');
10
10
  require('../chunk-V4ISCZJ7.cjs');
11
11
  var chunk2EI7NCUA_cjs = require('../chunk-2EI7NCUA.cjs');
12
12
  var chunkC2CWWEHO_cjs = require('../chunk-C2CWWEHO.cjs');
13
- require('../chunk-7RGLTF76.cjs');
14
13
  require('../chunk-BIXHB4LV.cjs');
15
- require('../chunk-KPZZ5FHE.cjs');
16
- require('../chunk-ULWRNGGE.cjs');
14
+ require('../chunk-7RGLTF76.cjs');
17
15
  require('../chunk-FX3K6LNZ.cjs');
18
16
  require('../chunk-PPCATBOY.cjs');
19
17
  var chunkMHVNT4J3_cjs = require('../chunk-MHVNT4J3.cjs');
18
+ require('../chunk-KPZZ5FHE.cjs');
19
+ require('../chunk-ULWRNGGE.cjs');
20
20
  var chunkKDG6FER6_cjs = require('../chunk-KDG6FER6.cjs');
21
21
  require('../chunk-DES3K4SD.cjs');
22
22
  var react = require('react');
@@ -75,13 +75,13 @@ function FactsTable({
75
75
  gridProps,
76
76
  testId = "facts-table"
77
77
  }) {
78
- const l = { ...chunkTAWPVD6C_cjs.DEFAULT_FACT_COLUMN_LABELS, ...columnLabels };
78
+ const l = { ...chunkB3FMUFAW_cjs.DEFAULT_FACT_COLUMN_LABELS, ...columnLabels };
79
79
  const columnDefs = react.useMemo(
80
- () => chunkTAWPVD6C_cjs.createFactColumns({
80
+ () => chunkB3FMUFAW_cjs.createFactColumns({
81
81
  isInChat,
82
82
  onToggleInChat,
83
83
  renderHeader: (params) => /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[12.5px] font-medium", children: params.displayName }),
84
- renderRowActions: (fact) => onEdit && onDelete ? /* @__PURE__ */ jsxRuntime.jsx(chunkTAWPVD6C_cjs.FactRowActions, { onEdit: () => onEdit(fact), onDelete: () => onDelete(fact) }) : null,
84
+ renderRowActions: (fact) => onEdit && onDelete ? /* @__PURE__ */ jsxRuntime.jsx(chunkB3FMUFAW_cjs.FactRowActions, { onEdit: () => onEdit(fact), onDelete: () => onDelete(fact) }) : null,
85
85
  renderLabels: (fact) => /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex flex-wrap items-center gap-1", children: (fact.tags ?? []).map((tag) => /* @__PURE__ */ jsxRuntime.jsx(
86
86
  "span",
87
87
  {
@@ -411,195 +411,195 @@ function FactSearchResult({
411
411
 
412
412
  Object.defineProperty(exports, "DEFAULT_FACTS_BULK_BAR_LABELS", {
413
413
  enumerable: true,
414
- get: function () { return chunkTAWPVD6C_cjs.DEFAULT_FACTS_BULK_BAR_LABELS; }
414
+ get: function () { return chunkB3FMUFAW_cjs.DEFAULT_FACTS_BULK_BAR_LABELS; }
415
415
  });
416
416
  Object.defineProperty(exports, "DEFAULT_FACTS_EMPTY_STATE_LABELS", {
417
417
  enumerable: true,
418
- get: function () { return chunkTAWPVD6C_cjs.DEFAULT_FACTS_EMPTY_STATE_LABELS; }
418
+ get: function () { return chunkB3FMUFAW_cjs.DEFAULT_FACTS_EMPTY_STATE_LABELS; }
419
419
  });
420
420
  Object.defineProperty(exports, "DEFAULT_FACTS_FIELDS_BUTTON_LABELS", {
421
421
  enumerable: true,
422
- get: function () { return chunkTAWPVD6C_cjs.DEFAULT_FACTS_FIELDS_BUTTON_LABELS; }
422
+ get: function () { return chunkB3FMUFAW_cjs.DEFAULT_FACTS_FIELDS_BUTTON_LABELS; }
423
423
  });
424
424
  Object.defineProperty(exports, "DEFAULT_FACTS_TOOLBAR_LABELS", {
425
425
  enumerable: true,
426
- get: function () { return chunkTAWPVD6C_cjs.DEFAULT_FACTS_TOOLBAR_LABELS; }
426
+ get: function () { return chunkB3FMUFAW_cjs.DEFAULT_FACTS_TOOLBAR_LABELS; }
427
427
  });
428
428
  Object.defineProperty(exports, "DEFAULT_FACTS_VIEW_TOGGLE_LABELS", {
429
429
  enumerable: true,
430
- get: function () { return chunkTAWPVD6C_cjs.DEFAULT_FACTS_VIEW_TOGGLE_LABELS; }
430
+ get: function () { return chunkB3FMUFAW_cjs.DEFAULT_FACTS_VIEW_TOGGLE_LABELS; }
431
431
  });
432
432
  Object.defineProperty(exports, "DEFAULT_FACT_COLUMN_LABELS", {
433
433
  enumerable: true,
434
- get: function () { return chunkTAWPVD6C_cjs.DEFAULT_FACT_COLUMN_LABELS; }
434
+ get: function () { return chunkB3FMUFAW_cjs.DEFAULT_FACT_COLUMN_LABELS; }
435
435
  });
436
436
  Object.defineProperty(exports, "DEFAULT_FACT_COLUMN_ORDER", {
437
437
  enumerable: true,
438
- get: function () { return chunkTAWPVD6C_cjs.DEFAULT_FACT_COLUMN_ORDER; }
438
+ get: function () { return chunkB3FMUFAW_cjs.DEFAULT_FACT_COLUMN_ORDER; }
439
439
  });
440
440
  Object.defineProperty(exports, "DEFAULT_FACT_COMPOSER_LABELS", {
441
441
  enumerable: true,
442
- get: function () { return chunkTAWPVD6C_cjs.DEFAULT_FACT_COMPOSER_LABELS; }
442
+ get: function () { return chunkB3FMUFAW_cjs.DEFAULT_FACT_COMPOSER_LABELS; }
443
443
  });
444
444
  Object.defineProperty(exports, "DEFAULT_FACT_DATE_INPUT_LABELS", {
445
445
  enumerable: true,
446
- get: function () { return chunkTAWPVD6C_cjs.DEFAULT_FACT_DATE_INPUT_LABELS; }
446
+ get: function () { return chunkB3FMUFAW_cjs.DEFAULT_FACT_DATE_INPUT_LABELS; }
447
447
  });
448
448
  Object.defineProperty(exports, "DEFAULT_FACT_LABELS_CELL_LABELS", {
449
449
  enumerable: true,
450
- get: function () { return chunkTAWPVD6C_cjs.DEFAULT_FACT_LABELS_CELL_LABELS; }
450
+ get: function () { return chunkB3FMUFAW_cjs.DEFAULT_FACT_LABELS_CELL_LABELS; }
451
451
  });
452
452
  Object.defineProperty(exports, "DEFAULT_FACT_ROW_ACTIONS_LABELS", {
453
453
  enumerable: true,
454
- get: function () { return chunkTAWPVD6C_cjs.DEFAULT_FACT_ROW_ACTIONS_LABELS; }
454
+ get: function () { return chunkB3FMUFAW_cjs.DEFAULT_FACT_ROW_ACTIONS_LABELS; }
455
455
  });
456
456
  Object.defineProperty(exports, "DEFAULT_FACT_SOURCES_ROW_LABELS", {
457
457
  enumerable: true,
458
- get: function () { return chunkTAWPVD6C_cjs.DEFAULT_FACT_SOURCES_ROW_LABELS; }
458
+ get: function () { return chunkB3FMUFAW_cjs.DEFAULT_FACT_SOURCES_ROW_LABELS; }
459
459
  });
460
460
  Object.defineProperty(exports, "DEFAULT_FACT_SOURCE_GROUP_LABELS", {
461
461
  enumerable: true,
462
- get: function () { return chunkTAWPVD6C_cjs.DEFAULT_FACT_SOURCE_GROUP_LABELS; }
462
+ get: function () { return chunkB3FMUFAW_cjs.DEFAULT_FACT_SOURCE_GROUP_LABELS; }
463
463
  });
464
464
  Object.defineProperty(exports, "DEFAULT_FACT_TIMELINE_LABELS", {
465
465
  enumerable: true,
466
- get: function () { return chunkTAWPVD6C_cjs.DEFAULT_FACT_TIMELINE_LABELS; }
466
+ get: function () { return chunkB3FMUFAW_cjs.DEFAULT_FACT_TIMELINE_LABELS; }
467
467
  });
468
468
  Object.defineProperty(exports, "EMPTY_FACT_DATE_FIELDS", {
469
469
  enumerable: true,
470
- get: function () { return chunkTAWPVD6C_cjs.EMPTY_FACT_DATE_FIELDS; }
470
+ get: function () { return chunkB3FMUFAW_cjs.EMPTY_FACT_DATE_FIELDS; }
471
471
  });
472
472
  Object.defineProperty(exports, "FactComposer", {
473
473
  enumerable: true,
474
- get: function () { return chunkTAWPVD6C_cjs.FactComposer; }
474
+ get: function () { return chunkB3FMUFAW_cjs.FactComposer; }
475
475
  });
476
476
  Object.defineProperty(exports, "FactDateInput", {
477
477
  enumerable: true,
478
- get: function () { return chunkTAWPVD6C_cjs.FactDateInput; }
478
+ get: function () { return chunkB3FMUFAW_cjs.FactDateInput; }
479
479
  });
480
480
  Object.defineProperty(exports, "FactFieldRow", {
481
481
  enumerable: true,
482
- get: function () { return chunkTAWPVD6C_cjs.FactFieldRow; }
482
+ get: function () { return chunkB3FMUFAW_cjs.FactFieldRow; }
483
483
  });
484
484
  Object.defineProperty(exports, "FactLabelsCell", {
485
485
  enumerable: true,
486
- get: function () { return chunkTAWPVD6C_cjs.FactLabelsCell; }
486
+ get: function () { return chunkB3FMUFAW_cjs.FactLabelsCell; }
487
487
  });
488
488
  Object.defineProperty(exports, "FactRowActions", {
489
489
  enumerable: true,
490
- get: function () { return chunkTAWPVD6C_cjs.FactRowActions; }
490
+ get: function () { return chunkB3FMUFAW_cjs.FactRowActions; }
491
491
  });
492
492
  Object.defineProperty(exports, "FactSourceGroup", {
493
493
  enumerable: true,
494
- get: function () { return chunkTAWPVD6C_cjs.FactSourceGroup; }
494
+ get: function () { return chunkB3FMUFAW_cjs.FactSourceGroup; }
495
495
  });
496
496
  Object.defineProperty(exports, "FactSourcesRow", {
497
497
  enumerable: true,
498
- get: function () { return chunkTAWPVD6C_cjs.FactSourcesRow; }
498
+ get: function () { return chunkB3FMUFAW_cjs.FactSourcesRow; }
499
499
  });
500
500
  Object.defineProperty(exports, "FactsBulkBar", {
501
501
  enumerable: true,
502
- get: function () { return chunkTAWPVD6C_cjs.FactsBulkBar; }
502
+ get: function () { return chunkB3FMUFAW_cjs.FactsBulkBar; }
503
503
  });
504
504
  Object.defineProperty(exports, "FactsCalendar", {
505
505
  enumerable: true,
506
- get: function () { return chunkTAWPVD6C_cjs.FactsCalendar; }
506
+ get: function () { return chunkB3FMUFAW_cjs.FactsCalendar; }
507
507
  });
508
508
  Object.defineProperty(exports, "FactsEmptyState", {
509
509
  enumerable: true,
510
- get: function () { return chunkTAWPVD6C_cjs.FactsEmptyState; }
510
+ get: function () { return chunkB3FMUFAW_cjs.FactsEmptyState; }
511
511
  });
512
512
  Object.defineProperty(exports, "FactsFieldsButton", {
513
513
  enumerable: true,
514
- get: function () { return chunkTAWPVD6C_cjs.FactsFieldsButton; }
514
+ get: function () { return chunkB3FMUFAW_cjs.FactsFieldsButton; }
515
515
  });
516
516
  Object.defineProperty(exports, "FactsGanttPane", {
517
517
  enumerable: true,
518
- get: function () { return chunkTAWPVD6C_cjs.FactsGanttPane; }
518
+ get: function () { return chunkB3FMUFAW_cjs.FactsGanttPane; }
519
519
  });
520
520
  Object.defineProperty(exports, "FactsLoadError", {
521
521
  enumerable: true,
522
- get: function () { return chunkTAWPVD6C_cjs.FactsLoadError; }
522
+ get: function () { return chunkB3FMUFAW_cjs.FactsLoadError; }
523
523
  });
524
524
  Object.defineProperty(exports, "FactsLoading", {
525
525
  enumerable: true,
526
- get: function () { return chunkTAWPVD6C_cjs.FactsLoading; }
526
+ get: function () { return chunkB3FMUFAW_cjs.FactsLoading; }
527
527
  });
528
528
  Object.defineProperty(exports, "FactsToolbar", {
529
529
  enumerable: true,
530
- get: function () { return chunkTAWPVD6C_cjs.FactsToolbar; }
530
+ get: function () { return chunkB3FMUFAW_cjs.FactsToolbar; }
531
531
  });
532
532
  Object.defineProperty(exports, "FactsViewToggle", {
533
533
  enumerable: true,
534
- get: function () { return chunkTAWPVD6C_cjs.FactsViewToggle; }
534
+ get: function () { return chunkB3FMUFAW_cjs.FactsViewToggle; }
535
535
  });
536
536
  Object.defineProperty(exports, "ISO_DATE_FILTER_PARAMS", {
537
537
  enumerable: true,
538
- get: function () { return chunkTAWPVD6C_cjs.ISO_DATE_FILTER_PARAMS; }
538
+ get: function () { return chunkB3FMUFAW_cjs.ISO_DATE_FILTER_PARAMS; }
539
539
  });
540
540
  Object.defineProperty(exports, "buildFactCitations", {
541
541
  enumerable: true,
542
- get: function () { return chunkTAWPVD6C_cjs.buildFactCitations; }
542
+ get: function () { return chunkB3FMUFAW_cjs.buildFactCitations; }
543
543
  });
544
544
  Object.defineProperty(exports, "chunkIdsOf", {
545
545
  enumerable: true,
546
- get: function () { return chunkTAWPVD6C_cjs.chunkIdsOf; }
546
+ get: function () { return chunkB3FMUFAW_cjs.chunkIdsOf; }
547
547
  });
548
548
  Object.defineProperty(exports, "citedVersionRef", {
549
549
  enumerable: true,
550
- get: function () { return chunkTAWPVD6C_cjs.citedVersionRef; }
550
+ get: function () { return chunkB3FMUFAW_cjs.citedVersionRef; }
551
551
  });
552
552
  Object.defineProperty(exports, "createFactColumns", {
553
553
  enumerable: true,
554
- get: function () { return chunkTAWPVD6C_cjs.createFactColumns; }
554
+ get: function () { return chunkB3FMUFAW_cjs.createFactColumns; }
555
555
  });
556
556
  Object.defineProperty(exports, "docIdsOf", {
557
557
  enumerable: true,
558
- get: function () { return chunkTAWPVD6C_cjs.docIdsOf; }
558
+ get: function () { return chunkB3FMUFAW_cjs.docIdsOf; }
559
559
  });
560
560
  Object.defineProperty(exports, "enableFactTableColumnResize", {
561
561
  enumerable: true,
562
- get: function () { return chunkTAWPVD6C_cjs.enableFactTableColumnResize; }
562
+ get: function () { return chunkB3FMUFAW_cjs.enableFactTableColumnResize; }
563
563
  });
564
564
  Object.defineProperty(exports, "factDateFieldsToSpan", {
565
565
  enumerable: true,
566
- get: function () { return chunkTAWPVD6C_cjs.factDateFieldsToSpan; }
566
+ get: function () { return chunkB3FMUFAW_cjs.factDateFieldsToSpan; }
567
567
  });
568
568
  Object.defineProperty(exports, "factDateSpanToFields", {
569
569
  enumerable: true,
570
- get: function () { return chunkTAWPVD6C_cjs.factDateSpanToFields; }
570
+ get: function () { return chunkB3FMUFAW_cjs.factDateSpanToFields; }
571
571
  });
572
572
  Object.defineProperty(exports, "hasChunk", {
573
573
  enumerable: true,
574
- get: function () { return chunkTAWPVD6C_cjs.hasChunk; }
574
+ get: function () { return chunkB3FMUFAW_cjs.hasChunk; }
575
575
  });
576
576
  Object.defineProperty(exports, "isWholeDoc", {
577
577
  enumerable: true,
578
- get: function () { return chunkTAWPVD6C_cjs.isWholeDoc; }
578
+ get: function () { return chunkB3FMUFAW_cjs.isWholeDoc; }
579
579
  });
580
580
  Object.defineProperty(exports, "sourceDocCount", {
581
581
  enumerable: true,
582
- get: function () { return chunkTAWPVD6C_cjs.sourceDocCount; }
582
+ get: function () { return chunkB3FMUFAW_cjs.sourceDocCount; }
583
583
  });
584
584
  Object.defineProperty(exports, "toFactCitations", {
585
585
  enumerable: true,
586
- get: function () { return chunkTAWPVD6C_cjs.toFactCitations; }
586
+ get: function () { return chunkB3FMUFAW_cjs.toFactCitations; }
587
587
  });
588
588
  Object.defineProperty(exports, "withChunk", {
589
589
  enumerable: true,
590
- get: function () { return chunkTAWPVD6C_cjs.withChunk; }
590
+ get: function () { return chunkB3FMUFAW_cjs.withChunk; }
591
591
  });
592
592
  Object.defineProperty(exports, "withDoc", {
593
593
  enumerable: true,
594
- get: function () { return chunkTAWPVD6C_cjs.withDoc; }
594
+ get: function () { return chunkB3FMUFAW_cjs.withDoc; }
595
595
  });
596
596
  Object.defineProperty(exports, "withoutChunk", {
597
597
  enumerable: true,
598
- get: function () { return chunkTAWPVD6C_cjs.withoutChunk; }
598
+ get: function () { return chunkB3FMUFAW_cjs.withoutChunk; }
599
599
  });
600
600
  Object.defineProperty(exports, "withoutDoc", {
601
601
  enumerable: true,
602
- get: function () { return chunkTAWPVD6C_cjs.withoutDoc; }
602
+ get: function () { return chunkB3FMUFAW_cjs.withoutDoc; }
603
603
  });
604
604
  Object.defineProperty(exports, "DEFAULT_FACT_PASSAGES_LABELS", {
605
605
  enumerable: true,