react-native-picture-selector 1.0.18 → 1.0.20

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.
@@ -369,6 +369,17 @@ enum PictureSelectorError: Error, LocalizedError {
369
369
  }
370
370
  }
371
371
 
372
+ // MARK: - Nitro registration helper
373
+
374
+ /// Called from NitroPictureSelectorOnLoad.mm at startup.
375
+ /// Creates a HybridPictureSelector instance and returns a retained raw pointer
376
+ /// to its HybridHybridPictureSelectorSpec_cxx wrapper.
377
+ /// The caller (C++ factory) takes ownership via create_std__shared_ptr_HybridHybridPictureSelectorSpec_.
378
+ @_cdecl("NitroPictureSelectorMakeHybrid")
379
+ public func NitroPictureSelectorMakeHybrid() -> UnsafeMutableRawPointer {
380
+ HybridPictureSelector().getCxxWrapper().toUnsafe()
381
+ }
382
+
372
383
  // MARK: - UIColor hex initialiser
373
384
 
374
385
  extension UIColor {
@@ -0,0 +1,41 @@
1
+ //
2
+ // NitroPictureSelectorOnLoad.mm
3
+ // Registers HybridPictureSelector with Nitro's HybridObjectRegistry.
4
+ //
5
+ // The +load ObjC method runs before main(), guaranteeing the factory is
6
+ // available when JS calls NitroModules.createHybridObject("PictureSelector").
7
+ //
8
+ // We bridge to Swift via @_cdecl("NitroPictureSelectorMakeHybrid") to avoid
9
+ // ambiguous Swift class constructor syntax from C++.
10
+ //
11
+
12
+ #import <Foundation/Foundation.h>
13
+ #import <NitroModules/HybridObjectRegistry.hpp>
14
+ #import "NitroPictureSelector-Swift-Cxx-Umbrella.hpp"
15
+ #import "HybridHybridPictureSelectorSpecSwift.hpp"
16
+
17
+ // Defined in HybridPictureSelector.swift via @_cdecl.
18
+ // Creates a HybridPictureSelector instance and returns a retained raw pointer
19
+ // to its HybridHybridPictureSelectorSpec_cxx wrapper.
20
+ extern "C" void* NitroPictureSelectorMakeHybrid();
21
+
22
+ using namespace margelo::nitro;
23
+ using namespace margelo::pictureselector;
24
+ using namespace margelo::pictureselector::bridge::swift;
25
+
26
+ @interface NitroPictureSelectorOnLoad: NSObject
27
+ @end
28
+
29
+ @implementation NitroPictureSelectorOnLoad
30
+
31
+ + (void)load {
32
+ HybridObjectRegistry::registerHybridObjectConstructor(
33
+ "PictureSelector",
34
+ []() -> std::shared_ptr<HybridObject> {
35
+ void* ptr = NitroPictureSelectorMakeHybrid();
36
+ return create_std__shared_ptr_HybridHybridPictureSelectorSpec_(ptr);
37
+ }
38
+ );
39
+ }
40
+
41
+ @end
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-picture-selector",
3
- "version": "1.0.18",
3
+ "version": "1.0.20",
4
4
  "description": "High-performance photo/video picker for React Native using Nitro Modules",
5
5
  "main": "lib/commonjs/index.js",
6
6
  "module": "lib/module/index.js",