@xh/hoist 73.0.0-SNAPSHOT.1744145524716 → 73.0.0-SNAPSHOT.1744145928224

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
@@ -2,11 +2,6 @@
2
2
 
3
3
  ## v73.0.0-SNAPSHOT - unreleased
4
4
 
5
- ### 🎁 New Features
6
-
7
- `ViewManagerConfig` takes new optional key `customViewMenuItem` to allow ViewManagers implementations to customize
8
- the menu items for views in the view manager menu.
9
-
10
5
  ## v72.3.0 - 2025-04-08
11
6
 
12
7
  ### 🎁 New Features
@@ -1,6 +1,5 @@
1
1
  import { HoistModel, LoadSpec, PlainObject, TaskObserver, Thunkable } from '@xh/hoist/core';
2
2
  import type { ViewManagerProvider } from '@xh/hoist/core';
3
- import { ReactNode } from 'react';
4
3
  import { ViewInfo } from './ViewInfo';
5
4
  import { View } from './View';
6
5
  export interface ViewCreateSpec {
@@ -86,11 +85,6 @@ export interface ViewManagerConfig {
86
85
  * Optional user-facing display name for describing global views. Defaults to 'global'
87
86
  */
88
87
  globalDisplayName?: string;
89
- /**
90
- * Optional key to pass a method that returns customized BlueprintJS `menuItem` for listing
91
- * views in the ViewManager menu.
92
- */
93
- customViewMenuItem?: (view: ViewInfo, model: ViewManagerModel) => ReactNode;
94
88
  }
95
89
  /**
96
90
  * ViewManagerModel coordinates the loading, saving, and management of user-defined bundles of
@@ -127,7 +121,6 @@ export declare class ViewManagerModel<T = PlainObject> extends HoistModel {
127
121
  readonly instance: string;
128
122
  readonly typeDisplayName: string;
129
123
  readonly globalDisplayName: string;
130
- readonly customViewMenuItem: (view: ViewInfo, model: ViewManagerModel) => ReactNode;
131
124
  readonly enableAutoSave: boolean;
132
125
  readonly enableDefault: boolean;
133
126
  readonly enableGlobal: boolean;
@@ -123,12 +123,6 @@ export interface ViewManagerConfig {
123
123
  * Optional user-facing display name for describing global views. Defaults to 'global'
124
124
  */
125
125
  globalDisplayName?: string;
126
-
127
- /**
128
- * Optional key to pass a method that returns customized BlueprintJS `menuItem` for listing
129
- * views in the ViewManager menu.
130
- */
131
- customViewMenuItem?: (view: ViewInfo, model: ViewManagerModel) => ReactNode;
132
126
  }
133
127
 
134
128
  /**
@@ -171,7 +165,6 @@ export class ViewManagerModel<T = PlainObject> extends HoistModel {
171
165
  readonly instance: string;
172
166
  readonly typeDisplayName: string;
173
167
  readonly globalDisplayName: string;
174
- readonly customViewMenuItem: (view: ViewInfo, model: ViewManagerModel) => ReactNode;
175
168
  readonly enableAutoSave: boolean;
176
169
  readonly enableDefault: boolean;
177
170
  readonly enableGlobal: boolean;
@@ -290,7 +283,6 @@ export class ViewManagerModel<T = PlainObject> extends HoistModel {
290
283
  instance = 'default',
291
284
  typeDisplayName,
292
285
  globalDisplayName = 'global',
293
- customViewMenuItem,
294
286
  manageGlobal = false,
295
287
  enableAutoSave = true,
296
288
  enableDefault = true,
@@ -304,14 +296,13 @@ export class ViewManagerModel<T = PlainObject> extends HoistModel {
304
296
 
305
297
  throwIf(
306
298
  !enableDefault && !initialViewSpec,
307
- "ViewManagerModel requires 'initialViewSpec' if 'enableDefault' is false."
299
+ "ViewManagerModel requires 'initialViewSpec' if `enableDefault` is false."
308
300
  );
309
301
 
310
302
  this.type = type;
311
303
  this.instance = instance;
312
304
  this.typeDisplayName = lowerCase(typeDisplayName ?? genDisplayName(type));
313
305
  this.globalDisplayName = globalDisplayName;
314
- this.customViewMenuItem = customViewMenuItem;
315
306
  this.manageGlobal = executeIfFunction(manageGlobal) ?? false;
316
307
  this.enableDefault = enableDefault;
317
308
  this.enableGlobal = enableGlobal;
@@ -162,14 +162,12 @@ function viewMenuItem(view: ViewInfo, model: ViewManagerModel): ReactNode {
162
162
  if (!view.isOwned && view.owner) title.push(view.owner);
163
163
  if (view.description) title.push(view.description);
164
164
 
165
- return model.customViewMenuItem
166
- ? model.customViewMenuItem(view, model)
167
- : menuItem({
168
- className: 'xh-view-manager__menu-item',
169
- key: view.token,
170
- text: view.name,
171
- title: title.join(' | '),
172
- icon,
173
- onClick: () => model.selectViewAsync(view).catchDefault()
174
- });
165
+ return menuItem({
166
+ className: 'xh-view-manager__menu-item',
167
+ key: view.token,
168
+ text: view.name,
169
+ title: title.join(' | '),
170
+ icon,
171
+ onClick: () => model.selectViewAsync(view).catchDefault()
172
+ });
175
173
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xh/hoist",
3
- "version": "73.0.0-SNAPSHOT.1744145524716",
3
+ "version": "73.0.0-SNAPSHOT.1744145928224",
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",