@heybox/hb-sdk 0.9.1-alpha.11 → 0.9.1-alpha.12

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 (30) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/README.md +1 -1
  3. package/dist/cli-chunks/{build-CSTdWNu1.cjs → build-CDvX6mZ_.cjs} +5 -5
  4. package/dist/cli-chunks/{context-Bej2XR0w.cjs → context-ycfj98q4.cjs} +2 -2
  5. package/dist/cli-chunks/{create-Cz5tqvMR.cjs → create-TQBnsU6A.cjs} +1 -1
  6. package/dist/cli-chunks/{dev-6nGC0_bZ.cjs → dev-DIlr0XsT.cjs} +8 -8
  7. package/dist/cli-chunks/{doctor-BSSJ7n8i.cjs → doctor-CNvx5BMQ.cjs} +1 -1
  8. package/dist/cli-chunks/{index-CQtu_5c7.cjs → index-B7zxtWTI.cjs} +16 -16
  9. package/dist/cli-chunks/{index-gqsUj-Am.cjs → index-CPAecgVy.cjs} +1 -1
  10. package/dist/cli-chunks/{index.esm-BuwSVK1U.cjs → index.esm-CshHset7.cjs} +6 -6
  11. package/dist/cli-chunks/{login-BB07gOy9.cjs → login-D9IsRXmh.cjs} +1 -1
  12. package/dist/cli-chunks/{project-vite-DqbyiCMm.cjs → project-vite-B4bIN6iT.cjs} +1 -1
  13. package/dist/cli-chunks/{remote-BvvAbGIG.cjs → remote-DeUMkvWX.cjs} +6 -6
  14. package/dist/cli-chunks/{runtime-gate-Bh1vm1an.cjs → runtime-gate-C8LOiCNj.cjs} +2 -2
  15. package/dist/cli-chunks/{runtime-permission-env-DuRchECp.cjs → runtime-permission-env-DJh53zIV.cjs} +2 -2
  16. package/dist/cli-chunks/{skill-D1pYV7g_.cjs → skill-5dzzu2QT.cjs} +2 -2
  17. package/dist/cli-chunks/{version-BaMa3UQg.cjs → version-DJMVnGTf.cjs} +1 -1
  18. package/dist/cli.cjs +1 -1
  19. package/dist/devtools/browser-dev-host/assets/{browser-dev-host-wMCyX_zc.js → browser-dev-host-WX0SWy37.js} +12 -12
  20. package/dist/devtools/browser-dev-host/assets/{desktop-app-launch-D1z3MxUY.js → desktop-app-launch-F0wNWGvm.js} +1 -1
  21. package/dist/devtools/browser-dev-host/assets/{index-CuH8wWTJ.js → index-BdfQ_aP4.js} +3 -3
  22. package/dist/devtools/browser-dev-host/index.html +2 -2
  23. package/dist/index.cjs.js +7 -1
  24. package/dist/index.esm.js +7 -1
  25. package/dist/vite.cjs.js +1 -1
  26. package/dist/vite.esm.js +1 -1
  27. package/package.json +4 -4
  28. package/skill/SKILL.md +10 -0
  29. package/skill/skill.json +5 -5
  30. package/types/index.d.ts +6 -1
@@ -5,8 +5,8 @@
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
6
  <meta name="theme-color" content="#f4f5f7" />
7
7
  <title>小程序工坊调试台</title>
8
- <script type="module" crossorigin src="/assets/index-CuH8wWTJ.js"></script>
9
- <link rel="modulepreload" crossorigin href="/assets/desktop-app-launch-D1z3MxUY.js">
8
+ <script type="module" crossorigin src="/assets/index-BdfQ_aP4.js"></script>
9
+ <link rel="modulepreload" crossorigin href="/assets/desktop-app-launch-F0wNWGvm.js">
10
10
  <link rel="stylesheet" crossorigin href="/assets/index-BRxbUJVN.css">
11
11
  </head>
12
12
  <body>
package/dist/index.cjs.js CHANGED
@@ -7278,7 +7278,7 @@ function createMessageId() {
7278
7278
  /** 构建时替换为当前发布包的实际版本。 */
7279
7279
  const HB_SDK_VERSION = typeof undefined === 'string'
7280
7280
  ? undefined
7281
- : '0.9.1-alpha.11';
7281
+ : '0.9.1-alpha.12';
7282
7282
 
7283
7283
  const RUNTIME_MODES = new Set(['production', 'preview', 'development', 'unknown']);
7284
7284
  const OPERATING_SYSTEM_NAMES = new Set(['android', 'ios', 'ohos', 'windows', 'macos', 'linux', 'unknown']);
@@ -10270,6 +10270,12 @@ function decodeBase64Url(value) {
10270
10270
  * @see {@link MiniProgramScreenshotOptions}
10271
10271
  */
10272
10272
  function screenshot(requester, options) {
10273
+ try {
10274
+ console.warn('[hb-sdk] share.screenshot 行为变更提醒:正式版 SDK 0.9.1 及以上默认添加小程序品牌水印;低于 0.9.1(含预发布版本)的 SDK 保持无水印截图。升级前请在目标截图区域底部预留至少 57 个逻辑像素,避免遮挡重要内容;watermarkTheme 的 light 为黑色水印,dark 为白色水印且是默认值,不自动跟随系统主题。系统按键截图不在此能力范围内。');
10275
+ }
10276
+ catch {
10277
+ // 日志输出失败不能阻断截图调用。
10278
+ }
10273
10279
  return requester.request(SHARE_SCREENSHOT_METHOD, options);
10274
10280
  }
10275
10281
 
package/dist/index.esm.js CHANGED
@@ -7274,7 +7274,7 @@ function createMessageId() {
7274
7274
  /** 构建时替换为当前发布包的实际版本。 */
7275
7275
  const HB_SDK_VERSION = typeof undefined === 'string'
7276
7276
  ? undefined
7277
- : '0.9.1-alpha.11';
7277
+ : '0.9.1-alpha.12';
7278
7278
 
7279
7279
  const RUNTIME_MODES = new Set(['production', 'preview', 'development', 'unknown']);
7280
7280
  const OPERATING_SYSTEM_NAMES = new Set(['android', 'ios', 'ohos', 'windows', 'macos', 'linux', 'unknown']);
@@ -10266,6 +10266,12 @@ function decodeBase64Url(value) {
10266
10266
  * @see {@link MiniProgramScreenshotOptions}
10267
10267
  */
10268
10268
  function screenshot(requester, options) {
10269
+ try {
10270
+ console.warn('[hb-sdk] share.screenshot 行为变更提醒:正式版 SDK 0.9.1 及以上默认添加小程序品牌水印;低于 0.9.1(含预发布版本)的 SDK 保持无水印截图。升级前请在目标截图区域底部预留至少 57 个逻辑像素,避免遮挡重要内容;watermarkTheme 的 light 为黑色水印,dark 为白色水印且是默认值,不自动跟随系统主题。系统按键截图不在此能力范围内。');
10271
+ }
10272
+ catch {
10273
+ // 日志输出失败不能阻断截图调用。
10274
+ }
10269
10275
  return requester.request(SHARE_SCREENSHOT_METHOD, options);
10270
10276
  }
10271
10277
 
package/dist/vite.cjs.js CHANGED
@@ -10282,7 +10282,7 @@ async function ensureBasicInfoDirectory(rootPath, relative) {
10282
10282
  /** 构建时替换为当前发布包的实际版本。 */
10283
10283
  const HB_SDK_VERSION = typeof undefined === 'string'
10284
10284
  ? undefined
10285
- : '0.9.1-alpha.11';
10285
+ : '0.9.1-alpha.12';
10286
10286
 
10287
10287
  /**
10288
10288
  * iframe 与调试台页面的开发期 console 捕获转发。
package/dist/vite.esm.js CHANGED
@@ -10279,7 +10279,7 @@ async function ensureBasicInfoDirectory(rootPath, relative) {
10279
10279
  /** 构建时替换为当前发布包的实际版本。 */
10280
10280
  const HB_SDK_VERSION = typeof undefined === 'string'
10281
10281
  ? undefined
10282
- : '0.9.1-alpha.11';
10282
+ : '0.9.1-alpha.12';
10283
10283
 
10284
10284
  /**
10285
10285
  * iframe 与调试台页面的开发期 console 捕获转发。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@heybox/hb-sdk",
3
- "version": "0.9.1-alpha.11",
3
+ "version": "0.9.1-alpha.12",
4
4
  "sideEffects": [
5
5
  "./src/index.ts",
6
6
  "./src/core/singleton.ts",
@@ -76,7 +76,7 @@
76
76
  "undici": "^7.28.0",
77
77
  "ws": "^8.18.0",
78
78
  "sharp": "^0.34.5",
79
- "@heybox/hb-sdk-protocol": "0.9.1-alpha.11"
79
+ "@heybox/hb-sdk-protocol": "0.9.1-alpha.12"
80
80
  },
81
81
  "peerDependencies": {
82
82
  "vite": ">=5"
@@ -129,11 +129,11 @@
129
129
  "@ai-desktop/view-contract": "file:../hb-sdk-protocol/vendor/view-contract-2.2.2-6ac49bbf6410.tgz",
130
130
  "rollup-plugin-dts": "6.4.0",
131
131
  "@heybox-domain/heybox-theme": "~0.1.0",
132
- "@heybox/hb-sdk-runtime": "~0.9.1-alpha.11",
133
- "@heybox/hb-api": "~1.28.14",
134
132
  "@heybox-domain/heybox-vue3-ui": "~0.1.0",
133
+ "@heybox/hb-sdk-runtime": "~0.9.1-alpha.12",
135
134
  "@heybox/runtime": "~0.2.1",
136
135
  "@heybox/runtime-policy": "~0.2.1",
136
+ "@heybox/hb-api": "~1.28.14",
137
137
  "@heybox/runtime-transport-fetch": "~0.2.1"
138
138
  },
139
139
  "publishConfig": {
package/skill/SKILL.md CHANGED
@@ -7,6 +7,16 @@ description: Uses @heybox/hb-sdk and the hb-sdk CLI to build, debug, review, and
7
7
 
8
8
  Use this Skill for workshop mini-program application code, project declarations, public SDK APIs, CLI workflows, Host/Runtime protocol maintenance, and publishing review.
9
9
 
10
+ ## Screenshot API Changes: Mandatory Upgrade Checks
11
+
12
+ Before implementing screenshot flows or upgrading the SDK, use the canonical documentation index to read the screenshot Reference, community-sharing Recipe, and upgrade notes. Explicitly explain these changes to the developer:
13
+
14
+ - Check the installed SDK against the watermark version cutoff, including prerelease ordering. Explain the warning emitted by the SDK screenshot entry and the Runtime's compatibility behavior for legacy screenshots versus the default watermark behavior for newer SDKs.
15
+ - Check the required reserved area at the bottom of the capture region, the content that must remain unobstructed, and the corresponding rules for custom capture rectangles.
16
+ - Check the light/dark theme option, default colors, system-theme behavior, and the support boundary between SDK screenshots and physical-button screenshots.
17
+
18
+ Before upgrading, verify both the page layout and the captured image. Do not only update the dependency or invocation without explaining screenshot behavior changes. Read exact version cutoffs, dimensions, parameters, and Host support from the canonical documentation fetched for this task; never substitute an older installed Skill snapshot.
19
+
10
20
  ## Canonical Documentation
11
21
 
12
22
  The only maintained hb-sdk guidance source is:
package/skill/skill.json CHANGED
@@ -1,16 +1,16 @@
1
1
  {
2
2
  "name": "hb-sdk",
3
- "skillVersion": "0.9.1-alpha.11+skill.3260e7d71ada",
3
+ "skillVersion": "0.9.1-alpha.12+skill.c3a240ca503a",
4
4
  "sdk": {
5
5
  "package": "@heybox/hb-sdk",
6
- "version": "0.9.1-alpha.11",
7
- "compatibility": "0.9.1-alpha.11"
6
+ "version": "0.9.1-alpha.12",
7
+ "compatibility": "0.9.1-alpha.12"
8
8
  },
9
9
  "distribution": {
10
10
  "type": "npm",
11
11
  "package": "@heybox/hb-sdk",
12
- "version": "0.9.1-alpha.11",
12
+ "version": "0.9.1-alpha.12",
13
13
  "path": "skill"
14
14
  },
15
- "integrity": "sha256-3260e7d71ada646d5d8b269490e3de4b5ecd3fe824b18cdb73fe64247738ffea"
15
+ "integrity": "sha256-c3a240ca503a1e5f3b15033e091f1fa79a8b70585aa0d8d8fa0b332daec60ac5"
16
16
  }
package/types/index.d.ts CHANGED
@@ -3451,7 +3451,12 @@ interface MiniProgramShareModule {
3451
3451
  * `pixelRatio` 换算,也不把越界矩形夹取到窗口内。JavaScript 的 coercible 非 number 值可能被
3452
3452
  * 当前 Runtime 接受,但这不是 TypeScript 公共合同,不应依赖。
3453
3453
  *
3454
- * Runtime 会在截图区域底部居中叠加「小黑盒 + 搜索图标 + 当前小程序名称」胶囊,
3454
+ * SDK 每次调用都会输出 warning,提醒水印行为变化及布局、配色要求;日志失败不阻断截图。
3455
+ * 新 Runtime 按 Version record 中已校验的 SDK 版本启用水印:低于正式版 `0.9.1`
3456
+ * (包括 `0.9.1-alpha.*`)或兼容模式下版本缺失时,静默保持无水印截图;
3457
+ * `0.9.1` 及以上默认添加水印。升级 SDK 前应同步调整截图布局。
3458
+ *
3459
+ * 启用水印时,Runtime 会在截图区域底部居中叠加「小黑盒 + 搜索图标 + 当前小程序名称」胶囊,
3455
3460
  * 下方显示灰色「小黑盒工坊小程序」。开发者应在目标截图区域底部预留至少 57 个逻辑
3456
3461
  * 像素的空白背景,不放置成绩、正文、按钮等重要内容,并保证背景与所选水印配色
3457
3462
  * 有足够对比度;自定义 `rect` 也按该区域的底部预留。水印不增加图片尺寸,只在本次