concentric-sheet 1.0.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/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,60 @@
|
|
|
1
|
+
#
|
|
2
|
+
# NitroConcentricSheet+autolinking.rb
|
|
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
|
+
# This is a Ruby script that adds all files generated by Nitrogen
|
|
9
|
+
# to the given podspec.
|
|
10
|
+
#
|
|
11
|
+
# To use it, add this to your .podspec:
|
|
12
|
+
# ```ruby
|
|
13
|
+
# Pod::Spec.new do |spec|
|
|
14
|
+
# # ...
|
|
15
|
+
#
|
|
16
|
+
# # Add all files generated by Nitrogen
|
|
17
|
+
# load 'nitrogen/generated/ios/NitroConcentricSheet+autolinking.rb'
|
|
18
|
+
# add_nitrogen_files(spec)
|
|
19
|
+
# end
|
|
20
|
+
# ```
|
|
21
|
+
|
|
22
|
+
def add_nitrogen_files(spec)
|
|
23
|
+
Pod::UI.puts "[NitroModules] 🔥 NitroConcentricSheet is boosted by nitro!"
|
|
24
|
+
|
|
25
|
+
spec.dependency "NitroModules"
|
|
26
|
+
|
|
27
|
+
current_source_files = Array(spec.attributes_hash['source_files'])
|
|
28
|
+
spec.source_files = current_source_files + [
|
|
29
|
+
# Generated cross-platform specs
|
|
30
|
+
"nitrogen/generated/shared/**/*.{h,hpp,c,cpp,swift}",
|
|
31
|
+
# Generated bridges for the cross-platform specs
|
|
32
|
+
"nitrogen/generated/ios/**/*.{h,hpp,c,cpp,mm,swift}",
|
|
33
|
+
]
|
|
34
|
+
|
|
35
|
+
current_public_header_files = Array(spec.attributes_hash['public_header_files'])
|
|
36
|
+
spec.public_header_files = current_public_header_files + [
|
|
37
|
+
# Generated specs
|
|
38
|
+
"nitrogen/generated/shared/**/*.{h,hpp}",
|
|
39
|
+
# Swift to C++ bridging helpers
|
|
40
|
+
"nitrogen/generated/ios/NitroConcentricSheet-Swift-Cxx-Bridge.hpp"
|
|
41
|
+
]
|
|
42
|
+
|
|
43
|
+
current_private_header_files = Array(spec.attributes_hash['private_header_files'])
|
|
44
|
+
spec.private_header_files = current_private_header_files + [
|
|
45
|
+
# iOS specific specs
|
|
46
|
+
"nitrogen/generated/ios/c++/**/*.{h,hpp}",
|
|
47
|
+
# Views are framework-specific and should be private
|
|
48
|
+
"nitrogen/generated/shared/**/views/**/*"
|
|
49
|
+
]
|
|
50
|
+
|
|
51
|
+
current_pod_target_xcconfig = spec.attributes_hash['pod_target_xcconfig'] || {}
|
|
52
|
+
spec.pod_target_xcconfig = current_pod_target_xcconfig.merge({
|
|
53
|
+
# Use C++ 20
|
|
54
|
+
"CLANG_CXX_LANGUAGE_STANDARD" => "c++20",
|
|
55
|
+
# Enables C++ <-> Swift interop (by default it's only ObjC)
|
|
56
|
+
"SWIFT_OBJC_INTEROP_MODE" => "objcxx",
|
|
57
|
+
# Enables stricter modular headers
|
|
58
|
+
"DEFINES_MODULE" => "YES",
|
|
59
|
+
})
|
|
60
|
+
end
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// NitroConcentricSheet-Swift-Cxx-Bridge.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 "NitroConcentricSheet-Swift-Cxx-Bridge.hpp"
|
|
9
|
+
|
|
10
|
+
// Include C++ implementation defined types
|
|
11
|
+
#include "HybridSheetModalControllerSpecSwift.hpp"
|
|
12
|
+
#include "NitroConcentricSheet-Swift-Cxx-Umbrella.hpp"
|
|
13
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
14
|
+
|
|
15
|
+
namespace margelo::nitro::concentricsheet::bridge::swift {
|
|
16
|
+
|
|
17
|
+
// pragma MARK: std::shared_ptr<HybridSheetModalControllerSpec>
|
|
18
|
+
std::shared_ptr<HybridSheetModalControllerSpec> create_std__shared_ptr_HybridSheetModalControllerSpec_(void* NON_NULL swiftUnsafePointer) noexcept {
|
|
19
|
+
NitroConcentricSheet::HybridSheetModalControllerSpec_cxx swiftPart = NitroConcentricSheet::HybridSheetModalControllerSpec_cxx::fromUnsafe(swiftUnsafePointer);
|
|
20
|
+
return std::make_shared<margelo::nitro::concentricsheet::HybridSheetModalControllerSpecSwift>(swiftPart);
|
|
21
|
+
}
|
|
22
|
+
void* NON_NULL get_std__shared_ptr_HybridSheetModalControllerSpec_(std__shared_ptr_HybridSheetModalControllerSpec_ cppType) {
|
|
23
|
+
std::shared_ptr<margelo::nitro::concentricsheet::HybridSheetModalControllerSpecSwift> swiftWrapper = std::dynamic_pointer_cast<margelo::nitro::concentricsheet::HybridSheetModalControllerSpecSwift>(cppType);
|
|
24
|
+
#ifdef NITRO_DEBUG
|
|
25
|
+
if (swiftWrapper == nullptr) [[unlikely]] {
|
|
26
|
+
throw std::runtime_error("Class \"HybridSheetModalControllerSpec\" is not implemented in Swift!");
|
|
27
|
+
}
|
|
28
|
+
#endif
|
|
29
|
+
NitroConcentricSheet::HybridSheetModalControllerSpec_cxx& swiftPart = swiftWrapper->getSwiftPart();
|
|
30
|
+
return swiftPart.toUnsafe();
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
} // namespace margelo::nitro::concentricsheet::bridge::swift
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// NitroConcentricSheet-Swift-Cxx-Bridge.hpp
|
|
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
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
// Forward declarations of C++ defined types
|
|
11
|
+
// Forward declaration of `HybridSheetModalControllerSpec` to properly resolve imports.
|
|
12
|
+
namespace margelo::nitro::concentricsheet { class HybridSheetModalControllerSpec; }
|
|
13
|
+
// Forward declaration of `ModalCornerConfigurationType` to properly resolve imports.
|
|
14
|
+
namespace margelo::nitro::concentricsheet { enum class ModalCornerConfigurationType; }
|
|
15
|
+
// Forward declaration of `ModalCornerConfiguration` to properly resolve imports.
|
|
16
|
+
namespace margelo::nitro::concentricsheet { struct ModalCornerConfiguration; }
|
|
17
|
+
// Forward declaration of `ModalViewBackground` to properly resolve imports.
|
|
18
|
+
namespace margelo::nitro::concentricsheet { enum class ModalViewBackground; }
|
|
19
|
+
// Forward declaration of `SheetDetentIdentifier` to properly resolve imports.
|
|
20
|
+
namespace margelo::nitro::concentricsheet { enum class SheetDetentIdentifier; }
|
|
21
|
+
// Forward declaration of `SheetPresentationConfig` to properly resolve imports.
|
|
22
|
+
namespace margelo::nitro::concentricsheet { struct SheetPresentationConfig; }
|
|
23
|
+
|
|
24
|
+
// Forward declarations of Swift defined types
|
|
25
|
+
// Forward declaration of `HybridSheetModalControllerSpec_cxx` to properly resolve imports.
|
|
26
|
+
namespace NitroConcentricSheet { class HybridSheetModalControllerSpec_cxx; }
|
|
27
|
+
|
|
28
|
+
// Include C++ defined types
|
|
29
|
+
#include "HybridSheetModalControllerSpec.hpp"
|
|
30
|
+
#include "ModalCornerConfiguration.hpp"
|
|
31
|
+
#include "ModalCornerConfigurationType.hpp"
|
|
32
|
+
#include "ModalViewBackground.hpp"
|
|
33
|
+
#include "SheetDetentIdentifier.hpp"
|
|
34
|
+
#include "SheetPresentationConfig.hpp"
|
|
35
|
+
#include <NitroModules/Result.hpp>
|
|
36
|
+
#include <exception>
|
|
37
|
+
#include <memory>
|
|
38
|
+
#include <optional>
|
|
39
|
+
#include <vector>
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Contains specialized versions of C++ templated types so they can be accessed from Swift,
|
|
43
|
+
* as well as helper functions to interact with those C++ types from Swift.
|
|
44
|
+
*/
|
|
45
|
+
namespace margelo::nitro::concentricsheet::bridge::swift {
|
|
46
|
+
|
|
47
|
+
// pragma MARK: std::optional<bool>
|
|
48
|
+
/**
|
|
49
|
+
* Specialized version of `std::optional<bool>`.
|
|
50
|
+
*/
|
|
51
|
+
using std__optional_bool_ = std::optional<bool>;
|
|
52
|
+
inline std::optional<bool> create_std__optional_bool_(const bool& value) noexcept {
|
|
53
|
+
return std::optional<bool>(value);
|
|
54
|
+
}
|
|
55
|
+
inline bool has_value_std__optional_bool_(const std::optional<bool>& optional) noexcept {
|
|
56
|
+
return optional.has_value();
|
|
57
|
+
}
|
|
58
|
+
inline bool get_std__optional_bool_(const std::optional<bool>& optional) noexcept {
|
|
59
|
+
return optional.value();
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// pragma MARK: std::optional<double>
|
|
63
|
+
/**
|
|
64
|
+
* Specialized version of `std::optional<double>`.
|
|
65
|
+
*/
|
|
66
|
+
using std__optional_double_ = std::optional<double>;
|
|
67
|
+
inline std::optional<double> create_std__optional_double_(const double& value) noexcept {
|
|
68
|
+
return std::optional<double>(value);
|
|
69
|
+
}
|
|
70
|
+
inline bool has_value_std__optional_double_(const std::optional<double>& optional) noexcept {
|
|
71
|
+
return optional.has_value();
|
|
72
|
+
}
|
|
73
|
+
inline double get_std__optional_double_(const std::optional<double>& optional) noexcept {
|
|
74
|
+
return optional.value();
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
// pragma MARK: std::optional<ModalViewBackground>
|
|
78
|
+
/**
|
|
79
|
+
* Specialized version of `std::optional<ModalViewBackground>`.
|
|
80
|
+
*/
|
|
81
|
+
using std__optional_ModalViewBackground_ = std::optional<ModalViewBackground>;
|
|
82
|
+
inline std::optional<ModalViewBackground> create_std__optional_ModalViewBackground_(const ModalViewBackground& value) noexcept {
|
|
83
|
+
return std::optional<ModalViewBackground>(value);
|
|
84
|
+
}
|
|
85
|
+
inline bool has_value_std__optional_ModalViewBackground_(const std::optional<ModalViewBackground>& optional) noexcept {
|
|
86
|
+
return optional.has_value();
|
|
87
|
+
}
|
|
88
|
+
inline ModalViewBackground get_std__optional_ModalViewBackground_(const std::optional<ModalViewBackground>& optional) noexcept {
|
|
89
|
+
return optional.value();
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
// pragma MARK: std::optional<ModalCornerConfiguration>
|
|
93
|
+
/**
|
|
94
|
+
* Specialized version of `std::optional<ModalCornerConfiguration>`.
|
|
95
|
+
*/
|
|
96
|
+
using std__optional_ModalCornerConfiguration_ = std::optional<ModalCornerConfiguration>;
|
|
97
|
+
inline std::optional<ModalCornerConfiguration> create_std__optional_ModalCornerConfiguration_(const ModalCornerConfiguration& value) noexcept {
|
|
98
|
+
return std::optional<ModalCornerConfiguration>(value);
|
|
99
|
+
}
|
|
100
|
+
inline bool has_value_std__optional_ModalCornerConfiguration_(const std::optional<ModalCornerConfiguration>& optional) noexcept {
|
|
101
|
+
return optional.has_value();
|
|
102
|
+
}
|
|
103
|
+
inline ModalCornerConfiguration get_std__optional_ModalCornerConfiguration_(const std::optional<ModalCornerConfiguration>& optional) noexcept {
|
|
104
|
+
return optional.value();
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
// pragma MARK: std::vector<SheetDetentIdentifier>
|
|
108
|
+
/**
|
|
109
|
+
* Specialized version of `std::vector<SheetDetentIdentifier>`.
|
|
110
|
+
*/
|
|
111
|
+
using std__vector_SheetDetentIdentifier_ = std::vector<SheetDetentIdentifier>;
|
|
112
|
+
inline std::vector<SheetDetentIdentifier> create_std__vector_SheetDetentIdentifier_(size_t size) noexcept {
|
|
113
|
+
std::vector<SheetDetentIdentifier> vector;
|
|
114
|
+
vector.reserve(size);
|
|
115
|
+
return vector;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
// pragma MARK: std::optional<std::vector<SheetDetentIdentifier>>
|
|
119
|
+
/**
|
|
120
|
+
* Specialized version of `std::optional<std::vector<SheetDetentIdentifier>>`.
|
|
121
|
+
*/
|
|
122
|
+
using std__optional_std__vector_SheetDetentIdentifier__ = std::optional<std::vector<SheetDetentIdentifier>>;
|
|
123
|
+
inline std::optional<std::vector<SheetDetentIdentifier>> create_std__optional_std__vector_SheetDetentIdentifier__(const std::vector<SheetDetentIdentifier>& value) noexcept {
|
|
124
|
+
return std::optional<std::vector<SheetDetentIdentifier>>(value);
|
|
125
|
+
}
|
|
126
|
+
inline bool has_value_std__optional_std__vector_SheetDetentIdentifier__(const std::optional<std::vector<SheetDetentIdentifier>>& optional) noexcept {
|
|
127
|
+
return optional.has_value();
|
|
128
|
+
}
|
|
129
|
+
inline std::vector<SheetDetentIdentifier> get_std__optional_std__vector_SheetDetentIdentifier__(const std::optional<std::vector<SheetDetentIdentifier>>& optional) noexcept {
|
|
130
|
+
return optional.value();
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
// pragma MARK: std::optional<SheetDetentIdentifier>
|
|
134
|
+
/**
|
|
135
|
+
* Specialized version of `std::optional<SheetDetentIdentifier>`.
|
|
136
|
+
*/
|
|
137
|
+
using std__optional_SheetDetentIdentifier_ = std::optional<SheetDetentIdentifier>;
|
|
138
|
+
inline std::optional<SheetDetentIdentifier> create_std__optional_SheetDetentIdentifier_(const SheetDetentIdentifier& value) noexcept {
|
|
139
|
+
return std::optional<SheetDetentIdentifier>(value);
|
|
140
|
+
}
|
|
141
|
+
inline bool has_value_std__optional_SheetDetentIdentifier_(const std::optional<SheetDetentIdentifier>& optional) noexcept {
|
|
142
|
+
return optional.has_value();
|
|
143
|
+
}
|
|
144
|
+
inline SheetDetentIdentifier get_std__optional_SheetDetentIdentifier_(const std::optional<SheetDetentIdentifier>& optional) noexcept {
|
|
145
|
+
return optional.value();
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
// pragma MARK: std::optional<SheetPresentationConfig>
|
|
149
|
+
/**
|
|
150
|
+
* Specialized version of `std::optional<SheetPresentationConfig>`.
|
|
151
|
+
*/
|
|
152
|
+
using std__optional_SheetPresentationConfig_ = std::optional<SheetPresentationConfig>;
|
|
153
|
+
inline std::optional<SheetPresentationConfig> create_std__optional_SheetPresentationConfig_(const SheetPresentationConfig& value) noexcept {
|
|
154
|
+
return std::optional<SheetPresentationConfig>(value);
|
|
155
|
+
}
|
|
156
|
+
inline bool has_value_std__optional_SheetPresentationConfig_(const std::optional<SheetPresentationConfig>& optional) noexcept {
|
|
157
|
+
return optional.has_value();
|
|
158
|
+
}
|
|
159
|
+
inline SheetPresentationConfig get_std__optional_SheetPresentationConfig_(const std::optional<SheetPresentationConfig>& optional) noexcept {
|
|
160
|
+
return optional.value();
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
// pragma MARK: std::shared_ptr<HybridSheetModalControllerSpec>
|
|
164
|
+
/**
|
|
165
|
+
* Specialized version of `std::shared_ptr<HybridSheetModalControllerSpec>`.
|
|
166
|
+
*/
|
|
167
|
+
using std__shared_ptr_HybridSheetModalControllerSpec_ = std::shared_ptr<HybridSheetModalControllerSpec>;
|
|
168
|
+
std::shared_ptr<HybridSheetModalControllerSpec> create_std__shared_ptr_HybridSheetModalControllerSpec_(void* NON_NULL swiftUnsafePointer) noexcept;
|
|
169
|
+
void* NON_NULL get_std__shared_ptr_HybridSheetModalControllerSpec_(std__shared_ptr_HybridSheetModalControllerSpec_ cppType);
|
|
170
|
+
|
|
171
|
+
// pragma MARK: std::weak_ptr<HybridSheetModalControllerSpec>
|
|
172
|
+
using std__weak_ptr_HybridSheetModalControllerSpec_ = std::weak_ptr<HybridSheetModalControllerSpec>;
|
|
173
|
+
inline std__weak_ptr_HybridSheetModalControllerSpec_ weakify_std__shared_ptr_HybridSheetModalControllerSpec_(const std::shared_ptr<HybridSheetModalControllerSpec>& strong) noexcept { return strong; }
|
|
174
|
+
|
|
175
|
+
// pragma MARK: Result<bool>
|
|
176
|
+
using Result_bool_ = Result<bool>;
|
|
177
|
+
inline Result_bool_ create_Result_bool_(bool value) noexcept {
|
|
178
|
+
return Result<bool>::withValue(std::move(value));
|
|
179
|
+
}
|
|
180
|
+
inline Result_bool_ create_Result_bool_(const std::exception_ptr& error) noexcept {
|
|
181
|
+
return Result<bool>::withError(error);
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
} // namespace margelo::nitro::concentricsheet::bridge::swift
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// NitroConcentricSheet-Swift-Cxx-Umbrella.hpp
|
|
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
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
// Forward declarations of C++ defined types
|
|
11
|
+
// Forward declaration of `HybridSheetModalControllerSpec` to properly resolve imports.
|
|
12
|
+
namespace margelo::nitro::concentricsheet { class HybridSheetModalControllerSpec; }
|
|
13
|
+
// Forward declaration of `ModalCornerConfigurationType` to properly resolve imports.
|
|
14
|
+
namespace margelo::nitro::concentricsheet { enum class ModalCornerConfigurationType; }
|
|
15
|
+
// Forward declaration of `ModalCornerConfiguration` to properly resolve imports.
|
|
16
|
+
namespace margelo::nitro::concentricsheet { struct ModalCornerConfiguration; }
|
|
17
|
+
// Forward declaration of `ModalViewBackground` to properly resolve imports.
|
|
18
|
+
namespace margelo::nitro::concentricsheet { enum class ModalViewBackground; }
|
|
19
|
+
// Forward declaration of `PresentedModalConfig` to properly resolve imports.
|
|
20
|
+
namespace margelo::nitro::concentricsheet { struct PresentedModalConfig; }
|
|
21
|
+
// Forward declaration of `SheetDetentIdentifier` to properly resolve imports.
|
|
22
|
+
namespace margelo::nitro::concentricsheet { enum class SheetDetentIdentifier; }
|
|
23
|
+
// Forward declaration of `SheetPresentationConfig` to properly resolve imports.
|
|
24
|
+
namespace margelo::nitro::concentricsheet { struct SheetPresentationConfig; }
|
|
25
|
+
|
|
26
|
+
// Include C++ defined types
|
|
27
|
+
#include "HybridSheetModalControllerSpec.hpp"
|
|
28
|
+
#include "ModalCornerConfiguration.hpp"
|
|
29
|
+
#include "ModalCornerConfigurationType.hpp"
|
|
30
|
+
#include "ModalViewBackground.hpp"
|
|
31
|
+
#include "PresentedModalConfig.hpp"
|
|
32
|
+
#include "SheetDetentIdentifier.hpp"
|
|
33
|
+
#include "SheetPresentationConfig.hpp"
|
|
34
|
+
#include <NitroModules/Result.hpp>
|
|
35
|
+
#include <exception>
|
|
36
|
+
#include <memory>
|
|
37
|
+
#include <optional>
|
|
38
|
+
#include <vector>
|
|
39
|
+
|
|
40
|
+
// C++ helpers for Swift
|
|
41
|
+
#include "NitroConcentricSheet-Swift-Cxx-Bridge.hpp"
|
|
42
|
+
|
|
43
|
+
// Common C++ types used in Swift
|
|
44
|
+
#include <NitroModules/ArrayBufferHolder.hpp>
|
|
45
|
+
#include <NitroModules/AnyMapUtils.hpp>
|
|
46
|
+
#include <NitroModules/RuntimeError.hpp>
|
|
47
|
+
#include <NitroModules/DateToChronoDate.hpp>
|
|
48
|
+
|
|
49
|
+
// Forward declarations of Swift defined types
|
|
50
|
+
// Forward declaration of `HybridSheetModalControllerSpec_cxx` to properly resolve imports.
|
|
51
|
+
namespace NitroConcentricSheet { class HybridSheetModalControllerSpec_cxx; }
|
|
52
|
+
|
|
53
|
+
// Include Swift defined types
|
|
54
|
+
#if __has_include("NitroConcentricSheet-Swift.h")
|
|
55
|
+
// This header is generated by Xcode/Swift on every app build.
|
|
56
|
+
// If it cannot be found, make sure the Swift module's name (= podspec name) is actually "NitroConcentricSheet".
|
|
57
|
+
#include "NitroConcentricSheet-Swift.h"
|
|
58
|
+
// Same as above, but used when building with frameworks (`use_frameworks`)
|
|
59
|
+
#elif __has_include(<NitroConcentricSheet/NitroConcentricSheet-Swift.h>)
|
|
60
|
+
#include <NitroConcentricSheet/NitroConcentricSheet-Swift.h>
|
|
61
|
+
#else
|
|
62
|
+
#error NitroConcentricSheet's autogenerated Swift header cannot be found! Make sure the Swift module's name (= podspec name) is actually "NitroConcentricSheet", and try building the app first.
|
|
63
|
+
#endif
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// NitroConcentricSheetAutolinking.mm
|
|
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 <Foundation/Foundation.h>
|
|
9
|
+
#import <NitroModules/HybridObjectRegistry.hpp>
|
|
10
|
+
#import "NitroConcentricSheet-Swift-Cxx-Umbrella.hpp"
|
|
11
|
+
#import <type_traits>
|
|
12
|
+
|
|
13
|
+
#include "HybridSheetModalControllerSpecSwift.hpp"
|
|
14
|
+
|
|
15
|
+
@interface NitroConcentricSheetAutolinking : NSObject
|
|
16
|
+
@end
|
|
17
|
+
|
|
18
|
+
@implementation NitroConcentricSheetAutolinking
|
|
19
|
+
|
|
20
|
+
+ (void) load {
|
|
21
|
+
using namespace margelo::nitro;
|
|
22
|
+
using namespace margelo::nitro::concentricsheet;
|
|
23
|
+
|
|
24
|
+
HybridObjectRegistry::registerHybridObjectConstructor(
|
|
25
|
+
"SheetModalController",
|
|
26
|
+
[]() -> std::shared_ptr<HybridObject> {
|
|
27
|
+
std::shared_ptr<HybridSheetModalControllerSpec> hybridObject = NitroConcentricSheet::NitroConcentricSheetAutolinking::createSheetModalController();
|
|
28
|
+
return hybridObject;
|
|
29
|
+
}
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
@end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// NitroConcentricSheetAutolinking.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
|
+
// TODO: Use empty enums once Swift supports exporting them as namespaces
|
|
11
|
+
// See: https://github.com/swiftlang/swift/pull/83616
|
|
12
|
+
public final class NitroConcentricSheetAutolinking {
|
|
13
|
+
public typealias bridge = margelo.nitro.concentricsheet.bridge.swift
|
|
14
|
+
|
|
15
|
+
public static func createSheetModalController() -> bridge.std__shared_ptr_HybridSheetModalControllerSpec_ {
|
|
16
|
+
let hybridObject = SheetModalController()
|
|
17
|
+
return { () -> bridge.std__shared_ptr_HybridSheetModalControllerSpec_ in
|
|
18
|
+
let __cxxWrapped = hybridObject.getCxxWrapper()
|
|
19
|
+
return __cxxWrapped.getCxxPart()
|
|
20
|
+
}()
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
public static func isSheetModalControllerRecyclable() -> Bool {
|
|
24
|
+
return SheetModalController.self is any RecyclableView.Type
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridSheetModalControllerSpecSwift.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 "HybridSheetModalControllerSpecSwift.hpp"
|
|
9
|
+
|
|
10
|
+
namespace margelo::nitro::concentricsheet {
|
|
11
|
+
} // namespace margelo::nitro::concentricsheet
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridSheetModalControllerSpecSwift.hpp
|
|
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
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include "HybridSheetModalControllerSpec.hpp"
|
|
11
|
+
|
|
12
|
+
// Forward declaration of `HybridSheetModalControllerSpec_cxx` to properly resolve imports.
|
|
13
|
+
namespace NitroConcentricSheet { class HybridSheetModalControllerSpec_cxx; }
|
|
14
|
+
|
|
15
|
+
// Forward declaration of `PresentedModalConfig` to properly resolve imports.
|
|
16
|
+
namespace margelo::nitro::concentricsheet { struct PresentedModalConfig; }
|
|
17
|
+
// Forward declaration of `ModalViewBackground` to properly resolve imports.
|
|
18
|
+
namespace margelo::nitro::concentricsheet { enum class ModalViewBackground; }
|
|
19
|
+
// Forward declaration of `ModalCornerConfiguration` to properly resolve imports.
|
|
20
|
+
namespace margelo::nitro::concentricsheet { struct ModalCornerConfiguration; }
|
|
21
|
+
// Forward declaration of `ModalCornerConfigurationType` to properly resolve imports.
|
|
22
|
+
namespace margelo::nitro::concentricsheet { enum class ModalCornerConfigurationType; }
|
|
23
|
+
// Forward declaration of `SheetPresentationConfig` to properly resolve imports.
|
|
24
|
+
namespace margelo::nitro::concentricsheet { struct SheetPresentationConfig; }
|
|
25
|
+
// Forward declaration of `SheetDetentIdentifier` to properly resolve imports.
|
|
26
|
+
namespace margelo::nitro::concentricsheet { enum class SheetDetentIdentifier; }
|
|
27
|
+
|
|
28
|
+
#include "PresentedModalConfig.hpp"
|
|
29
|
+
#include <optional>
|
|
30
|
+
#include "ModalViewBackground.hpp"
|
|
31
|
+
#include "ModalCornerConfiguration.hpp"
|
|
32
|
+
#include "ModalCornerConfigurationType.hpp"
|
|
33
|
+
#include "SheetPresentationConfig.hpp"
|
|
34
|
+
#include "SheetDetentIdentifier.hpp"
|
|
35
|
+
#include <vector>
|
|
36
|
+
|
|
37
|
+
#include "NitroConcentricSheet-Swift-Cxx-Umbrella.hpp"
|
|
38
|
+
|
|
39
|
+
namespace margelo::nitro::concentricsheet {
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* The C++ part of HybridSheetModalControllerSpec_cxx.swift.
|
|
43
|
+
*
|
|
44
|
+
* HybridSheetModalControllerSpecSwift (C++) accesses HybridSheetModalControllerSpec_cxx (Swift), and might
|
|
45
|
+
* contain some additional bridging code for C++ <> Swift interop.
|
|
46
|
+
*
|
|
47
|
+
* Since this obviously introduces an overhead, I hope at some point in
|
|
48
|
+
* the future, HybridSheetModalControllerSpec_cxx can directly inherit from the C++ class HybridSheetModalControllerSpec
|
|
49
|
+
* to simplify the whole structure and memory management.
|
|
50
|
+
*/
|
|
51
|
+
class HybridSheetModalControllerSpecSwift: public virtual HybridSheetModalControllerSpec {
|
|
52
|
+
public:
|
|
53
|
+
// Constructor from a Swift instance
|
|
54
|
+
explicit HybridSheetModalControllerSpecSwift(const NitroConcentricSheet::HybridSheetModalControllerSpec_cxx& swiftPart):
|
|
55
|
+
HybridObject(HybridSheetModalControllerSpec::TAG),
|
|
56
|
+
_swiftPart(swiftPart) { }
|
|
57
|
+
|
|
58
|
+
public:
|
|
59
|
+
// Get the Swift part
|
|
60
|
+
inline NitroConcentricSheet::HybridSheetModalControllerSpec_cxx& getSwiftPart() noexcept {
|
|
61
|
+
return _swiftPart;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
public:
|
|
65
|
+
inline size_t getExternalMemorySize() noexcept override {
|
|
66
|
+
return _swiftPart.getMemorySize();
|
|
67
|
+
}
|
|
68
|
+
bool equals(const std::shared_ptr<HybridObject>& other) override {
|
|
69
|
+
if (auto otherCast = std::dynamic_pointer_cast<HybridSheetModalControllerSpecSwift>(other)) {
|
|
70
|
+
return _swiftPart.equals(otherCast->_swiftPart);
|
|
71
|
+
}
|
|
72
|
+
return false;
|
|
73
|
+
}
|
|
74
|
+
void dispose() noexcept override {
|
|
75
|
+
_swiftPart.dispose();
|
|
76
|
+
}
|
|
77
|
+
std::string toString() override {
|
|
78
|
+
return _swiftPart.toString();
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
public:
|
|
82
|
+
// Properties
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
public:
|
|
86
|
+
// Methods
|
|
87
|
+
inline bool applyPresentedModalConfig(const PresentedModalConfig& config) override {
|
|
88
|
+
auto __result = _swiftPart.applyPresentedModalConfig(std::forward<decltype(config)>(config));
|
|
89
|
+
if (__result.hasError()) [[unlikely]] {
|
|
90
|
+
std::rethrow_exception(__result.error());
|
|
91
|
+
}
|
|
92
|
+
auto __value = std::move(__result.value());
|
|
93
|
+
return __value;
|
|
94
|
+
}
|
|
95
|
+
inline bool dismissPresentedModal(bool animated) override {
|
|
96
|
+
auto __result = _swiftPart.dismissPresentedModal(std::forward<decltype(animated)>(animated));
|
|
97
|
+
if (__result.hasError()) [[unlikely]] {
|
|
98
|
+
std::rethrow_exception(__result.error());
|
|
99
|
+
}
|
|
100
|
+
auto __value = std::move(__result.value());
|
|
101
|
+
return __value;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
private:
|
|
105
|
+
NitroConcentricSheet::HybridSheetModalControllerSpec_cxx _swiftPart;
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
} // namespace margelo::nitro::concentricsheet
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridSheetModalControllerSpec.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
|
+
/// See ``HybridSheetModalControllerSpec``
|
|
11
|
+
public protocol HybridSheetModalControllerSpec_protocol: HybridObject {
|
|
12
|
+
// Properties
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
// Methods
|
|
16
|
+
func applyPresentedModalConfig(config: PresentedModalConfig) throws -> Bool
|
|
17
|
+
func dismissPresentedModal(animated: Bool) throws -> Bool
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
public extension HybridSheetModalControllerSpec_protocol {
|
|
21
|
+
/// Default implementation of ``HybridObject.toString``
|
|
22
|
+
func toString() -> String {
|
|
23
|
+
return "[HybridObject SheetModalController]"
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/// See ``HybridSheetModalControllerSpec``
|
|
28
|
+
open class HybridSheetModalControllerSpec_base {
|
|
29
|
+
private weak var cxxWrapper: HybridSheetModalControllerSpec_cxx? = nil
|
|
30
|
+
public init() { }
|
|
31
|
+
public func getCxxWrapper() -> HybridSheetModalControllerSpec_cxx {
|
|
32
|
+
#if DEBUG
|
|
33
|
+
guard self is any HybridSheetModalControllerSpec else {
|
|
34
|
+
fatalError("`self` is not a `HybridSheetModalControllerSpec`! Did you accidentally inherit from `HybridSheetModalControllerSpec_base` instead of `HybridSheetModalControllerSpec`?")
|
|
35
|
+
}
|
|
36
|
+
#endif
|
|
37
|
+
if let cxxWrapper = self.cxxWrapper {
|
|
38
|
+
return cxxWrapper
|
|
39
|
+
} else {
|
|
40
|
+
let cxxWrapper = HybridSheetModalControllerSpec_cxx(self as! any HybridSheetModalControllerSpec)
|
|
41
|
+
self.cxxWrapper = cxxWrapper
|
|
42
|
+
return cxxWrapper
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* A Swift base-protocol representing the SheetModalController HybridObject.
|
|
49
|
+
* Implement this protocol to create Swift-based instances of SheetModalController.
|
|
50
|
+
* ```swift
|
|
51
|
+
* class HybridSheetModalController : HybridSheetModalControllerSpec {
|
|
52
|
+
* // ...
|
|
53
|
+
* }
|
|
54
|
+
* ```
|
|
55
|
+
*/
|
|
56
|
+
public typealias HybridSheetModalControllerSpec = HybridSheetModalControllerSpec_protocol & HybridSheetModalControllerSpec_base
|