@brightspace-ui/core 2.42.0 → 2.42.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.
- package/components/filter/filter-tags.js +1 -1
- package/components/html-block/demo/html-block.html +125 -0
- package/components/html-block/html-block.js +93 -37
- package/custom-elements.json +15 -2
- package/helpers/mathjax.js +17 -28
- package/helpers/prism.js +0 -2
- package/lang/cy.js +1 -1
- package/lang/de.js +1 -1
- package/lang/es-es.js +1 -1
- package/lang/es.js +1 -1
- package/lang/fr-fr.js +1 -1
- package/lang/fr.js +1 -1
- package/lang/hi.js +1 -1
- package/lang/ja.js +1 -1
- package/lang/ko.js +1 -1
- package/lang/nl.js +1 -1
- package/lang/pt.js +1 -1
- package/lang/sv.js +1 -1
- package/lang/tr.js +1 -1
- package/lang/zh-cn.js +1 -1
- package/lang/zh-tw.js +1 -1
- package/package.json +1 -1
|
@@ -527,6 +527,131 @@
|
|
|
527
527
|
</template>
|
|
528
528
|
</d2l-demo-snippet>
|
|
529
529
|
|
|
530
|
+
<h2>HTML Block (html prop)</h2>
|
|
531
|
+
|
|
532
|
+
<d2l-demo-snippet>
|
|
533
|
+
<template>
|
|
534
|
+
<d2l-html-block html="<math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><mi>x</mi>
|
|
535
|
+
<mo>=</mo>
|
|
536
|
+
<mrow>
|
|
537
|
+
<mfrac>
|
|
538
|
+
<mrow>
|
|
539
|
+
<mo>&#x2212;</mo>
|
|
540
|
+
<mi>b</mi>
|
|
541
|
+
<mo>&#xB1;</mo>
|
|
542
|
+
<msqrt>
|
|
543
|
+
<msup>
|
|
544
|
+
<mi>b</mi>
|
|
545
|
+
<mn>2</mn>
|
|
546
|
+
</msup>
|
|
547
|
+
<mo>&#x2212;</mo>
|
|
548
|
+
<mn>4</mn>
|
|
549
|
+
<mi>a</mi>
|
|
550
|
+
<mi>c</mi>
|
|
551
|
+
</msqrt>
|
|
552
|
+
</mrow>
|
|
553
|
+
<mrow>
|
|
554
|
+
<mn>2</mn>
|
|
555
|
+
<mi>a</mi>
|
|
556
|
+
</mrow>
|
|
557
|
+
</mfrac>
|
|
558
|
+
</mrow>
|
|
559
|
+
<mtext>.</mtext>
|
|
560
|
+
<mspace linebreak="newline"></mspace>
|
|
561
|
+
<msup>
|
|
562
|
+
<mi>e</mi>
|
|
563
|
+
<mrow>
|
|
564
|
+
<mi>i</mi>
|
|
565
|
+
<mi>π<!-- π --></mi>
|
|
566
|
+
</mrow>
|
|
567
|
+
</msup>
|
|
568
|
+
<mo>+</mo>
|
|
569
|
+
<mn>1</mn>
|
|
570
|
+
<mo>=</mo>
|
|
571
|
+
<mn>0</mn>
|
|
572
|
+
</math>
|
|
573
|
+
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
|
|
574
|
+
<msup>
|
|
575
|
+
<mrow>
|
|
576
|
+
<mo>(</mo>
|
|
577
|
+
<mrow>
|
|
578
|
+
<munderover>
|
|
579
|
+
<mo>∑<!-- ∑ --></mo>
|
|
580
|
+
<mrow class="MJX-TeXAtom-ORD">
|
|
581
|
+
<mi>k</mi>
|
|
582
|
+
<mo>=</mo>
|
|
583
|
+
<mn>1</mn>
|
|
584
|
+
</mrow>
|
|
585
|
+
<mi>n</mi>
|
|
586
|
+
</munderover>
|
|
587
|
+
<msub>
|
|
588
|
+
<mi>a</mi>
|
|
589
|
+
<mi>k</mi>
|
|
590
|
+
</msub>
|
|
591
|
+
<msub>
|
|
592
|
+
<mi>b</mi>
|
|
593
|
+
<mi>k</mi>
|
|
594
|
+
</msub>
|
|
595
|
+
</mrow>
|
|
596
|
+
<mo>)</mo>
|
|
597
|
+
</mrow>
|
|
598
|
+
<mrow class="MJX-TeXAtom-ORD">
|
|
599
|
+
<mspace width="negativethinmathspace"></mspace>
|
|
600
|
+
<mspace width="negativethinmathspace"></mspace>
|
|
601
|
+
<mn>2</mn>
|
|
602
|
+
</mrow>
|
|
603
|
+
</msup>
|
|
604
|
+
<mo>≤<!-- ≤ --></mo>
|
|
605
|
+
<mrow>
|
|
606
|
+
<mo>(</mo>
|
|
607
|
+
<mrow>
|
|
608
|
+
<munderover>
|
|
609
|
+
<mo>∑<!-- ∑ --></mo>
|
|
610
|
+
<mrow class="MJX-TeXAtom-ORD">
|
|
611
|
+
<mi>k</mi>
|
|
612
|
+
<mo>=</mo>
|
|
613
|
+
<mn>1</mn>
|
|
614
|
+
</mrow>
|
|
615
|
+
<mi>n</mi>
|
|
616
|
+
</munderover>
|
|
617
|
+
<msubsup>
|
|
618
|
+
<mi>a</mi>
|
|
619
|
+
<mi>k</mi>
|
|
620
|
+
<mn>2</mn>
|
|
621
|
+
</msubsup>
|
|
622
|
+
</mrow>
|
|
623
|
+
<mo>)</mo>
|
|
624
|
+
</mrow>
|
|
625
|
+
<mrow>
|
|
626
|
+
<mo>(</mo>
|
|
627
|
+
<mrow>
|
|
628
|
+
<munderover>
|
|
629
|
+
<mo>∑<!-- ∑ --></mo>
|
|
630
|
+
<mrow class="MJX-TeXAtom-ORD">
|
|
631
|
+
<mi>k</mi>
|
|
632
|
+
<mo>=</mo>
|
|
633
|
+
<mn>1</mn>
|
|
634
|
+
</mrow>
|
|
635
|
+
<mi>n</mi>
|
|
636
|
+
</munderover>
|
|
637
|
+
<msubsup>
|
|
638
|
+
<mi>b</mi>
|
|
639
|
+
<mi>k</mi>
|
|
640
|
+
<mn>2</mn>
|
|
641
|
+
</msubsup>
|
|
642
|
+
</mrow>
|
|
643
|
+
<mo>)</mo>
|
|
644
|
+
</mrow>
|
|
645
|
+
</math>
|
|
646
|
+
<div>$$ {\color{red}x} + {\color{blue}y} = {\color{green}z} $$</div>
|
|
647
|
+
<pre class="d2l-code d2l-code-dark"><code class="language-javascript">function helloGrumpy(name) {
|
|
648
|
+
console.log(`Hi there ${name}.`);
|
|
649
|
+
}
|
|
650
|
+
helloGrumpy('Wizard');</code></pre>">
|
|
651
|
+
</d2l-html-block>
|
|
652
|
+
</template>
|
|
653
|
+
</d2l-demo-snippet>
|
|
654
|
+
|
|
530
655
|
<h2>HTML Block (wrapped)</h2>
|
|
531
656
|
|
|
532
657
|
<d2l-demo-snippet>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import '../colors/colors.js';
|
|
2
2
|
import { codeStyles, HtmlBlockCodeRenderer } from '../../helpers/prism.js';
|
|
3
|
-
import { css, LitElement } from 'lit';
|
|
3
|
+
import { css, html, LitElement } from 'lit';
|
|
4
|
+
import { classMap } from 'lit/directives/class-map.js';
|
|
4
5
|
import { HtmlAttributeObserverController } from '../../controllers/attributeObserver/htmlAttributeObserverController.js';
|
|
5
6
|
import { HtmlBlockMathRenderer } from '../../helpers/mathjax.js';
|
|
6
7
|
import { requestInstance } from '../../mixins/provider-mixin.js';
|
|
@@ -138,8 +139,14 @@ class HtmlBlock extends RtlMixin(LitElement) {
|
|
|
138
139
|
* @type {Boolean}
|
|
139
140
|
*/
|
|
140
141
|
compact: { type: Boolean },
|
|
142
|
+
/**
|
|
143
|
+
* The HTML to be rendered. Ignored if slotted content is provided.
|
|
144
|
+
* @type {String}
|
|
145
|
+
*/
|
|
146
|
+
html: { type: String },
|
|
141
147
|
/**
|
|
142
148
|
* Whether to display the HTML in inline mode
|
|
149
|
+
* @type {Boolean}
|
|
143
150
|
*/
|
|
144
151
|
inline: { type: Boolean },
|
|
145
152
|
/**
|
|
@@ -161,13 +168,17 @@ class HtmlBlock extends RtlMixin(LitElement) {
|
|
|
161
168
|
text-align: left;
|
|
162
169
|
}
|
|
163
170
|
:host([inline]),
|
|
164
|
-
:host([inline])
|
|
171
|
+
:host([inline]) .d2l-html-block-rendered {
|
|
165
172
|
display: inline;
|
|
166
173
|
}
|
|
167
174
|
:host([hidden]),
|
|
168
|
-
:host([no-deferred-rendering])
|
|
175
|
+
:host([no-deferred-rendering]) .d2l-html-block-rendered,
|
|
176
|
+
slot {
|
|
169
177
|
display: none;
|
|
170
178
|
}
|
|
179
|
+
:host([no-deferred-rendering]) slot {
|
|
180
|
+
display: contents;
|
|
181
|
+
}
|
|
171
182
|
:host([dir="rtl"]) {
|
|
172
183
|
text-align: right;
|
|
173
184
|
}
|
|
@@ -177,8 +188,10 @@ class HtmlBlock extends RtlMixin(LitElement) {
|
|
|
177
188
|
constructor() {
|
|
178
189
|
super();
|
|
179
190
|
this.compact = false;
|
|
191
|
+
this.html = '';
|
|
180
192
|
this.inline = false;
|
|
181
193
|
this.noDeferredRendering = false;
|
|
194
|
+
this._hasSlottedContent = false;
|
|
182
195
|
|
|
183
196
|
const rendererContextAttributes = getRenderers().reduce((attrs, currentRenderer) => {
|
|
184
197
|
if (currentRenderer.contextAttributes) currentRenderer.contextAttributes.forEach(attr => attrs.push(attr));
|
|
@@ -196,7 +209,10 @@ class HtmlBlock extends RtlMixin(LitElement) {
|
|
|
196
209
|
|
|
197
210
|
const slot = this.shadowRoot.querySelector('slot');
|
|
198
211
|
if (slot) {
|
|
199
|
-
slot.assignedNodes({ flatten: true })
|
|
212
|
+
const slottedNodes = slot.assignedNodes({ flatten: true });
|
|
213
|
+
this._hasSlottedContent = this._hasSlottedElements(slottedNodes);
|
|
214
|
+
|
|
215
|
+
slottedNodes.forEach(
|
|
200
216
|
node => this._contentObserver.observe(node, { attributes: true, childList: true, subtree: true })
|
|
201
217
|
);
|
|
202
218
|
}
|
|
@@ -209,52 +225,81 @@ class HtmlBlock extends RtlMixin(LitElement) {
|
|
|
209
225
|
|
|
210
226
|
firstUpdated(changedProperties) {
|
|
211
227
|
super.firstUpdated(changedProperties);
|
|
228
|
+
this._updateContextKeys();
|
|
229
|
+
}
|
|
212
230
|
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
+ '"></div><slot'
|
|
219
|
-
+ `${!this.noDeferredRendering ? ' style="display: none"' : ''}`
|
|
220
|
-
+ '></slot>';
|
|
231
|
+
render() {
|
|
232
|
+
const renderContainerClasses = {
|
|
233
|
+
'd2l-html-block-rendered': true,
|
|
234
|
+
'd2l-html-block-compact': this.compact
|
|
235
|
+
};
|
|
221
236
|
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
237
|
+
return html`
|
|
238
|
+
<div class="${classMap(renderContainerClasses)}"></div>
|
|
239
|
+
<slot @slotchange="${this._handleSlotChange}"></slot>
|
|
240
|
+
`;
|
|
225
241
|
}
|
|
226
242
|
|
|
227
|
-
updated() {
|
|
228
|
-
super.updated();
|
|
229
|
-
if (this.
|
|
243
|
+
async updated(changedProperties) {
|
|
244
|
+
super.updated(changedProperties);
|
|
245
|
+
if (changedProperties.has('html') && this.html !== undefined && this.html !== null && !this._hasSlottedContent) {
|
|
246
|
+
await this._updateRenderContainer();
|
|
247
|
+
}
|
|
248
|
+
if (this._contextChanged()) {
|
|
249
|
+
if (this._hasSlottedContent) this._render();
|
|
250
|
+
else if (this.html !== undefined && this.html !== null) {
|
|
251
|
+
await this._updateRenderContainer();
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
this._updateContextKeys();
|
|
255
|
+
}
|
|
230
256
|
}
|
|
231
257
|
|
|
232
|
-
|
|
233
|
-
if (this.
|
|
234
|
-
|
|
258
|
+
_contextChanged() {
|
|
259
|
+
if (!this._contextObserverController) return false;
|
|
260
|
+
|
|
261
|
+
if (this._contextKeys.size !== this._contextObserverController.values.size) return true;
|
|
262
|
+
for (const [attr, val] of this._contextKeys) {
|
|
235
263
|
if (!this._contextObserverController.values.has(attr)) return true;
|
|
236
264
|
if (this._contextObserverController.values.get(attr) !== val) return true;
|
|
237
265
|
}
|
|
238
266
|
return false;
|
|
239
267
|
}
|
|
240
268
|
|
|
269
|
+
async _handleSlotChange(e) {
|
|
270
|
+
if (!e.target || !this.shadowRoot) return;
|
|
271
|
+
const slot = this.shadowRoot.querySelector('slot');
|
|
272
|
+
const slottedNodes = slot.assignedNodes({ flatten: true });
|
|
273
|
+
|
|
274
|
+
if (!this.html && this._hasSlottedElements(slottedNodes)) {
|
|
275
|
+
this._hasSlottedContent = true;
|
|
276
|
+
await this._render(e.target);
|
|
277
|
+
} else {
|
|
278
|
+
this._hasSlottedContent = false;
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
_hasSlottedElements(slottedNodes) {
|
|
283
|
+
if (!slottedNodes || slottedNodes.length === 0) return false;
|
|
284
|
+
if (slottedNodes.filter(node => node.nodeType === Node.ELEMENT_NODE || node.textContent).length === 0) return false;
|
|
285
|
+
return true;
|
|
286
|
+
}
|
|
287
|
+
|
|
241
288
|
async _processRenderers(elem) {
|
|
242
289
|
for (const renderer of getRenderers()) {
|
|
243
290
|
if (this._contextObserverController && renderer.contextAttributes) {
|
|
244
291
|
const contextValues = new Map();
|
|
245
292
|
renderer.contextAttributes.forEach(attr => contextValues.set(attr, this._contextObserverController.values.get(attr)));
|
|
246
|
-
|
|
293
|
+
await renderer.render(elem, {
|
|
247
294
|
contextValues: contextValues,
|
|
248
295
|
noDeferredRendering: this.noDeferredRendering
|
|
249
296
|
});
|
|
250
297
|
} else {
|
|
251
|
-
|
|
298
|
+
await renderer.render(elem, {
|
|
252
299
|
noDeferredRendering: this.noDeferredRendering
|
|
253
300
|
});
|
|
254
301
|
}
|
|
255
302
|
}
|
|
256
|
-
|
|
257
|
-
return elem;
|
|
258
303
|
}
|
|
259
304
|
|
|
260
305
|
async _render(slot) {
|
|
@@ -274,20 +319,16 @@ class HtmlBlock extends RtlMixin(LitElement) {
|
|
|
274
319
|
}
|
|
275
320
|
|
|
276
321
|
_stamp(slot) {
|
|
277
|
-
const
|
|
278
|
-
if (nodes && nodes.length > 0) {
|
|
279
|
-
|
|
280
|
-
let temp = document.createElement('div');
|
|
281
|
-
temp.style.display = 'none';
|
|
282
|
-
nodes.forEach(node => temp.appendChild(node.cloneNode(true)));
|
|
322
|
+
const renderContainer = this.shadowRoot.querySelector('.d2l-html-block-rendered');
|
|
283
323
|
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
324
|
+
const stampHTML = async nodes => {
|
|
325
|
+
renderContainer.innerHTML = '';
|
|
326
|
+
if (!nodes || nodes.length === 0) return;
|
|
287
327
|
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
328
|
+
// Nodes must be cloned into the render container before processing, as
|
|
329
|
+
// some renderers require connected nodes (e.g. MathJax).
|
|
330
|
+
nodes.forEach(node => renderContainer.appendChild(node.cloneNode(true)));
|
|
331
|
+
await this._processRenderers(renderContainer);
|
|
291
332
|
};
|
|
292
333
|
|
|
293
334
|
if (this._contentObserver) this._contentObserver.disconnect();
|
|
@@ -303,6 +344,21 @@ class HtmlBlock extends RtlMixin(LitElement) {
|
|
|
303
344
|
stampHTML(slottedNodes);
|
|
304
345
|
}
|
|
305
346
|
|
|
347
|
+
_updateContextKeys() {
|
|
348
|
+
if (!this._contextObserverController) return;
|
|
349
|
+
if (!this._contextKeys) this._contextKeys = new Map();
|
|
350
|
+
|
|
351
|
+
this._contextObserverController.values.forEach((val, attr) => {
|
|
352
|
+
this._contextKeys.set(attr, val);
|
|
353
|
+
});
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
async _updateRenderContainer() {
|
|
357
|
+
const renderContainer = this.shadowRoot.querySelector('.d2l-html-block-rendered');
|
|
358
|
+
renderContainer.innerHTML = this.html;
|
|
359
|
+
await this._processRenderers(renderContainer);
|
|
360
|
+
}
|
|
361
|
+
|
|
306
362
|
}
|
|
307
363
|
|
|
308
364
|
customElements.define('d2l-html-block', HtmlBlock);
|
package/custom-elements.json
CHANGED
|
@@ -3810,10 +3810,16 @@
|
|
|
3810
3810
|
"type": "Boolean",
|
|
3811
3811
|
"default": "false"
|
|
3812
3812
|
},
|
|
3813
|
+
{
|
|
3814
|
+
"name": "html",
|
|
3815
|
+
"description": "The HTML to be rendered. Ignored if slotted content is provided.",
|
|
3816
|
+
"type": "String",
|
|
3817
|
+
"default": "\"\""
|
|
3818
|
+
},
|
|
3813
3819
|
{
|
|
3814
3820
|
"name": "inline",
|
|
3815
3821
|
"description": "Whether to display the HTML in inline mode",
|
|
3816
|
-
"type": "
|
|
3822
|
+
"type": "Boolean",
|
|
3817
3823
|
"default": "false"
|
|
3818
3824
|
},
|
|
3819
3825
|
{
|
|
@@ -3831,11 +3837,18 @@
|
|
|
3831
3837
|
"type": "Boolean",
|
|
3832
3838
|
"default": "false"
|
|
3833
3839
|
},
|
|
3840
|
+
{
|
|
3841
|
+
"name": "html",
|
|
3842
|
+
"attribute": "html",
|
|
3843
|
+
"description": "The HTML to be rendered. Ignored if slotted content is provided.",
|
|
3844
|
+
"type": "String",
|
|
3845
|
+
"default": "\"\""
|
|
3846
|
+
},
|
|
3834
3847
|
{
|
|
3835
3848
|
"name": "inline",
|
|
3836
3849
|
"attribute": "inline",
|
|
3837
3850
|
"description": "Whether to display the HTML in inline mode",
|
|
3838
|
-
"type": "
|
|
3851
|
+
"type": "Boolean",
|
|
3839
3852
|
"default": "false"
|
|
3840
3853
|
},
|
|
3841
3854
|
{
|
package/helpers/mathjax.js
CHANGED
|
@@ -61,35 +61,18 @@ export class HtmlBlockMathRenderer {
|
|
|
61
61
|
// This work-around should be removed when linebreaks are natively supported.
|
|
62
62
|
// MathJax issue: https://github.com/mathjax/MathJax/issues/2312
|
|
63
63
|
// A duplicate that explains our exact issue: https://github.com/mathjax/MathJax/issues/2495
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
if (options.noDeferredRendering) {
|
|
69
|
-
elem.querySelectorAll('mspace[linebreak="newline"]').forEach(elm => {
|
|
70
|
-
elm.setAttribute('style', lineBreakStyle);
|
|
71
|
-
});
|
|
72
|
-
|
|
73
|
-
await window.MathJax.startup.promise;
|
|
74
|
-
renderingPromise = renderingPromise.then(() => window.MathJax.typesetShadow(elem.getRootNode(), elem));
|
|
75
|
-
await renderingPromise;
|
|
76
|
-
return elem;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
const inner = elem.innerHTML.replace(/<mspace linebreak="newline">/gi, `<mspace linebreak="newline" style="${lineBreakStyle}">`);
|
|
80
|
-
|
|
81
|
-
const temp = document.createElement('div');
|
|
82
|
-
temp.style.display = 'none';
|
|
83
|
-
temp.attachShadow({ mode: 'open' });
|
|
84
|
-
temp.shadowRoot.innerHTML = `<div><mjx-doc><mjx-head></mjx-head><mjx-body>${inner}</mjx-body></mjx-doc></div>`;
|
|
64
|
+
elem.querySelectorAll('mspace[linebreak="newline"]').forEach(elm => {
|
|
65
|
+
elm.style.display = 'block';
|
|
66
|
+
elm.style.height = '0.5rem';
|
|
67
|
+
});
|
|
85
68
|
|
|
86
|
-
|
|
69
|
+
// If we're using deferred rendering, we need to create a document structure
|
|
70
|
+
// within the element so MathJax can appropriately process math.
|
|
71
|
+
if (!options.noDeferredRendering) elem.innerHTML = `<mjx-doc><mjx-head></mjx-head><mjx-body>${elem.innerHTML}</mjx-body></mjx-doc>`;
|
|
87
72
|
|
|
88
73
|
await window.MathJax.startup.promise;
|
|
89
|
-
renderingPromise = renderingPromise.then(() => window.MathJax.typesetShadow(
|
|
74
|
+
renderingPromise = renderingPromise.then(() => window.MathJax.typesetShadow(elem.getRootNode(), elem));
|
|
90
75
|
await renderingPromise;
|
|
91
|
-
|
|
92
|
-
return temp.shadowRoot.firstChild;
|
|
93
76
|
}
|
|
94
77
|
|
|
95
78
|
}
|
|
@@ -129,12 +112,18 @@ export function loadMathJax(mathJaxConfig) {
|
|
|
129
112
|
const AbstractHandler = window.MathJax._.core.Handler.AbstractHandler.prototype;
|
|
130
113
|
const startup = window.MathJax.startup;
|
|
131
114
|
|
|
115
|
+
const getFirstChild = doc => {
|
|
116
|
+
const child = doc.firstChild;
|
|
117
|
+
if (!child || child.nodeType === Node.ELEMENT_NODE) return child;
|
|
118
|
+
else return child.nextElementSibling;
|
|
119
|
+
};
|
|
120
|
+
|
|
132
121
|
//
|
|
133
122
|
// Extend HTMLAdaptor to handle shadowDOM as the document
|
|
134
123
|
//
|
|
135
124
|
class ShadowAdaptor extends HTMLAdaptor {
|
|
136
125
|
body(doc) {
|
|
137
|
-
return doc.body || (doc
|
|
126
|
+
return doc.body || (getFirstChild(doc) || {}).lastChild || doc;
|
|
138
127
|
}
|
|
139
128
|
create(kind, ns) {
|
|
140
129
|
const document = (this.document.createElement ? this.document : this.window.document);
|
|
@@ -143,10 +132,10 @@ export function loadMathJax(mathJaxConfig) {
|
|
|
143
132
|
document.createElement(kind));
|
|
144
133
|
}
|
|
145
134
|
head(doc) {
|
|
146
|
-
return doc.head || (doc
|
|
135
|
+
return doc.head || (getFirstChild(doc) || {}).firstChild || doc;
|
|
147
136
|
}
|
|
148
137
|
root(doc) {
|
|
149
|
-
return doc.documentElement || doc
|
|
138
|
+
return doc.documentElement || getFirstChild(doc) || doc;
|
|
150
139
|
}
|
|
151
140
|
text(text) {
|
|
152
141
|
const document = (this.document.createTextNode ? this.document : this.window.document);
|
package/helpers/prism.js
CHANGED
|
@@ -450,8 +450,6 @@ export async function formatCodeElement(elem) {
|
|
|
450
450
|
|
|
451
451
|
if (!elem.dataset.language && languageInfo.key !== 'plain') elem.dataset.language = languageInfo.desc;
|
|
452
452
|
Prism.highlightElement(code);
|
|
453
|
-
|
|
454
|
-
return elem;
|
|
455
453
|
}
|
|
456
454
|
|
|
457
455
|
export class HtmlBlockCodeRenderer {
|
package/lang/cy.js
CHANGED
|
@@ -92,7 +92,7 @@ export default {
|
|
|
92
92
|
"components.more-less.more": "mwy",
|
|
93
93
|
"components.overflow-group.moreActions": "Rhagor o Gamau Gweithredu",
|
|
94
94
|
"components.pager-load-more.action": "Lwytho {count} Arall",
|
|
95
|
-
"components.pager-load-more.info": "{totalCount, plural, one {{showingCount}
|
|
95
|
+
"components.pager-load-more.info": "{totalCount, plural, one {{showingCount} o {totalCountFormatted} eitem} other {{showingCount} o {totalCountFormatted} eitem}}",
|
|
96
96
|
"components.pager-load-more.status-loading": "Llwytho rhagor o eitemau",
|
|
97
97
|
"components.selection.action-hint": "Dewiswch eitem i gyflawni'r weithred hon.",
|
|
98
98
|
"components.selection.select-all": "Dewis y Cyfan",
|
package/lang/de.js
CHANGED
|
@@ -92,7 +92,7 @@ export default {
|
|
|
92
92
|
"components.more-less.more": "mehr",
|
|
93
93
|
"components.overflow-group.moreActions": "Weitere Aktionen",
|
|
94
94
|
"components.pager-load-more.action": "{count} weitere laden",
|
|
95
|
-
"components.pager-load-more.info": "{totalCount, plural, one {{showingCount}
|
|
95
|
+
"components.pager-load-more.info": "{totalCount, plural, one {{showingCount} von {totalCountFormatted} Element} other {{showingCount} von {totalCountFormatted} Elementen}}",
|
|
96
96
|
"components.pager-load-more.status-loading": "Weitere Elemente werden geladen",
|
|
97
97
|
"components.selection.action-hint": "Wählen Sie ein Element aus, um diese Aktion auszuführen.",
|
|
98
98
|
"components.selection.select-all": "Alle auswählen",
|
package/lang/es-es.js
CHANGED
|
@@ -92,7 +92,7 @@ export default {
|
|
|
92
92
|
"components.more-less.more": "más",
|
|
93
93
|
"components.overflow-group.moreActions": "Más acciones",
|
|
94
94
|
"components.pager-load-more.action": "Cargar {count} más",
|
|
95
|
-
"components.pager-load-more.info": "{totalCount, plural, one {{showingCount}
|
|
95
|
+
"components.pager-load-more.info": "{totalCount, plural, one {{showingCount} de {totalCountFormatted} elemento} other {{showingCount} de {totalCountFormatted} elemento}}",
|
|
96
96
|
"components.pager-load-more.status-loading": "Cargando más elementos",
|
|
97
97
|
"components.selection.action-hint": "Seleccione un elemento para realizar esta acción.",
|
|
98
98
|
"components.selection.select-all": "Seleccionar todo",
|
package/lang/es.js
CHANGED
|
@@ -92,7 +92,7 @@ export default {
|
|
|
92
92
|
"components.more-less.more": "más",
|
|
93
93
|
"components.overflow-group.moreActions": "Más acciones",
|
|
94
94
|
"components.pager-load-more.action": "Cargar {count} más",
|
|
95
|
-
"components.pager-load-more.info": "{totalCount, plural, one {{showingCount}
|
|
95
|
+
"components.pager-load-more.info": "{totalCount, plural, one {{showingCount} de {totalCountFormatted} elemento} other {{showingCount} de {totalCountFormatted} elemento}}",
|
|
96
96
|
"components.pager-load-more.status-loading": "Cargando más elementos",
|
|
97
97
|
"components.selection.action-hint": "Seleccione un elemento para realizar esta acción.",
|
|
98
98
|
"components.selection.select-all": "Seleccionar todo",
|
package/lang/fr-fr.js
CHANGED
|
@@ -92,7 +92,7 @@ export default {
|
|
|
92
92
|
"components.more-less.more": "plus",
|
|
93
93
|
"components.overflow-group.moreActions": "Plus d'actions",
|
|
94
94
|
"components.pager-load-more.action": "Charger {count} supplémentaire(s)",
|
|
95
|
-
"components.pager-load-more.info": "{totalCount, plural, one {{showingCount}
|
|
95
|
+
"components.pager-load-more.info": "{totalCount, plural, one {{showingCount} sur {totalCountFormatted} élément} other {{showingCount} sur {totalCountFormatted} éléments}}",
|
|
96
96
|
"components.pager-load-more.status-loading": "Charger plus d’éléments",
|
|
97
97
|
"components.selection.action-hint": "Sélectionnez un élément pour exécuter cette action.",
|
|
98
98
|
"components.selection.select-all": "Tout sélectionner",
|
package/lang/fr.js
CHANGED
|
@@ -92,7 +92,7 @@ export default {
|
|
|
92
92
|
"components.more-less.more": "plus",
|
|
93
93
|
"components.overflow-group.moreActions": "Plus d'actions",
|
|
94
94
|
"components.pager-load-more.action": "Charger {count} de plus",
|
|
95
|
-
"components.pager-load-more.info": "{totalCount, plural, one {{showingCount}
|
|
95
|
+
"components.pager-load-more.info": "{totalCount, plural, one {{showingCount} de {totalCountFormatted} élément} other {{showingCount} de {totalCountFormatted} éléments}}",
|
|
96
96
|
"components.pager-load-more.status-loading": "Chargement d'autres d'éléments",
|
|
97
97
|
"components.selection.action-hint": "Sélectionner un élément pour exécuter cette action.",
|
|
98
98
|
"components.selection.select-all": "Tout sélectionner",
|
package/lang/hi.js
CHANGED
|
@@ -92,7 +92,7 @@ export default {
|
|
|
92
92
|
"components.more-less.more": "अधिक",
|
|
93
93
|
"components.overflow-group.moreActions": "अधिक क्रियाएँ",
|
|
94
94
|
"components.pager-load-more.action": "{count} और लोड करें",
|
|
95
|
-
"components.pager-load-more.info": "{totalCount, plural, one {{
|
|
95
|
+
"components.pager-load-more.info": "{totalCount, plural, one {{totalCountFormatted} में से {showingCount} आइटम} other {{totalCountFormatted} में से {showingCount} आइटम}}",
|
|
96
96
|
"components.pager-load-more.status-loading": "और आइटम लोड करना",
|
|
97
97
|
"components.selection.action-hint": "यह कार्रवाई निष्पादित करने के लिए कोई आइटम का चयन करें।",
|
|
98
98
|
"components.selection.select-all": "सभी का चयन करें",
|
package/lang/ja.js
CHANGED
|
@@ -92,7 +92,7 @@ export default {
|
|
|
92
92
|
"components.more-less.more": "増やす",
|
|
93
93
|
"components.overflow-group.moreActions": "その他のアクション",
|
|
94
94
|
"components.pager-load-more.action": "さらに {count} 件を読み込む",
|
|
95
|
-
"components.pager-load-more.info": "{totalCount, plural, other {{showingCount}
|
|
95
|
+
"components.pager-load-more.info": "{totalCount, plural, other {{showingCount}/{totalCountFormatted} 個の項目}}",
|
|
96
96
|
"components.pager-load-more.status-loading": "さらに項目を読み込み中",
|
|
97
97
|
"components.selection.action-hint": "このアクションを実行するための項目を選択します。",
|
|
98
98
|
"components.selection.select-all": "すべて選択",
|
package/lang/ko.js
CHANGED
|
@@ -92,7 +92,7 @@ export default {
|
|
|
92
92
|
"components.more-less.more": "더 보기",
|
|
93
93
|
"components.overflow-group.moreActions": "추가 작업",
|
|
94
94
|
"components.pager-load-more.action": "{count}개 더 로드",
|
|
95
|
-
"components.pager-load-more.info": "{totalCount, plural, other {{
|
|
95
|
+
"components.pager-load-more.info": "{totalCount, plural, other {{totalCountFormatted}개 항목 중 {showingCount}개}}",
|
|
96
96
|
"components.pager-load-more.status-loading": "더 많은 항목 로드",
|
|
97
97
|
"components.selection.action-hint": "이 작업을 수행할 항목을 선택하십시오.",
|
|
98
98
|
"components.selection.select-all": "모두 선택",
|
package/lang/nl.js
CHANGED
|
@@ -92,7 +92,7 @@ export default {
|
|
|
92
92
|
"components.more-less.more": "meer",
|
|
93
93
|
"components.overflow-group.moreActions": "Meer acties",
|
|
94
94
|
"components.pager-load-more.action": "Laad nog {count} extra",
|
|
95
|
-
"components.pager-load-more.info": "{totalCount, plural, one {{showingCount}
|
|
95
|
+
"components.pager-load-more.info": "{totalCount, plural, one {{showingCount} van {totalCountFormatted} artikel} other {{showingCount} van {totalCountFormatted} artikelen}}",
|
|
96
96
|
"components.pager-load-more.status-loading": "Er worden meer items geladen",
|
|
97
97
|
"components.selection.action-hint": "Selecteer een item om deze actie uit te voeren.",
|
|
98
98
|
"components.selection.select-all": "Alles selecteren",
|
package/lang/pt.js
CHANGED
|
@@ -92,7 +92,7 @@ export default {
|
|
|
92
92
|
"components.more-less.more": "mais",
|
|
93
93
|
"components.overflow-group.moreActions": "Mais ações",
|
|
94
94
|
"components.pager-load-more.action": "Carregar mais {count}",
|
|
95
|
-
"components.pager-load-more.info": "{totalCount, plural, one {{showingCount}
|
|
95
|
+
"components.pager-load-more.info": "{totalCount, plural, one {{showingCount} de {totalCountFormatted} item} other {{showingCount} de {totalCountFormatted} itens}}",
|
|
96
96
|
"components.pager-load-more.status-loading": "Carregando mais itens",
|
|
97
97
|
"components.selection.action-hint": "Selecione um item para realizar esta ação.",
|
|
98
98
|
"components.selection.select-all": "Selecionar tudo",
|
package/lang/sv.js
CHANGED
|
@@ -92,7 +92,7 @@ export default {
|
|
|
92
92
|
"components.more-less.more": "mer",
|
|
93
93
|
"components.overflow-group.moreActions": "Fler åtgärder",
|
|
94
94
|
"components.pager-load-more.action": "Läs in {count} till",
|
|
95
|
-
"components.pager-load-more.info": "{totalCount, plural, one {{showingCount}
|
|
95
|
+
"components.pager-load-more.info": "{totalCount, plural, one {{showingCount} av {totalCountFormatted} objekt} other {{showingCount} av {totalCountFormatted} objekt}}",
|
|
96
96
|
"components.pager-load-more.status-loading": "Läser in fler objekt",
|
|
97
97
|
"components.selection.action-hint": "Välj ett objekt för att utföra åtgärden.",
|
|
98
98
|
"components.selection.select-all": "Välj alla",
|
package/lang/tr.js
CHANGED
|
@@ -92,7 +92,7 @@ export default {
|
|
|
92
92
|
"components.more-less.more": "daha fazla",
|
|
93
93
|
"components.overflow-group.moreActions": "Daha Fazla Eylem",
|
|
94
94
|
"components.pager-load-more.action": "{count} Tane Daha Yükle",
|
|
95
|
-
"components.pager-load-more.info": "{totalCount, plural, one {{showingCount}
|
|
95
|
+
"components.pager-load-more.info": "{totalCount, plural, one {{showingCount} / {totalCountFormatted} öğe} other {{showingCount} / {totalCountFormatted} öğe}}",
|
|
96
96
|
"components.pager-load-more.status-loading": "Daha fazla öğe yükleniyor",
|
|
97
97
|
"components.selection.action-hint": "Bu eylemi gerçekleştirebilmek için bir öğe seçin.",
|
|
98
98
|
"components.selection.select-all": "Tümünü Seç",
|
package/lang/zh-cn.js
CHANGED
|
@@ -92,7 +92,7 @@ export default {
|
|
|
92
92
|
"components.more-less.more": "更多",
|
|
93
93
|
"components.overflow-group.moreActions": "更多操作",
|
|
94
94
|
"components.pager-load-more.action": "再加载 {count} 个",
|
|
95
|
-
"components.pager-load-more.info": "{totalCount, plural, other {{showingCount}
|
|
95
|
+
"components.pager-load-more.info": "{totalCount, plural, other {{showingCount}/{totalCountFormatted} 项}}",
|
|
96
96
|
"components.pager-load-more.status-loading": "加载更多项目",
|
|
97
97
|
"components.selection.action-hint": "选择一个项目后才能执行此操作。",
|
|
98
98
|
"components.selection.select-all": "全选",
|
package/lang/zh-tw.js
CHANGED
|
@@ -92,7 +92,7 @@ export default {
|
|
|
92
92
|
"components.more-less.more": "較多",
|
|
93
93
|
"components.overflow-group.moreActions": "其他動作",
|
|
94
94
|
"components.pager-load-more.action": "再載入 {count} 個",
|
|
95
|
-
"components.pager-load-more.info": "{totalCount, plural, other {{showingCount}
|
|
95
|
+
"components.pager-load-more.info": "{totalCount, plural, other {{showingCount} 項,共 {totalCountFormatted} 項}}",
|
|
96
96
|
"components.pager-load-more.status-loading": "正在載入更多項目",
|
|
97
97
|
"components.selection.action-hint": "選取項目以執行此動作。",
|
|
98
98
|
"components.selection.select-all": "全選",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@brightspace-ui/core",
|
|
3
|
-
"version": "2.42.
|
|
3
|
+
"version": "2.42.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",
|