@arbidocs/blocks 0.5.187 → 0.5.189

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 (84) hide show
  1. package/dist/{ConnectedCallDock-PZJRO54J.cjs → ConnectedCallDock-7GGYYQNK.cjs} +8 -8
  2. package/dist/{ConnectedCallDock-PZJRO54J.cjs.map → ConnectedCallDock-7GGYYQNK.cjs.map} +1 -1
  3. package/dist/{ConnectedCallRoom-NGSUG6MI.cjs → ConnectedCallRoom-ZZ7RBGGY.cjs} +8 -8
  4. package/dist/{ConnectedCallRoom-NGSUG6MI.cjs.map → ConnectedCallRoom-ZZ7RBGGY.cjs.map} +1 -1
  5. package/dist/{DocumentReviewCard-NKCKBY3P.cjs → DocumentReviewCard-RFE4THHR.cjs} +12 -12
  6. package/dist/{DocumentReviewCard-NKCKBY3P.cjs.map → DocumentReviewCard-RFE4THHR.cjs.map} +1 -1
  7. package/dist/{FilesViewerDialog-T4SOKUKO.cjs → FilesViewerDialog-6OCS7XMG.cjs} +7 -7
  8. package/dist/{FilesViewerDialog-T4SOKUKO.cjs.map → FilesViewerDialog-6OCS7XMG.cjs.map} +1 -1
  9. package/dist/{ai-CTJWECJ5.cjs → ai-A5YTWIEC.cjs} +14 -14
  10. package/dist/ai-A5YTWIEC.cjs.map +1 -0
  11. package/dist/calls/connected/DmCallButton.d.ts +1 -1
  12. package/dist/calls/connected/DmCallButton.js +9 -1
  13. package/dist/calls/connected/DmCallButton.js.map +2 -2
  14. package/dist/calls/index.cjs +22 -22
  15. package/dist/chat/index.cjs +59 -55
  16. package/dist/chat/index.d.ts +1 -0
  17. package/dist/chat/index.js +2 -0
  18. package/dist/chat/index.js.map +2 -2
  19. package/dist/{chunk-ZTLPUUZB.cjs → chunk-2QGTWHPQ.cjs} +2 -2
  20. package/dist/{chunk-ZTLPUUZB.cjs.map → chunk-2QGTWHPQ.cjs.map} +1 -1
  21. package/dist/{chunk-LRBX4VIG.cjs → chunk-5RUY5THD.cjs} +4 -4
  22. package/dist/{chunk-LRBX4VIG.cjs.map → chunk-5RUY5THD.cjs.map} +1 -1
  23. package/dist/{chunk-SFAAOEQE.cjs → chunk-72O4YH5M.cjs} +7 -2
  24. package/dist/chunk-72O4YH5M.cjs.map +1 -0
  25. package/dist/{chunk-7ARRFRQR.cjs → chunk-E7BSG5IS.cjs} +37 -38
  26. package/dist/chunk-E7BSG5IS.cjs.map +1 -0
  27. package/dist/{chunk-J4X3LYGC.cjs → chunk-GENUGV6V.cjs} +4 -4
  28. package/dist/{chunk-J4X3LYGC.cjs.map → chunk-GENUGV6V.cjs.map} +1 -1
  29. package/dist/{chunk-WDL3TOMX.cjs → chunk-HO2AURAQ.cjs} +6 -6
  30. package/dist/{chunk-WDL3TOMX.cjs.map → chunk-HO2AURAQ.cjs.map} +1 -1
  31. package/dist/{chunk-ZHLBTIJJ.cjs → chunk-HS7TUDEM.cjs} +5 -4
  32. package/dist/chunk-HS7TUDEM.cjs.map +1 -0
  33. package/dist/{chunk-TLEEVRYB.cjs → chunk-HTH3XIFF.cjs} +8 -8
  34. package/dist/{chunk-TLEEVRYB.cjs.map → chunk-HTH3XIFF.cjs.map} +1 -1
  35. package/dist/{chunk-DXOYRQKH.cjs → chunk-IRDL2EC6.cjs} +9 -9
  36. package/dist/{chunk-DXOYRQKH.cjs.map → chunk-IRDL2EC6.cjs.map} +1 -1
  37. package/dist/{chunk-6VIS6B3O.cjs → chunk-IXSOSISW.cjs} +28 -28
  38. package/dist/{chunk-6VIS6B3O.cjs.map → chunk-IXSOSISW.cjs.map} +1 -1
  39. package/dist/{chunk-FTSXCBUO.cjs → chunk-JEUHT7XH.cjs} +6 -6
  40. package/dist/{chunk-FTSXCBUO.cjs.map → chunk-JEUHT7XH.cjs.map} +1 -1
  41. package/dist/{chunk-WIQDXRRB.cjs → chunk-PGKCL6YA.cjs} +39 -39
  42. package/dist/{chunk-WIQDXRRB.cjs.map → chunk-PGKCL6YA.cjs.map} +1 -1
  43. package/dist/{chunk-HYULUR6E.cjs → chunk-PPHXBDJP.cjs} +9 -9
  44. package/dist/{chunk-HYULUR6E.cjs.map → chunk-PPHXBDJP.cjs.map} +1 -1
  45. package/dist/{chunk-DWUWPF2A.cjs → chunk-SFKBQLFV.cjs} +51 -51
  46. package/dist/{chunk-DWUWPF2A.cjs.map → chunk-SFKBQLFV.cjs.map} +1 -1
  47. package/dist/{chunk-TW5AGCHR.cjs → chunk-SXC4ZIN4.cjs} +9 -3
  48. package/dist/chunk-SXC4ZIN4.cjs.map +1 -0
  49. package/dist/{chunk-H3C5BY2H.cjs → chunk-U4MJIYGD.cjs} +4 -4
  50. package/dist/{chunk-H3C5BY2H.cjs.map → chunk-U4MJIYGD.cjs.map} +1 -1
  51. package/dist/{chunk-LIAC6O7W.cjs → chunk-UNT2VY3B.cjs} +4 -4
  52. package/dist/{chunk-LIAC6O7W.cjs.map → chunk-UNT2VY3B.cjs.map} +1 -1
  53. package/dist/{chunk-PUCYBYBY.cjs → chunk-USYCBTKK.cjs} +83 -32
  54. package/dist/chunk-USYCBTKK.cjs.map +1 -0
  55. package/dist/{chunk-YM77I6V7.cjs → chunk-WHU7ABQE.cjs} +18 -18
  56. package/dist/{chunk-YM77I6V7.cjs.map → chunk-WHU7ABQE.cjs.map} +1 -1
  57. package/dist/connect/index.cjs +621 -621
  58. package/dist/connect/viewer.cjs +5 -5
  59. package/dist/connection/files/explorer/FileTiles.js +2 -4
  60. package/dist/connection/files/explorer/FileTiles.js.map +2 -2
  61. package/dist/databases/DatabaseRowDetail.d.ts +2 -2
  62. package/dist/databases/DatabaseRowDetail.js +22 -35
  63. package/dist/databases/DatabaseRowDetail.js.map +2 -2
  64. package/dist/databases/DocumentSourcesField.d.ts +12 -0
  65. package/dist/databases/DocumentSourcesField.js +72 -0
  66. package/dist/databases/DocumentSourcesField.js.map +7 -0
  67. package/dist/databases/index.cjs +70 -69
  68. package/dist/embed/index.cjs +12 -12
  69. package/dist/files/index.cjs +219 -219
  70. package/dist/files/visibility.d.ts +5 -0
  71. package/dist/files/visibility.js +6 -1
  72. package/dist/files/visibility.js.map +2 -2
  73. package/dist/index.cjs +107 -103
  74. package/dist/pages/index.cjs +19 -19
  75. package/dist/studio/index.cjs +5 -5
  76. package/dist/workflow-canvas/index.cjs +16 -16
  77. package/node_modules/@arbidocs/coedit/package.json +1 -1
  78. package/package.json +5 -5
  79. package/dist/ai-CTJWECJ5.cjs.map +0 -1
  80. package/dist/chunk-7ARRFRQR.cjs.map +0 -1
  81. package/dist/chunk-PUCYBYBY.cjs.map +0 -1
  82. package/dist/chunk-SFAAOEQE.cjs.map +0 -1
  83. package/dist/chunk-TW5AGCHR.cjs.map +0 -1
  84. package/dist/chunk-ZHLBTIJJ.cjs.map +0 -1
@@ -9,6 +9,7 @@ var chunkLIJB6XOR_cjs = require('./chunk-LIJB6XOR.cjs');
9
9
  var chunkU46OGRCO_cjs = require('./chunk-U46OGRCO.cjs');
10
10
  var chunk66IOCKWS_cjs = require('./chunk-66IOCKWS.cjs');
11
11
  var chunkZVEW3JBT_cjs = require('./chunk-ZVEW3JBT.cjs');
12
+ var chunkVZOOGA47_cjs = require('./chunk-VZOOGA47.cjs');
12
13
  var chunkPPCATBOY_cjs = require('./chunk-PPCATBOY.cjs');
13
14
  var chunkPLIF5CUV_cjs = require('./chunk-PLIF5CUV.cjs');
14
15
  var lucideReact = require('lucide-react');
@@ -1539,18 +1540,79 @@ function RollupFields({
1539
1540
  ] })
1540
1541
  ] });
1541
1542
  }
1543
+ var rootTestId = (docId) => `database-source-${docId}`;
1544
+ var removeTestId = (docId) => `database-source-remove-${docId}`;
1545
+ function DocumentSourcesField({
1546
+ value,
1547
+ titles,
1548
+ options,
1549
+ onCommit,
1550
+ onOpenDocument,
1551
+ testId
1552
+ }) {
1553
+ const ids = cellIds(value);
1554
+ const groups = react.useMemo(
1555
+ () => [
1556
+ {
1557
+ id: "all",
1558
+ heading: "In this workspace",
1559
+ docs: (options ?? []).map((o) => ({ id: o.id, title: o.label }))
1560
+ }
1561
+ ],
1562
+ [options]
1563
+ );
1564
+ const nameOf2 = (id) => titles?.[id] ?? options?.find((o) => o.id === id)?.label ?? titleOf(id, titles);
1565
+ const toggle = (id) => onCommit?.(ids.includes(id) ? ids.filter((x) => x !== id) : [...ids, id]);
1566
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-testid": testId, className: "flex min-w-0 flex-col gap-2", children: [
1567
+ onCommit && /* @__PURE__ */ jsxRuntime.jsx(
1568
+ chunkVZOOGA47_cjs.DocumentPicker,
1569
+ {
1570
+ groups,
1571
+ value: "",
1572
+ onValueChange: toggle,
1573
+ selectedIds: ids,
1574
+ onOpenDocument,
1575
+ labels: { placeholder: "Search documents\u2026" }
1576
+ }
1577
+ ),
1578
+ ids.length === 0 && !onCommit ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex min-h-8 items-center text-sm text-muted-foreground", children: "\u2014" }) : ids.length > 0 ? (
1579
+ // The same card, document pill and rows as a fact's Sources.
1580
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "overflow-hidden rounded-md border border-border bg-card", children: ids.map((id) => /* @__PURE__ */ jsxRuntime.jsx(
1581
+ chunkHUAABZ2C_cjs.FactSourceGroup,
1582
+ {
1583
+ docId: id,
1584
+ document: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex min-w-0 items-center gap-1", children: /* @__PURE__ */ jsxRuntime.jsx(
1585
+ ui.DocumentEntity,
1586
+ {
1587
+ doc: { file_name: nameOf2(id) },
1588
+ noClamp: true,
1589
+ labelMaxWidth: "max-w-none",
1590
+ onClick: onOpenDocument ? () => onOpenDocument(id) : void 0,
1591
+ className: "min-w-0"
1592
+ }
1593
+ ) }),
1594
+ onRemove: onCommit ? () => onCommit(ids.filter((x) => x !== id)) : void 0,
1595
+ hasPassages: false,
1596
+ testIds: { root: rootTestId, remove: removeTestId },
1597
+ labels: { wholeDocument: "Whole document" }
1598
+ },
1599
+ id
1600
+ )) })
1601
+ ) : null
1602
+ ] });
1603
+ }
1542
1604
  var DEFAULT_DATABASE_ROW_DETAIL_LABELS = {
1543
1605
  untitled: "Untitled",
1544
1606
  fields: "Fields",
1545
- documents: "Linked documents",
1546
- noDocuments: "No document is linked to this row.",
1547
1607
  empty: "Empty",
1548
1608
  deleteRow: "Delete row",
1549
1609
  close: "Close",
1550
1610
  computed: "Computed from a relation",
1551
1611
  draft: "Draft: only you can see it. Submit it when it is ready; once submitted it can\u2019t be taken back.",
1552
1612
  submit: "Submit",
1553
- addField: "New field"
1613
+ addField: "New field",
1614
+ sourcesHintButton: "How to add sources",
1615
+ sourcesHint: "In the picker, tick a document's checkbox to add it as a source, or click its name to just open it."
1554
1616
  };
1555
1617
  var asText2 = (v) => typeof v === "string" && v ? v : null;
1556
1618
  function DraftInput({
@@ -1721,6 +1783,19 @@ function DatabaseRowDetail({
1721
1783
  }
1722
1784
  }
1723
1785
  };
1786
+ if (column.type === "document") {
1787
+ return /* @__PURE__ */ jsxRuntime.jsx(
1788
+ DocumentSourcesField,
1789
+ {
1790
+ testId: id,
1791
+ value,
1792
+ titles: row.titles,
1793
+ options: sources?.documents,
1794
+ onCommit: editable ? (next) => commit(column, next) : void 0,
1795
+ onOpenDocument: sources?.onOpenDocument
1796
+ }
1797
+ );
1798
+ }
1724
1799
  if (column.type === "source") {
1725
1800
  const editSources = sources?.renderSourcesEditor;
1726
1801
  if (editSources && !readOnly && onChange && !column.locked) {
@@ -1825,7 +1900,6 @@ function DatabaseRowDetail({
1825
1900
  }
1826
1901
  );
1827
1902
  case "person":
1828
- case "document":
1829
1903
  case "relation": {
1830
1904
  const target = column.relation?.database_id;
1831
1905
  const searchRows = sources?.searchRows;
@@ -1855,16 +1929,6 @@ function DatabaseRowDetail({
1855
1929
  return null;
1856
1930
  }
1857
1931
  };
1858
- const documents = /* @__PURE__ */ new Map();
1859
- if (row) {
1860
- for (const column of columns) {
1861
- if (column.type !== "document") continue;
1862
- for (const id of cellIds(row.values[column.id])) {
1863
- documents.set(id, [...documents.get(id) ?? [], column.name]);
1864
- }
1865
- }
1866
- }
1867
- const openDocument = sources?.onOpenDocument;
1868
1932
  return /* @__PURE__ */ jsxRuntime.jsxs(
1869
1933
  chunkU46OGRCO_cjs.DetailPanel,
1870
1934
  {
@@ -1911,8 +1975,8 @@ function DatabaseRowDetail({
1911
1975
  {
1912
1976
  label: column.name,
1913
1977
  icon: Icon ? /* @__PURE__ */ jsxRuntime.jsx(Icon, { className: "size-3.5" }) : void 0,
1914
- hint: own?.hint,
1915
- wide: own?.wide,
1978
+ hint: own?.hint ?? (own?.content === void 0 && column.type === "document" && !readOnly ? /* @__PURE__ */ jsxRuntime.jsx(chunkU46OGRCO_cjs.DetailHint, { label: l.sourcesHintButton, testId: `${testId}-sources-hint`, children: l.sourcesHint }) : void 0),
1979
+ wide: own?.wide ?? (own?.content === void 0 && column.type === "document"),
1916
1980
  testId: `${testId}-field-${column.id}`,
1917
1981
  children: own?.content !== void 0 ? own.content : fieldEditor(column)
1918
1982
  },
@@ -1934,20 +1998,7 @@ function DatabaseRowDetail({
1934
1998
  ]
1935
1999
  }
1936
2000
  )
1937
- ] }),
1938
- columns.some((c) => c.type === "document") && /* @__PURE__ */ jsxRuntime.jsx(chunkU46OGRCO_cjs.DetailSection, { title: l.documents, count: documents.size, testId: `${testId}-documents`, children: documents.size ? /* @__PURE__ */ jsxRuntime.jsx(chunkU46OGRCO_cjs.DetailLinkList, { children: [...documents].map(([id, via]) => /* @__PURE__ */ jsxRuntime.jsx(
1939
- chunkU46OGRCO_cjs.DetailLinkItem,
1940
- {
1941
- icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.FileText, { className: "size-4" }),
1942
- onClick: openDocument ? () => openDocument(id) : void 0,
1943
- testId: `${testId}-doc-${id}`,
1944
- children: /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "min-w-0 flex-1", children: [
1945
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "block truncate font-medium", children: titleOf(id, row?.titles) }),
1946
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "block truncate text-xs text-muted-foreground", children: via.join(", ") })
1947
- ] })
1948
- },
1949
- id
1950
- )) }) : /* @__PURE__ */ jsxRuntime.jsx(chunkU46OGRCO_cjs.DetailEmpty, { children: l.noDocuments }) })
2001
+ ] })
1951
2002
  ]
1952
2003
  }
1953
2004
  );
@@ -3752,5 +3803,5 @@ exports.storedLayoutAfter = storedLayoutAfter;
3752
3803
  exports.titleOf = titleOf;
3753
3804
  exports.toApiValue = toApiValue;
3754
3805
  exports.withUndatedFilter = withUndatedFilter;
3755
- //# sourceMappingURL=chunk-PUCYBYBY.cjs.map
3756
- //# sourceMappingURL=chunk-PUCYBYBY.cjs.map
3806
+ //# sourceMappingURL=chunk-USYCBTKK.cjs.map
3807
+ //# sourceMappingURL=chunk-USYCBTKK.cjs.map