@ethora/chat-component 26.4.4 → 26.5.1
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/README.md +7 -4
- package/dist/assets/icons.d.ts +4 -12
- package/dist/assets/illustrations/EmptyChatIllustration.d.ts +7 -0
- package/dist/assets/illustrations/NoMessagesIllustration.d.ts +7 -0
- package/dist/components/MainComponents/FallbackScreen.d.ts +12 -0
- package/dist/helpers/applyTypography.d.ts +4 -0
- package/dist/helpers/hiddenRooms.d.ts +9 -0
- package/dist/helpers/resolveIconColor.d.ts +23 -0
- package/dist/hooks/useTypography.d.ts +8 -0
- package/dist/hooks/useUnreadMessagesCounter.d.ts +9 -0
- package/dist/main.css +1 -1
- package/dist/main.d.ts +3 -0
- package/dist/main.js +15640 -15430
- package/dist/main.js.map +1 -1
- package/dist/types/models/config.model.d.ts +94 -0
- package/package.json +1 -3
|
@@ -13,6 +13,66 @@ export interface FBConfig {
|
|
|
13
13
|
messagingSenderId: string;
|
|
14
14
|
appId: string;
|
|
15
15
|
}
|
|
16
|
+
/**
|
|
17
|
+
* A single self-hosted font file to register via an injected `@font-face`
|
|
18
|
+
* rule. Use this for fonts that are not on Google Fonts — e.g. the Ukrainian
|
|
19
|
+
* government "e-Ukraine" family distributed from thedigital.gov.ua. Host the
|
|
20
|
+
* `.woff2`/`.ttf` somewhere reachable and point `src` at it.
|
|
21
|
+
*/
|
|
22
|
+
export interface FontFaceSource {
|
|
23
|
+
/** The `font-family` name this file provides, e.g. "e-Ukraine". */
|
|
24
|
+
family: string;
|
|
25
|
+
/** Absolute or relative URL to the font file (`.woff2`, `.woff`, `.ttf`, `.otf`). */
|
|
26
|
+
src: string;
|
|
27
|
+
/** Numeric weight this file covers (e.g. 400, 500, 700). Default 400. */
|
|
28
|
+
weight?: number | string;
|
|
29
|
+
/** Style this file covers. Default "normal". */
|
|
30
|
+
style?: 'normal' | 'italic';
|
|
31
|
+
/** `font-display` strategy. Default "swap" to avoid invisible text. */
|
|
32
|
+
display?: 'auto' | 'block' | 'swap' | 'fallback' | 'optional';
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Font configuration for the chat UI. When omitted, the component keeps its
|
|
36
|
+
* default system font stack, so existing integrations are unaffected.
|
|
37
|
+
*
|
|
38
|
+
* Two loading paths are supported and can be combined:
|
|
39
|
+
* - `googleFontsUrl` / `googleFontsFamily` → a Google Fonts stylesheet is
|
|
40
|
+
* injected at runtime (no host setup needed).
|
|
41
|
+
* - `fontFaces` → `@font-face` rules are injected for self-hosted files
|
|
42
|
+
* (e.g. e-Ukraine).
|
|
43
|
+
*
|
|
44
|
+
* `fontFamily` is the family actually applied to the chat (via the
|
|
45
|
+
* `--ethora-font-family` CSS variable). It should match a family you loaded
|
|
46
|
+
* above, optionally followed by fallbacks, e.g. "e-Ukraine, Inter, sans-serif".
|
|
47
|
+
*/
|
|
48
|
+
export interface TypographyConfig {
|
|
49
|
+
/** Family applied to the chat UI, optionally with fallbacks. */
|
|
50
|
+
fontFamily?: string;
|
|
51
|
+
/**
|
|
52
|
+
* Base font size for chat text. A number is treated as pixels (e.g. `18`),
|
|
53
|
+
* a string is used verbatim if it carries a unit (`"1.1rem"`, `"18px"`) or
|
|
54
|
+
* parsed as pixels otherwise. Published as the `--ethora-font-size` CSS
|
|
55
|
+
* variable (plus derived `-xs` / `-sm` / `-lg` variants) which the chat's
|
|
56
|
+
* text styles read, so message text, sender names, timestamps, inputs,
|
|
57
|
+
* room names and badges all scale proportionally. Default 16px.
|
|
58
|
+
*/
|
|
59
|
+
fontSize?: number | string;
|
|
60
|
+
/** A full Google Fonts stylesheet URL, e.g.
|
|
61
|
+
* "https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap". */
|
|
62
|
+
googleFontsUrl?: string;
|
|
63
|
+
/** Convenience: a Google family name (e.g. "Inter"); a stylesheet URL is
|
|
64
|
+
* built for the weights below. Ignored if `googleFontsUrl` is set. */
|
|
65
|
+
googleFontsFamily?: string;
|
|
66
|
+
/** Self-hosted `@font-face` sources (e.g. e-Ukraine .woff2 files). */
|
|
67
|
+
fontFaces?: FontFaceSource[];
|
|
68
|
+
/** Weight tokens used by the chat; also drives the generated Google URL. */
|
|
69
|
+
weights?: {
|
|
70
|
+
regular?: number;
|
|
71
|
+
medium?: number;
|
|
72
|
+
semibold?: number;
|
|
73
|
+
bold?: number;
|
|
74
|
+
};
|
|
75
|
+
}
|
|
16
76
|
export interface IConfig {
|
|
17
77
|
appId?: string;
|
|
18
78
|
disableHeader?: boolean;
|
|
@@ -20,6 +80,40 @@ export interface IConfig {
|
|
|
20
80
|
colors?: {
|
|
21
81
|
primary: string;
|
|
22
82
|
secondary: string;
|
|
83
|
+
/**
|
|
84
|
+
* Default colour applied to the chat's icons (attach, microphone, send,
|
|
85
|
+
* file, empty-state illustrations, etc.). When omitted, icons fall back
|
|
86
|
+
* to `primary`. Set to a specific colour to decouple icons from the
|
|
87
|
+
* primary theme colour.
|
|
88
|
+
*/
|
|
89
|
+
icons?: string;
|
|
90
|
+
};
|
|
91
|
+
/** Configurable font family / size / weights for the chat UI. See TypographyConfig. */
|
|
92
|
+
typography?: TypographyConfig;
|
|
93
|
+
/**
|
|
94
|
+
* Custom screens shown instead of the built-in Ethora UI when the chat
|
|
95
|
+
* cannot be displayed. Each value may be a plain string (rendered as
|
|
96
|
+
* centered text) or any React node. When a value is omitted, the default
|
|
97
|
+
* built-in UI for that state (e.g. the Ethora login form) is kept.
|
|
98
|
+
*/
|
|
99
|
+
fallbackScreens?: {
|
|
100
|
+
/** Replaces the default Ethora login form when there is no user session. */
|
|
101
|
+
noUser?: React.ReactNode;
|
|
102
|
+
/** Shown when the XMPP connection is lost / cannot be established. */
|
|
103
|
+
noConnection?: React.ReactNode;
|
|
104
|
+
/** Shown when the user has no chat room to display. */
|
|
105
|
+
noRoom?: React.ReactNode;
|
|
106
|
+
};
|
|
107
|
+
/**
|
|
108
|
+
* Hide specific rooms from the room list and unread counters without
|
|
109
|
+
* leaving them. Useful to suppress auto-created rooms such as the default
|
|
110
|
+
* "Main chat" created with a new Ethora app.
|
|
111
|
+
*/
|
|
112
|
+
hiddenRooms?: {
|
|
113
|
+
/** Case-insensitive exact room titles to hide, e.g. ["Main chat"]. */
|
|
114
|
+
titles?: string[];
|
|
115
|
+
/** Full room JIDs to hide. */
|
|
116
|
+
jids?: string[];
|
|
23
117
|
};
|
|
24
118
|
googleLogin?: {
|
|
25
119
|
enabled: boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ethora/chat-component",
|
|
3
|
-
"version": "26.
|
|
3
|
+
"version": "26.5.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/main.js",
|
|
6
6
|
"types": "dist/main.d.ts",
|
|
@@ -35,7 +35,6 @@
|
|
|
35
35
|
"axios": "^1.10.0",
|
|
36
36
|
"emoji-mart": "^5.6.0",
|
|
37
37
|
"firebase": "^11.9.1",
|
|
38
|
-
"i": "^0.3.7",
|
|
39
38
|
"js-sha256": "^0.11.1",
|
|
40
39
|
"ltx": "^3.1.2",
|
|
41
40
|
"react": "^18.3.1",
|
|
@@ -48,7 +47,6 @@
|
|
|
48
47
|
"redux": "^5.0.1",
|
|
49
48
|
"redux-persist": "^6.0.0",
|
|
50
49
|
"redux-persist-transform-encrypt": "^5.1.1",
|
|
51
|
-
"redux-saga": "^1.3.0",
|
|
52
50
|
"rehype-raw": "^7.0.0",
|
|
53
51
|
"remark-gfm": "^4.0.1",
|
|
54
52
|
"styled-components": "^6.1.19",
|