@tencentcloud/chat-uikit-vue
Advanced tools
Comparing version 2.0.8 to 2.0.9
@@ -1,6 +0,7 @@ | ||
import * as Vue from "vue"; | ||
import * as Vue from 'vue'; | ||
let vueVersion: number; | ||
let framework = 'vue2'; | ||
let createVNode = ( | ||
arg1: any, | ||
arg2: any | ||
arg2: any, | ||
): { component: any; props: any; data: any } => { | ||
@@ -15,4 +16,4 @@ return {} as { component: any; props: any; data: any }; | ||
if ( | ||
(Vue as any)?.default?.version && | ||
(Vue as any)?.default?.version?.startsWith("2.7.") | ||
(Vue as any)?.default?.version | ||
&& (Vue as any)?.default?.version?.startsWith('2.7.') | ||
) { | ||
@@ -22,4 +23,4 @@ // >= Vue 2.7.0 | ||
} else if ( | ||
(Vue as any)?.default?.version && | ||
(Vue as any)?.default?.version?.startsWith("2.") | ||
(Vue as any)?.default?.version | ||
&& (Vue as any)?.default?.version?.startsWith('2.') | ||
) { | ||
@@ -31,2 +32,3 @@ // < Vue 2.7.0 | ||
vueVersion = 3; | ||
framework = 'vue3'; | ||
createVNode = (Vue as any)?.createVNode; | ||
@@ -39,2 +41,3 @@ render = (Vue as any)?.render; | ||
vueVersion = 3; | ||
framework = 'vue3'; | ||
createVNode = (Vue as any)?.createVNode; | ||
@@ -44,3 +47,3 @@ render = (Vue as any)?.render; | ||
console.warn(`[adapter-vue]: vue version is ${vueVersion}`); | ||
export { vueVersion, render, createVNode }; | ||
export * from "vue"; | ||
export { vueVersion, framework, render, createVNode }; | ||
export * from 'vue'; |
@@ -0,1 +1,14 @@ | ||
## [2.0.9] (2024-03-29) | ||
### Features | ||
- ScrollButton 支持未读新消息提示 | ||
- 群未决申请展示优化 | ||
- 兼容支持 H5 IOS longPress 事件 | ||
### Update | ||
- 下线本地审核相关入口 | ||
### Fix | ||
- 修复 nick 过长样式溢出问题 | ||
## [2.0.8] (2024-03-15) | ||
@@ -2,0 +15,0 @@ |
11
index.ts
@@ -1,4 +0,3 @@ | ||
import TUIChatEngine from "@tencentcloud/chat-uikit-engine"; | ||
import { genTestUserSig } from "./debug"; | ||
import Server from "./server"; | ||
import { genTestUserSig } from './debug'; | ||
import Server from './server'; | ||
import TUIComponents, { | ||
@@ -10,9 +9,11 @@ TUIChat, | ||
TUIGroup, | ||
} from "./components"; | ||
} from './components'; | ||
import TUIKit from './index.vue'; | ||
const TUIChatKit = new Server(); | ||
TUIChatKit.init(); | ||
export { | ||
TUIKit, | ||
TUIChatKit, | ||
TUIChatEngine, | ||
TUIComponents, | ||
@@ -19,0 +20,0 @@ TUIChat, |
@@ -26,6 +26,6 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ | ||
url: string; | ||
list: Array<string>; | ||
list: string[]; | ||
} | ||
export type IEmojiList = Array<IEmojiListItem>; | ||
export type IEmojiList = any[]; | ||
@@ -35,3 +35,3 @@ export interface ISendMessagePayload { | ||
file?: any; | ||
atUserList?: Array<string>; | ||
atUserList?: string[]; | ||
} | ||
@@ -70,10 +70,10 @@ | ||
export interface IGroupApplicationType { | ||
applicant?: string; | ||
applicantNick?: string; | ||
groupID?: string; | ||
groupName?: string; | ||
applicationType: number; | ||
userID?: string; | ||
note?: string; | ||
export interface IGroupApplication { | ||
applicant: string; | ||
applicantNick: string; | ||
groupID: string; | ||
groupName: string; | ||
applicationType: 0 | 2; // 0 - group application, 2 - group invite | ||
userID: string; | ||
note: string; | ||
[propName: string]: any; | ||
@@ -90,3 +90,3 @@ } | ||
export type IGroupApplicationListItem = IGroupApplicationType & IGroupApplicationUserProfile; | ||
export type IGroupApplicationListItem = IGroupApplication; | ||
@@ -96,7 +96,7 @@ export interface IFriendType { | ||
remark?: string; | ||
groupList?: Array<unknown>; | ||
groupList?: any[]; | ||
source?: string; | ||
wording?: string; | ||
profile?: IFriendProfile; | ||
friendCustomFriend?: Array<object>; | ||
friendCustomFriend?: Record<string, any>[]; | ||
} | ||
@@ -119,3 +119,3 @@ | ||
muteUntil?: string; | ||
memberCustomField?: Array<object>; | ||
memberCustomField?: Record<string, any>[]; | ||
} | ||
@@ -129,3 +129,3 @@ | ||
userID?: string; | ||
memberCustomField?: Array<object>; | ||
memberCustomField?: Record<string, any>[]; | ||
} | ||
@@ -148,3 +148,3 @@ | ||
lastUpdatedTime: number; | ||
profileCustomField: Array<object>; | ||
profileCustomField: Record<string, any>[]; | ||
} | ||
@@ -154,3 +154,3 @@ | ||
title: string; | ||
list: Array<unknown>; | ||
list: any[]; | ||
key: string; | ||
@@ -171,7 +171,7 @@ unreadCount?: number; | ||
label: string; | ||
list: Array<any>; | ||
list: any[]; | ||
}; | ||
group: { | ||
label: string; | ||
list: Array<any>; | ||
list: any[]; | ||
}; | ||
@@ -206,3 +206,3 @@ } | ||
totalCount: number; | ||
searchResultList: Array<ISearchResultListItem>; | ||
searchResultList: ISearchResultListItem[]; | ||
cursor: string; | ||
@@ -214,3 +214,3 @@ } | ||
messageCount: number; | ||
messageList: Array<IMessageModel>; | ||
messageList: IMessageModel[]; | ||
type?: string; | ||
@@ -260,7 +260,7 @@ } | ||
destroy: () => void; | ||
onPlay: (callback: (...args: unknown[]) => void) => void; | ||
onPause: (callback: (...args: unknown[]) => void) => void; | ||
onStop: (callback: (...args: unknown[]) => void) => void; | ||
onEnded: (callback: (...args: unknown[]) => void) => void; | ||
onError: (callback: (...args: unknown[]) => void) => void; | ||
onPlay: (callback: (...args: any[]) => void) => void; | ||
onPause: (callback: (...args: any[]) => void) => void; | ||
onStop: (callback: (...args: any[]) => void) => void; | ||
onEnded: (callback: (...args: any[]) => void) => void; | ||
onError: (callback: (...args: any[]) => void) => void; | ||
} | ||
@@ -267,0 +267,0 @@ |
@@ -21,4 +21,4 @@ import TUIChat from './TUIChat'; | ||
确定: 'Save', | ||
开始时间: "Start Date", | ||
结束时间: "End Date", | ||
开始时间: 'Start Date', | ||
结束时间: 'End Date', | ||
TUIChat, | ||
@@ -25,0 +25,0 @@ TUIConversation, |
{ | ||
"name": "@tencentcloud/chat-uikit-vue", | ||
"version": "2.0.8", | ||
"version": "2.0.9", | ||
"repository": "https://github.com/TencentCloud/chat-uikit-vue", | ||
@@ -5,0 +5,0 @@ "description": "TUIKit 是基于 IM SDK 实现的一套 UI 组件,其包含会话、聊天、群组、个人资料等功能,基于 TUIKit 组件您可以像搭积木一样快速搭建起自己的业务逻辑。", |
@@ -38,3 +38,2 @@ ## 关于 chat-uikit-vue | ||
| useUploadPlugin | boolean | 是否使用上传插件, 默认 false | | ||
| useProfanityFilterPlugin | boolean | 是否使用本地审核插件,默认 false | | ||
| proxyServer | string | WebSocket 服务器代理地址 | | ||
@@ -41,0 +40,0 @@ | fileUploadProxy | string | 图片、视频、文件上传代理地址 | |
@@ -1,10 +0,11 @@ | ||
import TUICore, { TUILogin, TUIConstants } from "@tencentcloud/tui-core"; | ||
import TUIChatEngine, { TUITranslateService } from "@tencentcloud/chat-uikit-engine"; | ||
import { TUIGlobal } from "@tencentcloud/universal-api"; | ||
import { ITUIComponents, ITUIPlugins } from "./interface"; | ||
import TUILocales from "./locales"; | ||
import { isFunction, isObject } from "./utils"; | ||
import { isApp } from "./utils/env"; | ||
import CallkitPluginServer from "./plugins/extension-server/callkit"; | ||
import TUICore, { TUILogin, TUIConstants } from '@tencentcloud/tui-core'; | ||
import TUIChatEngine, { TUITranslateService } from '@tencentcloud/chat-uikit-engine'; | ||
import { TUIGlobal } from '@tencentcloud/universal-api'; | ||
import { ITUIComponents, ITUIPlugins } from './interface'; | ||
import TUILocales from './locales'; | ||
import { isFunction, isObject } from './utils'; | ||
import { isApp } from './utils/env'; | ||
import CallkitPluginServer from './plugins/extension-server/callkit'; | ||
export default class TUIChatKit { | ||
static isInitialized: boolean; | ||
public chat: any; | ||
@@ -28,3 +29,3 @@ | ||
TUIConstants.TUILogin.EVENT_SUB_KEY.USER_LOGIN_SUCCESS, | ||
this | ||
this, | ||
); | ||
@@ -37,3 +38,3 @@ } | ||
*/ | ||
private onNotifyEvent(eventName: string, subKey: string) { | ||
public onNotifyEvent(eventName: string, subKey: string) { | ||
if (eventName === TUIConstants.TUILogin.EVENT.LOGIN_STATE_CHANGED) { | ||
@@ -52,4 +53,9 @@ switch (subKey) { | ||
public init() { | ||
// 向下兼容,新版本在 index.ts 中默认执行 init 操作 | ||
if (TUIChatKit.isInitialized) { | ||
return; | ||
} | ||
TUIChatKit.isInitialized = true; | ||
// 原生插件 TUICallKit 存在时执行 call server | ||
if(isApp) { | ||
if (isApp) { | ||
new CallkitPluginServer(); | ||
@@ -64,3 +70,3 @@ } | ||
TUIGlobal.TUIPlugins = this.TUIPlugins; | ||
console.warn("[TUIChatKit]: init success."); | ||
console.warn('[TUIChatKit]: init success.'); | ||
} | ||
@@ -95,3 +101,3 @@ | ||
console.warn( | ||
`[TUIChatKit]: ${this?.TUIComponents?.componentName} component has already been applied to target TUIChatEngine.` | ||
`[TUIChatKit]: ${this?.TUIComponents?.componentName} component has already been applied to target TUIChatEngine.`, | ||
); | ||
@@ -117,3 +123,3 @@ } else { | ||
if (!components || !isObject(components)) { | ||
console.warn("[TUIChatKit]: components is empty or not object."); | ||
console.warn('[TUIChatKit]: components is empty or not object.'); | ||
} else { | ||
@@ -137,3 +143,3 @@ Object?.keys(components)?.forEach((key: string) => { | ||
console.warn( | ||
`[TUIChatKit]: Plugin ${this.TUIPlugins[TUIPluginName]} can't be used before init.` | ||
`[TUIChatKit]: Plugin ${this.TUIPlugins[TUIPluginName]} can't be used before init.`, | ||
); | ||
@@ -144,3 +150,3 @@ return; | ||
console.warn( | ||
`[TUIChatKit]: Plugin ${this.TUIPlugins[TUIPluginName]} has already been applied to target TUIChatEngine.` | ||
`[TUIChatKit]: Plugin ${this.TUIPlugins[TUIPluginName]} has already been applied to target TUIChatEngine.`, | ||
); | ||
@@ -155,6 +161,6 @@ } else if (TUIPlugin && isFunction(TUIPlugin?.plugin)) { | ||
console.warn( | ||
'[TUIChatKit]: A plugin must either be a function or an object with an "plugin" ' + | ||
"function." + | ||
this.TUIPlugins[TUIPluginName] + | ||
"does not comply with the above rules." | ||
'[TUIChatKit]: A plugin must either be a function or an object with an "plugin" ' | ||
+ 'function.' | ||
+ this.TUIPlugins[TUIPluginName] | ||
+ 'does not comply with the above rules.', | ||
); | ||
@@ -161,0 +167,0 @@ } |
@@ -1,15 +0,15 @@ | ||
import { getPlatform } from "@tencentcloud/universal-api"; | ||
import { getPlatform } from '@tencentcloud/universal-api'; | ||
declare const uni: any; | ||
export const isPC = getPlatform() === "pc"; | ||
export const isPC = getPlatform() === 'pc'; | ||
export const isH5 = getPlatform() === "h5"; | ||
export const isH5 = getPlatform() === 'h5'; | ||
export const isWeChat = getPlatform() === "wechat"; | ||
export const isWeChat = getPlatform() === 'wechat'; | ||
export const isApp = getPlatform() === "app"; | ||
export const isApp = getPlatform() === 'app'; | ||
export const isUniFrameWork = typeof uni !== "undefined"; | ||
export const isUniFrameWork = typeof uni !== 'undefined'; | ||
// H5、小程序、app 均认为是手机端产品,如果需要统一手机端 UI 样式,可以直接用 isMobile 控制 | ||
export const isMobile = isH5 || isWeChat || isApp; | ||
export const isMobile = isH5 || isWeChat || isApp; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1201814
351
5608
81
1