@xh/hoist 71.0.0-SNAPSHOT.1734551243081 → 71.0.0-SNAPSHOT.1734552619121

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.
@@ -2,7 +2,7 @@ import { HoistModel, LoadSpec, PersistOptions, PlainObject, TaskObserver, Thunka
2
2
  import type { ViewManagerProvider } from '@xh/hoist/core';
3
3
  import { ViewInfo } from './ViewInfo';
4
4
  import { View } from './View';
5
- import { ViewToBlobApi, ViewCreateSpec } from './ViewToBlobApi';
5
+ import { ViewCreateSpec, ViewUpdateSpec } from './ViewToBlobApi';
6
6
  export interface ViewManagerConfig {
7
7
  /**
8
8
  * True (default) to allow user to opt in to automatically saving changes to their current view.
@@ -143,11 +143,9 @@ export declare class ViewManagerModel<T = PlainObject> extends HoistModel {
143
143
  * @internal
144
144
  */
145
145
  providers: ViewManagerProvider<any>[];
146
- /**
147
- * Data access for persisting views.
148
- * @internal
149
- */
150
- api: ViewToBlobApi<T>;
146
+ /** Data access for persisting views. */
147
+ private api;
148
+ /** Last time changes were pushed to linked persistence providers */
151
149
  private lastPushed;
152
150
  get isValueDirty(): boolean;
153
151
  get isViewSavable(): boolean;
@@ -179,6 +177,10 @@ export declare class ViewManagerModel<T = PlainObject> extends HoistModel {
179
177
  userUnpin(view: ViewInfo): void;
180
178
  isUserPinned(view: ViewInfo): boolean | null;
181
179
  validateViewNameAsync(name: string, existing?: ViewInfo): Promise<string>;
180
+ /** Update all aspects of a view's metadata.*/
181
+ updateViewInfoAsync(view: ViewInfo, updates: ViewUpdateSpec): Promise<View<T>>;
182
+ /** Promote a view to global visibility/ownership status. */
183
+ makeViewGlobalAsync(view: ViewInfo): Promise<View<T>>;
182
184
  deleteViewsAsync(toDelete: ViewInfo[]): Promise<void>;
183
185
  private initAsync;
184
186
  private loadViewAsync;
@@ -29,7 +29,7 @@ import {runInAction} from 'mobx';
29
29
  import {ReactNode} from 'react';
30
30
  import {ViewInfo} from './ViewInfo';
31
31
  import {View} from './View';
32
- import {ViewToBlobApi, ViewCreateSpec} from './ViewToBlobApi';
32
+ import {ViewToBlobApi, ViewCreateSpec, ViewUpdateSpec} from './ViewToBlobApi';
33
33
 
34
34
  export interface ViewManagerConfig {
35
35
  /**
@@ -201,13 +201,10 @@ export class ViewManagerModel<T = PlainObject> extends HoistModel {
201
201
  */
202
202
  providers: ViewManagerProvider<any>[] = [];
203
203
 
204
- /**
205
- * Data access for persisting views.
206
- * @internal
207
- */
208
- api: ViewToBlobApi<T>;
204
+ /** Data access for persisting views. */
205
+ private api: ViewToBlobApi<T>;
209
206
 
210
- // Last time changes were pushed to linked persistence providers
207
+ /** Last time changes were pushed to linked persistence providers */
211
208
  private lastPushed: number = null;
212
209
 
213
210
  //---------------
@@ -442,6 +439,16 @@ export class ViewManagerModel<T = PlainObject> extends HoistModel {
442
439
  return null;
443
440
  }
444
441
 
442
+ /** Update all aspects of a view's metadata.*/
443
+ async updateViewInfoAsync(view: ViewInfo, updates: ViewUpdateSpec): Promise<View<T>> {
444
+ return this.api.updateViewInfoAsync(view, updates);
445
+ }
446
+
447
+ /** Promote a view to global visibility/ownership status. */
448
+ async makeViewGlobalAsync(view: ViewInfo): Promise<View<T>> {
449
+ return this.api.makeViewGlobalAsync(view);
450
+ }
451
+
445
452
  async deleteViewsAsync(toDelete: ViewInfo[]): Promise<void> {
446
453
  let exception;
447
454
  try {
@@ -173,7 +173,7 @@ export class ManageDialogModel extends HoistModel {
173
173
 
174
174
  private async doUpdateAsync(view: ViewInfo, update: ViewUpdateSpec) {
175
175
  const {viewManagerModel} = this;
176
- await viewManagerModel.api.updateViewInfoAsync(view, update);
176
+ await viewManagerModel.updateViewInfoAsync(view, update);
177
177
  await viewManagerModel.refreshAsync();
178
178
  await this.refreshAsync();
179
179
  }
@@ -235,7 +235,7 @@ export class ManageDialogModel extends HoistModel {
235
235
  if (!confirmed) return;
236
236
 
237
237
  const {viewManagerModel} = this;
238
- const updated = await viewManagerModel.api.makeViewGlobalAsync(view);
238
+ const updated = await viewManagerModel.makeViewGlobalAsync(view);
239
239
  await viewManagerModel.refreshAsync();
240
240
  await this.refreshAsync();
241
241
  await this.selectViewAsync(updated.info); // reselect -- will have moved tabs!
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xh/hoist",
3
- "version": "71.0.0-SNAPSHOT.1734551243081",
3
+ "version": "71.0.0-SNAPSHOT.1734552619121",
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",