@nivaro/react 0.1.29 → 0.1.30

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 (3) hide show
  1. package/dist/index.d.ts +22 -1
  2. package/dist/index.js +2863 -2824
  3. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -60,6 +60,8 @@ export declare interface ApiVersionInfo {
60
60
 
61
61
  export declare function BooleanField({ field, value, onChange, error, disabled, readOnly, inputId, errorId }: FieldComponentProps): JSX.Element;
62
62
 
63
+ export declare function canOpenChatRoom(): boolean;
64
+
63
65
  export declare function canOpenDm(): boolean;
64
66
 
65
67
  export { CascadeFilterRule }
@@ -158,7 +160,7 @@ export declare interface ChatOnlineUser {
158
160
  last_active?: string | null;
159
161
  }
160
162
 
161
- export declare function ChatPanel({ open, onClose, renderMessageBody, requestedDm }: {
163
+ export declare function ChatPanel({ open, onClose, renderMessageBody, requestedDm, requestedRoom }: {
162
164
  open: boolean;
163
165
  onClose: () => void;
164
166
  renderMessageBody?: (m: ChatMessage, ctx: {
@@ -171,6 +173,13 @@ export declare function ChatPanel({ open, onClose, renderMessageBody, requestedD
171
173
  name?: string;
172
174
  nonce: number;
173
175
  } | null;
176
+ /** Open this room directly (a toast click). Nonce-keyed like requestedDm so
177
+ * the same room can be re-opened after the reader navigates away. */
178
+ requestedRoom?: {
179
+ room: string;
180
+ label?: string;
181
+ nonce: number;
182
+ } | null;
174
183
  }): JSX.Element | null;
175
184
 
176
185
  export declare function ChatProvider({ children, me, onlineUsers, collections, globalRoom, globalLabel, entityPattern, entityUrl, roomLabel, recordUrl, sessionUrl, realtime, subscribeRooms, setTypingRoom, navigate, sound, theme }: ChatProviderProps): JSX.Element;
@@ -1072,6 +1081,8 @@ declare interface O2MFieldInfo {
1072
1081
  */
1073
1082
  export declare function onIdleChange(fn: (idle: boolean) => void): () => void;
1074
1083
 
1084
+ export declare function openChatRoom(room: string, label?: string): void;
1085
+
1075
1086
  export declare function openDmWith(userId: string, displayName?: string): void;
1076
1087
 
1077
1088
  /**
@@ -1320,6 +1331,8 @@ export declare function RecordDrilldownSheet({ collection, itemId, layoutId, roo
1320
1331
  /** Register the host's DM opener. Returns an unregister function. */
1321
1332
  export declare function registerDmOpener(fn: DmOpener): () => void;
1322
1333
 
1334
+ export declare function registerRoomOpener(fn: RoomOpener): () => void;
1335
+
1323
1336
  /**
1324
1337
  * Unstyled relation picker.
1325
1338
  * - m2o: single <select> of related items
@@ -1404,6 +1417,14 @@ export declare interface RoomInfo {
1404
1417
  channel: ChannelMeta | null;
1405
1418
  }
1406
1419
 
1420
+ /**
1421
+ * Same idea for a ROOM rather than a person: a new-message toast has to be able
1422
+ * to open the conversation it is about, and that may be a channel or an entity
1423
+ * room, not only a DM. The host's dock registers this; without one the toast
1424
+ * stays a notification instead of pretending to be clickable.
1425
+ */
1426
+ declare type RoomOpener = (room: string, label?: string) => void;
1427
+
1407
1428
  export declare type SectionState = {
1408
1429
  isCollapsed: (key: string) => boolean;
1409
1430
  toggle: (key: string) => void;