react-native-attachment-kit 1.0.8 → 1.0.9

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 (31) hide show
  1. package/README.md +40 -2
  2. package/android/CMakeLists.txt +3 -0
  3. package/android/build.gradle +11 -2
  4. package/android/src/main/libs/rnattachmentkit-release.aar +0 -0
  5. package/android/src/newarch/java/com/rnattachmentkit/RNAttachmentKitModule.kt +48 -2
  6. package/android/src/oldarch/java/com/rnattachmentkit/RNAttachmentKitModule.kt +48 -2
  7. package/ios/RNAttachmentKit.swift +133 -4
  8. package/ios/RNAttachmentKit.xcframework/Info.plist +5 -5
  9. package/ios/RNAttachmentKit.xcframework/ios-arm64/RNAttachmentKit.framework/Assets.car +0 -0
  10. package/ios/RNAttachmentKit.xcframework/ios-arm64/RNAttachmentKit.framework/Modules/RNAttachmentKit.swiftmodule/arm64-apple-ios.abi.json +727 -415
  11. package/ios/RNAttachmentKit.xcframework/ios-arm64/RNAttachmentKit.framework/Modules/RNAttachmentKit.swiftmodule/arm64-apple-ios.private.swiftinterface +12 -1
  12. package/ios/RNAttachmentKit.xcframework/ios-arm64/RNAttachmentKit.framework/Modules/RNAttachmentKit.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
  13. package/ios/RNAttachmentKit.xcframework/ios-arm64/RNAttachmentKit.framework/Modules/RNAttachmentKit.swiftmodule/arm64-apple-ios.swiftinterface +12 -1
  14. package/ios/RNAttachmentKit.xcframework/ios-arm64/RNAttachmentKit.framework/RNAttachmentKit +0 -0
  15. package/ios/RNAttachmentKit.xcframework/ios-arm64/RNAttachmentKit.framework/_CodeSignature/CodeDirectory +0 -0
  16. package/ios/RNAttachmentKit.xcframework/ios-arm64/RNAttachmentKit.framework/_CodeSignature/CodeResources +12 -12
  17. package/ios/RNAttachmentKit.xcframework/ios-arm64/RNAttachmentKit.framework/_CodeSignature/CodeSignature +0 -0
  18. package/ios/RNAttachmentKit.xcframework/ios-arm64_x86_64-simulator/RNAttachmentKit.framework/Modules/RNAttachmentKit.swiftmodule/arm64-apple-ios-simulator.abi.json +727 -415
  19. package/ios/RNAttachmentKit.xcframework/ios-arm64_x86_64-simulator/RNAttachmentKit.framework/Modules/RNAttachmentKit.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +12 -1
  20. package/ios/RNAttachmentKit.xcframework/ios-arm64_x86_64-simulator/RNAttachmentKit.framework/Modules/RNAttachmentKit.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
  21. package/ios/RNAttachmentKit.xcframework/ios-arm64_x86_64-simulator/RNAttachmentKit.framework/Modules/RNAttachmentKit.swiftmodule/arm64-apple-ios-simulator.swiftinterface +12 -1
  22. package/ios/RNAttachmentKit.xcframework/ios-arm64_x86_64-simulator/RNAttachmentKit.framework/Modules/RNAttachmentKit.swiftmodule/x86_64-apple-ios-simulator.abi.json +727 -415
  23. package/ios/RNAttachmentKit.xcframework/ios-arm64_x86_64-simulator/RNAttachmentKit.framework/Modules/RNAttachmentKit.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +12 -1
  24. package/ios/RNAttachmentKit.xcframework/ios-arm64_x86_64-simulator/RNAttachmentKit.framework/Modules/RNAttachmentKit.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
  25. package/ios/RNAttachmentKit.xcframework/ios-arm64_x86_64-simulator/RNAttachmentKit.framework/Modules/RNAttachmentKit.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +12 -1
  26. package/ios/RNAttachmentKit.xcframework/ios-arm64_x86_64-simulator/RNAttachmentKit.framework/RNAttachmentKit +0 -0
  27. package/ios/RNAttachmentKit.xcframework/ios-arm64_x86_64-simulator/RNAttachmentKit.framework/_CodeSignature/CodeDirectory +0 -0
  28. package/ios/RNAttachmentKit.xcframework/ios-arm64_x86_64-simulator/RNAttachmentKit.framework/_CodeSignature/CodeResources +20 -20
  29. package/package.json +1 -1
  30. package/src/index.ts +1 -1
  31. package/src/types.ts +34 -1
@@ -47,9 +47,13 @@ import _SwiftConcurrencyShims
47
47
  }
48
48
  @_Concurrency.MainActor @preconcurrency public var onLocationSelected: ((RNAttachmentKit.AttachLocationResult) -> Swift.Void)?
49
49
  @_Concurrency.MainActor @preconcurrency public var capturesLocationImage: Swift.Bool
50
- @_Concurrency.MainActor @preconcurrency public var mediaType: Swift.String
50
+ @_Concurrency.MainActor @preconcurrency public var mediaType: Swift.String {
51
+ get
52
+ set
53
+ }
51
54
  @_Concurrency.MainActor @preconcurrency public var maxVideoDurationSec: Swift.Double
52
55
  @_Concurrency.MainActor @preconcurrency public var videoExportOptions: RNAttachmentKit.VideoExportOptions
56
+ @_Concurrency.MainActor @preconcurrency public var videoLockedByLicense: Swift.Bool
53
57
  @_Concurrency.MainActor @preconcurrency public func releaseAfterReturn(discardPreparedVideos: Swift.Bool = true)
54
58
  @_Concurrency.MainActor @preconcurrency public var onFilesSelected: (([RNAttachmentKit.AttachFileResult]) -> Swift.Void)?
55
59
  @_Concurrency.MainActor @preconcurrency public var onFilesSelectedWithFailures: (([RNAttachmentKit.AttachFileResult], [RNAttachmentKit.AttachFileFailure]) -> Swift.Void)?
@@ -392,6 +396,13 @@ extension RNAttachmentKit.GalleryBaseViewController : UIKit.UIAdaptivePresentati
392
396
  public func isValidLicense() -> Swift.Bool
393
397
  @objc deinit
394
398
  }
399
+ public enum LicenseGate {
400
+ public static var isLicensed: Swift.Bool {
401
+ get
402
+ }
403
+ public static let errorCode: Swift.String
404
+ public static let errorMessage: Swift.String
405
+ }
395
406
  @_hasMissingDesignatedInitializers public class ViewerImageCache {
396
407
  public static let shared: RNAttachmentKit.ViewerImageCache
397
408
  public func hasCache(for url: Swift.String) -> Swift.Bool
@@ -47,9 +47,13 @@ import _SwiftConcurrencyShims
47
47
  }
48
48
  @_Concurrency.MainActor @preconcurrency public var onLocationSelected: ((RNAttachmentKit.AttachLocationResult) -> Swift.Void)?
49
49
  @_Concurrency.MainActor @preconcurrency public var capturesLocationImage: Swift.Bool
50
- @_Concurrency.MainActor @preconcurrency public var mediaType: Swift.String
50
+ @_Concurrency.MainActor @preconcurrency public var mediaType: Swift.String {
51
+ get
52
+ set
53
+ }
51
54
  @_Concurrency.MainActor @preconcurrency public var maxVideoDurationSec: Swift.Double
52
55
  @_Concurrency.MainActor @preconcurrency public var videoExportOptions: RNAttachmentKit.VideoExportOptions
56
+ @_Concurrency.MainActor @preconcurrency public var videoLockedByLicense: Swift.Bool
53
57
  @_Concurrency.MainActor @preconcurrency public func releaseAfterReturn(discardPreparedVideos: Swift.Bool = true)
54
58
  @_Concurrency.MainActor @preconcurrency public var onFilesSelected: (([RNAttachmentKit.AttachFileResult]) -> Swift.Void)?
55
59
  @_Concurrency.MainActor @preconcurrency public var onFilesSelectedWithFailures: (([RNAttachmentKit.AttachFileResult], [RNAttachmentKit.AttachFileFailure]) -> Swift.Void)?
@@ -392,6 +396,13 @@ extension RNAttachmentKit.GalleryBaseViewController : UIKit.UIAdaptivePresentati
392
396
  public func isValidLicense() -> Swift.Bool
393
397
  @objc deinit
394
398
  }
399
+ public enum LicenseGate {
400
+ public static var isLicensed: Swift.Bool {
401
+ get
402
+ }
403
+ public static let errorCode: Swift.String
404
+ public static let errorMessage: Swift.String
405
+ }
395
406
  @_hasMissingDesignatedInitializers public class ViewerImageCache {
396
407
  public static let shared: RNAttachmentKit.ViewerImageCache
397
408
  public func hasCache(for url: Swift.String) -> Swift.Bool
@@ -30,43 +30,43 @@
30
30
  </data>
31
31
  <key>Modules/RNAttachmentKit.swiftmodule/arm64-apple-ios-simulator.abi.json</key>
32
32
  <data>
33
- FC2zf1jZnueKAakmwRvTrB9xiFk=
33
+ 6dc4XjLkWL0ClhS91W2Jf/VW3ig=
34
34
  </data>
35
35
  <key>Modules/RNAttachmentKit.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface</key>
36
36
  <data>
37
- QViRQdPRlGSnejc+FkklUFb1xzo=
37
+ g6l2enKv1dyh0eRboORWKiGWCbA=
38
38
  </data>
39
39
  <key>Modules/RNAttachmentKit.swiftmodule/arm64-apple-ios-simulator.swiftdoc</key>
40
40
  <data>
41
- 13waPrbWcS1Vv7tMDqh9IORrbTU=
41
+ RcRMpG6AedlReIVIQJtTD1nwUAI=
42
42
  </data>
43
43
  <key>Modules/RNAttachmentKit.swiftmodule/arm64-apple-ios-simulator.swiftinterface</key>
44
44
  <data>
45
- QViRQdPRlGSnejc+FkklUFb1xzo=
45
+ g6l2enKv1dyh0eRboORWKiGWCbA=
46
46
  </data>
47
47
  <key>Modules/RNAttachmentKit.swiftmodule/arm64-apple-ios-simulator.swiftmodule</key>
48
48
  <data>
49
- vxYcaOMhuUnqhRHLBIJ08g7Poz8=
49
+ xBHmXARzqcVNqo9R0WPLaNAzhPU=
50
50
  </data>
51
51
  <key>Modules/RNAttachmentKit.swiftmodule/x86_64-apple-ios-simulator.abi.json</key>
52
52
  <data>
53
- FC2zf1jZnueKAakmwRvTrB9xiFk=
53
+ 6dc4XjLkWL0ClhS91W2Jf/VW3ig=
54
54
  </data>
55
55
  <key>Modules/RNAttachmentKit.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface</key>
56
56
  <data>
57
- 4Bhyu9pqG8QPG8JDzN15Es69LgQ=
57
+ ccv5FkQs1uALtMkn1aAVPz7RDQY=
58
58
  </data>
59
59
  <key>Modules/RNAttachmentKit.swiftmodule/x86_64-apple-ios-simulator.swiftdoc</key>
60
60
  <data>
61
- 9aHuRlxlcUm5c6hoS03l0x+rd+8=
61
+ vlvCOCbXyBLLMiP76IKT8kfD26Q=
62
62
  </data>
63
63
  <key>Modules/RNAttachmentKit.swiftmodule/x86_64-apple-ios-simulator.swiftinterface</key>
64
64
  <data>
65
- 4Bhyu9pqG8QPG8JDzN15Es69LgQ=
65
+ ccv5FkQs1uALtMkn1aAVPz7RDQY=
66
66
  </data>
67
67
  <key>Modules/RNAttachmentKit.swiftmodule/x86_64-apple-ios-simulator.swiftmodule</key>
68
68
  <data>
69
- H6BZLJRWSEbtZxoVbtor+kQqH4A=
69
+ C6hzj5gW3JGMV6YMKfnUNSZMIEE=
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
- qtO0CZnvzwP16BEJ2c8k4epzursuYOewuXDMvEuLD3k=
265
+ VTpr+TZHL7suP3tjZKPTbnZm4lZmTCWITiryUcI2TWE=
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
- bQBBzPNGBXPENE5stiQHn43HpKljGLBGsmytx74osv8=
272
+ WIkxYcgviEiCv2V7reTEHcQWPYUrg7k4pB/Q0oPG8MM=
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
- c5sCwczWvgTgfE4P3/QZXLg4Ju1YyiBkHe8mlkacRzs=
279
+ u68u0TTXRiB7oN8Jflrsps4kN5OEwVMupe6IUvH5eqw=
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
- bQBBzPNGBXPENE5stiQHn43HpKljGLBGsmytx74osv8=
286
+ WIkxYcgviEiCv2V7reTEHcQWPYUrg7k4pB/Q0oPG8MM=
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
- QYe4TAel3zohjG3Va4rjTXrpDxq7B321XftFkE+yV08=
293
+ bHUr/RM1QTZI8Kl3YPtQZ6cMtdADw7o6WVYX2ctpol4=
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
- qtO0CZnvzwP16BEJ2c8k4epzursuYOewuXDMvEuLD3k=
300
+ VTpr+TZHL7suP3tjZKPTbnZm4lZmTCWITiryUcI2TWE=
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
- ruMrsqQu7c5vBjEKp/hzHz82QST/UnwbWCTHD3uGgqM=
307
+ T9KyR08gS5Z4BdPO2QfnPYc4eEElG5ORNTLnzGejUV8=
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
- l+6rzGzrcNz6C1xQixmxJnTj6bp8QFLvi01FhSTniOA=
314
+ tLXcpDVSmYhV7qW8r+mkKTlxqC3+Jqzs6w5ZS5/k+Q8=
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
- ruMrsqQu7c5vBjEKp/hzHz82QST/UnwbWCTHD3uGgqM=
321
+ T9KyR08gS5Z4BdPO2QfnPYc4eEElG5ORNTLnzGejUV8=
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
- ThGXvJl+h56CfaVaUxPIvX289ZySMuF5rCfa478xQRo=
328
+ ZBW3iERs/YIP6AumkOEFEI0Xo9tDoxmOrBAJP0rCUaQ=
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.0.8",
3
+ "version": "1.0.9",
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 } from "./types"
92
+ export type { VideoOptions, VideoProgressEvent, ViewerVideo, ProcessingStartEvent, ProcessingStartItem, ThumbnailOptions } 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
 
package/src/types.ts CHANGED
@@ -24,10 +24,15 @@ export interface ImageResult {
24
24
  mediaType?: "image" | "video"
25
25
  /** 동영상: 길이(초, 소수) */
26
26
  duration?: number
27
- /** 동영상: 포스터 썸네일 file:// (video.posterFormat 형식 — 기본 webp, 긴 변 512) */
27
+ /**
28
+ * 사진: thumbnail 옵션을 줬을 때 썸네일 file:// (uri 와 같은 결과 사진에서 만듦 — 방향·크롭·그리기 반영, EXIF 없음).
29
+ * 동영상: 포스터 썸네일 (video.posterFormat 형식 — 기본 webp, 긴 변 512. thumbnail 옵션과 무관)
30
+ */
28
31
  thumbnailUri?: string
29
32
  thumbnailWidth?: number
30
33
  thumbnailHeight?: number
34
+ /** 사진 썸네일 파일 크기 (bytes) — thumbnail 옵션을 줬을 때만 */
35
+ thumbnailFileSize?: number
31
36
  /** 동영상: 전송본 코덱·평균 비트레이트(bps) */
32
37
  videoCodec?: "h264" | "hevc" | string
33
38
  videoBitrate?: number
@@ -70,6 +75,27 @@ export interface ProcessingStartItem {
70
75
  thumbnailHeight?: number
71
76
  }
72
77
 
78
+ /**
79
+ * 사진 썸네일 옵션 (GalleryOptions.thumbnail / EditorOptions.thumbnail).
80
+ * 결과 사진(uri)을 만든 같은 이미지에서 만들어 ImageResult.thumbnailUri/Width/Height/FileSize 로 돌려줍니다 (onImageProcessed 에도).
81
+ */
82
+ export interface ThumbnailOptions {
83
+ /** 썸네일 최대 가로(px). mode "cover" 면 결과 가로가 정확히 이 값 (원본이 더 작으면 확대하지 않음) */
84
+ maxWidth: number
85
+ /** 썸네일 최대 세로(px). 생략하면 maxWidth 와 같음 */
86
+ maxHeight?: number
87
+ /**
88
+ * "fit"(기본): 원본 비율 유지, maxWidth×maxHeight 상자 안에 맞춤 (예: 모먼트 목록)
89
+ * "cover": 상자를 꽉 채우고 넘치는 부분은 가운데 기준으로 잘라냄 → 결과가 정확히 maxWidth×maxHeight (예: 프로필 아바타).
90
+ * 원본이 상자보다 작으면 확대하지 않고 상자 비율로 가운데만 자름 (100×80 사진 + 200×200 → 80×80)
91
+ */
92
+ mode?: "fit" | "cover"
93
+ /** 0~1, 기본 0.8 */
94
+ quality?: number
95
+ /** 기본 "webp". webp 인코딩이 안 되는 드문 경우 jpg 로 대신 (확장자는 thumbnailUri 로 확인) */
96
+ format?: "webp" | "jpg"
97
+ }
98
+
73
99
  /** 동영상 옵션 (GalleryOptions.video). mediaType 이 "video"/"all" 일 때만 의미 */
74
100
  export interface VideoOptions {
75
101
  /** 고를 수 있는 최대 길이(초). 기본 600 (10분). 넘는 동영상은 누르면 안내만. 0 = 제한 없음 */
@@ -125,6 +151,11 @@ export interface GalleryOptions {
125
151
  mediaType?: "photo" | "video" | "all"
126
152
  /** 동영상 옵션 (mediaType 이 video/all 일 때) */
127
153
  video?: VideoOptions
154
+ /**
155
+ * 사진 썸네일도 함께 만들기. 생략하면 지금처럼 사진 썸네일 없음.
156
+ * 동영상 포스터는 이 옵션과 무관하게 기존 규칙 그대로 (video.posterFormat, 긴 변 512)
157
+ */
158
+ thumbnail?: ThumbnailOptions
128
159
  quality?: number
129
160
  allItemsText?: string
130
161
  selectedItemsText?: string
@@ -506,6 +537,8 @@ export interface EditorOptions {
506
537
  appearance?: Appearance
507
538
  maxWidth?: number // 최대 width
508
539
  maxHeight?: number // 최대 height
540
+ /** 편집 결과 사진의 썸네일도 함께 만들기 (크롭·그리기 반영된 결과 기준) */
541
+ thumbnail?: ThumbnailOptions
509
542
  openDuration?: number
510
543
  closeDuration?: number
511
544
  }