jbrowse-plugin-protein3d 0.12.0 → 0.12.1

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.
@@ -4,6 +4,10 @@ import { maybeLaunchSideBySide } from '../LaunchProteinView/utils/sideBySide';
4
4
  import { coerceColorScheme } from '../ProteinView/applyColorTheme';
5
5
  import { proteinViewSnapshot } from '../ProteinView/proteinViewSpec';
6
6
  export default function LaunchProteinViewExtensionPointF(pluginManager) {
7
+ // v4 hosts declare `init`; v5 reads the settings off the view object and
8
+ // warns about the nesting
9
+ const lgvTakesInit = () => 'init' in
10
+ pluginManager.getViewType('LinearGenomeView').stateModel.properties;
7
11
  pluginManager.addToExtensionPoint('LaunchView-ProteinView',
8
12
  // A LaunchView point is a transformer — the chain hands what each callback
9
13
  // returns to the next — and JBrowse now warns when one returns undefined
@@ -67,12 +71,9 @@ export default function LaunchProteinViewExtensionPointF(pluginManager) {
67
71
  const ownsConnectedView = !connectedViewId && !!connectedView;
68
72
  const resolvedConnectedViewId = connectedViewId ??
69
73
  (connectedView
70
- ? session.addView('LinearGenomeView', {
71
- type: 'LinearGenomeView',
72
- // a spec's connectedView is unvalidated json, so a missing
73
- // assembly reaches the view and is reported there, as before
74
- init: connectedView,
75
- }).id
74
+ ? session.addView('LinearGenomeView', lgvTakesInit()
75
+ ? { type: 'LinearGenomeView', init: connectedView }
76
+ : { ...connectedView, type: 'LinearGenomeView' }).id
76
77
  : undefined);
77
78
  const structures = requested.map((s, i) => ({
78
79
  url: urls[i],