@linktr.ee/messaging-react 1.11.2 → 1.11.3
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 +578 -433
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/ChannelList/CustomChannelPreview.tsx +1 -1
- package/src/components/ChannelView.tsx +3 -3
- package/src/components/MessagingShell/EmptyState.tsx +105 -12
- package/src/components/MessagingShell/index.tsx +2 -2
- package/src/providers/MessagingProvider.tsx +9 -1
package/package.json
CHANGED
|
@@ -72,7 +72,7 @@ const CustomChannelPreview: React.FC<
|
|
|
72
72
|
type="button"
|
|
73
73
|
onClick={handleClick}
|
|
74
74
|
className={classNames(
|
|
75
|
-
'group w-full px-4 py-3 transition-colors
|
|
75
|
+
'group w-full px-4 py-3 transition-colors text-left max-w-full overflow-hidden focus-ring',
|
|
76
76
|
{
|
|
77
77
|
'bg-primary-alt/10 border-l-4 border-l-primary': isSelected,
|
|
78
78
|
'hover:bg-sand': !isSelected,
|
|
@@ -291,7 +291,7 @@ const ChannelInfoDialog: React.FC<{
|
|
|
291
291
|
// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
|
|
292
292
|
<dialog
|
|
293
293
|
ref={dialogRef}
|
|
294
|
-
className="mes-dialog"
|
|
294
|
+
className="mes-dialog group"
|
|
295
295
|
onClose={onClose}
|
|
296
296
|
onClick={(e) => {
|
|
297
297
|
if (e.target === dialogRef.current) {
|
|
@@ -299,7 +299,7 @@ const ChannelInfoDialog: React.FC<{
|
|
|
299
299
|
}
|
|
300
300
|
}}
|
|
301
301
|
>
|
|
302
|
-
<div className="ml-auto flex h-full w-full flex-col bg-white shadow-max-elevation-light">
|
|
302
|
+
<div className="ml-auto flex h-full w-full flex-col bg-white shadow-none transition-shadow duration-200 group-open:shadow-max-elevation-light">
|
|
303
303
|
<div className="flex items-center justify-between border-b border-sand px-4 py-3">
|
|
304
304
|
<h2 className="text-base font-semibold text-charcoal">Chat info</h2>
|
|
305
305
|
<CloseButton onClick={onClose} />
|
|
@@ -526,7 +526,7 @@ export const ChannelView: React.FC<ChannelViewProps> = ({
|
|
|
526
526
|
return (
|
|
527
527
|
<div
|
|
528
528
|
className={classNames(
|
|
529
|
-
'messaging-channel-view h-full flex flex-col
|
|
529
|
+
'messaging-channel-view h-full flex flex-col',
|
|
530
530
|
className
|
|
531
531
|
)}
|
|
532
532
|
>
|
|
@@ -1,5 +1,98 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
|
|
3
|
+
const ChatBubblesIllustration = ({ className }: { className?: string }) => (
|
|
4
|
+
<svg
|
|
5
|
+
width="140"
|
|
6
|
+
height="120"
|
|
7
|
+
viewBox="44 -2 144 126"
|
|
8
|
+
fill="none"
|
|
9
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
10
|
+
className={className}
|
|
11
|
+
>
|
|
12
|
+
<g clipPath="url(#clip0_empty_state)">
|
|
13
|
+
<path
|
|
14
|
+
d="M123.68 82.1932C123.383 103.675 105.839 121 84.2417 121C77.4724 121 71.0986 119.297 65.5327 116.299L52.5873 119.687L53.8036 106.673C48.1776 99.8701 44.7994 91.1453 44.7994 81.6356C44.7994 59.8965 62.4554 42.2754 84.2374 42.2754C89.1328 42.2754 93.8175 43.1633 98.1413 44.789"
|
|
15
|
+
fill="#D7D4CE"
|
|
16
|
+
/>
|
|
17
|
+
<path
|
|
18
|
+
d="M84.2458 86.0364C82.2851 86.0364 80.6957 84.4501 80.6957 82.4933C80.6957 80.5365 82.2851 78.9502 84.2458 78.9502C86.2065 78.9502 87.7959 80.5365 87.7959 82.4933C87.7959 84.4501 86.2065 86.0364 84.2458 86.0364Z"
|
|
19
|
+
fill="white"
|
|
20
|
+
/>
|
|
21
|
+
<path
|
|
22
|
+
d="M68.3044 86.0364C66.3437 86.0364 64.7543 84.4501 64.7543 82.4933C64.7543 80.5365 66.3437 78.9502 68.3044 78.9502C70.2651 78.9502 71.8545 80.5365 71.8545 82.4933C71.8545 84.4501 70.2651 86.0364 68.3044 86.0364Z"
|
|
23
|
+
fill="white"
|
|
24
|
+
/>
|
|
25
|
+
<path
|
|
26
|
+
d="M100.183 86.0364C98.2226 86.0364 96.6332 84.4501 96.6332 82.4933C96.6332 80.5365 98.2226 78.9502 100.183 78.9502C102.144 78.9502 103.733 80.5365 103.733 82.4933C103.733 84.4501 102.144 86.0364 100.183 86.0364Z"
|
|
27
|
+
fill="white"
|
|
28
|
+
/>
|
|
29
|
+
<g filter="url(#filter0_empty_state)">
|
|
30
|
+
<path
|
|
31
|
+
d="M171.522 68.7154C177.443 61.4539 181 52.1488 181 42C181 18.8027 162.421 0 139.5 0C116.579 0 98 18.8027 98 42C98 65.1973 116.579 84 139.5 84C146.622 84 153.328 82.1857 159.184 78.9829L172.801 82.5993L171.522 68.7154Z"
|
|
32
|
+
fill="white"
|
|
33
|
+
/>
|
|
34
|
+
<path
|
|
35
|
+
d="M171.522 68.7154C177.443 61.4539 181 52.1488 181 42C181 18.8027 162.421 0 139.5 0C116.579 0 98 18.8027 98 42C98 65.1973 116.579 84 139.5 84C146.622 84 153.328 82.1857 159.184 78.9829L172.801 82.5993L171.522 68.7154Z"
|
|
36
|
+
stroke="#D7D4CE"
|
|
37
|
+
strokeWidth="2"
|
|
38
|
+
strokeMiterlimit="10"
|
|
39
|
+
/>
|
|
40
|
+
</g>
|
|
41
|
+
<path
|
|
42
|
+
d="M139.502 45.5431C137.541 45.5431 135.952 43.9568 135.952 42C135.952 40.0432 137.541 38.4569 139.502 38.4569C141.462 38.4569 143.052 40.0432 143.052 42C143.052 43.9568 141.462 45.5431 139.502 45.5431Z"
|
|
43
|
+
fill="#D7D4CE"
|
|
44
|
+
/>
|
|
45
|
+
<path
|
|
46
|
+
d="M123.561 45.5431C121.601 45.5431 120.011 43.9568 120.011 42C120.011 40.0432 121.601 38.4569 123.561 38.4569C125.522 38.4569 127.111 40.0432 127.111 42C127.111 43.9568 125.522 45.5431 123.561 45.5431Z"
|
|
47
|
+
fill="#D7D4CE"
|
|
48
|
+
/>
|
|
49
|
+
<path
|
|
50
|
+
d="M155.439 45.5431C153.478 45.5431 151.889 43.9568 151.889 42C151.889 40.0432 153.478 38.4569 155.439 38.4569C157.4 38.4569 158.989 40.0432 158.989 42C158.989 43.9568 157.4 45.5431 155.439 45.5431Z"
|
|
51
|
+
fill="#D7D4CE"
|
|
52
|
+
/>
|
|
53
|
+
</g>
|
|
54
|
+
<defs>
|
|
55
|
+
<filter
|
|
56
|
+
id="filter0_empty_state"
|
|
57
|
+
x="97"
|
|
58
|
+
y="-1"
|
|
59
|
+
width="89"
|
|
60
|
+
height="90"
|
|
61
|
+
filterUnits="userSpaceOnUse"
|
|
62
|
+
colorInterpolationFilters="sRGB"
|
|
63
|
+
>
|
|
64
|
+
<feFlood floodOpacity="0" result="BackgroundImageFix" />
|
|
65
|
+
<feColorMatrix
|
|
66
|
+
in="SourceAlpha"
|
|
67
|
+
type="matrix"
|
|
68
|
+
values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"
|
|
69
|
+
result="hardAlpha"
|
|
70
|
+
/>
|
|
71
|
+
<feOffset dx="4" dy="4" />
|
|
72
|
+
<feComposite in2="hardAlpha" operator="out" />
|
|
73
|
+
<feColorMatrix
|
|
74
|
+
type="matrix"
|
|
75
|
+
values="0 0 0 0 0.8428 0 0 0 0 0.830064 0 0 0 0 0.8095 0 0 0 1 0"
|
|
76
|
+
/>
|
|
77
|
+
<feBlend
|
|
78
|
+
mode="normal"
|
|
79
|
+
in2="BackgroundImageFix"
|
|
80
|
+
result="effect1_dropShadow"
|
|
81
|
+
/>
|
|
82
|
+
<feBlend
|
|
83
|
+
mode="normal"
|
|
84
|
+
in="SourceGraphic"
|
|
85
|
+
in2="effect1_dropShadow"
|
|
86
|
+
result="shape"
|
|
87
|
+
/>
|
|
88
|
+
</filter>
|
|
89
|
+
<clipPath id="clip0_empty_state">
|
|
90
|
+
<rect width="233" height="233" fill="white" />
|
|
91
|
+
</clipPath>
|
|
92
|
+
</defs>
|
|
93
|
+
</svg>
|
|
94
|
+
)
|
|
95
|
+
|
|
3
96
|
/**
|
|
4
97
|
* Empty state component shown when no channel is selected
|
|
5
98
|
*/
|
|
@@ -7,18 +100,18 @@ export const EmptyState: React.FC<{
|
|
|
7
100
|
hasChannels: boolean
|
|
8
101
|
}> = ({ hasChannels }) => (
|
|
9
102
|
<div className="messaging-empty-state flex items-center justify-center h-full p-8 text-balance">
|
|
10
|
-
<div className="
|
|
11
|
-
<
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
103
|
+
<div className="flex flex-col items-center max-w-sm text-center">
|
|
104
|
+
<ChatBubblesIllustration />
|
|
105
|
+
{!hasChannels && (
|
|
106
|
+
<div className="mt-8">
|
|
107
|
+
<h2 className="font-medium text-black text-[18px] mb-2">
|
|
108
|
+
Your inbox is empty
|
|
109
|
+
</h2>
|
|
110
|
+
<p className="text-[#676B5F] text-sm mb-6">
|
|
111
|
+
Share with your followers to start receiving messages
|
|
112
|
+
</p>
|
|
113
|
+
</div>
|
|
114
|
+
)}
|
|
22
115
|
</div>
|
|
23
116
|
</div>
|
|
24
117
|
)
|
|
@@ -389,7 +389,7 @@ export const MessagingShell: React.FC<MessagingShellProps> = ({
|
|
|
389
389
|
return (
|
|
390
390
|
<div
|
|
391
391
|
className={classNames(
|
|
392
|
-
'messaging-shell h-full bg-
|
|
392
|
+
'messaging-shell h-full bg-background-secondary overflow-hidden',
|
|
393
393
|
className
|
|
394
394
|
)}
|
|
395
395
|
>
|
|
@@ -397,7 +397,7 @@ export const MessagingShell: React.FC<MessagingShellProps> = ({
|
|
|
397
397
|
{/* Channel List Sidebar */}
|
|
398
398
|
<div
|
|
399
399
|
className={classNames(
|
|
400
|
-
'messaging-channel-list-sidebar min-h-0 min-w-0
|
|
400
|
+
'messaging-channel-list-sidebar min-h-0 min-w-0 lg:flex lg:flex-col',
|
|
401
401
|
{
|
|
402
402
|
// Explicitly hidden via prop or in direct conversation mode
|
|
403
403
|
'!hidden': showChannelList === false || directConversationMode,
|
|
@@ -336,7 +336,15 @@ export const MessagingProvider: React.FC<MessagingProviderProps> = ({
|
|
|
336
336
|
return (
|
|
337
337
|
<MessagingContext.Provider value={contextValue}>
|
|
338
338
|
{client && isConnected ? (
|
|
339
|
-
<Chat
|
|
339
|
+
<Chat
|
|
340
|
+
client={client}
|
|
341
|
+
customClasses={{
|
|
342
|
+
channelList:
|
|
343
|
+
'str-chat__channel-list str-chat__channel-list-react bg-transparent lg:border-r-2 border-r-0 border-[#0000000A]',
|
|
344
|
+
}}
|
|
345
|
+
>
|
|
346
|
+
{children}
|
|
347
|
+
</Chat>
|
|
340
348
|
) : (
|
|
341
349
|
children
|
|
342
350
|
)}
|