goblin-magic 1.9.2 → 1.9.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "goblin-magic",
3
- "version": "1.9.2",
3
+ "version": "1.9.3",
4
4
  "description": "goblin-magic",
5
5
  "author": "Epsitec SA",
6
6
  "contributors": [
@@ -40,6 +40,7 @@ class ViewStateShape {
40
40
  widgetProps = option(object);
41
41
  highlighted = boolean;
42
42
  parentViewId = option(id);
43
+ tabId = option(id); //used when we restore a tab
43
44
  }
44
45
 
45
46
  class ViewState extends Sculpt(ViewStateShape) {}
@@ -62,6 +63,7 @@ class ViewState extends Sculpt(ViewStateShape) {}
62
63
  * @property {string} [View.widget]
63
64
  * @property {object} [View.widgetProps]
64
65
  * @property {View} [View.previousView]
66
+ * @property {string} [View.tabId]
65
67
  */
66
68
 
67
69
  /**
@@ -73,6 +75,7 @@ class ViewState extends Sculpt(ViewStateShape) {}
73
75
  * @property {string} [View.widget]
74
76
  * @property {object} [View.widgetProps]
75
77
  * @property {View} [View.previousView]
78
+ * @property {string} [View.tabId]
76
79
  */
77
80
 
78
81
  /**
@@ -759,7 +762,7 @@ class MagicNavigation extends Elf {
759
762
  })();
760
763
  panelId = window.panelIds[newPanelIndex];
761
764
  }
762
- const tabId = `tab@${this.quest.uuidV4()}`;
765
+ const tabId = view.tabId || `tab@${this.quest.uuidV4()}`;
763
766
  const serviceId = await this._createService(view);
764
767
  const tab = {
765
768
  serviceId,
@@ -1129,7 +1132,10 @@ class MagicNavigation extends Elf {
1129
1132
  if (!view) {
1130
1133
  throw new Error(`Missing view for tab '${tabId}'`);
1131
1134
  }
1132
- await this.openNewTab(view, windowId, panelId);
1135
+ //Ensure new view infos without tabId
1136
+ const viewCopy = {...view};
1137
+ delete viewCopy.tabId;
1138
+ await this.openNewTab(viewCopy, windowId, panelId);
1133
1139
  }
1134
1140
 
1135
1141
  /**