@arbidocs/blocks 0.5.153 → 0.5.155
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} +8 -8
- 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} +8 -8
- package/dist/{ConnectedNativeDocxComparison-244UIHSM.cjs.map → ConnectedStreamedWordArtifact-LTYB62VM.cjs.map} +1 -1
- package/dist/{DocumentReviewCard-5W2QQWKA.cjs → DocumentReviewCard-5AP55NGZ.cjs} +4 -3
- package/dist/DocumentReviewCard-5AP55NGZ.cjs.map +1 -0
- package/dist/{FilesViewerDialog-63QUTG4L.cjs → FilesViewerDialog-SHWCE3UN.cjs} +21 -19
- package/dist/FilesViewerDialog-SHWCE3UN.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-S4IBYQVF.cjs} +13 -11
- package/dist/WorkspaceTableView-S4IBYQVF.cjs.map +1 -0
- package/dist/agents/index.cjs +244 -243
- 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-4I2PCP7O.cjs → chunk-2XOIULVN.cjs} +36 -35
- package/dist/chunk-2XOIULVN.cjs.map +1 -0
- package/dist/{chunk-D5DOK2AE.cjs → chunk-3SGFIDID.cjs} +10 -10
- package/dist/{chunk-D5DOK2AE.cjs.map → chunk-3SGFIDID.cjs.map} +1 -1
- package/dist/{chunk-WUM76MJU.cjs → chunk-4UDGCXUR.cjs} +7 -7
- package/dist/{chunk-WUM76MJU.cjs.map → chunk-4UDGCXUR.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-74RUAGVD.cjs +1533 -0
- package/dist/chunk-74RUAGVD.cjs.map +1 -0
- 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-BH322H5B.cjs +594 -0
- package/dist/chunk-BH322H5B.cjs.map +1 -0
- 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-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-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-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-CVVQHFLR.cjs → chunk-OZJENXU3.cjs} +71 -649
- package/dist/chunk-OZJENXU3.cjs.map +1 -0
- package/dist/{chunk-JLNKD56X.cjs → chunk-QEH375MU.cjs} +4 -4
- package/dist/{chunk-JLNKD56X.cjs.map → chunk-QEH375MU.cjs.map} +1 -1
- 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-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-Z3N32LL4.cjs → chunk-Y2Z5UHHV.cjs} +29 -27
- package/dist/chunk-Y2Z5UHHV.cjs.map +1 -0
- package/dist/{chunk-KRQCUVH7.cjs → chunk-YSAUOJA7.cjs} +9 -3
- package/dist/chunk-YSAUOJA7.cjs.map +1 -0
- 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 +11 -11
- package/dist/connect/index.cjs +1064 -2179
- 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 +11 -9
- 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/export/ConnectedExportPanel.js +19 -78
- package/dist/connection/export/ConnectedExportPanel.js.map +2 -2
- package/dist/connection/export/transfer-targets.d.ts +66 -0
- package/dist/connection/export/transfer-targets.js +93 -0
- package/dist/connection/export/transfer-targets.js.map +7 -0
- package/dist/connection/export/transfer-text.js +5 -0
- package/dist/connection/export/transfer-text.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 +9 -5
- package/dist/connection/pages/ConnectedPagesPage.js +144 -48
- 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/PageTransferDialog.d.ts +38 -0
- package/dist/connection/pages/PageTransferDialog.js +219 -0
- package/dist/connection/pages/PageTransferDialog.js.map +7 -0
- package/dist/connection/pages/PageView.d.ts +6 -2
- package/dist/connection/pages/PageView.js +40 -15
- package/dist/connection/pages/PageView.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/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 +5 -2
- package/dist/connection/pages/index.js +40 -5
- package/dist/connection/pages/index.js.map +2 -2
- package/dist/connection/pages/labels.d.ts +3 -1
- package/dist/connection/pages/labels.js +7 -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/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 +17 -15
- 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 +326 -324
- package/dist/index.cjs.map +1 -1
- package/dist/pages/index.cjs +864 -155
- package/dist/pages/index.cjs.map +1 -1
- package/dist/settings/index.cjs +164 -163
- package/dist/shell/index.cjs +34 -33
- package/dist/studio/index.cjs +12 -12
- package/dist/styles.css +1 -1
- package/dist/workflow-canvas/index.cjs +24 -21
- 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-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
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The starting points "New page" offers by default (`PAGE_TEMPLATES`): the workspace dashboard
|
|
3
|
+
* first (its live blocks, so a page can be the dashboard and then be changed), then the Analytics
|
|
4
|
+
* dashboards (`DASHBOARD_TEMPLATES`).
|
|
5
|
+
*/
|
|
6
|
+
import { type PageSpec } from '@arbidocs/react';
|
|
7
|
+
import { type PageTemplate } from '../dashboards/templates';
|
|
8
|
+
export declare const PAGE_TEMPLATES: readonly PageTemplate[];
|
|
9
|
+
/** The page a template makes: a dashboard's panels laid out in order, or the page itself. */
|
|
10
|
+
export declare function pageOfTemplate(template: PageTemplate): PageSpec;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { pageFromDashboard } from "@arbidocs/react";
|
|
3
|
+
import { DASHBOARD_TEMPLATES } from "../dashboards/templates.js";
|
|
4
|
+
import { WORKSPACE_DASHBOARD_PAGE } from "../live-blocks/workspace-dashboard-blocks.js";
|
|
5
|
+
const PAGE_TEMPLATES = [
|
|
6
|
+
WORKSPACE_DASHBOARD_PAGE,
|
|
7
|
+
...DASHBOARD_TEMPLATES
|
|
8
|
+
];
|
|
9
|
+
function pageOfTemplate(template) {
|
|
10
|
+
return "panels" in template ? pageFromDashboard(template) : structuredClone(template);
|
|
11
|
+
}
|
|
12
|
+
export {
|
|
13
|
+
PAGE_TEMPLATES,
|
|
14
|
+
pageOfTemplate
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=page-templates.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/connection/pages/page-templates.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * The starting points \"New page\" offers by default (`PAGE_TEMPLATES`): the workspace dashboard\n * first (its live blocks, so a page can be the dashboard and then be changed), then the Analytics\n * dashboards (`DASHBOARD_TEMPLATES`).\n */\nimport { pageFromDashboard, type PageSpec } from '@arbidocs/react'\nimport { DASHBOARD_TEMPLATES, type PageTemplate } from '../dashboards/templates'\nimport { WORKSPACE_DASHBOARD_PAGE } from '../live-blocks/workspace-dashboard-blocks'\n\nexport const PAGE_TEMPLATES: readonly PageTemplate[] = [\n WORKSPACE_DASHBOARD_PAGE,\n ...DASHBOARD_TEMPLATES,\n]\n\n/** The page a template makes: a dashboard's panels laid out in order, or the page itself. */\nexport function pageOfTemplate(template: PageTemplate): PageSpec {\n return 'panels' in template ? pageFromDashboard(template) : structuredClone(template)\n}\n"],
|
|
5
|
+
"mappings": ";AAKA,SAAS,yBAAwC;AACjD,SAAS,2BAA8C;AACvD,SAAS,gCAAgC;AAElC,MAAM,iBAA0C;AAAA,EACrD;AAAA,EACA,GAAG;AACL;AAGO,SAAS,eAAe,UAAkC;AAC/D,SAAO,YAAY,WAAW,kBAAkB,QAAQ,IAAI,gBAAgB,QAAQ;AACtF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -16,6 +16,8 @@ export interface ConnectedWorkflowStartProps {
|
|
|
16
16
|
tileWorkflows?: WorkflowDefinition[];
|
|
17
17
|
/** Render the Start band (off when another surface opens the dialog). */
|
|
18
18
|
showTiles?: boolean;
|
|
19
|
+
/** The band's layout: reflowing columns (default) or one sideways-scrolling row (a carousel). */
|
|
20
|
+
tilesLayout?: 'grid' | 'carousel';
|
|
19
21
|
caption?: string;
|
|
20
22
|
captionTestId?: string;
|
|
21
23
|
testId?: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/connection/workflows/ConnectedWorkflowStart.tsx"],
|
|
4
|
-
"sourcesContent": ["/**\n * The workflow launcher, wired to run what it launches: `ConnectedWorkflowLauncher` (the\n * workspace's files behind scope and file fields, the user's agents behind \"Run as\") with the one\n * launch handler (`useLaunchWorkflow`), the host's upload dialog for adding files\n * (`environment.openUpload`), and the touches of the annotation operation (its derived name and\n * overwrite warning, \"Annotate N documents\").\n *\n * The dashboard's Start band, Files (\"Create new\") and, headless, the slash menu use it.\n */\n\nimport { useTags } from '@arbidocs/react'\nimport { useCallback, useMemo, type ReactNode } from 'react'\nimport { TriangleAlert } from 'lucide-react'\nimport { documentScopeLabels } from '../../agents/workflows/workspaceScope'\nimport {\n type OnWorkflowLaunch,\n type WorkflowDefinition,\n type WorkflowField,\n type WorkflowInputs,\n type WorkflowLanding,\n} from '../../agents/workflows/types'\nimport { ConnectedWorkflowLauncher } from '../ConnectedWorkflowLauncher'\nimport { type StartTile } from '../../home/StartTiles'\nimport { useBlocksEnvironment } from '../../provider/environment'\nimport { useHost } from '../../provider/host'\nimport { deriveAnnotationName } from '../../agents/workflows/catalogue/annotation-name'\nimport { ANNOTATE_ID, renderWorkflowIcon } from '../../agents/workflows/catalogue/seed'\nimport { useLaunchWorkflow } from './useLaunchWorkflow'\n\n// The agent picker names the person it hands the work to: the default \"Run as\" / \"My assistant\"\n// copy did not say who an assistant is.\nconst AGENT_LABELS = { label: 'Who this runs for', myAssistant: 'Me (your own assistant)' }\n\nexport interface ConnectedWorkflowStartProps {\n workflows: WorkflowDefinition[]\n /** Which of `workflows` get a tile (a filtered or capped view). */\n tileWorkflows?: WorkflowDefinition[]\n /** Render the Start band (off when another surface opens the dialog). */\n showTiles?: boolean\n caption?: string\n captionTestId?: string\n testId?: string\n /** Plain tiles appended to the band (e.g. the \"Create a file\" menu). */\n extraTiles?: StartTile[]\n /** Controlled open workflow id. */\n activeId?: string | null\n onActiveIdChange?: (id: string | null) => void\n initialInputsFor?: (workflow: WorkflowDefinition) => Partial<WorkflowInputs> | undefined\n /** Where launches land, over each workflow's default (`current-chat` = the chat on screen). */\n landing?: WorkflowLanding\n /** A prompt run's own send (a chat that is not the session's conversation). See `useLaunchWorkflow`. */\n send?: (prompt: string) => void\n /**\n * Run a launch here instead of the usual way (`useLaunchWorkflow`): a surface that wants the\n * result itself, e.g. the presentation, which adds a generated image to its clips. The dialog\n * shows it running until it resolves, closes then, and stays open if it throws.\n */\n onLaunch?: OnWorkflowLaunch\n /**\n * Files added from a `documents` field are uploaded right in the field instead of through the\n * host's upload dialog: for a dialog in a popped-out window, where the host's dialog would open\n * in the app's window, out of sight, and block this one.\n */\n uploadInPlace?: boolean\n /** The host's own \"Add\" control, offered when a workflow needs files and there are none. */\n addFilesAction?: ReactNode\n tileTestId?: (workflow: WorkflowDefinition) => string | undefined\n disabledReason?: (workflow: WorkflowDefinition) => string | undefined\n}\n\nexport function ConnectedWorkflowStart({\n workflows,\n landing,\n send,\n addFilesAction,\n onLaunch: launchHere,\n uploadInPlace = false,\n ...rest\n}: ConnectedWorkflowStartProps) {\n const launchUsually = useLaunchWorkflow({ landing, send })\n const onLaunch = launchHere ?? launchUsually\n // The host's icons first (a skill pack names its own), then the kit's, then the skill icon.\n const hostIcon = useHost().workflows?.renderIcon\n const renderIcon = useCallback(\n (key: string) => hostIcon?.(key) ?? renderWorkflowIcon(key) ?? renderWorkflowIcon('skill'),\n [hostIcon]\n )\n const { openUpload } = useBlocksEnvironment()\n const { data: workspaceTags = [] } = useTags()\n const tags = useMemo(() => documentScopeLabels(workspaceTags), [workspaceTags])\n\n // The annotation's name is optional: left blank it is taken from the question, which the\n // field's placeholder shows before anything runs.\n const fieldPlaceholder = useCallback(\n (field: WorkflowField, inputs: WorkflowInputs, workflow: WorkflowDefinition) => {\n if (workflow.id !== ANNOTATE_ID || field.name !== 'name') return undefined\n const derived = deriveAnnotationName(String(inputs.description ?? ''))\n return derived ? `Otherwise \u201C${derived}\u201D` : 'Taken from the description'\n },\n []\n )\n\n return (\n <ConnectedWorkflowLauncher\n {...rest}\n workflows={workflows}\n onLaunch={onLaunch}\n renderIcon={renderIcon}\n onAddFiles={uploadInPlace ? undefined : openUpload}\n agentLabels={AGENT_LABELS}\n addFilesAction={addFilesAction}\n fieldPlaceholder={fieldPlaceholder}\n submitLabel={({ workflow, matchedCount }) =>\n workflow.id === ANNOTATE_ID && matchedCount !== null\n ? `Annotate ${matchedCount} document${matchedCount !== 1 ? 's' : ''}`\n : undefined\n }\n renderNotice={({ workflow, inputs }) => {\n if (workflow.id !== ANNOTATE_ID) return null\n // A same-named label is reused: warn that this overwrites its stored description and the\n // cell values for the selected documents.\n const name =\n String(inputs.name ?? '').trim() || deriveAnnotationName(String(inputs.description ?? ''))\n const existing = name\n ? tags.find((t) => t.name.toLowerCase() === name.toLowerCase())\n : undefined\n if (!existing) return null\n return (\n <div\n className=\"flex items-start gap-2 rounded-md border border-amber-500/40 bg-amber-500/10 px-3 py-2 text-sm text-amber-800 dark:text-amber-200\"\n role=\"status\"\n data-testid=\"workflow-existing-label-warning\"\n >\n <TriangleAlert className=\"mt-0.5 size-4 shrink-0 text-amber-500\" />\n <span>\n An annotation called <span className=\"font-medium\">{existing.name}</span> already\n exists. Annotating will overwrite its description and the current cell values for the\n selected files.\n </span>\n </div>\n )\n }}\n />\n )\n}\n"],
|
|
5
|
-
"mappings": ";
|
|
4
|
+
"sourcesContent": ["/**\n * The workflow launcher, wired to run what it launches: `ConnectedWorkflowLauncher` (the\n * workspace's files behind scope and file fields, the user's agents behind \"Run as\") with the one\n * launch handler (`useLaunchWorkflow`), the host's upload dialog for adding files\n * (`environment.openUpload`), and the touches of the annotation operation (its derived name and\n * overwrite warning, \"Annotate N documents\").\n *\n * The dashboard's Start band, Files (\"Create new\") and, headless, the slash menu use it.\n */\n\nimport { useTags } from '@arbidocs/react'\nimport { useCallback, useMemo, type ReactNode } from 'react'\nimport { TriangleAlert } from 'lucide-react'\nimport { documentScopeLabels } from '../../agents/workflows/workspaceScope'\nimport {\n type OnWorkflowLaunch,\n type WorkflowDefinition,\n type WorkflowField,\n type WorkflowInputs,\n type WorkflowLanding,\n} from '../../agents/workflows/types'\nimport { ConnectedWorkflowLauncher } from '../ConnectedWorkflowLauncher'\nimport { type StartTile } from '../../home/StartTiles'\nimport { useBlocksEnvironment } from '../../provider/environment'\nimport { useHost } from '../../provider/host'\nimport { deriveAnnotationName } from '../../agents/workflows/catalogue/annotation-name'\nimport { ANNOTATE_ID, renderWorkflowIcon } from '../../agents/workflows/catalogue/seed'\nimport { useLaunchWorkflow } from './useLaunchWorkflow'\n\n// The agent picker names the person it hands the work to: the default \"Run as\" / \"My assistant\"\n// copy did not say who an assistant is.\nconst AGENT_LABELS = { label: 'Who this runs for', myAssistant: 'Me (your own assistant)' }\n\nexport interface ConnectedWorkflowStartProps {\n workflows: WorkflowDefinition[]\n /** Which of `workflows` get a tile (a filtered or capped view). */\n tileWorkflows?: WorkflowDefinition[]\n /** Render the Start band (off when another surface opens the dialog). */\n showTiles?: boolean\n /** The band's layout: reflowing columns (default) or one sideways-scrolling row (a carousel). */\n tilesLayout?: 'grid' | 'carousel'\n caption?: string\n captionTestId?: string\n testId?: string\n /** Plain tiles appended to the band (e.g. the \"Create a file\" menu). */\n extraTiles?: StartTile[]\n /** Controlled open workflow id. */\n activeId?: string | null\n onActiveIdChange?: (id: string | null) => void\n initialInputsFor?: (workflow: WorkflowDefinition) => Partial<WorkflowInputs> | undefined\n /** Where launches land, over each workflow's default (`current-chat` = the chat on screen). */\n landing?: WorkflowLanding\n /** A prompt run's own send (a chat that is not the session's conversation). See `useLaunchWorkflow`. */\n send?: (prompt: string) => void\n /**\n * Run a launch here instead of the usual way (`useLaunchWorkflow`): a surface that wants the\n * result itself, e.g. the presentation, which adds a generated image to its clips. The dialog\n * shows it running until it resolves, closes then, and stays open if it throws.\n */\n onLaunch?: OnWorkflowLaunch\n /**\n * Files added from a `documents` field are uploaded right in the field instead of through the\n * host's upload dialog: for a dialog in a popped-out window, where the host's dialog would open\n * in the app's window, out of sight, and block this one.\n */\n uploadInPlace?: boolean\n /** The host's own \"Add\" control, offered when a workflow needs files and there are none. */\n addFilesAction?: ReactNode\n tileTestId?: (workflow: WorkflowDefinition) => string | undefined\n disabledReason?: (workflow: WorkflowDefinition) => string | undefined\n}\n\nexport function ConnectedWorkflowStart({\n workflows,\n landing,\n send,\n addFilesAction,\n onLaunch: launchHere,\n uploadInPlace = false,\n ...rest\n}: ConnectedWorkflowStartProps) {\n const launchUsually = useLaunchWorkflow({ landing, send })\n const onLaunch = launchHere ?? launchUsually\n // The host's icons first (a skill pack names its own), then the kit's, then the skill icon.\n const hostIcon = useHost().workflows?.renderIcon\n const renderIcon = useCallback(\n (key: string) => hostIcon?.(key) ?? renderWorkflowIcon(key) ?? renderWorkflowIcon('skill'),\n [hostIcon]\n )\n const { openUpload } = useBlocksEnvironment()\n const { data: workspaceTags = [] } = useTags()\n const tags = useMemo(() => documentScopeLabels(workspaceTags), [workspaceTags])\n\n // The annotation's name is optional: left blank it is taken from the question, which the\n // field's placeholder shows before anything runs.\n const fieldPlaceholder = useCallback(\n (field: WorkflowField, inputs: WorkflowInputs, workflow: WorkflowDefinition) => {\n if (workflow.id !== ANNOTATE_ID || field.name !== 'name') return undefined\n const derived = deriveAnnotationName(String(inputs.description ?? ''))\n return derived ? `Otherwise \u201C${derived}\u201D` : 'Taken from the description'\n },\n []\n )\n\n return (\n <ConnectedWorkflowLauncher\n {...rest}\n workflows={workflows}\n onLaunch={onLaunch}\n renderIcon={renderIcon}\n onAddFiles={uploadInPlace ? undefined : openUpload}\n agentLabels={AGENT_LABELS}\n addFilesAction={addFilesAction}\n fieldPlaceholder={fieldPlaceholder}\n submitLabel={({ workflow, matchedCount }) =>\n workflow.id === ANNOTATE_ID && matchedCount !== null\n ? `Annotate ${matchedCount} document${matchedCount !== 1 ? 's' : ''}`\n : undefined\n }\n renderNotice={({ workflow, inputs }) => {\n if (workflow.id !== ANNOTATE_ID) return null\n // A same-named label is reused: warn that this overwrites its stored description and the\n // cell values for the selected documents.\n const name =\n String(inputs.name ?? '').trim() || deriveAnnotationName(String(inputs.description ?? ''))\n const existing = name\n ? tags.find((t) => t.name.toLowerCase() === name.toLowerCase())\n : undefined\n if (!existing) return null\n return (\n <div\n className=\"flex items-start gap-2 rounded-md border border-amber-500/40 bg-amber-500/10 px-3 py-2 text-sm text-amber-800 dark:text-amber-200\"\n role=\"status\"\n data-testid=\"workflow-existing-label-warning\"\n >\n <TriangleAlert className=\"mt-0.5 size-4 shrink-0 text-amber-500\" />\n <span>\n An annotation called <span className=\"font-medium\">{existing.name}</span> already\n exists. Annotating will overwrite its description and the current cell values for the\n selected files.\n </span>\n </div>\n )\n }}\n />\n )\n}\n"],
|
|
5
|
+
"mappings": ";AAuIY,cACA,YADA;AA7HZ,SAAS,eAAe;AACxB,SAAS,aAAa,eAA+B;AACrD,SAAS,qBAAqB;AAC9B,SAAS,2BAA2B;AAQpC,SAAS,iCAAiC;AAE1C,SAAS,4BAA4B;AACrC,SAAS,eAAe;AACxB,SAAS,4BAA4B;AACrC,SAAS,aAAa,0BAA0B;AAChD,SAAS,yBAAyB;AAIlC,MAAM,eAAe,EAAE,OAAO,qBAAqB,aAAa,0BAA0B;AAyCnF,SAAS,uBAAuB;AAAA,EACrC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,UAAU;AAAA,EACV,gBAAgB;AAAA,EAChB,GAAG;AACL,GAAgC;AAC9B,QAAM,gBAAgB,kBAAkB,EAAE,SAAS,KAAK,CAAC;AACzD,QAAM,WAAW,cAAc;AAE/B,QAAM,WAAW,QAAQ,EAAE,WAAW;AACtC,QAAM,aAAa;AAAA,IACjB,CAAC,QAAgB,WAAW,GAAG,KAAK,mBAAmB,GAAG,KAAK,mBAAmB,OAAO;AAAA,IACzF,CAAC,QAAQ;AAAA,EACX;AACA,QAAM,EAAE,WAAW,IAAI,qBAAqB;AAC5C,QAAM,EAAE,MAAM,gBAAgB,CAAC,EAAE,IAAI,QAAQ;AAC7C,QAAM,OAAO,QAAQ,MAAM,oBAAoB,aAAa,GAAG,CAAC,aAAa,CAAC;AAI9E,QAAM,mBAAmB;AAAA,IACvB,CAAC,OAAsB,QAAwB,aAAiC;AAC9E,UAAI,SAAS,OAAO,eAAe,MAAM,SAAS,OAAQ,QAAO;AACjE,YAAM,UAAU,qBAAqB,OAAO,OAAO,eAAe,EAAE,CAAC;AACrE,aAAO,UAAU,mBAAc,OAAO,WAAM;AAAA,IAC9C;AAAA,IACA,CAAC;AAAA,EACH;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ;AAAA,MACA;AAAA,MACA;AAAA,MACA,YAAY,gBAAgB,SAAY;AAAA,MACxC,aAAa;AAAA,MACb;AAAA,MACA;AAAA,MACA,aAAa,CAAC,EAAE,UAAU,aAAa,MACrC,SAAS,OAAO,eAAe,iBAAiB,OAC5C,YAAY,YAAY,YAAY,iBAAiB,IAAI,MAAM,EAAE,KACjE;AAAA,MAEN,cAAc,CAAC,EAAE,UAAU,OAAO,MAAM;AACtC,YAAI,SAAS,OAAO,YAAa,QAAO;AAGxC,cAAM,OACJ,OAAO,OAAO,QAAQ,EAAE,EAAE,KAAK,KAAK,qBAAqB,OAAO,OAAO,eAAe,EAAE,CAAC;AAC3F,cAAM,WAAW,OACb,KAAK,KAAK,CAAC,MAAM,EAAE,KAAK,YAAY,MAAM,KAAK,YAAY,CAAC,IAC5D;AACJ,YAAI,CAAC,SAAU,QAAO;AACtB,eACE;AAAA,UAAC;AAAA;AAAA,YACC,WAAU;AAAA,YACV,MAAK;AAAA,YACL,eAAY;AAAA,YAEZ;AAAA,kCAAC,iBAAc,WAAU,yCAAwC;AAAA,cACjE,qBAAC,UAAK;AAAA;AAAA,gBACiB,oBAAC,UAAK,WAAU,eAAe,mBAAS,MAAK;AAAA,gBAAO;AAAA,iBAG3E;AAAA;AAAA;AAAA,QACF;AAAA,MAEJ;AAAA;AAAA,EACF;AAEJ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -3,14 +3,17 @@
|
|
|
3
3
|
* Start band), then what is recent (the last files and threads, each a way back in), then its
|
|
4
4
|
* facts (upcoming dated ones, the newest others) beside the agenda.
|
|
5
5
|
*
|
|
6
|
-
* Every section
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
6
|
+
* Every section is a live page block (`ConnectedStartBlock`, `ConnectedListBlock`,
|
|
7
|
+
* `ConnectedAgendaBlock`) of the one dashboard definition (`WORKSPACE_DASHBOARD_LAYOUT`), the
|
|
8
|
+
* same the "Dashboard" page template copies; here they sit in fixed bands, not editable. Every
|
|
9
|
+
* section always shows, each with its own empty state, so a new workspace has the same layout as a
|
|
10
|
+
* busy one. A row opens its thing (`BlocksEnvironment.openDocument` / `openConversation`); a
|
|
11
|
+
* section's header, a fact and "New fact" go to the host's pages (`openFiles`, `openThreads`,
|
|
12
|
+
* `openFacts`); asking starts a new conversation (`openNewConversation`); adding goes to the host's
|
|
13
|
+
* upload (`openUpload`). "New" opens the new-thread dialog, and the Add menu's URL and email-in
|
|
14
|
+
* dialogs open in place.
|
|
12
15
|
*/
|
|
13
|
-
import {
|
|
16
|
+
import type { ReactNode } from 'react';
|
|
14
17
|
export interface ConnectedWorkspaceDashboardProps {
|
|
15
18
|
/** The Start band. Default: the dashboard workflows, "Create a file" and Add; `null` hides it. */
|
|
16
19
|
start?: ReactNode;
|
|
@@ -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": ";AA8DQ,cAEE,YAFF;AAxDR,SAAS,MAAM,UAAU,OAAO,gBAAgB;AAChD,SAAS,UAAU;AACnB,SAAS,mBAAoC;AAE7C,MAAM,eAAe,MAAM,OAAO,oBAAoB;AACtD,MAAM,mBAAmB,KAAK,YAAY;AAOnC,SAAS,uBAA6B;AAC3C,OAAK,aAAa;AACpB;AAQO,MAAM,gCAAqD;AAAA,EAChE,WAAW;AAAA,EACX,WAAW;AAAA,EACX,OAAO;AACT;AAeO,SAAS,WAAW;AAAA,EACzB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAMG;AACD,SACE,oBAAC,SAAI,WAAW,GAAG,iBAAiB,OAAO,mBAAmB,UAAU,GACtE,+BAAC,WAAM,IAAQ,WAAU,4BAA2B,aAAU,eAC5D;AAAA,wBAAC,aAAQ,WAAU,WAAW,mBAAQ;AAAA,IACtC,oBAAC,WACC,+BAAC,QAAG,WAAU,gDACZ;AAAA,0BAAC,QAAG,OAAM,OAAM,WAAU,2BACvB,gBAAM,QACT;AAAA,MACC,MAAM,OAAO,IAAI,CAAC,MACjB,oBAAC,QAAc,OAAM,OAAM,WAAU,sCAClC,YAAE,SADI,EAAE,EAEX,CACD;AAAA,OACH,GACF;AAAA,IACA,oBAAC,WACE,gBAAM,WAAW,IAAI,CAAC,UAAU,MAC/B,qBAAC,QAA4B,WAAU,2CACrC;AAAA,0BAAC,QAAG,OAAM,OAAM,WAAU,2CACvB,oBACH;AAAA,MACC,MAAM,OAAO,IAAI,CAAC,MACjB,oBAAC,QAAc,WAAU,uDACtB,YAAE,OAAO,CAAC,MAAM,OAAO,WAAM,MAAM,OAAO,EAAE,OAAO,CAAC,CAAW,KADzD,EAAE,EAEX,CACD;AAAA,SARM,GAAG,QAAQ,IAAI,CAAC,EASzB,CACD,GACH;AAAA,KACF,GACF;AAEJ;AAEA,SAAS,OAAO,EAAE,OAAO,MAAM,GAAyC;AACtE,QAAM,MAAM,MAAM,SAAS,SAAS,MAAM,SAAS;AACnD,QAAM,QAAQ,MACV,MAAM,WAAW,IAAI,CAAC,OAAO,OAAO,EAAE,OAAO,OAAO,YAAY,OAAO,KAAK,EAAE,CAAC,EAAE,EAAE,IACnF,MAAM,OAAO,IAAI,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,OAAO,EAAE,MAAM,EAAE;AAChE,MAAI,CAAC,OAAO,MAAM,SAAS,EAAG,QAAO;AACrC,SACE,oBAAC,QAAG,WAAU,+EACX,gBAAM,IAAI,CAAC,MAAM,MAChB,qBAAC,QAA8B,WAAU,oCACvC;AAAA;AAAA,MAAC;AAAA;AAAA,QACC,eAAY;AAAA,QACZ,WAAU;AAAA,QACV,OAAO,EAAE,YAAY,KAAK,MAAM;AAAA;AAAA,IAClC;AAAA,IACC,KAAK;AAAA,OANC,GAAG,KAAK,KAAK,IAAI,CAAC,EAO3B,CACD,GACH;AAEJ;AAEO,SAAS,cAAc;AAAA,EAC5B;AAAA,EACA;AAAA,EACA,SAAS;AAAA,EACT,cAAc;AAAA,EACd;AAAA,EACA;AAAA,EACA;AACF,GAAuB;AACrB,QAAM,IAAI,EAAE,GAAG,+BAA+B,GAAG,OAAO;AACxD,QAAM,CAAC,MAAM,OAAO,IAAI,SAAS,WAAW;AAC5C,QAAM,UAAU,MAAM;AACtB,QAAM,OAAO,WAAW;AACxB,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW,GAAG,0CAA0C,QAAQ,kBAAkB,SAAS;AAAA,MAC3F,aAAU;AAAA,MACV,aAAW,MAAM;AAAA,MACjB,eAAa;AAAA,MAEZ;AAAA,iBAAS,UACR,oBAAC,SAAI,WAAW,GAAG,QAAQ,gBAAgB,GACzC,8BAAC,cAAW,OAAc,SAAS,WAAW,IAAI,SAAS,MAAY,GACzE,IAEA;AAAA,UAAC;AAAA;AAAA,YACC,WAAW,GAAG,WAAW,QAAQ,gBAAgB;AAAA,YACjD,OAAO,OAAO,SAAY,EAAE,OAAO;AAAA,YACnC,MAAK;AAAA,YACL,cAAY;AAAA,YAEZ;AAAA,cAAC;AAAA;AAAA,gBACC,UACE;AAAA,kBAAC;AAAA;AAAA,oBACC,WAAU;AAAA,oBACV,aAAU;AAAA;AAAA,gBACZ;AAAA,gBAGF;AAAA,kBAAC;AAAA;AAAA,oBACC;AAAA,oBACA;AAAA,oBACA,QAAQ,OAAO,SAAS;AAAA,oBACxB,YAAY,EAAE;AAAA;AAAA,gBAChB;AAAA;AAAA,YACF;AAAA;AAAA,QACF;AAAA,QAEF,qBAAC,gBAAW,WAAU,qDACpB;AAAA,8BAAC,UAAO,OAAc,OAAO,EAAE,OAAO;AAAA,UACtC;AAAA,YAAC;AAAA;AAAA,cACC,MAAK;AAAA,cACL,WAAU;AAAA,cACV,iBAAe,SAAS,UAAU,UAAU;AAAA,cAC5C,gBAAc,SAAS;AAAA,cACvB,SAAS,MAAM,QAAQ,SAAS,UAAU,UAAU,OAAO;AAAA,cAE1D,mBAAS,UAAU,EAAE,YAAY,EAAE;AAAA;AAAA,UACtC;AAAA,WACF;AAAA;AAAA;AAAA,EACF;AAEJ;",
|
|
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;
|