react-native-attachment-kit 1.0.5 โ 1.0.8
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 +18 -0
- package/README.md +100 -3
- package/android/build.gradle +14 -0
- package/android/src/main/libs/rnattachmentkit-release.aar +0 -0
- package/android/src/newarch/java/com/rnattachmentkit/RNAttachmentKitModule.kt +280 -13
- package/android/src/oldarch/java/com/rnattachmentkit/RNAttachmentKitModule.kt +282 -13
- package/ios/RNAttachmentKit.m +18 -0
- package/ios/RNAttachmentKit.swift +447 -9
- package/ios/RNAttachmentKit.xcframework/ios-arm64/RNAttachmentKit.framework/Assets.car +0 -0
- package/ios/RNAttachmentKit.xcframework/ios-arm64/RNAttachmentKit.framework/Headers/RNAttachmentKit-Swift.h +21 -5
- package/ios/RNAttachmentKit.xcframework/ios-arm64/RNAttachmentKit.framework/Info.plist +0 -0
- package/ios/RNAttachmentKit.xcframework/ios-arm64/RNAttachmentKit.framework/Modules/RNAttachmentKit.swiftmodule/arm64-apple-ios.abi.json +33440 -7566
- package/ios/RNAttachmentKit.xcframework/ios-arm64/RNAttachmentKit.framework/Modules/RNAttachmentKit.swiftmodule/arm64-apple-ios.private.swiftinterface +193 -5
- 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 +193 -5
- 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 +15 -15
- package/ios/RNAttachmentKit.xcframework/ios-arm64/RNAttachmentKit.framework/_CodeSignature/CodeSignature +0 -0
- package/ios/RNAttachmentKit.xcframework/ios-arm64_x86_64-simulator/RNAttachmentKit.framework/Assets.car +0 -0
- package/ios/RNAttachmentKit.xcframework/ios-arm64_x86_64-simulator/RNAttachmentKit.framework/Headers/RNAttachmentKit-Swift.h +42 -10
- package/ios/RNAttachmentKit.xcframework/ios-arm64_x86_64-simulator/RNAttachmentKit.framework/Info.plist +0 -0
- package/ios/RNAttachmentKit.xcframework/ios-arm64_x86_64-simulator/RNAttachmentKit.framework/Modules/RNAttachmentKit.swiftmodule/arm64-apple-ios-simulator.abi.json +33440 -7566
- package/ios/RNAttachmentKit.xcframework/ios-arm64_x86_64-simulator/RNAttachmentKit.framework/Modules/RNAttachmentKit.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +193 -5
- 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 +193 -5
- package/ios/RNAttachmentKit.xcframework/ios-arm64_x86_64-simulator/RNAttachmentKit.framework/Modules/RNAttachmentKit.swiftmodule/x86_64-apple-ios-simulator.abi.json +33440 -7566
- package/ios/RNAttachmentKit.xcframework/ios-arm64_x86_64-simulator/RNAttachmentKit.framework/Modules/RNAttachmentKit.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +193 -5
- 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 +193 -5
- 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 +25 -25
- package/package.json +2 -2
- package/react-native-attachment-kit.podspec +1 -1
- package/src/NativeAttachmentKit.ts +5 -0
- package/src/index.ts +118 -7
- package/src/types.ts +173 -0
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<dict>
|
|
7
7
|
<key>Assets.car</key>
|
|
8
8
|
<data>
|
|
9
|
-
|
|
9
|
+
MRss66st77g0KhHxCBbJQfKPil4=
|
|
10
10
|
</data>
|
|
11
11
|
<key>Base.lproj/LaunchScreen.storyboardc/01J-lp-oVM-view-Ze5-6b-2t3.nib</key>
|
|
12
12
|
<data>
|
|
@@ -22,51 +22,51 @@
|
|
|
22
22
|
</data>
|
|
23
23
|
<key>Headers/RNAttachmentKit-Swift.h</key>
|
|
24
24
|
<data>
|
|
25
|
-
|
|
25
|
+
SA2Uv/xUxXBayyyXE8H2RjgdHQA=
|
|
26
26
|
</data>
|
|
27
27
|
<key>Info.plist</key>
|
|
28
28
|
<data>
|
|
29
|
-
|
|
29
|
+
VGVHsdYWxmrpkpVKbSFeY69ecnY=
|
|
30
30
|
</data>
|
|
31
31
|
<key>Modules/RNAttachmentKit.swiftmodule/arm64-apple-ios-simulator.abi.json</key>
|
|
32
32
|
<data>
|
|
33
|
-
|
|
33
|
+
FC2zf1jZnueKAakmwRvTrB9xiFk=
|
|
34
34
|
</data>
|
|
35
35
|
<key>Modules/RNAttachmentKit.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface</key>
|
|
36
36
|
<data>
|
|
37
|
-
|
|
37
|
+
QViRQdPRlGSnejc+FkklUFb1xzo=
|
|
38
38
|
</data>
|
|
39
39
|
<key>Modules/RNAttachmentKit.swiftmodule/arm64-apple-ios-simulator.swiftdoc</key>
|
|
40
40
|
<data>
|
|
41
|
-
|
|
41
|
+
13waPrbWcS1Vv7tMDqh9IORrbTU=
|
|
42
42
|
</data>
|
|
43
43
|
<key>Modules/RNAttachmentKit.swiftmodule/arm64-apple-ios-simulator.swiftinterface</key>
|
|
44
44
|
<data>
|
|
45
|
-
|
|
45
|
+
QViRQdPRlGSnejc+FkklUFb1xzo=
|
|
46
46
|
</data>
|
|
47
47
|
<key>Modules/RNAttachmentKit.swiftmodule/arm64-apple-ios-simulator.swiftmodule</key>
|
|
48
48
|
<data>
|
|
49
|
-
|
|
49
|
+
vxYcaOMhuUnqhRHLBIJ08g7Poz8=
|
|
50
50
|
</data>
|
|
51
51
|
<key>Modules/RNAttachmentKit.swiftmodule/x86_64-apple-ios-simulator.abi.json</key>
|
|
52
52
|
<data>
|
|
53
|
-
|
|
53
|
+
FC2zf1jZnueKAakmwRvTrB9xiFk=
|
|
54
54
|
</data>
|
|
55
55
|
<key>Modules/RNAttachmentKit.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface</key>
|
|
56
56
|
<data>
|
|
57
|
-
|
|
57
|
+
4Bhyu9pqG8QPG8JDzN15Es69LgQ=
|
|
58
58
|
</data>
|
|
59
59
|
<key>Modules/RNAttachmentKit.swiftmodule/x86_64-apple-ios-simulator.swiftdoc</key>
|
|
60
60
|
<data>
|
|
61
|
-
|
|
61
|
+
9aHuRlxlcUm5c6hoS03l0x+rd+8=
|
|
62
62
|
</data>
|
|
63
63
|
<key>Modules/RNAttachmentKit.swiftmodule/x86_64-apple-ios-simulator.swiftinterface</key>
|
|
64
64
|
<data>
|
|
65
|
-
|
|
65
|
+
4Bhyu9pqG8QPG8JDzN15Es69LgQ=
|
|
66
66
|
</data>
|
|
67
67
|
<key>Modules/RNAttachmentKit.swiftmodule/x86_64-apple-ios-simulator.swiftmodule</key>
|
|
68
68
|
<data>
|
|
69
|
-
|
|
69
|
+
H6BZLJRWSEbtZxoVbtor+kQqH4A=
|
|
70
70
|
</data>
|
|
71
71
|
<key>Modules/module.modulemap</key>
|
|
72
72
|
<data>
|
|
@@ -227,7 +227,7 @@
|
|
|
227
227
|
<dict>
|
|
228
228
|
<key>hash2</key>
|
|
229
229
|
<data>
|
|
230
|
-
|
|
230
|
+
PN8SGeEYmroH8IKhC4cAPpqrFa8xoBCtF2CRXH0MgEA=
|
|
231
231
|
</data>
|
|
232
232
|
</dict>
|
|
233
233
|
<key>Base.lproj/LaunchScreen.storyboardc/01J-lp-oVM-view-Ze5-6b-2t3.nib</key>
|
|
@@ -255,77 +255,77 @@
|
|
|
255
255
|
<dict>
|
|
256
256
|
<key>hash2</key>
|
|
257
257
|
<data>
|
|
258
|
-
|
|
258
|
+
CIsiqD4QUiiFinw84KecZtVO9t4RF+3C362HoLNyZiA=
|
|
259
259
|
</data>
|
|
260
260
|
</dict>
|
|
261
261
|
<key>Modules/RNAttachmentKit.swiftmodule/arm64-apple-ios-simulator.abi.json</key>
|
|
262
262
|
<dict>
|
|
263
263
|
<key>hash2</key>
|
|
264
264
|
<data>
|
|
265
|
-
|
|
265
|
+
qtO0CZnvzwP16BEJ2c8k4epzursuYOewuXDMvEuLD3k=
|
|
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
|
+
bQBBzPNGBXPENE5stiQHn43HpKljGLBGsmytx74osv8=
|
|
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
|
+
c5sCwczWvgTgfE4P3/QZXLg4Ju1YyiBkHe8mlkacRzs=
|
|
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
|
+
bQBBzPNGBXPENE5stiQHn43HpKljGLBGsmytx74osv8=
|
|
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
|
+
QYe4TAel3zohjG3Va4rjTXrpDxq7B321XftFkE+yV08=
|
|
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
|
+
qtO0CZnvzwP16BEJ2c8k4epzursuYOewuXDMvEuLD3k=
|
|
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
|
+
ruMrsqQu7c5vBjEKp/hzHz82QST/UnwbWCTHD3uGgqM=
|
|
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
|
+
l+6rzGzrcNz6C1xQixmxJnTj6bp8QFLvi01FhSTniOA=
|
|
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
|
+
ruMrsqQu7c5vBjEKp/hzHz82QST/UnwbWCTHD3uGgqM=
|
|
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
|
+
ThGXvJl+h56CfaVaUxPIvX289ZySMuF5rCfa478xQRo=
|
|
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.
|
|
3
|
+
"version": "1.0.8",
|
|
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",
|
|
@@ -65,4 +65,4 @@
|
|
|
65
65
|
"type": "git",
|
|
66
66
|
"url": "https://github.com/Usomnia/react-native-attachment-kit.git"
|
|
67
67
|
}
|
|
68
|
-
}
|
|
68
|
+
}
|
|
@@ -26,7 +26,7 @@ Pod::Spec.new do |s|
|
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
s.vendored_frameworks = "ios/RNAttachmentKit.xcframework"
|
|
29
|
-
s.frameworks = "MapKit", "CoreLocation", "UniformTypeIdentifiers" #
|
|
29
|
+
s.frameworks = "MapKit", "CoreLocation", "UniformTypeIdentifiers", "Vision", "CryptoKit", "CoreMotion" # ์์นยทํ์ผ ํญ / AI ํธ์ง ์ฌ์ง ๋ถ์ยท์บ์ / ์นด๋ฉ๋ผ ๊ธฐ๊ธฐ ๋ฐฉํฅ
|
|
30
30
|
|
|
31
31
|
# s.dependency "SDWebImageWebPCoder"
|
|
32
32
|
|
|
@@ -7,6 +7,8 @@ export interface Spec extends TurboModule {
|
|
|
7
7
|
openEditor(options: Object): Promise<Object>;
|
|
8
8
|
openViewer(options: Object): Promise<void>;
|
|
9
9
|
closeGallery(): Promise<boolean>;
|
|
10
|
+
/** ๋์์ ๋ณํ ์ทจ์. index -1 = ๋จ์ ๋์์ ์ ๋ถ, processingId "" = ๊ฐ์ฅ ์ต๊ทผ ์ฒ๋ฆฌ */
|
|
11
|
+
cancelVideoProcessing(index: number, processingId: string): Promise<boolean>;
|
|
10
12
|
|
|
11
13
|
// RCTEventEmitter ํ์ ๊ท๊ฒฉ (Turbo Module์์ ์ด๋ฒคํธ ๋ฐฉ์ถ ์ ํ์)
|
|
12
14
|
addListener(eventName: string): void;
|
|
@@ -26,6 +28,9 @@ export interface Spec extends TurboModule {
|
|
|
26
28
|
reverseGeocode(options: Object): Promise<Object>;
|
|
27
29
|
clearReverseGeocodeCache(): Promise<void>;
|
|
28
30
|
|
|
31
|
+
// AI ๊ธฐ๋ฅ ์ค์ ยท์์ก (๋๊ธด ๊ฐ๋ง ๋ฐ๋). ์ฌ์ฉยท์ถฉ์ ์์ฒญ์ onAIUsage / onAIChargeRequired ์ด๋ฒคํธ
|
|
32
|
+
setAIConfig(config: Object): Promise<void>;
|
|
33
|
+
|
|
29
34
|
// ๋ฏธ๋์ด ๊ฐค๋ฌ๋ฆฌ (์ฌ์ง ๋ชจ์๋ณด๊ธฐ)
|
|
30
35
|
openMediaGallery(options: Object): Promise<Object>;
|
|
31
36
|
closeMediaGallery(galleryId: string): Promise<void>;
|
package/src/index.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { NativeModules, Platform, TurboModuleRegistry, NativeEventEmitter, DeviceEventEmitter } from "react-native"
|
|
2
|
-
import type { ImageResult, GalleryOptions, EditorOptions, SelectionChangeEvent, ViewerOptions, MediaGalleryOptions, MediaGalleryAppendPayload, MediaGalleryRemovePayload, Appearance } from "./types"
|
|
2
|
+
import type { ImageResult, GalleryOptions, EditorOptions, SelectionChangeEvent, ViewerOptions, MediaGalleryOptions, MediaGalleryAppendPayload, MediaGalleryRemovePayload, Appearance, AIConfig, AIUsageEvent, AIChargeRequiredEvent } from "./types"
|
|
3
3
|
|
|
4
4
|
const LINKING_ERROR = `The package 'react-native-attachment-kit' doesn't seem to be linked. Make sure: \n\n` + Platform.select({ ios: "- You have run 'pod install'\n", default: "" }) + "- You rebuilt the app after installing the package\n" + "- You are not using Expo Go\n"
|
|
5
5
|
|
|
@@ -78,6 +78,8 @@ function alreadyOpenError(what: string): Error {
|
|
|
78
78
|
* Android pickImagesPromise) ์ค๋ณต ํธ์ถํ๋ฉด ์ ํธ์ถ์ Promise ๊ฐ ์์ ๋๋์ง ์์ต๋๋ค โ JS ์์ ๋จผ์ ๋ง์ต๋๋ค.
|
|
79
79
|
*/
|
|
80
80
|
let _galleryOpen = false
|
|
81
|
+
/** ์ด๋ openGallery ํธ์ถ์ด _galleryOpen ์ ์ก๊ณ ์๋์ง โ ์ฒ๋ฆฌ ์์(onProcessingStart)์ ๋จผ์ ํ๊ณ , ๋ฆ๊ฒ ๋๋ ์ ํธ์ถ์ด ์ ํธ์ถ์ ์ ๊ธ์ ํ์ง ์๊ฒ */
|
|
82
|
+
let _galleryOpenToken = 0
|
|
81
83
|
/** openEditor ๋ Android ๊ฐ editImagePromise ํ๋๋ง ๋ณด๊ดํ๋ฏ๋ก ๊ฐ์ ๋ณดํธ๊ฐ ํ์ */
|
|
82
84
|
let _editorOpen = false
|
|
83
85
|
/**
|
|
@@ -86,6 +88,8 @@ let _editorOpen = false
|
|
|
86
88
|
*/
|
|
87
89
|
let _asyncImgProcessedSub: { remove: () => void } | null = null
|
|
88
90
|
|
|
91
|
+
export type { AIConfig, AIUsageEvent, AIChargeRequiredEvent } from "./types"
|
|
92
|
+
export type { VideoOptions, VideoProgressEvent, ViewerVideo, ProcessingStartEvent, ProcessingStartItem } from "./types"
|
|
89
93
|
export type { SelectionChangeEvent, Appearance, AttachLocationResult, MapViewerOptions, ReverseGeocodeOptions, ReverseGeocodeResult, ReverseGeocodeErrorCode, AttachFileResult, AttachFileFailure, LocationThumbnailOptions, LocationThumbnailResult } from "./types"
|
|
90
94
|
export type { MediaGalleryItem, MediaGalleryOptions, MediaGalleryGridSize, MediaGalleryGridSizeChangedEvent, MediaGalleryTheme, MediaGalleryViewerOptions, MediaGalleryDeleteOption, MediaGalleryItemDeletedEvent, MediaGalleryNeedPageEvent, MediaGalleryClosedEvent, MediaGalleryAppendPayload, MediaGalleryRemovePayload } from "./types"
|
|
91
95
|
|
|
@@ -115,6 +119,23 @@ export interface RNAttachmentKit {
|
|
|
115
119
|
/** reverseGeocode ์บ์ ๋น์ฐ๊ธฐ */
|
|
116
120
|
clearReverseGeocodeCache(): Promise<void>
|
|
117
121
|
closeGallery(): Promise<boolean>
|
|
122
|
+
/**
|
|
123
|
+
* processingId: ์ด๋ ๋ณด๋ด๊ธฐ์ธ์ง (onProcessingStart ์ ๊ฐ). ์๋ตํ๋ฉด ๊ฐ์ฅ ์ต๊ทผ ๋ณด๋ด๊ธฐ
|
|
124
|
+
*
|
|
125
|
+
* ๋ณด๋ด๋ ์ค์ธ ๋์์ ๋ณํ ์ทจ์ (HUD ์์ด ๋งํ์ ์์ ์ทจ์ํ ๋). index ์๋ต = ๋จ์ ๋์์ ์ ๋ถ.
|
|
126
|
+
* ์ทจ์๋ ๋์์์ onImageProcessedยท๊ฒฐ๊ณผ์ { error: "CANCELLED", cancelled: true } ๋ก ์ค๊ณ ๋๋จธ์ง๋ ๊ณ์ ์ฒ๋ฆฌ๋ฉ๋๋ค.
|
|
127
|
+
* ์งํ ์ค์ธ ์ฒ๋ฆฌ๊ฐ ์์ผ๋ฉด false
|
|
128
|
+
*/
|
|
129
|
+
cancelVideoProcessing(index?: number, processingId?: string): Promise<boolean>
|
|
130
|
+
/**
|
|
131
|
+
* AI ๊ธฐ๋ฅ on/off ยท ํฌ์ธํธ ยท ๋ฌด๋ฃ ํ์ ยท 1ํ ์ฐจ๊ฐ ํฌ์ธํธ (๋๊ธด ๊ฐ๋ง ๋ฐ๋). ์ฑ ์์ ๋ ํ ๋ฒ, ์์ก์ด ๋ฐ๋ ๋๋ง๋ค(์ถฉ์ ยท์๋ฒ ๋๊ธฐํ) ๋ค์ ํธ์ถ.
|
|
132
|
+
* AI ํ๋ฉด์ด ์ด๋ ค ์์ผ๋ฉด ๋ฐ๋ก ๋ฐ์๋ฉ๋๋ค.
|
|
133
|
+
*/
|
|
134
|
+
setAIConfig(config: AIConfig): Promise<void>
|
|
135
|
+
/** AI ๋ฅผ ํ ๋ฒ ์ธ ๋๋ง๋ค (๋ฌด๋ฃ ํ์ ์ฌ์ฉ ๋๋ ํฌ์ธํธ ์ฐจ๊ฐ) โ ์ฑ์ด ์๋ฒ์ ๋ฐ์. ํด์ ํจ์๋ฅผ ๋๋ ค์ค */
|
|
136
|
+
addAIUsageListener(listener: (event: AIUsageEvent) => void): () => void
|
|
137
|
+
/** ํฌ์ธํธ๊ฐ ๋ชจ์๋ผ ์ฌ์ฉ์๊ฐ '์ถฉ์ ํ๊ธฐ'๋ฅผ ๋๋ ์ ๋ โ ์ฑ์ด ์ถฉ์ ํ๋ฉด์ผ๋ก ์๋ด (ํ์ํ๋ฉด closeGallery() ๋ก ์ํธ๋ ๋ซ๊ธฐ). ํด์ ํจ์๋ฅผ ๋๋ ค์ค */
|
|
138
|
+
addAIChargeRequiredListener(listener: (event: AIChargeRequiredEvent) => void): () => void
|
|
118
139
|
addSelectionChangeListener(listener: (event: SelectionChangeEvent) => void): () => void
|
|
119
140
|
getDefaultAnimationConfig(): Promise<{ galleryOpen: number, galleryClose: number, editorOpen: number, editorClose: number, viewerOpen: number, viewerClose: number }>
|
|
120
141
|
injectImageCache(urlString: string, localPath: string): Promise<boolean>
|
|
@@ -167,6 +188,22 @@ const AttachmentKit: RNAttachmentKit = {
|
|
|
167
188
|
throw alreadyOpenError("Gallery")
|
|
168
189
|
}
|
|
169
190
|
_galleryOpen = true
|
|
191
|
+
const myToken = ++_galleryOpenToken
|
|
192
|
+
// ๊ฐค๋ฌ๋ฆฌ ํ๋ฉด์ด ๋ซํ๊ณ ์ฒ๋ฆฌ๊ฐ ์์๋๋ฉด(onProcessingStart) ๋ฐ๋ก ์ ๊ธ์ ํ โ ๋์์์ ๋ณํํ๋ ๋์์๋
|
|
193
|
+
// ๋ค์ ์ด์ด ๋ณด๋ผ ์ ์๊ฒ. Promise ๋ ์ง๊ธ์ฒ๋ผ ์ฒ๋ฆฌ๊ฐ ๋ค ๋๋์ผ resolve
|
|
194
|
+
let myProcessingId: string | null = null
|
|
195
|
+
const subscriptionOpenLock = eventEmitter.addListener("onProcessingStart", (e: any) => {
|
|
196
|
+
if (myProcessingId) return
|
|
197
|
+
myProcessingId = typeof e?.processingId === "string" ? e.processingId : ""
|
|
198
|
+
if (_galleryOpenToken === myToken) _galleryOpen = false
|
|
199
|
+
})
|
|
200
|
+
/** ์ด ํธ์ถ์ ์ด๋ฒคํธ์ธ์ง โ processingId ๊ฐ ๋ถ์ ์ด๋ฒคํธ๋ ๋ด ์ฒ๋ฆฌ์ ๊ฒ๋ง, ์ ๋ถ์(์ ๋ค์ดํฐ๋ธยท์ฌ์ง 1์ฅ ํธ์ง) ์ด๋ฒคํธ๋ ์ฒ๋ฆฌ ID ๋ฅผ ๋ชจ๋ฅผ ๋๋ง */
|
|
201
|
+
const isMine = (e: any) => {
|
|
202
|
+
const id = e?.processingId
|
|
203
|
+
if (typeof id !== "string" || id === "") return !myProcessingId
|
|
204
|
+
return myProcessingId === id
|
|
205
|
+
}
|
|
206
|
+
const mine = <T,>(fn?: (e: T) => void) => fn ? (e: T) => { if (isMine(e)) fn(e) } : undefined
|
|
170
207
|
|
|
171
208
|
// ์ฝ๋ฐฑ ์ด๋ฒคํธ ์์ ๋ฆฌ์ค๋ ๋ฑ๋ก
|
|
172
209
|
let subscriptionSelChange: any = null
|
|
@@ -182,16 +219,33 @@ const AttachmentKit: RNAttachmentKit = {
|
|
|
182
219
|
try { _asyncImgProcessedSub.remove() } catch (e) { /* noop */ }
|
|
183
220
|
_asyncImgProcessedSub = null
|
|
184
221
|
}
|
|
185
|
-
subscriptionImgProcessed = eventEmitter.addListener("onImageProcessed", options.onImageProcessed)
|
|
222
|
+
subscriptionImgProcessed = eventEmitter.addListener("onImageProcessed", mine(options.onImageProcessed)!)
|
|
186
223
|
_asyncImgProcessedSub = subscriptionImgProcessed
|
|
187
224
|
} else {
|
|
188
|
-
subscriptionImgProcessed = eventEmitter.addListener("onImageProcessed", options.onImageProcessed)
|
|
225
|
+
subscriptionImgProcessed = eventEmitter.addListener("onImageProcessed", mine(options.onImageProcessed)!)
|
|
189
226
|
}
|
|
190
227
|
}
|
|
191
228
|
let subscriptionLocation: any = null
|
|
192
229
|
if (options.onLocationSelected) {
|
|
193
230
|
subscriptionLocation = eventEmitter.addListener("onLocationSelected", options.onLocationSelected)
|
|
194
231
|
}
|
|
232
|
+
// ๋์์ ๋ณํ ์งํ๋ฅ (video.onProgress)
|
|
233
|
+
let subscriptionVideoProgress: any = null
|
|
234
|
+
if (options.video?.onProgress) {
|
|
235
|
+
subscriptionVideoProgress = eventEmitter.addListener("onVideoProgress", mine(options.video.onProgress)!)
|
|
236
|
+
}
|
|
237
|
+
// ์ฒ๋ฆฌ ์์ (๋ณด๋ธ ์งํ ํ ๋ฒ, ๊ฒฐ๊ณผ๋ณด๋ค ๋จผ์ )
|
|
238
|
+
let subscriptionProcessingStart: any = null
|
|
239
|
+
if (options.onProcessingStart) {
|
|
240
|
+
// ๋ด ์ฒ๋ฆฌ ์์๋ง (์ ๋ณด๋ด๊ธฐ์ ์์ ์ด๋ฒคํธ๋ ์ด ํธ์ถ ์ ์ ์ด๋ฏธ ์ง๋๊ฐ)
|
|
241
|
+
const onStart = options.onProcessingStart
|
|
242
|
+
let started = false
|
|
243
|
+
subscriptionProcessingStart = eventEmitter.addListener("onProcessingStart", (e: any) => {
|
|
244
|
+
if (started) return
|
|
245
|
+
started = true
|
|
246
|
+
onStart(e)
|
|
247
|
+
})
|
|
248
|
+
}
|
|
195
249
|
let subscriptionFiles: any = null
|
|
196
250
|
if (options.onFilesSelected) {
|
|
197
251
|
const onFiles = options.onFilesSelected
|
|
@@ -201,19 +255,26 @@ const AttachmentKit: RNAttachmentKit = {
|
|
|
201
255
|
|
|
202
256
|
try {
|
|
203
257
|
// ์ด๋ฒคํธ ์ฝ๋ฐฑ์ ๋ค์ดํฐ๋ธ๋ก ์ ๋ฌํ์ง ์์
|
|
204
|
-
const { onSelectionChange, onImageProcessed, onLocationSelected, onFilesSelected, ...restOptions } = options
|
|
205
|
-
const nativeOptions = {
|
|
258
|
+
const { onSelectionChange, onImageProcessed, onLocationSelected, onFilesSelected, onProcessingStart, video, ...restOptions } = options
|
|
259
|
+
const nativeOptions: any = {
|
|
206
260
|
themeColor: _defaultThemeColor,
|
|
207
261
|
languageCode: _defaultLanguageCode,
|
|
208
262
|
appearance: _defaultAppearance,
|
|
209
263
|
...restOptions,
|
|
210
264
|
}
|
|
265
|
+
if (video) {
|
|
266
|
+
// onProgress ์ฝ๋ฐฑ์ ๋ค์ดํฐ๋ธ๋ก ๋๊ธฐ์ง ์์
|
|
267
|
+
const { onProgress, ...videoRest } = video
|
|
268
|
+
nativeOptions.video = videoRest
|
|
269
|
+
}
|
|
211
270
|
nativeOptions.languageCode = normalizeLanguageCode(nativeOptions.languageCode)
|
|
212
271
|
nativeOptions.appearance = normalizeAppearance(nativeOptions.appearance)
|
|
213
272
|
const result = await RNAttachmentKitModule.openGallery(nativeOptions)
|
|
214
273
|
return result
|
|
215
274
|
} finally {
|
|
216
|
-
|
|
275
|
+
// ์ฒ๋ฆฌ ์์ ๋ ์ด๋ฏธ ํ์๊ณ ๊ทธ ๋ค ์ ํธ์ถ์ด ์ก์์ ์ ์์ โ ๋ด ์ ๊ธ์ผ ๋๋ง
|
|
276
|
+
if (_galleryOpenToken === myToken) _galleryOpen = false
|
|
277
|
+
subscriptionOpenLock.remove()
|
|
217
278
|
// ๊ฐค๋ฌ๋ฆฌ๊ฐ ๋ซํ๋ฉด onSelectionChange ๋ฆฌ์ค๋ ์ ๊ฑฐ
|
|
218
279
|
if (subscriptionSelChange) {
|
|
219
280
|
subscriptionSelChange.remove()
|
|
@@ -225,6 +286,12 @@ const AttachmentKit: RNAttachmentKit = {
|
|
|
225
286
|
if (subscriptionFiles) {
|
|
226
287
|
subscriptionFiles.remove()
|
|
227
288
|
}
|
|
289
|
+
if (subscriptionVideoProgress) {
|
|
290
|
+
subscriptionVideoProgress.remove()
|
|
291
|
+
}
|
|
292
|
+
if (subscriptionProcessingStart) {
|
|
293
|
+
subscriptionProcessingStart.remove()
|
|
294
|
+
}
|
|
228
295
|
// asyncProcessing ๋ชจ๋๊ฐ ์๋ ๋๋ง onImageProcessed ๋ฆฌ์ค๋ ์ ๊ฑฐ (async ๋ชจ๋์์ ๋ฐฑ๊ทธ๋ผ์ด๋ ์ฒ๋ฆฌ๋ฅผ ์ํด ์ ์งํด์ผ ํจ)
|
|
229
296
|
// ํธ์ถ๋ถ์์ ์๋์ผ๋ก ์ ๊ฑฐํ๊ฑฐ๋, ์ต์ข
์๋ฃ ์ ์ ๋ฆฌํ๋ ๊ตฌ์กฐ๊ฐ ํ์ํ ์ ์์
|
|
230
297
|
if (!options.asyncProcessing && subscriptionImgProcessed) {
|
|
@@ -380,7 +447,22 @@ const AttachmentKit: RNAttachmentKit = {
|
|
|
380
447
|
mergedOptions.addressLanguageCode = options.languageCode || _rawLanguageCode || _defaultLanguageCode
|
|
381
448
|
mergedOptions.languageCode = normalizeLanguageCode(mergedOptions.languageCode)
|
|
382
449
|
mergedOptions.appearance = normalizeAppearance(mergedOptions.appearance)
|
|
383
|
-
|
|
450
|
+
// ํจ์๋ ๋ค์ดํฐ๋ธ๋ก ๋ชป ๋๊น โ ๋ซ๊ธฐ ์์์ ์ด๋ฒคํธ๋ก ๋ฐ์ (Android ๋ RCTDeviceEventEmitter ๋ก๋ ์ฌ ์ ์์ด ๋ ๋ค ๋ฃ๊ณ ํ ๋ฒ๋ง)
|
|
451
|
+
const onWillClose = options.onViewerWillClose
|
|
452
|
+
delete mergedOptions.onViewerWillClose
|
|
453
|
+
let willCloseSent = false
|
|
454
|
+
const willCloseHandler = (e: any) => {
|
|
455
|
+
if (willCloseSent) return
|
|
456
|
+
willCloseSent = true
|
|
457
|
+
onWillClose?.({ durationMs: typeof e?.durationMs === 'number' ? e.durationMs : 0 })
|
|
458
|
+
}
|
|
459
|
+
const subs: any[] = [eventEmitter.addListener("onMapViewerWillClose", willCloseHandler)]
|
|
460
|
+
if (Platform.OS === "android") subs.push(DeviceEventEmitter.addListener("onMapViewerWillClose", willCloseHandler))
|
|
461
|
+
try {
|
|
462
|
+
await RNAttachmentKitModule.openMapViewer(mergedOptions)
|
|
463
|
+
} finally {
|
|
464
|
+
subs.forEach(s => s.remove())
|
|
465
|
+
}
|
|
384
466
|
},
|
|
385
467
|
|
|
386
468
|
updateMapViewerSourceRect: async (rect: import("./types").SourceRect | null): Promise<void> => {
|
|
@@ -439,6 +521,35 @@ const AttachmentKit: RNAttachmentKit = {
|
|
|
439
521
|
return RNAttachmentKitModule.closeGallery()
|
|
440
522
|
},
|
|
441
523
|
|
|
524
|
+
cancelVideoProcessing: async (index?: number, processingId?: string): Promise<boolean> => {
|
|
525
|
+
if (!RNAttachmentKitModule) {
|
|
526
|
+
throw new Error(LINKING_ERROR)
|
|
527
|
+
}
|
|
528
|
+
if (typeof RNAttachmentKitModule.cancelVideoProcessing !== "function") return false // ์ ๋ค์ดํฐ๋ธ ๋น๋
|
|
529
|
+
return RNAttachmentKitModule.cancelVideoProcessing(typeof index === "number" && index >= 0 ? index : -1, processingId ?? "")
|
|
530
|
+
},
|
|
531
|
+
|
|
532
|
+
setAIConfig: async (config: AIConfig): Promise<void> => {
|
|
533
|
+
if (!RNAttachmentKitModule) {
|
|
534
|
+
throw new Error(LINKING_ERROR)
|
|
535
|
+
}
|
|
536
|
+
if (typeof RNAttachmentKitModule.setAIConfig !== "function") return // ์ ๋ค์ดํฐ๋ธ ๋น๋
|
|
537
|
+
// undefined ๋ "๋ฐ๊พธ์ง ์์" ์ด๋ฏ๋ก ๋นผ๊ณ ๋ณด๋ (null ์ "๋น์")
|
|
538
|
+
const payload: Record<string, unknown> = {}
|
|
539
|
+
Object.entries(config ?? {}).forEach(([k, v]) => { if (v !== undefined) payload[k] = v })
|
|
540
|
+
return RNAttachmentKitModule.setAIConfig(payload)
|
|
541
|
+
},
|
|
542
|
+
|
|
543
|
+
addAIUsageListener: (listener: (event: AIUsageEvent) => void) => {
|
|
544
|
+
const subscription = eventEmitter.addListener("onAIUsage", listener as any)
|
|
545
|
+
return () => subscription.remove()
|
|
546
|
+
},
|
|
547
|
+
|
|
548
|
+
addAIChargeRequiredListener: (listener: (event: AIChargeRequiredEvent) => void) => {
|
|
549
|
+
const subscription = eventEmitter.addListener("onAIChargeRequired", listener as any)
|
|
550
|
+
return () => subscription.remove()
|
|
551
|
+
},
|
|
552
|
+
|
|
442
553
|
addSelectionChangeListener: (listener: (event: SelectionChangeEvent) => void) => {
|
|
443
554
|
const subscription = eventEmitter.addListener("onSelectionChange", listener)
|
|
444
555
|
|
package/src/types.ts
CHANGED
|
@@ -20,6 +20,94 @@ export interface ImageResult {
|
|
|
20
20
|
fileName?: string // ํ์ผ๋ช
|
|
21
21
|
fileExtension?: string // ํ์ฅ์
|
|
22
22
|
fileSize?: number // ํ์ผ ํฌ๊ธฐ (bytes)
|
|
23
|
+
/** "image"(๊ธฐ๋ณธ) | "video" โ mediaType: "all"/"video" ๋ก ์ด์์ ๋ ๋์์์ด๋ฉด "video" */
|
|
24
|
+
mediaType?: "image" | "video"
|
|
25
|
+
/** ๋์์: ๊ธธ์ด(์ด, ์์) */
|
|
26
|
+
duration?: number
|
|
27
|
+
/** ๋์์: ํฌ์คํฐ ์ธ๋ค์ผ file:// (video.posterFormat ํ์ โ ๊ธฐ๋ณธ webp, ๊ธด ๋ณ 512) */
|
|
28
|
+
thumbnailUri?: string
|
|
29
|
+
thumbnailWidth?: number
|
|
30
|
+
thumbnailHeight?: number
|
|
31
|
+
/** ๋์์: ์ ์ก๋ณธ ์ฝ๋ฑยทํ๊ท ๋นํธ๋ ์ดํธ(bps) */
|
|
32
|
+
videoCodec?: "h264" | "hevc" | string
|
|
33
|
+
videoBitrate?: number
|
|
34
|
+
/** ํธ์ง(trim/crop/overlay/์์๊ฑฐ/ํ์ง ๋ณ๊ฒฝ)ํ๋์ง. false ๋ฉด ์๋ณธ์ ๊ทธ๋๋ก(๋ฆฌ๋จน์ค) ๋ณด๋ธ ๊ฒ */
|
|
35
|
+
edited?: boolean
|
|
36
|
+
/** ๋์์ ๋ณํ์ ์คํจํ์ ๋ (uri ์์). ์ฌ์งยท์ ์ ๋์์์ ์์. ์ฑ์ด ์ทจ์ํ์ผ๋ฉด "CANCELLED" */
|
|
37
|
+
error?: string
|
|
38
|
+
/** ์ฑ์ด cancelVideoProcessing ์ผ๋ก ์ทจ์ํ ๋์์ (uri ์์) */
|
|
39
|
+
cancelled?: boolean
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* onProcessingStart โ ๊ฐค๋ฌ๋ฆฌ์์ ๋ณด๋ธ ์งํ, ์ฒ๋ฆฌ(์ฌ์ง ๋ฆฌ์ฌ์ด์ฆยท๋์์ ๋ณํ)๋ฅผ ์์ํ๊ธฐ ์ ์ ํ ๋ฒ.
|
|
44
|
+
* ์ฑ์ ์ด๊ฑธ๋ก ๋งํ์ ์๋ฆฌ๋ฅผ ๋จผ์ ๋ง๋ค๊ณ (๋น์จยทํฌ์คํฐยท๊ธธ์ด), ๋์์์ onVideoProgress ๋ก ์งํ๋ฅ ์ ๊ทธ๋ฆฐ ๋ค
|
|
45
|
+
* onImageProcessed(index ๊ฐ์)๊ฐ ์ค๋ฉด ์ค์ ํ์ผ๋ก ๋ฐ๊ฟ๋๋ค.
|
|
46
|
+
*/
|
|
47
|
+
export interface ProcessingStartEvent {
|
|
48
|
+
/**
|
|
49
|
+
* ์ด๋ฒ ๋ณด๋ด๊ธฐ์ ID. onVideoProgress / onImageProcessed ์๋ ๊ฐ์ ๊ฐ์ด ๋ถ์.
|
|
50
|
+
* ๋์์์ ๋ณํํ๋ ๋์์๋ ๊ฐค๋ฌ๋ฆฌ๋ฅผ ๋ค์ ์ด์ด ๋ ๋ณด๋ผ ์ ์์ผ๋ฏ๋ก, ์ด๋ฒคํธ๋ฅผ ์ ์ญ ๋ฆฌ์ค๋๋ก ๋ฐ๋ ์ฑ์ ์ด ๊ฐ์ผ๋ก ๊ตฌ๋ถ
|
|
51
|
+
*/
|
|
52
|
+
processingId: string
|
|
53
|
+
total: number
|
|
54
|
+
items: ProcessingStartItem[]
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export interface ProcessingStartItem {
|
|
58
|
+
index: number
|
|
59
|
+
mediaType: "image" | "video"
|
|
60
|
+
/** ph://โฆ (iOS) / content://โฆ (Android) */
|
|
61
|
+
originalUri?: string
|
|
62
|
+
/** ์์ ๊ฒฐ๊ณผ ํฌ๊ธฐ (์ฌ์ง: ๋ฆฌ์ฌ์ด์ฆ ํ, ๋์์: ํ์งยทํฌ๋กญ ๋ฐ์). ๋น์จ์ฉ */
|
|
63
|
+
width: number
|
|
64
|
+
height: number
|
|
65
|
+
/** ๋์์: ๋ณด๋ผ ๊ธธ์ด(์ด, ๊ตฌ๊ฐ ๋ฐ์) */
|
|
66
|
+
duration?: number
|
|
67
|
+
/** ๋์์: ํฌ์คํฐ file:// (video.posterFormat ํ์ โ ๊ธฐ๋ณธ webp, ํฌ๋กญยท๊ทธ๋ฆฌ๊ธฐ ๋ฐ์) โ ๋ณํ์ด ๋๋๊ธฐ ์ ๋งํ์ ์ */
|
|
68
|
+
thumbnailUri?: string
|
|
69
|
+
thumbnailWidth?: number
|
|
70
|
+
thumbnailHeight?: number
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/** ๋์์ ์ต์
(GalleryOptions.video). mediaType ์ด "video"/"all" ์ผ ๋๋ง ์๋ฏธ */
|
|
74
|
+
export interface VideoOptions {
|
|
75
|
+
/** ๊ณ ๋ฅผ ์ ์๋ ์ต๋ ๊ธธ์ด(์ด). ๊ธฐ๋ณธ 600 (10๋ถ). ๋๋ ๋์์์ ๋๋ฅด๋ฉด ์๋ด๋ง. 0 = ์ ํ ์์ */
|
|
76
|
+
maxDurationSec?: number
|
|
77
|
+
/** ์ ์ก ๊ฒฐ๊ณผ ์ต๋ ์ฉ๋(MB). ๊ธฐ๋ณธ 100. ์ถ์ ์น๊ฐ ๋์ผ๋ฉด ๋ ๋ฎ์ ํ์ง๋ก ์๋ ์กฐ์ . 0 = ์ ํ ์์ */
|
|
78
|
+
maxFileSizeMB?: number
|
|
79
|
+
/** ํด์๋ ๋จ๊ณ (์ธ๋ก px). ๊ธฐ๋ณธ [360, 480, 720, 1080]. ์๋ณธ๋ณด๋ค ํฐ ๋จ๊ณ๋ ์ฐ์ง ์์(์๋ณธ ์ ์ง) */
|
|
80
|
+
qualities?: number[]
|
|
81
|
+
/** ๊ธฐ๋ณธ ํ์ง (์ธ๋ก px). ๊ธฐ๋ณธ 720. ์๋ณธ์ด ๋ ์์ผ๋ฉด ์๋ณธ ๊ทธ๋๋ก */
|
|
82
|
+
defaultQuality?: number
|
|
83
|
+
/** ๊ตฌ๊ฐ ์๋ฅด๊ธฐ ํ์ฉ. ๊ธฐ๋ณธ true (ํธ์ง ํ๋ฉด์ด ์๊ธฐ๋ P2 ๋ถํฐ) */
|
|
84
|
+
allowTrim?: boolean
|
|
85
|
+
/** ์์๊ฑฐ ๋ฒํผ ํ์. ๊ธฐ๋ณธ true (P2 ๋ถํฐ) */
|
|
86
|
+
allowMute?: boolean
|
|
87
|
+
/** ์ฝ๋ฑ. ๊ธฐ๋ณธ "h264". "hevc" ๋ ์ฉ๋์ด ์์ง๋ง ์์ ๊ธฐ๊ธฐ ํธํ์ ํ์ธํ ๊ฒฝ์ฐ๋ง */
|
|
88
|
+
codec?: "h264" | "hevc"
|
|
89
|
+
/**
|
|
90
|
+
* ๋์์ ํฌ์คํฐ(์ธ๋ค์ผ) ํ์ผ ํ์. ๊ธฐ๋ณธ "webp" (jpg ๋ณด๋ค ์์). "jpg" ๋ก ํ๋ฉด ์์ ์ฒ๋ผ jpg.
|
|
91
|
+
* onProcessingStart / onImageProcessed ์ thumbnailUri ํ์ฅ์๊ฐ ์ด ๊ฐ์ ๋ฐ๋ฆ (webp ์ธ์ฝ๋ฉ์ด ์ ๋๋ ๋๋ฌธ ๊ฒฝ์ฐ์ jpg ๋ก ๋์ ํ๋, ํ์ฅ์๋ uri ๋ก ํ์ธ)
|
|
92
|
+
*/
|
|
93
|
+
posterFormat?: "webp" | "jpg"
|
|
94
|
+
/** ์ ์ก ์ ๋ณํ ์งํ๋ฅ (๋์์๋ง๋ค 0~1, 1% ์ด์ ๋ฐ๋ ๋ยท์ต์ 0.1์ด ๊ฐ๊ฒฉ) */
|
|
95
|
+
onProgress?: (e: VideoProgressEvent) => void
|
|
96
|
+
/**
|
|
97
|
+
* ๋ณํํ๋ ๋์ ํ๋ฉด ๊ฐ์ด๋ฐ ์งํ HUD(์ทจ์ ๋ฒํผ ํฌํจ)๋ฅผ ๋์ธ์ง.
|
|
98
|
+
* ๊ธฐ๋ณธ: asyncProcessing ์ด ์๋๋ฉด true, asyncProcessing: true ๋ฉด false โ
|
|
99
|
+
* ์ด๋ฒคํธ(onProcessingStart / onVideoProgress / onImageProcessed)๋ก ๋งํ์ ์ ์งํ ์ํฉ์ ๊ทธ๋ฆฌ๋ ์ฑ์ HUD ์์ด ์๋๋ค.
|
|
100
|
+
* HUD ๊ฐ ์์ ๋ ์ทจ์๋ AttachmentKit.cancelVideoProcessing(index)
|
|
101
|
+
*/
|
|
102
|
+
showProgressHUD?: boolean
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export interface VideoProgressEvent {
|
|
106
|
+
index: number
|
|
107
|
+
total: number
|
|
108
|
+
progress: number
|
|
109
|
+
/** ์ด๋ ๋ณด๋ด๊ธฐ์ ์งํ๋ฅ ์ธ์ง (onProcessingStart ์ processingId) */
|
|
110
|
+
processingId?: string
|
|
23
111
|
}
|
|
24
112
|
|
|
25
113
|
export interface SourceRect {
|
|
@@ -33,7 +121,10 @@ export interface GalleryOptions {
|
|
|
33
121
|
maxSelection?: number
|
|
34
122
|
maxWidth?: number // ์ต๋ width
|
|
35
123
|
maxHeight?: number // ์ต๋ height
|
|
124
|
+
/** ๊ธฐ๋ณธ "photo" = ์ฌ์ง๋ง(๋์์ ๊ถํ๋ ์์ฒญ ์ ํจ). "all" = ์ฌ์ง+๋์์ ๋ ์ง์ ํผํฉ, "video" = ๋์์๋ง */
|
|
36
125
|
mediaType?: "photo" | "video" | "all"
|
|
126
|
+
/** ๋์์ ์ต์
(mediaType ์ด video/all ์ผ ๋) */
|
|
127
|
+
video?: VideoOptions
|
|
37
128
|
quality?: number
|
|
38
129
|
allItemsText?: string
|
|
39
130
|
selectedItemsText?: string
|
|
@@ -61,6 +152,8 @@ export interface GalleryOptions {
|
|
|
61
152
|
asyncProcessing?: boolean // ์์ ๋น๋๊ธฐ ์ด๋ฒคํธ ๋ฆฌํด ์ฌ๋ถ
|
|
62
153
|
onSelectionChange?: (event: SelectionChangeEvent) => void
|
|
63
154
|
onImageProcessed?: (event: any) => void
|
|
155
|
+
/** ์ฒ๋ฆฌ ์์ (๋ณด๋ธ ์งํ ํ ๋ฒ) โ ๋ชจ๋ ์๋ฆฌ์ ๋ฏธ๋์ด ์ข
๋ฅยท์์ ํฌ๊ธฐยท๋์์ ํฌ์คํฐ. ProcessingStartEvent ์ฐธ๊ณ */
|
|
156
|
+
onProcessingStart?: (event: ProcessingStartEvent) => void
|
|
64
157
|
/**
|
|
65
158
|
* ๊ฐค๋ฌ๋ฆฌ ์๋์ ์ฒจ๋ถ ๋ฉ๋ด(๊ฐค๋ฌ๋ฆฌ / ์์น / ํ์ผ)๋ฅผ ๋ณด์ฌ์ค๋๋ค. ๊ธฐ๋ณธ false.
|
|
66
159
|
* ์์น ํญ: iOS ๋ Apple ์ง๋(ํค ํ์ ์์), Android ๋ Google ์ง๋ โ ์ฑ์ AndroidManifest ์
|
|
@@ -266,12 +359,29 @@ export interface MapViewerOptions {
|
|
|
266
359
|
sourceImageUri?: string
|
|
267
360
|
/** ๋งํ์ ์ด๋ฏธ์ง ๋ผ์ด๋ (dp/pt, ๊ธฐ๋ณธ 12) */
|
|
268
361
|
sourceCornerRadius?: number
|
|
362
|
+
/**
|
|
363
|
+
* ๋ซ๊ธฐ ์ ๋๋ฉ์ด์
์ด "์์"๋ ๋ (durationMs = ๋ซ๊ธฐ ์ ๋๋ฉ์ด์
๊ธธ์ด). ํ๋ก๋ฏธ์ค๋ ๋ค ๋ซํ ๋ค์ ๋๋๋ฏ๋ก,
|
|
364
|
+
* ํค๋ณด๋ ๋ณต๊ท์ฒ๋ผ ๋ซํ๊ณผ ๋์์ ํ๊ณ ์ถ์ ์ผ์ ์ฌ๊ธฐ์. Android ๋ ์ด ์์ ์ ๋ทฐ์ด ์ฐฝ์ด ์
๋ ฅ ํฌ์ปค์ค๋ฅผ ๋ด๋ ค๋์
|
|
365
|
+
*/
|
|
366
|
+
onViewerWillClose?: (e: { durationMs: number }) => void
|
|
269
367
|
/** ๋ง์ปคยท๋ฒํผ ์ (๊ธฐ๋ณธ: setDefaults ์ themeColor) */
|
|
270
368
|
themeColor?: string
|
|
271
369
|
languageCode?: LanguageCode
|
|
272
370
|
appearance?: Appearance
|
|
273
371
|
}
|
|
274
372
|
|
|
373
|
+
/** ๋ทฐ์ด์ ๋์์ ํ์ด์ง ์ ๋ณด (ViewerOptions.videos) */
|
|
374
|
+
export interface ViewerVideo {
|
|
375
|
+
/** http(s) ๋๋ file:// */
|
|
376
|
+
uri: string
|
|
377
|
+
/** ์ด. ๋ชจ๋ฅด๋ฉด ์๋ต (๋ถ๋ฌ์จ ๋ค ์ฑ์) */
|
|
378
|
+
duration?: number
|
|
379
|
+
/** ์ ๋ ๊ฒฝ๋ก(file:// ์์). ํ์ผ์ด ์์ผ๋ฉด ๊ทธ๊ฑธ๋ก ์ฌ์, ์์ผ๋ฉด ์คํธ๋ฆฌ๋ฐํ๊ณ ๋ค ๋ฐ์ผ๋ฉด ์ด ๊ฒฝ๋ก์ ์ ์ฅ */
|
|
380
|
+
cacheFile?: string
|
|
381
|
+
width?: number
|
|
382
|
+
height?: number
|
|
383
|
+
}
|
|
384
|
+
|
|
275
385
|
export interface ViewerOptions {
|
|
276
386
|
images: string[]
|
|
277
387
|
placeholderImages?: string[]
|
|
@@ -281,6 +391,12 @@ export interface ViewerOptions {
|
|
|
281
391
|
* (์ฑ์ด ์บ์๋ฅผ ํ ๊ณณ์์ ๊ด๋ฆฌํ๊ธฐ ์ํ ์ต์
โ ํญ๋ชฉ์ด null/๋น ๋ฌธ์์ด์ด๋ฉด ํด๋น ์ฌ์ง์ ๊ธฐ์กด ๋ฐฉ์)
|
|
282
392
|
*/
|
|
283
393
|
cacheFiles?: (string | null)[]
|
|
394
|
+
/**
|
|
395
|
+
* images ์ ๊ฐ์ ์์. ํญ๋ชฉ์ด ์์ผ๋ฉด ๊ทธ ํ์ด์ง๋ ๋์์ (null/์๋ต = ์ฌ์ง) โ cacheFiles ์ ๊ฐ์ "ํํ ๋ฐฐ์ด".
|
|
396
|
+
* ๋์์ ํ์ด์ง์์ images[i] ๋ ํฌ์คํฐ(์ธ๋ค์ผ) ์ด๋ฏธ์ง๋ก ์ฐ์
๋๋ค (์ด๊ธฐยท๋ซ๊ธฐ ์ ๋๋ฉ์ด์
, ๋ก๋ฉ ์ค ํ์).
|
|
397
|
+
* ์ง์: iOS ๋ทฐ์ด, Android ๋ useOverlayViewer: true ์ผ ๋ (๊ทธ ์ธ Android ๋ทฐ์ด๋ ํฌ์คํฐ๋ง ๋ณด์)
|
|
398
|
+
*/
|
|
399
|
+
videos?: (ViewerVideo | null)[]
|
|
284
400
|
initialIndex?: number
|
|
285
401
|
themeColor?: string // Added themeColor for Android
|
|
286
402
|
/**
|
|
@@ -414,6 +530,14 @@ export interface MediaGalleryItem {
|
|
|
414
530
|
isMine?: boolean
|
|
415
531
|
width?: number
|
|
416
532
|
height?: number
|
|
533
|
+
/** ์๋ต = 'image'. 'video' ๋ฉด imageUri/thumbUri ๋ ํฌ์คํฐ, ์ฌ์์ videoUri */
|
|
534
|
+
mediaType?: 'image' | 'video'
|
|
535
|
+
/** ๋์์ ์๋ณธ (http(s) ๋๋ file://) */
|
|
536
|
+
videoUri?: string
|
|
537
|
+
/** ๋์์ ์บ์ ๊ฒฝ๋ก (ViewerVideo.cacheFile ๊ณผ ๊ฐ์ ์๋ฏธ) */
|
|
538
|
+
videoCacheFile?: string
|
|
539
|
+
/** ์ด โ ๊ทธ๋ฆฌ๋ ์นธ์ "โถ 0:12" ๋ฐฐ์ง */
|
|
540
|
+
duration?: number
|
|
417
541
|
}
|
|
418
542
|
|
|
419
543
|
export interface MediaGalleryDeleteOption {
|
|
@@ -534,3 +658,52 @@ export interface MediaGalleryRemovePayload {
|
|
|
534
658
|
galleryId: string
|
|
535
659
|
groupIds: string[]
|
|
536
660
|
}
|
|
661
|
+
|
|
662
|
+
/**
|
|
663
|
+
* AI ๊ธฐ๋ฅ (๊ฐค๋ฌ๋ฆฌ์ AI ์์ฑ ยท ํธ์ง ํ๋ฉด์ AI ํธ์ง) ์ค์ ๊ณผ ์์ก. `AttachmentKit.setAIConfig` ๋ก ๋๊ธฐ๋ฉฐ, ๋๊ธด ๊ฐ๋ง ๋ฐ๋๋๋ค.
|
|
664
|
+
* ์ฑ ์๋ฒ๊ฐ ์ง์ง ์ฅ๋ถ์ด๊ณ ๋ชจ๋์ ํ๋ฉด ํ์ยท์ฌ์ฉ ๊ฐ๋ฅ ํ๋จ์ฉ ์ฌ๋ณธ์ ๋ค๊ณ ์์ต๋๋ค.
|
|
665
|
+
* ์ฌ์ฉ ์์: ๊ตฌ๋
์์ ๋จ์ ๋ฌด๋ฃ ํ์(freeCount, ์: ์ 30ํ) โ ํฌ์ธํธ(points, 1ํ costPerUse) โ ๋ชจ์๋ผ๋ฉด ์ถฉ์ ์๋ด(onAIChargeRequired).
|
|
666
|
+
* ์ฑ๊ณตํ ์์ฒญ๋ง ์ฐจ๊ฐ๋๊ณ (์คํจยท์ทจ์ยท์์ ์ฐจ๋จ์ ๋ฌด๋ฃ), ์ฐจ๊ฐํ ๋๋ง๋ค onAIUsage ๊ฐ ์ต๋๋ค.
|
|
667
|
+
*/
|
|
668
|
+
export interface AIConfig {
|
|
669
|
+
/** AI ๊ธฐ๋ฅ on/off. ๊ธฐ๋ณธ false โ ๊บผ์ ธ ์์ผ๋ฉด ๊ฐค๋ฌ๋ฆฌยทํธ์ง ํ๋ฉด์ AI ๋ฒํผ์ด ๋ณด์ด์ง ์์ */
|
|
670
|
+
enabled?: boolean
|
|
671
|
+
/** ํ์ฌ ํฌ์ธํธ */
|
|
672
|
+
points?: number
|
|
673
|
+
/** ๊ตฌ๋
์์ ๋จ์ ๋ฌด๋ฃ ํ์ (์: ์ 30ํ ์ค ๋จ์ ๊ฒ โ ๊ธฐ๊ฐยทํ์๋ ์ฑ/์๋ฒ๊ฐ ์ ํจ). 0 ๋ณด๋ค ํฌ๋ฉด ํฌ์ธํธ๋ณด๋ค ๋จผ์ ์ */
|
|
674
|
+
freeCount?: number
|
|
675
|
+
/** 1ํ ์ฐจ๊ฐ ํฌ์ธํธ. 0 ์ด๋ฉด ๊ณผ๊ธ ์์ (๋ฌด์ ํ) */
|
|
676
|
+
costPerUse?: number
|
|
677
|
+
/** ํ์ง ์ต์
"๊ณ ํ์ง(1K)" 1ํ ์ฐจ๊ฐ ํฌ์ธํธ. ์๋ต/null ์ด๋ฉด costPerUse */
|
|
678
|
+
highQualityCost?: number | null
|
|
679
|
+
/** ์ด์: ์ฑ ์๋ฒ(ํ๋ก์) ์ฃผ์. ๋ชจ๋์ด Gemini generateContent ๋ณธ๋ฌธ์ ์ด ์ฃผ์๋ก ๋ณด๋ด๊ณ ์๋ฒ๊ฐ ํค๋ฅผ ๋ถ์ฌ ์ ๋ฌ (ํค๋ X-AI-Model = ๋ชจ๋ธ ์ด๋ฆ) */
|
|
680
|
+
endpoint?: string | null
|
|
681
|
+
/** endpoint ๋ก ๋ณด๋ผ ๋ ๋ถ์ผ ํค๋ (์: { Authorization: "Bearer โฆ" }) */
|
|
682
|
+
headers?: Record<string, string>
|
|
683
|
+
/** ํ
์คํธ ์ ์ฉ Gemini ํค (์ฑ์ ๋ฃ์ด ๋ฐฐํฌํ์ง ๋ง ๊ฒ). endpoint ๊ฐ ์์ผ๋ฉด ๋ฌด์ */
|
|
684
|
+
apiKey?: string | null
|
|
685
|
+
}
|
|
686
|
+
|
|
687
|
+
/** AI ๋ฅผ ํ ๋ฒ ์ฑ๊ณต์ ์ผ๋ก ์ผ์ ๋ (์๋ฒ์ ์ฐจ๊ฐ์ ๋ฐ์ํ๋ ๋ฐ ์ฌ์ฉ) */
|
|
688
|
+
export interface AIUsageEvent {
|
|
689
|
+
/** "generate" = ๊ฐค๋ฌ๋ฆฌ AI ์์ฑ, "edit" = ํธ์ง ํ๋ฉด AI ํธ์ง */
|
|
690
|
+
kind: "generate" | "edit"
|
|
691
|
+
/** ๋ฌด๋ฃ ํ์๋ฅผ ์ผ์ผ๋ฉด true (์ด๋ pointsDeducted = 0) */
|
|
692
|
+
usedFreeCount: boolean
|
|
693
|
+
/** ์ด๋ฒ์ ์ฐจ๊ฐํ ํฌ์ธํธ */
|
|
694
|
+
pointsDeducted: number
|
|
695
|
+
/** ๊ณ ํ์ง(1K)๋ก ๋ง๋ค์๋์ง */
|
|
696
|
+
highQuality: boolean
|
|
697
|
+
/** ์ฐจ๊ฐ ํ ๋ชจ๋์ด ๋ค๊ณ ์๋ ๊ฐ */
|
|
698
|
+
points: number
|
|
699
|
+
freeCount: number
|
|
700
|
+
}
|
|
701
|
+
|
|
702
|
+
/** ํฌ์ธํธ๊ฐ ๋ชจ์๋ผ ์ฌ์ฉ์๊ฐ '์ถฉ์ ํ๊ธฐ'๋ฅผ ๋๋ ์ ๋ (๋ชจ๋์ AI ํ๋ฉด์ ๋ซ์ โ ์ฑ์ด ์ถฉ์ ํ๋ฉด์ผ๋ก ์๋ด) */
|
|
703
|
+
export interface AIChargeRequiredEvent {
|
|
704
|
+
kind: "generate" | "edit"
|
|
705
|
+
/** 1ํ์ ํ์ํ ํฌ์ธํธ */
|
|
706
|
+
required: number
|
|
707
|
+
points: number
|
|
708
|
+
freeCount: number
|
|
709
|
+
}
|