react-native-attachment-kit 1.0.18 → 1.1.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.
- package/CHANGELOG.md +15 -0
- package/README.md +4 -2
- package/android/build.gradle +8 -3
- package/android/src/main/libs/rnattachmentkit-release.aar +0 -0
- package/android/src/newarch/java/com/rnattachmentkit/RNAttachmentKitModule.kt +82 -341
- package/android/src/oldarch/java/com/rnattachmentkit/RNAttachmentKitModule.kt +82 -341
- package/ios/RNAttachmentKit.swift +84 -771
- package/ios/RNAttachmentKit.xcframework/ios-arm64/RNAttachmentKit.framework/Assets.car +0 -0
- package/ios/RNAttachmentKit.xcframework/ios-arm64/RNAttachmentKit.framework/Modules/RNAttachmentKit.swiftmodule/arm64-apple-ios.abi.json +6709 -449
- package/ios/RNAttachmentKit.xcframework/ios-arm64/RNAttachmentKit.framework/Modules/RNAttachmentKit.swiftmodule/arm64-apple-ios.private.swiftinterface +110 -0
- package/ios/RNAttachmentKit.xcframework/ios-arm64/RNAttachmentKit.framework/Modules/RNAttachmentKit.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
- package/ios/RNAttachmentKit.xcframework/ios-arm64/RNAttachmentKit.framework/Modules/RNAttachmentKit.swiftmodule/arm64-apple-ios.swiftinterface +110 -0
- package/ios/RNAttachmentKit.xcframework/ios-arm64/RNAttachmentKit.framework/RNAttachmentKit +0 -0
- package/ios/RNAttachmentKit.xcframework/ios-arm64/RNAttachmentKit.framework/_CodeSignature/CodeDirectory +0 -0
- package/ios/RNAttachmentKit.xcframework/ios-arm64/RNAttachmentKit.framework/_CodeSignature/CodeResources +12 -12
- package/ios/RNAttachmentKit.xcframework/ios-arm64/RNAttachmentKit.framework/_CodeSignature/CodeSignature +0 -0
- package/ios/RNAttachmentKit.xcframework/ios-arm64_x86_64-simulator/RNAttachmentKit.framework/Modules/RNAttachmentKit.swiftmodule/arm64-apple-ios-simulator.abi.json +6709 -449
- package/ios/RNAttachmentKit.xcframework/ios-arm64_x86_64-simulator/RNAttachmentKit.framework/Modules/RNAttachmentKit.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +110 -0
- package/ios/RNAttachmentKit.xcframework/ios-arm64_x86_64-simulator/RNAttachmentKit.framework/Modules/RNAttachmentKit.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
- package/ios/RNAttachmentKit.xcframework/ios-arm64_x86_64-simulator/RNAttachmentKit.framework/Modules/RNAttachmentKit.swiftmodule/arm64-apple-ios-simulator.swiftinterface +110 -0
- package/ios/RNAttachmentKit.xcframework/ios-arm64_x86_64-simulator/RNAttachmentKit.framework/Modules/RNAttachmentKit.swiftmodule/x86_64-apple-ios-simulator.abi.json +6709 -449
- package/ios/RNAttachmentKit.xcframework/ios-arm64_x86_64-simulator/RNAttachmentKit.framework/Modules/RNAttachmentKit.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +110 -0
- package/ios/RNAttachmentKit.xcframework/ios-arm64_x86_64-simulator/RNAttachmentKit.framework/Modules/RNAttachmentKit.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
- package/ios/RNAttachmentKit.xcframework/ios-arm64_x86_64-simulator/RNAttachmentKit.framework/Modules/RNAttachmentKit.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +110 -0
- package/ios/RNAttachmentKit.xcframework/ios-arm64_x86_64-simulator/RNAttachmentKit.framework/RNAttachmentKit +0 -0
- package/ios/RNAttachmentKit.xcframework/ios-arm64_x86_64-simulator/RNAttachmentKit.framework/_CodeSignature/CodeDirectory +0 -0
- package/ios/RNAttachmentKit.xcframework/ios-arm64_x86_64-simulator/RNAttachmentKit.framework/_CodeSignature/CodeResources +20 -20
- package/package.json +1 -1
- package/src/index.ts +4 -3
- package/src/types.ts +28 -0
|
@@ -392,8 +392,12 @@ extension RNAttachmentKit.GalleryBaseViewController : UIKit.UIAdaptivePresentati
|
|
|
392
392
|
}
|
|
393
393
|
@_hasMissingDesignatedInitializers public class LicenseManager {
|
|
394
394
|
public static let shared: RNAttachmentKit.LicenseManager
|
|
395
|
+
public var isInitialized: Swift.Bool {
|
|
396
|
+
get
|
|
397
|
+
}
|
|
395
398
|
public func initialize(with key: Swift.String) -> Swift.Bool
|
|
396
399
|
public func isValidLicense() -> Swift.Bool
|
|
400
|
+
public func whenInitialized(timeout: Foundation.TimeInterval = 3, _ block: @escaping () -> Swift.Void)
|
|
397
401
|
@objc deinit
|
|
398
402
|
}
|
|
399
403
|
public enum LicenseGate {
|
|
@@ -696,6 +700,9 @@ extension RNAttachmentKit.MediaGalleryViewController : UIKit.UICollectionViewDat
|
|
|
696
700
|
@_Concurrency.MainActor @preconcurrency public var sourceBorderCorners: QuartzCore.CACornerMask
|
|
697
701
|
@_Concurrency.MainActor @preconcurrency public var sourceBackgroundColor: UIKit.UIColor
|
|
698
702
|
@_Concurrency.MainActor @preconcurrency public var fadeOutOnDismiss: Swift.Bool
|
|
703
|
+
@_Concurrency.MainActor @preconcurrency public var sourceClipRect: CoreFoundation.CGRect?
|
|
704
|
+
@_Concurrency.MainActor @preconcurrency public var sourceClipInsets: UIKit.UIEdgeInsets?
|
|
705
|
+
@_Concurrency.MainActor @preconcurrency public func clipRect(in bounds: CoreFoundation.CGRect) -> CoreFoundation.CGRect?
|
|
699
706
|
@_Concurrency.MainActor @preconcurrency public func updateMaskView()
|
|
700
707
|
@_Concurrency.MainActor @preconcurrency public var openDuration: Swift.Double
|
|
701
708
|
@_Concurrency.MainActor @preconcurrency public var closeDuration: Swift.Double
|
|
@@ -941,6 +948,109 @@ public struct ViewerVideoItem {
|
|
|
941
948
|
final public func discardAll()
|
|
942
949
|
@objc deinit
|
|
943
950
|
}
|
|
951
|
+
public struct PhotoThumbnailOptions {
|
|
952
|
+
public let maxWidth: Swift.Int
|
|
953
|
+
public let maxHeight: Swift.Int
|
|
954
|
+
public let cover: Swift.Bool
|
|
955
|
+
public let quality: CoreFoundation.CGFloat
|
|
956
|
+
public let format: Swift.String
|
|
957
|
+
public init(maxWidth: Swift.Int, maxHeight: Swift.Int = 0, cover: Swift.Bool = false, quality: CoreFoundation.CGFloat = 0.8, format: Swift.String = "webp")
|
|
958
|
+
public init?(_ raw: Any?)
|
|
959
|
+
}
|
|
960
|
+
public struct AttachmentProcessingOptions {
|
|
961
|
+
public var maxWidth: Swift.Int
|
|
962
|
+
public var maxHeight: Swift.Int
|
|
963
|
+
public var outputFormat: Swift.String
|
|
964
|
+
public var thumbnail: RNAttachmentKit.PhotoThumbnailOptions?
|
|
965
|
+
public var video: RNAttachmentKit.VideoExportOptions
|
|
966
|
+
public var outputDirectory: Swift.String
|
|
967
|
+
public init(maxWidth: Swift.Int = 0, maxHeight: Swift.Int = 0, outputFormat: Swift.String = "webp", thumbnail: RNAttachmentKit.PhotoThumbnailOptions? = nil, video: RNAttachmentKit.VideoExportOptions = VideoExportOptions(), outputDirectory: Swift.String? = nil)
|
|
968
|
+
}
|
|
969
|
+
public struct AttachmentStartItem {
|
|
970
|
+
public let index: Swift.Int
|
|
971
|
+
public let isVideo: Swift.Bool
|
|
972
|
+
public let originalUri: Swift.String?
|
|
973
|
+
public let width: Swift.Int
|
|
974
|
+
public let height: Swift.Int
|
|
975
|
+
public let duration: Swift.Double?
|
|
976
|
+
public let posterURL: Foundation.URL?
|
|
977
|
+
public let posterWidth: Swift.Int
|
|
978
|
+
public let posterHeight: Swift.Int
|
|
979
|
+
public var dictionary: [Swift.String : Any] {
|
|
980
|
+
get
|
|
981
|
+
}
|
|
982
|
+
}
|
|
983
|
+
public struct AttachmentResult {
|
|
984
|
+
public let index: Swift.Int
|
|
985
|
+
public let isVideo: Swift.Bool
|
|
986
|
+
public var uri: Swift.String?
|
|
987
|
+
public var mimeType: Swift.String
|
|
988
|
+
public var width: Swift.Int?
|
|
989
|
+
public var height: Swift.Int?
|
|
990
|
+
public var fileName: Swift.String?
|
|
991
|
+
public var fileExtension: Swift.String?
|
|
992
|
+
public var fileSize: Swift.Int64?
|
|
993
|
+
public var originalUri: Swift.String
|
|
994
|
+
public var originalFileUri: Swift.String?
|
|
995
|
+
public var originalWidth: Swift.Int
|
|
996
|
+
public var originalHeight: Swift.Int
|
|
997
|
+
public var thumbnailURL: Foundation.URL?
|
|
998
|
+
public var thumbnailWidth: Swift.Int?
|
|
999
|
+
public var thumbnailHeight: Swift.Int?
|
|
1000
|
+
public var thumbnailFileSize: Swift.Int?
|
|
1001
|
+
public var duration: Swift.Double?
|
|
1002
|
+
public var videoCodec: Swift.String?
|
|
1003
|
+
public var videoBitrate: Swift.Int?
|
|
1004
|
+
public var edited: Swift.Bool?
|
|
1005
|
+
public var error: Swift.String?
|
|
1006
|
+
public var cancelled: Swift.Bool
|
|
1007
|
+
public var path: Swift.String? {
|
|
1008
|
+
get
|
|
1009
|
+
}
|
|
1010
|
+
public var dictionary: [Swift.String : Any] {
|
|
1011
|
+
get
|
|
1012
|
+
}
|
|
1013
|
+
}
|
|
1014
|
+
final public class AttachmentProcessingJob {
|
|
1015
|
+
public init()
|
|
1016
|
+
final public func cancel(index: Swift.Int?)
|
|
1017
|
+
final public func abort()
|
|
1018
|
+
final public var isAborted: Swift.Bool {
|
|
1019
|
+
get
|
|
1020
|
+
}
|
|
1021
|
+
final public func isCancelled(_ i: Swift.Int) -> Swift.Bool
|
|
1022
|
+
final public func begin(index: Swift.Int, exporter: RNAttachmentKit.VideoExporter)
|
|
1023
|
+
final public func end()
|
|
1024
|
+
@objc deinit
|
|
1025
|
+
}
|
|
1026
|
+
final public class AttachmentProgressThrottle {
|
|
1027
|
+
public init()
|
|
1028
|
+
final public func shouldSend(_ p: Swift.Double) -> Swift.Bool
|
|
1029
|
+
@objc deinit
|
|
1030
|
+
}
|
|
1031
|
+
public enum AttachmentProcessor {
|
|
1032
|
+
@discardableResult
|
|
1033
|
+
public static func process(_ selected: [(Photos.PHAsset?, UIKit.UIImage)], videoStates: [Swift.String : RNAttachmentKit.VideoEditState], options: RNAttachmentKit.AttachmentProcessingOptions, job: RNAttachmentKit.AttachmentProcessingJob, onStart: (([RNAttachmentKit.AttachmentStartItem]) -> Swift.Void)? = nil, onVideoProgress: ((Swift.Int, Swift.Double) -> Swift.Void)? = nil, onItem: ((RNAttachmentKit.AttachmentResult) -> Swift.Void)? = nil) -> (results: [RNAttachmentKit.AttachmentResult], aborted: Swift.Bool)
|
|
1034
|
+
public static func startItem(index: Swift.Int, asset: Photos.PHAsset?, image: UIKit.UIImage?, videoStates: [Swift.String : RNAttachmentKit.VideoEditState], options: RNAttachmentKit.AttachmentProcessingOptions) -> RNAttachmentKit.AttachmentStartItem
|
|
1035
|
+
public static func processPhoto(_ image: UIKit.UIImage, asset: Photos.PHAsset?, index: Swift.Int, options: RNAttachmentKit.AttachmentProcessingOptions) -> RNAttachmentKit.AttachmentResult?
|
|
1036
|
+
public static func processVideo(_ phAsset: Photos.PHAsset, index: Swift.Int, state: RNAttachmentKit.VideoEditState, options: RNAttachmentKit.AttachmentProcessingOptions, job: RNAttachmentKit.AttachmentProcessingJob, progress: ((Swift.Double) -> Swift.Void)? = nil) throws -> RNAttachmentKit.AttachmentResult
|
|
1037
|
+
public static var cacheDirectory: Swift.String {
|
|
1038
|
+
get
|
|
1039
|
+
}
|
|
1040
|
+
@discardableResult
|
|
1041
|
+
public static func prepareCacheDirectory() -> Swift.String
|
|
1042
|
+
public static func resizeImage(_ image: UIKit.UIImage, maxWidth: Swift.Int, maxHeight: Swift.Int) -> UIKit.UIImage?
|
|
1043
|
+
public static func saveOriginalImageAsJPEG(_ image: UIKit.UIImage, index: Swift.Int, timestamp: Swift.Int, tempDir: Swift.String) -> Swift.String?
|
|
1044
|
+
public static func saveImage(_ image: UIKit.UIImage, format: Swift.String, prefix: Swift.String, index: Swift.Int, timestamp: Swift.Int, tempDir: Swift.String, forceJPEG: Swift.Bool = false) -> Swift.String?
|
|
1045
|
+
public static func encodeWebP(image: UIKit.UIImage, quality: CoreFoundation.CGFloat) -> Foundation.Data?
|
|
1046
|
+
public static func mimeType(for format: Swift.String) -> Swift.String
|
|
1047
|
+
public static func fileMetadata(fromPath filePath: Swift.String) -> (fileName: Swift.String, fileExtension: Swift.String, fileSize: Swift.Int64)
|
|
1048
|
+
public static func photoThumbnailLayout(width w: Swift.Int, height h: Swift.Int, options o: RNAttachmentKit.PhotoThumbnailOptions) -> (crop: CoreFoundation.CGRect, size: CoreFoundation.CGSize)
|
|
1049
|
+
public static func makePhotoThumbnail(_ image: UIKit.UIImage, options: RNAttachmentKit.PhotoThumbnailOptions?, index: Swift.Int, timestamp: Swift.Int, tempDir: Swift.String) -> (url: Foundation.URL, width: Swift.Int, height: Swift.Int, fileSize: Swift.Int)?
|
|
1050
|
+
public static func photoThumbnailFields(_ image: UIKit.UIImage, options: RNAttachmentKit.PhotoThumbnailOptions?, index: Swift.Int, timestamp: Swift.Int, tempDir: Swift.String) -> [Swift.String : Any]
|
|
1051
|
+
public static func videoFrame(_ asset: Photos.PHAsset, at seconds: Swift.Double) -> UIKit.UIImage?
|
|
1052
|
+
public static func requestPoster(_ asset: Photos.PHAsset) -> UIKit.UIImage?
|
|
1053
|
+
}
|
|
944
1054
|
extension RNAttachmentKit.AttachMenuTab : Swift.Equatable {}
|
|
945
1055
|
extension RNAttachmentKit.AttachMenuTab : Swift.Hashable {}
|
|
946
1056
|
extension RNAttachmentKit.AttachMenuTab : Swift.RawRepresentable {}
|
|
Binary file
|
|
@@ -392,8 +392,12 @@ extension RNAttachmentKit.GalleryBaseViewController : UIKit.UIAdaptivePresentati
|
|
|
392
392
|
}
|
|
393
393
|
@_hasMissingDesignatedInitializers public class LicenseManager {
|
|
394
394
|
public static let shared: RNAttachmentKit.LicenseManager
|
|
395
|
+
public var isInitialized: Swift.Bool {
|
|
396
|
+
get
|
|
397
|
+
}
|
|
395
398
|
public func initialize(with key: Swift.String) -> Swift.Bool
|
|
396
399
|
public func isValidLicense() -> Swift.Bool
|
|
400
|
+
public func whenInitialized(timeout: Foundation.TimeInterval = 3, _ block: @escaping () -> Swift.Void)
|
|
397
401
|
@objc deinit
|
|
398
402
|
}
|
|
399
403
|
public enum LicenseGate {
|
|
@@ -696,6 +700,9 @@ extension RNAttachmentKit.MediaGalleryViewController : UIKit.UICollectionViewDat
|
|
|
696
700
|
@_Concurrency.MainActor @preconcurrency public var sourceBorderCorners: QuartzCore.CACornerMask
|
|
697
701
|
@_Concurrency.MainActor @preconcurrency public var sourceBackgroundColor: UIKit.UIColor
|
|
698
702
|
@_Concurrency.MainActor @preconcurrency public var fadeOutOnDismiss: Swift.Bool
|
|
703
|
+
@_Concurrency.MainActor @preconcurrency public var sourceClipRect: CoreFoundation.CGRect?
|
|
704
|
+
@_Concurrency.MainActor @preconcurrency public var sourceClipInsets: UIKit.UIEdgeInsets?
|
|
705
|
+
@_Concurrency.MainActor @preconcurrency public func clipRect(in bounds: CoreFoundation.CGRect) -> CoreFoundation.CGRect?
|
|
699
706
|
@_Concurrency.MainActor @preconcurrency public func updateMaskView()
|
|
700
707
|
@_Concurrency.MainActor @preconcurrency public var openDuration: Swift.Double
|
|
701
708
|
@_Concurrency.MainActor @preconcurrency public var closeDuration: Swift.Double
|
|
@@ -941,6 +948,109 @@ public struct ViewerVideoItem {
|
|
|
941
948
|
final public func discardAll()
|
|
942
949
|
@objc deinit
|
|
943
950
|
}
|
|
951
|
+
public struct PhotoThumbnailOptions {
|
|
952
|
+
public let maxWidth: Swift.Int
|
|
953
|
+
public let maxHeight: Swift.Int
|
|
954
|
+
public let cover: Swift.Bool
|
|
955
|
+
public let quality: CoreFoundation.CGFloat
|
|
956
|
+
public let format: Swift.String
|
|
957
|
+
public init(maxWidth: Swift.Int, maxHeight: Swift.Int = 0, cover: Swift.Bool = false, quality: CoreFoundation.CGFloat = 0.8, format: Swift.String = "webp")
|
|
958
|
+
public init?(_ raw: Any?)
|
|
959
|
+
}
|
|
960
|
+
public struct AttachmentProcessingOptions {
|
|
961
|
+
public var maxWidth: Swift.Int
|
|
962
|
+
public var maxHeight: Swift.Int
|
|
963
|
+
public var outputFormat: Swift.String
|
|
964
|
+
public var thumbnail: RNAttachmentKit.PhotoThumbnailOptions?
|
|
965
|
+
public var video: RNAttachmentKit.VideoExportOptions
|
|
966
|
+
public var outputDirectory: Swift.String
|
|
967
|
+
public init(maxWidth: Swift.Int = 0, maxHeight: Swift.Int = 0, outputFormat: Swift.String = "webp", thumbnail: RNAttachmentKit.PhotoThumbnailOptions? = nil, video: RNAttachmentKit.VideoExportOptions = VideoExportOptions(), outputDirectory: Swift.String? = nil)
|
|
968
|
+
}
|
|
969
|
+
public struct AttachmentStartItem {
|
|
970
|
+
public let index: Swift.Int
|
|
971
|
+
public let isVideo: Swift.Bool
|
|
972
|
+
public let originalUri: Swift.String?
|
|
973
|
+
public let width: Swift.Int
|
|
974
|
+
public let height: Swift.Int
|
|
975
|
+
public let duration: Swift.Double?
|
|
976
|
+
public let posterURL: Foundation.URL?
|
|
977
|
+
public let posterWidth: Swift.Int
|
|
978
|
+
public let posterHeight: Swift.Int
|
|
979
|
+
public var dictionary: [Swift.String : Any] {
|
|
980
|
+
get
|
|
981
|
+
}
|
|
982
|
+
}
|
|
983
|
+
public struct AttachmentResult {
|
|
984
|
+
public let index: Swift.Int
|
|
985
|
+
public let isVideo: Swift.Bool
|
|
986
|
+
public var uri: Swift.String?
|
|
987
|
+
public var mimeType: Swift.String
|
|
988
|
+
public var width: Swift.Int?
|
|
989
|
+
public var height: Swift.Int?
|
|
990
|
+
public var fileName: Swift.String?
|
|
991
|
+
public var fileExtension: Swift.String?
|
|
992
|
+
public var fileSize: Swift.Int64?
|
|
993
|
+
public var originalUri: Swift.String
|
|
994
|
+
public var originalFileUri: Swift.String?
|
|
995
|
+
public var originalWidth: Swift.Int
|
|
996
|
+
public var originalHeight: Swift.Int
|
|
997
|
+
public var thumbnailURL: Foundation.URL?
|
|
998
|
+
public var thumbnailWidth: Swift.Int?
|
|
999
|
+
public var thumbnailHeight: Swift.Int?
|
|
1000
|
+
public var thumbnailFileSize: Swift.Int?
|
|
1001
|
+
public var duration: Swift.Double?
|
|
1002
|
+
public var videoCodec: Swift.String?
|
|
1003
|
+
public var videoBitrate: Swift.Int?
|
|
1004
|
+
public var edited: Swift.Bool?
|
|
1005
|
+
public var error: Swift.String?
|
|
1006
|
+
public var cancelled: Swift.Bool
|
|
1007
|
+
public var path: Swift.String? {
|
|
1008
|
+
get
|
|
1009
|
+
}
|
|
1010
|
+
public var dictionary: [Swift.String : Any] {
|
|
1011
|
+
get
|
|
1012
|
+
}
|
|
1013
|
+
}
|
|
1014
|
+
final public class AttachmentProcessingJob {
|
|
1015
|
+
public init()
|
|
1016
|
+
final public func cancel(index: Swift.Int?)
|
|
1017
|
+
final public func abort()
|
|
1018
|
+
final public var isAborted: Swift.Bool {
|
|
1019
|
+
get
|
|
1020
|
+
}
|
|
1021
|
+
final public func isCancelled(_ i: Swift.Int) -> Swift.Bool
|
|
1022
|
+
final public func begin(index: Swift.Int, exporter: RNAttachmentKit.VideoExporter)
|
|
1023
|
+
final public func end()
|
|
1024
|
+
@objc deinit
|
|
1025
|
+
}
|
|
1026
|
+
final public class AttachmentProgressThrottle {
|
|
1027
|
+
public init()
|
|
1028
|
+
final public func shouldSend(_ p: Swift.Double) -> Swift.Bool
|
|
1029
|
+
@objc deinit
|
|
1030
|
+
}
|
|
1031
|
+
public enum AttachmentProcessor {
|
|
1032
|
+
@discardableResult
|
|
1033
|
+
public static func process(_ selected: [(Photos.PHAsset?, UIKit.UIImage)], videoStates: [Swift.String : RNAttachmentKit.VideoEditState], options: RNAttachmentKit.AttachmentProcessingOptions, job: RNAttachmentKit.AttachmentProcessingJob, onStart: (([RNAttachmentKit.AttachmentStartItem]) -> Swift.Void)? = nil, onVideoProgress: ((Swift.Int, Swift.Double) -> Swift.Void)? = nil, onItem: ((RNAttachmentKit.AttachmentResult) -> Swift.Void)? = nil) -> (results: [RNAttachmentKit.AttachmentResult], aborted: Swift.Bool)
|
|
1034
|
+
public static func startItem(index: Swift.Int, asset: Photos.PHAsset?, image: UIKit.UIImage?, videoStates: [Swift.String : RNAttachmentKit.VideoEditState], options: RNAttachmentKit.AttachmentProcessingOptions) -> RNAttachmentKit.AttachmentStartItem
|
|
1035
|
+
public static func processPhoto(_ image: UIKit.UIImage, asset: Photos.PHAsset?, index: Swift.Int, options: RNAttachmentKit.AttachmentProcessingOptions) -> RNAttachmentKit.AttachmentResult?
|
|
1036
|
+
public static func processVideo(_ phAsset: Photos.PHAsset, index: Swift.Int, state: RNAttachmentKit.VideoEditState, options: RNAttachmentKit.AttachmentProcessingOptions, job: RNAttachmentKit.AttachmentProcessingJob, progress: ((Swift.Double) -> Swift.Void)? = nil) throws -> RNAttachmentKit.AttachmentResult
|
|
1037
|
+
public static var cacheDirectory: Swift.String {
|
|
1038
|
+
get
|
|
1039
|
+
}
|
|
1040
|
+
@discardableResult
|
|
1041
|
+
public static func prepareCacheDirectory() -> Swift.String
|
|
1042
|
+
public static func resizeImage(_ image: UIKit.UIImage, maxWidth: Swift.Int, maxHeight: Swift.Int) -> UIKit.UIImage?
|
|
1043
|
+
public static func saveOriginalImageAsJPEG(_ image: UIKit.UIImage, index: Swift.Int, timestamp: Swift.Int, tempDir: Swift.String) -> Swift.String?
|
|
1044
|
+
public static func saveImage(_ image: UIKit.UIImage, format: Swift.String, prefix: Swift.String, index: Swift.Int, timestamp: Swift.Int, tempDir: Swift.String, forceJPEG: Swift.Bool = false) -> Swift.String?
|
|
1045
|
+
public static func encodeWebP(image: UIKit.UIImage, quality: CoreFoundation.CGFloat) -> Foundation.Data?
|
|
1046
|
+
public static func mimeType(for format: Swift.String) -> Swift.String
|
|
1047
|
+
public static func fileMetadata(fromPath filePath: Swift.String) -> (fileName: Swift.String, fileExtension: Swift.String, fileSize: Swift.Int64)
|
|
1048
|
+
public static func photoThumbnailLayout(width w: Swift.Int, height h: Swift.Int, options o: RNAttachmentKit.PhotoThumbnailOptions) -> (crop: CoreFoundation.CGRect, size: CoreFoundation.CGSize)
|
|
1049
|
+
public static func makePhotoThumbnail(_ image: UIKit.UIImage, options: RNAttachmentKit.PhotoThumbnailOptions?, index: Swift.Int, timestamp: Swift.Int, tempDir: Swift.String) -> (url: Foundation.URL, width: Swift.Int, height: Swift.Int, fileSize: Swift.Int)?
|
|
1050
|
+
public static func photoThumbnailFields(_ image: UIKit.UIImage, options: RNAttachmentKit.PhotoThumbnailOptions?, index: Swift.Int, timestamp: Swift.Int, tempDir: Swift.String) -> [Swift.String : Any]
|
|
1051
|
+
public static func videoFrame(_ asset: Photos.PHAsset, at seconds: Swift.Double) -> UIKit.UIImage?
|
|
1052
|
+
public static func requestPoster(_ asset: Photos.PHAsset) -> UIKit.UIImage?
|
|
1053
|
+
}
|
|
944
1054
|
extension RNAttachmentKit.AttachMenuTab : Swift.Equatable {}
|
|
945
1055
|
extension RNAttachmentKit.AttachMenuTab : Swift.Hashable {}
|
|
946
1056
|
extension RNAttachmentKit.AttachMenuTab : Swift.RawRepresentable {}
|
|
Binary file
|
|
Binary file
|
|
@@ -30,43 +30,43 @@
|
|
|
30
30
|
</data>
|
|
31
31
|
<key>Modules/RNAttachmentKit.swiftmodule/arm64-apple-ios-simulator.abi.json</key>
|
|
32
32
|
<data>
|
|
33
|
-
|
|
33
|
+
HgBJ2YsmrBeU0DS85YgVPkDlLTs=
|
|
34
34
|
</data>
|
|
35
35
|
<key>Modules/RNAttachmentKit.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface</key>
|
|
36
36
|
<data>
|
|
37
|
-
|
|
37
|
+
Ed6Tp4ZdEh1Odi1mGzC5KfR3ub4=
|
|
38
38
|
</data>
|
|
39
39
|
<key>Modules/RNAttachmentKit.swiftmodule/arm64-apple-ios-simulator.swiftdoc</key>
|
|
40
40
|
<data>
|
|
41
|
-
|
|
41
|
+
fkzCLPjLTpoPLvuP7U4zaR7oFNw=
|
|
42
42
|
</data>
|
|
43
43
|
<key>Modules/RNAttachmentKit.swiftmodule/arm64-apple-ios-simulator.swiftinterface</key>
|
|
44
44
|
<data>
|
|
45
|
-
|
|
45
|
+
Ed6Tp4ZdEh1Odi1mGzC5KfR3ub4=
|
|
46
46
|
</data>
|
|
47
47
|
<key>Modules/RNAttachmentKit.swiftmodule/arm64-apple-ios-simulator.swiftmodule</key>
|
|
48
48
|
<data>
|
|
49
|
-
|
|
49
|
+
CJAZ6C+TQtNC/0MyMl2L2XpFaUk=
|
|
50
50
|
</data>
|
|
51
51
|
<key>Modules/RNAttachmentKit.swiftmodule/x86_64-apple-ios-simulator.abi.json</key>
|
|
52
52
|
<data>
|
|
53
|
-
|
|
53
|
+
HgBJ2YsmrBeU0DS85YgVPkDlLTs=
|
|
54
54
|
</data>
|
|
55
55
|
<key>Modules/RNAttachmentKit.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface</key>
|
|
56
56
|
<data>
|
|
57
|
-
|
|
57
|
+
rXiwUUI1CzRSug3fqRG9W7EfYXU=
|
|
58
58
|
</data>
|
|
59
59
|
<key>Modules/RNAttachmentKit.swiftmodule/x86_64-apple-ios-simulator.swiftdoc</key>
|
|
60
60
|
<data>
|
|
61
|
-
|
|
61
|
+
hA3QQl7XlEdD/dLJvtloBIYPppw=
|
|
62
62
|
</data>
|
|
63
63
|
<key>Modules/RNAttachmentKit.swiftmodule/x86_64-apple-ios-simulator.swiftinterface</key>
|
|
64
64
|
<data>
|
|
65
|
-
|
|
65
|
+
rXiwUUI1CzRSug3fqRG9W7EfYXU=
|
|
66
66
|
</data>
|
|
67
67
|
<key>Modules/RNAttachmentKit.swiftmodule/x86_64-apple-ios-simulator.swiftmodule</key>
|
|
68
68
|
<data>
|
|
69
|
-
|
|
69
|
+
J5L/JxV9FT2C8tH+lGCtE16c8TY=
|
|
70
70
|
</data>
|
|
71
71
|
<key>Modules/module.modulemap</key>
|
|
72
72
|
<data>
|
|
@@ -262,70 +262,70 @@
|
|
|
262
262
|
<dict>
|
|
263
263
|
<key>hash2</key>
|
|
264
264
|
<data>
|
|
265
|
-
|
|
265
|
+
nfoRXkCuOnu5U1wnp4zqqmGx+leb8bfClaFr07ayxcM=
|
|
266
266
|
</data>
|
|
267
267
|
</dict>
|
|
268
268
|
<key>Modules/RNAttachmentKit.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface</key>
|
|
269
269
|
<dict>
|
|
270
270
|
<key>hash2</key>
|
|
271
271
|
<data>
|
|
272
|
-
|
|
272
|
+
RX253JxJd5m5f5B7GitqxHUHfizHOfq8tSMHXN75o34=
|
|
273
273
|
</data>
|
|
274
274
|
</dict>
|
|
275
275
|
<key>Modules/RNAttachmentKit.swiftmodule/arm64-apple-ios-simulator.swiftdoc</key>
|
|
276
276
|
<dict>
|
|
277
277
|
<key>hash2</key>
|
|
278
278
|
<data>
|
|
279
|
-
|
|
279
|
+
QkdK6zh16vDLhDaCCkHdYOvIw+XgvQ0vqz/xIAJJN6E=
|
|
280
280
|
</data>
|
|
281
281
|
</dict>
|
|
282
282
|
<key>Modules/RNAttachmentKit.swiftmodule/arm64-apple-ios-simulator.swiftinterface</key>
|
|
283
283
|
<dict>
|
|
284
284
|
<key>hash2</key>
|
|
285
285
|
<data>
|
|
286
|
-
|
|
286
|
+
RX253JxJd5m5f5B7GitqxHUHfizHOfq8tSMHXN75o34=
|
|
287
287
|
</data>
|
|
288
288
|
</dict>
|
|
289
289
|
<key>Modules/RNAttachmentKit.swiftmodule/arm64-apple-ios-simulator.swiftmodule</key>
|
|
290
290
|
<dict>
|
|
291
291
|
<key>hash2</key>
|
|
292
292
|
<data>
|
|
293
|
-
|
|
293
|
+
L2ZN1byGvwKOQa7qpgo/X4J+IbA2ZcksQowMoSI56W8=
|
|
294
294
|
</data>
|
|
295
295
|
</dict>
|
|
296
296
|
<key>Modules/RNAttachmentKit.swiftmodule/x86_64-apple-ios-simulator.abi.json</key>
|
|
297
297
|
<dict>
|
|
298
298
|
<key>hash2</key>
|
|
299
299
|
<data>
|
|
300
|
-
|
|
300
|
+
nfoRXkCuOnu5U1wnp4zqqmGx+leb8bfClaFr07ayxcM=
|
|
301
301
|
</data>
|
|
302
302
|
</dict>
|
|
303
303
|
<key>Modules/RNAttachmentKit.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface</key>
|
|
304
304
|
<dict>
|
|
305
305
|
<key>hash2</key>
|
|
306
306
|
<data>
|
|
307
|
-
|
|
307
|
+
nN80xaeGzDuus0TMWI42dZac58SSKKddo1k17wucRI8=
|
|
308
308
|
</data>
|
|
309
309
|
</dict>
|
|
310
310
|
<key>Modules/RNAttachmentKit.swiftmodule/x86_64-apple-ios-simulator.swiftdoc</key>
|
|
311
311
|
<dict>
|
|
312
312
|
<key>hash2</key>
|
|
313
313
|
<data>
|
|
314
|
-
|
|
314
|
+
vW/Wi94uUAPETo9uOKMafYZ0H7dtvllPw4YAciVQQ+4=
|
|
315
315
|
</data>
|
|
316
316
|
</dict>
|
|
317
317
|
<key>Modules/RNAttachmentKit.swiftmodule/x86_64-apple-ios-simulator.swiftinterface</key>
|
|
318
318
|
<dict>
|
|
319
319
|
<key>hash2</key>
|
|
320
320
|
<data>
|
|
321
|
-
|
|
321
|
+
nN80xaeGzDuus0TMWI42dZac58SSKKddo1k17wucRI8=
|
|
322
322
|
</data>
|
|
323
323
|
</dict>
|
|
324
324
|
<key>Modules/RNAttachmentKit.swiftmodule/x86_64-apple-ios-simulator.swiftmodule</key>
|
|
325
325
|
<dict>
|
|
326
326
|
<key>hash2</key>
|
|
327
327
|
<data>
|
|
328
|
-
|
|
328
|
+
xhODjv643cw/fI3FfNPDvnNvOquUgzEOleuZBFaSRuE=
|
|
329
329
|
</data>
|
|
330
330
|
</dict>
|
|
331
331
|
<key>Modules/module.modulemap</key>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-attachment-kit",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "Native attachment kit for React Native — gallery picker, editor, image viewer and media gallery (Turbo Module)",
|
|
5
5
|
"main": "src/index.ts",
|
|
6
6
|
"types": "src/index.ts",
|
package/src/index.ts
CHANGED
|
@@ -89,7 +89,7 @@ let _editorOpen = false
|
|
|
89
89
|
let _asyncImgProcessedSub: { remove: () => void } | null = null
|
|
90
90
|
|
|
91
91
|
export type { AIConfig, AIUsageEvent, AIChargeRequiredEvent } from "./types"
|
|
92
|
-
export type { VideoOptions, VideoProgressEvent, ViewerVideo, ProcessingStartEvent, ProcessingStartItem, ThumbnailOptions } from "./types"
|
|
92
|
+
export type { VideoOptions, VideoProgressEvent, ViewerVideo, ProcessingStartEvent, ProcessingStartItem, ThumbnailOptions, SourceRect, SourceClipInsets, ViewerSourceUpdate } from "./types"
|
|
93
93
|
export type { SelectionChangeEvent, Appearance, AttachLocationResult, MapViewerOptions, ReverseGeocodeOptions, ReverseGeocodeResult, ReverseGeocodeErrorCode, AttachFileResult, AttachFileFailure, LocationThumbnailOptions, LocationThumbnailResult } from "./types"
|
|
94
94
|
export type { MediaGalleryItem, MediaGalleryOptions, MediaGalleryGridSize, MediaGalleryGridSizeChangedEvent, MediaGalleryTheme, MediaGalleryViewerOptions, MediaGalleryDeleteOption, MediaGalleryItemDeletedEvent, MediaGalleryNeedPageEvent, MediaGalleryClosedEvent, MediaGalleryAppendPayload, MediaGalleryRemovePayload } from "./types"
|
|
95
95
|
|
|
@@ -102,7 +102,8 @@ export interface RNAttachmentKit {
|
|
|
102
102
|
openGallery(options?: GalleryOptions): Promise<ImageResult[]>
|
|
103
103
|
openEditor(options: EditorOptions): Promise<ImageResult>
|
|
104
104
|
openViewer(options: ViewerOptions): Promise<void>
|
|
105
|
-
|
|
105
|
+
/** 닫힐 때 돌아갈 자리 (페이지를 넘겼을 때). sourceClipRect·sourceClipInsets 도 함께 바꿀 수 있음 */
|
|
106
|
+
updateSourceRect(rect: import("./types").ViewerSourceUpdate): Promise<void>
|
|
106
107
|
/** 지도 뷰어. 닫히면 resolve */
|
|
107
108
|
openMapViewer(options: import("./types").MapViewerOptions): Promise<void>
|
|
108
109
|
/** 지도 뷰어가 열린 동안 말풍선 위치가 바뀌었을 때 (닫힐 때 돌아갈 자리) */
|
|
@@ -426,7 +427,7 @@ const AttachmentKit: RNAttachmentKit = {
|
|
|
426
427
|
// 정상적으로 열렸으면 리스너는 onViewerWillClose 콜백 안에서 제거됨
|
|
427
428
|
},
|
|
428
429
|
|
|
429
|
-
updateSourceRect: async (rect: import("./types").
|
|
430
|
+
updateSourceRect: async (rect: import("./types").ViewerSourceUpdate): Promise<void> => {
|
|
430
431
|
if (!RNAttachmentKitModule) {
|
|
431
432
|
throw new Error(LINKING_ERROR)
|
|
432
433
|
}
|
package/src/types.ts
CHANGED
|
@@ -143,6 +143,26 @@ export interface SourceRect {
|
|
|
143
143
|
height: number
|
|
144
144
|
}
|
|
145
145
|
|
|
146
|
+
/**
|
|
147
|
+
* 열림·닫힘(zoom) 중 움직이는 사진과 원래 자리 가림 판(hideSourceImage)이 보이는 영역의 화면 가장자리 여백.
|
|
148
|
+
* 앱의 위·아래 반투명 바 높이를 주면, 바 밑에 걸친 사진이 바 "뒤로" 들어가는 것처럼 바 밖에서만 보입니다.
|
|
149
|
+
* 빠진 값은 0. 단위·기준은 sourceRect 와 같음 (dp, 화면 기준)
|
|
150
|
+
*/
|
|
151
|
+
export interface SourceClipInsets {
|
|
152
|
+
top?: number
|
|
153
|
+
bottom?: number
|
|
154
|
+
left?: number
|
|
155
|
+
right?: number
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/** updateSourceRect 인자 — 닫힐 때 돌아갈 자리. 잘라내기 키는 넘긴 것만 바뀜 (null = 자르지 않음) */
|
|
159
|
+
export interface ViewerSourceUpdate extends SourceRect {
|
|
160
|
+
sourceBorderRadius?: number
|
|
161
|
+
sourceBorderCorners?: ('topLeft' | 'topRight' | 'bottomLeft' | 'bottomRight')[]
|
|
162
|
+
sourceClipRect?: SourceRect | null
|
|
163
|
+
sourceClipInsets?: SourceClipInsets | null
|
|
164
|
+
}
|
|
165
|
+
|
|
146
166
|
export interface GalleryOptions {
|
|
147
167
|
maxSelection?: number
|
|
148
168
|
maxWidth?: number // 최대 width
|
|
@@ -443,6 +463,14 @@ export interface ViewerOptions {
|
|
|
443
463
|
sourceBackgroundColor?: string
|
|
444
464
|
sourceBorderCorners?: ('topLeft' | 'topRight' | 'bottomLeft' | 'bottomRight')[]
|
|
445
465
|
hideSourceImage?: boolean
|
|
466
|
+
/**
|
|
467
|
+
* 잘라내기 영역 (zoom 전용). 열림·닫힘 중 움직이는 사진과 hideSourceImage 가림 판이 이 사각형 안에서만 그려집니다.
|
|
468
|
+
* sourceRect 와 같은 화면 좌표. 사진이 화면을 다 채우는 쪽으로 갈수록 잘림이 풀려, 뷰어 본체는 잘리지 않습니다.
|
|
469
|
+
* sourceClipInsets 와 같이 주면 둘의 교집합. 생략 = 자르지 않음 (예전과 같음). updateSourceRect 로 바꿀 수 있음.
|
|
470
|
+
*/
|
|
471
|
+
sourceClipRect?: SourceRect
|
|
472
|
+
/** 잘라내기를 화면 가장자리 여백으로 (예: { top: 상단 바 높이, bottom: 탭 바 높이 }). 설명은 sourceClipRect 참조 */
|
|
473
|
+
sourceClipInsets?: SourceClipInsets
|
|
446
474
|
onPageSelected?: (index: number) => void
|
|
447
475
|
onViewerWillClose?: () => void
|
|
448
476
|
/**
|