@vaadin/message-list 24.8.0-alpha18 → 24.8.0-alpha19
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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/message-list",
|
|
3
|
-
"version": "24.8.0-
|
|
3
|
+
"version": "24.8.0-alpha19",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -39,18 +39,18 @@
|
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"@open-wc/dedupe-mixin": "^1.3.0",
|
|
41
41
|
"@polymer/polymer": "^3.0.0",
|
|
42
|
-
"@vaadin/a11y-base": "24.8.0-
|
|
43
|
-
"@vaadin/avatar": "24.8.0-
|
|
44
|
-
"@vaadin/component-base": "24.8.0-
|
|
45
|
-
"@vaadin/markdown": "24.8.0-
|
|
46
|
-
"@vaadin/vaadin-lumo-styles": "24.8.0-
|
|
47
|
-
"@vaadin/vaadin-material-styles": "24.8.0-
|
|
48
|
-
"@vaadin/vaadin-themable-mixin": "24.8.0-
|
|
42
|
+
"@vaadin/a11y-base": "24.8.0-alpha19",
|
|
43
|
+
"@vaadin/avatar": "24.8.0-alpha19",
|
|
44
|
+
"@vaadin/component-base": "24.8.0-alpha19",
|
|
45
|
+
"@vaadin/markdown": "24.8.0-alpha19",
|
|
46
|
+
"@vaadin/vaadin-lumo-styles": "24.8.0-alpha19",
|
|
47
|
+
"@vaadin/vaadin-material-styles": "24.8.0-alpha19",
|
|
48
|
+
"@vaadin/vaadin-themable-mixin": "24.8.0-alpha19",
|
|
49
49
|
"lit": "^3.0.0"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
|
-
"@vaadin/chai-plugins": "24.8.0-
|
|
53
|
-
"@vaadin/test-runner-commands": "24.8.0-
|
|
52
|
+
"@vaadin/chai-plugins": "24.8.0-alpha19",
|
|
53
|
+
"@vaadin/test-runner-commands": "24.8.0-alpha19",
|
|
54
54
|
"@vaadin/testing-helpers": "^1.1.0",
|
|
55
55
|
"sinon": "^18.0.0"
|
|
56
56
|
},
|
|
@@ -58,5 +58,5 @@
|
|
|
58
58
|
"web-types.json",
|
|
59
59
|
"web-types.lit.json"
|
|
60
60
|
],
|
|
61
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "b66da924889a1316f7881742a13b80e1c95a4cc4"
|
|
62
62
|
}
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import type { Constructor } from '@open-wc/dedupe-mixin';
|
|
7
7
|
import type { KeyboardDirectionMixinClass } from '@vaadin/a11y-base/src/keyboard-direction-mixin.js';
|
|
8
|
+
import type { SlotStylesMixinClass } from '@vaadin/component-base/src/slot-styles-mixin.js';
|
|
8
9
|
|
|
9
10
|
export interface MessageListItem {
|
|
10
11
|
text?: string;
|
|
@@ -19,7 +20,10 @@ export interface MessageListItem {
|
|
|
19
20
|
|
|
20
21
|
export declare function MessageListMixin<T extends Constructor<HTMLElement>>(
|
|
21
22
|
base: T,
|
|
22
|
-
): Constructor<KeyboardDirectionMixinClass> &
|
|
23
|
+
): Constructor<KeyboardDirectionMixinClass> &
|
|
24
|
+
Constructor<MessageListMixinClass> &
|
|
25
|
+
Constructor<SlotStylesMixinClass> &
|
|
26
|
+
T;
|
|
23
27
|
|
|
24
28
|
export declare class MessageListMixinClass {
|
|
25
29
|
/**
|
|
@@ -44,4 +48,10 @@ export declare class MessageListMixinClass {
|
|
|
44
48
|
* When set to `true`, the message text is parsed as Markdown.
|
|
45
49
|
*/
|
|
46
50
|
markdown: boolean | undefined;
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* When set to `true`, new messages are announced to assistive technologies using ARIA live regions.
|
|
54
|
+
* @attr {boolean} announce-messages
|
|
55
|
+
*/
|
|
56
|
+
announceMessages: boolean | undefined;
|
|
47
57
|
}
|
|
@@ -6,13 +6,15 @@
|
|
|
6
6
|
import { html, render } from 'lit';
|
|
7
7
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
8
8
|
import { KeyboardDirectionMixin } from '@vaadin/a11y-base/src/keyboard-direction-mixin.js';
|
|
9
|
+
import { SlotStylesMixin } from '@vaadin/component-base/src/slot-styles-mixin';
|
|
9
10
|
|
|
10
11
|
/**
|
|
11
12
|
* @polymerMixin
|
|
12
13
|
* @mixes KeyboardDirectionMixin
|
|
14
|
+
* @mixes SlotStylesMixin
|
|
13
15
|
*/
|
|
14
16
|
export const MessageListMixin = (superClass) =>
|
|
15
|
-
class MessageListMixinClass extends KeyboardDirectionMixin(superClass) {
|
|
17
|
+
class MessageListMixinClass extends SlotStylesMixin(KeyboardDirectionMixin(superClass)) {
|
|
16
18
|
static get properties() {
|
|
17
19
|
return {
|
|
18
20
|
/**
|
|
@@ -47,6 +49,18 @@ export const MessageListMixin = (superClass) =>
|
|
|
47
49
|
observer: '__markdownChanged',
|
|
48
50
|
reflectToAttribute: true,
|
|
49
51
|
},
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* When set to `true`, new messages are announced to assistive technologies using ARIA live regions.
|
|
55
|
+
* @attr {boolean} announce-messages
|
|
56
|
+
* @type {boolean}
|
|
57
|
+
*/
|
|
58
|
+
announceMessages: {
|
|
59
|
+
type: Boolean,
|
|
60
|
+
value: false,
|
|
61
|
+
observer: '__announceChanged',
|
|
62
|
+
sync: true,
|
|
63
|
+
},
|
|
50
64
|
};
|
|
51
65
|
}
|
|
52
66
|
|
|
@@ -61,7 +75,23 @@ export const MessageListMixin = (superClass) =>
|
|
|
61
75
|
|
|
62
76
|
// Make screen readers announce new messages
|
|
63
77
|
this.setAttribute('aria-relevant', 'additions');
|
|
64
|
-
this.setAttribute('role', '
|
|
78
|
+
this.setAttribute('role', 'region');
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/** @protected */
|
|
82
|
+
get slotStyles() {
|
|
83
|
+
const tag = this.localName;
|
|
84
|
+
return [
|
|
85
|
+
`
|
|
86
|
+
${tag} :where(vaadin-markdown > :is(h1, h2, h3, h4, h5, h6, p, ul, ol):first-child) {
|
|
87
|
+
margin-top: 0;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
${tag} :where(vaadin-markdown > :is(h1, h2, h3, h4, h5, h6, p, ul, ol):last-child) {
|
|
91
|
+
margin-bottom: 0;
|
|
92
|
+
}
|
|
93
|
+
`,
|
|
94
|
+
];
|
|
65
95
|
}
|
|
66
96
|
|
|
67
97
|
/**
|
|
@@ -175,4 +205,9 @@ export const MessageListMixin = (superClass) =>
|
|
|
175
205
|
const index = this._messages.findIndex((e) => e.tabIndex === 0);
|
|
176
206
|
return index !== -1 ? index : 0;
|
|
177
207
|
}
|
|
208
|
+
|
|
209
|
+
/** @private */
|
|
210
|
+
__announceChanged(announceMessages) {
|
|
211
|
+
this.ariaLive = announceMessages ? 'polite' : null;
|
|
212
|
+
}
|
|
178
213
|
};
|
package/web-types.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": "24.8.0-
|
|
4
|
+
"version": "24.8.0-alpha19",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"contributions": {
|
|
7
7
|
"html": {
|
|
@@ -140,7 +140,7 @@
|
|
|
140
140
|
},
|
|
141
141
|
{
|
|
142
142
|
"name": "vaadin-message-list",
|
|
143
|
-
"description": "`<vaadin-message-list>` is a Web Component for showing an ordered list of messages. The messages are rendered as <vaadin-message>\n\n### Example\n\nTo create a new message list, add the component to the page:\n\n```html\n<vaadin-message-list></vaadin-message-list>\n```\n\nProvide the messages to the message list with the [`items`](https://cdn.vaadin.com/vaadin-web-components/24.8.0-
|
|
143
|
+
"description": "`<vaadin-message-list>` is a Web Component for showing an ordered list of messages. The messages are rendered as <vaadin-message>\n\n### Example\n\nTo create a new message list, add the component to the page:\n\n```html\n<vaadin-message-list></vaadin-message-list>\n```\n\nProvide the messages to the message list with the [`items`](https://cdn.vaadin.com/vaadin-web-components/24.8.0-alpha19/#/elements/vaadin-message-list#property-items) property.\n\n```js\ndocument.querySelector('vaadin-message-list').items = [\n { text: 'Hello list', time: 'yesterday', userName: 'Matt Mambo', userAbbr: 'MM', userColorIndex: 1 },\n { text: 'Another message', time: 'right now', userName: 'Linsey Listy', userAbbr: 'LL', userColorIndex: 2, userImg: '/static/img/avatar.jpg' }\n];\n```\n\n### Styling\n\nThe following shadow DOM parts are available for styling:\n\nPart name | Description\n----------|----------------\n`list` | The container wrapping messages.\n\nSee the [`<vaadin-message>`](https://cdn.vaadin.com/vaadin-web-components/24.8.0-alpha19/#/elements/vaadin-message) documentation for the available\nstate attributes and stylable shadow parts of message elements.\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
|
|
144
144
|
"attributes": [
|
|
145
145
|
{
|
|
146
146
|
"name": "markdown",
|
|
@@ -151,6 +151,15 @@
|
|
|
151
151
|
]
|
|
152
152
|
}
|
|
153
153
|
},
|
|
154
|
+
{
|
|
155
|
+
"name": "announce-messages",
|
|
156
|
+
"description": "When set to `true`, new messages are announced to assistive technologies using ARIA live regions.",
|
|
157
|
+
"value": {
|
|
158
|
+
"type": [
|
|
159
|
+
"boolean"
|
|
160
|
+
]
|
|
161
|
+
}
|
|
162
|
+
},
|
|
154
163
|
{
|
|
155
164
|
"name": "theme",
|
|
156
165
|
"description": "The theme variants to apply to the component.",
|
|
@@ -184,6 +193,15 @@
|
|
|
184
193
|
"boolean"
|
|
185
194
|
]
|
|
186
195
|
}
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
"name": "announceMessages",
|
|
199
|
+
"description": "When set to `true`, new messages are announced to assistive technologies using ARIA live regions.",
|
|
200
|
+
"value": {
|
|
201
|
+
"type": [
|
|
202
|
+
"boolean"
|
|
203
|
+
]
|
|
204
|
+
}
|
|
187
205
|
}
|
|
188
206
|
],
|
|
189
207
|
"events": []
|
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": "24.8.0-
|
|
4
|
+
"version": "24.8.0-alpha19",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"framework": "lit",
|
|
7
7
|
"framework-config": {
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
},
|
|
59
59
|
{
|
|
60
60
|
"name": "vaadin-message-list",
|
|
61
|
-
"description": "`<vaadin-message-list>` is a Web Component for showing an ordered list of messages. The messages are rendered as <vaadin-message>\n\n### Example\n\nTo create a new message list, add the component to the page:\n\n```html\n<vaadin-message-list></vaadin-message-list>\n```\n\nProvide the messages to the message list with the [`items`](https://cdn.vaadin.com/vaadin-web-components/24.8.0-
|
|
61
|
+
"description": "`<vaadin-message-list>` is a Web Component for showing an ordered list of messages. The messages are rendered as <vaadin-message>\n\n### Example\n\nTo create a new message list, add the component to the page:\n\n```html\n<vaadin-message-list></vaadin-message-list>\n```\n\nProvide the messages to the message list with the [`items`](https://cdn.vaadin.com/vaadin-web-components/24.8.0-alpha19/#/elements/vaadin-message-list#property-items) property.\n\n```js\ndocument.querySelector('vaadin-message-list').items = [\n { text: 'Hello list', time: 'yesterday', userName: 'Matt Mambo', userAbbr: 'MM', userColorIndex: 1 },\n { text: 'Another message', time: 'right now', userName: 'Linsey Listy', userAbbr: 'LL', userColorIndex: 2, userImg: '/static/img/avatar.jpg' }\n];\n```\n\n### Styling\n\nThe following shadow DOM parts are available for styling:\n\nPart name | Description\n----------|----------------\n`list` | The container wrapping messages.\n\nSee the [`<vaadin-message>`](https://cdn.vaadin.com/vaadin-web-components/24.8.0-alpha19/#/elements/vaadin-message) documentation for the available\nstate attributes and stylable shadow parts of message elements.\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
|
|
62
62
|
"extension": true,
|
|
63
63
|
"attributes": [
|
|
64
64
|
{
|
|
@@ -68,6 +68,13 @@
|
|
|
68
68
|
"kind": "expression"
|
|
69
69
|
}
|
|
70
70
|
},
|
|
71
|
+
{
|
|
72
|
+
"name": "?announceMessages",
|
|
73
|
+
"description": "When set to `true`, new messages are announced to assistive technologies using ARIA live regions.",
|
|
74
|
+
"value": {
|
|
75
|
+
"kind": "expression"
|
|
76
|
+
}
|
|
77
|
+
},
|
|
71
78
|
{
|
|
72
79
|
"name": ".items",
|
|
73
80
|
"description": "An array of objects which will be rendered as messages.\nThe message objects can have the following properties:\n```js\nArray<{\n text: string,\n time: string,\n userName: string,\n userAbbr: string,\n userImg: string,\n userColorIndex: number,\n className: string,\n theme: string\n}>\n```",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './vaadin-message-list.js';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './vaadin-message.js';
|