@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
@@ -1,7 +1,10 @@
1
1
  import { getSnapshot, getType, isArrayType, isStateTreeNode, } from '@jbrowse/mobx-state-tree';
2
2
  import { compareStructural } from 'mobx';
3
+ import { colorProblems, colorSlotsOf, noticeLines, scaleEndProblems, scaleEndsOf, withImpliedField, } from '../util/colorScale.js';
4
+ import { readConfObject } from './readConfObject.js';
3
5
  import { getConfigurationSchemaMetadata } from './schemaRegistry.js';
4
6
  import { bareFormOf, shorthandTargets } from './schemaTypes.js';
7
+ import { refusingUndeclaredKeys } from './snapshotPreprocess.js';
5
8
  /**
6
9
  * #api core/configuration
7
10
  * The grammar's settings, by the slot name every display that has one gives
@@ -9,20 +12,30 @@ import { bareFormOf, shorthandTargets } from './schemaTypes.js';
9
12
  * display's `plot`. A display's plot is the ones its config declares
10
13
  * (`plotKeysOf`).
11
14
  */
15
+ // The multi-row display's `rowGroups` is not here yet; it joins when "Edit
16
+ // plot..." should show the row grouping.
12
17
  export const PLOT_VOCABULARY = {
13
18
  marks: 'the marks drawn in order, each a mark and an encoding',
19
+ mark: 'the shape each value is drawn as: a bar, a point, a line or a span',
20
+ interpolate: 'the path a line takes between values: held across each bin, or centre to centre',
21
+ aggregate: 'the stored zoom-bin summary drawn: mean, min or max',
22
+ extent: "the span drawn around each bin's aggregate: its min to max, or none",
14
23
  transform: 'the steps run over the features before any mark',
24
+ unit: 'the unit one row draws: a read or a chain, a sample or a haplotype',
15
25
  facet: 'one section per value of a field',
26
+ sort: 'the order the rows stack in: one over the whole window, or by a column at one base',
16
27
  rows: 'the rows: their field or order, labels, focus and tree',
17
- rowColor: 'the colour of each row label',
18
- color: 'the colour',
28
+ rowColor: 'the color of each row, by a row attribute',
29
+ color: 'the color',
19
30
  baseColor: 'the per-base layer over the reads',
20
- arcColor: 'the colour of the arcs between mates',
21
- ribbonColor: 'the colour of the ribbons between lanes',
31
+ arcColor: 'the color of the arcs between mates',
32
+ ribbonColor: 'the color of the ribbons between lanes',
22
33
  laneLayers: 'the layers drawn over each lane',
23
34
  scales: 'the axes, scales.y the value axis',
24
- filter: 'the jexl: expressions a feature has to pass',
25
- filterBy: 'the read flags and tags a read has to pass',
35
+ y: 'the field plotted on the value axis',
36
+ size: "a point's diameter or a line's width, in px",
37
+ origin: 'the value bars grow from',
38
+ filter: 'the tests a feature has to pass: jexl: expressions, or on an alignments display the read flags, name, tags and categories',
26
39
  };
27
40
  const LIFT_ID = 'plotLift';
28
41
  /**
@@ -116,10 +129,10 @@ function merged(draft, current) {
116
129
  */
117
130
  export function liftPlot(conf, draft) {
118
131
  checkKeys(draft, plotKeysOf(conf));
119
- return getType(conf).create({
132
+ return refusingUndeclaredKeys(() => getType(conf).create({
120
133
  displayId: LIFT_ID,
121
134
  ...structuredClone(merged(draft, plotOf(conf))),
122
- });
135
+ }));
123
136
  }
124
137
  /**
125
138
  * #api core/configuration
@@ -136,7 +149,41 @@ export function plotWrites(conf, draft) {
136
149
  if (value === undefined || compareStructural(lifted[key], current[key])) {
137
150
  continue;
138
151
  }
139
- writes[key] = lifted[key] ?? null;
152
+ writes[key] = value === null ? null : (lifted[key] ?? null);
140
153
  }
141
154
  return writes;
142
155
  }
156
+ function subConfOf(conf, key) {
157
+ const member = conf[key];
158
+ return isStateTreeNode(member) ? member : undefined;
159
+ }
160
+ // `value` raw, as `colorSettingOf` reads it: a `jexl:` constant is a constant
161
+ // to judge, never a callback to evaluate here.
162
+ function membersOf(node) {
163
+ return (name) => name === 'value'
164
+ ? node.value
165
+ : readConfObject(node, name);
166
+ }
167
+ /**
168
+ * What a lifted plot's color objects and `scales.y` say together that the
169
+ * display cannot draw as written, as corner-notice lines: each color object
170
+ * under its schema's `fieldPresets`, as `jbrowse validate` judges it.
171
+ */
172
+ export function schemaPlotProblems(lifted) {
173
+ return plotKeysOf(lifted).flatMap(key => {
174
+ const node = subConfOf(lifted, key);
175
+ const options = node
176
+ ? getConfigurationSchemaMetadata(node)?.options
177
+ : undefined;
178
+ const presets = options?.fieldPresets;
179
+ const y = key === 'scales' && node ? subConfOf(node, 'y') : undefined;
180
+ return [
181
+ ...(node && presets
182
+ ? noticeLines(key, colorProblems(withImpliedField(colorSlotsOf(membersOf(node)), options.impliedField), presets))
183
+ : []),
184
+ ...(y
185
+ ? noticeLines('scales.y', scaleEndProblems(scaleEndsOf(membersOf(y))))
186
+ : []),
187
+ ];
188
+ });
189
+ }
@@ -3,20 +3,13 @@ import type { JexlInstance } from '../util/jexlStrings.ts';
3
3
  import type { AnyConfigurationModel, AnyConfigurationSnapshot, ConfigurationSchemaForModel, ConfigurationSlotName, ConfigurationSlotPath, ConfigurationSlotPathValue, ConfigurationSlotValue } from './types.ts';
4
4
  /**
5
5
  * #api core/configuration
6
- * Given a configuration model (an instance of a ConfigurationSchema), read the
7
- * configuration value at the given path. Use this when you hold the
8
- * configuration model directly, e.g. an entry from `session.tracks`.
6
+ * Read the value at a path of a live config node, such as a track's
7
+ * `configuration`, evaluating a `jexl:` callback with `args`.
9
8
  *
10
- * Wants a **live config node**, not a snapshot of one, and passing a snapshot is
11
- * a type error. Slots are built with `types.stripDefault`, so a slot sitting at
12
- * its default is absent from a snapshot — "unset" and "at its default" are
13
- * indistinguishable there, and a read off one reports a default as missing.
14
- *
15
- * That is enforced in the types only, deliberately: it can't be a runtime check.
16
- * `generateHierarchy` reads slots straight off the **un-hydrated frozen** entries
17
- * of `jbrowse.tracks` on purpose, because hydrating every track to answer the
18
- * track selector is what `types.frozen` exists to avoid — and those reads are
19
- * indistinguishable at runtime from the broken spelling.
9
+ * A snapshot is refused by the types, since a slot at its default is absent
10
+ * from one. A `session.tracks` entry is one (`TrackConfigEntry`): read its
11
+ * `trackId` and `type` directly, and a slot through a helper that supplies the
12
+ * default, such as `getConfAssemblyNamesOrNone`.
20
13
  *
21
14
  * @param model - instance of ConfigurationSchema
22
15
  * @param slotPaths - array of paths to read
@@ -26,9 +19,14 @@ import type { AnyConfigurationModel, AnyConfigurationSnapshot, ConfigurationSche
26
19
  export declare function readConfObject(confObject: AnyConfigurationModel): AnyConfigurationSnapshot;
27
20
  export declare function readConfObject<CONFMODEL extends AnyConfigurationModel, const SLOT extends ConfigurationSlotName<ConfigurationSchemaForModel<CONFMODEL>> | ConfigurationSlotPath<ConfigurationSchemaForModel<CONFMODEL>> = ConfigurationSlotName<ConfigurationSchemaForModel<CONFMODEL>>>(confObject: CONFMODEL, slotPath?: SLOT, args?: Record<string, unknown>): SLOT extends string ? ConfigurationSlotValue<ConfigurationSchemaForModel<CONFMODEL>, SLOT> : ConfigurationSlotPathValue<ConfigurationSchemaForModel<CONFMODEL>, SLOT>;
28
21
  /**
29
- * Read a value from a plain config snapshot object. Automatically evaluates
30
- * "jexl:..." strings per-feature. Works without MST — intended for use in
31
- * rendering code (GPU, Canvas2D, workers). Pass the realm's `pluginManager.jexl`
32
- * so plugin-registered functions (e.g. in a custom `mouseover` slot) resolve.
22
+ * Read a value from a plain config snapshot, evaluating a `jexl:` callback
23
+ * against `feature`. For rendering code and workers; pass the realm's
24
+ * `pluginManager.jexl` so plugin-registered functions resolve.
33
25
  */
34
26
  export declare function readConfigValue<T>(config: Record<string, unknown>, key: string | string[], feature: Feature, jexl: JexlInstance): T;
27
+ /**
28
+ * #api core/configuration
29
+ * A config value as `feature` reads it: a `jexl:` callback evaluated against
30
+ * the feature, anything else as written.
31
+ */
32
+ export declare function evaluateForFeature(value: unknown, feature: Feature, jexl: JexlInstance): unknown;
@@ -1,27 +1,14 @@
1
1
  /**
2
2
  * @module
3
- * The config **readers**: `readConfObject` off a live MST config node, and
4
- * `readConfigValue` off a plain snapshot object in a worker or a renderer. Both
5
- * exist to evaluate a slot's `jexl:...` callback on read; they differ only in
6
- * where the jexl instance comes from, the node's env or an explicit argument.
7
- * A `featureField` slot's `jexl:` expression is the display's to evaluate per
8
- * feature, so `readConfObject` hands it over as written.
3
+ * The config readers: `readConfObject` off a live config node, whose env
4
+ * supplies the jexl instance, and `readConfigValue` off a plain snapshot in a
5
+ * worker or renderer, which is handed one.
9
6
  */
10
7
  import { getEnv, getSnapshot, getType, isStateTreeNode, } from '@jbrowse/mobx-state-tree';
11
8
  import { getConfigurationSchemaMetadata } from './schemaRegistry.js';
12
9
  import { evaluateJexl, isCallbackValue } from './slotValueUtils.js';
13
- // Evaluate a slot's `jexl:...` callback string against the realm's single jexl
14
- // instance (carrying plugin-registered functions), read from the config node's
15
- // env. readConfObject only ever operates on live MST configs — nested sub-config
16
- // reads stay MST (env resolves to the root), and frozen track configs hydrate to
17
- // MST before any callback is read — so the env instance is always present here.
18
10
  function evalConfigCallback(expr, args, confObject) {
19
11
  if (!isStateTreeNode(confObject)) {
20
- // A jexl slot needs the realm's jexl instance, which is read from a live
21
- // config node's env. A plain config snapshot (e.g. an un-hydrated
22
- // session.tracks entry) carries no env — read it through a hydrated model,
23
- // or use readConfigValue(config, key, feature, jexl) which takes jexl
24
- // explicitly.
25
12
  throw new Error(`cannot evaluate jexl config callback ${JSON.stringify(expr)}: config is a plain snapshot, not a live model (no env to resolve the jexl instance)`);
26
13
  }
27
14
  const jexl = getEnv(confObject)
@@ -35,11 +22,7 @@ function isFeatureField(confObject, slotName) {
35
22
  return (isStateTreeNode(confObject) &&
36
23
  !!getConfigurationSchemaMetadata(getType(confObject))?.featureFields.has(slotName));
37
24
  }
38
- // Read and resolve a single slot: raw value, jexl callback evaluation, then a
39
- // referentially-stable snapshot for sub-config nodes.
40
25
  function readSlot(confObject, slotName, args) {
41
- // strict undefined check, not truthiness — a slot value can legitimately be
42
- // falsy (0, '', false, null)
43
26
  const value = confObject[slotName];
44
27
  if (value === undefined) {
45
28
  return undefined;
@@ -47,42 +30,25 @@ function readSlot(confObject, slotName, args) {
47
30
  const val = isCallbackValue(value) && !isFeatureField(confObject, slotName)
48
31
  ? evalConfigCallback(value, args, confObject)
49
32
  : value;
50
- // Fast path for primitives (most common case)
51
33
  if (val === null || typeof val !== 'object') {
52
34
  return val;
53
35
  }
54
- // Return the live, referentially-stable snapshot (frozen in dev) rather than
55
- // a per-read clone: stable identity lets downstream computeds memoize, and
56
- // the old structuredClone was both a hot-path allocation and a source of
57
- // spurious recomputation. Treat as read-only.
36
+ // the live snapshot, stable across reads so downstream computeds memoize;
37
+ // read-only
58
38
  return isStateTreeNode(val) ? getSnapshot(val) : val;
59
39
  }
60
- // loose implementation signature: the body returns values that are `any` by
61
- // nature (raw slot values, snapshots); the typed overloads above are what
62
- // callers see. No looser overload admits the model: one that did was a
63
- // catch-all a slot-name typo fell through to, compiling clean as `any`.
40
+ // No looser overload admits the model: a catch-all lets a slot-name typo
41
+ // compile as `any`.
64
42
  export function readConfObject(confObject, slotPath, args = {}) {
65
- // the single-slot read, first and allocation-free: it is the shape of nearly
66
- // every one of the ~1300 call sites, so it doesn't get normalized into a
67
- // one-element array on the way past
68
43
  if (typeof slotPath === 'string') {
69
44
  return readSlot(confObject, slotPath, args);
70
45
  }
71
46
  if (slotPath !== undefined && !Array.isArray(slotPath)) {
72
47
  throw new TypeError('slotPath must be a string or array');
73
48
  }
74
- // No path, or an empty one — which means the same thing, and used not to: `[]`
75
- // is truthy, so it reached the walk below and read `confObject[undefined]`.
76
- //
77
- // Returns the whole config as a plain object: the live, referentially-stable
78
- // snapshot (frozen in dev), not a fresh clone — treat as read-only.
79
49
  if (!slotPath?.length) {
80
50
  return isStateTreeNode(confObject) ? getSnapshot(confObject) : confObject;
81
51
  }
82
- // every segment but the last names a sub-config, and only the last is a slot
83
- // read — which is where jexl evaluation and snapshotting happen, and nowhere
84
- // else. Iterative rather than a self-call per segment, which re-entered the
85
- // whole argument-shape preamble above at each level.
86
52
  let conf = confObject;
87
53
  for (let i = 0; i < slotPath.length - 1; i++) {
88
54
  const subConf = conf[slotPath[i]];
@@ -93,9 +59,6 @@ export function readConfObject(confObject, slotPath, args = {}) {
93
59
  }
94
60
  return readSlot(conf, slotPath[slotPath.length - 1], args);
95
61
  }
96
- // The plain-object half of the slot walk, for readConfigValue. The MST half is
97
- // readSlot/rawSlotValue above. A plain object has no map entries and no
98
- // sub-config nodes to snapshot, so it is just a path reduce.
99
62
  function resolveConfigValue(config, key) {
100
63
  if (Array.isArray(key)) {
101
64
  let val = config;
@@ -107,12 +70,18 @@ function resolveConfigValue(config, key) {
107
70
  return config[key];
108
71
  }
109
72
  /**
110
- * Read a value from a plain config snapshot object. Automatically evaluates
111
- * "jexl:..." strings per-feature. Works without MST — intended for use in
112
- * rendering code (GPU, Canvas2D, workers). Pass the realm's `pluginManager.jexl`
113
- * so plugin-registered functions (e.g. in a custom `mouseover` slot) resolve.
73
+ * Read a value from a plain config snapshot, evaluating a `jexl:` callback
74
+ * against `feature`. For rendering code and workers; pass the realm's
75
+ * `pluginManager.jexl` so plugin-registered functions resolve.
114
76
  */
115
77
  export function readConfigValue(config, key, feature, jexl) {
116
- const raw = resolveConfigValue(config, key);
117
- return (isCallbackValue(raw) ? evaluateJexl(raw, { feature }, jexl) : raw);
78
+ return evaluateForFeature(resolveConfigValue(config, key), feature, jexl);
79
+ }
80
+ /**
81
+ * #api core/configuration
82
+ * A config value as `feature` reads it: a `jexl:` callback evaluated against
83
+ * the feature, anything else as written.
84
+ */
85
+ export function evaluateForFeature(value, feature, jexl) {
86
+ return isCallbackValue(value) ? evaluateJexl(value, { feature }, jexl) : value;
118
87
  }
@@ -11,8 +11,6 @@ export interface ConfigurationSchemaMetadata {
11
11
  * i.e. with any `baseConfiguration`'s hooks already composed in
12
12
  */
13
13
  options: MergedConfigurationSchemaOptions<any, any>;
14
- /** the frozen-family slots, the only members a snapshot's `null` is stored in */
15
- storesNull: ReadonlySet<string>;
16
14
  /** the `featureField` slots, which the reader hands over as written */
17
15
  featureFields: ReadonlySet<string>;
18
16
  /** the slots that refuse a `jexl:` string: every one but a callback and a featureField */
@@ -67,7 +67,11 @@ export function isSlotDefinitionEntry(def) {
67
67
  export function isConfigurationModel(thing) {
68
68
  return isStateTreeNode(thing) && isConfigurationSchemaType(getType(thing));
69
69
  }
70
- const NUMBER_SLOT_TYPES = new Set(['number', 'integer', 'maybeNumber']);
70
+ const NUMBER_SLOT_TYPES = new Set([
71
+ 'number',
72
+ 'integer',
73
+ 'maybeNumber',
74
+ ]);
71
75
  /**
72
76
  * The slot a bare value of each form lifts into, off a `shorthand` option:
73
77
  * each slot it names takes the form its own type holds, a number where it
@@ -5,7 +5,7 @@ import { slotWriteRefusal } from './configurationSlot.js';
5
5
  import { setConf } from './getConf.js';
6
6
  import { getConfigurationSchemaDefinition, getConfigurationSchemaMetadata, } from './schemaRegistry.js';
7
7
  import { isConfigurationSchemaType, isSlotDefinitionEntry, } from './schemaTypes.js';
8
- import { preProcessSnapshotWith } from './snapshotPreprocess.js';
8
+ import { preProcessSnapshotWith, refusingUndeclaredKeys, } from './snapshotPreprocess.js';
9
9
  /**
10
10
  * The slot's metadata entry, or undefined when `slotName` names a nested
11
11
  * sub-schema or a string/number constant rather than a slot.
@@ -42,7 +42,7 @@ export function slotValueRefusal(schema, key, value) {
42
42
  try {
43
43
  const lifted = preProcessSnapshotWith(meta, { [key]: value })[key];
44
44
  if (subSchema) {
45
- subSchema.create(lifted);
45
+ refusingUndeclaredKeys(() => subSchema.create(lifted));
46
46
  }
47
47
  else if (isSlotDefinitionEntry(entry) && !slotType?.is(lifted)) {
48
48
  return slotWriteRefusal(`${meta.name}.${key}`, entry.type, value);
@@ -2,42 +2,66 @@ import type { RetiredSpelling } from './configurationSchema.ts';
2
2
  import type { ConfigurationSchemaMetadata } from './schemaRegistry.ts';
3
3
  import type { IAnyType } from '@jbrowse/mobx-state-tree';
4
4
  export declare function listed(keys: readonly string[]): string;
5
+ /**
6
+ * #api core/configuration
7
+ * Runs `write` as a write: a `closed` schema created inside it refuses a key
8
+ * it does not declare, at any depth, where a config loading only names the
9
+ * key on the console. `setConf`, a settings bag and a plot draft write this
10
+ * way, so a typo in an edit is an error and a config written for another
11
+ * version still draws.
12
+ */
13
+ export declare function refusingUndeclaredKeys<T>(write: () => T): T;
5
14
  /**
6
15
  * The snapshot with each spelling `retired` names rewritten: a lift's members
7
16
  * take the old key's place, and what the snapshot already spells wins, member
8
17
  * by member inside an object, since writing the current name is the stronger
9
18
  * statement — so a retired flag lifting into `scales.y` lands beside a
10
19
  * `scales.y` the snapshot writes. The old key goes whether or not it carried a
11
- * value, so a `closed` schema never meets it. Where two retired names lift
12
- * onto one member — a slot the entry spelt directly and the same slot inside a
13
- * retired `renderer` — the one declared first wins.
20
+ * value, so a `closed` schema never meets it, and a member a lift produces
21
+ * that no slot takes goes with it: a v4 `renderer` block carried settings
22
+ * the display has no slot for, and they were dropped then too. Where two
23
+ * retired names lift onto one member — a slot the entry spelt directly and
24
+ * the same slot inside a retired `renderer` — the one declared first wins.
25
+ * A retired name the schema itself declares is that slot, not a spelling,
26
+ * so a list shared across displays leaves it alone where one still takes it.
14
27
  */
15
28
  export declare function liftRetiredSpellings(schema: ConfigurationSchemaMetadata, snapshot: Record<string, unknown>): Record<string, unknown>;
16
29
  /**
17
- * `liftRetiredSpellings` over a map directly, for a schema whose own
18
- * `preProcessSnapshot` uncovers a retired name the pass above could not see —
19
- * one that arrives out of a legacy sub-config rather than off the entry.
30
+ * `liftRetiredSpellings` over a map directly, for a lift that uncovers a
31
+ * retired name one level down, as a v4 `renderer` block carries a `color1`.
20
32
  * Applying the same map twice costs nothing, since a lift deletes the name it
21
- * reads.
33
+ * reads. `takes` says which lifted members land; every one does unless given.
22
34
  */
23
- export declare function applyRetiredSpellings(retired: Record<string, RetiredSpelling>, snapshot: Record<string, unknown>): Record<string, unknown>;
35
+ export declare function applyRetiredSpellings(retired: Record<string, RetiredSpelling>, snapshot: Record<string, unknown>, takes?: (name: string) => boolean): Record<string, unknown>;
24
36
  /**
25
37
  * What a schema does to every snapshot on its way in, whichever door it
26
38
  * arrives by (`create`, `applySnapshot`, `setSubschema`, a settings bag): a
27
39
  * bare string or number lifts into the `shorthand` slot taking its form, beside any
28
40
  * `shorthandWith` slots, and `null` into the empty object that clears it; a
29
- * `null` member reads as unset, except in a frozen-family slot, which stores
30
- * it; a `retired` spelling becomes the members that replaced it; a `closed`
31
- * schema refuses a key it does not declare, then the schema's
32
- * own `preProcessSnapshot` runs, and a `jexl:` callback in a slot declaring no
33
- * `contextVariable` is refused. A bare value the shorthand does not lift
34
- * passes through for MST to refuse.
41
+ * `null` member reads as unset; a `retired` spelling becomes the members that
42
+ * replaced it; the schema's own `preProcessSnapshot` runs, which is where a
43
+ * track folds `displayDefaults` into its displays; then a `closed` schema
44
+ * names a key it does not declare on the console, or refuses it inside
45
+ * `refusingUndeclaredKeys`, unless the caller is a settings bag that routes
46
+ * an undeclared key itself (`routesUndeclared`); it refuses a bare value no
47
+ * shorthand lifted on every door, and so is a `jexl:` callback in a slot
48
+ * declaring no `contextVariable`.
49
+ */
50
+ export declare function preProcessSnapshotWith(schema: ConfigurationSchemaMetadata, snapshot: unknown, { routesUndeclared }?: {
51
+ routesUndeclared?: boolean | undefined;
52
+ }): Record<string, unknown>;
53
+ /**
54
+ * #api core/configuration
55
+ * A snapshot as `type` lifts it, without the keys it does not declare: the
56
+ * config half of an entry that carries its owner's keys beside one, as a
57
+ * `MultiWiggleAdapter` subadapter carries its row's `name` and `color`.
35
58
  */
36
- export declare function preProcessSnapshotWith(schema: ConfigurationSchemaMetadata, snapshot: unknown): Record<string, unknown>;
59
+ export declare function declaredSnapshot(type: IAnyType, snapshot: Record<string, unknown>): Record<string, unknown>;
37
60
  /**
38
61
  * #api core/configuration
39
- * A snapshot as `type` admits it: the same lift and checks `type.create`
40
- * applies, so a dialog or a validator refuses exactly what a config file
41
- * cannot hold. Throws what the schema's `preProcessSnapshot` throws.
62
+ * A snapshot as a write to `type` admits it: the lift and checks `setConf`
63
+ * applies, so a dialog or a validator refuses what an edit cannot hold, an
64
+ * undeclared key included. Throws what the schema's `preProcessSnapshot`
65
+ * throws.
42
66
  */
43
67
  export declare function preProcessConfigSnapshot(type: IAnyType, snapshot: unknown): Record<string, unknown>;
@@ -1,4 +1,5 @@
1
1
  import { isJexl } from '../util/jexlStrings.js';
2
+ import { isPlainObject } from '../util/objectUtils.js';
2
3
  import { slotWriteRefusal } from './configurationSlot.js';
3
4
  import { getConfigurationSchemaMetadata } from './schemaRegistry.js';
4
5
  import { bareFormOf, isConstantEntry, shorthandTargets } from './schemaTypes.js';
@@ -10,18 +11,51 @@ export function listed(keys) {
10
11
  ? `${keys.slice(0, -1).join(', ')} and ${keys.at(-1)}`
11
12
  : (keys[0] ?? 'nothing');
12
13
  }
13
- function refuseUndeclaredKeys({ name, definition, options }, snapshot) {
14
+ function declaredKeys({ definition, options }) {
14
15
  const id = options.explicitIdentifier;
15
- const declared = [
16
+ return [
16
17
  ...Object.keys(definition).filter(key => !isConstantEntry(definition[key])),
17
18
  ...(options.explicitlyTyped ? ['type'] : []),
18
19
  ...(id ? [id] : []),
19
20
  ];
20
- const unknown = typeof snapshot === 'string'
21
+ }
22
+ const warned = new Set();
23
+ let writes = 0;
24
+ /**
25
+ * #api core/configuration
26
+ * Runs `write` as a write: a `closed` schema created inside it refuses a key
27
+ * it does not declare, at any depth, where a config loading only names the
28
+ * key on the console. `setConf`, a settings bag and a plot draft write this
29
+ * way, so a typo in an edit is an error and a config written for another
30
+ * version still draws.
31
+ */
32
+ export function refusingUndeclaredKeys(write) {
33
+ writes++;
34
+ try {
35
+ return write();
36
+ }
37
+ finally {
38
+ writes--;
39
+ }
40
+ }
41
+ function checkUndeclaredKeys(schema, snapshot) {
42
+ const { name, options } = schema;
43
+ const declared = declaredKeys(schema);
44
+ const bare = snapshot !== undefined &&
45
+ (typeof snapshot !== 'object' || Array.isArray(snapshot));
46
+ const unknown = bare
21
47
  ? [JSON.stringify(snapshot)]
22
48
  : Object.keys(snapshot ?? {}).filter(key => !declared.includes(key) && !COMMENT_KEY.test(key));
23
49
  if (unknown.length > 0) {
24
- throw new Error(`${name} takes ${listed(declared)}, not ${unknown.join(', ')}`);
50
+ if (bare || writes > 0) {
51
+ throw new Error(`${name} takes ${listed(declared)}, not ${unknown.join(', ')}`);
52
+ }
53
+ const key = `${name} ${unknown.toSorted().join(' ')}`;
54
+ if (!warned.has(key)) {
55
+ warned.add(key);
56
+ const id = snapshot[options.explicitIdentifier ?? ''];
57
+ console.warn(`${name}${typeof id === 'string' ? ` "${id}"` : ''} does not declare ${listed(unknown)}: loading without it`);
58
+ }
25
59
  }
26
60
  }
27
61
  // Checked here as well as by each slot's MST type because this runs on every
@@ -38,11 +72,13 @@ function refuseCallbacks({ name, takesNoCallback }, snapshot) {
38
72
  }
39
73
  }
40
74
  // ADR-146's reset, on the snapshot path: the member keeps its key, so a
41
- // settings bag still resets it, and `create` reads `undefined` as the default
42
- function nullMembersAsUnset(snapshot, storesNull) {
75
+ // settings bag still resets it, and `create` reads `undefined` as the default.
76
+ // A frozen slot resets too, since its readers take the default's shape and
77
+ // `setSlot` already resets it; storing the null put one past them.
78
+ function nullMembersAsUnset(snapshot) {
43
79
  let out = snapshot;
44
80
  for (const key in snapshot) {
45
- if (snapshot[key] === null && !storesNull.has(key)) {
81
+ if (snapshot[key] === null) {
46
82
  out = out === snapshot ? { ...snapshot } : out;
47
83
  out[key] = undefined;
48
84
  }
@@ -60,9 +96,6 @@ function isOwnSnapshot({ name, options }, snapshot) {
60
96
  snapshot.type === undefined ||
61
97
  snapshot.type === name);
62
98
  }
63
- function isPlainObject(value) {
64
- return typeof value === 'object' && value !== null && !Array.isArray(value);
65
- }
66
99
  // `lifted` under `written`: what the snapshot spells wins, member by member
67
100
  // where both are objects.
68
101
  function underWritten(written, lifted) {
@@ -84,24 +117,30 @@ function underWritten(written, lifted) {
84
117
  * by member inside an object, since writing the current name is the stronger
85
118
  * statement — so a retired flag lifting into `scales.y` lands beside a
86
119
  * `scales.y` the snapshot writes. The old key goes whether or not it carried a
87
- * value, so a `closed` schema never meets it. Where two retired names lift
88
- * onto one member — a slot the entry spelt directly and the same slot inside a
89
- * retired `renderer` — the one declared first wins.
120
+ * value, so a `closed` schema never meets it, and a member a lift produces
121
+ * that no slot takes goes with it: a v4 `renderer` block carried settings
122
+ * the display has no slot for, and they were dropped then too. Where two
123
+ * retired names lift onto one member — a slot the entry spelt directly and
124
+ * the same slot inside a retired `renderer` — the one declared first wins.
125
+ * A retired name the schema itself declares is that slot, not a spelling,
126
+ * so a list shared across displays leaves it alone where one still takes it.
90
127
  */
91
128
  export function liftRetiredSpellings(schema, snapshot) {
92
129
  const { retired } = schema.options;
93
- return retired && isOwnSnapshot(schema, snapshot)
94
- ? applyRetiredSpellings(retired, snapshot)
95
- : snapshot;
130
+ if (!retired || !isOwnSnapshot(schema, snapshot)) {
131
+ return snapshot;
132
+ }
133
+ const declared = new Set(declaredKeys(schema));
134
+ const spellings = Object.fromEntries(Object.entries(retired).filter(([name]) => !declared.has(name)));
135
+ return applyRetiredSpellings(spellings, snapshot, name => declared.has(name));
96
136
  }
97
137
  /**
98
- * `liftRetiredSpellings` over a map directly, for a schema whose own
99
- * `preProcessSnapshot` uncovers a retired name the pass above could not see —
100
- * one that arrives out of a legacy sub-config rather than off the entry.
138
+ * `liftRetiredSpellings` over a map directly, for a lift that uncovers a
139
+ * retired name one level down, as a v4 `renderer` block carries a `color1`.
101
140
  * Applying the same map twice costs nothing, since a lift deletes the name it
102
- * reads.
141
+ * reads. `takes` says which lifted members land; every one does unless given.
103
142
  */
104
- export function applyRetiredSpellings(retired, snapshot) {
143
+ export function applyRetiredSpellings(retired, snapshot, takes = () => true) {
105
144
  const present = Object.keys(retired).filter(key => key in snapshot);
106
145
  if (present.length === 0) {
107
146
  return snapshot;
@@ -113,7 +152,9 @@ export function applyRetiredSpellings(retired, snapshot) {
113
152
  for (const key of present.filter(key => snapshot[key] !== undefined)) {
114
153
  const lifted = retired[key](snapshot[key]);
115
154
  for (const [name, value] of Object.entries(lifted)) {
116
- out[name] = underWritten(out[name], value);
155
+ if (takes(name)) {
156
+ out[name] = underWritten(out[name], value);
157
+ }
117
158
  }
118
159
  }
119
160
  return out;
@@ -123,14 +164,16 @@ export function applyRetiredSpellings(retired, snapshot) {
123
164
  * arrives by (`create`, `applySnapshot`, `setSubschema`, a settings bag): a
124
165
  * bare string or number lifts into the `shorthand` slot taking its form, beside any
125
166
  * `shorthandWith` slots, and `null` into the empty object that clears it; a
126
- * `null` member reads as unset, except in a frozen-family slot, which stores
127
- * it; a `retired` spelling becomes the members that replaced it; a `closed`
128
- * schema refuses a key it does not declare, then the schema's
129
- * own `preProcessSnapshot` runs, and a `jexl:` callback in a slot declaring no
130
- * `contextVariable` is refused. A bare value the shorthand does not lift
131
- * passes through for MST to refuse.
167
+ * `null` member reads as unset; a `retired` spelling becomes the members that
168
+ * replaced it; the schema's own `preProcessSnapshot` runs, which is where a
169
+ * track folds `displayDefaults` into its displays; then a `closed` schema
170
+ * names a key it does not declare on the console, or refuses it inside
171
+ * `refusingUndeclaredKeys`, unless the caller is a settings bag that routes
172
+ * an undeclared key itself (`routesUndeclared`); it refuses a bare value no
173
+ * shorthand lifted on every door, and so is a `jexl:` callback in a slot
174
+ * declaring no `contextVariable`.
132
175
  */
133
- export function preProcessSnapshotWith(schema, snapshot) {
176
+ export function preProcessSnapshotWith(schema, snapshot, { routesUndeclared = false } = {}) {
134
177
  const { shorthandWith, closed, preProcessSnapshot } = schema.options;
135
178
  const form = bareFormOf(snapshot);
136
179
  const target = form && shorthandTargets(schema)[form];
@@ -138,24 +181,39 @@ export function preProcessSnapshotWith(schema, snapshot) {
138
181
  ? {}
139
182
  : target !== undefined
140
183
  ? { ...shorthandWith, [target]: snapshot }
141
- : nullMembersAsUnset(snapshot, schema.storesNull);
184
+ : nullMembersAsUnset(snapshot);
142
185
  const named = liftRetiredSpellings(schema, lifted);
143
- if (closed) {
144
- refuseUndeclaredKeys(schema, named);
145
- }
146
186
  const processed = preProcessSnapshot ? preProcessSnapshot(named) : named;
187
+ if (closed && !routesUndeclared && isOwnSnapshot(schema, processed)) {
188
+ checkUndeclaredKeys(schema, processed);
189
+ }
147
190
  refuseCallbacks(schema, processed);
148
191
  return processed;
149
192
  }
150
193
  /**
151
194
  * #api core/configuration
152
- * A snapshot as `type` admits it: the same lift and checks `type.create`
153
- * applies, so a dialog or a validator refuses exactly what a config file
154
- * cannot hold. Throws what the schema's `preProcessSnapshot` throws.
195
+ * A snapshot as `type` lifts it, without the keys it does not declare: the
196
+ * config half of an entry that carries its owner's keys beside one, as a
197
+ * `MultiWiggleAdapter` subadapter carries its row's `name` and `color`.
198
+ */
199
+ export function declaredSnapshot(type, snapshot) {
200
+ const schema = getConfigurationSchemaMetadata(type);
201
+ if (!schema) {
202
+ return snapshot;
203
+ }
204
+ const declared = new Set(declaredKeys(schema));
205
+ return Object.fromEntries(Object.entries(preProcessSnapshotWith(schema, snapshot, { routesUndeclared: true })).filter(([key]) => declared.has(key)));
206
+ }
207
+ /**
208
+ * #api core/configuration
209
+ * A snapshot as a write to `type` admits it: the lift and checks `setConf`
210
+ * applies, so a dialog or a validator refuses what an edit cannot hold, an
211
+ * undeclared key included. Throws what the schema's `preProcessSnapshot`
212
+ * throws.
155
213
  */
156
214
  export function preProcessConfigSnapshot(type, snapshot) {
157
215
  const schema = getConfigurationSchemaMetadata(type);
158
216
  return schema
159
- ? preProcessSnapshotWith(schema, snapshot)
217
+ ? refusingUndeclaredKeys(() => preProcessSnapshotWith(schema, snapshot))
160
218
  : snapshot;
161
219
  }
@@ -63,9 +63,7 @@ export function tabixIndexSnapshot(snap) {
63
63
  export function expandTabixShorthand(snap, locationKey) {
64
64
  return snap.uri
65
65
  ? {
66
- ...fillLocations(snap, {
67
- [locationKey]: { uri: snap.uri, baseUri: snap.baseUri },
68
- }),
66
+ ...fillLocations(snap, { [locationKey]: { uri: snap.uri, baseUri: snap.baseUri } }, ['csi']),
69
67
  index: tabixIndexSnapshot(snap),
70
68
  }
71
69
  : snap;