@brightspace-ui/core 2.108.0 → 2.110.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/components/html-block/README.md +11 -36
- package/components/html-block/demo/html-block-code.html +1 -3
- package/components/html-block/demo/html-block.html +238 -364
- package/components/html-block/html-block.js +18 -73
- package/components/list/list.js +1 -2
- package/components/paging/pageable-mixin.js +5 -0
- package/components/paging/pageable-subscriber-mixin.js +1 -1
- package/components/paging/pager-load-more.js +2 -2
- package/components/selection/selection-controls.js +18 -7
- package/components/table/demo/table-test.js +10 -8
- package/components/table/table-controls.js +6 -14
- package/components/table/table-wrapper.js +17 -1
- package/custom-elements.json +98 -6
- package/lang/ar.js +2 -1
- package/lang/cy.js +2 -1
- package/lang/da.js +2 -1
- package/lang/de.js +2 -1
- package/lang/en-gb.js +2 -1
- package/lang/en.js +2 -1
- package/lang/es-es.js +2 -1
- package/lang/es.js +2 -1
- package/lang/fr-fr.js +2 -1
- package/lang/fr.js +2 -1
- package/lang/hi.js +2 -1
- package/lang/ja.js +2 -1
- package/lang/ko.js +2 -1
- package/lang/nl.js +2 -1
- package/lang/pt.js +2 -1
- package/lang/sv.js +2 -1
- package/lang/tr.js +2 -1
- package/lang/zh-cn.js +2 -1
- package/lang/zh-tw.js +2 -1
- package/package.json +1 -1
|
@@ -6,7 +6,7 @@ Components to assist with displaying user-authored HTML within your webpage.
|
|
|
6
6
|
|
|
7
7
|
The `d2l-html-block` element is a web component for displaying user-authored HTML. It includes styles for headings, lists, anchors and other elements. In addition, it provides integration with MathJax for rendering MathML.
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Pass the user-authored HTML into the `html` attribute of the `d2l-html-block` and the component will stamp the content into its local DOM where styles will be applied, and math typeset.
|
|
10
10
|
|
|
11
11
|
<!-- docs: demo live name:d2l-html-block autoSize:false size:small -->
|
|
12
12
|
```html
|
|
@@ -14,8 +14,7 @@ Place the user-authored HTML within the `d2l-html-block` and the component will
|
|
|
14
14
|
import '@brightspace-ui/core/components/html-block/html-block.js';
|
|
15
15
|
import '@brightspace-ui/core/components/icons/icon.js';
|
|
16
16
|
</script>
|
|
17
|
-
<d2l-html-block
|
|
18
|
-
<!-- docs: start hidden content -->
|
|
17
|
+
<d2l-html-block html="
|
|
19
18
|
<style>
|
|
20
19
|
div {
|
|
21
20
|
--d2l-icon-fill-color: var(--d2l-color-cinnabar);
|
|
@@ -35,37 +34,15 @@ Place the user-authored HTML within the `d2l-html-block` and the component will
|
|
|
35
34
|
justify-content: center;
|
|
36
35
|
}
|
|
37
36
|
</style>
|
|
38
|
-
|
|
39
|
-
<d2l-icon icon
|
|
37
|
+
<div class="warning-container">
|
|
38
|
+
<d2l-icon icon="tier3:alert"></d2l-icon>
|
|
40
39
|
<span>
|
|
41
40
|
<b>Important:</b> user-authored HTML must be trusted or properly sanitized!
|
|
42
41
|
</span>
|
|
43
|
-
</div>
|
|
42
|
+
</div>">
|
|
44
43
|
</d2l-html-block>
|
|
45
44
|
```
|
|
46
45
|
|
|
47
|
-
To use `d2l-html-block` within another Lit component, use the [unsafeHTML](https://lit.dev/docs/api/directives/#unsafeHTML) directive to avoid escaping the HTML.
|
|
48
|
-
|
|
49
|
-
```html
|
|
50
|
-
<script type="module">
|
|
51
|
-
import { html, LitElement } from 'lit';
|
|
52
|
-
import { unsafeHTML } from 'lit/directives/unsafe-html.js';
|
|
53
|
-
import '@brightspace-ui/core/components/icons/icon.js';
|
|
54
|
-
|
|
55
|
-
class SomeComponent extends LitElement {
|
|
56
|
-
render() {
|
|
57
|
-
return html`
|
|
58
|
-
<d2l-html-block>
|
|
59
|
-
${unsafeHTML(this._unsafeHTML)}
|
|
60
|
-
</d2l-html-block>`;
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
customElements.define('d2l-some-component', SomeComponent);
|
|
65
|
-
</script>
|
|
66
|
-
<d2l-some-component></d2l-some-component>
|
|
67
|
-
```
|
|
68
|
-
|
|
69
46
|
### Rendering MathML and LaTeX
|
|
70
47
|
|
|
71
48
|
Examples are provided to display how user-authored math can be embedded within your webpage. Note that rendering math requires the `mathjax` context to be set correctly. For testing and/or demo pages **ONLY**, you can import `@brightspace-ui/core/tools/mathjax-test-context.js` to set this context for you.
|
|
@@ -78,8 +55,8 @@ Examples are provided to display how user-authored math can be embedded within y
|
|
|
78
55
|
import '@brightspace-ui/core/components/icons/icon.js';
|
|
79
56
|
import '@brightspace-ui/core/tools/mathjax-test-context.js';
|
|
80
57
|
</script>
|
|
81
|
-
<d2l-html-block
|
|
82
|
-
<math xmlns
|
|
58
|
+
<d2l-html-block html="
|
|
59
|
+
<math xmlns="http://www.w3.org/1998/Math/MathML">
|
|
83
60
|
<msqrt>
|
|
84
61
|
<mn>3</mn>
|
|
85
62
|
<mi>x</mi>
|
|
@@ -87,15 +64,15 @@ Examples are provided to display how user-authored math can be embedded within y
|
|
|
87
64
|
<mn>1</mn>
|
|
88
65
|
</msqrt>
|
|
89
66
|
<mo>+</mo>
|
|
90
|
-
<mo stretchy
|
|
67
|
+
<mo stretchy="false">(</mo>
|
|
91
68
|
<mn>1</mn>
|
|
92
69
|
<mo>+</mo>
|
|
93
70
|
<mi>x</mi>
|
|
94
71
|
<msup>
|
|
95
|
-
<mo stretchy
|
|
72
|
+
<mo stretchy="false">)</mo>
|
|
96
73
|
<mn>2</mn>
|
|
97
74
|
</msup>
|
|
98
|
-
</math>
|
|
75
|
+
</math>">
|
|
99
76
|
</d2l-html-block>
|
|
100
77
|
```
|
|
101
78
|
|
|
@@ -107,9 +84,7 @@ Examples are provided to display how user-authored math can be embedded within y
|
|
|
107
84
|
import '@brightspace-ui/core/components/html-block/html-block.js';
|
|
108
85
|
import '@brightspace-ui/core/tools/mathjax-test-context.js';
|
|
109
86
|
</script>
|
|
110
|
-
<d2l-html-block>
|
|
111
|
-
$$ f(x) = \int \mathrm{e}^{-x}\,\mathrm{d}x $$ $$ x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a} $$
|
|
112
|
-
</d2l-html-block>
|
|
87
|
+
<d2l-html-block html="$$ f(x) = \int \mathrm{e}^{-x}\,\mathrm{d}x $$ $$ x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a} $$"></d2l-html-block>
|
|
113
88
|
```
|
|
114
89
|
|
|
115
90
|
### Add Context Automatically to Demos and Tests
|
|
@@ -39,9 +39,7 @@ helloGrumpy('Wizard');</code></pre>
|
|
|
39
39
|
|
|
40
40
|
<h2 class="d2l-heading-3">Inline Samples</h2>
|
|
41
41
|
|
|
42
|
-
<d2l-html-block>
|
|
43
|
-
The best type of donuts are he kind you assign in code, for example: <code class="d2l-code d2l-code-dark language-javascript">const jelly = 'donuts';</code>. The next best type of thing you can assign in code is stuff you can ferment. <code class="d2l-code d2l-code-dark language-javascript">let beer = hopsAndWater.map(ingredients => ferment(ingredients));</code>
|
|
44
|
-
</d2l-html-block>
|
|
42
|
+
<d2l-html-block html="The best type of donuts are he kind you assign in code, for example: <code class="d2l-code d2l-code-dark language-javascript">const jelly = 'donuts';lgt;/code>. The next best type of thing you can assign in code is stuff you can ferment. <code class="d2l-code d2l-code-dark language-javascript">let beer = hopsAndWater.map(ingredients => ferment(ingredients));</code>"></d2l-html-block>
|
|
45
43
|
|
|
46
44
|
</body>
|
|
47
45
|
</html>
|