@arbidocs/blocks 0.4.129 → 0.4.130
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 +4 -3
- package/dist/agents/index.cjs +216 -216
- package/dist/agents/index.js +5 -5
- package/dist/calendar/CalendarPrint.d.ts +25 -0
- package/dist/calendar/booking-slots.d.ts +21 -0
- package/dist/calendar/index.cjs +381 -97
- package/dist/calendar/index.cjs.map +1 -1
- package/dist/calendar/index.d.ts +4 -0
- package/dist/calendar/index.js +277 -3
- package/dist/calendar/index.js.map +1 -1
- package/dist/calendar/print-layout.d.ts +16 -0
- package/dist/calendar/printCalendar.d.ts +6 -0
- package/dist/calls/composite-canvas.d.ts +52 -0
- package/dist/calls/index.cjs +376 -3
- package/dist/calls/index.cjs.map +1 -1
- package/dist/calls/index.d.ts +3 -0
- package/dist/calls/index.js +360 -5
- package/dist/calls/index.js.map +1 -1
- package/dist/calls/ringtone.d.ts +16 -0
- package/dist/calls/voice-levels.d.ts +32 -0
- package/dist/chat/ThreadVisualizer.d.ts +28 -0
- package/dist/chat/index.cjs +93 -77
- package/dist/chat/index.d.ts +2 -0
- package/dist/chat/index.js +2 -2
- package/dist/chat/open-document.d.ts +5 -1
- package/dist/chat/thread-diagram.d.ts +26 -0
- package/dist/{chunk-DQCYCEDR.js → chunk-2Q7FDZAY.js} +3 -3
- package/dist/{chunk-DQCYCEDR.js.map → chunk-2Q7FDZAY.js.map} +1 -1
- package/dist/{chunk-S7PSMMRG.js → chunk-444XKG46.js} +3 -3
- package/dist/{chunk-S7PSMMRG.js.map → chunk-444XKG46.js.map} +1 -1
- package/dist/{chunk-7423V6RM.cjs → chunk-4QIIDXLF.cjs} +8 -8
- package/dist/{chunk-7423V6RM.cjs.map → chunk-4QIIDXLF.cjs.map} +1 -1
- package/dist/{chunk-OYMWV45N.js → chunk-4RLCRFZS.js} +63 -13
- package/dist/chunk-4RLCRFZS.js.map +1 -0
- package/dist/{chunk-DZYAAL4H.cjs → chunk-4S5IDT5F.cjs} +231 -2
- package/dist/chunk-4S5IDT5F.cjs.map +1 -0
- package/dist/{chunk-CJBN5HIS.js → chunk-4UMXQPNA.js} +20 -8
- package/dist/chunk-4UMXQPNA.js.map +1 -0
- package/dist/{chunk-IBZJYCYM.js → chunk-66TA5IBN.js} +17 -25
- package/dist/chunk-66TA5IBN.js.map +1 -0
- package/dist/{chunk-OR4CO743.cjs → chunk-AAFX64WD.cjs} +3 -3
- package/dist/{chunk-OR4CO743.cjs.map → chunk-AAFX64WD.cjs.map} +1 -1
- package/dist/{chunk-MUMH3Z6K.cjs → chunk-ARDHLU73.cjs} +61 -11
- package/dist/chunk-ARDHLU73.cjs.map +1 -0
- package/dist/{chunk-TGWTLNXW.cjs → chunk-BIXHB4LV.cjs} +3 -2
- package/dist/{chunk-TGWTLNXW.cjs.map → chunk-BIXHB4LV.cjs.map} +1 -1
- package/dist/chunk-C4WSHRR6.cjs +166 -0
- package/dist/chunk-C4WSHRR6.cjs.map +1 -0
- package/dist/{chunk-ZAVEMQ37.cjs → chunk-DWZXSPMB.cjs} +3 -3
- package/dist/{chunk-ZAVEMQ37.cjs.map → chunk-DWZXSPMB.cjs.map} +1 -1
- package/dist/{chunk-5HFPRI3W.js → chunk-FUTMU4FR.js} +3 -3
- package/dist/{chunk-5HFPRI3W.js.map → chunk-FUTMU4FR.js.map} +1 -1
- package/dist/{chunk-5Y7JRY7Y.js → chunk-GDBDHOI4.js} +3 -3
- package/dist/{chunk-5Y7JRY7Y.js.map → chunk-GDBDHOI4.js.map} +1 -1
- package/dist/{chunk-TGJNPKST.js → chunk-GTCC2VAR.js} +3 -3
- package/dist/{chunk-TGJNPKST.js.map → chunk-GTCC2VAR.js.map} +1 -1
- package/dist/{chunk-3BJLNKOB.cjs → chunk-GZPTWHP5.cjs} +22 -10
- package/dist/chunk-GZPTWHP5.cjs.map +1 -0
- package/dist/{chunk-OUW6G4O2.cjs → chunk-HFGXA5CL.cjs} +4 -4
- package/dist/{chunk-OUW6G4O2.cjs.map → chunk-HFGXA5CL.cjs.map} +1 -1
- package/dist/{chunk-SWQX6CTT.cjs → chunk-JKB7WT7L.cjs} +2 -2
- package/dist/chunk-JKB7WT7L.cjs.map +1 -0
- package/dist/{chunk-S6BOINC4.cjs → chunk-OGBXV326.cjs} +7 -7
- package/dist/{chunk-S6BOINC4.cjs.map → chunk-OGBXV326.cjs.map} +1 -1
- package/dist/{chunk-DJM7DLCT.cjs → chunk-OPTBQSCV.cjs} +3 -3
- package/dist/{chunk-DJM7DLCT.cjs.map → chunk-OPTBQSCV.cjs.map} +1 -1
- package/dist/{chunk-GFYGYME3.js → chunk-OQ7RUNOC.js} +3 -3
- package/dist/{chunk-GFYGYME3.js.map → chunk-OQ7RUNOC.js.map} +1 -1
- package/dist/{chunk-NYHGG2IA.cjs → chunk-QDEODGXE.cjs} +5 -5
- package/dist/{chunk-NYHGG2IA.cjs.map → chunk-QDEODGXE.cjs.map} +1 -1
- package/dist/{chunk-6BTCDKCK.js → chunk-QYTYW74G.js} +4 -4
- package/dist/{chunk-6BTCDKCK.js.map → chunk-QYTYW74G.js.map} +1 -1
- package/dist/{chunk-A7NCSZAP.cjs → chunk-QZTNTP75.cjs} +17 -25
- package/dist/chunk-QZTNTP75.cjs.map +1 -0
- package/dist/{chunk-OB5F4577.cjs → chunk-R26BK7YL.cjs} +4 -4
- package/dist/{chunk-OB5F4577.cjs.map → chunk-R26BK7YL.cjs.map} +1 -1
- package/dist/{chunk-A2YAC22G.js → chunk-RI6DZA5X.js} +3 -3
- package/dist/{chunk-A2YAC22G.js.map → chunk-RI6DZA5X.js.map} +1 -1
- package/dist/{chunk-H2KQ6OSU.js → chunk-SZX44LCT.js} +230 -5
- package/dist/chunk-SZX44LCT.js.map +1 -0
- package/dist/{chunk-7QDX2CO4.cjs → chunk-TP6PLDNM.cjs} +4 -4
- package/dist/{chunk-7QDX2CO4.cjs.map → chunk-TP6PLDNM.cjs.map} +1 -1
- package/dist/{chunk-JLTXVW25.cjs → chunk-TT6XV6WM.cjs} +17 -17
- package/dist/{chunk-JLTXVW25.cjs.map → chunk-TT6XV6WM.cjs.map} +1 -1
- package/dist/{chunk-HSFLEVZY.js → chunk-UMIY4SQS.js} +6 -6
- package/dist/{chunk-HSFLEVZY.js.map → chunk-UMIY4SQS.js.map} +1 -1
- package/dist/{chunk-ECERC6TI.js → chunk-VHJHY7TT.js} +3 -3
- package/dist/{chunk-ECERC6TI.js.map → chunk-VHJHY7TT.js.map} +1 -1
- package/dist/{chunk-D3N67Q4D.js → chunk-W3VYZXNS.js} +3 -3
- package/dist/{chunk-D3N67Q4D.js.map → chunk-W3VYZXNS.js.map} +1 -1
- package/dist/{chunk-JK45LSIH.cjs → chunk-WXYQ66KC.cjs} +5 -5
- package/dist/{chunk-JK45LSIH.cjs.map → chunk-WXYQ66KC.cjs.map} +1 -1
- package/dist/{chunk-ZCF2JJFA.js → chunk-Y3KA6X7B.js} +3 -3
- package/dist/{chunk-ZCF2JJFA.js.map → chunk-Y3KA6X7B.js.map} +1 -1
- package/dist/{chunk-GYCQ3FNL.js → chunk-YBLIKTJK.js} +2 -2
- package/dist/chunk-YBLIKTJK.js.map +1 -0
- package/dist/chunk-YNIBUKV5.js +163 -0
- package/dist/chunk-YNIBUKV5.js.map +1 -0
- package/dist/citations/index.cjs +12 -11
- package/dist/citations/index.js +3 -2
- package/dist/collaboration/index.cjs +42 -42
- package/dist/collaboration/index.js +2 -2
- package/dist/connect/docx.cjs +7 -5
- package/dist/connect/docx.cjs.map +1 -1
- package/dist/connect/docx.js +6 -4
- package/dist/connect/docx.js.map +1 -1
- package/dist/connect/index.cjs +237 -194
- package/dist/connect/index.cjs.map +1 -1
- package/dist/connect/index.d.ts +1 -1
- package/dist/connect/index.js +190 -147
- package/dist/connect/index.js.map +1 -1
- package/dist/connection/ConnectedSettings.d.ts +46 -20
- package/dist/connection/ConnectionProvider.d.ts +5 -0
- package/dist/connection/mail/ConnectedMailComposer.d.ts +2 -3
- package/dist/connection/mail/ConnectedMailbox.d.ts +2 -3
- package/dist/connection/mail/MailComposerForm.d.ts +2 -3
- package/dist/connection/mail/index.d.ts +2 -2
- package/dist/connection/mail/mailbox.d.ts +1 -4
- package/dist/connection/mail/types.d.ts +0 -8
- package/dist/facts/fact-citations.d.ts +56 -0
- package/dist/facts/fact-table-column-resize.d.ts +18 -0
- package/dist/facts/index.cjs +197 -10
- package/dist/facts/index.cjs.map +1 -1
- package/dist/facts/index.d.ts +2 -0
- package/dist/facts/index.js +182 -6
- package/dist/facts/index.js.map +1 -1
- package/dist/files/index.cjs +4 -4
- package/dist/files/index.js +3 -3
- package/dist/home/index.cjs +20 -19
- package/dist/home/index.cjs.map +1 -1
- package/dist/home/index.js +5 -4
- package/dist/home/index.js.map +1 -1
- package/dist/index.cjs +485 -469
- package/dist/index.d.ts +2 -1
- package/dist/index.js +13 -13
- package/dist/provider/BlocksProvider.d.ts +39 -4
- package/dist/provider/dialogs.d.ts +31 -0
- package/dist/retrieval/index.cjs +5 -4
- package/dist/retrieval/index.js +3 -2
- package/dist/settings/MoreInfo.d.ts +25 -0
- package/dist/settings/PlanCard.d.ts +1 -1
- package/dist/settings/index.cjs +106 -252
- package/dist/settings/index.cjs.map +1 -1
- package/dist/settings/index.d.ts +1 -1
- package/dist/settings/index.js +71 -216
- package/dist/settings/index.js.map +1 -1
- package/dist/shell/index.cjs +48 -47
- package/dist/shell/index.js +4 -3
- package/dist/studio/index.cjs +15 -14
- package/dist/studio/index.cjs.map +1 -1
- package/dist/studio/index.js +7 -6
- package/dist/studio/index.js.map +1 -1
- package/dist/workflow-canvas/index.cjs +14 -14
- package/dist/workflow-canvas/index.js +6 -6
- package/dist/workspaces/index.cjs +3 -3
- package/dist/workspaces/index.js +2 -2
- package/node_modules/@arbidocs/coedit/package.json +1 -1
- package/package.json +9 -4
- package/dist/chunk-3BJLNKOB.cjs.map +0 -1
- package/dist/chunk-76JDDMSP.js +0 -31
- package/dist/chunk-76JDDMSP.js.map +0 -1
- package/dist/chunk-A7NCSZAP.cjs.map +0 -1
- package/dist/chunk-C54XEN5T.cjs +0 -34
- package/dist/chunk-C54XEN5T.cjs.map +0 -1
- package/dist/chunk-CJBN5HIS.js.map +0 -1
- package/dist/chunk-DZYAAL4H.cjs.map +0 -1
- package/dist/chunk-GYCQ3FNL.js.map +0 -1
- package/dist/chunk-H2KQ6OSU.js.map +0 -1
- package/dist/chunk-IBZJYCYM.js.map +0 -1
- package/dist/chunk-MUMH3Z6K.cjs.map +0 -1
- package/dist/chunk-OYMWV45N.js.map +0 -1
- package/dist/chunk-SWQX6CTT.cjs.map +0 -1
- package/dist/settings/FirmPool.d.ts +0 -82
package/dist/facts/index.d.ts
CHANGED
|
@@ -32,3 +32,5 @@ export { DEFAULT_FACT_PASSAGES_LABELS, type FactPassagesLabels, type FactSources
|
|
|
32
32
|
export { DEFAULT_FACT_LABELS_CELL_LABELS, type FactLabelsCellLabels, type FactLabelsCellTestIds, } from './FactLabelsCell';
|
|
33
33
|
export { DEFAULT_FACT_COLUMN_LABELS, type FactColumnLabels, type FactColumnTestIds, } from './factColumns';
|
|
34
34
|
export { DEFAULT_FACT_DATE_INPUT_LABELS, type FactDateInputLabels, type FactDateInputTestIds, } from './FactDateInput';
|
|
35
|
+
export { toFactCitations, isWholeDoc, docIdsOf, chunkIdsOf, hasChunk, withDoc, withoutDoc, withChunk, withoutChunk, buildFactCitations, type FactCitedChunk, type FactCitedDoc, type FactCitations, } from './fact-citations';
|
|
36
|
+
export { enableFactTableColumnResize } from './fact-table-column-resize';
|
package/dist/facts/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { ViewToggle } from '../chunk-JJA6GQKH.js';
|
|
3
3
|
export { DEFAULT_FACT_PASSAGES_LABELS, FactPassageItem, FactSourcesPanel, renderPreviewInline, toPreviewLine } from '../chunk-HFZ45FD3.js';
|
|
4
|
-
import { SearchHit } from '../chunk-
|
|
4
|
+
import { SearchHit } from '../chunk-RI6DZA5X.js';
|
|
5
5
|
import { formatSpan, TimelineCalendar, TimelineGantt } from '../chunk-4EZVCGRL.js';
|
|
6
6
|
import { decodeWhitespaceEntities } from '../chunk-AF6RDAJF.js';
|
|
7
7
|
export { decodeWhitespaceEntities } from '../chunk-AF6RDAJF.js';
|
|
@@ -9,18 +9,20 @@ import { SelectionBar, SelectionBarAction } from '../chunk-NUNKSZKU.js';
|
|
|
9
9
|
import { FilterInput } from '../chunk-YU2KUMGE.js';
|
|
10
10
|
export { DEFAULT_FILTER_INPUT_LABELS as DEFAULT_FACTS_FILTER_INPUT_LABELS, DEFAULT_FILTER_FIELDS as FACTS_SEARCH_FIELD_OPTIONS, FilterInput as FactsFilterInput } from '../chunk-YU2KUMGE.js';
|
|
11
11
|
import { GridView } from '../chunk-N5YEF3LC.js';
|
|
12
|
-
import { detectTimeZone, listTimeZones } from '../chunk-
|
|
12
|
+
import { detectTimeZone, listTimeZones } from '../chunk-GTCC2VAR.js';
|
|
13
13
|
import { TabHeader } from '../chunk-4WWM3GQ5.js';
|
|
14
14
|
import '../chunk-SLSBJRWW.js';
|
|
15
15
|
import { observeResize } from '../chunk-NPLYHR2E.js';
|
|
16
16
|
import { testIdOr } from '../chunk-7F6CBP3Z.js';
|
|
17
|
-
import '../chunk-
|
|
17
|
+
import '../chunk-YNIBUKV5.js';
|
|
18
|
+
import '../chunk-TX2ZICS7.js';
|
|
18
19
|
import { initials } from '../chunk-OXF2IFXG.js';
|
|
19
20
|
import '../chunk-VUNV25KB.js';
|
|
20
21
|
import { PencilLine, Check, MoreVertical, Pencil, Trash2, CalendarDays, X, Columns3, ChevronDown, RotateCcw, Milestone, CalendarClock, Scale, Lightbulb, ArrowRight, Loader2, Info, Paperclip, Tags, MoreHorizontal, FolderUp, BookMarked, Plus, Search, CheckCircle2, CornerDownLeft, Quote, ChevronLeft, ChevronRight, Table2, CalendarRange, GanttChartSquare } from 'lucide-react';
|
|
21
22
|
import { Popover, PopoverTrigger, PopoverContent, Command, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem, DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, cn, Input, Button, CommandSeparator, Tooltip, TooltipTrigger, TooltipContent } from '@arbidocs/react/ui';
|
|
22
23
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
23
24
|
import { memo, useState, useMemo, useRef, useEffect } from 'react';
|
|
25
|
+
import { unwrapCitationLinks } from '@arbidocs/react/artifacts';
|
|
24
26
|
|
|
25
27
|
var DEFAULT_FACT_COLUMN_LABELS = {
|
|
26
28
|
inChatHeaderTooltip: "Facts added to this chat are always in context for this chat",
|
|
@@ -1109,7 +1111,7 @@ var DEFAULT_FACT_SOURCE_GROUP_LABELS = {
|
|
|
1109
1111
|
};
|
|
1110
1112
|
function FactSourceGroup({
|
|
1111
1113
|
docId,
|
|
1112
|
-
document,
|
|
1114
|
+
document: document2,
|
|
1113
1115
|
isViewing,
|
|
1114
1116
|
onRemove,
|
|
1115
1117
|
children,
|
|
@@ -1127,7 +1129,7 @@ function FactSourceGroup({
|
|
|
1127
1129
|
"data-slot": "fact-source-group",
|
|
1128
1130
|
children: [
|
|
1129
1131
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5 px-1 text-sm", children: [
|
|
1130
|
-
|
|
1132
|
+
document2,
|
|
1131
1133
|
/* @__PURE__ */ jsx("span", { className: "flex-1" }),
|
|
1132
1134
|
onRemove && /* @__PURE__ */ jsx(
|
|
1133
1135
|
"button",
|
|
@@ -2113,7 +2115,181 @@ function FactSearchResult({
|
|
|
2113
2115
|
)
|
|
2114
2116
|
] });
|
|
2115
2117
|
}
|
|
2118
|
+
function toFactCitations(citations) {
|
|
2119
|
+
if (!citations) return null;
|
|
2120
|
+
return citations.map((d) => ({
|
|
2121
|
+
doc_ext_id: d.doc_ext_id,
|
|
2122
|
+
...d.version ? { version: d.version } : {},
|
|
2123
|
+
chunks: d.chunks ?? []
|
|
2124
|
+
}));
|
|
2125
|
+
}
|
|
2126
|
+
function isWholeDoc(doc) {
|
|
2127
|
+
return doc.chunks.length === 0;
|
|
2128
|
+
}
|
|
2129
|
+
function docIdsOf(citations) {
|
|
2130
|
+
return (citations ?? []).map((d) => d.doc_ext_id);
|
|
2131
|
+
}
|
|
2132
|
+
function chunkIdsOf(citations) {
|
|
2133
|
+
return (citations ?? []).flatMap((d) => d.chunks.map((c) => c.chunk_id));
|
|
2134
|
+
}
|
|
2135
|
+
function hasChunk(citations, chunkId) {
|
|
2136
|
+
return (citations ?? []).some((d) => d.chunks.some((c) => c.chunk_id === chunkId));
|
|
2137
|
+
}
|
|
2138
|
+
function withDoc(citations, docExtId) {
|
|
2139
|
+
const list = citations ?? [];
|
|
2140
|
+
if (list.some((d) => d.doc_ext_id === docExtId)) return list;
|
|
2141
|
+
return [...list, { doc_ext_id: docExtId, chunks: [] }];
|
|
2142
|
+
}
|
|
2143
|
+
function withoutDoc(citations, docExtId) {
|
|
2144
|
+
const remaining = (citations ?? []).filter((d) => d.doc_ext_id !== docExtId);
|
|
2145
|
+
return remaining.length ? remaining : null;
|
|
2146
|
+
}
|
|
2147
|
+
function withChunk(citations, docExtId, chunk) {
|
|
2148
|
+
const list = citations ?? [];
|
|
2149
|
+
const idx = list.findIndex((d) => d.doc_ext_id === docExtId);
|
|
2150
|
+
if (idx === -1) return [...list, { doc_ext_id: docExtId, chunks: [chunk] }];
|
|
2151
|
+
const doc = list[idx];
|
|
2152
|
+
if (doc.chunks.some((c) => c.chunk_id === chunk.chunk_id)) return list;
|
|
2153
|
+
const next = [...list];
|
|
2154
|
+
next[idx] = { ...doc, chunks: [...doc.chunks, chunk] };
|
|
2155
|
+
return next;
|
|
2156
|
+
}
|
|
2157
|
+
function withoutChunk(citations, chunkId, opts = {}) {
|
|
2158
|
+
const keepDoc = opts.keepDoc ?? true;
|
|
2159
|
+
const list = citations ?? [];
|
|
2160
|
+
if (!hasChunk(list, chunkId)) return citations ?? null;
|
|
2161
|
+
const next = [];
|
|
2162
|
+
for (const doc of list) {
|
|
2163
|
+
if (!doc.chunks.some((c) => c.chunk_id === chunkId)) {
|
|
2164
|
+
next.push(doc);
|
|
2165
|
+
continue;
|
|
2166
|
+
}
|
|
2167
|
+
const chunks = doc.chunks.filter((c) => c.chunk_id !== chunkId);
|
|
2168
|
+
if (chunks.length || keepDoc) next.push({ ...doc, chunks });
|
|
2169
|
+
}
|
|
2170
|
+
return next.length ? next : null;
|
|
2171
|
+
}
|
|
2172
|
+
function repairBoldFlanking(md) {
|
|
2173
|
+
return md.replace(/([.,;:!?"'’”)\]])(\*\*|__)(?=[A-Za-z0-9])/g, "$1$2 ");
|
|
2174
|
+
}
|
|
2175
|
+
var CHAT_LEAD_IN = /^(?:here(?:'s| is| are)|below (?:is|are)|sure|certainly)\b[^\n]*:[ \t]*(?:\n+|$)/i;
|
|
2176
|
+
function dropChatLeadIn(md) {
|
|
2177
|
+
const body = md.replace(CHAT_LEAD_IN, "");
|
|
2178
|
+
return body.trim() ? body : md;
|
|
2179
|
+
}
|
|
2180
|
+
function buildFactCitations(content, activeCitations, citationData) {
|
|
2181
|
+
const text = dropChatLeadIn(repairBoldFlanking(unwrapCitationLinks(content)).trim()).trim();
|
|
2182
|
+
if (!activeCitations) return { text, citations: null };
|
|
2183
|
+
const chunkMeta = /* @__PURE__ */ new Map();
|
|
2184
|
+
for (const chunks of Object.values(citationData)) {
|
|
2185
|
+
if (!Array.isArray(chunks)) continue;
|
|
2186
|
+
for (const chunk of chunks) {
|
|
2187
|
+
const meta = {
|
|
2188
|
+
doc_ext_id: chunk.metadata?.doc_ext_id ?? null,
|
|
2189
|
+
page: chunk.metadata?.page_number ?? null
|
|
2190
|
+
};
|
|
2191
|
+
for (const key of [chunk.metadata?.chunk_ext_id, chunk.chunk_id]) {
|
|
2192
|
+
if (key && !chunkMeta.has(key)) chunkMeta.set(key, meta);
|
|
2193
|
+
}
|
|
2194
|
+
}
|
|
2195
|
+
}
|
|
2196
|
+
let citations = null;
|
|
2197
|
+
for (const chunkIds of Object.values(activeCitations)) {
|
|
2198
|
+
for (const chunkId of chunkIds) {
|
|
2199
|
+
const meta = chunkMeta.get(chunkId);
|
|
2200
|
+
if (!meta?.doc_ext_id) continue;
|
|
2201
|
+
citations = withChunk(citations, meta.doc_ext_id, { chunk_id: chunkId, page: meta.page });
|
|
2202
|
+
}
|
|
2203
|
+
}
|
|
2204
|
+
return { text, citations };
|
|
2205
|
+
}
|
|
2206
|
+
|
|
2207
|
+
// src/facts/fact-table-column-resize.ts
|
|
2208
|
+
var EDGE = 6;
|
|
2209
|
+
var MIN_WIDTH = 48;
|
|
2210
|
+
function enableFactTableColumnResize(container) {
|
|
2211
|
+
let drag = null;
|
|
2212
|
+
const cellFromEvent = (e) => {
|
|
2213
|
+
const el = e.target;
|
|
2214
|
+
const cell = el?.closest?.("td, th");
|
|
2215
|
+
if (!cell || cell.hasAttribute("data-tool-cell")) return null;
|
|
2216
|
+
if (!container.contains(cell)) return null;
|
|
2217
|
+
return cell;
|
|
2218
|
+
};
|
|
2219
|
+
const nearRightEdge = (cell, clientX) => {
|
|
2220
|
+
const rect = cell.getBoundingClientRect();
|
|
2221
|
+
return clientX >= rect.right - EDGE && clientX <= rect.right + 2;
|
|
2222
|
+
};
|
|
2223
|
+
const colForCell = (cell) => {
|
|
2224
|
+
const row = cell.parentElement;
|
|
2225
|
+
const table = cell.closest("table");
|
|
2226
|
+
const colgroup = table?.querySelector("colgroup");
|
|
2227
|
+
if (!row || !table || !colgroup) return null;
|
|
2228
|
+
const index = Array.prototype.indexOf.call(row.children, cell);
|
|
2229
|
+
return colgroup.children[index] ?? null;
|
|
2230
|
+
};
|
|
2231
|
+
const freezeWidths = (table) => {
|
|
2232
|
+
const colgroup = table.querySelector("colgroup");
|
|
2233
|
+
if (!colgroup) return;
|
|
2234
|
+
const ruler = table.querySelector("thead tr") ?? table.querySelector("tbody tr");
|
|
2235
|
+
const cells = ruler ? Array.from(ruler.children) : [];
|
|
2236
|
+
Array.from(colgroup.children).forEach((node, i) => {
|
|
2237
|
+
const col = node;
|
|
2238
|
+
const cell = cells[i];
|
|
2239
|
+
if (!col.style.width && cell) col.style.width = `${cell.getBoundingClientRect().width}px`;
|
|
2240
|
+
});
|
|
2241
|
+
table.style.tableLayout = "fixed";
|
|
2242
|
+
};
|
|
2243
|
+
const onPointerMove = (e) => {
|
|
2244
|
+
if (drag) {
|
|
2245
|
+
const next = Math.max(MIN_WIDTH, drag.startWidth + (e.clientX - drag.startX));
|
|
2246
|
+
drag.col.style.width = `${next}px`;
|
|
2247
|
+
e.preventDefault();
|
|
2248
|
+
return;
|
|
2249
|
+
}
|
|
2250
|
+
const cell = cellFromEvent(e);
|
|
2251
|
+
if (cell && nearRightEdge(cell, e.clientX)) {
|
|
2252
|
+
cell.style.cursor = "col-resize";
|
|
2253
|
+
} else if (cell) {
|
|
2254
|
+
cell.style.cursor = "";
|
|
2255
|
+
}
|
|
2256
|
+
};
|
|
2257
|
+
const endDrag = () => {
|
|
2258
|
+
if (!drag) return;
|
|
2259
|
+
drag = null;
|
|
2260
|
+
document.documentElement.classList.remove("fact-col-resizing");
|
|
2261
|
+
document.removeEventListener("pointermove", onPointerMove, true);
|
|
2262
|
+
document.removeEventListener("pointerup", endDrag, true);
|
|
2263
|
+
};
|
|
2264
|
+
const onPointerDown = (e) => {
|
|
2265
|
+
if (e.button !== 0) return;
|
|
2266
|
+
const cell = cellFromEvent(e);
|
|
2267
|
+
if (!cell || !nearRightEdge(cell, e.clientX)) return;
|
|
2268
|
+
const table = cell.closest("table");
|
|
2269
|
+
if (!table) return;
|
|
2270
|
+
freezeWidths(table);
|
|
2271
|
+
const col = colForCell(cell);
|
|
2272
|
+
if (!col) return;
|
|
2273
|
+
drag = {
|
|
2274
|
+
col,
|
|
2275
|
+
table,
|
|
2276
|
+
startX: e.clientX,
|
|
2277
|
+
startWidth: parseFloat(col.style.width) || cell.getBoundingClientRect().width
|
|
2278
|
+
};
|
|
2279
|
+
e.preventDefault();
|
|
2280
|
+
document.documentElement.classList.add("fact-col-resizing");
|
|
2281
|
+
document.addEventListener("pointermove", onPointerMove, true);
|
|
2282
|
+
document.addEventListener("pointerup", endDrag, true);
|
|
2283
|
+
};
|
|
2284
|
+
container.addEventListener("pointerdown", onPointerDown);
|
|
2285
|
+
container.addEventListener("pointermove", onPointerMove);
|
|
2286
|
+
return () => {
|
|
2287
|
+
endDrag();
|
|
2288
|
+
container.removeEventListener("pointerdown", onPointerDown);
|
|
2289
|
+
container.removeEventListener("pointermove", onPointerMove);
|
|
2290
|
+
};
|
|
2291
|
+
}
|
|
2116
2292
|
|
|
2117
|
-
export { DEFAULT_FACTS_BULK_BAR_LABELS, DEFAULT_FACTS_EMPTY_STATE_LABELS, DEFAULT_FACTS_FIELDS_BUTTON_LABELS, DEFAULT_FACTS_TOOLBAR_LABELS, DEFAULT_FACTS_VIEW_TOGGLE_LABELS, DEFAULT_FACT_COLUMN_LABELS, DEFAULT_FACT_COLUMN_ORDER, DEFAULT_FACT_COMPOSER_LABELS, DEFAULT_FACT_DATE_INPUT_LABELS, DEFAULT_FACT_LABELS_CELL_LABELS, DEFAULT_FACT_ROW_ACTIONS_LABELS, DEFAULT_FACT_SEARCH_BAR_LABELS, DEFAULT_FACT_SEARCH_RESULT_LABELS, DEFAULT_FACT_SOURCES_ROW_LABELS, DEFAULT_FACT_SOURCE_GROUP_LABELS, DEFAULT_FACT_TIMELINE_LABELS, EMPTY_FACT_DATE_FIELDS, FactComposer, FactDateInput, FactFieldRow, FactLabelsCell, FactRowActions, FactSearchBar, FactSearchNoMatches, FactSearchPending, FactSearchResult, FactSearchTotals, FactSourceGroup, FactSourcesRow, FactsBulkBar, FactsCalendar, FactsEmptyState, FactsFieldsButton, FactsGanttPane, FactsLoadError, FactsLoading, FactsTable, FactsToolbar, FactsViewToggle, ISO_DATE_FILTER_PARAMS, createFactColumns, factDateFieldsToSpan, factDateSpanToFields, sourceDocCount, toFactRow, toFactRows };
|
|
2293
|
+
export { DEFAULT_FACTS_BULK_BAR_LABELS, DEFAULT_FACTS_EMPTY_STATE_LABELS, DEFAULT_FACTS_FIELDS_BUTTON_LABELS, DEFAULT_FACTS_TOOLBAR_LABELS, DEFAULT_FACTS_VIEW_TOGGLE_LABELS, DEFAULT_FACT_COLUMN_LABELS, DEFAULT_FACT_COLUMN_ORDER, DEFAULT_FACT_COMPOSER_LABELS, DEFAULT_FACT_DATE_INPUT_LABELS, DEFAULT_FACT_LABELS_CELL_LABELS, DEFAULT_FACT_ROW_ACTIONS_LABELS, DEFAULT_FACT_SEARCH_BAR_LABELS, DEFAULT_FACT_SEARCH_RESULT_LABELS, DEFAULT_FACT_SOURCES_ROW_LABELS, DEFAULT_FACT_SOURCE_GROUP_LABELS, DEFAULT_FACT_TIMELINE_LABELS, EMPTY_FACT_DATE_FIELDS, FactComposer, FactDateInput, FactFieldRow, FactLabelsCell, FactRowActions, FactSearchBar, FactSearchNoMatches, FactSearchPending, FactSearchResult, FactSearchTotals, FactSourceGroup, FactSourcesRow, FactsBulkBar, FactsCalendar, FactsEmptyState, FactsFieldsButton, FactsGanttPane, FactsLoadError, FactsLoading, FactsTable, FactsToolbar, FactsViewToggle, ISO_DATE_FILTER_PARAMS, buildFactCitations, chunkIdsOf, createFactColumns, docIdsOf, enableFactTableColumnResize, factDateFieldsToSpan, factDateSpanToFields, hasChunk, isWholeDoc, sourceDocCount, toFactCitations, toFactRow, toFactRows, withChunk, withDoc, withoutChunk, withoutDoc };
|
|
2118
2294
|
//# sourceMappingURL=index.js.map
|
|
2119
2295
|
//# sourceMappingURL=index.js.map
|