@tamagui/core 1.82.0 → 1.82.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/index.native.js +15 -14
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/index.native.js +15 -14
- package/dist/esm/index.native.js.map +1 -1
- package/dist/native.js +205 -274
- package/dist/native.js.map +3 -3
- package/dist/test.native.js +200 -262
- package/dist/test.native.js.map +3 -3
- package/package.json +6 -6
- package/src/index.tsx +15 -8
package/dist/native.js
CHANGED
|
@@ -1565,36 +1565,6 @@ var require_insertStyleRule_native = __commonJS({
|
|
|
1565
1565
|
}
|
|
1566
1566
|
});
|
|
1567
1567
|
|
|
1568
|
-
// ../web/dist/cjs/helpers/createProxy.native.js
|
|
1569
|
-
var require_createProxy_native = __commonJS({
|
|
1570
|
-
"../web/dist/cjs/helpers/createProxy.native.js"(exports, module2) {
|
|
1571
|
-
"use strict";
|
|
1572
|
-
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
1573
|
-
for (var name in all)
|
|
1574
|
-
__defProp2(target, name, { get: all[name], enumerable: !0 });
|
|
1575
|
-
}, __copyProps2 = (to, from, except, desc) => {
|
|
1576
|
-
if (from && typeof from == "object" || typeof from == "function")
|
|
1577
|
-
for (let key of __getOwnPropNames2(from))
|
|
1578
|
-
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
1579
|
-
return to;
|
|
1580
|
-
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), createProxy_exports = {};
|
|
1581
|
-
__export2(createProxy_exports, {
|
|
1582
|
-
createProxy: () => createProxy
|
|
1583
|
-
});
|
|
1584
|
-
module2.exports = __toCommonJS2(createProxy_exports);
|
|
1585
|
-
function createProxy(target, handler) {
|
|
1586
|
-
return process.env.NODE_ENV === "development" && (typeof target != "object" || !target) && console.warn(
|
|
1587
|
-
"Invalid object given for proxy:",
|
|
1588
|
-
target,
|
|
1589
|
-
`
|
|
1590
|
-
|
|
1591
|
-
This can be due to a missing theme or configuration given to Tamagui.`,
|
|
1592
|
-
new Error().stack
|
|
1593
|
-
), new Proxy(target || {}, handler);
|
|
1594
|
-
}
|
|
1595
|
-
}
|
|
1596
|
-
});
|
|
1597
|
-
|
|
1598
1568
|
// ../web/dist/cjs/helpers/matchMedia.native.js
|
|
1599
1569
|
var require_matchMedia_native = __commonJS({
|
|
1600
1570
|
"../web/dist/cjs/helpers/matchMedia.native.js"(exports, module2) {
|
|
@@ -1683,117 +1653,6 @@ var require_pseudoDescriptors_native = __commonJS({
|
|
|
1683
1653
|
}
|
|
1684
1654
|
});
|
|
1685
1655
|
|
|
1686
|
-
// ../web/dist/cjs/helpers/objectIdentityKey.native.js
|
|
1687
|
-
var require_objectIdentityKey_native = __commonJS({
|
|
1688
|
-
"../web/dist/cjs/helpers/objectIdentityKey.native.js"(exports, module2) {
|
|
1689
|
-
"use strict";
|
|
1690
|
-
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
1691
|
-
for (var name in all)
|
|
1692
|
-
__defProp2(target, name, { get: all[name], enumerable: !0 });
|
|
1693
|
-
}, __copyProps2 = (to, from, except, desc) => {
|
|
1694
|
-
if (from && typeof from == "object" || typeof from == "function")
|
|
1695
|
-
for (let key of __getOwnPropNames2(from))
|
|
1696
|
-
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
1697
|
-
return to;
|
|
1698
|
-
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), objectIdentityKey_exports = {};
|
|
1699
|
-
__export2(objectIdentityKey_exports, {
|
|
1700
|
-
objectIdentityKey: () => objectIdentityKey
|
|
1701
|
-
});
|
|
1702
|
-
module2.exports = __toCommonJS2(objectIdentityKey_exports);
|
|
1703
|
-
function objectIdentityKey(obj) {
|
|
1704
|
-
let k = "";
|
|
1705
|
-
for (let key in obj) {
|
|
1706
|
-
k += key;
|
|
1707
|
-
let arg = obj[key], type = typeof arg;
|
|
1708
|
-
if (!arg || type !== "object" && type !== "function")
|
|
1709
|
-
k += type + arg;
|
|
1710
|
-
else if (cache.has(arg))
|
|
1711
|
-
k += cache.get(arg);
|
|
1712
|
-
else {
|
|
1713
|
-
let v = Math.random();
|
|
1714
|
-
cache.set(arg, v), k += v;
|
|
1715
|
-
}
|
|
1716
|
-
}
|
|
1717
|
-
return k;
|
|
1718
|
-
}
|
|
1719
|
-
var cache = /* @__PURE__ */ new WeakMap();
|
|
1720
|
-
}
|
|
1721
|
-
});
|
|
1722
|
-
|
|
1723
|
-
// ../web/dist/cjs/helpers/createStyledContext.native.js
|
|
1724
|
-
var require_createStyledContext_native = __commonJS({
|
|
1725
|
-
"../web/dist/cjs/helpers/createStyledContext.native.js"(exports, module2) {
|
|
1726
|
-
"use strict";
|
|
1727
|
-
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
1728
|
-
for (var name in all)
|
|
1729
|
-
__defProp2(target, name, { get: all[name], enumerable: !0 });
|
|
1730
|
-
}, __copyProps2 = (to, from, except, desc) => {
|
|
1731
|
-
if (from && typeof from == "object" || typeof from == "function")
|
|
1732
|
-
for (let key of __getOwnPropNames2(from))
|
|
1733
|
-
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
1734
|
-
return to;
|
|
1735
|
-
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), createStyledContext_exports = {};
|
|
1736
|
-
__export2(createStyledContext_exports, {
|
|
1737
|
-
createStyledContext: () => createStyledContext
|
|
1738
|
-
});
|
|
1739
|
-
module2.exports = __toCommonJS2(createStyledContext_exports);
|
|
1740
|
-
var import_react3 = require("react"), import_objectIdentityKey = require_objectIdentityKey_native(), import_jsx_runtime = require("react/jsx-runtime");
|
|
1741
|
-
function createStyledContext(defaultValues) {
|
|
1742
|
-
let OGContext = (0, import_react3.createContext)(defaultValues), OGProvider = OGContext.Provider, Context = OGContext, scopedContexts = /* @__PURE__ */ new Map(), Provider = ({
|
|
1743
|
-
children,
|
|
1744
|
-
scope,
|
|
1745
|
-
...values
|
|
1746
|
-
}) => {
|
|
1747
|
-
let next = (0, import_react3.useMemo)(() => ({
|
|
1748
|
-
// this ! is a workaround for ts error
|
|
1749
|
-
...defaultValues,
|
|
1750
|
-
...values
|
|
1751
|
-
}), [(0, import_objectIdentityKey.objectIdentityKey)(values)]), Provider2 = OGProvider;
|
|
1752
|
-
if (scope) {
|
|
1753
|
-
let ScopedContext = scopedContexts.get(scope);
|
|
1754
|
-
ScopedContext || (ScopedContext = (0, import_react3.createContext)(defaultValues), scopedContexts.set(scope, ScopedContext)), Provider2 = ScopedContext.Provider;
|
|
1755
|
-
}
|
|
1756
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Provider2, { value: next, children });
|
|
1757
|
-
}, useStyledContext = (scope) => {
|
|
1758
|
-
let context = scope ? scopedContexts.get(scope) : OGContext;
|
|
1759
|
-
return (0, import_react3.useContext)(context);
|
|
1760
|
-
};
|
|
1761
|
-
return Context.Provider = Provider, Context.props = defaultValues, Context.context = OGContext, Context.useStyledContext = useStyledContext, Context;
|
|
1762
|
-
}
|
|
1763
|
-
}
|
|
1764
|
-
});
|
|
1765
|
-
|
|
1766
|
-
// ../web/dist/cjs/contexts/ComponentContext.native.js
|
|
1767
|
-
var require_ComponentContext_native = __commonJS({
|
|
1768
|
-
"../web/dist/cjs/contexts/ComponentContext.native.js"(exports, module2) {
|
|
1769
|
-
"use strict";
|
|
1770
|
-
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
1771
|
-
for (var name in all)
|
|
1772
|
-
__defProp2(target, name, { get: all[name], enumerable: !0 });
|
|
1773
|
-
}, __copyProps2 = (to, from, except, desc) => {
|
|
1774
|
-
if (from && typeof from == "object" || typeof from == "function")
|
|
1775
|
-
for (let key of __getOwnPropNames2(from))
|
|
1776
|
-
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
1777
|
-
return to;
|
|
1778
|
-
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), ComponentContext_exports = {};
|
|
1779
|
-
__export2(ComponentContext_exports, {
|
|
1780
|
-
ComponentContext: () => ComponentContext
|
|
1781
|
-
});
|
|
1782
|
-
module2.exports = __toCommonJS2(ComponentContext_exports);
|
|
1783
|
-
var import_createStyledContext = require_createStyledContext_native(), ComponentContext = (0, import_createStyledContext.createStyledContext)({
|
|
1784
|
-
disableSSR: void 0,
|
|
1785
|
-
inText: !1,
|
|
1786
|
-
language: null,
|
|
1787
|
-
animationDriver: null,
|
|
1788
|
-
groups: {
|
|
1789
|
-
emit: null,
|
|
1790
|
-
subscribe: null,
|
|
1791
|
-
state: {}
|
|
1792
|
-
}
|
|
1793
|
-
});
|
|
1794
|
-
}
|
|
1795
|
-
});
|
|
1796
|
-
|
|
1797
1656
|
// ../web/dist/cjs/hooks/useDisableSSR.native.js
|
|
1798
1657
|
var require_useDisableSSR_native = __commonJS({
|
|
1799
1658
|
"../web/dist/cjs/hooks/useDisableSSR.native.js"(exports, module2) {
|
|
@@ -1808,17 +1667,12 @@ var require_useDisableSSR_native = __commonJS({
|
|
|
1808
1667
|
return to;
|
|
1809
1668
|
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), useDisableSSR_exports = {};
|
|
1810
1669
|
__export2(useDisableSSR_exports, {
|
|
1811
|
-
getDisableSSR: () => getDisableSSR
|
|
1812
|
-
useDisableSSR: () => useDisableSSR
|
|
1670
|
+
getDisableSSR: () => getDisableSSR
|
|
1813
1671
|
});
|
|
1814
1672
|
module2.exports = __toCommonJS2(useDisableSSR_exports);
|
|
1815
|
-
var
|
|
1816
|
-
function useDisableSSR() {
|
|
1817
|
-
let componentContext = (0, import_react3.useContext)(import_ComponentContext.ComponentContext);
|
|
1818
|
-
return getDisableSSR(componentContext);
|
|
1819
|
-
}
|
|
1673
|
+
var import_config = require_config_native();
|
|
1820
1674
|
function getDisableSSR(componentContext) {
|
|
1821
|
-
return componentContext.disableSSR ?? (0, import_config.getConfig)().disableSSR;
|
|
1675
|
+
return (componentContext == null ? void 0 : componentContext.disableSSR) ?? (0, import_config.getConfig)().disableSSR;
|
|
1822
1676
|
}
|
|
1823
1677
|
}
|
|
1824
1678
|
});
|
|
@@ -1854,9 +1708,9 @@ var require_useMedia_native = __commonJS({
|
|
|
1854
1708
|
useMedia: () => useMedia2
|
|
1855
1709
|
});
|
|
1856
1710
|
module2.exports = __toCommonJS2(useMedia_exports);
|
|
1857
|
-
var import_constants3 = require_index_native3(), import_react3 = require("react"), import_config = require_config_native(),
|
|
1711
|
+
var import_constants3 = require_index_native3(), import_react3 = require("react"), import_config = require_config_native(), import_matchMedia = require_matchMedia_native(), import_pseudoDescriptors = require_pseudoDescriptors_native(), import_useDisableSSR = require_useDisableSSR_native(), mediaState2 = (
|
|
1858
1712
|
// development only safeguard
|
|
1859
|
-
process.env.NODE_ENV === "development" ?
|
|
1713
|
+
process.env.NODE_ENV === "development" ? new Proxy(
|
|
1860
1714
|
{},
|
|
1861
1715
|
{
|
|
1862
1716
|
get(target, key) {
|
|
@@ -1928,7 +1782,7 @@ var require_useMedia_native = __commonJS({
|
|
|
1928
1782
|
return listeners.add(subscriber), () => listeners.delete(subscriber);
|
|
1929
1783
|
}
|
|
1930
1784
|
function useMedia2(uid, componentContext) {
|
|
1931
|
-
let internal = (0, import_react3.useRef)(), initialState = ((
|
|
1785
|
+
let internal = (0, import_react3.useRef)(), initialState = ((0, import_useDisableSSR.getDisableSSR)(componentContext) || !import_constants3.isWeb ? mediaState2 : initState) || {}, state = (0, import_react3.useSyncExternalStore)(
|
|
1932
1786
|
subscribe,
|
|
1933
1787
|
() => {
|
|
1934
1788
|
if (!internal.current)
|
|
@@ -2154,6 +2008,117 @@ var require_constants_native2 = __commonJS({
|
|
|
2154
2008
|
}
|
|
2155
2009
|
});
|
|
2156
2010
|
|
|
2011
|
+
// ../web/dist/cjs/helpers/objectIdentityKey.native.js
|
|
2012
|
+
var require_objectIdentityKey_native = __commonJS({
|
|
2013
|
+
"../web/dist/cjs/helpers/objectIdentityKey.native.js"(exports, module2) {
|
|
2014
|
+
"use strict";
|
|
2015
|
+
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
2016
|
+
for (var name in all)
|
|
2017
|
+
__defProp2(target, name, { get: all[name], enumerable: !0 });
|
|
2018
|
+
}, __copyProps2 = (to, from, except, desc) => {
|
|
2019
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
2020
|
+
for (let key of __getOwnPropNames2(from))
|
|
2021
|
+
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
2022
|
+
return to;
|
|
2023
|
+
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), objectIdentityKey_exports = {};
|
|
2024
|
+
__export2(objectIdentityKey_exports, {
|
|
2025
|
+
objectIdentityKey: () => objectIdentityKey
|
|
2026
|
+
});
|
|
2027
|
+
module2.exports = __toCommonJS2(objectIdentityKey_exports);
|
|
2028
|
+
function objectIdentityKey(obj) {
|
|
2029
|
+
let k = "";
|
|
2030
|
+
for (let key in obj) {
|
|
2031
|
+
k += key;
|
|
2032
|
+
let arg = obj[key], type = typeof arg;
|
|
2033
|
+
if (!arg || type !== "object" && type !== "function")
|
|
2034
|
+
k += type + arg;
|
|
2035
|
+
else if (cache.has(arg))
|
|
2036
|
+
k += cache.get(arg);
|
|
2037
|
+
else {
|
|
2038
|
+
let v = Math.random();
|
|
2039
|
+
cache.set(arg, v), k += v;
|
|
2040
|
+
}
|
|
2041
|
+
}
|
|
2042
|
+
return k;
|
|
2043
|
+
}
|
|
2044
|
+
var cache = /* @__PURE__ */ new WeakMap();
|
|
2045
|
+
}
|
|
2046
|
+
});
|
|
2047
|
+
|
|
2048
|
+
// ../web/dist/cjs/helpers/createStyledContext.native.js
|
|
2049
|
+
var require_createStyledContext_native = __commonJS({
|
|
2050
|
+
"../web/dist/cjs/helpers/createStyledContext.native.js"(exports, module2) {
|
|
2051
|
+
"use strict";
|
|
2052
|
+
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
2053
|
+
for (var name in all)
|
|
2054
|
+
__defProp2(target, name, { get: all[name], enumerable: !0 });
|
|
2055
|
+
}, __copyProps2 = (to, from, except, desc) => {
|
|
2056
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
2057
|
+
for (let key of __getOwnPropNames2(from))
|
|
2058
|
+
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
2059
|
+
return to;
|
|
2060
|
+
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), createStyledContext_exports = {};
|
|
2061
|
+
__export2(createStyledContext_exports, {
|
|
2062
|
+
createStyledContext: () => createStyledContext
|
|
2063
|
+
});
|
|
2064
|
+
module2.exports = __toCommonJS2(createStyledContext_exports);
|
|
2065
|
+
var import_react3 = require("react"), import_objectIdentityKey = require_objectIdentityKey_native(), import_jsx_runtime = require("react/jsx-runtime");
|
|
2066
|
+
function createStyledContext(defaultValues) {
|
|
2067
|
+
let OGContext = (0, import_react3.createContext)(defaultValues), OGProvider = OGContext.Provider, Context = OGContext, scopedContexts = /* @__PURE__ */ new Map(), Provider = ({
|
|
2068
|
+
children,
|
|
2069
|
+
scope,
|
|
2070
|
+
...values
|
|
2071
|
+
}) => {
|
|
2072
|
+
let next = (0, import_react3.useMemo)(() => ({
|
|
2073
|
+
// this ! is a workaround for ts error
|
|
2074
|
+
...defaultValues,
|
|
2075
|
+
...values
|
|
2076
|
+
}), [(0, import_objectIdentityKey.objectIdentityKey)(values)]), Provider2 = OGProvider;
|
|
2077
|
+
if (scope) {
|
|
2078
|
+
let ScopedContext = scopedContexts.get(scope);
|
|
2079
|
+
ScopedContext || (ScopedContext = (0, import_react3.createContext)(defaultValues), scopedContexts.set(scope, ScopedContext)), Provider2 = ScopedContext.Provider;
|
|
2080
|
+
}
|
|
2081
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Provider2, { value: next, children });
|
|
2082
|
+
}, useStyledContext = (scope) => {
|
|
2083
|
+
let context = scope ? scopedContexts.get(scope) : OGContext;
|
|
2084
|
+
return (0, import_react3.useContext)(context);
|
|
2085
|
+
};
|
|
2086
|
+
return Context.Provider = Provider, Context.props = defaultValues, Context.context = OGContext, Context.useStyledContext = useStyledContext, Context;
|
|
2087
|
+
}
|
|
2088
|
+
}
|
|
2089
|
+
});
|
|
2090
|
+
|
|
2091
|
+
// ../web/dist/cjs/contexts/ComponentContext.native.js
|
|
2092
|
+
var require_ComponentContext_native = __commonJS({
|
|
2093
|
+
"../web/dist/cjs/contexts/ComponentContext.native.js"(exports, module2) {
|
|
2094
|
+
"use strict";
|
|
2095
|
+
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
2096
|
+
for (var name in all)
|
|
2097
|
+
__defProp2(target, name, { get: all[name], enumerable: !0 });
|
|
2098
|
+
}, __copyProps2 = (to, from, except, desc) => {
|
|
2099
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
2100
|
+
for (let key of __getOwnPropNames2(from))
|
|
2101
|
+
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
2102
|
+
return to;
|
|
2103
|
+
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), ComponentContext_exports = {};
|
|
2104
|
+
__export2(ComponentContext_exports, {
|
|
2105
|
+
ComponentContext: () => ComponentContext
|
|
2106
|
+
});
|
|
2107
|
+
module2.exports = __toCommonJS2(ComponentContext_exports);
|
|
2108
|
+
var import_createStyledContext = require_createStyledContext_native(), ComponentContext = (0, import_createStyledContext.createStyledContext)({
|
|
2109
|
+
disableSSR: void 0,
|
|
2110
|
+
inText: !1,
|
|
2111
|
+
language: null,
|
|
2112
|
+
animationDriver: null,
|
|
2113
|
+
groups: {
|
|
2114
|
+
emit: null,
|
|
2115
|
+
subscribe: null,
|
|
2116
|
+
state: {}
|
|
2117
|
+
}
|
|
2118
|
+
});
|
|
2119
|
+
}
|
|
2120
|
+
});
|
|
2121
|
+
|
|
2157
2122
|
// ../web/dist/cjs/defaultComponentState.native.js
|
|
2158
2123
|
var require_defaultComponentState_native = __commonJS({
|
|
2159
2124
|
"../web/dist/cjs/defaultComponentState.native.js"(exports, module2) {
|
|
@@ -2932,10 +2897,10 @@ var require_normalizeColor_native = __commonJS({
|
|
|
2932
2897
|
rgba: () => import_normalize_css_color2.rgba
|
|
2933
2898
|
});
|
|
2934
2899
|
module2.exports = __toCommonJS2(normalizeColor_exports);
|
|
2935
|
-
var
|
|
2900
|
+
var import_normalize_css_color = require_index_native7(), import_normalize_css_color2 = require_index_native7(), normalizeColor = (color, opacity) => {
|
|
2936
2901
|
if (!color)
|
|
2937
2902
|
return;
|
|
2938
|
-
if (color[0] === "$" || color
|
|
2903
|
+
if (color[0] === "$" || color.startsWith("var("))
|
|
2939
2904
|
return color;
|
|
2940
2905
|
let colorProcessed = (0, import_normalize_css_color.normalizeCSSColor)(color);
|
|
2941
2906
|
if (colorProcessed != null) {
|
|
@@ -3061,7 +3026,7 @@ var require_expandStyles_native = __commonJS({
|
|
|
3061
3026
|
function fixStyles(style) {
|
|
3062
3027
|
"elevationAndroid" in style && (style.elevation = style.elevationAndroid, delete style.elevationAndroid), (style.shadowRadius || style.shadowColor || style.shadowOpacity || style.shadowOffset) && Object.assign(style, (0, import_normalizeShadow.normalizeShadow)(style));
|
|
3063
3028
|
for (let key in borderDefaults)
|
|
3064
|
-
key in style &&
|
|
3029
|
+
key in style && (style[borderDefaults[key]] ||= "solid");
|
|
3065
3030
|
}
|
|
3066
3031
|
var nativeStyle = import_constants3.isWeb ? null : "borderStyle", borderDefaults = {
|
|
3067
3032
|
borderWidth: "borderStyle",
|
|
@@ -3236,7 +3201,7 @@ var require_getVariantExtras_native = __commonJS({
|
|
|
3236
3201
|
getVariantExtras: () => getVariantExtras
|
|
3237
3202
|
});
|
|
3238
3203
|
module2.exports = __toCommonJS2(getVariantExtras_exports);
|
|
3239
|
-
var import_createVariable = require_createVariable_native()
|
|
3204
|
+
var import_createVariable = require_createVariable_native();
|
|
3240
3205
|
function getVariantExtras(styleState) {
|
|
3241
3206
|
let { curProps, conf, context, theme } = styleState, fonts = conf.fontsParsed;
|
|
3242
3207
|
context != null && context.language && (fonts = getFontsForLanguage(conf.fontsParsed, context.language));
|
|
@@ -3251,7 +3216,7 @@ var require_getVariantExtras_native = __commonJS({
|
|
|
3251
3216
|
font: fonts[fontFamily] || fonts[styleState.conf.defaultFont],
|
|
3252
3217
|
// TODO do this in splitstlye
|
|
3253
3218
|
// we avoid passing in default props for media queries because that would confuse things like SizableText.size:
|
|
3254
|
-
props:
|
|
3219
|
+
props: new Proxy(curProps, {
|
|
3255
3220
|
// handles shorthands
|
|
3256
3221
|
get(target, key) {
|
|
3257
3222
|
let shorthand = conf.inverseShorthands[key];
|
|
@@ -3326,7 +3291,7 @@ var require_propMapper_native = __commonJS({
|
|
|
3326
3291
|
module2.exports = __toCommonJS2(propMapper_exports);
|
|
3327
3292
|
var import_constants3 = require_index_native3(), import_helpers = require_index_native4(), import_config = require_config_native(), import_isDevTools = require_isDevTools_native(), import_createVariable = require_createVariable_native(), import_expandStyle = require_expandStyle_native(), import_expandStylesAndRemoveNullishValues = require_expandStylesAndRemoveNullishValues_native(), import_getVariantExtras = require_getVariantExtras_native(), import_isObj = require_isObj_native(), import_pseudoDescriptors = require_pseudoDescriptors_native(), propMapper = (key, value, styleStateIn, subPropsIn) => {
|
|
3328
3293
|
var _a;
|
|
3329
|
-
if (!import_constants3.isAndroid && key === "elevationAndroid")
|
|
3294
|
+
if (lastFontFamilyToken = null, !import_constants3.isAndroid && key === "elevationAndroid")
|
|
3330
3295
|
return;
|
|
3331
3296
|
if (value === "unset") {
|
|
3332
3297
|
let unsetVal = (_a = styleStateIn.conf.unset) == null ? void 0 : _a[key];
|
|
@@ -3355,7 +3320,7 @@ var require_propMapper_native = __commonJS({
|
|
|
3355
3320
|
let result = (styleProps.noExpand ? null : (0, import_expandStyle.expandStyle)(key, value)) || [
|
|
3356
3321
|
[key, value]
|
|
3357
3322
|
];
|
|
3358
|
-
return key === "fontFamily" && fontFamilyCache.set(result, lastFontFamilyToken), result;
|
|
3323
|
+
return key === "fontFamily" && lastFontFamilyToken && fontFamilyCache.set(result, lastFontFamilyToken), result;
|
|
3359
3324
|
}
|
|
3360
3325
|
}, resolveVariants = (key, value, styleProps, styleState, parentVariantKey) => {
|
|
3361
3326
|
let { staticConfig, conf, debug } = styleState, { variants } = staticConfig;
|
|
@@ -3608,7 +3573,7 @@ var require_getSplitStyles_native = __commonJS({
|
|
|
3608
3573
|
}), console.groupEnd());
|
|
3609
3574
|
for (let keyOg in props) {
|
|
3610
3575
|
let keyInit = keyOg, valInit = props[keyOg];
|
|
3611
|
-
if (styleProps.disableExpandShorthands || keyInit in shorthands && (keyInit = shorthands[keyInit]), keyInit === "className" || keyInit in usedKeys || keyInit in skipProps && !isHOC)
|
|
3576
|
+
if (styleProps.disableExpandShorthands || keyInit in shorthands && (keyInit = shorthands[keyInit]), keyInit === "className" || keyInit in usedKeys || keyInit in skipProps && !styleProps.noSkip && !isHOC)
|
|
3612
3577
|
continue;
|
|
3613
3578
|
let valInitType = typeof valInit, isValidStyleKeyInit = isValidStyleKey(keyInit, staticConfig);
|
|
3614
3579
|
if (styleState.curProps[keyInit] = valInit, !import_constants3.isAndroid && keyInit === "elevationAndroid")
|
|
@@ -4099,9 +4064,8 @@ var require_proxyThemeVariables_native = __commonJS({
|
|
|
4099
4064
|
proxyThemeVariables: () => proxyThemeVariables
|
|
4100
4065
|
});
|
|
4101
4066
|
module2.exports = __toCommonJS2(proxyThemeVariables_exports);
|
|
4102
|
-
var import_createProxy = require_createProxy_native();
|
|
4103
4067
|
function proxyThemeVariables(obj) {
|
|
4104
|
-
return
|
|
4068
|
+
return new Proxy(obj || {}, {
|
|
4105
4069
|
has(target, key) {
|
|
4106
4070
|
return Reflect.has(target, removeStarting$(key));
|
|
4107
4071
|
},
|
|
@@ -4156,7 +4120,7 @@ var require_ThemeManager_native = __commonJS({
|
|
|
4156
4120
|
module2.exports = __toCommonJS2(ThemeManager_exports);
|
|
4157
4121
|
var import_constants3 = require_index_native3(), import_config = require_config_native(), import_constants22 = require_constants_native2(), emptyState = { name: "" };
|
|
4158
4122
|
function getHasThemeUpdatingProps(props) {
|
|
4159
|
-
return props.name || props.componentName || props.inverse || props.reset;
|
|
4123
|
+
return !!(props.name || props.componentName || props.inverse || props.reset);
|
|
4160
4124
|
}
|
|
4161
4125
|
var uid = 0, ThemeManager = class {
|
|
4162
4126
|
constructor(props = {}, parentManager) {
|
|
@@ -4226,7 +4190,7 @@ var require_ThemeManager_native = __commonJS({
|
|
|
4226
4190
|
let nextName = props.reset ? baseName : props.name || "", allComponentThemes = componentManagers.map((x) => (x == null ? void 0 : x.state.name) || "");
|
|
4227
4191
|
isDirectParentAComponentTheme && allComponentThemes.shift();
|
|
4228
4192
|
let base = baseName.split(import_constants22.THEME_NAME_SEPARATOR), max = base.length, min = props.componentName && !nextName ? max : 0;
|
|
4229
|
-
process.env.NODE_ENV !== "production" &&
|
|
4193
|
+
process.env.NODE_ENV !== "production" && props.debug && typeof window < "u" && (console.groupCollapsed("ThemeManager.getState()"), console.info({ props, baseName, base, min, max }));
|
|
4230
4194
|
for (let i = max; i >= min; i--) {
|
|
4231
4195
|
let prefix = base.slice(0, i).join(import_constants22.THEME_NAME_SEPARATOR);
|
|
4232
4196
|
props.inverse && (prefix = inverseThemeName(prefix));
|
|
@@ -4236,16 +4200,18 @@ var require_ThemeManager_native = __commonJS({
|
|
|
4236
4200
|
lastSegment > 0 && potentials.splice(lastSegment, 0, nextName);
|
|
4237
4201
|
}
|
|
4238
4202
|
if (componentName && !props.reset) {
|
|
4239
|
-
let componentPotentials = [];
|
|
4240
|
-
if (nextName) {
|
|
4241
|
-
let beforeSeparator =
|
|
4203
|
+
let baseLen = base.length, componentPotentials = [];
|
|
4204
|
+
if (nextName && baseLen > 1) {
|
|
4205
|
+
let beforeSeparator = base[0];
|
|
4242
4206
|
componentPotentials.push(`${beforeSeparator}_${nextName}_${componentName}`);
|
|
4243
4207
|
}
|
|
4244
4208
|
if (componentPotentials.push(`${prefix}_${componentName}`), nextName) {
|
|
4245
|
-
|
|
4246
|
-
|
|
4247
|
-
|
|
4248
|
-
|
|
4209
|
+
if (i > baseLen) {
|
|
4210
|
+
let prefixLessOne = base.slice(0, i - 1).join(import_constants22.THEME_NAME_SEPARATOR);
|
|
4211
|
+
if (prefixLessOne) {
|
|
4212
|
+
let lessSpecific = `${prefixLessOne}_${nextName}_${componentName}`;
|
|
4213
|
+
componentPotentials.unshift(lessSpecific);
|
|
4214
|
+
}
|
|
4249
4215
|
}
|
|
4250
4216
|
let moreSpecific = `${prefix}_${nextName}_${componentName}`;
|
|
4251
4217
|
componentPotentials.unshift(moreSpecific);
|
|
@@ -4254,6 +4220,7 @@ var require_ThemeManager_native = __commonJS({
|
|
|
4254
4220
|
}
|
|
4255
4221
|
let found = potentials.find((t) => t in themes);
|
|
4256
4222
|
if (process.env.NODE_ENV !== "production" && typeof props.debug == "string" && console.info(" getState ", {
|
|
4223
|
+
props,
|
|
4257
4224
|
found,
|
|
4258
4225
|
potentials,
|
|
4259
4226
|
baseManager,
|
|
@@ -4285,28 +4252,6 @@ var require_ThemeManager_native = __commonJS({
|
|
|
4285
4252
|
}
|
|
4286
4253
|
});
|
|
4287
4254
|
|
|
4288
|
-
// ../web/dist/cjs/hooks/getThemeUnwrapped.native.js
|
|
4289
|
-
var require_getThemeUnwrapped_native = __commonJS({
|
|
4290
|
-
"../web/dist/cjs/hooks/getThemeUnwrapped.native.js"(exports, module2) {
|
|
4291
|
-
"use strict";
|
|
4292
|
-
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
4293
|
-
for (var name in all)
|
|
4294
|
-
__defProp2(target, name, { get: all[name], enumerable: !0 });
|
|
4295
|
-
}, __copyProps2 = (to, from, except, desc) => {
|
|
4296
|
-
if (from && typeof from == "object" || typeof from == "function")
|
|
4297
|
-
for (let key of __getOwnPropNames2(from))
|
|
4298
|
-
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
4299
|
-
return to;
|
|
4300
|
-
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), getThemeUnwrapped_exports = {};
|
|
4301
|
-
__export2(getThemeUnwrapped_exports, {
|
|
4302
|
-
GetThemeUnwrapped: () => GetThemeUnwrapped,
|
|
4303
|
-
getThemeUnwrapped: () => getThemeUnwrapped
|
|
4304
|
-
});
|
|
4305
|
-
module2.exports = __toCommonJS2(getThemeUnwrapped_exports);
|
|
4306
|
-
var getThemeUnwrapped = (theme) => (theme == null ? void 0 : theme[GetThemeUnwrapped]) || theme, GetThemeUnwrapped = Symbol();
|
|
4307
|
-
}
|
|
4308
|
-
});
|
|
4309
|
-
|
|
4310
4255
|
// ../web/dist/cjs/hooks/useTheme.native.js
|
|
4311
4256
|
var require_useTheme_native = __commonJS({
|
|
4312
4257
|
"../web/dist/cjs/hooks/useTheme.native.js"(exports, module2) {
|
|
@@ -4328,7 +4273,7 @@ var require_useTheme_native = __commonJS({
|
|
|
4328
4273
|
useThemeWithState: () => useThemeWithState
|
|
4329
4274
|
});
|
|
4330
4275
|
module2.exports = __toCommonJS2(useTheme_exports);
|
|
4331
|
-
var import_constants3 = require_index_native3(), import_react3 = require("react"), import_config = require_config_native(), import_createVariable = require_createVariable_native(),
|
|
4276
|
+
var import_constants3 = require_index_native3(), import_react3 = require("react"), import_config = require_config_native(), import_createVariable = require_createVariable_native(), import_createShallowSetState = require_createShallowSetState_native(), import_ThemeManager = require_ThemeManager_native(), import_ThemeManagerContext = require_ThemeManagerContext_native(), emptyProps = { name: null }, cached;
|
|
4332
4277
|
function getDefaultThemeProxied() {
|
|
4333
4278
|
if (cached)
|
|
4334
4279
|
return cached;
|
|
@@ -4369,7 +4314,7 @@ If this is intended and you are using Tamagui without any themes, you can disabl
|
|
|
4369
4314
|
function track(key) {
|
|
4370
4315
|
keys && !keys.includes(key) && (keys.push(key), process.env.NODE_ENV === "development" && debug && console.info(` \u{1F3A8} useTheme() tracking new key: ${key}`));
|
|
4371
4316
|
}
|
|
4372
|
-
return
|
|
4317
|
+
return new Proxy(theme, {
|
|
4373
4318
|
has(_, key) {
|
|
4374
4319
|
if (Reflect.has(theme, key))
|
|
4375
4320
|
return !0;
|
|
@@ -4377,8 +4322,6 @@ If this is intended and you are using Tamagui without any themes, you can disabl
|
|
|
4377
4322
|
return key[0] === "$" && (key = key.slice(1)), themeManager == null ? void 0 : themeManager.allKeys.has(key);
|
|
4378
4323
|
},
|
|
4379
4324
|
get(_, key) {
|
|
4380
|
-
if (key === import_getThemeUnwrapped.GetThemeUnwrapped)
|
|
4381
|
-
return theme;
|
|
4382
4325
|
if (
|
|
4383
4326
|
// dont ask me, idk why but on hermes you can see that useTheme()[undefined] passes in STRING undefined to proxy
|
|
4384
4327
|
// if someone is crazy enough to use "undefined" as a theme key then this not working is on them
|
|
@@ -4526,7 +4469,7 @@ If this is intended and you are using Tamagui without any themes, you can disabl
|
|
|
4526
4469
|
}
|
|
4527
4470
|
let isNewTheme2 = !!(themeManager2 !== parentManager || props.inverse), mounted2 = props.inverse ? isRoot || (prev == null ? void 0 : prev.mounted) : !0;
|
|
4528
4471
|
state2 || (isNewTheme2 ? state2 = themeManager2.state : (state2 = parentManager.state, themeManager2 = parentManager));
|
|
4529
|
-
let wasInversed = prev == null ? void 0 : prev.inversed, inversed2 = isNewTheme2 && state2.scheme !== (parentManager == null ? void 0 : parentManager.state.scheme) ? !0 : wasInversed ? !1 : null, response = {
|
|
4472
|
+
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 = {
|
|
4530
4473
|
themeManager: themeManager2,
|
|
4531
4474
|
isNewTheme: isNewTheme2,
|
|
4532
4475
|
mounted: mounted2,
|
|
@@ -4605,40 +4548,40 @@ var require_Theme_native = __commonJS({
|
|
|
4605
4548
|
)), __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), Theme_exports = {};
|
|
4606
4549
|
__export2(Theme_exports, {
|
|
4607
4550
|
Theme: () => Theme,
|
|
4608
|
-
|
|
4551
|
+
getThemedChildren: () => getThemedChildren
|
|
4609
4552
|
});
|
|
4610
4553
|
module2.exports = __toCommonJS2(Theme_exports);
|
|
4611
|
-
var import_constants3 = require_index_native3(), import_react3 = __toESM2(require("react")), import_createVariable = require_createVariable_native(), import_ThemeManagerContext = require_ThemeManagerContext_native(), import_useTheme = require_useTheme_native(), import_ThemeDebug = require_ThemeDebug_native(), import_jsx_runtime = require("react/jsx-runtime"), Theme = (0, import_react3.forwardRef)(function(props, ref) {
|
|
4554
|
+
var import_constants3 = require_index_native3(), import_react3 = __toESM2(require("react")), import_createVariable = require_createVariable_native(), import_ThemeManagerContext = require_ThemeManagerContext_native(), import_useTheme = require_useTheme_native(), import_ThemeDebug = require_ThemeDebug_native(), import_jsx_runtime = require("react/jsx-runtime"), Theme = (0, import_react3.forwardRef)(function({ children, ...props }, ref) {
|
|
4612
4555
|
if (props.disable)
|
|
4613
|
-
return
|
|
4614
|
-
let isRoot = !!props._isRoot,
|
|
4615
|
-
|
|
4616
|
-
|
|
4617
|
-
|
|
4618
|
-
|
|
4619
|
-
|
|
4620
|
-
|
|
4621
|
-
|
|
4622
|
-
|
|
4623
|
-
|
|
4624
|
-
return process.env.NODE_ENV === "development" && props.debug === "visualize" && (children2 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ThemeDebug.ThemeDebug, { themeState, themeProps: props, children: children2 })), children2;
|
|
4625
|
-
}, [props.children, disableDirectChildTheme]);
|
|
4626
|
-
return useThemedChildren(themeState, children, props, isRoot);
|
|
4556
|
+
return children;
|
|
4557
|
+
let isRoot = !!props._isRoot, themeState = (0, import_useTheme.useChangeThemeEffect)(props, isRoot), finalChildren = props["disable-child-theme"] ? import_react3.Children.map(
|
|
4558
|
+
children,
|
|
4559
|
+
(child) => (0, import_react3.cloneElement)(child, { "data-disable-theme": !0 })
|
|
4560
|
+
) : children;
|
|
4561
|
+
if (ref)
|
|
4562
|
+
try {
|
|
4563
|
+
import_react3.default.Children.only(finalChildren), finalChildren = (0, import_react3.cloneElement)(finalChildren, { ref });
|
|
4564
|
+
} catch {
|
|
4565
|
+
}
|
|
4566
|
+
return process.env.NODE_ENV === "development" && props.debug === "visualize" && (finalChildren = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ThemeDebug.ThemeDebug, { themeState, themeProps: props, children: finalChildren })), getThemedChildren(themeState, finalChildren, props, isRoot);
|
|
4627
4567
|
});
|
|
4628
4568
|
Theme.displayName = "Theme";
|
|
4629
4569
|
Theme.avoidForwardRef = !0;
|
|
4630
|
-
function
|
|
4631
|
-
let { themeManager, isNewTheme } = themeState
|
|
4632
|
-
if (
|
|
4570
|
+
function getThemedChildren(themeState, children, props, isRoot = !1) {
|
|
4571
|
+
let { themeManager, isNewTheme } = themeState;
|
|
4572
|
+
if (!themeManager)
|
|
4573
|
+
throw "\u274C";
|
|
4574
|
+
let { shallow, forceClassName } = props, hasEverThemed = (0, import_react3.useRef)(!1), shouldRenderChildrenWithTheme = isNewTheme || props.inverse || hasEverThemed.current || forceClassName || isRoot;
|
|
4575
|
+
if (shouldRenderChildrenWithTheme && (hasEverThemed.current = !0), !shouldRenderChildrenWithTheme)
|
|
4633
4576
|
return children;
|
|
4634
4577
|
let next = children;
|
|
4635
|
-
shallow &&
|
|
4578
|
+
shallow && (next = import_react3.Children.toArray(children).map((child) => (0, import_react3.isValidElement)(child) ? (0, import_react3.cloneElement)(
|
|
4636
4579
|
child,
|
|
4637
4580
|
void 0,
|
|
4638
4581
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Theme, { name: themeManager.state.parentName, children: child.props.children })
|
|
4639
4582
|
) : child));
|
|
4640
|
-
let elementsWithContext =
|
|
4641
|
-
return forceClassName === !1 ? elementsWithContext : import_constants3.isWeb
|
|
4583
|
+
let elementsWithContext = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ThemeManagerContext.ThemeManagerContext.Provider, { value: themeManager, children: next });
|
|
4584
|
+
return forceClassName === !1 ? elementsWithContext : import_constants3.isWeb ? wrapThemeElements({
|
|
4642
4585
|
children: elementsWithContext,
|
|
4643
4586
|
themeState,
|
|
4644
4587
|
forceClassName,
|
|
@@ -4654,18 +4597,18 @@ var require_Theme_native = __commonJS({
|
|
|
4654
4597
|
var _a;
|
|
4655
4598
|
if (isRoot && forceClassName === !1)
|
|
4656
4599
|
return children;
|
|
4657
|
-
let inverse = themeState.inversed, requiresExtraWrapper = inverse != null || forceClassName;
|
|
4658
|
-
if (!themeState.isNewTheme && !requiresExtraWrapper)
|
|
4659
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "_dsp_contents is_Theme", children });
|
|
4660
|
-
let { className, style } = getThemeClassNameAndStyle(themeState, isRoot), themedChildren = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: `${className} _dsp_contents is_Theme`, style, children });
|
|
4600
|
+
let inverse = themeState.inversed, requiresExtraWrapper = inverse != null || forceClassName, { className, style } = getThemeClassNameAndStyle(themeState, isRoot), themedChildren = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: `${className} _dsp_contents is_Theme`, style, children });
|
|
4661
4601
|
if (requiresExtraWrapper) {
|
|
4662
4602
|
let name = ((_a = themeState.state) == null ? void 0 : _a.name) || "", inverseClassName = name.startsWith("light") ? "t_light is_inversed" : name.startsWith("dark") ? "t_dark is_inversed" : "";
|
|
4663
4603
|
themedChildren = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: `${inverse ? inverseClassName : ""} _dsp_contents`, children: themedChildren });
|
|
4664
4604
|
}
|
|
4665
4605
|
return themedChildren;
|
|
4666
4606
|
}
|
|
4607
|
+
var emptyObj = {};
|
|
4667
4608
|
function getThemeClassNameAndStyle(themeState, isRoot = !1) {
|
|
4668
4609
|
var _a, _b;
|
|
4610
|
+
if (!themeState.isNewTheme)
|
|
4611
|
+
return { className: "", style: emptyObj };
|
|
4669
4612
|
let themeColor = (_a = themeState.state) != null && _a.theme && themeState.isNewTheme ? (0, import_createVariable.variableToString)(themeState.state.theme.color) : "", style = themeColor ? {
|
|
4670
4613
|
color: themeColor
|
|
4671
4614
|
} : void 0, className = ((_b = themeState.state) == null ? void 0 : _b.className) || "";
|
|
@@ -4691,7 +4634,10 @@ var require_themeable_native = __commonJS({
|
|
|
4691
4634
|
themeable: () => themeable
|
|
4692
4635
|
});
|
|
4693
4636
|
module2.exports = __toCommonJS2(themeable_exports);
|
|
4694
|
-
var import_react3 = require("react"), import_Theme = require_Theme_native(), import_jsx_runtime =
|
|
4637
|
+
var import_react3 = require("react"), import_Theme = require_Theme_native(), import_jsx_runtime = (
|
|
4638
|
+
// @ts-expect-error its ok
|
|
4639
|
+
require("react/jsx-runtime")
|
|
4640
|
+
);
|
|
4695
4641
|
function themeable(Component, staticConfig) {
|
|
4696
4642
|
let withTheme = (0, import_react3.forwardRef)(function(props, ref) {
|
|
4697
4643
|
let { themeInverse, theme, componentName, themeReset, ...rest } = props, element = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Component, { ref, ...rest, "data-disable-theme": !0 });
|
|
@@ -4969,7 +4915,7 @@ var require_createComponent_native = __commonJS({
|
|
|
4969
4915
|
isEntering && enterVariant ? (process.env.NODE_ENV === "development" && debugProp === "verbose" && console.warn(`Animating presence ENTER "${enterVariant}"`), props[enterVariant] = !0) : isExiting2 && exitVariant && (process.env.NODE_ENV === "development" && debugProp === "verbose" && console.warn(`Animating presence EXIT "${enterVariant}"`), props[exitVariant] = !enterExitVariant);
|
|
4970
4916
|
}
|
|
4971
4917
|
}
|
|
4972
|
-
let isAnimatedReactNative = hasAnimationProp && (animationsConfig == null ? void 0 : animationsConfig.isReactNative), isReactNative = !!(staticConfig.isReactNative || isAnimatedReactNative), shouldAvoidClasses = !!(!import_constants3.isWeb || isAnimated || !staticConfig.acceptsClassName || propsIn.disableClassName), shouldForcePseudo = !!propsIn.forceStyle, noClassNames = shouldAvoidClasses || shouldForcePseudo,
|
|
4918
|
+
let isAnimatedReactNative = hasAnimationProp && (animationsConfig == null ? void 0 : animationsConfig.isReactNative), isReactNative = !!(staticConfig.isReactNative || isAnimatedReactNative), shouldAvoidClasses = !!(!import_constants3.isWeb || isAnimated || !staticConfig.acceptsClassName || propsIn.disableClassName), shouldForcePseudo = !!propsIn.forceStyle, noClassNames = shouldAvoidClasses || shouldForcePseudo, disableTheme = isHOC;
|
|
4973
4919
|
process.env.NODE_ENV === "development" && time && time`theme-props`, props.themeShallow && (stateRef.current.themeShallow = !0);
|
|
4974
4920
|
let themeStateProps = {
|
|
4975
4921
|
name: props.theme,
|
|
@@ -5262,7 +5208,7 @@ If you meant to do this, you can disable this warning - either change untilMeasu
|
|
|
5262
5208
|
subscribe: groupState.subscribe
|
|
5263
5209
|
};
|
|
5264
5210
|
}, [groupName]);
|
|
5265
|
-
if (groupName && subGroupContext && (content = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ComponentContext.ComponentContext.Provider, { ...componentContext, groups: subGroupContext, children: content })), process.env.NODE_ENV === "development" && time && time`group-context`, content =
|
|
5211
|
+
if (groupName && subGroupContext && (content = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ComponentContext.ComponentContext.Provider, { ...componentContext, groups: subGroupContext, children: content })), process.env.NODE_ENV === "development" && time && time`group-context`, content = disableTheme ? content : (0, import_Theme.getThemedChildren)(themeState, content, themeStateProps, !1), process.env.NODE_ENV === "development" && time && time`themed-children`, process.env.NODE_ENV === "development" && props.debug === "visualize" && (content = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ThemeDebug.ThemeDebug, { themeState, themeProps: props, children: content })), staticConfig.context) {
|
|
5266
5212
|
let contextProps = staticConfig.context.props;
|
|
5267
5213
|
for (let key in contextProps)
|
|
5268
5214
|
(key in style || key in viewProps) && (overriddenContextProps ||= {}, overriddenContextProps[key] = style[key] ?? viewProps[key]);
|
|
@@ -5602,11 +5548,10 @@ var require_proxyThemeToParents_native = __commonJS({
|
|
|
5602
5548
|
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), proxyThemeToParents_exports = {};
|
|
5603
5549
|
__export2(proxyThemeToParents_exports, {
|
|
5604
5550
|
proxyThemeToParents: () => proxyThemeToParents,
|
|
5605
|
-
proxyThemesToParents: () => proxyThemesToParents
|
|
5606
|
-
themesRaw: () => themesRaw
|
|
5551
|
+
proxyThemesToParents: () => proxyThemesToParents
|
|
5607
5552
|
});
|
|
5608
5553
|
module2.exports = __toCommonJS2(proxyThemeToParents_exports);
|
|
5609
|
-
var import_config = require_config_native(),
|
|
5554
|
+
var import_config = require_config_native(), themesRaw = {};
|
|
5610
5555
|
function proxyThemesToParents(dedupedThemes) {
|
|
5611
5556
|
for (let { names, theme } of dedupedThemes)
|
|
5612
5557
|
for (let name of names)
|
|
@@ -5623,9 +5568,7 @@ var require_proxyThemeToParents_native = __commonJS({
|
|
|
5623
5568
|
let cur = [], parents = themeName.split("_").slice(0, -1).map((part) => (cur.push(part), cur.join("_"))), numParents = parents.length;
|
|
5624
5569
|
return new Proxy(theme, {
|
|
5625
5570
|
get(target, key) {
|
|
5626
|
-
if (key
|
|
5627
|
-
return theme;
|
|
5628
|
-
if (key == null || // dont ask me, idk why but on hermes you can see that useTheme()[undefined] passes in STRING undefined to proxy
|
|
5571
|
+
if (!key || // dont ask me, idk why but on hermes you can see that useTheme()[undefined] passes in STRING undefined to proxy
|
|
5629
5572
|
// if someone is crazy enough to use "undefined" as a theme key then this not working is on them
|
|
5630
5573
|
key == "undefined" || Reflect.has(target, key))
|
|
5631
5574
|
return Reflect.get(target, key);
|
|
@@ -5634,7 +5577,7 @@ var require_proxyThemeToParents_native = __commonJS({
|
|
|
5634
5577
|
if (parent && Reflect.has(parent, key))
|
|
5635
5578
|
return Reflect.get(parent, key);
|
|
5636
5579
|
}
|
|
5637
|
-
return (0, import_config.getTokenObject)(key)
|
|
5580
|
+
return (0, import_config.getTokenObject)(key);
|
|
5638
5581
|
}
|
|
5639
5582
|
});
|
|
5640
5583
|
}
|
|
@@ -5685,14 +5628,14 @@ var require_themes_native = __commonJS({
|
|
|
5685
5628
|
module2.exports = __toCommonJS2(themes_exports);
|
|
5686
5629
|
var import_createVariable = require_createVariable_native();
|
|
5687
5630
|
function ensureThemeVariable(theme, key) {
|
|
5688
|
-
let val = theme[key]
|
|
5689
|
-
(0, import_createVariable.isVariable)(val) ? val.name !==
|
|
5631
|
+
let val = theme[key];
|
|
5632
|
+
(0, import_createVariable.isVariable)(val) ? val.name !== key && (theme[key] = (0, import_createVariable.createVariable)({
|
|
5690
5633
|
key: val.name,
|
|
5691
|
-
name:
|
|
5634
|
+
name: key,
|
|
5692
5635
|
val: val.val
|
|
5693
5636
|
})) : theme[key] = (0, import_createVariable.createVariable)({
|
|
5694
|
-
key
|
|
5695
|
-
name:
|
|
5637
|
+
key,
|
|
5638
|
+
name: key,
|
|
5696
5639
|
val
|
|
5697
5640
|
});
|
|
5698
5641
|
}
|
|
@@ -6042,31 +5985,18 @@ var require_mergeVariants_native = __commonJS({
|
|
|
6042
5985
|
mergeVariants: () => mergeVariants
|
|
6043
5986
|
});
|
|
6044
5987
|
module2.exports = __toCommonJS2(mergeVariants_exports);
|
|
6045
|
-
var mergeVariants = (parentVariants, ourVariants) => {
|
|
5988
|
+
var mergeVariants = (parentVariants, ourVariants, level = 0) => {
|
|
6046
5989
|
let variants = {};
|
|
6047
5990
|
for (let key in ourVariants) {
|
|
6048
5991
|
let parentVariant = parentVariants == null ? void 0 : parentVariants[key], ourVariant = ourVariants[key];
|
|
6049
|
-
|
|
6050
|
-
|
|
6051
|
-
|
|
6052
|
-
|
|
6053
|
-
|
|
6054
|
-
variants[key] = parentVariant[key];
|
|
6055
|
-
continue;
|
|
6056
|
-
}
|
|
6057
|
-
variants[key] = {};
|
|
6058
|
-
for (let subKey in ourVariant) {
|
|
6059
|
-
let val = ourVariant[subKey], parentVal = parentVariant == null ? void 0 : parentVariant[subKey];
|
|
6060
|
-
typeof val == "function" || !parentVal || typeof parentVal == "function" ? variants[key][subKey] = val : variants[key][subKey] = {
|
|
6061
|
-
// keep order
|
|
6062
|
-
...parentVal,
|
|
6063
|
-
...val
|
|
6064
|
-
};
|
|
6065
|
-
}
|
|
6066
|
-
parentVariant && (variants[key] = {
|
|
5992
|
+
!parentVariant || typeof ourVariant == "function" ? variants[key] = ourVariant : parentVariant && !ourVariant ? variants[key] = parentVariant[key] : level === 0 ? variants[key] = mergeVariants(
|
|
5993
|
+
parentVariant,
|
|
5994
|
+
ourVariant,
|
|
5995
|
+
level + 1
|
|
5996
|
+
) : variants[key] = {
|
|
6067
5997
|
...parentVariant,
|
|
6068
|
-
...
|
|
6069
|
-
}
|
|
5998
|
+
...ourVariant
|
|
5999
|
+
};
|
|
6070
6000
|
}
|
|
6071
6001
|
return {
|
|
6072
6002
|
...parentVariants,
|
|
@@ -7278,26 +7208,27 @@ var View = import_web.View, Stack = import_web.Stack, Text = import_web.Text, ba
|
|
|
7278
7208
|
return viewProps;
|
|
7279
7209
|
},
|
|
7280
7210
|
useEvents(viewProps, events, { pseudos }, setStateShallow, staticConfig) {
|
|
7281
|
-
if (events)
|
|
7282
|
-
if (events
|
|
7211
|
+
if (events && (events.onFocus && (viewProps.onFocus = events.onFocus), events.onBlur && (viewProps.onBlur = events.onBlur)), staticConfig.isInput) {
|
|
7212
|
+
if (events) {
|
|
7283
7213
|
let { onPressIn, onPressOut, onPress } = events, inputEvents = {
|
|
7284
7214
|
onPressIn,
|
|
7285
7215
|
onPressOut: onPressOut || onPress
|
|
7286
7216
|
};
|
|
7287
7217
|
onPressOut && onPress && (inputEvents.onPressOut = (0, import_web.composeEventHandlers)(onPress, onPressOut)), Object.assign(viewProps, inputEvents);
|
|
7288
|
-
} else {
|
|
7289
|
-
viewProps.hitSlop && (events.hitSlop = viewProps.hitSlop);
|
|
7290
|
-
let pressability = usePressability(events);
|
|
7291
|
-
if (process.env.NODE_ENV === "development" && viewProps.debug && console.info(
|
|
7292
|
-
`Checking for press ${!!events.onPress} then applying pressability props: ${Object.keys(
|
|
7293
|
-
pressability || {}
|
|
7294
|
-
)}`
|
|
7295
|
-
), events.onPress)
|
|
7296
|
-
for (let key in pressability) {
|
|
7297
|
-
let og = viewProps[key], val = pressability[key];
|
|
7298
|
-
viewProps[key] = og && !dontComposePressabilityKeys[key] ? (0, import_web.composeEventHandlers)(og, val) : val;
|
|
7299
|
-
}
|
|
7300
7218
|
}
|
|
7219
|
+
} else {
|
|
7220
|
+
events && viewProps.hitSlop && (events.hitSlop = viewProps.hitSlop);
|
|
7221
|
+
let pressability = usePressability(events);
|
|
7222
|
+
if (events && (process.env.NODE_ENV === "development" && viewProps.debug && console.info(
|
|
7223
|
+
`Checking for press ${!!events.onPress} then applying pressability props: ${Object.keys(
|
|
7224
|
+
pressability || {}
|
|
7225
|
+
)}`
|
|
7226
|
+
), events.onPress))
|
|
7227
|
+
for (let key in pressability) {
|
|
7228
|
+
let og = viewProps[key], val = pressability[key];
|
|
7229
|
+
viewProps[key] = og && !dontComposePressabilityKeys[key] ? (0, import_web.composeEventHandlers)(og, val) : val;
|
|
7230
|
+
}
|
|
7231
|
+
}
|
|
7301
7232
|
},
|
|
7302
7233
|
useChildren(elementType, children, viewProps, events, staticConfig) {
|
|
7303
7234
|
if (process.env.NODE_ENV !== "test") {
|