@arbidocs/blocks 0.4.128 → 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 +25 -10
- package/dist/{StreamedArtifactEditor-EEYAXJ4H.cjs → StreamedArtifactEditor-TQAND4H5.cjs} +6 -5
- package/dist/StreamedArtifactEditor-TQAND4H5.cjs.map +1 -0
- package/dist/{StreamedArtifactEditor-TDATDYD2.js → StreamedArtifactEditor-XQNANTWM.js} +4 -3
- package/dist/StreamedArtifactEditor-XQNANTWM.js.map +1 -0
- package/dist/agents/index.cjs +304 -304
- package/dist/agents/index.js +12 -12
- package/dist/artifacts/ArtifactCodeView.d.ts +6 -0
- package/dist/artifacts/ArtifactPreview.d.ts +22 -0
- package/dist/artifacts/index.cjs +50 -21
- package/dist/artifacts/index.d.ts +3 -0
- package/dist/artifacts/index.js +2 -1
- package/dist/artifacts/sandbox-policy.d.ts +34 -0
- package/dist/artifacts/sandboxDocument.d.ts +7 -0
- package/dist/calendar/CalendarPrint.d.ts +25 -0
- package/dist/calendar/booking-slots.d.ts +21 -0
- package/dist/calendar/index.cjs +440 -243
- package/dist/calendar/index.cjs.map +1 -1
- package/dist/calendar/index.d.ts +4 -0
- package/dist/calendar/index.js +282 -151
- 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 +156 -140
- package/dist/chat/index.d.ts +2 -0
- package/dist/chat/index.js +5 -5
- package/dist/chat/open-document.d.ts +5 -1
- package/dist/chat/thread-diagram.d.ts +26 -0
- package/dist/{chunk-7HAM7Y5U.js → chunk-2DFDFOM7.js} +3 -3
- package/dist/{chunk-7HAM7Y5U.js.map → chunk-2DFDFOM7.js.map} +1 -1
- package/dist/{chunk-54ANPPMV.js → chunk-2PNNCEPH.js} +4 -4
- package/dist/{chunk-54ANPPMV.js.map → chunk-2PNNCEPH.js.map} +1 -1
- 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-INW76PEL.cjs → chunk-2YV7FBLO.cjs} +175 -2
- package/dist/chunk-2YV7FBLO.cjs.map +1 -0
- 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-FSBY2S4V.cjs → chunk-4QIIDXLF.cjs} +10 -10
- package/dist/{chunk-FSBY2S4V.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-NZUQFF35.cjs → chunk-4S5IDT5F.cjs} +234 -5
- 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-KELGOCJA.js → chunk-65S53MZK.js} +174 -5
- package/dist/chunk-65S53MZK.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-HM23LXUP.cjs → chunk-6AALMYPS.cjs} +3 -3
- package/dist/{chunk-HM23LXUP.cjs.map → chunk-6AALMYPS.cjs.map} +1 -1
- 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-BIXHB4LV.cjs +178 -0
- package/dist/chunk-BIXHB4LV.cjs.map +1 -0
- 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-VW2C2AZL.js → chunk-ENDP7JER.js} +3 -3
- package/dist/{chunk-VW2C2AZL.js.map → chunk-ENDP7JER.js.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-P5ST47VY.js → chunk-GDBDHOI4.js} +3 -3
- package/dist/{chunk-P5ST47VY.js.map → chunk-GDBDHOI4.js.map} +1 -1
- package/dist/chunk-GTCC2VAR.js +153 -0
- package/dist/chunk-GTCC2VAR.js.map +1 -0
- 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-D4YR56FV.cjs → chunk-KYDRUFWT.cjs} +5 -5
- package/dist/{chunk-D4YR56FV.cjs.map → chunk-KYDRUFWT.cjs.map} +1 -1
- package/dist/chunk-NS4JD2VR.js +22 -0
- package/dist/chunk-NS4JD2VR.js.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-WV4IDVDQ.cjs → chunk-PJJY6CYL.cjs} +11 -11
- package/dist/{chunk-WV4IDVDQ.cjs.map → chunk-PJJY6CYL.cjs.map} +1 -1
- package/dist/{chunk-CXLVI3SB.js → chunk-PUCY3UXN.js} +3 -3
- package/dist/{chunk-CXLVI3SB.js.map → chunk-PUCY3UXN.js.map} +1 -1
- package/dist/{chunk-ZV3BKLFY.cjs → chunk-QDEODGXE.cjs} +5 -5
- package/dist/{chunk-ZV3BKLFY.cjs.map → chunk-QDEODGXE.cjs.map} +1 -1
- package/dist/{chunk-7BJRLP3U.js → chunk-QYTYW74G.js} +5 -5
- package/dist/{chunk-7BJRLP3U.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-LC2KJSUS.cjs → chunk-SARREDFP.cjs} +46 -46
- package/dist/{chunk-LC2KJSUS.cjs.map → chunk-SARREDFP.cjs.map} +1 -1
- package/dist/{chunk-ZCHSJUCI.js → chunk-SZX44LCT.js} +231 -6
- 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-W27VK32R.cjs → chunk-TT6XV6WM.cjs} +84 -84
- package/dist/{chunk-W27VK32R.cjs.map → chunk-TT6XV6WM.cjs.map} +1 -1
- package/dist/{chunk-KLOSOT26.js → chunk-UMIY4SQS.js} +11 -11
- package/dist/{chunk-KLOSOT26.js.map → chunk-UMIY4SQS.js.map} +1 -1
- package/dist/chunk-VG24E4JJ.cjs +26 -0
- package/dist/chunk-VG24E4JJ.cjs.map +1 -0
- 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 +51 -51
- package/dist/collaboration/index.js +3 -3
- package/dist/components/DroppableContainer.d.ts +6 -0
- package/dist/components/GridRowNavigator.d.ts +29 -0
- package/dist/components/LoadingIndicator.d.ts +21 -0
- package/dist/components/RowNavigatorControls.d.ts +29 -0
- package/dist/components/SharedCell.d.ts +27 -0
- 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 +270 -227
- package/dist/connect/index.cjs.map +1 -1
- package/dist/connect/index.d.ts +1 -1
- package/dist/connect/index.js +199 -156
- 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/document-tools/index.cjs +1 -1
- package/dist/document-tools/index.js +1 -1
- 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 +198 -29
- package/dist/facts/index.cjs.map +1 -1
- package/dist/facts/index.d.ts +2 -1
- package/dist/facts/index.js +187 -27
- 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 +877 -679
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +7 -1
- package/dist/index.js +207 -30
- package/dist/index.js.map +1 -1
- 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/sandboxDocument-JLEETIWW.js +71 -0
- package/dist/sandboxDocument-JLEETIWW.js.map +1 -0
- package/dist/sandboxDocument-WQUNODSC.cjs +76 -0
- package/dist/sandboxDocument-WQUNODSC.cjs.map +1 -0
- package/dist/settings/DraggableHeader.d.ts +10 -0
- package/dist/settings/FilterChip.d.ts +15 -0
- package/dist/settings/MessageJsonTree.d.ts +7 -0
- package/dist/settings/MoreInfo.d.ts +25 -0
- package/dist/settings/PlanCard.d.ts +1 -1
- package/dist/settings/index.cjs +363 -266
- package/dist/settings/index.cjs.map +1 -1
- package/dist/settings/index.d.ts +4 -1
- package/dist/settings/index.js +317 -222
- package/dist/settings/index.js.map +1 -1
- package/dist/settings/message-schema-hints.d.ts +19 -0
- package/dist/shell/index.cjs +48 -47
- package/dist/shell/index.js +4 -3
- package/dist/site/index.cjs +5 -5
- package/dist/site/index.js +1 -1
- package/dist/studio/index.cjs +19 -18
- package/dist/studio/index.cjs.map +1 -1
- package/dist/studio/index.js +11 -10
- package/dist/studio/index.js.map +1 -1
- package/dist/workflow-canvas/index.cjs +65 -65
- package/dist/workflow-canvas/index.js +13 -13
- package/dist/workspaces/index.cjs +42 -3
- package/dist/workspaces/index.cjs.map +1 -1
- package/dist/workspaces/index.d.ts +1 -0
- package/dist/workspaces/index.js +38 -3
- package/dist/workspaces/index.js.map +1 -1
- package/dist/workspaces/workspace-type.d.ts +29 -0
- package/node_modules/@arbidocs/coedit/package.json +1 -1
- package/package.json +10 -4
- package/dist/StreamedArtifactEditor-EEYAXJ4H.cjs.map +0 -1
- package/dist/StreamedArtifactEditor-TDATDYD2.js.map +0 -1
- 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-GYCQ3FNL.js.map +0 -1
- package/dist/chunk-IBZJYCYM.js.map +0 -1
- package/dist/chunk-INW76PEL.cjs.map +0 -1
- package/dist/chunk-KELGOCJA.js.map +0 -1
- package/dist/chunk-MUMH3Z6K.cjs.map +0 -1
- package/dist/chunk-NZUQFF35.cjs.map +0 -1
- package/dist/chunk-OYMWV45N.js.map +0 -1
- package/dist/chunk-SWQX6CTT.cjs.map +0 -1
- package/dist/chunk-ZCHSJUCI.js.map +0 -1
- package/dist/facts/timezone.d.ts +0 -4
- package/dist/settings/FirmPool.d.ts +0 -82
package/dist/facts/index.d.ts
CHANGED
|
@@ -7,7 +7,6 @@ export { EMPTY_FACT_DATE_FIELDS, factDateFieldsToSpan, factDateSpanToFields, typ
|
|
|
7
7
|
export { FactPassageItem, FactSourcesPanel, toPreviewLine, renderPreviewInline, type FactPassageItemProps, type FactSourcesPanelProps, } from './FactPassages';
|
|
8
8
|
export { FactSourceGroup, type FactSourceGroupProps } from './FactSourceGroup';
|
|
9
9
|
export { decodeWhitespaceEntities } from './fact-text';
|
|
10
|
-
export { detectTimezone, supportedTimezones } from './timezone';
|
|
11
10
|
export { FactsViewToggle, type FactsViewMode, type FactsViewToggleProps } from './FactsViewToggle';
|
|
12
11
|
export { FactsFilterInput, FACTS_SEARCH_FIELD_OPTIONS, type FactsFilterInputProps, type FactsSearchField, } from './FactsFilterInput';
|
|
13
12
|
export { FactsFieldsButton, type FactsFieldsButtonProps } from './FactsFieldsButton';
|
|
@@ -33,3 +32,5 @@ export { DEFAULT_FACT_PASSAGES_LABELS, type FactPassagesLabels, type FactSources
|
|
|
33
32
|
export { DEFAULT_FACT_LABELS_CELL_LABELS, type FactLabelsCellLabels, type FactLabelsCellTestIds, } from './FactLabelsCell';
|
|
34
33
|
export { DEFAULT_FACT_COLUMN_LABELS, type FactColumnLabels, type FactColumnTestIds, } from './factColumns';
|
|
35
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
|
-
export { DEFAULT_FACT_PASSAGES_LABELS, FactPassageItem, FactSourcesPanel, renderPreviewInline, toPreviewLine } from '../chunk-HFZ45FD3.js';
|
|
3
2
|
import { ViewToggle } from '../chunk-JJA6GQKH.js';
|
|
4
|
-
|
|
3
|
+
export { DEFAULT_FACT_PASSAGES_LABELS, FactPassageItem, FactSourcesPanel, renderPreviewInline, toPreviewLine } from '../chunk-HFZ45FD3.js';
|
|
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,17 +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-GTCC2VAR.js';
|
|
12
13
|
import { TabHeader } from '../chunk-4WWM3GQ5.js';
|
|
13
14
|
import '../chunk-SLSBJRWW.js';
|
|
14
15
|
import { observeResize } from '../chunk-NPLYHR2E.js';
|
|
15
16
|
import { testIdOr } from '../chunk-7F6CBP3Z.js';
|
|
16
|
-
import '../chunk-
|
|
17
|
+
import '../chunk-YNIBUKV5.js';
|
|
18
|
+
import '../chunk-TX2ZICS7.js';
|
|
17
19
|
import { initials } from '../chunk-OXF2IFXG.js';
|
|
18
20
|
import '../chunk-VUNV25KB.js';
|
|
19
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';
|
|
20
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';
|
|
21
23
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
22
24
|
import { memo, useState, useMemo, useRef, useEffect } from 'react';
|
|
25
|
+
import { unwrapCitationLinks } from '@arbidocs/react/artifacts';
|
|
23
26
|
|
|
24
27
|
var DEFAULT_FACT_COLUMN_LABELS = {
|
|
25
28
|
inChatHeaderTooltip: "Facts added to this chat are always in context for this chat",
|
|
@@ -725,23 +728,6 @@ var FactLabelsCell = memo(function FactLabelsCell2({
|
|
|
725
728
|
);
|
|
726
729
|
});
|
|
727
730
|
|
|
728
|
-
// src/facts/timezone.ts
|
|
729
|
-
function detectTimezone() {
|
|
730
|
-
try {
|
|
731
|
-
return Intl.DateTimeFormat().resolvedOptions().timeZone || "UTC";
|
|
732
|
-
} catch {
|
|
733
|
-
return "UTC";
|
|
734
|
-
}
|
|
735
|
-
}
|
|
736
|
-
function supportedTimezones() {
|
|
737
|
-
try {
|
|
738
|
-
const fn = Intl.supportedValuesOf;
|
|
739
|
-
return fn ? fn("timeZone") : [];
|
|
740
|
-
} catch {
|
|
741
|
-
return [];
|
|
742
|
-
}
|
|
743
|
-
}
|
|
744
|
-
|
|
745
731
|
// src/facts/fact-date.ts
|
|
746
732
|
var EMPTY_FACT_DATE_FIELDS = {
|
|
747
733
|
date: "",
|
|
@@ -820,7 +806,7 @@ function factDateSpanToFields(dateStart, dateEnd, timezone) {
|
|
|
820
806
|
}
|
|
821
807
|
function factDateFieldsToSpan(fields) {
|
|
822
808
|
if (!fields.date) return { date: null, date_end: null, timezone: null };
|
|
823
|
-
const tz = fields.timezone ||
|
|
809
|
+
const tz = fields.timezone || detectTimeZone();
|
|
824
810
|
const startIso = fields.time ? zonedPartsToIso(fields.date, fields.time, tz) : `${fields.date}T00:00:00.000Z`;
|
|
825
811
|
let endIso;
|
|
826
812
|
if (fields.endDate) {
|
|
@@ -1005,7 +991,7 @@ function MonthCalendar({
|
|
|
1005
991
|
function FactDateInput({ value, onChange, idPrefix, labels, testIds }) {
|
|
1006
992
|
const l = { ...DEFAULT_FACT_DATE_INPUT_LABELS, ...labels };
|
|
1007
993
|
const [open, setOpen] = useState(false);
|
|
1008
|
-
const timezones = useMemo(() =>
|
|
994
|
+
const timezones = useMemo(() => listTimeZones(), []);
|
|
1009
995
|
const timezoneListId = `${idPrefix}-timezone-options`;
|
|
1010
996
|
const span = factDateFieldsToSpan(value);
|
|
1011
997
|
const summary = value.time || value.endTime ? summarizeWithTimes(value) : formatSpan(span.date, span.date_end, span.timezone);
|
|
@@ -1013,7 +999,7 @@ function FactDateInput({ value, onChange, idPrefix, labels, testIds }) {
|
|
|
1013
999
|
const setStartTime = (time) => onChange({
|
|
1014
1000
|
...value,
|
|
1015
1001
|
time,
|
|
1016
|
-
timezone: time ? value.timezone ||
|
|
1002
|
+
timezone: time ? value.timezone || detectTimeZone() : "",
|
|
1017
1003
|
endTime: time ? value.endTime : ""
|
|
1018
1004
|
});
|
|
1019
1005
|
const setEndTime = (endTime) => onChange({
|
|
@@ -1078,7 +1064,7 @@ function FactDateInput({ value, onChange, idPrefix, labels, testIds }) {
|
|
|
1078
1064
|
list: timezoneListId,
|
|
1079
1065
|
value: value.timezone,
|
|
1080
1066
|
onChange: (e) => onChange({ ...value, timezone: e.target.value }),
|
|
1081
|
-
placeholder:
|
|
1067
|
+
placeholder: detectTimeZone(),
|
|
1082
1068
|
className: "h-8 text-xs",
|
|
1083
1069
|
"data-testid": `${idPrefix}-timezone`
|
|
1084
1070
|
}
|
|
@@ -1125,7 +1111,7 @@ var DEFAULT_FACT_SOURCE_GROUP_LABELS = {
|
|
|
1125
1111
|
};
|
|
1126
1112
|
function FactSourceGroup({
|
|
1127
1113
|
docId,
|
|
1128
|
-
document,
|
|
1114
|
+
document: document2,
|
|
1129
1115
|
isViewing,
|
|
1130
1116
|
onRemove,
|
|
1131
1117
|
children,
|
|
@@ -1143,7 +1129,7 @@ function FactSourceGroup({
|
|
|
1143
1129
|
"data-slot": "fact-source-group",
|
|
1144
1130
|
children: [
|
|
1145
1131
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5 px-1 text-sm", children: [
|
|
1146
|
-
|
|
1132
|
+
document2,
|
|
1147
1133
|
/* @__PURE__ */ jsx("span", { className: "flex-1" }),
|
|
1148
1134
|
onRemove && /* @__PURE__ */ jsx(
|
|
1149
1135
|
"button",
|
|
@@ -2129,7 +2115,181 @@ function FactSearchResult({
|
|
|
2129
2115
|
)
|
|
2130
2116
|
] });
|
|
2131
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
|
+
}
|
|
2132
2292
|
|
|
2133
|
-
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,
|
|
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 };
|
|
2134
2294
|
//# sourceMappingURL=index.js.map
|
|
2135
2295
|
//# sourceMappingURL=index.js.map
|