@arbidocs/blocks 0.5.39 → 0.5.41
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/{chunk-PD4AKBYZ.js → chunk-DYYTVUBW.js} +273 -5
- package/dist/chunk-DYYTVUBW.js.map +1 -0
- package/dist/{chunk-GX5MKJ3F.cjs → chunk-HNEOW7F3.cjs} +275 -2
- package/dist/chunk-HNEOW7F3.cjs.map +1 -0
- package/dist/{chunk-TTPXMCJL.js → chunk-NE7M6NJY.js} +5 -275
- package/dist/chunk-NE7M6NJY.js.map +1 -0
- package/dist/{chunk-BY2EW2QU.cjs → chunk-YWGDZR6A.cjs} +16 -291
- package/dist/chunk-YWGDZR6A.cjs.map +1 -0
- package/dist/connect/index.cjs +96 -24
- package/dist/connect/index.cjs.map +1 -1
- package/dist/connect/index.d.ts +2 -0
- package/dist/connect/index.js +78 -8
- package/dist/connect/index.js.map +1 -1
- package/dist/connect/viewer.cjs +2 -2
- package/dist/connect/viewer.js +2 -2
- package/dist/connection/shell/ConnectedAppShell.d.ts +41 -0
- package/dist/connection/shell/app-shell-controller.d.ts +7 -0
- package/dist/index.cjs +77 -77
- package/dist/index.js +2 -2
- package/dist/shell/index.cjs +77 -77
- package/dist/shell/index.js +2 -2
- package/dist/shell/use-sidebar-controller.d.ts +5 -0
- package/node_modules/@arbidocs/coedit/package.json +1 -1
- package/package.json +5 -5
- package/dist/chunk-BY2EW2QU.cjs.map +0 -1
- package/dist/chunk-GX5MKJ3F.cjs.map +0 -1
- package/dist/chunk-PD4AKBYZ.js.map +0 -1
- package/dist/chunk-TTPXMCJL.js.map +0 -1
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
var chunkAHDJXIUB_cjs = require('./chunk-AHDJXIUB.cjs');
|
|
4
|
+
var chunkHNEOW7F3_cjs = require('./chunk-HNEOW7F3.cjs');
|
|
6
5
|
var chunkX6MGM3LH_cjs = require('./chunk-X6MGM3LH.cjs');
|
|
7
6
|
var chunkB6MVQCXW_cjs = require('./chunk-B6MVQCXW.cjs');
|
|
8
|
-
var chunkFX3K6LNZ_cjs = require('./chunk-FX3K6LNZ.cjs');
|
|
9
7
|
var chunkMHVNT4J3_cjs = require('./chunk-MHVNT4J3.cjs');
|
|
10
8
|
var react = require('react');
|
|
11
9
|
var lucideReact = require('lucide-react');
|
|
@@ -54,7 +52,7 @@ function SidebarRoot({
|
|
|
54
52
|
"data-testid": testId,
|
|
55
53
|
backdropTestId
|
|
56
54
|
}) {
|
|
57
|
-
const mergedLabels = react.useMemo(() => ({ ...
|
|
55
|
+
const mergedLabels = react.useMemo(() => ({ ...chunkHNEOW7F3_cjs.DEFAULT_SIDEBAR_LABELS, ...labels }), [labels]);
|
|
58
56
|
const drawerRef = react.useRef(null);
|
|
59
57
|
const isDrawer = mode === "drawer";
|
|
60
58
|
chunkB6MVQCXW_cjs.useDrawerBehavior(isDrawer, onBackdropClick ?? noop, drawerRef);
|
|
@@ -172,7 +170,7 @@ function SidebarRoot({
|
|
|
172
170
|
)
|
|
173
171
|
] });
|
|
174
172
|
}
|
|
175
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
173
|
+
return /* @__PURE__ */ jsxRuntime.jsx(chunkHNEOW7F3_cjs.SidebarContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxRuntime.jsx(chunkB6MVQCXW_cjs.BlocksTooltipProvider, { children: body }) });
|
|
176
174
|
}
|
|
177
175
|
function SidebarHeader({ children, className, "data-testid": testId }) {
|
|
178
176
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -192,7 +190,7 @@ function SidebarNav({
|
|
|
192
190
|
className,
|
|
193
191
|
"data-testid": testId
|
|
194
192
|
}) {
|
|
195
|
-
const { expanded } =
|
|
193
|
+
const { expanded } = chunkHNEOW7F3_cjs.useSidebarContext();
|
|
196
194
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
197
195
|
"div",
|
|
198
196
|
{
|
|
@@ -223,7 +221,7 @@ function SidebarGroup({
|
|
|
223
221
|
className,
|
|
224
222
|
"data-testid": testId
|
|
225
223
|
}) {
|
|
226
|
-
const { expanded } =
|
|
224
|
+
const { expanded } = chunkHNEOW7F3_cjs.useSidebarContext();
|
|
227
225
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
228
226
|
"div",
|
|
229
227
|
{
|
|
@@ -260,7 +258,7 @@ function SidebarGroupLabel({ children, className }) {
|
|
|
260
258
|
);
|
|
261
259
|
}
|
|
262
260
|
function SidebarFooter({ children, className, "data-testid": testId }) {
|
|
263
|
-
const { expanded } =
|
|
261
|
+
const { expanded } = chunkHNEOW7F3_cjs.useSidebarContext();
|
|
264
262
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
265
263
|
"div",
|
|
266
264
|
{
|
|
@@ -295,7 +293,7 @@ function SidebarNavItem({
|
|
|
295
293
|
className,
|
|
296
294
|
tooltip
|
|
297
295
|
}) {
|
|
298
|
-
const { expanded } =
|
|
296
|
+
const { expanded } = chunkHNEOW7F3_cjs.useSidebarContext();
|
|
299
297
|
const [isRowActive, setIsRowActive] = react.useState(false);
|
|
300
298
|
const tip = expanded ? void 0 : tooltip ?? label;
|
|
301
299
|
if (!expanded) {
|
|
@@ -403,7 +401,7 @@ function SidebarNavItem({
|
|
|
403
401
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "ml-3 min-w-0 truncate text-left", children: label }),
|
|
404
402
|
countNode
|
|
405
403
|
] }),
|
|
406
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
404
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkHNEOW7F3_cjs.SidebarRowHoverContext.Provider, { value: isRowActive, children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "relative ml-2 flex flex-shrink-0 items-center", children: trailing }) })
|
|
407
405
|
]
|
|
408
406
|
}
|
|
409
407
|
);
|
|
@@ -434,7 +432,7 @@ function SidebarNavItem({
|
|
|
434
432
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex size-5 flex-shrink-0 items-center justify-center", children: icon }),
|
|
435
433
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "ml-3 min-w-0 truncate text-left", children: label }),
|
|
436
434
|
countNode,
|
|
437
|
-
trailing && /* @__PURE__ */ jsxRuntime.jsx(
|
|
435
|
+
trailing && /* @__PURE__ */ jsxRuntime.jsx(chunkHNEOW7F3_cjs.SidebarRowHoverContext.Provider, { value: isRowActive, children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ml-auto flex flex-shrink-0 items-center pl-2", children: trailing }) })
|
|
438
436
|
]
|
|
439
437
|
}
|
|
440
438
|
);
|
|
@@ -445,7 +443,7 @@ function SidebarPinToggle({
|
|
|
445
443
|
className,
|
|
446
444
|
"data-testid": testId
|
|
447
445
|
}) {
|
|
448
|
-
const { expanded, labels } =
|
|
446
|
+
const { expanded, labels } = chunkHNEOW7F3_cjs.useSidebarContext();
|
|
449
447
|
const label = isPinned ? labels.hideSidebar : labels.showSidebar;
|
|
450
448
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
451
449
|
"button",
|
|
@@ -474,7 +472,7 @@ function SidebarDrawerHeader({
|
|
|
474
472
|
closeLabel: closeLabelProp,
|
|
475
473
|
"data-testid": testId
|
|
476
474
|
}) {
|
|
477
|
-
const { labels } =
|
|
475
|
+
const { labels } = chunkHNEOW7F3_cjs.useSidebarContext();
|
|
478
476
|
const closeLabel = closeLabelProp ?? labels.closeNavigationMenu;
|
|
479
477
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
480
478
|
"div",
|
|
@@ -507,7 +505,7 @@ var Sidebar = {
|
|
|
507
505
|
NavItem: SidebarNavItem,
|
|
508
506
|
Footer: SidebarFooter,
|
|
509
507
|
PinToggle: SidebarPinToggle,
|
|
510
|
-
BadgeRow:
|
|
508
|
+
BadgeRow: chunkHNEOW7F3_cjs.SidebarBadgeRow,
|
|
511
509
|
DrawerHeader: SidebarDrawerHeader
|
|
512
510
|
};
|
|
513
511
|
function ShellSidebar({
|
|
@@ -540,133 +538,6 @@ function ShellSidebar({
|
|
|
540
538
|
] })
|
|
541
539
|
] });
|
|
542
540
|
}
|
|
543
|
-
function useCloseOnEscape(isActive, onClose) {
|
|
544
|
-
const onCloseRef = react.useRef(onClose);
|
|
545
|
-
react.useEffect(() => {
|
|
546
|
-
onCloseRef.current = onClose;
|
|
547
|
-
});
|
|
548
|
-
react.useEffect(() => {
|
|
549
|
-
if (!isActive) return;
|
|
550
|
-
const onKeyDown = (e) => {
|
|
551
|
-
if (e.key === "Escape" && !e.defaultPrevented) onCloseRef.current();
|
|
552
|
-
};
|
|
553
|
-
document.addEventListener("keydown", onKeyDown);
|
|
554
|
-
return () => document.removeEventListener("keydown", onKeyDown);
|
|
555
|
-
}, [isActive]);
|
|
556
|
-
}
|
|
557
|
-
function resolveSidebarLayout(input) {
|
|
558
|
-
const { isSmallScreen, isDrawerRequested, isCollapsed, isPinned, isHovering } = input;
|
|
559
|
-
const canPin = isPinned && !isSmallScreen && !input.isNarrow;
|
|
560
|
-
const drawerOpen = isSmallScreen && isDrawerRequested;
|
|
561
|
-
const effectiveCollapsed = isCollapsed || isSmallScreen && !drawerOpen;
|
|
562
|
-
const hovering = isHovering && !isSmallScreen;
|
|
563
|
-
let mode;
|
|
564
|
-
if (drawerOpen) mode = "drawer";
|
|
565
|
-
else if (effectiveCollapsed) mode = "collapsed";
|
|
566
|
-
else if (canPin) mode = "pinned";
|
|
567
|
-
else mode = "rail";
|
|
568
|
-
const expanded = drawerOpen || !effectiveCollapsed && (canPin || hovering);
|
|
569
|
-
return { mode, expanded, hidden: isSmallScreen && !drawerOpen, hovering };
|
|
570
|
-
}
|
|
571
|
-
function useSidebarSettle(expanded, settleMs = 300) {
|
|
572
|
-
const [labelsExpanded, setLabelsExpanded] = react.useState(expanded);
|
|
573
|
-
const [tipsVisible, setTipsVisible] = react.useState(expanded);
|
|
574
|
-
const labelsTimer = react.useRef(null);
|
|
575
|
-
const tipsTimer = react.useRef(null);
|
|
576
|
-
react.useEffect(() => {
|
|
577
|
-
if (labelsTimer.current) clearTimeout(labelsTimer.current);
|
|
578
|
-
if (expanded) setLabelsExpanded(true);
|
|
579
|
-
else labelsTimer.current = setTimeout(() => setLabelsExpanded(false), settleMs);
|
|
580
|
-
return () => {
|
|
581
|
-
if (labelsTimer.current) clearTimeout(labelsTimer.current);
|
|
582
|
-
};
|
|
583
|
-
}, [expanded, settleMs]);
|
|
584
|
-
react.useEffect(() => {
|
|
585
|
-
if (tipsTimer.current) clearTimeout(tipsTimer.current);
|
|
586
|
-
if (expanded) tipsTimer.current = setTimeout(() => setTipsVisible(true), settleMs);
|
|
587
|
-
else setTipsVisible(false);
|
|
588
|
-
return () => {
|
|
589
|
-
if (tipsTimer.current) clearTimeout(tipsTimer.current);
|
|
590
|
-
};
|
|
591
|
-
}, [expanded, settleMs]);
|
|
592
|
-
return { labelsExpanded, tipsVisible };
|
|
593
|
-
}
|
|
594
|
-
|
|
595
|
-
// src/shell/use-sidebar-controller.ts
|
|
596
|
-
var isMenuOpen = () => typeof document !== "undefined" && document.querySelector('[role="menu"][data-state="open"]') !== null;
|
|
597
|
-
function useSidebarController(options = {}) {
|
|
598
|
-
const [storedPinned, setPinned] = chunkAHDJXIUB_cjs.useControllableState(
|
|
599
|
-
options.isPinned,
|
|
600
|
-
options.defaultPinned ?? true,
|
|
601
|
-
options.onPinnedChange
|
|
602
|
-
);
|
|
603
|
-
const [isHovering, setHovering] = chunkAHDJXIUB_cjs.useControllableState(
|
|
604
|
-
options.isHovering,
|
|
605
|
-
false,
|
|
606
|
-
options.onHoveringChange
|
|
607
|
-
);
|
|
608
|
-
const [isDrawerOpen, setDrawerOpen] = chunkAHDJXIUB_cjs.useControllableState(
|
|
609
|
-
options.isDrawerOpen,
|
|
610
|
-
false,
|
|
611
|
-
options.onDrawerOpenChange
|
|
612
|
-
);
|
|
613
|
-
const isSmallScreen = chunkFX3K6LNZ_cjs.useIsPhone();
|
|
614
|
-
const isNarrow = chunkFX3K6LNZ_cjs.useIsNarrow() || !!options.forceRail;
|
|
615
|
-
const isTouch = chunkFX3K6LNZ_cjs.useIsTouchScreen();
|
|
616
|
-
const layout = resolveSidebarLayout({
|
|
617
|
-
isSmallScreen,
|
|
618
|
-
isDrawerRequested: isDrawerOpen,
|
|
619
|
-
isCollapsed: false,
|
|
620
|
-
isPinned: storedPinned,
|
|
621
|
-
isHovering,
|
|
622
|
-
isNarrow
|
|
623
|
-
});
|
|
624
|
-
const isDrawer = layout.mode === "drawer";
|
|
625
|
-
const { labelsExpanded, tipsVisible } = useSidebarSettle(layout.expanded);
|
|
626
|
-
const isPointerOver = react.useRef(false);
|
|
627
|
-
const closeDrawer = react.useCallback(() => setDrawerOpen(false), [setDrawerOpen]);
|
|
628
|
-
const openDrawer = react.useCallback(() => setDrawerOpen(true), [setDrawerOpen]);
|
|
629
|
-
useCloseOnEscape(layout.mode === "rail" && layout.hovering, () => setHovering(false));
|
|
630
|
-
react.useEffect(() => {
|
|
631
|
-
if (isDrawerOpen && !isSmallScreen) setDrawerOpen(false);
|
|
632
|
-
}, [isDrawerOpen, isSmallScreen, setDrawerOpen]);
|
|
633
|
-
const onMouseEnter = () => {
|
|
634
|
-
if (isTouch) return;
|
|
635
|
-
isPointerOver.current = true;
|
|
636
|
-
if (!isSmallScreen && !isNarrow && !isMenuOpen()) setHovering(true);
|
|
637
|
-
};
|
|
638
|
-
const onMouseLeave = () => {
|
|
639
|
-
if (isTouch) return;
|
|
640
|
-
isPointerOver.current = false;
|
|
641
|
-
if (!isSmallScreen) setHovering(false);
|
|
642
|
-
};
|
|
643
|
-
return {
|
|
644
|
-
layout,
|
|
645
|
-
expanded: labelsExpanded,
|
|
646
|
-
tipsVisible,
|
|
647
|
-
isDrawer,
|
|
648
|
-
isSmallScreen,
|
|
649
|
-
isNarrow,
|
|
650
|
-
isPinned: storedPinned && !isNarrow,
|
|
651
|
-
rootProps: {
|
|
652
|
-
mode: layout.mode,
|
|
653
|
-
expanded: labelsExpanded,
|
|
654
|
-
isHovering: layout.hovering,
|
|
655
|
-
onBackdropClick: isDrawer ? closeDrawer : () => setHovering(false),
|
|
656
|
-
hasRailBackdrop: isTouch,
|
|
657
|
-
onMouseEnter,
|
|
658
|
-
onMouseLeave
|
|
659
|
-
},
|
|
660
|
-
openDrawer,
|
|
661
|
-
closeDrawer,
|
|
662
|
-
togglePin: () => isNarrow ? setHovering(!isHovering) : setPinned(!storedPinned),
|
|
663
|
-
expand: () => isNarrow ? setHovering(true) : setPinned(true),
|
|
664
|
-
afterNavigate: () => {
|
|
665
|
-
if (!isPointerOver.current && !storedPinned) setHovering(false);
|
|
666
|
-
if (isDrawer) closeDrawer();
|
|
667
|
-
}
|
|
668
|
-
};
|
|
669
|
-
}
|
|
670
541
|
var PULSE_STYLES = {
|
|
671
542
|
active: "animate-pulse-attention text-primary",
|
|
672
543
|
success: "animate-pulse-attention text-green-text",
|
|
@@ -682,7 +553,7 @@ function SidebarRowAction({
|
|
|
682
553
|
"data-testid": testId,
|
|
683
554
|
children
|
|
684
555
|
}) {
|
|
685
|
-
const rowHovered = react.useContext(
|
|
556
|
+
const rowHovered = react.useContext(chunkHNEOW7F3_cjs.SidebarRowHoverContext);
|
|
686
557
|
const tone = active ? "text-accent-foreground hover:bg-background/60" : pulse ? `${PULSE_STYLES[pulse]} hover:bg-muted` : ui.cn(
|
|
687
558
|
"text-muted-foreground hover:bg-muted hover:text-foreground",
|
|
688
559
|
rowHovered ? "opacity-100" : "opacity-70"
|
|
@@ -1391,7 +1262,7 @@ function OfflinePill({
|
|
|
1391
1262
|
}
|
|
1392
1263
|
),
|
|
1393
1264
|
!compact && onReconnect && // Forced visible (context true): there is no row to hover.
|
|
1394
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1265
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkHNEOW7F3_cjs.SidebarRowHoverContext.Provider, { value: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1395
1266
|
SidebarRowAction,
|
|
1396
1267
|
{
|
|
1397
1268
|
label: labels?.reconnect ?? DEFAULT_OFFLINE_PILL_LABELS.reconnect,
|
|
@@ -1685,147 +1556,6 @@ function SplitLayout({
|
|
|
1685
1556
|
}
|
|
1686
1557
|
);
|
|
1687
1558
|
}
|
|
1688
|
-
var MIN_DOCK_PX = 200;
|
|
1689
|
-
var MIN_MAIN_PX = 300;
|
|
1690
|
-
var DEFAULT_DOCK_PX = 544;
|
|
1691
|
-
var MOBILE_BREAKPOINT_PX = 640;
|
|
1692
|
-
function DockZone({ children, ...props }) {
|
|
1693
|
-
const [hasDockedContent, setHasDockedContent] = react.useState(false);
|
|
1694
|
-
const [dockWidth, setDockWidth] = react.useState(null);
|
|
1695
|
-
const [isResizing, setIsResizing] = react.useState(false);
|
|
1696
|
-
const [dragPosition, setDragPosition] = react.useState(null);
|
|
1697
|
-
const [containerWidth, setContainerWidth] = react.useState(0);
|
|
1698
|
-
const containerRef = react.useRef(null);
|
|
1699
|
-
const dockZoneRef = react.useRef(null);
|
|
1700
|
-
react.useEffect(() => {
|
|
1701
|
-
const el = containerRef.current;
|
|
1702
|
-
if (!el) return;
|
|
1703
|
-
const observer = new ResizeObserver((entries) => {
|
|
1704
|
-
const width = entries[0]?.contentRect.width;
|
|
1705
|
-
if (width !== void 0) setContainerWidth(width);
|
|
1706
|
-
});
|
|
1707
|
-
observer.observe(el);
|
|
1708
|
-
return () => observer.disconnect();
|
|
1709
|
-
}, []);
|
|
1710
|
-
const isMobile = containerWidth > 0 && containerWidth < MOBILE_BREAKPOINT_PX;
|
|
1711
|
-
react.useEffect(() => {
|
|
1712
|
-
const el = dockZoneRef.current;
|
|
1713
|
-
if (!el) return;
|
|
1714
|
-
const update = () => {
|
|
1715
|
-
const hasChildren = el.children.length > 0;
|
|
1716
|
-
setHasDockedContent(hasChildren);
|
|
1717
|
-
if (hasChildren) {
|
|
1718
|
-
const requestedWidth = el.firstElementChild?.getAttribute("data-dock-width");
|
|
1719
|
-
if (requestedWidth) {
|
|
1720
|
-
setDockWidth(parseInt(requestedWidth, 10));
|
|
1721
|
-
}
|
|
1722
|
-
}
|
|
1723
|
-
};
|
|
1724
|
-
const observer = new MutationObserver(update);
|
|
1725
|
-
update();
|
|
1726
|
-
observer.observe(el, { childList: true });
|
|
1727
|
-
return () => observer.disconnect();
|
|
1728
|
-
}, []);
|
|
1729
|
-
const handleMouseDown = react.useCallback(() => {
|
|
1730
|
-
setIsResizing(true);
|
|
1731
|
-
setDragPosition(null);
|
|
1732
|
-
}, []);
|
|
1733
|
-
const handleMouseMove = react.useCallback(
|
|
1734
|
-
(e) => {
|
|
1735
|
-
if (!isResizing || !containerRef.current) return;
|
|
1736
|
-
const rect = containerRef.current.getBoundingClientRect();
|
|
1737
|
-
const x = e.clientX - rect.left;
|
|
1738
|
-
const clamped = Math.min(Math.max(x, MIN_MAIN_PX), rect.width - MIN_DOCK_PX);
|
|
1739
|
-
setDragPosition(clamped);
|
|
1740
|
-
},
|
|
1741
|
-
[isResizing]
|
|
1742
|
-
);
|
|
1743
|
-
const handleMouseUp = react.useCallback(() => {
|
|
1744
|
-
if (dragPosition !== null && containerRef.current) {
|
|
1745
|
-
const containerWidth2 = containerRef.current.getBoundingClientRect().width;
|
|
1746
|
-
setDockWidth(containerWidth2 - dragPosition);
|
|
1747
|
-
}
|
|
1748
|
-
setIsResizing(false);
|
|
1749
|
-
setDragPosition(null);
|
|
1750
|
-
}, [dragPosition]);
|
|
1751
|
-
react.useEffect(() => {
|
|
1752
|
-
if (!isResizing) return;
|
|
1753
|
-
document.addEventListener("mousemove", handleMouseMove);
|
|
1754
|
-
document.addEventListener("mouseup", handleMouseUp);
|
|
1755
|
-
document.body.style.cursor = "col-resize";
|
|
1756
|
-
document.body.style.userSelect = "none";
|
|
1757
|
-
return () => {
|
|
1758
|
-
document.removeEventListener("mousemove", handleMouseMove);
|
|
1759
|
-
document.removeEventListener("mouseup", handleMouseUp);
|
|
1760
|
-
document.body.style.cursor = "";
|
|
1761
|
-
document.body.style.userSelect = "";
|
|
1762
|
-
};
|
|
1763
|
-
}, [isResizing, handleMouseMove, handleMouseUp]);
|
|
1764
|
-
const effectiveDockWidth = hasDockedContent && containerWidth > 0 ? isMobile ? containerWidth : Math.min(
|
|
1765
|
-
Math.max(dockWidth ?? DEFAULT_DOCK_PX, MIN_DOCK_PX),
|
|
1766
|
-
containerWidth - MIN_MAIN_PX
|
|
1767
|
-
) : 0;
|
|
1768
|
-
const mainHidden = isMobile && hasDockedContent;
|
|
1769
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref: containerRef, className: "h-full relative flex", "data-testid": props["data-testid"], children: [
|
|
1770
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1771
|
-
"div",
|
|
1772
|
-
{
|
|
1773
|
-
style: {
|
|
1774
|
-
width: mainHidden ? 0 : `calc(100% - ${effectiveDockWidth}px)`,
|
|
1775
|
-
// Reserve gutter space so the vertical scrollbar doesn't appear and
|
|
1776
|
-
// disappear as streaming content crosses the viewport boundary —
|
|
1777
|
-
// that toggle reflows the layout and reads as a screen-wide flicker.
|
|
1778
|
-
scrollbarGutter: "stable"
|
|
1779
|
-
},
|
|
1780
|
-
className: ui.cn(
|
|
1781
|
-
// The CSS container for the page's @-variants (PageContainer must not be one; see there).
|
|
1782
|
-
"@container h-full overflow-auto",
|
|
1783
|
-
hasDockedContent && !isMobile && "border-r",
|
|
1784
|
-
mainHidden && "overflow-hidden",
|
|
1785
|
-
// Animate opening only. On close the portaled content has already
|
|
1786
|
-
// unmounted, so animating leaves an empty strip shrinking while the
|
|
1787
|
-
// page behind reflows — reads as flicker over heavy content like the
|
|
1788
|
-
// documents grid. Snap closed instead. Resizing is also instant so
|
|
1789
|
-
// the divider doesn't lag the cursor.
|
|
1790
|
-
hasDockedContent && !isResizing && "transition-[width] duration-300 ease-in-out"
|
|
1791
|
-
),
|
|
1792
|
-
"aria-hidden": mainHidden,
|
|
1793
|
-
inert: mainHidden,
|
|
1794
|
-
"data-scroll-container": true,
|
|
1795
|
-
children
|
|
1796
|
-
}
|
|
1797
|
-
),
|
|
1798
|
-
hasDockedContent && !isMobile && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1799
|
-
"div",
|
|
1800
|
-
{
|
|
1801
|
-
className: "group flex w-2 flex-shrink-0 cursor-col-resize items-center justify-center",
|
|
1802
|
-
onMouseDown: handleMouseDown,
|
|
1803
|
-
"data-testid": "dock-resize-handle",
|
|
1804
|
-
children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-12 w-1 rounded-full bg-muted-foreground/40 transition-colors group-hover:bg-primary" })
|
|
1805
|
-
}
|
|
1806
|
-
),
|
|
1807
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1808
|
-
"div",
|
|
1809
|
-
{
|
|
1810
|
-
ref: dockZoneRef,
|
|
1811
|
-
id: "dock-zone",
|
|
1812
|
-
style: { width: effectiveDockWidth },
|
|
1813
|
-
className: ui.cn(
|
|
1814
|
-
"h-full overflow-hidden flex-shrink-0",
|
|
1815
|
-
hasDockedContent && !isResizing && "transition-[width] duration-300 ease-in-out"
|
|
1816
|
-
)
|
|
1817
|
-
}
|
|
1818
|
-
),
|
|
1819
|
-
isResizing && dragPosition !== null && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1820
|
-
"div",
|
|
1821
|
-
{
|
|
1822
|
-
className: "absolute top-0 bottom-0 w-0.5 bg-primary z-50 pointer-events-none",
|
|
1823
|
-
style: { left: dragPosition }
|
|
1824
|
-
}
|
|
1825
|
-
),
|
|
1826
|
-
isResizing && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute inset-0 z-40 cursor-col-resize" })
|
|
1827
|
-
] });
|
|
1828
|
-
}
|
|
1829
1559
|
|
|
1830
1560
|
Object.defineProperty(exports, "UserMenu", {
|
|
1831
1561
|
enumerable: true,
|
|
@@ -1844,7 +1574,6 @@ exports.DEFAULT_MOBILE_BARS_LABELS = DEFAULT_MOBILE_BARS_LABELS;
|
|
|
1844
1574
|
exports.DEFAULT_OFFLINE_PILL_LABELS = DEFAULT_OFFLINE_PILL_LABELS;
|
|
1845
1575
|
exports.DEFAULT_REMOTE_CONTROL_PILL_LABELS = DEFAULT_REMOTE_CONTROL_PILL_LABELS;
|
|
1846
1576
|
exports.DEFAULT_TIP_CARD_LABELS = DEFAULT_TIP_CARD_LABELS;
|
|
1847
|
-
exports.DockZone = DockZone;
|
|
1848
1577
|
exports.INSTALL_PROMPT_DISMISSED_KEY = INSTALL_PROMPT_DISMISSED_KEY;
|
|
1849
1578
|
exports.InfoBar = InfoBar;
|
|
1850
1579
|
exports.InstallPrompt = InstallPrompt;
|
|
@@ -1866,11 +1595,7 @@ exports.getInstallInstructions = getInstallInstructions;
|
|
|
1866
1595
|
exports.initInstallPrompt = initInstallPrompt;
|
|
1867
1596
|
exports.isIosDevice = isIosDevice;
|
|
1868
1597
|
exports.promptAppInstall = promptAppInstall;
|
|
1869
|
-
exports.resolveSidebarLayout = resolveSidebarLayout;
|
|
1870
|
-
exports.useCloseOnEscape = useCloseOnEscape;
|
|
1871
1598
|
exports.useInstallPrompt = useInstallPrompt;
|
|
1872
1599
|
exports.useShellStartInset = useShellStartInset;
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
//# sourceMappingURL=chunk-BY2EW2QU.cjs.map
|
|
1876
|
-
//# sourceMappingURL=chunk-BY2EW2QU.cjs.map
|
|
1600
|
+
//# sourceMappingURL=chunk-YWGDZR6A.cjs.map
|
|
1601
|
+
//# sourceMappingURL=chunk-YWGDZR6A.cjs.map
|