@arbidocs/blocks 0.4.103 → 0.4.104

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 (78) hide show
  1. package/dist/agents/index.cjs +207 -207
  2. package/dist/agents/index.js +2 -2
  3. package/dist/{chunk-AOFATOT3.cjs → chunk-2A4MDHJR.cjs} +7 -5
  4. package/dist/chunk-2A4MDHJR.cjs.map +1 -0
  5. package/dist/{chunk-GQTIAATM.js → chunk-4GFB5U3K.js} +3 -3
  6. package/dist/{chunk-GQTIAATM.js.map → chunk-4GFB5U3K.js.map} +1 -1
  7. package/dist/chunk-5FYU7ZIU.cjs +139 -0
  8. package/dist/chunk-5FYU7ZIU.cjs.map +1 -0
  9. package/dist/{chunk-TFDU2KGS.cjs → chunk-7LLLQUM7.cjs} +5 -5
  10. package/dist/{chunk-TFDU2KGS.cjs.map → chunk-7LLLQUM7.cjs.map} +1 -1
  11. package/dist/{chunk-D3QPYKZG.js → chunk-EPHGD4YV.js} +7 -6
  12. package/dist/chunk-EPHGD4YV.js.map +1 -0
  13. package/dist/chunk-HFZ45FD3.js +133 -0
  14. package/dist/chunk-HFZ45FD3.js.map +1 -0
  15. package/dist/{chunk-5NQIBJPP.js → chunk-NJX774HB.js} +3 -3
  16. package/dist/{chunk-5NQIBJPP.js.map → chunk-NJX774HB.js.map} +1 -1
  17. package/dist/{chunk-DDYXFALG.cjs → chunk-NW3LFDZL.cjs} +3 -3
  18. package/dist/{chunk-DDYXFALG.cjs.map → chunk-NW3LFDZL.cjs.map} +1 -1
  19. package/dist/{chunk-H6DFXG5N.js → chunk-PIT2YZCK.js} +3 -3
  20. package/dist/{chunk-H6DFXG5N.js.map → chunk-PIT2YZCK.js.map} +1 -1
  21. package/dist/{chunk-Z3G65XHZ.js → chunk-S55VDTX3.js} +3 -3
  22. package/dist/{chunk-Z3G65XHZ.js.map → chunk-S55VDTX3.js.map} +1 -1
  23. package/dist/{chunk-LENXDIMY.cjs → chunk-SKSE4OT6.cjs} +22 -22
  24. package/dist/{chunk-LENXDIMY.cjs.map → chunk-SKSE4OT6.cjs.map} +1 -1
  25. package/dist/{chunk-N36PWG7A.cjs → chunk-TP3FAP5J.cjs} +5 -5
  26. package/dist/{chunk-N36PWG7A.cjs.map → chunk-TP3FAP5J.cjs.map} +1 -1
  27. package/dist/{chunk-CVYY4X5R.js → chunk-W2RTZOK3.js} +1232 -193
  28. package/dist/chunk-W2RTZOK3.js.map +1 -0
  29. package/dist/{chunk-O33EBMIX.cjs → chunk-ZWWN4CUL.cjs} +1410 -359
  30. package/dist/chunk-ZWWN4CUL.cjs.map +1 -0
  31. package/dist/connect/docx.cjs +8 -7
  32. package/dist/connect/docx.cjs.map +1 -1
  33. package/dist/connect/docx.js +6 -5
  34. package/dist/connect/docx.js.map +1 -1
  35. package/dist/connect/index.cjs +12 -11
  36. package/dist/connect/index.cjs.map +1 -1
  37. package/dist/connect/index.js +5 -4
  38. package/dist/connect/index.js.map +1 -1
  39. package/dist/docx/LinkHoverCard.d.ts +24 -0
  40. package/dist/docx/NativeDocxEditor.d.ts +6 -0
  41. package/dist/docx/beforeSave.d.ts +9 -0
  42. package/dist/docx/definitions/fragment.d.ts +19 -1
  43. package/dist/docx/definitions/port.d.ts +43 -11
  44. package/dist/docx/index.cjs +85 -36
  45. package/dist/docx/index.cjs.map +1 -1
  46. package/dist/docx/index.d.ts +6 -0
  47. package/dist/docx/index.js +5 -4
  48. package/dist/docx/index.js.map +1 -1
  49. package/dist/docx/references/CrossReferences.d.ts +97 -0
  50. package/dist/docx/references/EditorMenus.d.ts +10 -0
  51. package/dist/docx/references/commands.d.ts +119 -0
  52. package/dist/docx/references/numbering.d.ts +49 -0
  53. package/dist/docx/references/passages.d.ts +32 -0
  54. package/dist/docx/references/port.d.ts +20 -0
  55. package/dist/facts/index.cjs +22 -129
  56. package/dist/facts/index.cjs.map +1 -1
  57. package/dist/facts/index.js +3 -125
  58. package/dist/facts/index.js.map +1 -1
  59. package/dist/files/index.cjs +1 -1
  60. package/dist/files/index.js +1 -1
  61. package/dist/home/index.cjs +1 -1
  62. package/dist/home/index.js +1 -1
  63. package/dist/index.cjs +314 -314
  64. package/dist/index.js +8 -8
  65. package/dist/shell/index.cjs +1 -1
  66. package/dist/shell/index.js +1 -1
  67. package/dist/studio/index.cjs +1 -1
  68. package/dist/studio/index.js +1 -1
  69. package/dist/tags/ooxml.d.ts +4 -0
  70. package/dist/workflow-canvas/index.cjs +9 -9
  71. package/dist/workflow-canvas/index.js +2 -2
  72. package/node_modules/@arbidocs/coedit/package.json +1 -1
  73. package/package.json +4 -4
  74. package/src/docx/README.md +22 -0
  75. package/dist/chunk-AOFATOT3.cjs.map +0 -1
  76. package/dist/chunk-CVYY4X5R.js.map +0 -1
  77. package/dist/chunk-D3QPYKZG.js.map +0 -1
  78. package/dist/chunk-O33EBMIX.cjs.map +0 -1
@@ -0,0 +1,119 @@
1
+ /**
2
+ * Insert cross-references, the way Word does.
3
+ *
4
+ * Within the document: a hidden `_Ref…` bookmark on the target paragraph and a `REF` field at the
5
+ * caret — `REF _Ref123 \r \h` for a numbered paragraph (Word's Cross-reference › Numbered item ›
6
+ * Paragraph number), `REF _Ref123 \h` for a heading's text. The field's cached result is the value
7
+ * the editor computes, so it updates live when the clauses are renumbered, and Word updates it
8
+ * with the document's other fields.
9
+ *
10
+ * To another document: a hyperlink with the reference text ("SPA, clause 8.2"), aimed at the app
11
+ * address of that document's passage (so it works from Word too), with a screen tip saying so.
12
+ */
13
+ import { type DocPoint } from '../definitions/port';
14
+ import { type CrossReferenceTarget } from './numbering';
15
+ import type { ReferencesPort } from './port';
16
+ /** Prefix of Word's hidden cross-reference bookmarks. */
17
+ export declare const REF_BOOKMARK_PREFIX = "_Ref";
18
+ /** A new `_Ref` bookmark name: Word's shape (`_Ref` and nine digits), not yet in the document. */
19
+ export declare function newRefBookmark(taken: ReadonlySet<string>, random?: () => number): string;
20
+ /**
21
+ * A complex `REF` field with its cached result, every run in the Cross Reference style (Word gives
22
+ * an updated result the formatting of the field's first run).
23
+ */
24
+ export declare function refFieldXml(instruction: string, cached: string): string;
25
+ /** The screen tip of a reference to this document: "Cross-reference to clause 2.2". */
26
+ export declare const refTooltip: (value: string, mode: CrossReferenceMode) => string;
27
+ /**
28
+ * A reference to this document: the `REF` field inside a link to the same bookmark, which carries
29
+ * the screen tip Word shows on hover ("Cross-reference to clause 2.2").
30
+ */
31
+ export declare function crossReferenceXml(bookmark: string, mode: CrossReferenceMode, value: string): string;
32
+ export type CrossReferenceMode = 'number' | 'text';
33
+ /** The field instruction for a target: its paragraph number, or its text. */
34
+ export declare const refInstruction: (bookmark: string, mode: CrossReferenceMode) => string;
35
+ /** What the reference reads in the text. */
36
+ export declare const refResult: (target: CrossReferenceTarget, mode: CrossReferenceMode) => string;
37
+ /**
38
+ * The `_Ref` bookmark a target carries: an existing one at the paragraph, else a new one. For a
39
+ * paragraph number it is an empty bookmark at the paragraph's start (the number is the
40
+ * paragraph's); for heading text it wraps the heading's runs (REF shows the bookmarked text).
41
+ */
42
+ export declare function ensureTargetBookmark(port: ReferencesPort, target: CrossReferenceTarget, mode: CrossReferenceMode): string;
43
+ /**
44
+ * Mark a cross-reference's target (see {@link ensureTargetBookmark}): what the reference will
45
+ * address and read. A paragraph number falls back to the heading text when it has none. Done as a
46
+ * direct edit even while suggesting — the bookmark is hidden, and a heading's text is put back as
47
+ * it was — so rejecting the reference leaves the target as it was.
48
+ */
49
+ export declare function markCrossReferenceTarget(port: ReferencesPort, target: CrossReferenceTarget, mode: CrossReferenceMode): {
50
+ bookmark: string;
51
+ mode: CrossReferenceMode;
52
+ value: string;
53
+ };
54
+ /**
55
+ * Insert the `REF` field of a marked target at `caret`; the caret ends after it. With a port
56
+ * whose pastes are tracked, the reference is one suggestion.
57
+ */
58
+ export declare function insertCrossReferenceField(port: ReferencesPort, { bookmark, mode, value }: {
59
+ bookmark: string;
60
+ mode: CrossReferenceMode;
61
+ value: string;
62
+ }, caret: DocPoint): {
63
+ bookmark: string;
64
+ };
65
+ /** Insert a cross-reference to a target of this document at `caret`; the caret ends after it. */
66
+ export declare function insertCrossReference(port: ReferencesPort, target: CrossReferenceTarget, mode: CrossReferenceMode, caret: DocPoint): {
67
+ bookmark: string;
68
+ };
69
+ /** The screen tip of a reference to another document: "Cross-reference: SPA, clause 8.2 — opens in ARBI". */
70
+ export declare const documentReferenceTooltip: (text: string, appName?: string) => string;
71
+ /**
72
+ * Insert a reference to another document's passage: the reference text in the Cross Reference
73
+ * style, linked to the passage's (absolute) app address, at `caret`.
74
+ */
75
+ export declare function insertDocumentReference(port: ReferencesPort, reference: {
76
+ text: string;
77
+ url: string;
78
+ appName?: string;
79
+ }, caret: DocPoint): void;
80
+ /** A `REF` field whose cached result no longer says what its target now is. */
81
+ export interface StaleReference {
82
+ paragraphId: string;
83
+ offset: number;
84
+ instruction: string;
85
+ /** The current value, or null when the target is gone (the reference is broken). */
86
+ value: string | null;
87
+ /** The field's cached result (what it last showed). */
88
+ cached: string;
89
+ bookmark: string;
90
+ mode: CrossReferenceMode;
91
+ }
92
+ /** A cross-reference whose target was deleted: its last text, marked in the Broken style. */
93
+ export interface BrokenReference {
94
+ paragraphId: string;
95
+ offset: number;
96
+ text: string;
97
+ }
98
+ /**
99
+ * The cross-references whose cached result is out of date: a clause renumbered, a heading
100
+ * reworded. The editor paints a field's live value only while its cached result matches what it
101
+ * computes, so a stale cache shows the OLD number after the document is reopened (and Word shows
102
+ * the cached result until its fields are updated).
103
+ */
104
+ export declare function staleCrossReferences(port: ReferencesPort): StaleReference[];
105
+ /** The broken cross-references marked in the document, in document order. */
106
+ export declare function brokenCrossReferences(port: ReferencesPort): BrokenReference[];
107
+ export interface RefreshResult {
108
+ /** References rewritten with their current number or text. */
109
+ refreshed: number;
110
+ /** References whose target is gone, now (or already) marked broken. */
111
+ broken: BrokenReference[];
112
+ }
113
+ /**
114
+ * Bring every cross-reference up to date: a stale one is replaced by the same reference with its
115
+ * current value (and screen tip); one whose target was deleted becomes its last text in the Cross
116
+ * Reference Broken style — never Word's "Error! Reference source not found." A field directly
117
+ * after another field is left alone: a paste there would land inside the previous field.
118
+ */
119
+ export declare function refreshCrossReferences(port: ReferencesPort): RefreshResult;
@@ -0,0 +1,49 @@
1
+ /**
2
+ * Cross-reference targets: the document's numbered paragraphs (clauses, sub-clauses, numbered
3
+ * captions) and its headings, with the number Word's `REF \r` shows for each.
4
+ *
5
+ * The number is what the editor computes for a `REF … \r` field — and it has to be exactly that,
6
+ * because the engine shows a field's live value only while the field's cached result matches what
7
+ * it computes (otherwise it keeps the cached text for good). So this mirrors the engine: the
8
+ * paragraph's own list level, preceded by each higher level whose number its level text does not
9
+ * already show (`%1.%2` already shows level 1; `(%3)` does not show `2.1`), and one trailing
10
+ * period dropped (`2.` reads `2`).
11
+ */
12
+ import type { DocParagraph } from '../definitions/port';
13
+ /** A paragraph's resolved list numbering (the engine's list item). */
14
+ export interface ListItemInfo {
15
+ numId: string;
16
+ ilvl: number;
17
+ markerText: string;
18
+ numFmt: string;
19
+ }
20
+ /** A list level's definition: its level text (`%1.%2`) and number format. */
21
+ export interface LevelInfo {
22
+ lvlText: string;
23
+ numFmt: string;
24
+ }
25
+ export type LevelOf = (numId: string, ilvl: number) => LevelInfo | null;
26
+ /**
27
+ * The number `REF \r` shows for a paragraph, or null when it is not numbered. `order` is every
28
+ * paragraph id in document order (for the markers of the levels above it).
29
+ */
30
+ export declare function paragraphNumber(order: readonly string[], items: ReadonlyMap<string, ListItemInfo>, levelOf: LevelOf, paragraphId: string): string | null;
31
+ /** One place a cross-reference can point at. */
32
+ export interface CrossReferenceTarget {
33
+ paragraphId: string;
34
+ /** A numbered paragraph (clause, sub-clause, caption) or an unnumbered heading. */
35
+ kind: 'numbered' | 'heading';
36
+ /** What `REF \r` shows (`8.2`), or null for an unnumbered heading. */
37
+ number: string | null;
38
+ /** The paragraph's list marker as painted (`8.2`, `(a)`), or empty. */
39
+ marker: string;
40
+ /** The paragraph's text (without its marker). */
41
+ text: string;
42
+ heading: boolean;
43
+ /** Its list level (0 for a top-level clause), or 0 for a heading. */
44
+ level: number;
45
+ }
46
+ /** Every numbered paragraph and every heading, in document order. */
47
+ export declare function listTargets(paragraphs: readonly DocParagraph[], items: ReadonlyMap<string, ListItemInfo>, levelOf: LevelOf): CrossReferenceTarget[];
48
+ /** Targets whose number or text contains the query (case-insensitive). */
49
+ export declare function filterTargets(targets: readonly CrossReferenceTarget[], query: string): CrossReferenceTarget[];
@@ -0,0 +1,32 @@
1
+ /**
2
+ * References to another document's passages: what a passage is, the reference text a lawyer would
3
+ * write for it ("SPA, clause 8.2", "Lease, p. 12"), and the passage text shown on hover.
4
+ */
5
+ /** Where a cross-document reference points: a document's passage (its chunk) and page. */
6
+ export interface DocumentPassageTarget {
7
+ documentId: string;
8
+ chunkId: string;
9
+ page?: number | null;
10
+ }
11
+ /** One passage of a document, as the reference picker lists it. */
12
+ export interface DocumentPassage {
13
+ chunkId: string;
14
+ page?: number | null;
15
+ /** The passage text (Markdown). */
16
+ text: string;
17
+ }
18
+ /** A document the reference can point into. */
19
+ export interface ReferenceDocument {
20
+ id: string;
21
+ title: string;
22
+ }
23
+ /** The document's name as a reference uses it: its own short name if it gives one, no extension. */
24
+ export declare function shortTitle(title: string): string;
25
+ /** The clause number a passage starts with: `8.2` for "8.2 The Seller…", `8` for "## 8. Sale". */
26
+ export declare function passageClause(text: string): string | null;
27
+ /** The reference text for a passage: "SPA, clause 8.2", else "SPA, p. 12", else "SPA". */
28
+ export declare function referenceText(title: string, passage: Pick<DocumentPassage, 'text' | 'page'>): string;
29
+ /** A passage as one line of plain text, for a tooltip or a hover card. */
30
+ export declare function passageExcerpt(text: string, max?: number): string;
31
+ /** Passages containing the query (case-insensitive), in document order. */
32
+ export declare function filterPassages(passages: readonly DocumentPassage[], query: string): DocumentPassage[];
@@ -0,0 +1,20 @@
1
+ /**
2
+ * What the cross-reference commands need beyond the defined-term port: the document's list
3
+ * numbering as the engine resolves it, and a paragraph's runs as WordprocessingML (to wrap a
4
+ * heading's text in a bookmark without losing its formatting).
5
+ */
6
+ import type { DocxEditorInstance } from '@docx-editor.dev/core';
7
+ import type { Revision } from '@arbidocs/coedit/template';
8
+ import { type DefinitionsPort, type OoxmlNodeLike } from '../definitions/port';
9
+ import type { LevelOf, ListItemInfo } from './numbering';
10
+ export interface ReferencesPort extends DefinitionsPort {
11
+ /** Each numbered paragraph's list item, by paragraph id. */
12
+ listItems(): ReadonlyMap<string, ListItemInfo>;
13
+ levelOf: LevelOf;
14
+ /** The paragraph's runs as WordprocessingML, or null when it holds more than plain runs. */
15
+ runsXml(paragraphId: string): string | null;
16
+ }
17
+ /** A paragraph's runs as XML (formatting kept), or null for anything but plain runs. */
18
+ export declare function paragraphRunsXml(paragraph: OoxmlNodeLike): string | null;
19
+ /** The port over a live editor; with a `revision`, what it pastes is a tracked insertion by it. */
20
+ export declare function referencesPort(editor: DocxEditorInstance, revision?: Revision | null): ReferencesPort;
@@ -1,6 +1,7 @@
1
1
  "use client";
2
2
  'use strict';
3
3
 
4
+ var chunk5FYU7ZIU_cjs = require('../chunk-5FYU7ZIU.cjs');
4
5
  var chunk2WLXQGWC_cjs = require('../chunk-2WLXQGWC.cjs');
5
6
  var chunkOUW6G4O2_cjs = require('../chunk-OUW6G4O2.cjs');
6
7
  var chunkVPPX5XUF_cjs = require('../chunk-VPPX5XUF.cjs');
@@ -8,8 +9,8 @@ var chunkRC25WMVB_cjs = require('../chunk-RC25WMVB.cjs');
8
9
  var chunk7RGLTF76_cjs = require('../chunk-7RGLTF76.cjs');
9
10
  var chunkV4ISCZJ7_cjs = require('../chunk-V4ISCZJ7.cjs');
10
11
  var chunk2EI7NCUA_cjs = require('../chunk-2EI7NCUA.cjs');
11
- var chunkPPCATBOY_cjs = require('../chunk-PPCATBOY.cjs');
12
12
  require('../chunk-C54XEN5T.cjs');
13
+ var chunkPPCATBOY_cjs = require('../chunk-PPCATBOY.cjs');
13
14
  var chunkKDG6FER6_cjs = require('../chunk-KDG6FER6.cjs');
14
15
  var chunkIXALYQT7_cjs = require('../chunk-IXALYQT7.cjs');
15
16
  require('../chunk-FX3K6LNZ.cjs');
@@ -1118,129 +1119,6 @@ function FactDateInput({ value, onChange, idPrefix, labels, testIds }) {
1118
1119
  ] })
1119
1120
  ] }) });
1120
1121
  }
1121
- var DEFAULT_FACT_PASSAGES_LABELS = {
1122
- loading: "Loading passage\u2026",
1123
- close: "Close"
1124
- };
1125
- function toPreviewLine(md) {
1126
- return md.replace(/`{1,3}([^`]*)`{1,3}/g, "$1").replace(/!\[[^\]]*\]\([^)]*\)/g, "").replace(/\[([^\]]*)\]\([^)]*\)/g, "$1").replace(/^[>\s]*#{1,6}\s*/gm, "").replace(/^[>\s]*[-*+]\s+/gm, "").replace(/[*_~]/g, "").replace(/\|/g, " ").replace(/\s+/g, " ").trim();
1127
- }
1128
- var SUP_SUB_RE = /<(sup|sub)>([\s\S]*?)<\/\1>/gi;
1129
- var STRAY_SUP_SUB_RE = /<\/?(?:sup|sub)>/gi;
1130
- var stripStrayTags = (s) => s.replace(STRAY_SUP_SUB_RE, "");
1131
- function renderPreviewInline(line) {
1132
- const nodes = [];
1133
- let last = 0;
1134
- let key = 0;
1135
- for (const m of line.matchAll(SUP_SUB_RE)) {
1136
- const start = m.index ?? 0;
1137
- if (start > last) nodes.push(stripStrayTags(line.slice(last, start)));
1138
- const inner = stripStrayTags(m[2]);
1139
- nodes.push(
1140
- m[1].toLowerCase() === "sup" ? /* @__PURE__ */ jsxRuntime.jsx("sup", { children: inner }, key++) : /* @__PURE__ */ jsxRuntime.jsx("sub", { children: inner }, key++)
1141
- );
1142
- last = start + m[0].length;
1143
- }
1144
- if (last < line.length) nodes.push(stripStrayTags(line.slice(last)));
1145
- return nodes;
1146
- }
1147
- function FactPassageItem({
1148
- index,
1149
- page,
1150
- excerpt,
1151
- isViewing,
1152
- onSelect,
1153
- testId,
1154
- className,
1155
- labels
1156
- }) {
1157
- const l = { ...DEFAULT_FACT_PASSAGES_LABELS, ...labels };
1158
- return /* @__PURE__ */ jsxRuntime.jsxs(
1159
- "button",
1160
- {
1161
- type: "button",
1162
- onClick: onSelect,
1163
- "data-testid": chunkMHVNT4J3_cjs.testIdOr(testId, { testId: "fact-source-passage" }),
1164
- "aria-current": isViewing || void 0,
1165
- className: ui.cn(
1166
- "flex w-full items-start gap-2 rounded px-2 py-1.5 text-left text-xs transition-colors pointer-coarse:min-h-11",
1167
- isViewing ? "bg-ai-soft text-foreground ring-1 ring-ai-accent/40" : "bg-ai-soft/60 text-foreground hover:bg-ai-soft",
1168
- className
1169
- ),
1170
- children: [
1171
- /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "mt-0.5 shrink-0 rounded bg-muted px-1 py-0.5 font-mono text-xs text-muted-foreground", children: [
1172
- index + 1,
1173
- "."
1174
- ] }),
1175
- page != null && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "mt-0.5 shrink-0 rounded-full bg-muted px-1.5 py-0.5 font-mono text-xs text-muted-foreground", children: [
1176
- "p.",
1177
- page
1178
- ] }),
1179
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "block min-w-0 flex-1 overflow-hidden text-ellipsis whitespace-nowrap", children: excerpt ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1180
- "\u201C",
1181
- renderPreviewInline(toPreviewLine(excerpt)),
1182
- "\u201D"
1183
- ] }) : l.loading })
1184
- ]
1185
- }
1186
- );
1187
- }
1188
- function FactSourcesPanel({
1189
- title,
1190
- onClose,
1191
- container,
1192
- children,
1193
- labels,
1194
- testIds
1195
- }) {
1196
- const l = { ...DEFAULT_FACT_PASSAGES_LABELS, ...labels };
1197
- return /* @__PURE__ */ jsxRuntime.jsxs(
1198
- ui.PopoverContent,
1199
- {
1200
- align: "start",
1201
- side: "bottom",
1202
- sideOffset: 4,
1203
- collisionPadding: 16,
1204
- container,
1205
- collisionBoundary: container ?? void 0,
1206
- onInteractOutside: (e) => {
1207
- const target = e.detail.originalEvent.target;
1208
- if (target?.closest(
1209
- '[data-testid="parsed-viewer"], [role="dialog"], [data-radix-popper-content-wrapper]'
1210
- )) {
1211
- e.preventDefault();
1212
- }
1213
- },
1214
- className: "w-[34rem] max-w-[var(--radix-popover-content-available-width)] p-0 data-[state=closed]:animate-none",
1215
- "data-testid": chunkMHVNT4J3_cjs.testIdOr(testIds?.popover, { testId: "fact-sources-popover" }),
1216
- "data-slot": "fact-sources-panel",
1217
- children: [
1218
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sticky top-0 z-10 flex items-center justify-between gap-2 border-b border-border bg-popover px-3 py-2", children: [
1219
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs font-semibold text-muted-foreground", children: title }),
1220
- /* @__PURE__ */ jsxRuntime.jsx(
1221
- "button",
1222
- {
1223
- type: "button",
1224
- "aria-label": l.close,
1225
- "data-testid": chunkMHVNT4J3_cjs.testIdOr(testIds?.close, { testId: "fact-sources-close" }),
1226
- onClick: onClose,
1227
- className: "-m-1.5 flex shrink-0 items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground pointer-coarse:p-3",
1228
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "size-3.5" })
1229
- }
1230
- )
1231
- ] }),
1232
- /* @__PURE__ */ jsxRuntime.jsx(
1233
- "div",
1234
- {
1235
- className: "flex max-h-[min(60vh,var(--radix-popover-content-available-height))] flex-col gap-2 overflow-y-auto p-1.5",
1236
- "data-testid": chunkMHVNT4J3_cjs.testIdOr(testIds?.list, { testId: "fact-sources-list" }),
1237
- children
1238
- }
1239
- )
1240
- ]
1241
- }
1242
- );
1243
- }
1244
1122
  var DEFAULT_FACT_SOURCE_GROUP_LABELS = {
1245
1123
  remove: "Remove this document",
1246
1124
  wholeDocument: "Whole document \u2014 open it to cite specific passages"
@@ -2252,6 +2130,26 @@ function FactSearchResult({
2252
2130
  ] });
2253
2131
  }
2254
2132
 
2133
+ Object.defineProperty(exports, "DEFAULT_FACT_PASSAGES_LABELS", {
2134
+ enumerable: true,
2135
+ get: function () { return chunk5FYU7ZIU_cjs.DEFAULT_FACT_PASSAGES_LABELS; }
2136
+ });
2137
+ Object.defineProperty(exports, "FactPassageItem", {
2138
+ enumerable: true,
2139
+ get: function () { return chunk5FYU7ZIU_cjs.FactPassageItem; }
2140
+ });
2141
+ Object.defineProperty(exports, "FactSourcesPanel", {
2142
+ enumerable: true,
2143
+ get: function () { return chunk5FYU7ZIU_cjs.FactSourcesPanel; }
2144
+ });
2145
+ Object.defineProperty(exports, "renderPreviewInline", {
2146
+ enumerable: true,
2147
+ get: function () { return chunk5FYU7ZIU_cjs.renderPreviewInline; }
2148
+ });
2149
+ Object.defineProperty(exports, "toPreviewLine", {
2150
+ enumerable: true,
2151
+ get: function () { return chunk5FYU7ZIU_cjs.toPreviewLine; }
2152
+ });
2255
2153
  Object.defineProperty(exports, "decodeWhitespaceEntities", {
2256
2154
  enumerable: true,
2257
2155
  get: function () { return chunkRC25WMVB_cjs.decodeWhitespaceEntities; }
@@ -2278,7 +2176,6 @@ exports.DEFAULT_FACT_COLUMN_ORDER = DEFAULT_FACT_COLUMN_ORDER;
2278
2176
  exports.DEFAULT_FACT_COMPOSER_LABELS = DEFAULT_FACT_COMPOSER_LABELS;
2279
2177
  exports.DEFAULT_FACT_DATE_INPUT_LABELS = DEFAULT_FACT_DATE_INPUT_LABELS;
2280
2178
  exports.DEFAULT_FACT_LABELS_CELL_LABELS = DEFAULT_FACT_LABELS_CELL_LABELS;
2281
- exports.DEFAULT_FACT_PASSAGES_LABELS = DEFAULT_FACT_PASSAGES_LABELS;
2282
2179
  exports.DEFAULT_FACT_ROW_ACTIONS_LABELS = DEFAULT_FACT_ROW_ACTIONS_LABELS;
2283
2180
  exports.DEFAULT_FACT_SEARCH_BAR_LABELS = DEFAULT_FACT_SEARCH_BAR_LABELS;
2284
2181
  exports.DEFAULT_FACT_SEARCH_RESULT_LABELS = DEFAULT_FACT_SEARCH_RESULT_LABELS;
@@ -2290,7 +2187,6 @@ exports.FactComposer = FactComposer;
2290
2187
  exports.FactDateInput = FactDateInput;
2291
2188
  exports.FactFieldRow = FactFieldRow;
2292
2189
  exports.FactLabelsCell = FactLabelsCell;
2293
- exports.FactPassageItem = FactPassageItem;
2294
2190
  exports.FactRowActions = FactRowActions;
2295
2191
  exports.FactSearchBar = FactSearchBar;
2296
2192
  exports.FactSearchNoMatches = FactSearchNoMatches;
@@ -2298,7 +2194,6 @@ exports.FactSearchPending = FactSearchPending;
2298
2194
  exports.FactSearchResult = FactSearchResult;
2299
2195
  exports.FactSearchTotals = FactSearchTotals;
2300
2196
  exports.FactSourceGroup = FactSourceGroup;
2301
- exports.FactSourcesPanel = FactSourcesPanel;
2302
2197
  exports.FactSourcesRow = FactSourcesRow;
2303
2198
  exports.FactsBulkBar = FactsBulkBar;
2304
2199
  exports.FactsCalendar = FactsCalendar;
@@ -2315,11 +2210,9 @@ exports.createFactColumns = createFactColumns;
2315
2210
  exports.detectTimezone = detectTimezone;
2316
2211
  exports.factDateFieldsToSpan = factDateFieldsToSpan;
2317
2212
  exports.factDateSpanToFields = factDateSpanToFields;
2318
- exports.renderPreviewInline = renderPreviewInline;
2319
2213
  exports.sourceDocCount = sourceDocCount;
2320
2214
  exports.supportedTimezones = supportedTimezones;
2321
2215
  exports.toFactRow = toFactRow;
2322
2216
  exports.toFactRows = toFactRows;
2323
- exports.toPreviewLine = toPreviewLine;
2324
2217
  //# sourceMappingURL=index.cjs.map
2325
2218
  //# sourceMappingURL=index.cjs.map