@vaadin/message-list 24.8.0-alpha15 → 24.8.0-alpha17
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 +11 -10
- package/src/vaadin-message-list-mixin.d.ts +5 -0
- package/src/vaadin-message-list-mixin.js +19 -1
- package/src/vaadin-message-styles.js +4 -0
- package/theme/lumo/vaadin-message-list.d.ts +1 -0
- package/theme/lumo/vaadin-message-list.js +1 -0
- package/theme/material/vaadin-message-list.d.ts +1 -0
- package/theme/material/vaadin-message-list.js +1 -0
- package/web-types.json +20 -2
- package/web-types.lit.json +9 -2
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-alpha17",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -39,17 +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/
|
|
46
|
-
"@vaadin/vaadin-
|
|
47
|
-
"@vaadin/vaadin-
|
|
42
|
+
"@vaadin/a11y-base": "24.8.0-alpha17",
|
|
43
|
+
"@vaadin/avatar": "24.8.0-alpha17",
|
|
44
|
+
"@vaadin/component-base": "24.8.0-alpha17",
|
|
45
|
+
"@vaadin/markdown": "24.8.0-alpha17",
|
|
46
|
+
"@vaadin/vaadin-lumo-styles": "24.8.0-alpha17",
|
|
47
|
+
"@vaadin/vaadin-material-styles": "24.8.0-alpha17",
|
|
48
|
+
"@vaadin/vaadin-themable-mixin": "24.8.0-alpha17",
|
|
48
49
|
"lit": "^3.0.0"
|
|
49
50
|
},
|
|
50
51
|
"devDependencies": {
|
|
51
|
-
"@vaadin/chai-plugins": "24.8.0-
|
|
52
|
-
"@vaadin/test-runner-commands": "24.8.0-
|
|
52
|
+
"@vaadin/chai-plugins": "24.8.0-alpha17",
|
|
53
|
+
"@vaadin/test-runner-commands": "24.8.0-alpha17",
|
|
53
54
|
"@vaadin/testing-helpers": "^1.1.0",
|
|
54
55
|
"sinon": "^18.0.0"
|
|
55
56
|
},
|
|
@@ -57,5 +58,5 @@
|
|
|
57
58
|
"web-types.json",
|
|
58
59
|
"web-types.lit.json"
|
|
59
60
|
],
|
|
60
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "bf06d4d774049e0d19a3f008273864df15e085f6"
|
|
61
62
|
}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* Copyright (c) 2021 - 2025 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
|
+
import '@vaadin/markdown/src/vaadin-markdown.js';
|
|
6
7
|
import { html, render } from 'lit';
|
|
7
8
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
8
9
|
import { KeyboardDirectionMixin } from '@vaadin/a11y-base/src/keyboard-direction-mixin.js';
|
|
@@ -37,6 +38,16 @@ export const MessageListMixin = (superClass) =>
|
|
|
37
38
|
observer: '_itemsChanged',
|
|
38
39
|
sync: true,
|
|
39
40
|
},
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* When set to `true`, the message text is parsed as Markdown.
|
|
44
|
+
* @type {boolean}
|
|
45
|
+
*/
|
|
46
|
+
markdown: {
|
|
47
|
+
type: Boolean,
|
|
48
|
+
observer: '__markdownChanged',
|
|
49
|
+
reflectToAttribute: true,
|
|
50
|
+
},
|
|
40
51
|
};
|
|
41
52
|
}
|
|
42
53
|
|
|
@@ -86,6 +97,11 @@ export const MessageListMixin = (superClass) =>
|
|
|
86
97
|
}
|
|
87
98
|
}
|
|
88
99
|
|
|
100
|
+
/** @private */
|
|
101
|
+
__markdownChanged(_markdown) {
|
|
102
|
+
this._renderMessages(this.items);
|
|
103
|
+
}
|
|
104
|
+
|
|
89
105
|
/** @private */
|
|
90
106
|
_renderMessages(items) {
|
|
91
107
|
render(
|
|
@@ -102,7 +118,9 @@ export const MessageListMixin = (superClass) =>
|
|
|
102
118
|
theme="${ifDefined(item.theme)}"
|
|
103
119
|
class="${ifDefined(item.className)}"
|
|
104
120
|
@focusin="${this._onMessageFocusIn}"
|
|
105
|
-
>${
|
|
121
|
+
>${this.markdown
|
|
122
|
+
? html`<vaadin-markdown .content=${item.text}></vaadin-markdown>`
|
|
123
|
+
: item.text}<vaadin-avatar slot="avatar"></vaadin-avatar
|
|
106
124
|
></vaadin-message>
|
|
107
125
|
`,
|
|
108
126
|
)}
|
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-alpha17",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"contributions": {
|
|
7
7
|
"html": {
|
|
@@ -140,8 +140,17 @@
|
|
|
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-alpha17/#/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-alpha17/#/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
|
+
{
|
|
146
|
+
"name": "markdown",
|
|
147
|
+
"description": "When set to `true`, the message text is parsed as Markdown.",
|
|
148
|
+
"value": {
|
|
149
|
+
"type": [
|
|
150
|
+
"boolean"
|
|
151
|
+
]
|
|
152
|
+
}
|
|
153
|
+
},
|
|
145
154
|
{
|
|
146
155
|
"name": "theme",
|
|
147
156
|
"description": "The theme variants to apply to the component.",
|
|
@@ -166,6 +175,15 @@
|
|
|
166
175
|
"undefined"
|
|
167
176
|
]
|
|
168
177
|
}
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
"name": "markdown",
|
|
181
|
+
"description": "When set to `true`, the message text is parsed as Markdown.",
|
|
182
|
+
"value": {
|
|
183
|
+
"type": [
|
|
184
|
+
"boolean"
|
|
185
|
+
]
|
|
186
|
+
}
|
|
169
187
|
}
|
|
170
188
|
],
|
|
171
189
|
"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-alpha17",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"framework": "lit",
|
|
7
7
|
"framework-config": {
|
|
@@ -58,9 +58,16 @@
|
|
|
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-alpha17/#/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-alpha17/#/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
|
+
{
|
|
65
|
+
"name": "?markdown",
|
|
66
|
+
"description": "When set to `true`, the message text is parsed as Markdown.",
|
|
67
|
+
"value": {
|
|
68
|
+
"kind": "expression"
|
|
69
|
+
}
|
|
70
|
+
},
|
|
64
71
|
{
|
|
65
72
|
"name": ".items",
|
|
66
73
|
"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```",
|