@brightspace-ui/core 3.34.0 → 3.35.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.
@@ -216,7 +216,10 @@ class HtmlBlock extends LitElement {
|
|
216
216
|
|
217
217
|
const contextValsPromise = contextKeysPromise.then(contextKeys => {
|
218
218
|
return Promise.allSettled(contextKeys.map(key => {
|
219
|
-
return tryGet(key, undefined, ctx =>
|
219
|
+
return tryGet(key, undefined, ctx => {
|
220
|
+
this._context.set(key, ctx);
|
221
|
+
this.updated(new Map([['_context']]));
|
222
|
+
});
|
220
223
|
}));
|
221
224
|
});
|
222
225
|
|
@@ -234,24 +237,17 @@ class HtmlBlock extends LitElement {
|
|
234
237
|
'd2l-html-block-compact': this.compact
|
235
238
|
};
|
236
239
|
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
`;
|
244
|
-
} else {
|
245
|
-
return html`
|
246
|
-
<div class="${classMap(renderContainerClasses)}"></div>
|
247
|
-
${this.noDeferredRendering ? html`<slot @slotchange="${this._handleSlotChange}"></slot>` : ''}
|
248
|
-
`;
|
249
|
-
}
|
240
|
+
return html`
|
241
|
+
<div class="${classMap(renderContainerClasses)}">
|
242
|
+
${!this.noDeferredRendering ? until(this._processEmbeds(), nothing) : nothing}
|
243
|
+
</div>
|
244
|
+
${this.noDeferredRendering ? html`<slot @slotchange="${this._handleSlotChange}"></slot>` : ''}
|
245
|
+
`;
|
250
246
|
}
|
251
247
|
|
252
248
|
async updated(changedProperties) {
|
253
249
|
super.updated(changedProperties);
|
254
|
-
if ((changedProperties.has('
|
250
|
+
if ((changedProperties.has('embeds') || changedProperties.has('_context')) && this.html !== undefined && this.html !== null && !this.noDeferredRendering) {
|
255
251
|
await this._updateRenderContainer();
|
256
252
|
}
|
257
253
|
}
|
@@ -260,10 +256,6 @@ class HtmlBlock extends LitElement {
|
|
260
256
|
return this._renderersProcessedPromise;
|
261
257
|
}
|
262
258
|
|
263
|
-
_embedsFeatureEnabled() {
|
264
|
-
return window.D2L?.LP?.Web?.UI?.Flags.Flag('shield-7574-enable-embed-rendering-framework', true);
|
265
|
-
}
|
266
|
-
|
267
259
|
async _handleSlotChange(e) {
|
268
260
|
if (!e.target || !this.shadowRoot || !this.noDeferredRendering) return;
|
269
261
|
await this._renderInline(e.target);
|
@@ -272,6 +264,7 @@ class HtmlBlock extends LitElement {
|
|
272
264
|
async _processEmbeds() {
|
273
265
|
const htmlFragment = document.createRange().createContextualFragment(this.html);
|
274
266
|
await renderEmbeds(htmlFragment);
|
267
|
+
this.updated(new Map([['embeds']]));
|
275
268
|
return htmlFragment;
|
276
269
|
}
|
277
270
|
|
@@ -315,7 +308,6 @@ class HtmlBlock extends LitElement {
|
|
315
308
|
|
316
309
|
async _updateRenderContainer() {
|
317
310
|
const renderContainer = this.shadowRoot.querySelector('.d2l-html-block-rendered');
|
318
|
-
if (!this._embedsFeatureEnabled()) renderContainer.innerHTML = this.html;
|
319
311
|
await this._processRenderers(renderContainer);
|
320
312
|
}
|
321
313
|
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@brightspace-ui/core",
|
3
|
-
"version": "3.
|
3
|
+
"version": "3.35.0",
|
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",
|