tamagui 1.85.6 → 1.85.8
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/native.js +1007 -1000
- package/dist/native.js.map +3 -3
- package/dist/test.native.js +682 -707
- package/dist/test.native.js.map +3 -3
- package/package.json +52 -52
package/dist/test.native.js
CHANGED
|
@@ -1322,7 +1322,7 @@ var require_insertStyleRule_native = __commonJS({
|
|
|
1322
1322
|
if (sepI === -1)
|
|
1323
1323
|
continue;
|
|
1324
1324
|
let key = rule.slice(rule.indexOf("--") + 2, sepI), val = rule.slice(sepI + 2), value;
|
|
1325
|
-
if (val
|
|
1325
|
+
if (val.startsWith("var(")) {
|
|
1326
1326
|
let varName = val.slice(6, -1), tokenVal = colorVarToVal[varName];
|
|
1327
1327
|
tokenVal ? value = tokenVal : (rootComputedStyle ||= getComputedStyle(document.body), value = rootComputedStyle.getPropertyValue("--" + varName));
|
|
1328
1328
|
} else
|
|
@@ -1336,20 +1336,17 @@ var require_insertStyleRule_native = __commonJS({
|
|
|
1336
1336
|
!0
|
|
1337
1337
|
);
|
|
1338
1338
|
}
|
|
1339
|
-
|
|
1340
|
-
names: [
|
|
1341
|
-
...new Set(
|
|
1342
|
-
selectors.map((selector) => {
|
|
1343
|
-
let parts = selector.replace(/(.t_|:root)/g, "").trim().split(" "), [first] = parts, scheme = first.includes("dark") ? "dark" : first.includes("light") ? "light" : "", name = (() => {
|
|
1344
|
-
let _ = parts[parts.length - 1];
|
|
1345
|
-
return scheme && _.startsWith(scheme) && (_ = _.slice(scheme.length + 1)), _;
|
|
1346
|
-
})();
|
|
1347
|
-
return `${scheme}${scheme && name ? "_" : ""}${name}`;
|
|
1348
|
-
})
|
|
1349
|
-
)
|
|
1350
|
-
],
|
|
1339
|
+
let dedupedEntry = {
|
|
1340
|
+
names: [],
|
|
1351
1341
|
theme: values
|
|
1352
1342
|
};
|
|
1343
|
+
for (let selector of selectors) {
|
|
1344
|
+
let scheme = selector.includes("t_dark") ? "dark" : selector.includes("t_light") ? "light" : "", name = selector.slice(selector.lastIndexOf(".t_") + 3);
|
|
1345
|
+
name.startsWith(scheme) && (name = name.slice(scheme.length + 1)), scheme === name && (scheme = "");
|
|
1346
|
+
let themeName = `${scheme}${scheme && name ? "_" : ""}${name}`;
|
|
1347
|
+
dedupedEntry.names.includes(themeName) || dedupedEntry.names.push(themeName);
|
|
1348
|
+
}
|
|
1349
|
+
return dedupedEntry;
|
|
1353
1350
|
}
|
|
1354
1351
|
function getTamaguiSelector(rule, collectThemes = !1) {
|
|
1355
1352
|
if (rule instanceof CSSStyleRule) {
|
|
@@ -1659,65 +1656,11 @@ var require_useMedia_native = __commonJS({
|
|
|
1659
1656
|
}
|
|
1660
1657
|
});
|
|
1661
1658
|
|
|
1662
|
-
// ../web/dist/cjs/
|
|
1663
|
-
var
|
|
1664
|
-
"../web/dist/cjs/
|
|
1665
|
-
"use strict";
|
|
1666
|
-
var __create2 = Object.create, __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __getProtoOf2 = Object.getPrototypeOf, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
1667
|
-
for (var name in all)
|
|
1668
|
-
__defProp2(target, name, { get: all[name], enumerable: !0 });
|
|
1669
|
-
}, __copyProps2 = (to, from, except, desc) => {
|
|
1670
|
-
if (from && typeof from == "object" || typeof from == "function")
|
|
1671
|
-
for (let key of __getOwnPropNames2(from))
|
|
1672
|
-
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
1673
|
-
return to;
|
|
1674
|
-
}, __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps2(
|
|
1675
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
1676
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
1677
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
1678
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
1679
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", { value: mod, enumerable: !0 }) : target,
|
|
1680
|
-
mod
|
|
1681
|
-
)), __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), Tamagui_exports = {};
|
|
1682
|
-
__export2(Tamagui_exports, {
|
|
1683
|
-
Tamagui: () => Tamagui,
|
|
1684
|
-
getValueFromIdentifier: () => getValueFromIdentifier,
|
|
1685
|
-
setIdentifierValue: () => setIdentifierValue
|
|
1686
|
-
});
|
|
1687
|
-
module2.exports = __toCommonJS2(Tamagui_exports);
|
|
1688
|
-
var Helpers = __toESM2(require_index_native7()), import_config = require_config_native(), import_insertStyleRule = require_insertStyleRule_native(), import_useMedia = require_useMedia_native(), TamaguiManager = class {
|
|
1689
|
-
constructor() {
|
|
1690
|
-
this.Helpers = Helpers;
|
|
1691
|
-
}
|
|
1692
|
-
get mediaState() {
|
|
1693
|
-
return { ...import_useMedia.mediaState };
|
|
1694
|
-
}
|
|
1695
|
-
get config() {
|
|
1696
|
-
return (0, import_config.getConfig)();
|
|
1697
|
-
}
|
|
1698
|
-
get insertedRules() {
|
|
1699
|
-
return (0, import_insertStyleRule.getAllRules)();
|
|
1700
|
-
}
|
|
1701
|
-
get allSelectors() {
|
|
1702
|
-
return (0, import_insertStyleRule.getAllSelectors)();
|
|
1703
|
-
}
|
|
1704
|
-
get allTransforms() {
|
|
1705
|
-
return (0, import_insertStyleRule.getAllTransforms)();
|
|
1706
|
-
}
|
|
1707
|
-
get identifierToValue() {
|
|
1708
|
-
return identifierToValue;
|
|
1709
|
-
}
|
|
1710
|
-
}, Tamagui = new TamaguiManager(), identifierToValue = /* @__PURE__ */ new Map(), getValueFromIdentifier = (identifier) => identifierToValue.get(identifier), setIdentifierValue = (identifier, value) => {
|
|
1711
|
-
identifierToValue.set(identifier, value);
|
|
1712
|
-
};
|
|
1713
|
-
}
|
|
1714
|
-
});
|
|
1715
|
-
|
|
1716
|
-
// ../compose-refs/dist/cjs/compose-refs.native.js
|
|
1717
|
-
var require_compose_refs_native = __commonJS({
|
|
1718
|
-
"../compose-refs/dist/cjs/compose-refs.native.js"(exports2, module2) {
|
|
1659
|
+
// ../web/dist/cjs/helpers/createShallowSetState.native.js
|
|
1660
|
+
var require_createShallowSetState_native = __commonJS({
|
|
1661
|
+
"../web/dist/cjs/helpers/createShallowSetState.native.js"(exports2, module2) {
|
|
1719
1662
|
"use strict";
|
|
1720
|
-
var
|
|
1663
|
+
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
1721
1664
|
for (var name in all)
|
|
1722
1665
|
__defProp2(target, name, { get: all[name], enumerable: !0 });
|
|
1723
1666
|
}, __copyProps2 = (to, from, except, desc) => {
|
|
@@ -1725,47 +1668,28 @@ var require_compose_refs_native = __commonJS({
|
|
|
1725
1668
|
for (let key of __getOwnPropNames2(from))
|
|
1726
1669
|
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
1727
1670
|
return to;
|
|
1728
|
-
},
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", { value: mod, enumerable: !0 }) : target,
|
|
1734
|
-
mod
|
|
1735
|
-
)), __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), compose_refs_exports = {};
|
|
1736
|
-
__export2(compose_refs_exports, {
|
|
1737
|
-
composeRefs: () => composeRefs,
|
|
1738
|
-
useComposedRefs: () => useComposedRefs
|
|
1671
|
+
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), createShallowSetState_exports = {};
|
|
1672
|
+
__export2(createShallowSetState_exports, {
|
|
1673
|
+
createShallowSetState: () => createShallowSetState,
|
|
1674
|
+
isEqualShallow: () => isEqualShallow,
|
|
1675
|
+
mergeIfNotShallowEqual: () => mergeIfNotShallowEqual
|
|
1739
1676
|
});
|
|
1740
|
-
module2.exports = __toCommonJS2(
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
typeof ref == "function" ? ref(value) : ref && (ref.current = value);
|
|
1677
|
+
module2.exports = __toCommonJS2(createShallowSetState_exports);
|
|
1678
|
+
function createShallowSetState(setter, debug) {
|
|
1679
|
+
return (next) => setter((prev) => mergeIfNotShallowEqual(prev, next, debug));
|
|
1744
1680
|
}
|
|
1745
|
-
function
|
|
1746
|
-
return (
|
|
1681
|
+
function mergeIfNotShallowEqual(prev, next, debug) {
|
|
1682
|
+
return isEqualShallow(prev, next) ? prev : { ...prev, ...next };
|
|
1747
1683
|
}
|
|
1748
|
-
function
|
|
1749
|
-
|
|
1684
|
+
function isEqualShallow(prev, next) {
|
|
1685
|
+
for (let key in next)
|
|
1686
|
+
if (prev[key] !== next[key])
|
|
1687
|
+
return !1;
|
|
1688
|
+
return !0;
|
|
1750
1689
|
}
|
|
1751
1690
|
}
|
|
1752
1691
|
});
|
|
1753
1692
|
|
|
1754
|
-
// ../compose-refs/dist/cjs/index.native.js
|
|
1755
|
-
var require_index_native10 = __commonJS({
|
|
1756
|
-
"../compose-refs/dist/cjs/index.native.js"(exports2, module2) {
|
|
1757
|
-
"use strict";
|
|
1758
|
-
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __copyProps2 = (to, from, except, desc) => {
|
|
1759
|
-
if (from && typeof from == "object" || typeof from == "function")
|
|
1760
|
-
for (let key of __getOwnPropNames2(from))
|
|
1761
|
-
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
1762
|
-
return to;
|
|
1763
|
-
}, __reExport2 = (target, mod, secondTarget) => (__copyProps2(target, mod, "default"), secondTarget && __copyProps2(secondTarget, mod, "default")), __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), src_exports2 = {};
|
|
1764
|
-
module2.exports = __toCommonJS2(src_exports2);
|
|
1765
|
-
__reExport2(src_exports2, require_compose_refs_native(), module2.exports);
|
|
1766
|
-
}
|
|
1767
|
-
});
|
|
1768
|
-
|
|
1769
1693
|
// ../web/dist/cjs/constants/constants.native.js
|
|
1770
1694
|
var require_constants_native2 = __commonJS({
|
|
1771
1695
|
"../web/dist/cjs/constants/constants.native.js"(exports2, module2) {
|
|
@@ -1800,9 +1724,9 @@ var require_constants_native2 = __commonJS({
|
|
|
1800
1724
|
}
|
|
1801
1725
|
});
|
|
1802
1726
|
|
|
1803
|
-
// ../web/dist/cjs/helpers/
|
|
1804
|
-
var
|
|
1805
|
-
"../web/dist/cjs/helpers/
|
|
1727
|
+
// ../web/dist/cjs/helpers/ThemeManager.native.js
|
|
1728
|
+
var require_ThemeManager_native = __commonJS({
|
|
1729
|
+
"../web/dist/cjs/helpers/ThemeManager.native.js"(exports2, module2) {
|
|
1806
1730
|
"use strict";
|
|
1807
1731
|
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
1808
1732
|
for (var name in all)
|
|
@@ -1812,143 +1736,149 @@ var require_objectIdentityKey_native = __commonJS({
|
|
|
1812
1736
|
for (let key of __getOwnPropNames2(from))
|
|
1813
1737
|
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
1814
1738
|
return to;
|
|
1815
|
-
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod),
|
|
1816
|
-
__export2(
|
|
1817
|
-
|
|
1739
|
+
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), ThemeManager_exports = {};
|
|
1740
|
+
__export2(ThemeManager_exports, {
|
|
1741
|
+
ThemeManager: () => ThemeManager,
|
|
1742
|
+
getHasThemeUpdatingProps: () => getHasThemeUpdatingProps,
|
|
1743
|
+
getManagers: () => getManagers
|
|
1818
1744
|
});
|
|
1819
|
-
module2.exports = __toCommonJS2(
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
k += key;
|
|
1824
|
-
let arg = obj[key], type = typeof arg;
|
|
1825
|
-
if (!arg || type !== "object" && type !== "function")
|
|
1826
|
-
k += type + arg;
|
|
1827
|
-
else if (cache.has(arg))
|
|
1828
|
-
k += cache.get(arg);
|
|
1829
|
-
else {
|
|
1830
|
-
let v = Math.random();
|
|
1831
|
-
cache.set(arg, v), k += v;
|
|
1832
|
-
}
|
|
1833
|
-
}
|
|
1834
|
-
return k;
|
|
1745
|
+
module2.exports = __toCommonJS2(ThemeManager_exports);
|
|
1746
|
+
var import_constants4 = require_index_native(), import_config = require_config_native(), import_constants22 = require_constants_native2(), emptyState = { name: "" };
|
|
1747
|
+
function getHasThemeUpdatingProps(props) {
|
|
1748
|
+
return !!(props.name || props.componentName || props.inverse || props.reset);
|
|
1835
1749
|
}
|
|
1836
|
-
var
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
var require_createStyledContext_native = __commonJS({
|
|
1842
|
-
"../web/dist/cjs/helpers/createStyledContext.native.js"(exports2, module2) {
|
|
1843
|
-
"use strict";
|
|
1844
|
-
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
1845
|
-
for (var name in all)
|
|
1846
|
-
__defProp2(target, name, { get: all[name], enumerable: !0 });
|
|
1847
|
-
}, __copyProps2 = (to, from, except, desc) => {
|
|
1848
|
-
if (from && typeof from == "object" || typeof from == "function")
|
|
1849
|
-
for (let key of __getOwnPropNames2(from))
|
|
1850
|
-
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
1851
|
-
return to;
|
|
1852
|
-
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), createStyledContext_exports = {};
|
|
1853
|
-
__export2(createStyledContext_exports, {
|
|
1854
|
-
createStyledContext: () => createStyledContext2
|
|
1855
|
-
});
|
|
1856
|
-
module2.exports = __toCommonJS2(createStyledContext_exports);
|
|
1857
|
-
var import_react2 = require("react"), import_objectIdentityKey = require_objectIdentityKey_native(), import_jsx_runtime6 = require("react/jsx-runtime");
|
|
1858
|
-
function createStyledContext2(defaultValues) {
|
|
1859
|
-
let OGContext = (0, import_react2.createContext)(defaultValues), OGProvider2 = OGContext.Provider, Context = OGContext, scopedContexts = /* @__PURE__ */ new Map(), Provider = ({
|
|
1860
|
-
children,
|
|
1861
|
-
scope,
|
|
1862
|
-
...values
|
|
1863
|
-
}) => {
|
|
1864
|
-
let next = (0, import_react2.useMemo)(() => ({
|
|
1865
|
-
// this ! is a workaround for ts error
|
|
1866
|
-
...defaultValues,
|
|
1867
|
-
...values
|
|
1868
|
-
}), [(0, import_objectIdentityKey.objectIdentityKey)(values)]), Provider2 = OGProvider2;
|
|
1869
|
-
if (scope) {
|
|
1870
|
-
let ScopedContext = scopedContexts.get(scope);
|
|
1871
|
-
ScopedContext || (ScopedContext = (0, import_react2.createContext)(defaultValues), scopedContexts.set(scope, ScopedContext)), Provider2 = ScopedContext.Provider;
|
|
1750
|
+
var uid = 0, ThemeManager = class {
|
|
1751
|
+
constructor(props = {}, parentManager) {
|
|
1752
|
+
if (this.props = props, this.id = 0, this.themeListeners = /* @__PURE__ */ new Set(), this.parentManager = null, this.state = emptyState, this._allKeys = null, uid = (uid + 1) % Number.MAX_VALUE, this.id = uid, parentManager === "root") {
|
|
1753
|
+
this.updateStateFromProps(props, !1);
|
|
1754
|
+
return;
|
|
1872
1755
|
}
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
}
|
|
1880
|
-
}
|
|
1881
|
-
});
|
|
1882
|
-
|
|
1883
|
-
// ../web/dist/cjs/contexts/ComponentContext.native.js
|
|
1884
|
-
var require_ComponentContext_native = __commonJS({
|
|
1885
|
-
"../web/dist/cjs/contexts/ComponentContext.native.js"(exports2, module2) {
|
|
1886
|
-
"use strict";
|
|
1887
|
-
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
1888
|
-
for (var name in all)
|
|
1889
|
-
__defProp2(target, name, { get: all[name], enumerable: !0 });
|
|
1890
|
-
}, __copyProps2 = (to, from, except, desc) => {
|
|
1891
|
-
if (from && typeof from == "object" || typeof from == "function")
|
|
1892
|
-
for (let key of __getOwnPropNames2(from))
|
|
1893
|
-
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
1894
|
-
return to;
|
|
1895
|
-
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), ComponentContext_exports = {};
|
|
1896
|
-
__export2(ComponentContext_exports, {
|
|
1897
|
-
ComponentContext: () => ComponentContext2
|
|
1898
|
-
});
|
|
1899
|
-
module2.exports = __toCommonJS2(ComponentContext_exports);
|
|
1900
|
-
var import_createStyledContext = require_createStyledContext_native(), ComponentContext2 = (0, import_createStyledContext.createStyledContext)({
|
|
1901
|
-
disableSSR: void 0,
|
|
1902
|
-
inText: !1,
|
|
1903
|
-
language: null,
|
|
1904
|
-
animationDriver: null,
|
|
1905
|
-
groups: {
|
|
1906
|
-
emit: null,
|
|
1907
|
-
subscribe: null,
|
|
1908
|
-
state: {}
|
|
1756
|
+
if (!parentManager)
|
|
1757
|
+
throw new Error(
|
|
1758
|
+
"No parent manager given, this is likely due to duplicated Tamagui dependencies. Check your lockfile for mis-matched versions. It could also be from an error somewhere else in your stack causing Tamagui to recieve undefined context, you can try putting some ErrorBoundary components around other areas of your app, or a Suspense boundary."
|
|
1759
|
+
);
|
|
1760
|
+
if (this.parentManager = parentManager, !this.updateStateFromProps(props, !1))
|
|
1761
|
+
return parentManager;
|
|
1909
1762
|
}
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
}
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
var
|
|
1951
|
-
|
|
1763
|
+
updateStateFromProps(props = this.props || {}, shouldNotify = !0) {
|
|
1764
|
+
if (this.props = props, props.forceTheme)
|
|
1765
|
+
return this.state.theme = props.forceTheme, this.state.name = props.name || "", this.updateState(this.state, !0), this.state;
|
|
1766
|
+
let nextState = this.getStateIfChanged(props);
|
|
1767
|
+
if (nextState)
|
|
1768
|
+
return this.updateState(nextState, shouldNotify), nextState;
|
|
1769
|
+
}
|
|
1770
|
+
updateState(nextState, shouldNotify = !0) {
|
|
1771
|
+
this.state = nextState, this._allKeys = null, this._numChangeEventsSent ??= 0, this._numChangeEventsSent++, shouldNotify && this.notify();
|
|
1772
|
+
}
|
|
1773
|
+
getStateIfChanged(props = this.props, state = this.state, parentManager = this.parentManager) {
|
|
1774
|
+
let _ = this.getState(props, parentManager);
|
|
1775
|
+
if (state && state !== emptyState && !_)
|
|
1776
|
+
return parentManager == null ? void 0 : parentManager.state;
|
|
1777
|
+
if (this.getStateShouldChange(_, state))
|
|
1778
|
+
return _;
|
|
1779
|
+
}
|
|
1780
|
+
getStateShouldChange(nextState, state = this.state) {
|
|
1781
|
+
return !(!(nextState != null && nextState.theme) || nextState.theme === (state == null ? void 0 : state.theme));
|
|
1782
|
+
}
|
|
1783
|
+
getState(props = this.props, parentManager = this.parentManager) {
|
|
1784
|
+
return getState(props, parentManager) || (parentManager == null ? void 0 : parentManager.state) || null;
|
|
1785
|
+
}
|
|
1786
|
+
get allKeys() {
|
|
1787
|
+
var _a;
|
|
1788
|
+
return this._allKeys ||= /* @__PURE__ */ new Set([
|
|
1789
|
+
...((_a = this.parentManager) == null ? void 0 : _a.allKeys) || [],
|
|
1790
|
+
...Object.keys(this.state.theme || {})
|
|
1791
|
+
]), this._allKeys;
|
|
1792
|
+
}
|
|
1793
|
+
notify(forced = !1) {
|
|
1794
|
+
this.themeListeners.forEach((cb) => cb(this.state.name, this, forced));
|
|
1795
|
+
}
|
|
1796
|
+
onChangeTheme(cb, debugId) {
|
|
1797
|
+
return debugId && (this._listeningIds ??= /* @__PURE__ */ new Set(), this._listeningIds.add(debugId)), this.themeListeners.add(cb), () => {
|
|
1798
|
+
this.themeListeners.delete(cb);
|
|
1799
|
+
};
|
|
1800
|
+
}
|
|
1801
|
+
};
|
|
1802
|
+
function getState(props, manager) {
|
|
1803
|
+
var _a;
|
|
1804
|
+
if (props.name && props.reset)
|
|
1805
|
+
throw new Error(
|
|
1806
|
+
"Cannot reset and set a new name at the same time."
|
|
1807
|
+
);
|
|
1808
|
+
if (!getHasThemeUpdatingProps(props))
|
|
1809
|
+
return null;
|
|
1810
|
+
let themes = (0, import_config.getThemes)(), [allManagers, componentManagers] = getManagers(manager), isDirectParentAComponentTheme = !!(manager != null && manager.state.isComponent), startIndex = props.reset && !isDirectParentAComponentTheme ? 1 : 0, baseManager = allManagers[startIndex], parentManager = allManagers[startIndex + 1];
|
|
1811
|
+
if (!baseManager && props.reset)
|
|
1812
|
+
return console.warn("Cannot reset, no parent theme exists"), null;
|
|
1813
|
+
let { componentName } = props, result = null, baseName = (baseManager == null ? void 0 : baseManager.state.name) || "";
|
|
1814
|
+
baseManager != null && baseManager.state.isComponent && (baseName = baseName.replace(/_[A-Z][A-Za-z]+/, ""));
|
|
1815
|
+
let nextName = props.reset ? baseName : props.name || "", allComponentThemes = componentManagers.map((x) => (x == null ? void 0 : x.state.name) || "");
|
|
1816
|
+
isDirectParentAComponentTheme && allComponentThemes.shift();
|
|
1817
|
+
let base = baseName.split(import_constants22.THEME_NAME_SEPARATOR), max2 = base.length, min2 = props.componentName && !nextName ? max2 : 0;
|
|
1818
|
+
for (let i = max2; i >= min2; i--) {
|
|
1819
|
+
let prefix = base.slice(0, i).join(import_constants22.THEME_NAME_SEPARATOR);
|
|
1820
|
+
props.inverse && (prefix = inverseThemeName(prefix));
|
|
1821
|
+
let potentials = [];
|
|
1822
|
+
if (prefix && prefix !== baseName && potentials.push(prefix), nextName && potentials.unshift(prefix ? `${prefix}_${nextName}` : nextName), i === 1) {
|
|
1823
|
+
let lastSegment = potentials.findIndex((x) => !x.includes("_"));
|
|
1824
|
+
lastSegment > 0 && potentials.splice(lastSegment, 0, nextName);
|
|
1825
|
+
}
|
|
1826
|
+
if (componentName && !props.reset) {
|
|
1827
|
+
let baseLen = base.length, componentPotentials = [];
|
|
1828
|
+
if (nextName && baseLen > 1) {
|
|
1829
|
+
let beforeSeparator = base[0];
|
|
1830
|
+
componentPotentials.push(`${beforeSeparator}_${nextName}_${componentName}`);
|
|
1831
|
+
}
|
|
1832
|
+
if (componentPotentials.push(`${prefix}_${componentName}`), nextName) {
|
|
1833
|
+
if (i > baseLen) {
|
|
1834
|
+
let prefixLessOne = base.slice(0, i - 1).join(import_constants22.THEME_NAME_SEPARATOR);
|
|
1835
|
+
if (prefixLessOne) {
|
|
1836
|
+
let lessSpecific = `${prefixLessOne}_${nextName}_${componentName}`;
|
|
1837
|
+
componentPotentials.unshift(lessSpecific);
|
|
1838
|
+
}
|
|
1839
|
+
}
|
|
1840
|
+
let moreSpecific = `${prefix}_${nextName}_${componentName}`;
|
|
1841
|
+
componentPotentials.unshift(moreSpecific);
|
|
1842
|
+
}
|
|
1843
|
+
potentials = [...componentPotentials, ...potentials, ...allComponentThemes];
|
|
1844
|
+
}
|
|
1845
|
+
let found = potentials.find((t) => t in themes);
|
|
1846
|
+
if (typeof props.debug == "string" && console.info(" getState ", {
|
|
1847
|
+
props,
|
|
1848
|
+
found,
|
|
1849
|
+
potentials,
|
|
1850
|
+
baseManager,
|
|
1851
|
+
nextName,
|
|
1852
|
+
baseName,
|
|
1853
|
+
prefix
|
|
1854
|
+
}), found) {
|
|
1855
|
+
let names = found.split("_"), [firstName, ...restNames] = names, lastName = names[names.length - 1], isComponent = lastName[0] === lastName[0].toUpperCase(), scheme = firstName === "light" ? "light" : firstName === "dark" ? "dark" : void 0, pre = import_constants22.THEME_CLASSNAME_PREFIX, className = import_constants4.isWeb ? `${pre}sub_theme ${pre}${!scheme || !restNames.length ? firstName : restNames.join("_")}` : "", parentState = (_a = baseManager || parentManager) == null ? void 0 : _a.state, parentName = parentState == null ? void 0 : parentState.name;
|
|
1856
|
+
result = {
|
|
1857
|
+
name: found,
|
|
1858
|
+
parentName,
|
|
1859
|
+
theme: themes[found],
|
|
1860
|
+
className,
|
|
1861
|
+
isComponent,
|
|
1862
|
+
scheme
|
|
1863
|
+
};
|
|
1864
|
+
break;
|
|
1865
|
+
}
|
|
1866
|
+
}
|
|
1867
|
+
return props.debug === "verbose" && typeof window < "u" && (console.groupCollapsed("ThemeManager.getState()"), console.info({ props, baseName, base, min: min2, max: max2 }), console.warn("result", { result }), console.trace(), console.groupEnd()), result;
|
|
1868
|
+
}
|
|
1869
|
+
var inverseThemeName = (themeName) => themeName.startsWith("light") ? themeName.replace(/^light/, "dark") : themeName.replace(/^dark/, "light");
|
|
1870
|
+
function getManagers(themeManager) {
|
|
1871
|
+
let comp = [], all = [], cur = themeManager;
|
|
1872
|
+
for (; cur; )
|
|
1873
|
+
all.push(cur), cur.state.isComponent && comp.push(cur), cur = cur.parentManager;
|
|
1874
|
+
return [all, comp];
|
|
1875
|
+
}
|
|
1876
|
+
}
|
|
1877
|
+
});
|
|
1878
|
+
|
|
1879
|
+
// ../web/dist/cjs/helpers/ThemeManagerContext.native.js
|
|
1880
|
+
var require_ThemeManagerContext_native = __commonJS({
|
|
1881
|
+
"../web/dist/cjs/helpers/ThemeManagerContext.native.js"(exports2, module2) {
|
|
1952
1882
|
"use strict";
|
|
1953
1883
|
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
1954
1884
|
for (var name in all)
|
|
@@ -1958,25 +1888,461 @@ var require_createShallowSetState_native = __commonJS({
|
|
|
1958
1888
|
for (let key of __getOwnPropNames2(from))
|
|
1959
1889
|
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
1960
1890
|
return to;
|
|
1961
|
-
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod),
|
|
1962
|
-
__export2(
|
|
1963
|
-
|
|
1964
|
-
isEqualShallow: () => isEqualShallow,
|
|
1965
|
-
mergeIfNotShallowEqual: () => mergeIfNotShallowEqual
|
|
1891
|
+
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), ThemeManagerContext_exports = {};
|
|
1892
|
+
__export2(ThemeManagerContext_exports, {
|
|
1893
|
+
ThemeManagerIDContext: () => ThemeManagerIDContext
|
|
1966
1894
|
});
|
|
1967
|
-
module2.exports = __toCommonJS2(
|
|
1968
|
-
|
|
1969
|
-
|
|
1895
|
+
module2.exports = __toCommonJS2(ThemeManagerContext_exports);
|
|
1896
|
+
var import_react2 = require("react"), ThemeManagerIDContext = (0, import_react2.createContext)(1);
|
|
1897
|
+
}
|
|
1898
|
+
});
|
|
1899
|
+
|
|
1900
|
+
// ../web/dist/cjs/hooks/useTheme.native.js
|
|
1901
|
+
var require_useTheme_native = __commonJS({
|
|
1902
|
+
"../web/dist/cjs/hooks/useTheme.native.js"(exports2, module2) {
|
|
1903
|
+
"use strict";
|
|
1904
|
+
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
1905
|
+
for (var name in all)
|
|
1906
|
+
__defProp2(target, name, { get: all[name], enumerable: !0 });
|
|
1907
|
+
}, __copyProps2 = (to, from, except, desc) => {
|
|
1908
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
1909
|
+
for (let key of __getOwnPropNames2(from))
|
|
1910
|
+
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
1911
|
+
return to;
|
|
1912
|
+
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), useTheme_exports = {};
|
|
1913
|
+
__export2(useTheme_exports, {
|
|
1914
|
+
activeThemeManagers: () => activeThemeManagers,
|
|
1915
|
+
getThemeManager: () => getThemeManager,
|
|
1916
|
+
getThemeProxied: () => getThemeProxied,
|
|
1917
|
+
useChangeThemeEffect: () => useChangeThemeEffect,
|
|
1918
|
+
useTheme: () => useTheme4,
|
|
1919
|
+
useThemeWithState: () => useThemeWithState
|
|
1920
|
+
});
|
|
1921
|
+
module2.exports = __toCommonJS2(useTheme_exports);
|
|
1922
|
+
var import_constants4 = require_index_native(), import_react2 = require("react"), import_config = require_config_native(), import_createVariable = require_createVariable_native(), import_createShallowSetState = require_createShallowSetState_native(), import_ThemeManager = require_ThemeManager_native(), import_ThemeManagerContext = require_ThemeManagerContext_native(), emptyProps = { name: null }, cached;
|
|
1923
|
+
function getDefaultThemeProxied() {
|
|
1924
|
+
if (cached)
|
|
1925
|
+
return cached;
|
|
1926
|
+
let config = (0, import_config.getConfig)(), name = config.themes.light ? "light" : Object.keys(config.themes)[0], defaultTheme = config.themes[name];
|
|
1927
|
+
return cached = getThemeProxied({ theme: defaultTheme, name }), cached;
|
|
1970
1928
|
}
|
|
1971
|
-
|
|
1972
|
-
|
|
1929
|
+
var useTheme4 = (props = emptyProps) => {
|
|
1930
|
+
let [_, theme] = useThemeWithState(props);
|
|
1931
|
+
return theme || getDefaultThemeProxied();
|
|
1932
|
+
}, useThemeWithState = (props) => {
|
|
1933
|
+
let keys = (0, import_react2.useRef)([]), changedThemeState = useChangeThemeEffect(
|
|
1934
|
+
props,
|
|
1935
|
+
!1,
|
|
1936
|
+
keys.current,
|
|
1937
|
+
import_constants4.isServer ? void 0 : () => {
|
|
1938
|
+
var _a, _b;
|
|
1939
|
+
return ((_a = props.shouldUpdate) == null ? void 0 : _a.call(props)) ?? (keys.current.length > 0 ? !0 : void 0);
|
|
1940
|
+
}
|
|
1941
|
+
), { themeManager, state } = changedThemeState, themeProxied = (0, import_react2.useMemo)(() => !themeManager || !(state != null && state.theme) ? {} : getThemeProxied(state, props.deopt, themeManager, keys.current, props.debug), [state == null ? void 0 : state.theme, themeManager, props.deopt, props.debug]);
|
|
1942
|
+
return [changedThemeState, themeProxied];
|
|
1943
|
+
};
|
|
1944
|
+
function getThemeProxied({ theme, name, scheme }, deopt = !1, themeManager, keys, debug) {
|
|
1945
|
+
if (!theme)
|
|
1946
|
+
return {};
|
|
1947
|
+
let config = (0, import_config.getConfig)();
|
|
1948
|
+
function track(key) {
|
|
1949
|
+
keys && !keys.includes(key) && keys.push(key);
|
|
1950
|
+
}
|
|
1951
|
+
return new Proxy(theme, {
|
|
1952
|
+
has(_, key) {
|
|
1953
|
+
if (Reflect.has(theme, key))
|
|
1954
|
+
return !0;
|
|
1955
|
+
if (typeof key == "string")
|
|
1956
|
+
return key[0] === "$" && (key = key.slice(1)), themeManager == null ? void 0 : themeManager.allKeys.has(key);
|
|
1957
|
+
},
|
|
1958
|
+
get(_, key) {
|
|
1959
|
+
if (
|
|
1960
|
+
// dont ask me, idk why but on hermes you can see that useTheme()[undefined] passes in STRING undefined to proxy
|
|
1961
|
+
// if someone is crazy enough to use "undefined" as a theme key then this not working is on them
|
|
1962
|
+
key !== "undefined" && typeof key == "string"
|
|
1963
|
+
) {
|
|
1964
|
+
let keyString = key[0] === "$" ? key.slice(1) : key, val = theme[keyString];
|
|
1965
|
+
if (val && typeof val == "object")
|
|
1966
|
+
return new Proxy(val, {
|
|
1967
|
+
// when they touch the actual value we only track it
|
|
1968
|
+
// if its a variable (web), its ignored!
|
|
1969
|
+
get(_2, subkey) {
|
|
1970
|
+
if (subkey === "val")
|
|
1971
|
+
track(keyString);
|
|
1972
|
+
else if (subkey === "get")
|
|
1973
|
+
return (platform) => {
|
|
1974
|
+
let outVal = (0, import_createVariable.getVariable)(val);
|
|
1975
|
+
if (platform !== "web" && import_constants4.isIos && !deopt && config.settings.fastSchemeChange && !someParentIsInversed(themeManager) && scheme) {
|
|
1976
|
+
let oppositeThemeName = name.replace(
|
|
1977
|
+
scheme === "dark" ? "dark" : "light",
|
|
1978
|
+
scheme === "dark" ? "light" : "dark"
|
|
1979
|
+
), oppositeTheme = config.themes[oppositeThemeName], oppositeVal = (0, import_createVariable.getVariable)(oppositeTheme == null ? void 0 : oppositeTheme[keyString]);
|
|
1980
|
+
if (oppositeVal)
|
|
1981
|
+
return {
|
|
1982
|
+
dynamic: {
|
|
1983
|
+
dark: scheme === "dark" ? outVal : oppositeVal,
|
|
1984
|
+
light: scheme === "light" ? outVal : oppositeVal
|
|
1985
|
+
}
|
|
1986
|
+
};
|
|
1987
|
+
}
|
|
1988
|
+
return track(keyString), outVal;
|
|
1989
|
+
};
|
|
1990
|
+
return Reflect.get(val, subkey);
|
|
1991
|
+
}
|
|
1992
|
+
});
|
|
1993
|
+
}
|
|
1994
|
+
return Reflect.get(_, key);
|
|
1995
|
+
}
|
|
1996
|
+
});
|
|
1973
1997
|
}
|
|
1974
|
-
function
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1998
|
+
function someParentIsInversed(manager) {
|
|
1999
|
+
{
|
|
2000
|
+
let cur = manager;
|
|
2001
|
+
for (; cur; ) {
|
|
2002
|
+
if (!cur.parentManager)
|
|
2003
|
+
return !1;
|
|
2004
|
+
if (cur.parentManager.state.scheme !== cur.state.scheme)
|
|
2005
|
+
return !0;
|
|
2006
|
+
cur = cur.parentManager;
|
|
2007
|
+
}
|
|
2008
|
+
}
|
|
2009
|
+
return !1;
|
|
1979
2010
|
}
|
|
2011
|
+
var activeThemeManagers = /* @__PURE__ */ new Set(), _uidToManager = /* @__PURE__ */ new WeakMap(), _idToUID = {}, getId = (id) => _idToUID[id], getThemeManager = (id) => _uidToManager.get(getId(id)), registerThemeManager = (t) => {
|
|
2012
|
+
if (!_idToUID[t.id]) {
|
|
2013
|
+
let id = _idToUID[t.id] = {};
|
|
2014
|
+
_uidToManager.set(id, t);
|
|
2015
|
+
}
|
|
2016
|
+
}, useChangeThemeEffect = (props, isRoot = !1, keys, shouldUpdate) => {
|
|
2017
|
+
let { disable } = props, parentManagerId = (0, import_react2.useContext)(import_ThemeManagerContext.ThemeManagerIDContext), parentManager = getThemeManager(parentManagerId);
|
|
2018
|
+
if (!isRoot && !parentManager || disable)
|
|
2019
|
+
return {
|
|
2020
|
+
isNewTheme: !1,
|
|
2021
|
+
state: parentManager == null ? void 0 : parentManager.state,
|
|
2022
|
+
themeManager: parentManager
|
|
2023
|
+
};
|
|
2024
|
+
let [themeState, setThemeState] = (0, import_react2.useState)(createState), { state, mounted, isNewTheme, themeManager, inversed } = themeState, isInversingOnMount = !!(!themeState.mounted && props.inverse);
|
|
2025
|
+
function getShouldUpdateTheme(manager = themeManager, nextState, prevState = state, forceShouldChange = !1) {
|
|
2026
|
+
let forceUpdate = shouldUpdate == null ? void 0 : shouldUpdate();
|
|
2027
|
+
if (!manager || !forceShouldChange && forceUpdate === !1)
|
|
2028
|
+
return;
|
|
2029
|
+
let next = nextState || manager.getState(props, parentManager);
|
|
2030
|
+
if (forceShouldChange || next && !(forceUpdate !== !0 && !manager.getStateShouldChange(next, prevState)))
|
|
2031
|
+
return next;
|
|
2032
|
+
}
|
|
2033
|
+
if (import_constants4.isServer || (0, import_react2.useEffect)(() => {
|
|
2034
|
+
if (!themeManager)
|
|
2035
|
+
return;
|
|
2036
|
+
if (props.inverse && !mounted) {
|
|
2037
|
+
setThemeState((prev) => createState({
|
|
2038
|
+
...prev,
|
|
2039
|
+
mounted: !0
|
|
2040
|
+
}));
|
|
2041
|
+
return;
|
|
2042
|
+
}
|
|
2043
|
+
(isNewTheme || getShouldUpdateTheme(themeManager)) && (activeThemeManagers.add(themeManager), setThemeState(createState));
|
|
2044
|
+
let selfListenerDispose = themeManager.onChangeTheme((_a, _b, forced) => {
|
|
2045
|
+
forced && setThemeState((prev) => createState(prev, !0));
|
|
2046
|
+
}), disposeChangeListener = parentManager == null ? void 0 : parentManager.onChangeTheme(
|
|
2047
|
+
(name, manager, forced) => {
|
|
2048
|
+
let force = forced || (shouldUpdate == null ? void 0 : shouldUpdate()) || props.deopt || props["disable-child-theme"];
|
|
2049
|
+
(force ?? !!(keys != null && keys.length || isNewTheme)) && setThemeState((prev) => createState(prev, force));
|
|
2050
|
+
},
|
|
2051
|
+
themeManager.id
|
|
2052
|
+
);
|
|
2053
|
+
return () => {
|
|
2054
|
+
selfListenerDispose(), disposeChangeListener == null || disposeChangeListener(), isNewTheme && activeThemeManagers.delete(themeManager);
|
|
2055
|
+
};
|
|
2056
|
+
}, [
|
|
2057
|
+
themeManager,
|
|
2058
|
+
parentManager,
|
|
2059
|
+
isNewTheme,
|
|
2060
|
+
props.componentName,
|
|
2061
|
+
props.inverse,
|
|
2062
|
+
props.name,
|
|
2063
|
+
props.reset,
|
|
2064
|
+
mounted
|
|
2065
|
+
]), isInversingOnMount)
|
|
2066
|
+
return {
|
|
2067
|
+
isNewTheme: !1,
|
|
2068
|
+
inversed: !1,
|
|
2069
|
+
themeManager: parentManager,
|
|
2070
|
+
state: {
|
|
2071
|
+
name: "",
|
|
2072
|
+
...parentManager == null ? void 0 : parentManager.state,
|
|
2073
|
+
className: ""
|
|
2074
|
+
}
|
|
2075
|
+
};
|
|
2076
|
+
return {
|
|
2077
|
+
state,
|
|
2078
|
+
isNewTheme,
|
|
2079
|
+
inversed,
|
|
2080
|
+
themeManager
|
|
2081
|
+
};
|
|
2082
|
+
function createState(prev, force = !1) {
|
|
2083
|
+
if (prev && (shouldUpdate == null ? void 0 : shouldUpdate()) === !1 && !force)
|
|
2084
|
+
return prev;
|
|
2085
|
+
let themeManager2 = parentManager, state2;
|
|
2086
|
+
if ((0, import_ThemeManager.getHasThemeUpdatingProps)(props)) {
|
|
2087
|
+
let getNewThemeManager = () => new import_ThemeManager.ThemeManager(props, isRoot ? "root" : parentManager);
|
|
2088
|
+
if (prev != null && prev.themeManager) {
|
|
2089
|
+
themeManager2 = prev.themeManager;
|
|
2090
|
+
let forceChange = force || !!(keys != null && keys.length), next = themeManager2.getState(props, parentManager), nextState = getShouldUpdateTheme(
|
|
2091
|
+
themeManager2,
|
|
2092
|
+
next,
|
|
2093
|
+
prev.state,
|
|
2094
|
+
forceChange
|
|
2095
|
+
);
|
|
2096
|
+
nextState ? (state2 = nextState, prev.isNewTheme ? themeManager2.updateState(nextState) : themeManager2 = getNewThemeManager()) : prev.isNewTheme && parentManager && !next && (themeManager2 = parentManager);
|
|
2097
|
+
} else
|
|
2098
|
+
themeManager2 = getNewThemeManager(), state2 = { ...themeManager2.state };
|
|
2099
|
+
}
|
|
2100
|
+
let isNewTheme2 = !!(themeManager2 !== parentManager || props.inverse);
|
|
2101
|
+
isNewTheme2 && registerThemeManager(themeManager2);
|
|
2102
|
+
let mounted2 = props.inverse ? isRoot || (prev == null ? void 0 : prev.mounted) : !0;
|
|
2103
|
+
state2 || (isNewTheme2 ? state2 = themeManager2.state : (state2 = parentManager.state, themeManager2 = parentManager));
|
|
2104
|
+
let wasInversed = prev == null ? void 0 : prev.inversed, inversed2 = isNewTheme2 && state2.scheme !== (parentManager == null ? void 0 : parentManager.state.scheme) ? !0 : wasInversed != null ? !1 : null, response = {
|
|
2105
|
+
themeManager: themeManager2,
|
|
2106
|
+
isNewTheme: isNewTheme2,
|
|
2107
|
+
mounted: mounted2,
|
|
2108
|
+
inversed: inversed2
|
|
2109
|
+
}, shouldReturnPrev = prev && !force && // isEqualShallow uses the second arg as the keys so this should compare without state first...
|
|
2110
|
+
(0, import_createShallowSetState.isEqualShallow)(prev, response) && // ... and then compare just the state, because we make a new state obj but is likely the same
|
|
2111
|
+
(0, import_createShallowSetState.isEqualShallow)(prev.state, state2);
|
|
2112
|
+
return prev && shouldReturnPrev ? prev : (response.state = state2, response);
|
|
2113
|
+
}
|
|
2114
|
+
};
|
|
2115
|
+
}
|
|
2116
|
+
});
|
|
2117
|
+
|
|
2118
|
+
// ../web/dist/cjs/Tamagui.native.js
|
|
2119
|
+
var require_Tamagui_native = __commonJS({
|
|
2120
|
+
"../web/dist/cjs/Tamagui.native.js"(exports2, module2) {
|
|
2121
|
+
"use strict";
|
|
2122
|
+
var __create2 = Object.create, __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __getProtoOf2 = Object.getPrototypeOf, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
2123
|
+
for (var name in all)
|
|
2124
|
+
__defProp2(target, name, { get: all[name], enumerable: !0 });
|
|
2125
|
+
}, __copyProps2 = (to, from, except, desc) => {
|
|
2126
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
2127
|
+
for (let key of __getOwnPropNames2(from))
|
|
2128
|
+
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
2129
|
+
return to;
|
|
2130
|
+
}, __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps2(
|
|
2131
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
2132
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
2133
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
2134
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
2135
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", { value: mod, enumerable: !0 }) : target,
|
|
2136
|
+
mod
|
|
2137
|
+
)), __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), Tamagui_exports = {};
|
|
2138
|
+
__export2(Tamagui_exports, {
|
|
2139
|
+
Tamagui: () => Tamagui,
|
|
2140
|
+
getValueFromIdentifier: () => getValueFromIdentifier,
|
|
2141
|
+
setIdentifierValue: () => setIdentifierValue
|
|
2142
|
+
});
|
|
2143
|
+
module2.exports = __toCommonJS2(Tamagui_exports);
|
|
2144
|
+
var Helpers = __toESM2(require_index_native7()), import_config = require_config_native(), import_insertStyleRule = require_insertStyleRule_native(), import_useMedia = require_useMedia_native(), import_useTheme = require_useTheme_native(), Tamagui = void 0, identifierToValue = /* @__PURE__ */ new Map(), getValueFromIdentifier = (identifier) => identifierToValue.get(identifier), setIdentifierValue = (identifier, value) => {
|
|
2145
|
+
identifierToValue.set(identifier, value);
|
|
2146
|
+
};
|
|
2147
|
+
}
|
|
2148
|
+
});
|
|
2149
|
+
|
|
2150
|
+
// ../compose-refs/dist/cjs/compose-refs.native.js
|
|
2151
|
+
var require_compose_refs_native = __commonJS({
|
|
2152
|
+
"../compose-refs/dist/cjs/compose-refs.native.js"(exports2, module2) {
|
|
2153
|
+
"use strict";
|
|
2154
|
+
var __create2 = Object.create, __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __getProtoOf2 = Object.getPrototypeOf, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
2155
|
+
for (var name in all)
|
|
2156
|
+
__defProp2(target, name, { get: all[name], enumerable: !0 });
|
|
2157
|
+
}, __copyProps2 = (to, from, except, desc) => {
|
|
2158
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
2159
|
+
for (let key of __getOwnPropNames2(from))
|
|
2160
|
+
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
2161
|
+
return to;
|
|
2162
|
+
}, __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps2(
|
|
2163
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
2164
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
2165
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
2166
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
2167
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", { value: mod, enumerable: !0 }) : target,
|
|
2168
|
+
mod
|
|
2169
|
+
)), __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), compose_refs_exports = {};
|
|
2170
|
+
__export2(compose_refs_exports, {
|
|
2171
|
+
composeRefs: () => composeRefs,
|
|
2172
|
+
useComposedRefs: () => useComposedRefs
|
|
2173
|
+
});
|
|
2174
|
+
module2.exports = __toCommonJS2(compose_refs_exports);
|
|
2175
|
+
var React2 = __toESM2(require("react"));
|
|
2176
|
+
function setRef(ref, value) {
|
|
2177
|
+
typeof ref == "function" ? ref(value) : ref && (ref.current = value);
|
|
2178
|
+
}
|
|
2179
|
+
function composeRefs(...refs) {
|
|
2180
|
+
return (node) => refs.forEach((ref) => setRef(ref, node));
|
|
2181
|
+
}
|
|
2182
|
+
function useComposedRefs(...refs) {
|
|
2183
|
+
return React2.useCallback(composeRefs(...refs), refs);
|
|
2184
|
+
}
|
|
2185
|
+
}
|
|
2186
|
+
});
|
|
2187
|
+
|
|
2188
|
+
// ../compose-refs/dist/cjs/index.native.js
|
|
2189
|
+
var require_index_native10 = __commonJS({
|
|
2190
|
+
"../compose-refs/dist/cjs/index.native.js"(exports2, module2) {
|
|
2191
|
+
"use strict";
|
|
2192
|
+
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __copyProps2 = (to, from, except, desc) => {
|
|
2193
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
2194
|
+
for (let key of __getOwnPropNames2(from))
|
|
2195
|
+
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
2196
|
+
return to;
|
|
2197
|
+
}, __reExport2 = (target, mod, secondTarget) => (__copyProps2(target, mod, "default"), secondTarget && __copyProps2(secondTarget, mod, "default")), __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), src_exports2 = {};
|
|
2198
|
+
module2.exports = __toCommonJS2(src_exports2);
|
|
2199
|
+
__reExport2(src_exports2, require_compose_refs_native(), module2.exports);
|
|
2200
|
+
}
|
|
2201
|
+
});
|
|
2202
|
+
|
|
2203
|
+
// ../web/dist/cjs/helpers/objectIdentityKey.native.js
|
|
2204
|
+
var require_objectIdentityKey_native = __commonJS({
|
|
2205
|
+
"../web/dist/cjs/helpers/objectIdentityKey.native.js"(exports2, module2) {
|
|
2206
|
+
"use strict";
|
|
2207
|
+
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
2208
|
+
for (var name in all)
|
|
2209
|
+
__defProp2(target, name, { get: all[name], enumerable: !0 });
|
|
2210
|
+
}, __copyProps2 = (to, from, except, desc) => {
|
|
2211
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
2212
|
+
for (let key of __getOwnPropNames2(from))
|
|
2213
|
+
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
2214
|
+
return to;
|
|
2215
|
+
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), objectIdentityKey_exports = {};
|
|
2216
|
+
__export2(objectIdentityKey_exports, {
|
|
2217
|
+
objectIdentityKey: () => objectIdentityKey
|
|
2218
|
+
});
|
|
2219
|
+
module2.exports = __toCommonJS2(objectIdentityKey_exports);
|
|
2220
|
+
function objectIdentityKey(obj) {
|
|
2221
|
+
let k = "";
|
|
2222
|
+
for (let key in obj) {
|
|
2223
|
+
k += key;
|
|
2224
|
+
let arg = obj[key], type = typeof arg;
|
|
2225
|
+
if (!arg || type !== "object" && type !== "function")
|
|
2226
|
+
k += type + arg;
|
|
2227
|
+
else if (cache.has(arg))
|
|
2228
|
+
k += cache.get(arg);
|
|
2229
|
+
else {
|
|
2230
|
+
let v = Math.random();
|
|
2231
|
+
cache.set(arg, v), k += v;
|
|
2232
|
+
}
|
|
2233
|
+
}
|
|
2234
|
+
return k;
|
|
2235
|
+
}
|
|
2236
|
+
var cache = /* @__PURE__ */ new WeakMap();
|
|
2237
|
+
}
|
|
2238
|
+
});
|
|
2239
|
+
|
|
2240
|
+
// ../web/dist/cjs/helpers/createStyledContext.native.js
|
|
2241
|
+
var require_createStyledContext_native = __commonJS({
|
|
2242
|
+
"../web/dist/cjs/helpers/createStyledContext.native.js"(exports2, module2) {
|
|
2243
|
+
"use strict";
|
|
2244
|
+
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
2245
|
+
for (var name in all)
|
|
2246
|
+
__defProp2(target, name, { get: all[name], enumerable: !0 });
|
|
2247
|
+
}, __copyProps2 = (to, from, except, desc) => {
|
|
2248
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
2249
|
+
for (let key of __getOwnPropNames2(from))
|
|
2250
|
+
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
2251
|
+
return to;
|
|
2252
|
+
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), createStyledContext_exports = {};
|
|
2253
|
+
__export2(createStyledContext_exports, {
|
|
2254
|
+
createStyledContext: () => createStyledContext2
|
|
2255
|
+
});
|
|
2256
|
+
module2.exports = __toCommonJS2(createStyledContext_exports);
|
|
2257
|
+
var import_react2 = require("react"), import_objectIdentityKey = require_objectIdentityKey_native(), import_jsx_runtime6 = require("react/jsx-runtime");
|
|
2258
|
+
function createStyledContext2(defaultValues) {
|
|
2259
|
+
let OGContext = (0, import_react2.createContext)(defaultValues), OGProvider2 = OGContext.Provider, Context = OGContext, scopedContexts = /* @__PURE__ */ new Map(), Provider = ({
|
|
2260
|
+
children,
|
|
2261
|
+
scope,
|
|
2262
|
+
...values
|
|
2263
|
+
}) => {
|
|
2264
|
+
let next = (0, import_react2.useMemo)(() => ({
|
|
2265
|
+
// this ! is a workaround for ts error
|
|
2266
|
+
...defaultValues,
|
|
2267
|
+
...values
|
|
2268
|
+
}), [(0, import_objectIdentityKey.objectIdentityKey)(values)]), Provider2 = OGProvider2;
|
|
2269
|
+
if (scope) {
|
|
2270
|
+
let ScopedContext = scopedContexts.get(scope);
|
|
2271
|
+
ScopedContext || (ScopedContext = (0, import_react2.createContext)(defaultValues), scopedContexts.set(scope, ScopedContext)), Provider2 = ScopedContext.Provider;
|
|
2272
|
+
}
|
|
2273
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Provider2, { value: next, children });
|
|
2274
|
+
}, useStyledContext = (scope) => {
|
|
2275
|
+
let context = scope ? scopedContexts.get(scope) : OGContext;
|
|
2276
|
+
return (0, import_react2.useContext)(context);
|
|
2277
|
+
};
|
|
2278
|
+
return Context.Provider = Provider, Context.props = defaultValues, Context.context = OGContext, Context.useStyledContext = useStyledContext, Context;
|
|
2279
|
+
}
|
|
2280
|
+
}
|
|
2281
|
+
});
|
|
2282
|
+
|
|
2283
|
+
// ../web/dist/cjs/contexts/ComponentContext.native.js
|
|
2284
|
+
var require_ComponentContext_native = __commonJS({
|
|
2285
|
+
"../web/dist/cjs/contexts/ComponentContext.native.js"(exports2, module2) {
|
|
2286
|
+
"use strict";
|
|
2287
|
+
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
2288
|
+
for (var name in all)
|
|
2289
|
+
__defProp2(target, name, { get: all[name], enumerable: !0 });
|
|
2290
|
+
}, __copyProps2 = (to, from, except, desc) => {
|
|
2291
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
2292
|
+
for (let key of __getOwnPropNames2(from))
|
|
2293
|
+
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
2294
|
+
return to;
|
|
2295
|
+
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), ComponentContext_exports = {};
|
|
2296
|
+
__export2(ComponentContext_exports, {
|
|
2297
|
+
ComponentContext: () => ComponentContext2
|
|
2298
|
+
});
|
|
2299
|
+
module2.exports = __toCommonJS2(ComponentContext_exports);
|
|
2300
|
+
var import_createStyledContext = require_createStyledContext_native(), ComponentContext2 = (0, import_createStyledContext.createStyledContext)({
|
|
2301
|
+
disableSSR: void 0,
|
|
2302
|
+
inText: !1,
|
|
2303
|
+
language: null,
|
|
2304
|
+
animationDriver: null,
|
|
2305
|
+
groups: {
|
|
2306
|
+
emit: null,
|
|
2307
|
+
subscribe: null,
|
|
2308
|
+
state: {}
|
|
2309
|
+
}
|
|
2310
|
+
});
|
|
2311
|
+
}
|
|
2312
|
+
});
|
|
2313
|
+
|
|
2314
|
+
// ../web/dist/cjs/defaultComponentState.native.js
|
|
2315
|
+
var require_defaultComponentState_native = __commonJS({
|
|
2316
|
+
"../web/dist/cjs/defaultComponentState.native.js"(exports2, module2) {
|
|
2317
|
+
"use strict";
|
|
2318
|
+
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
2319
|
+
for (var name in all)
|
|
2320
|
+
__defProp2(target, name, { get: all[name], enumerable: !0 });
|
|
2321
|
+
}, __copyProps2 = (to, from, except, desc) => {
|
|
2322
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
2323
|
+
for (let key of __getOwnPropNames2(from))
|
|
2324
|
+
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
2325
|
+
return to;
|
|
2326
|
+
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), defaultComponentState_exports = {};
|
|
2327
|
+
__export2(defaultComponentState_exports, {
|
|
2328
|
+
defaultComponentState: () => defaultComponentState,
|
|
2329
|
+
defaultComponentStateMounted: () => defaultComponentStateMounted,
|
|
2330
|
+
defaultComponentStateShouldEnter: () => defaultComponentStateShouldEnter
|
|
2331
|
+
});
|
|
2332
|
+
module2.exports = __toCommonJS2(defaultComponentState_exports);
|
|
2333
|
+
var defaultComponentState = {
|
|
2334
|
+
hover: !1,
|
|
2335
|
+
press: !1,
|
|
2336
|
+
pressIn: !1,
|
|
2337
|
+
focus: !1,
|
|
2338
|
+
unmounted: !0
|
|
2339
|
+
}, defaultComponentStateMounted = {
|
|
2340
|
+
...defaultComponentState,
|
|
2341
|
+
unmounted: !1
|
|
2342
|
+
}, defaultComponentStateShouldEnter = {
|
|
2343
|
+
...defaultComponentState,
|
|
2344
|
+
unmounted: "should-enter"
|
|
2345
|
+
};
|
|
1980
2346
|
}
|
|
1981
2347
|
});
|
|
1982
2348
|
|
|
@@ -3650,254 +4016,41 @@ var require_getSplitStyles_native = __commonJS({
|
|
|
3650
4016
|
componentName: 1,
|
|
3651
4017
|
disableOptimization: 1,
|
|
3652
4018
|
tag: 1,
|
|
3653
|
-
style: 1,
|
|
3654
|
-
// handled after loop so pseudos set usedKeys and override it if necessary
|
|
3655
|
-
group: 1
|
|
3656
|
-
};
|
|
3657
|
-
skipProps["data-test-renders"] = 1;
|
|
3658
|
-
Object.assign(skipProps, {
|
|
3659
|
-
whiteSpace: 1,
|
|
3660
|
-
wordWrap: 1,
|
|
3661
|
-
textOverflow: 1,
|
|
3662
|
-
textDecorationDistance: 1,
|
|
3663
|
-
cursor: 1,
|
|
3664
|
-
contain: 1,
|
|
3665
|
-
boxSizing: 1,
|
|
3666
|
-
boxShadow: 1,
|
|
3667
|
-
outlineStyle: 1,
|
|
3668
|
-
outlineOffset: 1,
|
|
3669
|
-
outlineWidth: 1,
|
|
3670
|
-
outlineColor: 1
|
|
3671
|
-
});
|
|
3672
|
-
function passDownProp(viewProps, key, val, shouldMergeObject = !1) {
|
|
3673
|
-
if (shouldMergeObject) {
|
|
3674
|
-
let next = {
|
|
3675
|
-
...viewProps[key],
|
|
3676
|
-
...val
|
|
3677
|
-
};
|
|
3678
|
-
delete viewProps[key], viewProps[key] = next;
|
|
3679
|
-
} else
|
|
3680
|
-
viewProps[key] = val;
|
|
3681
|
-
}
|
|
3682
|
-
}
|
|
3683
|
-
});
|
|
3684
|
-
|
|
3685
|
-
// ../web/dist/cjs/helpers/mergeProps.native.js
|
|
3686
|
-
var require_mergeProps_native = __commonJS({
|
|
3687
|
-
"../web/dist/cjs/helpers/mergeProps.native.js"(exports2, module2) {
|
|
3688
|
-
"use strict";
|
|
3689
|
-
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
3690
|
-
for (var name in all)
|
|
3691
|
-
__defProp2(target, name, { get: all[name], enumerable: !0 });
|
|
3692
|
-
}, __copyProps2 = (to, from, except, desc) => {
|
|
3693
|
-
if (from && typeof from == "object" || typeof from == "function")
|
|
3694
|
-
for (let key of __getOwnPropNames2(from))
|
|
3695
|
-
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
3696
|
-
return to;
|
|
3697
|
-
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), mergeProps_exports = {};
|
|
3698
|
-
__export2(mergeProps_exports, {
|
|
3699
|
-
mergeProps: () => mergeProps
|
|
3700
|
-
});
|
|
3701
|
-
module2.exports = __toCommonJS2(mergeProps_exports);
|
|
3702
|
-
var import_useMedia = require_useMedia_native(), import_pseudoDescriptors = require_pseudoDescriptors_native(), mergeProps = (a, b, inverseShorthands) => {
|
|
3703
|
-
let out = {};
|
|
3704
|
-
for (let key in a)
|
|
3705
|
-
mergeProp(out, a, b, key, inverseShorthands);
|
|
3706
|
-
if (b)
|
|
3707
|
-
for (let key in b)
|
|
3708
|
-
mergeProp(out, b, void 0, key, inverseShorthands);
|
|
3709
|
-
return out;
|
|
3710
|
-
};
|
|
3711
|
-
function mergeProp(out, a, b, key, inverseShorthands) {
|
|
3712
|
-
let longhand = (inverseShorthands == null ? void 0 : inverseShorthands[key]) || null, val = a[key];
|
|
3713
|
-
if (key in import_pseudoDescriptors.pseudoDescriptors || import_useMedia.mediaKeys.has(key)) {
|
|
3714
|
-
out[key] = {
|
|
3715
|
-
...out[key],
|
|
3716
|
-
...val
|
|
3717
|
-
};
|
|
3718
|
-
return;
|
|
3719
|
-
}
|
|
3720
|
-
b && (key in b || longhand && longhand in b) || (out[longhand || key] = val);
|
|
3721
|
-
}
|
|
3722
|
-
}
|
|
3723
|
-
});
|
|
3724
|
-
|
|
3725
|
-
// ../web/dist/cjs/helpers/ThemeManagerContext.native.js
|
|
3726
|
-
var require_ThemeManagerContext_native = __commonJS({
|
|
3727
|
-
"../web/dist/cjs/helpers/ThemeManagerContext.native.js"(exports2, module2) {
|
|
3728
|
-
"use strict";
|
|
3729
|
-
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
3730
|
-
for (var name in all)
|
|
3731
|
-
__defProp2(target, name, { get: all[name], enumerable: !0 });
|
|
3732
|
-
}, __copyProps2 = (to, from, except, desc) => {
|
|
3733
|
-
if (from && typeof from == "object" || typeof from == "function")
|
|
3734
|
-
for (let key of __getOwnPropNames2(from))
|
|
3735
|
-
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
3736
|
-
return to;
|
|
3737
|
-
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), ThemeManagerContext_exports = {};
|
|
3738
|
-
__export2(ThemeManagerContext_exports, {
|
|
3739
|
-
ThemeManagerIDContext: () => ThemeManagerIDContext
|
|
3740
|
-
});
|
|
3741
|
-
module2.exports = __toCommonJS2(ThemeManagerContext_exports);
|
|
3742
|
-
var import_react2 = require("react"), ThemeManagerIDContext = (0, import_react2.createContext)(1);
|
|
3743
|
-
}
|
|
3744
|
-
});
|
|
3745
|
-
|
|
3746
|
-
// ../web/dist/cjs/helpers/ThemeManager.native.js
|
|
3747
|
-
var require_ThemeManager_native = __commonJS({
|
|
3748
|
-
"../web/dist/cjs/helpers/ThemeManager.native.js"(exports2, module2) {
|
|
3749
|
-
"use strict";
|
|
3750
|
-
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
3751
|
-
for (var name in all)
|
|
3752
|
-
__defProp2(target, name, { get: all[name], enumerable: !0 });
|
|
3753
|
-
}, __copyProps2 = (to, from, except, desc) => {
|
|
3754
|
-
if (from && typeof from == "object" || typeof from == "function")
|
|
3755
|
-
for (let key of __getOwnPropNames2(from))
|
|
3756
|
-
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
3757
|
-
return to;
|
|
3758
|
-
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), ThemeManager_exports = {};
|
|
3759
|
-
__export2(ThemeManager_exports, {
|
|
3760
|
-
ThemeManager: () => ThemeManager,
|
|
3761
|
-
getHasThemeUpdatingProps: () => getHasThemeUpdatingProps,
|
|
3762
|
-
getManagers: () => getManagers
|
|
3763
|
-
});
|
|
3764
|
-
module2.exports = __toCommonJS2(ThemeManager_exports);
|
|
3765
|
-
var import_constants4 = require_index_native(), import_config = require_config_native(), import_constants22 = require_constants_native2(), emptyState = { name: "" };
|
|
3766
|
-
function getHasThemeUpdatingProps(props) {
|
|
3767
|
-
return !!(props.name || props.componentName || props.inverse || props.reset);
|
|
3768
|
-
}
|
|
3769
|
-
var uid = 0, ThemeManager = class {
|
|
3770
|
-
constructor(props = {}, parentManager) {
|
|
3771
|
-
if (this.props = props, this.id = 0, this.themeListeners = /* @__PURE__ */ new Set(), this.parentManager = null, this.state = emptyState, this._allKeys = null, uid = (uid + 1) % Number.MAX_VALUE, this.id = uid, parentManager === "root") {
|
|
3772
|
-
this.updateStateFromProps(props, !1);
|
|
3773
|
-
return;
|
|
3774
|
-
}
|
|
3775
|
-
if (!parentManager)
|
|
3776
|
-
throw new Error(
|
|
3777
|
-
"No parent manager given, this is likely due to duplicated Tamagui dependencies. Check your lockfile for mis-matched versions. It could also be from an error somewhere else in your stack causing Tamagui to recieve undefined context, you can try putting some ErrorBoundary components around other areas of your app, or a Suspense boundary."
|
|
3778
|
-
);
|
|
3779
|
-
if (this.parentManager = parentManager, !this.updateStateFromProps(props, !1))
|
|
3780
|
-
return parentManager;
|
|
3781
|
-
}
|
|
3782
|
-
updateStateFromProps(props = this.props || {}, shouldNotify = !0) {
|
|
3783
|
-
if (this.props = props, props.forceTheme)
|
|
3784
|
-
return this.state.theme = props.forceTheme, this.state.name = props.name || "", this.updateState(this.state, !0), this.state;
|
|
3785
|
-
let nextState = this.getStateIfChanged(props);
|
|
3786
|
-
if (nextState)
|
|
3787
|
-
return this.updateState(nextState, shouldNotify), nextState;
|
|
3788
|
-
}
|
|
3789
|
-
updateState(nextState, shouldNotify = !0) {
|
|
3790
|
-
this.state = nextState, this._allKeys = null, this._numChangeEventsSent ??= 0, this._numChangeEventsSent++, shouldNotify && this.notify();
|
|
3791
|
-
}
|
|
3792
|
-
getStateIfChanged(props = this.props, state = this.state, parentManager = this.parentManager) {
|
|
3793
|
-
let _ = this.getState(props, parentManager);
|
|
3794
|
-
if (state && state !== emptyState && !_)
|
|
3795
|
-
return parentManager == null ? void 0 : parentManager.state;
|
|
3796
|
-
if (this.getStateShouldChange(_, state))
|
|
3797
|
-
return _;
|
|
3798
|
-
}
|
|
3799
|
-
getStateShouldChange(nextState, state = this.state) {
|
|
3800
|
-
return !(!(nextState != null && nextState.theme) || nextState.theme === (state == null ? void 0 : state.theme));
|
|
3801
|
-
}
|
|
3802
|
-
getState(props = this.props, parentManager = this.parentManager) {
|
|
3803
|
-
return getState(props, parentManager) || (parentManager == null ? void 0 : parentManager.state) || null;
|
|
3804
|
-
}
|
|
3805
|
-
get allKeys() {
|
|
3806
|
-
var _a;
|
|
3807
|
-
return this._allKeys ||= /* @__PURE__ */ new Set([
|
|
3808
|
-
...((_a = this.parentManager) == null ? void 0 : _a.allKeys) || [],
|
|
3809
|
-
...Object.keys(this.state.theme || {})
|
|
3810
|
-
]), this._allKeys;
|
|
3811
|
-
}
|
|
3812
|
-
notify(forced = !1) {
|
|
3813
|
-
this.themeListeners.forEach((cb) => cb(this.state.name, this, forced));
|
|
3814
|
-
}
|
|
3815
|
-
onChangeTheme(cb, debugId) {
|
|
3816
|
-
return debugId && (this._listeningIds ??= /* @__PURE__ */ new Set(), this._listeningIds.add(debugId)), this.themeListeners.add(cb), () => {
|
|
3817
|
-
this.themeListeners.delete(cb);
|
|
3818
|
-
};
|
|
3819
|
-
}
|
|
3820
|
-
};
|
|
3821
|
-
function getState(props, manager) {
|
|
3822
|
-
var _a;
|
|
3823
|
-
if (props.name && props.reset)
|
|
3824
|
-
throw new Error(
|
|
3825
|
-
"Cannot reset and set a new name at the same time."
|
|
3826
|
-
);
|
|
3827
|
-
if (!getHasThemeUpdatingProps(props))
|
|
3828
|
-
return null;
|
|
3829
|
-
let themes = (0, import_config.getThemes)(), [allManagers, componentManagers] = getManagers(manager), isDirectParentAComponentTheme = !!(manager != null && manager.state.isComponent), startIndex = props.reset && !isDirectParentAComponentTheme ? 1 : 0, baseManager = allManagers[startIndex], parentManager = allManagers[startIndex + 1];
|
|
3830
|
-
if (!baseManager && props.reset)
|
|
3831
|
-
return console.warn("Cannot reset, no parent theme exists"), null;
|
|
3832
|
-
let { componentName } = props, result = null, baseName = (baseManager == null ? void 0 : baseManager.state.name) || "";
|
|
3833
|
-
baseManager != null && baseManager.state.isComponent && (baseName = baseName.replace(/_[A-Z][A-Za-z]+/, ""));
|
|
3834
|
-
let nextName = props.reset ? baseName : props.name || "", allComponentThemes = componentManagers.map((x) => (x == null ? void 0 : x.state.name) || "");
|
|
3835
|
-
isDirectParentAComponentTheme && allComponentThemes.shift();
|
|
3836
|
-
let base = baseName.split(import_constants22.THEME_NAME_SEPARATOR), max2 = base.length, min2 = props.componentName && !nextName ? max2 : 0;
|
|
3837
|
-
for (let i = max2; i >= min2; i--) {
|
|
3838
|
-
let prefix = base.slice(0, i).join(import_constants22.THEME_NAME_SEPARATOR);
|
|
3839
|
-
props.inverse && (prefix = inverseThemeName(prefix));
|
|
3840
|
-
let potentials = [];
|
|
3841
|
-
if (prefix && prefix !== baseName && potentials.push(prefix), nextName && potentials.unshift(prefix ? `${prefix}_${nextName}` : nextName), i === 1) {
|
|
3842
|
-
let lastSegment = potentials.findIndex((x) => !x.includes("_"));
|
|
3843
|
-
lastSegment > 0 && potentials.splice(lastSegment, 0, nextName);
|
|
3844
|
-
}
|
|
3845
|
-
if (componentName && !props.reset) {
|
|
3846
|
-
let baseLen = base.length, componentPotentials = [];
|
|
3847
|
-
if (nextName && baseLen > 1) {
|
|
3848
|
-
let beforeSeparator = base[0];
|
|
3849
|
-
componentPotentials.push(`${beforeSeparator}_${nextName}_${componentName}`);
|
|
3850
|
-
}
|
|
3851
|
-
if (componentPotentials.push(`${prefix}_${componentName}`), nextName) {
|
|
3852
|
-
if (i > baseLen) {
|
|
3853
|
-
let prefixLessOne = base.slice(0, i - 1).join(import_constants22.THEME_NAME_SEPARATOR);
|
|
3854
|
-
if (prefixLessOne) {
|
|
3855
|
-
let lessSpecific = `${prefixLessOne}_${nextName}_${componentName}`;
|
|
3856
|
-
componentPotentials.unshift(lessSpecific);
|
|
3857
|
-
}
|
|
3858
|
-
}
|
|
3859
|
-
let moreSpecific = `${prefix}_${nextName}_${componentName}`;
|
|
3860
|
-
componentPotentials.unshift(moreSpecific);
|
|
3861
|
-
}
|
|
3862
|
-
potentials = [...componentPotentials, ...potentials, ...allComponentThemes];
|
|
3863
|
-
}
|
|
3864
|
-
let found = potentials.find((t) => t in themes);
|
|
3865
|
-
if (typeof props.debug == "string" && console.info(" getState ", {
|
|
3866
|
-
props,
|
|
3867
|
-
found,
|
|
3868
|
-
potentials,
|
|
3869
|
-
baseManager,
|
|
3870
|
-
nextName,
|
|
3871
|
-
baseName,
|
|
3872
|
-
prefix
|
|
3873
|
-
}), found) {
|
|
3874
|
-
let names = found.split("_"), [firstName, ...restNames] = names, lastName = names[names.length - 1], isComponent = lastName[0] === lastName[0].toUpperCase(), scheme = firstName === "light" ? "light" : firstName === "dark" ? "dark" : void 0, pre = import_constants22.THEME_CLASSNAME_PREFIX, className = import_constants4.isWeb ? `${pre}sub_theme ${pre}${!scheme || !restNames.length ? firstName : restNames.join("_")}` : "", parentState = (_a = baseManager || parentManager) == null ? void 0 : _a.state, parentName = parentState == null ? void 0 : parentState.name;
|
|
3875
|
-
result = {
|
|
3876
|
-
name: found,
|
|
3877
|
-
parentName,
|
|
3878
|
-
theme: themes[found],
|
|
3879
|
-
className,
|
|
3880
|
-
isComponent,
|
|
3881
|
-
scheme
|
|
3882
|
-
};
|
|
3883
|
-
break;
|
|
3884
|
-
}
|
|
3885
|
-
}
|
|
3886
|
-
return props.debug === "verbose" && typeof window < "u" && (console.groupCollapsed("ThemeManager.getState()"), console.info({ props, baseName, base, min: min2, max: max2 }), console.warn("result", { result }), console.trace(), console.groupEnd()), result;
|
|
3887
|
-
}
|
|
3888
|
-
var inverseThemeName = (themeName) => themeName.startsWith("light") ? themeName.replace(/^light/, "dark") : themeName.replace(/^dark/, "light");
|
|
3889
|
-
function getManagers(themeManager) {
|
|
3890
|
-
let comp = [], all = [], cur = themeManager;
|
|
3891
|
-
for (; cur; )
|
|
3892
|
-
all.push(cur), cur.state.isComponent && comp.push(cur), cur = cur.parentManager;
|
|
3893
|
-
return [all, comp];
|
|
4019
|
+
style: 1,
|
|
4020
|
+
// handled after loop so pseudos set usedKeys and override it if necessary
|
|
4021
|
+
group: 1
|
|
4022
|
+
};
|
|
4023
|
+
skipProps["data-test-renders"] = 1;
|
|
4024
|
+
Object.assign(skipProps, {
|
|
4025
|
+
whiteSpace: 1,
|
|
4026
|
+
wordWrap: 1,
|
|
4027
|
+
textOverflow: 1,
|
|
4028
|
+
textDecorationDistance: 1,
|
|
4029
|
+
cursor: 1,
|
|
4030
|
+
contain: 1,
|
|
4031
|
+
boxSizing: 1,
|
|
4032
|
+
boxShadow: 1,
|
|
4033
|
+
outlineStyle: 1,
|
|
4034
|
+
outlineOffset: 1,
|
|
4035
|
+
outlineWidth: 1,
|
|
4036
|
+
outlineColor: 1
|
|
4037
|
+
});
|
|
4038
|
+
function passDownProp(viewProps, key, val, shouldMergeObject = !1) {
|
|
4039
|
+
if (shouldMergeObject) {
|
|
4040
|
+
let next = {
|
|
4041
|
+
...viewProps[key],
|
|
4042
|
+
...val
|
|
4043
|
+
};
|
|
4044
|
+
delete viewProps[key], viewProps[key] = next;
|
|
4045
|
+
} else
|
|
4046
|
+
viewProps[key] = val;
|
|
3894
4047
|
}
|
|
3895
4048
|
}
|
|
3896
4049
|
});
|
|
3897
4050
|
|
|
3898
|
-
// ../web/dist/cjs/
|
|
3899
|
-
var
|
|
3900
|
-
"../web/dist/cjs/
|
|
4051
|
+
// ../web/dist/cjs/helpers/mergeProps.native.js
|
|
4052
|
+
var require_mergeProps_native = __commonJS({
|
|
4053
|
+
"../web/dist/cjs/helpers/mergeProps.native.js"(exports2, module2) {
|
|
3901
4054
|
"use strict";
|
|
3902
4055
|
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
3903
4056
|
for (var name in all)
|
|
@@ -3907,209 +4060,31 @@ var require_useTheme_native = __commonJS({
|
|
|
3907
4060
|
for (let key of __getOwnPropNames2(from))
|
|
3908
4061
|
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
3909
4062
|
return to;
|
|
3910
|
-
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod),
|
|
3911
|
-
__export2(
|
|
3912
|
-
|
|
3913
|
-
getThemeManager: () => getThemeManager,
|
|
3914
|
-
getThemeProxied: () => getThemeProxied,
|
|
3915
|
-
useChangeThemeEffect: () => useChangeThemeEffect,
|
|
3916
|
-
useTheme: () => useTheme4,
|
|
3917
|
-
useThemeWithState: () => useThemeWithState
|
|
4063
|
+
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), mergeProps_exports = {};
|
|
4064
|
+
__export2(mergeProps_exports, {
|
|
4065
|
+
mergeProps: () => mergeProps
|
|
3918
4066
|
});
|
|
3919
|
-
module2.exports = __toCommonJS2(
|
|
3920
|
-
var
|
|
3921
|
-
|
|
3922
|
-
|
|
3923
|
-
|
|
3924
|
-
|
|
3925
|
-
|
|
3926
|
-
|
|
3927
|
-
|
|
3928
|
-
let [_, theme] = useThemeWithState(props);
|
|
3929
|
-
return theme || getDefaultThemeProxied();
|
|
3930
|
-
}, useThemeWithState = (props) => {
|
|
3931
|
-
let keys = (0, import_react2.useRef)([]), changedThemeState = useChangeThemeEffect(
|
|
3932
|
-
props,
|
|
3933
|
-
!1,
|
|
3934
|
-
keys.current,
|
|
3935
|
-
import_constants4.isServer ? void 0 : () => {
|
|
3936
|
-
var _a, _b;
|
|
3937
|
-
return ((_a = props.shouldUpdate) == null ? void 0 : _a.call(props)) ?? (keys.current.length > 0 ? !0 : void 0);
|
|
3938
|
-
}
|
|
3939
|
-
), { themeManager, state } = changedThemeState, themeProxied = (0, import_react2.useMemo)(() => !themeManager || !(state != null && state.theme) ? {} : getThemeProxied(state, props.deopt, themeManager, keys.current, props.debug), [state == null ? void 0 : state.theme, themeManager, props.deopt, props.debug]);
|
|
3940
|
-
return [changedThemeState, themeProxied];
|
|
4067
|
+
module2.exports = __toCommonJS2(mergeProps_exports);
|
|
4068
|
+
var import_useMedia = require_useMedia_native(), import_pseudoDescriptors = require_pseudoDescriptors_native(), mergeProps = (a, b, inverseShorthands) => {
|
|
4069
|
+
let out = {};
|
|
4070
|
+
for (let key in a)
|
|
4071
|
+
mergeProp(out, a, b, key, inverseShorthands);
|
|
4072
|
+
if (b)
|
|
4073
|
+
for (let key in b)
|
|
4074
|
+
mergeProp(out, b, void 0, key, inverseShorthands);
|
|
4075
|
+
return out;
|
|
3941
4076
|
};
|
|
3942
|
-
function
|
|
3943
|
-
|
|
3944
|
-
|
|
3945
|
-
|
|
3946
|
-
|
|
3947
|
-
|
|
3948
|
-
}
|
|
3949
|
-
return new Proxy(theme, {
|
|
3950
|
-
has(_, key) {
|
|
3951
|
-
if (Reflect.has(theme, key))
|
|
3952
|
-
return !0;
|
|
3953
|
-
if (typeof key == "string")
|
|
3954
|
-
return key[0] === "$" && (key = key.slice(1)), themeManager == null ? void 0 : themeManager.allKeys.has(key);
|
|
3955
|
-
},
|
|
3956
|
-
get(_, key) {
|
|
3957
|
-
if (
|
|
3958
|
-
// dont ask me, idk why but on hermes you can see that useTheme()[undefined] passes in STRING undefined to proxy
|
|
3959
|
-
// if someone is crazy enough to use "undefined" as a theme key then this not working is on them
|
|
3960
|
-
key !== "undefined" && typeof key == "string"
|
|
3961
|
-
) {
|
|
3962
|
-
let keyString = key[0] === "$" ? key.slice(1) : key, val = theme[keyString];
|
|
3963
|
-
if (val && typeof val == "object")
|
|
3964
|
-
return new Proxy(val, {
|
|
3965
|
-
// when they touch the actual value we only track it
|
|
3966
|
-
// if its a variable (web), its ignored!
|
|
3967
|
-
get(_2, subkey) {
|
|
3968
|
-
if (subkey === "val")
|
|
3969
|
-
track(keyString);
|
|
3970
|
-
else if (subkey === "get")
|
|
3971
|
-
return (platform) => {
|
|
3972
|
-
let outVal = (0, import_createVariable.getVariable)(val);
|
|
3973
|
-
if (platform !== "web" && import_constants4.isIos && !deopt && config.settings.fastSchemeChange && !someParentIsInversed(themeManager) && scheme) {
|
|
3974
|
-
let oppositeThemeName = name.replace(
|
|
3975
|
-
scheme === "dark" ? "dark" : "light",
|
|
3976
|
-
scheme === "dark" ? "light" : "dark"
|
|
3977
|
-
), oppositeTheme = config.themes[oppositeThemeName], oppositeVal = (0, import_createVariable.getVariable)(oppositeTheme == null ? void 0 : oppositeTheme[keyString]);
|
|
3978
|
-
if (oppositeVal)
|
|
3979
|
-
return {
|
|
3980
|
-
dynamic: {
|
|
3981
|
-
dark: scheme === "dark" ? outVal : oppositeVal,
|
|
3982
|
-
light: scheme === "light" ? outVal : oppositeVal
|
|
3983
|
-
}
|
|
3984
|
-
};
|
|
3985
|
-
}
|
|
3986
|
-
return track(keyString), outVal;
|
|
3987
|
-
};
|
|
3988
|
-
return Reflect.get(val, subkey);
|
|
3989
|
-
}
|
|
3990
|
-
});
|
|
3991
|
-
}
|
|
3992
|
-
return Reflect.get(_, key);
|
|
3993
|
-
}
|
|
3994
|
-
});
|
|
3995
|
-
}
|
|
3996
|
-
function someParentIsInversed(manager) {
|
|
3997
|
-
{
|
|
3998
|
-
let cur = manager;
|
|
3999
|
-
for (; cur; ) {
|
|
4000
|
-
if (!cur.parentManager)
|
|
4001
|
-
return !1;
|
|
4002
|
-
if (cur.parentManager.state.scheme !== cur.state.scheme)
|
|
4003
|
-
return !0;
|
|
4004
|
-
cur = cur.parentManager;
|
|
4005
|
-
}
|
|
4006
|
-
}
|
|
4007
|
-
return !1;
|
|
4008
|
-
}
|
|
4009
|
-
var activeThemeManagers = /* @__PURE__ */ new Set(), _uidToManager = /* @__PURE__ */ new WeakMap(), _idToUID = {}, getId = (id) => _idToUID[id], getThemeManager = (id) => _uidToManager.get(getId(id)), registerThemeManager = (t) => {
|
|
4010
|
-
if (!_idToUID[t.id]) {
|
|
4011
|
-
let id = _idToUID[t.id] = {};
|
|
4012
|
-
_uidToManager.set(id, t);
|
|
4013
|
-
}
|
|
4014
|
-
}, useChangeThemeEffect = (props, isRoot = !1, keys, shouldUpdate) => {
|
|
4015
|
-
let { disable } = props, parentManagerId = (0, import_react2.useContext)(import_ThemeManagerContext.ThemeManagerIDContext), parentManager = getThemeManager(parentManagerId);
|
|
4016
|
-
if (!isRoot && !parentManager || disable)
|
|
4017
|
-
return {
|
|
4018
|
-
isNewTheme: !1,
|
|
4019
|
-
state: parentManager == null ? void 0 : parentManager.state,
|
|
4020
|
-
themeManager: parentManager
|
|
4021
|
-
};
|
|
4022
|
-
let [themeState, setThemeState] = (0, import_react2.useState)(createState), { state, mounted, isNewTheme, themeManager, inversed } = themeState, isInversingOnMount = !!(!themeState.mounted && props.inverse);
|
|
4023
|
-
function getShouldUpdateTheme(manager = themeManager, nextState, prevState = state, forceShouldChange = !1) {
|
|
4024
|
-
let forceUpdate = shouldUpdate == null ? void 0 : shouldUpdate();
|
|
4025
|
-
if (!manager || !forceShouldChange && forceUpdate === !1)
|
|
4026
|
-
return;
|
|
4027
|
-
let next = nextState || manager.getState(props, parentManager);
|
|
4028
|
-
if (forceShouldChange || next && !(forceUpdate !== !0 && !manager.getStateShouldChange(next, prevState)))
|
|
4029
|
-
return next;
|
|
4030
|
-
}
|
|
4031
|
-
if (import_constants4.isServer || (0, import_react2.useEffect)(() => {
|
|
4032
|
-
if (!themeManager)
|
|
4033
|
-
return;
|
|
4034
|
-
if (props.inverse && !mounted) {
|
|
4035
|
-
setThemeState((prev) => createState({
|
|
4036
|
-
...prev,
|
|
4037
|
-
mounted: !0
|
|
4038
|
-
}));
|
|
4039
|
-
return;
|
|
4040
|
-
}
|
|
4041
|
-
(isNewTheme || getShouldUpdateTheme(themeManager)) && (activeThemeManagers.add(themeManager), setThemeState(createState));
|
|
4042
|
-
let selfListenerDispose = themeManager.onChangeTheme((_a, _b, forced) => {
|
|
4043
|
-
forced && setThemeState((prev) => createState(prev, !0));
|
|
4044
|
-
}), disposeChangeListener = parentManager == null ? void 0 : parentManager.onChangeTheme(
|
|
4045
|
-
(name, manager, forced) => {
|
|
4046
|
-
let force = forced || (shouldUpdate == null ? void 0 : shouldUpdate()) || props.deopt || props["disable-child-theme"];
|
|
4047
|
-
(force ?? !!(keys != null && keys.length || isNewTheme)) && setThemeState((prev) => createState(prev, force));
|
|
4048
|
-
},
|
|
4049
|
-
themeManager.id
|
|
4050
|
-
);
|
|
4051
|
-
return () => {
|
|
4052
|
-
selfListenerDispose(), disposeChangeListener == null || disposeChangeListener(), isNewTheme && activeThemeManagers.delete(themeManager);
|
|
4053
|
-
};
|
|
4054
|
-
}, [
|
|
4055
|
-
themeManager,
|
|
4056
|
-
parentManager,
|
|
4057
|
-
isNewTheme,
|
|
4058
|
-
props.componentName,
|
|
4059
|
-
props.inverse,
|
|
4060
|
-
props.name,
|
|
4061
|
-
props.reset,
|
|
4062
|
-
mounted
|
|
4063
|
-
]), isInversingOnMount)
|
|
4064
|
-
return {
|
|
4065
|
-
isNewTheme: !1,
|
|
4066
|
-
inversed: !1,
|
|
4067
|
-
themeManager: parentManager,
|
|
4068
|
-
state: {
|
|
4069
|
-
name: "",
|
|
4070
|
-
...parentManager == null ? void 0 : parentManager.state,
|
|
4071
|
-
className: ""
|
|
4072
|
-
}
|
|
4077
|
+
function mergeProp(out, a, b, key, inverseShorthands) {
|
|
4078
|
+
let longhand = (inverseShorthands == null ? void 0 : inverseShorthands[key]) || null, val = a[key];
|
|
4079
|
+
if (key in import_pseudoDescriptors.pseudoDescriptors || import_useMedia.mediaKeys.has(key)) {
|
|
4080
|
+
out[key] = {
|
|
4081
|
+
...out[key],
|
|
4082
|
+
...val
|
|
4073
4083
|
};
|
|
4074
|
-
|
|
4075
|
-
state,
|
|
4076
|
-
isNewTheme,
|
|
4077
|
-
inversed,
|
|
4078
|
-
themeManager
|
|
4079
|
-
};
|
|
4080
|
-
function createState(prev, force = !1) {
|
|
4081
|
-
if (prev && (shouldUpdate == null ? void 0 : shouldUpdate()) === !1 && !force)
|
|
4082
|
-
return prev;
|
|
4083
|
-
let themeManager2 = parentManager, state2;
|
|
4084
|
-
if ((0, import_ThemeManager.getHasThemeUpdatingProps)(props)) {
|
|
4085
|
-
let getNewThemeManager = () => new import_ThemeManager.ThemeManager(props, isRoot ? "root" : parentManager);
|
|
4086
|
-
if (prev != null && prev.themeManager) {
|
|
4087
|
-
themeManager2 = prev.themeManager;
|
|
4088
|
-
let forceChange = force || !!(keys != null && keys.length), next = themeManager2.getState(props, parentManager), nextState = getShouldUpdateTheme(
|
|
4089
|
-
themeManager2,
|
|
4090
|
-
next,
|
|
4091
|
-
prev.state,
|
|
4092
|
-
forceChange
|
|
4093
|
-
);
|
|
4094
|
-
nextState ? (state2 = nextState, prev.isNewTheme ? themeManager2.updateState(nextState) : themeManager2 = getNewThemeManager()) : prev.isNewTheme && parentManager && !next && (themeManager2 = parentManager);
|
|
4095
|
-
} else
|
|
4096
|
-
themeManager2 = getNewThemeManager(), state2 = { ...themeManager2.state };
|
|
4097
|
-
}
|
|
4098
|
-
let isNewTheme2 = !!(themeManager2 !== parentManager || props.inverse);
|
|
4099
|
-
isNewTheme2 && registerThemeManager(themeManager2);
|
|
4100
|
-
let mounted2 = props.inverse ? isRoot || (prev == null ? void 0 : prev.mounted) : !0;
|
|
4101
|
-
state2 || (isNewTheme2 ? state2 = themeManager2.state : (state2 = parentManager.state, themeManager2 = parentManager));
|
|
4102
|
-
let wasInversed = prev == null ? void 0 : prev.inversed, inversed2 = isNewTheme2 && state2.scheme !== (parentManager == null ? void 0 : parentManager.state.scheme) ? !0 : wasInversed != null ? !1 : null, response = {
|
|
4103
|
-
themeManager: themeManager2,
|
|
4104
|
-
isNewTheme: isNewTheme2,
|
|
4105
|
-
mounted: mounted2,
|
|
4106
|
-
inversed: inversed2
|
|
4107
|
-
}, shouldReturnPrev = prev && !force && // isEqualShallow uses the second arg as the keys so this should compare without state first...
|
|
4108
|
-
(0, import_createShallowSetState.isEqualShallow)(prev, response) && // ... and then compare just the state, because we make a new state obj but is likely the same
|
|
4109
|
-
(0, import_createShallowSetState.isEqualShallow)(prev.state, state2);
|
|
4110
|
-
return prev && shouldReturnPrev ? prev : (response.state = state2, response);
|
|
4084
|
+
return;
|
|
4111
4085
|
}
|
|
4112
|
-
|
|
4086
|
+
b && (key in b || longhand && longhand in b) || (out[longhand || key] = val);
|
|
4087
|
+
}
|
|
4113
4088
|
}
|
|
4114
4089
|
});
|
|
4115
4090
|
|
|
@@ -14602,7 +14577,7 @@ var require_Popper_native = __commonJS({
|
|
|
14602
14577
|
usePopperContext: () => usePopperContext
|
|
14603
14578
|
});
|
|
14604
14579
|
module2.exports = __toCommonJS2(Popper_exports);
|
|
14605
|
-
var import_compose_refs = require_index_native10(), import_constants4 = require_index_native(),
|
|
14580
|
+
var import_compose_refs = require_index_native10(), import_constants4 = require_index_native(), import_core13 = require_index_native15(), import_floating = require_index_native53(), import_get_token2 = require_index_native17(), import_stacks3 = require_index_native19(), React2 = __toESM2(require("react")), import_react_native4 = require("react-native"), import_jsx_runtime6 = require("react/jsx-runtime"), PopperContext = (0, import_core13.createStyledContext)({}), { useStyledContext: usePopperContext, Provider: PopperProvider } = PopperContext;
|
|
14606
14581
|
function Popper(props) {
|
|
14607
14582
|
let {
|
|
14608
14583
|
children,
|
|
@@ -14614,7 +14589,7 @@ var require_Popper_native = __commonJS({
|
|
|
14614
14589
|
offset: offset2,
|
|
14615
14590
|
__scopePopper
|
|
14616
14591
|
} = props, [isMounted, setIsMounted] = React2.useState(!1);
|
|
14617
|
-
(0,
|
|
14592
|
+
(0, import_constants4.useIsomorphicLayoutEffect)(() => {
|
|
14618
14593
|
setIsMounted(!0);
|
|
14619
14594
|
}, []);
|
|
14620
14595
|
let [anchorRef, setAnchorRef] = React2.useState(), [arrowEl, setArrow] = React2.useState(null), [arrowSize, setArrowSize] = React2.useState(0), offsetOptions = offset2 ?? arrowSize, floating = (0, import_floating.useFloating)({
|
|
@@ -14634,10 +14609,10 @@ var require_Popper_native = __commonJS({
|
|
|
14634
14609
|
// @ts-expect-error this comes from Tooltip for example
|
|
14635
14610
|
open
|
|
14636
14611
|
} = floating;
|
|
14637
|
-
if ((0,
|
|
14612
|
+
if ((0, import_constants4.useIsomorphicLayoutEffect)(() => {
|
|
14638
14613
|
floating.refs.setReference(anchorRef);
|
|
14639
14614
|
}, [anchorRef]), import_constants4.isWeb)
|
|
14640
|
-
(0,
|
|
14615
|
+
(0, import_constants4.useIsomorphicLayoutEffect)(() => {
|
|
14641
14616
|
if (open && refs.reference.current && refs.floating.current)
|
|
14642
14617
|
return (0, import_floating.autoUpdate)(refs.reference.current, refs.floating.current, floating.update);
|
|
14643
14618
|
}, [open, floating.update, refs.floating, refs.reference]);
|
|
@@ -14652,7 +14627,7 @@ var require_Popper_native = __commonJS({
|
|
|
14652
14627
|
return () => {
|
|
14653
14628
|
showSubscription.remove(), hideSubscription.remove();
|
|
14654
14629
|
};
|
|
14655
|
-
}, []), (0,
|
|
14630
|
+
}, []), (0, import_constants4.useIsomorphicLayoutEffect)(() => {
|
|
14656
14631
|
floating.update();
|
|
14657
14632
|
}, [dimensions, keyboardOpen]);
|
|
14658
14633
|
}
|
|
@@ -14723,7 +14698,7 @@ var require_Popper_native = __commonJS({
|
|
|
14723
14698
|
), [placement, strategy, props]), [hasInitialPosition, setHasInitialPosition] = React2.useState(!0);
|
|
14724
14699
|
if (React2.useEffect(() => {
|
|
14725
14700
|
(x || y) && setHasInitialPosition(!1);
|
|
14726
|
-
}, [x, y]), (0,
|
|
14701
|
+
}, [x, y]), (0, import_constants4.useIsomorphicLayoutEffect)(() => {
|
|
14727
14702
|
isMounted && update();
|
|
14728
14703
|
}, [isMounted]), !isMounted)
|
|
14729
14704
|
return null;
|
|
@@ -14742,7 +14717,7 @@ var require_Popper_native = __commonJS({
|
|
|
14742
14717
|
animateOnly: rest.animateOnly
|
|
14743
14718
|
}
|
|
14744
14719
|
};
|
|
14745
|
-
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
14720
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_core13.Stack, { ...getFloatingProps ? getFloatingProps(frameProps) : frameProps, children: contents });
|
|
14746
14721
|
}), PopperArrowFrame = (0, import_core13.styled)(import_stacks3.YStack, {
|
|
14747
14722
|
name: "PopperArrow",
|
|
14748
14723
|
variants: {
|
|
@@ -14790,7 +14765,7 @@ var require_Popper_native = __commonJS({
|
|
|
14790
14765
|
if (primaryPlacement) {
|
|
14791
14766
|
arrowStyle[isVertical ? "width" : "height"] = size2 * 2;
|
|
14792
14767
|
let oppSide = opposites[primaryPlacement];
|
|
14793
|
-
oppSide && (arrowStyle[oppSide] = -size2, innerArrowStyle[oppSide] = size2 / 2), oppSide === "bottom" && (arrowStyle[oppSide] += 1), (oppSide === "top" || oppSide === "bottom") && (arrowStyle.left = 0), (oppSide === "left" || oppSide === "right") && (arrowStyle.top = 0), (0,
|
|
14768
|
+
oppSide && (arrowStyle[oppSide] = -size2, innerArrowStyle[oppSide] = size2 / 2), oppSide === "bottom" && (arrowStyle[oppSide] += 1), (oppSide === "top" || oppSide === "bottom") && (arrowStyle.left = 0), (oppSide === "left" || oppSide === "right") && (arrowStyle.top = 0), (0, import_constants4.useIsomorphicLayoutEffect)(() => {
|
|
14794
14769
|
var _a2;
|
|
14795
14770
|
(_a2 = context.onArrowSize) == null || _a2.call(context, size2);
|
|
14796
14771
|
}, [size2, context.onArrowSize]);
|