@pageboard/html 0.14.24 → 0.14.26

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pageboard/html",
3
- "version": "0.14.24",
3
+ "version": "0.14.26",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "repository": {
@@ -25,12 +25,6 @@ class HTMLElementFieldsetList extends Page.Element {
25
25
  this.#resize();
26
26
  return vars;
27
27
  }
28
- patch(state) {
29
- // initialize
30
- if (this.ownView.children.length == 0) {
31
- this.#resize();
32
- }
33
- }
34
28
 
35
29
  reset() {
36
30
  this.#list = this.#defaultList?.slice();
@@ -89,6 +83,9 @@ class HTMLElementFieldsetList extends Page.Element {
89
83
  for (const node of tpl.content.querySelectorAll('[block-id]')) {
90
84
  node.removeAttribute('block-id');
91
85
  }
86
+ if (this.ownView.children.length == 0) {
87
+ this.#resize();
88
+ }
92
89
  }
93
90
  }
94
91
 
package/ui/image.js CHANGED
@@ -157,7 +157,7 @@ const HTMLElementImageConstructor = Superclass => class extends Superclass {
157
157
  this.classList.remove('loading');
158
158
  }
159
159
  captureError(e) {
160
- this.#defer?.reject(e);
160
+ this.#defer?.reject(new Error(this.currentSrc));
161
161
  this.classList.remove('loading');
162
162
  this.classList.add('error');
163
163
  this.placeholder(true);
package/ui/layout.js CHANGED
@@ -60,7 +60,9 @@ class HTMLElementLayout extends Page.create(HTMLDivElement) {
60
60
  this.#defer = new Deferred();
61
61
  const img = new Image();
62
62
  img.addEventListener('load', this.#defer.resolve);
63
- img.addEventListener('error', this.#defer.reject);
63
+ img.addEventListener('error',
64
+ e => this.#defer.reject(new Error(this.currentSrc))
65
+ );
64
66
  img.src = curSrc;
65
67
  this.style.backgroundImage = `url("${curSrc}")`;
66
68
  return this.#defer;
package/ui/transition.js CHANGED
@@ -28,7 +28,8 @@ const loader = new class {
28
28
  }
29
29
  setup(state) {
30
30
  const tr = state.scope.transition;
31
- state.finish(() => {
31
+ state.finish(async () => {
32
+ await document.fonts?.ready;
32
33
  document.body.hidden = false;
33
34
  if (tr?.ok) return tr.start();
34
35
  });