@vaadin/message-list 25.2.0-alpha8 → 25.2.0-beta1

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": "25.2.0-alpha8",
3
+ "version": "25.2.0-beta1",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -37,19 +37,19 @@
37
37
  ],
38
38
  "dependencies": {
39
39
  "@open-wc/dedupe-mixin": "^1.3.0",
40
- "@vaadin/a11y-base": "25.2.0-alpha8",
41
- "@vaadin/avatar": "25.2.0-alpha8",
42
- "@vaadin/component-base": "25.2.0-alpha8",
43
- "@vaadin/markdown": "25.2.0-alpha8",
44
- "@vaadin/vaadin-themable-mixin": "25.2.0-alpha8",
40
+ "@vaadin/a11y-base": "25.2.0-beta1",
41
+ "@vaadin/avatar": "25.2.0-beta1",
42
+ "@vaadin/component-base": "25.2.0-beta1",
43
+ "@vaadin/markdown": "25.2.0-beta1",
44
+ "@vaadin/vaadin-themable-mixin": "25.2.0-beta1",
45
45
  "lit": "^3.0.0"
46
46
  },
47
47
  "devDependencies": {
48
- "@vaadin/aura": "25.2.0-alpha8",
49
- "@vaadin/chai-plugins": "25.2.0-alpha8",
50
- "@vaadin/test-runner-commands": "25.2.0-alpha8",
48
+ "@vaadin/aura": "25.2.0-beta1",
49
+ "@vaadin/chai-plugins": "25.2.0-beta1",
50
+ "@vaadin/test-runner-commands": "25.2.0-beta1",
51
51
  "@vaadin/testing-helpers": "^2.0.0",
52
- "@vaadin/vaadin-lumo-styles": "25.2.0-alpha8",
52
+ "@vaadin/vaadin-lumo-styles": "25.2.0-beta1",
53
53
  "sinon": "^21.0.2"
54
54
  },
55
55
  "customElements": "custom-elements.json",
@@ -57,5 +57,5 @@
57
57
  "web-types.json",
58
58
  "web-types.lit.json"
59
59
  ],
60
- "gitHead": "2b82e20cdfc605b1187e9a24ae42869e1500ab68"
60
+ "gitHead": "471a23f60d1eb725f98a33f62cb9664d9c0a4163"
61
61
  }
@@ -9,10 +9,6 @@ import { KeyboardDirectionMixin } from '@vaadin/a11y-base/src/keyboard-direction
9
9
  import { timeOut } from '@vaadin/component-base/src/async.js';
10
10
  import { Debouncer } from '@vaadin/component-base/src/debounce.js';
11
11
 
12
- /**
13
- * @polymerMixin
14
- * @mixes KeyboardDirectionMixin
15
- */
16
12
  export const MessageListMixin = (superClass) =>
17
13
  class MessageListMixinClass extends KeyboardDirectionMixin(superClass) {
18
14
  static get properties() {
@@ -116,6 +112,21 @@ export const MessageListMixin = (superClass) =>
116
112
  return this._messages;
117
113
  }
118
114
 
115
+ /**
116
+ * Override method inherited from `KeyboardDirectionMixin`
117
+ * to scroll the focused message into view, since the mixin
118
+ * itself focuses items with `preventScroll: true`.
119
+ *
120
+ * @protected
121
+ * @override
122
+ */
123
+ _focusItem(item, options, navigating) {
124
+ super._focusItem(item, options, navigating);
125
+ if (item && navigating) {
126
+ item.scrollIntoView({ block: 'nearest' });
127
+ }
128
+ }
129
+
119
130
  /** @private */
120
131
  _itemsChanged(newVal, oldVal) {
121
132
  const items = newVal || [];
@@ -235,9 +246,4 @@ export const MessageListMixin = (superClass) =>
235
246
  __announceChanged(announceMessages) {
236
247
  this.ariaLive = announceMessages ? 'polite' : null;
237
248
  }
238
-
239
- /**
240
- * Fired when an attachment is clicked.
241
- * @event attachment-click
242
- */
243
249
  };
@@ -49,10 +49,6 @@ import { MessageListMixin } from './vaadin-message-list-mixin.js';
49
49
  *
50
50
  * @customElement vaadin-message-list
51
51
  * @extends HTMLElement
52
- * @mixes ThemableMixin
53
- * @mixes ElementMixin
54
- * @mixes MessageListMixin
55
- * @mixes SlotStylesMixin
56
52
  */
57
53
  class MessageList extends SlotStylesMixin(MessageListMixin(ElementMixin(ThemableMixin(PolylitMixin(LitElement))))) {
58
54
  static get is() {
@@ -8,10 +8,6 @@ import { ifDefined } from 'lit/directives/if-defined.js';
8
8
  import { FocusMixin } from '@vaadin/a11y-base/src/focus-mixin.js';
9
9
  import { SlotController } from '@vaadin/component-base/src/slot-controller.js';
10
10
 
11
- /**
12
- * @polymerMixin
13
- * @mixes FocusMixin
14
- */
15
11
  export const MessageMixin = (superClass) =>
16
12
  class MessageMixinClass extends FocusMixin(superClass) {
17
13
  static get properties() {
@@ -183,9 +179,4 @@ export const MessageMixin = (superClass) =>
183
179
  }),
184
180
  );
185
181
  }
186
-
187
- /**
188
- * Fired when an attachment is clicked.
189
- * @event attachment-click
190
- */
191
182
  };
@@ -85,9 +85,6 @@ import { MessageMixin } from './vaadin-message-mixin.js';
85
85
  *
86
86
  * @customElement vaadin-message
87
87
  * @extends HTMLElement
88
- * @mixes MessageMixin
89
- * @mixes ThemableMixin
90
- * @mixes ElementMixin
91
88
  */
92
89
  class Message extends MessageMixin(ElementMixin(ThemableMixin(PolylitMixin(LumoInjectionMixin(LitElement))))) {
93
90
  static get is() {
package/web-types.json CHANGED
@@ -1,11 +1,83 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/message-list",
4
- "version": "25.2.0-alpha8",
4
+ "version": "25.2.0-beta1",
5
5
  "description-markup": "markdown",
6
6
  "contributions": {
7
7
  "html": {
8
8
  "elements": [
9
+ {
10
+ "name": "vaadin-message-list",
11
+ "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/25.2.0-beta1/#/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/25.2.0-beta1/#/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.",
12
+ "attributes": [
13
+ {
14
+ "name": "announce-messages",
15
+ "description": "When set to `true`, new messages are announced to assistive technologies using ARIA live regions.",
16
+ "value": {
17
+ "type": [
18
+ "boolean"
19
+ ]
20
+ }
21
+ },
22
+ {
23
+ "name": "markdown",
24
+ "description": "When set to `true`, the message text is parsed as Markdown.",
25
+ "value": {
26
+ "type": [
27
+ "boolean"
28
+ ]
29
+ }
30
+ },
31
+ {
32
+ "name": "theme",
33
+ "description": "The theme variants to apply to the component.",
34
+ "value": {
35
+ "type": [
36
+ "string",
37
+ "null",
38
+ "undefined"
39
+ ]
40
+ }
41
+ }
42
+ ],
43
+ "js": {
44
+ "properties": [
45
+ {
46
+ "name": "announceMessages",
47
+ "description": "When set to `true`, new messages are announced to assistive technologies using ARIA live regions.",
48
+ "value": {
49
+ "type": [
50
+ "boolean"
51
+ ]
52
+ }
53
+ },
54
+ {
55
+ "name": "items",
56
+ "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 attachments: Array<{\n name: string,\n url: string,\n type: string\n }>\n}>\n```\n\nWhen a message has attachments, they are rendered in the message's shadow DOM.\nImage attachments (type starting with \"image/\") show a thumbnail preview,\nwhile other attachments show a document icon with the file name.\nClicking an attachment dispatches an `attachment-click` event.",
57
+ "value": {
58
+ "type": [
59
+ "array"
60
+ ]
61
+ }
62
+ },
63
+ {
64
+ "name": "markdown",
65
+ "description": "When set to `true`, the message text is parsed as Markdown.",
66
+ "value": {
67
+ "type": [
68
+ "boolean"
69
+ ]
70
+ }
71
+ }
72
+ ],
73
+ "events": [
74
+ {
75
+ "name": "attachment-click",
76
+ "description": "Fired when an attachment is clicked."
77
+ }
78
+ ]
79
+ }
80
+ },
9
81
  {
10
82
  "name": "vaadin-message",
11
83
  "description": "`<vaadin-message>` is a Web Component for showing a single message with an author, message and time.\n\n```html\n<vaadin-message\n time=\"2021-01-28 10:43\"\n user-name=\"Bob Ross\"\n user-abbr=\"BR\"\n user-img=\"/static/img/avatar.jpg\"\n>\n There is no real ending. It's just the place where you stop the story.\n</vaadin-message>\n```\n\n### Styling\n\nThe following shadow DOM parts are available for styling:\n\nPart name | Description\n--------------------|----------------\n`name` | Author's name\n`time` | When the message was posted\n`content` | The message itself as a slotted content\n`attachments` | Container for the attachments\n`attachment` | Individual attachment button\n`attachment-image` | Image attachment button (in addition to `attachment`)\n`attachment-file` | File attachment button (in addition to `attachment`)\n`attachment-preview`| Image preview inside an image attachment\n`attachment-icon` | File icon inside a file attachment\n`attachment-name` | File name inside a file attachment\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\nThe following custom CSS properties are available for styling:\n\nCustom CSS property |\n:------------------------------------------- |\n`--vaadin-message-attachment-background` |\n`--vaadin-message-attachment-border-color` |\n`--vaadin-message-attachment-border-radius` |\n`--vaadin-message-attachment-border-width` |\n`--vaadin-message-attachment-font-size` |\n`--vaadin-message-attachment-font-weight` |\n`--vaadin-message-attachment-gap` |\n`--vaadin-message-attachment-line-height` |\n`--vaadin-message-attachment-padding` |\n`--vaadin-message-attachment-text-color` |\n`--vaadin-message-font-size` |\n`--vaadin-message-font-weight` |\n`--vaadin-message-gap` |\n`--vaadin-message-header-line-height` |\n`--vaadin-message-line-height` |\n`--vaadin-message-name-color` |\n`--vaadin-message-name-font-size` |\n`--vaadin-message-name-font-weight` |\n`--vaadin-message-padding` |\n`--vaadin-message-text-color` |\n`--vaadin-message-time-color` |\n`--vaadin-message-time-font-size` |\n`--vaadin-message-time-font-weight` |\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
@@ -26,9 +98,7 @@
26
98
  "description": "Time of sending the message. It is rendered as-is to the part='time' slot,\nso the formatting is up to you.",
27
99
  "value": {
28
100
  "type": [
29
- "string",
30
- "null",
31
- "undefined"
101
+ "string"
32
102
  ]
33
103
  }
34
104
  },
@@ -37,9 +107,7 @@
37
107
  "description": "The abbreviation of the user.\nThe abbreviation will be passed on to avatar of the message.\nIf the user does not have an avatar picture set with `userImg`, `userAbbr` will be shown in the avatar.\nExample: `message.userAbbr = \"JJ\";`",
38
108
  "value": {
39
109
  "type": [
40
- "string",
41
- "null",
42
- "undefined"
110
+ "string"
43
111
  ]
44
112
  }
45
113
  },
@@ -48,9 +116,7 @@
48
116
  "description": "A color index to be used to render the color of the avatar.",
49
117
  "value": {
50
118
  "type": [
51
- "number",
52
- "null",
53
- "undefined"
119
+ "number"
54
120
  ]
55
121
  }
56
122
  },
@@ -59,9 +125,7 @@
59
125
  "description": "An URL for a user image.\nThe image will be used in the avatar component to show who has sent the message.\nExample: `message.userImg = \"/static/img/avatar.jpg\";`",
60
126
  "value": {
61
127
  "type": [
62
- "string",
63
- "null",
64
- "undefined"
128
+ "string"
65
129
  ]
66
130
  }
67
131
  },
@@ -70,9 +134,7 @@
70
134
  "description": "The name of the user posting the message.\nIt will be placed in the name part to indicate who has sent the message.\nIt is also used as a tooltip for the avatar.\nExample: `message.userName = \"Jessica Jacobs\";`",
71
135
  "value": {
72
136
  "type": [
73
- "string",
74
- "null",
75
- "undefined"
137
+ "string"
76
138
  ]
77
139
  }
78
140
  }
@@ -84,9 +146,7 @@
84
146
  "description": "An array of attachment objects to display with the message.\nEach attachment object can have the following properties:\n- `name`: The name of the attachment file\n- `url`: The URL of the attachment\n- `type`: The MIME type of the attachment (e.g., 'image/png', 'application/pdf')\n\nImage attachments (type starting with \"image/\") show a thumbnail preview,\nwhile other attachments show a document icon with the file name.",
85
147
  "value": {
86
148
  "type": [
87
- "Array",
88
- "null",
89
- "undefined"
149
+ "Array<{name?: string, url?: string, type?: string}>"
90
150
  ]
91
151
  }
92
152
  },
@@ -95,9 +155,7 @@
95
155
  "description": "Time of sending the message. It is rendered as-is to the part='time' slot,\nso the formatting is up to you.",
96
156
  "value": {
97
157
  "type": [
98
- "string",
99
- "null",
100
- "undefined"
158
+ "string"
101
159
  ]
102
160
  }
103
161
  },
@@ -106,9 +164,7 @@
106
164
  "description": "The abbreviation of the user.\nThe abbreviation will be passed on to avatar of the message.\nIf the user does not have an avatar picture set with `userImg`, `userAbbr` will be shown in the avatar.\nExample: `message.userAbbr = \"JJ\";`",
107
165
  "value": {
108
166
  "type": [
109
- "string",
110
- "null",
111
- "undefined"
167
+ "string"
112
168
  ]
113
169
  }
114
170
  },
@@ -117,9 +173,7 @@
117
173
  "description": "A color index to be used to render the color of the avatar.",
118
174
  "value": {
119
175
  "type": [
120
- "number",
121
- "null",
122
- "undefined"
176
+ "number"
123
177
  ]
124
178
  }
125
179
  },
@@ -128,9 +182,7 @@
128
182
  "description": "An URL for a user image.\nThe image will be used in the avatar component to show who has sent the message.\nExample: `message.userImg = \"/static/img/avatar.jpg\";`",
129
183
  "value": {
130
184
  "type": [
131
- "string",
132
- "null",
133
- "undefined"
185
+ "string"
134
186
  ]
135
187
  }
136
188
  },
@@ -139,91 +191,7 @@
139
191
  "description": "The name of the user posting the message.\nIt will be placed in the name part to indicate who has sent the message.\nIt is also used as a tooltip for the avatar.\nExample: `message.userName = \"Jessica Jacobs\";`",
140
192
  "value": {
141
193
  "type": [
142
- "string",
143
- "null",
144
- "undefined"
145
- ]
146
- }
147
- }
148
- ],
149
- "events": [
150
- {
151
- "name": "attachment-click",
152
- "description": "Fired when an attachment is clicked."
153
- }
154
- ]
155
- }
156
- },
157
- {
158
- "name": "vaadin-message-list",
159
- "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/25.2.0-alpha8/#/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/25.2.0-alpha8/#/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.",
160
- "attributes": [
161
- {
162
- "name": "announce-messages",
163
- "description": "When set to `true`, new messages are announced to assistive technologies using ARIA live regions.",
164
- "value": {
165
- "type": [
166
- "boolean",
167
- "null",
168
- "undefined"
169
- ]
170
- }
171
- },
172
- {
173
- "name": "markdown",
174
- "description": "When set to `true`, the message text is parsed as Markdown.",
175
- "value": {
176
- "type": [
177
- "boolean",
178
- "null",
179
- "undefined"
180
- ]
181
- }
182
- },
183
- {
184
- "name": "theme",
185
- "description": "The theme variants to apply to the component.",
186
- "value": {
187
- "type": [
188
- "string",
189
- "null",
190
- "undefined"
191
- ]
192
- }
193
- }
194
- ],
195
- "js": {
196
- "properties": [
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
- "null",
204
- "undefined"
205
- ]
206
- }
207
- },
208
- {
209
- "name": "items",
210
- "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 attachments: Array<{\n name: string,\n url: string,\n type: string\n }>\n}>\n```\n\nWhen a message has attachments, they are rendered in the message's shadow DOM.\nImage attachments (type starting with \"image/\") show a thumbnail preview,\nwhile other attachments show a document icon with the file name.\nClicking an attachment dispatches an `attachment-click` event.",
211
- "value": {
212
- "type": [
213
- "Array",
214
- "null",
215
- "undefined"
216
- ]
217
- }
218
- },
219
- {
220
- "name": "markdown",
221
- "description": "When set to `true`, the message text is parsed as Markdown.",
222
- "value": {
223
- "type": [
224
- "boolean",
225
- "null",
226
- "undefined"
194
+ "string"
227
195
  ]
228
196
  }
229
197
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/message-list",
4
- "version": "25.2.0-alpha8",
4
+ "version": "25.2.0-beta1",
5
5
  "description-markup": "markdown",
6
6
  "framework": "lit",
7
7
  "framework-config": {
@@ -15,83 +15,83 @@
15
15
  "html": {
16
16
  "elements": [
17
17
  {
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\n time=\"2021-01-28 10:43\"\n user-name=\"Bob Ross\"\n user-abbr=\"BR\"\n user-img=\"/static/img/avatar.jpg\"\n>\n There is no real ending. It's just the place where you stop the story.\n</vaadin-message>\n```\n\n### Styling\n\nThe following shadow DOM parts are available for styling:\n\nPart name | Description\n--------------------|----------------\n`name` | Author's name\n`time` | When the message was posted\n`content` | The message itself as a slotted content\n`attachments` | Container for the attachments\n`attachment` | Individual attachment button\n`attachment-image` | Image attachment button (in addition to `attachment`)\n`attachment-file` | File attachment button (in addition to `attachment`)\n`attachment-preview`| Image preview inside an image attachment\n`attachment-icon` | File icon inside a file attachment\n`attachment-name` | File name inside a file attachment\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\nThe following custom CSS properties are available for styling:\n\nCustom CSS property |\n:------------------------------------------- |\n`--vaadin-message-attachment-background` |\n`--vaadin-message-attachment-border-color` |\n`--vaadin-message-attachment-border-radius` |\n`--vaadin-message-attachment-border-width` |\n`--vaadin-message-attachment-font-size` |\n`--vaadin-message-attachment-font-weight` |\n`--vaadin-message-attachment-gap` |\n`--vaadin-message-attachment-line-height` |\n`--vaadin-message-attachment-padding` |\n`--vaadin-message-attachment-text-color` |\n`--vaadin-message-font-size` |\n`--vaadin-message-font-weight` |\n`--vaadin-message-gap` |\n`--vaadin-message-header-line-height` |\n`--vaadin-message-line-height` |\n`--vaadin-message-name-color` |\n`--vaadin-message-name-font-size` |\n`--vaadin-message-name-font-weight` |\n`--vaadin-message-padding` |\n`--vaadin-message-text-color` |\n`--vaadin-message-time-color` |\n`--vaadin-message-time-font-size` |\n`--vaadin-message-time-font-weight` |\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
18
+ "name": "vaadin-message-list",
19
+ "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/25.2.0-beta1/#/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/25.2.0-beta1/#/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.",
20
20
  "extension": true,
21
21
  "attributes": [
22
22
  {
23
- "name": ".attachments",
24
- "description": "An array of attachment objects to display with the message.\nEach attachment object can have the following properties:\n- `name`: The name of the attachment file\n- `url`: The URL of the attachment\n- `type`: The MIME type of the attachment (e.g., 'image/png', 'application/pdf')\n\nImage attachments (type starting with \"image/\") show a thumbnail preview,\nwhile other attachments show a document icon with the file name.",
23
+ "name": "?announceMessages",
24
+ "description": "When set to `true`, new messages are announced to assistive technologies using ARIA live regions.",
25
25
  "value": {
26
26
  "kind": "expression"
27
27
  }
28
28
  },
29
29
  {
30
- "name": ".time",
31
- "description": "Time of sending the message. It is rendered as-is to the part='time' slot,\nso the formatting is up to you.",
30
+ "name": ".items",
31
+ "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 attachments: Array<{\n name: string,\n url: string,\n type: string\n }>\n}>\n```\n\nWhen a message has attachments, they are rendered in the message's shadow DOM.\nImage attachments (type starting with \"image/\") show a thumbnail preview,\nwhile other attachments show a document icon with the file name.\nClicking an attachment dispatches an `attachment-click` event.",
32
32
  "value": {
33
33
  "kind": "expression"
34
34
  }
35
35
  },
36
36
  {
37
- "name": ".userAbbr",
38
- "description": "The abbreviation of the user.\nThe abbreviation will be passed on to avatar of the message.\nIf the user does not have an avatar picture set with `userImg`, `userAbbr` will be shown in the avatar.\nExample: `message.userAbbr = \"JJ\";`",
37
+ "name": "?markdown",
38
+ "description": "When set to `true`, the message text is parsed as Markdown.",
39
39
  "value": {
40
40
  "kind": "expression"
41
41
  }
42
42
  },
43
43
  {
44
- "name": ".userColorIndex",
45
- "description": "A color index to be used to render the color of the avatar.",
44
+ "name": "@attachment-click",
45
+ "description": "Fired when an attachment is clicked.",
46
46
  "value": {
47
47
  "kind": "expression"
48
48
  }
49
- },
49
+ }
50
+ ]
51
+ },
52
+ {
53
+ "name": "vaadin-message",
54
+ "description": "`<vaadin-message>` is a Web Component for showing a single message with an author, message and time.\n\n```html\n<vaadin-message\n time=\"2021-01-28 10:43\"\n user-name=\"Bob Ross\"\n user-abbr=\"BR\"\n user-img=\"/static/img/avatar.jpg\"\n>\n There is no real ending. It's just the place where you stop the story.\n</vaadin-message>\n```\n\n### Styling\n\nThe following shadow DOM parts are available for styling:\n\nPart name | Description\n--------------------|----------------\n`name` | Author's name\n`time` | When the message was posted\n`content` | The message itself as a slotted content\n`attachments` | Container for the attachments\n`attachment` | Individual attachment button\n`attachment-image` | Image attachment button (in addition to `attachment`)\n`attachment-file` | File attachment button (in addition to `attachment`)\n`attachment-preview`| Image preview inside an image attachment\n`attachment-icon` | File icon inside a file attachment\n`attachment-name` | File name inside a file attachment\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\nThe following custom CSS properties are available for styling:\n\nCustom CSS property |\n:------------------------------------------- |\n`--vaadin-message-attachment-background` |\n`--vaadin-message-attachment-border-color` |\n`--vaadin-message-attachment-border-radius` |\n`--vaadin-message-attachment-border-width` |\n`--vaadin-message-attachment-font-size` |\n`--vaadin-message-attachment-font-weight` |\n`--vaadin-message-attachment-gap` |\n`--vaadin-message-attachment-line-height` |\n`--vaadin-message-attachment-padding` |\n`--vaadin-message-attachment-text-color` |\n`--vaadin-message-font-size` |\n`--vaadin-message-font-weight` |\n`--vaadin-message-gap` |\n`--vaadin-message-header-line-height` |\n`--vaadin-message-line-height` |\n`--vaadin-message-name-color` |\n`--vaadin-message-name-font-size` |\n`--vaadin-message-name-font-weight` |\n`--vaadin-message-padding` |\n`--vaadin-message-text-color` |\n`--vaadin-message-time-color` |\n`--vaadin-message-time-font-size` |\n`--vaadin-message-time-font-weight` |\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
55
+ "extension": true,
56
+ "attributes": [
50
57
  {
51
- "name": ".userImg",
52
- "description": "An URL for a user image.\nThe image will be used in the avatar component to show who has sent the message.\nExample: `message.userImg = \"/static/img/avatar.jpg\";`",
58
+ "name": ".attachments",
59
+ "description": "An array of attachment objects to display with the message.\nEach attachment object can have the following properties:\n- `name`: The name of the attachment file\n- `url`: The URL of the attachment\n- `type`: The MIME type of the attachment (e.g., 'image/png', 'application/pdf')\n\nImage attachments (type starting with \"image/\") show a thumbnail preview,\nwhile other attachments show a document icon with the file name.",
53
60
  "value": {
54
61
  "kind": "expression"
55
62
  }
56
63
  },
57
64
  {
58
- "name": ".userName",
59
- "description": "The name of the user posting the message.\nIt will be placed in the name part to indicate who has sent the message.\nIt is also used as a tooltip for the avatar.\nExample: `message.userName = \"Jessica Jacobs\";`",
65
+ "name": ".time",
66
+ "description": "Time of sending the message. It is rendered as-is to the part='time' slot,\nso the formatting is up to you.",
60
67
  "value": {
61
68
  "kind": "expression"
62
69
  }
63
70
  },
64
71
  {
65
- "name": "@attachment-click",
66
- "description": "Fired when an attachment is clicked.",
72
+ "name": ".userAbbr",
73
+ "description": "The abbreviation of the user.\nThe abbreviation will be passed on to avatar of the message.\nIf the user does not have an avatar picture set with `userImg`, `userAbbr` will be shown in the avatar.\nExample: `message.userAbbr = \"JJ\";`",
67
74
  "value": {
68
75
  "kind": "expression"
69
76
  }
70
- }
71
- ]
72
- },
73
- {
74
- "name": "vaadin-message-list",
75
- "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/25.2.0-alpha8/#/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/25.2.0-alpha8/#/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.",
76
- "extension": true,
77
- "attributes": [
77
+ },
78
78
  {
79
- "name": "?announceMessages",
80
- "description": "When set to `true`, new messages are announced to assistive technologies using ARIA live regions.",
79
+ "name": ".userColorIndex",
80
+ "description": "A color index to be used to render the color of the avatar.",
81
81
  "value": {
82
82
  "kind": "expression"
83
83
  }
84
84
  },
85
85
  {
86
- "name": "?markdown",
87
- "description": "When set to `true`, the message text is parsed as Markdown.",
86
+ "name": ".userImg",
87
+ "description": "An URL for a user image.\nThe image will be used in the avatar component to show who has sent the message.\nExample: `message.userImg = \"/static/img/avatar.jpg\";`",
88
88
  "value": {
89
89
  "kind": "expression"
90
90
  }
91
91
  },
92
92
  {
93
- "name": ".items",
94
- "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 attachments: Array<{\n name: string,\n url: string,\n type: string\n }>\n}>\n```\n\nWhen a message has attachments, they are rendered in the message's shadow DOM.\nImage attachments (type starting with \"image/\") show a thumbnail preview,\nwhile other attachments show a document icon with the file name.\nClicking an attachment dispatches an `attachment-click` event.",
93
+ "name": ".userName",
94
+ "description": "The name of the user posting the message.\nIt will be placed in the name part to indicate who has sent the message.\nIt is also used as a tooltip for the avatar.\nExample: `message.userName = \"Jessica Jacobs\";`",
95
95
  "value": {
96
96
  "kind": "expression"
97
97
  }