concentric-sheet 0.0.1
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.
Potentially problematic release.
This version of concentric-sheet might be problematic. Click here for more details.
- package/NitroConcentricSheet.podspec +31 -0
- package/README.md +95 -0
- package/ios/Bridge.h +8 -0
- package/ios/SheetModalController.swift +294 -0
- package/lib/NativeSheetModal.d.ts +22 -0
- package/lib/NativeSheetModal.js +128 -0
- package/lib/index.d.ts +3 -0
- package/lib/index.js +1 -0
- package/lib/specs/SheetModalController.nitro.d.ts +34 -0
- package/lib/specs/SheetModalController.nitro.js +1 -0
- package/nitro.json +23 -0
- package/nitrogen/generated/.gitattributes +1 -0
- package/nitrogen/generated/ios/NitroConcentricSheet+autolinking.rb +60 -0
- package/nitrogen/generated/ios/NitroConcentricSheet-Swift-Cxx-Bridge.cpp +33 -0
- package/nitrogen/generated/ios/NitroConcentricSheet-Swift-Cxx-Bridge.hpp +184 -0
- package/nitrogen/generated/ios/NitroConcentricSheet-Swift-Cxx-Umbrella.hpp +63 -0
- package/nitrogen/generated/ios/NitroConcentricSheetAutolinking.mm +33 -0
- package/nitrogen/generated/ios/NitroConcentricSheetAutolinking.swift +26 -0
- package/nitrogen/generated/ios/c++/HybridSheetModalControllerSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridSheetModalControllerSpecSwift.hpp +108 -0
- package/nitrogen/generated/ios/swift/HybridSheetModalControllerSpec.swift +56 -0
- package/nitrogen/generated/ios/swift/HybridSheetModalControllerSpec_cxx.swift +150 -0
- package/nitrogen/generated/ios/swift/ModalCornerConfiguration.swift +83 -0
- package/nitrogen/generated/ios/swift/ModalCornerConfigurationType.swift +48 -0
- package/nitrogen/generated/ios/swift/ModalViewBackground.swift +40 -0
- package/nitrogen/generated/ios/swift/PresentedModalConfig.swift +111 -0
- package/nitrogen/generated/ios/swift/SheetDetentIdentifier.swift +40 -0
- package/nitrogen/generated/ios/swift/SheetPresentationConfig.swift +160 -0
- package/nitrogen/generated/shared/c++/HybridSheetModalControllerSpec.cpp +22 -0
- package/nitrogen/generated/shared/c++/HybridSheetModalControllerSpec.hpp +64 -0
- package/nitrogen/generated/shared/c++/ModalCornerConfiguration.hpp +97 -0
- package/nitrogen/generated/shared/c++/ModalCornerConfigurationType.hpp +84 -0
- package/nitrogen/generated/shared/c++/ModalViewBackground.hpp +76 -0
- package/nitrogen/generated/shared/c++/PresentedModalConfig.hpp +111 -0
- package/nitrogen/generated/shared/c++/SheetDetentIdentifier.hpp +76 -0
- package/nitrogen/generated/shared/c++/SheetPresentationConfig.hpp +114 -0
- package/package.json +103 -0
- package/react-native.config.js +13 -0
- package/src/NativeSheetModal.tsx +204 -0
- package/src/index.ts +15 -0
- package/src/specs/SheetModalController.nitro.ts +41 -0
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridSheetModalControllerSpec_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 HybridSheetModalControllerSpec 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 HybridSheetModalControllerSpec_cxx {
|
|
20
|
+
/**
|
|
21
|
+
* The Swift <> C++ bridge's namespace (`margelo::nitro::concentricsheet::bridge::swift`)
|
|
22
|
+
* from `NitroConcentricSheet-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.concentricsheet.bridge.swift
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Holds an instance of the `HybridSheetModalControllerSpec` Swift protocol.
|
|
29
|
+
*/
|
|
30
|
+
private var __implementation: any HybridSheetModalControllerSpec
|
|
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_HybridSheetModalControllerSpec_
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Create a new `HybridSheetModalControllerSpec_cxx` that wraps the given `HybridSheetModalControllerSpec`.
|
|
39
|
+
* All properties and methods bridge to C++ types.
|
|
40
|
+
*/
|
|
41
|
+
public init(_ implementation: any HybridSheetModalControllerSpec) {
|
|
42
|
+
self.__implementation = implementation
|
|
43
|
+
self.__cxxPart = .init()
|
|
44
|
+
/* no base class */
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Get the actual `HybridSheetModalControllerSpec` instance this class wraps.
|
|
49
|
+
*/
|
|
50
|
+
@inline(__always)
|
|
51
|
+
public func getHybridSheetModalControllerSpec() -> any HybridSheetModalControllerSpec {
|
|
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 `HybridSheetModalControllerSpec_cxx`.
|
|
65
|
+
* The pointer has to be a retained opaque `Unmanaged<HybridSheetModalControllerSpec_cxx>`.
|
|
66
|
+
* This removes one strong reference from the object!
|
|
67
|
+
*/
|
|
68
|
+
public class func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> HybridSheetModalControllerSpec_cxx {
|
|
69
|
+
return Unmanaged<HybridSheetModalControllerSpec_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<HybridSheetModalControllerSpec>`.
|
|
75
|
+
*/
|
|
76
|
+
public func getCxxPart() -> bridge.std__shared_ptr_HybridSheetModalControllerSpec_ {
|
|
77
|
+
let cachedCxxPart = self.__cxxPart.lock()
|
|
78
|
+
if Bool(fromCxx: cachedCxxPart) {
|
|
79
|
+
return cachedCxxPart
|
|
80
|
+
} else {
|
|
81
|
+
let newCxxPart = bridge.create_std__shared_ptr_HybridSheetModalControllerSpec_(self.toUnsafe())
|
|
82
|
+
__cxxPart = bridge.weakify_std__shared_ptr_HybridSheetModalControllerSpec_(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: HybridSheetModalControllerSpec_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
|
+
|
|
125
|
+
|
|
126
|
+
// Methods
|
|
127
|
+
@inline(__always)
|
|
128
|
+
public final func applyPresentedModalConfig(config: PresentedModalConfig) -> bridge.Result_bool_ {
|
|
129
|
+
do {
|
|
130
|
+
let __result = try self.__implementation.applyPresentedModalConfig(config: config)
|
|
131
|
+
let __resultCpp = __result
|
|
132
|
+
return bridge.create_Result_bool_(__resultCpp)
|
|
133
|
+
} catch (let __error) {
|
|
134
|
+
let __exceptionPtr = __error.toCpp()
|
|
135
|
+
return bridge.create_Result_bool_(__exceptionPtr)
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
@inline(__always)
|
|
140
|
+
public final func dismissPresentedModal(animated: Bool) -> bridge.Result_bool_ {
|
|
141
|
+
do {
|
|
142
|
+
let __result = try self.__implementation.dismissPresentedModal(animated: animated)
|
|
143
|
+
let __resultCpp = __result
|
|
144
|
+
return bridge.create_Result_bool_(__resultCpp)
|
|
145
|
+
} catch (let __error) {
|
|
146
|
+
let __exceptionPtr = __error.toCpp()
|
|
147
|
+
return bridge.create_Result_bool_(__exceptionPtr)
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// ModalCornerConfiguration.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 `ModalCornerConfiguration`, backed by a C++ struct.
|
|
12
|
+
*/
|
|
13
|
+
public typealias ModalCornerConfiguration = margelo.nitro.concentricsheet.ModalCornerConfiguration
|
|
14
|
+
|
|
15
|
+
public extension ModalCornerConfiguration {
|
|
16
|
+
private typealias bridge = margelo.nitro.concentricsheet.bridge.swift
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Create a new instance of `ModalCornerConfiguration`.
|
|
20
|
+
*/
|
|
21
|
+
init(type: ModalCornerConfigurationType, radius: Double?, minimumRadius: Double?, maximumRadius: Double?) {
|
|
22
|
+
self.init(type, { () -> bridge.std__optional_double_ in
|
|
23
|
+
if let __unwrappedValue = radius {
|
|
24
|
+
return bridge.create_std__optional_double_(__unwrappedValue)
|
|
25
|
+
} else {
|
|
26
|
+
return .init()
|
|
27
|
+
}
|
|
28
|
+
}(), { () -> bridge.std__optional_double_ in
|
|
29
|
+
if let __unwrappedValue = minimumRadius {
|
|
30
|
+
return bridge.create_std__optional_double_(__unwrappedValue)
|
|
31
|
+
} else {
|
|
32
|
+
return .init()
|
|
33
|
+
}
|
|
34
|
+
}(), { () -> bridge.std__optional_double_ in
|
|
35
|
+
if let __unwrappedValue = maximumRadius {
|
|
36
|
+
return bridge.create_std__optional_double_(__unwrappedValue)
|
|
37
|
+
} else {
|
|
38
|
+
return .init()
|
|
39
|
+
}
|
|
40
|
+
}())
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
@inline(__always)
|
|
44
|
+
var type: ModalCornerConfigurationType {
|
|
45
|
+
return self.__type
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
@inline(__always)
|
|
49
|
+
var radius: Double? {
|
|
50
|
+
return { () -> Double? in
|
|
51
|
+
if bridge.has_value_std__optional_double_(self.__radius) {
|
|
52
|
+
let __unwrapped = bridge.get_std__optional_double_(self.__radius)
|
|
53
|
+
return __unwrapped
|
|
54
|
+
} else {
|
|
55
|
+
return nil
|
|
56
|
+
}
|
|
57
|
+
}()
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
@inline(__always)
|
|
61
|
+
var minimumRadius: Double? {
|
|
62
|
+
return { () -> Double? in
|
|
63
|
+
if bridge.has_value_std__optional_double_(self.__minimumRadius) {
|
|
64
|
+
let __unwrapped = bridge.get_std__optional_double_(self.__minimumRadius)
|
|
65
|
+
return __unwrapped
|
|
66
|
+
} else {
|
|
67
|
+
return nil
|
|
68
|
+
}
|
|
69
|
+
}()
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
@inline(__always)
|
|
73
|
+
var maximumRadius: Double? {
|
|
74
|
+
return { () -> Double? in
|
|
75
|
+
if bridge.has_value_std__optional_double_(self.__maximumRadius) {
|
|
76
|
+
let __unwrapped = bridge.get_std__optional_double_(self.__maximumRadius)
|
|
77
|
+
return __unwrapped
|
|
78
|
+
} else {
|
|
79
|
+
return nil
|
|
80
|
+
}
|
|
81
|
+
}()
|
|
82
|
+
}
|
|
83
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// ModalCornerConfigurationType.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 `ModalCornerConfigurationType`, backed by a C++ enum.
|
|
10
|
+
*/
|
|
11
|
+
public typealias ModalCornerConfigurationType = margelo.nitro.concentricsheet.ModalCornerConfigurationType
|
|
12
|
+
|
|
13
|
+
public extension ModalCornerConfigurationType {
|
|
14
|
+
/**
|
|
15
|
+
* Get a ModalCornerConfigurationType 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 "fixed":
|
|
23
|
+
self = .fixed
|
|
24
|
+
case "containerConcentric":
|
|
25
|
+
self = .containerconcentric
|
|
26
|
+
case "capsule":
|
|
27
|
+
self = .capsule
|
|
28
|
+
default:
|
|
29
|
+
return nil
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Get the String value this ModalCornerConfigurationType represents.
|
|
35
|
+
*/
|
|
36
|
+
var stringValue: String {
|
|
37
|
+
switch self {
|
|
38
|
+
case .none:
|
|
39
|
+
return "none"
|
|
40
|
+
case .fixed:
|
|
41
|
+
return "fixed"
|
|
42
|
+
case .containerconcentric:
|
|
43
|
+
return "containerConcentric"
|
|
44
|
+
case .capsule:
|
|
45
|
+
return "capsule"
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// ModalViewBackground.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 `ModalViewBackground`, backed by a C++ enum.
|
|
10
|
+
*/
|
|
11
|
+
public typealias ModalViewBackground = margelo.nitro.concentricsheet.ModalViewBackground
|
|
12
|
+
|
|
13
|
+
public extension ModalViewBackground {
|
|
14
|
+
/**
|
|
15
|
+
* Get a ModalViewBackground 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 "clear":
|
|
21
|
+
self = .clear
|
|
22
|
+
case "systemBackground":
|
|
23
|
+
self = .systembackground
|
|
24
|
+
default:
|
|
25
|
+
return nil
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Get the String value this ModalViewBackground represents.
|
|
31
|
+
*/
|
|
32
|
+
var stringValue: String {
|
|
33
|
+
switch self {
|
|
34
|
+
case .clear:
|
|
35
|
+
return "clear"
|
|
36
|
+
case .systembackground:
|
|
37
|
+
return "systemBackground"
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// PresentedModalConfig.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 `PresentedModalConfig`, backed by a C++ struct.
|
|
12
|
+
*/
|
|
13
|
+
public typealias PresentedModalConfig = margelo.nitro.concentricsheet.PresentedModalConfig
|
|
14
|
+
|
|
15
|
+
public extension PresentedModalConfig {
|
|
16
|
+
private typealias bridge = margelo.nitro.concentricsheet.bridge.swift
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Create a new instance of `PresentedModalConfig`.
|
|
20
|
+
*/
|
|
21
|
+
init(isModalInPresentation: Bool?, preferredContentWidth: Double?, preferredContentHeight: Double?, modalViewBackground: ModalViewBackground?, cornerConfiguration: ModalCornerConfiguration?, sheet: SheetPresentationConfig?) {
|
|
22
|
+
self.init({ () -> bridge.std__optional_bool_ in
|
|
23
|
+
if let __unwrappedValue = isModalInPresentation {
|
|
24
|
+
return bridge.create_std__optional_bool_(__unwrappedValue)
|
|
25
|
+
} else {
|
|
26
|
+
return .init()
|
|
27
|
+
}
|
|
28
|
+
}(), { () -> bridge.std__optional_double_ in
|
|
29
|
+
if let __unwrappedValue = preferredContentWidth {
|
|
30
|
+
return bridge.create_std__optional_double_(__unwrappedValue)
|
|
31
|
+
} else {
|
|
32
|
+
return .init()
|
|
33
|
+
}
|
|
34
|
+
}(), { () -> bridge.std__optional_double_ in
|
|
35
|
+
if let __unwrappedValue = preferredContentHeight {
|
|
36
|
+
return bridge.create_std__optional_double_(__unwrappedValue)
|
|
37
|
+
} else {
|
|
38
|
+
return .init()
|
|
39
|
+
}
|
|
40
|
+
}(), { () -> bridge.std__optional_ModalViewBackground_ in
|
|
41
|
+
if let __unwrappedValue = modalViewBackground {
|
|
42
|
+
return bridge.create_std__optional_ModalViewBackground_(__unwrappedValue)
|
|
43
|
+
} else {
|
|
44
|
+
return .init()
|
|
45
|
+
}
|
|
46
|
+
}(), { () -> bridge.std__optional_ModalCornerConfiguration_ in
|
|
47
|
+
if let __unwrappedValue = cornerConfiguration {
|
|
48
|
+
return bridge.create_std__optional_ModalCornerConfiguration_(__unwrappedValue)
|
|
49
|
+
} else {
|
|
50
|
+
return .init()
|
|
51
|
+
}
|
|
52
|
+
}(), { () -> bridge.std__optional_SheetPresentationConfig_ in
|
|
53
|
+
if let __unwrappedValue = sheet {
|
|
54
|
+
return bridge.create_std__optional_SheetPresentationConfig_(__unwrappedValue)
|
|
55
|
+
} else {
|
|
56
|
+
return .init()
|
|
57
|
+
}
|
|
58
|
+
}())
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
@inline(__always)
|
|
62
|
+
var isModalInPresentation: Bool? {
|
|
63
|
+
return { () -> Bool? in
|
|
64
|
+
if bridge.has_value_std__optional_bool_(self.__isModalInPresentation) {
|
|
65
|
+
let __unwrapped = bridge.get_std__optional_bool_(self.__isModalInPresentation)
|
|
66
|
+
return __unwrapped
|
|
67
|
+
} else {
|
|
68
|
+
return nil
|
|
69
|
+
}
|
|
70
|
+
}()
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
@inline(__always)
|
|
74
|
+
var preferredContentWidth: Double? {
|
|
75
|
+
return { () -> Double? in
|
|
76
|
+
if bridge.has_value_std__optional_double_(self.__preferredContentWidth) {
|
|
77
|
+
let __unwrapped = bridge.get_std__optional_double_(self.__preferredContentWidth)
|
|
78
|
+
return __unwrapped
|
|
79
|
+
} else {
|
|
80
|
+
return nil
|
|
81
|
+
}
|
|
82
|
+
}()
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
@inline(__always)
|
|
86
|
+
var preferredContentHeight: Double? {
|
|
87
|
+
return { () -> Double? in
|
|
88
|
+
if bridge.has_value_std__optional_double_(self.__preferredContentHeight) {
|
|
89
|
+
let __unwrapped = bridge.get_std__optional_double_(self.__preferredContentHeight)
|
|
90
|
+
return __unwrapped
|
|
91
|
+
} else {
|
|
92
|
+
return nil
|
|
93
|
+
}
|
|
94
|
+
}()
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
@inline(__always)
|
|
98
|
+
var modalViewBackground: ModalViewBackground? {
|
|
99
|
+
return self.__modalViewBackground.value
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
@inline(__always)
|
|
103
|
+
var cornerConfiguration: ModalCornerConfiguration? {
|
|
104
|
+
return self.__cornerConfiguration.value
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
@inline(__always)
|
|
108
|
+
var sheet: SheetPresentationConfig? {
|
|
109
|
+
return self.__sheet.value
|
|
110
|
+
}
|
|
111
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// SheetDetentIdentifier.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 `SheetDetentIdentifier`, backed by a C++ enum.
|
|
10
|
+
*/
|
|
11
|
+
public typealias SheetDetentIdentifier = margelo.nitro.concentricsheet.SheetDetentIdentifier
|
|
12
|
+
|
|
13
|
+
public extension SheetDetentIdentifier {
|
|
14
|
+
/**
|
|
15
|
+
* Get a SheetDetentIdentifier 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 "medium":
|
|
21
|
+
self = .medium
|
|
22
|
+
case "large":
|
|
23
|
+
self = .large
|
|
24
|
+
default:
|
|
25
|
+
return nil
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Get the String value this SheetDetentIdentifier represents.
|
|
31
|
+
*/
|
|
32
|
+
var stringValue: String {
|
|
33
|
+
switch self {
|
|
34
|
+
case .medium:
|
|
35
|
+
return "medium"
|
|
36
|
+
case .large:
|
|
37
|
+
return "large"
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// SheetPresentationConfig.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 `SheetPresentationConfig`, backed by a C++ struct.
|
|
12
|
+
*/
|
|
13
|
+
public typealias SheetPresentationConfig = margelo.nitro.concentricsheet.SheetPresentationConfig
|
|
14
|
+
|
|
15
|
+
public extension SheetPresentationConfig {
|
|
16
|
+
private typealias bridge = margelo.nitro.concentricsheet.bridge.swift
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Create a new instance of `SheetPresentationConfig`.
|
|
20
|
+
*/
|
|
21
|
+
init(detents: [SheetDetentIdentifier]?, selectedDetentIdentifier: SheetDetentIdentifier?, largestUndimmedDetentIdentifier: SheetDetentIdentifier?, prefersGrabberVisible: Bool?, preferredCornerRadius: Double?, prefersScrollingExpandsWhenScrolledToEdge: Bool?, prefersEdgeAttachedInCompactHeight: Bool?, widthFollowsPreferredContentSizeWhenEdgeAttached: Bool?) {
|
|
22
|
+
self.init({ () -> bridge.std__optional_std__vector_SheetDetentIdentifier__ in
|
|
23
|
+
if let __unwrappedValue = detents {
|
|
24
|
+
return bridge.create_std__optional_std__vector_SheetDetentIdentifier__({ () -> bridge.std__vector_SheetDetentIdentifier_ in
|
|
25
|
+
var __vector = bridge.create_std__vector_SheetDetentIdentifier_(__unwrappedValue.count)
|
|
26
|
+
for __item in __unwrappedValue {
|
|
27
|
+
__vector.push_back(__item)
|
|
28
|
+
}
|
|
29
|
+
return __vector
|
|
30
|
+
}())
|
|
31
|
+
} else {
|
|
32
|
+
return .init()
|
|
33
|
+
}
|
|
34
|
+
}(), { () -> bridge.std__optional_SheetDetentIdentifier_ in
|
|
35
|
+
if let __unwrappedValue = selectedDetentIdentifier {
|
|
36
|
+
return bridge.create_std__optional_SheetDetentIdentifier_(__unwrappedValue)
|
|
37
|
+
} else {
|
|
38
|
+
return .init()
|
|
39
|
+
}
|
|
40
|
+
}(), { () -> bridge.std__optional_SheetDetentIdentifier_ in
|
|
41
|
+
if let __unwrappedValue = largestUndimmedDetentIdentifier {
|
|
42
|
+
return bridge.create_std__optional_SheetDetentIdentifier_(__unwrappedValue)
|
|
43
|
+
} else {
|
|
44
|
+
return .init()
|
|
45
|
+
}
|
|
46
|
+
}(), { () -> bridge.std__optional_bool_ in
|
|
47
|
+
if let __unwrappedValue = prefersGrabberVisible {
|
|
48
|
+
return bridge.create_std__optional_bool_(__unwrappedValue)
|
|
49
|
+
} else {
|
|
50
|
+
return .init()
|
|
51
|
+
}
|
|
52
|
+
}(), { () -> bridge.std__optional_double_ in
|
|
53
|
+
if let __unwrappedValue = preferredCornerRadius {
|
|
54
|
+
return bridge.create_std__optional_double_(__unwrappedValue)
|
|
55
|
+
} else {
|
|
56
|
+
return .init()
|
|
57
|
+
}
|
|
58
|
+
}(), { () -> bridge.std__optional_bool_ in
|
|
59
|
+
if let __unwrappedValue = prefersScrollingExpandsWhenScrolledToEdge {
|
|
60
|
+
return bridge.create_std__optional_bool_(__unwrappedValue)
|
|
61
|
+
} else {
|
|
62
|
+
return .init()
|
|
63
|
+
}
|
|
64
|
+
}(), { () -> bridge.std__optional_bool_ in
|
|
65
|
+
if let __unwrappedValue = prefersEdgeAttachedInCompactHeight {
|
|
66
|
+
return bridge.create_std__optional_bool_(__unwrappedValue)
|
|
67
|
+
} else {
|
|
68
|
+
return .init()
|
|
69
|
+
}
|
|
70
|
+
}(), { () -> bridge.std__optional_bool_ in
|
|
71
|
+
if let __unwrappedValue = widthFollowsPreferredContentSizeWhenEdgeAttached {
|
|
72
|
+
return bridge.create_std__optional_bool_(__unwrappedValue)
|
|
73
|
+
} else {
|
|
74
|
+
return .init()
|
|
75
|
+
}
|
|
76
|
+
}())
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
@inline(__always)
|
|
80
|
+
var detents: [SheetDetentIdentifier]? {
|
|
81
|
+
return { () -> [SheetDetentIdentifier]? in
|
|
82
|
+
if bridge.has_value_std__optional_std__vector_SheetDetentIdentifier__(self.__detents) {
|
|
83
|
+
let __unwrapped = bridge.get_std__optional_std__vector_SheetDetentIdentifier__(self.__detents)
|
|
84
|
+
return __unwrapped.map({ __item in __item })
|
|
85
|
+
} else {
|
|
86
|
+
return nil
|
|
87
|
+
}
|
|
88
|
+
}()
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
@inline(__always)
|
|
92
|
+
var selectedDetentIdentifier: SheetDetentIdentifier? {
|
|
93
|
+
return self.__selectedDetentIdentifier.value
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
@inline(__always)
|
|
97
|
+
var largestUndimmedDetentIdentifier: SheetDetentIdentifier? {
|
|
98
|
+
return self.__largestUndimmedDetentIdentifier.value
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
@inline(__always)
|
|
102
|
+
var prefersGrabberVisible: Bool? {
|
|
103
|
+
return { () -> Bool? in
|
|
104
|
+
if bridge.has_value_std__optional_bool_(self.__prefersGrabberVisible) {
|
|
105
|
+
let __unwrapped = bridge.get_std__optional_bool_(self.__prefersGrabberVisible)
|
|
106
|
+
return __unwrapped
|
|
107
|
+
} else {
|
|
108
|
+
return nil
|
|
109
|
+
}
|
|
110
|
+
}()
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
@inline(__always)
|
|
114
|
+
var preferredCornerRadius: Double? {
|
|
115
|
+
return { () -> Double? in
|
|
116
|
+
if bridge.has_value_std__optional_double_(self.__preferredCornerRadius) {
|
|
117
|
+
let __unwrapped = bridge.get_std__optional_double_(self.__preferredCornerRadius)
|
|
118
|
+
return __unwrapped
|
|
119
|
+
} else {
|
|
120
|
+
return nil
|
|
121
|
+
}
|
|
122
|
+
}()
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
@inline(__always)
|
|
126
|
+
var prefersScrollingExpandsWhenScrolledToEdge: Bool? {
|
|
127
|
+
return { () -> Bool? in
|
|
128
|
+
if bridge.has_value_std__optional_bool_(self.__prefersScrollingExpandsWhenScrolledToEdge) {
|
|
129
|
+
let __unwrapped = bridge.get_std__optional_bool_(self.__prefersScrollingExpandsWhenScrolledToEdge)
|
|
130
|
+
return __unwrapped
|
|
131
|
+
} else {
|
|
132
|
+
return nil
|
|
133
|
+
}
|
|
134
|
+
}()
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
@inline(__always)
|
|
138
|
+
var prefersEdgeAttachedInCompactHeight: Bool? {
|
|
139
|
+
return { () -> Bool? in
|
|
140
|
+
if bridge.has_value_std__optional_bool_(self.__prefersEdgeAttachedInCompactHeight) {
|
|
141
|
+
let __unwrapped = bridge.get_std__optional_bool_(self.__prefersEdgeAttachedInCompactHeight)
|
|
142
|
+
return __unwrapped
|
|
143
|
+
} else {
|
|
144
|
+
return nil
|
|
145
|
+
}
|
|
146
|
+
}()
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
@inline(__always)
|
|
150
|
+
var widthFollowsPreferredContentSizeWhenEdgeAttached: Bool? {
|
|
151
|
+
return { () -> Bool? in
|
|
152
|
+
if bridge.has_value_std__optional_bool_(self.__widthFollowsPreferredContentSizeWhenEdgeAttached) {
|
|
153
|
+
let __unwrapped = bridge.get_std__optional_bool_(self.__widthFollowsPreferredContentSizeWhenEdgeAttached)
|
|
154
|
+
return __unwrapped
|
|
155
|
+
} else {
|
|
156
|
+
return nil
|
|
157
|
+
}
|
|
158
|
+
}()
|
|
159
|
+
}
|
|
160
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridSheetModalControllerSpec.cpp
|
|
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
|
+
#include "HybridSheetModalControllerSpec.hpp"
|
|
9
|
+
|
|
10
|
+
namespace margelo::nitro::concentricsheet {
|
|
11
|
+
|
|
12
|
+
void HybridSheetModalControllerSpec::loadHybridMethods() {
|
|
13
|
+
// load base methods/properties
|
|
14
|
+
HybridObject::loadHybridMethods();
|
|
15
|
+
// load custom methods/properties
|
|
16
|
+
registerHybrids(this, [](Prototype& prototype) {
|
|
17
|
+
prototype.registerHybridMethod("applyPresentedModalConfig", &HybridSheetModalControllerSpec::applyPresentedModalConfig);
|
|
18
|
+
prototype.registerHybridMethod("dismissPresentedModal", &HybridSheetModalControllerSpec::dismissPresentedModal);
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
} // namespace margelo::nitro::concentricsheet
|