@naersen/tts-rich-text 0.12.0 → 0.12.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.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,20 @@
2
2
 
3
3
  本项目遵循 [语义化版本](https://semver.org/lang/zh-CN/)。
4
4
 
5
+ ## 0.12.1 - 2026-11-20
6
+
7
+ ### 修复
8
+
9
+ - 语种标记中日语、韩语的代码由 `jp` / `kr` 改为 ISO 639-1 标准的 `ja` / `ko`。
10
+ - 初始化内容、`setContent()` 和解析 HTML 语种标签时,自动将旧代码 `jp` / `kr` 转换为 `ja` / `ko`,历史草稿无需迁移即可回显。
11
+ - `getTtsData()` / `convertToTtsFormat()` 导出语种指令时同样转换旧代码,合成 `payload` 统一输出 `ja` / `ko`。
12
+ - `@naersen/tts-rich-text/core` 新增导出 `normalizeLanguageCode()` 和 `normalizeTtsContent()`,可在业务侧单独转换旧数据。
13
+
14
+ ### 升级提示
15
+
16
+ - 合成指令中的日语、韩语代码会从 `jp` / `kr` 变为 `ja` / `ko`,请确认后端合成接口已支持新代码。
17
+ - 业务侧如果写死了 `jp` / `kr` 做判断或白名单,需要同步改为 `ja` / `ko`。
18
+
5
19
  ## 0.12.0 - 2026-11-19
6
20
 
7
21
  ### 新增
@@ -82,6 +82,9 @@ export declare const ToneOptions: readonly (LanguageOption & {
82
82
  tag: string;
83
83
  })[];
84
84
  export declare const LanguageOptions: readonly LanguageOption[];
85
+ export declare const normalizeLanguageCode: <T>(code: T) => T | string;
86
+ /** 返回语种标记代码已转换的新内容,不修改入参。 */
87
+ export declare const normalizeTtsContent: <T extends JSONContent>(content: T) => T;
85
88
  export declare const StopOptions: readonly [{
86
89
  readonly label: "停顿 0.5 秒";
87
90
  readonly value: 0.5;