react-native-nitro-modal 0.1.0
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.
- package/LICENSE +20 -0
- package/NitroModal.podspec +29 -0
- package/README.md +39 -0
- package/android/CMakeLists.txt +24 -0
- package/android/build.gradle +124 -0
- package/android/src/main/AndroidManifest.xml +2 -0
- package/android/src/main/cpp/cpp-adapter.cpp +11 -0
- package/android/src/main/java/com/margelo/nitro/nitromodal/BottomSheetPresenter.kt +284 -0
- package/android/src/main/java/com/margelo/nitro/nitromodal/HybridNitroModal.kt +312 -0
- package/android/src/main/java/com/margelo/nitro/nitromodal/ModalConfig.kt +50 -0
- package/android/src/main/java/com/margelo/nitro/nitromodal/ModalContentRoot.kt +115 -0
- package/android/src/main/java/com/margelo/nitro/nitromodal/ModalPresenter.kt +253 -0
- package/android/src/main/java/com/margelo/nitro/nitromodal/NitroModalHostView.kt +52 -0
- package/android/src/main/java/com/margelo/nitro/nitromodal/NitroModalPackage.kt +28 -0
- package/android/src/main/java/com/margelo/nitro/nitromodal/NitroModalViewManager.kt +67 -0
- package/android/src/main/java/com/margelo/nitro/nitromodal/PopupPresenter.kt +156 -0
- package/android/src/main/res/values/styles.xml +17 -0
- package/ios/BackdropView.swift +64 -0
- package/ios/HybridNitroModal.swift +329 -0
- package/ios/HybridNitroModalComponent+Children.mm +77 -0
- package/ios/ModalConfig.swift +73 -0
- package/ios/NitroModalHostView.swift +91 -0
- package/ios/PopupViewController.swift +223 -0
- package/ios/SheetViewController.swift +244 -0
- package/lib/module/NitroModal.js +188 -0
- package/lib/module/NitroModal.js.map +1 -0
- package/lib/module/NitroModal.nitro.js +4 -0
- package/lib/module/NitroModal.nitro.js.map +1 -0
- package/lib/module/NitroModalView.js +17 -0
- package/lib/module/NitroModalView.js.map +1 -0
- package/lib/module/NitroModalView.native.js +6 -0
- package/lib/module/NitroModalView.native.js.map +1 -0
- package/lib/module/index.js +4 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/typescript/package.json +1 -0
- package/lib/typescript/src/NitroModal.d.ts +59 -0
- package/lib/typescript/src/NitroModal.d.ts.map +1 -0
- package/lib/typescript/src/NitroModal.nitro.d.ts +78 -0
- package/lib/typescript/src/NitroModal.nitro.d.ts.map +1 -0
- package/lib/typescript/src/NitroModalView.d.ts +4 -0
- package/lib/typescript/src/NitroModalView.d.ts.map +1 -0
- package/lib/typescript/src/NitroModalView.native.d.ts +3 -0
- package/lib/typescript/src/NitroModalView.native.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +3 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/nitro.json +23 -0
- package/nitrogen/generated/android/c++/JDismissReason.hpp +64 -0
- package/nitrogen/generated/android/c++/JFunc_void.hpp +75 -0
- package/nitrogen/generated/android/c++/JFunc_void_DismissReason.hpp +77 -0
- package/nitrogen/generated/android/c++/JFunc_void_ModalContentArea.hpp +77 -0
- package/nitrogen/generated/android/c++/JFunc_void_double.hpp +75 -0
- package/nitrogen/generated/android/c++/JHybridNitroModalSpec.cpp +344 -0
- package/nitrogen/generated/android/c++/JHybridNitroModalSpec.hpp +106 -0
- package/nitrogen/generated/android/c++/JKeyboardBehavior.hpp +61 -0
- package/nitrogen/generated/android/c++/JModalContentArea.hpp +61 -0
- package/nitrogen/generated/android/c++/JModalMode.hpp +58 -0
- package/nitrogen/generated/android/c++/JPopupAnimation.hpp +61 -0
- package/nitrogen/generated/android/c++/JSheetDetent.hpp +64 -0
- package/nitrogen/generated/android/c++/views/JHybridNitroModalStateUpdater.cpp +174 -0
- package/nitrogen/generated/android/c++/views/JHybridNitroModalStateUpdater.hpp +54 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromodal/DismissReason.kt +25 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromodal/Func_void.kt +78 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromodal/Func_void_DismissReason.kt +78 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromodal/Func_void_ModalContentArea.kt +78 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromodal/Func_void_double.kt +78 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromodal/HybridNitroModalSpec.kt +237 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromodal/KeyboardBehavior.kt +24 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromodal/ModalContentArea.kt +56 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromodal/ModalMode.kt +23 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromodal/PopupAnimation.kt +24 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromodal/SheetDetent.kt +25 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromodal/nitromodalOnLoad.kt +35 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromodal/views/HybridNitroModalManager.kt +96 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromodal/views/HybridNitroModalStateUpdater.kt +23 -0
- package/nitrogen/generated/android/nitromodal+autolinking.cmake +83 -0
- package/nitrogen/generated/android/nitromodal+autolinking.gradle +27 -0
- package/nitrogen/generated/android/nitromodalOnLoad.cpp +64 -0
- package/nitrogen/generated/android/nitromodalOnLoad.hpp +34 -0
- package/nitrogen/generated/ios/NitroModal+autolinking.rb +62 -0
- package/nitrogen/generated/ios/NitroModal-Swift-Cxx-Bridge.cpp +65 -0
- package/nitrogen/generated/ios/NitroModal-Swift-Cxx-Bridge.hpp +237 -0
- package/nitrogen/generated/ios/NitroModal-Swift-Cxx-Umbrella.hpp +64 -0
- package/nitrogen/generated/ios/NitroModalAutolinking.mm +33 -0
- package/nitrogen/generated/ios/NitroModalAutolinking.swift +26 -0
- package/nitrogen/generated/ios/c++/HybridNitroModalSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridNitroModalSpecSwift.hpp +247 -0
- package/nitrogen/generated/ios/c++/views/HybridNitroModalComponent.mm +264 -0
- package/nitrogen/generated/ios/swift/DismissReason.swift +48 -0
- package/nitrogen/generated/ios/swift/Func_void.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_DismissReason.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_ModalContentArea.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_double.swift +46 -0
- package/nitrogen/generated/ios/swift/HybridNitroModalSpec.swift +77 -0
- package/nitrogen/generated/ios/swift/HybridNitroModalSpec_cxx.swift +554 -0
- package/nitrogen/generated/ios/swift/KeyboardBehavior.swift +44 -0
- package/nitrogen/generated/ios/swift/ModalContentArea.swift +34 -0
- package/nitrogen/generated/ios/swift/ModalMode.swift +40 -0
- package/nitrogen/generated/ios/swift/PopupAnimation.swift +44 -0
- package/nitrogen/generated/ios/swift/SheetDetent.swift +48 -0
- package/nitrogen/generated/shared/c++/DismissReason.hpp +84 -0
- package/nitrogen/generated/shared/c++/HybridNitroModalSpec.cpp +65 -0
- package/nitrogen/generated/shared/c++/HybridNitroModalSpec.hpp +124 -0
- package/nitrogen/generated/shared/c++/KeyboardBehavior.hpp +80 -0
- package/nitrogen/generated/shared/c++/ModalContentArea.hpp +87 -0
- package/nitrogen/generated/shared/c++/ModalMode.hpp +76 -0
- package/nitrogen/generated/shared/c++/PopupAnimation.hpp +80 -0
- package/nitrogen/generated/shared/c++/SheetDetent.hpp +84 -0
- package/nitrogen/generated/shared/c++/views/HybridNitroModalComponent.cpp +74 -0
- package/nitrogen/generated/shared/c++/views/HybridNitroModalComponent.hpp +151 -0
- package/nitrogen/generated/shared/json/NitroModalConfig.json +30 -0
- package/package.json +183 -0
- package/src/NitroModal.nitro.ts +92 -0
- package/src/NitroModal.tsx +292 -0
- package/src/NitroModalView.native.tsx +8 -0
- package/src/NitroModalView.tsx +24 -0
- package/src/index.tsx +12 -0
|
@@ -0,0 +1,554 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridNitroModalSpec_cxx.swift
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
import NitroModules
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* A class implementation that bridges HybridNitroModalSpec over to C++.
|
|
12
|
+
* In C++, we cannot use Swift protocols - so we need to wrap it in a class to make it strongly defined.
|
|
13
|
+
*
|
|
14
|
+
* Also, some Swift types need to be bridged with special handling:
|
|
15
|
+
* - Enums need to be wrapped in Structs, otherwise they cannot be accessed bi-directionally (Swift bug: https://github.com/swiftlang/swift/issues/75330)
|
|
16
|
+
* - Other HybridObjects need to be wrapped/unwrapped from the Swift TCxx wrapper
|
|
17
|
+
* - Throwing methods need to be wrapped with a Result<T, Error> type, as exceptions cannot be propagated to C++
|
|
18
|
+
*/
|
|
19
|
+
open class HybridNitroModalSpec_cxx {
|
|
20
|
+
/**
|
|
21
|
+
* The Swift <> C++ bridge's namespace (`margelo::nitro::nitromodal::bridge::swift`)
|
|
22
|
+
* from `NitroModal-Swift-Cxx-Bridge.hpp`.
|
|
23
|
+
* This contains specialized C++ templates, and C++ helper functions that can be accessed from Swift.
|
|
24
|
+
*/
|
|
25
|
+
public typealias bridge = margelo.nitro.nitromodal.bridge.swift
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Holds an instance of the `HybridNitroModalSpec` Swift protocol.
|
|
29
|
+
*/
|
|
30
|
+
private var __implementation: any HybridNitroModalSpec
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Holds a weak pointer to the C++ class that wraps the Swift class.
|
|
34
|
+
*/
|
|
35
|
+
private var __cxxPart: bridge.std__weak_ptr_HybridNitroModalSpec_
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Create a new `HybridNitroModalSpec_cxx` that wraps the given `HybridNitroModalSpec`.
|
|
39
|
+
* All properties and methods bridge to C++ types.
|
|
40
|
+
*/
|
|
41
|
+
public init(_ implementation: any HybridNitroModalSpec) {
|
|
42
|
+
self.__implementation = implementation
|
|
43
|
+
self.__cxxPart = .init()
|
|
44
|
+
/* no base class */
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Get the actual `HybridNitroModalSpec` instance this class wraps.
|
|
49
|
+
*/
|
|
50
|
+
@inline(__always)
|
|
51
|
+
public func getHybridNitroModalSpec() -> any HybridNitroModalSpec {
|
|
52
|
+
return __implementation
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Casts this instance to a retained unsafe raw pointer.
|
|
57
|
+
* This acquires one additional strong reference on the object!
|
|
58
|
+
*/
|
|
59
|
+
public func toUnsafe() -> UnsafeMutableRawPointer {
|
|
60
|
+
return Unmanaged.passRetained(self).toOpaque()
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Casts an unsafe pointer to a `HybridNitroModalSpec_cxx`.
|
|
65
|
+
* The pointer has to be a retained opaque `Unmanaged<HybridNitroModalSpec_cxx>`.
|
|
66
|
+
* This removes one strong reference from the object!
|
|
67
|
+
*/
|
|
68
|
+
public class func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> HybridNitroModalSpec_cxx {
|
|
69
|
+
return Unmanaged<HybridNitroModalSpec_cxx>.fromOpaque(pointer).takeRetainedValue()
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Gets (or creates) the C++ part of this Hybrid Object.
|
|
74
|
+
* The C++ part is a `std::shared_ptr<HybridNitroModalSpec>`.
|
|
75
|
+
*/
|
|
76
|
+
public func getCxxPart() -> bridge.std__shared_ptr_HybridNitroModalSpec_ {
|
|
77
|
+
let cachedCxxPart = self.__cxxPart.lock()
|
|
78
|
+
if Bool(fromCxx: cachedCxxPart) {
|
|
79
|
+
return cachedCxxPart
|
|
80
|
+
} else {
|
|
81
|
+
let newCxxPart = bridge.create_std__shared_ptr_HybridNitroModalSpec_(self.toUnsafe())
|
|
82
|
+
__cxxPart = bridge.weakify_std__shared_ptr_HybridNitroModalSpec_(newCxxPart)
|
|
83
|
+
return newCxxPart
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Get the memory size of the Swift class (plus size of any other allocations)
|
|
91
|
+
* so the JS VM can properly track it and garbage-collect the JS object if needed.
|
|
92
|
+
*/
|
|
93
|
+
@inline(__always)
|
|
94
|
+
public var memorySize: Int {
|
|
95
|
+
return MemoryHelper.getSizeOf(self.__implementation) + self.__implementation.memorySize
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Compares this object with the given [other] object for reference equality.
|
|
100
|
+
*/
|
|
101
|
+
@inline(__always)
|
|
102
|
+
public func equals(other: HybridNitroModalSpec_cxx) -> Bool {
|
|
103
|
+
return self.__implementation === other.__implementation
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Call dispose() on the Swift class.
|
|
108
|
+
* This _may_ be called manually from JS.
|
|
109
|
+
*/
|
|
110
|
+
@inline(__always)
|
|
111
|
+
public func dispose() {
|
|
112
|
+
self.__implementation.dispose()
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Call toString() on the Swift class.
|
|
117
|
+
*/
|
|
118
|
+
@inline(__always)
|
|
119
|
+
public func toString() -> String {
|
|
120
|
+
return self.__implementation.toString()
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
// Properties
|
|
124
|
+
public final var isOpen: Bool {
|
|
125
|
+
@inline(__always)
|
|
126
|
+
get {
|
|
127
|
+
return self.__implementation.isOpen
|
|
128
|
+
}
|
|
129
|
+
@inline(__always)
|
|
130
|
+
set {
|
|
131
|
+
self.__implementation.isOpen = newValue
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
public final var mode: Int32 {
|
|
136
|
+
@inline(__always)
|
|
137
|
+
get {
|
|
138
|
+
return self.__implementation.mode.rawValue
|
|
139
|
+
}
|
|
140
|
+
@inline(__always)
|
|
141
|
+
set {
|
|
142
|
+
self.__implementation.mode = margelo.nitro.nitromodal.ModalMode(rawValue: newValue)!
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
public final var detents: bridge.std__vector_SheetDetent_ {
|
|
147
|
+
@inline(__always)
|
|
148
|
+
get {
|
|
149
|
+
return { () -> bridge.std__vector_SheetDetent_ in
|
|
150
|
+
var __vector = bridge.create_std__vector_SheetDetent_(self.__implementation.detents.count)
|
|
151
|
+
for __item in self.__implementation.detents {
|
|
152
|
+
__vector.push_back(__item)
|
|
153
|
+
}
|
|
154
|
+
return __vector
|
|
155
|
+
}()
|
|
156
|
+
}
|
|
157
|
+
@inline(__always)
|
|
158
|
+
set {
|
|
159
|
+
self.__implementation.detents = newValue.map({ __item in __item })
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
public final var initialDetentIndex: Double {
|
|
164
|
+
@inline(__always)
|
|
165
|
+
get {
|
|
166
|
+
return self.__implementation.initialDetentIndex
|
|
167
|
+
}
|
|
168
|
+
@inline(__always)
|
|
169
|
+
set {
|
|
170
|
+
self.__implementation.initialDetentIndex = newValue
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
public final var backdropColor: Double {
|
|
175
|
+
@inline(__always)
|
|
176
|
+
get {
|
|
177
|
+
return self.__implementation.backdropColor
|
|
178
|
+
}
|
|
179
|
+
@inline(__always)
|
|
180
|
+
set {
|
|
181
|
+
self.__implementation.backdropColor = newValue
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
public final var backdropOpacity: Double {
|
|
186
|
+
@inline(__always)
|
|
187
|
+
get {
|
|
188
|
+
return self.__implementation.backdropOpacity
|
|
189
|
+
}
|
|
190
|
+
@inline(__always)
|
|
191
|
+
set {
|
|
192
|
+
self.__implementation.backdropOpacity = newValue
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
public final var backdropBlurRadius: Double {
|
|
197
|
+
@inline(__always)
|
|
198
|
+
get {
|
|
199
|
+
return self.__implementation.backdropBlurRadius
|
|
200
|
+
}
|
|
201
|
+
@inline(__always)
|
|
202
|
+
set {
|
|
203
|
+
self.__implementation.backdropBlurRadius = newValue
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
public final var dismissOnBackdropPress: Bool {
|
|
208
|
+
@inline(__always)
|
|
209
|
+
get {
|
|
210
|
+
return self.__implementation.dismissOnBackdropPress
|
|
211
|
+
}
|
|
212
|
+
@inline(__always)
|
|
213
|
+
set {
|
|
214
|
+
self.__implementation.dismissOnBackdropPress = newValue
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
public final var dismissOnSwipe: Bool {
|
|
219
|
+
@inline(__always)
|
|
220
|
+
get {
|
|
221
|
+
return self.__implementation.dismissOnSwipe
|
|
222
|
+
}
|
|
223
|
+
@inline(__always)
|
|
224
|
+
set {
|
|
225
|
+
self.__implementation.dismissOnSwipe = newValue
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
public final var dismissOnBackButton: Bool {
|
|
230
|
+
@inline(__always)
|
|
231
|
+
get {
|
|
232
|
+
return self.__implementation.dismissOnBackButton
|
|
233
|
+
}
|
|
234
|
+
@inline(__always)
|
|
235
|
+
set {
|
|
236
|
+
self.__implementation.dismissOnBackButton = newValue
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
public final var grabberVisible: Bool {
|
|
241
|
+
@inline(__always)
|
|
242
|
+
get {
|
|
243
|
+
return self.__implementation.grabberVisible
|
|
244
|
+
}
|
|
245
|
+
@inline(__always)
|
|
246
|
+
set {
|
|
247
|
+
self.__implementation.grabberVisible = newValue
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
public final var cornerRadius: Double {
|
|
252
|
+
@inline(__always)
|
|
253
|
+
get {
|
|
254
|
+
return self.__implementation.cornerRadius
|
|
255
|
+
}
|
|
256
|
+
@inline(__always)
|
|
257
|
+
set {
|
|
258
|
+
self.__implementation.cornerRadius = newValue
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
public final var contentBackgroundColor: bridge.std__optional_double_ {
|
|
263
|
+
@inline(__always)
|
|
264
|
+
get {
|
|
265
|
+
return { () -> bridge.std__optional_double_ in
|
|
266
|
+
if let __unwrappedValue = self.__implementation.contentBackgroundColor {
|
|
267
|
+
return bridge.create_std__optional_double_(__unwrappedValue)
|
|
268
|
+
} else {
|
|
269
|
+
return .init()
|
|
270
|
+
}
|
|
271
|
+
}()
|
|
272
|
+
}
|
|
273
|
+
@inline(__always)
|
|
274
|
+
set {
|
|
275
|
+
self.__implementation.contentBackgroundColor = { () -> Double? in
|
|
276
|
+
if bridge.has_value_std__optional_double_(newValue) {
|
|
277
|
+
let __unwrapped = bridge.get_std__optional_double_(newValue)
|
|
278
|
+
return __unwrapped
|
|
279
|
+
} else {
|
|
280
|
+
return nil
|
|
281
|
+
}
|
|
282
|
+
}()
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
public final var keyboardBehavior: Int32 {
|
|
287
|
+
@inline(__always)
|
|
288
|
+
get {
|
|
289
|
+
return self.__implementation.keyboardBehavior.rawValue
|
|
290
|
+
}
|
|
291
|
+
@inline(__always)
|
|
292
|
+
set {
|
|
293
|
+
self.__implementation.keyboardBehavior = margelo.nitro.nitromodal.KeyboardBehavior(rawValue: newValue)!
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
public final var popupAnimation: Int32 {
|
|
298
|
+
@inline(__always)
|
|
299
|
+
get {
|
|
300
|
+
return self.__implementation.popupAnimation.rawValue
|
|
301
|
+
}
|
|
302
|
+
@inline(__always)
|
|
303
|
+
set {
|
|
304
|
+
self.__implementation.popupAnimation = margelo.nitro.nitromodal.PopupAnimation(rawValue: newValue)!
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
public final var onPresent: bridge.std__optional_std__function_void____ {
|
|
309
|
+
@inline(__always)
|
|
310
|
+
get {
|
|
311
|
+
return { () -> bridge.std__optional_std__function_void____ in
|
|
312
|
+
if let __unwrappedValue = self.__implementation.onPresent {
|
|
313
|
+
return bridge.create_std__optional_std__function_void____({ () -> bridge.Func_void in
|
|
314
|
+
let __closureWrapper = Func_void(__unwrappedValue)
|
|
315
|
+
return bridge.create_Func_void(__closureWrapper.toUnsafe())
|
|
316
|
+
}())
|
|
317
|
+
} else {
|
|
318
|
+
return .init()
|
|
319
|
+
}
|
|
320
|
+
}()
|
|
321
|
+
}
|
|
322
|
+
@inline(__always)
|
|
323
|
+
set {
|
|
324
|
+
self.__implementation.onPresent = { () -> (() -> Void)? in
|
|
325
|
+
if bridge.has_value_std__optional_std__function_void____(newValue) {
|
|
326
|
+
let __unwrapped = bridge.get_std__optional_std__function_void____(newValue)
|
|
327
|
+
return { () -> () -> Void in
|
|
328
|
+
let __wrappedFunction = bridge.wrap_Func_void(__unwrapped)
|
|
329
|
+
return { () -> Void in
|
|
330
|
+
__wrappedFunction.call()
|
|
331
|
+
}
|
|
332
|
+
}()
|
|
333
|
+
} else {
|
|
334
|
+
return nil
|
|
335
|
+
}
|
|
336
|
+
}()
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
public final var onDismiss: bridge.std__optional_std__function_void_DismissReason____reason______ {
|
|
341
|
+
@inline(__always)
|
|
342
|
+
get {
|
|
343
|
+
return { () -> bridge.std__optional_std__function_void_DismissReason____reason______ in
|
|
344
|
+
if let __unwrappedValue = self.__implementation.onDismiss {
|
|
345
|
+
return bridge.create_std__optional_std__function_void_DismissReason____reason______({ () -> bridge.Func_void_DismissReason in
|
|
346
|
+
let __closureWrapper = Func_void_DismissReason(__unwrappedValue)
|
|
347
|
+
return bridge.create_Func_void_DismissReason(__closureWrapper.toUnsafe())
|
|
348
|
+
}())
|
|
349
|
+
} else {
|
|
350
|
+
return .init()
|
|
351
|
+
}
|
|
352
|
+
}()
|
|
353
|
+
}
|
|
354
|
+
@inline(__always)
|
|
355
|
+
set {
|
|
356
|
+
self.__implementation.onDismiss = { () -> ((_ reason: DismissReason) -> Void)? in
|
|
357
|
+
if bridge.has_value_std__optional_std__function_void_DismissReason____reason______(newValue) {
|
|
358
|
+
let __unwrapped = bridge.get_std__optional_std__function_void_DismissReason____reason______(newValue)
|
|
359
|
+
return { () -> (DismissReason) -> Void in
|
|
360
|
+
let __wrappedFunction = bridge.wrap_Func_void_DismissReason(__unwrapped)
|
|
361
|
+
return { (__reason: DismissReason) -> Void in
|
|
362
|
+
__wrappedFunction.call(__reason.rawValue)
|
|
363
|
+
}
|
|
364
|
+
}()
|
|
365
|
+
} else {
|
|
366
|
+
return nil
|
|
367
|
+
}
|
|
368
|
+
}()
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
public final var onDetentChange: bridge.std__optional_std__function_void_double____index______ {
|
|
373
|
+
@inline(__always)
|
|
374
|
+
get {
|
|
375
|
+
return { () -> bridge.std__optional_std__function_void_double____index______ in
|
|
376
|
+
if let __unwrappedValue = self.__implementation.onDetentChange {
|
|
377
|
+
return bridge.create_std__optional_std__function_void_double____index______({ () -> bridge.Func_void_double in
|
|
378
|
+
let __closureWrapper = Func_void_double(__unwrappedValue)
|
|
379
|
+
return bridge.create_Func_void_double(__closureWrapper.toUnsafe())
|
|
380
|
+
}())
|
|
381
|
+
} else {
|
|
382
|
+
return .init()
|
|
383
|
+
}
|
|
384
|
+
}()
|
|
385
|
+
}
|
|
386
|
+
@inline(__always)
|
|
387
|
+
set {
|
|
388
|
+
self.__implementation.onDetentChange = { () -> ((_ index: Double) -> Void)? in
|
|
389
|
+
if bridge.has_value_std__optional_std__function_void_double____index______(newValue) {
|
|
390
|
+
let __unwrapped = bridge.get_std__optional_std__function_void_double____index______(newValue)
|
|
391
|
+
return { () -> (Double) -> Void in
|
|
392
|
+
let __wrappedFunction = bridge.wrap_Func_void_double(__unwrapped)
|
|
393
|
+
return { (__index: Double) -> Void in
|
|
394
|
+
__wrappedFunction.call(__index)
|
|
395
|
+
}
|
|
396
|
+
}()
|
|
397
|
+
} else {
|
|
398
|
+
return nil
|
|
399
|
+
}
|
|
400
|
+
}()
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
public final var onBackdropPress: bridge.std__optional_std__function_void____ {
|
|
405
|
+
@inline(__always)
|
|
406
|
+
get {
|
|
407
|
+
return { () -> bridge.std__optional_std__function_void____ in
|
|
408
|
+
if let __unwrappedValue = self.__implementation.onBackdropPress {
|
|
409
|
+
return bridge.create_std__optional_std__function_void____({ () -> bridge.Func_void in
|
|
410
|
+
let __closureWrapper = Func_void(__unwrappedValue)
|
|
411
|
+
return bridge.create_Func_void(__closureWrapper.toUnsafe())
|
|
412
|
+
}())
|
|
413
|
+
} else {
|
|
414
|
+
return .init()
|
|
415
|
+
}
|
|
416
|
+
}()
|
|
417
|
+
}
|
|
418
|
+
@inline(__always)
|
|
419
|
+
set {
|
|
420
|
+
self.__implementation.onBackdropPress = { () -> (() -> Void)? in
|
|
421
|
+
if bridge.has_value_std__optional_std__function_void____(newValue) {
|
|
422
|
+
let __unwrapped = bridge.get_std__optional_std__function_void____(newValue)
|
|
423
|
+
return { () -> () -> Void in
|
|
424
|
+
let __wrappedFunction = bridge.wrap_Func_void(__unwrapped)
|
|
425
|
+
return { () -> Void in
|
|
426
|
+
__wrappedFunction.call()
|
|
427
|
+
}
|
|
428
|
+
}()
|
|
429
|
+
} else {
|
|
430
|
+
return nil
|
|
431
|
+
}
|
|
432
|
+
}()
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
public final var onBackButtonPress: bridge.std__optional_std__function_void____ {
|
|
437
|
+
@inline(__always)
|
|
438
|
+
get {
|
|
439
|
+
return { () -> bridge.std__optional_std__function_void____ in
|
|
440
|
+
if let __unwrappedValue = self.__implementation.onBackButtonPress {
|
|
441
|
+
return bridge.create_std__optional_std__function_void____({ () -> bridge.Func_void in
|
|
442
|
+
let __closureWrapper = Func_void(__unwrappedValue)
|
|
443
|
+
return bridge.create_Func_void(__closureWrapper.toUnsafe())
|
|
444
|
+
}())
|
|
445
|
+
} else {
|
|
446
|
+
return .init()
|
|
447
|
+
}
|
|
448
|
+
}()
|
|
449
|
+
}
|
|
450
|
+
@inline(__always)
|
|
451
|
+
set {
|
|
452
|
+
self.__implementation.onBackButtonPress = { () -> (() -> Void)? in
|
|
453
|
+
if bridge.has_value_std__optional_std__function_void____(newValue) {
|
|
454
|
+
let __unwrapped = bridge.get_std__optional_std__function_void____(newValue)
|
|
455
|
+
return { () -> () -> Void in
|
|
456
|
+
let __wrappedFunction = bridge.wrap_Func_void(__unwrapped)
|
|
457
|
+
return { () -> Void in
|
|
458
|
+
__wrappedFunction.call()
|
|
459
|
+
}
|
|
460
|
+
}()
|
|
461
|
+
} else {
|
|
462
|
+
return nil
|
|
463
|
+
}
|
|
464
|
+
}()
|
|
465
|
+
}
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
public final var onContentAreaChange: bridge.std__optional_std__function_void_const_ModalContentArea_____area______ {
|
|
469
|
+
@inline(__always)
|
|
470
|
+
get {
|
|
471
|
+
return { () -> bridge.std__optional_std__function_void_const_ModalContentArea_____area______ in
|
|
472
|
+
if let __unwrappedValue = self.__implementation.onContentAreaChange {
|
|
473
|
+
return bridge.create_std__optional_std__function_void_const_ModalContentArea_____area______({ () -> bridge.Func_void_ModalContentArea in
|
|
474
|
+
let __closureWrapper = Func_void_ModalContentArea(__unwrappedValue)
|
|
475
|
+
return bridge.create_Func_void_ModalContentArea(__closureWrapper.toUnsafe())
|
|
476
|
+
}())
|
|
477
|
+
} else {
|
|
478
|
+
return .init()
|
|
479
|
+
}
|
|
480
|
+
}()
|
|
481
|
+
}
|
|
482
|
+
@inline(__always)
|
|
483
|
+
set {
|
|
484
|
+
self.__implementation.onContentAreaChange = { () -> ((_ area: ModalContentArea) -> Void)? in
|
|
485
|
+
if bridge.has_value_std__optional_std__function_void_const_ModalContentArea_____area______(newValue) {
|
|
486
|
+
let __unwrapped = bridge.get_std__optional_std__function_void_const_ModalContentArea_____area______(newValue)
|
|
487
|
+
return { () -> (ModalContentArea) -> Void in
|
|
488
|
+
let __wrappedFunction = bridge.wrap_Func_void_ModalContentArea(__unwrapped)
|
|
489
|
+
return { (__area: ModalContentArea) -> Void in
|
|
490
|
+
__wrappedFunction.call(__area)
|
|
491
|
+
}
|
|
492
|
+
}()
|
|
493
|
+
} else {
|
|
494
|
+
return nil
|
|
495
|
+
}
|
|
496
|
+
}()
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
// Methods
|
|
501
|
+
@inline(__always)
|
|
502
|
+
public final func present() -> bridge.Result_void_ {
|
|
503
|
+
do {
|
|
504
|
+
try self.__implementation.present()
|
|
505
|
+
return bridge.create_Result_void_()
|
|
506
|
+
} catch (let __error) {
|
|
507
|
+
let __exceptionPtr = __error.toCpp()
|
|
508
|
+
return bridge.create_Result_void_(__exceptionPtr)
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
@inline(__always)
|
|
513
|
+
public final func dismiss() -> bridge.Result_void_ {
|
|
514
|
+
do {
|
|
515
|
+
try self.__implementation.dismiss()
|
|
516
|
+
return bridge.create_Result_void_()
|
|
517
|
+
} catch (let __error) {
|
|
518
|
+
let __exceptionPtr = __error.toCpp()
|
|
519
|
+
return bridge.create_Result_void_(__exceptionPtr)
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
@inline(__always)
|
|
524
|
+
public final func snapToDetent(index: Double) -> bridge.Result_void_ {
|
|
525
|
+
do {
|
|
526
|
+
try self.__implementation.snapToDetent(index: index)
|
|
527
|
+
return bridge.create_Result_void_()
|
|
528
|
+
} catch (let __error) {
|
|
529
|
+
let __exceptionPtr = __error.toCpp()
|
|
530
|
+
return bridge.create_Result_void_(__exceptionPtr)
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
public final func getView() -> UnsafeMutableRawPointer {
|
|
535
|
+
return Unmanaged.passRetained(__implementation.view).toOpaque()
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
public final func beforeUpdate() {
|
|
539
|
+
__implementation.beforeUpdate()
|
|
540
|
+
}
|
|
541
|
+
|
|
542
|
+
public final func afterUpdate() {
|
|
543
|
+
__implementation.afterUpdate()
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
public final func maybePrepareForRecycle() {
|
|
547
|
+
guard let recyclable = __implementation as? any RecyclableView else { return }
|
|
548
|
+
recyclable.prepareForRecycle()
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
public final func onDropView() {
|
|
552
|
+
__implementation.onDropView()
|
|
553
|
+
}
|
|
554
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// KeyboardBehavior.swift
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Represents the JS union `KeyboardBehavior`, backed by a C++ enum.
|
|
10
|
+
*/
|
|
11
|
+
public typealias KeyboardBehavior = margelo.nitro.nitromodal.KeyboardBehavior
|
|
12
|
+
|
|
13
|
+
public extension KeyboardBehavior {
|
|
14
|
+
/**
|
|
15
|
+
* Get a KeyboardBehavior for the given String value, or
|
|
16
|
+
* return `nil` if the given value was invalid/unknown.
|
|
17
|
+
*/
|
|
18
|
+
init?(fromString string: String) {
|
|
19
|
+
switch string {
|
|
20
|
+
case "pan":
|
|
21
|
+
self = .pan
|
|
22
|
+
case "resize":
|
|
23
|
+
self = .resize
|
|
24
|
+
case "none":
|
|
25
|
+
self = .none
|
|
26
|
+
default:
|
|
27
|
+
return nil
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Get the String value this KeyboardBehavior represents.
|
|
33
|
+
*/
|
|
34
|
+
var stringValue: String {
|
|
35
|
+
switch self {
|
|
36
|
+
case .pan:
|
|
37
|
+
return "pan"
|
|
38
|
+
case .resize:
|
|
39
|
+
return "resize"
|
|
40
|
+
case .none:
|
|
41
|
+
return "none"
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// ModalContentArea.swift
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
import NitroModules
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Represents an instance of `ModalContentArea`, backed by a C++ struct.
|
|
12
|
+
*/
|
|
13
|
+
public typealias ModalContentArea = margelo.nitro.nitromodal.ModalContentArea
|
|
14
|
+
|
|
15
|
+
public extension ModalContentArea {
|
|
16
|
+
private typealias bridge = margelo.nitro.nitromodal.bridge.swift
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Create a new instance of `ModalContentArea`.
|
|
20
|
+
*/
|
|
21
|
+
init(width: Double, height: Double) {
|
|
22
|
+
self.init(width, height)
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
@inline(__always)
|
|
26
|
+
var width: Double {
|
|
27
|
+
return self.__width
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
@inline(__always)
|
|
31
|
+
var height: Double {
|
|
32
|
+
return self.__height
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// ModalMode.swift
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Represents the JS union `ModalMode`, backed by a C++ enum.
|
|
10
|
+
*/
|
|
11
|
+
public typealias ModalMode = margelo.nitro.nitromodal.ModalMode
|
|
12
|
+
|
|
13
|
+
public extension ModalMode {
|
|
14
|
+
/**
|
|
15
|
+
* Get a ModalMode for the given String value, or
|
|
16
|
+
* return `nil` if the given value was invalid/unknown.
|
|
17
|
+
*/
|
|
18
|
+
init?(fromString string: String) {
|
|
19
|
+
switch string {
|
|
20
|
+
case "bottomSheet":
|
|
21
|
+
self = .bottomsheet
|
|
22
|
+
case "popup":
|
|
23
|
+
self = .popup
|
|
24
|
+
default:
|
|
25
|
+
return nil
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Get the String value this ModalMode represents.
|
|
31
|
+
*/
|
|
32
|
+
var stringValue: String {
|
|
33
|
+
switch self {
|
|
34
|
+
case .bottomsheet:
|
|
35
|
+
return "bottomSheet"
|
|
36
|
+
case .popup:
|
|
37
|
+
return "popup"
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// PopupAnimation.swift
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Represents the JS union `PopupAnimation`, backed by a C++ enum.
|
|
10
|
+
*/
|
|
11
|
+
public typealias PopupAnimation = margelo.nitro.nitromodal.PopupAnimation
|
|
12
|
+
|
|
13
|
+
public extension PopupAnimation {
|
|
14
|
+
/**
|
|
15
|
+
* Get a PopupAnimation for the given String value, or
|
|
16
|
+
* return `nil` if the given value was invalid/unknown.
|
|
17
|
+
*/
|
|
18
|
+
init?(fromString string: String) {
|
|
19
|
+
switch string {
|
|
20
|
+
case "none":
|
|
21
|
+
self = .none
|
|
22
|
+
case "scale":
|
|
23
|
+
self = .scale
|
|
24
|
+
case "fade":
|
|
25
|
+
self = .fade
|
|
26
|
+
default:
|
|
27
|
+
return nil
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Get the String value this PopupAnimation represents.
|
|
33
|
+
*/
|
|
34
|
+
var stringValue: String {
|
|
35
|
+
switch self {
|
|
36
|
+
case .none:
|
|
37
|
+
return "none"
|
|
38
|
+
case .scale:
|
|
39
|
+
return "scale"
|
|
40
|
+
case .fade:
|
|
41
|
+
return "fade"
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|