@tamagui/native-registry 3.0.0-beta.643.1 → 3.0.0-beta.647.1
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/cjs/processStyleColors.cjs +10 -1
- package/dist/cjs/processStyleColors.native.cjs +10 -1
- package/dist/cjs/processStyleColors.native.js +10 -1
- package/dist/cjs/processStyleColors.native.js.map +1 -1
- package/dist/esm/processStyleColors.mjs +10 -1
- package/dist/esm/processStyleColors.mjs.map +1 -1
- package/dist/esm/processStyleColors.native.js +10 -1
- package/dist/esm/processStyleColors.native.js.map +1 -1
- package/package.json +2 -2
- package/src/processStyleColors.ts +25 -5
- package/types/processStyleColors.d.ts.map +2 -2
|
@@ -49,7 +49,16 @@ function processStyleColors(props) {
|
|
|
49
49
|
if (COLOR_PROPS.has(key) && typeof value === "string") {
|
|
50
50
|
out ??= { ...props };
|
|
51
51
|
const processed = (0, import_react_native.processColor)(value);
|
|
52
|
-
if (processed
|
|
52
|
+
if (typeof processed === "number") {
|
|
53
|
+
out[key] = [
|
|
54
|
+
(processed >>> 16 & 255) / 255,
|
|
55
|
+
(processed >>> 8 & 255) / 255,
|
|
56
|
+
(processed & 255) / 255,
|
|
57
|
+
(processed >>> 24 & 255) / 255
|
|
58
|
+
];
|
|
59
|
+
} else if (processed != null) {
|
|
60
|
+
out[key] = processed;
|
|
61
|
+
}
|
|
53
62
|
}
|
|
54
63
|
}
|
|
55
64
|
return out ?? props;
|
|
@@ -51,7 +51,16 @@ function processStyleColors(props) {
|
|
|
51
51
|
if (COLOR_PROPS.has(key) && typeof value === "string") {
|
|
52
52
|
out !== null && out !== void 0 ? out : out = { ...props };
|
|
53
53
|
var processed = (0, import_react_native.processColor)(value);
|
|
54
|
-
if (processed
|
|
54
|
+
if (typeof processed === "number") {
|
|
55
|
+
out[key] = [
|
|
56
|
+
(processed >>> 16 & 255) / 255,
|
|
57
|
+
(processed >>> 8 & 255) / 255,
|
|
58
|
+
(processed & 255) / 255,
|
|
59
|
+
(processed >>> 24 & 255) / 255
|
|
60
|
+
];
|
|
61
|
+
} else if (processed != null) {
|
|
62
|
+
out[key] = processed;
|
|
63
|
+
}
|
|
55
64
|
}
|
|
56
65
|
}
|
|
57
66
|
return out !== null && out !== void 0 ? out : props;
|
|
@@ -51,7 +51,16 @@ function processStyleColors(props) {
|
|
|
51
51
|
if (COLOR_PROPS.has(key) && typeof value === "string") {
|
|
52
52
|
out !== null && out !== void 0 ? out : out = { ...props };
|
|
53
53
|
var processed = (0, import_react_native.processColor)(value);
|
|
54
|
-
if (processed
|
|
54
|
+
if (typeof processed === "number") {
|
|
55
|
+
out[key] = [
|
|
56
|
+
(processed >>> 16 & 255) / 255,
|
|
57
|
+
(processed >>> 8 & 255) / 255,
|
|
58
|
+
(processed & 255) / 255,
|
|
59
|
+
(processed >>> 24 & 255) / 255
|
|
60
|
+
];
|
|
61
|
+
} else if (processed != null) {
|
|
62
|
+
out[key] = processed;
|
|
63
|
+
}
|
|
55
64
|
}
|
|
56
65
|
}
|
|
57
66
|
return out !== null && out !== void 0 ? out : props;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"processStyleColors.native.js","names":[],"sources":["cjs/processStyleColors.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar processStyleColors_exports = {};\n__export(processStyleColors_exports, {\n processStyleColors: () => processStyleColors\n});\nmodule.exports = __toCommonJS(processStyleColors_exports);\nvar import_react_native = require(\"react-native\");\nvar COLOR_PROPS = /* @__PURE__ */ new Set([\n \"color\",\n \"backgroundColor\",\n \"borderColor\",\n \"borderTopColor\",\n \"borderBottomColor\",\n \"borderLeftColor\",\n \"borderRightColor\",\n \"borderStartColor\",\n \"borderEndColor\",\n \"borderBlockColor\",\n \"borderBlockStartColor\",\n \"borderBlockEndColor\",\n \"shadowColor\",\n \"textShadowColor\",\n \"textDecorationColor\",\n \"tintColor\",\n \"overlayColor\"\n]);\nfunction processStyleColors(props) {\n var out = null;\n for (var key in props) {\n var value = props[key];\n if (COLOR_PROPS.has(key) && typeof value === \"string\") {\n out !== null && out !== void 0 ? out : out = {\n ...props\n };\n var processed = (0, import_react_native.processColor)(value);\n if (processed != null) out[key] = processed;\n }\n }\n return out !== null && out !== void 0 ? out : props;\n}\n//# sourceMappingURL=processStyleColors.js.map\n"],"mappings":";;;;AACA,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC9B,KAAK,IAAI,QAAQ,KACf,UAAU,QAAQ,MAAM;EAAE,KAAK,IAAI;EAAO,YAAY;CAAK,CAAC;AAChE;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;GAAE,WAAW,KAAK;GAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAAW,CAAC;CACvH;CACA,OAAO;AACT;AACA,IAAI,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;AACzF,IAAI,6BAA6B,CAAC;AAClC,SAAS,4BAA4B,EACnC,0BAA0B,mBAC5B,CAAC;AACD,OAAO,UAAU,aAAa,0BAA0B;AACxD,IAAI,sBAAsB,QAAQ,cAAc;AAChD,IAAI,8BAA8B,IAAI,IAAI;CACxC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;AACD,SAAS,mBAAmB,OAAO;CACjC,IAAI,MAAM;CACV,KAAK,IAAI,OAAO,OAAO;EACrB,IAAI,QAAQ,MAAM;EAClB,IAAI,YAAY,IAAI,GAAG,KAAK,OAAO,UAAU,UAAU;GACrD,QAAQ,QAAQ,QAAQ,KAAK,IAAI,MAAM,MAAM,EAC3C,GAAG,MACL;GACA,IAAI,aAAa,GAAG,oBAAoB,cAAc,KAAK;GAC3D,IAAI,aAAa,MAAM,IAAI,OAAO;
|
|
1
|
+
{"version":3,"file":"processStyleColors.native.js","names":[],"sources":["cjs/processStyleColors.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar processStyleColors_exports = {};\n__export(processStyleColors_exports, {\n processStyleColors: () => processStyleColors\n});\nmodule.exports = __toCommonJS(processStyleColors_exports);\nvar import_react_native = require(\"react-native\");\nvar COLOR_PROPS = /* @__PURE__ */ new Set([\n \"color\",\n \"backgroundColor\",\n \"borderColor\",\n \"borderTopColor\",\n \"borderBottomColor\",\n \"borderLeftColor\",\n \"borderRightColor\",\n \"borderStartColor\",\n \"borderEndColor\",\n \"borderBlockColor\",\n \"borderBlockStartColor\",\n \"borderBlockEndColor\",\n \"shadowColor\",\n \"textShadowColor\",\n \"textDecorationColor\",\n \"tintColor\",\n \"overlayColor\"\n]);\nfunction processStyleColors(props) {\n var out = null;\n for (var key in props) {\n var value = props[key];\n if (COLOR_PROPS.has(key) && typeof value === \"string\") {\n out !== null && out !== void 0 ? out : out = {\n ...props\n };\n var processed = (0, import_react_native.processColor)(value);\n if (typeof processed === \"number\") {\n out[key] = [\n (processed >>> 16 & 255) / 255,\n (processed >>> 8 & 255) / 255,\n (processed & 255) / 255,\n (processed >>> 24 & 255) / 255\n ];\n } else if (processed != null) {\n out[key] = processed;\n }\n }\n }\n return out !== null && out !== void 0 ? out : props;\n}\n//# sourceMappingURL=processStyleColors.js.map\n"],"mappings":";;;;AACA,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC9B,KAAK,IAAI,QAAQ,KACf,UAAU,QAAQ,MAAM;EAAE,KAAK,IAAI;EAAO,YAAY;CAAK,CAAC;AAChE;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;GAAE,WAAW,KAAK;GAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAAW,CAAC;CACvH;CACA,OAAO;AACT;AACA,IAAI,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;AACzF,IAAI,6BAA6B,CAAC;AAClC,SAAS,4BAA4B,EACnC,0BAA0B,mBAC5B,CAAC;AACD,OAAO,UAAU,aAAa,0BAA0B;AACxD,IAAI,sBAAsB,QAAQ,cAAc;AAChD,IAAI,8BAA8B,IAAI,IAAI;CACxC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;AACD,SAAS,mBAAmB,OAAO;CACjC,IAAI,MAAM;CACV,KAAK,IAAI,OAAO,OAAO;EACrB,IAAI,QAAQ,MAAM;EAClB,IAAI,YAAY,IAAI,GAAG,KAAK,OAAO,UAAU,UAAU;GACrD,QAAQ,QAAQ,QAAQ,KAAK,IAAI,MAAM,MAAM,EAC3C,GAAG,MACL;GACA,IAAI,aAAa,GAAG,oBAAoB,cAAc,KAAK;GAC3D,IAAI,OAAO,cAAc,UAAU;IACjC,IAAI,OAAO;MACR,cAAc,KAAK,OAAO;MAC1B,cAAc,IAAI,OAAO;MACzB,YAAY,OAAO;MACnB,cAAc,KAAK,OAAO;IAC7B;GACF,OAAO,IAAI,aAAa,MAAM;IAC5B,IAAI,OAAO;GACb;EACF;CACF;CACA,OAAO,QAAQ,QAAQ,QAAQ,KAAK,IAAI,MAAM;AAChD"}
|
|
@@ -26,7 +26,16 @@ function processStyleColors(props) {
|
|
|
26
26
|
if (COLOR_PROPS.has(key) && typeof value === "string") {
|
|
27
27
|
out ??= { ...props };
|
|
28
28
|
const processed = processColor(value);
|
|
29
|
-
if (processed
|
|
29
|
+
if (typeof processed === "number") {
|
|
30
|
+
out[key] = [
|
|
31
|
+
(processed >>> 16 & 255) / 255,
|
|
32
|
+
(processed >>> 8 & 255) / 255,
|
|
33
|
+
(processed & 255) / 255,
|
|
34
|
+
(processed >>> 24 & 255) / 255
|
|
35
|
+
];
|
|
36
|
+
} else if (processed != null) {
|
|
37
|
+
out[key] = processed;
|
|
38
|
+
}
|
|
30
39
|
}
|
|
31
40
|
}
|
|
32
41
|
return out ?? props;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"processStyleColors.js","names":[],"sources":["esm/processStyleColors.js"],"sourcesContent":["import { processColor } from \"react-native-web\";\nconst COLOR_PROPS = /* @__PURE__ */ new Set([\n \"color\",\n \"backgroundColor\",\n \"borderColor\",\n \"borderTopColor\",\n \"borderBottomColor\",\n \"borderLeftColor\",\n \"borderRightColor\",\n \"borderStartColor\",\n \"borderEndColor\",\n \"borderBlockColor\",\n \"borderBlockStartColor\",\n \"borderBlockEndColor\",\n \"shadowColor\",\n \"textShadowColor\",\n \"textDecorationColor\",\n \"tintColor\",\n \"overlayColor\"\n]);\nfunction processStyleColors(props) {\n let out = null;\n for (const key in props) {\n const value = props[key];\n if (COLOR_PROPS.has(key) && typeof value === \"string\") {\n out ??= { ...props };\n const processed = processColor(value);\n if (processed != null) out[key] = processed;\n }\n }\n return out ?? props;\n}\nexport {\n processStyleColors\n};\n//# sourceMappingURL=processStyleColors.js.map\n"],"mappings":";;;AACA,MAAM,8BAA8B,IAAI,IAAI;CAC1C;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;AACD,SAAS,mBAAmB,OAAO;CACjC,IAAI,MAAM;CACV,KAAK,MAAM,OAAO,OAAO;EACvB,MAAM,QAAQ,MAAM;EACpB,IAAI,YAAY,IAAI,GAAG,KAAK,OAAO,UAAU,UAAU;GACrD,QAAQ,EAAE,GAAG,MAAM;GACnB,MAAM,YAAY,aAAa,KAAK;GACpC,IAAI,aAAa,MAAM,IAAI,OAAO;
|
|
1
|
+
{"version":3,"file":"processStyleColors.js","names":[],"sources":["esm/processStyleColors.js"],"sourcesContent":["import { processColor } from \"react-native-web\";\nconst COLOR_PROPS = /* @__PURE__ */ new Set([\n \"color\",\n \"backgroundColor\",\n \"borderColor\",\n \"borderTopColor\",\n \"borderBottomColor\",\n \"borderLeftColor\",\n \"borderRightColor\",\n \"borderStartColor\",\n \"borderEndColor\",\n \"borderBlockColor\",\n \"borderBlockStartColor\",\n \"borderBlockEndColor\",\n \"shadowColor\",\n \"textShadowColor\",\n \"textDecorationColor\",\n \"tintColor\",\n \"overlayColor\"\n]);\nfunction processStyleColors(props) {\n let out = null;\n for (const key in props) {\n const value = props[key];\n if (COLOR_PROPS.has(key) && typeof value === \"string\") {\n out ??= { ...props };\n const processed = processColor(value);\n if (typeof processed === \"number\") {\n out[key] = [\n (processed >>> 16 & 255) / 255,\n (processed >>> 8 & 255) / 255,\n (processed & 255) / 255,\n (processed >>> 24 & 255) / 255\n ];\n } else if (processed != null) {\n out[key] = processed;\n }\n }\n }\n return out ?? props;\n}\nexport {\n processStyleColors\n};\n//# sourceMappingURL=processStyleColors.js.map\n"],"mappings":";;;AACA,MAAM,8BAA8B,IAAI,IAAI;CAC1C;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;AACD,SAAS,mBAAmB,OAAO;CACjC,IAAI,MAAM;CACV,KAAK,MAAM,OAAO,OAAO;EACvB,MAAM,QAAQ,MAAM;EACpB,IAAI,YAAY,IAAI,GAAG,KAAK,OAAO,UAAU,UAAU;GACrD,QAAQ,EAAE,GAAG,MAAM;GACnB,MAAM,YAAY,aAAa,KAAK;GACpC,IAAI,OAAO,cAAc,UAAU;IACjC,IAAI,OAAO;MACR,cAAc,KAAK,OAAO;MAC1B,cAAc,IAAI,OAAO;MACzB,YAAY,OAAO;MACnB,cAAc,KAAK,OAAO;IAC7B;GACF,OAAO,IAAI,aAAa,MAAM;IAC5B,IAAI,OAAO;GACb;EACF;CACF;CACA,OAAO,OAAO;AAChB"}
|
|
@@ -26,7 +26,16 @@ function processStyleColors(props) {
|
|
|
26
26
|
if (COLOR_PROPS.has(key) && typeof value === "string") {
|
|
27
27
|
out !== null && out !== void 0 ? out : out = { ...props };
|
|
28
28
|
var processed = processColor(value);
|
|
29
|
-
if (processed
|
|
29
|
+
if (typeof processed === "number") {
|
|
30
|
+
out[key] = [
|
|
31
|
+
(processed >>> 16 & 255) / 255,
|
|
32
|
+
(processed >>> 8 & 255) / 255,
|
|
33
|
+
(processed & 255) / 255,
|
|
34
|
+
(processed >>> 24 & 255) / 255
|
|
35
|
+
];
|
|
36
|
+
} else if (processed != null) {
|
|
37
|
+
out[key] = processed;
|
|
38
|
+
}
|
|
30
39
|
}
|
|
31
40
|
}
|
|
32
41
|
return out !== null && out !== void 0 ? out : props;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"processStyleColors.native.js","names":[],"sources":["esm/processStyleColors.native.js"],"sourcesContent":["import { processColor } from \"react-native\";\nvar COLOR_PROPS = /* @__PURE__ */ new Set([\n \"color\",\n \"backgroundColor\",\n \"borderColor\",\n \"borderTopColor\",\n \"borderBottomColor\",\n \"borderLeftColor\",\n \"borderRightColor\",\n \"borderStartColor\",\n \"borderEndColor\",\n \"borderBlockColor\",\n \"borderBlockStartColor\",\n \"borderBlockEndColor\",\n \"shadowColor\",\n \"textShadowColor\",\n \"textDecorationColor\",\n \"tintColor\",\n \"overlayColor\"\n]);\nfunction processStyleColors(props) {\n var out = null;\n for (var key in props) {\n var value = props[key];\n if (COLOR_PROPS.has(key) && typeof value === \"string\") {\n out !== null && out !== void 0 ? out : out = {\n ...props\n };\n var processed = processColor(value);\n if (processed != null) out[key] = processed;\n }\n }\n return out !== null && out !== void 0 ? out : props;\n}\nexport {\n processStyleColors\n};\n//# sourceMappingURL=processStyleColors.js.map\n"],"mappings":";;;AACA,IAAI,8BAA8B,IAAI,IAAI;CACxC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;AACD,SAAS,mBAAmB,OAAO;CACjC,IAAI,MAAM;CACV,KAAK,IAAI,OAAO,OAAO;EACrB,IAAI,QAAQ,MAAM;EAClB,IAAI,YAAY,IAAI,GAAG,KAAK,OAAO,UAAU,UAAU;GACrD,QAAQ,QAAQ,QAAQ,KAAK,IAAI,MAAM,MAAM,EAC3C,GAAG,MACL;GACA,IAAI,YAAY,aAAa,KAAK;GAClC,IAAI,aAAa,MAAM,IAAI,OAAO;
|
|
1
|
+
{"version":3,"file":"processStyleColors.native.js","names":[],"sources":["esm/processStyleColors.native.js"],"sourcesContent":["import { processColor } from \"react-native\";\nvar COLOR_PROPS = /* @__PURE__ */ new Set([\n \"color\",\n \"backgroundColor\",\n \"borderColor\",\n \"borderTopColor\",\n \"borderBottomColor\",\n \"borderLeftColor\",\n \"borderRightColor\",\n \"borderStartColor\",\n \"borderEndColor\",\n \"borderBlockColor\",\n \"borderBlockStartColor\",\n \"borderBlockEndColor\",\n \"shadowColor\",\n \"textShadowColor\",\n \"textDecorationColor\",\n \"tintColor\",\n \"overlayColor\"\n]);\nfunction processStyleColors(props) {\n var out = null;\n for (var key in props) {\n var value = props[key];\n if (COLOR_PROPS.has(key) && typeof value === \"string\") {\n out !== null && out !== void 0 ? out : out = {\n ...props\n };\n var processed = processColor(value);\n if (typeof processed === \"number\") {\n out[key] = [\n (processed >>> 16 & 255) / 255,\n (processed >>> 8 & 255) / 255,\n (processed & 255) / 255,\n (processed >>> 24 & 255) / 255\n ];\n } else if (processed != null) {\n out[key] = processed;\n }\n }\n }\n return out !== null && out !== void 0 ? out : props;\n}\nexport {\n processStyleColors\n};\n//# sourceMappingURL=processStyleColors.js.map\n"],"mappings":";;;AACA,IAAI,8BAA8B,IAAI,IAAI;CACxC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;AACD,SAAS,mBAAmB,OAAO;CACjC,IAAI,MAAM;CACV,KAAK,IAAI,OAAO,OAAO;EACrB,IAAI,QAAQ,MAAM;EAClB,IAAI,YAAY,IAAI,GAAG,KAAK,OAAO,UAAU,UAAU;GACrD,QAAQ,QAAQ,QAAQ,KAAK,IAAI,MAAM,MAAM,EAC3C,GAAG,MACL;GACA,IAAI,YAAY,aAAa,KAAK;GAClC,IAAI,OAAO,cAAc,UAAU;IACjC,IAAI,OAAO;MACR,cAAc,KAAK,OAAO;MAC1B,cAAc,IAAI,OAAO;MACzB,YAAY,OAAO;MACnB,cAAc,KAAK,OAAO;IAC7B;GACF,OAAO,IAAI,aAAa,MAAM;IAC5B,IAAI,OAAO;GACb;EACF;CACF;CACA,OAAO,QAAQ,QAAQ,QAAQ,KAAK,IAAI,MAAM;AAChD"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/native-registry",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.647.1",
|
|
4
4
|
"description": "Generic native style registry: zero-re-render style updates via Fabric ShadowTree commits",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
}
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
|
-
"@tamagui/build": "3.0.0-beta.
|
|
48
|
+
"@tamagui/build": "3.0.0-beta.647.1",
|
|
49
49
|
"react": ">=19",
|
|
50
50
|
"react-native": "0.86.2",
|
|
51
51
|
"react-native-nitro-modules": "^0.36.5",
|
|
@@ -1,8 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Fabric's C++ prop parser
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
2
|
+
* Fabric's C++ prop parser cannot take colors as CSS strings, so every color
|
|
3
|
+
* prop must be converted before props reach the engine. The compiler mappings
|
|
4
|
+
* and runtime-mode pushes both use this exact runtime processor before props
|
|
5
|
+
* cross into the engine.
|
|
6
|
+
*
|
|
7
|
+
* Colors go over as `[r, g, b, a]` floats in 0..1, not as the packed ARGB int
|
|
8
|
+
* `processColor` returns. Both forms are accepted by Fabric
|
|
9
|
+
* (`fromRawValueShared`), but the int form is misread through this path: an
|
|
10
|
+
* opaque grey `0xFFE3E3E3` rendered as `rgb(254, 229, 229)`, taking `0xFF` as
|
|
11
|
+
* red and the real red as alpha, so every themed surface in an app came out
|
|
12
|
+
* tinted pink. The float branch carries each channel in its own array slot, so
|
|
13
|
+
* there is no packing for the parser to disagree about.
|
|
6
14
|
*/
|
|
7
15
|
import { processColor } from 'react-native'
|
|
8
16
|
|
|
@@ -35,7 +43,19 @@ export function processStyleColors(
|
|
|
35
43
|
if (COLOR_PROPS.has(key) && typeof value === 'string') {
|
|
36
44
|
out ??= { ...props }
|
|
37
45
|
const processed = processColor(value)
|
|
38
|
-
|
|
46
|
+
// a platform color resolves to an opaque object rather than a number, and
|
|
47
|
+
// Fabric unpacks that shape itself, so it goes over untouched
|
|
48
|
+
if (typeof processed === 'number') {
|
|
49
|
+
// processColor packs ARGB, and is signed on Android, hence >>>
|
|
50
|
+
out[key] = [
|
|
51
|
+
((processed >>> 16) & 0xff) / 255,
|
|
52
|
+
((processed >>> 8) & 0xff) / 255,
|
|
53
|
+
(processed & 0xff) / 255,
|
|
54
|
+
((processed >>> 24) & 0xff) / 255,
|
|
55
|
+
]
|
|
56
|
+
} else if (processed != null) {
|
|
57
|
+
out[key] = processed
|
|
58
|
+
}
|
|
39
59
|
}
|
|
40
60
|
}
|
|
41
61
|
return out ?? props
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
|
-
"mappings": "
|
|
2
|
+
"mappings": "AAoCA,OAAO,iBAAS,mBACd,OAAO,0BACN",
|
|
3
3
|
"names": [],
|
|
4
4
|
"sources": [
|
|
5
5
|
"src/processStyleColors.ts"
|
|
6
6
|
],
|
|
7
7
|
"version": 3,
|
|
8
8
|
"sourcesContent": [
|
|
9
|
-
"/**\n * Fabric's C++ prop parser
|
|
9
|
+
"/**\n * Fabric's C++ prop parser cannot take colors as CSS strings, so every color\n * prop must be converted before props reach the engine. The compiler mappings\n * and runtime-mode pushes both use this exact runtime processor before props\n * cross into the engine.\n *\n * Colors go over as `[r, g, b, a]` floats in 0..1, not as the packed ARGB int\n * `processColor` returns. Both forms are accepted by Fabric\n * (`fromRawValueShared`), but the int form is misread through this path: an\n * opaque grey `0xFFE3E3E3` rendered as `rgb(254, 229, 229)`, taking `0xFF` as\n * red and the real red as alpha, so every themed surface in an app came out\n * tinted pink. The float branch carries each channel in its own array slot, so\n * there is no packing for the parser to disagree about.\n */\nimport { processColor } from 'react-native'\n\nconst COLOR_PROPS = new Set([\n 'color',\n 'backgroundColor',\n 'borderColor',\n 'borderTopColor',\n 'borderBottomColor',\n 'borderLeftColor',\n 'borderRightColor',\n 'borderStartColor',\n 'borderEndColor',\n 'borderBlockColor',\n 'borderBlockStartColor',\n 'borderBlockEndColor',\n 'shadowColor',\n 'textShadowColor',\n 'textDecorationColor',\n 'tintColor',\n 'overlayColor',\n])\n\nexport function processStyleColors(\n props: Record<string, unknown>\n): Record<string, unknown> {\n let out: Record<string, unknown> | null = null\n for (const key in props) {\n const value = props[key]\n if (COLOR_PROPS.has(key) && typeof value === 'string') {\n out ??= { ...props }\n const processed = processColor(value)\n // a platform color resolves to an opaque object rather than a number, and\n // Fabric unpacks that shape itself, so it goes over untouched\n if (typeof processed === 'number') {\n // processColor packs ARGB, and is signed on Android, hence >>>\n out[key] = [\n ((processed >>> 16) & 0xff) / 255,\n ((processed >>> 8) & 0xff) / 255,\n (processed & 0xff) / 255,\n ((processed >>> 24) & 0xff) / 255,\n ]\n } else if (processed != null) {\n out[key] = processed\n }\n }\n }\n return out ?? props\n}\n"
|
|
10
10
|
]
|
|
11
11
|
}
|