@chat-leo/chatleo 0.0.0-stage → 2.0.2
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/LICENSE +21 -0
- package/dist/chatleo/chatleo.esm.js +1 -0
- package/dist/chatleo/index.esm.js +1 -0
- package/dist/chatleo/p-43ada232.entry.js +1 -0
- package/dist/chatleo/p-4485e141.entry.js +1 -0
- package/dist/chatleo/p-BnCPdbII.js +1 -0
- package/dist/chatleo/p-C-l90Wre.js +1 -0
- package/dist/chatleo/p-DQuL1Twl.js +1 -0
- package/dist/chatleo/p-DmL518NK.js +3 -0
- package/dist/chatleo/p-aed60255.entry.js +1 -0
- package/dist/cjs/app-globals-V2Kpy_OQ.js +5 -0
- package/dist/cjs/chatleo-avatar_13.cjs.entry.js +2986 -0
- package/dist/cjs/chatleo-call-adapter-B2OfC0VZ.js +35 -0
- package/dist/cjs/chatleo-chat-input.cjs.entry.js +67 -0
- package/dist/cjs/chatleo.cjs.js +25 -0
- package/dist/cjs/index-DkSDLR0y.js +56 -0
- package/dist/cjs/index-Dxw4YCA_.js +1741 -0
- package/dist/cjs/index.cjs.js +7 -0
- package/dist/cjs/loader.cjs.js +13 -0
- package/dist/cjs/my-component.cjs.entry.js +33 -0
- package/dist/collection/__mocks__/stencil-core.js +26 -0
- package/dist/collection/collection-manifest.json +27 -0
- package/dist/collection/components/chatleo-avatar/chatleo-avatar.css +40 -0
- package/dist/collection/components/chatleo-avatar/chatleo-avatar.js +116 -0
- package/dist/collection/components/chatleo-chat/chatleo-chat.css +108 -0
- package/dist/collection/components/chatleo-chat/chatleo-chat.js +459 -0
- package/dist/collection/components/chatleo-chat-header/chatleo-chat-header.css +22 -0
- package/dist/collection/components/chatleo-chat-header/chatleo-chat-header.js +105 -0
- package/dist/collection/components/chatleo-chat-input/chatleo-chat-input.css +84 -0
- package/dist/collection/components/chatleo-chat-input/chatleo-chat-input.js +141 -0
- package/dist/collection/components/chatleo-chat-message/chatleo-chat-message.css +149 -0
- package/dist/collection/components/chatleo-chat-message/chatleo-chat-message.js +259 -0
- package/dist/collection/components/chatleo-component/chatleo-component.css +271 -0
- package/dist/collection/components/chatleo-component/chatleo-component.js +1366 -0
- package/dist/collection/components/chatleo-new-message-selector/chatleo-new-message-selector.css +96 -0
- package/dist/collection/components/chatleo-new-message-selector/chatleo-new-message-selector.js +231 -0
- package/dist/collection/components/chatleo-rich-input/chatleo-rich-input.css +352 -0
- package/dist/collection/components/chatleo-rich-input/chatleo-rich-input.js +976 -0
- package/dist/collection/components/chatleo-rich-message-renderer/chatleo-rich-message-renderer.css +169 -0
- package/dist/collection/components/chatleo-rich-message-renderer/chatleo-rich-message-renderer.js +400 -0
- package/dist/collection/components/chatleo-room-list/chatleo-room-list.css +111 -0
- package/dist/collection/components/chatleo-room-list/chatleo-room-list.js +180 -0
- package/dist/collection/components/chatleo-room-tile-component/chatleo-room-tile-component.css +110 -0
- package/dist/collection/components/chatleo-room-tile-component/chatleo-room-tile-component.js +241 -0
- package/dist/collection/components/chatleo-room-view/chatleo-room-view.css +93 -0
- package/dist/collection/components/chatleo-room-view/chatleo-room-view.js +593 -0
- package/dist/collection/components/chatleo-tray-component/chatleo-tray-component.css +284 -0
- package/dist/collection/components/chatleo-tray-component/chatleo-tray-component.js +391 -0
- package/dist/collection/components/chatleo-user-tile/chatleo-user-tile.css +56 -0
- package/dist/collection/components/chatleo-user-tile/chatleo-user-tile.js +149 -0
- package/dist/collection/components/my-component/my-component.css +4 -0
- package/dist/collection/components/my-component/my-component.js +95 -0
- package/dist/collection/index.js +10 -0
- package/dist/collection/utils/call-entry.js +34 -0
- package/dist/collection/utils/delivery.js +7 -0
- package/dist/collection/utils/utils.js +51 -0
- package/dist/components/chatleo-avatar.d.ts +11 -0
- package/dist/components/chatleo-avatar.js +1 -0
- package/dist/components/chatleo-chat-header.d.ts +11 -0
- package/dist/components/chatleo-chat-header.js +1 -0
- package/dist/components/chatleo-chat-input.d.ts +11 -0
- package/dist/components/chatleo-chat-input.js +1 -0
- package/dist/components/chatleo-chat-message.d.ts +11 -0
- package/dist/components/chatleo-chat-message.js +1 -0
- package/dist/components/chatleo-chat.d.ts +11 -0
- package/dist/components/chatleo-chat.js +1 -0
- package/dist/components/chatleo-component.d.ts +11 -0
- package/dist/components/chatleo-component.js +1 -0
- package/dist/components/chatleo-new-message-selector.d.ts +11 -0
- package/dist/components/chatleo-new-message-selector.js +1 -0
- package/dist/components/chatleo-rich-input.d.ts +11 -0
- package/dist/components/chatleo-rich-input.js +1 -0
- package/dist/components/chatleo-rich-message-renderer.d.ts +11 -0
- package/dist/components/chatleo-rich-message-renderer.js +1 -0
- package/dist/components/chatleo-room-list.d.ts +11 -0
- package/dist/components/chatleo-room-list.js +1 -0
- package/dist/components/chatleo-room-tile-component.d.ts +11 -0
- package/dist/components/chatleo-room-tile-component.js +1 -0
- package/dist/components/chatleo-room-view.d.ts +11 -0
- package/dist/components/chatleo-room-view.js +1 -0
- package/dist/components/chatleo-tray-component.d.ts +11 -0
- package/dist/components/chatleo-tray-component.js +1 -0
- package/dist/components/chatleo-user-tile.d.ts +11 -0
- package/dist/components/chatleo-user-tile.js +1 -0
- package/dist/components/index.d.ts +35 -0
- package/dist/components/index.js +1 -0
- package/dist/components/my-component.d.ts +11 -0
- package/dist/components/my-component.js +1 -0
- package/dist/components/p-8kvQ-Uh-.js +1 -0
- package/dist/components/p-B7cdqAgv.js +1 -0
- package/dist/components/p-BdiOcOYZ.js +1 -0
- package/dist/components/p-BlbDSb7D.js +1 -0
- package/dist/components/p-BnCPdbII.js +1 -0
- package/dist/components/p-C-v19aUJ.js +1 -0
- package/dist/components/p-C1mF0s8g.js +1 -0
- package/dist/components/p-CRtBdzP3.js +1 -0
- package/dist/components/p-CfayCm9O.js +1 -0
- package/dist/components/p-DGjAxoQy.js +1 -0
- package/dist/components/p-Exj_2-yI.js +1 -0
- package/dist/components/p-XlwGxsqT.js +1 -0
- package/dist/components/p-fjMaTJam.js +1 -0
- package/dist/components/p-xt4kzz3B.js +1 -0
- package/dist/esm/app-globals-DQuL1Twl.js +3 -0
- package/dist/esm/chatleo-avatar_13.entry.js +2972 -0
- package/dist/esm/chatleo-call-adapter-BnCPdbII.js +33 -0
- package/dist/esm/chatleo-chat-input.entry.js +65 -0
- package/dist/esm/chatleo.js +21 -0
- package/dist/esm/index-C-l90Wre.js +53 -0
- package/dist/esm/index-DmL518NK.js +1733 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/loader.js +11 -0
- package/dist/esm/my-component.entry.js +31 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/types/__mocks__/stencil-core.d.ts +24 -0
- package/dist/types/components/chatleo-avatar/chatleo-avatar.d.ts +27 -0
- package/dist/types/components/chatleo-chat/chatleo-chat.d.ts +75 -0
- package/dist/types/components/chatleo-chat-header/chatleo-chat-header.d.ts +27 -0
- package/dist/types/components/chatleo-chat-input/chatleo-chat-input.d.ts +31 -0
- package/dist/types/components/chatleo-chat-message/chatleo-chat-message.d.ts +22 -0
- package/dist/types/components/chatleo-component/chatleo-component.d.ts +278 -0
- package/dist/types/components/chatleo-new-message-selector/chatleo-new-message-selector.d.ts +68 -0
- package/dist/types/components/chatleo-rich-input/chatleo-rich-input.d.ts +216 -0
- package/dist/types/components/chatleo-rich-message-renderer/chatleo-rich-message-renderer.d.ts +77 -0
- package/dist/types/components/chatleo-room-list/chatleo-room-list.d.ts +52 -0
- package/dist/types/components/chatleo-room-tile-component/chatleo-room-tile-component.d.ts +59 -0
- package/dist/types/components/chatleo-room-view/chatleo-room-view.d.ts +91 -0
- package/dist/types/components/chatleo-tray-component/chatleo-tray-component.d.ts +112 -0
- package/dist/types/components/chatleo-user-tile/chatleo-user-tile.d.ts +36 -0
- package/dist/types/components/my-component/my-component.d.ts +16 -0
- package/dist/types/components.d.ts +1593 -0
- package/dist/types/index.d.ts +12 -0
- package/dist/types/stencil-public-runtime.d.ts +1879 -0
- package/dist/types/utils/call-entry.d.ts +9 -0
- package/dist/types/utils/delivery.d.ts +7 -0
- package/dist/types/utils/utils.d.ts +24 -0
- package/loader/cdn.js +1 -0
- package/loader/index.cjs.js +1 -0
- package/loader/index.d.ts +24 -0
- package/loader/index.es2017.js +1 -0
- package/loader/index.js +2 -0
- package/package.json +70 -3
- package/readme.md +111 -0
- package/README.md +0 -3
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
/* Component-specific variables */
|
|
3
|
+
--hover-color: #f5f7fa;
|
|
4
|
+
--user-tile-border: 1px solid var(--border-color);
|
|
5
|
+
--font-size-name: 16px;
|
|
6
|
+
--font-size-status: 14px;
|
|
7
|
+
--font-weight-name: 600;
|
|
8
|
+
--tile-margin: 2px;
|
|
9
|
+
display: block;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.user-tile {
|
|
13
|
+
display: flex;
|
|
14
|
+
align-items: center;
|
|
15
|
+
cursor: pointer;
|
|
16
|
+
transition: background-color var(--transition-duration) ease;
|
|
17
|
+
border-bottom: var(--user-tile-border);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.user-tile:hover {
|
|
21
|
+
background-color: var(--hover-color);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.user-content {
|
|
25
|
+
flex: 1;
|
|
26
|
+
min-width: 0;
|
|
27
|
+
margin-left: 8px;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.user-header {
|
|
31
|
+
margin-bottom: var(--tile-margin);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.user-name {
|
|
35
|
+
font-size: var(--font-size-name);
|
|
36
|
+
font-weight: var(--font-weight-name);
|
|
37
|
+
margin: 0;
|
|
38
|
+
color: var(--text-primary);
|
|
39
|
+
overflow: hidden;
|
|
40
|
+
text-overflow: ellipsis;
|
|
41
|
+
white-space: nowrap;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.user-footer {
|
|
45
|
+
display: flex;
|
|
46
|
+
align-items: center;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.user-status {
|
|
50
|
+
font-size: var(--font-size-status);
|
|
51
|
+
color: var(--text-secondary);
|
|
52
|
+
margin: 0;
|
|
53
|
+
overflow: hidden;
|
|
54
|
+
text-overflow: ellipsis;
|
|
55
|
+
white-space: nowrap;
|
|
56
|
+
}
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
// filepath: /Users/danny/workspace/chatleo/chatleo-web/packages/chatleo/src/components/chatleo-user-tile/chatleo-user-tile.tsx
|
|
2
|
+
import { h } from "@stencil/core";
|
|
3
|
+
/**
|
|
4
|
+
* @component ChatleoUserTile
|
|
5
|
+
* @description This component displays a tile for a single user, showing their avatar, name, and online status. It is typically used in a list of users.
|
|
6
|
+
* @property {UserProfile} profile - The `UserProfile` object for the user to be displayed. This includes the user's name and avatar URL.
|
|
7
|
+
* @property {boolean} isOnline - A boolean indicating whether the user is currently online.
|
|
8
|
+
* @property {string} lastSeen - A string indicating when the user was last seen online. This is displayed if the user is not currently online.
|
|
9
|
+
* @fires userClicked - This event is emitted when the user tile is clicked. The event detail contains the `UserProfile` of the clicked user.
|
|
10
|
+
*/
|
|
11
|
+
export class ChatleoUserTile {
|
|
12
|
+
/**
|
|
13
|
+
* The `UserProfile` object for the user to be displayed. This includes the user's name and avatar URL.
|
|
14
|
+
*/
|
|
15
|
+
profile;
|
|
16
|
+
/**
|
|
17
|
+
* A boolean indicating whether the user is currently online.
|
|
18
|
+
*/
|
|
19
|
+
isOnline = false;
|
|
20
|
+
/**
|
|
21
|
+
* A string indicating when the user was last seen online. This is displayed if the user is not currently online.
|
|
22
|
+
*/
|
|
23
|
+
lastSeen;
|
|
24
|
+
userClicked;
|
|
25
|
+
/**
|
|
26
|
+
* @function onClick
|
|
27
|
+
* @description This method is called when the user tile is clicked. It emits the `userClicked` event with the user's profile.
|
|
28
|
+
*/
|
|
29
|
+
onClick() {
|
|
30
|
+
if (this.profile) {
|
|
31
|
+
this.userClicked.emit(this.profile);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* @function render
|
|
36
|
+
* @description The render method for the `ChatleoUserTile` component. It constructs the UI for the user tile, including the avatar, name, and status.
|
|
37
|
+
* @returns {any} A VNode representing the component's UI.
|
|
38
|
+
*/
|
|
39
|
+
render() {
|
|
40
|
+
const p = this.profile;
|
|
41
|
+
const avatarUrl = (p?.profile_picture_url);
|
|
42
|
+
const userName = p?.display_name ?? 'Unknown user';
|
|
43
|
+
return (h("div", { key: 'a1e0334d626b162edba9e5bcb93472ab1d75ea8d', class: "user-tile", onClick: () => this.onClick() }, h("chatleo-avatar", { key: '3eed64212482962fe151dbcdb275d2396d91a39f', name: userName, url: avatarUrl, isOnline: this.isOnline }), h("div", { key: '9438ec481cd480b576ef18e95a9fc30003b200ea', class: "user-content" }, h("div", { key: '62a9cd55c2e1061c28934f419addbd3ac28b6dca', class: "user-header" }, h("h3", { key: 'e8f36bfd9e972193fc066b0a0de8a599180104a9', class: "user-name" }, userName)), h("div", { key: 'dbffef93dbe1aff1b85a73669d020df94159b014', class: "user-footer" }, h("p", { key: 'ee7c35805b645f520b8ef9913c282e0651770684', class: "user-status" }, this.isOnline ? 'Online' : this.lastSeen ? `Zuletzt online ${this.lastSeen}` : '')))));
|
|
44
|
+
}
|
|
45
|
+
static get is() { return "chatleo-user-tile"; }
|
|
46
|
+
static get encapsulation() { return "shadow"; }
|
|
47
|
+
static get originalStyleUrls() {
|
|
48
|
+
return {
|
|
49
|
+
"$": ["chatleo-user-tile.css"]
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
static get styleUrls() {
|
|
53
|
+
return {
|
|
54
|
+
"$": ["chatleo-user-tile.css"]
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
static get properties() {
|
|
58
|
+
return {
|
|
59
|
+
"profile": {
|
|
60
|
+
"type": "unknown",
|
|
61
|
+
"mutable": false,
|
|
62
|
+
"complexType": {
|
|
63
|
+
"original": "UserProfile",
|
|
64
|
+
"resolved": "{ id: string; display_name: string; profile_picture_url: string; }",
|
|
65
|
+
"references": {
|
|
66
|
+
"UserProfile": {
|
|
67
|
+
"location": "import",
|
|
68
|
+
"path": "@chat-leo/chatleolib",
|
|
69
|
+
"id": "../chatleolib/dist/index.d.ts::UserProfile",
|
|
70
|
+
"referenceLocation": "UserProfile"
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
"required": false,
|
|
75
|
+
"optional": true,
|
|
76
|
+
"docs": {
|
|
77
|
+
"tags": [],
|
|
78
|
+
"text": "The `UserProfile` object for the user to be displayed. This includes the user's name and avatar URL."
|
|
79
|
+
},
|
|
80
|
+
"getter": false,
|
|
81
|
+
"setter": false
|
|
82
|
+
},
|
|
83
|
+
"isOnline": {
|
|
84
|
+
"type": "boolean",
|
|
85
|
+
"mutable": false,
|
|
86
|
+
"complexType": {
|
|
87
|
+
"original": "boolean",
|
|
88
|
+
"resolved": "boolean",
|
|
89
|
+
"references": {}
|
|
90
|
+
},
|
|
91
|
+
"required": false,
|
|
92
|
+
"optional": false,
|
|
93
|
+
"docs": {
|
|
94
|
+
"tags": [],
|
|
95
|
+
"text": "A boolean indicating whether the user is currently online."
|
|
96
|
+
},
|
|
97
|
+
"getter": false,
|
|
98
|
+
"setter": false,
|
|
99
|
+
"reflect": false,
|
|
100
|
+
"attribute": "is-online",
|
|
101
|
+
"defaultValue": "false"
|
|
102
|
+
},
|
|
103
|
+
"lastSeen": {
|
|
104
|
+
"type": "string",
|
|
105
|
+
"mutable": false,
|
|
106
|
+
"complexType": {
|
|
107
|
+
"original": "string",
|
|
108
|
+
"resolved": "string",
|
|
109
|
+
"references": {}
|
|
110
|
+
},
|
|
111
|
+
"required": false,
|
|
112
|
+
"optional": true,
|
|
113
|
+
"docs": {
|
|
114
|
+
"tags": [],
|
|
115
|
+
"text": "A string indicating when the user was last seen online. This is displayed if the user is not currently online."
|
|
116
|
+
},
|
|
117
|
+
"getter": false,
|
|
118
|
+
"setter": false,
|
|
119
|
+
"reflect": false,
|
|
120
|
+
"attribute": "last-seen"
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
static get events() {
|
|
125
|
+
return [{
|
|
126
|
+
"method": "userClicked",
|
|
127
|
+
"name": "userClicked",
|
|
128
|
+
"bubbles": true,
|
|
129
|
+
"cancelable": true,
|
|
130
|
+
"composed": true,
|
|
131
|
+
"docs": {
|
|
132
|
+
"tags": [],
|
|
133
|
+
"text": ""
|
|
134
|
+
},
|
|
135
|
+
"complexType": {
|
|
136
|
+
"original": "UserProfile",
|
|
137
|
+
"resolved": "{ id: string; display_name: string; profile_picture_url: string; }",
|
|
138
|
+
"references": {
|
|
139
|
+
"UserProfile": {
|
|
140
|
+
"location": "import",
|
|
141
|
+
"path": "@chat-leo/chatleolib",
|
|
142
|
+
"id": "../chatleolib/dist/index.d.ts::UserProfile",
|
|
143
|
+
"referenceLocation": "UserProfile"
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}];
|
|
148
|
+
}
|
|
149
|
+
}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { h } from "@stencil/core";
|
|
2
|
+
import { format } from "../../utils/utils";
|
|
3
|
+
export class MyComponent {
|
|
4
|
+
/**
|
|
5
|
+
* The first name
|
|
6
|
+
*/
|
|
7
|
+
first;
|
|
8
|
+
/**
|
|
9
|
+
* The middle name
|
|
10
|
+
*/
|
|
11
|
+
middle;
|
|
12
|
+
/**
|
|
13
|
+
* The last name
|
|
14
|
+
*/
|
|
15
|
+
last;
|
|
16
|
+
getText() {
|
|
17
|
+
return format(this.first, this.middle, this.last);
|
|
18
|
+
}
|
|
19
|
+
render() {
|
|
20
|
+
return h("div", { key: '190c7c8bc8333f9d1b4934fd633f7cf9820c7523' }, "Hello, World! I'm ", this.getText());
|
|
21
|
+
}
|
|
22
|
+
static get is() { return "my-component"; }
|
|
23
|
+
static get encapsulation() { return "shadow"; }
|
|
24
|
+
static get originalStyleUrls() {
|
|
25
|
+
return {
|
|
26
|
+
"$": ["my-component.css"]
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
static get styleUrls() {
|
|
30
|
+
return {
|
|
31
|
+
"$": ["my-component.css"]
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
static get properties() {
|
|
35
|
+
return {
|
|
36
|
+
"first": {
|
|
37
|
+
"type": "string",
|
|
38
|
+
"mutable": false,
|
|
39
|
+
"complexType": {
|
|
40
|
+
"original": "string",
|
|
41
|
+
"resolved": "string",
|
|
42
|
+
"references": {}
|
|
43
|
+
},
|
|
44
|
+
"required": false,
|
|
45
|
+
"optional": false,
|
|
46
|
+
"docs": {
|
|
47
|
+
"tags": [],
|
|
48
|
+
"text": "The first name"
|
|
49
|
+
},
|
|
50
|
+
"getter": false,
|
|
51
|
+
"setter": false,
|
|
52
|
+
"reflect": false,
|
|
53
|
+
"attribute": "first"
|
|
54
|
+
},
|
|
55
|
+
"middle": {
|
|
56
|
+
"type": "string",
|
|
57
|
+
"mutable": false,
|
|
58
|
+
"complexType": {
|
|
59
|
+
"original": "string",
|
|
60
|
+
"resolved": "string",
|
|
61
|
+
"references": {}
|
|
62
|
+
},
|
|
63
|
+
"required": false,
|
|
64
|
+
"optional": false,
|
|
65
|
+
"docs": {
|
|
66
|
+
"tags": [],
|
|
67
|
+
"text": "The middle name"
|
|
68
|
+
},
|
|
69
|
+
"getter": false,
|
|
70
|
+
"setter": false,
|
|
71
|
+
"reflect": false,
|
|
72
|
+
"attribute": "middle"
|
|
73
|
+
},
|
|
74
|
+
"last": {
|
|
75
|
+
"type": "string",
|
|
76
|
+
"mutable": false,
|
|
77
|
+
"complexType": {
|
|
78
|
+
"original": "string",
|
|
79
|
+
"resolved": "string",
|
|
80
|
+
"references": {}
|
|
81
|
+
},
|
|
82
|
+
"required": false,
|
|
83
|
+
"optional": false,
|
|
84
|
+
"docs": {
|
|
85
|
+
"tags": [],
|
|
86
|
+
"text": "The last name"
|
|
87
|
+
},
|
|
88
|
+
"getter": false,
|
|
89
|
+
"setter": false,
|
|
90
|
+
"reflect": false,
|
|
91
|
+
"attribute": "last"
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview entry point for your component library
|
|
3
|
+
*
|
|
4
|
+
* This is the entry point for your component library. Use this file to export utilities,
|
|
5
|
+
* constants or data structure that accompany your components.
|
|
6
|
+
*
|
|
7
|
+
* DO NOT use this file to export your components. Instead, use the recommended approaches
|
|
8
|
+
* to consume components of this package as outlined in the `README.md`.
|
|
9
|
+
*/
|
|
10
|
+
export { format } from './utils/utils';
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The text of a call history entry, or `null` when the message is not one.
|
|
3
|
+
*
|
|
4
|
+
* chatleo-server posts call entries as `application/json+blocks` with one `call` block:
|
|
5
|
+
* `{"version":"1","blocks":[{"type":"call","event":"started|ended|missed|declined|failed",
|
|
6
|
+
* "mode":…,"duration_ms":…}],"fallback_text":"Call ended · 1m 5s"}`. The message-level
|
|
7
|
+
* `fallback_text` is preferred; `state` and a block-level `fallback_text` are accepted too.
|
|
8
|
+
*/
|
|
9
|
+
export function callEntryText(contentBody) {
|
|
10
|
+
try {
|
|
11
|
+
const parsed = JSON.parse(contentBody);
|
|
12
|
+
const block = parsed?.call ?? (Array.isArray(parsed?.blocks) ? parsed.blocks.find((candidate) => candidate?.type === 'call') : undefined);
|
|
13
|
+
if (!block)
|
|
14
|
+
return null;
|
|
15
|
+
const text = block.fallback_text ?? parsed.fallback_text;
|
|
16
|
+
if (text)
|
|
17
|
+
return String(text);
|
|
18
|
+
const outcome = block.event ?? block.state;
|
|
19
|
+
const seconds = typeof block.duration_ms === 'number' ? Math.round(block.duration_ms / 1000) : undefined;
|
|
20
|
+
const duration = seconds ? ` · ${Math.floor(seconds / 60)}:${String(seconds % 60).padStart(2, '0')}` : '';
|
|
21
|
+
if (outcome === 'missed' || block.reason === 'missed')
|
|
22
|
+
return 'Missed call';
|
|
23
|
+
if (outcome === 'declined' || block.reason === 'declined')
|
|
24
|
+
return 'Call declined';
|
|
25
|
+
if (outcome === 'ended' || outcome === 'failed')
|
|
26
|
+
return `Call ended${duration}`;
|
|
27
|
+
if (outcome === 'started' || outcome === 'active')
|
|
28
|
+
return block.mode === 'group' ? 'Group call started' : 'Call started';
|
|
29
|
+
return 'Call';
|
|
30
|
+
}
|
|
31
|
+
catch {
|
|
32
|
+
return null;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** What the message footer should show for a locally originated message. */
|
|
2
|
+
export function deliveryView(message, isOwnMessage) {
|
|
3
|
+
if (!isOwnMessage || !message?.delivery || message.delivery === 'sent') {
|
|
4
|
+
return { status: 'none', canRetry: false };
|
|
5
|
+
}
|
|
6
|
+
return { status: message.delivery, error: message.error, canRetry: Boolean(message.client_id) };
|
|
7
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @function format
|
|
3
|
+
* @description This utility function concatenates the first, middle, and last names into a single string, with spaces in between. It gracefully handles cases where some or all of the name parts are not provided.
|
|
4
|
+
* @param {string} first - The first name.
|
|
5
|
+
* @param {string} middle - The middle name.
|
|
6
|
+
* @param {string} last - The last name.
|
|
7
|
+
* @returns {string} The full name as a single string.
|
|
8
|
+
*/
|
|
9
|
+
export function format(first, middle, last) {
|
|
10
|
+
return (first || '') + (middle ? ` ${middle}` : '') + (last ? ` ${last}` : '');
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* @function groupMessagesByDate
|
|
14
|
+
* @description This function takes an array of `ChatLeoMessage` objects and groups them into a record where the keys are formatted dates and the values are arrays of messages from that date.
|
|
15
|
+
* @param {ChatLeoMessage[]} messages - An array of `ChatLeoMessage` objects to be grouped.
|
|
16
|
+
* @returns {Record<string, ChatLeoMessage[]>} An object where keys are date strings and values are arrays of messages.
|
|
17
|
+
*/
|
|
18
|
+
export function groupMessagesByDate(messages) {
|
|
19
|
+
return [...messages]
|
|
20
|
+
.sort((a, b) => {
|
|
21
|
+
// Sequence numbers are authoritative when both messages have one; legacy servers (and
|
|
22
|
+
// optimistic local messages) fall back to timestamps.
|
|
23
|
+
if (typeof a.seq === 'number' && typeof b.seq === 'number')
|
|
24
|
+
return a.seq - b.seq;
|
|
25
|
+
if (typeof a.seq === 'number' || typeof b.seq === 'number')
|
|
26
|
+
return typeof a.seq === 'number' ? -1 : 1;
|
|
27
|
+
return new Date(a.created_at).getTime() - new Date(b.created_at).getTime();
|
|
28
|
+
})
|
|
29
|
+
.reduce((groups, message) => {
|
|
30
|
+
const date = formatDate(message.created_at);
|
|
31
|
+
if (!groups[date]) {
|
|
32
|
+
groups[date] = [];
|
|
33
|
+
}
|
|
34
|
+
groups[date].push(message);
|
|
35
|
+
return groups;
|
|
36
|
+
}, {});
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* @function formatDate
|
|
40
|
+
* @description This function takes a timestamp string, converts it to a Date object, and then formats it into a "Month Day, Year" format in uppercase.
|
|
41
|
+
* @param {string} timestamp - An ISO 8601 timestamp string.
|
|
42
|
+
* @returns {string} The formatted date string (e.g., "JAN 1, 2023").
|
|
43
|
+
*/
|
|
44
|
+
export function formatDate(timestamp) {
|
|
45
|
+
const date = new Date(timestamp);
|
|
46
|
+
return date.toLocaleDateString('en-US', {
|
|
47
|
+
day: 'numeric',
|
|
48
|
+
month: 'short',
|
|
49
|
+
year: 'numeric'
|
|
50
|
+
}).toUpperCase();
|
|
51
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface ChatleoAvatar extends Components.ChatleoAvatar, HTMLElement {}
|
|
4
|
+
export const ChatleoAvatar: {
|
|
5
|
+
prototype: ChatleoAvatar;
|
|
6
|
+
new (): ChatleoAvatar;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{C as o,d as s}from"./p-Exj_2-yI.js";const p=o,r=s;export{p as ChatleoAvatar,r as defineCustomElement}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface ChatleoChatHeader extends Components.ChatleoChatHeader, HTMLElement {}
|
|
4
|
+
export const ChatleoChatHeader: {
|
|
5
|
+
prototype: ChatleoChatHeader;
|
|
6
|
+
new (): ChatleoChatHeader;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{C as o,d as s}from"./p-B7cdqAgv.js";const p=o,r=s;export{p as ChatleoChatHeader,r as defineCustomElement}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface ChatleoChatInput extends Components.ChatleoChatInput, HTMLElement {}
|
|
4
|
+
export const ChatleoChatInput: {
|
|
5
|
+
prototype: ChatleoChatInput;
|
|
6
|
+
new (): ChatleoChatInput;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t,p as e,H as a,c as n,h as i}from"./p-C-v19aUJ.js";const r=e(class extends a{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.messageInputSent=n(this,"messageInputSent")}disabled=!1;sendOnModifierEnter=!1;inputValue="";messageInputSent;inputRef;isMac=()=>"undefined"!=typeof navigator&&navigator.platform.toUpperCase().indexOf("MAC")>=0;handleSubmit=t=>{if(t.preventDefault(),this.disabled)return;const e=this.inputValue.trim();e&&(this.messageInputSent.emit(e),this.inputValue="",this.inputRef.value="")};handleKeyPress=t=>{"Enter"===t.key&&(this.sendOnModifierEnter?(this.isMac()?t.metaKey:t.ctrlKey)&&this.handleSubmit(t):this.handleSubmit(t))};handleInput=t=>{this.inputValue=t.target.value};render(){return i("div",{key:"d4696c7c5c3a24901303a7ad4ccb5caa46e5a76c",class:"chat-input-container"},i("div",{key:"bda9a1218853fa285da618b59da61b7e42c872fa",class:"input-wrapper"},i("input",{key:"96d1683a63cdfd3129a895a3dbe583a2d7e19618",ref:t=>this.inputRef=t,type:"text",placeholder:"Write a comment...",class:"chat-input",onKeyPress:this.handleKeyPress,onInput:this.handleInput,disabled:this.disabled}),i("button",{key:"7de82bd11d42e77cf43d49691c1ce1a5cafa31ab",class:"emoji-button"},"😊")),i("div",{key:"63d136df55745b6f5c99a17e670fcff32c28a02f",class:"action-buttons"},i("button",{key:"884b6bb075e46fe72d334720ea18b579c9fd37c0",class:"action-button"},i("svg",{key:"ffbcc860666136d91ae0e7833a22f5ecafb9a83e",xmlns:"http://www.w3.org/2000/svg",width:"17",height:"16",viewBox:"0 0 17 16",fill:"none"},i("path",{key:"8e1f60338db9d48dff0293c120b17b44ea97eba4",d:"M11.9286 3.42858L11.9286 10.5714C11.9286 12.6286 10.2714 14.2857 8.21429 14.2857C6.15714 14.2857 4.5 12.6286 4.5 10.5714L4.5 4.28572C4.5 2.85715 5.64286 1.71429 7.07143 1.71429C8.5 1.71429 9.64286 2.85715 9.64286 4.28572L9.64286 10C9.64286 10.8 9.01429 11.4286 8.21429 11.4286C7.41429 11.4286 6.78571 10.8 6.78571 10L6.78571 5.14287",stroke:"#4A86E8","stroke-width":"1.5","stroke-miterlimit":"10","stroke-linecap":"square"}))),i("button",{key:"1abac7331daae09f49faacaab62eb620dcc138b7",class:"action-button"},i("svg",{key:"51ad70231d80fb7ca5543904b530697c528e8490",xmlns:"http://www.w3.org/2000/svg",width:"33",height:"32",viewBox:"0 0 33 32",fill:"none"},i("path",{key:"d606dad20a4ce3b88d6924a3ca9bd035a40fe894",d:"M10.5 18.5312L14.3226 14.7683C14.6047 14.4907 15.062 14.4907 15.344 14.7683L18.4444 17.8203M18.4444 17.8203L17.3611 18.8867M18.4444 17.8203L19.7393 16.5457C20.0214 16.268 20.4786 16.268 20.7607 16.5457L23.5 19.2422M11.9444 21.375H22.0556C22.8533 21.375 23.5 20.7384 23.5 19.9531V11.4219C23.5 10.6366 22.8533 10 22.0556 10H11.9444C11.1467 10 10.5 10.6366 10.5 11.4219V19.9531C10.5 20.7384 11.1467 21.375 11.9444 21.375ZM21.6944 13.1992C21.6944 13.9845 21.0477 14.6211 20.25 14.6211C19.4523 14.6211 18.8056 13.9845 18.8056 13.1992C18.8056 12.4139 19.4523 11.7773 20.25 11.7773C21.0477 11.7773 21.6944 12.4139 21.6944 13.1992Z",stroke:"#4A86E8","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}))),i("button",{key:"7e90543be4744853a917661f7ee9ad7d7792ea1c",class:"action-button",onClick:this.handleSubmit},i("svg",{key:"9ca013889d4fec8d45543c54695a6335685b6802",xmlns:"http://www.w3.org/2000/svg",width:"17",height:"16",viewBox:"0 0 17 16",fill:"none"},i("path",{key:"078800be3b4eef96e6801cd3b9b4036f5ac6c4e0",d:"M14.214 2.28564L5.64258 9.14279L5.64258 13.1428L7.69972 10.6856",stroke:"#4A86E8","stroke-width":"1.5","stroke-miterlimit":"10"}),i("path",{key:"10da5167e57bf2f5784a8e0b42c12aedcbb4f2e4",d:"M2.78613 6.85707L14.2147 2.28564L11.929 13.7142L2.78613 6.85707Z",stroke:"#4A86E8","stroke-width":"1.5","stroke-miterlimit":"10","stroke-linecap":"square"})))))}static get style(){return":host{--input-radius:100px;--button-radius:4px}.chat-input-container{display:flex;align-items:center;gap:16px;padding:16px;border-top:1px solid var(--border-color);background:var(--bg-primary)}.input-wrapper{flex:1;display:flex;align-items:center;gap:8px;background:var(--bg-secondary);border-radius:var(--input-radius);padding:8px 16px}.chat-input{flex:1;border:none;outline:none;background:transparent;font-family:var(--font-primary);font-weight:400;font-size:14px;line-height:1.6;color:var(--text-primary)}.chat-input::placeholder{color:var(--text-secondary)}.emoji-button{border:none;background:transparent;cursor:pointer;font-size:16px;padding:0;display:flex;align-items:center;justify-content:center}.action-buttons{display:flex;gap:0}.action-button{width:32px;height:32px;border:none;background:transparent;border-radius:var(--button-radius);cursor:pointer;display:flex;align-items:center;justify-content:center;font-size:14px;transition:background-color var(--transition-duration) ease}.action-button:hover{background:var(--bg-secondary)}"}},[513,"chatleo-chat-input",{disabled:[4],sendOnModifierEnter:[4,"send-on-modifier-enter"],inputValue:[32]}]);function o(){"undefined"!=typeof customElements&&["chatleo-chat-input"].forEach((e=>{"chatleo-chat-input"===e&&(customElements.get(t(e))||customElements.define(t(e),r))}))}o();const s=r,d=o;export{s as ChatleoChatInput,d as defineCustomElement}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface ChatleoChatMessage extends Components.ChatleoChatMessage, HTMLElement {}
|
|
4
|
+
export const ChatleoChatMessage: {
|
|
5
|
+
prototype: ChatleoChatMessage;
|
|
6
|
+
new (): ChatleoChatMessage;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{C as s,d as o}from"./p-XlwGxsqT.js";const p=s,r=o;export{p as ChatleoChatMessage,r as defineCustomElement}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface ChatleoChat extends Components.ChatleoChat, HTMLElement {}
|
|
4
|
+
export const ChatleoChat: {
|
|
5
|
+
prototype: ChatleoChat;
|
|
6
|
+
new (): ChatleoChat;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{C as o,d as s}from"./p-DGjAxoQy.js";const p=o,r=s;export{p as ChatleoChat,r as defineCustomElement}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface ChatleoComponent extends Components.ChatleoComponent, HTMLElement {}
|
|
4
|
+
export const ChatleoComponent: {
|
|
5
|
+
prototype: ChatleoComponent;
|
|
6
|
+
new (): ChatleoComponent;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e,p as t,H as o,c as a,h as n}from"./p-C-v19aUJ.js";import{d as i}from"./p-Exj_2-yI.js";import{d as s}from"./p-DGjAxoQy.js";import{d as c}from"./p-B7cdqAgv.js";import{d as r}from"./p-XlwGxsqT.js";import{d as l}from"./p-BdiOcOYZ.js";import{d as h}from"./p-C1mF0s8g.js";import{d}from"./p-CRtBdzP3.js";import{d as p}from"./p-8kvQ-Uh-.js";import{d as f}from"./p-fjMaTJam.js";import{d as m}from"./p-BlbDSb7D.js";import{d as u}from"./p-CfayCm9O.js";import{d as g}from"./p-xt4kzz3B.js";const b=t(class e extends o{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.activeRoomChange=a(this,"activeRoomChange"),this.unreadTotalChange=a(this,"unreadTotalChange")}username;ticket;useTray;useMain=!1;useRoomView=!1;roomId;chatLeoLib;chatStore;serverUrl;transport;calls="auto";push="manual";pushSwPath;isLoggedIn=!1;loading=!1;isSessionExpired=!1;connectionStatus="disconnected";callsAvailable=!1;incomingCall=null;callView=null;showCall=!1;pushState=null;pushPromptDismissed=!1;activeRoomChange;unreadTotalChange;chatEl;boundActiveRoomChanged=e=>this.activeRoomChange.emit(e.detail??{roomId:null});boundUnreadTotalChanged=e=>this.unreadTotalChange.emit(e.detail??{count:0});callRingtoneTimer;incomingRef;callRingtoneContext;callsChannel;callAdapterRef;trayEl;static OPEN_ROOM_EVENT="chatleo:openRoom";static START_DM_EVENT="chatleo:startDM";static NEW_CHAT_EVENT="chatleo:newChat";boundOpenRoomListener=e=>this.handleExternalOpenRoom(e);boundStartDmListener=e=>this.handleExternalStartDm(e);boundNewChatListener=e=>this.handleExternalNewChat(e);boundStartCallListener=e=>this.handleExternalStartCall(e);boundCallRinging=e=>this.handleCallRinging(e);boundCallChanged=e=>this.handleCallChanged(e);boundCallRole=e=>this.handleCallRole(e);boundServiceWorkerMessage=e=>this.handleServiceWorkerMessage(e);onChatLeoLibChange(e){console.debug("onChatLeoLibChange",e),e&&this.requestLibConnection()}onChatStoreChange(e,t){console.debug("onChatStoreChange",e,t),t?.removeEventListener("callRinging",this.boundCallRinging),t?.removeEventListener("callChanged",this.boundCallChanged),t?.removeEventListener("callRole",this.boundCallRole),t?.removeEventListener("activeRoomChanged",this.boundActiveRoomChanged),t?.removeEventListener("unreadTotalChanged",this.boundUnreadTotalChanged),e.addEventListener("callRinging",this.boundCallRinging),e.addEventListener("callChanged",this.boundCallChanged),e.addEventListener("callRole",this.boundCallRole),e.addEventListener("activeRoomChanged",this.boundActiveRoomChanged),e.addEventListener("unreadTotalChanged",this.boundUnreadTotalChanged),e.addEventListener("roomAdded",(e=>{console.warn(e)})),this.activeRoomChange.emit({roomId:e.activeRoomId}),this.unreadTotalChange.emit({count:e.unreadTotal})}onTicketChange(e){console.debug("onTicketChange",e),this.requestLibConnection()}onCallsChange(e){this.chatLeoLib?.setCallsEnabled?.("off"!==e),this.refreshCallsAvailability()}componentDidLoad(){console.debug("ChatLeoComponent:componentDidLoad",this.serverUrl),this.requestLibConnection()}connectedCallback(){console.debug("ChatLeoComponent:connectedCallback"),window.addEventListener(e.OPEN_ROOM_EVENT,this.boundOpenRoomListener),window.addEventListener(e.START_DM_EVENT,this.boundStartDmListener),window.addEventListener(e.NEW_CHAT_EVENT,this.boundNewChatListener),window.addEventListener("chatleo:startCall",this.boundStartCallListener),"undefined"!=typeof navigator&&"serviceWorker"in navigator&&navigator.serviceWorker.addEventListener("message",this.boundServiceWorkerMessage)}disconnectedCallback(){console.debug("ChatLeoComponent:disconnectedCallback"),this.chatLeoLib?.unregisterClient(this),window.removeEventListener(e.OPEN_ROOM_EVENT,this.boundOpenRoomListener),window.removeEventListener(e.START_DM_EVENT,this.boundStartDmListener),window.removeEventListener(e.NEW_CHAT_EVENT,this.boundNewChatListener),window.removeEventListener("chatleo:startCall",this.boundStartCallListener),"undefined"!=typeof navigator&&"serviceWorker"in navigator&&navigator.serviceWorker.removeEventListener("message",this.boundServiceWorkerMessage),this.chatStore?.removeEventListener("callRinging",this.boundCallRinging),this.chatStore?.removeEventListener("callChanged",this.boundCallChanged),this.chatStore?.removeEventListener("activeRoomChanged",this.boundActiveRoomChanged),this.chatStore?.removeEventListener("unreadTotalChanged",this.boundUnreadTotalChanged),this.chatStore?.removeEventListener("callRole",this.boundCallRole),this.stopRingtone(),this.callsChannel?.close()}async requestLibConnection(){console.debug("requestLibConnection",this.chatLeoLib),this.chatLeoLib?.setCallsEnabled?.("off"!==this.calls),this.pushSwPath&&this.chatLeoLib?.setPushServiceWorkerPath?.(this.pushSwPath),await(this.chatLeoLib?.requestConnection(this,{...this.ticket?{ticket:this.ticket}:{},...this.transport?{transport:this.transport}:{}}))}setLoading(e){this.loading=e}setLoggedIn(e){this.isLoggedIn=e,e&&(this.refreshCallsAvailability(),this.refreshPush())}setSessionExpired(e){this.isSessionExpired=e}setConnectionStatus(e){this.connectionStatus=e}async getConnectionStatus(){return{isConnected:this.chatStore?.isConnected??!1,isSessionExpired:this.isSessionExpired||(this.chatStore?.isSessionExpired??!1),connectionStatus:this.chatStore?.connectionStatus??this.connectionStatus}}async openRoom(e){e?this.useTray?await(this.trayEl?.openChatPanel(e,!1)):await(this.chatEl?.openRoom?.(e)):console.warn("[chatleo-component] openRoom called without roomId")}async closeRoom(){this.useTray?await(this.trayEl?.closeChatPanel?.()):await(this.chatEl?.closeRoom?.())}async getActiveRoomId(){return this.chatStore?.activeRoomId??null}async getDraft(){return await(this.chatEl?.getDraft?.())??""}async setDraft(e){e&&await(this.chatEl?.setDraft?.(e))}async addFiles(e){await(this.chatEl?.addFiles?.(e??[]))}async focusComposer(){await(this.chatEl?.focusComposer?.())}async openDirectMessageWithUser(e,t=!1){e?await this.internalStartDmFlow(e,t):console.warn("[chatleo-component] openDirectMessageWithUser called without userId")}async openNewChatDraft(){await(this.trayEl?.openChatPanel(void 0,!0))}async internalStartDmFlow(e,t=!1){if(e)try{const o=this.chatLeoLib?.findDirectMessageRoomIdByUser(e);if(console.debug("internalStartDmFlow",{existingRoomId:o}),o)return void await this.openRoom(o);const a=await(this.chatLeoLib?.ensureDirectMessageRoom(e,t)),n=a?.roomId;n?await this.openRoom(n):(console.warn("[chatleo-component] ensureDirectMessageRoom returned no roomId"),await(this.trayEl?.openChatPanel(void 0,!1)))}catch(e){console.error("[chatleo-component] Failed to start DM",e),await(this.trayEl?.openChatPanel(void 0,!1))}}async handleExternalOpenRoom(e){const t=e.roomId,o=e?.detail?.roomId||t;o?await this.openRoom(o):e?.detail||console.warn('[chatleo-component] chatleo:openRoom event missing detail. Use new CustomEvent("chatleo:openRoom", { detail: { roomId: "..." } })')}async handleExternalStartDm(e){console.log("handleExternalStartDm",e);const t=e.userId,o=e?.detail?.userId||t,a=e?.detail?.use_external_id??!1;o?await this.openDirectMessageWithUser(o,a):e?.detail||console.warn('[chatleo-component] chatleo:startDM event missing detail. Dispatch like: new CustomEvent("chatleo:startDM", { detail: { userId: "123" } })')}async handleExternalNewChat(e){await this.openNewChatDraft()}async refreshCallsAvailability(){this.callsAvailable=!("off"===this.calls||!this.chatLeoLib?.ensureCallsAvailable)&&await this.chatLeoLib.ensureCallsAvailable()}async loadCallComponents(){if("undefined"==typeof window||window.customElements.get("chatleo-call-adapter"))return!0;try{return await import("./p-BnCPdbII.js"),!!window.customElements.get("chatleo-call-adapter")}catch(e){return console.warn("[chatleo-component] call components could not be loaded",e),!1}}async startOrJoinCall(e,t,o){if(this.chatLeoLib)if(this.callView&&(t?this.callView.callId===t:this.callView.roomId===e))this.showCall=!0;else try{const a=this.chatStore?.rooms.find((t=>t.id===e)),n=t?{id:t,mode:"DirectMessage"===a?.type?"direct":"group"}:await this.chatLeoLib.startCall(e,o),i=await this.chatLeoLib.joinCall(n.id);if(!await this.loadCallComponents())return;this.callView={callId:n.id,roomId:e,mode:i.mode??n.mode,credentials:{sfuUrl:i.sfu_url,token:i.token,roomId:i.room_id,mode:i.mode,iceServers:i.ice_servers}},this.showCall=!0,this.incomingCall=null,this.stopRingtone()}catch(e){console.warn("[chatleo-component] call start/join failed",e)}}onIncomingCallChange(e){e&&setTimeout((()=>this.incomingRef?.focus()),0)}handleCallRinging(e){this.incomingCall=e.detail?.call??null,this.incomingCall?this.startRingtone(this.incomingCall.id):this.stopRingtone()}handleCallChanged(e){this.callView&&!e.detail?.call&&(this.callView=null,this.showCall=!1,this.stopRingtone())}async acceptIncomingCall(){if(!this.incomingCall)return;const e=this.incomingCall;this.incomingCall=null,this.stopRingtone(),await this.startOrJoinCall(e.room_id,e.id)}async declineIncomingCall(){if(!this.incomingCall||!this.chatLeoLib)return;const e=this.incomingCall;this.incomingCall=null,this.stopRingtone();try{await this.chatLeoLib.declineCall(e.id)}catch(e){console.warn("[chatleo-component] decline failed",e)}}handleExternalStartCall(e){const t=e?.detail?.roomId;t&&this.startOrJoinCall(t,void 0,e.detail.mode)}handleCallRole(e){const{callId:t,userId:o}=e.detail??{};this.callView&&this.callView.callId===t&&(o&&o!==this.chatStore?.profile?.id||this.callAdapterRef?.refreshToken?.().catch((e=>console.warn("[chatleo-component] token refresh after a role change failed",e))))}callToken=async()=>{const e=this.callView;if(!e||!this.chatLeoLib)throw Error("no call");const t=await this.chatLeoLib.refreshCallToken(e.callId);return{token:t.token,sfuUrl:t.sfu_url,iceServers:t.ice_servers}};promoteInCall=async(e,t,o)=>{const a=this.callView;if(!a||!this.chatLeoLib||!o?.userId)throw Error("unknown participant");await this.chatLeoLib.promoteCallParticipant(a.callId,o.userId)};demoteInCall=async(e,t)=>{const o=this.callView;if(!o||!this.chatLeoLib||!t?.userId)throw Error("unknown participant");await this.chatLeoLib.demoteCallParticipant(o.callId,t.userId)};startRingtone(e){if("undefined"!=typeof window){if(this.callsChannel??="undefined"!=typeof BroadcastChannel?new BroadcastChannel("chatleo-calls"):void 0,this.callsChannel){const t=this.callsChannel;t.addEventListener("message",(t=>{"ring"===t.data?.type&&t.data.callId===e&&this.stopRingtone()}),{once:!0}),t.postMessage({type:"ring",callId:e})}try{const e=this.callRingtoneContext??new AudioContext;this.callRingtoneContext=e;const t=()=>{const t=e.createOscillator(),o=e.createGain();t.frequency.value=660,o.gain.value=.04,t.connect(o).connect(e.destination),t.start(),setTimeout((()=>t.stop()),180)};t(),this.callRingtoneTimer=setInterval(t,1200)}catch{}}}stopRingtone(){this.callRingtoneTimer&&(clearInterval(this.callRingtoneTimer),this.callRingtoneTimer=void 0)}async refreshPush(){if("off"!==this.push&&this.chatLeoLib?.pushState)try{this.pushState=await this.chatLeoLib.pushState()}catch{this.pushState=null}else this.pushState=null}async enablePush(){if(this.chatLeoLib?.enablePush)try{this.pushState=await this.chatLeoLib.enablePush(),this.pushPromptDismissed=!0}catch(e){console.warn("[chatleo-component] enabling push failed",e),await this.refreshPush()}}async disablePush(){if(this.chatLeoLib?.disablePush)try{this.pushState=await this.chatLeoLib.disablePush()}catch(e){console.warn("[chatleo-component] disabling push failed",e)}}handleServiceWorkerMessage(e){if("chatleo:pushVisibility"!==e.data?.type)"chatleo:openRoom"===e.data?.type&&e.data.roomId&&(this.openRoom(e.data.roomId+""),"undefined"!=typeof navigator&&"clearAppBadge"in navigator&&navigator.clearAppBadge());else{const t=(e.data.roomId??"")+"",o="undefined"!=typeof document&&"visible"===document.visibilityState&&this.chatStore?.activeRoomId===t;e.ports?.[0]?.postMessage({visible:o})}}renderPushControl(){if("off"===this.push||!this.pushState)return null;const e=this.pushState;return"ios_install_required"===e.availability?n("div",{class:"push-control push-control--hint"},"Add ChatLeo to your home screen to enable notifications."):"available"!==e.availability?null:"denied"===e.permission?n("div",{class:"push-control push-control--hint"},"Notifications are blocked in your browser settings."):e.subscribed&&e.accountEnabled?n("button",{type:"button",class:"push-control",onClick:()=>{this.disablePush()}},"Notifications on"):"prompt"!==this.push||this.pushPromptDismissed?n("button",{type:"button",class:"push-control",onClick:()=>{this.enablePush()}},"Enable notifications"):n("div",{class:"push-control push-control--prompt",role:"region","aria-label":"Enable notifications"},n("span",null,"Get notified about new messages when ChatLeo is in the background."),n("button",{type:"button",onClick:()=>{this.enablePush()}},"Enable"),n("button",{type:"button",class:"push-control__secondary",onClick:()=>{this.pushPromptDismissed=!0}},"Not now"))}identityResolver={resolve:e=>Object.fromEntries(e.map((e=>{const t=this.chatStore?.usernameResolver(e);return[e,{displayName:t?.display_name??e,avatarUrl:t?.profile_picture_url??void 0}]})))};onCallError(e){const t=this.callView,o=e.detail?.code;t&&o&&["auth_rejected","removed","session_replaced","room_ended","room_full","network_failed"].includes(o)&&(this.callView=null,this.showCall=!1,"network_failed"===o&&this.chatLeoLib?.leaveCall(t.callId).catch((()=>{})))}onCallLeft(){const e=this.callView;e&&(this.callView=null,this.showCall=!1,this.chatLeoLib?.leaveCall(e.callId).catch((e=>console.warn("[chatleo-component] leave failed",e))))}onCallRequested(e){const t=e.detail;t?.roomId&&this.startOrJoinCall(t.roomId,t.callId)}onNewChatClicked(e){}onChatMessage(e){console.debug("messageChatSent",e),this.chatLeoLib?.sendChatMessage(e.detail)}async onUserSelectedForChat(e){const t=e.detail;t&&t.id&&await this.internalStartDmFlow(t.id)}get _connectionBannerLabel(){switch(this.connectionStatus){case"connecting":return"Verbindung wird hergestellt…";case"reconnecting":return"Verbindung wird wiederhergestellt…";case"disconnected":return"Offline";default:return null}}render(){const e=this._connectionBannerLabel;return n("div",{key:"d0c7c84ebf5fe164868f6e2250252a0899493ee3",style:{height:"100%",maxHeight:"inherit",width:"100%",display:"flex",flexDirection:"column",position:"relative",overflow:"hidden",minHeight:"0"}},this.renderPushControl(),e&&!this.isSessionExpired&&n("div",{key:"d5147662da351b027aba0542ae3dc5af161d2aa3",class:"connection-banner connection-banner--"+this.connectionStatus},n("span",{key:"43cad2fcb7fd75d099fa8b73f482e7eb282c0957",class:"connection-banner__dot"}),e),this.useMain&&n("chatleo-chat",{key:"609457ee0ab1ceaa2484d91d4c54d734770f4d01",ref:e=>this.chatEl=e,chatStore:this.chatStore,callsAvailable:this.callsAvailable,inCall:!!this.callView}),this.useTray&&n("chatleo-tray-component",{key:"ebd656fd966561d4f982859b9c36a1e233b204b6",chatStore:this.chatStore,ref:e=>this.trayEl=e}),this.useRoomView&&n("chatleo-room-view",{key:"6af1a89788728c21f72ee1a31b7e70bd7d096f0f",chatStore:this.chatStore,roomId:this.roomId,isOnline:this.chatStore?.isConnected??!1,pending:this.loading,callsAvailable:this.callsAvailable,inCall:!!this.callView}),this.callView&&n("div",{key:"3a346cdaf24c1fe758f86e1233cc4626db023a32",class:"call-layer",style:{display:this.showCall?"flex":"none"}},n("button",{key:"7720dc641239eb8da833c63c1f30d4ed29fece7c",type:"button",class:"call-layer__back",onClick:()=>{this.showCall=!1}},"Chat"),n("chatleo-call-adapter",{ref:e=>this.callAdapterRef=e,callId:this.callView.callId,mode:this.callView.mode,connection:this.callView.credentials,autoJoin:!0,identity:this.identityResolver,getToken:this.callToken,promoteHandler:this.promoteInCall,demoteHandler:this.demoteInCall,style:{flex:"1",minHeight:"0"}})),this.incomingCall&&n("div",{key:"ebdc317f30b07009f41f7f729b9e8631ea039752",class:"incoming-call",role:"dialog","aria-modal":"true","aria-label":"Incoming call from "+(this.incomingCall.caller.display_name??this.incomingCall.caller.id),tabIndex:-1,ref:e=>this.incomingRef=e},n("div",{key:"4eac45f10551a47c7bf1ad8035a9da5ed2955e29",class:"incoming-call__box"},n("p",{key:"6f74dee9aa261dc889b70c18e5b110e18b1a2111",class:"incoming-call__eyebrow"},"Incoming call"),n("chatleo-avatar",{key:"e097d46809d6202d64ebc1eaf42418b74c990e80",name:this.incomingCall.caller.display_name??this.incomingCall.caller.id,url:this.incomingCall.caller.profile_picture_url??null,isOnline:!1}),n("p",{key:"b160c0021f003d230d5fb544d82fd8d23f7df332",class:"incoming-call__name"},this.incomingCall.caller.display_name??this.incomingCall.caller.id),n("div",{key:"b238c1352384a0f14a2abd130fe0f3495da156f3",class:"incoming-call__actions"},n("button",{key:"1b44cc1c87dfb89b4715fb370c490a05d97b6512",type:"button",class:"incoming-call__accept",onClick:()=>{this.acceptIncomingCall()}},"Accept"),n("button",{key:"97276ec614d0be526f16573a3d0e9f6cb9e24b7c",type:"button",class:"incoming-call__decline",onClick:()=>{this.declineIncomingCall()}},"Decline")))),this.isSessionExpired&&n("div",{key:"b387b49bc31378c63c6520a95bf732c47a142e88",class:"session-expired-overlay"},n("div",{key:"118687b87cc612d9ad47692a3e8f2a38f3b71f32",class:"session-expired-box"},n("svg",{key:"562cf50bb4f6cdd0e4076267c6dea5f8b76b06d7",class:"session-expired-icon",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"},n("path",{key:"628579c8dad4064d6fcfdfd75801160fe8f0ef8f",d:"M12 9v4M12 17h.01M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})),n("p",{key:"e49e2388dad8df0e961cb7e0dc605a4011775eed",class:"session-expired-title"},"Session abgelaufen"),n("p",{key:"0b69cf4687411c7e9f117712b28da57bc798ce07",class:"session-expired-message"},"Deine Sitzung ist abgelaufen. Bitte lade die Seite neu, um fortzufahren."),n("button",{key:"9532b50dccc9f05dc3ee4a5ea2b28eea462a0ed1",class:"session-expired-button",onClick:()=>window.location.reload()},"Seite neu laden"))))}static get watchers(){return{chatLeoLib:[{onChatLeoLibChange:0}],chatStore:[{onChatStoreChange:0}],ticket:[{onTicketChange:0}],calls:[{onCallsChange:0}],incomingCall:[{onIncomingCallChange:0}]}}static get style(){return":host{overflow:hidden;position:relative;height:100%;max-height:100%;min-height:0;--display:block;--bg-primary:#ffffff;--bg-secondary:#f3f4f6;--bg-light:#e7effc;--text-primary:#171a1f;--text-secondary:#9095a1;--border-color:#bdc1ca;--border-light:#eeeeee;--accent-color:#4a86e8;--accent-hover:#3a7bd8;--status-online:#21d184;--status-offline:#6b7280;--font-primary:'Manrope', sans-serif;--avatar-size:36px;--border-radius:8px;--transition-duration:0.2s;display:var(--display)}.connection-banner{display:flex;align-items:center;gap:6px;padding:5px 12px;font-family:var(--font-primary, 'Manrope', sans-serif);font-size:12px;font-weight:600;color:#fff;background:#6b7280;z-index:100;flex-shrink:0}.connection-banner--connecting,.connection-banner--reconnecting{background:#f59e0b;color:#fff}.connection-banner--disconnected{background:#ef4444;color:#fff}.connection-banner__dot{width:7px;height:7px;border-radius:50%;background:rgba(255, 255, 255, 0.8);flex-shrink:0;animation:pulse-dot 1.4s ease-in-out infinite}.connection-banner--disconnected .connection-banner__dot{animation:none}@keyframes pulse-dot{0%,100%{opacity:1}50%{opacity:0.3}}.session-expired-overlay{position:absolute;inset:0;z-index:9999;background:rgba(255, 255, 255, 0.85);backdrop-filter:blur(4px);display:flex;align-items:center;justify-content:center}.session-expired-box{background:var(--bg-primary, #fff);border:1px solid var(--border-color, #bdc1ca);border-radius:var(--border-radius, 8px);box-shadow:0 4px 24px rgba(0, 0, 0, 0.12);padding:32px 28px;max-width:340px;width:100%;text-align:center;display:flex;flex-direction:column;align-items:center;gap:12px}.session-expired-icon{color:#f59e0b;width:32px;height:32px}.session-expired-title{margin:0;font-family:var(--font-primary, 'Manrope', sans-serif);font-size:16px;font-weight:700;color:var(--text-primary, #171a1f)}.session-expired-message{margin:0;font-family:var(--font-primary, 'Manrope', sans-serif);font-size:13px;color:var(--text-secondary, #9095a1);line-height:1.6}.session-expired-button{margin-top:4px;padding:8px 20px;background:var(--accent-color, #4a86e8);color:#fff;border:none;border-radius:var(--border-radius, 8px);font-family:var(--font-primary, 'Manrope', sans-serif);font-size:14px;font-weight:600;cursor:pointer;transition:background var(--transition-duration, 0.2s)}.session-expired-button:hover{background:var(--accent-hover, #3a7bd8)}.call-layer{position:absolute;inset:0;z-index:40;background:var(--bg-primary, #fff);flex-direction:column}.call-layer__back{align-self:flex-end;margin:8px 16px 0;border:1px solid var(--border-color, #ddd);background:transparent;border-radius:6px;padding:4px 10px;font:inherit;cursor:pointer}.incoming-call{position:absolute;inset:0;z-index:50;display:flex;align-items:center;justify-content:center;background:rgba(15, 23, 42, 0.45)}.incoming-call:focus{outline:none}.incoming-call__box{width:min(320px, calc(100% - 32px));background:var(--bg-primary, #fff);border-radius:12px;padding:24px;text-align:center;box-shadow:0 18px 50px rgba(15, 23, 42, 0.25)}.incoming-call__eyebrow{margin:0 0 12px;font-size:12px;letter-spacing:0.08em;text-transform:uppercase;color:var(--text-secondary, #667)}.incoming-call__name{margin:12px 0 20px;font-size:18px;font-weight:700}.incoming-call__actions{display:flex;gap:10px;justify-content:center}.incoming-call__accept,.incoming-call__decline{border-radius:8px;padding:8px 18px;font:inherit;cursor:pointer}.incoming-call__accept{border:none;background:#1b8a3a;color:#fff}.incoming-call__decline{border:1px solid var(--border-color, #ddd);background:transparent;color:inherit}.push-control{display:flex;align-items:center;gap:8px;padding:6px 12px;border:0;border-bottom:1px solid var(--border-light, #eee);background:var(--bg-secondary, #f7f8fa);color:var(--text-primary, #222);font:inherit;font-size:12px;text-align:left;cursor:pointer}.push-control--hint{cursor:default;color:var(--text-secondary, #667)}.push-control--prompt{flex-wrap:wrap}.push-control--prompt button{border:1px solid var(--accent-color, #4a86e8);border-radius:6px;background:transparent;color:var(--accent-color, #4a86e8);padding:3px 10px;font:inherit;cursor:pointer}.push-control__secondary{border-color:var(--border-color, #ddd) !important;color:var(--text-secondary, #667) !important}"}},[513,"chatleo-component",{username:[1],ticket:[1],useTray:[4,"use-tray"],useMain:[4,"use-main"],useRoomView:[4,"use-room-view"],roomId:[1,"room-id"],chatLeoLib:[16],chatStore:[16],serverUrl:[1,"server-url"],transport:[1],calls:[1],push:[1],pushSwPath:[1,"push-sw-path"],isLoggedIn:[32],loading:[32],isSessionExpired:[32],connectionStatus:[32],callsAvailable:[32],incomingCall:[32],callView:[32],showCall:[32],pushState:[32],pushPromptDismissed:[32],getConnectionStatus:[64],openRoom:[64],closeRoom:[64],getActiveRoomId:[64],getDraft:[64],setDraft:[64],addFiles:[64],focusComposer:[64],openDirectMessageWithUser:[64],openNewChatDraft:[64]},[[0,"callError","onCallError"],[0,"callLeft","onCallLeft"],[0,"callRequested","onCallRequested"],[0,"newChatClicked","onNewChatClicked"],[0,"messageChatSent","onChatMessage"],[0,"userSelected","onUserSelectedForChat"]],{chatLeoLib:[{onChatLeoLibChange:0}],chatStore:[{onChatStoreChange:0}],ticket:[{onTicketChange:0}],calls:[{onCallsChange:0}],incomingCall:[{onIncomingCallChange:0}]}]);function y(){"undefined"!=typeof customElements&&["chatleo-component","chatleo-avatar","chatleo-chat","chatleo-chat-header","chatleo-chat-message","chatleo-new-message-selector","chatleo-rich-input","chatleo-rich-message-renderer","chatleo-room-list","chatleo-room-tile-component","chatleo-room-view","chatleo-tray-component","chatleo-user-tile"].forEach((t=>{switch(t){case"chatleo-component":customElements.get(e(t))||customElements.define(e(t),b);break;case"chatleo-avatar":customElements.get(e(t))||i();break;case"chatleo-chat":customElements.get(e(t))||s();break;case"chatleo-chat-header":customElements.get(e(t))||c();break;case"chatleo-chat-message":customElements.get(e(t))||r();break;case"chatleo-new-message-selector":customElements.get(e(t))||l();break;case"chatleo-rich-input":customElements.get(e(t))||h();break;case"chatleo-rich-message-renderer":customElements.get(e(t))||d();break;case"chatleo-room-list":customElements.get(e(t))||p();break;case"chatleo-room-tile-component":customElements.get(e(t))||f();break;case"chatleo-room-view":customElements.get(e(t))||m();break;case"chatleo-tray-component":customElements.get(e(t))||u();break;case"chatleo-user-tile":customElements.get(e(t))||g()}}))}y();const C=b,w=y;export{C as ChatleoComponent,w as defineCustomElement}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface ChatleoNewMessageSelector extends Components.ChatleoNewMessageSelector, HTMLElement {}
|
|
4
|
+
export const ChatleoNewMessageSelector: {
|
|
5
|
+
prototype: ChatleoNewMessageSelector;
|
|
6
|
+
new (): ChatleoNewMessageSelector;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{C as o,d as s}from"./p-BdiOcOYZ.js";const p=o,r=s;export{p as ChatleoNewMessageSelector,r as defineCustomElement}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface ChatleoRichInput extends Components.ChatleoRichInput, HTMLElement {}
|
|
4
|
+
export const ChatleoRichInput: {
|
|
5
|
+
prototype: ChatleoRichInput;
|
|
6
|
+
new (): ChatleoRichInput;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{C as s,d as o}from"./p-C1mF0s8g.js";const m=s,p=o;export{m as ChatleoRichInput,p as defineCustomElement}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface ChatleoRichMessageRenderer extends Components.ChatleoRichMessageRenderer, HTMLElement {}
|
|
4
|
+
export const ChatleoRichMessageRenderer: {
|
|
5
|
+
prototype: ChatleoRichMessageRenderer;
|
|
6
|
+
new (): ChatleoRichMessageRenderer;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{C as o,d as s}from"./p-CRtBdzP3.js";const t=o,p=s;export{t as ChatleoRichMessageRenderer,p as defineCustomElement}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface ChatleoRoomList extends Components.ChatleoRoomList, HTMLElement {}
|
|
4
|
+
export const ChatleoRoomList: {
|
|
5
|
+
prototype: ChatleoRoomList;
|
|
6
|
+
new (): ChatleoRoomList;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{C as o,d as s}from"./p-8kvQ-Uh-.js";const p=o,r=s;export{p as ChatleoRoomList,r as defineCustomElement}
|