@tamagui/core 1.85.5 → 1.85.7
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 +1685 -1674
- package/dist/native.js.map +3 -3
- package/dist/test.native.js +819 -838
- package/dist/test.native.js.map +3 -3
- package/package.json +6 -6
package/dist/test.native.js
CHANGED
|
@@ -1430,7 +1430,7 @@ var require_insertStyleRule_native = __commonJS({
|
|
|
1430
1430
|
}
|
|
1431
1431
|
return scannedCache.set(sheet2, cacheKey), dedupedThemes;
|
|
1432
1432
|
}
|
|
1433
|
-
var colorVarToVal, rootComputedStyle = null;
|
|
1433
|
+
var colorVarToVal, rootComputedStyle = null, schemes = { dark: !0, light: !0 };
|
|
1434
1434
|
function addThemesFromCSS(cssStyleRule, tokens) {
|
|
1435
1435
|
let selectors = cssStyleRule.selectorText.split(",");
|
|
1436
1436
|
if (!selectors.length)
|
|
@@ -1462,17 +1462,20 @@ var require_insertStyleRule_native = __commonJS({
|
|
|
1462
1462
|
!0
|
|
1463
1463
|
);
|
|
1464
1464
|
}
|
|
1465
|
-
|
|
1466
|
-
names: [
|
|
1465
|
+
return {
|
|
1466
|
+
names: [
|
|
1467
|
+
...new Set(
|
|
1468
|
+
selectors.map((selector) => {
|
|
1469
|
+
let parts = selector.replace(/(.t_|:root)/g, "").trim().split(" "), secondToLast = parts[parts.length - 2] || "", scheme = secondToLast.includes("dark") ? "dark" : secondToLast.includes("light") ? "light" : "", name = (() => {
|
|
1470
|
+
let _ = parts[parts.length - 1];
|
|
1471
|
+
return scheme && _.startsWith(scheme) && (_ = _.slice(scheme.length + 1)), _;
|
|
1472
|
+
})();
|
|
1473
|
+
return scheme === name || schemes[name] ? scheme : `${scheme}${scheme && name ? "_" : ""}${name}`;
|
|
1474
|
+
})
|
|
1475
|
+
)
|
|
1476
|
+
],
|
|
1467
1477
|
theme: values
|
|
1468
1478
|
};
|
|
1469
|
-
for (let selector of selectors) {
|
|
1470
|
-
let di = selector.indexOf("t_dark"), li = selector.indexOf("t_light"), scheme = di && li ? di < li ? "dark" : "light" : "", name = selector.slice(selector.lastIndexOf(".t_") + 3);
|
|
1471
|
-
name.startsWith(scheme) && (name = name.slice(scheme.length + 1)), scheme === name && (scheme = "");
|
|
1472
|
-
let themeName = `${scheme}${scheme && name ? "_" : ""}${name}`;
|
|
1473
|
-
dedupedEntry.names.includes(themeName) || dedupedEntry.names.push(themeName);
|
|
1474
|
-
}
|
|
1475
|
-
return dedupedEntry;
|
|
1476
1479
|
}
|
|
1477
1480
|
function getTamaguiSelector(rule, collectThemes = !1) {
|
|
1478
1481
|
if (rule instanceof CSSStyleRule) {
|
|
@@ -1782,116 +1785,9 @@ var require_useMedia_native = __commonJS({
|
|
|
1782
1785
|
}
|
|
1783
1786
|
});
|
|
1784
1787
|
|
|
1785
|
-
// ../web/dist/cjs/
|
|
1786
|
-
var
|
|
1787
|
-
"../web/dist/cjs/
|
|
1788
|
-
"use strict";
|
|
1789
|
-
var __create2 = Object.create, __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __getProtoOf2 = Object.getPrototypeOf, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
1790
|
-
for (var name in all)
|
|
1791
|
-
__defProp2(target, name, { get: all[name], enumerable: !0 });
|
|
1792
|
-
}, __copyProps2 = (to, from, except, desc) => {
|
|
1793
|
-
if (from && typeof from == "object" || typeof from == "function")
|
|
1794
|
-
for (let key of __getOwnPropNames2(from))
|
|
1795
|
-
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
1796
|
-
return to;
|
|
1797
|
-
}, __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps2(
|
|
1798
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
1799
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
1800
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
1801
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
1802
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", { value: mod, enumerable: !0 }) : target,
|
|
1803
|
-
mod
|
|
1804
|
-
)), __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), Tamagui_exports = {};
|
|
1805
|
-
__export2(Tamagui_exports, {
|
|
1806
|
-
Tamagui: () => Tamagui,
|
|
1807
|
-
getValueFromIdentifier: () => getValueFromIdentifier,
|
|
1808
|
-
setIdentifierValue: () => setIdentifierValue
|
|
1809
|
-
});
|
|
1810
|
-
module2.exports = __toCommonJS2(Tamagui_exports);
|
|
1811
|
-
var Helpers = __toESM2(require_index_native4()), import_config = require_config_native(), import_insertStyleRule = require_insertStyleRule_native(), import_useMedia = require_useMedia_native(), TamaguiManager = class {
|
|
1812
|
-
constructor() {
|
|
1813
|
-
this.Helpers = Helpers;
|
|
1814
|
-
}
|
|
1815
|
-
get mediaState() {
|
|
1816
|
-
return { ...import_useMedia.mediaState };
|
|
1817
|
-
}
|
|
1818
|
-
get config() {
|
|
1819
|
-
return (0, import_config.getConfig)();
|
|
1820
|
-
}
|
|
1821
|
-
get insertedRules() {
|
|
1822
|
-
return (0, import_insertStyleRule.getAllRules)();
|
|
1823
|
-
}
|
|
1824
|
-
get allSelectors() {
|
|
1825
|
-
return (0, import_insertStyleRule.getAllSelectors)();
|
|
1826
|
-
}
|
|
1827
|
-
get allTransforms() {
|
|
1828
|
-
return (0, import_insertStyleRule.getAllTransforms)();
|
|
1829
|
-
}
|
|
1830
|
-
get identifierToValue() {
|
|
1831
|
-
return identifierToValue;
|
|
1832
|
-
}
|
|
1833
|
-
}, Tamagui = new TamaguiManager(), identifierToValue = /* @__PURE__ */ new Map(), getValueFromIdentifier = (identifier) => identifierToValue.get(identifier), setIdentifierValue = (identifier, value) => {
|
|
1834
|
-
identifierToValue.set(identifier, value);
|
|
1835
|
-
};
|
|
1836
|
-
}
|
|
1837
|
-
});
|
|
1838
|
-
|
|
1839
|
-
// ../compose-refs/dist/cjs/compose-refs.native.js
|
|
1840
|
-
var require_compose_refs_native = __commonJS({
|
|
1841
|
-
"../compose-refs/dist/cjs/compose-refs.native.js"(exports2, module2) {
|
|
1842
|
-
"use strict";
|
|
1843
|
-
var __create2 = Object.create, __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __getProtoOf2 = Object.getPrototypeOf, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
1844
|
-
for (var name in all)
|
|
1845
|
-
__defProp2(target, name, { get: all[name], enumerable: !0 });
|
|
1846
|
-
}, __copyProps2 = (to, from, except, desc) => {
|
|
1847
|
-
if (from && typeof from == "object" || typeof from == "function")
|
|
1848
|
-
for (let key of __getOwnPropNames2(from))
|
|
1849
|
-
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
1850
|
-
return to;
|
|
1851
|
-
}, __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps2(
|
|
1852
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
1853
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
1854
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
1855
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
1856
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", { value: mod, enumerable: !0 }) : target,
|
|
1857
|
-
mod
|
|
1858
|
-
)), __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), compose_refs_exports = {};
|
|
1859
|
-
__export2(compose_refs_exports, {
|
|
1860
|
-
composeRefs: () => composeRefs,
|
|
1861
|
-
useComposedRefs: () => useComposedRefs
|
|
1862
|
-
});
|
|
1863
|
-
module2.exports = __toCommonJS2(compose_refs_exports);
|
|
1864
|
-
var React = __toESM2(require("react"));
|
|
1865
|
-
function setRef(ref, value) {
|
|
1866
|
-
typeof ref == "function" ? ref(value) : ref && (ref.current = value);
|
|
1867
|
-
}
|
|
1868
|
-
function composeRefs(...refs) {
|
|
1869
|
-
return (node) => refs.forEach((ref) => setRef(ref, node));
|
|
1870
|
-
}
|
|
1871
|
-
function useComposedRefs(...refs) {
|
|
1872
|
-
return React.useCallback(composeRefs(...refs), refs);
|
|
1873
|
-
}
|
|
1874
|
-
}
|
|
1875
|
-
});
|
|
1876
|
-
|
|
1877
|
-
// ../compose-refs/dist/cjs/index.native.js
|
|
1878
|
-
var require_index_native5 = __commonJS({
|
|
1879
|
-
"../compose-refs/dist/cjs/index.native.js"(exports2, module2) {
|
|
1880
|
-
"use strict";
|
|
1881
|
-
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __copyProps2 = (to, from, except, desc) => {
|
|
1882
|
-
if (from && typeof from == "object" || typeof from == "function")
|
|
1883
|
-
for (let key of __getOwnPropNames2(from))
|
|
1884
|
-
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
1885
|
-
return to;
|
|
1886
|
-
}, __reExport2 = (target, mod, secondTarget) => (__copyProps2(target, mod, "default"), secondTarget && __copyProps2(secondTarget, mod, "default")), __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), src_exports2 = {};
|
|
1887
|
-
module2.exports = __toCommonJS2(src_exports2);
|
|
1888
|
-
__reExport2(src_exports2, require_compose_refs_native(), module2.exports);
|
|
1889
|
-
}
|
|
1890
|
-
});
|
|
1891
|
-
|
|
1892
|
-
// ../use-did-finish-ssr/dist/cjs/index.native.js
|
|
1893
|
-
var require_index_native6 = __commonJS({
|
|
1894
|
-
"../use-did-finish-ssr/dist/cjs/index.native.js"(exports2, module2) {
|
|
1788
|
+
// ../web/dist/cjs/helpers/createShallowSetState.native.js
|
|
1789
|
+
var require_createShallowSetState_native = __commonJS({
|
|
1790
|
+
"../web/dist/cjs/helpers/createShallowSetState.native.js"(exports2, module2) {
|
|
1895
1791
|
"use strict";
|
|
1896
1792
|
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
1897
1793
|
for (var name in all)
|
|
@@ -1901,18 +1797,24 @@ var require_index_native6 = __commonJS({
|
|
|
1901
1797
|
for (let key of __getOwnPropNames2(from))
|
|
1902
1798
|
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
1903
1799
|
return to;
|
|
1904
|
-
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod),
|
|
1905
|
-
__export2(
|
|
1906
|
-
|
|
1907
|
-
|
|
1800
|
+
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), createShallowSetState_exports = {};
|
|
1801
|
+
__export2(createShallowSetState_exports, {
|
|
1802
|
+
createShallowSetState: () => createShallowSetState,
|
|
1803
|
+
isEqualShallow: () => isEqualShallow,
|
|
1804
|
+
mergeIfNotShallowEqual: () => mergeIfNotShallowEqual
|
|
1908
1805
|
});
|
|
1909
|
-
module2.exports = __toCommonJS2(
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
return value ?? !0;
|
|
1806
|
+
module2.exports = __toCommonJS2(createShallowSetState_exports);
|
|
1807
|
+
function createShallowSetState(setter, debug) {
|
|
1808
|
+
return (next) => setter((prev) => mergeIfNotShallowEqual(prev, next, debug));
|
|
1913
1809
|
}
|
|
1914
|
-
function
|
|
1915
|
-
return
|
|
1810
|
+
function mergeIfNotShallowEqual(prev, next, debug) {
|
|
1811
|
+
return isEqualShallow(prev, next) ? prev : { ...prev, ...next };
|
|
1812
|
+
}
|
|
1813
|
+
function isEqualShallow(prev, next) {
|
|
1814
|
+
for (let key in next)
|
|
1815
|
+
if (prev[key] !== next[key])
|
|
1816
|
+
return !1;
|
|
1817
|
+
return !0;
|
|
1916
1818
|
}
|
|
1917
1819
|
}
|
|
1918
1820
|
});
|
|
@@ -1951,9 +1853,9 @@ var require_constants_native2 = __commonJS({
|
|
|
1951
1853
|
}
|
|
1952
1854
|
});
|
|
1953
1855
|
|
|
1954
|
-
// ../web/dist/cjs/helpers/
|
|
1955
|
-
var
|
|
1956
|
-
"../web/dist/cjs/helpers/
|
|
1856
|
+
// ../web/dist/cjs/helpers/ThemeManager.native.js
|
|
1857
|
+
var require_ThemeManager_native = __commonJS({
|
|
1858
|
+
"../web/dist/cjs/helpers/ThemeManager.native.js"(exports2, module2) {
|
|
1957
1859
|
"use strict";
|
|
1958
1860
|
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
1959
1861
|
for (var name in all)
|
|
@@ -1963,177 +1865,149 @@ var require_objectIdentityKey_native = __commonJS({
|
|
|
1963
1865
|
for (let key of __getOwnPropNames2(from))
|
|
1964
1866
|
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
1965
1867
|
return to;
|
|
1966
|
-
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod),
|
|
1967
|
-
__export2(
|
|
1968
|
-
|
|
1868
|
+
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), ThemeManager_exports = {};
|
|
1869
|
+
__export2(ThemeManager_exports, {
|
|
1870
|
+
ThemeManager: () => ThemeManager,
|
|
1871
|
+
getHasThemeUpdatingProps: () => getHasThemeUpdatingProps,
|
|
1872
|
+
getManagers: () => getManagers
|
|
1969
1873
|
});
|
|
1970
|
-
module2.exports = __toCommonJS2(
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
k += key;
|
|
1975
|
-
let arg = obj[key], type = typeof arg;
|
|
1976
|
-
if (!arg || type !== "object" && type !== "function")
|
|
1977
|
-
k += type + arg;
|
|
1978
|
-
else if (cache.has(arg))
|
|
1979
|
-
k += cache.get(arg);
|
|
1980
|
-
else {
|
|
1981
|
-
let v = Math.random();
|
|
1982
|
-
cache.set(arg, v), k += v;
|
|
1983
|
-
}
|
|
1984
|
-
}
|
|
1985
|
-
return k;
|
|
1874
|
+
module2.exports = __toCommonJS2(ThemeManager_exports);
|
|
1875
|
+
var import_constants = require_index_native3(), import_config = require_config_native(), import_constants2 = require_constants_native2(), emptyState = { name: "" };
|
|
1876
|
+
function getHasThemeUpdatingProps(props) {
|
|
1877
|
+
return !!(props.name || props.componentName || props.inverse || props.reset);
|
|
1986
1878
|
}
|
|
1987
|
-
var
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
var require_createStyledContext_native = __commonJS({
|
|
1993
|
-
"../web/dist/cjs/helpers/createStyledContext.native.js"(exports2, module2) {
|
|
1994
|
-
"use strict";
|
|
1995
|
-
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
1996
|
-
for (var name in all)
|
|
1997
|
-
__defProp2(target, name, { get: all[name], enumerable: !0 });
|
|
1998
|
-
}, __copyProps2 = (to, from, except, desc) => {
|
|
1999
|
-
if (from && typeof from == "object" || typeof from == "function")
|
|
2000
|
-
for (let key of __getOwnPropNames2(from))
|
|
2001
|
-
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
2002
|
-
return to;
|
|
2003
|
-
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), createStyledContext_exports = {};
|
|
2004
|
-
__export2(createStyledContext_exports, {
|
|
2005
|
-
createStyledContext: () => createStyledContext
|
|
2006
|
-
});
|
|
2007
|
-
module2.exports = __toCommonJS2(createStyledContext_exports);
|
|
2008
|
-
var import_react3 = require("react"), import_objectIdentityKey = require_objectIdentityKey_native(), import_jsx_runtime = require("react/jsx-runtime");
|
|
2009
|
-
function createStyledContext(defaultValues) {
|
|
2010
|
-
let OGContext = (0, import_react3.createContext)(defaultValues), OGProvider = OGContext.Provider, Context = OGContext, scopedContexts = /* @__PURE__ */ new Map(), Provider = ({
|
|
2011
|
-
children,
|
|
2012
|
-
scope,
|
|
2013
|
-
...values
|
|
2014
|
-
}) => {
|
|
2015
|
-
let next = (0, import_react3.useMemo)(() => ({
|
|
2016
|
-
// this ! is a workaround for ts error
|
|
2017
|
-
...defaultValues,
|
|
2018
|
-
...values
|
|
2019
|
-
}), [(0, import_objectIdentityKey.objectIdentityKey)(values)]), Provider2 = OGProvider;
|
|
2020
|
-
if (scope) {
|
|
2021
|
-
let ScopedContext = scopedContexts.get(scope);
|
|
2022
|
-
ScopedContext || (ScopedContext = (0, import_react3.createContext)(defaultValues), scopedContexts.set(scope, ScopedContext)), Provider2 = ScopedContext.Provider;
|
|
1879
|
+
var uid = 0, ThemeManager = class {
|
|
1880
|
+
constructor(props = {}, parentManager) {
|
|
1881
|
+
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") {
|
|
1882
|
+
this.updateStateFromProps(props, !1);
|
|
1883
|
+
return;
|
|
2023
1884
|
}
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
1885
|
+
if (!parentManager)
|
|
1886
|
+
throw new Error(
|
|
1887
|
+
"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."
|
|
1888
|
+
);
|
|
1889
|
+
if (this.parentManager = parentManager, !this.updateStateFromProps(props, !1))
|
|
1890
|
+
return parentManager;
|
|
1891
|
+
}
|
|
1892
|
+
updateStateFromProps(props = this.props || {}, shouldNotify = !0) {
|
|
1893
|
+
if (this.props = props, props.forceTheme)
|
|
1894
|
+
return this.state.theme = props.forceTheme, this.state.name = props.name || "", this.updateState(this.state, !0), this.state;
|
|
1895
|
+
let nextState = this.getStateIfChanged(props);
|
|
1896
|
+
if (nextState)
|
|
1897
|
+
return this.updateState(nextState, shouldNotify), nextState;
|
|
1898
|
+
}
|
|
1899
|
+
updateState(nextState, shouldNotify = !0) {
|
|
1900
|
+
this.state = nextState, this._allKeys = null, this._numChangeEventsSent ??= 0, this._numChangeEventsSent++, shouldNotify && this.notify();
|
|
1901
|
+
}
|
|
1902
|
+
getStateIfChanged(props = this.props, state = this.state, parentManager = this.parentManager) {
|
|
1903
|
+
let _ = this.getState(props, parentManager);
|
|
1904
|
+
if (state && state !== emptyState && !_)
|
|
1905
|
+
return parentManager == null ? void 0 : parentManager.state;
|
|
1906
|
+
if (this.getStateShouldChange(_, state))
|
|
1907
|
+
return _;
|
|
1908
|
+
}
|
|
1909
|
+
getStateShouldChange(nextState, state = this.state) {
|
|
1910
|
+
return !(!(nextState != null && nextState.theme) || nextState.theme === (state == null ? void 0 : state.theme));
|
|
1911
|
+
}
|
|
1912
|
+
getState(props = this.props, parentManager = this.parentManager) {
|
|
1913
|
+
return getState(props, parentManager) || (parentManager == null ? void 0 : parentManager.state) || null;
|
|
1914
|
+
}
|
|
1915
|
+
get allKeys() {
|
|
1916
|
+
var _a;
|
|
1917
|
+
return this._allKeys ||= /* @__PURE__ */ new Set([
|
|
1918
|
+
...((_a = this.parentManager) == null ? void 0 : _a.allKeys) || [],
|
|
1919
|
+
...Object.keys(this.state.theme || {})
|
|
1920
|
+
]), this._allKeys;
|
|
1921
|
+
}
|
|
1922
|
+
notify(forced = !1) {
|
|
1923
|
+
this.themeListeners.forEach((cb) => cb(this.state.name, this, forced));
|
|
1924
|
+
}
|
|
1925
|
+
onChangeTheme(cb, debugId) {
|
|
1926
|
+
return debugId && (this._listeningIds ??= /* @__PURE__ */ new Set(), this._listeningIds.add(debugId)), this.themeListeners.add(cb), () => {
|
|
1927
|
+
this.themeListeners.delete(cb);
|
|
1928
|
+
};
|
|
2060
1929
|
}
|
|
2061
|
-
});
|
|
2062
|
-
}
|
|
2063
|
-
});
|
|
2064
|
-
|
|
2065
|
-
// ../web/dist/cjs/defaultComponentState.native.js
|
|
2066
|
-
var require_defaultComponentState_native = __commonJS({
|
|
2067
|
-
"../web/dist/cjs/defaultComponentState.native.js"(exports2, module2) {
|
|
2068
|
-
"use strict";
|
|
2069
|
-
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
2070
|
-
for (var name in all)
|
|
2071
|
-
__defProp2(target, name, { get: all[name], enumerable: !0 });
|
|
2072
|
-
}, __copyProps2 = (to, from, except, desc) => {
|
|
2073
|
-
if (from && typeof from == "object" || typeof from == "function")
|
|
2074
|
-
for (let key of __getOwnPropNames2(from))
|
|
2075
|
-
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
2076
|
-
return to;
|
|
2077
|
-
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), defaultComponentState_exports = {};
|
|
2078
|
-
__export2(defaultComponentState_exports, {
|
|
2079
|
-
defaultComponentState: () => defaultComponentState,
|
|
2080
|
-
defaultComponentStateMounted: () => defaultComponentStateMounted,
|
|
2081
|
-
defaultComponentStateShouldEnter: () => defaultComponentStateShouldEnter
|
|
2082
|
-
});
|
|
2083
|
-
module2.exports = __toCommonJS2(defaultComponentState_exports);
|
|
2084
|
-
var defaultComponentState = {
|
|
2085
|
-
hover: !1,
|
|
2086
|
-
press: !1,
|
|
2087
|
-
pressIn: !1,
|
|
2088
|
-
focus: !1,
|
|
2089
|
-
unmounted: !0
|
|
2090
|
-
}, defaultComponentStateMounted = {
|
|
2091
|
-
...defaultComponentState,
|
|
2092
|
-
unmounted: !1
|
|
2093
|
-
}, defaultComponentStateShouldEnter = {
|
|
2094
|
-
...defaultComponentState,
|
|
2095
|
-
unmounted: "should-enter"
|
|
2096
1930
|
};
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
|
|
1931
|
+
function getState(props, manager) {
|
|
1932
|
+
var _a;
|
|
1933
|
+
if (props.name && props.reset)
|
|
1934
|
+
throw new Error(
|
|
1935
|
+
"Cannot reset and set a new name at the same time."
|
|
1936
|
+
);
|
|
1937
|
+
if (!getHasThemeUpdatingProps(props))
|
|
1938
|
+
return null;
|
|
1939
|
+
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];
|
|
1940
|
+
if (!baseManager && props.reset)
|
|
1941
|
+
return console.warn("Cannot reset, no parent theme exists"), null;
|
|
1942
|
+
let { componentName } = props, result = null, baseName = (baseManager == null ? void 0 : baseManager.state.name) || "";
|
|
1943
|
+
baseManager != null && baseManager.state.isComponent && (baseName = baseName.replace(/_[A-Z][A-Za-z]+/, ""));
|
|
1944
|
+
let nextName = props.reset ? baseName : props.name || "", allComponentThemes = componentManagers.map((x) => (x == null ? void 0 : x.state.name) || "");
|
|
1945
|
+
isDirectParentAComponentTheme && allComponentThemes.shift();
|
|
1946
|
+
let base = baseName.split(import_constants2.THEME_NAME_SEPARATOR), max = base.length, min = props.componentName && !nextName ? max : 0;
|
|
1947
|
+
for (let i = max; i >= min; i--) {
|
|
1948
|
+
let prefix = base.slice(0, i).join(import_constants2.THEME_NAME_SEPARATOR);
|
|
1949
|
+
props.inverse && (prefix = inverseThemeName(prefix));
|
|
1950
|
+
let potentials = [];
|
|
1951
|
+
if (prefix && prefix !== baseName && potentials.push(prefix), nextName && potentials.unshift(prefix ? `${prefix}_${nextName}` : nextName), i === 1) {
|
|
1952
|
+
let lastSegment = potentials.findIndex((x) => !x.includes("_"));
|
|
1953
|
+
lastSegment > 0 && potentials.splice(lastSegment, 0, nextName);
|
|
1954
|
+
}
|
|
1955
|
+
if (componentName && !props.reset) {
|
|
1956
|
+
let baseLen = base.length, componentPotentials = [];
|
|
1957
|
+
if (nextName && baseLen > 1) {
|
|
1958
|
+
let beforeSeparator = base[0];
|
|
1959
|
+
componentPotentials.push(`${beforeSeparator}_${nextName}_${componentName}`);
|
|
1960
|
+
}
|
|
1961
|
+
if (componentPotentials.push(`${prefix}_${componentName}`), nextName) {
|
|
1962
|
+
if (i > baseLen) {
|
|
1963
|
+
let prefixLessOne = base.slice(0, i - 1).join(import_constants2.THEME_NAME_SEPARATOR);
|
|
1964
|
+
if (prefixLessOne) {
|
|
1965
|
+
let lessSpecific = `${prefixLessOne}_${nextName}_${componentName}`;
|
|
1966
|
+
componentPotentials.unshift(lessSpecific);
|
|
1967
|
+
}
|
|
1968
|
+
}
|
|
1969
|
+
let moreSpecific = `${prefix}_${nextName}_${componentName}`;
|
|
1970
|
+
componentPotentials.unshift(moreSpecific);
|
|
1971
|
+
}
|
|
1972
|
+
potentials = [...componentPotentials, ...potentials, ...allComponentThemes];
|
|
1973
|
+
}
|
|
1974
|
+
let found = potentials.find((t) => t in themes);
|
|
1975
|
+
if (typeof props.debug == "string" && console.info(" getState ", {
|
|
1976
|
+
props,
|
|
1977
|
+
found,
|
|
1978
|
+
potentials,
|
|
1979
|
+
baseManager,
|
|
1980
|
+
nextName,
|
|
1981
|
+
baseName,
|
|
1982
|
+
prefix
|
|
1983
|
+
}), found) {
|
|
1984
|
+
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_constants2.THEME_CLASSNAME_PREFIX, className = import_constants.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;
|
|
1985
|
+
result = {
|
|
1986
|
+
name: found,
|
|
1987
|
+
parentName,
|
|
1988
|
+
theme: themes[found],
|
|
1989
|
+
className,
|
|
1990
|
+
isComponent,
|
|
1991
|
+
scheme
|
|
1992
|
+
};
|
|
1993
|
+
break;
|
|
1994
|
+
}
|
|
1995
|
+
}
|
|
1996
|
+
return props.debug === "verbose" && typeof window < "u" && (console.groupCollapsed("ThemeManager.getState()"), console.info({ props, baseName, base, min, max }), console.warn("result", { result }), console.trace(), console.groupEnd()), result;
|
|
2124
1997
|
}
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
1998
|
+
var inverseThemeName = (themeName) => themeName.startsWith("light") ? themeName.replace(/^light/, "dark") : themeName.replace(/^dark/, "light");
|
|
1999
|
+
function getManagers(themeManager) {
|
|
2000
|
+
let comp = [], all = [], cur = themeManager;
|
|
2001
|
+
for (; cur; )
|
|
2002
|
+
all.push(cur), cur.state.isComponent && comp.push(cur), cur = cur.parentManager;
|
|
2003
|
+
return [all, comp];
|
|
2130
2004
|
}
|
|
2131
2005
|
}
|
|
2132
2006
|
});
|
|
2133
2007
|
|
|
2134
|
-
// ../web/dist/cjs/
|
|
2135
|
-
var
|
|
2136
|
-
"../web/dist/cjs/
|
|
2008
|
+
// ../web/dist/cjs/helpers/ThemeManagerContext.native.js
|
|
2009
|
+
var require_ThemeManagerContext_native = __commonJS({
|
|
2010
|
+
"../web/dist/cjs/helpers/ThemeManagerContext.native.js"(exports2, module2) {
|
|
2137
2011
|
"use strict";
|
|
2138
2012
|
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
2139
2013
|
for (var name in all)
|
|
@@ -2143,72 +2017,18 @@ var require_accessibilityDirectMap_native = __commonJS({
|
|
|
2143
2017
|
for (let key of __getOwnPropNames2(from))
|
|
2144
2018
|
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
2145
2019
|
return to;
|
|
2146
|
-
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod),
|
|
2147
|
-
__export2(
|
|
2148
|
-
|
|
2149
|
-
accessibilityWebRoleToNativeRole: () => accessibilityWebRoleToNativeRole,
|
|
2150
|
-
nativeAccessibilityState: () => nativeAccessibilityState,
|
|
2151
|
-
nativeAccessibilityValue: () => nativeAccessibilityValue,
|
|
2152
|
-
webToNativeAccessibilityDirectMap: () => webToNativeAccessibilityDirectMap
|
|
2020
|
+
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), ThemeManagerContext_exports = {};
|
|
2021
|
+
__export2(ThemeManagerContext_exports, {
|
|
2022
|
+
ThemeManagerIDContext: () => ThemeManagerIDContext
|
|
2153
2023
|
});
|
|
2154
|
-
module2.exports = __toCommonJS2(
|
|
2155
|
-
var
|
|
2156
|
-
"aria-label": "accessibilityLabel",
|
|
2157
|
-
"aria-labelledby": "accessibilityLabelledBy",
|
|
2158
|
-
"aria-live": "accessibilityLiveRegion",
|
|
2159
|
-
"aria-modal": "accessibilityViewIsModal",
|
|
2160
|
-
"aria-hidden": "accessibilityElementsHidden"
|
|
2161
|
-
}, nativeAccessibilityValue = {
|
|
2162
|
-
"aria-valuemin": "min",
|
|
2163
|
-
"aria-valuemax": "max",
|
|
2164
|
-
"aria-valuenow": "now",
|
|
2165
|
-
"aria-valuetext": "text"
|
|
2166
|
-
}, nativeAccessibilityState = {
|
|
2167
|
-
"aria-disabled": "disabled",
|
|
2168
|
-
"aria-selected": "selected",
|
|
2169
|
-
"aria-checked": "checked",
|
|
2170
|
-
"aria-busy": "busy",
|
|
2171
|
-
"aria-expanded": "expanded"
|
|
2172
|
-
}, accessibilityWebRoleToNativeRole = {
|
|
2173
|
-
alert: "alert",
|
|
2174
|
-
button: "button",
|
|
2175
|
-
checkbox: "checkbox",
|
|
2176
|
-
combobox: "combobox",
|
|
2177
|
-
grid: "grid",
|
|
2178
|
-
group: "none",
|
|
2179
|
-
heading: "header",
|
|
2180
|
-
imagebutton: "imagebutton",
|
|
2181
|
-
img: "image",
|
|
2182
|
-
keyboardkey: "keyboardkey",
|
|
2183
|
-
link: "link",
|
|
2184
|
-
menu: "menu",
|
|
2185
|
-
menubar: "menubar",
|
|
2186
|
-
menuitem: "menuitem",
|
|
2187
|
-
none: "none",
|
|
2188
|
-
presentation: "none",
|
|
2189
|
-
progressbar: "progressbar",
|
|
2190
|
-
radio: "radio",
|
|
2191
|
-
radiogroup: "radiogroup",
|
|
2192
|
-
region: "summary",
|
|
2193
|
-
scrollbar: "scrollbar",
|
|
2194
|
-
searchbox: "search",
|
|
2195
|
-
slider: "adjustable",
|
|
2196
|
-
spinbutton: "spinbutton",
|
|
2197
|
-
summary: "summary",
|
|
2198
|
-
switch: "switch",
|
|
2199
|
-
tab: "tab",
|
|
2200
|
-
tablist: "tablist",
|
|
2201
|
-
text: "text",
|
|
2202
|
-
timer: "timer",
|
|
2203
|
-
togglebutton: "togglebutton",
|
|
2204
|
-
toolbar: "toolbar"
|
|
2205
|
-
};
|
|
2024
|
+
module2.exports = __toCommonJS2(ThemeManagerContext_exports);
|
|
2025
|
+
var import_react3 = require("react"), ThemeManagerIDContext = (0, import_react3.createContext)(1);
|
|
2206
2026
|
}
|
|
2207
2027
|
});
|
|
2208
2028
|
|
|
2209
|
-
// ../web/dist/cjs/
|
|
2210
|
-
var
|
|
2211
|
-
"../web/dist/cjs/
|
|
2029
|
+
// ../web/dist/cjs/hooks/useTheme.native.js
|
|
2030
|
+
var require_useTheme_native = __commonJS({
|
|
2031
|
+
"../web/dist/cjs/hooks/useTheme.native.js"(exports2, module2) {
|
|
2212
2032
|
"use strict";
|
|
2213
2033
|
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
2214
2034
|
for (var name in all)
|
|
@@ -2218,26 +2038,217 @@ var require_isDevTools_native = __commonJS({
|
|
|
2218
2038
|
for (let key of __getOwnPropNames2(from))
|
|
2219
2039
|
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
2220
2040
|
return to;
|
|
2221
|
-
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod),
|
|
2222
|
-
__export2(
|
|
2223
|
-
|
|
2041
|
+
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), useTheme_exports = {};
|
|
2042
|
+
__export2(useTheme_exports, {
|
|
2043
|
+
activeThemeManagers: () => activeThemeManagers,
|
|
2044
|
+
getThemeManager: () => getThemeManager,
|
|
2045
|
+
getThemeProxied: () => getThemeProxied,
|
|
2046
|
+
useChangeThemeEffect: () => useChangeThemeEffect,
|
|
2047
|
+
useTheme: () => useTheme,
|
|
2048
|
+
useThemeWithState: () => useThemeWithState
|
|
2224
2049
|
});
|
|
2225
|
-
module2.exports = __toCommonJS2(
|
|
2226
|
-
var
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
2050
|
+
module2.exports = __toCommonJS2(useTheme_exports);
|
|
2051
|
+
var import_constants = require_index_native3(), import_react3 = 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;
|
|
2052
|
+
function getDefaultThemeProxied() {
|
|
2053
|
+
if (cached)
|
|
2054
|
+
return cached;
|
|
2055
|
+
let config = (0, import_config.getConfig)(), name = config.themes.light ? "light" : Object.keys(config.themes)[0], defaultTheme = config.themes[name];
|
|
2056
|
+
return cached = getThemeProxied({ theme: defaultTheme, name }), cached;
|
|
2057
|
+
}
|
|
2058
|
+
var useTheme = (props = emptyProps) => {
|
|
2059
|
+
let [_, theme] = useThemeWithState(props);
|
|
2060
|
+
return theme || getDefaultThemeProxied();
|
|
2061
|
+
}, useThemeWithState = (props) => {
|
|
2062
|
+
let keys = (0, import_react3.useRef)([]), changedThemeState = useChangeThemeEffect(
|
|
2063
|
+
props,
|
|
2064
|
+
!1,
|
|
2065
|
+
keys.current,
|
|
2066
|
+
import_constants.isServer ? void 0 : () => {
|
|
2067
|
+
var _a, _b;
|
|
2068
|
+
return ((_a = props.shouldUpdate) == null ? void 0 : _a.call(props)) ?? (keys.current.length > 0 ? !0 : void 0);
|
|
2069
|
+
}
|
|
2070
|
+
), { themeManager, state } = changedThemeState, themeProxied = (0, import_react3.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]);
|
|
2071
|
+
return [changedThemeState, themeProxied];
|
|
2072
|
+
};
|
|
2073
|
+
function getThemeProxied({ theme, name, scheme }, deopt = !1, themeManager, keys, debug) {
|
|
2074
|
+
if (!theme)
|
|
2075
|
+
return {};
|
|
2076
|
+
let config = (0, import_config.getConfig)();
|
|
2077
|
+
function track(key) {
|
|
2078
|
+
keys && !keys.includes(key) && keys.push(key);
|
|
2079
|
+
}
|
|
2080
|
+
return new Proxy(theme, {
|
|
2081
|
+
has(_, key) {
|
|
2082
|
+
if (Reflect.has(theme, key))
|
|
2083
|
+
return !0;
|
|
2084
|
+
if (typeof key == "string")
|
|
2085
|
+
return key[0] === "$" && (key = key.slice(1)), themeManager == null ? void 0 : themeManager.allKeys.has(key);
|
|
2086
|
+
},
|
|
2087
|
+
get(_, key) {
|
|
2088
|
+
if (
|
|
2089
|
+
// dont ask me, idk why but on hermes you can see that useTheme()[undefined] passes in STRING undefined to proxy
|
|
2090
|
+
// if someone is crazy enough to use "undefined" as a theme key then this not working is on them
|
|
2091
|
+
key !== "undefined" && typeof key == "string"
|
|
2092
|
+
) {
|
|
2093
|
+
let keyString = key[0] === "$" ? key.slice(1) : key, val = theme[keyString];
|
|
2094
|
+
if (val && typeof val == "object")
|
|
2095
|
+
return new Proxy(val, {
|
|
2096
|
+
// when they touch the actual value we only track it
|
|
2097
|
+
// if its a variable (web), its ignored!
|
|
2098
|
+
get(_2, subkey) {
|
|
2099
|
+
if (subkey === "val")
|
|
2100
|
+
track(keyString);
|
|
2101
|
+
else if (subkey === "get")
|
|
2102
|
+
return (platform) => {
|
|
2103
|
+
let outVal = (0, import_createVariable.getVariable)(val);
|
|
2104
|
+
if (platform !== "web" && import_constants.isIos && !deopt && config.settings.fastSchemeChange && !someParentIsInversed(themeManager) && scheme) {
|
|
2105
|
+
let oppositeThemeName = name.replace(
|
|
2106
|
+
scheme === "dark" ? "dark" : "light",
|
|
2107
|
+
scheme === "dark" ? "light" : "dark"
|
|
2108
|
+
), oppositeTheme = config.themes[oppositeThemeName], oppositeVal = (0, import_createVariable.getVariable)(oppositeTheme == null ? void 0 : oppositeTheme[keyString]);
|
|
2109
|
+
if (oppositeVal)
|
|
2110
|
+
return {
|
|
2111
|
+
dynamic: {
|
|
2112
|
+
dark: scheme === "dark" ? outVal : oppositeVal,
|
|
2113
|
+
light: scheme === "light" ? outVal : oppositeVal
|
|
2114
|
+
}
|
|
2115
|
+
};
|
|
2116
|
+
}
|
|
2117
|
+
return track(keyString), outVal;
|
|
2118
|
+
};
|
|
2119
|
+
return Reflect.get(val, subkey);
|
|
2120
|
+
}
|
|
2121
|
+
});
|
|
2122
|
+
}
|
|
2123
|
+
return Reflect.get(_, key);
|
|
2124
|
+
}
|
|
2125
|
+
});
|
|
2126
|
+
}
|
|
2127
|
+
function someParentIsInversed(manager) {
|
|
2128
|
+
{
|
|
2129
|
+
let cur = manager;
|
|
2130
|
+
for (; cur; ) {
|
|
2131
|
+
if (!cur.parentManager)
|
|
2132
|
+
return !1;
|
|
2133
|
+
if (cur.parentManager.state.scheme !== cur.state.scheme)
|
|
2134
|
+
return !0;
|
|
2135
|
+
cur = cur.parentManager;
|
|
2230
2136
|
}
|
|
2137
|
+
}
|
|
2231
2138
|
return !1;
|
|
2232
|
-
}
|
|
2139
|
+
}
|
|
2140
|
+
var activeThemeManagers = /* @__PURE__ */ new Set(), _uidToManager = /* @__PURE__ */ new WeakMap(), _idToUID = {}, getId = (id) => _idToUID[id], getThemeManager = (id) => _uidToManager.get(getId(id)), registerThemeManager = (t) => {
|
|
2141
|
+
if (!_idToUID[t.id]) {
|
|
2142
|
+
let id = _idToUID[t.id] = {};
|
|
2143
|
+
_uidToManager.set(id, t);
|
|
2144
|
+
}
|
|
2145
|
+
}, useChangeThemeEffect = (props, isRoot = !1, keys, shouldUpdate) => {
|
|
2146
|
+
let { disable } = props, parentManagerId = (0, import_react3.useContext)(import_ThemeManagerContext.ThemeManagerIDContext), parentManager = getThemeManager(parentManagerId);
|
|
2147
|
+
if (!isRoot && !parentManager || disable)
|
|
2148
|
+
return {
|
|
2149
|
+
isNewTheme: !1,
|
|
2150
|
+
state: parentManager == null ? void 0 : parentManager.state,
|
|
2151
|
+
themeManager: parentManager
|
|
2152
|
+
};
|
|
2153
|
+
let [themeState, setThemeState] = (0, import_react3.useState)(createState), { state, mounted, isNewTheme, themeManager, inversed } = themeState, isInversingOnMount = !!(!themeState.mounted && props.inverse);
|
|
2154
|
+
function getShouldUpdateTheme(manager = themeManager, nextState, prevState = state, forceShouldChange = !1) {
|
|
2155
|
+
let forceUpdate = shouldUpdate == null ? void 0 : shouldUpdate();
|
|
2156
|
+
if (!manager || !forceShouldChange && forceUpdate === !1)
|
|
2157
|
+
return;
|
|
2158
|
+
let next = nextState || manager.getState(props, parentManager);
|
|
2159
|
+
if (forceShouldChange || next && !(forceUpdate !== !0 && !manager.getStateShouldChange(next, prevState)))
|
|
2160
|
+
return next;
|
|
2161
|
+
}
|
|
2162
|
+
if (import_constants.isServer || (0, import_react3.useEffect)(() => {
|
|
2163
|
+
if (!themeManager)
|
|
2164
|
+
return;
|
|
2165
|
+
if (props.inverse && !mounted) {
|
|
2166
|
+
setThemeState((prev) => createState({
|
|
2167
|
+
...prev,
|
|
2168
|
+
mounted: !0
|
|
2169
|
+
}));
|
|
2170
|
+
return;
|
|
2171
|
+
}
|
|
2172
|
+
(isNewTheme || getShouldUpdateTheme(themeManager)) && (activeThemeManagers.add(themeManager), setThemeState(createState));
|
|
2173
|
+
let selfListenerDispose = themeManager.onChangeTheme((_a, _b, forced) => {
|
|
2174
|
+
forced && setThemeState((prev) => createState(prev, !0));
|
|
2175
|
+
}), disposeChangeListener = parentManager == null ? void 0 : parentManager.onChangeTheme(
|
|
2176
|
+
(name, manager, forced) => {
|
|
2177
|
+
let force = forced || (shouldUpdate == null ? void 0 : shouldUpdate()) || props.deopt || props["disable-child-theme"];
|
|
2178
|
+
(force ?? !!(keys != null && keys.length || isNewTheme)) && setThemeState((prev) => createState(prev, force));
|
|
2179
|
+
},
|
|
2180
|
+
themeManager.id
|
|
2181
|
+
);
|
|
2182
|
+
return () => {
|
|
2183
|
+
selfListenerDispose(), disposeChangeListener == null || disposeChangeListener(), isNewTheme && activeThemeManagers.delete(themeManager);
|
|
2184
|
+
};
|
|
2185
|
+
}, [
|
|
2186
|
+
themeManager,
|
|
2187
|
+
parentManager,
|
|
2188
|
+
isNewTheme,
|
|
2189
|
+
props.componentName,
|
|
2190
|
+
props.inverse,
|
|
2191
|
+
props.name,
|
|
2192
|
+
props.reset,
|
|
2193
|
+
mounted
|
|
2194
|
+
]), isInversingOnMount)
|
|
2195
|
+
return {
|
|
2196
|
+
isNewTheme: !1,
|
|
2197
|
+
inversed: !1,
|
|
2198
|
+
themeManager: parentManager,
|
|
2199
|
+
state: {
|
|
2200
|
+
name: "",
|
|
2201
|
+
...parentManager == null ? void 0 : parentManager.state,
|
|
2202
|
+
className: ""
|
|
2203
|
+
}
|
|
2204
|
+
};
|
|
2205
|
+
return {
|
|
2206
|
+
state,
|
|
2207
|
+
isNewTheme,
|
|
2208
|
+
inversed,
|
|
2209
|
+
themeManager
|
|
2210
|
+
};
|
|
2211
|
+
function createState(prev, force = !1) {
|
|
2212
|
+
if (prev && (shouldUpdate == null ? void 0 : shouldUpdate()) === !1 && !force)
|
|
2213
|
+
return prev;
|
|
2214
|
+
let themeManager2 = parentManager, state2;
|
|
2215
|
+
if ((0, import_ThemeManager.getHasThemeUpdatingProps)(props)) {
|
|
2216
|
+
let getNewThemeManager = () => new import_ThemeManager.ThemeManager(props, isRoot ? "root" : parentManager);
|
|
2217
|
+
if (prev != null && prev.themeManager) {
|
|
2218
|
+
themeManager2 = prev.themeManager;
|
|
2219
|
+
let forceChange = force || !!(keys != null && keys.length), next = themeManager2.getState(props, parentManager), nextState = getShouldUpdateTheme(
|
|
2220
|
+
themeManager2,
|
|
2221
|
+
next,
|
|
2222
|
+
prev.state,
|
|
2223
|
+
forceChange
|
|
2224
|
+
);
|
|
2225
|
+
nextState ? (state2 = nextState, prev.isNewTheme ? themeManager2.updateState(nextState) : themeManager2 = getNewThemeManager()) : prev.isNewTheme && parentManager && !next && (themeManager2 = parentManager);
|
|
2226
|
+
} else
|
|
2227
|
+
themeManager2 = getNewThemeManager(), state2 = { ...themeManager2.state };
|
|
2228
|
+
}
|
|
2229
|
+
let isNewTheme2 = !!(themeManager2 !== parentManager || props.inverse);
|
|
2230
|
+
isNewTheme2 && registerThemeManager(themeManager2);
|
|
2231
|
+
let mounted2 = props.inverse ? isRoot || (prev == null ? void 0 : prev.mounted) : !0;
|
|
2232
|
+
state2 || (isNewTheme2 ? state2 = themeManager2.state : (state2 = parentManager.state, themeManager2 = parentManager));
|
|
2233
|
+
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 = {
|
|
2234
|
+
themeManager: themeManager2,
|
|
2235
|
+
isNewTheme: isNewTheme2,
|
|
2236
|
+
mounted: mounted2,
|
|
2237
|
+
inversed: inversed2
|
|
2238
|
+
}, shouldReturnPrev = prev && !force && // isEqualShallow uses the second arg as the keys so this should compare without state first...
|
|
2239
|
+
(0, import_createShallowSetState.isEqualShallow)(prev, response) && // ... and then compare just the state, because we make a new state obj but is likely the same
|
|
2240
|
+
(0, import_createShallowSetState.isEqualShallow)(prev.state, state2);
|
|
2241
|
+
return prev && shouldReturnPrev ? prev : (response.state = state2, response);
|
|
2242
|
+
}
|
|
2243
|
+
};
|
|
2233
2244
|
}
|
|
2234
2245
|
});
|
|
2235
2246
|
|
|
2236
|
-
// ../web/dist/cjs/
|
|
2237
|
-
var
|
|
2238
|
-
"../web/dist/cjs/
|
|
2247
|
+
// ../web/dist/cjs/Tamagui.native.js
|
|
2248
|
+
var require_Tamagui_native = __commonJS({
|
|
2249
|
+
"../web/dist/cjs/Tamagui.native.js"(exports2, module2) {
|
|
2239
2250
|
"use strict";
|
|
2240
|
-
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
2251
|
+
var __create2 = Object.create, __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __getProtoOf2 = Object.getPrototypeOf, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
2241
2252
|
for (var name in all)
|
|
2242
2253
|
__defProp2(target, name, { get: all[name], enumerable: !0 });
|
|
2243
2254
|
}, __copyProps2 = (to, from, except, desc) => {
|
|
@@ -2245,24 +2256,31 @@ var require_getGroupPropParts_native = __commonJS({
|
|
|
2245
2256
|
for (let key of __getOwnPropNames2(from))
|
|
2246
2257
|
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
2247
2258
|
return to;
|
|
2248
|
-
},
|
|
2249
|
-
|
|
2250
|
-
|
|
2259
|
+
}, __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps2(
|
|
2260
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
2261
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
2262
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
2263
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
2264
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", { value: mod, enumerable: !0 }) : target,
|
|
2265
|
+
mod
|
|
2266
|
+
)), __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), Tamagui_exports = {};
|
|
2267
|
+
__export2(Tamagui_exports, {
|
|
2268
|
+
Tamagui: () => Tamagui,
|
|
2269
|
+
getValueFromIdentifier: () => getValueFromIdentifier,
|
|
2270
|
+
setIdentifierValue: () => setIdentifierValue
|
|
2251
2271
|
});
|
|
2252
|
-
module2.exports = __toCommonJS2(
|
|
2253
|
-
var import_useMedia = require_useMedia_native()
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
return media ? pseudo = part4 : pseudo = part3, { name, pseudo, media };
|
|
2257
|
-
}
|
|
2272
|
+
module2.exports = __toCommonJS2(Tamagui_exports);
|
|
2273
|
+
var Helpers = __toESM2(require_index_native4()), 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) => {
|
|
2274
|
+
identifierToValue.set(identifier, value);
|
|
2275
|
+
};
|
|
2258
2276
|
}
|
|
2259
2277
|
});
|
|
2260
2278
|
|
|
2261
|
-
// ../
|
|
2262
|
-
var
|
|
2263
|
-
"../
|
|
2279
|
+
// ../compose-refs/dist/cjs/compose-refs.native.js
|
|
2280
|
+
var require_compose_refs_native = __commonJS({
|
|
2281
|
+
"../compose-refs/dist/cjs/compose-refs.native.js"(exports2, module2) {
|
|
2264
2282
|
"use strict";
|
|
2265
|
-
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
2283
|
+
var __create2 = Object.create, __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __getProtoOf2 = Object.getPrototypeOf, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
2266
2284
|
for (var name in all)
|
|
2267
2285
|
__defProp2(target, name, { get: all[name], enumerable: !0 });
|
|
2268
2286
|
}, __copyProps2 = (to, from, except, desc) => {
|
|
@@ -2270,18 +2288,372 @@ var require_createMediaStyle_native = __commonJS({
|
|
|
2270
2288
|
for (let key of __getOwnPropNames2(from))
|
|
2271
2289
|
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
2272
2290
|
return to;
|
|
2273
|
-
},
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2291
|
+
}, __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps2(
|
|
2292
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
2293
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
2294
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
2295
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
2296
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", { value: mod, enumerable: !0 }) : target,
|
|
2297
|
+
mod
|
|
2298
|
+
)), __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), compose_refs_exports = {};
|
|
2299
|
+
__export2(compose_refs_exports, {
|
|
2300
|
+
composeRefs: () => composeRefs,
|
|
2301
|
+
useComposedRefs: () => useComposedRefs
|
|
2277
2302
|
});
|
|
2278
|
-
module2.exports = __toCommonJS2(
|
|
2279
|
-
var
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
|
|
2303
|
+
module2.exports = __toCommonJS2(compose_refs_exports);
|
|
2304
|
+
var React = __toESM2(require("react"));
|
|
2305
|
+
function setRef(ref, value) {
|
|
2306
|
+
typeof ref == "function" ? ref(value) : ref && (ref.current = value);
|
|
2307
|
+
}
|
|
2308
|
+
function composeRefs(...refs) {
|
|
2309
|
+
return (node) => refs.forEach((ref) => setRef(ref, node));
|
|
2310
|
+
}
|
|
2311
|
+
function useComposedRefs(...refs) {
|
|
2312
|
+
return React.useCallback(composeRefs(...refs), refs);
|
|
2313
|
+
}
|
|
2314
|
+
}
|
|
2315
|
+
});
|
|
2316
|
+
|
|
2317
|
+
// ../compose-refs/dist/cjs/index.native.js
|
|
2318
|
+
var require_index_native5 = __commonJS({
|
|
2319
|
+
"../compose-refs/dist/cjs/index.native.js"(exports2, module2) {
|
|
2320
|
+
"use strict";
|
|
2321
|
+
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __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
|
+
}, __reExport2 = (target, mod, secondTarget) => (__copyProps2(target, mod, "default"), secondTarget && __copyProps2(secondTarget, mod, "default")), __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), src_exports2 = {};
|
|
2327
|
+
module2.exports = __toCommonJS2(src_exports2);
|
|
2328
|
+
__reExport2(src_exports2, require_compose_refs_native(), module2.exports);
|
|
2329
|
+
}
|
|
2330
|
+
});
|
|
2331
|
+
|
|
2332
|
+
// ../use-did-finish-ssr/dist/cjs/index.native.js
|
|
2333
|
+
var require_index_native6 = __commonJS({
|
|
2334
|
+
"../use-did-finish-ssr/dist/cjs/index.native.js"(exports2, module2) {
|
|
2335
|
+
"use strict";
|
|
2336
|
+
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
2337
|
+
for (var name in all)
|
|
2338
|
+
__defProp2(target, name, { get: all[name], enumerable: !0 });
|
|
2339
|
+
}, __copyProps2 = (to, from, except, desc) => {
|
|
2340
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
2341
|
+
for (let key of __getOwnPropNames2(from))
|
|
2342
|
+
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
2343
|
+
return to;
|
|
2344
|
+
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), src_exports2 = {};
|
|
2345
|
+
__export2(src_exports2, {
|
|
2346
|
+
useClientValue: () => useClientValue,
|
|
2347
|
+
useDidFinishSSR: () => useDidFinishSSR
|
|
2348
|
+
});
|
|
2349
|
+
module2.exports = __toCommonJS2(src_exports2);
|
|
2350
|
+
var import_react3 = require("react");
|
|
2351
|
+
function useDidFinishSSR(value) {
|
|
2352
|
+
return value ?? !0;
|
|
2353
|
+
}
|
|
2354
|
+
function useClientValue(value) {
|
|
2355
|
+
return useDidFinishSSR() ? typeof value == "function" ? value() : value : void 0;
|
|
2356
|
+
}
|
|
2357
|
+
}
|
|
2358
|
+
});
|
|
2359
|
+
|
|
2360
|
+
// ../web/dist/cjs/helpers/objectIdentityKey.native.js
|
|
2361
|
+
var require_objectIdentityKey_native = __commonJS({
|
|
2362
|
+
"../web/dist/cjs/helpers/objectIdentityKey.native.js"(exports2, module2) {
|
|
2363
|
+
"use strict";
|
|
2364
|
+
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
2365
|
+
for (var name in all)
|
|
2366
|
+
__defProp2(target, name, { get: all[name], enumerable: !0 });
|
|
2367
|
+
}, __copyProps2 = (to, from, except, desc) => {
|
|
2368
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
2369
|
+
for (let key of __getOwnPropNames2(from))
|
|
2370
|
+
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
2371
|
+
return to;
|
|
2372
|
+
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), objectIdentityKey_exports = {};
|
|
2373
|
+
__export2(objectIdentityKey_exports, {
|
|
2374
|
+
objectIdentityKey: () => objectIdentityKey
|
|
2375
|
+
});
|
|
2376
|
+
module2.exports = __toCommonJS2(objectIdentityKey_exports);
|
|
2377
|
+
function objectIdentityKey(obj) {
|
|
2378
|
+
let k = "";
|
|
2379
|
+
for (let key in obj) {
|
|
2380
|
+
k += key;
|
|
2381
|
+
let arg = obj[key], type = typeof arg;
|
|
2382
|
+
if (!arg || type !== "object" && type !== "function")
|
|
2383
|
+
k += type + arg;
|
|
2384
|
+
else if (cache.has(arg))
|
|
2385
|
+
k += cache.get(arg);
|
|
2386
|
+
else {
|
|
2387
|
+
let v = Math.random();
|
|
2388
|
+
cache.set(arg, v), k += v;
|
|
2389
|
+
}
|
|
2390
|
+
}
|
|
2391
|
+
return k;
|
|
2392
|
+
}
|
|
2393
|
+
var cache = /* @__PURE__ */ new WeakMap();
|
|
2394
|
+
}
|
|
2395
|
+
});
|
|
2396
|
+
|
|
2397
|
+
// ../web/dist/cjs/helpers/createStyledContext.native.js
|
|
2398
|
+
var require_createStyledContext_native = __commonJS({
|
|
2399
|
+
"../web/dist/cjs/helpers/createStyledContext.native.js"(exports2, module2) {
|
|
2400
|
+
"use strict";
|
|
2401
|
+
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
2402
|
+
for (var name in all)
|
|
2403
|
+
__defProp2(target, name, { get: all[name], enumerable: !0 });
|
|
2404
|
+
}, __copyProps2 = (to, from, except, desc) => {
|
|
2405
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
2406
|
+
for (let key of __getOwnPropNames2(from))
|
|
2407
|
+
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
2408
|
+
return to;
|
|
2409
|
+
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), createStyledContext_exports = {};
|
|
2410
|
+
__export2(createStyledContext_exports, {
|
|
2411
|
+
createStyledContext: () => createStyledContext
|
|
2412
|
+
});
|
|
2413
|
+
module2.exports = __toCommonJS2(createStyledContext_exports);
|
|
2414
|
+
var import_react3 = require("react"), import_objectIdentityKey = require_objectIdentityKey_native(), import_jsx_runtime = require("react/jsx-runtime");
|
|
2415
|
+
function createStyledContext(defaultValues) {
|
|
2416
|
+
let OGContext = (0, import_react3.createContext)(defaultValues), OGProvider = OGContext.Provider, Context = OGContext, scopedContexts = /* @__PURE__ */ new Map(), Provider = ({
|
|
2417
|
+
children,
|
|
2418
|
+
scope,
|
|
2419
|
+
...values
|
|
2420
|
+
}) => {
|
|
2421
|
+
let next = (0, import_react3.useMemo)(() => ({
|
|
2422
|
+
// this ! is a workaround for ts error
|
|
2423
|
+
...defaultValues,
|
|
2424
|
+
...values
|
|
2425
|
+
}), [(0, import_objectIdentityKey.objectIdentityKey)(values)]), Provider2 = OGProvider;
|
|
2426
|
+
if (scope) {
|
|
2427
|
+
let ScopedContext = scopedContexts.get(scope);
|
|
2428
|
+
ScopedContext || (ScopedContext = (0, import_react3.createContext)(defaultValues), scopedContexts.set(scope, ScopedContext)), Provider2 = ScopedContext.Provider;
|
|
2429
|
+
}
|
|
2430
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Provider2, { value: next, children });
|
|
2431
|
+
}, useStyledContext = (scope) => {
|
|
2432
|
+
let context = scope ? scopedContexts.get(scope) : OGContext;
|
|
2433
|
+
return (0, import_react3.useContext)(context);
|
|
2434
|
+
};
|
|
2435
|
+
return Context.Provider = Provider, Context.props = defaultValues, Context.context = OGContext, Context.useStyledContext = useStyledContext, Context;
|
|
2436
|
+
}
|
|
2437
|
+
}
|
|
2438
|
+
});
|
|
2439
|
+
|
|
2440
|
+
// ../web/dist/cjs/contexts/ComponentContext.native.js
|
|
2441
|
+
var require_ComponentContext_native = __commonJS({
|
|
2442
|
+
"../web/dist/cjs/contexts/ComponentContext.native.js"(exports2, module2) {
|
|
2443
|
+
"use strict";
|
|
2444
|
+
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
2445
|
+
for (var name in all)
|
|
2446
|
+
__defProp2(target, name, { get: all[name], enumerable: !0 });
|
|
2447
|
+
}, __copyProps2 = (to, from, except, desc) => {
|
|
2448
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
2449
|
+
for (let key of __getOwnPropNames2(from))
|
|
2450
|
+
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
2451
|
+
return to;
|
|
2452
|
+
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), ComponentContext_exports = {};
|
|
2453
|
+
__export2(ComponentContext_exports, {
|
|
2454
|
+
ComponentContext: () => ComponentContext
|
|
2455
|
+
});
|
|
2456
|
+
module2.exports = __toCommonJS2(ComponentContext_exports);
|
|
2457
|
+
var import_createStyledContext = require_createStyledContext_native(), ComponentContext = (0, import_createStyledContext.createStyledContext)({
|
|
2458
|
+
disableSSR: void 0,
|
|
2459
|
+
inText: !1,
|
|
2460
|
+
language: null,
|
|
2461
|
+
animationDriver: null,
|
|
2462
|
+
groups: {
|
|
2463
|
+
emit: null,
|
|
2464
|
+
subscribe: null,
|
|
2465
|
+
state: {}
|
|
2466
|
+
}
|
|
2467
|
+
});
|
|
2468
|
+
}
|
|
2469
|
+
});
|
|
2470
|
+
|
|
2471
|
+
// ../web/dist/cjs/defaultComponentState.native.js
|
|
2472
|
+
var require_defaultComponentState_native = __commonJS({
|
|
2473
|
+
"../web/dist/cjs/defaultComponentState.native.js"(exports2, module2) {
|
|
2474
|
+
"use strict";
|
|
2475
|
+
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
2476
|
+
for (var name in all)
|
|
2477
|
+
__defProp2(target, name, { get: all[name], enumerable: !0 });
|
|
2478
|
+
}, __copyProps2 = (to, from, except, desc) => {
|
|
2479
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
2480
|
+
for (let key of __getOwnPropNames2(from))
|
|
2481
|
+
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
2482
|
+
return to;
|
|
2483
|
+
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), defaultComponentState_exports = {};
|
|
2484
|
+
__export2(defaultComponentState_exports, {
|
|
2485
|
+
defaultComponentState: () => defaultComponentState,
|
|
2486
|
+
defaultComponentStateMounted: () => defaultComponentStateMounted,
|
|
2487
|
+
defaultComponentStateShouldEnter: () => defaultComponentStateShouldEnter
|
|
2488
|
+
});
|
|
2489
|
+
module2.exports = __toCommonJS2(defaultComponentState_exports);
|
|
2490
|
+
var defaultComponentState = {
|
|
2491
|
+
hover: !1,
|
|
2492
|
+
press: !1,
|
|
2493
|
+
pressIn: !1,
|
|
2494
|
+
focus: !1,
|
|
2495
|
+
unmounted: !0
|
|
2496
|
+
}, defaultComponentStateMounted = {
|
|
2497
|
+
...defaultComponentState,
|
|
2498
|
+
unmounted: !1
|
|
2499
|
+
}, defaultComponentStateShouldEnter = {
|
|
2500
|
+
...defaultComponentState,
|
|
2501
|
+
unmounted: "should-enter"
|
|
2502
|
+
};
|
|
2503
|
+
}
|
|
2504
|
+
});
|
|
2505
|
+
|
|
2506
|
+
// ../web/dist/cjs/constants/accessibilityDirectMap.native.js
|
|
2507
|
+
var require_accessibilityDirectMap_native = __commonJS({
|
|
2508
|
+
"../web/dist/cjs/constants/accessibilityDirectMap.native.js"(exports2, module2) {
|
|
2509
|
+
"use strict";
|
|
2510
|
+
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
2511
|
+
for (var name in all)
|
|
2512
|
+
__defProp2(target, name, { get: all[name], enumerable: !0 });
|
|
2513
|
+
}, __copyProps2 = (to, from, except, desc) => {
|
|
2514
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
2515
|
+
for (let key of __getOwnPropNames2(from))
|
|
2516
|
+
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
2517
|
+
return to;
|
|
2518
|
+
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), accessibilityDirectMap_native_exports = {};
|
|
2519
|
+
__export2(accessibilityDirectMap_native_exports, {
|
|
2520
|
+
accessibilityDirectMap: () => accessibilityDirectMap,
|
|
2521
|
+
accessibilityWebRoleToNativeRole: () => accessibilityWebRoleToNativeRole,
|
|
2522
|
+
nativeAccessibilityState: () => nativeAccessibilityState,
|
|
2523
|
+
nativeAccessibilityValue: () => nativeAccessibilityValue,
|
|
2524
|
+
webToNativeAccessibilityDirectMap: () => webToNativeAccessibilityDirectMap
|
|
2525
|
+
});
|
|
2526
|
+
module2.exports = __toCommonJS2(accessibilityDirectMap_native_exports);
|
|
2527
|
+
var accessibilityDirectMap = {}, webToNativeAccessibilityDirectMap = {
|
|
2528
|
+
"aria-label": "accessibilityLabel",
|
|
2529
|
+
"aria-labelledby": "accessibilityLabelledBy",
|
|
2530
|
+
"aria-live": "accessibilityLiveRegion",
|
|
2531
|
+
"aria-modal": "accessibilityViewIsModal",
|
|
2532
|
+
"aria-hidden": "accessibilityElementsHidden"
|
|
2533
|
+
}, nativeAccessibilityValue = {
|
|
2534
|
+
"aria-valuemin": "min",
|
|
2535
|
+
"aria-valuemax": "max",
|
|
2536
|
+
"aria-valuenow": "now",
|
|
2537
|
+
"aria-valuetext": "text"
|
|
2538
|
+
}, nativeAccessibilityState = {
|
|
2539
|
+
"aria-disabled": "disabled",
|
|
2540
|
+
"aria-selected": "selected",
|
|
2541
|
+
"aria-checked": "checked",
|
|
2542
|
+
"aria-busy": "busy",
|
|
2543
|
+
"aria-expanded": "expanded"
|
|
2544
|
+
}, accessibilityWebRoleToNativeRole = {
|
|
2545
|
+
alert: "alert",
|
|
2546
|
+
button: "button",
|
|
2547
|
+
checkbox: "checkbox",
|
|
2548
|
+
combobox: "combobox",
|
|
2549
|
+
grid: "grid",
|
|
2550
|
+
group: "none",
|
|
2551
|
+
heading: "header",
|
|
2552
|
+
imagebutton: "imagebutton",
|
|
2553
|
+
img: "image",
|
|
2554
|
+
keyboardkey: "keyboardkey",
|
|
2555
|
+
link: "link",
|
|
2556
|
+
menu: "menu",
|
|
2557
|
+
menubar: "menubar",
|
|
2558
|
+
menuitem: "menuitem",
|
|
2559
|
+
none: "none",
|
|
2560
|
+
presentation: "none",
|
|
2561
|
+
progressbar: "progressbar",
|
|
2562
|
+
radio: "radio",
|
|
2563
|
+
radiogroup: "radiogroup",
|
|
2564
|
+
region: "summary",
|
|
2565
|
+
scrollbar: "scrollbar",
|
|
2566
|
+
searchbox: "search",
|
|
2567
|
+
slider: "adjustable",
|
|
2568
|
+
spinbutton: "spinbutton",
|
|
2569
|
+
summary: "summary",
|
|
2570
|
+
switch: "switch",
|
|
2571
|
+
tab: "tab",
|
|
2572
|
+
tablist: "tablist",
|
|
2573
|
+
text: "text",
|
|
2574
|
+
timer: "timer",
|
|
2575
|
+
togglebutton: "togglebutton",
|
|
2576
|
+
toolbar: "toolbar"
|
|
2577
|
+
};
|
|
2578
|
+
}
|
|
2579
|
+
});
|
|
2580
|
+
|
|
2581
|
+
// ../web/dist/cjs/constants/isDevTools.native.js
|
|
2582
|
+
var require_isDevTools_native = __commonJS({
|
|
2583
|
+
"../web/dist/cjs/constants/isDevTools.native.js"(exports2, module2) {
|
|
2584
|
+
"use strict";
|
|
2585
|
+
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
2586
|
+
for (var name in all)
|
|
2587
|
+
__defProp2(target, name, { get: all[name], enumerable: !0 });
|
|
2588
|
+
}, __copyProps2 = (to, from, except, desc) => {
|
|
2589
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
2590
|
+
for (let key of __getOwnPropNames2(from))
|
|
2591
|
+
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
2592
|
+
return to;
|
|
2593
|
+
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), isDevTools_exports = {};
|
|
2594
|
+
__export2(isDevTools_exports, {
|
|
2595
|
+
isDevTools: () => isDevTools
|
|
2596
|
+
});
|
|
2597
|
+
module2.exports = __toCommonJS2(isDevTools_exports);
|
|
2598
|
+
var isDevTools = (() => {
|
|
2599
|
+
if (0)
|
|
2600
|
+
try {
|
|
2601
|
+
} catch {
|
|
2602
|
+
}
|
|
2603
|
+
return !1;
|
|
2604
|
+
})();
|
|
2605
|
+
}
|
|
2606
|
+
});
|
|
2607
|
+
|
|
2608
|
+
// ../web/dist/cjs/helpers/getGroupPropParts.native.js
|
|
2609
|
+
var require_getGroupPropParts_native = __commonJS({
|
|
2610
|
+
"../web/dist/cjs/helpers/getGroupPropParts.native.js"(exports2, module2) {
|
|
2611
|
+
"use strict";
|
|
2612
|
+
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
2613
|
+
for (var name in all)
|
|
2614
|
+
__defProp2(target, name, { get: all[name], enumerable: !0 });
|
|
2615
|
+
}, __copyProps2 = (to, from, except, desc) => {
|
|
2616
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
2617
|
+
for (let key of __getOwnPropNames2(from))
|
|
2618
|
+
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
2619
|
+
return to;
|
|
2620
|
+
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), getGroupPropParts_exports = {};
|
|
2621
|
+
__export2(getGroupPropParts_exports, {
|
|
2622
|
+
getGroupPropParts: () => getGroupPropParts
|
|
2623
|
+
});
|
|
2624
|
+
module2.exports = __toCommonJS2(getGroupPropParts_exports);
|
|
2625
|
+
var import_useMedia = require_useMedia_native();
|
|
2626
|
+
function getGroupPropParts(groupProp) {
|
|
2627
|
+
let mediaQueries = (0, import_useMedia.getMedia)(), [_, name, part3, part4] = groupProp.split("-"), pseudo, media = part3 in mediaQueries ? part3 : void 0;
|
|
2628
|
+
return media ? pseudo = part4 : pseudo = part3, { name, pseudo, media };
|
|
2629
|
+
}
|
|
2630
|
+
}
|
|
2631
|
+
});
|
|
2632
|
+
|
|
2633
|
+
// ../web/dist/cjs/helpers/createMediaStyle.native.js
|
|
2634
|
+
var require_createMediaStyle_native = __commonJS({
|
|
2635
|
+
"../web/dist/cjs/helpers/createMediaStyle.native.js"(exports2, module2) {
|
|
2636
|
+
"use strict";
|
|
2637
|
+
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
2638
|
+
for (var name in all)
|
|
2639
|
+
__defProp2(target, name, { get: all[name], enumerable: !0 });
|
|
2640
|
+
}, __copyProps2 = (to, from, except, desc) => {
|
|
2641
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
2642
|
+
for (let key of __getOwnPropNames2(from))
|
|
2643
|
+
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
2644
|
+
return to;
|
|
2645
|
+
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), createMediaStyle_exports = {};
|
|
2646
|
+
__export2(createMediaStyle_exports, {
|
|
2647
|
+
MEDIA_SEP: () => MEDIA_SEP,
|
|
2648
|
+
createMediaStyle: () => createMediaStyle
|
|
2649
|
+
});
|
|
2650
|
+
module2.exports = __toCommonJS2(createMediaStyle_exports);
|
|
2651
|
+
var import_config = require_config_native(), import_useMedia = require_useMedia_native(), import_getGroupPropParts = require_getGroupPropParts_native(), MEDIA_SEP = "_", prefixes = null, selectors = null, groupPseudoToPseudoCSSMap = {
|
|
2652
|
+
press: "active"
|
|
2653
|
+
}, createMediaStyle = (styleObject, mediaKeyIn, mediaQueries, type, negate, priority) => {
|
|
2654
|
+
let { property, identifier, rules } = styleObject, conf = (0, import_config.getConfig)(), enableMediaPropOrder = conf.settings.mediaPropOrder, isTheme = type === "theme", isPlatform = type === "platform", isGroup = type === "group", isNonWindowMedia = isTheme || isPlatform || isGroup, negKey = negate ? "0" : "", ogPrefix = identifier.slice(0, identifier.indexOf("-") + 1), id = `${ogPrefix}${MEDIA_SEP}${mediaKeyIn.replace("-", "")}${negKey}${MEDIA_SEP}`, styleRule = "", groupMediaKey, containerName, nextIdentifier = identifier.replace(ogPrefix, id), styleInner = rules.map((rule) => rule.replace(identifier, nextIdentifier)).join(";");
|
|
2655
|
+
if (isNonWindowMedia) {
|
|
2656
|
+
let precedenceImportancePrefix = new Array((priority || 0) + (isGroup ? 1 : 0)).fill(":root").join("");
|
|
2285
2657
|
if (isTheme || isGroup) {
|
|
2286
2658
|
let groupInfo = (0, import_getGroupPropParts.getGroupPropParts)(mediaKeyIn), mediaName = groupInfo == null ? void 0 : groupInfo.name;
|
|
2287
2659
|
groupMediaKey = groupInfo == null ? void 0 : groupInfo.media, isGroup && (containerName = mediaName);
|
|
@@ -3799,256 +4171,43 @@ var require_getSplitStyles_native = __commonJS({
|
|
|
3799
4171
|
disableClassName: 1,
|
|
3800
4172
|
debug: 1,
|
|
3801
4173
|
componentName: 1,
|
|
3802
|
-
disableOptimization: 1,
|
|
3803
|
-
tag: 1,
|
|
3804
|
-
style: 1,
|
|
3805
|
-
// handled after loop so pseudos set usedKeys and override it if necessary
|
|
3806
|
-
group: 1
|
|
3807
|
-
};
|
|
3808
|
-
skipProps["data-test-renders"] = 1;
|
|
3809
|
-
Object.assign(skipProps, {
|
|
3810
|
-
whiteSpace: 1,
|
|
3811
|
-
wordWrap: 1,
|
|
3812
|
-
textOverflow: 1,
|
|
3813
|
-
textDecorationDistance: 1,
|
|
3814
|
-
cursor: 1,
|
|
3815
|
-
contain: 1,
|
|
3816
|
-
boxSizing: 1,
|
|
3817
|
-
boxShadow: 1,
|
|
3818
|
-
outlineStyle: 1,
|
|
3819
|
-
outlineOffset: 1,
|
|
3820
|
-
outlineWidth: 1,
|
|
3821
|
-
outlineColor: 1
|
|
3822
|
-
});
|
|
3823
|
-
function passDownProp(viewProps, key, val, shouldMergeObject = !1) {
|
|
3824
|
-
if (shouldMergeObject) {
|
|
3825
|
-
let next = {
|
|
3826
|
-
...viewProps[key],
|
|
3827
|
-
...val
|
|
3828
|
-
};
|
|
3829
|
-
delete viewProps[key], viewProps[key] = next;
|
|
3830
|
-
} else
|
|
3831
|
-
viewProps[key] = val;
|
|
3832
|
-
}
|
|
3833
|
-
}
|
|
3834
|
-
});
|
|
3835
|
-
|
|
3836
|
-
// ../web/dist/cjs/helpers/mergeProps.native.js
|
|
3837
|
-
var require_mergeProps_native = __commonJS({
|
|
3838
|
-
"../web/dist/cjs/helpers/mergeProps.native.js"(exports2, module2) {
|
|
3839
|
-
"use strict";
|
|
3840
|
-
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
3841
|
-
for (var name in all)
|
|
3842
|
-
__defProp2(target, name, { get: all[name], enumerable: !0 });
|
|
3843
|
-
}, __copyProps2 = (to, from, except, desc) => {
|
|
3844
|
-
if (from && typeof from == "object" || typeof from == "function")
|
|
3845
|
-
for (let key of __getOwnPropNames2(from))
|
|
3846
|
-
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
3847
|
-
return to;
|
|
3848
|
-
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), mergeProps_exports = {};
|
|
3849
|
-
__export2(mergeProps_exports, {
|
|
3850
|
-
mergeProps: () => mergeProps
|
|
3851
|
-
});
|
|
3852
|
-
module2.exports = __toCommonJS2(mergeProps_exports);
|
|
3853
|
-
var import_useMedia = require_useMedia_native(), import_pseudoDescriptors = require_pseudoDescriptors_native(), mergeProps = (a, b, inverseShorthands) => {
|
|
3854
|
-
let out = {};
|
|
3855
|
-
for (let key in a)
|
|
3856
|
-
mergeProp(out, a, b, key, inverseShorthands);
|
|
3857
|
-
if (b)
|
|
3858
|
-
for (let key in b)
|
|
3859
|
-
mergeProp(out, b, void 0, key, inverseShorthands);
|
|
3860
|
-
return out;
|
|
3861
|
-
};
|
|
3862
|
-
function mergeProp(out, a, b, key, inverseShorthands) {
|
|
3863
|
-
let longhand = (inverseShorthands == null ? void 0 : inverseShorthands[key]) || null, val = a[key];
|
|
3864
|
-
if (key in import_pseudoDescriptors.pseudoDescriptors || import_useMedia.mediaKeys.has(key)) {
|
|
3865
|
-
out[key] = {
|
|
3866
|
-
...out[key],
|
|
3867
|
-
...val
|
|
3868
|
-
};
|
|
3869
|
-
return;
|
|
3870
|
-
}
|
|
3871
|
-
b && (key in b || longhand && longhand in b) || (out[longhand || key] = val);
|
|
3872
|
-
}
|
|
3873
|
-
}
|
|
3874
|
-
});
|
|
3875
|
-
|
|
3876
|
-
// ../web/dist/cjs/helpers/ThemeManagerContext.native.js
|
|
3877
|
-
var require_ThemeManagerContext_native = __commonJS({
|
|
3878
|
-
"../web/dist/cjs/helpers/ThemeManagerContext.native.js"(exports2, module2) {
|
|
3879
|
-
"use strict";
|
|
3880
|
-
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
3881
|
-
for (var name in all)
|
|
3882
|
-
__defProp2(target, name, { get: all[name], enumerable: !0 });
|
|
3883
|
-
}, __copyProps2 = (to, from, except, desc) => {
|
|
3884
|
-
if (from && typeof from == "object" || typeof from == "function")
|
|
3885
|
-
for (let key of __getOwnPropNames2(from))
|
|
3886
|
-
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
3887
|
-
return to;
|
|
3888
|
-
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), ThemeManagerContext_exports = {};
|
|
3889
|
-
__export2(ThemeManagerContext_exports, {
|
|
3890
|
-
ThemeManagerIDContext: () => ThemeManagerIDContext
|
|
3891
|
-
});
|
|
3892
|
-
module2.exports = __toCommonJS2(ThemeManagerContext_exports);
|
|
3893
|
-
var import_react3 = require("react"), ThemeManagerIDContext = (0, import_react3.createContext)(1);
|
|
3894
|
-
}
|
|
3895
|
-
});
|
|
3896
|
-
|
|
3897
|
-
// ../web/dist/cjs/helpers/ThemeManager.native.js
|
|
3898
|
-
var require_ThemeManager_native = __commonJS({
|
|
3899
|
-
"../web/dist/cjs/helpers/ThemeManager.native.js"(exports2, module2) {
|
|
3900
|
-
"use strict";
|
|
3901
|
-
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
3902
|
-
for (var name in all)
|
|
3903
|
-
__defProp2(target, name, { get: all[name], enumerable: !0 });
|
|
3904
|
-
}, __copyProps2 = (to, from, except, desc) => {
|
|
3905
|
-
if (from && typeof from == "object" || typeof from == "function")
|
|
3906
|
-
for (let key of __getOwnPropNames2(from))
|
|
3907
|
-
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
3908
|
-
return to;
|
|
3909
|
-
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), ThemeManager_exports = {};
|
|
3910
|
-
__export2(ThemeManager_exports, {
|
|
3911
|
-
ThemeManager: () => ThemeManager,
|
|
3912
|
-
getHasThemeUpdatingProps: () => getHasThemeUpdatingProps,
|
|
3913
|
-
getManagers: () => getManagers
|
|
3914
|
-
});
|
|
3915
|
-
module2.exports = __toCommonJS2(ThemeManager_exports);
|
|
3916
|
-
var import_constants = require_index_native3(), import_config = require_config_native(), import_constants2 = require_constants_native2(), emptyState = { name: "" };
|
|
3917
|
-
function getHasThemeUpdatingProps(props) {
|
|
3918
|
-
return !!(props.name || props.componentName || props.inverse || props.reset);
|
|
3919
|
-
}
|
|
3920
|
-
var uid = 0, ThemeManager = class {
|
|
3921
|
-
constructor(props = {}, parentManager) {
|
|
3922
|
-
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") {
|
|
3923
|
-
this.updateStateFromProps(props, !1);
|
|
3924
|
-
return;
|
|
3925
|
-
}
|
|
3926
|
-
if (!parentManager)
|
|
3927
|
-
throw new Error(
|
|
3928
|
-
"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."
|
|
3929
|
-
);
|
|
3930
|
-
if (this.parentManager = parentManager, !this.updateStateFromProps(props, !1))
|
|
3931
|
-
return parentManager;
|
|
3932
|
-
}
|
|
3933
|
-
updateStateFromProps(props = this.props || {}, shouldNotify = !0) {
|
|
3934
|
-
if (this.props = props, props.forceTheme)
|
|
3935
|
-
return this.state.theme = props.forceTheme, this.state.name = props.name || "", this.updateState(this.state, !0), this.state;
|
|
3936
|
-
let nextState = this.getStateIfChanged(props);
|
|
3937
|
-
if (nextState)
|
|
3938
|
-
return this.updateState(nextState, shouldNotify), nextState;
|
|
3939
|
-
}
|
|
3940
|
-
updateState(nextState, shouldNotify = !0) {
|
|
3941
|
-
this.state = nextState, this._allKeys = null, this._numChangeEventsSent ??= 0, this._numChangeEventsSent++, shouldNotify && this.notify();
|
|
3942
|
-
}
|
|
3943
|
-
getStateIfChanged(props = this.props, state = this.state, parentManager = this.parentManager) {
|
|
3944
|
-
let _ = this.getState(props, parentManager);
|
|
3945
|
-
if (state && state !== emptyState && !_)
|
|
3946
|
-
return parentManager == null ? void 0 : parentManager.state;
|
|
3947
|
-
if (this.getStateShouldChange(_, state))
|
|
3948
|
-
return _;
|
|
3949
|
-
}
|
|
3950
|
-
getStateShouldChange(nextState, state = this.state) {
|
|
3951
|
-
return !(!(nextState != null && nextState.theme) || nextState.theme === (state == null ? void 0 : state.theme));
|
|
3952
|
-
}
|
|
3953
|
-
getState(props = this.props, parentManager = this.parentManager) {
|
|
3954
|
-
return getState(props, parentManager) || (parentManager == null ? void 0 : parentManager.state) || null;
|
|
3955
|
-
}
|
|
3956
|
-
get allKeys() {
|
|
3957
|
-
var _a;
|
|
3958
|
-
return this._allKeys ||= /* @__PURE__ */ new Set([
|
|
3959
|
-
...((_a = this.parentManager) == null ? void 0 : _a.allKeys) || [],
|
|
3960
|
-
...Object.keys(this.state.theme || {})
|
|
3961
|
-
]), this._allKeys;
|
|
3962
|
-
}
|
|
3963
|
-
notify(forced = !1) {
|
|
3964
|
-
this.themeListeners.forEach((cb) => cb(this.state.name, this, forced));
|
|
3965
|
-
}
|
|
3966
|
-
onChangeTheme(cb, debugId) {
|
|
3967
|
-
return debugId && (this._listeningIds ??= /* @__PURE__ */ new Set(), this._listeningIds.add(debugId)), this.themeListeners.add(cb), () => {
|
|
3968
|
-
this.themeListeners.delete(cb);
|
|
3969
|
-
};
|
|
3970
|
-
}
|
|
3971
|
-
};
|
|
3972
|
-
function getState(props, manager) {
|
|
3973
|
-
var _a;
|
|
3974
|
-
if (props.name && props.reset)
|
|
3975
|
-
throw new Error(
|
|
3976
|
-
"Cannot reset and set a new name at the same time."
|
|
3977
|
-
);
|
|
3978
|
-
if (!getHasThemeUpdatingProps(props))
|
|
3979
|
-
return null;
|
|
3980
|
-
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];
|
|
3981
|
-
if (!baseManager && props.reset)
|
|
3982
|
-
return console.warn("Cannot reset, no parent theme exists"), null;
|
|
3983
|
-
let { componentName } = props, result = null, baseName = (baseManager == null ? void 0 : baseManager.state.name) || "";
|
|
3984
|
-
baseManager != null && baseManager.state.isComponent && (baseName = baseName.replace(/_[A-Z][A-Za-z]+/, ""));
|
|
3985
|
-
let nextName = props.reset ? baseName : props.name || "", allComponentThemes = componentManagers.map((x) => (x == null ? void 0 : x.state.name) || "");
|
|
3986
|
-
isDirectParentAComponentTheme && allComponentThemes.shift();
|
|
3987
|
-
let base = baseName.split(import_constants2.THEME_NAME_SEPARATOR), max = base.length, min = props.componentName && !nextName ? max : 0;
|
|
3988
|
-
for (let i = max; i >= min; i--) {
|
|
3989
|
-
let prefix = base.slice(0, i).join(import_constants2.THEME_NAME_SEPARATOR);
|
|
3990
|
-
props.inverse && (prefix = inverseThemeName(prefix));
|
|
3991
|
-
let potentials = [];
|
|
3992
|
-
if (prefix && prefix !== baseName && potentials.push(prefix), nextName && potentials.unshift(prefix ? `${prefix}_${nextName}` : nextName), i === 1) {
|
|
3993
|
-
let lastSegment = potentials.findIndex((x) => !x.includes("_"));
|
|
3994
|
-
lastSegment > 0 && potentials.splice(lastSegment, 0, nextName);
|
|
3995
|
-
}
|
|
3996
|
-
if (componentName && !props.reset) {
|
|
3997
|
-
let baseLen = base.length, componentPotentials = [];
|
|
3998
|
-
if (nextName && baseLen > 1) {
|
|
3999
|
-
let beforeSeparator = base[0];
|
|
4000
|
-
componentPotentials.push(`${beforeSeparator}_${nextName}_${componentName}`);
|
|
4001
|
-
}
|
|
4002
|
-
if (componentPotentials.push(`${prefix}_${componentName}`), nextName) {
|
|
4003
|
-
if (i > baseLen) {
|
|
4004
|
-
let prefixLessOne = base.slice(0, i - 1).join(import_constants2.THEME_NAME_SEPARATOR);
|
|
4005
|
-
if (prefixLessOne) {
|
|
4006
|
-
let lessSpecific = `${prefixLessOne}_${nextName}_${componentName}`;
|
|
4007
|
-
componentPotentials.unshift(lessSpecific);
|
|
4008
|
-
}
|
|
4009
|
-
}
|
|
4010
|
-
let moreSpecific = `${prefix}_${nextName}_${componentName}`;
|
|
4011
|
-
componentPotentials.unshift(moreSpecific);
|
|
4012
|
-
}
|
|
4013
|
-
potentials = [...componentPotentials, ...potentials, ...allComponentThemes];
|
|
4014
|
-
}
|
|
4015
|
-
let found = potentials.find((t) => t in themes);
|
|
4016
|
-
if (typeof props.debug == "string" && console.info(" getState ", {
|
|
4017
|
-
props,
|
|
4018
|
-
found,
|
|
4019
|
-
potentials,
|
|
4020
|
-
baseManager,
|
|
4021
|
-
nextName,
|
|
4022
|
-
baseName,
|
|
4023
|
-
prefix
|
|
4024
|
-
}), found) {
|
|
4025
|
-
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_constants2.THEME_CLASSNAME_PREFIX, className = import_constants.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;
|
|
4026
|
-
result = {
|
|
4027
|
-
name: found,
|
|
4028
|
-
parentName,
|
|
4029
|
-
theme: themes[found],
|
|
4030
|
-
className,
|
|
4031
|
-
isComponent,
|
|
4032
|
-
scheme
|
|
4033
|
-
};
|
|
4034
|
-
break;
|
|
4035
|
-
}
|
|
4036
|
-
}
|
|
4037
|
-
return props.debug === "verbose" && typeof window < "u" && (console.groupCollapsed("ThemeManager.getState()"), console.info({ props, baseName, base, min, max }), console.warn("result", { result }), console.trace(), console.groupEnd()), result;
|
|
4038
|
-
}
|
|
4039
|
-
var inverseThemeName = (themeName) => themeName.startsWith("light") ? themeName.replace(/^light/, "dark") : themeName.replace(/^dark/, "light");
|
|
4040
|
-
function getManagers(themeManager) {
|
|
4041
|
-
let comp = [], all = [], cur = themeManager;
|
|
4042
|
-
for (; cur; )
|
|
4043
|
-
all.push(cur), cur.state.isComponent && comp.push(cur), cur = cur.parentManager;
|
|
4044
|
-
return [all, comp];
|
|
4174
|
+
disableOptimization: 1,
|
|
4175
|
+
tag: 1,
|
|
4176
|
+
style: 1,
|
|
4177
|
+
// handled after loop so pseudos set usedKeys and override it if necessary
|
|
4178
|
+
group: 1
|
|
4179
|
+
};
|
|
4180
|
+
skipProps["data-test-renders"] = 1;
|
|
4181
|
+
Object.assign(skipProps, {
|
|
4182
|
+
whiteSpace: 1,
|
|
4183
|
+
wordWrap: 1,
|
|
4184
|
+
textOverflow: 1,
|
|
4185
|
+
textDecorationDistance: 1,
|
|
4186
|
+
cursor: 1,
|
|
4187
|
+
contain: 1,
|
|
4188
|
+
boxSizing: 1,
|
|
4189
|
+
boxShadow: 1,
|
|
4190
|
+
outlineStyle: 1,
|
|
4191
|
+
outlineOffset: 1,
|
|
4192
|
+
outlineWidth: 1,
|
|
4193
|
+
outlineColor: 1
|
|
4194
|
+
});
|
|
4195
|
+
function passDownProp(viewProps, key, val, shouldMergeObject = !1) {
|
|
4196
|
+
if (shouldMergeObject) {
|
|
4197
|
+
let next = {
|
|
4198
|
+
...viewProps[key],
|
|
4199
|
+
...val
|
|
4200
|
+
};
|
|
4201
|
+
delete viewProps[key], viewProps[key] = next;
|
|
4202
|
+
} else
|
|
4203
|
+
viewProps[key] = val;
|
|
4045
4204
|
}
|
|
4046
4205
|
}
|
|
4047
4206
|
});
|
|
4048
4207
|
|
|
4049
|
-
// ../web/dist/cjs/
|
|
4050
|
-
var
|
|
4051
|
-
"../web/dist/cjs/
|
|
4208
|
+
// ../web/dist/cjs/helpers/mergeProps.native.js
|
|
4209
|
+
var require_mergeProps_native = __commonJS({
|
|
4210
|
+
"../web/dist/cjs/helpers/mergeProps.native.js"(exports2, module2) {
|
|
4052
4211
|
"use strict";
|
|
4053
4212
|
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
4054
4213
|
for (var name in all)
|
|
@@ -4058,209 +4217,31 @@ var require_useTheme_native = __commonJS({
|
|
|
4058
4217
|
for (let key of __getOwnPropNames2(from))
|
|
4059
4218
|
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
4060
4219
|
return to;
|
|
4061
|
-
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod),
|
|
4062
|
-
__export2(
|
|
4063
|
-
|
|
4064
|
-
getThemeManager: () => getThemeManager,
|
|
4065
|
-
getThemeProxied: () => getThemeProxied,
|
|
4066
|
-
useChangeThemeEffect: () => useChangeThemeEffect,
|
|
4067
|
-
useTheme: () => useTheme,
|
|
4068
|
-
useThemeWithState: () => useThemeWithState
|
|
4220
|
+
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), mergeProps_exports = {};
|
|
4221
|
+
__export2(mergeProps_exports, {
|
|
4222
|
+
mergeProps: () => mergeProps
|
|
4069
4223
|
});
|
|
4070
|
-
module2.exports = __toCommonJS2(
|
|
4071
|
-
var
|
|
4072
|
-
|
|
4073
|
-
|
|
4074
|
-
|
|
4075
|
-
|
|
4076
|
-
|
|
4077
|
-
|
|
4078
|
-
|
|
4079
|
-
let [_, theme] = useThemeWithState(props);
|
|
4080
|
-
return theme || getDefaultThemeProxied();
|
|
4081
|
-
}, useThemeWithState = (props) => {
|
|
4082
|
-
let keys = (0, import_react3.useRef)([]), changedThemeState = useChangeThemeEffect(
|
|
4083
|
-
props,
|
|
4084
|
-
!1,
|
|
4085
|
-
keys.current,
|
|
4086
|
-
import_constants.isServer ? void 0 : () => {
|
|
4087
|
-
var _a, _b;
|
|
4088
|
-
return ((_a = props.shouldUpdate) == null ? void 0 : _a.call(props)) ?? (keys.current.length > 0 ? !0 : void 0);
|
|
4089
|
-
}
|
|
4090
|
-
), { themeManager, state } = changedThemeState, themeProxied = (0, import_react3.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]);
|
|
4091
|
-
return [changedThemeState, themeProxied];
|
|
4224
|
+
module2.exports = __toCommonJS2(mergeProps_exports);
|
|
4225
|
+
var import_useMedia = require_useMedia_native(), import_pseudoDescriptors = require_pseudoDescriptors_native(), mergeProps = (a, b, inverseShorthands) => {
|
|
4226
|
+
let out = {};
|
|
4227
|
+
for (let key in a)
|
|
4228
|
+
mergeProp(out, a, b, key, inverseShorthands);
|
|
4229
|
+
if (b)
|
|
4230
|
+
for (let key in b)
|
|
4231
|
+
mergeProp(out, b, void 0, key, inverseShorthands);
|
|
4232
|
+
return out;
|
|
4092
4233
|
};
|
|
4093
|
-
function
|
|
4094
|
-
|
|
4095
|
-
|
|
4096
|
-
|
|
4097
|
-
|
|
4098
|
-
|
|
4099
|
-
}
|
|
4100
|
-
return new Proxy(theme, {
|
|
4101
|
-
has(_, key) {
|
|
4102
|
-
if (Reflect.has(theme, key))
|
|
4103
|
-
return !0;
|
|
4104
|
-
if (typeof key == "string")
|
|
4105
|
-
return key[0] === "$" && (key = key.slice(1)), themeManager == null ? void 0 : themeManager.allKeys.has(key);
|
|
4106
|
-
},
|
|
4107
|
-
get(_, key) {
|
|
4108
|
-
if (
|
|
4109
|
-
// dont ask me, idk why but on hermes you can see that useTheme()[undefined] passes in STRING undefined to proxy
|
|
4110
|
-
// if someone is crazy enough to use "undefined" as a theme key then this not working is on them
|
|
4111
|
-
key !== "undefined" && typeof key == "string"
|
|
4112
|
-
) {
|
|
4113
|
-
let keyString = key[0] === "$" ? key.slice(1) : key, val = theme[keyString];
|
|
4114
|
-
if (val && typeof val == "object")
|
|
4115
|
-
return new Proxy(val, {
|
|
4116
|
-
// when they touch the actual value we only track it
|
|
4117
|
-
// if its a variable (web), its ignored!
|
|
4118
|
-
get(_2, subkey) {
|
|
4119
|
-
if (subkey === "val")
|
|
4120
|
-
track(keyString);
|
|
4121
|
-
else if (subkey === "get")
|
|
4122
|
-
return (platform) => {
|
|
4123
|
-
let outVal = (0, import_createVariable.getVariable)(val);
|
|
4124
|
-
if (platform !== "web" && import_constants.isIos && !deopt && config.settings.fastSchemeChange && !someParentIsInversed(themeManager) && scheme) {
|
|
4125
|
-
let oppositeThemeName = name.replace(
|
|
4126
|
-
scheme === "dark" ? "dark" : "light",
|
|
4127
|
-
scheme === "dark" ? "light" : "dark"
|
|
4128
|
-
), oppositeTheme = config.themes[oppositeThemeName], oppositeVal = (0, import_createVariable.getVariable)(oppositeTheme == null ? void 0 : oppositeTheme[keyString]);
|
|
4129
|
-
if (oppositeVal)
|
|
4130
|
-
return {
|
|
4131
|
-
dynamic: {
|
|
4132
|
-
dark: scheme === "dark" ? outVal : oppositeVal,
|
|
4133
|
-
light: scheme === "light" ? outVal : oppositeVal
|
|
4134
|
-
}
|
|
4135
|
-
};
|
|
4136
|
-
}
|
|
4137
|
-
return track(keyString), outVal;
|
|
4138
|
-
};
|
|
4139
|
-
return Reflect.get(val, subkey);
|
|
4140
|
-
}
|
|
4141
|
-
});
|
|
4142
|
-
}
|
|
4143
|
-
return Reflect.get(_, key);
|
|
4144
|
-
}
|
|
4145
|
-
});
|
|
4146
|
-
}
|
|
4147
|
-
function someParentIsInversed(manager) {
|
|
4148
|
-
{
|
|
4149
|
-
let cur = manager;
|
|
4150
|
-
for (; cur; ) {
|
|
4151
|
-
if (!cur.parentManager)
|
|
4152
|
-
return !1;
|
|
4153
|
-
if (cur.parentManager.state.scheme !== cur.state.scheme)
|
|
4154
|
-
return !0;
|
|
4155
|
-
cur = cur.parentManager;
|
|
4156
|
-
}
|
|
4157
|
-
}
|
|
4158
|
-
return !1;
|
|
4159
|
-
}
|
|
4160
|
-
var activeThemeManagers = /* @__PURE__ */ new Set(), _uidToManager = /* @__PURE__ */ new WeakMap(), _idToUID = {}, getId = (id) => _idToUID[id], getThemeManager = (id) => _uidToManager.get(getId(id)), registerThemeManager = (t) => {
|
|
4161
|
-
if (!_idToUID[t.id]) {
|
|
4162
|
-
let id = _idToUID[t.id] = {};
|
|
4163
|
-
_uidToManager.set(id, t);
|
|
4164
|
-
}
|
|
4165
|
-
}, useChangeThemeEffect = (props, isRoot = !1, keys, shouldUpdate) => {
|
|
4166
|
-
let { disable } = props, parentManagerId = (0, import_react3.useContext)(import_ThemeManagerContext.ThemeManagerIDContext), parentManager = getThemeManager(parentManagerId);
|
|
4167
|
-
if (!isRoot && !parentManager || disable)
|
|
4168
|
-
return {
|
|
4169
|
-
isNewTheme: !1,
|
|
4170
|
-
state: parentManager == null ? void 0 : parentManager.state,
|
|
4171
|
-
themeManager: parentManager
|
|
4172
|
-
};
|
|
4173
|
-
let [themeState, setThemeState] = (0, import_react3.useState)(createState), { state, mounted, isNewTheme, themeManager, inversed } = themeState, isInversingOnMount = !!(!themeState.mounted && props.inverse);
|
|
4174
|
-
function getShouldUpdateTheme(manager = themeManager, nextState, prevState = state, forceShouldChange = !1) {
|
|
4175
|
-
let forceUpdate = shouldUpdate == null ? void 0 : shouldUpdate();
|
|
4176
|
-
if (!manager || !forceShouldChange && forceUpdate === !1)
|
|
4177
|
-
return;
|
|
4178
|
-
let next = nextState || manager.getState(props, parentManager);
|
|
4179
|
-
if (forceShouldChange || next && !(forceUpdate !== !0 && !manager.getStateShouldChange(next, prevState)))
|
|
4180
|
-
return next;
|
|
4181
|
-
}
|
|
4182
|
-
if (import_constants.isServer || (0, import_react3.useEffect)(() => {
|
|
4183
|
-
if (!themeManager)
|
|
4184
|
-
return;
|
|
4185
|
-
if (props.inverse && !mounted) {
|
|
4186
|
-
setThemeState((prev) => createState({
|
|
4187
|
-
...prev,
|
|
4188
|
-
mounted: !0
|
|
4189
|
-
}));
|
|
4190
|
-
return;
|
|
4191
|
-
}
|
|
4192
|
-
(isNewTheme || getShouldUpdateTheme(themeManager)) && (activeThemeManagers.add(themeManager), setThemeState(createState));
|
|
4193
|
-
let selfListenerDispose = themeManager.onChangeTheme((_a, _b, forced) => {
|
|
4194
|
-
forced && setThemeState((prev) => createState(prev, !0));
|
|
4195
|
-
}), disposeChangeListener = parentManager == null ? void 0 : parentManager.onChangeTheme(
|
|
4196
|
-
(name, manager, forced) => {
|
|
4197
|
-
let force = forced || (shouldUpdate == null ? void 0 : shouldUpdate()) || props.deopt || props["disable-child-theme"];
|
|
4198
|
-
(force ?? !!(keys != null && keys.length || isNewTheme)) && setThemeState((prev) => createState(prev, force));
|
|
4199
|
-
},
|
|
4200
|
-
themeManager.id
|
|
4201
|
-
);
|
|
4202
|
-
return () => {
|
|
4203
|
-
selfListenerDispose(), disposeChangeListener == null || disposeChangeListener(), isNewTheme && activeThemeManagers.delete(themeManager);
|
|
4204
|
-
};
|
|
4205
|
-
}, [
|
|
4206
|
-
themeManager,
|
|
4207
|
-
parentManager,
|
|
4208
|
-
isNewTheme,
|
|
4209
|
-
props.componentName,
|
|
4210
|
-
props.inverse,
|
|
4211
|
-
props.name,
|
|
4212
|
-
props.reset,
|
|
4213
|
-
mounted
|
|
4214
|
-
]), isInversingOnMount)
|
|
4215
|
-
return {
|
|
4216
|
-
isNewTheme: !1,
|
|
4217
|
-
inversed: !1,
|
|
4218
|
-
themeManager: parentManager,
|
|
4219
|
-
state: {
|
|
4220
|
-
name: "",
|
|
4221
|
-
...parentManager == null ? void 0 : parentManager.state,
|
|
4222
|
-
className: ""
|
|
4223
|
-
}
|
|
4234
|
+
function mergeProp(out, a, b, key, inverseShorthands) {
|
|
4235
|
+
let longhand = (inverseShorthands == null ? void 0 : inverseShorthands[key]) || null, val = a[key];
|
|
4236
|
+
if (key in import_pseudoDescriptors.pseudoDescriptors || import_useMedia.mediaKeys.has(key)) {
|
|
4237
|
+
out[key] = {
|
|
4238
|
+
...out[key],
|
|
4239
|
+
...val
|
|
4224
4240
|
};
|
|
4225
|
-
|
|
4226
|
-
state,
|
|
4227
|
-
isNewTheme,
|
|
4228
|
-
inversed,
|
|
4229
|
-
themeManager
|
|
4230
|
-
};
|
|
4231
|
-
function createState(prev, force = !1) {
|
|
4232
|
-
if (prev && (shouldUpdate == null ? void 0 : shouldUpdate()) === !1 && !force)
|
|
4233
|
-
return prev;
|
|
4234
|
-
let themeManager2 = parentManager, state2;
|
|
4235
|
-
if ((0, import_ThemeManager.getHasThemeUpdatingProps)(props)) {
|
|
4236
|
-
let getNewThemeManager = () => new import_ThemeManager.ThemeManager(props, isRoot ? "root" : parentManager);
|
|
4237
|
-
if (prev != null && prev.themeManager) {
|
|
4238
|
-
themeManager2 = prev.themeManager;
|
|
4239
|
-
let forceChange = force || !!(keys != null && keys.length), next = themeManager2.getState(props, parentManager), nextState = getShouldUpdateTheme(
|
|
4240
|
-
themeManager2,
|
|
4241
|
-
next,
|
|
4242
|
-
prev.state,
|
|
4243
|
-
forceChange
|
|
4244
|
-
);
|
|
4245
|
-
nextState ? (state2 = nextState, prev.isNewTheme ? themeManager2.updateState(nextState) : themeManager2 = getNewThemeManager()) : prev.isNewTheme && parentManager && !next && (themeManager2 = parentManager);
|
|
4246
|
-
} else
|
|
4247
|
-
themeManager2 = getNewThemeManager(), state2 = { ...themeManager2.state };
|
|
4248
|
-
}
|
|
4249
|
-
let isNewTheme2 = !!(themeManager2 !== parentManager || props.inverse);
|
|
4250
|
-
isNewTheme2 && registerThemeManager(themeManager2);
|
|
4251
|
-
let mounted2 = props.inverse ? isRoot || (prev == null ? void 0 : prev.mounted) : !0;
|
|
4252
|
-
state2 || (isNewTheme2 ? state2 = themeManager2.state : (state2 = parentManager.state, themeManager2 = parentManager));
|
|
4253
|
-
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 = {
|
|
4254
|
-
themeManager: themeManager2,
|
|
4255
|
-
isNewTheme: isNewTheme2,
|
|
4256
|
-
mounted: mounted2,
|
|
4257
|
-
inversed: inversed2
|
|
4258
|
-
}, shouldReturnPrev = prev && !force && // isEqualShallow uses the second arg as the keys so this should compare without state first...
|
|
4259
|
-
(0, import_createShallowSetState.isEqualShallow)(prev, response) && // ... and then compare just the state, because we make a new state obj but is likely the same
|
|
4260
|
-
(0, import_createShallowSetState.isEqualShallow)(prev.state, state2);
|
|
4261
|
-
return prev && shouldReturnPrev ? prev : (response.state = state2, response);
|
|
4241
|
+
return;
|
|
4262
4242
|
}
|
|
4263
|
-
|
|
4243
|
+
b && (key in b || longhand && longhand in b) || (out[longhand || key] = val);
|
|
4244
|
+
}
|
|
4264
4245
|
}
|
|
4265
4246
|
});
|
|
4266
4247
|
|