@kbach/react-native 1.0.0-beta.25 → 1.0.0-beta.26
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/android/src/main/jniLibs/arm64-v8a/libkbach_core_engine.so +0 -0
- package/android/src/main/jniLibs/x86_64/libkbach_core_engine.so +0 -0
- package/dist/chunk-BEXNFWW6.mjs +564 -0
- package/dist/{chunk-EBLZ3CJG.mjs → chunk-GHQ7DWLO.mjs} +1 -1
- package/dist/{chunk-JENWPIJT.mjs → chunk-LWD6JATB.mjs} +5 -1
- package/dist/darkModeStore.d.ts +16 -1
- package/dist/darkModeStore.js +5 -0
- package/dist/index.d.ts +1 -84
- package/dist/index.js +42 -21
- package/dist/index.web.d.ts +1 -1
- package/dist/index.web.js +38 -22
- package/dist/index.web.mjs +7 -3
- package/dist/jsx-dev-runtime.js +18 -1
- package/dist/jsx-dev-runtime.web.js +14 -2
- package/dist/jsx-dev-runtime.web.mjs +3 -3
- package/dist/jsx-runtime.js +18 -1
- package/dist/jsx-runtime.web.js +14 -2
- package/dist/jsx-runtime.web.mjs +2 -2
- package/dist/{useDynamicToken-DAHQob1u.d.ts → useDynamicToken-C8T9r6Cl.d.ts} +7 -1
- package/package.json +1 -1
- package/dist/chunk-TBDAJIR3.mjs +0 -552
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import "./chunk-
|
|
1
|
+
import "./chunk-LWD6JATB.mjs";
|
|
2
2
|
import {
|
|
3
3
|
Fragment,
|
|
4
4
|
jsx,
|
|
5
5
|
jsxs
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-GHQ7DWLO.mjs";
|
|
7
|
+
import "./chunk-BEXNFWW6.mjs";
|
|
8
8
|
|
|
9
9
|
// src/jsxRuntimeCore.ts
|
|
10
10
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
package/dist/jsx-runtime.js
CHANGED
|
@@ -1929,16 +1929,33 @@ function resolveStyleJsWithWarnings(classString, theme, colorScheme, pressed, wi
|
|
|
1929
1929
|
}
|
|
1930
1930
|
|
|
1931
1931
|
// src/nativeBridge.ts
|
|
1932
|
+
var RESOLVE_STYLE_CACHE_MAX = 500;
|
|
1933
|
+
var resolveStyleCache = /* @__PURE__ */ new Map();
|
|
1934
|
+
var cachedForThemeJson = null;
|
|
1932
1935
|
function resolveStyle(classString, pressed = false) {
|
|
1933
1936
|
const colorScheme = (0, import_darkModeStore2.getGlobalDarkMode)() ? "dark" : "light";
|
|
1934
1937
|
const width = import_react_native2.Dimensions.get("window").width;
|
|
1938
|
+
const themeJson = (0, import_theme.getThemeJson)();
|
|
1939
|
+
if (themeJson !== cachedForThemeJson) {
|
|
1940
|
+
resolveStyleCache.clear();
|
|
1941
|
+
cachedForThemeJson = themeJson;
|
|
1942
|
+
}
|
|
1943
|
+
const cacheKey = `${classString}\0${pressed}\0${colorScheme}\0${width}`;
|
|
1944
|
+
const cached = resolveStyleCache.get(cacheKey);
|
|
1945
|
+
if (cached !== void 0) return { ...cached };
|
|
1946
|
+
const style = resolveStyleUncached(classString, pressed, colorScheme, width, themeJson);
|
|
1947
|
+
if (resolveStyleCache.size >= RESOLVE_STYLE_CACHE_MAX) resolveStyleCache.clear();
|
|
1948
|
+
resolveStyleCache.set(cacheKey, style);
|
|
1949
|
+
return { ...style };
|
|
1950
|
+
}
|
|
1951
|
+
function resolveStyleUncached(classString, pressed, colorScheme, width, themeJson) {
|
|
1935
1952
|
const KbachModule = import_react_native2.TurboModuleRegistry.get("KbachModule");
|
|
1936
1953
|
if (!KbachModule) {
|
|
1937
1954
|
const { style: style2, warnings: warnings2 } = resolveStyleJsWithWarnings(classString, (0, import_theme.getTheme)(), colorScheme, pressed, width);
|
|
1938
1955
|
warnIfDev(classString, warnings2);
|
|
1939
1956
|
return style2;
|
|
1940
1957
|
}
|
|
1941
|
-
const json = KbachModule.resolveStyle(classString,
|
|
1958
|
+
const json = KbachModule.resolveStyle(classString, themeJson, colorScheme, pressed, width);
|
|
1942
1959
|
const style = JSON.parse(json);
|
|
1943
1960
|
const warnings = style.__kbachWarnings;
|
|
1944
1961
|
if (warnings !== void 0) {
|