Skip to content

Commit

Permalink
Merge pull request #11 from Angus2333/main
Browse files Browse the repository at this point in the history
feat: 🎸 9.5.0 发布
  • Loading branch information
shine2008 authored Jun 15, 2023
2 parents 910f78c + 31e8573 commit 287bb49
Show file tree
Hide file tree
Showing 49 changed files with 1,525 additions and 6,764 deletions.
221 changes: 99 additions & 122 deletions react/package-lock.json

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
"start": "umi dev"
},
"dependencies": {
"@xkit-yx/call-kit": "^1.9.3",
"@xkit-yx/call-kit-react-ui": "^0.3.6",
"@xkit-yx/im-kit-ui": "^9.3.3",
"@xkit-yx/call-kit": "^2.0.1",
"@xkit-yx/call-kit-react-ui": "^0.4.1",
"@xkit-yx/im-kit-ui": "^9.5.0",
"react-dom": "^16.8.0",
"umi": "^3.5.40"
},
Expand Down
89 changes: 58 additions & 31 deletions react/src/YXUIKit/im-kit-ui/package.json
Original file line number Diff line number Diff line change
@@ -1,27 +1,43 @@
{
"name": "@xkit-yx/im-kit-ui",
"version": "9.4.1",
"description": "云信即时通讯组件",
"license": "MIT",
"main": "lib/index.js",
"module": "es/index.js",
"typings": "es/index.d.ts",
"publishConfig": {
"access": "public"
},
"scripts": {
"start": "rollup -cw --environment DEV",
"dev": "gulp watch",
"build": "gulp",
"p": "npm run build && npm publish"
"_from": "@xkit-yx/im-kit-ui@latest",
"_id": "@xkit-yx/[email protected]",
"_inBundle": false,
"_integrity": "sha512-UAJ8qxgmt5LGFvGKEt7ixHmFlfZtVb59iV6KvBlGCpVGro8YfailtRyUwxalTIU4kIJXQVd/5zfbp8m099kYtw==",
"_location": "/@xkit-yx/im-kit-ui",
"_phantomChildren": {},
"_requested": {
"type": "tag",
"registry": true,
"raw": "@xkit-yx/im-kit-ui@latest",
"name": "@xkit-yx/im-kit-ui",
"escapedName": "@xkit-yx%2fim-kit-ui",
"scope": "@xkit-yx",
"rawSpec": "latest",
"saveSpec": null,
"fetchSpec": "latest"
},
"files": [
"src",
"lib",
"es",
"copySourceCode.js"
"_requiredBy": [
"#USER",
"/"
],
"_resolved": "https://registry.npmjs.org/@xkit-yx/im-kit-ui/-/im-kit-ui-9.5.0.tgz",
"_shasum": "e74d71c0f80abcc753383b8e52ce5bec3010999a",
"_spec": "@xkit-yx/im-kit-ui@latest",
"_where": "/Users/yaoshun01/Desktop/IMUIKit-prod/nim-uikit-web/react",
"author": "",
"bundleDependencies": false,
"dependencies": {
"@ant-design/icons": "^5.0.1",
"@xkit-yx/core-kit": "^0.10.2",
"@xkit-yx/im-store": "^0.0.5",
"@xkit-yx/utils": "^0.5.2",
"antd": "^4.16.3",
"mobx": "^6.6.1",
"mobx-react": "^7.5.2",
"react-string-replace": "^1.1.0"
},
"deprecated": false,
"description": "云信即时通讯组件",
"devDependencies": {
"@rollup/plugin-commonjs": "^17.1.0",
"@rollup/plugin-json": "^4.1.0",
Expand All @@ -33,7 +49,7 @@
"gulp-typescript": "^6.0.0-alpha.1",
"less": "^4.1.1",
"less-plugin-npm-import": "^2.1.0",
"nim-web-sdk-ng": "0.13.0",
"nim-web-sdk-ng": "0.14.0",
"postcss": "^8.3.5",
"postcss-nested": "^5.0.5",
"react": "^16.8.0",
Expand All @@ -45,6 +61,17 @@
"sass": "^1.58.3",
"typescript": "^4.6.4"
},
"files": [
"src",
"lib",
"es",
"copySourceCode.js"
],
"gitHead": "bcf34d625e69b2c647eaacb58b35b70ef886ff9f",
"license": "MIT",
"main": "lib/index.js",
"module": "es/index.js",
"name": "@xkit-yx/im-kit-ui",
"peerDependencies": {
"@xkit-yx/core-kit": "^0.3.2",
"@xkit-yx/utils": "^0.4.3",
Expand All @@ -54,15 +81,15 @@
"react": ">=16.8.0",
"react-dom": ">=16.8.0"
},
"dependencies": {
"@ant-design/icons": "^5.0.1",
"@xkit-yx/core-kit": "^0.10.1",
"@xkit-yx/im-store": "^0.0.4",
"@xkit-yx/utils": "^0.5.2",
"antd": "^4.16.3",
"mobx": "^6.6.1",
"mobx-react": "^7.5.2",
"react-string-replace": "^1.1.0"
"publishConfig": {
"access": "public"
},
"scripts": {
"build": "gulp",
"dev": "gulp watch",
"p": "npm run build && npm publish",
"start": "rollup -cw --environment DEV"
},
"gitHead": "31ee9b2094f1a13e179565bf8a37237c5e45c1dd"
"typings": "es/index.d.ts",
"version": "9.5.0"
}
43 changes: 30 additions & 13 deletions react/src/YXUIKit/im-kit-ui/src/chat/Container.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@ import { Session } from 'nim-web-sdk-ng/dist/NIM_BROWSER_SDK/SessionServiceInter
import { observer } from 'mobx-react'

import packageJson from '../../package.json'
import { TeamMember } from 'nim-web-sdk-ng/dist/NIM_BROWSER_SDK/TeamServiceInterface'
import { FriendProfile } from 'nim-web-sdk-ng/dist/NIM_BROWSER_SDK/FriendServiceInterface'
import { GroupItemProps } from './components/ChatTeamSetting/GroupItem'
import { MenuItemKey } from './components/ChatMessageItem'

export interface ActionRenderProps extends ChatMessageInputProps {
scene: TMsgScene
Expand All @@ -37,6 +36,23 @@ export interface Action {
render?: (props: ActionRenderProps) => ReactNode
}

export interface MsgOperMenuItem {
/**
菜单项是否显示
*/
show?: number
/**
菜单项名称
*/
label?: string
key: MenuItemKey | string
icon?: React.ReactNode
/**
自定义点击事件
*/
onClick?: (msg: IMMessage) => void
}

export interface ChatContainerProps {
/**
自定义选中的会话 sessionId。一般不用传,内部会处理好选中逻辑
Expand All @@ -47,13 +63,9 @@ export interface ChatContainerProps {
*/
actions?: Action[]
/**
是否需要显示 p2p 消息已读未读,默认 false
*/
p2pMsgReceiptVisible?: boolean
/**
是否需要显示群组消息已读未读,默认 false
*/
teamMsgReceiptVisible?: boolean
自定义渲染 消息右键菜单
*/
msgOperMenu?: MsgOperMenuItem[]
/**
发送文字消息的回调,一般用于默认的文字发送缺少想要的字段时
*/
Expand All @@ -62,6 +74,10 @@ export interface ChatContainerProps {
scene: TMsgScene
to: string
}) => Promise<void>
/**
转让群主后的回调
*/
afterTransferTeam?: (teamId: string) => Promise<void>
/**
自定义渲染未选中任何会话时的内容
*/
Expand Down Expand Up @@ -130,9 +146,9 @@ export const ChatContainer: React.FC<ChatContainerProps> = observer(
({
selectedSession,
actions,
p2pMsgReceiptVisible = false,
teamMsgReceiptVisible = false,
msgOperMenu,
onSendText,
afterTransferTeam,
renderEmpty,
renderP2pCustomMessage,
renderTeamCustomMessage,
Expand Down Expand Up @@ -169,9 +185,9 @@ export const ChatContainer: React.FC<ChatContainerProps> = observer(
commonPrefix={commonPrefix}
scene={scene}
to={to}
p2pMsgReceiptVisible={p2pMsgReceiptVisible}
onSendText={onSendText}
actions={actions}
msgOperMenu={msgOperMenu}
renderP2pCustomMessage={renderP2pCustomMessage}
renderHeader={renderHeader}
renderP2pInputPlaceHolder={renderP2pInputPlaceHolder}
Expand All @@ -186,9 +202,10 @@ export const ChatContainer: React.FC<ChatContainerProps> = observer(
commonPrefix={commonPrefix}
scene={scene}
to={to}
teamMsgReceiptVisible={teamMsgReceiptVisible}
onSendText={onSendText}
actions={actions}
msgOperMenu={msgOperMenu}
afterTransferTeam={afterTransferTeam}
renderTeamCustomMessage={renderTeamCustomMessage}
renderHeader={renderHeader}
renderTeamInputPlaceHolder={renderTeamInputPlaceHolder}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ const ChatForwardModal: React.FC<ChatForwardModalProps> = ({
if (searchText) {
const friends = store.uiStore.friendsWithoutBlacklist
.filter((item) =>
(item.alias || item.nick || item.account).includes(searchText)
store.uiStore
.getAppellation({ account: item.account })
.includes(searchText)
)
.map((item) => ({
scene: 'p2p' as TMsgScene,
Expand All @@ -66,12 +68,7 @@ const ChatForwardModal: React.FC<ChatForwardModalProps> = ({
scene: item.scene,
to: item.to,
}))
}, [
searchText,
store.uiStore.teamList,
store.uiStore.friendsWithoutBlacklist,
store.sessionStore.sessions,
])
}, [searchText, store.uiStore, store.sessionStore.sessions])

const _prefix = `${prefix}-forward-modal`

Expand Down
Loading

0 comments on commit 287bb49

Please sign in to comment.