@symbo.ls/fetch 3.5.0 → 3.5.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/dist/iife/index.js +53 -24
- package/package.json +2 -2
package/dist/iife/index.js
CHANGED
|
@@ -2401,18 +2401,26 @@ var SmblsFetch = (() => {
|
|
|
2401
2401
|
};
|
|
2402
2402
|
var applyEvent = (param, element, state, context, options) => {
|
|
2403
2403
|
if (!isFunction(param)) return;
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
|
|
2409
|
-
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
result.
|
|
2413
|
-
|
|
2404
|
+
try {
|
|
2405
|
+
const result = param.call(
|
|
2406
|
+
element,
|
|
2407
|
+
element,
|
|
2408
|
+
state || element.state,
|
|
2409
|
+
context || element.context,
|
|
2410
|
+
options
|
|
2411
|
+
);
|
|
2412
|
+
if (result && typeof result.then === "function") {
|
|
2413
|
+
result.catch((err) => {
|
|
2414
|
+
element.error = err;
|
|
2415
|
+
console.error("[DomQL] Async event error:", err);
|
|
2416
|
+
});
|
|
2417
|
+
}
|
|
2418
|
+
return result;
|
|
2419
|
+
} catch (err) {
|
|
2420
|
+
element.error = err;
|
|
2421
|
+
console.error("[DomQL] Event handler error:", err);
|
|
2422
|
+
if (element.context?.strictMode) throw err;
|
|
2414
2423
|
}
|
|
2415
|
-
return result;
|
|
2416
2424
|
};
|
|
2417
2425
|
var triggerEventOn = (param, element, options) => {
|
|
2418
2426
|
if (!element) {
|
|
@@ -2426,19 +2434,27 @@ var SmblsFetch = (() => {
|
|
|
2426
2434
|
};
|
|
2427
2435
|
var applyEventUpdate = (param, updatedObj, element, state, context, options) => {
|
|
2428
2436
|
if (!isFunction(param)) return;
|
|
2429
|
-
|
|
2430
|
-
|
|
2431
|
-
|
|
2432
|
-
|
|
2433
|
-
|
|
2434
|
-
|
|
2435
|
-
|
|
2436
|
-
|
|
2437
|
-
|
|
2438
|
-
result.
|
|
2439
|
-
|
|
2437
|
+
try {
|
|
2438
|
+
const result = param.call(
|
|
2439
|
+
element,
|
|
2440
|
+
updatedObj,
|
|
2441
|
+
element,
|
|
2442
|
+
state || element.state,
|
|
2443
|
+
context || element.context,
|
|
2444
|
+
options
|
|
2445
|
+
);
|
|
2446
|
+
if (result && typeof result.then === "function") {
|
|
2447
|
+
result.catch((err) => {
|
|
2448
|
+
element.error = err;
|
|
2449
|
+
console.error("[DomQL] Async event update error:", err);
|
|
2450
|
+
});
|
|
2451
|
+
}
|
|
2452
|
+
return result;
|
|
2453
|
+
} catch (err) {
|
|
2454
|
+
element.error = err;
|
|
2455
|
+
console.error("[DomQL] Event update error:", err);
|
|
2456
|
+
if (element.context?.strictMode) throw err;
|
|
2440
2457
|
}
|
|
2441
|
-
return result;
|
|
2442
2458
|
};
|
|
2443
2459
|
var triggerEventOnUpdate = (param, updatedObj, element, options) => {
|
|
2444
2460
|
const appliedFunction = getOnOrPropsEvent(param, element);
|
|
@@ -2754,7 +2770,20 @@ var SmblsFetch = (() => {
|
|
|
2754
2770
|
}
|
|
2755
2771
|
function call(fnKey, ...args) {
|
|
2756
2772
|
const context = this.context;
|
|
2757
|
-
|
|
2773
|
+
const fn = context.utils?.[fnKey] || context.functions?.[fnKey] || context.methods?.[fnKey] || context.snippets?.[fnKey];
|
|
2774
|
+
if (!fn) return;
|
|
2775
|
+
try {
|
|
2776
|
+
const result = fn.call(this, ...args);
|
|
2777
|
+
if (result && typeof result.then === "function") {
|
|
2778
|
+
result.catch((err) => {
|
|
2779
|
+
this.error = err;
|
|
2780
|
+
});
|
|
2781
|
+
}
|
|
2782
|
+
return result;
|
|
2783
|
+
} catch (err) {
|
|
2784
|
+
this.error = err;
|
|
2785
|
+
if (context?.strictMode) throw err;
|
|
2786
|
+
}
|
|
2758
2787
|
}
|
|
2759
2788
|
function isMethod(param, element) {
|
|
2760
2789
|
return Boolean(METHODS.has(param) || element?.context?.methods?.[param]);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@symbo.ls/fetch",
|
|
3
|
-
"version": "3.5.
|
|
3
|
+
"version": "3.5.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"gitHead": "9fc1b79b41cdc725ca6b24aec64920a599634681",
|
|
6
6
|
"type": "module",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"prepublish": "npm run build && npm run copy:package:cjs"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@domql/utils": "^3.5.
|
|
33
|
+
"@domql/utils": "^3.5.1"
|
|
34
34
|
},
|
|
35
35
|
"browser": "./dist/esm/index.js",
|
|
36
36
|
"sideEffects": false
|