@tamagui/native-registry 3.0.0-beta.645.1 → 3.0.0-beta.649.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 +11 -1
- package/dist/cjs/processStyleColors.native.cjs +11 -1
- package/dist/cjs/processStyleColors.native.js +11 -1
- package/dist/cjs/processStyleColors.native.js.map +1 -1
- package/dist/esm/processStyleColors.mjs +11 -1
- package/dist/esm/processStyleColors.mjs.map +1 -1
- package/dist/esm/processStyleColors.native.js +11 -1
- package/dist/esm/processStyleColors.native.js.map +1 -1
- package/package.json +2 -2
- package/src/processStyleColors.ts +33 -5
- package/types/processStyleColors.d.ts.map +2 -2
|
@@ -49,7 +49,17 @@ 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
|
+
space: "srgb",
|
|
55
|
+
r: (processed >>> 16 & 255) / 255,
|
|
56
|
+
g: (processed >>> 8 & 255) / 255,
|
|
57
|
+
b: (processed & 255) / 255,
|
|
58
|
+
a: (processed >>> 24 & 255) / 255
|
|
59
|
+
};
|
|
60
|
+
} else if (processed != null) {
|
|
61
|
+
out[key] = processed;
|
|
62
|
+
}
|
|
53
63
|
}
|
|
54
64
|
}
|
|
55
65
|
return out ?? props;
|
|
@@ -51,7 +51,17 @@ 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
|
+
space: "srgb",
|
|
57
|
+
r: (processed >>> 16 & 255) / 255,
|
|
58
|
+
g: (processed >>> 8 & 255) / 255,
|
|
59
|
+
b: (processed & 255) / 255,
|
|
60
|
+
a: (processed >>> 24 & 255) / 255
|
|
61
|
+
};
|
|
62
|
+
} else if (processed != null) {
|
|
63
|
+
out[key] = processed;
|
|
64
|
+
}
|
|
55
65
|
}
|
|
56
66
|
}
|
|
57
67
|
return out !== null && out !== void 0 ? out : props;
|
|
@@ -51,7 +51,17 @@ 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
|
+
space: "srgb",
|
|
57
|
+
r: (processed >>> 16 & 255) / 255,
|
|
58
|
+
g: (processed >>> 8 & 255) / 255,
|
|
59
|
+
b: (processed & 255) / 255,
|
|
60
|
+
a: (processed >>> 24 & 255) / 255
|
|
61
|
+
};
|
|
62
|
+
} else if (processed != null) {
|
|
63
|
+
out[key] = processed;
|
|
64
|
+
}
|
|
55
65
|
}
|
|
56
66
|
}
|
|
57
67
|
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 space: \"srgb\",\n r: (processed >>> 16 & 255) / 255,\n g: (processed >>> 8 & 255) / 255,\n b: (processed & 255) / 255,\n a: (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;KACT,OAAO;KACP,IAAI,cAAc,KAAK,OAAO;KAC9B,IAAI,cAAc,IAAI,OAAO;KAC7B,IAAI,YAAY,OAAO;KACvB,IAAI,cAAc,KAAK,OAAO;IAChC;GACF,OAAO,IAAI,aAAa,MAAM;IAC5B,IAAI,OAAO;GACb;EACF;CACF;CACA,OAAO,QAAQ,QAAQ,QAAQ,KAAK,IAAI,MAAM;AAChD"}
|
|
@@ -26,7 +26,17 @@ 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
|
+
space: "srgb",
|
|
32
|
+
r: (processed >>> 16 & 255) / 255,
|
|
33
|
+
g: (processed >>> 8 & 255) / 255,
|
|
34
|
+
b: (processed & 255) / 255,
|
|
35
|
+
a: (processed >>> 24 & 255) / 255
|
|
36
|
+
};
|
|
37
|
+
} else if (processed != null) {
|
|
38
|
+
out[key] = processed;
|
|
39
|
+
}
|
|
30
40
|
}
|
|
31
41
|
}
|
|
32
42
|
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 space: \"srgb\",\n r: (processed >>> 16 & 255) / 255,\n g: (processed >>> 8 & 255) / 255,\n b: (processed & 255) / 255,\n a: (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;KACT,OAAO;KACP,IAAI,cAAc,KAAK,OAAO;KAC9B,IAAI,cAAc,IAAI,OAAO;KAC7B,IAAI,YAAY,OAAO;KACvB,IAAI,cAAc,KAAK,OAAO;IAChC;GACF,OAAO,IAAI,aAAa,MAAM;IAC5B,IAAI,OAAO;GACb;EACF;CACF;CACA,OAAO,OAAO;AAChB"}
|
|
@@ -26,7 +26,17 @@ 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
|
+
space: "srgb",
|
|
32
|
+
r: (processed >>> 16 & 255) / 255,
|
|
33
|
+
g: (processed >>> 8 & 255) / 255,
|
|
34
|
+
b: (processed & 255) / 255,
|
|
35
|
+
a: (processed >>> 24 & 255) / 255
|
|
36
|
+
};
|
|
37
|
+
} else if (processed != null) {
|
|
38
|
+
out[key] = processed;
|
|
39
|
+
}
|
|
30
40
|
}
|
|
31
41
|
}
|
|
32
42
|
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 space: \"srgb\",\n r: (processed >>> 16 & 255) / 255,\n g: (processed >>> 8 & 255) / 255,\n b: (processed & 255) / 255,\n a: (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;KACT,OAAO;KACP,IAAI,cAAc,KAAK,OAAO;KAC9B,IAAI,cAAc,IAAI,OAAO;KAC7B,IAAI,YAAY,OAAO;KACvB,IAAI,cAAc,KAAK,OAAO;IAChC;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.649.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.649.1",
|
|
49
49
|
"react": ">=19",
|
|
50
50
|
"react-native": "0.86.2",
|
|
51
51
|
"react-native-nitro-modules": "^0.36.5",
|
|
@@ -1,8 +1,23 @@
|
|
|
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 `{ space: 'srgb', r, g, b, a }` with each channel a float
|
|
8
|
+
* in 0..1. That shape is the only one both prop parsers a themed view can reach
|
|
9
|
+
* will accept:
|
|
10
|
+
*
|
|
11
|
+
* - C++ `fromRawValueShared` reads it through its `space` branch. The packed
|
|
12
|
+
* ARGB int `processColor` returns is misread here: an opaque grey
|
|
13
|
+
* `0xFFE3E3E3` rendered as `rgb(254, 229, 229)`, taking `0xFF` as red and
|
|
14
|
+
* the real red as alpha, so every themed surface came out tinted pink.
|
|
15
|
+
* - Android additionally mounts some of these props through Java
|
|
16
|
+
* `SurfaceMountingManager.updateProps` -> `ColorPropConverter`, which takes
|
|
17
|
+
* a number or a map and throws `ColorValue: the value must be a number or
|
|
18
|
+
* Object` on anything else. A plain `[r, g, b, a]` array satisfies the C++
|
|
19
|
+
* parser but not this one, and the throw kills the mount-item dispatch and
|
|
20
|
+
* tears the whole React surface down.
|
|
6
21
|
*/
|
|
7
22
|
import { processColor } from 'react-native'
|
|
8
23
|
|
|
@@ -35,7 +50,20 @@ export function processStyleColors(
|
|
|
35
50
|
if (COLOR_PROPS.has(key) && typeof value === 'string') {
|
|
36
51
|
out ??= { ...props }
|
|
37
52
|
const processed = processColor(value)
|
|
38
|
-
|
|
53
|
+
// a platform color resolves to an opaque object rather than a number, and
|
|
54
|
+
// Fabric unpacks that shape itself, so it goes over untouched
|
|
55
|
+
if (typeof processed === 'number') {
|
|
56
|
+
// processColor packs ARGB, and is signed on Android, hence >>>
|
|
57
|
+
out[key] = {
|
|
58
|
+
space: 'srgb',
|
|
59
|
+
r: ((processed >>> 16) & 0xff) / 255,
|
|
60
|
+
g: ((processed >>> 8) & 0xff) / 255,
|
|
61
|
+
b: (processed & 0xff) / 255,
|
|
62
|
+
a: ((processed >>> 24) & 0xff) / 255,
|
|
63
|
+
}
|
|
64
|
+
} else if (processed != null) {
|
|
65
|
+
out[key] = processed
|
|
66
|
+
}
|
|
39
67
|
}
|
|
40
68
|
}
|
|
41
69
|
return out ?? props
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
|
-
"mappings": "
|
|
2
|
+
"mappings": "AA2CA,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 `{ space: 'srgb', r, g, b, a }` with each channel a float\n * in 0..1. That shape is the only one both prop parsers a themed view can reach\n * will accept:\n *\n * - C++ `fromRawValueShared` reads it through its `space` branch. The packed\n * ARGB int `processColor` returns is misread here: an opaque grey\n * `0xFFE3E3E3` rendered as `rgb(254, 229, 229)`, taking `0xFF` as red and\n * the real red as alpha, so every themed surface came out tinted pink.\n * - Android additionally mounts some of these props through Java\n * `SurfaceMountingManager.updateProps` -> `ColorPropConverter`, which takes\n * a number or a map and throws `ColorValue: the value must be a number or\n * Object` on anything else. A plain `[r, g, b, a]` array satisfies the C++\n * parser but not this one, and the throw kills the mount-item dispatch and\n * tears the whole React surface down.\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 space: 'srgb',\n r: ((processed >>> 16) & 0xff) / 255,\n g: ((processed >>> 8) & 0xff) / 255,\n b: (processed & 0xff) / 255,\n a: ((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
|
}
|