@natoe/colab 0.1.3 → 0.1.5
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 +24 -6
- package/dist/index.d.ts +24 -6
- package/dist/index.js +687 -245
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +688 -246
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -130,6 +130,13 @@ interface Message {
|
|
|
130
130
|
isPinned?: boolean;
|
|
131
131
|
pinnedAt?: string;
|
|
132
132
|
pinnedBy?: string;
|
|
133
|
+
/**
|
|
134
|
+
* Client-side delivery status for optimistically-sent messages.
|
|
135
|
+
* - undefined: a real, server-persisted message
|
|
136
|
+
* - 'sending': optimistic, awaiting socket round-trip
|
|
137
|
+
* - 'failed': socket send threw; user can retry
|
|
138
|
+
*/
|
|
139
|
+
status?: 'sending' | 'failed';
|
|
133
140
|
}
|
|
134
141
|
interface SendMessagePayload {
|
|
135
142
|
body: string;
|
|
@@ -402,6 +409,8 @@ interface UseConversationReturn {
|
|
|
402
409
|
/** Set/clear the active reply target */
|
|
403
410
|
setReplyTo: (message: Message | null) => void;
|
|
404
411
|
sendMessage: (body: string) => Promise<void>;
|
|
412
|
+
/** Re-attempt sending a previously-failed optimistic text message */
|
|
413
|
+
retryMessage: (messageId: string) => Promise<void>;
|
|
405
414
|
sendAudioMessage: (audioBlob: Blob, duration: number) => Promise<void>;
|
|
406
415
|
sendFileMessage: (file: File) => Promise<void>;
|
|
407
416
|
sendDeepLink: (path: string, label: string) => Promise<void>;
|
|
@@ -673,6 +682,8 @@ interface MessageListProps {
|
|
|
673
682
|
onPin?: (messageId: string) => void;
|
|
674
683
|
onUnpin?: (messageId: string) => void;
|
|
675
684
|
onCopy?: (text: string) => void;
|
|
685
|
+
/** Retry a failed message (own bubbles only) */
|
|
686
|
+
onRetry?: (messageId: string) => void;
|
|
676
687
|
pinDisabled?: boolean;
|
|
677
688
|
className?: string;
|
|
678
689
|
}
|
|
@@ -693,11 +704,13 @@ interface MessageBubbleProps {
|
|
|
693
704
|
onUnpin?: (messageId: string) => void;
|
|
694
705
|
onCopy?: (text: string) => void;
|
|
695
706
|
onReplyJumpTo?: (messageId: string) => void;
|
|
707
|
+
/** Re-send a previously-failed message (own bubbles only) */
|
|
708
|
+
onRetry?: (messageId: string) => void;
|
|
696
709
|
/** True if pin limit reached — disables pin action */
|
|
697
710
|
pinDisabled?: boolean;
|
|
698
711
|
className?: string;
|
|
699
712
|
}
|
|
700
|
-
declare function MessageBubble({ message, isOwn, participants, currentUserId, showSeenBy, onDeepLinkClick, onReply, onPin, onUnpin, onCopy, onReplyJumpTo, pinDisabled, className, }: MessageBubbleProps): react_jsx_runtime.JSX.Element;
|
|
713
|
+
declare function MessageBubble({ message, isOwn, participants, currentUserId, showSeenBy, onDeepLinkClick, onReply, onPin, onUnpin, onCopy, onReplyJumpTo, onRetry, pinDisabled, className, }: MessageBubbleProps): react_jsx_runtime.JSX.Element;
|
|
701
714
|
|
|
702
715
|
interface MessageInputProps {
|
|
703
716
|
onSendText: (body: string) => Promise<void>;
|
|
@@ -721,17 +734,22 @@ interface MessageActionsMenuProps {
|
|
|
721
734
|
onPin: (messageId: string) => void;
|
|
722
735
|
onUnpin: (messageId: string) => void;
|
|
723
736
|
onCopy?: (text: string) => void;
|
|
724
|
-
/** True when the menu should show (hover / open state managed by parent) */
|
|
725
|
-
visible: boolean;
|
|
726
737
|
/** Whether we've hit the pin limit — if true, pin is disabled */
|
|
727
738
|
pinDisabled?: boolean;
|
|
739
|
+
/** Anchor the popover to the left of the trigger (use for own bubbles) */
|
|
740
|
+
anchorRight?: boolean;
|
|
728
741
|
className?: string;
|
|
729
742
|
}
|
|
730
743
|
/**
|
|
731
|
-
*
|
|
732
|
-
*
|
|
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.
|
|
747
|
+
*
|
|
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.
|
|
733
751
|
*/
|
|
734
|
-
declare function MessageActionsMenu({ message, onReply, onPin, onUnpin, onCopy,
|
|
752
|
+
declare function MessageActionsMenu({ message, onReply, onPin, onUnpin, onCopy, pinDisabled, anchorRight, className, }: MessageActionsMenuProps): react_jsx_runtime.JSX.Element;
|
|
735
753
|
|
|
736
754
|
interface ReplyPreviewProps {
|
|
737
755
|
/** The message being replied to */
|
package/dist/index.d.ts
CHANGED
|
@@ -130,6 +130,13 @@ interface Message {
|
|
|
130
130
|
isPinned?: boolean;
|
|
131
131
|
pinnedAt?: string;
|
|
132
132
|
pinnedBy?: string;
|
|
133
|
+
/**
|
|
134
|
+
* Client-side delivery status for optimistically-sent messages.
|
|
135
|
+
* - undefined: a real, server-persisted message
|
|
136
|
+
* - 'sending': optimistic, awaiting socket round-trip
|
|
137
|
+
* - 'failed': socket send threw; user can retry
|
|
138
|
+
*/
|
|
139
|
+
status?: 'sending' | 'failed';
|
|
133
140
|
}
|
|
134
141
|
interface SendMessagePayload {
|
|
135
142
|
body: string;
|
|
@@ -402,6 +409,8 @@ interface UseConversationReturn {
|
|
|
402
409
|
/** Set/clear the active reply target */
|
|
403
410
|
setReplyTo: (message: Message | null) => void;
|
|
404
411
|
sendMessage: (body: string) => Promise<void>;
|
|
412
|
+
/** Re-attempt sending a previously-failed optimistic text message */
|
|
413
|
+
retryMessage: (messageId: string) => Promise<void>;
|
|
405
414
|
sendAudioMessage: (audioBlob: Blob, duration: number) => Promise<void>;
|
|
406
415
|
sendFileMessage: (file: File) => Promise<void>;
|
|
407
416
|
sendDeepLink: (path: string, label: string) => Promise<void>;
|
|
@@ -673,6 +682,8 @@ interface MessageListProps {
|
|
|
673
682
|
onPin?: (messageId: string) => void;
|
|
674
683
|
onUnpin?: (messageId: string) => void;
|
|
675
684
|
onCopy?: (text: string) => void;
|
|
685
|
+
/** Retry a failed message (own bubbles only) */
|
|
686
|
+
onRetry?: (messageId: string) => void;
|
|
676
687
|
pinDisabled?: boolean;
|
|
677
688
|
className?: string;
|
|
678
689
|
}
|
|
@@ -693,11 +704,13 @@ interface MessageBubbleProps {
|
|
|
693
704
|
onUnpin?: (messageId: string) => void;
|
|
694
705
|
onCopy?: (text: string) => void;
|
|
695
706
|
onReplyJumpTo?: (messageId: string) => void;
|
|
707
|
+
/** Re-send a previously-failed message (own bubbles only) */
|
|
708
|
+
onRetry?: (messageId: string) => void;
|
|
696
709
|
/** True if pin limit reached — disables pin action */
|
|
697
710
|
pinDisabled?: boolean;
|
|
698
711
|
className?: string;
|
|
699
712
|
}
|
|
700
|
-
declare function MessageBubble({ message, isOwn, participants, currentUserId, showSeenBy, onDeepLinkClick, onReply, onPin, onUnpin, onCopy, onReplyJumpTo, pinDisabled, className, }: MessageBubbleProps): react_jsx_runtime.JSX.Element;
|
|
713
|
+
declare function MessageBubble({ message, isOwn, participants, currentUserId, showSeenBy, onDeepLinkClick, onReply, onPin, onUnpin, onCopy, onReplyJumpTo, onRetry, pinDisabled, className, }: MessageBubbleProps): react_jsx_runtime.JSX.Element;
|
|
701
714
|
|
|
702
715
|
interface MessageInputProps {
|
|
703
716
|
onSendText: (body: string) => Promise<void>;
|
|
@@ -721,17 +734,22 @@ interface MessageActionsMenuProps {
|
|
|
721
734
|
onPin: (messageId: string) => void;
|
|
722
735
|
onUnpin: (messageId: string) => void;
|
|
723
736
|
onCopy?: (text: string) => void;
|
|
724
|
-
/** True when the menu should show (hover / open state managed by parent) */
|
|
725
|
-
visible: boolean;
|
|
726
737
|
/** Whether we've hit the pin limit — if true, pin is disabled */
|
|
727
738
|
pinDisabled?: boolean;
|
|
739
|
+
/** Anchor the popover to the left of the trigger (use for own bubbles) */
|
|
740
|
+
anchorRight?: boolean;
|
|
728
741
|
className?: string;
|
|
729
742
|
}
|
|
730
743
|
/**
|
|
731
|
-
*
|
|
732
|
-
*
|
|
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.
|
|
747
|
+
*
|
|
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.
|
|
733
751
|
*/
|
|
734
|
-
declare function MessageActionsMenu({ message, onReply, onPin, onUnpin, onCopy,
|
|
752
|
+
declare function MessageActionsMenu({ message, onReply, onPin, onUnpin, onCopy, pinDisabled, anchorRight, className, }: MessageActionsMenuProps): react_jsx_runtime.JSX.Element;
|
|
735
753
|
|
|
736
754
|
interface ReplyPreviewProps {
|
|
737
755
|
/** The message being replied to */
|