@symbo.ls/scratch 2.34.27 → 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/index.js CHANGED
@@ -1710,6 +1710,46 @@ ${element}` : ""
1710
1710
  }
1711
1711
  return element;
1712
1712
  };
1713
+ function getRootState(param) {
1714
+ var _a, _b;
1715
+ let state2 = null;
1716
+ const hasRootState = (obj) => {
1717
+ var _a2;
1718
+ return obj.__element && ((_a2 = obj.root) == null ? void 0 : _a2.isRootState);
1719
+ };
1720
+ if (!this) {
1721
+ state2 = window.platformState || ((_a = window.smblsApp) == null ? void 0 : _a.state);
1722
+ } else if (hasRootState(this)) {
1723
+ state2 = this.root;
1724
+ } else if (this.__ref && this.__ref.path) {
1725
+ const hasPlatformState = this.state && hasRootState(this.state);
1726
+ const hasPlatformStateOnParent = this.call("isFunction", this.state) && this.parent.state && hasRootState(this.parent.state);
1727
+ if (hasPlatformState || hasPlatformStateOnParent) {
1728
+ state2 = this.state.root || this.parent.state.root;
1729
+ }
1730
+ }
1731
+ if (!state2) {
1732
+ state2 = window.platformState || ((_b = window.smblsApp) == null ? void 0 : _b.state);
1733
+ }
1734
+ return param ? state2[param] : state2;
1735
+ }
1736
+ function getRoot(key) {
1737
+ var _a;
1738
+ const rootElem = (_a = this.getRootState()) == null ? void 0 : _a.__element;
1739
+ return rootElem && Object.keys(rootElem).length > 0 && key ? rootElem[key] : rootElem;
1740
+ }
1741
+ function getRootData(key) {
1742
+ return this.getRoot("data") && Object.keys(this.getRoot("data")).length > 0 && key ? this.getRoot("data")[key] : this.getRoot("data");
1743
+ }
1744
+ function getRootContext(key) {
1745
+ var _a;
1746
+ const ctx = (_a = this.getRoot()) == null ? void 0 : _a.context;
1747
+ return key ? ctx[key] : ctx;
1748
+ }
1749
+ function getContext(key) {
1750
+ const ctx = this.context;
1751
+ return key ? ctx[key] : ctx;
1752
+ }
1713
1753
  var ROOT = {
1714
1754
  key: ":root",
1715
1755
  node: document22 ? document22.body : report("DocumentNotDefined", document22)
@@ -2000,6 +2040,11 @@ ${element}` : ""
2000
2040
  "getRef",
2001
2041
  "getChildren",
2002
2042
  "getPath",
2043
+ "getRootState",
2044
+ "getRoot",
2045
+ "getRootData",
2046
+ "getRootContext",
2047
+ "getContext",
2003
2048
  "setNodeStyles",
2004
2049
  "spotByPath",
2005
2050
  "keys",
@@ -3118,6 +3163,11 @@ ${element}` : ""
3118
3163
  lookdown,
3119
3164
  lookdownAll,
3120
3165
  getRef,
3166
+ getRootState,
3167
+ getRoot,
3168
+ getRootData,
3169
+ getRootContext,
3170
+ getContext,
3121
3171
  getPath,
3122
3172
  setNodeStyles,
3123
3173
  spotByPath,
package/dist/cjs/set.js CHANGED
@@ -1710,6 +1710,46 @@ ${element}` : ""
1710
1710
  }
1711
1711
  return element;
1712
1712
  };
1713
+ function getRootState(param) {
1714
+ var _a, _b;
1715
+ let state2 = null;
1716
+ const hasRootState = (obj) => {
1717
+ var _a2;
1718
+ return obj.__element && ((_a2 = obj.root) == null ? void 0 : _a2.isRootState);
1719
+ };
1720
+ if (!this) {
1721
+ state2 = window.platformState || ((_a = window.smblsApp) == null ? void 0 : _a.state);
1722
+ } else if (hasRootState(this)) {
1723
+ state2 = this.root;
1724
+ } else if (this.__ref && this.__ref.path) {
1725
+ const hasPlatformState = this.state && hasRootState(this.state);
1726
+ const hasPlatformStateOnParent = this.call("isFunction", this.state) && this.parent.state && hasRootState(this.parent.state);
1727
+ if (hasPlatformState || hasPlatformStateOnParent) {
1728
+ state2 = this.state.root || this.parent.state.root;
1729
+ }
1730
+ }
1731
+ if (!state2) {
1732
+ state2 = window.platformState || ((_b = window.smblsApp) == null ? void 0 : _b.state);
1733
+ }
1734
+ return param ? state2[param] : state2;
1735
+ }
1736
+ function getRoot(key) {
1737
+ var _a;
1738
+ const rootElem = (_a = this.getRootState()) == null ? void 0 : _a.__element;
1739
+ return rootElem && Object.keys(rootElem).length > 0 && key ? rootElem[key] : rootElem;
1740
+ }
1741
+ function getRootData(key) {
1742
+ return this.getRoot("data") && Object.keys(this.getRoot("data")).length > 0 && key ? this.getRoot("data")[key] : this.getRoot("data");
1743
+ }
1744
+ function getRootContext(key) {
1745
+ var _a;
1746
+ const ctx = (_a = this.getRoot()) == null ? void 0 : _a.context;
1747
+ return key ? ctx[key] : ctx;
1748
+ }
1749
+ function getContext(key) {
1750
+ const ctx = this.context;
1751
+ return key ? ctx[key] : ctx;
1752
+ }
1713
1753
  var ROOT = {
1714
1754
  key: ":root",
1715
1755
  node: document22 ? document22.body : report("DocumentNotDefined", document22)
@@ -2000,6 +2040,11 @@ ${element}` : ""
2000
2040
  "getRef",
2001
2041
  "getChildren",
2002
2042
  "getPath",
2043
+ "getRootState",
2044
+ "getRoot",
2045
+ "getRootData",
2046
+ "getRootContext",
2047
+ "getContext",
2003
2048
  "setNodeStyles",
2004
2049
  "spotByPath",
2005
2050
  "keys",
@@ -3118,6 +3163,11 @@ ${element}` : ""
3118
3163
  lookdown,
3119
3164
  lookdownAll,
3120
3165
  getRef,
3166
+ getRootState,
3167
+ getRoot,
3168
+ getRootData,
3169
+ getRootContext,
3170
+ getContext,
3121
3171
  getPath,
3122
3172
  setNodeStyles,
3123
3173
  spotByPath,
@@ -1710,6 +1710,46 @@ ${element}` : ""
1710
1710
  }
1711
1711
  return element;
1712
1712
  };
1713
+ function getRootState(param) {
1714
+ var _a, _b;
1715
+ let state2 = null;
1716
+ const hasRootState = (obj) => {
1717
+ var _a2;
1718
+ return obj.__element && ((_a2 = obj.root) == null ? void 0 : _a2.isRootState);
1719
+ };
1720
+ if (!this) {
1721
+ state2 = window.platformState || ((_a = window.smblsApp) == null ? void 0 : _a.state);
1722
+ } else if (hasRootState(this)) {
1723
+ state2 = this.root;
1724
+ } else if (this.__ref && this.__ref.path) {
1725
+ const hasPlatformState = this.state && hasRootState(this.state);
1726
+ const hasPlatformStateOnParent = this.call("isFunction", this.state) && this.parent.state && hasRootState(this.parent.state);
1727
+ if (hasPlatformState || hasPlatformStateOnParent) {
1728
+ state2 = this.state.root || this.parent.state.root;
1729
+ }
1730
+ }
1731
+ if (!state2) {
1732
+ state2 = window.platformState || ((_b = window.smblsApp) == null ? void 0 : _b.state);
1733
+ }
1734
+ return param ? state2[param] : state2;
1735
+ }
1736
+ function getRoot(key) {
1737
+ var _a;
1738
+ const rootElem = (_a = this.getRootState()) == null ? void 0 : _a.__element;
1739
+ return rootElem && Object.keys(rootElem).length > 0 && key ? rootElem[key] : rootElem;
1740
+ }
1741
+ function getRootData(key) {
1742
+ return this.getRoot("data") && Object.keys(this.getRoot("data")).length > 0 && key ? this.getRoot("data")[key] : this.getRoot("data");
1743
+ }
1744
+ function getRootContext(key) {
1745
+ var _a;
1746
+ const ctx = (_a = this.getRoot()) == null ? void 0 : _a.context;
1747
+ return key ? ctx[key] : ctx;
1748
+ }
1749
+ function getContext(key) {
1750
+ const ctx = this.context;
1751
+ return key ? ctx[key] : ctx;
1752
+ }
1713
1753
  var ROOT = {
1714
1754
  key: ":root",
1715
1755
  node: document22 ? document22.body : report("DocumentNotDefined", document22)
@@ -2000,6 +2040,11 @@ ${element}` : ""
2000
2040
  "getRef",
2001
2041
  "getChildren",
2002
2042
  "getPath",
2043
+ "getRootState",
2044
+ "getRoot",
2045
+ "getRootData",
2046
+ "getRootContext",
2047
+ "getContext",
2003
2048
  "setNodeStyles",
2004
2049
  "spotByPath",
2005
2050
  "keys",
@@ -3118,6 +3163,11 @@ ${element}` : ""
3118
3163
  lookdown,
3119
3164
  lookdownAll,
3120
3165
  getRef,
3166
+ getRootState,
3167
+ getRoot,
3168
+ getRootData,
3169
+ getRootContext,
3170
+ getContext,
3121
3171
  getPath,
3122
3172
  setNodeStyles,
3123
3173
  spotByPath,
@@ -1710,6 +1710,46 @@ ${element}` : ""
1710
1710
  }
1711
1711
  return element;
1712
1712
  };
1713
+ function getRootState(param) {
1714
+ var _a, _b;
1715
+ let state2 = null;
1716
+ const hasRootState = (obj) => {
1717
+ var _a2;
1718
+ return obj.__element && ((_a2 = obj.root) == null ? void 0 : _a2.isRootState);
1719
+ };
1720
+ if (!this) {
1721
+ state2 = window.platformState || ((_a = window.smblsApp) == null ? void 0 : _a.state);
1722
+ } else if (hasRootState(this)) {
1723
+ state2 = this.root;
1724
+ } else if (this.__ref && this.__ref.path) {
1725
+ const hasPlatformState = this.state && hasRootState(this.state);
1726
+ const hasPlatformStateOnParent = this.call("isFunction", this.state) && this.parent.state && hasRootState(this.parent.state);
1727
+ if (hasPlatformState || hasPlatformStateOnParent) {
1728
+ state2 = this.state.root || this.parent.state.root;
1729
+ }
1730
+ }
1731
+ if (!state2) {
1732
+ state2 = window.platformState || ((_b = window.smblsApp) == null ? void 0 : _b.state);
1733
+ }
1734
+ return param ? state2[param] : state2;
1735
+ }
1736
+ function getRoot(key) {
1737
+ var _a;
1738
+ const rootElem = (_a = this.getRootState()) == null ? void 0 : _a.__element;
1739
+ return rootElem && Object.keys(rootElem).length > 0 && key ? rootElem[key] : rootElem;
1740
+ }
1741
+ function getRootData(key) {
1742
+ return this.getRoot("data") && Object.keys(this.getRoot("data")).length > 0 && key ? this.getRoot("data")[key] : this.getRoot("data");
1743
+ }
1744
+ function getRootContext(key) {
1745
+ var _a;
1746
+ const ctx = (_a = this.getRoot()) == null ? void 0 : _a.context;
1747
+ return key ? ctx[key] : ctx;
1748
+ }
1749
+ function getContext(key) {
1750
+ const ctx = this.context;
1751
+ return key ? ctx[key] : ctx;
1752
+ }
1713
1753
  var ROOT = {
1714
1754
  key: ":root",
1715
1755
  node: document22 ? document22.body : report("DocumentNotDefined", document22)
@@ -2000,6 +2040,11 @@ ${element}` : ""
2000
2040
  "getRef",
2001
2041
  "getChildren",
2002
2042
  "getPath",
2043
+ "getRootState",
2044
+ "getRoot",
2045
+ "getRootData",
2046
+ "getRootContext",
2047
+ "getContext",
2003
2048
  "setNodeStyles",
2004
2049
  "spotByPath",
2005
2050
  "keys",
@@ -3118,6 +3163,11 @@ ${element}` : ""
3118
3163
  lookdown,
3119
3164
  lookdownAll,
3120
3165
  getRef,
3166
+ getRootState,
3167
+ getRoot,
3168
+ getRootData,
3169
+ getRootContext,
3170
+ getContext,
3121
3171
  getPath,
3122
3172
  setNodeStyles,
3123
3173
  spotByPath,
@@ -1710,6 +1710,46 @@ ${element}` : ""
1710
1710
  }
1711
1711
  return element;
1712
1712
  };
1713
+ function getRootState(param) {
1714
+ var _a, _b;
1715
+ let state2 = null;
1716
+ const hasRootState = (obj) => {
1717
+ var _a2;
1718
+ return obj.__element && ((_a2 = obj.root) == null ? void 0 : _a2.isRootState);
1719
+ };
1720
+ if (!this) {
1721
+ state2 = window.platformState || ((_a = window.smblsApp) == null ? void 0 : _a.state);
1722
+ } else if (hasRootState(this)) {
1723
+ state2 = this.root;
1724
+ } else if (this.__ref && this.__ref.path) {
1725
+ const hasPlatformState = this.state && hasRootState(this.state);
1726
+ const hasPlatformStateOnParent = this.call("isFunction", this.state) && this.parent.state && hasRootState(this.parent.state);
1727
+ if (hasPlatformState || hasPlatformStateOnParent) {
1728
+ state2 = this.state.root || this.parent.state.root;
1729
+ }
1730
+ }
1731
+ if (!state2) {
1732
+ state2 = window.platformState || ((_b = window.smblsApp) == null ? void 0 : _b.state);
1733
+ }
1734
+ return param ? state2[param] : state2;
1735
+ }
1736
+ function getRoot(key) {
1737
+ var _a;
1738
+ const rootElem = (_a = this.getRootState()) == null ? void 0 : _a.__element;
1739
+ return rootElem && Object.keys(rootElem).length > 0 && key ? rootElem[key] : rootElem;
1740
+ }
1741
+ function getRootData(key) {
1742
+ return this.getRoot("data") && Object.keys(this.getRoot("data")).length > 0 && key ? this.getRoot("data")[key] : this.getRoot("data");
1743
+ }
1744
+ function getRootContext(key) {
1745
+ var _a;
1746
+ const ctx = (_a = this.getRoot()) == null ? void 0 : _a.context;
1747
+ return key ? ctx[key] : ctx;
1748
+ }
1749
+ function getContext(key) {
1750
+ const ctx = this.context;
1751
+ return key ? ctx[key] : ctx;
1752
+ }
1713
1753
  var ROOT = {
1714
1754
  key: ":root",
1715
1755
  node: document22 ? document22.body : report("DocumentNotDefined", document22)
@@ -2000,6 +2040,11 @@ ${element}` : ""
2000
2040
  "getRef",
2001
2041
  "getChildren",
2002
2042
  "getPath",
2043
+ "getRootState",
2044
+ "getRoot",
2045
+ "getRootData",
2046
+ "getRootContext",
2047
+ "getContext",
2003
2048
  "setNodeStyles",
2004
2049
  "spotByPath",
2005
2050
  "keys",
@@ -3118,6 +3163,11 @@ ${element}` : ""
3118
3163
  lookdown,
3119
3164
  lookdownAll,
3120
3165
  getRef,
3166
+ getRootState,
3167
+ getRoot,
3168
+ getRootData,
3169
+ getRootContext,
3170
+ getContext,
3121
3171
  getPath,
3122
3172
  setNodeStyles,
3123
3173
  spotByPath,
@@ -1710,6 +1710,46 @@ ${element}` : ""
1710
1710
  }
1711
1711
  return element;
1712
1712
  };
1713
+ function getRootState(param) {
1714
+ var _a, _b;
1715
+ let state2 = null;
1716
+ const hasRootState = (obj) => {
1717
+ var _a2;
1718
+ return obj.__element && ((_a2 = obj.root) == null ? void 0 : _a2.isRootState);
1719
+ };
1720
+ if (!this) {
1721
+ state2 = window.platformState || ((_a = window.smblsApp) == null ? void 0 : _a.state);
1722
+ } else if (hasRootState(this)) {
1723
+ state2 = this.root;
1724
+ } else if (this.__ref && this.__ref.path) {
1725
+ const hasPlatformState = this.state && hasRootState(this.state);
1726
+ const hasPlatformStateOnParent = this.call("isFunction", this.state) && this.parent.state && hasRootState(this.parent.state);
1727
+ if (hasPlatformState || hasPlatformStateOnParent) {
1728
+ state2 = this.state.root || this.parent.state.root;
1729
+ }
1730
+ }
1731
+ if (!state2) {
1732
+ state2 = window.platformState || ((_b = window.smblsApp) == null ? void 0 : _b.state);
1733
+ }
1734
+ return param ? state2[param] : state2;
1735
+ }
1736
+ function getRoot(key) {
1737
+ var _a;
1738
+ const rootElem = (_a = this.getRootState()) == null ? void 0 : _a.__element;
1739
+ return rootElem && Object.keys(rootElem).length > 0 && key ? rootElem[key] : rootElem;
1740
+ }
1741
+ function getRootData(key) {
1742
+ return this.getRoot("data") && Object.keys(this.getRoot("data")).length > 0 && key ? this.getRoot("data")[key] : this.getRoot("data");
1743
+ }
1744
+ function getRootContext(key) {
1745
+ var _a;
1746
+ const ctx = (_a = this.getRoot()) == null ? void 0 : _a.context;
1747
+ return key ? ctx[key] : ctx;
1748
+ }
1749
+ function getContext(key) {
1750
+ const ctx = this.context;
1751
+ return key ? ctx[key] : ctx;
1752
+ }
1713
1753
  var ROOT = {
1714
1754
  key: ":root",
1715
1755
  node: document22 ? document22.body : report("DocumentNotDefined", document22)
@@ -2000,6 +2040,11 @@ ${element}` : ""
2000
2040
  "getRef",
2001
2041
  "getChildren",
2002
2042
  "getPath",
2043
+ "getRootState",
2044
+ "getRoot",
2045
+ "getRootData",
2046
+ "getRootContext",
2047
+ "getContext",
2003
2048
  "setNodeStyles",
2004
2049
  "spotByPath",
2005
2050
  "keys",
@@ -3118,6 +3163,11 @@ ${element}` : ""
3118
3163
  lookdown,
3119
3164
  lookdownAll,
3120
3165
  getRef,
3166
+ getRootState,
3167
+ getRoot,
3168
+ getRootData,
3169
+ getRootContext,
3170
+ getContext,
3121
3171
  getPath,
3122
3172
  setNodeStyles,
3123
3173
  spotByPath,
@@ -1710,6 +1710,46 @@ ${element}` : ""
1710
1710
  }
1711
1711
  return element;
1712
1712
  };
1713
+ function getRootState(param) {
1714
+ var _a, _b;
1715
+ let state2 = null;
1716
+ const hasRootState = (obj) => {
1717
+ var _a2;
1718
+ return obj.__element && ((_a2 = obj.root) == null ? void 0 : _a2.isRootState);
1719
+ };
1720
+ if (!this) {
1721
+ state2 = window.platformState || ((_a = window.smblsApp) == null ? void 0 : _a.state);
1722
+ } else if (hasRootState(this)) {
1723
+ state2 = this.root;
1724
+ } else if (this.__ref && this.__ref.path) {
1725
+ const hasPlatformState = this.state && hasRootState(this.state);
1726
+ const hasPlatformStateOnParent = this.call("isFunction", this.state) && this.parent.state && hasRootState(this.parent.state);
1727
+ if (hasPlatformState || hasPlatformStateOnParent) {
1728
+ state2 = this.state.root || this.parent.state.root;
1729
+ }
1730
+ }
1731
+ if (!state2) {
1732
+ state2 = window.platformState || ((_b = window.smblsApp) == null ? void 0 : _b.state);
1733
+ }
1734
+ return param ? state2[param] : state2;
1735
+ }
1736
+ function getRoot(key) {
1737
+ var _a;
1738
+ const rootElem = (_a = this.getRootState()) == null ? void 0 : _a.__element;
1739
+ return rootElem && Object.keys(rootElem).length > 0 && key ? rootElem[key] : rootElem;
1740
+ }
1741
+ function getRootData(key) {
1742
+ return this.getRoot("data") && Object.keys(this.getRoot("data")).length > 0 && key ? this.getRoot("data")[key] : this.getRoot("data");
1743
+ }
1744
+ function getRootContext(key) {
1745
+ var _a;
1746
+ const ctx = (_a = this.getRoot()) == null ? void 0 : _a.context;
1747
+ return key ? ctx[key] : ctx;
1748
+ }
1749
+ function getContext(key) {
1750
+ const ctx = this.context;
1751
+ return key ? ctx[key] : ctx;
1752
+ }
1713
1753
  var ROOT = {
1714
1754
  key: ":root",
1715
1755
  node: document22 ? document22.body : report("DocumentNotDefined", document22)
@@ -2000,6 +2040,11 @@ ${element}` : ""
2000
2040
  "getRef",
2001
2041
  "getChildren",
2002
2042
  "getPath",
2043
+ "getRootState",
2044
+ "getRoot",
2045
+ "getRootData",
2046
+ "getRootContext",
2047
+ "getContext",
2003
2048
  "setNodeStyles",
2004
2049
  "spotByPath",
2005
2050
  "keys",
@@ -3118,6 +3163,11 @@ ${element}` : ""
3118
3163
  lookdown,
3119
3164
  lookdownAll,
3120
3165
  getRef,
3166
+ getRootState,
3167
+ getRoot,
3168
+ getRootData,
3169
+ getRootContext,
3170
+ getContext,
3121
3171
  getPath,
3122
3172
  setNodeStyles,
3123
3173
  spotByPath,
@@ -1710,6 +1710,46 @@ ${element}` : ""
1710
1710
  }
1711
1711
  return element;
1712
1712
  };
1713
+ function getRootState(param) {
1714
+ var _a, _b;
1715
+ let state2 = null;
1716
+ const hasRootState = (obj) => {
1717
+ var _a2;
1718
+ return obj.__element && ((_a2 = obj.root) == null ? void 0 : _a2.isRootState);
1719
+ };
1720
+ if (!this) {
1721
+ state2 = window.platformState || ((_a = window.smblsApp) == null ? void 0 : _a.state);
1722
+ } else if (hasRootState(this)) {
1723
+ state2 = this.root;
1724
+ } else if (this.__ref && this.__ref.path) {
1725
+ const hasPlatformState = this.state && hasRootState(this.state);
1726
+ const hasPlatformStateOnParent = this.call("isFunction", this.state) && this.parent.state && hasRootState(this.parent.state);
1727
+ if (hasPlatformState || hasPlatformStateOnParent) {
1728
+ state2 = this.state.root || this.parent.state.root;
1729
+ }
1730
+ }
1731
+ if (!state2) {
1732
+ state2 = window.platformState || ((_b = window.smblsApp) == null ? void 0 : _b.state);
1733
+ }
1734
+ return param ? state2[param] : state2;
1735
+ }
1736
+ function getRoot(key) {
1737
+ var _a;
1738
+ const rootElem = (_a = this.getRootState()) == null ? void 0 : _a.__element;
1739
+ return rootElem && Object.keys(rootElem).length > 0 && key ? rootElem[key] : rootElem;
1740
+ }
1741
+ function getRootData(key) {
1742
+ return this.getRoot("data") && Object.keys(this.getRoot("data")).length > 0 && key ? this.getRoot("data")[key] : this.getRoot("data");
1743
+ }
1744
+ function getRootContext(key) {
1745
+ var _a;
1746
+ const ctx = (_a = this.getRoot()) == null ? void 0 : _a.context;
1747
+ return key ? ctx[key] : ctx;
1748
+ }
1749
+ function getContext(key) {
1750
+ const ctx = this.context;
1751
+ return key ? ctx[key] : ctx;
1752
+ }
1713
1753
  var ROOT = {
1714
1754
  key: ":root",
1715
1755
  node: document22 ? document22.body : report("DocumentNotDefined", document22)
@@ -2000,6 +2040,11 @@ ${element}` : ""
2000
2040
  "getRef",
2001
2041
  "getChildren",
2002
2042
  "getPath",
2043
+ "getRootState",
2044
+ "getRoot",
2045
+ "getRootData",
2046
+ "getRootContext",
2047
+ "getContext",
2003
2048
  "setNodeStyles",
2004
2049
  "spotByPath",
2005
2050
  "keys",
@@ -3118,6 +3163,11 @@ ${element}` : ""
3118
3163
  lookdown,
3119
3164
  lookdownAll,
3120
3165
  getRef,
3166
+ getRootState,
3167
+ getRoot,
3168
+ getRootData,
3169
+ getRootContext,
3170
+ getContext,
3121
3171
  getPath,
3122
3172
  setNodeStyles,
3123
3173
  spotByPath,
@@ -1710,6 +1710,46 @@ ${element}` : ""
1710
1710
  }
1711
1711
  return element;
1712
1712
  };
1713
+ function getRootState(param) {
1714
+ var _a, _b;
1715
+ let state2 = null;
1716
+ const hasRootState = (obj) => {
1717
+ var _a2;
1718
+ return obj.__element && ((_a2 = obj.root) == null ? void 0 : _a2.isRootState);
1719
+ };
1720
+ if (!this) {
1721
+ state2 = window.platformState || ((_a = window.smblsApp) == null ? void 0 : _a.state);
1722
+ } else if (hasRootState(this)) {
1723
+ state2 = this.root;
1724
+ } else if (this.__ref && this.__ref.path) {
1725
+ const hasPlatformState = this.state && hasRootState(this.state);
1726
+ const hasPlatformStateOnParent = this.call("isFunction", this.state) && this.parent.state && hasRootState(this.parent.state);
1727
+ if (hasPlatformState || hasPlatformStateOnParent) {
1728
+ state2 = this.state.root || this.parent.state.root;
1729
+ }
1730
+ }
1731
+ if (!state2) {
1732
+ state2 = window.platformState || ((_b = window.smblsApp) == null ? void 0 : _b.state);
1733
+ }
1734
+ return param ? state2[param] : state2;
1735
+ }
1736
+ function getRoot(key) {
1737
+ var _a;
1738
+ const rootElem = (_a = this.getRootState()) == null ? void 0 : _a.__element;
1739
+ return rootElem && Object.keys(rootElem).length > 0 && key ? rootElem[key] : rootElem;
1740
+ }
1741
+ function getRootData(key) {
1742
+ return this.getRoot("data") && Object.keys(this.getRoot("data")).length > 0 && key ? this.getRoot("data")[key] : this.getRoot("data");
1743
+ }
1744
+ function getRootContext(key) {
1745
+ var _a;
1746
+ const ctx = (_a = this.getRoot()) == null ? void 0 : _a.context;
1747
+ return key ? ctx[key] : ctx;
1748
+ }
1749
+ function getContext(key) {
1750
+ const ctx = this.context;
1751
+ return key ? ctx[key] : ctx;
1752
+ }
1713
1753
  var ROOT = {
1714
1754
  key: ":root",
1715
1755
  node: document22 ? document22.body : report("DocumentNotDefined", document22)
@@ -2000,6 +2040,11 @@ ${element}` : ""
2000
2040
  "getRef",
2001
2041
  "getChildren",
2002
2042
  "getPath",
2043
+ "getRootState",
2044
+ "getRoot",
2045
+ "getRootData",
2046
+ "getRootContext",
2047
+ "getContext",
2003
2048
  "setNodeStyles",
2004
2049
  "spotByPath",
2005
2050
  "keys",
@@ -3118,6 +3163,11 @@ ${element}` : ""
3118
3163
  lookdown,
3119
3164
  lookdownAll,
3120
3165
  getRef,
3166
+ getRootState,
3167
+ getRoot,
3168
+ getRootData,
3169
+ getRootContext,
3170
+ getContext,
3121
3171
  getPath,
3122
3172
  setNodeStyles,
3123
3173
  spotByPath,
@@ -1710,6 +1710,46 @@ ${element}` : ""
1710
1710
  }
1711
1711
  return element;
1712
1712
  };
1713
+ function getRootState(param) {
1714
+ var _a, _b;
1715
+ let state2 = null;
1716
+ const hasRootState = (obj) => {
1717
+ var _a2;
1718
+ return obj.__element && ((_a2 = obj.root) == null ? void 0 : _a2.isRootState);
1719
+ };
1720
+ if (!this) {
1721
+ state2 = window.platformState || ((_a = window.smblsApp) == null ? void 0 : _a.state);
1722
+ } else if (hasRootState(this)) {
1723
+ state2 = this.root;
1724
+ } else if (this.__ref && this.__ref.path) {
1725
+ const hasPlatformState = this.state && hasRootState(this.state);
1726
+ const hasPlatformStateOnParent = this.call("isFunction", this.state) && this.parent.state && hasRootState(this.parent.state);
1727
+ if (hasPlatformState || hasPlatformStateOnParent) {
1728
+ state2 = this.state.root || this.parent.state.root;
1729
+ }
1730
+ }
1731
+ if (!state2) {
1732
+ state2 = window.platformState || ((_b = window.smblsApp) == null ? void 0 : _b.state);
1733
+ }
1734
+ return param ? state2[param] : state2;
1735
+ }
1736
+ function getRoot(key) {
1737
+ var _a;
1738
+ const rootElem = (_a = this.getRootState()) == null ? void 0 : _a.__element;
1739
+ return rootElem && Object.keys(rootElem).length > 0 && key ? rootElem[key] : rootElem;
1740
+ }
1741
+ function getRootData(key) {
1742
+ return this.getRoot("data") && Object.keys(this.getRoot("data")).length > 0 && key ? this.getRoot("data")[key] : this.getRoot("data");
1743
+ }
1744
+ function getRootContext(key) {
1745
+ var _a;
1746
+ const ctx = (_a = this.getRoot()) == null ? void 0 : _a.context;
1747
+ return key ? ctx[key] : ctx;
1748
+ }
1749
+ function getContext(key) {
1750
+ const ctx = this.context;
1751
+ return key ? ctx[key] : ctx;
1752
+ }
1713
1753
  var ROOT = {
1714
1754
  key: ":root",
1715
1755
  node: document22 ? document22.body : report("DocumentNotDefined", document22)
@@ -2000,6 +2040,11 @@ ${element}` : ""
2000
2040
  "getRef",
2001
2041
  "getChildren",
2002
2042
  "getPath",
2043
+ "getRootState",
2044
+ "getRoot",
2045
+ "getRootData",
2046
+ "getRootContext",
2047
+ "getContext",
2003
2048
  "setNodeStyles",
2004
2049
  "spotByPath",
2005
2050
  "keys",
@@ -3118,6 +3163,11 @@ ${element}` : ""
3118
3163
  lookdown,
3119
3164
  lookdownAll,
3120
3165
  getRef,
3166
+ getRootState,
3167
+ getRoot,
3168
+ getRootData,
3169
+ getRootContext,
3170
+ getContext,
3121
3171
  getPath,
3122
3172
  setNodeStyles,
3123
3173
  spotByPath,
@@ -1710,6 +1710,46 @@ ${element}` : ""
1710
1710
  }
1711
1711
  return element;
1712
1712
  };
1713
+ function getRootState(param) {
1714
+ var _a, _b;
1715
+ let state2 = null;
1716
+ const hasRootState = (obj) => {
1717
+ var _a2;
1718
+ return obj.__element && ((_a2 = obj.root) == null ? void 0 : _a2.isRootState);
1719
+ };
1720
+ if (!this) {
1721
+ state2 = window.platformState || ((_a = window.smblsApp) == null ? void 0 : _a.state);
1722
+ } else if (hasRootState(this)) {
1723
+ state2 = this.root;
1724
+ } else if (this.__ref && this.__ref.path) {
1725
+ const hasPlatformState = this.state && hasRootState(this.state);
1726
+ const hasPlatformStateOnParent = this.call("isFunction", this.state) && this.parent.state && hasRootState(this.parent.state);
1727
+ if (hasPlatformState || hasPlatformStateOnParent) {
1728
+ state2 = this.state.root || this.parent.state.root;
1729
+ }
1730
+ }
1731
+ if (!state2) {
1732
+ state2 = window.platformState || ((_b = window.smblsApp) == null ? void 0 : _b.state);
1733
+ }
1734
+ return param ? state2[param] : state2;
1735
+ }
1736
+ function getRoot(key) {
1737
+ var _a;
1738
+ const rootElem = (_a = this.getRootState()) == null ? void 0 : _a.__element;
1739
+ return rootElem && Object.keys(rootElem).length > 0 && key ? rootElem[key] : rootElem;
1740
+ }
1741
+ function getRootData(key) {
1742
+ return this.getRoot("data") && Object.keys(this.getRoot("data")).length > 0 && key ? this.getRoot("data")[key] : this.getRoot("data");
1743
+ }
1744
+ function getRootContext(key) {
1745
+ var _a;
1746
+ const ctx = (_a = this.getRoot()) == null ? void 0 : _a.context;
1747
+ return key ? ctx[key] : ctx;
1748
+ }
1749
+ function getContext(key) {
1750
+ const ctx = this.context;
1751
+ return key ? ctx[key] : ctx;
1752
+ }
1713
1753
  var ROOT = {
1714
1754
  key: ":root",
1715
1755
  node: document22 ? document22.body : report("DocumentNotDefined", document22)
@@ -2000,6 +2040,11 @@ ${element}` : ""
2000
2040
  "getRef",
2001
2041
  "getChildren",
2002
2042
  "getPath",
2043
+ "getRootState",
2044
+ "getRoot",
2045
+ "getRootData",
2046
+ "getRootContext",
2047
+ "getContext",
2003
2048
  "setNodeStyles",
2004
2049
  "spotByPath",
2005
2050
  "keys",
@@ -3118,6 +3163,11 @@ ${element}` : ""
3118
3163
  lookdown,
3119
3164
  lookdownAll,
3120
3165
  getRef,
3166
+ getRootState,
3167
+ getRoot,
3168
+ getRootData,
3169
+ getRootContext,
3170
+ getContext,
3121
3171
  getPath,
3122
3172
  setNodeStyles,
3123
3173
  spotByPath,
@@ -1710,6 +1710,46 @@ ${element}` : ""
1710
1710
  }
1711
1711
  return element;
1712
1712
  };
1713
+ function getRootState(param) {
1714
+ var _a, _b;
1715
+ let state2 = null;
1716
+ const hasRootState = (obj) => {
1717
+ var _a2;
1718
+ return obj.__element && ((_a2 = obj.root) == null ? void 0 : _a2.isRootState);
1719
+ };
1720
+ if (!this) {
1721
+ state2 = window.platformState || ((_a = window.smblsApp) == null ? void 0 : _a.state);
1722
+ } else if (hasRootState(this)) {
1723
+ state2 = this.root;
1724
+ } else if (this.__ref && this.__ref.path) {
1725
+ const hasPlatformState = this.state && hasRootState(this.state);
1726
+ const hasPlatformStateOnParent = this.call("isFunction", this.state) && this.parent.state && hasRootState(this.parent.state);
1727
+ if (hasPlatformState || hasPlatformStateOnParent) {
1728
+ state2 = this.state.root || this.parent.state.root;
1729
+ }
1730
+ }
1731
+ if (!state2) {
1732
+ state2 = window.platformState || ((_b = window.smblsApp) == null ? void 0 : _b.state);
1733
+ }
1734
+ return param ? state2[param] : state2;
1735
+ }
1736
+ function getRoot(key) {
1737
+ var _a;
1738
+ const rootElem = (_a = this.getRootState()) == null ? void 0 : _a.__element;
1739
+ return rootElem && Object.keys(rootElem).length > 0 && key ? rootElem[key] : rootElem;
1740
+ }
1741
+ function getRootData(key) {
1742
+ return this.getRoot("data") && Object.keys(this.getRoot("data")).length > 0 && key ? this.getRoot("data")[key] : this.getRoot("data");
1743
+ }
1744
+ function getRootContext(key) {
1745
+ var _a;
1746
+ const ctx = (_a = this.getRoot()) == null ? void 0 : _a.context;
1747
+ return key ? ctx[key] : ctx;
1748
+ }
1749
+ function getContext(key) {
1750
+ const ctx = this.context;
1751
+ return key ? ctx[key] : ctx;
1752
+ }
1713
1753
  var ROOT = {
1714
1754
  key: ":root",
1715
1755
  node: document22 ? document22.body : report("DocumentNotDefined", document22)
@@ -2000,6 +2040,11 @@ ${element}` : ""
2000
2040
  "getRef",
2001
2041
  "getChildren",
2002
2042
  "getPath",
2043
+ "getRootState",
2044
+ "getRoot",
2045
+ "getRootData",
2046
+ "getRootContext",
2047
+ "getContext",
2003
2048
  "setNodeStyles",
2004
2049
  "spotByPath",
2005
2050
  "keys",
@@ -3118,6 +3163,11 @@ ${element}` : ""
3118
3163
  lookdown,
3119
3164
  lookdownAll,
3120
3165
  getRef,
3166
+ getRootState,
3167
+ getRoot,
3168
+ getRootData,
3169
+ getRootContext,
3170
+ getContext,
3121
3171
  getPath,
3122
3172
  setNodeStyles,
3123
3173
  spotByPath,
@@ -1710,6 +1710,46 @@ ${element}` : ""
1710
1710
  }
1711
1711
  return element;
1712
1712
  };
1713
+ function getRootState(param) {
1714
+ var _a, _b;
1715
+ let state2 = null;
1716
+ const hasRootState = (obj) => {
1717
+ var _a2;
1718
+ return obj.__element && ((_a2 = obj.root) == null ? void 0 : _a2.isRootState);
1719
+ };
1720
+ if (!this) {
1721
+ state2 = window.platformState || ((_a = window.smblsApp) == null ? void 0 : _a.state);
1722
+ } else if (hasRootState(this)) {
1723
+ state2 = this.root;
1724
+ } else if (this.__ref && this.__ref.path) {
1725
+ const hasPlatformState = this.state && hasRootState(this.state);
1726
+ const hasPlatformStateOnParent = this.call("isFunction", this.state) && this.parent.state && hasRootState(this.parent.state);
1727
+ if (hasPlatformState || hasPlatformStateOnParent) {
1728
+ state2 = this.state.root || this.parent.state.root;
1729
+ }
1730
+ }
1731
+ if (!state2) {
1732
+ state2 = window.platformState || ((_b = window.smblsApp) == null ? void 0 : _b.state);
1733
+ }
1734
+ return param ? state2[param] : state2;
1735
+ }
1736
+ function getRoot(key) {
1737
+ var _a;
1738
+ const rootElem = (_a = this.getRootState()) == null ? void 0 : _a.__element;
1739
+ return rootElem && Object.keys(rootElem).length > 0 && key ? rootElem[key] : rootElem;
1740
+ }
1741
+ function getRootData(key) {
1742
+ return this.getRoot("data") && Object.keys(this.getRoot("data")).length > 0 && key ? this.getRoot("data")[key] : this.getRoot("data");
1743
+ }
1744
+ function getRootContext(key) {
1745
+ var _a;
1746
+ const ctx = (_a = this.getRoot()) == null ? void 0 : _a.context;
1747
+ return key ? ctx[key] : ctx;
1748
+ }
1749
+ function getContext(key) {
1750
+ const ctx = this.context;
1751
+ return key ? ctx[key] : ctx;
1752
+ }
1713
1753
  var ROOT = {
1714
1754
  key: ":root",
1715
1755
  node: document22 ? document22.body : report("DocumentNotDefined", document22)
@@ -2000,6 +2040,11 @@ ${element}` : ""
2000
2040
  "getRef",
2001
2041
  "getChildren",
2002
2042
  "getPath",
2043
+ "getRootState",
2044
+ "getRoot",
2045
+ "getRootData",
2046
+ "getRootContext",
2047
+ "getContext",
2003
2048
  "setNodeStyles",
2004
2049
  "spotByPath",
2005
2050
  "keys",
@@ -3118,6 +3163,11 @@ ${element}` : ""
3118
3163
  lookdown,
3119
3164
  lookdownAll,
3120
3165
  getRef,
3166
+ getRootState,
3167
+ getRoot,
3168
+ getRootData,
3169
+ getRootContext,
3170
+ getContext,
3121
3171
  getPath,
3122
3172
  setNodeStyles,
3123
3173
  spotByPath,
@@ -1710,6 +1710,46 @@ ${element}` : ""
1710
1710
  }
1711
1711
  return element;
1712
1712
  };
1713
+ function getRootState(param) {
1714
+ var _a, _b;
1715
+ let state2 = null;
1716
+ const hasRootState = (obj) => {
1717
+ var _a2;
1718
+ return obj.__element && ((_a2 = obj.root) == null ? void 0 : _a2.isRootState);
1719
+ };
1720
+ if (!this) {
1721
+ state2 = window.platformState || ((_a = window.smblsApp) == null ? void 0 : _a.state);
1722
+ } else if (hasRootState(this)) {
1723
+ state2 = this.root;
1724
+ } else if (this.__ref && this.__ref.path) {
1725
+ const hasPlatformState = this.state && hasRootState(this.state);
1726
+ const hasPlatformStateOnParent = this.call("isFunction", this.state) && this.parent.state && hasRootState(this.parent.state);
1727
+ if (hasPlatformState || hasPlatformStateOnParent) {
1728
+ state2 = this.state.root || this.parent.state.root;
1729
+ }
1730
+ }
1731
+ if (!state2) {
1732
+ state2 = window.platformState || ((_b = window.smblsApp) == null ? void 0 : _b.state);
1733
+ }
1734
+ return param ? state2[param] : state2;
1735
+ }
1736
+ function getRoot(key) {
1737
+ var _a;
1738
+ const rootElem = (_a = this.getRootState()) == null ? void 0 : _a.__element;
1739
+ return rootElem && Object.keys(rootElem).length > 0 && key ? rootElem[key] : rootElem;
1740
+ }
1741
+ function getRootData(key) {
1742
+ return this.getRoot("data") && Object.keys(this.getRoot("data")).length > 0 && key ? this.getRoot("data")[key] : this.getRoot("data");
1743
+ }
1744
+ function getRootContext(key) {
1745
+ var _a;
1746
+ const ctx = (_a = this.getRoot()) == null ? void 0 : _a.context;
1747
+ return key ? ctx[key] : ctx;
1748
+ }
1749
+ function getContext(key) {
1750
+ const ctx = this.context;
1751
+ return key ? ctx[key] : ctx;
1752
+ }
1713
1753
  var ROOT = {
1714
1754
  key: ":root",
1715
1755
  node: document22 ? document22.body : report("DocumentNotDefined", document22)
@@ -2000,6 +2040,11 @@ ${element}` : ""
2000
2040
  "getRef",
2001
2041
  "getChildren",
2002
2042
  "getPath",
2043
+ "getRootState",
2044
+ "getRoot",
2045
+ "getRootData",
2046
+ "getRootContext",
2047
+ "getContext",
2003
2048
  "setNodeStyles",
2004
2049
  "spotByPath",
2005
2050
  "keys",
@@ -3118,6 +3163,11 @@ ${element}` : ""
3118
3163
  lookdown,
3119
3164
  lookdownAll,
3120
3165
  getRef,
3166
+ getRootState,
3167
+ getRoot,
3168
+ getRootData,
3169
+ getRootContext,
3170
+ getContext,
3121
3171
  getPath,
3122
3172
  setNodeStyles,
3123
3173
  spotByPath,
@@ -1710,6 +1710,46 @@ ${element}` : ""
1710
1710
  }
1711
1711
  return element;
1712
1712
  };
1713
+ function getRootState(param) {
1714
+ var _a, _b;
1715
+ let state2 = null;
1716
+ const hasRootState = (obj) => {
1717
+ var _a2;
1718
+ return obj.__element && ((_a2 = obj.root) == null ? void 0 : _a2.isRootState);
1719
+ };
1720
+ if (!this) {
1721
+ state2 = window.platformState || ((_a = window.smblsApp) == null ? void 0 : _a.state);
1722
+ } else if (hasRootState(this)) {
1723
+ state2 = this.root;
1724
+ } else if (this.__ref && this.__ref.path) {
1725
+ const hasPlatformState = this.state && hasRootState(this.state);
1726
+ const hasPlatformStateOnParent = this.call("isFunction", this.state) && this.parent.state && hasRootState(this.parent.state);
1727
+ if (hasPlatformState || hasPlatformStateOnParent) {
1728
+ state2 = this.state.root || this.parent.state.root;
1729
+ }
1730
+ }
1731
+ if (!state2) {
1732
+ state2 = window.platformState || ((_b = window.smblsApp) == null ? void 0 : _b.state);
1733
+ }
1734
+ return param ? state2[param] : state2;
1735
+ }
1736
+ function getRoot(key) {
1737
+ var _a;
1738
+ const rootElem = (_a = this.getRootState()) == null ? void 0 : _a.__element;
1739
+ return rootElem && Object.keys(rootElem).length > 0 && key ? rootElem[key] : rootElem;
1740
+ }
1741
+ function getRootData(key) {
1742
+ return this.getRoot("data") && Object.keys(this.getRoot("data")).length > 0 && key ? this.getRoot("data")[key] : this.getRoot("data");
1743
+ }
1744
+ function getRootContext(key) {
1745
+ var _a;
1746
+ const ctx = (_a = this.getRoot()) == null ? void 0 : _a.context;
1747
+ return key ? ctx[key] : ctx;
1748
+ }
1749
+ function getContext(key) {
1750
+ const ctx = this.context;
1751
+ return key ? ctx[key] : ctx;
1752
+ }
1713
1753
  var ROOT = {
1714
1754
  key: ":root",
1715
1755
  node: document22 ? document22.body : report("DocumentNotDefined", document22)
@@ -2000,6 +2040,11 @@ ${element}` : ""
2000
2040
  "getRef",
2001
2041
  "getChildren",
2002
2042
  "getPath",
2043
+ "getRootState",
2044
+ "getRoot",
2045
+ "getRootData",
2046
+ "getRootContext",
2047
+ "getContext",
2003
2048
  "setNodeStyles",
2004
2049
  "spotByPath",
2005
2050
  "keys",
@@ -3118,6 +3163,11 @@ ${element}` : ""
3118
3163
  lookdown,
3119
3164
  lookdownAll,
3120
3165
  getRef,
3166
+ getRootState,
3167
+ getRoot,
3168
+ getRootData,
3169
+ getRootContext,
3170
+ getContext,
3121
3171
  getPath,
3122
3172
  setNodeStyles,
3123
3173
  spotByPath,
@@ -1710,6 +1710,46 @@ ${element}` : ""
1710
1710
  }
1711
1711
  return element;
1712
1712
  };
1713
+ function getRootState(param) {
1714
+ var _a, _b;
1715
+ let state2 = null;
1716
+ const hasRootState = (obj) => {
1717
+ var _a2;
1718
+ return obj.__element && ((_a2 = obj.root) == null ? void 0 : _a2.isRootState);
1719
+ };
1720
+ if (!this) {
1721
+ state2 = window.platformState || ((_a = window.smblsApp) == null ? void 0 : _a.state);
1722
+ } else if (hasRootState(this)) {
1723
+ state2 = this.root;
1724
+ } else if (this.__ref && this.__ref.path) {
1725
+ const hasPlatformState = this.state && hasRootState(this.state);
1726
+ const hasPlatformStateOnParent = this.call("isFunction", this.state) && this.parent.state && hasRootState(this.parent.state);
1727
+ if (hasPlatformState || hasPlatformStateOnParent) {
1728
+ state2 = this.state.root || this.parent.state.root;
1729
+ }
1730
+ }
1731
+ if (!state2) {
1732
+ state2 = window.platformState || ((_b = window.smblsApp) == null ? void 0 : _b.state);
1733
+ }
1734
+ return param ? state2[param] : state2;
1735
+ }
1736
+ function getRoot(key) {
1737
+ var _a;
1738
+ const rootElem = (_a = this.getRootState()) == null ? void 0 : _a.__element;
1739
+ return rootElem && Object.keys(rootElem).length > 0 && key ? rootElem[key] : rootElem;
1740
+ }
1741
+ function getRootData(key) {
1742
+ return this.getRoot("data") && Object.keys(this.getRoot("data")).length > 0 && key ? this.getRoot("data")[key] : this.getRoot("data");
1743
+ }
1744
+ function getRootContext(key) {
1745
+ var _a;
1746
+ const ctx = (_a = this.getRoot()) == null ? void 0 : _a.context;
1747
+ return key ? ctx[key] : ctx;
1748
+ }
1749
+ function getContext(key) {
1750
+ const ctx = this.context;
1751
+ return key ? ctx[key] : ctx;
1752
+ }
1713
1753
  var ROOT = {
1714
1754
  key: ":root",
1715
1755
  node: document22 ? document22.body : report("DocumentNotDefined", document22)
@@ -2000,6 +2040,11 @@ ${element}` : ""
2000
2040
  "getRef",
2001
2041
  "getChildren",
2002
2042
  "getPath",
2043
+ "getRootState",
2044
+ "getRoot",
2045
+ "getRootData",
2046
+ "getRootContext",
2047
+ "getContext",
2003
2048
  "setNodeStyles",
2004
2049
  "spotByPath",
2005
2050
  "keys",
@@ -3118,6 +3163,11 @@ ${element}` : ""
3118
3163
  lookdown,
3119
3164
  lookdownAll,
3120
3165
  getRef,
3166
+ getRootState,
3167
+ getRoot,
3168
+ getRootData,
3169
+ getRootContext,
3170
+ getContext,
3121
3171
  getPath,
3122
3172
  setNodeStyles,
3123
3173
  spotByPath,
@@ -1710,6 +1710,46 @@ ${element}` : ""
1710
1710
  }
1711
1711
  return element;
1712
1712
  };
1713
+ function getRootState(param) {
1714
+ var _a, _b;
1715
+ let state2 = null;
1716
+ const hasRootState = (obj) => {
1717
+ var _a2;
1718
+ return obj.__element && ((_a2 = obj.root) == null ? void 0 : _a2.isRootState);
1719
+ };
1720
+ if (!this) {
1721
+ state2 = window.platformState || ((_a = window.smblsApp) == null ? void 0 : _a.state);
1722
+ } else if (hasRootState(this)) {
1723
+ state2 = this.root;
1724
+ } else if (this.__ref && this.__ref.path) {
1725
+ const hasPlatformState = this.state && hasRootState(this.state);
1726
+ const hasPlatformStateOnParent = this.call("isFunction", this.state) && this.parent.state && hasRootState(this.parent.state);
1727
+ if (hasPlatformState || hasPlatformStateOnParent) {
1728
+ state2 = this.state.root || this.parent.state.root;
1729
+ }
1730
+ }
1731
+ if (!state2) {
1732
+ state2 = window.platformState || ((_b = window.smblsApp) == null ? void 0 : _b.state);
1733
+ }
1734
+ return param ? state2[param] : state2;
1735
+ }
1736
+ function getRoot(key) {
1737
+ var _a;
1738
+ const rootElem = (_a = this.getRootState()) == null ? void 0 : _a.__element;
1739
+ return rootElem && Object.keys(rootElem).length > 0 && key ? rootElem[key] : rootElem;
1740
+ }
1741
+ function getRootData(key) {
1742
+ return this.getRoot("data") && Object.keys(this.getRoot("data")).length > 0 && key ? this.getRoot("data")[key] : this.getRoot("data");
1743
+ }
1744
+ function getRootContext(key) {
1745
+ var _a;
1746
+ const ctx = (_a = this.getRoot()) == null ? void 0 : _a.context;
1747
+ return key ? ctx[key] : ctx;
1748
+ }
1749
+ function getContext(key) {
1750
+ const ctx = this.context;
1751
+ return key ? ctx[key] : ctx;
1752
+ }
1713
1753
  var ROOT = {
1714
1754
  key: ":root",
1715
1755
  node: document22 ? document22.body : report("DocumentNotDefined", document22)
@@ -2000,6 +2040,11 @@ ${element}` : ""
2000
2040
  "getRef",
2001
2041
  "getChildren",
2002
2042
  "getPath",
2043
+ "getRootState",
2044
+ "getRoot",
2045
+ "getRootData",
2046
+ "getRootContext",
2047
+ "getContext",
2003
2048
  "setNodeStyles",
2004
2049
  "spotByPath",
2005
2050
  "keys",
@@ -3118,6 +3163,11 @@ ${element}` : ""
3118
3163
  lookdown,
3119
3164
  lookdownAll,
3120
3165
  getRef,
3166
+ getRootState,
3167
+ getRoot,
3168
+ getRootData,
3169
+ getRootContext,
3170
+ getContext,
3121
3171
  getPath,
3122
3172
  setNodeStyles,
3123
3173
  spotByPath,
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@symbo.ls/scratch",
3
3
  "description": "Φ / CSS framework and methodology.",
4
4
  "author": "symbo.ls",
5
- "version": "2.34.27",
5
+ "version": "2.34.29",
6
6
  "files": [
7
7
  "src",
8
8
  "dist"
@@ -25,9 +25,9 @@
25
25
  "prepublish": "rimraf -I dist && npm run build && npm run copy:package:cjs"
26
26
  },
27
27
  "dependencies": {
28
- "@domql/utils": "^2.34.27",
29
- "@symbo.ls/utils": "^2.34.27",
28
+ "@domql/utils": "^2.34.29",
29
+ "@symbo.ls/utils": "^2.34.29",
30
30
  "color-contrast-checker": "^1.5.0"
31
31
  },
32
- "gitHead": "1994ef5ac77cba0564a416c60e9d0a984543d9af"
32
+ "gitHead": "90cb8b61065249122ff356c3ea6eb56191c49bfa"
33
33
  }