tamagui 1.85.6 → 1.85.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/native.js +1007 -1000
- package/dist/native.js.map +3 -3
- package/dist/test.native.js +682 -707
- package/dist/test.native.js.map +3 -3
- package/package.json +52 -52
package/dist/native.js
CHANGED
|
@@ -1347,7 +1347,7 @@ var require_insertStyleRule_native = __commonJS({
|
|
|
1347
1347
|
if (sepI === -1)
|
|
1348
1348
|
continue;
|
|
1349
1349
|
let key = rule.slice(rule.indexOf("--") + 2, sepI), val = rule.slice(sepI + 2), value;
|
|
1350
|
-
if (val
|
|
1350
|
+
if (val.startsWith("var(")) {
|
|
1351
1351
|
let varName = val.slice(6, -1), tokenVal = colorVarToVal[varName];
|
|
1352
1352
|
tokenVal ? value = tokenVal : (rootComputedStyle ||= getComputedStyle(document.body), value = rootComputedStyle.getPropertyValue("--" + varName));
|
|
1353
1353
|
} else
|
|
@@ -1361,20 +1361,17 @@ var require_insertStyleRule_native = __commonJS({
|
|
|
1361
1361
|
!0
|
|
1362
1362
|
);
|
|
1363
1363
|
}
|
|
1364
|
-
|
|
1365
|
-
names: [
|
|
1366
|
-
...new Set(
|
|
1367
|
-
selectors.map((selector) => {
|
|
1368
|
-
let parts = selector.replace(/(.t_|:root)/g, "").trim().split(" "), [first] = parts, scheme = first.includes("dark") ? "dark" : first.includes("light") ? "light" : "", name = (() => {
|
|
1369
|
-
let _ = parts[parts.length - 1];
|
|
1370
|
-
return scheme && _.startsWith(scheme) && (_ = _.slice(scheme.length + 1)), _;
|
|
1371
|
-
})();
|
|
1372
|
-
return `${scheme}${scheme && name ? "_" : ""}${name}`;
|
|
1373
|
-
})
|
|
1374
|
-
)
|
|
1375
|
-
],
|
|
1364
|
+
let dedupedEntry = {
|
|
1365
|
+
names: [],
|
|
1376
1366
|
theme: values
|
|
1377
1367
|
};
|
|
1368
|
+
for (let selector of selectors) {
|
|
1369
|
+
let scheme = selector.includes("t_dark") ? "dark" : selector.includes("t_light") ? "light" : "", name = selector.slice(selector.lastIndexOf(".t_") + 3);
|
|
1370
|
+
name.startsWith(scheme) && (name = name.slice(scheme.length + 1)), scheme === name && (scheme = "");
|
|
1371
|
+
let themeName = `${scheme}${scheme && name ? "_" : ""}${name}`;
|
|
1372
|
+
dedupedEntry.names.includes(themeName) || dedupedEntry.names.push(themeName);
|
|
1373
|
+
}
|
|
1374
|
+
return dedupedEntry;
|
|
1378
1375
|
}
|
|
1379
1376
|
function getTamaguiSelector(rule, collectThemes = !1) {
|
|
1380
1377
|
if (rule instanceof CSSStyleRule) {
|
|
@@ -1706,65 +1703,11 @@ var require_useMedia_native = __commonJS({
|
|
|
1706
1703
|
}
|
|
1707
1704
|
});
|
|
1708
1705
|
|
|
1709
|
-
// ../web/dist/cjs/
|
|
1710
|
-
var
|
|
1711
|
-
"../web/dist/cjs/
|
|
1712
|
-
"use strict";
|
|
1713
|
-
var __create2 = Object.create, __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __getProtoOf2 = Object.getPrototypeOf, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
1714
|
-
for (var name in all)
|
|
1715
|
-
__defProp2(target, name, { get: all[name], enumerable: !0 });
|
|
1716
|
-
}, __copyProps2 = (to, from, except, desc) => {
|
|
1717
|
-
if (from && typeof from == "object" || typeof from == "function")
|
|
1718
|
-
for (let key of __getOwnPropNames2(from))
|
|
1719
|
-
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
1720
|
-
return to;
|
|
1721
|
-
}, __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps2(
|
|
1722
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
1723
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
1724
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
1725
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
1726
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", { value: mod, enumerable: !0 }) : target,
|
|
1727
|
-
mod
|
|
1728
|
-
)), __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), Tamagui_exports = {};
|
|
1729
|
-
__export2(Tamagui_exports, {
|
|
1730
|
-
Tamagui: () => Tamagui,
|
|
1731
|
-
getValueFromIdentifier: () => getValueFromIdentifier,
|
|
1732
|
-
setIdentifierValue: () => setIdentifierValue
|
|
1733
|
-
});
|
|
1734
|
-
module2.exports = __toCommonJS2(Tamagui_exports);
|
|
1735
|
-
var Helpers = __toESM2(require_index_native7()), import_config = require_config_native(), import_insertStyleRule = require_insertStyleRule_native(), import_useMedia = require_useMedia_native(), TamaguiManager = class {
|
|
1736
|
-
constructor() {
|
|
1737
|
-
this.Helpers = Helpers;
|
|
1738
|
-
}
|
|
1739
|
-
get mediaState() {
|
|
1740
|
-
return { ...import_useMedia.mediaState };
|
|
1741
|
-
}
|
|
1742
|
-
get config() {
|
|
1743
|
-
return (0, import_config.getConfig)();
|
|
1744
|
-
}
|
|
1745
|
-
get insertedRules() {
|
|
1746
|
-
return (0, import_insertStyleRule.getAllRules)();
|
|
1747
|
-
}
|
|
1748
|
-
get allSelectors() {
|
|
1749
|
-
return (0, import_insertStyleRule.getAllSelectors)();
|
|
1750
|
-
}
|
|
1751
|
-
get allTransforms() {
|
|
1752
|
-
return (0, import_insertStyleRule.getAllTransforms)();
|
|
1753
|
-
}
|
|
1754
|
-
get identifierToValue() {
|
|
1755
|
-
return identifierToValue;
|
|
1756
|
-
}
|
|
1757
|
-
}, Tamagui = new TamaguiManager(), identifierToValue = /* @__PURE__ */ new Map(), getValueFromIdentifier = (identifier) => identifierToValue.get(identifier), setIdentifierValue = (identifier, value) => {
|
|
1758
|
-
identifierToValue.set(identifier, value);
|
|
1759
|
-
};
|
|
1760
|
-
}
|
|
1761
|
-
});
|
|
1762
|
-
|
|
1763
|
-
// ../compose-refs/dist/cjs/compose-refs.native.js
|
|
1764
|
-
var require_compose_refs_native = __commonJS({
|
|
1765
|
-
"../compose-refs/dist/cjs/compose-refs.native.js"(exports2, module2) {
|
|
1706
|
+
// ../web/dist/cjs/helpers/createShallowSetState.native.js
|
|
1707
|
+
var require_createShallowSetState_native = __commonJS({
|
|
1708
|
+
"../web/dist/cjs/helpers/createShallowSetState.native.js"(exports2, module2) {
|
|
1766
1709
|
"use strict";
|
|
1767
|
-
var
|
|
1710
|
+
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
1768
1711
|
for (var name in all)
|
|
1769
1712
|
__defProp2(target, name, { get: all[name], enumerable: !0 });
|
|
1770
1713
|
}, __copyProps2 = (to, from, except, desc) => {
|
|
@@ -1772,47 +1715,28 @@ var require_compose_refs_native = __commonJS({
|
|
|
1772
1715
|
for (let key of __getOwnPropNames2(from))
|
|
1773
1716
|
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
1774
1717
|
return to;
|
|
1775
|
-
},
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", { value: mod, enumerable: !0 }) : target,
|
|
1781
|
-
mod
|
|
1782
|
-
)), __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), compose_refs_exports = {};
|
|
1783
|
-
__export2(compose_refs_exports, {
|
|
1784
|
-
composeRefs: () => composeRefs,
|
|
1785
|
-
useComposedRefs: () => useComposedRefs
|
|
1718
|
+
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), createShallowSetState_exports = {};
|
|
1719
|
+
__export2(createShallowSetState_exports, {
|
|
1720
|
+
createShallowSetState: () => createShallowSetState,
|
|
1721
|
+
isEqualShallow: () => isEqualShallow,
|
|
1722
|
+
mergeIfNotShallowEqual: () => mergeIfNotShallowEqual
|
|
1786
1723
|
});
|
|
1787
|
-
module2.exports = __toCommonJS2(
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
typeof ref == "function" ? ref(value) : ref && (ref.current = value);
|
|
1724
|
+
module2.exports = __toCommonJS2(createShallowSetState_exports);
|
|
1725
|
+
function createShallowSetState(setter, debug) {
|
|
1726
|
+
return (next) => setter((prev) => mergeIfNotShallowEqual(prev, next, debug));
|
|
1791
1727
|
}
|
|
1792
|
-
function
|
|
1793
|
-
return (
|
|
1728
|
+
function mergeIfNotShallowEqual(prev, next, debug) {
|
|
1729
|
+
return isEqualShallow(prev, next) ? prev : (process.env.NODE_ENV === "development" && debug && console.warn("setStateShallow CHANGE", { prev, next }), { ...prev, ...next });
|
|
1794
1730
|
}
|
|
1795
|
-
function
|
|
1796
|
-
|
|
1731
|
+
function isEqualShallow(prev, next) {
|
|
1732
|
+
for (let key in next)
|
|
1733
|
+
if (prev[key] !== next[key])
|
|
1734
|
+
return !1;
|
|
1735
|
+
return !0;
|
|
1797
1736
|
}
|
|
1798
1737
|
}
|
|
1799
1738
|
});
|
|
1800
1739
|
|
|
1801
|
-
// ../compose-refs/dist/cjs/index.native.js
|
|
1802
|
-
var require_index_native10 = __commonJS({
|
|
1803
|
-
"../compose-refs/dist/cjs/index.native.js"(exports2, module2) {
|
|
1804
|
-
"use strict";
|
|
1805
|
-
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __copyProps2 = (to, from, except, desc) => {
|
|
1806
|
-
if (from && typeof from == "object" || typeof from == "function")
|
|
1807
|
-
for (let key of __getOwnPropNames2(from))
|
|
1808
|
-
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
1809
|
-
return to;
|
|
1810
|
-
}, __reExport2 = (target, mod, secondTarget) => (__copyProps2(target, mod, "default"), secondTarget && __copyProps2(secondTarget, mod, "default")), __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), src_exports2 = {};
|
|
1811
|
-
module2.exports = __toCommonJS2(src_exports2);
|
|
1812
|
-
__reExport2(src_exports2, require_compose_refs_native(), module2.exports);
|
|
1813
|
-
}
|
|
1814
|
-
});
|
|
1815
|
-
|
|
1816
1740
|
// ../web/dist/cjs/constants/constants.native.js
|
|
1817
1741
|
var require_constants_native2 = __commonJS({
|
|
1818
1742
|
"../web/dist/cjs/constants/constants.native.js"(exports2, module2) {
|
|
@@ -1847,9 +1771,9 @@ var require_constants_native2 = __commonJS({
|
|
|
1847
1771
|
}
|
|
1848
1772
|
});
|
|
1849
1773
|
|
|
1850
|
-
// ../web/dist/cjs/helpers/
|
|
1851
|
-
var
|
|
1852
|
-
"../web/dist/cjs/helpers/
|
|
1774
|
+
// ../web/dist/cjs/helpers/ThemeManager.native.js
|
|
1775
|
+
var require_ThemeManager_native = __commonJS({
|
|
1776
|
+
"../web/dist/cjs/helpers/ThemeManager.native.js"(exports2, module2) {
|
|
1853
1777
|
"use strict";
|
|
1854
1778
|
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
1855
1779
|
for (var name in all)
|
|
@@ -1859,177 +1783,149 @@ var require_objectIdentityKey_native = __commonJS({
|
|
|
1859
1783
|
for (let key of __getOwnPropNames2(from))
|
|
1860
1784
|
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
1861
1785
|
return to;
|
|
1862
|
-
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod),
|
|
1863
|
-
__export2(
|
|
1864
|
-
|
|
1786
|
+
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), ThemeManager_exports = {};
|
|
1787
|
+
__export2(ThemeManager_exports, {
|
|
1788
|
+
ThemeManager: () => ThemeManager,
|
|
1789
|
+
getHasThemeUpdatingProps: () => getHasThemeUpdatingProps,
|
|
1790
|
+
getManagers: () => getManagers
|
|
1865
1791
|
});
|
|
1866
|
-
module2.exports = __toCommonJS2(
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
k += key;
|
|
1871
|
-
let arg = obj[key], type = typeof arg;
|
|
1872
|
-
if (!arg || type !== "object" && type !== "function")
|
|
1873
|
-
k += type + arg;
|
|
1874
|
-
else if (cache.has(arg))
|
|
1875
|
-
k += cache.get(arg);
|
|
1876
|
-
else {
|
|
1877
|
-
let v = Math.random();
|
|
1878
|
-
cache.set(arg, v), k += v;
|
|
1879
|
-
}
|
|
1880
|
-
}
|
|
1881
|
-
return k;
|
|
1792
|
+
module2.exports = __toCommonJS2(ThemeManager_exports);
|
|
1793
|
+
var import_constants4 = require_index_native(), import_config = require_config_native(), import_constants22 = require_constants_native2(), emptyState = { name: "" };
|
|
1794
|
+
function getHasThemeUpdatingProps(props) {
|
|
1795
|
+
return !!(props.name || props.componentName || props.inverse || props.reset);
|
|
1882
1796
|
}
|
|
1883
|
-
var
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
var require_createStyledContext_native = __commonJS({
|
|
1889
|
-
"../web/dist/cjs/helpers/createStyledContext.native.js"(exports2, module2) {
|
|
1890
|
-
"use strict";
|
|
1891
|
-
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
1892
|
-
for (var name in all)
|
|
1893
|
-
__defProp2(target, name, { get: all[name], enumerable: !0 });
|
|
1894
|
-
}, __copyProps2 = (to, from, except, desc) => {
|
|
1895
|
-
if (from && typeof from == "object" || typeof from == "function")
|
|
1896
|
-
for (let key of __getOwnPropNames2(from))
|
|
1897
|
-
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
1898
|
-
return to;
|
|
1899
|
-
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), createStyledContext_exports = {};
|
|
1900
|
-
__export2(createStyledContext_exports, {
|
|
1901
|
-
createStyledContext: () => createStyledContext2
|
|
1902
|
-
});
|
|
1903
|
-
module2.exports = __toCommonJS2(createStyledContext_exports);
|
|
1904
|
-
var import_react2 = require("react"), import_objectIdentityKey = require_objectIdentityKey_native(), import_jsx_runtime6 = require("react/jsx-runtime");
|
|
1905
|
-
function createStyledContext2(defaultValues) {
|
|
1906
|
-
let OGContext = (0, import_react2.createContext)(defaultValues), OGProvider2 = OGContext.Provider, Context = OGContext, scopedContexts = /* @__PURE__ */ new Map(), Provider = ({
|
|
1907
|
-
children,
|
|
1908
|
-
scope,
|
|
1909
|
-
...values
|
|
1910
|
-
}) => {
|
|
1911
|
-
let next = (0, import_react2.useMemo)(() => ({
|
|
1912
|
-
// this ! is a workaround for ts error
|
|
1913
|
-
...defaultValues,
|
|
1914
|
-
...values
|
|
1915
|
-
}), [(0, import_objectIdentityKey.objectIdentityKey)(values)]), Provider2 = OGProvider2;
|
|
1916
|
-
if (scope) {
|
|
1917
|
-
let ScopedContext = scopedContexts.get(scope);
|
|
1918
|
-
ScopedContext || (ScopedContext = (0, import_react2.createContext)(defaultValues), scopedContexts.set(scope, ScopedContext)), Provider2 = ScopedContext.Provider;
|
|
1797
|
+
var uid = 0, ThemeManager = class {
|
|
1798
|
+
constructor(props = {}, parentManager) {
|
|
1799
|
+
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") {
|
|
1800
|
+
this.updateStateFromProps(props, !1);
|
|
1801
|
+
return;
|
|
1919
1802
|
}
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
}
|
|
1927
|
-
}
|
|
1928
|
-
});
|
|
1929
|
-
|
|
1930
|
-
// ../web/dist/cjs/contexts/ComponentContext.native.js
|
|
1931
|
-
var require_ComponentContext_native = __commonJS({
|
|
1932
|
-
"../web/dist/cjs/contexts/ComponentContext.native.js"(exports2, module2) {
|
|
1933
|
-
"use strict";
|
|
1934
|
-
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
1935
|
-
for (var name in all)
|
|
1936
|
-
__defProp2(target, name, { get: all[name], enumerable: !0 });
|
|
1937
|
-
}, __copyProps2 = (to, from, except, desc) => {
|
|
1938
|
-
if (from && typeof from == "object" || typeof from == "function")
|
|
1939
|
-
for (let key of __getOwnPropNames2(from))
|
|
1940
|
-
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
1941
|
-
return to;
|
|
1942
|
-
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), ComponentContext_exports = {};
|
|
1943
|
-
__export2(ComponentContext_exports, {
|
|
1944
|
-
ComponentContext: () => ComponentContext2
|
|
1945
|
-
});
|
|
1946
|
-
module2.exports = __toCommonJS2(ComponentContext_exports);
|
|
1947
|
-
var import_createStyledContext = require_createStyledContext_native(), ComponentContext2 = (0, import_createStyledContext.createStyledContext)({
|
|
1948
|
-
disableSSR: void 0,
|
|
1949
|
-
inText: !1,
|
|
1950
|
-
language: null,
|
|
1951
|
-
animationDriver: null,
|
|
1952
|
-
groups: {
|
|
1953
|
-
emit: null,
|
|
1954
|
-
subscribe: null,
|
|
1955
|
-
state: {}
|
|
1803
|
+
if (!parentManager)
|
|
1804
|
+
throw process.env.NODE_ENV !== "production" ? new Error(
|
|
1805
|
+
"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."
|
|
1806
|
+
) : "\u274C 000";
|
|
1807
|
+
if (this.parentManager = parentManager, !this.updateStateFromProps(props, !1))
|
|
1808
|
+
return parentManager;
|
|
1956
1809
|
}
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
}
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
var
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
1810
|
+
updateStateFromProps(props = this.props || {}, shouldNotify = !0) {
|
|
1811
|
+
if (this.props = props, props.forceTheme)
|
|
1812
|
+
return this.state.theme = props.forceTheme, this.state.name = props.name || "", this.updateState(this.state, !0), this.state;
|
|
1813
|
+
let nextState = this.getStateIfChanged(props);
|
|
1814
|
+
if (nextState)
|
|
1815
|
+
return this.updateState(nextState, shouldNotify), nextState;
|
|
1816
|
+
}
|
|
1817
|
+
updateState(nextState, shouldNotify = !0) {
|
|
1818
|
+
this.state = nextState, this._allKeys = null, process.env.NODE_ENV !== "production" && (this._numChangeEventsSent ??= 0, this._numChangeEventsSent++), shouldNotify && this.notify();
|
|
1819
|
+
}
|
|
1820
|
+
getStateIfChanged(props = this.props, state = this.state, parentManager = this.parentManager) {
|
|
1821
|
+
let _ = this.getState(props, parentManager);
|
|
1822
|
+
if (state && state !== emptyState && !_)
|
|
1823
|
+
return parentManager == null ? void 0 : parentManager.state;
|
|
1824
|
+
if (this.getStateShouldChange(_, state))
|
|
1825
|
+
return _;
|
|
1826
|
+
}
|
|
1827
|
+
getStateShouldChange(nextState, state = this.state) {
|
|
1828
|
+
return !(!(nextState != null && nextState.theme) || nextState.theme === (state == null ? void 0 : state.theme));
|
|
1829
|
+
}
|
|
1830
|
+
getState(props = this.props, parentManager = this.parentManager) {
|
|
1831
|
+
return getState(props, parentManager) || (parentManager == null ? void 0 : parentManager.state) || null;
|
|
1832
|
+
}
|
|
1833
|
+
get allKeys() {
|
|
1834
|
+
var _a;
|
|
1835
|
+
return this._allKeys ||= /* @__PURE__ */ new Set([
|
|
1836
|
+
...((_a = this.parentManager) == null ? void 0 : _a.allKeys) || [],
|
|
1837
|
+
...Object.keys(this.state.theme || {})
|
|
1838
|
+
]), this._allKeys;
|
|
1839
|
+
}
|
|
1840
|
+
notify(forced = !1) {
|
|
1841
|
+
this.themeListeners.forEach((cb) => cb(this.state.name, this, forced));
|
|
1842
|
+
}
|
|
1843
|
+
onChangeTheme(cb, debugId) {
|
|
1844
|
+
return process.env.NODE_ENV !== "production" && debugId && (this._listeningIds ??= /* @__PURE__ */ new Set(), this._listeningIds.add(debugId)), this.themeListeners.add(cb), () => {
|
|
1845
|
+
this.themeListeners.delete(cb);
|
|
1846
|
+
};
|
|
1847
|
+
}
|
|
1848
|
+
};
|
|
1849
|
+
function getState(props, manager) {
|
|
1850
|
+
var _a;
|
|
1851
|
+
if (props.name && props.reset)
|
|
1852
|
+
throw new Error(
|
|
1853
|
+
process.env.NODE_ENV === "production" ? "\u274C004" : "Cannot reset and set a new name at the same time."
|
|
1854
|
+
);
|
|
1855
|
+
if (!getHasThemeUpdatingProps(props))
|
|
1856
|
+
return null;
|
|
1857
|
+
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];
|
|
1858
|
+
if (!baseManager && props.reset)
|
|
1859
|
+
return process.env.NODE_ENV !== "production" && console.warn("Cannot reset, no parent theme exists"), null;
|
|
1860
|
+
let { componentName } = props, result = null, baseName = (baseManager == null ? void 0 : baseManager.state.name) || "";
|
|
1861
|
+
baseManager != null && baseManager.state.isComponent && (baseName = baseName.replace(/_[A-Z][A-Za-z]+/, ""));
|
|
1862
|
+
let nextName = props.reset ? baseName : props.name || "", allComponentThemes = componentManagers.map((x) => (x == null ? void 0 : x.state.name) || "");
|
|
1863
|
+
isDirectParentAComponentTheme && allComponentThemes.shift();
|
|
1864
|
+
let base = baseName.split(import_constants22.THEME_NAME_SEPARATOR), max2 = base.length, min2 = props.componentName && !nextName ? max2 : 0;
|
|
1865
|
+
for (let i = max2; i >= min2; i--) {
|
|
1866
|
+
let prefix = base.slice(0, i).join(import_constants22.THEME_NAME_SEPARATOR);
|
|
1867
|
+
props.inverse && (prefix = inverseThemeName(prefix));
|
|
1868
|
+
let potentials = [];
|
|
1869
|
+
if (prefix && prefix !== baseName && potentials.push(prefix), nextName && potentials.unshift(prefix ? `${prefix}_${nextName}` : nextName), i === 1) {
|
|
1870
|
+
let lastSegment = potentials.findIndex((x) => !x.includes("_"));
|
|
1871
|
+
lastSegment > 0 && potentials.splice(lastSegment, 0, nextName);
|
|
1872
|
+
}
|
|
1873
|
+
if (componentName && !props.reset) {
|
|
1874
|
+
let baseLen = base.length, componentPotentials = [];
|
|
1875
|
+
if (nextName && baseLen > 1) {
|
|
1876
|
+
let beforeSeparator = base[0];
|
|
1877
|
+
componentPotentials.push(`${beforeSeparator}_${nextName}_${componentName}`);
|
|
1878
|
+
}
|
|
1879
|
+
if (componentPotentials.push(`${prefix}_${componentName}`), nextName) {
|
|
1880
|
+
if (i > baseLen) {
|
|
1881
|
+
let prefixLessOne = base.slice(0, i - 1).join(import_constants22.THEME_NAME_SEPARATOR);
|
|
1882
|
+
if (prefixLessOne) {
|
|
1883
|
+
let lessSpecific = `${prefixLessOne}_${nextName}_${componentName}`;
|
|
1884
|
+
componentPotentials.unshift(lessSpecific);
|
|
1885
|
+
}
|
|
1886
|
+
}
|
|
1887
|
+
let moreSpecific = `${prefix}_${nextName}_${componentName}`;
|
|
1888
|
+
componentPotentials.unshift(moreSpecific);
|
|
1889
|
+
}
|
|
1890
|
+
potentials = [...componentPotentials, ...potentials, ...allComponentThemes];
|
|
1891
|
+
}
|
|
1892
|
+
let found = potentials.find((t) => t in themes);
|
|
1893
|
+
if (process.env.NODE_ENV !== "production" && typeof props.debug == "string" && console.info(" getState ", {
|
|
1894
|
+
props,
|
|
1895
|
+
found,
|
|
1896
|
+
potentials,
|
|
1897
|
+
baseManager,
|
|
1898
|
+
nextName,
|
|
1899
|
+
baseName,
|
|
1900
|
+
prefix
|
|
1901
|
+
}), found) {
|
|
1902
|
+
let names = found.split("_"), [firstName, ...restNames] = names, lastName = names[names.length - 1], isComponent = lastName[0] === lastName[0].toUpperCase(), scheme = firstName === "light" ? "light" : firstName === "dark" ? "dark" : void 0, pre = import_constants22.THEME_CLASSNAME_PREFIX, className = import_constants4.isWeb ? `${pre}sub_theme ${pre}${!scheme || !restNames.length ? firstName : restNames.join("_")}` : "", parentState = (_a = baseManager || parentManager) == null ? void 0 : _a.state, parentName = parentState == null ? void 0 : parentState.name;
|
|
1903
|
+
result = {
|
|
1904
|
+
name: found,
|
|
1905
|
+
parentName,
|
|
1906
|
+
theme: themes[found],
|
|
1907
|
+
className,
|
|
1908
|
+
isComponent,
|
|
1909
|
+
scheme
|
|
1910
|
+
};
|
|
1911
|
+
break;
|
|
1912
|
+
}
|
|
1913
|
+
}
|
|
1914
|
+
return process.env.NODE_ENV !== "production" && props.debug === "verbose" && typeof window < "u" && (console.groupCollapsed("ThemeManager.getState()"), console.info({ props, baseName, base, min: min2, max: max2 }), console.warn("result", { result }), console.trace(), console.groupEnd()), result;
|
|
2020
1915
|
}
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
1916
|
+
var inverseThemeName = (themeName) => themeName.startsWith("light") ? themeName.replace(/^light/, "dark") : themeName.replace(/^dark/, "light");
|
|
1917
|
+
function getManagers(themeManager) {
|
|
1918
|
+
let comp = [], all = [], cur = themeManager;
|
|
1919
|
+
for (; cur; )
|
|
1920
|
+
all.push(cur), cur.state.isComponent && comp.push(cur), cur = cur.parentManager;
|
|
1921
|
+
return [all, comp];
|
|
2026
1922
|
}
|
|
2027
1923
|
}
|
|
2028
1924
|
});
|
|
2029
1925
|
|
|
2030
|
-
// ../web/dist/cjs/
|
|
2031
|
-
var
|
|
2032
|
-
"../web/dist/cjs/
|
|
1926
|
+
// ../web/dist/cjs/helpers/ThemeManagerContext.native.js
|
|
1927
|
+
var require_ThemeManagerContext_native = __commonJS({
|
|
1928
|
+
"../web/dist/cjs/helpers/ThemeManagerContext.native.js"(exports2, module2) {
|
|
2033
1929
|
"use strict";
|
|
2034
1930
|
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
2035
1931
|
for (var name in all)
|
|
@@ -2039,72 +1935,18 @@ var require_accessibilityDirectMap_native = __commonJS({
|
|
|
2039
1935
|
for (let key of __getOwnPropNames2(from))
|
|
2040
1936
|
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
2041
1937
|
return to;
|
|
2042
|
-
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod),
|
|
2043
|
-
__export2(
|
|
2044
|
-
|
|
2045
|
-
accessibilityWebRoleToNativeRole: () => accessibilityWebRoleToNativeRole,
|
|
2046
|
-
nativeAccessibilityState: () => nativeAccessibilityState,
|
|
2047
|
-
nativeAccessibilityValue: () => nativeAccessibilityValue,
|
|
2048
|
-
webToNativeAccessibilityDirectMap: () => webToNativeAccessibilityDirectMap
|
|
1938
|
+
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), ThemeManagerContext_exports = {};
|
|
1939
|
+
__export2(ThemeManagerContext_exports, {
|
|
1940
|
+
ThemeManagerIDContext: () => ThemeManagerIDContext
|
|
2049
1941
|
});
|
|
2050
|
-
module2.exports = __toCommonJS2(
|
|
2051
|
-
var
|
|
2052
|
-
"aria-label": "accessibilityLabel",
|
|
2053
|
-
"aria-labelledby": "accessibilityLabelledBy",
|
|
2054
|
-
"aria-live": "accessibilityLiveRegion",
|
|
2055
|
-
"aria-modal": "accessibilityViewIsModal",
|
|
2056
|
-
"aria-hidden": "accessibilityElementsHidden"
|
|
2057
|
-
}, nativeAccessibilityValue = {
|
|
2058
|
-
"aria-valuemin": "min",
|
|
2059
|
-
"aria-valuemax": "max",
|
|
2060
|
-
"aria-valuenow": "now",
|
|
2061
|
-
"aria-valuetext": "text"
|
|
2062
|
-
}, nativeAccessibilityState = {
|
|
2063
|
-
"aria-disabled": "disabled",
|
|
2064
|
-
"aria-selected": "selected",
|
|
2065
|
-
"aria-checked": "checked",
|
|
2066
|
-
"aria-busy": "busy",
|
|
2067
|
-
"aria-expanded": "expanded"
|
|
2068
|
-
}, accessibilityWebRoleToNativeRole = {
|
|
2069
|
-
alert: "alert",
|
|
2070
|
-
button: "button",
|
|
2071
|
-
checkbox: "checkbox",
|
|
2072
|
-
combobox: "combobox",
|
|
2073
|
-
grid: "grid",
|
|
2074
|
-
group: "none",
|
|
2075
|
-
heading: "header",
|
|
2076
|
-
imagebutton: "imagebutton",
|
|
2077
|
-
img: "image",
|
|
2078
|
-
keyboardkey: "keyboardkey",
|
|
2079
|
-
link: "link",
|
|
2080
|
-
menu: "menu",
|
|
2081
|
-
menubar: "menubar",
|
|
2082
|
-
menuitem: "menuitem",
|
|
2083
|
-
none: "none",
|
|
2084
|
-
presentation: "none",
|
|
2085
|
-
progressbar: "progressbar",
|
|
2086
|
-
radio: "radio",
|
|
2087
|
-
radiogroup: "radiogroup",
|
|
2088
|
-
region: "summary",
|
|
2089
|
-
scrollbar: "scrollbar",
|
|
2090
|
-
searchbox: "search",
|
|
2091
|
-
slider: "adjustable",
|
|
2092
|
-
spinbutton: "spinbutton",
|
|
2093
|
-
summary: "summary",
|
|
2094
|
-
switch: "switch",
|
|
2095
|
-
tab: "tab",
|
|
2096
|
-
tablist: "tablist",
|
|
2097
|
-
text: "text",
|
|
2098
|
-
timer: "timer",
|
|
2099
|
-
togglebutton: "togglebutton",
|
|
2100
|
-
toolbar: "toolbar"
|
|
2101
|
-
};
|
|
1942
|
+
module2.exports = __toCommonJS2(ThemeManagerContext_exports);
|
|
1943
|
+
var import_react2 = require("react"), ThemeManagerIDContext = (0, import_react2.createContext)(1);
|
|
2102
1944
|
}
|
|
2103
1945
|
});
|
|
2104
1946
|
|
|
2105
|
-
// ../web/dist/cjs/
|
|
2106
|
-
var
|
|
2107
|
-
"../web/dist/cjs/
|
|
1947
|
+
// ../web/dist/cjs/hooks/useTheme.native.js
|
|
1948
|
+
var require_useTheme_native = __commonJS({
|
|
1949
|
+
"../web/dist/cjs/hooks/useTheme.native.js"(exports2, module2) {
|
|
2108
1950
|
"use strict";
|
|
2109
1951
|
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
2110
1952
|
for (var name in all)
|
|
@@ -2114,27 +1956,260 @@ var require_isDevTools_native = __commonJS({
|
|
|
2114
1956
|
for (let key of __getOwnPropNames2(from))
|
|
2115
1957
|
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
2116
1958
|
return to;
|
|
2117
|
-
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod),
|
|
2118
|
-
__export2(
|
|
2119
|
-
|
|
1959
|
+
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), useTheme_exports = {};
|
|
1960
|
+
__export2(useTheme_exports, {
|
|
1961
|
+
activeThemeManagers: () => activeThemeManagers,
|
|
1962
|
+
getThemeManager: () => getThemeManager,
|
|
1963
|
+
getThemeProxied: () => getThemeProxied,
|
|
1964
|
+
useChangeThemeEffect: () => useChangeThemeEffect,
|
|
1965
|
+
useTheme: () => useTheme4,
|
|
1966
|
+
useThemeWithState: () => useThemeWithState
|
|
2120
1967
|
});
|
|
2121
|
-
module2.exports = __toCommonJS2(
|
|
2122
|
-
var
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
1968
|
+
module2.exports = __toCommonJS2(useTheme_exports);
|
|
1969
|
+
var import_constants4 = require_index_native(), import_react2 = require("react"), import_config = require_config_native(), import_createVariable = require_createVariable_native(), import_createShallowSetState = require_createShallowSetState_native(), import_ThemeManager = require_ThemeManager_native(), import_ThemeManagerContext = require_ThemeManagerContext_native(), emptyProps = { name: null }, cached;
|
|
1970
|
+
function getDefaultThemeProxied() {
|
|
1971
|
+
if (cached)
|
|
1972
|
+
return cached;
|
|
1973
|
+
let config = (0, import_config.getConfig)(), name = config.themes.light ? "light" : Object.keys(config.themes)[0], defaultTheme = config.themes[name];
|
|
1974
|
+
return cached = getThemeProxied({ theme: defaultTheme, name }), cached;
|
|
1975
|
+
}
|
|
1976
|
+
var useTheme4 = (props = emptyProps) => {
|
|
1977
|
+
let [_, theme] = useThemeWithState(props);
|
|
1978
|
+
return theme || getDefaultThemeProxied();
|
|
1979
|
+
}, useThemeWithState = (props) => {
|
|
1980
|
+
let keys = (0, import_react2.useRef)([]), changedThemeState = useChangeThemeEffect(
|
|
1981
|
+
props,
|
|
1982
|
+
!1,
|
|
1983
|
+
keys.current,
|
|
1984
|
+
import_constants4.isServer ? void 0 : () => {
|
|
1985
|
+
var _a, _b;
|
|
1986
|
+
let next = ((_a = props.shouldUpdate) == null ? void 0 : _a.call(props)) ?? (keys.current.length > 0 ? !0 : void 0);
|
|
1987
|
+
return process.env.NODE_ENV === "development" && typeof props.debug == "string" && props.debug !== "profile" && console.info(" \u{1F3A8} useTheme() shouldUpdate?", next, {
|
|
1988
|
+
shouldUpdateProp: (_b = props.shouldUpdate) == null ? void 0 : _b.call(props),
|
|
1989
|
+
keys: [...keys.current]
|
|
1990
|
+
}), next;
|
|
2127
1991
|
}
|
|
1992
|
+
), { themeManager, state } = changedThemeState;
|
|
1993
|
+
process.env.NODE_ENV === "development" && (state != null && state.theme || process.env.TAMAGUI_DISABLE_NO_THEME_WARNING !== "1" && console.warn(
|
|
1994
|
+
`[tamagui] No theme found, this could be due to an invalid theme name (given theme props ${JSON.stringify(
|
|
1995
|
+
props
|
|
1996
|
+
)}).
|
|
1997
|
+
|
|
1998
|
+
If this is intended and you are using Tamagui without any themes, you can disable this warning by setting the environment variable TAMAGUI_DISABLE_NO_THEME_WARNING=1`
|
|
1999
|
+
));
|
|
2000
|
+
let themeProxied = (0, import_react2.useMemo)(() => !themeManager || !(state != null && state.theme) ? {} : getThemeProxied(state, props.deopt, themeManager, keys.current, props.debug), [state == null ? void 0 : state.theme, themeManager, props.deopt, props.debug]);
|
|
2001
|
+
return process.env.NODE_ENV === "development" && props.debug === "verbose" && (console.groupCollapsed(" \u{1F539} useTheme =>", state == null ? void 0 : state.name), console.info("returning state", changedThemeState, "from props", props), console.groupEnd()), [changedThemeState, themeProxied];
|
|
2002
|
+
};
|
|
2003
|
+
function getThemeProxied({ theme, name, scheme }, deopt = !1, themeManager, keys, debug) {
|
|
2004
|
+
if (!theme)
|
|
2005
|
+
return {};
|
|
2006
|
+
let config = (0, import_config.getConfig)();
|
|
2007
|
+
function track(key) {
|
|
2008
|
+
keys && !keys.includes(key) && (keys.push(key), process.env.NODE_ENV === "development" && debug && console.info(` \u{1F3A8} useTheme() tracking new key: ${key}`));
|
|
2009
|
+
}
|
|
2010
|
+
return new Proxy(theme, {
|
|
2011
|
+
has(_, key) {
|
|
2012
|
+
if (Reflect.has(theme, key))
|
|
2013
|
+
return !0;
|
|
2014
|
+
if (typeof key == "string")
|
|
2015
|
+
return key[0] === "$" && (key = key.slice(1)), themeManager == null ? void 0 : themeManager.allKeys.has(key);
|
|
2016
|
+
},
|
|
2017
|
+
get(_, key) {
|
|
2018
|
+
if (
|
|
2019
|
+
// dont ask me, idk why but on hermes you can see that useTheme()[undefined] passes in STRING undefined to proxy
|
|
2020
|
+
// if someone is crazy enough to use "undefined" as a theme key then this not working is on them
|
|
2021
|
+
key !== "undefined" && typeof key == "string"
|
|
2022
|
+
) {
|
|
2023
|
+
let keyString = key[0] === "$" ? key.slice(1) : key, val = theme[keyString];
|
|
2024
|
+
if (val && typeof val == "object")
|
|
2025
|
+
return new Proxy(val, {
|
|
2026
|
+
// when they touch the actual value we only track it
|
|
2027
|
+
// if its a variable (web), its ignored!
|
|
2028
|
+
get(_2, subkey) {
|
|
2029
|
+
if (subkey === "val")
|
|
2030
|
+
track(keyString);
|
|
2031
|
+
else if (subkey === "get")
|
|
2032
|
+
return (platform) => {
|
|
2033
|
+
let outVal = (0, import_createVariable.getVariable)(val);
|
|
2034
|
+
if (platform !== "web" && import_constants4.isIos && !deopt && config.settings.fastSchemeChange && !someParentIsInversed(themeManager) && scheme) {
|
|
2035
|
+
let oppositeThemeName = name.replace(
|
|
2036
|
+
scheme === "dark" ? "dark" : "light",
|
|
2037
|
+
scheme === "dark" ? "light" : "dark"
|
|
2038
|
+
), oppositeTheme = config.themes[oppositeThemeName], oppositeVal = (0, import_createVariable.getVariable)(oppositeTheme == null ? void 0 : oppositeTheme[keyString]);
|
|
2039
|
+
if (oppositeVal)
|
|
2040
|
+
return {
|
|
2041
|
+
dynamic: {
|
|
2042
|
+
dark: scheme === "dark" ? outVal : oppositeVal,
|
|
2043
|
+
light: scheme === "light" ? outVal : oppositeVal
|
|
2044
|
+
}
|
|
2045
|
+
};
|
|
2046
|
+
}
|
|
2047
|
+
return track(keyString), outVal;
|
|
2048
|
+
};
|
|
2049
|
+
return Reflect.get(val, subkey);
|
|
2050
|
+
}
|
|
2051
|
+
});
|
|
2052
|
+
if (process.env.NODE_ENV === "development" && process.env.TAMAGUI_FEAT_THROW_ON_MISSING_THEME_VALUE === "1")
|
|
2053
|
+
throw new Error(
|
|
2054
|
+
`[tamagui] No theme key "${key}" found in theme ${name}.
|
|
2055
|
+
Keys in theme: ${Object.keys(
|
|
2056
|
+
theme
|
|
2057
|
+
).join(", ")}`
|
|
2058
|
+
);
|
|
2059
|
+
}
|
|
2060
|
+
return Reflect.get(_, key);
|
|
2061
|
+
}
|
|
2062
|
+
});
|
|
2063
|
+
}
|
|
2064
|
+
function someParentIsInversed(manager) {
|
|
2065
|
+
{
|
|
2066
|
+
let cur = manager;
|
|
2067
|
+
for (; cur; ) {
|
|
2068
|
+
if (!cur.parentManager)
|
|
2069
|
+
return !1;
|
|
2070
|
+
if (cur.parentManager.state.scheme !== cur.state.scheme)
|
|
2071
|
+
return !0;
|
|
2072
|
+
cur = cur.parentManager;
|
|
2073
|
+
}
|
|
2074
|
+
}
|
|
2128
2075
|
return !1;
|
|
2129
|
-
}
|
|
2076
|
+
}
|
|
2077
|
+
var activeThemeManagers = /* @__PURE__ */ new Set(), _uidToManager = /* @__PURE__ */ new WeakMap(), _idToUID = {}, getId = (id) => _idToUID[id], getThemeManager = (id) => _uidToManager.get(getId(id)), registerThemeManager = (t) => {
|
|
2078
|
+
if (!_idToUID[t.id]) {
|
|
2079
|
+
let id = _idToUID[t.id] = {};
|
|
2080
|
+
_uidToManager.set(id, t);
|
|
2081
|
+
}
|
|
2082
|
+
}, useChangeThemeEffect = (props, isRoot = !1, keys, shouldUpdate) => {
|
|
2083
|
+
let { disable } = props, parentManagerId = (0, import_react2.useContext)(import_ThemeManagerContext.ThemeManagerIDContext), parentManager = getThemeManager(parentManagerId);
|
|
2084
|
+
if (!isRoot && !parentManager || disable)
|
|
2085
|
+
return {
|
|
2086
|
+
isNewTheme: !1,
|
|
2087
|
+
state: parentManager == null ? void 0 : parentManager.state,
|
|
2088
|
+
themeManager: parentManager
|
|
2089
|
+
};
|
|
2090
|
+
let [themeState, setThemeState] = (0, import_react2.useState)(createState), { state, mounted, isNewTheme, themeManager, inversed } = themeState, isInversingOnMount = !!(!themeState.mounted && props.inverse);
|
|
2091
|
+
function getShouldUpdateTheme(manager = themeManager, nextState, prevState = state, forceShouldChange = !1) {
|
|
2092
|
+
let forceUpdate = shouldUpdate == null ? void 0 : shouldUpdate();
|
|
2093
|
+
if (!manager || !forceShouldChange && forceUpdate === !1)
|
|
2094
|
+
return;
|
|
2095
|
+
let next = nextState || manager.getState(props, parentManager);
|
|
2096
|
+
if (forceShouldChange || next && !(forceUpdate !== !0 && !manager.getStateShouldChange(next, prevState)))
|
|
2097
|
+
return next;
|
|
2098
|
+
}
|
|
2099
|
+
if (import_constants4.isServer || ((0, import_react2.useEffect)(() => {
|
|
2100
|
+
if (!themeManager)
|
|
2101
|
+
return;
|
|
2102
|
+
if (props.inverse && !mounted) {
|
|
2103
|
+
setThemeState((prev) => createState({
|
|
2104
|
+
...prev,
|
|
2105
|
+
mounted: !0
|
|
2106
|
+
}));
|
|
2107
|
+
return;
|
|
2108
|
+
}
|
|
2109
|
+
(isNewTheme || getShouldUpdateTheme(themeManager)) && (activeThemeManagers.add(themeManager), setThemeState(createState));
|
|
2110
|
+
let selfListenerDispose = themeManager.onChangeTheme((_a, _b, forced) => {
|
|
2111
|
+
forced && setThemeState((prev) => createState(prev, !0));
|
|
2112
|
+
}), disposeChangeListener = parentManager == null ? void 0 : parentManager.onChangeTheme(
|
|
2113
|
+
(name, manager, forced) => {
|
|
2114
|
+
let force = forced || (shouldUpdate == null ? void 0 : shouldUpdate()) || props.deopt || props["disable-child-theme"], shouldTryUpdate = force ?? !!(keys != null && keys.length || isNewTheme);
|
|
2115
|
+
process.env.NODE_ENV === "development" && props.debug === "verbose" && console.info(" \u{1F538} onChange", themeManager.id, {
|
|
2116
|
+
force,
|
|
2117
|
+
shouldTryUpdate,
|
|
2118
|
+
props,
|
|
2119
|
+
name,
|
|
2120
|
+
manager,
|
|
2121
|
+
keys
|
|
2122
|
+
}), shouldTryUpdate && setThemeState((prev) => createState(prev, force));
|
|
2123
|
+
},
|
|
2124
|
+
themeManager.id
|
|
2125
|
+
);
|
|
2126
|
+
return () => {
|
|
2127
|
+
selfListenerDispose(), disposeChangeListener == null || disposeChangeListener(), isNewTheme && activeThemeManagers.delete(themeManager);
|
|
2128
|
+
};
|
|
2129
|
+
}, [
|
|
2130
|
+
themeManager,
|
|
2131
|
+
parentManager,
|
|
2132
|
+
isNewTheme,
|
|
2133
|
+
props.componentName,
|
|
2134
|
+
props.inverse,
|
|
2135
|
+
props.name,
|
|
2136
|
+
props.reset,
|
|
2137
|
+
mounted
|
|
2138
|
+
]), process.env.NODE_ENV === "development" && props.debug !== "profile" && (0, import_react2.useEffect)(() => (globalThis.TamaguiThemeManagers ??= /* @__PURE__ */ new Set(), globalThis.TamaguiThemeManagers.add(themeManager), () => {
|
|
2139
|
+
globalThis.TamaguiThemeManagers.delete(themeManager);
|
|
2140
|
+
}), [themeManager])), isInversingOnMount)
|
|
2141
|
+
return {
|
|
2142
|
+
isNewTheme: !1,
|
|
2143
|
+
inversed: !1,
|
|
2144
|
+
themeManager: parentManager,
|
|
2145
|
+
state: {
|
|
2146
|
+
name: "",
|
|
2147
|
+
...parentManager == null ? void 0 : parentManager.state,
|
|
2148
|
+
className: ""
|
|
2149
|
+
}
|
|
2150
|
+
};
|
|
2151
|
+
return {
|
|
2152
|
+
state,
|
|
2153
|
+
isNewTheme,
|
|
2154
|
+
inversed,
|
|
2155
|
+
themeManager
|
|
2156
|
+
};
|
|
2157
|
+
function createState(prev, force = !1) {
|
|
2158
|
+
if (prev && (shouldUpdate == null ? void 0 : shouldUpdate()) === !1 && !force)
|
|
2159
|
+
return prev;
|
|
2160
|
+
let themeManager2 = parentManager, state2;
|
|
2161
|
+
if ((0, import_ThemeManager.getHasThemeUpdatingProps)(props)) {
|
|
2162
|
+
let getNewThemeManager = () => new import_ThemeManager.ThemeManager(props, isRoot ? "root" : parentManager);
|
|
2163
|
+
if (prev != null && prev.themeManager) {
|
|
2164
|
+
themeManager2 = prev.themeManager;
|
|
2165
|
+
let forceChange = force || !!(keys != null && keys.length), next = themeManager2.getState(props, parentManager), nextState = getShouldUpdateTheme(
|
|
2166
|
+
themeManager2,
|
|
2167
|
+
next,
|
|
2168
|
+
prev.state,
|
|
2169
|
+
forceChange
|
|
2170
|
+
);
|
|
2171
|
+
nextState ? (state2 = nextState, prev.isNewTheme ? themeManager2.updateState(nextState) : themeManager2 = getNewThemeManager()) : prev.isNewTheme && parentManager && !next && (themeManager2 = parentManager);
|
|
2172
|
+
} else
|
|
2173
|
+
themeManager2 = getNewThemeManager(), state2 = { ...themeManager2.state };
|
|
2174
|
+
}
|
|
2175
|
+
let isNewTheme2 = !!(themeManager2 !== parentManager || props.inverse);
|
|
2176
|
+
isNewTheme2 && registerThemeManager(themeManager2);
|
|
2177
|
+
let mounted2 = props.inverse ? isRoot || (prev == null ? void 0 : prev.mounted) : !0;
|
|
2178
|
+
state2 || (isNewTheme2 ? state2 = themeManager2.state : (state2 = parentManager.state, themeManager2 = parentManager));
|
|
2179
|
+
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 = {
|
|
2180
|
+
themeManager: themeManager2,
|
|
2181
|
+
isNewTheme: isNewTheme2,
|
|
2182
|
+
mounted: mounted2,
|
|
2183
|
+
inversed: inversed2
|
|
2184
|
+
}, shouldReturnPrev = prev && !force && // isEqualShallow uses the second arg as the keys so this should compare without state first...
|
|
2185
|
+
(0, import_createShallowSetState.isEqualShallow)(prev, response) && // ... and then compare just the state, because we make a new state obj but is likely the same
|
|
2186
|
+
(0, import_createShallowSetState.isEqualShallow)(prev.state, state2);
|
|
2187
|
+
if (prev && shouldReturnPrev)
|
|
2188
|
+
return prev;
|
|
2189
|
+
if (response.state = state2, process.env.NODE_ENV === "development" && props.debug && import_constants4.isClient) {
|
|
2190
|
+
console.groupCollapsed(` \u{1F537} ${themeManager2.id} useChangeThemeEffect createState`);
|
|
2191
|
+
let parentState = { ...parentManager == null ? void 0 : parentManager.state }, parentId = parentManager == null ? void 0 : parentManager.id, themeManagerState = { ...themeManager2.state };
|
|
2192
|
+
console.info({
|
|
2193
|
+
props,
|
|
2194
|
+
parentState,
|
|
2195
|
+
parentId,
|
|
2196
|
+
themeManager: themeManager2,
|
|
2197
|
+
prev,
|
|
2198
|
+
response,
|
|
2199
|
+
themeManagerState
|
|
2200
|
+
}), console.groupEnd();
|
|
2201
|
+
}
|
|
2202
|
+
return response;
|
|
2203
|
+
}
|
|
2204
|
+
};
|
|
2130
2205
|
}
|
|
2131
2206
|
});
|
|
2132
2207
|
|
|
2133
|
-
// ../web/dist/cjs/
|
|
2134
|
-
var
|
|
2135
|
-
"../web/dist/cjs/
|
|
2208
|
+
// ../web/dist/cjs/Tamagui.native.js
|
|
2209
|
+
var require_Tamagui_native = __commonJS({
|
|
2210
|
+
"../web/dist/cjs/Tamagui.native.js"(exports2, module2) {
|
|
2136
2211
|
"use strict";
|
|
2137
|
-
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
2212
|
+
var __create2 = Object.create, __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __getProtoOf2 = Object.getPrototypeOf, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
2138
2213
|
for (var name in all)
|
|
2139
2214
|
__defProp2(target, name, { get: all[name], enumerable: !0 });
|
|
2140
2215
|
}, __copyProps2 = (to, from, except, desc) => {
|
|
@@ -2142,22 +2217,112 @@ var require_getGroupPropParts_native = __commonJS({
|
|
|
2142
2217
|
for (let key of __getOwnPropNames2(from))
|
|
2143
2218
|
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
2144
2219
|
return to;
|
|
2145
|
-
},
|
|
2146
|
-
|
|
2147
|
-
|
|
2220
|
+
}, __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps2(
|
|
2221
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
2222
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
2223
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
2224
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
2225
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", { value: mod, enumerable: !0 }) : target,
|
|
2226
|
+
mod
|
|
2227
|
+
)), __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), Tamagui_exports = {};
|
|
2228
|
+
__export2(Tamagui_exports, {
|
|
2229
|
+
Tamagui: () => Tamagui,
|
|
2230
|
+
getValueFromIdentifier: () => getValueFromIdentifier,
|
|
2231
|
+
setIdentifierValue: () => setIdentifierValue
|
|
2148
2232
|
});
|
|
2149
|
-
module2.exports = __toCommonJS2(
|
|
2150
|
-
var import_useMedia = require_useMedia_native()
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2233
|
+
module2.exports = __toCommonJS2(Tamagui_exports);
|
|
2234
|
+
var Helpers = __toESM2(require_index_native7()), import_config = require_config_native(), import_insertStyleRule = require_insertStyleRule_native(), import_useMedia = require_useMedia_native(), import_useTheme = require_useTheme_native(), Tamagui = (() => {
|
|
2235
|
+
if (process.env.NODE_ENV === "development") {
|
|
2236
|
+
class TamaguiManager {
|
|
2237
|
+
constructor() {
|
|
2238
|
+
this.Helpers = Helpers, this.getThemeManager = import_useTheme.getThemeManager;
|
|
2239
|
+
}
|
|
2240
|
+
get activeThemeManagers() {
|
|
2241
|
+
return import_useTheme.activeThemeManagers;
|
|
2242
|
+
}
|
|
2243
|
+
get mediaState() {
|
|
2244
|
+
return { ...import_useMedia.mediaState };
|
|
2245
|
+
}
|
|
2246
|
+
get config() {
|
|
2247
|
+
return (0, import_config.getConfig)();
|
|
2248
|
+
}
|
|
2249
|
+
get insertedRules() {
|
|
2250
|
+
return (0, import_insertStyleRule.getAllRules)();
|
|
2251
|
+
}
|
|
2252
|
+
get allSelectors() {
|
|
2253
|
+
return (0, import_insertStyleRule.getAllSelectors)();
|
|
2254
|
+
}
|
|
2255
|
+
get allTransforms() {
|
|
2256
|
+
return (0, import_insertStyleRule.getAllTransforms)();
|
|
2257
|
+
}
|
|
2258
|
+
get identifierToValue() {
|
|
2259
|
+
return identifierToValue;
|
|
2260
|
+
}
|
|
2261
|
+
}
|
|
2262
|
+
return new TamaguiManager();
|
|
2263
|
+
}
|
|
2264
|
+
})(), identifierToValue = /* @__PURE__ */ new Map(), getValueFromIdentifier = (identifier) => identifierToValue.get(identifier), setIdentifierValue = (identifier, value) => {
|
|
2265
|
+
identifierToValue.set(identifier, value);
|
|
2266
|
+
};
|
|
2155
2267
|
}
|
|
2156
2268
|
});
|
|
2157
2269
|
|
|
2158
|
-
// ../
|
|
2159
|
-
var
|
|
2160
|
-
"../
|
|
2270
|
+
// ../compose-refs/dist/cjs/compose-refs.native.js
|
|
2271
|
+
var require_compose_refs_native = __commonJS({
|
|
2272
|
+
"../compose-refs/dist/cjs/compose-refs.native.js"(exports2, module2) {
|
|
2273
|
+
"use strict";
|
|
2274
|
+
var __create2 = Object.create, __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __getProtoOf2 = Object.getPrototypeOf, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
2275
|
+
for (var name in all)
|
|
2276
|
+
__defProp2(target, name, { get: all[name], enumerable: !0 });
|
|
2277
|
+
}, __copyProps2 = (to, from, except, desc) => {
|
|
2278
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
2279
|
+
for (let key of __getOwnPropNames2(from))
|
|
2280
|
+
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
2281
|
+
return to;
|
|
2282
|
+
}, __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps2(
|
|
2283
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
2284
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
2285
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
2286
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
2287
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", { value: mod, enumerable: !0 }) : target,
|
|
2288
|
+
mod
|
|
2289
|
+
)), __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), compose_refs_exports = {};
|
|
2290
|
+
__export2(compose_refs_exports, {
|
|
2291
|
+
composeRefs: () => composeRefs,
|
|
2292
|
+
useComposedRefs: () => useComposedRefs
|
|
2293
|
+
});
|
|
2294
|
+
module2.exports = __toCommonJS2(compose_refs_exports);
|
|
2295
|
+
var React2 = __toESM2(require("react"));
|
|
2296
|
+
function setRef(ref, value) {
|
|
2297
|
+
typeof ref == "function" ? ref(value) : ref && (ref.current = value);
|
|
2298
|
+
}
|
|
2299
|
+
function composeRefs(...refs) {
|
|
2300
|
+
return (node) => refs.forEach((ref) => setRef(ref, node));
|
|
2301
|
+
}
|
|
2302
|
+
function useComposedRefs(...refs) {
|
|
2303
|
+
return React2.useCallback(composeRefs(...refs), refs);
|
|
2304
|
+
}
|
|
2305
|
+
}
|
|
2306
|
+
});
|
|
2307
|
+
|
|
2308
|
+
// ../compose-refs/dist/cjs/index.native.js
|
|
2309
|
+
var require_index_native10 = __commonJS({
|
|
2310
|
+
"../compose-refs/dist/cjs/index.native.js"(exports2, module2) {
|
|
2311
|
+
"use strict";
|
|
2312
|
+
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __copyProps2 = (to, from, except, desc) => {
|
|
2313
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
2314
|
+
for (let key of __getOwnPropNames2(from))
|
|
2315
|
+
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
2316
|
+
return to;
|
|
2317
|
+
}, __reExport2 = (target, mod, secondTarget) => (__copyProps2(target, mod, "default"), secondTarget && __copyProps2(secondTarget, mod, "default")), __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), src_exports2 = {};
|
|
2318
|
+
module2.exports = __toCommonJS2(src_exports2);
|
|
2319
|
+
__reExport2(src_exports2, require_compose_refs_native(), module2.exports);
|
|
2320
|
+
}
|
|
2321
|
+
});
|
|
2322
|
+
|
|
2323
|
+
// ../web/dist/cjs/helpers/objectIdentityKey.native.js
|
|
2324
|
+
var require_objectIdentityKey_native = __commonJS({
|
|
2325
|
+
"../web/dist/cjs/helpers/objectIdentityKey.native.js"(exports2, module2) {
|
|
2161
2326
|
"use strict";
|
|
2162
2327
|
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
2163
2328
|
for (var name in all)
|
|
@@ -2167,83 +2332,357 @@ var require_createMediaStyle_native = __commonJS({
|
|
|
2167
2332
|
for (let key of __getOwnPropNames2(from))
|
|
2168
2333
|
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
2169
2334
|
return to;
|
|
2170
|
-
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod),
|
|
2171
|
-
__export2(
|
|
2172
|
-
|
|
2173
|
-
createMediaStyle: () => createMediaStyle
|
|
2335
|
+
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), objectIdentityKey_exports = {};
|
|
2336
|
+
__export2(objectIdentityKey_exports, {
|
|
2337
|
+
objectIdentityKey: () => objectIdentityKey
|
|
2174
2338
|
});
|
|
2175
|
-
module2.exports = __toCommonJS2(
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
)}`;
|
|
2189
|
-
styleRule = styleInner.replace(selector, nextSelector);
|
|
2190
|
-
} else
|
|
2191
|
-
styleRule = `${precedenceImportancePrefix}${styleInner}`;
|
|
2192
|
-
}
|
|
2193
|
-
if (!isNonWindowMedia || groupMediaKey) {
|
|
2194
|
-
if (!selectors) {
|
|
2195
|
-
let mediaKeys = Object.keys(mediaQueries);
|
|
2196
|
-
selectors = Object.fromEntries(
|
|
2197
|
-
mediaKeys.map((key) => [key, (0, import_useMedia.mediaObjectToString)(mediaQueries[key])])
|
|
2198
|
-
), enableMediaPropOrder || (prefixes = Object.fromEntries(
|
|
2199
|
-
mediaKeys.map((k, index) => [k, new Array(index + 1).fill(":root").join("")])
|
|
2200
|
-
));
|
|
2339
|
+
module2.exports = __toCommonJS2(objectIdentityKey_exports);
|
|
2340
|
+
function objectIdentityKey(obj) {
|
|
2341
|
+
let k = "";
|
|
2342
|
+
for (let key in obj) {
|
|
2343
|
+
k += key;
|
|
2344
|
+
let arg = obj[key], type = typeof arg;
|
|
2345
|
+
if (!arg || type !== "object" && type !== "function")
|
|
2346
|
+
k += type + arg;
|
|
2347
|
+
else if (cache.has(arg))
|
|
2348
|
+
k += cache.get(arg);
|
|
2349
|
+
else {
|
|
2350
|
+
let v = Math.random();
|
|
2351
|
+
cache.set(arg, v), k += v;
|
|
2201
2352
|
}
|
|
2202
|
-
let mediaKey = groupMediaKey || mediaKeyIn, mediaSelector = selectors[mediaKey], mediaQuery = `${negate ? "not all and " : ""}${mediaSelector}`, precedenceImportancePrefix = groupMediaKey ? "" : enableMediaPropOrder ? (
|
|
2203
|
-
// this new array should be cached
|
|
2204
|
-
new Array(priority).fill(":root").join("")
|
|
2205
|
-
) : (
|
|
2206
|
-
// @ts-ignore
|
|
2207
|
-
prefixes[mediaKey]
|
|
2208
|
-
), prefix = groupMediaKey ? `@container ${containerName}` : "@media";
|
|
2209
|
-
groupMediaKey && (styleInner = styleRule), styleInner.includes(prefix) ? styleRule = styleInner.replace("{", ` and ${mediaQuery} {`).replace("and screen and", "and") : styleRule = `${prefix} ${mediaQuery}{${precedenceImportancePrefix}${styleInner}}`, groupMediaKey && (styleRule = `@supports (contain: ${conf.settings.webContainerType || "inline-size"}) {${styleRule}}`);
|
|
2210
2353
|
}
|
|
2211
|
-
return
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
|
|
2354
|
+
return k;
|
|
2355
|
+
}
|
|
2356
|
+
var cache = /* @__PURE__ */ new WeakMap();
|
|
2357
|
+
}
|
|
2358
|
+
});
|
|
2359
|
+
|
|
2360
|
+
// ../web/dist/cjs/helpers/createStyledContext.native.js
|
|
2361
|
+
var require_createStyledContext_native = __commonJS({
|
|
2362
|
+
"../web/dist/cjs/helpers/createStyledContext.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), createStyledContext_exports = {};
|
|
2373
|
+
__export2(createStyledContext_exports, {
|
|
2374
|
+
createStyledContext: () => createStyledContext2
|
|
2375
|
+
});
|
|
2376
|
+
module2.exports = __toCommonJS2(createStyledContext_exports);
|
|
2377
|
+
var import_react2 = require("react"), import_objectIdentityKey = require_objectIdentityKey_native(), import_jsx_runtime6 = require("react/jsx-runtime");
|
|
2378
|
+
function createStyledContext2(defaultValues) {
|
|
2379
|
+
let OGContext = (0, import_react2.createContext)(defaultValues), OGProvider2 = OGContext.Provider, Context = OGContext, scopedContexts = /* @__PURE__ */ new Map(), Provider = ({
|
|
2380
|
+
children,
|
|
2381
|
+
scope,
|
|
2382
|
+
...values
|
|
2383
|
+
}) => {
|
|
2384
|
+
let next = (0, import_react2.useMemo)(() => ({
|
|
2385
|
+
// this ! is a workaround for ts error
|
|
2386
|
+
...defaultValues,
|
|
2387
|
+
...values
|
|
2388
|
+
}), [(0, import_objectIdentityKey.objectIdentityKey)(values)]), Provider2 = OGProvider2;
|
|
2389
|
+
if (scope) {
|
|
2390
|
+
let ScopedContext = scopedContexts.get(scope);
|
|
2391
|
+
ScopedContext || (ScopedContext = (0, import_react2.createContext)(defaultValues), scopedContexts.set(scope, ScopedContext)), Provider2 = ScopedContext.Provider;
|
|
2392
|
+
}
|
|
2393
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Provider2, { value: next, children });
|
|
2394
|
+
}, useStyledContext = (scope) => {
|
|
2395
|
+
let context = scope ? scopedContexts.get(scope) : OGContext;
|
|
2396
|
+
return (0, import_react2.useContext)(context);
|
|
2215
2397
|
};
|
|
2398
|
+
return Context.Provider = Provider, Context.props = defaultValues, Context.context = OGContext, Context.useStyledContext = useStyledContext, Context;
|
|
2399
|
+
}
|
|
2400
|
+
}
|
|
2401
|
+
});
|
|
2402
|
+
|
|
2403
|
+
// ../web/dist/cjs/contexts/ComponentContext.native.js
|
|
2404
|
+
var require_ComponentContext_native = __commonJS({
|
|
2405
|
+
"../web/dist/cjs/contexts/ComponentContext.native.js"(exports2, module2) {
|
|
2406
|
+
"use strict";
|
|
2407
|
+
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
2408
|
+
for (var name in all)
|
|
2409
|
+
__defProp2(target, name, { get: all[name], enumerable: !0 });
|
|
2410
|
+
}, __copyProps2 = (to, from, except, desc) => {
|
|
2411
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
2412
|
+
for (let key of __getOwnPropNames2(from))
|
|
2413
|
+
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
2414
|
+
return to;
|
|
2415
|
+
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), ComponentContext_exports = {};
|
|
2416
|
+
__export2(ComponentContext_exports, {
|
|
2417
|
+
ComponentContext: () => ComponentContext2
|
|
2418
|
+
});
|
|
2419
|
+
module2.exports = __toCommonJS2(ComponentContext_exports);
|
|
2420
|
+
var import_createStyledContext = require_createStyledContext_native(), ComponentContext2 = (0, import_createStyledContext.createStyledContext)({
|
|
2421
|
+
disableSSR: void 0,
|
|
2422
|
+
inText: !1,
|
|
2423
|
+
language: null,
|
|
2424
|
+
animationDriver: null,
|
|
2425
|
+
groups: {
|
|
2426
|
+
emit: null,
|
|
2427
|
+
subscribe: null,
|
|
2428
|
+
state: {}
|
|
2429
|
+
}
|
|
2430
|
+
});
|
|
2431
|
+
}
|
|
2432
|
+
});
|
|
2433
|
+
|
|
2434
|
+
// ../web/dist/cjs/defaultComponentState.native.js
|
|
2435
|
+
var require_defaultComponentState_native = __commonJS({
|
|
2436
|
+
"../web/dist/cjs/defaultComponentState.native.js"(exports2, module2) {
|
|
2437
|
+
"use strict";
|
|
2438
|
+
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
2439
|
+
for (var name in all)
|
|
2440
|
+
__defProp2(target, name, { get: all[name], enumerable: !0 });
|
|
2441
|
+
}, __copyProps2 = (to, from, except, desc) => {
|
|
2442
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
2443
|
+
for (let key of __getOwnPropNames2(from))
|
|
2444
|
+
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
2445
|
+
return to;
|
|
2446
|
+
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), defaultComponentState_exports = {};
|
|
2447
|
+
__export2(defaultComponentState_exports, {
|
|
2448
|
+
defaultComponentState: () => defaultComponentState,
|
|
2449
|
+
defaultComponentStateMounted: () => defaultComponentStateMounted,
|
|
2450
|
+
defaultComponentStateShouldEnter: () => defaultComponentStateShouldEnter
|
|
2451
|
+
});
|
|
2452
|
+
module2.exports = __toCommonJS2(defaultComponentState_exports);
|
|
2453
|
+
var defaultComponentState = {
|
|
2454
|
+
hover: !1,
|
|
2455
|
+
press: !1,
|
|
2456
|
+
pressIn: !1,
|
|
2457
|
+
focus: !1,
|
|
2458
|
+
unmounted: !0
|
|
2459
|
+
}, defaultComponentStateMounted = {
|
|
2460
|
+
...defaultComponentState,
|
|
2461
|
+
unmounted: !1
|
|
2462
|
+
}, defaultComponentStateShouldEnter = {
|
|
2463
|
+
...defaultComponentState,
|
|
2464
|
+
unmounted: "should-enter"
|
|
2216
2465
|
};
|
|
2217
2466
|
}
|
|
2218
2467
|
});
|
|
2219
2468
|
|
|
2220
|
-
//
|
|
2221
|
-
var
|
|
2222
|
-
"
|
|
2469
|
+
// ../web/dist/cjs/constants/accessibilityDirectMap.native.js
|
|
2470
|
+
var require_accessibilityDirectMap_native = __commonJS({
|
|
2471
|
+
"../web/dist/cjs/constants/accessibilityDirectMap.native.js"(exports2, module2) {
|
|
2223
2472
|
"use strict";
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
|
|
2473
|
+
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
2474
|
+
for (var name in all)
|
|
2475
|
+
__defProp2(target, name, { get: all[name], enumerable: !0 });
|
|
2476
|
+
}, __copyProps2 = (to, from, except, desc) => {
|
|
2477
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
2478
|
+
for (let key of __getOwnPropNames2(from))
|
|
2479
|
+
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
2480
|
+
return to;
|
|
2481
|
+
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), accessibilityDirectMap_native_exports = {};
|
|
2482
|
+
__export2(accessibilityDirectMap_native_exports, {
|
|
2483
|
+
accessibilityDirectMap: () => accessibilityDirectMap,
|
|
2484
|
+
accessibilityWebRoleToNativeRole: () => accessibilityWebRoleToNativeRole,
|
|
2485
|
+
nativeAccessibilityState: () => nativeAccessibilityState,
|
|
2486
|
+
nativeAccessibilityValue: () => nativeAccessibilityValue,
|
|
2487
|
+
webToNativeAccessibilityDirectMap: () => webToNativeAccessibilityDirectMap
|
|
2488
|
+
});
|
|
2489
|
+
module2.exports = __toCommonJS2(accessibilityDirectMap_native_exports);
|
|
2490
|
+
var accessibilityDirectMap = {}, webToNativeAccessibilityDirectMap = {
|
|
2491
|
+
"aria-label": "accessibilityLabel",
|
|
2492
|
+
"aria-labelledby": "accessibilityLabelledBy",
|
|
2493
|
+
"aria-live": "accessibilityLiveRegion",
|
|
2494
|
+
"aria-modal": "accessibilityViewIsModal",
|
|
2495
|
+
"aria-hidden": "accessibilityElementsHidden"
|
|
2496
|
+
}, nativeAccessibilityValue = {
|
|
2497
|
+
"aria-valuemin": "min",
|
|
2498
|
+
"aria-valuemax": "max",
|
|
2499
|
+
"aria-valuenow": "now",
|
|
2500
|
+
"aria-valuetext": "text"
|
|
2501
|
+
}, nativeAccessibilityState = {
|
|
2502
|
+
"aria-disabled": "disabled",
|
|
2503
|
+
"aria-selected": "selected",
|
|
2504
|
+
"aria-checked": "checked",
|
|
2505
|
+
"aria-busy": "busy",
|
|
2506
|
+
"aria-expanded": "expanded"
|
|
2507
|
+
}, accessibilityWebRoleToNativeRole = {
|
|
2508
|
+
alert: "alert",
|
|
2509
|
+
button: "button",
|
|
2510
|
+
checkbox: "checkbox",
|
|
2511
|
+
combobox: "combobox",
|
|
2512
|
+
grid: "grid",
|
|
2513
|
+
group: "none",
|
|
2514
|
+
heading: "header",
|
|
2515
|
+
imagebutton: "imagebutton",
|
|
2516
|
+
img: "image",
|
|
2517
|
+
keyboardkey: "keyboardkey",
|
|
2518
|
+
link: "link",
|
|
2519
|
+
menu: "menu",
|
|
2520
|
+
menubar: "menubar",
|
|
2521
|
+
menuitem: "menuitem",
|
|
2522
|
+
none: "none",
|
|
2523
|
+
presentation: "none",
|
|
2524
|
+
progressbar: "progressbar",
|
|
2525
|
+
radio: "radio",
|
|
2526
|
+
radiogroup: "radiogroup",
|
|
2527
|
+
region: "summary",
|
|
2528
|
+
scrollbar: "scrollbar",
|
|
2529
|
+
searchbox: "search",
|
|
2530
|
+
slider: "adjustable",
|
|
2531
|
+
spinbutton: "spinbutton",
|
|
2532
|
+
summary: "summary",
|
|
2533
|
+
switch: "switch",
|
|
2534
|
+
tab: "tab",
|
|
2535
|
+
tablist: "tablist",
|
|
2536
|
+
text: "text",
|
|
2537
|
+
timer: "timer",
|
|
2538
|
+
togglebutton: "togglebutton",
|
|
2539
|
+
toolbar: "toolbar"
|
|
2540
|
+
};
|
|
2541
|
+
}
|
|
2542
|
+
});
|
|
2543
|
+
|
|
2544
|
+
// ../web/dist/cjs/constants/isDevTools.native.js
|
|
2545
|
+
var require_isDevTools_native = __commonJS({
|
|
2546
|
+
"../web/dist/cjs/constants/isDevTools.native.js"(exports2, module2) {
|
|
2547
|
+
"use strict";
|
|
2548
|
+
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
2549
|
+
for (var name in all)
|
|
2550
|
+
__defProp2(target, name, { get: all[name], enumerable: !0 });
|
|
2551
|
+
}, __copyProps2 = (to, from, except, desc) => {
|
|
2552
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
2553
|
+
for (let key of __getOwnPropNames2(from))
|
|
2554
|
+
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
2555
|
+
return to;
|
|
2556
|
+
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), isDevTools_exports = {};
|
|
2557
|
+
__export2(isDevTools_exports, {
|
|
2558
|
+
isDevTools: () => isDevTools
|
|
2559
|
+
});
|
|
2560
|
+
module2.exports = __toCommonJS2(isDevTools_exports);
|
|
2561
|
+
var isDevTools = (() => {
|
|
2562
|
+
if (process.env.NODE_ENV === "development")
|
|
2563
|
+
try {
|
|
2564
|
+
return new Function("try {return this===window;}catch(e){ return false;}")();
|
|
2565
|
+
} catch {
|
|
2566
|
+
}
|
|
2567
|
+
return !1;
|
|
2568
|
+
})();
|
|
2569
|
+
}
|
|
2570
|
+
});
|
|
2571
|
+
|
|
2572
|
+
// ../web/dist/cjs/helpers/getGroupPropParts.native.js
|
|
2573
|
+
var require_getGroupPropParts_native = __commonJS({
|
|
2574
|
+
"../web/dist/cjs/helpers/getGroupPropParts.native.js"(exports2, module2) {
|
|
2575
|
+
"use strict";
|
|
2576
|
+
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
2577
|
+
for (var name in all)
|
|
2578
|
+
__defProp2(target, name, { get: all[name], enumerable: !0 });
|
|
2579
|
+
}, __copyProps2 = (to, from, except, desc) => {
|
|
2580
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
2581
|
+
for (let key of __getOwnPropNames2(from))
|
|
2582
|
+
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
2583
|
+
return to;
|
|
2584
|
+
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), getGroupPropParts_exports = {};
|
|
2585
|
+
__export2(getGroupPropParts_exports, {
|
|
2586
|
+
getGroupPropParts: () => getGroupPropParts
|
|
2587
|
+
});
|
|
2588
|
+
module2.exports = __toCommonJS2(getGroupPropParts_exports);
|
|
2589
|
+
var import_useMedia = require_useMedia_native();
|
|
2590
|
+
function getGroupPropParts(groupProp) {
|
|
2591
|
+
let mediaQueries = (0, import_useMedia.getMedia)(), [_, name, part3, part4] = groupProp.split("-"), pseudo, media = part3 in mediaQueries ? part3 : void 0;
|
|
2592
|
+
return media ? pseudo = part4 : pseudo = part3, { name, pseudo, media };
|
|
2593
|
+
}
|
|
2594
|
+
}
|
|
2595
|
+
});
|
|
2596
|
+
|
|
2597
|
+
// ../web/dist/cjs/helpers/createMediaStyle.native.js
|
|
2598
|
+
var require_createMediaStyle_native = __commonJS({
|
|
2599
|
+
"../web/dist/cjs/helpers/createMediaStyle.native.js"(exports2, module2) {
|
|
2600
|
+
"use strict";
|
|
2601
|
+
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
2602
|
+
for (var name in all)
|
|
2603
|
+
__defProp2(target, name, { get: all[name], enumerable: !0 });
|
|
2604
|
+
}, __copyProps2 = (to, from, except, desc) => {
|
|
2605
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
2606
|
+
for (let key of __getOwnPropNames2(from))
|
|
2607
|
+
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
2608
|
+
return to;
|
|
2609
|
+
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), createMediaStyle_exports = {};
|
|
2610
|
+
__export2(createMediaStyle_exports, {
|
|
2611
|
+
MEDIA_SEP: () => MEDIA_SEP,
|
|
2612
|
+
createMediaStyle: () => createMediaStyle
|
|
2613
|
+
});
|
|
2614
|
+
module2.exports = __toCommonJS2(createMediaStyle_exports);
|
|
2615
|
+
var import_config = require_config_native(), import_useMedia = require_useMedia_native(), import_getGroupPropParts = require_getGroupPropParts_native(), MEDIA_SEP = "_", prefixes = null, selectors = null, groupPseudoToPseudoCSSMap = {
|
|
2616
|
+
press: "active"
|
|
2617
|
+
}, createMediaStyle = (styleObject, mediaKeyIn, mediaQueries, type, negate, priority) => {
|
|
2618
|
+
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(";");
|
|
2619
|
+
if (isNonWindowMedia) {
|
|
2620
|
+
let precedenceImportancePrefix = new Array((priority || 0) + (isGroup ? 1 : 0)).fill(":root").join("");
|
|
2621
|
+
if (isTheme || isGroup) {
|
|
2622
|
+
let groupInfo = (0, import_getGroupPropParts.getGroupPropParts)(mediaKeyIn), mediaName = groupInfo == null ? void 0 : groupInfo.name;
|
|
2623
|
+
groupMediaKey = groupInfo == null ? void 0 : groupInfo.media, isGroup && (containerName = mediaName);
|
|
2624
|
+
let name = (isGroup ? "group_" : "") + mediaName, selectorStart = styleInner.indexOf(":root"), selectorEnd = styleInner.lastIndexOf("{"), selector = styleInner.slice(selectorStart, selectorEnd), precedenceSpace = conf.themeClassNameOnRoot && isTheme ? "" : " ", pseudoSelectorName = groupInfo.pseudo ? groupPseudoToPseudoCSSMap[groupInfo.pseudo] || groupInfo.pseudo : void 0, pseudoSelector = pseudoSelectorName ? `:${pseudoSelectorName}` : "", presedencePrefix = `:root${precedenceImportancePrefix}${precedenceSpace}`, mediaSelector = `.t_${name}${pseudoSelector}`, nextSelector = `${presedencePrefix}${mediaSelector} ${selector.replace(
|
|
2625
|
+
":root",
|
|
2626
|
+
""
|
|
2627
|
+
)}`;
|
|
2628
|
+
styleRule = styleInner.replace(selector, nextSelector);
|
|
2629
|
+
} else
|
|
2630
|
+
styleRule = `${precedenceImportancePrefix}${styleInner}`;
|
|
2631
|
+
}
|
|
2632
|
+
if (!isNonWindowMedia || groupMediaKey) {
|
|
2633
|
+
if (!selectors) {
|
|
2634
|
+
let mediaKeys = Object.keys(mediaQueries);
|
|
2635
|
+
selectors = Object.fromEntries(
|
|
2636
|
+
mediaKeys.map((key) => [key, (0, import_useMedia.mediaObjectToString)(mediaQueries[key])])
|
|
2637
|
+
), enableMediaPropOrder || (prefixes = Object.fromEntries(
|
|
2638
|
+
mediaKeys.map((k, index) => [k, new Array(index + 1).fill(":root").join("")])
|
|
2639
|
+
));
|
|
2640
|
+
}
|
|
2641
|
+
let mediaKey = groupMediaKey || mediaKeyIn, mediaSelector = selectors[mediaKey], mediaQuery = `${negate ? "not all and " : ""}${mediaSelector}`, precedenceImportancePrefix = groupMediaKey ? "" : enableMediaPropOrder ? (
|
|
2642
|
+
// this new array should be cached
|
|
2643
|
+
new Array(priority).fill(":root").join("")
|
|
2644
|
+
) : (
|
|
2645
|
+
// @ts-ignore
|
|
2646
|
+
prefixes[mediaKey]
|
|
2647
|
+
), prefix = groupMediaKey ? `@container ${containerName}` : "@media";
|
|
2648
|
+
groupMediaKey && (styleInner = styleRule), styleInner.includes(prefix) ? styleRule = styleInner.replace("{", ` and ${mediaQuery} {`).replace("and screen and", "and") : styleRule = `${prefix} ${mediaQuery}{${precedenceImportancePrefix}${styleInner}}`, groupMediaKey && (styleRule = `@supports (contain: ${conf.settings.webContainerType || "inline-size"}) {${styleRule}}`);
|
|
2649
|
+
}
|
|
2650
|
+
return {
|
|
2651
|
+
property,
|
|
2652
|
+
rules: [styleRule],
|
|
2653
|
+
identifier: nextIdentifier
|
|
2654
|
+
};
|
|
2655
|
+
};
|
|
2656
|
+
}
|
|
2657
|
+
});
|
|
2658
|
+
|
|
2659
|
+
// ../../node_modules/@react-native/normalize-color/index.js
|
|
2660
|
+
var require_normalize_color = __commonJS({
|
|
2661
|
+
"../../node_modules/@react-native/normalize-color/index.js"(exports2, module2) {
|
|
2662
|
+
"use strict";
|
|
2663
|
+
function normalizeColor(color) {
|
|
2664
|
+
if (typeof color == "number")
|
|
2665
|
+
return color >>> 0 === color && color >= 0 && color <= 4294967295 ? color : null;
|
|
2666
|
+
if (typeof color != "string")
|
|
2667
|
+
return null;
|
|
2668
|
+
let matchers = getMatchers(), match;
|
|
2669
|
+
if (match = matchers.hex6.exec(color))
|
|
2670
|
+
return parseInt(match[1] + "ff", 16) >>> 0;
|
|
2671
|
+
let colorFromKeyword = normalizeKeyword(color);
|
|
2672
|
+
return colorFromKeyword ?? ((match = matchers.rgb.exec(color)) ? (parse255(match[1]) << 24 | // r
|
|
2673
|
+
parse255(match[2]) << 16 | // g
|
|
2674
|
+
parse255(match[3]) << 8 | // b
|
|
2675
|
+
255) >>> // a
|
|
2676
|
+
0 : (match = matchers.rgba.exec(color)) ? match[6] !== void 0 ? (parse255(match[6]) << 24 | // r
|
|
2677
|
+
parse255(match[7]) << 16 | // g
|
|
2678
|
+
parse255(match[8]) << 8 | // b
|
|
2679
|
+
parse1(match[9])) >>> // a
|
|
2680
|
+
0 : (parse255(match[2]) << 24 | // r
|
|
2681
|
+
parse255(match[3]) << 16 | // g
|
|
2682
|
+
parse255(match[4]) << 8 | // b
|
|
2683
|
+
parse1(match[5])) >>> // a
|
|
2684
|
+
0 : (match = matchers.hex3.exec(color)) ? parseInt(
|
|
2685
|
+
match[1] + match[1] + // r
|
|
2247
2686
|
match[2] + match[2] + // g
|
|
2248
2687
|
match[3] + match[3] + // b
|
|
2249
2688
|
"ff",
|
|
@@ -3200,7 +3639,9 @@ var require_propMapper_native = __commonJS({
|
|
|
3200
3639
|
let expanded = (0, import_expandStylesAndRemoveNullishValues.expandStylesAndRemoveNullishValues)(
|
|
3201
3640
|
variantValue,
|
|
3202
3641
|
!!styleProps.noNormalize
|
|
3203
|
-
)
|
|
3642
|
+
);
|
|
3643
|
+
process.env.NODE_ENV === "development" && debug === "verbose" && console.info(" expanding styles from ", variantValue, "to", expanded);
|
|
3644
|
+
let next = Object.entries(expanded);
|
|
3204
3645
|
return fontFamilyResult && fontFamilyResult[0] === "$" && fontFamilyCache.set(next, (0, import_createVariable.getVariableValue)(fontFamilyResult)), next;
|
|
3205
3646
|
}
|
|
3206
3647
|
};
|
|
@@ -3238,7 +3679,7 @@ var require_propMapper_native = __commonJS({
|
|
|
3238
3679
|
continue;
|
|
3239
3680
|
}
|
|
3240
3681
|
if ((0, import_createVariable.isVariable)(val)) {
|
|
3241
|
-
res[subKey] = resolveVariableValue(subKey, val, styleProps.resolveValues);
|
|
3682
|
+
res[subKey] = resolveVariableValue(subKey, val, styleProps.resolveValues), process.env.NODE_ENV === "development" && debug === "verbose" && console.info("variable", subKey, res[subKey]);
|
|
3242
3683
|
continue;
|
|
3243
3684
|
}
|
|
3244
3685
|
if (typeof val == "string") {
|
|
@@ -3741,576 +4182,142 @@ current`, {
|
|
|
3741
4182
|
}
|
|
3742
4183
|
console.groupEnd();
|
|
3743
4184
|
}
|
|
3744
|
-
return result;
|
|
3745
|
-
};
|
|
3746
|
-
function mergeStyle(styleState, key, val, disableNormalize = !1) {
|
|
3747
|
-
let { classNames, viewProps, style, usedKeys, styleProps } = styleState;
|
|
3748
|
-
if (import_constants4.isWeb && (val == null ? void 0 : val[0]) === "_")
|
|
3749
|
-
classNames[key] = val, usedKeys[key] ||= 1;
|
|
3750
|
-
else if (key in import_helpers.stylePropsTransform)
|
|
3751
|
-
styleState.transforms ||= {}, styleState.transforms[key] = val;
|
|
3752
|
-
else {
|
|
3753
|
-
let out = import_constants4.isWeb && !disableNormalize && !styleProps.noNormalize ? (0, import_normalizeValueWithProperty.normalizeValueWithProperty)(val, key) : val;
|
|
3754
|
-
key in import_helpers.validStylesOnBaseProps ? viewProps[key] = out : style[key] = out;
|
|
3755
|
-
}
|
|
3756
|
-
}
|
|
3757
|
-
var getSubStyle = (styleState, subKey, styleIn, avoidMergeTransform) => {
|
|
3758
|
-
let { staticConfig, props, conf: conf2, styleProps } = styleState, styleOut = {};
|
|
3759
|
-
for (let key in styleIn) {
|
|
3760
|
-
let val = styleIn[key];
|
|
3761
|
-
key = conf2.shorthands[key] || key;
|
|
3762
|
-
let expanded = (0, import_propMapper.propMapper)(key, val, styleState, { ...props, ...props[subKey] });
|
|
3763
|
-
if (!(!expanded || !staticConfig.isHOC && key in skipProps && !styleProps.noSkip))
|
|
3764
|
-
for (let [skey, sval] of expanded)
|
|
3765
|
-
!avoidMergeTransform && skey in import_helpers.stylePropsTransform ? mergeTransform(styleOut, skey, sval) : styleOut[skey] = styleProps.noNormalize ? sval : (0, import_normalizeValueWithProperty.normalizeValueWithProperty)(sval, key);
|
|
3766
|
-
}
|
|
3767
|
-
return styleProps.noNormalize || (0, import_expandStyles.fixStyles)(styleOut), styleOut;
|
|
3768
|
-
};
|
|
3769
|
-
function mergeStylePropIntoStyle(styleState, cur) {
|
|
3770
|
-
if (!cur)
|
|
3771
|
-
return;
|
|
3772
|
-
let styles = Array.isArray(cur) ? cur : [cur];
|
|
3773
|
-
for (let style of styles) {
|
|
3774
|
-
if (!style)
|
|
3775
|
-
continue;
|
|
3776
|
-
let isRNW = style.$$css;
|
|
3777
|
-
Object.assign(isRNW ? styleState.classNames : styleState.style, style);
|
|
3778
|
-
}
|
|
3779
|
-
}
|
|
3780
|
-
var useInsertEffectCompat = import_constants4.isWeb ? import_react2.useInsertionEffect || import_constants4.useIsomorphicLayoutEffect : () => {
|
|
3781
|
-
}, useSplitStyles = (...args) => {
|
|
3782
|
-
let res = getSplitStyles(...args);
|
|
3783
|
-
return useInsertEffectCompat(() => {
|
|
3784
|
-
(0, import_insertStyleRule.insertStyleRules)(res.rulesToInsert);
|
|
3785
|
-
}, [res.rulesToInsert]), res;
|
|
3786
|
-
}, animatableDefaults = {
|
|
3787
|
-
opacity: 1,
|
|
3788
|
-
scale: 1,
|
|
3789
|
-
rotate: "0deg",
|
|
3790
|
-
rotateY: "0deg",
|
|
3791
|
-
rotateX: "0deg",
|
|
3792
|
-
x: 0,
|
|
3793
|
-
y: 0
|
|
3794
|
-
}, lowercaseHyphenate = (match) => `-${match.toLowerCase()}`, hyphenate = (str) => str.replace(/[A-Z]/g, lowercaseHyphenate), mergeTransform = (obj, key, val, backwards = !1) => {
|
|
3795
|
-
typeof obj.transform != "string" && (obj.transform ||= [], obj.transform[backwards ? "unshift" : "push"]({
|
|
3796
|
-
[mapTransformKeys[key] || key]: val
|
|
3797
|
-
}));
|
|
3798
|
-
}, mapTransformKeys = {
|
|
3799
|
-
x: "translateX",
|
|
3800
|
-
y: "translateY"
|
|
3801
|
-
}, skipProps = {
|
|
3802
|
-
untilMeasured: 1,
|
|
3803
|
-
animation: 1,
|
|
3804
|
-
space: 1,
|
|
3805
|
-
animateOnly: 1,
|
|
3806
|
-
disableClassName: 1,
|
|
3807
|
-
debug: 1,
|
|
3808
|
-
componentName: 1,
|
|
3809
|
-
disableOptimization: 1,
|
|
3810
|
-
tag: 1,
|
|
3811
|
-
style: 1,
|
|
3812
|
-
// handled after loop so pseudos set usedKeys and override it if necessary
|
|
3813
|
-
group: 1
|
|
3814
|
-
};
|
|
3815
|
-
process.env.NODE_ENV === "test" && (skipProps["data-test-renders"] = 1);
|
|
3816
|
-
Object.assign(skipProps, {
|
|
3817
|
-
whiteSpace: 1,
|
|
3818
|
-
wordWrap: 1,
|
|
3819
|
-
textOverflow: 1,
|
|
3820
|
-
textDecorationDistance: 1,
|
|
3821
|
-
cursor: 1,
|
|
3822
|
-
contain: 1,
|
|
3823
|
-
boxSizing: 1,
|
|
3824
|
-
boxShadow: 1,
|
|
3825
|
-
outlineStyle: 1,
|
|
3826
|
-
outlineOffset: 1,
|
|
3827
|
-
outlineWidth: 1,
|
|
3828
|
-
outlineColor: 1
|
|
3829
|
-
});
|
|
3830
|
-
function passDownProp(viewProps, key, val, shouldMergeObject = !1) {
|
|
3831
|
-
if (shouldMergeObject) {
|
|
3832
|
-
let next = {
|
|
3833
|
-
...viewProps[key],
|
|
3834
|
-
...val
|
|
3835
|
-
};
|
|
3836
|
-
delete viewProps[key], viewProps[key] = next;
|
|
3837
|
-
} else
|
|
3838
|
-
viewProps[key] = val;
|
|
3839
|
-
}
|
|
3840
|
-
}
|
|
3841
|
-
});
|
|
3842
|
-
|
|
3843
|
-
// ../web/dist/cjs/helpers/mergeProps.native.js
|
|
3844
|
-
var require_mergeProps_native = __commonJS({
|
|
3845
|
-
"../web/dist/cjs/helpers/mergeProps.native.js"(exports2, module2) {
|
|
3846
|
-
"use strict";
|
|
3847
|
-
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
3848
|
-
for (var name in all)
|
|
3849
|
-
__defProp2(target, name, { get: all[name], enumerable: !0 });
|
|
3850
|
-
}, __copyProps2 = (to, from, except, desc) => {
|
|
3851
|
-
if (from && typeof from == "object" || typeof from == "function")
|
|
3852
|
-
for (let key of __getOwnPropNames2(from))
|
|
3853
|
-
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
3854
|
-
return to;
|
|
3855
|
-
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), mergeProps_exports = {};
|
|
3856
|
-
__export2(mergeProps_exports, {
|
|
3857
|
-
mergeProps: () => mergeProps
|
|
3858
|
-
});
|
|
3859
|
-
module2.exports = __toCommonJS2(mergeProps_exports);
|
|
3860
|
-
var import_useMedia = require_useMedia_native(), import_pseudoDescriptors = require_pseudoDescriptors_native(), mergeProps = (a, b, inverseShorthands) => {
|
|
3861
|
-
let out = {};
|
|
3862
|
-
for (let key in a)
|
|
3863
|
-
mergeProp(out, a, b, key, inverseShorthands);
|
|
3864
|
-
if (b)
|
|
3865
|
-
for (let key in b)
|
|
3866
|
-
mergeProp(out, b, void 0, key, inverseShorthands);
|
|
3867
|
-
return out;
|
|
3868
|
-
};
|
|
3869
|
-
function mergeProp(out, a, b, key, inverseShorthands) {
|
|
3870
|
-
let longhand = (inverseShorthands == null ? void 0 : inverseShorthands[key]) || null, val = a[key];
|
|
3871
|
-
if (key in import_pseudoDescriptors.pseudoDescriptors || import_useMedia.mediaKeys.has(key)) {
|
|
3872
|
-
out[key] = {
|
|
3873
|
-
...out[key],
|
|
3874
|
-
...val
|
|
3875
|
-
};
|
|
3876
|
-
return;
|
|
3877
|
-
}
|
|
3878
|
-
b && (key in b || longhand && longhand in b) || (out[longhand || key] = val);
|
|
3879
|
-
}
|
|
3880
|
-
}
|
|
3881
|
-
});
|
|
3882
|
-
|
|
3883
|
-
// ../web/dist/cjs/helpers/ThemeManagerContext.native.js
|
|
3884
|
-
var require_ThemeManagerContext_native = __commonJS({
|
|
3885
|
-
"../web/dist/cjs/helpers/ThemeManagerContext.native.js"(exports2, module2) {
|
|
3886
|
-
"use strict";
|
|
3887
|
-
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
3888
|
-
for (var name in all)
|
|
3889
|
-
__defProp2(target, name, { get: all[name], enumerable: !0 });
|
|
3890
|
-
}, __copyProps2 = (to, from, except, desc) => {
|
|
3891
|
-
if (from && typeof from == "object" || typeof from == "function")
|
|
3892
|
-
for (let key of __getOwnPropNames2(from))
|
|
3893
|
-
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
3894
|
-
return to;
|
|
3895
|
-
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), ThemeManagerContext_exports = {};
|
|
3896
|
-
__export2(ThemeManagerContext_exports, {
|
|
3897
|
-
ThemeManagerIDContext: () => ThemeManagerIDContext
|
|
3898
|
-
});
|
|
3899
|
-
module2.exports = __toCommonJS2(ThemeManagerContext_exports);
|
|
3900
|
-
var import_react2 = require("react"), ThemeManagerIDContext = (0, import_react2.createContext)(1);
|
|
3901
|
-
}
|
|
3902
|
-
});
|
|
3903
|
-
|
|
3904
|
-
// ../web/dist/cjs/helpers/ThemeManager.native.js
|
|
3905
|
-
var require_ThemeManager_native = __commonJS({
|
|
3906
|
-
"../web/dist/cjs/helpers/ThemeManager.native.js"(exports2, module2) {
|
|
3907
|
-
"use strict";
|
|
3908
|
-
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
3909
|
-
for (var name in all)
|
|
3910
|
-
__defProp2(target, name, { get: all[name], enumerable: !0 });
|
|
3911
|
-
}, __copyProps2 = (to, from, except, desc) => {
|
|
3912
|
-
if (from && typeof from == "object" || typeof from == "function")
|
|
3913
|
-
for (let key of __getOwnPropNames2(from))
|
|
3914
|
-
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
3915
|
-
return to;
|
|
3916
|
-
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), ThemeManager_exports = {};
|
|
3917
|
-
__export2(ThemeManager_exports, {
|
|
3918
|
-
ThemeManager: () => ThemeManager,
|
|
3919
|
-
getHasThemeUpdatingProps: () => getHasThemeUpdatingProps,
|
|
3920
|
-
getManagers: () => getManagers
|
|
3921
|
-
});
|
|
3922
|
-
module2.exports = __toCommonJS2(ThemeManager_exports);
|
|
3923
|
-
var import_constants4 = require_index_native(), import_config = require_config_native(), import_constants22 = require_constants_native2(), emptyState = { name: "" };
|
|
3924
|
-
function getHasThemeUpdatingProps(props) {
|
|
3925
|
-
return !!(props.name || props.componentName || props.inverse || props.reset);
|
|
3926
|
-
}
|
|
3927
|
-
var uid = 0, ThemeManager = class {
|
|
3928
|
-
constructor(props = {}, parentManager) {
|
|
3929
|
-
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") {
|
|
3930
|
-
this.updateStateFromProps(props, !1);
|
|
3931
|
-
return;
|
|
3932
|
-
}
|
|
3933
|
-
if (!parentManager)
|
|
3934
|
-
throw process.env.NODE_ENV !== "production" ? new Error(
|
|
3935
|
-
"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."
|
|
3936
|
-
) : "\u274C 000";
|
|
3937
|
-
if (this.parentManager = parentManager, !this.updateStateFromProps(props, !1))
|
|
3938
|
-
return parentManager;
|
|
3939
|
-
}
|
|
3940
|
-
updateStateFromProps(props = this.props || {}, shouldNotify = !0) {
|
|
3941
|
-
if (this.props = props, props.forceTheme)
|
|
3942
|
-
return this.state.theme = props.forceTheme, this.state.name = props.name || "", this.updateState(this.state, !0), this.state;
|
|
3943
|
-
let nextState = this.getStateIfChanged(props);
|
|
3944
|
-
if (nextState)
|
|
3945
|
-
return this.updateState(nextState, shouldNotify), nextState;
|
|
3946
|
-
}
|
|
3947
|
-
updateState(nextState, shouldNotify = !0) {
|
|
3948
|
-
this.state = nextState, this._allKeys = null, process.env.NODE_ENV !== "production" && (this._numChangeEventsSent ??= 0, this._numChangeEventsSent++), shouldNotify && this.notify();
|
|
3949
|
-
}
|
|
3950
|
-
getStateIfChanged(props = this.props, state = this.state, parentManager = this.parentManager) {
|
|
3951
|
-
let _ = this.getState(props, parentManager);
|
|
3952
|
-
if (state && state !== emptyState && !_)
|
|
3953
|
-
return parentManager == null ? void 0 : parentManager.state;
|
|
3954
|
-
if (this.getStateShouldChange(_, state))
|
|
3955
|
-
return _;
|
|
3956
|
-
}
|
|
3957
|
-
getStateShouldChange(nextState, state = this.state) {
|
|
3958
|
-
return !(!(nextState != null && nextState.theme) || nextState.theme === (state == null ? void 0 : state.theme));
|
|
3959
|
-
}
|
|
3960
|
-
getState(props = this.props, parentManager = this.parentManager) {
|
|
3961
|
-
return getState(props, parentManager) || (parentManager == null ? void 0 : parentManager.state) || null;
|
|
3962
|
-
}
|
|
3963
|
-
get allKeys() {
|
|
3964
|
-
var _a;
|
|
3965
|
-
return this._allKeys ||= /* @__PURE__ */ new Set([
|
|
3966
|
-
...((_a = this.parentManager) == null ? void 0 : _a.allKeys) || [],
|
|
3967
|
-
...Object.keys(this.state.theme || {})
|
|
3968
|
-
]), this._allKeys;
|
|
3969
|
-
}
|
|
3970
|
-
notify(forced = !1) {
|
|
3971
|
-
this.themeListeners.forEach((cb) => cb(this.state.name, this, forced));
|
|
3972
|
-
}
|
|
3973
|
-
onChangeTheme(cb, debugId) {
|
|
3974
|
-
return process.env.NODE_ENV !== "production" && debugId && (this._listeningIds ??= /* @__PURE__ */ new Set(), this._listeningIds.add(debugId)), this.themeListeners.add(cb), () => {
|
|
3975
|
-
this.themeListeners.delete(cb);
|
|
3976
|
-
};
|
|
3977
|
-
}
|
|
3978
|
-
};
|
|
3979
|
-
function getState(props, manager) {
|
|
3980
|
-
var _a;
|
|
3981
|
-
if (props.name && props.reset)
|
|
3982
|
-
throw new Error(
|
|
3983
|
-
process.env.NODE_ENV === "production" ? "\u274C004" : "Cannot reset and set a new name at the same time."
|
|
3984
|
-
);
|
|
3985
|
-
if (!getHasThemeUpdatingProps(props))
|
|
3986
|
-
return null;
|
|
3987
|
-
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];
|
|
3988
|
-
if (!baseManager && props.reset)
|
|
3989
|
-
return process.env.NODE_ENV !== "production" && console.warn("Cannot reset, no parent theme exists"), null;
|
|
3990
|
-
let { componentName } = props, result = null, baseName = (baseManager == null ? void 0 : baseManager.state.name) || "";
|
|
3991
|
-
baseManager != null && baseManager.state.isComponent && (baseName = baseName.replace(/_[A-Z][A-Za-z]+/, ""));
|
|
3992
|
-
let nextName = props.reset ? baseName : props.name || "", allComponentThemes = componentManagers.map((x) => (x == null ? void 0 : x.state.name) || "");
|
|
3993
|
-
isDirectParentAComponentTheme && allComponentThemes.shift();
|
|
3994
|
-
let base = baseName.split(import_constants22.THEME_NAME_SEPARATOR), max2 = base.length, min2 = props.componentName && !nextName ? max2 : 0;
|
|
3995
|
-
for (let i = max2; i >= min2; i--) {
|
|
3996
|
-
let prefix = base.slice(0, i).join(import_constants22.THEME_NAME_SEPARATOR);
|
|
3997
|
-
props.inverse && (prefix = inverseThemeName(prefix));
|
|
3998
|
-
let potentials = [];
|
|
3999
|
-
if (prefix && prefix !== baseName && potentials.push(prefix), nextName && potentials.unshift(prefix ? `${prefix}_${nextName}` : nextName), i === 1) {
|
|
4000
|
-
let lastSegment = potentials.findIndex((x) => !x.includes("_"));
|
|
4001
|
-
lastSegment > 0 && potentials.splice(lastSegment, 0, nextName);
|
|
4002
|
-
}
|
|
4003
|
-
if (componentName && !props.reset) {
|
|
4004
|
-
let baseLen = base.length, componentPotentials = [];
|
|
4005
|
-
if (nextName && baseLen > 1) {
|
|
4006
|
-
let beforeSeparator = base[0];
|
|
4007
|
-
componentPotentials.push(`${beforeSeparator}_${nextName}_${componentName}`);
|
|
4008
|
-
}
|
|
4009
|
-
if (componentPotentials.push(`${prefix}_${componentName}`), nextName) {
|
|
4010
|
-
if (i > baseLen) {
|
|
4011
|
-
let prefixLessOne = base.slice(0, i - 1).join(import_constants22.THEME_NAME_SEPARATOR);
|
|
4012
|
-
if (prefixLessOne) {
|
|
4013
|
-
let lessSpecific = `${prefixLessOne}_${nextName}_${componentName}`;
|
|
4014
|
-
componentPotentials.unshift(lessSpecific);
|
|
4015
|
-
}
|
|
4016
|
-
}
|
|
4017
|
-
let moreSpecific = `${prefix}_${nextName}_${componentName}`;
|
|
4018
|
-
componentPotentials.unshift(moreSpecific);
|
|
4019
|
-
}
|
|
4020
|
-
potentials = [...componentPotentials, ...potentials, ...allComponentThemes];
|
|
4021
|
-
}
|
|
4022
|
-
let found = potentials.find((t) => t in themes);
|
|
4023
|
-
if (process.env.NODE_ENV !== "production" && typeof props.debug == "string" && console.info(" getState ", {
|
|
4024
|
-
props,
|
|
4025
|
-
found,
|
|
4026
|
-
potentials,
|
|
4027
|
-
baseManager,
|
|
4028
|
-
nextName,
|
|
4029
|
-
baseName,
|
|
4030
|
-
prefix
|
|
4031
|
-
}), found) {
|
|
4032
|
-
let names = found.split("_"), [firstName, ...restNames] = names, lastName = names[names.length - 1], isComponent = lastName[0] === lastName[0].toUpperCase(), scheme = firstName === "light" ? "light" : firstName === "dark" ? "dark" : void 0, pre = import_constants22.THEME_CLASSNAME_PREFIX, className = import_constants4.isWeb ? `${pre}sub_theme ${pre}${!scheme || !restNames.length ? firstName : restNames.join("_")}` : "", parentState = (_a = baseManager || parentManager) == null ? void 0 : _a.state, parentName = parentState == null ? void 0 : parentState.name;
|
|
4033
|
-
result = {
|
|
4034
|
-
name: found,
|
|
4035
|
-
parentName,
|
|
4036
|
-
theme: themes[found],
|
|
4037
|
-
className,
|
|
4038
|
-
isComponent,
|
|
4039
|
-
scheme
|
|
4040
|
-
};
|
|
4041
|
-
break;
|
|
4042
|
-
}
|
|
4043
|
-
}
|
|
4044
|
-
return process.env.NODE_ENV !== "production" && props.debug === "verbose" && typeof window < "u" && (console.groupCollapsed("ThemeManager.getState()"), console.info({ props, baseName, base, min: min2, max: max2 }), console.warn("result", { result }), console.trace(), console.groupEnd()), result;
|
|
4045
|
-
}
|
|
4046
|
-
var inverseThemeName = (themeName) => themeName.startsWith("light") ? themeName.replace(/^light/, "dark") : themeName.replace(/^dark/, "light");
|
|
4047
|
-
function getManagers(themeManager) {
|
|
4048
|
-
let comp = [], all = [], cur = themeManager;
|
|
4049
|
-
for (; cur; )
|
|
4050
|
-
all.push(cur), cur.state.isComponent && comp.push(cur), cur = cur.parentManager;
|
|
4051
|
-
return [all, comp];
|
|
4052
|
-
}
|
|
4053
|
-
}
|
|
4054
|
-
});
|
|
4055
|
-
|
|
4056
|
-
// ../web/dist/cjs/hooks/useTheme.native.js
|
|
4057
|
-
var require_useTheme_native = __commonJS({
|
|
4058
|
-
"../web/dist/cjs/hooks/useTheme.native.js"(exports2, module2) {
|
|
4059
|
-
"use strict";
|
|
4060
|
-
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
4061
|
-
for (var name in all)
|
|
4062
|
-
__defProp2(target, name, { get: all[name], enumerable: !0 });
|
|
4063
|
-
}, __copyProps2 = (to, from, except, desc) => {
|
|
4064
|
-
if (from && typeof from == "object" || typeof from == "function")
|
|
4065
|
-
for (let key of __getOwnPropNames2(from))
|
|
4066
|
-
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
4067
|
-
return to;
|
|
4068
|
-
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), useTheme_exports = {};
|
|
4069
|
-
__export2(useTheme_exports, {
|
|
4070
|
-
activeThemeManagers: () => activeThemeManagers,
|
|
4071
|
-
getThemeManager: () => getThemeManager,
|
|
4072
|
-
getThemeProxied: () => getThemeProxied,
|
|
4073
|
-
useChangeThemeEffect: () => useChangeThemeEffect,
|
|
4074
|
-
useTheme: () => useTheme4,
|
|
4075
|
-
useThemeWithState: () => useThemeWithState
|
|
4076
|
-
});
|
|
4077
|
-
module2.exports = __toCommonJS2(useTheme_exports);
|
|
4078
|
-
var import_constants4 = require_index_native(), import_react2 = require("react"), import_config = require_config_native(), import_createVariable = require_createVariable_native(), import_createShallowSetState = require_createShallowSetState_native(), import_ThemeManager = require_ThemeManager_native(), import_ThemeManagerContext = require_ThemeManagerContext_native(), emptyProps = { name: null }, cached;
|
|
4079
|
-
function getDefaultThemeProxied() {
|
|
4080
|
-
if (cached)
|
|
4081
|
-
return cached;
|
|
4082
|
-
let config = (0, import_config.getConfig)(), name = config.themes.light ? "light" : Object.keys(config.themes)[0], defaultTheme = config.themes[name];
|
|
4083
|
-
return cached = getThemeProxied({ theme: defaultTheme, name }), cached;
|
|
4084
|
-
}
|
|
4085
|
-
var useTheme4 = (props = emptyProps) => {
|
|
4086
|
-
let [_, theme] = useThemeWithState(props);
|
|
4087
|
-
return theme || getDefaultThemeProxied();
|
|
4088
|
-
}, useThemeWithState = (props) => {
|
|
4089
|
-
let keys = (0, import_react2.useRef)([]), changedThemeState = useChangeThemeEffect(
|
|
4090
|
-
props,
|
|
4091
|
-
!1,
|
|
4092
|
-
keys.current,
|
|
4093
|
-
import_constants4.isServer ? void 0 : () => {
|
|
4094
|
-
var _a, _b;
|
|
4095
|
-
let next = ((_a = props.shouldUpdate) == null ? void 0 : _a.call(props)) ?? (keys.current.length > 0 ? !0 : void 0);
|
|
4096
|
-
return process.env.NODE_ENV === "development" && typeof props.debug == "string" && props.debug !== "profile" && console.info(" \u{1F3A8} useTheme() shouldUpdate?", next, {
|
|
4097
|
-
shouldUpdateProp: (_b = props.shouldUpdate) == null ? void 0 : _b.call(props),
|
|
4098
|
-
keys: [...keys.current]
|
|
4099
|
-
}), next;
|
|
4100
|
-
}
|
|
4101
|
-
), { themeManager, state } = changedThemeState;
|
|
4102
|
-
process.env.NODE_ENV === "development" && (state != null && state.theme || process.env.TAMAGUI_DISABLE_NO_THEME_WARNING !== "1" && console.warn(
|
|
4103
|
-
`[tamagui] No theme found, this could be due to an invalid theme name (given theme props ${JSON.stringify(
|
|
4104
|
-
props
|
|
4105
|
-
)}).
|
|
4106
|
-
|
|
4107
|
-
If this is intended and you are using Tamagui without any themes, you can disable this warning by setting the environment variable TAMAGUI_DISABLE_NO_THEME_WARNING=1`
|
|
4108
|
-
));
|
|
4109
|
-
let themeProxied = (0, import_react2.useMemo)(() => !themeManager || !(state != null && state.theme) ? {} : getThemeProxied(state, props.deopt, themeManager, keys.current, props.debug), [state == null ? void 0 : state.theme, themeManager, props.deopt, props.debug]);
|
|
4110
|
-
return process.env.NODE_ENV === "development" && props.debug === "verbose" && (console.groupCollapsed(" \u{1F539} useTheme =>", state == null ? void 0 : state.name), console.info("returning state", changedThemeState, "from props", props), console.groupEnd()), [changedThemeState, themeProxied];
|
|
4111
|
-
};
|
|
4112
|
-
function getThemeProxied({ theme, name, scheme }, deopt = !1, themeManager, keys, debug) {
|
|
4113
|
-
if (!theme)
|
|
4114
|
-
return {};
|
|
4115
|
-
let config = (0, import_config.getConfig)();
|
|
4116
|
-
function track(key) {
|
|
4117
|
-
keys && !keys.includes(key) && (keys.push(key), process.env.NODE_ENV === "development" && debug && console.info(` \u{1F3A8} useTheme() tracking new key: ${key}`));
|
|
4118
|
-
}
|
|
4119
|
-
return new Proxy(theme, {
|
|
4120
|
-
has(_, key) {
|
|
4121
|
-
if (Reflect.has(theme, key))
|
|
4122
|
-
return !0;
|
|
4123
|
-
if (typeof key == "string")
|
|
4124
|
-
return key[0] === "$" && (key = key.slice(1)), themeManager == null ? void 0 : themeManager.allKeys.has(key);
|
|
4125
|
-
},
|
|
4126
|
-
get(_, key) {
|
|
4127
|
-
if (
|
|
4128
|
-
// dont ask me, idk why but on hermes you can see that useTheme()[undefined] passes in STRING undefined to proxy
|
|
4129
|
-
// if someone is crazy enough to use "undefined" as a theme key then this not working is on them
|
|
4130
|
-
key !== "undefined" && typeof key == "string"
|
|
4131
|
-
) {
|
|
4132
|
-
let keyString = key[0] === "$" ? key.slice(1) : key, val = theme[keyString];
|
|
4133
|
-
if (val && typeof val == "object")
|
|
4134
|
-
return new Proxy(val, {
|
|
4135
|
-
// when they touch the actual value we only track it
|
|
4136
|
-
// if its a variable (web), its ignored!
|
|
4137
|
-
get(_2, subkey) {
|
|
4138
|
-
if (subkey === "val")
|
|
4139
|
-
track(keyString);
|
|
4140
|
-
else if (subkey === "get")
|
|
4141
|
-
return (platform) => {
|
|
4142
|
-
let outVal = (0, import_createVariable.getVariable)(val);
|
|
4143
|
-
if (platform !== "web" && import_constants4.isIos && !deopt && config.settings.fastSchemeChange && !someParentIsInversed(themeManager) && scheme) {
|
|
4144
|
-
let oppositeThemeName = name.replace(
|
|
4145
|
-
scheme === "dark" ? "dark" : "light",
|
|
4146
|
-
scheme === "dark" ? "light" : "dark"
|
|
4147
|
-
), oppositeTheme = config.themes[oppositeThemeName], oppositeVal = (0, import_createVariable.getVariable)(oppositeTheme == null ? void 0 : oppositeTheme[keyString]);
|
|
4148
|
-
if (oppositeVal)
|
|
4149
|
-
return {
|
|
4150
|
-
dynamic: {
|
|
4151
|
-
dark: scheme === "dark" ? outVal : oppositeVal,
|
|
4152
|
-
light: scheme === "light" ? outVal : oppositeVal
|
|
4153
|
-
}
|
|
4154
|
-
};
|
|
4155
|
-
}
|
|
4156
|
-
return track(keyString), outVal;
|
|
4157
|
-
};
|
|
4158
|
-
return Reflect.get(val, subkey);
|
|
4159
|
-
}
|
|
4160
|
-
});
|
|
4161
|
-
if (process.env.NODE_ENV === "development" && process.env.TAMAGUI_FEAT_THROW_ON_MISSING_THEME_VALUE === "1")
|
|
4162
|
-
throw new Error(
|
|
4163
|
-
`[tamagui] No theme key "${key}" found in theme ${name}.
|
|
4164
|
-
Keys in theme: ${Object.keys(
|
|
4165
|
-
theme
|
|
4166
|
-
).join(", ")}`
|
|
4167
|
-
);
|
|
4168
|
-
}
|
|
4169
|
-
return Reflect.get(_, key);
|
|
4170
|
-
}
|
|
4171
|
-
});
|
|
4172
|
-
}
|
|
4173
|
-
function someParentIsInversed(manager) {
|
|
4174
|
-
{
|
|
4175
|
-
let cur = manager;
|
|
4176
|
-
for (; cur; ) {
|
|
4177
|
-
if (!cur.parentManager)
|
|
4178
|
-
return !1;
|
|
4179
|
-
if (cur.parentManager.state.scheme !== cur.state.scheme)
|
|
4180
|
-
return !0;
|
|
4181
|
-
cur = cur.parentManager;
|
|
4182
|
-
}
|
|
4183
|
-
}
|
|
4184
|
-
return !1;
|
|
4185
|
+
return result;
|
|
4186
|
+
};
|
|
4187
|
+
function mergeStyle(styleState, key, val, disableNormalize = !1) {
|
|
4188
|
+
let { classNames, viewProps, style, usedKeys, styleProps } = styleState;
|
|
4189
|
+
if (import_constants4.isWeb && (val == null ? void 0 : val[0]) === "_")
|
|
4190
|
+
classNames[key] = val, usedKeys[key] ||= 1;
|
|
4191
|
+
else if (key in import_helpers.stylePropsTransform)
|
|
4192
|
+
styleState.transforms ||= {}, styleState.transforms[key] = val;
|
|
4193
|
+
else {
|
|
4194
|
+
let out = import_constants4.isWeb && !disableNormalize && !styleProps.noNormalize ? (0, import_normalizeValueWithProperty.normalizeValueWithProperty)(val, key) : val;
|
|
4195
|
+
key in import_helpers.validStylesOnBaseProps ? viewProps[key] = out : style[key] = out;
|
|
4196
|
+
}
|
|
4185
4197
|
}
|
|
4186
|
-
var
|
|
4187
|
-
|
|
4188
|
-
|
|
4189
|
-
|
|
4198
|
+
var getSubStyle = (styleState, subKey, styleIn, avoidMergeTransform) => {
|
|
4199
|
+
let { staticConfig, props, conf: conf2, styleProps } = styleState, styleOut = {};
|
|
4200
|
+
for (let key in styleIn) {
|
|
4201
|
+
let val = styleIn[key];
|
|
4202
|
+
key = conf2.shorthands[key] || key;
|
|
4203
|
+
let expanded = (0, import_propMapper.propMapper)(key, val, styleState, { ...props, ...props[subKey] });
|
|
4204
|
+
if (!(!expanded || !staticConfig.isHOC && key in skipProps && !styleProps.noSkip))
|
|
4205
|
+
for (let [skey, sval] of expanded)
|
|
4206
|
+
!avoidMergeTransform && skey in import_helpers.stylePropsTransform ? mergeTransform(styleOut, skey, sval) : styleOut[skey] = styleProps.noNormalize ? sval : (0, import_normalizeValueWithProperty.normalizeValueWithProperty)(sval, key);
|
|
4190
4207
|
}
|
|
4191
|
-
|
|
4192
|
-
|
|
4193
|
-
|
|
4194
|
-
|
|
4195
|
-
|
|
4196
|
-
|
|
4197
|
-
|
|
4198
|
-
|
|
4199
|
-
|
|
4200
|
-
|
|
4201
|
-
|
|
4202
|
-
if (!manager || !forceShouldChange && forceUpdate === !1)
|
|
4203
|
-
return;
|
|
4204
|
-
let next = nextState || manager.getState(props, parentManager);
|
|
4205
|
-
if (forceShouldChange || next && !(forceUpdate !== !0 && !manager.getStateShouldChange(next, prevState)))
|
|
4206
|
-
return next;
|
|
4208
|
+
return styleProps.noNormalize || (0, import_expandStyles.fixStyles)(styleOut), styleOut;
|
|
4209
|
+
};
|
|
4210
|
+
function mergeStylePropIntoStyle(styleState, cur) {
|
|
4211
|
+
if (!cur)
|
|
4212
|
+
return;
|
|
4213
|
+
let styles = Array.isArray(cur) ? cur : [cur];
|
|
4214
|
+
for (let style of styles) {
|
|
4215
|
+
if (!style)
|
|
4216
|
+
continue;
|
|
4217
|
+
let isRNW = style.$$css;
|
|
4218
|
+
Object.assign(isRNW ? styleState.classNames : styleState.style, style);
|
|
4207
4219
|
}
|
|
4208
|
-
|
|
4209
|
-
|
|
4210
|
-
|
|
4211
|
-
|
|
4212
|
-
|
|
4213
|
-
|
|
4214
|
-
|
|
4215
|
-
|
|
4216
|
-
|
|
4217
|
-
|
|
4218
|
-
|
|
4219
|
-
|
|
4220
|
-
|
|
4221
|
-
|
|
4222
|
-
|
|
4223
|
-
|
|
4224
|
-
|
|
4225
|
-
|
|
4226
|
-
|
|
4227
|
-
|
|
4228
|
-
|
|
4229
|
-
|
|
4230
|
-
|
|
4231
|
-
|
|
4232
|
-
|
|
4233
|
-
|
|
4234
|
-
|
|
4235
|
-
|
|
4236
|
-
|
|
4220
|
+
}
|
|
4221
|
+
var useInsertEffectCompat = import_constants4.isWeb ? import_react2.useInsertionEffect || import_constants4.useIsomorphicLayoutEffect : () => {
|
|
4222
|
+
}, useSplitStyles = (...args) => {
|
|
4223
|
+
let res = getSplitStyles(...args);
|
|
4224
|
+
return useInsertEffectCompat(() => {
|
|
4225
|
+
(0, import_insertStyleRule.insertStyleRules)(res.rulesToInsert);
|
|
4226
|
+
}, [res.rulesToInsert]), res;
|
|
4227
|
+
}, animatableDefaults = {
|
|
4228
|
+
opacity: 1,
|
|
4229
|
+
scale: 1,
|
|
4230
|
+
rotate: "0deg",
|
|
4231
|
+
rotateY: "0deg",
|
|
4232
|
+
rotateX: "0deg",
|
|
4233
|
+
x: 0,
|
|
4234
|
+
y: 0
|
|
4235
|
+
}, lowercaseHyphenate = (match) => `-${match.toLowerCase()}`, hyphenate = (str) => str.replace(/[A-Z]/g, lowercaseHyphenate), mergeTransform = (obj, key, val, backwards = !1) => {
|
|
4236
|
+
typeof obj.transform != "string" && (obj.transform ||= [], obj.transform[backwards ? "unshift" : "push"]({
|
|
4237
|
+
[mapTransformKeys[key] || key]: val
|
|
4238
|
+
}));
|
|
4239
|
+
}, mapTransformKeys = {
|
|
4240
|
+
x: "translateX",
|
|
4241
|
+
y: "translateY"
|
|
4242
|
+
}, skipProps = {
|
|
4243
|
+
untilMeasured: 1,
|
|
4244
|
+
animation: 1,
|
|
4245
|
+
space: 1,
|
|
4246
|
+
animateOnly: 1,
|
|
4247
|
+
disableClassName: 1,
|
|
4248
|
+
debug: 1,
|
|
4249
|
+
componentName: 1,
|
|
4250
|
+
disableOptimization: 1,
|
|
4251
|
+
tag: 1,
|
|
4252
|
+
style: 1,
|
|
4253
|
+
// handled after loop so pseudos set usedKeys and override it if necessary
|
|
4254
|
+
group: 1
|
|
4255
|
+
};
|
|
4256
|
+
process.env.NODE_ENV === "test" && (skipProps["data-test-renders"] = 1);
|
|
4257
|
+
Object.assign(skipProps, {
|
|
4258
|
+
whiteSpace: 1,
|
|
4259
|
+
wordWrap: 1,
|
|
4260
|
+
textOverflow: 1,
|
|
4261
|
+
textDecorationDistance: 1,
|
|
4262
|
+
cursor: 1,
|
|
4263
|
+
contain: 1,
|
|
4264
|
+
boxSizing: 1,
|
|
4265
|
+
boxShadow: 1,
|
|
4266
|
+
outlineStyle: 1,
|
|
4267
|
+
outlineOffset: 1,
|
|
4268
|
+
outlineWidth: 1,
|
|
4269
|
+
outlineColor: 1
|
|
4270
|
+
});
|
|
4271
|
+
function passDownProp(viewProps, key, val, shouldMergeObject = !1) {
|
|
4272
|
+
if (shouldMergeObject) {
|
|
4273
|
+
let next = {
|
|
4274
|
+
...viewProps[key],
|
|
4275
|
+
...val
|
|
4237
4276
|
};
|
|
4238
|
-
|
|
4239
|
-
|
|
4240
|
-
|
|
4241
|
-
|
|
4242
|
-
|
|
4243
|
-
|
|
4244
|
-
|
|
4245
|
-
|
|
4246
|
-
|
|
4247
|
-
|
|
4248
|
-
|
|
4249
|
-
|
|
4250
|
-
|
|
4251
|
-
|
|
4252
|
-
|
|
4253
|
-
|
|
4254
|
-
|
|
4255
|
-
|
|
4256
|
-
|
|
4257
|
-
|
|
4258
|
-
|
|
4277
|
+
delete viewProps[key], viewProps[key] = next;
|
|
4278
|
+
} else
|
|
4279
|
+
viewProps[key] = val;
|
|
4280
|
+
}
|
|
4281
|
+
}
|
|
4282
|
+
});
|
|
4283
|
+
|
|
4284
|
+
// ../web/dist/cjs/helpers/mergeProps.native.js
|
|
4285
|
+
var require_mergeProps_native = __commonJS({
|
|
4286
|
+
"../web/dist/cjs/helpers/mergeProps.native.js"(exports2, module2) {
|
|
4287
|
+
"use strict";
|
|
4288
|
+
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
4289
|
+
for (var name in all)
|
|
4290
|
+
__defProp2(target, name, { get: all[name], enumerable: !0 });
|
|
4291
|
+
}, __copyProps2 = (to, from, except, desc) => {
|
|
4292
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
4293
|
+
for (let key of __getOwnPropNames2(from))
|
|
4294
|
+
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
4295
|
+
return to;
|
|
4296
|
+
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), mergeProps_exports = {};
|
|
4297
|
+
__export2(mergeProps_exports, {
|
|
4298
|
+
mergeProps: () => mergeProps
|
|
4299
|
+
});
|
|
4300
|
+
module2.exports = __toCommonJS2(mergeProps_exports);
|
|
4301
|
+
var import_useMedia = require_useMedia_native(), import_pseudoDescriptors = require_pseudoDescriptors_native(), mergeProps = (a, b, inverseShorthands) => {
|
|
4302
|
+
let out = {};
|
|
4303
|
+
for (let key in a)
|
|
4304
|
+
mergeProp(out, a, b, key, inverseShorthands);
|
|
4305
|
+
if (b)
|
|
4306
|
+
for (let key in b)
|
|
4307
|
+
mergeProp(out, b, void 0, key, inverseShorthands);
|
|
4308
|
+
return out;
|
|
4309
|
+
};
|
|
4310
|
+
function mergeProp(out, a, b, key, inverseShorthands) {
|
|
4311
|
+
let longhand = (inverseShorthands == null ? void 0 : inverseShorthands[key]) || null, val = a[key];
|
|
4312
|
+
if (key in import_pseudoDescriptors.pseudoDescriptors || import_useMedia.mediaKeys.has(key)) {
|
|
4313
|
+
out[key] = {
|
|
4314
|
+
...out[key],
|
|
4315
|
+
...val
|
|
4259
4316
|
};
|
|
4260
|
-
|
|
4261
|
-
state,
|
|
4262
|
-
isNewTheme,
|
|
4263
|
-
inversed,
|
|
4264
|
-
themeManager
|
|
4265
|
-
};
|
|
4266
|
-
function createState(prev, force = !1) {
|
|
4267
|
-
if (prev && (shouldUpdate == null ? void 0 : shouldUpdate()) === !1 && !force)
|
|
4268
|
-
return prev;
|
|
4269
|
-
let themeManager2 = parentManager, state2;
|
|
4270
|
-
if ((0, import_ThemeManager.getHasThemeUpdatingProps)(props)) {
|
|
4271
|
-
let getNewThemeManager = () => new import_ThemeManager.ThemeManager(props, isRoot ? "root" : parentManager);
|
|
4272
|
-
if (prev != null && prev.themeManager) {
|
|
4273
|
-
themeManager2 = prev.themeManager;
|
|
4274
|
-
let forceChange = force || !!(keys != null && keys.length), next = themeManager2.getState(props, parentManager), nextState = getShouldUpdateTheme(
|
|
4275
|
-
themeManager2,
|
|
4276
|
-
next,
|
|
4277
|
-
prev.state,
|
|
4278
|
-
forceChange
|
|
4279
|
-
);
|
|
4280
|
-
nextState ? (state2 = nextState, prev.isNewTheme ? themeManager2.updateState(nextState) : themeManager2 = getNewThemeManager()) : prev.isNewTheme && parentManager && !next && (themeManager2 = parentManager);
|
|
4281
|
-
} else
|
|
4282
|
-
themeManager2 = getNewThemeManager(), state2 = { ...themeManager2.state };
|
|
4283
|
-
}
|
|
4284
|
-
let isNewTheme2 = !!(themeManager2 !== parentManager || props.inverse);
|
|
4285
|
-
isNewTheme2 && registerThemeManager(themeManager2);
|
|
4286
|
-
let mounted2 = props.inverse ? isRoot || (prev == null ? void 0 : prev.mounted) : !0;
|
|
4287
|
-
state2 || (isNewTheme2 ? state2 = themeManager2.state : (state2 = parentManager.state, themeManager2 = parentManager));
|
|
4288
|
-
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 = {
|
|
4289
|
-
themeManager: themeManager2,
|
|
4290
|
-
isNewTheme: isNewTheme2,
|
|
4291
|
-
mounted: mounted2,
|
|
4292
|
-
inversed: inversed2
|
|
4293
|
-
}, shouldReturnPrev = prev && !force && // isEqualShallow uses the second arg as the keys so this should compare without state first...
|
|
4294
|
-
(0, import_createShallowSetState.isEqualShallow)(prev, response) && // ... and then compare just the state, because we make a new state obj but is likely the same
|
|
4295
|
-
(0, import_createShallowSetState.isEqualShallow)(prev.state, state2);
|
|
4296
|
-
if (prev && shouldReturnPrev)
|
|
4297
|
-
return prev;
|
|
4298
|
-
if (response.state = state2, process.env.NODE_ENV === "development" && props.debug && import_constants4.isClient) {
|
|
4299
|
-
console.groupCollapsed(` \u{1F537} ${themeManager2.id} useChangeThemeEffect createState`);
|
|
4300
|
-
let parentState = { ...parentManager == null ? void 0 : parentManager.state }, parentId = parentManager == null ? void 0 : parentManager.id, themeManagerState = { ...themeManager2.state };
|
|
4301
|
-
console.info({
|
|
4302
|
-
props,
|
|
4303
|
-
parentState,
|
|
4304
|
-
parentId,
|
|
4305
|
-
themeManager: themeManager2,
|
|
4306
|
-
prev,
|
|
4307
|
-
response,
|
|
4308
|
-
themeManagerState
|
|
4309
|
-
}), console.groupEnd();
|
|
4310
|
-
}
|
|
4311
|
-
return response;
|
|
4317
|
+
return;
|
|
4312
4318
|
}
|
|
4313
|
-
|
|
4319
|
+
b && (key in b || longhand && longhand in b) || (out[longhand || key] = val);
|
|
4320
|
+
}
|
|
4314
4321
|
}
|
|
4315
4322
|
});
|
|
4316
4323
|
|
|
@@ -15114,7 +15121,7 @@ var require_Popper_native = __commonJS({
|
|
|
15114
15121
|
usePopperContext: () => usePopperContext
|
|
15115
15122
|
});
|
|
15116
15123
|
module2.exports = __toCommonJS2(Popper_exports);
|
|
15117
|
-
var import_compose_refs = require_index_native10(), import_constants4 = require_index_native(),
|
|
15124
|
+
var import_compose_refs = require_index_native10(), import_constants4 = require_index_native(), import_core13 = require_index_native15(), import_floating = require_index_native53(), import_get_token2 = require_index_native17(), import_stacks3 = require_index_native19(), React2 = __toESM2(require("react")), import_react_native4 = require("react-native"), import_jsx_runtime6 = require("react/jsx-runtime"), PopperContext = (0, import_core13.createStyledContext)({}), { useStyledContext: usePopperContext, Provider: PopperProvider } = PopperContext;
|
|
15118
15125
|
function Popper(props) {
|
|
15119
15126
|
let {
|
|
15120
15127
|
children,
|
|
@@ -15126,7 +15133,7 @@ var require_Popper_native = __commonJS({
|
|
|
15126
15133
|
offset: offset2,
|
|
15127
15134
|
__scopePopper
|
|
15128
15135
|
} = props, [isMounted, setIsMounted] = React2.useState(!1);
|
|
15129
|
-
(0,
|
|
15136
|
+
(0, import_constants4.useIsomorphicLayoutEffect)(() => {
|
|
15130
15137
|
setIsMounted(!0);
|
|
15131
15138
|
}, []);
|
|
15132
15139
|
let [anchorRef, setAnchorRef] = React2.useState(), [arrowEl, setArrow] = React2.useState(null), [arrowSize, setArrowSize] = React2.useState(0), offsetOptions = offset2 ?? arrowSize, floating = (0, import_floating.useFloating)({
|
|
@@ -15146,10 +15153,10 @@ var require_Popper_native = __commonJS({
|
|
|
15146
15153
|
// @ts-expect-error this comes from Tooltip for example
|
|
15147
15154
|
open
|
|
15148
15155
|
} = floating;
|
|
15149
|
-
if ((0,
|
|
15156
|
+
if ((0, import_constants4.useIsomorphicLayoutEffect)(() => {
|
|
15150
15157
|
floating.refs.setReference(anchorRef);
|
|
15151
15158
|
}, [anchorRef]), import_constants4.isWeb)
|
|
15152
|
-
(0,
|
|
15159
|
+
(0, import_constants4.useIsomorphicLayoutEffect)(() => {
|
|
15153
15160
|
if (open && refs.reference.current && refs.floating.current)
|
|
15154
15161
|
return (0, import_floating.autoUpdate)(refs.reference.current, refs.floating.current, floating.update);
|
|
15155
15162
|
}, [open, floating.update, refs.floating, refs.reference]);
|
|
@@ -15164,7 +15171,7 @@ var require_Popper_native = __commonJS({
|
|
|
15164
15171
|
return () => {
|
|
15165
15172
|
showSubscription.remove(), hideSubscription.remove();
|
|
15166
15173
|
};
|
|
15167
|
-
}, []), (0,
|
|
15174
|
+
}, []), (0, import_constants4.useIsomorphicLayoutEffect)(() => {
|
|
15168
15175
|
floating.update();
|
|
15169
15176
|
}, [dimensions, keyboardOpen]);
|
|
15170
15177
|
}
|
|
@@ -15235,7 +15242,7 @@ var require_Popper_native = __commonJS({
|
|
|
15235
15242
|
), [placement, strategy, props]), [hasInitialPosition, setHasInitialPosition] = React2.useState(!0);
|
|
15236
15243
|
if (React2.useEffect(() => {
|
|
15237
15244
|
(x || y) && setHasInitialPosition(!1);
|
|
15238
|
-
}, [x, y]), (0,
|
|
15245
|
+
}, [x, y]), (0, import_constants4.useIsomorphicLayoutEffect)(() => {
|
|
15239
15246
|
isMounted && update();
|
|
15240
15247
|
}, [isMounted]), !isMounted)
|
|
15241
15248
|
return null;
|
|
@@ -15254,7 +15261,7 @@ var require_Popper_native = __commonJS({
|
|
|
15254
15261
|
animateOnly: rest.animateOnly
|
|
15255
15262
|
}
|
|
15256
15263
|
};
|
|
15257
|
-
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
15264
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_core13.Stack, { ...getFloatingProps ? getFloatingProps(frameProps) : frameProps, children: contents });
|
|
15258
15265
|
}), PopperArrowFrame = (0, import_core13.styled)(import_stacks3.YStack, {
|
|
15259
15266
|
name: "PopperArrow",
|
|
15260
15267
|
variants: {
|
|
@@ -15302,7 +15309,7 @@ var require_Popper_native = __commonJS({
|
|
|
15302
15309
|
if (primaryPlacement) {
|
|
15303
15310
|
arrowStyle[isVertical ? "width" : "height"] = size2 * 2;
|
|
15304
15311
|
let oppSide = opposites[primaryPlacement];
|
|
15305
|
-
oppSide && (arrowStyle[oppSide] = -size2, innerArrowStyle[oppSide] = size2 / 2), oppSide === "bottom" && (arrowStyle[oppSide] += 1), (oppSide === "top" || oppSide === "bottom") && (arrowStyle.left = 0), (oppSide === "left" || oppSide === "right") && (arrowStyle.top = 0), (0,
|
|
15312
|
+
oppSide && (arrowStyle[oppSide] = -size2, innerArrowStyle[oppSide] = size2 / 2), oppSide === "bottom" && (arrowStyle[oppSide] += 1), (oppSide === "top" || oppSide === "bottom") && (arrowStyle.left = 0), (oppSide === "left" || oppSide === "right") && (arrowStyle.top = 0), (0, import_constants4.useIsomorphicLayoutEffect)(() => {
|
|
15306
15313
|
var _a2;
|
|
15307
15314
|
(_a2 = context.onArrowSize) == null || _a2.call(context, size2);
|
|
15308
15315
|
}, [size2, context.onArrowSize]);
|