@doubao-dev/framework 0.5.1 → 0.6.0

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/dist/api.d.ts CHANGED
@@ -1044,7 +1044,7 @@ export declare type ChatPanelHeightChangedListener = (event: ChatPanelHeightChan
1044
1044
  */
1045
1045
  export declare interface ChatPanelInfo {
1046
1046
  /**
1047
- * 对话框实际占用的垂直高度,单位为 px,包含被键盘抬高的区域。
1047
+ * 对话框实际占用的垂直高度,单位为 px,包含被键盘抬高的区域,隐藏时为 0。
1048
1048
  *
1049
1049
  * @constraint 大于等于 0;收起态高度也可能大于 0
1050
1050
  */
@@ -2339,6 +2339,60 @@ declare interface CustomEventOptions_2<Params extends object> {
2339
2339
  paramsTypeGuard?: TypeGuard<object, Params>;
2340
2340
  }
2341
2341
 
2342
+ /**
2343
+ * 按标题和原始时间删除全部匹配的系统日历事件。
2344
+ *
2345
+ * @example
2346
+ * ```typescript
2347
+ * import { deletePhoneCalendar } from '@doubao-dev/framework/api';
2348
+ * await deletePhoneCalendar({ title: '项目评审', startTime: 1770000000, endTime: 1770001800 });
2349
+ * ```
2350
+ *
2351
+ * @since 0.6.0
2352
+ * @containerSupport Page | supported
2353
+ * @containerSupport Widget | supported
2354
+ * @platformSupport Android | supported | 支持日历删除。
2355
+ * @platformSupport iOS | supported | 支持日历删除。
2356
+ * @platformSupport PC | unsupported | 暂不支持。
2357
+ * @platformSupport HarmonyOS | unsupported | 暂不支持。
2358
+ * @permission applet | scope.addPhoneCalendar | required | Android,iOS | 复用系统日历写入授权。
2359
+ * @authorizationBehavior Android | 申请应用授权和日历写入权限,拒绝或撤销后调用失败。
2360
+ * @authorizationBehavior iOS | 申请应用授权和日历完整访问权限,拒绝或撤销后调用失败。
2361
+ * @precondition All | 传入创建时的原始参数;重复事件使用系列首个事件的参数。
2362
+ * @usageNote All | 重复事件删除整个系列;事件不存在也成功;暂不支持全天事件。
2363
+ * @errorExample
2364
+ * ```json
2365
+ * {
2366
+ * "errNo": 102,
2367
+ * "errMsg": "internal error"
2368
+ * }
2369
+ * ```
2370
+ * @errorCode errNo | 102 | internal error | Android,iOS | 系统日历存储删除失败 | 稍后重试
2371
+ * @errorCode errNo | 104 | invalid parameter | Android,iOS | 标题或时间参数不合法 | 检查参数
2372
+ * @errorCode errNo | 106 | system permission denied | Android,iOS | 无系统日历权限 | 在系统设置中授权
2373
+ * @errorCode errNo | 107 | user permission denied | Android,iOS | 应用插件授权被拒绝或取消 | 重新授权
2374
+ *
2375
+ * @public
2376
+ */
2377
+ export declare const deletePhoneCalendar: (params: DeletePhoneCalendarParams) => Promise<object>;
2378
+
2379
+ /**
2380
+ * 删除系统日历事件的请求参数。
2381
+ *
2382
+ * @public
2383
+ */
2384
+ export declare interface DeletePhoneCalendarParams {
2385
+ /** 创建时的标题。 */
2386
+ title: string;
2387
+ /** 创建时的开始时间,Unix 秒级时间戳。 */
2388
+ startTime: number;
2389
+ /**
2390
+ * 创建时的结束时间,Unix 秒级时间戳。
2391
+ * @default startTime
2392
+ */
2393
+ endTime?: number;
2394
+ }
2395
+
2342
2396
  /**
2343
2397
  * 设备方向变化事件。
2344
2398
  *
@@ -4538,7 +4592,7 @@ export declare interface GetLocationResponse {
4538
4592
  /**
4539
4593
  * 取菜单按钮(右上角胶囊按钮)的布局位置信息。
4540
4594
  *
4541
- * @returns 获坐标信息以屏幕左上角为原点。字段见 {@link MenuButtonBoundingClientRect}。
4595
+ * @returns 胶囊矩形信息;宿主注入的坐标以页面内容区左上角为原点。字段见 {@link MenuButtonBoundingClientRect}。
4542
4596
  * @example
4543
4597
  * ```ts
4544
4598
  * import { getMenuButtonBoundingClientRect } from '@doubao-dev/framework/api';
@@ -9361,6 +9415,13 @@ export declare interface SetChatPanelStateParams {
9361
9415
  * - `floating`:将对话框切换为悬浮胶囊态。
9362
9416
  */
9363
9417
  state: ChatPanelTargetState;
9418
+ /**
9419
+ * 本次面板状态切换的扩展参数;`show_reason` 指定本次切换的展示原因。
9420
+ *
9421
+ * @default 不指定展示原因
9422
+ * @internal
9423
+ */
9424
+ extra?: Record<string, string>;
9364
9425
  }
9365
9426
 
9366
9427
  /**
package/dist/config.d.ts CHANGED
@@ -82,6 +82,10 @@ declare type AIWidgetMetadata = {
82
82
  };
83
83
 
84
84
  declare interface AppletChatConfig {
85
+ /**
86
+ * App-level chat panel style.
87
+ */
88
+ style?: ChatStyle;
85
89
  /**
86
90
  * App-level chat feature overrides.
87
91
  */
@@ -158,6 +162,10 @@ declare interface BaseModuleDefinition extends BaseDefinition {
158
162
  prop?: string;
159
163
  }
160
164
 
165
+ export declare type ChatStyle = {
166
+ mode: 'normal' | 'alpha' | 'weak';
167
+ };
168
+
161
169
  export declare type DefineAppConfig = (config: DoubaoAppsAppConfig) => DoubaoAppsAppConfig;
162
170
 
163
171
  export declare const defineAppConfig: (config: DoubaoAppsAppConfig) => DoubaoAppsMetaConfig;
package/dist/index.d.ts CHANGED
@@ -263,6 +263,10 @@ declare interface AppBaseInfoHost {
263
263
  }
264
264
 
265
265
  declare interface AppletChatConfig {
266
+ /**
267
+ * App-level chat panel style.
268
+ */
269
+ style?: ChatStyle;
266
270
  /**
267
271
  * App-level chat feature overrides.
268
272
  */
@@ -301,6 +305,10 @@ export { CElement }
301
305
 
302
306
  export { CFactory }
303
307
 
308
+ declare type ChatStyle = {
309
+ mode: 'normal' | 'alpha' | 'weak';
310
+ };
311
+
304
312
  export { ChildContextProvider }
305
313
 
306
314
  export { ClassAttributes }
@@ -1043,6 +1051,17 @@ export declare function useError(callback: LifecycleErrorCallback): void;
1043
1051
 
1044
1052
  export declare function useForeground(callback: LifecycleCallback): void;
1045
1053
 
1054
+ /**
1055
+ * 获取宿主流式注入的累计 OpenUI DSL,并在每次数据更新后刷新。
1056
+ *
1057
+ * 应用无需直接感知 Lynx global event;宿主每次覆盖
1058
+ * `__GEN_UI_CODE__` 后,本 Hook 会返回最新的完整 DSL 字符串。
1059
+ *
1060
+ * @since 0.5.0
1061
+ * @public
1062
+ */
1063
+ export declare function useGenUICode(): string | undefined;
1064
+
1046
1065
  export declare function useHide(callback: LifecycleCallback): void;
1047
1066
 
1048
1067
  export declare function useHostCardStyle(style?: CSSProperties): CSSProperties | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@doubao-dev/framework",
3
- "version": "0.5.1",
3
+ "version": "0.6.0",
4
4
  "type": "module",
5
5
  "types": "./dist/index.d.ts",
6
6
  "exports": {