@equinor/echo-framework 0.7.13 → 0.8.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/dist/hooks/hookLibrary.d.ts +8 -2
- package/dist/hooks/index.d.ts +0 -1
- package/dist/index.d.ts +3 -3
- package/dist/src/components/containers/layout.module.css.js +1 -2
- package/dist/src/components/containers/layouts.js +5 -55
- package/dist/src/components/contextualAppLinks/externalAppsMenu.js +5 -29
- package/dist/src/components/contextualAppLinks/externalAppsMenu.module.css.js +1 -1
- package/dist/src/components/externalLinkButton/externalLinkButton.module.css.js +1 -3
- package/dist/src/components/toaster/toaster.js +1 -2
- package/dist/src/components/toaster/toaster.module.css.js +1 -2
- package/dist/src/coreApplication/EchoContent.js +26 -1
- package/dist/src/coreApplication/EchoContent.module.css.js +1 -1
- package/dist/src/globalStyles.css.js +1 -1
- package/dist/src/hooks/hookLibrary.js +9 -0
- package/dist/src/hooks/index.js +0 -3
- package/dist/src/index.js +0 -3
- package/dist/types/hookLibrary.d.ts +4 -0
- package/package.json +30 -30
- package/dist/hooks/useIsLandscape.d.ts +0 -1
- package/dist/src/hooks/useIsLandscape.js +0 -52
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { DataInformation } from '@equinor/echo-components';
|
|
2
|
-
import { SetActiveCommPackNo, SetActiveMcPackNo, SetActiveTagNo, TagData } from './../types/hookLibrary';
|
|
2
|
+
import { DeviceOrientation, SetActiveCommPackNo, SetActiveMcPackNo, SetActiveTagNo, TagData } from './../types/hookLibrary';
|
|
3
3
|
export declare enum RegisteredHookName {
|
|
4
4
|
useSetActiveTagNo = "useSetActiveTagNo",
|
|
5
5
|
useContextMenuDataInfo = "useContextMenuDataInfo",
|
|
6
6
|
useTagData = "useTagData",
|
|
7
7
|
useIsContextMenuInfoLoading = "useIsContextMenuInfoLoading",
|
|
8
8
|
useSetActiveCommPackNo = "useSetActiveCommPackNo",
|
|
9
|
-
useSetActiveMcPackNo = "useSetActiveMcPackNo"
|
|
9
|
+
useSetActiveMcPackNo = "useSetActiveMcPackNo",
|
|
10
|
+
useDeviceOrientation = "useDeviceOrientation"
|
|
10
11
|
}
|
|
11
12
|
export declare const HookLibrary: Readonly<{
|
|
12
13
|
/**
|
|
@@ -46,4 +47,9 @@ export declare const HookLibrary: Readonly<{
|
|
|
46
47
|
* @returns {SetActiveMcPackNo}
|
|
47
48
|
*/
|
|
48
49
|
useSetActiveMcPackNo: () => SetActiveMcPackNo;
|
|
50
|
+
/**
|
|
51
|
+
* Hook for detecting device orientation from native devices.
|
|
52
|
+
* @returns {DeviceOrientation}
|
|
53
|
+
*/
|
|
54
|
+
useDeviceOrientation: () => DeviceOrientation;
|
|
49
55
|
}>;
|
package/dist/hooks/index.d.ts
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ export * from './theme/themeConst';
|
|
|
13
13
|
export type { EchoHubPlant } from './types/echoHubPlant';
|
|
14
14
|
export * from './types/eventTypes';
|
|
15
15
|
export * from './types/extensions';
|
|
16
|
-
export type { SetActiveTagNo, TagData } from './types/hookLibrary';
|
|
16
|
+
export type { DeviceOrientation, SetActiveTagNo, TagData } from './types/hookLibrary';
|
|
17
17
|
export { LegendStatus, LegendType } from './types/legend';
|
|
18
18
|
export type { ModelPermissions } from './types/modelPermissions';
|
|
19
19
|
export { PingableSources } from './types/pingableSources';
|
|
@@ -34,8 +34,7 @@ declare const EchoFramework: Readonly<{
|
|
|
34
34
|
useEchoHistory(): (path: string, params?: {
|
|
35
35
|
[key: string]: string;
|
|
36
36
|
} | undefined, state?: any) => void;
|
|
37
|
-
|
|
38
|
-
useScreenOrientation(): "landscape-primary" | "landscape-secondary" | "portrait-primary" | "portrait-secondary";
|
|
37
|
+
useScreenOrientation(): string;
|
|
39
38
|
useTagDetails({ tagNo, instCode }: {
|
|
40
39
|
tagNo: string;
|
|
41
40
|
instCode: string;
|
|
@@ -46,6 +45,7 @@ declare const EchoFramework: Readonly<{
|
|
|
46
45
|
useIsContextMenuInfoLoading: () => boolean;
|
|
47
46
|
useSetActiveCommPackNo: () => import("./types/hookLibrary").SetActiveCommPackNo;
|
|
48
47
|
useSetActiveMcPackNo: () => import("./types/hookLibrary").SetActiveMcPackNo;
|
|
48
|
+
useDeviceOrientation: () => import("./types/hookLibrary").DeviceOrientation;
|
|
49
49
|
}>;
|
|
50
50
|
EchopediaComponentLibrary: Readonly<{
|
|
51
51
|
getTagItem: () => import("react").FunctionComponent<any>;
|
|
@@ -6,9 +6,8 @@ Object.defineProperty(exports, '__esModule', {
|
|
|
6
6
|
|
|
7
7
|
var styleInject_es = require('../../../node_modules/style-inject/dist/style-inject.es.js');
|
|
8
8
|
|
|
9
|
-
var css_248z = ".layout-
|
|
9
|
+
var css_248z = ".layout-module_applicationWrapper__adzds{animation:layout-module_fadeIn__-OF4H 2s;background-color:#fff;background-image:url(../../images/frontpage-brand-placeholder-vert.jpg);background-size:cover;height:100%;overflow:auto;position:relative;width:100%}@keyframes layout-module_fadeIn__-OF4H{0%{opacity:0}to{opacity:1}}@media screen and (min-width:640px){.layout-module_applicationWrapper__adzds{background-image:none}}.layout-module_mainLayoutWrapper__4kuIT{height:100%;overflow:hidden;width:100%}.layout-module_bgTransparent__bBfb-{background-color:transparent}.layout-module_footerDisclaimer__-F6dv{font-size:.7rem}.layout-module_footerLogo__CBb-F{max-height:2.5rem}.layout-module_fullBodyHeight__hQfe5{min-height:calc(100vh - 75px)!important;padding-bottom:16px}.layout-module_navbarBrand__2IOPY{color:red}::selection{background-color:#cce2ff;color:rgba(0,0,0,.87)}.layout-module_colorLayout__VHJcU{background-color:#eaf4f9;height:100%;overflow:hidden;position:relative;width:100%}.layout-module_pdfViewerNative__hnAgy{background-color:#323639;height:100%;overflow:hidden;padding-top:6.5rem;position:relative;width:100%}.layout-module_cameraLayout__iVPug{background-color:\"transparent\"}.layout-module_cameraLayout__iVPug,.layout-module_defaultLayout__3MIwa{height:100%;position:relative;width:100%}.layout-module_noPadding__7amV4{padding:0}.layout-module_noMargin__1eUBf{margin:0}@media screen and (orientation:landscape) and (max-width:927px){.layout-module_applicationWrapper__adzds,.layout-module_cameraLayout__iVPug,.layout-module_colorLayout__VHJcU,.layout-module_defaultLayout__3MIwa,.layout-module_pdfViewerNative__hnAgy{width:calc(100% - 48px)}}@media screen and (orientation:portrait) and (max-width:767px){.layout-module_applicationWrapper__adzds,.layout-module_cameraLayout__iVPug,.layout-module_colorLayout__VHJcU,.layout-module_defaultLayout__3MIwa,.layout-module_pdfViewerNative__hnAgy{height:calc(100% - 48px)}}";
|
|
10
10
|
var style = {
|
|
11
|
-
"echoContentContainer": "layout-module_echoContentContainer__0debO",
|
|
12
11
|
"applicationWrapper": "layout-module_applicationWrapper__adzds",
|
|
13
12
|
"fadeIn": "layout-module_fadeIn__-OF4H",
|
|
14
13
|
"mainLayoutWrapper": "layout-module_mainLayoutWrapper__4kuIT",
|
|
@@ -8,16 +8,6 @@ Object.defineProperty(exports, '__esModule', {
|
|
|
8
8
|
|
|
9
9
|
var React = require('react');
|
|
10
10
|
|
|
11
|
-
var EchoBarComponent = require('../../coreApplication/EchoBarComponent.js');
|
|
12
|
-
|
|
13
|
-
require('@equinor/echo-core');
|
|
14
|
-
|
|
15
|
-
require('react-router-dom');
|
|
16
|
-
|
|
17
|
-
var useScreenOrientation = require('../../hooks/useScreenOrientation.js');
|
|
18
|
-
|
|
19
|
-
require('@equinor/echo-search');
|
|
20
|
-
|
|
21
11
|
var layout_module = require('./layout.module.css.js');
|
|
22
12
|
|
|
23
13
|
function _interopDefaultLegacy(e) {
|
|
@@ -30,77 +20,37 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
|
30
20
|
|
|
31
21
|
var MainLayout = function MainLayout(_ref) {
|
|
32
22
|
var children = _ref.children;
|
|
33
|
-
var screenOrientation = useScreenOrientation.useScreenOrientation();
|
|
34
|
-
var isLandscape = screenOrientation === 'landscape';
|
|
35
23
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
36
|
-
className: layout_module["default"].applicationWrapper
|
|
37
|
-
}, isLandscape && /*#__PURE__*/React__default["default"].createElement(EchoBarComponent.EchoBarComponent, {
|
|
38
|
-
isLandscape: isLandscape
|
|
39
|
-
}), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
40
24
|
className: layout_module["default"].mainLayoutWrapper
|
|
41
|
-
}, children)
|
|
42
|
-
isLandscape: isLandscape
|
|
43
|
-
}));
|
|
25
|
+
}, children);
|
|
44
26
|
};
|
|
45
27
|
|
|
46
28
|
var ColorLayout = function ColorLayout(_ref2) {
|
|
47
29
|
var children = _ref2.children;
|
|
48
|
-
var screenOrientation = useScreenOrientation.useScreenOrientation();
|
|
49
|
-
var isLandscape = screenOrientation === 'landscape';
|
|
50
30
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
51
|
-
className: layout_module["default"].echoContentContainer
|
|
52
|
-
}, isLandscape && /*#__PURE__*/React__default["default"].createElement(EchoBarComponent.EchoBarComponent, {
|
|
53
|
-
isLandscape: isLandscape
|
|
54
|
-
}), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
55
31
|
className: layout_module["default"].colorLayout
|
|
56
|
-
}, children)
|
|
57
|
-
isLandscape: isLandscape
|
|
58
|
-
}));
|
|
32
|
+
}, children);
|
|
59
33
|
};
|
|
60
34
|
|
|
61
35
|
var PdfViewerNative = function PdfViewerNative(_ref3) {
|
|
62
36
|
var children = _ref3.children;
|
|
63
|
-
var screenOrientation = useScreenOrientation.useScreenOrientation();
|
|
64
|
-
var isLandscape = screenOrientation === 'landscape';
|
|
65
37
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
66
|
-
className: layout_module["default"].echoContentContainer
|
|
67
|
-
}, isLandscape && /*#__PURE__*/React__default["default"].createElement(EchoBarComponent.EchoBarComponent, {
|
|
68
|
-
isLandscape: isLandscape
|
|
69
|
-
}), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
70
38
|
className: layout_module["default"].pdfViewerNative
|
|
71
|
-
}, children)
|
|
72
|
-
isLandscape: isLandscape
|
|
73
|
-
}));
|
|
39
|
+
}, children);
|
|
74
40
|
};
|
|
75
41
|
|
|
76
42
|
var CameraLayout = function CameraLayout(_ref4) {
|
|
77
43
|
var children = _ref4.children;
|
|
78
|
-
var screenOrientation = useScreenOrientation.useScreenOrientation();
|
|
79
|
-
var isLandscape = screenOrientation === 'landscape';
|
|
80
44
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
81
|
-
className: layout_module["default"].echoContentContainer
|
|
82
|
-
}, isLandscape && /*#__PURE__*/React__default["default"].createElement(EchoBarComponent.EchoBarComponent, {
|
|
83
|
-
isLandscape: isLandscape
|
|
84
|
-
}), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
85
45
|
className: layout_module["default"].cameraLayout
|
|
86
|
-
}, children)
|
|
87
|
-
isLandscape: isLandscape
|
|
88
|
-
}));
|
|
46
|
+
}, children);
|
|
89
47
|
};
|
|
90
48
|
|
|
91
49
|
var DefaultLayout = function DefaultLayout(_ref5) {
|
|
92
50
|
var children = _ref5.children;
|
|
93
|
-
var screenOrientation = useScreenOrientation.useScreenOrientation();
|
|
94
|
-
var isLandscape = screenOrientation === 'landscape';
|
|
95
51
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
96
|
-
className: layout_module["default"].echoContentContainer
|
|
97
|
-
}, isLandscape && /*#__PURE__*/React__default["default"].createElement(EchoBarComponent.EchoBarComponent, {
|
|
98
|
-
isLandscape: isLandscape
|
|
99
|
-
}), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
100
52
|
className: layout_module["default"].defaultLayout
|
|
101
|
-
}, children)
|
|
102
|
-
isLandscape: isLandscape
|
|
103
|
-
}));
|
|
53
|
+
}, children);
|
|
104
54
|
};
|
|
105
55
|
|
|
106
56
|
exports.CameraLayout = CameraLayout;
|
|
@@ -78,7 +78,6 @@ var ExternalAppsMenu = function ExternalAppsMenu(_a) {
|
|
|
78
78
|
var buttonElRef = React.useRef(null);
|
|
79
79
|
|
|
80
80
|
var _React$useState = React.useState({
|
|
81
|
-
focus: 'first',
|
|
82
81
|
buttonEl: undefined
|
|
83
82
|
}),
|
|
84
83
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
@@ -91,41 +90,20 @@ var ExternalAppsMenu = function ExternalAppsMenu(_a) {
|
|
|
91
90
|
var appMenuOnButtonId = "".concat(randomId, "-external-apps-menu-on-button");
|
|
92
91
|
var contextualAppLinkContext = useContextualAppLinksContext.useContextualAppLinksContext();
|
|
93
92
|
|
|
94
|
-
var openMenu = function openMenu(element
|
|
95
|
-
|
|
96
|
-
buttonEl: element
|
|
97
|
-
})) : setMenuState({
|
|
98
|
-
focus: focus,
|
|
93
|
+
var openMenu = function openMenu(element) {
|
|
94
|
+
setMenuState({
|
|
99
95
|
buttonEl: element
|
|
100
96
|
});
|
|
101
97
|
};
|
|
102
98
|
|
|
103
99
|
var closeMenu = function closeMenu() {
|
|
104
|
-
setMenuState(
|
|
100
|
+
setMenuState({
|
|
105
101
|
buttonEl: undefined
|
|
106
|
-
})
|
|
102
|
+
});
|
|
107
103
|
};
|
|
108
104
|
|
|
109
105
|
var stopPropagationOnClick = function stopPropagationOnClick(event) {
|
|
110
106
|
event.stopPropagation();
|
|
111
|
-
};
|
|
112
|
-
|
|
113
|
-
var onKeyPress = function onKeyPress(e) {
|
|
114
|
-
var key = e.key;
|
|
115
|
-
|
|
116
|
-
switch (key) {
|
|
117
|
-
case 'ArrowDown':
|
|
118
|
-
isOpen ? closeMenu() : openMenu(buttonElRef, 'first');
|
|
119
|
-
break;
|
|
120
|
-
|
|
121
|
-
case 'ArrowUp':
|
|
122
|
-
isOpen ? closeMenu() : openMenu(buttonElRef, 'last');
|
|
123
|
-
break;
|
|
124
|
-
|
|
125
|
-
case 'Escape':
|
|
126
|
-
closeMenu();
|
|
127
|
-
break;
|
|
128
|
-
}
|
|
129
107
|
}; // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
130
108
|
|
|
131
109
|
|
|
@@ -152,8 +130,7 @@ var ExternalAppsMenu = function ExternalAppsMenu(_a) {
|
|
|
152
130
|
},
|
|
153
131
|
onMouseLeave: function onMouseLeave() {
|
|
154
132
|
closeMenu();
|
|
155
|
-
}
|
|
156
|
-
onKeyDown: onKeyPress
|
|
133
|
+
}
|
|
157
134
|
}, /*#__PURE__*/React__default["default"].createElement(edsCoreReact.Icon, {
|
|
158
135
|
title: "echo",
|
|
159
136
|
name: "external_link",
|
|
@@ -161,7 +138,6 @@ var ExternalAppsMenu = function ExternalAppsMenu(_a) {
|
|
|
161
138
|
})), /*#__PURE__*/React__default["default"].createElement(edsCoreReact.Menu, {
|
|
162
139
|
id: appMenuOnButtonId,
|
|
163
140
|
"aria-labelledby": menuButtonId,
|
|
164
|
-
focus: menuState.focus,
|
|
165
141
|
open: Boolean(menuState.buttonEl),
|
|
166
142
|
anchorEl: buttonElRef === null || buttonElRef === void 0 ? void 0 : buttonElRef.current,
|
|
167
143
|
placement: 'bottom-end',
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, '__esModule', {
|
|
|
6
6
|
|
|
7
7
|
var styleInject_es = require('../../../node_modules/style-inject/dist/style-inject.es.js');
|
|
8
8
|
|
|
9
|
-
var css_248z = ".externalAppsMenu-module_externalAppsMenuContainer__gRHtf{animation:externalAppsMenu-module_fadein__a3fmQ .4s;display:inline-block;height:40px;margin:0;padding:0;position:relative;width:40px}.externalAppsMenu-module_appMenu__Hg3uJ{top:-5px!important
|
|
9
|
+
var css_248z = ".externalAppsMenu-module_externalAppsMenuContainer__gRHtf{animation:externalAppsMenu-module_fadein__a3fmQ .4s;display:inline-block;height:40px;margin:0;padding:0;position:relative;width:40px}.externalAppsMenu-module_appMenu__Hg3uJ{top:-5px!important}.externalAppsMenu-module_appMenu__Hg3uJ>[role=menu]{padding:.5rem!important;width:200px!important}.externalAppsMenu-module_appMenu__Hg3uJ [role=menu]>div{display:flex;flex-direction:row;flex-flow:wrap;min-height:130px;min-width:150px}";
|
|
10
10
|
var styles = {
|
|
11
11
|
"externalAppsMenuContainer": "externalAppsMenu-module_externalAppsMenuContainer__gRHtf",
|
|
12
12
|
"fadein": "externalAppsMenu-module_fadein__a3fmQ",
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, '__esModule', {
|
|
|
6
6
|
|
|
7
7
|
var styleInject_es = require('../../../node_modules/style-inject/dist/style-inject.es.js');
|
|
8
8
|
|
|
9
|
-
var css_248z = ".externalLinkButton-module_echoButton__J9As0{display:inline-block;padding:16px;position:relative;width:90px}.externalLinkButton-module_echoButtonDisabled__6kYFw{padding-bottom:0}.externalLinkButton-module_echoButtonRounded__moamZ{display:inline-block;position:relative}@media screen and (min-width:420px){.externalLinkButton-module_echoButtonDisabled__6kYFw,.externalLinkButton-module_echoButton__J9As0{width:96px}}.externalLinkButton-module_echoButton__J9As0 svg{display:inline-block;height:48px;margin:0 8px 8px;width:48px}.externalLinkButton-module_echoButtonRounded__moamZ svg{display:inline-block;height:24px;margin:0 8px;width:24px}.externalLinkButton-module_echoButton__J9As0 span{color:#007079;display:inline-block;font-size:14px;font-weight:500;line-height:16px;width:64px}.externalLinkButton-module_echoButton__J9As0:hover svg{fill:#004f55}.externalLinkButton-module_echoButton__J9As0:hover span{color:#004f55}.externalLinkButton-module_echoButtonDisabled__6kYFw span{color:var(--disabledColor)}.externalLinkButton-module_echoButtonDisabled__6kYFw:hover svg{fill:var(--disabledColor)}.externalLinkButton-module_echoButtonDisabled__6kYFw:hover span{color:var(--disabledColor)}.externalLinkButton-module_buttonIconAsImage__JL6p6{height:30px;justify-self:center;width:30px}.externalLinkButton-module_toolTip__ywPoc{background-color:#233746;border-radius:8px;box-shadow:0 0 4px rgba(0,0,0,.05),0 4px 4px rgba(0,0,0,.05);color:#fff;display:block;padding:8px 16px;position:absolute;z-index:1}.externalLinkButton-module_toolTipContainer__n1YIl{display:inline-flex;justify-content:center}.externalLinkButton-
|
|
9
|
+
var css_248z = ".externalLinkButton-module_echoButton__J9As0{display:inline-block;padding:16px;position:relative;width:90px}.externalLinkButton-module_echoButtonDisabled__6kYFw{padding-bottom:0}.externalLinkButton-module_echoButtonRounded__moamZ{display:inline-block;position:relative}@media screen and (min-width:420px){.externalLinkButton-module_echoButtonDisabled__6kYFw,.externalLinkButton-module_echoButton__J9As0{width:96px}}.externalLinkButton-module_echoButton__J9As0 svg{display:inline-block;height:48px;margin:0 8px 8px;width:48px}.externalLinkButton-module_echoButtonRounded__moamZ svg{display:inline-block;height:24px;margin:0 8px;width:24px}.externalLinkButton-module_echoButton__J9As0 span{color:#007079;display:inline-block;font-size:14px;font-weight:500;line-height:16px;width:64px}.externalLinkButton-module_echoButton__J9As0:hover svg{fill:#004f55}.externalLinkButton-module_echoButton__J9As0:hover span{color:#004f55}.externalLinkButton-module_echoButtonDisabled__6kYFw span{color:var(--disabledColor)}.externalLinkButton-module_echoButtonDisabled__6kYFw:hover svg{fill:var(--disabledColor)}.externalLinkButton-module_echoButtonDisabled__6kYFw:hover span{color:var(--disabledColor)}.externalLinkButton-module_buttonIconAsImage__JL6p6{height:30px;justify-self:center;width:30px}.externalLinkButton-module_toolTip__ywPoc{background-color:#233746;border-radius:8px;box-shadow:0 0 4px rgba(0,0,0,.05),0 4px 4px rgba(0,0,0,.05);color:#fff;display:block;padding:8px 16px;position:absolute;z-index:1}.externalLinkButton-module_toolTipContainer__n1YIl{display:inline-flex;justify-content:center}.externalLinkButton-module_stidIcon__XoFaL{height:auto!important}";
|
|
10
10
|
var style = {
|
|
11
11
|
"echoButton": "externalLinkButton-module_echoButton__J9As0",
|
|
12
12
|
"echoButtonDisabled": "externalLinkButton-module_echoButtonDisabled__6kYFw",
|
|
@@ -14,8 +14,6 @@ var style = {
|
|
|
14
14
|
"buttonIconAsImage": "externalLinkButton-module_buttonIconAsImage__JL6p6",
|
|
15
15
|
"toolTip": "externalLinkButton-module_toolTip__ywPoc",
|
|
16
16
|
"toolTipContainer": "externalLinkButton-module_toolTipContainer__n1YIl",
|
|
17
|
-
"scrimContainer": "externalLinkButton-module_scrimContainer__zE8L-",
|
|
18
|
-
"dialogWrapper": "externalLinkButton-module_dialogWrapper__IKpyE",
|
|
19
17
|
"stidIcon": "externalLinkButton-module_stidIcon__XoFaL"
|
|
20
18
|
};
|
|
21
19
|
styleInject_es["default"](css_248z);
|
|
@@ -29,8 +29,7 @@ var Toaster = function Toaster(_ref) {
|
|
|
29
29
|
return /*#__PURE__*/React__default["default"].createElement(edsCoreReact.Snackbar, {
|
|
30
30
|
placement: 'bottom-left',
|
|
31
31
|
open: true,
|
|
32
|
-
onClose: onClose
|
|
33
|
-
className: toaster_module["default"].toaster
|
|
32
|
+
onClose: onClose
|
|
34
33
|
}, toastNumber === numberOfToasts - 1 && numberOfToasts !== 1 && /*#__PURE__*/React__default["default"].createElement(edsCoreReact.Chip, {
|
|
35
34
|
variant: "error",
|
|
36
35
|
className: toaster_module["default"].chip
|
|
@@ -6,9 +6,8 @@ Object.defineProperty(exports, '__esModule', {
|
|
|
6
6
|
|
|
7
7
|
var styleInject_es = require('../../../node_modules/style-inject/dist/style-inject.es.js');
|
|
8
8
|
|
|
9
|
-
var css_248z = ".toaster-
|
|
9
|
+
var css_248z = ".toaster-module_chip__eNPoH{padding:5px!important;position:absolute;right:-5px;top:-5px}.toaster-module_toastersSection__q-orZ{grid-gap:24px;align-items:start;bottom:8px;display:grid;grid-auto-rows:32px;height:auto;left:8px;position:absolute}.toaster-module_toastersSection__q-orZ>div{height:32px;position:relative;width:fit-content}";
|
|
10
10
|
var style = {
|
|
11
|
-
"toaster": "toaster-module_toaster__6C9aR",
|
|
12
11
|
"chip": "toaster-module_chip__eNPoH",
|
|
13
12
|
"toastersSection": "toaster-module_toastersSection__q-orZ"
|
|
14
13
|
};
|
|
@@ -14,6 +14,16 @@ var corePanelLeft = require('../components/panel/corePanelLeft.js');
|
|
|
14
14
|
|
|
15
15
|
var corePanelRight = require('../components/panel/corePanelRight.js');
|
|
16
16
|
|
|
17
|
+
require('react-router-dom');
|
|
18
|
+
|
|
19
|
+
var useScreenOrientation = require('../hooks/useScreenOrientation.js');
|
|
20
|
+
|
|
21
|
+
require('@equinor/echo-search');
|
|
22
|
+
|
|
23
|
+
var hookLibrary = require('../hooks/hookLibrary.js');
|
|
24
|
+
|
|
25
|
+
var EchoBarComponent = require('./EchoBarComponent.js');
|
|
26
|
+
|
|
17
27
|
var EchoContent_module = require('./EchoContent.module.css.js');
|
|
18
28
|
|
|
19
29
|
function _interopDefaultLegacy(e) {
|
|
@@ -28,13 +38,28 @@ var EchoContent = function EchoContent(_ref) {
|
|
|
28
38
|
var children = _ref.children,
|
|
29
39
|
Legend = _ref.Legend,
|
|
30
40
|
isToggleButtonVisible = _ref.isToggleButtonVisible;
|
|
41
|
+
var deviceOrientation = hookLibrary.HookLibrary.useDeviceOrientation();
|
|
42
|
+
var isLandscapeDevice = deviceOrientation.landscape;
|
|
43
|
+
var screenOrientation = useScreenOrientation.useScreenOrientation();
|
|
44
|
+
var isWeb = !deviceOrientation.landscape && !deviceOrientation.portrait;
|
|
45
|
+
var isLandscapeWeb = screenOrientation === 'landscape';
|
|
31
46
|
return /*#__PURE__*/React__default["default"].createElement(EchoCore.ModuleContextProvider, null, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
32
47
|
className: EchoContent_module["default"].echoContent
|
|
33
48
|
}, /*#__PURE__*/React__default["default"].createElement(corePanelLeft["default"], {
|
|
34
49
|
isToggleButtonVisible: isToggleButtonVisible
|
|
35
50
|
}), /*#__PURE__*/React__default["default"].createElement(corePanelRight["default"], {
|
|
36
51
|
isToggleButtonVisible: isToggleButtonVisible
|
|
37
|
-
}),
|
|
52
|
+
}), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
53
|
+
className: EchoContent_module["default"].echoContentContainer
|
|
54
|
+
}, isWeb ? screenOrientation === 'landscape' && /*#__PURE__*/React__default["default"].createElement(EchoBarComponent.EchoBarComponent, {
|
|
55
|
+
isLandscape: isLandscapeWeb
|
|
56
|
+
}) : deviceOrientation.landscape && /*#__PURE__*/React__default["default"].createElement(EchoBarComponent.EchoBarComponent, {
|
|
57
|
+
isLandscape: isLandscapeDevice
|
|
58
|
+
}), children, isWeb ? screenOrientation === 'portrait' && /*#__PURE__*/React__default["default"].createElement(EchoBarComponent.EchoBarComponent, {
|
|
59
|
+
isLandscape: isLandscapeWeb
|
|
60
|
+
}) : deviceOrientation.portrait && /*#__PURE__*/React__default["default"].createElement(EchoBarComponent.EchoBarComponent, {
|
|
61
|
+
isLandscape: isLandscapeDevice
|
|
62
|
+
})), Legend && /*#__PURE__*/React__default["default"].createElement(Legend, null)));
|
|
38
63
|
};
|
|
39
64
|
|
|
40
65
|
exports.EchoContent = EchoContent;
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, '__esModule', {
|
|
|
6
6
|
|
|
7
7
|
var styleInject_es = require('../../node_modules/style-inject/dist/style-inject.es.js');
|
|
8
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{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}";
|
|
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
10
|
var style = {
|
|
11
11
|
"echoContent": "EchoContent-module_echoContent__DgKg-",
|
|
12
12
|
"mobileWrapper": "EchoContent-module_mobileWrapper__I1UNf",
|
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
|
|
3
3
|
var styleInject_es = require('../node_modules/style-inject/dist/style-inject.es.js');
|
|
4
4
|
|
|
5
|
-
var css_248z = "
|
|
5
|
+
var css_248z = ":root{--echo-framework-z-level-panel:500;--echo-framework-z-level-bottom-bar:1000;--echo-framework-z-level-scrim:1450}[class^=Scrim__StyledScrim]{z-index:var(--echo-framework-z-level-scrim)!important}";
|
|
6
6
|
styleInject_es["default"](css_248z);
|
|
@@ -25,6 +25,7 @@ exports.RegisteredHookName = void 0;
|
|
|
25
25
|
RegisteredHookName["useIsContextMenuInfoLoading"] = "useIsContextMenuInfoLoading";
|
|
26
26
|
RegisteredHookName["useSetActiveCommPackNo"] = "useSetActiveCommPackNo";
|
|
27
27
|
RegisteredHookName["useSetActiveMcPackNo"] = "useSetActiveMcPackNo";
|
|
28
|
+
RegisteredHookName["useDeviceOrientation"] = "useDeviceOrientation";
|
|
28
29
|
})(exports.RegisteredHookName || (exports.RegisteredHookName = {}));
|
|
29
30
|
|
|
30
31
|
var HookLibrary = Object.freeze({
|
|
@@ -81,6 +82,14 @@ var HookLibrary = Object.freeze({
|
|
|
81
82
|
*/
|
|
82
83
|
useSetActiveMcPackNo: function useSetActiveMcPackNo() {
|
|
83
84
|
return EchoCore__default["default"].echoHookRegistry.getHookByName(exports.RegisteredHookName.useSetActiveMcPackNo)();
|
|
85
|
+
},
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Hook for detecting device orientation from native devices.
|
|
89
|
+
* @returns {DeviceOrientation}
|
|
90
|
+
*/
|
|
91
|
+
useDeviceOrientation: function useDeviceOrientation() {
|
|
92
|
+
return EchoCore__default["default"].echoHookRegistry.getHookByName(exports.RegisteredHookName.useDeviceOrientation)();
|
|
84
93
|
}
|
|
85
94
|
});
|
|
86
95
|
exports.HookLibrary = HookLibrary;
|
package/dist/src/hooks/index.js
CHANGED
|
@@ -6,13 +6,10 @@ Object.defineProperty(exports, '__esModule', {
|
|
|
6
6
|
|
|
7
7
|
var useEchoHistory = require('./useEchoHistory.js');
|
|
8
8
|
|
|
9
|
-
var useIsLandscape = require('./useIsLandscape.js');
|
|
10
|
-
|
|
11
9
|
var useScreenOrientation = require('./useScreenOrientation.js');
|
|
12
10
|
|
|
13
11
|
var useTagDetails = require('./useTagDetails.js');
|
|
14
12
|
|
|
15
13
|
exports.useEchoHistory = useEchoHistory.useEchoHistory;
|
|
16
|
-
exports.useIsLandscape = useIsLandscape.useIsLandscape;
|
|
17
14
|
exports.useScreenOrientation = useScreenOrientation.useScreenOrientation;
|
|
18
15
|
exports.useTagDetails = useTagDetails.useTagDetails;
|
package/dist/src/index.js
CHANGED
|
@@ -116,8 +116,6 @@ var startup = require('./utils/startup.js');
|
|
|
116
116
|
|
|
117
117
|
var useEchoHistory = require('./hooks/useEchoHistory.js');
|
|
118
118
|
|
|
119
|
-
var useIsLandscape = require('./hooks/useIsLandscape.js');
|
|
120
|
-
|
|
121
119
|
var useScreenOrientation = require('./hooks/useScreenOrientation.js');
|
|
122
120
|
|
|
123
121
|
var useTagDetails = require('./hooks/useTagDetails.js');
|
|
@@ -246,7 +244,6 @@ exports.getPlantCodesOnInstallation = plantInfo.getPlantCodesOnInstallation;
|
|
|
246
244
|
exports.getPlantsOnInstallation = plantInfo.getPlantsOnInstallation;
|
|
247
245
|
exports.startup = startup.startup;
|
|
248
246
|
exports.useEchoHistory = useEchoHistory.useEchoHistory;
|
|
249
|
-
exports.useIsLandscape = useIsLandscape.useIsLandscape;
|
|
250
247
|
exports.useScreenOrientation = useScreenOrientation.useScreenOrientation;
|
|
251
248
|
exports.useTagDetails = useTagDetails.useTagDetails;
|
|
252
249
|
exports["default"] = EchoFramework;
|
|
@@ -2,3 +2,7 @@ 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
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@equinor/echo-framework",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.2",
|
|
4
4
|
"description": "Modules and components for EchoWeb, utilizing EchoCore",
|
|
5
5
|
"main": "dist/src/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -34,32 +34,32 @@
|
|
|
34
34
|
"echo-update-all": "echo-update -a"
|
|
35
35
|
},
|
|
36
36
|
"peerDependencies": {
|
|
37
|
-
"@equinor/echo-base": "^0.6.
|
|
38
|
-
"@equinor/echo-components": "^0.
|
|
39
|
-
"@equinor/echo-core": "^0.6.
|
|
40
|
-
"@equinor/echo-search": "^0.
|
|
37
|
+
"@equinor/echo-base": "^0.6.8",
|
|
38
|
+
"@equinor/echo-components": "^0.4.0",
|
|
39
|
+
"@equinor/echo-core": "^0.6.11",
|
|
40
|
+
"@equinor/echo-search": "^0.12.1",
|
|
41
41
|
"@equinor/echo-utils": "^0.2.9",
|
|
42
|
-
"@equinor/eds-core-react": "^0.
|
|
42
|
+
"@equinor/eds-core-react": "^0.19.0",
|
|
43
43
|
"react": "^17.0.2",
|
|
44
44
|
"react-dom": "^17.0.2",
|
|
45
45
|
"react-router-dom": "^5.3.0",
|
|
46
|
-
"styled-components": "^5.3.
|
|
46
|
+
"styled-components": "^5.3.5"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
|
-
"@babel/core": "^7.17.
|
|
49
|
+
"@babel/core": "^7.17.9",
|
|
50
50
|
"@babel/preset-env": "^7.16.11",
|
|
51
51
|
"@babel/preset-react": "^7.16.7",
|
|
52
|
-
"@equinor/echo-base": "^0.6.
|
|
53
|
-
"@equinor/echo-components": "^0.
|
|
54
|
-
"@equinor/echo-core": "^0.6.
|
|
52
|
+
"@equinor/echo-base": "^0.6.8",
|
|
53
|
+
"@equinor/echo-components": "^0.4.0",
|
|
54
|
+
"@equinor/echo-core": "^0.6.11",
|
|
55
55
|
"@equinor/echo-scripts": "^0.1.5",
|
|
56
|
-
"@equinor/echo-search": "^0.
|
|
56
|
+
"@equinor/echo-search": "^0.12.1",
|
|
57
57
|
"@equinor/echo-update": "^1.3.0",
|
|
58
58
|
"@equinor/echo-utils": "^0.2.9",
|
|
59
|
-
"@equinor/eds-core-react": "^0.
|
|
59
|
+
"@equinor/eds-core-react": "^0.19.0",
|
|
60
60
|
"@modular-css/rollup": "^28.0.0",
|
|
61
61
|
"@rollup/plugin-babel": "^5.3.1",
|
|
62
|
-
"@rollup/plugin-commonjs": "^21.0.
|
|
62
|
+
"@rollup/plugin-commonjs": "^21.0.3",
|
|
63
63
|
"@rollup/plugin-image": "^2.1.1",
|
|
64
64
|
"@rollup/plugin-json": "^4.1.0",
|
|
65
65
|
"@rollup/plugin-node-resolve": "^13.1.3",
|
|
@@ -68,38 +68,38 @@
|
|
|
68
68
|
"@svgr/rollup": "^6.2.1",
|
|
69
69
|
"@testing-library/react-hooks": "^7.0.2",
|
|
70
70
|
"@types/jest": "^27.4.1",
|
|
71
|
-
"@types/node": "^17.0.
|
|
72
|
-
"@types/react": "^17.0.
|
|
73
|
-
"@types/react-dom": "^17.0.
|
|
71
|
+
"@types/node": "^17.0.23",
|
|
72
|
+
"@types/react": "^17.0.43",
|
|
73
|
+
"@types/react-dom": "^17.0.14",
|
|
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.18.0",
|
|
76
|
+
"@typescript-eslint/parser": "^5.18.0",
|
|
77
77
|
"@wessberg/rollup-plugin-ts": "^2.0.4",
|
|
78
|
-
"autoprefixer": "^10.4.
|
|
78
|
+
"autoprefixer": "^10.4.4",
|
|
79
79
|
"babel-jest": "^27.5.1",
|
|
80
|
-
"eslint": "^8.
|
|
80
|
+
"eslint": "^8.12.0",
|
|
81
81
|
"eslint-config-prettier": "^8.5.0",
|
|
82
82
|
"eslint-plugin-prettier": "^4.0.0",
|
|
83
|
-
"eslint-plugin-react": "^7.29.
|
|
84
|
-
"eslint-plugin-react-hooks": "^4.
|
|
83
|
+
"eslint-plugin-react": "^7.29.4",
|
|
84
|
+
"eslint-plugin-react-hooks": "^4.4.0",
|
|
85
85
|
"jest": "^27.5.1",
|
|
86
86
|
"jest-expo": "^44.0.1",
|
|
87
|
-
"postcss": "^8.4.
|
|
87
|
+
"postcss": "^8.4.12",
|
|
88
88
|
"postcss-assets": "^6.0.0",
|
|
89
89
|
"postcss-modules": "^4.3.1",
|
|
90
|
-
"prettier": "^2.
|
|
90
|
+
"prettier": "^2.6.2",
|
|
91
91
|
"react": "^17.0.2",
|
|
92
92
|
"react-dom": "^17.0.2",
|
|
93
93
|
"react-router-dom": "^5.3.0",
|
|
94
|
-
"rollup": "^2.70.
|
|
94
|
+
"rollup": "^2.70.1",
|
|
95
95
|
"rollup-plugin-delete": "^2.0.0",
|
|
96
96
|
"rollup-plugin-postcss": "^4.0.2",
|
|
97
97
|
"rollup-plugin-typescript-paths": "^1.3.1",
|
|
98
98
|
"rollup-plugin-typescript2": "^0.31.2",
|
|
99
|
-
"styled-components": "^5.3.
|
|
100
|
-
"ts-jest": "^27.1.
|
|
99
|
+
"styled-components": "^5.3.5",
|
|
100
|
+
"ts-jest": "^27.1.4",
|
|
101
101
|
"tslib": "^2.3.1",
|
|
102
|
-
"typescript": "=4.6.
|
|
102
|
+
"typescript": "=4.6.3"
|
|
103
103
|
},
|
|
104
104
|
"compilerOptions": {
|
|
105
105
|
"declaration": true
|
|
@@ -114,4 +114,4 @@
|
|
|
114
114
|
"dependencies": {
|
|
115
115
|
"@microsoft/signalr": "^6.0.3"
|
|
116
116
|
}
|
|
117
|
-
}
|
|
117
|
+
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function useIsLandscape(): boolean;
|
|
@@ -1,52 +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
|
|
22
|
-
/* content: React.RefObject<HTMLDivElement> */
|
|
23
|
-
useIsLandscape() {
|
|
24
|
-
var _React$useState = React.useState(false),
|
|
25
|
-
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
26
|
-
isLandscape = _React$useState2[0],
|
|
27
|
-
setIsLandscape = _React$useState2[1];
|
|
28
|
-
|
|
29
|
-
var checkScreenOrientation = React.useCallback(function () {
|
|
30
|
-
var isMounted = true;
|
|
31
|
-
|
|
32
|
-
if (window.innerHeight < window.innerWidth * 0.75 && isMounted) {
|
|
33
|
-
setIsLandscape(true);
|
|
34
|
-
} else {
|
|
35
|
-
setIsLandscape(false);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
return function () {
|
|
39
|
-
isMounted = false;
|
|
40
|
-
};
|
|
41
|
-
}, []);
|
|
42
|
-
React.useEffect(function () {
|
|
43
|
-
checkScreenOrientation();
|
|
44
|
-
window.addEventListener('resize', checkScreenOrientation);
|
|
45
|
-
return function () {
|
|
46
|
-
window.removeEventListener('resize', checkScreenOrientation);
|
|
47
|
-
};
|
|
48
|
-
}, [checkScreenOrientation]);
|
|
49
|
-
return isLandscape;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
exports.useIsLandscape = useIsLandscape;
|