@hadoku/watchparty-ui 0.45.123 → 0.45.125

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.
@@ -1,7 +1,21 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import React from 'react';
2
+ import React, { ReactNode } from 'react';
3
3
  import { Theme } from '@wolffm/themes';
4
4
 
5
+ /** A button a caller adds to the toolbar. Give `href` for a link that opens
6
+ * outside (a new tab), or `onPress` for a press; with neither it does nothing. */
7
+ interface ChatToolbarButton {
8
+ /** Stable among the buttons passed together (the React key). */
9
+ id: string;
10
+ /** The accessible name and the tooltip. */
11
+ label: string;
12
+ /** Drawn at the toolbar's icon size (16px) in its colour: an svg using
13
+ * `currentColor`, or any element that fits that box. */
14
+ icon: ReactNode;
15
+ href?: string;
16
+ onPress?: () => void;
17
+ }
18
+
5
19
  interface ChatLayoutState {
6
20
  collapsed: boolean;
7
21
  /** The column's RENDERED width in CSS px — the rail's while collapsed —
@@ -9,6 +23,29 @@ interface ChatLayoutState {
9
23
  width: number;
10
24
  }
11
25
 
26
+ /** A host's own button in the chat toolbar: a link that opens outside
27
+ * (`href`, a new tab) or a press (`onPress`). `label` is its accessible name
28
+ * and tooltip; `icon` draws at the toolbar's 16px icon size in its colour
29
+ * (an svg using `currentColor`). */
30
+ type RoomChromeToolbarButton = ChatToolbarButton;
31
+ /** The chat pane's toolbar, the one watchparty's own chat panel draws. */
32
+ interface RoomChromeToolbar {
33
+ /** Home: where it goes is the host's. Absent: no Home button. */
34
+ onHome?: () => void;
35
+ /** The platform theme picker, which writes the shared hadoku theme prefs
36
+ * through the host's `<HadokuThemeRoot>`; with no such root above the
37
+ * chrome it is not drawn. Default true. */
38
+ theme?: boolean;
39
+ /** The fleet settings popout (`ConnectedSettings`). `section` is the host's
40
+ * own part of it, drawn as its "App preferences". A host passing this
41
+ * should not also mount a settings gear of its own. Default true. */
42
+ settings?: boolean | {
43
+ section?: React.ReactNode;
44
+ };
45
+ /** The host's own buttons, after the settings gear and before the roster
46
+ * button, in the order given. */
47
+ extra?: readonly RoomChromeToolbarButton[];
48
+ }
12
49
  interface RoomChromeProps {
13
50
  /** The watchparty room to join. Keys spelled `<app-id>-<[a-z0-9-]{1,40}>`
14
51
  * need no provisioning: the room is created on first join by a friend-tier
@@ -93,6 +130,13 @@ interface RoomChromeProps {
93
130
  * allows collapsing still opens the way they left it. For a host screen
94
131
  * where the chat IS the point (a lobby). Resizing still works. Default true. */
95
132
  collapsible?: boolean;
133
+ /** Draws watchparty's chat toolbar (Home, theme picker, settings gear, the
134
+ * host's own buttons, roster) in place of the bare header row; Leave and
135
+ * Hide chat stay at the end of the same row. `{}` is the toolbar with its
136
+ * defaults. Absent: the header is the roster button alone, as before.
137
+ * Not drawn while the chat is collapsed. The page needs
138
+ * `@wolffm/task-ui-components` (this entry already imports it). */
139
+ toolbar?: RoomChromeToolbar;
96
140
  /** The host's content, rendered where the app renders its player. */
97
141
  children: React.ReactNode;
98
142
  }
@@ -110,7 +154,7 @@ interface RoomChromeProps {
110
154
  * module singletons, so ONE chrome per page — a second instance would share,
111
155
  * and then tear down, the first one's connection.
112
156
  */
113
- declare function RoomChrome({ roomKey, serverOrigin, roomOrigin, roomSocketPath, chatOrigin, chatSocketPath, userType, userId, theme, name: hostName, onLeave, onLayoutChange, collapsible, debug: debugHandles, children, }: RoomChromeProps): react_jsx_runtime.JSX.Element;
157
+ declare function RoomChrome({ roomKey, serverOrigin, roomOrigin, roomSocketPath, chatOrigin, chatSocketPath, userType, userId, theme, name: hostName, onLeave, onLayoutChange, collapsible, toolbar, debug: debugHandles, children, }: RoomChromeProps): react_jsx_runtime.JSX.Element;
114
158
 
115
159
  export { RoomChrome };
116
- export type { RoomChromeProps };
160
+ export type { RoomChromeProps, RoomChromeToolbar, RoomChromeToolbarButton };