@arbidocs/blocks 0.4.159 → 0.4.160
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 +48 -9
- package/dist/{ConnectedNativeDocxComparison-R6RU5TZE.cjs → ConnectedNativeDocxComparison-GLHOGUP6.cjs} +12 -11
- package/dist/{ConnectedNativeDocxComparison-R6RU5TZE.cjs.map → ConnectedNativeDocxComparison-GLHOGUP6.cjs.map} +1 -1
- package/dist/{ConnectedNativeDocxComparison-XMZ5KLD4.js → ConnectedNativeDocxComparison-LKIMKOTA.js} +11 -10
- package/dist/{ConnectedStreamedWordArtifact-IXRJ7MUE.js.map → ConnectedNativeDocxComparison-LKIMKOTA.js.map} +1 -1
- package/dist/{ConnectedNativeDocxEditor-NGUK2AX6.js → ConnectedNativeDocxEditor-6LNYWZ3P.js} +10 -9
- package/dist/{ConnectedNativeDocxEditor-NGUK2AX6.js.map → ConnectedNativeDocxEditor-6LNYWZ3P.js.map} +1 -1
- package/dist/{ConnectedNativeDocxEditor-LBATSM3M.cjs → ConnectedNativeDocxEditor-M3UGWL6K.cjs} +12 -11
- package/dist/{ConnectedNativeDocxEditor-LBATSM3M.cjs.map → ConnectedNativeDocxEditor-M3UGWL6K.cjs.map} +1 -1
- package/dist/{ConnectedStreamedWordArtifact-IXRJ7MUE.js → ConnectedStreamedWordArtifact-432HT7DK.js} +11 -10
- package/dist/{ConnectedNativeDocxComparison-XMZ5KLD4.js.map → ConnectedStreamedWordArtifact-432HT7DK.js.map} +1 -1
- package/dist/{ConnectedStreamedWordArtifact-CWFR6A37.cjs → ConnectedStreamedWordArtifact-COEXL5IT.cjs} +12 -11
- package/dist/ConnectedStreamedWordArtifact-COEXL5IT.cjs.map +1 -0
- package/dist/{FactTextEditor-YESAU2IJ.js → FactTextEditor-ABKKJOCY.js} +2 -2
- package/dist/FactTextEditor-ABKKJOCY.js.map +1 -0
- package/dist/{FactTextEditor-YUPBCTXK.cjs → FactTextEditor-GYN5RHJT.cjs} +2 -2
- package/dist/FactTextEditor-GYN5RHJT.cjs.map +1 -0
- package/dist/{WorkspaceTableView-EYLEUZZT.cjs → WorkspaceTableView-AQTF5F6T.cjs} +6 -5
- package/dist/WorkspaceTableView-AQTF5F6T.cjs.map +1 -0
- package/dist/{WorkspaceTableView-DWUE4VQF.js → WorkspaceTableView-PTB5BPVA.js} +4 -3
- package/dist/WorkspaceTableView-PTB5BPVA.js.map +1 -0
- package/dist/agents/index.cjs +263 -263
- package/dist/agents/index.js +6 -6
- package/dist/agents/skills/skillLibrary.d.ts +1 -1
- package/dist/{chunk-FPHTSNOE.js → chunk-2AKIMCDD.js} +3 -3
- package/dist/{chunk-FPHTSNOE.js.map → chunk-2AKIMCDD.js.map} +1 -1
- package/dist/{chunk-YNMO3DSR.js → chunk-2AMYT2HQ.js} +3 -3
- package/dist/{chunk-YNMO3DSR.js.map → chunk-2AMYT2HQ.js.map} +1 -1
- package/dist/{chunk-MSFQDELO.cjs → chunk-3CUORKDL.cjs} +4 -4
- package/dist/{chunk-MSFQDELO.cjs.map → chunk-3CUORKDL.cjs.map} +1 -1
- package/dist/{chunk-MNG7N6M2.js → chunk-3PQIWOTZ.js} +122 -57
- package/dist/chunk-3PQIWOTZ.js.map +1 -0
- package/dist/chunk-5C7DRQQE.cjs +1891 -0
- package/dist/chunk-5C7DRQQE.cjs.map +1 -0
- package/dist/{chunk-F57LNUSZ.js → chunk-5NWY3FXQ.js} +24 -57
- package/dist/chunk-5NWY3FXQ.js.map +1 -0
- package/dist/{chunk-ISHFVKVU.js → chunk-5WLORPGX.js} +4 -4
- package/dist/{chunk-ISHFVKVU.js.map → chunk-5WLORPGX.js.map} +1 -1
- package/dist/{chunk-FAXXN7KI.cjs → chunk-5Y6V7F6W.cjs} +53 -4
- package/dist/chunk-5Y6V7F6W.cjs.map +1 -0
- package/dist/{chunk-6QAAIDQQ.cjs → chunk-6UTIAHQG.cjs} +60 -60
- package/dist/{chunk-6QAAIDQQ.cjs.map → chunk-6UTIAHQG.cjs.map} +1 -1
- package/dist/{chunk-KCSIX7CY.js → chunk-6XIXNH26.js} +3 -3
- package/dist/{chunk-KCSIX7CY.js.map → chunk-6XIXNH26.js.map} +1 -1
- package/dist/{chunk-YBJ4QGNH.cjs → chunk-ANLTECZ6.cjs} +8 -8
- package/dist/{chunk-YBJ4QGNH.cjs.map → chunk-ANLTECZ6.cjs.map} +1 -1
- package/dist/{chunk-Q2XGM372.cjs → chunk-AR6A2PMV.cjs} +4 -4
- package/dist/{chunk-Q2XGM372.cjs.map → chunk-AR6A2PMV.cjs.map} +1 -1
- package/dist/{chunk-KBO75NLM.cjs → chunk-AYJZRBHG.cjs} +7 -7
- package/dist/{chunk-KBO75NLM.cjs.map → chunk-AYJZRBHG.cjs.map} +1 -1
- package/dist/{chunk-FM3IRQJW.cjs → chunk-AYKE6USO.cjs} +12 -12
- package/dist/chunk-AYKE6USO.cjs.map +1 -0
- package/dist/chunk-BGJZVJJM.cjs +63 -0
- package/dist/chunk-BGJZVJJM.cjs.map +1 -0
- package/dist/{chunk-ECW2R2KF.cjs → chunk-BPL5RLNN.cjs} +27 -27
- package/dist/{chunk-ECW2R2KF.cjs.map → chunk-BPL5RLNN.cjs.map} +1 -1
- package/dist/{chunk-CNHUJRQ4.cjs → chunk-EFEFLBRM.cjs} +21 -55
- package/dist/chunk-EFEFLBRM.cjs.map +1 -0
- package/dist/{chunk-ETZ5A3GU.js → chunk-EVO2UNX3.js} +3 -3
- package/dist/chunk-EVO2UNX3.js.map +1 -0
- package/dist/{chunk-P6RIBIVN.js → chunk-FMJGVAWX.js} +8 -9
- package/dist/chunk-FMJGVAWX.js.map +1 -0
- package/dist/chunk-H5542IOD.cjs +108 -0
- package/dist/chunk-H5542IOD.cjs.map +1 -0
- package/dist/{chunk-VF5EUAIV.js → chunk-H7PHANI4.js} +3 -3
- package/dist/chunk-H7PHANI4.js.map +1 -0
- package/dist/chunk-HQJL7FSY.js +58 -0
- package/dist/chunk-HQJL7FSY.js.map +1 -0
- package/dist/{chunk-OFV3PRF2.cjs → chunk-HRDVQERS.cjs} +7 -7
- package/dist/{chunk-OFV3PRF2.cjs.map → chunk-HRDVQERS.cjs.map} +1 -1
- package/dist/{chunk-3VULDTNL.cjs → chunk-HUNX4CQG.cjs} +4 -4
- package/dist/chunk-HUNX4CQG.cjs.map +1 -0
- package/dist/{chunk-2BHDRVVL.cjs → chunk-I6I34FDU.cjs} +38 -37
- package/dist/chunk-I6I34FDU.cjs.map +1 -0
- package/dist/chunk-IWVOZREF.js +12 -0
- package/dist/chunk-IWVOZREF.js.map +1 -0
- package/dist/chunk-J7YHBMBB.js +1834 -0
- package/dist/chunk-J7YHBMBB.js.map +1 -0
- package/dist/{chunk-SDOEHEJP.js → chunk-JMQLTMJ7.js} +53 -5
- package/dist/chunk-JMQLTMJ7.js.map +1 -0
- package/dist/{chunk-TF7HN5EU.js → chunk-JNE2XEXD.js} +12 -12
- package/dist/chunk-JNE2XEXD.js.map +1 -0
- package/dist/{chunk-QKR5LWDO.js → chunk-K7CZFNJ2.js} +7 -7
- package/dist/{chunk-QKR5LWDO.js.map → chunk-K7CZFNJ2.js.map} +1 -1
- package/dist/{chunk-4RPBUMHB.cjs → chunk-KMZO5W6D.cjs} +4 -4
- package/dist/chunk-KMZO5W6D.cjs.map +1 -0
- package/dist/{chunk-FTZ45WHY.js → chunk-KNCJSPXV.js} +5020 -4014
- package/dist/chunk-KNCJSPXV.js.map +1 -0
- package/dist/{chunk-3OCNUKGX.js → chunk-KQWC4YBX.js} +3 -3
- package/dist/{chunk-3OCNUKGX.js.map → chunk-KQWC4YBX.js.map} +1 -1
- package/dist/{chunk-TC3RQNEX.cjs → chunk-L4KWTDFE.cjs} +5 -5
- package/dist/chunk-L4KWTDFE.cjs.map +1 -0
- package/dist/{chunk-VTTZZ4FN.js → chunk-LH3JAZ33.js} +5 -5
- package/dist/chunk-LH3JAZ33.js.map +1 -0
- package/dist/{chunk-P2YM67Y5.cjs → chunk-LQYPOWKN.cjs} +14 -21
- package/dist/chunk-LQYPOWKN.cjs.map +1 -0
- package/dist/{chunk-RATEAOKT.js → chunk-NOXGEQQR.js} +7 -13
- package/dist/chunk-NOXGEQQR.js.map +1 -0
- package/dist/{chunk-NPLGB4LI.cjs → chunk-NUAC5GTQ.cjs} +5115 -4077
- package/dist/chunk-NUAC5GTQ.cjs.map +1 -0
- package/dist/chunk-NYECCTB3.js +101 -0
- package/dist/chunk-NYECCTB3.js.map +1 -0
- package/dist/{chunk-GC2FSPSQ.cjs → chunk-O5E3NKPI.cjs} +128 -58
- package/dist/chunk-O5E3NKPI.cjs.map +1 -0
- package/dist/{chunk-SZOFGU7W.js → chunk-O5XREO7H.js} +3 -3
- package/dist/{chunk-SZOFGU7W.js.map → chunk-O5XREO7H.js.map} +1 -1
- package/dist/{chunk-OOU4QLRK.cjs → chunk-OHCYJFV2.cjs} +9 -9
- package/dist/{chunk-OOU4QLRK.cjs.map → chunk-OHCYJFV2.cjs.map} +1 -1
- package/dist/{chunk-DEPF5LQI.js → chunk-OKRYNQPH.js} +3 -3
- package/dist/chunk-OKRYNQPH.js.map +1 -0
- package/dist/{chunk-KFMRBZQK.js → chunk-PCL7IEZO.js} +21 -20
- package/dist/chunk-PCL7IEZO.js.map +1 -0
- package/dist/chunk-RFB7B6XG.cjs +169 -0
- package/dist/chunk-RFB7B6XG.cjs.map +1 -0
- package/dist/{chunk-SZSJGZSO.js → chunk-SQQU3WRB.js} +714 -5
- package/dist/chunk-SQQU3WRB.js.map +1 -0
- package/dist/{chunk-OALEDG67.cjs → chunk-TNESYDBR.cjs} +5 -5
- package/dist/{chunk-OALEDG67.cjs.map → chunk-TNESYDBR.cjs.map} +1 -1
- package/dist/chunk-TTS353W2.js +163 -0
- package/dist/chunk-TTS353W2.js.map +1 -0
- package/dist/{chunk-CROGFB46.cjs → chunk-U7OUZHBH.cjs} +753 -2
- package/dist/chunk-U7OUZHBH.cjs.map +1 -0
- package/dist/{chunk-BQ77KSXU.js → chunk-UORU5S7Y.js} +3 -3
- package/dist/{chunk-BQ77KSXU.js.map → chunk-UORU5S7Y.js.map} +1 -1
- package/dist/{chunk-FYZXDZM7.js → chunk-VFF76GTB.js} +4 -4
- package/dist/{chunk-FYZXDZM7.js.map → chunk-VFF76GTB.js.map} +1 -1
- package/dist/{chunk-E4H5H2C3.cjs → chunk-VYTK2WJB.cjs} +4 -4
- package/dist/{chunk-E4H5H2C3.cjs.map → chunk-VYTK2WJB.cjs.map} +1 -1
- package/dist/{chunk-XI37A7HH.js → chunk-WKSP73RU.js} +3 -3
- package/dist/{chunk-XI37A7HH.js.map → chunk-WKSP73RU.js.map} +1 -1
- package/dist/chunk-WP4VIOOA.cjs +15 -0
- package/dist/chunk-WP4VIOOA.cjs.map +1 -0
- package/dist/{chunk-YF3QUHKN.cjs → chunk-X3XPXEIM.cjs} +14 -15
- package/dist/chunk-X3XPXEIM.cjs.map +1 -0
- package/dist/{chunk-VZPFYZZU.cjs → chunk-Z2HEBOA3.cjs} +8 -8
- package/dist/{chunk-VZPFYZZU.cjs.map → chunk-Z2HEBOA3.cjs.map} +1 -1
- package/dist/{chunk-Q7CQYYZW.cjs → chunk-ZMYW5M75.cjs} +5 -5
- package/dist/chunk-ZMYW5M75.cjs.map +1 -0
- package/dist/{chunk-7UENVUA6.js → chunk-ZW2AWACP.js} +3 -3
- package/dist/{chunk-7UENVUA6.js.map → chunk-ZW2AWACP.js.map} +1 -1
- package/dist/citations/index.cjs +10 -10
- package/dist/citations/index.js +2 -2
- package/dist/collaboration/contacts/contact-form.d.ts +47 -0
- package/dist/collaboration/contacts/index.d.ts +3 -1
- package/dist/collaboration/contacts/invite-plan.d.ts +46 -0
- package/dist/collaboration/contacts/parseEmails.d.ts +7 -0
- package/dist/collaboration/index.cjs +163 -83
- package/dist/collaboration/index.js +2 -2
- package/dist/components/ActionLink.d.ts +1 -1
- package/dist/components/TeamGrid.d.ts +1 -1
- package/dist/components/editorial/{ProfileCard.d.ts → EditorialProfileCard.d.ts} +2 -2
- package/dist/components/editorial/index.d.ts +1 -1
- package/dist/connect/docx.cjs +14 -13
- package/dist/connect/docx.d.ts +1 -1
- package/dist/connect/docx.js +10 -9
- package/dist/connect/index.cjs +22053 -14708
- package/dist/connect/index.cjs.map +1 -1
- package/dist/connect/index.d.ts +11 -7
- package/dist/connect/index.js +15193 -7911
- package/dist/connect/index.js.map +1 -1
- package/dist/connect/viewer.cjs +86 -141
- package/dist/connect/viewer.cjs.map +1 -1
- package/dist/connect/viewer.d.ts +3 -2
- package/dist/connect/viewer.js +28 -85
- package/dist/connect/viewer.js.map +1 -1
- package/dist/connection/ConnectedSettings.d.ts +3 -2
- package/dist/connection/ConnectionProvider.d.ts +5 -4
- package/dist/connection/StreamedArtifact.d.ts +1 -1
- package/dist/connection/billing/index.d.ts +3 -3
- package/dist/connection/billing/support.d.ts +4 -7
- package/dist/connection/contacts/ConnectedAddContacts.d.ts +9 -0
- package/dist/connection/contacts/ConnectedContactCardForm.d.ts +11 -0
- package/dist/connection/contacts/ConnectedContactToggle.d.ts +16 -0
- package/dist/connection/contacts/ConnectedContactsDirectory.d.ts +10 -0
- package/dist/connection/contacts/ImportVcf.d.ts +29 -0
- package/dist/connection/contacts/index.d.ts +5 -0
- package/dist/connection/defaultHost.d.ts +9 -0
- package/dist/connection/docx/ConnectedNativeDocxEditor.d.ts +3 -3
- package/dist/connection/docx/support.d.ts +10 -9
- package/dist/connection/files/bulk/ConnectedFilesBulkActions.d.ts +22 -0
- package/dist/connection/files/bulk/useDocumentBulkActions.d.ts +19 -0
- package/dist/connection/files/explorer/FileTiles.d.ts +6 -3
- package/dist/connection/files/fields/ConnectedBulkTagEditor.d.ts +16 -0
- package/dist/connection/files/fields/ConnectedFieldsEditor.d.ts +40 -0
- package/dist/connection/files/fields/ConnectedFieldsManager.d.ts +33 -0
- package/dist/connection/files/fields/ConnectedTagEditorDialog.d.ts +20 -0
- package/dist/connection/files/fields/ConnectedTagForm.d.ts +54 -0
- package/dist/connection/files/fields/DocumentFieldParts.d.ts +33 -0
- package/dist/connection/files/fields/DocumentUser.d.ts +11 -0
- package/dist/connection/files/fields/documentField.d.ts +48 -0
- package/dist/connection/files/fields/useFieldWrites.d.ts +20 -0
- package/dist/connection/files/fields/useFieldsApply.d.ts +49 -0
- package/dist/connection/files/fields/useMemberLookup.d.ts +3 -0
- package/dist/connection/files/grid/ConnectedTagEntity.d.ts +19 -0
- package/dist/connection/files/grid/cells.d.ts +85 -0
- package/dist/connection/files/grid/documentColumns.d.ts +66 -0
- package/dist/connection/files/grid/documentGridBus.d.ts +48 -0
- package/dist/connection/files/grid/documentStatus.d.ts +43 -0
- package/dist/connection/files/grid/familyMeta.d.ts +21 -0
- package/dist/connection/files/grid/tagColumn.d.ts +23 -0
- package/dist/connection/files/grid/useDocumentGridSync.d.ts +48 -0
- package/dist/connection/files/grid/useDocumentTable.d.ts +30 -0
- package/dist/connection/files/index.d.ts +36 -2
- package/dist/connection/files/move/ConnectedMoveToFolder.d.ts +31 -0
- package/dist/connection/files/page/ConnectedFilesPage.d.ts +86 -0
- package/dist/connection/files/page/DocumentsFilterBarActions.d.ts +39 -0
- package/dist/connection/files/page/DocumentsUploadButton.d.ts +25 -0
- package/dist/connection/files/page/PersistedGridView.d.ts +6 -0
- package/dist/connection/files/page/ProgressiveLoadingChip.d.ts +12 -0
- package/dist/connection/files/page/useDocumentNavigation.d.ts +20 -0
- package/dist/connection/files/review/ConnectedAiReview.d.ts +40 -0
- package/dist/connection/files/review/reviewProgress.d.ts +2 -0
- package/dist/connection/files/store.d.ts +96 -0
- package/dist/connection/files/useDocumentFilters.d.ts +54 -0
- package/dist/connection/files/views/ViewSelector.d.ts +33 -0
- package/dist/connection/files/views/tableViews.d.ts +22 -0
- package/dist/connection/files/views/useTableViews.d.ts +22 -0
- package/dist/connection/mail/ConnectedMailbox.d.ts +2 -2
- package/dist/connection/messenger/ChatAttachments.d.ts +15 -0
- package/dist/connection/messenger/ConnectedChatThread.d.ts +21 -0
- package/dist/connection/messenger/ConnectedGroupMembers.d.ts +20 -0
- package/dist/connection/messenger/ConnectedMessenger.d.ts +52 -0
- package/dist/connection/messenger/index.d.ts +6 -0
- package/dist/connection/messenger/types.d.ts +103 -0
- package/dist/connection/messenger/useMessengerRows.d.ts +19 -0
- package/dist/connection/tags/ConnectedTagsPage.d.ts +2 -35
- package/dist/connection/viewer/ConnectedDocumentToolsProvider.d.ts +19 -2
- package/dist/connection/viewer/ConnectedDocumentViewer.d.ts +1 -1
- package/dist/connection/viewer/support.d.ts +21 -15
- package/dist/connection/workspaceData.d.ts +134 -8
- package/dist/facts/index.cjs +3 -3
- package/dist/facts/index.js +2 -2
- package/dist/files/bulk/BulkActionsBar.d.ts +9 -5
- package/dist/files/cells/DocumentNameCell.d.ts +4 -2
- package/dist/files/cells/MultiSelectCellEditor.d.ts +13 -0
- package/dist/files/cells/RelatedDocsCell.d.ts +2 -1
- package/dist/files/cells/index.d.ts +1 -0
- package/dist/files/documentColumns.d.ts +15 -0
- package/dist/files/folders/DocumentsFolderButton.d.ts +26 -0
- package/dist/files/folders/FolderTreePicker.d.ts +16 -0
- package/dist/files/folders/index.d.ts +2 -0
- package/dist/files/index.cjs +430 -434
- package/dist/files/index.d.ts +4 -1
- package/dist/files/index.js +5 -5
- package/dist/files/navigator/DocumentSearchList.d.ts +19 -0
- package/dist/files/navigator/ExplorerFileNavigator.d.ts +23 -0
- package/dist/files/navigator/NavDocumentPicker.d.ts +15 -0
- package/dist/files/navigator/NavigatorPickerBar.d.ts +26 -0
- package/dist/files/navigator/index.d.ts +5 -0
- package/dist/files/navigator/types.d.ts +7 -0
- package/dist/files/tags/BulkTagEditor.d.ts +2 -1
- package/dist/files/tags/index.d.ts +0 -2
- package/dist/files/visibility.d.ts +6 -5
- package/dist/home/StartTiles.d.ts +1 -1
- package/dist/home/index.cjs +30 -30
- package/dist/home/index.js +5 -5
- package/dist/index.cjs +684 -694
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +22 -134
- package/dist/index.js.map +1 -1
- package/dist/provider/{BlocksProvider.d.ts → environment.d.ts} +8 -10
- package/dist/provider/host.d.ts +44 -0
- package/dist/retrieval/index.cjs +4 -4
- package/dist/retrieval/index.js +2 -2
- package/dist/shell/index.cjs +44 -44
- package/dist/shell/index.js +3 -3
- package/dist/shell/types.d.ts +1 -1
- package/dist/site/index.cjs +61 -61
- package/dist/site/index.js +2 -2
- package/dist/studio/index.cjs +86 -87
- package/dist/studio/index.cjs.map +1 -1
- package/dist/studio/index.js +15 -16
- package/dist/studio/index.js.map +1 -1
- package/dist/workflow-canvas/index.cjs +28 -27
- package/dist/workflow-canvas/index.cjs.map +1 -1
- package/dist/workflow-canvas/index.js +11 -10
- package/dist/workflow-canvas/index.js.map +1 -1
- package/dist/workspaces/WorkspaceCard.d.ts +1 -1
- package/dist/workspaces/index.cjs +20 -20
- package/dist/workspaces/index.js +4 -4
- package/node_modules/@arbidocs/coedit/package.json +1 -1
- package/package.json +5 -5
- package/dist/ConnectedStreamedWordArtifact-CWFR6A37.cjs.map +0 -1
- package/dist/FactTextEditor-YESAU2IJ.js.map +0 -1
- package/dist/FactTextEditor-YUPBCTXK.cjs.map +0 -1
- package/dist/WorkspaceTableView-DWUE4VQF.js.map +0 -1
- package/dist/WorkspaceTableView-EYLEUZZT.cjs.map +0 -1
- package/dist/chunk-2BHDRVVL.cjs.map +0 -1
- package/dist/chunk-3VULDTNL.cjs.map +0 -1
- package/dist/chunk-4RPBUMHB.cjs.map +0 -1
- package/dist/chunk-5ZIYPZYE.js +0 -2748
- package/dist/chunk-5ZIYPZYE.js.map +0 -1
- package/dist/chunk-6I6CVX5G.cjs +0 -22
- package/dist/chunk-6I6CVX5G.cjs.map +0 -1
- package/dist/chunk-7NL6WJER.cjs +0 -682
- package/dist/chunk-7NL6WJER.cjs.map +0 -1
- package/dist/chunk-CB4TIDEX.cjs +0 -54
- package/dist/chunk-CB4TIDEX.cjs.map +0 -1
- package/dist/chunk-CNHUJRQ4.cjs.map +0 -1
- package/dist/chunk-CROGFB46.cjs.map +0 -1
- package/dist/chunk-DEPF5LQI.js.map +0 -1
- package/dist/chunk-ETZ5A3GU.js.map +0 -1
- package/dist/chunk-EYJMMGXF.js +0 -19
- package/dist/chunk-EYJMMGXF.js.map +0 -1
- package/dist/chunk-F57LNUSZ.js.map +0 -1
- package/dist/chunk-FAXXN7KI.cjs.map +0 -1
- package/dist/chunk-FM3IRQJW.cjs.map +0 -1
- package/dist/chunk-FTZ45WHY.js.map +0 -1
- package/dist/chunk-GC2FSPSQ.cjs.map +0 -1
- package/dist/chunk-KDLX5AA7.js +0 -49
- package/dist/chunk-KDLX5AA7.js.map +0 -1
- package/dist/chunk-KFMRBZQK.js.map +0 -1
- package/dist/chunk-MNG7N6M2.js.map +0 -1
- package/dist/chunk-NPLGB4LI.cjs.map +0 -1
- package/dist/chunk-P2YM67Y5.cjs.map +0 -1
- package/dist/chunk-P6RIBIVN.js.map +0 -1
- package/dist/chunk-Q7CQYYZW.cjs.map +0 -1
- package/dist/chunk-QJFJ5JBF.cjs +0 -2838
- package/dist/chunk-QJFJ5JBF.cjs.map +0 -1
- package/dist/chunk-RATEAOKT.js.map +0 -1
- package/dist/chunk-SDOEHEJP.js.map +0 -1
- package/dist/chunk-SZSJGZSO.js.map +0 -1
- package/dist/chunk-TC3RQNEX.cjs.map +0 -1
- package/dist/chunk-TF7HN5EU.js.map +0 -1
- package/dist/chunk-VF5EUAIV.js.map +0 -1
- package/dist/chunk-VTTZZ4FN.js.map +0 -1
- package/dist/chunk-WK6FVIF7.js +0 -654
- package/dist/chunk-WK6FVIF7.js.map +0 -1
- package/dist/chunk-YF3QUHKN.cjs.map +0 -1
- package/dist/connection/ArbiAppProvider.d.ts +0 -16
- package/dist/connection/files/support.d.ts +0 -40
- package/dist/files/tags/DocTagPopover.d.ts +0 -113
- package/dist/files/tags/TagManager.d.ts +0 -54
|
@@ -0,0 +1,1834 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { FailedStageIcon } from './chunk-KNCJSPXV.js';
|
|
3
|
+
import { LabelPickerList } from './chunk-JMQLTMJ7.js';
|
|
4
|
+
import { testIdOr, prefixedTestId } from './chunk-7F6CBP3Z.js';
|
|
5
|
+
import { ModalSection, ModalSectionTitle } from './chunk-TX2ZICS7.js';
|
|
6
|
+
import { Download, Copy, FolderInput, Users, XCircle, AlertTriangle, CheckCircle2, Loader2, Info, RotateCcw, Share2, ImagePlus, Crop, ChevronLeft, ChevronRight, ZoomIn, Tags, StickyNote, X, Check, ExternalLink, Square, RefreshCw, Settings, Unplug, CheckCircle, CircleSlash, AlertCircle, Hourglass, LoaderCircle, SquareCheckBig, FileX } from 'lucide-react';
|
|
7
|
+
import { cn, Badge, RadioGroup, RadioGroupItem, Label, ScrollArea, Button, Checkbox, Progress, getEntityColor, TooltipProvider, Tooltip, TooltipTrigger, TooltipContent, Textarea, Popover, PopoverTrigger, PopoverContent } from '@arbidocs/react/ui';
|
|
8
|
+
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
9
|
+
import { memo, useMemo, useState, useRef } from 'react';
|
|
10
|
+
|
|
11
|
+
var DEFAULT_EXPORT_LABELS = {
|
|
12
|
+
export: "Export, copy or move",
|
|
13
|
+
selected: (count) => `${count} selected`,
|
|
14
|
+
exportMethod: "Where to",
|
|
15
|
+
downloadToComputer: "Download as files",
|
|
16
|
+
downloadDescription: "A ZIP with the files (every version), one data file per kind (JSON) and a manifest",
|
|
17
|
+
copyToWorkspace: "Copy to another workspace",
|
|
18
|
+
copyDescription: "Re-encrypted for the target workspace; nothing changes here",
|
|
19
|
+
moveToWorkspace: "Move to another workspace",
|
|
20
|
+
moveDescription: "Copied first, then removed from here \u2014 only what you may delete here",
|
|
21
|
+
exportColumns: "Document table (index.csv)",
|
|
22
|
+
columnsVisible: "Visible columns (from current table view)",
|
|
23
|
+
columnsAll: "All columns (including hidden)",
|
|
24
|
+
columnsFiles: "None (files and data only)",
|
|
25
|
+
columnsHelp: "Which document columns go into index.csv",
|
|
26
|
+
selectTargetWorkspace: "Select Target Workspace",
|
|
27
|
+
noOtherWorkspaces: "No other workspaces available",
|
|
28
|
+
member: "member",
|
|
29
|
+
members: "members",
|
|
30
|
+
result: "Result",
|
|
31
|
+
noItemDetail: "The server returned no per-item detail.",
|
|
32
|
+
done: "Done",
|
|
33
|
+
cancel: "Cancel"
|
|
34
|
+
};
|
|
35
|
+
function ExportModalTitle({
|
|
36
|
+
workspace,
|
|
37
|
+
entityIcon,
|
|
38
|
+
entityPlural,
|
|
39
|
+
selectedCount,
|
|
40
|
+
labels
|
|
41
|
+
}) {
|
|
42
|
+
const l = { ...DEFAULT_EXPORT_LABELS, ...labels };
|
|
43
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-col gap-1", children: [
|
|
44
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
45
|
+
/* @__PURE__ */ jsx("span", { children: l.export }),
|
|
46
|
+
selectedCount > 0 && /* @__PURE__ */ jsx(Badge, { className: "bg-accent px-2.5 py-0.5 text-accent-foreground hover:bg-accent", children: /* @__PURE__ */ jsx("span", { className: "font-semibold", children: l.selected(selectedCount) }) })
|
|
47
|
+
] }),
|
|
48
|
+
workspace && /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 items-center gap-1.5 text-sm font-normal text-muted-foreground", children: [
|
|
49
|
+
/* @__PURE__ */ jsx("span", { className: "shrink-0", children: workspace.icon }),
|
|
50
|
+
/* @__PURE__ */ jsx("span", { className: "truncate", title: workspace.name, children: workspace.name }),
|
|
51
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": "true", children: "/" }),
|
|
52
|
+
/* @__PURE__ */ jsx("span", { className: "shrink-0", children: entityIcon }),
|
|
53
|
+
/* @__PURE__ */ jsx("span", { className: "truncate", children: entityPlural })
|
|
54
|
+
] })
|
|
55
|
+
] });
|
|
56
|
+
}
|
|
57
|
+
function ExportMethodChooser({
|
|
58
|
+
mode,
|
|
59
|
+
onModeChange,
|
|
60
|
+
columnsMode,
|
|
61
|
+
onColumnsModeChange,
|
|
62
|
+
showColumns = true,
|
|
63
|
+
moveDisabledReason,
|
|
64
|
+
labels,
|
|
65
|
+
columnsTestId
|
|
66
|
+
}) {
|
|
67
|
+
const l = { ...DEFAULT_EXPORT_LABELS, ...labels };
|
|
68
|
+
const card = "flex cursor-pointer items-start space-x-3 rounded-lg bg-muted p-4 transition-colors hover:bg-accent";
|
|
69
|
+
const options = [
|
|
70
|
+
{
|
|
71
|
+
value: "download",
|
|
72
|
+
icon: Download,
|
|
73
|
+
title: l.downloadToComputer,
|
|
74
|
+
description: l.downloadDescription
|
|
75
|
+
},
|
|
76
|
+
{ value: "copy", icon: Copy, title: l.copyToWorkspace, description: l.copyDescription },
|
|
77
|
+
{
|
|
78
|
+
value: "move",
|
|
79
|
+
icon: FolderInput,
|
|
80
|
+
title: l.moveToWorkspace,
|
|
81
|
+
description: moveDisabledReason ?? l.moveDescription,
|
|
82
|
+
disabledReason: moveDisabledReason
|
|
83
|
+
}
|
|
84
|
+
];
|
|
85
|
+
return /* @__PURE__ */ jsxs(ModalSection, { children: [
|
|
86
|
+
/* @__PURE__ */ jsx(ModalSectionTitle, { children: l.exportMethod }),
|
|
87
|
+
/* @__PURE__ */ jsx(
|
|
88
|
+
RadioGroup,
|
|
89
|
+
{
|
|
90
|
+
value: mode,
|
|
91
|
+
onValueChange: (v) => onModeChange(v),
|
|
92
|
+
className: "space-y-3",
|
|
93
|
+
children: options.map((option) => {
|
|
94
|
+
const Icon = option.icon;
|
|
95
|
+
const disabled = !!option.disabledReason;
|
|
96
|
+
return /* @__PURE__ */ jsxs(
|
|
97
|
+
"div",
|
|
98
|
+
{
|
|
99
|
+
className: cn(card, disabled && "cursor-not-allowed opacity-60 hover:bg-muted"),
|
|
100
|
+
children: [
|
|
101
|
+
/* @__PURE__ */ jsx(
|
|
102
|
+
RadioGroupItem,
|
|
103
|
+
{
|
|
104
|
+
value: option.value,
|
|
105
|
+
id: `export-mode-${option.value}`,
|
|
106
|
+
className: "mt-1",
|
|
107
|
+
disabled
|
|
108
|
+
}
|
|
109
|
+
),
|
|
110
|
+
/* @__PURE__ */ jsxs("div", { className: "flex-1", onClick: () => !disabled && onModeChange(option.value), children: [
|
|
111
|
+
/* @__PURE__ */ jsxs(
|
|
112
|
+
Label,
|
|
113
|
+
{
|
|
114
|
+
htmlFor: `export-mode-${option.value}`,
|
|
115
|
+
className: "flex cursor-pointer items-center gap-2 font-medium",
|
|
116
|
+
children: [
|
|
117
|
+
/* @__PURE__ */ jsx(Icon, { className: "size-4" }),
|
|
118
|
+
option.title
|
|
119
|
+
]
|
|
120
|
+
}
|
|
121
|
+
),
|
|
122
|
+
/* @__PURE__ */ jsx("p", { className: "mt-1 text-sm text-muted-foreground", children: option.description }),
|
|
123
|
+
option.value === "download" && mode === "download" && showColumns && /* @__PURE__ */ jsxs("div", { className: "mt-3", onClick: (e) => e.stopPropagation(), children: [
|
|
124
|
+
/* @__PURE__ */ jsx("label", { className: "text-sm font-medium text-foreground", children: l.exportColumns }),
|
|
125
|
+
/* @__PURE__ */ jsxs(
|
|
126
|
+
"select",
|
|
127
|
+
{
|
|
128
|
+
value: columnsMode,
|
|
129
|
+
onChange: (e) => onColumnsModeChange(e.target.value),
|
|
130
|
+
className: "mt-1.5 w-full rounded-md border border-input bg-background px-3 py-2 text-sm pointer-coarse:min-h-11",
|
|
131
|
+
"data-testid": testIdOr(columnsTestId, { testId: "export-columns-selector" }),
|
|
132
|
+
children: [
|
|
133
|
+
/* @__PURE__ */ jsx("option", { value: "visible", children: l.columnsVisible }),
|
|
134
|
+
/* @__PURE__ */ jsx("option", { value: "all", children: l.columnsAll }),
|
|
135
|
+
/* @__PURE__ */ jsx("option", { value: "files", children: l.columnsFiles })
|
|
136
|
+
]
|
|
137
|
+
}
|
|
138
|
+
),
|
|
139
|
+
/* @__PURE__ */ jsx("p", { className: "mt-1.5 text-sm text-muted-foreground", children: l.columnsHelp })
|
|
140
|
+
] })
|
|
141
|
+
] })
|
|
142
|
+
]
|
|
143
|
+
},
|
|
144
|
+
option.value
|
|
145
|
+
);
|
|
146
|
+
})
|
|
147
|
+
}
|
|
148
|
+
)
|
|
149
|
+
] });
|
|
150
|
+
}
|
|
151
|
+
function ExportWorkspacePicker({
|
|
152
|
+
workspaces,
|
|
153
|
+
selectedId,
|
|
154
|
+
onSelect,
|
|
155
|
+
labels,
|
|
156
|
+
testId
|
|
157
|
+
}) {
|
|
158
|
+
const l = { ...DEFAULT_EXPORT_LABELS, ...labels };
|
|
159
|
+
return /* @__PURE__ */ jsxs(ModalSection, { children: [
|
|
160
|
+
/* @__PURE__ */ jsx(ModalSectionTitle, { children: l.selectTargetWorkspace }),
|
|
161
|
+
/* @__PURE__ */ jsx(ScrollArea, { className: "h-[300px] rounded-lg bg-muted", children: /* @__PURE__ */ jsx("div", { className: "space-y-2 p-2", children: workspaces.length === 0 ? /* @__PURE__ */ jsx("p", { className: "py-4 text-center text-sm text-muted-foreground", children: l.noOtherWorkspaces }) : workspaces.map((w) => /* @__PURE__ */ jsxs(
|
|
162
|
+
"button",
|
|
163
|
+
{
|
|
164
|
+
type: "button",
|
|
165
|
+
onClick: () => onSelect(w.id),
|
|
166
|
+
"aria-pressed": selectedId === w.id,
|
|
167
|
+
"data-testid": testIdOr(testId?.(w.id), { testId: `export-workspace-${w.id}` }),
|
|
168
|
+
className: cn(
|
|
169
|
+
"w-full rounded-lg p-3 text-left transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
170
|
+
selectedId === w.id ? "bg-accent ring-1 ring-primary/40" : "bg-background hover:bg-accent/60"
|
|
171
|
+
),
|
|
172
|
+
children: [
|
|
173
|
+
/* @__PURE__ */ jsxs("div", { className: "mb-2 flex items-start gap-3", children: [
|
|
174
|
+
w.icon,
|
|
175
|
+
/* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
|
|
176
|
+
/* @__PURE__ */ jsx("div", { className: "truncate font-medium", children: w.name }),
|
|
177
|
+
w.description && /* @__PURE__ */ jsx("div", { className: "mt-0.5 truncate text-sm text-muted-foreground", children: w.description })
|
|
178
|
+
] })
|
|
179
|
+
] }),
|
|
180
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between border-t border-border pt-2", children: [
|
|
181
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5 text-sm text-muted-foreground", children: [
|
|
182
|
+
/* @__PURE__ */ jsx(Users, { className: "size-3" }),
|
|
183
|
+
/* @__PURE__ */ jsxs("span", { children: [
|
|
184
|
+
w.memberCount,
|
|
185
|
+
" ",
|
|
186
|
+
w.memberCount === 1 ? l.member : l.members
|
|
187
|
+
] })
|
|
188
|
+
] }),
|
|
189
|
+
w.members
|
|
190
|
+
] })
|
|
191
|
+
]
|
|
192
|
+
},
|
|
193
|
+
w.id
|
|
194
|
+
)) }) })
|
|
195
|
+
] });
|
|
196
|
+
}
|
|
197
|
+
var RESULT_ICON = { success: CheckCircle2, warning: AlertTriangle, error: XCircle };
|
|
198
|
+
var RESULT_ICON_CLASS = {
|
|
199
|
+
success: "text-green-text",
|
|
200
|
+
warning: "text-yellow-text",
|
|
201
|
+
error: "text-red-text"
|
|
202
|
+
};
|
|
203
|
+
function ExportResultsReport({
|
|
204
|
+
summary,
|
|
205
|
+
rows,
|
|
206
|
+
onDone,
|
|
207
|
+
labels,
|
|
208
|
+
testIds
|
|
209
|
+
}) {
|
|
210
|
+
const l = { ...DEFAULT_EXPORT_LABELS, ...labels };
|
|
211
|
+
return /* @__PURE__ */ jsxs(ModalSection, { "data-testid": testIdOr(testIds?.root, { testId: "export-results" }), children: [
|
|
212
|
+
/* @__PURE__ */ jsx(ModalSectionTitle, { children: l.result }),
|
|
213
|
+
/* @__PURE__ */ jsx(
|
|
214
|
+
"p",
|
|
215
|
+
{
|
|
216
|
+
className: "text-sm text-muted-foreground",
|
|
217
|
+
"data-testid": testIdOr(testIds?.summary, { testId: "export-results-summary" }),
|
|
218
|
+
children: summary
|
|
219
|
+
}
|
|
220
|
+
),
|
|
221
|
+
/* @__PURE__ */ jsx(ScrollArea, { className: "mt-3 h-[280px] rounded-lg bg-muted", children: /* @__PURE__ */ jsxs("div", { className: "space-y-1 p-2", children: [
|
|
222
|
+
rows.map((row) => {
|
|
223
|
+
const Icon = RESULT_ICON[row.tone];
|
|
224
|
+
return /* @__PURE__ */ jsxs(
|
|
225
|
+
"div",
|
|
226
|
+
{
|
|
227
|
+
className: "flex items-start gap-2 rounded-md px-2 py-1.5",
|
|
228
|
+
"data-testid": testIdOr(testIds?.row?.(row.id), {
|
|
229
|
+
testId: `export-result-${row.id}`
|
|
230
|
+
}),
|
|
231
|
+
children: [
|
|
232
|
+
/* @__PURE__ */ jsx(Icon, { className: cn("mt-0.5 size-4 shrink-0", RESULT_ICON_CLASS[row.tone]) }),
|
|
233
|
+
/* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
|
|
234
|
+
/* @__PURE__ */ jsxs("div", { className: "flex min-w-0 items-center gap-2", children: [
|
|
235
|
+
/* @__PURE__ */ jsx("span", { className: "truncate text-sm", children: row.name }),
|
|
236
|
+
/* @__PURE__ */ jsx("span", { className: "shrink-0 text-xs uppercase tracking-wide text-muted-foreground", children: row.kind })
|
|
237
|
+
] }),
|
|
238
|
+
row.detail && /* @__PURE__ */ jsx("p", { className: "mt-0.5 break-words text-sm text-muted-foreground", children: row.detail })
|
|
239
|
+
] })
|
|
240
|
+
]
|
|
241
|
+
},
|
|
242
|
+
row.id
|
|
243
|
+
);
|
|
244
|
+
}),
|
|
245
|
+
rows.length === 0 && /* @__PURE__ */ jsx("p", { className: "py-4 text-center text-sm text-muted-foreground", children: l.noItemDetail })
|
|
246
|
+
] }) }),
|
|
247
|
+
/* @__PURE__ */ jsx("div", { className: "mt-4 flex justify-end", children: /* @__PURE__ */ jsx(
|
|
248
|
+
Button,
|
|
249
|
+
{
|
|
250
|
+
onClick: onDone,
|
|
251
|
+
"data-testid": testIdOr(testIds?.done, { testId: "export-results-done-button" }),
|
|
252
|
+
children: l.done
|
|
253
|
+
}
|
|
254
|
+
) })
|
|
255
|
+
] });
|
|
256
|
+
}
|
|
257
|
+
function ExportFooter({
|
|
258
|
+
onCancel,
|
|
259
|
+
onSubmit,
|
|
260
|
+
submitLabel,
|
|
261
|
+
submitDisabled,
|
|
262
|
+
labels,
|
|
263
|
+
testIds
|
|
264
|
+
}) {
|
|
265
|
+
const l = { ...DEFAULT_EXPORT_LABELS, ...labels };
|
|
266
|
+
return /* @__PURE__ */ jsxs("div", { className: "sticky bottom-0 flex flex-col-reverse sm:flex-row sm:justify-end gap-2 border-t border-border bg-background p-4", children: [
|
|
267
|
+
/* @__PURE__ */ jsx(
|
|
268
|
+
Button,
|
|
269
|
+
{
|
|
270
|
+
variant: "outline",
|
|
271
|
+
onClick: onCancel,
|
|
272
|
+
"data-testid": testIdOr(testIds?.cancel, { testId: "export-cancel-button" }),
|
|
273
|
+
children: l.cancel
|
|
274
|
+
}
|
|
275
|
+
),
|
|
276
|
+
/* @__PURE__ */ jsx(
|
|
277
|
+
Button,
|
|
278
|
+
{
|
|
279
|
+
onClick: onSubmit,
|
|
280
|
+
disabled: submitDisabled,
|
|
281
|
+
"data-testid": testIdOr(testIds?.submit, { testId: "export-submit-button" }),
|
|
282
|
+
children: submitLabel
|
|
283
|
+
}
|
|
284
|
+
)
|
|
285
|
+
] });
|
|
286
|
+
}
|
|
287
|
+
var DEFAULT_TRANSFER_LABELS = {
|
|
288
|
+
what: "What",
|
|
289
|
+
scopeSelection: (count) => `The ${count} selected`,
|
|
290
|
+
scopeLabel: "Everything with a label",
|
|
291
|
+
scopeAll: "Everything in this workspace",
|
|
292
|
+
chooseLabel: "Label",
|
|
293
|
+
include: "Include",
|
|
294
|
+
references: "Documents they cite",
|
|
295
|
+
referencesInclude: "Bring them along",
|
|
296
|
+
referencesLink: "Leave them here (the citation keeps pointing here)",
|
|
297
|
+
referencesHelp: "Notes, conversations and automations can cite documents outside your selection.",
|
|
298
|
+
conflicts: "Already in the target",
|
|
299
|
+
conflictSkip: "Skip it (same-named file or automation, identical note)",
|
|
300
|
+
conflictKeepBoth: 'Keep both \u2014 the copy is renamed "name (2)"',
|
|
301
|
+
summary: "This will include",
|
|
302
|
+
summaryLoading: "Working out what is included\u2026",
|
|
303
|
+
hide: "Close \u2014 it keeps going",
|
|
304
|
+
cancelJob: "Stop",
|
|
305
|
+
resume: "Resume"
|
|
306
|
+
};
|
|
307
|
+
function TransferScopeChooser({
|
|
308
|
+
scope,
|
|
309
|
+
onScopeChange,
|
|
310
|
+
selectedCount,
|
|
311
|
+
labelOptions,
|
|
312
|
+
labelId,
|
|
313
|
+
onLabelChange,
|
|
314
|
+
labels
|
|
315
|
+
}) {
|
|
316
|
+
const l = { ...DEFAULT_TRANSFER_LABELS, ...labels };
|
|
317
|
+
const choices = [
|
|
318
|
+
{ value: "selection", title: l.scopeSelection(selectedCount), hidden: selectedCount === 0 },
|
|
319
|
+
{ value: "label", title: l.scopeLabel, disabled: labelOptions.length === 0 },
|
|
320
|
+
{ value: "all", title: l.scopeAll }
|
|
321
|
+
];
|
|
322
|
+
return /* @__PURE__ */ jsxs(ModalSection, { "data-testid": "transfer-scope", children: [
|
|
323
|
+
/* @__PURE__ */ jsx(ModalSectionTitle, { children: l.what }),
|
|
324
|
+
/* @__PURE__ */ jsx(
|
|
325
|
+
RadioGroup,
|
|
326
|
+
{
|
|
327
|
+
value: scope,
|
|
328
|
+
onValueChange: (v) => onScopeChange(v),
|
|
329
|
+
className: "space-y-2",
|
|
330
|
+
children: choices.filter((c) => !c.hidden).map((c) => /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
|
|
331
|
+
/* @__PURE__ */ jsx(
|
|
332
|
+
RadioGroupItem,
|
|
333
|
+
{
|
|
334
|
+
value: c.value,
|
|
335
|
+
id: `transfer-scope-${c.value}`,
|
|
336
|
+
disabled: c.disabled,
|
|
337
|
+
"data-testid": `transfer-scope-${c.value}`
|
|
338
|
+
}
|
|
339
|
+
),
|
|
340
|
+
/* @__PURE__ */ jsx(Label, { htmlFor: `transfer-scope-${c.value}`, className: "cursor-pointer", children: c.title }),
|
|
341
|
+
c.value === "label" && scope === "label" && /* @__PURE__ */ jsx(
|
|
342
|
+
"select",
|
|
343
|
+
{
|
|
344
|
+
"aria-label": l.chooseLabel,
|
|
345
|
+
value: labelId ?? "",
|
|
346
|
+
onChange: (e) => onLabelChange(e.target.value),
|
|
347
|
+
className: "min-w-0 flex-1 rounded-md border border-input bg-background px-2 py-1 text-sm pointer-coarse:min-h-11",
|
|
348
|
+
"data-testid": "transfer-scope-label-select",
|
|
349
|
+
children: labelOptions.map((option) => /* @__PURE__ */ jsx("option", { value: option.id, children: option.name }, option.id))
|
|
350
|
+
}
|
|
351
|
+
)
|
|
352
|
+
] }, c.value))
|
|
353
|
+
}
|
|
354
|
+
)
|
|
355
|
+
] });
|
|
356
|
+
}
|
|
357
|
+
function TransferKindsPicker({
|
|
358
|
+
options,
|
|
359
|
+
selected,
|
|
360
|
+
onToggle,
|
|
361
|
+
labels
|
|
362
|
+
}) {
|
|
363
|
+
const l = { ...DEFAULT_TRANSFER_LABELS, ...labels };
|
|
364
|
+
return /* @__PURE__ */ jsxs(ModalSection, { "data-testid": "transfer-kinds", children: [
|
|
365
|
+
/* @__PURE__ */ jsx(ModalSectionTitle, { children: l.include }),
|
|
366
|
+
/* @__PURE__ */ jsx("div", { className: "grid grid-cols-1 gap-2 sm:grid-cols-2", children: options.map((option) => {
|
|
367
|
+
const id = `transfer-kind-${option.kind}`;
|
|
368
|
+
return /* @__PURE__ */ jsxs(
|
|
369
|
+
"div",
|
|
370
|
+
{
|
|
371
|
+
className: "flex items-center gap-2 rounded-md bg-muted px-3 py-2",
|
|
372
|
+
children: [
|
|
373
|
+
/* @__PURE__ */ jsx(
|
|
374
|
+
Checkbox,
|
|
375
|
+
{
|
|
376
|
+
id,
|
|
377
|
+
checked: selected.includes(option.kind),
|
|
378
|
+
onCheckedChange: (checked) => onToggle(option.kind, checked === true),
|
|
379
|
+
"data-testid": id
|
|
380
|
+
}
|
|
381
|
+
),
|
|
382
|
+
/* @__PURE__ */ jsx(Label, { htmlFor: id, className: "flex-1 cursor-pointer", children: option.label }),
|
|
383
|
+
option.count !== void 0 && /* @__PURE__ */ jsx(
|
|
384
|
+
"span",
|
|
385
|
+
{
|
|
386
|
+
className: "text-sm tabular-nums text-muted-foreground",
|
|
387
|
+
"data-testid": `${id}-count`,
|
|
388
|
+
children: option.count
|
|
389
|
+
}
|
|
390
|
+
)
|
|
391
|
+
]
|
|
392
|
+
},
|
|
393
|
+
option.kind
|
|
394
|
+
);
|
|
395
|
+
}) })
|
|
396
|
+
] });
|
|
397
|
+
}
|
|
398
|
+
function ChoiceRows({
|
|
399
|
+
title,
|
|
400
|
+
value,
|
|
401
|
+
onChange,
|
|
402
|
+
choices,
|
|
403
|
+
help,
|
|
404
|
+
testId
|
|
405
|
+
}) {
|
|
406
|
+
return /* @__PURE__ */ jsxs(ModalSection, { "data-testid": testId, children: [
|
|
407
|
+
/* @__PURE__ */ jsx(ModalSectionTitle, { children: title }),
|
|
408
|
+
help && /* @__PURE__ */ jsx("p", { className: "mb-2 text-sm text-muted-foreground", children: help }),
|
|
409
|
+
/* @__PURE__ */ jsx(RadioGroup, { value, onValueChange: (v) => onChange(v), className: "space-y-2", children: choices.map((c) => /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
|
|
410
|
+
/* @__PURE__ */ jsx(
|
|
411
|
+
RadioGroupItem,
|
|
412
|
+
{
|
|
413
|
+
value: c.value,
|
|
414
|
+
id: `${testId}-${c.value}`,
|
|
415
|
+
"data-testid": `${testId}-${c.value}`
|
|
416
|
+
}
|
|
417
|
+
),
|
|
418
|
+
/* @__PURE__ */ jsx(Label, { htmlFor: `${testId}-${c.value}`, className: "cursor-pointer", children: c.title })
|
|
419
|
+
] }, c.value)) })
|
|
420
|
+
] });
|
|
421
|
+
}
|
|
422
|
+
function TransferReferencesChooser({
|
|
423
|
+
value,
|
|
424
|
+
onChange,
|
|
425
|
+
labels
|
|
426
|
+
}) {
|
|
427
|
+
const l = { ...DEFAULT_TRANSFER_LABELS, ...labels };
|
|
428
|
+
return /* @__PURE__ */ jsx(
|
|
429
|
+
ChoiceRows,
|
|
430
|
+
{
|
|
431
|
+
title: l.references,
|
|
432
|
+
help: l.referencesHelp,
|
|
433
|
+
value,
|
|
434
|
+
onChange,
|
|
435
|
+
testId: "transfer-references",
|
|
436
|
+
choices: [
|
|
437
|
+
{ value: "include", title: l.referencesInclude },
|
|
438
|
+
{ value: "link", title: l.referencesLink }
|
|
439
|
+
]
|
|
440
|
+
}
|
|
441
|
+
);
|
|
442
|
+
}
|
|
443
|
+
function TransferConflictChooser({
|
|
444
|
+
value,
|
|
445
|
+
onChange,
|
|
446
|
+
labels
|
|
447
|
+
}) {
|
|
448
|
+
const l = { ...DEFAULT_TRANSFER_LABELS, ...labels };
|
|
449
|
+
return /* @__PURE__ */ jsx(
|
|
450
|
+
ChoiceRows,
|
|
451
|
+
{
|
|
452
|
+
title: l.conflicts,
|
|
453
|
+
value,
|
|
454
|
+
onChange,
|
|
455
|
+
testId: "transfer-conflict",
|
|
456
|
+
choices: [
|
|
457
|
+
{ value: "skip", title: l.conflictSkip },
|
|
458
|
+
{ value: "keep_both", title: l.conflictKeepBoth }
|
|
459
|
+
]
|
|
460
|
+
}
|
|
461
|
+
);
|
|
462
|
+
}
|
|
463
|
+
function TransferPlanSummary({
|
|
464
|
+
lines,
|
|
465
|
+
warnings,
|
|
466
|
+
isLoading,
|
|
467
|
+
labels
|
|
468
|
+
}) {
|
|
469
|
+
const l = { ...DEFAULT_TRANSFER_LABELS, ...labels };
|
|
470
|
+
return /* @__PURE__ */ jsxs(ModalSection, { "data-testid": "transfer-plan-summary", children: [
|
|
471
|
+
/* @__PURE__ */ jsx(ModalSectionTitle, { children: l.summary }),
|
|
472
|
+
isLoading && lines.length === 0 ? /* @__PURE__ */ jsxs("p", { className: "flex items-center gap-2 text-sm text-muted-foreground", children: [
|
|
473
|
+
/* @__PURE__ */ jsx(Loader2, { className: "size-4 animate-spin" }),
|
|
474
|
+
l.summaryLoading
|
|
475
|
+
] }) : /* @__PURE__ */ jsx("ul", { className: "space-y-1 text-sm", children: lines.map((line) => /* @__PURE__ */ jsxs("li", { className: "flex items-start gap-2", children: [
|
|
476
|
+
/* @__PURE__ */ jsx(Info, { className: "mt-0.5 size-4 shrink-0 text-muted-foreground" }),
|
|
477
|
+
/* @__PURE__ */ jsx("span", { children: line })
|
|
478
|
+
] }, line)) }),
|
|
479
|
+
warnings.length > 0 && /* @__PURE__ */ jsx("ul", { className: "mt-2 space-y-1 text-sm", "data-testid": "transfer-plan-warnings", children: warnings.map((warning) => /* @__PURE__ */ jsxs("li", { className: "flex items-start gap-2", children: [
|
|
480
|
+
/* @__PURE__ */ jsx(AlertTriangle, { className: "mt-0.5 size-4 shrink-0 text-yellow-text" }),
|
|
481
|
+
/* @__PURE__ */ jsx("span", { children: warning })
|
|
482
|
+
] }, warning)) })
|
|
483
|
+
] });
|
|
484
|
+
}
|
|
485
|
+
function TransferProgressView({
|
|
486
|
+
title,
|
|
487
|
+
processed,
|
|
488
|
+
total,
|
|
489
|
+
phaseLabel,
|
|
490
|
+
onHide,
|
|
491
|
+
onCancel,
|
|
492
|
+
isCancelling,
|
|
493
|
+
labels
|
|
494
|
+
}) {
|
|
495
|
+
const l = { ...DEFAULT_TRANSFER_LABELS, ...labels };
|
|
496
|
+
const percent = total > 0 ? Math.min(100, Math.round(processed / total * 100)) : 0;
|
|
497
|
+
return /* @__PURE__ */ jsxs(ModalSection, { "data-testid": "transfer-progress", children: [
|
|
498
|
+
/* @__PURE__ */ jsx(ModalSectionTitle, { children: title }),
|
|
499
|
+
/* @__PURE__ */ jsx(Progress, { value: percent, className: "h-2" }),
|
|
500
|
+
/* @__PURE__ */ jsxs("p", { className: "mt-2 text-sm text-muted-foreground", "data-testid": "transfer-progress-text", children: [
|
|
501
|
+
phaseLabel,
|
|
502
|
+
" \xB7 ",
|
|
503
|
+
processed,
|
|
504
|
+
" / ",
|
|
505
|
+
total
|
|
506
|
+
] }),
|
|
507
|
+
/* @__PURE__ */ jsxs("div", { className: "mt-4 flex justify-end gap-2", children: [
|
|
508
|
+
onCancel && /* @__PURE__ */ jsx(
|
|
509
|
+
Button,
|
|
510
|
+
{
|
|
511
|
+
variant: "outline",
|
|
512
|
+
onClick: onCancel,
|
|
513
|
+
disabled: isCancelling,
|
|
514
|
+
"data-testid": "transfer-cancel-button",
|
|
515
|
+
children: l.cancelJob
|
|
516
|
+
}
|
|
517
|
+
),
|
|
518
|
+
onHide && /* @__PURE__ */ jsx(Button, { onClick: onHide, "data-testid": "transfer-hide-button", children: l.hide })
|
|
519
|
+
] })
|
|
520
|
+
] });
|
|
521
|
+
}
|
|
522
|
+
function TransferResumeBanner({
|
|
523
|
+
message,
|
|
524
|
+
onResume,
|
|
525
|
+
isResuming,
|
|
526
|
+
labels
|
|
527
|
+
}) {
|
|
528
|
+
const l = { ...DEFAULT_TRANSFER_LABELS, ...labels };
|
|
529
|
+
return /* @__PURE__ */ jsxs(
|
|
530
|
+
"div",
|
|
531
|
+
{
|
|
532
|
+
className: cn("flex items-center gap-3 rounded-lg bg-muted p-3 text-sm"),
|
|
533
|
+
"data-testid": "transfer-resume-banner",
|
|
534
|
+
children: [
|
|
535
|
+
/* @__PURE__ */ jsx(AlertTriangle, { className: "size-4 shrink-0 text-yellow-text" }),
|
|
536
|
+
/* @__PURE__ */ jsx("span", { className: "flex-1", children: message }),
|
|
537
|
+
/* @__PURE__ */ jsxs(
|
|
538
|
+
Button,
|
|
539
|
+
{
|
|
540
|
+
size: "sm",
|
|
541
|
+
onClick: onResume,
|
|
542
|
+
disabled: isResuming,
|
|
543
|
+
"data-testid": "transfer-resume-button",
|
|
544
|
+
children: [
|
|
545
|
+
/* @__PURE__ */ jsx(RotateCcw, { className: "size-4" }),
|
|
546
|
+
l.resume
|
|
547
|
+
]
|
|
548
|
+
}
|
|
549
|
+
)
|
|
550
|
+
]
|
|
551
|
+
}
|
|
552
|
+
);
|
|
553
|
+
}
|
|
554
|
+
var DEFAULT_VIEWER_LABELS = {
|
|
555
|
+
shared: "Shared",
|
|
556
|
+
useAsReference: "Use as reference",
|
|
557
|
+
useAsReferenceTitle: "Use as reference for a new image generation",
|
|
558
|
+
crop: "Crop",
|
|
559
|
+
cropTitle: "Crop and save as a new version",
|
|
560
|
+
previousPage: "Previous page",
|
|
561
|
+
nextPage: "Next page",
|
|
562
|
+
zoom: (level) => `Zoom ${level}. Click to zoom in further, then back to fit the page width.`,
|
|
563
|
+
pageInput: "Page number input",
|
|
564
|
+
pageOfTitle: "Click to go to page",
|
|
565
|
+
pageOf: (page, total) => `Page ${page} of ${total}. Click to navigate.`,
|
|
566
|
+
previewUnavailable: "Preview not available",
|
|
567
|
+
cannotPreview: (extension) => `${extension} files cannot be previewed in the browser.`,
|
|
568
|
+
downloadToOpen: "Download to open",
|
|
569
|
+
download: "Download"
|
|
570
|
+
};
|
|
571
|
+
var ViewerFrame = ({
|
|
572
|
+
header,
|
|
573
|
+
compareRow,
|
|
574
|
+
contentId,
|
|
575
|
+
children,
|
|
576
|
+
footer,
|
|
577
|
+
frameRef,
|
|
578
|
+
className,
|
|
579
|
+
testIds
|
|
580
|
+
}) => /* @__PURE__ */ jsxs(
|
|
581
|
+
"div",
|
|
582
|
+
{
|
|
583
|
+
ref: frameRef,
|
|
584
|
+
className: cn("flex h-full w-full flex-col", className),
|
|
585
|
+
"data-slot": "viewer-frame",
|
|
586
|
+
"data-testid": testIdOr(testIds?.root, { testId: "document-viewer" }),
|
|
587
|
+
children: [
|
|
588
|
+
/* @__PURE__ */ jsxs("div", { className: "sticky top-0 z-10 bg-background", children: [
|
|
589
|
+
header,
|
|
590
|
+
compareRow && /* @__PURE__ */ jsx(
|
|
591
|
+
"div",
|
|
592
|
+
{
|
|
593
|
+
className: "flex flex-wrap items-center gap-1.5 border-t border-border px-3 py-1.5",
|
|
594
|
+
"data-testid": testIdOr(testIds?.compareRow, { testId: "compare-indicator-row" }),
|
|
595
|
+
children: compareRow
|
|
596
|
+
}
|
|
597
|
+
)
|
|
598
|
+
] }),
|
|
599
|
+
/* @__PURE__ */ jsx(
|
|
600
|
+
"div",
|
|
601
|
+
{
|
|
602
|
+
className: "flex-1 overflow-hidden",
|
|
603
|
+
"data-testid": testIdOr(testIds?.content, { testId: `document-viewer-content-${contentId}` }),
|
|
604
|
+
children
|
|
605
|
+
}
|
|
606
|
+
),
|
|
607
|
+
footer
|
|
608
|
+
]
|
|
609
|
+
}
|
|
610
|
+
);
|
|
611
|
+
function ViewerMessage({ children, testId }) {
|
|
612
|
+
return /* @__PURE__ */ jsx("div", { className: "flex h-full items-center justify-center", "data-testid": testId, children: /* @__PURE__ */ jsx("div", { className: "text-sm text-muted-foreground", children }) });
|
|
613
|
+
}
|
|
614
|
+
function ViewerTitle({
|
|
615
|
+
title,
|
|
616
|
+
shared,
|
|
617
|
+
versionLabel,
|
|
618
|
+
shrink,
|
|
619
|
+
labels,
|
|
620
|
+
sharedTestId
|
|
621
|
+
}) {
|
|
622
|
+
const l = { ...DEFAULT_VIEWER_LABELS, ...labels };
|
|
623
|
+
return /* @__PURE__ */ jsxs(
|
|
624
|
+
"span",
|
|
625
|
+
{
|
|
626
|
+
className: cn(
|
|
627
|
+
"inline-flex min-w-0 items-center gap-1.5 px-1 py-1 text-sm font-medium",
|
|
628
|
+
shrink ? "shrink" : "shrink-0"
|
|
629
|
+
),
|
|
630
|
+
title,
|
|
631
|
+
children: [
|
|
632
|
+
/* @__PURE__ */ jsx("span", { className: "truncate", children: title }),
|
|
633
|
+
shared && /* @__PURE__ */ jsx(
|
|
634
|
+
"span",
|
|
635
|
+
{
|
|
636
|
+
title: l.shared,
|
|
637
|
+
className: "flex shrink-0 items-center",
|
|
638
|
+
"data-testid": testIdOr(sharedTestId, { testId: "document-title-shared-indicator" }),
|
|
639
|
+
children: /* @__PURE__ */ jsx(Share2, { "aria-label": l.shared, className: "size-3.5 text-muted-foreground" })
|
|
640
|
+
}
|
|
641
|
+
),
|
|
642
|
+
versionLabel && /* @__PURE__ */ jsx("span", { className: "shrink-0 text-xs font-normal text-muted-foreground", children: versionLabel })
|
|
643
|
+
]
|
|
644
|
+
}
|
|
645
|
+
);
|
|
646
|
+
}
|
|
647
|
+
function ViewerImageActions({
|
|
648
|
+
compact,
|
|
649
|
+
onUseAsReference,
|
|
650
|
+
onCrop,
|
|
651
|
+
labels,
|
|
652
|
+
testIds
|
|
653
|
+
}) {
|
|
654
|
+
const l = { ...DEFAULT_VIEWER_LABELS, ...labels };
|
|
655
|
+
const size = compact ? "icon" : "sm";
|
|
656
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
657
|
+
onUseAsReference && /* @__PURE__ */ jsxs(
|
|
658
|
+
Button,
|
|
659
|
+
{
|
|
660
|
+
onClick: onUseAsReference,
|
|
661
|
+
variant: "outline",
|
|
662
|
+
size,
|
|
663
|
+
title: l.useAsReferenceTitle,
|
|
664
|
+
"aria-label": l.useAsReference,
|
|
665
|
+
"data-testid": testIdOr(testIds?.useAsReference, {
|
|
666
|
+
testId: "image-use-as-reference-button"
|
|
667
|
+
}),
|
|
668
|
+
className: "pointer-coarse:min-h-11",
|
|
669
|
+
children: [
|
|
670
|
+
/* @__PURE__ */ jsx(ImagePlus, { className: "size-4" }),
|
|
671
|
+
!compact && /* @__PURE__ */ jsx("span", { className: "ml-1", children: l.useAsReference })
|
|
672
|
+
]
|
|
673
|
+
}
|
|
674
|
+
),
|
|
675
|
+
/* @__PURE__ */ jsxs(
|
|
676
|
+
Button,
|
|
677
|
+
{
|
|
678
|
+
onClick: onCrop,
|
|
679
|
+
variant: "outline",
|
|
680
|
+
size,
|
|
681
|
+
title: l.cropTitle,
|
|
682
|
+
"aria-label": l.crop,
|
|
683
|
+
"data-testid": testIdOr(testIds?.crop, { testId: "image-crop-button" }),
|
|
684
|
+
className: "pointer-coarse:min-h-11",
|
|
685
|
+
children: [
|
|
686
|
+
/* @__PURE__ */ jsx(Crop, { className: "size-4" }),
|
|
687
|
+
!compact && /* @__PURE__ */ jsx("span", { className: "ml-1", children: l.crop })
|
|
688
|
+
]
|
|
689
|
+
}
|
|
690
|
+
)
|
|
691
|
+
] });
|
|
692
|
+
}
|
|
693
|
+
function PdfPageNav({
|
|
694
|
+
canPrev,
|
|
695
|
+
canNext,
|
|
696
|
+
onPrev,
|
|
697
|
+
onNext,
|
|
698
|
+
counter,
|
|
699
|
+
labels,
|
|
700
|
+
testIds
|
|
701
|
+
}) {
|
|
702
|
+
const l = { ...DEFAULT_VIEWER_LABELS, ...labels };
|
|
703
|
+
return /* @__PURE__ */ jsxs(
|
|
704
|
+
"div",
|
|
705
|
+
{
|
|
706
|
+
className: "absolute bottom-4 left-1/2 z-10 flex -translate-x-1/2 items-center gap-1 rounded-lg border border-border bg-background/95 px-2 py-1.5 shadow-lg backdrop-blur",
|
|
707
|
+
"data-testid": testIdOr(testIds?.overlay, { testId: "pdf-page-nav-overlay" }),
|
|
708
|
+
children: [
|
|
709
|
+
/* @__PURE__ */ jsx(
|
|
710
|
+
Button,
|
|
711
|
+
{
|
|
712
|
+
variant: "ghost",
|
|
713
|
+
size: "icon",
|
|
714
|
+
className: "size-7 shrink-0 pointer-coarse:size-11",
|
|
715
|
+
onClick: onPrev,
|
|
716
|
+
disabled: !canPrev,
|
|
717
|
+
"aria-label": l.previousPage,
|
|
718
|
+
"data-testid": testIdOr(testIds?.prev, { testId: "pdf-page-nav-prev" }),
|
|
719
|
+
children: /* @__PURE__ */ jsx(ChevronLeft, { className: "size-4" })
|
|
720
|
+
}
|
|
721
|
+
),
|
|
722
|
+
counter,
|
|
723
|
+
/* @__PURE__ */ jsx(
|
|
724
|
+
Button,
|
|
725
|
+
{
|
|
726
|
+
variant: "ghost",
|
|
727
|
+
size: "icon",
|
|
728
|
+
className: "size-7 shrink-0 pointer-coarse:size-11",
|
|
729
|
+
onClick: onNext,
|
|
730
|
+
disabled: !canNext,
|
|
731
|
+
"aria-label": l.nextPage,
|
|
732
|
+
"data-testid": testIdOr(testIds?.next, { testId: "pdf-page-nav-next" }),
|
|
733
|
+
children: /* @__PURE__ */ jsx(ChevronRight, { className: "size-4" })
|
|
734
|
+
}
|
|
735
|
+
)
|
|
736
|
+
]
|
|
737
|
+
}
|
|
738
|
+
);
|
|
739
|
+
}
|
|
740
|
+
function ViewerZoomControl({ zoom, onCycle, labels, testIds }) {
|
|
741
|
+
const l = { ...DEFAULT_VIEWER_LABELS, ...labels };
|
|
742
|
+
const level = `${Math.round(zoom * 100)}%`;
|
|
743
|
+
const isZoomed = Math.abs(zoom - 1) > 0.02;
|
|
744
|
+
return /* @__PURE__ */ jsxs(
|
|
745
|
+
Button,
|
|
746
|
+
{
|
|
747
|
+
type: "button",
|
|
748
|
+
variant: "ghost",
|
|
749
|
+
onClick: onCycle,
|
|
750
|
+
title: `Zoom ${level}`,
|
|
751
|
+
"aria-label": l.zoom(level),
|
|
752
|
+
"data-testid": testIdOr(testIds?.button, { testId: "viewer-zoom-button" }),
|
|
753
|
+
className: "absolute right-3 bottom-4 z-10 h-9 min-w-9 items-center justify-center gap-1 rounded-full border border-border bg-background/95 px-2 shadow-md backdrop-blur pointer-coarse:h-11 pointer-coarse:min-w-11 pointer-coarse:px-2.5",
|
|
754
|
+
children: [
|
|
755
|
+
/* @__PURE__ */ jsx(ZoomIn, { className: "size-4" }),
|
|
756
|
+
isZoomed && /* @__PURE__ */ jsx(
|
|
757
|
+
"span",
|
|
758
|
+
{
|
|
759
|
+
className: "text-xs font-medium tabular-nums",
|
|
760
|
+
"data-testid": testIdOr(testIds?.level, { testId: "viewer-zoom-level" }),
|
|
761
|
+
children: level
|
|
762
|
+
}
|
|
763
|
+
)
|
|
764
|
+
]
|
|
765
|
+
}
|
|
766
|
+
);
|
|
767
|
+
}
|
|
768
|
+
function ViewerControlBar({ children, controls }) {
|
|
769
|
+
return (
|
|
770
|
+
// It fills what its pane leaves below any bars above it (a ViewerPane is a column), never
|
|
771
|
+
// the pane's whole height: that would push the body past the pane by the bars' height.
|
|
772
|
+
/* @__PURE__ */ jsxs("div", { className: "flex min-h-0 flex-1 flex-col", children: [
|
|
773
|
+
/* @__PURE__ */ jsx("div", { className: "relative min-h-0 flex-1", children }),
|
|
774
|
+
controls && /* @__PURE__ */ jsx(
|
|
775
|
+
"div",
|
|
776
|
+
{
|
|
777
|
+
"data-testid": "viewer-control-bar",
|
|
778
|
+
className: "relative h-22 shrink-0 border-t border-border bg-background",
|
|
779
|
+
children: controls
|
|
780
|
+
}
|
|
781
|
+
)
|
|
782
|
+
] })
|
|
783
|
+
);
|
|
784
|
+
}
|
|
785
|
+
var DEFAULT_HTML_VIEWER_LABELS = {
|
|
786
|
+
viewerRegion: "Parsed document viewer",
|
|
787
|
+
pageOfTotal: (page, total) => `Page ${page} of ${total}`,
|
|
788
|
+
documentContent: "Document content",
|
|
789
|
+
page: (n) => `Page ${n}`,
|
|
790
|
+
noContent: "No Content Available",
|
|
791
|
+
noContentDescription: "This document has not been parsed yet or contains no content",
|
|
792
|
+
citedSuffix: "cited",
|
|
793
|
+
previousCited: "Previous cited passage",
|
|
794
|
+
nextCited: "Next cited passage",
|
|
795
|
+
previousLabelPassage: "Previous passage with this label",
|
|
796
|
+
nextLabelPassage: "Next passage with this label",
|
|
797
|
+
sharedWithMembers: "Shared with workspace members",
|
|
798
|
+
privateToYou: "Private to you",
|
|
799
|
+
shared: "Shared",
|
|
800
|
+
private: "Private"
|
|
801
|
+
};
|
|
802
|
+
function HtmlViewerRoot({ children, className }) {
|
|
803
|
+
return /* @__PURE__ */ jsx("div", { className: cn("relative h-full w-full", className), "data-slot": "html-viewer", children });
|
|
804
|
+
}
|
|
805
|
+
function HtmlViewerSurface({
|
|
806
|
+
children,
|
|
807
|
+
surfaceRef,
|
|
808
|
+
hidden,
|
|
809
|
+
onMouseUp,
|
|
810
|
+
className,
|
|
811
|
+
labels,
|
|
812
|
+
testId
|
|
813
|
+
}) {
|
|
814
|
+
const l = { ...DEFAULT_HTML_VIEWER_LABELS, ...labels };
|
|
815
|
+
return /* @__PURE__ */ jsx(
|
|
816
|
+
"div",
|
|
817
|
+
{
|
|
818
|
+
ref: surfaceRef,
|
|
819
|
+
className: cn(
|
|
820
|
+
"flex h-full w-full flex-col items-center overflow-y-auto bg-muted p-4 pb-20",
|
|
821
|
+
hidden && "hidden",
|
|
822
|
+
className
|
|
823
|
+
),
|
|
824
|
+
role: "region",
|
|
825
|
+
"aria-label": l.viewerRegion,
|
|
826
|
+
"data-slot": "html-viewer-surface",
|
|
827
|
+
style: { touchAction: "pan-x pan-y" },
|
|
828
|
+
"data-testid": testIdOr(testId, { testId: "parsed-viewer" }),
|
|
829
|
+
onMouseUp,
|
|
830
|
+
children
|
|
831
|
+
}
|
|
832
|
+
);
|
|
833
|
+
}
|
|
834
|
+
function HtmlPage({
|
|
835
|
+
pageNumber,
|
|
836
|
+
totalPages,
|
|
837
|
+
isRendered,
|
|
838
|
+
placeholderHeight,
|
|
839
|
+
zoom = 1,
|
|
840
|
+
children,
|
|
841
|
+
labels
|
|
842
|
+
}) {
|
|
843
|
+
const l = { ...DEFAULT_HTML_VIEWER_LABELS, ...labels };
|
|
844
|
+
return /* @__PURE__ */ jsx(
|
|
845
|
+
"div",
|
|
846
|
+
{
|
|
847
|
+
id: pageNumber ? `page-${pageNumber}` : void 0,
|
|
848
|
+
"data-page-number": pageNumber ?? void 0,
|
|
849
|
+
"data-slot": "html-page",
|
|
850
|
+
className: cn(
|
|
851
|
+
// shrink-0: a page is a flex item of the scrolling surface and must never be squeezed.
|
|
852
|
+
"mb-6 w-full max-w-4xl shrink-0",
|
|
853
|
+
isRendered && "rounded-lg border border-border bg-background p-8"
|
|
854
|
+
),
|
|
855
|
+
role: "article",
|
|
856
|
+
"aria-label": pageNumber ? l.pageOfTotal(pageNumber, totalPages) : l.documentContent,
|
|
857
|
+
children: isRendered ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
858
|
+
pageNumber ? /* @__PURE__ */ jsx("div", { className: "mb-4 flex items-center justify-center border-b border-border pb-4", children: /* @__PURE__ */ jsx("div", { className: "text-sm font-medium text-muted-foreground", children: l.page(pageNumber) }) }) : null,
|
|
859
|
+
/* @__PURE__ */ jsx(
|
|
860
|
+
"div",
|
|
861
|
+
{
|
|
862
|
+
className: "prose prose-sm max-w-none prose-p:my-0 prose-headings:my-0 [&_img]:max-w-full [&_pre]:overflow-x-auto [&_table]:block [&_table]:max-w-full [&_table]:overflow-x-auto",
|
|
863
|
+
style: zoom === 1 ? void 0 : { fontSize: `${zoom}rem` },
|
|
864
|
+
children
|
|
865
|
+
}
|
|
866
|
+
)
|
|
867
|
+
] }) : /* @__PURE__ */ jsx(
|
|
868
|
+
"div",
|
|
869
|
+
{
|
|
870
|
+
className: "flex items-center justify-center rounded-md border border-border bg-muted",
|
|
871
|
+
style: { height: placeholderHeight },
|
|
872
|
+
children: pageNumber ? /* @__PURE__ */ jsx("div", { className: "text-sm text-muted-foreground", children: l.page(pageNumber) }) : null
|
|
873
|
+
}
|
|
874
|
+
)
|
|
875
|
+
}
|
|
876
|
+
);
|
|
877
|
+
}
|
|
878
|
+
function HtmlViewerEmpty({ labels }) {
|
|
879
|
+
const l = { ...DEFAULT_HTML_VIEWER_LABELS, ...labels };
|
|
880
|
+
return /* @__PURE__ */ jsx("div", { className: "flex h-full items-center justify-center text-muted-foreground", children: /* @__PURE__ */ jsxs("div", { className: "text-center", children: [
|
|
881
|
+
/* @__PURE__ */ jsx("p", { className: "mb-2 text-base font-medium", children: l.noContent }),
|
|
882
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm", children: l.noContentDescription })
|
|
883
|
+
] }) });
|
|
884
|
+
}
|
|
885
|
+
var HtmlPassage = memo(function HtmlPassage2({
|
|
886
|
+
chunkId,
|
|
887
|
+
highlight,
|
|
888
|
+
isHit,
|
|
889
|
+
hitTestId,
|
|
890
|
+
isSelected,
|
|
891
|
+
runIsStart,
|
|
892
|
+
runIsEnd,
|
|
893
|
+
isClickable,
|
|
894
|
+
onSelect,
|
|
895
|
+
isTagged,
|
|
896
|
+
activeTagColor,
|
|
897
|
+
runMarker,
|
|
898
|
+
tagMark,
|
|
899
|
+
mark,
|
|
900
|
+
children
|
|
901
|
+
}) {
|
|
902
|
+
const hasId = !!chunkId;
|
|
903
|
+
const rounding = !isSelected ? "rounded" : [runIsStart ? "rounded-t" : "rounded-t-none", runIsEnd ? "rounded-b" : "rounded-b-none"].join(
|
|
904
|
+
" "
|
|
905
|
+
);
|
|
906
|
+
return /* @__PURE__ */ jsxs(
|
|
907
|
+
"div",
|
|
908
|
+
{
|
|
909
|
+
id: chunkId,
|
|
910
|
+
"data-slot": "html-passage",
|
|
911
|
+
"data-chunk-id": chunkId,
|
|
912
|
+
"data-run-start": isSelected && runIsStart || void 0,
|
|
913
|
+
"data-tagged": isTagged || void 0,
|
|
914
|
+
"data-tag-active": activeTagColor ? true : void 0,
|
|
915
|
+
"data-testid": isHit ? testIdOr(hitTestId, { testId: "highlighted-chunk" }) : null,
|
|
916
|
+
onClick: hasId && onSelect ? (e) => {
|
|
917
|
+
if (e.target.closest('[data-slot="mark"], [data-slot="mark-menu"]'))
|
|
918
|
+
return;
|
|
919
|
+
onSelect(e.shiftKey);
|
|
920
|
+
} : void 0,
|
|
921
|
+
className: cn(
|
|
922
|
+
"group relative block px-1 py-0.5",
|
|
923
|
+
rounding,
|
|
924
|
+
highlight === "strong" ? "bg-ai-soft text-foreground ring-1 ring-ai-accent/40" : highlight === "light" ? "bg-ai-soft/60 text-foreground hover:bg-ai-soft" : hasId && "hover:bg-muted/50",
|
|
925
|
+
hasId && isClickable && "cursor-pointer select-none"
|
|
926
|
+
),
|
|
927
|
+
style: activeTagColor && !highlight ? {
|
|
928
|
+
backgroundColor: `${activeTagColor}22`,
|
|
929
|
+
boxShadow: `inset 3px 0 0 0 ${activeTagColor}`
|
|
930
|
+
} : void 0,
|
|
931
|
+
children: [
|
|
932
|
+
children,
|
|
933
|
+
tagMark && /* @__PURE__ */ jsx("span", { className: "absolute -left-3 top-1.5 z-10", children: tagMark }),
|
|
934
|
+
runMarker ? /* @__PURE__ */ jsx("span", { className: "absolute -top-2.5 left-1 z-10", "data-run-marker": true, children: runMarker }) : null,
|
|
935
|
+
mark && /* @__PURE__ */ jsx("span", { className: "absolute -top-2.5 right-0 z-10 opacity-0 transition-opacity duration-200 group-hover:opacity-100 group-focus-within:opacity-100 pointer-coarse:opacity-70 [&:has([aria-expanded=true])]:opacity-100", children: mark })
|
|
936
|
+
]
|
|
937
|
+
}
|
|
938
|
+
);
|
|
939
|
+
});
|
|
940
|
+
var stepButton = "px-1 text-muted-foreground hover:text-foreground pointer-coarse:min-h-11 pointer-coarse:min-w-11";
|
|
941
|
+
function PassageStepper({
|
|
942
|
+
position,
|
|
943
|
+
total,
|
|
944
|
+
onStep,
|
|
945
|
+
testId,
|
|
946
|
+
className,
|
|
947
|
+
prevLabel,
|
|
948
|
+
nextLabel,
|
|
949
|
+
suffix
|
|
950
|
+
}) {
|
|
951
|
+
return /* @__PURE__ */ jsxs(
|
|
952
|
+
"span",
|
|
953
|
+
{
|
|
954
|
+
className: cn(
|
|
955
|
+
"inline-flex items-center gap-1 rounded-md border border-border bg-background/95 px-1.5 py-0.5",
|
|
956
|
+
className
|
|
957
|
+
),
|
|
958
|
+
"data-slot": "passage-stepper",
|
|
959
|
+
"data-testid": testId,
|
|
960
|
+
children: [
|
|
961
|
+
/* @__PURE__ */ jsx(
|
|
962
|
+
"button",
|
|
963
|
+
{
|
|
964
|
+
type: "button",
|
|
965
|
+
onClick: () => onStep(-1),
|
|
966
|
+
"aria-label": prevLabel,
|
|
967
|
+
className: stepButton,
|
|
968
|
+
children: "\u2039"
|
|
969
|
+
}
|
|
970
|
+
),
|
|
971
|
+
/* @__PURE__ */ jsxs("span", { className: "text-xs tabular-nums text-muted-foreground", children: [
|
|
972
|
+
Math.min(position, total),
|
|
973
|
+
"/",
|
|
974
|
+
total,
|
|
975
|
+
suffix ? ` ${suffix}` : ""
|
|
976
|
+
] }),
|
|
977
|
+
/* @__PURE__ */ jsx("button", { type: "button", onClick: () => onStep(1), "aria-label": nextLabel, className: stepButton, children: "\u203A" })
|
|
978
|
+
]
|
|
979
|
+
}
|
|
980
|
+
);
|
|
981
|
+
}
|
|
982
|
+
function CitedRunNav({
|
|
983
|
+
labels,
|
|
984
|
+
testId,
|
|
985
|
+
...props
|
|
986
|
+
}) {
|
|
987
|
+
const l = { ...DEFAULT_HTML_VIEWER_LABELS, ...labels };
|
|
988
|
+
return /* @__PURE__ */ jsx("div", { className: "absolute left-1/2 top-2 z-20 -translate-x-1/2", "data-slot": "cited-run-nav", children: /* @__PURE__ */ jsx(
|
|
989
|
+
PassageStepper,
|
|
990
|
+
{
|
|
991
|
+
...props,
|
|
992
|
+
suffix: l.citedSuffix,
|
|
993
|
+
prevLabel: l.previousCited,
|
|
994
|
+
nextLabel: l.nextCited,
|
|
995
|
+
testId: testIdOr(testId, { testId: "note-run-nav" })
|
|
996
|
+
}
|
|
997
|
+
) });
|
|
998
|
+
}
|
|
999
|
+
function DocTagBar({
|
|
1000
|
+
chips,
|
|
1001
|
+
visibility,
|
|
1002
|
+
step,
|
|
1003
|
+
activeId = null,
|
|
1004
|
+
onSelect,
|
|
1005
|
+
labels,
|
|
1006
|
+
testIds
|
|
1007
|
+
}) {
|
|
1008
|
+
const l = { ...DEFAULT_HTML_VIEWER_LABELS, ...labels };
|
|
1009
|
+
if (chips.length === 0 && !visibility) return null;
|
|
1010
|
+
return /* @__PURE__ */ jsxs(
|
|
1011
|
+
"div",
|
|
1012
|
+
{
|
|
1013
|
+
className: "absolute left-2 right-2 top-2 z-20 flex flex-wrap items-center gap-1",
|
|
1014
|
+
"data-slot": "doc-tag-bar",
|
|
1015
|
+
"data-testid": testIdOr(testIds?.root, { testId: "doc-tag-bar" }),
|
|
1016
|
+
children: [
|
|
1017
|
+
chips.map((c) => {
|
|
1018
|
+
const isActive = c.id === activeId;
|
|
1019
|
+
const content = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1020
|
+
/* @__PURE__ */ jsx(Tags, { className: "size-3 shrink-0" }),
|
|
1021
|
+
c.name,
|
|
1022
|
+
c.passageCount > 0 && /* @__PURE__ */ jsx("span", { className: "tabular-nums opacity-90", children: c.passageCount }),
|
|
1023
|
+
c.hasNote && /* @__PURE__ */ jsx(StickyNote, { className: "size-3 opacity-90" })
|
|
1024
|
+
] });
|
|
1025
|
+
const chipClass = "inline-flex items-center gap-1.5 rounded-full border border-transparent px-2 py-0.5 text-xs text-white";
|
|
1026
|
+
return onSelect ? /* @__PURE__ */ jsx(
|
|
1027
|
+
"button",
|
|
1028
|
+
{
|
|
1029
|
+
type: "button",
|
|
1030
|
+
onClick: () => onSelect(isActive ? null : c.id),
|
|
1031
|
+
"aria-pressed": isActive,
|
|
1032
|
+
title: c.title,
|
|
1033
|
+
"data-testid": testIdOr(testIds?.chip?.(c.id), { testId: `doc-tag-chip-${c.id}` }),
|
|
1034
|
+
"data-active": isActive || void 0,
|
|
1035
|
+
className: cn(chipClass, "cursor-pointer", !isActive && "opacity-70 hover:opacity-100"),
|
|
1036
|
+
style: { backgroundColor: c.color },
|
|
1037
|
+
children: content
|
|
1038
|
+
},
|
|
1039
|
+
c.id
|
|
1040
|
+
) : /* @__PURE__ */ jsx(
|
|
1041
|
+
"span",
|
|
1042
|
+
{
|
|
1043
|
+
title: c.title,
|
|
1044
|
+
"data-testid": testIdOr(testIds?.chip?.(c.id), { testId: `doc-tag-chip-${c.id}` }),
|
|
1045
|
+
className: chipClass,
|
|
1046
|
+
style: { backgroundColor: c.color },
|
|
1047
|
+
children: content
|
|
1048
|
+
},
|
|
1049
|
+
c.id
|
|
1050
|
+
);
|
|
1051
|
+
}),
|
|
1052
|
+
step && step.total > 0 && /* @__PURE__ */ jsx(
|
|
1053
|
+
PassageStepper,
|
|
1054
|
+
{
|
|
1055
|
+
className: "ml-1",
|
|
1056
|
+
position: step.position,
|
|
1057
|
+
total: step.total,
|
|
1058
|
+
onStep: step.onStep,
|
|
1059
|
+
testId: testIdOr(testIds?.nav, { testId: "doc-tag-nav" }),
|
|
1060
|
+
prevLabel: l.previousLabelPassage,
|
|
1061
|
+
nextLabel: l.nextLabelPassage
|
|
1062
|
+
}
|
|
1063
|
+
),
|
|
1064
|
+
visibility && /* @__PURE__ */ jsxs(
|
|
1065
|
+
"span",
|
|
1066
|
+
{
|
|
1067
|
+
title: visibility === "shared" ? l.sharedWithMembers : l.privateToYou,
|
|
1068
|
+
"data-testid": testIdOr(testIds?.visibility, { testId: "doc-visibility-chip" }),
|
|
1069
|
+
className: cn(
|
|
1070
|
+
"ml-auto inline-flex shrink-0 items-center gap-1.5 rounded-full px-2 py-0.5 text-xs",
|
|
1071
|
+
visibility === "shared" ? "bg-accent text-accent-foreground" : "bg-muted text-muted-foreground"
|
|
1072
|
+
),
|
|
1073
|
+
children: [
|
|
1074
|
+
/* @__PURE__ */ jsx(Share2, { className: "size-3 shrink-0" }),
|
|
1075
|
+
visibility === "shared" ? l.shared : l.private
|
|
1076
|
+
]
|
|
1077
|
+
}
|
|
1078
|
+
)
|
|
1079
|
+
]
|
|
1080
|
+
}
|
|
1081
|
+
);
|
|
1082
|
+
}
|
|
1083
|
+
function isDocumentLabel(tag) {
|
|
1084
|
+
if (tag.kind !== "label") return false;
|
|
1085
|
+
const onDocs = (tag.doctag_count ?? 0) > 0;
|
|
1086
|
+
const onFacts = (tag.facttag_count ?? 0) > 0;
|
|
1087
|
+
return onDocs || !onFacts;
|
|
1088
|
+
}
|
|
1089
|
+
function summariseDocTags(doctags, workspaceTags) {
|
|
1090
|
+
const byTag = new Map(doctags.map((dt) => [dt.tag_ext_id, dt]));
|
|
1091
|
+
return workspaceTags.filter((t) => byTag.has(t.external_id)).map((t) => {
|
|
1092
|
+
const dt = byTag.get(t.external_id);
|
|
1093
|
+
return {
|
|
1094
|
+
tagExtId: t.external_id,
|
|
1095
|
+
name: t.name,
|
|
1096
|
+
chunkIds: (dt.citations ?? []).flatMap((d) => (d.chunks ?? []).map((c) => c.chunk_id)),
|
|
1097
|
+
hasNote: !!dt.note
|
|
1098
|
+
};
|
|
1099
|
+
});
|
|
1100
|
+
}
|
|
1101
|
+
function DocumentLabelBar({
|
|
1102
|
+
summaries,
|
|
1103
|
+
activeTagExtId = null,
|
|
1104
|
+
cursor = 0,
|
|
1105
|
+
onSelect,
|
|
1106
|
+
onStep
|
|
1107
|
+
}) {
|
|
1108
|
+
const chips = useMemo(
|
|
1109
|
+
() => summaries.map((s) => {
|
|
1110
|
+
const marked = s.chunkIds.length;
|
|
1111
|
+
return {
|
|
1112
|
+
id: s.tagExtId,
|
|
1113
|
+
name: s.name,
|
|
1114
|
+
color: getEntityColor(s.tagExtId, "medium"),
|
|
1115
|
+
passageCount: marked,
|
|
1116
|
+
hasNote: s.hasNote,
|
|
1117
|
+
title: marked ? `${s.name} \u2014 ${marked} passage${marked === 1 ? "" : "s"}${s.hasNote ? ", annotated" : ""}` : `${s.name} \u2014 applies to the document, no passages marked`
|
|
1118
|
+
};
|
|
1119
|
+
}),
|
|
1120
|
+
[summaries]
|
|
1121
|
+
);
|
|
1122
|
+
const active = summaries.find((s) => s.tagExtId === activeTagExtId);
|
|
1123
|
+
return /* @__PURE__ */ jsx(
|
|
1124
|
+
DocTagBar,
|
|
1125
|
+
{
|
|
1126
|
+
chips,
|
|
1127
|
+
activeId: activeTagExtId,
|
|
1128
|
+
onSelect,
|
|
1129
|
+
step: onStep && active && active.chunkIds.length > 0 ? { position: cursor + 1, total: active.chunkIds.length, onStep } : void 0
|
|
1130
|
+
}
|
|
1131
|
+
);
|
|
1132
|
+
}
|
|
1133
|
+
function ViewerTabBar({ tabs, activeId, onChange, className }) {
|
|
1134
|
+
return /* @__PURE__ */ jsx(TooltipProvider, { children: /* @__PURE__ */ jsx("div", { className: cn("flex shrink-0 items-center", className), role: "group", children: tabs.map((tab) => {
|
|
1135
|
+
const isActive = tab.id === activeId;
|
|
1136
|
+
return /* @__PURE__ */ jsxs(Tooltip, { children: [
|
|
1137
|
+
/* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(
|
|
1138
|
+
"button",
|
|
1139
|
+
{
|
|
1140
|
+
type: "button",
|
|
1141
|
+
onClick: () => onChange(tab.id),
|
|
1142
|
+
"aria-label": tab.tooltip,
|
|
1143
|
+
"aria-pressed": isActive,
|
|
1144
|
+
"data-testid": testIdOr(tab.testId, { testId: `${tab.id}-tab` }),
|
|
1145
|
+
className: cn(
|
|
1146
|
+
"shrink-0 border-b-2 px-3 py-2 font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring pointer-coarse:min-h-11",
|
|
1147
|
+
tab.label && "inline-flex items-center gap-1.5 text-sm",
|
|
1148
|
+
isActive ? "border-primary text-primary" : "border-transparent text-muted-foreground hover:border-border hover:text-foreground"
|
|
1149
|
+
),
|
|
1150
|
+
children: [
|
|
1151
|
+
tab.icon,
|
|
1152
|
+
tab.label && /* @__PURE__ */ jsx("span", { children: tab.label })
|
|
1153
|
+
]
|
|
1154
|
+
}
|
|
1155
|
+
) }),
|
|
1156
|
+
/* @__PURE__ */ jsx(TooltipContent, { side: "bottom", children: tab.tooltip })
|
|
1157
|
+
] }, tab.id);
|
|
1158
|
+
}) }) });
|
|
1159
|
+
}
|
|
1160
|
+
function ViewerPageCounter({ page, total, onGoTo, labels }) {
|
|
1161
|
+
const l = { ...DEFAULT_VIEWER_LABELS, ...labels };
|
|
1162
|
+
const [isEditing, setIsEditing] = useState(false);
|
|
1163
|
+
const [input, setInput] = useState("");
|
|
1164
|
+
const inputRef = useRef(null);
|
|
1165
|
+
if (total <= 0) return null;
|
|
1166
|
+
const commit = () => {
|
|
1167
|
+
const n = parseInt(input, 10);
|
|
1168
|
+
if (!isNaN(n) && n >= 1 && n <= total) onGoTo(n);
|
|
1169
|
+
setIsEditing(false);
|
|
1170
|
+
};
|
|
1171
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex shrink-0 items-center gap-1 rounded-md bg-muted px-2 py-1", children: [
|
|
1172
|
+
isEditing ? /* @__PURE__ */ jsx(
|
|
1173
|
+
"input",
|
|
1174
|
+
{
|
|
1175
|
+
ref: inputRef,
|
|
1176
|
+
autoFocus: true,
|
|
1177
|
+
type: "text",
|
|
1178
|
+
value: input,
|
|
1179
|
+
onFocus: (e) => e.currentTarget.select(),
|
|
1180
|
+
onChange: (e) => setInput(e.target.value),
|
|
1181
|
+
onKeyDown: (e) => {
|
|
1182
|
+
if (e.key === "Enter") commit();
|
|
1183
|
+
else if (e.key === "Escape") setIsEditing(false);
|
|
1184
|
+
},
|
|
1185
|
+
onBlur: commit,
|
|
1186
|
+
className: "w-8 rounded border border-border bg-background px-1 py-0.5 text-center text-sm font-medium focus:outline-none",
|
|
1187
|
+
"aria-label": l.pageInput
|
|
1188
|
+
}
|
|
1189
|
+
) : /* @__PURE__ */ jsx(
|
|
1190
|
+
"button",
|
|
1191
|
+
{
|
|
1192
|
+
type: "button",
|
|
1193
|
+
onClick: () => {
|
|
1194
|
+
setInput(String(page));
|
|
1195
|
+
setIsEditing(true);
|
|
1196
|
+
},
|
|
1197
|
+
className: "min-w-[2rem] cursor-text rounded border border-border bg-background px-1 py-0.5 text-sm font-medium transition-colors hover:bg-muted pointer-coarse:min-h-11 pointer-coarse:min-w-11",
|
|
1198
|
+
title: l.pageOfTitle,
|
|
1199
|
+
"aria-label": l.pageOf(page, total),
|
|
1200
|
+
children: page
|
|
1201
|
+
}
|
|
1202
|
+
),
|
|
1203
|
+
/* @__PURE__ */ jsxs("span", { className: "text-sm text-muted-foreground", children: [
|
|
1204
|
+
"/ ",
|
|
1205
|
+
total
|
|
1206
|
+
] })
|
|
1207
|
+
] });
|
|
1208
|
+
}
|
|
1209
|
+
function ViewerPreviewUnavailable({
|
|
1210
|
+
extension,
|
|
1211
|
+
onDownload,
|
|
1212
|
+
labels
|
|
1213
|
+
}) {
|
|
1214
|
+
const l = { ...DEFAULT_VIEWER_LABELS, ...labels };
|
|
1215
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex h-full flex-col items-center justify-center gap-4 p-8 text-center", children: [
|
|
1216
|
+
/* @__PURE__ */ jsx("div", { className: "text-4xl text-muted-foreground", "aria-hidden": true, children: "\u{1F4C4}" }),
|
|
1217
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
1218
|
+
/* @__PURE__ */ jsx("p", { className: "mb-1 font-medium", children: l.previewUnavailable }),
|
|
1219
|
+
/* @__PURE__ */ jsx("p", { className: "mb-4 text-sm text-muted-foreground", children: l.cannotPreview(extension) }),
|
|
1220
|
+
/* @__PURE__ */ jsxs(Button, { variant: "outline", size: "sm", onClick: onDownload, children: [
|
|
1221
|
+
/* @__PURE__ */ jsx(Download, { className: "mr-2 size-4" }),
|
|
1222
|
+
l.downloadToOpen
|
|
1223
|
+
] })
|
|
1224
|
+
] })
|
|
1225
|
+
] });
|
|
1226
|
+
}
|
|
1227
|
+
function ViewerLoadError({
|
|
1228
|
+
message,
|
|
1229
|
+
onDownload,
|
|
1230
|
+
labels,
|
|
1231
|
+
testId
|
|
1232
|
+
}) {
|
|
1233
|
+
const l = { ...DEFAULT_VIEWER_LABELS, ...labels };
|
|
1234
|
+
return /* @__PURE__ */ jsxs(
|
|
1235
|
+
"div",
|
|
1236
|
+
{
|
|
1237
|
+
className: "flex h-full flex-col items-center justify-center gap-3 p-8 text-center",
|
|
1238
|
+
"data-testid": testIdOr(testId, { testId: "pdf-load-error" }),
|
|
1239
|
+
children: [
|
|
1240
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: message }),
|
|
1241
|
+
/* @__PURE__ */ jsxs(Button, { variant: "outline", size: "sm", onClick: onDownload, children: [
|
|
1242
|
+
/* @__PURE__ */ jsx(Download, { className: "mr-2 size-4" }),
|
|
1243
|
+
l.download
|
|
1244
|
+
] })
|
|
1245
|
+
]
|
|
1246
|
+
}
|
|
1247
|
+
);
|
|
1248
|
+
}
|
|
1249
|
+
var DEFAULT_TAG_PASSAGE_PANEL_LABELS = {
|
|
1250
|
+
title: "Tag Passage",
|
|
1251
|
+
page: (n) => `Page ${n}`,
|
|
1252
|
+
close: "Close",
|
|
1253
|
+
empty: "No tags available. Create one to start tagging passages.",
|
|
1254
|
+
viewTagged: "View all passages with this tag",
|
|
1255
|
+
notePlaceholder: "Add a note for this tag...",
|
|
1256
|
+
cancel: "Cancel",
|
|
1257
|
+
save: "Save",
|
|
1258
|
+
addNote: "Add note...",
|
|
1259
|
+
createField: "+ Create new field"
|
|
1260
|
+
};
|
|
1261
|
+
function TagPassagePanel({
|
|
1262
|
+
pageNumber,
|
|
1263
|
+
preview,
|
|
1264
|
+
groups,
|
|
1265
|
+
isEmpty,
|
|
1266
|
+
isBusy,
|
|
1267
|
+
editingNoteTagId,
|
|
1268
|
+
noteValue,
|
|
1269
|
+
onNoteChange,
|
|
1270
|
+
onToggle,
|
|
1271
|
+
onViewTagged,
|
|
1272
|
+
onStartNote,
|
|
1273
|
+
onSaveNote,
|
|
1274
|
+
onCancelNote,
|
|
1275
|
+
onCreate,
|
|
1276
|
+
onClose,
|
|
1277
|
+
labels,
|
|
1278
|
+
testIds
|
|
1279
|
+
}) {
|
|
1280
|
+
const l = { ...DEFAULT_TAG_PASSAGE_PANEL_LABELS, ...labels };
|
|
1281
|
+
return /* @__PURE__ */ jsxs(
|
|
1282
|
+
"div",
|
|
1283
|
+
{
|
|
1284
|
+
className: "fixed right-0 top-0 z-50 flex h-full w-80 max-w-full flex-col border-l border-border bg-background shadow-lg",
|
|
1285
|
+
"data-slot": "tag-passage-panel",
|
|
1286
|
+
"data-testid": testIdOr(testIds?.root, { testId: "chunk-tag-panel" }),
|
|
1287
|
+
children: [
|
|
1288
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between border-b border-border p-4", children: [
|
|
1289
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
1290
|
+
/* @__PURE__ */ jsx("h3", { className: "text-sm font-semibold", children: l.title }),
|
|
1291
|
+
pageNumber && /* @__PURE__ */ jsx("span", { className: "text-sm text-muted-foreground", children: l.page(pageNumber) })
|
|
1292
|
+
] }),
|
|
1293
|
+
/* @__PURE__ */ jsx(
|
|
1294
|
+
Button,
|
|
1295
|
+
{
|
|
1296
|
+
variant: "ghost",
|
|
1297
|
+
size: "icon",
|
|
1298
|
+
onClick: onClose,
|
|
1299
|
+
"aria-label": l.close,
|
|
1300
|
+
className: "pointer-coarse:size-11",
|
|
1301
|
+
"data-testid": testIdOr(testIds?.close, { testId: "chunk-tag-panel-close" }),
|
|
1302
|
+
children: /* @__PURE__ */ jsx(X, { className: "size-4" })
|
|
1303
|
+
}
|
|
1304
|
+
)
|
|
1305
|
+
] }),
|
|
1306
|
+
/* @__PURE__ */ jsx("div", { className: "border-b border-border bg-muted p-4", children: /* @__PURE__ */ jsx("p", { className: "line-clamp-4 text-sm text-muted-foreground", children: preview }) }),
|
|
1307
|
+
/* @__PURE__ */ jsx("div", { className: "flex-1 overflow-y-auto", children: isEmpty ? /* @__PURE__ */ jsx("div", { className: "p-4 text-center text-sm text-muted-foreground", children: l.empty }) : /* @__PURE__ */ jsx("div", { className: "py-2", children: groups.map((group) => /* @__PURE__ */ jsxs("div", { className: "mb-2", children: [
|
|
1308
|
+
/* @__PURE__ */ jsx("div", { className: "bg-muted px-4 py-2 text-sm font-medium uppercase tracking-wider text-muted-foreground", children: group.title }),
|
|
1309
|
+
group.tags.map((tag) => {
|
|
1310
|
+
const hasNote = !!tag.note;
|
|
1311
|
+
const isEditing = editingNoteTagId === tag.id;
|
|
1312
|
+
return /* @__PURE__ */ jsxs(
|
|
1313
|
+
"div",
|
|
1314
|
+
{
|
|
1315
|
+
className: "border-b border-border last:border-b-0",
|
|
1316
|
+
"data-testid": prefixedTestId(testIds?.row, tag.id, {
|
|
1317
|
+
testId: `chunk-tag-row-${tag.id}`
|
|
1318
|
+
}),
|
|
1319
|
+
children: [
|
|
1320
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center transition-colors hover:bg-muted", children: [
|
|
1321
|
+
/* @__PURE__ */ jsxs(
|
|
1322
|
+
"button",
|
|
1323
|
+
{
|
|
1324
|
+
onClick: () => onToggle(tag.id),
|
|
1325
|
+
disabled: isBusy,
|
|
1326
|
+
className: "flex flex-1 items-center gap-3 px-4 py-3 disabled:opacity-50 pointer-coarse:min-h-11",
|
|
1327
|
+
children: [
|
|
1328
|
+
/* @__PURE__ */ jsx(
|
|
1329
|
+
"div",
|
|
1330
|
+
{
|
|
1331
|
+
className: "flex size-5 shrink-0 items-center justify-center rounded border-2",
|
|
1332
|
+
style: {
|
|
1333
|
+
borderColor: tag.color,
|
|
1334
|
+
backgroundColor: tag.isApplied ? tag.color : "transparent"
|
|
1335
|
+
},
|
|
1336
|
+
children: tag.isApplied && /* @__PURE__ */ jsx(Check, { className: "size-3 text-white", strokeWidth: 3 })
|
|
1337
|
+
}
|
|
1338
|
+
),
|
|
1339
|
+
/* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-1 items-center gap-2", children: [
|
|
1340
|
+
tag.badge,
|
|
1341
|
+
hasNote && !isEditing && /* @__PURE__ */ jsx(StickyNote, { className: "size-3.5 text-muted-foreground" })
|
|
1342
|
+
] }),
|
|
1343
|
+
isBusy && /* @__PURE__ */ jsx(Loader2, { className: "size-4 shrink-0 animate-spin" })
|
|
1344
|
+
]
|
|
1345
|
+
}
|
|
1346
|
+
),
|
|
1347
|
+
tag.isApplied && onViewTagged && /* @__PURE__ */ jsx(
|
|
1348
|
+
"button",
|
|
1349
|
+
{
|
|
1350
|
+
onClick: () => onViewTagged(tag.id),
|
|
1351
|
+
className: "mr-3 shrink-0 rounded p-1 hover:bg-muted pointer-coarse:min-h-11 pointer-coarse:min-w-11",
|
|
1352
|
+
title: l.viewTagged,
|
|
1353
|
+
"data-testid": testIdOr(testIds?.viewTagged, {
|
|
1354
|
+
testId: "view-tagged-chunks-button"
|
|
1355
|
+
}),
|
|
1356
|
+
children: /* @__PURE__ */ jsx(ChevronRight, { className: "size-4 text-muted-foreground" })
|
|
1357
|
+
}
|
|
1358
|
+
)
|
|
1359
|
+
] }),
|
|
1360
|
+
tag.isApplied && /* @__PURE__ */ jsx("div", { className: "px-4 pb-3", children: isEditing ? /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
1361
|
+
/* @__PURE__ */ jsx(
|
|
1362
|
+
Textarea,
|
|
1363
|
+
{
|
|
1364
|
+
value: noteValue,
|
|
1365
|
+
onChange: (e) => onNoteChange(e.target.value),
|
|
1366
|
+
placeholder: l.notePlaceholder,
|
|
1367
|
+
className: "min-h-[60px] text-sm",
|
|
1368
|
+
autoFocus: true
|
|
1369
|
+
}
|
|
1370
|
+
),
|
|
1371
|
+
/* @__PURE__ */ jsxs("div", { className: "flex justify-end gap-2", children: [
|
|
1372
|
+
/* @__PURE__ */ jsx(Button, { variant: "ghost", size: "sm", onClick: onCancelNote, children: l.cancel }),
|
|
1373
|
+
/* @__PURE__ */ jsx(
|
|
1374
|
+
Button,
|
|
1375
|
+
{
|
|
1376
|
+
size: "sm",
|
|
1377
|
+
onClick: () => onSaveNote(tag.id),
|
|
1378
|
+
disabled: isBusy,
|
|
1379
|
+
children: l.save
|
|
1380
|
+
}
|
|
1381
|
+
)
|
|
1382
|
+
] })
|
|
1383
|
+
] }) : /* @__PURE__ */ jsx(
|
|
1384
|
+
"button",
|
|
1385
|
+
{
|
|
1386
|
+
onClick: () => onStartNote(tag.id),
|
|
1387
|
+
className: cn(
|
|
1388
|
+
"w-full rounded-md bg-muted px-2 py-1.5 text-left text-sm pointer-coarse:min-h-11",
|
|
1389
|
+
hasNote ? "text-foreground" : "text-muted-foreground"
|
|
1390
|
+
),
|
|
1391
|
+
children: tag.note || l.addNote
|
|
1392
|
+
}
|
|
1393
|
+
) })
|
|
1394
|
+
]
|
|
1395
|
+
},
|
|
1396
|
+
tag.id
|
|
1397
|
+
);
|
|
1398
|
+
})
|
|
1399
|
+
] }, group.id)) }) }),
|
|
1400
|
+
onCreate && /* @__PURE__ */ jsx("div", { className: "border-t border-border p-4", children: /* @__PURE__ */ jsx(Button, { variant: "outline", size: "sm", className: "w-full", onClick: onCreate, children: l.createField }) })
|
|
1401
|
+
]
|
|
1402
|
+
}
|
|
1403
|
+
);
|
|
1404
|
+
}
|
|
1405
|
+
function FilesPageTitle({
|
|
1406
|
+
label = "Files",
|
|
1407
|
+
count,
|
|
1408
|
+
isFiltered,
|
|
1409
|
+
isProcessing,
|
|
1410
|
+
onClick,
|
|
1411
|
+
filteredLabel = "filtered",
|
|
1412
|
+
className,
|
|
1413
|
+
testId,
|
|
1414
|
+
countTestId
|
|
1415
|
+
}) {
|
|
1416
|
+
const body = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1417
|
+
/* @__PURE__ */ jsx("span", { children: label }),
|
|
1418
|
+
/* @__PURE__ */ jsx(
|
|
1419
|
+
"span",
|
|
1420
|
+
{
|
|
1421
|
+
"data-testid": testIdOr(countTestId, { testId: "tab-count" }),
|
|
1422
|
+
className: "inline-flex h-6 min-w-6 items-center justify-center rounded-full bg-muted px-2 text-xs font-medium tabular-nums text-muted-foreground",
|
|
1423
|
+
children: count
|
|
1424
|
+
}
|
|
1425
|
+
),
|
|
1426
|
+
isFiltered && /* @__PURE__ */ jsx("span", { className: "text-xs font-normal text-muted-foreground", children: filteredLabel }),
|
|
1427
|
+
isProcessing && /* @__PURE__ */ jsx(Loader2, { className: "size-3.5 animate-spin text-muted-foreground", "aria-hidden": true })
|
|
1428
|
+
] });
|
|
1429
|
+
const classes = cn(
|
|
1430
|
+
"inline-flex min-w-0 items-center gap-2 text-xl font-semibold leading-8 text-foreground",
|
|
1431
|
+
className
|
|
1432
|
+
);
|
|
1433
|
+
return /* @__PURE__ */ jsx("h1", { "data-slot": "files-page-title", className: "m-0 min-w-0 font-semibold", children: onClick ? /* @__PURE__ */ jsx(
|
|
1434
|
+
"button",
|
|
1435
|
+
{
|
|
1436
|
+
type: "button",
|
|
1437
|
+
onClick,
|
|
1438
|
+
"data-testid": testIdOr(testId, { testId: "documents-tab" }),
|
|
1439
|
+
className: cn(
|
|
1440
|
+
classes,
|
|
1441
|
+
"rounded-md pointer-coarse:-mx-2 pointer-coarse:min-h-11 pointer-coarse:px-2 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"
|
|
1442
|
+
),
|
|
1443
|
+
children: body
|
|
1444
|
+
}
|
|
1445
|
+
) : /* @__PURE__ */ jsx("span", { "data-testid": testIdOr(testId, { testId: "documents-tab" }), className: classes, children: body }) });
|
|
1446
|
+
}
|
|
1447
|
+
var DEFAULT_IMPORT_LABELS = {
|
|
1448
|
+
stop: "Stop",
|
|
1449
|
+
stopping: "Stopping\u2026",
|
|
1450
|
+
importNow: "Import now",
|
|
1451
|
+
settings: "Settings",
|
|
1452
|
+
importingOf: (processed, total, noun) => `Importing ${processed} of ${total} ${noun}\u2026`,
|
|
1453
|
+
importing: (processed, noun) => `Importing ${processed} ${noun}\u2026`,
|
|
1454
|
+
foldersSelected: (count) => `Folders: ${count} selected`,
|
|
1455
|
+
folders: (names) => `Folders: ${names}`,
|
|
1456
|
+
moreFolders: (count) => ` +${count} more`,
|
|
1457
|
+
connect: "Connect",
|
|
1458
|
+
reconnect: "Reconnect",
|
|
1459
|
+
reconnecting: "Reconnecting\u2026",
|
|
1460
|
+
disconnect: "Disconnect",
|
|
1461
|
+
disconnecting: "Disconnecting\u2026",
|
|
1462
|
+
reconnectHint: (reconnectLabel) => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1463
|
+
"Couldn\u2019t reach this account. Click ",
|
|
1464
|
+
reconnectLabel,
|
|
1465
|
+
" \u2014 if it keeps happening, log out and back in to refresh the connection."
|
|
1466
|
+
] })
|
|
1467
|
+
};
|
|
1468
|
+
function ImportList({ className, ...props }) {
|
|
1469
|
+
return /* @__PURE__ */ jsx("div", { "data-slot": "import-list", className: cn("divide-y divide-border", className), ...props });
|
|
1470
|
+
}
|
|
1471
|
+
function ImportRow({ logo, name, actions, children, testId, className }) {
|
|
1472
|
+
return /* @__PURE__ */ jsxs("div", { "data-slot": "import-row", "data-testid": testId, className: cn("py-3", className), children: [
|
|
1473
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2.5", children: [
|
|
1474
|
+
logo,
|
|
1475
|
+
/* @__PURE__ */ jsx("div", { className: "min-w-0 flex-1 truncate text-sm font-medium text-foreground", children: name }),
|
|
1476
|
+
actions
|
|
1477
|
+
] }),
|
|
1478
|
+
children
|
|
1479
|
+
] });
|
|
1480
|
+
}
|
|
1481
|
+
function ImportHint({ className, ...props }) {
|
|
1482
|
+
return /* @__PURE__ */ jsx(
|
|
1483
|
+
"p",
|
|
1484
|
+
{
|
|
1485
|
+
"data-slot": "import-hint",
|
|
1486
|
+
className: cn("ml-[34px] mt-1 text-xs text-muted-foreground", className),
|
|
1487
|
+
...props
|
|
1488
|
+
}
|
|
1489
|
+
);
|
|
1490
|
+
}
|
|
1491
|
+
function ImportActionButton({
|
|
1492
|
+
className,
|
|
1493
|
+
children,
|
|
1494
|
+
variant = "outline",
|
|
1495
|
+
...props
|
|
1496
|
+
}) {
|
|
1497
|
+
return /* @__PURE__ */ jsxs(
|
|
1498
|
+
Button,
|
|
1499
|
+
{
|
|
1500
|
+
variant,
|
|
1501
|
+
size: "sm",
|
|
1502
|
+
className: cn("ml-auto h-7 shrink-0 gap-1.5 pointer-coarse:h-11", className),
|
|
1503
|
+
"data-slot": "import-action",
|
|
1504
|
+
...props,
|
|
1505
|
+
children: [
|
|
1506
|
+
/* @__PURE__ */ jsx(ExternalLink, { className: "h-3.5 w-3.5" }),
|
|
1507
|
+
children
|
|
1508
|
+
]
|
|
1509
|
+
}
|
|
1510
|
+
);
|
|
1511
|
+
}
|
|
1512
|
+
function ImportRunActions({
|
|
1513
|
+
isRunning,
|
|
1514
|
+
isStopping,
|
|
1515
|
+
isBusy,
|
|
1516
|
+
importDisabled,
|
|
1517
|
+
importTitle,
|
|
1518
|
+
onImport,
|
|
1519
|
+
onStop,
|
|
1520
|
+
onSettings,
|
|
1521
|
+
settingsLabel,
|
|
1522
|
+
importButton,
|
|
1523
|
+
settingsButton,
|
|
1524
|
+
stopButton,
|
|
1525
|
+
labels
|
|
1526
|
+
}) {
|
|
1527
|
+
const l = { ...DEFAULT_IMPORT_LABELS, ...labels };
|
|
1528
|
+
if (isRunning) {
|
|
1529
|
+
return /* @__PURE__ */ jsxs(
|
|
1530
|
+
Button,
|
|
1531
|
+
{
|
|
1532
|
+
variant: "outline",
|
|
1533
|
+
size: "sm",
|
|
1534
|
+
className: "ml-auto h-7 gap-1.5 pointer-coarse:h-11",
|
|
1535
|
+
onClick: onStop,
|
|
1536
|
+
disabled: isStopping,
|
|
1537
|
+
"data-testid": stopButton?.testId,
|
|
1538
|
+
children: [
|
|
1539
|
+
/* @__PURE__ */ jsx(Square, { className: "h-3 w-3" }),
|
|
1540
|
+
isStopping ? l.stopping : l.stop
|
|
1541
|
+
]
|
|
1542
|
+
}
|
|
1543
|
+
);
|
|
1544
|
+
}
|
|
1545
|
+
return /* @__PURE__ */ jsxs("div", { className: "ml-auto flex shrink-0 items-center gap-1.5", children: [
|
|
1546
|
+
/* @__PURE__ */ jsxs(
|
|
1547
|
+
Button,
|
|
1548
|
+
{
|
|
1549
|
+
variant: "default",
|
|
1550
|
+
size: "sm",
|
|
1551
|
+
className: "h-7 gap-1.5 pointer-coarse:h-11",
|
|
1552
|
+
onClick: onImport,
|
|
1553
|
+
disabled: isBusy || importDisabled,
|
|
1554
|
+
"data-testid": importButton?.testId,
|
|
1555
|
+
title: importTitle,
|
|
1556
|
+
children: [
|
|
1557
|
+
isBusy ? /* @__PURE__ */ jsx(Loader2, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ jsx(RefreshCw, { className: "h-3.5 w-3.5" }),
|
|
1558
|
+
l.importNow
|
|
1559
|
+
]
|
|
1560
|
+
}
|
|
1561
|
+
),
|
|
1562
|
+
/* @__PURE__ */ jsxs(
|
|
1563
|
+
Button,
|
|
1564
|
+
{
|
|
1565
|
+
variant: "outline",
|
|
1566
|
+
size: "sm",
|
|
1567
|
+
className: "h-7 gap-1.5 px-2 text-muted-foreground pointer-coarse:h-11",
|
|
1568
|
+
onClick: onSettings,
|
|
1569
|
+
disabled: isBusy,
|
|
1570
|
+
"aria-label": settingsLabel,
|
|
1571
|
+
"data-testid": settingsButton?.testId,
|
|
1572
|
+
children: [
|
|
1573
|
+
/* @__PURE__ */ jsx(Settings, { className: "h-4 w-4" }),
|
|
1574
|
+
l.settings
|
|
1575
|
+
]
|
|
1576
|
+
}
|
|
1577
|
+
)
|
|
1578
|
+
] });
|
|
1579
|
+
}
|
|
1580
|
+
function ImportSummary({ children, aside, className }) {
|
|
1581
|
+
return /* @__PURE__ */ jsxs(
|
|
1582
|
+
"div",
|
|
1583
|
+
{
|
|
1584
|
+
"data-slot": "import-summary",
|
|
1585
|
+
className: cn("mt-2.5 flex items-start justify-between gap-3", className),
|
|
1586
|
+
children: [
|
|
1587
|
+
/* @__PURE__ */ jsx("div", { className: "ml-[34px] text-sm leading-snug text-muted-foreground", children }),
|
|
1588
|
+
aside
|
|
1589
|
+
]
|
|
1590
|
+
}
|
|
1591
|
+
);
|
|
1592
|
+
}
|
|
1593
|
+
function ImportAside({ className, ...props }) {
|
|
1594
|
+
return /* @__PURE__ */ jsx(
|
|
1595
|
+
"div",
|
|
1596
|
+
{
|
|
1597
|
+
"data-slot": "import-aside",
|
|
1598
|
+
className: cn(
|
|
1599
|
+
"min-w-0 max-w-[55%] text-right text-sm leading-snug text-muted-foreground",
|
|
1600
|
+
className
|
|
1601
|
+
),
|
|
1602
|
+
...props
|
|
1603
|
+
}
|
|
1604
|
+
);
|
|
1605
|
+
}
|
|
1606
|
+
function ImportProgress({ processed, total, noun, testId, labels }) {
|
|
1607
|
+
const l = { ...DEFAULT_IMPORT_LABELS, ...labels };
|
|
1608
|
+
const known = total != null && total > 0;
|
|
1609
|
+
return /* @__PURE__ */ jsxs("div", { "data-slot": "import-progress", className: "mt-2 space-y-1", "data-testid": testId, children: [
|
|
1610
|
+
known && /* @__PURE__ */ jsx(Progress, { value: Math.min(100, Math.round(processed / total * 100)), className: "h-1.5" }),
|
|
1611
|
+
/* @__PURE__ */ jsx("div", { className: "text-right text-sm leading-snug text-muted-foreground", children: known ? l.importingOf(processed, total, noun) : l.importing(processed, noun) })
|
|
1612
|
+
] });
|
|
1613
|
+
}
|
|
1614
|
+
var FOLDER_SUMMARY_LIMIT = 3;
|
|
1615
|
+
function FolderSummary({ names, testId, labels }) {
|
|
1616
|
+
const l = { ...DEFAULT_IMPORT_LABELS, ...labels };
|
|
1617
|
+
const known = names.filter((n) => !!n);
|
|
1618
|
+
if (known.length === 0) {
|
|
1619
|
+
return /* @__PURE__ */ jsx("div", { "data-testid": testId, children: l.foldersSelected(names.length) });
|
|
1620
|
+
}
|
|
1621
|
+
const shown = known.slice(0, FOLDER_SUMMARY_LIMIT);
|
|
1622
|
+
const hidden = names.length - shown.length;
|
|
1623
|
+
return /* @__PURE__ */ jsxs("div", { className: "break-words", title: known.join(", "), "data-testid": testId, children: [
|
|
1624
|
+
l.folders(shown.join(", ")),
|
|
1625
|
+
hidden > 0 && /* @__PURE__ */ jsx("span", { className: "whitespace-nowrap", children: l.moreFolders(hidden) })
|
|
1626
|
+
] });
|
|
1627
|
+
}
|
|
1628
|
+
function ImportFamilySection({
|
|
1629
|
+
label,
|
|
1630
|
+
identity,
|
|
1631
|
+
action,
|
|
1632
|
+
isActionPending,
|
|
1633
|
+
onAction,
|
|
1634
|
+
testId,
|
|
1635
|
+
actionButton,
|
|
1636
|
+
children,
|
|
1637
|
+
labels
|
|
1638
|
+
}) {
|
|
1639
|
+
const l = { ...DEFAULT_IMPORT_LABELS, ...labels };
|
|
1640
|
+
const [idle, pending] = {
|
|
1641
|
+
connect: [l.connect, l.connect],
|
|
1642
|
+
reconnect: [l.reconnect, l.reconnecting],
|
|
1643
|
+
disconnect: [l.disconnect, l.disconnecting]
|
|
1644
|
+
}[action];
|
|
1645
|
+
const Icon = action === "disconnect" ? Unplug : ExternalLink;
|
|
1646
|
+
const isPending = action !== "connect" && !!isActionPending;
|
|
1647
|
+
return /* @__PURE__ */ jsxs("section", { "data-slot": "import-family", "data-testid": testId, children: [
|
|
1648
|
+
/* @__PURE__ */ jsxs("div", { className: "mb-1 flex items-center gap-2", children: [
|
|
1649
|
+
/* @__PURE__ */ jsxs("h3", { className: "min-w-0 truncate text-sm font-semibold uppercase tracking-wide text-muted-foreground", children: [
|
|
1650
|
+
label,
|
|
1651
|
+
identity && /* @__PURE__ */ jsxs("span", { className: "ml-1.5 text-sm font-normal normal-case tracking-normal", children: [
|
|
1652
|
+
"(",
|
|
1653
|
+
identity,
|
|
1654
|
+
")"
|
|
1655
|
+
] })
|
|
1656
|
+
] }),
|
|
1657
|
+
/* @__PURE__ */ jsxs(
|
|
1658
|
+
Button,
|
|
1659
|
+
{
|
|
1660
|
+
variant: action === "disconnect" ? "ghost" : "outline",
|
|
1661
|
+
size: "sm",
|
|
1662
|
+
className: cn(
|
|
1663
|
+
"h-6 shrink-0 gap-1 px-2 text-xs pointer-coarse:h-11",
|
|
1664
|
+
action === "disconnect" && "text-muted-foreground [&:hover]:text-destructive"
|
|
1665
|
+
),
|
|
1666
|
+
onClick: onAction,
|
|
1667
|
+
disabled: isPending,
|
|
1668
|
+
"data-testid": actionButton?.testId,
|
|
1669
|
+
children: [
|
|
1670
|
+
/* @__PURE__ */ jsx(Icon, { className: "h-3 w-3" }),
|
|
1671
|
+
isPending ? pending : idle
|
|
1672
|
+
]
|
|
1673
|
+
}
|
|
1674
|
+
)
|
|
1675
|
+
] }),
|
|
1676
|
+
action === "reconnect" && /* @__PURE__ */ jsx("p", { className: "mb-1 text-xs text-muted-foreground", children: l.reconnectHint(/* @__PURE__ */ jsx("span", { className: "font-medium", children: l.reconnect })) }),
|
|
1677
|
+
children
|
|
1678
|
+
] });
|
|
1679
|
+
}
|
|
1680
|
+
function ImportPanel({ className, ...props }) {
|
|
1681
|
+
return /* @__PURE__ */ jsx("div", { "data-slot": "import-panel", className: cn("space-y-5", className), ...props });
|
|
1682
|
+
}
|
|
1683
|
+
var STATUS_ICONS = {
|
|
1684
|
+
active: { Icon: LoaderCircle, color: "text-blue-text", spin: true },
|
|
1685
|
+
queued: { Icon: Hourglass, color: "text-yellow-text", spin: false },
|
|
1686
|
+
failed: { Icon: AlertCircle, color: "text-red-text", spin: false },
|
|
1687
|
+
skipped: { Icon: CircleSlash, color: "text-muted-foreground", spin: false },
|
|
1688
|
+
completed: { Icon: CheckCircle, color: "text-green-text", spin: false }
|
|
1689
|
+
};
|
|
1690
|
+
function TaskSection({
|
|
1691
|
+
title,
|
|
1692
|
+
count,
|
|
1693
|
+
status,
|
|
1694
|
+
tooltip,
|
|
1695
|
+
headerAction,
|
|
1696
|
+
defaultExpanded = true,
|
|
1697
|
+
children,
|
|
1698
|
+
testIds
|
|
1699
|
+
}) {
|
|
1700
|
+
const [isExpanded, setIsExpanded] = useState(defaultExpanded);
|
|
1701
|
+
const hasItems = count > 0;
|
|
1702
|
+
const { Icon, color, spin } = STATUS_ICONS[status];
|
|
1703
|
+
const headingInner = /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
1704
|
+
/* @__PURE__ */ jsx(Icon, { className: cn("h-4 w-4", color, hasItems ? spin && "animate-spin" : "opacity-50") }),
|
|
1705
|
+
/* @__PURE__ */ jsx("span", { className: "whitespace-nowrap", children: title }),
|
|
1706
|
+
/* @__PURE__ */ jsx(Badge, { variant: "outline", className: "badge-count ml-2 border-border", children: count })
|
|
1707
|
+
] });
|
|
1708
|
+
const heading = tooltip ? /* @__PURE__ */ jsxs(Tooltip, { children: [
|
|
1709
|
+
/* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: headingInner }),
|
|
1710
|
+
/* @__PURE__ */ jsx(TooltipContent, { className: "max-w-xs", children: tooltip })
|
|
1711
|
+
] }) : headingInner;
|
|
1712
|
+
return /* @__PURE__ */ jsxs("div", { "data-slot": "task-section", "data-testid": testIdOr(testIds?.root, { testId: "task-section" }), children: [
|
|
1713
|
+
/* @__PURE__ */ jsxs("div", { className: "mb-3 flex items-center justify-between", children: [
|
|
1714
|
+
hasItems ? /* @__PURE__ */ jsxs(
|
|
1715
|
+
"button",
|
|
1716
|
+
{
|
|
1717
|
+
onClick: () => setIsExpanded(!isExpanded),
|
|
1718
|
+
"aria-expanded": isExpanded,
|
|
1719
|
+
className: "flex cursor-pointer items-center gap-2 text-left font-medium transition-colors hover:text-primary pointer-coarse:min-h-11",
|
|
1720
|
+
"data-testid": testIdOr(testIds?.toggle, { testId: "task-section-toggle" }),
|
|
1721
|
+
children: [
|
|
1722
|
+
/* @__PURE__ */ jsx(
|
|
1723
|
+
ChevronRight,
|
|
1724
|
+
{
|
|
1725
|
+
className: cn("h-4 w-4 transition-transform", isExpanded && "rotate-90")
|
|
1726
|
+
}
|
|
1727
|
+
),
|
|
1728
|
+
heading
|
|
1729
|
+
]
|
|
1730
|
+
}
|
|
1731
|
+
) : /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 font-medium text-muted-foreground", children: [
|
|
1732
|
+
/* @__PURE__ */ jsx(ChevronRight, { className: "h-4 w-4 flex-shrink-0" }),
|
|
1733
|
+
heading
|
|
1734
|
+
] }),
|
|
1735
|
+
headerAction
|
|
1736
|
+
] }),
|
|
1737
|
+
hasItems && isExpanded && children
|
|
1738
|
+
] });
|
|
1739
|
+
}
|
|
1740
|
+
function BulkLabelSelectView({
|
|
1741
|
+
options,
|
|
1742
|
+
appliedIds,
|
|
1743
|
+
mixedIds,
|
|
1744
|
+
onToggle,
|
|
1745
|
+
onCreate,
|
|
1746
|
+
disabled,
|
|
1747
|
+
isCompact
|
|
1748
|
+
}) {
|
|
1749
|
+
return /* @__PURE__ */ jsxs(Popover, { children: [
|
|
1750
|
+
/* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(
|
|
1751
|
+
Button,
|
|
1752
|
+
{
|
|
1753
|
+
variant: "outline",
|
|
1754
|
+
size: "sm",
|
|
1755
|
+
disabled,
|
|
1756
|
+
className: "h-7 gap-1.5 px-2 text-yellow-text hover:text-yellow-text hover:bg-yellow-bg border-yellow-border",
|
|
1757
|
+
"data-testid": "bulk-label-button",
|
|
1758
|
+
"aria-label": "Labels",
|
|
1759
|
+
children: [
|
|
1760
|
+
/* @__PURE__ */ jsx(SquareCheckBig, { className: "size-4" }),
|
|
1761
|
+
!isCompact && /* @__PURE__ */ jsx("span", { children: "Labels" })
|
|
1762
|
+
]
|
|
1763
|
+
}
|
|
1764
|
+
) }),
|
|
1765
|
+
/* @__PURE__ */ jsx(PopoverContent, { className: "w-[220px] p-0", align: "start", side: "top", sideOffset: 4, children: /* @__PURE__ */ jsx(
|
|
1766
|
+
LabelPickerList,
|
|
1767
|
+
{
|
|
1768
|
+
options,
|
|
1769
|
+
appliedIds,
|
|
1770
|
+
mixedIds,
|
|
1771
|
+
onToggle,
|
|
1772
|
+
onCreate
|
|
1773
|
+
}
|
|
1774
|
+
) })
|
|
1775
|
+
] });
|
|
1776
|
+
}
|
|
1777
|
+
var STATUS = {
|
|
1778
|
+
completed: { Icon: CheckCircle, title: "Ready", tone: "text-green-text" },
|
|
1779
|
+
empty: { Icon: FileX, title: "Empty", tone: "text-yellow-text" },
|
|
1780
|
+
"low-content": { Icon: AlertTriangle, title: "Low Content", tone: "text-yellow-text" },
|
|
1781
|
+
processing: { Icon: Loader2, title: "Indexing", tone: "text-muted-foreground", spin: true },
|
|
1782
|
+
queued: { Icon: Hourglass, title: "Queued", tone: "text-yellow-text" }
|
|
1783
|
+
};
|
|
1784
|
+
function DocStatusIcon({
|
|
1785
|
+
status,
|
|
1786
|
+
onClick,
|
|
1787
|
+
failedStage,
|
|
1788
|
+
errorMessage,
|
|
1789
|
+
className
|
|
1790
|
+
}) {
|
|
1791
|
+
if (!status) return null;
|
|
1792
|
+
const key = status.toLowerCase();
|
|
1793
|
+
if (key === "failed") {
|
|
1794
|
+
return /* @__PURE__ */ jsx(
|
|
1795
|
+
FailedStageIcon,
|
|
1796
|
+
{
|
|
1797
|
+
stage: failedStage,
|
|
1798
|
+
errorMessage,
|
|
1799
|
+
className: cn("size-3 text-red-text", onClick && "cursor-pointer", className),
|
|
1800
|
+
onClick: onClick ? (e) => {
|
|
1801
|
+
e.stopPropagation();
|
|
1802
|
+
onClick();
|
|
1803
|
+
} : void 0
|
|
1804
|
+
}
|
|
1805
|
+
);
|
|
1806
|
+
}
|
|
1807
|
+
const entry = STATUS[key];
|
|
1808
|
+
if (!entry) return null;
|
|
1809
|
+
const { Icon } = entry;
|
|
1810
|
+
const glyph = /* @__PURE__ */ jsx(Icon, { className: cn("size-3", entry.tone, entry.spin && "animate-spin", className) });
|
|
1811
|
+
if (!onClick) {
|
|
1812
|
+
return /* @__PURE__ */ jsx("span", { title: entry.title, "data-slot": "doc-status-icon", "data-status": key, children: glyph });
|
|
1813
|
+
}
|
|
1814
|
+
return /* @__PURE__ */ jsx(
|
|
1815
|
+
"button",
|
|
1816
|
+
{
|
|
1817
|
+
type: "button",
|
|
1818
|
+
title: entry.title,
|
|
1819
|
+
"aria-label": entry.title,
|
|
1820
|
+
"data-slot": "doc-status-icon",
|
|
1821
|
+
"data-status": key,
|
|
1822
|
+
onClick: (e) => {
|
|
1823
|
+
e.stopPropagation();
|
|
1824
|
+
onClick();
|
|
1825
|
+
},
|
|
1826
|
+
className: "cursor-pointer rounded hover:opacity-80 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
1827
|
+
children: glyph
|
|
1828
|
+
}
|
|
1829
|
+
);
|
|
1830
|
+
}
|
|
1831
|
+
|
|
1832
|
+
export { BulkLabelSelectView, CitedRunNav, DEFAULT_EXPORT_LABELS, DEFAULT_HTML_VIEWER_LABELS, DEFAULT_IMPORT_LABELS, DEFAULT_TAG_PASSAGE_PANEL_LABELS, DEFAULT_TRANSFER_LABELS, DEFAULT_VIEWER_LABELS, DocStatusIcon, DocTagBar, DocumentLabelBar, ExportFooter, ExportMethodChooser, ExportModalTitle, ExportResultsReport, ExportWorkspacePicker, FilesPageTitle, FolderSummary, HtmlPage, HtmlPassage, HtmlViewerEmpty, HtmlViewerRoot, HtmlViewerSurface, ImportActionButton, ImportAside, ImportFamilySection, ImportHint, ImportList, ImportPanel, ImportProgress, ImportRow, ImportRunActions, ImportSummary, PassageStepper, PdfPageNav, TagPassagePanel, TaskSection, TransferConflictChooser, TransferKindsPicker, TransferPlanSummary, TransferProgressView, TransferReferencesChooser, TransferResumeBanner, TransferScopeChooser, ViewerControlBar, ViewerFrame, ViewerImageActions, ViewerLoadError, ViewerMessage, ViewerPageCounter, ViewerPreviewUnavailable, ViewerTabBar, ViewerTitle, ViewerZoomControl, isDocumentLabel, summariseDocTags };
|
|
1833
|
+
//# sourceMappingURL=chunk-J7YHBMBB.js.map
|
|
1834
|
+
//# sourceMappingURL=chunk-J7YHBMBB.js.map
|