diff --git a/lib/commonjs/components/BlurView.android.js b/lib/commonjs/components/BlurView.android.js new file mode 100644 index 0000000..0677fc5 --- /dev/null +++ b/lib/commonjs/components/BlurView.android.js @@ -0,0 +1,108 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _react = _interopRequireWildcard(require("react")); + +var _reactNative = require("react-native"); + +var _BlurViewNativeComponentAndroid = _interopRequireDefault(require("../fabric/BlurViewNativeComponentAndroid")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } + +function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } + +function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } + +const OVERLAY_COLORS = { + light: 'rgba(255, 255, 255, 0.2)', + xlight: 'rgba(255, 255, 255, 0.75)', + dark: 'rgba(16, 12, 12, 0.64)' +}; +const BlurView = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => { + let { + downsampleFactor, + blurRadius, + blurAmount = 10, + blurType = 'dark', + overlayColor, + enabled, + autoUpdate, + children, + style, + ...rest + } = _ref; + (0, _react.useEffect)(() => { + _reactNative.DeviceEventEmitter.addListener('ReactNativeBlurError', message => { + throw new Error(`[ReactNativeBlur]: ${message}`); + }); + + return () => { + _reactNative.DeviceEventEmitter.removeAllListeners('ReactNativeBlurError'); + }; + }, []); + + const getOverlayColor = () => { + if (overlayColor != null) { + return overlayColor; + } + + return OVERLAY_COLORS[blurType] || OVERLAY_COLORS.dark; + }; + + const getBlurRadius = () => { + if (blurRadius != null) { + if (blurRadius > 25) { + throw new Error(`[ReactNativeBlur]: blurRadius cannot be greater than 25! (was: ${blurRadius})`); + } + + return blurRadius; + } // iOS seems to use a slightly different blurring algorithm (or scale?). + // Android blurRadius + downsampleFactor is approximately 80% of blurAmount. + + + const equivalentBlurRadius = Math.round(blurAmount * 0.8); + + if (equivalentBlurRadius > 25) { + return 25; + } + + return equivalentBlurRadius; + }; + + const getDownsampleFactor = () => { + if (downsampleFactor != null) { + return downsampleFactor; + } + + return blurRadius; + }; + + return /*#__PURE__*/_react.default.createElement(_BlurViewNativeComponentAndroid.default, _extends({}, rest, { + ref: ref, + blurRadius: getBlurRadius(), + downsampleFactor: getDownsampleFactor(), + overlayColor: getOverlayColor(), + blurAmount: blurAmount, + blurType: blurType, + enabled: enabled, + autoUpdate: autoUpdate, + pointerEvents: "none", + style: _reactNative.StyleSheet.compose(styles.transparent, style) + }), children); +}); + +const styles = _reactNative.StyleSheet.create({ + transparent: { + backgroundColor: 'transparent' + } +}); + +var _default = BlurView; +exports.default = _default; +//# sourceMappingURL=BlurView.android.js.map \ No newline at end of file diff --git a/lib/commonjs/components/BlurView.android.js.map b/lib/commonjs/components/BlurView.android.js.map new file mode 100644 index 0000000..8eabc39 --- /dev/null +++ b/lib/commonjs/components/BlurView.android.js.map @@ -0,0 +1 @@ +{"version":3,"names":["OVERLAY_COLORS","light","xlight","dark","BlurView","forwardRef","ref","downsampleFactor","blurRadius","blurAmount","blurType","overlayColor","enabled","autoUpdate","children","style","rest","useEffect","DeviceEventEmitter","addListener","message","Error","removeAllListeners","getOverlayColor","getBlurRadius","equivalentBlurRadius","Math","round","getDownsampleFactor","StyleSheet","compose","styles","transparent","create","backgroundColor"],"sources":["BlurView.android.tsx"],"sourcesContent":["import React, { forwardRef, useEffect } from 'react';\nimport {\n View,\n DeviceEventEmitter,\n StyleSheet,\n ViewProps,\n ViewStyle,\n} from 'react-native';\nimport NativeBlurView from '../fabric/BlurViewNativeComponentAndroid';\n\nconst OVERLAY_COLORS = {\n light: 'rgba(255, 255, 255, 0.2)',\n xlight: 'rgba(255, 255, 255, 0.75)',\n dark: 'rgba(16, 12, 12, 0.64)',\n};\n\nexport type BlurViewProps = ViewProps & {\n blurAmount?: number;\n blurType?: 'dark' | 'light' | 'xlight';\n blurRadius?: number;\n downsampleFactor?: number;\n overlayColor?: string;\n enabled?: boolean;\n autoUpdate?: boolean;\n};\n\nconst BlurView = forwardRef(\n (\n {\n downsampleFactor,\n blurRadius,\n blurAmount = 10,\n blurType = 'dark',\n overlayColor,\n enabled,\n autoUpdate,\n children,\n style,\n ...rest\n },\n ref\n ) => {\n useEffect(() => {\n DeviceEventEmitter.addListener('ReactNativeBlurError', (message) => {\n throw new Error(`[ReactNativeBlur]: ${message}`);\n });\n\n return () => {\n DeviceEventEmitter.removeAllListeners('ReactNativeBlurError');\n };\n }, []);\n\n const getOverlayColor = () => {\n if (overlayColor != null) {\n return overlayColor;\n }\n\n return OVERLAY_COLORS[blurType] || OVERLAY_COLORS.dark;\n };\n\n const getBlurRadius = () => {\n if (blurRadius != null) {\n if (blurRadius > 25) {\n throw new Error(\n `[ReactNativeBlur]: blurRadius cannot be greater than 25! (was: ${blurRadius})`\n );\n }\n return blurRadius;\n }\n\n // iOS seems to use a slightly different blurring algorithm (or scale?).\n // Android blurRadius + downsampleFactor is approximately 80% of blurAmount.\n const equivalentBlurRadius = Math.round(blurAmount * 0.8);\n\n if (equivalentBlurRadius > 25) {\n return 25;\n }\n return equivalentBlurRadius;\n };\n\n const getDownsampleFactor = () => {\n if (downsampleFactor != null) {\n return downsampleFactor;\n }\n\n return blurRadius;\n };\n\n return (\n \n {children}\n \n );\n }\n);\n\nconst styles = StyleSheet.create<{ transparent: ViewStyle }>({\n transparent: { backgroundColor: 'transparent' },\n});\n\nexport default BlurView;\n"],"mappings":";;;;;;;AAAA;;AACA;;AAOA;;;;;;;;;;AAEA,MAAMA,cAAc,GAAG;EACrBC,KAAK,EAAE,0BADc;EAErBC,MAAM,EAAE,2BAFa;EAGrBC,IAAI,EAAE;AAHe,CAAvB;AAgBA,MAAMC,QAAQ,gBAAG,IAAAC,iBAAA,EACf,OAaEC,GAbF,KAcK;EAAA,IAbH;IACEC,gBADF;IAEEC,UAFF;IAGEC,UAAU,GAAG,EAHf;IAIEC,QAAQ,GAAG,MAJb;IAKEC,YALF;IAMEC,OANF;IAOEC,UAPF;IAQEC,QARF;IASEC,KATF;IAUE,GAAGC;EAVL,CAaG;EACH,IAAAC,gBAAA,EAAU,MAAM;IACdC,+BAAA,CAAmBC,WAAnB,CAA+B,sBAA/B,EAAwDC,OAAD,IAAa;MAClE,MAAM,IAAIC,KAAJ,CAAW,sBAAqBD,OAAQ,EAAxC,CAAN;IACD,CAFD;;IAIA,OAAO,MAAM;MACXF,+BAAA,CAAmBI,kBAAnB,CAAsC,sBAAtC;IACD,CAFD;EAGD,CARD,EAQG,EARH;;EAUA,MAAMC,eAAe,GAAG,MAAM;IAC5B,IAAIZ,YAAY,IAAI,IAApB,EAA0B;MACxB,OAAOA,YAAP;IACD;;IAED,OAAOX,cAAc,CAACU,QAAD,CAAd,IAA4BV,cAAc,CAACG,IAAlD;EACD,CAND;;EAQA,MAAMqB,aAAa,GAAG,MAAM;IAC1B,IAAIhB,UAAU,IAAI,IAAlB,EAAwB;MACtB,IAAIA,UAAU,GAAG,EAAjB,EAAqB;QACnB,MAAM,IAAIa,KAAJ,CACH,kEAAiEb,UAAW,GADzE,CAAN;MAGD;;MACD,OAAOA,UAAP;IACD,CARyB,CAU1B;IACA;;;IACA,MAAMiB,oBAAoB,GAAGC,IAAI,CAACC,KAAL,CAAWlB,UAAU,GAAG,GAAxB,CAA7B;;IAEA,IAAIgB,oBAAoB,GAAG,EAA3B,EAA+B;MAC7B,OAAO,EAAP;IACD;;IACD,OAAOA,oBAAP;EACD,CAlBD;;EAoBA,MAAMG,mBAAmB,GAAG,MAAM;IAChC,IAAIrB,gBAAgB,IAAI,IAAxB,EAA8B;MAC5B,OAAOA,gBAAP;IACD;;IAED,OAAOC,UAAP;EACD,CAND;;EAQA,oBACE,6BAAC,uCAAD,eACMQ,IADN;IAEE,GAAG,EAAEV,GAFP;IAGE,UAAU,EAAEkB,aAAa,EAH3B;IAIE,gBAAgB,EAAEI,mBAAmB,EAJvC;IAKE,YAAY,EAAEL,eAAe,EAL/B;IAME,UAAU,EAAEd,UANd;IAOE,QAAQ,EAAEC,QAPZ;IAQE,OAAO,EAAEE,OARX;IASE,UAAU,EAAEC,UATd;IAUE,aAAa,EAAC,MAVhB;IAWE,KAAK,EAAEgB,uBAAA,CAAWC,OAAX,CAAmBC,MAAM,CAACC,WAA1B,EAAuCjB,KAAvC;EAXT,IAaGD,QAbH,CADF;AAiBD,CA/Ec,CAAjB;;AAkFA,MAAMiB,MAAM,GAAGF,uBAAA,CAAWI,MAAX,CAA8C;EAC3DD,WAAW,EAAE;IAAEE,eAAe,EAAE;EAAnB;AAD8C,CAA9C,CAAf;;eAIe9B,Q"} \ No newline at end of file diff --git a/lib/commonjs/components/BlurView.ios.js b/lib/commonjs/components/BlurView.ios.js new file mode 100644 index 0000000..5d88856 --- /dev/null +++ b/lib/commonjs/components/BlurView.ios.js @@ -0,0 +1,45 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _react = _interopRequireWildcard(require("react")); + +var _reactNative = require("react-native"); + +var _BlurViewNativeComponent = _interopRequireDefault(require("../fabric/BlurViewNativeComponent")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } + +function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } + +function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } + +const BlurView = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => { + let { + blurType = 'dark', + blurAmount = 10, + style, + ...rest + } = _ref; + return /*#__PURE__*/_react.default.createElement(_BlurViewNativeComponent.default, _extends({ + ref: ref, + style: _reactNative.StyleSheet.compose(styles.transparent, style), + blurType: blurType, + blurAmount: blurAmount + }, rest)); +}); + +const styles = _reactNative.StyleSheet.create({ + transparent: { + backgroundColor: 'transparent' + } +}); + +var _default = BlurView; +exports.default = _default; +//# sourceMappingURL=BlurView.ios.js.map \ No newline at end of file diff --git a/lib/commonjs/components/BlurView.ios.js.map b/lib/commonjs/components/BlurView.ios.js.map new file mode 100644 index 0000000..63d3fec --- /dev/null +++ b/lib/commonjs/components/BlurView.ios.js.map @@ -0,0 +1 @@ +{"version":3,"names":["BlurView","forwardRef","ref","blurType","blurAmount","style","rest","StyleSheet","compose","styles","transparent","create","backgroundColor"],"sources":["BlurView.ios.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport { StyleSheet, ViewProps, ViewStyle, View } from 'react-native';\nimport NativeBlurView from '../fabric/BlurViewNativeComponent';\n\ntype BlurType =\n | 'dark'\n | 'light'\n | 'xlight'\n | 'transparent'\n | 'prominent'\n | 'regular'\n | 'extraDark'\n | 'chromeMaterial'\n | 'material'\n | 'thickMaterial'\n | 'thinMaterial'\n | 'ultraThinMaterial'\n | 'chromeMaterialDark'\n | 'materialDark'\n | 'thickMaterialDark'\n | 'thinMaterialDark'\n | 'ultraThinMaterialDark'\n | 'chromeMaterialLight'\n | 'materialLight'\n | 'thickMaterialLight'\n | 'thinMaterialLight'\n | 'ultraThinMaterialLight';\n\nexport type BlurViewProps = ViewProps & {\n blurType?: BlurType;\n blurAmount?: number;\n reducedTransparencyFallbackColor?: string;\n};\n\nconst BlurView = forwardRef(\n ({ blurType = 'dark', blurAmount = 10, style, ...rest }, ref) => (\n \n )\n);\n\nconst styles = StyleSheet.create<{ transparent: ViewStyle }>({\n transparent: { backgroundColor: 'transparent' },\n});\n\nexport default BlurView;\n"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;;;;;;;;;AAgCA,MAAMA,QAAQ,gBAAG,IAAAC,iBAAA,EACf,OAAyDC,GAAzD;EAAA,IAAC;IAAEC,QAAQ,GAAG,MAAb;IAAqBC,UAAU,GAAG,EAAlC;IAAsCC,KAAtC;IAA6C,GAAGC;EAAhD,CAAD;EAAA,oBACE,6BAAC,gCAAD;IACE,GAAG,EAAEJ,GADP;IAEE,KAAK,EAAEK,uBAAA,CAAWC,OAAX,CAAmBC,MAAM,CAACC,WAA1B,EAAuCL,KAAvC,CAFT;IAGE,QAAQ,EAAEF,QAHZ;IAIE,UAAU,EAAEC;EAJd,GAKME,IALN,EADF;AAAA,CADe,CAAjB;;AAYA,MAAMG,MAAM,GAAGF,uBAAA,CAAWI,MAAX,CAA8C;EAC3DD,WAAW,EAAE;IAAEE,eAAe,EAAE;EAAnB;AAD8C,CAA9C,CAAf;;eAIeZ,Q"} \ No newline at end of file diff --git a/lib/commonjs/components/VibrancyView.android.js b/lib/commonjs/components/VibrancyView.android.js new file mode 100644 index 0000000..d179a56 --- /dev/null +++ b/lib/commonjs/components/VibrancyView.android.js @@ -0,0 +1,22 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _react = _interopRequireDefault(require("react")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +class VibrancyView extends _react.default.Component { + render() { + console.error('VibrancyView is not implemented on Android'); + return null; + } + +} + +var _default = VibrancyView; +exports.default = _default; +//# sourceMappingURL=VibrancyView.android.js.map \ No newline at end of file diff --git a/lib/commonjs/components/VibrancyView.android.js.map b/lib/commonjs/components/VibrancyView.android.js.map new file mode 100644 index 0000000..03f512f --- /dev/null +++ b/lib/commonjs/components/VibrancyView.android.js.map @@ -0,0 +1 @@ +{"version":3,"names":["VibrancyView","React","Component","render","console","error"],"sources":["VibrancyView.android.tsx"],"sourcesContent":["import React from 'react';\n\nclass VibrancyView extends React.Component {\n render() {\n console.error('VibrancyView is not implemented on Android');\n return null;\n }\n}\n\nexport default VibrancyView;\n"],"mappings":";;;;;;;AAAA;;;;AAEA,MAAMA,YAAN,SAA2BC,cAAA,CAAMC,SAAjC,CAA2C;EACzCC,MAAM,GAAG;IACPC,OAAO,CAACC,KAAR,CAAc,4CAAd;IACA,OAAO,IAAP;EACD;;AAJwC;;eAO5BL,Y"} \ No newline at end of file diff --git a/lib/commonjs/components/VibrancyView.ios.js b/lib/commonjs/components/VibrancyView.ios.js new file mode 100644 index 0000000..cd7247e --- /dev/null +++ b/lib/commonjs/components/VibrancyView.ios.js @@ -0,0 +1,41 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _react = _interopRequireWildcard(require("react")); + +var _reactNative = require("react-native"); + +var _VibrancyViewNativeComponent = _interopRequireDefault(require("../fabric/VibrancyViewNativeComponent")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } + +function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } + +function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } + +const VibrancyView = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => { + let { + style, + ...rest + } = _ref; + return /*#__PURE__*/_react.default.createElement(_VibrancyViewNativeComponent.default, _extends({}, rest, { + ref: ref, + style: _reactNative.StyleSheet.compose(styles.transparent, style) + })); +}); + +const styles = _reactNative.StyleSheet.create({ + transparent: { + backgroundColor: 'transparent' + } +}); + +var _default = VibrancyView; +exports.default = _default; +//# sourceMappingURL=VibrancyView.ios.js.map \ No newline at end of file diff --git a/lib/commonjs/components/VibrancyView.ios.js.map b/lib/commonjs/components/VibrancyView.ios.js.map new file mode 100644 index 0000000..6018825 --- /dev/null +++ b/lib/commonjs/components/VibrancyView.ios.js.map @@ -0,0 +1 @@ +{"version":3,"names":["VibrancyView","forwardRef","ref","style","rest","StyleSheet","compose","styles","transparent","create","backgroundColor"],"sources":["VibrancyView.ios.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport { StyleSheet, ViewProps, ViewStyle } from 'react-native';\nimport NativeVibrancyView from '../fabric/VibrancyViewNativeComponent';\nimport type { BlurViewProps } from './BlurView.ios';\n\nexport type VibrancyViewProps = ViewProps & {\n blurType?: BlurViewProps['blurType'];\n blurAmount: number;\n reducedTransparencyFallbackColor?: string;\n};\n\nconst VibrancyView = forwardRef(\n ({ style, ...rest }, ref) => (\n \n )\n);\n\nconst styles = StyleSheet.create<{ transparent: ViewStyle }>({\n transparent: { backgroundColor: 'transparent' },\n});\n\nexport default VibrancyView;\n"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;;;;;;;;;AASA,MAAMA,YAAY,gBAAG,IAAAC,iBAAA,EACnB,OAAqBC,GAArB;EAAA,IAAC;IAAEC,KAAF;IAAS,GAAGC;EAAZ,CAAD;EAAA,oBACE,6BAAC,oCAAD,eACMA,IADN;IAEE,GAAG,EAAEF,GAFP;IAGE,KAAK,EAAEG,uBAAA,CAAWC,OAAX,CAAmBC,MAAM,CAACC,WAA1B,EAAuCL,KAAvC;EAHT,GADF;AAAA,CADmB,CAArB;;AAUA,MAAMI,MAAM,GAAGF,uBAAA,CAAWI,MAAX,CAA8C;EAC3DD,WAAW,EAAE;IAAEE,eAAe,EAAE;EAAnB;AAD8C,CAA9C,CAAf;;eAIeV,Y"} \ No newline at end of file diff --git a/lib/commonjs/fabric/BlurViewNativeComponent.js b/lib/commonjs/fabric/BlurViewNativeComponent.js new file mode 100644 index 0000000..da600c8 --- /dev/null +++ b/lib/commonjs/fabric/BlurViewNativeComponent.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _codegenNativeComponent = _interopRequireDefault(require("react-native/Libraries/Utilities/codegenNativeComponent")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var _default = (0, _codegenNativeComponent.default)('BlurView', { + excludedPlatforms: ['android'] +}); + +exports.default = _default; +//# sourceMappingURL=BlurViewNativeComponent.js.map \ No newline at end of file diff --git a/lib/commonjs/fabric/BlurViewNativeComponent.js.map b/lib/commonjs/fabric/BlurViewNativeComponent.js.map new file mode 100644 index 0000000..5726bca --- /dev/null +++ b/lib/commonjs/fabric/BlurViewNativeComponent.js.map @@ -0,0 +1 @@ +{"version":3,"names":["codegenNativeComponent","excludedPlatforms"],"sources":["BlurViewNativeComponent.ts"],"sourcesContent":["import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';\nimport type { ViewProps, HostComponent, ColorValue } from 'react-native';\nimport type {\n WithDefault,\n Int32,\n} from 'react-native/Libraries/Types/CodegenTypes';\n\ninterface NativeProps extends ViewProps {\n blurType?: WithDefault<\n | 'dark'\n | 'light'\n | 'xlight'\n | 'transparent'\n | 'prominent'\n | 'regular'\n | 'extraDark'\n | 'chromeMaterial'\n | 'material'\n | 'thickMaterial'\n | 'thinMaterial'\n | 'ultraThinMaterial'\n | 'chromeMaterialDark'\n | 'materialDark'\n | 'thickMaterialDark'\n | 'thinMaterialDark'\n | 'ultraThinMaterialDark'\n | 'chromeMaterialLight'\n | 'materialLight'\n | 'thickMaterialLight'\n | 'thinMaterialLight'\n | 'ultraThinMaterialLight',\n 'dark'\n >;\n blurAmount?: WithDefault;\n reducedTransparencyFallbackColor?: ColorValue;\n}\n\nexport default codegenNativeComponent('BlurView', {\n excludedPlatforms: ['android'],\n}) as HostComponent;\n"],"mappings":";;;;;;;AAAA;;;;eAqCe,IAAAA,+BAAA,EAAoC,UAApC,EAAgD;EAC7DC,iBAAiB,EAAE,CAAC,SAAD;AAD0C,CAAhD,C"} \ No newline at end of file diff --git a/lib/commonjs/fabric/BlurViewNativeComponentAndroid.js b/lib/commonjs/fabric/BlurViewNativeComponentAndroid.js new file mode 100644 index 0000000..d8e75ad --- /dev/null +++ b/lib/commonjs/fabric/BlurViewNativeComponentAndroid.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _codegenNativeComponent = _interopRequireDefault(require("react-native/Libraries/Utilities/codegenNativeComponent")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var _default = (0, _codegenNativeComponent.default)('AndroidBlurView', { + excludedPlatforms: ['iOS'] +}); + +exports.default = _default; +//# sourceMappingURL=BlurViewNativeComponentAndroid.js.map \ No newline at end of file diff --git a/lib/commonjs/fabric/BlurViewNativeComponentAndroid.js.map b/lib/commonjs/fabric/BlurViewNativeComponentAndroid.js.map new file mode 100644 index 0000000..41411f9 --- /dev/null +++ b/lib/commonjs/fabric/BlurViewNativeComponentAndroid.js.map @@ -0,0 +1 @@ +{"version":3,"names":["codegenNativeComponent","excludedPlatforms"],"sources":["BlurViewNativeComponentAndroid.ts"],"sourcesContent":["import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';\nimport type { ViewProps, HostComponent, ColorValue } from 'react-native';\nimport type {\n WithDefault,\n Int32,\n} from 'react-native/Libraries/Types/CodegenTypes';\n\ninterface NativeProps extends ViewProps {\n blurAmount?: WithDefault;\n blurType?: WithDefault<'dark' | 'light' | 'xlight', 'dark'>;\n blurRadius?: Int32;\n downsampleFactor?: Int32;\n overlayColor?: ColorValue;\n enabled?: boolean;\n autoUpdate?: boolean;\n}\n\nexport default codegenNativeComponent('AndroidBlurView', {\n excludedPlatforms: ['iOS'],\n}) as HostComponent;\n"],"mappings":";;;;;;;AAAA;;;;eAiBe,IAAAA,+BAAA,EAAoC,iBAApC,EAAuD;EACpEC,iBAAiB,EAAE,CAAC,KAAD;AADiD,CAAvD,C"} \ No newline at end of file diff --git a/lib/commonjs/fabric/VibrancyViewNativeComponent.js b/lib/commonjs/fabric/VibrancyViewNativeComponent.js new file mode 100644 index 0000000..7f62e61 --- /dev/null +++ b/lib/commonjs/fabric/VibrancyViewNativeComponent.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _codegenNativeComponent = _interopRequireDefault(require("react-native/Libraries/Utilities/codegenNativeComponent")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var _default = (0, _codegenNativeComponent.default)('VibrancyView', { + excludedPlatforms: ['android'] +}); + +exports.default = _default; +//# sourceMappingURL=VibrancyViewNativeComponent.js.map \ No newline at end of file diff --git a/lib/commonjs/fabric/VibrancyViewNativeComponent.js.map b/lib/commonjs/fabric/VibrancyViewNativeComponent.js.map new file mode 100644 index 0000000..0cf4ff6 --- /dev/null +++ b/lib/commonjs/fabric/VibrancyViewNativeComponent.js.map @@ -0,0 +1 @@ +{"version":3,"names":["codegenNativeComponent","excludedPlatforms"],"sources":["VibrancyViewNativeComponent.ts"],"sourcesContent":["import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';\nimport type { ViewProps, HostComponent, ColorValue } from 'react-native';\nimport type {\n WithDefault,\n Int32,\n} from 'react-native/Libraries/Types/CodegenTypes';\n\ninterface NativeProps extends ViewProps {\n blurType?: WithDefault<\n | 'dark'\n | 'light'\n | 'xlight'\n | 'transparent'\n | 'prominent'\n | 'regular'\n | 'extraDark'\n | 'chromeMaterial'\n | 'material'\n | 'thickMaterial'\n | 'thinMaterial'\n | 'ultraThinMaterial'\n | 'chromeMaterialDark'\n | 'materialDark'\n | 'thickMaterialDark'\n | 'thinMaterialDark'\n | 'ultraThinMaterialDark'\n | 'chromeMaterialLight'\n | 'materialLight'\n | 'thickMaterialLight'\n | 'thinMaterialLight'\n | 'ultraThinMaterialLight',\n 'dark'\n >;\n blurAmount?: WithDefault;\n reducedTransparencyFallbackColor?: ColorValue;\n}\n\nexport default codegenNativeComponent('VibrancyView', {\n excludedPlatforms: ['android'],\n}) as HostComponent;\n"],"mappings":";;;;;;;AAAA;;;;eAqCe,IAAAA,+BAAA,EAAoC,cAApC,EAAoD;EACjEC,iBAAiB,EAAE,CAAC,SAAD;AAD8C,CAApD,C"} \ No newline at end of file diff --git a/lib/commonjs/index.js b/lib/commonjs/index.js new file mode 100644 index 0000000..df3d0e4 --- /dev/null +++ b/lib/commonjs/index.js @@ -0,0 +1,18 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.VibrancyView = exports.BlurView = void 0; + +var _BlurView = _interopRequireDefault(require("./components/BlurView")); + +var _VibrancyView = _interopRequireDefault(require("./components/VibrancyView")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +const BlurView = _BlurView.default; +exports.BlurView = BlurView; +const VibrancyView = _VibrancyView.default; +exports.VibrancyView = VibrancyView; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/lib/commonjs/index.js.map b/lib/commonjs/index.js.map new file mode 100644 index 0000000..f7e3683 --- /dev/null +++ b/lib/commonjs/index.js.map @@ -0,0 +1 @@ +{"version":3,"names":["BlurView","BlurViewUntyped","VibrancyView","VibrancyViewUntyped"],"sources":["index.tsx"],"sourcesContent":["import BlurViewUntyped from './components/BlurView';\nimport VibrancyViewUntyped from './components/VibrancyView';\nimport type { View } from 'react-native'\n\nimport type { BlurViewProps as BlurViewPropsIOS } from './components/BlurView.ios';\nimport type { BlurViewProps as BlurViewPropsAndroid } from './components/BlurView.android';\nimport type { VibrancyViewProps as VibrancyViewPropsIOS } from './components/VibrancyView.ios';\n\ntype BlurViewProps = BlurViewPropsIOS | BlurViewPropsAndroid;\ntype VibrancyViewProps = VibrancyViewPropsIOS;\n\nconst BlurView = BlurViewUntyped as React.ForwardRefExoticComponent>\nconst VibrancyView = VibrancyViewUntyped as React.ForwardRefExoticComponent>\n\nexport { BlurView, VibrancyView };\nexport type { BlurViewProps, VibrancyViewProps };"],"mappings":";;;;;;;AAAA;;AACA;;;;AAUA,MAAMA,QAAQ,GAAGC,iBAAjB;;AACA,MAAMC,YAAY,GAAGC,qBAArB"} \ No newline at end of file diff --git a/lib/module/components/BlurView.android.js b/lib/module/components/BlurView.android.js new file mode 100644 index 0000000..03d2b15 --- /dev/null +++ b/lib/module/components/BlurView.android.js @@ -0,0 +1,88 @@ +function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } + +import React, { forwardRef, useEffect } from 'react'; +import { DeviceEventEmitter, StyleSheet } from 'react-native'; +import NativeBlurView from '../fabric/BlurViewNativeComponentAndroid'; +const OVERLAY_COLORS = { + light: 'rgba(255, 255, 255, 0.2)', + xlight: 'rgba(255, 255, 255, 0.75)', + dark: 'rgba(16, 12, 12, 0.64)' +}; +const BlurView = /*#__PURE__*/forwardRef((_ref, ref) => { + let { + downsampleFactor, + blurRadius, + blurAmount = 10, + blurType = 'dark', + overlayColor, + enabled, + autoUpdate, + children, + style, + ...rest + } = _ref; + useEffect(() => { + DeviceEventEmitter.addListener('ReactNativeBlurError', message => { + throw new Error(`[ReactNativeBlur]: ${message}`); + }); + return () => { + DeviceEventEmitter.removeAllListeners('ReactNativeBlurError'); + }; + }, []); + + const getOverlayColor = () => { + if (overlayColor != null) { + return overlayColor; + } + + return OVERLAY_COLORS[blurType] || OVERLAY_COLORS.dark; + }; + + const getBlurRadius = () => { + if (blurRadius != null) { + if (blurRadius > 25) { + throw new Error(`[ReactNativeBlur]: blurRadius cannot be greater than 25! (was: ${blurRadius})`); + } + + return blurRadius; + } // iOS seems to use a slightly different blurring algorithm (or scale?). + // Android blurRadius + downsampleFactor is approximately 80% of blurAmount. + + + const equivalentBlurRadius = Math.round(blurAmount * 0.8); + + if (equivalentBlurRadius > 25) { + return 25; + } + + return equivalentBlurRadius; + }; + + const getDownsampleFactor = () => { + if (downsampleFactor != null) { + return downsampleFactor; + } + + return blurRadius; + }; + + return /*#__PURE__*/React.createElement(NativeBlurView, _extends({}, rest, { + ref: ref, + blurRadius: getBlurRadius(), + downsampleFactor: getDownsampleFactor(), + overlayColor: getOverlayColor(), + blurAmount: blurAmount, + blurType: blurType, + enabled: enabled, + autoUpdate: autoUpdate, + pointerEvents: "none", + style: StyleSheet.compose(styles.transparent, style) + }), children); +}); +const styles = StyleSheet.create({ + transparent: { + backgroundColor: 'transparent' + } +}); +export default BlurView; +//# sourceMappingURL=BlurView.android.js.map \ No newline at end of file diff --git a/lib/module/components/BlurView.android.js.map b/lib/module/components/BlurView.android.js.map new file mode 100644 index 0000000..c83de63 --- /dev/null +++ b/lib/module/components/BlurView.android.js.map @@ -0,0 +1 @@ +{"version":3,"names":["React","forwardRef","useEffect","DeviceEventEmitter","StyleSheet","NativeBlurView","OVERLAY_COLORS","light","xlight","dark","BlurView","ref","downsampleFactor","blurRadius","blurAmount","blurType","overlayColor","enabled","autoUpdate","children","style","rest","addListener","message","Error","removeAllListeners","getOverlayColor","getBlurRadius","equivalentBlurRadius","Math","round","getDownsampleFactor","compose","styles","transparent","create","backgroundColor"],"sources":["BlurView.android.tsx"],"sourcesContent":["import React, { forwardRef, useEffect } from 'react';\nimport {\n View,\n DeviceEventEmitter,\n StyleSheet,\n ViewProps,\n ViewStyle,\n} from 'react-native';\nimport NativeBlurView from '../fabric/BlurViewNativeComponentAndroid';\n\nconst OVERLAY_COLORS = {\n light: 'rgba(255, 255, 255, 0.2)',\n xlight: 'rgba(255, 255, 255, 0.75)',\n dark: 'rgba(16, 12, 12, 0.64)',\n};\n\nexport type BlurViewProps = ViewProps & {\n blurAmount?: number;\n blurType?: 'dark' | 'light' | 'xlight';\n blurRadius?: number;\n downsampleFactor?: number;\n overlayColor?: string;\n enabled?: boolean;\n autoUpdate?: boolean;\n};\n\nconst BlurView = forwardRef(\n (\n {\n downsampleFactor,\n blurRadius,\n blurAmount = 10,\n blurType = 'dark',\n overlayColor,\n enabled,\n autoUpdate,\n children,\n style,\n ...rest\n },\n ref\n ) => {\n useEffect(() => {\n DeviceEventEmitter.addListener('ReactNativeBlurError', (message) => {\n throw new Error(`[ReactNativeBlur]: ${message}`);\n });\n\n return () => {\n DeviceEventEmitter.removeAllListeners('ReactNativeBlurError');\n };\n }, []);\n\n const getOverlayColor = () => {\n if (overlayColor != null) {\n return overlayColor;\n }\n\n return OVERLAY_COLORS[blurType] || OVERLAY_COLORS.dark;\n };\n\n const getBlurRadius = () => {\n if (blurRadius != null) {\n if (blurRadius > 25) {\n throw new Error(\n `[ReactNativeBlur]: blurRadius cannot be greater than 25! (was: ${blurRadius})`\n );\n }\n return blurRadius;\n }\n\n // iOS seems to use a slightly different blurring algorithm (or scale?).\n // Android blurRadius + downsampleFactor is approximately 80% of blurAmount.\n const equivalentBlurRadius = Math.round(blurAmount * 0.8);\n\n if (equivalentBlurRadius > 25) {\n return 25;\n }\n return equivalentBlurRadius;\n };\n\n const getDownsampleFactor = () => {\n if (downsampleFactor != null) {\n return downsampleFactor;\n }\n\n return blurRadius;\n };\n\n return (\n \n {children}\n \n );\n }\n);\n\nconst styles = StyleSheet.create<{ transparent: ViewStyle }>({\n transparent: { backgroundColor: 'transparent' },\n});\n\nexport default BlurView;\n"],"mappings":";;AAAA,OAAOA,KAAP,IAAgBC,UAAhB,EAA4BC,SAA5B,QAA6C,OAA7C;AACA,SAEEC,kBAFF,EAGEC,UAHF,QAMO,cANP;AAOA,OAAOC,cAAP,MAA2B,0CAA3B;AAEA,MAAMC,cAAc,GAAG;EACrBC,KAAK,EAAE,0BADc;EAErBC,MAAM,EAAE,2BAFa;EAGrBC,IAAI,EAAE;AAHe,CAAvB;AAgBA,MAAMC,QAAQ,gBAAGT,UAAU,CACzB,OAaEU,GAbF,KAcK;EAAA,IAbH;IACEC,gBADF;IAEEC,UAFF;IAGEC,UAAU,GAAG,EAHf;IAIEC,QAAQ,GAAG,MAJb;IAKEC,YALF;IAMEC,OANF;IAOEC,UAPF;IAQEC,QARF;IASEC,KATF;IAUE,GAAGC;EAVL,CAaG;EACHnB,SAAS,CAAC,MAAM;IACdC,kBAAkB,CAACmB,WAAnB,CAA+B,sBAA/B,EAAwDC,OAAD,IAAa;MAClE,MAAM,IAAIC,KAAJ,CAAW,sBAAqBD,OAAQ,EAAxC,CAAN;IACD,CAFD;IAIA,OAAO,MAAM;MACXpB,kBAAkB,CAACsB,kBAAnB,CAAsC,sBAAtC;IACD,CAFD;EAGD,CARQ,EAQN,EARM,CAAT;;EAUA,MAAMC,eAAe,GAAG,MAAM;IAC5B,IAAIV,YAAY,IAAI,IAApB,EAA0B;MACxB,OAAOA,YAAP;IACD;;IAED,OAAOV,cAAc,CAACS,QAAD,CAAd,IAA4BT,cAAc,CAACG,IAAlD;EACD,CAND;;EAQA,MAAMkB,aAAa,GAAG,MAAM;IAC1B,IAAId,UAAU,IAAI,IAAlB,EAAwB;MACtB,IAAIA,UAAU,GAAG,EAAjB,EAAqB;QACnB,MAAM,IAAIW,KAAJ,CACH,kEAAiEX,UAAW,GADzE,CAAN;MAGD;;MACD,OAAOA,UAAP;IACD,CARyB,CAU1B;IACA;;;IACA,MAAMe,oBAAoB,GAAGC,IAAI,CAACC,KAAL,CAAWhB,UAAU,GAAG,GAAxB,CAA7B;;IAEA,IAAIc,oBAAoB,GAAG,EAA3B,EAA+B;MAC7B,OAAO,EAAP;IACD;;IACD,OAAOA,oBAAP;EACD,CAlBD;;EAoBA,MAAMG,mBAAmB,GAAG,MAAM;IAChC,IAAInB,gBAAgB,IAAI,IAAxB,EAA8B;MAC5B,OAAOA,gBAAP;IACD;;IAED,OAAOC,UAAP;EACD,CAND;;EAQA,oBACE,oBAAC,cAAD,eACMQ,IADN;IAEE,GAAG,EAAEV,GAFP;IAGE,UAAU,EAAEgB,aAAa,EAH3B;IAIE,gBAAgB,EAAEI,mBAAmB,EAJvC;IAKE,YAAY,EAAEL,eAAe,EAL/B;IAME,UAAU,EAAEZ,UANd;IAOE,QAAQ,EAAEC,QAPZ;IAQE,OAAO,EAAEE,OARX;IASE,UAAU,EAAEC,UATd;IAUE,aAAa,EAAC,MAVhB;IAWE,KAAK,EAAEd,UAAU,CAAC4B,OAAX,CAAmBC,MAAM,CAACC,WAA1B,EAAuCd,KAAvC;EAXT,IAaGD,QAbH,CADF;AAiBD,CA/EwB,CAA3B;AAkFA,MAAMc,MAAM,GAAG7B,UAAU,CAAC+B,MAAX,CAA8C;EAC3DD,WAAW,EAAE;IAAEE,eAAe,EAAE;EAAnB;AAD8C,CAA9C,CAAf;AAIA,eAAe1B,QAAf"} \ No newline at end of file diff --git a/lib/module/components/BlurView.ios.js b/lib/module/components/BlurView.ios.js new file mode 100644 index 0000000..bf8817b --- /dev/null +++ b/lib/module/components/BlurView.ios.js @@ -0,0 +1,26 @@ +function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } + +import React, { forwardRef } from 'react'; +import { StyleSheet } from 'react-native'; +import NativeBlurView from '../fabric/BlurViewNativeComponent'; +const BlurView = /*#__PURE__*/forwardRef((_ref, ref) => { + let { + blurType = 'dark', + blurAmount = 10, + style, + ...rest + } = _ref; + return /*#__PURE__*/React.createElement(NativeBlurView, _extends({ + ref: ref, + style: StyleSheet.compose(styles.transparent, style), + blurType: blurType, + blurAmount: blurAmount + }, rest)); +}); +const styles = StyleSheet.create({ + transparent: { + backgroundColor: 'transparent' + } +}); +export default BlurView; +//# sourceMappingURL=BlurView.ios.js.map \ No newline at end of file diff --git a/lib/module/components/BlurView.ios.js.map b/lib/module/components/BlurView.ios.js.map new file mode 100644 index 0000000..d9066c7 --- /dev/null +++ b/lib/module/components/BlurView.ios.js.map @@ -0,0 +1 @@ +{"version":3,"names":["React","forwardRef","StyleSheet","NativeBlurView","BlurView","ref","blurType","blurAmount","style","rest","compose","styles","transparent","create","backgroundColor"],"sources":["BlurView.ios.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport { StyleSheet, ViewProps, ViewStyle, View } from 'react-native';\nimport NativeBlurView from '../fabric/BlurViewNativeComponent';\n\ntype BlurType =\n | 'dark'\n | 'light'\n | 'xlight'\n | 'transparent'\n | 'prominent'\n | 'regular'\n | 'extraDark'\n | 'chromeMaterial'\n | 'material'\n | 'thickMaterial'\n | 'thinMaterial'\n | 'ultraThinMaterial'\n | 'chromeMaterialDark'\n | 'materialDark'\n | 'thickMaterialDark'\n | 'thinMaterialDark'\n | 'ultraThinMaterialDark'\n | 'chromeMaterialLight'\n | 'materialLight'\n | 'thickMaterialLight'\n | 'thinMaterialLight'\n | 'ultraThinMaterialLight';\n\nexport type BlurViewProps = ViewProps & {\n blurType?: BlurType;\n blurAmount?: number;\n reducedTransparencyFallbackColor?: string;\n};\n\nconst BlurView = forwardRef(\n ({ blurType = 'dark', blurAmount = 10, style, ...rest }, ref) => (\n \n )\n);\n\nconst styles = StyleSheet.create<{ transparent: ViewStyle }>({\n transparent: { backgroundColor: 'transparent' },\n});\n\nexport default BlurView;\n"],"mappings":";;AAAA,OAAOA,KAAP,IAAgBC,UAAhB,QAAkC,OAAlC;AACA,SAASC,UAAT,QAAuD,cAAvD;AACA,OAAOC,cAAP,MAA2B,mCAA3B;AAgCA,MAAMC,QAAQ,gBAAGH,UAAU,CACzB,OAAyDI,GAAzD;EAAA,IAAC;IAAEC,QAAQ,GAAG,MAAb;IAAqBC,UAAU,GAAG,EAAlC;IAAsCC,KAAtC;IAA6C,GAAGC;EAAhD,CAAD;EAAA,oBACE,oBAAC,cAAD;IACE,GAAG,EAAEJ,GADP;IAEE,KAAK,EAAEH,UAAU,CAACQ,OAAX,CAAmBC,MAAM,CAACC,WAA1B,EAAuCJ,KAAvC,CAFT;IAGE,QAAQ,EAAEF,QAHZ;IAIE,UAAU,EAAEC;EAJd,GAKME,IALN,EADF;AAAA,CADyB,CAA3B;AAYA,MAAME,MAAM,GAAGT,UAAU,CAACW,MAAX,CAA8C;EAC3DD,WAAW,EAAE;IAAEE,eAAe,EAAE;EAAnB;AAD8C,CAA9C,CAAf;AAIA,eAAeV,QAAf"} \ No newline at end of file diff --git a/lib/module/components/VibrancyView.android.js b/lib/module/components/VibrancyView.android.js new file mode 100644 index 0000000..946294b --- /dev/null +++ b/lib/module/components/VibrancyView.android.js @@ -0,0 +1,12 @@ +import React from 'react'; + +class VibrancyView extends React.Component { + render() { + console.error('VibrancyView is not implemented on Android'); + return null; + } + +} + +export default VibrancyView; +//# sourceMappingURL=VibrancyView.android.js.map \ No newline at end of file diff --git a/lib/module/components/VibrancyView.android.js.map b/lib/module/components/VibrancyView.android.js.map new file mode 100644 index 0000000..d80d7af --- /dev/null +++ b/lib/module/components/VibrancyView.android.js.map @@ -0,0 +1 @@ +{"version":3,"names":["React","VibrancyView","Component","render","console","error"],"sources":["VibrancyView.android.tsx"],"sourcesContent":["import React from 'react';\n\nclass VibrancyView extends React.Component {\n render() {\n console.error('VibrancyView is not implemented on Android');\n return null;\n }\n}\n\nexport default VibrancyView;\n"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;;AAEA,MAAMC,YAAN,SAA2BD,KAAK,CAACE,SAAjC,CAA2C;EACzCC,MAAM,GAAG;IACPC,OAAO,CAACC,KAAR,CAAc,4CAAd;IACA,OAAO,IAAP;EACD;;AAJwC;;AAO3C,eAAeJ,YAAf"} \ No newline at end of file diff --git a/lib/module/components/VibrancyView.ios.js b/lib/module/components/VibrancyView.ios.js new file mode 100644 index 0000000..89f776d --- /dev/null +++ b/lib/module/components/VibrancyView.ios.js @@ -0,0 +1,22 @@ +function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } + +import React, { forwardRef } from 'react'; +import { StyleSheet } from 'react-native'; +import NativeVibrancyView from '../fabric/VibrancyViewNativeComponent'; +const VibrancyView = /*#__PURE__*/forwardRef((_ref, ref) => { + let { + style, + ...rest + } = _ref; + return /*#__PURE__*/React.createElement(NativeVibrancyView, _extends({}, rest, { + ref: ref, + style: StyleSheet.compose(styles.transparent, style) + })); +}); +const styles = StyleSheet.create({ + transparent: { + backgroundColor: 'transparent' + } +}); +export default VibrancyView; +//# sourceMappingURL=VibrancyView.ios.js.map \ No newline at end of file diff --git a/lib/module/components/VibrancyView.ios.js.map b/lib/module/components/VibrancyView.ios.js.map new file mode 100644 index 0000000..60b765d --- /dev/null +++ b/lib/module/components/VibrancyView.ios.js.map @@ -0,0 +1 @@ +{"version":3,"names":["React","forwardRef","StyleSheet","NativeVibrancyView","VibrancyView","ref","style","rest","compose","styles","transparent","create","backgroundColor"],"sources":["VibrancyView.ios.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport { StyleSheet, ViewProps, ViewStyle } from 'react-native';\nimport NativeVibrancyView from '../fabric/VibrancyViewNativeComponent';\nimport type { BlurViewProps } from './BlurView.ios';\n\nexport type VibrancyViewProps = ViewProps & {\n blurType?: BlurViewProps['blurType'];\n blurAmount: number;\n reducedTransparencyFallbackColor?: string;\n};\n\nconst VibrancyView = forwardRef(\n ({ style, ...rest }, ref) => (\n \n )\n);\n\nconst styles = StyleSheet.create<{ transparent: ViewStyle }>({\n transparent: { backgroundColor: 'transparent' },\n});\n\nexport default VibrancyView;\n"],"mappings":";;AAAA,OAAOA,KAAP,IAAgBC,UAAhB,QAAkC,OAAlC;AACA,SAASC,UAAT,QAAiD,cAAjD;AACA,OAAOC,kBAAP,MAA+B,uCAA/B;AASA,MAAMC,YAAY,gBAAGH,UAAU,CAC7B,OAAqBI,GAArB;EAAA,IAAC;IAAEC,KAAF;IAAS,GAAGC;EAAZ,CAAD;EAAA,oBACE,oBAAC,kBAAD,eACMA,IADN;IAEE,GAAG,EAAEF,GAFP;IAGE,KAAK,EAAEH,UAAU,CAACM,OAAX,CAAmBC,MAAM,CAACC,WAA1B,EAAuCJ,KAAvC;EAHT,GADF;AAAA,CAD6B,CAA/B;AAUA,MAAMG,MAAM,GAAGP,UAAU,CAACS,MAAX,CAA8C;EAC3DD,WAAW,EAAE;IAAEE,eAAe,EAAE;EAAnB;AAD8C,CAA9C,CAAf;AAIA,eAAeR,YAAf"} \ No newline at end of file diff --git a/lib/module/fabric/BlurViewNativeComponent.js b/lib/module/fabric/BlurViewNativeComponent.js new file mode 100644 index 0000000..f6208a8 --- /dev/null +++ b/lib/module/fabric/BlurViewNativeComponent.js @@ -0,0 +1,5 @@ +import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent'; +export default codegenNativeComponent('BlurView', { + excludedPlatforms: ['android'] +}); +//# sourceMappingURL=BlurViewNativeComponent.js.map \ No newline at end of file diff --git a/lib/module/fabric/BlurViewNativeComponent.js.map b/lib/module/fabric/BlurViewNativeComponent.js.map new file mode 100644 index 0000000..cdc5587 --- /dev/null +++ b/lib/module/fabric/BlurViewNativeComponent.js.map @@ -0,0 +1 @@ +{"version":3,"names":["codegenNativeComponent","excludedPlatforms"],"sources":["BlurViewNativeComponent.ts"],"sourcesContent":["import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';\nimport type { ViewProps, HostComponent, ColorValue } from 'react-native';\nimport type {\n WithDefault,\n Int32,\n} from 'react-native/Libraries/Types/CodegenTypes';\n\ninterface NativeProps extends ViewProps {\n blurType?: WithDefault<\n | 'dark'\n | 'light'\n | 'xlight'\n | 'transparent'\n | 'prominent'\n | 'regular'\n | 'extraDark'\n | 'chromeMaterial'\n | 'material'\n | 'thickMaterial'\n | 'thinMaterial'\n | 'ultraThinMaterial'\n | 'chromeMaterialDark'\n | 'materialDark'\n | 'thickMaterialDark'\n | 'thinMaterialDark'\n | 'ultraThinMaterialDark'\n | 'chromeMaterialLight'\n | 'materialLight'\n | 'thickMaterialLight'\n | 'thinMaterialLight'\n | 'ultraThinMaterialLight',\n 'dark'\n >;\n blurAmount?: WithDefault;\n reducedTransparencyFallbackColor?: ColorValue;\n}\n\nexport default codegenNativeComponent('BlurView', {\n excludedPlatforms: ['android'],\n}) as HostComponent;\n"],"mappings":"AAAA,OAAOA,sBAAP,MAAmC,yDAAnC;AAqCA,eAAeA,sBAAsB,CAAc,UAAd,EAA0B;EAC7DC,iBAAiB,EAAE,CAAC,SAAD;AAD0C,CAA1B,CAArC"} \ No newline at end of file diff --git a/lib/module/fabric/BlurViewNativeComponentAndroid.js b/lib/module/fabric/BlurViewNativeComponentAndroid.js new file mode 100644 index 0000000..cbc706c --- /dev/null +++ b/lib/module/fabric/BlurViewNativeComponentAndroid.js @@ -0,0 +1,5 @@ +import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent'; +export default codegenNativeComponent('AndroidBlurView', { + excludedPlatforms: ['iOS'] +}); +//# sourceMappingURL=BlurViewNativeComponentAndroid.js.map \ No newline at end of file diff --git a/lib/module/fabric/BlurViewNativeComponentAndroid.js.map b/lib/module/fabric/BlurViewNativeComponentAndroid.js.map new file mode 100644 index 0000000..4690bcd --- /dev/null +++ b/lib/module/fabric/BlurViewNativeComponentAndroid.js.map @@ -0,0 +1 @@ +{"version":3,"names":["codegenNativeComponent","excludedPlatforms"],"sources":["BlurViewNativeComponentAndroid.ts"],"sourcesContent":["import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';\nimport type { ViewProps, HostComponent, ColorValue } from 'react-native';\nimport type {\n WithDefault,\n Int32,\n} from 'react-native/Libraries/Types/CodegenTypes';\n\ninterface NativeProps extends ViewProps {\n blurAmount?: WithDefault;\n blurType?: WithDefault<'dark' | 'light' | 'xlight', 'dark'>;\n blurRadius?: Int32;\n downsampleFactor?: Int32;\n overlayColor?: ColorValue;\n enabled?: boolean;\n autoUpdate?: boolean;\n}\n\nexport default codegenNativeComponent('AndroidBlurView', {\n excludedPlatforms: ['iOS'],\n}) as HostComponent;\n"],"mappings":"AAAA,OAAOA,sBAAP,MAAmC,yDAAnC;AAiBA,eAAeA,sBAAsB,CAAc,iBAAd,EAAiC;EACpEC,iBAAiB,EAAE,CAAC,KAAD;AADiD,CAAjC,CAArC"} \ No newline at end of file diff --git a/lib/module/fabric/VibrancyViewNativeComponent.js b/lib/module/fabric/VibrancyViewNativeComponent.js new file mode 100644 index 0000000..ca6eda7 --- /dev/null +++ b/lib/module/fabric/VibrancyViewNativeComponent.js @@ -0,0 +1,5 @@ +import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent'; +export default codegenNativeComponent('VibrancyView', { + excludedPlatforms: ['android'] +}); +//# sourceMappingURL=VibrancyViewNativeComponent.js.map \ No newline at end of file diff --git a/lib/module/fabric/VibrancyViewNativeComponent.js.map b/lib/module/fabric/VibrancyViewNativeComponent.js.map new file mode 100644 index 0000000..7ce41ec --- /dev/null +++ b/lib/module/fabric/VibrancyViewNativeComponent.js.map @@ -0,0 +1 @@ +{"version":3,"names":["codegenNativeComponent","excludedPlatforms"],"sources":["VibrancyViewNativeComponent.ts"],"sourcesContent":["import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';\nimport type { ViewProps, HostComponent, ColorValue } from 'react-native';\nimport type {\n WithDefault,\n Int32,\n} from 'react-native/Libraries/Types/CodegenTypes';\n\ninterface NativeProps extends ViewProps {\n blurType?: WithDefault<\n | 'dark'\n | 'light'\n | 'xlight'\n | 'transparent'\n | 'prominent'\n | 'regular'\n | 'extraDark'\n | 'chromeMaterial'\n | 'material'\n | 'thickMaterial'\n | 'thinMaterial'\n | 'ultraThinMaterial'\n | 'chromeMaterialDark'\n | 'materialDark'\n | 'thickMaterialDark'\n | 'thinMaterialDark'\n | 'ultraThinMaterialDark'\n | 'chromeMaterialLight'\n | 'materialLight'\n | 'thickMaterialLight'\n | 'thinMaterialLight'\n | 'ultraThinMaterialLight',\n 'dark'\n >;\n blurAmount?: WithDefault;\n reducedTransparencyFallbackColor?: ColorValue;\n}\n\nexport default codegenNativeComponent('VibrancyView', {\n excludedPlatforms: ['android'],\n}) as HostComponent;\n"],"mappings":"AAAA,OAAOA,sBAAP,MAAmC,yDAAnC;AAqCA,eAAeA,sBAAsB,CAAc,cAAd,EAA8B;EACjEC,iBAAiB,EAAE,CAAC,SAAD;AAD8C,CAA9B,CAArC"} \ No newline at end of file diff --git a/lib/module/index.js b/lib/module/index.js new file mode 100644 index 0000000..7cbb72a --- /dev/null +++ b/lib/module/index.js @@ -0,0 +1,6 @@ +import BlurViewUntyped from './components/BlurView'; +import VibrancyViewUntyped from './components/VibrancyView'; +const BlurView = BlurViewUntyped; +const VibrancyView = VibrancyViewUntyped; +export { BlurView, VibrancyView }; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/lib/module/index.js.map b/lib/module/index.js.map new file mode 100644 index 0000000..f7456d2 --- /dev/null +++ b/lib/module/index.js.map @@ -0,0 +1 @@ +{"version":3,"names":["BlurViewUntyped","VibrancyViewUntyped","BlurView","VibrancyView"],"sources":["index.tsx"],"sourcesContent":["import BlurViewUntyped from './components/BlurView';\nimport VibrancyViewUntyped from './components/VibrancyView';\nimport type { View } from 'react-native'\n\nimport type { BlurViewProps as BlurViewPropsIOS } from './components/BlurView.ios';\nimport type { BlurViewProps as BlurViewPropsAndroid } from './components/BlurView.android';\nimport type { VibrancyViewProps as VibrancyViewPropsIOS } from './components/VibrancyView.ios';\n\ntype BlurViewProps = BlurViewPropsIOS | BlurViewPropsAndroid;\ntype VibrancyViewProps = VibrancyViewPropsIOS;\n\nconst BlurView = BlurViewUntyped as React.ForwardRefExoticComponent>\nconst VibrancyView = VibrancyViewUntyped as React.ForwardRefExoticComponent>\n\nexport { BlurView, VibrancyView };\nexport type { BlurViewProps, VibrancyViewProps };"],"mappings":"AAAA,OAAOA,eAAP,MAA4B,uBAA5B;AACA,OAAOC,mBAAP,MAAgC,2BAAhC;AAUA,MAAMC,QAAQ,GAAGF,eAAjB;AACA,MAAMG,YAAY,GAAGF,mBAArB;AAEA,SAASC,QAAT,EAAmBC,YAAnB"} \ No newline at end of file diff --git a/lib/typescript/components/BlurView.android.d.ts b/lib/typescript/components/BlurView.android.d.ts new file mode 100644 index 0000000..3f34afd --- /dev/null +++ b/lib/typescript/components/BlurView.android.d.ts @@ -0,0 +1,21 @@ +import React from 'react'; +import { View, ViewProps } from 'react-native'; +export declare type BlurViewProps = ViewProps & { + blurAmount?: number; + blurType?: 'dark' | 'light' | 'xlight'; + blurRadius?: number; + downsampleFactor?: number; + overlayColor?: string; + enabled?: boolean; + autoUpdate?: boolean; +}; +declare const BlurView: React.ForwardRefExoticComponent>; +export default BlurView; diff --git a/lib/typescript/components/BlurView.ios.d.ts b/lib/typescript/components/BlurView.ios.d.ts new file mode 100644 index 0000000..4254ab7 --- /dev/null +++ b/lib/typescript/components/BlurView.ios.d.ts @@ -0,0 +1,14 @@ +import React from 'react'; +import { ViewProps, View } from 'react-native'; +declare type BlurType = 'dark' | 'light' | 'xlight' | 'transparent' | 'prominent' | 'regular' | 'extraDark' | 'chromeMaterial' | 'material' | 'thickMaterial' | 'thinMaterial' | 'ultraThinMaterial' | 'chromeMaterialDark' | 'materialDark' | 'thickMaterialDark' | 'thinMaterialDark' | 'ultraThinMaterialDark' | 'chromeMaterialLight' | 'materialLight' | 'thickMaterialLight' | 'thinMaterialLight' | 'ultraThinMaterialLight'; +export declare type BlurViewProps = ViewProps & { + blurType?: BlurType; + blurAmount?: number; + reducedTransparencyFallbackColor?: string; +}; +declare const BlurView: React.ForwardRefExoticComponent>; +export default BlurView; diff --git a/lib/typescript/components/VibrancyView.android.d.ts b/lib/typescript/components/VibrancyView.android.d.ts new file mode 100644 index 0000000..e9c812b --- /dev/null +++ b/lib/typescript/components/VibrancyView.android.d.ts @@ -0,0 +1,5 @@ +import React from 'react'; +declare class VibrancyView extends React.Component { + render(): null; +} +export default VibrancyView; diff --git a/lib/typescript/components/VibrancyView.ios.d.ts b/lib/typescript/components/VibrancyView.ios.d.ts new file mode 100644 index 0000000..0b06362 --- /dev/null +++ b/lib/typescript/components/VibrancyView.ios.d.ts @@ -0,0 +1,14 @@ +import React from 'react'; +import { ViewProps } from 'react-native'; +import type { BlurViewProps } from './BlurView.ios'; +export declare type VibrancyViewProps = ViewProps & { + blurType?: BlurViewProps['blurType']; + blurAmount: number; + reducedTransparencyFallbackColor?: string; +}; +declare const VibrancyView: React.ForwardRefExoticComponent>; +export default VibrancyView; diff --git a/lib/typescript/fabric/BlurViewNativeComponent.d.ts b/lib/typescript/fabric/BlurViewNativeComponent.d.ts new file mode 100644 index 0000000..5df9c97 --- /dev/null +++ b/lib/typescript/fabric/BlurViewNativeComponent.d.ts @@ -0,0 +1,9 @@ +import type { ViewProps, HostComponent, ColorValue } from 'react-native'; +import type { WithDefault, Int32 } from 'react-native/Libraries/Types/CodegenTypes'; +interface NativeProps extends ViewProps { + blurType?: WithDefault<'dark' | 'light' | 'xlight' | 'transparent' | 'prominent' | 'regular' | 'extraDark' | 'chromeMaterial' | 'material' | 'thickMaterial' | 'thinMaterial' | 'ultraThinMaterial' | 'chromeMaterialDark' | 'materialDark' | 'thickMaterialDark' | 'thinMaterialDark' | 'ultraThinMaterialDark' | 'chromeMaterialLight' | 'materialLight' | 'thickMaterialLight' | 'thinMaterialLight' | 'ultraThinMaterialLight', 'dark'>; + blurAmount?: WithDefault; + reducedTransparencyFallbackColor?: ColorValue; +} +declare const _default: HostComponent; +export default _default; diff --git a/lib/typescript/fabric/BlurViewNativeComponentAndroid.d.ts b/lib/typescript/fabric/BlurViewNativeComponentAndroid.d.ts new file mode 100644 index 0000000..5392cc8 --- /dev/null +++ b/lib/typescript/fabric/BlurViewNativeComponentAndroid.d.ts @@ -0,0 +1,13 @@ +import type { ViewProps, HostComponent, ColorValue } from 'react-native'; +import type { WithDefault, Int32 } from 'react-native/Libraries/Types/CodegenTypes'; +interface NativeProps extends ViewProps { + blurAmount?: WithDefault; + blurType?: WithDefault<'dark' | 'light' | 'xlight', 'dark'>; + blurRadius?: Int32; + downsampleFactor?: Int32; + overlayColor?: ColorValue; + enabled?: boolean; + autoUpdate?: boolean; +} +declare const _default: HostComponent; +export default _default; diff --git a/lib/typescript/fabric/VibrancyViewNativeComponent.d.ts b/lib/typescript/fabric/VibrancyViewNativeComponent.d.ts new file mode 100644 index 0000000..5df9c97 --- /dev/null +++ b/lib/typescript/fabric/VibrancyViewNativeComponent.d.ts @@ -0,0 +1,9 @@ +import type { ViewProps, HostComponent, ColorValue } from 'react-native'; +import type { WithDefault, Int32 } from 'react-native/Libraries/Types/CodegenTypes'; +interface NativeProps extends ViewProps { + blurType?: WithDefault<'dark' | 'light' | 'xlight' | 'transparent' | 'prominent' | 'regular' | 'extraDark' | 'chromeMaterial' | 'material' | 'thickMaterial' | 'thinMaterial' | 'ultraThinMaterial' | 'chromeMaterialDark' | 'materialDark' | 'thickMaterialDark' | 'thinMaterialDark' | 'ultraThinMaterialDark' | 'chromeMaterialLight' | 'materialLight' | 'thickMaterialLight' | 'thinMaterialLight' | 'ultraThinMaterialLight', 'dark'>; + blurAmount?: WithDefault; + reducedTransparencyFallbackColor?: ColorValue; +} +declare const _default: HostComponent; +export default _default; diff --git a/lib/typescript/index.d.ts b/lib/typescript/index.d.ts new file mode 100644 index 0000000..bd94850 --- /dev/null +++ b/lib/typescript/index.d.ts @@ -0,0 +1,15 @@ +/// +import type { View } from 'react-native'; +import type { BlurViewProps as BlurViewPropsIOS } from './components/BlurView.ios'; +import type { BlurViewProps as BlurViewPropsAndroid } from './components/BlurView.android'; +import type { VibrancyViewProps as VibrancyViewPropsIOS } from './components/VibrancyView.ios'; +declare type BlurViewProps = BlurViewPropsIOS | BlurViewPropsAndroid; +declare type VibrancyViewProps = VibrancyViewPropsIOS; +declare const BlurView: import("react").ForwardRefExoticComponent>; +declare const VibrancyView: import("react").ForwardRefExoticComponent>; +export { BlurView, VibrancyView }; +export type { BlurViewProps, VibrancyViewProps };