@kbach/react-native 1.0.0-beta.11 → 1.0.0-beta.12
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-3LNPXJEW.mjs +192 -0
- package/dist/{chunk-5MU6PEXV.mjs → chunk-7AIH5MXY.mjs} +1 -1
- package/dist/{chunk-XHL653X2.mjs → chunk-MGXMALPC.mjs} +31 -3
- package/dist/{chunk-YOC3SHF5.mjs → chunk-OJIFXMLD.mjs} +1 -1
- package/dist/index.js +31 -3
- package/dist/index.mjs +1 -1
- package/dist/index.web.js +1 -1
- package/dist/index.web.mjs +1 -1
- package/dist/jsx-dev-runtime.js +31 -3
- package/dist/jsx-dev-runtime.mjs +2 -2
- package/dist/jsx-dev-runtime.web.js +1 -1
- package/dist/jsx-dev-runtime.web.mjs +2 -2
- package/dist/jsx-runtime.js +31 -3
- package/dist/jsx-runtime.mjs +2 -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-H5Z24XX5.mjs +0 -192
package/dist/index.web.mjs
CHANGED
package/dist/jsx-dev-runtime.js
CHANGED
|
@@ -1112,6 +1112,36 @@ function lookupHex(theme, key) {
|
|
|
1112
1112
|
const entry = theme.colors[key];
|
|
1113
1113
|
return typeof entry === "string" ? entry : null;
|
|
1114
1114
|
}
|
|
1115
|
+
function hexToRgb(hex) {
|
|
1116
|
+
const m = /^#([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(hex.trim());
|
|
1117
|
+
if (!m) return null;
|
|
1118
|
+
let h = m[1];
|
|
1119
|
+
if (h.length === 3) h = h.split("").map((c) => c + c).join("");
|
|
1120
|
+
const n = parseInt(h, 16);
|
|
1121
|
+
return [n >> 16 & 255, n >> 8 & 255, n & 255];
|
|
1122
|
+
}
|
|
1123
|
+
function splitOpacity(value) {
|
|
1124
|
+
const slash = value.lastIndexOf("/");
|
|
1125
|
+
if (slash === -1) return [value, null];
|
|
1126
|
+
const opacityText = value.slice(slash + 1);
|
|
1127
|
+
const n = Number(opacityText);
|
|
1128
|
+
if (opacityText !== "" && Number.isInteger(n) && n >= 0 && n <= 100) {
|
|
1129
|
+
return [value.slice(0, slash), n];
|
|
1130
|
+
}
|
|
1131
|
+
return [value, null];
|
|
1132
|
+
}
|
|
1133
|
+
function colorValue(theme, parsed) {
|
|
1134
|
+
const value = parsed.value;
|
|
1135
|
+
if (value === null) return null;
|
|
1136
|
+
if (parsed.isArbitrary) return value;
|
|
1137
|
+
const [name, opacity] = splitOpacity(value);
|
|
1138
|
+
const hex = lookupHex(theme, name);
|
|
1139
|
+
if (hex === null) return null;
|
|
1140
|
+
if (opacity === null) return hex;
|
|
1141
|
+
const rgb = hexToRgb(hex);
|
|
1142
|
+
if (rgb === null) return hex;
|
|
1143
|
+
return `rgba(${rgb.join(",")},${opacity / 100})`;
|
|
1144
|
+
}
|
|
1115
1145
|
|
|
1116
1146
|
// src/jsEngine/resolvers/border.ts
|
|
1117
1147
|
function radiusSize(key) {
|
|
@@ -1517,9 +1547,7 @@ function resolveLeadingTrackingNative(parsed) {
|
|
|
1517
1547
|
return null;
|
|
1518
1548
|
}
|
|
1519
1549
|
function nativeHexColor(parsed, theme) {
|
|
1520
|
-
|
|
1521
|
-
if (value === null) return null;
|
|
1522
|
-
return parsed.isArbitrary ? value : lookupHex(theme, value);
|
|
1550
|
+
return colorValue(theme, parsed);
|
|
1523
1551
|
}
|
|
1524
1552
|
function resolveTextNative(parsed, theme) {
|
|
1525
1553
|
if (!parsed.isArbitrary && parsed.value !== null) {
|