@brightspace-ui/core 2.47.0 → 2.47.1

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.
@@ -194,11 +194,17 @@ class HtmlBlock extends RtlMixin(LitElement) {
194
194
  this.noDeferredRendering = false;
195
195
  this._hasSlottedContent = false;
196
196
 
197
+ this._contextObserverControllerResolve = undefined;
198
+ this._contextObserverControllerInitialized = new Promise(resolve => {
199
+ this._contextObserverControllerResolve = resolve;
200
+ });
201
+
197
202
  getRenderers().then(renderers => renderers.reduce((attrs, currentRenderer) => {
198
203
  if (currentRenderer.contextAttributes) currentRenderer.contextAttributes.forEach(attr => attrs.push(attr));
199
204
  return attrs;
200
205
  }, [])).then(rendererContextAttributes => {
201
206
  this._contextObserverController = new HtmlAttributeObserverController(this, ...rendererContextAttributes);
207
+ this._contextObserverControllerResolve();
202
208
  });
203
209
  }
204
210
 
@@ -245,7 +251,7 @@ class HtmlBlock extends RtlMixin(LitElement) {
245
251
  if (changedProperties.has('html') && this.html !== undefined && this.html !== null && !this._hasSlottedContent) {
246
252
  await this._updateRenderContainer();
247
253
  }
248
- if (this._contextChanged()) {
254
+ if (await this._contextChanged()) {
249
255
  if (this._hasSlottedContent) this._render();
250
256
  else if (this.html !== undefined && this.html !== null) {
251
257
  await this._updateRenderContainer();
@@ -255,8 +261,8 @@ class HtmlBlock extends RtlMixin(LitElement) {
255
261
  }
256
262
  }
257
263
 
258
- _contextChanged() {
259
- if (!this._contextObserverController) return false;
264
+ async _contextChanged() {
265
+ await this._contextObserverControllerInitialized;
260
266
  if (!this._contextKeys) {
261
267
  this._updateContextKeys();
262
268
  return true;
@@ -290,9 +296,10 @@ class HtmlBlock extends RtlMixin(LitElement) {
290
296
  }
291
297
 
292
298
  async _processRenderers(elem) {
299
+ await this._contextObserverControllerInitialized;
293
300
  const renderers = await getRenderers();
294
301
  for (const renderer of renderers) {
295
- if (this._contextObserverController && renderer.contextAttributes) {
302
+ if (renderer.contextAttributes) {
296
303
  const contextValues = new Map();
297
304
  renderer.contextAttributes.forEach(attr => contextValues.set(attr, this._contextObserverController.values.get(attr)));
298
305
  await renderer.render(elem, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brightspace-ui/core",
3
- "version": "2.47.0",
3
+ "version": "2.47.1",
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",