@arbidocs/blocks 0.5.152 → 0.5.154
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/{ConnectedNativeDocxComparison-244UIHSM.cjs → ConnectedNativeDocxComparison-2DAQX5GX.cjs} +9 -9
- package/dist/{ConnectedStreamedWordArtifact-V6BRZMEQ.cjs.map → ConnectedNativeDocxComparison-2DAQX5GX.cjs.map} +1 -1
- package/dist/{ConnectedPresentation-JUXIXKYN.cjs → ConnectedPresentation-J42JPUVR.cjs} +13 -13
- package/dist/{ConnectedPresentation-JUXIXKYN.cjs.map → ConnectedPresentation-J42JPUVR.cjs.map} +1 -1
- package/dist/{ConnectedSlidesTab-JA3VB66W.cjs → ConnectedSlidesTab-BYS7HFNK.cjs} +12 -12
- package/dist/{ConnectedSlidesTab-JA3VB66W.cjs.map → ConnectedSlidesTab-BYS7HFNK.cjs.map} +1 -1
- package/dist/{ConnectedStreamedWordArtifact-V6BRZMEQ.cjs → ConnectedStreamedWordArtifact-LTYB62VM.cjs} +9 -9
- package/dist/{ConnectedNativeDocxComparison-244UIHSM.cjs.map → ConnectedStreamedWordArtifact-LTYB62VM.cjs.map} +1 -1
- package/dist/{DocumentReviewCard-5W2QQWKA.cjs → DocumentReviewCard-ILDLYZ5A.cjs} +15 -13
- package/dist/DocumentReviewCard-ILDLYZ5A.cjs.map +1 -0
- package/dist/{FilesViewerDialog-63QUTG4L.cjs → FilesViewerDialog-YLD5YFP2.cjs} +25 -22
- package/dist/FilesViewerDialog-YLD5YFP2.cjs.map +1 -0
- package/dist/{RechartsRenderer-NU6WUZJS.cjs → RechartsRenderer-EPVL5QZA.cjs} +2 -2
- package/dist/{RechartsRenderer-NU6WUZJS.cjs.map → RechartsRenderer-EPVL5QZA.cjs.map} +1 -1
- package/dist/{SpotlightStrip-HXQFPAAL.cjs → SpotlightStrip-JE6MXUBT.cjs} +6 -6
- package/dist/{SpotlightStrip-HXQFPAAL.cjs.map → SpotlightStrip-JE6MXUBT.cjs.map} +1 -1
- package/dist/{WorkspaceTableView-2QP2HJLK.cjs → WorkspaceTableView-V3N64LJG.cjs} +13 -11
- package/dist/WorkspaceTableView-V3N64LJG.cjs.map +1 -0
- package/dist/agents/index.cjs +245 -244
- package/dist/agents/workflows/WorkflowLauncher.d.ts +3 -1
- package/dist/agents/workflows/WorkflowLauncher.js +2 -0
- package/dist/agents/workflows/WorkflowLauncher.js.map +2 -2
- package/dist/{ai-ODGRIL6Y.cjs → ai-QFY4LYQZ.cjs} +16 -16
- package/dist/ai-QFY4LYQZ.cjs.map +1 -0
- package/dist/calls/index.cjs +25 -24
- package/dist/calls/index.cjs.map +1 -1
- package/dist/{chunk-MAKCWF45.cjs → chunk-6GKCGCMT.cjs} +4 -4
- package/dist/{chunk-MAKCWF45.cjs.map → chunk-6GKCGCMT.cjs.map} +1 -1
- package/dist/{chunk-LYKT336H.cjs → chunk-6I5HHWCD.cjs} +5 -5
- package/dist/{chunk-LYKT336H.cjs.map → chunk-6I5HHWCD.cjs.map} +1 -1
- package/dist/{chunk-KWJW5TMH.cjs → chunk-6OPDKROP.cjs} +4 -41
- package/dist/chunk-6OPDKROP.cjs.map +1 -0
- package/dist/{chunk-QWOPEBH2.cjs → chunk-6P4U63HO.cjs} +4 -4
- package/dist/{chunk-QWOPEBH2.cjs.map → chunk-6P4U63HO.cjs.map} +1 -1
- package/dist/{chunk-QKCFV36K.cjs → chunk-7UPEFZCV.cjs} +9 -9
- package/dist/{chunk-QKCFV36K.cjs.map → chunk-7UPEFZCV.cjs.map} +1 -1
- package/dist/{chunk-DUNXLT63.cjs → chunk-AHUEBRLX.cjs} +2 -238
- package/dist/chunk-AHUEBRLX.cjs.map +1 -0
- package/dist/{chunk-B5BGVPQ5.cjs → chunk-AURL2KT5.cjs} +4 -4
- package/dist/{chunk-B5BGVPQ5.cjs.map → chunk-AURL2KT5.cjs.map} +1 -1
- package/dist/chunk-BH322H5B.cjs +594 -0
- package/dist/chunk-BH322H5B.cjs.map +1 -0
- package/dist/{chunk-ZCQXQIBA.cjs → chunk-BNDIMTWJ.cjs} +28 -28
- package/dist/{chunk-ZCQXQIBA.cjs.map → chunk-BNDIMTWJ.cjs.map} +1 -1
- package/dist/{chunk-AG6KAGAX.cjs → chunk-BTQ7IAOH.cjs} +4 -4
- package/dist/{chunk-AG6KAGAX.cjs.map → chunk-BTQ7IAOH.cjs.map} +1 -1
- package/dist/{chunk-FCT62ZPE.cjs → chunk-BZVK7JW5.cjs} +5 -5
- package/dist/{chunk-FCT62ZPE.cjs.map → chunk-BZVK7JW5.cjs.map} +1 -1
- package/dist/{chunk-WUM76MJU.cjs → chunk-CNBYM5Q7.cjs} +7 -7
- package/dist/{chunk-WUM76MJU.cjs.map → chunk-CNBYM5Q7.cjs.map} +1 -1
- package/dist/{chunk-HNLNRAEU.cjs → chunk-DSLMJ24E.cjs} +2 -261
- package/dist/chunk-DSLMJ24E.cjs.map +1 -0
- package/dist/chunk-DWRUGOTQ.cjs +35 -0
- package/dist/chunk-DWRUGOTQ.cjs.map +1 -0
- package/dist/{chunk-GAA222SK.cjs → chunk-EG3DPKXM.cjs} +5 -5
- package/dist/{chunk-GAA222SK.cjs.map → chunk-EG3DPKXM.cjs.map} +1 -1
- package/dist/chunk-FEAHTNTY.cjs +1447 -0
- package/dist/chunk-FEAHTNTY.cjs.map +1 -0
- package/dist/{chunk-VSDD5TH5.cjs → chunk-G3MRW4WB.cjs} +10 -8
- package/dist/chunk-G3MRW4WB.cjs.map +1 -0
- package/dist/{chunk-TFRCNIUY.cjs → chunk-GF6AYAMI.cjs} +9 -9
- package/dist/{chunk-TFRCNIUY.cjs.map → chunk-GF6AYAMI.cjs.map} +1 -1
- package/dist/{chunk-4ZR4O5SP.cjs → chunk-GK3U3FWY.cjs} +60 -28
- package/dist/chunk-GK3U3FWY.cjs.map +1 -0
- package/dist/{chunk-3CJTO6RV.cjs → chunk-GXRD5OSU.cjs} +8 -8
- package/dist/{chunk-3CJTO6RV.cjs.map → chunk-GXRD5OSU.cjs.map} +1 -1
- package/dist/{chunk-JLNKD56X.cjs → chunk-GYI4UXX6.cjs} +4 -4
- package/dist/{chunk-JLNKD56X.cjs.map → chunk-GYI4UXX6.cjs.map} +1 -1
- package/dist/{chunk-4I2PCP7O.cjs → chunk-I3XTTTPZ.cjs} +41 -40
- package/dist/chunk-I3XTTTPZ.cjs.map +1 -0
- package/dist/chunk-JWCVA4LC.cjs +248 -0
- package/dist/chunk-JWCVA4LC.cjs.map +1 -0
- package/dist/{chunk-UM3EWCDE.cjs → chunk-K5F2VNCX.cjs} +35 -10
- package/dist/chunk-K5F2VNCX.cjs.map +1 -0
- package/dist/chunk-KD66CBYO.cjs +44 -0
- package/dist/chunk-KD66CBYO.cjs.map +1 -0
- package/dist/chunk-LLVE5TST.cjs +318 -0
- package/dist/chunk-LLVE5TST.cjs.map +1 -0
- package/dist/{chunk-JCFXS336.cjs → chunk-NRGLF4J4.cjs} +2 -466
- package/dist/chunk-NRGLF4J4.cjs.map +1 -0
- package/dist/{chunk-CVVQHFLR.cjs → chunk-O7U6KL2W.cjs} +72 -650
- package/dist/chunk-O7U6KL2W.cjs.map +1 -0
- package/dist/{chunk-Z3N32LL4.cjs → chunk-OOANNOH4.cjs} +35 -33
- package/dist/chunk-OOANNOH4.cjs.map +1 -0
- package/dist/chunk-SGYURQ23.cjs +271 -0
- package/dist/chunk-SGYURQ23.cjs.map +1 -0
- package/dist/{chunk-A5SKK3CU.cjs → chunk-SLCH5JRI.cjs} +64 -35
- package/dist/chunk-SLCH5JRI.cjs.map +1 -0
- package/dist/chunk-T26UYA6Q.cjs +64 -0
- package/dist/chunk-T26UYA6Q.cjs.map +1 -0
- package/dist/chunk-T3Y3LZ4Y.cjs +477 -0
- package/dist/chunk-T3Y3LZ4Y.cjs.map +1 -0
- package/dist/{chunk-4XNP27N4.cjs → chunk-T7BUGVSG.cjs} +36 -36
- package/dist/{chunk-4XNP27N4.cjs.map → chunk-T7BUGVSG.cjs.map} +1 -1
- package/dist/{chunk-SMO4SPPB.cjs → chunk-TD5V5BZ3.cjs} +5 -5
- package/dist/{chunk-SMO4SPPB.cjs.map → chunk-TD5V5BZ3.cjs.map} +1 -1
- package/dist/{chunk-IXTDOPSB.cjs → chunk-TSAZWUPZ.cjs} +4 -4
- package/dist/{chunk-IXTDOPSB.cjs.map → chunk-TSAZWUPZ.cjs.map} +1 -1
- package/dist/{chunk-5DGNJ6VJ.cjs → chunk-UD3LPATQ.cjs} +6 -6
- package/dist/{chunk-5DGNJ6VJ.cjs.map → chunk-UD3LPATQ.cjs.map} +1 -1
- package/dist/{chunk-OF7KMG6R.cjs → chunk-UJHQ4DA4.cjs} +5 -5
- package/dist/{chunk-OF7KMG6R.cjs.map → chunk-UJHQ4DA4.cjs.map} +1 -1
- package/dist/{chunk-NUFZFWHZ.cjs → chunk-W5QSKW7T.cjs} +3 -29
- package/dist/chunk-W5QSKW7T.cjs.map +1 -0
- package/dist/{chunk-NNZFZYTI.cjs → chunk-WOVNXJK5.cjs} +4 -54
- package/dist/chunk-WOVNXJK5.cjs.map +1 -0
- package/dist/{chunk-E6BM5ENI.cjs → chunk-WRTEKOQP.cjs} +2 -309
- package/dist/chunk-WRTEKOQP.cjs.map +1 -0
- package/dist/{chunk-KRQCUVH7.cjs → chunk-YSAUOJA7.cjs} +9 -3
- package/dist/chunk-YSAUOJA7.cjs.map +1 -0
- package/dist/{chunk-6ZZWQ3OL.cjs → chunk-YXY52OGU.cjs} +4 -4
- package/dist/{chunk-6ZZWQ3OL.cjs.map → chunk-YXY52OGU.cjs.map} +1 -1
- package/dist/{chunk-D5DOK2AE.cjs → chunk-ZW2ZFC3Q.cjs} +58 -58
- package/dist/{chunk-D5DOK2AE.cjs.map → chunk-ZW2ZFC3Q.cjs.map} +1 -1
- package/dist/components/gestures/usePointerGesture.d.ts +13 -1
- package/dist/components/gestures/usePointerGesture.js +33 -8
- package/dist/components/gestures/usePointerGesture.js.map +2 -2
- package/dist/connect/docx.cjs +12 -12
- package/dist/connect/index.cjs +1319 -2361
- package/dist/connect/index.cjs.map +1 -1
- package/dist/connect/index.d.ts +1 -0
- package/dist/connect/index.js +1 -0
- package/dist/connect/index.js.map +2 -2
- package/dist/connect/viewer.cjs +15 -12
- package/dist/connection/dashboards/DashboardPanel.d.ts +2 -0
- package/dist/connection/dashboards/DashboardPanel.js +4 -0
- package/dist/connection/dashboards/DashboardPanel.js.map +2 -2
- package/dist/connection/dashboards/index.d.ts +1 -1
- package/dist/connection/dashboards/index.js +2 -0
- package/dist/connection/dashboards/index.js.map +2 -2
- package/dist/connection/dashboards/templates.d.ts +10 -5
- package/dist/connection/dashboards/templates.js +7 -1
- package/dist/connection/dashboards/templates.js.map +2 -2
- package/dist/connection/live-blocks/ConnectedAgendaBlock.d.ts +13 -0
- package/dist/connection/live-blocks/ConnectedAgendaBlock.js +19 -0
- package/dist/connection/live-blocks/ConnectedAgendaBlock.js.map +7 -0
- package/dist/connection/live-blocks/ConnectedCarouselBlock.d.ts +7 -0
- package/dist/connection/live-blocks/ConnectedCarouselBlock.js +84 -0
- package/dist/connection/live-blocks/ConnectedCarouselBlock.js.map +7 -0
- package/dist/connection/live-blocks/ConnectedListBlock.d.ts +29 -0
- package/dist/connection/live-blocks/ConnectedListBlock.js +193 -0
- package/dist/connection/live-blocks/ConnectedListBlock.js.map +7 -0
- package/dist/connection/live-blocks/ConnectedStartBlock.d.ts +7 -0
- package/dist/connection/live-blocks/ConnectedStartBlock.js +16 -0
- package/dist/connection/live-blocks/ConnectedStartBlock.js.map +7 -0
- package/dist/connection/live-blocks/DashboardAgenda.d.ts +10 -0
- package/dist/connection/{workspace-dashboard → live-blocks}/DashboardAgenda.js +10 -2
- package/dist/connection/live-blocks/DashboardAgenda.js.map +7 -0
- package/dist/connection/{workspace-dashboard → live-blocks}/DashboardStart.js.map +1 -1
- package/dist/connection/live-blocks/LiveBlockRoot.d.ts +11 -0
- package/dist/connection/live-blocks/LiveBlockRoot.js +22 -0
- package/dist/connection/live-blocks/LiveBlockRoot.js.map +7 -0
- package/dist/connection/live-blocks/index.d.ts +5 -0
- package/dist/connection/live-blocks/index.js +20 -0
- package/dist/connection/live-blocks/index.js.map +7 -0
- package/dist/connection/{workspace-dashboard/dashboard-rows.d.ts → live-blocks/list-rows.d.ts} +22 -4
- package/dist/connection/{workspace-dashboard/dashboard-rows.js → live-blocks/list-rows.js} +13 -8
- package/dist/connection/live-blocks/list-rows.js.map +7 -0
- package/dist/connection/{workspace-dashboard → live-blocks}/useDashboardAdd.js.map +1 -1
- package/dist/connection/live-blocks/workspace-dashboard-blocks.d.ts +23 -0
- package/dist/connection/live-blocks/workspace-dashboard-blocks.js +58 -0
- package/dist/connection/live-blocks/workspace-dashboard-blocks.js.map +7 -0
- package/dist/connection/pages/BlockEditor.d.ts +3 -1
- package/dist/connection/pages/BlockEditor.js +18 -1
- package/dist/connection/pages/BlockEditor.js.map +2 -2
- package/dist/connection/pages/ConnectedPagesPage.d.ts +5 -4
- package/dist/connection/pages/ConnectedPagesPage.js +122 -46
- package/dist/connection/pages/ConnectedPagesPage.js.map +2 -2
- package/dist/connection/pages/EditablePageGrid.d.ts +25 -15
- package/dist/connection/pages/EditablePageGrid.js +145 -50
- package/dist/connection/pages/EditablePageGrid.js.map +2 -2
- package/dist/connection/pages/LiveBlockEditor.d.ts +30 -0
- package/dist/connection/pages/LiveBlockEditor.js +175 -0
- package/dist/connection/pages/LiveBlockEditor.js.map +7 -0
- package/dist/connection/pages/PageBlockView.d.ts +5 -3
- package/dist/connection/pages/PageBlockView.js +69 -4
- package/dist/connection/pages/PageBlockView.js.map +2 -2
- package/dist/connection/pages/PageGrid.d.ts +4 -3
- package/dist/connection/pages/PageGrid.js +4 -2
- package/dist/connection/pages/PageGrid.js.map +2 -2
- package/dist/connection/pages/PagesList.d.ts +4 -3
- package/dist/connection/pages/PagesList.js.map +2 -2
- package/dist/connection/pages/TableViewBlock.d.ts +5 -4
- package/dist/connection/pages/TableViewBlock.js +19 -19
- package/dist/connection/pages/TableViewBlock.js.map +2 -2
- package/dist/connection/pages/grid-layout.d.ts +44 -12
- package/dist/connection/pages/grid-layout.js +71 -27
- package/dist/connection/pages/grid-layout.js.map +2 -2
- package/dist/connection/pages/index.d.ts +4 -2
- package/dist/connection/pages/index.js +34 -5
- package/dist/connection/pages/index.js.map +2 -2
- package/dist/connection/pages/labels.js +5 -1
- package/dist/connection/pages/labels.js.map +2 -2
- package/dist/connection/pages/page-templates.d.ts +10 -0
- package/dist/connection/pages/page-templates.js +16 -0
- package/dist/connection/pages/page-templates.js.map +7 -0
- package/dist/connection/storage/ConnectedStorageProjectCard.js +1 -1
- package/dist/connection/storage/ConnectedStorageProjectCard.js.map +2 -2
- package/dist/connection/storage/ConnectedWorkspaceTrash.d.ts +3 -0
- package/dist/connection/storage/ConnectedWorkspaceTrash.js +41 -17
- package/dist/connection/storage/ConnectedWorkspaceTrash.js.map +2 -2
- package/dist/connection/workflows/ConnectedWorkflowStart.d.ts +2 -0
- package/dist/connection/workflows/ConnectedWorkflowStart.js.map +2 -2
- package/dist/connection/workspace-dashboard/ConnectedWorkspaceDashboard.d.ts +10 -7
- package/dist/connection/workspace-dashboard/ConnectedWorkspaceDashboard.js +31 -171
- package/dist/connection/workspace-dashboard/ConnectedWorkspaceDashboard.js.map +3 -3
- package/dist/dashboards/ChartRenderer.d.ts +5 -3
- package/dist/dashboards/ChartRenderer.js +29 -18
- package/dist/dashboards/ChartRenderer.js.map +2 -2
- package/dist/dashboards/PanelView.d.ts +6 -1
- package/dist/dashboards/PanelView.js +24 -7
- package/dist/dashboards/PanelView.js.map +2 -2
- package/dist/dashboards/RechartsRenderer.d.ts +2 -1
- package/dist/dashboards/RechartsRenderer.js.map +2 -2
- package/dist/dashboards/index.cjs +25 -21
- package/dist/embed/index.cjs +23 -20
- package/dist/files/index.cjs +250 -249
- package/dist/home/FactsStrip.d.ts +3 -1
- package/dist/home/FactsStrip.js +3 -2
- package/dist/home/FactsStrip.js.map +2 -2
- package/dist/home/RecentList.d.ts +4 -2
- package/dist/home/RecentList.js +3 -2
- package/dist/home/RecentList.js.map +2 -2
- package/dist/home/StartTiles.d.ts +6 -1
- package/dist/home/StartTiles.js +55 -33
- package/dist/home/StartTiles.js.map +2 -2
- package/dist/home/index.cjs +62 -57
- package/dist/home/index.d.ts +1 -1
- package/dist/home/index.js +2 -1
- package/dist/home/index.js.map +2 -2
- package/dist/home/sections.d.ts +5 -0
- package/dist/home/sections.js +7 -0
- package/dist/home/sections.js.map +2 -2
- package/dist/index.cjs +339 -337
- package/dist/index.cjs.map +1 -1
- package/dist/pages/index.cjs +635 -157
- package/dist/pages/index.cjs.map +1 -1
- package/dist/settings/index.cjs +170 -169
- package/dist/shell/index.cjs +35 -34
- package/dist/studio/index.cjs +12 -12
- package/dist/styles.css +1 -1
- package/dist/workflow-canvas/index.cjs +33 -29
- package/dist/workflow-canvas/index.cjs.map +1 -1
- package/dist/workspaces/index.cjs +49 -47
- package/dist/workspaces/index.cjs.map +1 -1
- package/node_modules/@arbidocs/coedit/package.json +1 -1
- package/package.json +5 -5
- package/dist/DocumentReviewCard-5W2QQWKA.cjs.map +0 -1
- package/dist/FilesViewerDialog-63QUTG4L.cjs.map +0 -1
- package/dist/WorkspaceTableView-2QP2HJLK.cjs.map +0 -1
- package/dist/ai-ODGRIL6Y.cjs.map +0 -1
- package/dist/chunk-4I2PCP7O.cjs.map +0 -1
- package/dist/chunk-4ZR4O5SP.cjs.map +0 -1
- package/dist/chunk-A5SKK3CU.cjs.map +0 -1
- package/dist/chunk-CVVQHFLR.cjs.map +0 -1
- package/dist/chunk-DUNXLT63.cjs.map +0 -1
- package/dist/chunk-E6BM5ENI.cjs.map +0 -1
- package/dist/chunk-HNLNRAEU.cjs.map +0 -1
- package/dist/chunk-JCFXS336.cjs.map +0 -1
- package/dist/chunk-KRQCUVH7.cjs.map +0 -1
- package/dist/chunk-KWJW5TMH.cjs.map +0 -1
- package/dist/chunk-NNZFZYTI.cjs.map +0 -1
- package/dist/chunk-NUFZFWHZ.cjs.map +0 -1
- package/dist/chunk-UM3EWCDE.cjs.map +0 -1
- package/dist/chunk-VSDD5TH5.cjs.map +0 -1
- package/dist/chunk-Z3N32LL4.cjs.map +0 -1
- package/dist/connection/workspace-dashboard/DashboardAgenda.d.ts +0 -1
- package/dist/connection/workspace-dashboard/DashboardAgenda.js.map +0 -7
- package/dist/connection/workspace-dashboard/dashboard-rows.js.map +0 -7
- /package/dist/connection/{workspace-dashboard → live-blocks}/DashboardStart.d.ts +0 -0
- /package/dist/connection/{workspace-dashboard → live-blocks}/DashboardStart.js +0 -0
- /package/dist/connection/{workspace-dashboard → live-blocks}/useDashboardAdd.d.ts +0 -0
- /package/dist/connection/{workspace-dashboard → live-blocks}/useDashboardAdd.js +0 -0
|
@@ -1,29 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { FileText, MessagesSquare, Milestone, Plus, Upload } from "lucide-react";
|
|
5
|
-
import { useFacts } from "@arbidocs/react";
|
|
6
|
-
import { useAssistantCopy } from "@arbidocs/react/shell";
|
|
7
|
-
import { EntityIcon, getDocIcon, getEntityLabel } from "@arbidocs/react/ui";
|
|
8
|
-
import {
|
|
9
|
-
DASHBOARD_QUIET_ACTION_CLASS,
|
|
10
|
-
DashboardAction,
|
|
11
|
-
DashboardBand,
|
|
12
|
-
DashboardColumns,
|
|
13
|
-
DashboardRoot,
|
|
14
|
-
FactMark
|
|
15
|
-
} from "../../home/DashboardParts.js";
|
|
16
|
-
import { FactsStrip } from "../../home/FactsStrip.js";
|
|
17
|
-
import { RecentList } from "../../home/RecentList.js";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { DashboardBand, DashboardColumns, DashboardRoot } from "../../home/DashboardParts.js";
|
|
18
4
|
import { SectionLabel } from "../../home/sections.js";
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
|
|
24
|
-
import { DashboardStart } from "./DashboardStart.js";
|
|
25
|
-
import { recentConversations, recentDocuments, splitFacts } from "./dashboard-rows.js";
|
|
26
|
-
import { useDashboardAdd } from "./useDashboardAdd.js";
|
|
5
|
+
import { ConnectedAgendaBlock } from "../live-blocks/ConnectedAgendaBlock.js";
|
|
6
|
+
import { ConnectedListBlock } from "../live-blocks/ConnectedListBlock.js";
|
|
7
|
+
import { ConnectedStartBlock } from "../live-blocks/ConnectedStartBlock.js";
|
|
8
|
+
import { WORKSPACE_DASHBOARD_LAYOUT } from "../live-blocks/workspace-dashboard-blocks.js";
|
|
9
|
+
const { files, threads, facts, agenda } = WORKSPACE_DASHBOARD_LAYOUT;
|
|
27
10
|
function ConnectedWorkspaceDashboard({
|
|
28
11
|
start,
|
|
29
12
|
addFilesAction,
|
|
@@ -32,160 +15,37 @@ function ConnectedWorkspaceDashboard({
|
|
|
32
15
|
onTakePhoto,
|
|
33
16
|
testId = "workspace-dashboard"
|
|
34
17
|
}) {
|
|
35
|
-
const {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
openThreads,
|
|
41
|
-
openFacts,
|
|
42
|
-
hrefFor
|
|
43
|
-
} = useBlocksEnvironment();
|
|
44
|
-
const [newThreadOpen, setNewThreadOpen] = useState(false);
|
|
45
|
-
const add = useDashboardAdd({ onCreateNew, onTakePhoto });
|
|
46
|
-
const ask = () => openNewConversation();
|
|
47
|
-
const { workspaceId } = useConnectedWorkspace();
|
|
48
|
-
const { data: documents } = useListedDocuments();
|
|
49
|
-
const { data: conversations } = useConnectedConversations();
|
|
50
|
-
const { data: facts = [] } = useFacts(workspaceId);
|
|
51
|
-
const conversationIcon = /* @__PURE__ */ jsx(EntityIcon, { entityType: "CONVERSATION", className: "mt-0.5 size-5 shrink-0" });
|
|
52
|
-
const chatRows = useMemo(
|
|
53
|
-
() => recentConversations(conversations).map((row) => ({
|
|
54
|
-
...row,
|
|
55
|
-
leading: conversationIcon,
|
|
56
|
-
href: hrefFor({ kind: "conversation", conversationId: row.id, workspaceId }),
|
|
57
|
-
onSelect: () => openConversation(row.id)
|
|
58
|
-
})),
|
|
59
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
60
|
-
[conversations, workspaceId, openConversation, hrefFor]
|
|
61
|
-
);
|
|
62
|
-
const assistant = useAssistantCopy();
|
|
63
|
-
const docRows = useMemo(
|
|
64
|
-
() => recentDocuments(documents).map(({ fileName, ...row }) => ({
|
|
65
|
-
...row,
|
|
66
|
-
// The file-type mark, bare: it carries its own identity.
|
|
67
|
-
leading: /* @__PURE__ */ jsx("span", { className: "mt-0.5 shrink-0", children: getDocIcon(fileName, 20) }),
|
|
68
|
-
href: hrefFor({ kind: "document", documentId: row.id, workspaceId }),
|
|
69
|
-
onSelect: () => openDocument(row.id)
|
|
70
|
-
})),
|
|
71
|
-
[documents, workspaceId, openDocument, hrefFor]
|
|
72
|
-
);
|
|
73
|
-
const { upcoming, recent } = useMemo(() => {
|
|
74
|
-
const { upcoming: upcoming2, recent: recent2 } = splitFacts(facts);
|
|
75
|
-
const toRow = (row) => ({
|
|
76
|
-
...row,
|
|
77
|
-
leading: /* @__PURE__ */ jsx(FactMark, {}),
|
|
78
|
-
// The item, not the list: the Facts page scrolls to this fact.
|
|
79
|
-
onSelect: openFacts && (() => openFacts({ focusId: row.id }))
|
|
80
|
-
});
|
|
81
|
-
return { upcoming: upcoming2.map(toRow), recent: recent2.map(toRow) };
|
|
82
|
-
}, [facts, openFacts]);
|
|
83
|
-
const newFact = openFacts && (() => openFacts({ compose: true }));
|
|
84
|
-
const startBand = start === void 0 ? /* @__PURE__ */ jsx(DashboardStart, { addMenu: add.menu, onCreateNew }) : start;
|
|
85
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
86
|
-
/* @__PURE__ */ jsxs(DashboardRoot, { testId, children: [
|
|
87
|
-
startBand && /* @__PURE__ */ jsx(DashboardBand, { kind: "start", children: startBand }),
|
|
88
|
-
/* @__PURE__ */ jsxs(DashboardBand, { kind: "recent", children: [
|
|
89
|
-
/* @__PURE__ */ jsx(SectionLabel, { testId: `${testId}-recent-caption`, children: "Recent" }),
|
|
90
|
-
/* @__PURE__ */ jsxs(DashboardColumns, { children: [
|
|
91
|
-
/* @__PURE__ */ jsx(
|
|
92
|
-
RecentList,
|
|
93
|
-
{
|
|
94
|
-
testId: `${testId}-docs`,
|
|
95
|
-
icon: FileText,
|
|
96
|
-
title: getEntityLabel("DOCUMENT", "PLURAL"),
|
|
97
|
-
count: documents.length,
|
|
98
|
-
onOpen: () => openFiles(),
|
|
99
|
-
action: addFilesAction === void 0 ? add.menu({ canUpload: true, className: DASHBOARD_QUIET_ACTION_CLASS }) : addFilesAction,
|
|
100
|
-
rows: docRows,
|
|
101
|
-
caption: "Added",
|
|
102
|
-
empty: {
|
|
103
|
-
icon: Upload,
|
|
104
|
-
label: "Add files or emails",
|
|
105
|
-
description: "From your computer, a web link, or a connected mailbox.",
|
|
106
|
-
onSelect: add.addFiles
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
),
|
|
110
|
-
/* @__PURE__ */ jsx(
|
|
111
|
-
RecentList,
|
|
112
|
-
{
|
|
113
|
-
testId: `${testId}-chats`,
|
|
114
|
-
icon: MessagesSquare,
|
|
115
|
-
title: getEntityLabel("CONVERSATION", "PLURAL"),
|
|
116
|
-
count: conversations.length,
|
|
117
|
-
onOpen: openThreads && (() => openThreads()),
|
|
118
|
-
action: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
|
|
119
|
-
/* @__PURE__ */ jsx(
|
|
120
|
-
DashboardAction,
|
|
121
|
-
{
|
|
122
|
-
emphasis: "primary",
|
|
123
|
-
icon: /* @__PURE__ */ jsx(Plus, { className: "size-4" }),
|
|
124
|
-
label: assistant.ask,
|
|
125
|
-
onClick: ask,
|
|
126
|
-
testId: `${testId}-chats-ask`
|
|
127
|
-
}
|
|
128
|
-
),
|
|
129
|
-
/* @__PURE__ */ jsx(
|
|
130
|
-
DashboardAction,
|
|
131
|
-
{
|
|
132
|
-
emphasis: "quiet",
|
|
133
|
-
icon: /* @__PURE__ */ jsx(Plus, { className: "size-4" }),
|
|
134
|
-
label: "New",
|
|
135
|
-
onClick: () => setNewThreadOpen(true),
|
|
136
|
-
testId: `${testId}-chats-new`
|
|
137
|
-
}
|
|
138
|
-
)
|
|
139
|
-
] }),
|
|
140
|
-
rows: chatRows,
|
|
141
|
-
caption: "Messaged",
|
|
142
|
-
empty: {
|
|
143
|
-
icon: Plus,
|
|
144
|
-
label: assistant.askAnything,
|
|
145
|
-
description: "Questions are answered from this workspace's files.",
|
|
146
|
-
onSelect: ask
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
)
|
|
150
|
-
] })
|
|
151
|
-
] }),
|
|
18
|
+
const startBand = start === void 0 ? /* @__PURE__ */ jsx(ConnectedStartBlock, { onCreateNew, onTakePhoto }) : start;
|
|
19
|
+
return /* @__PURE__ */ jsxs(DashboardRoot, { testId, children: [
|
|
20
|
+
startBand && /* @__PURE__ */ jsx(DashboardBand, { kind: "start", children: startBand }),
|
|
21
|
+
/* @__PURE__ */ jsxs(DashboardBand, { kind: "recent", children: [
|
|
22
|
+
/* @__PURE__ */ jsx(SectionLabel, { testId: `${testId}-recent-caption`, children: "Recent" }),
|
|
152
23
|
/* @__PURE__ */ jsxs(DashboardColumns, { children: [
|
|
153
24
|
/* @__PURE__ */ jsx(
|
|
154
|
-
|
|
25
|
+
ConnectedListBlock,
|
|
155
26
|
{
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
DashboardAction,
|
|
163
|
-
{
|
|
164
|
-
emphasis: "quiet",
|
|
165
|
-
icon: /* @__PURE__ */ jsx(Plus, { className: "size-4" }),
|
|
166
|
-
label: "New fact",
|
|
167
|
-
onClick: newFact,
|
|
168
|
-
testId: `${testId}-facts-action`
|
|
169
|
-
}
|
|
170
|
-
),
|
|
171
|
-
groups: [
|
|
172
|
-
{ caption: "Upcoming", rows: upcoming, rowTestId: `${testId}-facts-upcoming-row` },
|
|
173
|
-
{ caption: "Created", rows: recent, rowTestId: `${testId}-facts-row` }
|
|
174
|
-
],
|
|
175
|
-
empty: {
|
|
176
|
-
icon: Milestone,
|
|
177
|
-
label: `Add your first ${getEntityLabel("FACT").toLowerCase()}`,
|
|
178
|
-
description: "A date, a decision, a preference \u2014 anything worth remembering.",
|
|
179
|
-
onSelect: newFact,
|
|
180
|
-
testId: `${testId}-facts-empty-action`
|
|
181
|
-
}
|
|
27
|
+
config: files.config,
|
|
28
|
+
addFilesAction,
|
|
29
|
+
onCreateNew,
|
|
30
|
+
onTakePhoto,
|
|
31
|
+
showLoading: false,
|
|
32
|
+
testId: `${testId}-docs`
|
|
182
33
|
}
|
|
183
34
|
),
|
|
184
|
-
|
|
35
|
+
/* @__PURE__ */ jsx(
|
|
36
|
+
ConnectedListBlock,
|
|
37
|
+
{
|
|
38
|
+
config: threads.config,
|
|
39
|
+
showLoading: false,
|
|
40
|
+
testId: `${testId}-chats`
|
|
41
|
+
}
|
|
42
|
+
)
|
|
185
43
|
] })
|
|
186
44
|
] }),
|
|
187
|
-
|
|
188
|
-
|
|
45
|
+
/* @__PURE__ */ jsxs(DashboardColumns, { children: [
|
|
46
|
+
/* @__PURE__ */ jsx(ConnectedListBlock, { config: facts.config, showLoading: false, testId: `${testId}-facts` }),
|
|
47
|
+
aside === void 0 ? /* @__PURE__ */ jsx(ConnectedAgendaBlock, { config: agenda.config }) : aside
|
|
48
|
+
] })
|
|
189
49
|
] });
|
|
190
50
|
}
|
|
191
51
|
export {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/connection/workspace-dashboard/ConnectedWorkspaceDashboard.tsx"],
|
|
4
|
-
"sourcesContent": ["/**\n * The open workspace's home: what a returning person needs, in order. What they can start (the\n * Start band), then what is recent (the last files and threads, each a way back in), then its\n * facts (upcoming dated ones, the newest others) beside the agenda.\n *\n * Every section always shows, each with its own empty state, so a new workspace has the same
|
|
5
|
-
"mappings": ";
|
|
6
|
-
"names": [
|
|
4
|
+
"sourcesContent": ["/**\n * The open workspace's home: what a returning person needs, in order. What they can start (the\n * Start band), then what is recent (the last files and threads, each a way back in), then its\n * facts (upcoming dated ones, the newest others) beside the agenda.\n *\n * Every section is a live page block (`ConnectedStartBlock`, `ConnectedListBlock`,\n * `ConnectedAgendaBlock`) of the one dashboard definition (`WORKSPACE_DASHBOARD_LAYOUT`), the\n * same the \"Dashboard\" page template copies; here they sit in fixed bands, not editable. Every\n * section always shows, each with its own empty state, so a new workspace has the same layout as a\n * busy one. A row opens its thing (`BlocksEnvironment.openDocument` / `openConversation`); a\n * section's header, a fact and \"New fact\" go to the host's pages (`openFiles`, `openThreads`,\n * `openFacts`); asking starts a new conversation (`openNewConversation`); adding goes to the host's\n * upload (`openUpload`). \"New\" opens the new-thread dialog, and the Add menu's URL and email-in\n * dialogs open in place.\n */\nimport type { ReactNode } from 'react'\nimport { DashboardBand, DashboardColumns, DashboardRoot } from '../../home/DashboardParts'\nimport { SectionLabel } from '../../home/sections'\nimport { ConnectedAgendaBlock } from '../live-blocks/ConnectedAgendaBlock'\nimport { ConnectedListBlock } from '../live-blocks/ConnectedListBlock'\nimport { ConnectedStartBlock } from '../live-blocks/ConnectedStartBlock'\nimport { WORKSPACE_DASHBOARD_LAYOUT } from '../live-blocks/workspace-dashboard-blocks'\n\nexport interface ConnectedWorkspaceDashboardProps {\n /** The Start band. Default: the dashboard workflows, \"Create a file\" and Add; `null` hides it. */\n start?: ReactNode\n /** The Files section's add control. Default: the Add source menu. */\n addFilesAction?: ReactNode\n /** Beside the facts. Default: the calendar's agenda (what is coming up); `null` hides it. */\n aside?: ReactNode\n /** \"Create a file\" (a Start tile and an Add item): the host's new-file chooser. Absent: not offered. */\n onCreateNew?: () => void\n /** \"Take photo\" in the Add menu. Absent: not offered. */\n onTakePhoto?: () => void\n testId?: string\n}\n\nconst { files, threads, facts, agenda } = WORKSPACE_DASHBOARD_LAYOUT\n\nexport function ConnectedWorkspaceDashboard({\n start,\n addFilesAction,\n aside,\n onCreateNew,\n onTakePhoto,\n testId = 'workspace-dashboard',\n}: ConnectedWorkspaceDashboardProps) {\n const startBand =\n start === undefined ? (\n <ConnectedStartBlock onCreateNew={onCreateNew} onTakePhoto={onTakePhoto} />\n ) : (\n start\n )\n\n // The dashboard invites a first item at once: its lists show no placeholder rows while loading.\n return (\n <DashboardRoot testId={testId}>\n {startBand && <DashboardBand kind=\"start\">{startBand}</DashboardBand>}\n\n {/* One eyebrow over the row: the page reads as what you can start, then what is recent. */}\n <DashboardBand kind=\"recent\">\n <SectionLabel testId={`${testId}-recent-caption`}>Recent</SectionLabel>\n <DashboardColumns>\n {/* Files lead: they are what the workspace is; threads are what was asked of them. */}\n <ConnectedListBlock\n config={files.config}\n addFilesAction={addFilesAction}\n onCreateNew={onCreateNew}\n onTakePhoto={onTakePhoto}\n showLoading={false}\n testId={`${testId}-docs`}\n />\n <ConnectedListBlock\n config={threads.config}\n showLoading={false}\n testId={`${testId}-chats`}\n />\n </DashboardColumns>\n </DashboardBand>\n\n {/* Facts take one column of the same grid, as wide as Files. */}\n <DashboardColumns>\n <ConnectedListBlock config={facts.config} showLoading={false} testId={`${testId}-facts`} />\n {aside === undefined ? <ConnectedAgendaBlock config={agenda.config} /> : aside}\n </DashboardColumns>\n </DashboardRoot>\n )\n}\n"],
|
|
5
|
+
"mappings": ";AAiDM,cAaE,YAbF;AAjCN,SAAS,eAAe,kBAAkB,qBAAqB;AAC/D,SAAS,oBAAoB;AAC7B,SAAS,4BAA4B;AACrC,SAAS,0BAA0B;AACnC,SAAS,2BAA2B;AACpC,SAAS,kCAAkC;AAgB3C,MAAM,EAAE,OAAO,SAAS,OAAO,OAAO,IAAI;AAEnC,SAAS,4BAA4B;AAAA,EAC1C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,SAAS;AACX,GAAqC;AACnC,QAAM,YACJ,UAAU,SACR,oBAAC,uBAAoB,aAA0B,aAA0B,IAEzE;AAIJ,SACE,qBAAC,iBAAc,QACZ;AAAA,iBAAa,oBAAC,iBAAc,MAAK,SAAS,qBAAU;AAAA,IAGrD,qBAAC,iBAAc,MAAK,UAClB;AAAA,0BAAC,gBAAa,QAAQ,GAAG,MAAM,mBAAmB,oBAAM;AAAA,MACxD,qBAAC,oBAEC;AAAA;AAAA,UAAC;AAAA;AAAA,YACC,QAAQ,MAAM;AAAA,YACd;AAAA,YACA;AAAA,YACA;AAAA,YACA,aAAa;AAAA,YACb,QAAQ,GAAG,MAAM;AAAA;AAAA,QACnB;AAAA,QACA;AAAA,UAAC;AAAA;AAAA,YACC,QAAQ,QAAQ;AAAA,YAChB,aAAa;AAAA,YACb,QAAQ,GAAG,MAAM;AAAA;AAAA,QACnB;AAAA,SACF;AAAA,OACF;AAAA,IAGA,qBAAC,oBACC;AAAA,0BAAC,sBAAmB,QAAQ,MAAM,QAAQ,aAAa,OAAO,QAAQ,GAAG,MAAM,UAAU;AAAA,MACxF,UAAU,SAAY,oBAAC,wBAAqB,QAAQ,OAAO,QAAQ,IAAK;AAAA,OAC3E;AAAA,KACF;AAEJ;",
|
|
6
|
+
"names": []
|
|
7
7
|
}
|
|
@@ -14,8 +14,8 @@ export declare const DEFAULT_CHART_RENDERER_LABELS: ChartRendererLabels;
|
|
|
14
14
|
export interface ChartRendererProps {
|
|
15
15
|
model: ChartModel;
|
|
16
16
|
ariaLabel: string;
|
|
17
|
-
/** The plot's height in px
|
|
18
|
-
height?: number;
|
|
17
|
+
/** The plot's height in px (default 240), or `fill`: whatever its box leaves (a page's tile). */
|
|
18
|
+
height?: number | 'fill';
|
|
19
19
|
/** Start on the table. */
|
|
20
20
|
defaultView?: 'chart' | 'table';
|
|
21
21
|
labels?: Partial<ChartRendererLabels>;
|
|
@@ -23,9 +23,11 @@ export interface ChartRendererProps {
|
|
|
23
23
|
testId?: string;
|
|
24
24
|
}
|
|
25
25
|
/** The values as a table: a row per category, a column per series. */
|
|
26
|
-
export declare function ChartTable({ model, caption, id, }: {
|
|
26
|
+
export declare function ChartTable({ model, caption, id, fill, }: {
|
|
27
27
|
model: ChartModel;
|
|
28
28
|
caption: string;
|
|
29
29
|
id?: string;
|
|
30
|
+
/** Scroll within the box it is in (a page's tile), not a fixed height. */
|
|
31
|
+
fill?: boolean;
|
|
30
32
|
}): import("react").JSX.Element;
|
|
31
33
|
export declare function ChartRenderer({ model, ariaLabel, height, defaultView, labels, className, testId, }: ChartRendererProps): import("react").JSX.Element;
|
|
@@ -16,9 +16,10 @@ const DEFAULT_CHART_RENDERER_LABELS = {
|
|
|
16
16
|
function ChartTable({
|
|
17
17
|
model,
|
|
18
18
|
caption,
|
|
19
|
-
id
|
|
19
|
+
id,
|
|
20
|
+
fill
|
|
20
21
|
}) {
|
|
21
|
-
return /* @__PURE__ */ jsx("div", { className: "
|
|
22
|
+
return /* @__PURE__ */ jsx("div", { className: cn("overflow-auto", fill ? "h-full min-h-0" : "max-h-72"), children: /* @__PURE__ */ jsxs("table", { id, className: "w-full text-left text-xs", "data-slot": "chart-table", children: [
|
|
22
23
|
/* @__PURE__ */ jsx("caption", { className: "sr-only", children: caption }),
|
|
23
24
|
/* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsxs("tr", { className: "border-b border-border text-muted-foreground", children: [
|
|
24
25
|
/* @__PURE__ */ jsx("th", { scope: "col", className: "py-1.5 pr-3 font-medium", children: model.xLabel }),
|
|
@@ -58,35 +59,45 @@ function ChartRenderer({
|
|
|
58
59
|
const l = { ...DEFAULT_CHART_RENDERER_LABELS, ...labels };
|
|
59
60
|
const [view, setView] = useState(defaultView);
|
|
60
61
|
const tableId = useId();
|
|
62
|
+
const fill = height === "fill";
|
|
61
63
|
return /* @__PURE__ */ jsxs(
|
|
62
64
|
"figure",
|
|
63
65
|
{
|
|
64
|
-
className: cn("flex min-w-0 max-w-full flex-col gap-2", className),
|
|
66
|
+
className: cn("flex min-w-0 max-w-full flex-col gap-2", fill && "h-full min-h-0", className),
|
|
65
67
|
"data-slot": "dashboard-chart",
|
|
66
68
|
"data-type": model.type,
|
|
67
69
|
"data-testid": testId,
|
|
68
70
|
children: [
|
|
69
|
-
view === "table" ? /* @__PURE__ */ jsx(
|
|
70
|
-
|
|
71
|
+
view === "table" ? /* @__PURE__ */ jsx("div", { className: cn(fill && "min-h-0 flex-1"), children: /* @__PURE__ */ jsx(ChartTable, { model, caption: ariaLabel, id: tableId, fill }) }) : /* @__PURE__ */ jsx(
|
|
72
|
+
"div",
|
|
71
73
|
{
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
"data-slot": "chart-loading"
|
|
77
|
-
}
|
|
78
|
-
),
|
|
74
|
+
className: cn("min-w-0", fill && "min-h-0 flex-1"),
|
|
75
|
+
style: fill ? void 0 : { height },
|
|
76
|
+
role: "figure",
|
|
77
|
+
"aria-label": ariaLabel,
|
|
79
78
|
children: /* @__PURE__ */ jsx(
|
|
80
|
-
|
|
79
|
+
Suspense,
|
|
81
80
|
{
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
81
|
+
fallback: /* @__PURE__ */ jsx(
|
|
82
|
+
"div",
|
|
83
|
+
{
|
|
84
|
+
className: "size-full animate-pulse rounded-md bg-muted",
|
|
85
|
+
"data-slot": "chart-loading"
|
|
86
|
+
}
|
|
87
|
+
),
|
|
88
|
+
children: /* @__PURE__ */ jsx(
|
|
89
|
+
RechartsRenderer,
|
|
90
|
+
{
|
|
91
|
+
model,
|
|
92
|
+
ariaLabel,
|
|
93
|
+
height: fill ? "100%" : height,
|
|
94
|
+
otherLabel: l.other
|
|
95
|
+
}
|
|
96
|
+
)
|
|
86
97
|
}
|
|
87
98
|
)
|
|
88
99
|
}
|
|
89
|
-
)
|
|
100
|
+
),
|
|
90
101
|
/* @__PURE__ */ jsxs("figcaption", { className: "flex flex-wrap items-center justify-between gap-2", children: [
|
|
91
102
|
/* @__PURE__ */ jsx(Legend, { model, other: l.other }),
|
|
92
103
|
/* @__PURE__ */ jsx(
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/dashboards/ChartRenderer.tsx"],
|
|
4
|
-
"sourcesContent": ["/**\n * `ChartRenderer`: draws a `ChartModel`. The drawing library is loaded on demand (a skeleton shows\n * meanwhile), so a page fetches it only when a chart is on screen. Beside the drawing: a legend in\n * the theme's text colours, and a table of the same values one click away (for screen readers,\n * copying, or when colours are hard to tell apart).\n */\nimport { lazy, Suspense, useId, useState } from 'react'\nimport { cn } from '@arbidocs/react/ui'\nimport { sliceColors, type ChartModel } from './chartModel'\n\nconst loadRecharts = () => import('./RechartsRenderer')\nconst RechartsRenderer = lazy(loadRecharts)\n\n/**\n * Start fetching the drawing library now (a chart panel calls it as its data starts loading), so\n * the code arrives alongside the data instead of only after it. Safe to call often: the module\n * is fetched once.\n */\nexport function preloadChartRenderer(): void {\n void loadRecharts()\n}\n\nexport interface ChartRendererLabels {\n showTable: string\n showChart: string\n other: string\n}\n\nexport const DEFAULT_CHART_RENDERER_LABELS: ChartRendererLabels = {\n showTable: 'Show table',\n showChart: 'Show chart',\n other: 'Other',\n}\n\nexport interface ChartRendererProps {\n model: ChartModel\n ariaLabel: string\n /** The plot's height in px
|
|
5
|
-
"mappings": ";
|
|
4
|
+
"sourcesContent": ["/**\n * `ChartRenderer`: draws a `ChartModel`. The drawing library is loaded on demand (a skeleton shows\n * meanwhile), so a page fetches it only when a chart is on screen. Beside the drawing: a legend in\n * the theme's text colours, and a table of the same values one click away (for screen readers,\n * copying, or when colours are hard to tell apart).\n */\nimport { lazy, Suspense, useId, useState } from 'react'\nimport { cn } from '@arbidocs/react/ui'\nimport { sliceColors, type ChartModel } from './chartModel'\n\nconst loadRecharts = () => import('./RechartsRenderer')\nconst RechartsRenderer = lazy(loadRecharts)\n\n/**\n * Start fetching the drawing library now (a chart panel calls it as its data starts loading), so\n * the code arrives alongside the data instead of only after it. Safe to call often: the module\n * is fetched once.\n */\nexport function preloadChartRenderer(): void {\n void loadRecharts()\n}\n\nexport interface ChartRendererLabels {\n showTable: string\n showChart: string\n other: string\n}\n\nexport const DEFAULT_CHART_RENDERER_LABELS: ChartRendererLabels = {\n showTable: 'Show table',\n showChart: 'Show chart',\n other: 'Other',\n}\n\nexport interface ChartRendererProps {\n model: ChartModel\n ariaLabel: string\n /** The plot's height in px (default 240), or `fill`: whatever its box leaves (a page's tile). */\n height?: number | 'fill'\n /** Start on the table. */\n defaultView?: 'chart' | 'table'\n labels?: Partial<ChartRendererLabels>\n className?: string\n testId?: string\n}\n\n/** The values as a table: a row per category, a column per series. */\nexport function ChartTable({\n model,\n caption,\n id,\n fill,\n}: {\n model: ChartModel\n caption: string\n id?: string\n /** Scroll within the box it is in (a page's tile), not a fixed height. */\n fill?: boolean\n}) {\n return (\n <div className={cn('overflow-auto', fill ? 'h-full min-h-0' : 'max-h-72')}>\n <table id={id} className=\"w-full text-left text-xs\" data-slot=\"chart-table\">\n <caption className=\"sr-only\">{caption}</caption>\n <thead>\n <tr className=\"border-b border-border text-muted-foreground\">\n <th scope=\"col\" className=\"py-1.5 pr-3 font-medium\">\n {model.xLabel}\n </th>\n {model.series.map((s) => (\n <th key={s.id} scope=\"col\" className=\"py-1.5 pr-3 text-right font-medium\">\n {s.label}\n </th>\n ))}\n </tr>\n </thead>\n <tbody>\n {model.categories.map((category, i) => (\n <tr key={`${category}-${i}`} className=\"border-b border-border/60 last:border-0\">\n <th scope=\"row\" className=\"py-1.5 pr-3 font-normal text-foreground\">\n {category}\n </th>\n {model.series.map((s) => (\n <td key={s.id} className=\"py-1.5 pr-3 text-right tabular-nums text-foreground\">\n {s.values[i] === null ? '\u2013' : model.format(s.values[i] as number)}\n </td>\n ))}\n </tr>\n ))}\n </tbody>\n </table>\n </div>\n )\n}\n\nfunction Legend({ model, other }: { model: ChartModel; other: string }) {\n const pie = model.type === 'pie' || model.type === 'donut'\n const items = pie\n ? model.categories.map((label, i) => ({ label, color: sliceColors(model, other)[i] }))\n : model.series.map((s) => ({ label: s.label, color: s.color }))\n if (!pie && items.length < 2) return null\n return (\n <ul className=\"flex flex-wrap justify-center gap-x-4 gap-y-1 text-xs text-muted-foreground\">\n {items.map((item, i) => (\n <li key={`${item.label}-${i}`} className=\"inline-flex items-center gap-1.5\">\n <span\n aria-hidden=\"true\"\n className=\"inline-block size-2 rounded-full\"\n style={{ background: item.color }}\n />\n {item.label}\n </li>\n ))}\n </ul>\n )\n}\n\nexport function ChartRenderer({\n model,\n ariaLabel,\n height = 240,\n defaultView = 'chart',\n labels,\n className,\n testId,\n}: ChartRendererProps) {\n const l = { ...DEFAULT_CHART_RENDERER_LABELS, ...labels }\n const [view, setView] = useState(defaultView)\n const tableId = useId()\n const fill = height === 'fill'\n return (\n <figure\n className={cn('flex min-w-0 max-w-full flex-col gap-2', fill && 'h-full min-h-0', className)}\n data-slot=\"dashboard-chart\"\n data-type={model.type}\n data-testid={testId}\n >\n {view === 'table' ? (\n <div className={cn(fill && 'min-h-0 flex-1')}>\n <ChartTable model={model} caption={ariaLabel} id={tableId} fill={fill} />\n </div>\n ) : (\n <div\n className={cn('min-w-0', fill && 'min-h-0 flex-1')}\n style={fill ? undefined : { height }}\n role=\"figure\"\n aria-label={ariaLabel}\n >\n <Suspense\n fallback={\n <div\n className=\"size-full animate-pulse rounded-md bg-muted\"\n data-slot=\"chart-loading\"\n />\n }\n >\n <RechartsRenderer\n model={model}\n ariaLabel={ariaLabel}\n height={fill ? '100%' : height}\n otherLabel={l.other}\n />\n </Suspense>\n </div>\n )}\n <figcaption className=\"flex flex-wrap items-center justify-between gap-2\">\n <Legend model={model} other={l.other} />\n <button\n type=\"button\"\n className=\"ml-auto rounded-sm text-xs text-muted-foreground underline-offset-2 hover:text-foreground hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring print:hidden\"\n aria-controls={view === 'table' ? tableId : undefined}\n aria-pressed={view === 'table'}\n onClick={() => setView(view === 'table' ? 'chart' : 'table')}\n >\n {view === 'table' ? l.showChart : l.showTable}\n </button>\n </figcaption>\n </figure>\n )\n}\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -58,9 +58,14 @@ export interface PanelViewProps {
|
|
|
58
58
|
variant?: 'card' | 'plain';
|
|
59
59
|
/** Most records a table shows. Default 50. */
|
|
60
60
|
maxRows?: number;
|
|
61
|
+
/**
|
|
62
|
+
* Fit the box it is given (a page's tile, any size): the chart takes the room left, a table
|
|
63
|
+
* scrolls inside, nothing spills out. Default: the panel's own heights.
|
|
64
|
+
*/
|
|
65
|
+
fit?: boolean;
|
|
61
66
|
formatters?: UnitFormatters;
|
|
62
67
|
labels?: Partial<PanelViewLabels>;
|
|
63
68
|
className?: string;
|
|
64
69
|
testId?: string;
|
|
65
70
|
}
|
|
66
|
-
export declare function PanelView({ kind, title, description, state, body, errorDetail, emptyAction, actions, metricAccent, variant, maxRows, formatters, labels, className, testId, }: PanelViewProps): import("react").JSX.Element;
|
|
71
|
+
export declare function PanelView({ kind, title, description, state, body, errorDetail, emptyAction, actions, metricAccent, variant, maxRows, fit, formatters, labels, className, testId, }: PanelViewProps): import("react").JSX.Element;
|
|
@@ -33,6 +33,7 @@ function RecordsTable({
|
|
|
33
33
|
maxRows,
|
|
34
34
|
l,
|
|
35
35
|
formatters,
|
|
36
|
+
fit,
|
|
36
37
|
testId
|
|
37
38
|
}) {
|
|
38
39
|
const shown = rows.slice(0, maxRows).map((row, i) => ({ row, i }));
|
|
@@ -43,8 +44,8 @@ function RecordsTable({
|
|
|
43
44
|
render: ({ row }) => cellText(row[field.id], field, l, formatters),
|
|
44
45
|
className: field.type === "number" ? "tabular-nums" : void 0
|
|
45
46
|
}));
|
|
46
|
-
return /* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
|
|
47
|
-
/* @__PURE__ */ jsx("div", { className: "
|
|
47
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("space-y-1", fit && "flex h-full min-h-0 flex-col"), children: [
|
|
48
|
+
/* @__PURE__ */ jsx("div", { className: cn("overflow-auto", fit ? "min-h-0 flex-1" : "max-h-80"), children: /* @__PURE__ */ jsx(
|
|
48
49
|
DataTable,
|
|
49
50
|
{
|
|
50
51
|
columns,
|
|
@@ -63,13 +64,17 @@ function Message({
|
|
|
63
64
|
text,
|
|
64
65
|
detail,
|
|
65
66
|
action,
|
|
67
|
+
fit,
|
|
66
68
|
testId
|
|
67
69
|
}) {
|
|
68
70
|
const Icon = tone === "error" ? AlertTriangle : ChartNoAxesColumn;
|
|
69
71
|
return /* @__PURE__ */ jsxs(
|
|
70
72
|
"div",
|
|
71
73
|
{
|
|
72
|
-
className:
|
|
74
|
+
className: cn(
|
|
75
|
+
"flex flex-col items-center justify-center gap-2 text-center",
|
|
76
|
+
fit ? "h-full min-h-0 overflow-hidden py-2" : "min-h-40 py-6"
|
|
77
|
+
),
|
|
73
78
|
role: tone === "error" ? "alert" : void 0,
|
|
74
79
|
"data-testid": testId,
|
|
75
80
|
children: [
|
|
@@ -98,6 +103,7 @@ function PanelView({
|
|
|
98
103
|
metricAccent,
|
|
99
104
|
variant = "card",
|
|
100
105
|
maxRows = 50,
|
|
106
|
+
fit = false,
|
|
101
107
|
formatters,
|
|
102
108
|
labels,
|
|
103
109
|
className,
|
|
@@ -131,7 +137,10 @@ function PanelView({
|
|
|
131
137
|
content = /* @__PURE__ */ jsx(
|
|
132
138
|
"div",
|
|
133
139
|
{
|
|
134
|
-
className:
|
|
140
|
+
className: cn(
|
|
141
|
+
"flex items-center justify-center rounded-md bg-muted/50 text-sm text-muted-foreground",
|
|
142
|
+
fit ? "h-full min-h-0" : "h-60"
|
|
143
|
+
),
|
|
135
144
|
role: "status",
|
|
136
145
|
"data-slot": "panel-loading",
|
|
137
146
|
"data-testid": testId && `${testId}-loading`,
|
|
@@ -142,6 +151,7 @@ function PanelView({
|
|
|
142
151
|
content = /* @__PURE__ */ jsx(
|
|
143
152
|
Message,
|
|
144
153
|
{
|
|
154
|
+
fit,
|
|
145
155
|
tone: "error",
|
|
146
156
|
text: l.error,
|
|
147
157
|
detail: errorDetail,
|
|
@@ -152,6 +162,7 @@ function PanelView({
|
|
|
152
162
|
content = /* @__PURE__ */ jsx(
|
|
153
163
|
Message,
|
|
154
164
|
{
|
|
165
|
+
fit,
|
|
155
166
|
tone: "empty",
|
|
156
167
|
text: l.empty,
|
|
157
168
|
action: emptyAction,
|
|
@@ -163,17 +174,19 @@ function PanelView({
|
|
|
163
174
|
ChartRenderer,
|
|
164
175
|
{
|
|
165
176
|
model: body.model,
|
|
177
|
+
height: fit ? "fill" : void 0,
|
|
166
178
|
ariaLabel: title,
|
|
167
179
|
labels: l,
|
|
168
180
|
testId: testId && `${testId}-chart`
|
|
169
181
|
}
|
|
170
182
|
);
|
|
171
183
|
} else if (body.kind === "groups") {
|
|
172
|
-
content = /* @__PURE__ */ jsx(ChartTable, { model: body.model, caption: title });
|
|
184
|
+
content = /* @__PURE__ */ jsx(ChartTable, { model: body.model, caption: title, fill: fit });
|
|
173
185
|
} else {
|
|
174
186
|
content = /* @__PURE__ */ jsx(
|
|
175
187
|
RecordsTable,
|
|
176
188
|
{
|
|
189
|
+
fit,
|
|
177
190
|
fields: body.fields,
|
|
178
191
|
rows: body.rows,
|
|
179
192
|
maxRows,
|
|
@@ -209,13 +222,17 @@ function PanelView({
|
|
|
209
222
|
Card,
|
|
210
223
|
{
|
|
211
224
|
variant: "elevated",
|
|
212
|
-
className: cn(
|
|
225
|
+
className: cn(
|
|
226
|
+
"flex h-full min-w-0 flex-col gap-3 rounded-xl p-5",
|
|
227
|
+
fit && "overflow-hidden",
|
|
228
|
+
className
|
|
229
|
+
),
|
|
213
230
|
"data-slot": "dashboard-panel",
|
|
214
231
|
"data-testid": testId,
|
|
215
232
|
"aria-busy": state === "loading" || void 0,
|
|
216
233
|
children: [
|
|
217
234
|
header,
|
|
218
|
-
/* @__PURE__ */ jsx("div", { className: "min-w-0 flex-1", children: content })
|
|
235
|
+
/* @__PURE__ */ jsx("div", { className: cn("min-w-0 flex-1", fit && "min-h-0"), children: content })
|
|
219
236
|
]
|
|
220
237
|
}
|
|
221
238
|
);
|