@natoe/colab 0.1.5 → 0.1.7

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
@@ -141,9 +141,9 @@ interface Message {
141
141
  interface SendMessagePayload {
142
142
  body: string;
143
143
  type: MessageType;
144
- mediaUrl?: string;
145
- mediaDuration?: number;
146
- fileName?: string;
144
+ media_url?: string;
145
+ media_duration?: number;
146
+ file_name?: string;
147
147
  metadata?: Record<string, unknown>;
148
148
  /** ID of message being replied to (snapshot is built server-side) */
149
149
  replyToId?: string;
@@ -178,6 +178,11 @@ interface CollabPanelProps {
178
178
  participantIds?: string[];
179
179
  /** Show "seen by" indicator under own messages (default true) */
180
180
  showSeenBy?: boolean;
181
+ /**
182
+ * When set, the header renders a back-arrow button (used by CollabInbox in
183
+ * its compact / single-pane layout to return to the conversation list).
184
+ */
185
+ onBack?: () => void;
181
186
  /** Custom class name for the outer container */
182
187
  className?: string;
183
188
  /** Custom inline styles for the outer container */
@@ -187,7 +192,7 @@ interface CollabPanelProps {
187
192
  * Full collaboration panel: patient header + pinned bar + message thread + input.
188
193
  * Supports reply, pin/unpin, and (optionally) seen-by indicators.
189
194
  */
190
- declare function CollabPanel({ orderId, patientData, participantIds, showSeenBy, className, style, }: CollabPanelProps): react_jsx_runtime.JSX.Element;
195
+ declare function CollabPanel({ orderId, patientData, participantIds, showSeenBy, onBack, className, style, }: CollabPanelProps): react_jsx_runtime.JSX.Element;
191
196
 
192
197
  interface CollabPopupProps {
193
198
  /** Order ID for this conversation */
@@ -200,6 +205,8 @@ interface CollabPopupProps {
200
205
  isOpen: boolean;
201
206
  /** Close the popup */
202
207
  onClose: () => void;
208
+ /** Optional back navigation — renders a ← button in the title bar when provided */
209
+ onBack?: () => void;
203
210
  /** Initial position (defaults to bottom-right) */
204
211
  initialPosition?: {
205
212
  x: number;
@@ -215,7 +222,7 @@ interface CollabPopupProps {
215
222
  * Draggable floating chat popup — drop-in replacement for DraggableChatPopup.
216
223
  * Renders a CollabPanel inside a movable, resizable container.
217
224
  */
218
- declare function CollabPopup({ orderId, patientData, participantIds, isOpen, onClose, initialPosition, width, height, className, }: CollabPopupProps): react_jsx_runtime.JSX.Element | null;
225
+ declare function CollabPopup({ orderId, patientData, participantIds, isOpen, onClose, onBack, initialPosition, width, height, className, }: CollabPopupProps): react_jsx_runtime.JSX.Element | null;
219
226
 
220
227
  interface CollabInlineProps {
221
228
  orderId: string;
@@ -659,9 +666,11 @@ interface PatientHeaderProps {
659
666
  participants: Participant[];
660
667
  onOpenDicom?: () => void;
661
668
  onOpenSettings?: () => void;
669
+ /** When set, renders a back-arrow button (compact inbox returning to list) */
670
+ onBack?: () => void;
662
671
  className?: string;
663
672
  }
664
- declare function PatientHeader({ patientData, onOpenDicom, onOpenSettings, className, }: PatientHeaderProps): react_jsx_runtime.JSX.Element;
673
+ declare function PatientHeader({ patientData, onOpenDicom, onOpenSettings, onBack, className, }: PatientHeaderProps): react_jsx_runtime.JSX.Element;
665
674
 
666
675
  interface MessageListHandle {
667
676
  /** Scroll to a specific message by ID (used by pin jump-to) */
@@ -736,18 +745,17 @@ interface MessageActionsMenuProps {
736
745
  onCopy?: (text: string) => void;
737
746
  /** Whether we've hit the pin limit — if true, pin is disabled */
738
747
  pinDisabled?: boolean;
739
- /** Anchor the popover to the left of the trigger (use for own bubbles) */
748
+ /** Anchor the popover to the right edge of the trigger (use for messages on the left side of the panel) */
740
749
  anchorRight?: boolean;
741
750
  className?: string;
742
751
  }
743
752
  /**
744
- * Self-contained "⋯" trigger + popover for per-message actions. Replaces
745
- * the previous hover-only floating menu so touch users (and anyone with
746
- * a non-pointer device) can reach Reply / Pin / Copy.
753
+ * Self-contained "⋯" trigger + popover for per-message actions. The menu is
754
+ * rendered into a portal on document.body and positioned via getBoundingClientRect,
755
+ * so it escapes any ancestor overflow:hidden (the floating CollabPopup
756
+ * container) and flips above the trigger when there's no room below.
747
757
  *
748
- * Menu rows are icon + text so the affordance reads cold; the trigger is
749
- * a 36px tap target. Closes on outside-click, Escape, or after selecting
750
- * an action.
758
+ * Closes on outside-click, Escape, window resize, or scroll outside the menu.
751
759
  */
752
760
  declare function MessageActionsMenu({ message, onReply, onPin, onUnpin, onCopy, pinDisabled, anchorRight, className, }: MessageActionsMenuProps): react_jsx_runtime.JSX.Element;
753
761
 
package/dist/index.d.ts CHANGED
@@ -141,9 +141,9 @@ interface Message {
141
141
  interface SendMessagePayload {
142
142
  body: string;
143
143
  type: MessageType;
144
- mediaUrl?: string;
145
- mediaDuration?: number;
146
- fileName?: string;
144
+ media_url?: string;
145
+ media_duration?: number;
146
+ file_name?: string;
147
147
  metadata?: Record<string, unknown>;
148
148
  /** ID of message being replied to (snapshot is built server-side) */
149
149
  replyToId?: string;
@@ -178,6 +178,11 @@ interface CollabPanelProps {
178
178
  participantIds?: string[];
179
179
  /** Show "seen by" indicator under own messages (default true) */
180
180
  showSeenBy?: boolean;
181
+ /**
182
+ * When set, the header renders a back-arrow button (used by CollabInbox in
183
+ * its compact / single-pane layout to return to the conversation list).
184
+ */
185
+ onBack?: () => void;
181
186
  /** Custom class name for the outer container */
182
187
  className?: string;
183
188
  /** Custom inline styles for the outer container */
@@ -187,7 +192,7 @@ interface CollabPanelProps {
187
192
  * Full collaboration panel: patient header + pinned bar + message thread + input.
188
193
  * Supports reply, pin/unpin, and (optionally) seen-by indicators.
189
194
  */
190
- declare function CollabPanel({ orderId, patientData, participantIds, showSeenBy, className, style, }: CollabPanelProps): react_jsx_runtime.JSX.Element;
195
+ declare function CollabPanel({ orderId, patientData, participantIds, showSeenBy, onBack, className, style, }: CollabPanelProps): react_jsx_runtime.JSX.Element;
191
196
 
192
197
  interface CollabPopupProps {
193
198
  /** Order ID for this conversation */
@@ -200,6 +205,8 @@ interface CollabPopupProps {
200
205
  isOpen: boolean;
201
206
  /** Close the popup */
202
207
  onClose: () => void;
208
+ /** Optional back navigation — renders a ← button in the title bar when provided */
209
+ onBack?: () => void;
203
210
  /** Initial position (defaults to bottom-right) */
204
211
  initialPosition?: {
205
212
  x: number;
@@ -215,7 +222,7 @@ interface CollabPopupProps {
215
222
  * Draggable floating chat popup — drop-in replacement for DraggableChatPopup.
216
223
  * Renders a CollabPanel inside a movable, resizable container.
217
224
  */
218
- declare function CollabPopup({ orderId, patientData, participantIds, isOpen, onClose, initialPosition, width, height, className, }: CollabPopupProps): react_jsx_runtime.JSX.Element | null;
225
+ declare function CollabPopup({ orderId, patientData, participantIds, isOpen, onClose, onBack, initialPosition, width, height, className, }: CollabPopupProps): react_jsx_runtime.JSX.Element | null;
219
226
 
220
227
  interface CollabInlineProps {
221
228
  orderId: string;
@@ -659,9 +666,11 @@ interface PatientHeaderProps {
659
666
  participants: Participant[];
660
667
  onOpenDicom?: () => void;
661
668
  onOpenSettings?: () => void;
669
+ /** When set, renders a back-arrow button (compact inbox returning to list) */
670
+ onBack?: () => void;
662
671
  className?: string;
663
672
  }
664
- declare function PatientHeader({ patientData, onOpenDicom, onOpenSettings, className, }: PatientHeaderProps): react_jsx_runtime.JSX.Element;
673
+ declare function PatientHeader({ patientData, onOpenDicom, onOpenSettings, onBack, className, }: PatientHeaderProps): react_jsx_runtime.JSX.Element;
665
674
 
666
675
  interface MessageListHandle {
667
676
  /** Scroll to a specific message by ID (used by pin jump-to) */
@@ -736,18 +745,17 @@ interface MessageActionsMenuProps {
736
745
  onCopy?: (text: string) => void;
737
746
  /** Whether we've hit the pin limit — if true, pin is disabled */
738
747
  pinDisabled?: boolean;
739
- /** Anchor the popover to the left of the trigger (use for own bubbles) */
748
+ /** Anchor the popover to the right edge of the trigger (use for messages on the left side of the panel) */
740
749
  anchorRight?: boolean;
741
750
  className?: string;
742
751
  }
743
752
  /**
744
- * Self-contained "⋯" trigger + popover for per-message actions. Replaces
745
- * the previous hover-only floating menu so touch users (and anyone with
746
- * a non-pointer device) can reach Reply / Pin / Copy.
753
+ * Self-contained "⋯" trigger + popover for per-message actions. The menu is
754
+ * rendered into a portal on document.body and positioned via getBoundingClientRect,
755
+ * so it escapes any ancestor overflow:hidden (the floating CollabPopup
756
+ * container) and flips above the trigger when there's no room below.
747
757
  *
748
- * Menu rows are icon + text so the affordance reads cold; the trigger is
749
- * a 36px tap target. Closes on outside-click, Escape, or after selecting
750
- * an action.
758
+ * Closes on outside-click, Escape, window resize, or scroll outside the menu.
751
759
  */
752
760
  declare function MessageActionsMenu({ message, onReply, onPin, onUnpin, onCopy, pinDisabled, anchorRight, className, }: MessageActionsMenuProps): react_jsx_runtime.JSX.Element;
753
761