@domql/state 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 +39 -23
- package/package.json +3 -3
package/dist/iife/index.js
CHANGED
|
@@ -564,18 +564,26 @@ var DomqlState = (() => {
|
|
|
564
564
|
};
|
|
565
565
|
var applyEvent = (param, element, state, context, options) => {
|
|
566
566
|
if (!isFunction(param)) return;
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
result.
|
|
576
|
-
|
|
567
|
+
try {
|
|
568
|
+
const result = param.call(
|
|
569
|
+
element,
|
|
570
|
+
element,
|
|
571
|
+
state || element.state,
|
|
572
|
+
context || element.context,
|
|
573
|
+
options
|
|
574
|
+
);
|
|
575
|
+
if (result && typeof result.then === "function") {
|
|
576
|
+
result.catch((err) => {
|
|
577
|
+
element.error = err;
|
|
578
|
+
console.error("[DomQL] Async event error:", err);
|
|
579
|
+
});
|
|
580
|
+
}
|
|
581
|
+
return result;
|
|
582
|
+
} catch (err) {
|
|
583
|
+
element.error = err;
|
|
584
|
+
console.error("[DomQL] Event handler error:", err);
|
|
585
|
+
if (element.context?.strictMode) throw err;
|
|
577
586
|
}
|
|
578
|
-
return result;
|
|
579
587
|
};
|
|
580
588
|
var triggerEventOn = (param, element, options) => {
|
|
581
589
|
if (!element) {
|
|
@@ -589,19 +597,27 @@ var DomqlState = (() => {
|
|
|
589
597
|
};
|
|
590
598
|
var applyEventUpdate = (param, updatedObj, element, state, context, options) => {
|
|
591
599
|
if (!isFunction(param)) return;
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
result.
|
|
602
|
-
|
|
600
|
+
try {
|
|
601
|
+
const result = param.call(
|
|
602
|
+
element,
|
|
603
|
+
updatedObj,
|
|
604
|
+
element,
|
|
605
|
+
state || element.state,
|
|
606
|
+
context || element.context,
|
|
607
|
+
options
|
|
608
|
+
);
|
|
609
|
+
if (result && typeof result.then === "function") {
|
|
610
|
+
result.catch((err) => {
|
|
611
|
+
element.error = err;
|
|
612
|
+
console.error("[DomQL] Async event update error:", err);
|
|
613
|
+
});
|
|
614
|
+
}
|
|
615
|
+
return result;
|
|
616
|
+
} catch (err) {
|
|
617
|
+
element.error = err;
|
|
618
|
+
console.error("[DomQL] Event update error:", err);
|
|
619
|
+
if (element.context?.strictMode) throw err;
|
|
603
620
|
}
|
|
604
|
-
return result;
|
|
605
621
|
};
|
|
606
622
|
var triggerEventOnUpdate = (param, updatedObj, element, options) => {
|
|
607
623
|
const appliedFunction = getOnOrPropsEvent(param, element);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@domql/state",
|
|
3
|
-
"version": "3.5.
|
|
3
|
+
"version": "3.5.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./dist/esm/index.js",
|
|
@@ -39,8 +39,8 @@
|
|
|
39
39
|
"prepublish": "npm run build && npm run copy:package:cjs"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@domql/report": "^3.5.
|
|
43
|
-
"@domql/utils": "^3.5.
|
|
42
|
+
"@domql/report": "^3.5.1",
|
|
43
|
+
"@domql/utils": "^3.5.1"
|
|
44
44
|
},
|
|
45
45
|
"gitHead": "9fc1b79b41cdc725ca6b24aec64920a599634681",
|
|
46
46
|
"browser": "./dist/esm/index.js",
|