@chat-leo/chatleo 0.0.0-stage → 2.0.0
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
package/dist/collection/components/chatleo-new-message-selector/chatleo-new-message-selector.css
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
/* Component-specific variables */
|
|
3
|
+
--input-bg: #F3F4F6;
|
|
4
|
+
--text-placeholder: #9ca3af;
|
|
5
|
+
--accent-shadow: rgba(59, 130, 246, 0.1);
|
|
6
|
+
--container-padding: 16px;
|
|
7
|
+
--input-font-size: 16px;
|
|
8
|
+
--list-padding: 8px;
|
|
9
|
+
--tile-padding: 12px 16px;
|
|
10
|
+
display: block;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.new-message-selector {
|
|
14
|
+
display: flex;
|
|
15
|
+
flex-direction: column;
|
|
16
|
+
height: 100%;
|
|
17
|
+
max-height: 70vh;
|
|
18
|
+
background-color: var(--bg-primary);
|
|
19
|
+
color: var(--text-secondary);
|
|
20
|
+
box-sizing: border-box; /* keep padding inside the width */
|
|
21
|
+
width: 100%;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.title {
|
|
25
|
+
padding: 16px 16px 8px 16px;
|
|
26
|
+
border-bottom: 1px solid var(--border-color);
|
|
27
|
+
font-weight: 700;
|
|
28
|
+
font-size: 16px;
|
|
29
|
+
color: #171A1F;
|
|
30
|
+
display: flex;
|
|
31
|
+
flex-direction: row;
|
|
32
|
+
justify-content: space-between;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.close-button {
|
|
36
|
+
background: none;
|
|
37
|
+
border: none;
|
|
38
|
+
cursor: pointer;
|
|
39
|
+
font-size: 16px;
|
|
40
|
+
color: var(--text-secondary);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.search-container {
|
|
44
|
+
padding: 16px;
|
|
45
|
+
/*border-bottom: 1px solid var(--border-color);*/
|
|
46
|
+
flex-shrink: 0;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.search-input {
|
|
50
|
+
width: 100%;
|
|
51
|
+
/*border: 1px solid var(--border-color);*/
|
|
52
|
+
border: 0;
|
|
53
|
+
font-size: 14px;
|
|
54
|
+
border-radius: var(--border-radius);
|
|
55
|
+
outline: none;
|
|
56
|
+
background-color: var(--input-bg);
|
|
57
|
+
color: var(--text-secondary);
|
|
58
|
+
padding: 8px;
|
|
59
|
+
box-sizing: border-box;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.search-input:focus {
|
|
63
|
+
border-color: var(--accent-color);
|
|
64
|
+
/*box-shadow: 0 0 0 3px var(--accent-shadow);*/
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.search-input::placeholder {
|
|
68
|
+
color: var(--text-placeholder);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.suggestions {
|
|
72
|
+
padding: 0 16px;
|
|
73
|
+
font-size: 14px;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.users-list {
|
|
77
|
+
flex: 1;
|
|
78
|
+
overflow-y: auto;
|
|
79
|
+
/*padding: var(--list-padding) 0;*/
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/* remove */
|
|
83
|
+
.users-list chatleo-user-tile {
|
|
84
|
+
padding: 8px 16px;
|
|
85
|
+
display: block;
|
|
86
|
+
--user-tile-border: none;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.users-list chatleo-user-tile:hover {
|
|
90
|
+
background-color: var(--hover-color);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/* override avatar size */
|
|
94
|
+
chatleo-user-tile chatleo-avatar {
|
|
95
|
+
--avatar-size: 36px;
|
|
96
|
+
}
|
package/dist/collection/components/chatleo-new-message-selector/chatleo-new-message-selector.js
ADDED
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
import { h } from "@stencil/core";
|
|
2
|
+
/**
|
|
3
|
+
* @component ChatLeoNewMessageSelector
|
|
4
|
+
* @description This component provides a UI for starting a new conversation. It displays a list of users that can be filtered by name. When a user is selected, it fires an event to notify the parent component.
|
|
5
|
+
* @property {ChatStore} chatStore - An instance of the `ChatStore` class, used to access the list of users and their presence information.
|
|
6
|
+
* @property {string} placeholder - The placeholder text to be displayed in the search input field.
|
|
7
|
+
* @fires userSelected - This event is emitted when a user is selected from the list. The event detail contains the `UserProfile` of the selected user.
|
|
8
|
+
* @fires doClose - This event is emitted when the user clicks the close button.
|
|
9
|
+
*/
|
|
10
|
+
export class ChatLeoNewMessageSelector {
|
|
11
|
+
/**
|
|
12
|
+
* An instance of the `ChatStore` class, used to access the list of users and their presence information.
|
|
13
|
+
*/
|
|
14
|
+
chatStore;
|
|
15
|
+
/**
|
|
16
|
+
* The placeholder text to be displayed in the search input field.
|
|
17
|
+
*/
|
|
18
|
+
placeholder = "Suche";
|
|
19
|
+
filterText = "";
|
|
20
|
+
filteredUsers = [];
|
|
21
|
+
_version = 0;
|
|
22
|
+
boundOnUserAdded = () => this.onUserAdded();
|
|
23
|
+
boundOnPresenceChange = () => this.onPresenceChange();
|
|
24
|
+
userSelected;
|
|
25
|
+
doClose;
|
|
26
|
+
/**
|
|
27
|
+
* @function onChatStoreChange
|
|
28
|
+
* @description A Stencil watcher that is called when the `chatStore` prop changes. It sets up event listeners on the new store to update the user list when users are added or their presence changes.
|
|
29
|
+
* @param {ChatStore} chatStore - The new `ChatStore` instance.
|
|
30
|
+
* @param {ChatStore} oldValue - The previous `ChatStore` instance.
|
|
31
|
+
*/
|
|
32
|
+
onChatStoreChange(chatStore, oldValue) {
|
|
33
|
+
this.unbindChatStore(oldValue);
|
|
34
|
+
this.bindChatStore(chatStore);
|
|
35
|
+
}
|
|
36
|
+
connectedCallback() {
|
|
37
|
+
this.bindChatStore(this.chatStore);
|
|
38
|
+
}
|
|
39
|
+
disconnectedCallback() {
|
|
40
|
+
this.unbindChatStore(this.chatStore);
|
|
41
|
+
}
|
|
42
|
+
bindChatStore(chatStore) {
|
|
43
|
+
if (!chatStore)
|
|
44
|
+
return;
|
|
45
|
+
chatStore.addEventListener('userAdded', this.boundOnUserAdded);
|
|
46
|
+
chatStore.addEventListener('presenceChanged', this.boundOnPresenceChange);
|
|
47
|
+
// Users are normally already in the store when the selector is opened, so seed
|
|
48
|
+
// the list from the current store contents rather than waiting for `userAdded`.
|
|
49
|
+
this.updateFilteredUsers();
|
|
50
|
+
}
|
|
51
|
+
unbindChatStore(chatStore) {
|
|
52
|
+
if (!chatStore)
|
|
53
|
+
return;
|
|
54
|
+
chatStore.removeEventListener('userAdded', this.boundOnUserAdded);
|
|
55
|
+
chatStore.removeEventListener('presenceChanged', this.boundOnPresenceChange);
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* @function onUserAdded
|
|
59
|
+
* @description This event handler is called when a new user is added to the `ChatStore`. It triggers an update of the filtered user list to include the new user.
|
|
60
|
+
*/
|
|
61
|
+
onUserAdded() {
|
|
62
|
+
// console.debug('User added', event);
|
|
63
|
+
this.updateFilteredUsers();
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* @function onPresenceChange
|
|
67
|
+
* @description This event handler is called when a user's presence status changes in the `ChatStore`. It increments a version counter to trigger a re-render of the component.
|
|
68
|
+
*/
|
|
69
|
+
onPresenceChange() {
|
|
70
|
+
console.debug('onPresenceChange');
|
|
71
|
+
this._version++;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* @function onDoClose
|
|
75
|
+
* @description This method is called when the user clicks the close button. It prevents the default event behavior and emits the `doClose` event to notify the parent component to close the selector.
|
|
76
|
+
* @param {Event} e - The click event from the close button.
|
|
77
|
+
*/
|
|
78
|
+
onDoClose(e) {
|
|
79
|
+
e.preventDefault();
|
|
80
|
+
this.doClose.emit();
|
|
81
|
+
}
|
|
82
|
+
onFilterChange = (event) => {
|
|
83
|
+
const input = event.target;
|
|
84
|
+
this.filterText = input.value.toLowerCase();
|
|
85
|
+
this.updateFilteredUsers();
|
|
86
|
+
};
|
|
87
|
+
/**
|
|
88
|
+
* @function updateFilteredUsers
|
|
89
|
+
* @description This method filters the list of users from the `ChatStore` based on the text entered in the search input. If the filter text is empty, it displays all users; otherwise, it shows only the users whose display name matches the filter text.
|
|
90
|
+
*/
|
|
91
|
+
updateFilteredUsers() {
|
|
92
|
+
const users = this.chatStore?.users ?? [];
|
|
93
|
+
const selfId = this.chatStore?.profile?.id;
|
|
94
|
+
const filterText = this.filterText;
|
|
95
|
+
this.filteredUsers = users.filter(user => {
|
|
96
|
+
if (user.id === selfId)
|
|
97
|
+
return false;
|
|
98
|
+
return !filterText || (user.display_name || '').toLowerCase().includes(filterText);
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
onUserSelected = (event) => {
|
|
102
|
+
const selectedUser = event.detail;
|
|
103
|
+
if (selectedUser) {
|
|
104
|
+
this.userSelected.emit(selectedUser);
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
/**
|
|
108
|
+
* @function render
|
|
109
|
+
* @description The render method for the `ChatLeoNewMessageSelector` component. It constructs the UI, including the header with a close button, the search input, and the list of filtered users. Each user is rendered using the `chatleo-user-tile` component.
|
|
110
|
+
* @returns {any} A VNode representing the component's UI.
|
|
111
|
+
*/
|
|
112
|
+
render() {
|
|
113
|
+
return (h("div", { key: 'ec5c9b8d53cce3ff5bc812dc4fc4ba3ab12bf6f8', class: "new-message-selector" }, h("div", { key: '62d0468365a42452ccdd3de9aad50aa79d8eb029', class: "title" }, "Neue Nachricht", h("button", { key: '74338599974c932922193040da99815d472d79da', class: "close-button", onClick: this.onDoClose.bind(this) }, h("svg", { key: 'c277fd2307e0fc618a4ea07146ac026828900cb7', width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h("path", { key: 'a30e06e02089d91366bc5bb9a653cf15ebb2f367', d: "M12 4L4 12", stroke: "#565D6D", "stroke-width": "1.37143", "stroke-miterlimit": "10", "stroke-linecap": "square" }), h("path", { key: 'f2583d2faf8f1ffefe43e273f2c07cde71dd5502', d: "M12 12L4 4", stroke: "#565D6D", "stroke-width": "1.37143", "stroke-miterlimit": "10", "stroke-linecap": "square" })))), h("div", { key: '04983dc0b38f3f7c2bf133dfdfd8aba9a57358e4', class: "search-container" }, h("input", { key: '77f351f89f4c78735d1ce34ef0f925d5bea92746', type: "text", class: "search-input", placeholder: this.placeholder, value: this.filterText, onInput: this.onFilterChange })), h("span", { key: '26ac88fea8e9855246a74e9196bd6da4c3ea1c88', class: "suggestions" }, "Vorschl\u00E4ge"), h("div", { key: '58f1bfe2385d0f7ecaace341c6575135d1c84e63', class: "users-list" }, this.filteredUsers.map(user => {
|
|
114
|
+
const isOnline = this.chatStore?.isOnline(user.id) ?? false;
|
|
115
|
+
return (h("chatleo-user-tile", { key: user.id, profile: user, isOnline: isOnline, lastSeen: undefined, onUserClicked: this.onUserSelected }));
|
|
116
|
+
}))));
|
|
117
|
+
}
|
|
118
|
+
static get is() { return "chatleo-new-message-selector"; }
|
|
119
|
+
static get encapsulation() { return "shadow"; }
|
|
120
|
+
static get originalStyleUrls() {
|
|
121
|
+
return {
|
|
122
|
+
"$": ["chatleo-new-message-selector.css"]
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
static get styleUrls() {
|
|
126
|
+
return {
|
|
127
|
+
"$": ["chatleo-new-message-selector.css"]
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
static get properties() {
|
|
131
|
+
return {
|
|
132
|
+
"chatStore": {
|
|
133
|
+
"type": "unknown",
|
|
134
|
+
"mutable": false,
|
|
135
|
+
"complexType": {
|
|
136
|
+
"original": "ChatStore",
|
|
137
|
+
"resolved": "ChatStore",
|
|
138
|
+
"references": {
|
|
139
|
+
"ChatStore": {
|
|
140
|
+
"location": "import",
|
|
141
|
+
"path": "@chat-leo/chatleolib",
|
|
142
|
+
"id": "../chatleolib/dist/ChatStore.d.ts::ChatStore",
|
|
143
|
+
"referenceLocation": "ChatStore"
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
"required": false,
|
|
148
|
+
"optional": true,
|
|
149
|
+
"docs": {
|
|
150
|
+
"tags": [],
|
|
151
|
+
"text": "An instance of the `ChatStore` class, used to access the list of users and their presence information."
|
|
152
|
+
},
|
|
153
|
+
"getter": false,
|
|
154
|
+
"setter": false
|
|
155
|
+
},
|
|
156
|
+
"placeholder": {
|
|
157
|
+
"type": "string",
|
|
158
|
+
"mutable": false,
|
|
159
|
+
"complexType": {
|
|
160
|
+
"original": "string",
|
|
161
|
+
"resolved": "string",
|
|
162
|
+
"references": {}
|
|
163
|
+
},
|
|
164
|
+
"required": false,
|
|
165
|
+
"optional": false,
|
|
166
|
+
"docs": {
|
|
167
|
+
"tags": [],
|
|
168
|
+
"text": "The placeholder text to be displayed in the search input field."
|
|
169
|
+
},
|
|
170
|
+
"getter": false,
|
|
171
|
+
"setter": false,
|
|
172
|
+
"reflect": false,
|
|
173
|
+
"attribute": "placeholder",
|
|
174
|
+
"defaultValue": "\"Suche\""
|
|
175
|
+
}
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
static get states() {
|
|
179
|
+
return {
|
|
180
|
+
"filterText": {},
|
|
181
|
+
"filteredUsers": {},
|
|
182
|
+
"_version": {}
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
static get events() {
|
|
186
|
+
return [{
|
|
187
|
+
"method": "userSelected",
|
|
188
|
+
"name": "userSelected",
|
|
189
|
+
"bubbles": true,
|
|
190
|
+
"cancelable": true,
|
|
191
|
+
"composed": true,
|
|
192
|
+
"docs": {
|
|
193
|
+
"tags": [],
|
|
194
|
+
"text": ""
|
|
195
|
+
},
|
|
196
|
+
"complexType": {
|
|
197
|
+
"original": "UserProfile",
|
|
198
|
+
"resolved": "{ id: string; display_name: string; profile_picture_url: string; }",
|
|
199
|
+
"references": {
|
|
200
|
+
"UserProfile": {
|
|
201
|
+
"location": "import",
|
|
202
|
+
"path": "@chat-leo/chatleolib",
|
|
203
|
+
"id": "../chatleolib/dist/index.d.ts::UserProfile",
|
|
204
|
+
"referenceLocation": "UserProfile"
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
}, {
|
|
209
|
+
"method": "doClose",
|
|
210
|
+
"name": "doClose",
|
|
211
|
+
"bubbles": true,
|
|
212
|
+
"cancelable": true,
|
|
213
|
+
"composed": true,
|
|
214
|
+
"docs": {
|
|
215
|
+
"tags": [],
|
|
216
|
+
"text": ""
|
|
217
|
+
},
|
|
218
|
+
"complexType": {
|
|
219
|
+
"original": "void",
|
|
220
|
+
"resolved": "void",
|
|
221
|
+
"references": {}
|
|
222
|
+
}
|
|
223
|
+
}];
|
|
224
|
+
}
|
|
225
|
+
static get watchers() {
|
|
226
|
+
return [{
|
|
227
|
+
"propName": "chatStore",
|
|
228
|
+
"methodName": "onChatStoreChange"
|
|
229
|
+
}];
|
|
230
|
+
}
|
|
231
|
+
}
|
|
@@ -0,0 +1,352 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
display: block;
|
|
3
|
+
/* Component-specific variables */
|
|
4
|
+
--rich-input-border-radius: 12px;
|
|
5
|
+
--rich-input-padding: 4px;
|
|
6
|
+
--attachment-item-radius: 8px;
|
|
7
|
+
--attachment-preview-size: 60px;
|
|
8
|
+
--min-input-height: 18px;
|
|
9
|
+
--max-input-height: 120px;
|
|
10
|
+
--transition-duration: 0.2s;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.rich-input-container {
|
|
14
|
+
position: relative;
|
|
15
|
+
background: var(--bg-primary, #ffffff);
|
|
16
|
+
/*border: 1px solid var(--border-color, #e1e5e9);*/
|
|
17
|
+
/*border-radius: var(--rich-input-border-radius);*/
|
|
18
|
+
/*transition: border-color var(--transition-duration) ease, box-shadow var(--transition-duration) ease;*/
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.rich-input-container:focus-within {
|
|
22
|
+
border-color: var(--accent-color, #4a86e8);
|
|
23
|
+
box-shadow: 0 0 0 2px rgba(74, 134, 232, 0.1);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.rich-input-container.drag-over {
|
|
27
|
+
border-color: var(--accent-color, #4a86e8);
|
|
28
|
+
background: var(--bg-light, #f8fafc);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/* Editor Area */
|
|
32
|
+
.editor-area {
|
|
33
|
+
padding: var(--rich-input-padding);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.editor-wrapper {
|
|
37
|
+
display: flex;
|
|
38
|
+
align-items: flex-end;
|
|
39
|
+
gap: 12px;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.rich-editor {
|
|
43
|
+
flex: 1;
|
|
44
|
+
min-height: var(--min-input-height);
|
|
45
|
+
max-height: var(--max-input-height, 200px);
|
|
46
|
+
overflow-y: auto;
|
|
47
|
+
padding: 12px 16px;
|
|
48
|
+
border: none;
|
|
49
|
+
outline: none;
|
|
50
|
+
background: var(--bg-secondary, #f8f9fa);
|
|
51
|
+
border-radius: 20px;
|
|
52
|
+
font-family: var(--font-primary, system-ui, sans-serif);
|
|
53
|
+
font-size: 14px;
|
|
54
|
+
line-height: 1.4;
|
|
55
|
+
color: var(--text-primary, #212529);
|
|
56
|
+
white-space: pre-wrap;
|
|
57
|
+
word-wrap: break-word;
|
|
58
|
+
resize: none;
|
|
59
|
+
transition: background-color var(--transition-duration) ease;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.rich-editor:focus {
|
|
63
|
+
/*background: var(--bg-primary, #ffffff);*/
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/* iOS zooms into an input whose font-size is below 16px. */
|
|
67
|
+
@media (max-width: 768px) {
|
|
68
|
+
.rich-editor {
|
|
69
|
+
font-size: 16px;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.rich-editor:empty::before {
|
|
74
|
+
content: attr(data-placeholder);
|
|
75
|
+
color: var(--text-secondary, #6c757d);
|
|
76
|
+
pointer-events: none;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.rich-editor:focus:empty::before {
|
|
80
|
+
content: '';
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/* Inline Attachment Blocks */
|
|
84
|
+
.attachment-block {
|
|
85
|
+
display: block;
|
|
86
|
+
background: var(--bg-secondary, #f8f9fa);
|
|
87
|
+
border: 1px solid var(--border-light, #e9ecef);
|
|
88
|
+
border-radius: var(--attachment-item-radius);
|
|
89
|
+
padding: 8px;
|
|
90
|
+
margin: 8px 0;
|
|
91
|
+
max-width: 300px;
|
|
92
|
+
position: relative;
|
|
93
|
+
box-sizing: border-box;
|
|
94
|
+
/* Prevent text selection and editing */
|
|
95
|
+
user-select: none;
|
|
96
|
+
-webkit-user-select: none;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.attachment-block .attachment-content {
|
|
100
|
+
display: flex;
|
|
101
|
+
flex-direction: column;
|
|
102
|
+
gap: 8px;
|
|
103
|
+
flex: 1;
|
|
104
|
+
min-width: 0;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.attachment-item {
|
|
108
|
+
display: flex;
|
|
109
|
+
align-items: center;
|
|
110
|
+
gap: 8px;
|
|
111
|
+
position: relative;
|
|
112
|
+
min-width: 0;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.attachment-block .attachment-thumbnail {
|
|
116
|
+
width: var(--attachment-preview-size);
|
|
117
|
+
height: var(--attachment-preview-size);
|
|
118
|
+
object-fit: cover;
|
|
119
|
+
border-radius: 4px;
|
|
120
|
+
flex-shrink: 0;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.attachment-item .attachment-thumbnail {
|
|
124
|
+
width: var(--attachment-preview-size);
|
|
125
|
+
height: var(--attachment-preview-size);
|
|
126
|
+
object-fit: cover;
|
|
127
|
+
border-radius: 4px;
|
|
128
|
+
flex-shrink: 0;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.attachment-block .attachment-icon {
|
|
132
|
+
width: var(--attachment-preview-size);
|
|
133
|
+
height: var(--attachment-preview-size);
|
|
134
|
+
display: flex;
|
|
135
|
+
align-items: center;
|
|
136
|
+
justify-content: center;
|
|
137
|
+
background: var(--bg-light, #f1f3f4);
|
|
138
|
+
border-radius: 4px;
|
|
139
|
+
color: var(--text-secondary, #6c757d);
|
|
140
|
+
flex-shrink: 0;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.attachment-item .attachment-icon {
|
|
144
|
+
width: var(--attachment-preview-size);
|
|
145
|
+
height: var(--attachment-preview-size);
|
|
146
|
+
display: flex;
|
|
147
|
+
align-items: center;
|
|
148
|
+
justify-content: center;
|
|
149
|
+
background: var(--bg-light, #f1f3f4);
|
|
150
|
+
border-radius: 4px;
|
|
151
|
+
color: var(--text-secondary, #6c757d);
|
|
152
|
+
flex-shrink: 0;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.attachment-block .attachment-info {
|
|
156
|
+
flex: 1;
|
|
157
|
+
min-width: 0;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.attachment-item .attachment-info {
|
|
161
|
+
flex: 1;
|
|
162
|
+
min-width: 0;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
.attachment-block .attachment-name {
|
|
166
|
+
font-size: 12px;
|
|
167
|
+
font-weight: 500;
|
|
168
|
+
color: var(--text-primary, #212529);
|
|
169
|
+
white-space: nowrap;
|
|
170
|
+
overflow: hidden;
|
|
171
|
+
text-overflow: ellipsis;
|
|
172
|
+
line-height: 1.3;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
.attachment-item .attachment-name {
|
|
176
|
+
font-size: 12px;
|
|
177
|
+
font-weight: 500;
|
|
178
|
+
color: var(--text-primary, #212529);
|
|
179
|
+
white-space: nowrap;
|
|
180
|
+
overflow: hidden;
|
|
181
|
+
text-overflow: ellipsis;
|
|
182
|
+
line-height: 1.3;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
.attachment-block .attachment-size {
|
|
186
|
+
font-size: 11px;
|
|
187
|
+
color: var(--text-secondary, #6c757d);
|
|
188
|
+
line-height: 1.2;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
.attachment-item .attachment-size {
|
|
192
|
+
font-size: 11px;
|
|
193
|
+
color: var(--text-secondary, #6c757d);
|
|
194
|
+
line-height: 1.2;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
.attachment-block .attachment-remove {
|
|
198
|
+
position: absolute;
|
|
199
|
+
top: -6px;
|
|
200
|
+
right: -6px;
|
|
201
|
+
width: 20px;
|
|
202
|
+
height: 20px;
|
|
203
|
+
border: none;
|
|
204
|
+
background: var(--bg-primary, #ffffff);
|
|
205
|
+
border-radius: 50%;
|
|
206
|
+
display: flex;
|
|
207
|
+
align-items: center;
|
|
208
|
+
justify-content: center;
|
|
209
|
+
cursor: pointer;
|
|
210
|
+
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
|
211
|
+
color: var(--text-secondary, #6c757d);
|
|
212
|
+
transition: all var(--transition-duration) ease;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
.attachment-item .attachment-remove {
|
|
216
|
+
position: absolute;
|
|
217
|
+
top: -6px;
|
|
218
|
+
right: -6px;
|
|
219
|
+
width: 20px;
|
|
220
|
+
height: 20px;
|
|
221
|
+
border: none;
|
|
222
|
+
background: var(--bg-primary, #ffffff);
|
|
223
|
+
border-radius: 50%;
|
|
224
|
+
display: flex;
|
|
225
|
+
align-items: center;
|
|
226
|
+
justify-content: center;
|
|
227
|
+
cursor: pointer;
|
|
228
|
+
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
|
229
|
+
color: var(--text-secondary, #6c757d);
|
|
230
|
+
transition: all var(--transition-duration) ease;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
.attachment-block .attachment-remove:hover {
|
|
234
|
+
background: #dc3545;
|
|
235
|
+
color: white;
|
|
236
|
+
transform: scale(1.1);
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
.attachment-item .attachment-remove:hover {
|
|
240
|
+
background: #dc3545;
|
|
241
|
+
color: white;
|
|
242
|
+
transform: scale(1.1);
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
/* Scrollbar styling for the rich editor */
|
|
246
|
+
.rich-editor::-webkit-scrollbar {
|
|
247
|
+
width: 4px;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
.rich-editor::-webkit-scrollbar-track {
|
|
251
|
+
background: transparent;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
.rich-editor::-webkit-scrollbar-thumb {
|
|
255
|
+
background: var(--border-color, #dee2e6);
|
|
256
|
+
border-radius: 2px;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
.rich-editor::-webkit-scrollbar-thumb:hover {
|
|
260
|
+
background: var(--text-secondary, #6c757d);
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
/* Input Actions */
|
|
264
|
+
.input-actions {
|
|
265
|
+
display: flex;
|
|
266
|
+
flex-direction: row;
|
|
267
|
+
align-items: flex-end;
|
|
268
|
+
gap: 2px;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
.action-button {
|
|
272
|
+
width: 36px;
|
|
273
|
+
height: 36px;
|
|
274
|
+
border: none;
|
|
275
|
+
background: transparent;
|
|
276
|
+
border-radius: 18px;
|
|
277
|
+
cursor: pointer;
|
|
278
|
+
display: flex;
|
|
279
|
+
align-items: center;
|
|
280
|
+
justify-content: center;
|
|
281
|
+
color: var(--accent-color, #4a86e8);
|
|
282
|
+
transition: all var(--transition-duration) ease;
|
|
283
|
+
flex-shrink: 0;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
.action-button:hover:not(:disabled) {
|
|
287
|
+
background: var(--bg-light, #f1f3f4);
|
|
288
|
+
transform: scale(1.05);
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
.action-button:disabled {
|
|
292
|
+
color: var(--text-secondary, #6c757d);
|
|
293
|
+
cursor: not-allowed;
|
|
294
|
+
opacity: 0.5;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
.send-button:not(:disabled) {
|
|
298
|
+
/*background: var(--accent-color, #4a86e8);*/
|
|
299
|
+
color: white;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
.send-button:hover:not(:disabled) {
|
|
303
|
+
background: var(--accent-hover, #3d71d9);
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
/* Drag Overlay */
|
|
307
|
+
.drag-overlay {
|
|
308
|
+
position: absolute;
|
|
309
|
+
top: 0;
|
|
310
|
+
left: 0;
|
|
311
|
+
right: 0;
|
|
312
|
+
bottom: 0;
|
|
313
|
+
background: rgba(74, 134, 232, 0.05);
|
|
314
|
+
border: 2px dashed var(--accent-color, #4a86e8);
|
|
315
|
+
border-radius: var(--rich-input-border-radius);
|
|
316
|
+
display: flex;
|
|
317
|
+
align-items: center;
|
|
318
|
+
justify-content: center;
|
|
319
|
+
z-index: 10;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
.drag-content {
|
|
323
|
+
text-align: center;
|
|
324
|
+
color: var(--accent-color, #4a86e8);
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
.drag-content svg {
|
|
328
|
+
margin-bottom: 8px;
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
.drag-content p {
|
|
332
|
+
margin: 0;
|
|
333
|
+
font-size: 14px;
|
|
334
|
+
font-weight: 500;
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
/* Responsive adjustments */
|
|
338
|
+
@media (max-width: 768px) {
|
|
339
|
+
:host {
|
|
340
|
+
--rich-input-padding: 12px;
|
|
341
|
+
--attachment-preview-size: 48px;
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
.attachment-block {
|
|
345
|
+
max-width: 260px;
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
.action-button {
|
|
349
|
+
width: 32px;
|
|
350
|
+
height: 32px;
|
|
351
|
+
}
|
|
352
|
+
}
|