@iobroker/adapter-react-v5 4.0.0 → 4.0.2

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/Connection.d.ts CHANGED
@@ -1,4 +1,6 @@
1
- export { PROGRESS };
2
1
  export default Connection;
3
2
  import { PROGRESS } from "@iobroker/socket-client/Connection";
3
+ import { ERRORS } from "@iobroker/socket-client/Connection";
4
+ import { PERMISSION_ERROR } from "@iobroker/socket-client/Connection";
4
5
  import { Connection } from "@iobroker/socket-client/Connection";
6
+ export { PROGRESS, ERRORS, PERMISSION_ERROR };
package/Connection.js CHANGED
@@ -3,6 +3,18 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
+ Object.defineProperty(exports, "ERRORS", {
7
+ enumerable: true,
8
+ get: function get() {
9
+ return _socketClient.ERRORS;
10
+ }
11
+ });
12
+ Object.defineProperty(exports, "PERMISSION_ERROR", {
13
+ enumerable: true,
14
+ get: function get() {
15
+ return _socketClient.PERMISSION_ERROR;
16
+ }
17
+ });
6
18
  Object.defineProperty(exports, "PROGRESS", {
7
19
  enumerable: true,
8
20
  get: function get() {
package/Connection.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"Connection.js","names":["Connection"],"sources":["Connection.js"],"sourcesContent":["import { Connection, PROGRESS } from '@iobroker/socket-client';\n\nexport { PROGRESS };\n\nexport default Connection;\n"],"mappings":";;;;;;;;;;;;AAAA;AAA+D,eAIhDA,wBAAU;AAAA"}
1
+ {"version":3,"file":"Connection.js","names":["Connection"],"sources":["Connection.js"],"sourcesContent":["import { Connection, PROGRESS, ERRORS, PERMISSION_ERROR } from '@iobroker/socket-client';\n\nexport { PROGRESS, ERRORS, PERMISSION_ERROR };\n\nexport default Connection;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAyF,eAI1EA,wBAAU;AAAA"}
package/README.md CHANGED
@@ -10,7 +10,7 @@ If you want to create the configuration page with react:
10
10
  - Change `name` from `src` to `ADAPTERNAME-admin` (Of course replace `ADAPTERNAME` with yours)
11
11
  - Add to devDependencies:
12
12
  ```
13
- "@iobroker/adapter-react": "^4.0.0",
13
+ "@iobroker/adapter-react": "^4.0.2",
14
14
  ```
15
15
  Versions can be higher.
16
16
  So your src/package.json should look like:
@@ -611,7 +611,7 @@ This project uses icons from [Flaticon](https://www.flaticon.com/).
611
611
  ioBroker GmbH has a valid license for all of used icons.
612
612
  The icons may not be reused in other projects without the proper flaticon license or flaticon subscription.
613
613
 
614
- ## Migration to v5
614
+ ## Migration from adapter-react to adapter-react-v5
615
615
  ### In src/package.json => dependencies
616
616
  - `"@iobroker/adapter-react": "^2.0.22",` => `"@iobroker/adapter-react-v5": "^3.1.34",`
617
617
  - `"@material-ui/core": "^4.12.3",` => `"@mui/material": "^5.10.9",`
@@ -637,13 +637,30 @@ The icons may not be reused in other projects without the proper flaticon licens
637
637
 
638
638
  If you still have questions, try to find an answer [here](https://mui.com/guides/migration-v4/).
639
639
 
640
+ ## Migration from adapter-react-v5@3.x to adapter-react-v5@4.x
641
+ - Look for getObjectView socket requests and replace `socket.getObjectView('startKey', 'endKey', 'instance')` to `socket.getObjectViewSystem('instance', 'startKey', 'endKey')`
642
+ - Look for calls of custom like
643
+ ```
644
+ this.props.socket._socket.emit('getObjectView', 'system', 'custom', {startKey: '', endKey:'\u9999'}, (err, objs) => {
645
+ (objs?.rows || [])
646
+ .forEach(item => console.log(item.id, item.value));
647
+ });
648
+ ```
649
+ to
650
+ ```
651
+ socket.getObjectViewCustom('custom', 'state', 'startKey', 'endKey')
652
+ .then(objects => {
653
+ Object.keys(objects).forEach(obj => console.log(obj._id));
654
+ });
655
+ ```
656
+
640
657
  <!--
641
658
  Placeholder for the next version (at the beginning of the line):
642
659
  ### **WORK IN PROGRESS**
643
660
  -->
644
661
 
645
662
  ## Changelog
646
- ### 4.0.0 (2022-11-30)
663
+ ### 4.0.2 (2022-12-01)
647
664
  * (bluefox) use `@iobroker/socket-client` instead of `Connection.js`
648
665
 
649
666
  ### 3.5.3 (2022-11-30)
package/index.d.ts CHANGED
@@ -1,6 +1,5 @@
1
1
  export { default as Theme } from "./Theme";
2
2
  export * from "./Theme";
3
- export * from "./Connection";
4
3
  export * from "./i18n";
5
4
  export * from "./Prompt";
6
5
  export * from "./Components/ColorPicker";
@@ -114,5 +113,5 @@ export { default as SimpleCronDialog } from "./Dialogs/SimpleCron";
114
113
  export { default as TextInput } from "./Dialogs/TextInput";
115
114
  export { default as ConfigGeneric } from "./Components/JsonConfigComponent/ConfigGeneric";
116
115
  export { default as AdminConnection } from "./AdminConnection";
117
- export { default as Connection, PROGRESS } from "./Connection";
118
116
  export { default as i18n, default as I18n } from "./i18n";
117
+ export { default as Connection, PROGRESS } from "./Connection";
package/index.js CHANGED
@@ -4,9 +4,6 @@ export * from './Theme';
4
4
  // export { default as GenericApp } from './GenericApp';
5
5
  // export * from './GenericApp';
6
6
 
7
- export { default as Connection } from './Connection';
8
- export * from './Connection';
9
-
10
7
  export { default as i18n } from './i18n';
11
8
  export { default as I18n } from './i18n';
12
9
  export * from './i18n';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iobroker/adapter-react-v5",
3
- "version": "4.0.0",
3
+ "version": "4.0.2",
4
4
  "description": "React classes to develop admin interfaces for ioBroker with react.",
5
5
  "author": {
6
6
  "name": "bluefox",
@@ -29,19 +29,19 @@
29
29
  "dependencies": {
30
30
  "@emotion/react": "^11.10.5",
31
31
  "@emotion/styled": "^11.10.5",
32
- "@mui/icons-material": "^5.10.9",
33
- "@mui/material": "^5.10.12",
34
- "@mui/styles": "^5.10.10",
35
- "@mui/x-date-pickers": "5.0.2",
32
+ "@mui/icons-material": "^5.10.16",
33
+ "@mui/material": "^5.10.16",
34
+ "@mui/styles": "^5.10.16",
35
+ "@mui/x-date-pickers": "5.0.9",
36
36
  "@iobroker/socket-client": "^2.0.0",
37
37
  "react-cropper": "^2.1.8",
38
- "@sentry/browser": "^7.18.0",
39
- "@sentry/integrations": "^7.17.4",
38
+ "@sentry/browser": "^7.23.0",
39
+ "@sentry/integrations": "^7.23.0",
40
40
  "@types/iobroker": "^4.0.5",
41
41
  "react-color": "^2.19.3",
42
42
  "react-colorful": "^5.6.1",
43
43
  "react-dropzone": "^14.2.3",
44
- "react-icons": "^4.6.0",
44
+ "react-icons": "^4.7.1",
45
45
  "react-inlinesvg": "^3.0.1",
46
46
  "react-text-mask": "^5.5.0"
47
47
  }