@ethora/chat-component-rn 26.5.18 → 26.5.19
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/lib/commonjs/components/MainComponents/ChatHeader.js +2 -0
- package/lib/commonjs/components/MainComponents/ChatHeader.js.map +1 -1
- package/lib/commonjs/components/MessageBubble/Message.js +3 -0
- package/lib/commonjs/components/MessageBubble/Message.js.map +1 -1
- package/lib/commonjs/components/Modals/AttachSheet/AttachSheet.js +7 -5
- package/lib/commonjs/components/Modals/AttachSheet/AttachSheet.js.map +1 -1
- package/lib/commonjs/components/Modals/ChatProfileModal/ChatProfileModal.js +4 -2
- package/lib/commonjs/components/Modals/ChatProfileModal/ChatProfileModal.js.map +1 -1
- package/lib/commonjs/components/styled/SendInput.js +11 -8
- package/lib/commonjs/components/styled/SendInput.js.map +1 -1
- package/lib/commonjs/helpers/getElementFont.js +29 -0
- package/lib/commonjs/helpers/getElementFont.js.map +1 -0
- package/lib/commonjs/hooks/useSendMessage.js +6 -6
- package/lib/commonjs/networking/outboundQueue.js +1 -1
- package/lib/module/components/MainComponents/ChatHeader.js +2 -0
- package/lib/module/components/MainComponents/ChatHeader.js.map +1 -1
- package/lib/module/components/MessageBubble/Message.js +3 -0
- package/lib/module/components/MessageBubble/Message.js.map +1 -1
- package/lib/module/components/Modals/AttachSheet/AttachSheet.js +7 -5
- package/lib/module/components/Modals/AttachSheet/AttachSheet.js.map +1 -1
- package/lib/module/components/Modals/ChatProfileModal/ChatProfileModal.js +4 -2
- package/lib/module/components/Modals/ChatProfileModal/ChatProfileModal.js.map +1 -1
- package/lib/module/components/styled/SendInput.js +11 -8
- package/lib/module/components/styled/SendInput.js.map +1 -1
- package/lib/module/helpers/getElementFont.js +24 -0
- package/lib/module/helpers/getElementFont.js.map +1 -0
- package/lib/module/hooks/useSendMessage.js +6 -6
- package/lib/module/networking/outboundQueue.js +1 -1
- package/lib/typescript/components/MainComponents/ChatHeader.d.ts.map +1 -1
- package/lib/typescript/components/MessageBubble/Message.d.ts.map +1 -1
- package/lib/typescript/components/Modals/AttachSheet/AttachSheet.d.ts +3 -0
- package/lib/typescript/components/Modals/AttachSheet/AttachSheet.d.ts.map +1 -1
- package/lib/typescript/components/Modals/ChatProfileModal/ChatProfileModal.d.ts.map +1 -1
- package/lib/typescript/components/styled/SendInput.d.ts.map +1 -1
- package/lib/typescript/helpers/getElementFont.d.ts +13 -0
- package/lib/typescript/helpers/getElementFont.d.ts.map +1 -0
- package/lib/typescript/networking/outboundQueue.d.ts +2 -2
- package/lib/typescript/types/types.d.ts +47 -1
- package/lib/typescript/types/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/MainComponents/ChatHeader.tsx +6 -1
- package/src/components/MessageBubble/Message.tsx +7 -1
- package/src/components/Modals/AttachSheet/AttachSheet.tsx +32 -4
- package/src/components/Modals/ChatProfileModal/ChatProfileModal.tsx +10 -2
- package/src/components/styled/SendInput.tsx +14 -8
- package/src/helpers/getElementFont.ts +25 -0
- package/src/hooks/useSendMessage.tsx +6 -6
- package/src/networking/outboundQueue.ts +2 -2
- package/src/types/types.ts +49 -1
package/src/types/types.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ViewStyle, ImageSourcePropType } from 'react-native';
|
|
1
|
+
import type { ViewStyle, TextStyle, ImageSourcePropType } from 'react-native';
|
|
2
2
|
import type { Iso639_1Codes } from './models/language.model';
|
|
3
3
|
import type { IMessage, IReply } from './models/message.model';
|
|
4
4
|
import type { RoomMember } from './models/room.model';
|
|
@@ -260,6 +260,52 @@ export interface TypographyConfig {
|
|
|
260
260
|
};
|
|
261
261
|
/** Fonts for the SDK to load with expo-font before applying `fontFamily`. */
|
|
262
262
|
fonts?: RNFontSource[];
|
|
263
|
+
/** Per-element size / weight overrides. Each entry replaces only the
|
|
264
|
+
* properties it sets; everything else keeps the built-in style. */
|
|
265
|
+
elements?: {
|
|
266
|
+
/** Message body text inside bubbles (default 16). */
|
|
267
|
+
messageText?: ElementFontStyle;
|
|
268
|
+
/** Sender's name above incoming bubbles (default 14 / 500). */
|
|
269
|
+
senderName?: ElementFontStyle;
|
|
270
|
+
/** Room title in the chat header (default 16 / 600). */
|
|
271
|
+
chatHeaderTitle?: ElementFontStyle;
|
|
272
|
+
/** Typed text AND the "Type message" placeholder (default 16).
|
|
273
|
+
* Pair larger sizes with `inputLayout.minHeight` so glyphs aren't
|
|
274
|
+
* clipped vertically. */
|
|
275
|
+
input?: ElementFontStyle;
|
|
276
|
+
/** Room name on the chat-profile screen (default 24 / 400). */
|
|
277
|
+
chatProfileTitle?: ElementFontStyle;
|
|
278
|
+
/** Member names in the chat-profile list (default 16 / 600). */
|
|
279
|
+
chatProfileMemberName?: ElementFontStyle;
|
|
280
|
+
/** "ATTACH" caption of the attachment sheet (default 13 / 600). */
|
|
281
|
+
attachSheetTitle?: ElementFontStyle;
|
|
282
|
+
/** Row labels in the attachment sheet — "Take photo", "Photo or
|
|
283
|
+
* video", "Document" (default 16 / 500). */
|
|
284
|
+
attachSheetRowLabel?: ElementFontStyle;
|
|
285
|
+
/** Row hints under each label (default 12). */
|
|
286
|
+
attachSheetRowHint?: ElementFontStyle;
|
|
287
|
+
/** "Cancel" button of the attachment sheet (default 16 / 600). */
|
|
288
|
+
attachSheetCancel?: ElementFontStyle;
|
|
289
|
+
};
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
/** Size/weight override for one chat-UI text element. */
|
|
293
|
+
export interface ElementFontStyle {
|
|
294
|
+
fontSize?: number;
|
|
295
|
+
fontWeight?: TextStyle['fontWeight'];
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
/**
|
|
299
|
+
* Geometry of the message-input row. Raise `minHeight` together with
|
|
300
|
+
* `typography.elements.input.fontSize` so larger text isn't clipped.
|
|
301
|
+
*/
|
|
302
|
+
export interface InputLayoutConfig {
|
|
303
|
+
/** Min height of the text field, also its single-line height (default 40). */
|
|
304
|
+
minHeight?: number;
|
|
305
|
+
/** Height at which the field stops growing and starts scrolling (default 120). */
|
|
306
|
+
maxHeight?: number;
|
|
307
|
+
/** Diameter of the round send / mic button (default 40). */
|
|
308
|
+
sendButtonSize?: number;
|
|
263
309
|
}
|
|
264
310
|
|
|
265
311
|
export interface IConfig {
|
|
@@ -290,6 +336,8 @@ export interface IConfig {
|
|
|
290
336
|
};
|
|
291
337
|
/** Configurable font family / weights for the chat UI. See TypographyConfig. */
|
|
292
338
|
typography?: TypographyConfig;
|
|
339
|
+
/** Input-row geometry (field height, send-button size). See InputLayoutConfig. */
|
|
340
|
+
inputLayout?: InputLayoutConfig;
|
|
293
341
|
messageColor?: {
|
|
294
342
|
backgroundMessage: string;
|
|
295
343
|
backgroundMessageUser: string;
|