@xh/hoist 73.0.0-SNAPSHOT.1744141996401 → 73.0.0-SNAPSHOT.1744142528681
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.
|
@@ -85,12 +85,6 @@ export interface ViewManagerConfig {
|
|
|
85
85
|
* Optional user-facing display name for describing global views. Defaults to 'global'
|
|
86
86
|
*/
|
|
87
87
|
globalDisplayName?: string;
|
|
88
|
-
/**
|
|
89
|
-
* Optional key used as route param for view tokens. Specify if you have customized your
|
|
90
|
-
* ViewManager implementation to be routable, and you want users to be able to Ctrl+Click or
|
|
91
|
-
* ContextMenu Click to open views from the view menu in new tabs or windows.
|
|
92
|
-
*/
|
|
93
|
-
viewRouteParam?: string;
|
|
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 viewRouteParam: string;
|
|
131
124
|
readonly enableAutoSave: boolean;
|
|
132
125
|
readonly enableDefault: boolean;
|
|
133
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
|
-
viewRouteParam?: string;
|
|
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 viewRouteParam: string;
|
|
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
|
-
viewRouteParam,
|
|
295
286
|
manageGlobal = false,
|
|
296
287
|
enableAutoSave = true,
|
|
297
288
|
enableDefault = true,
|
|
@@ -312,7 +303,6 @@ export class ViewManagerModel<T = PlainObject> extends HoistModel {
|
|
|
312
303
|
this.instance = instance;
|
|
313
304
|
this.typeDisplayName = lowerCase(typeDisplayName ?? genDisplayName(type));
|
|
314
305
|
this.globalDisplayName = globalDisplayName;
|
|
315
|
-
this.viewRouteParam = viewRouteParam;
|
|
316
306
|
this.manageGlobal = executeIfFunction(manageGlobal) ?? false;
|
|
317
307
|
this.enableDefault = enableDefault;
|
|
318
308
|
this.enableGlobal = enableGlobal;
|
|
@@ -5,12 +5,12 @@
|
|
|
5
5
|
* Copyright © 2025 Extremely Heavy Industries Inc.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import {hoistCmp
|
|
8
|
+
import {hoistCmp} from '@xh/hoist/core';
|
|
9
9
|
import {ViewManagerModel, ViewInfo} from '@xh/hoist/cmp/viewmanager';
|
|
10
10
|
import {switchInput} from '@xh/hoist/desktop/cmp/input';
|
|
11
11
|
import {Icon} from '@xh/hoist/icon';
|
|
12
12
|
import {menu, menuDivider, menuItem} from '@xh/hoist/kit/blueprint';
|
|
13
|
-
import {
|
|
13
|
+
import {pluralize} from '@xh/hoist/utils/js';
|
|
14
14
|
import {Dictionary} from 'express-serve-static-core';
|
|
15
15
|
import {each, filter, groupBy, isEmpty, orderBy, some, startCase} from 'lodash';
|
|
16
16
|
import {ReactNode} from 'react';
|
|
@@ -157,40 +157,17 @@ function getGroupedMenuItems(
|
|
|
157
157
|
|
|
158
158
|
function viewMenuItem(view: ViewInfo, model: ViewManagerModel): ReactNode {
|
|
159
159
|
const icon = view.isCurrentView ? Icon.check() : Icon.placeholder(),
|
|
160
|
-
title = []
|
|
161
|
-
usingRouting = XH.routerState && model.viewRouteParam;
|
|
160
|
+
title = [];
|
|
162
161
|
|
|
163
162
|
if (!view.isOwned && view.owner) title.push(view.owner);
|
|
164
163
|
if (view.description) title.push(view.description);
|
|
165
164
|
|
|
166
|
-
const href = usingRouting
|
|
167
|
-
? XH.router.buildUrl(XH.routerState.name, {
|
|
168
|
-
...XH.routerState.params,
|
|
169
|
-
[model.viewRouteParam]: view.token
|
|
170
|
-
})
|
|
171
|
-
: undefined;
|
|
172
|
-
|
|
173
165
|
return menuItem({
|
|
174
166
|
className: 'xh-view-manager__menu-item',
|
|
175
167
|
key: view.token,
|
|
176
168
|
text: view.name,
|
|
177
169
|
title: title.join(' | '),
|
|
178
170
|
icon,
|
|
179
|
-
|
|
180
|
-
onClick: e => {
|
|
181
|
-
if (!usingRouting || (e.button === 0 && !e.ctrlKey && !e.metaKey)) {
|
|
182
|
-
consumeEvent(e);
|
|
183
|
-
model.selectViewAsync(view).catchDefault();
|
|
184
|
-
return false;
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
if (e.button === 0) {
|
|
188
|
-
consumeEvent(e);
|
|
189
|
-
XH.navigate(href);
|
|
190
|
-
return false;
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
return true;
|
|
194
|
-
}
|
|
171
|
+
onClick: () => model.selectViewAsync(view).catchDefault()
|
|
195
172
|
});
|
|
196
173
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xh/hoist",
|
|
3
|
-
"version": "73.0.0-SNAPSHOT.
|
|
3
|
+
"version": "73.0.0-SNAPSHOT.1744142528681",
|
|
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",
|