@brightspace-ui/core 2.18.0 → 2.18.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.
@@ -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>
@@ -156,7 +156,6 @@ class HtmlBlock extends RtlMixin(LitElement) {
156
156
  overflow-wrap: break-word;
157
157
  overflow-x: auto;
158
158
  overflow-y: hidden;
159
- position: relative;
160
159
  text-align: left;
161
160
  }
162
161
  :host([hidden]),
@@ -3,7 +3,7 @@
3
3
 
4
4
  Tag lists are used to present a list of compact, discrete pieces of information.
5
5
 
6
- <!-- docs: demo display:block -->
6
+ <!-- docs: demo autoSize:false display:block size:small -->
7
7
  ```html
8
8
  <script type="module">
9
9
  import '@brightspace-ui/core/components/tag-list/tag-list.js';
@@ -12,7 +12,7 @@ Tag lists are used to present a list of compact, discrete pieces of information.
12
12
 
13
13
  <d2l-tag-list description="Example Tags">
14
14
  <d2l-tag-list-item text="Lorem ipsum dolor"></d2l-tag-list-item>
15
- <d2l-tag-list-item text="Reprehenderit in voluptate velit esse"></d2l-tag-list-item>
15
+ <d2l-tag-list-item text="Reprehenderit in voluptate velit esse lorem ipsum dolor"></d2l-tag-list-item>
16
16
  <d2l-tag-list-item text="Sit amet"></d2l-tag-list-item>
17
17
  <d2l-tag-list-item text="Duis aute irure"></d2l-tag-list-item>
18
18
  <d2l-tag-list-item text="Excepteur sint"></d2l-tag-list-item>
@@ -26,7 +26,7 @@ Tag lists are used to present a list of compact, discrete pieces of information.
26
26
 
27
27
  The `d2l-tag-list` element can take a combination of any type of `d2l-tag-list-item` and adds the appropriate keyboard navigation, list semantics, clearing behaviour and responsive behaviour.
28
28
 
29
- <!-- docs: demo live name:d2l-tag-list display:block -->
29
+ <!-- docs: demo live name:d2l-tag-list autoSize:false display:block size:small -->
30
30
  ```html
31
31
  <script type="module">
32
32
  import '@brightspace-ui/core/components/tag-list/tag-list.js';
@@ -39,7 +39,7 @@ The `d2l-tag-list` element can take a combination of any type of `d2l-tag-list-i
39
39
  </script>
40
40
  <d2l-tag-list description="Example Tags">
41
41
  <d2l-tag-list-item text="Lorem ipsum dolor"></d2l-tag-list-item>
42
- <d2l-tag-list-item text="Reprehenderit in voluptate velit esse"></d2l-tag-list-item>
42
+ <d2l-tag-list-item text="Reprehenderit in voluptate velit esse lorem ipsum dolor"></d2l-tag-list-item>
43
43
  <d2l-tag-list-item text="Sit amet"></d2l-tag-list-item>
44
44
  <d2l-tag-list-item text="Duis aute irure"></d2l-tag-list-item>
45
45
  </d2l-tag-list>
@@ -48,7 +48,7 @@ The `d2l-tag-list` element can take a combination of any type of `d2l-tag-list-i
48
48
  ## Tag List Item [d2l-tag-list-item]
49
49
  The `d2l-tag-list-item` provides the appropriate `listitem` semantics and styling for children within a tag list. Tag List items do not work outside of a Tag List and should not be used on their own.
50
50
 
51
- <!-- docs: demo live name:d2l-tag-list-item display:block -->
51
+ <!-- docs: demo live name:d2l-tag-list-item autoSize:false display:block size:small -->
52
52
  ```html
53
53
  <script type="module">
54
54
  import '@brightspace-ui/core/components/tag-list/tag-list.js';
@@ -68,8 +68,9 @@ 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.typeset([elem]);
73
+ window.MathJax.typesetShadow(elem.getRootNode(), elem);
73
74
  return elem;
74
75
  }
75
76
 
@@ -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: ['ui/menu'] },
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.0",
3
+ "version": "2.18.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",
@@ -60,7 +60,7 @@
60
60
  "lit-analyzer": "^1",
61
61
  "messageformat-validator": "^2",
62
62
  "node-sass": "^7",
63
- "sinon": "^13",
63
+ "sinon": "^14",
64
64
  "stylelint": "^14"
65
65
  },
66
66
  "dependencies": {