@equinor/echo-framework 0.9.11 → 0.9.14

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 (182) hide show
  1. package/dist/components/appLinks/applinkUtils.d.ts +2 -0
  2. package/dist/components/appLinks/applinkUtils.test.d.ts +1 -0
  3. package/dist/index.js +3 -0
  4. package/package.json +42 -39
  5. package/dist/_virtual/_tslib.js +0 -67
  6. package/dist/node_modules/@babel/runtime/helpers/esm/extends.js +0 -25
  7. package/dist/node_modules/@equinor/eds-icons/dist/icons.esm.js +0 -5285
  8. package/dist/node_modules/@microsoft/signalr/dist/esm/AbortController.js +0 -54
  9. package/dist/node_modules/@microsoft/signalr/dist/esm/DefaultHttpClient.js +0 -96
  10. package/dist/node_modules/@microsoft/signalr/dist/esm/DefaultReconnectPolicy.js +0 -47
  11. package/dist/node_modules/@microsoft/signalr/dist/esm/Errors.js +0 -287
  12. package/dist/node_modules/@microsoft/signalr/dist/esm/FetchHttpClient.js +0 -283
  13. package/dist/node_modules/@microsoft/signalr/dist/esm/HandshakeProtocol.js +0 -86
  14. package/dist/node_modules/@microsoft/signalr/dist/esm/HeaderNames.js +0 -20
  15. package/dist/node_modules/@microsoft/signalr/dist/esm/HttpClient.js +0 -82
  16. package/dist/node_modules/@microsoft/signalr/dist/esm/HttpConnection.js +0 -1169
  17. package/dist/node_modules/@microsoft/signalr/dist/esm/HubConnection.js +0 -1346
  18. package/dist/node_modules/@microsoft/signalr/dist/esm/HubConnectionBuilder.js +0 -165
  19. package/dist/node_modules/@microsoft/signalr/dist/esm/IHubProtocol.js +0 -33
  20. package/dist/node_modules/@microsoft/signalr/dist/esm/ILogger.js +0 -37
  21. package/dist/node_modules/@microsoft/signalr/dist/esm/ITransport.js +0 -37
  22. package/dist/node_modules/@microsoft/signalr/dist/esm/JsonHubProtocol.js +0 -179
  23. package/dist/node_modules/@microsoft/signalr/dist/esm/Loggers.js +0 -35
  24. package/dist/node_modules/@microsoft/signalr/dist/esm/LongPollingTransport.js +0 -448
  25. package/dist/node_modules/@microsoft/signalr/dist/esm/ServerSentEventsTransport.js +0 -238
  26. package/dist/node_modules/@microsoft/signalr/dist/esm/Subject.js +0 -99
  27. package/dist/node_modules/@microsoft/signalr/dist/esm/TextMessageFormat.js +0 -45
  28. package/dist/node_modules/@microsoft/signalr/dist/esm/Utils.js +0 -435
  29. package/dist/node_modules/@microsoft/signalr/dist/esm/WebSocketTransport.js +0 -264
  30. package/dist/node_modules/@microsoft/signalr/dist/esm/XhrHttpClient.js +0 -133
  31. package/dist/node_modules/history/esm/history.js +0 -498
  32. package/dist/node_modules/resolve-pathname/esm/resolve-pathname.js +0 -73
  33. package/dist/node_modules/style-inject/dist/style-inject.es.js +0 -36
  34. package/dist/node_modules/tiny-invariant/dist/tiny-invariant.esm.js +0 -23
  35. package/dist/node_modules/tiny-warning/dist/tiny-warning.esm.js +0 -26
  36. package/dist/src/components/appLinks/AppLinks.js +0 -38
  37. package/dist/src/components/appLinks/AppLinks.module.css.js +0 -14
  38. package/dist/src/components/appLinks/linkButton/linkButton.js +0 -45
  39. package/dist/src/components/containers/layout.module.css.js +0 -25
  40. package/dist/src/components/containers/layouts.js +0 -62
  41. package/dist/src/components/contextualAppLinks/contextualAppLinks.context.js +0 -20
  42. package/dist/src/components/contextualAppLinks/contextualAppLinks.js +0 -47
  43. package/dist/src/components/contextualAppLinks/externalAppsMenu.js +0 -157
  44. package/dist/src/components/contextualAppLinks/externalAppsMenu.module.css.js +0 -16
  45. package/dist/src/components/contextualAppLinks/externalLinkButtons/allExternalLinks.js +0 -127
  46. package/dist/src/components/contextualAppLinks/externalLinkButtons/externalLinkButtons.helpers.js +0 -169
  47. package/dist/src/components/contextualAppLinks/externalLinkButtons/externalLinkToCommApp.js +0 -95
  48. package/dist/src/components/contextualAppLinks/externalLinkButtons/externalLinkToMcApp.js +0 -95
  49. package/dist/src/components/contextualAppLinks/externalLinkButtons/externalLinkToProCoSys.js +0 -84
  50. package/dist/src/components/contextualAppLinks/externalLinkButtons/externalLinkToSafeX.js +0 -38
  51. package/dist/src/components/contextualAppLinks/externalLinkButtons/externalLinkToSap.js +0 -110
  52. package/dist/src/components/contextualAppLinks/externalLinkButtons/externalLinkToSemiDoc.js +0 -59
  53. package/dist/src/components/contextualAppLinks/externalLinkButtons/externalLinkToStid.js +0 -40
  54. package/dist/src/components/contextualAppLinks/externalLinkButtons/externalLinkToTr2000.js +0 -114
  55. package/dist/src/components/contextualAppLinks/externalLinkButtons/iconButtonSpinner.js +0 -44
  56. package/dist/src/components/contextualAppLinks/externalLinkButtons/iconButtonSpinner.module.css.js +0 -15
  57. package/dist/src/components/contextualAppLinks/hooks/useContextualAppLinks.js +0 -52
  58. package/dist/src/components/contextualAppLinks/hooks/useContextualAppLinksContext.js +0 -36
  59. package/dist/src/components/contextualAppLinks/index.js +0 -22
  60. package/dist/src/components/contextualAppLinks/internalAppLinks.js +0 -115
  61. package/dist/src/components/contextualAppLinks/linkButton.js +0 -57
  62. package/dist/src/components/echoLogo/echoLogo.js +0 -30
  63. package/dist/src/components/echoLogo/echoLogo.module.css.js +0 -15
  64. package/dist/src/components/errorBoundary/components/chunkLoadErrorMessage.js +0 -64
  65. package/dist/src/components/errorBoundary/components/chunkLoadErrorMessage.module.css.js +0 -17
  66. package/dist/src/components/errorBoundary/components/errorBoundaryBaseMessage.js +0 -85
  67. package/dist/src/components/errorBoundary/components/errorBoundaryBaseMessage.module.css.js +0 -19
  68. package/dist/src/components/errorBoundary/components/notificationCardWithLogo.js +0 -55
  69. package/dist/src/components/errorBoundary/components/notificationCardWithLogo.module.css.js +0 -19
  70. package/dist/src/components/errorBoundary/errorBoundary.js +0 -100
  71. package/dist/src/components/externalLinkButton/externalLinkButton.js +0 -310
  72. package/dist/src/components/externalLinkButton/externalLinkButton.module.css.js +0 -23
  73. package/dist/src/components/footer/footer.js +0 -42
  74. package/dist/src/components/footer/footer.module.css.js +0 -17
  75. package/dist/src/components/lazyLoading/appLoadingIndicator.js +0 -34
  76. package/dist/src/components/lazyLoading/appLoadingIndicator.module.css.js +0 -15
  77. package/dist/src/components/lazyLoading/lazyLoadedAppWrapper.js +0 -40
  78. package/dist/src/components/mediator/mediator.js +0 -32
  79. package/dist/src/components/pageMenu/Navigation/applicationList.js +0 -35
  80. package/dist/src/components/pageMenu/Navigation/applicationList.module.css.js +0 -17
  81. package/dist/src/components/pageMenu/accordionItem.module.css.js +0 -16
  82. package/dist/src/components/pageMenu/defaultAccordionItem.js +0 -61
  83. package/dist/src/components/pageMenu/pageMenu.js +0 -141
  84. package/dist/src/components/pageMenu/pageMenu.module.css.js +0 -17
  85. package/dist/src/components/pageMenu/pageMenuDrawerItem.js +0 -77
  86. package/dist/src/components/pageMenu/pageMenuDrawerItem.module.css.js +0 -20
  87. package/dist/src/components/pageMenu/settings/asset.js +0 -40
  88. package/dist/src/components/pageMenu/settings/profile.js +0 -62
  89. package/dist/src/components/pageMenu/settings/settings.js +0 -41
  90. package/dist/src/components/pageMenu/settings/settings.module.css.js +0 -25
  91. package/dist/src/components/pageMenu/version/version.js +0 -88
  92. package/dist/src/components/pageMenu/version/version.module.css.js +0 -14
  93. package/dist/src/components/panel/corePanelIcon.js +0 -31
  94. package/dist/src/components/panel/corePanelLeft.js +0 -91
  95. package/dist/src/components/panel/corePanelLeft.module.css.js +0 -19
  96. package/dist/src/components/panel/corePanelRight.js +0 -95
  97. package/dist/src/components/panel/corePanelRight.module.css.js +0 -18
  98. package/dist/src/components/panelButton/panelButton.js +0 -124
  99. package/dist/src/components/panelButton/panelButton.module.css.js +0 -25
  100. package/dist/src/components/plantSelector/plantSelector.js +0 -137
  101. package/dist/src/components/projectSelector/ProcosysProjectSelector.js +0 -115
  102. package/dist/src/components/projectSelector/ProcosysProjectSelector.module.css.js +0 -14
  103. package/dist/src/components/realTimeData/RealTimePopoverButton.js +0 -168
  104. package/dist/src/components/realTimeData/components/IMSDropdown/RealTimeIMSDropdown.js +0 -83
  105. package/dist/src/components/realTimeData/components/IMSDropdown/RealTimeIMSDropdown.module.css.js +0 -15
  106. package/dist/src/components/realTimeData/components/connectorForIMSTag/IMSConnector.module.css.js +0 -17
  107. package/dist/src/components/realTimeData/components/connectorForIMSTag/RealTimeConnectorForIMSTag.js +0 -149
  108. package/dist/src/components/realTimeData/components/contextButton/RealTimeContextButton.js +0 -75
  109. package/dist/src/components/realTimeData/components/contextButton/RealTimeContextButton.module.css.js +0 -15
  110. package/dist/src/components/realTimeData/components/contextPopover/Popover.js +0 -37
  111. package/dist/src/components/realTimeData/components/contextPopover/Popover.module.css.js +0 -15
  112. package/dist/src/components/realTimeData/hooks/useRealTimeHub.js +0 -124
  113. package/dist/src/components/realTimeData/hooks/useSignalR.js +0 -175
  114. package/dist/src/components/realTimeData/hooks/useSignalRListener.js +0 -22
  115. package/dist/src/components/router/echoRoute.js +0 -45
  116. package/dist/src/components/router/echoRouter.js +0 -30
  117. package/dist/src/components/router/echoWrapper.js +0 -33
  118. package/dist/src/components/router/routes.js +0 -46
  119. package/dist/src/components/router/useLayout.js +0 -32
  120. package/dist/src/components/searchMenu/searchMenu.js +0 -46
  121. package/dist/src/components/searchMenu/searchMenu.module.css.js +0 -16
  122. package/dist/src/components/tagNumber/tagNo.module.css.js +0 -14
  123. package/dist/src/components/tagNumber/tagNumber.js +0 -38
  124. package/dist/src/components/toaster/toaster.js +0 -43
  125. package/dist/src/components/toaster/toaster.module.css.js +0 -15
  126. package/dist/src/components/toaster/toasters.js +0 -101
  127. package/dist/src/coreApplication/EchoContent.js +0 -32
  128. package/dist/src/coreApplication/EchoContentPanels.js +0 -40
  129. package/dist/src/coreApplication/EchoEventHandler.js +0 -79
  130. package/dist/src/coreApplication/EchoEventHandler.module.css.js +0 -14
  131. package/dist/src/globalStyles.css.js +0 -6
  132. package/dist/src/hooks/hookLibrary.js +0 -86
  133. package/dist/src/hooks/index.js +0 -12
  134. package/dist/src/hooks/useEchoHistory.js +0 -38
  135. package/dist/src/hooks/useLongPress.js +0 -37
  136. package/dist/src/hooks/useSemi.js +0 -100
  137. package/dist/src/hooks/useTagDetails.js +0 -153
  138. package/dist/src/icons/common/CommissionApp-icon.png.js +0 -7
  139. package/dist/src/icons/common/Evision.svg.js +0 -68
  140. package/dist/src/icons/common/Fusion.svg.js +0 -111
  141. package/dist/src/icons/common/McApp.svg.js +0 -70
  142. package/dist/src/icons/common/Notification.svg.js +0 -81
  143. package/dist/src/icons/common/ProCoSysIcon.svg.js +0 -68
  144. package/dist/src/icons/common/Robim.svg.js +0 -66
  145. package/dist/src/icons/common/SX-logo.png.js +0 -7
  146. package/dist/src/icons/common/SapLogo.svg.js +0 -95
  147. package/dist/src/icons/common/SemiIcon.svg.js +0 -82
  148. package/dist/src/icons/common/Stid.svg.js +0 -65
  149. package/dist/src/icons/common/TR2000.svg.js +0 -73
  150. package/dist/src/icons/common/WorkOrder.svg.js +0 -71
  151. package/dist/src/icons/common/Yammer.svg.js +0 -65
  152. package/dist/src/icons/common/satos-logo.png.js +0 -7
  153. package/dist/src/icons/edsIons.js +0 -15
  154. package/dist/src/icons/equinor-logo.js +0 -62
  155. package/dist/src/icons/logo_ee.js +0 -37
  156. package/dist/src/icons/search.js +0 -35
  157. package/dist/src/index.js +0 -209
  158. package/dist/src/index2.js +0 -201
  159. package/dist/src/services/api/api-manager.js +0 -190
  160. package/dist/src/services/api/api-plantinfo.js +0 -196
  161. package/dist/src/services/api/api-plants.js +0 -75
  162. package/dist/src/services/api/api-realtimedata.js +0 -55
  163. package/dist/src/services/api/api-tag-details.js +0 -69
  164. package/dist/src/services/api/api-tags.js +0 -88
  165. package/dist/src/services/api/api-version.js +0 -124
  166. package/dist/src/services/componentRegistry/componentRegistry.js +0 -69
  167. package/dist/src/services/echopediaAnalyticsModule/echopediaAnalyticsModule.js +0 -10
  168. package/dist/src/services/eventCallbacks/plantChanged.js +0 -42
  169. package/dist/src/services/eventHubActions/toastActions.js +0 -18
  170. package/dist/src/theme/themeConst.js +0 -75
  171. package/dist/src/types/extensions.js +0 -10
  172. package/dist/src/types/legend.js +0 -58
  173. package/dist/src/types/pingableSources.js +0 -11
  174. package/dist/src/utils/copyText.js +0 -67
  175. package/dist/src/utils/eventHandlerUtils.js +0 -11
  176. package/dist/src/utils/legendUtils.js +0 -168
  177. package/dist/src/utils/navigationUtils.js +0 -28
  178. package/dist/src/utils/plantInfo.js +0 -535
  179. package/dist/src/utils/plantsDataUtils.js +0 -35
  180. package/dist/src/utils/projectSelectorUtils.js +0 -19
  181. package/dist/src/utils/startup.js +0 -89
  182. package/dist/src/utils/taskCache.js +0 -89
@@ -1,498 +0,0 @@
1
- 'use strict';
2
-
3
- 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); }
4
-
5
- Object.defineProperty(exports, '__esModule', {
6
- value: true
7
- });
8
-
9
- var _extends = require('../../@babel/runtime/helpers/esm/extends.js');
10
-
11
- var resolvePathname = require('../../resolve-pathname/esm/resolve-pathname.js');
12
-
13
- var tinyWarning_esm = require('../../tiny-warning/dist/tiny-warning.esm.js');
14
-
15
- var tinyInvariant_esm = require('../../tiny-invariant/dist/tiny-invariant.esm.js');
16
-
17
- function addLeadingSlash(path) {
18
- return path.charAt(0) === '/' ? path : '/' + path;
19
- }
20
-
21
- function hasBasename(path, prefix) {
22
- return path.toLowerCase().indexOf(prefix.toLowerCase()) === 0 && '/?#'.indexOf(path.charAt(prefix.length)) !== -1;
23
- }
24
-
25
- function stripBasename(path, prefix) {
26
- return hasBasename(path, prefix) ? path.substr(prefix.length) : path;
27
- }
28
-
29
- function stripTrailingSlash(path) {
30
- return path.charAt(path.length - 1) === '/' ? path.slice(0, -1) : path;
31
- }
32
-
33
- function parsePath(path) {
34
- var pathname = path || '/';
35
- var search = '';
36
- var hash = '';
37
- var hashIndex = pathname.indexOf('#');
38
-
39
- if (hashIndex !== -1) {
40
- hash = pathname.substr(hashIndex);
41
- pathname = pathname.substr(0, hashIndex);
42
- }
43
-
44
- var searchIndex = pathname.indexOf('?');
45
-
46
- if (searchIndex !== -1) {
47
- search = pathname.substr(searchIndex);
48
- pathname = pathname.substr(0, searchIndex);
49
- }
50
-
51
- return {
52
- pathname: pathname,
53
- search: search === '?' ? '' : search,
54
- hash: hash === '#' ? '' : hash
55
- };
56
- }
57
-
58
- function createPath(location) {
59
- var pathname = location.pathname,
60
- search = location.search,
61
- hash = location.hash;
62
- var path = pathname || '/';
63
- if (search && search !== '?') path += search.charAt(0) === '?' ? search : "?" + search;
64
- if (hash && hash !== '#') path += hash.charAt(0) === '#' ? hash : "#" + hash;
65
- return path;
66
- }
67
-
68
- function createLocation(path, state, key, currentLocation) {
69
- var location;
70
-
71
- if (typeof path === 'string') {
72
- // Two-arg form: push(path, state)
73
- location = parsePath(path);
74
- location.state = state;
75
- } else {
76
- // One-arg form: push(location)
77
- location = _extends["default"]({}, path);
78
- if (location.pathname === undefined) location.pathname = '';
79
-
80
- if (location.search) {
81
- if (location.search.charAt(0) !== '?') location.search = '?' + location.search;
82
- } else {
83
- location.search = '';
84
- }
85
-
86
- if (location.hash) {
87
- if (location.hash.charAt(0) !== '#') location.hash = '#' + location.hash;
88
- } else {
89
- location.hash = '';
90
- }
91
-
92
- if (state !== undefined && location.state === undefined) location.state = state;
93
- }
94
-
95
- try {
96
- location.pathname = decodeURI(location.pathname);
97
- } catch (e) {
98
- if (e instanceof URIError) {
99
- throw new URIError('Pathname "' + location.pathname + '" could not be decoded. ' + 'This is likely caused by an invalid percent-encoding.');
100
- } else {
101
- throw e;
102
- }
103
- }
104
-
105
- if (key) location.key = key;
106
-
107
- if (currentLocation) {
108
- // Resolve incomplete/relative pathname relative to current location.
109
- if (!location.pathname) {
110
- location.pathname = currentLocation.pathname;
111
- } else if (location.pathname.charAt(0) !== '/') {
112
- location.pathname = resolvePathname["default"](location.pathname, currentLocation.pathname);
113
- }
114
- } else {
115
- // When there is no prior location and pathname is empty, set it to /
116
- if (!location.pathname) {
117
- location.pathname = '/';
118
- }
119
- }
120
-
121
- return location;
122
- }
123
-
124
- function createTransitionManager() {
125
- var prompt = null;
126
-
127
- function setPrompt(nextPrompt) {
128
- process.env.NODE_ENV !== "production" ? tinyWarning_esm["default"](prompt == null, 'A history supports only one prompt at a time') : void 0;
129
- prompt = nextPrompt;
130
- return function () {
131
- if (prompt === nextPrompt) prompt = null;
132
- };
133
- }
134
-
135
- function confirmTransitionTo(location, action, getUserConfirmation, callback) {
136
- // TODO: If another transition starts while we're still confirming
137
- // the previous one, we may end up in a weird state. Figure out the
138
- // best way to handle this.
139
- if (prompt != null) {
140
- var result = typeof prompt === 'function' ? prompt(location, action) : prompt;
141
-
142
- if (typeof result === 'string') {
143
- if (typeof getUserConfirmation === 'function') {
144
- getUserConfirmation(result, callback);
145
- } else {
146
- process.env.NODE_ENV !== "production" ? tinyWarning_esm["default"](false, 'A history needs a getUserConfirmation function in order to use a prompt message') : void 0;
147
- callback(true);
148
- }
149
- } else {
150
- // Return false from a transition hook to cancel the transition.
151
- callback(result !== false);
152
- }
153
- } else {
154
- callback(true);
155
- }
156
- }
157
-
158
- var listeners = [];
159
-
160
- function appendListener(fn) {
161
- var isActive = true;
162
-
163
- function listener() {
164
- if (isActive) fn.apply(void 0, arguments);
165
- }
166
-
167
- listeners.push(listener);
168
- return function () {
169
- isActive = false;
170
- listeners = listeners.filter(function (item) {
171
- return item !== listener;
172
- });
173
- };
174
- }
175
-
176
- function notifyListeners() {
177
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
178
- args[_key] = arguments[_key];
179
- }
180
-
181
- listeners.forEach(function (listener) {
182
- return listener.apply(void 0, args);
183
- });
184
- }
185
-
186
- return {
187
- setPrompt: setPrompt,
188
- confirmTransitionTo: confirmTransitionTo,
189
- appendListener: appendListener,
190
- notifyListeners: notifyListeners
191
- };
192
- }
193
-
194
- var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);
195
-
196
- function getConfirmation(message, callback) {
197
- callback(window.confirm(message)); // eslint-disable-line no-alert
198
- }
199
- /**
200
- * Returns true if the HTML5 history API is supported. Taken from Modernizr.
201
- *
202
- * https://github.com/Modernizr/Modernizr/blob/master/LICENSE
203
- * https://github.com/Modernizr/Modernizr/blob/master/feature-detects/history.js
204
- * changed to avoid false negatives for Windows Phones: https://github.com/reactjs/react-router/issues/586
205
- */
206
-
207
-
208
- function supportsHistory() {
209
- var ua = window.navigator.userAgent;
210
- if ((ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) && ua.indexOf('Mobile Safari') !== -1 && ua.indexOf('Chrome') === -1 && ua.indexOf('Windows Phone') === -1) return false;
211
- return window.history && 'pushState' in window.history;
212
- }
213
- /**
214
- * Returns true if browser fires popstate on hash change.
215
- * IE10 and IE11 do not.
216
- */
217
-
218
-
219
- function supportsPopStateOnHashChange() {
220
- return window.navigator.userAgent.indexOf('Trident') === -1;
221
- }
222
- /**
223
- * Returns true if a given popstate event is an extraneous WebKit event.
224
- * Accounts for the fact that Chrome on iOS fires real popstate events
225
- * containing undefined state when pressing the back button.
226
- */
227
-
228
-
229
- function isExtraneousPopstateEvent(event) {
230
- return event.state === undefined && navigator.userAgent.indexOf('CriOS') === -1;
231
- }
232
-
233
- var PopStateEvent = 'popstate';
234
- var HashChangeEvent = 'hashchange';
235
-
236
- function getHistoryState() {
237
- try {
238
- return window.history.state || {};
239
- } catch (e) {
240
- // IE 11 sometimes throws when accessing window.history.state
241
- // See https://github.com/ReactTraining/history/pull/289
242
- return {};
243
- }
244
- }
245
- /**
246
- * Creates a history object that uses the HTML5 history API including
247
- * pushState, replaceState, and the popstate event.
248
- */
249
-
250
-
251
- function createBrowserHistory(props) {
252
- if (props === void 0) {
253
- props = {};
254
- }
255
-
256
- !canUseDOM ? process.env.NODE_ENV !== "production" ? tinyInvariant_esm["default"](false, 'Browser history needs a DOM') : tinyInvariant_esm["default"](false) : void 0;
257
- var globalHistory = window.history;
258
- var canUseHistory = supportsHistory();
259
- var needsHashChangeListener = !supportsPopStateOnHashChange();
260
- var _props = props,
261
- _props$forceRefresh = _props.forceRefresh,
262
- forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,
263
- _props$getUserConfirm = _props.getUserConfirmation,
264
- getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,
265
- _props$keyLength = _props.keyLength,
266
- keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;
267
- var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';
268
-
269
- function getDOMLocation(historyState) {
270
- var _ref = historyState || {},
271
- key = _ref.key,
272
- state = _ref.state;
273
-
274
- var _window$location = window.location,
275
- pathname = _window$location.pathname,
276
- search = _window$location.search,
277
- hash = _window$location.hash;
278
- var path = pathname + search + hash;
279
- process.env.NODE_ENV !== "production" ? tinyWarning_esm["default"](!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path "' + path + '" to begin with "' + basename + '".') : void 0;
280
- if (basename) path = stripBasename(path, basename);
281
- return createLocation(path, state, key);
282
- }
283
-
284
- function createKey() {
285
- return Math.random().toString(36).substr(2, keyLength);
286
- }
287
-
288
- var transitionManager = createTransitionManager();
289
-
290
- function setState(nextState) {
291
- _extends["default"](history, nextState);
292
-
293
- history.length = globalHistory.length;
294
- transitionManager.notifyListeners(history.location, history.action);
295
- }
296
-
297
- function handlePopState(event) {
298
- // Ignore extraneous popstate events in WebKit.
299
- if (isExtraneousPopstateEvent(event)) return;
300
- handlePop(getDOMLocation(event.state));
301
- }
302
-
303
- function handleHashChange() {
304
- handlePop(getDOMLocation(getHistoryState()));
305
- }
306
-
307
- var forceNextPop = false;
308
-
309
- function handlePop(location) {
310
- if (forceNextPop) {
311
- forceNextPop = false;
312
- setState();
313
- } else {
314
- var action = 'POP';
315
- transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
316
- if (ok) {
317
- setState({
318
- action: action,
319
- location: location
320
- });
321
- } else {
322
- revertPop(location);
323
- }
324
- });
325
- }
326
- }
327
-
328
- function revertPop(fromLocation) {
329
- var toLocation = history.location; // TODO: We could probably make this more reliable by
330
- // keeping a list of keys we've seen in sessionStorage.
331
- // Instead, we just default to 0 for keys we don't know.
332
-
333
- var toIndex = allKeys.indexOf(toLocation.key);
334
- if (toIndex === -1) toIndex = 0;
335
- var fromIndex = allKeys.indexOf(fromLocation.key);
336
- if (fromIndex === -1) fromIndex = 0;
337
- var delta = toIndex - fromIndex;
338
-
339
- if (delta) {
340
- forceNextPop = true;
341
- go(delta);
342
- }
343
- }
344
-
345
- var initialLocation = getDOMLocation(getHistoryState());
346
- var allKeys = [initialLocation.key]; // Public interface
347
-
348
- function createHref(location) {
349
- return basename + createPath(location);
350
- }
351
-
352
- function push(path, state) {
353
- process.env.NODE_ENV !== "production" ? tinyWarning_esm["default"](!(_typeof(path) === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;
354
- var action = 'PUSH';
355
- var location = createLocation(path, state, createKey(), history.location);
356
- transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
357
- if (!ok) return;
358
- var href = createHref(location);
359
- var key = location.key,
360
- state = location.state;
361
-
362
- if (canUseHistory) {
363
- globalHistory.pushState({
364
- key: key,
365
- state: state
366
- }, null, href);
367
-
368
- if (forceRefresh) {
369
- window.location.href = href;
370
- } else {
371
- var prevIndex = allKeys.indexOf(history.location.key);
372
- var nextKeys = allKeys.slice(0, prevIndex + 1);
373
- nextKeys.push(location.key);
374
- allKeys = nextKeys;
375
- setState({
376
- action: action,
377
- location: location
378
- });
379
- }
380
- } else {
381
- process.env.NODE_ENV !== "production" ? tinyWarning_esm["default"](state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : void 0;
382
- window.location.href = href;
383
- }
384
- });
385
- }
386
-
387
- function replace(path, state) {
388
- process.env.NODE_ENV !== "production" ? tinyWarning_esm["default"](!(_typeof(path) === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;
389
- var action = 'REPLACE';
390
- var location = createLocation(path, state, createKey(), history.location);
391
- transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
392
- if (!ok) return;
393
- var href = createHref(location);
394
- var key = location.key,
395
- state = location.state;
396
-
397
- if (canUseHistory) {
398
- globalHistory.replaceState({
399
- key: key,
400
- state: state
401
- }, null, href);
402
-
403
- if (forceRefresh) {
404
- window.location.replace(href);
405
- } else {
406
- var prevIndex = allKeys.indexOf(history.location.key);
407
- if (prevIndex !== -1) allKeys[prevIndex] = location.key;
408
- setState({
409
- action: action,
410
- location: location
411
- });
412
- }
413
- } else {
414
- process.env.NODE_ENV !== "production" ? tinyWarning_esm["default"](state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : void 0;
415
- window.location.replace(href);
416
- }
417
- });
418
- }
419
-
420
- function go(n) {
421
- globalHistory.go(n);
422
- }
423
-
424
- function goBack() {
425
- go(-1);
426
- }
427
-
428
- function goForward() {
429
- go(1);
430
- }
431
-
432
- var listenerCount = 0;
433
-
434
- function checkDOMListeners(delta) {
435
- listenerCount += delta;
436
-
437
- if (listenerCount === 1 && delta === 1) {
438
- window.addEventListener(PopStateEvent, handlePopState);
439
- if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);
440
- } else if (listenerCount === 0) {
441
- window.removeEventListener(PopStateEvent, handlePopState);
442
- if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);
443
- }
444
- }
445
-
446
- var isBlocked = false;
447
-
448
- function block(prompt) {
449
- if (prompt === void 0) {
450
- prompt = false;
451
- }
452
-
453
- var unblock = transitionManager.setPrompt(prompt);
454
-
455
- if (!isBlocked) {
456
- checkDOMListeners(1);
457
- isBlocked = true;
458
- }
459
-
460
- return function () {
461
- if (isBlocked) {
462
- isBlocked = false;
463
- checkDOMListeners(-1);
464
- }
465
-
466
- return unblock();
467
- };
468
- }
469
-
470
- function listen(listener) {
471
- var unlisten = transitionManager.appendListener(listener);
472
- checkDOMListeners(1);
473
- return function () {
474
- checkDOMListeners(-1);
475
- unlisten();
476
- };
477
- }
478
-
479
- var history = {
480
- length: globalHistory.length,
481
- action: 'POP',
482
- location: initialLocation,
483
- createHref: createHref,
484
- push: push,
485
- replace: replace,
486
- go: go,
487
- goBack: goBack,
488
- goForward: goForward,
489
- block: block,
490
- listen: listen
491
- };
492
- return history;
493
- }
494
-
495
- exports.createBrowserHistory = createBrowserHistory;
496
- exports.createLocation = createLocation;
497
- exports.createPath = createPath;
498
- exports.parsePath = parsePath;
@@ -1,73 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', {
4
- value: true
5
- });
6
-
7
- function isAbsolute(pathname) {
8
- return pathname.charAt(0) === '/';
9
- } // About 1.5x faster than the two-arg version of Array#splice()
10
-
11
-
12
- function spliceOne(list, index) {
13
- for (var i = index, k = i + 1, n = list.length; k < n; i += 1, k += 1) {
14
- list[i] = list[k];
15
- }
16
-
17
- list.pop();
18
- } // This implementation is based heavily on node's url.parse
19
-
20
-
21
- function resolvePathname(to, from) {
22
- if (from === undefined) from = '';
23
- var toParts = to && to.split('/') || [];
24
- var fromParts = from && from.split('/') || [];
25
- var isToAbs = to && isAbsolute(to);
26
- var isFromAbs = from && isAbsolute(from);
27
- var mustEndAbs = isToAbs || isFromAbs;
28
-
29
- if (to && isAbsolute(to)) {
30
- // to is absolute
31
- fromParts = toParts;
32
- } else if (toParts.length) {
33
- // to is relative, drop the filename
34
- fromParts.pop();
35
- fromParts = fromParts.concat(toParts);
36
- }
37
-
38
- if (!fromParts.length) return '/';
39
- var hasTrailingSlash;
40
-
41
- if (fromParts.length) {
42
- var last = fromParts[fromParts.length - 1];
43
- hasTrailingSlash = last === '.' || last === '..' || last === '';
44
- } else {
45
- hasTrailingSlash = false;
46
- }
47
-
48
- var up = 0;
49
-
50
- for (var i = fromParts.length; i >= 0; i--) {
51
- var part = fromParts[i];
52
-
53
- if (part === '.') {
54
- spliceOne(fromParts, i);
55
- } else if (part === '..') {
56
- spliceOne(fromParts, i);
57
- up++;
58
- } else if (up) {
59
- spliceOne(fromParts, i);
60
- up--;
61
- }
62
- }
63
-
64
- if (!mustEndAbs) for (; up--; up) {
65
- fromParts.unshift('..');
66
- }
67
- if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) fromParts.unshift('');
68
- var result = fromParts.join('/');
69
- if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';
70
- return result;
71
- }
72
-
73
- exports["default"] = resolvePathname;
@@ -1,36 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', {
4
- value: true
5
- });
6
-
7
- function styleInject(css, ref) {
8
- if (ref === void 0) ref = {};
9
- var insertAt = ref.insertAt;
10
-
11
- if (!css || typeof document === 'undefined') {
12
- return;
13
- }
14
-
15
- var head = document.head || document.getElementsByTagName('head')[0];
16
- var style = document.createElement('style');
17
- style.type = 'text/css';
18
-
19
- if (insertAt === 'top') {
20
- if (head.firstChild) {
21
- head.insertBefore(style, head.firstChild);
22
- } else {
23
- head.appendChild(style);
24
- }
25
- } else {
26
- head.appendChild(style);
27
- }
28
-
29
- if (style.styleSheet) {
30
- style.styleSheet.cssText = css;
31
- } else {
32
- style.appendChild(document.createTextNode(css));
33
- }
34
- }
35
-
36
- exports["default"] = styleInject;
@@ -1,23 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', {
4
- value: true
5
- });
6
- var isProduction = process.env.NODE_ENV === 'production';
7
- var prefix = 'Invariant failed';
8
-
9
- function invariant(condition, message) {
10
- if (condition) {
11
- return;
12
- }
13
-
14
- if (isProduction) {
15
- throw new Error(prefix);
16
- }
17
-
18
- var provided = typeof message === 'function' ? message() : message;
19
- var value = provided ? prefix + ": " + provided : prefix;
20
- throw new Error(value);
21
- }
22
-
23
- exports["default"] = invariant;
@@ -1,26 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', {
4
- value: true
5
- });
6
- var isProduction = process.env.NODE_ENV === 'production';
7
-
8
- function warning(condition, message) {
9
- if (!isProduction) {
10
- if (condition) {
11
- return;
12
- }
13
-
14
- var text = "Warning: " + message;
15
-
16
- if (typeof console !== 'undefined') {
17
- console.warn(text);
18
- }
19
-
20
- try {
21
- throw Error(text);
22
- } catch (x) {}
23
- }
24
- }
25
-
26
- exports["default"] = warning;
@@ -1,38 +0,0 @@
1
- 'use strict';
2
-
3
- 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); }
4
-
5
- Object.defineProperty(exports, '__esModule', {
6
- value: true
7
- });
8
-
9
- var EchoCore = require('@equinor/echo-core');
10
-
11
- var React = require('react');
12
-
13
- var AppLinks_module = require('./AppLinks.module.css.js');
14
-
15
- var linkButton = require('./linkButton/linkButton.js');
16
-
17
- function _interopDefaultLegacy(e) {
18
- return e && _typeof(e) === 'object' && 'default' in e ? e : {
19
- 'default': e
20
- };
21
- }
22
-
23
- var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
24
-
25
- var AppLinks = function AppLinks(_ref) {
26
- var isHome = _ref.isHome;
27
- var appLinks = EchoCore.useAppLinks(isHome);
28
- return /*#__PURE__*/React__default["default"].createElement("div", {
29
- className: AppLinks_module["default"].AppBar
30
- }, appLinks.map(function (appLink, index) {
31
- return /*#__PURE__*/React__default["default"].createElement(linkButton.LinkButton, {
32
- key: appLink.name + index,
33
- appLink: appLink
34
- });
35
- }));
36
- };
37
-
38
- exports.AppLinks = AppLinks;