react-native-attachment-kit 1.1.1 → 1.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/README.md +77 -5
  3. package/android/src/main/libs/rnattachmentkit-release.aar +0 -0
  4. package/android/src/newarch/java/com/rnattachmentkit/RNAttachmentKitModule.kt +28 -1
  5. package/android/src/oldarch/java/com/rnattachmentkit/RNAttachmentKitModule.kt +28 -1
  6. package/ios/RNAttachmentKit.swift +21 -3
  7. package/ios/RNAttachmentKit.xcframework/ios-arm64/RNAttachmentKit.framework/Modules/RNAttachmentKit.swiftmodule/arm64-apple-ios.abi.json +7188 -4555
  8. package/ios/RNAttachmentKit.xcframework/ios-arm64/RNAttachmentKit.framework/Modules/RNAttachmentKit.swiftmodule/arm64-apple-ios.private.swiftinterface +37 -1
  9. package/ios/RNAttachmentKit.xcframework/ios-arm64/RNAttachmentKit.framework/Modules/RNAttachmentKit.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
  10. package/ios/RNAttachmentKit.xcframework/ios-arm64/RNAttachmentKit.framework/Modules/RNAttachmentKit.swiftmodule/arm64-apple-ios.swiftinterface +37 -1
  11. package/ios/RNAttachmentKit.xcframework/ios-arm64/RNAttachmentKit.framework/RNAttachmentKit +0 -0
  12. package/ios/RNAttachmentKit.xcframework/ios-arm64/RNAttachmentKit.framework/_CodeSignature/CodeDirectory +0 -0
  13. package/ios/RNAttachmentKit.xcframework/ios-arm64/RNAttachmentKit.framework/_CodeSignature/CodeResources +10 -10
  14. package/ios/RNAttachmentKit.xcframework/ios-arm64/RNAttachmentKit.framework/_CodeSignature/CodeSignature +0 -0
  15. package/ios/RNAttachmentKit.xcframework/ios-arm64_x86_64-simulator/RNAttachmentKit.framework/Assets.car +0 -0
  16. package/ios/RNAttachmentKit.xcframework/ios-arm64_x86_64-simulator/RNAttachmentKit.framework/Modules/RNAttachmentKit.swiftmodule/arm64-apple-ios-simulator.abi.json +7188 -4555
  17. package/ios/RNAttachmentKit.xcframework/ios-arm64_x86_64-simulator/RNAttachmentKit.framework/Modules/RNAttachmentKit.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +37 -1
  18. package/ios/RNAttachmentKit.xcframework/ios-arm64_x86_64-simulator/RNAttachmentKit.framework/Modules/RNAttachmentKit.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
  19. package/ios/RNAttachmentKit.xcframework/ios-arm64_x86_64-simulator/RNAttachmentKit.framework/Modules/RNAttachmentKit.swiftmodule/arm64-apple-ios-simulator.swiftinterface +37 -1
  20. package/ios/RNAttachmentKit.xcframework/ios-arm64_x86_64-simulator/RNAttachmentKit.framework/Modules/RNAttachmentKit.swiftmodule/x86_64-apple-ios-simulator.abi.json +7188 -4555
  21. package/ios/RNAttachmentKit.xcframework/ios-arm64_x86_64-simulator/RNAttachmentKit.framework/Modules/RNAttachmentKit.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +37 -1
  22. package/ios/RNAttachmentKit.xcframework/ios-arm64_x86_64-simulator/RNAttachmentKit.framework/Modules/RNAttachmentKit.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
  23. package/ios/RNAttachmentKit.xcframework/ios-arm64_x86_64-simulator/RNAttachmentKit.framework/Modules/RNAttachmentKit.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +37 -1
  24. package/ios/RNAttachmentKit.xcframework/ios-arm64_x86_64-simulator/RNAttachmentKit.framework/RNAttachmentKit +0 -0
  25. package/ios/RNAttachmentKit.xcframework/ios-arm64_x86_64-simulator/RNAttachmentKit.framework/_CodeSignature/CodeDirectory +0 -0
  26. package/ios/RNAttachmentKit.xcframework/ios-arm64_x86_64-simulator/RNAttachmentKit.framework/_CodeSignature/CodeResources +22 -22
  27. package/package.json +1 -1
  28. package/src/index.ts +24 -3
  29. package/src/types.ts +64 -1
@@ -490,6 +490,7 @@ extension RNAttachmentKit.RemoteImageViewerViewController : UIKit.UICollectionVi
490
490
  @_Concurrency.MainActor @preconcurrency @objc dynamic public func collectionView(_ collectionView: UIKit.UICollectionView, didSelectItemAt indexPath: Foundation.IndexPath)
491
491
  }
492
492
  extension RNAttachmentKit.RemoteImageViewerViewController {
493
+ @_Concurrency.MainActor @preconcurrency public func willCloseEventBody() -> [Swift.String : Any]
493
494
  @_Concurrency.MainActor @preconcurrency public func videoCloseSnapshot(in container: UIKit.UIView) -> (image: UIKit.UIImage, frame: CoreFoundation.CGRect)?
494
495
  }
495
496
  public struct Localizer {
@@ -703,6 +704,8 @@ extension RNAttachmentKit.MediaGalleryViewController : UIKit.UICollectionViewDat
703
704
  @_Concurrency.MainActor @preconcurrency public var sourceClipRect: CoreFoundation.CGRect?
704
705
  @_Concurrency.MainActor @preconcurrency public var sourceClipInsets: UIKit.UIEdgeInsets?
705
706
  @_Concurrency.MainActor @preconcurrency public func clipRect(in bounds: CoreFoundation.CGRect) -> CoreFoundation.CGRect?
707
+ @_Concurrency.MainActor @preconcurrency weak public var underView: UIKit.UIView?
708
+ @_Concurrency.MainActor @preconcurrency public func removeUnderLayer()
706
709
  @_Concurrency.MainActor @preconcurrency public func updateMaskView()
707
710
  @_Concurrency.MainActor @preconcurrency public var openDuration: Swift.Double
708
711
  @_Concurrency.MainActor @preconcurrency public var closeDuration: Swift.Double
@@ -832,6 +835,23 @@ public struct ReverseGeocodeError : Swift.Error {
832
835
  public static func apply(_ config: [Swift.String : Any])
833
836
  @objc deinit
834
837
  }
838
+ public struct VideoPreviewOptions {
839
+ public var height: Swift.Int
840
+ public var bitrate: Swift.Int
841
+ public var maxFps: Swift.Double
842
+ public var maxDurationSec: Swift.Double
843
+ public var codec: Swift.String
844
+ public init()
845
+ public init?(any v: Any?)
846
+ }
847
+ public struct VideoPreviewResult {
848
+ public let url: Foundation.URL
849
+ public let width: Swift.Int
850
+ public let height: Swift.Int
851
+ public let duration: Swift.Double
852
+ public let fileSize: Swift.Int64
853
+ public let bitrate: Swift.Int
854
+ }
835
855
  public struct VideoExportOptions {
836
856
  public var maxDurationSec: Swift.Double
837
857
  public var maxFileSizeMB: Swift.Double
@@ -839,6 +859,7 @@ public struct VideoExportOptions {
839
859
  public var defaultQuality: Swift.Int
840
860
  public var codec: Swift.String
841
861
  public var posterFormat: Swift.String
862
+ public var preview: RNAttachmentKit.VideoPreviewOptions?
842
863
  public init()
843
864
  public init(dictionary d: [Swift.String : Any]?)
844
865
  }
@@ -904,6 +925,7 @@ public enum VideoSendIssue {
904
925
  }
905
926
  final public class VideoExporter {
906
927
  public static let sizeMargin: Swift.Double
928
+ public static func tooLongText(maxDurationSec: Swift.Double, languageCode: Swift.String) -> Swift.String
907
929
  public static func sendIssue(sourceDuration: Swift.Double, sourceShortSide: CoreFoundation.CGFloat, state: RNAttachmentKit.VideoEditState, options: RNAttachmentKit.VideoExportOptions) -> RNAttachmentKit.VideoSendIssue?
908
930
  public static func fittedQuality(_ want: Swift.Int, sourceShortSide: CoreFoundation.CGFloat, outputDuration: Swift.Double, options: RNAttachmentKit.VideoExportOptions) -> Swift.Int
909
931
  public enum ExportError : Foundation.LocalizedError {
@@ -920,6 +942,8 @@ final public class VideoExporter {
920
942
  final public func cancel()
921
943
  final public func export(asset: Photos.PHAsset, state: RNAttachmentKit.VideoEditState, options: RNAttachmentKit.VideoExportOptions, outputDir: Foundation.URL, baseName: Swift.String, progress: @escaping (Swift.Double) -> Swift.Void) throws -> RNAttachmentKit.VideoExportResult
922
944
  final public func export(fileURL: Foundation.URL, state: RNAttachmentKit.VideoEditState, options: RNAttachmentKit.VideoExportOptions, outputDir: Foundation.URL, baseName: Swift.String, progress: @escaping (Swift.Double) -> Swift.Void) throws -> RNAttachmentKit.VideoExportResult
945
+ public static func previewWorthMaking(sentShortSide: Swift.Int, sentFileSize: Swift.Int64, sentDuration: Swift.Double, options: RNAttachmentKit.VideoPreviewOptions) -> Swift.Bool
946
+ final public func makePreview(from source: Foundation.URL, options: RNAttachmentKit.VideoPreviewOptions, to url: Foundation.URL, progress: @escaping (Swift.Double) -> Swift.Void) throws -> RNAttachmentKit.VideoPreviewResult
923
947
  public static func encodePoster(_ image: UIKit.UIImage, format: Swift.String, quality: CoreFoundation.CGFloat) -> (data: Foundation.Data, fileExtension: Swift.String)?
924
948
  @objc deinit
925
949
  }
@@ -937,7 +961,8 @@ public struct ViewerVideoItem {
937
961
  public var uri: Swift.String
938
962
  public var duration: Swift.Double?
939
963
  public var cacheFile: Swift.String?
940
- public init(uri: Swift.String, duration: Swift.Double? = nil, cacheFile: Swift.String? = nil)
964
+ public var startTime: Swift.Double?
965
+ public init(uri: Swift.String, duration: Swift.Double? = nil, cacheFile: Swift.String? = nil, startTime: Swift.Double? = nil)
941
966
  public init?(dictionary d: Any?)
942
967
  }
943
968
  @_hasMissingDesignatedInitializers final public class VideoPrepareManager {
@@ -1002,8 +1027,19 @@ public struct AttachmentResult {
1002
1027
  public var videoCodec: Swift.String?
1003
1028
  public var videoBitrate: Swift.Int?
1004
1029
  public var edited: Swift.Bool?
1030
+ public var previewURL: Foundation.URL?
1031
+ public var previewWidth: Swift.Int?
1032
+ public var previewHeight: Swift.Int?
1033
+ public var previewDuration: Swift.Double?
1034
+ public var previewFileSize: Swift.Int64?
1035
+ public var previewBitrate: Swift.Int?
1036
+ public var previewError: Swift.String?
1037
+ public var previewSkipped: Swift.String?
1005
1038
  public var error: Swift.String?
1006
1039
  public var cancelled: Swift.Bool
1040
+ public var previewPath: Swift.String? {
1041
+ get
1042
+ }
1007
1043
  public var path: Swift.String? {
1008
1044
  get
1009
1045
  }
@@ -490,6 +490,7 @@ extension RNAttachmentKit.RemoteImageViewerViewController : UIKit.UICollectionVi
490
490
  @_Concurrency.MainActor @preconcurrency @objc dynamic public func collectionView(_ collectionView: UIKit.UICollectionView, didSelectItemAt indexPath: Foundation.IndexPath)
491
491
  }
492
492
  extension RNAttachmentKit.RemoteImageViewerViewController {
493
+ @_Concurrency.MainActor @preconcurrency public func willCloseEventBody() -> [Swift.String : Any]
493
494
  @_Concurrency.MainActor @preconcurrency public func videoCloseSnapshot(in container: UIKit.UIView) -> (image: UIKit.UIImage, frame: CoreFoundation.CGRect)?
494
495
  }
495
496
  public struct Localizer {
@@ -703,6 +704,8 @@ extension RNAttachmentKit.MediaGalleryViewController : UIKit.UICollectionViewDat
703
704
  @_Concurrency.MainActor @preconcurrency public var sourceClipRect: CoreFoundation.CGRect?
704
705
  @_Concurrency.MainActor @preconcurrency public var sourceClipInsets: UIKit.UIEdgeInsets?
705
706
  @_Concurrency.MainActor @preconcurrency public func clipRect(in bounds: CoreFoundation.CGRect) -> CoreFoundation.CGRect?
707
+ @_Concurrency.MainActor @preconcurrency weak public var underView: UIKit.UIView?
708
+ @_Concurrency.MainActor @preconcurrency public func removeUnderLayer()
706
709
  @_Concurrency.MainActor @preconcurrency public func updateMaskView()
707
710
  @_Concurrency.MainActor @preconcurrency public var openDuration: Swift.Double
708
711
  @_Concurrency.MainActor @preconcurrency public var closeDuration: Swift.Double
@@ -832,6 +835,23 @@ public struct ReverseGeocodeError : Swift.Error {
832
835
  public static func apply(_ config: [Swift.String : Any])
833
836
  @objc deinit
834
837
  }
838
+ public struct VideoPreviewOptions {
839
+ public var height: Swift.Int
840
+ public var bitrate: Swift.Int
841
+ public var maxFps: Swift.Double
842
+ public var maxDurationSec: Swift.Double
843
+ public var codec: Swift.String
844
+ public init()
845
+ public init?(any v: Any?)
846
+ }
847
+ public struct VideoPreviewResult {
848
+ public let url: Foundation.URL
849
+ public let width: Swift.Int
850
+ public let height: Swift.Int
851
+ public let duration: Swift.Double
852
+ public let fileSize: Swift.Int64
853
+ public let bitrate: Swift.Int
854
+ }
835
855
  public struct VideoExportOptions {
836
856
  public var maxDurationSec: Swift.Double
837
857
  public var maxFileSizeMB: Swift.Double
@@ -839,6 +859,7 @@ public struct VideoExportOptions {
839
859
  public var defaultQuality: Swift.Int
840
860
  public var codec: Swift.String
841
861
  public var posterFormat: Swift.String
862
+ public var preview: RNAttachmentKit.VideoPreviewOptions?
842
863
  public init()
843
864
  public init(dictionary d: [Swift.String : Any]?)
844
865
  }
@@ -904,6 +925,7 @@ public enum VideoSendIssue {
904
925
  }
905
926
  final public class VideoExporter {
906
927
  public static let sizeMargin: Swift.Double
928
+ public static func tooLongText(maxDurationSec: Swift.Double, languageCode: Swift.String) -> Swift.String
907
929
  public static func sendIssue(sourceDuration: Swift.Double, sourceShortSide: CoreFoundation.CGFloat, state: RNAttachmentKit.VideoEditState, options: RNAttachmentKit.VideoExportOptions) -> RNAttachmentKit.VideoSendIssue?
908
930
  public static func fittedQuality(_ want: Swift.Int, sourceShortSide: CoreFoundation.CGFloat, outputDuration: Swift.Double, options: RNAttachmentKit.VideoExportOptions) -> Swift.Int
909
931
  public enum ExportError : Foundation.LocalizedError {
@@ -920,6 +942,8 @@ final public class VideoExporter {
920
942
  final public func cancel()
921
943
  final public func export(asset: Photos.PHAsset, state: RNAttachmentKit.VideoEditState, options: RNAttachmentKit.VideoExportOptions, outputDir: Foundation.URL, baseName: Swift.String, progress: @escaping (Swift.Double) -> Swift.Void) throws -> RNAttachmentKit.VideoExportResult
922
944
  final public func export(fileURL: Foundation.URL, state: RNAttachmentKit.VideoEditState, options: RNAttachmentKit.VideoExportOptions, outputDir: Foundation.URL, baseName: Swift.String, progress: @escaping (Swift.Double) -> Swift.Void) throws -> RNAttachmentKit.VideoExportResult
945
+ public static func previewWorthMaking(sentShortSide: Swift.Int, sentFileSize: Swift.Int64, sentDuration: Swift.Double, options: RNAttachmentKit.VideoPreviewOptions) -> Swift.Bool
946
+ final public func makePreview(from source: Foundation.URL, options: RNAttachmentKit.VideoPreviewOptions, to url: Foundation.URL, progress: @escaping (Swift.Double) -> Swift.Void) throws -> RNAttachmentKit.VideoPreviewResult
923
947
  public static func encodePoster(_ image: UIKit.UIImage, format: Swift.String, quality: CoreFoundation.CGFloat) -> (data: Foundation.Data, fileExtension: Swift.String)?
924
948
  @objc deinit
925
949
  }
@@ -937,7 +961,8 @@ public struct ViewerVideoItem {
937
961
  public var uri: Swift.String
938
962
  public var duration: Swift.Double?
939
963
  public var cacheFile: Swift.String?
940
- public init(uri: Swift.String, duration: Swift.Double? = nil, cacheFile: Swift.String? = nil)
964
+ public var startTime: Swift.Double?
965
+ public init(uri: Swift.String, duration: Swift.Double? = nil, cacheFile: Swift.String? = nil, startTime: Swift.Double? = nil)
941
966
  public init?(dictionary d: Any?)
942
967
  }
943
968
  @_hasMissingDesignatedInitializers final public class VideoPrepareManager {
@@ -1002,8 +1027,19 @@ public struct AttachmentResult {
1002
1027
  public var videoCodec: Swift.String?
1003
1028
  public var videoBitrate: Swift.Int?
1004
1029
  public var edited: Swift.Bool?
1030
+ public var previewURL: Foundation.URL?
1031
+ public var previewWidth: Swift.Int?
1032
+ public var previewHeight: Swift.Int?
1033
+ public var previewDuration: Swift.Double?
1034
+ public var previewFileSize: Swift.Int64?
1035
+ public var previewBitrate: Swift.Int?
1036
+ public var previewError: Swift.String?
1037
+ public var previewSkipped: Swift.String?
1005
1038
  public var error: Swift.String?
1006
1039
  public var cancelled: Swift.Bool
1040
+ public var previewPath: Swift.String? {
1041
+ get
1042
+ }
1007
1043
  public var path: Swift.String? {
1008
1044
  get
1009
1045
  }
@@ -30,23 +30,23 @@
30
30
  </data>
31
31
  <key>Modules/RNAttachmentKit.swiftmodule/arm64-apple-ios.abi.json</key>
32
32
  <data>
33
- 4pXl77oaqGf4kp0ccvkhQUG7h80=
33
+ tl9QjHjC8qI5JSYGpkUfAK2YGpo=
34
34
  </data>
35
35
  <key>Modules/RNAttachmentKit.swiftmodule/arm64-apple-ios.private.swiftinterface</key>
36
36
  <data>
37
- Ne9vcMLnZi2MxDGKyNnwi97bL84=
37
+ sE8pffkEOfbbnupugaMayiY2Y+s=
38
38
  </data>
39
39
  <key>Modules/RNAttachmentKit.swiftmodule/arm64-apple-ios.swiftdoc</key>
40
40
  <data>
41
- NdmsL6G2DN6mQCB2p4dZudF/Y/A=
41
+ KbCVdjIosKSLgCfqnpl445EcxWU=
42
42
  </data>
43
43
  <key>Modules/RNAttachmentKit.swiftmodule/arm64-apple-ios.swiftinterface</key>
44
44
  <data>
45
- Ne9vcMLnZi2MxDGKyNnwi97bL84=
45
+ sE8pffkEOfbbnupugaMayiY2Y+s=
46
46
  </data>
47
47
  <key>Modules/RNAttachmentKit.swiftmodule/arm64-apple-ios.swiftmodule</key>
48
48
  <data>
49
- NByxa9uw3+fv7u8xscuWgQMLqXg=
49
+ Lc6KrNwkNWlD7atVcH5Fgkc77F4=
50
50
  </data>
51
51
  <key>Modules/module.modulemap</key>
52
52
  <data>
@@ -242,35 +242,35 @@
242
242
  <dict>
243
243
  <key>hash2</key>
244
244
  <data>
245
- yrEFcLxuZNiJZCnTbLDvLuPuZSImZSXoqrPGP50aleg=
245
+ YUjLKJjnt06lEXMxebYCo0ZvaDCxPo213q2O1UqjYUg=
246
246
  </data>
247
247
  </dict>
248
248
  <key>Modules/RNAttachmentKit.swiftmodule/arm64-apple-ios.private.swiftinterface</key>
249
249
  <dict>
250
250
  <key>hash2</key>
251
251
  <data>
252
- RGuaglarcySZLYt86m9oFo7HK+zyW7IF5TrVvNGYTbQ=
252
+ CgB/kN5219+YdHfRWuv84zMNnhnJgkCfKnUNIykxZ7Y=
253
253
  </data>
254
254
  </dict>
255
255
  <key>Modules/RNAttachmentKit.swiftmodule/arm64-apple-ios.swiftdoc</key>
256
256
  <dict>
257
257
  <key>hash2</key>
258
258
  <data>
259
- L/hilWOgTXQhtenmbgE842fuflYednu2E6kp83/ckkg=
259
+ qYVF7nfV42ki1IcKOoOOI17N4RqSU3RPmRQE9uBTMbg=
260
260
  </data>
261
261
  </dict>
262
262
  <key>Modules/RNAttachmentKit.swiftmodule/arm64-apple-ios.swiftinterface</key>
263
263
  <dict>
264
264
  <key>hash2</key>
265
265
  <data>
266
- RGuaglarcySZLYt86m9oFo7HK+zyW7IF5TrVvNGYTbQ=
266
+ CgB/kN5219+YdHfRWuv84zMNnhnJgkCfKnUNIykxZ7Y=
267
267
  </data>
268
268
  </dict>
269
269
  <key>Modules/RNAttachmentKit.swiftmodule/arm64-apple-ios.swiftmodule</key>
270
270
  <dict>
271
271
  <key>hash2</key>
272
272
  <data>
273
- Xg3ufTjOmjWtQUMuGn4IPlALqJ/lG8Nt2Qi0KoeYLcQ=
273
+ rXnJrWHqXU0kQdiYt5Tu/3wA9ORHkXYF1c+X6nz4l94=
274
274
  </data>
275
275
  </dict>
276
276
  <key>Modules/module.modulemap</key>