@jbrowse/app-core 5.0.0-beta.11 → 5.0.0-beta.14

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.
Files changed (78) hide show
  1. package/esm/AppSession/AppSessionMixin.d.ts +110 -92
  2. package/esm/Assemblies/AssembliesMixin.d.ts +30 -0
  3. package/esm/HistoryManagement/index.d.ts +2 -0
  4. package/esm/HistoryManagement/index.js +2 -0
  5. package/esm/JBrowseConfig/RootConfiguration.d.ts +4 -10
  6. package/esm/JBrowseConfig/RootConfiguration.js +5 -8
  7. package/esm/JBrowseConfig/index.d.ts +3 -11
  8. package/esm/JBrowseConfig/index.js +2 -3
  9. package/esm/JBrowseModel/index.d.ts +10 -9
  10. package/esm/JBrowseModel/index.js +8 -7
  11. package/esm/JbApi/jbApi.d.ts +2 -2
  12. package/esm/JbApi/jbApi.js +16 -11
  13. package/esm/RootMenu/index.d.ts +2 -0
  14. package/esm/RootMenu/index.js +2 -0
  15. package/esm/SessionSpec/index.d.ts +2 -2
  16. package/esm/SessionSpec/index.js +1 -1
  17. package/esm/SessionSpec/loadSessionSpec.js +2 -12
  18. package/esm/SessionSpec/parseSessionSpecUrl.d.ts +19 -0
  19. package/esm/SessionSpec/parseSessionSpecUrl.js +29 -0
  20. package/esm/WorkspaceLayout/LayoutRenderer.d.ts +0 -10
  21. package/esm/WorkspaceLayout/LayoutRenderer.js +34 -101
  22. package/esm/WorkspaceLayout/PanelView.js +19 -45
  23. package/esm/WorkspaceLayout/TabStrip.d.ts +2 -2
  24. package/esm/WorkspaceLayout/TabStrip.js +36 -104
  25. package/esm/WorkspaceLayout/WorkspaceContainer.d.ts +0 -9
  26. package/esm/WorkspaceLayout/WorkspaceContainer.js +9 -42
  27. package/esm/WorkspaceLayout/WorkspacePanelActions.d.ts +1 -16
  28. package/esm/WorkspaceLayout/WorkspacePanelActions.js +46 -51
  29. package/esm/WorkspaceLayout/WorkspaceTab.d.ts +3 -19
  30. package/esm/WorkspaceLayout/WorkspaceTab.js +12 -48
  31. package/esm/WorkspaceLayout/dropZone.d.ts +7 -37
  32. package/esm/WorkspaceLayout/dropZone.js +7 -44
  33. package/esm/WorkspaceLayout/model.d.ts +45 -120
  34. package/esm/WorkspaceLayout/model.js +145 -303
  35. package/esm/WorkspaceLayout/panelChrome.d.ts +4 -7
  36. package/esm/WorkspaceLayout/panelChrome.js +0 -2
  37. package/esm/WorkspaceLayout/spec.d.ts +10 -51
  38. package/esm/WorkspaceLayout/spec.js +12 -80
  39. package/esm/WorkspaceLayout/splitter.d.ts +3 -19
  40. package/esm/WorkspaceLayout/splitter.js +5 -21
  41. package/esm/WorkspaceLayout/tabName.d.ts +8 -0
  42. package/esm/WorkspaceLayout/tabName.js +14 -0
  43. package/esm/WorkspaceLayout/tree.d.ts +19 -79
  44. package/esm/WorkspaceLayout/tree.js +34 -131
  45. package/esm/WorkspaceLayout/useLayoutDrag.d.ts +4 -22
  46. package/esm/WorkspaceLayout/useLayoutDrag.js +55 -177
  47. package/esm/WorkspaceLayout/usePointerGesture.d.ts +24 -0
  48. package/esm/WorkspaceLayout/usePointerGesture.js +83 -0
  49. package/esm/WorkspaceLayout/workspaceTheme.d.ts +27 -0
  50. package/esm/WorkspaceLayout/workspaceTheme.js +37 -0
  51. package/esm/index.d.ts +5 -3
  52. package/esm/index.js +3 -2
  53. package/esm/queryParams.d.ts +2 -0
  54. package/esm/queryParams.js +16 -5
  55. package/esm/sessionSummary.d.ts +16 -0
  56. package/esm/sessionSummary.js +57 -0
  57. package/esm/ui/App/App.js +3 -0
  58. package/esm/ui/App/DrawerHeaderHelpDialog.d.ts +3 -2
  59. package/esm/ui/App/DrawerHeaderHelpDialog.js +4 -2
  60. package/esm/ui/App/JBrowseTabMenu.d.ts +3 -2
  61. package/esm/ui/App/JBrowseTabMenu.js +5 -3
  62. package/esm/ui/App/ThemeModeButton.d.ts +4 -5
  63. package/esm/ui/App/ThemeModeButton.js +22 -14
  64. package/esm/ui/App/ViewContainer.js +7 -1
  65. package/esm/ui/App/ViewMenu.js +69 -42
  66. package/esm/ui/App/ViewWrapper.js +2 -2
  67. package/esm/ui/App/ViewsContainer.js +3 -4
  68. package/esm/ui/App/lazyParts.d.ts +0 -5
  69. package/esm/ui/App/lazyParts.js +0 -1
  70. package/esm/ui/App/preloadAppShell.js +3 -6
  71. package/esm/ui/App/types.d.ts +3 -2
  72. package/esm/ui/App/viewTitle.d.ts +6 -1
  73. package/esm/ui/App/viewTitle.js +7 -2
  74. package/package.json +7 -7
  75. package/esm/WorkspaceLayout/dockviewTheme.d.ts +0 -69
  76. package/esm/WorkspaceLayout/dockviewTheme.js +0 -82
  77. package/esm/ui/App/ClassicViewsContainer.d.ts +0 -6
  78. package/esm/ui/App/ClassicViewsContainer.js +0 -22
@@ -78,29 +78,16 @@ export declare function WorkspaceLayoutMixin(): import("@jbrowse/mobx-state-tree
78
78
  }>>, [undefined]>;
79
79
  activePanelId: import("@jbrowse/mobx-state-tree").IMaybe<import("@jbrowse/mobx-state-tree").ISimpleType<string>>;
80
80
  /**
81
- * Show only this cell, at the size of the whole workspace.
82
- *
83
- * Deliberately HERE and not a `maximized` flag on `PanelNode`. On the
84
- * node it would be inside `tree.ts`, the half that carries the risk and
85
- * is proven by a randomised operation sequence asserting canonical form
86
- * after every step — and every operation would then have to say what it
87
- * does to the flag: a split of a maximized panel, a drag of its last tab
88
- * out, a normalize that collapses it into its parent. Beside
89
- * `activePanelId` it is the same class of thing as `activePanelId`,
90
- * including its failure mode, which `livePanelIds` already repairs.
81
+ * Show only this cell, at the size of the whole workspace. Kept here
82
+ * rather than as a flag on `PanelNode` so no `tree.ts` operation has to
83
+ * say what it does to it.
91
84
  */
92
85
  maximizedPanelId: import("@jbrowse/mobx-state-tree").IMaybe<import("@jbrowse/mobx-state-tree").ISimpleType<string>>;
93
86
  }, {
94
87
  /**
95
- * The plain tree the pure functions take.
96
- *
97
- * `getSnapshot` is a `keepAlive` computed, so this is cached and
98
- * referentially stable — which also lets MST's reconcile short-circuit on
99
- * identity when `apply` writes an untouched subtree back.
100
- *
101
- * Uncast on purpose: the models below and the interfaces in `tree.ts` are
102
- * two spellings of one shape, and this assignment is the only thing that
103
- * checks they agree.
88
+ * Referentially stable, since `getSnapshot` is cached. Uncast on
89
+ * purpose: this assignment is what checks the models above agree with
90
+ * the interfaces in `tree.ts`.
104
91
  */
105
92
  readonly tree: LayoutTree;
106
93
  } & {
@@ -110,36 +97,19 @@ export declare function WorkspaceLayoutMixin(): import("@jbrowse/mobx-state-tree
110
97
  findTab(tabId: string): TabHome | undefined;
111
98
  tabContainingView(viewId: string): TabHome | undefined;
112
99
  panelContainingView(viewId: string): PanelNode | undefined;
113
- /** The views a tab renders: its members, in `session.views` order. */
114
- viewIdsForTab(tabId: string, order: string[]): string[];
115
- /** The tab a panel is showing, or its first. */
116
- activeTabOf(panelId: string): TabNode | undefined;
117
100
  /**
118
- * What to render: the maximized cell alone, or the whole tree.
119
- *
120
- * Sized to 1 rather than handed over as it sits. A pane's `size` is its
121
- * share of its siblings, and CSS distributes free space by grow factor
122
- * only up to a total of 1 — so a cell that was a third of a row, alone
123
- * in the workspace with `flexGrow: 0.33`, draws a third of the window
124
- * and leaves the rest blank.
101
+ * The maximized cell alone, or the whole tree. The cell is resized to 1
102
+ * because CSS hands out free space by grow factor only up to a total of
103
+ * 1, so a third-of-a-row cell would draw a third of the window.
125
104
  */
126
105
  readonly visibleTree: LayoutTree;
127
106
  } & {
128
107
  setActivePanelId(panelId: string | undefined): void;
129
108
  /**
130
- * Show one cell at the size of the workspace, or go back.
131
- *
132
- * A toggle rather than a pair, because the gesture is a toggle: the
133
- * strip's double-click and the cell menu's one item both mean "this
134
- * cell, or not any more". Maximizing a DIFFERENT cell while one is
135
- * already maximized moves the mode rather than restoring, which is
136
- * what the menu item on another cell's strip is asking for.
137
- *
138
- * Mounts no views that were not mounted — it is the same cell showing
139
- * the same tab — and unmounts every other cell's, so the WebGL2
140
- * context ceiling (`agent-docs/reference/GPU_PORTABILITY.md`) can
141
- * only go down. That is the reason it is this and not a `display:
142
- * none` over a still-mounted workspace.
109
+ * Show one cell at the size of the workspace, or go back; naming a
110
+ * different cell moves the mode. Unmounts every other cell's views
111
+ * rather than hiding them, to stay under the WebGL2 context ceiling
112
+ * (`agent-docs/reference/GPU_PORTABILITY.md`).
143
113
  */
144
114
  toggleMaximizedPanel(panelId: string): void;
145
115
  restorePanels(): void;
@@ -151,108 +121,63 @@ export declare function WorkspaceLayoutMixin(): import("@jbrowse/mobx-state-tree
151
121
  /** "New empty tab": a tab in an existing cell, showing the launcher. */
152
122
  addTab(panelId: string, viewIds?: string[]): TabNode | undefined;
153
123
  /**
154
- * Close a tab, and the cell with it if that was its last.
155
- *
156
- * A cell whose tabs are all gone is the state `pruneEmptyPanel` was
157
- * written for — "dragging the last tab out of a split and leaving a
158
- * blank half is the one place an empty panel is clearly not what was
159
- * meant" — and closing that tab arrives at the identical half by a
160
- * different gesture. It rendered nothing at all, not even the launcher
161
- * an empty TAB shows, so the only way back out of it was the `+`.
162
- *
163
- * `pruneEmptyPanel` carries both guards already: a cell with tabs left
164
- * stays, and the last cell in the workspace stays whatever happens to
165
- * it, since there is nowhere for the tree to collapse to.
124
+ * Close a tab, and its cell too if that was the last tab and not the
125
+ * workspace's last cell: a tabless cell renders nothing at all.
166
126
  */
167
127
  closeTab(tabId: string): void;
168
128
  addViewToTab(tabId: string, viewId: string): void;
169
- /**
170
- * Drop a dragged tab into an existing panel, as a tab.
171
- *
172
- * One action, so the tree never exists in a state where the tab is in
173
- * both panels or neither. The imperative bridge needed an explicit
174
- * `runInAction` around the unassign+reassign pair for exactly this, and
175
- * a comment explaining that without it the reconcile autorun would
176
- * observe the gap and re-home the view.
177
- */
129
+ /** Drop a dragged tab into an existing panel, as a tab. */
178
130
  dropTabInPanel(tabId: string, targetPanelId: string, index?: number): void;
179
131
  /** Drop a dragged tab on a panel edge: split, and land in the new half. */
180
132
  dropTabInNewSplit(tabId: string, targetPanelId: string, direction: 'row' | 'column', before: boolean): string | undefined;
181
133
  setSizes(branchId: string, sizes: number[]): void;
182
134
  /**
183
- * Arrange the workspace as a spec states.
184
- *
185
- * The spec is the same shape a session spec's `layout` takes: a leaf's
186
- * `views` names views by index into `session.views` or by id, so
187
- * `{ direction: 'horizontal', children: [{ views: [0] }, { views: [1] }] }`
188
- * means here what it means in a link. A leaf spelled any other way, an
189
- * index past the end or an id no view has throws rather than arranging
190
- * nothing — an untyped caller used to collapse the workspace into one
191
- * blank tab that way.
192
- *
193
- * There is no `init` property and no standing request: the spec is
194
- * converted and *becomes* the layout, here and now. `init` existed only
195
- * because dockview had to be told, could not be told before it mounted,
196
- * and had to be told again afterwards — three problems that all came
197
- * from the layout living somewhere this action could not reach.
135
+ * Arrange the workspace as a spec states, in the shape a session
136
+ * spec's `layout` takes: a leaf's `views` names views by index into
137
+ * `session.views` or by id. A malformed leaf, an index past the end or
138
+ * an unknown id throws.
198
139
  */
199
140
  applyLayoutSpec(spec: LayoutSpecNode): string[];
200
141
  /**
201
142
  * ViewMenu's "move to new tab": the view leaves its tab for a new one.
202
- *
203
- * `allViewIds` is EVERY view in the session, defaulting to the host's
204
- * own list — homing drops any view the list does not name, so the
205
- * `[viewId]` default this used to carry unhomed all the others.
206
143
  */
207
- moveViewToNewTab(viewId: string, allViewIds?: string[]): string | undefined;
144
+ moveViewToNewTab(viewId: string): string | undefined;
208
145
  /**
209
- * ViewMenu's "move to split view": the view leaves for a new cell.
210
- * `allViewIds` is every view in the session — see `moveViewToNewTab`.
146
+ * ViewMenu's "move to split": the view leaves for a new cell to the
147
+ * right (`row`) or below (`column`) of its own.
211
148
  */
212
- moveViewToSplitRight(viewId: string, allViewIds?: string[]): string | undefined;
149
+ moveViewToSplit(viewId: string, direction: 'row' | 'column'): string | undefined;
150
+ /**
151
+ * ViewMenu's "move to tab": the view joins an existing tab, which
152
+ * becomes the one shown.
153
+ */
154
+ moveViewToTab(viewId: string, tabId: string): void;
213
155
  homeUnassignedViews(viewIds: string[]): void;
214
156
  } & {
215
157
  /**
216
- * Move one view relative to the others. PUBLIC API: an external plugin
217
- * calls this behind a `'setPendingMove' in session` guard
218
- * (jbrowse-plugin-protein3d, putting a protein view beside its genome
219
- * view). It survived the last storage change by being kept as sugar, and
220
- * it survives this one the same way — a capability-detecting caller
221
- * cannot tell you it lost a capability.
222
- *
223
- * **`allViewIds` is therefore OPTIONAL, and has to stay that way.** The
224
- * plugin passes the move alone, because that was the whole signature when
225
- * its call site was written; requiring the second argument threw
226
- * `undefined.filter` out of a launch the plugin does not wrap, and the
227
- * figure was again the only thing that noticed. Keeping the NAME is half
228
- * of not breaking a runtime lookup — the call has to keep working as it
229
- * is spelled.
158
+ * Move one view to a new tab or a split beside its cell, keeping the
159
+ * rest of the arrangement. PUBLIC API: protein3d and msaview call it
160
+ * with the move alone. The second argument is an old plugin signature;
161
+ * the session's own views are read instead.
230
162
  */
231
- setPendingMove(move: PendingMove | undefined, allViewIds?: string[]): void;
163
+ setPendingMove(move: PendingMove | undefined, _allViewIds?: string[]): void;
232
164
  /**
233
- * The whole-workspace re-arrange: every view one cell, in one of four
234
- * shapes. Restored from the dockview header's four "Global:" commands,
235
- * which went with that component and were not reimplemented.
236
- *
237
- * `allViewIds` is passed in rather than read off the session for the same
238
- * reason `moveViewToNewTab` takes it: this mixin owns the tree and has no
239
- * view list of its own. Passing `session.views` order means the
240
- * arrangement it states is already the order views render in, so unlike a
241
- * session spec's layout there is nothing for `orderViews` to apply.
165
+ * Re-arrange the whole workspace, one view per cell, in one of four
166
+ * shapes, in `session.views` order.
242
167
  */
243
- tileViews(mode: TileMode, allViewIds: string[]): void;
168
+ tileViews(mode: TileMode): void;
244
169
  /**
245
170
  * #action
246
- * Arrange the session's views into panels. Calls `applyLayoutSpec`,
247
- * turns workspaces mode on for this session (a layout renders nowhere
248
- * else), and orders `session.views` to the spec's top-to-bottom
249
- * order, which tabs read their order from. Without the last two steps
250
- * the layout applies but does not display, or the tabs appear in the
251
- * wrong order. Leaves take view ids or indexes into `session.views`; a
252
- * layout that seats no view throws rather than leaving a blank tab. A
253
- * session spec's `layout` and an agent's live re-layout both call it.
171
+ * Arrange the session's views into panels: `applyLayoutSpec`, then
172
+ * `session.views` ordered to the spec's top-to-bottom order, which tabs
173
+ * read their order from. Leaves take view ids or indexes into
174
+ * `session.views`; a layout that seats no view throws rather than
175
+ * leaving a blank tab. A session spec's `layout` and an agent's live
176
+ * re-layout both call it.
254
177
  */
255
178
  layoutViews(spec: LayoutSpecNode): string[];
179
+ } & {
180
+ afterAttach(): void;
256
181
  }, import("@jbrowse/mobx-state-tree")._NotCustomized, import("@jbrowse/mobx-state-tree")._NotCustomized>;
257
182
  export type WorkspaceLayoutMixinType = ReturnType<typeof WorkspaceLayoutMixin>;
258
183
  export interface WorkspaceLayout extends Instance<WorkspaceLayoutMixinType> {