@jbrowse/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 (439) hide show
  1. package/README.md +450 -132
  2. package/esm/BaseFeatureWidget/BaseFeatureDetail/ArrayValue.d.ts +3 -2
  3. package/esm/BaseFeatureWidget/BaseFeatureDetail/ArrayValue.js +4 -2
  4. package/esm/BaseFeatureWidget/BaseFeatureDetail/Attributes.d.ts +6 -2
  5. package/esm/BaseFeatureWidget/BaseFeatureDetail/Attributes.js +18 -3
  6. package/esm/BaseFeatureWidget/BaseFeatureDetail/BaseAttributes.d.ts +2 -1
  7. package/esm/BaseFeatureWidget/BaseFeatureDetail/BaseAttributes.js +4 -2
  8. package/esm/BaseFeatureWidget/BaseFeatureDetail/BaseCard.d.ts +2 -1
  9. package/esm/BaseFeatureWidget/BaseFeatureDetail/BaseCard.js +4 -2
  10. package/esm/BaseFeatureWidget/BaseFeatureDetail/BaseCoreDetails.d.ts +2 -1
  11. package/esm/BaseFeatureWidget/BaseFeatureDetail/BaseCoreDetails.js +4 -2
  12. package/esm/BaseFeatureWidget/BaseFeatureDetail/BasicValue.d.ts +5 -4
  13. package/esm/BaseFeatureWidget/BaseFeatureDetail/BasicValue.js +6 -4
  14. package/esm/BaseFeatureWidget/BaseFeatureDetail/CoreDetails.d.ts +2 -1
  15. package/esm/BaseFeatureWidget/BaseFeatureDetail/CoreDetails.js +4 -2
  16. package/esm/BaseFeatureWidget/BaseFeatureDetail/DataGridDetails.d.ts +3 -2
  17. package/esm/BaseFeatureWidget/BaseFeatureDetail/DataGridDetails.js +4 -2
  18. package/esm/BaseFeatureWidget/BaseFeatureDetail/FeatureDetails.js +2 -2
  19. package/esm/BaseFeatureWidget/BaseFeatureDetail/FeatureWash.d.ts +3 -2
  20. package/esm/BaseFeatureWidget/BaseFeatureDetail/FeatureWash.js +4 -2
  21. package/esm/BaseFeatureWidget/BaseFeatureDetail/FieldActionsButton.d.ts +3 -2
  22. package/esm/BaseFeatureWidget/BaseFeatureDetail/FieldActionsButton.js +4 -2
  23. package/esm/BaseFeatureWidget/BaseFeatureDetail/FieldName.d.ts +3 -2
  24. package/esm/BaseFeatureWidget/BaseFeatureDetail/FieldName.js +4 -2
  25. package/esm/BaseFeatureWidget/BaseFeatureDetail/Formatter.d.ts +3 -2
  26. package/esm/BaseFeatureWidget/BaseFeatureDetail/Formatter.js +4 -2
  27. package/esm/BaseFeatureWidget/BaseFeatureDetail/ParentFeatureLine.d.ts +3 -2
  28. package/esm/BaseFeatureWidget/BaseFeatureDetail/ParentFeatureLine.js +4 -2
  29. package/esm/BaseFeatureWidget/BaseFeatureDetail/SimpleField.d.ts +3 -2
  30. package/esm/BaseFeatureWidget/BaseFeatureDetail/SimpleField.js +4 -2
  31. package/esm/BaseFeatureWidget/BaseFeatureDetail/UriField.d.ts +3 -2
  32. package/esm/BaseFeatureWidget/BaseFeatureDetail/UriField.js +4 -2
  33. package/esm/BaseFeatureWidget/SequenceFeatureDetails/SequenceBody.d.ts +3 -2
  34. package/esm/BaseFeatureWidget/SequenceFeatureDetails/SequenceBody.js +4 -2
  35. package/esm/BaseFeatureWidget/SequenceFeatureDetails/SequenceFeatureDetails.d.ts +3 -1
  36. package/esm/BaseFeatureWidget/SequenceFeatureDetails/SequenceFeatureDetails.js +15 -24
  37. package/esm/BaseFeatureWidget/SequenceFeatureDetails/SequenceFeaturePanel.js +1 -1
  38. package/esm/BaseFeatureWidget/SequenceFeatureDetails/SequenceLegend.d.ts +3 -2
  39. package/esm/BaseFeatureWidget/SequenceFeatureDetails/SequenceLegend.js +4 -2
  40. package/esm/BaseFeatureWidget/SequenceFeatureDetails/SequencePanel.js +4 -4
  41. package/esm/BaseFeatureWidget/SequenceFeatureDetails/dialogs/FeatureSequenceDialog.d.ts +3 -1
  42. package/esm/BaseFeatureWidget/SequenceFeatureDetails/dialogs/FeatureSequenceDialog.js +2 -2
  43. package/esm/BaseFeatureWidget/SequenceFeatureDetails/dialogs/HelpDialog.d.ts +3 -2
  44. package/esm/BaseFeatureWidget/SequenceFeatureDetails/dialogs/HelpDialog.js +4 -2
  45. package/esm/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SequenceDialog.d.ts +1 -2
  46. package/esm/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SequenceDialog.js +2 -2
  47. package/esm/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SequenceTypeSelector.d.ts +1 -2
  48. package/esm/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SequenceTypeSelector.js +15 -36
  49. package/esm/BaseFeatureWidget/SequenceFeatureDetails/dialogs/TranscriptSelector.d.ts +3 -2
  50. package/esm/BaseFeatureWidget/SequenceFeatureDetails/dialogs/TranscriptSelector.js +4 -2
  51. package/esm/BaseFeatureWidget/SequenceFeatureDetails/featureTypeUtil.d.ts +4 -2
  52. package/esm/BaseFeatureWidget/SequenceFeatureDetails/featureTypeUtil.js +29 -20
  53. package/esm/BaseFeatureWidget/SequenceFeatureDetails/model.d.ts +13 -1
  54. package/esm/BaseFeatureWidget/SequenceFeatureDetails/model.js +28 -1
  55. package/esm/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/CDNASequence.js +3 -3
  56. package/esm/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/SequenceDisplay.js +2 -2
  57. package/esm/BaseFeatureWidget/stateModelFactory.d.ts +9 -0
  58. package/esm/BaseFeatureWidget/stateModelFactory.js +11 -0
  59. package/esm/BaseFeatureWidget/types.d.ts +2 -0
  60. package/esm/PluginManager.d.ts +7 -3
  61. package/esm/PluginManager.js +12 -3
  62. package/esm/ReExports/coreModules.generated.js +538 -518
  63. package/esm/ReExports/coreWorkerModules.generated.js +456 -438
  64. package/esm/ReExports/lazify.js +3 -2
  65. package/esm/ReExports/list.js +22 -6
  66. package/esm/ReExports/names.d.ts +1 -0
  67. package/esm/ReExports/names.generated.d.ts +2 -0
  68. package/esm/ReExports/names.generated.js +566 -0
  69. package/esm/ReExports/names.js +3 -0
  70. package/esm/TextSearch/TextSearchManager.d.ts +3 -3
  71. package/esm/TextSearch/TextSearchManager.js +6 -13
  72. package/esm/assemblyManager/assembly.d.ts +9 -0
  73. package/esm/assemblyManager/assembly.js +13 -0
  74. package/esm/assemblyManager/assemblyConfigSchema.d.ts +6 -1
  75. package/esm/assemblyManager/assemblyConfigSchema.js +23 -22
  76. package/esm/assemblyManager/assemblyManager.d.ts +11 -0
  77. package/esm/assemblyManager/assemblyManager.js +2 -0
  78. package/esm/assemblyManager/expandAssemblyConfigShorthand.d.ts +9 -0
  79. package/esm/assemblyManager/expandAssemblyConfigShorthand.js +23 -0
  80. package/esm/checkPlugins.js +10 -4
  81. package/esm/configuration/configurationSchema.d.ts +51 -100
  82. package/esm/configuration/configurationSchema.js +59 -225
  83. package/esm/configuration/configurationSchemaUnion.d.ts +2 -1
  84. package/esm/configuration/configurationSchemaUnion.js +2 -1
  85. package/esm/configuration/configurationSlot.d.ts +18 -64
  86. package/esm/configuration/configurationSlot.js +32 -98
  87. package/esm/configuration/fillLocations.d.ts +4 -2
  88. package/esm/configuration/fillLocations.js +9 -3
  89. package/esm/configuration/formatAboutConfigSchema.d.ts +2 -2
  90. package/esm/configuration/formatAboutConfigSchema.js +2 -2
  91. package/esm/configuration/formatDetailsConfigSchema.d.ts +2 -2
  92. package/esm/configuration/formatDetailsConfigSchema.js +7 -5
  93. package/esm/configuration/getConf.d.ts +7 -36
  94. package/esm/configuration/getConf.js +20 -41
  95. package/esm/configuration/index.d.ts +4 -3
  96. package/esm/configuration/index.js +3 -2
  97. package/esm/configuration/partitionAdvanced.d.ts +12 -0
  98. package/esm/configuration/partitionAdvanced.js +42 -0
  99. package/esm/configuration/plot.d.ts +6 -0
  100. package/esm/configuration/plot.js +56 -9
  101. package/esm/configuration/readConfObject.d.ts +15 -17
  102. package/esm/configuration/readConfObject.js +19 -50
  103. package/esm/configuration/schemaRegistry.d.ts +0 -2
  104. package/esm/configuration/schemaTypes.js +5 -1
  105. package/esm/configuration/slotFacade.js +2 -2
  106. package/esm/configuration/snapshotPreprocess.d.ts +42 -18
  107. package/esm/configuration/snapshotPreprocess.js +95 -37
  108. package/esm/configuration/tabixShorthand.js +1 -3
  109. package/esm/configuration/types.d.ts +60 -159
  110. package/esm/data_adapters/BaseAdapter/BaseAdapter.d.ts +7 -0
  111. package/esm/data_adapters/BaseAdapter/BaseAdapter.js +7 -0
  112. package/esm/data_adapters/BaseAdapter/BaseFeatureDataAdapter.d.ts +0 -22
  113. package/esm/data_adapters/BaseAdapter/BaseFeatureDataAdapter.js +0 -55
  114. package/esm/data_adapters/BaseAdapter/index.d.ts +0 -1
  115. package/esm/data_adapters/BaseAdapter/index.js +0 -1
  116. package/esm/data_adapters/BaseAdapter/rowSources.d.ts +2 -2
  117. package/esm/data_adapters/BaseAdapter/types.d.ts +1 -0
  118. package/esm/data_adapters/CytobandAdapter/configSchema.d.ts +2 -0
  119. package/esm/data_adapters/CytobandAdapter/configSchema.js +5 -0
  120. package/esm/data_adapters/dataAdapterCache.d.ts +25 -13
  121. package/esm/data_adapters/dataAdapterCache.js +68 -24
  122. package/esm/data_adapters/getFeatureAdapter.d.ts +9 -0
  123. package/esm/data_adapters/getFeatureAdapter.js +17 -0
  124. package/esm/pluggableElementTypes/DisplayType.d.ts +7 -0
  125. package/esm/pluggableElementTypes/DisplayType.js +7 -0
  126. package/esm/pluggableElementTypes/RpcMethodType.d.ts +7 -0
  127. package/esm/pluggableElementTypes/RpcMethodType.js +9 -0
  128. package/esm/pluggableElementTypes/addMenuItems.d.ts +2 -1
  129. package/esm/pluggableElementTypes/addMenuItems.js +2 -1
  130. package/esm/pluggableElementTypes/models/BaseConnectionModelFactory.d.ts +2 -0
  131. package/esm/pluggableElementTypes/models/BaseConnectionModelFactory.js +2 -0
  132. package/esm/pluggableElementTypes/models/BaseDisplayModel.d.ts +40 -5
  133. package/esm/pluggableElementTypes/models/BaseDisplayModel.js +57 -9
  134. package/esm/pluggableElementTypes/models/BaseTrackModel.d.ts +5 -7
  135. package/esm/pluggableElementTypes/models/BaseTrackModel.js +9 -10
  136. package/esm/pluggableElementTypes/models/BaseViewModel.d.ts +2 -0
  137. package/esm/pluggableElementTypes/models/BaseViewModel.js +2 -0
  138. package/esm/pluggableElementTypes/models/InternetAccountModel.d.ts +3 -0
  139. package/esm/pluggableElementTypes/models/InternetAccountModel.js +3 -0
  140. package/esm/pluggableElementTypes/models/baseConnectionConfig.d.ts +3 -0
  141. package/esm/pluggableElementTypes/models/baseConnectionConfig.js +3 -0
  142. package/esm/pluggableElementTypes/models/baseInternetAccountConfig.d.ts +3 -1
  143. package/esm/pluggableElementTypes/models/baseInternetAccountConfig.js +3 -1
  144. package/esm/pluggableElementTypes/models/baseTrackConfig.js +12 -1
  145. package/esm/pluggableElementTypes/models/components/SaveTrackData.js +2 -2
  146. package/esm/pluggableElementTypes/models/expandTrackConfigShorthand.d.ts +1 -1
  147. package/esm/pluggableElementTypes/models/expandTrackConfigShorthand.js +1 -1
  148. package/esm/pluginDefinitions.d.ts +7 -0
  149. package/esm/pluginDefinitions.js +20 -0
  150. package/esm/rpc/RpcRegistry.d.ts +2 -11
  151. package/esm/rpc/byteBudget.d.ts +15 -0
  152. package/esm/rpc/byteBudget.js +23 -0
  153. package/esm/rpc/configSchema.d.ts +2 -0
  154. package/esm/rpc/configSchema.js +3 -1
  155. package/esm/rpc/coreRpcMethods.d.ts +1 -2
  156. package/esm/rpc/coreRpcMethods.js +1 -2
  157. package/esm/rpc/explainTransferError.js +3 -3
  158. package/esm/rpc/methods/CoreGetEncodedLayers.d.ts +2 -2
  159. package/esm/rpc/methods/CoreGetEncodedLayers.js +7 -5
  160. package/esm/rpc/methods/CoreLoadTrackCode.d.ts +17 -0
  161. package/esm/rpc/methods/CoreLoadTrackCode.js +24 -0
  162. package/esm/rpc/methods/layerFeatures.d.ts +9 -6
  163. package/esm/rpc/methods/layerFeatures.js +21 -5
  164. package/esm/ui/ActionLink.d.ts +3 -2
  165. package/esm/ui/ActionLink.js +4 -2
  166. package/esm/ui/AddCustomPluginDialog.d.ts +3 -2
  167. package/esm/ui/AddCustomPluginDialog.js +6 -4
  168. package/esm/ui/AppLogo.js +43 -3
  169. package/esm/ui/BaseTooltip.d.ts +3 -2
  170. package/esm/ui/BaseTooltip.js +4 -2
  171. package/esm/ui/CascadingMenu.js +14 -12
  172. package/esm/ui/CascadingMenuButton.d.ts +2 -2
  173. package/esm/ui/CascadingMenuButton.js +5 -4
  174. package/esm/ui/CascadingMenuHelpDialog.d.ts +3 -2
  175. package/esm/ui/CascadingMenuHelpDialog.js +4 -2
  176. package/esm/ui/CascadingMenuHelpIconButton.d.ts +4 -3
  177. package/esm/ui/CascadingMenuHelpIconButton.js +9 -5
  178. package/esm/ui/ColorPicker.d.ts +5 -4
  179. package/esm/ui/ColorPicker.js +6 -4
  180. package/esm/ui/ContextMenu.d.ts +1 -1
  181. package/esm/ui/ContextMenu.js +1 -1
  182. package/esm/ui/CopyToClipboardButton.d.ts +3 -2
  183. package/esm/ui/CopyToClipboardButton.js +4 -2
  184. package/esm/ui/Crosshairs.js +13 -10
  185. package/esm/ui/DOMPurifySanitizedHTML.d.ts +3 -2
  186. package/esm/ui/DOMPurifySanitizedHTML.js +4 -2
  187. package/esm/ui/DataGridFlexContainer.d.ts +3 -2
  188. package/esm/ui/DataGridFlexContainer.js +4 -2
  189. package/esm/ui/Dialog.d.ts +1 -1
  190. package/esm/ui/Dialog.js +5 -4
  191. package/esm/ui/DropDownMenu.js +2 -2
  192. package/esm/ui/EditableTypography.d.ts +1 -1
  193. package/esm/ui/EditableTypography.js +3 -2
  194. package/esm/ui/ErrorActions.d.ts +3 -2
  195. package/esm/ui/ErrorActions.js +4 -2
  196. package/esm/ui/ErrorBanner.d.ts +2 -2
  197. package/esm/ui/ErrorBanner.js +3 -2
  198. package/esm/ui/ErrorBar.d.ts +3 -2
  199. package/esm/ui/ErrorBar.js +4 -2
  200. package/esm/ui/ErrorMessage.d.ts +3 -2
  201. package/esm/ui/ErrorMessage.js +4 -2
  202. package/esm/ui/ErrorMessageStackTraceContents.d.ts +3 -2
  203. package/esm/ui/ErrorMessageStackTraceContents.js +4 -2
  204. package/esm/ui/ErrorMessageStackTraceDialog.d.ts +3 -2
  205. package/esm/ui/ErrorMessageStackTraceDialog.js +4 -2
  206. package/esm/ui/ErrorOverlay.d.ts +3 -2
  207. package/esm/ui/ErrorOverlay.js +4 -2
  208. package/esm/ui/ExportSvgDialog.d.ts +3 -2
  209. package/esm/ui/ExportSvgDialog.js +4 -2
  210. package/esm/ui/ExternalLink.d.ts +2 -1
  211. package/esm/ui/ExternalLink.js +4 -2
  212. package/esm/ui/FactoryResetDialog.d.ts +3 -2
  213. package/esm/ui/FactoryResetDialog.js +4 -2
  214. package/esm/ui/FatalErrorDialog.d.ts +3 -2
  215. package/esm/ui/FatalErrorDialog.js +6 -4
  216. package/esm/ui/FileDropZone.d.ts +3 -2
  217. package/esm/ui/FileDropZone.js +4 -2
  218. package/esm/ui/FileSelector/LocalFileChooser.js +4 -4
  219. package/esm/ui/FileSelector/LocationInput.d.ts +3 -2
  220. package/esm/ui/FileSelector/LocationInput.js +4 -2
  221. package/esm/ui/FileSelector/SourceTypeSelector.d.ts +3 -2
  222. package/esm/ui/FileSelector/SourceTypeSelector.js +8 -6
  223. package/esm/ui/GpuFallbackButton.d.ts +3 -2
  224. package/esm/ui/GpuFallbackButton.js +4 -2
  225. package/esm/ui/HoverMenu.d.ts +2 -2
  226. package/esm/ui/HoverMenu.js +7 -3
  227. package/esm/ui/HoverTooltip.d.ts +3 -2
  228. package/esm/ui/HoverTooltip.js +4 -2
  229. package/esm/ui/Icons.d.ts +5 -5
  230. package/esm/ui/Icons.js +11 -10
  231. package/esm/ui/InlineMenuControls.d.ts +2 -2
  232. package/esm/ui/InlineMenuControls.js +4 -3
  233. package/esm/ui/JexlFilterRowEditors.d.ts +4 -4
  234. package/esm/ui/JexlFilterRowEditors.js +9 -8
  235. package/esm/ui/LabeledCheckbox.d.ts +3 -2
  236. package/esm/ui/LabeledCheckbox.js +4 -2
  237. package/esm/ui/LazyBaseTooltip.d.ts +12 -3
  238. package/esm/ui/LazyBaseTooltip.js +4 -2
  239. package/esm/ui/LegendSwatchGlyph.js +1 -0
  240. package/esm/ui/LoadingDots.d.ts +2 -1
  241. package/esm/ui/LoadingDots.js +4 -2
  242. package/esm/ui/LoadingEllipses.d.ts +5 -2
  243. package/esm/ui/LoadingEllipses.js +5 -3
  244. package/esm/ui/LoadingOverlay.d.ts +3 -2
  245. package/esm/ui/LoadingOverlay.js +4 -2
  246. package/esm/ui/LoadingProgress.d.ts +3 -2
  247. package/esm/ui/LoadingProgress.js +4 -2
  248. package/esm/ui/Logo.d.ts +2 -2
  249. package/esm/ui/Logo.js +9 -8
  250. package/esm/ui/MenuItemChevron.d.ts +2 -2
  251. package/esm/ui/MenuItemChevron.js +3 -2
  252. package/esm/ui/MenuItemEndDecoration.d.ts +2 -2
  253. package/esm/ui/MenuItemEndDecoration.js +3 -2
  254. package/esm/ui/MenuItemTrailing.d.ts +2 -2
  255. package/esm/ui/MenuItemTrailing.js +7 -6
  256. package/esm/ui/MenuTypes.d.ts +21 -1
  257. package/esm/ui/MenuTypes.js +20 -0
  258. package/esm/ui/MonospaceTextField.d.ts +3 -2
  259. package/esm/ui/MonospaceTextField.js +4 -2
  260. package/esm/ui/NumberTextField.d.ts +2 -2
  261. package/esm/ui/NumberTextField.js +4 -2
  262. package/esm/ui/PaletteContext.d.ts +11 -9
  263. package/esm/ui/PaletteContext.js +33 -18
  264. package/esm/ui/PluginStoreCard.d.ts +3 -2
  265. package/esm/ui/PluginStoreCard.js +4 -2
  266. package/esm/ui/PopoverPicker.d.ts +3 -2
  267. package/esm/ui/PopoverPicker.js +4 -2
  268. package/esm/ui/PrerenderedCanvas.d.ts +2 -2
  269. package/esm/ui/PrerenderedCanvas.js +3 -2
  270. package/esm/ui/RedErrorMessageBox.d.ts +3 -2
  271. package/esm/ui/RedErrorMessageBox.js +4 -2
  272. package/esm/ui/RefNameAutocomplete/EndAdornment.d.ts +3 -2
  273. package/esm/ui/RefNameAutocomplete/EndAdornment.js +4 -2
  274. package/esm/ui/RefNameAutocomplete/HelpDialog.d.ts +3 -2
  275. package/esm/ui/RefNameAutocomplete/HelpDialog.js +4 -2
  276. package/esm/ui/ReplaceCurrentViewButton.d.ts +3 -2
  277. package/esm/ui/ReplaceCurrentViewButton.js +4 -2
  278. package/esm/ui/ResizeHandle.d.ts +2 -2
  279. package/esm/ui/ResizeHandle.js +3 -2
  280. package/esm/ui/SanitizedHTML.d.ts +3 -2
  281. package/esm/ui/SanitizedHTML.js +6 -4
  282. package/esm/ui/ScrollChrome.d.ts +3 -2
  283. package/esm/ui/ScrollChrome.js +4 -2
  284. package/esm/ui/ScrollEdgeShadow.d.ts +2 -2
  285. package/esm/ui/ScrollEdgeShadow.js +2 -2
  286. package/esm/ui/SessionJsonPanel.d.ts +3 -2
  287. package/esm/ui/SessionJsonPanel.js +4 -2
  288. package/esm/ui/ShareLinkField.d.ts +3 -2
  289. package/esm/ui/ShareLinkField.js +4 -2
  290. package/esm/ui/SingleSlider.d.ts +2 -2
  291. package/esm/ui/SingleSlider.js +4 -2
  292. package/esm/ui/SliderTooltip.d.ts +2 -1
  293. package/esm/ui/SliderTooltip.js +4 -2
  294. package/esm/ui/SnackbarContents.d.ts +3 -2
  295. package/esm/ui/SnackbarContents.js +4 -2
  296. package/esm/ui/SnackbarModel.d.ts +2 -0
  297. package/esm/ui/SnackbarModel.js +2 -0
  298. package/esm/ui/StackTraceButton.d.ts +3 -2
  299. package/esm/ui/StackTraceButton.js +4 -2
  300. package/esm/ui/StatusProgressBar.d.ts +3 -2
  301. package/esm/ui/StatusProgressBar.js +4 -2
  302. package/esm/ui/SubmitForm.d.ts +2 -1
  303. package/esm/ui/SubmitForm.js +4 -2
  304. package/esm/ui/SvgColorLegend.d.ts +3 -4
  305. package/esm/ui/SvgColorLegend.js +27 -18
  306. package/esm/ui/TagTextField.d.ts +2 -2
  307. package/esm/ui/TagTextField.js +4 -2
  308. package/esm/ui/ViewLoadingScreen.d.ts +3 -2
  309. package/esm/ui/ViewLoadingScreen.js +4 -2
  310. package/esm/ui/buildExtraTrackMenuItems.d.ts +2 -2
  311. package/esm/ui/colorScale.d.ts +5 -1
  312. package/esm/ui/colorScale.js +12 -10
  313. package/esm/ui/colors.d.ts +42 -31
  314. package/esm/ui/colors.js +85 -48
  315. package/esm/ui/filterMenuItems.d.ts +10 -31
  316. package/esm/ui/filterMenuItems.js +13 -14
  317. package/esm/ui/index.d.ts +1 -1
  318. package/esm/ui/index.js +1 -1
  319. package/esm/ui/launchTargetsMenuItem.js +9 -13
  320. package/esm/ui/legendMenuItem.d.ts +4 -4
  321. package/esm/ui/legendMenuItem.js +4 -4
  322. package/esm/ui/menuItemAdornment.d.ts +1 -1
  323. package/esm/ui/menuItemAdornment.js +1 -1
  324. package/esm/ui/menuItems.d.ts +1 -1
  325. package/esm/ui/menuItems.js +1 -1
  326. package/esm/ui/menuLabels.d.ts +2 -2
  327. package/esm/ui/menuLabels.js +2 -2
  328. package/esm/ui/multiTrackMenuItems.d.ts +2 -2
  329. package/esm/ui/palette.d.ts +2 -2
  330. package/esm/ui/palette.js +10 -10
  331. package/esm/ui/radioSubMenu.d.ts +5 -3
  332. package/esm/ui/radioSubMenu.js +2 -2
  333. package/esm/ui/rampKey.d.ts +15 -0
  334. package/esm/ui/rampKey.js +17 -0
  335. package/esm/ui/showSubMenu.d.ts +0 -5
  336. package/esm/ui/showSubMenu.js +6 -15
  337. package/esm/ui/theme.d.ts +2 -2
  338. package/esm/ui/theme.js +1 -1
  339. package/esm/ui/useAssemblySelection.d.ts +2 -0
  340. package/esm/ui/useMouseTracking.d.ts +8 -20
  341. package/esm/ui/useMouseTracking.js +23 -62
  342. package/esm/ui/usePlacedMenuFocus.d.ts +19 -0
  343. package/esm/ui/usePlacedMenuFocus.js +28 -0
  344. package/esm/util/Base1DViewModel.d.ts +5 -3
  345. package/esm/util/Base1DViewModel.js +5 -3
  346. package/esm/util/SvgCanvas.js +1 -1
  347. package/esm/util/aggregateFieldName.d.ts +1 -10
  348. package/esm/util/aggregateFieldName.js +1 -8
  349. package/esm/util/alignedBytes.d.ts +19 -0
  350. package/esm/util/alignedBytes.js +37 -0
  351. package/esm/util/analytics.d.ts +6 -9
  352. package/esm/util/analytics.js +148 -15
  353. package/esm/util/bezierConnector.d.ts +20 -0
  354. package/esm/util/bezierConnector.js +34 -96
  355. package/esm/util/cacheBudgets.d.ts +3 -0
  356. package/esm/util/cacheBudgets.js +3 -0
  357. package/esm/util/categoricalField.d.ts +24 -4
  358. package/esm/util/categoricalField.js +38 -5
  359. package/esm/util/cellMatches.js +14 -14
  360. package/esm/util/cellsStep.d.ts +3 -5
  361. package/esm/util/cellsStep.js +31 -29
  362. package/esm/util/color/index.d.ts +1 -1
  363. package/esm/util/color/index.js +2 -2
  364. package/esm/util/color-bits/bit.js +1 -1
  365. package/esm/util/color-bits/parse.js +28 -17
  366. package/esm/util/colorBits.d.ts +15 -4
  367. package/esm/util/colorBits.js +38 -15
  368. package/esm/util/colorRamp.d.ts +3 -3
  369. package/esm/util/colorRamp.js +20 -2
  370. package/esm/util/colorScale.d.ts +123 -22
  371. package/esm/util/colorScale.js +157 -28
  372. package/esm/util/colorSchemes.d.ts +7 -3
  373. package/esm/util/colorSchemes.js +8 -2
  374. package/esm/util/createSvgRasterCanvas.d.ts +14 -1
  375. package/esm/util/createSvgRasterCanvas.js +36 -12
  376. package/esm/util/diagonalizeRegions.js +18 -9
  377. package/esm/util/featureTransforms.d.ts +2 -2
  378. package/esm/util/featureTransforms.js +85 -135
  379. package/esm/util/fileHandleStore.js +5 -0
  380. package/esm/util/groupKeys.d.ts +5 -4
  381. package/esm/util/groupKeys.js +15 -9
  382. package/esm/util/index.js +1 -1
  383. package/esm/util/installFetch.d.ts +2 -2
  384. package/esm/util/installPrerequisiteFetch.d.ts +8 -3
  385. package/esm/util/installPrerequisiteFetch.js +9 -7
  386. package/esm/util/io/RemoteFileWithRangeCache.d.ts +1 -1
  387. package/esm/util/io/RemoteFileWithRangeCache.js +1 -1
  388. package/esm/util/isoformRank.d.ts +39 -0
  389. package/esm/util/isoformRank.js +118 -0
  390. package/esm/util/jexl.js +1 -1
  391. package/esm/util/layouts/GranularRectLayout.d.ts +19 -3
  392. package/esm/util/layouts/GranularRectLayout.js +57 -34
  393. package/esm/util/leadingEdgeAutorun.d.ts +9 -1
  394. package/esm/util/leadingEdgeAutorun.js +5 -2
  395. package/esm/util/markEncoding.d.ts +10 -8
  396. package/esm/util/markEncoding.js +50 -12
  397. package/esm/util/markEncodingTypes.d.ts +77 -21
  398. package/esm/util/originCut.d.ts +14 -0
  399. package/esm/util/originCut.js +19 -0
  400. package/esm/util/paintLayer.d.ts +1 -1
  401. package/esm/util/paintLayer.js +4 -3
  402. package/esm/util/pathSeries.d.ts +18 -0
  403. package/esm/util/pathSeries.js +143 -0
  404. package/esm/util/pressOwner.d.ts +20 -0
  405. package/esm/util/pressOwner.js +26 -0
  406. package/esm/util/quantileExtent.d.ts +23 -1
  407. package/esm/util/quantileExtent.js +25 -2
  408. package/esm/util/rowStackGeometry.d.ts +1 -1
  409. package/esm/util/rowStackGeometry.js +1 -1
  410. package/esm/util/sessionActivity.d.ts +36 -0
  411. package/esm/util/sessionActivity.js +88 -0
  412. package/esm/util/stepOutputs.d.ts +165 -0
  413. package/esm/util/stepOutputs.js +201 -0
  414. package/esm/util/stepTables.d.ts +7 -3
  415. package/esm/util/stepTables.js +86 -3
  416. package/esm/util/systemColorScheme.d.ts +4 -0
  417. package/esm/util/systemColorScheme.js +21 -0
  418. package/esm/util/tabix.d.ts +1 -1
  419. package/esm/util/tabix.js +1 -1
  420. package/esm/util/temporaryAssembly.d.ts +2 -2
  421. package/esm/util/temporaryAssembly.js +2 -3
  422. package/esm/util/thresholdScale.d.ts +1 -1
  423. package/esm/util/thresholdScale.js +1 -1
  424. package/esm/util/trackConfigDelta.d.ts +1 -1
  425. package/esm/util/tracks.d.ts +25 -15
  426. package/esm/util/tracks.js +68 -44
  427. package/esm/util/types/index.d.ts +15 -7
  428. package/esm/util/types/index.js +21 -2
  429. package/esm/util/usePanZoom.js +4 -10
  430. package/esm/util/useRowVirtualScroll.d.ts +1 -0
  431. package/esm/util/windowStep.d.ts +6 -0
  432. package/esm/util/windowStep.js +153 -0
  433. package/package.json +27 -16
  434. package/esm/data_adapters/BaseAdapter/featureDensity.d.ts +0 -40
  435. package/esm/data_adapters/BaseAdapter/featureDensity.js +0 -31
  436. package/esm/rpc/methods/CoreGetFeatureDensity.d.ts +0 -11
  437. package/esm/rpc/methods/CoreGetFeatureDensity.js +0 -22
  438. package/esm/rpc/methods/CoreLoadAdapterCode.d.ts +0 -13
  439. package/esm/rpc/methods/CoreLoadAdapterCode.js +0 -16
@@ -6,26 +6,17 @@ import ConfigSlot, { slotWriteRefusal } from './configurationSlot.js';
6
6
  import { checkRequirements } from './requirements.js';
7
7
  import { getConfigurationSchemaMetadata, registerConfigurationSchema, } from './schemaRegistry.js';
8
8
  import { isConfigurationSchemaType, isConstantEntry, isSlotDefinitionEntry, shorthandTargetsOf, } from './schemaTypes.js';
9
- import { preProcessSnapshotWith } from './snapshotPreprocess.js';
9
+ import { preProcessSnapshotWith, refusingUndeclaredKeys, } from './snapshotPreprocess.js';
10
10
  function hookList(hook) {
11
11
  return hook === undefined ? [] : Array.isArray(hook) ? hook : [hook];
12
12
  }
13
- // base first, then child. Returns the single function unchanged when only one
14
- // side declares the hook, so the common case never allocates a chain.
15
13
  function chainHooks(base, child) {
16
14
  return base && child
17
15
  ? [...hookList(base), ...hookList(child)]
18
16
  : (child ?? base);
19
17
  }
20
- /**
21
- * Fold a subclass's schema definition over its `baseConfiguration`'s. New slots
22
- * are added and sub-schema entries replaced wholesale, but a slot the subclass
23
- * **redeclares merges field-by-field over the base's** — so an override states
24
- * only what actually differs and inherits the rest. (`type` comes along
25
- * regardless: it is what marks an entry as a slot rather than a nested
26
- * sub-schema, per `isSlotDefinitionEntry`.) The cases are pinned by the
27
- * "baseConfiguration slot override merge" tests.
28
- */
18
+ // A redeclared slot merges field-by-field over the base's, so an override states
19
+ // only what differs; a sub-schema or a constant is replaced whole.
29
20
  function mergeSchemaDefinition(baseDefinition, childDefinition) {
30
21
  const merged = {
31
22
  ...baseDefinition,
@@ -33,8 +24,6 @@ function mergeSchemaDefinition(baseDefinition, childDefinition) {
33
24
  };
34
25
  for (const [slot, childEntry] of Object.entries(childDefinition)) {
35
26
  const baseEntry = baseDefinition[slot];
36
- // both sides must be slot definitions: a sub-schema (or a constant) is an
37
- // opaque entry with no fields to fold, so it keeps replace semantics
38
27
  if (isSlotDefinitionEntry(baseEntry) && isSlotDefinitionEntry(childEntry)) {
39
28
  merged[slot] = { ...baseEntry, ...childEntry };
40
29
  }
@@ -58,32 +47,19 @@ function preprocessConfigurationSchemaArguments(modelName, inputSchemaDefinition
58
47
  if (typeof modelName !== 'string') {
59
48
  throw new Error('first arg must be string name of the model that this config schema goes with');
60
49
  }
61
- // if we have a base configuration schema that we are
62
- // extending, grab the slot definitions from that
63
50
  let schemaDefinition = inputSchemaDefinition;
64
51
  let options = inputOptions;
65
52
  const baseMeta = inputOptions.baseConfiguration
66
53
  ? getConfigurationSchemaMetadata(inputOptions.baseConfiguration)
67
54
  : undefined;
68
- // A base with no registry entry used to be skipped in silence, producing a
69
- // schema missing every inherited slot with nothing thrown anywhere, and
70
- // reachable without doing anything obviously wrong:
71
- // `pluginManager.pluggableConfigSchemaType(…)` hands back a `types.union`,
72
- // which carries no slot table of its own.
73
55
  if (inputOptions.baseConfiguration && !baseMeta) {
74
56
  throw new Error(`${modelName}'s baseConfiguration is not a configuration schema: it has no registered slot table, so every slot it was meant to inherit would be dropped silently. Pass the type ConfigurationSchema() returned, not a union (pluginManager.pluggableConfigSchemaType) or a plain MST model.`);
75
57
  }
76
58
  if (baseMeta) {
77
59
  schemaDefinition = mergeSchemaDefinition(baseMeta.definition, schemaDefinition);
78
- // Everything else merges as a shallow `{...base, ...child}` spread, where
79
- // the child's value replaces the base's. The four hooks, `requires` and
80
- // `retired` must not: `createBaseTrackConfig` alone declares two of the hooks, so
81
- // replace-semantics meant no track config schema could ever declare its
82
- // own without silently dropping display-stub injection and the legacy-key
83
- // migration, and a subclass stating one requirement would have dropped
84
- // every one its base stated. They compose instead, base first, and
85
- // `retired` merges per key so a subclass adds a spelling without dropping
86
- // the ones its base retired. See MergedConfigurationSchemaOptions.
60
+ // The hooks, `requires` and `retired` compose, base first, where every
61
+ // other option is replaced by the child's: a track schema's own
62
+ // preProcessSnapshot must not drop the base's display-stub injection.
87
63
  const basePreProcess = baseMeta.options.preProcessSnapshot;
88
64
  const childPreProcess = inputOptions.preProcessSnapshot;
89
65
  const requires = [
@@ -106,10 +82,12 @@ function preprocessConfigurationSchemaArguments(modelName, inputSchemaDefinition
106
82
  requires: requires.length ? requires : undefined,
107
83
  };
108
84
  }
85
+ if (options.explicitlyTyped && options.explicitIdentifier === 'displayId') {
86
+ options = { ...options, closed: options.closed ?? true };
87
+ }
109
88
  return { schemaDefinition, options };
110
89
  }
111
90
  function makeConfigurationSchemaModel(modelName, schemaDefinition, options) {
112
- // now assemble the MST model of the configuration schema
113
91
  const modelDefinition = {};
114
92
  if (options.explicitlyTyped) {
115
93
  modelDefinition.type = types.optional(types.literal(modelName), modelName);
@@ -118,30 +96,18 @@ function makeConfigurationSchemaModel(modelName, schemaDefinition, options) {
118
96
  if (identifier) {
119
97
  modelDefinition[identifier] = types.identifier;
120
98
  }
121
- // String/number entries in the schema definition become volatile instance
122
- // constants (read via `model.someName`). Per-slot metadata lives in the
123
- // schema registry (a WeakMap keyed by the MST type, see schemaRegistry.ts),
124
- // not on the instance.
125
99
  const volatileConstants = {};
126
- // The members `setSubschema` replaces: a single sub-schema, swapped for a
127
- // node built from the data, or a collection of them, assigned whole so MST
128
- // reconciles the entries. Collected as the loop classifies each entry.
129
100
  const subSchemaKeys = new Set();
130
101
  const collectionKeys = new Set();
131
- // The actual slots, which is a strictly smaller set than `modelDefinition`:
132
- // that also holds the sub-schema properties and the identifier, neither of
133
- // which setSlot may write. Same collect-as-you-classify as subSchemaKeys.
102
+ // narrower than `modelDefinition`, which also holds the identifier and the
103
+ // sub-schemas, neither of which setSlot may write
134
104
  const slotKeys = new Set();
135
- const storesNull = new Set();
136
105
  const featureFields = new Set();
137
106
  const takesNoCallback = new Map();
138
107
  for (const [slotName, slotDefinition] of Object.entries(schemaDefinition)) {
139
108
  if (isConfigurationSchemaType(slotDefinition)) {
140
- // a sub-configuration. A bare sub-schema is already stripDefault-wrapped
141
- // (so it strips when all-default); an array/map of sub-schemas gets
142
- // wrapped so an empty collection is likewise omitted from the snapshot,
143
- // unless it is wrapped in a default of its own: a display built on
144
- // another names its own default plot that way.
109
+ // an empty collection strips from the snapshot as an all-default
110
+ // sub-schema does, unless it names a default of its own
145
111
  if (isArrayType(slotDefinition) || isMapType(slotDefinition)) {
146
112
  modelDefinition[slotName] = isOptionalType(slotDefinition)
147
113
  ? slotDefinition
@@ -157,13 +123,9 @@ function makeConfigurationSchemaModel(modelName, schemaDefinition, options) {
157
123
  volatileConstants[slotName] = slotDefinition;
158
124
  }
159
125
  else if (isSlotDefinitionEntry(slotDefinition)) {
160
- // slotDefinition is narrowed to ConfigSlotDefinition here (no cast)
161
126
  slotKeys.add(slotName);
162
127
  try {
163
128
  modelDefinition[slotName] = ConfigSlot(slotDefinition);
164
- if (modelDefinition[slotName].is(null)) {
165
- storesNull.add(slotName);
166
- }
167
129
  if (slotDefinition.type === 'featureField') {
168
130
  featureFields.add(slotName);
169
131
  }
@@ -176,8 +138,6 @@ function makeConfigurationSchemaModel(modelName, schemaDefinition, options) {
176
138
  }
177
139
  }
178
140
  else if (typeof slotDefinition === 'object') {
179
- // an object that's neither a sub-schema nor a slot is almost always a
180
- // slot definition missing its required `type` field
181
141
  throw new Error(`no type set for config slot ${modelName}.${slotName}`);
182
142
  }
183
143
  else {
@@ -188,16 +148,17 @@ function makeConfigurationSchemaModel(modelName, schemaDefinition, options) {
188
148
  checkShorthand(modelName, schemaDefinition, options.shorthand);
189
149
  let completeModel = types
190
150
  .model(`${modelName}ConfigurationSchema`, modelDefinition)
191
- // annotated so `ConfigurationSchemaType['Type']`, which has to name these
192
- // two by hand (the model's own props are a `Record<string, any>`, so
193
- // nothing derived off them keeps a signature), cannot drift from them
151
+ // annotated so `ConfigurationSchemaType['Type']`, which names these by
152
+ // hand, cannot drift from them
194
153
  .actions((self) => ({
195
- // Replace a sub-schema member whole. `data` is whatever the sub-schema's
196
- // `preProcessSnapshot` takes, a string shorthand included; for a
197
- // collection it is the whole list or map, and `null` resets it to its
198
- // default, empty unless the collection names one.
154
+ // `data` is whatever the sub-schema's preProcessSnapshot takes; a
155
+ // collection takes the whole list or map, and `null` resets it
199
156
  setSubschema(slotName, data) {
200
157
  if (collectionKeys.has(slotName)) {
158
+ // checked on a copy, since the assignment runs patch listeners
159
+ if (data != null && !isStateTreeNode(data)) {
160
+ refusingUndeclaredKeys(() => modelDefinition[slotName].create(data));
161
+ }
201
162
  self[slotName] = data ?? undefined;
202
163
  return self[slotName];
203
164
  }
@@ -206,32 +167,16 @@ function makeConfigurationSchemaModel(modelName, schemaDefinition, options) {
206
167
  }
207
168
  const newSchema = isStateTreeNode(data)
208
169
  ? data
209
- : modelDefinition[slotName].create(data);
170
+ : refusingUndeclaredKeys(() => modelDefinition[slotName].create(data));
210
171
  self[slotName] = newSchema;
211
172
  return newSchema;
212
173
  },
213
- // generic slot setter the config editor's slot facade routes through. A
214
- // slot is a bare value-union property, so this is a plain assignment,
215
- // save an array, which `refillArray` writes.
216
- //
217
- // **Don't weaken the membership check to a warning, and don't check
218
- // against `modelDefinition`** — that also holds the identifier and the
219
- // sub-schema properties, neither of which is a write this action is for.
220
- // Slot-name safety is a write guard (ADR-052); `setSlot`'s tests in
221
- // `configurationSchema.test.ts` pin both halves. `slotKeys` already has
222
- // base-schema slots merged in, so an inherited slot passes.
223
- // `null` resets, the same thing `undefined` does, because a JSON-borne
224
- // caller cannot spell `undefined`: a session spec, share link or agent
225
- // call can set a slot and then has no way to put it back. Omitting the
226
- // key is not that — this action is the merge path, where an absent key
227
- // means "leave it alone". A sub-schema reads `null` the same way, and
228
- // no slot stores `null` as a value.
174
+ // The name check is a write guard (ADR-052), never a warning. `null`
175
+ // resets, as `undefined` does, since JSON cannot spell `undefined`
176
+ // (ADR-146).
229
177
  setSlot(slotName, rawValue) {
230
178
  const value = rawValue ?? undefined;
231
179
  if (!slotKeys.has(slotName)) {
232
- // the sub-schema branch re-classifies off the definition rather than
233
- // carrying a second Set: it runs only on the way to a throw, and the
234
- // predicate is the same one the loop above classified with
235
180
  throw new Error(isConfigurationSchemaType(schemaDefinition[slotName])
236
181
  ? `${slotName} is a sub-schema on ${modelName}, not a config slot — replace it with setSubschema`
237
182
  : `${modelName} has no config slot "${slotName}". Valid slots: ${[
@@ -240,10 +185,7 @@ function makeConfigurationSchemaModel(modelName, schemaDefinition, options) {
240
185
  .sort()
241
186
  .join(', ')}`);
242
187
  }
243
- // MST skips its own type check in a production build, and a value the
244
- // slot's union cannot take is then dropped with no throw: the write
245
- // reported success and the slot kept its old value. `is` still runs
246
- // there, so the guard holds in both builds.
188
+ // MST skips its own type check in a production build; `is` does not
247
189
  if (!modelDefinition[slotName].is(value)) {
248
190
  const declared = schemaDefinition[slotName];
249
191
  const slotType = isSlotDefinitionEntry(declared)
@@ -263,8 +205,6 @@ function makeConfigurationSchemaModel(modelName, schemaDefinition, options) {
263
205
  if (Object.keys(volatileConstants).length) {
264
206
  completeModel = completeModel.volatile(( /* self */) => volatileConstants);
265
207
  }
266
- // one MST call per entry, base's before the subclass's — chaining is what
267
- // makes the base's members visible on `self` inside the subclass's function
268
208
  for (const hook of hookList(options.actions)) {
269
209
  completeModel = completeModel.actions(hook);
270
210
  }
@@ -278,7 +218,6 @@ function makeConfigurationSchemaModel(modelName, schemaDefinition, options) {
278
218
  name: modelName,
279
219
  definition: schemaDefinition,
280
220
  options,
281
- storesNull,
282
221
  featureFields,
283
222
  takesNoCallback,
284
223
  };
@@ -287,18 +226,15 @@ function makeConfigurationSchemaModel(modelName, schemaDefinition, options) {
287
226
  const modelDefault = options.explicitlyTyped
288
227
  ? { type: modelName, ...identifierDefault }
289
228
  : identifierDefault;
290
- // stripDefault (not optional) so a nested all-default sub-schema is omitted
291
- // from its parent's snapshot: the slot props strip themselves, the sub-schema
292
- // collapses to its default, and the parent's stripDefault drops the key.
229
+ // stripDefault, not optional, so an all-default sub-schema leaves its
230
+ // parent's snapshot
293
231
  registerConfigurationSchema(completeModel, metadata);
294
232
  return types.stripDefault(completeModel, modelDefault);
295
233
  }
296
- // Assigning an array makes MST reconcile it, scanning ahead for a node to reuse
297
- // at each mismatch: seconds for a reorder of 5,000 row names. A slot array
298
- // holds scalars, so no reused node keeps anything of its own, and emptying and
299
- // refilling it takes 50 ms for the 5,000. spliceWithArray, since spreading into
300
- // `push` overflows the stack past about 120,000 names. An unchanged array is
301
- // left alone, so it fires no observer.
234
+ // Assigning an array makes MST reconcile it entry by entry, seconds for a
235
+ // reorder of 5,000 row names; refilling a scalar array takes 50 ms.
236
+ // spliceWithArray, since spreading into `push` overflows the stack past about
237
+ // 120,000 entries.
302
238
  function refillArray(held, value) {
303
239
  if (held.length !== value.length || held.some((v, i) => v !== value[i])) {
304
240
  held.clear();
@@ -309,39 +245,22 @@ export function ConfigurationSchema(modelName, inputSchemaDefinition, inputOptio
309
245
  const { schemaDefinition, options } = preprocessConfigurationSchemaArguments(modelName, inputSchemaDefinition, inputOptions);
310
246
  return makeConfigurationSchemaModel(modelName, schemaDefinition, options);
311
247
  }
312
- // The frozen -> live half of TrackConfigurationReference's `get`, shared with
313
- // hydrateTrackConfig below so there is one hydration rather than two that can
314
- // drift on which env they build with. The memo it goes through belongs to the
315
- // PluginManager instance (ADR-031): a node built with one instance's env must
316
- // never be handed to another, and `pluginManager.hydratedTrackConfig` scopes
317
- // that structurally rather than by convention.
248
+ // memoized per PluginManager, so a node never crosses to another instance's env
249
+ // (ADR-031)
318
250
  function hydrateInto(pluginManager, schemaType, frozen) {
319
251
  return pluginManager.hydratedTrackConfig(schemaType, frozen, () => schemaType.create(frozen, { pluginManager }));
320
252
  }
321
253
  /**
322
254
  * #api core/configuration
323
- * Hydrate a plain track config into a live config node, dispatching on its
324
- * `type` to find the schema. `session.tracks` holds `types.frozen` plain
325
- * objects until something references a track (ADR-031). One of those holds only
326
- * what was literally authored: a slot at its schema default is absent,
327
- * `preProcessSnapshot` has not run, and nothing that walks a live node applies
328
- * to it.
329
- *
330
- * Use it where a caller needs the resolved config and may be handed either
331
- * form. The About dialog's "Copy config" is reached from two menus, and one of
332
- * them passes a `session.tracks` entry.
333
- *
334
- * Returns **undefined** when the config names a track type no plugin
335
- * registered, or when `create` rejects it as invalid. An un-hydrated config has
336
- * never been validated, so the dialog opening over it should not throw. Callers
337
- * fall back to using the plain object.
255
+ * Hydrate a plain track config, such as a `session.tracks` entry, into a live
256
+ * config node, dispatching on its `type` to find the schema. A plain entry
257
+ * holds only what was authored: a slot at its default is absent and
258
+ * `preProcessSnapshot` has not run.
338
259
  *
339
- * Shares `TrackConfigurationReference`'s per-PluginManager cache, so hydrating
340
- * the same entry twice returns the same node, and in an admin session a track
341
- * opened later resolves to that same node. A non-admin's open track
342
- * resolves to the session's private working copy (ADR-032), and this function
343
- * returns the pristine mirror beside it. The two have the same content;
344
- * `CopyConfigEntryPoints.test.ts` tests both cases.
260
+ * Returns **undefined** when no plugin registered the type or `create` rejects
261
+ * the config, which has never been validated; callers fall back to the plain
262
+ * object. Hydrating one entry twice returns one node. A shown track resolves to
263
+ * the session's working copy instead (ADR-032), which has the same content.
345
264
  */
346
265
  export function hydrateTrackConfig(pluginManager, config) {
347
266
  const type = config.type;
@@ -349,10 +268,6 @@ export function hydrateTrackConfig(pluginManager, config) {
349
268
  return undefined;
350
269
  }
351
270
  try {
352
- // getTrackType throws on an unregistered name rather than returning
353
- // undefined, so it is inside the guard with `create` — the two failures are
354
- // the same failure (nothing here can build this config) and neither should
355
- // reach a dialog that is only trying to show it
356
271
  const { configSchema } = pluginManager.getTrackType(type);
357
272
  return hydrateInto(pluginManager, configSchema, config);
358
273
  }
@@ -361,52 +276,24 @@ export function hydrateTrackConfig(pluginManager, config) {
361
276
  return undefined;
362
277
  }
363
278
  }
364
- // A slot holding either an id string (resolved through `ref`) or a full inline
365
- // config snapshot (held as a standalone schema instance). Both reference kinds
366
- // resolve to `schemaType` instances, so MST can't auto-dispatch on the instance
367
- // side — the explicit snapshot dispatcher (string → ref, object → schema)
368
- // disambiguates. Shared by TrackConfigurationReference/DisplayConfigurationReference,
369
- // and by neither accident nor oversight NOT by the plain branch — see the note
370
- // on it in `ConfigurationReference`.
371
- //
372
- // One consequence, because both refs' `set` callbacks read as if it were not
373
- // true: assigning a config **node** here does not store a reference to it. The
374
- // dispatcher sees a non-string and picks `schemaType`, so MST tries to adopt the
375
- // node as an inline child — which throws if it already has a parent. `set` is
376
- // therefore unreachable on both refs (checked by making it throw: 231 suites
377
- // stayed green), and exists only because MST rejects a custom reference
378
- // declaring `get` without it. The plain branch, with no dispatcher, does the
379
- // opposite and stores the reference.
279
+ // An id string resolves through `ref`; an object is an inline config. So
280
+ // assigning a node here adopts it as a child rather than storing a reference,
281
+ // which makes both refs' `set` unreachable: MST only requires one beside `get`.
380
282
  function idOrSnapshotUnion(ref, schemaType) {
381
283
  return types.union({
382
284
  dispatcher: snapshot => (typeof snapshot === 'string' ? ref : schemaType),
383
285
  }, ref, schemaType);
384
286
  }
385
287
  /**
386
- * Reference to a track configuration. Snapshot output is the trackId string.
387
- *
388
- * One load-bearing complication: **`types.union(trackRef, schemaType)` accepts a
389
- * string id OR a full config.** A view that synthesizes a track nobody else can
390
- * draw — a read-vs-ref synteny band, an SV inspector row, a circular view's
391
- * added track — writes the config here rather than registering it in
392
- * `session.tracks`, and it then lives and dies with the track that holds it.
393
- * `ReadVsRef.test.tsx` and `SVInspector.test.tsx` are the canaries.
394
- *
395
- * NOTE: don't add `as SCHEMATYPE` to the return value. It narrows SnapshotIn
396
- * to just the object branch, forcing callers to wrap string ids in
397
- * `@ts-expect-error`. The inferred union SnapshotIn is `string | SnapshotIn<schema>`.
288
+ * Reference to a track configuration, snapshotted as its trackId. It also takes
289
+ * a whole config: a view's synthesized track (a read-vs-ref band, an SV
290
+ * inspector row) holds its config inline and lives and dies with it. ADR-084.
398
291
  */
399
292
  function TrackConfigurationReference(schemaType) {
400
293
  const trackRef = types.reference(schemaType, {
401
294
  get(id, parent) {
402
295
  const session = getSession(parent);
403
296
  const trackId = String(id);
404
- // Per-id lookup: subscribes only to this trackId's derivation, so
405
- // resolving one track's config doesn't re-render the others. A session
406
- // with track deltas hands back a private, per-track working copy so a
407
- // shown track's in-place quick-edits mutate that copy and never the
408
- // shared frozen base (ADR-032); any other session falls through to the
409
- // frozen hydration cache (ADR-031).
410
297
  const ret = isSessionWithEditableTrackConfig(session)
411
298
  ? session.getEditableTrackConfig(trackId, schemaType)
412
299
  : session.getTrackById(trackId);
@@ -424,52 +311,19 @@ function TrackConfigurationReference(schemaType) {
424
311
  return idOrSnapshotUnion(trackRef, schemaType);
425
312
  }
426
313
  /**
427
- * Reference to a display configuration. Looked up inside the containing track
428
- * config's `displays` array. Snapshot output is the displayId string.
429
- *
430
- * Resolution order:
431
- * 1. by displayId
432
- * 2. by `parent.type` — handles old sessions where the saved displayId
433
- * no longer matches but a display of the same type exists on the track
434
- *
435
- * Step 2 is the safety net because `baseTrackConfig.preProcessSnapshot`
436
- * already injects a stub display for every registered displayType on the
437
- * track, so a same-type lookup always succeeds at runtime for properly
438
- * loaded tracks. It is what carries a **renamed display type** across for a
439
- * catalog track: the injected stub is named for the new type, the display
440
- * model's own `preProcessSnapshot` rewrites the state model's, and the saved
441
- * `configuration` id still spells the old name, so only the type match
442
- * reconnects them. Not every pre-rename session reaches it — a track config
443
- * that itself declares the old display entry keeps that entry's `displayId`
444
- * through the alias rewrite (`{ ...d, type: canonical }`) and wins the
445
- * first-wins dedupe, so its session resolves by id. An older third step
446
- * auto-created a *detached* config when neither matched — that produced an
447
- * orphaned MST node whose edits silently didn't persist. Removed in favor of a
448
- * clear throw.
449
- *
450
- * The union's schemaType branch is symmetry with `TrackConfigurationReference`
451
- * rather than a path anything in tree takes: the two production writers,
452
- * `showTrackGeneric` and `BaseTrackModel.replaceDisplay`, both write a
453
- * displayId string, because a display config belongs in its track config's
454
- * `displays` array. It stays because it costs nothing and because dropping it
455
- * narrows `SnapshotIn` for every caller.
314
+ * Reference to a display configuration in the containing track config's
315
+ * `displays`, snapshotted as its displayId. An id that matches nothing falls
316
+ * back to the display of the parent's type, which the track config always
317
+ * holds a stub of: that is what reconnects a session saved before a display
318
+ * type was renamed.
456
319
  */
457
320
  function DisplayConfigurationReference(schemaType) {
458
321
  const displayRef = types.reference(schemaType, {
459
322
  get(id, parent) {
460
- // track.configuration is a hydrated MST node (hydrated lazily via
461
- // TrackConfigurationReference), so its displays array contains MST nodes.
462
323
  const track = getContainingTrack(parent);
463
324
  const displays = track.configuration.displays;
464
325
  const displayType = parent.type;
465
326
  let ret = displays.find(d => d.displayId === id);
466
- // Fallback: match by display type when the displayId isn't found.
467
- // baseTrackConfig.preProcessSnapshot injects a display entry for every
468
- // registered displayType for the track, so id-mismatch (e.g. an old
469
- // session with a different displayId convention) finds a same-type
470
- // entry here. The `if (displayType)` guard prevents an undefined
471
- // parent.type from silently matching a display whose `.type` is also
472
- // undefined.
473
327
  if (!ret && displayType) {
474
328
  ret = displays.find(d => d.type === displayType);
475
329
  }
@@ -486,21 +340,10 @@ function DisplayConfigurationReference(schemaType) {
486
340
  return idOrSnapshotUnion(displayRef, schemaType);
487
341
  }
488
342
  /**
489
- * Dispatch by the schema's identifier: `trackId` → track-ref (resolves through
490
- * `session.getTrackById`), `displayId` → display-ref (resolves through the
491
- * parent track's displays array), anything else → plain reference.
492
- *
493
- * Display schemas must declare `explicitIdentifier: 'displayId'` (directly or
494
- * via `baseConfiguration: baseLinearDisplayConfigSchema`, which merges its
495
- * options through `preprocessConfigurationSchemaArguments`).
496
- *
497
- * The return is annotated `IConfigurationReference<SCHEMATYPE>` (see its doc)
498
- * so `self.configuration` carries the concrete schema. The three runtime
499
- * branches produce MST reference/union types over `schemaType` that are
500
- * assignable to that annotation, so `return ref` needs no cast — and must not
501
- * get one: a prior `as SCHEMATYPE` was dropped because it narrowed `SnapshotIn`
502
- * to just the object branch and forced callers pushing string ids to
503
- * `@ts-expect-error` (see `TrackConfigurationReference`'s note).
343
+ * A reference resolved by the schema's identifier: a `trackId` through the
344
+ * session, a `displayId` through the containing track's `displays`, anything
345
+ * else by MST's own identifier lookup. No `as SCHEMATYPE` on the return: it
346
+ * would narrow `SnapshotIn` to the object branch and refuse a string id.
504
347
  */
505
348
  export function ConfigurationReference(schemaType) {
506
349
  const id = getConfigurationSchemaMetadata(schemaType)?.options.explicitIdentifier;
@@ -508,17 +351,8 @@ export function ConfigurationReference(schemaType) {
508
351
  ? TrackConfigurationReference(schemaType)
509
352
  : id === 'displayId'
510
353
  ? DisplayConfigurationReference(schemaType)
511
- : // Plain (non-track/display) ref — internet accounts, connections —
512
- // resolved by MST's own identifier lookup rather than through the
513
- // session. **Deliberately not `idOrSnapshotUnion`**, even though it is
514
- // the same two members: this branch is also handed a *live, in-tree*
515
- // config node (`initializeInternetAccount` pushes
516
- // `jbrowse.internetAccounts[i]` straight through), and an undispatched
517
- // union sends that to the reference member because
518
- // `BaseReferenceType.isAssignableFrom` defers to its target type. A
519
- // `typeof snapshot === 'string'` dispatcher sends it to the schema
520
- // member instead, and MST refuses to adopt a node that already has a
521
- // parent. `InternetAccounts.test.ts` is the canary.
354
+ : // not idOrSnapshotUnion: this branch is handed live in-tree nodes
355
+ // (an internet account), which its dispatcher would try to adopt
522
356
  types.union(types.reference(schemaType), schemaType);
523
357
  return ref;
524
358
  }
@@ -27,7 +27,8 @@ export type ConfigurationSchemaUnionType<MEMBERS extends Record<string, AnyConfi
27
27
  * member, and a `type` naming no member is refused in every build — where a
28
28
  * bare `types.union` would load it as its first member. Each member is an
29
29
  * `explicitlyTyped`, `closed` schema named by its key, so a key belonging to
30
- * another member is refused rather than dropped; one that is not throws here.
30
+ * another member is named on a load and refused on a write rather than
31
+ * dropped; one that is not throws here.
31
32
  */
32
33
  export declare function ConfigurationSchemaUnion<const MEMBERS extends Record<string, AnyConfigurationSchemaType>>(name: string, members: MEMBERS): ConfigurationSchemaUnionType<MEMBERS>;
33
34
  /**
@@ -21,7 +21,8 @@ function memberRefusal(key, member) {
21
21
  * member, and a `type` naming no member is refused in every build — where a
22
22
  * bare `types.union` would load it as its first member. Each member is an
23
23
  * `explicitlyTyped`, `closed` schema named by its key, so a key belonging to
24
- * another member is refused rather than dropped; one that is not throws here.
24
+ * another member is named on a load and refused on a write rather than
25
+ * dropped; one that is not throws here.
25
26
  */
26
27
  export function ConfigurationSchemaUnion(name, members) {
27
28
  for (const [key, member] of Object.entries(members)) {
@@ -261,29 +261,15 @@ declare const slotTypes: {
261
261
  fallbackDefault: {};
262
262
  };
263
263
  };
264
- /**
265
- * The builtin table's own names — every slot type whose MST model this module
266
- * supplies, so excluding the two enum types. Exported for `SlotValueByType` in
267
- * `types.ts`, which has to name the same set and is checked against this.
268
- */
264
+ /** the types whose model this module supplies; `SlotValueByType` names the same set */
269
265
  export type BuiltinSlotTypeName = keyof typeof slotTypes;
270
266
  declare const ENUM_SLOT_TYPES: readonly ['stringEnum', 'maybeStringEnum', 'stringEnumArray'];
271
267
  /**
272
- * Every legal `type` on a slot definition: the builtin table's own names, plus
273
- * the enum types.
274
- *
275
- * Closed on purpose. A name outside this set still *works* at runtime as long
276
- * as a `model` is given — which is exactly the trap: the value round-trips
277
- * fine, and the only symptom is that everything keyed off the type name stops
278
- * recognising the slot (`slotFacade` hands the editor no `choices`, so an enum
279
- * renders as a free text box).
268
+ * Every legal `type` on a slot definition. Closed, since a name outside it
269
+ * would still load with a `model` given, and every surface keyed on the name
270
+ * would stop recognising the slot.
280
271
  */
281
272
  export type ConfigSlotType = keyof typeof slotTypes | (typeof ENUM_SLOT_TYPES)[number];
282
- /**
283
- * The same set as `MAYBE_TYPES`, at the type level, and derived from the same
284
- * property of the same table so the two cannot disagree: an entry with no
285
- * `fallbackDefault` is one whose fixed form is "unset".
286
- */
287
273
  type MaybeBuiltinSlotTypeName = {
288
274
  [K in keyof typeof slotTypes]: 'fallbackDefault' extends keyof (typeof slotTypes)[K] ? never : K;
289
275
  }[keyof typeof slotTypes];
@@ -301,31 +287,19 @@ interface ConfigSlotDefinitionCommon {
301
287
  */
302
288
  contextVariable?: string[];
303
289
  /**
304
- * hide this slot behind a "Show advanced settings" toggle in the config
305
- * editor, so common slots aren't crowded out by rarely-changed ones
290
+ * put this slot behind a toggle so common slots aren't crowded out by
291
+ * rarely-changed ones: "Show advanced settings" in the config editor, and
292
+ * the collapsed Advanced card in a track's About dialog, which also takes
293
+ * every slot with a `contextVariable`
306
294
  */
307
295
  advanced?: boolean;
308
296
  }
309
297
  /**
310
- * A slot definition, split on whether the slot's type spends `undefined` on
311
- * "unset". The type-level twin of `ConfigSlot`'s
312
- * `defaultValue === undefined && !MAYBE_TYPES.has(type)` throw, which used to be
313
- * the only statement of the rule: a `maybe*` slot has exactly one legal
314
- * `defaultValue`, so requiring the field of every slot alike made 81 slots
315
- * across the repo carry a `defaultValue: undefined` line that said nothing.
316
- *
317
- * A `maybe*` slot's only legal `defaultValue` is the sentinel itself, but the
318
- * field stays `unknown` rather than being pinned to `undefined`: the spread in
319
- * `mergeSchemaDefinition` combines a base and a child whose halves may disagree,
320
- * so pinning it forces a cast through the one place slot definitions are
321
- * combined. `ConfigSlot` throws on a concrete one instead — and has to anyway,
322
- * since no type can see what a `baseConfiguration` merged in, which is the way
323
- * this mistake actually happens.
324
- *
325
- * Stating the sentinel stays meaningful in a subclass override, where the merge
326
- * is a spread and an omitted key inherits the base's value. The same spread is
327
- * why an enum slot's `model` stays optional here though `ConfigSlot` requires
328
- * one: a subclass restating only the default inherits the vocabulary.
298
+ * A slot definition: a `maybe*` type's `defaultValue` is optional, every
299
+ * other's required. A `maybe*` default stays `unknown` rather than `undefined`
300
+ * because a subclass override is spread over its base's, which no type can see;
301
+ * `ConfigSlot` throws on a concrete one. An enum's `model` is optional for the
302
+ * same spread: an override restating only the default inherits the vocabulary.
329
303
  */
330
304
  export type ConfigSlotDefinition = (ConfigSlotDefinitionCommon & {
331
305
  /** a `maybe*` slot type, whose unset state is `undefined` */
@@ -339,33 +313,13 @@ export type ConfigSlotDefinition = (ConfigSlotDefinitionCommon & {
339
313
  defaultValue: unknown;
340
314
  });
341
315
  /**
342
- * A configuration slot is a plain MST property holding the slot's value type,
343
- * or, where the slot declares a `contextVariable`, that or a `jexl:...`
344
- * callback string. Every other slot refuses a `jexl:` string, so a callback
345
- * the reader would evaluate is one the schema says it takes. A `featureField`
346
- * holds a `jexl:` expression as its value, which the display evaluates per
347
- * feature. The value lives directly on the parent configuration model — there
348
- * is no per-slot sub-model. `types.stripDefault` omits the property from the
349
- * parent snapshot when it equals the default, so saved sessions stay minimal.
350
- * Per-slot metadata (type/description/defaultValue/contextVariable) lives in
351
- * the schema registry (a WeakMap keyed by the MST type, see
352
- * schemaRegistry.ts); jexl callbacks are evaluated on read by
353
- * `readConfObject`.
354
- *
355
- * Interning the returned type on `(type, model, defaultValue)` was prototyped
356
- * and declined: a session builds 1197 slot types for 222 distinct ones, and
357
- * removing the repeats moves neither the time nor the heap
358
- * (`config-schema-construction`, published in `reference/EAGER_BUNDLE.md`).
316
+ * The MST property a slot is: its value type, or that or a `jexl:` callback
317
+ * where the slot declares a `contextVariable` (ADR-155), stripped from the
318
+ * snapshot at its default. Interning these was measured and declined
319
+ * (`config-schema-construction` in `reference/EAGER_BUNDLE.md`).
359
320
  */
360
321
  export default function ConfigSlot(definition: ConfigSlotDefinition): import("@jbrowse/mobx-state-tree").IOptionalIType<IAnyType, [undefined]>;
361
- /**
362
- * New value when converting a fixed-value slot to a jexl callback. Already-
363
- * callback values are returned unchanged.
364
- *
365
- * A single JSON.stringify covers every type: `jexl:${42}` and
366
- * `jexl:${JSON.stringify(42)}` are identical for numbers/booleans, and the rest
367
- * need the quoting/serialization anyway.
368
- */
322
+ /** A fixed value as the `jexl:` callback that returns it. */
369
323
  export declare function toCallbackValue(value: unknown): string;
370
324
  /**
371
325
  * New value when converting a jexl callback back to a fixed value: try