@samtv12345/etherpad-webcomponents 0.0.14 → 0.0.15

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.
Files changed (48) hide show
  1. package/README.md +11 -0
  2. package/dist/EpAvatar.d.ts +25 -0
  3. package/dist/EpAvatar.d.ts.map +1 -0
  4. package/dist/EpAvatar.js +115 -0
  5. package/dist/EpAvatar.js.map +1 -0
  6. package/dist/EpChatMessage.d.ts.map +1 -1
  7. package/dist/EpChatMessage.js +3 -1
  8. package/dist/EpChatMessage.js.map +1 -1
  9. package/dist/EpChatPanel.d.ts +81 -0
  10. package/dist/EpChatPanel.d.ts.map +1 -0
  11. package/dist/EpChatPanel.js +368 -0
  12. package/dist/EpChatPanel.js.map +1 -0
  13. package/dist/EpCheckbox.d.ts +3 -0
  14. package/dist/EpCheckbox.d.ts.map +1 -1
  15. package/dist/EpCheckbox.js +9 -1
  16. package/dist/EpCheckbox.js.map +1 -1
  17. package/dist/EpPopup.d.ts +57 -0
  18. package/dist/EpPopup.d.ts.map +1 -0
  19. package/dist/EpPopup.js +323 -0
  20. package/dist/EpPopup.js.map +1 -0
  21. package/dist/EpSegmented.d.ts +35 -0
  22. package/dist/EpSegmented.d.ts.map +1 -0
  23. package/dist/EpSegmented.js +149 -0
  24. package/dist/EpSegmented.js.map +1 -0
  25. package/dist/EpSettings.d.ts +47 -0
  26. package/dist/EpSettings.d.ts.map +1 -0
  27. package/dist/EpSettings.js +226 -0
  28. package/dist/EpSettings.js.map +1 -0
  29. package/dist/EpToolbar.d.ts +90 -0
  30. package/dist/EpToolbar.d.ts.map +1 -0
  31. package/dist/EpToolbar.js +431 -0
  32. package/dist/EpToolbar.js.map +1 -0
  33. package/dist/EpUserBadge.d.ts.map +1 -1
  34. package/dist/EpUserBadge.js +3 -1
  35. package/dist/EpUserBadge.js.map +1 -1
  36. package/dist/EpUserList.d.ts +52 -0
  37. package/dist/EpUserList.d.ts.map +1 -0
  38. package/dist/EpUserList.js +225 -0
  39. package/dist/EpUserList.js.map +1 -0
  40. package/dist/index.d.ts +10 -0
  41. package/dist/index.d.ts.map +1 -1
  42. package/dist/index.js +7 -0
  43. package/dist/index.js.map +1 -1
  44. package/dist/internal/color.d.ts +15 -0
  45. package/dist/internal/color.d.ts.map +1 -0
  46. package/dist/internal/color.js +44 -0
  47. package/dist/internal/color.js.map +1 -0
  48. package/package.json +8 -1
@@ -0,0 +1,431 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ import { LitElement, html, css, nothing } from 'lit';
8
+ import { customElement, property, state } from 'lit/decorators.js';
9
+ /**
10
+ * Button for `<ep-toolbar>`. Put an icon (SVG, icon font element, …) inside;
11
+ * `label` becomes tooltip and accessible name.
12
+ *
13
+ * Fires a normal `click`, and `ep-toolbar-action` (detail: `{ key }`) when
14
+ * it has a `key`.
15
+ */
16
+ let EpToolbarButton = class EpToolbarButton extends LitElement {
17
+ constructor() {
18
+ super(...arguments);
19
+ /** Tooltip and accessible name. */
20
+ this.label = '';
21
+ /** Identifier reported by `ep-toolbar-action`. */
22
+ this.key = '';
23
+ /** Makes the button a toggle; reflects `pressed` as aria-pressed. */
24
+ this.toggle = false;
25
+ this.pressed = false;
26
+ /** Highlights the button without toggle semantics (e.g. open popup). */
27
+ this.active = false;
28
+ this.disabled = false;
29
+ /** Shows the label next to the icon. */
30
+ this.showLabel = false;
31
+ /**
32
+ * For buttons that open something: `true` / `false` becomes aria-expanded,
33
+ * empty leaves it out.
34
+ */
35
+ this.expanded = '';
36
+ /** Small counter (e.g. users online). Empty hides it. */
37
+ this.badge = '';
38
+ /** `low` items move into the overflow row on narrow toolbars. */
39
+ this.priority = 'normal';
40
+ /** @internal roving tabindex managed by the toolbar. */
41
+ this.rovingTabIndex = 0;
42
+ }
43
+ focus(options) {
44
+ this.renderRoot.querySelector('button')?.focus(options);
45
+ }
46
+ _onClick(e) {
47
+ if (this.disabled) {
48
+ e.stopImmediatePropagation();
49
+ e.preventDefault();
50
+ return;
51
+ }
52
+ if (this.toggle)
53
+ this.pressed = !this.pressed;
54
+ if (this.key) {
55
+ this.dispatchEvent(new CustomEvent('ep-toolbar-action', {
56
+ bubbles: true, composed: true,
57
+ detail: { key: this.key, pressed: this.toggle ? this.pressed : undefined },
58
+ }));
59
+ }
60
+ }
61
+ render() {
62
+ const badge = this.badge !== '' && this.badge !== undefined && this.badge !== null;
63
+ return html `
64
+ <button
65
+ part="button"
66
+ type="button"
67
+ title=${this.label || nothing}
68
+ aria-label=${this.label || nothing}
69
+ aria-pressed=${this.toggle ? String(this.pressed) : nothing}
70
+ aria-expanded=${this.expanded || nothing}
71
+ aria-disabled=${this.disabled ? 'true' : nothing}
72
+ tabindex=${this.rovingTabIndex}
73
+ @click=${this._onClick}
74
+ >
75
+ <slot></slot>
76
+ ${this.showLabel && this.label ? html `<span class="text">${this.label}</span>` : nothing}
77
+ ${badge ? html `<span class="badge" part="badge" aria-hidden="true">${this.badge}</span>` : nothing}
78
+ </button>
79
+ `;
80
+ }
81
+ };
82
+ EpToolbarButton.styles = css `
83
+ :host {
84
+ display: inline-flex;
85
+ position: relative;
86
+ }
87
+ :host([hidden]) { display: none; }
88
+
89
+ button {
90
+ display: inline-flex;
91
+ align-items: center;
92
+ justify-content: center;
93
+ gap: 6px;
94
+ min-width: var(--ep-toolbar-button-size, 32px);
95
+ height: var(--ep-toolbar-button-size, 32px);
96
+ padding: 0 6px;
97
+ box-sizing: border-box;
98
+ border: none;
99
+ border-radius: var(--radius, 4px);
100
+ background: transparent;
101
+ color: var(--toolbar-text-color, var(--text-color, #485365));
102
+ font: inherit;
103
+ font-size: 14px;
104
+ cursor: pointer;
105
+ transition: background 0.15s ease, color 0.15s ease;
106
+ }
107
+ button:hover {
108
+ background: var(--toolbar-hover-color, var(--bg-soft-color, #f2f3f4));
109
+ }
110
+ :host([pressed]) button,
111
+ :host([active]) button {
112
+ background: var(--toolbar-active-color, var(--bg-soft-color, #f2f3f4));
113
+ color: var(--toolbar-active-text-color, var(--primary-color, #64d29b));
114
+ }
115
+ button:focus-visible {
116
+ outline: 2px solid var(--focus-color, var(--dark-color, #576273));
117
+ outline-offset: 1px;
118
+ }
119
+ :host([disabled]) button {
120
+ opacity: 0.4;
121
+ cursor: not-allowed;
122
+ }
123
+ ::slotted(svg), ::slotted(.icon) {
124
+ width: 18px;
125
+ height: 18px;
126
+ flex-shrink: 0;
127
+ }
128
+ .text { white-space: nowrap; }
129
+ .badge {
130
+ min-width: 16px;
131
+ height: 16px;
132
+ padding: 0 4px;
133
+ box-sizing: border-box;
134
+ border-radius: 8px;
135
+ background: var(--primary-color, #64d29b);
136
+ color: var(--primary-text-color, #ffffff);
137
+ font-size: 11px;
138
+ font-weight: 700;
139
+ line-height: 16px;
140
+ text-align: center;
141
+ }
142
+ `;
143
+ __decorate([
144
+ property()
145
+ ], EpToolbarButton.prototype, "label", void 0);
146
+ __decorate([
147
+ property({ reflect: true })
148
+ ], EpToolbarButton.prototype, "key", void 0);
149
+ __decorate([
150
+ property({ type: Boolean, reflect: true })
151
+ ], EpToolbarButton.prototype, "toggle", void 0);
152
+ __decorate([
153
+ property({ type: Boolean, reflect: true })
154
+ ], EpToolbarButton.prototype, "pressed", void 0);
155
+ __decorate([
156
+ property({ type: Boolean, reflect: true })
157
+ ], EpToolbarButton.prototype, "active", void 0);
158
+ __decorate([
159
+ property({ type: Boolean, reflect: true })
160
+ ], EpToolbarButton.prototype, "disabled", void 0);
161
+ __decorate([
162
+ property({ type: Boolean, attribute: 'show-label' })
163
+ ], EpToolbarButton.prototype, "showLabel", void 0);
164
+ __decorate([
165
+ property({ reflect: true })
166
+ ], EpToolbarButton.prototype, "expanded", void 0);
167
+ __decorate([
168
+ property()
169
+ ], EpToolbarButton.prototype, "badge", void 0);
170
+ __decorate([
171
+ property({ reflect: true })
172
+ ], EpToolbarButton.prototype, "priority", void 0);
173
+ __decorate([
174
+ property({ attribute: false })
175
+ ], EpToolbarButton.prototype, "rovingTabIndex", void 0);
176
+ EpToolbarButton = __decorate([
177
+ customElement('ep-toolbar-button')
178
+ ], EpToolbarButton);
179
+ export { EpToolbarButton };
180
+ /** Vertical divider between toolbar groups. */
181
+ let EpToolbarSeparator = class EpToolbarSeparator extends LitElement {
182
+ connectedCallback() {
183
+ super.connectedCallback();
184
+ this.setAttribute('role', 'separator');
185
+ this.setAttribute('aria-orientation', 'vertical');
186
+ }
187
+ };
188
+ EpToolbarSeparator.styles = css `
189
+ :host {
190
+ display: inline-block;
191
+ width: 1px;
192
+ height: 20px;
193
+ margin: 0 6px;
194
+ background: var(--toolbar-border-color, var(--middle-color, #d2d2d2));
195
+ align-self: center;
196
+ flex-shrink: 0;
197
+ }
198
+ :host([hidden]) { display: none; }
199
+ `;
200
+ EpToolbarSeparator = __decorate([
201
+ customElement('ep-toolbar-separator')
202
+ ], EpToolbarSeparator);
203
+ export { EpToolbarSeparator };
204
+ /**
205
+ * Editor toolbar. Default slot: left side (formatting), slot `end`: right
206
+ * side (actions). Arrow keys, Home and End move between the buttons; only
207
+ * one button is in the tab order.
208
+ *
209
+ * Below `breakpoint` pixels the toolbar becomes `compact`: buttons with
210
+ * `priority="low"` move into a second row that a "more" button opens.
211
+ */
212
+ let EpToolbar = class EpToolbar extends LitElement {
213
+ constructor() {
214
+ super(...arguments);
215
+ /** Accessible name of the toolbar. */
216
+ this.label = '';
217
+ /** Width in px below which the toolbar turns compact. 0 disables it. */
218
+ this.breakpoint = 800;
219
+ /** Label of the "more" button. */
220
+ this.moreLabel = 'More';
221
+ this.compact = false;
222
+ this.expanded = false;
223
+ this._focusIndex = 0;
224
+ }
225
+ connectedCallback() {
226
+ super.connectedCallback();
227
+ if (typeof ResizeObserver === 'function') {
228
+ this._resize = new ResizeObserver(() => this._measure());
229
+ this._resize.observe(this);
230
+ }
231
+ this._mutation = new MutationObserver(() => this._placeItems());
232
+ this._mutation.observe(this, { childList: true, subtree: true, attributes: true, attributeFilter: ['priority', 'disabled', 'hidden'] });
233
+ }
234
+ disconnectedCallback() {
235
+ super.disconnectedCallback();
236
+ this._resize?.disconnect();
237
+ this._mutation?.disconnect();
238
+ }
239
+ firstUpdated() {
240
+ this._measure();
241
+ }
242
+ updated(changed) {
243
+ if (changed.has('compact')) {
244
+ if (!this.compact)
245
+ this.expanded = false;
246
+ this._placeItems();
247
+ }
248
+ if (changed.has('breakpoint'))
249
+ this._measure();
250
+ }
251
+ _measure() {
252
+ const width = this.getBoundingClientRect().width;
253
+ this.compact = this.breakpoint > 0 && width > 0 && width < this.breakpoint;
254
+ }
255
+ /** In compact mode low-priority buttons go to the overflow slot. */
256
+ _placeItems() {
257
+ // Current low-priority items plus those moved earlier (their priority may have changed).
258
+ for (const el of Array.from(this.children)) {
259
+ const eligible = this.compact && el.getAttribute('priority') === 'low';
260
+ if (eligible) {
261
+ if (el.dataset.homeSlot === undefined)
262
+ el.dataset.homeSlot = el.getAttribute('slot') ?? '';
263
+ if (el.getAttribute('slot') !== 'overflow')
264
+ el.setAttribute('slot', 'overflow');
265
+ }
266
+ else if (el.dataset.homeSlot !== undefined) {
267
+ const home = el.dataset.homeSlot;
268
+ delete el.dataset.homeSlot;
269
+ if (home)
270
+ el.setAttribute('slot', home);
271
+ else
272
+ el.removeAttribute('slot');
273
+ }
274
+ }
275
+ this._updateRoving();
276
+ }
277
+ get _more() {
278
+ return this.renderRoot?.querySelector('.more') ?? null;
279
+ }
280
+ /**
281
+ * Buttons in visual order, without hidden or collapsed ones. In compact
282
+ * mode the "more" button follows the `end` items.
283
+ */
284
+ get items() {
285
+ const slots = ['', 'end', 'overflow'];
286
+ const all = Array.from(this.querySelectorAll('ep-toolbar-button'));
287
+ const bySlot = (b) => {
288
+ const top = Array.from(this.children).find((c) => c === b || c.contains(b));
289
+ return slots.indexOf(top?.getAttribute('slot') ?? '');
290
+ };
291
+ const visible = all
292
+ .filter((b) => !b.hidden && !b.closest('[hidden]'))
293
+ .filter((b) => !(bySlot(b) === 2 && !(this.compact && this.expanded)))
294
+ .sort((a, b) => bySlot(a) - bySlot(b));
295
+ const more = this._more;
296
+ if (!this.compact || !more)
297
+ return visible;
298
+ const firstOverflow = visible.findIndex((b) => bySlot(b) === 2);
299
+ if (firstOverflow < 0)
300
+ return [...visible, more];
301
+ return [...visible.slice(0, firstOverflow), more, ...visible.slice(firstOverflow)];
302
+ }
303
+ _updateRoving() {
304
+ const items = this.items;
305
+ if (this._focusIndex >= items.length)
306
+ this._focusIndex = Math.max(0, items.length - 1);
307
+ const more = this._more;
308
+ for (const b of [...Array.from(this.querySelectorAll('ep-toolbar-button')), ...(more ? [more] : [])]) {
309
+ b.rovingTabIndex = -1;
310
+ }
311
+ if (items[this._focusIndex])
312
+ items[this._focusIndex].rovingTabIndex = 0;
313
+ }
314
+ _onFocusIn(e) {
315
+ const btn = e.composedPath().find((n) => n instanceof EpToolbarButton);
316
+ if (!btn)
317
+ return;
318
+ const i = this.items.indexOf(btn);
319
+ if (i >= 0 && i !== this._focusIndex) {
320
+ this._focusIndex = i;
321
+ this._updateRoving();
322
+ }
323
+ }
324
+ _onKeydown(e) {
325
+ const items = this.items;
326
+ if (!items.length)
327
+ return;
328
+ let next;
329
+ switch (e.key) {
330
+ case 'ArrowRight':
331
+ next = (this._focusIndex + 1) % items.length;
332
+ break;
333
+ case 'ArrowLeft':
334
+ next = (this._focusIndex - 1 + items.length) % items.length;
335
+ break;
336
+ case 'Home':
337
+ next = 0;
338
+ break;
339
+ case 'End':
340
+ next = items.length - 1;
341
+ break;
342
+ default: return;
343
+ }
344
+ e.preventDefault();
345
+ this._focusIndex = next;
346
+ this._updateRoving();
347
+ items[next].focus();
348
+ }
349
+ _toggleMore() {
350
+ this.expanded = !this.expanded;
351
+ this.updateComplete.then(() => this._updateRoving());
352
+ }
353
+ render() {
354
+ return html `
355
+ <div class="row" part="row" role="toolbar" aria-label=${this.label || nothing}
356
+ @keydown=${this._onKeydown} @focusin=${this._onFocusIn}>
357
+ <div class="start" part="start"><slot @slotchange=${this._placeItems}></slot></div>
358
+ <div class="end" part="end">
359
+ <slot name="end" @slotchange=${this._placeItems}></slot>
360
+ <ep-toolbar-button class="more" part="more" label=${this.moreLabel}
361
+ ?active=${this.expanded}
362
+ expanded=${String(this.expanded)}
363
+ @click=${this._toggleMore}>
364
+ <svg viewBox="0 0 16 16" fill="currentColor" aria-hidden="true"><circle cx="3" cy="8" r="1.5"/><circle cx="8" cy="8" r="1.5"/><circle cx="13" cy="8" r="1.5"/></svg>
365
+ </ep-toolbar-button>
366
+ </div>
367
+ </div>
368
+ <div class="overflow" part="overflow" role="toolbar" aria-label=${this.moreLabel}
369
+ @keydown=${this._onKeydown} @focusin=${this._onFocusIn}>
370
+ <slot name="overflow" @slotchange=${this._updateRoving}></slot>
371
+ </div>
372
+ `;
373
+ }
374
+ };
375
+ EpToolbar.styles = css `
376
+ :host {
377
+ display: block;
378
+ background: var(--toolbar-bg-color, var(--bg-color, #ffffff));
379
+ color: var(--toolbar-text-color, var(--text-color, #485365));
380
+ border-bottom: 1px solid var(--toolbar-border-color, var(--middle-color, #d2d2d2));
381
+ font-family: var(--main-font-family, Quicksand, Cantarell, "Open Sans", "Helvetica Neue", sans-serif);
382
+ }
383
+ .row {
384
+ display: flex;
385
+ align-items: center;
386
+ gap: 2px;
387
+ padding: var(--ep-toolbar-padding, 6px 10px);
388
+ min-height: 32px;
389
+ }
390
+ .start, .end {
391
+ display: flex;
392
+ align-items: center;
393
+ gap: 2px;
394
+ min-width: 0;
395
+ }
396
+ .start { flex: 1; flex-wrap: wrap; }
397
+ .end { flex-shrink: 0; }
398
+ .more { display: none; }
399
+ :host([compact]) .more { display: inline-flex; }
400
+ .overflow {
401
+ display: none;
402
+ flex-wrap: wrap;
403
+ gap: 2px;
404
+ padding: 4px 10px 6px;
405
+ border-top: 1px solid var(--toolbar-border-color, var(--middle-color, #d2d2d2));
406
+ }
407
+ :host([compact][expanded]) .overflow { display: flex; }
408
+ `;
409
+ __decorate([
410
+ property()
411
+ ], EpToolbar.prototype, "label", void 0);
412
+ __decorate([
413
+ property({ type: Number })
414
+ ], EpToolbar.prototype, "breakpoint", void 0);
415
+ __decorate([
416
+ property({ attribute: 'more-label' })
417
+ ], EpToolbar.prototype, "moreLabel", void 0);
418
+ __decorate([
419
+ property({ type: Boolean, reflect: true })
420
+ ], EpToolbar.prototype, "compact", void 0);
421
+ __decorate([
422
+ property({ type: Boolean, reflect: true })
423
+ ], EpToolbar.prototype, "expanded", void 0);
424
+ __decorate([
425
+ state()
426
+ ], EpToolbar.prototype, "_focusIndex", void 0);
427
+ EpToolbar = __decorate([
428
+ customElement('ep-toolbar')
429
+ ], EpToolbar);
430
+ export { EpToolbar };
431
+ //# sourceMappingURL=EpToolbar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EpToolbar.js","sourceRoot":"","sources":["../src/EpToolbar.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAEnE;;;;;;GAMG;AAEI,IAAM,eAAe,GAArB,MAAM,eAAgB,SAAQ,UAAU;IAAxC;;QA+DL,mCAAmC;QACvB,UAAK,GAAG,EAAE,CAAC;QACvB,kDAAkD;QACrB,QAAG,GAAG,EAAE,CAAC;QACtC,qEAAqE;QACzB,WAAM,GAAG,KAAK,CAAC;QACf,YAAO,GAAG,KAAK,CAAC;QAC5D,wEAAwE;QAC5B,WAAM,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["../src/EpUserBadge.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;AAK5C,qBACa,WAAY,SAAQ,UAAU;IACzC,MAAM,CAAC,MAAM,0BA8CX;IAEU,IAAI,SAAM;IACV,KAAK,SAAa;IACD,IAAI,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAY;IAC/B,MAAM,UAAS;IAE3D,MAAM;CASP;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,eAAe,EAAE,WAAW,CAAC;KAC9B;CACF"}
@@ -6,6 +6,8 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
6
6
  };
7
7
  import { LitElement, html, css } from 'lit';
8
8
  import { customElement, property } from 'lit/decorators.js';
9
+ import { styleMap } from 'lit/directives/style-map.js';
10
+ import { safeColor } from './internal/color.js';
9
11
  let EpUserBadge = class EpUserBadge extends LitElement {
10
12
  constructor() {
11
13
  super(...arguments);
@@ -17,7 +19,7 @@ let EpUserBadge = class EpUserBadge extends LitElement {
17
19
  render() {
18
20
  const initial = this.name ? this.name.charAt(0) : '?';
19
21
  return html `
20
- <div class="avatar" style="background: ${this.color}">
22
+ <div class="avatar" style=${styleMap({ background: safeColor(this.color) })}>
21
23
  ${initial}
22
24
  </div>
23
25
  ${this.name ? html `<span class="name">${this.name}</span>` : ''}
@@ -1 +1 @@
1
- {"version":3,"file":"EpUserBadge.js","sourceRoot":"","sources":["../src/EpUserBadge.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAGrD,IAAM,WAAW,GAAjB,MAAM,WAAY,SAAQ,UAAU;IAApC;;QAiDO,SAAI,GAAG,EAAE,CAAC;QACV,UAAK,GAAG,SAAS,CAAC;QACD,SAAI,GAAiC,QAAQ,CAAC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AS,CAAC;QACD,SAAI,GAAiC,QAAQ,CAAC;QAC/B,WAAM,GAAG,KAAK,CAAC;IAW7D,CAAC;IATC,MAAM;QACJ,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;QACtD,OAAO,IAAI,CAAA;kCACmB,QAAQ,CAAC,EAAE,UAAU,EAAE,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;UACvE,OAAO;;QAET,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAA,sBAAsB,IAAI,CAAC,IAAI,SAAS,CAAC,CAAC,CAAC,EAAE;KAChE,CAAC;IACJ,CAAC;;AA7DM,kBAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8ClB,AA9CY,CA8CX;AAEU;IAAX,QAAQ,EAAE;yCAAW;AACV;IAAX,QAAQ,EAAE;0CAAmB;AACD;IAA5B,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;yCAA+C;AAC/B;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;2CAAgB;AApDhD,WAAW;IADvB,aAAa,CAAC,eAAe,CAAC;GAClB,WAAW,CA+DvB"}
@@ -0,0 +1,52 @@
1
+ import { LitElement } from 'lit';
2
+ import './EpAvatar.js';
3
+ export interface EpUser {
4
+ id: string;
5
+ name: string;
6
+ color: string;
7
+ /** The current user: shown first, name and colour can be changed. */
8
+ self?: boolean;
9
+ status?: '' | 'online' | 'idle' | 'offline';
10
+ }
11
+ /**
12
+ * List of the users in a pad. The own entry has a name field and a colour
13
+ * button.
14
+ *
15
+ * Events:
16
+ * - `ep-user-rename` (detail `{ name }`) when the own name is committed
17
+ * (Enter or leaving the field),
18
+ * - `ep-user-color-request` (detail `{ anchor }`) when the colour button is
19
+ * clicked; the app opens its colour picker at `anchor`,
20
+ * - `ep-user-select` (detail `{ user }`) when another user is clicked.
21
+ */
22
+ export declare class EpUserList extends LitElement {
23
+ static styles: import("lit").CSSResult;
24
+ users: EpUser[];
25
+ /** Heading above the list; empty hides it. */
26
+ heading: string;
27
+ namePlaceholder: string;
28
+ unnamedLabel: string;
29
+ colorLabel: string;
30
+ emptyLabel: string;
31
+ /** Others can be clicked (`ep-user-select`). */
32
+ selectable: boolean;
33
+ /** Own name and colour cannot be changed (read-only pad). */
34
+ readonly: boolean;
35
+ /** Last name sent or received for the own entry. */
36
+ private _committed;
37
+ private _lastSelfName;
38
+ protected willUpdate(changed: Map<string, unknown>): void;
39
+ private get _sorted();
40
+ private _commit;
41
+ private _requestColor;
42
+ private _select;
43
+ private _renderSelf;
44
+ private _renderOther;
45
+ render(): import("lit-html").TemplateResult<1>;
46
+ }
47
+ declare global {
48
+ interface HTMLElementTagNameMap {
49
+ 'ep-user-list': EpUserList;
50
+ }
51
+ }
52
+ //# sourceMappingURL=EpUserList.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EpUserList.d.ts","sourceRoot":"","sources":["../src/EpUserList.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAsB,MAAM,KAAK,CAAC;AAGrD,OAAO,eAAe,CAAC;AAGvB,MAAM,WAAW,MAAM;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,qEAAqE;IACrE,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,MAAM,CAAC,EAAE,EAAE,GAAG,QAAQ,GAAG,MAAM,GAAG,SAAS,CAAC;CAC7C;AAED;;;;;;;;;;GAUG;AACH,qBACa,UAAW,SAAQ,UAAU;IACxC,MAAM,CAAC,MAAM,0BAgEX;IAE8B,KAAK,EAAE,MAAM,EAAE,CAAM;IACrD,8CAA8C;IAClC,OAAO,SAAM;IACoB,eAAe,SAAqB;IACvC,YAAY,SAAa;IAC3B,UAAU,SAAwB;IAClC,UAAU,SAAM;IACxD,gDAAgD;IACnB,UAAU,UAAS;IAChD,6DAA6D;IACjB,QAAQ,UAAS;IAE7D,oDAAoD;IACpD,OAAO,CAAC,UAAU,CAAM;IACxB,OAAO,CAAC,aAAa,CAAqB;IAE1C,SAAS,CAAC,UAAU,CAAC,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC;IAUlD,OAAO,KAAK,OAAO,GAMlB;IAED,OAAO,CAAC,OAAO;IASf,OAAO,CAAC,aAAa;IAMrB,OAAO,CAAC,OAAO;IAOf,OAAO,CAAC,WAAW;IAmBnB,OAAO,CAAC,YAAY;IAgBpB,MAAM;CAYP;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,cAAc,EAAE,UAAU,CAAC;KAC5B;CACF"}