@xh/hoist 73.0.0-SNAPSHOT.1744145292985 → 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 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,12 +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 used as route param for view tokens. Specify if you have customized your
91
- * ViewManager implementation to be routable, and you want users to be able to Ctrl+Click or
92
- * ContextMenu Click to open views from the view menu in new tabs or windows.
93
- */
94
- customViewMenuItem?: (view: ViewInfo) => ReactNode;
95
88
  }
96
89
  /**
97
90
  * ViewManagerModel coordinates the loading, saving, and management of user-defined bundles of
@@ -128,7 +121,6 @@ export declare class ViewManagerModel<T = PlainObject> extends HoistModel {
128
121
  readonly instance: string;
129
122
  readonly typeDisplayName: string;
130
123
  readonly globalDisplayName: string;
131
- readonly customViewMenuItem: (view: ViewInfo) => ReactNode;
132
124
  readonly enableAutoSave: boolean;
133
125
  readonly enableDefault: boolean;
134
126
  readonly enableGlobal: boolean;
@@ -123,13 +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 used as route param for view tokens. Specify if you have customized your
129
- * ViewManager implementation to be routable, and you want users to be able to Ctrl+Click or
130
- * ContextMenu Click to open views from the view menu in new tabs or windows.
131
- */
132
- customViewMenuItem?: (view: ViewInfo) => ReactNode;
133
126
  }
134
127
 
135
128
  /**
@@ -172,7 +165,6 @@ export class ViewManagerModel<T = PlainObject> extends HoistModel {
172
165
  readonly instance: string;
173
166
  readonly typeDisplayName: string;
174
167
  readonly globalDisplayName: string;
175
- readonly customViewMenuItem: (view: ViewInfo) => ReactNode;
176
168
  readonly enableAutoSave: boolean;
177
169
  readonly enableDefault: boolean;
178
170
  readonly enableGlobal: boolean;
@@ -291,7 +283,6 @@ export class ViewManagerModel<T = PlainObject> extends HoistModel {
291
283
  instance = 'default',
292
284
  typeDisplayName,
293
285
  globalDisplayName = 'global',
294
- customViewMenuItem,
295
286
  manageGlobal = false,
296
287
  enableAutoSave = true,
297
288
  enableDefault = true,
@@ -305,14 +296,13 @@ export class ViewManagerModel<T = PlainObject> extends HoistModel {
305
296
 
306
297
  throwIf(
307
298
  !enableDefault && !initialViewSpec,
308
- "ViewManagerModel requires 'initialViewSpec' if 'enableDefault' is false."
299
+ "ViewManagerModel requires 'initialViewSpec' if `enableDefault` is false."
309
300
  );
310
301
 
311
302
  this.type = type;
312
303
  this.instance = instance;
313
304
  this.typeDisplayName = lowerCase(typeDisplayName ?? genDisplayName(type));
314
305
  this.globalDisplayName = globalDisplayName;
315
- this.customViewMenuItem = customViewMenuItem;
316
306
  this.manageGlobal = executeIfFunction(manageGlobal) ?? false;
317
307
  this.enableDefault = enableDefault;
318
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)
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.1744145292985",
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",