@arbidocs/blocks 0.5.34 → 0.5.36

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 (83) hide show
  1. package/README.md +30 -0
  2. package/dist/{ConnectedNativeDocxComparison-4R5WW7IU.cjs → ConnectedNativeDocxComparison-H2OZMWHT.cjs} +7 -7
  3. package/dist/{ConnectedNativeDocxComparison-4R5WW7IU.cjs.map → ConnectedNativeDocxComparison-H2OZMWHT.cjs.map} +1 -1
  4. package/dist/{ConnectedNativeDocxComparison-AH6KR4CZ.js → ConnectedNativeDocxComparison-RWKFPJPJ.js} +6 -6
  5. package/dist/{ConnectedStreamedWordArtifact-JJI3HR7U.js.map → ConnectedNativeDocxComparison-RWKFPJPJ.js.map} +1 -1
  6. package/dist/{ConnectedNativeDocxEditor-ETEJM7GN.js → ConnectedNativeDocxEditor-43BI5LN6.js} +5 -5
  7. package/dist/{ConnectedNativeDocxEditor-ETEJM7GN.js.map → ConnectedNativeDocxEditor-43BI5LN6.js.map} +1 -1
  8. package/dist/{ConnectedNativeDocxEditor-MJVE2I33.cjs → ConnectedNativeDocxEditor-6DQEM6SD.cjs} +7 -7
  9. package/dist/{ConnectedNativeDocxEditor-MJVE2I33.cjs.map → ConnectedNativeDocxEditor-6DQEM6SD.cjs.map} +1 -1
  10. package/dist/{ConnectedStreamedWordArtifact-S7EQ4FM2.cjs → ConnectedStreamedWordArtifact-3VKYIG6C.cjs} +7 -7
  11. package/dist/ConnectedStreamedWordArtifact-3VKYIG6C.cjs.map +1 -0
  12. package/dist/{ConnectedStreamedWordArtifact-JJI3HR7U.js → ConnectedStreamedWordArtifact-TEB332E3.js} +6 -6
  13. package/dist/{ConnectedNativeDocxComparison-AH6KR4CZ.js.map → ConnectedStreamedWordArtifact-TEB332E3.js.map} +1 -1
  14. package/dist/agents/index.cjs +326 -326
  15. package/dist/agents/index.js +4 -4
  16. package/dist/calls/index.cjs +1 -1
  17. package/dist/calls/index.js +1 -1
  18. package/dist/{chunk-SSYRPBL5.cjs → chunk-2QDNQM63.cjs} +3 -3
  19. package/dist/{chunk-SSYRPBL5.cjs.map → chunk-2QDNQM63.cjs.map} +1 -1
  20. package/dist/{chunk-H7L43DIE.js → chunk-46WCQ4F3.js} +8 -3
  21. package/dist/chunk-46WCQ4F3.js.map +1 -0
  22. package/dist/{chunk-UWXCT3ON.js → chunk-4DKI37QQ.js} +3 -3
  23. package/dist/{chunk-UWXCT3ON.js.map → chunk-4DKI37QQ.js.map} +1 -1
  24. package/dist/{chunk-FSEZEVWZ.cjs → chunk-5NTSJV5H.cjs} +219 -2
  25. package/dist/chunk-5NTSJV5H.cjs.map +1 -0
  26. package/dist/{chunk-WUG24K7P.cjs → chunk-5V4HH7EH.cjs} +7 -2
  27. package/dist/chunk-5V4HH7EH.cjs.map +1 -0
  28. package/dist/{chunk-J6U6DIZK.cjs → chunk-6EQSP77K.cjs} +5 -5
  29. package/dist/{chunk-J6U6DIZK.cjs.map → chunk-6EQSP77K.cjs.map} +1 -1
  30. package/dist/{chunk-OPK6GYYR.js → chunk-7CHI36EP.js} +3 -3
  31. package/dist/{chunk-OPK6GYYR.js.map → chunk-7CHI36EP.js.map} +1 -1
  32. package/dist/{chunk-KBISVJPU.cjs → chunk-BRYRZOS3.cjs} +4 -4
  33. package/dist/{chunk-KBISVJPU.cjs.map → chunk-BRYRZOS3.cjs.map} +1 -1
  34. package/dist/{chunk-O76V2TUY.js → chunk-EZSYYENN.js} +5 -5
  35. package/dist/{chunk-O76V2TUY.js.map → chunk-EZSYYENN.js.map} +1 -1
  36. package/dist/{chunk-G5ISXB5I.js → chunk-FHB4G77H.js} +3 -3
  37. package/dist/{chunk-G5ISXB5I.js.map → chunk-FHB4G77H.js.map} +1 -1
  38. package/dist/{chunk-POU4O4D7.cjs → chunk-FY4C7HU5.cjs} +9 -9
  39. package/dist/{chunk-POU4O4D7.cjs.map → chunk-FY4C7HU5.cjs.map} +1 -1
  40. package/dist/{chunk-AL4GAWD3.js → chunk-MLHOG7YH.js} +3 -3
  41. package/dist/{chunk-AL4GAWD3.js.map → chunk-MLHOG7YH.js.map} +1 -1
  42. package/dist/{chunk-RFQ2FGL4.js → chunk-NUV5F6MM.js} +3 -3
  43. package/dist/{chunk-RFQ2FGL4.js.map → chunk-NUV5F6MM.js.map} +1 -1
  44. package/dist/{chunk-B426HYRI.cjs → chunk-PUX4M22Q.cjs} +49 -49
  45. package/dist/{chunk-B426HYRI.cjs.map → chunk-PUX4M22Q.cjs.map} +1 -1
  46. package/dist/{chunk-LTEDORG3.js → chunk-QFYRXQTD.js} +220 -5
  47. package/dist/chunk-QFYRXQTD.js.map +1 -0
  48. package/dist/{chunk-SXYXFCHN.js → chunk-VKY4SQMH.js} +3 -3
  49. package/dist/{chunk-SXYXFCHN.js.map → chunk-VKY4SQMH.js.map} +1 -1
  50. package/dist/{chunk-QU77RRZP.cjs → chunk-VMLEISRZ.cjs} +8 -8
  51. package/dist/{chunk-QU77RRZP.cjs.map → chunk-VMLEISRZ.cjs.map} +1 -1
  52. package/dist/{chunk-R3QNE46Z.cjs → chunk-XFSEPGF7.cjs} +4 -4
  53. package/dist/{chunk-R3QNE46Z.cjs.map → chunk-XFSEPGF7.cjs.map} +1 -1
  54. package/dist/collaboration/index.cjs +67 -67
  55. package/dist/collaboration/index.js +1 -1
  56. package/dist/connect/docx.cjs +9 -9
  57. package/dist/connect/docx.js +5 -5
  58. package/dist/connect/index.cjs +301 -301
  59. package/dist/connect/index.js +9 -9
  60. package/dist/connect/viewer.cjs +5 -5
  61. package/dist/connect/viewer.js +5 -5
  62. package/dist/index.cjs +552 -501
  63. package/dist/index.cjs.map +1 -1
  64. package/dist/index.d.ts +2 -0
  65. package/dist/index.js +51 -10
  66. package/dist/index.js.map +1 -1
  67. package/dist/nav/actions.d.ts +24 -0
  68. package/dist/nav/manifest.d.ts +16 -0
  69. package/dist/nav/types.d.ts +2 -0
  70. package/dist/shell/DockZone.d.ts +27 -0
  71. package/dist/shell/PanelModeSwitcher.d.ts +30 -0
  72. package/dist/shell/index.cjs +47 -39
  73. package/dist/shell/index.d.ts +2 -0
  74. package/dist/shell/index.js +1 -1
  75. package/dist/workflow-canvas/index.cjs +17 -17
  76. package/dist/workflow-canvas/index.js +4 -4
  77. package/node_modules/@arbidocs/coedit/package.json +1 -1
  78. package/package.json +5 -5
  79. package/dist/ConnectedStreamedWordArtifact-S7EQ4FM2.cjs.map +0 -1
  80. package/dist/chunk-FSEZEVWZ.cjs.map +0 -1
  81. package/dist/chunk-H7L43DIE.js.map +0 -1
  82. package/dist/chunk-LTEDORG3.js.map +0 -1
  83. package/dist/chunk-WUG24K7P.cjs.map +0 -1
@@ -3,10 +3,10 @@ import { SidebarBadgeRow, DEFAULT_SIDEBAR_LABELS, SidebarContext, useSidebarCont
3
3
  import { useControllableState } from './chunk-RLWIUUQ5.js';
4
4
  import { ActionLink } from './chunk-73DANGPH.js';
5
5
  import { useDrawerBehavior, BlocksTooltipProvider, useShellBottomInset } from './chunk-7XF5SFJ2.js';
6
- import { useIsPhone, useIsNarrow, useIsTouchScreen } from './chunk-SLSBJRWW.js';
6
+ import { useIsPhone, useIsNarrow, useIsTouchScreen, useMediaQuery } from './chunk-SLSBJRWW.js';
7
7
  import { testIdOr, prefixedTestId } from './chunk-7F6CBP3Z.js';
8
8
  import { useEffect, useMemo, useRef, useState, useCallback, useContext } from 'react';
9
- import { TriangleAlert, CheckCircle2, Loader2, PanelLeftClose, PanelLeftOpen, X, Sparkles, Search, ArrowUp, Menu, Download, RefreshCw, WifiOff, MousePointerClick, Lightbulb, Pencil, ChevronLeft, ChevronRight, Info } from 'lucide-react';
9
+ import { TriangleAlert, CheckCircle2, Loader2, PanelLeftClose, PanelLeftOpen, X, Sparkles, Search, ArrowUp, Menu, Download, RefreshCw, WifiOff, MousePointerClick, Lightbulb, Pencil, ChevronLeft, ChevronRight, Info, ExternalLink, PanelRight, PictureInPicture2 } from 'lucide-react';
10
10
  import { cn, Tooltip, TooltipTrigger, TooltipContent, Button } from '@arbidocs/react/ui';
11
11
  export { UserMenu } from '@arbidocs/react/ui';
12
12
  import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
@@ -1684,7 +1684,222 @@ function SplitLayout({
1684
1684
  }
1685
1685
  );
1686
1686
  }
1687
+ var MIN_DOCK_PX = 200;
1688
+ var MIN_MAIN_PX = 300;
1689
+ var DEFAULT_DOCK_PX = 544;
1690
+ var MOBILE_BREAKPOINT_PX = 640;
1691
+ function DockZone({ children, ...props }) {
1692
+ const [hasDockedContent, setHasDockedContent] = useState(false);
1693
+ const [dockWidth, setDockWidth] = useState(null);
1694
+ const [isResizing, setIsResizing] = useState(false);
1695
+ const [dragPosition, setDragPosition] = useState(null);
1696
+ const [containerWidth, setContainerWidth] = useState(0);
1697
+ const containerRef = useRef(null);
1698
+ const dockZoneRef = useRef(null);
1699
+ useEffect(() => {
1700
+ const el = containerRef.current;
1701
+ if (!el) return;
1702
+ const observer = new ResizeObserver((entries) => {
1703
+ const width = entries[0]?.contentRect.width;
1704
+ if (width !== void 0) setContainerWidth(width);
1705
+ });
1706
+ observer.observe(el);
1707
+ return () => observer.disconnect();
1708
+ }, []);
1709
+ const isMobile = containerWidth > 0 && containerWidth < MOBILE_BREAKPOINT_PX;
1710
+ useEffect(() => {
1711
+ const el = dockZoneRef.current;
1712
+ if (!el) return;
1713
+ const update = () => {
1714
+ const hasChildren = el.children.length > 0;
1715
+ setHasDockedContent(hasChildren);
1716
+ if (hasChildren) {
1717
+ const requestedWidth = el.firstElementChild?.getAttribute("data-dock-width");
1718
+ if (requestedWidth) {
1719
+ setDockWidth(parseInt(requestedWidth, 10));
1720
+ }
1721
+ }
1722
+ };
1723
+ const observer = new MutationObserver(update);
1724
+ update();
1725
+ observer.observe(el, { childList: true });
1726
+ return () => observer.disconnect();
1727
+ }, []);
1728
+ const handleMouseDown = useCallback(() => {
1729
+ setIsResizing(true);
1730
+ setDragPosition(null);
1731
+ }, []);
1732
+ const handleMouseMove = useCallback(
1733
+ (e) => {
1734
+ if (!isResizing || !containerRef.current) return;
1735
+ const rect = containerRef.current.getBoundingClientRect();
1736
+ const x = e.clientX - rect.left;
1737
+ const clamped = Math.min(Math.max(x, MIN_MAIN_PX), rect.width - MIN_DOCK_PX);
1738
+ setDragPosition(clamped);
1739
+ },
1740
+ [isResizing]
1741
+ );
1742
+ const handleMouseUp = useCallback(() => {
1743
+ if (dragPosition !== null && containerRef.current) {
1744
+ const containerWidth2 = containerRef.current.getBoundingClientRect().width;
1745
+ setDockWidth(containerWidth2 - dragPosition);
1746
+ }
1747
+ setIsResizing(false);
1748
+ setDragPosition(null);
1749
+ }, [dragPosition]);
1750
+ useEffect(() => {
1751
+ if (!isResizing) return;
1752
+ document.addEventListener("mousemove", handleMouseMove);
1753
+ document.addEventListener("mouseup", handleMouseUp);
1754
+ document.body.style.cursor = "col-resize";
1755
+ document.body.style.userSelect = "none";
1756
+ return () => {
1757
+ document.removeEventListener("mousemove", handleMouseMove);
1758
+ document.removeEventListener("mouseup", handleMouseUp);
1759
+ document.body.style.cursor = "";
1760
+ document.body.style.userSelect = "";
1761
+ };
1762
+ }, [isResizing, handleMouseMove, handleMouseUp]);
1763
+ const effectiveDockWidth = hasDockedContent && containerWidth > 0 ? isMobile ? containerWidth : Math.min(
1764
+ Math.max(dockWidth ?? DEFAULT_DOCK_PX, MIN_DOCK_PX),
1765
+ containerWidth - MIN_MAIN_PX
1766
+ ) : 0;
1767
+ const mainHidden = isMobile && hasDockedContent;
1768
+ return /* @__PURE__ */ jsxs("div", { ref: containerRef, className: "h-full relative flex", "data-testid": props["data-testid"], children: [
1769
+ /* @__PURE__ */ jsx(
1770
+ "div",
1771
+ {
1772
+ style: {
1773
+ width: mainHidden ? 0 : `calc(100% - ${effectiveDockWidth}px)`,
1774
+ // Reserve gutter space so the vertical scrollbar doesn't appear and
1775
+ // disappear as streaming content crosses the viewport boundary —
1776
+ // that toggle reflows the layout and reads as a screen-wide flicker.
1777
+ scrollbarGutter: "stable"
1778
+ },
1779
+ className: cn(
1780
+ // The CSS container for the page's @-variants (PageContainer must not be one; see there).
1781
+ "@container h-full overflow-auto",
1782
+ hasDockedContent && !isMobile && "border-r",
1783
+ mainHidden && "overflow-hidden",
1784
+ // Animate opening only. On close the portaled content has already
1785
+ // unmounted, so animating leaves an empty strip shrinking while the
1786
+ // page behind reflows — reads as flicker over heavy content like the
1787
+ // documents grid. Snap closed instead. Resizing is also instant so
1788
+ // the divider doesn't lag the cursor.
1789
+ hasDockedContent && !isResizing && "transition-[width] duration-300 ease-in-out"
1790
+ ),
1791
+ "aria-hidden": mainHidden,
1792
+ inert: mainHidden,
1793
+ "data-scroll-container": true,
1794
+ children
1795
+ }
1796
+ ),
1797
+ hasDockedContent && !isMobile && /* @__PURE__ */ jsx(
1798
+ "div",
1799
+ {
1800
+ className: "group flex w-2 flex-shrink-0 cursor-col-resize items-center justify-center",
1801
+ onMouseDown: handleMouseDown,
1802
+ "data-testid": "dock-resize-handle",
1803
+ children: /* @__PURE__ */ jsx("div", { className: "h-12 w-1 rounded-full bg-muted-foreground/40 transition-colors group-hover:bg-primary" })
1804
+ }
1805
+ ),
1806
+ /* @__PURE__ */ jsx(
1807
+ "div",
1808
+ {
1809
+ ref: dockZoneRef,
1810
+ id: "dock-zone",
1811
+ style: { width: effectiveDockWidth },
1812
+ className: cn(
1813
+ "h-full overflow-hidden flex-shrink-0",
1814
+ hasDockedContent && !isResizing && "transition-[width] duration-300 ease-in-out"
1815
+ )
1816
+ }
1817
+ ),
1818
+ isResizing && dragPosition !== null && /* @__PURE__ */ jsx(
1819
+ "div",
1820
+ {
1821
+ className: "absolute top-0 bottom-0 w-0.5 bg-primary z-50 pointer-events-none",
1822
+ style: { left: dragPosition }
1823
+ }
1824
+ ),
1825
+ isResizing && /* @__PURE__ */ jsx("div", { className: "absolute inset-0 z-40 cursor-col-resize" })
1826
+ ] });
1827
+ }
1828
+ var btnClass = "h-7 w-7 p-0 text-muted-foreground hover:text-foreground";
1829
+ function SwitcherButton({
1830
+ label,
1831
+ inPopout = false,
1832
+ onClick,
1833
+ testId,
1834
+ children
1835
+ }) {
1836
+ const button = /* @__PURE__ */ jsx(
1837
+ Button,
1838
+ {
1839
+ variant: "ghost",
1840
+ size: "sm",
1841
+ className: btnClass,
1842
+ "aria-label": label,
1843
+ title: inPopout ? label : void 0,
1844
+ onClick,
1845
+ "data-testid": testId,
1846
+ children
1847
+ }
1848
+ );
1849
+ if (inPopout) return button;
1850
+ return /* @__PURE__ */ jsxs(Tooltip, { children: [
1851
+ /* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: button }),
1852
+ /* @__PURE__ */ jsx(TooltipContent, { children: label })
1853
+ ] });
1854
+ }
1855
+ var TABLET_AND_BELOW_QUERY = "(max-width: 1024px)";
1856
+ function PanelModeSwitcher({
1857
+ mode,
1858
+ onModeChange,
1859
+ onClose,
1860
+ disablePopout,
1861
+ closeTestId = "dialog-close-button"
1862
+ }) {
1863
+ const isPopout = mode === "popout";
1864
+ const isSmallScreen = useIsPhone();
1865
+ const isTabletAndBelow = useMediaQuery(TABLET_AND_BELOW_QUERY);
1866
+ const closeButton = onClose && /* @__PURE__ */ jsx(SwitcherButton, { label: "Close (Esc)", onClick: onClose, testId: closeTestId, children: /* @__PURE__ */ jsx(X, { className: "w-3.5 h-3.5" }) });
1867
+ if (isSmallScreen) {
1868
+ return /* @__PURE__ */ jsx("div", { className: "flex items-center gap-0.5 flex-shrink-0", children: closeButton });
1869
+ }
1870
+ return /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-0.5 flex-shrink-0", children: [
1871
+ !disablePopout && !isTabletAndBelow && /* @__PURE__ */ jsx(
1872
+ SwitcherButton,
1873
+ {
1874
+ label: isPopout ? "Pop back in" : "Open in new window",
1875
+ inPopout: isPopout,
1876
+ onClick: () => onModeChange(isPopout ? "docked" : "popout"),
1877
+ testId: isPopout ? "pop-into-main-window-button" : "open-in-new-window-button",
1878
+ children: /* @__PURE__ */ jsx(ExternalLink, { className: "w-3.5 h-3.5" })
1879
+ }
1880
+ ),
1881
+ !isPopout && mode !== "docked" && /* @__PURE__ */ jsx(
1882
+ SwitcherButton,
1883
+ {
1884
+ label: "Split screen",
1885
+ onClick: () => onModeChange("docked"),
1886
+ testId: "dock-panel-button",
1887
+ children: /* @__PURE__ */ jsx(PanelRight, { className: "w-3.5 h-3.5" })
1888
+ }
1889
+ ),
1890
+ !isPopout && mode !== "overlay" && !isTabletAndBelow && /* @__PURE__ */ jsx(
1891
+ SwitcherButton,
1892
+ {
1893
+ label: "Float as overlay",
1894
+ onClick: () => onModeChange("overlay"),
1895
+ testId: "overlay-panel-button",
1896
+ children: /* @__PURE__ */ jsx(PictureInPicture2, { className: "w-3.5 h-3.5" })
1897
+ }
1898
+ ),
1899
+ !isPopout && closeButton
1900
+ ] });
1901
+ }
1687
1902
 
1688
- export { AskField, AskRow, AskTrigger, DEFAULT_ASK_FIELD_LABELS, DEFAULT_INSTALL_PROMPT_LABELS, DEFAULT_MOBILE_BARS_LABELS, DEFAULT_OFFLINE_PILL_LABELS, DEFAULT_REMOTE_CONTROL_PILL_LABELS, DEFAULT_TIP_CARD_LABELS, INSTALL_PROMPT_DISMISSED_KEY, InfoBar, InstallPrompt, MobileAppBar, MobileTabBar, OfflinePill, RemoteControlPill, SHELL_START_INSET_VAR, STATUS_ROW_BASE_CLASS, STATUS_ROW_TONES, ShellSidebar, Sidebar, SidebarRowAction, SplitLayout, StatusBadge, StatusRow, TipCard, getInstallInstructions, initInstallPrompt, isIosDevice, promptAppInstall, resolveSidebarLayout, useCloseOnEscape, useInstallPrompt, useShellStartInset, useSidebarController, useSidebarSettle };
1689
- //# sourceMappingURL=chunk-LTEDORG3.js.map
1690
- //# sourceMappingURL=chunk-LTEDORG3.js.map
1903
+ export { AskField, AskRow, AskTrigger, DEFAULT_ASK_FIELD_LABELS, DEFAULT_INSTALL_PROMPT_LABELS, DEFAULT_MOBILE_BARS_LABELS, DEFAULT_OFFLINE_PILL_LABELS, DEFAULT_REMOTE_CONTROL_PILL_LABELS, DEFAULT_TIP_CARD_LABELS, DockZone, INSTALL_PROMPT_DISMISSED_KEY, InfoBar, InstallPrompt, MobileAppBar, MobileTabBar, OfflinePill, PanelModeSwitcher, RemoteControlPill, SHELL_START_INSET_VAR, STATUS_ROW_BASE_CLASS, STATUS_ROW_TONES, ShellSidebar, Sidebar, SidebarRowAction, SplitLayout, StatusBadge, StatusRow, TipCard, getInstallInstructions, initInstallPrompt, isIosDevice, promptAppInstall, resolveSidebarLayout, useCloseOnEscape, useInstallPrompt, useShellStartInset, useSidebarController, useSidebarSettle };
1904
+ //# sourceMappingURL=chunk-QFYRXQTD.js.map
1905
+ //# sourceMappingURL=chunk-QFYRXQTD.js.map