k2-im 0.1.52 → 0.1.54

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/README.md CHANGED
@@ -20,7 +20,7 @@ Chat Kit Core 与 Core-only 入口不依赖 Vue/Pinia/路由,也不自行获
20
20
 
21
21
  当前 ESM 与声明构建均已内联 workspace 依赖,crypto WASM 和 Speex 运行时资产也随包提供。开发期本地同步保留 JavaScript source map、不压缩且每个入口保持独立,便于调试;公共 npm 发布使用压缩后的 JavaScript、共享 chunk 和压缩后的 Speex 运行时,并且 tarball 不包含 `.map` 文件。这仍是 `0.1.0` 预稳定候选,不代表 registry 稳定发布。
22
22
 
23
- 发布候选已通过独立 Rspack clean-consumer Gate:AWS 仅在首次上传时加载,crypto WASM 与 Speex 由 dist 自持,fixture 不需要 Node shim、WASM loader、asset copy 或 postinstall。该证据只证明普通 Rspack 消费者可以编译,不等于 H5 已同步当前 tarball 或真实媒体链路已验收;H5 开发期通过本地同步脚本完成自身 typecheck/Rspack 验证,上线准备阶段再使用内部 Registry 精确版本完成 Docker/Jenkins 验证。
23
+ 发布候选已通过独立 Rspack clean-consumer Gate:AWS 仅在首次上传时加载,crypto WASM 与 Speex 由 dist 自持,fixture 不需要 Node shim、WASM loader、asset copy 或 postinstall。该证据只证明普通 Rspack 消费者可以编译,不等于 H5 已同步当前 tarball 或真实媒体链路已验收;H5 开发期通过本地同步脚本完成自身 typecheck/Rspack 验证,上线准备阶段使用已发布 npm 精确版本完成 Docker/Jenkins 验证。
24
24
 
25
25
  ## 普通请求加解密
26
26
 
package/dist/browser.js CHANGED
@@ -1 +1 @@
1
- export{Va as canCopyImageToClipboard,Wa as copyImageToClipboard,C as createLazyBrowserApiProtocolClient}from'./chunk-KV7I2SAC.js';import'./chunk-Q6TFPZMF.js';import'./chunk-WOT6VMZA.js';
1
+ export{Va as canCopyImageToClipboard,Wa as copyImageToClipboard,C as createLazyBrowserApiProtocolClient}from'./chunk-KORCFTGX.js';import'./chunk-Q6TFPZMF.js';import'./chunk-WOT6VMZA.js';
@@ -5355,6 +5355,11 @@ interface ImMediaTask {
5355
5355
  /** 可供产品按 code/category 决策的稳定错误;不含底层 URL、密钥或响应正文。 */
5356
5356
  error?: ImSdkErrorShape;
5357
5357
  }
5358
+ /** 本地视频预读结果:消息小封面与仅供页面显示的高清图分别持有。 */
5359
+ interface LocalVideoPreviewMetadata extends VideoPreviewMetadata {
5360
+ /** 按需生成的高清 JPEG;宿主负责 object URL 生命周期,不可替代 posterData 发送。 */
5361
+ displayPoster?: Blob;
5362
+ }
5358
5363
  /**
5359
5364
  * 当前账号的媒体任务、取消、重试与消息媒体下载产品面。
5360
5365
  *
@@ -5461,7 +5466,8 @@ interface ImMediaTasksApi {
5461
5466
  *
5462
5467
  * 返回的对象可以**原样**作为 `localPreviewMetadata` 交给 `sendImage` / `sendVideo` /
5463
5468
  * `sendMediaAlbum`:发送链路会跳过重复解码,上传中的气泡也从第一帧就有封面。
5464
- * 视频封面用的就是发送链路那套规格(长边 320、JPEG),所以弹层里看到的与最终发出去的是同一张。
5469
+ * posterData 保持发送规格(长边 320、JPEG);includeDisplayPoster 可在同一次解码中额外生成
5470
+ * 仅供页面显示的高清 displayPoster(长边最多 960),不得用它替换消息里的小封面。
5465
5471
  *
5466
5472
  * @param input.kind 按文件类型选解码路径;`'video'` 才会抽首帧与读时长。
5467
5473
  * @param input.file 本地文件;不会被上传,也不会进任何缓存。
@@ -5476,7 +5482,9 @@ interface ImMediaTasksApi {
5476
5482
  kind: TKind;
5477
5483
  file: Blob;
5478
5484
  signal?: AbortSignal;
5479
- }) => Promise<(TKind extends 'video' ? VideoPreviewMetadata : ImagePreviewMetadata) | null>;
5485
+ /** 仅视频有效;同一次解码附带高清显示封面,默认不生成。 */
5486
+ includeDisplayPoster?: boolean;
5487
+ }) => Promise<(TKind extends 'video' ? LocalVideoPreviewMetadata : ImagePreviewMetadata) | null>;
5480
5488
  /**
5481
5489
  * 从本地视频提取仅供页面展示的高清 JPEG 封面,不上传、不下载、不写缓存。
5482
5490
  *
@@ -6836,6 +6844,8 @@ type ImServiceTextKey = 'common.notConnected' | 'common.selectOrOpenConversation
6836
6844
  interface MediaObjectUrlLease {
6837
6845
  /** 可直接交给媒体 DOM 元素的 `blob:` 地址。 */
6838
6846
  readonly url: string;
6847
+ /** 发送前已生成的高清视频封面,仅供本机显示;未预读或已释放时不存在。 */
6848
+ readonly videoPoster?: Blob;
6839
6849
  /** 告知 Runtime 当前组件已不再使用该地址。 */
6840
6850
  release: () => void;
6841
6851
  }
@@ -7166,6 +7176,8 @@ interface ChatRuntime {
7166
7176
  clearSelfVoiceBytes: () => void;
7167
7177
  /** 为用户刚选择的图片、视频或 GIF 创建本地预览地址,并登记资源所有权;上传取消前该地址不会被自动淘汰。 */
7168
7178
  createLocalMediaPreview: (source: Blob) => string;
7179
+ /** 按原文件暂存当前账号的高清视频封面;创建上传源时一并交给消息租约,关闭选择后随 File 回收。 */
7180
+ rememberLocalVideoPoster: (source: Blob, poster: Blob) => void;
7169
7181
  /** 用户取消选择或上传尚未绑定消息时,撤销指定本地预览地址并释放对应 Blob 内存。 */
7170
7182
  discardLocalMediaPreview: (url: string) => void;
7171
7183
  /** 发送动作生成消息 ID 后,把临时预览地址绑定到精确的会话和消息,供消息气泡继续展示。 */