@heybox/hb-sdk 0.3.3 → 0.4.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.
Files changed (35) hide show
  1. package/README.md +63 -28
  2. package/dist/cli-chunks/browser-RAy8e8cV.cjs +635 -0
  3. package/dist/cli-chunks/create-Ds8A82lV.cjs +1376 -0
  4. package/dist/cli-chunks/deploy-D4uxwB2W.cjs +3730 -0
  5. package/dist/cli-chunks/dev-v-tcA7mM.cjs +955 -0
  6. package/dist/cli-chunks/doctor-C8NP7bow.cjs +186 -0
  7. package/dist/cli-chunks/index-BWrMUHh9.cjs +64023 -0
  8. package/dist/cli-chunks/index-DDqd9qAR.cjs +13348 -0
  9. package/dist/cli-chunks/login-BJVOo-hq.cjs +193 -0
  10. package/dist/cli-chunks/session-Iyxc2AGl.cjs +3040 -0
  11. package/dist/cli.cjs +19 -77707
  12. package/dist/devtools/mock-host/index.html +62 -2
  13. package/dist/devtools/mock-host/main.js +3246 -20
  14. package/dist/index.cjs.js +20 -0
  15. package/dist/index.esm.js +20 -0
  16. package/dist/miniapp-publish.cjs.js +2810 -4
  17. package/dist/miniapp-publish.esm.js +2809 -4
  18. package/dist/protocol.cjs.js +15 -0
  19. package/dist/protocol.esm.js +15 -1
  20. package/dist/templates/vue3-vite-ts/README.md.ejs +6 -2
  21. package/dist/vite.cjs.js +2814 -14
  22. package/dist/vite.esm.js +2814 -14
  23. package/package.json +6 -1
  24. package/skill/SKILL.md +19 -13
  25. package/skill/references/api-protocol.md +7 -2
  26. package/skill/references/api-root.md +24 -13
  27. package/skill/references/cli.md +339 -104
  28. package/skill/scripts/sync-references.mjs +17 -1
  29. package/skill/skill.json +4 -4
  30. package/types/index.d.ts +1 -1
  31. package/types/miniapp-manifest/schema.d.ts +2 -1
  32. package/types/miniapp-publish/index.d.ts +2 -1
  33. package/types/modules/viewport/index.d.ts +33 -0
  34. package/types/protocol/capabilities.d.ts +17 -2
  35. package/types/protocol.d.ts +2 -2
package/dist/index.cjs.js CHANGED
@@ -445,6 +445,13 @@ const SHARE_SCREENSHOT_METHOD = 'share.screenshot';
445
445
  * 供 SDK 与父容器 runtime 共享同一 bridge method 标识。
446
446
  */
447
447
  const VIEWPORT_GET_WINDOW_INFO_METHOD = 'viewport.getWindowInfo';
448
+ /**
449
+ * 设置导航栏样式能力方法名。
450
+ *
451
+ * @remarks
452
+ * 供 SDK 与父容器 runtime 共享同一 bridge method 标识。
453
+ */
454
+ const VIEWPORT_SET_NAVIGATION_BAR_STYLE_METHOD = 'viewport.setNavigationBarStyle';
448
455
  /**
449
456
  * 读取小程序隔离 storage 能力方法名。
450
457
  *
@@ -670,6 +677,17 @@ function createNetworkModule(requester) {
670
677
  function getWindowInfo(requester) {
671
678
  return requester.request(VIEWPORT_GET_WINDOW_INFO_METHOD);
672
679
  }
680
+ /**
681
+ * 设置导航栏关闭按钮与状态栏图标/文字的前景样式。
682
+ *
683
+ * @param requester 底层 bridge 请求能力。
684
+ * @param options 导航栏样式配置。
685
+ * @returns 宿主接受设置后 resolve。
686
+ * @throws {HbMiniProgramSDKError} 当 bridge、父容器或宿主能力调用失败时抛出。
687
+ */
688
+ function setNavigationBarStyle(requester, options) {
689
+ return requester.request(VIEWPORT_SET_NAVIGATION_BAR_STYLE_METHOD, options);
690
+ }
673
691
  /**
674
692
  * 创建 Viewport 模块。
675
693
  *
@@ -679,6 +697,7 @@ function getWindowInfo(requester) {
679
697
  function createViewportModule(requester) {
680
698
  return {
681
699
  getWindowInfo: () => getWindowInfo(requester),
700
+ setNavigationBarStyle: options => setNavigationBarStyle(requester, options),
682
701
  };
683
702
  }
684
703
 
@@ -866,6 +885,7 @@ const share = {
866
885
  /** 默认 SDK 实例的 Viewport 模块。 */
867
886
  const viewport = {
868
887
  getWindowInfo: () => getDefaultSDK().viewport.getWindowInfo(),
888
+ setNavigationBarStyle: options => getDefaultSDK().viewport.setNavigationBarStyle(options),
869
889
  };
870
890
  /** 默认 SDK 实例的 storage 模块。 */
871
891
  const storage = {
package/dist/index.esm.js CHANGED
@@ -441,6 +441,13 @@ const SHARE_SCREENSHOT_METHOD = 'share.screenshot';
441
441
  * 供 SDK 与父容器 runtime 共享同一 bridge method 标识。
442
442
  */
443
443
  const VIEWPORT_GET_WINDOW_INFO_METHOD = 'viewport.getWindowInfo';
444
+ /**
445
+ * 设置导航栏样式能力方法名。
446
+ *
447
+ * @remarks
448
+ * 供 SDK 与父容器 runtime 共享同一 bridge method 标识。
449
+ */
450
+ const VIEWPORT_SET_NAVIGATION_BAR_STYLE_METHOD = 'viewport.setNavigationBarStyle';
444
451
  /**
445
452
  * 读取小程序隔离 storage 能力方法名。
446
453
  *
@@ -666,6 +673,17 @@ function createNetworkModule(requester) {
666
673
  function getWindowInfo(requester) {
667
674
  return requester.request(VIEWPORT_GET_WINDOW_INFO_METHOD);
668
675
  }
676
+ /**
677
+ * 设置导航栏关闭按钮与状态栏图标/文字的前景样式。
678
+ *
679
+ * @param requester 底层 bridge 请求能力。
680
+ * @param options 导航栏样式配置。
681
+ * @returns 宿主接受设置后 resolve。
682
+ * @throws {HbMiniProgramSDKError} 当 bridge、父容器或宿主能力调用失败时抛出。
683
+ */
684
+ function setNavigationBarStyle(requester, options) {
685
+ return requester.request(VIEWPORT_SET_NAVIGATION_BAR_STYLE_METHOD, options);
686
+ }
669
687
  /**
670
688
  * 创建 Viewport 模块。
671
689
  *
@@ -675,6 +693,7 @@ function getWindowInfo(requester) {
675
693
  function createViewportModule(requester) {
676
694
  return {
677
695
  getWindowInfo: () => getWindowInfo(requester),
696
+ setNavigationBarStyle: options => setNavigationBarStyle(requester, options),
678
697
  };
679
698
  }
680
699
 
@@ -862,6 +881,7 @@ const share = {
862
881
  /** 默认 SDK 实例的 Viewport 模块。 */
863
882
  const viewport = {
864
883
  getWindowInfo: () => getDefaultSDK().viewport.getWindowInfo(),
884
+ setNavigationBarStyle: options => getDefaultSDK().viewport.setNavigationBarStyle(options),
865
885
  };
866
886
  /** 默认 SDK 实例的 storage 模块。 */
867
887
  const storage = {