@equinor/echo-framework 0.8.6 → 0.9.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.
- package/dist/_virtual/_tslib.js +1 -1
- package/dist/components/contextualAppLinks/externalLinkButtons/externalLinkButtons.helpers.d.ts +46 -0
- package/dist/components/contextualAppLinks/externalLinkButtons/externalLinkButtons.helpers.test.d.ts +1 -0
- package/dist/components/contextualAppLinks/externalLinkButtons/externalLinkToCommApp.d.ts +14 -0
- package/dist/components/contextualAppLinks/externalLinkButtons/externalLinkToMcApp.d.ts +3 -1
- package/dist/components/contextualAppLinks/externalLinkButtons/externalLinkToProCoSys.d.ts +1 -2
- package/dist/components/contextualAppLinks/externalLinkButtons/externalLinkToSap.d.ts +3 -0
- package/dist/components/contextualAppLinks/externalLinkButtons/externalLinkToSemiDoc.d.ts +4 -0
- package/dist/components/contextualAppLinks/externalLinkButtons/externalLinkToTr2000.d.ts +2 -0
- package/dist/components/contextualAppLinks/externalLinkButtons/iconButtonSpinner.d.ts +18 -0
- package/dist/components/contextualAppLinks/externalLinkButtons/index.d.ts +1 -0
- package/dist/components/externalLinkButton/externalLinkButton.d.ts +16 -7
- package/dist/components/panel/corePanelLeft.d.ts +1 -4
- package/dist/components/panel/corePanelRight.d.ts +1 -4
- package/dist/components/realTimeData/components/contextButton/RealTimeContextButton.d.ts +1 -0
- package/dist/components/realTimeData/components/contextPopover/Popover.d.ts +4 -1
- package/dist/components/realTimeData/hooks/useSignalR.d.ts +3 -2
- package/dist/coreApplication/EchoContent.d.ts +0 -1
- package/dist/coreApplication/index.d.ts +0 -1
- package/dist/hooks/hookLibrary.d.ts +3 -9
- package/dist/hooks/index.d.ts +0 -1
- package/dist/hooks/useSemi.d.ts +11 -7
- package/dist/hooks/useTagDetails.d.ts +10 -3
- package/dist/index.d.ts +12 -7
- package/dist/node_modules/@microsoft/signalr/dist/esm/DefaultHttpClient.js +2 -2
- package/dist/node_modules/@microsoft/signalr/dist/esm/Errors.js +3 -3
- package/dist/node_modules/@microsoft/signalr/dist/esm/FetchHttpClient.js +6 -4
- package/dist/node_modules/@microsoft/signalr/dist/esm/HttpConnection.js +16 -14
- package/dist/node_modules/@microsoft/signalr/dist/esm/HubConnection.js +14 -10
- package/dist/node_modules/@microsoft/signalr/dist/esm/LongPollingTransport.js +14 -10
- package/dist/node_modules/@microsoft/signalr/dist/esm/ServerSentEventsTransport.js +8 -5
- package/dist/node_modules/@microsoft/signalr/dist/esm/Utils.js +5 -3
- package/dist/node_modules/@microsoft/signalr/dist/esm/WebSocketTransport.js +6 -5
- package/dist/node_modules/@microsoft/signalr/dist/esm/XhrHttpClient.js +2 -2
- package/dist/services/api/api-manager.d.ts +1 -1
- package/dist/services/api/api-tag-details.d.ts +17 -0
- package/dist/services/api/api-tag-details.test.d.ts +1 -0
- package/dist/services/api/api-tags.d.ts +17 -0
- package/dist/services/api/api-tags.test.d.ts +1 -0
- package/dist/services/api/index.d.ts +1 -0
- package/dist/services/echopediaAnalyticsModule/echopediaAnalyticsModule.d.ts +1 -0
- package/dist/services/eventCallbacks/plantChanged.d.ts +1 -1
- package/dist/src/components/containers/layout.module.css.js +1 -4
- package/dist/src/components/containers/layouts.js +10 -122
- package/dist/src/components/contextualAppLinks/externalAppsMenu.js +4 -4
- package/dist/src/components/contextualAppLinks/externalLinkButtons/allExternalLinks.js +66 -11
- package/dist/src/components/contextualAppLinks/externalLinkButtons/externalLinkButtons.helpers.js +169 -0
- package/dist/src/components/contextualAppLinks/externalLinkButtons/externalLinkToCommApp.js +95 -0
- package/dist/src/components/contextualAppLinks/externalLinkButtons/externalLinkToMcApp.js +62 -5
- package/dist/src/components/contextualAppLinks/externalLinkButtons/externalLinkToProCoSys.js +45 -11
- package/dist/src/components/contextualAppLinks/externalLinkButtons/externalLinkToSafeX.js +1 -1
- package/dist/src/components/contextualAppLinks/externalLinkButtons/externalLinkToSap.js +60 -11
- package/dist/src/components/contextualAppLinks/externalLinkButtons/externalLinkToSemiDoc.js +16 -5
- package/dist/src/components/contextualAppLinks/externalLinkButtons/externalLinkToStid.js +1 -1
- package/dist/src/components/contextualAppLinks/externalLinkButtons/externalLinkToTr2000.js +67 -16
- package/dist/src/components/contextualAppLinks/externalLinkButtons/iconButtonSpinner.js +44 -0
- package/dist/src/components/contextualAppLinks/externalLinkButtons/iconButtonSpinner.module.css.js +15 -0
- package/dist/src/components/errorBoundary/errorBoundary.js +2 -2
- package/dist/src/components/externalLinkButton/externalLinkButton.js +99 -36
- package/dist/src/components/externalLinkButton/externalLinkButton.module.css.js +5 -2
- package/dist/src/components/footer/footer.module.css.js +1 -1
- package/dist/src/components/pageMenu/version/version.js +4 -2
- package/dist/src/components/panel/corePanelLeft.js +2 -5
- package/dist/src/components/panel/corePanelLeft.module.css.js +1 -1
- package/dist/src/components/panel/corePanelRight.js +2 -5
- package/dist/src/components/panel/corePanelRight.module.css.js +1 -1
- package/dist/src/components/plantSelector/plantSelector.js +4 -2
- package/dist/src/components/projectSelector/ProcosysProjectSelector.js +4 -2
- package/dist/src/components/realTimeData/RealTimePopoverButton.js +18 -2
- package/dist/src/components/realTimeData/components/connectorForIMSTag/IMSConnector.module.css.js +3 -2
- package/dist/src/components/realTimeData/components/connectorForIMSTag/RealTimeConnectorForIMSTag.js +46 -7
- package/dist/src/components/realTimeData/components/contextButton/RealTimeContextButton.js +4 -4
- package/dist/src/components/realTimeData/hooks/useRealTimeHub.js +4 -2
- package/dist/src/components/realTimeData/hooks/useSignalR.js +24 -8
- package/dist/src/coreApplication/EchoContent.js +2 -11
- package/dist/src/globalStyles.css.js +1 -1
- package/dist/src/hooks/hookLibrary.js +0 -9
- package/dist/src/hooks/index.js +0 -3
- package/dist/src/hooks/useSemi.js +40 -14
- package/dist/src/hooks/useTagDetails.js +118 -45
- package/dist/src/icons/common/CommissionApp-icon.png.js +7 -0
- package/dist/src/icons/common/Evision.svg.js +4 -4
- package/dist/src/icons/common/Fusion.svg.js +31 -27
- package/dist/src/icons/common/McApp.svg.js +11 -8
- package/dist/src/icons/common/Notification.svg.js +81 -0
- package/dist/src/icons/common/ProCoSysIcon.svg.js +4 -4
- package/dist/src/icons/common/Robim.svg.js +66 -0
- package/dist/src/icons/common/SapLogo.svg.js +6 -6
- package/dist/src/icons/common/SemiIcon.svg.js +12 -13
- package/dist/src/icons/common/Stid.svg.js +4 -4
- package/dist/src/icons/common/TR2000.svg.js +9 -8
- package/dist/src/icons/common/WorkOrder.svg.js +71 -0
- package/dist/src/icons/common/Yammer.svg.js +3 -3
- package/dist/src/icons/common/satos-logo.png.js +7 -0
- package/dist/src/index.js +38 -73
- package/dist/src/index2.js +201 -0
- package/dist/src/services/api/api-manager.js +6 -4
- package/dist/src/services/api/api-plantinfo.js +10 -6
- package/dist/src/services/api/api-plants.js +6 -2
- package/dist/src/services/api/api-realtimedata.js +9 -3
- package/dist/src/services/api/api-tag-details.js +69 -0
- package/dist/src/services/api/api-tags.js +29 -0
- package/dist/src/services/api/api-version.js +8 -4
- package/dist/src/services/echopediaAnalyticsModule/echopediaAnalyticsModule.js +10 -0
- package/dist/src/services/eventCallbacks/plantChanged.js +6 -2
- package/dist/src/types/pingableSources.js +1 -0
- package/dist/src/utils/copyText.js +6 -2
- package/dist/src/utils/navigationUtils.js +28 -0
- package/dist/src/utils/plantInfo.js +25 -20
- package/dist/src/utils/startup.js +6 -4
- package/dist/types/api-proCoSysTagResponse.d.ts +8 -0
- package/dist/types/hookLibrary.d.ts +0 -4
- package/dist/types/pingableSources.d.ts +2 -1
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/navigationUtils.d.ts +7 -0
- package/dist/utils/navigationUtils.test.d.ts +1 -0
- package/dist/utils/plantInfo.d.ts +6 -0
- package/dist/utils/plantInfo.test.d.ts +1 -0
- package/package.json +34 -33
- package/dist/coreApplication/EchoBarComponent.d.ts +0 -6
- package/dist/hooks/useScreenOrientation.d.ts +0 -1
- package/dist/src/coreApplication/EchoBarComponent.js +0 -190
- package/dist/src/coreApplication/EchoContent.module.css.js +0 -21
- package/dist/src/hooks/useScreenOrientation.js +0 -50
|
@@ -2,7 +2,3 @@ export declare type SetActiveTagNo = (tagNo: string, activeTagTab?: string, acti
|
|
|
2
2
|
export declare type TagData = [(tagNo: string, instCode: string) => void];
|
|
3
3
|
export declare type SetActiveCommPackNo = (commPackNo: string, activeCommPackProject: string, activeCommPackTab?: string, activeCommPackSubTab?: string) => void;
|
|
4
4
|
export declare type SetActiveMcPackNo = (mcPackNo: string, activeMcPackProject: string, activeMcPackTab?: string, activeMcPackSubTab?: string) => void;
|
|
5
|
-
export interface DeviceOrientation {
|
|
6
|
-
portrait: boolean;
|
|
7
|
-
landscape: boolean;
|
|
8
|
-
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export declare enum PingableSources {
|
|
2
|
-
Sap = "https://p03web.statoil.no/sap/public/icmandir/its/lsgui/images/img/splashscreen_corbu.png"
|
|
2
|
+
Sap = "https://p03web.statoil.no/sap/public/icmandir/its/lsgui/images/img/splashscreen_corbu.png",
|
|
3
|
+
Statos = "https://satos.equinor.com/files/4/bilder/johan_svedrup.png"
|
|
3
4
|
}
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Helper function to execute a redirection to an outer source.
|
|
3
|
+
*
|
|
4
|
+
* @param {string} link Link to navigate to.
|
|
5
|
+
* @param {boolean} redirect Set this to 'true' to load the given url to navigate to in the current tab / window.
|
|
6
|
+
*/
|
|
7
|
+
export declare const goToExternalLink: (link: string, redirect?: boolean) => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
import { EchoHubPlant } from '../types/echoHubPlant';
|
|
2
|
+
/**
|
|
3
|
+
* Method for setting echo hub plant information in local storage under the key echoHubPlantInfo
|
|
4
|
+
*
|
|
5
|
+
* @param {EchoHubPlant[]} plants list of plant information to add to local storage
|
|
6
|
+
*/
|
|
7
|
+
export declare function setPlantInfo(plants: EchoHubPlant[]): void;
|
|
2
8
|
/**
|
|
3
9
|
* Method for getting echo hub plant information from local storage.
|
|
4
10
|
* If plant information is not in local storage, then this method will try to fetch the information
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@equinor/echo-framework",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"description": "Modules and components for EchoWeb, utilizing EchoCore",
|
|
5
5
|
"main": "dist/src/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -37,8 +37,8 @@
|
|
|
37
37
|
"@equinor/echo-base": "^0.6.8",
|
|
38
38
|
"@equinor/echo-components": "^0.4.0",
|
|
39
39
|
"@equinor/echo-core": "^0.6.11",
|
|
40
|
-
"@equinor/echo-search": "^0.12.
|
|
41
|
-
"@equinor/echo-utils": "^0.2.
|
|
40
|
+
"@equinor/echo-search": "^0.12.4",
|
|
41
|
+
"@equinor/echo-utils": "^0.2.11",
|
|
42
42
|
"@equinor/eds-core-react": "^0.19.0",
|
|
43
43
|
"react": "^17.0.2",
|
|
44
44
|
"react-dom": "^17.0.2",
|
|
@@ -46,60 +46,61 @@
|
|
|
46
46
|
"styled-components": "^5.3.5"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
|
-
"@babel/core": "^7.
|
|
50
|
-
"@babel/preset-env": "^7.
|
|
51
|
-
"@babel/preset-react": "^7.
|
|
49
|
+
"@babel/core": "^7.18.2",
|
|
50
|
+
"@babel/preset-env": "^7.18.2",
|
|
51
|
+
"@babel/preset-react": "^7.17.12",
|
|
52
52
|
"@equinor/echo-base": "^0.6.8",
|
|
53
53
|
"@equinor/echo-components": "^0.4.0",
|
|
54
54
|
"@equinor/echo-core": "^0.6.11",
|
|
55
55
|
"@equinor/echo-scripts": "^0.1.5",
|
|
56
|
-
"@equinor/echo-search": "^0.12.
|
|
56
|
+
"@equinor/echo-search": "^0.12.4",
|
|
57
57
|
"@equinor/echo-update": "^1.3.0",
|
|
58
|
-
"@equinor/echo-utils": "^0.2.
|
|
58
|
+
"@equinor/echo-utils": "^0.2.11",
|
|
59
59
|
"@equinor/eds-core-react": "^0.19.0",
|
|
60
|
-
"@modular-css/rollup": "^28.
|
|
60
|
+
"@modular-css/rollup": "^28.1.2",
|
|
61
61
|
"@rollup/plugin-babel": "^5.3.1",
|
|
62
|
-
"@rollup/plugin-commonjs": "^
|
|
62
|
+
"@rollup/plugin-commonjs": "^22.0.0",
|
|
63
63
|
"@rollup/plugin-image": "^2.1.1",
|
|
64
64
|
"@rollup/plugin-json": "^4.1.0",
|
|
65
|
-
"@rollup/plugin-node-resolve": "^13.
|
|
66
|
-
"@rollup/plugin-typescript": "^8.3.
|
|
67
|
-
"@rollup/plugin-url": "^
|
|
65
|
+
"@rollup/plugin-node-resolve": "^13.3.0",
|
|
66
|
+
"@rollup/plugin-typescript": "^8.3.2",
|
|
67
|
+
"@rollup/plugin-url": "^7.0.0",
|
|
68
68
|
"@svgr/rollup": "^6.2.1",
|
|
69
|
-
"@testing-library/react-hooks": "^
|
|
70
|
-
"@types/jest": "^27.
|
|
71
|
-
"@types/node": "^17.0.
|
|
72
|
-
"@types/react": "^
|
|
73
|
-
"@types/react-dom": "^
|
|
69
|
+
"@testing-library/react-hooks": "^8.0.0",
|
|
70
|
+
"@types/jest": "^27.5.1",
|
|
71
|
+
"@types/node": "^17.0.38",
|
|
72
|
+
"@types/react": "^18.0.10",
|
|
73
|
+
"@types/react-dom": "^18.0.5",
|
|
74
74
|
"@types/react-router-dom": "^5.3.3",
|
|
75
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
76
|
-
"@typescript-eslint/parser": "^5.
|
|
75
|
+
"@typescript-eslint/eslint-plugin": "^5.27.0",
|
|
76
|
+
"@typescript-eslint/parser": "^5.27.0",
|
|
77
77
|
"@wessberg/rollup-plugin-ts": "^2.0.4",
|
|
78
|
-
"autoprefixer": "^10.4.
|
|
79
|
-
"babel-jest": "^
|
|
80
|
-
"eslint": "^8.
|
|
78
|
+
"autoprefixer": "^10.4.7",
|
|
79
|
+
"babel-jest": "^28.1.0",
|
|
80
|
+
"eslint": "^8.16.0",
|
|
81
81
|
"eslint-config-prettier": "^8.5.0",
|
|
82
82
|
"eslint-plugin-prettier": "^4.0.0",
|
|
83
|
-
"eslint-plugin-react": "^7.
|
|
84
|
-
"eslint-plugin-react-hooks": "^4.
|
|
85
|
-
"jest": "^
|
|
86
|
-
"jest-
|
|
87
|
-
"
|
|
83
|
+
"eslint-plugin-react": "^7.30.0",
|
|
84
|
+
"eslint-plugin-react-hooks": "^4.5.0",
|
|
85
|
+
"jest": "^28.1.0",
|
|
86
|
+
"jest-environment-jsdom": "^28.1.0",
|
|
87
|
+
"jest-expo": "^45.0.1",
|
|
88
|
+
"postcss": "^8.4.14",
|
|
88
89
|
"postcss-assets": "^6.0.0",
|
|
89
90
|
"postcss-modules": "^4.3.1",
|
|
90
91
|
"prettier": "^2.6.2",
|
|
91
92
|
"react": "^17.0.2",
|
|
92
93
|
"react-dom": "^17.0.2",
|
|
93
94
|
"react-router-dom": "^5.3.0",
|
|
94
|
-
"rollup": "^2.
|
|
95
|
+
"rollup": "^2.75.5",
|
|
95
96
|
"rollup-plugin-delete": "^2.0.0",
|
|
96
97
|
"rollup-plugin-postcss": "^4.0.2",
|
|
97
98
|
"rollup-plugin-typescript-paths": "^1.3.1",
|
|
98
99
|
"rollup-plugin-typescript2": "^0.31.2",
|
|
99
100
|
"styled-components": "^5.3.5",
|
|
100
|
-
"ts-jest": "^
|
|
101
|
-
"tslib": "^2.
|
|
102
|
-
"typescript": "=4.
|
|
101
|
+
"ts-jest": "^28.0.3",
|
|
102
|
+
"tslib": "^2.4.0",
|
|
103
|
+
"typescript": "=4.7.2"
|
|
103
104
|
},
|
|
104
105
|
"compilerOptions": {
|
|
105
106
|
"declaration": true
|
|
@@ -112,6 +113,6 @@
|
|
|
112
113
|
"npm": ">=7.0.0"
|
|
113
114
|
},
|
|
114
115
|
"dependencies": {
|
|
115
|
-
"@microsoft/signalr": "^6.0.
|
|
116
|
+
"@microsoft/signalr": "^6.0.5"
|
|
116
117
|
}
|
|
117
118
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function useScreenOrientation(): string;
|
|
@@ -1,190 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
4
|
-
|
|
5
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
6
|
-
|
|
7
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
8
|
-
|
|
9
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
10
|
-
|
|
11
|
-
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
12
|
-
|
|
13
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
14
|
-
|
|
15
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
16
|
-
|
|
17
|
-
Object.defineProperty(exports, '__esModule', {
|
|
18
|
-
value: true
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
var echoBase = require('@equinor/echo-base');
|
|
22
|
-
|
|
23
|
-
var echoComponents = require('@equinor/echo-components');
|
|
24
|
-
|
|
25
|
-
var EchoCore = require('@equinor/echo-core');
|
|
26
|
-
|
|
27
|
-
var edsCoreReact = require('@equinor/eds-core-react');
|
|
28
|
-
|
|
29
|
-
var React = require('react');
|
|
30
|
-
|
|
31
|
-
var reactRouterDom = require('react-router-dom');
|
|
32
|
-
|
|
33
|
-
var logo_ee = require('../icons/logo_ee.js');
|
|
34
|
-
|
|
35
|
-
var EchoContent_module = require('./EchoContent.module.css.js');
|
|
36
|
-
|
|
37
|
-
function _interopDefaultLegacy(e) {
|
|
38
|
-
return e && _typeof(e) === 'object' && 'default' in e ? e : {
|
|
39
|
-
'default': e
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
44
|
-
|
|
45
|
-
var EchoBarComponent = function EchoBarComponent(_ref) {
|
|
46
|
-
var isLandscape = _ref.isLandscape;
|
|
47
|
-
|
|
48
|
-
var _React$useState = React.useState(false),
|
|
49
|
-
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
50
|
-
shouldRenderBar = _React$useState2[0],
|
|
51
|
-
setShouldRenderBar = _React$useState2[1];
|
|
52
|
-
|
|
53
|
-
var _React$useState3 = React.useState(''),
|
|
54
|
-
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
55
|
-
activeKey = _React$useState4[0],
|
|
56
|
-
setActiveKey = _React$useState4[1];
|
|
57
|
-
|
|
58
|
-
var _React$useState5 = React.useState(false),
|
|
59
|
-
_React$useState6 = _slicedToArray(_React$useState5, 2),
|
|
60
|
-
isSyncing = _React$useState6[0],
|
|
61
|
-
setIsSyncing = _React$useState6[1];
|
|
62
|
-
|
|
63
|
-
var _EchoCore$usePanels = EchoCore.usePanels(),
|
|
64
|
-
setActivePanel = _EchoCore$usePanels.setActivePanel;
|
|
65
|
-
|
|
66
|
-
var goToInternalLink = EchoCore.useInternalLink();
|
|
67
|
-
|
|
68
|
-
var _EchoCore$usePlantSet = EchoCore.usePlantSettings(),
|
|
69
|
-
selectedInstCode = _EchoCore$usePlantSet.instCode;
|
|
70
|
-
|
|
71
|
-
var history = reactRouterDom.useHistory();
|
|
72
|
-
var shouldRenderBottomBar = React.useCallback(function () {
|
|
73
|
-
var isMounted = true;
|
|
74
|
-
|
|
75
|
-
if (window.innerWidth < 768 && !isLandscape || window.innerWidth < 927 && isLandscape && isMounted) {
|
|
76
|
-
setShouldRenderBar(true);
|
|
77
|
-
} else {
|
|
78
|
-
setShouldRenderBar(false);
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
return function () {
|
|
82
|
-
isMounted = false;
|
|
83
|
-
};
|
|
84
|
-
}, [isLandscape]);
|
|
85
|
-
React.useEffect(function () {
|
|
86
|
-
var isMounted = true;
|
|
87
|
-
var unSubscribeSyncing = echoBase.eventHub.subscribe('isSyncing', function (active) {
|
|
88
|
-
if (isMounted) {
|
|
89
|
-
setIsSyncing(active);
|
|
90
|
-
}
|
|
91
|
-
});
|
|
92
|
-
return function () {
|
|
93
|
-
isMounted = false;
|
|
94
|
-
unSubscribeSyncing();
|
|
95
|
-
};
|
|
96
|
-
});
|
|
97
|
-
|
|
98
|
-
var onClickButton = function onClickButton(key) {
|
|
99
|
-
setActivePanel('');
|
|
100
|
-
|
|
101
|
-
if (key === activeKey) {
|
|
102
|
-
if (key === 'menu' || key === 'search') {
|
|
103
|
-
setActivePanel('');
|
|
104
|
-
} else {
|
|
105
|
-
history.go(-1);
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
setActiveKey('');
|
|
109
|
-
} else {
|
|
110
|
-
setActiveKey(key);
|
|
111
|
-
|
|
112
|
-
switch (key) {
|
|
113
|
-
case 'home':
|
|
114
|
-
return history.push("/?instCode=".concat(selectedInstCode));
|
|
115
|
-
|
|
116
|
-
case 'search':
|
|
117
|
-
return setActivePanel(EchoCore.ECHO_CORE_SEARCH);
|
|
118
|
-
|
|
119
|
-
case 'camera':
|
|
120
|
-
return goToInternalLink('/camera');
|
|
121
|
-
|
|
122
|
-
case 'menu':
|
|
123
|
-
return setActivePanel(EchoCore.ECHO_CORE_MAIN);
|
|
124
|
-
|
|
125
|
-
default:
|
|
126
|
-
return null;
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
setActiveKey('');
|
|
131
|
-
};
|
|
132
|
-
|
|
133
|
-
React.useEffect(function () {
|
|
134
|
-
shouldRenderBottomBar();
|
|
135
|
-
window.addEventListener('resize', shouldRenderBottomBar);
|
|
136
|
-
return function () {
|
|
137
|
-
window.removeEventListener('resize', shouldRenderBottomBar);
|
|
138
|
-
};
|
|
139
|
-
}, [shouldRenderBottomBar, shouldRenderBar]);
|
|
140
|
-
var EchoIcon = logo_ee.icon;
|
|
141
|
-
return shouldRenderBar ? /*#__PURE__*/React__default["default"].createElement(echoComponents.EchoBottomBar, {
|
|
142
|
-
style: {
|
|
143
|
-
zIndex: 'var( --echo-framework-z-level-bottom-bar)'
|
|
144
|
-
}
|
|
145
|
-
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
146
|
-
className: "".concat(EchoContent_module["default"].barButtons, " ").concat(activeKey === 'home' ? EchoContent_module["default"].activeButton : '')
|
|
147
|
-
}, /*#__PURE__*/React__default["default"].createElement(edsCoreReact.Button, {
|
|
148
|
-
variant: "ghost_icon",
|
|
149
|
-
onClick: function onClick() {
|
|
150
|
-
return onClickButton('home');
|
|
151
|
-
}
|
|
152
|
-
}, /*#__PURE__*/React__default["default"].createElement(EchoIcon, null))), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
153
|
-
className: "".concat(EchoContent_module["default"].barButtons, " ").concat(activeKey === 'search' ? EchoContent_module["default"].activeButton : '')
|
|
154
|
-
}, /*#__PURE__*/React__default["default"].createElement(edsCoreReact.Button, {
|
|
155
|
-
variant: "ghost_icon",
|
|
156
|
-
onClick: function onClick() {
|
|
157
|
-
return onClickButton('search');
|
|
158
|
-
}
|
|
159
|
-
}, /*#__PURE__*/React__default["default"].createElement(echoComponents.Icon, {
|
|
160
|
-
name: 'search',
|
|
161
|
-
color: echoComponents.themeConst.echoText
|
|
162
|
-
}))), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
163
|
-
className: "".concat(EchoContent_module["default"].barButtons, " ").concat(activeKey === 'camera' ? EchoContent_module["default"].activeButton : '')
|
|
164
|
-
}, /*#__PURE__*/React__default["default"].createElement(edsCoreReact.Button, {
|
|
165
|
-
variant: "ghost_icon",
|
|
166
|
-
onClick: function onClick() {
|
|
167
|
-
return onClickButton('camera');
|
|
168
|
-
}
|
|
169
|
-
}, /*#__PURE__*/React__default["default"].createElement(echoComponents.Icon, {
|
|
170
|
-
name: 'camera',
|
|
171
|
-
color: echoComponents.themeConst.echoText
|
|
172
|
-
}))), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
173
|
-
className: "".concat(EchoContent_module["default"].barButtons, " ").concat(activeKey === 'menu' ? EchoContent_module["default"].activeButton : '')
|
|
174
|
-
}, /*#__PURE__*/React__default["default"].createElement(edsCoreReact.Button, {
|
|
175
|
-
variant: "ghost_icon",
|
|
176
|
-
onClick: function onClick() {
|
|
177
|
-
return onClickButton('menu');
|
|
178
|
-
}
|
|
179
|
-
}, isSyncing ? /*#__PURE__*/React__default["default"].createElement(echoComponents.Icon, {
|
|
180
|
-
className: EchoContent_module["default"].spinningIcon,
|
|
181
|
-
color: echoComponents.themeConst.echoText,
|
|
182
|
-
name: 'sync'
|
|
183
|
-
}) : /*#__PURE__*/React__default["default"].createElement(echoComponents.Icon, {
|
|
184
|
-
name: 'menu',
|
|
185
|
-
color: echoComponents.themeConst.echoText
|
|
186
|
-
})))) : null;
|
|
187
|
-
};
|
|
188
|
-
|
|
189
|
-
exports.EchoBarComponent = EchoBarComponent;
|
|
190
|
-
exports["default"] = EchoBarComponent;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
|
|
7
|
-
var styleInject_es = require('../../node_modules/style-inject/dist/style-inject.es.js');
|
|
8
|
-
|
|
9
|
-
var css_248z = ".EchoContent-module_echoContent__DgKg-{height:100%;padding:env(safe-area-inset-top,20px) env(safe-area-inset-right,20px) env(safe-area-inset-bottom,20px) env(safe-area-inset-left,20px);width:100%}.EchoContent-module_mobileWrapper__I1UNf{height:calc(100% - 60px);position:relative}.EchoContent-module_echoContentContainer__-yhpr{height:100%}.EchoContent-module_echoModuleContainer__NsbOv{width:100%}.EchoContent-module_barButtons__F8xrV{align-items:center;display:flex;height:100%;justify-content:center;width:100%}.EchoContent-module_activeButton__5xhQu{background-color:var(--equiGreen3);border-top:2px solid var(--equiGreen1)}@media screen and (max-width:927px) and (orientation:landscape){.EchoContent-module_activeButton__5xhQu{border-right:2px solid var(--equiGreen1);border-top:0}}@media screen and (orientation:landscape){.EchoContent-module_echoContentContainer__-yhpr{display:flex;flex-direction:row}}@media screen and (orientation:portrait){.EchoContent-module_echoModuleContainer__NsbOv{height:calc(100% - 48px);overflow:hidden}}@keyframes EchoContent-module_spinAnimation__gNXNq{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}.EchoContent-module_spinningIcon__am10d{animation:EchoContent-module_spinAnimation__gNXNq 1.5s linear infinite reverse}";
|
|
10
|
-
var style = {
|
|
11
|
-
"echoContent": "EchoContent-module_echoContent__DgKg-",
|
|
12
|
-
"mobileWrapper": "EchoContent-module_mobileWrapper__I1UNf",
|
|
13
|
-
"echoContentContainer": "EchoContent-module_echoContentContainer__-yhpr",
|
|
14
|
-
"echoModuleContainer": "EchoContent-module_echoModuleContainer__NsbOv",
|
|
15
|
-
"barButtons": "EchoContent-module_barButtons__F8xrV",
|
|
16
|
-
"activeButton": "EchoContent-module_activeButton__5xhQu",
|
|
17
|
-
"spinningIcon": "EchoContent-module_spinningIcon__am10d",
|
|
18
|
-
"spinAnimation": "EchoContent-module_spinAnimation__gNXNq"
|
|
19
|
-
};
|
|
20
|
-
styleInject_es["default"](css_248z);
|
|
21
|
-
exports["default"] = style;
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
4
|
-
|
|
5
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
6
|
-
|
|
7
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
8
|
-
|
|
9
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
10
|
-
|
|
11
|
-
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
12
|
-
|
|
13
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
14
|
-
|
|
15
|
-
Object.defineProperty(exports, '__esModule', {
|
|
16
|
-
value: true
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
var React = require('react');
|
|
20
|
-
|
|
21
|
-
function useScreenOrientation() {
|
|
22
|
-
var _React$useState = React.useState(''),
|
|
23
|
-
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
24
|
-
orientation = _React$useState2[0],
|
|
25
|
-
setOrientation = _React$useState2[1];
|
|
26
|
-
|
|
27
|
-
var updateOrientation = React.useCallback(function () {
|
|
28
|
-
var isMounted = true;
|
|
29
|
-
|
|
30
|
-
if (window.innerWidth > window.innerHeight && isMounted) {
|
|
31
|
-
setOrientation('landscape');
|
|
32
|
-
} else {
|
|
33
|
-
setOrientation('portrait');
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
return function () {
|
|
37
|
-
isMounted = false;
|
|
38
|
-
};
|
|
39
|
-
}, []);
|
|
40
|
-
React.useEffect(function () {
|
|
41
|
-
updateOrientation();
|
|
42
|
-
window.addEventListener('resize', updateOrientation);
|
|
43
|
-
return function () {
|
|
44
|
-
window.removeEventListener('resize', updateOrientation);
|
|
45
|
-
};
|
|
46
|
-
}, [updateOrientation]);
|
|
47
|
-
return orientation;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
exports.useScreenOrientation = useScreenOrientation;
|