@arbidocs/blocks 0.5.146 → 0.5.148
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/dist/{ConnectedCallDock-JVLJEWLJ.cjs → ConnectedCallDock-6VGATAAQ.cjs} +5 -5
- package/dist/{ConnectedCallDock-JVLJEWLJ.cjs.map → ConnectedCallDock-6VGATAAQ.cjs.map} +1 -1
- package/dist/{ConnectedCallRoom-7YQRDIS3.cjs → ConnectedCallRoom-YBNERVTW.cjs} +5 -5
- package/dist/{ConnectedCallRoom-7YQRDIS3.cjs.map → ConnectedCallRoom-YBNERVTW.cjs.map} +1 -1
- package/dist/{ConnectedPresentation-JJXQBIV2.cjs → ConnectedPresentation-JZQFTC5H.cjs} +4 -4
- package/dist/{ConnectedPresentation-JJXQBIV2.cjs.map → ConnectedPresentation-JZQFTC5H.cjs.map} +1 -1
- package/dist/{DocumentReviewCard-ENCPTGJE.cjs → DocumentReviewCard-UDC4PNIS.cjs} +15 -14
- package/dist/DocumentReviewCard-UDC4PNIS.cjs.map +1 -0
- package/dist/{FilesViewerDialog-FFPW7TIK.cjs → FilesViewerDialog-D5GHWK4Y.cjs} +12 -11
- package/dist/FilesViewerDialog-D5GHWK4Y.cjs.map +1 -0
- package/dist/{WorkspaceTableView-2RH33X3U.cjs → WorkspaceTableView-2NRV4CWP.cjs} +7 -6
- package/dist/WorkspaceTableView-2NRV4CWP.cjs.map +1 -0
- package/dist/agents/index.cjs +176 -175
- package/dist/agents/tasks/TaskRowMenu.d.ts +1 -2
- package/dist/agents/tasks/TaskRowMenu.js +0 -2
- package/dist/agents/tasks/TaskRowMenu.js.map +2 -2
- package/dist/agents/tasks/TaskTable.d.ts +5 -2
- package/dist/agents/tasks/TaskTable.js +11 -8
- package/dist/agents/tasks/TaskTable.js.map +2 -2
- package/dist/agents/tasks/taskTableLabels.js +1 -1
- package/dist/agents/tasks/taskTableLabels.js.map +1 -1
- package/dist/{ai-YX3OAC4F.cjs → ai-VLIPYNWP.cjs} +13 -13
- package/dist/ai-VLIPYNWP.cjs.map +1 -0
- package/dist/calls/index.cjs +2 -2
- package/dist/chat/ChatThreads.js +1 -1
- package/dist/chat/ChatThreads.js.map +2 -2
- package/dist/chat/chat-page-types.d.ts +2 -0
- package/dist/chat/chat-page-types.js.map +2 -2
- package/dist/chat/index.cjs +25 -25
- package/dist/{chunk-32HVYK4Q.cjs → chunk-3VPNL4EH.cjs} +14 -13
- package/dist/chunk-3VPNL4EH.cjs.map +1 -0
- package/dist/{chunk-6TU4YLFW.cjs → chunk-5TT6J67U.cjs} +3 -3
- package/dist/chunk-5TT6J67U.cjs.map +1 -0
- package/dist/{chunk-N7AUJTU4.cjs → chunk-7AULM6LS.cjs} +5 -5
- package/dist/{chunk-N7AUJTU4.cjs.map → chunk-7AULM6LS.cjs.map} +1 -1
- package/dist/{chunk-MBXXWTKT.cjs → chunk-AYWY4MX2.cjs} +28 -28
- package/dist/{chunk-MBXXWTKT.cjs.map → chunk-AYWY4MX2.cjs.map} +1 -1
- package/dist/{chunk-P2AZ2HX7.cjs → chunk-AZQ4XIVY.cjs} +26 -26
- package/dist/{chunk-P2AZ2HX7.cjs.map → chunk-AZQ4XIVY.cjs.map} +1 -1
- package/dist/{chunk-VZKTOGZR.cjs → chunk-BLRPBEUG.cjs} +2 -2
- package/dist/{chunk-VZKTOGZR.cjs.map → chunk-BLRPBEUG.cjs.map} +1 -1
- package/dist/chunk-DKY67DA6.cjs +43 -0
- package/dist/chunk-DKY67DA6.cjs.map +1 -0
- package/dist/{chunk-N3H3YAKY.cjs → chunk-DUNXLT63.cjs} +17 -12
- package/dist/chunk-DUNXLT63.cjs.map +1 -0
- package/dist/{chunk-UOI6JJPG.cjs → chunk-EF2QQBDV.cjs} +29 -134
- package/dist/chunk-EF2QQBDV.cjs.map +1 -0
- package/dist/{chunk-3Y75LUCT.cjs → chunk-FHKBR55Q.cjs} +3 -3
- package/dist/{chunk-3Y75LUCT.cjs.map → chunk-FHKBR55Q.cjs.map} +1 -1
- package/dist/{chunk-QW6NCUR7.cjs → chunk-GAA222SK.cjs} +5 -5
- package/dist/{chunk-QW6NCUR7.cjs.map → chunk-GAA222SK.cjs.map} +1 -1
- package/dist/{chunk-LVIQWRC5.cjs → chunk-KRQCUVH7.cjs} +2 -2
- package/dist/chunk-KRQCUVH7.cjs.map +1 -0
- package/dist/{chunk-6RJXO2NF.cjs → chunk-KWV4VC74.cjs} +6 -6
- package/dist/{chunk-6RJXO2NF.cjs.map → chunk-KWV4VC74.cjs.map} +1 -1
- package/dist/{chunk-UD56Y6UA.cjs → chunk-L5Q5PDTA.cjs} +4 -4
- package/dist/{chunk-UD56Y6UA.cjs.map → chunk-L5Q5PDTA.cjs.map} +1 -1
- package/dist/{chunk-XAW22O2S.cjs → chunk-LCIMYEGX.cjs} +4 -4
- package/dist/{chunk-XAW22O2S.cjs.map → chunk-LCIMYEGX.cjs.map} +1 -1
- package/dist/{chunk-BCRB42SP.cjs → chunk-LYYJDQW6.cjs} +110 -970
- package/dist/chunk-LYYJDQW6.cjs.map +1 -0
- package/dist/{chunk-OE36OY64.cjs → chunk-LZQ2XZOC.cjs} +4 -4
- package/dist/{chunk-OE36OY64.cjs.map → chunk-LZQ2XZOC.cjs.map} +1 -1
- package/dist/{chunk-BTAT3MJP.cjs → chunk-MEWRE43W.cjs} +28 -28
- package/dist/{chunk-BTAT3MJP.cjs.map → chunk-MEWRE43W.cjs.map} +1 -1
- package/dist/chunk-MWHVETKN.cjs +151 -0
- package/dist/chunk-MWHVETKN.cjs.map +1 -0
- package/dist/{chunk-33GOYI3O.cjs → chunk-ONRUHYW3.cjs} +4 -4
- package/dist/{chunk-33GOYI3O.cjs.map → chunk-ONRUHYW3.cjs.map} +1 -1
- package/dist/{chunk-KP7BQIZL.cjs → chunk-ORGGDQKZ.cjs} +43 -40
- package/dist/chunk-ORGGDQKZ.cjs.map +1 -0
- package/dist/{chunk-N2OVF6SJ.cjs → chunk-OXPIJYRU.cjs} +65 -60
- package/dist/chunk-OXPIJYRU.cjs.map +1 -0
- package/dist/{chunk-2V5HW6T5.cjs → chunk-P5TQOSKA.cjs} +6 -6
- package/dist/{chunk-2V5HW6T5.cjs.map → chunk-P5TQOSKA.cjs.map} +1 -1
- package/dist/chunk-Q25CZLK6.cjs +958 -0
- package/dist/chunk-Q25CZLK6.cjs.map +1 -0
- package/dist/{chunk-ZPIZINH2.cjs → chunk-VLHBKF4P.cjs} +164 -98
- package/dist/chunk-VLHBKF4P.cjs.map +1 -0
- package/dist/{chunk-TG2GM7WJ.cjs → chunk-WCT6FT2K.cjs} +11 -7
- package/dist/chunk-WCT6FT2K.cjs.map +1 -0
- package/dist/{chunk-NPRNR54M.cjs → chunk-ZCVW63DF.cjs} +4 -4
- package/dist/{chunk-NPRNR54M.cjs.map → chunk-ZCVW63DF.cjs.map} +1 -1
- package/dist/collaboration/index.cjs +34 -9
- package/dist/collaboration/sharing/ShareControl.d.ts +15 -6
- package/dist/collaboration/sharing/ShareControl.js +9 -4
- package/dist/collaboration/sharing/ShareControl.js.map +2 -2
- package/dist/collaboration/sharing/index.d.ts +1 -0
- package/dist/collaboration/sharing/index.js +15 -1
- package/dist/collaboration/sharing/index.js.map +2 -2
- package/dist/collaboration/sharing/one-way.d.ts +41 -0
- package/dist/collaboration/sharing/one-way.js +39 -0
- package/dist/collaboration/sharing/one-way.js.map +7 -0
- package/dist/connect/index.cjs +4037 -3984
- package/dist/connect/index.cjs.map +1 -1
- package/dist/connect/viewer.cjs +9 -8
- package/dist/connection/account-cluster/ConnectedAccountCluster.js +1 -1
- package/dist/connection/account-cluster/ConnectedAccountCluster.js.map +1 -1
- package/dist/connection/agents/agentsPageParts.js +6 -2
- package/dist/connection/agents/agentsPageParts.js.map +2 -2
- package/dist/connection/command/actions.js +3 -3
- package/dist/connection/command/actions.js.map +2 -2
- package/dist/connection/conversation/ConnectedConversationSettings.js +3 -6
- package/dist/connection/conversation/ConnectedConversationSettings.js.map +2 -2
- package/dist/connection/dashboards/PanelEditor.d.ts +3 -9
- package/dist/connection/dashboards/PanelEditor.js +17 -124
- package/dist/connection/dashboards/PanelEditor.js.map +2 -2
- package/dist/connection/dashboards/index.d.ts +0 -1
- package/dist/connection/dashboards/index.js +0 -6
- package/dist/connection/dashboards/index.js.map +2 -2
- package/dist/connection/dashboards/templates.d.ts +1 -1
- package/dist/connection/dashboards/templates.js.map +1 -1
- package/dist/connection/databases/ConnectedDatabasesPage.js +46 -20
- package/dist/connection/databases/ConnectedDatabasesPage.js.map +2 -2
- package/dist/connection/databases/DatabaseViewsMenu.d.ts +5 -1
- package/dist/connection/databases/DatabaseViewsMenu.js +16 -21
- package/dist/connection/databases/DatabaseViewsMenu.js.map +2 -2
- package/dist/connection/files/bulk/ConnectedFilesBulkActions.d.ts +4 -3
- package/dist/connection/files/bulk/ConnectedFilesBulkActions.js +12 -18
- package/dist/connection/files/bulk/ConnectedFilesBulkActions.js.map +2 -2
- package/dist/connection/files/bulk/useDocumentBulkActions.d.ts +2 -3
- package/dist/connection/files/bulk/useDocumentBulkActions.js +6 -15
- package/dist/connection/files/bulk/useDocumentBulkActions.js.map +2 -2
- package/dist/connection/files/grid/cells.d.ts +7 -3
- package/dist/connection/files/grid/cells.js +8 -5
- package/dist/connection/files/grid/cells.js.map +2 -2
- package/dist/connection/files/grid/documentCellRenderers.d.ts +4 -1
- package/dist/connection/files/grid/documentCellRenderers.js +3 -2
- package/dist/connection/files/grid/documentCellRenderers.js.map +2 -2
- package/dist/connection/files/grid/documentColumns.d.ts +3 -3
- package/dist/connection/files/grid/documentColumns.js +4 -2
- package/dist/connection/files/grid/documentColumns.js.map +2 -2
- package/dist/connection/files/grid/useDocumentTable.js +10 -5
- package/dist/connection/files/grid/useDocumentTable.js.map +2 -2
- package/dist/connection/files/index.d.ts +1 -2
- package/dist/connection/files/index.js +4 -12
- package/dist/connection/files/index.js.map +2 -2
- package/dist/connection/files/review/useAiReviewLiveUpdates.js +13 -2
- package/dist/connection/files/review/useAiReviewLiveUpdates.js.map +2 -2
- package/dist/connection/files/views/ViewSelector.js +9 -21
- package/dist/connection/files/views/ViewSelector.js.map +2 -2
- package/dist/connection/files/views/useTableViews.d.ts +23 -15
- package/dist/connection/files/views/useTableViews.js +61 -35
- package/dist/connection/files/views/useTableViews.js.map +2 -2
- package/dist/connection/files/views/useViewWrites.d.ts +6 -0
- package/dist/connection/files/views/useViewWrites.js +64 -0
- package/dist/connection/files/views/useViewWrites.js.map +7 -0
- package/dist/connection/pages/BlockEditor.d.ts +32 -0
- package/dist/connection/pages/BlockEditor.js +175 -0
- package/dist/connection/pages/BlockEditor.js.map +7 -0
- package/dist/connection/pages/ConnectedPagesPage.d.ts +31 -0
- package/dist/connection/pages/ConnectedPagesPage.js +426 -0
- package/dist/connection/pages/ConnectedPagesPage.js.map +7 -0
- package/dist/connection/pages/DocumentBlocks.d.ts +46 -0
- package/dist/connection/pages/DocumentBlocks.js +200 -0
- package/dist/connection/pages/DocumentBlocks.js.map +7 -0
- package/dist/connection/pages/DocumentsPicker.d.ts +26 -0
- package/dist/connection/pages/DocumentsPicker.js +133 -0
- package/dist/connection/pages/DocumentsPicker.js.map +7 -0
- package/dist/connection/pages/PageBlockView.d.ts +22 -0
- package/dist/connection/pages/PageBlockView.js +82 -0
- package/dist/connection/pages/PageBlockView.js.map +7 -0
- package/dist/connection/pages/PageGrid.d.ts +26 -0
- package/dist/connection/pages/PageGrid.js +50 -0
- package/dist/connection/pages/PageGrid.js.map +7 -0
- package/dist/connection/pages/PageView.d.ts +24 -0
- package/dist/connection/pages/PageView.js +93 -0
- package/dist/connection/pages/PageView.js.map +7 -0
- package/dist/connection/pages/PagesList.d.ts +14 -0
- package/dist/connection/pages/PagesList.js +143 -0
- package/dist/connection/pages/PagesList.js.map +7 -0
- package/dist/connection/pages/TableViewBlock.d.ts +24 -0
- package/dist/connection/pages/TableViewBlock.js +82 -0
- package/dist/connection/pages/TableViewBlock.js.map +7 -0
- package/dist/connection/pages/ViewPicker.d.ts +21 -0
- package/dist/connection/pages/ViewPicker.js +56 -0
- package/dist/connection/pages/ViewPicker.js.map +7 -0
- package/dist/connection/pages/index.d.ts +9 -0
- package/dist/connection/pages/index.js +49 -0
- package/dist/connection/pages/index.js.map +7 -0
- package/dist/connection/pages/labels.d.ts +61 -0
- package/dist/connection/pages/labels.js +61 -0
- package/dist/connection/pages/labels.js.map +7 -0
- package/dist/connection/settings-page/featuresSection.js +2 -2
- package/dist/connection/settings-page/featuresSection.js.map +1 -1
- package/dist/connection/sharing/ResourceShareForm.js +1 -1
- package/dist/connection/sharing/ResourceShareForm.js.map +2 -2
- package/dist/connection/threads-page/ConnectedThreadsPage.js +10 -8
- package/dist/connection/threads-page/ConnectedThreadsPage.js.map +2 -2
- package/dist/connection/viewer/ConnectedDocumentViewer.js +11 -6
- package/dist/connection/viewer/ConnectedDocumentViewer.js.map +2 -2
- package/dist/dashboards/ConditionsEditor.d.ts +54 -0
- package/dist/dashboards/ConditionsEditor.js +156 -0
- package/dist/dashboards/ConditionsEditor.js.map +7 -0
- package/dist/dashboards/index.cjs +33 -521
- package/dist/dashboards/index.cjs.map +1 -1
- package/dist/dashboards/index.d.ts +3 -2
- package/dist/dashboards/index.js +13 -1
- package/dist/dashboards/index.js.map +2 -2
- package/dist/databases/DatabaseFilterMenu.d.ts +18 -0
- package/dist/databases/DatabaseFilterMenu.js +95 -0
- package/dist/databases/DatabaseFilterMenu.js.map +7 -0
- package/dist/databases/DatabaseTable.js +1 -1
- package/dist/databases/DatabaseTable.js.map +1 -1
- package/dist/databases/DatabaseToolbar.d.ts +3 -1
- package/dist/databases/DatabaseToolbar.js +2 -0
- package/dist/databases/DatabaseToolbar.js.map +2 -2
- package/dist/databases/index.cjs +85 -71
- package/dist/databases/index.d.ts +1 -0
- package/dist/databases/index.js +8 -0
- package/dist/databases/index.js.map +2 -2
- package/dist/embed/index.cjs +14 -13
- package/dist/facts/index.cjs +43 -43
- package/dist/files/bulk/BulkActionsBar.d.ts +8 -5
- package/dist/files/bulk/BulkActionsBar.js +6 -7
- package/dist/files/bulk/BulkActionsBar.js.map +2 -2
- package/dist/files/cells/DocumentNameCell.d.ts +2 -1
- package/dist/files/cells/DocumentNameCell.js +1 -1
- package/dist/files/cells/DocumentNameCell.js.map +2 -2
- package/dist/files/index.cjs +237 -224
- package/dist/files/index.d.ts +1 -1
- package/dist/files/index.js +0 -2
- package/dist/files/index.js.map +2 -2
- package/dist/files/permissions.d.ts +4 -3
- package/dist/files/permissions.js +6 -3
- package/dist/files/permissions.js.map +2 -2
- package/dist/files/views/ViewSelectorMenu.d.ts +24 -5
- package/dist/files/views/ViewSelectorMenu.js +78 -51
- package/dist/files/views/ViewSelectorMenu.js.map +2 -2
- package/dist/files/views/gridViews.d.ts +34 -1
- package/dist/files/views/gridViews.js +28 -0
- package/dist/files/views/gridViews.js.map +2 -2
- package/dist/files/views/index.d.ts +2 -2
- package/dist/files/views/index.js +8 -0
- package/dist/files/views/index.js.map +2 -2
- package/dist/files/views/useGridViews.d.ts +8 -4
- package/dist/files/views/useGridViews.js +42 -11
- package/dist/files/views/useGridViews.js.map +2 -2
- package/dist/files/visibility.d.ts +1 -16
- package/dist/files/visibility.js +6 -23
- package/dist/files/visibility.js.map +2 -2
- package/dist/index.cjs +453 -428
- package/dist/index.cjs.map +1 -1
- package/dist/pages/index.cjs +1363 -0
- package/dist/pages/index.cjs.map +1 -0
- package/dist/pages/index.d.ts +14 -0
- package/dist/pages/index.js +3 -0
- package/dist/pages/index.js.map +7 -0
- package/dist/settings/ConversationSettingsParts.d.ts +4 -6
- package/dist/settings/ConversationSettingsParts.js +15 -10
- package/dist/settings/ConversationSettingsParts.js.map +2 -2
- package/dist/settings/index.cjs +145 -144
- package/dist/studio/index.cjs +8 -7
- package/dist/studio/index.cjs.map +1 -1
- package/dist/studio/widgets.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/workflow-canvas/index.cjs +23 -22
- package/dist/workflow-canvas/index.cjs.map +1 -1
- package/node_modules/@arbidocs/coedit/package.json +1 -1
- package/package.json +10 -5
- package/dist/DocumentReviewCard-ENCPTGJE.cjs.map +0 -1
- package/dist/FilesViewerDialog-FFPW7TIK.cjs.map +0 -1
- package/dist/WorkspaceTableView-2RH33X3U.cjs.map +0 -1
- package/dist/ai-YX3OAC4F.cjs.map +0 -1
- package/dist/chunk-32HVYK4Q.cjs.map +0 -1
- package/dist/chunk-6TU4YLFW.cjs.map +0 -1
- package/dist/chunk-BCRB42SP.cjs.map +0 -1
- package/dist/chunk-KP7BQIZL.cjs.map +0 -1
- package/dist/chunk-LVIQWRC5.cjs.map +0 -1
- package/dist/chunk-N2OVF6SJ.cjs.map +0 -1
- package/dist/chunk-N3H3YAKY.cjs.map +0 -1
- package/dist/chunk-TG2GM7WJ.cjs.map +0 -1
- package/dist/chunk-UOI6JJPG.cjs.map +0 -1
- package/dist/chunk-ZPIZINH2.cjs.map +0 -1
- package/dist/connection/dashboards/ConnectedDashboardsPage.d.ts +0 -69
- package/dist/connection/dashboards/ConnectedDashboardsPage.js +0 -554
- package/dist/connection/dashboards/ConnectedDashboardsPage.js.map +0 -7
- package/dist/connection/files/views/tableViews.d.ts +0 -19
- package/dist/connection/files/views/tableViews.js +0 -36
- package/dist/connection/files/views/tableViews.js.map +0 -7
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/connection/files/grid/useDocumentTable.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * The documents table's columns and edits, bound to the session: the column definitions (rebuilt\n * only when the fields themselves change, so AG Grid keeps manual column widths), the inline edits\n * (title, AI fields, folder) written through `@arbidocs/react`, and the default columns.\n */\n\nimport { filterDocumentTags, type TagResponse } from '@arbidocs/sdk/browser'\nimport {\n useAssignDocTags,\n useCreateTag,\n useDocumentHostActions,\n useRemoveDocTags,\n useTags,\n useUpdateDocTag,\n useUpdateDocuments,\n} from '@arbidocs/react'\nimport { getDocumentTitle } from '@arbidocs/react/ui'\nimport { useCallback, useMemo, useRef } from 'react'\nimport type { CellValueChangedEvent, ColDef } from 'ag-grid-community'\nimport { DEFAULT_DOCUMENT_COLUMNS } from '../../../files/documentColumns'\nimport type { WorkspaceMemberRole } from '../../../files/permissions'\nimport { useBlocksEnvironment } from '../../../provider/environment'\nimport { createDocumentColumns, type GridDocument } from './documentColumns'\n\ntype Doc = GridDocument\ntype Tag = TagResponse\n\ninterface DocumentTableProps {\n handleToggleDocumentViewer: (docId: string) => void\n /** The viewer's id and role in the workspace (who may edit what). */\n currentUserExtId?: string\n workspaceRole: WorkspaceMemberRole | null\n onStatusClick?: () => void\n onReviewDocument?: (docId: string) => void\n onDownloadDocument?: (doc: Doc) => void\n onMoveDocument?: (docId: string) => void\n onDeleteDocument?: (docId: string) => void\n isMember?: boolean\n documents?: Doc[]\n}\n\nexport function useDocumentTable({\n handleToggleDocumentViewer,\n onStatusClick,\n onReviewDocument,\n onDownloadDocument,\n onMoveDocument,\n onDeleteDocument,\n isMember = true,\n currentUserExtId,\n workspaceRole,\n}: DocumentTableProps) {\n const { notify } = useBlocksEnvironment()\n // The host's document chat, when it has one (its identity is stable for the session).\n const { openDocumentChat } = useDocumentHostActions()\n\n const updateDocumentMutation = useUpdateDocuments()\n const updateDocRef = useRef(updateDocumentMutation)\n updateDocRef.current = updateDocumentMutation\n\n // Stable callback for folder updates \u2014 used via AG Grid context to avoid per-cell hooks\n const updateFolder = useCallback((externalId: string, folder: string | null) => {\n updateDocRef.current.mutate({ documents: [{ external_id: externalId, folder }] })\n }, [])\n\n // Mutation hooks \u2014 React Query returns new objects every render.\n // We keep them in refs so stable proxy objects can always delegate to the latest version.\n const createDocTagHook = useAssignDocTags()\n const updateDocTagHook = useUpdateDocTag()\n const deleteDocTagHook = useRemoveDocTags()\n const createTagHook = useCreateTag()\n const mutRef = useRef({\n createDocTag: createDocTagHook,\n updateDocTag: updateDocTagHook,\n deleteDocTag: deleteDocTagHook,\n createTag: createTagHook,\n })\n mutRef.current.createDocTag = createDocTagHook\n mutRef.current.updateDocTag = updateDocTagHook\n mutRef.current.deleteDocTag = deleteDocTagHook\n mutRef.current.createTag = createTagHook\n\n // Stable proxy objects \u2014 same reference across renders, always delegate to latest hooks.\n // Proxy is created once via useRef; methods forward through mutRef so closures are never stale.\n const stableProxies = useRef({\n createDocTag: new Proxy({} as ReturnType<typeof useAssignDocTags>, {\n get: (_target, prop) => Reflect.get(mutRef.current.createDocTag, prop),\n }),\n updateDocTag: new Proxy({} as ReturnType<typeof useUpdateDocTag>, {\n get: (_target, prop) => Reflect.get(mutRef.current.updateDocTag, prop),\n }),\n deleteDocTag: new Proxy({} as ReturnType<typeof useRemoveDocTags>, {\n get: (_target, prop) => Reflect.get(mutRef.current.deleteDocTag, prop),\n }),\n createTag: new Proxy({} as ReturnType<typeof useCreateTag>, {\n get: (_target, prop) => Reflect.get(mutRef.current.createTag, prop),\n }),\n })\n\n const createDocTag = stableProxies.current.createDocTag\n const updateDocTag = stableProxies.current.updateDocTag\n const deleteDocTag = stableProxies.current.deleteDocTag\n const createTagMutation = stableProxies.current.createTag\n\n // The action callbacks from the parent change identity on most renders (they\n // close over parent state / non-memoized hook returns). Keep the latest set in\n // a ref and expose referentially-stable wrappers, so the columnDefs memo below\n // doesn't recreate every render \u2014 recreating columnDefs makes AG Grid re-apply\n // them and snap manually-resized column widths back to their colDef defaults.\n const cbRef = useRef({\n handleToggleDocumentViewer,\n onStatusClick,\n onReviewDocument,\n onDownloadDocument,\n onMoveDocument,\n onDeleteDocument,\n })\n cbRef.current = {\n handleToggleDocumentViewer,\n onStatusClick,\n onReviewDocument,\n onDownloadDocument,\n onMoveDocument,\n onDeleteDocument,\n }\n const stableToggleViewer = useCallback((docId: string) => {\n cbRef.current.handleToggleDocumentViewer(docId)\n }, [])\n const stableStatusClick = useCallback(() => {\n cbRef.current.onStatusClick?.()\n }, [])\n // Offered only when the host has a review view (a menu item never does nothing).\n const canReview = !!onReviewDocument\n const stableReviewDocument = useCallback((docId: string) => {\n cbRef.current.onReviewDocument?.(docId)\n }, [])\n const stableDownloadDocument = useCallback((doc: Doc) => {\n cbRef.current.onDownloadDocument?.(doc)\n }, [])\n const stableMoveDocument = useCallback((docId: string) => {\n cbRef.current.onMoveDocument?.(docId)\n }, [])\n const stableDeleteDocument = useCallback((docId: string) => {\n cbRef.current.onDeleteDocument?.(docId)\n }, [])\n\n // Fetch workspace tags to get available annotation tags\n const { data: workspaceTags = [] } = useTags()\n\n // Get available tags (exclude search tags and child tags whose parent is a select tag)\n const availableTags = useMemo(() => {\n const filteredTags = filterDocumentTags(workspaceTags as Tag[])\n const selectTagIds = new Set(\n filteredTags.filter((t) => t.tag_type.type === 'select').map((t) => t.external_id)\n )\n return filteredTags.filter((tag) => !selectTagIds.has(tag.parent_ext_id || ''))\n }, [workspaceTags])\n\n // Store latest availableTags in ref so createDocumentColumns can access it\n // even when columnDefs useMemo doesn't run\n const availableTagsRef = useRef(availableTags)\n availableTagsRef.current = availableTags\n\n // Track tag IDs and names for columnDefs dependency\n // Update when tag IDs change (additions/removals) OR when tag names change (renames)\n // This allows column headers and tag badges to update when tags are renamed\n const prevTagIdsRef = useRef<string[]>([])\n const prevTagNamesRef = useRef<Record<string, string>>({})\n\n const currentTagIds = availableTags.map((tag) => tag.external_id).sort()\n const currentTagNames = availableTags.reduce(\n (acc, tag) => {\n acc[tag.external_id] = tag.name\n return acc\n },\n {} as Record<string, string>\n )\n\n const prevTagIds = prevTagIdsRef.current\n const prevTagNames = prevTagNamesRef.current\n\n // Check if tag IDs changed (additions/removals)\n const tagIdsChanged =\n currentTagIds.length !== prevTagIds.length ||\n currentTagIds.some((id, i) => id !== prevTagIds[i])\n\n // Check if tag names changed (renames)\n const tagNamesChanged =\n currentTagIds.some(\n (id) => prevTagNames[id] !== undefined && prevTagNames[id] !== currentTagNames[id]\n ) || currentTagIds.some((id) => prevTagNames[id] === undefined)\n\n // Update refs when tag IDs or names change\n if (tagIdsChanged || tagNamesChanged) {\n prevTagIdsRef.current = currentTagIds\n prevTagNamesRef.current = currentTagNames\n }\n\n // Stabilized tag data for dependencies - only changes when tags are added/removed/renamed\n // Not when document tag values are toggled (which doesn't change availableTags)\n const stabilizedTagIds = prevTagIdsRef.current\n const stabilizedTagNames = prevTagNamesRef.current\n\n // Initial visible columns - used when no saved view exists\n const defaultVisibleColumns = useMemo(() => [...DEFAULT_DOCUMENT_COLUMNS], [])\n\n // Visibility toggles: one stable writer for every row's cell.\n const toggleShared = useCallback((docId: string, shared: boolean) => {\n updateDocRef.current.mutate({ documents: [{ external_id: docId, shared }] })\n }, [])\n const notifyRef = useRef(notify)\n notifyRef.current = notify\n const tagNotify = useCallback(\n (message: string, kind: 'success' | 'error') => notifyRef.current(message, kind),\n []\n )\n\n // Handle cell value changes\n const handleCellValueChanged = useCallback(\n async (event: CellValueChangedEvent<Doc>) => {\n // Check that we have data and value actually changed\n if (!event.data || event.newValue === event.oldValue) {\n return\n }\n\n const docId = event.data.external_id\n const docTitle = getDocumentTitle(event.data)\n\n if (event.column.getColId() === 'title') {\n // Update title via doc_metadata\n updateDocumentMutation.mutate({\n documents: [\n {\n external_id: docId,\n doc_metadata: { ...event.data.doc_metadata, title: event.newValue },\n },\n ],\n })\n notify(`Updated title for \"${docTitle}\"`, 'success')\n } else if (event.column.getColId() === 'doc_date') {\n // Validate date format before updating\n const newValue = event.newValue?.trim()\n\n // Allow clearing the date\n if (!newValue || newValue === '') {\n updateDocumentMutation.mutate({\n documents: [\n {\n external_id: docId,\n doc_metadata: { ...event.data.doc_metadata, doc_date: '' },\n },\n ],\n })\n notify(`Cleared date for \"${docTitle}\"`, 'success')\n return\n }\n\n // Validate YYYY-MM-DD format\n if (!/^\\d{4}-\\d{2}-\\d{2}$/.test(newValue)) {\n notify('Please enter date in YYYY-MM-DD format (e.g., 2024-11-24)', 'error')\n // Revert to old value\n event.node.setDataValue('doc_date', event.oldValue)\n return\n }\n\n // Validate it's a real date\n const date = new Date(newValue)\n if (isNaN(date.getTime())) {\n notify('Please enter a valid date in YYYY-MM-DD format (e.g., 2024-11-24)', 'error')\n // Revert to old value\n event.node.setDataValue('doc_date', event.oldValue)\n return\n }\n\n // Update doc_date via doc_metadata\n updateDocumentMutation.mutate({\n documents: [\n {\n external_id: docId,\n doc_metadata: { ...event.data.doc_metadata, doc_date: newValue },\n },\n ],\n })\n notify(`Updated date for \"${docTitle}\"`, 'success')\n } else if (event.column.getColId() === 'doc_nature') {\n // Update doc_nature via doc_metadata\n updateDocumentMutation.mutate({\n documents: [\n {\n external_id: docId,\n doc_metadata: { ...event.data.doc_metadata, doc_nature: event.newValue || null },\n },\n ],\n })\n notify(`Updated type for \"${docTitle}\"`, 'success')\n } else if (event.column.getColId() === 'doc_author') {\n // Update doc_author via doc_metadata\n updateDocumentMutation.mutate({\n documents: [\n {\n external_id: docId,\n doc_metadata: { ...event.data.doc_metadata, doc_author: event.newValue || null },\n },\n ],\n })\n notify(`Updated author for \"${docTitle}\"`, 'success')\n } else if (event.column.getColId() === 'doc_subject') {\n // Update doc_subject via doc_metadata\n updateDocumentMutation.mutate({\n documents: [\n {\n external_id: docId,\n doc_metadata: { ...event.data.doc_metadata, doc_subject: event.newValue || null },\n },\n ],\n })\n notify(`Updated abstract for \"${docTitle}\"`, 'success')\n } else if (event.column.getColId() === 'folder') {\n // Update folder path\n updateDocumentMutation.mutate({\n documents: [\n {\n external_id: docId,\n folder: event.newValue || null,\n },\n ],\n })\n notify(`Updated folder for \"${docTitle}\"`, 'success')\n }\n },\n [updateDocumentMutation, notify]\n )\n\n // Get stable reference to availableTags that only changes when tags are added/removed/renamed\n // We use the stabilized IDs/names as dependencies, then access the full tag objects from ref\n const memoizedAvailableTags = useMemo(() => {\n // Access full tag objects from ref (stabilizedTagIds/Names ensure this runs at right time)\n void stabilizedTagIds // Used to trigger recalculation\n void stabilizedTagNames // Used to trigger recalculation\n return availableTagsRef.current\n }, [stabilizedTagIds, stabilizedTagNames])\n\n const columnDefs: ColDef<Doc>[] = useMemo(() => {\n // ColumnDefs recreates when tag IDs change (additions/removals) OR when tag names change (renames)\n // This allows column headers and tag badges to update when tags are renamed\n return createDocumentColumns({\n handleToggleDocumentViewer: stableToggleViewer,\n onStatusClick: stableStatusClick,\n onReviewDocument: canReview ? stableReviewDocument : undefined,\n onDocumentChat: openDocumentChat,\n onDownloadDocument: stableDownloadDocument,\n onMoveDocument: stableMoveDocument,\n onDeleteDocument: stableDeleteDocument,\n isMember,\n workspaceRole,\n currentUserExtId,\n availableTags: memoizedAvailableTags,\n createDocTag,\n updateDocTag,\n deleteDocTag,\n createTag: createTagMutation,\n onToggleShared: toggleShared,\n notify: tagNotify,\n })\n }, [\n stableToggleViewer,\n stableStatusClick,\n stableReviewDocument,\n canReview,\n openDocumentChat,\n stableDownloadDocument,\n stableMoveDocument,\n stableDeleteDocument,\n isMember,\n workspaceRole,\n currentUserExtId,\n memoizedAvailableTags,\n createDocTag,\n updateDocTag,\n deleteDocTag,\n createTagMutation,\n toggleShared,\n tagNotify,\n ])\n\n return {\n columnDefs,\n onCellValueChanged: handleCellValueChanged,\n defaultVisibleColumns, // For use in ViewEditor and initial grid state\n updateFolder, // Stable callback for FolderCellRenderer via AG Grid context\n }\n}\n"],
|
|
5
|
-
"mappings": ";AAMA,SAAS,0BAA4C;AACrD;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,wBAAwB;AACjC,SAAS,aAAa,SAAS,cAAc;AAE7C,SAAS,gCAAgC;AAEzC,SAAS,4BAA4B;AACrC,SAAS,6BAAgD;AAmBlD,SAAS,iBAAiB;AAAA,EAC/B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,WAAW;AAAA,EACX;AAAA,EACA;AACF,GAAuB;AACrB,QAAM,EAAE,
|
|
4
|
+
"sourcesContent": ["/**\n * The documents table's columns and edits, bound to the session: the column definitions (rebuilt\n * only when the fields themselves change, so AG Grid keeps manual column widths), the inline edits\n * (title, AI fields, folder) written through `@arbidocs/react`, and the default columns.\n */\n\nimport { filterDocumentTags, type TagResponse } from '@arbidocs/sdk/browser'\nimport {\n useAssignDocTags,\n useCreateTag,\n useDocumentHostActions,\n useRemoveDocTags,\n useTags,\n useUpdateDocTag,\n useUpdateDocuments,\n} from '@arbidocs/react'\nimport { getDocumentTitle } from '@arbidocs/react/ui'\nimport { useCallback, useMemo, useRef } from 'react'\nimport type { CellValueChangedEvent, ColDef } from 'ag-grid-community'\nimport { DEFAULT_DOCUMENT_COLUMNS } from '../../../files/documentColumns'\nimport type { WorkspaceMemberRole } from '../../../files/permissions'\nimport { useBlocksEnvironment } from '../../../provider/environment'\nimport { confirmShareWithWorkspace, entityNoun } from '../../../collaboration/sharing/one-way'\nimport { createDocumentColumns, type GridDocument } from './documentColumns'\n\ntype Doc = GridDocument\ntype Tag = TagResponse\n\ninterface DocumentTableProps {\n handleToggleDocumentViewer: (docId: string) => void\n /** The viewer's id and role in the workspace (who may edit what). */\n currentUserExtId?: string\n workspaceRole: WorkspaceMemberRole | null\n onStatusClick?: () => void\n onReviewDocument?: (docId: string) => void\n onDownloadDocument?: (doc: Doc) => void\n onMoveDocument?: (docId: string) => void\n onDeleteDocument?: (docId: string) => void\n isMember?: boolean\n documents?: Doc[]\n}\n\nexport function useDocumentTable({\n handleToggleDocumentViewer,\n onStatusClick,\n onReviewDocument,\n onDownloadDocument,\n onMoveDocument,\n onDeleteDocument,\n isMember = true,\n currentUserExtId,\n workspaceRole,\n}: DocumentTableProps) {\n const { notify, confirm } = useBlocksEnvironment()\n // The host's document chat, when it has one (its identity is stable for the session).\n const { openDocumentChat } = useDocumentHostActions()\n\n const updateDocumentMutation = useUpdateDocuments()\n const updateDocRef = useRef(updateDocumentMutation)\n updateDocRef.current = updateDocumentMutation\n\n // Stable callback for folder updates \u2014 used via AG Grid context to avoid per-cell hooks\n const updateFolder = useCallback((externalId: string, folder: string | null) => {\n updateDocRef.current.mutate({ documents: [{ external_id: externalId, folder }] })\n }, [])\n\n // Mutation hooks \u2014 React Query returns new objects every render.\n // We keep them in refs so stable proxy objects can always delegate to the latest version.\n const createDocTagHook = useAssignDocTags()\n const updateDocTagHook = useUpdateDocTag()\n const deleteDocTagHook = useRemoveDocTags()\n const createTagHook = useCreateTag()\n const mutRef = useRef({\n createDocTag: createDocTagHook,\n updateDocTag: updateDocTagHook,\n deleteDocTag: deleteDocTagHook,\n createTag: createTagHook,\n })\n mutRef.current.createDocTag = createDocTagHook\n mutRef.current.updateDocTag = updateDocTagHook\n mutRef.current.deleteDocTag = deleteDocTagHook\n mutRef.current.createTag = createTagHook\n\n // Stable proxy objects \u2014 same reference across renders, always delegate to latest hooks.\n // Proxy is created once via useRef; methods forward through mutRef so closures are never stale.\n const stableProxies = useRef({\n createDocTag: new Proxy({} as ReturnType<typeof useAssignDocTags>, {\n get: (_target, prop) => Reflect.get(mutRef.current.createDocTag, prop),\n }),\n updateDocTag: new Proxy({} as ReturnType<typeof useUpdateDocTag>, {\n get: (_target, prop) => Reflect.get(mutRef.current.updateDocTag, prop),\n }),\n deleteDocTag: new Proxy({} as ReturnType<typeof useRemoveDocTags>, {\n get: (_target, prop) => Reflect.get(mutRef.current.deleteDocTag, prop),\n }),\n createTag: new Proxy({} as ReturnType<typeof useCreateTag>, {\n get: (_target, prop) => Reflect.get(mutRef.current.createTag, prop),\n }),\n })\n\n const createDocTag = stableProxies.current.createDocTag\n const updateDocTag = stableProxies.current.updateDocTag\n const deleteDocTag = stableProxies.current.deleteDocTag\n const createTagMutation = stableProxies.current.createTag\n\n // The action callbacks from the parent change identity on most renders (they\n // close over parent state / non-memoized hook returns). Keep the latest set in\n // a ref and expose referentially-stable wrappers, so the columnDefs memo below\n // doesn't recreate every render \u2014 recreating columnDefs makes AG Grid re-apply\n // them and snap manually-resized column widths back to their colDef defaults.\n const cbRef = useRef({\n handleToggleDocumentViewer,\n onStatusClick,\n onReviewDocument,\n onDownloadDocument,\n onMoveDocument,\n onDeleteDocument,\n })\n cbRef.current = {\n handleToggleDocumentViewer,\n onStatusClick,\n onReviewDocument,\n onDownloadDocument,\n onMoveDocument,\n onDeleteDocument,\n }\n const stableToggleViewer = useCallback((docId: string) => {\n cbRef.current.handleToggleDocumentViewer(docId)\n }, [])\n const stableStatusClick = useCallback(() => {\n cbRef.current.onStatusClick?.()\n }, [])\n // Offered only when the host has a review view (a menu item never does nothing).\n const canReview = !!onReviewDocument\n const stableReviewDocument = useCallback((docId: string) => {\n cbRef.current.onReviewDocument?.(docId)\n }, [])\n const stableDownloadDocument = useCallback((doc: Doc) => {\n cbRef.current.onDownloadDocument?.(doc)\n }, [])\n const stableMoveDocument = useCallback((docId: string) => {\n cbRef.current.onMoveDocument?.(docId)\n }, [])\n const stableDeleteDocument = useCallback((docId: string) => {\n cbRef.current.onDeleteDocument?.(docId)\n }, [])\n\n // Fetch workspace tags to get available annotation tags\n const { data: workspaceTags = [] } = useTags()\n\n // Get available tags (exclude search tags and child tags whose parent is a select tag)\n const availableTags = useMemo(() => {\n const filteredTags = filterDocumentTags(workspaceTags as Tag[])\n const selectTagIds = new Set(\n filteredTags.filter((t) => t.tag_type.type === 'select').map((t) => t.external_id)\n )\n return filteredTags.filter((tag) => !selectTagIds.has(tag.parent_ext_id || ''))\n }, [workspaceTags])\n\n // Store latest availableTags in ref so createDocumentColumns can access it\n // even when columnDefs useMemo doesn't run\n const availableTagsRef = useRef(availableTags)\n availableTagsRef.current = availableTags\n\n // Track tag IDs and names for columnDefs dependency\n // Update when tag IDs change (additions/removals) OR when tag names change (renames)\n // This allows column headers and tag badges to update when tags are renamed\n const prevTagIdsRef = useRef<string[]>([])\n const prevTagNamesRef = useRef<Record<string, string>>({})\n\n const currentTagIds = availableTags.map((tag) => tag.external_id).sort()\n const currentTagNames = availableTags.reduce(\n (acc, tag) => {\n acc[tag.external_id] = tag.name\n return acc\n },\n {} as Record<string, string>\n )\n\n const prevTagIds = prevTagIdsRef.current\n const prevTagNames = prevTagNamesRef.current\n\n // Check if tag IDs changed (additions/removals)\n const tagIdsChanged =\n currentTagIds.length !== prevTagIds.length ||\n currentTagIds.some((id, i) => id !== prevTagIds[i])\n\n // Check if tag names changed (renames)\n const tagNamesChanged =\n currentTagIds.some(\n (id) => prevTagNames[id] !== undefined && prevTagNames[id] !== currentTagNames[id]\n ) || currentTagIds.some((id) => prevTagNames[id] === undefined)\n\n // Update refs when tag IDs or names change\n if (tagIdsChanged || tagNamesChanged) {\n prevTagIdsRef.current = currentTagIds\n prevTagNamesRef.current = currentTagNames\n }\n\n // Stabilized tag data for dependencies - only changes when tags are added/removed/renamed\n // Not when document tag values are toggled (which doesn't change availableTags)\n const stabilizedTagIds = prevTagIdsRef.current\n const stabilizedTagNames = prevTagNamesRef.current\n\n // Initial visible columns - used when no saved view exists\n const defaultVisibleColumns = useMemo(() => [...DEFAULT_DOCUMENT_COLUMNS], [])\n\n // Sharing: one stable writer for every row's cell. It asks first, since it cannot be undone.\n const confirmRef = useRef(confirm)\n confirmRef.current = confirm\n const shareDocument = useCallback(async (docId: string) => {\n const noun = entityNoun('DOCUMENT')\n if (!(await confirmShareWithWorkspace(confirmRef.current, { count: 1, noun }))) return\n updateDocRef.current.mutate({ documents: [{ external_id: docId, shared: true }] })\n }, [])\n const notifyRef = useRef(notify)\n notifyRef.current = notify\n const tagNotify = useCallback(\n (message: string, kind: 'success' | 'error') => notifyRef.current(message, kind),\n []\n )\n\n // Handle cell value changes\n const handleCellValueChanged = useCallback(\n async (event: CellValueChangedEvent<Doc>) => {\n // Check that we have data and value actually changed\n if (!event.data || event.newValue === event.oldValue) {\n return\n }\n\n const docId = event.data.external_id\n const docTitle = getDocumentTitle(event.data)\n\n if (event.column.getColId() === 'title') {\n // Update title via doc_metadata\n updateDocumentMutation.mutate({\n documents: [\n {\n external_id: docId,\n doc_metadata: { ...event.data.doc_metadata, title: event.newValue },\n },\n ],\n })\n notify(`Updated title for \"${docTitle}\"`, 'success')\n } else if (event.column.getColId() === 'doc_date') {\n // Validate date format before updating\n const newValue = event.newValue?.trim()\n\n // Allow clearing the date\n if (!newValue || newValue === '') {\n updateDocumentMutation.mutate({\n documents: [\n {\n external_id: docId,\n doc_metadata: { ...event.data.doc_metadata, doc_date: '' },\n },\n ],\n })\n notify(`Cleared date for \"${docTitle}\"`, 'success')\n return\n }\n\n // Validate YYYY-MM-DD format\n if (!/^\\d{4}-\\d{2}-\\d{2}$/.test(newValue)) {\n notify('Please enter date in YYYY-MM-DD format (e.g., 2024-11-24)', 'error')\n // Revert to old value\n event.node.setDataValue('doc_date', event.oldValue)\n return\n }\n\n // Validate it's a real date\n const date = new Date(newValue)\n if (isNaN(date.getTime())) {\n notify('Please enter a valid date in YYYY-MM-DD format (e.g., 2024-11-24)', 'error')\n // Revert to old value\n event.node.setDataValue('doc_date', event.oldValue)\n return\n }\n\n // Update doc_date via doc_metadata\n updateDocumentMutation.mutate({\n documents: [\n {\n external_id: docId,\n doc_metadata: { ...event.data.doc_metadata, doc_date: newValue },\n },\n ],\n })\n notify(`Updated date for \"${docTitle}\"`, 'success')\n } else if (event.column.getColId() === 'doc_nature') {\n // Update doc_nature via doc_metadata\n updateDocumentMutation.mutate({\n documents: [\n {\n external_id: docId,\n doc_metadata: { ...event.data.doc_metadata, doc_nature: event.newValue || null },\n },\n ],\n })\n notify(`Updated type for \"${docTitle}\"`, 'success')\n } else if (event.column.getColId() === 'doc_author') {\n // Update doc_author via doc_metadata\n updateDocumentMutation.mutate({\n documents: [\n {\n external_id: docId,\n doc_metadata: { ...event.data.doc_metadata, doc_author: event.newValue || null },\n },\n ],\n })\n notify(`Updated author for \"${docTitle}\"`, 'success')\n } else if (event.column.getColId() === 'doc_subject') {\n // Update doc_subject via doc_metadata\n updateDocumentMutation.mutate({\n documents: [\n {\n external_id: docId,\n doc_metadata: { ...event.data.doc_metadata, doc_subject: event.newValue || null },\n },\n ],\n })\n notify(`Updated abstract for \"${docTitle}\"`, 'success')\n } else if (event.column.getColId() === 'folder') {\n // Update folder path\n updateDocumentMutation.mutate({\n documents: [\n {\n external_id: docId,\n folder: event.newValue || null,\n },\n ],\n })\n notify(`Updated folder for \"${docTitle}\"`, 'success')\n }\n },\n [updateDocumentMutation, notify]\n )\n\n // Get stable reference to availableTags that only changes when tags are added/removed/renamed\n // We use the stabilized IDs/names as dependencies, then access the full tag objects from ref\n const memoizedAvailableTags = useMemo(() => {\n // Access full tag objects from ref (stabilizedTagIds/Names ensure this runs at right time)\n void stabilizedTagIds // Used to trigger recalculation\n void stabilizedTagNames // Used to trigger recalculation\n return availableTagsRef.current\n }, [stabilizedTagIds, stabilizedTagNames])\n\n const columnDefs: ColDef<Doc>[] = useMemo(() => {\n // ColumnDefs recreates when tag IDs change (additions/removals) OR when tag names change (renames)\n // This allows column headers and tag badges to update when tags are renamed\n return createDocumentColumns({\n handleToggleDocumentViewer: stableToggleViewer,\n onStatusClick: stableStatusClick,\n onReviewDocument: canReview ? stableReviewDocument : undefined,\n onDocumentChat: openDocumentChat,\n onDownloadDocument: stableDownloadDocument,\n onMoveDocument: stableMoveDocument,\n onDeleteDocument: stableDeleteDocument,\n isMember,\n workspaceRole,\n currentUserExtId,\n availableTags: memoizedAvailableTags,\n createDocTag,\n updateDocTag,\n deleteDocTag,\n createTag: createTagMutation,\n onShareDocument: (docId: string) => void shareDocument(docId),\n notify: tagNotify,\n })\n }, [\n stableToggleViewer,\n stableStatusClick,\n stableReviewDocument,\n canReview,\n openDocumentChat,\n stableDownloadDocument,\n stableMoveDocument,\n stableDeleteDocument,\n isMember,\n workspaceRole,\n currentUserExtId,\n memoizedAvailableTags,\n createDocTag,\n updateDocTag,\n deleteDocTag,\n createTagMutation,\n shareDocument,\n tagNotify,\n ])\n\n return {\n columnDefs,\n onCellValueChanged: handleCellValueChanged,\n defaultVisibleColumns, // For use in ViewEditor and initial grid state\n updateFolder, // Stable callback for FolderCellRenderer via AG Grid context\n }\n}\n"],
|
|
5
|
+
"mappings": ";AAMA,SAAS,0BAA4C;AACrD;AAAA,EACE;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A;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AAED,SAAO;AAAA,IACL;AAAA,IACA,oBAAoB;AAAA,IACpB;AAAA;AAAA,IACA;AAAA;AAAA,EACF;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -45,8 +45,7 @@ export { PersistedGridView } from './page/PersistedGridView';
|
|
|
45
45
|
export { ProgressiveLoadingChip } from './page/ProgressiveLoadingChip';
|
|
46
46
|
export { useDocumentNavigation } from './page/useDocumentNavigation';
|
|
47
47
|
export { ViewSelector, type LoadableTableView } from './views/ViewSelector';
|
|
48
|
-
export { useTableViews } from './views/useTableViews';
|
|
49
|
-
export { viewsOfTable, withMissingTableViews, withTableView, withoutTableView, type TableView, type TableViewTable, } from './views/tableViews';
|
|
48
|
+
export { toGridView, toSpec, useTableViews, type TableViewTable } from './views/useTableViews';
|
|
50
49
|
export { useFilesDialogs, type DeleteRequestDocument } from './store';
|
|
51
50
|
export { ConnectedFilesPage, type ConnectedFilesPageProps, type FilesViewerOptions, type FilesReviewCardProps, type FilesUploadRequest, } from './page/ConnectedFilesPage';
|
|
52
51
|
export { ConnectedGridView } from './ConnectedGridView';
|
|
@@ -103,13 +103,7 @@ import { PersistedGridView } from "./page/PersistedGridView.js";
|
|
|
103
103
|
import { ProgressiveLoadingChip } from "./page/ProgressiveLoadingChip.js";
|
|
104
104
|
import { useDocumentNavigation } from "./page/useDocumentNavigation.js";
|
|
105
105
|
import { ViewSelector } from "./views/ViewSelector.js";
|
|
106
|
-
import { useTableViews } from "./views/useTableViews.js";
|
|
107
|
-
import {
|
|
108
|
-
viewsOfTable,
|
|
109
|
-
withMissingTableViews,
|
|
110
|
-
withTableView,
|
|
111
|
-
withoutTableView
|
|
112
|
-
} from "./views/tableViews.js";
|
|
106
|
+
import { toGridView, toSpec, useTableViews } from "./views/useTableViews.js";
|
|
113
107
|
import { useFilesDialogs } from "./store.js";
|
|
114
108
|
import {
|
|
115
109
|
ConnectedFilesPage
|
|
@@ -192,6 +186,8 @@ export {
|
|
|
192
186
|
parseQuotaError,
|
|
193
187
|
reviewProgress,
|
|
194
188
|
startMenuItem,
|
|
189
|
+
toGridView,
|
|
190
|
+
toSpec,
|
|
195
191
|
useAddFromUrls,
|
|
196
192
|
useAiReviewLiveUpdates,
|
|
197
193
|
useAiReviewStore,
|
|
@@ -211,10 +207,6 @@ export {
|
|
|
211
207
|
usePendingFolders,
|
|
212
208
|
useProcessingCounts,
|
|
213
209
|
useProcessingPulse,
|
|
214
|
-
useTableViews
|
|
215
|
-
viewsOfTable,
|
|
216
|
-
withMissingTableViews,
|
|
217
|
-
withTableView,
|
|
218
|
-
withoutTableView
|
|
210
|
+
useTableViews
|
|
219
211
|
};
|
|
220
212
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/connection/files/index.ts"],
|
|
4
|
-
"sourcesContent": ["// The connected Files kits: the explorer, the upload, the table, the bulk actions and the field\n// and tag editors. What a host adds to them is on the `@arbidocs/react` DocumentsSupport.\nexport {\n ConnectedFilesExplorer,\n TILE_DEFAULT,\n TILE_MAX,\n TILE_MIN,\n type ConnectedFilesExplorerHandle,\n type ConnectedFilesExplorerProps,\n} from './explorer/ConnectedFilesExplorer'\nexport {\n FileTooltipContent,\n isActiveDocumentStatus,\n startMenuItem,\n type FileTileDocument,\n type FileTileUser,\n} from './explorer/FileTiles'\nexport { DocumentSyncGlyph } from './DocumentSyncGlyph'\nexport {\n FILES_PREFS_KEY,\n filesViewMode,\n useFilesPrefs,\n useFilesStore,\n usePendingFolders,\n} from './store'\nexport { ConnectedUpload, type ConnectedUploadProps } from './upload/ConnectedUpload'\nexport { ConnectedUploadDialog } from './upload/ConnectedUploadDialog'\nexport { ConnectedNewFileMenu, type ConnectedNewFileMenuProps } from './ConnectedNewFileMenu'\nexport { ConnectedBulkTagCrumbs } from './ConnectedBulkTagCrumbs'\nexport {\n ConnectedUploadDropzone,\n type ConnectedUploadDropzoneProps,\n type UploadSource,\n} from './upload/ConnectedUploadDropzone'\nexport { EmptyWorkspaceUpload, type EmptyWorkspaceUploadProps } from './upload/EmptyWorkspaceUpload'\nexport { AddFromAccountsButton } from './upload/AddFromAccountsButton'\nexport { useAddFromUrls, type AddFromUrlsOptions } from './upload/useAddFromUrls'\nexport { useDocumentTable } from './grid/useDocumentTable'\nexport {\n createDocumentColumns,\n type DocumentGridContext,\n type GridDocument,\n} from './grid/documentColumns'\nexport { createTagColumn } from './grid/tagColumn'\nexport {\n DocumentFolderCell,\n DocumentLabelsCell,\n DocumentNameCell,\n DocumentSharedCell,\n RelatedDocumentsCell,\n UserAvatar,\n useDocumentFolders,\n type GridLabel,\n type GridUser,\n} from './grid/cells'\nexport {\n DocumentStatusGlyph,\n StatusCell,\n parseQuotaError,\n type ResolvedDocStatus,\n} from './grid/documentStatus'\nexport { ConnectedTagEntity, type ConnectedTagEntityProps } from './grid/ConnectedTagEntity'\nexport {\n ConnectedFilesBulkActions,\n type ConnectedFilesBulkActionsProps,\n} from './bulk/ConnectedFilesBulkActions'\nexport { useDocumentBulkActions, BULK_REPROCESS_LIMIT } from './bulk/useDocumentBulkActions'\nexport { useDocumentGridSync, type UseDocumentGridSyncArgs } from './grid/useDocumentGridSync'\nexport { documentFamilyMeta, type FamilyMeta } from './grid/familyMeta'\nexport {\n useDocumentFilters,\n deduplicateByContentHash,\n DEFAULT_SEARCH_FIELDS,\n SEARCH_FIELD_OPTIONS,\n type DocumentFilterId,\n type DocumentFilterOption,\n type SearchFieldId,\n} from './useDocumentFilters'\nexport { ConnectedAiReview, type ConnectedAiReviewProps } from './review/ConnectedAiReview'\nexport { reviewProgress } from './review/reviewProgress'\nexport { useAiReviewLiveUpdates } from './review/useAiReviewLiveUpdates'\nexport { useBatchCompleteToasts } from './useBatchCompleteToasts'\nexport { useAiReviewStore, type AiReviewRun } from './store'\nexport {\n ConnectedMoveToFolder,\n type ConnectedMoveToFolderProps,\n} from './move/ConnectedMoveToFolder'\nexport {\n ConnectedTagForm,\n type ConnectedTagFormProps,\n type TagCreateData,\n type TagFormat,\n type TagUpdateData,\n} from './fields/ConnectedTagForm'\nexport {\n ConnectedTagEditorDialog,\n type ConnectedTagEditorDialogProps,\n} from './fields/ConnectedTagEditorDialog'\nexport {\n ConnectedFieldsEditor,\n type ConnectedFieldsEditorProps,\n type FieldsExportSlot,\n} from './fields/ConnectedFieldsEditor'\nexport {\n ConnectedFieldsManager,\n type ConnectedFieldsManagerProps,\n} from './fields/ConnectedFieldsManager'\nexport {\n ConnectedFieldsManagerPanel,\n type ConnectedFieldsManagerPanelProps,\n} from './fields/ConnectedFieldsManagerPanel'\nexport { FIELDS_MANAGER_PANEL, openFieldsManagerIn } from './fields/fields-manager-panel'\nexport { type AppliedAiFields, type FieldsTarget } from './fields/useFieldsApply'\nexport {\n ConnectedBulkTagEditor,\n type ConnectedBulkTagEditorProps,\n} from './fields/ConnectedBulkTagEditor'\nexport {\n documentFieldContent,\n type DocTagCitations,\n type DocumentFieldContent,\n type DocumentFieldOptions,\n} from './fields/documentField'\nexport { DocumentUser } from './fields/DocumentUser'\nexport { useMemberLookup } from './fields/useMemberLookup'\nexport { useFilesGridStates, type FilesViewMode } from './store'\nexport {\n DocumentsFilterBarActions,\n type DocumentsFilterBarActionsProps,\n} from './page/DocumentsFilterBarActions'\nexport {\n DocumentsUploadButton,\n type DocumentsUploadButtonProps,\n} from './page/DocumentsUploadButton'\nexport { PersistedGridView } from './page/PersistedGridView'\nexport { ProgressiveLoadingChip } from './page/ProgressiveLoadingChip'\nexport { useDocumentNavigation } from './page/useDocumentNavigation'\nexport { ViewSelector, type LoadableTableView } from './views/ViewSelector'\nexport {
|
|
5
|
-
"mappings": ";AAEA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAGK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OA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
+
"sourcesContent": ["// The connected Files kits: the explorer, the upload, the table, the bulk actions and the field\n// and tag editors. What a host adds to them is on the `@arbidocs/react` DocumentsSupport.\nexport {\n ConnectedFilesExplorer,\n TILE_DEFAULT,\n TILE_MAX,\n TILE_MIN,\n type ConnectedFilesExplorerHandle,\n type ConnectedFilesExplorerProps,\n} from './explorer/ConnectedFilesExplorer'\nexport {\n FileTooltipContent,\n isActiveDocumentStatus,\n startMenuItem,\n type FileTileDocument,\n type FileTileUser,\n} from './explorer/FileTiles'\nexport { DocumentSyncGlyph } from './DocumentSyncGlyph'\nexport {\n FILES_PREFS_KEY,\n filesViewMode,\n useFilesPrefs,\n useFilesStore,\n usePendingFolders,\n} from './store'\nexport { ConnectedUpload, type ConnectedUploadProps } from './upload/ConnectedUpload'\nexport { ConnectedUploadDialog } from './upload/ConnectedUploadDialog'\nexport { ConnectedNewFileMenu, type ConnectedNewFileMenuProps } from './ConnectedNewFileMenu'\nexport { ConnectedBulkTagCrumbs } from './ConnectedBulkTagCrumbs'\nexport {\n ConnectedUploadDropzone,\n type ConnectedUploadDropzoneProps,\n type UploadSource,\n} from './upload/ConnectedUploadDropzone'\nexport { EmptyWorkspaceUpload, type EmptyWorkspaceUploadProps } from './upload/EmptyWorkspaceUpload'\nexport { AddFromAccountsButton } from './upload/AddFromAccountsButton'\nexport { useAddFromUrls, type AddFromUrlsOptions } from './upload/useAddFromUrls'\nexport { useDocumentTable } from './grid/useDocumentTable'\nexport {\n createDocumentColumns,\n type DocumentGridContext,\n type GridDocument,\n} from './grid/documentColumns'\nexport { createTagColumn } from './grid/tagColumn'\nexport {\n DocumentFolderCell,\n DocumentLabelsCell,\n DocumentNameCell,\n DocumentSharedCell,\n RelatedDocumentsCell,\n UserAvatar,\n useDocumentFolders,\n type GridLabel,\n type GridUser,\n} from './grid/cells'\nexport {\n DocumentStatusGlyph,\n StatusCell,\n parseQuotaError,\n type ResolvedDocStatus,\n} from './grid/documentStatus'\nexport { ConnectedTagEntity, type ConnectedTagEntityProps } from './grid/ConnectedTagEntity'\nexport {\n ConnectedFilesBulkActions,\n type ConnectedFilesBulkActionsProps,\n} from './bulk/ConnectedFilesBulkActions'\nexport { useDocumentBulkActions, BULK_REPROCESS_LIMIT } from './bulk/useDocumentBulkActions'\nexport { useDocumentGridSync, type UseDocumentGridSyncArgs } from './grid/useDocumentGridSync'\nexport { documentFamilyMeta, type FamilyMeta } from './grid/familyMeta'\nexport {\n useDocumentFilters,\n deduplicateByContentHash,\n DEFAULT_SEARCH_FIELDS,\n SEARCH_FIELD_OPTIONS,\n type DocumentFilterId,\n type DocumentFilterOption,\n type SearchFieldId,\n} from './useDocumentFilters'\nexport { ConnectedAiReview, type ConnectedAiReviewProps } from './review/ConnectedAiReview'\nexport { reviewProgress } from './review/reviewProgress'\nexport { useAiReviewLiveUpdates } from './review/useAiReviewLiveUpdates'\nexport { useBatchCompleteToasts } from './useBatchCompleteToasts'\nexport { useAiReviewStore, type AiReviewRun } from './store'\nexport {\n ConnectedMoveToFolder,\n type ConnectedMoveToFolderProps,\n} from './move/ConnectedMoveToFolder'\nexport {\n ConnectedTagForm,\n type ConnectedTagFormProps,\n type TagCreateData,\n type TagFormat,\n type TagUpdateData,\n} from './fields/ConnectedTagForm'\nexport {\n ConnectedTagEditorDialog,\n type ConnectedTagEditorDialogProps,\n} from './fields/ConnectedTagEditorDialog'\nexport {\n ConnectedFieldsEditor,\n type ConnectedFieldsEditorProps,\n type FieldsExportSlot,\n} from './fields/ConnectedFieldsEditor'\nexport {\n ConnectedFieldsManager,\n type ConnectedFieldsManagerProps,\n} from './fields/ConnectedFieldsManager'\nexport {\n ConnectedFieldsManagerPanel,\n type ConnectedFieldsManagerPanelProps,\n} from './fields/ConnectedFieldsManagerPanel'\nexport { FIELDS_MANAGER_PANEL, openFieldsManagerIn } from './fields/fields-manager-panel'\nexport { type AppliedAiFields, type FieldsTarget } from './fields/useFieldsApply'\nexport {\n ConnectedBulkTagEditor,\n type ConnectedBulkTagEditorProps,\n} from './fields/ConnectedBulkTagEditor'\nexport {\n documentFieldContent,\n type DocTagCitations,\n type DocumentFieldContent,\n type DocumentFieldOptions,\n} from './fields/documentField'\nexport { DocumentUser } from './fields/DocumentUser'\nexport { useMemberLookup } from './fields/useMemberLookup'\nexport { useFilesGridStates, type FilesViewMode } from './store'\nexport {\n DocumentsFilterBarActions,\n type DocumentsFilterBarActionsProps,\n} from './page/DocumentsFilterBarActions'\nexport {\n DocumentsUploadButton,\n type DocumentsUploadButtonProps,\n} from './page/DocumentsUploadButton'\nexport { PersistedGridView } from './page/PersistedGridView'\nexport { ProgressiveLoadingChip } from './page/ProgressiveLoadingChip'\nexport { useDocumentNavigation } from './page/useDocumentNavigation'\nexport { ViewSelector, type LoadableTableView } from './views/ViewSelector'\nexport { toGridView, toSpec, useTableViews, type TableViewTable } from './views/useTableViews'\nexport { useFilesDialogs, type DeleteRequestDocument } from './store'\nexport {\n ConnectedFilesPage,\n type ConnectedFilesPageProps,\n type FilesViewerOptions,\n type FilesReviewCardProps,\n type FilesUploadRequest,\n} from './page/ConnectedFilesPage'\n\nexport { ConnectedGridView } from './ConnectedGridView'\n\nexport {\n ConnectedAccountsImport,\n useHasAccountsImport,\n type ConnectedAccountsImportProps,\n} from './imports/ConnectedAccountsImport'\n\nexport {\n ConnectedDocumentProcessingPanel,\n type ConnectedDocumentProcessingPanelProps,\n} from './processing/ConnectedDocumentProcessingPanel'\nexport {\n ConnectedProcessingPanel,\n type ConnectedProcessingPanelProps,\n} from './processing/ConnectedProcessingPanel'\nexport {\n ConnectedProcessingStatus,\n type ConnectedProcessingStatusProps,\n} from './processing/ConnectedProcessingStatus'\nexport {\n useProcessingCounts,\n useProcessingPulse,\n type ProcessingPulse,\n} from './processing/useProcessingPulse'\n"],
|
|
5
|
+
"mappings": ";AAEA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAGK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAGK;AACP,SAAS,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vE,SAAS,uBAAmD;AAC5D;AAAA,EACE;AAAA,OAKK;AAEP,SAAS,yBAAyB;AAElC;AAAA,EACE;AAAA,EACA;AAAA,OAEK;AAEP;AAAA,EACE;AAAA,OAEK;AACP;AAAA,EACE;AAAA,OAEK;AACP;AAAA,EACE;AAAA,OAEK;AACP;AAAA,EACE;AAAA,EACA;AAAA,OAEK;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -10,8 +10,19 @@ function useAiReviewLiveUpdates() {
|
|
|
10
10
|
const docIds = message.doc_ext_ids ?? [];
|
|
11
11
|
if (!docIds.length) return;
|
|
12
12
|
void refreshDocuments(docIds).then(() => useAiReviewStore.getState().markFinished(docIds));
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
dropQueuedRows(docIds);
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
function dropQueuedRows(docIds) {
|
|
17
|
+
useArbiWsStore.setState((state) => {
|
|
18
|
+
const queued = docIds.filter((id) => {
|
|
19
|
+
const task = state.tasks[id];
|
|
20
|
+
return task && task.seq == null;
|
|
21
|
+
});
|
|
22
|
+
if (!queued.length) return state;
|
|
23
|
+
const tasks = { ...state.tasks };
|
|
24
|
+
for (const id of queued) delete tasks[id];
|
|
25
|
+
return { tasks };
|
|
15
26
|
});
|
|
16
27
|
}
|
|
17
28
|
export {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/connection/files/review/useAiReviewLiveUpdates.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * AI fields finishing, live: a `doctag_generate` batch names the documents the server finished\n * (with or without a value for every field). Their fresh values are read into the list, then the\n * open AI review marks them finished (a cell that got no value says so instead of spinning), and\n * the \"queued\" rows set when the run started leave the processing views. Mount once, under the\n * shared `ArbiWebSocketProvider`.\n */\n\nimport { isMessageType, type WsBatchCompleteMessage } from '@arbidocs/client'\nimport { useArbiWebSocket, useArbiWsStore, useRefreshDocuments } from '@arbidocs/react'\nimport { useAiReviewStore } from '../store'\n\nexport function useAiReviewLiveUpdates(): void {\n const refreshDocuments = useRefreshDocuments()\n useArbiWebSocket((message) => {\n if (!isMessageType<WsBatchCompleteMessage>(message, 'batch_complete')) return\n if (message.batch_type !== 'doctag_generate') return\n const docIds = message.doc_ext_ids ?? []\n if (!docIds.length) return\n void refreshDocuments(docIds).then(() => useAiReviewStore.getState().markFinished(docIds))\n
|
|
5
|
-
"mappings": ";AAQA,SAAS,qBAAkD;AAC3D,SAAS,kBAAkB,gBAAgB,2BAA2B;AACtE,SAAS,wBAAwB;AAE1B,SAAS,yBAA+B;AAC7C,QAAM,mBAAmB,oBAAoB;AAC7C,mBAAiB,CAAC,YAAY;AAC5B,QAAI,CAAC,cAAsC,SAAS,gBAAgB,EAAG;AACvE,QAAI,QAAQ,eAAe,kBAAmB;AAC9C,UAAM,SAAS,QAAQ,eAAe,CAAC;AACvC,QAAI,CAAC,OAAO,OAAQ;AACpB,SAAK,iBAAiB,MAAM,EAAE,KAAK,MAAM,iBAAiB,SAAS,EAAE,aAAa,MAAM,CAAC;AACzF,
|
|
4
|
+
"sourcesContent": ["/**\n * AI fields finishing, live: a `doctag_generate` batch names the documents the server finished\n * (with or without a value for every field). Their fresh values are read into the list, then the\n * open AI review marks them finished (a cell that got no value says so instead of spinning), and\n * the \"queued\" rows set when the run started leave the processing views. Mount once, under the\n * shared `ArbiWebSocketProvider`.\n */\n\nimport { isMessageType, type WsBatchCompleteMessage } from '@arbidocs/client'\nimport { useArbiWebSocket, useArbiWsStore, useRefreshDocuments } from '@arbidocs/react'\nimport { useAiReviewStore } from '../store'\n\nexport function useAiReviewLiveUpdates(): void {\n const refreshDocuments = useRefreshDocuments()\n useArbiWebSocket((message) => {\n if (!isMessageType<WsBatchCompleteMessage>(message, 'batch_complete')) return\n if (message.batch_type !== 'doctag_generate') return\n const docIds = message.doc_ext_ids ?? []\n if (!docIds.length) return\n void refreshDocuments(docIds).then(() => useAiReviewStore.getState().markFinished(docIds))\n dropQueuedRows(docIds)\n })\n}\n\n/**\n * Drop the \"queued\" rows the run set (`useGenerateDocTags`: no `seq`, never a server event). A row\n * the server's own events keep (a new upload, whose batch can name it while it is still being\n * indexed) stays, and its later events are still heard: its \"completed\" is what re-reads it.\n */\nfunction dropQueuedRows(docIds: string[]): void {\n useArbiWsStore.setState((state) => {\n const queued = docIds.filter((id) => {\n const task = state.tasks[id]\n return task && task.seq == null\n })\n if (!queued.length) return state\n const tasks = { ...state.tasks }\n for (const id of queued) delete tasks[id]\n return { tasks }\n })\n}\n"],
|
|
5
|
+
"mappings": ";AAQA,SAAS,qBAAkD;AAC3D,SAAS,kBAAkB,gBAAgB,2BAA2B;AACtE,SAAS,wBAAwB;AAE1B,SAAS,yBAA+B;AAC7C,QAAM,mBAAmB,oBAAoB;AAC7C,mBAAiB,CAAC,YAAY;AAC5B,QAAI,CAAC,cAAsC,SAAS,gBAAgB,EAAG;AACvE,QAAI,QAAQ,eAAe,kBAAmB;AAC9C,UAAM,SAAS,QAAQ,eAAe,CAAC;AACvC,QAAI,CAAC,OAAO,OAAQ;AACpB,SAAK,iBAAiB,MAAM,EAAE,KAAK,MAAM,iBAAiB,SAAS,EAAE,aAAa,MAAM,CAAC;AACzF,mBAAe,MAAM;AAAA,EACvB,CAAC;AACH;AAOA,SAAS,eAAe,QAAwB;AAC9C,iBAAe,SAAS,CAAC,UAAU;AACjC,UAAM,SAAS,OAAO,OAAO,CAAC,OAAO;AACnC,YAAM,OAAO,MAAM,MAAM,EAAE;AAC3B,aAAO,QAAQ,KAAK,OAAO;AAAA,IAC7B,CAAC;AACD,QAAI,CAAC,OAAO,OAAQ,QAAO;AAC3B,UAAM,QAAQ,EAAE,GAAG,MAAM,MAAM;AAC/B,eAAW,MAAM,OAAQ,QAAO,MAAM,EAAE;AACxC,WAAO,EAAE,MAAM;AAAA,EACjB,CAAC;AACH;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
|
-
import { useMemo
|
|
3
|
+
import { useMemo } from "react";
|
|
4
4
|
import { Table, Columns3, Mail } from "lucide-react";
|
|
5
5
|
import { ViewSelectorMenu } from "../../../files/views/ViewSelectorMenu.js";
|
|
6
6
|
import { useGridViews } from "../../../files/views/useGridViews.js";
|
|
7
7
|
import { DOCUMENTS_ROW_HEIGHT_INITIAL, EMAIL_VIEW_COLUMNS } from "../../../files/documentColumns.js";
|
|
8
|
-
import { useBlocksEnvironment } from "../../../provider/environment.js";
|
|
9
8
|
import { useTableViews } from "./useTableViews.js";
|
|
9
|
+
import { useViewWrites } from "./useViewWrites.js";
|
|
10
10
|
const DOCUMENT_VIEW_PINNED = ["ag-Grid-SelectionColumn", "title"];
|
|
11
11
|
function ViewSelector({
|
|
12
12
|
getGridApi,
|
|
@@ -18,8 +18,7 @@ function ViewSelector({
|
|
|
18
18
|
defaultTileSize,
|
|
19
19
|
stateVersion
|
|
20
20
|
}) {
|
|
21
|
-
const {
|
|
22
|
-
const { savedViews, workspaceId, saveView, deleteView, isSaving } = useTableViews(null);
|
|
21
|
+
const { savedViews, saveView, deleteView, shareView, isSaving } = useTableViews(null);
|
|
23
22
|
const builtins = useMemo(
|
|
24
23
|
() => [
|
|
25
24
|
{
|
|
@@ -53,23 +52,11 @@ function ViewSelector({
|
|
|
53
52
|
],
|
|
54
53
|
[defaultColumns]
|
|
55
54
|
);
|
|
56
|
-
const onSaveView =
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
[saveView, notify]
|
|
62
|
-
);
|
|
63
|
-
const onDeleteView = useCallback(
|
|
64
|
-
async (name) => {
|
|
65
|
-
if (!workspaceId) return false;
|
|
66
|
-
if (!await confirm({ message: `Delete view "${name}"?`, title: "Delete View" }))
|
|
67
|
-
return false;
|
|
68
|
-
await deleteView(name);
|
|
69
|
-
notify(`Deleted view "${name}"`, "success");
|
|
70
|
-
return true;
|
|
71
|
-
},
|
|
72
|
-
[confirm, workspaceId, deleteView, notify]
|
|
55
|
+
const { onSaveView, onDeleteView, onShareView } = useViewWrites(
|
|
56
|
+
savedViews,
|
|
57
|
+
saveView,
|
|
58
|
+
deleteView,
|
|
59
|
+
shareView
|
|
73
60
|
);
|
|
74
61
|
const menu = useGridViews({
|
|
75
62
|
getGridApi,
|
|
@@ -84,6 +71,7 @@ function ViewSelector({
|
|
|
84
71
|
onLoadView,
|
|
85
72
|
onSaveView,
|
|
86
73
|
onDeleteView,
|
|
74
|
+
onShareView,
|
|
87
75
|
isSaving
|
|
88
76
|
});
|
|
89
77
|
return /* @__PURE__ */ jsx(ViewSelectorMenu, { ...menu });
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/connection/files/views/ViewSelector.tsx"],
|
|
4
|
-
"sourcesContent": ["/**\n * ViewSelector: data binding for the saved-views popover (UI lives in\n * `@arbidocs/blocks` `ViewSelectorMenu`).\n *\n * Lives in the Documents page TabHeader. Derives the active view from the actual grid column\n * state.\n */\n\nimport { useMemo
|
|
5
|
-
"mappings": ";
|
|
4
|
+
"sourcesContent": ["/**\n * ViewSelector: data binding for the saved-views popover (UI lives in\n * `@arbidocs/blocks` `ViewSelectorMenu`).\n *\n * Lives in the Documents page TabHeader. Derives the active view from the actual grid column\n * state.\n */\n\nimport { useMemo } from 'react'\nimport { Table, Columns3, Mail } from 'lucide-react'\nimport type { GridApi } from 'ag-grid-community'\nimport { ViewSelectorMenu } from '../../../files/views/ViewSelectorMenu'\nimport { useGridViews, type GridBuiltinView } from '../../../files/views/useGridViews'\nimport type { SavedGridView } from '../../../files/views/gridViews'\nimport { DOCUMENTS_ROW_HEIGHT_INITIAL, EMAIL_VIEW_COLUMNS } from '../../../files/documentColumns'\nimport type { GridDocument as Doc } from '../grid/documentColumns'\nimport { useTableViews } from './useTableViews'\nimport { useViewWrites } from './useViewWrites'\n\n/** A view as loaded: a saved TableView, or a built-in carrying its pin instruction\n * (`pinned_left`: which columns to pin left; [] = unpin everything). Saved views never\n * carry it (the schema doesn't store pinning), so loading them leaves pins alone. */\nexport type LoadableTableView = SavedGridView\n\n/** Columns the built-in \"Document view\" keeps fixed while scrolling. */\nconst DOCUMENT_VIEW_PINNED = ['ag-Grid-SelectionColumn', 'title']\n\ninterface ViewSelectorProps {\n getGridApi: () => GridApi<Doc> | null\n defaultColumns: string[]\n /** Live column toggle (visibility/order only) \u2014 does not touch zoom/row height. */\n onApplyView: (columns: string[], gridApi: GridApi<Doc>) => void\n /** Restore a full saved view: columns + widths + Gallery zoom + row height\n * (+ pinning, for built-ins that specify it). */\n onLoadView: (view: LoadableTableView, gridApi: GridApi<Doc>) => void\n /** Current Gallery tile size + table row height, captured when saving a view. */\n currentTileSize: number\n currentRowHeight: number\n /** Baseline for the built-in Default view, so deviations flip to \"Unsaved\".\n * (Row-height baselines live on the built-in views themselves.) */\n defaultTileSize: number\n /** Changes whenever the grid's saved state does: the current view is recomputed. */\n stateVersion: unknown\n}\n\nexport function ViewSelector({\n getGridApi,\n defaultColumns,\n onApplyView,\n onLoadView,\n currentTileSize,\n currentRowHeight,\n defaultTileSize,\n stateVersion,\n}: ViewSelectorProps) {\n // The documents table's views: those with no `table` (a database's views carry its id).\n const { savedViews, saveView, deleteView, shareView, isSaving } = useTableViews(null)\n\n // Built-in views: keyed by stable ids ('default', 'email-default') that never\n // change even if the display labels do \u2014 users' layouts keep matching.\n const builtins = useMemo<GridBuiltinView[]>(\n () => [\n {\n key: 'default',\n label: 'Default view',\n columns: defaultColumns,\n icon: Table,\n // Both built-ins load at the minimal (compact) row height.\n rowHeight: DOCUMENTS_ROW_HEIGHT_INITIAL,\n // [] = loading this view unpins everything.\n pinnedLeft: [],\n },\n {\n key: 'document',\n label: 'Document view',\n // Same columns as Default view \u2014 differs only in pinning: the\n // batch-select checkbox and Title stay fixed left while scrolling.\n columns: defaultColumns,\n icon: Columns3,\n rowHeight: DOCUMENTS_ROW_HEIGHT_INITIAL,\n pinnedLeft: DOCUMENT_VIEW_PINNED,\n },\n {\n key: 'email-default',\n label: 'Email view',\n columns: [...EMAIL_VIEW_COLUMNS],\n icon: Mail,\n rowHeight: DOCUMENTS_ROW_HEIGHT_INITIAL,\n pinnedLeft: [],\n },\n ],\n [defaultColumns]\n )\n\n const { onSaveView, onDeleteView, onShareView } = useViewWrites(\n savedViews,\n saveView,\n deleteView,\n shareView\n )\n\n const menu = useGridViews<Doc, SavedGridView>({\n getGridApi,\n defaultColumns,\n builtins,\n savedViews,\n stateVersion,\n currentRowHeight,\n currentTileSize,\n defaultTileSize,\n onApplyColumns: onApplyView,\n onLoadView,\n onSaveView,\n onDeleteView,\n onShareView,\n isSaving,\n })\n\n return <ViewSelectorMenu {...menu} />\n}\n"],
|
|
5
|
+
"mappings": ";AAsHS;AA9GT,SAAS,eAAe;AACxB,SAAS,OAAO,UAAU,YAAY;AAEtC,SAAS,wBAAwB;AACjC,SAAS,oBAA0C;AAEnD,SAAS,8BAA8B,0BAA0B;AAEjE,SAAS,qBAAqB;AAC9B,SAAS,qBAAqB;AAQ9B,MAAM,uBAAuB,CAAC,2BAA2B,OAAO;AAoBzD,SAAS,aAAa;AAAA,EAC3B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAsB;AAEpB,QAAM,EAAE,YAAY,UAAU,YAAY,WAAW,SAAS,IAAI,cAAc,IAAI;AAIpF,QAAM,WAAW;AAAA,IACf,MAAM;AAAA,MACJ;AAAA,QACE,KAAK;AAAA,QACL,OAAO;AAAA,QACP,SAAS;AAAA,QACT,MAAM;AAAA;AAAA,QAEN,WAAW;AAAA;AAAA,QAEX,YAAY,CAAC;AAAA,MACf;AAAA,MACA;AAAA,QACE,KAAK;AAAA,QACL,OAAO;AAAA;AAAA;AAAA,QAGP,SAAS;AAAA,QACT,MAAM;AAAA,QACN,WAAW;AAAA,QACX,YAAY;AAAA,MACd;AAAA,MACA;AAAA,QACE,KAAK;AAAA,QACL,OAAO;AAAA,QACP,SAAS,CAAC,GAAG,kBAAkB;AAAA,QAC/B,MAAM;AAAA,QACN,WAAW;AAAA,QACX,YAAY,CAAC;AAAA,MACf;AAAA,IACF;AAAA,IACA,CAAC,cAAc;AAAA,EACjB;AAEA,QAAM,EAAE,YAAY,cAAc,YAAY,IAAI;AAAA,IAChD;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAEA,QAAM,OAAO,aAAiC;AAAA,IAC5C;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,gBAAgB;AAAA,IAChB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AAED,SAAO,oBAAC,oBAAkB,GAAG,MAAM;AACrC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,22 +1,30 @@
|
|
|
1
|
+
import { type TableViewRecord, type TableViewSpec, type TableViewTable } from '@arbidocs/react';
|
|
1
2
|
import type { SavedGridView } from '../../../files/views/gridViews';
|
|
2
|
-
|
|
3
|
+
export type { TableViewTable };
|
|
4
|
+
/** A saved view as the grid's views menu takes it. */
|
|
5
|
+
export declare function toGridView(record: TableViewRecord): SavedGridView;
|
|
6
|
+
/** The API's spec of a grid view. */
|
|
7
|
+
export declare function toSpec(view: SavedGridView): TableViewSpec;
|
|
3
8
|
export declare function useTableViews(table: TableViewTable): {
|
|
4
|
-
savedViews:
|
|
5
|
-
|
|
6
|
-
table?: string | null;
|
|
7
|
-
name: string;
|
|
8
|
-
columns: string[];
|
|
9
|
-
column_widths?: {
|
|
10
|
-
[key: string]: number;
|
|
11
|
-
} | null;
|
|
12
|
-
tile_size?: number | null;
|
|
13
|
-
row_height?: number | null;
|
|
14
|
-
}[];
|
|
15
|
-
/** Settings and workspace are known: views can be written without losing any. */
|
|
9
|
+
savedViews: SavedGridView[];
|
|
10
|
+
/** The views are read: views can be written without adding one twice. */
|
|
16
11
|
ready: boolean;
|
|
17
|
-
workspaceId: string | null;
|
|
18
12
|
saveView: (view: SavedGridView) => Promise<void>;
|
|
19
|
-
deleteView: (
|
|
13
|
+
deleteView: (key: string) => Promise<void>;
|
|
14
|
+
shareView: (key: string) => Promise<{
|
|
15
|
+
id: string;
|
|
16
|
+
workspace_id: string;
|
|
17
|
+
target: string;
|
|
18
|
+
shared: boolean;
|
|
19
|
+
spec: import("@arbidocs/client").components["schemas"]["TableViewSpec"];
|
|
20
|
+
mine: boolean;
|
|
21
|
+
editable: boolean;
|
|
22
|
+
can_delete: boolean;
|
|
23
|
+
created_by?: string | null;
|
|
24
|
+
updated_by?: string | null;
|
|
25
|
+
created_at: string;
|
|
26
|
+
updated_at: string;
|
|
27
|
+
}>;
|
|
20
28
|
importViews: (views: SavedGridView[]) => Promise<void>;
|
|
21
29
|
isSaving: boolean;
|
|
22
30
|
};
|
|
@@ -1,58 +1,84 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { useCallback, useMemo } from "react";
|
|
3
|
-
import { useUpdateUserSettings, useUserSettings } from "@arbidocs/react";
|
|
4
|
-
import { useConnectedWorkspace } from "../../ConnectionProvider.js";
|
|
5
3
|
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
4
|
+
useCreateTableView,
|
|
5
|
+
useDeleteTableView,
|
|
6
|
+
useShareTableView,
|
|
7
|
+
useTableViewsQuery,
|
|
8
|
+
useUpdateTableView
|
|
9
|
+
} from "@arbidocs/react";
|
|
10
|
+
function toGridView(record) {
|
|
11
|
+
const { spec } = record;
|
|
12
|
+
return {
|
|
13
|
+
id: record.id,
|
|
14
|
+
name: spec.name,
|
|
15
|
+
columns: spec.columns ?? [],
|
|
16
|
+
column_widths: spec.column_widths ?? null,
|
|
17
|
+
tile_size: spec.tile_size ?? null,
|
|
18
|
+
row_height: spec.row_height ?? null,
|
|
19
|
+
filters: spec.filters ?? [],
|
|
20
|
+
sort: spec.sort ?? null,
|
|
21
|
+
descending: spec.descending ?? false,
|
|
22
|
+
shared: record.shared,
|
|
23
|
+
mine: record.mine,
|
|
24
|
+
can_delete: record.can_delete
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
function toSpec(view) {
|
|
28
|
+
return {
|
|
29
|
+
name: view.name,
|
|
30
|
+
columns: view.columns,
|
|
31
|
+
column_widths: view.column_widths ?? null,
|
|
32
|
+
tile_size: view.tile_size ?? null,
|
|
33
|
+
row_height: view.row_height ?? null,
|
|
34
|
+
filters: view.filters ?? [],
|
|
35
|
+
sort: view.sort ?? null,
|
|
36
|
+
descending: !!view.descending
|
|
37
|
+
};
|
|
38
|
+
}
|
|
11
39
|
function useTableViews(table) {
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
(resolve, reject) => updateUserSettings.mutate({ tableviews }, { onSuccess: () => resolve(), onError: reject })
|
|
20
|
-
),
|
|
21
|
-
[updateUserSettings]
|
|
22
|
-
);
|
|
40
|
+
const query = useTableViewsQuery(table);
|
|
41
|
+
const create = useCreateTableView();
|
|
42
|
+
const update = useUpdateTableView();
|
|
43
|
+
const share = useShareTableView();
|
|
44
|
+
const remove = useDeleteTableView();
|
|
45
|
+
const records = query.data;
|
|
46
|
+
const savedViews = useMemo(() => (records ?? []).map(toGridView), [records]);
|
|
23
47
|
const saveView = useCallback(
|
|
24
48
|
async (view) => {
|
|
25
|
-
|
|
26
|
-
await
|
|
27
|
-
|
|
28
|
-
[workspaceId, all, table, writeViews]
|
|
29
|
-
);
|
|
30
|
-
const deleteView = useCallback(
|
|
31
|
-
async (name) => {
|
|
32
|
-
if (!workspaceId) throw new Error("No workspace");
|
|
33
|
-
await writeViews(withoutTableView(all, name, workspaceId, table));
|
|
49
|
+
const own = (records ?? []).find((r) => r.mine && r.spec.name === view.name);
|
|
50
|
+
if (own) await update.mutateAsync({ viewId: own.id, spec: toSpec(view) });
|
|
51
|
+
else await create.mutateAsync({ table, spec: toSpec(view) });
|
|
34
52
|
},
|
|
35
|
-
[
|
|
53
|
+
[records, table, create, update]
|
|
36
54
|
);
|
|
55
|
+
const deleteView = useCallback((key) => remove.mutateAsync(key), [remove]);
|
|
56
|
+
const shareView = useCallback((key) => share.mutateAsync(key), [share]);
|
|
37
57
|
const importViews = useCallback(
|
|
38
58
|
async (views) => {
|
|
39
|
-
|
|
40
|
-
|
|
59
|
+
const taken = new Set((records ?? []).filter((r) => r.mine).map((r) => r.spec.name));
|
|
60
|
+
for (const view of views) {
|
|
61
|
+
if (taken.has(view.name)) continue;
|
|
62
|
+
taken.add(view.name);
|
|
63
|
+
await create.mutateAsync({ table, spec: toSpec(view) });
|
|
64
|
+
}
|
|
41
65
|
},
|
|
42
|
-
[
|
|
66
|
+
[records, table, create]
|
|
43
67
|
);
|
|
44
68
|
return {
|
|
45
69
|
savedViews,
|
|
46
|
-
/**
|
|
47
|
-
ready:
|
|
48
|
-
workspaceId,
|
|
70
|
+
/** The views are read: views can be written without adding one twice. */
|
|
71
|
+
ready: query.isSuccess,
|
|
49
72
|
saveView,
|
|
50
73
|
deleteView,
|
|
74
|
+
shareView,
|
|
51
75
|
importViews,
|
|
52
|
-
isSaving:
|
|
76
|
+
isSaving: create.isPending || update.isPending
|
|
53
77
|
};
|
|
54
78
|
}
|
|
55
79
|
export {
|
|
80
|
+
toGridView,
|
|
81
|
+
toSpec,
|
|
56
82
|
useTableViews
|
|
57
83
|
};
|
|
58
84
|
//# sourceMappingURL=useTableViews.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/connection/files/views/useTableViews.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * useTableViews: one table's saved views
|
|
5
|
-
"mappings": ";
|
|
4
|
+
"sourcesContent": ["/**\n * useTableViews: one table's saved views (`/v1/views`) \u2014 the documents table's (`table: null`) or\n * a database grid's (`table: 'dbs-\u2026'`): the caller's own (private or shared) and the workspace's\n * shared ones, as the grid's views menu takes them. Saving under a name the caller already has\n * for this table replaces that view; a new one is private until shared (one way).\n */\nimport { useCallback, useMemo } from 'react'\nimport {\n useCreateTableView,\n useDeleteTableView,\n useShareTableView,\n useTableViewsQuery,\n useUpdateTableView,\n type TableViewRecord,\n type TableViewSpec,\n type TableViewTable,\n} from '@arbidocs/react'\nimport type { SavedGridView, ViewFilter } from '../../../files/views/gridViews'\n\nexport type { TableViewTable }\n\n/** A saved view as the grid's views menu takes it. */\nexport function toGridView(record: TableViewRecord): SavedGridView {\n const { spec } = record\n return {\n id: record.id,\n name: spec.name,\n columns: spec.columns ?? [],\n column_widths: spec.column_widths ?? null,\n tile_size: spec.tile_size ?? null,\n row_height: spec.row_height ?? null,\n filters: (spec.filters ?? []) as ViewFilter[],\n sort: spec.sort ?? null,\n descending: spec.descending ?? false,\n shared: record.shared,\n mine: record.mine,\n can_delete: record.can_delete,\n }\n}\n\n/** The API's spec of a grid view. */\nexport function toSpec(view: SavedGridView): TableViewSpec {\n return {\n name: view.name,\n columns: view.columns,\n column_widths: view.column_widths ?? null,\n tile_size: view.tile_size ?? null,\n row_height: view.row_height ?? null,\n filters: (view.filters ?? []) as TableViewSpec['filters'],\n sort: view.sort ?? null,\n descending: !!view.descending,\n }\n}\n\nexport function useTableViews(table: TableViewTable) {\n const query = useTableViewsQuery(table)\n const create = useCreateTableView()\n const update = useUpdateTableView()\n const share = useShareTableView()\n const remove = useDeleteTableView()\n const records = query.data\n\n const savedViews = useMemo(() => (records ?? []).map(toGridView), [records])\n\n /** Save a view: replaces the caller's own view of that name, else a new private view. */\n const saveView = useCallback(\n async (view: SavedGridView) => {\n const own = (records ?? []).find((r) => r.mine && r.spec.name === view.name)\n if (own) await update.mutateAsync({ viewId: own.id, spec: toSpec(view) })\n else await create.mutateAsync({ table, spec: toSpec(view) })\n },\n [records, table, create, update]\n )\n\n const deleteView = useCallback((key: string) => remove.mutateAsync(key), [remove])\n\n const shareView = useCallback((key: string) => share.mutateAsync(key), [share])\n\n /** Add views kept elsewhere (this browser) as private views, skipping names the caller has. */\n const importViews = useCallback(\n async (views: SavedGridView[]) => {\n const taken = new Set((records ?? []).filter((r) => r.mine).map((r) => r.spec.name))\n for (const view of views) {\n if (taken.has(view.name)) continue\n taken.add(view.name)\n await create.mutateAsync({ table, spec: toSpec(view) })\n }\n },\n [records, table, create]\n )\n\n return {\n savedViews,\n /** The views are read: views can be written without adding one twice. */\n ready: query.isSuccess,\n saveView,\n deleteView,\n shareView,\n importViews,\n isSaving: create.isPending || update.isPending,\n }\n}\n"],
|
|
5
|
+
"mappings": ";AAMA,SAAS,aAAa,eAAe;AACrC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAIK;AAMA,SAAS,WAAW,QAAwC;AACjE,QAAM,EAAE,KAAK,IAAI;AACjB,SAAO;AAAA,IACL,IAAI,OAAO;AAAA,IACX,MAAM,KAAK;AAAA,IACX,SAAS,KAAK,WAAW,CAAC;AAAA,IAC1B,eAAe,KAAK,iBAAiB;AAAA,IACrC,WAAW,KAAK,aAAa;AAAA,IAC7B,YAAY,KAAK,cAAc;AAAA,IAC/B,SAAU,KAAK,WAAW,CAAC;AAAA,IAC3B,MAAM,KAAK,QAAQ;AAAA,IACnB,YAAY,KAAK,cAAc;AAAA,IAC/B,QAAQ,OAAO;AAAA,IACf,MAAM,OAAO;AAAA,IACb,YAAY,OAAO;AAAA,EACrB;AACF;AAGO,SAAS,OAAO,MAAoC;AACzD,SAAO;AAAA,IACL,MAAM,KAAK;AAAA,IACX,SAAS,KAAK;AAAA,IACd,eAAe,KAAK,iBAAiB;AAAA,IACrC,WAAW,KAAK,aAAa;AAAA,IAC7B,YAAY,KAAK,cAAc;AAAA,IAC/B,SAAU,KAAK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AI,EAAE,CAAC;AAAA,MACxD;AAAA,IACF;AAAA,IACA,CAAC,SAAS,OAAO,MAAM;AAAA,EACzB;AAEA,SAAO;AAAA,IACL;AAAA;AAAA,IAEA,OAAO,MAAM;AAAA,IACb;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,UAAU,OAAO,aAAa,OAAO;AAAA,EACvC;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type SavedGridView } from '../../../files/views/gridViews';
|
|
2
|
+
export declare function useViewWrites(savedViews: SavedGridView[], saveView: (view: SavedGridView) => Promise<unknown>, deleteView: (key: string) => Promise<unknown>, shareView: (key: string) => Promise<unknown>): {
|
|
3
|
+
onSaveView: (view: SavedGridView) => Promise<void>;
|
|
4
|
+
onDeleteView: (key: string) => Promise<boolean>;
|
|
5
|
+
onShareView: (key: string) => Promise<void>;
|
|
6
|
+
};
|