@skillbuilder/miniapp-simulator 0.2.0 → 0.2.1

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.
@@ -299,6 +299,10 @@ JSON 合并逻辑;Server 不解析 directive、阈值、JSAPI 名称或返回
299
299
  Toast 和浏览器原生 Alert;同一项同时配置两者时 Alert 优先。精确覆盖只负责提示并成功返回空对象,
300
300
  不会合成 API 专属返回字段。宿主显式提供的同名 `hostApi` 优先级最高。
301
301
 
302
+ 仅 `businessLine: "mars"` 配置的 Alert 按 API 和参数组合独立限频,相同 API、相同参数在关闭后 60 秒内不再弹出;被抑制的调用仍正常返回。
303
+ 参数比较忽略对象字段顺序和调用的 `callbackId`,保留数组顺序;不同参数组合独立计时。
304
+ 限频状态在同一模拟器会话内保留,宿主同步 JSAPI 配置不会重置冷却时间。
305
+
302
306
  Runtime 初始化只请求 `/simulator/runtime-config`,响应聚合各个独立配置项。旧 `/simulator/csp`、
303
307
  `/simulator/performance-policy` 接口继续服务已发布 Runtime;新增配置聚合到同一接口,不新增请求。
304
308
 
@@ -96,6 +96,11 @@ JSAPI 配置。`businessLine` 缺失或为空时薄 SDK 会拒绝创建实例。
96
96
  - 优先级为:宿主 `hostApi` → 单 API 远端配置 → `unsupported` → Runtime 默认行为。
97
97
  - 配置在实例连接 Runtime 时读取;配置更新后需要新建模拟器实例才能取得新值。
98
98
 
99
+ 模拟器内置 `vibrateLong()` 和 `vibrateShort({ type })`,通过整台模拟手机横向抖动展示触感反馈:
100
+ 长震动持续 400ms;短震动持续 120ms,`light`、`medium`、`heavy` 分别对应 1px、2px、4px 振幅。
101
+ 短震动缺少 `type` 或取值非法时返回 `10001`。两个 API 均在触发后立即返回成功,不等待动画结束;
102
+ 同一模拟器 100ms 内的重复震动请求合并处理,仍正常回调。未支持 API 的统一提示不影响这两个内置实现。
103
+
99
104
  ## 3. 加载小应用
100
105
 
101
106
  ### 加载 ZIP
@@ -1,4 +1,4 @@
1
- import { c as he, r as ye, v as we, o as ve, e as ge } from "./index-B5oixYXr.mjs";
1
+ import { c as he, r as ye, v as we, o as ve, e as ge } from "./index-DI2oETZ_.mjs";
2
2
  const K = {
3
3
  report() {
4
4
  },
@@ -1,4 +1,4 @@
1
- const E = "0.2.0", _ = /* @__PURE__ */ new Set();
1
+ const E = "0.2.1", _ = /* @__PURE__ */ new Set();
2
2
  function M(e, n) {
3
3
  const t = () => {
4
4
  let s = !document.hidden && e.isConnected;