@tencentcloud/chat-uikit-react 2.2.3 → 2.2.4

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.
Files changed (124) hide show
  1. package/.editorconfig +16 -0
  2. package/.eslintrc.js +112 -41
  3. package/.husky/pre-commit +4 -0
  4. package/.lintstagedrc.json +6 -0
  5. package/.stylelintrc.js +41 -0
  6. package/CHANGELOG.md +5 -0
  7. package/dist/cjs/components/DivWithEdit/WithText.js +1 -1
  8. package/dist/cjs/components/Input/Input.js +1 -1
  9. package/dist/cjs/components/Plugins/index.js +1 -1
  10. package/dist/cjs/components/TUIKit/TUIKit.js +1 -1
  11. package/dist/cjs/components/TUIMessage/utils/emojiMap.js +1 -1
  12. package/dist/cjs/components/TUIMessageInput/TUIMessageInputDefault.js +1 -1
  13. package/dist/cjs/components/TUIMessageInput/hooks/useEmojiPicker.js +1 -1
  14. package/dist/cjs/components/TUIMessageInput/hooks/useMessageInputText.js +1 -1
  15. package/dist/cjs/components/TUIMessageList/TUIMessageList.js +1 -1
  16. package/dist/cjs/components/untils.js +1 -1
  17. package/dist/cjs/index.css +1 -1
  18. package/dist/cjs/index.d.css +3 -6
  19. package/dist/cjs/index.d.ts +1 -1
  20. package/dist/cjs/index.js +1 -1
  21. package/dist/cjs/locales/en-US/index.js +1 -0
  22. package/dist/cjs/locales/index.js +1 -1
  23. package/dist/cjs/locales/ja-JP/TUIChat.js +1 -0
  24. package/dist/cjs/locales/ja-JP/TUIContact.js +1 -0
  25. package/dist/cjs/locales/ja-JP/TUIConversation.js +1 -0
  26. package/dist/cjs/locales/ja-JP/TUIProfile.js +1 -0
  27. package/dist/cjs/locales/ja-JP/index.js +1 -0
  28. package/dist/cjs/locales/ko-KR/TUIChat.js +1 -0
  29. package/dist/cjs/locales/ko-KR/TUIContact.js +1 -0
  30. package/dist/cjs/locales/ko-KR/TUIConversation.js +1 -0
  31. package/dist/cjs/locales/ko-KR/TUIProfile.js +1 -0
  32. package/dist/cjs/locales/ko-KR/index.js +1 -0
  33. package/dist/cjs/utils/env.d.ts +4 -3
  34. package/dist/cjs/utils/env.js +1 -1
  35. package/dist/esm/components/DivWithEdit/WithText.js +1 -1
  36. package/dist/esm/components/Input/Input.js +1 -1
  37. package/dist/esm/components/Plugins/index.js +1 -1
  38. package/dist/esm/components/TUIKit/TUIKit.js +1 -1
  39. package/dist/esm/components/TUIMessage/utils/emojiMap.js +1 -1
  40. package/dist/esm/components/TUIMessageInput/TUIMessageInputDefault.js +1 -1
  41. package/dist/esm/components/TUIMessageInput/hooks/useEmojiPicker.js +1 -1
  42. package/dist/esm/components/TUIMessageInput/hooks/useMessageInputText.js +1 -1
  43. package/dist/esm/components/TUIMessageList/TUIMessageList.js +1 -1
  44. package/dist/esm/components/untils.js +1 -1
  45. package/dist/esm/index.css +1 -1
  46. package/dist/esm/index.d.css +3 -6
  47. package/dist/esm/index.d.ts +1 -1
  48. package/dist/esm/index.js +1 -1
  49. package/dist/esm/locales/en-US/index.js +1 -0
  50. package/dist/esm/locales/index.js +1 -1
  51. package/dist/esm/locales/ja-JP/TUIChat.js +1 -0
  52. package/dist/esm/locales/ja-JP/TUIContact.js +1 -0
  53. package/dist/esm/locales/ja-JP/TUIConversation.js +1 -0
  54. package/dist/esm/locales/ja-JP/TUIProfile.js +1 -0
  55. package/dist/esm/locales/ja-JP/index.js +1 -0
  56. package/dist/esm/locales/ko-KR/TUIChat.js +1 -0
  57. package/dist/esm/locales/ko-KR/TUIContact.js +1 -0
  58. package/dist/esm/locales/ko-KR/TUIConversation.js +1 -0
  59. package/dist/esm/locales/ko-KR/TUIProfile.js +1 -0
  60. package/dist/esm/locales/ko-KR/index.js +1 -0
  61. package/dist/esm/utils/env.d.ts +4 -3
  62. package/dist/esm/utils/env.js +1 -1
  63. package/package.json +20 -15
  64. package/rollup.config.js +27 -23
  65. package/src/components/ConversationPreview/styles/index.scss +3 -5
  66. package/src/components/ConversationPreview/utils.tsx +1 -1
  67. package/src/components/DivWithEdit/WithText.tsx +4 -2
  68. package/src/components/Input/Input.tsx +3 -1
  69. package/src/components/TUIConversationList/index.scss +1 -2
  70. package/src/components/TUIKit/TUIKit.tsx +1 -1
  71. package/src/components/TUIManage/styles/index.scss +4 -4
  72. package/src/components/TUIMessage/utils/emojiMap.ts +1 -1
  73. package/src/components/TUIMessageInput/TUIMessageInputDefault.tsx +3 -1
  74. package/src/components/TUIMessageInput/hooks/useEmojiPicker.tsx +1 -1
  75. package/src/components/TUIMessageInput/hooks/useMessageInputText.tsx +3 -1
  76. package/src/components/TUIMessageList/TUIMessageList.tsx +17 -10
  77. package/src/components/untils.ts +13 -17
  78. package/src/locales/en-US/TUIGlobal.ts +6 -0
  79. package/src/locales/en-US/index.ts +14 -0
  80. package/src/locales/index.ts +15 -7
  81. package/src/locales/ja-JP/TUIChat.ts +27 -0
  82. package/src/locales/ja-JP/TUIContact.ts +30 -0
  83. package/src/locales/ja-JP/TUIConversation.ts +33 -0
  84. package/src/locales/ja-JP/TUIGlobal.ts +6 -0
  85. package/src/locales/ja-JP/TUIProfile.ts +15 -0
  86. package/src/locales/{en → ja-JP}/index.ts +0 -2
  87. package/src/locales/ko-KR/TUIChat.ts +27 -0
  88. package/src/locales/ko-KR/TUIContact.ts +30 -0
  89. package/src/locales/ko-KR/TUIConversation.ts +33 -0
  90. package/src/locales/ko-KR/TUIGlobal.ts +6 -0
  91. package/src/locales/ko-KR/TUIProfile.ts +15 -0
  92. package/src/locales/ko-KR/index.ts +11 -0
  93. package/src/locales/zh-CN/TUIGlobal.ts +6 -0
  94. package/src/utils/env.ts +7 -2
  95. package/tsconfig.json +1 -0
  96. package/dist/cjs/locales/en/index.js +0 -1
  97. package/dist/esm/locales/en/index.js +0 -1
  98. /package/dist/cjs/locales/{en → en-US}/TUIChat.js +0 -0
  99. /package/dist/cjs/locales/{en → en-US}/TUIContact.js +0 -0
  100. /package/dist/cjs/locales/{en → en-US}/TUIConversation.js +0 -0
  101. /package/dist/cjs/locales/{en → en-US}/TUIProfile.js +0 -0
  102. /package/dist/cjs/locales/{zh_cn → zh-CN}/TUIChat.js +0 -0
  103. /package/dist/cjs/locales/{zh_cn → zh-CN}/TUIContact.js +0 -0
  104. /package/dist/cjs/locales/{zh_cn → zh-CN}/TUIConversation.js +0 -0
  105. /package/dist/cjs/locales/{zh_cn → zh-CN}/TUIProfile.js +0 -0
  106. /package/dist/cjs/locales/{zh_cn → zh-CN}/index.js +0 -0
  107. /package/dist/esm/locales/{en → en-US}/TUIChat.js +0 -0
  108. /package/dist/esm/locales/{en → en-US}/TUIContact.js +0 -0
  109. /package/dist/esm/locales/{en → en-US}/TUIConversation.js +0 -0
  110. /package/dist/esm/locales/{en → en-US}/TUIProfile.js +0 -0
  111. /package/dist/esm/locales/{zh_cn → zh-CN}/TUIChat.js +0 -0
  112. /package/dist/esm/locales/{zh_cn → zh-CN}/TUIContact.js +0 -0
  113. /package/dist/esm/locales/{zh_cn → zh-CN}/TUIConversation.js +0 -0
  114. /package/dist/esm/locales/{zh_cn → zh-CN}/TUIProfile.js +0 -0
  115. /package/dist/esm/locales/{zh_cn → zh-CN}/index.js +0 -0
  116. /package/src/locales/{en → en-US}/TUIChat.ts +0 -0
  117. /package/src/locales/{en → en-US}/TUIContact.ts +0 -0
  118. /package/src/locales/{en → en-US}/TUIConversation.ts +0 -0
  119. /package/src/locales/{en → en-US}/TUIProfile.ts +0 -0
  120. /package/src/locales/{zh_cn → zh-CN}/TUIChat.ts +0 -0
  121. /package/src/locales/{zh_cn → zh-CN}/TUIContact.ts +0 -0
  122. /package/src/locales/{zh_cn → zh-CN}/TUIConversation.ts +0 -0
  123. /package/src/locales/{zh_cn → zh-CN}/TUIProfile.ts +0 -0
  124. /package/src/locales/{zh_cn → zh-CN}/index.ts +0 -0
package/.editorconfig ADDED
@@ -0,0 +1,16 @@
1
+ # top-most EditorConfig file
2
+ root = true
3
+
4
+ [*]
5
+ # Unix-style newlines with a newline ending every file
6
+ end_of_line = lf
7
+ insert_final_newline = true
8
+ charset = utf-8
9
+ trim_trailing_whitespace = true
10
+ indent_style = space
11
+ indent_size = 2
12
+
13
+ [*.{js,ts,css,less,html,json,vue}]
14
+
15
+ [*.md]
16
+ trim_trailing_whitespace = false
package/.eslintrc.js CHANGED
@@ -1,28 +1,29 @@
1
+ const stylistic = require('@stylistic/eslint-plugin');
2
+
3
+ const customizedStylisticConfig = stylistic.configs.customize({
4
+ semi: true,
5
+ indent: 2,
6
+ quotes: 'single',
7
+ jsx: true,
8
+ braceStyle: '1tbs',
9
+ });
10
+
1
11
  module.exports = {
2
12
  env: {
3
- browser: true,
4
- es2021: true,
13
+ node: true,
5
14
  },
6
- extends: [
7
- 'plugin:react/recommended',
8
- 'plugin:@typescript-eslint/recommended',
9
- ],
10
- parser: '@typescript-eslint/parser',
11
15
  parserOptions: {
12
- ecmaFeatures: {
13
- jsx: true,
14
- },
15
16
  ecmaVersion: 'latest',
16
17
  sourceType: 'module',
17
18
  },
18
- plugins: ['react', 'import'],
19
+ extends: [
20
+ 'eslint:recommended',
21
+ 'plugin:@stylistic/recommended-extends',
22
+ ],
23
+ plugins: ['@stylistic'],
19
24
  settings: {
20
- typescript: {
21
- alwaysTryTypes: true,
22
- },
23
- react: {
24
- pragma: 'React',
25
- version: 'detect',
25
+ 'import/parsers': {
26
+ '@typescript-eslint/parser': ['.ts', '.tsx'],
26
27
  },
27
28
  'import/resolver': {
28
29
  typescript: {
@@ -31,21 +32,60 @@ module.exports = {
31
32
  },
32
33
  },
33
34
  rules: {
35
+ ...customizedStylisticConfig.rules,
36
+ ...getJavascriptRules(),
37
+ },
38
+ overrides: [
39
+ {
40
+ env: {
41
+ node: true,
42
+ },
43
+ files: ['*.js'],
44
+ },
45
+ {
46
+ env: {
47
+ browser: true,
48
+ },
49
+ files: ['src/**/*.{js,ts,jsx,tsx}'],
50
+ extends: [
51
+ 'plugin:@typescript-eslint/recommended',
52
+ 'react-app',
53
+ ],
54
+ parser: '@typescript-eslint/parser',
55
+ parserOptions: {
56
+ ecmaVersion: 'latest',
57
+ ecmaFeatures: {
58
+ jsx: true,
59
+ },
60
+ },
61
+ rules: {
62
+ ...customizedStylisticConfig.rules,
63
+ ...getJavascriptRules(),
64
+ ...getJavascriptRules(),
65
+ ...getTypescriptRules(),
66
+ ...getA11yRules(),
67
+ ...getImportRules(),
68
+ ...getReactRules(),
69
+ },
70
+ },
71
+ ],
72
+ };
73
+
74
+ function getA11yRules() {
75
+ return {
34
76
  'jsx-a11y/click-events-have-key-events': 'off',
35
- 'no-unused-vars': 'off',
36
- '@typescript-eslint/no-unused-vars': 'off',
77
+ };
78
+ }
79
+
80
+ function getJavascriptRules() {
81
+ return {
37
82
  'class-methods-use-this': 'off',
38
- // 'no-unused-vars': [
39
- // 'error',
40
- // {
41
- // varsIgnorePattern: '^[A-Z]',
42
- // },
43
- // ],
44
- 'import/no-unresolved': 'error',
45
- 'react/jsx-filename-extension': 'off',
46
- 'no-use-before-define': 'off',
83
+ };
84
+ }
85
+
86
+ function getImportRules() {
87
+ return {
47
88
  'import/prefer-default-export': 'off',
48
- // '@typescript-eslint/no-use-before-define': ['error'],
49
89
  'import/extensions': [
50
90
  'error',
51
91
  'ignorePackages',
@@ -55,16 +95,47 @@ module.exports = {
55
95
  tsx: 'never',
56
96
  },
57
97
  ],
58
- 'no-shadow': 'off',
59
- '@typescript-eslint/no-shadow': ['error'],
60
- // "@typescript-eslint/explicit-function-return-type": [
61
- // "error",
62
- // {
63
- // allowExpressions: true,
64
- // },
65
- // ],
66
- 'max-len': ['warn', { code: 160 }],
98
+ };
99
+ }
100
+
101
+ function getReactRules() {
102
+ return {
67
103
  'react/jsx-props-no-spreading': 'off',
68
- 'react/require-default-props': [0],
69
- },
70
- };
104
+ 'react/require-default-props': 'off',
105
+ };
106
+ }
107
+
108
+ function getTypescriptRules() {
109
+ return {
110
+ '@typescript-eslint/no-explicit-any': ['warn', {
111
+ ignoreRestArgs: true,
112
+ fixToUnknown: false,
113
+ }],
114
+ '@typescript-eslint/array-type': ['warn', {
115
+ default: 'array-simple',
116
+ readonly: 'array-simple',
117
+ }],
118
+ 'no-shadow': 'off',
119
+ '@typescript-eslint/no-shadow': 'error',
120
+ 'no-unused-vars': 'off',
121
+ '@typescript-eslint/no-unused-vars': [
122
+ 'error',
123
+ {
124
+ args: 'all',
125
+ argsIgnorePattern: '^_',
126
+ caughtErrors: 'all',
127
+ caughtErrorsIgnorePattern: '^_',
128
+ destructuredArrayIgnorePattern: '^_',
129
+ varsIgnorePattern: '^_',
130
+ ignoreRestSiblings: true,
131
+ },
132
+ ],
133
+ 'no-use-before-define': 'off',
134
+ '@typescript-eslint/no-use-before-define': ['error', {
135
+ functions: false,
136
+ classes: false,
137
+ variables: true,
138
+ allowNamedExports: true,
139
+ }],
140
+ };
141
+ }
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env sh
2
+ . "$(dirname -- "$0")/_/husky.sh"
3
+
4
+ npx lint-staged
@@ -0,0 +1,6 @@
1
+ {
2
+ "src/**/*.{ts,tsx}": [
3
+ "eslint"
4
+ ],
5
+ "src/**/*.scss": "stylelint"
6
+ }
@@ -0,0 +1,41 @@
1
+ module.exports = {
2
+ extends: [
3
+ "stylelint-config-standard",
4
+ "@stylistic/stylelint-config"
5
+ ],
6
+ overrides: [
7
+ {
8
+ files: ["src/**/*.scss"],
9
+ extends: ["stylelint-config-recommended-scss"],
10
+ }
11
+ ],
12
+ rules: {
13
+ ...getCssRules(),
14
+ ...getScssRules(),
15
+ ...getStylisticRules(),
16
+ }
17
+ }
18
+
19
+ function getScssRules() {
20
+ return {
21
+ "declaration-block-no-redundant-longhand-properties": [
22
+ true,
23
+ {
24
+ "ignoreShorthands": ["inset"]
25
+ }
26
+ ],
27
+ "color-function-notation": "legacy",
28
+ "property-no-vendor-prefix": null,
29
+ "alpha-value-notation": "number",
30
+ }
31
+ }
32
+
33
+ function getScssRules() {
34
+ return {
35
+ "scss/at-extend-no-missing-placeholder": null,
36
+ }
37
+ }
38
+
39
+ function getStylisticRules() {
40
+ return {};
41
+ }
package/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ ## [2.2.3] (2024-7-30)
2
+
3
+ #### feat
4
+ * feat: Localization language Added for ja-JP and ko-KR
5
+
1
6
  ## [2.2.3] (2024-7-05)
2
7
 
3
8
  #### fix
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),r=require("react"),n=require("../Icon/Icon.js"),i=require("../Icon/type.js");exports.WithText=function(s){var u=s.value,c=s.confirm,o=s.className,a=r.useRef(),l=r.useState(u),f=l[0],v=l[1];return r.useLayoutEffect((function(){var e;null===(e=null==a?void 0:a.current)||void 0===e||e.focus(),v(f)}),[a,u]),t.jsxs("div",e.__assign({className:"edit ".concat(o)},{children:[t.jsx("input",{ref:a,type:"text",value:f,onChange:function(e){v(e.target.value)}}),t.jsx(n.Icon,{className:"icon",width:15,height:10.5,type:i.IconTypes.CONFIRM,onClick:function(){c&&c(f)}})]}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),r=require("react"),n=require("../Icon/Icon.js"),c=require("../Icon/type.js");exports.WithText=function(i){var s=i.value,u=i.confirm,o=i.className,a=r.useRef(),l=r.useState(s),f=l[0],v=l[1];return r.useLayoutEffect((function(){var e;null===(e=null==a?void 0:a.current)||void 0===e||e.focus({preventScroll:!0}),v(f)}),[a,s]),t.jsxs("div",e.__assign({className:"edit ".concat(o)},{children:[t.jsx("input",{ref:a,type:"text",value:f,onChange:function(e){v(e.target.value)}}),t.jsx(n.Icon,{className:"icon",width:15,height:10.5,type:c.IconTypes.CONFIRM,onClick:function(){u&&u(f)}})]}))};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),t=require("react"),u=require("../Icon/Icon.js"),r=require("../Icon/type.js");function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=i(t).default.forwardRef((function(i,o){var c=i.className,a=void 0===c?"":c,l=i.customClassName,s=void 0===l?"":l,d=i.placeholder,v=i.clearable,f=void 0!==v&&v,p=i.prefix,b=i.suffix,x=i.onChange,h=i.onBlur,m=i.onFocus,g=i.onKeyDown,j=i.value,k=void 0===j?"":j,y=i.border,I=void 0===y?"":y,N=i.disabled,_=void 0!==N&&N,q=i.maxLength,C=void 0===q?void 0:q,w=t.useState(!1),D=w[0],E=w[1],L=["Enter","NumpadEnter"],O=t.useState(k),R=O[0],B=O[1],F=t.useRef(null),K=function(){F.current&&F.current.focus()};return t.useImperativeHandle(o,(function(){return{focus:K,blur:function(){var e;null===(e=F.current)||void 0===e||e.blur()},input:F.current}})),n.jsx("div",e.__assign({className:"".concat(a," tui-kit-input-container")},{children:n.jsxs("div",e.__assign({className:"tui-kit-input-box ".concat(I&&"tui-kit-input-border--".concat(I)," ").concat(D?"tui-kit-input-box--focus":"tui-kit-input-box--blur")},{children:[p,n.jsx("input",{maxLength:C,disabled:_,className:"tui-kit-input ".concat(s),placeholder:d,ref:F,value:R,onFocus:function(e){E(!0),null==m||m(e)},onBlur:function(e){E(!1),null==h||h(e)},onChange:function(e){B(e.target.value),F.current&&(null==x||x(e))},onKeyDown:function(e){L.indexOf(null==e?void 0:e.key)>-1&&g&&(null==e||e.preventDefault(),g(e))}}),b,f&&R&&n.jsx(u.Icon,{type:r.IconTypes.CLEAR,height:13,width:13,onClick:function(e){!function(e){var n;B(""),K();var t=null===(n=null==F?void 0:F.current)||void 0===n?void 0:n.cloneNode(!0),u=Object.create(e,{target:{value:t},currentTarget:{value:t}});t.value="",null==x||x(u)}(e)}})]}))}))}));exports.Input=o;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),t=require("react"),u=require("../Icon/Icon.js"),r=require("../Icon/type.js");function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=i(t).default.forwardRef((function(i,o){var c=i.className,l=void 0===c?"":c,a=i.customClassName,s=void 0===a?"":a,d=i.placeholder,v=i.clearable,f=void 0!==v&&v,p=i.prefix,b=i.suffix,x=i.onChange,h=i.onBlur,m=i.onFocus,g=i.onKeyDown,j=i.value,k=void 0===j?"":j,y=i.border,I=void 0===y?"":y,N=i.disabled,_=void 0!==N&&N,q=i.maxLength,C=void 0===q?void 0:q,w=t.useState(!1),D=w[0],E=w[1],L=["Enter","NumpadEnter"],O=t.useState(k),R=O[0],S=O[1],B=t.useRef(null),F=function(){B.current&&B.current.focus({preventScroll:!0})};return t.useImperativeHandle(o,(function(){return{focus:F,blur:function(){var e;null===(e=B.current)||void 0===e||e.blur()},input:B.current}})),n.jsx("div",e.__assign({className:"".concat(l," tui-kit-input-container")},{children:n.jsxs("div",e.__assign({className:"tui-kit-input-box ".concat(I&&"tui-kit-input-border--".concat(I)," ").concat(D?"tui-kit-input-box--focus":"tui-kit-input-box--blur")},{children:[p,n.jsx("input",{maxLength:C,disabled:_,className:"tui-kit-input ".concat(s),placeholder:d,ref:B,value:R,onFocus:function(e){E(!0),null==m||m(e)},onBlur:function(e){E(!1),null==h||h(e)},onChange:function(e){S(e.target.value),B.current&&(null==x||x(e))},onKeyDown:function(e){L.indexOf(null==e?void 0:e.key)>-1&&g&&(null==e||e.preventDefault(),g(e))}}),b,f&&R&&n.jsx(u.Icon,{type:r.IconTypes.CLEAR,height:13,width:13,onClick:function(e){!function(e){var n;S(""),F();var t=null===(n=null==B?void 0:B.current)||void 0===n?void 0:n.cloneNode(!0),u=Object.create(e,{target:{value:t},currentTarget:{value:t}});t.value="",null==x||x(u)}(e)}})]}))}))}));exports.Input=o;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),i=require("react"),s=require("../Icon/Icon.js"),l=require("../Icon/type.js"),o=require("../Popup/index.js"),r=require("./hooks/usePluginsElement.js");function t(t,u){var c=t.plugins,a=void 0===c?[]:c,d=t.showNumber,v=t.MoreIcon,g=t.className,h=void 0===g?"":g,p=t.style,m=t.customClass,_=void 0===m?"":m,f=t.root,x=t.handleVisible;i.useImperativeHandle(u,(function(){return{closeMore:function(e){I(!1)}}}));var j=r.usePluginsElement({plugins:a,showNumber:d}),P=j.showPicker,N=j.elements,b=i.useRef(null),w=i.useState(!1),y=w[0],I=w[1],q=function e(n){var i,s;n.stopPropagation(),I(!y),y||null===(s=null===(i=null==b?void 0:b.current)||void 0===i?void 0:i.offsetParent)||void 0===s||s.removeEventListener("scroll",e)};return(P&&P.length>0||N&&(null==N?void 0:N.length)>0)&&n.jsxs("ul",e.__assign({className:"plugin ".concat(h)},{children:[P&&(null==P?void 0:P.length)>0&&P.map((function(i,s){var l="".concat(i).concat(s);return n.jsx("li",e.__assign({className:"plugin-item"},{children:i}),l)})),N&&(null==N?void 0:N.length)>0&&n.jsxs("div",e.__assign({className:"plugin-popup",ref:b},{children:[n.jsxs("div",e.__assign({role:"menuitem",tabIndex:0,className:"more",onClick:q},{children:[!v&&n.jsx(s.Icon,{width:20,height:20,type:l.IconTypes.ADD}),v&&v]})),n.jsx(o.Popup,e.__assign({className:"plugin-popup-box ".concat(_),style:p,show:y,close:q,root:f,handleVisible:function(n){var i,s,l,o;if(x){var r=(null===(i=null==b?void 0:b.current)||void 0===i?void 0:i.children[1].getBoundingClientRect())||{},t=r.width,u=r.height,c=(null===(s=null==b?void 0:b.current)||void 0===s?void 0:s.getBoundingClientRect())||{},a=c.x,d=void 0===a?0:a,v=c.y,g=void 0===v?0:v;null===(o=null===(l=b.current)||void 0===l?void 0:l.offsetParent)||void 0===o||o.addEventListener("scroll",q),x(e.__assign(e.__assign({},n),{width:t,height:u,x:d,y:g}))}}},{children:n.jsx("ul",{children:N.map((function(i,s){var l="".concat(i).concat(s);return n.jsx("li",e.__assign({className:"plugin-item"},{children:i}),l)}))})}))]}))]}))}var u=i.forwardRef(t);exports.Plugins=u;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),i=require("react"),s=require("../Icon/Icon.js"),l=require("../Icon/type.js"),o=require("../Popup/index.js"),r=require("./hooks/usePluginsElement.js");function t(t,u){var c=t.plugins,a=void 0===c?[]:c,d=t.showNumber,v=t.MoreIcon,g=t.className,h=void 0===g?"":g,p=t.style,m=t.customClass,_=void 0===m?"":m,f=t.root,x=t.handleVisible;i.useImperativeHandle(u,(function(){return{closeMore:function(e){I(!1)}}}));var j=r.usePluginsElement({plugins:a,showNumber:d}),P=j.showPicker,N=j.elements,b=i.useRef(null),w=i.useState(!1),y=w[0],I=w[1],q=function(e){var n,i;e.stopPropagation(),I(!y),y||null===(i=null===(n=null==b?void 0:b.current)||void 0===n?void 0:n.offsetParent)||void 0===i||i.removeEventListener("scroll",q)};return(P&&P.length>0||N&&(null==N?void 0:N.length)>0)&&n.jsxs("ul",e.__assign({className:"plugin ".concat(h)},{children:[P&&(null==P?void 0:P.length)>0&&P.map((function(i,s){var l="".concat(i).concat(s);return n.jsx("li",e.__assign({className:"plugin-item"},{children:i}),l)})),N&&(null==N?void 0:N.length)>0&&n.jsxs("div",e.__assign({className:"plugin-popup",ref:b},{children:[n.jsxs("div",e.__assign({role:"menuitem",tabIndex:0,className:"more",onClick:q},{children:[!v&&n.jsx(s.Icon,{width:20,height:20,type:l.IconTypes.ADD}),v&&v]})),n.jsx(o.Popup,e.__assign({className:"plugin-popup-box ".concat(_),style:p,show:y,close:q,root:f,handleVisible:function(n){var i,s,l,o;if(x){var r=(null===(i=null==b?void 0:b.current)||void 0===i?void 0:i.children[1].getBoundingClientRect())||{},t=r.width,u=r.height,c=(null===(s=null==b?void 0:b.current)||void 0===s?void 0:s.getBoundingClientRect())||{},a=c.x,d=void 0===a?0:a,v=c.y,g=void 0===v?0:v;null===(o=null===(l=b.current)||void 0===l?void 0:l.offsetParent)||void 0===o||o.addEventListener("scroll",q),x(e.__assign(e.__assign({},n),{width:t,height:u,x:d,y:g}))}}},{children:n.jsx("ul",{children:N.map((function(i,s){var l="".concat(i).concat(s);return n.jsx("li",e.__assign({className:"plugin-item"},{children:i}),l)}))})}))]}))]}))}var u=i.forwardRef(t);exports.Plugins=u;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),a=require("react"),s=require("@tencentcloud/chat-uikit-engine"),n=require("@tencentcloud/tui-core"),r=require("react-i18next"),i=require("../../utils/env.js"),o=require("./hooks/useTUIKit.js"),c=require("./hooks/useCreateTUIKitContext.js"),T=require("../../context/TUIKitContext.js"),l=require("../TUIConversation/TUIConversation.js"),u=require("../TUIChat/TUIChat.js"),I=require("../TUIManage/TUIManage.js"),C=require("../TUIProfile/TUIProfile.js");require("../TUIProfile/TUIProfileDefault.js"),require("@tencentcloud/chat"),require("../../context/TUIMessageContext.js"),require("../Icon/config.js"),require("../Icon/type.js");var U=require("../TUIContact/TUIContactInfo/TUIContactInfo.js"),v=require("../TUIContact/TUIContact.js"),h=require("../../constants.js");require("../../locales/index.js");var d=require("../Icon/images/chats.svg.js"),j=require("../Icon/images/chats-selected.svg.js"),A=require("../Icon/images/contacts.svg.js"),m=require("../Icon/images/contacts-selected.svg.js"),g=[{id:1,name:h.TUIKIT_TABBAR.CHATS,icon:d,selectedIcon:j,value:h.TUIKIT_TABBAR.CHATS},{id:2,name:h.TUIKIT_TABBAR.CONTACTS,icon:A,selectedIcon:m,value:h.TUIKIT_TABBAR.CONTACTS}],x={className:"sample-h5-input",isTransmitter:!0};function _(a){var s=a.moduleValue,n=a.tabbarRender,r=a.setModuleValue;return t.jsxs(t.Fragment,{children:[t.jsxs("div",e.__assign({className:"sample-chat-left-container"},{children:[t.jsx(C.TUIProfile,{className:"sample-chat-profile"}),n,s===h.TUIKIT_TABBAR.CHATS&&t.jsx(l.TUIConversation,{}),s===h.TUIKIT_TABBAR.CONTACTS&&t.jsx(v.TUIContact,{})]})),s===h.TUIKIT_TABBAR.CHATS&&t.jsxs(t.Fragment,{children:[t.jsx(u.TUIChat,{}),t.jsx(I.TUIManage,{})]}),s===h.TUIKIT_TABBAR.CONTACTS&&t.jsx(v.TUIContact,{children:t.jsx(U.TUIContactInfo,{showChats:function(){r(h.TUIKIT_TABBAR.CHATS)}})})]})}function f(a){var s=a.moduleValue,n=a.contactData,r=a.tabbarRender,i=a.currentConversationID,o=a.setModuleValue;return t.jsxs("div",e.__assign({className:"sample-chat-h5"},{children:[!i&&!n&&t.jsxs("div",e.__assign({className:"sample-chat-h5-container"},{children:[t.jsx(C.TUIProfile,{className:"sample-profile"}),r,s===h.TUIKIT_TABBAR.CHATS&&t.jsx(l.TUIConversation,{}),s===h.TUIKIT_TABBAR.CONTACTS&&t.jsx(v.TUIContact,{})]})),s===h.TUIKIT_TABBAR.CHATS&&i&&t.jsxs(t.Fragment,{children:[t.jsx(u.TUIChat,{TUIMessageInputConfig:x}),t.jsx(I.TUIManage,{})]}),s===h.TUIKIT_TABBAR.CONTACTS&&n&&t.jsx(v.TUIContact,{children:t.jsx(U.TUIContactInfo,{showChats:function(){o(h.TUIKIT_TABBAR.CHATS)}})})]}))}exports.TUIKit=function(l){var u=a.useState("chats"),I=u[0],C=u[1],U=r.useTranslation().t,v=l.children,h=l.chat,d=void 0===h?n.TUILogin.getContext().chat:h,j=l.customClasses,A=l.activeConversation,m=l.language,x=void 0===m?"en":m;window.tencent_cloud_im_csig_react_uikit_23F_xa=!0;var B=o.useTUIKit({chat:d,activeConversation:A,language:x}),S=B.conversation,q=B.contactData,p=B.setActiveConversation,K=B.myProfile,N=B.TUIManageShow,R=B.setTUIManageShow,w=B.TUIProfileShow,M=B.setTUIProfileShow,P=B.setActiveContact,b=c.useCreateTUIKitContext({chat:d,language:x,conversation:S,contactData:q,setActiveConversation:p,customClasses:j,myProfile:K,TUIManageShow:N,setTUIManageShow:R,TUIProfileShow:w,setTUIProfileShow:M,setActiveContact:P});a.useEffect((function(){return s.TUIStore.watch(s.StoreName.CONV,{currentConversation:V}),function(){s.TUIStore.unwatch(s.StoreName.CONV,{currentConversation:V})}}),[]);var V=function(e){p(null==e?void 0:e.getConversation())},H=t.jsx("div",e.__assign({className:"sample-chat-tab"},{children:g.map((function(a){return t.jsxs("div",e.__assign({className:"sample-chat-tab-container",role:"presentation",onClick:function(){var e;e=a.value,C(e),s.TUIConversationService.switchConversation("")}},{children:[t.jsx("img",{src:I===a.value?a.selectedIcon:a.icon,alt:""}),t.jsx("p",e.__assign({className:"sample-chat-tab-text ".concat(I===a.value?"sample-chat-tab-active":"")},{children:U(a.name)}))]}),a.id)}))}));return t.jsx(T.TUIKitProvider,e.__assign({value:b},{children:t.jsx("div",e.__assign({className:"tui-kit"},{children:v||i.isPC&&t.jsx(_,{moduleValue:I,tabbarRender:H,setModuleValue:C})||i.isH5&&t.jsx(f,{contactData:q,moduleValue:I,tabbarRender:H,currentConversationID:(null==S?void 0:S.conversationID)||"",setModuleValue:C})}))}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),a=require("react"),s=require("@tencentcloud/chat-uikit-engine"),n=require("@tencentcloud/tui-core"),r=require("react-i18next"),i=require("../../utils/env.js"),o=require("./hooks/useTUIKit.js"),c=require("./hooks/useCreateTUIKitContext.js"),T=require("../../context/TUIKitContext.js"),l=require("../TUIConversation/TUIConversation.js"),u=require("../TUIChat/TUIChat.js"),I=require("../TUIManage/TUIManage.js"),C=require("../TUIProfile/TUIProfile.js");require("../TUIProfile/TUIProfileDefault.js"),require("@tencentcloud/chat"),require("../../context/TUIMessageContext.js"),require("../Icon/config.js"),require("../Icon/type.js");var U=require("../TUIContact/TUIContactInfo/TUIContactInfo.js"),v=require("../TUIContact/TUIContact.js"),h=require("../../constants.js");require("../../locales/index.js");var d=require("../Icon/images/chats.svg.js"),j=require("../Icon/images/chats-selected.svg.js"),A=require("../Icon/images/contacts.svg.js"),m=require("../Icon/images/contacts-selected.svg.js"),g=[{id:1,name:h.TUIKIT_TABBAR.CHATS,icon:d,selectedIcon:j,value:h.TUIKIT_TABBAR.CHATS},{id:2,name:h.TUIKIT_TABBAR.CONTACTS,icon:A,selectedIcon:m,value:h.TUIKIT_TABBAR.CONTACTS}],x={className:"sample-h5-input",isTransmitter:!0};function _(a){var s=a.moduleValue,n=a.tabbarRender,r=a.setModuleValue;return t.jsxs(t.Fragment,{children:[t.jsxs("div",e.__assign({className:"sample-chat-left-container"},{children:[t.jsx(C.TUIProfile,{className:"sample-chat-profile"}),n,s===h.TUIKIT_TABBAR.CHATS&&t.jsx(l.TUIConversation,{}),s===h.TUIKIT_TABBAR.CONTACTS&&t.jsx(v.TUIContact,{})]})),s===h.TUIKIT_TABBAR.CHATS&&t.jsxs(t.Fragment,{children:[t.jsx(u.TUIChat,{}),t.jsx(I.TUIManage,{})]}),s===h.TUIKIT_TABBAR.CONTACTS&&t.jsx(v.TUIContact,{children:t.jsx(U.TUIContactInfo,{showChats:function(){r(h.TUIKIT_TABBAR.CHATS)}})})]})}function f(a){var s=a.moduleValue,n=a.contactData,r=a.tabbarRender,i=a.currentConversationID,o=a.setModuleValue;return t.jsxs("div",e.__assign({className:"sample-chat-h5"},{children:[!i&&!n&&t.jsxs("div",e.__assign({className:"sample-chat-h5-container"},{children:[t.jsx(C.TUIProfile,{className:"sample-profile"}),r,s===h.TUIKIT_TABBAR.CHATS&&t.jsx(l.TUIConversation,{}),s===h.TUIKIT_TABBAR.CONTACTS&&t.jsx(v.TUIContact,{})]})),s===h.TUIKIT_TABBAR.CHATS&&i&&t.jsxs(t.Fragment,{children:[t.jsx(u.TUIChat,{TUIMessageInputConfig:x}),t.jsx(I.TUIManage,{})]}),s===h.TUIKIT_TABBAR.CONTACTS&&n&&t.jsx(v.TUIContact,{children:t.jsx(U.TUIContactInfo,{showChats:function(){o(h.TUIKIT_TABBAR.CHATS)}})})]}))}exports.TUIKit=function(l){var u=a.useState("chats"),I=u[0],C=u[1],U=r.useTranslation().t,v=l.children,h=l.chat,d=void 0===h?n.TUILogin.getContext().chat:h,j=l.customClasses,A=l.activeConversation,m=l.language,x=void 0===m?"en-US":m;window.tencent_cloud_im_csig_react_uikit_23F_xa=!0;var S=o.useTUIKit({chat:d,activeConversation:A,language:x}),B=S.conversation,q=S.contactData,p=S.setActiveConversation,K=S.myProfile,N=S.TUIManageShow,R=S.setTUIManageShow,w=S.TUIProfileShow,M=S.setTUIProfileShow,P=S.setActiveContact,b=c.useCreateTUIKitContext({chat:d,language:x,conversation:B,contactData:q,setActiveConversation:p,customClasses:j,myProfile:K,TUIManageShow:N,setTUIManageShow:R,TUIProfileShow:w,setTUIProfileShow:M,setActiveContact:P});a.useEffect((function(){return s.TUIStore.watch(s.StoreName.CONV,{currentConversation:V}),function(){s.TUIStore.unwatch(s.StoreName.CONV,{currentConversation:V})}}),[]);var V=function(e){p(null==e?void 0:e.getConversation())},H=t.jsx("div",e.__assign({className:"sample-chat-tab"},{children:g.map((function(a){return t.jsxs("div",e.__assign({className:"sample-chat-tab-container",role:"presentation",onClick:function(){var e;e=a.value,C(e),s.TUIConversationService.switchConversation("")}},{children:[t.jsx("img",{src:I===a.value?a.selectedIcon:a.icon,alt:""}),t.jsx("p",e.__assign({className:"sample-chat-tab-text ".concat(I===a.value?"sample-chat-tab-active":"")},{children:U(a.name)}))]}),a.id)}))}));return t.jsx(T.TUIKitProvider,e.__assign({value:b},{children:t.jsx("div",e.__assign({className:"tui-kit"},{children:v||i.isPC&&t.jsx(_,{moduleValue:I,tabbarRender:H,setModuleValue:C})||i.isH5&&t.jsx(f,{contactData:q,moduleValue:I,tabbarRender:H,currentConversationID:(null==B?void 0:B.conversationID)||"",setModuleValue:C})}))}))};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e={"[NO]":"[no]","[OK]":"[ok]","[下雨]":"[rain]","[么么哒]":"[muah]","[乒乓]":"[ping pong]","[便便]":"[poo]","[信封]":"[mail]","[偷笑]":"[snicker]","[傲慢]":"[arrogant]","[再见]":"[bye]","[冷汗]":"[sweat]","[凋谢]":"[wither]","[刀]":"[knife]","[删除]":"[delete]","[勾引]":"[hook]","[发呆]":"[daze]","[发抖]":"[shaking]","[可怜]":"[pitiful]","[可爱]":"[cute]","[右哼哼]":"[right hum]","[右太极]":"[right Tai Chi]","[右车头]":"[right head]","[吐]":"[vomit]","[吓]":"[scare]","[咒骂]":"[curse]","[咖啡]":"[cafe]","[啤酒]":"[beer]","[嘘]":"[hiss]","[回头]":"[look back]","[困]":"[sleepy]","[坏笑]":"[bad laugh]","[多云]":"[cloud]","[大兵]":"[soldiers]","[大哭]":"[cry]","[太阳]":"[sun]","[奋斗]":"[struggle]","[奶瓶]":"[feeding bottle]","[委屈]":"[wronged]","[害羞]":"[shy]","[尴尬]":"[awkward]","[左哼哼]":"[left hem]","[左太极]":"[left Tai Chi]","[左车头]":"[left head]","[差劲]":"[poor]","[弱]":"[weak]","[强]":"[stong]","[彩带]":"[ribbon]","[彩球]":"[ball]","[得意]":"[proud]","[微笑]":"[smile]","[心碎了]":"[heartbroken]","[快哭了]":"[almost cry]","[怄火]":"[ire]","[怒]":"[anger]","[惊恐]":"[terrify]","[惊讶]":"[flummox]","[憨笑]":"[smirk]","[手枪]":"[gun]","[打哈欠]":"[yawn]","[抓狂]":"[crazy]","[折磨]":"[torment]","[抠鼻]":"[nose picking]","[抱抱]":"[hug]","[抱拳]":"[hug fist]","[拳头]":"[fist]","[挥手]":"[waving hands]","[握手]":"[shake hands]","[撇嘴]":"[pouted]","[擦汗]":"[wipe sweat]","[敲打]":"[knock on the head]","[晕]":"[faint]","[月亮]":"[moon]","[棒棒糖]":"[lollipop]","[汽车]":"[car]","[沙发]":"[sofa]","[流汗]":"[sweat]","[流泪]":"[tears]","[激动]":"[excitement]","[灯泡]":"[light]","[炸弹]":"[bomb]","[熊猫]":"[panda]","[爆筋]":"[exploding muscle]","[爱你]":"[love you]","[爱心]":"[love heart]","[爱情]":"[love]","[猪头]":"[pig]","[猫咪]":"[cat]","[献吻]":"[kiss]","[玫瑰]":"[rose]","[瓢虫]":"[ladybird]","[疑问]":"[what]","[白眼]":"[rolling eyes]","[皮球]":"[rubber ball]","[睡觉]":"[sleep]","[磕头]":"[kowtow]","[示爱]":"[show love]","[礼品袋]":"[gift bag]","[礼物]":"[gift]","[篮球]":"[basketball]","[米饭]":"[rice]","[糗大了]":"[shame]","[红双喜]":"[happiness]","[红灯笼]":"[lantern]","[纸巾]":"[tissue]","[胜利]":"[victory]","[色]":"[lecherous]","[药]":"[medicine]","[菜刀]":"[kitchen knife]","[蛋糕]":"[coke]","[蜡烛]":"[candle]","[街舞]":"[hip hop]","[衰]":"[decline]","[西瓜]":"[lemon]","[调皮]":"[naughty]","[象棋]":"[chess]","[跳绳]":"[jump rope]","[跳跳]":"[jump]","[车厢]":"[compartment]","[转圈]":"[turn in circles]","[鄙视]":"[contempt]","[酷]":"[cool]","[钞票]":"[money]","[钻戒]":"[diamond]","[闪电]":"[lightning]","[闭嘴]":"[shut up]","[闹钟]":"[clock]","[阴险]":"[sinister]","[难过]":"[sad]","[雨伞]":"[umbrella]","[青蛙]":"[frog]","[面条]":"[noodles]","[鞭炮]":"[firecracker]","[风车]":"[windmill]","[飞吻]":"[blow kisses]","[飞机]":"[air]","[饥饿]":"[hunger]","[香蕉]":"[banana]","[骷髅]":"[skull]","[麦克风]":"[mic]","[麻将]":"[mahjong]","[鼓掌]":"[handclap]","[龇牙]":"[happy]"};function o(e,i,n){var m=e;return(m=m.replace(i,n)).includes(i)&&(m=o(m,i,n)),m}exports.emojiEnKey=e,exports.emojiMap={"[NO]":"emoji_0@2x.png","[OK]":"emoji_1@2x.png","[下雨]":"emoji_2@2x.png","[么么哒]":"emoji_3@2x.png","[乒乓]":"emoji_4@2x.png","[便便]":"emoji_5@2x.png","[信封]":"emoji_6@2x.png","[偷笑]":"emoji_7@2x.png","[傲慢]":"emoji_8@2x.png","[再见]":"emoji_9@2x.png","[冷汗]":"emoji_10@2x.png","[凋谢]":"emoji_11@2x.png","[刀]":"emoji_12@2x.png","[删除]":"emoji_13@2x.png","[勾引]":"emoji_14@2x.png","[发呆]":"emoji_15@2x.png","[发抖]":"emoji_16@2x.png","[可怜]":"emoji_17@2x.png","[可爱]":"emoji_18@2x.png","[右哼哼]":"emoji_19@2x.png","[右太极]":"emoji_20@2x.png","[右车头]":"emoji_21@2x.png","[吐]":"emoji_22@2x.png","[吓]":"emoji_23@2x.png","[咒骂]":"emoji_24@2x.png","[咖啡]":"emoji_25@2x.png","[啤酒]":"emoji_26@2x.png","[嘘]":"emoji_27@2x.png","[回头]":"emoji_28@2x.png","[困]":"emoji_29@2x.png","[坏笑]":"emoji_30@2x.png","[多云]":"emoji_31@2x.png","[大兵]":"emoji_32@2x.png","[大哭]":"emoji_33@2x.png","[太阳]":"emoji_34@2x.png","[奋斗]":"emoji_35@2x.png","[奶瓶]":"emoji_36@2x.png","[委屈]":"emoji_37@2x.png","[害羞]":"emoji_38@2x.png","[尴尬]":"emoji_39@2x.png","[左哼哼]":"emoji_40@2x.png","[左太极]":"emoji_41@2x.png","[左车头]":"emoji_42@2x.png","[差劲]":"emoji_43@2x.png","[弱]":"emoji_44@2x.png","[强]":"emoji_45@2x.png","[彩带]":"emoji_46@2x.png","[彩球]":"emoji_47@2x.png","[得意]":"emoji_48@2x.png","[微笑]":"emoji_49@2x.png","[心碎了]":"emoji_50@2x.png","[快哭了]":"emoji_51@2x.png","[怄火]":"emoji_52@2x.png","[怒]":"emoji_53@2x.png","[惊恐]":"emoji_54@2x.png","[惊讶]":"emoji_55@2x.png","[憨笑]":"emoji_56@2x.png","[手枪]":"emoji_57@2x.png","[打哈欠]":"emoji_58@2x.png","[抓狂]":"emoji_59@2x.png","[折磨]":"emoji_60@2x.png","[抠鼻]":"emoji_61@2x.png","[抱抱]":"emoji_62@2x.png","[抱拳]":"emoji_63@2x.png","[拳头]":"emoji_64@2x.png","[挥手]":"emoji_65@2x.png","[握手]":"emoji_66@2x.png","[撇嘴]":"emoji_67@2x.png","[擦汗]":"emoji_68@2x.png","[敲打]":"emoji_69@2x.png","[晕]":"emoji_70@2x.png","[月亮]":"emoji_71@2x.png","[棒棒糖]":"emoji_72@2x.png","[汽车]":"emoji_73@2x.png","[沙发]":"emoji_74@2x.png","[流汗]":"emoji_75@2x.png","[流泪]":"emoji_76@2x.png","[激动]":"emoji_77@2x.png","[灯泡]":"emoji_78@2x.png","[炸弹]":"emoji_79@2x.png","[熊猫]":"emoji_80@2x.png","[爆筋]":"emoji_81@2x.png","[爱你]":"emoji_82@2x.png","[爱心]":"emoji_83@2x.png","[爱情]":"emoji_84@2x.png","[猪头]":"emoji_85@2x.png","[猫咪]":"emoji_86@2x.png","[献吻]":"emoji_87@2x.png","[玫瑰]":"emoji_88@2x.png","[瓢虫]":"emoji_89@2x.png","[疑问]":"emoji_90@2x.png","[白眼]":"emoji_91@2x.png","[皮球]":"emoji_92@2x.png","[睡觉]":"emoji_93@2x.png","[磕头]":"emoji_94@2x.png","[示爱]":"emoji_95@2x.png","[礼品袋]":"emoji_96@2x.png","[礼物]":"emoji_97@2x.png","[篮球]":"emoji_98@2x.png","[米饭]":"emoji_99@2x.png","[糗大了]":"emoji_100@2x.png","[红双喜]":"emoji_101@2x.png","[红灯笼]":"emoji_102@2x.png","[纸巾]":"emoji_103@2x.png","[胜利]":"emoji_104@2x.png","[色]":"emoji_105@2x.png","[药]":"emoji_106@2x.png","[菜刀]":"emoji_107@2x.png","[蛋糕]":"emoji_108@2x.png","[蜡烛]":"emoji_109@2x.png","[街舞]":"emoji_110@2x.png","[衰]":"emoji_111@2x.png","[西瓜]":"emoji_112@2x.png","[调皮]":"emoji_113@2x.png","[象棋]":"emoji_114@2x.png","[跳绳]":"emoji_115@2x.png","[跳跳]":"emoji_116@2x.png","[车厢]":"emoji_117@2x.png","[转圈]":"emoji_118@2x.png","[鄙视]":"emoji_119@2x.png","[酷]":"emoji_120@2x.png","[钞票]":"emoji_121@2x.png","[钻戒]":"emoji_122@2x.png","[闪电]":"emoji_123@2x.png","[闭嘴]":"emoji_124@2x.png","[闹钟]":"emoji_125@2x.png","[阴险]":"emoji_126@2x.png","[难过]":"emoji_127@2x.png","[雨伞]":"emoji_128@2x.png","[青蛙]":"emoji_129@2x.png","[面条]":"emoji_130@2x.png","[鞭炮]":"emoji_131@2x.png","[风车]":"emoji_132@2x.png","[飞吻]":"emoji_133@2x.png","[飞机]":"emoji_134@2x.png","[饥饿]":"emoji_135@2x.png","[香蕉]":"emoji_136@2x.png","[骷髅]":"emoji_137@2x.png","[麦克风]":"emoji_138@2x.png","[麻将]":"emoji_139@2x.png","[鼓掌]":"emoji_140@2x.png","[龇牙]":"emoji_141@2x.png"},exports.emojiName=["[龇牙]","[调皮]","[流汗]","[偷笑]","[再见]","[敲打]","[擦汗]","[猪头]","[玫瑰]","[流泪]","[大哭]","[嘘]","[酷]","[抓狂]","[委屈]","[便便]","[炸弹]","[菜刀]","[可爱]","[色]","[害羞]","[得意]","[吐]","[微笑]","[怒]","[尴尬]","[惊恐]","[冷汗]","[爱心]","[示爱]","[白眼]","[傲慢]","[难过]","[惊讶]","[疑问]","[困]","[么么哒]","[憨笑]","[爱情]","[衰]","[撇嘴]","[阴险]","[奋斗]","[发呆]","[右哼哼]","[抱抱]","[坏笑]","[飞吻]","[鄙视]","[晕]","[大兵]","[可怜]","[强]","[弱]","[握手]","[胜利]","[抱拳]","[凋谢]","[米饭]","[蛋糕]","[西瓜]","[啤酒]","[瓢虫]","[勾引]","[OK]","[爱你]","[咖啡]","[月亮]","[刀]","[发抖]","[差劲]","[拳头]","[心碎了]","[太阳]","[礼物]","[皮球]","[骷髅]","[挥手]","[闪电]","[饥饿]","[咒骂]","[折磨]","[抠鼻]","[鼓掌]","[糗大了]","[左哼哼]","[打哈欠]","[快哭了]","[吓]","[篮球]","[乒乓]","[NO]","[跳跳]","[怄火]","[转圈]","[磕头]","[回头]","[跳绳]","[激动]","[街舞]","[献吻]","[左太极]","[右太极]","[闭嘴]","[猫咪]","[红双喜]","[鞭炮]","[红灯笼]","[麻将]","[麦克风]","[礼品袋]","[信封]","[象棋]","[彩带]","[蜡烛]","[爆筋]","[棒棒糖]","[奶瓶]","[面条]","[香蕉]","[飞机]","[左车头]","[车厢]","[右车头]","[多云]","[下雨]","[钞票]","[熊猫]","[灯泡]","[风车]","[闹钟]","[雨伞]","[彩球]","[钻戒]","[沙发]","[纸巾]","[手枪]","[青蛙]"],exports.emojiUrl="https://web.sdk.qcloud.com/im/assets/emoji/",exports.formatEmojiString=function(i,n,m){void 0===n&&(n=0);var p=i,g=0===n?1:0,j=n;return Object.entries(e).map((function(e){return p.includes(e[g])&&(p=m&&"zh"===m?e[g]:o(p,e[g],e[j])),e})),p};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e={"[NO]":"[no]","[OK]":"[ok]","[下雨]":"[rain]","[么么哒]":"[muah]","[乒乓]":"[ping pong]","[便便]":"[poo]","[信封]":"[mail]","[偷笑]":"[snicker]","[傲慢]":"[arrogant]","[再见]":"[bye]","[冷汗]":"[sweat]","[凋谢]":"[wither]","[刀]":"[knife]","[删除]":"[delete]","[勾引]":"[hook]","[发呆]":"[daze]","[发抖]":"[shaking]","[可怜]":"[pitiful]","[可爱]":"[cute]","[右哼哼]":"[right hum]","[右太极]":"[right Tai Chi]","[右车头]":"[right head]","[吐]":"[vomit]","[吓]":"[scare]","[咒骂]":"[curse]","[咖啡]":"[cafe]","[啤酒]":"[beer]","[嘘]":"[hiss]","[回头]":"[look back]","[困]":"[sleepy]","[坏笑]":"[bad laugh]","[多云]":"[cloud]","[大兵]":"[soldiers]","[大哭]":"[cry]","[太阳]":"[sun]","[奋斗]":"[struggle]","[奶瓶]":"[feeding bottle]","[委屈]":"[wronged]","[害羞]":"[shy]","[尴尬]":"[awkward]","[左哼哼]":"[left hem]","[左太极]":"[left Tai Chi]","[左车头]":"[left head]","[差劲]":"[poor]","[弱]":"[weak]","[强]":"[stong]","[彩带]":"[ribbon]","[彩球]":"[ball]","[得意]":"[proud]","[微笑]":"[smile]","[心碎了]":"[heartbroken]","[快哭了]":"[almost cry]","[怄火]":"[ire]","[怒]":"[anger]","[惊恐]":"[terrify]","[惊讶]":"[flummox]","[憨笑]":"[smirk]","[手枪]":"[gun]","[打哈欠]":"[yawn]","[抓狂]":"[crazy]","[折磨]":"[torment]","[抠鼻]":"[nose picking]","[抱抱]":"[hug]","[抱拳]":"[hug fist]","[拳头]":"[fist]","[挥手]":"[waving hands]","[握手]":"[shake hands]","[撇嘴]":"[pouted]","[擦汗]":"[wipe sweat]","[敲打]":"[knock on the head]","[晕]":"[faint]","[月亮]":"[moon]","[棒棒糖]":"[lollipop]","[汽车]":"[car]","[沙发]":"[sofa]","[流汗]":"[sweat]","[流泪]":"[tears]","[激动]":"[excitement]","[灯泡]":"[light]","[炸弹]":"[bomb]","[熊猫]":"[panda]","[爆筋]":"[exploding muscle]","[爱你]":"[love you]","[爱心]":"[love heart]","[爱情]":"[love]","[猪头]":"[pig]","[猫咪]":"[cat]","[献吻]":"[kiss]","[玫瑰]":"[rose]","[瓢虫]":"[ladybird]","[疑问]":"[what]","[白眼]":"[rolling eyes]","[皮球]":"[rubber ball]","[睡觉]":"[sleep]","[磕头]":"[kowtow]","[示爱]":"[show love]","[礼品袋]":"[gift bag]","[礼物]":"[gift]","[篮球]":"[basketball]","[米饭]":"[rice]","[糗大了]":"[shame]","[红双喜]":"[happiness]","[红灯笼]":"[lantern]","[纸巾]":"[tissue]","[胜利]":"[victory]","[色]":"[lecherous]","[药]":"[medicine]","[菜刀]":"[kitchen knife]","[蛋糕]":"[coke]","[蜡烛]":"[candle]","[街舞]":"[hip hop]","[衰]":"[decline]","[西瓜]":"[lemon]","[调皮]":"[naughty]","[象棋]":"[chess]","[跳绳]":"[jump rope]","[跳跳]":"[jump]","[车厢]":"[compartment]","[转圈]":"[turn in circles]","[鄙视]":"[contempt]","[酷]":"[cool]","[钞票]":"[money]","[钻戒]":"[diamond]","[闪电]":"[lightning]","[闭嘴]":"[shut up]","[闹钟]":"[clock]","[阴险]":"[sinister]","[难过]":"[sad]","[雨伞]":"[umbrella]","[青蛙]":"[frog]","[面条]":"[noodles]","[鞭炮]":"[firecracker]","[风车]":"[windmill]","[飞吻]":"[blow kisses]","[飞机]":"[air]","[饥饿]":"[hunger]","[香蕉]":"[banana]","[骷髅]":"[skull]","[麦克风]":"[mic]","[麻将]":"[mahjong]","[鼓掌]":"[handclap]","[龇牙]":"[happy]"};function o(e,i,n){var m=e;return(m=m.replace(i,n)).includes(i)&&(m=o(m,i,n)),m}exports.emojiEnKey=e,exports.emojiMap={"[NO]":"emoji_0@2x.png","[OK]":"emoji_1@2x.png","[下雨]":"emoji_2@2x.png","[么么哒]":"emoji_3@2x.png","[乒乓]":"emoji_4@2x.png","[便便]":"emoji_5@2x.png","[信封]":"emoji_6@2x.png","[偷笑]":"emoji_7@2x.png","[傲慢]":"emoji_8@2x.png","[再见]":"emoji_9@2x.png","[冷汗]":"emoji_10@2x.png","[凋谢]":"emoji_11@2x.png","[刀]":"emoji_12@2x.png","[删除]":"emoji_13@2x.png","[勾引]":"emoji_14@2x.png","[发呆]":"emoji_15@2x.png","[发抖]":"emoji_16@2x.png","[可怜]":"emoji_17@2x.png","[可爱]":"emoji_18@2x.png","[右哼哼]":"emoji_19@2x.png","[右太极]":"emoji_20@2x.png","[右车头]":"emoji_21@2x.png","[吐]":"emoji_22@2x.png","[吓]":"emoji_23@2x.png","[咒骂]":"emoji_24@2x.png","[咖啡]":"emoji_25@2x.png","[啤酒]":"emoji_26@2x.png","[嘘]":"emoji_27@2x.png","[回头]":"emoji_28@2x.png","[困]":"emoji_29@2x.png","[坏笑]":"emoji_30@2x.png","[多云]":"emoji_31@2x.png","[大兵]":"emoji_32@2x.png","[大哭]":"emoji_33@2x.png","[太阳]":"emoji_34@2x.png","[奋斗]":"emoji_35@2x.png","[奶瓶]":"emoji_36@2x.png","[委屈]":"emoji_37@2x.png","[害羞]":"emoji_38@2x.png","[尴尬]":"emoji_39@2x.png","[左哼哼]":"emoji_40@2x.png","[左太极]":"emoji_41@2x.png","[左车头]":"emoji_42@2x.png","[差劲]":"emoji_43@2x.png","[弱]":"emoji_44@2x.png","[强]":"emoji_45@2x.png","[彩带]":"emoji_46@2x.png","[彩球]":"emoji_47@2x.png","[得意]":"emoji_48@2x.png","[微笑]":"emoji_49@2x.png","[心碎了]":"emoji_50@2x.png","[快哭了]":"emoji_51@2x.png","[怄火]":"emoji_52@2x.png","[怒]":"emoji_53@2x.png","[惊恐]":"emoji_54@2x.png","[惊讶]":"emoji_55@2x.png","[憨笑]":"emoji_56@2x.png","[手枪]":"emoji_57@2x.png","[打哈欠]":"emoji_58@2x.png","[抓狂]":"emoji_59@2x.png","[折磨]":"emoji_60@2x.png","[抠鼻]":"emoji_61@2x.png","[抱抱]":"emoji_62@2x.png","[抱拳]":"emoji_63@2x.png","[拳头]":"emoji_64@2x.png","[挥手]":"emoji_65@2x.png","[握手]":"emoji_66@2x.png","[撇嘴]":"emoji_67@2x.png","[擦汗]":"emoji_68@2x.png","[敲打]":"emoji_69@2x.png","[晕]":"emoji_70@2x.png","[月亮]":"emoji_71@2x.png","[棒棒糖]":"emoji_72@2x.png","[汽车]":"emoji_73@2x.png","[沙发]":"emoji_74@2x.png","[流汗]":"emoji_75@2x.png","[流泪]":"emoji_76@2x.png","[激动]":"emoji_77@2x.png","[灯泡]":"emoji_78@2x.png","[炸弹]":"emoji_79@2x.png","[熊猫]":"emoji_80@2x.png","[爆筋]":"emoji_81@2x.png","[爱你]":"emoji_82@2x.png","[爱心]":"emoji_83@2x.png","[爱情]":"emoji_84@2x.png","[猪头]":"emoji_85@2x.png","[猫咪]":"emoji_86@2x.png","[献吻]":"emoji_87@2x.png","[玫瑰]":"emoji_88@2x.png","[瓢虫]":"emoji_89@2x.png","[疑问]":"emoji_90@2x.png","[白眼]":"emoji_91@2x.png","[皮球]":"emoji_92@2x.png","[睡觉]":"emoji_93@2x.png","[磕头]":"emoji_94@2x.png","[示爱]":"emoji_95@2x.png","[礼品袋]":"emoji_96@2x.png","[礼物]":"emoji_97@2x.png","[篮球]":"emoji_98@2x.png","[米饭]":"emoji_99@2x.png","[糗大了]":"emoji_100@2x.png","[红双喜]":"emoji_101@2x.png","[红灯笼]":"emoji_102@2x.png","[纸巾]":"emoji_103@2x.png","[胜利]":"emoji_104@2x.png","[色]":"emoji_105@2x.png","[药]":"emoji_106@2x.png","[菜刀]":"emoji_107@2x.png","[蛋糕]":"emoji_108@2x.png","[蜡烛]":"emoji_109@2x.png","[街舞]":"emoji_110@2x.png","[衰]":"emoji_111@2x.png","[西瓜]":"emoji_112@2x.png","[调皮]":"emoji_113@2x.png","[象棋]":"emoji_114@2x.png","[跳绳]":"emoji_115@2x.png","[跳跳]":"emoji_116@2x.png","[车厢]":"emoji_117@2x.png","[转圈]":"emoji_118@2x.png","[鄙视]":"emoji_119@2x.png","[酷]":"emoji_120@2x.png","[钞票]":"emoji_121@2x.png","[钻戒]":"emoji_122@2x.png","[闪电]":"emoji_123@2x.png","[闭嘴]":"emoji_124@2x.png","[闹钟]":"emoji_125@2x.png","[阴险]":"emoji_126@2x.png","[难过]":"emoji_127@2x.png","[雨伞]":"emoji_128@2x.png","[青蛙]":"emoji_129@2x.png","[面条]":"emoji_130@2x.png","[鞭炮]":"emoji_131@2x.png","[风车]":"emoji_132@2x.png","[飞吻]":"emoji_133@2x.png","[飞机]":"emoji_134@2x.png","[饥饿]":"emoji_135@2x.png","[香蕉]":"emoji_136@2x.png","[骷髅]":"emoji_137@2x.png","[麦克风]":"emoji_138@2x.png","[麻将]":"emoji_139@2x.png","[鼓掌]":"emoji_140@2x.png","[龇牙]":"emoji_141@2x.png"},exports.emojiName=["[龇牙]","[调皮]","[流汗]","[偷笑]","[再见]","[敲打]","[擦汗]","[猪头]","[玫瑰]","[流泪]","[大哭]","[嘘]","[酷]","[抓狂]","[委屈]","[便便]","[炸弹]","[菜刀]","[可爱]","[色]","[害羞]","[得意]","[吐]","[微笑]","[怒]","[尴尬]","[惊恐]","[冷汗]","[爱心]","[示爱]","[白眼]","[傲慢]","[难过]","[惊讶]","[疑问]","[困]","[么么哒]","[憨笑]","[爱情]","[衰]","[撇嘴]","[阴险]","[奋斗]","[发呆]","[右哼哼]","[抱抱]","[坏笑]","[飞吻]","[鄙视]","[晕]","[大兵]","[可怜]","[强]","[弱]","[握手]","[胜利]","[抱拳]","[凋谢]","[米饭]","[蛋糕]","[西瓜]","[啤酒]","[瓢虫]","[勾引]","[OK]","[爱你]","[咖啡]","[月亮]","[刀]","[发抖]","[差劲]","[拳头]","[心碎了]","[太阳]","[礼物]","[皮球]","[骷髅]","[挥手]","[闪电]","[饥饿]","[咒骂]","[折磨]","[抠鼻]","[鼓掌]","[糗大了]","[左哼哼]","[打哈欠]","[快哭了]","[吓]","[篮球]","[乒乓]","[NO]","[跳跳]","[怄火]","[转圈]","[磕头]","[回头]","[跳绳]","[激动]","[街舞]","[献吻]","[左太极]","[右太极]","[闭嘴]","[猫咪]","[红双喜]","[鞭炮]","[红灯笼]","[麻将]","[麦克风]","[礼品袋]","[信封]","[象棋]","[彩带]","[蜡烛]","[爆筋]","[棒棒糖]","[奶瓶]","[面条]","[香蕉]","[飞机]","[左车头]","[车厢]","[右车头]","[多云]","[下雨]","[钞票]","[熊猫]","[灯泡]","[风车]","[闹钟]","[雨伞]","[彩球]","[钻戒]","[沙发]","[纸巾]","[手枪]","[青蛙]"],exports.emojiUrl="https://web.sdk.qcloud.com/im/assets/emoji/",exports.formatEmojiString=function(i,n,m){void 0===n&&(n=0);var p=i,g=0===n?1:0,j=n;return Object.entries(e).map((function(e){return p.includes(e[g])&&(p=m&&"zh-CN"===m?e[g]:o(p,e[g],e[j])),e})),p};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),n=require("react"),s=require("react-i18next"),r=require("../../constants.js"),a=require("../../context/TUIChatStateContext.js");require("../../context/TUIMessageContext.js");var u=require("../../context/TUIMessageInputContext.js"),i=require("../../utils/env.js"),o=require("../TUIMessage/utils/emojiMap.js");exports.TUIMessageInputDefault=function(){var l=u.useTUIMessageInputContext("TUIMessageInputDefault"),c=l.text,d=l.disabled,v=l.handleChange,x=l.handleKeyDown,f=l.handlePasete,E=l.textareaRef,p=l.focus,g=l.setText,I=l.setCursorPos,T=s.useTranslation().t,j=a.useTUIChatStateContext("TUIMessageInputDefault").operateData;n.useEffect((function(){j&&j[r.MESSAGE_OPERATE.REVOKE]&&g&&g(o.formatEmojiString(j[r.MESSAGE_OPERATE.REVOKE].payload.text,1))}),[j]),n.useEffect((function(){var e,t;return p&&E&&E.current&&(E.current.autofocus=!0,i.isPC&&(null===(e=null==E?void 0:E.current)||void 0===e||e.focus()),null===(t=null==E?void 0:E.current)||void 0===t||t.addEventListener("paste",f)),function(){var e;null===(e=null==E?void 0:E.current)||void 0===e||e.removeEventListener("paste",f)}}),[p,E]);var C=n.useState(!1),h=C[0],M=C[1];return t.jsxs("div",e.__assign({className:"input-box ".concat(d?"disabled":""," ").concat(h?"tui-kit-input-box--focus":"tui-kit-input-box--blur")},{children:[t.jsx("div",e.__assign({className:"input-visibility-content"},{children:c})),!d&&t.jsx("textarea",{placeholder:T("TUIChat.Enter a message"),rows:1,value:c,ref:E,onChange:v,onKeyDown:x,onFocus:function(){M(!0)},onBlur:function(e){!function(e){var t;I&&I({start:null===(t=null==e?void 0:e.target)||void 0===t?void 0:t.selectionStart,end:e.target.selectionEnd}),M(!1)}(e)}})]}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),n=require("react"),r=require("react-i18next"),s=require("../../constants.js"),a=require("../../context/TUIChatStateContext.js");require("../../context/TUIMessageContext.js");var u=require("../../context/TUIMessageInputContext.js"),i=require("../../utils/env.js"),o=require("../TUIMessage/utils/emojiMap.js");exports.TUIMessageInputDefault=function(){var l=u.useTUIMessageInputContext("TUIMessageInputDefault"),c=l.text,d=l.disabled,v=l.handleChange,x=l.handleKeyDown,f=l.handlePasete,p=l.textareaRef,E=l.focus,g=l.setText,I=l.setCursorPos,T=r.useTranslation().t,j=a.useTUIChatStateContext("TUIMessageInputDefault").operateData;n.useEffect((function(){j&&j[s.MESSAGE_OPERATE.REVOKE]&&g&&g(o.formatEmojiString(j[s.MESSAGE_OPERATE.REVOKE].payload.text,1))}),[j]),n.useEffect((function(){var e,t;return E&&p&&p.current&&(p.current.autofocus=!0,i.isPC&&(null===(e=null==p?void 0:p.current)||void 0===e||e.focus({preventScroll:!0})),null===(t=null==p?void 0:p.current)||void 0===t||t.addEventListener("paste",f)),function(){var e;null===(e=null==p?void 0:p.current)||void 0===e||e.removeEventListener("paste",f)}}),[E,p]);var C=n.useState(!1),h=C[0],M=C[1];return t.jsxs("div",e.__assign({className:"input-box ".concat(d?"disabled":""," ").concat(h?"tui-kit-input-box--focus":"tui-kit-input-box--blur")},{children:[t.jsx("div",e.__assign({className:"input-visibility-content"},{children:c})),!d&&t.jsx("textarea",{placeholder:T("TUIChat.Enter a message"),rows:1,value:c,ref:p,onChange:v,onKeyDown:x,onFocus:function(){M(!0)},onBlur:function(e){!function(e){var t;I&&I({start:null===(t=null==e?void 0:e.target)||void 0===t?void 0:t.selectionStart,end:e.target.selectionEnd}),M(!1)}(e)}})]}))};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),a=require("react-i18next"),t=require("@tencentcloud/chat-uikit-engine"),r=require("../../TUIMessage/utils/emojiMap.js");exports.useEmojiPicker=function(i){i.textareaRef;var n=i.insertText,s=a.useTranslation().i18n;return{onSelectEmoji:function(e){"zh"===s.language?n&&n(e.data):n&&n(r.emojiEnKey[e.data])},sendFaceMessage:e.useCallback((function(e){t.TUIChatService.sendFaceMessage({payload:e})}),[])}};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),a=require("react-i18next"),t=require("@tencentcloud/chat-uikit-engine"),r=require("../../TUIMessage/utils/emojiMap.js");exports.useEmojiPicker=function(i){i.textareaRef;var n=i.insertText,s=a.useTranslation().i18n;return{onSelectEmoji:function(e){"zh-CN"===s.language?n&&n(e.data):n&&n(r.emojiEnKey[e.data])},sendFaceMessage:e.useCallback((function(e){t.TUIChatService.sendFaceMessage({payload:e})}),[])}};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react"),n=require("@tencentcloud/chat-uikit-engine"),r=require("../../../constants.js"),u=require("../../../context/TUIKitContext.js");require("react/jsx-runtime");var a=require("../../../context/TUIChatActionContext.js");require("../../../context/TUIMessageContext.js");var o=require("../../untils.js"),s=require("../../TUIMessage/utils/emojiMap.js"),i=require("./useHandleQuoteMessage.js");exports.useMessageInputText=function(l){var c=l.state,T=l.dispatch;l.focus;var d=l.textareaRef,v=l.sendUploadMessage,S=u.useTUIKitContext("useMessageInputText").chat,_=a.useTUIChatActionContext(),f=_.operateMessage,C=_.setFirstSendMessage,E=i.useHandleQuoteMessage().cloudCustomData,g=["Enter","NumpadEnter"],p=t.useCallback((function(e){e.preventDefault(),e&&e.target&&T({type:r.CONSTANT_DISPATCH_TYPE.SET_TEXT,getNewText:function(t){return e.target.value}})}),[S]),x=function(t){return e.__awaiter(void 0,void 0,void 0,(function(){var u,a;return e.__generator(this,(function(e){return null==t||t.preventDefault(),c.text?(u={payload:{text:s.formatEmojiString(c.text)}},E.messageReply&&(u.cloudCustomData=JSON.stringify(E)),n.TUIChatService.sendTextMessage(u).then((function(e){var t=e.data.message;C&&C(t)})),o.enableSampleTaskStatus("sendMessage"),T({getNewText:function(e){return""},type:r.CONSTANT_DISPATCH_TYPE.SET_TEXT}),f&&f(((a={})[r.MESSAGE_OPERATE.QUOTE]=null,a)),[2]):[2]}))}))},P=t.useCallback((function(e){!(null==e?void 0:e.ctrlKey)&&(null==e?void 0:e.code)&&g.indexOf(null==e?void 0:e.code)>-1&&13===e.keyCode&&(null==e||e.preventDefault(),x(e)),(null==e?void 0:e.ctrlKey)&&g.indexOf(null==e?void 0:e.code)>-1&&13===e.keyCode&&T({type:r.CONSTANT_DISPATCH_TYPE.SET_TEXT,getNewText:function(e){return"".concat(e,"\n")}})}),[x,T]),A=t.useCallback((function(t){return e.__awaiter(void 0,void 0,void 0,(function(){var n,u,a;return e.__generator(this,(function(e){return t.preventDefault(),t.clipboardData&&t.clipboardData.items?(n=t.clipboardData,u=n.types,a=n.items,u.find((function(e,t){var n=a[t];switch(e){case"text/plain":return n.getAsString((function(e){T({type:r.CONSTANT_DISPATCH_TYPE.SET_TEXT,getNewText:function(t){return"".concat(t).concat(e)}})})),!0;case"Files":var u=n.getAsFile();return n&&"file"===n.kind&&n.type.match(/^image\//i)&&v&&v({file:u},r.MESSAGE_TYPE_NAME.IMAGE),!0;default:return!1}})),[2]):[2]}))}))}),[d]),N=t.useCallback((function(e){var t,n,u;T({type:r.CONSTANT_DISPATCH_TYPE.SET_TEXT,getNewText:function(t){var n,r;return"".concat(t.slice(0,(null===(n=null==c?void 0:c.cursorPos)||void 0===n?void 0:n.start)||0)).concat(e).concat(t.slice((null===(r=null==c?void 0:c.cursorPos)||void 0===r?void 0:r.start)||0))}}),T({type:r.CONSTANT_DISPATCH_TYPE.SET_CURSOR_POS,value:{start:(null===(t=null==c?void 0:c.cursorPos)||void 0===t?void 0:t.start)&&c.cursorPos.start+e.length,end:(null===(n=null==c?void 0:c.cursorPos)||void 0===n?void 0:n.end)&&c.cursorPos.end+e.length}}),null===(u=null==d?void 0:d.current)||void 0===u||u.focus()}),[d,c]),y=t.useCallback((function(e){var t;T({type:r.CONSTANT_DISPATCH_TYPE.SET_TEXT,getNewText:function(){return"".concat(e)}}),null===(t=null==d?void 0:d.current)||void 0===t||t.focus()}),[d]),h=t.useCallback((function(e){T({type:r.CONSTANT_DISPATCH_TYPE.SET_CURSOR_POS,value:e})}),[d]);return{handleChange:p,handleSubmit:x,handleKeyDown:P,handlePasete:A,insertText:N,setText:y,setCursorPos:h}};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react"),n=require("@tencentcloud/chat-uikit-engine"),r=require("../../../constants.js"),u=require("../../../context/TUIKitContext.js");require("react/jsx-runtime");var a=require("../../../context/TUIChatActionContext.js");require("../../../context/TUIMessageContext.js");var o=require("../../untils.js"),s=require("../../TUIMessage/utils/emojiMap.js"),i=require("./useHandleQuoteMessage.js");exports.useMessageInputText=function(l){var c=l.state,T=l.dispatch;l.focus;var d=l.textareaRef,v=l.sendUploadMessage,S=u.useTUIKitContext("useMessageInputText").chat,_=a.useTUIChatActionContext(),f=_.operateMessage,C=_.setFirstSendMessage,E=i.useHandleQuoteMessage().cloudCustomData,g=["Enter","NumpadEnter"],p=t.useCallback((function(e){e.preventDefault(),e&&e.target&&T({type:r.CONSTANT_DISPATCH_TYPE.SET_TEXT,getNewText:function(t){return e.target.value}})}),[S]),x=function(t){return e.__awaiter(void 0,void 0,void 0,(function(){var u,a;return e.__generator(this,(function(e){return null==t||t.preventDefault(),c.text?(u={payload:{text:s.formatEmojiString(c.text)}},E.messageReply&&(u.cloudCustomData=JSON.stringify(E)),n.TUIChatService.sendTextMessage(u).then((function(e){var t=e.data.message;C&&C(t)})),o.enableSampleTaskStatus("sendMessage"),T({getNewText:function(e){return""},type:r.CONSTANT_DISPATCH_TYPE.SET_TEXT}),f&&f(((a={})[r.MESSAGE_OPERATE.QUOTE]=null,a)),[2]):[2]}))}))},P=t.useCallback((function(e){!(null==e?void 0:e.ctrlKey)&&(null==e?void 0:e.code)&&g.indexOf(null==e?void 0:e.code)>-1&&13===e.keyCode&&(null==e||e.preventDefault(),x(e)),(null==e?void 0:e.ctrlKey)&&g.indexOf(null==e?void 0:e.code)>-1&&13===e.keyCode&&T({type:r.CONSTANT_DISPATCH_TYPE.SET_TEXT,getNewText:function(e){return"".concat(e,"\n")}})}),[x,T]),A=t.useCallback((function(t){return e.__awaiter(void 0,void 0,void 0,(function(){var n,u,a;return e.__generator(this,(function(e){return t.preventDefault(),t.clipboardData&&t.clipboardData.items?(n=t.clipboardData,u=n.types,a=n.items,u.find((function(e,t){var n=a[t];switch(e){case"text/plain":return n.getAsString((function(e){T({type:r.CONSTANT_DISPATCH_TYPE.SET_TEXT,getNewText:function(t){return"".concat(t).concat(e)}})})),!0;case"Files":var u=n.getAsFile();return n&&"file"===n.kind&&n.type.match(/^image\//i)&&v&&v({file:u},r.MESSAGE_TYPE_NAME.IMAGE),!0;default:return!1}})),[2]):[2]}))}))}),[d]),N=t.useCallback((function(e){var t,n,u;T({type:r.CONSTANT_DISPATCH_TYPE.SET_TEXT,getNewText:function(t){var n,r;return"".concat(t.slice(0,(null===(n=null==c?void 0:c.cursorPos)||void 0===n?void 0:n.start)||0)).concat(e).concat(t.slice((null===(r=null==c?void 0:c.cursorPos)||void 0===r?void 0:r.start)||0))}}),T({type:r.CONSTANT_DISPATCH_TYPE.SET_CURSOR_POS,value:{start:(null===(t=null==c?void 0:c.cursorPos)||void 0===t?void 0:t.start)&&c.cursorPos.start+e.length,end:(null===(n=null==c?void 0:c.cursorPos)||void 0===n?void 0:n.end)&&c.cursorPos.end+e.length}}),null===(u=null==d?void 0:d.current)||void 0===u||u.focus({preventScroll:!0})}),[d,c]),y=t.useCallback((function(e){var t;T({type:r.CONSTANT_DISPATCH_TYPE.SET_TEXT,getNewText:function(){return"".concat(e)}}),null===(t=null==d?void 0:d.current)||void 0===t||t.focus()}),[d]),h=t.useCallback((function(e){T({type:r.CONSTANT_DISPATCH_TYPE.SET_CURSOR_POS,value:e})}),[d]);return{handleChange:p,handleSubmit:x,handleKeyDown:P,handlePasete:A,insertText:N,setText:y,setCursorPos:h}};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),s=require("react"),i=require("react-i18next"),n=require("../../context/TUIChatStateContext.js"),r=require("../../context/TUIChatActionContext.js");require("../../context/TUIMessageContext.js");var a=require("../../context/ComponentContext.js"),l=require("./hooks/useMessageListElement.js"),o=require("../InfiniteScrollPaginator/InfiniteScroll.js"),c=require("../EmptyStateIndicator/EmptyStateIndicator.js");function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function d(u){var d=this,g=u.highlightedMessageId,h=u.loadMore,m=u.intervalsTimer,v=u.className,f=i.useTranslation().t,I=s.useState(null),x=I[0],M=I[1],T=s.useState(!1),j=T[0],C=T[1],_=n.useTUIChatStateContext("TUIMessageList"),p=_.messageList,S=_.highlightedMessageId,q=_.isCompleted;_.isSameLastMessageID;var U=_.messageListRef,L=_.noMore,E=_.TUIMessageListConfig,y=r.useTUIChatActionContext(),b=y.loadMore,N=y.setHighlightedMessageId,w=a.useComponentContext(),H=w.TUIMessage,k=w.EmptyStateIndicator,A=void 0===k?c.EmptyStateIndicator:k,P=g||(null==E?void 0:E.highlightedMessageId)||S,V=60*(m||(null==E?void 0:E.intervalsTimer)||30),D=h||(null==E?void 0:E.loadMore)||b,O=p&&l({enrichedMessageList:p,TUIMessage:H,intervalsTimer:V});return s.useEffect((function(){e.__awaiter(d,void 0,void 0,(function(){var t,s,i,n,r;return e.__generator(this,(function(e){switch(e.label){case 0:return t=null===(r=null==x?void 0:x.parentElement)||void 0===r?void 0:r.parentElement,!q&&t&&(null==t?void 0:t.clientHeight)>=(null==x?void 0:x.clientHeight)?D?[4,D()]:[3,2]:[3,3];case 1:e.sent(),e.label=2;case 2:e.label=3;case 3:return(null==x?void 0:x.children)&&(s=(null==x?void 0:x.children)||[],i=s[s.length-1],n=setTimeout((function(){null==i||i.scrollIntoView(),C(!0),clearTimeout(n)}),100)),[2]}}))}))}),[O,j]),s.useEffect((function(){if(P){var e=null==x?void 0:x.querySelector("[data-message-id='".concat(P,"']"));if(!e)return;var t=e.children;t[t.length-1].classList.add("high-lighted"),null==e||e.scrollIntoView({block:"center"});var s=setTimeout((function(){t[t.length-1].classList.remove("high-lighted"),clearTimeout(s),N&&N("")}),1e3)}}),[P]),t.jsxs("div",e.__assign({className:"message-list ".concat(v," ").concat(j?"":"hide"),ref:U},{children:[L,L&&t.jsx("p",e.__assign({className:"no-more"},{children:f("TUIChat.No More")})),t.jsx(o.InfiniteScroll,e.__assign({className:"message-list-infinite-scroll",hasMore:!0,loadMore:D,threshold:1},{children:t.jsx("ul",e.__assign({ref:M},{children:(null==O?void 0:O.length)&&O.length>0?O:t.jsx(A,{listType:"message"})}))}))]}))}var g=u(s).default.memo(d);exports.TUIMessageList=function(s){return t.jsx(g,e.__assign({},s))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),i=require("react"),s=require("react-i18next"),n=require("../../context/TUIChatStateContext.js"),r=require("../../context/TUIChatActionContext.js");require("../../context/TUIMessageContext.js");var l=require("../../context/ComponentContext.js"),a=require("./hooks/useMessageListElement.js"),o=require("../InfiniteScrollPaginator/InfiniteScroll.js"),c=require("../EmptyStateIndicator/EmptyStateIndicator.js");function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function d(u){var d=this,g=u.highlightedMessageId,h=u.loadMore,m=u.intervalsTimer,v=u.className,f=s.useTranslation().t,I=i.useState(null),T=I[0],x=I[1],M=i.useState(!1),p=M[0],C=M[1],j=n.useTUIChatStateContext("TUIMessageList"),_=j.messageList,S=j.highlightedMessageId,q=j.isCompleted;j.isSameLastMessageID;var U=j.messageListRef,L=j.noMore,E=j.TUIMessageListConfig,y=r.useTUIChatActionContext(),b=y.loadMore,N=y.setHighlightedMessageId,H=l.useComponentContext(),R=H.TUIMessage,w=H.EmptyStateIndicator,A=void 0===w?c.EmptyStateIndicator:w,B=g||(null==E?void 0:E.highlightedMessageId)||S,P=60*(m||(null==E?void 0:E.intervalsTimer)||30),k=h||(null==E?void 0:E.loadMore)||b,D=_&&a({enrichedMessageList:_,TUIMessage:R,intervalsTimer:P});return i.useEffect((function(){e.__awaiter(d,void 0,void 0,(function(){var t,i,s,n;return e.__generator(this,(function(e){switch(e.label){case 0:return t=null===(n=null==T?void 0:T.parentElement)||void 0===n?void 0:n.parentElement,!q&&t&&(null==t?void 0:t.clientHeight)>=(null==T?void 0:T.clientHeight)?k?[4,k()]:[3,2]:[3,3];case 1:e.sent(),e.label=2;case 2:e.label=3;case 3:return(null==T?void 0:T.children)&&((i=(null==T?void 0:T.children)||[])[i.length-1],s=setTimeout((function(){(null==U?void 0:U.current)&&(U.current.scrollTop=U.current.scrollHeight),C(!0),clearTimeout(s)}),100)),[2]}}))}))}),[D,p]),i.useEffect((function(){if(B){var e=null==T?void 0:T.querySelector("[data-message-id='".concat(B,"']"));if(!e)return;var t=e.children;if(t[t.length-1].classList.add("high-lighted"),null==U?void 0:U.current){var i=e.getBoundingClientRect(),s=U.current.getBoundingClientRect(),n=i.top-s.top+U.current.scrollTop;U.current.scrollTop=n}var r=setTimeout((function(){t[t.length-1].classList.remove("high-lighted"),clearTimeout(r),N&&N("")}),1e3)}}),[B]),t.jsxs("div",e.__assign({className:"message-list ".concat(v," ").concat(p?"":"hide"),ref:U},{children:[L,L&&t.jsx("p",e.__assign({className:"no-more"},{children:f("TUIChat.No More")})),t.jsx(o.InfiniteScroll,e.__assign({className:"message-list-infinite-scroll",hasMore:!0,loadMore:k,threshold:1},{children:t.jsx("ul",e.__assign({ref:x},{children:(null==D?void 0:D.length)&&D.length>0?D:t.jsx(A,{listType:"message"})}))}))]}))}var g=u(i).default.memo(d);exports.TUIMessageList=function(i){return t.jsx(g,e.__assign({},i))};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("date-fns"),t=require("date-fns/locale"),r=require("@tencentcloud/chat"),a=require("@tencentcloud/chat-uikit-engine");require("tslib"),require("react/jsx-runtime"),require("react"),require("./Icon/config.js"),require("./Icon/type.js");var n=require("./Avatar/default.js");function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=i(r);function u(e){if("string"==typeof e)try{return!!JSON.parse(e)}catch(e){return!1}return!1}exports.JSONStringToParse=function(e){return u(e)?JSON.parse(e):e},exports.enableSampleTaskStatus=function(e){var t=a.TUIStore.getData(a.StoreName.APP,"tasks");e in t&&!t[e]&&(t[e]=!0,a.TUIStore.update(a.StoreName.APP,"tasks",t))},exports.getTimeStamp=function(r,a){var n={enGB:t.enGB,zhCN:t.zhCN},i="";return"zh"===a&&(i="zhCN"),"en"===a&&(i="enGB"),r?e.isThisYear(r)?e.isToday(r)?e.format(r,"p",{locale:n[i]}):e.isYesterday(r)?e.formatDistance(r,new Date,{locale:n[i]}):e.isThisWeek(r)?e.format(r,"eeee",{locale:n[i]}):e.format(r,"MMM dd",{locale:n[i]}):e.format(r,"yyyy MMM dd",{locale:n[i]}):""},exports.handleDisplayAvatar=function(e,t){void 0===t&&(t=o.default.TYPES.CONV_C2C);var r=e;if(!e)switch(t){case o.default.TYPES.CONV_C2C:r=n.defaultUserAvatar;break;case o.default.TYPES.CONV_GROUP:default:r=n.defaultGroupAvatarWork}return r},exports.isJSON=u;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("date-fns"),t=require("date-fns/locale"),r=require("@tencentcloud/chat"),a=require("@tencentcloud/chat-uikit-engine");require("tslib"),require("react/jsx-runtime"),require("react"),require("./Icon/config.js"),require("./Icon/type.js");var o=require("./Avatar/default.js");function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=i(r);function u(e){if("string"==typeof e)try{return!!JSON.parse(e)}catch(e){return!1}return!1}exports.JSONStringToParse=function(e){return u(e)?JSON.parse(e):e},exports.enableSampleTaskStatus=function(e){var t=a.TUIStore.getData(a.StoreName.APP,"tasks");e in t&&!t[e]&&(t[e]=!0,a.TUIStore.update(a.StoreName.APP,"tasks",t))},exports.getTimeStamp=function(r,a){void 0===a&&(a="en-US");var o={"zh-CN":t.zhCN,"en-US":t.enGB,"ja-JP":t.ja,"ko-KR":t.ko};return r?e.isThisYear(r)?e.isToday(r)?e.format(r,"p",{locale:o[a]}):e.isYesterday(r)?e.formatDistance(r,new Date,{locale:o[a]}):e.isThisWeek(r)?e.format(r,"eeee",{locale:o[a]}):e.format(r,"MMM dd",{locale:o[a]}):e.format(r,"yyyy MMM dd",{locale:o[a]}):""},exports.handleDisplayAvatar=function(e,t){void 0===t&&(t=n.default.TYPES.CONV_C2C);var r=e;if(!e)switch(t){case n.default.TYPES.CONV_C2C:r=o.defaultUserAvatar;break;case n.default.TYPES.CONV_GROUP:default:r=o.defaultGroupAvatarWork}return r},exports.isJSON=u;