@pageboard/html 0.15.4 → 0.15.6

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.15.4",
3
+ "version": "0.15.6",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "repository": {
package/ui/form.js CHANGED
@@ -366,7 +366,13 @@ class HTMLElementForm extends Page.create(HTMLFormElement) {
366
366
  vary = "patch";
367
367
  }
368
368
  }
369
- state.push(loc, { vary });
369
+ state.debounce(
370
+ () => {
371
+ msg.classList.remove('visible');
372
+ return state.push(loc, { vary });
373
+ },
374
+ msg.dataset.fading ? 1000 : 100
375
+ )();
370
376
  }
371
377
  }
372
378
  window.HTMLElementForm = HTMLElementForm;
package/ui/image.js CHANGED
@@ -132,7 +132,6 @@ const HTMLElementImageConstructor = Superclass => class extends Superclass {
132
132
  }
133
133
 
134
134
  reveal(state) {
135
- const img = this.image;
136
135
  if (!this.options.src) {
137
136
  this.placeholder(true);
138
137
  return;
@@ -140,6 +139,7 @@ const HTMLElementImageConstructor = Superclass => class extends Superclass {
140
139
  if (this.classList.contains('loading')) {
141
140
  return;
142
141
  }
142
+ const img = this.image;
143
143
  const srcLoc = Page.parse(this.options.src);
144
144
  const reqSrc = this.requestSrc(srcLoc);
145
145
  if (!reqSrc) {
@@ -153,14 +153,14 @@ const HTMLElementImageConstructor = Superclass => class extends Superclass {
153
153
  }
154
154
  }
155
155
  captureLoad() {
156
- this.#defer?.resolve();
157
156
  this.classList.remove('loading');
157
+ this.#defer?.resolve();
158
158
  }
159
159
  captureError(e) {
160
- this.#defer?.reject(new Error(this.currentSrc));
161
160
  this.classList.remove('loading');
162
161
  this.classList.add('error');
163
162
  this.placeholder(true);
163
+ this.#defer?.reject(new Error(this.currentSrc));
164
164
  }
165
165
  placeholder(error) {
166
166
  this.image.removeAttribute('src');