expo-simple-gallery 0.3.0 → 0.3.2

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.
@@ -4,10 +4,8 @@ import UIKit
4
4
 
5
5
  final class ExpoSimpleGalleryView: ExpoView, ContextMenuActionsDelegate {
6
6
  var galleryView: GalleryGridView?
7
- private var overlays: [String: [Int: ReactMountingComponent]] = [
8
- "thumbnail": [:],
9
- "sectionHeader": [:],
10
- ]
7
+ private var thumbnailOverlays: [Int: ReactMountingComponent] = [:]
8
+ private var sectionHeaderOverlays: [Int: ReactMountingComponent] = [:]
11
9
 
12
10
  let onOverlayPreloadRequested = EventDispatcher()
13
11
  let onThumbnailPress = EventDispatcher()
@@ -53,7 +51,7 @@ final class ExpoSimpleGalleryView: ExpoView, ContextMenuActionsDelegate {
53
51
  return
54
52
  }
55
53
  let component = ReactMountingComponent(view: childComponentView, index: index)
56
- self.overlays["thumbnail"]?[id] = component
54
+ self.thumbnailOverlays[id] = component
57
55
 
58
56
  if let cell = self.galleryView?.cell(withIndex: id) {
59
57
  self.mount(to: cell, overlay: component)
@@ -62,7 +60,7 @@ final class ExpoSimpleGalleryView: ExpoView, ContextMenuActionsDelegate {
62
60
  guard let sectionId = Int(label.replacingOccurrences(of: "SectionHeaderOverlay_", with: ""))
63
61
  else { return }
64
62
  let component = ReactMountingComponent(view: childComponentView, index: index)
65
- self.overlays["sectionHeader"]?[sectionId] = component
63
+ self.sectionHeaderOverlays[sectionId] = component
66
64
 
67
65
  if let galleryView = self.galleryView, galleryView.isGroupedLayout {
68
66
  let indexPath = IndexPath(item: 0, section: sectionId)
@@ -86,11 +84,11 @@ final class ExpoSimpleGalleryView: ExpoView, ContextMenuActionsDelegate {
86
84
  guard let id = Int(label.replacingOccurrences(of: "GalleryViewOverlay_", with: "")) else {
87
85
  return
88
86
  }
89
- overlays["thumbnail"]?[id] = nil
87
+ thumbnailOverlays[id] = nil
90
88
  } else if label.starts(with: "SectionHeaderOverlay_") {
91
89
  guard let sectionId = Int(label.replacingOccurrences(of: "SectionHeaderOverlay_", with: ""))
92
90
  else { return }
93
- overlays["sectionHeader"]?[sectionId] = nil
91
+ sectionHeaderOverlays[sectionId] = nil
94
92
  }
95
93
  }
96
94
 
@@ -146,9 +144,9 @@ extension ExpoSimpleGalleryView: OverlayMountingDelegate {
146
144
  guard let containerId = container.containerIdentifier else { return }
147
145
  var component: ReactMountingComponent?
148
146
  if container is GalleryCell {
149
- component = overlays["thumbnail"]?[containerId]
147
+ component = thumbnailOverlays[containerId]
150
148
  } else if container is GallerySectionHeaderView {
151
- component = overlays["sectionHeader"]?[containerId]
149
+ component = sectionHeaderOverlays[containerId]
152
150
  }
153
151
 
154
152
  if let component = component {
@@ -51,7 +51,7 @@ struct PageMediaView: View {
51
51
  PlayerView(player: player)
52
52
  .frame(width: proxy.size.width, height: proxy.size.height)
53
53
  case .none:
54
- Color.black
54
+ Color.clear
55
55
  }
56
56
  }
57
57
  .scaleEffect(scale)
@@ -33,7 +33,7 @@ final class SwiftUIGalleryHostView: ExpoView, ViewerProtocol {
33
33
  }
34
34
  )
35
35
  let hc = UIHostingController(rootView: swiftUIView)
36
- hc.view.backgroundColor = .black
36
+ hc.view.backgroundColor = .clear
37
37
  return hc
38
38
  }()
39
39
 
@@ -47,7 +47,7 @@ final class SwiftUIGalleryHostView: ExpoView, ViewerProtocol {
47
47
 
48
48
  // Attach hostingController's view as a subview (triggers lazy init safely)
49
49
  let hostedView = hostingController.view!
50
- hostedView.backgroundColor = .black
50
+ hostedView.backgroundColor = .clear
51
51
  hostedView.translatesAutoresizingMaskIntoConstraints = false
52
52
  addSubview(hostedView)
53
53
 
@@ -12,15 +12,10 @@ struct SwiftUIGalleryView: View {
12
12
  var onImageLoaded: (Int, String) -> Void
13
13
  var onDismissAttempt: () -> Void
14
14
 
15
- @State private var backgroundOpacity: Double = 1.0
16
15
  var body: some View {
17
16
  ZStack {
18
- Color.black
19
- .opacity(backgroundOpacity)
20
- .ignoresSafeArea()
21
-
22
17
  if viewModel.uris.isEmpty {
23
- Color.black.ignoresSafeArea()
18
+ Color.clear.ignoresSafeArea()
24
19
  } else {
25
20
  TabView(selection: $viewModel.index) {
26
21
  ForEach(viewModel.uris.indices, id: \.self) { i in
@@ -32,7 +27,7 @@ struct SwiftUIGalleryView: View {
32
27
  onDragProgress: { _ in }
33
28
  )
34
29
  .tag(i)
35
- .background(Color.black)
30
+ .background(.clear)
36
31
  .ignoresSafeArea()
37
32
  }
38
33
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-simple-gallery",
3
- "version": "0.3.0",
3
+ "version": "0.3.2",
4
4
  "description": "Image gallery view",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",