@xh/hoist 76.0.0-SNAPSHOT.1758215282397 → 76.0.0-SNAPSHOT.1758297294348

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 (84) hide show
  1. package/CHANGELOG.md +1 -3
  2. package/admin/tabs/userData/roles/graph/RoleGraph.ts +1 -2
  3. package/appcontainer/AppContainerModel.ts +1 -2
  4. package/appcontainer/ExceptionDialogModel.ts +2 -1
  5. package/build/types/appcontainer/ExceptionDialogModel.d.ts +2 -1
  6. package/build/types/cmp/grid/Grid.d.ts +3 -3
  7. package/build/types/core/{exception/ExceptionHandler.d.ts → ExceptionHandler.d.ts} +2 -1
  8. package/build/types/core/XH.d.ts +3 -2
  9. package/build/types/core/index.d.ts +1 -3
  10. package/build/types/core/types/Types.d.ts +0 -10
  11. package/build/types/desktop/cmp/appOption/AutoRefreshAppOption.d.ts +5 -5
  12. package/build/types/desktop/cmp/appOption/ThemeAppOption.d.ts +5 -5
  13. package/build/types/desktop/cmp/rest/impl/RestFormModel.d.ts +1 -1
  14. package/build/types/exception/Exception.d.ts +24 -0
  15. package/build/types/{core/exception → exception}/Types.d.ts +1 -18
  16. package/build/types/exception/index.d.ts +2 -0
  17. package/build/types/kit/swiper/index.d.ts +1 -1
  18. package/build/types/svc/FetchService.d.ts +55 -0
  19. package/build/types/utils/js/LangUtils.d.ts +1 -27
  20. package/build/types/utils/{log → js}/LogUtils.d.ts +37 -1
  21. package/build/types/utils/js/index.d.ts +2 -0
  22. package/cmp/ag-grid/AgGrid.ts +1 -1
  23. package/cmp/chart/Chart.ts +1 -2
  24. package/cmp/chart/impl/ChartContextMenuItems.ts +1 -1
  25. package/cmp/grid/columns/Column.ts +1 -2
  26. package/cmp/grid/helpers/GridCountLabel.ts +1 -2
  27. package/cmp/grid/impl/ColumnWidthCalculator.ts +1 -2
  28. package/cmp/grid/impl/Utils.ts +1 -1
  29. package/cmp/relativetimestamp/RelativeTimestamp.ts +1 -2
  30. package/cmp/treemap/TreeMap.ts +1 -2
  31. package/core/{exception/ExceptionHandler.ts → ExceptionHandler.ts} +3 -4
  32. package/core/HoistBase.ts +3 -2
  33. package/core/HoistBaseDecorators.ts +1 -2
  34. package/core/HoistComponent.ts +1 -2
  35. package/core/XH.ts +3 -4
  36. package/core/index.ts +1 -3
  37. package/core/load/LoadSupport.ts +1 -2
  38. package/core/persist/PersistenceProvider.ts +1 -2
  39. package/core/types/Types.ts +0 -6
  40. package/data/filter/Utils.ts +1 -1
  41. package/data/impl/RecordSet.ts +1 -2
  42. package/desktop/cmp/button/grid/ColAutosizeButton.ts +1 -2
  43. package/desktop/cmp/button/grid/ColChooserButton.ts +1 -2
  44. package/desktop/cmp/button/grid/ExpandToLevelButton.ts +1 -2
  45. package/desktop/cmp/button/grid/ExportButton.ts +1 -2
  46. package/desktop/cmp/button/panel/ModalToggleButton.ts +1 -2
  47. package/desktop/cmp/button/zoneGrid/ZoneMapperButton.ts +1 -2
  48. package/desktop/cmp/dash/container/impl/DashContainerUtils.ts +1 -2
  49. package/desktop/cmp/form/FormField.ts +1 -2
  50. package/desktop/cmp/grid/editors/BooleanEditor.ts +1 -1
  51. package/desktop/cmp/panel/Panel.ts +1 -1
  52. package/desktop/hooks/UseContextMenu.ts +1 -1
  53. package/exception/Exception.ts +81 -0
  54. package/{core/exception → exception}/Types.ts +1 -22
  55. package/{utils/log → exception}/index.ts +2 -2
  56. package/kit/ag-grid/index.ts +1 -2
  57. package/kit/highcharts/index.ts +1 -2
  58. package/mobile/cmp/button/grid/ColAutosizeButton.ts +1 -2
  59. package/mobile/cmp/button/grid/ColChooserButton.ts +1 -2
  60. package/mobile/cmp/button/grid/ExpandCollapseButton.ts +1 -2
  61. package/mobile/cmp/button/grid/ExpandToLevelButton.ts +1 -2
  62. package/mobile/cmp/button/zoneGrid/ZoneMapperButton.ts +1 -2
  63. package/mobile/cmp/panel/Panel.ts +1 -1
  64. package/mobx/overrides.ts +1 -1
  65. package/package.json +1 -1
  66. package/promise/Promise.ts +3 -3
  67. package/security/BaseOAuthClient.ts +3 -3
  68. package/security/msal/MsalClient.ts +1 -2
  69. package/svc/ChangelogService.ts +1 -1
  70. package/svc/EnvironmentService.ts +1 -2
  71. package/svc/FetchService.ts +208 -16
  72. package/tsconfig.tsbuildinfo +1 -1
  73. package/utils/async/Timer.ts +1 -2
  74. package/utils/js/Decorators.ts +4 -4
  75. package/utils/js/LangUtils.ts +2 -66
  76. package/utils/{log → js}/LogUtils.ts +77 -19
  77. package/utils/js/index.ts +2 -0
  78. package/build/types/core/exception/Exception.d.ts +0 -61
  79. package/build/types/utils/log/index.d.ts +0 -1
  80. package/build/types/utils/version/index.d.ts +0 -1
  81. package/core/exception/Exception.ts +0 -256
  82. package/utils/version/index.ts +0 -8
  83. /package/build/types/utils/{version → js}/VersionUtils.d.ts +0 -0
  84. /package/utils/{version → js}/VersionUtils.ts +0 -0
package/CHANGELOG.md CHANGED
@@ -3,10 +3,8 @@
3
3
  ## 76.0.0-SNAPSHOT - unreleased
4
4
 
5
5
  ### 💥 Breaking Changes (upgrade difficulty: 🟢 LOW - upgrade to Hoist Core, change to Tab constructor)
6
- * The constructor for `TabModel` has changed to take its owning container as a second argument.
6
+ * The constructor for `TabModel` has changed to take its owning container as a second argument.
7
7
  (Most applications do not create `TabModels` directly, but it is possible.)
8
- * `checkVersion` and related methods' import path has changed. Update imports from
9
- `@xh/hoist/utils/js/VersionUtils` to `@xh/hoist/utils/version`; (Unlikely to affect most apps.)
10
8
 
11
9
  ### 🎁 New Features
12
10
 
@@ -14,8 +14,7 @@ import {panel} from '@xh/hoist/desktop/cmp/panel';
14
14
  import {toolbar} from '@xh/hoist/desktop/cmp/toolbar';
15
15
  import {Icon} from '@xh/hoist/icon';
16
16
  import {Highcharts} from '@xh/hoist/kit/highcharts';
17
- import {pluralize} from '@xh/hoist/utils/js';
18
- import {logError} from '@xh/hoist/utils/log';
17
+ import {logError, pluralize} from '@xh/hoist/utils/js';
19
18
  import {isEmpty} from 'lodash';
20
19
  import {RoleModel} from '../RoleModel';
21
20
  import {RoleGraphModel} from './RoleGraphModel';
@@ -40,8 +40,7 @@ import {
40
40
  TrackService,
41
41
  WebSocketService
42
42
  } from '@xh/hoist/svc';
43
- import {checkMinVersion} from '@xh/hoist/utils/version';
44
- import {createSingleton, throwIf} from '@xh/hoist/utils/js';
43
+ import {checkMinVersion, createSingleton, throwIf} from '@xh/hoist/utils/js';
45
44
  import {compact, isEmpty} from 'lodash';
46
45
  import {AboutDialogModel} from './AboutDialogModel';
47
46
  import {BannerSourceModel} from './BannerSourceModel';
@@ -4,7 +4,8 @@
4
4
  *
5
5
  * Copyright © 2025 Extremely Heavy Industries Inc.
6
6
  */
7
- import {ExceptionHandlerOptions, HoistException, HoistModel, XH} from '@xh/hoist/core';
7
+ import type {HoistException} from '@xh/hoist/exception';
8
+ import {ExceptionHandlerOptions, HoistModel, XH} from '@xh/hoist/core';
8
9
  import {action, observable, makeObservable, bindable} from '@xh/hoist/mobx';
9
10
 
10
11
  /**
@@ -1,4 +1,5 @@
1
- import { ExceptionHandlerOptions, HoistException, HoistModel } from '@xh/hoist/core';
1
+ import type { HoistException } from '@xh/hoist/exception';
2
+ import { ExceptionHandlerOptions, HoistModel } from '@xh/hoist/core';
2
3
  /**
3
4
  * Manages the default display of exceptions.
4
5
  *
@@ -55,7 +55,7 @@ export declare class GridLocalModel extends HoistModel {
55
55
  getColumnDefs(): Array<ColDef | ColGroupDef>;
56
56
  getContextMenuItems: (params: GetContextMenuItemsParams) => (string | import("@ag-grid-community/core").MenuItemDef<any, any>)[];
57
57
  dataReaction(): {
58
- track: () => (boolean | import("@xh/hoist/core").VSide | import("../../data").StoreRecord[] | RecordSet)[];
58
+ track: () => (boolean | RecordSet | import("../../data").StoreRecord[] | import("@xh/hoist/core").VSide)[];
59
59
  run: () => void;
60
60
  };
61
61
  selectionReaction(): {
@@ -63,7 +63,7 @@ export declare class GridLocalModel extends HoistModel {
63
63
  run: () => void;
64
64
  };
65
65
  sortReaction(): {
66
- track: () => (GridApi<any> | import("@xh/hoist/cmp/grid").GridSorter[])[];
66
+ track: () => (import("@xh/hoist/cmp/grid").GridSorter[] | GridApi<any>)[];
67
67
  run: ([agApi, sortBy]: [any, any]) => void;
68
68
  };
69
69
  groupReaction(): {
@@ -83,7 +83,7 @@ export declare class GridLocalModel extends HoistModel {
83
83
  get useScrollOptimization(): boolean;
84
84
  applyScrollOptimization(): void;
85
85
  columnsReaction(): {
86
- track: () => (GridApi<any> | (import("@xh/hoist/cmp/grid").Column | import("@xh/hoist/cmp/grid").ColumnGroup)[])[];
86
+ track: () => ((import("@xh/hoist/cmp/grid").Column | import("@xh/hoist/cmp/grid").ColumnGroup)[] | GridApi<any>)[];
87
87
  run: ([api]: [any]) => void;
88
88
  };
89
89
  columnStateReaction(): ReactionSpec<[GridApi, ColumnState[]]>;
@@ -1,4 +1,5 @@
1
- import { HoistException, PlainObject } from '../';
1
+ import { HoistException } from '../exception';
2
+ import { PlainObject } from './';
2
3
  export interface ExceptionHandlerOptions {
3
4
  /** Text (ideally user-friendly) describing the error. */
4
5
  message?: string;
@@ -2,7 +2,7 @@ import { RouterModel } from '@xh/hoist/appcontainer/RouterModel';
2
2
  import { HoistAuthModel } from '@xh/hoist/core/HoistAuthModel';
3
3
  import { Store } from '@xh/hoist/data';
4
4
  import { AlertBannerService, AutoRefreshService, ChangelogService, ConfigService, EnvironmentService, FetchOptions, FetchService, GridAutosizeService, GridExportService, IdentityService, IdleService, InspectorService, JsonBlobService, LocalStorageService, PrefService, SessionStorageService, TrackService, WebSocketService, ClientHealthService } from '@xh/hoist/svc';
5
- import type { LogLevel } from './types/Types';
5
+ import { LogLevel } from '@xh/hoist/utils/js';
6
6
  import { Router, State } from 'router5';
7
7
  import { CancelFn } from 'router5/types/types/base';
8
8
  import { SetOptional } from 'type-fest';
@@ -10,7 +10,8 @@ import { AppContainerModel } from '../appcontainer/AppContainerModel';
10
10
  import { BannerModel } from '../appcontainer/BannerModel';
11
11
  import { ToastModel } from '../appcontainer/ToastModel';
12
12
  import '../styles/XH.scss';
13
- import { AppSpec, AppState, AppSuspendData, BannerSpec, ExceptionHandler, ExceptionHandlerOptions, HoistAppModel, HoistException, HoistService, HoistServiceClass, HoistUser, MessageSpec, PageState, PlainObject, ReloadAppOptions, SizingMode, TaskObserver, Theme, ToastSpec, TrackOptions } from './';
13
+ import { HoistException } from '../exception';
14
+ import { AppSpec, AppState, AppSuspendData, BannerSpec, ExceptionHandler, ExceptionHandlerOptions, HoistAppModel, HoistService, HoistServiceClass, HoistUser, MessageSpec, PageState, PlainObject, ReloadAppOptions, SizingMode, TaskObserver, Theme, ToastSpec, TrackOptions } from './';
14
15
  import { HoistModel, ModelSelector, RefreshContextModel } from './model';
15
16
  export declare const MIN_HOIST_CORE_VERSION = "31.2";
16
17
  /**
@@ -18,7 +18,5 @@ export * from './HoistComponent';
18
18
  export * from './RefreshContextView';
19
19
  export * from './HoistAppModel';
20
20
  export * from './HoistAuthModel';
21
- export * from './exception/ExceptionHandler';
22
- export * from './exception/Exception';
23
- export * from './exception/Types';
21
+ export * from './ExceptionHandler';
24
22
  export { XH, XHApi } from './XH';
@@ -66,13 +66,3 @@ export type PageState =
66
66
  * The page is in the process of being unloaded by the browser (this is a terminal state x_x).
67
67
  */
68
68
  | 'terminated';
69
- /** Severity Level for log statement */
70
- export type LogLevel = 'error' | 'warn' | 'info' | 'debug';
71
- /** Object identifying the source of log statement. Typically, a javascript class */
72
- export type LogSource = string | {
73
- displayName: string;
74
- } | {
75
- constructor: {
76
- name: string;
77
- };
78
- };
@@ -72,14 +72,14 @@ export declare const autoRefreshAppOption: ({ formFieldProps, inputProps }?: Aut
72
72
  position?: import("csstype").Property.Position;
73
73
  display?: string;
74
74
  testId?: string;
75
- onClick?: import("react").MouseEventHandler<HTMLDivElement>;
75
+ id?: string | undefined;
76
+ onError?: import("react").ReactEventHandler<HTMLDivElement>;
77
+ defaultValue?: string | number | readonly string[] | undefined;
76
78
  slot?: string | undefined;
77
79
  style?: import("react").CSSProperties | undefined;
78
80
  title?: string | undefined;
79
- content?: string | undefined;
80
81
  hidden?: boolean | undefined;
81
82
  defaultChecked?: boolean | undefined;
82
- defaultValue?: string | number | readonly string[] | undefined;
83
83
  suppressContentEditableWarning?: boolean | undefined;
84
84
  suppressHydrationWarning?: boolean | undefined;
85
85
  accessKey?: string | undefined;
@@ -89,7 +89,6 @@ export declare const autoRefreshAppOption: ({ formFieldProps, inputProps }?: Aut
89
89
  dir?: string | undefined;
90
90
  draggable?: (boolean | "true" | "false") | undefined;
91
91
  enterKeyHint?: "enter" | "done" | "go" | "next" | "previous" | "search" | "send" | undefined;
92
- id?: string | undefined;
93
92
  lang?: string | undefined;
94
93
  nonce?: string | undefined;
95
94
  spellCheck?: (boolean | "true" | "false") | undefined;
@@ -98,6 +97,7 @@ export declare const autoRefreshAppOption: ({ formFieldProps, inputProps }?: Aut
98
97
  radioGroup?: string | undefined;
99
98
  role?: import("react").AriaRole | undefined;
100
99
  about?: string | undefined;
100
+ content?: string | undefined;
101
101
  datatype?: string | undefined;
102
102
  inlist?: any;
103
103
  prefix?: string | undefined;
@@ -207,7 +207,6 @@ export declare const autoRefreshAppOption: ({ formFieldProps, inputProps }?: Aut
207
207
  onInvalidCapture?: import("react").FormEventHandler<HTMLDivElement>;
208
208
  onLoad?: import("react").ReactEventHandler<HTMLDivElement>;
209
209
  onLoadCapture?: import("react").ReactEventHandler<HTMLDivElement>;
210
- onError?: import("react").ReactEventHandler<HTMLDivElement>;
211
210
  onErrorCapture?: import("react").ReactEventHandler<HTMLDivElement>;
212
211
  onKeyDown?: import("react").KeyboardEventHandler<HTMLDivElement>;
213
212
  onKeyDownCapture?: import("react").KeyboardEventHandler<HTMLDivElement>;
@@ -261,6 +260,7 @@ export declare const autoRefreshAppOption: ({ formFieldProps, inputProps }?: Aut
261
260
  onWaitingCapture?: import("react").ReactEventHandler<HTMLDivElement>;
262
261
  onAuxClick?: import("react").MouseEventHandler<HTMLDivElement>;
263
262
  onAuxClickCapture?: import("react").MouseEventHandler<HTMLDivElement>;
263
+ onClick?: import("react").MouseEventHandler<HTMLDivElement>;
264
264
  onClickCapture?: import("react").MouseEventHandler<HTMLDivElement>;
265
265
  onContextMenu?: import("react").MouseEventHandler<HTMLDivElement>;
266
266
  onContextMenuCapture?: import("react").MouseEventHandler<HTMLDivElement>;
@@ -70,14 +70,14 @@ export declare const themeAppOption: ({ formFieldProps, inputProps }?: ThemeAppO
70
70
  position?: import("csstype").Property.Position;
71
71
  display?: string;
72
72
  testId?: string;
73
- onClick?: import("react").MouseEventHandler<HTMLDivElement>;
73
+ id?: string | undefined;
74
+ onError?: import("react").ReactEventHandler<HTMLDivElement>;
75
+ defaultValue?: string | number | readonly string[] | undefined;
74
76
  slot?: string | undefined;
75
77
  style?: import("react").CSSProperties | undefined;
76
78
  title?: string | undefined;
77
- content?: string | undefined;
78
79
  hidden?: boolean | undefined;
79
80
  defaultChecked?: boolean | undefined;
80
- defaultValue?: string | number | readonly string[] | undefined;
81
81
  suppressContentEditableWarning?: boolean | undefined;
82
82
  suppressHydrationWarning?: boolean | undefined;
83
83
  accessKey?: string | undefined;
@@ -87,7 +87,6 @@ export declare const themeAppOption: ({ formFieldProps, inputProps }?: ThemeAppO
87
87
  dir?: string | undefined;
88
88
  draggable?: (boolean | "true" | "false") | undefined;
89
89
  enterKeyHint?: "enter" | "done" | "go" | "next" | "previous" | "search" | "send" | undefined;
90
- id?: string | undefined;
91
90
  lang?: string | undefined;
92
91
  nonce?: string | undefined;
93
92
  spellCheck?: (boolean | "true" | "false") | undefined;
@@ -96,6 +95,7 @@ export declare const themeAppOption: ({ formFieldProps, inputProps }?: ThemeAppO
96
95
  radioGroup?: string | undefined;
97
96
  role?: import("react").AriaRole | undefined;
98
97
  about?: string | undefined;
98
+ content?: string | undefined;
99
99
  datatype?: string | undefined;
100
100
  inlist?: any;
101
101
  prefix?: string | undefined;
@@ -205,7 +205,6 @@ export declare const themeAppOption: ({ formFieldProps, inputProps }?: ThemeAppO
205
205
  onInvalidCapture?: import("react").FormEventHandler<HTMLDivElement>;
206
206
  onLoad?: import("react").ReactEventHandler<HTMLDivElement>;
207
207
  onLoadCapture?: import("react").ReactEventHandler<HTMLDivElement>;
208
- onError?: import("react").ReactEventHandler<HTMLDivElement>;
209
208
  onErrorCapture?: import("react").ReactEventHandler<HTMLDivElement>;
210
209
  onKeyDown?: import("react").KeyboardEventHandler<HTMLDivElement>;
211
210
  onKeyDownCapture?: import("react").KeyboardEventHandler<HTMLDivElement>;
@@ -259,6 +258,7 @@ export declare const themeAppOption: ({ formFieldProps, inputProps }?: ThemeAppO
259
258
  onWaitingCapture?: import("react").ReactEventHandler<HTMLDivElement>;
260
259
  onAuxClick?: import("react").MouseEventHandler<HTMLDivElement>;
261
260
  onAuxClickCapture?: import("react").MouseEventHandler<HTMLDivElement>;
261
+ onClick?: import("react").MouseEventHandler<HTMLDivElement>;
262
262
  onClickCapture?: import("react").MouseEventHandler<HTMLDivElement>;
263
263
  onContextMenu?: import("react").MouseEventHandler<HTMLDivElement>;
264
264
  onContextMenuCapture?: import("react").MouseEventHandler<HTMLDivElement>;
@@ -20,7 +20,7 @@ export declare class RestFormModel extends HoistModel {
20
20
  del?: string | ((recs: import("@xh/hoist/data").StoreRecord[]) => string);
21
21
  edit?: string | ((recs: import("@xh/hoist/data").StoreRecord[]) => string);
22
22
  };
23
- get actions(): (import("@xh/hoist/data").RecordAction | import("@xh/hoist/data").RecordActionSpec)[];
23
+ get actions(): (import("@xh/hoist/data").RecordActionSpec | import("@xh/hoist/data").RecordAction)[];
24
24
  get editors(): RestGridEditor[];
25
25
  get gridModel(): import("../../../../cmp/grid").GridModel;
26
26
  get store(): import("@xh/hoist/desktop/cmp/rest").RestStore;
@@ -0,0 +1,24 @@
1
+ import type { HoistException, TimeoutException, TimeoutExceptionConfig } from './Types';
2
+ /**
3
+ * Standardized Exception/Error objects.
4
+ *
5
+ * The main entry point for this class is the create() method.
6
+ * Applications can use this method to create various generic runtime exceptions.
7
+ * @see ExceptionHandler.handleException
8
+ */
9
+ export declare class Exception {
10
+ /**
11
+ * Create and return a HoistException
12
+ *
13
+ * See {@link XH.exception} - an alias for this factory off of `XH`.
14
+ *
15
+ * @param src - If a native JS Error, it will be enhanced into a HoistException and returned.
16
+ * If a plain object, all properties will be set on a new HoistException.
17
+ * Other inputs will be treated as the `message` of a new HoistException.
18
+ */
19
+ static create(src: unknown): HoistException;
20
+ /** Create an Error for when an operation (e.g. a Promise) times out. */
21
+ static timeout(config: TimeoutExceptionConfig): TimeoutException;
22
+ private static createInternal;
23
+ }
24
+ export declare function isHoistException(src: unknown): src is HoistException;
@@ -1,5 +1,4 @@
1
- import { PlainObject } from '@xh/hoist/core';
2
- import { FetchOptions } from '@xh/hoist/svc';
1
+ import type { PlainObject } from '@xh/hoist/core';
3
2
  /**
4
3
  * A Hoist optimized Javascript Error object.
5
4
  */
@@ -26,22 +25,6 @@ export interface TimeoutException extends HoistException {
26
25
  /** Time in Milliseconds that was waited before exception was thrown. */
27
26
  interval: number;
28
27
  }
29
- /**
30
- * Exception thrown to indicate an HTTP error resulting from a call to FetchService.
31
- */
32
- export interface FetchException extends HoistException {
33
- /** Http Status code associated with exception. 0 if no response received. */
34
- httpStatus: number;
35
- /** Rich object or string containing details about the exception as sent by server. */
36
- serverDetails: string | PlainObject;
37
- /** Options of underlying fetch call. */
38
- fetchOptions: FetchOptions;
39
- /**
40
- * True if exception resulted from the fetch being aborted by fetchService, or the application.
41
- * @see FetchService.abort and FetchOptions.autoAbortKey.
42
- */
43
- isFetchAborted: boolean;
44
- }
45
28
  /**
46
29
  * Configuration for generating a timeout exception.
47
30
  *
@@ -0,0 +1,2 @@
1
+ export * from './Types';
2
+ export * from './Exception';
@@ -2,7 +2,7 @@ import { Swiper, SwiperSlide } from 'swiper/react';
2
2
  import { EffectCreative } from 'swiper/modules';
3
3
  import './styles.scss';
4
4
  export { Swiper, SwiperSlide, EffectCreative };
5
- export declare const swiper: import("@xh/hoist/core").ElementFactory<import("react").RefAttributes<import("swiper/react").SwiperRef> & Omit<import("react").HTMLAttributes<HTMLElement>, "onClick" | "onKeyPress" | "onProgress" | "onDoubleClick" | "onTouchEnd" | "onTouchMove" | "onTouchStart" | "onScroll" | "onTransitionEnd" | "onResize"> & import("swiper/types").SwiperOptions & {
5
+ export declare const swiper: import("@xh/hoist/core").ElementFactory<import("react").RefAttributes<import("swiper/react").SwiperRef> & Omit<import("react").HTMLAttributes<HTMLElement>, "onKeyPress" | "onProgress" | "onClick" | "onDoubleClick" | "onTouchEnd" | "onTouchMove" | "onTouchStart" | "onScroll" | "onTransitionEnd" | "onResize"> & import("swiper/types").SwiperOptions & {
6
6
  tag?: string;
7
7
  wrapperTag?: string;
8
8
  onSwiper?: (swiper: import("swiper/react").SwiperClass) => void;
@@ -1,4 +1,5 @@
1
1
  import { Awaitable, HoistService, LoadSpec, PlainObject, TrackOptions } from '@xh/hoist/core';
2
+ import { HoistException } from '@xh/hoist/exception';
2
3
  import { PromiseTimeoutSpec } from '@xh/hoist/promise';
3
4
  import { StatusCodes } from 'http-status-codes';
4
5
  import { IStringifyOptions } from 'qs';
@@ -124,6 +125,44 @@ export declare class FetchService extends HoistService {
124
125
  private parseJsonAsync;
125
126
  private safeResponseTextAsync;
126
127
  private qsFilterFn;
128
+ /**
129
+ * Create an Error to throw when a fetch call returns a !ok response.
130
+ * @param fetchOptions - original options passed to FetchService.
131
+ * @param response - return value of native fetch.
132
+ * @param responseText - optional additional details from the server.
133
+ */
134
+ private exceptionFromResponse;
135
+ /**
136
+ * Create an Error to throw when a fetchJson call encounters a SyntaxError.
137
+ * @param fetchOptions - original options passed to FetchService.
138
+ * @param cause - object thrown by native {@link response.json}.
139
+ */
140
+ private jsonParseException;
141
+ /**
142
+ * Create an Error to throw when a fetch call is aborted.
143
+ * @param fetchOptions - original options passed to FetchService.
144
+ * @param cause - object thrown by native fetch
145
+ */
146
+ private abortedException;
147
+ /**
148
+ * Create an Error to throw when a fetch call times out.
149
+ * @param fetchOptions - original options the app passed when calling FetchService.
150
+ * @param cause - underlying timeout exception
151
+ * @param message - optional custom message
152
+ *
153
+ * @returns an exception that is both a TimeoutException, and a FetchException, with the
154
+ * underlying TimeoutException as its cause.
155
+ */
156
+ private timeoutException;
157
+ /**
158
+ * Create an Error for when the server called by fetch does not respond
159
+ * @param fetchOptions - original options the app passed to FetchService.fetch
160
+ * @param cause - object thrown by native fetch
161
+ */
162
+ private serverUnavailableException;
163
+ private createException;
164
+ private safeParseJson;
165
+ private extractMessage;
127
166
  }
128
167
  /** Headers to be applied to all requests. Specified as object, or dynamic function to create. */
129
168
  export type DefaultHeaders = PlainObject | ((opts: FetchOptions) => Awaitable<PlainObject>);
@@ -198,3 +237,19 @@ export interface FetchOptions {
198
237
  */
199
238
  track?: string | TrackOptions;
200
239
  }
240
+ /**
241
+ * Exception thrown to indicate an HTTP error resulting from a call to FetchService.
242
+ */
243
+ export interface FetchException extends HoistException {
244
+ /** Http Status code associated with exception. 0 if no response received. */
245
+ httpStatus: number;
246
+ /** Rich object or string containing details about the exception as sent by server. */
247
+ serverDetails: string | PlainObject;
248
+ /** Options of underlying fetch call. */
249
+ fetchOptions: FetchOptions;
250
+ /**
251
+ * True if exception resulted from the fetch being aborted by fetchService, or the application.
252
+ * @see FetchService.abort and FetchOptions.autoAbortKey.
253
+ */
254
+ isFetchAborted: boolean;
255
+ }
@@ -1,4 +1,4 @@
1
- import type { Thunkable, LogSource } from '@xh/hoist/core';
1
+ import type { Thunkable } from '@xh/hoist/core';
2
2
  /**
3
3
  * Get a cached value on an object, creating it if it does not yet exist.
4
4
  *
@@ -36,14 +36,6 @@ export declare function isJSON(obj: any): boolean;
36
36
  * Throw an exception if a condition evaluates as truthy.
37
37
  */
38
38
  export declare function throwIf(condition: any, message: unknown): void;
39
- /**
40
- * Log a warning to the console if a condition evaluates as truthy.
41
- */
42
- export declare function warnIf(condition: any, message: any): void;
43
- /**
44
- * Log an error to the console if a condition evaluates as truthy.
45
- */
46
- export declare function errorIf(condition: any, message: any): void;
47
39
  /**
48
40
  * Instantiate a singleton object of a class, and place a reference to the created
49
41
  * object in a static property on the class.
@@ -54,24 +46,6 @@ export declare function errorIf(condition: any, message: any): void;
54
46
  * @param clazz -- Class (i.e. Constructor) of singleton object to be created.
55
47
  */
56
48
  export declare function createSingleton<T>(clazz: new () => T): T;
57
- export interface APIWarnOptions {
58
- /**
59
- * If provided and undefined, this method will be a no-op.
60
- * Useful for testing if a parameter has been provided in caller.
61
- */
62
- test?: any;
63
- /** Version when this API will no longer be supported or this warning should be removed. */
64
- v?: string;
65
- /** An additional message. Can contain suggestions for alternatives. */
66
- msg?: string;
67
- /** Source of message for labeling log message. */
68
- source?: LogSource;
69
- }
70
- /**
71
- * Document and prevent usage of a removed parameter.
72
- */
73
- export declare function apiRemoved(name: string, opts?: APIWarnOptions): void;
74
- export declare function apiDeprecated(name: string, opts?: APIWarnOptions): void;
75
49
  /**
76
50
  * Throw an exception if the provided object or collection is empty, as per lodash isEmpty().
77
51
  *
@@ -1,4 +1,4 @@
1
- import type { Some, LogLevel, LogSource } from '@xh/hoist/core';
1
+ import type { Some } from '@xh/hoist/core';
2
2
  /**
3
3
  * Utility functions providing managed, structured logging to Hoist apps.
4
4
  *
@@ -12,6 +12,29 @@ import type { Some, LogLevel, LogSource } from '@xh/hoist/core';
12
12
  * memory impacts that might result from verbose debug logging. This can be adjusted by calling
13
13
  * XH.logLevel from the console.
14
14
  */
15
+ /** Severity Level for log statement */
16
+ export type LogLevel = 'error' | 'warn' | 'info' | 'debug';
17
+ /** Object identifying the source of log statement. Typically, a javascript class */
18
+ export type LogSource = string | {
19
+ displayName: string;
20
+ } | {
21
+ constructor: {
22
+ name: string;
23
+ };
24
+ };
25
+ export interface APIWarnOptions {
26
+ /**
27
+ * If provided and undefined, this method will be a no-op.
28
+ * Useful for testing if a parameter has been provided in caller.
29
+ */
30
+ test?: any;
31
+ /** Version when this API will no longer be supported or this warning should be removed. */
32
+ v?: string;
33
+ /** An additional message. Can contain suggestions for alternatives. */
34
+ msg?: string;
35
+ /** Source of message for labelling log message. */
36
+ source?: LogSource;
37
+ }
15
38
  /**
16
39
  * Current minimum severity for Hoist log utils (default 'info').
17
40
  * Messages logged via managed Hoist log utils with lower severity will be ignored.
@@ -70,3 +93,16 @@ export declare function logError(msgs: Some<unknown>, source?: LogSource): unkno
70
93
  * @param source - class, function or string to label the source of the message
71
94
  */
72
95
  export declare function logWarn(msgs: Some<unknown>, source?: LogSource): unknown;
96
+ /**
97
+ * Log a warning to the console if a condition evaluates as truthy.
98
+ */
99
+ export declare function warnIf(condition: any, message: any): void;
100
+ /**
101
+ * Log an error to the console if a condition evaluates as truthy.
102
+ */
103
+ export declare function errorIf(condition: any, message: any): void;
104
+ /**
105
+ * Document and prevent usage of a removed parameter.
106
+ */
107
+ export declare function apiRemoved(name: string, opts?: APIWarnOptions): void;
108
+ export declare function apiDeprecated(name: string, opts?: APIWarnOptions): void;
@@ -1,5 +1,7 @@
1
1
  export * from './HtmlUtils';
2
2
  export * from './LangUtils';
3
3
  export * from './Decorators';
4
+ export * from './LogUtils';
4
5
  export * from './DomUtils';
5
6
  export * from './TestUtils';
7
+ export * from './VersionUtils';
@@ -18,7 +18,7 @@ import {
18
18
  XH
19
19
  } from '@xh/hoist/core';
20
20
  import {AgGridReact, GridOptions} from '@xh/hoist/kit/ag-grid';
21
- import {logError} from '@xh/hoist/utils/log';
21
+ import {logError} from '@xh/hoist/utils/js';
22
22
  import {splitLayoutProps} from '@xh/hoist/utils/react';
23
23
  import classNames from 'classnames';
24
24
  import {isNil} from 'lodash';
@@ -21,8 +21,7 @@ import {
21
21
  import {useContextMenu} from '@xh/hoist/dynamics/desktop';
22
22
  import {Highcharts} from '@xh/hoist/kit/highcharts';
23
23
  import {runInAction} from '@xh/hoist/mobx';
24
- import {mergeDeep} from '@xh/hoist/utils/js';
25
- import {logError} from '@xh/hoist/utils/log';
24
+ import {logError, mergeDeep} from '@xh/hoist/utils/js';
26
25
  import {
27
26
  createObservableRef,
28
27
  getLayoutProps,
@@ -5,7 +5,7 @@
5
5
  * Copyright © 2025 Extremely Heavy Industries Inc.
6
6
  */
7
7
  import type {ChartMenuContext, ChartMenuToken} from '@xh/hoist/cmp/chart/Types';
8
- import {logWarn} from '@xh/hoist/utils/log';
8
+ import {logWarn} from '@xh/hoist/utils/js';
9
9
  import {cloneDeep, isEmpty, isString} from 'lodash';
10
10
  import {ChartModel} from '@xh/hoist/cmp/chart';
11
11
  import {isMenuItem, type MenuItem, type MenuItemLike} from '@xh/hoist/core';
@@ -15,8 +15,7 @@ import {
15
15
  RecordActionSpec,
16
16
  StoreRecord
17
17
  } from '@xh/hoist/data';
18
- import {logDebug, logWarn} from '@xh/hoist/utils/log';
19
- import {throwIf, warnIf, withDefault} from '@xh/hoist/utils/js';
18
+ import {logDebug, logWarn, throwIf, warnIf, withDefault} from '@xh/hoist/utils/js';
20
19
  import classNames from 'classnames';
21
20
  import {
22
21
  castArray,
@@ -7,8 +7,7 @@
7
7
  import {box} from '@xh/hoist/cmp/layout';
8
8
  import {BoxProps, hoistCmp, HoistProps, useContextModel} from '@xh/hoist/core';
9
9
  import {fmtNumber} from '@xh/hoist/format';
10
- import {pluralize, singularize, withDefault} from '@xh/hoist/utils/js';
11
- import {logError} from '@xh/hoist/utils/log';
10
+ import {logError, pluralize, singularize, withDefault} from '@xh/hoist/utils/js';
12
11
  import {GridModel} from '../GridModel';
13
12
 
14
13
  export interface GridCountLabelProps extends HoistProps, BoxProps {
@@ -9,8 +9,7 @@ import {GridAutosizeOptions} from '@xh/hoist/cmp/grid/GridAutosizeOptions';
9
9
  import {XH} from '@xh/hoist/core';
10
10
  import {CompoundFilter, FieldFilter, Filter, StoreRecord} from '@xh/hoist/data';
11
11
  import {forEachAsync} from '@xh/hoist/utils/async';
12
- import {logWarn} from '@xh/hoist/utils/log';
13
- import {stripTags} from '@xh/hoist/utils/js';
12
+ import {logWarn, stripTags} from '@xh/hoist/utils/js';
14
13
  import {
15
14
  forOwn,
16
15
  groupBy,
@@ -6,7 +6,7 @@
6
6
  */
7
7
  import {Column, ColumnGroup, ColumnRenderer, GroupRowRenderer} from '@xh/hoist/cmp/grid';
8
8
  import {HeaderClassParams} from '@xh/hoist/kit/ag-grid';
9
- import {logWarn} from '@xh/hoist/utils/log';
9
+ import {logWarn} from '@xh/hoist/utils/js';
10
10
  import {castArray, isFunction} from 'lodash';
11
11
 
12
12
  /** @internal */
@@ -21,8 +21,7 @@ import {fmtCompactDate, fmtDateTime} from '@xh/hoist/format';
21
21
  import {action, computed, makeObservable, observable} from '@xh/hoist/mobx';
22
22
  import {Timer} from '@xh/hoist/utils/async';
23
23
  import {DAYS, HOURS, LocalDate, SECONDS} from '@xh/hoist/utils/datetime';
24
- import {logWarn} from '@xh/hoist/utils/log';
25
- import {apiDeprecated, withDefault} from '@xh/hoist/utils/js';
24
+ import {apiDeprecated, logWarn, withDefault} from '@xh/hoist/utils/js';
26
25
 
27
26
  interface RelativeTimestampProps extends HoistProps, BoxProps, RelativeTimestampOptions {
28
27
  /**
@@ -21,8 +21,7 @@ import {errorMessage} from '@xh/hoist/cmp/error';
21
21
  import {mask} from '@xh/hoist/cmp/mask';
22
22
  import {Highcharts} from '@xh/hoist/kit/highcharts';
23
23
  import {wait} from '@xh/hoist/promise';
24
- import {logWithDebug} from '@xh/hoist/utils/js';
25
- import {logError} from '@xh/hoist/utils/log';
24
+ import {logError, logWithDebug} from '@xh/hoist/utils/js';
26
25
  import {
27
26
  createObservableRef,
28
27
  getLayoutProps,
@@ -4,13 +4,12 @@
4
4
  *
5
5
  * Copyright © 2025 Extremely Heavy Industries Inc.
6
6
  */
7
- import {Exception} from './Exception';
7
+ import {Exception, HoistException} from '../exception';
8
8
  import {fragment, span} from '@xh/hoist/cmp/layout';
9
- import {stripTags} from '@xh/hoist/utils/js';
10
- import {logDebug, logError, logWarn} from '@xh/hoist/utils/log';
9
+ import {logDebug, logError, logWarn, stripTags} from '@xh/hoist/utils/js';
11
10
  import {Icon} from '@xh/hoist/icon';
12
11
  import {forOwn, has, isArray, isNil, isObject, omitBy, pick, set} from 'lodash';
13
- import {HoistException, PlainObject, XH} from '../';
12
+ import {PlainObject, XH} from './';
14
13
 
15
14
  export interface ExceptionHandlerOptions {
16
15
  /** Text (ideally user-friendly) describing the error. */
package/core/HoistBase.ts CHANGED
@@ -13,15 +13,16 @@ import {
13
13
  runInAction,
14
14
  when as mobxWhen
15
15
  } from '@xh/hoist/mobx';
16
- import {getOrCreate, throwIf} from '@xh/hoist/utils/js';
17
16
  import {
17
+ getOrCreate,
18
18
  logDebug,
19
19
  logError,
20
20
  logInfo,
21
21
  logWarn,
22
+ throwIf,
22
23
  withDebug,
23
24
  withInfo
24
- } from '@xh/hoist/utils/log/LogUtils';
25
+ } from '@xh/hoist/utils/js';
25
26
  import {
26
27
  debounce as lodashDebounce,
27
28
  isFunction,