@brightspace-ui/core 2.18.1 → 2.18.4
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.
|
@@ -383,6 +383,7 @@
|
|
|
383
383
|
<mo>)</mo>
|
|
384
384
|
</mrow>
|
|
385
385
|
</math>
|
|
386
|
+
$$ {\color{red}x} + {\color{blue}y} = {\color{green}z} $$
|
|
386
387
|
<p>The wizard (<span data-replace-me-id="0">Elmer Fudd</span>) quickly jinxed the gnomes before they vaporized.</p>
|
|
387
388
|
</div>
|
|
388
389
|
</d2l-html-block>
|
|
@@ -495,6 +496,7 @@
|
|
|
495
496
|
<template>
|
|
496
497
|
<d2l-html-block>
|
|
497
498
|
<div>$$ f(x) = \int \mathrm{e}^{-x}\,\mathrm{d}x $$ $$ x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a} $$</div>
|
|
499
|
+
<div>$$ {\color{red}x} + {\color{blue}y} = {\color{green}z} $$</div>
|
|
498
500
|
</d2l-html-block>
|
|
499
501
|
</template>
|
|
500
502
|
</d2l-demo-snippet>
|
|
@@ -507,7 +509,7 @@
|
|
|
507
509
|
<div>
|
|
508
510
|
An equation rendered using LaTeX...
|
|
509
511
|
\( f(x) = \int \mathrm{e}^{-x}\,\mathrm{d}x \)
|
|
510
|
-
... and some text
|
|
512
|
+
... and some text ...
|
|
511
513
|
</div>
|
|
512
514
|
</d2l-html-block>
|
|
513
515
|
</template>
|
package/helpers/README.md
CHANGED
|
@@ -125,7 +125,7 @@ getComposedActiveElement()
|
|
|
125
125
|
// gets the first focusable descendant given a node, including those within the shadow DOM
|
|
126
126
|
getFirstFocusableDescendant(node, includeHidden, predicate)
|
|
127
127
|
|
|
128
|
-
// gets the last
|
|
128
|
+
// gets the last focusable descendant given a node, including those within the shadow DOM
|
|
129
129
|
getLastFocusableDescendant(node, includeHidden)
|
|
130
130
|
|
|
131
131
|
// gets the previous focusable node on the page given a node
|
|
@@ -134,7 +134,7 @@ getPreviousFocusable(node, includeHidden)
|
|
|
134
134
|
// gets the next focusable node on the page given a node
|
|
135
135
|
getNextFocusable(node, includeHidden)
|
|
136
136
|
|
|
137
|
-
// gets the ancestor of the given node
|
|
137
|
+
// gets the nearest focusable ancestor of the given node
|
|
138
138
|
getPreviousFocusableAncestor(node, includeHidden, includeTabbablesOnly)
|
|
139
139
|
|
|
140
140
|
// returns true/false whether the element is focusable
|
package/helpers/mathjax.js
CHANGED
|
@@ -68,12 +68,13 @@ export class HtmlBlockMathRenderer {
|
|
|
68
68
|
elem.querySelectorAll('mspace[linebreak="newline"]').forEach(elm => {
|
|
69
69
|
elm.setAttribute('style', lineBreakStyle);
|
|
70
70
|
});
|
|
71
|
+
|
|
71
72
|
await window.MathJax.startup.promise;
|
|
72
|
-
window.MathJax.
|
|
73
|
+
window.MathJax.typesetShadow(elem.getRootNode(), elem);
|
|
73
74
|
return elem;
|
|
74
75
|
}
|
|
75
76
|
|
|
76
|
-
const inner = elem.innerHTML.
|
|
77
|
+
const inner = elem.innerHTML.replace(/<mspace linebreak="newline">/gi, `<mspace linebreak="newline" style="${lineBreakStyle}">`);
|
|
77
78
|
|
|
78
79
|
const temp = document.createElement('div');
|
|
79
80
|
temp.style.display = 'none';
|
|
@@ -93,6 +94,11 @@ export function loadMathJax(mathJaxConfig) {
|
|
|
93
94
|
|
|
94
95
|
if (mathJaxLoaded) return mathJaxLoaded;
|
|
95
96
|
|
|
97
|
+
const loadOptions = ['ui/menu'];
|
|
98
|
+
if (mathJaxConfig && mathJaxConfig.renderLatex) {
|
|
99
|
+
loadOptions.push('[tex]/all-packages');
|
|
100
|
+
}
|
|
101
|
+
|
|
96
102
|
window.MathJax = {
|
|
97
103
|
chtml: {
|
|
98
104
|
scale: (mathJaxConfig && mathJaxConfig.outputScale) || 1
|
|
@@ -102,7 +108,7 @@ export function loadMathJax(mathJaxConfig) {
|
|
|
102
108
|
settings: { zoom: 'None' }
|
|
103
109
|
}
|
|
104
110
|
},
|
|
105
|
-
loader: { load:
|
|
111
|
+
loader: { load: loadOptions },
|
|
106
112
|
startup: {
|
|
107
113
|
ready: () => {
|
|
108
114
|
|
|
@@ -182,10 +188,13 @@ export function loadMathJax(mathJaxConfig) {
|
|
|
182
188
|
// renders the document. The MathDocument is returned in case
|
|
183
189
|
// you need to rerender the shadowRoot later.
|
|
184
190
|
//
|
|
185
|
-
window.MathJax.typesetShadow = function(root) {
|
|
191
|
+
window.MathJax.typesetShadow = function(root, elem) {
|
|
186
192
|
const InputJax = startup.getInputJax();
|
|
187
193
|
const OutputJax = startup.getOutputJax();
|
|
188
194
|
const html = mathjax.document(root, { InputJax, OutputJax });
|
|
195
|
+
|
|
196
|
+
if (elem) html.options.elements = [elem];
|
|
197
|
+
|
|
189
198
|
html.render().typeset();
|
|
190
199
|
return html;
|
|
191
200
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@brightspace-ui/core",
|
|
3
|
-
"version": "2.18.
|
|
3
|
+
"version": "2.18.4",
|
|
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",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"lit-analyzer": "^1",
|
|
61
61
|
"messageformat-validator": "^2",
|
|
62
62
|
"node-sass": "^7",
|
|
63
|
-
"sinon": "^
|
|
63
|
+
"sinon": "^14",
|
|
64
64
|
"stylelint": "^14"
|
|
65
65
|
},
|
|
66
66
|
"dependencies": {
|