@droppii-org/chat-mobile 0.2.66 → 0.2.68
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/lib/module/components/Avatar/Avatar.js +39 -2
- package/lib/module/components/Avatar/Avatar.js.map +1 -1
- package/lib/module/components/Avatar/DoubleAvatar.js +18 -18
- package/lib/module/components/Avatar/DoubleAvatar.js.map +1 -1
- package/lib/module/components/Avatar/QuadAvatar.js +131 -0
- package/lib/module/components/Avatar/QuadAvatar.js.map +1 -0
- package/lib/module/components/Avatar/TripleAvatar.js +97 -0
- package/lib/module/components/Avatar/TripleAvatar.js.map +1 -0
- package/lib/module/components/Avatar/index.js +2 -0
- package/lib/module/components/Avatar/index.js.map +1 -1
- package/lib/module/components/ThreadCard/AvatarSection.js +41 -0
- package/lib/module/components/ThreadCard/AvatarSection.js.map +1 -1
- package/lib/module/components/ThreadCard/NamePrefixIcon.js +5 -4
- package/lib/module/components/ThreadCard/NamePrefixIcon.js.map +1 -1
- package/lib/module/components/ThreadCard/ThreadCard.js +3 -1
- package/lib/module/components/ThreadCard/ThreadCard.js.map +1 -1
- package/lib/module/components/messages/groupNotificationMessage/index.js +25 -0
- package/lib/module/components/messages/groupNotificationMessage/index.js.map +1 -0
- package/lib/module/context/ChatContext.js +1 -1
- package/lib/module/context/ChatContext.js.map +1 -1
- package/lib/module/context/ChatDetailContext.js +9 -0
- package/lib/module/context/ChatDetailContext.js.map +1 -1
- package/lib/module/core/useChatListener.js +121 -21
- package/lib/module/core/useChatListener.js.map +1 -1
- package/lib/module/hooks/conversation/useGetGroupInfo.js +3 -1
- package/lib/module/hooks/conversation/useGetGroupInfo.js.map +1 -1
- package/lib/module/hooks/message/usePinMessage.js +4 -2
- package/lib/module/hooks/message/usePinMessage.js.map +1 -1
- package/lib/module/hooks/message/useSendMessage.js +13 -15
- package/lib/module/hooks/message/useSendMessage.js.map +1 -1
- package/lib/module/hooks/useConversationList.js +9 -4
- package/lib/module/hooks/useConversationList.js.map +1 -1
- package/lib/module/hooks/useGroupPermission.js +34 -0
- package/lib/module/hooks/useGroupPermission.js.map +1 -0
- package/lib/module/screens/ChatInfo/ChatInfoProfile.js +4 -2
- package/lib/module/screens/ChatInfo/ChatInfoProfile.js.map +1 -1
- package/lib/module/screens/chat-detail/ChatComposer.js +16 -18
- package/lib/module/screens/chat-detail/ChatComposer.js.map +1 -1
- package/lib/module/screens/chat-detail/ChatDetail.js +7 -0
- package/lib/module/screens/chat-detail/ChatDetail.js.map +1 -1
- package/lib/module/screens/chat-detail/ChatDetailHeader.js +10 -3
- package/lib/module/screens/chat-detail/ChatDetailHeader.js.map +1 -1
- package/lib/module/screens/chat-detail/conversationHeader.utils.js +13 -3
- package/lib/module/screens/chat-detail/conversationHeader.utils.js.map +1 -1
- package/lib/module/screens/chat-detail/legend/LegendChatMessage.js +29 -2
- package/lib/module/screens/chat-detail/legend/LegendChatMessage.js.map +1 -1
- package/lib/module/screens/chat-detail/messageToolbox/MessageToolboxOverlay.js +5 -0
- package/lib/module/screens/chat-detail/messageToolbox/MessageToolboxOverlay.js.map +1 -1
- package/lib/module/screens/inbox/MessagesTab.js.map +1 -1
- package/lib/module/store/conversation.js +56 -12
- package/lib/module/store/conversation.js.map +1 -1
- package/lib/module/translation/resources/i18n.js +32 -0
- package/lib/module/translation/resources/i18n.js.map +1 -1
- package/lib/module/types/events.js +1 -0
- package/lib/module/types/events.js.map +1 -1
- package/lib/module/utils/messageUtils.js +95 -2
- package/lib/module/utils/messageUtils.js.map +1 -1
- package/lib/typescript/src/components/Avatar/Avatar.d.ts +1 -1
- package/lib/typescript/src/components/Avatar/Avatar.d.ts.map +1 -1
- package/lib/typescript/src/components/Avatar/Avatar.types.d.ts +5 -1
- package/lib/typescript/src/components/Avatar/Avatar.types.d.ts.map +1 -1
- package/lib/typescript/src/components/Avatar/DoubleAvatar.d.ts.map +1 -1
- package/lib/typescript/src/components/Avatar/QuadAvatar.d.ts +16 -0
- package/lib/typescript/src/components/Avatar/QuadAvatar.d.ts.map +1 -0
- package/lib/typescript/src/components/Avatar/TripleAvatar.d.ts +15 -0
- package/lib/typescript/src/components/Avatar/TripleAvatar.d.ts.map +1 -0
- package/lib/typescript/src/components/Avatar/index.d.ts +2 -0
- package/lib/typescript/src/components/Avatar/index.d.ts.map +1 -1
- package/lib/typescript/src/components/ThreadCard/AvatarSection.d.ts +2 -2
- package/lib/typescript/src/components/ThreadCard/AvatarSection.d.ts.map +1 -1
- package/lib/typescript/src/components/ThreadCard/NamePrefixIcon.d.ts +3 -1
- package/lib/typescript/src/components/ThreadCard/NamePrefixIcon.d.ts.map +1 -1
- package/lib/typescript/src/components/ThreadCard/ThreadCard.d.ts.map +1 -1
- package/lib/typescript/src/components/messages/groupNotificationMessage/index.d.ts +3 -0
- package/lib/typescript/src/components/messages/groupNotificationMessage/index.d.ts.map +1 -0
- package/lib/typescript/src/context/ChatDetailContext.d.ts +2 -0
- package/lib/typescript/src/context/ChatDetailContext.d.ts.map +1 -1
- package/lib/typescript/src/core/useChatListener.d.ts.map +1 -1
- package/lib/typescript/src/hooks/conversation/useGetGroupInfo.d.ts.map +1 -1
- package/lib/typescript/src/hooks/message/usePinMessage.d.ts.map +1 -1
- package/lib/typescript/src/hooks/message/useSendMessage.d.ts.map +1 -1
- package/lib/typescript/src/hooks/useConversationList.d.ts.map +1 -1
- package/lib/typescript/src/hooks/useGroupPermission.d.ts +6 -0
- package/lib/typescript/src/hooks/useGroupPermission.d.ts.map +1 -0
- package/lib/typescript/src/screens/ChatInfo/ChatInfoProfile.d.ts.map +1 -1
- package/lib/typescript/src/screens/chat-detail/ChatComposer.d.ts.map +1 -1
- package/lib/typescript/src/screens/chat-detail/ChatDetail.d.ts.map +1 -1
- package/lib/typescript/src/screens/chat-detail/ChatDetailHeader.d.ts.map +1 -1
- package/lib/typescript/src/screens/chat-detail/conversationHeader.utils.d.ts +1 -1
- package/lib/typescript/src/screens/chat-detail/conversationHeader.utils.d.ts.map +1 -1
- package/lib/typescript/src/screens/chat-detail/legend/LegendChatMessage.d.ts.map +1 -1
- package/lib/typescript/src/screens/chat-detail/messageToolbox/MessageToolboxOverlay.d.ts +1 -1
- package/lib/typescript/src/screens/chat-detail/messageToolbox/MessageToolboxOverlay.d.ts.map +1 -1
- package/lib/typescript/src/screens/inbox/MessagesTab.d.ts.map +1 -1
- package/lib/typescript/src/store/conversation.d.ts +11 -0
- package/lib/typescript/src/store/conversation.d.ts.map +1 -1
- package/lib/typescript/src/translation/resources/i18n.d.ts.map +1 -1
- package/lib/typescript/src/types/events.d.ts +6 -1
- package/lib/typescript/src/types/events.d.ts.map +1 -1
- package/lib/typescript/src/utils/messageUtils.d.ts +6 -1
- package/lib/typescript/src/utils/messageUtils.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/build-ignore.d.ts +1 -0
- package/src/components/Avatar/Avatar.tsx +47 -0
- package/src/components/Avatar/Avatar.types.ts +5 -1
- package/src/components/Avatar/DoubleAvatar.tsx +16 -13
- package/src/components/Avatar/QuadAvatar.tsx +161 -0
- package/src/components/Avatar/TripleAvatar.tsx +119 -0
- package/src/components/Avatar/index.ts +2 -0
- package/src/components/ThreadCard/AvatarSection.tsx +58 -2
- package/src/components/ThreadCard/NamePrefixIcon.tsx +32 -25
- package/src/components/ThreadCard/ThreadCard.tsx +2 -0
- package/src/components/messages/groupNotificationMessage/index.tsx +28 -0
- package/src/context/ChatContext.tsx +1 -1
- package/src/context/ChatDetailContext.tsx +15 -0
- package/src/core/useChatListener.ts +176 -23
- package/src/hooks/conversation/useGetGroupInfo.ts +2 -0
- package/src/hooks/message/usePinMessage.ts +8 -2
- package/src/hooks/message/useSendMessage.ts +22 -18
- package/src/hooks/useConversationList.ts +17 -7
- package/src/hooks/useGroupPermission.ts +43 -0
- package/src/screens/ChatInfo/ChatInfoProfile.tsx +6 -3
- package/src/screens/chat-detail/ChatComposer.tsx +29 -32
- package/src/screens/chat-detail/ChatDetail.tsx +12 -1
- package/src/screens/chat-detail/ChatDetailHeader.tsx +19 -3
- package/src/screens/chat-detail/conversationHeader.utils.ts +14 -6
- package/src/screens/chat-detail/legend/LegendChatMessage.tsx +36 -1
- package/src/screens/chat-detail/messageToolbox/MessageToolboxOverlay.tsx +8 -1
- package/src/screens/inbox/MessagesTab.tsx +0 -1
- package/src/store/conversation.ts +62 -17
- package/src/translation/resources/i18n.ts +32 -0
- package/src/types/events.ts +6 -0
- package/src/utils/messageUtils.ts +103 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatDetailContext.d.ts","sourceRoot":"","sources":["../../../../src/context/ChatDetailContext.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ChatDetailContext.d.ts","sourceRoot":"","sources":["../../../../src/context/ChatDetailContext.tsx"],"names":[],"mappings":"AAAA,OAAO,EAOL,KAAK,aAAa,EACnB,MAAM,OAAO,CAAC;AAEf,OAAO,EAEL,KAAK,qBAAqB,EAC1B,KAAK,uBAAuB,EAC7B,MAAM,eAAe,CAAC;AAmBvB,eAAO,MAAM,iBAAiB,gDAU5B,CAAC;AAEH,eAAO,MAAM,oBAAoB,QAAO,qBAQvC,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAI,cAAc,uBAAuB,gCAwIvE,CAAC;AAEF,wBAAgB,sBAAsB,CAAC,CAAC,SAAS,MAAM,EACrD,SAAS,EAAE,aAAa,CAAC,CAAC,CAAC,GAC1B,aAAa,CAAC,CAAC,CAAC,CAUlB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useChatListener.d.ts","sourceRoot":"","sources":["../../../../src/core/useChatListener.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useChatListener.d.ts","sourceRoot":"","sources":["../../../../src/core/useChatListener.ts"],"names":[],"mappings":"AA4BA,eAAO,MAAM,eAAe,YAiW3B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useGetGroupInfo.d.ts","sourceRoot":"","sources":["../../../../../src/hooks/conversation/useGetGroupInfo.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,eAAe,GAAI,gBAAY,
|
|
1
|
+
{"version":3,"file":"useGetGroupInfo.d.ts","sourceRoot":"","sources":["../../../../../src/hooks/conversation/useGetGroupInfo.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,eAAe,GAAI,gBAAY,sHAexC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePinMessage.d.ts","sourceRoot":"","sources":["../../../../../src/hooks/message/usePinMessage.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"usePinMessage.d.ts","sourceRoot":"","sources":["../../../../../src/hooks/message/usePinMessage.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAWjE,eAAO,MAAM,mBAAmB,GAAU,gBAAgB,MAAM,kBAqC/D,CAAC;AAiBF,eAAO,MAAM,aAAa,GAAI,iBAAiB,MAAM;;0BAuBjC,WAAW;4BAiCX,WAAW;CAqC9B,CAAC;AAEF,eAAO,MAAM,yBAAyB,GAAI,gBAAgB,MAAM,SAQ/D,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSendMessage.d.ts","sourceRoot":"","sources":["../../../../../src/hooks/message/useSendMessage.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,eAAe,EACf,WAAW,EACX,WAAW,EACX,cAAc,EACf,MAAM,+BAA+B,CAAC;AASvC,OAAO,EAEL,KAAK,oBAAoB,EAE1B,MAAM,kBAAkB,CAAC;AAM1B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,mBAAmB,CAAC;AAGrE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAmBvD,eAAO,MAAM,cAAc;
|
|
1
|
+
{"version":3,"file":"useSendMessage.d.ts","sourceRoot":"","sources":["../../../../../src/hooks/message/useSendMessage.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,eAAe,EACf,WAAW,EACX,WAAW,EACX,cAAc,EACf,MAAM,+BAA+B,CAAC;AASvC,OAAO,EAEL,KAAK,oBAAoB,EAE1B,MAAM,kBAAkB,CAAC;AAM1B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,mBAAmB,CAAC;AAGrE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAmBvD,eAAO,MAAM,cAAc;6EA0CpB;QACD,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,WAAW,CAAC,EAAE,YAAY,CAAC;QAC3B,IAAI,CAAC,EAAE,2BAA2B,CAAC;QACnC,aAAa,CAAC,EAAE,oBAAoB,CAAC;QACrC,OAAO,CAAC,EAAE,WAAW,CAAC;KACvB;4BAyFe,WAAW;6BA8CqB,WAAW;CA2B9D,CAAC;AAEF,eAAO,MAAM,uBAAuB,GAAI,SAAS,WAAW,KA6BrD,WACN,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAU,MAAM,MAAM,iBAUnD,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAAU,MAAM,MAAM,EAAE,MAAM,MAAM,EAAE,iBActE,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAAU,QAAQ,eAAe,iBAUhE,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAAU,QAAQ,cAAc,iBAU/D,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAAU,SAAS,MAAM,iBAUzD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useConversationList.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useConversationList.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAE1D,KAAK,MAAM,GAAG;IACZ,eAAe,EAAE,oBAAoB,CAAC;IACtC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,wBAAgB,mBAAmB,CAAC,EAClC,eAAe,EACf,IAAQ,EACR,OAAc,GACf,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"useConversationList.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useConversationList.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAE1D,KAAK,MAAM,GAAG;IACZ,eAAe,EAAE,oBAAoB,CAAC;IACtC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,wBAAgB,mBAAmB,CAAC,EAClC,eAAe,EACf,IAAQ,EACR,OAAc,GACf,EAAE,MAAM,8HAyCR"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type GroupPermission } from '@droppii/openim-rn-client-sdk';
|
|
2
|
+
export declare const useHasGroupPermission: (permission: GroupPermission | GroupPermission[], mode?: "every" | "some") => boolean;
|
|
3
|
+
export declare const useGuardedAction: <T extends (...args: any[]) => any>(permission: GroupPermission, action: T, options?: {
|
|
4
|
+
deniedMessage?: string;
|
|
5
|
+
}) => T;
|
|
6
|
+
//# sourceMappingURL=useGroupPermission.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useGroupPermission.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useGroupPermission.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAM/E,eAAO,MAAM,qBAAqB,GAChC,YAAY,eAAe,GAAG,eAAe,EAAE,EAC/C,OAAM,OAAO,GAAG,MAAgB,KAC/B,OAYF,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAI,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,EAChE,YAAY,eAAe,EAC3B,QAAQ,CAAC,EACT,UAAU;IAAE,aAAa,CAAC,EAAE,MAAM,CAAA;CAAE,KACnC,CAeF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatInfoProfile.d.ts","sourceRoot":"","sources":["../../../../../src/screens/ChatInfo/ChatInfoProfile.tsx"],"names":[],"mappings":"AAEA,OAAO,EAGL,KAAK,gBAAgB,EACtB,MAAM,+BAA+B,CAAC;AAwCvC,UAAU,oBAAoB;IAC5B,YAAY,CAAC,EAAE,gBAAgB,CAAC;IAChC,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;CAC5B;AAED,QAAA,MAAM,eAAe,wEACe,oBAAoB,
|
|
1
|
+
{"version":3,"file":"ChatInfoProfile.d.ts","sourceRoot":"","sources":["../../../../../src/screens/ChatInfo/ChatInfoProfile.tsx"],"names":[],"mappings":"AAEA,OAAO,EAGL,KAAK,gBAAgB,EACtB,MAAM,+BAA+B,CAAC;AAwCvC,UAAU,oBAAoB;IAC5B,YAAY,CAAC,EAAE,gBAAgB,CAAC;IAChC,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;CAC5B;AAED,QAAA,MAAM,eAAe,wEACe,oBAAoB,iCAuFvD,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatComposer.d.ts","sourceRoot":"","sources":["../../../../../src/screens/chat-detail/ChatComposer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAOL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,EAIL,KAAK,iBAAiB,EACtB,KAAK,IAAI,EACV,MAAM,cAAc,CAAC;AA8BtB,OAAO,EAA6B,KAAK,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAuB5E,UAAU,yBAAyB;IACjC,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,aAAa,CAAC,EAAE,iBAAiB,EAAE,CAAC;IACpC,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,WAAW,CAAC,EAAE,SAAS,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC;IACrC,gBAAgB,CAAC,EAAE,CAAC,KAAK,EAAE,iBAAiB,KAAK,IAAI,CAAC;CACvD;AAED,eAAO,MAAM,YAAY,6HAOpB,yBAAyB,
|
|
1
|
+
{"version":3,"file":"ChatComposer.d.ts","sourceRoot":"","sources":["../../../../../src/screens/chat-detail/ChatComposer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAOL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,EAIL,KAAK,iBAAiB,EACtB,KAAK,IAAI,EACV,MAAM,cAAc,CAAC;AA8BtB,OAAO,EAA6B,KAAK,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAuB5E,UAAU,yBAAyB;IACjC,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,aAAa,CAAC,EAAE,iBAAiB,EAAE,CAAC;IACpC,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,WAAW,CAAC,EAAE,SAAS,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC;IACrC,gBAAgB,CAAC,EAAE,CAAC,KAAK,EAAE,iBAAiB,KAAK,IAAI,CAAC;CACvD;AAED,eAAO,MAAM,YAAY,6HAOpB,yBAAyB,iCA4d7B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatDetail.d.ts","sourceRoot":"","sources":["../../../../../src/screens/chat-detail/ChatDetail.tsx"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAa/C,QAAA,MAAM,UAAU,uPAeX,eAAe,
|
|
1
|
+
{"version":3,"file":"ChatDetail.d.ts","sourceRoot":"","sources":["../../../../../src/screens/chat-detail/ChatDetail.tsx"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAa/C,QAAA,MAAM,UAAU,uPAeX,eAAe,iCA0KnB,CAAC;AAIF,eAAe,UAAU,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatDetailHeader.d.ts","sourceRoot":"","sources":["../../../../../src/screens/chat-detail/ChatDetailHeader.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"ChatDetailHeader.d.ts","sourceRoot":"","sources":["../../../../../src/screens/chat-detail/ChatDetailHeader.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAOrD,QAAA,MAAM,gBAAgB,8JAUjB,qBAAqB,iCAwIzB,CAAC;AAIF,eAAe,gBAAgB,CAAC"}
|
|
@@ -2,7 +2,7 @@ import { type ConversationItem } from '@droppii/openim-rn-client-sdk';
|
|
|
2
2
|
import type { IConversationItemEx } from '../../types/chat';
|
|
3
3
|
export declare const getConversationTitle: (conversation?: ConversationItem) => string;
|
|
4
4
|
export declare const getConversationAvatarUri: (conversation?: ConversationItem) => string | null;
|
|
5
|
-
export declare const getConversationSubtitle: (conversation?: ConversationItem) => string | undefined;
|
|
5
|
+
export declare const getConversationSubtitle: (conversation?: ConversationItem, memberCount?: number) => string | undefined;
|
|
6
6
|
export declare const shouldShowAddMember: (conversation?: ConversationItem) => boolean;
|
|
7
7
|
export declare const getConversationEx: (ex?: string) => IConversationItemEx | {};
|
|
8
8
|
//# sourceMappingURL=conversationHeader.utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversationHeader.utils.d.ts","sourceRoot":"","sources":["../../../../../src/screens/chat-detail/conversationHeader.utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAChF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAE5D,eAAO,MAAM,oBAAoB,GAC/B,eAAe,gBAAgB,KAC9B,MAMF,CAAC;AAEF,eAAO,MAAM,wBAAwB,GACnC,eAAe,gBAAgB,KAC9B,MAAM,GAAG,IAEX,CAAC;AAEF,eAAO,MAAM,uBAAuB,GAClC,eAAe,gBAAgB,
|
|
1
|
+
{"version":3,"file":"conversationHeader.utils.d.ts","sourceRoot":"","sources":["../../../../../src/screens/chat-detail/conversationHeader.utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAChF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAE5D,eAAO,MAAM,oBAAoB,GAC/B,eAAe,gBAAgB,KAC9B,MAMF,CAAC;AAEF,eAAO,MAAM,wBAAwB,GACnC,eAAe,gBAAgB,KAC9B,MAAM,GAAG,IAEX,CAAC;AAEF,eAAO,MAAM,uBAAuB,GAClC,eAAe,gBAAgB,EAC/B,cAAc,MAAM,KACnB,MAAM,GAAG,SAyBX,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAC9B,eAAe,gBAAgB,KAC9B,OAEF,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAI,KAAK,MAAM,KAAG,mBAAmB,GAAG,EAQrE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LegendChatMessage.d.ts","sourceRoot":"","sources":["../../../../../../src/screens/chat-detail/legend/LegendChatMessage.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAoC,SAAS,EAAE,MAAM,OAAO,CAAC;AAEzE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAGjE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"LegendChatMessage.d.ts","sourceRoot":"","sources":["../../../../../../src/screens/chat-detail/legend/LegendChatMessage.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAoC,SAAS,EAAE,MAAM,OAAO,CAAC;AAEzE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAGjE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAqB/D,UAAU,sBAAsB;IAC9B,OAAO,EAAE,WAAW,CAAC;IACrB,UAAU,EAAE,OAAO,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,SAAS,EAAE,EAAE,KAAK,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5D,UAAU,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,IAAI,CAAC;IACzC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,IAAI,CAAC;IACzC,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;IACzB,wBAAwB,CAAC,EAAE,CAAC,CAAC,EAAE,WAAW,KAAK,SAAS,CAAC;IACzD,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAsCD,eAAO,MAAM,iBAAiB,kLAYzB,sBAAsB,wRAqE1B,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { MessageToolboxRef } from './types';
|
|
2
2
|
import type { ReactNode } from 'react';
|
|
3
|
-
import type
|
|
3
|
+
import { type MessageItem } from '@droppii/openim-rn-client-sdk';
|
|
4
4
|
interface MessageToolboxOverlayProps {
|
|
5
5
|
currentUserId?: string;
|
|
6
6
|
customMessageItemFactory?: (item: MessageItem) => ReactNode;
|
package/lib/typescript/src/screens/chat-detail/messageToolbox/MessageToolboxOverlay.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MessageToolboxOverlay.d.ts","sourceRoot":"","sources":["../../../../../../src/screens/chat-detail/messageToolbox/MessageToolboxOverlay.tsx"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAgB,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAE/D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"MessageToolboxOverlay.d.ts","sourceRoot":"","sources":["../../../../../../src/screens/chat-detail/messageToolbox/MessageToolboxOverlay.tsx"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAgB,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAE/D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,OAAO,EAEL,KAAK,WAAW,EACjB,MAAM,+BAA+B,CAAC;AAGvC,UAAU,0BAA0B;IAClC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,wBAAwB,CAAC,EAAE,CAAC,IAAI,EAAE,WAAW,KAAK,SAAS,CAAC;IAC5D,YAAY,CAAC,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,IAAI,CAAC;IAC9C,cAAc,CAAC,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,IAAI,CAAC;CACjD;AAED,eAAO,MAAM,qBAAqB,0HAgKjC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MessagesTab.d.ts","sourceRoot":"","sources":["../../../../../src/screens/inbox/MessagesTab.tsx"],"names":[],"mappings":"AAQA,UAAU,gBAAgB;IACxB,aAAa,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CACxC;AAKD,eAAO,MAAM,WAAW,0DAA4B,gBAAgB,
|
|
1
|
+
{"version":3,"file":"MessagesTab.d.ts","sourceRoot":"","sources":["../../../../../src/screens/inbox/MessagesTab.tsx"],"names":[],"mappings":"AAQA,UAAU,gBAAgB;IACxB,aAAa,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CACxC;AAKD,eAAO,MAAM,WAAW,0DAA4B,gBAAgB,iCAoDlE,CAAC"}
|
|
@@ -10,6 +10,13 @@ export interface ConversationStore {
|
|
|
10
10
|
map: Record<ConversationID, ConversationItem>;
|
|
11
11
|
/** Signal incremented when a truly new conversation arrives and a full refetch is needed. */
|
|
12
12
|
newConversationSignal: number;
|
|
13
|
+
/**
|
|
14
|
+
* Group IDs the user just left/was removed from. Any late-arriving SDK
|
|
15
|
+
* event (OnConversationChanged, OnNewConversation, ...) that still carries
|
|
16
|
+
* this group must not resurrect it — without this guard those events race
|
|
17
|
+
* with removeGroupConversation and silently undo the removal.
|
|
18
|
+
*/
|
|
19
|
+
removedGroupIds: Set<string>;
|
|
13
20
|
updateConversation(id: ConversationID, data: Partial<ConversationItem>): void;
|
|
14
21
|
updateConversations(conversations: ConversationItem[]): void;
|
|
15
22
|
/**
|
|
@@ -17,6 +24,10 @@ export interface ConversationStore {
|
|
|
17
24
|
* Returns true if any conversation was not found in the store (triggers refetch).
|
|
18
25
|
*/
|
|
19
26
|
removeConversation(id: ConversationID): void;
|
|
27
|
+
/** Removes a group's conversation and guards it against being re-added. */
|
|
28
|
+
removeGroupConversation(groupID: string): void;
|
|
29
|
+
/** Lifts the removal guard once the user (re)joins the group. */
|
|
30
|
+
restoreGroupConversation(groupID: string): void;
|
|
20
31
|
reset(): void;
|
|
21
32
|
}
|
|
22
33
|
export declare const useConversationStore: import("zustand").UseBoundStore<import("zustand").StoreApi<ConversationStore>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversation.d.ts","sourceRoot":"","sources":["../../../../src/store/conversation.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"conversation.d.ts","sourceRoot":"","sources":["../../../../src/store/conversation.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAEtE,KAAK,cAAc,GAAG,MAAM,CAAC;AAE7B,MAAM,WAAW,iBAAiB;IAChC,qBAAqB,CAAC,EAAE,cAAc,CAAC;IACvC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,sBAAsB,CACpB,EAAE,CAAC,EAAE,cAAc,EACnB,MAAM,CAAC,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,MAAM,GACf,IAAI,CAAC;IACR,sBAAsB,IAAI,gBAAgB,GAAG,SAAS,CAAC;IACvD,IAAI,EAAE,cAAc,EAAE,CAAC;IACvB,GAAG,EAAE,MAAM,CAAC,cAAc,EAAE,gBAAgB,CAAC,CAAC;IAC9C,6FAA6F;IAC7F,qBAAqB,EAAE,MAAM,CAAC;IAC9B;;;;;OAKG;IACH,eAAe,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC7B,kBAAkB,CAAC,EAAE,EAAE,cAAc,EAAE,IAAI,EAAE,OAAO,CAAC,gBAAgB,CAAC,GAAG,IAAI,CAAC;IAC9E,mBAAmB,CAAC,aAAa,EAAE,gBAAgB,EAAE,GAAG,IAAI,CAAC;IAC7D;;;OAGG;IACH,kBAAkB,CAAC,EAAE,EAAE,cAAc,GAAG,IAAI,CAAC;IAC7C,2EAA2E;IAC3E,uBAAuB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/C,iEAAiE;IACjE,wBAAwB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAChD,KAAK,IAAI,IAAI,CAAC;CACf;AAED,eAAO,MAAM,oBAAoB,gFA2F9B,CAAC;AAEJ,eAAO,MAAM,eAAe,GAAI,IAAI,MAAM,KAAG,gBAAgB,GAAG,SAE/D,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i18n.d.ts","sourceRoot":"","sources":["../../../../../src/translation/resources/i18n.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"i18n.d.ts","sourceRoot":"","sources":["../../../../../src/translation/resources/i18n.ts"],"names":[],"mappings":";;;AAyKA,wBAEE"}
|
|
@@ -3,7 +3,8 @@ export declare enum ChatEvent {
|
|
|
3
3
|
ScrollToMessage = "chat:scroll_to_message",
|
|
4
4
|
ScrollToBottom = "chat:scroll_to_bottom",
|
|
5
5
|
MessageRevoked = "chat:message_revoked",
|
|
6
|
-
GroupPermissionUpdated = "chat:group_permission_updated"
|
|
6
|
+
GroupPermissionUpdated = "chat:group_permission_updated",
|
|
7
|
+
GroupRemoved = "chat:group_removed"
|
|
7
8
|
}
|
|
8
9
|
export interface ScrollToMessagePayload {
|
|
9
10
|
clientMessageId: string;
|
|
@@ -14,4 +15,8 @@ export interface MessageRevokedPayload {
|
|
|
14
15
|
export interface GroupPermissionUpdatedPayload {
|
|
15
16
|
permissions: GroupPermission[];
|
|
16
17
|
}
|
|
18
|
+
export interface GroupRemovedPayload {
|
|
19
|
+
groupID: string;
|
|
20
|
+
reason: 'left' | 'dismissed' | 'kicked';
|
|
21
|
+
}
|
|
17
22
|
//# sourceMappingURL=events.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../../../src/types/events.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAErE,oBAAY,SAAS;IACnB,eAAe,2BAA2B;IAC1C,cAAc,0BAA0B;IACxC,cAAc,yBAAyB;IACvC,sBAAsB,kCAAkC;
|
|
1
|
+
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../../../src/types/events.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAErE,oBAAY,SAAS;IACnB,eAAe,2BAA2B;IAC1C,cAAc,0BAA0B;IACxC,cAAc,yBAAyB;IACvC,sBAAsB,kCAAkC;IACxD,YAAY,uBAAuB;CACpC;AAED,MAAM,WAAW,sBAAsB;IACrC,eAAe,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,qBAAqB;IACpC,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,6BAA6B;IAC5C,WAAW,EAAE,eAAe,EAAE,CAAC;CAChC;AAED,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,GAAG,WAAW,GAAG,QAAQ,CAAC;CACzC"}
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Message formatting and preview utilities
|
|
3
3
|
*/
|
|
4
|
-
import { type ConversationItem, type MessageItem } from '@droppii/openim-rn-client-sdk';
|
|
4
|
+
import { MessageType, type ConversationItem, type MessageItem } from '@droppii/openim-rn-client-sdk';
|
|
5
5
|
import type { IUrlMetadata } from '../types/common';
|
|
6
6
|
import type { TextProps } from 'react-native';
|
|
7
7
|
export declare const isMessageRevoked: (message: MessageItem) => boolean;
|
|
8
|
+
export declare const GROUP_NOTIFICATION_TEXT: Partial<Record<MessageType, {
|
|
9
|
+
previewKey: string;
|
|
10
|
+
bySenderKey: string;
|
|
11
|
+
}>>;
|
|
8
12
|
export declare const extractTextContent: (message: MessageItem) => string;
|
|
9
13
|
export declare const getMessagePreview: (message?: MessageItem) => string;
|
|
10
14
|
export declare const getMessagePreviewTextProps: (message?: MessageItem) => TextProps;
|
|
@@ -20,6 +24,7 @@ export interface PinnedMessagePreview {
|
|
|
20
24
|
fileIcon?: number;
|
|
21
25
|
}
|
|
22
26
|
export declare const getPinnedMessagePreview: (message: MessageItem) => PinnedMessagePreview;
|
|
27
|
+
export declare const getNotificationOpUserNickname: (message: MessageItem) => string | undefined;
|
|
23
28
|
export declare const getSenderName: (message: MessageItem, currentUserId?: string, conversation?: ConversationItem) => string;
|
|
24
29
|
export interface GetLastMessageTextParams {
|
|
25
30
|
message: MessageItem | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messageUtils.d.ts","sourceRoot":"","sources":["../../../../src/utils/messageUtils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"messageUtils.d.ts","sourceRoot":"","sources":["../../../../src/utils/messageUtils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,WAAW,EAEX,KAAK,gBAAgB,EACrB,KAAK,WAAW,EACjB,MAAM,+BAA+B,CAAC;AAIvC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C,eAAO,MAAM,gBAAgB,GAAI,SAAS,WAAW,KAAG,OACL,CAAC;AAKpD,eAAO,MAAM,uBAAuB,EAAE,OAAO,CAC3C,MAAM,CAAC,WAAW,EAAE;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,CAAC,CA0DjE,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAI,SAAS,WAAW,KAAG,MAYzD,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAI,UAAU,WAAW,KAAG,MAyFzD,CAAC;AAEF,eAAO,MAAM,0BAA0B,GACrC,UAAU,WAAW,KACpB,SAUF,CAAC;AAEF,eAAO,MAAM,sBAAsB,GACjC,UAAU,WAAW,KACpB;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,SAAS,CAAA;CAGrC,CAAC;AAEH,MAAM,MAAM,sBAAsB,GAAG,OAAO,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC;AAEzE,MAAM,WAAW,oBAAoB;IACnC,SAAS,EAAE,sBAAsB,CAAC;IAClC,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAmBD,eAAO,MAAM,uBAAuB,GAClC,SAAS,WAAW,KACnB,oBA0DF,CAAC;AAKF,eAAO,MAAM,6BAA6B,GACxC,SAAS,WAAW,KACnB,MAAM,GAAG,SAUX,CAAC;AAEF,eAAO,MAAM,aAAa,GACxB,SAAS,WAAW,EACpB,gBAAgB,MAAM,EACtB,eAAe,gBAAgB,KAC9B,MAUF,CAAC;AAEF,MAAM,WAAW,wBAAwB;IACvC,OAAO,EAAE,WAAW,GAAG,SAAS,CAAC;IACjC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,gBAAgB,CAAC;IAChC,6BAA6B,CAAC,EAAE,OAAO,CAAC;CACzC;AAED,eAAO,MAAM,kBAAkB,GAAI,0EAKhC,wBAAwB,KAAG,MAsB7B,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAC7B,UAAU,WAAW,EACrB,gBAAgB,MAAM,EACtB,eAAe,gBAAgB,EAC/B,SAAS,OAAO,KACf,MAOF,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAI,KAAK,MAAM,KAAG,YAAY,GAAG,SAS7D,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,MAAM,MAAM,EAAE,WAAW,MAAM,KAAG,MAUhE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@droppii-org/chat-mobile",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.68",
|
|
4
4
|
"description": "Droppii chat mobile",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react-native",
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
"example-legacy": "yarn workspace @droppii-org/chat-mobile-example-legacy"
|
|
70
70
|
},
|
|
71
71
|
"dependencies": {
|
|
72
|
-
"@droppii/openim-rn-client-sdk": "git+ssh://git@github.com/droppii/open-im-sdk-reactnative.git#v1.0.0-
|
|
72
|
+
"@droppii/openim-rn-client-sdk": "git+ssh://git@github.com/droppii/open-im-sdk-reactnative.git#v1.0.0-rc27",
|
|
73
73
|
"@legendapp/list": "^3.0.6",
|
|
74
74
|
"axios": "^1.16.1",
|
|
75
75
|
"lodash": "^4.18.1",
|
package/src/build-ignore.d.ts
CHANGED
|
@@ -3,6 +3,8 @@ import { StyleSheet } from 'react-native';
|
|
|
3
3
|
import { KContainer, KColors } from '@droppii/libs';
|
|
4
4
|
import { SingleAvatar } from './SingleAvatar';
|
|
5
5
|
import { DoubleAvatar } from './DoubleAvatar';
|
|
6
|
+
import { TripleAvatar } from './TripleAvatar';
|
|
7
|
+
import { QuadAvatar } from './QuadAvatar';
|
|
6
8
|
import { AvatarBadge } from './AvatarBadge';
|
|
7
9
|
import { SIZE_MAP } from './Avatar.utils';
|
|
8
10
|
import type { AvatarProps } from './Avatar.types';
|
|
@@ -13,8 +15,12 @@ const Avatar = memo(
|
|
|
13
15
|
size = 'md',
|
|
14
16
|
type = 'single',
|
|
15
17
|
secondarySource,
|
|
18
|
+
tertiarySource,
|
|
19
|
+
remainingCount,
|
|
16
20
|
badge,
|
|
17
21
|
fullName,
|
|
22
|
+
secondaryFullName,
|
|
23
|
+
tertiaryFullName,
|
|
18
24
|
borderColor = KColors.white,
|
|
19
25
|
borderWidth = 1,
|
|
20
26
|
placeholderColor = KColors.palette.gray.w400,
|
|
@@ -23,6 +29,41 @@ const Avatar = memo(
|
|
|
23
29
|
const sizeValue = useMemo(() => SIZE_MAP[size], [size]);
|
|
24
30
|
|
|
25
31
|
const content = useMemo(() => {
|
|
32
|
+
if (type === 'quad' && remainingCount) {
|
|
33
|
+
return (
|
|
34
|
+
<QuadAvatar
|
|
35
|
+
primarySource={source}
|
|
36
|
+
secondarySource={secondarySource}
|
|
37
|
+
tertiarySource={tertiarySource}
|
|
38
|
+
remainingCount={remainingCount}
|
|
39
|
+
size={sizeValue}
|
|
40
|
+
borderColor={borderColor}
|
|
41
|
+
borderWidth={borderWidth}
|
|
42
|
+
placeholderColor={placeholderColor}
|
|
43
|
+
primaryFullName={fullName}
|
|
44
|
+
secondaryFullName={secondaryFullName}
|
|
45
|
+
tertiaryFullName={tertiaryFullName}
|
|
46
|
+
/>
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
if (type === 'triple') {
|
|
51
|
+
return (
|
|
52
|
+
<TripleAvatar
|
|
53
|
+
primarySource={source}
|
|
54
|
+
secondarySource={secondarySource}
|
|
55
|
+
tertiarySource={tertiarySource}
|
|
56
|
+
size={sizeValue}
|
|
57
|
+
borderColor={borderColor}
|
|
58
|
+
borderWidth={borderWidth}
|
|
59
|
+
placeholderColor={placeholderColor}
|
|
60
|
+
primaryFullName={fullName}
|
|
61
|
+
secondaryFullName={secondaryFullName}
|
|
62
|
+
tertiaryFullName={tertiaryFullName}
|
|
63
|
+
/>
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
|
|
26
67
|
if (type === 'double') {
|
|
27
68
|
return (
|
|
28
69
|
<DoubleAvatar
|
|
@@ -32,6 +73,8 @@ const Avatar = memo(
|
|
|
32
73
|
borderColor={borderColor}
|
|
33
74
|
borderWidth={borderWidth}
|
|
34
75
|
placeholderColor={placeholderColor}
|
|
76
|
+
primaryFullName={fullName}
|
|
77
|
+
secondaryFullName={secondaryFullName}
|
|
35
78
|
/>
|
|
36
79
|
);
|
|
37
80
|
}
|
|
@@ -51,11 +94,15 @@ const Avatar = memo(
|
|
|
51
94
|
type,
|
|
52
95
|
source,
|
|
53
96
|
secondarySource,
|
|
97
|
+
tertiarySource,
|
|
98
|
+
remainingCount,
|
|
54
99
|
sizeValue,
|
|
55
100
|
borderColor,
|
|
56
101
|
borderWidth,
|
|
57
102
|
placeholderColor,
|
|
58
103
|
fullName,
|
|
104
|
+
secondaryFullName,
|
|
105
|
+
tertiaryFullName,
|
|
59
106
|
]);
|
|
60
107
|
|
|
61
108
|
const containerStyle = useMemo(
|
|
@@ -2,13 +2,17 @@ export interface AvatarProps {
|
|
|
2
2
|
userId?: string;
|
|
3
3
|
source?: string | null;
|
|
4
4
|
size?: 'sm' | 'nm' | 'md' | 'lg' | '4xlg';
|
|
5
|
-
type?: 'single' | 'double';
|
|
5
|
+
type?: 'single' | 'double' | 'triple' | 'quad';
|
|
6
6
|
secondarySource?: string | null;
|
|
7
|
+
tertiarySource?: string | null;
|
|
8
|
+
remainingCount?: number;
|
|
7
9
|
badge?: {
|
|
8
10
|
label?: string;
|
|
9
11
|
variant?: 'bot' | 'support' | 'mall' | 'custom';
|
|
10
12
|
};
|
|
11
13
|
fullName?: string;
|
|
14
|
+
secondaryFullName?: string;
|
|
15
|
+
tertiaryFullName?: string;
|
|
12
16
|
borderColor?: string;
|
|
13
17
|
borderWidth?: number;
|
|
14
18
|
placeholderColor?: string;
|
|
@@ -25,8 +25,9 @@ export const DoubleAvatar = memo(
|
|
|
25
25
|
primaryFullName,
|
|
26
26
|
secondaryFullName,
|
|
27
27
|
}: DoubleAvatarProps) => {
|
|
28
|
-
const
|
|
29
|
-
const
|
|
28
|
+
const primarySize = Math.round(size * 0.78);
|
|
29
|
+
const secondarySize = Math.round(size * 0.58);
|
|
30
|
+
const secondaryBorderWidth = borderWidth + 1;
|
|
30
31
|
|
|
31
32
|
return (
|
|
32
33
|
<KContainer.View
|
|
@@ -35,13 +36,13 @@ export const DoubleAvatar = memo(
|
|
|
35
36
|
<KContainer.View
|
|
36
37
|
style={[
|
|
37
38
|
styles.doubleAvatarChild,
|
|
38
|
-
styles.
|
|
39
|
-
{ width:
|
|
39
|
+
styles.doubleAvatarBottomLeft,
|
|
40
|
+
{ width: primarySize, height: primarySize },
|
|
40
41
|
]}
|
|
41
42
|
>
|
|
42
43
|
<SingleAvatar
|
|
43
44
|
source={primarySource}
|
|
44
|
-
size={
|
|
45
|
+
size={primarySize}
|
|
45
46
|
borderColor={borderColor}
|
|
46
47
|
borderWidth={borderWidth}
|
|
47
48
|
placeholderColor={placeholderColor}
|
|
@@ -52,15 +53,15 @@ export const DoubleAvatar = memo(
|
|
|
52
53
|
<KContainer.View
|
|
53
54
|
style={[
|
|
54
55
|
styles.doubleAvatarChild,
|
|
55
|
-
styles.
|
|
56
|
-
{ width:
|
|
56
|
+
styles.doubleAvatarTopRight,
|
|
57
|
+
{ width: secondarySize, height: secondarySize },
|
|
57
58
|
]}
|
|
58
59
|
>
|
|
59
60
|
<SingleAvatar
|
|
60
61
|
source={secondarySource}
|
|
61
|
-
size={
|
|
62
|
+
size={secondarySize}
|
|
62
63
|
borderColor={borderColor}
|
|
63
|
-
borderWidth={
|
|
64
|
+
borderWidth={secondaryBorderWidth}
|
|
64
65
|
placeholderColor={placeholderColor}
|
|
65
66
|
backgroundColor={KColors.palette.gray.w300}
|
|
66
67
|
fullName={secondaryFullName}
|
|
@@ -80,10 +81,12 @@ const styles = StyleSheet.create({
|
|
|
80
81
|
doubleAvatarChild: {
|
|
81
82
|
position: 'absolute',
|
|
82
83
|
},
|
|
83
|
-
|
|
84
|
-
top: 0,
|
|
85
|
-
},
|
|
86
|
-
doubleAvatarBottom: {
|
|
84
|
+
doubleAvatarBottomLeft: {
|
|
87
85
|
bottom: 0,
|
|
86
|
+
left: 0,
|
|
87
|
+
},
|
|
88
|
+
doubleAvatarTopRight: {
|
|
89
|
+
top: 0,
|
|
90
|
+
right: 0,
|
|
88
91
|
},
|
|
89
92
|
});
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import { memo } from 'react';
|
|
2
|
+
import { StyleSheet } from 'react-native';
|
|
3
|
+
import { KContainer, KLabel, KColors } from '@droppii/libs';
|
|
4
|
+
import { SingleAvatar } from './SingleAvatar';
|
|
5
|
+
|
|
6
|
+
interface QuadAvatarProps {
|
|
7
|
+
primarySource: string | null | undefined;
|
|
8
|
+
secondarySource: string | null | undefined;
|
|
9
|
+
tertiarySource: string | null | undefined;
|
|
10
|
+
remainingCount: number;
|
|
11
|
+
size: number;
|
|
12
|
+
borderColor: string;
|
|
13
|
+
borderWidth: number;
|
|
14
|
+
placeholderColor: string;
|
|
15
|
+
primaryFullName?: string;
|
|
16
|
+
secondaryFullName?: string;
|
|
17
|
+
tertiaryFullName?: string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const getCountTypo = (cellSize: number) => {
|
|
21
|
+
if (cellSize <= 20) return 'Text2XsBold' as const;
|
|
22
|
+
if (cellSize <= 32) return 'TextXsBold' as const;
|
|
23
|
+
return 'TextNmBold' as const;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export const QuadAvatar = memo(
|
|
27
|
+
({
|
|
28
|
+
primarySource,
|
|
29
|
+
secondarySource,
|
|
30
|
+
tertiarySource,
|
|
31
|
+
remainingCount,
|
|
32
|
+
size,
|
|
33
|
+
borderColor,
|
|
34
|
+
borderWidth,
|
|
35
|
+
placeholderColor,
|
|
36
|
+
primaryFullName,
|
|
37
|
+
secondaryFullName,
|
|
38
|
+
tertiaryFullName,
|
|
39
|
+
}: QuadAvatarProps) => {
|
|
40
|
+
const circleSize = Math.round(size * 0.58);
|
|
41
|
+
const clusterBorderWidth = borderWidth + 1;
|
|
42
|
+
const overflowLabel = remainingCount > 99 ? '99+' : `+${remainingCount}`;
|
|
43
|
+
|
|
44
|
+
return (
|
|
45
|
+
<KContainer.View
|
|
46
|
+
style={[styles.quadAvatarContainer, { width: size, height: size }]}
|
|
47
|
+
>
|
|
48
|
+
<KContainer.View
|
|
49
|
+
style={[
|
|
50
|
+
styles.quadAvatarChild,
|
|
51
|
+
styles.quadAvatarTopLeft,
|
|
52
|
+
{ width: circleSize, height: circleSize },
|
|
53
|
+
]}
|
|
54
|
+
>
|
|
55
|
+
<SingleAvatar
|
|
56
|
+
source={primarySource}
|
|
57
|
+
size={circleSize}
|
|
58
|
+
borderColor={borderColor}
|
|
59
|
+
borderWidth={clusterBorderWidth}
|
|
60
|
+
placeholderColor={placeholderColor}
|
|
61
|
+
backgroundColor={KColors.palette.gray.w300}
|
|
62
|
+
fullName={primaryFullName}
|
|
63
|
+
/>
|
|
64
|
+
</KContainer.View>
|
|
65
|
+
<KContainer.View
|
|
66
|
+
style={[
|
|
67
|
+
styles.quadAvatarChild,
|
|
68
|
+
styles.quadAvatarBottomLeft,
|
|
69
|
+
{ width: circleSize, height: circleSize },
|
|
70
|
+
]}
|
|
71
|
+
>
|
|
72
|
+
<SingleAvatar
|
|
73
|
+
source={tertiarySource}
|
|
74
|
+
size={circleSize}
|
|
75
|
+
borderColor={borderColor}
|
|
76
|
+
borderWidth={clusterBorderWidth}
|
|
77
|
+
placeholderColor={placeholderColor}
|
|
78
|
+
backgroundColor={KColors.palette.gray.w300}
|
|
79
|
+
fullName={tertiaryFullName}
|
|
80
|
+
/>
|
|
81
|
+
</KContainer.View>
|
|
82
|
+
<KContainer.View
|
|
83
|
+
style={[
|
|
84
|
+
styles.quadAvatarChild,
|
|
85
|
+
styles.quadAvatarTopRight,
|
|
86
|
+
{ width: circleSize, height: circleSize },
|
|
87
|
+
]}
|
|
88
|
+
>
|
|
89
|
+
<SingleAvatar
|
|
90
|
+
source={secondarySource}
|
|
91
|
+
size={circleSize}
|
|
92
|
+
borderColor={borderColor}
|
|
93
|
+
borderWidth={clusterBorderWidth}
|
|
94
|
+
placeholderColor={placeholderColor}
|
|
95
|
+
backgroundColor={KColors.palette.gray.w300}
|
|
96
|
+
fullName={secondaryFullName}
|
|
97
|
+
/>
|
|
98
|
+
</KContainer.View>
|
|
99
|
+
<KContainer.View
|
|
100
|
+
style={[
|
|
101
|
+
styles.quadAvatarChild,
|
|
102
|
+
styles.quadAvatarBottomRight,
|
|
103
|
+
{ width: circleSize, height: circleSize },
|
|
104
|
+
]}
|
|
105
|
+
>
|
|
106
|
+
<KContainer.View
|
|
107
|
+
center
|
|
108
|
+
style={[
|
|
109
|
+
styles.overflowBadge,
|
|
110
|
+
{
|
|
111
|
+
width: circleSize,
|
|
112
|
+
height: circleSize,
|
|
113
|
+
borderRadius: circleSize / 2,
|
|
114
|
+
borderWidth: clusterBorderWidth,
|
|
115
|
+
borderColor,
|
|
116
|
+
},
|
|
117
|
+
]}
|
|
118
|
+
>
|
|
119
|
+
<KLabel.Text typo={getCountTypo(circleSize)} color={KColors.white}>
|
|
120
|
+
{overflowLabel}
|
|
121
|
+
</KLabel.Text>
|
|
122
|
+
</KContainer.View>
|
|
123
|
+
</KContainer.View>
|
|
124
|
+
</KContainer.View>
|
|
125
|
+
);
|
|
126
|
+
}
|
|
127
|
+
);
|
|
128
|
+
|
|
129
|
+
QuadAvatar.displayName = 'QuadAvatar';
|
|
130
|
+
|
|
131
|
+
const styles = StyleSheet.create({
|
|
132
|
+
quadAvatarContainer: {
|
|
133
|
+
position: 'relative',
|
|
134
|
+
},
|
|
135
|
+
quadAvatarChild: {
|
|
136
|
+
position: 'absolute',
|
|
137
|
+
},
|
|
138
|
+
quadAvatarTopLeft: {
|
|
139
|
+
top: 0,
|
|
140
|
+
left: 0,
|
|
141
|
+
zIndex: 1,
|
|
142
|
+
},
|
|
143
|
+
quadAvatarBottomLeft: {
|
|
144
|
+
bottom: 0,
|
|
145
|
+
left: 0,
|
|
146
|
+
zIndex: 2,
|
|
147
|
+
},
|
|
148
|
+
quadAvatarTopRight: {
|
|
149
|
+
top: 0,
|
|
150
|
+
right: 0,
|
|
151
|
+
zIndex: 3,
|
|
152
|
+
},
|
|
153
|
+
quadAvatarBottomRight: {
|
|
154
|
+
bottom: 0,
|
|
155
|
+
right: 0,
|
|
156
|
+
zIndex: 4,
|
|
157
|
+
},
|
|
158
|
+
overflowBadge: {
|
|
159
|
+
backgroundColor: KColors.palette.gray.w500,
|
|
160
|
+
},
|
|
161
|
+
});
|