@vaadin/message-list 24.8.0-alpha17 → 24.8.0-alpha18
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 -11
- package/src/vaadin-message-list-mixin.js +13 -2
- package/theme/lumo/vaadin-message-list.d.ts +1 -1
- package/theme/lumo/vaadin-message-list.js +1 -1
- package/theme/material/vaadin-message-list.d.ts +1 -1
- package/theme/material/vaadin-message-list.js +1 -1
- 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": "24.8.0-
|
|
3
|
+
"version": "24.8.0-alpha18",
|
|
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-alpha18",
|
|
43
|
+
"@vaadin/avatar": "24.8.0-alpha18",
|
|
44
|
+
"@vaadin/component-base": "24.8.0-alpha18",
|
|
45
|
+
"@vaadin/markdown": "24.8.0-alpha18",
|
|
46
|
+
"@vaadin/vaadin-lumo-styles": "24.8.0-alpha18",
|
|
47
|
+
"@vaadin/vaadin-material-styles": "24.8.0-alpha18",
|
|
48
|
+
"@vaadin/vaadin-themable-mixin": "24.8.0-alpha18",
|
|
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-alpha18",
|
|
53
|
+
"@vaadin/test-runner-commands": "24.8.0-alpha18",
|
|
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": "57d1022f4c197d3a0100d360017ea37777cb3595"
|
|
62
62
|
}
|
|
@@ -3,7 +3,6 @@
|
|
|
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';
|
|
7
6
|
import { html, render } from 'lit';
|
|
8
7
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
9
8
|
import { KeyboardDirectionMixin } from '@vaadin/a11y-base/src/keyboard-direction-mixin.js';
|
|
@@ -98,12 +97,23 @@ export const MessageListMixin = (superClass) =>
|
|
|
98
97
|
}
|
|
99
98
|
|
|
100
99
|
/** @private */
|
|
101
|
-
__markdownChanged(
|
|
100
|
+
__markdownChanged(markdown) {
|
|
101
|
+
if (markdown && !customElements.get('vaadin-markdown')) {
|
|
102
|
+
// Dynamically import the markdown component
|
|
103
|
+
import('@vaadin/markdown/src/vaadin-markdown.js')
|
|
104
|
+
// Wait until the component is defined
|
|
105
|
+
.then(() => customElements.whenDefined('vaadin-markdown'))
|
|
106
|
+
// Render the messages again
|
|
107
|
+
.then(() => this._renderMessages(this.items));
|
|
108
|
+
}
|
|
102
109
|
this._renderMessages(this.items);
|
|
103
110
|
}
|
|
104
111
|
|
|
105
112
|
/** @private */
|
|
106
113
|
_renderMessages(items) {
|
|
114
|
+
// Check if markdown component is still loading
|
|
115
|
+
const loadingMarkdown = this.markdown && !customElements.get('vaadin-markdown');
|
|
116
|
+
|
|
107
117
|
render(
|
|
108
118
|
html`
|
|
109
119
|
${items.map(
|
|
@@ -118,6 +128,7 @@ export const MessageListMixin = (superClass) =>
|
|
|
118
128
|
theme="${ifDefined(item.theme)}"
|
|
119
129
|
class="${ifDefined(item.className)}"
|
|
120
130
|
@focusin="${this._onMessageFocusIn}"
|
|
131
|
+
style="${ifDefined(loadingMarkdown ? 'visibility: hidden' : undefined)}"
|
|
121
132
|
>${this.markdown
|
|
122
133
|
? html`<vaadin-markdown .content=${item.text}></vaadin-markdown>`
|
|
123
134
|
: item.text}<vaadin-avatar slot="avatar"></vaadin-avatar
|
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-alpha18",
|
|
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-alpha18/#/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-alpha18/#/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",
|
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-alpha18",
|
|
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-alpha18/#/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-alpha18/#/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
|
{
|