@brightspace-ui/core 1.202.1 → 1.202.2
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.
|
@@ -15,34 +15,34 @@ Place the user-authored HTML within a `template` and the `d2l-html-block` will s
|
|
|
15
15
|
import '@brightspace-ui/core/components/icons/icon.js';
|
|
16
16
|
</script>
|
|
17
17
|
<d2l-html-block>
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
18
|
+
<template>
|
|
19
|
+
<!-- docs: start hidden content -->
|
|
20
|
+
<style>
|
|
21
|
+
div {
|
|
22
|
+
--d2l-icon-fill-color: var(--d2l-color-cinnabar);
|
|
23
|
+
}
|
|
24
|
+
span {
|
|
25
|
+
color: var(--d2l-color-cinnabar);
|
|
26
|
+
margin-left: 10px;
|
|
27
|
+
vertical-align: middle;
|
|
28
|
+
}
|
|
29
|
+
d2l-icon {
|
|
30
|
+
align-self: center;
|
|
31
|
+
flex-shrink: 0;
|
|
32
|
+
}
|
|
33
|
+
.warning-container {
|
|
34
|
+
align-items: center;
|
|
35
|
+
display: flex;
|
|
36
|
+
justify-content: center;
|
|
37
|
+
}
|
|
38
|
+
</style>
|
|
39
39
|
<!-- docs: end hidden content --><div class="warning-container">
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
40
|
+
<d2l-icon icon="tier3:alert"></d2l-icon>
|
|
41
|
+
<span>
|
|
42
|
+
<b>Important:</b> user-authored HTML must be trusted or properly sanitized!
|
|
43
|
+
</span>
|
|
44
|
+
</div>
|
|
45
|
+
</template>
|
|
46
46
|
</d2l-html-block>
|
|
47
47
|
```
|
|
48
48
|
|
|
@@ -50,20 +50,20 @@ To use `d2l-html-block` within another Lit component, use the [unsafeHTML](https
|
|
|
50
50
|
|
|
51
51
|
```html
|
|
52
52
|
<script type="module">
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
53
|
+
import { html, LitElement } from 'lit-element/lit-element.js';
|
|
54
|
+
import { unsafeHTML } from 'lit-html/directives/unsafe-html.js';
|
|
55
|
+
import '@brightspace-ui/core/components/icons/icon.js';
|
|
56
56
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
57
|
+
class SomeComponent extends LitElement {
|
|
58
|
+
render() {
|
|
59
|
+
return html`
|
|
60
|
+
<d2l-html-block>
|
|
61
|
+
<template>${unsafeHTML(this._unsafeHTML)}</template>
|
|
62
|
+
</d2l-html-block>`;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
65
|
|
|
66
|
-
|
|
66
|
+
customElements.define('d2l-some-component', SomeComponent);
|
|
67
67
|
</script>
|
|
68
68
|
<d2l-some-component></d2l-some-component>
|
|
69
69
|
```
|
|
@@ -79,27 +79,27 @@ Examples are provided to display how user-authored math can be embedded within y
|
|
|
79
79
|
import '@brightspace-ui/core/components/icons/icon.js';
|
|
80
80
|
</script>
|
|
81
81
|
<d2l-html-block>
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
82
|
+
<template>
|
|
83
|
+
<div class="mathml-container">
|
|
84
|
+
<math xmlns="http://www.w3.org/1998/Math/MathML">
|
|
85
|
+
<msqrt>
|
|
86
|
+
<mn>3</mn>
|
|
87
|
+
<mi>x</mi>
|
|
88
|
+
<mo>−</mo>
|
|
89
|
+
<mn>1</mn>
|
|
90
|
+
</msqrt>
|
|
91
|
+
<mo>+</mo>
|
|
92
|
+
<mo stretchy="false">(</mo>
|
|
93
|
+
<mn>1</mn>
|
|
94
|
+
<mo>+</mo>
|
|
95
|
+
<mi>x</mi>
|
|
96
|
+
<msup>
|
|
97
|
+
<mo stretchy="false">)</mo>
|
|
98
|
+
<mn>2</mn>
|
|
99
|
+
</msup>
|
|
100
|
+
</math>
|
|
101
|
+
</div>
|
|
102
|
+
</template>
|
|
103
103
|
</d2l-html-block>
|
|
104
104
|
```
|
|
105
105
|
|
|
@@ -109,26 +109,25 @@ Examples are provided to display how user-authored math can be embedded within y
|
|
|
109
109
|
```html
|
|
110
110
|
<script type="module">
|
|
111
111
|
import '@brightspace-ui/core/components/html-block/html-block.js';
|
|
112
|
-
import '@brightspace-ui/core/components/icons/icon.js';
|
|
113
112
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
113
|
+
window.D2L = {};
|
|
114
|
+
D2L.LP = {};
|
|
115
|
+
D2L.LP.Web = {};
|
|
116
|
+
D2L.LP.Web.UI = {};
|
|
117
|
+
D2L.LP.Web.UI.Flags = {
|
|
118
|
+
Flag: (feature, defaultValue) => {
|
|
119
|
+
if (feature === 'us125413-mathjax-render-latex') return true;
|
|
120
|
+
else return defaultValue;
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
<!-- docs: start hidden content -->
|
|
124
|
+
document.getElementsByTagName('html')[0].dataset.mathjaxContext = JSON.stringify({ renderLatex: true });<!-- docs: end hidden content -->
|
|
126
125
|
</script>
|
|
127
126
|
<d2l-html-block>
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
127
|
+
<template>
|
|
128
|
+
<div class="latex-container">
|
|
129
|
+
$$ f(x) = \int \mathrm{e}^{-x}\,\mathrm{d}x $$ $$ x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a} $$
|
|
130
|
+
</div>
|
|
131
|
+
</template>
|
|
133
132
|
</d2l-html-block>
|
|
134
133
|
```
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
</script>
|
|
40
40
|
<script>
|
|
41
41
|
if (window.location.search.indexOf('latex=true') !== -1) {
|
|
42
|
-
document.getElementsByTagName('html')[0].dataset.mathjaxContext = JSON.stringify({
|
|
42
|
+
document.getElementsByTagName('html')[0].dataset.mathjaxContext = JSON.stringify({ renderLatex: true });
|
|
43
43
|
}
|
|
44
44
|
</script>
|
|
45
45
|
</head>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@brightspace-ui/core",
|
|
3
|
-
"version": "1.202.
|
|
3
|
+
"version": "1.202.2",
|
|
4
4
|
"description": "A collection of accessible, free, open-source web components for building Brightspace applications",
|
|
5
5
|
"repository": "https://github.com/BrightspaceUI/core.git",
|
|
6
6
|
"publishConfig": {
|