@victronenergy/mfd-modules 10.0.0 → 10.1.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.
@@ -1 +1 @@
1
- {"version":3,"file":"hsvw.d.ts","sourceRoot":"/","sources":["src/utils/hsvw.ts"],"names":[],"mappings":"AAAA,KAAK,GAAG,GAAG,MAAM,GAAG;IAAE,OAAO,EAAE,KAAK,CAAA;CAAE,CAAA;AACtC,KAAK,UAAU,GAAG,MAAM,GAAG;IAAE,OAAO,EAAE,YAAY,CAAA;CAAE,CAAA;AACpD,KAAK,gBAAgB,GAAG,MAAM,GAAG;IAAE,OAAO,EAAE,kBAAkB,CAAA;CAAE,CAAA;AAEhE,MAAM,WAAW,SAAS;IACxB,GAAG,EAAE,GAAG,CAAA;IACR,UAAU,EAAE,UAAU,CAAA;IACtB,UAAU,EAAE,UAAU,CAAA;IACtB,KAAK,EAAE,UAAU,CAAA;IACjB,gBAAgB,EAAE,gBAAgB,CAAA;CACnC;AAED,MAAM,MAAM,cAAc,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAA;AAErE,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,GAAG,CAG5C;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,UAAU,CAG1D;AAED,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,MAAM,GAAG,gBAAgB,CAGtE;AAED,wBAAgB,WAAW,CAAC,GAAG,EAAE,cAAc,GAAG,SAAS,CAS1D;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,SAAS,GAAG,cAAc,CAE5D;AAED,wBAAgB,eAAe,CAAC,GAAG,EAAE,cAAc,GAAG,MAAM,CAS3D;AAED,wBAAgB,eAAe,CAC7B,GAAG,EAAE,MAAM,EACX,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,MAAM,EACb,SAAS,EAAE,MAAM,GAChB,SAAS,CAQX"}
1
+ {"version":3,"file":"hsvw.d.ts","sourceRoot":"/","sources":["src/utils/hsvw.ts"],"names":[],"mappings":"AAAA,KAAK,GAAG,GAAG,MAAM,GAAG;IAAE,OAAO,EAAE,KAAK,CAAA;CAAE,CAAA;AACtC,KAAK,UAAU,GAAG,MAAM,GAAG;IAAE,OAAO,EAAE,YAAY,CAAA;CAAE,CAAA;AACpD,KAAK,gBAAgB,GAAG,MAAM,GAAG;IAAE,OAAO,EAAE,kBAAkB,CAAA;CAAE,CAAA;AAEhE,MAAM,WAAW,SAAS;IACxB,GAAG,EAAE,GAAG,CAAA;IACR,UAAU,EAAE,UAAU,CAAA;IACtB,UAAU,EAAE,UAAU,CAAA;IACtB,KAAK,EAAE,UAAU,CAAA;IACjB,gBAAgB,EAAE,gBAAgB,CAAA;CACnC;AAED,MAAM,MAAM,cAAc,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAA;AAErE,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,GAAG,CAG5C;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,UAAU,CAG1D;AAED,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,MAAM,GAAG,gBAAgB,CAGtE;AAED,wBAAgB,WAAW,CAAC,GAAG,EAAE,cAAc,GAAG,SAAS,CAS1D;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,SAAS,GAAG,cAAc,CAE5D;AAED,wBAAgB,eAAe,CAAC,GAAG,EAAE,cAAc,GAAG,MAAM,CAG3D;AAED,wBAAgB,eAAe,CAC7B,GAAG,EAAE,MAAM,EACX,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,MAAM,EACb,SAAS,EAAE,MAAM,GAChB,SAAS,CAQX"}
@@ -24,12 +24,7 @@ export function hsvwToArray(color) {
24
24
  return [color.hue, color.saturation, color.brightness, color.white, color.colorTemperature];
25
25
  }
26
26
  export function hsvwArrayToJSON(arr) {
27
- var formattedNumbers = arr
28
- .map(function (n) {
29
- // If integer, add .0, otherwise keep as is
30
- return Number.isInteger(n) ? "".concat(n, ".0") : String(n);
31
- })
32
- .join(",");
27
+ var formattedNumbers = arr.map(function (n) { return n.toFixed(0); }).join(",");
33
28
  return "{\"value\":[".concat(formattedNumbers, "]}");
34
29
  }
35
30
  export function createHSVWColor(hue, saturation, brightness, white, colorTemp) {
@@ -1 +1 @@
1
- {"version":3,"file":"hsvw.js","sourceRoot":"/","sources":["src/utils/hsvw.ts"],"names":[],"mappings":"AAcA,MAAM,UAAU,SAAS,CAAC,KAAa;IACrC,IAAM,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC,CAAA;IACjD,OAAO,OAAc,CAAA;AACvB,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,KAAa;IAC5C,IAAM,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC,CAAA;IACjD,OAAO,OAAqB,CAAA;AAC9B,CAAC;AAED,MAAM,UAAU,sBAAsB,CAAC,KAAa;IAClD,IAAM,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,CAAA;IAClD,OAAO,OAA2B,CAAA;AACpC,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,GAAmB;IACtC,IAAA,GAAG,GAA8C,GAAG,GAAjD,EAAE,UAAU,GAAkC,GAAG,GAArC,EAAE,UAAU,GAAsB,GAAG,GAAzB,EAAE,KAAK,GAAe,GAAG,GAAlB,EAAE,SAAS,GAAI,GAAG,GAAP,CAAO;IAC3D,OAAO;QACL,GAAG,EAAE,SAAS,CAAC,GAAG,CAAC;QACnB,UAAU,EAAE,gBAAgB,CAAC,UAAU,CAAC;QACxC,UAAU,EAAE,gBAAgB,CAAC,UAAU,CAAC;QACxC,KAAK,EAAE,gBAAgB,CAAC,KAAK,CAAC;QAC9B,gBAAgB,EAAE,sBAAsB,CAAC,SAAS,CAAC;KACpD,CAAA;AACH,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,KAAgB;IAC1C,OAAO,CAAC,KAAK,CAAC,GAAG,EAAE,KAAK,CAAC,UAAU,EAAE,KAAK,CAAC,UAAU,EAAE,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,gBAAgB,CAAC,CAAA;AAC7F,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,GAAmB;IACjD,IAAM,gBAAgB,GAAG,GAAG;SACzB,GAAG,CAAC,UAAC,CAAC;QACL,2CAA2C;QAC3C,OAAO,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,UAAG,CAAC,OAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAA;IACnD,CAAC,CAAC;SACD,IAAI,CAAC,GAAG,CAAC,CAAA;IAEZ,OAAO,sBAAa,gBAAgB,OAAI,CAAA;AAC1C,CAAC;AAED,MAAM,UAAU,eAAe,CAC7B,GAAW,EACX,UAAkB,EAClB,UAAkB,EAClB,KAAa,EACb,SAAiB;IAEjB,OAAO;QACL,GAAG,EAAE,SAAS,CAAC,GAAG,CAAC;QACnB,UAAU,EAAE,gBAAgB,CAAC,UAAU,CAAC;QACxC,UAAU,EAAE,gBAAgB,CAAC,UAAU,CAAC;QACxC,KAAK,EAAE,gBAAgB,CAAC,KAAK,CAAC;QAC9B,gBAAgB,EAAE,sBAAsB,CAAC,SAAS,CAAC;KACpD,CAAA;AACH,CAAC","sourcesContent":["type Hue = number & { __brand: \"Hue\" } // 0-360 degrees\ntype Percentage = number & { __brand: \"Percentage\" } // 0-100\ntype ColorTemperature = number & { __brand: \"ColorTemperature\" } // 0-6500 K\n\nexport interface HSVWColor {\n hue: Hue\n saturation: Percentage\n brightness: Percentage\n white: Percentage\n colorTemperature: ColorTemperature\n}\n\nexport type HSVWColorArray = [number, number, number, number, number]\n\nexport function createHue(value: number): Hue {\n const clamped = Math.max(0, Math.min(360, value))\n return clamped as Hue\n}\n\nexport function createPercentage(value: number): Percentage {\n const clamped = Math.max(0, Math.min(100, value))\n return clamped as Percentage\n}\n\nexport function createColorTemperature(value: number): ColorTemperature {\n const clamped = Math.max(0, Math.min(6500, value))\n return clamped as ColorTemperature\n}\n\nexport function arrayToHSVW(arr: HSVWColorArray): HSVWColor {\n const [hue, saturation, brightness, white, colorTemp] = arr\n return {\n hue: createHue(hue),\n saturation: createPercentage(saturation),\n brightness: createPercentage(brightness),\n white: createPercentage(white),\n colorTemperature: createColorTemperature(colorTemp),\n }\n}\n\nexport function hsvwToArray(color: HSVWColor): HSVWColorArray {\n return [color.hue, color.saturation, color.brightness, color.white, color.colorTemperature]\n}\n\nexport function hsvwArrayToJSON(arr: HSVWColorArray): string {\n const formattedNumbers = arr\n .map((n) => {\n // If integer, add .0, otherwise keep as is\n return Number.isInteger(n) ? `${n}.0` : String(n)\n })\n .join(\",\")\n\n return `{\"value\":[${formattedNumbers}]}`\n}\n\nexport function createHSVWColor(\n hue: number,\n saturation: number,\n brightness: number,\n white: number,\n colorTemp: number\n): HSVWColor {\n return {\n hue: createHue(hue),\n saturation: createPercentage(saturation),\n brightness: createPercentage(brightness),\n white: createPercentage(white),\n colorTemperature: createColorTemperature(colorTemp),\n }\n}\n"]}
1
+ {"version":3,"file":"hsvw.js","sourceRoot":"/","sources":["src/utils/hsvw.ts"],"names":[],"mappings":"AAcA,MAAM,UAAU,SAAS,CAAC,KAAa;IACrC,IAAM,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC,CAAA;IACjD,OAAO,OAAc,CAAA;AAC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AC,IAAI,CAAC,GAAG,CAAC,CAAA;IAC/D,OAAO,sBAAa,gBAAgB,OAAI,CAAA;AAC1C,CAAC;AAED,MAAM,UAAU,eAAe,CAC7B,GAAW,EACX,UAAkB,EAClB,UAAkB,EAClB,KAAa,EACb,SAAiB;IAEjB,OAAO;QACL,GAAG,EAAE,SAAS,CAAC,GAAG,CAAC;QACnB,UAAU,EAAE,gBAAgB,CAAC,UAAU,CAAC;QACxC,UAAU,EAAE,gBAAgB,CAAC,UAAU,CAAC;QACxC,KAAK,EAAE,gBAAgB,CAAC,KAAK,CAAC;QAC9B,gBAAgB,EAAE,sBAAsB,CAAC,SAAS,CAAC;KACpD,CAAA;AACH,CAAC","sourcesContent":["type Hue = number & { __brand: \"Hue\" } // 0-360 degrees\ntype Percentage = number & { __brand: \"Percentage\" } // 0-100\ntype ColorTemperature = number & { __brand: \"ColorTemperature\" } // 0-6500 K\n\nexport interface HSVWColor {\n hue: Hue\n saturation: Percentage\n brightness: Percentage\n white: Percentage\n colorTemperature: ColorTemperature\n}\n\nexport type HSVWColorArray = [number, number, number, number, number]\n\nexport function createHue(value: number): Hue {\n const clamped = Math.max(0, Math.min(360, value))\n return clamped as Hue\n}\n\nexport function createPercentage(value: number): Percentage {\n const clamped = Math.max(0, Math.min(100, value))\n return clamped as Percentage\n}\n\nexport function createColorTemperature(value: number): ColorTemperature {\n const clamped = Math.max(0, Math.min(6500, value))\n return clamped as ColorTemperature\n}\n\nexport function arrayToHSVW(arr: HSVWColorArray): HSVWColor {\n const [hue, saturation, brightness, white, colorTemp] = arr\n return {\n hue: createHue(hue),\n saturation: createPercentage(saturation),\n brightness: createPercentage(brightness),\n white: createPercentage(white),\n colorTemperature: createColorTemperature(colorTemp),\n }\n}\n\nexport function hsvwToArray(color: HSVWColor): HSVWColorArray {\n return [color.hue, color.saturation, color.brightness, color.white, color.colorTemperature]\n}\n\nexport function hsvwArrayToJSON(arr: HSVWColorArray): string {\n const formattedNumbers = arr.map((n) => n.toFixed(0)).join(\",\")\n return `{\"value\":[${formattedNumbers}]}`\n}\n\nexport function createHSVWColor(\n hue: number,\n saturation: number,\n brightness: number,\n white: number,\n colorTemp: number\n): HSVWColor {\n return {\n hue: createHue(hue),\n saturation: createPercentage(saturation),\n brightness: createPercentage(brightness),\n white: createPercentage(white),\n colorTemperature: createColorTemperature(colorTemp),\n }\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@victronenergy/mfd-modules",
3
- "version": "10.0.0",
3
+ "version": "10.1.0",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",