@linktr.ee/messaging-react 4.1.7 → 4.1.8-rc-1787213233

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 CHANGED
@@ -1,4 +1,4 @@
1
- import { a as e, b as t, C as i, c as n, d as o, e as m, F as r, f as g, L as l, h as M, M as c, i as h, j as p, k as L, l as u, R as d, T as C, m as v, n as A, p as k, q as F, s as b, t as P, u as T, v as f, w as x, x as y, o as z, y as S, z as q, B, D, E, G as R, H as w } from "./index-xcIpBghu.js";
1
+ import { a as e, b as t, C as i, c as n, d as o, e as m, F as r, f as g, L as l, h as M, M as c, i as h, j as p, k as L, l as u, R as d, T as C, m as v, n as A, p as k, q as F, s as b, t as P, u as T, v as f, w as x, x as y, o as z, y as S, z as q, B, D, E, G as R, H as w } from "./index-D1KC09no.js";
2
2
  export {
3
3
  e as ActionButton,
4
4
  t as Avatar,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@linktr.ee/messaging-react",
3
- "version": "4.1.7",
3
+ "version": "4.1.8-rc-1787213233",
4
4
  "description": "React messaging components built on messaging-core for web applications",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",
@@ -40,8 +40,8 @@
40
40
  "test:ci": "vitest run",
41
41
  "test:ui": "vitest --ui",
42
42
  "test:coverage": "vitest --coverage",
43
- "lint": "npx --no-install eslint .",
44
- "lint:fix": "npx --no-install eslint . --fix",
43
+ "lint": "cd \"$PROJECT_CWD\" && npx --no-install eslint packages/messaging-react",
44
+ "lint:fix": "cd \"$PROJECT_CWD\" && npx --no-install eslint packages/messaging-react --fix",
45
45
  "verify": "yarn type-check && yarn lint && yarn test:ci && yarn build",
46
46
  "storybook": "storybook dev -p 6006",
47
47
  "storybook:build": "storybook build --stats-json",
@@ -50,7 +50,7 @@
50
50
  "chromatic:local": "yarn storybook:build && chromatic"
51
51
  },
52
52
  "dependencies": {
53
- "@linktr.ee/messaging-core": "^2.5.0",
53
+ "@linktr.ee/messaging-core": "2.5.0-rc-1787213233",
54
54
  "@linktr.ee/messaging-taxonomy": "^0.10.0",
55
55
  "@phosphor-icons/react": "^2.1.10"
56
56
  },
@@ -71,7 +71,7 @@
71
71
  "@types/react": "^18.3.24",
72
72
  "@types/react-dom": "^18.3.7",
73
73
  "@vitejs/plugin-react": "^4.2.1",
74
- "@vitest/ui": "^1.0.4",
74
+ "@vitest/ui": "^4.1.10",
75
75
  "autoprefixer": "^10.4.20",
76
76
  "chromatic": "^17.4.0",
77
77
  "classnames": "^2.3.2",
@@ -87,7 +87,7 @@
87
87
  "typescript": "5.9.2",
88
88
  "vite": "^6.0.7",
89
89
  "vite-plugin-dts": "^3.7.0",
90
- "vitest": "^1.0.4"
90
+ "vitest": "^4.1.10"
91
91
  },
92
92
  "peerDependencies": {
93
93
  "classnames": "^2.3.2",
@@ -18,13 +18,12 @@ import React from 'react'
18
18
  import { getDocumentIconType, getSourceType } from './mimeType'
19
19
  import type { AttachmentSourceType } from './mimeType'
20
20
 
21
- const MEDIA_TYPE_ICON: Record<AttachmentSourceType, React.ElementType> =
22
- {
23
- video: VideoCameraIcon,
24
- audio: SpeakerHighIcon,
25
- image: ImageIcon,
26
- document: FileIcon,
27
- }
21
+ const MEDIA_TYPE_ICON: Record<AttachmentSourceType, React.ElementType> = {
22
+ video: VideoCameraIcon,
23
+ audio: SpeakerHighIcon,
24
+ image: ImageIcon,
25
+ document: FileIcon,
26
+ }
28
27
 
29
28
  const DOCUMENT_ICON_COMPONENT = {
30
29
  pdf: FilePdfIcon,
@@ -223,10 +223,14 @@ describe('ChannelView', () => {
223
223
 
224
224
  it('widens the content column in the official (read-only) channel via the width var', () => {
225
225
  const { container } = renderWithProviders(
226
- <ChannelView channel={createChannel({ channelType: OFFICIAL_CHANNEL_TYPE })} />
226
+ <ChannelView
227
+ channel={createChannel({ channelType: OFFICIAL_CHANNEL_TYPE })}
228
+ />
227
229
  )
228
230
 
229
- const root = container.querySelector('.messaging-channel-view') as HTMLElement
231
+ const root = container.querySelector(
232
+ '.messaging-channel-view'
233
+ ) as HTMLElement
230
234
  expect(root.style.getPropertyValue('--lt-msg-card-width')).toBe('368px')
231
235
  })
232
236
 
@@ -235,7 +239,9 @@ describe('ChannelView', () => {
235
239
  <ChannelView channel={createChannel({ channelType: 'messaging' })} />
236
240
  )
237
241
 
238
- const root = container.querySelector('.messaging-channel-view') as HTMLElement
242
+ const root = container.querySelector(
243
+ '.messaging-channel-view'
244
+ ) as HTMLElement
239
245
  expect(root.style.getPropertyValue('--lt-msg-card-width')).toBe('')
240
246
  })
241
247
 
@@ -155,9 +155,7 @@ export function buildOrderedAttachmentSegments(
155
155
  return segments
156
156
  }
157
157
 
158
- function countMediaSegmentBubbles(
159
- segments: AttachmentSegment[]
160
- ): number {
158
+ function countMediaSegmentBubbles(segments: AttachmentSegment[]): number {
161
159
  return segments.filter((segment) => segment.type === 'media').length
162
160
  }
163
161
 
@@ -245,7 +243,9 @@ function buildMediaClusterRenderProps(
245
243
  ): Record<string, unknown> {
246
244
  if (attachments.length > 1) {
247
245
  return {
248
- items: attachments.map((attachment) => mediaItemForKind(kind, attachment)),
246
+ items: attachments.map((attachment) =>
247
+ mediaItemForKind(kind, attachment)
248
+ ),
249
249
  }
250
250
  }
251
251
 
@@ -318,8 +318,7 @@ const StreamAttachmentMessage: React.FC<StreamAttachmentMessageProps> = ({
318
318
  : groupPosition
319
319
  // The trailing caption bubble carries the tail on single / last-in-run
320
320
  // messages, matching the in-channel text bubbles.
321
- const captionShowsTail =
322
- groupPosition === 'single' || groupPosition === 'end'
321
+ const captionShowsTail = groupPosition === 'single' || groupPosition === 'end'
323
322
 
324
323
  const pushLinkRow = (
325
324
  attachment: Attachment,
@@ -19,8 +19,9 @@ const DM_AGENT_SYSTEM_MESSAGE_FALLBACK_TEXT: Record<DmAgentSystemType, string> =
19
19
  * explicitly added. Keep in sync with the mobile client (cerberus
20
20
  * `CustomMessageSystem`); there is no shared package between the two surfaces.
21
21
  */
22
- const SHOW_SYSTEM_MESSAGE_TIMESTAMP_TYPES: readonly AgeSafetySystemType[] =
23
- ['SYSTEM_AGE_SAFETY_BLOCKED']
22
+ const SHOW_SYSTEM_MESSAGE_TIMESTAMP_TYPES: readonly AgeSafetySystemType[] = [
23
+ 'SYSTEM_AGE_SAFETY_BLOCKED',
24
+ ]
24
25
 
25
26
  const AGE_SAFETY_SYSTEM_MESSAGE_FALLBACK_TEXT: Record<
26
27
  AgeSafetySystemType,
@@ -29,7 +29,9 @@ describe('RichCard', () => {
29
29
  renderWithProviders(
30
30
  <RichCard.Received
31
31
  title="Welcome"
32
- subtitle={'👋 Say hello as people arrive\n✨ Spark conversations\n💬 Add automated FAQs'}
32
+ subtitle={
33
+ '👋 Say hello as people arrive\n✨ Spark conversations\n💬 Add automated FAQs'
34
+ }
33
35
  subtitleLines={6}
34
36
  images={[HERO]}
35
37
  />
@@ -16,7 +16,9 @@ vi.mock('stream-chat-react', () => ({
16
16
  // The provider constructs the Chat client via `new StreamChat(apiKey)` and
17
17
  // injects it into the service. Stub the constructor so <Chat> sees an instance.
18
18
  vi.mock('stream-chat', () => ({
19
- StreamChat: vi.fn().mockImplementation(() => ({ userID: 'mock' })),
19
+ StreamChat: vi.fn().mockImplementation(function () {
20
+ return { userID: 'mock' }
21
+ }),
20
22
  }))
21
23
 
22
24
  const setupServiceMock = () => {
@@ -16,7 +16,10 @@ import {
16
16
  } from 'stream-chat-react'
17
17
 
18
18
  import { CustomMessage } from '../components/CustomMessage'
19
- import { OutboundContext, buildOutboundsByRecordId } from '../components/CustomMessage/OutboundContext'
19
+ import {
20
+ OutboundContext,
21
+ buildOutboundsByRecordId,
22
+ } from '../components/CustomMessage/OutboundContext'
20
23
  import CustomTypingIndicator from '../components/CustomTypingIndicator'
21
24
  import { createMockStreamChatClient } from '../testing/createMockStreamChatClient'
22
25
  import type { OutboundResolver } from '../types'
package/src/styles.css CHANGED
@@ -120,10 +120,6 @@
120
120
  }
121
121
  }
122
122
 
123
- .messaging-channel-layout {
124
- --messaging-composer-fade-height: 2rem;
125
- }
126
-
127
123
  .messaging-composer-chrome--floating {
128
124
  position: relative;
129
125
  right: 0;
@@ -132,27 +128,27 @@
132
128
  z-index: 20;
133
129
  }
134
130
 
131
+ /* 12/20 above the custom composer — chrome padding box only, not host composerInput. */
132
+ .messaging-composer-chrome--floating > .relative.z-10 > .p-4 {
133
+ padding-top: 12px;
134
+ }
135
+
136
+ @media (min-width: 767px) {
137
+ .messaging-composer-chrome--floating > .relative.z-10 > .p-4 {
138
+ padding-top: 20px;
139
+ }
140
+ }
141
+
135
142
  .messaging-channel-layout > .messaging-composer-chrome--floating {
136
143
  position: absolute;
137
144
  }
138
145
 
139
146
  .messaging-composer-chrome--floating .messaging-composer-backdrop {
140
147
  position: absolute;
141
- top: calc(-1 * var(--messaging-composer-fade-height));
142
- right: 0;
143
- bottom: 0;
144
- left: 0;
148
+ inset: 0;
145
149
  overflow: hidden;
146
150
  isolation: isolate;
147
151
  pointer-events: none;
148
- /* Frosted band height, from the backdrop's top edge down to the composer
149
- pill: the fade-height above the chrome plus the chrome's own top padding
150
- (p-4 = 1rem). Blur/gradient stops are anchored to this fixed band so the
151
- frosting stays in the gap above the composer and does not scale with the
152
- (opaque) composer height. */
153
- --messaging-composer-fade-band: calc(
154
- var(--messaging-composer-fade-height) + 1rem
155
- );
156
152
  }
157
153
 
158
154
  .messaging-composer-backdrop-blur {
@@ -161,99 +157,71 @@
161
157
  pointer-events: none;
162
158
  }
163
159
 
160
+ /* Figma progressive background blur: (50%, 0%) → (50%, 100%), 0 → 16.
161
+ CSS has no spatially-varying blur, so five evenly spaced masked layers
162
+ approximate the linear ramp across the full parent height. */
164
163
  .messaging-composer-backdrop-blur:nth-child(1) {
165
- backdrop-filter: blur(2px);
166
- -webkit-backdrop-filter: blur(2px);
167
- mask: linear-gradient(
168
- to bottom,
169
- transparent 0,
170
- black calc(var(--messaging-composer-fade-band) * 0.12),
171
- black calc(var(--messaging-composer-fade-band) * 0.32),
172
- transparent calc(var(--messaging-composer-fade-band) * 0.5)
173
- );
174
- -webkit-mask: linear-gradient(
164
+ --messaging-composer-blur-mask: linear-gradient(
175
165
  to bottom,
176
- transparent 0,
177
- black calc(var(--messaging-composer-fade-band) * 0.12),
178
- black calc(var(--messaging-composer-fade-band) * 0.32),
179
- transparent calc(var(--messaging-composer-fade-band) * 0.5)
166
+ transparent 0%,
167
+ black 20%,
168
+ transparent 40%
180
169
  );
170
+ backdrop-filter: blur(3.2px);
171
+ -webkit-backdrop-filter: blur(3.2px);
172
+ mask: var(--messaging-composer-blur-mask);
173
+ -webkit-mask: var(--messaging-composer-blur-mask);
181
174
  }
182
175
 
183
176
  .messaging-composer-backdrop-blur:nth-child(2) {
184
- backdrop-filter: blur(4px);
185
- -webkit-backdrop-filter: blur(4px);
186
- mask: linear-gradient(
187
- to bottom,
188
- transparent calc(var(--messaging-composer-fade-band) * 0.2),
189
- black calc(var(--messaging-composer-fade-band) * 0.38),
190
- black calc(var(--messaging-composer-fade-band) * 0.55),
191
- transparent calc(var(--messaging-composer-fade-band) * 0.7)
192
- );
193
- -webkit-mask: linear-gradient(
177
+ --messaging-composer-blur-mask: linear-gradient(
194
178
  to bottom,
195
- transparent calc(var(--messaging-composer-fade-band) * 0.2),
196
- black calc(var(--messaging-composer-fade-band) * 0.38),
197
- black calc(var(--messaging-composer-fade-band) * 0.55),
198
- transparent calc(var(--messaging-composer-fade-band) * 0.7)
179
+ transparent 20%,
180
+ black 40%,
181
+ transparent 60%
199
182
  );
183
+ backdrop-filter: blur(6.4px);
184
+ -webkit-backdrop-filter: blur(6.4px);
185
+ mask: var(--messaging-composer-blur-mask);
186
+ -webkit-mask: var(--messaging-composer-blur-mask);
200
187
  }
201
188
 
202
189
  .messaging-composer-backdrop-blur:nth-child(3) {
203
- backdrop-filter: blur(8px);
204
- -webkit-backdrop-filter: blur(8px);
205
- mask: linear-gradient(
190
+ --messaging-composer-blur-mask: linear-gradient(
206
191
  to bottom,
207
- transparent calc(var(--messaging-composer-fade-band) * 0.4),
208
- black calc(var(--messaging-composer-fade-band) * 0.58),
209
- black calc(var(--messaging-composer-fade-band) * 0.72),
210
- transparent calc(var(--messaging-composer-fade-band) * 0.85)
211
- );
212
- -webkit-mask: linear-gradient(
213
- to bottom,
214
- transparent calc(var(--messaging-composer-fade-band) * 0.4),
215
- black calc(var(--messaging-composer-fade-band) * 0.58),
216
- black calc(var(--messaging-composer-fade-band) * 0.72),
217
- transparent calc(var(--messaging-composer-fade-band) * 0.85)
192
+ transparent 40%,
193
+ black 60%,
194
+ transparent 80%
218
195
  );
196
+ backdrop-filter: blur(9.6px);
197
+ -webkit-backdrop-filter: blur(9.6px);
198
+ mask: var(--messaging-composer-blur-mask);
199
+ -webkit-mask: var(--messaging-composer-blur-mask);
219
200
  }
220
201
 
221
202
  .messaging-composer-backdrop-blur:nth-child(4) {
222
- backdrop-filter: blur(12px);
223
- -webkit-backdrop-filter: blur(12px);
224
- mask: linear-gradient(
225
- to bottom,
226
- transparent calc(var(--messaging-composer-fade-band) * 0.55),
227
- black calc(var(--messaging-composer-fade-band) * 0.72),
228
- black calc(var(--messaging-composer-fade-band) * 0.88),
229
- transparent var(--messaging-composer-fade-band)
230
- );
231
- -webkit-mask: linear-gradient(
203
+ --messaging-composer-blur-mask: linear-gradient(
232
204
  to bottom,
233
- transparent calc(var(--messaging-composer-fade-band) * 0.55),
234
- black calc(var(--messaging-composer-fade-band) * 0.72),
235
- black calc(var(--messaging-composer-fade-band) * 0.88),
236
- transparent var(--messaging-composer-fade-band)
205
+ transparent 60%,
206
+ black 80%,
207
+ transparent 100%
237
208
  );
209
+ backdrop-filter: blur(12.8px);
210
+ -webkit-backdrop-filter: blur(12.8px);
211
+ mask: var(--messaging-composer-blur-mask);
212
+ -webkit-mask: var(--messaging-composer-blur-mask);
238
213
  }
239
214
 
240
215
  .messaging-composer-backdrop-blur:nth-child(5) {
241
- backdrop-filter: blur(16px);
242
- -webkit-backdrop-filter: blur(16px);
243
- mask: linear-gradient(
244
- to bottom,
245
- transparent calc(var(--messaging-composer-fade-band) * 0.7),
246
- black calc(var(--messaging-composer-fade-band) * 0.9),
247
- black var(--messaging-composer-fade-band),
248
- transparent var(--messaging-composer-fade-band)
249
- );
250
- -webkit-mask: linear-gradient(
216
+ --messaging-composer-blur-mask: linear-gradient(
251
217
  to bottom,
252
- transparent calc(var(--messaging-composer-fade-band) * 0.7),
253
- black calc(var(--messaging-composer-fade-band) * 0.9),
254
- black var(--messaging-composer-fade-band),
255
- transparent var(--messaging-composer-fade-band)
218
+ transparent 80%,
219
+ black 100%
256
220
  );
221
+ backdrop-filter: blur(16px);
222
+ -webkit-backdrop-filter: blur(16px);
223
+ mask: var(--messaging-composer-blur-mask);
224
+ -webkit-mask: var(--messaging-composer-blur-mask);
257
225
  }
258
226
 
259
227
  .messaging-composer-backdrop-gradient {
@@ -261,9 +229,9 @@
261
229
  inset: 0;
262
230
  pointer-events: none;
263
231
  background: linear-gradient(
264
- 180deg,
265
- rgba(251, 250, 249, 0) 0,
266
- #fbfaf9 var(--messaging-composer-fade-band)
232
+ to bottom,
233
+ rgba(251, 250, 249, 0) 0%,
234
+ #fbfaf9 100%
267
235
  );
268
236
  }
269
237
 
@@ -934,7 +902,8 @@
934
902
  /* Tighter gap for the locked-attachment card + text bubble and the tip
935
903
  pill + text bubble — same margin-top mechanism, smaller value. Must come
936
904
  after the rule above: equal specificity, so source order decides. */
937
- .message-locked-attachment-wrapper > .str-chat__message-bubble:not(:first-child),
905
+ .message-locked-attachment-wrapper
906
+ > .str-chat__message-bubble:not(:first-child),
938
907
  .message-tip-wrapper > .str-chat__message-bubble:not(:first-child) {
939
908
  margin-top: 2px;
940
909
  }