@kbach/react-native 1.0.0 → 1.1.1-beta.0
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/AGENTS.md +9 -0
- package/README.md +8 -0
- 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-HYQFT32E.mjs → chunk-6F44N62F.mjs} +1 -1
- package/dist/{chunk-7CNURQSH.mjs → chunk-FSO4WVCH.mjs} +1 -1
- package/dist/chunk-R7E5D3D6.mjs +623 -0
- package/dist/index.js +68 -0
- package/dist/index.web.js +1 -1
- package/dist/index.web.mjs +2 -2
- package/dist/jsx-dev-runtime.js +68 -0
- package/dist/jsx-dev-runtime.web.js +1 -1
- package/dist/jsx-dev-runtime.web.mjs +3 -3
- package/dist/jsx-runtime.js +68 -0
- package/dist/jsx-runtime.web.js +1 -1
- package/dist/jsx-runtime.web.mjs +2 -2
- package/package.json +1 -1
- package/dist/chunk-MUPEQJRT.mjs +0 -623
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import "./chunk-
|
|
1
|
+
import "./chunk-FSO4WVCH.mjs";
|
|
2
2
|
import {
|
|
3
3
|
Fragment,
|
|
4
4
|
jsx,
|
|
5
5
|
jsxs
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-6F44N62F.mjs";
|
|
7
|
+
import "./chunk-R7E5D3D6.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
|
@@ -1142,6 +1142,73 @@ var import_react_native2 = require("react-native");
|
|
|
1142
1142
|
var import_theme2 = require("./theme");
|
|
1143
1143
|
var import_darkModeStore2 = require("./darkModeStore");
|
|
1144
1144
|
|
|
1145
|
+
// src/jsEngine/groups.ts
|
|
1146
|
+
function expandVariantGroups(input) {
|
|
1147
|
+
if (!input.includes(":(")) return input;
|
|
1148
|
+
const out = [];
|
|
1149
|
+
for (const token of splitTopLevel(input)) expandToken(token, "", false, out);
|
|
1150
|
+
return out.join(" ");
|
|
1151
|
+
}
|
|
1152
|
+
function splitTopLevel(s) {
|
|
1153
|
+
const parts = [];
|
|
1154
|
+
let depth = 0;
|
|
1155
|
+
let start = -1;
|
|
1156
|
+
for (let i = 0; i < s.length; i++) {
|
|
1157
|
+
const ch = s[i];
|
|
1158
|
+
if (ch === "(" || ch === "[") depth++;
|
|
1159
|
+
else if (ch === ")" || ch === "]") depth--;
|
|
1160
|
+
const space = /\s/.test(ch);
|
|
1161
|
+
if (space && depth <= 0) {
|
|
1162
|
+
if (start >= 0) {
|
|
1163
|
+
parts.push(s.slice(start, i));
|
|
1164
|
+
start = -1;
|
|
1165
|
+
}
|
|
1166
|
+
depth = Math.max(depth, 0);
|
|
1167
|
+
} else if (start < 0 && !space) {
|
|
1168
|
+
start = i;
|
|
1169
|
+
}
|
|
1170
|
+
}
|
|
1171
|
+
if (start >= 0) parts.push(s.slice(start));
|
|
1172
|
+
return parts;
|
|
1173
|
+
}
|
|
1174
|
+
function groupOpen(token) {
|
|
1175
|
+
let brackets = 0;
|
|
1176
|
+
for (let i = 0; i < token.length; i++) {
|
|
1177
|
+
const ch = token[i];
|
|
1178
|
+
if (ch === "[") brackets++;
|
|
1179
|
+
else if (ch === "]") brackets--;
|
|
1180
|
+
else if (ch === "(" && brackets === 0 && i > 1 && token[i - 1] === ":") return i;
|
|
1181
|
+
}
|
|
1182
|
+
return -1;
|
|
1183
|
+
}
|
|
1184
|
+
function groupClose(token, open) {
|
|
1185
|
+
let depth = 0;
|
|
1186
|
+
for (let i = open; i < token.length; i++) {
|
|
1187
|
+
const ch = token[i];
|
|
1188
|
+
if (ch === "(" || ch === "[") depth++;
|
|
1189
|
+
else if (ch === ")" || ch === "]") {
|
|
1190
|
+
depth--;
|
|
1191
|
+
if (depth === 0) return ch === ")" ? i : -1;
|
|
1192
|
+
}
|
|
1193
|
+
}
|
|
1194
|
+
return -1;
|
|
1195
|
+
}
|
|
1196
|
+
function pushClass(prefix, cls, important, out) {
|
|
1197
|
+
if (!cls) return;
|
|
1198
|
+
const bare = cls.split(":").pop() ?? cls;
|
|
1199
|
+
out.push(prefix + cls + (important && !cls.endsWith("!") && !bare.startsWith("!") ? "!" : ""));
|
|
1200
|
+
}
|
|
1201
|
+
function expandToken(token, prefix, important, out) {
|
|
1202
|
+
const open = groupOpen(token);
|
|
1203
|
+
if (open < 0) return pushClass(prefix, token, important, out);
|
|
1204
|
+
const close = groupClose(token, open);
|
|
1205
|
+
if (close < 0) return pushClass(prefix, token, important, out);
|
|
1206
|
+
const rest = token.slice(close + 1);
|
|
1207
|
+
if (rest !== "" && rest !== "!") return pushClass(prefix, token, important, out);
|
|
1208
|
+
const innerPrefix = prefix + token.slice(0, open);
|
|
1209
|
+
for (const part of splitTopLevel(token.slice(open + 1, close))) expandToken(part, innerPrefix, rest === "!" || important, out);
|
|
1210
|
+
}
|
|
1211
|
+
|
|
1145
1212
|
// src/jsEngine/shared.ts
|
|
1146
1213
|
function decl(property, value) {
|
|
1147
1214
|
return { property, value };
|
|
@@ -2441,6 +2508,7 @@ Fix: use a plain px/rem calc, a fraction utility (e.g. w-1/2), or resolve this v
|
|
|
2441
2508
|
return { value: null, warning };
|
|
2442
2509
|
}
|
|
2443
2510
|
function resolveStyleJsWithWarnings(classString, theme, colorScheme, pressed, width) {
|
|
2511
|
+
classString = expandVariantGroups(classString);
|
|
2444
2512
|
const style = {};
|
|
2445
2513
|
const warnings = [];
|
|
2446
2514
|
let shadowOffset = null;
|