@iobroker/gui-components 8.0.2 → 10.0.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.
Files changed (160) hide show
  1. package/LICENSE +22 -22
  2. package/README.md +834 -543
  3. package/build/AdminConnection.js.map +1 -1
  4. package/build/Components/404.js +13 -13
  5. package/build/Components/404.js.map +1 -1
  6. package/build/Components/ColorPicker.js.map +1 -1
  7. package/build/Components/ComplexCron.js +2 -2
  8. package/build/Components/ComplexCron.js.map +1 -1
  9. package/build/Components/CopyToClipboard.js.map +1 -1
  10. package/build/Components/CustomModal.js +1 -1
  11. package/build/Components/CustomModal.js.map +1 -1
  12. package/build/Components/DeviceType/DeviceTypeIcon.js +1 -0
  13. package/build/Components/DeviceType/DeviceTypeIcon.js.map +1 -1
  14. package/build/Components/DeviceType/DeviceTypeSelector.js +2 -2
  15. package/build/Components/DeviceType/DeviceTypeSelector.js.map +1 -1
  16. package/build/Components/DeviceType/i18n/de.json +1 -0
  17. package/build/Components/DeviceType/i18n/en.json +1 -0
  18. package/build/Components/DeviceType/i18n/fr.json +1 -0
  19. package/build/Components/DeviceType/i18n/it.json +1 -0
  20. package/build/Components/DeviceType/i18n/nl.json +1 -0
  21. package/build/Components/DeviceType/i18n/pl.json +1 -0
  22. package/build/Components/DeviceType/i18n/pt.json +1 -0
  23. package/build/Components/DeviceType/i18n/ru.json +1 -0
  24. package/build/Components/DeviceType/i18n/uk.json +1 -0
  25. package/build/Components/DeviceType/i18n/zh-cn.json +1 -0
  26. package/build/Components/FileBrowser.d.ts +39 -4
  27. package/build/Components/FileBrowser.js +104 -11
  28. package/build/Components/FileBrowser.js.map +1 -1
  29. package/build/Components/FileViewer.js +2 -4
  30. package/build/Components/FileViewer.js.map +1 -1
  31. package/build/Components/Icon.d.ts +1 -3
  32. package/build/Components/Icon.js +11 -11
  33. package/build/Components/Icon.js.map +1 -1
  34. package/build/Components/Image.js +8 -4
  35. package/build/Components/Image.js.map +1 -1
  36. package/build/Components/InfoBox.js +1 -1
  37. package/build/Components/InfoBox.js.map +1 -1
  38. package/build/Components/IobUri.js +5 -5
  39. package/build/Components/IobUri.js.map +1 -1
  40. package/build/Components/Loader.d.ts +2 -3
  41. package/build/Components/Loader.js +25 -257
  42. package/build/Components/Loader.js.map +1 -1
  43. package/build/Components/Loaders/Community.d.ts +31 -0
  44. package/build/Components/Loaders/Community.js +265 -0
  45. package/build/Components/Loaders/Community.js.map +1 -0
  46. package/build/Components/Loaders/HA.d.ts +17 -0
  47. package/build/Components/Loaders/HA.js +99 -0
  48. package/build/Components/Loaders/HA.js.map +1 -0
  49. package/build/Components/Loaders/MV.js.map +1 -1
  50. package/build/Components/Loaders/NW.d.ts +17 -0
  51. package/build/Components/Loaders/NW.js +70 -0
  52. package/build/Components/Loaders/NW.js.map +1 -0
  53. package/build/Components/Loaders/PT.js +103 -103
  54. package/build/Components/Loaders/PT.js.map +1 -1
  55. package/build/Components/Loaders/Vendor.js +7 -7
  56. package/build/Components/Loaders/Vendor.js.map +1 -1
  57. package/build/Components/MDUtils.js.map +1 -1
  58. package/build/Components/ObjectBrowser.d.ts +25 -406
  59. package/build/Components/ObjectBrowser.js +460 -1543
  60. package/build/Components/ObjectBrowser.js.map +1 -1
  61. package/build/Components/Router.js.map +1 -1
  62. package/build/Components/SaveCloseButtons.js.map +1 -1
  63. package/build/Components/Schedule.d.ts +27 -1
  64. package/build/Components/Schedule.js +60 -50
  65. package/build/Components/Schedule.js.map +1 -1
  66. package/build/Components/SelectWithIcon.js +1 -1
  67. package/build/Components/SelectWithIcon.js.map +1 -1
  68. package/build/Components/SimpleCron/cronText.js.map +1 -1
  69. package/build/Components/SimpleCron/index.js +3 -3
  70. package/build/Components/SimpleCron/index.js.map +1 -1
  71. package/build/Components/TabContainer.js +7 -2
  72. package/build/Components/TabContainer.js.map +1 -1
  73. package/build/Components/TabContent.d.ts +1 -1
  74. package/build/Components/TabContent.js +5 -5
  75. package/build/Components/TabContent.js.map +1 -1
  76. package/build/Components/TabHeader.js +2 -2
  77. package/build/Components/TabHeader.js.map +1 -1
  78. package/build/Components/TableResize.js.map +1 -1
  79. package/build/Components/TextWithIcon.js.map +1 -1
  80. package/build/Components/TreeTable.d.ts +1 -0
  81. package/build/Components/TreeTable.js +16 -6
  82. package/build/Components/TreeTable.js.map +1 -1
  83. package/build/Components/UploadImage.js +305 -305
  84. package/build/Components/UploadImage.js.map +1 -1
  85. package/build/Components/Utils.d.ts +17 -3
  86. package/build/Components/Utils.js +167 -9
  87. package/build/Components/Utils.js.map +1 -1
  88. package/build/Components/objectBrowser.types.d.ts +496 -0
  89. package/build/Components/objectBrowserUtils.d.ts +170 -0
  90. package/build/Components/objectBrowserUtils.js +1375 -0
  91. package/build/Components/objectBrowserUtils.js.map +1 -0
  92. package/build/Connection.js.map +1 -1
  93. package/build/Dialogs/ComplexCron.js.map +1 -1
  94. package/build/Dialogs/Confirm.js.map +1 -1
  95. package/build/Dialogs/Cron.js.map +1 -1
  96. package/build/Dialogs/Error.js.map +1 -1
  97. package/build/Dialogs/Message.js.map +1 -1
  98. package/build/Dialogs/SelectFile.d.ts +1 -1
  99. package/build/Dialogs/SelectFile.js +1 -1
  100. package/build/Dialogs/SelectFile.js.map +1 -1
  101. package/build/Dialogs/SelectID.d.ts +1 -1
  102. package/build/Dialogs/SelectID.js +1 -1
  103. package/build/Dialogs/SelectID.js.map +1 -1
  104. package/build/Dialogs/SimpleCron.js.map +1 -1
  105. package/build/Dialogs/TextInput.js +1 -1
  106. package/build/Dialogs/TextInput.js.map +1 -1
  107. package/build/GenericApp.d.ts +6 -4
  108. package/build/GenericApp.js +22 -16
  109. package/build/GenericApp.js.map +1 -1
  110. package/build/Prompt.js +7 -7
  111. package/build/Prompt.js.map +1 -1
  112. package/build/Theme.js +57 -11
  113. package/build/Theme.js.map +1 -1
  114. package/build/assets/devices/parseNames.js +1 -0
  115. package/build/assets/devices/parseNames.js.map +1 -1
  116. package/build/assets/rooms/parseNames.js +1 -0
  117. package/build/assets/rooms/parseNames.js.map +1 -1
  118. package/build/dictionary.js.map +1 -1
  119. package/build/globals.d.ts +2 -0
  120. package/build/i18n/de.json +5 -66
  121. package/build/i18n/en.json +5 -66
  122. package/build/i18n/es.json +5 -66
  123. package/build/i18n/fr.json +5 -66
  124. package/build/i18n/it.json +5 -61
  125. package/build/i18n/nl.json +5 -61
  126. package/build/i18n/pl.json +5 -61
  127. package/build/i18n/pt.json +5 -61
  128. package/build/i18n/ru.json +5 -61
  129. package/build/i18n/uk.json +5 -61
  130. package/build/i18n/zh-cn.json +5 -61
  131. package/build/i18n.js +12 -15
  132. package/build/i18n.js.map +1 -1
  133. package/build/index.css +56 -56
  134. package/build/index.d.ts +9 -4
  135. package/build/index.js +5 -2
  136. package/build/index.js.map +1 -1
  137. package/build/modulefederation.admin.config.d.ts +1 -0
  138. package/build/modulefederation.admin.config.js +1 -1
  139. package/build/modulefederation.admin.config.js.map +1 -1
  140. package/build/types.d.ts +4 -84
  141. package/i18n/de.json +5 -66
  142. package/i18n/en.json +5 -66
  143. package/i18n/es.json +5 -66
  144. package/i18n/fr.json +5 -66
  145. package/i18n/it.json +5 -61
  146. package/i18n/nl.json +5 -61
  147. package/i18n/pl.json +5 -61
  148. package/i18n/pt.json +5 -61
  149. package/i18n/ru.json +5 -61
  150. package/i18n/uk.json +5 -61
  151. package/i18n/zh-cn.json +5 -61
  152. package/index.css +56 -56
  153. package/modulefederation.admin.config.d.ts +1 -0
  154. package/modulefederation.admin.config.js +1 -2
  155. package/package.json +50 -35
  156. package/tasksExample.ts +93 -0
  157. package/build/LegacyConnection.d.ts +0 -938
  158. package/build/LegacyConnection.js +0 -2849
  159. package/build/LegacyConnection.js.map +0 -1
  160. package/tasksExample.js +0 -91
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@iobroker/gui-components",
3
- "version": "8.0.2",
4
- "description": "React components to develop ioBroker interfaces with react.",
3
+ "version": "10.0.1",
4
+ "description": "Shared React components (React 19 / MUI 9) to develop ioBroker interfaces. Successor of @iobroker/adapter-react-v5.",
5
5
  "author": {
6
6
  "name": "bluefox",
7
7
  "email": "dogafox@gmail.com"
@@ -9,22 +9,22 @@
9
9
  "scripts": {
10
10
  "prepublishOnly": "npm run build",
11
11
  "build:ts": "tsc -p tsconfig.build.json",
12
- "build": "node tasks --0-clean && node tasks --2-copy && node tasks --3-patchReadme && npm run build:ts",
12
+ "build": "node tasks.ts --0-clean && node tasks.ts --2-copy && node tasks.ts --3-patchReadme && npm run build:ts",
13
13
  "release": "release-script --noPush --yes --lf",
14
14
  "release-patch": "release-script patch --yes --lf",
15
15
  "release-minor": "release-script minor --yes --lf",
16
16
  "release-major": "release-script major --yes --lf",
17
17
  "update-packages": "npx -y npm-check-updates --upgrade",
18
- "0-clean": "node tasks --0-clean",
18
+ "0-clean": "node tasks.ts --0-clean",
19
19
  "1-build": "tsc -p tsconfig.build.json",
20
- "2-copy": "node tasks --2-copy",
21
- "3-patchReadme": "node tasks --3-patchReadme",
22
- "npm": "npm i -f",
20
+ "2-copy": "node tasks.ts --2-copy",
21
+ "3-patchReadme": "node tasks.ts --3-patchReadme",
22
+ "npm": "npm i",
23
23
  "lint": "eslint -c eslint.config.mjs src"
24
24
  },
25
25
  "repository": {
26
26
  "type": "git",
27
- "url": "git+https://github.com/ioBroker/gui-components.git"
27
+ "url": "git+https://github.com/ioBroker/adapter-react-v5.git"
28
28
  },
29
29
  "publishConfig": {
30
30
  "access": "public"
@@ -41,46 +41,61 @@
41
41
  "i18n/",
42
42
  "index.css",
43
43
  "LICENSE",
44
- "tasksExample.js",
44
+ "tasksExample.ts",
45
45
  "craco-module-federation.js",
46
46
  "modulefederation.admin.config.d.ts",
47
47
  "modulefederation.admin.config.js"
48
48
  ],
49
49
  "license": "MIT",
50
50
  "bugs": {
51
- "url": "https://github.com/ioBroker/gui-components/issues"
51
+ "url": "https://github.com/ioBroker/adapter-react-v5/issues"
52
52
  },
53
- "homepage": "https://github.com/ioBroker/gui-components#readme",
53
+ "homepage": "https://github.com/ioBroker/adapter-react-v5#readme",
54
54
  "dependencies": {
55
- "@emotion/react": "^11.14.0",
56
- "@emotion/styled": "^11.14.1",
57
- "@iobroker/js-controller-common": "^7.0.8-alpha.7-20250928-40cb80c18",
58
- "@iobroker/js-controller-common-db": "^7.0.8-alpha.7-20250928-40cb80c18",
59
- "@iobroker/socket-client": "5.0.2",
60
- "@iobroker/type-detector": "^4.5.1",
61
- "@iobroker/types": "^7.0.8-alpha.7-20250928-40cb80c18",
62
- "@mui/icons-material": "^6.5.0",
63
- "@mui/material": "^6.5.0",
64
- "@sentry/browser": "^10.8.0",
65
- "cronstrue": "^2.61.0",
66
- "file-selector": "^2.1.2",
55
+ "@iobroker/js-controller-common": "^7.2.2",
56
+ "@iobroker/js-controller-common-db": "^7.2.2",
57
+ "@iobroker/socket-client": "^5.2.1",
58
+ "@iobroker/type-detector": "^5.0.15",
59
+ "@iobroker/types": "^7.2.2",
60
+ "@sentry/browser": "^10.68.0",
61
+ "cronstrue": "^3.24.0",
62
+ "file-selector": "^4.0.2",
67
63
  "react-color": "^2.19.3",
68
- "react-colorful": "^5.6.1",
64
+ "react-colorful": "^5.8.0",
69
65
  "react-cropper": "^2.3.3",
70
- "react-dropzone": "^14.3.8",
71
- "react-icons": "^5.4.0",
72
- "react-inlinesvg": "^4.2.0"
66
+ "react-dropzone": "^19.1.1",
67
+ "react-icons": "^5.7.0",
68
+ "react-inlinesvg": "^4.5.0"
69
+ },
70
+ "peerDependencies": {
71
+ "react": "^19.0.0",
72
+ "react-dom": "^19.0.0",
73
+ "@mui/icons-material": "^9.0.0",
74
+ "@mui/material": "^9.0.0"
73
75
  },
74
76
  "devDependencies": {
75
- "@alcalzone/release-script": "^5.0.0",
76
- "@alcalzone/release-script-plugin-license": "^4.0.0",
77
- "@iobroker/build-tools": "^2.0.15",
78
- "@iobroker/eslint-config": "^2.2.0",
79
- "@types/node": "^22.15.30",
80
- "@types/react": "^18.3.23",
77
+ "@alcalzone/release-script": "^5.2.1",
78
+ "@alcalzone/release-script-plugin-license": "^5.2.0",
79
+ "@emotion/react": "^11.14.0",
80
+ "@emotion/styled": "^11.14.1",
81
+ "@iobroker/build-tools": "^3.0.1",
82
+ "@iobroker/eslint-config": "^2.3.4",
83
+ "@mui/icons-material": "^9.2.0",
84
+ "@mui/material": "^9.2.0",
85
+ "@types/node": "^26.1.1",
86
+ "@types/react": "^19.2.17",
81
87
  "@types/react-color": "^3.0.13",
82
- "ajv": "^8.17.1",
88
+ "@types/react-dom": "^19.2.3",
89
+ "ajv": "^8.20.0",
90
+ "react": "^19.2.5",
91
+ "react-dom": "^19.2.5",
83
92
  "ts-node": "^10.9.2",
84
- "typescript": "~5.9.3"
93
+ "typescript": "~6.0.3"
94
+ },
95
+ "overrides": {
96
+ "react": "^19.2.5",
97
+ "react-dom": "^19.2.5",
98
+ "@types/react": "^19.2.17",
99
+ "@types/react-dom": "^19.2.3"
85
100
  }
86
101
  }
@@ -0,0 +1,93 @@
1
+ /**
2
+ * Copyright 2024-2026 bluefox <dogafox@gmail.com>
3
+ *
4
+ * MIT License
5
+ *
6
+ * Example of a build script for an adapter GUI that uses `@iobroker/gui-components`.
7
+ * Copy this file into the root of your adapter as `tasks.ts`.
8
+ *
9
+ * The GUI sources are expected in the `src` directory and are built with vite
10
+ * into `src/build` (see `build.outDir` in `src/vite.config.ts`).
11
+ * The result is copied into the `admin` directory of the adapter.
12
+ *
13
+ * It is executed directly by node (>= 22.18 / >= 23.6), which strips the types at load time,
14
+ * so it must stay CommonJS and use only erasable TypeScript syntax: the `typeof import(...)`
15
+ * annotations provide full typings while `require()` keeps `__dirname` available.
16
+ */
17
+ 'use strict';
18
+
19
+ const fs: typeof import('node:fs') = require('node:fs');
20
+ const {
21
+ deleteFoldersRecursive,
22
+ npmInstall,
23
+ buildReact,
24
+ copyFiles,
25
+ }: typeof import('@iobroker/build-tools') = require('@iobroker/build-tools');
26
+
27
+ const SRC = 'src';
28
+
29
+ /** Inline script in index.html that loads socket.io from the admin instance */
30
+ const SOCKET_IO_LOADER =
31
+ /<script>\s*(?:var|const|let)\s+script\s*=\s*document\.createElement\(["']script["']\)[\s\S]*?<\/script>/;
32
+
33
+ function copyAllFiles(): void {
34
+ deleteFoldersRecursive('admin', ['.png', '.json', 'i18n']);
35
+
36
+ copyFiles([`${SRC}/build/**/*`, `!${SRC}/build/**/*.map`], 'admin');
37
+ }
38
+
39
+ function clean(): void {
40
+ deleteFoldersRecursive('admin', ['.png', '.json', 'i18n']);
41
+ deleteFoldersRecursive(`${SRC}/build`);
42
+ }
43
+
44
+ function installNpmLocal(): Promise<void> {
45
+ if (fs.existsSync(`${SRC}/node_modules`)) {
46
+ return Promise.resolve();
47
+ }
48
+ return npmInstall(`${__dirname.replace(/\\/g, '/')}/${SRC}/`);
49
+ }
50
+
51
+ /**
52
+ * In the development mode socket.io is loaded from the admin instance on port 8081.
53
+ * In the production build it must be loaded from the admin instance that serves the GUI.
54
+ */
55
+ function patchFiles(): void {
56
+ for (const file of [`${__dirname}/admin/index.html`, `${__dirname}/${SRC}/build/index.html`]) {
57
+ if (fs.existsSync(file)) {
58
+ const code = fs.readFileSync(file).toString('utf8');
59
+ fs.writeFileSync(
60
+ file,
61
+ code.replace(
62
+ SOCKET_IO_LOADER,
63
+ `<script type="text/javascript" src="./../../lib/js/socket.io.js"></script>`,
64
+ ),
65
+ );
66
+ }
67
+ }
68
+ }
69
+
70
+ if (process.argv.find(arg => arg === '--0-clean')) {
71
+ clean();
72
+ } else if (process.argv.find(arg => arg === '--1-npm')) {
73
+ npmInstall(`${__dirname.replace(/\\/g, '/')}/${SRC}/`).catch((e: unknown) => {
74
+ console.error(`Cannot install: ${e}`);
75
+ process.exit(1);
76
+ });
77
+ } else if (process.argv.find(arg => arg === '--2-build')) {
78
+ buildReact(SRC, { rootDir: __dirname, vite: true }).catch((e: unknown) => {
79
+ console.error(`Cannot build: ${e}`);
80
+ process.exit(1);
81
+ });
82
+ } else if (process.argv.find(arg => arg === '--3-copy')) {
83
+ copyAllFiles();
84
+ } else if (process.argv.find(arg => arg === '--4-patch')) {
85
+ patchFiles();
86
+ } else {
87
+ clean();
88
+
89
+ installNpmLocal()
90
+ .then(() => buildReact(SRC, { rootDir: __dirname, vite: true }))
91
+ .then(() => copyAllFiles())
92
+ .then(() => patchFiles());
93
+ }