@equinor/echo-framework 0.9.5 → 0.9.8

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 (45) hide show
  1. package/dist/components/containers/layouts.d.ts +5 -3
  2. package/dist/components/panel/corePanelLeft.d.ts +1 -4
  3. package/dist/components/panel/corePanelRight.d.ts +1 -4
  4. package/dist/components/router/echoRoute.d.ts +2 -2
  5. package/dist/components/router/index.d.ts +1 -0
  6. package/dist/components/router/useLayout.d.ts +3 -0
  7. package/dist/coreApplication/index.d.ts +0 -1
  8. package/dist/hooks/hookLibrary.d.ts +2 -13
  9. package/dist/hooks/index.d.ts +0 -2
  10. package/dist/index.d.ts +1 -14
  11. package/dist/src/components/containers/layout.module.css.js +2 -6
  12. package/dist/src/components/containers/layouts.js +36 -67
  13. package/dist/src/components/contextualAppLinks/externalLinkButtons/externalLinkToTr2000.js +0 -2
  14. package/dist/src/components/footer/footer.module.css.js +1 -1
  15. package/dist/src/components/panel/corePanelLeft.js +2 -5
  16. package/dist/src/components/panel/corePanelLeft.module.css.js +1 -1
  17. package/dist/src/components/panel/corePanelRight.js +2 -5
  18. package/dist/src/components/panel/corePanelRight.module.css.js +1 -1
  19. package/dist/src/components/router/echoRoute.js +3 -9
  20. package/dist/src/components/router/routes.js +4 -1
  21. package/dist/src/components/router/useLayout.js +32 -0
  22. package/dist/src/coreApplication/EchoContent.js +1 -21
  23. package/dist/src/globalStyles.css.js +1 -1
  24. package/dist/src/hooks/hookLibrary.js +0 -17
  25. package/dist/src/hooks/index.js +0 -6
  26. package/dist/src/index.js +8 -19
  27. package/dist/src/index2.js +26 -37
  28. package/dist/src/types/legend.js +1 -0
  29. package/dist/src/utils/legendUtils.js +1 -1
  30. package/dist/types/hookLibrary.d.ts +0 -5
  31. package/dist/types/legend.d.ts +2 -1
  32. package/package.json +3 -3
  33. package/dist/_virtual/index.js +0 -9
  34. package/dist/coreApplication/EchoBarComponent.d.ts +0 -12
  35. package/dist/hooks/useIsCompactLayout.d.ts +0 -5
  36. package/dist/hooks/useScreenOrientation.d.ts +0 -5
  37. package/dist/hooks/useScreenValues.d.ts +0 -17
  38. package/dist/hooks/useWindowSize.d.ts +0 -9
  39. package/dist/node_modules/classnames/index.js +0 -67
  40. package/dist/src/coreApplication/EchoBarComponent.js +0 -182
  41. package/dist/src/coreApplication/EchoContent.module.css.js +0 -17
  42. package/dist/src/hooks/useIsCompactLayout.js +0 -47
  43. package/dist/src/hooks/useScreenOrientation.js +0 -62
  44. package/dist/src/hooks/useScreenValues.js +0 -48
  45. package/dist/src/hooks/useWindowSize.js +0 -62
@@ -1,62 +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 EchoUtils = require('@equinor/echo-utils');
22
-
23
- var React = require('react');
24
-
25
- function _interopDefaultLegacy(e) {
26
- return e && _typeof(e) === 'object' && 'default' in e ? e : {
27
- 'default': e
28
- };
29
- }
30
-
31
- var EchoUtils__default = /*#__PURE__*/_interopDefaultLegacy(EchoUtils);
32
- /**
33
- * @returns {ScreenOrientation}
34
- */
35
-
36
-
37
- function useScreenOrientation() {
38
- var useStateSafe = EchoUtils__default["default"].Hooks.useStateSafe;
39
-
40
- var _useStateSafe = useStateSafe(undefined),
41
- _useStateSafe2 = _slicedToArray(_useStateSafe, 2),
42
- orientation = _useStateSafe2[0],
43
- setOrientation = _useStateSafe2[1];
44
-
45
- var updateOrientation = React.useCallback(function () {
46
- if (window.innerWidth > window.innerHeight) {
47
- setOrientation('landscape');
48
- } else {
49
- setOrientation('portrait');
50
- }
51
- }, [setOrientation]);
52
- React.useEffect(function () {
53
- updateOrientation();
54
- window.addEventListener('resize', updateOrientation);
55
- return function () {
56
- window.removeEventListener('resize', updateOrientation);
57
- };
58
- }, [updateOrientation]);
59
- return orientation;
60
- }
61
-
62
- exports.useScreenOrientation = useScreenOrientation;
@@ -1,48 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', {
4
- value: true
5
- });
6
-
7
- require('@equinor/echo-core');
8
-
9
- require('react');
10
-
11
- require('react-router-dom');
12
-
13
- var useScreenOrientation = require('./useScreenOrientation.js');
14
-
15
- var hookLibrary = require('./hookLibrary.js');
16
-
17
- var useIsCompactLayout = require('./useIsCompactLayout.js');
18
-
19
- require('@equinor/echo-utils');
20
-
21
- require('@equinor/echo-base');
22
-
23
- require('@equinor/echo-search');
24
-
25
- require('../services/echopediaAnalyticsModule/echopediaAnalyticsModule.js');
26
-
27
- function useScreenValues() {
28
- var screenOrientation = useScreenOrientation.useScreenOrientation();
29
-
30
- var _hookLibrary$HookLibr = hookLibrary.HookLibrary.useDeviceOrientation(),
31
- landscape = _hookLibrary$HookLibr.landscape,
32
- portrait = _hookLibrary$HookLibr.portrait;
33
-
34
- var isWeb = !landscape && !portrait;
35
- var isLandscapeWeb = screenOrientation === 'landscape';
36
- var isScreenMobileSize = useIsCompactLayout.useIsCompactLayout(isWeb ? isLandscapeWeb : landscape);
37
- return {
38
- isWeb: isWeb,
39
- isScreenMobileSize: isScreenMobileSize,
40
- screenOrientationDevice: {
41
- landscape: landscape,
42
- portrait: portrait
43
- },
44
- screenOrientationWeb: screenOrientation
45
- };
46
- }
47
-
48
- exports.useScreenValues = useScreenValues;
@@ -1,62 +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'); // useWindowSize from usehooks.com
20
-
21
- /**
22
- * Get the current size of the browser window.
23
- * @returns {width?: number; height?: number} Width and height of the current browser window size.
24
- * Returns undefined if there is no window object (for example: executed on server side)
25
- */
26
-
27
-
28
- function useWindowSize() {
29
- // Initialize state with undefined width/height so server and client renders match
30
- // Learn more here: https://joshwcomeau.com/react/the-perils-of-rehydration/
31
- var _React$useState = React.useState({
32
- width: 0,
33
- height: 0
34
- }),
35
- _React$useState2 = _slicedToArray(_React$useState, 2),
36
- windowSize = _React$useState2[0],
37
- setWindowSize = _React$useState2[1];
38
-
39
- React.useEffect(function () {
40
- // Handler to call on window resize
41
- function handleResize() {
42
- // Set window width/height to state
43
- setWindowSize({
44
- width: window.outerWidth,
45
- height: window.outerHeight
46
- });
47
- } // Add event listener
48
-
49
-
50
- window.addEventListener('resize', handleResize); // Call handler right away so state gets updated with initial window size
51
-
52
- handleResize(); // Remove event listener on cleanup
53
-
54
- return function () {
55
- return window.removeEventListener('resize', handleResize);
56
- };
57
- }, []); // Empty array ensures that effect is only run on mount
58
-
59
- return windowSize;
60
- }
61
-
62
- exports.useWindowSize = useWindowSize;