domql 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 +75 -37
- package/package.json +4 -4
package/dist/iife/index.js
CHANGED
|
@@ -1543,18 +1543,26 @@ var Domql = (() => {
|
|
|
1543
1543
|
};
|
|
1544
1544
|
var applyEvent = (param, element, state2, context, options) => {
|
|
1545
1545
|
if (!isFunction(param)) return;
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
result.
|
|
1555
|
-
|
|
1546
|
+
try {
|
|
1547
|
+
const result = param.call(
|
|
1548
|
+
element,
|
|
1549
|
+
element,
|
|
1550
|
+
state2 || element.state,
|
|
1551
|
+
context || element.context,
|
|
1552
|
+
options
|
|
1553
|
+
);
|
|
1554
|
+
if (result && typeof result.then === "function") {
|
|
1555
|
+
result.catch((err) => {
|
|
1556
|
+
element.error = err;
|
|
1557
|
+
console.error("[DomQL] Async event error:", err);
|
|
1558
|
+
});
|
|
1559
|
+
}
|
|
1560
|
+
return result;
|
|
1561
|
+
} catch (err) {
|
|
1562
|
+
element.error = err;
|
|
1563
|
+
console.error("[DomQL] Event handler error:", err);
|
|
1564
|
+
if (element.context?.strictMode) throw err;
|
|
1556
1565
|
}
|
|
1557
|
-
return result;
|
|
1558
1566
|
};
|
|
1559
1567
|
var triggerEventOn = (param, element, options) => {
|
|
1560
1568
|
if (!element) {
|
|
@@ -1568,19 +1576,27 @@ var Domql = (() => {
|
|
|
1568
1576
|
};
|
|
1569
1577
|
var applyEventUpdate = (param, updatedObj, element, state2, context, options) => {
|
|
1570
1578
|
if (!isFunction(param)) return;
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
result.
|
|
1581
|
-
|
|
1579
|
+
try {
|
|
1580
|
+
const result = param.call(
|
|
1581
|
+
element,
|
|
1582
|
+
updatedObj,
|
|
1583
|
+
element,
|
|
1584
|
+
state2 || element.state,
|
|
1585
|
+
context || element.context,
|
|
1586
|
+
options
|
|
1587
|
+
);
|
|
1588
|
+
if (result && typeof result.then === "function") {
|
|
1589
|
+
result.catch((err) => {
|
|
1590
|
+
element.error = err;
|
|
1591
|
+
console.error("[DomQL] Async event update error:", err);
|
|
1592
|
+
});
|
|
1593
|
+
}
|
|
1594
|
+
return result;
|
|
1595
|
+
} catch (err) {
|
|
1596
|
+
element.error = err;
|
|
1597
|
+
console.error("[DomQL] Event update error:", err);
|
|
1598
|
+
if (element.context?.strictMode) throw err;
|
|
1582
1599
|
}
|
|
1583
|
-
return result;
|
|
1584
1600
|
};
|
|
1585
1601
|
var triggerEventOnUpdate = (param, updatedObj, element, options) => {
|
|
1586
1602
|
const appliedFunction = getOnOrPropsEvent(param, element);
|
|
@@ -1887,7 +1903,20 @@ var Domql = (() => {
|
|
|
1887
1903
|
}
|
|
1888
1904
|
function call(fnKey, ...args) {
|
|
1889
1905
|
const context = this.context;
|
|
1890
|
-
|
|
1906
|
+
const fn = context.utils?.[fnKey] || context.functions?.[fnKey] || context.methods?.[fnKey] || context.snippets?.[fnKey];
|
|
1907
|
+
if (!fn) return;
|
|
1908
|
+
try {
|
|
1909
|
+
const result = fn.call(this, ...args);
|
|
1910
|
+
if (result && typeof result.then === "function") {
|
|
1911
|
+
result.catch((err) => {
|
|
1912
|
+
this.error = err;
|
|
1913
|
+
});
|
|
1914
|
+
}
|
|
1915
|
+
return result;
|
|
1916
|
+
} catch (err) {
|
|
1917
|
+
this.error = err;
|
|
1918
|
+
if (context?.strictMode) throw err;
|
|
1919
|
+
}
|
|
1891
1920
|
}
|
|
1892
1921
|
function isMethod(param, element) {
|
|
1893
1922
|
return Boolean(METHODS.has(param) || element?.context?.methods?.[param]);
|
|
@@ -2008,17 +2037,25 @@ ${element}` : "";
|
|
|
2008
2037
|
}
|
|
2009
2038
|
const handler = (event) => {
|
|
2010
2039
|
const { state: state2, context } = element;
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
result.
|
|
2021
|
-
|
|
2040
|
+
try {
|
|
2041
|
+
const result = appliedFunction.call(
|
|
2042
|
+
element,
|
|
2043
|
+
event,
|
|
2044
|
+
element,
|
|
2045
|
+
state2,
|
|
2046
|
+
context,
|
|
2047
|
+
options
|
|
2048
|
+
);
|
|
2049
|
+
if (result && typeof result.then === "function") {
|
|
2050
|
+
result.catch((err) => {
|
|
2051
|
+
element.error = err;
|
|
2052
|
+
console.error("[DomQL] Async DOM event error:", err);
|
|
2053
|
+
});
|
|
2054
|
+
}
|
|
2055
|
+
} catch (err) {
|
|
2056
|
+
element.error = err;
|
|
2057
|
+
console.error("[DomQL] DOM event error:", err);
|
|
2058
|
+
if (context?.strictMode) throw err;
|
|
2022
2059
|
}
|
|
2023
2060
|
};
|
|
2024
2061
|
ref.__eventListeners[param] = handler;
|
|
@@ -4602,12 +4639,13 @@ ${element}` : "";
|
|
|
4602
4639
|
createNode(element, options);
|
|
4603
4640
|
ref.__uniqId = _uniqIdCounter++;
|
|
4604
4641
|
};
|
|
4605
|
-
if (ENV6 === "test" || ENV6 === "development") {
|
|
4642
|
+
if (ENV6 === "test" || ENV6 === "development" || element.context?.strictMode) {
|
|
4606
4643
|
createNestedChild();
|
|
4607
4644
|
} else {
|
|
4608
4645
|
try {
|
|
4609
4646
|
createNestedChild();
|
|
4610
4647
|
} catch (e) {
|
|
4648
|
+
element.error = e;
|
|
4611
4649
|
const path = ref.path;
|
|
4612
4650
|
if (path.includes("ComponentsGrid")) {
|
|
4613
4651
|
path.splice(0, path.indexOf("ComponentsGrid") + 2);
|
|
@@ -4621,7 +4659,7 @@ ${element}` : "";
|
|
|
4621
4659
|
isDemoComponent ? isDemoComponent + " " : "" + path.join(".")
|
|
4622
4660
|
);
|
|
4623
4661
|
element.verbose();
|
|
4624
|
-
|
|
4662
|
+
console.error("[DomQL] Render error:", e);
|
|
4625
4663
|
if (element.on?.error) {
|
|
4626
4664
|
element.on.error(e, element, element.state, element.context, options);
|
|
4627
4665
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "domql",
|
|
3
|
-
"version": "3.5.
|
|
3
|
+
"version": "3.5.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./dist/esm/index.js",
|
|
@@ -27,9 +27,9 @@
|
|
|
27
27
|
"build:iife": "cross-env NODE_ENV=$NODE_ENV esbuild index.js --bundle --target=es2020 --format=iife --global-name=Domql --outfile=dist/iife/index.js --define:process.env.NODE_ENV=process.env.NODE_ENV"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@domql/element": "^3.5.
|
|
31
|
-
"@domql/state": "^3.5.
|
|
32
|
-
"@domql/utils": "^3.5.
|
|
30
|
+
"@domql/element": "^3.5.1",
|
|
31
|
+
"@domql/state": "^3.5.1",
|
|
32
|
+
"@domql/utils": "^3.5.1"
|
|
33
33
|
},
|
|
34
34
|
"gitHead": "9fc1b79b41cdc725ca6b24aec64920a599634681",
|
|
35
35
|
"browser": "./dist/esm/index.js",
|