@kbach/react-native 1.0.0-beta.23 → 1.0.0-beta.24
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/jsx-dev-runtime.js
CHANGED
|
@@ -588,11 +588,18 @@ function ReactiveElement({
|
|
|
588
588
|
}) {
|
|
589
589
|
(0, import_react.useSyncExternalStore)(import_darkModeStore.subscribeGlobalDarkMode, import_darkModeStore.getGlobalDarkMode);
|
|
590
590
|
(0, import_react.useSyncExternalStore)(import_dynamicTokens.subscribeDynamicTokens, import_dynamicTokens.getDynamicTokensVersion);
|
|
591
|
-
(0, import_react_native.useWindowDimensions)();
|
|
591
|
+
const windowSize = (0, import_react_native.useWindowDimensions)();
|
|
592
592
|
const [measuredBasis, setMeasuredBasis] = (0, import_react.useState)(null);
|
|
593
|
+
const lastWindowSizeRef = (0, import_react.useRef)(windowSize);
|
|
594
|
+
if (lastWindowSizeRef.current.width !== windowSize.width || lastWindowSizeRef.current.height !== windowSize.height) {
|
|
595
|
+
lastWindowSizeRef.current = windowSize;
|
|
596
|
+
if (measuredBasis !== null) {
|
|
597
|
+
setMeasuredBasis(null);
|
|
598
|
+
}
|
|
599
|
+
}
|
|
593
600
|
const measure = (0, import_react.useCallback)((e) => {
|
|
594
601
|
const { width: w, height: h } = e.nativeEvent.layout;
|
|
595
|
-
setMeasuredBasis((prev) => prev
|
|
602
|
+
setMeasuredBasis((prev) => prev === null ? { width: w, height: h } : prev);
|
|
596
603
|
}, []);
|
|
597
604
|
const [isHovered, setIsHovered] = (0, import_react.useState)(false);
|
|
598
605
|
const [isFocused, setIsFocused] = (0, import_react.useState)(false);
|
|
@@ -8,7 +8,7 @@ import "./chunk-AG7ZQ2K4.mjs";
|
|
|
8
8
|
|
|
9
9
|
// src/jsxRuntimeCore.ts
|
|
10
10
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
|
-
import { Fragment as Fragment2, useCallback, useState, useSyncExternalStore } from "react";
|
|
11
|
+
import { Fragment as Fragment2, useCallback, useRef, useState, useSyncExternalStore } from "react";
|
|
12
12
|
import { Pressable, useWindowDimensions } from "react-native";
|
|
13
13
|
function createJsxDEV(jsx2, jsxs2) {
|
|
14
14
|
return function jsxDEV2(type, props, key, isStaticChildren, source, self) {
|
package/dist/jsx-runtime.js
CHANGED
|
@@ -589,11 +589,18 @@ function ReactiveElement({
|
|
|
589
589
|
}) {
|
|
590
590
|
(0, import_react.useSyncExternalStore)(import_darkModeStore.subscribeGlobalDarkMode, import_darkModeStore.getGlobalDarkMode);
|
|
591
591
|
(0, import_react.useSyncExternalStore)(import_dynamicTokens.subscribeDynamicTokens, import_dynamicTokens.getDynamicTokensVersion);
|
|
592
|
-
(0, import_react_native.useWindowDimensions)();
|
|
592
|
+
const windowSize = (0, import_react_native.useWindowDimensions)();
|
|
593
593
|
const [measuredBasis, setMeasuredBasis] = (0, import_react.useState)(null);
|
|
594
|
+
const lastWindowSizeRef = (0, import_react.useRef)(windowSize);
|
|
595
|
+
if (lastWindowSizeRef.current.width !== windowSize.width || lastWindowSizeRef.current.height !== windowSize.height) {
|
|
596
|
+
lastWindowSizeRef.current = windowSize;
|
|
597
|
+
if (measuredBasis !== null) {
|
|
598
|
+
setMeasuredBasis(null);
|
|
599
|
+
}
|
|
600
|
+
}
|
|
594
601
|
const measure = (0, import_react.useCallback)((e) => {
|
|
595
602
|
const { width: w, height: h } = e.nativeEvent.layout;
|
|
596
|
-
setMeasuredBasis((prev) => prev
|
|
603
|
+
setMeasuredBasis((prev) => prev === null ? { width: w, height: h } : prev);
|
|
597
604
|
}, []);
|
|
598
605
|
const [isHovered, setIsHovered] = (0, import_react.useState)(false);
|
|
599
606
|
const [isFocused, setIsFocused] = (0, import_react.useState)(false);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kbach/react-native",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.24",
|
|
4
4
|
"description": "Kbach's utility-class styling engine for React Native — the same class names as @kbach/react, resolved to a StyleSheet-ready style object via a Kotlin/JNI TurboModule (native), the same WASM engine @kbach/react uses (Expo Web / react-native-web), or a pure-JS fallback engine (Expo Go). Ships its own native Android module — one npm install, no separate native package. Beta. Native is Android-only (no iOS bridge yet); works with the React Native CLI, an Expo dev client, AND Expo Go (a reduced-coverage pure-JS fallback, since Expo Go can't load any custom native module).",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"css",
|