@kbach/react-native 1.0.0-beta.46 → 1.0.0-beta.47
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/README.md +73 -13
- 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-3KLOVONL.mjs +564 -0
- package/dist/{chunk-UFSVFF3V.mjs → chunk-SC3L5I7H.mjs} +1 -1
- package/dist/{chunk-KT6TQLWI.mjs → chunk-XOH25F3E.mjs} +1 -1
- package/dist/dynamicTokens.d.ts +18 -1
- package/dist/index.js +22 -2
- package/dist/index.web.js +1 -1
- package/dist/index.web.mjs +2 -2
- package/dist/jsx-dev-runtime.js +22 -2
- package/dist/jsx-dev-runtime.web.js +1 -1
- package/dist/jsx-dev-runtime.web.mjs +3 -3
- package/dist/jsx-runtime.js +22 -2
- package/dist/jsx-runtime.web.js +1 -1
- package/dist/jsx-runtime.web.mjs +2 -2
- package/package.json +1 -1
- package/dist/chunk-DKZM4NUU.mjs +0 -564
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import "./chunk-
|
|
1
|
+
import "./chunk-XOH25F3E.mjs";
|
|
2
2
|
import {
|
|
3
3
|
Fragment,
|
|
4
4
|
jsx,
|
|
5
5
|
jsxs
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-SC3L5I7H.mjs";
|
|
7
|
+
import "./chunk-3KLOVONL.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
|
@@ -2128,6 +2128,12 @@ function isPlainPercentage(value) {
|
|
|
2128
2128
|
if (digits.startsWith("-")) digits = digits.slice(1);
|
|
2129
2129
|
return digits.length > 0 && /^[0-9.]+$/.test(digits);
|
|
2130
2130
|
}
|
|
2131
|
+
function sanitizeForWarning(value) {
|
|
2132
|
+
const MAX_CHARS = 60;
|
|
2133
|
+
const escaped = value.replace(/"/g, "'").replace(/[\n\r]/g, " ");
|
|
2134
|
+
if (escaped.length <= MAX_CHARS) return escaped;
|
|
2135
|
+
return `${escaped.slice(0, MAX_CHARS)}\u2026`;
|
|
2136
|
+
}
|
|
2131
2137
|
function rnStyleValue(property, value) {
|
|
2132
2138
|
if (property === "aspect-ratio") {
|
|
2133
2139
|
if (value.trim() === "auto") return { value: null, warning: null };
|
|
@@ -2168,7 +2174,8 @@ function rnStyleValue(property, value) {
|
|
|
2168
2174
|
if (reduced !== null) {
|
|
2169
2175
|
return { value: reduced, warning: null };
|
|
2170
2176
|
}
|
|
2171
|
-
const
|
|
2177
|
+
const sanitizedValue = sanitizeForWarning(value);
|
|
2178
|
+
const warning = `[Kbach] "${sanitizedValue}" isn't a valid native value for "${property}" \u2014 dropped.
|
|
2172
2179
|
calc()/min()/max()/clamp() only resolve on native when every operand is a constant px/rem length (no %, vw, vh, var(), or other viewport/CSS-variable units \u2014 those need real layout/DOM, which doesn't exist on native at paint time).
|
|
2173
2180
|
Fix: use a plain px/rem calc, a fraction utility (e.g. w-1/2), or resolve this value in JS instead.`;
|
|
2174
2181
|
return { value: null, warning };
|
|
@@ -2276,14 +2283,27 @@ function resolveStyleUncached(classString, pressed, colorScheme, width, themeJso
|
|
|
2276
2283
|
}
|
|
2277
2284
|
return style;
|
|
2278
2285
|
}
|
|
2286
|
+
var WARNED_MESSAGES_MAX = 500;
|
|
2279
2287
|
var warnedMessages = /* @__PURE__ */ new Set();
|
|
2288
|
+
var QUOTED_TOKEN_RE = /"([^"]*)"/;
|
|
2289
|
+
function highlightToken(classString, warning) {
|
|
2290
|
+
const match = QUOTED_TOKEN_RE.exec(warning);
|
|
2291
|
+
if (match === null) return classString;
|
|
2292
|
+
const token = match[1];
|
|
2293
|
+
const parts = classString.split(/(\s+)/);
|
|
2294
|
+
const idx = parts.indexOf(token);
|
|
2295
|
+
if (idx === -1) return classString;
|
|
2296
|
+
parts[idx] = `\xBB${token}\xAB`;
|
|
2297
|
+
return parts.join("");
|
|
2298
|
+
}
|
|
2280
2299
|
function warnIfDev(classString, warnings) {
|
|
2281
2300
|
if (warnings.length === 0) return;
|
|
2282
2301
|
if (typeof __DEV__ !== "undefined" && !__DEV__) return;
|
|
2283
2302
|
for (const warning of warnings) {
|
|
2284
2303
|
const message = `${warning}
|
|
2285
|
-
From className: "${classString}"`;
|
|
2304
|
+
From className: "${highlightToken(classString, warning)}"`;
|
|
2286
2305
|
if (warnedMessages.has(message)) continue;
|
|
2306
|
+
if (warnedMessages.size >= WARNED_MESSAGES_MAX) warnedMessages.clear();
|
|
2287
2307
|
warnedMessages.add(message);
|
|
2288
2308
|
console.warn(message);
|
|
2289
2309
|
}
|