@aperture-browser/session-react 0.0.0-nightly.128.ed7e02bfeb1c → 0.0.0-nightly.129.9e2ebce87a2d

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.d.ts CHANGED
@@ -37,7 +37,12 @@ declare function ApertureUIRoot({
37
37
  interface SessionProps {
38
38
  readonly access: SessionAccess$1 | null;
39
39
  readonly features?: SessionFeatures;
40
+ /** Rendered at the start of the title bar row, before the tab strip. */
40
41
  readonly leading?: ReactNode;
42
+ /** Rendered at the start of the toolbar row, before the navigation buttons. */
43
+ readonly toolbarLeading?: ReactNode;
44
+ /** Rendered at the end of the toolbar row, after the menus. */
45
+ readonly toolbarTrailing?: ReactNode;
41
46
  }
42
47
  interface ApertureSessionProps extends SessionProps {
43
48
  readonly features?: ApertureSessionFeatures;
@@ -52,7 +57,9 @@ declare function ApertureSession({
52
57
  declare function Session({
53
58
  access,
54
59
  features,
55
- leading
60
+ leading,
61
+ toolbarLeading,
62
+ toolbarTrailing
56
63
  }: SessionProps): import("react").JSX.Element;
57
64
  declare function devToolsUrl(origin: string, cdpUrl: string, sessionToken: string): string;
58
65
  //#endregion
@@ -72,8 +79,10 @@ declare const copyTextWithToast: (value: string, onCopied?: () => void) => Effec
72
79
  //#endregion
73
80
  //#region src/components/browser-control-pane.d.ts
74
81
  type BrowserControlPaneProps = {
75
- control: UseBrowserControlResult;
76
- leading?: ReactNode;
82
+ control: UseBrowserControlResult; /** Rendered at the start of the title bar row, before the tab strip. */
83
+ leading?: ReactNode; /** Rendered at the start of the toolbar row, before the navigation buttons. */
84
+ toolbarLeading?: ReactNode; /** Rendered at the end of the toolbar row, after the menus. */
85
+ toolbarTrailing?: ReactNode;
77
86
  features?: SessionFeatures;
78
87
  collaborationRole: CollaborationRole$1;
79
88
  cdpUrl: string | null;
@@ -86,6 +95,8 @@ type BrowserControlPaneProps = {
86
95
  declare function BrowserControlPane({
87
96
  control,
88
97
  leading,
98
+ toolbarLeading,
99
+ toolbarTrailing,
89
100
  features: featureOverrides,
90
101
  collaborationRole,
91
102
  cdpUrl,
package/dist/index.js CHANGED
@@ -2089,7 +2089,7 @@ function initials(name) {
2089
2089
  }
2090
2090
  //#endregion
2091
2091
  //#region src/components/browser-toolbar.tsx
2092
- function BrowserToolbar({ control, leading, features, collaborationRole, cdpUrl, shareUrls, localCursorEnabled, onLocalCursorChange, paintingEnabled, onPaintingEnabledChange, devToolsOpen, devToolsTargetIds, devToolsDock, onDevToolsOpenChange, onDevToolsDockChange, onSessionDetails }) {
2092
+ function BrowserToolbar({ control, leading, toolbarLeading, toolbarTrailing, features, collaborationRole, cdpUrl, shareUrls, localCursorEnabled, onLocalCursorChange, paintingEnabled, onPaintingEnabledChange, devToolsOpen, devToolsTargetIds, devToolsDock, onDevToolsOpenChange, onDevToolsDockChange, onSessionDetails }) {
2093
2093
  const [urlDraft, setUrlDraft] = useState(null);
2094
2094
  const displayUrl = control.activeTarget?.url ?? "";
2095
2095
  const busy = control.phase === "connecting";
@@ -2134,9 +2134,13 @@ function BrowserToolbar({ control, leading, features, collaborationRole, cdpUrl,
2134
2134
  }) : /* @__PURE__ */ jsx("div", { className: "aperture:min-w-0 aperture:flex-1" }),
2135
2135
  features.presence ? /* @__PURE__ */ jsx(CollaborationPresence, { collaboration: control.collaboration }) : null
2136
2136
  ]
2137
- }) : null, features.navigation || features.addressBar || features.drawing || features.devTools || features.menus ? /* @__PURE__ */ jsxs("div", {
2137
+ }) : null, toolbarLeading || toolbarTrailing || features.navigation || features.addressBar || features.drawing || features.devTools || features.menus ? /* @__PURE__ */ jsxs("div", {
2138
2138
  className: "aperture:flex aperture:h-9 aperture:items-center aperture:gap-1 aperture:px-1.5",
2139
2139
  children: [
2140
+ toolbarLeading ? /* @__PURE__ */ jsx("div", {
2141
+ className: "aperture:flex aperture:shrink-0 aperture:items-center aperture:gap-0.5",
2142
+ children: toolbarLeading
2143
+ }) : null,
2140
2144
  features.navigation ? /* @__PURE__ */ jsxs("div", {
2141
2145
  className: "aperture:flex aperture:shrink-0 aperture:items-center aperture:gap-0.5",
2142
2146
  children: [
@@ -2215,6 +2219,10 @@ function BrowserToolbar({ control, leading, features, collaborationRole, cdpUrl,
2215
2219
  onReconnect: () => control.reconnect(),
2216
2220
  onSessionDetails,
2217
2221
  now: recordingNow
2222
+ }) : null,
2223
+ toolbarTrailing ? /* @__PURE__ */ jsx("div", {
2224
+ className: "aperture:flex aperture:shrink-0 aperture:items-center aperture:gap-0.5",
2225
+ children: toolbarTrailing
2218
2226
  }) : null
2219
2227
  ]
2220
2228
  }) : null]
@@ -2444,7 +2452,7 @@ function ResizableHandle({ withHandle, className, ...props }) {
2444
2452
  //#endregion
2445
2453
  //#region src/components/browser-control-pane.tsx
2446
2454
  const LOCAL_CURSOR_STORAGE_KEY = "aperture.workbench.localCursorEnabled";
2447
- function BrowserControlPane({ control, leading, features: featureOverrides, collaborationRole, cdpUrl, shareUrls, onSessionDetails }) {
2455
+ function BrowserControlPane({ control, leading, toolbarLeading, toolbarTrailing, features: featureOverrides, collaborationRole, cdpUrl, shareUrls, onSessionDetails }) {
2448
2456
  const features = resolveSessionFeatures(featureOverrides);
2449
2457
  const [localCursorEnabled, setLocalCursorEnabled] = useState(true);
2450
2458
  const [paintingEnabled, setPaintingEnabled] = useState(false);
@@ -2500,6 +2508,8 @@ function BrowserControlPane({ control, leading, features: featureOverrides, coll
2500
2508
  children: [/* @__PURE__ */ jsx(BrowserToolbar, {
2501
2509
  control,
2502
2510
  leading,
2511
+ toolbarLeading,
2512
+ toolbarTrailing,
2503
2513
  features,
2504
2514
  collaborationRole,
2505
2515
  cdpUrl,
@@ -2590,7 +2600,7 @@ function ApertureSession({ theme = "system", className, ...props }) {
2590
2600
  })
2591
2601
  });
2592
2602
  }
2593
- function Session({ access, features, leading }) {
2603
+ function Session({ access, features, leading, toolbarLeading, toolbarTrailing }) {
2594
2604
  const { status, control } = useSession({
2595
2605
  access,
2596
2606
  onNotice: showNotice
@@ -2628,6 +2638,8 @@ function Session({ access, features, leading }) {
2628
2638
  cdpUrl: null,
2629
2639
  shareUrls: null,
2630
2640
  leading,
2641
+ toolbarLeading,
2642
+ toolbarTrailing,
2631
2643
  features: {
2632
2644
  devTools: false,
2633
2645
  ...features