@iobroker/adapter-react-v5 7.4.21 → 7.5.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 (118) hide show
  1. package/LICENSE +22 -22
  2. package/build/AdminConnection.js.map +1 -1
  3. package/build/Components/404.js +13 -13
  4. package/build/Components/404.js.map +1 -1
  5. package/build/Components/ColorPicker.js.map +1 -1
  6. package/build/Components/ComplexCron.js.map +1 -1
  7. package/build/Components/CopyToClipboard.js.map +1 -1
  8. package/build/Components/CustomModal.js.map +1 -1
  9. package/build/Components/FileBrowser.js +1 -1
  10. package/build/Components/FileBrowser.js.map +1 -1
  11. package/build/Components/FileViewer.js.map +1 -1
  12. package/build/Components/Icon.js.map +1 -1
  13. package/build/Components/IconPicker.js.map +1 -1
  14. package/build/Components/IconSelector.js.map +1 -1
  15. package/build/Components/IobUri.js.map +1 -1
  16. package/build/Components/Loader.js +223 -223
  17. package/build/Components/Loader.js.map +1 -1
  18. package/build/Components/Loaders/MV.js.map +1 -1
  19. package/build/Components/Loaders/PT.js +103 -103
  20. package/build/Components/Loaders/PT.js.map +1 -1
  21. package/build/Components/Loaders/Vendor.js +7 -7
  22. package/build/Components/Loaders/Vendor.js.map +1 -1
  23. package/build/Components/MDUtils.js.map +1 -1
  24. package/build/Components/ObjectBrowser.d.ts +11 -0
  25. package/build/Components/ObjectBrowser.js +172 -11
  26. package/build/Components/ObjectBrowser.js.map +1 -1
  27. package/build/Components/Router.js.map +1 -1
  28. package/build/Components/SaveCloseButtons.js.map +1 -1
  29. package/build/Components/Schedule.js.map +1 -1
  30. package/build/Components/SelectWithIcon.js.map +1 -1
  31. package/build/Components/SimpleCron/cronText.js.map +1 -1
  32. package/build/Components/SimpleCron/index.js.map +1 -1
  33. package/build/Components/TabContainer.js.map +1 -1
  34. package/build/Components/TabContent.js.map +1 -1
  35. package/build/Components/TabHeader.js.map +1 -1
  36. package/build/Components/TableResize.js.map +1 -1
  37. package/build/Components/TextWithIcon.js.map +1 -1
  38. package/build/Components/ToggleThemeMenu.js.map +1 -1
  39. package/build/Components/TreeTable.js.map +1 -1
  40. package/build/Components/UploadImage.js +305 -305
  41. package/build/Components/UploadImage.js.map +1 -1
  42. package/build/Components/withWidth.js.map +1 -1
  43. package/build/Connection.js.map +1 -1
  44. package/build/Dialogs/ComplexCron.js.map +1 -1
  45. package/build/Dialogs/Confirm.js.map +1 -1
  46. package/build/Dialogs/Cron.js.map +1 -1
  47. package/build/Dialogs/Error.js.map +1 -1
  48. package/build/Dialogs/Message.js.map +1 -1
  49. package/build/Dialogs/SelectFile.js.map +1 -1
  50. package/build/Dialogs/SimpleCron.js.map +1 -1
  51. package/build/Dialogs/TextInput.d.ts +1 -1
  52. package/build/Dialogs/TextInput.js.map +1 -1
  53. package/build/GenericApp.js.map +1 -1
  54. package/build/LegacyConnection.d.ts +4 -46
  55. package/build/LegacyConnection.js.map +1 -1
  56. package/build/Prompt.js +7 -7
  57. package/build/Prompt.js.map +1 -1
  58. package/build/Theme.js +6 -6
  59. package/build/Theme.js.map +1 -1
  60. package/build/assets/devices/parseNames.js.map +1 -1
  61. package/build/assets/devices.json +1 -1
  62. package/build/assets/lamp_ceiling.svg +8 -8
  63. package/build/assets/lamp_table.svg +7 -7
  64. package/build/assets/no_icon.svg +9 -9
  65. package/build/assets/rooms/parseNames.js.map +1 -1
  66. package/build/assets/rooms.json +1 -1
  67. package/build/dictionary.js.map +1 -1
  68. package/build/i18n/de.json +11 -0
  69. package/build/i18n/en.json +11 -0
  70. package/build/i18n/es.json +11 -0
  71. package/build/i18n/fr.json +11 -0
  72. package/build/i18n/it.json +11 -0
  73. package/build/i18n/nl.json +11 -0
  74. package/build/i18n/pl.json +11 -0
  75. package/build/i18n/pt.json +11 -0
  76. package/build/i18n/ru.json +11 -0
  77. package/build/i18n/uk.json +11 -0
  78. package/build/i18n/zh-cn.json +11 -0
  79. package/build/i18n.js.map +1 -1
  80. package/build/icons/IconAdapter.js.map +1 -1
  81. package/build/icons/IconAlias.js.map +1 -1
  82. package/build/icons/IconButtonImage.js.map +1 -1
  83. package/build/icons/IconChannel.js.map +1 -1
  84. package/build/icons/IconClearFilter.js.map +1 -1
  85. package/build/icons/IconClosed.js.map +1 -1
  86. package/build/icons/IconCopy.js.map +1 -1
  87. package/build/icons/IconDevice.js.map +1 -1
  88. package/build/icons/IconDocument.js.map +1 -1
  89. package/build/icons/IconDocumentReadOnly.js.map +1 -1
  90. package/build/icons/IconExpert.js.map +1 -1
  91. package/build/icons/IconFx.js +1 -1
  92. package/build/icons/IconFx.js.map +1 -1
  93. package/build/icons/IconInstance.js.map +1 -1
  94. package/build/icons/IconLogout.js +1 -1
  95. package/build/icons/IconLogout.js.map +1 -1
  96. package/build/icons/IconNoIcon.js.map +1 -1
  97. package/build/icons/IconOpen.js.map +1 -1
  98. package/build/icons/IconProps.js.map +1 -1
  99. package/build/icons/IconState.js.map +1 -1
  100. package/build/icons/IconVacuum.js.map +1 -1
  101. package/build/index.css +56 -56
  102. package/build/index.js.map +1 -1
  103. package/craco-module-federation.js +62 -62
  104. package/i18n/de.json +11 -0
  105. package/i18n/en.json +11 -0
  106. package/i18n/es.json +11 -0
  107. package/i18n/fr.json +11 -0
  108. package/i18n/it.json +11 -0
  109. package/i18n/nl.json +11 -0
  110. package/i18n/pl.json +11 -0
  111. package/i18n/pt.json +11 -0
  112. package/i18n/ru.json +11 -0
  113. package/i18n/uk.json +11 -0
  114. package/i18n/zh-cn.json +11 -0
  115. package/index.css +56 -56
  116. package/modulefederation.admin.config.js +33 -33
  117. package/package.json +14 -15
  118. package/tasksExample.js +91 -91
package/build/Prompt.js CHANGED
@@ -2,13 +2,13 @@
2
2
  * Print the ioBroker welcome screen to the developer console.
3
3
  */
4
4
  export function printPrompt() {
5
- const prompt = `
6
- ██╗ ██████╗ ██████╗ ██████╗ ██████╗ ██╗ ██╗███████╗██████╗
7
- ██║██╔═══██╗██╔══██╗██╔══██╗██╔═══██╗██║ ██╔╝██╔════╝██╔══██╗
8
- ██║██║ ██║██████╔╝██████╔╝██║ ██║█████╔╝ █████╗ ██████╔╝
9
- ██║██║ ██║██╔══██╗██╔══██╗██║ ██║██╔═██╗ ██╔══╝ ██╔══██╗
10
- ██║╚██████╔╝██████╔╝██║ ██║╚██████╔╝██║ ██╗███████╗██║ ██║
11
- ╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
5
+ const prompt = `
6
+ ██╗ ██████╗ ██████╗ ██████╗ ██████╗ ██╗ ██╗███████╗██████╗
7
+ ██║██╔═══██╗██╔══██╗██╔══██╗██╔═══██╗██║ ██╔╝██╔════╝██╔══██╗
8
+ ██║██║ ██║██████╔╝██████╔╝██║ ██║█████╔╝ █████╗ ██████╔╝
9
+ ██║██║ ██║██╔══██╗██╔══██╗██║ ██║██╔═██╗ ██╔══╝ ██╔══██╗
10
+ ██║╚██████╔╝██████╔╝██║ ██║╚██████╔╝██║ ██╗███████╗██║ ██║
11
+ ╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
12
12
  `;
13
13
  console.log(prompt);
14
14
  console.log('Nice to see you here! :) Join our dev community here https://github.com/ioBroker/ioBroker or here https://github.com/iobroker-community-adapters');
@@ -1 +1 @@
1
- {"version":3,"file":"Prompt.js","sourceRoot":"./src/","sources":["Prompt.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,UAAU,WAAW;IACvB,MAAM,MAAM,GAAG;;;;;;;CAOlB,CAAC;IAEE,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IACpB,OAAO,CAAC,GAAG,CACP,kJAAkJ,CACrJ,CAAC;IACF,OAAO,CAAC,GAAG,CAAC,qDAAqD,CAAC,CAAC;IACnE,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;AAC9B,CAAC;AAED,eAAe,WAAW,CAAC","sourcesContent":["/**\n * Print the ioBroker welcome screen to the developer console.\n */\nexport function printPrompt(): void {\n const prompt = `\n██╗ ██████╗ ██████╗ ██████╗ ██████╗ ██╗ ██╗███████╗██████╗ \n██║██╔═══██╗██╔══██╗██╔══██╗██╔═══██╗██║ ██╔╝██╔════╝██╔══██╗\n██║██║ ██║██████╔╝██████╔╝██║ ██║█████╔╝ █████╗ ██████╔╝\n██║██║ ██║██╔══██╗██╔══██╗██║ ██║██╔═██╗ ██╔══╝ ██╔══██╗\n██║╚██████╔╝██████╔╝██║ ██║╚██████╔╝██║ ██╗███████╗██║ ██║\n╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝\n`;\n\n console.log(prompt);\n console.log(\n 'Nice to see you here! :) Join our dev community here https://github.com/ioBroker/ioBroker or here https://github.com/iobroker-community-adapters',\n );\n console.log('Help us to create open source project with reactJS!');\n console.log('See you :)');\n}\n\nexport default printPrompt;\n"]}
1
+ {"version":3,"file":"Prompt.js","sourceRoot":"./src/","sources":["Prompt.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,UAAU,WAAW;IACvB,MAAM,MAAM,GAAG;;;;;;;CAOlB,CAAC;IAEE,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IACpB,OAAO,CAAC,GAAG,CACP,kJAAkJ,CACrJ,CAAC;IACF,OAAO,CAAC,GAAG,CAAC,qDAAqD,CAAC,CAAC;IACnE,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;AAC9B,CAAC;AAED,eAAe,WAAW,CAAC","sourcesContent":["/**\r\n * Print the ioBroker welcome screen to the developer console.\r\n */\r\nexport function printPrompt(): void {\r\n const prompt = `\r\n██╗ ██████╗ ██████╗ ██████╗ ██████╗ ██╗ ██╗███████╗██████╗ \r\n██║██╔═══██╗██╔══██╗██╔══██╗██╔═══██╗██║ ██╔╝██╔════╝██╔══██╗\r\n██║██║ ██║██████╔╝██████╔╝██║ ██║█████╔╝ █████╗ ██████╔╝\r\n██║██║ ██║██╔══██╗██╔══██╗██║ ██║██╔═██╗ ██╔══╝ ██╔══██╗\r\n██║╚██████╔╝██████╔╝██║ ██║╚██████╔╝██║ ██╗███████╗██║ ██║\r\n╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝\r\n`;\r\n\r\n console.log(prompt);\r\n console.log(\r\n 'Nice to see you here! :) Join our dev community here https://github.com/ioBroker/ioBroker or here https://github.com/iobroker-community-adapters',\r\n );\r\n console.log('Help us to create open source project with reactJS!');\r\n console.log('See you :)');\r\n}\r\n\r\nexport default printPrompt;\r\n"]}
package/build/Theme.js CHANGED
@@ -11,14 +11,14 @@ function toInt(hex) {
11
11
  b: 0,
12
12
  };
13
13
  if (hex.length === 7) {
14
- rgb.r = parseInt(hex.substr(1, 2), 16);
15
- rgb.g = parseInt(hex.substr(3, 2), 16);
16
- rgb.b = parseInt(hex.substr(5, 2), 16);
14
+ rgb.r = parseInt(hex.substring(1, 3), 16);
15
+ rgb.g = parseInt(hex.substring(3, 5), 16);
16
+ rgb.b = parseInt(hex.substring(5, 7), 16);
17
17
  }
18
18
  else if (hex.length === 4) {
19
- const r = hex.substr(1, 1);
20
- const g = hex.substr(2, 1);
21
- const b = hex.substr(3, 1);
19
+ const r = hex[1];
20
+ const g = hex[2];
21
+ const b = hex[3];
22
22
  rgb.r = parseInt(r + r, 16);
23
23
  rgb.g = parseInt(g + g, 16);
24
24
  rgb.b = parseInt(b + b, 16);
@@ -1 +1 @@
1
- {"version":3,"file":"Theme.js","sourceRoot":"./src/","sources":["Theme.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,KAAK,EAA4C,MAAM,sBAAsB,CAAC;AACpG,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAMpD,MAAM,IAAI,GAAG,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3B,OAAO,CAAC,MAAM,EAAE,YAAY,IAAI,IAAI,CACvC;6BACJ;yBACJ;qBACJ;iBACJ;aACJ;YACD,GAAG,CAAC,SAAS,EAAE,UAAU,IAAI,SAAS,CAAC;SAC1C;KACJ,CAAa,CAAC;AACnB,CAAC","sourcesContent":["import { type CSSProperties } from 'react';\nimport { createTheme, alpha, type PaletteOptions as PaletteOptionsMui } from '@mui/material/styles';\nimport { orange, grey } from '@mui/material/colors';\n\nimport type { SimplePaletteColorOptions } from '@mui/material/styles/createPalette';\nimport type { ThemeOptions as ThemeOptionsMui } from '@mui/material/styles/createTheme';\nimport type { IobTheme, ThemeName, ThemeType } from './types';\n\nconst step = (16 - 5) / 23 / 100;\n\n/**\n * Convert hex color in the format '#rrggbb' or '#rgb' to an RGB object.\n */\nfunction toInt(hex: string): { r: number; g: number; b: number } {\n const rgb: { r: number; g: number; b: number } = {\n r: 0,\n g: 0,\n b: 0,\n };\n\n if (hex.length === 7) {\n rgb.r = parseInt(hex.substr(1, 2), 16);\n rgb.g = parseInt(hex.substr(3, 2), 16);\n rgb.b = parseInt(hex.substr(5, 2), 16);\n } else if (hex.length === 4) {\n const r = hex.substr(1, 1);\n const g = hex.substr(2, 1);\n const b = hex.substr(3, 1);\n\n rgb.r = parseInt(r + r, 16);\n rgb.g = parseInt(g + g, 16);\n rgb.b = parseInt(b + b, 16);\n }\n\n return rgb;\n}\n\n/**\n * Convert an RGB object to a hex color string in the format '#rrggbb'.\n */\nfunction toHex(int: { r: number; g: number; b: number }): string {\n return `#${Math.round(int.r).toString(16)}${Math.round(int.g).toString(16)}${Math.round(int.b).toString(16)}`;\n}\n\n/** Returns the hex color string in the format '#rrggbb' */\nfunction getElevation(\n /** color in the format '#rrggbb' or '#rgb' */\n color: string,\n /** overlay color in the format '#rrggbb' or '#rgb' */\n overlayColor: string,\n /** elevation as an integer starting with 1 */\n elevation: number,\n): string {\n const rgb: { r: number; g: number; b: number } = toInt(color);\n const overlay: { r: number; g: number; b: number } = toInt(overlayColor);\n\n rgb.r += overlay.r * (0.05 + step * (elevation - 1));\n rgb.g += overlay.g * (0.05 + step * (elevation - 1));\n rgb.b += overlay.b * (0.05 + step * (elevation - 1));\n\n return toHex(rgb);\n}\n\n/**\n * Get all 24 elevations of the given color and overlay.\n *\n * @param color color in the format '#rrggbb' or '#rgb'\n * @param overlay overlay color in the format '#rrggbb' or '#rgb'\n */\nfunction getElevations(color: string, overlay: string): Record<string, CSSProperties> {\n const elevations: Record<string, CSSProperties> = {};\n\n for (let i = 1; i <= 24; i++) {\n elevations[`elevation${i}`] = {\n backgroundColor: getElevation(color, overlay, i),\n };\n }\n\n return elevations;\n}\n\n// const buttonsPalette = () => ({\n// palette: {\n// // mode: \"dark\",\n// grey: {\n// main: grey[300],\n// dark: grey[400],\n// },\n// },\n// });\n\n// const buttonsTheme = theme => ({\n// components: {\n// MuiButton: {\n// variants: [\n// {\n// props: { variant: 'contained', color: 'grey' },\n// style: {\n// color: theme.palette.getContrastText(theme.palette.grey[300]),\n// },\n// },\n// {\n// props: { variant: 'outlined', color: 'grey' },\n// style: {\n// color: theme.palette.text.primary,\n// borderColor:\n// theme.palette.mode === 'light'\n// ? 'rgba(0, 0, 0, 0.23)'\n// : 'rgba(255, 255, 255, 0.23)',\n// '&.Mui-disabled': {\n// border: `1px solid ${theme.palette.action.disabledBackground}`,\n// },\n// '&:hover': {\n// borderColor:\n// theme.palette.mode === 'light'\n// ? 'rgba(0, 0, 0, 0.23)'\n// : 'rgba(255, 255, 255, 0.23)',\n// backgroundColor: alpha(\n// theme.palette.text.primary,\n// theme.palette.action.hoverOpacity,\n// ),\n// },\n// },\n// },\n// {\n// props: { color: 'grey', variant: 'text' },\n// style: {\n// color: 'black',\n// '&:hover': {\n// backgroundColor: alpha(\n// theme.palette.text.primary,\n// theme.palette.action.hoverOpacity,\n// ),\n// },\n// },\n// },\n// ],\n// },\n// },\n// });\n\ninterface PaletteOptions extends PaletteOptionsMui {\n mode: ThemeType;\n expert: string;\n grey?: {\n main?: string;\n dark?: string;\n 50?: string;\n 100?: string;\n 200?: string;\n 300?: string;\n 400?: string;\n 500?: string;\n 600?: string;\n 700?: string;\n 800?: string;\n 900?: string;\n A100?: string;\n A200?: string;\n A400?: string;\n A700?: string;\n };\n}\n\ninterface ThemeOptions extends ThemeOptionsMui {\n name: ThemeName;\n palette?: PaletteOptions;\n toolbar?: CSSProperties;\n saveToolbar?: {\n background: string;\n button: CSSProperties;\n };\n}\n\n/**\n * The theme creation factory function.\n */\nexport function Theme(type: ThemeName, overrides?: Record<string, any>): IobTheme {\n let options: ThemeOptions;\n let localOverrides: Record<string, any>;\n\n if (type === 'dark') {\n localOverrides = {\n MuiAppBar: {\n colorDefault: {\n backgroundColor: '#272727',\n },\n },\n MuiLink: {\n root: {\n textTransform: 'uppercase',\n transition: 'color .3s ease',\n color: orange[200],\n '&:hover': {\n color: orange[100],\n },\n },\n },\n MuiPaper: getElevations('#121212', '#fff'),\n };\n\n options = {\n name: type,\n palette: {\n mode: 'dark',\n background: {\n paper: '#121212',\n default: '#121212',\n },\n primary: {\n main: '#4dabf5',\n },\n secondary: {\n main: '#436a93',\n },\n expert: '#14bb00',\n text: {\n primary: '#ffffff',\n secondary: '#ffffff',\n },\n },\n };\n } else if (type === 'blue') {\n localOverrides = {\n MuiAppBar: {\n colorDefault: {\n backgroundColor: '#3399CC',\n },\n },\n MuiLink: {\n root: {\n textTransform: 'uppercase',\n transition: 'color .3s ease',\n color: orange[400],\n '&:hover': {\n color: orange[300],\n },\n },\n },\n };\n\n options = {\n name: type,\n palette: {\n mode: 'dark',\n background: {\n paper: '#151d21',\n default: '#151d21',\n },\n primary: {\n main: '#4dabf5',\n },\n secondary: {\n main: '#436a93',\n },\n expert: '#14bb00',\n text: {\n primary: '#ffffff',\n secondary: '#ffffff',\n },\n },\n };\n } else if (type === 'colored') {\n localOverrides = {\n MuiAppBar: {\n colorDefault: {\n backgroundColor: '#2a3135',\n },\n },\n MuiLink: {\n root: {\n textTransform: 'uppercase',\n transition: 'color .3s ease',\n color: orange[200],\n '&:hover': {\n color: orange[100],\n },\n },\n },\n MuiPaper: getElevations('#151d21', '#fff'),\n };\n\n options = {\n name: type,\n palette: {\n mode: 'light',\n primary: {\n main: '#3399CC',\n },\n secondary: {\n main: '#164477',\n },\n expert: '#96fc96',\n },\n };\n } else if (type === 'PT') {\n localOverrides = {\n MuiAppBar: {\n colorDefault: {\n backgroundColor: '#0F99DE',\n },\n },\n MuiLink: {\n root: {\n textTransform: 'uppercase',\n transition: 'color .3s ease',\n color: orange[400],\n '&:hover': {\n color: orange[300],\n },\n },\n },\n };\n\n options = {\n name: type,\n palette: {\n mode: 'light',\n primary: {\n main: '#0F99DE',\n },\n secondary: {\n main: '#88A536',\n },\n expert: '#BD1B24',\n },\n };\n } else if (type === 'DX') {\n localOverrides = {\n MuiAppBar: {\n colorDefault: {\n backgroundColor: '#a9a9a9',\n },\n },\n MuiLink: {\n root: {\n textTransform: 'uppercase',\n transition: 'color .3s ease',\n color: orange[400],\n '&:hover': {\n color: orange[300],\n },\n },\n },\n };\n\n options = {\n name: type,\n palette: {\n mode: 'light',\n primary: {\n main: '#F5F5F7',\n },\n secondary: {\n main: '#a9a9a9',\n },\n expert: '#BD1B24',\n text: {\n primary: '#007AFE',\n secondary: '#007AFE',\n disabled: '#007AFEAA',\n },\n },\n };\n } else {\n localOverrides = {\n MuiLink: {\n root: {\n textTransform: 'uppercase',\n transition: 'color .3s ease',\n color: orange[400],\n '&:hover': {\n color: orange[300],\n },\n },\n },\n };\n\n options = {\n name: type,\n palette: {\n mode: 'light',\n primary: {\n main: '#3399CC',\n dark: '#256c97',\n light: '#76d0fd',\n },\n secondary: {\n main: '#164477',\n },\n expert: '#14bb00',\n },\n };\n }\n\n options.toolbar = {\n height: 48,\n };\n\n options.saveToolbar = {\n background: (options.palette?.primary as SimplePaletteColorOptions)?.main,\n button: {\n borderRadius: 3,\n height: 32,\n },\n };\n\n if (options.palette) {\n options.palette.grey = {\n main: grey[300],\n dark: grey[400],\n };\n }\n\n const theme: IobTheme = createTheme(options) as IobTheme;\n\n const palette: PaletteOptions = theme.palette as PaletteOptions;\n\n return createTheme(theme, {\n ...(overrides || undefined),\n components: {\n ...localOverrides,\n MuiButton: {\n variants: [\n {\n props: { variant: 'contained', color: 'grey' },\n style: {\n backgroundColor: palette.grey?.[300],\n color:\n palette.getContrastText && palette.grey?.[300]\n ? palette.getContrastText(palette.grey[300])\n : undefined,\n },\n },\n {\n props: { variant: 'outlined', color: 'grey' },\n style: {\n color: palette.text?.primary,\n borderColor: palette.mode === 'light' ? 'rgba(0, 0, 0, 0.23)' : 'rgba(255, 255, 255, 0.23)',\n '&.Mui-disabled': {\n border: `1px solid ${palette.action?.disabledBackground}`,\n },\n '&:hover': {\n borderColor:\n palette.mode === 'light' ? 'rgba(0, 0, 0, 0.23)' : 'rgba(255, 255, 255, 0.23)',\n backgroundColor: alpha(\n palette.text?.primary || '',\n palette.action?.hoverOpacity || 0.04,\n ),\n },\n },\n },\n {\n props: { variant: 'text', color: 'grey' },\n style: {\n color: palette.text?.primary,\n '&:hover': {\n backgroundColor: alpha(\n palette.text?.primary || '',\n palette.action?.hoverOpacity || 0.04,\n ),\n },\n },\n },\n ],\n },\n ...(overrides?.components || undefined),\n },\n }) as IobTheme;\n}\n"]}
1
+ {"version":3,"file":"Theme.js","sourceRoot":"./src/","sources":["Theme.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,KAAK,EAA4C,MAAM,sBAAsB,CAAC;AACpG,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAMpD,MAAM,IAAI,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC,GAAG,EAAE,GAAG,GAAG,CAAC;AAEjC;;GAEG;AACH,SAAS,KAAK,CAAC,GAAW;IACtB,MAAM,GAAG,GAAwC;QAC7C,CAAC,EAAE,CAAC;QACJ,CAAC,EAAE,CAAC;QACJ,CAAC,EAAE,CAAC;KAC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CAAC,eAAe,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;gCAC5C,CAAC,CAAC,SAAS;yBACtB;qBACJ;oBACD;wBACI,KAAK,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE;wBAC7C,KAAK,EAAE;4BACH,KAAK,EAAE,OAAO,CAAC,IAAI,EAAE,OAAO;4BAC5B,WAAW,EAAE,OAAO,CAAC,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,2BAA2B;4BAC3F,gBAAgB,EAAE;gCACd,MAAM,EAAE,aAAa,OAAO,CAAC,MAAM,EAAE,kBAAkB,EAAE;6BAC5D;4BACD,SAAS,EAAE;gCACP,WAAW,EACP,OAAO,CAAC,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,2BAA2B;gCAClF,eAAe,EAAE,KAAK,CAClB,OAAO,CAAC,IAAI,EAAE,OAAO,IAAI,EAAE,EAC3B,OAAO,CAAC,MAAM,EAAE,YAAY,IAAI,IAAI,CACvC;6BACJ;yBACJ;qBACJ;oBACD;wBACI,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE;wBACzC,KAAK,EAAE;4BACH,KAAK,EAAE,OAAO,CAAC,IAAI,EAAE,OAAO;4BAC5B,SAAS,EAAE;gCACP,eAAe,EAAE,KAAK,CAClB,OAAO,CAAC,IAAI,EAAE,OAAO,IAAI,EAAE,EAC3B,OAAO,CAAC,MAAM,EAAE,YAAY,IAAI,IAAI,CACvC;6BACJ;yBACJ;qBACJ;iBACJ;aACJ;YACD,GAAG,CAAC,SAAS,EAAE,UAAU,IAAI,SAAS,CAAC;SAC1C;KACJ,CAAa,CAAC;AACnB,CAAC","sourcesContent":["import { type CSSProperties } from 'react';\nimport { createTheme, alpha, type PaletteOptions as PaletteOptionsMui } from '@mui/material/styles';\nimport { orange, grey } from '@mui/material/colors';\n\nimport type { SimplePaletteColorOptions } from '@mui/material/styles/createPalette';\nimport type { ThemeOptions as ThemeOptionsMui } from '@mui/material/styles/createTheme';\nimport type { IobTheme, ThemeName, ThemeType } from './types';\n\nconst step = (16 - 5) / 23 / 100;\n\n/**\n * Convert hex color in the format '#rrggbb' or '#rgb' to an RGB object.\n */\nfunction toInt(hex: string): { r: number; g: number; b: number } {\n const rgb: { r: number; g: number; b: number } = {\n r: 0,\n g: 0,\n b: 0,\n };\n\n if (hex.length === 7) {\n rgb.r = parseInt(hex.substring(1, 3), 16);\n rgb.g = parseInt(hex.substring(3, 5), 16);\n rgb.b = parseInt(hex.substring(5, 7), 16);\n } else if (hex.length === 4) {\n const r = hex[1];\n const g = hex[2];\n const b = hex[3];\n\n rgb.r = parseInt(r + r, 16);\n rgb.g = parseInt(g + g, 16);\n rgb.b = parseInt(b + b, 16);\n }\n\n return rgb;\n}\n\n/**\n * Convert an RGB object to a hex color string in the format '#rrggbb'.\n */\nfunction toHex(int: { r: number; g: number; b: number }): string {\n return `#${Math.round(int.r).toString(16)}${Math.round(int.g).toString(16)}${Math.round(int.b).toString(16)}`;\n}\n\n/** Returns the hex color string in the format '#rrggbb' */\nfunction getElevation(\n /** color in the format '#rrggbb' or '#rgb' */\n color: string,\n /** overlay color in the format '#rrggbb' or '#rgb' */\n overlayColor: string,\n /** elevation as an integer starting with 1 */\n elevation: number,\n): string {\n const rgb: { r: number; g: number; b: number } = toInt(color);\n const overlay: { r: number; g: number; b: number } = toInt(overlayColor);\n\n rgb.r += overlay.r * (0.05 + step * (elevation - 1));\n rgb.g += overlay.g * (0.05 + step * (elevation - 1));\n rgb.b += overlay.b * (0.05 + step * (elevation - 1));\n\n return toHex(rgb);\n}\n\n/**\n * Get all 24 elevations of the given color and overlay.\n *\n * @param color color in the format '#rrggbb' or '#rgb'\n * @param overlay overlay color in the format '#rrggbb' or '#rgb'\n */\nfunction getElevations(color: string, overlay: string): Record<string, CSSProperties> {\n const elevations: Record<string, CSSProperties> = {};\n\n for (let i = 1; i <= 24; i++) {\n elevations[`elevation${i}`] = {\n backgroundColor: getElevation(color, overlay, i),\n };\n }\n\n return elevations;\n}\n\n// const buttonsPalette = () => ({\n// palette: {\n// // mode: \"dark\",\n// grey: {\n// main: grey[300],\n// dark: grey[400],\n// },\n// },\n// });\n\n// const buttonsTheme = theme => ({\n// components: {\n// MuiButton: {\n// variants: [\n// {\n// props: { variant: 'contained', color: 'grey' },\n// style: {\n// color: theme.palette.getContrastText(theme.palette.grey[300]),\n// },\n// },\n// {\n// props: { variant: 'outlined', color: 'grey' },\n// style: {\n// color: theme.palette.text.primary,\n// borderColor:\n// theme.palette.mode === 'light'\n// ? 'rgba(0, 0, 0, 0.23)'\n// : 'rgba(255, 255, 255, 0.23)',\n// '&.Mui-disabled': {\n// border: `1px solid ${theme.palette.action.disabledBackground}`,\n// },\n// '&:hover': {\n// borderColor:\n// theme.palette.mode === 'light'\n// ? 'rgba(0, 0, 0, 0.23)'\n// : 'rgba(255, 255, 255, 0.23)',\n// backgroundColor: alpha(\n// theme.palette.text.primary,\n// theme.palette.action.hoverOpacity,\n// ),\n// },\n// },\n// },\n// {\n// props: { color: 'grey', variant: 'text' },\n// style: {\n// color: 'black',\n// '&:hover': {\n// backgroundColor: alpha(\n// theme.palette.text.primary,\n// theme.palette.action.hoverOpacity,\n// ),\n// },\n// },\n// },\n// ],\n// },\n// },\n// });\n\ninterface PaletteOptions extends PaletteOptionsMui {\n mode: ThemeType;\n expert: string;\n grey?: {\n main?: string;\n dark?: string;\n 50?: string;\n 100?: string;\n 200?: string;\n 300?: string;\n 400?: string;\n 500?: string;\n 600?: string;\n 700?: string;\n 800?: string;\n 900?: string;\n A100?: string;\n A200?: string;\n A400?: string;\n A700?: string;\n };\n}\n\ninterface ThemeOptions extends ThemeOptionsMui {\n name: ThemeName;\n palette?: PaletteOptions;\n toolbar?: CSSProperties;\n saveToolbar?: {\n background: string;\n button: CSSProperties;\n };\n}\n\n/**\n * The theme creation factory function.\n */\nexport function Theme(type: ThemeName, overrides?: Record<string, any>): IobTheme {\n let options: ThemeOptions;\n let localOverrides: Record<string, any>;\n\n if (type === 'dark') {\n localOverrides = {\n MuiAppBar: {\n colorDefault: {\n backgroundColor: '#272727',\n },\n },\n MuiLink: {\n root: {\n textTransform: 'uppercase',\n transition: 'color .3s ease',\n color: orange[200],\n '&:hover': {\n color: orange[100],\n },\n },\n },\n MuiPaper: getElevations('#121212', '#fff'),\n };\n\n options = {\n name: type,\n palette: {\n mode: 'dark',\n background: {\n paper: '#121212',\n default: '#121212',\n },\n primary: {\n main: '#4dabf5',\n },\n secondary: {\n main: '#436a93',\n },\n expert: '#14bb00',\n text: {\n primary: '#ffffff',\n secondary: '#ffffff',\n },\n },\n };\n } else if (type === 'blue') {\n localOverrides = {\n MuiAppBar: {\n colorDefault: {\n backgroundColor: '#3399CC',\n },\n },\n MuiLink: {\n root: {\n textTransform: 'uppercase',\n transition: 'color .3s ease',\n color: orange[400],\n '&:hover': {\n color: orange[300],\n },\n },\n },\n };\n\n options = {\n name: type,\n palette: {\n mode: 'dark',\n background: {\n paper: '#151d21',\n default: '#151d21',\n },\n primary: {\n main: '#4dabf5',\n },\n secondary: {\n main: '#436a93',\n },\n expert: '#14bb00',\n text: {\n primary: '#ffffff',\n secondary: '#ffffff',\n },\n },\n };\n } else if (type === 'colored') {\n localOverrides = {\n MuiAppBar: {\n colorDefault: {\n backgroundColor: '#2a3135',\n },\n },\n MuiLink: {\n root: {\n textTransform: 'uppercase',\n transition: 'color .3s ease',\n color: orange[200],\n '&:hover': {\n color: orange[100],\n },\n },\n },\n MuiPaper: getElevations('#151d21', '#fff'),\n };\n\n options = {\n name: type,\n palette: {\n mode: 'light',\n primary: {\n main: '#3399CC',\n },\n secondary: {\n main: '#164477',\n },\n expert: '#96fc96',\n },\n };\n } else if (type === 'PT') {\n localOverrides = {\n MuiAppBar: {\n colorDefault: {\n backgroundColor: '#0F99DE',\n },\n },\n MuiLink: {\n root: {\n textTransform: 'uppercase',\n transition: 'color .3s ease',\n color: orange[400],\n '&:hover': {\n color: orange[300],\n },\n },\n },\n };\n\n options = {\n name: type,\n palette: {\n mode: 'light',\n primary: {\n main: '#0F99DE',\n },\n secondary: {\n main: '#88A536',\n },\n expert: '#BD1B24',\n },\n };\n } else if (type === 'DX') {\n localOverrides = {\n MuiAppBar: {\n colorDefault: {\n backgroundColor: '#a9a9a9',\n },\n },\n MuiLink: {\n root: {\n textTransform: 'uppercase',\n transition: 'color .3s ease',\n color: orange[400],\n '&:hover': {\n color: orange[300],\n },\n },\n },\n };\n\n options = {\n name: type,\n palette: {\n mode: 'light',\n primary: {\n main: '#F5F5F7',\n },\n secondary: {\n main: '#a9a9a9',\n },\n expert: '#BD1B24',\n text: {\n primary: '#007AFE',\n secondary: '#007AFE',\n disabled: '#007AFEAA',\n },\n },\n };\n } else {\n localOverrides = {\n MuiLink: {\n root: {\n textTransform: 'uppercase',\n transition: 'color .3s ease',\n color: orange[400],\n '&:hover': {\n color: orange[300],\n },\n },\n },\n };\n\n options = {\n name: type,\n palette: {\n mode: 'light',\n primary: {\n main: '#3399CC',\n dark: '#256c97',\n light: '#76d0fd',\n },\n secondary: {\n main: '#164477',\n },\n expert: '#14bb00',\n },\n };\n }\n\n options.toolbar = {\n height: 48,\n };\n\n options.saveToolbar = {\n background: (options.palette?.primary as SimplePaletteColorOptions)?.main,\n button: {\n borderRadius: 3,\n height: 32,\n },\n };\n\n if (options.palette) {\n options.palette.grey = {\n main: grey[300],\n dark: grey[400],\n };\n }\n\n const theme: IobTheme = createTheme(options) as IobTheme;\n\n const palette: PaletteOptions = theme.palette as PaletteOptions;\n\n return createTheme(theme, {\n ...(overrides || undefined),\n components: {\n ...localOverrides,\n MuiButton: {\n variants: [\n {\n props: { variant: 'contained', color: 'grey' },\n style: {\n backgroundColor: palette.grey?.[300],\n color:\n palette.getContrastText && palette.grey?.[300]\n ? palette.getContrastText(palette.grey[300])\n : undefined,\n },\n },\n {\n props: { variant: 'outlined', color: 'grey' },\n style: {\n color: palette.text?.primary,\n borderColor: palette.mode === 'light' ? 'rgba(0, 0, 0, 0.23)' : 'rgba(255, 255, 255, 0.23)',\n '&.Mui-disabled': {\n border: `1px solid ${palette.action?.disabledBackground}`,\n },\n '&:hover': {\n borderColor:\n palette.mode === 'light' ? 'rgba(0, 0, 0, 0.23)' : 'rgba(255, 255, 255, 0.23)',\n backgroundColor: alpha(\n palette.text?.primary || '',\n palette.action?.hoverOpacity || 0.04,\n ),\n },\n },\n },\n {\n props: { variant: 'text', color: 'grey' },\n style: {\n color: palette.text?.primary,\n '&:hover': {\n backgroundColor: alpha(\n palette.text?.primary || '',\n palette.action?.hoverOpacity || 0.04,\n ),\n },\n },\n },\n ],\n },\n ...(overrides?.components || undefined),\n },\n }) as IobTheme;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"parseNames.js","sourceRoot":"./src/","sources":["assets/devices/parseNames.js"],"names":[],"mappings":"AAAA,6FAA6F;AAC7F;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgCE","sourcesContent":["// this is a service script that extracts names from names.txt and places them into list.json\n/*\nconst fs = require('fs');\n\nfunction readTxt(fileName) {\n const text = fs.readFileSync(fileName).toString('utf8');\n const lines = text.split('\\n');\n const langs = lines.shift().split('\\t').map(l => l.toLowerCase().trim());\n\n const result = {};\n lines.forEach(line => {\n const words = line.split('\\t').map(w => w.trim());\n const word = {};\n result[words[0]] = word;\n langs.forEach((lang, i) => {\n word[lang] = words[i];\n });\n });\n return result;\n}\n\nfunction mergeTexts(jsonFileName, words) {\n const file = require(jsonFileName);\n file.forEach(item => {\n if (typeof item.name === 'string' && words[item.name]) {\n item.name = words[item.name];\n }\n });\n fs.writeFileSync(jsonFileName, JSON.stringify(file, null, 2));\n}\n\nconst words = readTxt(__dirname + '/names.txt');\nmergeTexts(__dirname + '/list.json', words);\n*/\n"]}
1
+ {"version":3,"file":"parseNames.js","sourceRoot":"./src/","sources":["assets/devices/parseNames.js"],"names":[],"mappings":"AAAA,6FAA6F;AAC7F;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgCE","sourcesContent":["// this is a service script that extracts names from names.txt and places them into list.json\r\n/*\r\nconst fs = require('fs');\r\n\r\nfunction readTxt(fileName) {\r\n const text = fs.readFileSync(fileName).toString('utf8');\r\n const lines = text.split('\\n');\r\n const langs = lines.shift().split('\\t').map(l => l.toLowerCase().trim());\r\n\r\n const result = {};\r\n lines.forEach(line => {\r\n const words = line.split('\\t').map(w => w.trim());\r\n const word = {};\r\n result[words[0]] = word;\r\n langs.forEach((lang, i) => {\r\n word[lang] = words[i];\r\n });\r\n });\r\n return result;\r\n}\r\n\r\nfunction mergeTexts(jsonFileName, words) {\r\n const file = require(jsonFileName);\r\n file.forEach(item => {\r\n if (typeof item.name === 'string' && words[item.name]) {\r\n item.name = words[item.name];\r\n }\r\n });\r\n fs.writeFileSync(jsonFileName, JSON.stringify(file, null, 2));\r\n}\r\n\r\nconst words = readTxt(__dirname + '/names.txt');\r\nmergeTexts(__dirname + '/list.json', words);\r\n*/\r\n"]}