@doubao-dev/plugin-app-dev 1.0.0-rc.14 → 1.0.0-rc.16

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.
@@ -18,5 +18,6 @@ metadata:
18
18
  | 界面设计、样式调整或实际渲染验收 | [界面设计与验收](references/ui-design.md) |
19
19
  | 端工具、工具参数表单、实体映射或卡片不显示 | [端工具与出卡配置](references/tools-and-cards.md) |
20
20
  | 本地编译和 Web 模拟器 | [本地调试](references/app-development.md#本地调试) |
21
+ | 应用插件手机扫码预览 | [交接模拟器或手机预览](references/app-development.md#交接模拟器或手机预览) |
21
22
  | 真机扫码、断线恢复和桌面工具 | [真机与桌面调试](references/app-development.md#真机与桌面调试) |
22
23
  | 组件、Hooks、API、模板或 Lynx | [SDK 参考资料索引](references/app-development.md#按需读取-sdk-参考资料) |
@@ -19,7 +19,7 @@ export default {
19
19
  };
20
20
  ```
21
21
 
22
- 前端配置默认导出普通对象,必须声明非空的 `widgets`,至少注册一个卡片入口;`pages`、`tools` 按需声明。应用元信息通过 `name`(应用名称)、`description`(应用描述)两个顶层字段按需填写。端工具定义放在 `com.doubao/app/tools.json`,与 `manifest.yaml` 同级。
22
+ 前端配置默认导出普通对象。`widgets` 至少包含一个业务卡片入口,`pages` 和 `tools` 按需声明。应用名称和描述可分别填在顶层的 `name` 和 `description`。端工具定义放在 `com.doubao/app/tools.json`,与 `manifest.yaml` 同级。
23
23
 
24
24
  ## 调试前提
25
25
 
@@ -28,14 +28,15 @@ export default {
28
28
  ## 实现与验证
29
29
 
30
30
  1. 工具调用或出卡变化先按 [端工具与出卡配置](tools-and-cards.md) 对齐业务 Skill、tools.json、handler 和生成的 Manifest。
31
- 2. 在 `src/widgets/<name>/index.tsx` 实现卡片,在 `src/pages/<name>/index.tsx` 实现全屏页面,在 `src/app.config.ts` 注册入口,保留已有配置。
32
- 3. 使用 Lynx 的 `view`、`text`、`image` 和独立样式文件;布局按 Lynx 文档实现。Widget 优先使用 SDK 卡片模板,核对 props 后映射实体数据。
33
- 4. `useViewData<T>()` 的类型与返回实体一致,并处理数据未到达的空态。字符串入口 `widgets/example/index` 的 Widget ID 为 `example`,显式对象入口使用其 `id`,均须与 Manifest 绑定一致。
34
- 5. 满足[调试前提](#调试前提)后,用 `dbx dev --app` 验证真实工具结果驱动出卡。有 Page 时,从对应业务 Widget 点击进入该 Page,核对实体 ID、数据和导航参数,再验证页面核心操作及返回;直开 Page 或 Widget 不能替代这条链路。
31
+ 2. 在 `src/app.config.ts` 注册本次新增的入口,保留已有配置。
32
+ - **对话卡片(Widget)** 在 `src/widgets/<name>/index.tsx` 把实体数据映射到 [SDK 卡片模板](frontend/widget-templates/overview.md)的字段。图文列表可用 `ContentCard`,在同一张卡片里组合行程和选项可用 `CompositeCard`。
33
+ - **全屏页面(Page)** 适合展示详情或完成多步操作。在 `src/pages/<name>/index.tsx` 使用 Lynx 的 `view`、`text`、`image` 和独立样式文件实现布局。
34
+ 3. `useViewData<T>()` 的类型与工具返回的实体一致,数据尚未到达时显示空态。卡片 ID 与 Manifest 中的绑定保持一致。例如,`widgets/example/index` 对应 `example`,对象形式的入口取其 `id`。
35
+ 4. 满足[调试前提](#调试前提)后,启动 `dbx dev --app`。工具驱动的卡片用一次真实调用核对结果,静态卡片直接查看内容。有 Page 时,从对应的业务卡片打开页面,核对导航参数、业务数据和返回操作。
35
36
 
36
- 有 Page 的业务须提供对应 Widget 入口,不能只为满足非空 `widgets` 放置无关示例卡片。按钮用法见 [交互控件](frontend/components/interactive-controls.md),页面滚动、安全区和按钮布局见 [布局规则](frontend/lynx/overview.md);用长内容和实际宿主尺寸检查滚动、遮挡与可点击区域。
37
+ 按钮用法见[交互控件](frontend/components/interactive-controls.md),页面滚动、安全区和按钮布局见[布局规则](frontend/lynx/overview.md)。在实际宿主尺寸下用长内容检查滚动、遮挡和可点击区域。
37
38
 
38
- 仅包含 Widget 时,验证实际出卡、数据及适用的空态、错误和交互;静态卡片按内容验收,不为验证新增按钮、Page 或工具。视觉设计和真实渲染检查见 [界面设计与验收](ui-design.md)。页面、卡片和配置的完整示例以当前项目模板为准,SDK 用法按下表读取。
39
+ 卡片的空态、错误提示和交互按实际功能检查,见[界面设计与验收](ui-design.md)。页面、卡片和配置的完整示例见当前项目模板。
39
40
 
40
41
  Web 调试成功只证明已验证的编译与模拟器行为;目标客户端效果仍需实际体验。
41
42
 
@@ -51,6 +52,12 @@ Web 调试成功只证明已验证的编译与模拟器行为;目标客户端
51
52
 
52
53
  指定版本用 `DBX_KIT_VERSION=<准确版本>`;指定本地包用 `DBX_KIT_PATH`,相对启动命令工作目录解析,使用时跳过版本检查。本地包加载失败先修复其路径、`package.json` 或 SDK 入口,不通过反复安装覆盖该问题。
53
54
 
55
+ ## 交接模拟器或手机预览
56
+
57
+ 制作应用插件后默认给用户本次 Web 模拟器的实际链接,附一条业务输入和预期的卡片或页面操作,等用户反馈。模拟器体验通过即可完成这一阶段。
58
+
59
+ 用户需要手机扫码预览时,先说明生成云预览需要将该版本保存到平台,沿用已有上传授权。通过 CLI Skill 的版本交付流程取得本次真实预览地址,交接给用户用手机体验。用户明确要求直接预览时,按该目标执行。需要手机连接本地开发服务、实时调试时,使用下面的真机连接流程。
60
+
54
61
  ## 真机与桌面调试
55
62
 
56
63
  前提:CLI 能从平台查询到有效 AppID,手机能访问电脑的局域网资源地址。没有平台 AppID 时先使用 Web 模拟器;不能用 Web Sandbox 的兜底 ID 申请真机授权。
@@ -8,6 +8,9 @@
8
8
 
9
9
  | API | 说明 |
10
10
  | --- | --- |
11
+ | [getContainerInfoSync](#getcontainerinfosync) | 同步获取当前渲染容器的尺寸信息。 同时支持 Page(含全屏、半屏)和 Widget(卡片)容器。<br><br>同步 API。 |
12
+ | [getContainerInfo](#getcontainerinfo) | 异步获取当前渲染容器的尺寸信息。 同时支持 Page(含全屏、半屏)和 Widget(卡片)容器。 |
13
+ | [onContainerResize](#oncontainerresize) | 监听当前渲染容器尺寸变化。 使用与 getContainerInfoSync 相同的数据源,仅在容器宽度或高度变化时触发,注册时不触发回调。<br><br>返回取消监听函数。 |
11
14
  | [getWindowInfoSync](#getwindowinfosync) | 获取窗口信息。<br><br>同步 API。 |
12
15
  | [getSystemSetting](#getsystemsetting) | 获取设备设置。 |
13
16
  | [getAppAuthorizeSetting](#getappauthorizesetting) | 获取豆包客户端的系统授权设置。 调用只读取当前系统授权状态,不会申请权限或触发系统授权弹窗。原有状态字段固定返回 authorized、denied 或 not determined,精细授权字段用于区分部分、只读、只写、前后台等能力。 |
@@ -21,6 +24,288 @@
21
24
 
22
25
  ## API 详情
23
26
 
27
+ <a id="getcontainerinfosync"></a>
28
+ ### getContainerInfoSync()
29
+
30
+ ---
31
+ internal: true
32
+ ---
33
+
34
+ # getContainerInfoSync
35
+
36
+ 同步获取当前渲染容器的尺寸信息。
37
+
38
+ 同时支持 Page(含全屏、半屏)和 Widget(卡片)容器。
39
+
40
+ ## 支持版本
41
+
42
+ 前端库版本不低于 `0.11.0`。
43
+
44
+ ## 支持平台
45
+
46
+ <table>
47
+ <thead>
48
+ <tr><th>平台</th><th>支持情况</th></tr>
49
+ </thead>
50
+ <tbody>
51
+ <tr><td>Android</td><td>支持</td></tr>
52
+ <tr><td>iOS</td><td>支持</td></tr>
53
+ <tr><td>PC</td><td>不支持</td></tr>
54
+ <tr><td>HarmonyOS</td><td>不支持</td></tr>
55
+ </tbody>
56
+ </table>
57
+
58
+ ## 支持场景
59
+
60
+ <table>
61
+ <thead>
62
+ <tr><th>场景</th><th>支持情况</th></tr>
63
+ </thead>
64
+ <tbody>
65
+ <tr><td>页面</td><td>支持</td></tr>
66
+ <tr><td>卡片</td><td>支持</td></tr>
67
+ </tbody>
68
+ </table>
69
+
70
+ ## 使用说明
71
+
72
+ - Widget 首屏渲染前测量完成时 height 可能为 0,需结合 onContainerResize 或 useContainerInfo 感知变化。
73
+
74
+ ## 调用方式
75
+
76
+ ### 同步 API
77
+
78
+ ```typescript
79
+ getContainerInfoSync(_params?: object): GetContainerInfoResult
80
+ ```
81
+
82
+ ## 入参
83
+
84
+ 无。
85
+
86
+ ## 调用示例
87
+
88
+ ```typescript
89
+ import { getContainerInfoSync } from '@doubao-dev/framework/api';
90
+
91
+ const info = getContainerInfoSync();
92
+ console.log(info.containerType, info.width, info.height);
93
+ ```
94
+
95
+ ## 返回值
96
+
97
+ <table>
98
+ <thead>
99
+ <tr><th>名称</th><th>类型</th><th>必返</th><th>说明</th></tr>
100
+ </thead>
101
+ <tbody>
102
+ <tr><td><code>containerType</code></td><td><code>ContainerType</code></td><td>是</td><td>当前容器类型</td></tr>
103
+ <tr><td><code>height</code></td><td><code>number</code></td><td>是</td><td>当前容器高度,单位为逻辑像素;Widget 首屏渲染前未测量完成时可能为 0</td></tr>
104
+ <tr><td><code>pixelRatio</code></td><td><code>number</code></td><td>是</td><td>设备像素比,物理像素 = 逻辑像素 × pixelRatio</td></tr>
105
+ <tr><td><code>width</code></td><td><code>number</code></td><td>是</td><td>当前容器可用宽度,单位为逻辑像素;Page 为窗口或半屏宽度,Widget 为卡片容器宽度</td></tr>
106
+ </tbody>
107
+ </table>
108
+
109
+ ### 返回示例
110
+
111
+ ```json
112
+ {
113
+ "containerType": "widget",
114
+ "width": 328,
115
+ "height": 200,
116
+ "pixelRatio": 3
117
+ }
118
+ ```
119
+
120
+ <a id="getcontainerinfo"></a>
121
+ ### getContainerInfo()
122
+
123
+ ---
124
+ internal: true
125
+ ---
126
+
127
+ # getContainerInfo
128
+
129
+ 异步获取当前渲染容器的尺寸信息。
130
+
131
+ 同时支持 Page(含全屏、半屏)和 Widget(卡片)容器。
132
+
133
+ ## 支持版本
134
+
135
+ 前端库版本不低于 `0.11.0`。
136
+
137
+ ## 支持平台
138
+
139
+ <table>
140
+ <thead>
141
+ <tr><th>平台</th><th>支持情况</th></tr>
142
+ </thead>
143
+ <tbody>
144
+ <tr><td>Android</td><td>支持</td></tr>
145
+ <tr><td>iOS</td><td>支持</td></tr>
146
+ <tr><td>PC</td><td>不支持</td></tr>
147
+ <tr><td>HarmonyOS</td><td>不支持</td></tr>
148
+ </tbody>
149
+ </table>
150
+
151
+ ## 支持场景
152
+
153
+ <table>
154
+ <thead>
155
+ <tr><th>场景</th><th>支持情况</th></tr>
156
+ </thead>
157
+ <tbody>
158
+ <tr><td>页面</td><td>支持</td></tr>
159
+ <tr><td>卡片</td><td>支持</td></tr>
160
+ </tbody>
161
+ </table>
162
+
163
+ ## 使用说明
164
+
165
+ - 该接口封装 getContainerInfoSync 的结果;无需 Promise 形式时可直接使用 getContainerInfoSync。
166
+
167
+ ## 调用方式
168
+
169
+ ### 异步 API
170
+
171
+ ```typescript
172
+ getContainerInfo(_params?: object): Promise<GetContainerInfoResult>
173
+ ```
174
+
175
+ ## 入参
176
+
177
+ 无。
178
+
179
+ ## 调用示例
180
+
181
+ ```typescript
182
+ import { getContainerInfo } from '@doubao-dev/framework/api';
183
+
184
+ const info = await getContainerInfo();
185
+ console.log(info.containerType, info.width, info.height);
186
+ ```
187
+
188
+ ## 成功返回
189
+
190
+ <table>
191
+ <thead>
192
+ <tr><th>名称</th><th>类型</th><th>必返</th><th>说明</th></tr>
193
+ </thead>
194
+ <tbody>
195
+ <tr><td><code>containerType</code></td><td><code>ContainerType</code></td><td>是</td><td>当前容器类型</td></tr>
196
+ <tr><td><code>height</code></td><td><code>number</code></td><td>是</td><td>当前容器高度,单位为逻辑像素;Widget 首屏渲染前未测量完成时可能为 0</td></tr>
197
+ <tr><td><code>pixelRatio</code></td><td><code>number</code></td><td>是</td><td>设备像素比,物理像素 = 逻辑像素 × pixelRatio</td></tr>
198
+ <tr><td><code>width</code></td><td><code>number</code></td><td>是</td><td>当前容器可用宽度,单位为逻辑像素;Page 为窗口或半屏宽度,Widget 为卡片容器宽度</td></tr>
199
+ </tbody>
200
+ </table>
201
+
202
+ ### 返回示例
203
+
204
+ ```json
205
+ {
206
+ "containerType": "widget",
207
+ "width": 328,
208
+ "height": 200,
209
+ "pixelRatio": 3
210
+ }
211
+ ```
212
+
213
+ <a id="oncontainerresize"></a>
214
+ ### onContainerResize()
215
+
216
+ ---
217
+ internal: true
218
+ ---
219
+
220
+ # onContainerResize
221
+
222
+ 监听当前渲染容器尺寸变化。
223
+
224
+ 使用与 getContainerInfoSync 相同的数据源,仅在容器宽度或高度变化时触发,注册时不触发回调。
225
+
226
+ ## 支持版本
227
+
228
+ 前端库版本不低于 `0.11.0`。
229
+
230
+ ## 支持平台
231
+
232
+ <table>
233
+ <thead>
234
+ <tr><th>平台</th><th>支持情况</th></tr>
235
+ </thead>
236
+ <tbody>
237
+ <tr><td>Android</td><td>支持</td></tr>
238
+ <tr><td>iOS</td><td>支持</td></tr>
239
+ <tr><td>PC</td><td>不支持</td></tr>
240
+ <tr><td>HarmonyOS</td><td>不支持</td></tr>
241
+ </tbody>
242
+ </table>
243
+
244
+ ## 支持场景
245
+
246
+ <table>
247
+ <thead>
248
+ <tr><th>场景</th><th>支持情况</th></tr>
249
+ </thead>
250
+ <tbody>
251
+ <tr><td>页面</td><td>支持</td></tr>
252
+ <tr><td>卡片</td><td>支持</td></tr>
253
+ </tbody>
254
+ </table>
255
+
256
+ ## 使用说明
257
+
258
+ - 注册时不会立即触发回调;若需在首屏异步测量场景同步初始尺寸,请配合 getContainerInfoSync 或直接改用 useContainerInfo;不再需要监听时调用返回的函数取消监听。
259
+
260
+ ## 调用方式
261
+
262
+ ### 事件监听 API
263
+
264
+ ```typescript
265
+ onContainerResize(callback: ContainerResizeListener): () => void
266
+ ```
267
+
268
+ ## 入参
269
+
270
+ 无。
271
+
272
+ ## 调用示例
273
+
274
+ ```typescript
275
+ import { onContainerResize } from '@doubao-dev/framework/api';
276
+
277
+ const offContainerResize = onContainerResize(({ width, height }) => {
278
+ console.log(width, height);
279
+ });
280
+
281
+ offContainerResize();
282
+ ```
283
+
284
+ ## 回调参数
285
+
286
+ <table>
287
+ <thead>
288
+ <tr><th>名称</th><th>类型</th><th>必返</th><th>说明</th></tr>
289
+ </thead>
290
+ <tbody>
291
+ <tr><td><code>event.height</code></td><td><code>number</code></td><td>是</td><td>变化后的容器高度,单位为逻辑像素。</td></tr>
292
+ <tr><td><code>event.width</code></td><td><code>number</code></td><td>是</td><td>变化后的容器宽度,单位为逻辑像素。</td></tr>
293
+ </tbody>
294
+ </table>
295
+
296
+ ## 返回值
297
+
298
+ 取消当前监听的函数。
299
+
300
+ ### 回调示例
301
+
302
+ ```json
303
+ {
304
+ "width": 328,
305
+ "height": 200
306
+ }
307
+ ```
308
+
24
309
  <a id="getwindowinfosync"></a>
25
310
  ### getWindowInfoSync()
26
311
 
@@ -1194,6 +1479,44 @@ offWindowResize();
1194
1479
 
1195
1480
  ## 相关类型
1196
1481
 
1482
+ <a id="containertype"></a>
1483
+ ### ContainerType
1484
+
1485
+ 容器类型。
1486
+
1487
+ #### Type
1488
+
1489
+ `'page' | 'widget'`
1490
+
1491
+ <a id="getcontainerinforesult"></a>
1492
+ ### GetContainerInfoResult
1493
+
1494
+ #### Properties
1495
+
1496
+ • **containerType**: `ContainerType` - 当前容器类型
1497
+ • **width**: `number` - 当前容器可用宽度,单位为逻辑像素;Page 为窗口或半屏宽度,Widget 为卡片容器宽度
1498
+ • **height**: `number` - 当前容器高度,单位为逻辑像素;Widget 首屏渲染前未测量完成时可能为 0
1499
+ • **pixelRatio**: `number` - 设备像素比,物理像素 = 逻辑像素 × pixelRatio
1500
+
1501
+ <a id="containerresizelistener"></a>
1502
+ ### ContainerResizeListener
1503
+
1504
+ 容器尺寸变化监听函数。
1505
+
1506
+ #### Type
1507
+
1508
+ `(event: ContainerResizeEvent) => void`
1509
+
1510
+ <a id="containerresizeevent"></a>
1511
+ ### ContainerResizeEvent
1512
+
1513
+ 容器尺寸变化事件。
1514
+
1515
+ #### Properties
1516
+
1517
+ • **width**: `number` - 变化后的容器宽度,单位为逻辑像素
1518
+ • **height**: `number` - 变化后的容器高度,单位为逻辑像素
1519
+
1197
1520
  <a id="windowsafearea"></a>
1198
1521
  ### WindowSafeArea
1199
1522
 
@@ -7,7 +7,7 @@
7
7
  | 分组 | 说明 | API 数量 | 详细文档 |
8
8
  | --- | --- | ---: | --- |
9
9
  | 基础 | 账号、授权、豆包客户端信息、窗口信息和能力可用性。 | 10 | [查看](./01-基础.md) |
10
- | 系统 | 豆包客户端信息、窗口信息和系统设置。 | 10 | [查看](./02-系统.md) |
10
+ | 系统 | 豆包客户端信息、窗口信息和系统设置。 | 13 | [查看](./02-系统.md) |
11
11
  | 自定义通信 | 在应用插件的页面或卡片实例之间发送和接收自定义事件。 | 1 | [查看](./03-自定义通信.md) |
12
12
  | 定位 | 获取设备当前的地理位置信息。 | 5 | [查看](./04-定位.md) |
13
13
  | 存储 | 本地缓存;带 Sync 后缀的是同步 API。 | 10 | [查看](./05-存储.md) |
@@ -2,7 +2,7 @@
2
2
 
3
3
  > 这是豆包应用插件运行时 API,也称 Open API。默认从 `@doubao-dev/framework/api` 导入;本文件根据 `packages/open-api/src` 的导出结构自动生成,按模块列出 API 名称和说明。
4
4
 
5
- 覆盖 162 个函数。详细参数、返回值、示例和相关类型请查看 [豆包应用插件的端能力 API 分组目录](groups.md),精确字段也可按参数/结果类型名查看 IDE 类型提示或 `@doubao-dev/framework/api` 类型定义。
5
+ 覆盖 165 个函数。详细参数、返回值、示例和相关类型请查看 [豆包应用插件的端能力 API 分组目录](groups.md),精确字段也可按参数/结果类型名查看 IDE 类型提示或 `@doubao-dev/framework/api` 类型定义。
6
6
 
7
7
  ## 使用方式
8
8
 
@@ -55,6 +55,9 @@ import { showToast, request, getStorage } from '@doubao-dev/framework/api';
55
55
 
56
56
  | API | 说明 |
57
57
  | --- | --- |
58
+ | [getContainerInfoSync](02-系统.md#getcontainerinfosync) | 同步获取当前渲染容器的尺寸信息。 同时支持 Page(含全屏、半屏)和 Widget(卡片)容器。<br><br>同步 API。 |
59
+ | [getContainerInfo](02-系统.md#getcontainerinfo) | 异步获取当前渲染容器的尺寸信息。 同时支持 Page(含全屏、半屏)和 Widget(卡片)容器。 |
60
+ | [onContainerResize](02-系统.md#oncontainerresize) | 监听当前渲染容器尺寸变化。 使用与 getContainerInfoSync 相同的数据源,仅在容器宽度或高度变化时触发,注册时不触发回调。<br><br>返回取消监听函数。 |
58
61
  | [getWindowInfoSync](02-系统.md#getwindowinfosync) | 获取窗口信息。<br><br>同步 API。 |
59
62
  | [getSystemSetting](02-系统.md#getsystemsetting) | 获取设备设置。 |
60
63
  | [getAppAuthorizeSetting](02-系统.md#getappauthorizesetting) | 获取豆包客户端的系统授权设置。 调用只读取当前系统授权状态,不会申请权限或触发系统授权弹窗。原有状态字段固定返回 authorized、denied 或 not determined,精细授权字段用于区分部分、只读、只写、前后台等能力。 |
@@ -38,16 +38,16 @@
38
38
 
39
39
  ## Tag — 标签展示组件
40
40
 
41
- `import { Tag, type TagProps, type TagTone, type TagValue } from '@doubao-dev/template/primitives'`
41
+ `import { Tag, type TagItem, type TagProps, type TagTone, type TagValue } from '@doubao-dev/template/primitives'`
42
42
 
43
43
  `Tag` 用于卡片内容中的营销或常规辅助标签,不是独立卡片模板。
44
44
 
45
45
  | Prop | 类型 | 说明 |
46
46
  |------|------|------|
47
- | `text` | `string \| number` | 标签内容,不截断 |
47
+ | `text` | `string \| number \| readonly TagItem[]` | 标签内容或标签数组;数组项为 `{ text, tone? }` |
48
48
  | `tone` | `'marketing' \| 'neutral'` | 营销橙色或常规灰色,默认 `neutral`;旧值 `authority` 已废弃,仅保留兼容,按 `neutral` 显示 |
49
49
 
50
- 多个标签由业务容器横向排列,标签间距为 4px,容器高度为 26px;标签内容不会收缩或截断,空间不足时由业务容器隐藏放不下的整枚标签。
50
+ 数组由 Tag 自行横向排列,间距 4px,高度 26px(上下各 3px),只显示第一行;空字符串项跳过,空数组不渲染。单值保持 20px 高度。每项 tone 不传时继承外层 tone;数组中的标签也适配深浅色模式。避免传入比整个容器还宽的单枚标签。
51
51
 
52
52
  ---
53
53
 
@@ -91,13 +91,14 @@
91
91
 
92
92
  ## Price — 价格展示组件
93
93
 
94
- `import { Price, type PricePrefixTone, type PriceProps, type PriceTone, type PriceValue } from '@doubao-dev/template/primitives'`
94
+ `import { Price, type PricePrefixTone, type PriceProps, type PriceSize, type PriceTone, type PriceValue } from '@doubao-dev/template/primitives'`
95
95
 
96
96
  `Price` 用于卡片内容中的价格排版,不是独立卡片模板。
97
97
 
98
98
  | Prop | 类型 | 说明 |
99
99
  |------|------|------|
100
100
  | `value` | `string \| number` | 价格值;字符串保留前导零和末尾小数位 |
101
+ | `size` | `'md' \| 'sm'` | 默认 md 保持原样;sm 高 20px,现价和原价均为系统字体 13px、19.5px 行高;现价字重 500,原价字重 400、灰色删除线 |
101
102
  | `currency` | `string` | 币种符号,默认 `¥`;空字符串隐藏 |
102
103
  | `prefix` / `suffix` | `string` | 价格前缀 / 后缀 |
103
104
  | `prefixTone` | `'default' \| 'highlight' \| 'muted'` | 前缀主文字色 / 豆包蓝 / `--neutral-70` 次级灰色;不传时跟随价格色调 |
@@ -128,7 +129,7 @@
128
129
 
129
130
  ## CompositeCard — 组合卡
130
131
 
131
- `import { CompositeCard, type CompositeCardContentSection, type CompositeCardCustomSection, type CompositeCardHeaderProps, type CompositeCardOptionGroupSection, type CompositeCardProps, type CompositeCardSection, type CompositeCardTransitSection } from '@doubao-dev/template'`
132
+ `import { CompositeCard, type CompositeCardContentSection, type CompositeCardCustomSection, type CompositeCardHeaderProps, type CompositeCardOptionGroupSection, type CompositeCardProductItem, type CompositeCardProductProps, type CompositeCardProductSection, type CompositeCardProps, type CompositeCardSection, type CompositeCardTransitSection } from '@doubao-dev/template'`
132
133
 
133
134
  | Prop | 类型 | 说明 |
134
135
  |------|------|------|
@@ -140,13 +141,15 @@
140
141
  当前白名单:
141
142
 
142
143
  - `CompositeCardTransitSection`:`{ type: 'transit', props: { items?: TransitCardItem[] } }`。
143
- - `CompositeCardContentSection`:`{ type: 'content', props: { items?: ContentCardItem[] } }`;只复用 ContentCard 的内容区域,不渲染其卡片外壳、header 或 footer。
144
+ - `CompositeCardContentSection`:`{ type: 'content', props: { items?: ContentCardItem[], topBar?: ContentCardTopBarProps } }`;只复用 ContentCard 的内容区域及列表上方的信息栏,不渲染其卡片外壳、header 或 footer。
144
145
  - `CompositeCardOptionGroupSection`:`{ type: 'option-group', props: OptionGroupProps }`。
146
+ - `CompositeCardProductSection`:`{ type: 'product', props: { items: CompositeCardProductItem[] } }`;仅展示前三项,始终三等分列宽,不足三个时保留空列。左右、下方 12px,列间距 8px;图片为随列宽缩放的正方形,标题单行省略,价格使用 Price size="sm"。
147
+ - `CompositeCardProductItem`:`key?`、`title: TemplateText`、`imageSrc?: string`、`price?: Pick<PriceProps, 'value' | 'currency' | 'originalPrice' | 'tone'>`、`onClick?: (event: TouchEvent) => void`;有回调时整项点击上报并阻止冒泡,没有回调时保留根节点点击。
145
148
  - `CompositeCardCustomSection`:`{ type: 'custom', content: ReactElement }`;传入业务内容组件,外壳、header 和 footer 仍由模板管理。
146
149
 
147
150
  `props` 透传给对应模块,因此模块原有的回调和具名内容字段仍然有效;只有 `custom.content` 支持业务组件及其内容区样式。其他 section 不开放 `children`、任意 JSX、布局参数或 wrapper 样式,也不提供独立标题字段。标题、说明等普通信息通过 `content` section 表达。业务样式不能覆盖模板外壳、header、footer 或模板类名。卡片统一管理标准 header/footer,复用模块保留原有内容留白、内部布局与窄屏策略;`OptionGroup` 由组合卡内的专用容器补充左右 12px、下方 16px,上方不额外留白。
148
151
 
149
- `items` 为空的 section 会连同间距一起收起;运行时未知 `type` 不展示。`sections` 不支持运行中插入、删除或重排,不要求配置 section key。
152
+ `items` 为空的 section 会连同间距一起收起;`content` section 配置了 `topBar` 时仍展示该信息栏。运行时未知 `type` 不展示。`sections` 不支持运行中插入、删除或重排,不要求配置 section key。
150
153
 
151
154
  ---
152
155
 
@@ -173,11 +176,12 @@ MapCard 的 `ref` 直接绑定到内部 Map,可通过 `MapRef` 调用地图实
173
176
 
174
177
  ## ContentCard — 列表卡
175
178
 
176
- `import { ContentCard, type ContentCardItem, type ContentCardProps, type TemplateExtraAction, type TemplateCardHeaderProps, type TemplateCardFooterProps } from '@doubao-dev/template'`
179
+ `import { ContentCard, type ContentCardItem, type ContentCardProps, type ContentCardTopBarProps, type TemplateExtraAction, type TemplateCardHeaderProps, type TemplateCardFooterProps } from '@doubao-dev/template'`
177
180
 
178
181
  | Prop | 类型 | 说明 |
179
182
  |------|------|------|
180
183
  | `header` | `TemplateCardHeaderProps` | 标题栏配置 |
184
+ | `topBar` | `ContentCardTopBarProps` | 内容列表上方的业务信息栏:`title: TemplateText` 左侧文字,`extra?: TemplateText` 右侧补充文字;只接受字符串或数字,两侧单行超出省略,不传时不占空间 |
181
185
  | `items` | `ContentCardItem[]` | 列表数据,全量展示 |
182
186
  | `footer` | `TemplateCardFooterProps` | 底部操作区配置 |
183
187
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@doubao-dev/plugin-app-dev",
3
- "version": "1.0.0-rc.14",
3
+ "version": "1.0.0-rc.16",
4
4
  "description": "App development tools for Doubao Plugin CLI",
5
5
  "type": "module",
6
6
  "exports": {
@@ -27,7 +27,7 @@
27
27
  "zod": "4.2.0"
28
28
  },
29
29
  "devDependencies": {
30
- "@byted-doubao-apps/plugin-app-dev": "1.0.0-rc.14",
30
+ "@byted-doubao-apps/plugin-app-dev": "1.0.0-rc.16",
31
31
  "@rslib/core": "1.0.0-beta.1",
32
32
  "@types/node": "22.20.4",
33
33
  "rimraf": "3.0.2",