@arbidocs/blocks 0.5.154 → 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.
Files changed (78) hide show
  1. package/dist/ConnectedNativeDocxComparison-2DAQX5GX.cjs +2 -2
  2. package/dist/ConnectedStreamedWordArtifact-LTYB62VM.cjs +2 -2
  3. package/dist/{DocumentReviewCard-ILDLYZ5A.cjs → DocumentReviewCard-5AP55NGZ.cjs} +13 -14
  4. package/dist/DocumentReviewCard-5AP55NGZ.cjs.map +1 -0
  5. package/dist/{FilesViewerDialog-YLD5YFP2.cjs → FilesViewerDialog-SHWCE3UN.cjs} +12 -13
  6. package/dist/FilesViewerDialog-SHWCE3UN.cjs.map +1 -0
  7. package/dist/{WorkspaceTableView-V3N64LJG.cjs → WorkspaceTableView-S4IBYQVF.cjs} +3 -3
  8. package/dist/{WorkspaceTableView-V3N64LJG.cjs.map → WorkspaceTableView-S4IBYQVF.cjs.map} +1 -1
  9. package/dist/agents/index.cjs +163 -163
  10. package/dist/{chunk-I3XTTTPZ.cjs → chunk-2XOIULVN.cjs} +24 -24
  11. package/dist/{chunk-I3XTTTPZ.cjs.map → chunk-2XOIULVN.cjs.map} +1 -1
  12. package/dist/{chunk-ZW2ZFC3Q.cjs → chunk-3SGFIDID.cjs} +51 -51
  13. package/dist/{chunk-ZW2ZFC3Q.cjs.map → chunk-3SGFIDID.cjs.map} +1 -1
  14. package/dist/{chunk-CNBYM5Q7.cjs → chunk-4UDGCXUR.cjs} +5 -5
  15. package/dist/{chunk-CNBYM5Q7.cjs.map → chunk-4UDGCXUR.cjs.map} +1 -1
  16. package/dist/{chunk-T7BUGVSG.cjs → chunk-4XNP27N4.cjs} +36 -36
  17. package/dist/{chunk-T7BUGVSG.cjs.map → chunk-4XNP27N4.cjs.map} +1 -1
  18. package/dist/{chunk-YXY52OGU.cjs → chunk-6ZZWQ3OL.cjs} +4 -4
  19. package/dist/{chunk-YXY52OGU.cjs.map → chunk-6ZZWQ3OL.cjs.map} +1 -1
  20. package/dist/{chunk-FEAHTNTY.cjs → chunk-74RUAGVD.cjs} +91 -5
  21. package/dist/chunk-74RUAGVD.cjs.map +1 -0
  22. package/dist/{chunk-AURL2KT5.cjs → chunk-B5BGVPQ5.cjs} +4 -4
  23. package/dist/{chunk-AURL2KT5.cjs.map → chunk-B5BGVPQ5.cjs.map} +1 -1
  24. package/dist/{chunk-NRGLF4J4.cjs → chunk-JCFXS336.cjs} +466 -2
  25. package/dist/chunk-JCFXS336.cjs.map +1 -0
  26. package/dist/{chunk-6GKCGCMT.cjs → chunk-MAKCWF45.cjs} +4 -4
  27. package/dist/{chunk-6GKCGCMT.cjs.map → chunk-MAKCWF45.cjs.map} +1 -1
  28. package/dist/{chunk-O7U6KL2W.cjs → chunk-OZJENXU3.cjs} +4 -4
  29. package/dist/{chunk-O7U6KL2W.cjs.map → chunk-OZJENXU3.cjs.map} +1 -1
  30. package/dist/{chunk-GYI4UXX6.cjs → chunk-QEH375MU.cjs} +4 -4
  31. package/dist/{chunk-GYI4UXX6.cjs.map → chunk-QEH375MU.cjs.map} +1 -1
  32. package/dist/{chunk-OOANNOH4.cjs → chunk-Y2Z5UHHV.cjs} +9 -9
  33. package/dist/{chunk-OOANNOH4.cjs.map → chunk-Y2Z5UHHV.cjs.map} +1 -1
  34. package/dist/{chunk-BNDIMTWJ.cjs → chunk-ZCQXQIBA.cjs} +28 -28
  35. package/dist/{chunk-BNDIMTWJ.cjs.map → chunk-ZCQXQIBA.cjs.map} +1 -1
  36. package/dist/connect/docx.cjs +2 -2
  37. package/dist/connect/index.cjs +665 -715
  38. package/dist/connect/index.cjs.map +1 -1
  39. package/dist/connect/viewer.cjs +10 -11
  40. package/dist/connection/export/ConnectedExportPanel.js +19 -78
  41. package/dist/connection/export/ConnectedExportPanel.js.map +2 -2
  42. package/dist/connection/export/transfer-targets.d.ts +66 -0
  43. package/dist/connection/export/transfer-targets.js +93 -0
  44. package/dist/connection/export/transfer-targets.js.map +7 -0
  45. package/dist/connection/export/transfer-text.js +5 -0
  46. package/dist/connection/export/transfer-text.js.map +2 -2
  47. package/dist/connection/pages/ConnectedPagesPage.d.ts +4 -1
  48. package/dist/connection/pages/ConnectedPagesPage.js +22 -2
  49. package/dist/connection/pages/ConnectedPagesPage.js.map +2 -2
  50. package/dist/connection/pages/PageTransferDialog.d.ts +38 -0
  51. package/dist/connection/pages/PageTransferDialog.js +219 -0
  52. package/dist/connection/pages/PageTransferDialog.js.map +7 -0
  53. package/dist/connection/pages/PageView.d.ts +6 -2
  54. package/dist/connection/pages/PageView.js +40 -15
  55. package/dist/connection/pages/PageView.js.map +2 -2
  56. package/dist/connection/pages/index.d.ts +1 -0
  57. package/dist/connection/pages/index.js +6 -0
  58. package/dist/connection/pages/index.js.map +2 -2
  59. package/dist/connection/pages/labels.d.ts +3 -1
  60. package/dist/connection/pages/labels.js +2 -0
  61. package/dist/connection/pages/labels.js.map +2 -2
  62. package/dist/embed/index.cjs +15 -16
  63. package/dist/files/index.cjs +249 -250
  64. package/dist/index.cjs +228 -228
  65. package/dist/pages/index.cjs +253 -25
  66. package/dist/pages/index.cjs.map +1 -1
  67. package/dist/settings/index.cjs +9 -9
  68. package/dist/shell/index.cjs +1 -1
  69. package/dist/workflow-canvas/index.cjs +22 -23
  70. package/dist/workflow-canvas/index.cjs.map +1 -1
  71. package/node_modules/@arbidocs/coedit/package.json +1 -1
  72. package/package.json +5 -5
  73. package/dist/DocumentReviewCard-ILDLYZ5A.cjs.map +0 -1
  74. package/dist/FilesViewerDialog-YLD5YFP2.cjs.map +0 -1
  75. package/dist/chunk-FEAHTNTY.cjs.map +0 -1
  76. package/dist/chunk-NRGLF4J4.cjs.map +0 -1
  77. package/dist/chunk-T3Y3LZ4Y.cjs +0 -477
  78. package/dist/chunk-T3Y3LZ4Y.cjs.map +0 -1
@@ -2,7 +2,7 @@
2
2
  'use strict';
3
3
 
4
4
  var chunkK5F2VNCX_cjs = require('../chunk-K5F2VNCX.cjs');
5
- var chunkFEAHTNTY_cjs = require('../chunk-FEAHTNTY.cjs');
5
+ var chunk74RUAGVD_cjs = require('../chunk-74RUAGVD.cjs');
6
6
  require('../chunk-DWRUGOTQ.cjs');
7
7
  require('../chunk-KD66CBYO.cjs');
8
8
  require('../chunk-7UPEFZCV.cjs');
@@ -10,7 +10,9 @@ require('../chunk-V27WLYTG.cjs');
10
10
  require('../chunk-SGYURQ23.cjs');
11
11
  var chunkDLGYR4JL_cjs = require('../chunk-DLGYR4JL.cjs');
12
12
  require('../chunk-JWCVA4LC.cjs');
13
- require('../chunk-T3Y3LZ4Y.cjs');
13
+ var chunkJCFXS336_cjs = require('../chunk-JCFXS336.cjs');
14
+ require('../chunk-223D4727.cjs');
15
+ require('../chunk-SNUBQMIS.cjs');
14
16
  require('../chunk-5GBM7BQB.cjs');
15
17
  require('../chunk-UD3LPATQ.cjs');
16
18
  var chunk6I5HHWCD_cjs = require('../chunk-6I5HHWCD.cjs');
@@ -19,17 +21,25 @@ var chunkGK3U3FWY_cjs = require('../chunk-GK3U3FWY.cjs');
19
21
  require('../chunk-PBPO54KZ.cjs');
20
22
  var chunkQ25CZLK6_cjs = require('../chunk-Q25CZLK6.cjs');
21
23
  var chunkMWHVETKN_cjs = require('../chunk-MWHVETKN.cjs');
24
+ require('../chunk-DTMBAFIL.cjs');
22
25
  var chunkNSD37OF5_cjs = require('../chunk-NSD37OF5.cjs');
23
26
  require('../chunk-7G2LJMUG.cjs');
24
27
  require('../chunk-WRTEKOQP.cjs');
28
+ require('../chunk-SK6HQ46Q.cjs');
29
+ require('../chunk-WCT6FT2K.cjs');
25
30
  require('../chunk-2P7VH2SK.cjs');
26
31
  require('../chunk-ZU2B2RZK.cjs');
27
32
  require('../chunk-BH322H5B.cjs');
28
33
  require('../chunk-M55XUF4L.cjs');
29
34
  require('../chunk-EVZH6Z5O.cjs');
35
+ require('../chunk-S237ORM3.cjs');
36
+ require('../chunk-II2OEXHW.cjs');
30
37
  require('../chunk-G3MRW4WB.cjs');
31
38
  require('../chunk-AHDJXIUB.cjs');
39
+ require('../chunk-RL2HI6NP.cjs');
40
+ require('../chunk-6UZC4XVV.cjs');
32
41
  require('../chunk-SLCH5JRI.cjs');
42
+ require('../chunk-DKY67DA6.cjs');
33
43
  require('../chunk-YA6GXWC2.cjs');
34
44
  require('../chunk-ZVEW3JBT.cjs');
35
45
  var chunkMHIG6GGS_cjs = require('../chunk-MHIG6GGS.cjs');
@@ -64,7 +74,7 @@ var documentTools = require('@arbidocs/react/document-tools');
64
74
  var viewers = require('@arbidocs/react/viewers');
65
75
 
66
76
  var PAGE_TEMPLATES = [
67
- chunkFEAHTNTY_cjs.WORKSPACE_DASHBOARD_PAGE,
77
+ chunk74RUAGVD_cjs.WORKSPACE_DASHBOARD_PAGE,
68
78
  ...chunkYSAUOJA7_cjs.DASHBOARD_TEMPLATES
69
79
  ];
70
80
  function pageOfTemplate(template) {
@@ -1220,7 +1230,7 @@ function WithNewFileMenu({ children }) {
1220
1230
  const [open, setOpen] = react$1.useState(false);
1221
1231
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1222
1232
  children(() => setOpen(true)),
1223
- /* @__PURE__ */ jsxRuntime.jsx(chunkFEAHTNTY_cjs.ConnectedNewFileMenu, { open, onOpenChange: setOpen })
1233
+ /* @__PURE__ */ jsxRuntime.jsx(chunk74RUAGVD_cjs.ConnectedNewFileMenu, { open, onOpenChange: setOpen })
1224
1234
  ] });
1225
1235
  }
1226
1236
  function PageBlockView({
@@ -1301,18 +1311,18 @@ function PageBlockView({
1301
1311
  ) });
1302
1312
  case "list":
1303
1313
  return /* @__PURE__ */ jsxRuntime.jsx(LiveBlockCard, { actions, className, testId, children: block.config.source === "documents" ? /* @__PURE__ */ jsxRuntime.jsx(WithNewFileMenu, { children: (onCreateNew) => /* @__PURE__ */ jsxRuntime.jsx(
1304
- chunkFEAHTNTY_cjs.ConnectedListBlock,
1314
+ chunk74RUAGVD_cjs.ConnectedListBlock,
1305
1315
  {
1306
1316
  config: block.config,
1307
1317
  onCreateNew,
1308
1318
  testId: testId && `${testId}-list`
1309
1319
  }
1310
- ) }) : /* @__PURE__ */ jsxRuntime.jsx(chunkFEAHTNTY_cjs.ConnectedListBlock, { config: block.config, testId: testId && `${testId}-list` }) });
1320
+ ) }) : /* @__PURE__ */ jsxRuntime.jsx(chunk74RUAGVD_cjs.ConnectedListBlock, { config: block.config, testId: testId && `${testId}-list` }) });
1311
1321
  case "carousel":
1312
- return /* @__PURE__ */ jsxRuntime.jsx(LiveBlockCard, { actions, className, testId, children: /* @__PURE__ */ jsxRuntime.jsx(chunkFEAHTNTY_cjs.ConnectedCarouselBlock, { config: block.config, testId: testId && `${testId}-carousel` }) });
1322
+ return /* @__PURE__ */ jsxRuntime.jsx(LiveBlockCard, { actions, className, testId, children: /* @__PURE__ */ jsxRuntime.jsx(chunk74RUAGVD_cjs.ConnectedCarouselBlock, { config: block.config, testId: testId && `${testId}-carousel` }) });
1313
1323
  case "agenda":
1314
1324
  return /* @__PURE__ */ jsxRuntime.jsx(LiveBlockCard, { actions, className, testId, children: /* @__PURE__ */ jsxRuntime.jsx(
1315
- chunkFEAHTNTY_cjs.ConnectedAgendaBlock,
1325
+ chunk74RUAGVD_cjs.ConnectedAgendaBlock,
1316
1326
  {
1317
1327
  config: block.config,
1318
1328
  className: "border-0 p-0",
@@ -1320,7 +1330,7 @@ function PageBlockView({
1320
1330
  }
1321
1331
  ) });
1322
1332
  case "start":
1323
- return /* @__PURE__ */ jsxRuntime.jsx(LiveBlockCard, { actions, className, testId, children: /* @__PURE__ */ jsxRuntime.jsx(WithNewFileMenu, { children: (onCreateNew) => /* @__PURE__ */ jsxRuntime.jsx(chunkFEAHTNTY_cjs.ConnectedStartBlock, { onCreateNew }) }) });
1333
+ return /* @__PURE__ */ jsxRuntime.jsx(LiveBlockCard, { actions, className, testId, children: /* @__PURE__ */ jsxRuntime.jsx(WithNewFileMenu, { children: (onCreateNew) => /* @__PURE__ */ jsxRuntime.jsx(chunk74RUAGVD_cjs.ConnectedStartBlock, { onCreateNew }) }) });
1324
1334
  }
1325
1335
  }
1326
1336
  function NewPageButton({
@@ -1455,6 +1465,8 @@ function PageView({
1455
1465
  onEdit,
1456
1466
  onShare,
1457
1467
  onDelete,
1468
+ onCopy,
1469
+ onMove,
1458
1470
  children,
1459
1471
  testId
1460
1472
  }) {
@@ -1489,7 +1501,7 @@ function PageView({
1489
1501
  " ",
1490
1502
  l.edit
1491
1503
  ] }),
1492
- canDelete && /* @__PURE__ */ jsxRuntime.jsxs(ui.DropdownMenu, { children: [
1504
+ (canDelete || onCopy) && /* @__PURE__ */ jsxRuntime.jsxs(ui.DropdownMenu, { children: [
1493
1505
  /* @__PURE__ */ jsxRuntime.jsx(ui.DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
1494
1506
  ui.Button,
1495
1507
  {
@@ -1500,19 +1512,32 @@ function PageView({
1500
1512
  children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.MoreHorizontal, { className: "size-4" })
1501
1513
  }
1502
1514
  ) }),
1503
- /* @__PURE__ */ jsxRuntime.jsx(ui.DropdownMenuContent, { align: "end", children: /* @__PURE__ */ jsxRuntime.jsxs(
1504
- ui.DropdownMenuItem,
1505
- {
1506
- onSelect: onDelete,
1507
- className: "text-destructive focus:text-destructive",
1508
- "data-testid": `${testId}-delete`,
1509
- children: [
1510
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Trash2, { className: "size-4" }),
1511
- " ",
1512
- l.delete
1513
- ]
1514
- }
1515
- ) })
1515
+ /* @__PURE__ */ jsxRuntime.jsxs(ui.DropdownMenuContent, { align: "end", children: [
1516
+ onCopy && /* @__PURE__ */ jsxRuntime.jsxs(ui.DropdownMenuItem, { onSelect: onCopy, "data-testid": `${testId}-copy-to`, children: [
1517
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Copy, { className: "size-4" }),
1518
+ " ",
1519
+ l.copyToWorkspace
1520
+ ] }),
1521
+ onCopy && onMove && canDelete && /* @__PURE__ */ jsxRuntime.jsxs(ui.DropdownMenuItem, { onSelect: onMove, "data-testid": `${testId}-move-to`, children: [
1522
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ArrowRightLeft, { className: "size-4" }),
1523
+ " ",
1524
+ l.moveToWorkspace
1525
+ ] }),
1526
+ onCopy && canDelete && /* @__PURE__ */ jsxRuntime.jsx(ui.DropdownMenuSeparator, {}),
1527
+ canDelete && /* @__PURE__ */ jsxRuntime.jsxs(
1528
+ ui.DropdownMenuItem,
1529
+ {
1530
+ onSelect: onDelete,
1531
+ className: "text-destructive focus:text-destructive",
1532
+ "data-testid": `${testId}-delete`,
1533
+ children: [
1534
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Trash2, { className: "size-4" }),
1535
+ " ",
1536
+ l.delete
1537
+ ]
1538
+ }
1539
+ )
1540
+ ] })
1516
1541
  ] })
1517
1542
  ] })
1518
1543
  }
@@ -1521,6 +1546,188 @@ function PageView({
1521
1546
  children
1522
1547
  ] });
1523
1548
  }
1549
+ var DEFAULT_PAGE_TRANSFER_LABELS = {
1550
+ title: (mode, title) => `${mode === "move" ? "Move" : "Copy"} \u201C${title}\u201D to a workspace`,
1551
+ description: (mode) => mode === "move" ? "The page goes to the workspace you pick, private to you, and is deleted here." : "A copy goes to the workspace you pick, private to you. This page stays as it is.",
1552
+ documents: "Documents on this page",
1553
+ documentsHelp: (documents) => `It shows ${documents === 1 ? "a document" : `${documents} documents`} of this workspace.`,
1554
+ documentsLink: "Leave them here \u2014 the copy keeps showing them to whoever can open them in this workspace",
1555
+ documentsInclude: "Copy them too \u2014 the copy shows the copies",
1556
+ viewsStay: (views) => `Its ${views === 1 ? "table view stays" : `${views} table views stay`} here: there, ${views === 1 ? "its block reads" : "their blocks read"} \u201Cnot available\u201D to anyone who cannot open ${views === 1 ? "it" : "them"} here.`,
1557
+ notRemovable: "You may not delete this page here, so it would be copied and stay here too.",
1558
+ cancel: "Cancel",
1559
+ submit: (mode) => mode === "move" ? "Move" : "Copy",
1560
+ starting: "Starting\u2026",
1561
+ progress: (mode, target) => `${mode === "move" ? "Moving" : "Copying"} to ${target}`,
1562
+ phase: {
1563
+ copy: "Copying",
1564
+ link: "Linking",
1565
+ remove: "Removing from this workspace",
1566
+ done: "Done"
1567
+ },
1568
+ done: (mode, target) => `${mode === "move" ? "Moved" : "Copied"} to ${target}.`,
1569
+ kept: (target) => `Copied to ${target}. It also stays here:`,
1570
+ failed: (mode, target) => `The page could not be ${mode === "move" ? "moved" : "copied"} to ${target}.`,
1571
+ open: "Open",
1572
+ close: "Close",
1573
+ startFailed: "The transfer could not start"
1574
+ };
1575
+ function PageTransferDialog(props) {
1576
+ if (!props.page) return null;
1577
+ return /* @__PURE__ */ jsxRuntime.jsx(OpenPageTransferDialog, { ...props, page: props.page });
1578
+ }
1579
+ function OpenPageTransferDialog({
1580
+ page,
1581
+ mode,
1582
+ onClose,
1583
+ onOpenCopy,
1584
+ labels,
1585
+ testId = "page-transfer"
1586
+ }) {
1587
+ const l = { ...DEFAULT_PAGE_TRANSFER_LABELS, ...labels };
1588
+ const { notify } = chunk46LX6EQT_cjs.useBlocksEnvironment();
1589
+ const { options, nameOf } = chunk74RUAGVD_cjs.useTransferTargets();
1590
+ const trackTransfer = chunk74RUAGVD_cjs.useExportStore((state) => state.trackTransfer);
1591
+ const [targetId, setTargetId] = react$1.useState(null);
1592
+ const [references, setReferences] = react$1.useState("link");
1593
+ const [jobId, setJobId] = react$1.useState(null);
1594
+ const [opening, setOpening] = react$1.useState(false);
1595
+ const scope = react$1.useMemo(() => react.pageTransferScope(page.id, references), [page.id, references]);
1596
+ const { data: plan } = react.usePlanWorkspaceTransfer(scope, mode, { enabled: !jobId });
1597
+ const start = react.useStartWorkspaceTransfer();
1598
+ const cancel = react.useCancelWorkspaceTransfer();
1599
+ const switchToPages = react.useSwitchToWorkspacePages();
1600
+ const { data: job } = react.useWorkspaceTransfer(jobId);
1601
+ const finished = !!jobId && react.isTransferFinished(job);
1602
+ const { data: items } = react.useWorkspaceTransferItems(jobId, { enabled: finished });
1603
+ const target = nameOf(job?.target_workspace_ext_id ?? targetId);
1604
+ const documents = page.documentIds.length;
1605
+ const views = page.viewIds.length;
1606
+ const copyId = react.transferredId(items, page.id);
1607
+ const pageItem = items?.find((i) => i.source_ext_id === page.id);
1608
+ const submit = async () => {
1609
+ if (!targetId) return;
1610
+ try {
1611
+ const started = await start.mutateAsync({
1612
+ scope,
1613
+ mode,
1614
+ targetWorkspaceId: targetId,
1615
+ // What the person asked for arrives: a same-titled page there is kept, the copy renamed "(2)".
1616
+ onConflict: "keep_both"
1617
+ });
1618
+ setJobId(started.external_id);
1619
+ trackTransfer(started.external_id);
1620
+ } catch (error) {
1621
+ const detail = error?.detail;
1622
+ notify(typeof detail === "string" ? detail : l.startFailed, "error");
1623
+ }
1624
+ };
1625
+ const openCopy = async () => {
1626
+ const workspaceId = job?.target_workspace_ext_id;
1627
+ if (!copyId || !workspaceId) return;
1628
+ setOpening(true);
1629
+ try {
1630
+ if (await switchToPages({ id: workspaceId, name: target })) onOpenCopy(copyId);
1631
+ onClose();
1632
+ } finally {
1633
+ setOpening(false);
1634
+ }
1635
+ };
1636
+ let body;
1637
+ let footer;
1638
+ if (!jobId) {
1639
+ body = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
1640
+ /* @__PURE__ */ jsxRuntime.jsx(
1641
+ chunkJCFXS336_cjs.ExportWorkspacePicker,
1642
+ {
1643
+ workspaces: options,
1644
+ selectedId: targetId,
1645
+ onSelect: setTargetId,
1646
+ testId: (id) => `${testId}-workspace-${id}`
1647
+ }
1648
+ ),
1649
+ documents > 0 && /* @__PURE__ */ jsxRuntime.jsx(
1650
+ chunkJCFXS336_cjs.TransferReferencesChooser,
1651
+ {
1652
+ value: references,
1653
+ onChange: setReferences,
1654
+ labels: {
1655
+ references: l.documents,
1656
+ referencesHelp: l.documentsHelp(documents),
1657
+ referencesInclude: l.documentsInclude,
1658
+ referencesLink: l.documentsLink
1659
+ }
1660
+ }
1661
+ ),
1662
+ views > 0 && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "pt-2 text-sm text-muted-foreground", "data-testid": `${testId}-views`, children: l.viewsStay(views) }),
1663
+ mode === "move" && !!plan?.not_removable && /* @__PURE__ */ jsxRuntime.jsxs(
1664
+ "p",
1665
+ {
1666
+ className: "flex items-start gap-2 pt-2 text-sm",
1667
+ "data-testid": `${testId}-not-removable`,
1668
+ children: [
1669
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.AlertTriangle, { className: "mt-0.5 size-4 shrink-0 text-yellow-text" }),
1670
+ l.notRemovable
1671
+ ]
1672
+ }
1673
+ )
1674
+ ] });
1675
+ footer = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1676
+ /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { variant: "outline", onClick: onClose, "data-testid": `${testId}-cancel`, children: l.cancel }),
1677
+ /* @__PURE__ */ jsxRuntime.jsx(
1678
+ ui.Button,
1679
+ {
1680
+ onClick: () => void submit(),
1681
+ disabled: !targetId || start.isPending,
1682
+ "data-testid": `${testId}-submit`,
1683
+ children: start.isPending ? l.starting : l.submit(mode)
1684
+ }
1685
+ )
1686
+ ] });
1687
+ } else if (!finished || !items) {
1688
+ body = job ? /* @__PURE__ */ jsxRuntime.jsx(
1689
+ chunkJCFXS336_cjs.TransferProgressView,
1690
+ {
1691
+ title: l.progress(mode, target),
1692
+ processed: job.processed ?? 0,
1693
+ total: job.total ?? 0,
1694
+ phaseLabel: l.phase[job.phase] ?? job.phase,
1695
+ onHide: finished ? void 0 : onClose,
1696
+ onCancel: finished ? void 0 : () => cancel.mutate(job.external_id),
1697
+ isCancelling: cancel.isPending
1698
+ }
1699
+ ) : /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "flex items-center gap-2 text-sm text-muted-foreground", children: [
1700
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2, { className: "size-4 animate-spin" }),
1701
+ " ",
1702
+ l.progress(mode, target)
1703
+ ] });
1704
+ } else {
1705
+ const kept = mode === "move" && pageItem?.status === "kept";
1706
+ const failed = !copyId;
1707
+ const Icon = failed ? lucideReact.XCircle : kept ? lucideReact.AlertTriangle : lucideReact.CheckCircle2;
1708
+ const tone = failed ? "text-red-text" : kept ? "text-yellow-text" : "text-green-text";
1709
+ const detail = failed ? pageItem?.message ?? job?.error : pageItem?.message;
1710
+ body = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start gap-3 pt-2", "data-testid": `${testId}-result`, children: [
1711
+ /* @__PURE__ */ jsxRuntime.jsx(Icon, { className: `mt-0.5 size-5 shrink-0 ${tone}` }),
1712
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0 space-y-1 text-sm", children: [
1713
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "font-medium", children: failed ? l.failed(mode, target) : kept ? l.kept(target) : l.done(mode, target) }),
1714
+ detail && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "break-words text-muted-foreground", children: detail })
1715
+ ] })
1716
+ ] });
1717
+ footer = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1718
+ /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { variant: "outline", onClick: onClose, "data-testid": `${testId}-close`, children: l.close }),
1719
+ copyId && /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { onClick: () => void openCopy(), disabled: opening, "data-testid": `${testId}-open`, children: l.open })
1720
+ ] });
1721
+ }
1722
+ return /* @__PURE__ */ jsxRuntime.jsx(ui.Dialog, { open: true, onOpenChange: (open) => !open && onClose(), children: /* @__PURE__ */ jsxRuntime.jsxs(ui.DialogContent, { className: "max-h-[90dvh] max-w-lg overflow-y-auto", "data-testid": testId, children: [
1723
+ /* @__PURE__ */ jsxRuntime.jsxs(ui.DialogHeader, { children: [
1724
+ /* @__PURE__ */ jsxRuntime.jsx(ui.DialogTitle, { children: l.title(mode, page.spec.title) }),
1725
+ /* @__PURE__ */ jsxRuntime.jsx(ui.DialogDescription, { children: l.description(mode) })
1726
+ ] }),
1727
+ body,
1728
+ footer && /* @__PURE__ */ jsxRuntime.jsx(ui.DialogFooter, { children: footer })
1729
+ ] }) });
1730
+ }
1524
1731
 
1525
1732
  // src/connection/pages/labels.ts
1526
1733
  var DEFAULT_PAGES_PAGE_LABELS = {
@@ -1542,6 +1749,8 @@ var DEFAULT_PAGES_PAGE_LABELS = {
1542
1749
  back: "All pages",
1543
1750
  edit: "Edit",
1544
1751
  more: "More page actions",
1752
+ copyToWorkspace: "Copy to workspace\u2026",
1753
+ moveToWorkspace: "Move to workspace\u2026",
1545
1754
  delete: "Delete",
1546
1755
  confirmDelete: (title) => `Delete the page \u201C${title}\u201D? Its blocks go with it.`,
1547
1756
  deleteFailed: "The page could not be deleted",
@@ -1647,6 +1856,7 @@ function ConnectedPagesPage({
1647
1856
  gridLabels,
1648
1857
  tableLabels,
1649
1858
  pickerLabels,
1859
+ transferLabels,
1650
1860
  className,
1651
1861
  testId = "pages"
1652
1862
  }) {
@@ -1675,6 +1885,7 @@ function ConnectedPagesPage({
1675
1885
  openIdRef.current = openId;
1676
1886
  }, [openId]);
1677
1887
  const [editing, setEditing] = react$1.useState(null);
1888
+ const [transfer, setTransfer] = react$1.useState(null);
1678
1889
  const open = react$1.useMemo(
1679
1890
  () => pages.data?.find((p) => p.id === openId && !p.unreadable),
1680
1891
  [pages.data, openId]
@@ -1931,6 +2142,8 @@ function ConnectedPagesPage({
1931
2142
  onEdit: () => startEditing(open),
1932
2143
  onShare: () => void sharePage(open),
1933
2144
  onDelete: () => void deletePage(open),
2145
+ onCopy: open.legacy ? void 0 : () => setTransfer({ page: open, mode: "copy" }),
2146
+ onMove: open.legacy ? void 0 : () => setTransfer({ page: open, mode: "move" }),
1934
2147
  testId,
1935
2148
  children: open.spec.blocks.length > 0 && (canArrange(open) ? (
1936
2149
  // Who may change the page arranges it as it is read: a drop saves at once.
@@ -1995,12 +2208,25 @@ function ConnectedPagesPage({
1995
2208
  }
1996
2209
  );
1997
2210
  }
1998
- return /* @__PURE__ */ jsxRuntime.jsx(
2211
+ return /* @__PURE__ */ jsxRuntime.jsxs(
1999
2212
  "div",
2000
2213
  {
2001
2214
  className: ui.cn("h-full min-h-0 w-full overflow-y-auto p-4 sm:p-6", className),
2002
2215
  "data-testid": testId,
2003
- children: content
2216
+ children: [
2217
+ content,
2218
+ /* @__PURE__ */ jsxRuntime.jsx(
2219
+ PageTransferDialog,
2220
+ {
2221
+ page: transfer?.page ?? null,
2222
+ mode: transfer?.mode ?? "copy",
2223
+ onClose: () => setTransfer(null),
2224
+ onOpenCopy: setOpenId,
2225
+ labels: transferLabels,
2226
+ testId: `${testId}-transfer`
2227
+ }
2228
+ )
2229
+ ]
2004
2230
  }
2005
2231
  );
2006
2232
  }
@@ -2014,6 +2240,7 @@ exports.DEFAULT_DOCUMENT_BLOCK_LABELS = DEFAULT_DOCUMENT_BLOCK_LABELS;
2014
2240
  exports.DEFAULT_EDITABLE_PAGE_GRID_LABELS = DEFAULT_EDITABLE_PAGE_GRID_LABELS;
2015
2241
  exports.DEFAULT_LIVE_BLOCK_EDITOR_LABELS = DEFAULT_LIVE_BLOCK_EDITOR_LABELS;
2016
2242
  exports.DEFAULT_PAGES_PAGE_LABELS = DEFAULT_PAGES_PAGE_LABELS;
2243
+ exports.DEFAULT_PAGE_TRANSFER_LABELS = DEFAULT_PAGE_TRANSFER_LABELS;
2017
2244
  exports.DEFAULT_TABLE_VIEW_BLOCK_LABELS = DEFAULT_TABLE_VIEW_BLOCK_LABELS;
2018
2245
  exports.DEFAULT_VIEW_PICKER_LABELS = DEFAULT_VIEW_PICKER_LABELS;
2019
2246
  exports.DocumentBlockView = DocumentBlockView;
@@ -2029,6 +2256,7 @@ exports.PAGE_TEMPLATES = PAGE_TEMPLATES;
2029
2256
  exports.PageBlockView = PageBlockView;
2030
2257
  exports.PageCell = PageCell;
2031
2258
  exports.PageGrid = PageGrid;
2259
+ exports.PageTransferDialog = PageTransferDialog;
2032
2260
  exports.SLOTS_ACROSS = SLOTS_ACROSS;
2033
2261
  exports.SLOT_COLUMNS = SLOT_COLUMNS;
2034
2262
  exports.SLOT_ROWS = SLOT_ROWS;