@natoe/colab 0.1.16 → 0.1.18

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.mts CHANGED
@@ -78,6 +78,13 @@ interface CollabConfig {
78
78
  theme?: Theme;
79
79
  /** Host app callbacks — colab calls these, never implements them */
80
80
  onOpenDicom?: (studyId: string, storageId: string) => void;
81
+ /**
82
+ * Open the case behind this conversation. Wired to the package's
83
+ * PatientHeader "Open" button (sibling to "View DICOM"). The host
84
+ * decides how to route — typically role-aware: lab → case page,
85
+ * radiologist → viewer, physician → order history.
86
+ */
87
+ onOpenCase?: (orderId: string, displayOrderId?: string) => void;
81
88
  onUploadFile?: (file: File | Blob, fileName?: string) => Promise<string>;
82
89
  onDeepLink?: (path: string) => void;
83
90
  onError?: (error: CollabError) => void;
@@ -256,6 +263,14 @@ interface CollabPanelProps {
256
263
  onBack?: () => void;
257
264
  /** Hide the patient name row in the header — set when a parent already shows it (e.g. CollabPopup title bar) */
258
265
  hidePatientName?: boolean;
266
+ /**
267
+ * Suppress the PatientHeader "Open" button even when the host has
268
+ * supplied `config.onOpenCase`. Set this when the panel is rendered
269
+ * for the same case the user is already on (e.g. embedded in the
270
+ * viewer's left panel) — otherwise clicking Open would re-fetch the
271
+ * current order and overwrite in-progress context.
272
+ */
273
+ hideOpenCase?: boolean;
259
274
  /**
260
275
  * Notified whenever the underlying conversation state changes (initial
261
276
  * preview load, create, channel deletion). Lets a parent like CollabPopup
@@ -271,6 +286,15 @@ interface CollabPanelProps {
271
286
  * MessageInput, PinnedMessagesBar, etc.) inherits them via cascade.
272
287
  */
273
288
  themeMode?: 'light' | 'dark';
289
+ /**
290
+ * Controlled channel-settings overlay. When both `showSettings` and
291
+ * `onSettingsChange` are provided, the parent (e.g. CollabPopup
292
+ * rendering a settings button in its title bar) owns the open/closed
293
+ * state. When omitted, CollabPanel falls back to its own internal
294
+ * state and surfaces a button via PatientHeader.
295
+ */
296
+ showSettings?: boolean;
297
+ onSettingsChange?: (open: boolean) => void;
274
298
  /** Custom class name for the outer container */
275
299
  className?: string;
276
300
  /** Custom inline styles for the outer container */
@@ -280,7 +304,7 @@ interface CollabPanelProps {
280
304
  * Full collaboration panel: patient header + pinned bar + message thread + input.
281
305
  * Supports reply, pin/unpin, and (optionally) seen-by indicators.
282
306
  */
283
- declare function CollabPanel({ orderId, patientData, participantIds, showSeenBy, onBack, hidePatientName, onConversationChange, themeMode, className, style, }: CollabPanelProps): react_jsx_runtime.JSX.Element;
307
+ declare function CollabPanel({ orderId, patientData, participantIds, showSeenBy, onBack, hidePatientName, hideOpenCase, onConversationChange, themeMode, showSettings: controlledShowSettings, onSettingsChange, className, style, }: CollabPanelProps): react_jsx_runtime.JSX.Element;
284
308
 
285
309
  interface CollabPopupProps {
286
310
  /** Order ID for this conversation */
@@ -857,30 +881,37 @@ interface PatientHeaderProps {
857
881
  patientData: PatientData;
858
882
  participants: Participant[];
859
883
  onOpenDicom?: () => void;
884
+ /**
885
+ * Open the case behind this conversation — bound to the "Open" button
886
+ * that sits next to "View DICOM". When undefined, the button is
887
+ * hidden.
888
+ */
889
+ onOpenCase?: () => void;
860
890
  onOpenSettings?: () => void;
861
891
  /** When set, renders a back-arrow button (compact inbox returning to list) */
862
892
  onBack?: () => void;
863
- /** Suppress the channel name row — use when the name is already shown in a parent title bar */
893
+ /** Suppress the patient name row — use when the name is already shown in a parent title bar */
864
894
  hideName?: boolean;
865
895
  /** Override the displayed name — use the stored conversation.name to avoid reconstructing from patientData components */
866
896
  displayName?: string;
867
897
  className?: string;
868
898
  }
869
899
  /**
870
- * "Case card" header that sits below the window title bar. Tinted blue-50
871
- * background to set it apart from the conversation body. Renders a row
872
- * of labelled key-value columns (label uppercase on top, value below) for
873
- * the clinical context the host passed in, with the action buttons
874
- * (View DICOM + Settings) right-aligned.
900
+ * Compact case header. One zone, two rows:
901
+ *
902
+ * Row 1: [back?] Patient Name [View DICOM] [Open] [👥 4]
903
+ * Row 2: 54 · M · CT · Knee
904
+ *
905
+ * Replaces the older "case card" layout (labelled meta columns —
906
+ * Age/Sex, Modality, Body part — stacked below the name row). That
907
+ * layout cost ~70-80px of vertical real estate on every chat surface
908
+ * and pushed the message thread further down the panel. This version
909
+ * lands at ~52-60px and conveys the same identifying context inline.
875
910
  *
876
- * Used in two layouts:
877
- * - Popup path (`hideName=true`): the surrounding title bar already
878
- * shows the patient name, so we render the case card only.
879
- * - Compact-inbox path (`hideName=false`): the panel is a full-page
880
- * experience and there's no outer title, so we still show the name +
881
- * back button stacked above the case card.
911
+ * When `hideName=true` (CollabPopup wraps the conversation in its own
912
+ * window title), only the meta + actions row renders.
882
913
  */
883
- declare function PatientHeader({ patientData, participants, onOpenDicom, onOpenSettings, onBack, hideName, displayName, className, }: PatientHeaderProps): react_jsx_runtime.JSX.Element;
914
+ declare function PatientHeader({ patientData, participants, onOpenDicom, onOpenCase, onOpenSettings, onBack, hideName, displayName, className, }: PatientHeaderProps): react_jsx_runtime.JSX.Element;
884
915
 
885
916
  interface MessageListHandle {
886
917
  /** Scroll to a specific message by ID (used by pin jump-to) */
package/dist/index.d.ts CHANGED
@@ -78,6 +78,13 @@ interface CollabConfig {
78
78
  theme?: Theme;
79
79
  /** Host app callbacks — colab calls these, never implements them */
80
80
  onOpenDicom?: (studyId: string, storageId: string) => void;
81
+ /**
82
+ * Open the case behind this conversation. Wired to the package's
83
+ * PatientHeader "Open" button (sibling to "View DICOM"). The host
84
+ * decides how to route — typically role-aware: lab → case page,
85
+ * radiologist → viewer, physician → order history.
86
+ */
87
+ onOpenCase?: (orderId: string, displayOrderId?: string) => void;
81
88
  onUploadFile?: (file: File | Blob, fileName?: string) => Promise<string>;
82
89
  onDeepLink?: (path: string) => void;
83
90
  onError?: (error: CollabError) => void;
@@ -256,6 +263,14 @@ interface CollabPanelProps {
256
263
  onBack?: () => void;
257
264
  /** Hide the patient name row in the header — set when a parent already shows it (e.g. CollabPopup title bar) */
258
265
  hidePatientName?: boolean;
266
+ /**
267
+ * Suppress the PatientHeader "Open" button even when the host has
268
+ * supplied `config.onOpenCase`. Set this when the panel is rendered
269
+ * for the same case the user is already on (e.g. embedded in the
270
+ * viewer's left panel) — otherwise clicking Open would re-fetch the
271
+ * current order and overwrite in-progress context.
272
+ */
273
+ hideOpenCase?: boolean;
259
274
  /**
260
275
  * Notified whenever the underlying conversation state changes (initial
261
276
  * preview load, create, channel deletion). Lets a parent like CollabPopup
@@ -271,6 +286,15 @@ interface CollabPanelProps {
271
286
  * MessageInput, PinnedMessagesBar, etc.) inherits them via cascade.
272
287
  */
273
288
  themeMode?: 'light' | 'dark';
289
+ /**
290
+ * Controlled channel-settings overlay. When both `showSettings` and
291
+ * `onSettingsChange` are provided, the parent (e.g. CollabPopup
292
+ * rendering a settings button in its title bar) owns the open/closed
293
+ * state. When omitted, CollabPanel falls back to its own internal
294
+ * state and surfaces a button via PatientHeader.
295
+ */
296
+ showSettings?: boolean;
297
+ onSettingsChange?: (open: boolean) => void;
274
298
  /** Custom class name for the outer container */
275
299
  className?: string;
276
300
  /** Custom inline styles for the outer container */
@@ -280,7 +304,7 @@ interface CollabPanelProps {
280
304
  * Full collaboration panel: patient header + pinned bar + message thread + input.
281
305
  * Supports reply, pin/unpin, and (optionally) seen-by indicators.
282
306
  */
283
- declare function CollabPanel({ orderId, patientData, participantIds, showSeenBy, onBack, hidePatientName, onConversationChange, themeMode, className, style, }: CollabPanelProps): react_jsx_runtime.JSX.Element;
307
+ declare function CollabPanel({ orderId, patientData, participantIds, showSeenBy, onBack, hidePatientName, hideOpenCase, onConversationChange, themeMode, showSettings: controlledShowSettings, onSettingsChange, className, style, }: CollabPanelProps): react_jsx_runtime.JSX.Element;
284
308
 
285
309
  interface CollabPopupProps {
286
310
  /** Order ID for this conversation */
@@ -857,30 +881,37 @@ interface PatientHeaderProps {
857
881
  patientData: PatientData;
858
882
  participants: Participant[];
859
883
  onOpenDicom?: () => void;
884
+ /**
885
+ * Open the case behind this conversation — bound to the "Open" button
886
+ * that sits next to "View DICOM". When undefined, the button is
887
+ * hidden.
888
+ */
889
+ onOpenCase?: () => void;
860
890
  onOpenSettings?: () => void;
861
891
  /** When set, renders a back-arrow button (compact inbox returning to list) */
862
892
  onBack?: () => void;
863
- /** Suppress the channel name row — use when the name is already shown in a parent title bar */
893
+ /** Suppress the patient name row — use when the name is already shown in a parent title bar */
864
894
  hideName?: boolean;
865
895
  /** Override the displayed name — use the stored conversation.name to avoid reconstructing from patientData components */
866
896
  displayName?: string;
867
897
  className?: string;
868
898
  }
869
899
  /**
870
- * "Case card" header that sits below the window title bar. Tinted blue-50
871
- * background to set it apart from the conversation body. Renders a row
872
- * of labelled key-value columns (label uppercase on top, value below) for
873
- * the clinical context the host passed in, with the action buttons
874
- * (View DICOM + Settings) right-aligned.
900
+ * Compact case header. One zone, two rows:
901
+ *
902
+ * Row 1: [back?] Patient Name [View DICOM] [Open] [👥 4]
903
+ * Row 2: 54 · M · CT · Knee
904
+ *
905
+ * Replaces the older "case card" layout (labelled meta columns —
906
+ * Age/Sex, Modality, Body part — stacked below the name row). That
907
+ * layout cost ~70-80px of vertical real estate on every chat surface
908
+ * and pushed the message thread further down the panel. This version
909
+ * lands at ~52-60px and conveys the same identifying context inline.
875
910
  *
876
- * Used in two layouts:
877
- * - Popup path (`hideName=true`): the surrounding title bar already
878
- * shows the patient name, so we render the case card only.
879
- * - Compact-inbox path (`hideName=false`): the panel is a full-page
880
- * experience and there's no outer title, so we still show the name +
881
- * back button stacked above the case card.
911
+ * When `hideName=true` (CollabPopup wraps the conversation in its own
912
+ * window title), only the meta + actions row renders.
882
913
  */
883
- declare function PatientHeader({ patientData, participants, onOpenDicom, onOpenSettings, onBack, hideName, displayName, className, }: PatientHeaderProps): react_jsx_runtime.JSX.Element;
914
+ declare function PatientHeader({ patientData, participants, onOpenDicom, onOpenCase, onOpenSettings, onBack, hideName, displayName, className, }: PatientHeaderProps): react_jsx_runtime.JSX.Element;
884
915
 
885
916
  interface MessageListHandle {
886
917
  /** Scroll to a specific message by ID (used by pin jump-to) */