@nivaro/react 0.1.28 → 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 +41 -1
  2. package/dist/index.js +2918 -2829
  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;
@@ -668,6 +677,15 @@ declare interface HeaderWidgetInfo {
668
677
  inputBindings: InputBinding[];
669
678
  }
670
679
 
680
+ /** Time without real input before someone counts as idle. */
681
+ export declare const IDLE_AFTER_MS: number;
682
+
683
+ /** The fields a presence heartbeat should carry. */
684
+ export declare function idleState(): {
685
+ is_idle: boolean;
686
+ last_active: string;
687
+ };
688
+
671
689
  export declare function ImportConsole({ realtime, defaultTab, initialJobId, onJobOpen }: ImportConsoleProps): JSX.Element;
672
690
 
673
691
  export declare interface ImportConsoleProps {
@@ -1056,6 +1074,15 @@ declare interface O2MFieldInfo {
1056
1074
  parentId: string;
1057
1075
  }
1058
1076
 
1077
+ /**
1078
+ * Called when idleness CHANGES, not on a timer — a host can push the flip
1079
+ * straight down its socket so coming back is seen in about a second instead of
1080
+ * on the next heartbeat. Returns an unsubscribe.
1081
+ */
1082
+ export declare function onIdleChange(fn: (idle: boolean) => void): () => void;
1083
+
1084
+ export declare function openChatRoom(room: string, label?: string): void;
1085
+
1059
1086
  export declare function openDmWith(userId: string, displayName?: string): void;
1060
1087
 
1061
1088
  /**
@@ -1304,6 +1331,8 @@ export declare function RecordDrilldownSheet({ collection, itemId, layoutId, roo
1304
1331
  /** Register the host's DM opener. Returns an unregister function. */
1305
1332
  export declare function registerDmOpener(fn: DmOpener): () => void;
1306
1333
 
1334
+ export declare function registerRoomOpener(fn: RoomOpener): () => void;
1335
+
1307
1336
  /**
1308
1337
  * Unstyled relation picker.
1309
1338
  * - m2o: single <select> of related items
@@ -1388,6 +1417,14 @@ export declare interface RoomInfo {
1388
1417
  channel: ChannelMeta | null;
1389
1418
  }
1390
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
+
1391
1428
  export declare type SectionState = {
1392
1429
  isCollapsed: (key: string) => boolean;
1393
1430
  toggle: (key: string) => void;
@@ -1477,6 +1514,9 @@ export declare function TextField({ field, value, onChange, error, disabled, rea
1477
1514
 
1478
1515
  export declare function TipLayer(): ReactPortal | null;
1479
1516
 
1517
+ /** Install the listeners. Safe to call more than once. */
1518
+ export declare function trackActivity(): void;
1519
+
1480
1520
  /**
1481
1521
  * Translate scope values (target-collection IDS) into a filter's value space.
1482
1522
  * When the filter compares ids (valueField 'id'/undefined) this is identity;