@ajuarezso/capacitor-liquid-glass 0.3.2 → 0.3.3

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.
@@ -63,11 +63,20 @@ final class LiquidGlassTabBarOverlay: UIViewController {
63
63
  private var items: [LiquidGlassTabItem] = []
64
64
  private weak var hostVC: UIViewController?
65
65
 
66
+ /// Reemplaza `self.view` por una `PassThroughView` custom. El override
67
+ /// de `hitTest` vive en la `UIView` (no en el `UIViewController`), así
68
+ /// que necesitamos una subclase dedicada en lugar de override el VC.
69
+ override func loadView() {
70
+ let v = PassThroughView()
71
+ v.allowedHitView = tabBar
72
+ self.view = v
73
+ }
74
+
66
75
  override func viewDidLoad() {
67
76
  super.viewDidLoad()
68
77
  // Background transparente — solo el `UITabBar` (la pill flotante)
69
- // ocupa espacio visible. El resto del área es transparente y `hitTest`
70
- // la deja pasar al webview por debajo (ver override más abajo).
78
+ // ocupa espacio visible. El resto del área es transparente y la
79
+ // `PassThroughView` deja pasar los toques al webview por debajo.
71
80
  view.backgroundColor = .clear
72
81
 
73
82
  tabBar.translatesAutoresizingMaskIntoConstraints = false
@@ -86,15 +95,19 @@ final class LiquidGlassTabBarOverlay: UIViewController {
86
95
  ])
87
96
  }
88
97
 
89
- /// `self.view` cubre todo el rootVC (constraints leading/trailing/top/
90
- /// bottom = rootVC.view). Sin este override absorbería TODOS los taps y
91
- /// bloquearía el webview de Capacitor. Solo dejamos pasar los toques que
92
- /// aterrizan sobre el `UITabBar` o sus subvistas.
93
- override func hitTest(_ point: CGPoint, with event: UIEvent?) -> UIView? {
94
- let hit = super.hitTest(point, with: event)
95
- guard let hit else { return nil }
96
- if hit === tabBar || hit.isDescendant(of: tabBar) { return hit }
97
- return nil
98
+ /// View que cubre todo el rootVC pero solo absorbe taps que aterrizan
99
+ /// sobre `allowedHitView` (el `UITabBar` floating). El resto pasa al
100
+ /// webview de Capacitor por debajo. Sin esto, este overlay bloquearía
101
+ /// TODO el contenido de la app.
102
+ private final class PassThroughView: UIView {
103
+ weak var allowedHitView: UIView?
104
+
105
+ override func hitTest(_ point: CGPoint, with event: UIEvent?) -> UIView? {
106
+ let hit = super.hitTest(point, with: event)
107
+ guard let hit, let allowed = allowedHitView else { return nil }
108
+ if hit === allowed || hit.isDescendant(of: allowed) { return hit }
109
+ return nil
110
+ }
98
111
  }
99
112
 
100
113
  /// Adjunta este view controller como child del rootViewController del
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ajuarezso/capacitor-liquid-glass",
3
- "version": "0.3.2",
3
+ "version": "0.3.3",
4
4
  "description": "iOS 26 Liquid Glass native chrome (TabBar, NavigationBar, Alerts, Sheets) for Capacitor apps. Falls back gracefully on iOS < 26 and Android.",
5
5
  "main": "dist/plugin.cjs.js",
6
6
  "module": "dist/esm/index.js",