@aperture-browser/session-react 0.0.0-nightly.134.a2b44bc33726 → 0.0.0-nightly.136.3e1fe3ddf22e

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/index.js CHANGED
@@ -154,6 +154,7 @@ const buttonVariants = cva("aperture:group/button aperture:inline-flex aperture:
154
154
  function Button$1({ className, variant = "default", size = "default", ...props }) {
155
155
  return /* @__PURE__ */ jsx(Button, {
156
156
  "data-slot": "button",
157
+ "data-icon-button": size === "icon" || (size?.startsWith("icon-") ?? false) ? "" : void 0,
157
158
  className: cn(buttonVariants({
158
159
  variant,
159
160
  size,
@@ -352,7 +353,7 @@ function HoverCardTrigger(props) {
352
353
  ...props
353
354
  });
354
355
  }
355
- function HoverCardContent({ className, side = "bottom", sideOffset = 4, align = "center", alignOffset = 0, collisionPadding, ...props }) {
356
+ function HoverCardContent({ className, positionerClassName, side = "bottom", sideOffset = 4, align = "center", alignOffset = 0, collisionPadding, ...props }) {
356
357
  return /* @__PURE__ */ jsx(PreviewCard.Portal, {
357
358
  container: usePortalContainer(),
358
359
  children: /* @__PURE__ */ jsx(PreviewCard.Positioner, {
@@ -361,7 +362,7 @@ function HoverCardContent({ className, side = "bottom", sideOffset = 4, align =
361
362
  side,
362
363
  sideOffset,
363
364
  collisionPadding,
364
- className: "aperture:isolate aperture:z-50",
365
+ className: cn("aperture:isolate aperture:z-50", positionerClassName),
365
366
  children: /* @__PURE__ */ jsx(PreviewCard.Popup, {
366
367
  "data-slot": "hover-card-content",
367
368
  className: cn("aperture:z-50 aperture:w-64 aperture:rounded-lg aperture:bg-popover aperture:p-2.5 aperture:text-sm aperture:text-popover-foreground aperture:shadow-md aperture:ring-1 aperture:ring-foreground/10 aperture:outline-hidden", className),
@@ -444,7 +445,11 @@ const copyTextWithToast = (value, onCopied = () => {}) => copyText(value).pipe(E
444
445
  const BROWSER_TAB_DRAG_KIND = "browser-tab";
445
446
  function BrowserTabStrip({ targets, activeTargetId, recordingTargetIds, devToolsTargetIds, disabled, mutationDisabled, onActivate, onCreate, onDuplicate, onClose, onReload, onReorder, loadThumbnail = null, targetFaviconUrl }) {
446
447
  const [previewHandle] = useState(() => createHoverCardHandle());
448
+ const closePreview = () => {
449
+ if (previewHandle.isOpen) previewHandle.close();
450
+ };
447
451
  if (targets.length === 0) return /* @__PURE__ */ jsxs("div", {
452
+ "data-browser-tab-strip": true,
448
453
  className: "aperture:flex aperture:h-8 aperture:min-w-0 aperture:flex-1 aperture:items-center aperture:gap-2 aperture:px-2 aperture:text-xs aperture:text-muted-foreground",
449
454
  children: [/* @__PURE__ */ jsx("span", { children: "No tabs" }), /* @__PURE__ */ jsx(NewTabButton, {
450
455
  disabled: disabled || mutationDisabled,
@@ -452,9 +457,11 @@ function BrowserTabStrip({ targets, activeTargetId, recordingTargetIds, devTools
452
457
  })]
453
458
  });
454
459
  return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(ScrollArea$1, {
460
+ "data-browser-tab-strip": true,
455
461
  scrollbars: "horizontal",
456
462
  className: "aperture:h-8 aperture:min-w-0 aperture:flex-1",
457
463
  children: /* @__PURE__ */ jsxs("div", {
464
+ "data-browser-tab-strip-tabs": true,
458
465
  className: "aperture:flex aperture:min-w-max aperture:items-end aperture:gap-0.5 aperture:px-1 aperture:pt-1",
459
466
  children: [targets.map((target, index) => {
460
467
  const active = target.id === activeTargetId;
@@ -472,6 +479,7 @@ function BrowserTabStrip({ targets, activeTargetId, recordingTargetIds, devTools
472
479
  onReload,
473
480
  onReorder,
474
481
  previewHandle: loadThumbnail ? previewHandle : null,
482
+ onPreviewClose: closePreview,
475
483
  closeOtherTargetIds: targets.filter((current) => current.id !== target.id).map((current) => current.id),
476
484
  closeRightTargetIds: targets.slice(index + 1).map((current) => current.id)
477
485
  }, target.id);
@@ -491,7 +499,7 @@ function BrowserTabStrip({ targets, activeTargetId, recordingTargetIds, devTools
491
499
  }
492
500
  }) : null] });
493
501
  }
494
- function BrowserTab({ target, faviconSrc, active, recording, devToolsOpen, disabled, mutationDisabled, onActivate, onDuplicate, onClose, onReload, onReorder, previewHandle, closeOtherTargetIds, closeRightTargetIds }) {
502
+ function BrowserTab({ target, faviconSrc, active, recording, devToolsOpen, disabled, mutationDisabled, onActivate, onDuplicate, onClose, onReload, onReorder, previewHandle, onPreviewClose, closeOtherTargetIds, closeRightTargetIds }) {
495
503
  const tabRef = useRef(null);
496
504
  const [dragging, setDragging] = useState(false);
497
505
  const [dropPlacement, setDropPlacement] = useState(null);
@@ -538,6 +546,7 @@ function BrowserTab({ target, faviconSrc, active, recording, devToolsOpen, disab
538
546
  onMouseDown: (event) => {
539
547
  if (event.button === 1) event.preventDefault();
540
548
  },
549
+ onMouseLeave: onPreviewClose,
541
550
  onAuxClick: (event) => {
542
551
  if (event.button === 1 && !disabled && !mutationDisabled) {
543
552
  event.preventDefault();
@@ -561,7 +570,10 @@ function BrowserTab({ target, faviconSrc, active, recording, devToolsOpen, disab
561
570
  "aria-current": active ? "page" : void 0,
562
571
  disabled,
563
572
  className: "aperture:flex aperture:min-w-0 aperture:flex-1 aperture:items-center aperture:gap-1.5 aperture:text-left",
564
- onClick: () => onActivate(target.id),
573
+ onClick: () => {
574
+ onPreviewClose();
575
+ onActivate(target.id);
576
+ },
565
577
  children: [
566
578
  /* @__PURE__ */ jsx(TabFavicon, { src: faviconSrc }),
567
579
  devToolsOpen ? /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Wrench, {
@@ -706,6 +718,7 @@ function TabPreview({ target, loadThumbnail }) {
706
718
  align: "start",
707
719
  sideOffset: 8,
708
720
  collisionPadding: 16,
721
+ positionerClassName: "aperture:pointer-events-none",
709
722
  className: "aperture:pointer-events-none aperture:flex aperture:w-80 aperture:max-w-[calc(100vw-2rem)] aperture:flex-col aperture:gap-2 aperture:p-2",
710
723
  children: [
711
724
  /* @__PURE__ */ jsx(TabThumbnail, {
@@ -2118,6 +2131,7 @@ function BrowserToolbar({ control, leading, trailing, toolbarLeading, toolbarTra
2118
2131
  ]
2119
2132
  }) : null, toolbarLeading || toolbarTrailing || features.navigation || features.addressBar || features.drawing || features.devTools || features.menus ? /* @__PURE__ */ jsxs("div", {
2120
2133
  className: "aperture:flex aperture:h-9 aperture:items-center aperture:gap-1 aperture:px-1.5",
2134
+ "data-workbench-toolbar": true,
2121
2135
  children: [
2122
2136
  toolbarLeading ? /* @__PURE__ */ jsx("div", {
2123
2137
  className: "aperture:flex aperture:shrink-0 aperture:items-center aperture:gap-0.5",