@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
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/connection/pages/PageView.tsx"],
|
|
4
|
-
"sourcesContent": ["/**\n * An open page: its header (back, title, \"Share with the workspace\", Edit, and the \"\u2026\" menu with\n * Delete) over its grid of blocks. Private by default; sharing is one step and one-way (asked\n * first): a shared page says so and stays shared, and only a workspace owner deletes it.\n */\nimport type { ReactNode } from 'react'\nimport {
|
|
5
|
-
"mappings": ";
|
|
4
|
+
"sourcesContent": ["/**\n * An open page: its header (back, title, \"Share with the workspace\", Edit, and the \"\u2026\" menu with\n * Copy to workspace\u2026, Move to workspace\u2026 and Delete) over its grid of blocks. Private by default; sharing is one step and one-way (asked\n * first): a shared page says so and stays shared, and only a workspace owner deletes it.\n */\nimport type { ReactNode } from 'react'\nimport {\n ArrowLeft,\n ArrowRightLeft,\n Copy,\n MoreHorizontal,\n Pencil,\n Share2,\n Trash2,\n Users,\n} from 'lucide-react'\nimport type { SavedPage } from '@arbidocs/react'\nimport {\n Badge,\n Button,\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuSeparator,\n DropdownMenuTrigger,\n} from '@arbidocs/react/ui'\nimport { PageHeader } from '../../components/PageHeader'\nimport type { PagesPageLabels } from './labels'\n\nexport interface PageViewProps {\n page: SavedPage\n l: PagesPageLabels\n canEdit: boolean\n canDelete: boolean\n /** May the viewer share it (their own private page, as an editor)? */\n canShare: boolean\n sharing: boolean\n onBack: () => void\n onEdit: () => void\n onShare: () => void\n onDelete: () => void\n /** \"Copy to workspace\u2026\": omitted, not offered (e.g. a dashboard from before pages). */\n onCopy?: () => void\n /** \"Move to workspace\u2026\": offered with `onCopy` only to whoever may delete the page here. */\n onMove?: () => void\n children?: ReactNode\n testId: string\n}\n\nexport function PageView({\n page,\n l,\n canEdit,\n canDelete,\n canShare,\n sharing,\n onBack,\n onEdit,\n onShare,\n onDelete,\n onCopy,\n onMove,\n children,\n testId,\n}: PageViewProps) {\n return (\n <div className=\"space-y-6\" data-testid={`${testId}-view`}>\n <PageHeader\n title={page.spec.title}\n description={page.spec.description}\n leading={\n <Button variant=\"ghost\" size=\"icon\" aria-label={l.back} onClick={onBack}>\n <ArrowLeft className=\"size-4\" />\n </Button>\n }\n actions={\n <div className=\"flex flex-wrap items-center gap-3\">\n {page.shared ? (\n <Badge variant=\"secondary\" className=\"gap-1\" data-testid={`${testId}-shared`}>\n <Users className=\"size-3.5\" /> {l.sharedBadge}\n </Badge>\n ) : (\n canShare && (\n <Button\n variant=\"outline\"\n onClick={onShare}\n disabled={sharing}\n data-testid={`${testId}-share`}\n >\n <Share2 className=\"size-4\" /> {l.share}\n </Button>\n )\n )}\n {canEdit && (\n <Button variant=\"outline\" onClick={onEdit} data-testid={`${testId}-edit`}>\n <Pencil className=\"size-4\" /> {l.edit}\n </Button>\n )}\n {(canDelete || onCopy) && (\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <Button\n variant=\"ghost\"\n size=\"icon\"\n aria-label={l.more}\n data-testid={`${testId}-more`}\n >\n <MoreHorizontal className=\"size-4\" />\n </Button>\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"end\">\n {onCopy && (\n <DropdownMenuItem onSelect={onCopy} data-testid={`${testId}-copy-to`}>\n <Copy className=\"size-4\" /> {l.copyToWorkspace}\n </DropdownMenuItem>\n )}\n {onCopy && onMove && canDelete && (\n <DropdownMenuItem onSelect={onMove} data-testid={`${testId}-move-to`}>\n <ArrowRightLeft className=\"size-4\" /> {l.moveToWorkspace}\n </DropdownMenuItem>\n )}\n {onCopy && canDelete && <DropdownMenuSeparator />}\n {canDelete && (\n <DropdownMenuItem\n onSelect={onDelete}\n className=\"text-destructive focus:text-destructive\"\n data-testid={`${testId}-delete`}\n >\n <Trash2 className=\"size-4\" /> {l.delete}\n </DropdownMenuItem>\n )}\n </DropdownMenuContent>\n </DropdownMenu>\n )}\n </div>\n }\n />\n {page.legacy && (\n <p className=\"text-sm text-muted-foreground\" data-testid={`${testId}-legacy-note`}>\n {l.legacy}\n </p>\n )}\n {children}\n </div>\n )\n}\n"],
|
|
5
|
+
"mappings": ";AAwEY,cAME,YANF;AAlEZ;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AA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C,SAAQ;AAAA,gBACR,MAAK;AAAA,gBACL,cAAY,EAAE;AAAA,gBACd,eAAa,GAAG,MAAM;AAAA,gBAEtB,8BAAC,kBAAe,WAAU,UAAS;AAAA;AAAA,YACrC,GACF;AAAA,YACA,qBAAC,uBAAoB,OAAM,OACxB;AAAA,wBACC,qBAAC,oBAAiB,UAAU,QAAQ,eAAa,GAAG,MAAM,YACxD;AAAA,oCAAC,QAAK,WAAU,UAAS;AAAA,gBAAE;AAAA,gBAAE,EAAE;AAAA,iBACjC;AAAA,cAED,UAAU,UAAU,aACnB,qBAAC,oBAAiB,UAAU,QAAQ,eAAa,GAAG,MAAM,YACxD;AAAA,oCAAC,kBAAe,WAAU,UAAS;AAAA,gBAAE;AAAA,gBAAE,EAAE;AAAA,iBAC3C;AAAA,cAED,UAAU,aAAa,oBAAC,yBAAsB;AAAA,cAC9C,aACC;AAAA,gBAAC;AAAA;AAAA,kBACC,UAAU;AAAA,kBACV,WAAU;AAAA,kBACV,eAAa,GAAG,MAAM;AAAA,kBAEtB;AAAA,wCAAC,UAAO,WAAU,UAAS;AAAA,oBAAE;AAAA,oBAAE,EAAE;AAAA;AAAA;AAAA,cACnC;AAAA,eAEJ;AAAA,aACF;AAAA,WAEJ;AAAA;AAAA,IAEJ;AAAA,IACC,KAAK,UACJ,oBAAC,OAAE,WAAU,iCAAgC,eAAa,GAAG,MAAM,gBAChE,YAAE,QACL;AAAA,IAED;AAAA,KACH;AAEJ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type usePages } from '@arbidocs/react';
|
|
2
|
+
import type { PageTemplate } from '../dashboards/templates';
|
|
2
3
|
import type { PagesPageLabels } from './labels';
|
|
3
4
|
export interface PagesListProps {
|
|
4
5
|
query: ReturnType<typeof usePages>;
|
|
5
6
|
l: PagesPageLabels;
|
|
6
|
-
templates: readonly
|
|
7
|
+
templates: readonly PageTemplate[];
|
|
7
8
|
creating: boolean;
|
|
8
9
|
onOpen: (id: string) => void;
|
|
9
10
|
onBlank: () => void;
|
|
10
|
-
onTemplate: (
|
|
11
|
+
onTemplate: (template: PageTemplate) => void;
|
|
11
12
|
onDeleteUnreadable: (ids: string[]) => void;
|
|
12
13
|
testId: string;
|
|
13
14
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/connection/pages/PagesList.tsx"],
|
|
4
|
-
"sourcesContent": ["/**\n * The list of pages: the viewer's own and the workspace's shared ones (two tabs), \"New page\" (blank\n * or a template), and the pages that could not be opened (delete only).\n */\nimport { LayoutDashboard, Plus, Users } from 'lucide-react'\nimport { useSessionView, type
|
|
5
|
-
"mappings": ";
|
|
4
|
+
"sourcesContent": ["/**\n * The list of pages: the viewer's own and the workspace's shared ones (two tabs), \"New page\" (blank\n * or a template), and the pages that could not be opened (delete only).\n */\nimport { LayoutDashboard, Plus, Users } from 'lucide-react'\nimport { useSessionView, type usePages } from '@arbidocs/react'\nimport type { PageTemplate } from '../dashboards/templates'\nimport {\n Badge,\n Button,\n Card,\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuTrigger,\n Tabs,\n TabsList,\n TabsTrigger,\n} from '@arbidocs/react/ui'\nimport { EmptyState } from '../../components/EmptyState'\nimport { PageHeader } from '../../components/PageHeader'\nimport type { PagesPageLabels } from './labels'\n\n/**\n * \"New page\": a blank one opens in the editor; a template is saved and opened at once (a finished\n * page; Edit changes it), so each menu item says what the template shows.\n */\nfunction NewPageButton({\n templates,\n l,\n onBlank,\n onTemplate,\n busy,\n testId,\n}: {\n templates: readonly PageTemplate[]\n l: PagesPageLabels\n onBlank: () => void\n onTemplate: (template: PageTemplate) => void\n busy: boolean\n testId: string\n}) {\n return (\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <Button disabled={busy} data-testid={`${testId}-new`}>\n <Plus className=\"size-4\" /> {busy ? l.saving : l.newPage}\n </Button>\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"end\" className=\"max-w-[min(20rem,calc(100vw-1rem))]\">\n <DropdownMenuItem onSelect={onBlank} data-testid={`${testId}-blank`}>\n {l.blank}\n </DropdownMenuItem>\n {templates.map((t, i) => (\n <DropdownMenuItem\n key={`${t.title}-${i}`}\n onSelect={() => onTemplate(t)}\n className=\"flex-col items-start gap-0.5\"\n data-testid={`${testId}-template-${i}`}\n >\n <span>{t.title}</span>\n {t.description && (\n <span className=\"text-xs text-muted-foreground\">{t.description}</span>\n )}\n </DropdownMenuItem>\n ))}\n </DropdownMenuContent>\n </DropdownMenu>\n )\n}\n\nexport interface PagesListProps {\n query: ReturnType<typeof usePages>\n l: PagesPageLabels\n templates: readonly PageTemplate[]\n creating: boolean\n onOpen: (id: string) => void\n onBlank: () => void\n onTemplate: (template: PageTemplate) => void\n onDeleteUnreadable: (ids: string[]) => void\n testId: string\n}\n\nexport function PagesList({\n query,\n l,\n templates,\n creating,\n onOpen,\n onBlank,\n onTemplate,\n onDeleteUnreadable,\n testId,\n}: PagesListProps) {\n const [tab, setTab] = useSessionView<'mine' | 'shared'>('pages.tab', 'mine')\n const all = query.data ?? []\n const readable = all.filter((p) => !p.unreadable)\n const unreadable = all.filter((p) => p.unreadable)\n const list = readable.filter((p) => (tab === 'shared' ? p.shared : !p.shared))\n const newButton = (\n <NewPageButton\n templates={templates}\n l={l}\n onBlank={onBlank}\n onTemplate={onTemplate}\n busy={creating}\n testId={testId}\n />\n )\n // Empty only once the list is in: offline with nothing cached, the read is paused (not loading).\n const isEmpty = !!query.data && readable.length === 0\n return (\n <div className=\"space-y-6\" data-testid={`${testId}-list`}>\n {/* With none yet, the empty state holds the one \"New page\" (none while the list loads). */}\n <PageHeader\n title={l.title}\n description={l.description}\n actions={query.isError || (query.data && !isEmpty) ? newButton : undefined}\n />\n {unreadable.length > 0 && (\n <div className=\"flex flex-wrap items-center gap-3\" data-testid={`${testId}-unreadable`}>\n <p className=\"text-sm text-muted-foreground\">{l.unreadable(unreadable.length)}</p>\n <Button\n variant=\"outline\"\n size=\"sm\"\n onClick={() => onDeleteUnreadable(unreadable.map((p) => p.id))}\n >\n {l.deleteUnreadable}\n </Button>\n </div>\n )}\n {query.isError && !query.data ? (\n <div className=\"flex flex-wrap items-center gap-3\" role=\"alert\">\n <p className=\"text-sm text-destructive\">{l.loadError}</p>\n <Button variant=\"outline\" size=\"sm\" onClick={() => void query.refetch()}>\n {l.retry}\n </Button>\n </div>\n ) : !query.data && query.fetchStatus === 'paused' ? (\n <p className=\"text-sm text-muted-foreground\" data-testid={`${testId}-offline`}>\n {l.offline}\n </p>\n ) : !query.data ? (\n <div className=\"grid gap-4 sm:grid-cols-2 lg:grid-cols-3\">\n {[0, 1, 2].map((i) => (\n <div key={i} className=\"h-24 animate-pulse rounded-xl bg-muted\" />\n ))}\n </div>\n ) : isEmpty ? (\n <EmptyState\n icon={LayoutDashboard}\n title={l.empty}\n description={l.emptyDescription}\n action={newButton}\n testId={`${testId}-empty`}\n />\n ) : (\n <>\n <Tabs value={tab} onValueChange={(v) => setTab(v as 'mine' | 'shared')}>\n <TabsList>\n <TabsTrigger value=\"mine\" data-testid={`${testId}-tab-mine`}>\n {l.mine}\n </TabsTrigger>\n <TabsTrigger value=\"shared\" data-testid={`${testId}-tab-shared`}>\n {l.shared}\n </TabsTrigger>\n </TabsList>\n </Tabs>\n {list.length === 0 ? (\n <p className=\"text-sm text-muted-foreground\" data-testid={`${testId}-none`}>\n {tab === 'shared' ? l.noneShared : l.noneMine}\n </p>\n ) : (\n <ul className=\"grid gap-4 sm:grid-cols-2 lg:grid-cols-3\">\n {list.map((p) => (\n <li key={p.id}>\n <Card variant=\"elevated\" className=\"card-hover h-full rounded-xl p-0\">\n <button\n type=\"button\"\n className=\"flex size-full flex-col items-start gap-1 rounded-xl p-5 text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\"\n onClick={() => onOpen(p.id)}\n data-testid={`${testId}-open-${p.id}`}\n >\n <span className=\"flex items-center gap-2 font-medium text-foreground\">\n {p.shared ? (\n <Users className=\"size-4 text-muted-foreground\" />\n ) : (\n <LayoutDashboard className=\"size-4 text-muted-foreground\" />\n )}\n {p.spec.title}\n </span>\n {p.spec.description && (\n <span className=\"line-clamp-2 text-sm text-muted-foreground\">\n {p.spec.description}\n </span>\n )}\n <span className=\"flex items-center gap-2 text-xs text-muted-foreground\">\n {l.blocks(p.spec.blocks.length)}\n {p.legacy && (\n <Badge variant=\"outline\" data-testid={`${testId}-legacy-${p.id}`}>\n {l.privateBadge}\n </Badge>\n )}\n </span>\n </button>\n </Card>\n </li>\n ))}\n </ul>\n )}\n </>\n )}\n </div>\n )\n}\n"],
|
|
5
|
+
"mappings": ";AA6CQ,SAgHA,UA/GE,KADF;AAzCR,SAAS,iBAAiB,MAAM,aAAa;AAC7C,SAAS,sBAAqC;AAE9C;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,kBAAkB;AAC3B,SAAS,kBAAkB;AAO3B,SAAS,cAAc;AAAA,EACrB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAOG;AACD,SACE,qBAAC,gBACC;AAAA,wBAAC,uBAAoB,SAAO,MAC1B,+BAAC,UAAO,UAAU,MAAM,eAAa,GAAG,MAAM,QAC5C;AAAA,0BAAC,QAAK,WAAU,UAAS;AAAA,MAAE;AAAA,MAAE,OAAO,EAAE,SAAS,EAAE;AAAA,OACnD,GACF;AAAA,IACA,qBAAC,uBAAoB,OAAM,OAAM,WAAU,uCACzC;AAAA,0BAAC,oBAAiB,UAAU,SAAS,eAAa,GAAG,MAAM,UACxD,YAAE,OACL;AAAA,MACC,UAAU,IAAI,CAAC,GAAG,MACjB;AAAA,QAAC;AAAA;AAAA,UAEC,UAAU,MAAM,WAAW,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,CAAC,MACT,oBAAC,QACC,8BAAC,QAAK,SAAQ,YAAW,WAAU,oCACjC;AAAA,QAAC;AAAA;AAAA,UACC,MAAK;AAAA,UACL,WAAU;AAAA,UACV,SAAS,MAAM,OAAO,EAAE,EAAE;AAAA,UAC1B,eAAa,GAAG,MAAM,SAAS,EAAE,EAAE;AAAA,UAEnC;AAAA,iCAAC,UAAK,WAAU,uDACb;AAAA,gBAAE,SACD,oBAAC,SAAM,WAAU,gCAA+B,IAEhD,oBAAC,mBAAgB,WAAU,gCAA+B;AAAA,cAE3D,EAAE,KAAK;AAAA,eACV;AAAA,YACC,EAAE,KAAK,eACN,oBAAC,UAAK,WAAU,8CACb,YAAE,KAAK,aACV;AAAA,YAEF,qBAAC,UAAK,WAAU,yDACb;AAAA,gBAAE,OAAO,EAAE,KAAK,OAAO,MAAM;AAAA,cAC7B,EAAE,UACD,oBAAC,SAAM,SAAQ,WAAU,eAAa,GAAG,MAAM,WAAW,EAAE,EAAE,IAC3D,YAAE,cACL;AAAA,eAEJ;AAAA;AAAA;AAAA,MACF,GACF,KA9BO,EAAE,EA+BX,CACD,GACH;AAAA,OAEJ;AAAA,KAEJ;AAEJ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,19 +1,30 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* A page's grid as it is
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
2
|
+
* A page's grid as it is arranged: blocks in SLOTS. The page is 4 slots wide and as many slots
|
|
3
|
+
* tall as its blocks need; every block is 1 to 4 slots wide and 1 to 4 slots tall, in any
|
|
4
|
+
* combination. A slot is 3 of the page's 12 stored columns wide and 3 rows tall
|
|
5
|
+
* (`SLOT_COLUMNS`, `SLOT_ROWS`), so a block is saved as before (`x`/`y`/`w`/`h`), each a multiple
|
|
6
|
+
* of 3. Blocks never overlap and leave no gaps above them (vertical compaction, as dashboard grids
|
|
7
|
+
* do). Moving or resizing one pushes the blocks it lands on out of its way (up into the room it
|
|
8
|
+
* left, when they fit there, else down), and the rest float up again. Pure functions of the
|
|
9
|
+
* layouts: the grid calls them on every snapped step of a drag, and saves the result on drop.
|
|
7
10
|
*/
|
|
8
11
|
import { type BlockLayout, type PageBlockKind } from '@arbidocs/react';
|
|
9
|
-
/**
|
|
10
|
-
export declare const
|
|
12
|
+
/** A slot's width, in the page's 12 columns: a quarter of the page. */
|
|
13
|
+
export declare const SLOT_COLUMNS = 3;
|
|
14
|
+
/** A slot's height, in the page's rows (`PAGE_ROW_HEIGHT` each): about as tall as it is wide. */
|
|
15
|
+
export declare const SLOT_ROWS = 3;
|
|
16
|
+
/** The page is this many slots wide; a block is at most this many slots wide or tall. */
|
|
17
|
+
export declare const SLOTS_ACROSS: number;
|
|
18
|
+
export declare const MAX_BLOCK_SLOTS = 4;
|
|
19
|
+
/** A new block's size, in slots, by kind (any size may be chosen after). */
|
|
20
|
+
export declare const DEFAULT_BLOCK_SLOTS: Record<PageBlockKind, {
|
|
11
21
|
w: number;
|
|
12
22
|
h: number;
|
|
13
23
|
}>;
|
|
24
|
+
/** A new block's layout (columns and rows), by kind. */
|
|
25
|
+
export declare function defaultLayout(kind: PageBlockKind): BlockLayout;
|
|
14
26
|
export interface GridItem {
|
|
15
27
|
id: string;
|
|
16
|
-
kind: PageBlockKind;
|
|
17
28
|
layout: BlockLayout;
|
|
18
29
|
}
|
|
19
30
|
/**
|
|
@@ -22,17 +33,38 @@ export interface GridItem {
|
|
|
22
33
|
*/
|
|
23
34
|
export declare function compactLayout<T extends GridItem>(items: readonly T[], pinned?: string): T[];
|
|
24
35
|
/**
|
|
25
|
-
* A
|
|
26
|
-
* the
|
|
36
|
+
* A layout in slot cells: each side to the nearest whole slot (1 to 4 slots wide and tall), on
|
|
37
|
+
* the page. Columns and rows in, fractions allowed (a pointer's).
|
|
38
|
+
*/
|
|
39
|
+
export declare function snapLayout(layout: BlockLayout): BlockLayout;
|
|
40
|
+
/**
|
|
41
|
+
* Blocks in slot cells: a layout saved before slots at the nearest slot size and place, then
|
|
42
|
+
* compacted. One already in slots comes back as it was.
|
|
43
|
+
*/
|
|
44
|
+
export declare function normalizeLayout<T extends GridItem>(items: readonly T[]): T[];
|
|
45
|
+
/**
|
|
46
|
+
* A block moved (its new place in columns and rows, fractions allowed) into the nearest slot cell:
|
|
47
|
+
* what it lands on makes way. `settle`: compact the block itself too (on drop); while dragging it
|
|
48
|
+
* stays where the pointer has it.
|
|
27
49
|
*/
|
|
28
50
|
export declare function moveBlock<T extends GridItem>(items: readonly T[], id: string, to: {
|
|
29
51
|
x: number;
|
|
30
52
|
y: number;
|
|
31
53
|
}, settle?: boolean): T[];
|
|
32
|
-
/**
|
|
54
|
+
/**
|
|
55
|
+
* A block resized to the nearest whole slots (in columns and rows, fractions allowed): 1 to 4
|
|
56
|
+
* slots each way, no wider than the page from where it starts.
|
|
57
|
+
*/
|
|
33
58
|
export declare function resizeBlock<T extends GridItem>(items: readonly T[], id: string, to: {
|
|
34
59
|
w: number;
|
|
35
60
|
h: number;
|
|
36
61
|
}, settle?: boolean): T[];
|
|
37
|
-
/** A
|
|
62
|
+
/** A block one slot wider or narrower (`dw`), taller or shorter (`dh`), as far as it may go. */
|
|
63
|
+
export declare function stepSize<T extends GridItem>(items: readonly T[], id: string, dw: -1 | 0 | 1, dh: -1 | 0 | 1): T[];
|
|
64
|
+
/**
|
|
65
|
+
* A block one slot over: left or right a slot, or up or down past the nearest block above or
|
|
66
|
+
* below it (they swap places). Nothing that way: it stays.
|
|
67
|
+
*/
|
|
68
|
+
export declare function stepMove<T extends GridItem>(items: readonly T[], id: string, dx: -1 | 0 | 1, dy: -1 | 0 | 1): T[];
|
|
69
|
+
/** A new block: below everything, at the left, in slot cells. */
|
|
38
70
|
export declare function appendBlock<T extends GridItem>(items: readonly T[], item: T): T[];
|
|
@@ -3,16 +3,27 @@ import {
|
|
|
3
3
|
DEFAULT_BLOCK_HEIGHT,
|
|
4
4
|
PAGE_GRID_COLUMNS
|
|
5
5
|
} from "@arbidocs/react";
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
6
|
+
const SLOT_COLUMNS = 3;
|
|
7
|
+
const SLOT_ROWS = 3;
|
|
8
|
+
const SLOTS_ACROSS = PAGE_GRID_COLUMNS / SLOT_COLUMNS;
|
|
9
|
+
const MAX_BLOCK_SLOTS = 4;
|
|
10
|
+
const DEFAULT_BLOCK_SLOTS = {
|
|
11
|
+
metric: { w: 1, h: DEFAULT_BLOCK_HEIGHT.metric / SLOT_ROWS },
|
|
12
|
+
text: { w: 2, h: DEFAULT_BLOCK_HEIGHT.text / SLOT_ROWS },
|
|
13
|
+
chart: { w: 2, h: DEFAULT_BLOCK_HEIGHT.chart / SLOT_ROWS },
|
|
14
|
+
table: { w: 4, h: DEFAULT_BLOCK_HEIGHT.table / SLOT_ROWS },
|
|
15
|
+
document: { w: 2, h: DEFAULT_BLOCK_HEIGHT.document / SLOT_ROWS },
|
|
16
|
+
gallery: { w: 2, h: DEFAULT_BLOCK_HEIGHT.gallery / SLOT_ROWS },
|
|
17
|
+
list: { w: 2, h: DEFAULT_BLOCK_HEIGHT.list / SLOT_ROWS },
|
|
18
|
+
carousel: { w: 4, h: DEFAULT_BLOCK_HEIGHT.carousel / SLOT_ROWS },
|
|
19
|
+
agenda: { w: 2, h: DEFAULT_BLOCK_HEIGHT.agenda / SLOT_ROWS },
|
|
20
|
+
start: { w: 4, h: DEFAULT_BLOCK_HEIGHT.start / SLOT_ROWS }
|
|
13
21
|
};
|
|
22
|
+
function defaultLayout(kind) {
|
|
23
|
+
const { w, h } = DEFAULT_BLOCK_SLOTS[kind];
|
|
24
|
+
return { x: 0, y: 0, w: w * SLOT_COLUMNS, h: h * SLOT_ROWS };
|
|
25
|
+
}
|
|
14
26
|
const overlaps = (a, b) => a.x < b.x + b.w && b.x < a.x + a.w && a.y < b.y + b.h && b.y < a.y + a.h;
|
|
15
|
-
const clampInt = (n, lo, hi) => Math.min(hi, Math.max(lo, Math.round(n)));
|
|
16
27
|
function compactLayout(items, pinned) {
|
|
17
28
|
const placed = [];
|
|
18
29
|
const out = /* @__PURE__ */ new Map();
|
|
@@ -56,43 +67,76 @@ function place(items, id, layout) {
|
|
|
56
67
|
moved
|
|
57
68
|
);
|
|
58
69
|
}
|
|
70
|
+
const clampSlots = (n, lo, hi) => Math.min(hi, Math.max(lo, Math.round(n)));
|
|
71
|
+
function snapLayout(layout) {
|
|
72
|
+
const w = clampSlots(layout.w / SLOT_COLUMNS, 1, MAX_BLOCK_SLOTS);
|
|
73
|
+
const h = clampSlots(layout.h / SLOT_ROWS, 1, MAX_BLOCK_SLOTS);
|
|
74
|
+
const x = clampSlots(layout.x / SLOT_COLUMNS, 0, SLOTS_ACROSS - w);
|
|
75
|
+
const y = Math.max(0, Math.round(layout.y / SLOT_ROWS));
|
|
76
|
+
return { x: x * SLOT_COLUMNS, y: y * SLOT_ROWS, w: w * SLOT_COLUMNS, h: h * SLOT_ROWS };
|
|
77
|
+
}
|
|
78
|
+
function normalizeLayout(items) {
|
|
79
|
+
return compactLayout(items.map((i) => ({ ...i, layout: snapLayout(i.layout) })));
|
|
80
|
+
}
|
|
59
81
|
function moveBlock(items, id, to, settle = true) {
|
|
60
82
|
const item = items.find((i) => i.id === id);
|
|
61
83
|
if (!item) return [...items];
|
|
62
|
-
const layout = {
|
|
63
|
-
...item.layout,
|
|
64
|
-
x: clampInt(to.x, 0, PAGE_GRID_COLUMNS - item.layout.w),
|
|
65
|
-
y: Math.max(0, Math.round(to.y))
|
|
66
|
-
};
|
|
84
|
+
const layout = snapLayout({ ...item.layout, x: to.x, y: to.y });
|
|
67
85
|
const next = compactLayout(place(items, id, layout), id);
|
|
68
86
|
return settle ? compactLayout(next) : next;
|
|
69
87
|
}
|
|
70
88
|
function resizeBlock(items, id, to, settle = true) {
|
|
71
89
|
const item = items.find((i) => i.id === id);
|
|
72
90
|
if (!item) return [...items];
|
|
73
|
-
const
|
|
74
|
-
const
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
to.w,
|
|
78
|
-
Math.min(min.w, PAGE_GRID_COLUMNS - item.layout.x),
|
|
79
|
-
PAGE_GRID_COLUMNS - item.layout.x
|
|
80
|
-
),
|
|
81
|
-
h: Math.max(min.h, Math.round(to.h))
|
|
82
|
-
};
|
|
91
|
+
const room = SLOTS_ACROSS - item.layout.x / SLOT_COLUMNS;
|
|
92
|
+
const w = clampSlots(to.w / SLOT_COLUMNS, 1, Math.min(MAX_BLOCK_SLOTS, room));
|
|
93
|
+
const h = clampSlots(to.h / SLOT_ROWS, 1, MAX_BLOCK_SLOTS);
|
|
94
|
+
const layout = { ...item.layout, w: w * SLOT_COLUMNS, h: h * SLOT_ROWS };
|
|
83
95
|
const next = compactLayout(place(items, id, layout), id);
|
|
84
96
|
return settle ? compactLayout(next) : next;
|
|
85
97
|
}
|
|
98
|
+
function stepSize(items, id, dw, dh) {
|
|
99
|
+
const item = items.find((i) => i.id === id);
|
|
100
|
+
if (!item) return [...items];
|
|
101
|
+
return resizeBlock(items, id, {
|
|
102
|
+
w: item.layout.w + dw * SLOT_COLUMNS,
|
|
103
|
+
h: item.layout.h + dh * SLOT_ROWS
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
function stepMove(items, id, dx, dy) {
|
|
107
|
+
const item = items.find((i) => i.id === id);
|
|
108
|
+
if (!item) return [...items];
|
|
109
|
+
const at = item.layout;
|
|
110
|
+
if (dx) return moveBlock(items, id, { x: at.x + dx * SLOT_COLUMNS, y: at.y });
|
|
111
|
+
if (!dy) return [...items];
|
|
112
|
+
const sameColumns = (b) => b.x < at.x + at.w && at.x < b.x + b.w;
|
|
113
|
+
const others = items.filter((i) => i.id !== id && sameColumns(i.layout)).map((i) => i.layout);
|
|
114
|
+
if (dy > 0) {
|
|
115
|
+
const below = others.filter((b) => b.y >= at.y + at.h).sort((a, b) => a.y - b.y)[0];
|
|
116
|
+
return below ? moveBlock(items, id, { x: at.x, y: below.y + below.h - at.h }) : [...items];
|
|
117
|
+
}
|
|
118
|
+
const above = others.filter((b) => b.y + b.h <= at.y).sort((a, b) => b.y - a.y)[0];
|
|
119
|
+
return above ? moveBlock(items, id, { x: at.x, y: above.y }) : [...items];
|
|
120
|
+
}
|
|
86
121
|
function appendBlock(items, item) {
|
|
87
122
|
const bottom = Math.max(0, ...items.map((i) => i.layout.y + i.layout.h));
|
|
88
|
-
const
|
|
89
|
-
return compactLayout([...items, { ...item, layout
|
|
123
|
+
const layout = snapLayout({ ...item.layout, x: 0, y: bottom });
|
|
124
|
+
return compactLayout([...items, { ...item, layout }]);
|
|
90
125
|
}
|
|
91
126
|
export {
|
|
92
|
-
|
|
127
|
+
DEFAULT_BLOCK_SLOTS,
|
|
128
|
+
MAX_BLOCK_SLOTS,
|
|
129
|
+
SLOTS_ACROSS,
|
|
130
|
+
SLOT_COLUMNS,
|
|
131
|
+
SLOT_ROWS,
|
|
93
132
|
appendBlock,
|
|
94
133
|
compactLayout,
|
|
134
|
+
defaultLayout,
|
|
95
135
|
moveBlock,
|
|
96
|
-
|
|
136
|
+
normalizeLayout,
|
|
137
|
+
resizeBlock,
|
|
138
|
+
snapLayout,
|
|
139
|
+
stepMove,
|
|
140
|
+
stepSize
|
|
97
141
|
};
|
|
98
142
|
//# sourceMappingURL=grid-layout.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/connection/pages/grid-layout.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * A page's grid as it is
|
|
5
|
-
"mappings": ";
|
|
4
|
+
"sourcesContent": ["/**\n * A page's grid as it is arranged: blocks in SLOTS. The page is 4 slots wide and as many slots\n * tall as its blocks need; every block is 1 to 4 slots wide and 1 to 4 slots tall, in any\n * combination. A slot is 3 of the page's 12 stored columns wide and 3 rows tall\n * (`SLOT_COLUMNS`, `SLOT_ROWS`), so a block is saved as before (`x`/`y`/`w`/`h`), each a multiple\n * of 3. Blocks never overlap and leave no gaps above them (vertical compaction, as dashboard grids\n * do). Moving or resizing one pushes the blocks it lands on out of its way (up into the room it\n * left, when they fit there, else down), and the rest float up again. Pure functions of the\n * layouts: the grid calls them on every snapped step of a drag, and saves the result on drop.\n */\nimport {\n DEFAULT_BLOCK_HEIGHT,\n PAGE_GRID_COLUMNS,\n type BlockLayout,\n type PageBlockKind,\n} from '@arbidocs/react'\n\n/** A slot's width, in the page's 12 columns: a quarter of the page. */\nexport const SLOT_COLUMNS = 3\n/** A slot's height, in the page's rows (`PAGE_ROW_HEIGHT` each): about as tall as it is wide. */\nexport const SLOT_ROWS = 3\n/** The page is this many slots wide; a block is at most this many slots wide or tall. */\nexport const SLOTS_ACROSS = PAGE_GRID_COLUMNS / SLOT_COLUMNS\nexport const MAX_BLOCK_SLOTS = 4\n\n/** A new block's size, in slots, by kind (any size may be chosen after). */\nexport const DEFAULT_BLOCK_SLOTS: Record<PageBlockKind, { w: number; h: number }> = {\n metric: { w: 1, h: DEFAULT_BLOCK_HEIGHT.metric / SLOT_ROWS },\n text: { w: 2, h: DEFAULT_BLOCK_HEIGHT.text / SLOT_ROWS },\n chart: { w: 2, h: DEFAULT_BLOCK_HEIGHT.chart / SLOT_ROWS },\n table: { w: 4, h: DEFAULT_BLOCK_HEIGHT.table / SLOT_ROWS },\n document: { w: 2, h: DEFAULT_BLOCK_HEIGHT.document / SLOT_ROWS },\n gallery: { w: 2, h: DEFAULT_BLOCK_HEIGHT.gallery / SLOT_ROWS },\n list: { w: 2, h: DEFAULT_BLOCK_HEIGHT.list / SLOT_ROWS },\n carousel: { w: 4, h: DEFAULT_BLOCK_HEIGHT.carousel / SLOT_ROWS },\n agenda: { w: 2, h: DEFAULT_BLOCK_HEIGHT.agenda / SLOT_ROWS },\n start: { w: 4, h: DEFAULT_BLOCK_HEIGHT.start / SLOT_ROWS },\n}\n\n/** A new block's layout (columns and rows), by kind. */\nexport function defaultLayout(kind: PageBlockKind): BlockLayout {\n const { w, h } = DEFAULT_BLOCK_SLOTS[kind]\n return { x: 0, y: 0, w: w * SLOT_COLUMNS, h: h * SLOT_ROWS }\n}\n\nexport interface GridItem {\n id: string\n layout: BlockLayout\n}\n\nconst overlaps = (a: BlockLayout, b: BlockLayout) =>\n a.x < b.x + b.w && b.x < a.x + a.w && a.y < b.y + b.h && b.y < a.y + a.h\n\n/**\n * Float every block up as far as it goes, top to bottom (left to right in a row), never onto\n * another. `pinned` stays where it is (the block being dragged): the others settle around it.\n */\nexport function compactLayout<T extends GridItem>(items: readonly T[], pinned?: string): T[] {\n const placed: BlockLayout[] = []\n const out = new Map<string, T>()\n const fixed = items.find((i) => i.id === pinned)\n if (fixed) {\n placed.push(fixed.layout)\n out.set(fixed.id, fixed)\n }\n const order = items\n .filter((i) => i.id !== pinned)\n .sort((a, b) => a.layout.y - b.layout.y || a.layout.x - b.layout.x)\n for (const item of order) {\n const layout = { ...item.layout }\n while (placed.some((p) => overlaps(p, layout))) layout.y += 1\n while (layout.y > 0 && !placed.some((p) => overlaps(p, { ...layout, y: layout.y - 1 })))\n layout.y -= 1\n placed.push(layout)\n out.set(item.id, { ...item, layout })\n }\n return items.map((i) => out.get(i.id) ?? i)\n}\n\n/** Push every block that overlaps `mover` out of its way: up into room it fits, else below it. */\nfunction pushAway<T extends GridItem>(items: T[], mover: T): T[] {\n let next = items\n const others = () => next.filter((i) => i.id !== mover.id)\n for (const hit of others().sort((a, b) => a.layout.y - b.layout.y)) {\n const current = next.find((i) => i.id === hit.id)\n if (!current || !overlaps(current.layout, mover.layout)) continue\n const above = { ...current.layout, y: mover.layout.y - current.layout.h }\n const fitsAbove =\n above.y >= 0 && !next.some((i) => i.id !== current.id && overlaps(i.layout, above))\n const layout = fitsAbove ? above : { ...current.layout, y: mover.layout.y + mover.layout.h }\n const moved = { ...current, layout }\n next = next.map((i) => (i.id === moved.id ? moved : i))\n // A block pushed down pushes what it now lands on (the mover keeps its place).\n if (!fitsAbove) next = pushAway(next, moved).map((i) => (i.id === mover.id ? mover : i))\n }\n return next\n}\n\nfunction place<T extends GridItem>(items: readonly T[], id: string, layout: BlockLayout): T[] {\n const mover = items.find((i) => i.id === id)\n if (!mover) return [...items]\n const moved = { ...mover, layout }\n return pushAway(\n items.map((i) => (i.id === id ? moved : i)),\n moved\n )\n}\n\nconst clampSlots = (n: number, lo: number, hi: number) => Math.min(hi, Math.max(lo, Math.round(n)))\n\n/**\n * A layout in slot cells: each side to the nearest whole slot (1 to 4 slots wide and tall), on\n * the page. Columns and rows in, fractions allowed (a pointer's).\n */\nexport function snapLayout(layout: BlockLayout): BlockLayout {\n const w = clampSlots(layout.w / SLOT_COLUMNS, 1, MAX_BLOCK_SLOTS)\n const h = clampSlots(layout.h / SLOT_ROWS, 1, MAX_BLOCK_SLOTS)\n const x = clampSlots(layout.x / SLOT_COLUMNS, 0, SLOTS_ACROSS - w)\n const y = Math.max(0, Math.round(layout.y / SLOT_ROWS))\n return { x: x * SLOT_COLUMNS, y: y * SLOT_ROWS, w: w * SLOT_COLUMNS, h: h * SLOT_ROWS }\n}\n\n/**\n * Blocks in slot cells: a layout saved before slots at the nearest slot size and place, then\n * compacted. One already in slots comes back as it was.\n */\nexport function normalizeLayout<T extends GridItem>(items: readonly T[]): T[] {\n return compactLayout(items.map((i) => ({ ...i, layout: snapLayout(i.layout) })))\n}\n\n/**\n * A block moved (its new place in columns and rows, fractions allowed) into the nearest slot cell:\n * what it lands on makes way. `settle`: compact the block itself too (on drop); while dragging it\n * stays where the pointer has it.\n */\nexport function moveBlock<T extends GridItem>(\n items: readonly T[],\n id: string,\n to: { x: number; y: number },\n settle = true\n): T[] {\n const item = items.find((i) => i.id === id)\n if (!item) return [...items]\n const layout = snapLayout({ ...item.layout, x: to.x, y: to.y })\n const next = compactLayout(place(items, id, layout), id)\n return settle ? compactLayout(next) : next\n}\n\n/**\n * A block resized to the nearest whole slots (in columns and rows, fractions allowed): 1 to 4\n * slots each way, no wider than the page from where it starts.\n */\nexport function resizeBlock<T extends GridItem>(\n items: readonly T[],\n id: string,\n to: { w: number; h: number },\n settle = true\n): T[] {\n const item = items.find((i) => i.id === id)\n if (!item) return [...items]\n const room = SLOTS_ACROSS - item.layout.x / SLOT_COLUMNS\n const w = clampSlots(to.w / SLOT_COLUMNS, 1, Math.min(MAX_BLOCK_SLOTS, room))\n const h = clampSlots(to.h / SLOT_ROWS, 1, MAX_BLOCK_SLOTS)\n const layout = { ...item.layout, w: w * SLOT_COLUMNS, h: h * SLOT_ROWS }\n const next = compactLayout(place(items, id, layout), id)\n return settle ? compactLayout(next) : next\n}\n\n/** A block one slot wider or narrower (`dw`), taller or shorter (`dh`), as far as it may go. */\nexport function stepSize<T extends GridItem>(\n items: readonly T[],\n id: string,\n dw: -1 | 0 | 1,\n dh: -1 | 0 | 1\n): T[] {\n const item = items.find((i) => i.id === id)\n if (!item) return [...items]\n return resizeBlock(items, id, {\n w: item.layout.w + dw * SLOT_COLUMNS,\n h: item.layout.h + dh * SLOT_ROWS,\n })\n}\n\n/**\n * A block one slot over: left or right a slot, or up or down past the nearest block above or\n * below it (they swap places). Nothing that way: it stays.\n */\nexport function stepMove<T extends GridItem>(\n items: readonly T[],\n id: string,\n dx: -1 | 0 | 1,\n dy: -1 | 0 | 1\n): T[] {\n const item = items.find((i) => i.id === id)\n if (!item) return [...items]\n const at = item.layout\n if (dx) return moveBlock(items, id, { x: at.x + dx * SLOT_COLUMNS, y: at.y })\n if (!dy) return [...items]\n const sameColumns = (b: BlockLayout) => b.x < at.x + at.w && at.x < b.x + b.w\n const others = items.filter((i) => i.id !== id && sameColumns(i.layout)).map((i) => i.layout)\n if (dy > 0) {\n const below = others.filter((b) => b.y >= at.y + at.h).sort((a, b) => a.y - b.y)[0]\n return below ? moveBlock(items, id, { x: at.x, y: below.y + below.h - at.h }) : [...items]\n }\n const above = others.filter((b) => b.y + b.h <= at.y).sort((a, b) => b.y - a.y)[0]\n return above ? moveBlock(items, id, { x: at.x, y: above.y }) : [...items]\n}\n\n/** A new block: below everything, at the left, in slot cells. */\nexport function appendBlock<T extends GridItem>(items: readonly T[], item: T): T[] {\n const bottom = Math.max(0, ...items.map((i) => i.layout.y + i.layout.h))\n const layout = snapLayout({ ...item.layout, x: 0, y: bottom })\n return compactLayout([...items, { ...item, layout }])\n}\n"],
|
|
5
|
+
"mappings": ";AAUA;AAAA,EACE;AAAA,EACA;AAAA,OAGK;AAGA,MAAM,eAAe;AAErB,MAAM,YAAY;AAElB,MAAM,eAAe,oBAAoB;AACzC,MAAM,kBAAkB;AAGxB,MAAM,sBAAuE;AAAA,EAClF,QAAQ,EAAE,GAAG,GAAG,GAAG,qBAAqB,SAAS,UAAU;AAAA,EAC3D,MAAM,EAAE,GAAG,GAAG,GAAG,qBAAqB,OAAO,UAAU;AAAA,EACvD,OAAO,EAAE,GAAG,GAAG,GAAG,qBAAqB,QAAQ,UAAU;AAAA,EACzD,OAAO,EAAE,GAAG,GAAG,GAAG,qBAAqB,QAAQ,UAAU;AAAA,EACzD,UAAU,EAAE,GAAG,GAAG,GAAG,qBAAqB,WAAW,UAAU;AAAA,EAC/D,SAAS,EAAE,GAAG,GAAG,GAAG,qBAAqB,UAAU,UAAU;AAAA,EAC7D,MAAM,EAAE,GAAG,GAAG,GAAG,qBAAqB,OAAO,UAAU;AAAA,EACvD,UAAU,EAAE,GAAG,GAAG,GAAG,qBAAqB,WAAW,UAAU;AAAA,EAC/D,QAAQ,EAAE,GAAG,GAAG,GAAG,qBAAqB,SAAS,UAAU;AAAA,EAC3D,OAAO,EAAE,GAAG,GAAG,GAAG,qBAAqB,QAAQ,UAAU;AAC3D;AAGO,SAAS,cAAc,MAAkC;AAC9D,QAAM,EAAE,GAAG,EAAE,IAAI,oBAAoB,IAAI;AACzC,SAAO,EAAE,GAAG,GAAG,GAAG,GAAG,GAAG,IAAI,cAAc,GAAG,IAAI,UAAU;AAC7D;AAOA,MAAM,WAAW,CAAC,GAAgB,MAChC,EAAE,IAAI,EAAE,IAAI,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C,GAAG,MAAM,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC;AACjF,SAAO,QAAQ,UAAU,OAAO,IAAI,EAAE,GAAG,GAAG,GAAG,GAAG,MAAM,EAAE,CAAC,IAAI,CAAC,GAAG,KAAK;AAC1E;AAGO,SAAS,YAAgC,OAAqB,MAAc;AACjF,QAAM,SAAS,KAAK,IAAI,GAAG,GAAG,MAAM,IAAI,CAAC,MAAM,EAAE,OAAO,IAAI,EAAE,OAAO,CAAC,CAAC;AACvE,QAAM,SAAS,WAAW,EAAE,GAAG,KAAK,QAAQ,GAAG,GAAG,GAAG,OAAO,CAAC;AAC7D,SAAO,cAAc,CAAC,GAAG,OAAO,EAAE,GAAG,MAAM,OAAO,CAAC,CAAC;AACtD;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
export { ConnectedPagesPage, type ConnectedPagesPageProps } from './ConnectedPagesPage';
|
|
2
|
+
export { DEFAULT_PAGE_TRANSFER_LABELS, PageTransferDialog, type PageTransferDialogLabels, type PageTransferDialogProps, type PageTransferMode, } from './PageTransferDialog';
|
|
2
3
|
export { DEFAULT_PAGES_PAGE_LABELS, type PagesPageLabels } from './labels';
|
|
3
4
|
export { BlockEditor, DEFAULT_BLOCK_EDITOR_LABELS, type BlockEditorLabels, type BlockEditorProps, } from './BlockEditor';
|
|
4
5
|
export { PageBlockView, type PageBlockViewProps } from './PageBlockView';
|
|
5
|
-
export {
|
|
6
|
-
export {
|
|
6
|
+
export { DEFAULT_LIVE_BLOCK_EDITOR_LABELS, LiveBlockEditor, type LiveBlockEditorLabels, type LiveBlockEditorProps, } from './LiveBlockEditor';
|
|
7
|
+
export { PAGE_TEMPLATES, pageOfTemplate } from './page-templates';
|
|
8
|
+
export { DEFAULT_EDITABLE_PAGE_GRID_LABELS, EditablePageGrid, NO_DRAG, type EditablePageGridLabels, type EditablePageGridProps, } from './EditablePageGrid';
|
|
9
|
+
export { DEFAULT_BLOCK_SLOTS, MAX_BLOCK_SLOTS, SLOT_COLUMNS, SLOT_ROWS, SLOTS_ACROSS, appendBlock, compactLayout, defaultLayout, moveBlock, normalizeLayout, resizeBlock, snapLayout, stepMove, stepSize, type GridItem, } from './grid-layout';
|
|
7
10
|
export { PAGE_ROW_HEIGHT, PageCell, PageGrid, inReadingOrder, type PageGridProps } from './PageGrid';
|
|
8
11
|
export { DEFAULT_TABLE_VIEW_BLOCK_LABELS, TableViewBlock, type TableViewBlockLabels, type TableViewBlockProps, } from './TableViewBlock';
|
|
9
12
|
export { DEFAULT_VIEW_PICKER_LABELS, ViewPicker, type ViewPickerLabels, type ViewPickerProps, } from './ViewPicker';
|
|
@@ -1,21 +1,40 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { ConnectedPagesPage } from "./ConnectedPagesPage.js";
|
|
3
|
+
import {
|
|
4
|
+
DEFAULT_PAGE_TRANSFER_LABELS,
|
|
5
|
+
PageTransferDialog
|
|
6
|
+
} from "./PageTransferDialog.js";
|
|
3
7
|
import { DEFAULT_PAGES_PAGE_LABELS } from "./labels.js";
|
|
4
8
|
import {
|
|
5
9
|
BlockEditor,
|
|
6
10
|
DEFAULT_BLOCK_EDITOR_LABELS
|
|
7
11
|
} from "./BlockEditor.js";
|
|
8
12
|
import { PageBlockView } from "./PageBlockView.js";
|
|
13
|
+
import {
|
|
14
|
+
DEFAULT_LIVE_BLOCK_EDITOR_LABELS,
|
|
15
|
+
LiveBlockEditor
|
|
16
|
+
} from "./LiveBlockEditor.js";
|
|
17
|
+
import { PAGE_TEMPLATES, pageOfTemplate } from "./page-templates.js";
|
|
9
18
|
import {
|
|
10
19
|
DEFAULT_EDITABLE_PAGE_GRID_LABELS,
|
|
11
|
-
EditablePageGrid
|
|
20
|
+
EditablePageGrid,
|
|
21
|
+
NO_DRAG
|
|
12
22
|
} from "./EditablePageGrid.js";
|
|
13
23
|
import {
|
|
14
|
-
|
|
24
|
+
DEFAULT_BLOCK_SLOTS,
|
|
25
|
+
MAX_BLOCK_SLOTS,
|
|
26
|
+
SLOT_COLUMNS,
|
|
27
|
+
SLOT_ROWS,
|
|
28
|
+
SLOTS_ACROSS,
|
|
15
29
|
appendBlock,
|
|
16
30
|
compactLayout,
|
|
31
|
+
defaultLayout,
|
|
17
32
|
moveBlock,
|
|
18
|
-
|
|
33
|
+
normalizeLayout,
|
|
34
|
+
resizeBlock,
|
|
35
|
+
snapLayout,
|
|
36
|
+
stepMove,
|
|
37
|
+
stepSize
|
|
19
38
|
} from "./grid-layout.js";
|
|
20
39
|
import { PAGE_ROW_HEIGHT, PageCell, PageGrid, inReadingOrder } from "./PageGrid.js";
|
|
21
40
|
import {
|
|
@@ -40,10 +59,13 @@ export {
|
|
|
40
59
|
BlockEditor,
|
|
41
60
|
ConnectedPagesPage,
|
|
42
61
|
DEFAULT_BLOCK_EDITOR_LABELS,
|
|
62
|
+
DEFAULT_BLOCK_SLOTS,
|
|
43
63
|
DEFAULT_DOCUMENTS_PICKER_LABELS,
|
|
44
64
|
DEFAULT_DOCUMENT_BLOCK_LABELS,
|
|
45
65
|
DEFAULT_EDITABLE_PAGE_GRID_LABELS,
|
|
66
|
+
DEFAULT_LIVE_BLOCK_EDITOR_LABELS,
|
|
46
67
|
DEFAULT_PAGES_PAGE_LABELS,
|
|
68
|
+
DEFAULT_PAGE_TRANSFER_LABELS,
|
|
47
69
|
DEFAULT_TABLE_VIEW_BLOCK_LABELS,
|
|
48
70
|
DEFAULT_VIEW_PICKER_LABELS,
|
|
49
71
|
DocumentBlockView,
|
|
@@ -51,17 +73,30 @@ export {
|
|
|
51
73
|
DocumentsPicker,
|
|
52
74
|
EditablePageGrid,
|
|
53
75
|
GalleryBlockView,
|
|
54
|
-
|
|
76
|
+
LiveBlockEditor,
|
|
77
|
+
MAX_BLOCK_SLOTS,
|
|
78
|
+
NO_DRAG,
|
|
55
79
|
PAGE_ROW_HEIGHT,
|
|
80
|
+
PAGE_TEMPLATES,
|
|
56
81
|
PageBlockView,
|
|
57
82
|
PageCell,
|
|
58
83
|
PageGrid,
|
|
84
|
+
PageTransferDialog,
|
|
85
|
+
SLOTS_ACROSS,
|
|
86
|
+
SLOT_COLUMNS,
|
|
87
|
+
SLOT_ROWS,
|
|
59
88
|
TableViewBlock,
|
|
60
89
|
ViewPicker,
|
|
61
90
|
appendBlock,
|
|
62
91
|
compactLayout,
|
|
92
|
+
defaultLayout,
|
|
63
93
|
inReadingOrder,
|
|
64
94
|
moveBlock,
|
|
65
|
-
|
|
95
|
+
normalizeLayout,
|
|
96
|
+
pageOfTemplate,
|
|
97
|
+
resizeBlock,
|
|
98
|
+
snapLayout,
|
|
99
|
+
stepMove,
|
|
100
|
+
stepSize
|
|
66
101
|
};
|
|
67
102
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/connection/pages/index.ts"],
|
|
4
|
-
"sourcesContent": ["export { ConnectedPagesPage, type ConnectedPagesPageProps } from './ConnectedPagesPage'\nexport { DEFAULT_PAGES_PAGE_LABELS, type PagesPageLabels } from './labels'\nexport {\n BlockEditor,\n DEFAULT_BLOCK_EDITOR_LABELS,\n type BlockEditorLabels,\n type BlockEditorProps,\n} from './BlockEditor'\nexport { PageBlockView, type PageBlockViewProps } from './PageBlockView'\nexport {\n DEFAULT_EDITABLE_PAGE_GRID_LABELS,\n EditablePageGrid,\n type EditablePageGridLabels,\n type EditablePageGridProps,\n} from './EditablePageGrid'\nexport {\n
|
|
5
|
-
"mappings": ";AAAA,SAAS,0BAAwD;AACjE,SAAS,iCAAuD;AAChE;AAAA,EACE;AAAA,EACA;AAAA,OAGK;AACP,SAAS,qBAA8C;AACvD;AAAA,EACE;AAAA,EACA;AAAA,OAGK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AACP,SAAS,iBAAiB,UAAU,UAAU,sBAA0C;AACxF;AAAA,EACE;AAAA,EACA;AAAA,OAGK;AACP;AAAA,EACE;AAAA,EACA;AAAA,OAGK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAKK;AACP;AAAA,EACE;AAAA,EACA;AAAA,OAGK;",
|
|
4
|
+
"sourcesContent": ["export { ConnectedPagesPage, type ConnectedPagesPageProps } from './ConnectedPagesPage'\nexport {\n DEFAULT_PAGE_TRANSFER_LABELS,\n PageTransferDialog,\n type PageTransferDialogLabels,\n type PageTransferDialogProps,\n type PageTransferMode,\n} from './PageTransferDialog'\nexport { DEFAULT_PAGES_PAGE_LABELS, type PagesPageLabels } from './labels'\nexport {\n BlockEditor,\n DEFAULT_BLOCK_EDITOR_LABELS,\n type BlockEditorLabels,\n type BlockEditorProps,\n} from './BlockEditor'\nexport { PageBlockView, type PageBlockViewProps } from './PageBlockView'\nexport {\n DEFAULT_LIVE_BLOCK_EDITOR_LABELS,\n LiveBlockEditor,\n type LiveBlockEditorLabels,\n type LiveBlockEditorProps,\n} from './LiveBlockEditor'\nexport { PAGE_TEMPLATES, pageOfTemplate } from './page-templates'\nexport {\n DEFAULT_EDITABLE_PAGE_GRID_LABELS,\n EditablePageGrid,\n NO_DRAG,\n type EditablePageGridLabels,\n type EditablePageGridProps,\n} from './EditablePageGrid'\nexport {\n DEFAULT_BLOCK_SLOTS,\n MAX_BLOCK_SLOTS,\n SLOT_COLUMNS,\n SLOT_ROWS,\n SLOTS_ACROSS,\n appendBlock,\n compactLayout,\n defaultLayout,\n moveBlock,\n normalizeLayout,\n resizeBlock,\n snapLayout,\n stepMove,\n stepSize,\n type GridItem,\n} from './grid-layout'\nexport { PAGE_ROW_HEIGHT, PageCell, PageGrid, inReadingOrder, type PageGridProps } from './PageGrid'\nexport {\n DEFAULT_TABLE_VIEW_BLOCK_LABELS,\n TableViewBlock,\n type TableViewBlockLabels,\n type TableViewBlockProps,\n} from './TableViewBlock'\nexport {\n DEFAULT_VIEW_PICKER_LABELS,\n ViewPicker,\n type ViewPickerLabels,\n type ViewPickerProps,\n} from './ViewPicker'\nexport {\n DEFAULT_DOCUMENT_BLOCK_LABELS,\n DocumentBlockView,\n DocumentReadView,\n GalleryBlockView,\n type DocumentBlockLabels,\n type DocumentBlockViewProps,\n type DocumentReadViewProps,\n type GalleryBlockViewProps,\n} from './DocumentBlocks'\nexport {\n DEFAULT_DOCUMENTS_PICKER_LABELS,\n DocumentsPicker,\n type DocumentsPickerLabels,\n type DocumentsPickerProps,\n} from './DocumentsPicker'\n"],
|
|
5
|
+
"mappings": ";AAAA,SAAS,0BAAwD;AACjE;AAAA,EACE;AAAA,EACA;AAAA,OAIK;AACP,SAAS,iCAAuD;AAChE;AAAA,EACE;AAAA,EACA;AAAA,OAGK;AACP,SAAS,qBAA8C;AACvD;AAAA,EACE;AAAA,EACA;AAAA,OAGK;AACP,SAAS,gBAAgB,sBAAsB;AAC/C;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAGK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AACP,SAAS,iBAAiB,UAAU,UAAU,sBAA0C;AACxF;AAAA,EACE;AAAA,EACA;AAAA,OAGK;AACP;AAAA,EACE;AAAA,EACA;AAAA,OAGK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAKK;AACP;AAAA,EACE;AAAA,EACA;AAAA,OAGK;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -21,8 +21,10 @@ export interface PagesPageLabels {
|
|
|
21
21
|
blocks: (count: number) => string;
|
|
22
22
|
back: string;
|
|
23
23
|
edit: string;
|
|
24
|
-
/** The "…" menu of an open page (its rarer actions: delete). */
|
|
24
|
+
/** The "…" menu of an open page (its rarer actions: copy or move to a workspace, delete). */
|
|
25
25
|
more: string;
|
|
26
|
+
copyToWorkspace: string;
|
|
27
|
+
moveToWorkspace: string;
|
|
26
28
|
delete: string;
|
|
27
29
|
confirmDelete: (title: string) => string;
|
|
28
30
|
deleteFailed: string;
|
|
@@ -18,6 +18,8 @@ const DEFAULT_PAGES_PAGE_LABELS = {
|
|
|
18
18
|
back: "All pages",
|
|
19
19
|
edit: "Edit",
|
|
20
20
|
more: "More page actions",
|
|
21
|
+
copyToWorkspace: "Copy to workspace\u2026",
|
|
22
|
+
moveToWorkspace: "Move to workspace\u2026",
|
|
21
23
|
delete: "Delete",
|
|
22
24
|
confirmDelete: (title) => `Delete the page \u201C${title}\u201D? Its blocks go with it.`,
|
|
23
25
|
deleteFailed: "The page could not be deleted",
|
|
@@ -34,7 +36,11 @@ const DEFAULT_PAGES_PAGE_LABELS = {
|
|
|
34
36
|
text: "Text",
|
|
35
37
|
table: "Table",
|
|
36
38
|
document: "Document",
|
|
37
|
-
gallery: "Gallery"
|
|
39
|
+
gallery: "Gallery",
|
|
40
|
+
list: "Recent list",
|
|
41
|
+
carousel: "Carousel",
|
|
42
|
+
agenda: "Agenda",
|
|
43
|
+
start: "Start"
|
|
38
44
|
},
|
|
39
45
|
editBlock: "Edit the block",
|
|
40
46
|
removeBlock: "Remove the block",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/connection/pages/labels.ts"],
|
|
4
|
-
"sourcesContent": ["import type { PageBlockKind } from '@arbidocs/react'\n\n/** The words of `ConnectedPagesPage` (a host passes its own through `labels`). */\nexport interface PagesPageLabels {\n title: string\n description: string\n /** The list's two parts: the viewer's own pages, and the workspace's shared ones. */\n mine: string\n shared: string\n newPage: string\n blank: string\n untitled: string\n empty: string\n emptyDescription: string\n /** Nothing in one part of the list. */\n noneMine: string\n noneShared: string\n loadError: string\n /** Offline with no pages cached. */\n offline: string\n retry: string\n blocks: (count: number) => string\n back: string\n edit: string\n /** The \"\u2026\" menu of an open page (its rarer actions: delete). */\n more: string\n delete: string\n confirmDelete: (title: string) => string\n deleteFailed: string\n /** Leaving the editor with changes not saved. */\n confirmDiscard: string\n save: string\n saving: string\n cancel: string\n pageTitle: string\n pageDescription: string\n addBlock: string\n kinds: Record<PageBlockKind, string>\n editBlock: string\n removeBlock: string\n noBlocks: string\n saved: string\n saveFailed: string\n /** The one-way share button of an open page, and what it asks first. */\n share: string\n confirmShare: (title: string) => string\n sharedBadge: string\n privateBadge: string\n sharedDone: string\n shareFailed: string\n /** A dashboard from before pages, not yet saved into a workspace. */\n legacy: string\n /** The figure of a new page made from a database (\"Chart this\"): its rows. */\n rows: string\n /** Saved pages that could not be opened (sealed under another key, or damaged). */\n unreadable: (count: number) => string\n deleteUnreadable: string\n confirmDeleteUnreadable: (count: number) => string\n}\n\nexport const DEFAULT_PAGES_PAGE_LABELS: PagesPageLabels = {\n title: 'Pages',\n description:\n 'Charts, figures, notes and tables from your documents, threads, tags, facts, workflows, AI usage and databases.',\n mine: 'Mine',\n shared: 'Shared',\n newPage: 'New page',\n blank: 'Blank page',\n untitled: 'Untitled page',\n empty: 'No pages yet',\n emptyDescription:\n 'Start from a template or a blank page, then add charts, figures, text and tables.',\n noneMine: 'You have no pages of your own here.',\n noneShared: 'No page is shared with this workspace yet.',\n loadError: 'The pages could not be loaded.',\n offline: 'You are offline. Your pages show when the connection is back.',\n retry: 'Try again',\n blocks: (count) => `${count} ${count === 1 ? 'block' : 'blocks'}`,\n back: 'All pages',\n edit: 'Edit',\n more: 'More page actions',\n delete: 'Delete',\n confirmDelete: (title) => `Delete the page \u201C${title}\u201D? Its blocks go with it.`,\n deleteFailed: 'The page could not be deleted',\n confirmDiscard: 'Discard the changes to this page?',\n save: 'Save',\n saving: 'Saving\u2026',\n cancel: 'Cancel',\n pageTitle: 'Name',\n pageDescription: 'Description',\n addBlock: 'Add a block',\n kinds: {\n chart: 'Chart',\n metric: 'Figure',\n text: 'Text',\n table: 'Table',\n document: 'Document',\n gallery: 'Gallery',\n },\n editBlock: 'Edit the block',\n removeBlock: 'Remove the block',\n noBlocks: 'No blocks yet. Add one to start.',\n saved: 'Page saved',\n saveFailed: 'The page could not be saved',\n share: 'Share with the workspace',\n confirmShare: (title) =>\n `Share \u201C${title}\u201D with the workspace? Every member will see it. Sharing cannot be undone: once shared, only a workspace owner can delete it.`,\n sharedBadge: 'Shared with the workspace',\n privateBadge: 'Private',\n sharedDone: 'The page is shared with the workspace',\n shareFailed: 'The page could not be shared',\n legacy: 'A dashboard from before pages: saving it puts it in this workspace.',\n rows: 'Rows',\n unreadable: (count) => `${count} saved ${count === 1 ? 'page' : 'pages'} could not be opened.`,\n deleteUnreadable: 'Delete',\n confirmDeleteUnreadable: (count) =>\n `Delete the ${count === 1 ? 'page' : `${count} pages`} that could not be opened?`,\n}\n"],
|
|
5
|
-
"mappings": ";
|
|
4
|
+
"sourcesContent": ["import type { PageBlockKind } from '@arbidocs/react'\n\n/** The words of `ConnectedPagesPage` (a host passes its own through `labels`). */\nexport interface PagesPageLabels {\n title: string\n description: string\n /** The list's two parts: the viewer's own pages, and the workspace's shared ones. */\n mine: string\n shared: string\n newPage: string\n blank: string\n untitled: string\n empty: string\n emptyDescription: string\n /** Nothing in one part of the list. */\n noneMine: string\n noneShared: string\n loadError: string\n /** Offline with no pages cached. */\n offline: string\n retry: string\n blocks: (count: number) => string\n back: string\n edit: string\n /** The \"\u2026\" menu of an open page (its rarer actions: copy or move to a workspace, delete). */\n more: string\n copyToWorkspace: string\n moveToWorkspace: string\n delete: string\n confirmDelete: (title: string) => string\n deleteFailed: string\n /** Leaving the editor with changes not saved. */\n confirmDiscard: string\n save: string\n saving: string\n cancel: string\n pageTitle: string\n pageDescription: string\n addBlock: string\n kinds: Record<PageBlockKind, string>\n editBlock: string\n removeBlock: string\n noBlocks: string\n saved: string\n saveFailed: string\n /** The one-way share button of an open page, and what it asks first. */\n share: string\n confirmShare: (title: string) => string\n sharedBadge: string\n privateBadge: string\n sharedDone: string\n shareFailed: string\n /** A dashboard from before pages, not yet saved into a workspace. */\n legacy: string\n /** The figure of a new page made from a database (\"Chart this\"): its rows. */\n rows: string\n /** Saved pages that could not be opened (sealed under another key, or damaged). */\n unreadable: (count: number) => string\n deleteUnreadable: string\n confirmDeleteUnreadable: (count: number) => string\n}\n\nexport const DEFAULT_PAGES_PAGE_LABELS: PagesPageLabels = {\n title: 'Pages',\n description:\n 'Charts, figures, notes and tables from your documents, threads, tags, facts, workflows, AI usage and databases.',\n mine: 'Mine',\n shared: 'Shared',\n newPage: 'New page',\n blank: 'Blank page',\n untitled: 'Untitled page',\n empty: 'No pages yet',\n emptyDescription:\n 'Start from a template or a blank page, then add charts, figures, text and tables.',\n noneMine: 'You have no pages of your own here.',\n noneShared: 'No page is shared with this workspace yet.',\n loadError: 'The pages could not be loaded.',\n offline: 'You are offline. Your pages show when the connection is back.',\n retry: 'Try again',\n blocks: (count) => `${count} ${count === 1 ? 'block' : 'blocks'}`,\n back: 'All pages',\n edit: 'Edit',\n more: 'More page actions',\n copyToWorkspace: 'Copy to workspace\u2026',\n moveToWorkspace: 'Move to workspace\u2026',\n delete: 'Delete',\n confirmDelete: (title) => `Delete the page \u201C${title}\u201D? Its blocks go with it.`,\n deleteFailed: 'The page could not be deleted',\n confirmDiscard: 'Discard the changes to this page?',\n save: 'Save',\n saving: 'Saving\u2026',\n cancel: 'Cancel',\n pageTitle: 'Name',\n pageDescription: 'Description',\n addBlock: 'Add a block',\n kinds: {\n chart: 'Chart',\n metric: 'Figure',\n text: 'Text',\n table: 'Table',\n document: 'Document',\n gallery: 'Gallery',\n list: 'Recent list',\n carousel: 'Carousel',\n agenda: 'Agenda',\n start: 'Start',\n },\n editBlock: 'Edit the block',\n removeBlock: 'Remove the block',\n noBlocks: 'No blocks yet. Add one to start.',\n saved: 'Page saved',\n saveFailed: 'The page could not be saved',\n share: 'Share with the workspace',\n confirmShare: (title) =>\n `Share \u201C${title}\u201D with the workspace? Every member will see it. Sharing cannot be undone: once shared, only a workspace owner can delete it.`,\n sharedBadge: 'Shared with the workspace',\n privateBadge: 'Private',\n sharedDone: 'The page is shared with the workspace',\n shareFailed: 'The page could not be shared',\n legacy: 'A dashboard from before pages: saving it puts it in this workspace.',\n rows: 'Rows',\n unreadable: (count) => `${count} saved ${count === 1 ? 'page' : 'pages'} could not be opened.`,\n deleteUnreadable: 'Delete',\n confirmDeleteUnreadable: (count) =>\n `Delete the ${count === 1 ? 'page' : `${count} pages`} that could not be opened?`,\n}\n"],
|
|
5
|
+
"mappings": ";AA8DO,MAAM,4BAA6C;AAAA,EACxD,OAAO;AAAA,EACP,aACE;AAAA,EACF,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,OAAO;AAAA,EACP,UAAU;AAAA,EACV,OAAO;AAAA,EACP,kBACE;AAAA,EACF,UAAU;AAAA,EACV,YAAY;AAAA,EACZ,WAAW;AAAA,EACX,SAAS;AAAA,EACT,OAAO;AAAA,EACP,QAAQ,CAAC,UAAU,GAAG,KAAK,IAAI,UAAU,IAAI,UAAU,QAAQ;AAAA,EAC/D,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AAAA,EACN,iBAAiB;AAAA,EACjB,iBAAiB;AAAA,EACjB,QAAQ;AAAA,EACR,eAAe,CAAC,UAAU,yBAAoB,KAAK;AAAA,EACnD,cAAc;AAAA,EACd,gBAAgB;AAAA,EAChB,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,WAAW;AAAA,EACX,iBAAiB;AAAA,EACjB,UAAU;AAAA,EACV,OAAO;AAAA,IACL,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,MAAM;AAAA,IACN,OAAO;AAAA,IACP,UAAU;AAAA,IACV,SAAS;AAAA,IACT,MAAM;AAAA,IACN,UAAU;AAAA,IACV,QAAQ;AAAA,IACR,OAAO;AAAA,EACT;AAAA,EACA,WAAW;AAAA,EACX,aAAa;AAAA,EACb,UAAU;AAAA,EACV,OAAO;AA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