@tamagui/core 1.85.6 → 1.85.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/native.js +1676 -1668
- package/dist/native.js.map +3 -3
- package/dist/test.native.js +810 -832
- package/dist/test.native.js.map +3 -3
- package/package.json +6 -6
package/dist/native.js
CHANGED
|
@@ -1465,7 +1465,7 @@ var require_insertStyleRule_native = __commonJS({
|
|
|
1465
1465
|
}
|
|
1466
1466
|
return scannedCache.set(sheet2, cacheKey), dedupedThemes;
|
|
1467
1467
|
}
|
|
1468
|
-
var colorVarToVal, rootComputedStyle = null;
|
|
1468
|
+
var colorVarToVal, rootComputedStyle = null, schemes = { dark: !0, light: !0 };
|
|
1469
1469
|
function addThemesFromCSS(cssStyleRule, tokens) {
|
|
1470
1470
|
let selectors = cssStyleRule.selectorText.split(",");
|
|
1471
1471
|
if (!selectors.length)
|
|
@@ -1501,11 +1501,11 @@ var require_insertStyleRule_native = __commonJS({
|
|
|
1501
1501
|
names: [
|
|
1502
1502
|
...new Set(
|
|
1503
1503
|
selectors.map((selector) => {
|
|
1504
|
-
let parts = selector.replace(/(.t_|:root)/g, "").trim().split(" "), [
|
|
1504
|
+
let parts = selector.replace(/(.t_|:root)/g, "").trim().split(" "), secondToLast = parts[parts.length - 2] || "", scheme = secondToLast.includes("dark") ? "dark" : secondToLast.includes("light") ? "light" : "", name = (() => {
|
|
1505
1505
|
let _ = parts[parts.length - 1];
|
|
1506
1506
|
return scheme && _.startsWith(scheme) && (_ = _.slice(scheme.length + 1)), _;
|
|
1507
1507
|
})();
|
|
1508
|
-
return `${scheme}${scheme && name ? "_" : ""}${name}`;
|
|
1508
|
+
return scheme === name || schemes[name] ? scheme : `${scheme}${scheme && name ? "_" : ""}${name}`;
|
|
1509
1509
|
})
|
|
1510
1510
|
)
|
|
1511
1511
|
],
|
|
@@ -1842,116 +1842,9 @@ var require_useMedia_native = __commonJS({
|
|
|
1842
1842
|
}
|
|
1843
1843
|
});
|
|
1844
1844
|
|
|
1845
|
-
// ../web/dist/cjs/
|
|
1846
|
-
var
|
|
1847
|
-
"../web/dist/cjs/
|
|
1848
|
-
"use strict";
|
|
1849
|
-
var __create2 = Object.create, __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __getProtoOf2 = Object.getPrototypeOf, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
1850
|
-
for (var name in all)
|
|
1851
|
-
__defProp2(target, name, { get: all[name], enumerable: !0 });
|
|
1852
|
-
}, __copyProps2 = (to, from, except, desc) => {
|
|
1853
|
-
if (from && typeof from == "object" || typeof from == "function")
|
|
1854
|
-
for (let key of __getOwnPropNames2(from))
|
|
1855
|
-
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
1856
|
-
return to;
|
|
1857
|
-
}, __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps2(
|
|
1858
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
1859
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
1860
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
1861
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
1862
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", { value: mod, enumerable: !0 }) : target,
|
|
1863
|
-
mod
|
|
1864
|
-
)), __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), Tamagui_exports = {};
|
|
1865
|
-
__export2(Tamagui_exports, {
|
|
1866
|
-
Tamagui: () => Tamagui,
|
|
1867
|
-
getValueFromIdentifier: () => getValueFromIdentifier,
|
|
1868
|
-
setIdentifierValue: () => setIdentifierValue
|
|
1869
|
-
});
|
|
1870
|
-
module2.exports = __toCommonJS2(Tamagui_exports);
|
|
1871
|
-
var Helpers = __toESM2(require_index_native4()), import_config = require_config_native(), import_insertStyleRule = require_insertStyleRule_native(), import_useMedia = require_useMedia_native(), TamaguiManager = class {
|
|
1872
|
-
constructor() {
|
|
1873
|
-
this.Helpers = Helpers;
|
|
1874
|
-
}
|
|
1875
|
-
get mediaState() {
|
|
1876
|
-
return { ...import_useMedia.mediaState };
|
|
1877
|
-
}
|
|
1878
|
-
get config() {
|
|
1879
|
-
return (0, import_config.getConfig)();
|
|
1880
|
-
}
|
|
1881
|
-
get insertedRules() {
|
|
1882
|
-
return (0, import_insertStyleRule.getAllRules)();
|
|
1883
|
-
}
|
|
1884
|
-
get allSelectors() {
|
|
1885
|
-
return (0, import_insertStyleRule.getAllSelectors)();
|
|
1886
|
-
}
|
|
1887
|
-
get allTransforms() {
|
|
1888
|
-
return (0, import_insertStyleRule.getAllTransforms)();
|
|
1889
|
-
}
|
|
1890
|
-
get identifierToValue() {
|
|
1891
|
-
return identifierToValue;
|
|
1892
|
-
}
|
|
1893
|
-
}, Tamagui = new TamaguiManager(), identifierToValue = /* @__PURE__ */ new Map(), getValueFromIdentifier = (identifier) => identifierToValue.get(identifier), setIdentifierValue = (identifier, value) => {
|
|
1894
|
-
identifierToValue.set(identifier, value);
|
|
1895
|
-
};
|
|
1896
|
-
}
|
|
1897
|
-
});
|
|
1898
|
-
|
|
1899
|
-
// ../compose-refs/dist/cjs/compose-refs.native.js
|
|
1900
|
-
var require_compose_refs_native = __commonJS({
|
|
1901
|
-
"../compose-refs/dist/cjs/compose-refs.native.js"(exports2, module2) {
|
|
1902
|
-
"use strict";
|
|
1903
|
-
var __create2 = Object.create, __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __getProtoOf2 = Object.getPrototypeOf, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
1904
|
-
for (var name in all)
|
|
1905
|
-
__defProp2(target, name, { get: all[name], enumerable: !0 });
|
|
1906
|
-
}, __copyProps2 = (to, from, except, desc) => {
|
|
1907
|
-
if (from && typeof from == "object" || typeof from == "function")
|
|
1908
|
-
for (let key of __getOwnPropNames2(from))
|
|
1909
|
-
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
1910
|
-
return to;
|
|
1911
|
-
}, __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps2(
|
|
1912
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
1913
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
1914
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
1915
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
1916
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", { value: mod, enumerable: !0 }) : target,
|
|
1917
|
-
mod
|
|
1918
|
-
)), __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), compose_refs_exports = {};
|
|
1919
|
-
__export2(compose_refs_exports, {
|
|
1920
|
-
composeRefs: () => composeRefs,
|
|
1921
|
-
useComposedRefs: () => useComposedRefs
|
|
1922
|
-
});
|
|
1923
|
-
module2.exports = __toCommonJS2(compose_refs_exports);
|
|
1924
|
-
var React = __toESM2(require("react"));
|
|
1925
|
-
function setRef(ref, value) {
|
|
1926
|
-
typeof ref == "function" ? ref(value) : ref && (ref.current = value);
|
|
1927
|
-
}
|
|
1928
|
-
function composeRefs(...refs) {
|
|
1929
|
-
return (node) => refs.forEach((ref) => setRef(ref, node));
|
|
1930
|
-
}
|
|
1931
|
-
function useComposedRefs(...refs) {
|
|
1932
|
-
return React.useCallback(composeRefs(...refs), refs);
|
|
1933
|
-
}
|
|
1934
|
-
}
|
|
1935
|
-
});
|
|
1936
|
-
|
|
1937
|
-
// ../compose-refs/dist/cjs/index.native.js
|
|
1938
|
-
var require_index_native5 = __commonJS({
|
|
1939
|
-
"../compose-refs/dist/cjs/index.native.js"(exports2, module2) {
|
|
1940
|
-
"use strict";
|
|
1941
|
-
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __copyProps2 = (to, from, except, desc) => {
|
|
1942
|
-
if (from && typeof from == "object" || typeof from == "function")
|
|
1943
|
-
for (let key of __getOwnPropNames2(from))
|
|
1944
|
-
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
1945
|
-
return to;
|
|
1946
|
-
}, __reExport2 = (target, mod, secondTarget) => (__copyProps2(target, mod, "default"), secondTarget && __copyProps2(secondTarget, mod, "default")), __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), src_exports2 = {};
|
|
1947
|
-
module2.exports = __toCommonJS2(src_exports2);
|
|
1948
|
-
__reExport2(src_exports2, require_compose_refs_native(), module2.exports);
|
|
1949
|
-
}
|
|
1950
|
-
});
|
|
1951
|
-
|
|
1952
|
-
// ../use-did-finish-ssr/dist/cjs/index.native.js
|
|
1953
|
-
var require_index_native6 = __commonJS({
|
|
1954
|
-
"../use-did-finish-ssr/dist/cjs/index.native.js"(exports2, module2) {
|
|
1845
|
+
// ../web/dist/cjs/helpers/createShallowSetState.native.js
|
|
1846
|
+
var require_createShallowSetState_native = __commonJS({
|
|
1847
|
+
"../web/dist/cjs/helpers/createShallowSetState.native.js"(exports2, module2) {
|
|
1955
1848
|
"use strict";
|
|
1956
1849
|
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
1957
1850
|
for (var name in all)
|
|
@@ -1961,18 +1854,24 @@ var require_index_native6 = __commonJS({
|
|
|
1961
1854
|
for (let key of __getOwnPropNames2(from))
|
|
1962
1855
|
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
1963
1856
|
return to;
|
|
1964
|
-
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod),
|
|
1965
|
-
__export2(
|
|
1966
|
-
|
|
1967
|
-
|
|
1857
|
+
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), createShallowSetState_exports = {};
|
|
1858
|
+
__export2(createShallowSetState_exports, {
|
|
1859
|
+
createShallowSetState: () => createShallowSetState,
|
|
1860
|
+
isEqualShallow: () => isEqualShallow,
|
|
1861
|
+
mergeIfNotShallowEqual: () => mergeIfNotShallowEqual
|
|
1968
1862
|
});
|
|
1969
|
-
module2.exports = __toCommonJS2(
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
return value ?? !0;
|
|
1863
|
+
module2.exports = __toCommonJS2(createShallowSetState_exports);
|
|
1864
|
+
function createShallowSetState(setter, debug) {
|
|
1865
|
+
return (next) => setter((prev) => mergeIfNotShallowEqual(prev, next, debug));
|
|
1973
1866
|
}
|
|
1974
|
-
function
|
|
1975
|
-
return
|
|
1867
|
+
function mergeIfNotShallowEqual(prev, next, debug) {
|
|
1868
|
+
return isEqualShallow(prev, next) ? prev : (process.env.NODE_ENV === "development" && debug && console.warn("setStateShallow CHANGE", { prev, next }), { ...prev, ...next });
|
|
1869
|
+
}
|
|
1870
|
+
function isEqualShallow(prev, next) {
|
|
1871
|
+
for (let key in next)
|
|
1872
|
+
if (prev[key] !== next[key])
|
|
1873
|
+
return !1;
|
|
1874
|
+
return !0;
|
|
1976
1875
|
}
|
|
1977
1876
|
}
|
|
1978
1877
|
});
|
|
@@ -2011,9 +1910,9 @@ var require_constants_native2 = __commonJS({
|
|
|
2011
1910
|
}
|
|
2012
1911
|
});
|
|
2013
1912
|
|
|
2014
|
-
// ../web/dist/cjs/helpers/
|
|
2015
|
-
var
|
|
2016
|
-
"../web/dist/cjs/helpers/
|
|
1913
|
+
// ../web/dist/cjs/helpers/ThemeManager.native.js
|
|
1914
|
+
var require_ThemeManager_native = __commonJS({
|
|
1915
|
+
"../web/dist/cjs/helpers/ThemeManager.native.js"(exports2, module2) {
|
|
2017
1916
|
"use strict";
|
|
2018
1917
|
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
2019
1918
|
for (var name in all)
|
|
@@ -2023,177 +1922,149 @@ var require_objectIdentityKey_native = __commonJS({
|
|
|
2023
1922
|
for (let key of __getOwnPropNames2(from))
|
|
2024
1923
|
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
2025
1924
|
return to;
|
|
2026
|
-
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod),
|
|
2027
|
-
__export2(
|
|
2028
|
-
|
|
1925
|
+
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), ThemeManager_exports = {};
|
|
1926
|
+
__export2(ThemeManager_exports, {
|
|
1927
|
+
ThemeManager: () => ThemeManager,
|
|
1928
|
+
getHasThemeUpdatingProps: () => getHasThemeUpdatingProps,
|
|
1929
|
+
getManagers: () => getManagers
|
|
2029
1930
|
});
|
|
2030
|
-
module2.exports = __toCommonJS2(
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
k += key;
|
|
2035
|
-
let arg = obj[key], type = typeof arg;
|
|
2036
|
-
if (!arg || type !== "object" && type !== "function")
|
|
2037
|
-
k += type + arg;
|
|
2038
|
-
else if (cache.has(arg))
|
|
2039
|
-
k += cache.get(arg);
|
|
2040
|
-
else {
|
|
2041
|
-
let v = Math.random();
|
|
2042
|
-
cache.set(arg, v), k += v;
|
|
2043
|
-
}
|
|
2044
|
-
}
|
|
2045
|
-
return k;
|
|
1931
|
+
module2.exports = __toCommonJS2(ThemeManager_exports);
|
|
1932
|
+
var import_constants = require_index_native3(), import_config = require_config_native(), import_constants2 = require_constants_native2(), emptyState = { name: "" };
|
|
1933
|
+
function getHasThemeUpdatingProps(props) {
|
|
1934
|
+
return !!(props.name || props.componentName || props.inverse || props.reset);
|
|
2046
1935
|
}
|
|
2047
|
-
var
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
var require_createStyledContext_native = __commonJS({
|
|
2053
|
-
"../web/dist/cjs/helpers/createStyledContext.native.js"(exports2, module2) {
|
|
2054
|
-
"use strict";
|
|
2055
|
-
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
2056
|
-
for (var name in all)
|
|
2057
|
-
__defProp2(target, name, { get: all[name], enumerable: !0 });
|
|
2058
|
-
}, __copyProps2 = (to, from, except, desc) => {
|
|
2059
|
-
if (from && typeof from == "object" || typeof from == "function")
|
|
2060
|
-
for (let key of __getOwnPropNames2(from))
|
|
2061
|
-
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
2062
|
-
return to;
|
|
2063
|
-
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), createStyledContext_exports = {};
|
|
2064
|
-
__export2(createStyledContext_exports, {
|
|
2065
|
-
createStyledContext: () => createStyledContext
|
|
2066
|
-
});
|
|
2067
|
-
module2.exports = __toCommonJS2(createStyledContext_exports);
|
|
2068
|
-
var import_react3 = require("react"), import_objectIdentityKey = require_objectIdentityKey_native(), import_jsx_runtime = require("react/jsx-runtime");
|
|
2069
|
-
function createStyledContext(defaultValues) {
|
|
2070
|
-
let OGContext = (0, import_react3.createContext)(defaultValues), OGProvider = OGContext.Provider, Context = OGContext, scopedContexts = /* @__PURE__ */ new Map(), Provider = ({
|
|
2071
|
-
children,
|
|
2072
|
-
scope,
|
|
2073
|
-
...values
|
|
2074
|
-
}) => {
|
|
2075
|
-
let next = (0, import_react3.useMemo)(() => ({
|
|
2076
|
-
// this ! is a workaround for ts error
|
|
2077
|
-
...defaultValues,
|
|
2078
|
-
...values
|
|
2079
|
-
}), [(0, import_objectIdentityKey.objectIdentityKey)(values)]), Provider2 = OGProvider;
|
|
2080
|
-
if (scope) {
|
|
2081
|
-
let ScopedContext = scopedContexts.get(scope);
|
|
2082
|
-
ScopedContext || (ScopedContext = (0, import_react3.createContext)(defaultValues), scopedContexts.set(scope, ScopedContext)), Provider2 = ScopedContext.Provider;
|
|
1936
|
+
var uid = 0, ThemeManager = class {
|
|
1937
|
+
constructor(props = {}, parentManager) {
|
|
1938
|
+
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") {
|
|
1939
|
+
this.updateStateFromProps(props, !1);
|
|
1940
|
+
return;
|
|
2083
1941
|
}
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
1942
|
+
if (!parentManager)
|
|
1943
|
+
throw process.env.NODE_ENV !== "production" ? new Error(
|
|
1944
|
+
"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."
|
|
1945
|
+
) : "\u274C 000";
|
|
1946
|
+
if (this.parentManager = parentManager, !this.updateStateFromProps(props, !1))
|
|
1947
|
+
return parentManager;
|
|
1948
|
+
}
|
|
1949
|
+
updateStateFromProps(props = this.props || {}, shouldNotify = !0) {
|
|
1950
|
+
if (this.props = props, props.forceTheme)
|
|
1951
|
+
return this.state.theme = props.forceTheme, this.state.name = props.name || "", this.updateState(this.state, !0), this.state;
|
|
1952
|
+
let nextState = this.getStateIfChanged(props);
|
|
1953
|
+
if (nextState)
|
|
1954
|
+
return this.updateState(nextState, shouldNotify), nextState;
|
|
1955
|
+
}
|
|
1956
|
+
updateState(nextState, shouldNotify = !0) {
|
|
1957
|
+
this.state = nextState, this._allKeys = null, process.env.NODE_ENV !== "production" && (this._numChangeEventsSent ??= 0, this._numChangeEventsSent++), shouldNotify && this.notify();
|
|
1958
|
+
}
|
|
1959
|
+
getStateIfChanged(props = this.props, state = this.state, parentManager = this.parentManager) {
|
|
1960
|
+
let _ = this.getState(props, parentManager);
|
|
1961
|
+
if (state && state !== emptyState && !_)
|
|
1962
|
+
return parentManager == null ? void 0 : parentManager.state;
|
|
1963
|
+
if (this.getStateShouldChange(_, state))
|
|
1964
|
+
return _;
|
|
1965
|
+
}
|
|
1966
|
+
getStateShouldChange(nextState, state = this.state) {
|
|
1967
|
+
return !(!(nextState != null && nextState.theme) || nextState.theme === (state == null ? void 0 : state.theme));
|
|
1968
|
+
}
|
|
1969
|
+
getState(props = this.props, parentManager = this.parentManager) {
|
|
1970
|
+
return getState(props, parentManager) || (parentManager == null ? void 0 : parentManager.state) || null;
|
|
1971
|
+
}
|
|
1972
|
+
get allKeys() {
|
|
1973
|
+
var _a;
|
|
1974
|
+
return this._allKeys ||= /* @__PURE__ */ new Set([
|
|
1975
|
+
...((_a = this.parentManager) == null ? void 0 : _a.allKeys) || [],
|
|
1976
|
+
...Object.keys(this.state.theme || {})
|
|
1977
|
+
]), this._allKeys;
|
|
1978
|
+
}
|
|
1979
|
+
notify(forced = !1) {
|
|
1980
|
+
this.themeListeners.forEach((cb) => cb(this.state.name, this, forced));
|
|
1981
|
+
}
|
|
1982
|
+
onChangeTheme(cb, debugId) {
|
|
1983
|
+
return process.env.NODE_ENV !== "production" && debugId && (this._listeningIds ??= /* @__PURE__ */ new Set(), this._listeningIds.add(debugId)), this.themeListeners.add(cb), () => {
|
|
1984
|
+
this.themeListeners.delete(cb);
|
|
1985
|
+
};
|
|
2120
1986
|
}
|
|
2121
|
-
});
|
|
2122
|
-
}
|
|
2123
|
-
});
|
|
2124
|
-
|
|
2125
|
-
// ../web/dist/cjs/defaultComponentState.native.js
|
|
2126
|
-
var require_defaultComponentState_native = __commonJS({
|
|
2127
|
-
"../web/dist/cjs/defaultComponentState.native.js"(exports2, module2) {
|
|
2128
|
-
"use strict";
|
|
2129
|
-
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
2130
|
-
for (var name in all)
|
|
2131
|
-
__defProp2(target, name, { get: all[name], enumerable: !0 });
|
|
2132
|
-
}, __copyProps2 = (to, from, except, desc) => {
|
|
2133
|
-
if (from && typeof from == "object" || typeof from == "function")
|
|
2134
|
-
for (let key of __getOwnPropNames2(from))
|
|
2135
|
-
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
2136
|
-
return to;
|
|
2137
|
-
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), defaultComponentState_exports = {};
|
|
2138
|
-
__export2(defaultComponentState_exports, {
|
|
2139
|
-
defaultComponentState: () => defaultComponentState,
|
|
2140
|
-
defaultComponentStateMounted: () => defaultComponentStateMounted,
|
|
2141
|
-
defaultComponentStateShouldEnter: () => defaultComponentStateShouldEnter
|
|
2142
|
-
});
|
|
2143
|
-
module2.exports = __toCommonJS2(defaultComponentState_exports);
|
|
2144
|
-
var defaultComponentState = {
|
|
2145
|
-
hover: !1,
|
|
2146
|
-
press: !1,
|
|
2147
|
-
pressIn: !1,
|
|
2148
|
-
focus: !1,
|
|
2149
|
-
unmounted: !0
|
|
2150
|
-
}, defaultComponentStateMounted = {
|
|
2151
|
-
...defaultComponentState,
|
|
2152
|
-
unmounted: !1
|
|
2153
|
-
}, defaultComponentStateShouldEnter = {
|
|
2154
|
-
...defaultComponentState,
|
|
2155
|
-
unmounted: "should-enter"
|
|
2156
1987
|
};
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
1988
|
+
function getState(props, manager) {
|
|
1989
|
+
var _a;
|
|
1990
|
+
if (props.name && props.reset)
|
|
1991
|
+
throw new Error(
|
|
1992
|
+
process.env.NODE_ENV === "production" ? "\u274C004" : "Cannot reset and set a new name at the same time."
|
|
1993
|
+
);
|
|
1994
|
+
if (!getHasThemeUpdatingProps(props))
|
|
1995
|
+
return null;
|
|
1996
|
+
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];
|
|
1997
|
+
if (!baseManager && props.reset)
|
|
1998
|
+
return process.env.NODE_ENV !== "production" && console.warn("Cannot reset, no parent theme exists"), null;
|
|
1999
|
+
let { componentName } = props, result = null, baseName = (baseManager == null ? void 0 : baseManager.state.name) || "";
|
|
2000
|
+
baseManager != null && baseManager.state.isComponent && (baseName = baseName.replace(/_[A-Z][A-Za-z]+/, ""));
|
|
2001
|
+
let nextName = props.reset ? baseName : props.name || "", allComponentThemes = componentManagers.map((x) => (x == null ? void 0 : x.state.name) || "");
|
|
2002
|
+
isDirectParentAComponentTheme && allComponentThemes.shift();
|
|
2003
|
+
let base = baseName.split(import_constants2.THEME_NAME_SEPARATOR), max = base.length, min = props.componentName && !nextName ? max : 0;
|
|
2004
|
+
for (let i = max; i >= min; i--) {
|
|
2005
|
+
let prefix = base.slice(0, i).join(import_constants2.THEME_NAME_SEPARATOR);
|
|
2006
|
+
props.inverse && (prefix = inverseThemeName(prefix));
|
|
2007
|
+
let potentials = [];
|
|
2008
|
+
if (prefix && prefix !== baseName && potentials.push(prefix), nextName && potentials.unshift(prefix ? `${prefix}_${nextName}` : nextName), i === 1) {
|
|
2009
|
+
let lastSegment = potentials.findIndex((x) => !x.includes("_"));
|
|
2010
|
+
lastSegment > 0 && potentials.splice(lastSegment, 0, nextName);
|
|
2011
|
+
}
|
|
2012
|
+
if (componentName && !props.reset) {
|
|
2013
|
+
let baseLen = base.length, componentPotentials = [];
|
|
2014
|
+
if (nextName && baseLen > 1) {
|
|
2015
|
+
let beforeSeparator = base[0];
|
|
2016
|
+
componentPotentials.push(`${beforeSeparator}_${nextName}_${componentName}`);
|
|
2017
|
+
}
|
|
2018
|
+
if (componentPotentials.push(`${prefix}_${componentName}`), nextName) {
|
|
2019
|
+
if (i > baseLen) {
|
|
2020
|
+
let prefixLessOne = base.slice(0, i - 1).join(import_constants2.THEME_NAME_SEPARATOR);
|
|
2021
|
+
if (prefixLessOne) {
|
|
2022
|
+
let lessSpecific = `${prefixLessOne}_${nextName}_${componentName}`;
|
|
2023
|
+
componentPotentials.unshift(lessSpecific);
|
|
2024
|
+
}
|
|
2025
|
+
}
|
|
2026
|
+
let moreSpecific = `${prefix}_${nextName}_${componentName}`;
|
|
2027
|
+
componentPotentials.unshift(moreSpecific);
|
|
2028
|
+
}
|
|
2029
|
+
potentials = [...componentPotentials, ...potentials, ...allComponentThemes];
|
|
2030
|
+
}
|
|
2031
|
+
let found = potentials.find((t) => t in themes);
|
|
2032
|
+
if (process.env.NODE_ENV !== "production" && typeof props.debug == "string" && console.info(" getState ", {
|
|
2033
|
+
props,
|
|
2034
|
+
found,
|
|
2035
|
+
potentials,
|
|
2036
|
+
baseManager,
|
|
2037
|
+
nextName,
|
|
2038
|
+
baseName,
|
|
2039
|
+
prefix
|
|
2040
|
+
}), found) {
|
|
2041
|
+
let names = found.split("_"), [firstName, ...restNames] = names, lastName = names[names.length - 1], isComponent = lastName[0] === lastName[0].toUpperCase(), scheme = firstName === "light" ? "light" : firstName === "dark" ? "dark" : void 0, pre = import_constants2.THEME_CLASSNAME_PREFIX, className = import_constants.isWeb ? `${pre}sub_theme ${pre}${!scheme || !restNames.length ? firstName : restNames.join("_")}` : "", parentState = (_a = baseManager || parentManager) == null ? void 0 : _a.state, parentName = parentState == null ? void 0 : parentState.name;
|
|
2042
|
+
result = {
|
|
2043
|
+
name: found,
|
|
2044
|
+
parentName,
|
|
2045
|
+
theme: themes[found],
|
|
2046
|
+
className,
|
|
2047
|
+
isComponent,
|
|
2048
|
+
scheme
|
|
2049
|
+
};
|
|
2050
|
+
break;
|
|
2051
|
+
}
|
|
2052
|
+
}
|
|
2053
|
+
return process.env.NODE_ENV !== "production" && props.debug === "verbose" && typeof window < "u" && (console.groupCollapsed("ThemeManager.getState()"), console.info({ props, baseName, base, min, max }), console.warn("result", { result }), console.trace(), console.groupEnd()), result;
|
|
2184
2054
|
}
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2055
|
+
var inverseThemeName = (themeName) => themeName.startsWith("light") ? themeName.replace(/^light/, "dark") : themeName.replace(/^dark/, "light");
|
|
2056
|
+
function getManagers(themeManager) {
|
|
2057
|
+
let comp = [], all = [], cur = themeManager;
|
|
2058
|
+
for (; cur; )
|
|
2059
|
+
all.push(cur), cur.state.isComponent && comp.push(cur), cur = cur.parentManager;
|
|
2060
|
+
return [all, comp];
|
|
2190
2061
|
}
|
|
2191
2062
|
}
|
|
2192
2063
|
});
|
|
2193
2064
|
|
|
2194
|
-
// ../web/dist/cjs/
|
|
2195
|
-
var
|
|
2196
|
-
"../web/dist/cjs/
|
|
2065
|
+
// ../web/dist/cjs/helpers/ThemeManagerContext.native.js
|
|
2066
|
+
var require_ThemeManagerContext_native = __commonJS({
|
|
2067
|
+
"../web/dist/cjs/helpers/ThemeManagerContext.native.js"(exports2, module2) {
|
|
2197
2068
|
"use strict";
|
|
2198
2069
|
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
2199
2070
|
for (var name in all)
|
|
@@ -2203,72 +2074,18 @@ var require_accessibilityDirectMap_native = __commonJS({
|
|
|
2203
2074
|
for (let key of __getOwnPropNames2(from))
|
|
2204
2075
|
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
2205
2076
|
return to;
|
|
2206
|
-
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod),
|
|
2207
|
-
__export2(
|
|
2208
|
-
|
|
2209
|
-
accessibilityWebRoleToNativeRole: () => accessibilityWebRoleToNativeRole,
|
|
2210
|
-
nativeAccessibilityState: () => nativeAccessibilityState,
|
|
2211
|
-
nativeAccessibilityValue: () => nativeAccessibilityValue,
|
|
2212
|
-
webToNativeAccessibilityDirectMap: () => webToNativeAccessibilityDirectMap
|
|
2077
|
+
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), ThemeManagerContext_exports = {};
|
|
2078
|
+
__export2(ThemeManagerContext_exports, {
|
|
2079
|
+
ThemeManagerIDContext: () => ThemeManagerIDContext
|
|
2213
2080
|
});
|
|
2214
|
-
module2.exports = __toCommonJS2(
|
|
2215
|
-
var
|
|
2216
|
-
"aria-label": "accessibilityLabel",
|
|
2217
|
-
"aria-labelledby": "accessibilityLabelledBy",
|
|
2218
|
-
"aria-live": "accessibilityLiveRegion",
|
|
2219
|
-
"aria-modal": "accessibilityViewIsModal",
|
|
2220
|
-
"aria-hidden": "accessibilityElementsHidden"
|
|
2221
|
-
}, nativeAccessibilityValue = {
|
|
2222
|
-
"aria-valuemin": "min",
|
|
2223
|
-
"aria-valuemax": "max",
|
|
2224
|
-
"aria-valuenow": "now",
|
|
2225
|
-
"aria-valuetext": "text"
|
|
2226
|
-
}, nativeAccessibilityState = {
|
|
2227
|
-
"aria-disabled": "disabled",
|
|
2228
|
-
"aria-selected": "selected",
|
|
2229
|
-
"aria-checked": "checked",
|
|
2230
|
-
"aria-busy": "busy",
|
|
2231
|
-
"aria-expanded": "expanded"
|
|
2232
|
-
}, accessibilityWebRoleToNativeRole = {
|
|
2233
|
-
alert: "alert",
|
|
2234
|
-
button: "button",
|
|
2235
|
-
checkbox: "checkbox",
|
|
2236
|
-
combobox: "combobox",
|
|
2237
|
-
grid: "grid",
|
|
2238
|
-
group: "none",
|
|
2239
|
-
heading: "header",
|
|
2240
|
-
imagebutton: "imagebutton",
|
|
2241
|
-
img: "image",
|
|
2242
|
-
keyboardkey: "keyboardkey",
|
|
2243
|
-
link: "link",
|
|
2244
|
-
menu: "menu",
|
|
2245
|
-
menubar: "menubar",
|
|
2246
|
-
menuitem: "menuitem",
|
|
2247
|
-
none: "none",
|
|
2248
|
-
presentation: "none",
|
|
2249
|
-
progressbar: "progressbar",
|
|
2250
|
-
radio: "radio",
|
|
2251
|
-
radiogroup: "radiogroup",
|
|
2252
|
-
region: "summary",
|
|
2253
|
-
scrollbar: "scrollbar",
|
|
2254
|
-
searchbox: "search",
|
|
2255
|
-
slider: "adjustable",
|
|
2256
|
-
spinbutton: "spinbutton",
|
|
2257
|
-
summary: "summary",
|
|
2258
|
-
switch: "switch",
|
|
2259
|
-
tab: "tab",
|
|
2260
|
-
tablist: "tablist",
|
|
2261
|
-
text: "text",
|
|
2262
|
-
timer: "timer",
|
|
2263
|
-
togglebutton: "togglebutton",
|
|
2264
|
-
toolbar: "toolbar"
|
|
2265
|
-
};
|
|
2081
|
+
module2.exports = __toCommonJS2(ThemeManagerContext_exports);
|
|
2082
|
+
var import_react3 = require("react"), ThemeManagerIDContext = (0, import_react3.createContext)(1);
|
|
2266
2083
|
}
|
|
2267
2084
|
});
|
|
2268
2085
|
|
|
2269
|
-
// ../web/dist/cjs/
|
|
2270
|
-
var
|
|
2271
|
-
"../web/dist/cjs/
|
|
2086
|
+
// ../web/dist/cjs/hooks/useTheme.native.js
|
|
2087
|
+
var require_useTheme_native = __commonJS({
|
|
2088
|
+
"../web/dist/cjs/hooks/useTheme.native.js"(exports2, module2) {
|
|
2272
2089
|
"use strict";
|
|
2273
2090
|
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
2274
2091
|
for (var name in all)
|
|
@@ -2278,27 +2095,260 @@ var require_isDevTools_native = __commonJS({
|
|
|
2278
2095
|
for (let key of __getOwnPropNames2(from))
|
|
2279
2096
|
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
2280
2097
|
return to;
|
|
2281
|
-
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod),
|
|
2282
|
-
__export2(
|
|
2283
|
-
|
|
2098
|
+
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), useTheme_exports = {};
|
|
2099
|
+
__export2(useTheme_exports, {
|
|
2100
|
+
activeThemeManagers: () => activeThemeManagers,
|
|
2101
|
+
getThemeManager: () => getThemeManager,
|
|
2102
|
+
getThemeProxied: () => getThemeProxied,
|
|
2103
|
+
useChangeThemeEffect: () => useChangeThemeEffect,
|
|
2104
|
+
useTheme: () => useTheme,
|
|
2105
|
+
useThemeWithState: () => useThemeWithState
|
|
2284
2106
|
});
|
|
2285
|
-
module2.exports = __toCommonJS2(
|
|
2286
|
-
var
|
|
2287
|
-
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
|
|
2107
|
+
module2.exports = __toCommonJS2(useTheme_exports);
|
|
2108
|
+
var import_constants = require_index_native3(), import_react3 = require("react"), import_config = require_config_native(), import_createVariable = require_createVariable_native(), import_createShallowSetState = require_createShallowSetState_native(), import_ThemeManager = require_ThemeManager_native(), import_ThemeManagerContext = require_ThemeManagerContext_native(), emptyProps = { name: null }, cached;
|
|
2109
|
+
function getDefaultThemeProxied() {
|
|
2110
|
+
if (cached)
|
|
2111
|
+
return cached;
|
|
2112
|
+
let config = (0, import_config.getConfig)(), name = config.themes.light ? "light" : Object.keys(config.themes)[0], defaultTheme = config.themes[name];
|
|
2113
|
+
return cached = getThemeProxied({ theme: defaultTheme, name }), cached;
|
|
2114
|
+
}
|
|
2115
|
+
var useTheme = (props = emptyProps) => {
|
|
2116
|
+
let [_, theme] = useThemeWithState(props);
|
|
2117
|
+
return theme || getDefaultThemeProxied();
|
|
2118
|
+
}, useThemeWithState = (props) => {
|
|
2119
|
+
let keys = (0, import_react3.useRef)([]), changedThemeState = useChangeThemeEffect(
|
|
2120
|
+
props,
|
|
2121
|
+
!1,
|
|
2122
|
+
keys.current,
|
|
2123
|
+
import_constants.isServer ? void 0 : () => {
|
|
2124
|
+
var _a, _b;
|
|
2125
|
+
let next = ((_a = props.shouldUpdate) == null ? void 0 : _a.call(props)) ?? (keys.current.length > 0 ? !0 : void 0);
|
|
2126
|
+
return process.env.NODE_ENV === "development" && typeof props.debug == "string" && props.debug !== "profile" && console.info(" \u{1F3A8} useTheme() shouldUpdate?", next, {
|
|
2127
|
+
shouldUpdateProp: (_b = props.shouldUpdate) == null ? void 0 : _b.call(props),
|
|
2128
|
+
keys: [...keys.current]
|
|
2129
|
+
}), next;
|
|
2130
|
+
}
|
|
2131
|
+
), { themeManager, state } = changedThemeState;
|
|
2132
|
+
process.env.NODE_ENV === "development" && (state != null && state.theme || process.env.TAMAGUI_DISABLE_NO_THEME_WARNING !== "1" && console.warn(
|
|
2133
|
+
`[tamagui] No theme found, this could be due to an invalid theme name (given theme props ${JSON.stringify(
|
|
2134
|
+
props
|
|
2135
|
+
)}).
|
|
2136
|
+
|
|
2137
|
+
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`
|
|
2138
|
+
));
|
|
2139
|
+
let themeProxied = (0, import_react3.useMemo)(() => !themeManager || !(state != null && state.theme) ? {} : getThemeProxied(state, props.deopt, themeManager, keys.current, props.debug), [state == null ? void 0 : state.theme, themeManager, props.deopt, props.debug]);
|
|
2140
|
+
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];
|
|
2141
|
+
};
|
|
2142
|
+
function getThemeProxied({ theme, name, scheme }, deopt = !1, themeManager, keys, debug) {
|
|
2143
|
+
if (!theme)
|
|
2144
|
+
return {};
|
|
2145
|
+
let config = (0, import_config.getConfig)();
|
|
2146
|
+
function track(key) {
|
|
2147
|
+
keys && !keys.includes(key) && (keys.push(key), process.env.NODE_ENV === "development" && debug && console.info(` \u{1F3A8} useTheme() tracking new key: ${key}`));
|
|
2148
|
+
}
|
|
2149
|
+
return new Proxy(theme, {
|
|
2150
|
+
has(_, key) {
|
|
2151
|
+
if (Reflect.has(theme, key))
|
|
2152
|
+
return !0;
|
|
2153
|
+
if (typeof key == "string")
|
|
2154
|
+
return key[0] === "$" && (key = key.slice(1)), themeManager == null ? void 0 : themeManager.allKeys.has(key);
|
|
2155
|
+
},
|
|
2156
|
+
get(_, key) {
|
|
2157
|
+
if (
|
|
2158
|
+
// dont ask me, idk why but on hermes you can see that useTheme()[undefined] passes in STRING undefined to proxy
|
|
2159
|
+
// if someone is crazy enough to use "undefined" as a theme key then this not working is on them
|
|
2160
|
+
key !== "undefined" && typeof key == "string"
|
|
2161
|
+
) {
|
|
2162
|
+
let keyString = key[0] === "$" ? key.slice(1) : key, val = theme[keyString];
|
|
2163
|
+
if (val && typeof val == "object")
|
|
2164
|
+
return new Proxy(val, {
|
|
2165
|
+
// when they touch the actual value we only track it
|
|
2166
|
+
// if its a variable (web), its ignored!
|
|
2167
|
+
get(_2, subkey) {
|
|
2168
|
+
if (subkey === "val")
|
|
2169
|
+
track(keyString);
|
|
2170
|
+
else if (subkey === "get")
|
|
2171
|
+
return (platform) => {
|
|
2172
|
+
let outVal = (0, import_createVariable.getVariable)(val);
|
|
2173
|
+
if (platform !== "web" && import_constants.isIos && !deopt && config.settings.fastSchemeChange && !someParentIsInversed(themeManager) && scheme) {
|
|
2174
|
+
let oppositeThemeName = name.replace(
|
|
2175
|
+
scheme === "dark" ? "dark" : "light",
|
|
2176
|
+
scheme === "dark" ? "light" : "dark"
|
|
2177
|
+
), oppositeTheme = config.themes[oppositeThemeName], oppositeVal = (0, import_createVariable.getVariable)(oppositeTheme == null ? void 0 : oppositeTheme[keyString]);
|
|
2178
|
+
if (oppositeVal)
|
|
2179
|
+
return {
|
|
2180
|
+
dynamic: {
|
|
2181
|
+
dark: scheme === "dark" ? outVal : oppositeVal,
|
|
2182
|
+
light: scheme === "light" ? outVal : oppositeVal
|
|
2183
|
+
}
|
|
2184
|
+
};
|
|
2185
|
+
}
|
|
2186
|
+
return track(keyString), outVal;
|
|
2187
|
+
};
|
|
2188
|
+
return Reflect.get(val, subkey);
|
|
2189
|
+
}
|
|
2190
|
+
});
|
|
2191
|
+
if (process.env.NODE_ENV === "development" && process.env.TAMAGUI_FEAT_THROW_ON_MISSING_THEME_VALUE === "1")
|
|
2192
|
+
throw new Error(
|
|
2193
|
+
`[tamagui] No theme key "${key}" found in theme ${name}.
|
|
2194
|
+
Keys in theme: ${Object.keys(
|
|
2195
|
+
theme
|
|
2196
|
+
).join(", ")}`
|
|
2197
|
+
);
|
|
2198
|
+
}
|
|
2199
|
+
return Reflect.get(_, key);
|
|
2200
|
+
}
|
|
2201
|
+
});
|
|
2202
|
+
}
|
|
2203
|
+
function someParentIsInversed(manager) {
|
|
2204
|
+
{
|
|
2205
|
+
let cur = manager;
|
|
2206
|
+
for (; cur; ) {
|
|
2207
|
+
if (!cur.parentManager)
|
|
2208
|
+
return !1;
|
|
2209
|
+
if (cur.parentManager.state.scheme !== cur.state.scheme)
|
|
2210
|
+
return !0;
|
|
2211
|
+
cur = cur.parentManager;
|
|
2212
|
+
}
|
|
2213
|
+
}
|
|
2292
2214
|
return !1;
|
|
2293
|
-
}
|
|
2215
|
+
}
|
|
2216
|
+
var activeThemeManagers = /* @__PURE__ */ new Set(), _uidToManager = /* @__PURE__ */ new WeakMap(), _idToUID = {}, getId = (id) => _idToUID[id], getThemeManager = (id) => _uidToManager.get(getId(id)), registerThemeManager = (t) => {
|
|
2217
|
+
if (!_idToUID[t.id]) {
|
|
2218
|
+
let id = _idToUID[t.id] = {};
|
|
2219
|
+
_uidToManager.set(id, t);
|
|
2220
|
+
}
|
|
2221
|
+
}, useChangeThemeEffect = (props, isRoot = !1, keys, shouldUpdate) => {
|
|
2222
|
+
let { disable } = props, parentManagerId = (0, import_react3.useContext)(import_ThemeManagerContext.ThemeManagerIDContext), parentManager = getThemeManager(parentManagerId);
|
|
2223
|
+
if (!isRoot && !parentManager || disable)
|
|
2224
|
+
return {
|
|
2225
|
+
isNewTheme: !1,
|
|
2226
|
+
state: parentManager == null ? void 0 : parentManager.state,
|
|
2227
|
+
themeManager: parentManager
|
|
2228
|
+
};
|
|
2229
|
+
let [themeState, setThemeState] = (0, import_react3.useState)(createState), { state, mounted, isNewTheme, themeManager, inversed } = themeState, isInversingOnMount = !!(!themeState.mounted && props.inverse);
|
|
2230
|
+
function getShouldUpdateTheme(manager = themeManager, nextState, prevState = state, forceShouldChange = !1) {
|
|
2231
|
+
let forceUpdate = shouldUpdate == null ? void 0 : shouldUpdate();
|
|
2232
|
+
if (!manager || !forceShouldChange && forceUpdate === !1)
|
|
2233
|
+
return;
|
|
2234
|
+
let next = nextState || manager.getState(props, parentManager);
|
|
2235
|
+
if (forceShouldChange || next && !(forceUpdate !== !0 && !manager.getStateShouldChange(next, prevState)))
|
|
2236
|
+
return next;
|
|
2237
|
+
}
|
|
2238
|
+
if (import_constants.isServer || ((0, import_react3.useEffect)(() => {
|
|
2239
|
+
if (!themeManager)
|
|
2240
|
+
return;
|
|
2241
|
+
if (props.inverse && !mounted) {
|
|
2242
|
+
setThemeState((prev) => createState({
|
|
2243
|
+
...prev,
|
|
2244
|
+
mounted: !0
|
|
2245
|
+
}));
|
|
2246
|
+
return;
|
|
2247
|
+
}
|
|
2248
|
+
(isNewTheme || getShouldUpdateTheme(themeManager)) && (activeThemeManagers.add(themeManager), setThemeState(createState));
|
|
2249
|
+
let selfListenerDispose = themeManager.onChangeTheme((_a, _b, forced) => {
|
|
2250
|
+
forced && setThemeState((prev) => createState(prev, !0));
|
|
2251
|
+
}), disposeChangeListener = parentManager == null ? void 0 : parentManager.onChangeTheme(
|
|
2252
|
+
(name, manager, forced) => {
|
|
2253
|
+
let force = forced || (shouldUpdate == null ? void 0 : shouldUpdate()) || props.deopt || props["disable-child-theme"], shouldTryUpdate = force ?? !!(keys != null && keys.length || isNewTheme);
|
|
2254
|
+
process.env.NODE_ENV === "development" && props.debug === "verbose" && console.info(" \u{1F538} onChange", themeManager.id, {
|
|
2255
|
+
force,
|
|
2256
|
+
shouldTryUpdate,
|
|
2257
|
+
props,
|
|
2258
|
+
name,
|
|
2259
|
+
manager,
|
|
2260
|
+
keys
|
|
2261
|
+
}), shouldTryUpdate && setThemeState((prev) => createState(prev, force));
|
|
2262
|
+
},
|
|
2263
|
+
themeManager.id
|
|
2264
|
+
);
|
|
2265
|
+
return () => {
|
|
2266
|
+
selfListenerDispose(), disposeChangeListener == null || disposeChangeListener(), isNewTheme && activeThemeManagers.delete(themeManager);
|
|
2267
|
+
};
|
|
2268
|
+
}, [
|
|
2269
|
+
themeManager,
|
|
2270
|
+
parentManager,
|
|
2271
|
+
isNewTheme,
|
|
2272
|
+
props.componentName,
|
|
2273
|
+
props.inverse,
|
|
2274
|
+
props.name,
|
|
2275
|
+
props.reset,
|
|
2276
|
+
mounted
|
|
2277
|
+
]), process.env.NODE_ENV === "development" && props.debug !== "profile" && (0, import_react3.useEffect)(() => (globalThis.TamaguiThemeManagers ??= /* @__PURE__ */ new Set(), globalThis.TamaguiThemeManagers.add(themeManager), () => {
|
|
2278
|
+
globalThis.TamaguiThemeManagers.delete(themeManager);
|
|
2279
|
+
}), [themeManager])), isInversingOnMount)
|
|
2280
|
+
return {
|
|
2281
|
+
isNewTheme: !1,
|
|
2282
|
+
inversed: !1,
|
|
2283
|
+
themeManager: parentManager,
|
|
2284
|
+
state: {
|
|
2285
|
+
name: "",
|
|
2286
|
+
...parentManager == null ? void 0 : parentManager.state,
|
|
2287
|
+
className: ""
|
|
2288
|
+
}
|
|
2289
|
+
};
|
|
2290
|
+
return {
|
|
2291
|
+
state,
|
|
2292
|
+
isNewTheme,
|
|
2293
|
+
inversed,
|
|
2294
|
+
themeManager
|
|
2295
|
+
};
|
|
2296
|
+
function createState(prev, force = !1) {
|
|
2297
|
+
if (prev && (shouldUpdate == null ? void 0 : shouldUpdate()) === !1 && !force)
|
|
2298
|
+
return prev;
|
|
2299
|
+
let themeManager2 = parentManager, state2;
|
|
2300
|
+
if ((0, import_ThemeManager.getHasThemeUpdatingProps)(props)) {
|
|
2301
|
+
let getNewThemeManager = () => new import_ThemeManager.ThemeManager(props, isRoot ? "root" : parentManager);
|
|
2302
|
+
if (prev != null && prev.themeManager) {
|
|
2303
|
+
themeManager2 = prev.themeManager;
|
|
2304
|
+
let forceChange = force || !!(keys != null && keys.length), next = themeManager2.getState(props, parentManager), nextState = getShouldUpdateTheme(
|
|
2305
|
+
themeManager2,
|
|
2306
|
+
next,
|
|
2307
|
+
prev.state,
|
|
2308
|
+
forceChange
|
|
2309
|
+
);
|
|
2310
|
+
nextState ? (state2 = nextState, prev.isNewTheme ? themeManager2.updateState(nextState) : themeManager2 = getNewThemeManager()) : prev.isNewTheme && parentManager && !next && (themeManager2 = parentManager);
|
|
2311
|
+
} else
|
|
2312
|
+
themeManager2 = getNewThemeManager(), state2 = { ...themeManager2.state };
|
|
2313
|
+
}
|
|
2314
|
+
let isNewTheme2 = !!(themeManager2 !== parentManager || props.inverse);
|
|
2315
|
+
isNewTheme2 && registerThemeManager(themeManager2);
|
|
2316
|
+
let mounted2 = props.inverse ? isRoot || (prev == null ? void 0 : prev.mounted) : !0;
|
|
2317
|
+
state2 || (isNewTheme2 ? state2 = themeManager2.state : (state2 = parentManager.state, themeManager2 = parentManager));
|
|
2318
|
+
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 = {
|
|
2319
|
+
themeManager: themeManager2,
|
|
2320
|
+
isNewTheme: isNewTheme2,
|
|
2321
|
+
mounted: mounted2,
|
|
2322
|
+
inversed: inversed2
|
|
2323
|
+
}, shouldReturnPrev = prev && !force && // isEqualShallow uses the second arg as the keys so this should compare without state first...
|
|
2324
|
+
(0, import_createShallowSetState.isEqualShallow)(prev, response) && // ... and then compare just the state, because we make a new state obj but is likely the same
|
|
2325
|
+
(0, import_createShallowSetState.isEqualShallow)(prev.state, state2);
|
|
2326
|
+
if (prev && shouldReturnPrev)
|
|
2327
|
+
return prev;
|
|
2328
|
+
if (response.state = state2, process.env.NODE_ENV === "development" && props.debug && import_constants.isClient) {
|
|
2329
|
+
console.groupCollapsed(` \u{1F537} ${themeManager2.id} useChangeThemeEffect createState`);
|
|
2330
|
+
let parentState = { ...parentManager == null ? void 0 : parentManager.state }, parentId = parentManager == null ? void 0 : parentManager.id, themeManagerState = { ...themeManager2.state };
|
|
2331
|
+
console.info({
|
|
2332
|
+
props,
|
|
2333
|
+
parentState,
|
|
2334
|
+
parentId,
|
|
2335
|
+
themeManager: themeManager2,
|
|
2336
|
+
prev,
|
|
2337
|
+
response,
|
|
2338
|
+
themeManagerState
|
|
2339
|
+
}), console.groupEnd();
|
|
2340
|
+
}
|
|
2341
|
+
return response;
|
|
2342
|
+
}
|
|
2343
|
+
};
|
|
2294
2344
|
}
|
|
2295
2345
|
});
|
|
2296
2346
|
|
|
2297
|
-
// ../web/dist/cjs/
|
|
2298
|
-
var
|
|
2299
|
-
"../web/dist/cjs/
|
|
2347
|
+
// ../web/dist/cjs/Tamagui.native.js
|
|
2348
|
+
var require_Tamagui_native = __commonJS({
|
|
2349
|
+
"../web/dist/cjs/Tamagui.native.js"(exports2, module2) {
|
|
2300
2350
|
"use strict";
|
|
2301
|
-
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
2351
|
+
var __create2 = Object.create, __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __getProtoOf2 = Object.getPrototypeOf, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
2302
2352
|
for (var name in all)
|
|
2303
2353
|
__defProp2(target, name, { get: all[name], enumerable: !0 });
|
|
2304
2354
|
}, __copyProps2 = (to, from, except, desc) => {
|
|
@@ -2306,22 +2356,112 @@ var require_getGroupPropParts_native = __commonJS({
|
|
|
2306
2356
|
for (let key of __getOwnPropNames2(from))
|
|
2307
2357
|
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
2308
2358
|
return to;
|
|
2309
|
-
},
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
|
|
2359
|
+
}, __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps2(
|
|
2360
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
2361
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
2362
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
2363
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
2364
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", { value: mod, enumerable: !0 }) : target,
|
|
2365
|
+
mod
|
|
2366
|
+
)), __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), Tamagui_exports = {};
|
|
2367
|
+
__export2(Tamagui_exports, {
|
|
2368
|
+
Tamagui: () => Tamagui,
|
|
2369
|
+
getValueFromIdentifier: () => getValueFromIdentifier,
|
|
2370
|
+
setIdentifierValue: () => setIdentifierValue
|
|
2371
|
+
});
|
|
2372
|
+
module2.exports = __toCommonJS2(Tamagui_exports);
|
|
2373
|
+
var Helpers = __toESM2(require_index_native4()), import_config = require_config_native(), import_insertStyleRule = require_insertStyleRule_native(), import_useMedia = require_useMedia_native(), import_useTheme = require_useTheme_native(), Tamagui = (() => {
|
|
2374
|
+
if (process.env.NODE_ENV === "development") {
|
|
2375
|
+
class TamaguiManager {
|
|
2376
|
+
constructor() {
|
|
2377
|
+
this.Helpers = Helpers, this.getThemeManager = import_useTheme.getThemeManager;
|
|
2378
|
+
}
|
|
2379
|
+
get activeThemeManagers() {
|
|
2380
|
+
return import_useTheme.activeThemeManagers;
|
|
2381
|
+
}
|
|
2382
|
+
get mediaState() {
|
|
2383
|
+
return { ...import_useMedia.mediaState };
|
|
2384
|
+
}
|
|
2385
|
+
get config() {
|
|
2386
|
+
return (0, import_config.getConfig)();
|
|
2387
|
+
}
|
|
2388
|
+
get insertedRules() {
|
|
2389
|
+
return (0, import_insertStyleRule.getAllRules)();
|
|
2390
|
+
}
|
|
2391
|
+
get allSelectors() {
|
|
2392
|
+
return (0, import_insertStyleRule.getAllSelectors)();
|
|
2393
|
+
}
|
|
2394
|
+
get allTransforms() {
|
|
2395
|
+
return (0, import_insertStyleRule.getAllTransforms)();
|
|
2396
|
+
}
|
|
2397
|
+
get identifierToValue() {
|
|
2398
|
+
return identifierToValue;
|
|
2399
|
+
}
|
|
2400
|
+
}
|
|
2401
|
+
return new TamaguiManager();
|
|
2402
|
+
}
|
|
2403
|
+
})(), identifierToValue = /* @__PURE__ */ new Map(), getValueFromIdentifier = (identifier) => identifierToValue.get(identifier), setIdentifierValue = (identifier, value) => {
|
|
2404
|
+
identifierToValue.set(identifier, value);
|
|
2405
|
+
};
|
|
2406
|
+
}
|
|
2320
2407
|
});
|
|
2321
2408
|
|
|
2322
|
-
// ../
|
|
2323
|
-
var
|
|
2324
|
-
"../
|
|
2409
|
+
// ../compose-refs/dist/cjs/compose-refs.native.js
|
|
2410
|
+
var require_compose_refs_native = __commonJS({
|
|
2411
|
+
"../compose-refs/dist/cjs/compose-refs.native.js"(exports2, module2) {
|
|
2412
|
+
"use strict";
|
|
2413
|
+
var __create2 = Object.create, __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __getProtoOf2 = Object.getPrototypeOf, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
2414
|
+
for (var name in all)
|
|
2415
|
+
__defProp2(target, name, { get: all[name], enumerable: !0 });
|
|
2416
|
+
}, __copyProps2 = (to, from, except, desc) => {
|
|
2417
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
2418
|
+
for (let key of __getOwnPropNames2(from))
|
|
2419
|
+
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
2420
|
+
return to;
|
|
2421
|
+
}, __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps2(
|
|
2422
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
2423
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
2424
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
2425
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
2426
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", { value: mod, enumerable: !0 }) : target,
|
|
2427
|
+
mod
|
|
2428
|
+
)), __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), compose_refs_exports = {};
|
|
2429
|
+
__export2(compose_refs_exports, {
|
|
2430
|
+
composeRefs: () => composeRefs,
|
|
2431
|
+
useComposedRefs: () => useComposedRefs
|
|
2432
|
+
});
|
|
2433
|
+
module2.exports = __toCommonJS2(compose_refs_exports);
|
|
2434
|
+
var React = __toESM2(require("react"));
|
|
2435
|
+
function setRef(ref, value) {
|
|
2436
|
+
typeof ref == "function" ? ref(value) : ref && (ref.current = value);
|
|
2437
|
+
}
|
|
2438
|
+
function composeRefs(...refs) {
|
|
2439
|
+
return (node) => refs.forEach((ref) => setRef(ref, node));
|
|
2440
|
+
}
|
|
2441
|
+
function useComposedRefs(...refs) {
|
|
2442
|
+
return React.useCallback(composeRefs(...refs), refs);
|
|
2443
|
+
}
|
|
2444
|
+
}
|
|
2445
|
+
});
|
|
2446
|
+
|
|
2447
|
+
// ../compose-refs/dist/cjs/index.native.js
|
|
2448
|
+
var require_index_native5 = __commonJS({
|
|
2449
|
+
"../compose-refs/dist/cjs/index.native.js"(exports2, module2) {
|
|
2450
|
+
"use strict";
|
|
2451
|
+
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __copyProps2 = (to, from, except, desc) => {
|
|
2452
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
2453
|
+
for (let key of __getOwnPropNames2(from))
|
|
2454
|
+
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
2455
|
+
return to;
|
|
2456
|
+
}, __reExport2 = (target, mod, secondTarget) => (__copyProps2(target, mod, "default"), secondTarget && __copyProps2(secondTarget, mod, "default")), __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), src_exports2 = {};
|
|
2457
|
+
module2.exports = __toCommonJS2(src_exports2);
|
|
2458
|
+
__reExport2(src_exports2, require_compose_refs_native(), module2.exports);
|
|
2459
|
+
}
|
|
2460
|
+
});
|
|
2461
|
+
|
|
2462
|
+
// ../use-did-finish-ssr/dist/cjs/index.native.js
|
|
2463
|
+
var require_index_native6 = __commonJS({
|
|
2464
|
+
"../use-did-finish-ssr/dist/cjs/index.native.js"(exports2, module2) {
|
|
2325
2465
|
"use strict";
|
|
2326
2466
|
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
2327
2467
|
for (var name in all)
|
|
@@ -2331,165 +2471,467 @@ var require_createMediaStyle_native = __commonJS({
|
|
|
2331
2471
|
for (let key of __getOwnPropNames2(from))
|
|
2332
2472
|
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
2333
2473
|
return to;
|
|
2334
|
-
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod),
|
|
2335
|
-
__export2(
|
|
2336
|
-
|
|
2337
|
-
|
|
2474
|
+
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), src_exports2 = {};
|
|
2475
|
+
__export2(src_exports2, {
|
|
2476
|
+
useClientValue: () => useClientValue,
|
|
2477
|
+
useDidFinishSSR: () => useDidFinishSSR
|
|
2338
2478
|
});
|
|
2339
|
-
module2.exports = __toCommonJS2(
|
|
2340
|
-
var
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
|
|
2364
|
-
|
|
2479
|
+
module2.exports = __toCommonJS2(src_exports2);
|
|
2480
|
+
var import_react3 = require("react");
|
|
2481
|
+
function useDidFinishSSR(value) {
|
|
2482
|
+
return value ?? !0;
|
|
2483
|
+
}
|
|
2484
|
+
function useClientValue(value) {
|
|
2485
|
+
return useDidFinishSSR() ? typeof value == "function" ? value() : value : void 0;
|
|
2486
|
+
}
|
|
2487
|
+
}
|
|
2488
|
+
});
|
|
2489
|
+
|
|
2490
|
+
// ../web/dist/cjs/helpers/objectIdentityKey.native.js
|
|
2491
|
+
var require_objectIdentityKey_native = __commonJS({
|
|
2492
|
+
"../web/dist/cjs/helpers/objectIdentityKey.native.js"(exports2, module2) {
|
|
2493
|
+
"use strict";
|
|
2494
|
+
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
2495
|
+
for (var name in all)
|
|
2496
|
+
__defProp2(target, name, { get: all[name], enumerable: !0 });
|
|
2497
|
+
}, __copyProps2 = (to, from, except, desc) => {
|
|
2498
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
2499
|
+
for (let key of __getOwnPropNames2(from))
|
|
2500
|
+
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
2501
|
+
return to;
|
|
2502
|
+
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), objectIdentityKey_exports = {};
|
|
2503
|
+
__export2(objectIdentityKey_exports, {
|
|
2504
|
+
objectIdentityKey: () => objectIdentityKey
|
|
2505
|
+
});
|
|
2506
|
+
module2.exports = __toCommonJS2(objectIdentityKey_exports);
|
|
2507
|
+
function objectIdentityKey(obj) {
|
|
2508
|
+
let k = "";
|
|
2509
|
+
for (let key in obj) {
|
|
2510
|
+
k += key;
|
|
2511
|
+
let arg = obj[key], type = typeof arg;
|
|
2512
|
+
if (!arg || type !== "object" && type !== "function")
|
|
2513
|
+
k += type + arg;
|
|
2514
|
+
else if (cache.has(arg))
|
|
2515
|
+
k += cache.get(arg);
|
|
2516
|
+
else {
|
|
2517
|
+
let v = Math.random();
|
|
2518
|
+
cache.set(arg, v), k += v;
|
|
2365
2519
|
}
|
|
2366
|
-
let mediaKey = groupMediaKey || mediaKeyIn, mediaSelector = selectors[mediaKey], mediaQuery = `${negate ? "not all and " : ""}${mediaSelector}`, precedenceImportancePrefix = groupMediaKey ? "" : enableMediaPropOrder ? (
|
|
2367
|
-
// this new array should be cached
|
|
2368
|
-
new Array(priority).fill(":root").join("")
|
|
2369
|
-
) : (
|
|
2370
|
-
// @ts-ignore
|
|
2371
|
-
prefixes[mediaKey]
|
|
2372
|
-
), prefix = groupMediaKey ? `@container ${containerName}` : "@media";
|
|
2373
|
-
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}}`);
|
|
2374
2520
|
}
|
|
2375
|
-
return
|
|
2376
|
-
|
|
2377
|
-
|
|
2378
|
-
|
|
2521
|
+
return k;
|
|
2522
|
+
}
|
|
2523
|
+
var cache = /* @__PURE__ */ new WeakMap();
|
|
2524
|
+
}
|
|
2525
|
+
});
|
|
2526
|
+
|
|
2527
|
+
// ../web/dist/cjs/helpers/createStyledContext.native.js
|
|
2528
|
+
var require_createStyledContext_native = __commonJS({
|
|
2529
|
+
"../web/dist/cjs/helpers/createStyledContext.native.js"(exports2, module2) {
|
|
2530
|
+
"use strict";
|
|
2531
|
+
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
2532
|
+
for (var name in all)
|
|
2533
|
+
__defProp2(target, name, { get: all[name], enumerable: !0 });
|
|
2534
|
+
}, __copyProps2 = (to, from, except, desc) => {
|
|
2535
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
2536
|
+
for (let key of __getOwnPropNames2(from))
|
|
2537
|
+
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
2538
|
+
return to;
|
|
2539
|
+
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), createStyledContext_exports = {};
|
|
2540
|
+
__export2(createStyledContext_exports, {
|
|
2541
|
+
createStyledContext: () => createStyledContext
|
|
2542
|
+
});
|
|
2543
|
+
module2.exports = __toCommonJS2(createStyledContext_exports);
|
|
2544
|
+
var import_react3 = require("react"), import_objectIdentityKey = require_objectIdentityKey_native(), import_jsx_runtime = require("react/jsx-runtime");
|
|
2545
|
+
function createStyledContext(defaultValues) {
|
|
2546
|
+
let OGContext = (0, import_react3.createContext)(defaultValues), OGProvider = OGContext.Provider, Context = OGContext, scopedContexts = /* @__PURE__ */ new Map(), Provider = ({
|
|
2547
|
+
children,
|
|
2548
|
+
scope,
|
|
2549
|
+
...values
|
|
2550
|
+
}) => {
|
|
2551
|
+
let next = (0, import_react3.useMemo)(() => ({
|
|
2552
|
+
// this ! is a workaround for ts error
|
|
2553
|
+
...defaultValues,
|
|
2554
|
+
...values
|
|
2555
|
+
}), [(0, import_objectIdentityKey.objectIdentityKey)(values)]), Provider2 = OGProvider;
|
|
2556
|
+
if (scope) {
|
|
2557
|
+
let ScopedContext = scopedContexts.get(scope);
|
|
2558
|
+
ScopedContext || (ScopedContext = (0, import_react3.createContext)(defaultValues), scopedContexts.set(scope, ScopedContext)), Provider2 = ScopedContext.Provider;
|
|
2559
|
+
}
|
|
2560
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Provider2, { value: next, children });
|
|
2561
|
+
}, useStyledContext = (scope) => {
|
|
2562
|
+
let context = scope ? scopedContexts.get(scope) : OGContext;
|
|
2563
|
+
return (0, import_react3.useContext)(context);
|
|
2379
2564
|
};
|
|
2380
|
-
|
|
2565
|
+
return Context.Provider = Provider, Context.props = defaultValues, Context.context = OGContext, Context.useStyledContext = useStyledContext, Context;
|
|
2566
|
+
}
|
|
2381
2567
|
}
|
|
2382
2568
|
});
|
|
2383
2569
|
|
|
2384
|
-
//
|
|
2385
|
-
var
|
|
2386
|
-
"
|
|
2570
|
+
// ../web/dist/cjs/contexts/ComponentContext.native.js
|
|
2571
|
+
var require_ComponentContext_native = __commonJS({
|
|
2572
|
+
"../web/dist/cjs/contexts/ComponentContext.native.js"(exports2, module2) {
|
|
2387
2573
|
"use strict";
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
|
|
2409
|
-
|
|
2410
|
-
match[1] + match[1] + // r
|
|
2411
|
-
match[2] + match[2] + // g
|
|
2412
|
-
match[3] + match[3] + // b
|
|
2413
|
-
"ff",
|
|
2414
|
-
// a
|
|
2415
|
-
16
|
|
2416
|
-
) >>> 0 : (match = matchers.hex8.exec(color)) ? parseInt(match[1], 16) >>> 0 : (match = matchers.hex4.exec(color)) ? parseInt(
|
|
2417
|
-
match[1] + match[1] + // r
|
|
2418
|
-
match[2] + match[2] + // g
|
|
2419
|
-
match[3] + match[3] + // b
|
|
2420
|
-
match[4] + match[4],
|
|
2421
|
-
// a
|
|
2422
|
-
16
|
|
2423
|
-
) >>> 0 : (match = matchers.hsl.exec(color)) ? (hslToRgb(
|
|
2424
|
-
parse360(match[1]),
|
|
2425
|
-
// h
|
|
2426
|
-
parsePercentage(match[2]),
|
|
2427
|
-
// s
|
|
2428
|
-
parsePercentage(match[3])
|
|
2429
|
-
// l
|
|
2430
|
-
) | 255) >>> // a
|
|
2431
|
-
0 : (match = matchers.hsla.exec(color)) ? match[6] !== void 0 ? (hslToRgb(
|
|
2432
|
-
parse360(match[6]),
|
|
2433
|
-
// h
|
|
2434
|
-
parsePercentage(match[7]),
|
|
2435
|
-
// s
|
|
2436
|
-
parsePercentage(match[8])
|
|
2437
|
-
// l
|
|
2438
|
-
) | parse1(match[9])) >>> // a
|
|
2439
|
-
0 : (hslToRgb(
|
|
2440
|
-
parse360(match[2]),
|
|
2441
|
-
// h
|
|
2442
|
-
parsePercentage(match[3]),
|
|
2443
|
-
// s
|
|
2444
|
-
parsePercentage(match[4])
|
|
2445
|
-
// l
|
|
2446
|
-
) | parse1(match[5])) >>> // a
|
|
2447
|
-
0 : (match = matchers.hwb.exec(color)) ? (hwbToRgb(
|
|
2448
|
-
parse360(match[1]),
|
|
2449
|
-
// h
|
|
2450
|
-
parsePercentage(match[2]),
|
|
2451
|
-
// w
|
|
2452
|
-
parsePercentage(match[3])
|
|
2453
|
-
// b
|
|
2454
|
-
) | 255) >>> // a
|
|
2455
|
-
0 : null);
|
|
2456
|
-
}
|
|
2457
|
-
function hue2rgb(p, q, t) {
|
|
2458
|
-
return t < 0 && (t += 1), t > 1 && (t -= 1), t < 1 / 6 ? p + (q - p) * 6 * t : t < 1 / 2 ? q : t < 2 / 3 ? p + (q - p) * (2 / 3 - t) * 6 : p;
|
|
2459
|
-
}
|
|
2460
|
-
function hslToRgb(h, s, l) {
|
|
2461
|
-
let q = l < 0.5 ? l * (1 + s) : l + s - l * s, p = 2 * l - q, r = hue2rgb(p, q, h + 1 / 3), g = hue2rgb(p, q, h), b = hue2rgb(p, q, h - 1 / 3);
|
|
2462
|
-
return Math.round(r * 255) << 24 | Math.round(g * 255) << 16 | Math.round(b * 255) << 8;
|
|
2463
|
-
}
|
|
2464
|
-
function hwbToRgb(h, w, b) {
|
|
2465
|
-
if (w + b >= 1) {
|
|
2466
|
-
let gray = Math.round(w * 255 / (w + b));
|
|
2467
|
-
return gray << 24 | gray << 16 | gray << 8;
|
|
2574
|
+
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
2575
|
+
for (var name in all)
|
|
2576
|
+
__defProp2(target, name, { get: all[name], enumerable: !0 });
|
|
2577
|
+
}, __copyProps2 = (to, from, except, desc) => {
|
|
2578
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
2579
|
+
for (let key of __getOwnPropNames2(from))
|
|
2580
|
+
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
2581
|
+
return to;
|
|
2582
|
+
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), ComponentContext_exports = {};
|
|
2583
|
+
__export2(ComponentContext_exports, {
|
|
2584
|
+
ComponentContext: () => ComponentContext
|
|
2585
|
+
});
|
|
2586
|
+
module2.exports = __toCommonJS2(ComponentContext_exports);
|
|
2587
|
+
var import_createStyledContext = require_createStyledContext_native(), ComponentContext = (0, import_createStyledContext.createStyledContext)({
|
|
2588
|
+
disableSSR: void 0,
|
|
2589
|
+
inText: !1,
|
|
2590
|
+
language: null,
|
|
2591
|
+
animationDriver: null,
|
|
2592
|
+
groups: {
|
|
2593
|
+
emit: null,
|
|
2594
|
+
subscribe: null,
|
|
2595
|
+
state: {}
|
|
2468
2596
|
}
|
|
2469
|
-
|
|
2470
|
-
|
|
2471
|
-
|
|
2472
|
-
|
|
2473
|
-
|
|
2474
|
-
|
|
2475
|
-
|
|
2476
|
-
|
|
2477
|
-
|
|
2478
|
-
|
|
2479
|
-
|
|
2480
|
-
|
|
2597
|
+
});
|
|
2598
|
+
}
|
|
2599
|
+
});
|
|
2600
|
+
|
|
2601
|
+
// ../web/dist/cjs/defaultComponentState.native.js
|
|
2602
|
+
var require_defaultComponentState_native = __commonJS({
|
|
2603
|
+
"../web/dist/cjs/defaultComponentState.native.js"(exports2, module2) {
|
|
2604
|
+
"use strict";
|
|
2605
|
+
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
2606
|
+
for (var name in all)
|
|
2607
|
+
__defProp2(target, name, { get: all[name], enumerable: !0 });
|
|
2608
|
+
}, __copyProps2 = (to, from, except, desc) => {
|
|
2609
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
2610
|
+
for (let key of __getOwnPropNames2(from))
|
|
2611
|
+
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
2612
|
+
return to;
|
|
2613
|
+
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), defaultComponentState_exports = {};
|
|
2614
|
+
__export2(defaultComponentState_exports, {
|
|
2615
|
+
defaultComponentState: () => defaultComponentState,
|
|
2616
|
+
defaultComponentStateMounted: () => defaultComponentStateMounted,
|
|
2617
|
+
defaultComponentStateShouldEnter: () => defaultComponentStateShouldEnter
|
|
2618
|
+
});
|
|
2619
|
+
module2.exports = __toCommonJS2(defaultComponentState_exports);
|
|
2620
|
+
var defaultComponentState = {
|
|
2621
|
+
hover: !1,
|
|
2622
|
+
press: !1,
|
|
2623
|
+
pressIn: !1,
|
|
2624
|
+
focus: !1,
|
|
2625
|
+
unmounted: !0
|
|
2626
|
+
}, defaultComponentStateMounted = {
|
|
2627
|
+
...defaultComponentState,
|
|
2628
|
+
unmounted: !1
|
|
2629
|
+
}, defaultComponentStateShouldEnter = {
|
|
2630
|
+
...defaultComponentState,
|
|
2631
|
+
unmounted: "should-enter"
|
|
2632
|
+
};
|
|
2633
|
+
}
|
|
2634
|
+
});
|
|
2635
|
+
|
|
2636
|
+
// ../web/dist/cjs/constants/accessibilityDirectMap.native.js
|
|
2637
|
+
var require_accessibilityDirectMap_native = __commonJS({
|
|
2638
|
+
"../web/dist/cjs/constants/accessibilityDirectMap.native.js"(exports2, module2) {
|
|
2639
|
+
"use strict";
|
|
2640
|
+
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
2641
|
+
for (var name in all)
|
|
2642
|
+
__defProp2(target, name, { get: all[name], enumerable: !0 });
|
|
2643
|
+
}, __copyProps2 = (to, from, except, desc) => {
|
|
2644
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
2645
|
+
for (let key of __getOwnPropNames2(from))
|
|
2646
|
+
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
2647
|
+
return to;
|
|
2648
|
+
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), accessibilityDirectMap_native_exports = {};
|
|
2649
|
+
__export2(accessibilityDirectMap_native_exports, {
|
|
2650
|
+
accessibilityDirectMap: () => accessibilityDirectMap,
|
|
2651
|
+
accessibilityWebRoleToNativeRole: () => accessibilityWebRoleToNativeRole,
|
|
2652
|
+
nativeAccessibilityState: () => nativeAccessibilityState,
|
|
2653
|
+
nativeAccessibilityValue: () => nativeAccessibilityValue,
|
|
2654
|
+
webToNativeAccessibilityDirectMap: () => webToNativeAccessibilityDirectMap
|
|
2655
|
+
});
|
|
2656
|
+
module2.exports = __toCommonJS2(accessibilityDirectMap_native_exports);
|
|
2657
|
+
var accessibilityDirectMap = {}, webToNativeAccessibilityDirectMap = {
|
|
2658
|
+
"aria-label": "accessibilityLabel",
|
|
2659
|
+
"aria-labelledby": "accessibilityLabelledBy",
|
|
2660
|
+
"aria-live": "accessibilityLiveRegion",
|
|
2661
|
+
"aria-modal": "accessibilityViewIsModal",
|
|
2662
|
+
"aria-hidden": "accessibilityElementsHidden"
|
|
2663
|
+
}, nativeAccessibilityValue = {
|
|
2664
|
+
"aria-valuemin": "min",
|
|
2665
|
+
"aria-valuemax": "max",
|
|
2666
|
+
"aria-valuenow": "now",
|
|
2667
|
+
"aria-valuetext": "text"
|
|
2668
|
+
}, nativeAccessibilityState = {
|
|
2669
|
+
"aria-disabled": "disabled",
|
|
2670
|
+
"aria-selected": "selected",
|
|
2671
|
+
"aria-checked": "checked",
|
|
2672
|
+
"aria-busy": "busy",
|
|
2673
|
+
"aria-expanded": "expanded"
|
|
2674
|
+
}, accessibilityWebRoleToNativeRole = {
|
|
2675
|
+
alert: "alert",
|
|
2676
|
+
button: "button",
|
|
2677
|
+
checkbox: "checkbox",
|
|
2678
|
+
combobox: "combobox",
|
|
2679
|
+
grid: "grid",
|
|
2680
|
+
group: "none",
|
|
2681
|
+
heading: "header",
|
|
2682
|
+
imagebutton: "imagebutton",
|
|
2683
|
+
img: "image",
|
|
2684
|
+
keyboardkey: "keyboardkey",
|
|
2685
|
+
link: "link",
|
|
2686
|
+
menu: "menu",
|
|
2687
|
+
menubar: "menubar",
|
|
2688
|
+
menuitem: "menuitem",
|
|
2689
|
+
none: "none",
|
|
2690
|
+
presentation: "none",
|
|
2691
|
+
progressbar: "progressbar",
|
|
2692
|
+
radio: "radio",
|
|
2693
|
+
radiogroup: "radiogroup",
|
|
2694
|
+
region: "summary",
|
|
2695
|
+
scrollbar: "scrollbar",
|
|
2696
|
+
searchbox: "search",
|
|
2697
|
+
slider: "adjustable",
|
|
2698
|
+
spinbutton: "spinbutton",
|
|
2699
|
+
summary: "summary",
|
|
2700
|
+
switch: "switch",
|
|
2701
|
+
tab: "tab",
|
|
2702
|
+
tablist: "tablist",
|
|
2703
|
+
text: "text",
|
|
2704
|
+
timer: "timer",
|
|
2705
|
+
togglebutton: "togglebutton",
|
|
2706
|
+
toolbar: "toolbar"
|
|
2707
|
+
};
|
|
2708
|
+
}
|
|
2709
|
+
});
|
|
2710
|
+
|
|
2711
|
+
// ../web/dist/cjs/constants/isDevTools.native.js
|
|
2712
|
+
var require_isDevTools_native = __commonJS({
|
|
2713
|
+
"../web/dist/cjs/constants/isDevTools.native.js"(exports2, module2) {
|
|
2714
|
+
"use strict";
|
|
2715
|
+
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
2716
|
+
for (var name in all)
|
|
2717
|
+
__defProp2(target, name, { get: all[name], enumerable: !0 });
|
|
2718
|
+
}, __copyProps2 = (to, from, except, desc) => {
|
|
2719
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
2720
|
+
for (let key of __getOwnPropNames2(from))
|
|
2721
|
+
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
2722
|
+
return to;
|
|
2723
|
+
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), isDevTools_exports = {};
|
|
2724
|
+
__export2(isDevTools_exports, {
|
|
2725
|
+
isDevTools: () => isDevTools
|
|
2726
|
+
});
|
|
2727
|
+
module2.exports = __toCommonJS2(isDevTools_exports);
|
|
2728
|
+
var isDevTools = (() => {
|
|
2729
|
+
if (process.env.NODE_ENV === "development")
|
|
2730
|
+
try {
|
|
2731
|
+
return new Function("try {return this===window;}catch(e){ return false;}")();
|
|
2732
|
+
} catch {
|
|
2733
|
+
}
|
|
2734
|
+
return !1;
|
|
2735
|
+
})();
|
|
2736
|
+
}
|
|
2737
|
+
});
|
|
2738
|
+
|
|
2739
|
+
// ../web/dist/cjs/helpers/getGroupPropParts.native.js
|
|
2740
|
+
var require_getGroupPropParts_native = __commonJS({
|
|
2741
|
+
"../web/dist/cjs/helpers/getGroupPropParts.native.js"(exports2, module2) {
|
|
2742
|
+
"use strict";
|
|
2743
|
+
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
2744
|
+
for (var name in all)
|
|
2745
|
+
__defProp2(target, name, { get: all[name], enumerable: !0 });
|
|
2746
|
+
}, __copyProps2 = (to, from, except, desc) => {
|
|
2747
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
2748
|
+
for (let key of __getOwnPropNames2(from))
|
|
2749
|
+
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
2750
|
+
return to;
|
|
2751
|
+
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), getGroupPropParts_exports = {};
|
|
2752
|
+
__export2(getGroupPropParts_exports, {
|
|
2753
|
+
getGroupPropParts: () => getGroupPropParts
|
|
2754
|
+
});
|
|
2755
|
+
module2.exports = __toCommonJS2(getGroupPropParts_exports);
|
|
2756
|
+
var import_useMedia = require_useMedia_native();
|
|
2757
|
+
function getGroupPropParts(groupProp) {
|
|
2758
|
+
let mediaQueries = (0, import_useMedia.getMedia)(), [_, name, part3, part4] = groupProp.split("-"), pseudo, media = part3 in mediaQueries ? part3 : void 0;
|
|
2759
|
+
return media ? pseudo = part4 : pseudo = part3, { name, pseudo, media };
|
|
2481
2760
|
}
|
|
2482
|
-
|
|
2483
|
-
|
|
2484
|
-
|
|
2485
|
-
|
|
2486
|
-
|
|
2487
|
-
|
|
2488
|
-
|
|
2489
|
-
|
|
2490
|
-
|
|
2491
|
-
|
|
2492
|
-
|
|
2761
|
+
}
|
|
2762
|
+
});
|
|
2763
|
+
|
|
2764
|
+
// ../web/dist/cjs/helpers/createMediaStyle.native.js
|
|
2765
|
+
var require_createMediaStyle_native = __commonJS({
|
|
2766
|
+
"../web/dist/cjs/helpers/createMediaStyle.native.js"(exports2, module2) {
|
|
2767
|
+
"use strict";
|
|
2768
|
+
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
2769
|
+
for (var name in all)
|
|
2770
|
+
__defProp2(target, name, { get: all[name], enumerable: !0 });
|
|
2771
|
+
}, __copyProps2 = (to, from, except, desc) => {
|
|
2772
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
2773
|
+
for (let key of __getOwnPropNames2(from))
|
|
2774
|
+
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
2775
|
+
return to;
|
|
2776
|
+
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), createMediaStyle_exports = {};
|
|
2777
|
+
__export2(createMediaStyle_exports, {
|
|
2778
|
+
MEDIA_SEP: () => MEDIA_SEP,
|
|
2779
|
+
createMediaStyle: () => createMediaStyle
|
|
2780
|
+
});
|
|
2781
|
+
module2.exports = __toCommonJS2(createMediaStyle_exports);
|
|
2782
|
+
var import_config = require_config_native(), import_useMedia = require_useMedia_native(), import_getGroupPropParts = require_getGroupPropParts_native(), MEDIA_SEP = "_", prefixes = null, selectors = null, groupPseudoToPseudoCSSMap = {
|
|
2783
|
+
press: "active"
|
|
2784
|
+
}, createMediaStyle = (styleObject, mediaKeyIn, mediaQueries, type, negate, priority) => {
|
|
2785
|
+
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(";");
|
|
2786
|
+
if (isNonWindowMedia) {
|
|
2787
|
+
let precedenceImportancePrefix = new Array((priority || 0) + (isGroup ? 1 : 0)).fill(":root").join("");
|
|
2788
|
+
if (isTheme || isGroup) {
|
|
2789
|
+
let groupInfo = (0, import_getGroupPropParts.getGroupPropParts)(mediaKeyIn), mediaName = groupInfo == null ? void 0 : groupInfo.name;
|
|
2790
|
+
groupMediaKey = groupInfo == null ? void 0 : groupInfo.media, isGroup && (containerName = mediaName);
|
|
2791
|
+
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(
|
|
2792
|
+
":root",
|
|
2793
|
+
""
|
|
2794
|
+
)}`;
|
|
2795
|
+
styleRule = styleInner.replace(selector, nextSelector);
|
|
2796
|
+
} else
|
|
2797
|
+
styleRule = `${precedenceImportancePrefix}${styleInner}`;
|
|
2798
|
+
}
|
|
2799
|
+
if (!isNonWindowMedia || groupMediaKey) {
|
|
2800
|
+
if (!selectors) {
|
|
2801
|
+
let mediaKeys = Object.keys(mediaQueries);
|
|
2802
|
+
selectors = Object.fromEntries(
|
|
2803
|
+
mediaKeys.map((key) => [key, (0, import_useMedia.mediaObjectToString)(mediaQueries[key])])
|
|
2804
|
+
), enableMediaPropOrder || (prefixes = Object.fromEntries(
|
|
2805
|
+
mediaKeys.map((k, index) => [k, new Array(index + 1).fill(":root").join("")])
|
|
2806
|
+
));
|
|
2807
|
+
}
|
|
2808
|
+
let mediaKey = groupMediaKey || mediaKeyIn, mediaSelector = selectors[mediaKey], mediaQuery = `${negate ? "not all and " : ""}${mediaSelector}`, precedenceImportancePrefix = groupMediaKey ? "" : enableMediaPropOrder ? (
|
|
2809
|
+
// this new array should be cached
|
|
2810
|
+
new Array(priority).fill(":root").join("")
|
|
2811
|
+
) : (
|
|
2812
|
+
// @ts-ignore
|
|
2813
|
+
prefixes[mediaKey]
|
|
2814
|
+
), prefix = groupMediaKey ? `@container ${containerName}` : "@media";
|
|
2815
|
+
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}}`);
|
|
2816
|
+
}
|
|
2817
|
+
return {
|
|
2818
|
+
property,
|
|
2819
|
+
rules: [styleRule],
|
|
2820
|
+
identifier: nextIdentifier
|
|
2821
|
+
};
|
|
2822
|
+
};
|
|
2823
|
+
}
|
|
2824
|
+
});
|
|
2825
|
+
|
|
2826
|
+
// ../../node_modules/@react-native/normalize-color/index.js
|
|
2827
|
+
var require_normalize_color = __commonJS({
|
|
2828
|
+
"../../node_modules/@react-native/normalize-color/index.js"(exports2, module2) {
|
|
2829
|
+
"use strict";
|
|
2830
|
+
function normalizeColor(color) {
|
|
2831
|
+
if (typeof color == "number")
|
|
2832
|
+
return color >>> 0 === color && color >= 0 && color <= 4294967295 ? color : null;
|
|
2833
|
+
if (typeof color != "string")
|
|
2834
|
+
return null;
|
|
2835
|
+
let matchers = getMatchers(), match;
|
|
2836
|
+
if (match = matchers.hex6.exec(color))
|
|
2837
|
+
return parseInt(match[1] + "ff", 16) >>> 0;
|
|
2838
|
+
let colorFromKeyword = normalizeKeyword(color);
|
|
2839
|
+
return colorFromKeyword ?? ((match = matchers.rgb.exec(color)) ? (parse255(match[1]) << 24 | // r
|
|
2840
|
+
parse255(match[2]) << 16 | // g
|
|
2841
|
+
parse255(match[3]) << 8 | // b
|
|
2842
|
+
255) >>> // a
|
|
2843
|
+
0 : (match = matchers.rgba.exec(color)) ? match[6] !== void 0 ? (parse255(match[6]) << 24 | // r
|
|
2844
|
+
parse255(match[7]) << 16 | // g
|
|
2845
|
+
parse255(match[8]) << 8 | // b
|
|
2846
|
+
parse1(match[9])) >>> // a
|
|
2847
|
+
0 : (parse255(match[2]) << 24 | // r
|
|
2848
|
+
parse255(match[3]) << 16 | // g
|
|
2849
|
+
parse255(match[4]) << 8 | // b
|
|
2850
|
+
parse1(match[5])) >>> // a
|
|
2851
|
+
0 : (match = matchers.hex3.exec(color)) ? parseInt(
|
|
2852
|
+
match[1] + match[1] + // r
|
|
2853
|
+
match[2] + match[2] + // g
|
|
2854
|
+
match[3] + match[3] + // b
|
|
2855
|
+
"ff",
|
|
2856
|
+
// a
|
|
2857
|
+
16
|
|
2858
|
+
) >>> 0 : (match = matchers.hex8.exec(color)) ? parseInt(match[1], 16) >>> 0 : (match = matchers.hex4.exec(color)) ? parseInt(
|
|
2859
|
+
match[1] + match[1] + // r
|
|
2860
|
+
match[2] + match[2] + // g
|
|
2861
|
+
match[3] + match[3] + // b
|
|
2862
|
+
match[4] + match[4],
|
|
2863
|
+
// a
|
|
2864
|
+
16
|
|
2865
|
+
) >>> 0 : (match = matchers.hsl.exec(color)) ? (hslToRgb(
|
|
2866
|
+
parse360(match[1]),
|
|
2867
|
+
// h
|
|
2868
|
+
parsePercentage(match[2]),
|
|
2869
|
+
// s
|
|
2870
|
+
parsePercentage(match[3])
|
|
2871
|
+
// l
|
|
2872
|
+
) | 255) >>> // a
|
|
2873
|
+
0 : (match = matchers.hsla.exec(color)) ? match[6] !== void 0 ? (hslToRgb(
|
|
2874
|
+
parse360(match[6]),
|
|
2875
|
+
// h
|
|
2876
|
+
parsePercentage(match[7]),
|
|
2877
|
+
// s
|
|
2878
|
+
parsePercentage(match[8])
|
|
2879
|
+
// l
|
|
2880
|
+
) | parse1(match[9])) >>> // a
|
|
2881
|
+
0 : (hslToRgb(
|
|
2882
|
+
parse360(match[2]),
|
|
2883
|
+
// h
|
|
2884
|
+
parsePercentage(match[3]),
|
|
2885
|
+
// s
|
|
2886
|
+
parsePercentage(match[4])
|
|
2887
|
+
// l
|
|
2888
|
+
) | parse1(match[5])) >>> // a
|
|
2889
|
+
0 : (match = matchers.hwb.exec(color)) ? (hwbToRgb(
|
|
2890
|
+
parse360(match[1]),
|
|
2891
|
+
// h
|
|
2892
|
+
parsePercentage(match[2]),
|
|
2893
|
+
// w
|
|
2894
|
+
parsePercentage(match[3])
|
|
2895
|
+
// b
|
|
2896
|
+
) | 255) >>> // a
|
|
2897
|
+
0 : null);
|
|
2898
|
+
}
|
|
2899
|
+
function hue2rgb(p, q, t) {
|
|
2900
|
+
return t < 0 && (t += 1), t > 1 && (t -= 1), t < 1 / 6 ? p + (q - p) * 6 * t : t < 1 / 2 ? q : t < 2 / 3 ? p + (q - p) * (2 / 3 - t) * 6 : p;
|
|
2901
|
+
}
|
|
2902
|
+
function hslToRgb(h, s, l) {
|
|
2903
|
+
let q = l < 0.5 ? l * (1 + s) : l + s - l * s, p = 2 * l - q, r = hue2rgb(p, q, h + 1 / 3), g = hue2rgb(p, q, h), b = hue2rgb(p, q, h - 1 / 3);
|
|
2904
|
+
return Math.round(r * 255) << 24 | Math.round(g * 255) << 16 | Math.round(b * 255) << 8;
|
|
2905
|
+
}
|
|
2906
|
+
function hwbToRgb(h, w, b) {
|
|
2907
|
+
if (w + b >= 1) {
|
|
2908
|
+
let gray = Math.round(w * 255 / (w + b));
|
|
2909
|
+
return gray << 24 | gray << 16 | gray << 8;
|
|
2910
|
+
}
|
|
2911
|
+
let red = hue2rgb(0, 1, h + 1 / 3) * (1 - w - b) + w, green = hue2rgb(0, 1, h) * (1 - w - b) + w, blue = hue2rgb(0, 1, h - 1 / 3) * (1 - w - b) + w;
|
|
2912
|
+
return Math.round(red * 255) << 24 | Math.round(green * 255) << 16 | Math.round(blue * 255) << 8;
|
|
2913
|
+
}
|
|
2914
|
+
var NUMBER = "[-+]?\\d*\\.?\\d+", PERCENTAGE = NUMBER + "%";
|
|
2915
|
+
function call(...args) {
|
|
2916
|
+
return "\\(\\s*(" + args.join(")\\s*,?\\s*(") + ")\\s*\\)";
|
|
2917
|
+
}
|
|
2918
|
+
function callWithSlashSeparator(...args) {
|
|
2919
|
+
return "\\(\\s*(" + args.slice(0, args.length - 1).join(")\\s*,?\\s*(") + ")\\s*/\\s*(" + args[args.length - 1] + ")\\s*\\)";
|
|
2920
|
+
}
|
|
2921
|
+
function commaSeparatedCall(...args) {
|
|
2922
|
+
return "\\(\\s*(" + args.join(")\\s*,\\s*(") + ")\\s*\\)";
|
|
2923
|
+
}
|
|
2924
|
+
var cachedMatchers;
|
|
2925
|
+
function getMatchers() {
|
|
2926
|
+
return cachedMatchers === void 0 && (cachedMatchers = {
|
|
2927
|
+
rgb: new RegExp("rgb" + call(NUMBER, NUMBER, NUMBER)),
|
|
2928
|
+
rgba: new RegExp(
|
|
2929
|
+
"rgba(" + commaSeparatedCall(NUMBER, NUMBER, NUMBER, NUMBER) + "|" + callWithSlashSeparator(NUMBER, NUMBER, NUMBER, NUMBER) + ")"
|
|
2930
|
+
),
|
|
2931
|
+
hsl: new RegExp("hsl" + call(NUMBER, PERCENTAGE, PERCENTAGE)),
|
|
2932
|
+
hsla: new RegExp(
|
|
2933
|
+
"hsla(" + commaSeparatedCall(NUMBER, PERCENTAGE, PERCENTAGE, NUMBER) + "|" + callWithSlashSeparator(NUMBER, PERCENTAGE, PERCENTAGE, NUMBER) + ")"
|
|
2934
|
+
),
|
|
2493
2935
|
hwb: new RegExp("hwb" + call(NUMBER, PERCENTAGE, PERCENTAGE)),
|
|
2494
2936
|
hex3: /^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
|
|
2495
2937
|
hex4: /^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
|
|
@@ -3290,784 +3732,232 @@ var require_propMapper_native = __commonJS({
|
|
|
3290
3732
|
getPropMappedFontFamily: () => getPropMappedFontFamily,
|
|
3291
3733
|
getTokenForKey: () => getTokenForKey,
|
|
3292
3734
|
propMapper: () => propMapper
|
|
3293
|
-
});
|
|
3294
|
-
module2.exports = __toCommonJS2(propMapper_exports);
|
|
3295
|
-
var import_constants = 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) => {
|
|
3296
|
-
var _a;
|
|
3297
|
-
if (lastFontFamilyToken = null, !import_constants.isAndroid && key === "elevationAndroid")
|
|
3298
|
-
return;
|
|
3299
|
-
if (value === "unset") {
|
|
3300
|
-
let unsetVal = (_a = styleStateIn.conf.unset) == null ? void 0 : _a[key];
|
|
3301
|
-
if (unsetVal != null)
|
|
3302
|
-
value = unsetVal;
|
|
3303
|
-
else
|
|
3304
|
-
return;
|
|
3305
|
-
}
|
|
3306
|
-
let subProps = styleStateIn.styleProps.fallbackProps || subPropsIn, styleState = subProps ? new Proxy(styleStateIn, {
|
|
3307
|
-
get(_, k) {
|
|
3308
|
-
return k === "curProps" ? subProps : Reflect.get(_, k);
|
|
3309
|
-
}
|
|
3310
|
-
}) : styleStateIn, { conf, styleProps, fontFamily, staticConfig } = styleState, { variants } = staticConfig;
|
|
3311
|
-
if (process.env.NODE_ENV === "development" && fontFamily && fontFamily[0] === "$" && !(fontFamily in conf.fontsParsed) && console.warn(
|
|
3312
|
-
`Warning: no fontFamily "${fontFamily}" found in config: ${Object.keys(
|
|
3313
|
-
conf.fontsParsed
|
|
3314
|
-
).join(", ")}`
|
|
3315
|
-
), !styleProps.noExpand && variants && key in variants) {
|
|
3316
|
-
styleState.curProps[key] = value;
|
|
3317
|
-
let variantValue = resolveVariants(key, value, styleProps, styleState, "");
|
|
3318
|
-
if (variantValue)
|
|
3319
|
-
return variantValue;
|
|
3320
|
-
}
|
|
3321
|
-
let shouldReturn = !1;
|
|
3322
|
-
if (styleProps.disableExpandShorthands || key in conf.shorthands && (shouldReturn = !0, key = conf.shorthands[key]), value && (value[0] === "$" ? value = getTokenForKey(key, value, styleProps.resolveValues, styleState) : (0, import_createVariable.isVariable)(value) && (value = resolveVariableValue(key, value, styleProps.resolveValues))), shouldReturn || value != null) {
|
|
3323
|
-
let result = (styleProps.noExpand ? null : (0, import_expandStyle.expandStyle)(key, value)) || [
|
|
3324
|
-
[key, value]
|
|
3325
|
-
];
|
|
3326
|
-
return key === "fontFamily" && lastFontFamilyToken && fontFamilyCache.set(result, lastFontFamilyToken), result;
|
|
3327
|
-
}
|
|
3328
|
-
}, resolveVariants = (key, value, styleProps, styleState, parentVariantKey) => {
|
|
3329
|
-
let { staticConfig, conf, debug } = styleState, { variants } = staticConfig;
|
|
3330
|
-
if (!variants)
|
|
3331
|
-
return;
|
|
3332
|
-
let variantValue = getVariantDefinition(variants[key], value, conf);
|
|
3333
|
-
if (process.env.NODE_ENV === "development" && debug === "verbose" && (console.groupCollapsed(`\u2666\uFE0F\u2666\uFE0F\u2666\uFE0F resolve variant ${key}`), console.info({
|
|
3334
|
-
key,
|
|
3335
|
-
value,
|
|
3336
|
-
variantValue,
|
|
3337
|
-
variants,
|
|
3338
|
-
curProps: { ...styleState.curProps }
|
|
3339
|
-
}), console.groupEnd()), !variantValue) {
|
|
3340
|
-
if (process.env.TAMAGUI_WARN_ON_MISSING_VARIANT === "1" && typeof value != "boolean") {
|
|
3341
|
-
let name = staticConfig.componentName || "[UnnamedComponent]";
|
|
3342
|
-
console.warn(
|
|
3343
|
-
`No variant found: ${name} has variant "${key}", but no matching value "${value}"`
|
|
3344
|
-
);
|
|
3345
|
-
}
|
|
3346
|
-
return;
|
|
3347
|
-
}
|
|
3348
|
-
if (typeof variantValue == "function") {
|
|
3349
|
-
let fn = variantValue, extras = (0, import_getVariantExtras.getVariantExtras)(styleState);
|
|
3350
|
-
variantValue = fn(value, extras), process.env.NODE_ENV === "development" && debug === "verbose" && (console.groupCollapsed(" expanded functional variant", key), console.info({ fn, variantValue, extras }), console.groupEnd());
|
|
3351
|
-
}
|
|
3352
|
-
let fontFamilyResult;
|
|
3353
|
-
if ((0, import_isObj.isObj)(variantValue)) {
|
|
3354
|
-
let fontFamilyUpdate = variantValue.fontFamily || variantValue[conf.inverseShorthands.fontFamily];
|
|
3355
|
-
fontFamilyUpdate && (fontFamilyResult = getFontFamilyFromNameOrVariable(fontFamilyUpdate, conf), styleState.fontFamily = fontFamilyResult, process.env.NODE_ENV === "development" && debug === "verbose" && console.info(" updating font family", fontFamilyResult)), variantValue = resolveTokensAndVariants(
|
|
3356
|
-
key,
|
|
3357
|
-
variantValue,
|
|
3358
|
-
styleProps,
|
|
3359
|
-
styleState,
|
|
3360
|
-
parentVariantKey
|
|
3361
|
-
);
|
|
3362
|
-
}
|
|
3363
|
-
if (variantValue) {
|
|
3364
|
-
let expanded = (0, import_expandStylesAndRemoveNullishValues.expandStylesAndRemoveNullishValues)(
|
|
3365
|
-
variantValue,
|
|
3366
|
-
!!styleProps.noNormalize
|
|
3367
|
-
), next = Object.entries(expanded);
|
|
3368
|
-
return fontFamilyResult && fontFamilyResult[0] === "$" && fontFamilyCache.set(next, (0, import_createVariable.getVariableValue)(fontFamilyResult)), next;
|
|
3369
|
-
}
|
|
3370
|
-
};
|
|
3371
|
-
function getFontFamilyFromNameOrVariable(input, conf) {
|
|
3372
|
-
if ((0, import_createVariable.isVariable)(input)) {
|
|
3373
|
-
let val = variableToFontNameCache.get(input);
|
|
3374
|
-
if (val)
|
|
3375
|
-
return val;
|
|
3376
|
-
for (let key in conf.fontsParsed) {
|
|
3377
|
-
let familyVariable = conf.fontsParsed[key].family;
|
|
3378
|
-
if ((0, import_createVariable.isVariable)(familyVariable) && (variableToFontNameCache.set(familyVariable, key), familyVariable === input))
|
|
3379
|
-
return key;
|
|
3380
|
-
}
|
|
3381
|
-
} else if (typeof input == "string" && input[0] === "$")
|
|
3382
|
-
return input;
|
|
3383
|
-
}
|
|
3384
|
-
var variableToFontNameCache = /* @__PURE__ */ new WeakMap(), fontFamilyCache = /* @__PURE__ */ new WeakMap(), getPropMappedFontFamily = (expanded) => expanded && fontFamilyCache.get(expanded), resolveTokensAndVariants = (key, value, styleProps, styleState, parentVariantKey) => {
|
|
3385
|
-
var _a;
|
|
3386
|
-
let { conf, staticConfig, debug, theme } = styleState, { variants } = staticConfig, res = {};
|
|
3387
|
-
process.env.NODE_ENV === "development" && debug === "verbose" && console.info(" - resolveTokensAndVariants", key, value);
|
|
3388
|
-
for (let _key in value) {
|
|
3389
|
-
let subKey = conf.shorthands[_key] || _key, val = value[_key];
|
|
3390
|
-
if (styleProps.noExpand)
|
|
3391
|
-
res[subKey] = val;
|
|
3392
|
-
else if (variants && subKey in variants) {
|
|
3393
|
-
if (styleState.curProps[subKey] = val, parentVariantKey && parentVariantKey === key)
|
|
3394
|
-
res[subKey] = // SYNC WITH *1
|
|
3395
|
-
val[0] === "$" ? getTokenForKey(subKey, val, styleProps.resolveValues, styleState) : val;
|
|
3396
|
-
else {
|
|
3397
|
-
let variantOut = resolveVariants(subKey, val, styleProps, styleState, key);
|
|
3398
|
-
if (variantOut)
|
|
3399
|
-
for (let [key2, val2] of variantOut)
|
|
3400
|
-
val2 != null && (key2 in import_pseudoDescriptors.pseudoDescriptors ? (res[key2] ??= {}, Object.assign(res[key2], val2)) : res[key2] = val2);
|
|
3401
|
-
}
|
|
3402
|
-
continue;
|
|
3403
|
-
}
|
|
3404
|
-
if ((0, import_createVariable.isVariable)(val)) {
|
|
3405
|
-
res[subKey] = resolveVariableValue(subKey, val, styleProps.resolveValues);
|
|
3406
|
-
continue;
|
|
3407
|
-
}
|
|
3408
|
-
if (typeof val == "string") {
|
|
3409
|
-
let fVal = (
|
|
3410
|
-
// SYNC WITH *1
|
|
3411
|
-
val[0] === "$" ? getTokenForKey(subKey, val, styleProps.resolveValues, styleState) : val
|
|
3412
|
-
);
|
|
3413
|
-
res[subKey] = fVal;
|
|
3414
|
-
continue;
|
|
3415
|
-
}
|
|
3416
|
-
if ((0, import_isObj.isObj)(val)) {
|
|
3417
|
-
let subObject = resolveTokensAndVariants(subKey, val, styleProps, styleState, key);
|
|
3418
|
-
process.env.NODE_ENV === "development" && debug === "verbose" && console.info("object", subKey, subObject), res[subKey] ??= {}, Object.assign(res[subKey], subObject);
|
|
3419
|
-
} else
|
|
3420
|
-
res[subKey] = val;
|
|
3421
|
-
process.env.NODE_ENV === "development" && debug && ((_a = res[subKey]) == null ? void 0 : _a[0]) === "$" && console.warn(
|
|
3422
|
-
`\u26A0\uFE0F Missing token in theme ${theme.name}:`,
|
|
3423
|
-
subKey,
|
|
3424
|
-
res[subKey],
|
|
3425
|
-
theme
|
|
3426
|
-
);
|
|
3427
|
-
}
|
|
3428
|
-
return res;
|
|
3429
|
-
}, tokenCats = ["size", "color", "radius", "space", "zIndex"].map((name) => ({
|
|
3430
|
-
name,
|
|
3431
|
-
spreadName: `...${name}`
|
|
3432
|
-
}));
|
|
3433
|
-
function getVariantDefinition(variant, value, conf) {
|
|
3434
|
-
if (typeof variant == "function")
|
|
3435
|
-
return variant;
|
|
3436
|
-
let exact = variant[value];
|
|
3437
|
-
if (exact)
|
|
3438
|
-
return exact;
|
|
3439
|
-
if (value != null) {
|
|
3440
|
-
let { tokensParsed } = conf;
|
|
3441
|
-
for (let { name, spreadName } of tokenCats)
|
|
3442
|
-
if (spreadName in variant && value in tokensParsed[name])
|
|
3443
|
-
return variant[spreadName];
|
|
3444
|
-
let fontSizeVariant = variant["...fontSize"];
|
|
3445
|
-
if (fontSizeVariant && conf.fontSizeTokens.has(value))
|
|
3446
|
-
return fontSizeVariant;
|
|
3447
|
-
}
|
|
3448
|
-
return variant[`:${typeof value}`] || variant["..."];
|
|
3449
|
-
}
|
|
3450
|
-
var fontShorthand = {
|
|
3451
|
-
fontSize: "size",
|
|
3452
|
-
fontWeight: "weight"
|
|
3453
|
-
}, lastFontFamilyToken = null, getTokenForKey = (key, value, resolveAs = "none", styleState) => {
|
|
3454
|
-
var _a, _b, _c, _d;
|
|
3455
|
-
if (resolveAs === "none")
|
|
3456
|
-
return value;
|
|
3457
|
-
let { theme, conf = (0, import_config.getConfig)(), context, fontFamily, staticConfig } = styleState, tokensParsed = conf.tokensParsed, valOrVar, hasSet = !1;
|
|
3458
|
-
if (theme && value in theme)
|
|
3459
|
-
valOrVar = theme[value], process.env.NODE_ENV === "development" && styleState.debug === "verbose" && console.info(` - resolving ${key} to theme value ${value}: ${(_a = valOrVar == null ? void 0 : valOrVar.get) == null ? void 0 : _a.call(valOrVar)}`), hasSet = !0;
|
|
3460
|
-
else if (value in conf.specificTokens)
|
|
3461
|
-
hasSet = !0, valOrVar = conf.specificTokens[value];
|
|
3462
|
-
else {
|
|
3463
|
-
let customTokenAccept = (_b = staticConfig == null ? void 0 : staticConfig.acceptTokens) == null ? void 0 : _b[key];
|
|
3464
|
-
if (customTokenAccept) {
|
|
3465
|
-
let val = tokensParsed[customTokenAccept][value];
|
|
3466
|
-
val && (valOrVar = val, hasSet = !0);
|
|
3467
|
-
} else {
|
|
3468
|
-
switch (key) {
|
|
3469
|
-
case "fontFamily": {
|
|
3470
|
-
valOrVar = ((_c = (context != null && context.language ? (0, import_getVariantExtras.getFontsForLanguage)(conf.fontsParsed, context.language) : conf.fontsParsed)[value]) == null ? void 0 : _c.family) || value, lastFontFamilyToken = value, hasSet = !0;
|
|
3471
|
-
break;
|
|
3472
|
-
}
|
|
3473
|
-
case "fontSize":
|
|
3474
|
-
case "lineHeight":
|
|
3475
|
-
case "letterSpacing":
|
|
3476
|
-
case "fontWeight": {
|
|
3477
|
-
let defaultFont = conf.defaultFont || "$body", fam = fontFamily || defaultFont;
|
|
3478
|
-
if (fam) {
|
|
3479
|
-
let fontsParsed = context != null && context.language ? (0, import_getVariantExtras.getFontsForLanguage)(conf.fontsParsed, context.language) : conf.fontsParsed, font = fontsParsed[fam] || fontsParsed[defaultFont];
|
|
3480
|
-
valOrVar = ((_d = font == null ? void 0 : font[fontShorthand[key] || key]) == null ? void 0 : _d[value]) || value, hasSet = !0;
|
|
3481
|
-
}
|
|
3482
|
-
break;
|
|
3483
|
-
}
|
|
3484
|
-
}
|
|
3485
|
-
for (let cat in import_helpers.tokenCategories)
|
|
3486
|
-
if (key in import_helpers.tokenCategories[cat]) {
|
|
3487
|
-
let res = tokensParsed[cat][value];
|
|
3488
|
-
res != null && (valOrVar = res, hasSet = !0);
|
|
3489
|
-
}
|
|
3490
|
-
}
|
|
3491
|
-
if (!hasSet) {
|
|
3492
|
-
let spaceVar = tokensParsed.space[value];
|
|
3493
|
-
spaceVar != null && (valOrVar = spaceVar, hasSet = !0);
|
|
3494
|
-
}
|
|
3495
|
-
}
|
|
3496
|
-
if (hasSet) {
|
|
3497
|
-
let out = resolveVariableValue(key, valOrVar, resolveAs);
|
|
3498
|
-
return process.env.NODE_ENV === "development" && styleState.debug === "verbose" && console.info("resolved", resolveAs, valOrVar, out), out;
|
|
3499
|
-
}
|
|
3500
|
-
return process.env.NODE_ENV === "development" && import_isDevTools.isDevTools && styleState.debug === "verbose" && (console.groupCollapsed(" \uFE52 propMap (val)", key, value), console.info({ valOrVar, theme, hasSet }, theme ? theme[key] : ""), console.groupEnd()), value;
|
|
3501
|
-
};
|
|
3502
|
-
function resolveVariableValue(key, valOrVar, resolveValues) {
|
|
3503
|
-
if (resolveValues === "none")
|
|
3504
|
-
return valOrVar;
|
|
3505
|
-
if ((0, import_createVariable.isVariable)(valOrVar)) {
|
|
3506
|
-
if (resolveValues === "value")
|
|
3507
|
-
return valOrVar.val;
|
|
3508
|
-
let get = valOrVar == null ? void 0 : valOrVar.get;
|
|
3509
|
-
return key !== "shadowColor" && typeof get == "function" ? get(resolveValues === "web" ? "web" : void 0) : valOrVar.val;
|
|
3510
|
-
}
|
|
3511
|
-
return valOrVar;
|
|
3512
|
-
}
|
|
3513
|
-
}
|
|
3514
|
-
});
|
|
3515
|
-
|
|
3516
|
-
// ../web/dist/cjs/helpers/getSplitStyles.native.js
|
|
3517
|
-
var require_getSplitStyles_native = __commonJS({
|
|
3518
|
-
"../web/dist/cjs/helpers/getSplitStyles.native.js"(exports2, module2) {
|
|
3519
|
-
"use strict";
|
|
3520
|
-
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
3521
|
-
for (var name in all)
|
|
3522
|
-
__defProp2(target, name, { get: all[name], enumerable: !0 });
|
|
3523
|
-
}, __copyProps2 = (to, from, except, desc) => {
|
|
3524
|
-
if (from && typeof from == "object" || typeof from == "function")
|
|
3525
|
-
for (let key of __getOwnPropNames2(from))
|
|
3526
|
-
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
3527
|
-
return to;
|
|
3528
|
-
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), getSplitStyles_exports = {};
|
|
3529
|
-
__export2(getSplitStyles_exports, {
|
|
3530
|
-
PROP_SPLIT: () => PROP_SPLIT,
|
|
3531
|
-
getSplitStyles: () => getSplitStyles,
|
|
3532
|
-
getSubStyle: () => getSubStyle,
|
|
3533
|
-
useSplitStyles: () => useSplitStyles
|
|
3534
|
-
});
|
|
3535
|
-
module2.exports = __toCommonJS2(getSplitStyles_exports);
|
|
3536
|
-
var import_constants = require_index_native3(), import_helpers = require_index_native4(), import_react3 = require("react"), import_config = require_config_native(), import_accessibilityDirectMap = require_accessibilityDirectMap_native(), import_constants2 = require_constants_native2(), import_isDevTools = require_isDevTools_native(), import_useMedia = require_useMedia_native(), import_createMediaStyle = require_createMediaStyle_native(), import_expandStyles = require_expandStyles_native(), import_getGroupPropParts = require_getGroupPropParts_native(), import_getStylesAtomic = require_getStylesAtomic_native(), import_insertStyleRule = require_insertStyleRule_native(), import_log = require_log_native(), import_normalizeValueWithProperty = require_normalizeValueWithProperty_native(), import_propMapper = require_propMapper_native(), import_pseudoDescriptors = require_pseudoDescriptors_native(), IS_STATIC = process.env.IS_STATIC === "is_static", conf, PROP_SPLIT = "-";
|
|
3537
|
-
function isValidStyleKey(key, staticConfig) {
|
|
3538
|
-
let validStyleProps = staticConfig.validStyles ?? (staticConfig.isText ? import_helpers.stylePropsText : import_helpers.validStyles);
|
|
3539
|
-
return key in validStyleProps || staticConfig.acceptTokens && key in staticConfig.acceptTokens;
|
|
3540
|
-
}
|
|
3541
|
-
var getSplitStyles = (props, staticConfig, theme, themeName, componentState, styleProps, parentSplitStyles, context, elementType, debug) => {
|
|
3542
|
-
var _a, _b, _c, _e, _f, _g;
|
|
3543
|
-
conf = conf || (0, import_config.getConfig)(), import_constants.isWeb && styleProps.isAnimated && conf.animations.isReactNative && !styleProps.noNormalize && (styleProps.noNormalize = "values");
|
|
3544
|
-
let { shorthands } = conf, {
|
|
3545
|
-
isHOC,
|
|
3546
|
-
isText,
|
|
3547
|
-
variants,
|
|
3548
|
-
isReactNative,
|
|
3549
|
-
inlineProps,
|
|
3550
|
-
inlineWhenUnflattened,
|
|
3551
|
-
parentStaticConfig,
|
|
3552
|
-
acceptsClassName
|
|
3553
|
-
} = staticConfig, viewProps = {}, mediaState2 = styleProps.mediaState || import_useMedia.mediaState, usedKeys = {}, shouldDoClasses = acceptsClassName && import_constants.isWeb && !styleProps.noClassNames, rulesToInsert = [], classNames = {}, transforms = {}, pseudos = null, space = props.space, hasMedia = !1, dynamicThemeAccess, pseudoGroups, mediaGroups, style = {}, className = props.className ?? "", mediaStylesSeen = 0, styleState = {
|
|
3554
|
-
curProps: { ...props },
|
|
3555
|
-
classNames,
|
|
3556
|
-
conf,
|
|
3557
|
-
props,
|
|
3558
|
-
styleProps,
|
|
3559
|
-
componentState,
|
|
3560
|
-
staticConfig,
|
|
3561
|
-
style,
|
|
3562
|
-
theme,
|
|
3563
|
-
usedKeys,
|
|
3564
|
-
viewProps,
|
|
3565
|
-
context,
|
|
3566
|
-
debug
|
|
3567
|
-
};
|
|
3568
|
-
process.env.NODE_ENV === "development" && debug && debug !== "profile" && import_constants.isClient && (console.groupCollapsed("getSplitStyles (collapsed)"), (0, import_log.log)({
|
|
3569
|
-
props,
|
|
3570
|
-
staticConfig,
|
|
3571
|
-
shouldDoClasses,
|
|
3572
|
-
styleProps,
|
|
3573
|
-
componentState,
|
|
3574
|
-
styleState,
|
|
3575
|
-
theme: { ...theme }
|
|
3576
|
-
}), console.groupEnd());
|
|
3577
|
-
for (let keyOg in props) {
|
|
3578
|
-
let keyInit = keyOg, valInit = props[keyOg];
|
|
3579
|
-
if (styleProps.disableExpandShorthands || keyInit in shorthands && (keyInit = shorthands[keyInit]), keyInit === "className" || keyInit in usedKeys || keyInit in skipProps && !styleProps.noSkip && !isHOC)
|
|
3580
|
-
continue;
|
|
3581
|
-
let valInitType = typeof valInit, isValidStyleKeyInit = isValidStyleKey(keyInit, staticConfig);
|
|
3582
|
-
if (styleState.curProps[keyInit] = valInit, !import_constants.isAndroid && keyInit === "elevationAndroid")
|
|
3583
|
-
continue;
|
|
3584
|
-
if (keyInit === "userSelect")
|
|
3585
|
-
keyInit = "selectable", valInit = valInit !== "none";
|
|
3586
|
-
else if (keyInit === "role") {
|
|
3587
|
-
viewProps.accessibilityRole = import_accessibilityDirectMap.accessibilityWebRoleToNativeRole[valInit];
|
|
3588
|
-
continue;
|
|
3589
|
-
} else if (keyInit.startsWith("aria-")) {
|
|
3590
|
-
if (import_accessibilityDirectMap.webToNativeAccessibilityDirectMap[keyInit]) {
|
|
3591
|
-
let nativeA11yProp = import_accessibilityDirectMap.webToNativeAccessibilityDirectMap[keyInit];
|
|
3592
|
-
keyInit === "aria-hidden" && (viewProps["aria-hidden"] = valInit), viewProps[nativeA11yProp] = valInit;
|
|
3593
|
-
continue;
|
|
3594
|
-
}
|
|
3595
|
-
if (import_accessibilityDirectMap.nativeAccessibilityValue[keyInit]) {
|
|
3596
|
-
let field = import_accessibilityDirectMap.nativeAccessibilityValue[keyInit];
|
|
3597
|
-
viewProps.accessibilityValue ? viewProps.accessibilityValue[field] = valInit : viewProps.accessibilityValue = {
|
|
3598
|
-
[field]: valInit
|
|
3599
|
-
};
|
|
3600
|
-
} else if (import_accessibilityDirectMap.nativeAccessibilityState[keyInit]) {
|
|
3601
|
-
let field = import_accessibilityDirectMap.nativeAccessibilityState[keyInit];
|
|
3602
|
-
viewProps.accessibilityState ? viewProps.accessibilityState[field] = valInit : viewProps.accessibilityState = {
|
|
3603
|
-
[field]: valInit
|
|
3604
|
-
};
|
|
3605
|
-
}
|
|
3606
|
-
continue;
|
|
3607
|
-
} else if (keyInit.startsWith("data-"))
|
|
3608
|
-
continue;
|
|
3609
|
-
if (keyInit === "dataSet") {
|
|
3610
|
-
for (let keyInit2 in valInit)
|
|
3611
|
-
viewProps[`data-${hyphenate(keyInit2)}`] = valInit[keyInit2];
|
|
3612
|
-
continue;
|
|
3613
|
-
}
|
|
3614
|
-
if (keyInit[0] === "_" && keyInit.startsWith("_style")) {
|
|
3615
|
-
mergeStylePropIntoStyle(styleState, valInit);
|
|
3616
|
-
continue;
|
|
3617
|
-
}
|
|
3618
|
-
if (0)
|
|
3619
|
-
switch (keyInit) {
|
|
3620
|
-
case "accessibilityRole":
|
|
3621
|
-
case "accessibilityLabelledBy":
|
|
3622
|
-
case "accessibilityFlowTo":
|
|
3623
|
-
case "accessibilityControls":
|
|
3624
|
-
case "accessibilityDescribedBy":
|
|
3625
|
-
case "accessibilityKeyShortcuts":
|
|
3626
|
-
case "accessibilityLiveRegion":
|
|
3627
|
-
case "accessibilityReadOnly":
|
|
3628
|
-
case "accessibilityRequired":
|
|
3629
|
-
default:
|
|
3630
|
-
}
|
|
3631
|
-
let isShorthand = keyInit in shorthands, isVariant = !isValidStyleKeyInit && variants && keyInit in variants, isStyleLikeKey = isShorthand || isValidStyleKeyInit || isVariant, isPseudo = keyInit in import_helpers.validPseudoKeys, isMedia = !isStyleLikeKey && !isPseudo && (0, import_useMedia.isMediaKey)(keyInit), isMediaOrPseudo = !!(isMedia || isPseudo), isStyleProp = isMediaOrPseudo || isVariant && !styleProps.noExpand || isValidStyleKeyInit || isShorthand;
|
|
3632
|
-
if (isStyleProp && (props.asChild === "except-style" || props.asChild === "except-style-web"))
|
|
3633
|
-
continue;
|
|
3634
|
-
let shouldPassProp = !isStyleProp || // is in parent variants
|
|
3635
|
-
isHOC && (parentStaticConfig == null ? void 0 : parentStaticConfig.variants) && keyInit in parentStaticConfig.variants || (inlineProps == null ? void 0 : inlineProps.has(keyInit)), parentVariant = (_a = parentStaticConfig == null ? void 0 : parentStaticConfig.variants) == null ? void 0 : _a[keyInit], isHOCShouldPassThrough = !!(isHOC && (isShorthand || isValidStyleKeyInit || isMediaOrPseudo || parentVariant || keyInit in skipProps)), shouldPassThrough = shouldPassProp || isHOCShouldPassThrough;
|
|
3636
|
-
if (process.env.NODE_ENV === "development" && debug === "verbose" && (console.groupCollapsed(
|
|
3637
|
-
`\u{1F539}\u{1F539}\u{1F539}\u{1F539} ${keyOg}${keyInit !== keyOg ? ` (shorthand for ${keyInit})` : ""} ${shouldPassThrough ? "(pass)" : ""} \u{1F539}\u{1F539}\u{1F539}\u{1F539}`
|
|
3638
|
-
), (0, import_log.log)({ isVariant, valInit, shouldPassProp }), import_constants.isClient && (0, import_log.log)({
|
|
3639
|
-
variants,
|
|
3640
|
-
variant: variants == null ? void 0 : variants[keyInit],
|
|
3641
|
-
isVariant,
|
|
3642
|
-
isHOCShouldPassThrough,
|
|
3643
|
-
curProps: { ...styleState.curProps },
|
|
3644
|
-
parentStaticConfig
|
|
3645
|
-
}), console.groupEnd()), shouldPassThrough && (passDownProp(viewProps, keyInit, valInit, isMediaOrPseudo), !isVariant) || !styleProps.noSkip && keyInit in skipProps)
|
|
3646
|
-
continue;
|
|
3647
|
-
if (isText && valInit && (keyInit === "fontFamily" || keyInit === shorthands.fontFamily) && valInit in conf.fontsParsed && (styleState.fontFamily = valInit), isValidStyleKeyInit && !variants && valInit !== "unset" && (valInitType === "number" || valInitType === "string" && valInit[0] !== "$")) {
|
|
3648
|
-
style[keyInit] = valInit;
|
|
3649
|
-
continue;
|
|
3650
|
-
}
|
|
3651
|
-
let expanded = isMediaOrPseudo || !isVariant && !isValidStyleKeyInit ? [[keyInit, valInit]] : (0, import_propMapper.propMapper)(keyInit, valInit, styleState), next = (0, import_propMapper.getPropMappedFontFamily)(expanded);
|
|
3652
|
-
if (next && (styleState.fontFamily = next), process.env.NODE_ENV === "development" && debug === "verbose") {
|
|
3653
|
-
console.groupCollapsed(" \u{1F4A0} expanded", keyInit, valInit);
|
|
3654
|
-
try {
|
|
3655
|
-
!import_constants.isServer && import_isDevTools.isDevTools && ((0, import_log.log)({
|
|
3656
|
-
expanded,
|
|
3657
|
-
styleProps,
|
|
3658
|
-
componentState,
|
|
3659
|
-
isVariant,
|
|
3660
|
-
variant: variants == null ? void 0 : variants[keyInit],
|
|
3661
|
-
shouldPassProp,
|
|
3662
|
-
isHOCShouldPassThrough,
|
|
3663
|
-
theme,
|
|
3664
|
-
usedKeys: { ...usedKeys },
|
|
3665
|
-
curProps: { ...styleState.curProps }
|
|
3666
|
-
}), (0, import_log.log)("expanded", expanded, `
|
|
3667
|
-
usedKeys`, { ...usedKeys }, `
|
|
3668
|
-
current`, {
|
|
3669
|
-
...style
|
|
3670
|
-
}));
|
|
3671
|
-
} catch {
|
|
3672
|
-
}
|
|
3673
|
-
console.groupEnd();
|
|
3674
|
-
}
|
|
3675
|
-
if (expanded) {
|
|
3676
|
-
for (let [key, val] of expanded)
|
|
3677
|
-
if (!(val == null || key in usedKeys)) {
|
|
3678
|
-
if (isPseudo = key in import_helpers.validPseudoKeys, isMedia = !isPseudo && !isValidStyleKeyInit && (0, import_useMedia.isMediaKey)(key), isMediaOrPseudo = !!(isMedia || isPseudo), isVariant = variants && key in variants, (inlineProps != null && inlineProps.has(key) || IS_STATIC && inlineWhenUnflattened != null && inlineWhenUnflattened.has(key)) && (viewProps[key] = props[key] ?? val), styleProps.noExpand && isPseudo || isHOC && (isMediaOrPseudo || ((_b = parentStaticConfig == null ? void 0 : parentStaticConfig.variants) == null ? void 0 : _b[keyInit]))) {
|
|
3679
|
-
passDownProp(viewProps, key, val, isMediaOrPseudo), process.env.NODE_ENV === "development" && debug === "verbose" && (console.groupCollapsed(` - passing down prop ${key}`), (0, import_log.log)({ val, after: { ...viewProps[key] } }), console.groupEnd());
|
|
3680
|
-
continue;
|
|
3681
|
-
}
|
|
3682
|
-
if (isPseudo) {
|
|
3683
|
-
if (!val)
|
|
3684
|
-
continue;
|
|
3685
|
-
let pseudoStyleObject = getSubStyle(
|
|
3686
|
-
styleState,
|
|
3687
|
-
key,
|
|
3688
|
-
val,
|
|
3689
|
-
styleProps.noClassNames
|
|
3690
|
-
), descriptor = import_pseudoDescriptors.pseudoDescriptors[key], isEnter = key === "enterStyle", isExit = key === "exitStyle";
|
|
3691
|
-
if (!descriptor || isExit && !styleProps.isExiting)
|
|
3692
|
-
continue;
|
|
3693
|
-
if ((!shouldDoClasses || IS_STATIC) && (pseudos ||= {}, pseudos[key] ||= {}, IS_STATIC)) {
|
|
3694
|
-
Object.assign(pseudos[key], pseudoStyleObject);
|
|
3695
|
-
continue;
|
|
3696
|
-
}
|
|
3697
|
-
if (shouldDoClasses && !isExit) {
|
|
3698
|
-
let pseudoStyles = (0, import_getStylesAtomic.generateAtomicStyles)(pseudoStyleObject, descriptor);
|
|
3699
|
-
process.env.NODE_ENV === "development" && debug === "verbose" && (console.groupCollapsed("pseudo (classes)", key), (0, import_log.log)({ pseudoStyleObject, pseudoStyles }), console.groupEnd());
|
|
3700
|
-
for (let psuedoStyle of pseudoStyles)
|
|
3701
|
-
`${psuedoStyle.property}${PROP_SPLIT}${descriptor.name}` in usedKeys || psuedoStyle.identifier;
|
|
3702
|
-
}
|
|
3703
|
-
if (!shouldDoClasses || isExit || isEnter) {
|
|
3704
|
-
let descriptorKey = descriptor.stateKey || descriptor.name, isDisabled = componentState[descriptorKey] === !1;
|
|
3705
|
-
isExit && (isDisabled = !styleProps.isExiting), isEnter && (isDisabled = componentState.unmounted === "should-enter" ? !0 : !componentState.unmounted), process.env.NODE_ENV === "development" && debug === "verbose" && (console.groupCollapsed("pseudo", key, { isDisabled }), (0, import_log.log)({ pseudoStyleObject, isDisabled, descriptor, componentState }), console.groupEnd());
|
|
3706
|
-
let importance = descriptor.priority;
|
|
3707
|
-
for (let pkey in pseudoStyleObject) {
|
|
3708
|
-
let val2 = pseudoStyleObject[pkey];
|
|
3709
|
-
if (isDisabled) {
|
|
3710
|
-
if (pkey in animatableDefaults && !(pkey in usedKeys)) {
|
|
3711
|
-
let defaultVal = animatableDefaults[pkey];
|
|
3712
|
-
mergeStyle(styleState, pkey, defaultVal);
|
|
3713
|
-
}
|
|
3714
|
-
} else {
|
|
3715
|
-
let curImportance = usedKeys[pkey] || 0, shouldMerge = importance >= curImportance;
|
|
3716
|
-
shouldMerge && (pseudos ||= {}, pseudos[key] ||= {}, pseudos[key][pkey] = val2, mergeStyle(styleState, pkey, val2)), process.env.NODE_ENV === "development" && debug === "verbose" && (0, import_log.log)(" subKey", pkey, shouldMerge, {
|
|
3717
|
-
importance,
|
|
3718
|
-
curImportance,
|
|
3719
|
-
pkey,
|
|
3720
|
-
val: val2,
|
|
3721
|
-
transforms: { ...styleState.transforms }
|
|
3722
|
-
});
|
|
3723
|
-
}
|
|
3724
|
-
}
|
|
3725
|
-
if (!isDisabled)
|
|
3726
|
-
for (let key2 in val) {
|
|
3727
|
-
let k = shorthands[key2] || key2;
|
|
3728
|
-
usedKeys[k] = Math.max(importance, usedKeys[k] || 0);
|
|
3729
|
-
}
|
|
3730
|
-
}
|
|
3731
|
-
continue;
|
|
3732
|
-
}
|
|
3733
|
-
if (isMedia) {
|
|
3734
|
-
if (!val)
|
|
3735
|
-
continue;
|
|
3736
|
-
if (isMedia === "platform") {
|
|
3737
|
-
let platform = key.slice(10);
|
|
3738
|
-
if (
|
|
3739
|
-
// supports web, ios, android
|
|
3740
|
-
platform !== import_constants.currentPlatform && // supports web, native
|
|
3741
|
-
platform !== "native"
|
|
3742
|
-
)
|
|
3743
|
-
continue;
|
|
3744
|
-
}
|
|
3745
|
-
hasMedia ||= !0;
|
|
3746
|
-
let mediaStyle = getSubStyle(
|
|
3747
|
-
styleState,
|
|
3748
|
-
key,
|
|
3749
|
-
val,
|
|
3750
|
-
// TODO try true like pseudo
|
|
3751
|
-
!1
|
|
3752
|
-
), mediaKeyShort = key.slice(1);
|
|
3753
|
-
process.env.NODE_ENV === "development" && debug === "verbose" && (0, import_log.log)(` \u{1F4FA} ${key}`, {
|
|
3754
|
-
key,
|
|
3755
|
-
val,
|
|
3756
|
-
mediaStyle,
|
|
3757
|
-
props,
|
|
3758
|
-
shouldDoClasses,
|
|
3759
|
-
componentState
|
|
3760
|
-
});
|
|
3761
|
-
let hasSpace = val.space;
|
|
3762
|
-
if ((hasSpace || !shouldDoClasses) && (Array.isArray(hasMedia) || (hasMedia = []), hasMedia.push(mediaKeyShort)), shouldDoClasses) {
|
|
3763
|
-
if (hasSpace && (delete mediaStyle.space, mediaState2[mediaKeyShort])) {
|
|
3764
|
-
let importance = (0, import_useMedia.getMediaImportanceIfMoreImportant)(
|
|
3765
|
-
mediaKeyShort,
|
|
3766
|
-
"space",
|
|
3767
|
-
usedKeys,
|
|
3768
|
-
!0
|
|
3769
|
-
);
|
|
3770
|
-
importance && (space = val.space, usedKeys.space = importance, process.env.NODE_ENV === "development" && debug === "verbose" && (0, import_log.log)(
|
|
3771
|
-
`Found more important space for current media ${mediaKeyShort}: ${val} (importance: ${importance})`
|
|
3772
|
-
));
|
|
3773
|
-
}
|
|
3774
|
-
let mediaStyles = (0, import_getStylesAtomic.getStylesAtomic)(mediaStyle, debug), priority = mediaStylesSeen;
|
|
3775
|
-
mediaStylesSeen += 1;
|
|
3776
|
-
for (let style2 of mediaStyles) {
|
|
3777
|
-
let out = (0, import_createMediaStyle.createMediaStyle)(
|
|
3778
|
-
style2,
|
|
3779
|
-
mediaKeyShort,
|
|
3780
|
-
import_useMedia.mediaQueryConfig,
|
|
3781
|
-
isMedia,
|
|
3782
|
-
!1,
|
|
3783
|
-
priority
|
|
3784
|
-
);
|
|
3785
|
-
process.env.NODE_ENV === "development" && debug === "verbose" && (0, import_log.log)("\u{1F4FA} media style:", out), `${style2.property}${PROP_SPLIT}${mediaKeyShort}` in usedKeys || out.identifier;
|
|
3786
|
-
}
|
|
3787
|
-
} else {
|
|
3788
|
-
let isThemeMedia = isMedia === "theme", isGroupMedia = isMedia === "group";
|
|
3789
|
-
if (!isThemeMedia && isMedia !== "platform" && !isGroupMedia && !mediaState2[mediaKeyShort])
|
|
3790
|
-
continue;
|
|
3791
|
-
let importanceBump = 0;
|
|
3792
|
-
if (isThemeMedia) {
|
|
3793
|
-
dynamicThemeAccess = !0;
|
|
3794
|
-
let mediaThemeName = mediaKeyShort.slice(6);
|
|
3795
|
-
if (!(themeName === mediaThemeName || themeName.startsWith(mediaThemeName)))
|
|
3796
|
-
continue;
|
|
3797
|
-
} else if (isGroupMedia) {
|
|
3798
|
-
let groupInfo = (0, import_getGroupPropParts.getGroupPropParts)(mediaKeyShort), groupName = groupInfo.name, groupContext = context == null ? void 0 : context.groups.state[groupName];
|
|
3799
|
-
if (!groupContext) {
|
|
3800
|
-
process.env.NODE_ENV === "development" && debug && console.warn(`No parent with group prop, skipping styles: ${groupName}`);
|
|
3801
|
-
continue;
|
|
3802
|
-
}
|
|
3803
|
-
let groupPseudoKey = groupInfo.pseudo, groupMediaKey = groupInfo.media, componentGroupState = (_c = componentState.group) == null ? void 0 : _c[groupName];
|
|
3804
|
-
if (groupMediaKey) {
|
|
3805
|
-
mediaGroups ||= /* @__PURE__ */ new Set(), mediaGroups.add(groupMediaKey);
|
|
3806
|
-
let mediaState22 = componentGroupState == null ? void 0 : componentGroupState.media, isActive = mediaState22 == null ? void 0 : mediaState22[groupMediaKey];
|
|
3807
|
-
if (!mediaState22 && groupContext.layout && (isActive = (0, import_useMedia.mediaKeyMatch)(groupMediaKey, groupContext.layout)), !isActive)
|
|
3808
|
-
continue;
|
|
3809
|
-
importanceBump = 2;
|
|
3810
|
-
}
|
|
3811
|
-
if (groupPseudoKey) {
|
|
3812
|
-
pseudoGroups ||= /* @__PURE__ */ new Set(), pseudoGroups.add(groupName);
|
|
3813
|
-
let componentGroupPseudoState = (componentGroupState || // fallback to context initially
|
|
3814
|
-
context.groups.state[groupName]).pseudo;
|
|
3815
|
-
if (!(componentGroupPseudoState != null && componentGroupPseudoState[groupPseudoKey]))
|
|
3816
|
-
continue;
|
|
3817
|
-
importanceBump = import_pseudoDescriptors.pseudoPriorities[groupPseudoKey];
|
|
3818
|
-
}
|
|
3819
|
-
}
|
|
3820
|
-
for (let subKey in mediaStyle) {
|
|
3821
|
-
if (subKey === "space") {
|
|
3822
|
-
space = valInit.space;
|
|
3823
|
-
continue;
|
|
3824
|
-
}
|
|
3825
|
-
(0, import_useMedia.mergeMediaByImportance)(
|
|
3826
|
-
style,
|
|
3827
|
-
mediaKeyShort,
|
|
3828
|
-
subKey,
|
|
3829
|
-
mediaStyle[subKey],
|
|
3830
|
-
usedKeys,
|
|
3831
|
-
mediaState2[mediaKeyShort],
|
|
3832
|
-
importanceBump
|
|
3833
|
-
), key === "fontFamily" && (styleState.fontFamily = mediaStyle.fontFamily);
|
|
3834
|
-
}
|
|
3835
|
-
}
|
|
3836
|
-
continue;
|
|
3837
|
-
}
|
|
3838
|
-
if (key === "pointerEvents") {
|
|
3839
|
-
viewProps[key] = val;
|
|
3840
|
-
continue;
|
|
3841
|
-
}
|
|
3842
|
-
if (
|
|
3843
|
-
// is HOC we can just pass through the styles as props
|
|
3844
|
-
// this fixes issues where style prop got merged with wrong priority
|
|
3845
|
-
!isHOC && (isValidStyleKey(key, staticConfig) || import_constants.isAndroid && key === "elevation")
|
|
3846
|
-
) {
|
|
3847
|
-
mergeStyle(styleState, key, val);
|
|
3848
|
-
continue;
|
|
3849
|
-
}
|
|
3850
|
-
isVariant || (viewProps[key] = val);
|
|
3851
|
-
}
|
|
3852
|
-
if (process.env.NODE_ENV === "development" && debug === "verbose") {
|
|
3853
|
-
console.groupCollapsed(" \u2714\uFE0F expand complete", keyInit);
|
|
3854
|
-
try {
|
|
3855
|
-
(0, import_log.log)("style", { ...style }), (0, import_log.log)("transforms", { ...transforms }), (0, import_log.log)("viewProps", { ...viewProps });
|
|
3856
|
-
} catch {
|
|
3857
|
-
}
|
|
3858
|
-
console.groupEnd();
|
|
3859
|
-
}
|
|
3860
|
-
}
|
|
3735
|
+
});
|
|
3736
|
+
module2.exports = __toCommonJS2(propMapper_exports);
|
|
3737
|
+
var import_constants = 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) => {
|
|
3738
|
+
var _a;
|
|
3739
|
+
if (lastFontFamilyToken = null, !import_constants.isAndroid && key === "elevationAndroid")
|
|
3740
|
+
return;
|
|
3741
|
+
if (value === "unset") {
|
|
3742
|
+
let unsetVal = (_a = styleStateIn.conf.unset) == null ? void 0 : _a[key];
|
|
3743
|
+
if (unsetVal != null)
|
|
3744
|
+
value = unsetVal;
|
|
3745
|
+
else
|
|
3746
|
+
return;
|
|
3861
3747
|
}
|
|
3862
|
-
|
|
3863
|
-
|
|
3864
|
-
|
|
3865
|
-
for (let key in parentSplitStyles.style)
|
|
3866
|
-
key in classNames || key in style || (style[key] = parentSplitStyles.style[key]);
|
|
3867
|
-
let result = {
|
|
3868
|
-
space,
|
|
3869
|
-
hasMedia,
|
|
3870
|
-
fontFamily: styleState.fontFamily,
|
|
3871
|
-
viewProps,
|
|
3872
|
-
// @ts-expect-error
|
|
3873
|
-
style,
|
|
3874
|
-
pseudos,
|
|
3875
|
-
classNames,
|
|
3876
|
-
rulesToInsert,
|
|
3877
|
-
dynamicThemeAccess,
|
|
3878
|
-
pseudoGroups,
|
|
3879
|
-
mediaGroups
|
|
3880
|
-
};
|
|
3881
|
-
if (style.fontFamily) {
|
|
3882
|
-
let faceInfo = (_e = (0, import_config.getFont)(style.fontFamily)) == null ? void 0 : _e.face;
|
|
3883
|
-
if (faceInfo) {
|
|
3884
|
-
let overrideFace = (_g = (_f = faceInfo[style.fontWeight]) == null ? void 0 : _f[style.fontStyle || "normal"]) == null ? void 0 : _g.val;
|
|
3885
|
-
overrideFace && (style.fontFamily = overrideFace, styleState.fontFamily = overrideFace, delete style.fontWeight, delete style.fontStyle);
|
|
3748
|
+
let subProps = styleStateIn.styleProps.fallbackProps || subPropsIn, styleState = subProps ? new Proxy(styleStateIn, {
|
|
3749
|
+
get(_, k) {
|
|
3750
|
+
return k === "curProps" ? subProps : Reflect.get(_, k);
|
|
3886
3751
|
}
|
|
3887
|
-
|
|
3752
|
+
}) : styleStateIn, { conf, styleProps, fontFamily, staticConfig } = styleState, { variants } = staticConfig;
|
|
3753
|
+
if (process.env.NODE_ENV === "development" && fontFamily && fontFamily[0] === "$" && !(fontFamily in conf.fontsParsed) && console.warn(
|
|
3754
|
+
`Warning: no fontFamily "${fontFamily}" found in config: ${Object.keys(
|
|
3755
|
+
conf.fontsParsed
|
|
3756
|
+
).join(", ")}`
|
|
3757
|
+
), !styleProps.noExpand && variants && key in variants) {
|
|
3758
|
+
styleState.curProps[key] = value;
|
|
3759
|
+
let variantValue = resolveVariants(key, value, styleProps, styleState, "");
|
|
3760
|
+
if (variantValue)
|
|
3761
|
+
return variantValue;
|
|
3888
3762
|
}
|
|
3889
|
-
|
|
3890
|
-
|
|
3891
|
-
|
|
3892
|
-
|
|
3893
|
-
|
|
3894
|
-
|
|
3895
|
-
|
|
3896
|
-
|
|
3897
|
-
|
|
3898
|
-
|
|
3899
|
-
|
|
3900
|
-
|
|
3901
|
-
|
|
3902
|
-
|
|
3903
|
-
|
|
3904
|
-
|
|
3763
|
+
let shouldReturn = !1;
|
|
3764
|
+
if (styleProps.disableExpandShorthands || key in conf.shorthands && (shouldReturn = !0, key = conf.shorthands[key]), value && (value[0] === "$" ? value = getTokenForKey(key, value, styleProps.resolveValues, styleState) : (0, import_createVariable.isVariable)(value) && (value = resolveVariableValue(key, value, styleProps.resolveValues))), shouldReturn || value != null) {
|
|
3765
|
+
let result = (styleProps.noExpand ? null : (0, import_expandStyle.expandStyle)(key, value)) || [
|
|
3766
|
+
[key, value]
|
|
3767
|
+
];
|
|
3768
|
+
return key === "fontFamily" && lastFontFamilyToken && fontFamilyCache.set(result, lastFontFamilyToken), result;
|
|
3769
|
+
}
|
|
3770
|
+
}, resolveVariants = (key, value, styleProps, styleState, parentVariantKey) => {
|
|
3771
|
+
let { staticConfig, conf, debug } = styleState, { variants } = staticConfig;
|
|
3772
|
+
if (!variants)
|
|
3773
|
+
return;
|
|
3774
|
+
let variantValue = getVariantDefinition(variants[key], value, conf);
|
|
3775
|
+
if (process.env.NODE_ENV === "development" && debug === "verbose" && (console.groupCollapsed(`\u2666\uFE0F\u2666\uFE0F\u2666\uFE0F resolve variant ${key}`), console.info({
|
|
3776
|
+
key,
|
|
3777
|
+
value,
|
|
3778
|
+
variantValue,
|
|
3779
|
+
variants,
|
|
3780
|
+
curProps: { ...styleState.curProps }
|
|
3781
|
+
}), console.groupEnd()), !variantValue) {
|
|
3782
|
+
if (process.env.TAMAGUI_WARN_ON_MISSING_VARIANT === "1" && typeof value != "boolean") {
|
|
3783
|
+
let name = staticConfig.componentName || "[UnnamedComponent]";
|
|
3784
|
+
console.warn(
|
|
3785
|
+
`No variant found: ${name} has variant "${key}", but no matching value "${value}"`
|
|
3786
|
+
);
|
|
3905
3787
|
}
|
|
3906
|
-
|
|
3788
|
+
return;
|
|
3907
3789
|
}
|
|
3908
|
-
|
|
3909
|
-
|
|
3910
|
-
|
|
3911
|
-
let { classNames, viewProps, style, usedKeys, styleProps } = styleState;
|
|
3912
|
-
if (import_constants.isWeb && (val == null ? void 0 : val[0]) === "_")
|
|
3913
|
-
classNames[key] = val, usedKeys[key] ||= 1;
|
|
3914
|
-
else if (key in import_helpers.stylePropsTransform)
|
|
3915
|
-
styleState.transforms ||= {}, styleState.transforms[key] = val;
|
|
3916
|
-
else {
|
|
3917
|
-
let out = import_constants.isWeb && !disableNormalize && !styleProps.noNormalize ? (0, import_normalizeValueWithProperty.normalizeValueWithProperty)(val, key) : val;
|
|
3918
|
-
key in import_helpers.validStylesOnBaseProps ? viewProps[key] = out : style[key] = out;
|
|
3790
|
+
if (typeof variantValue == "function") {
|
|
3791
|
+
let fn = variantValue, extras = (0, import_getVariantExtras.getVariantExtras)(styleState);
|
|
3792
|
+
variantValue = fn(value, extras), process.env.NODE_ENV === "development" && debug === "verbose" && (console.groupCollapsed(" expanded functional variant", key), console.info({ fn, variantValue, extras }), console.groupEnd());
|
|
3919
3793
|
}
|
|
3920
|
-
|
|
3921
|
-
|
|
3922
|
-
|
|
3923
|
-
|
|
3924
|
-
|
|
3925
|
-
|
|
3926
|
-
|
|
3927
|
-
|
|
3928
|
-
|
|
3929
|
-
|
|
3794
|
+
let fontFamilyResult;
|
|
3795
|
+
if ((0, import_isObj.isObj)(variantValue)) {
|
|
3796
|
+
let fontFamilyUpdate = variantValue.fontFamily || variantValue[conf.inverseShorthands.fontFamily];
|
|
3797
|
+
fontFamilyUpdate && (fontFamilyResult = getFontFamilyFromNameOrVariable(fontFamilyUpdate, conf), styleState.fontFamily = fontFamilyResult, process.env.NODE_ENV === "development" && debug === "verbose" && console.info(" updating font family", fontFamilyResult)), variantValue = resolveTokensAndVariants(
|
|
3798
|
+
key,
|
|
3799
|
+
variantValue,
|
|
3800
|
+
styleProps,
|
|
3801
|
+
styleState,
|
|
3802
|
+
parentVariantKey
|
|
3803
|
+
);
|
|
3930
3804
|
}
|
|
3931
|
-
|
|
3932
|
-
|
|
3933
|
-
|
|
3934
|
-
|
|
3935
|
-
|
|
3936
|
-
|
|
3937
|
-
for (let style of styles) {
|
|
3938
|
-
if (!style)
|
|
3939
|
-
continue;
|
|
3940
|
-
let isRNW = style.$$css;
|
|
3941
|
-
Object.assign(isRNW ? styleState.classNames : styleState.style, style);
|
|
3805
|
+
if (variantValue) {
|
|
3806
|
+
let expanded = (0, import_expandStylesAndRemoveNullishValues.expandStylesAndRemoveNullishValues)(
|
|
3807
|
+
variantValue,
|
|
3808
|
+
!!styleProps.noNormalize
|
|
3809
|
+
), next = Object.entries(expanded);
|
|
3810
|
+
return fontFamilyResult && fontFamilyResult[0] === "$" && fontFamilyCache.set(next, (0, import_createVariable.getVariableValue)(fontFamilyResult)), next;
|
|
3942
3811
|
}
|
|
3943
|
-
}
|
|
3944
|
-
var useInsertEffectCompat = import_constants.isWeb ? import_react3.useInsertionEffect || import_constants.useIsomorphicLayoutEffect : () => {
|
|
3945
|
-
}, useSplitStyles = (...args) => {
|
|
3946
|
-
let res = getSplitStyles(...args);
|
|
3947
|
-
return useInsertEffectCompat(() => {
|
|
3948
|
-
(0, import_insertStyleRule.insertStyleRules)(res.rulesToInsert);
|
|
3949
|
-
}, [res.rulesToInsert]), res;
|
|
3950
|
-
}, animatableDefaults = {
|
|
3951
|
-
opacity: 1,
|
|
3952
|
-
scale: 1,
|
|
3953
|
-
rotate: "0deg",
|
|
3954
|
-
rotateY: "0deg",
|
|
3955
|
-
rotateX: "0deg",
|
|
3956
|
-
x: 0,
|
|
3957
|
-
y: 0
|
|
3958
|
-
}, lowercaseHyphenate = (match) => `-${match.toLowerCase()}`, hyphenate = (str) => str.replace(/[A-Z]/g, lowercaseHyphenate), mergeTransform = (obj, key, val, backwards = !1) => {
|
|
3959
|
-
typeof obj.transform != "string" && (obj.transform ||= [], obj.transform[backwards ? "unshift" : "push"]({
|
|
3960
|
-
[mapTransformKeys[key] || key]: val
|
|
3961
|
-
}));
|
|
3962
|
-
}, mapTransformKeys = {
|
|
3963
|
-
x: "translateX",
|
|
3964
|
-
y: "translateY"
|
|
3965
|
-
}, skipProps = {
|
|
3966
|
-
untilMeasured: 1,
|
|
3967
|
-
animation: 1,
|
|
3968
|
-
space: 1,
|
|
3969
|
-
animateOnly: 1,
|
|
3970
|
-
disableClassName: 1,
|
|
3971
|
-
debug: 1,
|
|
3972
|
-
componentName: 1,
|
|
3973
|
-
disableOptimization: 1,
|
|
3974
|
-
tag: 1,
|
|
3975
|
-
style: 1,
|
|
3976
|
-
// handled after loop so pseudos set usedKeys and override it if necessary
|
|
3977
|
-
group: 1
|
|
3978
3812
|
};
|
|
3979
|
-
|
|
3980
|
-
|
|
3981
|
-
|
|
3982
|
-
|
|
3983
|
-
|
|
3984
|
-
|
|
3985
|
-
|
|
3986
|
-
|
|
3987
|
-
|
|
3988
|
-
|
|
3989
|
-
|
|
3990
|
-
|
|
3991
|
-
|
|
3992
|
-
|
|
3993
|
-
|
|
3994
|
-
|
|
3995
|
-
|
|
3996
|
-
|
|
3997
|
-
|
|
3998
|
-
|
|
3999
|
-
|
|
4000
|
-
|
|
4001
|
-
|
|
4002
|
-
|
|
3813
|
+
function getFontFamilyFromNameOrVariable(input, conf) {
|
|
3814
|
+
if ((0, import_createVariable.isVariable)(input)) {
|
|
3815
|
+
let val = variableToFontNameCache.get(input);
|
|
3816
|
+
if (val)
|
|
3817
|
+
return val;
|
|
3818
|
+
for (let key in conf.fontsParsed) {
|
|
3819
|
+
let familyVariable = conf.fontsParsed[key].family;
|
|
3820
|
+
if ((0, import_createVariable.isVariable)(familyVariable) && (variableToFontNameCache.set(familyVariable, key), familyVariable === input))
|
|
3821
|
+
return key;
|
|
3822
|
+
}
|
|
3823
|
+
} else if (typeof input == "string" && input[0] === "$")
|
|
3824
|
+
return input;
|
|
3825
|
+
}
|
|
3826
|
+
var variableToFontNameCache = /* @__PURE__ */ new WeakMap(), fontFamilyCache = /* @__PURE__ */ new WeakMap(), getPropMappedFontFamily = (expanded) => expanded && fontFamilyCache.get(expanded), resolveTokensAndVariants = (key, value, styleProps, styleState, parentVariantKey) => {
|
|
3827
|
+
var _a;
|
|
3828
|
+
let { conf, staticConfig, debug, theme } = styleState, { variants } = staticConfig, res = {};
|
|
3829
|
+
process.env.NODE_ENV === "development" && debug === "verbose" && console.info(" - resolveTokensAndVariants", key, value);
|
|
3830
|
+
for (let _key in value) {
|
|
3831
|
+
let subKey = conf.shorthands[_key] || _key, val = value[_key];
|
|
3832
|
+
if (styleProps.noExpand)
|
|
3833
|
+
res[subKey] = val;
|
|
3834
|
+
else if (variants && subKey in variants) {
|
|
3835
|
+
if (styleState.curProps[subKey] = val, parentVariantKey && parentVariantKey === key)
|
|
3836
|
+
res[subKey] = // SYNC WITH *1
|
|
3837
|
+
val[0] === "$" ? getTokenForKey(subKey, val, styleProps.resolveValues, styleState) : val;
|
|
3838
|
+
else {
|
|
3839
|
+
let variantOut = resolveVariants(subKey, val, styleProps, styleState, key);
|
|
3840
|
+
if (variantOut)
|
|
3841
|
+
for (let [key2, val2] of variantOut)
|
|
3842
|
+
val2 != null && (key2 in import_pseudoDescriptors.pseudoDescriptors ? (res[key2] ??= {}, Object.assign(res[key2], val2)) : res[key2] = val2);
|
|
3843
|
+
}
|
|
3844
|
+
continue;
|
|
3845
|
+
}
|
|
3846
|
+
if ((0, import_createVariable.isVariable)(val)) {
|
|
3847
|
+
res[subKey] = resolveVariableValue(subKey, val, styleProps.resolveValues);
|
|
3848
|
+
continue;
|
|
3849
|
+
}
|
|
3850
|
+
if (typeof val == "string") {
|
|
3851
|
+
let fVal = (
|
|
3852
|
+
// SYNC WITH *1
|
|
3853
|
+
val[0] === "$" ? getTokenForKey(subKey, val, styleProps.resolveValues, styleState) : val
|
|
3854
|
+
);
|
|
3855
|
+
res[subKey] = fVal;
|
|
3856
|
+
continue;
|
|
3857
|
+
}
|
|
3858
|
+
if ((0, import_isObj.isObj)(val)) {
|
|
3859
|
+
let subObject = resolveTokensAndVariants(subKey, val, styleProps, styleState, key);
|
|
3860
|
+
process.env.NODE_ENV === "development" && debug === "verbose" && console.info("object", subKey, subObject), res[subKey] ??= {}, Object.assign(res[subKey], subObject);
|
|
3861
|
+
} else
|
|
3862
|
+
res[subKey] = val;
|
|
3863
|
+
process.env.NODE_ENV === "development" && debug && ((_a = res[subKey]) == null ? void 0 : _a[0]) === "$" && console.warn(
|
|
3864
|
+
`\u26A0\uFE0F Missing token in theme ${theme.name}:`,
|
|
3865
|
+
subKey,
|
|
3866
|
+
res[subKey],
|
|
3867
|
+
theme
|
|
3868
|
+
);
|
|
3869
|
+
}
|
|
3870
|
+
return res;
|
|
3871
|
+
}, tokenCats = ["size", "color", "radius", "space", "zIndex"].map((name) => ({
|
|
3872
|
+
name,
|
|
3873
|
+
spreadName: `...${name}`
|
|
3874
|
+
}));
|
|
3875
|
+
function getVariantDefinition(variant, value, conf) {
|
|
3876
|
+
if (typeof variant == "function")
|
|
3877
|
+
return variant;
|
|
3878
|
+
let exact = variant[value];
|
|
3879
|
+
if (exact)
|
|
3880
|
+
return exact;
|
|
3881
|
+
if (value != null) {
|
|
3882
|
+
let { tokensParsed } = conf;
|
|
3883
|
+
for (let { name, spreadName } of tokenCats)
|
|
3884
|
+
if (spreadName in variant && value in tokensParsed[name])
|
|
3885
|
+
return variant[spreadName];
|
|
3886
|
+
let fontSizeVariant = variant["...fontSize"];
|
|
3887
|
+
if (fontSizeVariant && conf.fontSizeTokens.has(value))
|
|
3888
|
+
return fontSizeVariant;
|
|
3889
|
+
}
|
|
3890
|
+
return variant[`:${typeof value}`] || variant["..."];
|
|
4003
3891
|
}
|
|
4004
|
-
|
|
4005
|
-
|
|
4006
|
-
|
|
4007
|
-
|
|
4008
|
-
var
|
|
4009
|
-
|
|
4010
|
-
|
|
4011
|
-
|
|
4012
|
-
|
|
4013
|
-
|
|
4014
|
-
|
|
4015
|
-
|
|
4016
|
-
|
|
4017
|
-
|
|
4018
|
-
|
|
4019
|
-
|
|
4020
|
-
|
|
4021
|
-
|
|
4022
|
-
|
|
4023
|
-
|
|
4024
|
-
|
|
4025
|
-
|
|
4026
|
-
|
|
4027
|
-
|
|
4028
|
-
|
|
4029
|
-
|
|
4030
|
-
|
|
4031
|
-
|
|
3892
|
+
var fontShorthand = {
|
|
3893
|
+
fontSize: "size",
|
|
3894
|
+
fontWeight: "weight"
|
|
3895
|
+
}, lastFontFamilyToken = null, getTokenForKey = (key, value, resolveAs = "none", styleState) => {
|
|
3896
|
+
var _a, _b, _c, _d;
|
|
3897
|
+
if (resolveAs === "none")
|
|
3898
|
+
return value;
|
|
3899
|
+
let { theme, conf = (0, import_config.getConfig)(), context, fontFamily, staticConfig } = styleState, tokensParsed = conf.tokensParsed, valOrVar, hasSet = !1;
|
|
3900
|
+
if (theme && value in theme)
|
|
3901
|
+
valOrVar = theme[value], process.env.NODE_ENV === "development" && styleState.debug === "verbose" && console.info(` - resolving ${key} to theme value ${value}: ${(_a = valOrVar == null ? void 0 : valOrVar.get) == null ? void 0 : _a.call(valOrVar)}`), hasSet = !0;
|
|
3902
|
+
else if (value in conf.specificTokens)
|
|
3903
|
+
hasSet = !0, valOrVar = conf.specificTokens[value];
|
|
3904
|
+
else {
|
|
3905
|
+
let customTokenAccept = (_b = staticConfig == null ? void 0 : staticConfig.acceptTokens) == null ? void 0 : _b[key];
|
|
3906
|
+
if (customTokenAccept) {
|
|
3907
|
+
let val = tokensParsed[customTokenAccept][value];
|
|
3908
|
+
val && (valOrVar = val, hasSet = !0);
|
|
3909
|
+
} else {
|
|
3910
|
+
switch (key) {
|
|
3911
|
+
case "fontFamily": {
|
|
3912
|
+
valOrVar = ((_c = (context != null && context.language ? (0, import_getVariantExtras.getFontsForLanguage)(conf.fontsParsed, context.language) : conf.fontsParsed)[value]) == null ? void 0 : _c.family) || value, lastFontFamilyToken = value, hasSet = !0;
|
|
3913
|
+
break;
|
|
3914
|
+
}
|
|
3915
|
+
case "fontSize":
|
|
3916
|
+
case "lineHeight":
|
|
3917
|
+
case "letterSpacing":
|
|
3918
|
+
case "fontWeight": {
|
|
3919
|
+
let defaultFont = conf.defaultFont || "$body", fam = fontFamily || defaultFont;
|
|
3920
|
+
if (fam) {
|
|
3921
|
+
let fontsParsed = context != null && context.language ? (0, import_getVariantExtras.getFontsForLanguage)(conf.fontsParsed, context.language) : conf.fontsParsed, font = fontsParsed[fam] || fontsParsed[defaultFont];
|
|
3922
|
+
valOrVar = ((_d = font == null ? void 0 : font[fontShorthand[key] || key]) == null ? void 0 : _d[value]) || value, hasSet = !0;
|
|
3923
|
+
}
|
|
3924
|
+
break;
|
|
3925
|
+
}
|
|
3926
|
+
}
|
|
3927
|
+
for (let cat in import_helpers.tokenCategories)
|
|
3928
|
+
if (key in import_helpers.tokenCategories[cat]) {
|
|
3929
|
+
let res = tokensParsed[cat][value];
|
|
3930
|
+
res != null && (valOrVar = res, hasSet = !0);
|
|
3931
|
+
}
|
|
3932
|
+
}
|
|
3933
|
+
if (!hasSet) {
|
|
3934
|
+
let spaceVar = tokensParsed.space[value];
|
|
3935
|
+
spaceVar != null && (valOrVar = spaceVar, hasSet = !0);
|
|
3936
|
+
}
|
|
3937
|
+
}
|
|
3938
|
+
if (hasSet) {
|
|
3939
|
+
let out = resolveVariableValue(key, valOrVar, resolveAs);
|
|
3940
|
+
return process.env.NODE_ENV === "development" && styleState.debug === "verbose" && console.info("resolved", resolveAs, valOrVar, out), out;
|
|
3941
|
+
}
|
|
3942
|
+
return process.env.NODE_ENV === "development" && import_isDevTools.isDevTools && styleState.debug === "verbose" && (console.groupCollapsed(" \uFE52 propMap (val)", key, value), console.info({ valOrVar, theme, hasSet }, theme ? theme[key] : ""), console.groupEnd()), value;
|
|
4032
3943
|
};
|
|
4033
|
-
function
|
|
4034
|
-
|
|
4035
|
-
|
|
4036
|
-
|
|
4037
|
-
|
|
4038
|
-
|
|
4039
|
-
|
|
4040
|
-
return;
|
|
3944
|
+
function resolveVariableValue(key, valOrVar, resolveValues) {
|
|
3945
|
+
if (resolveValues === "none")
|
|
3946
|
+
return valOrVar;
|
|
3947
|
+
if ((0, import_createVariable.isVariable)(valOrVar)) {
|
|
3948
|
+
if (resolveValues === "value")
|
|
3949
|
+
return valOrVar.val;
|
|
3950
|
+
let get = valOrVar == null ? void 0 : valOrVar.get;
|
|
3951
|
+
return key !== "shadowColor" && typeof get == "function" ? get(resolveValues === "web" ? "web" : void 0) : valOrVar.val;
|
|
4041
3952
|
}
|
|
4042
|
-
|
|
3953
|
+
return valOrVar;
|
|
4043
3954
|
}
|
|
4044
3955
|
}
|
|
4045
3956
|
});
|
|
4046
3957
|
|
|
4047
|
-
// ../web/dist/cjs/helpers/
|
|
4048
|
-
var
|
|
4049
|
-
"../web/dist/cjs/helpers/
|
|
4050
|
-
"use strict";
|
|
4051
|
-
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
4052
|
-
for (var name in all)
|
|
4053
|
-
__defProp2(target, name, { get: all[name], enumerable: !0 });
|
|
4054
|
-
}, __copyProps2 = (to, from, except, desc) => {
|
|
4055
|
-
if (from && typeof from == "object" || typeof from == "function")
|
|
4056
|
-
for (let key of __getOwnPropNames2(from))
|
|
4057
|
-
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
4058
|
-
return to;
|
|
4059
|
-
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), ThemeManagerContext_exports = {};
|
|
4060
|
-
__export2(ThemeManagerContext_exports, {
|
|
4061
|
-
ThemeManagerIDContext: () => ThemeManagerIDContext
|
|
4062
|
-
});
|
|
4063
|
-
module2.exports = __toCommonJS2(ThemeManagerContext_exports);
|
|
4064
|
-
var import_react3 = require("react"), ThemeManagerIDContext = (0, import_react3.createContext)(1);
|
|
4065
|
-
}
|
|
4066
|
-
});
|
|
4067
|
-
|
|
4068
|
-
// ../web/dist/cjs/helpers/ThemeManager.native.js
|
|
4069
|
-
var require_ThemeManager_native = __commonJS({
|
|
4070
|
-
"../web/dist/cjs/helpers/ThemeManager.native.js"(exports2, module2) {
|
|
3958
|
+
// ../web/dist/cjs/helpers/getSplitStyles.native.js
|
|
3959
|
+
var require_getSplitStyles_native = __commonJS({
|
|
3960
|
+
"../web/dist/cjs/helpers/getSplitStyles.native.js"(exports2, module2) {
|
|
4071
3961
|
"use strict";
|
|
4072
3962
|
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
4073
3963
|
for (var name in all)
|
|
@@ -4077,404 +3967,522 @@ var require_ThemeManager_native = __commonJS({
|
|
|
4077
3967
|
for (let key of __getOwnPropNames2(from))
|
|
4078
3968
|
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
4079
3969
|
return to;
|
|
4080
|
-
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod),
|
|
4081
|
-
__export2(
|
|
4082
|
-
|
|
4083
|
-
|
|
4084
|
-
|
|
3970
|
+
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), getSplitStyles_exports = {};
|
|
3971
|
+
__export2(getSplitStyles_exports, {
|
|
3972
|
+
PROP_SPLIT: () => PROP_SPLIT,
|
|
3973
|
+
getSplitStyles: () => getSplitStyles,
|
|
3974
|
+
getSubStyle: () => getSubStyle,
|
|
3975
|
+
useSplitStyles: () => useSplitStyles
|
|
4085
3976
|
});
|
|
4086
|
-
module2.exports = __toCommonJS2(
|
|
4087
|
-
var import_constants = require_index_native3(), import_config = require_config_native(), import_constants2 = require_constants_native2(),
|
|
4088
|
-
function
|
|
4089
|
-
|
|
3977
|
+
module2.exports = __toCommonJS2(getSplitStyles_exports);
|
|
3978
|
+
var import_constants = require_index_native3(), import_helpers = require_index_native4(), import_react3 = require("react"), import_config = require_config_native(), import_accessibilityDirectMap = require_accessibilityDirectMap_native(), import_constants2 = require_constants_native2(), import_isDevTools = require_isDevTools_native(), import_useMedia = require_useMedia_native(), import_createMediaStyle = require_createMediaStyle_native(), import_expandStyles = require_expandStyles_native(), import_getGroupPropParts = require_getGroupPropParts_native(), import_getStylesAtomic = require_getStylesAtomic_native(), import_insertStyleRule = require_insertStyleRule_native(), import_log = require_log_native(), import_normalizeValueWithProperty = require_normalizeValueWithProperty_native(), import_propMapper = require_propMapper_native(), import_pseudoDescriptors = require_pseudoDescriptors_native(), IS_STATIC = process.env.IS_STATIC === "is_static", conf, PROP_SPLIT = "-";
|
|
3979
|
+
function isValidStyleKey(key, staticConfig) {
|
|
3980
|
+
let validStyleProps = staticConfig.validStyles ?? (staticConfig.isText ? import_helpers.stylePropsText : import_helpers.validStyles);
|
|
3981
|
+
return key in validStyleProps || staticConfig.acceptTokens && key in staticConfig.acceptTokens;
|
|
4090
3982
|
}
|
|
4091
|
-
var
|
|
4092
|
-
|
|
4093
|
-
|
|
4094
|
-
|
|
4095
|
-
|
|
4096
|
-
|
|
4097
|
-
|
|
4098
|
-
|
|
4099
|
-
|
|
4100
|
-
|
|
4101
|
-
|
|
4102
|
-
|
|
4103
|
-
}
|
|
4104
|
-
|
|
4105
|
-
|
|
4106
|
-
|
|
4107
|
-
|
|
4108
|
-
|
|
4109
|
-
|
|
4110
|
-
|
|
4111
|
-
|
|
4112
|
-
|
|
4113
|
-
|
|
4114
|
-
|
|
4115
|
-
|
|
4116
|
-
|
|
4117
|
-
|
|
4118
|
-
|
|
4119
|
-
|
|
4120
|
-
|
|
4121
|
-
|
|
4122
|
-
|
|
4123
|
-
|
|
4124
|
-
|
|
4125
|
-
|
|
4126
|
-
}
|
|
4127
|
-
|
|
4128
|
-
|
|
4129
|
-
|
|
4130
|
-
|
|
4131
|
-
|
|
4132
|
-
]
|
|
4133
|
-
|
|
4134
|
-
|
|
4135
|
-
|
|
4136
|
-
|
|
4137
|
-
|
|
4138
|
-
|
|
4139
|
-
|
|
4140
|
-
|
|
4141
|
-
|
|
4142
|
-
|
|
4143
|
-
|
|
4144
|
-
|
|
4145
|
-
|
|
4146
|
-
|
|
4147
|
-
|
|
4148
|
-
|
|
4149
|
-
|
|
4150
|
-
|
|
4151
|
-
|
|
4152
|
-
|
|
4153
|
-
|
|
4154
|
-
|
|
4155
|
-
|
|
4156
|
-
|
|
4157
|
-
|
|
4158
|
-
|
|
4159
|
-
|
|
4160
|
-
|
|
4161
|
-
|
|
4162
|
-
|
|
4163
|
-
if (prefix && prefix !== baseName && potentials.push(prefix), nextName && potentials.unshift(prefix ? `${prefix}_${nextName}` : nextName), i === 1) {
|
|
4164
|
-
let lastSegment = potentials.findIndex((x) => !x.includes("_"));
|
|
4165
|
-
lastSegment > 0 && potentials.splice(lastSegment, 0, nextName);
|
|
3983
|
+
var getSplitStyles = (props, staticConfig, theme, themeName, componentState, styleProps, parentSplitStyles, context, elementType, debug) => {
|
|
3984
|
+
var _a, _b, _c, _e, _f, _g;
|
|
3985
|
+
conf = conf || (0, import_config.getConfig)(), import_constants.isWeb && styleProps.isAnimated && conf.animations.isReactNative && !styleProps.noNormalize && (styleProps.noNormalize = "values");
|
|
3986
|
+
let { shorthands } = conf, {
|
|
3987
|
+
isHOC,
|
|
3988
|
+
isText,
|
|
3989
|
+
variants,
|
|
3990
|
+
isReactNative,
|
|
3991
|
+
inlineProps,
|
|
3992
|
+
inlineWhenUnflattened,
|
|
3993
|
+
parentStaticConfig,
|
|
3994
|
+
acceptsClassName
|
|
3995
|
+
} = staticConfig, viewProps = {}, mediaState2 = styleProps.mediaState || import_useMedia.mediaState, usedKeys = {}, shouldDoClasses = acceptsClassName && import_constants.isWeb && !styleProps.noClassNames, rulesToInsert = [], classNames = {}, transforms = {}, pseudos = null, space = props.space, hasMedia = !1, dynamicThemeAccess, pseudoGroups, mediaGroups, style = {}, className = props.className ?? "", mediaStylesSeen = 0, styleState = {
|
|
3996
|
+
curProps: { ...props },
|
|
3997
|
+
classNames,
|
|
3998
|
+
conf,
|
|
3999
|
+
props,
|
|
4000
|
+
styleProps,
|
|
4001
|
+
componentState,
|
|
4002
|
+
staticConfig,
|
|
4003
|
+
style,
|
|
4004
|
+
theme,
|
|
4005
|
+
usedKeys,
|
|
4006
|
+
viewProps,
|
|
4007
|
+
context,
|
|
4008
|
+
debug
|
|
4009
|
+
};
|
|
4010
|
+
process.env.NODE_ENV === "development" && debug && debug !== "profile" && import_constants.isClient && (console.groupCollapsed("getSplitStyles (collapsed)"), (0, import_log.log)({
|
|
4011
|
+
props,
|
|
4012
|
+
staticConfig,
|
|
4013
|
+
shouldDoClasses,
|
|
4014
|
+
styleProps,
|
|
4015
|
+
componentState,
|
|
4016
|
+
styleState,
|
|
4017
|
+
theme: { ...theme }
|
|
4018
|
+
}), console.groupEnd());
|
|
4019
|
+
for (let keyOg in props) {
|
|
4020
|
+
let keyInit = keyOg, valInit = props[keyOg];
|
|
4021
|
+
if (styleProps.disableExpandShorthands || keyInit in shorthands && (keyInit = shorthands[keyInit]), keyInit === "className" || keyInit in usedKeys || keyInit in skipProps && !styleProps.noSkip && !isHOC)
|
|
4022
|
+
continue;
|
|
4023
|
+
let valInitType = typeof valInit, isValidStyleKeyInit = isValidStyleKey(keyInit, staticConfig);
|
|
4024
|
+
if (styleState.curProps[keyInit] = valInit, !import_constants.isAndroid && keyInit === "elevationAndroid")
|
|
4025
|
+
continue;
|
|
4026
|
+
if (keyInit === "userSelect")
|
|
4027
|
+
keyInit = "selectable", valInit = valInit !== "none";
|
|
4028
|
+
else if (keyInit === "role") {
|
|
4029
|
+
viewProps.accessibilityRole = import_accessibilityDirectMap.accessibilityWebRoleToNativeRole[valInit];
|
|
4030
|
+
continue;
|
|
4031
|
+
} else if (keyInit.startsWith("aria-")) {
|
|
4032
|
+
if (import_accessibilityDirectMap.webToNativeAccessibilityDirectMap[keyInit]) {
|
|
4033
|
+
let nativeA11yProp = import_accessibilityDirectMap.webToNativeAccessibilityDirectMap[keyInit];
|
|
4034
|
+
keyInit === "aria-hidden" && (viewProps["aria-hidden"] = valInit), viewProps[nativeA11yProp] = valInit;
|
|
4035
|
+
continue;
|
|
4036
|
+
}
|
|
4037
|
+
if (import_accessibilityDirectMap.nativeAccessibilityValue[keyInit]) {
|
|
4038
|
+
let field = import_accessibilityDirectMap.nativeAccessibilityValue[keyInit];
|
|
4039
|
+
viewProps.accessibilityValue ? viewProps.accessibilityValue[field] = valInit : viewProps.accessibilityValue = {
|
|
4040
|
+
[field]: valInit
|
|
4041
|
+
};
|
|
4042
|
+
} else if (import_accessibilityDirectMap.nativeAccessibilityState[keyInit]) {
|
|
4043
|
+
let field = import_accessibilityDirectMap.nativeAccessibilityState[keyInit];
|
|
4044
|
+
viewProps.accessibilityState ? viewProps.accessibilityState[field] = valInit : viewProps.accessibilityState = {
|
|
4045
|
+
[field]: valInit
|
|
4046
|
+
};
|
|
4047
|
+
}
|
|
4048
|
+
continue;
|
|
4049
|
+
} else if (keyInit.startsWith("data-"))
|
|
4050
|
+
continue;
|
|
4051
|
+
if (keyInit === "dataSet") {
|
|
4052
|
+
for (let keyInit2 in valInit)
|
|
4053
|
+
viewProps[`data-${hyphenate(keyInit2)}`] = valInit[keyInit2];
|
|
4054
|
+
continue;
|
|
4166
4055
|
}
|
|
4167
|
-
if (
|
|
4168
|
-
|
|
4169
|
-
|
|
4170
|
-
|
|
4171
|
-
|
|
4056
|
+
if (keyInit[0] === "_" && keyInit.startsWith("_style")) {
|
|
4057
|
+
mergeStylePropIntoStyle(styleState, valInit);
|
|
4058
|
+
continue;
|
|
4059
|
+
}
|
|
4060
|
+
if (0)
|
|
4061
|
+
switch (keyInit) {
|
|
4062
|
+
case "accessibilityRole":
|
|
4063
|
+
case "accessibilityLabelledBy":
|
|
4064
|
+
case "accessibilityFlowTo":
|
|
4065
|
+
case "accessibilityControls":
|
|
4066
|
+
case "accessibilityDescribedBy":
|
|
4067
|
+
case "accessibilityKeyShortcuts":
|
|
4068
|
+
case "accessibilityLiveRegion":
|
|
4069
|
+
case "accessibilityReadOnly":
|
|
4070
|
+
case "accessibilityRequired":
|
|
4071
|
+
default:
|
|
4172
4072
|
}
|
|
4173
|
-
|
|
4174
|
-
|
|
4175
|
-
|
|
4176
|
-
|
|
4177
|
-
|
|
4178
|
-
|
|
4073
|
+
let isShorthand = keyInit in shorthands, isVariant = !isValidStyleKeyInit && variants && keyInit in variants, isStyleLikeKey = isShorthand || isValidStyleKeyInit || isVariant, isPseudo = keyInit in import_helpers.validPseudoKeys, isMedia = !isStyleLikeKey && !isPseudo && (0, import_useMedia.isMediaKey)(keyInit), isMediaOrPseudo = !!(isMedia || isPseudo), isStyleProp = isMediaOrPseudo || isVariant && !styleProps.noExpand || isValidStyleKeyInit || isShorthand;
|
|
4074
|
+
if (isStyleProp && (props.asChild === "except-style" || props.asChild === "except-style-web"))
|
|
4075
|
+
continue;
|
|
4076
|
+
let shouldPassProp = !isStyleProp || // is in parent variants
|
|
4077
|
+
isHOC && (parentStaticConfig == null ? void 0 : parentStaticConfig.variants) && keyInit in parentStaticConfig.variants || (inlineProps == null ? void 0 : inlineProps.has(keyInit)), parentVariant = (_a = parentStaticConfig == null ? void 0 : parentStaticConfig.variants) == null ? void 0 : _a[keyInit], isHOCShouldPassThrough = !!(isHOC && (isShorthand || isValidStyleKeyInit || isMediaOrPseudo || parentVariant || keyInit in skipProps)), shouldPassThrough = shouldPassProp || isHOCShouldPassThrough;
|
|
4078
|
+
if (process.env.NODE_ENV === "development" && debug === "verbose" && (console.groupCollapsed(
|
|
4079
|
+
`\u{1F539}\u{1F539}\u{1F539}\u{1F539} ${keyOg}${keyInit !== keyOg ? ` (shorthand for ${keyInit})` : ""} ${shouldPassThrough ? "(pass)" : ""} \u{1F539}\u{1F539}\u{1F539}\u{1F539}`
|
|
4080
|
+
), (0, import_log.log)({ isVariant, valInit, shouldPassProp }), import_constants.isClient && (0, import_log.log)({
|
|
4081
|
+
variants,
|
|
4082
|
+
variant: variants == null ? void 0 : variants[keyInit],
|
|
4083
|
+
isVariant,
|
|
4084
|
+
isHOCShouldPassThrough,
|
|
4085
|
+
curProps: { ...styleState.curProps },
|
|
4086
|
+
parentStaticConfig
|
|
4087
|
+
}), console.groupEnd()), shouldPassThrough && (passDownProp(viewProps, keyInit, valInit, isMediaOrPseudo), !isVariant) || !styleProps.noSkip && keyInit in skipProps)
|
|
4088
|
+
continue;
|
|
4089
|
+
if (isText && valInit && (keyInit === "fontFamily" || keyInit === shorthands.fontFamily) && valInit in conf.fontsParsed && (styleState.fontFamily = valInit), isValidStyleKeyInit && !variants && valInit !== "unset" && (valInitType === "number" || valInitType === "string" && valInit[0] !== "$")) {
|
|
4090
|
+
style[keyInit] = valInit;
|
|
4091
|
+
continue;
|
|
4092
|
+
}
|
|
4093
|
+
let expanded = isMediaOrPseudo || !isVariant && !isValidStyleKeyInit ? [[keyInit, valInit]] : (0, import_propMapper.propMapper)(keyInit, valInit, styleState), next = (0, import_propMapper.getPropMappedFontFamily)(expanded);
|
|
4094
|
+
if (next && (styleState.fontFamily = next), process.env.NODE_ENV === "development" && debug === "verbose") {
|
|
4095
|
+
console.groupCollapsed(" \u{1F4A0} expanded", keyInit, valInit);
|
|
4096
|
+
try {
|
|
4097
|
+
!import_constants.isServer && import_isDevTools.isDevTools && ((0, import_log.log)({
|
|
4098
|
+
expanded,
|
|
4099
|
+
styleProps,
|
|
4100
|
+
componentState,
|
|
4101
|
+
isVariant,
|
|
4102
|
+
variant: variants == null ? void 0 : variants[keyInit],
|
|
4103
|
+
shouldPassProp,
|
|
4104
|
+
isHOCShouldPassThrough,
|
|
4105
|
+
theme,
|
|
4106
|
+
usedKeys: { ...usedKeys },
|
|
4107
|
+
curProps: { ...styleState.curProps }
|
|
4108
|
+
}), (0, import_log.log)("expanded", expanded, `
|
|
4109
|
+
usedKeys`, { ...usedKeys }, `
|
|
4110
|
+
current`, {
|
|
4111
|
+
...style
|
|
4112
|
+
}));
|
|
4113
|
+
} catch {
|
|
4114
|
+
}
|
|
4115
|
+
console.groupEnd();
|
|
4116
|
+
}
|
|
4117
|
+
if (expanded) {
|
|
4118
|
+
for (let [key, val] of expanded)
|
|
4119
|
+
if (!(val == null || key in usedKeys)) {
|
|
4120
|
+
if (isPseudo = key in import_helpers.validPseudoKeys, isMedia = !isPseudo && !isValidStyleKeyInit && (0, import_useMedia.isMediaKey)(key), isMediaOrPseudo = !!(isMedia || isPseudo), isVariant = variants && key in variants, (inlineProps != null && inlineProps.has(key) || IS_STATIC && inlineWhenUnflattened != null && inlineWhenUnflattened.has(key)) && (viewProps[key] = props[key] ?? val), styleProps.noExpand && isPseudo || isHOC && (isMediaOrPseudo || ((_b = parentStaticConfig == null ? void 0 : parentStaticConfig.variants) == null ? void 0 : _b[keyInit]))) {
|
|
4121
|
+
passDownProp(viewProps, key, val, isMediaOrPseudo), process.env.NODE_ENV === "development" && debug === "verbose" && (console.groupCollapsed(` - passing down prop ${key}`), (0, import_log.log)({ val, after: { ...viewProps[key] } }), console.groupEnd());
|
|
4122
|
+
continue;
|
|
4123
|
+
}
|
|
4124
|
+
if (isPseudo) {
|
|
4125
|
+
if (!val)
|
|
4126
|
+
continue;
|
|
4127
|
+
let pseudoStyleObject = getSubStyle(
|
|
4128
|
+
styleState,
|
|
4129
|
+
key,
|
|
4130
|
+
val,
|
|
4131
|
+
styleProps.noClassNames
|
|
4132
|
+
), descriptor = import_pseudoDescriptors.pseudoDescriptors[key], isEnter = key === "enterStyle", isExit = key === "exitStyle";
|
|
4133
|
+
if (!descriptor || isExit && !styleProps.isExiting)
|
|
4134
|
+
continue;
|
|
4135
|
+
if ((!shouldDoClasses || IS_STATIC) && (pseudos ||= {}, pseudos[key] ||= {}, IS_STATIC)) {
|
|
4136
|
+
Object.assign(pseudos[key], pseudoStyleObject);
|
|
4137
|
+
continue;
|
|
4138
|
+
}
|
|
4139
|
+
if (shouldDoClasses && !isExit) {
|
|
4140
|
+
let pseudoStyles = (0, import_getStylesAtomic.generateAtomicStyles)(pseudoStyleObject, descriptor);
|
|
4141
|
+
process.env.NODE_ENV === "development" && debug === "verbose" && (console.groupCollapsed("pseudo (classes)", key), (0, import_log.log)({ pseudoStyleObject, pseudoStyles }), console.groupEnd());
|
|
4142
|
+
for (let psuedoStyle of pseudoStyles)
|
|
4143
|
+
`${psuedoStyle.property}${PROP_SPLIT}${descriptor.name}` in usedKeys || psuedoStyle.identifier;
|
|
4144
|
+
}
|
|
4145
|
+
if (!shouldDoClasses || isExit || isEnter) {
|
|
4146
|
+
let descriptorKey = descriptor.stateKey || descriptor.name, isDisabled = componentState[descriptorKey] === !1;
|
|
4147
|
+
isExit && (isDisabled = !styleProps.isExiting), isEnter && (isDisabled = componentState.unmounted === "should-enter" ? !0 : !componentState.unmounted), process.env.NODE_ENV === "development" && debug === "verbose" && (console.groupCollapsed("pseudo", key, { isDisabled }), (0, import_log.log)({ pseudoStyleObject, isDisabled, descriptor, componentState }), console.groupEnd());
|
|
4148
|
+
let importance = descriptor.priority;
|
|
4149
|
+
for (let pkey in pseudoStyleObject) {
|
|
4150
|
+
let val2 = pseudoStyleObject[pkey];
|
|
4151
|
+
if (isDisabled) {
|
|
4152
|
+
if (pkey in animatableDefaults && !(pkey in usedKeys)) {
|
|
4153
|
+
let defaultVal = animatableDefaults[pkey];
|
|
4154
|
+
mergeStyle(styleState, pkey, defaultVal);
|
|
4155
|
+
}
|
|
4156
|
+
} else {
|
|
4157
|
+
let curImportance = usedKeys[pkey] || 0, shouldMerge = importance >= curImportance;
|
|
4158
|
+
shouldMerge && (pseudos ||= {}, pseudos[key] ||= {}, pseudos[key][pkey] = val2, mergeStyle(styleState, pkey, val2)), process.env.NODE_ENV === "development" && debug === "verbose" && (0, import_log.log)(" subKey", pkey, shouldMerge, {
|
|
4159
|
+
importance,
|
|
4160
|
+
curImportance,
|
|
4161
|
+
pkey,
|
|
4162
|
+
val: val2,
|
|
4163
|
+
transforms: { ...styleState.transforms }
|
|
4164
|
+
});
|
|
4165
|
+
}
|
|
4166
|
+
}
|
|
4167
|
+
if (!isDisabled)
|
|
4168
|
+
for (let key2 in val) {
|
|
4169
|
+
let k = shorthands[key2] || key2;
|
|
4170
|
+
usedKeys[k] = Math.max(importance, usedKeys[k] || 0);
|
|
4171
|
+
}
|
|
4172
|
+
}
|
|
4173
|
+
continue;
|
|
4174
|
+
}
|
|
4175
|
+
if (isMedia) {
|
|
4176
|
+
if (!val)
|
|
4177
|
+
continue;
|
|
4178
|
+
if (isMedia === "platform") {
|
|
4179
|
+
let platform = key.slice(10);
|
|
4180
|
+
if (
|
|
4181
|
+
// supports web, ios, android
|
|
4182
|
+
platform !== import_constants.currentPlatform && // supports web, native
|
|
4183
|
+
platform !== "native"
|
|
4184
|
+
)
|
|
4185
|
+
continue;
|
|
4186
|
+
}
|
|
4187
|
+
hasMedia ||= !0;
|
|
4188
|
+
let mediaStyle = getSubStyle(
|
|
4189
|
+
styleState,
|
|
4190
|
+
key,
|
|
4191
|
+
val,
|
|
4192
|
+
// TODO try true like pseudo
|
|
4193
|
+
!1
|
|
4194
|
+
), mediaKeyShort = key.slice(1);
|
|
4195
|
+
process.env.NODE_ENV === "development" && debug === "verbose" && (0, import_log.log)(` \u{1F4FA} ${key}`, {
|
|
4196
|
+
key,
|
|
4197
|
+
val,
|
|
4198
|
+
mediaStyle,
|
|
4199
|
+
props,
|
|
4200
|
+
shouldDoClasses,
|
|
4201
|
+
componentState
|
|
4202
|
+
});
|
|
4203
|
+
let hasSpace = val.space;
|
|
4204
|
+
if ((hasSpace || !shouldDoClasses) && (Array.isArray(hasMedia) || (hasMedia = []), hasMedia.push(mediaKeyShort)), shouldDoClasses) {
|
|
4205
|
+
if (hasSpace && (delete mediaStyle.space, mediaState2[mediaKeyShort])) {
|
|
4206
|
+
let importance = (0, import_useMedia.getMediaImportanceIfMoreImportant)(
|
|
4207
|
+
mediaKeyShort,
|
|
4208
|
+
"space",
|
|
4209
|
+
usedKeys,
|
|
4210
|
+
!0
|
|
4211
|
+
);
|
|
4212
|
+
importance && (space = val.space, usedKeys.space = importance, process.env.NODE_ENV === "development" && debug === "verbose" && (0, import_log.log)(
|
|
4213
|
+
`Found more important space for current media ${mediaKeyShort}: ${val} (importance: ${importance})`
|
|
4214
|
+
));
|
|
4215
|
+
}
|
|
4216
|
+
let mediaStyles = (0, import_getStylesAtomic.getStylesAtomic)(mediaStyle, debug), priority = mediaStylesSeen;
|
|
4217
|
+
mediaStylesSeen += 1;
|
|
4218
|
+
for (let style2 of mediaStyles) {
|
|
4219
|
+
let out = (0, import_createMediaStyle.createMediaStyle)(
|
|
4220
|
+
style2,
|
|
4221
|
+
mediaKeyShort,
|
|
4222
|
+
import_useMedia.mediaQueryConfig,
|
|
4223
|
+
isMedia,
|
|
4224
|
+
!1,
|
|
4225
|
+
priority
|
|
4226
|
+
);
|
|
4227
|
+
process.env.NODE_ENV === "development" && debug === "verbose" && (0, import_log.log)("\u{1F4FA} media style:", out), `${style2.property}${PROP_SPLIT}${mediaKeyShort}` in usedKeys || out.identifier;
|
|
4228
|
+
}
|
|
4229
|
+
} else {
|
|
4230
|
+
let isThemeMedia = isMedia === "theme", isGroupMedia = isMedia === "group";
|
|
4231
|
+
if (!isThemeMedia && isMedia !== "platform" && !isGroupMedia && !mediaState2[mediaKeyShort])
|
|
4232
|
+
continue;
|
|
4233
|
+
let importanceBump = 0;
|
|
4234
|
+
if (isThemeMedia) {
|
|
4235
|
+
dynamicThemeAccess = !0;
|
|
4236
|
+
let mediaThemeName = mediaKeyShort.slice(6);
|
|
4237
|
+
if (!(themeName === mediaThemeName || themeName.startsWith(mediaThemeName)))
|
|
4238
|
+
continue;
|
|
4239
|
+
} else if (isGroupMedia) {
|
|
4240
|
+
let groupInfo = (0, import_getGroupPropParts.getGroupPropParts)(mediaKeyShort), groupName = groupInfo.name, groupContext = context == null ? void 0 : context.groups.state[groupName];
|
|
4241
|
+
if (!groupContext) {
|
|
4242
|
+
process.env.NODE_ENV === "development" && debug && console.warn(`No parent with group prop, skipping styles: ${groupName}`);
|
|
4243
|
+
continue;
|
|
4244
|
+
}
|
|
4245
|
+
let groupPseudoKey = groupInfo.pseudo, groupMediaKey = groupInfo.media, componentGroupState = (_c = componentState.group) == null ? void 0 : _c[groupName];
|
|
4246
|
+
if (groupMediaKey) {
|
|
4247
|
+
mediaGroups ||= /* @__PURE__ */ new Set(), mediaGroups.add(groupMediaKey);
|
|
4248
|
+
let mediaState22 = componentGroupState == null ? void 0 : componentGroupState.media, isActive = mediaState22 == null ? void 0 : mediaState22[groupMediaKey];
|
|
4249
|
+
if (!mediaState22 && groupContext.layout && (isActive = (0, import_useMedia.mediaKeyMatch)(groupMediaKey, groupContext.layout)), !isActive)
|
|
4250
|
+
continue;
|
|
4251
|
+
importanceBump = 2;
|
|
4252
|
+
}
|
|
4253
|
+
if (groupPseudoKey) {
|
|
4254
|
+
pseudoGroups ||= /* @__PURE__ */ new Set(), pseudoGroups.add(groupName);
|
|
4255
|
+
let componentGroupPseudoState = (componentGroupState || // fallback to context initially
|
|
4256
|
+
context.groups.state[groupName]).pseudo;
|
|
4257
|
+
if (!(componentGroupPseudoState != null && componentGroupPseudoState[groupPseudoKey]))
|
|
4258
|
+
continue;
|
|
4259
|
+
importanceBump = import_pseudoDescriptors.pseudoPriorities[groupPseudoKey];
|
|
4260
|
+
}
|
|
4261
|
+
}
|
|
4262
|
+
for (let subKey in mediaStyle) {
|
|
4263
|
+
if (subKey === "space") {
|
|
4264
|
+
space = valInit.space;
|
|
4265
|
+
continue;
|
|
4266
|
+
}
|
|
4267
|
+
(0, import_useMedia.mergeMediaByImportance)(
|
|
4268
|
+
style,
|
|
4269
|
+
mediaKeyShort,
|
|
4270
|
+
subKey,
|
|
4271
|
+
mediaStyle[subKey],
|
|
4272
|
+
usedKeys,
|
|
4273
|
+
mediaState2[mediaKeyShort],
|
|
4274
|
+
importanceBump
|
|
4275
|
+
), key === "fontFamily" && (styleState.fontFamily = mediaStyle.fontFamily);
|
|
4276
|
+
}
|
|
4277
|
+
}
|
|
4278
|
+
continue;
|
|
4279
|
+
}
|
|
4280
|
+
if (key === "pointerEvents") {
|
|
4281
|
+
viewProps[key] = val;
|
|
4282
|
+
continue;
|
|
4283
|
+
}
|
|
4284
|
+
if (
|
|
4285
|
+
// is HOC we can just pass through the styles as props
|
|
4286
|
+
// this fixes issues where style prop got merged with wrong priority
|
|
4287
|
+
!isHOC && (isValidStyleKey(key, staticConfig) || import_constants.isAndroid && key === "elevation")
|
|
4288
|
+
) {
|
|
4289
|
+
mergeStyle(styleState, key, val);
|
|
4290
|
+
continue;
|
|
4179
4291
|
}
|
|
4292
|
+
isVariant || (viewProps[key] = val);
|
|
4180
4293
|
}
|
|
4181
|
-
|
|
4182
|
-
|
|
4294
|
+
if (process.env.NODE_ENV === "development" && debug === "verbose") {
|
|
4295
|
+
console.groupCollapsed(" \u2714\uFE0F expand complete", keyInit);
|
|
4296
|
+
try {
|
|
4297
|
+
(0, import_log.log)("style", { ...style }), (0, import_log.log)("transforms", { ...transforms }), (0, import_log.log)("viewProps", { ...viewProps });
|
|
4298
|
+
} catch {
|
|
4299
|
+
}
|
|
4300
|
+
console.groupEnd();
|
|
4183
4301
|
}
|
|
4184
|
-
potentials = [...componentPotentials, ...potentials, ...allComponentThemes];
|
|
4185
|
-
}
|
|
4186
|
-
let found = potentials.find((t) => t in themes);
|
|
4187
|
-
if (process.env.NODE_ENV !== "production" && typeof props.debug == "string" && console.info(" getState ", {
|
|
4188
|
-
props,
|
|
4189
|
-
found,
|
|
4190
|
-
potentials,
|
|
4191
|
-
baseManager,
|
|
4192
|
-
nextName,
|
|
4193
|
-
baseName,
|
|
4194
|
-
prefix
|
|
4195
|
-
}), found) {
|
|
4196
|
-
let names = found.split("_"), [firstName, ...restNames] = names, lastName = names[names.length - 1], isComponent = lastName[0] === lastName[0].toUpperCase(), scheme = firstName === "light" ? "light" : firstName === "dark" ? "dark" : void 0, pre = import_constants2.THEME_CLASSNAME_PREFIX, className = import_constants.isWeb ? `${pre}sub_theme ${pre}${!scheme || !restNames.length ? firstName : restNames.join("_")}` : "", parentState = (_a = baseManager || parentManager) == null ? void 0 : _a.state, parentName = parentState == null ? void 0 : parentState.name;
|
|
4197
|
-
result = {
|
|
4198
|
-
name: found,
|
|
4199
|
-
parentName,
|
|
4200
|
-
theme: themes[found],
|
|
4201
|
-
className,
|
|
4202
|
-
isComponent,
|
|
4203
|
-
scheme
|
|
4204
|
-
};
|
|
4205
|
-
break;
|
|
4206
4302
|
}
|
|
4207
4303
|
}
|
|
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
|
-
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), useTheme_exports = {};
|
|
4233
|
-
__export2(useTheme_exports, {
|
|
4234
|
-
activeThemeManagers: () => activeThemeManagers,
|
|
4235
|
-
getThemeManager: () => getThemeManager,
|
|
4236
|
-
getThemeProxied: () => getThemeProxied,
|
|
4237
|
-
useChangeThemeEffect: () => useChangeThemeEffect,
|
|
4238
|
-
useTheme: () => useTheme,
|
|
4239
|
-
useThemeWithState: () => useThemeWithState
|
|
4240
|
-
});
|
|
4241
|
-
module2.exports = __toCommonJS2(useTheme_exports);
|
|
4242
|
-
var import_constants = require_index_native3(), import_react3 = require("react"), import_config = require_config_native(), import_createVariable = require_createVariable_native(), import_createShallowSetState = require_createShallowSetState_native(), import_ThemeManager = require_ThemeManager_native(), import_ThemeManagerContext = require_ThemeManagerContext_native(), emptyProps = { name: null }, cached;
|
|
4243
|
-
function getDefaultThemeProxied() {
|
|
4244
|
-
if (cached)
|
|
4245
|
-
return cached;
|
|
4246
|
-
let config = (0, import_config.getConfig)(), name = config.themes.light ? "light" : Object.keys(config.themes)[0], defaultTheme = config.themes[name];
|
|
4247
|
-
return cached = getThemeProxied({ theme: defaultTheme, name }), cached;
|
|
4248
|
-
}
|
|
4249
|
-
var useTheme = (props = emptyProps) => {
|
|
4250
|
-
let [_, theme] = useThemeWithState(props);
|
|
4251
|
-
return theme || getDefaultThemeProxied();
|
|
4252
|
-
}, useThemeWithState = (props) => {
|
|
4253
|
-
let keys = (0, import_react3.useRef)([]), changedThemeState = useChangeThemeEffect(
|
|
4254
|
-
props,
|
|
4255
|
-
!1,
|
|
4256
|
-
keys.current,
|
|
4257
|
-
import_constants.isServer ? void 0 : () => {
|
|
4258
|
-
var _a, _b;
|
|
4259
|
-
let next = ((_a = props.shouldUpdate) == null ? void 0 : _a.call(props)) ?? (keys.current.length > 0 ? !0 : void 0);
|
|
4260
|
-
return process.env.NODE_ENV === "development" && typeof props.debug == "string" && props.debug !== "profile" && console.info(" \u{1F3A8} useTheme() shouldUpdate?", next, {
|
|
4261
|
-
shouldUpdateProp: (_b = props.shouldUpdate) == null ? void 0 : _b.call(props),
|
|
4262
|
-
keys: [...keys.current]
|
|
4263
|
-
}), next;
|
|
4304
|
+
if (props.style && mergeStylePropIntoStyle(styleState, props.style), styleProps.noNormalize !== !1 && ((0, import_expandStyles.fixStyles)(style), import_constants.isWeb && !staticConfig.isReactNative && (0, import_getStylesAtomic.styleToCSS)(style), styleState.transforms && Object.entries(styleState.transforms).sort(([a], [b]) => a.localeCompare(b)).forEach(([key, val]) => {
|
|
4305
|
+
mergeTransform(style, key, val, !0);
|
|
4306
|
+
}), parentSplitStyles && !shouldDoClasses))
|
|
4307
|
+
for (let key in parentSplitStyles.style)
|
|
4308
|
+
key in classNames || key in style || (style[key] = parentSplitStyles.style[key]);
|
|
4309
|
+
let result = {
|
|
4310
|
+
space,
|
|
4311
|
+
hasMedia,
|
|
4312
|
+
fontFamily: styleState.fontFamily,
|
|
4313
|
+
viewProps,
|
|
4314
|
+
// @ts-expect-error
|
|
4315
|
+
style,
|
|
4316
|
+
pseudos,
|
|
4317
|
+
classNames,
|
|
4318
|
+
rulesToInsert,
|
|
4319
|
+
dynamicThemeAccess,
|
|
4320
|
+
pseudoGroups,
|
|
4321
|
+
mediaGroups
|
|
4322
|
+
};
|
|
4323
|
+
if (style.fontFamily) {
|
|
4324
|
+
let faceInfo = (_e = (0, import_config.getFont)(style.fontFamily)) == null ? void 0 : _e.face;
|
|
4325
|
+
if (faceInfo) {
|
|
4326
|
+
let overrideFace = (_g = (_f = faceInfo[style.fontWeight]) == null ? void 0 : _f[style.fontStyle || "normal"]) == null ? void 0 : _g.val;
|
|
4327
|
+
overrideFace && (style.fontFamily = overrideFace, styleState.fontFamily = overrideFace, delete style.fontWeight, delete style.fontStyle);
|
|
4264
4328
|
}
|
|
4265
|
-
|
|
4266
|
-
process.env.NODE_ENV === "development" && (state != null && state.theme || process.env.TAMAGUI_DISABLE_NO_THEME_WARNING !== "1" && console.warn(
|
|
4267
|
-
`[tamagui] No theme found, this could be due to an invalid theme name (given theme props ${JSON.stringify(
|
|
4268
|
-
props
|
|
4269
|
-
)}).
|
|
4270
|
-
|
|
4271
|
-
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`
|
|
4272
|
-
));
|
|
4273
|
-
let themeProxied = (0, import_react3.useMemo)(() => !themeManager || !(state != null && state.theme) ? {} : getThemeProxied(state, props.deopt, themeManager, keys.current, props.debug), [state == null ? void 0 : state.theme, themeManager, props.deopt, props.debug]);
|
|
4274
|
-
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];
|
|
4275
|
-
};
|
|
4276
|
-
function getThemeProxied({ theme, name, scheme }, deopt = !1, themeManager, keys, debug) {
|
|
4277
|
-
if (!theme)
|
|
4278
|
-
return {};
|
|
4279
|
-
let config = (0, import_config.getConfig)();
|
|
4280
|
-
function track(key) {
|
|
4281
|
-
keys && !keys.includes(key) && (keys.push(key), process.env.NODE_ENV === "development" && debug && console.info(` \u{1F3A8} useTheme() tracking new key: ${key}`));
|
|
4329
|
+
process.env.NODE_ENV === "development" && debug && debug !== "profile" && (0, import_log.log)(`Found fontFamily native: ${style.fontFamily}`, faceInfo);
|
|
4282
4330
|
}
|
|
4283
|
-
|
|
4284
|
-
|
|
4285
|
-
|
|
4286
|
-
|
|
4287
|
-
|
|
4288
|
-
|
|
4289
|
-
|
|
4290
|
-
|
|
4291
|
-
|
|
4292
|
-
|
|
4293
|
-
|
|
4294
|
-
|
|
4295
|
-
|
|
4296
|
-
|
|
4297
|
-
|
|
4298
|
-
|
|
4299
|
-
// when they touch the actual value we only track it
|
|
4300
|
-
// if its a variable (web), its ignored!
|
|
4301
|
-
get(_2, subkey) {
|
|
4302
|
-
if (subkey === "val")
|
|
4303
|
-
track(keyString);
|
|
4304
|
-
else if (subkey === "get")
|
|
4305
|
-
return (platform) => {
|
|
4306
|
-
let outVal = (0, import_createVariable.getVariable)(val);
|
|
4307
|
-
if (platform !== "web" && import_constants.isIos && !deopt && config.settings.fastSchemeChange && !someParentIsInversed(themeManager) && scheme) {
|
|
4308
|
-
let oppositeThemeName = name.replace(
|
|
4309
|
-
scheme === "dark" ? "dark" : "light",
|
|
4310
|
-
scheme === "dark" ? "light" : "dark"
|
|
4311
|
-
), oppositeTheme = config.themes[oppositeThemeName], oppositeVal = (0, import_createVariable.getVariable)(oppositeTheme == null ? void 0 : oppositeTheme[keyString]);
|
|
4312
|
-
if (oppositeVal)
|
|
4313
|
-
return {
|
|
4314
|
-
dynamic: {
|
|
4315
|
-
dark: scheme === "dark" ? outVal : oppositeVal,
|
|
4316
|
-
light: scheme === "light" ? outVal : oppositeVal
|
|
4317
|
-
}
|
|
4318
|
-
};
|
|
4319
|
-
}
|
|
4320
|
-
return track(keyString), outVal;
|
|
4321
|
-
};
|
|
4322
|
-
return Reflect.get(val, subkey);
|
|
4323
|
-
}
|
|
4324
|
-
});
|
|
4325
|
-
if (process.env.NODE_ENV === "development" && process.env.TAMAGUI_FEAT_THROW_ON_MISSING_THEME_VALUE === "1")
|
|
4326
|
-
throw new Error(
|
|
4327
|
-
`[tamagui] No theme key "${key}" found in theme ${name}.
|
|
4328
|
-
Keys in theme: ${Object.keys(
|
|
4329
|
-
theme
|
|
4330
|
-
).join(", ")}`
|
|
4331
|
-
);
|
|
4332
|
-
}
|
|
4333
|
-
return Reflect.get(_, key);
|
|
4334
|
-
}
|
|
4335
|
-
});
|
|
4336
|
-
}
|
|
4337
|
-
function someParentIsInversed(manager) {
|
|
4338
|
-
{
|
|
4339
|
-
let cur = manager;
|
|
4340
|
-
for (; cur; ) {
|
|
4341
|
-
if (!cur.parentManager)
|
|
4342
|
-
return !1;
|
|
4343
|
-
if (cur.parentManager.state.scheme !== cur.state.scheme)
|
|
4344
|
-
return !0;
|
|
4345
|
-
cur = cur.parentManager;
|
|
4331
|
+
if (className && (classNames.className = className), process.env.NODE_ENV === "development" && debug === "verbose" && import_isDevTools.isDevTools) {
|
|
4332
|
+
console.groupCollapsed(" \u{1F539} ===>");
|
|
4333
|
+
try {
|
|
4334
|
+
let logs = {
|
|
4335
|
+
...result,
|
|
4336
|
+
className,
|
|
4337
|
+
componentState,
|
|
4338
|
+
transforms,
|
|
4339
|
+
viewProps,
|
|
4340
|
+
viewPropsOrder: Object.keys(viewProps),
|
|
4341
|
+
rulesToInsert,
|
|
4342
|
+
parentSplitStyles
|
|
4343
|
+
};
|
|
4344
|
+
for (let key in logs)
|
|
4345
|
+
(0, import_log.log)(key, logs[key]);
|
|
4346
|
+
} catch {
|
|
4346
4347
|
}
|
|
4348
|
+
console.groupEnd();
|
|
4349
|
+
}
|
|
4350
|
+
return result;
|
|
4351
|
+
};
|
|
4352
|
+
function mergeStyle(styleState, key, val, disableNormalize = !1) {
|
|
4353
|
+
let { classNames, viewProps, style, usedKeys, styleProps } = styleState;
|
|
4354
|
+
if (import_constants.isWeb && (val == null ? void 0 : val[0]) === "_")
|
|
4355
|
+
classNames[key] = val, usedKeys[key] ||= 1;
|
|
4356
|
+
else if (key in import_helpers.stylePropsTransform)
|
|
4357
|
+
styleState.transforms ||= {}, styleState.transforms[key] = val;
|
|
4358
|
+
else {
|
|
4359
|
+
let out = import_constants.isWeb && !disableNormalize && !styleProps.noNormalize ? (0, import_normalizeValueWithProperty.normalizeValueWithProperty)(val, key) : val;
|
|
4360
|
+
key in import_helpers.validStylesOnBaseProps ? viewProps[key] = out : style[key] = out;
|
|
4347
4361
|
}
|
|
4348
|
-
return !1;
|
|
4349
4362
|
}
|
|
4350
|
-
var
|
|
4351
|
-
|
|
4352
|
-
|
|
4353
|
-
|
|
4363
|
+
var getSubStyle = (styleState, subKey, styleIn, avoidMergeTransform) => {
|
|
4364
|
+
let { staticConfig, props, conf: conf2, styleProps } = styleState, styleOut = {};
|
|
4365
|
+
for (let key in styleIn) {
|
|
4366
|
+
let val = styleIn[key];
|
|
4367
|
+
key = conf2.shorthands[key] || key;
|
|
4368
|
+
let expanded = (0, import_propMapper.propMapper)(key, val, styleState, { ...props, ...props[subKey] });
|
|
4369
|
+
if (!(!expanded || !staticConfig.isHOC && key in skipProps && !styleProps.noSkip))
|
|
4370
|
+
for (let [skey, sval] of expanded)
|
|
4371
|
+
!avoidMergeTransform && skey in import_helpers.stylePropsTransform ? mergeTransform(styleOut, skey, sval) : styleOut[skey] = styleProps.noNormalize ? sval : (0, import_normalizeValueWithProperty.normalizeValueWithProperty)(sval, key);
|
|
4354
4372
|
}
|
|
4355
|
-
|
|
4356
|
-
|
|
4357
|
-
|
|
4358
|
-
|
|
4359
|
-
|
|
4360
|
-
|
|
4361
|
-
|
|
4362
|
-
|
|
4363
|
-
|
|
4364
|
-
|
|
4365
|
-
|
|
4366
|
-
if (!manager || !forceShouldChange && forceUpdate === !1)
|
|
4367
|
-
return;
|
|
4368
|
-
let next = nextState || manager.getState(props, parentManager);
|
|
4369
|
-
if (forceShouldChange || next && !(forceUpdate !== !0 && !manager.getStateShouldChange(next, prevState)))
|
|
4370
|
-
return next;
|
|
4373
|
+
return styleProps.noNormalize || (0, import_expandStyles.fixStyles)(styleOut), styleOut;
|
|
4374
|
+
};
|
|
4375
|
+
function mergeStylePropIntoStyle(styleState, cur) {
|
|
4376
|
+
if (!cur)
|
|
4377
|
+
return;
|
|
4378
|
+
let styles = Array.isArray(cur) ? cur : [cur];
|
|
4379
|
+
for (let style of styles) {
|
|
4380
|
+
if (!style)
|
|
4381
|
+
continue;
|
|
4382
|
+
let isRNW = style.$$css;
|
|
4383
|
+
Object.assign(isRNW ? styleState.classNames : styleState.style, style);
|
|
4371
4384
|
}
|
|
4372
|
-
|
|
4373
|
-
|
|
4374
|
-
|
|
4375
|
-
|
|
4376
|
-
|
|
4377
|
-
|
|
4378
|
-
|
|
4379
|
-
|
|
4380
|
-
|
|
4381
|
-
|
|
4382
|
-
|
|
4383
|
-
|
|
4384
|
-
|
|
4385
|
-
|
|
4386
|
-
|
|
4387
|
-
|
|
4388
|
-
|
|
4389
|
-
|
|
4390
|
-
|
|
4391
|
-
|
|
4392
|
-
|
|
4393
|
-
|
|
4394
|
-
|
|
4395
|
-
|
|
4396
|
-
|
|
4397
|
-
|
|
4398
|
-
|
|
4399
|
-
|
|
4400
|
-
|
|
4385
|
+
}
|
|
4386
|
+
var useInsertEffectCompat = import_constants.isWeb ? import_react3.useInsertionEffect || import_constants.useIsomorphicLayoutEffect : () => {
|
|
4387
|
+
}, useSplitStyles = (...args) => {
|
|
4388
|
+
let res = getSplitStyles(...args);
|
|
4389
|
+
return useInsertEffectCompat(() => {
|
|
4390
|
+
(0, import_insertStyleRule.insertStyleRules)(res.rulesToInsert);
|
|
4391
|
+
}, [res.rulesToInsert]), res;
|
|
4392
|
+
}, animatableDefaults = {
|
|
4393
|
+
opacity: 1,
|
|
4394
|
+
scale: 1,
|
|
4395
|
+
rotate: "0deg",
|
|
4396
|
+
rotateY: "0deg",
|
|
4397
|
+
rotateX: "0deg",
|
|
4398
|
+
x: 0,
|
|
4399
|
+
y: 0
|
|
4400
|
+
}, lowercaseHyphenate = (match) => `-${match.toLowerCase()}`, hyphenate = (str) => str.replace(/[A-Z]/g, lowercaseHyphenate), mergeTransform = (obj, key, val, backwards = !1) => {
|
|
4401
|
+
typeof obj.transform != "string" && (obj.transform ||= [], obj.transform[backwards ? "unshift" : "push"]({
|
|
4402
|
+
[mapTransformKeys[key] || key]: val
|
|
4403
|
+
}));
|
|
4404
|
+
}, mapTransformKeys = {
|
|
4405
|
+
x: "translateX",
|
|
4406
|
+
y: "translateY"
|
|
4407
|
+
}, skipProps = {
|
|
4408
|
+
untilMeasured: 1,
|
|
4409
|
+
animation: 1,
|
|
4410
|
+
space: 1,
|
|
4411
|
+
animateOnly: 1,
|
|
4412
|
+
disableClassName: 1,
|
|
4413
|
+
debug: 1,
|
|
4414
|
+
componentName: 1,
|
|
4415
|
+
disableOptimization: 1,
|
|
4416
|
+
tag: 1,
|
|
4417
|
+
style: 1,
|
|
4418
|
+
// handled after loop so pseudos set usedKeys and override it if necessary
|
|
4419
|
+
group: 1
|
|
4420
|
+
};
|
|
4421
|
+
process.env.NODE_ENV === "test" && (skipProps["data-test-renders"] = 1);
|
|
4422
|
+
Object.assign(skipProps, {
|
|
4423
|
+
whiteSpace: 1,
|
|
4424
|
+
wordWrap: 1,
|
|
4425
|
+
textOverflow: 1,
|
|
4426
|
+
textDecorationDistance: 1,
|
|
4427
|
+
cursor: 1,
|
|
4428
|
+
contain: 1,
|
|
4429
|
+
boxSizing: 1,
|
|
4430
|
+
boxShadow: 1,
|
|
4431
|
+
outlineStyle: 1,
|
|
4432
|
+
outlineOffset: 1,
|
|
4433
|
+
outlineWidth: 1,
|
|
4434
|
+
outlineColor: 1
|
|
4435
|
+
});
|
|
4436
|
+
function passDownProp(viewProps, key, val, shouldMergeObject = !1) {
|
|
4437
|
+
if (shouldMergeObject) {
|
|
4438
|
+
let next = {
|
|
4439
|
+
...viewProps[key],
|
|
4440
|
+
...val
|
|
4401
4441
|
};
|
|
4402
|
-
|
|
4403
|
-
|
|
4404
|
-
|
|
4405
|
-
|
|
4406
|
-
|
|
4407
|
-
|
|
4408
|
-
|
|
4409
|
-
|
|
4410
|
-
|
|
4411
|
-
|
|
4412
|
-
|
|
4413
|
-
|
|
4414
|
-
|
|
4415
|
-
|
|
4416
|
-
|
|
4417
|
-
|
|
4418
|
-
|
|
4419
|
-
|
|
4420
|
-
|
|
4421
|
-
|
|
4422
|
-
|
|
4442
|
+
delete viewProps[key], viewProps[key] = next;
|
|
4443
|
+
} else
|
|
4444
|
+
viewProps[key] = val;
|
|
4445
|
+
}
|
|
4446
|
+
}
|
|
4447
|
+
});
|
|
4448
|
+
|
|
4449
|
+
// ../web/dist/cjs/helpers/mergeProps.native.js
|
|
4450
|
+
var require_mergeProps_native = __commonJS({
|
|
4451
|
+
"../web/dist/cjs/helpers/mergeProps.native.js"(exports2, module2) {
|
|
4452
|
+
"use strict";
|
|
4453
|
+
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
4454
|
+
for (var name in all)
|
|
4455
|
+
__defProp2(target, name, { get: all[name], enumerable: !0 });
|
|
4456
|
+
}, __copyProps2 = (to, from, except, desc) => {
|
|
4457
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
4458
|
+
for (let key of __getOwnPropNames2(from))
|
|
4459
|
+
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
4460
|
+
return to;
|
|
4461
|
+
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), mergeProps_exports = {};
|
|
4462
|
+
__export2(mergeProps_exports, {
|
|
4463
|
+
mergeProps: () => mergeProps
|
|
4464
|
+
});
|
|
4465
|
+
module2.exports = __toCommonJS2(mergeProps_exports);
|
|
4466
|
+
var import_useMedia = require_useMedia_native(), import_pseudoDescriptors = require_pseudoDescriptors_native(), mergeProps = (a, b, inverseShorthands) => {
|
|
4467
|
+
let out = {};
|
|
4468
|
+
for (let key in a)
|
|
4469
|
+
mergeProp(out, a, b, key, inverseShorthands);
|
|
4470
|
+
if (b)
|
|
4471
|
+
for (let key in b)
|
|
4472
|
+
mergeProp(out, b, void 0, key, inverseShorthands);
|
|
4473
|
+
return out;
|
|
4474
|
+
};
|
|
4475
|
+
function mergeProp(out, a, b, key, inverseShorthands) {
|
|
4476
|
+
let longhand = (inverseShorthands == null ? void 0 : inverseShorthands[key]) || null, val = a[key];
|
|
4477
|
+
if (key in import_pseudoDescriptors.pseudoDescriptors || import_useMedia.mediaKeys.has(key)) {
|
|
4478
|
+
out[key] = {
|
|
4479
|
+
...out[key],
|
|
4480
|
+
...val
|
|
4423
4481
|
};
|
|
4424
|
-
|
|
4425
|
-
state,
|
|
4426
|
-
isNewTheme,
|
|
4427
|
-
inversed,
|
|
4428
|
-
themeManager
|
|
4429
|
-
};
|
|
4430
|
-
function createState(prev, force = !1) {
|
|
4431
|
-
if (prev && (shouldUpdate == null ? void 0 : shouldUpdate()) === !1 && !force)
|
|
4432
|
-
return prev;
|
|
4433
|
-
let themeManager2 = parentManager, state2;
|
|
4434
|
-
if ((0, import_ThemeManager.getHasThemeUpdatingProps)(props)) {
|
|
4435
|
-
let getNewThemeManager = () => new import_ThemeManager.ThemeManager(props, isRoot ? "root" : parentManager);
|
|
4436
|
-
if (prev != null && prev.themeManager) {
|
|
4437
|
-
themeManager2 = prev.themeManager;
|
|
4438
|
-
let forceChange = force || !!(keys != null && keys.length), next = themeManager2.getState(props, parentManager), nextState = getShouldUpdateTheme(
|
|
4439
|
-
themeManager2,
|
|
4440
|
-
next,
|
|
4441
|
-
prev.state,
|
|
4442
|
-
forceChange
|
|
4443
|
-
);
|
|
4444
|
-
nextState ? (state2 = nextState, prev.isNewTheme ? themeManager2.updateState(nextState) : themeManager2 = getNewThemeManager()) : prev.isNewTheme && parentManager && !next && (themeManager2 = parentManager);
|
|
4445
|
-
} else
|
|
4446
|
-
themeManager2 = getNewThemeManager(), state2 = { ...themeManager2.state };
|
|
4447
|
-
}
|
|
4448
|
-
let isNewTheme2 = !!(themeManager2 !== parentManager || props.inverse);
|
|
4449
|
-
isNewTheme2 && registerThemeManager(themeManager2);
|
|
4450
|
-
let mounted2 = props.inverse ? isRoot || (prev == null ? void 0 : prev.mounted) : !0;
|
|
4451
|
-
state2 || (isNewTheme2 ? state2 = themeManager2.state : (state2 = parentManager.state, themeManager2 = parentManager));
|
|
4452
|
-
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 = {
|
|
4453
|
-
themeManager: themeManager2,
|
|
4454
|
-
isNewTheme: isNewTheme2,
|
|
4455
|
-
mounted: mounted2,
|
|
4456
|
-
inversed: inversed2
|
|
4457
|
-
}, shouldReturnPrev = prev && !force && // isEqualShallow uses the second arg as the keys so this should compare without state first...
|
|
4458
|
-
(0, import_createShallowSetState.isEqualShallow)(prev, response) && // ... and then compare just the state, because we make a new state obj but is likely the same
|
|
4459
|
-
(0, import_createShallowSetState.isEqualShallow)(prev.state, state2);
|
|
4460
|
-
if (prev && shouldReturnPrev)
|
|
4461
|
-
return prev;
|
|
4462
|
-
if (response.state = state2, process.env.NODE_ENV === "development" && props.debug && import_constants.isClient) {
|
|
4463
|
-
console.groupCollapsed(` \u{1F537} ${themeManager2.id} useChangeThemeEffect createState`);
|
|
4464
|
-
let parentState = { ...parentManager == null ? void 0 : parentManager.state }, parentId = parentManager == null ? void 0 : parentManager.id, themeManagerState = { ...themeManager2.state };
|
|
4465
|
-
console.info({
|
|
4466
|
-
props,
|
|
4467
|
-
parentState,
|
|
4468
|
-
parentId,
|
|
4469
|
-
themeManager: themeManager2,
|
|
4470
|
-
prev,
|
|
4471
|
-
response,
|
|
4472
|
-
themeManagerState
|
|
4473
|
-
}), console.groupEnd();
|
|
4474
|
-
}
|
|
4475
|
-
return response;
|
|
4482
|
+
return;
|
|
4476
4483
|
}
|
|
4477
|
-
|
|
4484
|
+
b && (key in b || longhand && longhand in b) || (out[longhand || key] = val);
|
|
4485
|
+
}
|
|
4478
4486
|
}
|
|
4479
4487
|
});
|
|
4480
4488
|
|