@trackunit/iris-app-api 0.2.2 → 0.2.3

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,8 @@
2
2
 
3
3
  This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
4
4
 
5
+ ## [0.2.3](https://github.com/Trackunit/manager/compare/iris-app-api/0.2.2...iris-app-api/0.2.3) (2024-09-11)
6
+
5
7
  ## [0.2.2](https://github.com/Trackunit/manager/compare/iris-app-api/0.2.1...iris-app-api/0.2.2) (2024-09-09)
6
8
 
7
9
  ## [0.2.1](https://github.com/Trackunit/manager/compare/iris-app-api/0.2.0...iris-app-api/0.2.1) (2024-09-05)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trackunit/iris-app-api",
3
- "version": "0.2.2",
3
+ "version": "0.2.3",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
5
  "repository": "https://github.com/Trackunit/manager",
6
6
  "engines": {
@@ -1,6 +1,7 @@
1
1
  import { IconName } from "./icons.generated";
2
2
  type HexColor = `#${string}`;
3
3
  type RgbColor = `rgb(${number},${number},${number})`;
4
+ export type SvgImagePath = `${string}.svg`;
4
5
  /**
5
6
  * Checks if the value is a valid hex color
6
7
  */
@@ -16,7 +17,7 @@ export type IconImage = {
16
17
  *
17
18
  * @example "assets/icon.svg"
18
19
  */
19
- path: string;
20
+ path: SvgImagePath;
20
21
  color?: Color;
21
22
  };
22
23
  export type IconByName = {
@@ -1 +1 @@
1
- {"version":3,"file":"iconImage.js","sourceRoot":"","sources":["../../../../../../libs/iris-app-sdk/iris-app-api/src/types/iconImage.ts"],"names":[],"mappings":";;;AAKA;;GAEG;AACH,8DAA8D;AACvD,MAAM,UAAU,GAAG,CAAC,KAAU,EAAqB,EAAE;IAC1D,OAAO,iBAAiB,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,iBAAiB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AACxE,CAAC,CAAC;AAFW,QAAA,UAAU,cAErB;AAEF;;GAEG;AACH,8DAA8D;AACvD,MAAM,UAAU,GAAG,CAAC,KAAU,EAAqB,EAAE;IAC1D,OAAO,mCAAmC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AACzD,CAAC,CAAC;AAFW,QAAA,UAAU,cAErB;AAyBF;;;;;GAKG;AACI,MAAM,WAAW,GAAG,CAAC,KAAc,EAAsB,EAAE;IAChE,OAAO,CAAC,CAAC,CAAC,KAA+B,aAA/B,KAAK,uBAAL,KAAK,CAA4B,IAAI,CAAA,CAAC;AAClD,CAAC,CAAC;AAFW,QAAA,WAAW,eAEtB;AAEF;;;;;GAKG;AACI,MAAM,YAAY,GAAG,CAAC,KAAc,EAAuB,EAAE;IAClE,OAAO,CAAC,CAAC,CAAC,KAAgC,aAAhC,KAAK,uBAAL,KAAK,CAA6B,IAAI,CAAA,CAAC;AACnD,CAAC,CAAC;AAFW,QAAA,YAAY,gBAEvB","sourcesContent":["import { IconName } from \"./icons.generated\";\n\ntype HexColor = `#${string}`;\ntype RgbColor = `rgb(${number},${number},${number})`;\n\n/**\n * Checks if the value is a valid hex color\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const isHexColor = (color: any): color is HexColor => {\n return /^#[0-9A-F]{6}$/i.test(color) || /^#[0-9A-F]{3}$/i.test(color);\n};\n\n/**\n * Checks if the value is a valid rgb color\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const isRgbColor = (color: any): color is RgbColor => {\n return /^rgb\\(\\d{1,3},\\d{1,3},\\d{1,3}\\)$/i.test(color);\n};\n\nexport type Color = HexColor | RgbColor;\n\nexport type IconImage = {\n /**\n * Path relative to the projects src folder defined in the extensions sourceRoot\n *\n * @example \"assets/icon.svg\"\n */\n path: string;\n color?: Color;\n};\n\nexport type IconByName = {\n name: IconName;\n /**\n * Color of the background for the icon\n * Supports hex or rgb\n *\n * @example \"#ff0000\" or \"rgb(255,0,0)\"\n */\n color?: Color;\n};\n\n/**\n * Checks if value is an IconImage\n *\n * @param value - The value to check\n * @returns - True if value is an IconImage\n */\nexport const isIconImage = (value: unknown): value is IconImage => {\n return !!(value as IconImage | undefined)?.path;\n};\n\n/**\n * Checks if value is an IconByName\n *\n * @param value - The value to check\n * @returns - True if value is an IconByName\n */\nexport const isIconByName = (value: unknown): value is IconByName => {\n return !!(value as IconByName | undefined)?.name;\n};\n"]}
1
+ {"version":3,"file":"iconImage.js","sourceRoot":"","sources":["../../../../../../libs/iris-app-sdk/iris-app-api/src/types/iconImage.ts"],"names":[],"mappings":";;;AAMA;;GAEG;AACH,8DAA8D;AACvD,MAAM,UAAU,GAAG,CAAC,KAAU,EAAqB,EAAE;IAC1D,OAAO,iBAAiB,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,iBAAiB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AACxE,CAAC,CAAC;AAFW,QAAA,UAAU,cAErB;AAEF;;GAEG;AACH,8DAA8D;AACvD,MAAM,UAAU,GAAG,CAAC,KAAU,EAAqB,EAAE;IAC1D,OAAO,mCAAmC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AACzD,CAAC,CAAC;AAFW,QAAA,UAAU,cAErB;AAyBF;;;;;GAKG;AACI,MAAM,WAAW,GAAG,CAAC,KAAc,EAAsB,EAAE;IAChE,OAAO,CAAC,CAAC,CAAC,KAA+B,aAA/B,KAAK,uBAAL,KAAK,CAA4B,IAAI,CAAA,CAAC;AAClD,CAAC,CAAC;AAFW,QAAA,WAAW,eAEtB;AAEF;;;;;GAKG;AACI,MAAM,YAAY,GAAG,CAAC,KAAc,EAAuB,EAAE;IAClE,OAAO,CAAC,CAAC,CAAC,KAAgC,aAAhC,KAAK,uBAAL,KAAK,CAA6B,IAAI,CAAA,CAAC;AACnD,CAAC,CAAC;AAFW,QAAA,YAAY,gBAEvB","sourcesContent":["import { IconName } from \"./icons.generated\";\n\ntype HexColor = `#${string}`;\ntype RgbColor = `rgb(${number},${number},${number})`;\nexport type SvgImagePath = `${string}.svg`;\n\n/**\n * Checks if the value is a valid hex color\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const isHexColor = (color: any): color is HexColor => {\n return /^#[0-9A-F]{6}$/i.test(color) || /^#[0-9A-F]{3}$/i.test(color);\n};\n\n/**\n * Checks if the value is a valid rgb color\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const isRgbColor = (color: any): color is RgbColor => {\n return /^rgb\\(\\d{1,3},\\d{1,3},\\d{1,3}\\)$/i.test(color);\n};\n\nexport type Color = HexColor | RgbColor;\n\nexport type IconImage = {\n /**\n * Path relative to the projects src folder defined in the extensions sourceRoot\n *\n * @example \"assets/icon.svg\"\n */\n path: SvgImagePath;\n color?: Color;\n};\n\nexport type IconByName = {\n name: IconName;\n /**\n * Color of the background for the icon\n * Supports hex or rgb\n *\n * @example \"#ff0000\" or \"rgb(255,0,0)\"\n */\n color?: Color;\n};\n\n/**\n * Checks if value is an IconImage\n *\n * @param value - The value to check\n * @returns - True if value is an IconImage\n */\nexport const isIconImage = (value: unknown): value is IconImage => {\n return !!(value as IconImage | undefined)?.path;\n};\n\n/**\n * Checks if value is an IconByName\n *\n * @param value - The value to check\n * @returns - True if value is an IconByName\n */\nexport const isIconByName = (value: unknown): value is IconByName => {\n return !!(value as IconByName | undefined)?.name;\n};\n"]}