@natoe/colab 0.1.16 → 0.1.17

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
@@ -280,7 +295,7 @@ interface CollabPanelProps {
280
295
  * Full collaboration panel: patient header + pinned bar + message thread + input.
281
296
  * Supports reply, pin/unpin, and (optionally) seen-by indicators.
282
297
  */
283
- declare function CollabPanel({ orderId, patientData, participantIds, showSeenBy, onBack, hidePatientName, onConversationChange, themeMode, className, style, }: CollabPanelProps): react_jsx_runtime.JSX.Element;
298
+ declare function CollabPanel({ orderId, patientData, participantIds, showSeenBy, onBack, hidePatientName, hideOpenCase, onConversationChange, themeMode, className, style, }: CollabPanelProps): react_jsx_runtime.JSX.Element;
284
299
 
285
300
  interface CollabPopupProps {
286
301
  /** Order ID for this conversation */
@@ -857,30 +872,37 @@ interface PatientHeaderProps {
857
872
  patientData: PatientData;
858
873
  participants: Participant[];
859
874
  onOpenDicom?: () => void;
875
+ /**
876
+ * Open the case behind this conversation — bound to the "Open" button
877
+ * that sits next to "View DICOM". When undefined, the button is
878
+ * hidden.
879
+ */
880
+ onOpenCase?: () => void;
860
881
  onOpenSettings?: () => void;
861
882
  /** When set, renders a back-arrow button (compact inbox returning to list) */
862
883
  onBack?: () => void;
863
- /** Suppress the channel name row — use when the name is already shown in a parent title bar */
884
+ /** Suppress the patient name row — use when the name is already shown in a parent title bar */
864
885
  hideName?: boolean;
865
886
  /** Override the displayed name — use the stored conversation.name to avoid reconstructing from patientData components */
866
887
  displayName?: string;
867
888
  className?: string;
868
889
  }
869
890
  /**
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.
891
+ * Compact case header. One zone, two rows:
892
+ *
893
+ * Row 1: [back?] Patient Name [View DICOM] [Open] [👥 4]
894
+ * Row 2: 54 · M · CT · Knee
895
+ *
896
+ * Replaces the older "case card" layout (labelled meta columns —
897
+ * Age/Sex, Modality, Body part — stacked below the name row). That
898
+ * layout cost ~70-80px of vertical real estate on every chat surface
899
+ * and pushed the message thread further down the panel. This version
900
+ * lands at ~52-60px and conveys the same identifying context inline.
875
901
  *
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.
902
+ * When `hideName=true` (CollabPopup wraps the conversation in its own
903
+ * window title), only the meta + actions row renders.
882
904
  */
883
- declare function PatientHeader({ patientData, participants, onOpenDicom, onOpenSettings, onBack, hideName, displayName, className, }: PatientHeaderProps): react_jsx_runtime.JSX.Element;
905
+ declare function PatientHeader({ patientData, participants, onOpenDicom, onOpenCase, onOpenSettings, onBack, hideName, displayName, className, }: PatientHeaderProps): react_jsx_runtime.JSX.Element;
884
906
 
885
907
  interface MessageListHandle {
886
908
  /** 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
@@ -280,7 +295,7 @@ interface CollabPanelProps {
280
295
  * Full collaboration panel: patient header + pinned bar + message thread + input.
281
296
  * Supports reply, pin/unpin, and (optionally) seen-by indicators.
282
297
  */
283
- declare function CollabPanel({ orderId, patientData, participantIds, showSeenBy, onBack, hidePatientName, onConversationChange, themeMode, className, style, }: CollabPanelProps): react_jsx_runtime.JSX.Element;
298
+ declare function CollabPanel({ orderId, patientData, participantIds, showSeenBy, onBack, hidePatientName, hideOpenCase, onConversationChange, themeMode, className, style, }: CollabPanelProps): react_jsx_runtime.JSX.Element;
284
299
 
285
300
  interface CollabPopupProps {
286
301
  /** Order ID for this conversation */
@@ -857,30 +872,37 @@ interface PatientHeaderProps {
857
872
  patientData: PatientData;
858
873
  participants: Participant[];
859
874
  onOpenDicom?: () => void;
875
+ /**
876
+ * Open the case behind this conversation — bound to the "Open" button
877
+ * that sits next to "View DICOM". When undefined, the button is
878
+ * hidden.
879
+ */
880
+ onOpenCase?: () => void;
860
881
  onOpenSettings?: () => void;
861
882
  /** When set, renders a back-arrow button (compact inbox returning to list) */
862
883
  onBack?: () => void;
863
- /** Suppress the channel name row — use when the name is already shown in a parent title bar */
884
+ /** Suppress the patient name row — use when the name is already shown in a parent title bar */
864
885
  hideName?: boolean;
865
886
  /** Override the displayed name — use the stored conversation.name to avoid reconstructing from patientData components */
866
887
  displayName?: string;
867
888
  className?: string;
868
889
  }
869
890
  /**
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.
891
+ * Compact case header. One zone, two rows:
892
+ *
893
+ * Row 1: [back?] Patient Name [View DICOM] [Open] [👥 4]
894
+ * Row 2: 54 · M · CT · Knee
895
+ *
896
+ * Replaces the older "case card" layout (labelled meta columns —
897
+ * Age/Sex, Modality, Body part — stacked below the name row). That
898
+ * layout cost ~70-80px of vertical real estate on every chat surface
899
+ * and pushed the message thread further down the panel. This version
900
+ * lands at ~52-60px and conveys the same identifying context inline.
875
901
  *
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.
902
+ * When `hideName=true` (CollabPopup wraps the conversation in its own
903
+ * window title), only the meta + actions row renders.
882
904
  */
883
- declare function PatientHeader({ patientData, participants, onOpenDicom, onOpenSettings, onBack, hideName, displayName, className, }: PatientHeaderProps): react_jsx_runtime.JSX.Element;
905
+ declare function PatientHeader({ patientData, participants, onOpenDicom, onOpenCase, onOpenSettings, onBack, hideName, displayName, className, }: PatientHeaderProps): react_jsx_runtime.JSX.Element;
884
906
 
885
907
  interface MessageListHandle {
886
908
  /** Scroll to a specific message by ID (used by pin jump-to) */