@symbo.ls/utils 2.34.25 → 2.34.29
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/cjs/domqlv3hacks.js +52 -0
- package/dist/cjs/index.js +52 -0
- package/package.json +4 -4
package/dist/cjs/domqlv3hacks.js
CHANGED
|
@@ -1531,6 +1531,48 @@ var assignNode = (element, parent2, key, attachOptions) => {
|
|
|
1531
1531
|
return element;
|
|
1532
1532
|
};
|
|
1533
1533
|
|
|
1534
|
+
// ../../../domql/packages/element/methods/root.js
|
|
1535
|
+
function getRootState(param) {
|
|
1536
|
+
var _a, _b;
|
|
1537
|
+
let state2 = null;
|
|
1538
|
+
const hasRootState = (obj) => {
|
|
1539
|
+
var _a2;
|
|
1540
|
+
return obj.__element && ((_a2 = obj.root) == null ? void 0 : _a2.isRootState);
|
|
1541
|
+
};
|
|
1542
|
+
if (!this) {
|
|
1543
|
+
state2 = window.platformState || ((_a = window.smblsApp) == null ? void 0 : _a.state);
|
|
1544
|
+
} else if (hasRootState(this)) {
|
|
1545
|
+
state2 = this.root;
|
|
1546
|
+
} else if (this.__ref && this.__ref.path) {
|
|
1547
|
+
const hasPlatformState = this.state && hasRootState(this.state);
|
|
1548
|
+
const hasPlatformStateOnParent = this.call("isFunction", this.state) && this.parent.state && hasRootState(this.parent.state);
|
|
1549
|
+
if (hasPlatformState || hasPlatformStateOnParent) {
|
|
1550
|
+
state2 = this.state.root || this.parent.state.root;
|
|
1551
|
+
}
|
|
1552
|
+
}
|
|
1553
|
+
if (!state2) {
|
|
1554
|
+
state2 = window.platformState || ((_b = window.smblsApp) == null ? void 0 : _b.state);
|
|
1555
|
+
}
|
|
1556
|
+
return param ? state2[param] : state2;
|
|
1557
|
+
}
|
|
1558
|
+
function getRoot(key) {
|
|
1559
|
+
var _a;
|
|
1560
|
+
const rootElem = (_a = this.getRootState()) == null ? void 0 : _a.__element;
|
|
1561
|
+
return rootElem && Object.keys(rootElem).length > 0 && key ? rootElem[key] : rootElem;
|
|
1562
|
+
}
|
|
1563
|
+
function getRootData(key) {
|
|
1564
|
+
return this.getRoot("data") && Object.keys(this.getRoot("data")).length > 0 && key ? this.getRoot("data")[key] : this.getRoot("data");
|
|
1565
|
+
}
|
|
1566
|
+
function getRootContext(key) {
|
|
1567
|
+
var _a;
|
|
1568
|
+
const ctx = (_a = this.getRoot()) == null ? void 0 : _a.context;
|
|
1569
|
+
return key ? ctx[key] : ctx;
|
|
1570
|
+
}
|
|
1571
|
+
function getContext(key) {
|
|
1572
|
+
const ctx = this.context;
|
|
1573
|
+
return key ? ctx[key] : ctx;
|
|
1574
|
+
}
|
|
1575
|
+
|
|
1534
1576
|
// ../../../domql/packages/element/tree.js
|
|
1535
1577
|
var ROOT = {
|
|
1536
1578
|
key: ":root",
|
|
@@ -1824,6 +1866,11 @@ var METHODS2 = [
|
|
|
1824
1866
|
"getRef",
|
|
1825
1867
|
"getChildren",
|
|
1826
1868
|
"getPath",
|
|
1869
|
+
"getRootState",
|
|
1870
|
+
"getRoot",
|
|
1871
|
+
"getRootData",
|
|
1872
|
+
"getRootContext",
|
|
1873
|
+
"getContext",
|
|
1827
1874
|
"setNodeStyles",
|
|
1828
1875
|
"spotByPath",
|
|
1829
1876
|
"keys",
|
|
@@ -2964,6 +3011,11 @@ var addMethods = (element, parent2, options = {}) => {
|
|
|
2964
3011
|
lookdown,
|
|
2965
3012
|
lookdownAll,
|
|
2966
3013
|
getRef,
|
|
3014
|
+
getRootState,
|
|
3015
|
+
getRoot,
|
|
3016
|
+
getRootData,
|
|
3017
|
+
getRootContext,
|
|
3018
|
+
getContext,
|
|
2967
3019
|
getPath,
|
|
2968
3020
|
setNodeStyles,
|
|
2969
3021
|
spotByPath,
|
package/dist/cjs/index.js
CHANGED
|
@@ -1744,6 +1744,48 @@ var assignNode = (element, parent2, key, attachOptions) => {
|
|
|
1744
1744
|
return element;
|
|
1745
1745
|
};
|
|
1746
1746
|
|
|
1747
|
+
// ../../../domql/packages/element/methods/root.js
|
|
1748
|
+
function getRootState(param) {
|
|
1749
|
+
var _a, _b;
|
|
1750
|
+
let state2 = null;
|
|
1751
|
+
const hasRootState = (obj) => {
|
|
1752
|
+
var _a2;
|
|
1753
|
+
return obj.__element && ((_a2 = obj.root) == null ? void 0 : _a2.isRootState);
|
|
1754
|
+
};
|
|
1755
|
+
if (!this) {
|
|
1756
|
+
state2 = window.platformState || ((_a = window.smblsApp) == null ? void 0 : _a.state);
|
|
1757
|
+
} else if (hasRootState(this)) {
|
|
1758
|
+
state2 = this.root;
|
|
1759
|
+
} else if (this.__ref && this.__ref.path) {
|
|
1760
|
+
const hasPlatformState = this.state && hasRootState(this.state);
|
|
1761
|
+
const hasPlatformStateOnParent = this.call("isFunction", this.state) && this.parent.state && hasRootState(this.parent.state);
|
|
1762
|
+
if (hasPlatformState || hasPlatformStateOnParent) {
|
|
1763
|
+
state2 = this.state.root || this.parent.state.root;
|
|
1764
|
+
}
|
|
1765
|
+
}
|
|
1766
|
+
if (!state2) {
|
|
1767
|
+
state2 = window.platformState || ((_b = window.smblsApp) == null ? void 0 : _b.state);
|
|
1768
|
+
}
|
|
1769
|
+
return param ? state2[param] : state2;
|
|
1770
|
+
}
|
|
1771
|
+
function getRoot(key) {
|
|
1772
|
+
var _a;
|
|
1773
|
+
const rootElem = (_a = this.getRootState()) == null ? void 0 : _a.__element;
|
|
1774
|
+
return rootElem && Object.keys(rootElem).length > 0 && key ? rootElem[key] : rootElem;
|
|
1775
|
+
}
|
|
1776
|
+
function getRootData(key) {
|
|
1777
|
+
return this.getRoot("data") && Object.keys(this.getRoot("data")).length > 0 && key ? this.getRoot("data")[key] : this.getRoot("data");
|
|
1778
|
+
}
|
|
1779
|
+
function getRootContext(key) {
|
|
1780
|
+
var _a;
|
|
1781
|
+
const ctx = (_a = this.getRoot()) == null ? void 0 : _a.context;
|
|
1782
|
+
return key ? ctx[key] : ctx;
|
|
1783
|
+
}
|
|
1784
|
+
function getContext(key) {
|
|
1785
|
+
const ctx = this.context;
|
|
1786
|
+
return key ? ctx[key] : ctx;
|
|
1787
|
+
}
|
|
1788
|
+
|
|
1747
1789
|
// ../../../domql/packages/element/tree.js
|
|
1748
1790
|
var ROOT = {
|
|
1749
1791
|
key: ":root",
|
|
@@ -2037,6 +2079,11 @@ var METHODS2 = [
|
|
|
2037
2079
|
"getRef",
|
|
2038
2080
|
"getChildren",
|
|
2039
2081
|
"getPath",
|
|
2082
|
+
"getRootState",
|
|
2083
|
+
"getRoot",
|
|
2084
|
+
"getRootData",
|
|
2085
|
+
"getRootContext",
|
|
2086
|
+
"getContext",
|
|
2040
2087
|
"setNodeStyles",
|
|
2041
2088
|
"spotByPath",
|
|
2042
2089
|
"keys",
|
|
@@ -3177,6 +3224,11 @@ var addMethods = (element, parent2, options = {}) => {
|
|
|
3177
3224
|
lookdown,
|
|
3178
3225
|
lookdownAll,
|
|
3179
3226
|
getRef,
|
|
3227
|
+
getRootState,
|
|
3228
|
+
getRoot,
|
|
3229
|
+
getRootData,
|
|
3230
|
+
getRootContext,
|
|
3231
|
+
getContext,
|
|
3180
3232
|
getPath,
|
|
3181
3233
|
setNodeStyles,
|
|
3182
3234
|
spotByPath,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@symbo.ls/utils",
|
|
3
|
-
"version": "2.34.
|
|
3
|
+
"version": "2.34.29",
|
|
4
4
|
"author": "symbo.ls",
|
|
5
5
|
"files": [
|
|
6
6
|
"src",
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
},
|
|
25
25
|
"license": "ISC",
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@domql/element": "^2.34.
|
|
28
|
-
"@domql/utils": "^2.34.
|
|
27
|
+
"@domql/element": "^2.34.29",
|
|
28
|
+
"@domql/utils": "^2.34.29"
|
|
29
29
|
},
|
|
30
|
-
"gitHead": "
|
|
30
|
+
"gitHead": "90cb8b61065249122ff356c3ea6eb56191c49bfa"
|
|
31
31
|
}
|