@lumikmz/kmz-file 0.6.3 → 0.7.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.
Files changed (2) hide show
  1. package/dist/index.mjs +23 -2
  2. package/package.json +2 -2
package/dist/index.mjs CHANGED
@@ -94,6 +94,15 @@ function encodeSmartObliquePoint(p) {
94
94
  "wpml:smartObliqueEulerYaw": String(p.smartObliqueEulerYaw)
95
95
  };
96
96
  }
97
+ function encodeTtsParam(p) {
98
+ return {
99
+ text: p.text,
100
+ role: p.role,
101
+ language: p.language,
102
+ volume: String(p.volume),
103
+ speed: String(p.speed)
104
+ };
105
+ }
97
106
  /**
98
107
  * Encode an Action's `actionActuatorFuncParam` block. Each branch lays out the
99
108
  * params with `wpml:` prefixes per the spec; optional fields are omitted when
@@ -281,7 +290,8 @@ function encodeActionParams(action) {
281
290
  "wpml:megaphoneFileName": p.megaphoneFileName,
282
291
  "wpml:megaphoneFileOriginalName": p.megaphoneFileOriginalName,
283
292
  "wpml:megaphoneFileMd5": p.megaphoneFileMd5,
284
- "wpml:megaphoneFileBitrate": String(p.megaphoneFileBitrate)
293
+ "wpml:megaphoneFileBitrate": String(p.megaphoneFileBitrate),
294
+ ...p.ttsparam ? { ttsparam: encodeTtsParam(p.ttsparam) } : {}
285
295
  };
286
296
  }
287
297
  case "searchlight": {
@@ -666,9 +676,19 @@ function decodeSmartObliquePoint(raw) {
666
676
  smartObliqueEulerYaw: degrees(parseNum(raw["wpml:smartObliqueEulerYaw"], "smartObliqueEulerYaw"))
667
677
  };
668
678
  }
679
+ function decodeTtsParam(raw) {
680
+ return {
681
+ text: raw.text,
682
+ role: raw.role,
683
+ language: raw.language,
684
+ volume: parseNum(raw.volume, "ttsparam.volume"),
685
+ speed: parseNum(raw.speed, "ttsparam.speed")
686
+ };
687
+ }
669
688
  function decodeAction(raw) {
670
689
  const p = raw["wpml:actionActuatorFuncParam"] ?? {};
671
690
  const smartObliquePoint = p["wpml:smartObliquePoint"];
691
+ const ttsparam = p.ttsparam;
672
692
  const id = parseNum(raw["wpml:actionId"], "actionId");
673
693
  const func = raw["wpml:actionActuatorFunc"];
674
694
  switch (func) {
@@ -871,7 +891,8 @@ function decodeAction(raw) {
871
891
  megaphoneFileName: need(p["wpml:megaphoneFileName"], "megaphoneFileName"),
872
892
  megaphoneFileOriginalName: need(p["wpml:megaphoneFileOriginalName"], "megaphoneFileOriginalName"),
873
893
  megaphoneFileMd5: need(p["wpml:megaphoneFileMd5"], "megaphoneFileMd5"),
874
- megaphoneFileBitrate: parseNum(p["wpml:megaphoneFileBitrate"], "megaphoneFileBitrate")
894
+ megaphoneFileBitrate: parseNum(p["wpml:megaphoneFileBitrate"], "megaphoneFileBitrate"),
895
+ ...ttsparam ? { ttsparam: decodeTtsParam(ttsparam) } : {}
875
896
  }
876
897
  };
877
898
  case "searchlight": return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lumikmz/kmz-file",
3
- "version": "0.6.3",
3
+ "version": "0.7.0",
4
4
  "description": "DJI KMZ file pack/unpack — Rust WASM + spec-aligned TypeScript codec",
5
5
  "license": "MIT",
6
6
  "files": [
@@ -24,7 +24,7 @@
24
24
  "./package.json": "./package.json"
25
25
  },
26
26
  "dependencies": {
27
- "@lumikmz/kmz": "0.6.3"
27
+ "@lumikmz/kmz": "0.7.0"
28
28
  },
29
29
  "devDependencies": {
30
30
  "vite-plus": "latest",