@linktr.ee/messaging-react 3.14.4 → 3.14.5

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.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-BZNP-Xf_.cjs");exports.ActionButton=e.ActionButton;exports.Avatar=e.Avatar;exports.ChannelEmptyState=e.ChannelEmptyState;exports.ChannelList=e.ChannelList;exports.ChannelView=e.ChannelView;exports.CustomMessageProvider=e.CustomMessageProvider;exports.FaqList=e.FaqList;exports.FaqListItem=e.FaqListItem;exports.LinkAttachment=e.LinkAttachment;exports.LockedAttachment=e.LockedAttachment;exports.MediaMessage=e.MediaMessage;exports.MessageAttachment=e.MessageAttachment;exports.MessageBubble=e.MessageBubble;exports.MessageVoteButtons=e.MessageVoteButtons;exports.MessagingProvider=e.MessagingProvider;exports.MessagingShell=e.MessagingShell;exports.buildCompactMetaLabel=e.buildCompactMetaLabel;exports.formatFileSize=e.formatFileSize;exports.formatRelativeTime=e.formatRelativeTime;exports.getFileExtensionLabel=e.getFileExtensionLabel;exports.getMessageDisplayText=e.getMessageDisplayText;exports.isLinkAttachment=e.isLinkAttachment;exports.isUuidLike=e.isUuidLike;exports.messageAttachmentGroupPositionFromStream=e.bubbleGroupPositionFromStream;exports.normalizeLanguageCode=e.normalizeLanguageCode;exports.optimizeMessagingAttachmentUrl=e.optimizeMessagingAttachmentUrl;exports.resolveConversationParticipant=e.resolveConversationParticipant;exports.resolveLinkAttachment=e.resolveLinkAttachment;exports.resolveMediaFromMessage=e.resolveMediaFromMessage;exports.resolveParticipantDisplayName=e.resolveParticipantDisplayName;exports.useComposerLocked=e.useComposerLocked;exports.useCustomMessage=e.useCustomMessage;exports.useMessageVote=e.useMessageVote;exports.useMessaging=e.useMessaging;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-BdzqW4jX.cjs");exports.ActionButton=e.ActionButton;exports.Avatar=e.Avatar;exports.ChannelEmptyState=e.ChannelEmptyState;exports.ChannelList=e.ChannelList;exports.ChannelView=e.ChannelView;exports.CustomMessageProvider=e.CustomMessageProvider;exports.FaqList=e.FaqList;exports.FaqListItem=e.FaqListItem;exports.LinkAttachment=e.LinkAttachment;exports.LockedAttachment=e.LockedAttachment;exports.MediaMessage=e.MediaMessage;exports.MessageAttachment=e.MessageAttachment;exports.MessageBubble=e.MessageBubble;exports.MessageVoteButtons=e.MessageVoteButtons;exports.MessagingProvider=e.MessagingProvider;exports.MessagingShell=e.MessagingShell;exports.buildCompactMetaLabel=e.buildCompactMetaLabel;exports.formatFileSize=e.formatFileSize;exports.formatRelativeTime=e.formatRelativeTime;exports.getFileExtensionLabel=e.getFileExtensionLabel;exports.getMessageDisplayText=e.getMessageDisplayText;exports.isLinkAttachment=e.isLinkAttachment;exports.isUuidLike=e.isUuidLike;exports.messageAttachmentGroupPositionFromStream=e.bubbleGroupPositionFromStream;exports.normalizeLanguageCode=e.normalizeLanguageCode;exports.optimizeMessagingAttachmentUrl=e.optimizeMessagingAttachmentUrl;exports.resolveConversationParticipant=e.resolveConversationParticipant;exports.resolveLinkAttachment=e.resolveLinkAttachment;exports.resolveMediaFromMessage=e.resolveMediaFromMessage;exports.resolveParticipantDisplayName=e.resolveParticipantDisplayName;exports.useComposerLocked=e.useComposerLocked;exports.useCustomMessage=e.useCustomMessage;exports.useMessageVote=e.useMessageVote;exports.useMessaging=e.useMessaging;
2
2
  //# sourceMappingURL=index.cjs.map
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { a as e, b as t, C as i, c as o, d as n, e as m, F as r, f as g, L as l, h as M, M as c, i as u, j as L, k as h, l as p, m as d, n as v, p as C, q as A, s as k, t as F, u as b, v as P, w as f, x, o as y, y as z, z as B, B as S, D as q, E as D, G as E, H as V, I as w } from "./index-BiiMPaUs.js";
1
+ import { a as e, b as t, C as i, c as o, d as n, e as m, F as r, f as g, L as l, h as M, M as c, i as u, j as L, k as h, l as p, m as d, n as v, p as C, q as A, s as k, t as F, u as b, v as P, w as f, x, o as y, y as z, z as B, B as S, D as q, E as D, G as E, H as V, I as w } from "./index-DMYxJz1w.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": "3.14.4",
3
+ "version": "3.14.5",
4
4
  "description": "React messaging components built on messaging-core for web applications",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",
@@ -40,7 +40,7 @@ export const CustomLinkPreviewList = () => {
40
40
  // block so it keeps its intrinsic height and the container scrolls — a
41
41
  // bare flex-column child would be shrunk on the column axis and its
42
42
  // fixed-height hero would spill out of the collapsed card box.
43
- <div className="messaging-link-preview-list flex min-h-0 flex-col items-stretch w-full gap-2 mb-4 overflow-y-auto overscroll-contain">
43
+ <div className="messaging-link-preview-list flex min-h-0 flex-col items-stretch w-full gap-2 overflow-y-auto overscroll-contain">
44
44
  {stateLinkPreviews.map((linkPreview) => (
45
45
  <div key={linkPreview.og_scrape_url} className="w-full shrink-0">
46
46
  <CustomLinkPreviewCard link={linkPreview} onDismiss={handleDismiss} />
@@ -79,39 +79,76 @@ const CustomMessageInputInner: React.FC = () => {
79
79
  // content height and the squeeze never reaches the preview list. Stream's
80
80
  // <MessageInput> renders its Input directly (context providers only, no
81
81
  // wrapper element), so this is a direct flex item of that row.
82
+ //
83
+ // The container itself carries no padding of its own: it used to (p-2),
84
+ // but that inset now lives on the textarea as padding instead, so the
85
+ // textarea's actual (clickable) box is as large as the container — save
86
+ // for the small margin and the send button on the right (MES-1325).
87
+ // Visually nothing moves; the container ends up exactly the size of the
88
+ // textarea + send button row it contains.
89
+ //
90
+ // Some hosts portal staged-media thumbnails (e.g. ComposerPendingMediaPortal,
91
+ // see this component's stories) straight into `.central-container` rather
92
+ // than through this React tree, bypassing the two wrappers below. The
93
+ // `[&>:not(...)]:p-2` variant restores the container's old inset for any
94
+ // such foreign direct child, without re-adding it to our own wrappers.
82
95
  <div
83
- className="central-container flex min-h-0 flex-col gap-2 min-w-0 w-full self-stretch p-2 bg-white rounded-[1.5rem] shadow-[0_4px_16px_0_rgba(0,0,0,0.08),0_1px_2px_0_rgba(0,0,0,0.04),0_0_0_1px_rgba(0,0,0,0.04)]"
96
+ className="central-container flex min-h-0 flex-col min-w-0 w-full self-stretch bg-white rounded-[1.5rem] shadow-[0_4px_16px_0_rgba(0,0,0,0.08),0_1px_2px_0_rgba(0,0,0,0.04),0_0_0_1px_rgba(0,0,0,0.04)] [&>:not(.messaging-composer-previews):not(.messaging-composer-row)]:p-2"
84
97
  data-dd-privacy="mask"
85
98
  >
86
- <QuotedMessagePreview />
87
- <CustomLinkPreviewList />
88
- <AttachmentPreviewList />
89
- <div className="flex shrink-0">
90
- <div className="w-full ml-2 mr-4 self-center leading-[0]">
91
- <TextareaComposer
92
- aria-disabled={disabled || undefined}
93
- className="w-full resize-none outline-none leading-5 placeholder:text-black/30 text-sm"
94
- // While this might usually be considered an anti-pattern, in most
95
- // cases, when a message thread is rendered, we want the input to
96
- // gain focus automatically.
97
- // eslint-disable-next-line jsx-a11y/no-autofocus
98
- autoFocus={!disabled}
99
- // Enter sends (Shift+Enter inserts a newline), so label the
100
- // on-screen keyboard's return key accordingly.
101
- enterKeyHint="send"
102
- maxRows={4}
103
- readOnly={disabled}
104
- tabIndex={disabled ? -1 : undefined}
99
+ {/* empty:hidden collapses this row (padding, gap, and all) when none of
100
+ the previews below have anything to render, so an idle composer has
101
+ no leftover top inset before the textarea row. */}
102
+ <div className="messaging-composer-previews empty:hidden flex min-h-0 flex-col gap-2 px-2 pt-2">
103
+ <QuotedMessagePreview />
104
+ <CustomLinkPreviewList />
105
+ <AttachmentPreviewList />
106
+ </div>
107
+ <div className="messaging-composer-row flex shrink-0 items-start">
108
+ <TextareaComposer
109
+ aria-disabled={disabled || undefined}
110
+ // TextareaComposer wraps the real <textarea> in its own div, so
111
+ // `containerClassName` (not `className`) is what joins the row's
112
+ // flex layout; `leading-[0]` drops the line-height space an
113
+ // inline-level parent otherwise reserves, keeping that wrapper
114
+ // exactly the textarea's height rather than stretched by the row
115
+ // (items-start above is a second guard against that same stretch).
116
+ containerClassName="min-w-0 flex-1 leading-[0]"
117
+ // bg-transparent: the container has no padding to inset it behind
118
+ // anymore, so an opaque textarea would paint over its rounded corners.
119
+ className="w-full resize-none bg-transparent py-3.5 pl-4 pr-4 outline-none leading-5 placeholder:text-black/30 text-sm"
120
+ // While this might usually be considered an anti-pattern, in most
121
+ // cases, when a message thread is rendered, we want the input to
122
+ // gain focus automatically.
123
+ // eslint-disable-next-line jsx-a11y/no-autofocus
124
+ autoFocus={!disabled}
125
+ // Enter sends (Shift+Enter inserts a newline), so label the
126
+ // on-screen keyboard's return key accordingly.
127
+ enterKeyHint="send"
128
+ maxRows={4}
129
+ readOnly={disabled}
130
+ tabIndex={disabled ? -1 : undefined}
131
+ />
132
+ {/* The container no longer has its own p-2, so this inset — and the
133
+ mt-auto that anchors the button to the bottom as the textarea
134
+ grows — lives on a wrapper instead of the button's own
135
+ className: a host-supplied SendButton can (and, per our own
136
+ stories, does) spread its own className over the one we pass in,
137
+ which would otherwise silently drop this spacing. */}
138
+ <div className="mt-auto mb-2 mr-2 shrink-0">
139
+ <SendButton
140
+ sendMessage={handleSubmit}
141
+ aria-label="Send"
142
+ // before:-inset-2 extends the button's clickable area to 48x48
143
+ // (MES-1325) via an invisible pseudo-element — clicks on it still
144
+ // land on the button itself — without growing the 32x32 circle
145
+ // `size-8`/`rounded-full`/`bg-[#121110]` visually describe.
146
+ className="str-chat__send-button relative flex justify-center items-center rounded-full size-8 bg-[#121110] disabled:bg-[#F1F0EE] disabled:text-black/20 text-white focus-ring before:absolute before:-inset-2 before:content-['']"
147
+ data-testid="send-button"
148
+ disabled={isSendDisabled}
149
+ type="button"
105
150
  />
106
151
  </div>
107
- <SendButton
108
- sendMessage={handleSubmit}
109
- aria-label="Send"
110
- className="str-chat__send-button mt-auto flex justify-center items-center flex-shrink-0 rounded-full size-8 bg-[#121110] disabled:bg-[#F1F0EE] disabled:text-black/20 text-white focus-ring"
111
- data-testid="send-button"
112
- disabled={isSendDisabled}
113
- type="button"
114
- />
115
152
  </div>
116
153
  </div>
117
154
  )