@schukai/monster 4.84.0 → 4.85.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.
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,22 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
+
## [4.85.1] - 2026-01-08
|
|
6
|
+
|
|
7
|
+
### Bug Fixes
|
|
8
|
+
|
|
9
|
+
- Add new issue page and enhanced message state button functionality
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
## [4.85.0] - 2026-01-08
|
|
14
|
+
|
|
15
|
+
### Add Features
|
|
16
|
+
|
|
17
|
+
- Improve spinner visibility control in DatasourceStatus component
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
5
21
|
## [4.84.0] - 2026-01-08
|
|
6
22
|
|
|
7
23
|
### Add Features
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"author":"Volker Schukai","dependencies":{"@floating-ui/dom":"^1.7.4","@popperjs/core":"^2.11.8"},"description":"Monster is a simple library for creating fast, robust and lightweight websites.","homepage":"https://monsterjs.org/","keywords":["framework","web","dom","css","sass","mobile-first","app","front-end","templates","schukai","core","shopcloud","alvine","monster","buildmap","stack","observer","observable","uuid","node","nodelist","css-in-js","logger","log","theme"],"license":"AGPL 3.0","main":"source/monster.mjs","module":"source/monster.mjs","name":"@schukai/monster","repository":{"type":"git","url":"https://gitlab.schukai.com/oss/libraries/javascript/monster.git"},"type":"module","version":"4.
|
|
1
|
+
{"author":"Volker Schukai","dependencies":{"@floating-ui/dom":"^1.7.4","@popperjs/core":"^2.11.8"},"description":"Monster is a simple library for creating fast, robust and lightweight websites.","homepage":"https://monsterjs.org/","keywords":["framework","web","dom","css","sass","mobile-first","app","front-end","templates","schukai","core","shopcloud","alvine","monster","buildmap","stack","observer","observable","uuid","node","nodelist","css-in-js","logger","log","theme"],"license":"AGPL 3.0","main":"source/monster.mjs","module":"source/monster.mjs","name":"@schukai/monster","repository":{"type":"git","url":"https://gitlab.schukai.com/oss/libraries/javascript/monster.git"},"type":"module","version":"4.85.1"}
|
|
@@ -106,6 +106,7 @@ class DatasourceStatus extends CustomElement {
|
|
|
106
106
|
|
|
107
107
|
timeouts: {
|
|
108
108
|
message: 4000,
|
|
109
|
+
spinnerMin: 200,
|
|
109
110
|
},
|
|
110
111
|
|
|
111
112
|
state: {
|
|
@@ -185,6 +186,10 @@ function initEventHandler() {
|
|
|
185
186
|
throw new TypeError("the element must be a datasource");
|
|
186
187
|
}
|
|
187
188
|
|
|
189
|
+
let hideTimer = null;
|
|
190
|
+
let lastShowAt = 0;
|
|
191
|
+
let requestVersion = 0;
|
|
192
|
+
|
|
188
193
|
const setSpinnerState = (state) => {
|
|
189
194
|
self.setOption("state.spinner", state);
|
|
190
195
|
const spinner = self[spinnerElementSymbol];
|
|
@@ -192,6 +197,28 @@ function initEventHandler() {
|
|
|
192
197
|
spinner.setAttribute("data-monster-state-loader", state);
|
|
193
198
|
}
|
|
194
199
|
};
|
|
200
|
+
const clearHideTimer = () => {
|
|
201
|
+
if (hideTimer) {
|
|
202
|
+
clearTimeout(hideTimer);
|
|
203
|
+
hideTimer = null;
|
|
204
|
+
}
|
|
205
|
+
};
|
|
206
|
+
const getSpinnerMinTimeout = () => {
|
|
207
|
+
const value = Number(self.getOption("timeouts.spinnerMin", 0));
|
|
208
|
+
return Number.isFinite(value) ? Math.max(0, value) : 0;
|
|
209
|
+
};
|
|
210
|
+
const scheduleHide = (version) => {
|
|
211
|
+
clearHideTimer();
|
|
212
|
+
const elapsed = Date.now() - lastShowAt;
|
|
213
|
+
const delay = Math.max(0, getSpinnerMinTimeout() - elapsed);
|
|
214
|
+
hideTimer = setTimeout(() => {
|
|
215
|
+
hideTimer = null;
|
|
216
|
+
if (version !== requestVersion) {
|
|
217
|
+
return;
|
|
218
|
+
}
|
|
219
|
+
setSpinnerState("hide");
|
|
220
|
+
}, delay);
|
|
221
|
+
};
|
|
195
222
|
const hideSpinner = () => {
|
|
196
223
|
setSpinnerState("hide");
|
|
197
224
|
};
|
|
@@ -205,10 +232,13 @@ function initEventHandler() {
|
|
|
205
232
|
if (typeof self[errorElementSymbol]?.resetErrorMessage === "function") {
|
|
206
233
|
self[errorElementSymbol].resetErrorMessage();
|
|
207
234
|
}
|
|
208
|
-
|
|
235
|
+
scheduleHide(requestVersion);
|
|
209
236
|
});
|
|
210
237
|
|
|
211
238
|
element.addEventListener("monster-datasource-fetch", function () {
|
|
239
|
+
requestVersion += 1;
|
|
240
|
+
lastShowAt = Date.now();
|
|
241
|
+
clearHideTimer();
|
|
212
242
|
if (typeof self[errorElementSymbol]?.resetErrorMessage === "function") {
|
|
213
243
|
self[errorElementSymbol].resetErrorMessage();
|
|
214
244
|
}
|
|
@@ -217,7 +247,7 @@ function initEventHandler() {
|
|
|
217
247
|
});
|
|
218
248
|
|
|
219
249
|
element.addEventListener("monster-datasource-error", function (event) {
|
|
220
|
-
|
|
250
|
+
scheduleHide(requestVersion);
|
|
221
251
|
|
|
222
252
|
const timeout = self.getOption("timeouts.message", 4000);
|
|
223
253
|
let msg = "Cannot load data";
|
|
@@ -22,6 +22,7 @@ import { parseDataURL } from "../types/dataurl.mjs";
|
|
|
22
22
|
import { getGlobalObject } from "../types/global.mjs";
|
|
23
23
|
import {
|
|
24
24
|
isArray,
|
|
25
|
+
isElement,
|
|
25
26
|
isFunction,
|
|
26
27
|
isIterable,
|
|
27
28
|
isObject,
|
|
@@ -1080,6 +1081,16 @@ function syncUpdaterSubject(target, source) {
|
|
|
1080
1081
|
}
|
|
1081
1082
|
|
|
1082
1083
|
for (const [key, value] of Object.entries(source)) {
|
|
1084
|
+
if (
|
|
1085
|
+
isElement(value) ||
|
|
1086
|
+
(typeof Document !== "undefined" && value instanceof Document) ||
|
|
1087
|
+
(typeof DocumentFragment !== "undefined" &&
|
|
1088
|
+
value instanceof DocumentFragment)
|
|
1089
|
+
) {
|
|
1090
|
+
target[key] = value;
|
|
1091
|
+
continue;
|
|
1092
|
+
}
|
|
1093
|
+
|
|
1083
1094
|
if (isArray(value)) {
|
|
1084
1095
|
if (!isArray(target?.[key])) {
|
|
1085
1096
|
target[key] = [];
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
15
|
import { Base } from "./base.mjs";
|
|
16
|
-
import { isArray, isObject, isPrimitive } from "./is.mjs";
|
|
16
|
+
import { isArray, isElement, isObject, isPrimitive } from "./is.mjs";
|
|
17
17
|
import { Observer } from "./observer.mjs";
|
|
18
18
|
import { ObserverList } from "./observerlist.mjs";
|
|
19
19
|
import { validateObject } from "./validate.mjs";
|
|
@@ -165,6 +165,14 @@ function getHandler() {
|
|
|
165
165
|
return value;
|
|
166
166
|
}
|
|
167
167
|
|
|
168
|
+
if (isElement(value)) {
|
|
169
|
+
return value;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
if (typeof Node !== "undefined" && value instanceof Node) {
|
|
173
|
+
return value;
|
|
174
|
+
}
|
|
175
|
+
|
|
168
176
|
// set value as proxy if object or array
|
|
169
177
|
if (isArray(value) || isObject(value)) {
|
|
170
178
|
if (proxy.objectMap.has(value)) {
|