@xh/hoist 71.0.0-SNAPSHOT.1735657683714 → 71.0.0-SNAPSHOT.1735673121607

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/CHANGELOG.md CHANGED
@@ -32,6 +32,8 @@
32
32
  ID and access tokens in a single request and to use refresh tokens to maintain access without
33
33
  relying on third-party cookies.
34
34
  * Updated sorting on grouped grids to place ungrouped items at the bottom.
35
+ * `DashCanvas` views can now be resized left and up in addition to right and down.
36
+ * `FetchService.autoGenCorrelationIds` now supports a functional form for per-request behavior.
35
37
 
36
38
  ### 🐞 Bug Fixes
37
39
 
@@ -49,7 +49,7 @@ export declare abstract class HoistModel extends HoistBase implements Loadable {
49
49
  config: unknown;
50
50
  static get isHoistModel(): boolean;
51
51
  get isHoistModel(): boolean;
52
- _componentProps: {};
52
+ _componentProps: any;
53
53
  _modelLookup: any;
54
54
  _created: number;
55
55
  constructor();
@@ -9,8 +9,8 @@ import { IStringifyOptions } from 'qs';
9
9
  * the most common use-cases. The Fetch API will be called with CORS enabled, credentials
10
10
  * included, and redirects followed.
11
11
  *
12
- * Set {@link autoGenCorrelationIds} to true on this service to enable auto-generation of UUID
13
- * Correlation IDs for all requests issued by this service. Can also be set on a per-request basis
12
+ * Set {@link autoGenCorrelationIds} on this service to enable auto-generation of UUID
13
+ * Correlation IDs for requests issued by this service. Can also be set on a per-request basis
14
14
  * via {@link FetchOptions.correlationId}.
15
15
  *
16
16
  * Custom headers can be set on a request via {@link FetchOptions.headers}. Default headers for all
@@ -28,8 +28,11 @@ export declare class FetchService extends HoistService {
28
28
  private autoAborters;
29
29
  private _defaultHeaders;
30
30
  private _interceptors;
31
- /** True to auto-generate a Correlation ID for each request unless otherwise specified. */
32
- autoGenCorrelationIds: boolean;
31
+ /**
32
+ * Should hoist auto-generate a Correlation ID for a request when not otherwise specified?
33
+ * Set to `true` or a dynamic per-request function to enable. Default false.
34
+ */
35
+ autoGenCorrelationIds: boolean | ((opts: FetchOptions) => boolean);
33
36
  /**
34
37
  * Method for generating Correlation ID's. Defaults to a 16 character random string with
35
38
  * an extremely low probability of collisions. Applications may customize
@@ -4,9 +4,9 @@
4
4
  *
5
5
  * Copyright © 2025 Extremely Heavy Industries Inc.
6
6
  */
7
- import {action, makeObservable, observable} from '@xh/hoist/mobx';
7
+ import {action, computed, comparer, makeObservable, observable} from '@xh/hoist/mobx';
8
8
  import {warnIf} from '@xh/hoist/utils/js';
9
- import {forOwn, has, isFunction} from 'lodash';
9
+ import {isFunction} from 'lodash';
10
10
  import {DefaultHoistProps, HoistBase, LoadSpecConfig, managed, PlainObject} from '../';
11
11
  import {instanceManager} from '../impl/InstanceManager';
12
12
  import {Loadable, LoadSpec, LoadSupport} from '../load';
@@ -67,8 +67,7 @@ export abstract class HoistModel extends HoistBase implements Loadable {
67
67
  }
68
68
 
69
69
  // Internal State
70
- @observable
71
- _componentProps = {};
70
+ @observable.ref _componentProps = null;
72
71
  _modelLookup = null;
73
72
  _created = Date.now();
74
73
 
@@ -136,6 +135,7 @@ export abstract class HoistModel extends HoistBase implements Loadable {
136
135
  * Observability is based on a shallow computation for each prop (i.e. a reference
137
136
  * change in any particular prop will trigger observers to be notified).
138
137
  */
138
+ @computed({equals: comparer.shallow})
139
139
  get componentProps(): DefaultHoistProps {
140
140
  return this._componentProps;
141
141
  }
@@ -187,13 +187,7 @@ export abstract class HoistModel extends HoistBase implements Loadable {
187
187
  /** @internal */
188
188
  @action
189
189
  setComponentProps(newProps) {
190
- const props = this._componentProps;
191
- Object.assign(props, newProps);
192
- forOwn(props, (v, k) => {
193
- if (!has(newProps, k)) {
194
- delete props[k];
195
- }
196
- });
190
+ this._componentProps = newProps;
197
191
  }
198
192
 
199
193
  /** @internal */
@@ -1,3 +1,32 @@
1
+ @mixin resize-handle-ew {
2
+ height: 100%;
3
+ top: 0;
4
+ transform: rotate(0);
5
+ width: 8px;
6
+ }
7
+
8
+ @mixin resize-handle-ns {
9
+ height: 8px;
10
+ left: 0;
11
+ transform: rotate(0);
12
+ width: 100%;
13
+ }
14
+
15
+ @mixin resize-handle-corner {
16
+ height: 16px;
17
+ width: 16px;
18
+ }
19
+
20
+ @mixin resize-handle-se-sw {
21
+ @include resize-handle-corner;
22
+ bottom: -8px;
23
+ }
24
+
25
+ @mixin resize-handle-ne-nw {
26
+ @include resize-handle-corner;
27
+ top: -8px;
28
+ }
29
+
1
30
  .xh-dash-canvas {
2
31
  width: 100%;
3
32
  height: 100%;
@@ -21,27 +50,44 @@
21
50
 
22
51
  > .react-resizable-handle {
23
52
  // Make the resize handles fill the entire side
53
+ &.react-resizable-handle-n {
54
+ @include resize-handle-ns;
55
+ top: -4px;
56
+ }
57
+
24
58
  &.react-resizable-handle-s {
59
+ @include resize-handle-ns;
25
60
  bottom: -4px;
26
- height: 8px;
27
- left: 0;
28
- transform: rotate(0);
29
- width: 100%;
30
61
  }
31
62
 
32
63
  &.react-resizable-handle-e {
33
- height: 100%;
64
+ @include resize-handle-ew;
34
65
  right: -4px;
35
- top: 0;
36
- transform: rotate(0);
37
- width: 8px;
66
+ }
67
+
68
+ &.react-resizable-handle-w {
69
+ @include resize-handle-ew;
70
+ left: -4px;
71
+ }
72
+
73
+ &.react-resizable-handle-ne {
74
+ @include resize-handle-ne-nw;
75
+ right: -8px;
76
+ }
77
+
78
+ &.react-resizable-handle-nw {
79
+ @include resize-handle-ne-nw;
80
+ left: -8px;
38
81
  }
39
82
 
40
83
  &.react-resizable-handle-se {
41
- bottom: -8px;
42
- height: 16px;
84
+ @include resize-handle-se-sw;
43
85
  right: -8px;
44
- width: 16px;
86
+ }
87
+
88
+ &.react-resizable-handle-sw {
89
+ @include resize-handle-se-sw;
90
+ left: -8px;
45
91
  }
46
92
 
47
93
  // Hide the resize handles
@@ -112,7 +112,9 @@ export class DashCanvasModel
112
112
 
113
113
  return {
114
114
  ...it,
115
- resizeHandles: autoHeight ? ['e'] : ['e', 's', 'se'],
115
+ resizeHandles: autoHeight
116
+ ? ['w', 'e']
117
+ : ['s', 'w', 'e', 'n', 'sw', 'nw', 'se', 'ne'],
116
118
  maxH: viewSpec.maxHeight,
117
119
  minH: viewSpec.minHeight,
118
120
  maxW: viewSpec.maxWidth,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xh/hoist",
3
- "version": "71.0.0-SNAPSHOT.1735657683714",
3
+ "version": "71.0.0-SNAPSHOT.1735673121607",
4
4
  "description": "Hoist add-on for building and deploying React Applications.",
5
5
  "repository": "github:xh/hoist-react",
6
6
  "homepage": "https://xh.io",
@@ -28,8 +28,8 @@ import ShortUniqueId from 'short-unique-id';
28
28
  * the most common use-cases. The Fetch API will be called with CORS enabled, credentials
29
29
  * included, and redirects followed.
30
30
  *
31
- * Set {@link autoGenCorrelationIds} to true on this service to enable auto-generation of UUID
32
- * Correlation IDs for all requests issued by this service. Can also be set on a per-request basis
31
+ * Set {@link autoGenCorrelationIds} on this service to enable auto-generation of UUID
32
+ * Correlation IDs for requests issued by this service. Can also be set on a per-request basis
33
33
  * via {@link FetchOptions.correlationId}.
34
34
  *
35
35
  * Custom headers can be set on a request via {@link FetchOptions.headers}. Default headers for all
@@ -52,8 +52,11 @@ export class FetchService extends HoistService {
52
52
  //-----------------------------------
53
53
  // Public properties, Getters/Setters
54
54
  //------------------------------------
55
- /** True to auto-generate a Correlation ID for each request unless otherwise specified. */
56
- autoGenCorrelationIds = false;
55
+ /**
56
+ * Should hoist auto-generate a Correlation ID for a request when not otherwise specified?
57
+ * Set to `true` or a dynamic per-request function to enable. Default false.
58
+ */
59
+ autoGenCorrelationIds: boolean | ((opts: FetchOptions) => boolean) = false;
57
60
 
58
61
  /**
59
62
  * Method for generating Correlation ID's. Defaults to a 16 character random string with
@@ -253,10 +256,12 @@ export class FetchService extends HoistService {
253
256
 
254
257
  // Resolve convenience options for Correlation ID to server-ready string
255
258
  private withCorrelationId(opts: FetchOptions): FetchOptions {
256
- const {correlationId} = opts;
257
- if (isString(correlationId)) return opts;
258
- if (correlationId === false || correlationId === null) return omit(opts, 'correlationId');
259
- if (correlationId === true || this.autoGenCorrelationIds) {
259
+ const cid = opts.correlationId,
260
+ autoCid = this.autoGenCorrelationIds;
261
+
262
+ if (isString(cid)) return opts;
263
+ if (cid === false || cid === null) return omit(opts, 'correlationId');
264
+ if (cid === true || autoCid === true || (isFunction(autoCid) && autoCid(opts))) {
260
265
  return {...opts, correlationId: this.genCorrelationId()};
261
266
  }
262
267
  return opts;