react-native-attachment-kit 1.1.0 → 1.1.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 (30) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/README.md +5 -2
  3. package/android/src/main/libs/rnattachmentkit-release.aar +0 -0
  4. package/android/src/newarch/java/com/rnattachmentkit/RNAttachmentKitModule.kt +31 -0
  5. package/android/src/oldarch/java/com/rnattachmentkit/RNAttachmentKitModule.kt +31 -0
  6. package/ios/RNAttachmentKit.swift +37 -0
  7. package/ios/RNAttachmentKit.xcframework/Info.plist +5 -5
  8. package/ios/RNAttachmentKit.xcframework/ios-arm64/RNAttachmentKit.framework/Assets.car +0 -0
  9. package/ios/RNAttachmentKit.xcframework/ios-arm64/RNAttachmentKit.framework/Modules/RNAttachmentKit.swiftmodule/arm64-apple-ios.abi.json +436 -45
  10. package/ios/RNAttachmentKit.xcframework/ios-arm64/RNAttachmentKit.framework/Modules/RNAttachmentKit.swiftmodule/arm64-apple-ios.private.swiftinterface +5 -0
  11. package/ios/RNAttachmentKit.xcframework/ios-arm64/RNAttachmentKit.framework/Modules/RNAttachmentKit.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
  12. package/ios/RNAttachmentKit.xcframework/ios-arm64/RNAttachmentKit.framework/Modules/RNAttachmentKit.swiftmodule/arm64-apple-ios.swiftinterface +5 -0
  13. package/ios/RNAttachmentKit.xcframework/ios-arm64/RNAttachmentKit.framework/RNAttachmentKit +0 -0
  14. package/ios/RNAttachmentKit.xcframework/ios-arm64/RNAttachmentKit.framework/_CodeSignature/CodeDirectory +0 -0
  15. package/ios/RNAttachmentKit.xcframework/ios-arm64/RNAttachmentKit.framework/_CodeSignature/CodeResources +12 -12
  16. package/ios/RNAttachmentKit.xcframework/ios-arm64/RNAttachmentKit.framework/_CodeSignature/CodeSignature +0 -0
  17. package/ios/RNAttachmentKit.xcframework/ios-arm64_x86_64-simulator/RNAttachmentKit.framework/Modules/RNAttachmentKit.swiftmodule/arm64-apple-ios-simulator.abi.json +436 -45
  18. package/ios/RNAttachmentKit.xcframework/ios-arm64_x86_64-simulator/RNAttachmentKit.framework/Modules/RNAttachmentKit.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +5 -0
  19. package/ios/RNAttachmentKit.xcframework/ios-arm64_x86_64-simulator/RNAttachmentKit.framework/Modules/RNAttachmentKit.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
  20. package/ios/RNAttachmentKit.xcframework/ios-arm64_x86_64-simulator/RNAttachmentKit.framework/Modules/RNAttachmentKit.swiftmodule/arm64-apple-ios-simulator.swiftinterface +5 -0
  21. package/ios/RNAttachmentKit.xcframework/ios-arm64_x86_64-simulator/RNAttachmentKit.framework/Modules/RNAttachmentKit.swiftmodule/x86_64-apple-ios-simulator.abi.json +436 -45
  22. package/ios/RNAttachmentKit.xcframework/ios-arm64_x86_64-simulator/RNAttachmentKit.framework/Modules/RNAttachmentKit.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +5 -0
  23. package/ios/RNAttachmentKit.xcframework/ios-arm64_x86_64-simulator/RNAttachmentKit.framework/Modules/RNAttachmentKit.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
  24. package/ios/RNAttachmentKit.xcframework/ios-arm64_x86_64-simulator/RNAttachmentKit.framework/Modules/RNAttachmentKit.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +5 -0
  25. package/ios/RNAttachmentKit.xcframework/ios-arm64_x86_64-simulator/RNAttachmentKit.framework/RNAttachmentKit +0 -0
  26. package/ios/RNAttachmentKit.xcframework/ios-arm64_x86_64-simulator/RNAttachmentKit.framework/_CodeSignature/CodeDirectory +0 -0
  27. package/ios/RNAttachmentKit.xcframework/ios-arm64_x86_64-simulator/RNAttachmentKit.framework/_CodeSignature/CodeResources +20 -20
  28. package/package.json +1 -1
  29. package/src/index.ts +4 -3
  30. package/src/types.ts +37 -0
@@ -700,6 +700,11 @@ extension RNAttachmentKit.MediaGalleryViewController : UIKit.UICollectionViewDat
700
700
  @_Concurrency.MainActor @preconcurrency public var sourceBorderCorners: QuartzCore.CACornerMask
701
701
  @_Concurrency.MainActor @preconcurrency public var sourceBackgroundColor: UIKit.UIColor
702
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?
706
+ @_Concurrency.MainActor @preconcurrency weak public var underView: UIKit.UIView?
707
+ @_Concurrency.MainActor @preconcurrency public func removeUnderLayer()
703
708
  @_Concurrency.MainActor @preconcurrency public func updateMaskView()
704
709
  @_Concurrency.MainActor @preconcurrency public var openDuration: Swift.Double
705
710
  @_Concurrency.MainActor @preconcurrency public var closeDuration: Swift.Double
@@ -700,6 +700,11 @@ extension RNAttachmentKit.MediaGalleryViewController : UIKit.UICollectionViewDat
700
700
  @_Concurrency.MainActor @preconcurrency public var sourceBorderCorners: QuartzCore.CACornerMask
701
701
  @_Concurrency.MainActor @preconcurrency public var sourceBackgroundColor: UIKit.UIColor
702
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?
706
+ @_Concurrency.MainActor @preconcurrency weak public var underView: UIKit.UIView?
707
+ @_Concurrency.MainActor @preconcurrency public func removeUnderLayer()
703
708
  @_Concurrency.MainActor @preconcurrency public func updateMaskView()
704
709
  @_Concurrency.MainActor @preconcurrency public var openDuration: Swift.Double
705
710
  @_Concurrency.MainActor @preconcurrency public var closeDuration: Swift.Double
@@ -30,43 +30,43 @@
30
30
  </data>
31
31
  <key>Modules/RNAttachmentKit.swiftmodule/arm64-apple-ios-simulator.abi.json</key>
32
32
  <data>
33
- Wd9Z1q7s0pyKrUFIRm36hxiumxA=
33
+ mHgBXSRar3by2sly8QkYcG6C3UU=
34
34
  </data>
35
35
  <key>Modules/RNAttachmentKit.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface</key>
36
36
  <data>
37
- RmzaHDbzfZw30UT/xvDXKezD9aw=
37
+ 48bN+CmMmI2fYY7cip2dEc3a1Hk=
38
38
  </data>
39
39
  <key>Modules/RNAttachmentKit.swiftmodule/arm64-apple-ios-simulator.swiftdoc</key>
40
40
  <data>
41
- gwOkWoxLQLhZ4dp7hfZ3GKGruzU=
41
+ fkzCLPjLTpoPLvuP7U4zaR7oFNw=
42
42
  </data>
43
43
  <key>Modules/RNAttachmentKit.swiftmodule/arm64-apple-ios-simulator.swiftinterface</key>
44
44
  <data>
45
- RmzaHDbzfZw30UT/xvDXKezD9aw=
45
+ 48bN+CmMmI2fYY7cip2dEc3a1Hk=
46
46
  </data>
47
47
  <key>Modules/RNAttachmentKit.swiftmodule/arm64-apple-ios-simulator.swiftmodule</key>
48
48
  <data>
49
- iX7xA5GDC3xEamXDBC6jbjfOnBs=
49
+ 2uVysiM0Im1jxTaeChoidRvnOWI=
50
50
  </data>
51
51
  <key>Modules/RNAttachmentKit.swiftmodule/x86_64-apple-ios-simulator.abi.json</key>
52
52
  <data>
53
- Wd9Z1q7s0pyKrUFIRm36hxiumxA=
53
+ mHgBXSRar3by2sly8QkYcG6C3UU=
54
54
  </data>
55
55
  <key>Modules/RNAttachmentKit.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface</key>
56
56
  <data>
57
- LhFJOtX6SOU+FfAuYThVqC8SSqs=
57
+ oWhA5PRZoNYFRGImJ63eYJr7f4k=
58
58
  </data>
59
59
  <key>Modules/RNAttachmentKit.swiftmodule/x86_64-apple-ios-simulator.swiftdoc</key>
60
60
  <data>
61
- /LtCn1/VvpPM26soJ2eLsk8Z9x4=
61
+ hA3QQl7XlEdD/dLJvtloBIYPppw=
62
62
  </data>
63
63
  <key>Modules/RNAttachmentKit.swiftmodule/x86_64-apple-ios-simulator.swiftinterface</key>
64
64
  <data>
65
- LhFJOtX6SOU+FfAuYThVqC8SSqs=
65
+ oWhA5PRZoNYFRGImJ63eYJr7f4k=
66
66
  </data>
67
67
  <key>Modules/RNAttachmentKit.swiftmodule/x86_64-apple-ios-simulator.swiftmodule</key>
68
68
  <data>
69
- o4bPOSmdBiPlE67pQ/RzA/KZmZw=
69
+ 1KLGAb8IsB2H7iDi1K4E+iXZ/yg=
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
- JZpbj4lr/kHvMhEpEqktq0X3rYVYWDaZsDI1uumdO1w=
265
+ iv0FOpabpFXN5cHvliBcJFsiT0Cw+Pq9ybvnzfZCbpk=
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
- dHX+BN8X57oouOym573PRRvDJNoBAXwNa8Qq4jP4v6A=
272
+ aZ4YAPm1DpNtur5dhJWeONfZ7fglNFXFIXofhCW8eb8=
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
- UsbWPEMfgbl9bdJJPszSsyO9FdIMYATuWWbKkTOQFB0=
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
- dHX+BN8X57oouOym573PRRvDJNoBAXwNa8Qq4jP4v6A=
286
+ aZ4YAPm1DpNtur5dhJWeONfZ7fglNFXFIXofhCW8eb8=
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
- 8aY3DBjnZFzdFFPOHwLKk9vARFNG+ybA29aUpwieqvY=
293
+ B1ZtnW/xPks/lSm457umvJhXC3ZPV7BEFUTMP9aI18k=
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
- JZpbj4lr/kHvMhEpEqktq0X3rYVYWDaZsDI1uumdO1w=
300
+ iv0FOpabpFXN5cHvliBcJFsiT0Cw+Pq9ybvnzfZCbpk=
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
- 3ecyFo55Pp2aYTZviW80j+IBBNSDiCw4uZhWVPf5EbI=
307
+ NlaF0PcQyduneps06dOb7PT6UI0qYxZFpMzw8tjg2yY=
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
- V7QUlPHRJPUVIBYuvhXE636clsz5Vu4+wj+s9w3yrV0=
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
- 3ecyFo55Pp2aYTZviW80j+IBBNSDiCw4uZhWVPf5EbI=
321
+ NlaF0PcQyduneps06dOb7PT6UI0qYxZFpMzw8tjg2yY=
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
- vwXXki2l45Lv67PAsvQvKelPTtWoKEXU8sagiac80OY=
328
+ VyZGnU0wV4c9WCy/0s/x5bF3+Zp8ISI8WvkakI2A8MM=
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.1.0",
3
+ "version": "1.1.2",
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
- updateSourceRect(rect: import("./types").SourceRect): Promise<void>
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").SourceRect): Promise<void> => {
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,27 @@ 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
+ underlayViewTag?: number | null
165
+ }
166
+
146
167
  export interface GalleryOptions {
147
168
  maxSelection?: number
148
169
  maxWidth?: number // 최대 width
@@ -443,6 +464,22 @@ export interface ViewerOptions {
443
464
  sourceBackgroundColor?: string
444
465
  sourceBorderCorners?: ('topLeft' | 'topRight' | 'bottomLeft' | 'bottomRight')[]
445
466
  hideSourceImage?: boolean
467
+ /**
468
+ * 잘라내기 영역 (zoom 전용). 열림·닫힘 중 움직이는 사진과 hideSourceImage 가림 판이 이 사각형 안에서만 그려집니다.
469
+ * sourceRect 와 같은 화면 좌표. 사진이 화면을 다 채우는 쪽으로 갈수록 잘림이 풀려, 뷰어 본체는 잘리지 않습니다.
470
+ * sourceClipInsets 와 같이 주면 둘의 교집합. 생략 = 자르지 않음 (예전과 같음). updateSourceRect 로 바꿀 수 있음.
471
+ */
472
+ sourceClipRect?: SourceRect
473
+ /** 잘라내기를 화면 가장자리 여백으로 (예: { top: 상단 바 높이, bottom: 탭 바 높이 }). 설명은 sourceClipRect 참조 */
474
+ sourceClipInsets?: SourceClipInsets
475
+ /**
476
+ * 앱이 반투명 바 바로 아래 층에 둔 빈 뷰의 RN 태그(findNodeHandle). 열림·닫힘 동안 움직이는 사진과 원래 자리 가림 판의
477
+ * 사본을 이 뷰 안에 그립니다 — 바의 흐림 너머로 사진이 움직이며 바 뒤로 들어가고 나오는 게 보임
478
+ * (잘라내기만으로는 바 밑 부분이 안 보일 뿐). sourceClipRect/Insets 와 같이 씀. iOS + Android useOverlayViewer.
479
+ * 뷰 조건: 화면 크기, 자식 없음, collapsable={false}, pointerEvents="none", 리스트보다 뒤·바보다 앞 순서로 렌더.
480
+ * 자식이 있는 뷰를 넘기면 RN 의 자식 번호가 어긋나 앱이 죽을 수 있습니다.
481
+ */
482
+ underlayViewTag?: number
446
483
  onPageSelected?: (index: number) => void
447
484
  onViewerWillClose?: () => void
448
485
  /**