@xh/hoist 72.1.0 → 72.3.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.
Files changed (60) hide show
  1. package/CHANGELOG.md +44 -0
  2. package/admin/tabs/activity/clienterrors/ClientErrorsModel.ts +23 -4
  3. package/admin/tabs/cluster/instances/InstancesTabModel.ts +4 -3
  4. package/admin/tabs/cluster/instances/logs/LogDisplay.ts +12 -14
  5. package/admin/tabs/cluster/instances/logs/LogDisplayModel.ts +0 -2
  6. package/admin/tabs/cluster/instances/logs/LogViewer.ts +6 -5
  7. package/admin/tabs/cluster/instances/logs/LogViewerModel.ts +8 -1
  8. package/admin/tabs/cluster/instances/memory/MemoryMonitorModel.ts +1 -0
  9. package/admin/tabs/cluster/instances/services/DetailsModel.ts +1 -2
  10. package/admin/tabs/cluster/instances/services/DetailsPanel.ts +19 -14
  11. package/admin/tabs/cluster/instances/services/ServiceModel.ts +14 -6
  12. package/admin/tabs/cluster/instances/services/ServicePanel.ts +9 -10
  13. package/admin/tabs/cluster/instances/websocket/WebSocketColumns.ts +9 -0
  14. package/admin/tabs/cluster/instances/websocket/WebSocketModel.ts +2 -1
  15. package/admin/tabs/userData/roles/RoleModel.ts +1 -1
  16. package/admin/tabs/userData/roles/details/RoleDetailsModel.ts +2 -1
  17. package/admin/tabs/userData/roles/recategorize/RecategorizeDialogModel.ts +1 -1
  18. package/appcontainer/AppStateModel.ts +6 -1
  19. package/build/types/admin/tabs/activity/tracking/ActivityTrackingModel.d.ts +4 -1
  20. package/build/types/admin/tabs/cluster/instances/services/DetailsModel.d.ts +2 -3
  21. package/build/types/admin/tabs/cluster/instances/websocket/WebSocketColumns.d.ts +1 -0
  22. package/build/types/appcontainer/AppStateModel.d.ts +5 -1
  23. package/build/types/cmp/tab/TabContainerModel.d.ts +5 -5
  24. package/build/types/core/HoistProps.d.ts +1 -0
  25. package/build/types/core/XH.d.ts +5 -5
  26. package/build/types/core/types/Interfaces.d.ts +9 -0
  27. package/build/types/desktop/cmp/appOption/AutoRefreshAppOption.d.ts +1 -0
  28. package/build/types/desktop/cmp/appOption/ThemeAppOption.d.ts +1 -0
  29. package/build/types/desktop/cmp/tab/TabSwitcher.d.ts +1 -1
  30. package/build/types/kit/blueprint/Wrappers.d.ts +1 -1
  31. package/build/types/kit/swiper/index.d.ts +4 -4
  32. package/build/types/security/BaseOAuthClient.d.ts +25 -28
  33. package/build/types/security/Token.d.ts +0 -1
  34. package/build/types/security/Types.d.ts +39 -0
  35. package/build/types/security/authzero/AuthZeroClient.d.ts +3 -4
  36. package/build/types/security/msal/MsalClient.d.ts +14 -4
  37. package/build/types/svc/TrackService.d.ts +31 -1
  38. package/build/types/utils/js/BrowserUtils.d.ts +38 -1
  39. package/cmp/tab/TabContainerModel.ts +5 -5
  40. package/core/HoistProps.ts +1 -0
  41. package/core/XH.ts +13 -5
  42. package/core/exception/Exception.ts +19 -12
  43. package/core/types/Interfaces.ts +11 -0
  44. package/data/Store.ts +3 -0
  45. package/desktop/appcontainer/ExceptionDialog.ts +1 -1
  46. package/desktop/cmp/dash/canvas/DashCanvas.ts +2 -1
  47. package/desktop/cmp/grid/editors/BooleanEditor.ts +15 -3
  48. package/desktop/cmp/tab/TabSwitcher.ts +1 -1
  49. package/package.json +2 -2
  50. package/security/BaseOAuthClient.ts +52 -45
  51. package/security/Token.ts +0 -2
  52. package/security/Types.ts +51 -0
  53. package/security/authzero/AuthZeroClient.ts +6 -8
  54. package/security/msal/MsalClient.ts +130 -27
  55. package/svc/FetchService.ts +3 -2
  56. package/svc/TrackService.ts +94 -8
  57. package/svc/WebSocketService.ts +1 -2
  58. package/tsconfig.tsbuildinfo +1 -1
  59. package/utils/js/BrowserUtils.ts +72 -21
  60. package/utils/react/LayoutPropUtils.ts +2 -1
@@ -4,25 +4,31 @@
4
4
  *
5
5
  * Copyright © 2025 Extremely Heavy Industries Inc.
6
6
  */
7
- import {pick} from 'lodash';
7
+ import {XH} from '@xh/hoist/core';
8
+ import {pick, round} from 'lodash';
8
9
 
9
10
  /**
10
11
  * Extract information (if available) about the client browser's window, screen, and network speed.
11
12
  */
12
- export function getClientDeviceInfo() {
13
- const data: any = pick(window, [
14
- 'screen',
15
- 'devicePixelRatio',
16
- 'screenX',
17
- 'screenY',
18
- 'innerWidth',
19
- 'innerHeight',
20
- 'outerWidth',
21
- 'outerHeight'
22
- ]);
13
+ export function getClientDeviceInfo(): ClientDeviceInfo {
14
+ const ret: ClientDeviceInfo = {
15
+ window: pick(window, [
16
+ 'devicePixelRatio',
17
+ 'screenX',
18
+ 'screenY',
19
+ 'innerWidth',
20
+ 'innerHeight',
21
+ 'outerWidth',
22
+ 'outerHeight'
23
+ ]),
24
+ memory: {
25
+ modelCount: XH.getModels().length
26
+ }
27
+ };
23
28
 
24
- if (data.screen) {
25
- data.screen = pick(data.screen, [
29
+ const screen = window.screen as any;
30
+ if (screen) {
31
+ ret.screen = pick(screen, [
26
32
  'availWidth',
27
33
  'availHeight',
28
34
  'width',
@@ -30,23 +36,68 @@ export function getClientDeviceInfo() {
30
36
  'colorDepth',
31
37
  'pixelDepth',
32
38
  'availLeft',
33
- 'availTop',
34
- 'orientation'
39
+ 'availTop'
35
40
  ]);
36
- if (data.screen.orientation) {
37
- data.screen.orientation = pick(data.screen.orientation, ['angle', 'type']);
41
+ if (screen.orientation) {
42
+ ret.screen.orientation = pick(screen.orientation, ['angle', 'type']);
38
43
  }
39
44
  }
40
45
 
41
46
  const nav = window.navigator as any;
42
47
  if (nav.connection) {
43
- data.connection = pick(nav.connection, ['downlink', 'effectiveType', 'rtt']);
48
+ ret.connection = pick(nav.connection, ['downlink', 'effectiveType', 'rtt']);
44
49
  }
45
50
 
46
51
  const perf = window.performance as any;
47
52
  if (perf?.memory) {
48
- data.memory = pick(perf.memory, ['jsHeapSizeLimit', 'totalJSHeapSize', 'usedJSHeapSize']);
53
+ ['jsHeapSizeLimit', 'totalJSHeapSize', 'usedJSHeapSize'].forEach(key => {
54
+ const raw = perf.memory[key];
55
+ if (raw) ret.memory[key] = round(raw / 1024 / 1024); // convert to MB
56
+ });
57
+
58
+ const {jsHeapSizeLimit: limit, usedJSHeapSize: used} = ret.memory;
59
+ if (limit && used) {
60
+ ret.memory.usedPctLimit = round((used / limit) * 100, 1);
61
+ }
49
62
  }
50
63
 
51
- return data;
64
+ return ret;
65
+ }
66
+
67
+ export interface ClientDeviceInfo {
68
+ window: {
69
+ devicePixelRatio: number;
70
+ screenX: number;
71
+ screenY: number;
72
+ innerWidth: number;
73
+ innerHeight: number;
74
+ outerWidth: number;
75
+ outerHeight: number;
76
+ };
77
+ screen?: {
78
+ availWidth: number;
79
+ availHeight: number;
80
+ width: number;
81
+ height: number;
82
+ colorDepth: number;
83
+ pixelDepth: number;
84
+ availLeft: number;
85
+ availTop: number;
86
+ orientation?: {
87
+ angle: number;
88
+ type: string;
89
+ };
90
+ };
91
+ connection?: {
92
+ downlink: number;
93
+ effectiveType: string;
94
+ rtt: number;
95
+ };
96
+ memory: {
97
+ modelCount: number;
98
+ usedPctLimit?: number;
99
+ jsHeapSizeLimit?: number;
100
+ totalJSHeapSize?: number;
101
+ usedJSHeapSize?: number;
102
+ };
52
103
  }
@@ -97,7 +97,8 @@ const dimKeys = [
97
97
  'maxHeight',
98
98
  'width',
99
99
  'minWidth',
100
- 'maxWidth'
100
+ 'maxWidth',
101
+ 'gap'
101
102
  ];
102
103
  const flexKeys = ['flex', 'flexBasis', 'flexDirection', 'flexGrow', 'flexShrink', 'flexWrap'];
103
104
  const alignKeys = ['alignItems', 'alignSelf', 'alignContent', 'justifyContent'];