@vaadin/message-list 23.2.0 → 23.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +7 -7
- package/src/vaadin-message-list.js +5 -0
- package/src/vaadin-message.d.ts +4 -0
- package/src/vaadin-message.js +4 -0
- package/web-types.json +2 -2
- package/web-types.lit.json +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/message-list",
|
|
3
|
-
"version": "23.2.
|
|
3
|
+
"version": "23.2.1",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -38,11 +38,11 @@
|
|
|
38
38
|
],
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"@polymer/polymer": "^3.0.0",
|
|
41
|
-
"@vaadin/avatar": "
|
|
42
|
-
"@vaadin/component-base": "
|
|
43
|
-
"@vaadin/vaadin-lumo-styles": "
|
|
44
|
-
"@vaadin/vaadin-material-styles": "
|
|
45
|
-
"@vaadin/vaadin-themable-mixin": "
|
|
41
|
+
"@vaadin/avatar": "~23.2.1",
|
|
42
|
+
"@vaadin/component-base": "~23.2.1",
|
|
43
|
+
"@vaadin/vaadin-lumo-styles": "~23.2.1",
|
|
44
|
+
"@vaadin/vaadin-material-styles": "~23.2.1",
|
|
45
|
+
"@vaadin/vaadin-themable-mixin": "~23.2.1"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@esm-bundle/chai": "^4.3.4",
|
|
@@ -53,5 +53,5 @@
|
|
|
53
53
|
"web-types.json",
|
|
54
54
|
"web-types.lit.json"
|
|
55
55
|
],
|
|
56
|
-
"gitHead": "
|
|
56
|
+
"gitHead": "a6c314f6927bfd3309fc735eae6c6dc72ab8367a"
|
|
57
57
|
}
|
|
@@ -118,6 +118,7 @@ class MessageList extends ElementMixin(ThemableMixin(PolymerElement)) {
|
|
|
118
118
|
return Array.from(this.shadowRoot.querySelectorAll('vaadin-message'));
|
|
119
119
|
}
|
|
120
120
|
|
|
121
|
+
/** @private */
|
|
121
122
|
_itemsChanged(newVal, oldVal) {
|
|
122
123
|
const focusedIndex = this._getIndexOfFocusableElement();
|
|
123
124
|
if (newVal && newVal.length) {
|
|
@@ -132,6 +133,7 @@ class MessageList extends ElementMixin(ThemableMixin(PolymerElement)) {
|
|
|
132
133
|
}
|
|
133
134
|
}
|
|
134
135
|
|
|
136
|
+
/** @private */
|
|
135
137
|
_scrollToLastMessage() {
|
|
136
138
|
if (this.items.length > 0) {
|
|
137
139
|
this.scrollTop = this.scrollHeight - this.clientHeight;
|
|
@@ -186,6 +188,7 @@ class MessageList extends ElementMixin(ThemableMixin(PolymerElement)) {
|
|
|
186
188
|
target.focus();
|
|
187
189
|
}
|
|
188
190
|
|
|
191
|
+
/** @private */
|
|
189
192
|
_handleFocusEvent(e) {
|
|
190
193
|
const target = e.composedPath().find((node) => node instanceof Message);
|
|
191
194
|
this._setTabIndexesByMessage(target);
|
|
@@ -200,12 +203,14 @@ class MessageList extends ElementMixin(ThemableMixin(PolymerElement)) {
|
|
|
200
203
|
this._setTabIndexesByMessage(message);
|
|
201
204
|
}
|
|
202
205
|
|
|
206
|
+
/** @private */
|
|
203
207
|
_setTabIndexesByMessage(message) {
|
|
204
208
|
this._messages.forEach((e) => {
|
|
205
209
|
e.tabIndex = e === message ? 0 : -1;
|
|
206
210
|
});
|
|
207
211
|
}
|
|
208
212
|
|
|
213
|
+
/** @private */
|
|
209
214
|
_getIndexOfFocusableElement() {
|
|
210
215
|
const index = this._messages.findIndex((e) => e.tabIndex === 0);
|
|
211
216
|
return index !== -1 ? index : 0;
|
package/src/vaadin-message.d.ts
CHANGED
|
@@ -56,6 +56,7 @@ declare class Message extends FocusMixin(ThemableMixin(ElementMixin(HTMLElement)
|
|
|
56
56
|
* It will be placed in the name part to indicate who has sent the message.
|
|
57
57
|
* It is also used as a tooltip for the avatar.
|
|
58
58
|
* Example: `message.userName = "Jessica Jacobs";`
|
|
59
|
+
* @attr {string} user-name
|
|
59
60
|
*/
|
|
60
61
|
userName: string | null | undefined;
|
|
61
62
|
|
|
@@ -64,6 +65,7 @@ declare class Message extends FocusMixin(ThemableMixin(ElementMixin(HTMLElement)
|
|
|
64
65
|
* The abbreviation will be passed on to avatar of the message.
|
|
65
66
|
* If the user does not have an avatar picture set with `userImg`, `userAbbr` will be shown in the avatar.
|
|
66
67
|
* Example: `message.userAbbr = "JJ";`
|
|
68
|
+
* @attr {string} user-abbr
|
|
67
69
|
*/
|
|
68
70
|
userAbbr: string | null | undefined;
|
|
69
71
|
|
|
@@ -71,6 +73,7 @@ declare class Message extends FocusMixin(ThemableMixin(ElementMixin(HTMLElement)
|
|
|
71
73
|
* An URL for a user image.
|
|
72
74
|
* The image will be used in the avatar component to show who has sent the message.
|
|
73
75
|
* Example: `message.userImg = "/static/img/avatar.jpg";`
|
|
76
|
+
* @attr {string} user-img
|
|
74
77
|
*/
|
|
75
78
|
userImg: string | null | undefined;
|
|
76
79
|
|
|
@@ -92,6 +95,7 @@ declare class Message extends FocusMixin(ThemableMixin(ElementMixin(HTMLElement)
|
|
|
92
95
|
* ```js
|
|
93
96
|
* message.userColorIndex = 1;
|
|
94
97
|
* ```
|
|
98
|
+
* @attr {number} user-color-index
|
|
95
99
|
*/
|
|
96
100
|
userColorIndex: number | null | undefined;
|
|
97
101
|
}
|
package/src/vaadin-message.js
CHANGED
|
@@ -67,6 +67,7 @@ class Message extends FocusMixin(ElementMixin(ThemableMixin(PolymerElement))) {
|
|
|
67
67
|
* It will be placed in the name part to indicate who has sent the message.
|
|
68
68
|
* It is also used as a tooltip for the avatar.
|
|
69
69
|
* Example: `message.userName = "Jessica Jacobs";`
|
|
70
|
+
* @attr {string} user-name
|
|
70
71
|
*/
|
|
71
72
|
userName: {
|
|
72
73
|
type: String,
|
|
@@ -77,6 +78,7 @@ class Message extends FocusMixin(ElementMixin(ThemableMixin(PolymerElement))) {
|
|
|
77
78
|
* The abbreviation will be passed on to avatar of the message.
|
|
78
79
|
* If the user does not have an avatar picture set with `userImg`, `userAbbr` will be shown in the avatar.
|
|
79
80
|
* Example: `message.userAbbr = "JJ";`
|
|
81
|
+
* @attr {string} user-abbr
|
|
80
82
|
*/
|
|
81
83
|
userAbbr: {
|
|
82
84
|
type: String,
|
|
@@ -86,6 +88,7 @@ class Message extends FocusMixin(ElementMixin(ThemableMixin(PolymerElement))) {
|
|
|
86
88
|
* An URL for a user image.
|
|
87
89
|
* The image will be used in the avatar component to show who has sent the message.
|
|
88
90
|
* Example: `message.userImg = "/static/img/avatar.jpg";`
|
|
91
|
+
* @attr {string} user-img
|
|
89
92
|
*/
|
|
90
93
|
userImg: {
|
|
91
94
|
type: String,
|
|
@@ -109,6 +112,7 @@ class Message extends FocusMixin(ElementMixin(ThemableMixin(PolymerElement))) {
|
|
|
109
112
|
* ```js
|
|
110
113
|
* message.userColorIndex = 1;
|
|
111
114
|
* ```
|
|
115
|
+
* @attr {number} user-color-index
|
|
112
116
|
*/
|
|
113
117
|
userColorIndex: {
|
|
114
118
|
type: Number,
|
package/web-types.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/web-types",
|
|
3
3
|
"name": "@vaadin/message-list",
|
|
4
|
-
"version": "23.2.
|
|
4
|
+
"version": "23.2.1",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"contributions": {
|
|
7
7
|
"html": {
|
|
8
8
|
"elements": [
|
|
9
9
|
{
|
|
10
10
|
"name": "vaadin-message",
|
|
11
|
-
"description": "`<vaadin-message>` is a Web Component for showing a single message with an author, message and time.\n\n```html\n<vaadin-message time=\"2021-01-28 10:43\"\n user-name = \"Bob Ross\"\n user-abbr = \"BR\"\n user-img = \"/static/img/avatar.jpg\">There is no real ending. It's just the place where you stop the story.</vaadin-message>\n```\n\n### Styling\n\nThe following shadow DOM parts are available for styling:\n\nPart name | Description\n----------|----------------\n`avatar` | The author's avatar\n`name` | Author's name\n`time` | When the message was posted\n`content` | The message itself as a slotted content\n\nThe following state attributes are available for styling:\n\nAttribute | Description\n-------------|-------------\n`focus-ring` | Set when the message is focused using the keyboard.\n`focused` | Set when the message is focused.\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/custom-theme/styling-components) documentation.\n\n### Internal components\n\nIn addition to `<vaadin-message>` itself, the following internal\ncomponents are themable:\n\n- `<vaadin-message-avatar>` - has the same API as [`<vaadin-avatar>`](https://cdn.vaadin.com/vaadin-web-components/23.2.
|
|
11
|
+
"description": "`<vaadin-message>` is a Web Component for showing a single message with an author, message and time.\n\n```html\n<vaadin-message time=\"2021-01-28 10:43\"\n user-name = \"Bob Ross\"\n user-abbr = \"BR\"\n user-img = \"/static/img/avatar.jpg\">There is no real ending. It's just the place where you stop the story.</vaadin-message>\n```\n\n### Styling\n\nThe following shadow DOM parts are available for styling:\n\nPart name | Description\n----------|----------------\n`avatar` | The author's avatar\n`name` | Author's name\n`time` | When the message was posted\n`content` | The message itself as a slotted content\n\nThe following state attributes are available for styling:\n\nAttribute | Description\n-------------|-------------\n`focus-ring` | Set when the message is focused using the keyboard.\n`focused` | Set when the message is focused.\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/custom-theme/styling-components) documentation.\n\n### Internal components\n\nIn addition to `<vaadin-message>` itself, the following internal\ncomponents are themable:\n\n- `<vaadin-message-avatar>` - has the same API as [`<vaadin-avatar>`](https://cdn.vaadin.com/vaadin-web-components/23.2.1/#/elements/vaadin-avatar).",
|
|
12
12
|
"attributes": [
|
|
13
13
|
{
|
|
14
14
|
"name": "time",
|
package/web-types.lit.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/web-types",
|
|
3
3
|
"name": "@vaadin/message-list",
|
|
4
|
-
"version": "23.2.
|
|
4
|
+
"version": "23.2.1",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"framework": "lit",
|
|
7
7
|
"framework-config": {
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"elements": [
|
|
17
17
|
{
|
|
18
18
|
"name": "vaadin-message",
|
|
19
|
-
"description": "`<vaadin-message>` is a Web Component for showing a single message with an author, message and time.\n\n```html\n<vaadin-message time=\"2021-01-28 10:43\"\n user-name = \"Bob Ross\"\n user-abbr = \"BR\"\n user-img = \"/static/img/avatar.jpg\">There is no real ending. It's just the place where you stop the story.</vaadin-message>\n```\n\n### Styling\n\nThe following shadow DOM parts are available for styling:\n\nPart name | Description\n----------|----------------\n`avatar` | The author's avatar\n`name` | Author's name\n`time` | When the message was posted\n`content` | The message itself as a slotted content\n\nThe following state attributes are available for styling:\n\nAttribute | Description\n-------------|-------------\n`focus-ring` | Set when the message is focused using the keyboard.\n`focused` | Set when the message is focused.\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/custom-theme/styling-components) documentation.\n\n### Internal components\n\nIn addition to `<vaadin-message>` itself, the following internal\ncomponents are themable:\n\n- `<vaadin-message-avatar>` - has the same API as [`<vaadin-avatar>`](https://cdn.vaadin.com/vaadin-web-components/23.2.
|
|
19
|
+
"description": "`<vaadin-message>` is a Web Component for showing a single message with an author, message and time.\n\n```html\n<vaadin-message time=\"2021-01-28 10:43\"\n user-name = \"Bob Ross\"\n user-abbr = \"BR\"\n user-img = \"/static/img/avatar.jpg\">There is no real ending. It's just the place where you stop the story.</vaadin-message>\n```\n\n### Styling\n\nThe following shadow DOM parts are available for styling:\n\nPart name | Description\n----------|----------------\n`avatar` | The author's avatar\n`name` | Author's name\n`time` | When the message was posted\n`content` | The message itself as a slotted content\n\nThe following state attributes are available for styling:\n\nAttribute | Description\n-------------|-------------\n`focus-ring` | Set when the message is focused using the keyboard.\n`focused` | Set when the message is focused.\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/custom-theme/styling-components) documentation.\n\n### Internal components\n\nIn addition to `<vaadin-message>` itself, the following internal\ncomponents are themable:\n\n- `<vaadin-message-avatar>` - has the same API as [`<vaadin-avatar>`](https://cdn.vaadin.com/vaadin-web-components/23.2.1/#/elements/vaadin-avatar).",
|
|
20
20
|
"extension": true,
|
|
21
21
|
"attributes": [
|
|
22
22
|
{
|