@xh/hoist 77.0.0-SNAPSHOT.1759414848931 → 77.0.0-SNAPSHOT.1759849276739

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,13 +2,6 @@
2
2
 
3
3
  ## 77.0.0-SNAPSHOT - unreleased
4
4
 
5
- ### 🎁 New Features
6
-
7
- * `DashCanvasView` and `DashContainerView` components now have a public `@bindable` `titleDetails`
8
- property on their models to support displaying additional information in the title bar of these
9
- components. `titleDetails` is not persisted, and is expected to be set programmatically by the
10
- application as needed.
11
-
12
5
  ## 76.0.0 - 2025-09-26
13
6
 
14
7
  ### 💥 Breaking Changes (upgrade difficulty: 🟠 MEDIUM - AG Grid update, Hoist React upgrade)
@@ -9,7 +9,7 @@ import { Class } from 'type-fest';
9
9
  *
10
10
  * The most common use of `HoistModel` is to support Hoist components. Components can be configured
11
11
  * to create or lookup an instance of an appropriate model subclass using the `model` config passed
12
- * to {@link hoistComponent.factory}. Hoist will automatically pass the resolved model instance as a
12
+ * to {@link hoistCmp.factory}. Hoist will automatically pass the resolved model instance as a
13
13
  * prop to the component's `render()` function, where the model's properties can be read/rendered
14
14
  * and any imperative APIs wired to buttons, callbacks, and other handlers.
15
15
  *
@@ -1,6 +1,5 @@
1
1
  import { HoistModel, MenuItemLike, PlainObject, RefreshMode, RenderMode } from '@xh/hoist/core';
2
2
  import '@xh/hoist/desktop/register';
3
- import { IReactionDisposer } from 'mobx/dist/internal';
4
3
  import { ReactElement } from 'react';
5
4
  import { DashViewSpec } from './DashViewSpec';
6
5
  export type DashViewState = PlainObject;
@@ -24,16 +23,8 @@ export declare class DashViewModel<T extends DashViewSpec = DashViewSpec> extend
24
23
  * constructing these models - no need to specify manually.
25
24
  */
26
25
  containerModel: any;
27
- /** Title with which to initialize the view. Value is persisted. */
26
+ /** Title with which to initialize the view. */
28
27
  title: string;
29
- /**
30
- * Additional info that will be displayed after the title.
31
- * Applications can bind to this property to provide dynamic title details.
32
- * Value is not persisted.
33
- **/
34
- titleDetails: string;
35
- get fullTitle(): string;
36
- fullTitleReaction: IReactionDisposer;
37
28
  /** Icon with which to initialize the view. */
38
29
  icon: ReactElement;
39
30
  /** State with which to initialize the view. */
@@ -20,7 +20,7 @@ import {Class} from 'type-fest';
20
20
  *
21
21
  * The most common use of `HoistModel` is to support Hoist components. Components can be configured
22
22
  * to create or lookup an instance of an appropriate model subclass using the `model` config passed
23
- * to {@link hoistComponent.factory}. Hoist will automatically pass the resolved model instance as a
23
+ * to {@link hoistCmp.factory}. Hoist will automatically pass the resolved model instance as a
24
24
  * prop to the component's `render()` function, where the model's properties can be read/rendered
25
25
  * and any imperative APIs wired to buttons, callbacks, and other handlers.
26
26
  *
@@ -16,7 +16,6 @@ import {
16
16
  import '@xh/hoist/desktop/register';
17
17
  import {makeObservable, bindable} from '@xh/hoist/mobx';
18
18
  import {throwIf} from '@xh/hoist/utils/js';
19
- import {IReactionDisposer} from 'mobx/dist/internal';
20
19
  import {ReactElement} from 'react';
21
20
  import {DashViewSpec} from './DashViewSpec';
22
21
 
@@ -45,22 +44,9 @@ export class DashViewModel<T extends DashViewSpec = DashViewSpec> extends HoistM
45
44
  */
46
45
  containerModel: any;
47
46
 
48
- /** Title with which to initialize the view. Value is persisted. */
47
+ /** Title with which to initialize the view. */
49
48
  @bindable title: string;
50
49
 
51
- /**
52
- * Additional info that will be displayed after the title.
53
- * Applications can bind to this property to provide dynamic title details.
54
- * Value is not persisted.
55
- **/
56
- @bindable titleDetails: string;
57
-
58
- get fullTitle(): string {
59
- return this.title + (this.titleDetails ? ' ' + this.titleDetails : '');
60
- }
61
-
62
- fullTitleReaction: IReactionDisposer;
63
-
64
50
  /** Icon with which to initialize the view. */
65
51
  @bindable.ref icon: ReactElement;
66
52
 
@@ -34,13 +34,13 @@ export const dashCanvasView = hoistCmp.factory({
34
34
  model: uses(DashCanvasViewModel, {publishMode: 'limited'}),
35
35
 
36
36
  render({model, className}) {
37
- const {viewSpec, ref, hidePanelHeader, headerItems, autoHeight, fullTitle, icon} = model,
37
+ const {viewSpec, ref, hidePanelHeader, headerItems, autoHeight} = model,
38
38
  headerProps = hidePanelHeader
39
39
  ? {}
40
40
  : {
41
41
  compactHeader: true,
42
- title: fullTitle,
43
- icon,
42
+ title: model.title,
43
+ icon: model.icon,
44
44
  headerItems: [...headerItems, headerMenu({model})]
45
45
  };
46
46
  return panel({
@@ -338,7 +338,7 @@ export class DashContainerModel
338
338
  renameView(id: string) {
339
339
  const view = this.getItemByViewModel(id);
340
340
  if (!view) return;
341
- this.showTitleForm(view.tab.element, this.getViewModel(id));
341
+ this.showTitleForm(view.tab.element);
342
342
  }
343
343
 
344
344
  onResize() {
@@ -531,7 +531,7 @@ export class DashContainerModel
531
531
  $titleEl = $el.find('.lm_title').first(),
532
532
  iconSelector = 'svg.svg-inline--fa',
533
533
  viewSpec = this.getViewSpec(item.config.component),
534
- {icon} = viewModel;
534
+ {icon, title} = viewModel;
535
535
 
536
536
  $el.off('contextmenu').contextmenu(e => {
537
537
  const index = stack.contentItems.indexOf(item);
@@ -551,21 +551,15 @@ export class DashContainerModel
551
551
  }
552
552
  }
553
553
 
554
+ if (title) {
555
+ const currentTitle = $titleEl.text();
556
+ if (currentTitle !== title) $titleEl.text(title);
557
+ }
558
+
554
559
  if (viewSpec.allowRename) {
555
560
  this.insertTitleForm($el, viewModel);
556
- $titleEl.off('dblclick').dblclick(() => this.showTitleForm($el, viewModel));
561
+ $titleEl.off('dblclick').dblclick(() => this.showTitleForm($el));
557
562
  }
558
-
559
- viewModel.fullTitleReaction?.();
560
- viewModel.fullTitleReaction = viewModel.addReaction({
561
- track: () => viewModel.fullTitle,
562
- run: () => {
563
- const currentTitle = $titleEl.text(),
564
- newTitle = viewModel.fullTitle;
565
-
566
- if (currentTitle !== newTitle) $titleEl.text(newTitle);
567
- }
568
- });
569
563
  });
570
564
  }
571
565
 
@@ -585,6 +579,7 @@ export class DashContainerModel
585
579
  $formEl.submit(() => {
586
580
  const title = $inputEl.val();
587
581
  if (title.length) {
582
+ $titleEl.text(title);
588
583
  viewModel.title = title;
589
584
  }
590
585
 
@@ -593,11 +588,12 @@ export class DashContainerModel
593
588
  });
594
589
  }
595
590
 
596
- private showTitleForm($tabEl, viewModel: DashViewModel) {
591
+ private showTitleForm($tabEl) {
597
592
  if (this.renameLocked) return;
598
593
 
599
- const $inputEl = $tabEl.find('.title-form input').first(),
600
- currentTitle = viewModel.title;
594
+ const $titleEl = $tabEl.find('.lm_title').first(),
595
+ $inputEl = $tabEl.find('.title-form input').first(),
596
+ currentTitle = $titleEl.text();
601
597
 
602
598
  $tabEl.addClass('show-title-form');
603
599
  $inputEl.val(currentTitle);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xh/hoist",
3
- "version": "77.0.0-SNAPSHOT.1759414848931",
3
+ "version": "77.0.0-SNAPSHOT.1759849276739",
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",