UNPKG

one

Version:

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

115 lines (92 loc) • 5.91 kB
# Vendored native sources ## Ordinary Blur (`OneNativeBlur`, `UI.Blur`) `ios/OneNativeBlurEffectView.swift` ports `@sbaiahmed1/react-native-blur@6.0.2` `ios/Views/BlurEffectView.swift` (MIT, Copyright (c) 2025 Ahmed Sbai). The paused public UIKit animator is rebuilt on style or intensity updates, window entry, foreground entry and effect refresh. Mount and update stabilization lasts three display ticks. One keeps its existing tint mapping and sharp React children above the effect. The upstream test-runner on/off override is omitted; zero intensity uses no effect. The npm tarball SHA256 is `39eab071f0d93ef47bdf27cf59613c2a322c2f6efacfbe348fb13838fb8d8532`. The separate upstream `VariableBlurView.swift` uses private Core Animation filters. Assigned review on 2026-10-04 holds its adoption. The requested exact variable-radius behavior remains unresolved in `plans/one-native-blur.md`; the ordinary public UIKit repair does not replace that requirement. Upstream license (MIT): ``` MIT License Copyright (c) 2025 Ahmed Sbai Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ``` ## EdgeFade (`OneNativeEdgeFade`, `UI.EdgeFade`) Direction: One's blur is built on `@sbaiahmed1/react-native-blur` (MIT): its platform native blur effects and a real iOS progressive blur (`CAFilter` `variableBlur`). The react-native-edge-fade blur stack described below fakes progressive blur with three `UIVisualEffectView` levels. Its replacement is held pending a supported route meeting the exact behavior; the private upstream filter is not adopted. The blur sits behind the composer: chrome sits above the blur by layer order and is never offset around it. Vendored from `react-native-edge-fade@0.2.0` (MIT, Copyright (c) 2026 Giulio Amato), owned in-tree under `OneNative*` names so the symbols never collide with the upstream package if an app also links it. What we took (mask + blur; slice 1 mask, slice 2 blur): - ios/OneNativeEdgeFadeCurves.{h,mm} — preset tables + custom parsing (overlay `LocationsForCurve` and blur `PresenceAt` dropped; the blur mask layer inlines its own presence sampling) - ios/OneNativeEdgeFadeMaskLayer.{h,mm} — whole file - ios/OneNativeEdgeFadeBlurMaskLayer.{h,mm} — whole file - ios/OneNativeEdgeFadeComponentView.{h,mm} — mask wiring + blur stack + frost veil + saturation compensation; overlay layers and bench macros dropped - android/.../OneNativeEdgeFadeCurves.kt — whole object - android/.../OneNativeEdgeFadeShader.kt — AGSL + fallback trimmed to mask-only (overlay uniforms/branches deleted, not stubbed) - android/.../OneNativeEdgeFadeView.kt — mask render + UNIFORM blur stack + veil + clip + scroll sync; overlay, LAYERED pipeline, and lens deleted - android/.../OneNativeEdgeFadeManager.kt — rewritten for our codegen spec following the file's dp/px + invalidate pattern Deliberately NOT carried: overlay strip rendering (RN core `backgroundImage` gradients paint it in `src/effects/EdgeFade.native.tsx` with identical stacked semantics), the Reanimated variant, the web implementation, and the lens mode. One divergences from upstream, all tightening: - Frost grades (`frostSaturation`/`frostLift`) are not props: upstream JS never forwarded them, so both platforms use the upstream defaults as constants (Android) / internal compensation (iOS). - The frost veil is global-color-only on both platforms (matching upstream behavior); per-edge color in blur mode warns in JS. - The veil color crosses the spec as Int32 0xAARRGGBB resolved in JS (0 = no veil), so the main codegen emitter needs no color support. - Android hardcodes the UNIFORM blur pipeline (upstream default); the LAYERED compile-time flag and its exclusive helpers are deleted. The JS side (`src/effects/`) is a fresh implementation of the same prop surface, not a copy. Upstream license (MIT): ``` MIT License Copyright (c) 2026 Giulio Amato Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ```