@brightspace-ui/core 2.15.0 → 2.15.3
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.
|
@@ -14,6 +14,8 @@ import { tryGetIfrauBackdropService } from '../../helpers/ifrauBackdropService.j
|
|
|
14
14
|
window.D2L = window.D2L || {};
|
|
15
15
|
window.D2L.DialogMixin = window.D2L.DialogMixin || {};
|
|
16
16
|
|
|
17
|
+
// while implemented in Webkit, native <dialog> focus mangement across slotted content is buggy
|
|
18
|
+
// https://bugs.webkit.org/show_bug.cgi?id=233320
|
|
17
19
|
window.D2L.DialogMixin.hasNative = (window.HTMLDialogElement !== undefined)
|
|
18
20
|
&& (navigator.vendor && navigator.vendor.toLowerCase().indexOf('apple') === -1);
|
|
19
21
|
if (window.D2L.DialogMixin.preferNative === undefined) {
|
|
@@ -182,7 +184,16 @@ export const DialogMixin = superclass => class extends RtlMixin(superclass) {
|
|
|
182
184
|
return;
|
|
183
185
|
}
|
|
184
186
|
}
|
|
185
|
-
this.shadowRoot.querySelector('d2l-focus-trap')
|
|
187
|
+
const focusTrap = this.shadowRoot.querySelector('d2l-focus-trap');
|
|
188
|
+
if (focusTrap) {
|
|
189
|
+
focusTrap.focus();
|
|
190
|
+
return;
|
|
191
|
+
}
|
|
192
|
+
const header = this.shadowRoot.querySelector('.d2l-dialog-header');
|
|
193
|
+
if (header) {
|
|
194
|
+
const firstFocusable = getNextFocusable(header);
|
|
195
|
+
if (firstFocusable) forceFocusVisible(firstFocusable);
|
|
196
|
+
}
|
|
186
197
|
}
|
|
187
198
|
|
|
188
199
|
_focusInitial() {
|
|
@@ -412,12 +423,6 @@ export const DialogMixin = superclass => class extends RtlMixin(superclass) {
|
|
|
412
423
|
'd2l-dialog-fullscreen-within': this._fullscreenWithin !== 0
|
|
413
424
|
};
|
|
414
425
|
|
|
415
|
-
inner = html`<d2l-focus-trap
|
|
416
|
-
@d2l-focus-trap-enter="${this._handleFocusTrapEnter}"
|
|
417
|
-
?trap="${this.opened}">
|
|
418
|
-
${inner}
|
|
419
|
-
</d2l-focus-trap>`;
|
|
420
|
-
|
|
421
426
|
return html`${this._useNative ?
|
|
422
427
|
html`<dialog
|
|
423
428
|
aria-describedby="${ifDefined(info.descId)}"
|
|
@@ -443,7 +448,9 @@ export const DialogMixin = superclass => class extends RtlMixin(superclass) {
|
|
|
443
448
|
id="${this._dialogId}"
|
|
444
449
|
role="${info.role}"
|
|
445
450
|
style=${styleMap(styles)}>
|
|
446
|
-
|
|
451
|
+
<d2l-focus-trap
|
|
452
|
+
@d2l-focus-trap-enter="${this._handleFocusTrapEnter}"
|
|
453
|
+
?trap="${this.opened}">${inner}</d2l-focus-trap>
|
|
447
454
|
</div>
|
|
448
455
|
<d2l-backdrop for-target="${this._dialogId}" ?shown="${this._state === 'showing'}"></d2l-backdrop>`}
|
|
449
456
|
`;
|
|
@@ -106,7 +106,6 @@ class Dialog extends LocalizeCoreElement(AsyncContainerMixin(DialogMixin(LitElem
|
|
|
106
106
|
this.describeContent = false;
|
|
107
107
|
this.width = 600;
|
|
108
108
|
this._handleResize = this._handleResize.bind(this);
|
|
109
|
-
this._handleResize();
|
|
110
109
|
}
|
|
111
110
|
|
|
112
111
|
get asyncContainerCustom() {
|
|
@@ -123,6 +122,11 @@ class Dialog extends LocalizeCoreElement(AsyncContainerMixin(DialogMixin(LitElem
|
|
|
123
122
|
super.disconnectedCallback();
|
|
124
123
|
}
|
|
125
124
|
|
|
125
|
+
firstUpdated(changedProperties) {
|
|
126
|
+
super.firstUpdated(changedProperties);
|
|
127
|
+
this._handleResize();
|
|
128
|
+
}
|
|
129
|
+
|
|
126
130
|
render() {
|
|
127
131
|
|
|
128
132
|
let loading = null;
|
|
@@ -174,6 +174,18 @@
|
|
|
174
174
|
</mfrac>
|
|
175
175
|
</mrow>
|
|
176
176
|
<mtext>.</mtext>
|
|
177
|
+
<mspace linebreak="newline"></mspace>
|
|
178
|
+
<msup>
|
|
179
|
+
<mi>e</mi>
|
|
180
|
+
<mrow>
|
|
181
|
+
<mi>i</mi>
|
|
182
|
+
<mi>π<!-- π --></mi>
|
|
183
|
+
</mrow>
|
|
184
|
+
</msup>
|
|
185
|
+
<mo>+</mo>
|
|
186
|
+
<mn>1</mn>
|
|
187
|
+
<mo>=</mo>
|
|
188
|
+
<mn>0</mn>
|
|
177
189
|
</math>
|
|
178
190
|
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
|
|
179
191
|
<msup>
|
package/helpers/mathjax.js
CHANGED
|
@@ -64,14 +64,21 @@ export class HtmlBlockMathRenderer {
|
|
|
64
64
|
return elem;
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
+
// MathJax 3 does not support newlines, but it does persist styles, so add custom styles to mimic a linebreak
|
|
68
|
+
// This work-around should be removed when linebreaks are natively supported.
|
|
69
|
+
// MathJax issue: https://github.com/mathjax/MathJax/issues/2312
|
|
70
|
+
// A duplicate that explains our exact issue: https://github.com/mathjax/MathJax/issues/2495
|
|
71
|
+
const inner = elem.innerHTML.replaceAll('<mspace linebreak="newline">', '<mspace linebreak="newline" style="display: block; height: 0.5rem;">');
|
|
72
|
+
|
|
67
73
|
const temp = document.createElement('div');
|
|
68
74
|
temp.style.display = 'none';
|
|
69
75
|
temp.attachShadow({ mode: 'open' });
|
|
70
|
-
temp.shadowRoot.innerHTML = `<div><mjx-doc><mjx-head></mjx-head><mjx-body>${
|
|
76
|
+
temp.shadowRoot.innerHTML = `<div><mjx-doc><mjx-head></mjx-head><mjx-body>${inner}</mjx-body></mjx-doc></div>`;
|
|
71
77
|
|
|
72
78
|
elem.appendChild(temp);
|
|
73
79
|
await window.MathJax.startup.promise;
|
|
74
80
|
window.MathJax.typesetShadow(temp.shadowRoot);
|
|
81
|
+
|
|
75
82
|
return temp.shadowRoot.firstChild;
|
|
76
83
|
}
|
|
77
84
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@brightspace-ui/core",
|
|
3
|
-
"version": "2.15.
|
|
3
|
+
"version": "2.15.3",
|
|
4
4
|
"description": "A collection of accessible, free, open-source web components for building Brightspace applications",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": "https://github.com/BrightspaceUI/core.git",
|