@sendbird/uikit-react-native 3.2.0 → 3.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/components/ChannelInput/EditInput.js +2 -11
- package/lib/commonjs/components/ChannelInput/EditInput.js.map +1 -1
- package/lib/commonjs/components/ChannelInput/SendInput.js +2 -11
- package/lib/commonjs/components/ChannelInput/SendInput.js.map +1 -1
- package/lib/commonjs/components/ChannelInput/index.js +30 -3
- package/lib/commonjs/components/ChannelInput/index.js.map +1 -1
- package/lib/commonjs/components/ChannelMessageList/index.js +148 -116
- package/lib/commonjs/components/ChannelMessageList/index.js.map +1 -1
- package/lib/commonjs/components/GroupChannelMessageRenderer/index.js +34 -1
- package/lib/commonjs/components/GroupChannelMessageRenderer/index.js.map +1 -1
- package/lib/commonjs/domain/groupChannel/component/GroupChannelHeader.js +14 -4
- package/lib/commonjs/domain/groupChannel/component/GroupChannelHeader.js.map +1 -1
- package/lib/commonjs/domain/groupChannel/component/GroupChannelMessageList.js +1 -0
- package/lib/commonjs/domain/groupChannel/component/GroupChannelMessageList.js.map +1 -1
- package/lib/commonjs/domain/groupChannel/types.js.map +1 -1
- package/lib/commonjs/fragments/createGroupChannelFragment.js +4 -3
- package/lib/commonjs/fragments/createGroupChannelFragment.js.map +1 -1
- package/lib/commonjs/index.js +4 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/types.js +7 -0
- package/lib/commonjs/types.js.map +1 -1
- package/lib/commonjs/utils/promise.js +138 -0
- package/lib/commonjs/utils/promise.js.map +1 -0
- package/lib/commonjs/version.js +1 -1
- package/lib/commonjs/version.js.map +1 -1
- package/lib/module/components/ChannelInput/EditInput.js +3 -12
- package/lib/module/components/ChannelInput/EditInput.js.map +1 -1
- package/lib/module/components/ChannelInput/SendInput.js +3 -12
- package/lib/module/components/ChannelInput/SendInput.js.map +1 -1
- package/lib/module/components/ChannelInput/index.js +32 -5
- package/lib/module/components/ChannelInput/index.js.map +1 -1
- package/lib/module/components/ChannelMessageList/index.js +148 -116
- package/lib/module/components/ChannelMessageList/index.js.map +1 -1
- package/lib/module/components/GroupChannelMessageRenderer/index.js +34 -2
- package/lib/module/components/GroupChannelMessageRenderer/index.js.map +1 -1
- package/lib/module/domain/groupChannel/component/GroupChannelHeader.js +15 -5
- package/lib/module/domain/groupChannel/component/GroupChannelHeader.js.map +1 -1
- package/lib/module/domain/groupChannel/component/GroupChannelMessageList.js +1 -0
- package/lib/module/domain/groupChannel/component/GroupChannelMessageList.js.map +1 -1
- package/lib/module/domain/groupChannel/types.js.map +1 -1
- package/lib/module/fragments/createGroupChannelFragment.js +4 -3
- package/lib/module/fragments/createGroupChannelFragment.js.map +1 -1
- package/lib/module/index.js +4 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/types.js +5 -1
- package/lib/module/types.js.map +1 -1
- package/lib/module/utils/promise.js +132 -0
- package/lib/module/utils/promise.js.map +1 -0
- package/lib/module/version.js +1 -1
- package/lib/module/version.js.map +1 -1
- package/lib/typescript/src/components/ChannelInput/index.d.ts +2 -0
- package/lib/typescript/src/components/ChannelMessageList/index.d.ts +3 -0
- package/lib/typescript/src/components/GroupChannelMessageRenderer/index.d.ts +3 -0
- package/lib/typescript/src/components/OpenChannelMessageRenderer/index.d.ts +2 -0
- package/lib/typescript/src/containers/SendbirdUIKitContainer.d.ts +1 -1
- package/lib/typescript/src/domain/groupChannel/types.d.ts +3 -0
- package/lib/typescript/src/types.d.ts +4 -0
- package/lib/typescript/src/utils/promise.d.ts +7 -0
- package/lib/typescript/src/version.d.ts +1 -1
- package/package.json +6 -6
- package/src/components/ChannelInput/EditInput.tsx +3 -15
- package/src/components/ChannelInput/SendInput.tsx +2 -9
- package/src/components/ChannelInput/index.tsx +27 -4
- package/src/components/ChannelMessageList/index.tsx +144 -114
- package/src/components/GroupChannelMessageRenderer/index.tsx +34 -2
- package/src/domain/groupChannel/component/GroupChannelHeader.tsx +14 -3
- package/src/domain/groupChannel/component/GroupChannelMessageList.tsx +1 -0
- package/src/domain/groupChannel/types.ts +4 -0
- package/src/fragments/createGroupChannelFragment.tsx +11 -3
- package/src/index.ts +5 -1
- package/src/types.ts +5 -0
- package/src/utils/promise.ts +139 -0
- package/src/version.ts +1 -1
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import 'react-native';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* This file contains subcomponents with separate copyright notices and license terms.
|
|
5
|
+
* Your use of the source code for these subcomponents is subject to the terms and conditions of the following licenses.
|
|
6
|
+
*
|
|
7
|
+
* MIT License: https://github.com/then/promise
|
|
8
|
+
*
|
|
9
|
+
* Copyright (c) 2014 Forbes Lindesay
|
|
10
|
+
*
|
|
11
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
12
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
13
|
+
* in the Software without restriction, including without limitation the rights
|
|
14
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
15
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
16
|
+
* furnished to do so, subject to the following conditions:
|
|
17
|
+
*
|
|
18
|
+
* The above copyright notice and this permission notice shall be included in
|
|
19
|
+
* all copies or substantial portions of the Software.
|
|
20
|
+
*
|
|
21
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
22
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
23
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
24
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
25
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
26
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
27
|
+
* THE SOFTWARE.
|
|
28
|
+
*
|
|
29
|
+
* Original code: https://github.com/then/promise/blob/master/src/es6-extensions.js
|
|
30
|
+
* */
|
|
31
|
+
let iterableToArray = function (iterable) {
|
|
32
|
+
if (typeof Array.from === 'function') {
|
|
33
|
+
// ES2015+, iterables exist
|
|
34
|
+
iterableToArray = Array.from;
|
|
35
|
+
return Array.from(iterable);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// ES5, only arrays and array-likes exist
|
|
39
|
+
iterableToArray = function (x) {
|
|
40
|
+
return Array.prototype.slice.call(x);
|
|
41
|
+
};
|
|
42
|
+
return Array.prototype.slice.call(iterable);
|
|
43
|
+
};
|
|
44
|
+
function onSettledFulfill(value) {
|
|
45
|
+
return {
|
|
46
|
+
status: 'fulfilled',
|
|
47
|
+
value: value
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
function onSettledReject(reason) {
|
|
51
|
+
return {
|
|
52
|
+
status: 'rejected',
|
|
53
|
+
reason: reason
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
function mapAllSettled(item) {
|
|
57
|
+
if (item && (typeof item === 'object' || typeof item === 'function')) {
|
|
58
|
+
if (item instanceof Promise && item.then === Promise.prototype.then) {
|
|
59
|
+
return item.then(onSettledFulfill, onSettledReject);
|
|
60
|
+
}
|
|
61
|
+
// @ts-expect-error
|
|
62
|
+
const then = item.then;
|
|
63
|
+
if (typeof then === 'function') {
|
|
64
|
+
return new Promise(then.bind(item)).then(onSettledFulfill, onSettledReject);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// @ts-expect-error
|
|
69
|
+
return onSettledFulfill(item);
|
|
70
|
+
}
|
|
71
|
+
function getAggregateError(errors) {
|
|
72
|
+
if (typeof AggregateError === 'function') {
|
|
73
|
+
return new AggregateError(errors, 'All promises were rejected');
|
|
74
|
+
}
|
|
75
|
+
const error = new Error('All promises were rejected');
|
|
76
|
+
error.name = 'AggregateError';
|
|
77
|
+
error.errors = errors;
|
|
78
|
+
return error;
|
|
79
|
+
}
|
|
80
|
+
export const PromisePolyfill = {
|
|
81
|
+
allSettled(values) {
|
|
82
|
+
return Promise.all(iterableToArray(values).map(mapAllSettled));
|
|
83
|
+
},
|
|
84
|
+
race(values) {
|
|
85
|
+
return new Promise(function (resolve, reject) {
|
|
86
|
+
iterableToArray(values).forEach(function (value) {
|
|
87
|
+
Promise.resolve(value).then(resolve, reject);
|
|
88
|
+
});
|
|
89
|
+
});
|
|
90
|
+
},
|
|
91
|
+
any(values) {
|
|
92
|
+
return new Promise(function (resolve, reject) {
|
|
93
|
+
const promises = iterableToArray(values);
|
|
94
|
+
let hasResolved = false;
|
|
95
|
+
const rejectionReasons = [];
|
|
96
|
+
function resolveOnce(value) {
|
|
97
|
+
if (!hasResolved) {
|
|
98
|
+
hasResolved = true;
|
|
99
|
+
resolve(value);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
function rejectionCheck(reason) {
|
|
103
|
+
rejectionReasons.push(reason);
|
|
104
|
+
if (rejectionReasons.length === promises.length) {
|
|
105
|
+
reject(getAggregateError(rejectionReasons));
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
if (promises.length === 0) {
|
|
109
|
+
reject(getAggregateError(rejectionReasons));
|
|
110
|
+
} else {
|
|
111
|
+
promises.forEach(function (value) {
|
|
112
|
+
Promise.resolve(value).then(resolveOnce, rejectionCheck);
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
},
|
|
117
|
+
apply() {
|
|
118
|
+
// https://github.com/facebook/react-native/blob/main/packages/react-native/Libraries/Utilities/PolyfillFunctions.js
|
|
119
|
+
if (typeof global !== 'undefined' && 'Promise' in global) {
|
|
120
|
+
if (!global.Promise.allSettled) {
|
|
121
|
+
global.Promise.allSettled = this.allSettled;
|
|
122
|
+
}
|
|
123
|
+
if (!global.Promise.any) {
|
|
124
|
+
global.Promise.any = this.any;
|
|
125
|
+
}
|
|
126
|
+
if (!global.Promise.race) {
|
|
127
|
+
global.Promise.race = this.race;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
};
|
|
132
|
+
//# sourceMappingURL=promise.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["iterableToArray","iterable","Array","from","x","prototype","slice","call","onSettledFulfill","value","status","onSettledReject","reason","mapAllSettled","item","Promise","then","bind","getAggregateError","errors","AggregateError","error","Error","name","PromisePolyfill","allSettled","values","all","map","race","resolve","reject","forEach","any","promises","hasResolved","rejectionReasons","resolveOnce","rejectionCheck","push","length","apply","global"],"sources":["promise.ts"],"sourcesContent":["import 'react-native';\n\n/**\n * This file contains subcomponents with separate copyright notices and license terms.\n * Your use of the source code for these subcomponents is subject to the terms and conditions of the following licenses.\n *\n * MIT License: https://github.com/then/promise\n *\n * Copyright (c) 2014 Forbes Lindesay\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n *\n * Original code: https://github.com/then/promise/blob/master/src/es6-extensions.js\n * */\nlet iterableToArray = function <T>(iterable: Iterable<T | PromiseLike<T>>): (T | PromiseLike<T>)[] {\n if (typeof Array.from === 'function') {\n // ES2015+, iterables exist\n iterableToArray = Array.from;\n return Array.from(iterable);\n }\n\n // ES5, only arrays and array-likes exist\n iterableToArray = function (x) {\n return Array.prototype.slice.call(x);\n };\n return Array.prototype.slice.call(iterable);\n};\n\nfunction onSettledFulfill<T>(value: T) {\n return { status: 'fulfilled', value: value } as const;\n}\n\nfunction onSettledReject<T>(reason: T) {\n return { status: 'rejected', reason: reason } as const;\n}\n\nfunction mapAllSettled<T>(item: T | PromiseLike<T>): PromiseLike<PromiseSettledResult<T>> | PromiseSettledResult<T> {\n if (item && (typeof item === 'object' || typeof item === 'function')) {\n if (item instanceof Promise && item.then === Promise.prototype.then) {\n return item.then(onSettledFulfill, onSettledReject);\n }\n // @ts-expect-error\n const then = item.then;\n if (typeof then === 'function') {\n return new Promise<T>(then.bind(item)).then(onSettledFulfill, onSettledReject);\n }\n }\n\n // @ts-expect-error\n return onSettledFulfill(item);\n}\n\nfunction getAggregateError(errors: unknown[]) {\n if (typeof AggregateError === 'function') {\n return new AggregateError(errors, 'All promises were rejected');\n }\n\n const error = new Error('All promises were rejected') as Error & { errors: unknown[] };\n\n error.name = 'AggregateError';\n error.errors = errors;\n\n return error;\n}\n\nexport const PromisePolyfill = {\n allSettled<T extends readonly unknown[] | []>(values: T) {\n return Promise.all(iterableToArray(values).map(mapAllSettled)) as Promise<{\n -readonly [P in keyof T]: PromiseSettledResult<Awaited<T[P]>>;\n }>;\n },\n race<T>(values: Iterable<T | PromiseLike<T>>): Promise<Awaited<T>> {\n return new Promise(function (resolve, reject) {\n iterableToArray(values).forEach(function (value) {\n Promise.resolve(value).then(resolve, reject);\n });\n });\n },\n any<T>(values: Iterable<T | PromiseLike<T>>): Promise<Awaited<T>> {\n return new Promise<Awaited<T>>(function (resolve, reject) {\n const promises = iterableToArray(values);\n let hasResolved = false;\n const rejectionReasons: unknown[] = [];\n\n function resolveOnce(value: Awaited<T>) {\n if (!hasResolved) {\n hasResolved = true;\n resolve(value);\n }\n }\n\n function rejectionCheck(reason: unknown) {\n rejectionReasons.push(reason);\n\n if (rejectionReasons.length === promises.length) {\n reject(getAggregateError(rejectionReasons));\n }\n }\n\n if (promises.length === 0) {\n reject(getAggregateError(rejectionReasons));\n } else {\n promises.forEach(function (value) {\n Promise.resolve(value).then(resolveOnce, rejectionCheck);\n });\n }\n });\n },\n apply() {\n // https://github.com/facebook/react-native/blob/main/packages/react-native/Libraries/Utilities/PolyfillFunctions.js\n if (typeof global !== 'undefined' && 'Promise' in global) {\n if (!global.Promise.allSettled) {\n global.Promise.allSettled = this.allSettled;\n }\n if (!global.Promise.any) {\n global.Promise.any = this.any;\n }\n if (!global.Promise.race) {\n global.Promise.race = this.race;\n }\n }\n },\n};\n"],"mappings":"AAAA,OAAO,cAAc;;AAErB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAIA,eAAe,GAAG,SAAAA,CAAaC,QAAsC,EAA0B;EACjG,IAAI,OAAOC,KAAK,CAACC,IAAI,KAAK,UAAU,EAAE;IACpC;IACAH,eAAe,GAAGE,KAAK,CAACC,IAAI;IAC5B,OAAOD,KAAK,CAACC,IAAI,CAACF,QAAQ,CAAC;EAC7B;;EAEA;EACAD,eAAe,GAAG,SAAAA,CAAUI,CAAC,EAAE;IAC7B,OAAOF,KAAK,CAACG,SAAS,CAACC,KAAK,CAACC,IAAI,CAACH,CAAC,CAAC;EACtC,CAAC;EACD,OAAOF,KAAK,CAACG,SAAS,CAACC,KAAK,CAACC,IAAI,CAACN,QAAQ,CAAC;AAC7C,CAAC;AAED,SAASO,gBAAgBA,CAAIC,KAAQ,EAAE;EACrC,OAAO;IAAEC,MAAM,EAAE,WAAW;IAAED,KA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A,EAAG;IACN;IACA,IAAI,OAAOC,MAAM,KAAK,WAAW,IAAI,SAAS,IAAIA,MAAM,EAAE;MACxD,IAAI,CAACA,MAAM,CAAC3B,OAAO,CAACU,UAAU,EAAE;QAC9BiB,MAAM,CAAC3B,OAAO,CAACU,UAAU,GAAG,IAAI,CAACA,UAAU;MAC7C;MACA,IAAI,CAACiB,MAAM,CAAC3B,OAAO,CAACkB,GAAG,EAAE;QACvBS,MAAM,CAAC3B,OAAO,CAACkB,GAAG,GAAG,IAAI,CAACA,GAAG;MAC/B;MACA,IAAI,CAACS,MAAM,CAAC3B,OAAO,CAACc,IAAI,EAAE;QACxBa,MAAM,CAAC3B,OAAO,CAACc,IAAI,GAAG,IAAI,CAACA,IAAI;MACjC;IACF;EACF;AACF,CAAC"}
|
package/lib/module/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["VERSION"],"sources":["version.ts"],"sourcesContent":["const VERSION = '3.
|
|
1
|
+
{"version":3,"names":["VERSION"],"sources":["version.ts"],"sourcesContent":["const VERSION = '3.3.0';\nexport default VERSION;\n"],"mappings":"AAAA,MAAMA,OAAO,GAAG,OAAO;AACvB,eAAeA,OAAO"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { StyleProp, TextStyle } from 'react-native';
|
|
2
3
|
import { SendbirdBaseChannel, SendbirdFileMessage, SendbirdFileMessageCreateParams, SendbirdFileMessageUpdateParams, SendbirdMember, SendbirdUserMessage, SendbirdUserMessageCreateParams, SendbirdUserMessageUpdateParams } from '@sendbird/uikit-utils';
|
|
3
4
|
import type { MentionedUser, Range } from '../../types';
|
|
4
5
|
import type { AttachmentsButtonProps } from './AttachmentsButton';
|
|
@@ -14,6 +15,7 @@ export type SuggestedMentionListProps = {
|
|
|
14
15
|
mentionedUsers: MentionedUser[];
|
|
15
16
|
};
|
|
16
17
|
export type ChannelInputProps = {
|
|
18
|
+
style?: StyleProp<TextStyle>;
|
|
17
19
|
channel: SendbirdBaseChannel;
|
|
18
20
|
shouldRenderInput: boolean;
|
|
19
21
|
keyboardAvoidOffset: number;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { Ref } from 'react';
|
|
2
2
|
import { FlatList, FlatListProps } from 'react-native';
|
|
3
|
+
import { BottomSheetItem } from '@sendbird/uikit-react-native-foundation';
|
|
3
4
|
import { SendbirdFileMessage, SendbirdGroupChannel, SendbirdMessage, SendbirdOpenChannel, SendbirdUserMessage } from '@sendbird/uikit-utils';
|
|
4
5
|
import type { UserProfileContextType } from '../../contexts/UserProfileCtx';
|
|
5
6
|
import type { CommonComponent } from '../../types';
|
|
@@ -38,6 +39,8 @@ export type ChannelMessageListProps<T extends SendbirdGroupChannel | SendbirdOpe
|
|
|
38
39
|
channel: T;
|
|
39
40
|
currentUserId?: ChannelMessageListProps<T>['currentUserId'];
|
|
40
41
|
enableMessageGrouping: ChannelMessageListProps<T>['enableMessageGrouping'];
|
|
42
|
+
bottomSheetItem?: BottomSheetItem;
|
|
43
|
+
isFirstItem: boolean;
|
|
41
44
|
}) => React.ReactElement | null;
|
|
42
45
|
renderNewMessagesButton: null | CommonComponent<{
|
|
43
46
|
visible: boolean;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { SendbirdMessage } from '@sendbird/uikit-utils';
|
|
3
|
+
export declare const GroupChannelTypingIndicatorBubble: () => React.JSX.Element | null;
|
|
3
4
|
declare const _default: React.MemoExoticComponent<(props: {
|
|
4
5
|
focused: boolean;
|
|
5
6
|
message: SendbirdMessage;
|
|
@@ -14,5 +15,7 @@ declare const _default: React.MemoExoticComponent<(props: {
|
|
|
14
15
|
channel: import("@sendbird/chat/groupChannel").GroupChannel;
|
|
15
16
|
currentUserId?: string | undefined;
|
|
16
17
|
enableMessageGrouping: boolean;
|
|
18
|
+
bottomSheetItem?: import("@sendbird/uikit-react-native-foundation").BottomSheetItem | undefined;
|
|
19
|
+
isFirstItem: boolean;
|
|
17
20
|
}) => React.ReactElement<any, string | React.JSXElementConstructor<any>> | null>;
|
|
18
21
|
export default _default;
|
|
@@ -14,5 +14,7 @@ declare const _default: React.MemoExoticComponent<(props: {
|
|
|
14
14
|
channel: import("@sendbird/chat/openChannel").OpenChannel;
|
|
15
15
|
currentUserId?: string | undefined;
|
|
16
16
|
enableMessageGrouping: boolean;
|
|
17
|
+
bottomSheetItem?: import("@sendbird/uikit-react-native-foundation").BottomSheetItem | undefined;
|
|
18
|
+
isFirstItem: boolean;
|
|
17
19
|
}) => React.ReactElement<any, string | React.JSXElementConstructor<any>> | null>;
|
|
18
20
|
export default _default;
|
|
@@ -13,7 +13,7 @@ import type { StringSet } from '../localization/StringSet.type';
|
|
|
13
13
|
import type { ClipboardServiceInterface, FileServiceInterface, MediaServiceInterface, NotificationServiceInterface, PlayerServiceInterface, RecorderServiceInterface } from '../platform/types';
|
|
14
14
|
import type { ErrorBoundaryProps, LocalCacheStorage } from '../types';
|
|
15
15
|
export declare const SendbirdUIKit: Readonly<{
|
|
16
|
-
VERSION: "3.
|
|
16
|
+
VERSION: "3.3.0";
|
|
17
17
|
PLATFORM: string;
|
|
18
18
|
DEFAULT: {
|
|
19
19
|
AUTO_PUSH_TOKEN_REGISTRATION: boolean;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import 'react-native';
|
|
2
|
+
export declare const PromisePolyfill: {
|
|
3
|
+
allSettled<T extends [] | readonly unknown[]>(values: T): Promise<{ -readonly [P in keyof T]: PromiseSettledResult<Awaited<T[P]>>; }>;
|
|
4
|
+
race<T_1>(values: Iterable<T_1 | PromiseLike<T_1>>): Promise<Awaited<T_1>>;
|
|
5
|
+
any<T_2>(values: Iterable<T_2 | PromiseLike<T_2>>): Promise<Awaited<T_2>>;
|
|
6
|
+
apply(): void;
|
|
7
|
+
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const VERSION = "3.
|
|
1
|
+
declare const VERSION = "3.3.0";
|
|
2
2
|
export default VERSION;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sendbird/uikit-react-native",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.3.0",
|
|
4
4
|
"description": "Sendbird UIKit for React Native: A feature-rich and customizable chat UI kit with messaging, channel management, and user authentication.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"sendbird",
|
|
@@ -59,10 +59,10 @@
|
|
|
59
59
|
"access": "public"
|
|
60
60
|
},
|
|
61
61
|
"dependencies": {
|
|
62
|
-
"@sendbird/uikit-chat-hooks": "3.
|
|
63
|
-
"@sendbird/uikit-react-native-foundation": "3.
|
|
64
|
-
"@sendbird/uikit-tools": "
|
|
65
|
-
"@sendbird/uikit-utils": "3.
|
|
62
|
+
"@sendbird/uikit-chat-hooks": "3.3.0",
|
|
63
|
+
"@sendbird/uikit-react-native-foundation": "3.3.0",
|
|
64
|
+
"@sendbird/uikit-tools": "0.0.1-alpha.42",
|
|
65
|
+
"@sendbird/uikit-utils": "3.3.0"
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
68
68
|
"@bam.tech/react-native-image-resizer": "^3.0.4",
|
|
@@ -202,5 +202,5 @@
|
|
|
202
202
|
]
|
|
203
203
|
]
|
|
204
204
|
},
|
|
205
|
-
"gitHead": "
|
|
205
|
+
"gitHead": "51adda5f33a7bb450b51ce30f505dcc9884e9586"
|
|
206
206
|
}
|
|
@@ -1,11 +1,5 @@
|
|
|
1
1
|
import React, { forwardRef } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
NativeSyntheticEvent,
|
|
4
|
-
Platform,
|
|
5
|
-
TextInput as RNTextInput,
|
|
6
|
-
TextInputSelectionChangeEventData,
|
|
7
|
-
View,
|
|
8
|
-
} from 'react-native';
|
|
2
|
+
import { NativeSyntheticEvent, TextInput as RNTextInput, TextInputSelectionChangeEventData, View } from 'react-native';
|
|
9
3
|
|
|
10
4
|
import { MentionType } from '@sendbird/chat/message';
|
|
11
5
|
import { Button, TextInput, createStyleSheet, useToast } from '@sendbird/uikit-react-native-foundation';
|
|
@@ -27,6 +21,7 @@ interface EditInputProps extends ChannelInputProps {
|
|
|
27
21
|
|
|
28
22
|
const EditInput = forwardRef<RNTextInput, EditInputProps>(function EditInput(
|
|
29
23
|
{
|
|
24
|
+
style,
|
|
30
25
|
text,
|
|
31
26
|
onChangeText,
|
|
32
27
|
messageToEdit,
|
|
@@ -81,7 +76,7 @@ const EditInput = forwardRef<RNTextInput, EditInputProps>(function EditInput(
|
|
|
81
76
|
editable={!inputDisabled}
|
|
82
77
|
autoFocus={autoFocus}
|
|
83
78
|
onChangeText={onChangeText}
|
|
84
|
-
style={
|
|
79
|
+
style={style}
|
|
85
80
|
placeholder={STRINGS.LABELS.CHANNEL_INPUT_PLACEHOLDER_ACTIVE}
|
|
86
81
|
onSelectionChange={onSelectionChange}
|
|
87
82
|
>
|
|
@@ -112,13 +107,6 @@ const styles = createStyleSheet({
|
|
|
112
107
|
flexDirection: 'column',
|
|
113
108
|
alignItems: 'center',
|
|
114
109
|
},
|
|
115
|
-
input: {
|
|
116
|
-
flex: 1,
|
|
117
|
-
marginRight: 4,
|
|
118
|
-
minHeight: 36,
|
|
119
|
-
maxHeight: 36 * Platform.select({ ios: 2.5, default: 2 }),
|
|
120
|
-
borderRadius: 20,
|
|
121
|
-
},
|
|
122
110
|
inputWrapper: {
|
|
123
111
|
flexDirection: 'row',
|
|
124
112
|
},
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React, { forwardRef } from 'react';
|
|
2
2
|
import {
|
|
3
3
|
NativeSyntheticEvent,
|
|
4
|
-
Platform,
|
|
5
4
|
TextInput as RNTextInput,
|
|
6
5
|
TextInputSelectionChangeEventData,
|
|
7
6
|
TouchableOpacity,
|
|
@@ -38,6 +37,7 @@ interface SendInputProps extends ChannelInputProps {
|
|
|
38
37
|
|
|
39
38
|
const SendInput = forwardRef<RNTextInput, SendInputProps>(function SendInput(
|
|
40
39
|
{
|
|
40
|
+
style,
|
|
41
41
|
VoiceMessageInput,
|
|
42
42
|
MessageToReplyPreview,
|
|
43
43
|
AttachmentsButton,
|
|
@@ -173,7 +173,7 @@ const SendInput = forwardRef<RNTextInput, SendInputProps>(function SendInput(
|
|
|
173
173
|
onSelectionChange={onSelectionChange}
|
|
174
174
|
editable={!inputDisabled}
|
|
175
175
|
onChangeText={onChangeText}
|
|
176
|
-
style={
|
|
176
|
+
style={style}
|
|
177
177
|
placeholder={getPlaceholder()}
|
|
178
178
|
>
|
|
179
179
|
{mentionManager.textToMentionedComponents(
|
|
@@ -284,13 +284,6 @@ const styles = createStyleSheet({
|
|
|
284
284
|
alignItems: 'center',
|
|
285
285
|
flexDirection: 'row',
|
|
286
286
|
},
|
|
287
|
-
input: {
|
|
288
|
-
flex: 1,
|
|
289
|
-
marginRight: 4,
|
|
290
|
-
minHeight: 36,
|
|
291
|
-
maxHeight: 36 * Platform.select({ ios: 2.5, default: 2 }),
|
|
292
|
-
borderRadius: 20,
|
|
293
|
-
},
|
|
294
287
|
sendIcon: {
|
|
295
288
|
marginLeft: 4,
|
|
296
289
|
padding: 4,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import React, { useEffect, useState } from 'react';
|
|
2
|
-
import { KeyboardAvoidingView, Platform, TextInput, View } from 'react-native';
|
|
1
|
+
import React, { useEffect, useMemo, useState } from 'react';
|
|
2
|
+
import { KeyboardAvoidingView, Platform, StyleProp, StyleSheet, TextInput, TextStyle, View } from 'react-native';
|
|
3
3
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
4
4
|
|
|
5
5
|
import { createStyleSheet, useUIKitTheme } from '@sendbird/uikit-react-native-foundation';
|
|
@@ -39,6 +39,9 @@ export type SuggestedMentionListProps = {
|
|
|
39
39
|
};
|
|
40
40
|
|
|
41
41
|
export type ChannelInputProps = {
|
|
42
|
+
// style
|
|
43
|
+
style?: StyleProp<TextStyle>;
|
|
44
|
+
|
|
42
45
|
// default
|
|
43
46
|
channel: SendbirdBaseChannel;
|
|
44
47
|
shouldRenderInput: boolean;
|
|
@@ -85,7 +88,7 @@ const ChannelInput = (props: ChannelInputProps) => {
|
|
|
85
88
|
const { channel, keyboardAvoidOffset, messageToEdit, setMessageToEdit } = props;
|
|
86
89
|
|
|
87
90
|
const { top, left, right, bottom } = useSafeAreaInsets();
|
|
88
|
-
const { colors } = useUIKitTheme();
|
|
91
|
+
const { colors, typography } = useUIKitTheme();
|
|
89
92
|
const { sbOptions, mentionManager } = useSendbirdChat();
|
|
90
93
|
|
|
91
94
|
const { selection, onSelectionChange, textInputRef, text, onChangeText, mentionedUsers } = useMentionTextInput({
|
|
@@ -98,11 +101,18 @@ const ChannelInput = (props: ChannelInputProps) => {
|
|
|
98
101
|
|
|
99
102
|
const mentionAvailable =
|
|
100
103
|
sbOptions.uikit.groupChannel.channel.enableMention && channel.isGroupChannel() && !channel.isBroadcast;
|
|
101
|
-
|
|
102
104
|
const inputKeyToRemount = GET_INPUT_KEY(mentionAvailable ? mentionedUsers.length === 0 : false);
|
|
103
105
|
|
|
104
106
|
const [inputHeight, setInputHeight] = useState(styles.inputDefault.height);
|
|
105
107
|
|
|
108
|
+
const fontStyle = useMemo(() => {
|
|
109
|
+
if (!typography.body3.fontSize) return typography.body3;
|
|
110
|
+
// NOTE: iOS does not support textAlignVertical, so we should adjust lineHeight to center the text in multiline TextInput.
|
|
111
|
+
return { ...typography.body3, lineHeight: typography.body3.fontSize * 1.275, textAlignVertical: 'center' };
|
|
112
|
+
}, [typography.body3.fontSize]);
|
|
113
|
+
|
|
114
|
+
const textInputStyle = StyleSheet.flatten([styles.input, fontStyle, props.style]);
|
|
115
|
+
|
|
106
116
|
useTypingTrigger(text, channel);
|
|
107
117
|
useTextClearOnDisabled(onChangeText, props.inputDisabled);
|
|
108
118
|
useAutoFocusOnEditMode(textInputRef, messageToEdit);
|
|
@@ -138,6 +148,7 @@ const ChannelInput = (props: ChannelInputProps) => {
|
|
|
138
148
|
VoiceMessageInput={props.VoiceMessageInput ?? VoiceMessageInput}
|
|
139
149
|
AttachmentsButton={props.AttachmentsButton ?? AttachmentsButton}
|
|
140
150
|
MessageToReplyPreview={props.MessageToReplyPreview ?? MessageToReplyPreview}
|
|
151
|
+
style={textInputStyle}
|
|
141
152
|
/>
|
|
142
153
|
)}
|
|
143
154
|
{inputMode === 'edit' && messageToEdit && (
|
|
@@ -152,6 +163,7 @@ const ChannelInput = (props: ChannelInputProps) => {
|
|
|
152
163
|
mentionedUsers={mentionedUsers}
|
|
153
164
|
messageToEdit={messageToEdit}
|
|
154
165
|
setMessageToEdit={setMessageToEdit}
|
|
166
|
+
style={textInputStyle}
|
|
155
167
|
/>
|
|
156
168
|
)}
|
|
157
169
|
</View>
|
|
@@ -211,6 +223,17 @@ const styles = createStyleSheet({
|
|
|
211
223
|
inputDefault: {
|
|
212
224
|
height: 56,
|
|
213
225
|
},
|
|
226
|
+
input: {
|
|
227
|
+
flex: 1,
|
|
228
|
+
marginRight: 4,
|
|
229
|
+
borderRadius: 20,
|
|
230
|
+
paddingTop: 8,
|
|
231
|
+
paddingBottom: 8,
|
|
232
|
+
minHeight: 36,
|
|
233
|
+
// Android - padding area is hidden
|
|
234
|
+
// iOS - padding area is visible
|
|
235
|
+
maxHeight: Platform.select({ ios: 36 * 2 + 16, android: 36 * 2 }),
|
|
236
|
+
},
|
|
214
237
|
});
|
|
215
238
|
|
|
216
239
|
export default React.memo(ChannelInput);
|