@jbrowse/embedded-core 5.0.0-beta.1 → 5.0.0-beta.11

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.
@@ -8,18 +8,17 @@ import { EmbeddedSessionThemeMixin } from './EmbeddedSessionThemeMixin.js';
8
8
  * they compose and the three getters that read the root model. The twin of
9
9
  * {@link createEmbeddedRootModel} one level down.
10
10
  *
11
- * A mixin the product composes, deliberately, rather than a factory taking the
12
- * product's view type and tracks mixin as parameters. That factory is the
13
- * obvious shape and it does not work: `types.compose`'s overloads are declared
14
- * over `IModelType<P, O, FC, FS>`, so a model handed in as a naked type
15
- * parameter has nothing to infer those four from and the composed result
16
- * degrades — `session.view` becomes `any`, which typechecks at every embedder
17
- * call site and is caught by nothing. Keeping every argument to `compose`
18
- * concrete is what keeps the products' views typed.
11
+ * Each product composes this mixin. A factory taking the product's view type
12
+ * and tracks mixin as parameters does not typecheck usefully:
13
+ * `types.compose`'s overloads are declared over `IModelType<P, O, FC, FS>`, so
14
+ * a model passed as a naked type parameter gives nothing to infer those four
15
+ * from, and `session.view` becomes `any` at every embedder call site with no
16
+ * type error. Passing only concrete types to `compose` keeps the products'
17
+ * views typed.
19
18
  *
20
- * So each product still spells out its own tracks mixin, `view` prop, and the
21
- * `views`/`addView`/`removeView` members that read `self.view` — those are the
22
- * ones that need its concrete view type.
19
+ * Each product therefore declares its tracks mixin, `view` prop, and the
20
+ * `views`/`addView`/`removeView` members that read `self.view`, because those
21
+ * members need its concrete view type.
23
22
  */
24
23
  export function EmbeddedSessionMixin(pluginManager) {
25
24
  return types
@@ -28,6 +27,14 @@ export function EmbeddedSessionMixin(pluginManager) {
28
27
  // members, so their order relative to each other is not load-bearing
29
28
  ReferenceManagementSessionMixin(pluginManager), TrackMenuSessionMixin(pluginManager), EmbeddedSessionThemeMixin(pluginManager))
30
29
  .views(self => ({
30
+ /**
31
+ * #getter
32
+ * An embedded view is drawn with no title bar above it, so its menu lives
33
+ * in the view's own controls.
34
+ */
35
+ get viewTitleBars() {
36
+ return false;
37
+ },
31
38
  /**
32
39
  * #getter
33
40
  */
@@ -42,7 +49,7 @@ export function EmbeddedSessionMixin(pluginManager) {
42
49
  // them through `self.jbrowse` (= root.config), so re-declaring here would
43
50
  // just duplicate the base getters with looser types
44
51
  get assemblyNames() {
45
- return [getParent(self).config.assemblyName];
52
+ return getParent(self).config.assemblyNames;
46
53
  },
47
54
  /**
48
55
  * #getter