react-native-attachment-kit 1.0.6 → 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 +8 -0
- package/README.md +1 -1
- package/android/src/main/libs/rnattachmentkit-release.aar +0 -0
- package/ios/RNAttachmentKit.swift +27 -1
- package/ios/RNAttachmentKit.xcframework/Info.plist +5 -5
- package/ios/RNAttachmentKit.xcframework/ios-arm64/RNAttachmentKit.framework/Modules/RNAttachmentKit.swiftmodule/arm64-apple-ios.abi.json +787 -626
- 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 +4 -4
- 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/Modules/RNAttachmentKit.swiftmodule/arm64-apple-ios-simulator.abi.json +787 -626
- package/ios/RNAttachmentKit.xcframework/ios-arm64_x86_64-simulator/RNAttachmentKit.framework/Modules/RNAttachmentKit.swiftmodule/x86_64-apple-ios-simulator.abi.json +787 -626
- 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 +10 -10
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.0.8 — 2026-10-16
|
|
4
|
+
|
|
5
|
+
- **AI screens are the same in every app (iOS + Android)**. Generate: woman / man, country, age (up to the 80s), style, situation, aspect ratio + Create, sample chips and the chat input; chat text is sent together with the chosen settings, and tapping a sample shows a summary of the settings before creating. The glamour situations / samples and the detail options were removed from the generate screen. Edit: the full editing screen everywhere. Generated and edited images are stored for the gallery's "AI 이미지" tab in every app.
|
|
6
|
+
- iOS: the "AI 이미지" tab expands / collapses the sheet like the gallery grid.
|
|
7
|
+
- iOS: an edited (trimmed) video's first poster (`onProcessingStart` `thumbnailUri`) is taken from the trimmed start, with crop and drawing applied.
|
|
8
|
+
- iOS: closing the AI screen right after using a menu no longer leaves a stray button over the gallery.
|
|
9
|
+
- Android image viewer: video controls no longer flash on photo pages while the viewer opens.
|
|
10
|
+
|
|
3
11
|
## 1.0.6 — 2026-10-14
|
|
4
12
|
|
|
5
13
|
- **Video in the picker, editor and viewer (iOS + Android)**: `openGallery({ mediaType: "all" | "video", video })` picks videos; the editor gets video pages (trim, mute, quality, crop, drawing/stickers/text, pre-encoding); `openViewer({ images, videos })` plays videos (progress pill, mute/options, remote video cache, pinch zoom). Sending progress is reported as events. `video.posterFormat` (`"webp"` default / `"jpg"`). Video limits are checked before sending.
|
package/README.md
CHANGED
|
@@ -463,7 +463,7 @@ A native grid built for thousands of photos. It opens like the picker (same bott
|
|
|
463
463
|
|
|
464
464
|
### AI (generate & edit)
|
|
465
465
|
|
|
466
|
-
The gallery's ✦ button (AI image generation) and the editor's 6th tool **AI** (AI photo editing) use Google Gemini. They are **off until you call `setAIConfig({ enabled: true, ... })`**.
|
|
466
|
+
The gallery's ✦ button (AI image generation) and the editor's 6th tool **AI** (AI photo editing) use Google Gemini. They are **off until you call `setAIConfig({ enabled: true, ... })`**. The screens are the same in every app. Generate has woman / man, country, age, style and situation pickers, an aspect-ratio bar, sample chips and the chat input; chat text is sent together with the chosen settings. Edit is the full editing screen: edit choices, options, recommendation chips and the chat input. Generated and edited images are kept on the device and listed in the gallery's "AI 이미지" tab.
|
|
467
467
|
|
|
468
468
|
```ts
|
|
469
469
|
await AttachmentKit.setAIConfig({
|
|
Binary file
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
import UIKit
|
|
9
9
|
import Photos
|
|
10
|
+
import AVFoundation
|
|
10
11
|
import ImageIO
|
|
11
12
|
import CoreLocation
|
|
12
13
|
import RNAttachmentKit
|
|
@@ -1339,7 +1340,10 @@ class RNAttachmentKit: RCTEventEmitter {
|
|
|
1339
1340
|
"width": Int(size.width), "height": Int(size.height),
|
|
1340
1341
|
"duration": state.outputDuration(sourceDuration: a.duration),
|
|
1341
1342
|
]
|
|
1342
|
-
|
|
1343
|
+
// 앞을 잘랐으면 포스터는 잘린 구간의 첫 프레임 (원본 첫 프레임은 결과 영상에 없음 — Android 와 같음)
|
|
1344
|
+
let trimmedStart = state.trimRange(duration: a.duration).map { CMTimeGetSeconds($0.start) } ?? 0
|
|
1345
|
+
let base = trimmedStart > 0.01 ? (Self.videoFrame(a, at: trimmedStart) ?? image) : image
|
|
1346
|
+
if let poster = base {
|
|
1343
1347
|
let edited = state.applyEdits(to: poster)
|
|
1344
1348
|
if let encoded = VideoExporter.encodePoster(edited, format: videoOptions.posterFormat, quality: 0.8) {
|
|
1345
1349
|
let path = (tempDir as NSString).appendingPathComponent("turbo_video_poster_\(Int(Date().timeIntervalSince1970 * 1000))_\(index).\(encoded.fileExtension)")
|
|
@@ -1368,6 +1372,28 @@ class RNAttachmentKit: RCTEventEmitter {
|
|
|
1368
1372
|
}
|
|
1369
1373
|
|
|
1370
1374
|
/// 동영상 포스터 (긴 변 512, 동기) — 처리 시작 이벤트용
|
|
1375
|
+
/// 동영상의 [seconds] 프레임 (긴 변 ≤ 1024, 회전 반영). 백그라운드 스레드에서만 — 원본을 받는 동안 최대 3초 기다림
|
|
1376
|
+
private static func videoFrame(_ asset: PHAsset, at seconds: Double) -> UIImage? {
|
|
1377
|
+
let o = PHVideoRequestOptions()
|
|
1378
|
+
o.isNetworkAccessAllowed = true
|
|
1379
|
+
o.deliveryMode = .automatic
|
|
1380
|
+
var avAsset: AVAsset?
|
|
1381
|
+
let done = DispatchSemaphore(value: 0)
|
|
1382
|
+
PHImageManager.default().requestAVAsset(forVideo: asset, options: o) { a, _, _ in
|
|
1383
|
+
avAsset = a
|
|
1384
|
+
done.signal()
|
|
1385
|
+
}
|
|
1386
|
+
guard done.wait(timeout: .now() + 3) == .success, let av = avAsset else { return nil }
|
|
1387
|
+
let gen = AVAssetImageGenerator(asset: av)
|
|
1388
|
+
gen.appliesPreferredTrackTransform = true
|
|
1389
|
+
gen.maximumSize = CGSize(width: 1024, height: 1024)
|
|
1390
|
+
// 잘린 구간 밖(앞) 프레임이 나오지 않게 — 뒤로만 조금 허용
|
|
1391
|
+
gen.requestedTimeToleranceBefore = .zero
|
|
1392
|
+
gen.requestedTimeToleranceAfter = CMTime(seconds: 0.1, preferredTimescale: 600)
|
|
1393
|
+
guard let cg = try? gen.copyCGImage(at: CMTime(seconds: seconds, preferredTimescale: 600), actualTime: nil) else { return nil }
|
|
1394
|
+
return UIImage(cgImage: cg)
|
|
1395
|
+
}
|
|
1396
|
+
|
|
1371
1397
|
private static func requestPoster(_ asset: PHAsset) -> UIImage? {
|
|
1372
1398
|
let o = PHImageRequestOptions()
|
|
1373
1399
|
o.isSynchronous = true
|
|
@@ -8,32 +8,32 @@
|
|
|
8
8
|
<key>BinaryPath</key>
|
|
9
9
|
<string>RNAttachmentKit.framework/RNAttachmentKit</string>
|
|
10
10
|
<key>LibraryIdentifier</key>
|
|
11
|
-
<string>ios-
|
|
11
|
+
<string>ios-arm64_x86_64-simulator</string>
|
|
12
12
|
<key>LibraryPath</key>
|
|
13
13
|
<string>RNAttachmentKit.framework</string>
|
|
14
14
|
<key>SupportedArchitectures</key>
|
|
15
15
|
<array>
|
|
16
16
|
<string>arm64</string>
|
|
17
|
+
<string>x86_64</string>
|
|
17
18
|
</array>
|
|
18
19
|
<key>SupportedPlatform</key>
|
|
19
20
|
<string>ios</string>
|
|
21
|
+
<key>SupportedPlatformVariant</key>
|
|
22
|
+
<string>simulator</string>
|
|
20
23
|
</dict>
|
|
21
24
|
<dict>
|
|
22
25
|
<key>BinaryPath</key>
|
|
23
26
|
<string>RNAttachmentKit.framework/RNAttachmentKit</string>
|
|
24
27
|
<key>LibraryIdentifier</key>
|
|
25
|
-
<string>ios-
|
|
28
|
+
<string>ios-arm64</string>
|
|
26
29
|
<key>LibraryPath</key>
|
|
27
30
|
<string>RNAttachmentKit.framework</string>
|
|
28
31
|
<key>SupportedArchitectures</key>
|
|
29
32
|
<array>
|
|
30
33
|
<string>arm64</string>
|
|
31
|
-
<string>x86_64</string>
|
|
32
34
|
</array>
|
|
33
35
|
<key>SupportedPlatform</key>
|
|
34
36
|
<string>ios</string>
|
|
35
|
-
<key>SupportedPlatformVariant</key>
|
|
36
|
-
<string>simulator</string>
|
|
37
37
|
</dict>
|
|
38
38
|
</array>
|
|
39
39
|
<key>CFBundlePackageType</key>
|