@tencentcloud/sdk-mcp 1.0.7 → 1.0.9
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/package.json +1 -1
- package/resource/doc/chatuikit/react/components/chat.md +38 -0
- package/resource/doc/chatuikit/react/components/chatheader.md +153 -0
- package/resource/doc/chatuikit/react/components/conversation-list.md +765 -0
- package/resource/doc/chatuikit/react/components/message-input.md +799 -0
- package/resource/doc/chatuikit/react/components/message-list.md +385 -0
- package/resource/doc/chatuikit/react/components/tuikit.md +64 -0
- package/resource/doc/chatuikit/react/create-group.md +22 -0
- package/resource/doc/chatuikit/react/login.md +25 -0
- package/resource/doc/chatuikit/vue/components/MessageInput.md +546 -0
- package/resource/doc/chatuikit/vue/components/avatar.md +105 -0
- package/resource/doc/chatuikit/vue/components/chat.md +38 -0
- package/resource/doc/chatuikit/vue/components/chatheader.md +153 -0
- package/resource/doc/chatuikit/vue/components/component-list.md +90 -0
- package/resource/doc/chatuikit/vue/components/conversation-list.md +590 -0
- package/resource/doc/chatuikit/vue/components/login.md +29 -0
- package/resource/doc/chatuikit/vue/components/message-input.md +546 -0
- package/resource/doc/chatuikit/vue/components/message-list.md +548 -0
- package/resource/doc/chatuikit/vue/components/tuikit.md +110 -0
- package/resource/doc/chatuikit/vue/components/userpicker.md +256 -0
- package/resource/doc/chatuikit/vue/create-group.md +26 -0
- package/resource/doc/chatuikit/vue/integration.md +218 -0
- package/resource/doc/chatuikit/vue/login.md +29 -0
- package/resource/doc/chatuikit/vue3/components/MessageList.md +385 -0
- package/resource/doc/chatuikit/vue3/integration.md +7 -4
- package/tools/call/get-native-call-integration-guide.js +2 -2
- package/tools/call/get-native-call-integration-guide.js.map +1 -1
- package/tools/call/get-native-call-integration.js +35 -0
- package/tools/call/get-native-call-integration.js.map +1 -0
- package/tools/call/get-web-call-integration-guide.js +4 -4
- package/tools/call/get-web-call-integration-guide.js.map +1 -1
- package/tools/call/get-web-call-integration.js +34 -0
- package/tools/call/get-web-call-integration.js.map +1 -0
- package/tools/chat/auto-create-group.js +44 -0
- package/tools/chat/auto-create-group.js.map +1 -0
- package/tools/chat/create-group.js +29 -0
- package/tools/chat/create-group.js.map +1 -0
- package/tools/chat/get-native-chat-integration-guide.js +2 -2
- package/tools/chat/get-native-chat-integration-guide.js.map +1 -1
- package/tools/chat/get-native-chat-integration.js +33 -0
- package/tools/chat/get-native-chat-integration.js.map +1 -0
- package/tools/chat/get-web-chat-component-detail.js +8 -5
- package/tools/chat/get-web-chat-component-detail.js.map +1 -1
- package/tools/chat/get-web-chat-integration-guide.js +16 -8
- package/tools/chat/get-web-chat-integration-guide.js.map +1 -1
- package/tools/chat/get-web-chat-integration.js +36 -0
- package/tools/chat/get-web-chat-integration.js.map +1 -0
- package/tools/chat/get-web-chat-uikit-login.js +30 -0
- package/tools/chat/get-web-chat-uikit-login.js.map +1 -0
- package/tools/common/present-framework-choice.js +9 -18
- package/tools/common/present-framework-choice.js.map +1 -1
- package/tools/common/record-prompt.js +3 -3
- package/tools/common/record-prompt.js.map +1 -1
- package/tools/common/record-result.js +6 -6
- package/tools/common/record-result.js.map +1 -1
- package/tools/index.js +12 -8
- package/tools/index.js.map +1 -1
- package/utils/handle-component-name.js +12 -0
- package/utils/handle-component-name.js.map +1 -0
- package/utils/handle-framework.js +9 -0
- package/utils/handle-framework.js.map +1 -0
- package/@tencent/aegis-node-sdk/CHANGELOG.md +0 -8
- package/@tencent/aegis-node-sdk/LICENSE +0 -21
- package/@tencent/aegis-node-sdk/README.md +0 -562
- package/@tencent/aegis-node-sdk/lib/aegis.min.js +0 -1
- package/@tencent/aegis-node-sdk/lib/packages/core/src/constant/config.d.ts +0 -14
- package/@tencent/aegis-node-sdk/lib/packages/core/src/constant/global.d.ts +0 -1
- package/@tencent/aegis-node-sdk/lib/packages/core/src/constant/index.d.ts +0 -9
- package/@tencent/aegis-node-sdk/lib/packages/core/src/constant/report-ignore.d.ts +0 -2
- package/@tencent/aegis-node-sdk/lib/packages/core/src/core.d.ts +0 -85
- package/@tencent/aegis-node-sdk/lib/packages/core/src/hooks/afterRequestHooks.d.ts +0 -3
- package/@tencent/aegis-node-sdk/lib/packages/core/src/hooks/beforeRequestHooks.d.ts +0 -9
- package/@tencent/aegis-node-sdk/lib/packages/core/src/hooks/modifyRequestHooks.d.ts +0 -3
- package/@tencent/aegis-node-sdk/lib/packages/core/src/index.d.ts +0 -9
- package/@tencent/aegis-node-sdk/lib/packages/core/src/interface/config.d.ts +0 -62
- package/@tencent/aegis-node-sdk/lib/packages/core/src/interface/env.d.ts +0 -11
- package/@tencent/aegis-node-sdk/lib/packages/core/src/interface/index.d.ts +0 -4
- package/@tencent/aegis-node-sdk/lib/packages/core/src/interface/log.d.ts +0 -130
- package/@tencent/aegis-node-sdk/lib/packages/core/src/interface/send.d.ts +0 -34
- package/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/format.d.ts +0 -2
- package/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/index.d.ts +0 -18
- package/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/length-limit.d.ts +0 -8
- package/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/pv.d.ts +0 -8
- package/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/remove-payload.d.ts +0 -2
- package/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/repeat-limit.d.ts +0 -4
- package/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/report.d.ts +0 -10
- package/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/sample.d.ts +0 -3
- package/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/throttle.d.ts +0 -3
- package/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/trace/index.d.ts +0 -34
- package/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/trace/jwt.d.ts +0 -12
- package/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/trace/ot-js.d.ts +0 -14
- package/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/trace/uuid.d.ts +0 -2
- package/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/whitelist.d.ts +0 -12
- package/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/write-before.d.ts +0 -3
- package/@tencent/aegis-node-sdk/lib/packages/core/src/plugin.d.ts +0 -33
- package/@tencent/aegis-node-sdk/lib/packages/core/src/polyfill.d.ts +0 -0
- package/@tencent/aegis-node-sdk/lib/packages/core/src/util/destroy.d.ts +0 -2
- package/@tencent/aegis-node-sdk/lib/packages/core/src/util/event-emitter.d.ts +0 -18
- package/@tencent/aegis-node-sdk/lib/packages/core/src/util/index.d.ts +0 -60
- package/@tencent/aegis-node-sdk/lib/packages/node-sdk/src/index.d.ts +0 -15
- package/@tencent/aegis-node-sdk/lib/packages/node-sdk/src/interface/selector.d.ts +0 -5
- package/@tencent/aegis-node-sdk/lib/packages/node-sdk/src/pipes/batch-report-pipe.d.ts +0 -6
- package/@tencent/aegis-node-sdk/lib/packages/node-sdk/src/protocol/protocol_base.d.ts +0 -18
- package/@tencent/aegis-node-sdk/lib/packages/node-sdk/src/protocol/protocol_http.d.ts +0 -12
- package/@tencent/aegis-node-sdk/lib/packages/node-sdk/src/selector/ip_selector.d.ts +0 -10
- package/@tencent/aegis-node-sdk/lib/packages/node-sdk/src/selector/polaris_selector.d.ts +0 -20
- package/@tencent/aegis-node-sdk/lib/packages/node-sdk/src/selector/selector_base.d.ts +0 -27
- package/@tencent/aegis-node-sdk/lib/packages/node-sdk/src/util/eval_require.d.ts +0 -2
- package/@tencent/aegis-node-sdk/package.json +0 -19
- package/@tencent/polaris/README.md +0 -407
- package/@tencent/polaris/dist/consumer/health.d.ts +0 -126
- package/@tencent/polaris/dist/consumer/health.js +0 -283
- package/@tencent/polaris/dist/consumer/health.js.map +0 -1
- package/@tencent/polaris/dist/consumer/index.d.ts +0 -120
- package/@tencent/polaris/dist/consumer/index.js +0 -348
- package/@tencent/polaris/dist/consumer/index.js.map +0 -1
- package/@tencent/polaris/dist/consumer/monitor.d.ts +0 -145
- package/@tencent/polaris/dist/consumer/monitor.js +0 -343
- package/@tencent/polaris/dist/consumer/monitor.js.map +0 -1
- package/@tencent/polaris/dist/consumer/selector.d.ts +0 -73
- package/@tencent/polaris/dist/consumer/selector.js +0 -316
- package/@tencent/polaris/dist/consumer/selector.js.map +0 -1
- package/@tencent/polaris/dist/errors.d.ts +0 -373
- package/@tencent/polaris/dist/errors.js +0 -154
- package/@tencent/polaris/dist/errors.js.map +0 -1
- package/@tencent/polaris/dist/global.d.ts +0 -16
- package/@tencent/polaris/dist/global.js +0 -18
- package/@tencent/polaris/dist/global.js.map +0 -1
- package/@tencent/polaris/dist/index.d.ts +0 -62
- package/@tencent/polaris/dist/index.js +0 -145
- package/@tencent/polaris/dist/index.js.map +0 -1
- package/@tencent/polaris/dist/instance.d.ts +0 -109
- package/@tencent/polaris/dist/instance.js +0 -38
- package/@tencent/polaris/dist/instance.js.map +0 -1
- package/@tencent/polaris/dist/limiter/bucket.d.ts +0 -51
- package/@tencent/polaris/dist/limiter/bucket.js +0 -152
- package/@tencent/polaris/dist/limiter/bucket.js.map +0 -1
- package/@tencent/polaris/dist/limiter/index.d.ts +0 -73
- package/@tencent/polaris/dist/limiter/index.js +0 -149
- package/@tencent/polaris/dist/limiter/index.js.map +0 -1
- package/@tencent/polaris/dist/limiter/ratelimit.d.ts +0 -27
- package/@tencent/polaris/dist/limiter/ratelimit.js +0 -134
- package/@tencent/polaris/dist/limiter/ratelimit.js.map +0 -1
- package/@tencent/polaris/dist/limiter/ratelimiter/base.d.ts +0 -17
- package/@tencent/polaris/dist/limiter/ratelimiter/base.js +0 -15
- package/@tencent/polaris/dist/limiter/ratelimiter/base.js.map +0 -1
- package/@tencent/polaris/dist/limiter/ratelimiter/global.d.ts +0 -59
- package/@tencent/polaris/dist/limiter/ratelimiter/global.js +0 -397
- package/@tencent/polaris/dist/limiter/ratelimiter/global.js.map +0 -1
- package/@tencent/polaris/dist/limiter/ratelimiter/index.d.ts +0 -3
- package/@tencent/polaris/dist/limiter/ratelimiter/index.js +0 -19
- package/@tencent/polaris/dist/limiter/ratelimiter/index.js.map +0 -1
- package/@tencent/polaris/dist/limiter/ratelimiter/local.d.ts +0 -17
- package/@tencent/polaris/dist/limiter/ratelimiter/local.js +0 -52
- package/@tencent/polaris/dist/limiter/ratelimiter/local.js.map +0 -1
- package/@tencent/polaris/dist/location.d.ts +0 -48
- package/@tencent/polaris/dist/location.js +0 -67
- package/@tencent/polaris/dist/location.js.map +0 -1
- package/@tencent/polaris/dist/logging.d.ts +0 -106
- package/@tencent/polaris/dist/logging.js +0 -130
- package/@tencent/polaris/dist/logging.js.map +0 -1
- package/@tencent/polaris/dist/metadata.d.ts +0 -78
- package/@tencent/polaris/dist/metadata.js +0 -119
- package/@tencent/polaris/dist/metadata.js.map +0 -1
- package/@tencent/polaris/dist/plugins/breaker/polaris.d.ts +0 -47
- package/@tencent/polaris/dist/plugins/breaker/polaris.js +0 -162
- package/@tencent/polaris/dist/plugins/breaker/polaris.js.map +0 -1
- package/@tencent/polaris/dist/plugins/lb/base.d.ts +0 -24
- package/@tencent/polaris/dist/plugins/lb/base.js +0 -32
- package/@tencent/polaris/dist/plugins/lb/base.js.map +0 -1
- package/@tencent/polaris/dist/plugins/lb/edf.d.ts +0 -24
- package/@tencent/polaris/dist/plugins/lb/edf.js +0 -77
- package/@tencent/polaris/dist/plugins/lb/edf.js.map +0 -1
- package/@tencent/polaris/dist/plugins/lb/hashring.d.ts +0 -24
- package/@tencent/polaris/dist/plugins/lb/hashring.js +0 -53
- package/@tencent/polaris/dist/plugins/lb/hashring.js.map +0 -1
- package/@tencent/polaris/dist/plugins/lb/sticky.d.ts +0 -31
- package/@tencent/polaris/dist/plugins/lb/sticky.js +0 -88
- package/@tencent/polaris/dist/plugins/lb/sticky.js.map +0 -1
- package/@tencent/polaris/dist/plugins/lb/swrr.d.ts +0 -25
- package/@tencent/polaris/dist/plugins/lb/swrr.js +0 -72
- package/@tencent/polaris/dist/plugins/lb/swrr.js.map +0 -1
- package/@tencent/polaris/dist/plugins/lb/wr.d.ts +0 -17
- package/@tencent/polaris/dist/plugins/lb/wr.js +0 -50
- package/@tencent/polaris/dist/plugins/lb/wr.js.map +0 -1
- package/@tencent/polaris/dist/plugins/lb/wrr.d.ts +0 -19
- package/@tencent/polaris/dist/plugins/lb/wrr.js +0 -81
- package/@tencent/polaris/dist/plugins/lb/wrr.js.map +0 -1
- package/@tencent/polaris/dist/plugins/logging/console.d.ts +0 -10
- package/@tencent/polaris/dist/plugins/logging/console.js +0 -38
- package/@tencent/polaris/dist/plugins/logging/console.js.map +0 -1
- package/@tencent/polaris/dist/plugins/naming/local-server/index.d.ts +0 -32
- package/@tencent/polaris/dist/plugins/naming/local-server/index.js +0 -88
- package/@tencent/polaris/dist/plugins/naming/local-server/index.js.map +0 -1
- package/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/base.d.ts +0 -124
- package/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/base.js +0 -398
- package/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/base.js.map +0 -1
- package/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/discover.d.ts +0 -27
- package/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/discover.js +0 -287
- package/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/discover.js.map +0 -1
- package/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/index.d.ts +0 -15
- package/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/index.js +0 -43
- package/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/index.js.map +0 -1
- package/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/monitor.d.ts +0 -28
- package/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/monitor.js +0 -249
- package/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/monitor.js.map +0 -1
- package/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/ratelimit.d.ts +0 -19
- package/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/ratelimit.js +0 -222
- package/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/ratelimit.js.map +0 -1
- package/@tencent/polaris/dist/plugins/naming/polaris-server/connector/grpc/bidi.d.ts +0 -26
- package/@tencent/polaris/dist/plugins/naming/polaris-server/connector/grpc/bidi.js +0 -99
- package/@tencent/polaris/dist/plugins/naming/polaris-server/connector/grpc/bidi.js.map +0 -1
- package/@tencent/polaris/dist/plugins/naming/polaris-server/connector/grpc/index.d.ts +0 -60
- package/@tencent/polaris/dist/plugins/naming/polaris-server/connector/grpc/index.js +0 -259
- package/@tencent/polaris/dist/plugins/naming/polaris-server/connector/grpc/index.js.map +0 -1
- package/@tencent/polaris/dist/plugins/naming/polaris-server/connector/grpc/pb/discover.proto +0 -24
- package/@tencent/polaris/dist/plugins/naming/polaris-server/connector/grpc/pb/monitor.proto +0 -18
- package/@tencent/polaris/dist/plugins/naming/polaris-server/connector/grpc/pb/ratelimit.proto +0 -12
- package/@tencent/polaris/dist/plugins/naming/polaris-server/connector/http/index.d.ts +0 -39
- package/@tencent/polaris/dist/plugins/naming/polaris-server/connector/http/index.js +0 -115
- package/@tencent/polaris/dist/plugins/naming/polaris-server/connector/http/index.js.map +0 -1
- package/@tencent/polaris/dist/plugins/naming/polaris-server/discover-pb/api.proto +0 -24
- package/@tencent/polaris/dist/plugins/naming/polaris-server/discover-pb/client.proto +0 -22
- package/@tencent/polaris/dist/plugins/naming/polaris-server/discover-pb/model.proto +0 -28
- package/@tencent/polaris/dist/plugins/naming/polaris-server/discover-pb/ratelimit.proto +0 -80
- package/@tencent/polaris/dist/plugins/naming/polaris-server/discover-pb/request.proto +0 -18
- package/@tencent/polaris/dist/plugins/naming/polaris-server/discover-pb/response.proto +0 -65
- package/@tencent/polaris/dist/plugins/naming/polaris-server/discover-pb/routing.proto +0 -66
- package/@tencent/polaris/dist/plugins/naming/polaris-server/discover-pb/service.proto +0 -95
- package/@tencent/polaris/dist/plugins/naming/polaris-server/discover-pb/types.d.ts +0 -1568
- package/@tencent/polaris/dist/plugins/naming/polaris-server/index.d.ts +0 -36
- package/@tencent/polaris/dist/plugins/naming/polaris-server/index.js +0 -51
- package/@tencent/polaris/dist/plugins/naming/polaris-server/index.js.map +0 -1
- package/@tencent/polaris/dist/plugins/naming/polaris-server/monitor-pb/api.proto +0 -18
- package/@tencent/polaris/dist/plugins/naming/polaris-server/monitor-pb/circuitbreak.proto +0 -67
- package/@tencent/polaris/dist/plugins/naming/polaris-server/monitor-pb/request.proto +0 -82
- package/@tencent/polaris/dist/plugins/naming/polaris-server/monitor-pb/response.proto +0 -11
- package/@tencent/polaris/dist/plugins/naming/polaris-server/monitor-pb/sdkcache.proto +0 -46
- package/@tencent/polaris/dist/plugins/naming/polaris-server/monitor-pb/sdkconfiguration.proto +0 -16
- package/@tencent/polaris/dist/plugins/naming/polaris-server/monitor-pb/sdktoken.proto +0 -10
- package/@tencent/polaris/dist/plugins/naming/polaris-server/monitor-pb/types.d.ts +0 -1102
- package/@tencent/polaris/dist/plugins/naming/polaris-server/pool.d.ts +0 -29
- package/@tencent/polaris/dist/plugins/naming/polaris-server/pool.js +0 -77
- package/@tencent/polaris/dist/plugins/naming/polaris-server/pool.js.map +0 -1
- package/@tencent/polaris/dist/plugins/naming/polaris-server/ratelimit-pb/api.proto +0 -12
- package/@tencent/polaris/dist/plugins/naming/polaris-server/ratelimit-pb/ratelimit.proto +0 -28
- package/@tencent/polaris/dist/plugins/naming/polaris-server/ratelimit-pb/types.d.ts +0 -395
- package/@tencent/polaris/dist/plugins/naming/polaris-server/rules.d.ts +0 -13
- package/@tencent/polaris/dist/plugins/naming/polaris-server/rules.js +0 -116
- package/@tencent/polaris/dist/plugins/naming/polaris-server/rules.js.map +0 -1
- package/@tencent/polaris/dist/plugins/naming/polaris-server/types.d.ts +0 -67
- package/@tencent/polaris/dist/plugins/naming/polaris-server/types.js +0 -67
- package/@tencent/polaris/dist/plugins/naming/polaris-server/types.js.map +0 -1
- package/@tencent/polaris/dist/plugins/naming/polaris-server/utils.d.ts +0 -99
- package/@tencent/polaris/dist/plugins/naming/polaris-server/utils.js +0 -217
- package/@tencent/polaris/dist/plugins/naming/polaris-server/utils.js.map +0 -1
- package/@tencent/polaris/dist/plugins/registry/memory.d.ts +0 -10
- package/@tencent/polaris/dist/plugins/registry/memory.js +0 -50
- package/@tencent/polaris/dist/plugins/registry/memory.js.map +0 -1
- package/@tencent/polaris/dist/plugins/router/polaris/nearby.d.ts +0 -51
- package/@tencent/polaris/dist/plugins/router/polaris/nearby.js +0 -145
- package/@tencent/polaris/dist/plugins/router/polaris/nearby.js.map +0 -1
- package/@tencent/polaris/dist/plugins/router/polaris/rule.d.ts +0 -11
- package/@tencent/polaris/dist/plugins/router/polaris/rule.js +0 -174
- package/@tencent/polaris/dist/plugins/router/polaris/rule.js.map +0 -1
- package/@tencent/polaris/dist/plugins/router/trpc/canary.d.ts +0 -25
- package/@tencent/polaris/dist/plugins/router/trpc/canary.js +0 -36
- package/@tencent/polaris/dist/plugins/router/trpc/canary.js.map +0 -1
- package/@tencent/polaris/dist/plugins/router/trpc/env.d.ts +0 -10
- package/@tencent/polaris/dist/plugins/router/trpc/env.js +0 -34
- package/@tencent/polaris/dist/plugins/router/trpc/env.js.map +0 -1
- package/@tencent/polaris/dist/plugins/router/trpc/set.d.ts +0 -56
- package/@tencent/polaris/dist/plugins/router/trpc/set.js +0 -106
- package/@tencent/polaris/dist/plugins/router/trpc/set.js.map +0 -1
- package/@tencent/polaris/dist/plugins/shaping/unirate.d.ts +0 -31
- package/@tencent/polaris/dist/plugins/shaping/unirate.js +0 -124
- package/@tencent/polaris/dist/plugins/shaping/unirate.js.map +0 -1
- package/@tencent/polaris/dist/plugins/shaping/warmup.d.ts +0 -61
- package/@tencent/polaris/dist/plugins/shaping/warmup.js +0 -171
- package/@tencent/polaris/dist/plugins/shaping/warmup.js.map +0 -1
- package/@tencent/polaris/dist/plugins/weight/polaris.d.ts +0 -23
- package/@tencent/polaris/dist/plugins/weight/polaris.js +0 -159
- package/@tencent/polaris/dist/plugins/weight/polaris.js.map +0 -1
- package/@tencent/polaris/dist/plugins.d.ts +0 -619
- package/@tencent/polaris/dist/plugins.js +0 -91
- package/@tencent/polaris/dist/plugins.js.map +0 -1
- package/@tencent/polaris/dist/polaris.d.ts +0 -33
- package/@tencent/polaris/dist/polaris.js +0 -59
- package/@tencent/polaris/dist/polaris.js.map +0 -1
- package/@tencent/polaris/dist/provider/index.d.ts +0 -102
- package/@tencent/polaris/dist/provider/index.js +0 -168
- package/@tencent/polaris/dist/provider/index.js.map +0 -1
- package/@tencent/polaris/dist/registry.d.ts +0 -174
- package/@tencent/polaris/dist/registry.js +0 -660
- package/@tencent/polaris/dist/registry.js.map +0 -1
- package/@tencent/polaris/dist/rules.d.ts +0 -163
- package/@tencent/polaris/dist/rules.js +0 -24
- package/@tencent/polaris/dist/rules.js.map +0 -1
- package/@tencent/polaris/dist/scripts/postinstall.d.ts +0 -1
- package/@tencent/polaris/dist/scripts/postinstall.js +0 -71
- package/@tencent/polaris/dist/scripts/postinstall.js.map +0 -1
- package/@tencent/polaris/dist/service.d.ts +0 -18
- package/@tencent/polaris/dist/service.js +0 -3
- package/@tencent/polaris/dist/service.js.map +0 -1
- package/@tencent/polaris/dist/skeleton.d.ts +0 -87
- package/@tencent/polaris/dist/skeleton.js +0 -282
- package/@tencent/polaris/dist/skeleton.js.map +0 -1
- package/@tencent/polaris/dist/utils.d.ts +0 -36
- package/@tencent/polaris/dist/utils.js +0 -74
- package/@tencent/polaris/dist/utils.js.map +0 -1
- package/@tencent/polaris/dist/weak.d.ts +0 -11
- package/@tencent/polaris/dist/weak.js +0 -44
- package/@tencent/polaris/dist/weak.js.map +0 -1
- package/@tencent/polaris/package.json +0 -114
- package/resource/doc/chatuikit/react/integrate_tuichat_only_react.md +0 -185
- package/resource/doc/chatuikit/react/integrate_tuichat_react.md +0 -212
- package/resource/doc/chatuikit/vue/integrate_tuichat_only_vue.md +0 -149
- package/resource/doc/chatuikit/vue/integrate_tuichat_vue.md +0 -248
- package/streamableHttp.js +0 -74
- package/streamableHttp.js.map +0 -1
- /package/resource/doc/chatuikit/{iOS → ios}/client_api_iOS.md +0 -0
- /package/resource/doc/chatuikit/{iOS → ios}/integrate_tuichat_only_iOS.md +0 -0
- /package/resource/doc/chatuikit/{iOS → ios}/integrate_tuikit_iOS.md +0 -0
- /package/resource/doc/chatuikit/{iOS → ios}/ui_api_iOS.md +0 -0
- /package/resource/doc/tuicallkit/{iOS → ios}/api_TUICallKit.md +0 -0
- /package/resource/doc/tuicallkit/{iOS → ios}/api_TUICallObserver.md +0 -0
- /package/resource/doc/tuicallkit/{iOS → ios}/how_to_integrated_iOS_callkit.md +0 -0
- /package/resource/doc/tuicallkit/{iOS → ios}/how_to_run_iOS_callkit_demo.md +0 -0
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
## 概述
|
|
2
|
+
|
|
3
|
+
UserPicker 是一个功能强大的用户选择器组件,支持列表和树形两种显示模式。组件提供了搜索、多选、懒加载、自定义渲染等功能,适用于用户选择、组织架构选择、权限分配等业务场景。组件内置了选择状态管理、搜索过滤、树形展开等复杂逻辑,提供了简洁易用的 API 接口。
|
|
4
|
+
|
|
5
|
+
## Props 速查表
|
|
6
|
+
|
|
7
|
+
| 字段 | 类型 | 默认值 | 描述 |
|
|
8
|
+
| -------------------- | -------------------------------------------- | -------------------------- | ----------- |
|
|
9
|
+
| displayMode | `'list' \| 'tree'` | 必填 | 显示模式,列表或树形 |
|
|
10
|
+
| dataSource | `UserPickerDataSource<T>` | `[]` | 数据源 |
|
|
11
|
+
| defaultSelectedItems | `Array<{ key: string; [key: string]: any }>` | `[]` | 默认选中项 |
|
|
12
|
+
| lockedItems | `Array<{ key: string; [key: string]: any }>` | `[]` | 锁定项(不可取消选择) |
|
|
13
|
+
| maxCount | `number` | `Number.POSITIVE_INFINITY` | 最大选择数量 |
|
|
14
|
+
| minCount | `number` | `0` | 最小选择数量 |
|
|
15
|
+
| enableSearch | `boolean` | `true` | 是否启用搜索功能 |
|
|
16
|
+
| searchPlaceholder | `string` | `undefined` | 搜索框占位符 |
|
|
17
|
+
| renderItem | `Function` | `undefined` | 自定义渲染函数 |
|
|
18
|
+
| onSelectedChange | `Function` | `undefined` | 选择变化回调 |
|
|
19
|
+
| onMaxCountExceed | `Function` | `undefined` | 超出最大数量回调 |
|
|
20
|
+
| onSearch | `Function` | `undefined` | 搜索回调 |
|
|
21
|
+
| onReachEnd | `Function` | `undefined` | 列表模式滚动到底部回调 |
|
|
22
|
+
| onExpand | `Function` | `undefined` | 树形模式展开回调 |
|
|
23
|
+
|
|
24
|
+
## Ref expose 方法速查表
|
|
25
|
+
|
|
26
|
+
|方法名 | 参数 | 返回值 | 描述 |
|
|
27
|
+
| -------- | ---- | ---- | ---- |
|
|
28
|
+
| getSelectedItems | 无 | UserPickerResult<T> | 获取当前选中的项目 |
|
|
29
|
+
| updateTreeData | nodeKey: string, partialNode: Partial<UserPickerNode<T>> | void | 更新树形模式节点数据
|
|
30
|
+
|
|
31
|
+
## Props 详细介绍
|
|
32
|
+
|
|
33
|
+
### displayMode
|
|
34
|
+
|
|
35
|
+
- `类型`: `'list' | 'tree'`
|
|
36
|
+
- `描述`:组件的显示模式。`list` 模式显示平铺列表,`tree` 模式显示树形结构,支持层级展开和懒加载。
|
|
37
|
+
|
|
38
|
+
### dataSource
|
|
39
|
+
|
|
40
|
+
- `类型`: `UserPickerDataSource<T>`
|
|
41
|
+
- `描述`:组件的数据源,根据 displayMode 的不同接受不同的数据结构,默认值为 `[]`。
|
|
42
|
+
|
|
43
|
+
```typescript
|
|
44
|
+
// 列表模式数据结构
|
|
45
|
+
interface UserPickerRow<T = unknown> {
|
|
46
|
+
key: string; // 唯一标识符
|
|
47
|
+
label: string; // 显示名称
|
|
48
|
+
avatarUrl?: string; // 头像URL
|
|
49
|
+
extraData?: T; // 扩展数据
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// 树形模式数据结构
|
|
53
|
+
interface UserPickerNode<T = unknown> {
|
|
54
|
+
key: string; // 唯一标识符
|
|
55
|
+
label: string; // 显示名称
|
|
56
|
+
isLeafNode: boolean; // 是否为叶子节点
|
|
57
|
+
avatarUrl?: string; // 头像URL
|
|
58
|
+
lazyLoad?: boolean; // 是否支持懒加载
|
|
59
|
+
children?: Array<UserPickerNode<T>>; // 子节点
|
|
60
|
+
extraData?: T; // 扩展数据
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export type UserPickerDataSource<T = unknown> = Array<UserPickerRow<T>> | Array<UserPickerNode<T>>;
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
#### Example 1: 列表模式数据源
|
|
67
|
+
|
|
68
|
+
```vue
|
|
69
|
+
<template>
|
|
70
|
+
<UserPicker
|
|
71
|
+
display-mode="list"
|
|
72
|
+
:data-source="listData"
|
|
73
|
+
@selected-change="handleSelectionChange"
|
|
74
|
+
/>
|
|
75
|
+
</template>
|
|
76
|
+
|
|
77
|
+
<script setup lang="ts">
|
|
78
|
+
import { ref } from 'vue';
|
|
79
|
+
import { UserPicker } from 'tuikit-atomicx-vue3';
|
|
80
|
+
import type { UserPickerRow } from 'tuikit-atomicx-vue3/types';
|
|
81
|
+
|
|
82
|
+
// 用户列表数据
|
|
83
|
+
const listData = ref<UserPickerRow[]>([
|
|
84
|
+
{
|
|
85
|
+
key: 'user1',
|
|
86
|
+
label: '张三',
|
|
87
|
+
avatarUrl: 'https://example.com/avatar1.jpg',
|
|
88
|
+
extraData: { department: '技术部', role: '前端工程师' }
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
key: 'user2',
|
|
92
|
+
label: '李四',
|
|
93
|
+
avatarUrl: 'https://example.com/avatar2.jpg',
|
|
94
|
+
extraData: { department: '产品部', role: '产品经理' }
|
|
95
|
+
}
|
|
96
|
+
]);
|
|
97
|
+
|
|
98
|
+
const handleSelectionChange = (selectedItems: any[]) => {
|
|
99
|
+
console.log('选中的用户:', selectedItems);
|
|
100
|
+
};
|
|
101
|
+
</script>
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### defaultSelectedItems
|
|
105
|
+
|
|
106
|
+
- `类型`: `Array<{ key: string; [key: string]: any }>`
|
|
107
|
+
- `描述`:默认选中的项目列表,通过 key 字段标识选中项,默认值为 `[]`。
|
|
108
|
+
|
|
109
|
+
### lockedItems
|
|
110
|
+
|
|
111
|
+
- `类型`: `Array<{ key: string; [key: string]: any }>`
|
|
112
|
+
- `描述`:锁定的项目列表,这些项目将被强制选中且用户无法取消选择,默认值为 `[]`。
|
|
113
|
+
|
|
114
|
+
### maxCount
|
|
115
|
+
|
|
116
|
+
- `类型`: `number`
|
|
117
|
+
- `描述`:允许选择的最大数量限制,超出时会触发 onMaxCountExceed 回调,默认值为 `Number.POSITIVE_INFINITY`。
|
|
118
|
+
|
|
119
|
+
### minCount
|
|
120
|
+
|
|
121
|
+
- `类型`: `number`
|
|
122
|
+
- `描述`:要求选择的最小数量,用于表单验证等场景,默认值为 `0`。
|
|
123
|
+
|
|
124
|
+
### enableSearch
|
|
125
|
+
|
|
126
|
+
- `类型`: `boolean`
|
|
127
|
+
- `描述`:是否启用搜索功能,启用后会显示搜索框,默认值为 `true`。
|
|
128
|
+
|
|
129
|
+
### searchPlaceholder
|
|
130
|
+
|
|
131
|
+
- `类型`: `string`
|
|
132
|
+
- `描述`:搜索框的占位符文本,如果不设置则使用默认的国际化文本,默认值为 `undefined`。
|
|
133
|
+
|
|
134
|
+
### renderItem
|
|
135
|
+
|
|
136
|
+
- `类型`: `(data: UserPickerRow<T> | UserPickerNode<T>) => any`
|
|
137
|
+
- `描述`:自定义项目渲染函数,可以自定义每个选项的显示内容和样式,默认值为 `undefined`。
|
|
138
|
+
|
|
139
|
+
```typescript
|
|
140
|
+
type RenderItemFunction<T> = (data: UserPickerRow<T> | UserPickerNode<T>) => VNode | string;
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
#### Example: 自定义渲染函数
|
|
144
|
+
|
|
145
|
+
```vue
|
|
146
|
+
<template>
|
|
147
|
+
<UserPicker
|
|
148
|
+
display-mode="list"
|
|
149
|
+
:data-source="userData"
|
|
150
|
+
:render-item="customRenderItem"
|
|
151
|
+
/>
|
|
152
|
+
</template>
|
|
153
|
+
|
|
154
|
+
<script setup lang="ts">
|
|
155
|
+
import { h } from 'vue';
|
|
156
|
+
import { UserPicker } from 'tuikit-atomicx-vue3';
|
|
157
|
+
import type { UserPickerRow } from 'tuikit-atomicx-vue3/types';
|
|
158
|
+
|
|
159
|
+
const userData = ref<UserPickerRow[]>([
|
|
160
|
+
{
|
|
161
|
+
key: 'user1',
|
|
162
|
+
label: '张三',
|
|
163
|
+
extraData: { status: 'online', department: '技术部' }
|
|
164
|
+
}
|
|
165
|
+
]);
|
|
166
|
+
|
|
167
|
+
// 自定义渲染函数,显示用户状态和部门信息
|
|
168
|
+
const customRenderItem = (data: UserPickerRow) => {
|
|
169
|
+
return h('div', { class: 'custom-user-item' }, [
|
|
170
|
+
h('div', { class: 'user-name' }, data.label),
|
|
171
|
+
h('div', { class: 'user-info' }, [
|
|
172
|
+
h('span', {
|
|
173
|
+
class: `status ${data.extraData?.status}`
|
|
174
|
+
}, data.extraData?.status === 'online' ? '在线' : '离线'),
|
|
175
|
+
h('span', { class: 'department' }, data.extraData?.department)
|
|
176
|
+
])
|
|
177
|
+
]);
|
|
178
|
+
};
|
|
179
|
+
</script>
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
### onSelectedChange
|
|
183
|
+
|
|
184
|
+
- `类型`: `(selectedItems: UserPickerResult<T>) => void`
|
|
185
|
+
- `描述`:选择状态变化时的回调函数,会传入当前选中的所有项目,默认值为 `undefined`。应该尽量减少使用避免频繁的触发回调函数。
|
|
186
|
+
|
|
187
|
+
```typescript
|
|
188
|
+
interface UserPickerResultItem<T = unknown> {
|
|
189
|
+
key: string;
|
|
190
|
+
label: string;
|
|
191
|
+
avatarUrl?: string;
|
|
192
|
+
isLeafNode?: boolean; // 仅树形模式有意义
|
|
193
|
+
extraData?: T;
|
|
194
|
+
path?: string[]; // 仅树形模式有意义,记录节点路径
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
type UserPickerResult<T = unknown> = Array<UserPickerResultItem<T>>;
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
### onMaxCountExceed
|
|
201
|
+
|
|
202
|
+
- `类型`: `(selectedItems: UserPickerResult<T>) => void`
|
|
203
|
+
- `描述`:当选择数量超出 maxCount 限制时触发的回调函数,默认值为 `undefined`。
|
|
204
|
+
|
|
205
|
+
### onSearch
|
|
206
|
+
|
|
207
|
+
- `类型`: `(value: string) => void`
|
|
208
|
+
- `描述`:搜索输入变化时的回调函数,可用于实现服务端搜索,默认值为 `undefined`。
|
|
209
|
+
|
|
210
|
+
### onReachEnd
|
|
211
|
+
|
|
212
|
+
- `类型`: `() => void`
|
|
213
|
+
- `描述`:列表模式下滚动到底部时的回调函数,常用于实现分页加载,默认值为 `undefined`。
|
|
214
|
+
|
|
215
|
+
### onExpand
|
|
216
|
+
|
|
217
|
+
- `类型`: `(node: UserPickerNode<T>) => void`
|
|
218
|
+
- `描述`:树形模式下节点展开时的回调函数,用于实现懒加载子节点,默认值为 `undefined`。
|
|
219
|
+
|
|
220
|
+
## Ref Expose 方法详细介绍
|
|
221
|
+
|
|
222
|
+
### getSelectedItems
|
|
223
|
+
|
|
224
|
+
- `类型`:`() => UserPickerResult<T>`
|
|
225
|
+
- `描述`:作为选择完成后确认时的最佳实践。
|
|
226
|
+
|
|
227
|
+
```typescript
|
|
228
|
+
interface UserPickerResultItem<T = unknown> {
|
|
229
|
+
key: string;
|
|
230
|
+
label: string;
|
|
231
|
+
avatarUrl?: string;
|
|
232
|
+
isLeafNode?: boolean; // 仅树形模式有意义
|
|
233
|
+
extraData?: T;
|
|
234
|
+
path?: string[]; // 仅树形模式有意义,记录节点路径
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
type UserPickerResult<T = unknown> = Array<UserPickerResultItem<T>>;
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
#### Example: 选择完成后确认时获取选中的项
|
|
241
|
+
|
|
242
|
+
```vue
|
|
243
|
+
<template>
|
|
244
|
+
<UserPicker
|
|
245
|
+
ref="userPickerRef"
|
|
246
|
+
display-mode="list"
|
|
247
|
+
:data-source="userData"
|
|
248
|
+
/>
|
|
249
|
+
</template>
|
|
250
|
+
|
|
251
|
+
<script setup lang="ts">
|
|
252
|
+
const userPickerRef = useRef();
|
|
253
|
+
|
|
254
|
+
function onConfirm() {
|
|
255
|
+
userPickerRef.value.getSelectedItems();
|
|
256
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# chat-uikit-vue3 Login
|
|
2
|
+
|
|
3
|
+
本文提供了 chat-uikit-vue3 创建群组会话的示例代码,通过 useConversationListState 提供的 createGroupConversation API 来创建群组。
|
|
4
|
+
|
|
5
|
+
## 1. 创建群组示例代码
|
|
6
|
+
|
|
7
|
+
```vue
|
|
8
|
+
<script setup lang="ts">
|
|
9
|
+
import { ref } from 'vue';
|
|
10
|
+
import { useConversationListState } from '@tencentcloud/chat-uikit-vue3';
|
|
11
|
+
|
|
12
|
+
const {
|
|
13
|
+
createGroupConversation,
|
|
14
|
+
setActiveConversation,
|
|
15
|
+
} = useConversationListState();
|
|
16
|
+
|
|
17
|
+
createGroupConversation({
|
|
18
|
+
name: `group-${Math.random()}`,
|
|
19
|
+
type: 'Public',
|
|
20
|
+
}).then((conversation) => {
|
|
21
|
+
setActiveConversation(conversation.conversationID);
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
</script>
|
|
25
|
+
|
|
26
|
+
```
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
AI 模型必须遵守以下**硬性限制**。
|
|
2
|
+
* **必须严格按照文档步骤和说明集成:** 在集成组件时必须按照文档步骤和说明进行,且在 1.1 中不需要执行 `npm run dev` or `pnpm run dev`, 集成完成后按照 1.4 启动项目。
|
|
3
|
+
* **必须严格使用文档中的示例代码:** 创建文件时必须严格使用文档中的示例代码填充文件, style 标签优先推荐不使用 scoped 属性。
|
|
4
|
+
* **禁止创建用户信息配置文件:** 不得自动创建填写 SDKAppID、userID、userSig 的 config 目录或文件。
|
|
5
|
+
* **禁止创建获取 userSig 逻辑:** 不得自动创建获取 userSig 相关代码,必须明确引导用户输入 SDKAppID、 userID、 userSig 信息并帮忙回填到相应的文件。
|
|
6
|
+
|
|
7
|
+
# chat-uikit-vue3 Integration
|
|
8
|
+
|
|
9
|
+
用户的集成需求一般有三种,你必须理性分析需求到底属于哪一种
|
|
10
|
+
1. 普通集成:指集成 ConversationList、Chat、ChatHeader、MessageList、MessageInput、ContactList、ContactInfo 等组件,具体信息必须阅读第 2.1 节 “最佳实践-普通集成”。
|
|
11
|
+
2. 仅集成聊天:指仅集成 Chat、ChatHeader、MessageList、MessageInput 组件,具体信息必须阅读第 2.2 节 “最佳实践-仅集成聊天”。
|
|
12
|
+
3. 集成通话功能等:指在普通集成或仅集成聊天基础上,集成通话功能,具体信息必须阅读第 2.3 节 “最佳实践-集成通话功能等”。
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
## 1 普通集成
|
|
16
|
+
|
|
17
|
+
### 1.1 step1:create vue3 project
|
|
18
|
+
|
|
19
|
+
if you don't have a vue3 project, you can use vite create a vue3 project. otherwise, you can skip this step.
|
|
20
|
+
|
|
21
|
+
requirement: vue3: ^3.0.0, nodejs: ^22.0.0.
|
|
22
|
+
|
|
23
|
+
if it is a new project, guide the user to use vite to create a vue3 project manually, and then continue with step 1.2. if it is an existing project, skip this step and continue with step 1.2.
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
pnpm create vite@latest
|
|
27
|
+
# skip some settings
|
|
28
|
+
cd ${your-vue-project-name}
|
|
29
|
+
pnpm install
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### 1.2 step2: install chat-uikit-vue3
|
|
33
|
+
|
|
34
|
+
use npm or pnpm to install @tencentcloud/chat-uikit-vue3@latest @tencentcloud/call-uikit-vue@latest
|
|
35
|
+
|
|
36
|
+
### 1.3 step3: add main content to your project
|
|
37
|
+
|
|
38
|
+
```vue
|
|
39
|
+
<template>
|
|
40
|
+
<UIKitProvider language="zh-CN">
|
|
41
|
+
<div class="chat-layout">
|
|
42
|
+
<div class="sidebar" style="width: 300px;">
|
|
43
|
+
<div class="tab-header">
|
|
44
|
+
<button
|
|
45
|
+
:class="['tab-button', { active: activeTab === 'conversations' }]"
|
|
46
|
+
@click="activeTab = 'conversations'"
|
|
47
|
+
>
|
|
48
|
+
会话
|
|
49
|
+
</button>
|
|
50
|
+
<button
|
|
51
|
+
:class="['tab-button', { active: activeTab === 'contacts' }]"
|
|
52
|
+
@click="activeTab = 'contacts'"
|
|
53
|
+
>
|
|
54
|
+
联系人
|
|
55
|
+
</button>
|
|
56
|
+
</div>
|
|
57
|
+
|
|
58
|
+
<div class="tab-content">
|
|
59
|
+
<ConversationList v-if="activeTab === 'conversations'" />
|
|
60
|
+
<ContactList v-else />
|
|
61
|
+
</div>
|
|
62
|
+
</div>
|
|
63
|
+
|
|
64
|
+
<Chat style="flex: 1;" v-if="activeTab === 'conversations'">
|
|
65
|
+
<ChatHeader />
|
|
66
|
+
<MessageList />
|
|
67
|
+
<MessageInput />
|
|
68
|
+
</Chat>
|
|
69
|
+
<ContactInfo v-else style="flex: 1;" @send-message="handleSendMessage" @enter-group="handleSendMessage" />
|
|
70
|
+
</div>
|
|
71
|
+
<Teleport to="body">
|
|
72
|
+
<TUICallKit style="position: fixed; z-index: 1000;"/>
|
|
73
|
+
</Teleport>
|
|
74
|
+
</UIKitProvider>
|
|
75
|
+
</template>
|
|
76
|
+
|
|
77
|
+
<script setup lang="ts">
|
|
78
|
+
import { ref } from 'vue';
|
|
79
|
+
import {
|
|
80
|
+
ConversationList,
|
|
81
|
+
Chat,
|
|
82
|
+
MessageList,
|
|
83
|
+
MessageInput,
|
|
84
|
+
ChatHeader,
|
|
85
|
+
ContactList,
|
|
86
|
+
ContactInfo,
|
|
87
|
+
UIKitProvider,
|
|
88
|
+
useLoginState,
|
|
89
|
+
} from '@tencentcloud/chat-uikit-vue3';
|
|
90
|
+
import { TUICallKit } from '@tencentcloud/call-uikit-vue';
|
|
91
|
+
|
|
92
|
+
const userID = ''; // TODO: Replace with your userID
|
|
93
|
+
const SDKAppID = 0; // TODO: Replace with your SDKAppID (Notice: SDKAppID is of type number)
|
|
94
|
+
const userSig = ''; // TODO: Replace with your userSig
|
|
95
|
+
|
|
96
|
+
const { login } = useLoginState();
|
|
97
|
+
|
|
98
|
+
const activeTab = ref<'conversations' | 'contacts'>('conversations');
|
|
99
|
+
|
|
100
|
+
login({
|
|
101
|
+
sdkAppId : SDKAppID,
|
|
102
|
+
userId: userID,
|
|
103
|
+
userSig: userSig,
|
|
104
|
+
})
|
|
105
|
+
.then(() => {})
|
|
106
|
+
|
|
107
|
+
.catch(() => {});
|
|
108
|
+
const handleSendMessage = () => {
|
|
109
|
+
activeTab.value = 'conversations';
|
|
110
|
+
}
|
|
111
|
+
</script>
|
|
112
|
+
|
|
113
|
+
<style>
|
|
114
|
+
#app{margin:0;padding:0;text-align:left;}.chat-layout{width:100vw;height:100vh;display:flex;}.sidebar{display:flex;flex-direction:column;border-right:1px solid #e5e7eb;}.tab-header{display:flex;border-bottom:1px solid #e5e7eb;}.tab-button{flex:1;padding:12px 16px;background:none;border:none;cursor:pointer;font-size:14px;color:#6b7280;transition:all 0.2s;}.tab-button.active{color:#3b82f6;background-color:#eff6ff;border-bottom:2px solid #3b82f6;}.tab-content{flex:1;overflow:hidden;}
|
|
115
|
+
</style>
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### 1.4 step4: start your project
|
|
119
|
+
```bash
|
|
120
|
+
pnpm run dev
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
## 2. 最佳实践
|
|
124
|
+
|
|
125
|
+
以下提到的组件通过 MCP Tools get_component_detail ${componenetname.tolowercase()} 获取。
|
|
126
|
+
以下提到的 state 通过 MCP Tools get_state_detail ${statename.tolowercase()} 获取。
|
|
127
|
+
|
|
128
|
+
### 2.1 最佳实践-普通集成
|
|
129
|
+
|
|
130
|
+
普通集成参考 1.3 节中的的代码示例。
|
|
131
|
+
|
|
132
|
+
重点:
|
|
133
|
+
1. 如果需要集成 ChatSetting 组件,请阅读 ChatHeader 的 ChatHeaderRight 插槽说明。
|
|
134
|
+
|
|
135
|
+
### 2.2 最佳实践-仅集成聊天
|
|
136
|
+
|
|
137
|
+
仅集成聊天视为普通集成但是仅保留 Chat 部分,参考 1.3 节中的的代码示例。但是仅保留 UIKitProvider、Chat、ChatHeader、MessageList、MessageInput 组件:
|
|
138
|
+
|
|
139
|
+
```vue
|
|
140
|
+
<template>
|
|
141
|
+
<UIKitProvider>
|
|
142
|
+
<Chat style="flex: 1;">
|
|
143
|
+
<ChatHeader />
|
|
144
|
+
<MessageList />
|
|
145
|
+
<MessageInput />
|
|
146
|
+
</Chat>
|
|
147
|
+
</UIKitProvider>
|
|
148
|
+
</template>
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
重点:
|
|
152
|
+
1. 由于仅集成聊天不使用 ConversationList,你需要使用 ConversationListState 的 useConversationListState 获取 activeConversation,然后调用 setActiveConversation 设置 activeConversation。
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
```vue
|
|
156
|
+
<script setup lang="ts">
|
|
157
|
+
import { useConversationListState } from '@tencentcloud/chat-uikit-vue3';
|
|
158
|
+
|
|
159
|
+
const { setActiveConversation } = useConversationListState();
|
|
160
|
+
|
|
161
|
+
const conversationID = ref(''); // define by yourself
|
|
162
|
+
|
|
163
|
+
onMounted(() => {
|
|
164
|
+
setActiveConversation(conversationID.value);
|
|
165
|
+
});
|
|
166
|
+
</script>
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
重点:
|
|
170
|
+
2. 如果需要集成 ChatSetting 组件,请阅读 ChatHeader 的 ChatHeaderRight 插槽说明。
|
|
171
|
+
|
|
172
|
+
### 2.3 最佳实践-集成通话功能等
|
|
173
|
+
|
|
174
|
+
集成通话功能需要在普通集成或仅集成聊天基础上,添加通话功能的代码。
|
|
175
|
+
|
|
176
|
+
引入 TUICallKit 组件:
|
|
177
|
+
```vue
|
|
178
|
+
<script setup lang="ts">
|
|
179
|
+
import { TUICallKit } from '@tencentcloud/call-uikit-vue';
|
|
180
|
+
</script>
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
在合适的位置添加 TUICallKit 组件:
|
|
184
|
+
```vue
|
|
185
|
+
<Teleport to="body">
|
|
186
|
+
<TUICallKit style="position: fixed; z-index: 1000;"/>
|
|
187
|
+
</Teleport>
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
重点:
|
|
191
|
+
1. 需要在 ChatHeader 组件的 ChatHeaderRight 插槽中添加通话按钮。
|
|
192
|
+
2. 点击通话按钮调用以下方法:
|
|
193
|
+
2.1 阅读 ConversationListState 文档,通过 activeConversation 判断当前是单聊还是群聊。
|
|
194
|
+
2.2 如果是单聊,通过 `import { TUICallKitServer, TUICallType } from '@tencentcloud/call-uikit-vue';` 引入 TUICallKitService 服务。通过 TUICallKitService 的 `calls` 方法发起通话。
|
|
195
|
+
```ts
|
|
196
|
+
try {
|
|
197
|
+
await TUICallKitServer.calls({
|
|
198
|
+
userIDList: [activeConversation.value.userProfile.userID],
|
|
199
|
+
type: TUICallType.VIDEO_CALL, // or TUICallType.AUDIO_CALL
|
|
200
|
+
});
|
|
201
|
+
} catch (error: any) {
|
|
202
|
+
console.error(`[TUICallKit] Failed to call the groupCall API. Reason:${error}`);
|
|
203
|
+
}
|
|
204
|
+
```
|
|
205
|
+
2.3 如果是群聊,需要阅读 UserPicker 组件文档,建议结合 Dialog 组件,弹出 UserPicker 组件。
|
|
206
|
+
阅读 GroupSettingState 文档,结合 GroupSettingState 的 `getGroupMemberList`、`allMembers` 等属性,获取群成员列表。
|
|
207
|
+
```ts
|
|
208
|
+
try {
|
|
209
|
+
await TUICallKitServer.calls({
|
|
210
|
+
userIDList: selectedItems.map((item: any) => item.key),
|
|
211
|
+
type: TUICallType.VIDEO_CALL, // or TUICallType.AUDIO_CALL
|
|
212
|
+
});
|
|
213
|
+
} catch (error: any) {
|
|
214
|
+
console.error(`[TUICallKit] Failed to call the groupCall API. Reason:${error}`);
|
|
215
|
+
}
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
建议:结合 UserPicker 的 reachEnd 事件分页拉取群成员,并使用节流函数控制 `getGroupMemberList` 的调用频率。
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# chat-uikit-vue3 Login
|
|
2
|
+
|
|
3
|
+
本文提供了 chat-uikit-vue3 登录的示例代码, 通过 useLoginState 提供的 login API 来驱动组件登录。
|
|
4
|
+
|
|
5
|
+
## 1. 登录
|
|
6
|
+
|
|
7
|
+
```vue
|
|
8
|
+
<script setup lang="ts">
|
|
9
|
+
import { ref } from 'vue';
|
|
10
|
+
import { useLoginState } from '@tencentcloud/chat-uikit-vue3';
|
|
11
|
+
|
|
12
|
+
const userID = ''; // TODO: Replace with your userID
|
|
13
|
+
const SDKAppID = 0; // TODO: Replace with your SDKAppID (Notice: SDKAppID is of type number)
|
|
14
|
+
const userSig = ''; // TODO: Replace with your userSig
|
|
15
|
+
|
|
16
|
+
const { login } = useLoginState();
|
|
17
|
+
|
|
18
|
+
login({
|
|
19
|
+
sdkAppId : SDKAppID,
|
|
20
|
+
userId: userID,
|
|
21
|
+
userSig: userSig,
|
|
22
|
+
})
|
|
23
|
+
.then(() => {})
|
|
24
|
+
|
|
25
|
+
.catch(() => {});
|
|
26
|
+
|
|
27
|
+
</script>
|
|
28
|
+
|
|
29
|
+
```
|