UNPKG

one

Version:

One is a React framework for web, iOS, and Android apps.

32 lines (29 loc) • 2.4 kB
import { processColor } from "react-native"; import { serializeCurve } from "./curves.native.js"; import { DEFAULT_CURVE } from "./normalize.native.js"; function resolveVeilColor(color) { if (color == null) return 0; var processed = processColor(color); return typeof processed === "number" ? processed : 0; } function resolveNativeProps(resolved, radius) { var _ref, _ref1, _ref2, _ref3, _ref4, _ref5, _ref6, _ref7; var _resolved_top, _resolved_bottom, _resolved_left, _resolved_right, _resolved_top1, _resolved_bottom1, _resolved_left1, _resolved_right1; return { fadeTop: (_ref = (_resolved_top = resolved.top) === null || _resolved_top === void 0 ? void 0 : _resolved_top.size) !== null && _ref !== void 0 ? _ref : 0, fadeBottom: (_ref1 = (_resolved_bottom = resolved.bottom) === null || _resolved_bottom === void 0 ? void 0 : _resolved_bottom.size) !== null && _ref1 !== void 0 ? _ref1 : 0, fadeLeft: (_ref2 = (_resolved_left = resolved.left) === null || _resolved_left === void 0 ? void 0 : _resolved_left.size) !== null && _ref2 !== void 0 ? _ref2 : 0, fadeRight: (_ref3 = (_resolved_right = resolved.right) === null || _resolved_right === void 0 ? void 0 : _resolved_right.size) !== null && _ref3 !== void 0 ? _ref3 : 0, curveTop: serializeCurve((_ref4 = (_resolved_top1 = resolved.top) === null || _resolved_top1 === void 0 ? void 0 : _resolved_top1.curve) !== null && _ref4 !== void 0 ? _ref4 : DEFAULT_CURVE), curveBottom: serializeCurve((_ref5 = (_resolved_bottom1 = resolved.bottom) === null || _resolved_bottom1 === void 0 ? void 0 : _resolved_bottom1.curve) !== null && _ref5 !== void 0 ? _ref5 : DEFAULT_CURVE), curveLeft: serializeCurve((_ref6 = (_resolved_left1 = resolved.left) === null || _resolved_left1 === void 0 ? void 0 : _resolved_left1.curve) !== null && _ref6 !== void 0 ? _ref6 : DEFAULT_CURVE), curveRight: serializeCurve((_ref7 = (_resolved_right1 = resolved.right) === null || _resolved_right1 === void 0 ? void 0 : _resolved_right1.curve) !== null && _ref7 !== void 0 ? _ref7 : DEFAULT_CURVE), fadeRadius: radius !== null && radius !== void 0 ? radius : 0, mode: resolved.mode, blurRadius: resolved.blurRadius, frostProgression: resolved.frostProgression, overlayColor: resolved.mode === "blur" ? resolveVeilColor(resolved.color) : 0 }; } export { resolveNativeProps, resolveVeilColor }; //# sourceMappingURL=nativeProps.native.js.map