@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/{Card-F4L-jBFd.cjs → Card-Ce3PVNyH.cjs} +2 -2
- package/dist/{Card-F4L-jBFd.cjs.map → Card-Ce3PVNyH.cjs.map} +1 -1
- package/dist/{Card-CZq9t0G_.js → Card-Dy9dBg7f.js} +2 -2
- package/dist/{Card-CZq9t0G_.js.map → Card-Dy9dBg7f.js.map} +1 -1
- package/dist/{index-BZNP-Xf_.cjs → index-BdzqW4jX.cjs} +2 -2
- package/dist/{index-BZNP-Xf_.cjs.map → index-BdzqW4jX.cjs.map} +1 -1
- package/dist/{index-BiiMPaUs.js → index-DMYxJz1w.js} +182 -166
- package/dist/{index-BiiMPaUs.js.map → index-DMYxJz1w.js.map} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/src/components/CustomLinkPreviewList/index.tsx +1 -1
- package/src/components/CustomMessageInput/index.tsx +65 -28
package/dist/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-
|
|
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-
|
|
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
|
@@ -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
|
|
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
|
|
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
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
<div className="flex
|
|
90
|
-
<
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
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
|
)
|