- Add SDWebImage dependency to FollowNative.podspec - Refactor ImagePreview and PreviewControllerController for robust image preview - Implement dynamic file extension handling for image preview - Update WebView bridge to support more flexible image preview payload - Improve MarkdownImage component to use Uint8Array for image conversion Signed-off-by: Innei <tukon479@gmail.com>
31 lines
532 B
Swift
31 lines
532 B
Swift
//
|
|
// SharedWebView+BridgeData.swift
|
|
// Pods
|
|
//
|
|
// Created by Innei on 2025/2/7.
|
|
//
|
|
import Foundation
|
|
|
|
private protocol BasePayload {
|
|
var type: String { get }
|
|
}
|
|
|
|
struct SetContentHeightPayload: Codable, BasePayload {
|
|
var type: String
|
|
var payload: CGFloat
|
|
}
|
|
|
|
struct BridgeDataBasePayload: Codable {
|
|
var type: String
|
|
}
|
|
|
|
struct PreviewImagePayloadProps: Codable {
|
|
var images: [[UInt8]]
|
|
var index: Int = 0
|
|
}
|
|
|
|
struct PreviewImagePayload: Codable, BasePayload {
|
|
var type: String
|
|
var payload: PreviewImagePayloadProps
|
|
}
|