@brightspace-ui/labs 2.50.0 → 2.51.0

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
@@ -82,13 +82,13 @@
82
82
  "@web/dev-server": "^0.4",
83
83
  "@web/rollup-plugin-html": "^3",
84
84
  "eslint": "^9",
85
- "eslint-config-brightspace": "^2",
85
+ "eslint-config-brightspace": "^3",
86
86
  "glob-all": "^3",
87
87
  "messageformat-validator": "^3.0.0-beta.5",
88
88
  "rollup": "^4",
89
89
  "rollup-plugin-copy": "^3",
90
90
  "rollup-plugin-delete": "^3",
91
- "sinon": "^21",
91
+ "sinon": "^22",
92
92
  "stylelint": "^17"
93
93
  },
94
94
  "files": [
@@ -113,5 +113,5 @@
113
113
  "parse-srt": "^1.0.0-alpha",
114
114
  "webvtt-parser": "^2"
115
115
  },
116
- "version": "2.50.0"
116
+ "version": "2.51.0"
117
117
  }
@@ -221,7 +221,7 @@ class LabsAccordionCollapse extends LitElement {
221
221
  render() {
222
222
  return html`
223
223
  <div id="header-container">
224
- <a href="javascript:void(0)" id="trigger" ?aria-expanded=${this.opened} class="header-grid-item" aria-controls="collapse" role="button" ?data-border="${this.headerBorder}" @blur=${this._triggerBlur} @click=${this.toggle} @focus=${this._triggerFocus}>
224
+ <a href="javascript:void(0)" id="trigger" aria-expanded=${this.opened ? 'true' : 'false'} class="header-grid-item" aria-controls="collapse" role="button" ?data-border="${this.headerBorder}" @blur=${this._triggerBlur} @click=${this.toggle} @focus=${this._triggerFocus}>
225
225
  ${!this.headerHasInteractiveContent ? html`
226
226
  <div class="collapse-title" title="${this.label}">${this.title}${this.label}<slot name="header"></slot>
227
227
  </div>
@@ -243,7 +243,7 @@ class LabsAccordionCollapse extends LitElement {
243
243
  ` : nothing}
244
244
  </div>
245
245
 
246
- <div class="content">
246
+ <div class="content" id="collapse">
247
247
  <d2l-expand-collapse-content ?expanded=${this.opened} @d2l-expand-collapse-content-expand=${this._handleExpand} @d2l-expand-collapse-content-collapse=${this._handleCollapse}>
248
248
  <slot></slot>
249
249
  </d2l-expand-collapse-content>
@@ -1576,7 +1576,7 @@ class MediaPlayer extends LocalizeLabsElement(RtlMixin(LitElement)) {
1576
1576
  this._updateCurrentTimeFromSeekbarProgress();
1577
1577
 
1578
1578
  if (this._pausedForSeekDrag) {
1579
- this._media.play();
1579
+ this._play();
1580
1580
  }
1581
1581
  this._dragging = false;
1582
1582
  }
@@ -2030,6 +2030,12 @@ class MediaPlayer extends LocalizeLabsElement(RtlMixin(LitElement)) {
2030
2030
  return quality;
2031
2031
  }
2032
2032
 
2033
+ // Calling play() returns a Promise. If pause() is called before that Promise resolves,
2034
+ // the browser rejects it with an AbortError. This is benign, so we suppress it.
2035
+ _play() {
2036
+ return this._media.play().catch((e) => { if (e.name !== 'AbortError') throw e; });
2037
+ }
2038
+
2033
2039
  _reloadSource() {
2034
2040
  if (this._media) {
2035
2041
  const oldSourceNode = this._media.getElementsByTagName('source')[0];
@@ -2243,7 +2249,7 @@ class MediaPlayer extends LocalizeLabsElement(RtlMixin(LitElement)) {
2243
2249
  this._loadVisibilityObserver({ target: this._mediaContainer });
2244
2250
  }
2245
2251
  this._playRequested = true;
2246
- this._media.play();
2252
+ this._play();
2247
2253
  } else {
2248
2254
  this._playRequested = false;
2249
2255
  this._media.pause();