@shiqianjiang/ceru-plugin-sdk 0.3.2 → 0.3.3
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 +3 -1
- package/README.md +2 -0
- package/dist/index.d.ts +3 -0
- package/dist/manifest.d.ts +2 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
# SDK 变更记录
|
|
2
2
|
|
|
3
|
-
## 0.3.
|
|
3
|
+
## 0.3.3
|
|
4
4
|
|
|
5
5
|
- 新增 Host 原生基础 UI Surface:插件返回经过校验的 `NativeView` 数据,宿主用自己的列表、网格和按钮组件渲染;平台业务与登录流程仍留在插件内。
|
|
6
6
|
- 原生列表支持资源打开、播放及逐项菜单动作;Core 校验所有动作引用,CLI 在 Host DOM 中预览并共享 Surface 生命周期。
|
|
7
7
|
- 新增 `accountItems` 和 `AccountSummary`:插件贡献账号菜单摘要与登录页面,Host 展示头像、昵称和可选会员标签。
|
|
8
|
+
- 账号菜单支持声明 `logoutAction`;Surface 支持 `modal` 展示、Web `ctx.close()` 及逻辑 `ctx.ui.closeView()`,便于插件完成扫码后关闭自己的登录界面。
|
|
9
|
+
- 浏览器沙箱公共服务调用序列化 OperationContext 并传递取消信号,修复调用队列/播放器时 AbortSignal 无法跨窗口克隆的问题。
|
|
8
10
|
|
|
9
11
|
## 0.3.1
|
|
10
12
|
|
package/README.md
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
## 原生 UI 与账号菜单
|
|
4
4
|
|
|
5
|
+
本节接口由 0.3.3 完整提供。
|
|
6
|
+
|
|
5
7
|
从根入口导入 `defineNativeView`、`NativeView`、`assertNativeView` 和 `AccountSummary`。`kind: 'native'` 的 Surface 以声明的 action 为 render 入口,返回网格/列表与标准内容数据,由 Host 的原生组件渲染。`contributes.accountItems` 以公开摘要动作和账号 Surface 接入 Host 账号菜单;账号业务、凭据和 Vue 登录页面保留在插件内。
|
|
6
8
|
|
|
7
9
|
[原生 Surface、导航、播放与账号贡献教程](https://github.com/CeruMusic/CeruMusic-Plugin-Cli/blob/main/docs/NATIVE-SURFACES.md)。脚手架 `connected-library` 的 JS/TS 示例可直接构建和预览。
|
package/dist/index.d.ts
CHANGED
|
@@ -284,6 +284,7 @@ export interface PluginContext extends HostServices {
|
|
|
284
284
|
message: string;
|
|
285
285
|
}): Promise<void>;
|
|
286
286
|
openView(surfaceId: string): Promise<void>;
|
|
287
|
+
closeView(surfaceId: string): Promise<void>;
|
|
287
288
|
};
|
|
288
289
|
storage: PluginStorageAPI;
|
|
289
290
|
guests: GuestAPI & {
|
|
@@ -318,6 +319,8 @@ export interface SurfaceContext extends Pick<PluginContext, 'host' | 'utils' | '
|
|
|
318
319
|
mode?: 'append' | 'prepend' | 'wrap' | 'replace';
|
|
319
320
|
};
|
|
320
321
|
invoke(action: string, input: JsonValue): Promise<JsonValue>;
|
|
322
|
+
/** Close this mounted Surface after its current action has returned. */
|
|
323
|
+
close(): Promise<void>;
|
|
321
324
|
subscribe(handler: (state: JsonObject) => void): Disposable;
|
|
322
325
|
}
|
|
323
326
|
export interface GuestContext extends Pick<PluginContext, 'host' | 'utils'>, GuestBootstrapAPI {
|
package/dist/manifest.d.ts
CHANGED
|
@@ -40,7 +40,7 @@ export interface SurfaceDeclaration {
|
|
|
40
40
|
/** Host chrome only. The plugin owns all content inside a web Surface. */
|
|
41
41
|
title?: string;
|
|
42
42
|
presentation?: {
|
|
43
|
-
kind: 'drawer';
|
|
43
|
+
kind: 'drawer' | 'modal';
|
|
44
44
|
placement?: 'left' | 'right' | 'top' | 'bottom';
|
|
45
45
|
size?: number;
|
|
46
46
|
};
|
|
@@ -153,6 +153,7 @@ export interface PluginManifest {
|
|
|
153
153
|
title: string;
|
|
154
154
|
view: string;
|
|
155
155
|
action: string;
|
|
156
|
+
logoutAction?: string;
|
|
156
157
|
}[];
|
|
157
158
|
sidebarItems?: {
|
|
158
159
|
id: string;
|