@usechat/react-native 1.0.8 → 1.0.10
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/dist/index.js +21 -29
- package/dist/index.mjs +35 -43
- package/package.json +1 -1
- package/dist/index.d.mts +0 -662
- package/dist/index.d.ts +0 -662
package/dist/index.js
CHANGED
|
@@ -4454,16 +4454,6 @@ var ChatAvatar = ({
|
|
|
4454
4454
|
return { width: 48, height: 48 };
|
|
4455
4455
|
}
|
|
4456
4456
|
};
|
|
4457
|
-
const getTextSize = () => {
|
|
4458
|
-
switch (size) {
|
|
4459
|
-
case "small":
|
|
4460
|
-
return theme.typography.fontSize.sm;
|
|
4461
|
-
case "large":
|
|
4462
|
-
return theme.typography.fontSize.xxl;
|
|
4463
|
-
default:
|
|
4464
|
-
return theme.typography.fontSize.lg;
|
|
4465
|
-
}
|
|
4466
|
-
};
|
|
4467
4457
|
const getIndicatorSize = () => {
|
|
4468
4458
|
switch (size) {
|
|
4469
4459
|
case "small":
|
|
@@ -4477,25 +4467,16 @@ var ChatAvatar = ({
|
|
|
4477
4467
|
const avatarSize = getAvatarSize();
|
|
4478
4468
|
const indicatorSize = getIndicatorSize();
|
|
4479
4469
|
return <import_react_native19.View style={{ position: "relative" }}>
|
|
4470
|
+
<import_react_native19.Image
|
|
4471
|
+
source={{ uri: avatar }}
|
|
4472
|
+
style={[
|
|
4473
|
+
avatarSize,
|
|
4480
4474
|
{
|
|
4481
|
-
|
|
4482
|
-
|
|
4483
|
-
|
|
4484
|
-
|
|
4485
|
-
|
|
4486
|
-
borderRadius: theme.borderRadius.full,
|
|
4487
|
-
backgroundColor: theme.colors.gray[200],
|
|
4488
|
-
alignItems: "center",
|
|
4489
|
-
justifyContent: "center"
|
|
4490
|
-
}
|
|
4491
|
-
]}>
|
|
4492
|
-
<import_react_native19.Text style={{
|
|
4493
|
-
fontSize: getTextSize(),
|
|
4494
|
-
color: theme.colors.text
|
|
4495
|
-
}}>
|
|
4496
|
-
{avatar}
|
|
4497
|
-
</import_react_native19.Text>
|
|
4498
|
-
</import_react_native19.View>
|
|
4475
|
+
borderRadius: theme.borderRadius.full
|
|
4476
|
+
}
|
|
4477
|
+
]}
|
|
4478
|
+
resizeMode="cover"
|
|
4479
|
+
/>
|
|
4499
4480
|
|
|
4500
4481
|
{
|
|
4501
4482
|
/* Online indicator */
|
|
@@ -4607,7 +4588,12 @@ var ChatItem = ({ item, onPress }) => {
|
|
|
4607
4588
|
var ChatItem_default = ChatItem;
|
|
4608
4589
|
|
|
4609
4590
|
// src/components/chat-list/ChatList.tsx
|
|
4610
|
-
var ChatListBase = ({
|
|
4591
|
+
var ChatListBase = ({
|
|
4592
|
+
chats,
|
|
4593
|
+
onChatPress,
|
|
4594
|
+
onRefresh,
|
|
4595
|
+
refreshing = false
|
|
4596
|
+
}) => {
|
|
4611
4597
|
const renderChatItem = ({ item }) => <ChatItem_default item={item} onPress={onChatPress} />;
|
|
4612
4598
|
return <import_react_native21.FlatList
|
|
4613
4599
|
data={chats}
|
|
@@ -4615,6 +4601,12 @@ var ChatListBase = ({ chats, onChatPress }) => {
|
|
|
4615
4601
|
keyExtractor={(item) => item.id}
|
|
4616
4602
|
showsVerticalScrollIndicator={false}
|
|
4617
4603
|
style={{ flex: 1 }}
|
|
4604
|
+
refreshControl={onRefresh ? <import_react_native21.RefreshControl
|
|
4605
|
+
refreshing={refreshing}
|
|
4606
|
+
onRefresh={onRefresh}
|
|
4607
|
+
tintColor="#007AFF"
|
|
4608
|
+
colors={["#007AFF"]}
|
|
4609
|
+
/> : void 0}
|
|
4618
4610
|
/>;
|
|
4619
4611
|
};
|
|
4620
4612
|
var ChatList_default = ChatListBase;
|
package/dist/index.mjs
CHANGED
|
@@ -4341,13 +4341,13 @@ function requireAuthHook(hookFn) {
|
|
|
4341
4341
|
}
|
|
4342
4342
|
|
|
4343
4343
|
// src/components/chat-list/ChatList.tsx
|
|
4344
|
-
import { FlatList as FlatList2 } from "react-native";
|
|
4344
|
+
import { FlatList as FlatList2, RefreshControl } from "react-native";
|
|
4345
4345
|
|
|
4346
4346
|
// src/components/chat-list/ChatItem.tsx
|
|
4347
|
-
import { View as View17, Text as
|
|
4347
|
+
import { View as View17, Text as Text12, TouchableOpacity as TouchableOpacity9 } from "react-native";
|
|
4348
4348
|
|
|
4349
4349
|
// src/components/shared/ChatAvatar.tsx
|
|
4350
|
-
import { View as View16,
|
|
4350
|
+
import { View as View16, Image as Image6 } from "react-native";
|
|
4351
4351
|
var ChatAvatar = ({
|
|
4352
4352
|
avatar,
|
|
4353
4353
|
isOnline = false,
|
|
@@ -4364,16 +4364,6 @@ var ChatAvatar = ({
|
|
|
4364
4364
|
return { width: 48, height: 48 };
|
|
4365
4365
|
}
|
|
4366
4366
|
};
|
|
4367
|
-
const getTextSize = () => {
|
|
4368
|
-
switch (size) {
|
|
4369
|
-
case "small":
|
|
4370
|
-
return theme.typography.fontSize.sm;
|
|
4371
|
-
case "large":
|
|
4372
|
-
return theme.typography.fontSize.xxl;
|
|
4373
|
-
default:
|
|
4374
|
-
return theme.typography.fontSize.lg;
|
|
4375
|
-
}
|
|
4376
|
-
};
|
|
4377
4367
|
const getIndicatorSize = () => {
|
|
4378
4368
|
switch (size) {
|
|
4379
4369
|
case "small":
|
|
@@ -4387,25 +4377,16 @@ var ChatAvatar = ({
|
|
|
4387
4377
|
const avatarSize = getAvatarSize();
|
|
4388
4378
|
const indicatorSize = getIndicatorSize();
|
|
4389
4379
|
return <View16 style={{ position: "relative" }}>
|
|
4380
|
+
<Image6
|
|
4381
|
+
source={{ uri: avatar }}
|
|
4382
|
+
style={[
|
|
4383
|
+
avatarSize,
|
|
4390
4384
|
{
|
|
4391
|
-
|
|
4392
|
-
|
|
4393
|
-
|
|
4394
|
-
|
|
4395
|
-
|
|
4396
|
-
borderRadius: theme.borderRadius.full,
|
|
4397
|
-
backgroundColor: theme.colors.gray[200],
|
|
4398
|
-
alignItems: "center",
|
|
4399
|
-
justifyContent: "center"
|
|
4400
|
-
}
|
|
4401
|
-
]}>
|
|
4402
|
-
<Text12 style={{
|
|
4403
|
-
fontSize: getTextSize(),
|
|
4404
|
-
color: theme.colors.text
|
|
4405
|
-
}}>
|
|
4406
|
-
{avatar}
|
|
4407
|
-
</Text12>
|
|
4408
|
-
</View16>
|
|
4385
|
+
borderRadius: theme.borderRadius.full
|
|
4386
|
+
}
|
|
4387
|
+
]}
|
|
4388
|
+
resizeMode="cover"
|
|
4389
|
+
/>
|
|
4409
4390
|
|
|
4410
4391
|
{
|
|
4411
4392
|
/* Online indicator */
|
|
@@ -4460,22 +4441,22 @@ var ChatItem = ({ item, onPress }) => {
|
|
|
4460
4441
|
alignItems: "center",
|
|
4461
4442
|
marginBottom: theme.spacing.xs
|
|
4462
4443
|
}}>
|
|
4463
|
-
<
|
|
4444
|
+
<Text12 style={{
|
|
4464
4445
|
fontSize: theme.typography.fontSize.base,
|
|
4465
4446
|
flex: 1,
|
|
4466
4447
|
fontWeight: hasUnreadMessages ? theme.typography.fontWeight.bold : theme.typography.fontWeight.semibold,
|
|
4467
4448
|
color: theme.colors.text
|
|
4468
4449
|
}}>
|
|
4469
4450
|
{item.name}
|
|
4470
|
-
</
|
|
4471
|
-
<
|
|
4451
|
+
</Text12>
|
|
4452
|
+
<Text12 style={{
|
|
4472
4453
|
fontSize: theme.typography.fontSize.sm,
|
|
4473
4454
|
marginLeft: theme.spacing.sm,
|
|
4474
4455
|
color: hasUnreadMessages ? theme.colors.gray[700] : theme.colors.textSecondary,
|
|
4475
4456
|
fontWeight: hasUnreadMessages ? theme.typography.fontWeight.medium : theme.typography.fontWeight.normal
|
|
4476
4457
|
}}>
|
|
4477
4458
|
{item.time}
|
|
4478
|
-
</
|
|
4459
|
+
</Text12>
|
|
4479
4460
|
</View17>
|
|
4480
4461
|
|
|
4481
4462
|
{
|
|
@@ -4485,14 +4466,14 @@ var ChatItem = ({ item, onPress }) => {
|
|
|
4485
4466
|
flexDirection: "row",
|
|
4486
4467
|
alignItems: "center"
|
|
4487
4468
|
}}>
|
|
4488
|
-
<
|
|
4469
|
+
<Text12 style={{
|
|
4489
4470
|
fontSize: theme.typography.fontSize.sm,
|
|
4490
4471
|
flex: 1,
|
|
4491
4472
|
color: hasUnreadMessages ? theme.colors.gray[800] : theme.colors.textSecondary,
|
|
4492
4473
|
fontWeight: hasUnreadMessages ? theme.typography.fontWeight.medium : theme.typography.fontWeight.normal
|
|
4493
4474
|
}} numberOfLines={1}>
|
|
4494
4475
|
{item.message}
|
|
4495
|
-
</
|
|
4476
|
+
</Text12>
|
|
4496
4477
|
{item.unreadCount && <View17 style={{
|
|
4497
4478
|
width: 20,
|
|
4498
4479
|
height: 20,
|
|
@@ -4502,13 +4483,13 @@ var ChatItem = ({ item, onPress }) => {
|
|
|
4502
4483
|
justifyContent: "center",
|
|
4503
4484
|
marginLeft: theme.spacing.sm
|
|
4504
4485
|
}}>
|
|
4505
|
-
<
|
|
4486
|
+
<Text12 style={{
|
|
4506
4487
|
fontSize: theme.typography.fontSize.xs,
|
|
4507
4488
|
color: "white",
|
|
4508
4489
|
fontWeight: theme.typography.fontWeight.bold
|
|
4509
4490
|
}}>
|
|
4510
4491
|
{item.unreadCount}
|
|
4511
|
-
</
|
|
4492
|
+
</Text12>
|
|
4512
4493
|
</View17>}
|
|
4513
4494
|
</View17>
|
|
4514
4495
|
</View17>
|
|
@@ -4517,7 +4498,12 @@ var ChatItem = ({ item, onPress }) => {
|
|
|
4517
4498
|
var ChatItem_default = ChatItem;
|
|
4518
4499
|
|
|
4519
4500
|
// src/components/chat-list/ChatList.tsx
|
|
4520
|
-
var ChatListBase = ({
|
|
4501
|
+
var ChatListBase = ({
|
|
4502
|
+
chats,
|
|
4503
|
+
onChatPress,
|
|
4504
|
+
onRefresh,
|
|
4505
|
+
refreshing = false
|
|
4506
|
+
}) => {
|
|
4521
4507
|
const renderChatItem = ({ item }) => <ChatItem_default item={item} onPress={onChatPress} />;
|
|
4522
4508
|
return <FlatList2
|
|
4523
4509
|
data={chats}
|
|
@@ -4525,12 +4511,18 @@ var ChatListBase = ({ chats, onChatPress }) => {
|
|
|
4525
4511
|
keyExtractor={(item) => item.id}
|
|
4526
4512
|
showsVerticalScrollIndicator={false}
|
|
4527
4513
|
style={{ flex: 1 }}
|
|
4514
|
+
refreshControl={onRefresh ? <RefreshControl
|
|
4515
|
+
refreshing={refreshing}
|
|
4516
|
+
onRefresh={onRefresh}
|
|
4517
|
+
tintColor="#007AFF"
|
|
4518
|
+
colors={["#007AFF"]}
|
|
4519
|
+
/> : void 0}
|
|
4528
4520
|
/>;
|
|
4529
4521
|
};
|
|
4530
4522
|
var ChatList_default = ChatListBase;
|
|
4531
4523
|
|
|
4532
4524
|
// src/components/chat-list/ChatHeader.tsx
|
|
4533
|
-
import { View as View18, Text as
|
|
4525
|
+
import { View as View18, Text as Text13 } from "react-native";
|
|
4534
4526
|
var ChatHeader = ({ title }) => {
|
|
4535
4527
|
const theme = useTheme();
|
|
4536
4528
|
return <View18 style={{
|
|
@@ -4540,13 +4532,13 @@ var ChatHeader = ({ title }) => {
|
|
|
4540
4532
|
borderBottomWidth: 1,
|
|
4541
4533
|
borderBottomColor: theme.colors.borderLight
|
|
4542
4534
|
}}>
|
|
4543
|
-
<
|
|
4535
|
+
<Text13 style={{
|
|
4544
4536
|
fontSize: theme.typography.fontSize.xxl,
|
|
4545
4537
|
fontWeight: theme.typography.fontWeight.bold,
|
|
4546
4538
|
color: theme.colors.text
|
|
4547
4539
|
}}>
|
|
4548
4540
|
{title}
|
|
4549
|
-
</
|
|
4541
|
+
</Text13>
|
|
4550
4542
|
</View18>;
|
|
4551
4543
|
};
|
|
4552
4544
|
var ChatHeader_default = ChatHeader;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@usechat/react-native",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.10",
|
|
4
4
|
"description": "Modular React Native Chat UI SDK with keyboard handling, customizable components, and rich features",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"author": "Lukasz Ko <hello@usechat.dev>",
|