@arbidocs/blocks 0.3.184 → 0.4.0
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 +100 -0
- package/dist/agents/approvals/AuthorizeAgentParts.d.ts +79 -0
- package/dist/agents/approvals/ConsentPage.d.ts +76 -0
- package/dist/agents/approvals/ConsentParts.d.ts +37 -0
- package/dist/agents/approvals/index.d.ts +3 -0
- package/dist/agents/config/ConfigField.d.ts +43 -0
- package/dist/agents/config/ConfigForm.d.ts +35 -0
- package/dist/agents/config/TupleArrayField.d.ts +32 -0
- package/dist/agents/config/index.d.ts +4 -0
- package/dist/agents/config/schema-utils.d.ts +28 -0
- package/dist/agents/definitions/AgentCard.d.ts +63 -0
- package/dist/agents/definitions/AgentCreator.d.ts +118 -0
- package/dist/agents/definitions/AgentEditorParts.d.ts +63 -0
- package/dist/agents/definitions/AgentGallery.d.ts +29 -0
- package/dist/agents/definitions/index.d.ts +4 -0
- package/dist/agents/index.cjs +595 -0
- package/dist/agents/index.cjs.map +1 -0
- package/dist/agents/index.d.ts +7 -0
- package/dist/agents/index.js +14 -0
- package/dist/agents/index.js.map +1 -0
- package/dist/agents/runs/AgentBar.d.ts +103 -0
- package/dist/agents/runs/AgentSteps.d.ts +157 -0
- package/dist/agents/runs/SubagentRoster.d.ts +37 -0
- package/dist/agents/runs/index.d.ts +3 -0
- package/dist/agents/skills/SkillBrowserParts.d.ts +70 -0
- package/dist/agents/skills/SkillCard.d.ts +48 -0
- package/dist/agents/skills/SkillForms.d.ts +64 -0
- package/dist/agents/skills/SkillParts.d.ts +31 -0
- package/dist/agents/skills/SkillRow.d.ts +34 -0
- package/dist/agents/skills/index.d.ts +5 -0
- package/dist/agents/tasks/LiveRunsBanner.d.ts +26 -0
- package/dist/agents/tasks/RecurrenceBuilder.d.ts +36 -0
- package/dist/agents/tasks/TaskComposer.d.ts +108 -0
- package/dist/agents/tasks/TaskPlan.d.ts +78 -0
- package/dist/agents/tasks/TaskRowActions.d.ts +43 -0
- package/dist/agents/tasks/TaskRunsDialog.d.ts +45 -0
- package/dist/agents/tasks/TasksChrome.d.ts +36 -0
- package/dist/agents/tasks/UploadTaskItem.d.ts +39 -0
- package/dist/agents/tasks/UploadTaskList.d.ts +35 -0
- package/dist/agents/tasks/elapsed.d.ts +2 -0
- package/dist/agents/tasks/index.d.ts +13 -0
- package/dist/agents/tasks/rrule.d.ts +36 -0
- package/dist/agents/tasks/taskColumns.d.ts +68 -0
- package/dist/agents/tasks/taskLabels.d.ts +26 -0
- package/dist/agents/workflows/AgentSelect.d.ts +33 -0
- package/dist/agents/workflows/SchemaForm.d.ts +37 -0
- package/dist/agents/workflows/WorkflowConfigDialog.d.ts +73 -0
- package/dist/agents/workflows/WorkflowLauncher.d.ts +38 -0
- package/dist/agents/workflows/index.d.ts +6 -0
- package/dist/agents/workflows/types.d.ts +125 -0
- package/dist/agents/workflows/workflow.d.ts +62 -0
- package/dist/auth/AuthFooter.d.ts +56 -0
- package/dist/auth/AuthForm.d.ts +105 -0
- package/dist/auth/AuthLayout.d.ts +46 -0
- package/dist/auth/PasswordStrengthInput.d.ts +44 -0
- package/dist/auth/RecoveryDialogs.d.ts +90 -0
- package/dist/auth/SsoLoginButton.d.ts +19 -0
- package/dist/auth/index.cjs +123 -0
- package/dist/auth/index.cjs.map +1 -0
- package/dist/auth/index.d.ts +6 -0
- package/dist/auth/index.js +6 -0
- package/dist/auth/index.js.map +1 -0
- package/dist/builder/AgentsPanel.d.ts +9 -0
- package/dist/builder/ModuleManager.d.ts +6 -0
- package/dist/builder/VerticalBuilder.d.ts +32 -0
- package/dist/builder/agents/store.d.ts +21 -0
- package/dist/builder/export.d.ts +30 -0
- package/dist/builder/modules/registry.d.ts +11 -0
- package/dist/builder/modules/store.d.ts +29 -0
- package/dist/builder/modules/types.d.ts +29 -0
- package/dist/builder/types.d.ts +28 -0
- package/dist/chat/BranchControls.d.ts +33 -0
- package/dist/chat/Composer.d.ts +156 -0
- package/dist/chat/ContextChip.d.ts +19 -0
- package/dist/chat/ContextPanel.d.ts +108 -0
- package/dist/chat/ConversationEmpty.d.ts +53 -0
- package/dist/chat/ConversationLayout.d.ts +40 -0
- package/dist/chat/ConversationParts.d.ts +62 -0
- package/dist/chat/ConversationSearchView.d.ts +57 -0
- package/dist/chat/LabelPinRow.d.ts +30 -0
- package/dist/chat/Message.d.ts +189 -0
- package/dist/chat/MessageAlert.d.ts +25 -0
- package/dist/chat/MessageList.d.ts +102 -0
- package/dist/chat/ModelPicker.d.ts +103 -0
- package/dist/chat/PendingAnswerBar.d.ts +36 -0
- package/dist/chat/PinnedDocChip.d.ts +22 -0
- package/dist/chat/SlashMenu.d.ts +57 -0
- package/dist/chat/ThreadMap.d.ts +45 -0
- package/dist/chat/index.cjs +423 -0
- package/dist/chat/index.cjs.map +1 -0
- package/dist/chat/index.d.ts +21 -0
- package/dist/chat/index.js +6 -0
- package/dist/chat/index.js.map +1 -0
- package/dist/chat/test-id.d.ts +16 -0
- package/dist/chat/useStreamAnnouncement.d.ts +19 -0
- package/dist/chunk-223D4727.cjs +50 -0
- package/dist/chunk-223D4727.cjs.map +1 -0
- package/dist/chunk-4EZVCGRL.js +803 -0
- package/dist/chunk-4EZVCGRL.js.map +1 -0
- package/dist/chunk-54Q3RNJU.cjs +516 -0
- package/dist/chunk-54Q3RNJU.cjs.map +1 -0
- package/dist/chunk-5B4PXAKI.cjs +287 -0
- package/dist/chunk-5B4PXAKI.cjs.map +1 -0
- package/dist/chunk-5TYEJOXY.js +1762 -0
- package/dist/chunk-5TYEJOXY.js.map +1 -0
- package/dist/chunk-6ALISABK.cjs +677 -0
- package/dist/chunk-6ALISABK.cjs.map +1 -0
- package/dist/chunk-6HIPFEID.cjs +574 -0
- package/dist/chunk-6HIPFEID.cjs.map +1 -0
- package/dist/chunk-76JDDMSP.js +31 -0
- package/dist/chunk-76JDDMSP.js.map +1 -0
- package/dist/chunk-7F6CBP3Z.js +12 -0
- package/dist/chunk-7F6CBP3Z.js.map +1 -0
- package/dist/chunk-7G2LJMUG.cjs +45 -0
- package/dist/chunk-7G2LJMUG.cjs.map +1 -0
- package/dist/chunk-7G3JNSJB.cjs +1809 -0
- package/dist/chunk-7G3JNSJB.cjs.map +1 -0
- package/dist/chunk-A2YAC22G.js +93 -0
- package/dist/chunk-A2YAC22G.js.map +1 -0
- package/dist/chunk-ADOKTJHV.cjs +262 -0
- package/dist/chunk-ADOKTJHV.cjs.map +1 -0
- package/dist/chunk-AXIZ2MDV.js +751 -0
- package/dist/chunk-AXIZ2MDV.js.map +1 -0
- package/dist/chunk-AZQDNYH4.js +2865 -0
- package/dist/chunk-AZQDNYH4.js.map +1 -0
- package/dist/chunk-C54XEN5T.cjs +34 -0
- package/dist/chunk-C54XEN5T.cjs.map +1 -0
- package/dist/chunk-CQCC7LE7.js +210 -0
- package/dist/chunk-CQCC7LE7.js.map +1 -0
- package/dist/chunk-CRIKTUEU.cjs +47 -0
- package/dist/chunk-CRIKTUEU.cjs.map +1 -0
- package/dist/chunk-CTZ5745I.js +564 -0
- package/dist/chunk-CTZ5745I.js.map +1 -0
- package/dist/chunk-DPLRHEJZ.js +78 -0
- package/dist/chunk-DPLRHEJZ.js.map +1 -0
- package/dist/chunk-DVLEQURC.js +672 -0
- package/dist/chunk-DVLEQURC.js.map +1 -0
- package/dist/chunk-ELR74ME6.cjs +68 -0
- package/dist/chunk-ELR74ME6.cjs.map +1 -0
- package/dist/{chunk-DBAUZD7A.cjs → chunk-FZQJ2S6P.cjs} +244 -1123
- package/dist/chunk-FZQJ2S6P.cjs.map +1 -0
- package/dist/chunk-G3G7LZPM.cjs +205 -0
- package/dist/chunk-G3G7LZPM.cjs.map +1 -0
- package/dist/chunk-GDFWJ73C.cjs +2973 -0
- package/dist/chunk-GDFWJ73C.cjs.map +1 -0
- package/dist/chunk-ITGHMJOM.js +5528 -0
- package/dist/chunk-ITGHMJOM.js.map +1 -0
- package/dist/chunk-K4BGOPGG.js +79 -0
- package/dist/chunk-K4BGOPGG.js.map +1 -0
- package/dist/chunk-KUA3BCT2.cjs +272 -0
- package/dist/chunk-KUA3BCT2.cjs.map +1 -0
- package/dist/chunk-LGBAZD37.js +341 -0
- package/dist/chunk-LGBAZD37.js.map +1 -0
- package/dist/chunk-MHVNT4J3.cjs +15 -0
- package/dist/chunk-MHVNT4J3.cjs.map +1 -0
- package/dist/chunk-MMYCZRKT.cjs +168 -0
- package/dist/chunk-MMYCZRKT.cjs.map +1 -0
- package/dist/chunk-NBV56SGU.js +42 -0
- package/dist/chunk-NBV56SGU.js.map +1 -0
- package/dist/chunk-NPLYHR2E.js +13 -0
- package/dist/chunk-NPLYHR2E.js.map +1 -0
- package/dist/chunk-NUNKSZKU.js +203 -0
- package/dist/chunk-NUNKSZKU.js.map +1 -0
- package/dist/chunk-OB5F4577.cjs +40 -0
- package/dist/chunk-OB5F4577.cjs.map +1 -0
- package/dist/chunk-OUW6G4O2.cjs +96 -0
- package/dist/chunk-OUW6G4O2.cjs.map +1 -0
- package/dist/chunk-OVEQERPO.js +66 -0
- package/dist/chunk-OVEQERPO.js.map +1 -0
- package/dist/chunk-P6GHJSLR.js +34 -0
- package/dist/chunk-P6GHJSLR.js.map +1 -0
- package/dist/chunk-PCB2BPN3.cjs +41 -0
- package/dist/chunk-PCB2BPN3.cjs.map +1 -0
- package/dist/chunk-PPCATBOY.cjs +15 -0
- package/dist/chunk-PPCATBOY.cjs.map +1 -0
- package/dist/chunk-QN42OA5J.js +887 -0
- package/dist/chunk-QN42OA5J.js.map +1 -0
- package/dist/{chunk-FZ2S6VAZ.js → chunk-RBXZYNVB.js} +223 -1102
- package/dist/chunk-RBXZYNVB.js.map +1 -0
- package/dist/chunk-RC6VTY2H.js +47 -0
- package/dist/chunk-RC6VTY2H.js.map +1 -0
- package/dist/chunk-RFIBUWLF.cjs +232 -0
- package/dist/chunk-RFIBUWLF.cjs.map +1 -0
- package/dist/chunk-S5T7ZTX2.js +266 -0
- package/dist/chunk-S5T7ZTX2.js.map +1 -0
- package/dist/chunk-S7PSMMRG.js +38 -0
- package/dist/chunk-S7PSMMRG.js.map +1 -0
- package/dist/chunk-SCFYPAG6.cjs +18 -0
- package/dist/chunk-SCFYPAG6.cjs.map +1 -0
- package/dist/chunk-SYDHKKRZ.cjs +818 -0
- package/dist/chunk-SYDHKKRZ.cjs.map +1 -0
- package/dist/chunk-TX2ZICS7.js +139 -0
- package/dist/chunk-TX2ZICS7.js.map +1 -0
- package/dist/chunk-TYZUCAT7.js +787 -0
- package/dist/chunk-TYZUCAT7.js.map +1 -0
- package/dist/chunk-U2E3WT3J.js +45 -0
- package/dist/chunk-U2E3WT3J.js.map +1 -0
- package/dist/chunk-UBNVIIBT.js +284 -0
- package/dist/chunk-UBNVIIBT.js.map +1 -0
- package/dist/chunk-UFHMLHIR.cjs +66 -0
- package/dist/chunk-UFHMLHIR.cjs.map +1 -0
- package/dist/chunk-UJE32SST.js +39 -0
- package/dist/chunk-UJE32SST.js.map +1 -0
- package/dist/chunk-ULWRNGGE.cjs +146 -0
- package/dist/chunk-ULWRNGGE.cjs.map +1 -0
- package/dist/chunk-UTWX2X2A.js +165 -0
- package/dist/chunk-UTWX2X2A.js.map +1 -0
- package/dist/chunk-UWGIB3VQ.js +64 -0
- package/dist/chunk-UWGIB3VQ.js.map +1 -0
- package/dist/chunk-V4ISCZJ7.cjs +207 -0
- package/dist/chunk-V4ISCZJ7.cjs.map +1 -0
- package/dist/chunk-VFUWWH52.cjs +83 -0
- package/dist/chunk-VFUWWH52.cjs.map +1 -0
- package/dist/chunk-VILAPTCB.js +259 -0
- package/dist/chunk-VILAPTCB.js.map +1 -0
- package/dist/chunk-VLCY46K6.cjs +82 -0
- package/dist/chunk-VLCY46K6.cjs.map +1 -0
- package/dist/chunk-VPPX5XUF.cjs +813 -0
- package/dist/chunk-VPPX5XUF.cjs.map +1 -0
- package/dist/chunk-WJMEXTVD.cjs +122 -0
- package/dist/chunk-WJMEXTVD.cjs.map +1 -0
- package/dist/chunk-WTNMWEBC.js +504 -0
- package/dist/chunk-WTNMWEBC.js.map +1 -0
- package/dist/chunk-WW6EOVZA.js +112 -0
- package/dist/chunk-WW6EOVZA.js.map +1 -0
- package/dist/chunk-XNBAXRY7.cjs +5673 -0
- package/dist/chunk-XNBAXRY7.cjs.map +1 -0
- package/dist/chunk-XQ7PKKDY.cjs +787 -0
- package/dist/chunk-XQ7PKKDY.cjs.map +1 -0
- package/dist/chunk-XZIYRKLW.cjs +347 -0
- package/dist/chunk-XZIYRKLW.cjs.map +1 -0
- package/dist/chunk-YBXCZEWS.js +187 -0
- package/dist/chunk-YBXCZEWS.js.map +1 -0
- package/dist/chunk-YDHO4AVL.js +16 -0
- package/dist/chunk-YDHO4AVL.js.map +1 -0
- package/dist/chunk-ZORQ5M3W.cjs +934 -0
- package/dist/chunk-ZORQ5M3W.cjs.map +1 -0
- package/dist/chunk-ZW6FPIFC.cjs +36 -0
- package/dist/chunk-ZW6FPIFC.cjs.map +1 -0
- package/dist/citations/CitationEditor.d.ts +58 -0
- package/dist/citations/PassagePill.d.ts +49 -0
- package/dist/citations/QuietMarks.d.ts +81 -0
- package/dist/citations/index.cjs +47 -0
- package/dist/citations/index.cjs.map +1 -0
- package/dist/citations/index.d.ts +3 -0
- package/dist/citations/index.js +6 -0
- package/dist/citations/index.js.map +1 -0
- package/dist/collaboration/contacts/AddContactsParts.d.ts +46 -0
- package/dist/collaboration/contacts/index.d.ts +1 -0
- package/dist/collaboration/direct-messages/DirectMessages.d.ts +33 -0
- package/dist/collaboration/direct-messages/DmParts.d.ts +139 -0
- package/dist/collaboration/direct-messages/index.d.ts +2 -0
- package/dist/collaboration/index.cjs +141 -0
- package/dist/collaboration/index.cjs.map +1 -0
- package/dist/collaboration/index.d.ts +5 -0
- package/dist/collaboration/index.js +8 -0
- package/dist/collaboration/index.js.map +1 -0
- package/dist/collaboration/mail/MailFolderTree.d.ts +34 -0
- package/dist/collaboration/mail/index.d.ts +2 -0
- package/dist/collaboration/mail/mailFolders.d.ts +25 -0
- package/dist/collaboration/members/WorkspaceMembers.d.ts +74 -0
- package/dist/collaboration/members/index.d.ts +1 -0
- package/dist/collaboration/sharing/ShareControl.d.ts +38 -0
- package/dist/collaboration/sharing/index.d.ts +1 -0
- package/dist/components/Accordion.d.ts +12 -0
- package/dist/components/ActionLink.d.ts +18 -0
- package/dist/components/AskBar.d.ts +48 -0
- package/dist/components/AvatarBlock.d.ts +9 -0
- package/dist/components/Banner.d.ts +12 -0
- package/dist/components/BlockImage.d.ts +18 -0
- package/dist/components/CTABanner.d.ts +17 -0
- package/dist/components/Callout.d.ts +9 -0
- package/dist/components/Chart.d.ts +27 -0
- package/dist/components/CollectionDetail.d.ts +23 -0
- package/dist/components/Columns.d.ts +11 -0
- package/dist/components/ContactForm.d.ts +42 -0
- package/dist/components/Container.d.ts +11 -0
- package/dist/components/DataTable.d.ts +47 -0
- package/dist/components/DataTableBlock.d.ts +26 -0
- package/dist/components/EmptyState.d.ts +11 -0
- package/dist/components/EntityChip.d.ts +24 -0
- package/dist/components/EntityIdentityBar.d.ts +90 -0
- package/dist/components/EntityTooltip.d.ts +43 -0
- package/dist/components/FAQ.d.ts +14 -0
- package/dist/components/FeatureGrid.d.ts +18 -0
- package/dist/components/Footer.d.ts +25 -0
- package/dist/components/Gallery.d.ts +15 -0
- package/dist/components/Hero.d.ts +35 -0
- package/dist/components/ListBlock.d.ts +10 -0
- package/dist/components/LogoCloud.d.ts +12 -0
- package/dist/components/MediaText.d.ts +15 -0
- package/dist/components/MemberAvatarStack.d.ts +36 -0
- package/dist/components/MetricCard.d.ts +28 -0
- package/dist/components/Navbar.d.ts +39 -0
- package/dist/components/PageHeader.d.ts +15 -0
- package/dist/components/PricingTable.d.ts +19 -0
- package/dist/components/RichTextBlock.d.ts +10 -0
- package/dist/components/SectionHeading.d.ts +11 -0
- package/dist/components/Spacer.d.ts +7 -0
- package/dist/components/StatGroup.d.ts +12 -0
- package/dist/components/Steps.d.ts +12 -0
- package/dist/components/Tabs.d.ts +15 -0
- package/dist/components/TeamGrid.d.ts +18 -0
- package/dist/components/Testimonial.d.ts +9 -0
- package/dist/components/TestimonialGrid.d.ts +13 -0
- package/dist/components/ToneBadge.d.ts +18 -0
- package/dist/components/Toolbar.d.ts +11 -0
- package/dist/components/UsageMeter.d.ts +21 -0
- package/dist/components/VideoEmbed.d.ts +16 -0
- package/dist/components/assetImage.d.ts +16 -0
- package/dist/components/assetResolver.d.ts +57 -0
- package/dist/components/blockLink.d.ts +26 -0
- package/dist/components/tones.d.ts +14 -0
- package/dist/connect/index.cjs +65 -0
- package/dist/connect/index.cjs.map +1 -0
- package/dist/connect/index.d.ts +8 -0
- package/dist/connect/index.js +28 -0
- package/dist/connect/index.js.map +1 -0
- package/dist/connection/ArbiAppProvider.d.ts +16 -0
- package/dist/connection/ConnectionProvider.d.ts +50 -0
- package/dist/connection/ai.d.ts +99 -0
- package/dist/connection/types.d.ts +54 -0
- package/dist/connection/useImageGen.d.ts +22 -0
- package/dist/facts/FactComposer.d.ts +75 -0
- package/dist/facts/FactDateInput.d.ts +34 -0
- package/dist/facts/FactLabelsCell.d.ts +35 -0
- package/dist/facts/FactPassages.d.ts +52 -0
- package/dist/facts/FactRowActions.d.ts +18 -0
- package/dist/facts/FactSearchParts.d.ts +80 -0
- package/dist/facts/FactSourceGroup.d.ts +26 -0
- package/dist/facts/FactTimelineViews.d.ts +37 -0
- package/dist/facts/FactsBulkBar.d.ts +53 -0
- package/dist/facts/FactsEmptyState.d.ts +38 -0
- package/dist/facts/FactsFieldsButton.d.ts +21 -0
- package/dist/facts/FactsFilterInput.d.ts +46 -0
- package/dist/facts/FactsTable.d.ts +28 -0
- package/dist/facts/FactsToolbar.d.ts +53 -0
- package/dist/facts/FactsViewToggle.d.ts +36 -0
- package/dist/facts/fact-date.d.ts +22 -0
- package/dist/facts/fact-text.d.ts +14 -0
- package/dist/facts/factColumns.d.ts +88 -0
- package/dist/facts/index.cjs +2372 -0
- package/dist/facts/index.cjs.map +1 -0
- package/dist/facts/index.d.ts +34 -0
- package/dist/facts/index.js +2316 -0
- package/dist/facts/index.js.map +1 -0
- package/dist/facts/timezone.d.ts +4 -0
- package/dist/files/AiReviewDialog.d.ts +77 -0
- package/dist/files/DocStatusIcon.d.ts +12 -0
- package/dist/files/DocumentGrid.d.ts +27 -0
- package/dist/files/Explorer.d.ts +10 -0
- package/dist/files/ExplorerSurface.d.ts +34 -0
- package/dist/files/ExplorerTile.d.ts +142 -0
- package/dist/files/ExportParts.d.ts +114 -0
- package/dist/files/FieldParts.d.ts +64 -0
- package/dist/files/FilesPage.d.ts +20 -0
- package/dist/files/FilesToolbar.d.ts +59 -0
- package/dist/files/FolderPicker.d.ts +82 -0
- package/dist/files/GridView.d.ts +59 -0
- package/dist/files/HtmlViewerParts.d.ts +183 -0
- package/dist/files/MoveToFolderDialog.d.ts +32 -0
- package/dist/files/RedlineParts.d.ts +72 -0
- package/dist/files/SelectionBar.d.ts +65 -0
- package/dist/files/StatusPill.d.ts +23 -0
- package/dist/files/TagPassagePanel.d.ts +60 -0
- package/dist/files/UploadDropzone.d.ts +33 -0
- package/dist/files/UploadFooter.d.ts +59 -0
- package/dist/files/UploadParts.d.ts +78 -0
- package/dist/files/UploadSources.d.ts +77 -0
- package/dist/files/VersionTimeline.d.ts +60 -0
- package/dist/files/ViewToggle.d.ts +49 -0
- package/dist/files/ViewerChrome.d.ts +155 -0
- package/dist/files/ViewerLayout.d.ts +32 -0
- package/dist/files/ViewerParts.d.ts +62 -0
- package/dist/files/bulk/BulkActionsBar.d.ts +76 -0
- package/dist/files/bulk/FolderFilterButton.d.ts +35 -0
- package/dist/files/bulk/index.d.ts +2 -0
- package/dist/files/cells/DocumentNameCell.d.ts +31 -0
- package/dist/files/cells/FolderCell.d.ts +25 -0
- package/dist/files/cells/HoverIconCell.d.ts +21 -0
- package/dist/files/cells/LabelMultiSelect.d.ts +50 -0
- package/dist/files/cells/RelatedDocsCell.d.ts +22 -0
- package/dist/files/cells/TagColumnParts.d.ts +29 -0
- package/dist/files/cells/index.d.ts +6 -0
- package/dist/files/documentGridLayout.d.ts +31 -0
- package/dist/files/grid-test-ids.d.ts +18 -0
- package/dist/files/import/CalendarImportRow.d.ts +26 -0
- package/dist/files/import/ImportParts.d.ts +114 -0
- package/dist/files/import/TaskSection.d.ts +51 -0
- package/dist/files/import/UrlInputDialogView.d.ts +63 -0
- package/dist/files/import/VendorLogo.d.ts +15 -0
- package/dist/files/import/index.d.ts +5 -0
- package/dist/files/index.cjs +7589 -0
- package/dist/files/index.cjs.map +1 -0
- package/dist/files/index.d.ts +34 -0
- package/dist/files/index.js +7374 -0
- package/dist/files/index.js.map +1 -0
- package/dist/files/page/FilesAddMenu.d.ts +30 -0
- package/dist/files/page/FilesPageParts.d.ts +24 -0
- package/dist/files/page/FilesPageTitle.d.ts +24 -0
- package/dist/files/page/index.d.ts +3 -0
- package/dist/files/tags/BulkTagEditor.d.ts +136 -0
- package/dist/files/tags/DocTagPopover.d.ts +113 -0
- package/dist/files/tags/TagManager.d.ts +54 -0
- package/dist/files/tags/index.d.ts +3 -0
- package/dist/files/views/FieldsEditorParts.d.ts +151 -0
- package/dist/files/views/FieldsManagerParts.d.ts +17 -0
- package/dist/files/views/TagFormParts.d.ts +109 -0
- package/dist/files/views/ViewSelectorMenu.d.ts +66 -0
- package/dist/files/views/fieldsEditorModel.d.ts +43 -0
- package/dist/files/views/index.d.ts +5 -0
- package/dist/home/ActionMenuDialog.d.ts +26 -0
- package/dist/home/AddFilesFirst.d.ts +22 -0
- package/dist/home/CardHeaderBar.d.ts +40 -0
- package/dist/home/CollapsibleSection.d.ts +43 -0
- package/dist/home/CreateTile.d.ts +17 -0
- package/dist/home/DashboardParts.d.ts +32 -0
- package/dist/home/FactsStrip.d.ts +41 -0
- package/dist/home/FoldSection.d.ts +19 -0
- package/dist/home/GettingStartedStrip.d.ts +49 -0
- package/dist/home/Greeting.d.ts +18 -0
- package/dist/home/HomeLayout.d.ts +28 -0
- package/dist/home/KeyValueRow.d.ts +43 -0
- package/dist/home/ProjectBandParts.d.ts +70 -0
- package/dist/home/QuickActionDialogHeader.d.ts +21 -0
- package/dist/home/RecentList.d.ts +48 -0
- package/dist/home/ScopePicker.d.ts +65 -0
- package/dist/home/StartTiles.d.ts +33 -0
- package/dist/home/index.cjs +854 -0
- package/dist/home/index.cjs.map +1 -0
- package/dist/home/index.d.ts +37 -0
- package/dist/home/index.js +763 -0
- package/dist/home/index.js.map +1 -0
- package/dist/home/sections.d.ts +33 -0
- package/dist/index.cjs +1932 -5547
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +71 -1716
- package/dist/index.js +142 -5316
- package/dist/index.js.map +1 -1
- package/dist/lib/balanced-columns.d.ts +8 -0
- package/dist/lib/format.d.ts +37 -0
- package/dist/lib/observe-resize.d.ts +6 -0
- package/dist/lib/password-strength.d.ts +24 -0
- package/dist/lib/sidebar-mode.d.ts +46 -0
- package/dist/lib/testid.d.ts +7 -0
- package/dist/lib/use-drawer.d.ts +11 -0
- package/dist/lib/useControllableState.d.ts +5 -0
- package/dist/lib/useDismissibleCard.d.ts +15 -0
- package/dist/lib/useListKeyNav.d.ts +42 -0
- package/dist/lib/useLongPaste.d.ts +15 -0
- package/dist/lib/useRestoreFocus.d.ts +11 -0
- package/dist/lib/useScopeSelection.d.ts +34 -0
- package/dist/nav/types.d.ts +19 -0
- package/dist/provider/BlocksProvider.d.ts +20 -0
- package/dist/provider/TooltipScope.d.ts +9 -0
- package/dist/record/index.cjs +2 -4
- package/dist/record/index.cjs.map +1 -1
- package/dist/record/index.d.ts +12 -16
- package/dist/record/index.js +2 -4
- package/dist/record/index.js.map +1 -1
- package/dist/retrieval/HighlightText.d.ts +21 -0
- package/dist/retrieval/SearchEmptyState.d.ts +39 -0
- package/dist/retrieval/SearchGroupHeader.d.ts +21 -0
- package/dist/retrieval/SearchHit.d.ts +36 -0
- package/dist/retrieval/SearchPage.d.ts +187 -0
- package/dist/retrieval/SearchPagination.d.ts +21 -0
- package/dist/retrieval/highlight.d.ts +21 -0
- package/dist/retrieval/index.cjs +160 -0
- package/dist/retrieval/index.cjs.map +1 -0
- package/dist/retrieval/index.d.ts +7 -0
- package/dist/retrieval/index.js +7 -0
- package/dist/retrieval/index.js.map +1 -0
- package/dist/settings/AccountDialogs.d.ts +89 -0
- package/dist/settings/AvatarPicker.d.ts +25 -0
- package/dist/settings/Billing.d.ts +113 -0
- package/dist/settings/ConfigSwitcherBar.d.ts +46 -0
- package/dist/settings/ConfirmDialog.d.ts +28 -0
- package/dist/settings/ConnectionCard.d.ts +58 -0
- package/dist/settings/ConversationSettingsParts.d.ts +53 -0
- package/dist/settings/DocumentPicker.d.ts +57 -0
- package/dist/settings/EmailWorkspaceDialogView.d.ts +60 -0
- package/dist/settings/ErrorDialog.d.ts +36 -0
- package/dist/settings/FloatingPanel.d.ts +32 -0
- package/dist/settings/JsonTree.d.ts +24 -0
- package/dist/settings/LogoutDialog.d.ts +51 -0
- package/dist/settings/ModalBreadcrumbHeader.d.ts +32 -0
- package/dist/settings/ModalScaffold.d.ts +60 -0
- package/dist/settings/MultiSelect.d.ts +111 -0
- package/dist/settings/NotificationCategoryList.d.ts +26 -0
- package/dist/settings/PanelFrame.d.ts +47 -0
- package/dist/settings/PasswordChangeDialog.d.ts +64 -0
- package/dist/settings/PlanBadge.d.ts +14 -0
- package/dist/settings/PlanCard.d.ts +97 -0
- package/dist/settings/PremiumModelsFrame.d.ts +17 -0
- package/dist/settings/ProfileCard.d.ts +67 -0
- package/dist/settings/Projects.d.ts +108 -0
- package/dist/settings/QuotaMeter.d.ts +31 -0
- package/dist/settings/ReferralCredit.d.ts +46 -0
- package/dist/settings/SegmentedControl.d.ts +20 -0
- package/dist/settings/ServerConnectionControls.d.ts +31 -0
- package/dist/settings/SettingsPanel.d.ts +61 -0
- package/dist/settings/SettingsSwitchRow.d.ts +21 -0
- package/dist/settings/SubscriptionParts.d.ts +215 -0
- package/dist/settings/SupportPanel.d.ts +32 -0
- package/dist/settings/SyncDialogParts.d.ts +155 -0
- package/dist/settings/ThreadPreviewDialog.d.ts +18 -0
- package/dist/settings/TipsEditorDialog.d.ts +94 -0
- package/dist/settings/TriStateFilterMenu.d.ts +66 -0
- package/dist/settings/Usage.d.ts +102 -0
- package/dist/settings/WelcomeDialog.d.ts +79 -0
- package/dist/settings/index.cjs +5131 -0
- package/dist/settings/index.cjs.map +1 -0
- package/dist/settings/index.d.ts +38 -0
- package/dist/settings/index.js +4922 -0
- package/dist/settings/index.js.map +1 -0
- package/dist/shell/ActionCluster.d.ts +28 -0
- package/dist/shell/AskField.d.ts +71 -0
- package/dist/shell/InfoBar.d.ts +20 -0
- package/dist/shell/MobileBars.d.ts +47 -0
- package/dist/shell/OfflinePill.d.ts +28 -0
- package/dist/shell/RemoteControlPill.d.ts +23 -0
- package/dist/shell/Shell.d.ts +123 -0
- package/dist/shell/Sidebar.d.ts +104 -0
- package/dist/shell/SidebarBadgeRow.d.ts +29 -0
- package/dist/shell/SidebarRowAction.d.ts +24 -0
- package/dist/shell/StatusRow.d.ts +20 -0
- package/dist/shell/TabHeader.d.ts +70 -0
- package/dist/shell/TipCard.d.ts +46 -0
- package/dist/shell/ToolButton.d.ts +12 -0
- package/dist/shell/Workspace.d.ts +90 -0
- package/dist/shell/index.cjs +187 -0
- package/dist/shell/index.cjs.map +1 -0
- package/dist/shell/index.d.ts +20 -0
- package/dist/shell/index.js +10 -0
- package/dist/shell/index.js.map +1 -0
- package/dist/shell/sidebar-context.d.ts +19 -0
- package/dist/shell/types.d.ts +48 -0
- package/dist/site/index.cjs +113 -90
- package/dist/site/index.d.ts +59 -4
- package/dist/site/index.js +8 -1
- package/dist/studio/PageRenderer.d.ts +35 -0
- package/dist/studio/Section.d.ts +24 -0
- package/dist/studio/StudioEditor.d.ts +32 -0
- package/dist/studio/aiFields.d.ts +17 -0
- package/dist/studio/blockKit.d.ts +36 -0
- package/dist/studio/blocksConfig.d.ts +42 -0
- package/dist/studio/imageFields.d.ts +14 -0
- package/dist/studio/index.cjs +3353 -0
- package/dist/studio/index.cjs.map +1 -0
- package/dist/studio/index.d.ts +32 -0
- package/dist/studio/index.js +3297 -0
- package/dist/studio/index.js.map +1 -0
- package/dist/studio/liveData.d.ts +4 -0
- package/dist/studio/liveWidgetRuntime.d.ts +41 -0
- package/dist/studio/persistence.d.ts +38 -0
- package/dist/studio/publish.d.ts +39 -0
- package/dist/studio/siteBlocks.d.ts +14 -0
- package/dist/studio/types.d.ts +46 -0
- package/dist/studio/websiteBlocks.d.ts +4 -0
- package/dist/studio/widgets.d.ts +20 -0
- package/dist/theme/ThemeEditor.d.ts +16 -0
- package/dist/theme/fontPairings.d.ts +48 -0
- package/dist/theme/store.d.ts +53 -0
- package/dist/theme/tokens.d.ts +105 -0
- package/dist/timeline/Timeline.d.ts +27 -0
- package/dist/timeline/TimelineCalendar.d.ts +54 -0
- package/dist/timeline/TimelineGantt.d.ts +71 -0
- package/dist/timeline/TimelineZoomControl.d.ts +17 -0
- package/dist/timeline/index.cjs +50 -0
- package/dist/timeline/index.cjs.map +1 -0
- package/dist/timeline/index.d.ts +13 -0
- package/dist/timeline/index.js +5 -0
- package/dist/timeline/index.js.map +1 -0
- package/dist/timeline/span.d.ts +29 -0
- package/dist/timeline/types.d.ts +30 -0
- package/dist/workspaces/WorkspaceBadges.d.ts +27 -0
- package/dist/workspaces/WorkspaceCard.d.ts +142 -0
- package/dist/workspaces/WorkspaceFormParts.d.ts +98 -0
- package/dist/workspaces/WorkspaceGroup.d.ts +31 -0
- package/dist/workspaces/WorkspaceSettingsParts.d.ts +70 -0
- package/dist/workspaces/index.cjs +690 -0
- package/dist/workspaces/index.cjs.map +1 -0
- package/dist/workspaces/index.d.ts +9 -0
- package/dist/workspaces/index.js +661 -0
- package/dist/workspaces/index.js.map +1 -0
- package/package.json +164 -9
- package/src/blocks.css +348 -0
- package/src/components/grid.css +60 -107
- package/src/source.css +20 -0
- package/src/studio/studio.css +3 -3
- package/src/tokens.css +226 -0
- package/dist/chunk-DBAUZD7A.cjs.map +0 -1
- package/dist/chunk-FZ2S6VAZ.js.map +0 -1
- package/dist/index-DduoEosi.d.cts +0 -846
- package/dist/index-DduoEosi.d.ts +0 -846
- package/dist/index.d.cts +0 -1717
- package/dist/record/index.d.cts +0 -96
- package/dist/site/index.d.cts +0 -4
|
@@ -0,0 +1,672 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { testIdOr } from './chunk-7F6CBP3Z.js';
|
|
3
|
+
import { useRef, useSyncExternalStore, useMemo, useCallback, useEffect, useState } from 'react';
|
|
4
|
+
import { AgGridReact } from 'ag-grid-react';
|
|
5
|
+
import { themeQuartz, AllCommunityModule } from 'ag-grid-community';
|
|
6
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
7
|
+
import { FileImage, Table2, BookOpen, Search } from 'lucide-react';
|
|
8
|
+
import { ToggleGroup, cn, Select, SelectTrigger, SelectValue, SelectContent, SelectItem, ToggleGroupItem, Tooltip, TooltipTrigger, TooltipContent } from '@arbidocs/react/ui';
|
|
9
|
+
|
|
10
|
+
// src/files/grid-test-ids.ts
|
|
11
|
+
function applyGridTestIds(root, itemsById, { getRowTestId, getCellTestId }) {
|
|
12
|
+
if (!getRowTestId && !getCellTestId) return;
|
|
13
|
+
root.querySelectorAll(".ag-center-cols-container .ag-row[row-id]").forEach((row) => {
|
|
14
|
+
const item = itemsById.get(row.getAttribute("row-id") ?? "");
|
|
15
|
+
if (item === void 0) return;
|
|
16
|
+
if (getRowTestId) row.setAttribute("data-testid", getRowTestId(item));
|
|
17
|
+
if (getCellTestId) {
|
|
18
|
+
row.querySelectorAll(".ag-cell[col-id]").forEach((cell) => {
|
|
19
|
+
cell.setAttribute("data-testid", getCellTestId(cell.getAttribute("col-id") ?? "", item));
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
function watchGridTestIds(root, getItemsById, options) {
|
|
25
|
+
if (!options.getRowTestId && !options.getCellTestId) return () => {
|
|
26
|
+
};
|
|
27
|
+
const run = () => applyGridTestIds(root, getItemsById(), options);
|
|
28
|
+
run();
|
|
29
|
+
if (typeof MutationObserver === "undefined") return () => {
|
|
30
|
+
};
|
|
31
|
+
const observer = new MutationObserver(run);
|
|
32
|
+
observer.observe(root, { childList: true, subtree: true });
|
|
33
|
+
return () => observer.disconnect();
|
|
34
|
+
}
|
|
35
|
+
var cssVar = (name, alpha) => alpha === void 0 ? `hsl(var(--${name}))` : `hsl(var(--${name}) / ${alpha})`;
|
|
36
|
+
var arbiTheme = themeQuartz.withParams({
|
|
37
|
+
// Variant B palette: white canvas, quiet header, muted hover nudge, accent-tint selection.
|
|
38
|
+
// Every colour is a host CSS variable, so light/dark follow the app with no .dark overrides.
|
|
39
|
+
backgroundColor: cssVar("background"),
|
|
40
|
+
foregroundColor: cssVar("foreground"),
|
|
41
|
+
borderColor: cssVar("border"),
|
|
42
|
+
headerBackgroundColor: cssVar("background"),
|
|
43
|
+
headerTextColor: cssVar("muted-foreground"),
|
|
44
|
+
oddRowBackgroundColor: cssVar("background"),
|
|
45
|
+
rowHoverColor: cssVar("muted", 0.6),
|
|
46
|
+
// Checkbox-selected rows: a light accent tint. A row opened elsewhere (e.g. the viewer) may take
|
|
47
|
+
// the full accent, so the two states stay distinguishable.
|
|
48
|
+
selectedRowBackgroundColor: cssVar("accent", 0.6),
|
|
49
|
+
rangeSelectionBackgroundColor: cssVar("accent"),
|
|
50
|
+
accentColor: cssVar("primary"),
|
|
51
|
+
inputFocusBorder: { color: cssVar("primary") },
|
|
52
|
+
headerColumnBorder: false,
|
|
53
|
+
headerColumnResizeHandleColor: "transparent",
|
|
54
|
+
// still draggable, no visible divider
|
|
55
|
+
// Font settings — inherit the host app's font. A googleFont here never
|
|
56
|
+
// loaded under the apps' CSP, so every grid silently fell back to the
|
|
57
|
+
// browser's default SERIF and read as unstyled.
|
|
58
|
+
fontFamily: "inherit",
|
|
59
|
+
fontSize: 14,
|
|
60
|
+
headerFontSize: 12.5,
|
|
61
|
+
headerFontWeight: 500,
|
|
62
|
+
// Sizing
|
|
63
|
+
headerHeight: 44,
|
|
64
|
+
rowHeight: 40,
|
|
65
|
+
cellHorizontalPadding: 16,
|
|
66
|
+
// Borders - structural settings only.
|
|
67
|
+
// Row border is a real hairline in the theme border colour (not hardcoded
|
|
68
|
+
// white, which was invisible on the light-mode background and wrong in dark
|
|
69
|
+
// mode) so adjacent rows are clearly separated — important now that rows can
|
|
70
|
+
// be tall and multi-line (e.g. the Abstract column).
|
|
71
|
+
rowBorder: { style: "solid", width: 1, color: "hsl(var(--border))" },
|
|
72
|
+
columnBorder: false,
|
|
73
|
+
// Row hairlines only
|
|
74
|
+
wrapperBorder: false,
|
|
75
|
+
// No rounded corners for clean look (except checkboxes)
|
|
76
|
+
borderRadius: 0,
|
|
77
|
+
wrapperBorderRadius: 0,
|
|
78
|
+
checkboxBorderRadius: 2
|
|
79
|
+
// Keep checkboxes square
|
|
80
|
+
});
|
|
81
|
+
var TOUCH_ROW_HEIGHT = 52;
|
|
82
|
+
var COARSE_QUERY = "(pointer: coarse)";
|
|
83
|
+
var queryCoarsePointer = () => typeof window !== "undefined" && typeof window.matchMedia === "function" ? window.matchMedia(COARSE_QUERY) ?? void 0 : void 0;
|
|
84
|
+
var getCoarsePointer = () => queryCoarsePointer()?.matches ?? false;
|
|
85
|
+
function subscribeCoarsePointer(onChange) {
|
|
86
|
+
const mq = queryCoarsePointer();
|
|
87
|
+
mq?.addEventListener?.("change", onChange);
|
|
88
|
+
return () => mq?.removeEventListener?.("change", onChange);
|
|
89
|
+
}
|
|
90
|
+
function GridView({
|
|
91
|
+
items,
|
|
92
|
+
columnDefs,
|
|
93
|
+
getItemId,
|
|
94
|
+
selection,
|
|
95
|
+
emptyState,
|
|
96
|
+
isLoading = false,
|
|
97
|
+
loadingMessage = "Loading...",
|
|
98
|
+
gridOptions,
|
|
99
|
+
onGridReady,
|
|
100
|
+
onCellValueChanged,
|
|
101
|
+
onRowClick,
|
|
102
|
+
persistState = false,
|
|
103
|
+
gridState,
|
|
104
|
+
onGridStateChange,
|
|
105
|
+
initialVisibleColumns,
|
|
106
|
+
className = "w-full",
|
|
107
|
+
height = 500,
|
|
108
|
+
rowHeight: rowHeightProp,
|
|
109
|
+
testId = "grid-view",
|
|
110
|
+
pinnedBottomRowData,
|
|
111
|
+
pinnedTopRowData,
|
|
112
|
+
pagination = false,
|
|
113
|
+
paginationPageSizeSelector,
|
|
114
|
+
getRowTestId,
|
|
115
|
+
getCellTestId,
|
|
116
|
+
showEmpty
|
|
117
|
+
}) {
|
|
118
|
+
const gridApiRef = useRef(null);
|
|
119
|
+
const isCoarsePointer = useSyncExternalStore(
|
|
120
|
+
subscribeCoarsePointer,
|
|
121
|
+
getCoarsePointer,
|
|
122
|
+
() => false
|
|
123
|
+
);
|
|
124
|
+
const rowHeight = isCoarsePointer ? Math.max(rowHeightProp ?? gridOptions?.rowHeight ?? 40, TOUCH_ROW_HEIGHT) : rowHeightProp;
|
|
125
|
+
const initialRowHeightRef = useRef(rowHeight);
|
|
126
|
+
const initialGridStateRef = useRef(gridState);
|
|
127
|
+
const initialState = useMemo(() => {
|
|
128
|
+
if (!persistState) return void 0;
|
|
129
|
+
return initialGridStateRef.current;
|
|
130
|
+
}, [persistState]);
|
|
131
|
+
const saveGridState = useCallback(() => {
|
|
132
|
+
if (!persistState || !onGridStateChange || !gridApiRef.current) return;
|
|
133
|
+
const state = gridApiRef.current.getState();
|
|
134
|
+
onGridStateChange(state);
|
|
135
|
+
}, [persistState, onGridStateChange]);
|
|
136
|
+
const ensureSelectionColumnVisible = useCallback(() => {
|
|
137
|
+
if (!gridApiRef.current || !selection?.mode) return;
|
|
138
|
+
const currentState = gridApiRef.current.getColumnState();
|
|
139
|
+
const selectionColumn = currentState.find((col) => col.colId === "ag-Grid-SelectionColumn");
|
|
140
|
+
const selectionColumnIndex = currentState.findIndex(
|
|
141
|
+
(col) => col.colId === "ag-Grid-SelectionColumn"
|
|
142
|
+
);
|
|
143
|
+
if (!selectionColumn || selectionColumn.hide || selectionColumnIndex !== 0) {
|
|
144
|
+
gridApiRef.current.setColumnsVisible(["ag-Grid-SelectionColumn"], true);
|
|
145
|
+
gridApiRef.current.applyColumnState({
|
|
146
|
+
state: [
|
|
147
|
+
{
|
|
148
|
+
colId: "ag-Grid-SelectionColumn",
|
|
149
|
+
hide: false,
|
|
150
|
+
width: selectionColumn?.width || 48,
|
|
151
|
+
pinned: null
|
|
152
|
+
// Ensure not pinned in wrong position
|
|
153
|
+
}
|
|
154
|
+
],
|
|
155
|
+
defaultState: { hide: void 0 },
|
|
156
|
+
applyOrder: false
|
|
157
|
+
});
|
|
158
|
+
if (selectionColumnIndex !== 0) {
|
|
159
|
+
gridApiRef.current.moveColumns(["ag-Grid-SelectionColumn"], 0);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}, [selection?.mode]);
|
|
163
|
+
const containerRef = useRef(null);
|
|
164
|
+
const itemsRef = useRef(items);
|
|
165
|
+
itemsRef.current = items;
|
|
166
|
+
const getItemIdRef = useRef(getItemId);
|
|
167
|
+
getItemIdRef.current = getItemId;
|
|
168
|
+
const hasTestIdHooks = Boolean(getRowTestId || getCellTestId);
|
|
169
|
+
useEffect(() => {
|
|
170
|
+
const root = containerRef.current;
|
|
171
|
+
if (!root || !hasTestIdHooks) return;
|
|
172
|
+
return watchGridTestIds(
|
|
173
|
+
root,
|
|
174
|
+
() => new Map(itemsRef.current.map((item) => [getItemIdRef.current(item), item])),
|
|
175
|
+
{ getRowTestId, getCellTestId }
|
|
176
|
+
);
|
|
177
|
+
}, [hasTestIdHooks, getRowTestId, getCellTestId, isLoading]);
|
|
178
|
+
const getRowId = useCallback(
|
|
179
|
+
(params) => {
|
|
180
|
+
return getItemId(params.data);
|
|
181
|
+
},
|
|
182
|
+
[getItemId]
|
|
183
|
+
);
|
|
184
|
+
const selectionRef = useRef(selection);
|
|
185
|
+
selectionRef.current = selection;
|
|
186
|
+
const onSelectionChangeRef = useRef(selection?.onSelectionChange);
|
|
187
|
+
onSelectionChangeRef.current = selection?.onSelectionChange;
|
|
188
|
+
const handleSelectionChanged = useCallback(() => {
|
|
189
|
+
if (!onSelectionChangeRef.current || !gridApiRef.current) return;
|
|
190
|
+
const selectedNodes = gridApiRef.current.getSelectedNodes();
|
|
191
|
+
const selectedData = selectedNodes.map((node) => node.data).filter((item) => item !== void 0);
|
|
192
|
+
onSelectionChangeRef.current(selectedData);
|
|
193
|
+
}, []);
|
|
194
|
+
const handleRowClicked = useCallback(
|
|
195
|
+
(event) => {
|
|
196
|
+
if (!onRowClick || !event.data) return;
|
|
197
|
+
const target = event.event?.target;
|
|
198
|
+
if (target?.closest('button, input, a, select, textarea, [role="button"]')) return;
|
|
199
|
+
onRowClick(event.data);
|
|
200
|
+
},
|
|
201
|
+
[onRowClick]
|
|
202
|
+
);
|
|
203
|
+
const desiredHiddenRef = useRef(null);
|
|
204
|
+
const snapshotDesiredHidden = useCallback(() => {
|
|
205
|
+
const api = gridApiRef.current;
|
|
206
|
+
if (!api) return;
|
|
207
|
+
desiredHiddenRef.current = new Map(api.getColumnState().map((c) => [c.colId, !!c.hide]));
|
|
208
|
+
}, []);
|
|
209
|
+
const handleGridReady = useCallback(
|
|
210
|
+
(event) => {
|
|
211
|
+
gridApiRef.current = event.api;
|
|
212
|
+
if (!initialState && initialVisibleColumns?.length) {
|
|
213
|
+
const currentState = event.api.getColumnState();
|
|
214
|
+
const stateMap = new Map(currentState.map((col) => [col.colId, col]));
|
|
215
|
+
const visibleSet = new Set(initialVisibleColumns);
|
|
216
|
+
const selectionCol = stateMap.get("ag-Grid-SelectionColumn");
|
|
217
|
+
const orderedState = [
|
|
218
|
+
// Selection column first - ALWAYS visible, create if not in state
|
|
219
|
+
selectionCol ? { ...selectionCol, hide: false } : { colId: "ag-Grid-SelectionColumn", hide: false, width: 48 },
|
|
220
|
+
// Visible columns in specified order
|
|
221
|
+
...initialVisibleColumns.filter((colId) => colId !== "ag-Grid-SelectionColumn").map((colId) => {
|
|
222
|
+
const col = stateMap.get(colId);
|
|
223
|
+
return col ? { ...col, hide: false } : void 0;
|
|
224
|
+
}),
|
|
225
|
+
// Hidden columns (everything else)
|
|
226
|
+
...currentState.filter((col) => col.colId !== "ag-Grid-SelectionColumn" && !visibleSet.has(col.colId)).map((col) => ({ ...col, hide: true }))
|
|
227
|
+
].filter((col) => col !== void 0);
|
|
228
|
+
event.api.applyColumnState({ state: orderedState, applyOrder: true });
|
|
229
|
+
}
|
|
230
|
+
if (initialState && initialVisibleColumns?.length) {
|
|
231
|
+
const currentState = event.api.getColumnState();
|
|
232
|
+
const savedColIds = new Set(
|
|
233
|
+
initialState.columnOrder?.orderedColIds ?? currentState.map((c) => c.colId)
|
|
234
|
+
);
|
|
235
|
+
const newCols = currentState.filter(
|
|
236
|
+
(col) => !savedColIds.has(col.colId) && col.colId !== "ag-Grid-SelectionColumn"
|
|
237
|
+
);
|
|
238
|
+
if (newCols.length > 0) {
|
|
239
|
+
const defaultVisible = new Set(initialVisibleColumns);
|
|
240
|
+
event.api.applyColumnState({
|
|
241
|
+
state: newCols.map((col) => ({
|
|
242
|
+
...col,
|
|
243
|
+
hide: !defaultVisible.has(col.colId)
|
|
244
|
+
}))
|
|
245
|
+
});
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
ensureSelectionColumnVisible();
|
|
249
|
+
snapshotDesiredHidden();
|
|
250
|
+
if (onGridReady) {
|
|
251
|
+
onGridReady({ api: event.api });
|
|
252
|
+
}
|
|
253
|
+
const sel = selectionRef.current;
|
|
254
|
+
if (sel && sel.selected.length > 0) {
|
|
255
|
+
const selectedIds = new Set(sel.selected.map(getItemId));
|
|
256
|
+
event.api.forEachNode((node) => {
|
|
257
|
+
if (node.data && selectedIds.has(getItemId(node.data))) {
|
|
258
|
+
node.setSelected(true);
|
|
259
|
+
}
|
|
260
|
+
});
|
|
261
|
+
}
|
|
262
|
+
},
|
|
263
|
+
[
|
|
264
|
+
onGridReady,
|
|
265
|
+
getItemId,
|
|
266
|
+
ensureSelectionColumnVisible,
|
|
267
|
+
snapshotDesiredHidden,
|
|
268
|
+
initialState,
|
|
269
|
+
initialVisibleColumns
|
|
270
|
+
]
|
|
271
|
+
);
|
|
272
|
+
const handleColumnVisible = useCallback(
|
|
273
|
+
(event) => {
|
|
274
|
+
const api = gridApiRef.current;
|
|
275
|
+
if (!api) return;
|
|
276
|
+
if (event.source === "gridOptionsChanged") {
|
|
277
|
+
const desired = desiredHiddenRef.current;
|
|
278
|
+
if (!desired) return;
|
|
279
|
+
const fixes = api.getColumnState().filter(
|
|
280
|
+
(c) => c.colId !== "ag-Grid-SelectionColumn" && desired.has(c.colId) && desired.get(c.colId) !== !!c.hide
|
|
281
|
+
).map((c) => ({ colId: c.colId, hide: desired.get(c.colId) }));
|
|
282
|
+
if (fixes.length) api.applyColumnState({ state: fixes });
|
|
283
|
+
} else {
|
|
284
|
+
snapshotDesiredHidden();
|
|
285
|
+
}
|
|
286
|
+
},
|
|
287
|
+
[snapshotDesiredHidden]
|
|
288
|
+
);
|
|
289
|
+
const handleFirstDataRendered = useCallback(() => {
|
|
290
|
+
ensureSelectionColumnVisible();
|
|
291
|
+
snapshotDesiredHidden();
|
|
292
|
+
}, [ensureSelectionColumnVisible, snapshotDesiredHidden]);
|
|
293
|
+
const handleModelUpdated = useCallback(() => {
|
|
294
|
+
}, []);
|
|
295
|
+
const prevItemsRef = useRef([]);
|
|
296
|
+
useEffect(() => {
|
|
297
|
+
prevItemsRef.current = items;
|
|
298
|
+
}, [items]);
|
|
299
|
+
const handleStateUpdated = useCallback(() => {
|
|
300
|
+
saveGridState();
|
|
301
|
+
}, [saveGridState]);
|
|
302
|
+
const defaultOptions = useMemo(() => {
|
|
303
|
+
return {
|
|
304
|
+
// Initial row height (stable — captured once). Live changes go through the
|
|
305
|
+
// imperative effect, not this option, to avoid column-state churn.
|
|
306
|
+
rowHeight: initialRowHeightRef.current,
|
|
307
|
+
suppressMenuHide: true,
|
|
308
|
+
// Prevent hiding columns since we don't have enterprise sidebar
|
|
309
|
+
maintainColumnOrder: true,
|
|
310
|
+
// Preserve column order when columns are added/removed
|
|
311
|
+
// Row virtualization: Render rows as needed for performance
|
|
312
|
+
// rowBuffer renders extra rows above/below viewport for smoother scrolling
|
|
313
|
+
rowBuffer: 10,
|
|
314
|
+
// Render 10 extra rows above/below viewport for smooth scrolling
|
|
315
|
+
suppressColumnVirtualisation: false,
|
|
316
|
+
// Keep column virtualization enabled
|
|
317
|
+
suppressRowVirtualisation: false,
|
|
318
|
+
// ENABLE row virtualization - only render visible rows
|
|
319
|
+
animateRows: false,
|
|
320
|
+
// Disable row animations
|
|
321
|
+
suppressColumnMoveAnimation: true,
|
|
322
|
+
// Disable column move/resize animations
|
|
323
|
+
// Efficient updates with React Query cache
|
|
324
|
+
// getRowId enables change detection - grid only re-renders changed rows
|
|
325
|
+
// Works perfectly with React Query's cache updates
|
|
326
|
+
getRowId,
|
|
327
|
+
rowSelection: selection?.mode ? {
|
|
328
|
+
mode: selection.mode === "single" ? "singleRow" : "multiRow",
|
|
329
|
+
selectAll: "filtered",
|
|
330
|
+
// Header checkbox selects all filtered rows (across all pages)
|
|
331
|
+
// In multi-row mode, only checkboxes should toggle selection (clicking row body would replace selection)
|
|
332
|
+
enableClickSelection: selection.mode === "single",
|
|
333
|
+
checkboxes: true,
|
|
334
|
+
headerCheckbox: selection.mode === "multiple"
|
|
335
|
+
} : void 0,
|
|
336
|
+
selectionColumnDef: selection?.mode ? {
|
|
337
|
+
sortable: selection.mode === "multiple",
|
|
338
|
+
width: 48,
|
|
339
|
+
lockVisible: true,
|
|
340
|
+
// Cannot be hidden
|
|
341
|
+
suppressMovable: true
|
|
342
|
+
// Cannot be moved
|
|
343
|
+
} : void 0,
|
|
344
|
+
// Use normal layout for better performance - autoHeight causes forced reflows
|
|
345
|
+
domLayout: "normal",
|
|
346
|
+
// Stop editing when clicking outside the cell/grid
|
|
347
|
+
stopEditingWhenCellsLoseFocus: true,
|
|
348
|
+
// Additional performance optimizations
|
|
349
|
+
suppressCellFocus: true,
|
|
350
|
+
// Don't focus cells on click (faster)
|
|
351
|
+
suppressRowHoverHighlight: true,
|
|
352
|
+
// Disable hover highlight - reduces DOM manipulation during scroll
|
|
353
|
+
suppressScrollOnNewData: true,
|
|
354
|
+
// Don't scroll when data updates
|
|
355
|
+
suppressAggFuncInHeader: true,
|
|
356
|
+
// Don't show aggregation functions (faster)
|
|
357
|
+
// Tooltip UX: the AG Grid default show-delay is 2 s which hurts
|
|
358
|
+
// discoverability for cells where tooltips carry the "reveal full
|
|
359
|
+
// content" affordance for non-editable users. 300 ms is snappy
|
|
360
|
+
// without being accidental. tooltipInteraction lets users hover
|
|
361
|
+
// onto the tooltip itself (e.g. to select / copy long text).
|
|
362
|
+
// These are AG Grid's native tooltip controls — no React / Radix
|
|
363
|
+
// provider involved, zero per-row cost; tooltip DOM is created on
|
|
364
|
+
// demand when hover-delay elapses and destroyed on mouseout.
|
|
365
|
+
tooltipShowDelay: 300,
|
|
366
|
+
tooltipHideDelay: 4e3,
|
|
367
|
+
tooltipInteraction: true,
|
|
368
|
+
// Pagination (disabled by default)
|
|
369
|
+
pagination,
|
|
370
|
+
paginationPageSizeSelector,
|
|
371
|
+
defaultColDef: {
|
|
372
|
+
sortable: true,
|
|
373
|
+
resizable: true,
|
|
374
|
+
unSortIcon: false,
|
|
375
|
+
// Sort glyph only on the sorted column (every header carrying one was noise)
|
|
376
|
+
sortingOrder: ["asc", "desc", null],
|
|
377
|
+
// 3-way sorting: asc → desc → unsorted (AG Grid default)
|
|
378
|
+
wrapText: false,
|
|
379
|
+
// Disable text wrapping for cleaner display
|
|
380
|
+
autoHeight: false,
|
|
381
|
+
// Use fixed row height from theme
|
|
382
|
+
wrapHeaderText: false,
|
|
383
|
+
// Disable header text wrapping for cleaner look
|
|
384
|
+
autoHeaderHeight: false,
|
|
385
|
+
// Fixed header height
|
|
386
|
+
filterParams: {
|
|
387
|
+
maxNumConditions: 1,
|
|
388
|
+
buttons: ["reset"]
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
};
|
|
392
|
+
}, [selection?.mode, getRowId, pagination, paginationPageSizeSelector]);
|
|
393
|
+
const combinedOptions = useMemo(
|
|
394
|
+
() => ({ ...defaultOptions, ...gridOptions }),
|
|
395
|
+
[defaultOptions, gridOptions]
|
|
396
|
+
);
|
|
397
|
+
const containerStyle = useMemo(() => {
|
|
398
|
+
const style = { height };
|
|
399
|
+
if (rowHeight) {
|
|
400
|
+
const LINE_PX = 14 * 1.35;
|
|
401
|
+
const BORDER = 2;
|
|
402
|
+
const PREFERRED_PAD = 16;
|
|
403
|
+
const padTotal = Math.max(0, Math.min(PREFERRED_PAD, rowHeight - BORDER - LINE_PX));
|
|
404
|
+
const lines = Math.max(1, Math.floor((rowHeight - BORDER - padTotal) / LINE_PX));
|
|
405
|
+
const vars = style;
|
|
406
|
+
vars["--multiline-line-clamp"] = `${lines}`;
|
|
407
|
+
vars["--multiline-pad-y"] = `${padTotal / 2}px`;
|
|
408
|
+
vars["--multiline-max-h"] = `${lines * LINE_PX + padTotal / 2 + BORDER}px`;
|
|
409
|
+
}
|
|
410
|
+
return style;
|
|
411
|
+
}, [height, rowHeight]);
|
|
412
|
+
useEffect(() => {
|
|
413
|
+
const api = gridApiRef.current;
|
|
414
|
+
if (!api || api.isDestroyed() || !rowHeight) return;
|
|
415
|
+
api.setGridOption("rowHeight", rowHeight);
|
|
416
|
+
api.resetRowHeights();
|
|
417
|
+
}, [rowHeight]);
|
|
418
|
+
const containerClassName = useMemo(() => {
|
|
419
|
+
const baseClass = className || "";
|
|
420
|
+
const shadowClass = "shadow-sm";
|
|
421
|
+
const alignClass = rowHeight ? "ag-cells-centered" : "";
|
|
422
|
+
return [baseClass, shadowClass, alignClass].filter(Boolean).join(" ");
|
|
423
|
+
}, [className, rowHeight]);
|
|
424
|
+
if (isLoading) {
|
|
425
|
+
const skeletonRowCount = 12;
|
|
426
|
+
return /* @__PURE__ */ jsxs(
|
|
427
|
+
"div",
|
|
428
|
+
{
|
|
429
|
+
"data-testid": `${testId}-loading`,
|
|
430
|
+
className: containerClassName,
|
|
431
|
+
style: containerStyle,
|
|
432
|
+
"aria-busy": "true",
|
|
433
|
+
"aria-label": loadingMessage,
|
|
434
|
+
children: [
|
|
435
|
+
/* @__PURE__ */ jsxs("div", { className: "flex h-11 items-center gap-4 border-b border-border/40 px-4", children: [
|
|
436
|
+
/* @__PURE__ */ jsx("div", { className: "h-3 w-6 rounded bg-muted animate-pulse" }),
|
|
437
|
+
/* @__PURE__ */ jsx("div", { className: "h-3 w-32 rounded bg-muted animate-pulse" }),
|
|
438
|
+
/* @__PURE__ */ jsx("div", { className: "h-3 w-24 rounded bg-muted animate-pulse" }),
|
|
439
|
+
/* @__PURE__ */ jsx("div", { className: "h-3 w-20 rounded bg-muted animate-pulse" }),
|
|
440
|
+
/* @__PURE__ */ jsx("div", { className: "h-3 w-28 rounded bg-muted animate-pulse" }),
|
|
441
|
+
/* @__PURE__ */ jsx("div", { className: "h-3 w-16 rounded bg-muted animate-pulse ml-auto" })
|
|
442
|
+
] }),
|
|
443
|
+
Array.from({ length: skeletonRowCount }).map((_, rowIdx) => /* @__PURE__ */ jsxs("div", { className: "flex h-10 items-center gap-4 border-b border-border/20 px-4", children: [
|
|
444
|
+
/* @__PURE__ */ jsx("div", { className: "h-4 w-4 rounded-sm bg-muted/70 animate-pulse" }),
|
|
445
|
+
/* @__PURE__ */ jsx(
|
|
446
|
+
"div",
|
|
447
|
+
{
|
|
448
|
+
className: "h-3 rounded bg-muted/70 animate-pulse",
|
|
449
|
+
style: { width: `${20 + rowIdx * 17 % 40}%` }
|
|
450
|
+
}
|
|
451
|
+
),
|
|
452
|
+
/* @__PURE__ */ jsx(
|
|
453
|
+
"div",
|
|
454
|
+
{
|
|
455
|
+
className: "h-3 rounded bg-muted/60 animate-pulse",
|
|
456
|
+
style: { width: `${8 + rowIdx * 11 % 12}%` }
|
|
457
|
+
}
|
|
458
|
+
),
|
|
459
|
+
/* @__PURE__ */ jsx(
|
|
460
|
+
"div",
|
|
461
|
+
{
|
|
462
|
+
className: "h-3 rounded bg-muted/60 animate-pulse",
|
|
463
|
+
style: { width: `${6 + rowIdx * 7 % 10}%` }
|
|
464
|
+
}
|
|
465
|
+
),
|
|
466
|
+
/* @__PURE__ */ jsx(
|
|
467
|
+
"div",
|
|
468
|
+
{
|
|
469
|
+
className: "h-3 rounded bg-muted/50 animate-pulse ml-auto",
|
|
470
|
+
style: { width: `${5 + rowIdx * 5 % 8}%` }
|
|
471
|
+
}
|
|
472
|
+
)
|
|
473
|
+
] }, rowIdx))
|
|
474
|
+
]
|
|
475
|
+
}
|
|
476
|
+
);
|
|
477
|
+
}
|
|
478
|
+
if ((showEmpty ?? items.length === 0) && emptyState) {
|
|
479
|
+
return /* @__PURE__ */ jsx(
|
|
480
|
+
"div",
|
|
481
|
+
{
|
|
482
|
+
"data-testid": `${testId}-empty`,
|
|
483
|
+
className: "flex h-96 max-h-full flex-col items-center overflow-y-auto p-6 text-center",
|
|
484
|
+
children: /* @__PURE__ */ jsxs("div", { className: "my-auto flex flex-col items-center", children: [
|
|
485
|
+
emptyState.icon && /* @__PURE__ */ jsx("div", { className: "text-muted-foreground/60 mb-4", children: emptyState.icon }),
|
|
486
|
+
emptyState.title && /* @__PURE__ */ jsx("h3", { className: "text-xl font-medium mb-2", children: emptyState.title }),
|
|
487
|
+
emptyState.message && /* @__PURE__ */ jsx("p", { className: "text-muted-foreground mb-6 max-w-md", children: emptyState.message }),
|
|
488
|
+
emptyState.action
|
|
489
|
+
] })
|
|
490
|
+
}
|
|
491
|
+
);
|
|
492
|
+
}
|
|
493
|
+
return /* @__PURE__ */ jsx(
|
|
494
|
+
"div",
|
|
495
|
+
{
|
|
496
|
+
ref: containerRef,
|
|
497
|
+
className: containerClassName,
|
|
498
|
+
style: containerStyle,
|
|
499
|
+
"data-testid": testId,
|
|
500
|
+
children: /* @__PURE__ */ jsx(
|
|
501
|
+
AgGridReact,
|
|
502
|
+
{
|
|
503
|
+
theme: arbiTheme,
|
|
504
|
+
modules: [AllCommunityModule],
|
|
505
|
+
columnDefs,
|
|
506
|
+
rowData: items,
|
|
507
|
+
pinnedBottomRowData,
|
|
508
|
+
pinnedTopRowData,
|
|
509
|
+
getRowId,
|
|
510
|
+
initialState,
|
|
511
|
+
onGridReady: handleGridReady,
|
|
512
|
+
onFirstDataRendered: handleFirstDataRendered,
|
|
513
|
+
onModelUpdated: handleModelUpdated,
|
|
514
|
+
onSelectionChanged: handleSelectionChanged,
|
|
515
|
+
onCellValueChanged,
|
|
516
|
+
onRowClicked: handleRowClicked,
|
|
517
|
+
onStateUpdated: handleStateUpdated,
|
|
518
|
+
onColumnVisible: handleColumnVisible,
|
|
519
|
+
...combinedOptions
|
|
520
|
+
}
|
|
521
|
+
)
|
|
522
|
+
}
|
|
523
|
+
);
|
|
524
|
+
}
|
|
525
|
+
var DEFAULT_DOCUMENT_VIEW_TOGGLE_LABELS = {
|
|
526
|
+
gallery: "Gallery",
|
|
527
|
+
table: "Table",
|
|
528
|
+
review: "Review",
|
|
529
|
+
smartSearch: "Smart Search"
|
|
530
|
+
};
|
|
531
|
+
function ViewToggleItem({
|
|
532
|
+
option,
|
|
533
|
+
size,
|
|
534
|
+
testIdPrefix,
|
|
535
|
+
showLabel,
|
|
536
|
+
labelClassName,
|
|
537
|
+
hideTooltip
|
|
538
|
+
}) {
|
|
539
|
+
const labelRef = useRef(null);
|
|
540
|
+
const [isTipNeeded, setIsTipNeeded] = useState(true);
|
|
541
|
+
const isLabelShown = () => !!labelRef.current && labelRef.current.offsetParent !== null;
|
|
542
|
+
const content = /* @__PURE__ */ jsxs(
|
|
543
|
+
"span",
|
|
544
|
+
{
|
|
545
|
+
className: "flex items-center gap-1.5",
|
|
546
|
+
onPointerEnter: () => setIsTipNeeded(!isLabelShown()),
|
|
547
|
+
onFocus: () => setIsTipNeeded(!isLabelShown()),
|
|
548
|
+
children: [
|
|
549
|
+
option.icon,
|
|
550
|
+
showLabel && /* @__PURE__ */ jsx("span", { ref: labelRef, className: labelClassName, children: option.label })
|
|
551
|
+
]
|
|
552
|
+
}
|
|
553
|
+
);
|
|
554
|
+
return (
|
|
555
|
+
// The tooltip lives INSIDE the item: wrapping the ToggleGroupItem would make Radix
|
|
556
|
+
// Tooltip's data-state collide with the toggle's on/off state.
|
|
557
|
+
/* @__PURE__ */ jsx(
|
|
558
|
+
ToggleGroupItem,
|
|
559
|
+
{
|
|
560
|
+
value: option.value,
|
|
561
|
+
"aria-label": option.label,
|
|
562
|
+
size,
|
|
563
|
+
className: "rounded-[5px] border-0 bg-transparent text-muted-foreground pointer-coarse:min-h-11 data-[state=off]:hover:bg-background/60 data-[state=off]:hover:text-foreground data-[state=on]:bg-accent data-[state=on]:text-accent-foreground data-[state=on]:hover:bg-accent data-[state=on]:hover:text-accent-foreground",
|
|
564
|
+
"data-testid": `${testIdPrefix}-${option.value}-button`,
|
|
565
|
+
children: hideTooltip ? content : /* @__PURE__ */ jsxs(Tooltip, { children: [
|
|
566
|
+
/* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: content }),
|
|
567
|
+
isTipNeeded && /* @__PURE__ */ jsx(TooltipContent, { children: option.label })
|
|
568
|
+
] })
|
|
569
|
+
}
|
|
570
|
+
)
|
|
571
|
+
);
|
|
572
|
+
}
|
|
573
|
+
function ViewToggle({
|
|
574
|
+
options,
|
|
575
|
+
value,
|
|
576
|
+
onChange,
|
|
577
|
+
testIdPrefix = "view",
|
|
578
|
+
showLabels = false,
|
|
579
|
+
hideTooltips = false,
|
|
580
|
+
size = "default",
|
|
581
|
+
containerCollapse = false,
|
|
582
|
+
className
|
|
583
|
+
}) {
|
|
584
|
+
const labelClassName = containerCollapse ? "hidden @lg:inline text-sm" : "hidden md:inline text-sm";
|
|
585
|
+
return /* @__PURE__ */ jsx(
|
|
586
|
+
ToggleGroup,
|
|
587
|
+
{
|
|
588
|
+
variant: "default",
|
|
589
|
+
type: "single",
|
|
590
|
+
value,
|
|
591
|
+
onValueChange: (next) => next && onChange(next),
|
|
592
|
+
className: cn("gap-0.5 rounded-md bg-muted p-0.5", className),
|
|
593
|
+
children: options.map((option) => /* @__PURE__ */ jsx(
|
|
594
|
+
ViewToggleItem,
|
|
595
|
+
{
|
|
596
|
+
option,
|
|
597
|
+
size,
|
|
598
|
+
testIdPrefix,
|
|
599
|
+
showLabel: showLabels,
|
|
600
|
+
labelClassName,
|
|
601
|
+
hideTooltip: hideTooltips
|
|
602
|
+
},
|
|
603
|
+
option.value
|
|
604
|
+
))
|
|
605
|
+
}
|
|
606
|
+
);
|
|
607
|
+
}
|
|
608
|
+
function documentViewOptions(l) {
|
|
609
|
+
return [
|
|
610
|
+
// "Gallery" (page-preview grid) reads more conventionally than "Tiles".
|
|
611
|
+
{ value: "explorer", icon: /* @__PURE__ */ jsx(FileImage, { className: "size-3.5" }), label: l.gallery },
|
|
612
|
+
{ value: "grid", icon: /* @__PURE__ */ jsx(Table2, { className: "size-3.5" }), label: l.table },
|
|
613
|
+
{ value: "navigator", icon: /* @__PURE__ */ jsx(BookOpen, { className: "size-3.5" }), label: l.review },
|
|
614
|
+
{ value: "search", icon: /* @__PURE__ */ jsx(Search, { className: "size-3.5" }), label: l.smartSearch }
|
|
615
|
+
];
|
|
616
|
+
}
|
|
617
|
+
function DocumentViewToggle({
|
|
618
|
+
viewMode,
|
|
619
|
+
onChange,
|
|
620
|
+
compact,
|
|
621
|
+
labels,
|
|
622
|
+
testIdPrefix,
|
|
623
|
+
compactTestIds
|
|
624
|
+
}) {
|
|
625
|
+
const options = documentViewOptions({ ...DEFAULT_DOCUMENT_VIEW_TOGGLE_LABELS, ...labels });
|
|
626
|
+
if (compact) {
|
|
627
|
+
const current = options.find((o) => o.value === viewMode) ?? options[0];
|
|
628
|
+
return /* @__PURE__ */ jsxs(Select, { value: viewMode, onValueChange: (v) => onChange(v), children: [
|
|
629
|
+
/* @__PURE__ */ jsx(
|
|
630
|
+
SelectTrigger,
|
|
631
|
+
{
|
|
632
|
+
className: "h-7 w-10 justify-center gap-0 border-input p-0 pointer-coarse:h-11! pointer-coarse:w-11! shrink-0 [&>svg]:hidden",
|
|
633
|
+
"aria-label": current.label,
|
|
634
|
+
"data-testid": testIdOr(compactTestIds?.select, {
|
|
635
|
+
testId: "documents-layout-compact-select"
|
|
636
|
+
}),
|
|
637
|
+
children: /* @__PURE__ */ jsx(SelectValue, { children: current.icon })
|
|
638
|
+
}
|
|
639
|
+
),
|
|
640
|
+
/* @__PURE__ */ jsx(SelectContent, { align: "center", children: options.map((option) => /* @__PURE__ */ jsx(
|
|
641
|
+
SelectItem,
|
|
642
|
+
{
|
|
643
|
+
value: option.value,
|
|
644
|
+
"data-testid": testIdOr(compactTestIds?.option?.(option.value), {
|
|
645
|
+
testId: `documents-layout-compact-${option.value}-option`
|
|
646
|
+
}),
|
|
647
|
+
children: /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-2", children: [
|
|
648
|
+
option.icon,
|
|
649
|
+
option.label
|
|
650
|
+
] })
|
|
651
|
+
},
|
|
652
|
+
option.value
|
|
653
|
+
)) })
|
|
654
|
+
] });
|
|
655
|
+
}
|
|
656
|
+
return /* @__PURE__ */ jsx(
|
|
657
|
+
ViewToggle,
|
|
658
|
+
{
|
|
659
|
+
options,
|
|
660
|
+
value: viewMode,
|
|
661
|
+
onChange: (v) => onChange(v),
|
|
662
|
+
testIdPrefix: testIdPrefix ?? "documents-layout",
|
|
663
|
+
showLabels: true,
|
|
664
|
+
containerCollapse: true,
|
|
665
|
+
size: "sm"
|
|
666
|
+
}
|
|
667
|
+
);
|
|
668
|
+
}
|
|
669
|
+
|
|
670
|
+
export { DEFAULT_DOCUMENT_VIEW_TOGGLE_LABELS, DocumentViewToggle, GridView, ViewToggle };
|
|
671
|
+
//# sourceMappingURL=chunk-DVLEQURC.js.map
|
|
672
|
+
//# sourceMappingURL=chunk-DVLEQURC.js.map
|