@jbrowse/core 5.0.0-beta.8 → 5.0.0-beta.9
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.
- package/README.md +427 -130
- package/esm/BaseFeatureWidget/BaseFeatureDetail/ArrayValue.d.ts +3 -2
- package/esm/BaseFeatureWidget/BaseFeatureDetail/ArrayValue.js +5 -3
- package/esm/BaseFeatureWidget/BaseFeatureDetail/Attributes.d.ts +3 -5
- package/esm/BaseFeatureWidget/BaseFeatureDetail/Attributes.js +8 -9
- package/esm/BaseFeatureWidget/BaseFeatureDetail/CoreDetails.js +8 -13
- package/esm/BaseFeatureWidget/BaseFeatureDetail/FeatureDetails.d.ts +2 -1
- package/esm/BaseFeatureWidget/BaseFeatureDetail/FeatureDetails.js +3 -3
- package/esm/BaseFeatureWidget/BaseFeatureDetail/FieldActionsButton.d.ts +8 -0
- package/esm/BaseFeatureWidget/BaseFeatureDetail/FieldActionsButton.js +24 -0
- package/esm/BaseFeatureWidget/BaseFeatureDetail/SimpleField.d.ts +3 -2
- package/esm/BaseFeatureWidget/BaseFeatureDetail/SimpleField.js +5 -3
- package/esm/BaseFeatureWidget/BaseFeatureDetail/index.d.ts +1 -0
- package/esm/BaseFeatureWidget/BaseFeatureDetail/index.js +1 -4
- package/esm/BaseFeatureWidget/BaseFeatureDetail/jexlFilterActions.d.ts +16 -0
- package/esm/BaseFeatureWidget/BaseFeatureDetail/jexlFilterActions.js +53 -0
- package/esm/BaseFeatureWidget/BaseFeatureDetail/util.d.ts +0 -8
- package/esm/BaseFeatureWidget/BaseFeatureDetail/util.js +0 -16
- package/esm/BaseFeatureWidget/SequenceFeatureDetails/SequenceContents.js +7 -34
- package/esm/BaseFeatureWidget/configSchema.d.ts +1 -1
- package/esm/BaseFeatureWidget/formatDetails.d.ts +13 -29
- package/esm/BaseFeatureWidget/formatDetails.js +46 -79
- package/esm/BaseFeatureWidget/index.d.ts +1 -0
- package/esm/BaseFeatureWidget/stateModelFactory.d.ts +35 -28
- package/esm/BaseFeatureWidget/stateModelFactory.js +94 -102
- package/esm/BaseFeatureWidget/types.d.ts +3 -0
- package/esm/BaseFeatureWidget/util.d.ts +0 -3
- package/esm/BaseFeatureWidget/util.js +0 -17
- package/esm/PluginLoader.d.ts +14 -9
- package/esm/PluginLoader.js +34 -26
- package/esm/PluginManager.d.ts +4 -4
- package/esm/PluginManager.js +1 -1
- package/esm/ReExports/coreModules.generated.d.ts +2 -0
- package/esm/ReExports/coreModules.generated.js +492 -0
- package/esm/ReExports/coreWorkerModules.generated.d.ts +2 -0
- package/esm/ReExports/coreWorkerModules.generated.js +453 -0
- package/esm/ReExports/frameworkModules.d.ts +2 -0
- package/esm/ReExports/frameworkModules.js +67 -0
- package/esm/ReExports/frameworkShared.d.ts +12 -0
- package/esm/ReExports/frameworkShared.js +16 -0
- package/esm/ReExports/frameworkWorkerModules.generated.d.ts +2 -0
- package/esm/ReExports/frameworkWorkerModules.generated.js +130 -0
- package/esm/ReExports/list.js +493 -79
- package/esm/ReExports/modules.d.ts +1 -1
- package/esm/ReExports/modules.js +10 -87
- package/esm/ReExports/registry.d.ts +1 -0
- package/esm/ReExports/registry.js +23 -5
- package/esm/ReExports/uiStub.d.ts +2 -1
- package/esm/ReExports/uiStub.js +24 -2
- package/esm/ReExports/workerModules.js +8 -12
- package/esm/TextSearch/TextSearchManager.d.ts +3 -12
- package/esm/TextSearch/TextSearchManager.js +22 -10
- package/esm/assemblyManager/assembly.d.ts +10 -14
- package/esm/assemblyManager/assembly.js +10 -14
- package/esm/assemblyManager/assemblyConfigSchema.d.ts +23 -81
- package/esm/assemblyManager/assemblyManager.d.ts +10 -16
- package/esm/assemblyManager/assemblyManager.js +7 -10
- package/esm/assemblyManager/loadRefNameMap.js +3 -3
- package/esm/configuration/configurationSchema.d.ts +75 -31
- package/esm/configuration/configurationSchema.js +74 -40
- package/esm/configuration/configurationSchemaUnion.d.ts +39 -0
- package/esm/configuration/configurationSchemaUnion.js +59 -0
- package/esm/configuration/configurationSlot.d.ts +37 -12
- package/esm/configuration/configurationSlot.js +83 -22
- package/esm/configuration/formatAboutConfigSchema.d.ts +7 -21
- package/esm/configuration/formatDetailsConfigSchema.d.ts +11 -37
- package/esm/configuration/formatDetailsConfigSchema.js +10 -13
- package/esm/configuration/getConf.d.ts +17 -9
- package/esm/configuration/getConf.js +52 -7
- package/esm/configuration/index.d.ts +11 -4
- package/esm/configuration/index.js +7 -4
- package/esm/configuration/mergeFormatCallbacks.d.ts +6 -7
- package/esm/configuration/mergeFormatCallbacks.js +13 -10
- package/esm/configuration/readConfObject.d.ts +2 -22
- package/esm/configuration/readConfObject.js +15 -49
- package/esm/configuration/requirements.d.ts +37 -0
- package/esm/configuration/requirements.js +88 -0
- package/esm/configuration/schemaRegistry.d.ts +21 -1
- package/esm/configuration/schemaRegistry.js +11 -0
- package/esm/configuration/schemaTypes.d.ts +3 -0
- package/esm/configuration/schemaTypes.js +10 -0
- package/esm/configuration/slotFacade.d.ts +35 -4
- package/esm/configuration/slotFacade.js +96 -9
- package/esm/configuration/snapshotPreprocess.d.ts +27 -0
- package/esm/configuration/snapshotPreprocess.js +102 -0
- package/esm/configuration/types.d.ts +161 -22
- package/esm/data_adapters/BaseAdapter/BaseAdapter.d.ts +2 -2
- package/esm/data_adapters/BaseAdapter/BaseFeatureDataAdapter.d.ts +11 -2
- package/esm/data_adapters/BaseAdapter/BaseFeatureDataAdapter.js +12 -1
- package/esm/data_adapters/BaseAdapter/featureDensity.d.ts +2 -3
- package/esm/data_adapters/BaseAdapter/featureDensity.js +2 -3
- package/esm/data_adapters/BaseAdapter/index.d.ts +22 -3
- package/esm/data_adapters/BaseAdapter/types.d.ts +3 -4
- package/esm/data_adapters/BaseAdapter/zoomRange.d.ts +10 -0
- package/esm/data_adapters/BaseAdapter/zoomRange.js +1 -0
- package/esm/data_adapters/CytobandAdapter/configSchema.d.ts +9 -11
- package/esm/data_adapters/getSequenceSubAdapter.d.ts +1 -3
- package/esm/data_adapters/getSequenceSubAdapter.js +1 -3
- package/esm/pluggableElementTypes/AdapterType.d.ts +7 -7
- package/esm/pluggableElementTypes/RpcMethodType.d.ts +1 -1
- package/esm/pluggableElementTypes/RpcMethodType.js +3 -8
- package/esm/pluggableElementTypes/RpcMethodTypeWithFiltersAndRenameRegions.d.ts +1 -2
- package/esm/pluggableElementTypes/TextSearchAdapterType.d.ts +7 -7
- package/esm/pluggableElementTypes/index.d.ts +1 -1
- package/esm/pluggableElementTypes/index.js +1 -1
- package/esm/pluggableElementTypes/models/BaseConnectionModelFactory.d.ts +17 -7
- package/esm/pluggableElementTypes/models/BaseDisplayModel.d.ts +45 -48
- package/esm/pluggableElementTypes/models/BaseDisplayModel.js +40 -36
- package/esm/pluggableElementTypes/models/BaseTrackModel.d.ts +10 -13
- package/esm/pluggableElementTypes/models/BaseTrackModel.js +6 -6
- package/esm/pluggableElementTypes/models/BaseViewModel.d.ts +37 -17
- package/esm/pluggableElementTypes/models/BaseViewModel.js +25 -10
- package/esm/pluggableElementTypes/models/InternetAccountModel.d.ts +26 -16
- package/esm/pluggableElementTypes/models/assertDisplayContract.d.ts +1 -1
- package/esm/pluggableElementTypes/models/baseConnectionConfig.d.ts +22 -18
- package/esm/pluggableElementTypes/models/baseConnectionConfig.js +5 -5
- package/esm/pluggableElementTypes/models/baseInternetAccountConfig.d.ts +26 -31
- package/esm/pluggableElementTypes/models/baseTrackConfig.d.ts +57 -141
- package/esm/pluggableElementTypes/models/baseTrackConfig.js +22 -26
- package/esm/pluggableElementTypes/models/components/SaveTrackData.js +2 -2
- package/esm/pluggableElementTypes/models/components/fetchTrackData.d.ts +3 -4
- package/esm/pluggableElementTypes/models/components/fetchTrackData.js +3 -3
- package/esm/pluggableElementTypes/models/expandTrackConfigShorthand.d.ts +15 -7
- package/esm/pluggableElementTypes/models/expandTrackConfigShorthand.js +38 -29
- package/esm/pluggableElementTypes/models/index.d.ts +1 -2
- package/esm/pluggableElementTypes/models/index.js +1 -2
- package/esm/pluggableElementTypes/models/saveTrackFileTypes/genbank.d.ts +3 -3
- package/esm/pluggableElementTypes/models/saveTrackFileTypes/genbank.js +4 -4
- package/esm/pluggableElementTypes/models/saveTrackFileTypes/types.d.ts +3 -3
- package/esm/rpc/BaseRpcDriver.d.ts +1 -2
- package/esm/rpc/BaseRpcDriver.js +23 -30
- package/esm/rpc/MainThreadRpcDriver.d.ts +2 -2
- package/esm/rpc/MainThreadRpcDriver.js +13 -8
- package/esm/rpc/RpcClient.d.ts +17 -6
- package/esm/rpc/RpcClient.js +42 -12
- package/esm/rpc/RpcManager.d.ts +8 -10
- package/esm/rpc/RpcManager.js +1 -1
- package/esm/rpc/RpcRegistry.d.ts +8 -2
- package/esm/rpc/RpcServer.d.ts +3 -1
- package/esm/rpc/RpcServer.js +19 -12
- package/esm/rpc/WebWorkerRpcDriver.d.ts +3 -3
- package/esm/rpc/WebWorkerRpcDriver.js +9 -47
- package/esm/rpc/byteBudget.d.ts +3 -5
- package/esm/rpc/byteBudget.js +4 -4
- package/esm/rpc/configSchema.d.ts +7 -21
- package/esm/rpc/coreRpcMethods.d.ts +1 -0
- package/esm/rpc/coreRpcMethods.js +1 -0
- package/esm/rpc/methods/CoreEncodeFeatures.d.ts +6 -5
- package/esm/rpc/methods/CoreEncodeFeatures.js +26 -31
- package/esm/rpc/methods/CoreGetEncodedFeature.d.ts +13 -0
- package/esm/rpc/methods/CoreGetEncodedFeature.js +31 -0
- package/esm/rpc/methods/CoreGetExportData.js +2 -2
- package/esm/rpc/methods/CoreGetFeatureDensity.js +2 -2
- package/esm/rpc/methods/CoreGetFeatures.js +2 -2
- package/esm/rpc/methods/CoreGetSequence.js +2 -2
- package/esm/rpc/methods/layerFeatures.d.ts +26 -0
- package/esm/rpc/methods/layerFeatures.js +40 -0
- package/esm/svg/SvgExport.js +3 -4
- package/esm/svg/SvgThemeProviders.d.ts +12 -0
- package/esm/svg/SvgThemeProviders.js +15 -0
- package/esm/svg/exportViewSvg.d.ts +32 -0
- package/esm/svg/exportViewSvg.js +13 -0
- package/esm/svg/normalizeSvgMarkup.d.ts +7 -0
- package/esm/svg/normalizeSvgMarkup.js +99 -0
- package/esm/svg/serializeSvg.d.ts +7 -0
- package/esm/svg/serializeSvg.js +11 -0
- package/esm/svg/svgReady.d.ts +8 -7
- package/esm/svg/svgReady.js +8 -7
- package/esm/svg/trackNames.d.ts +5 -5
- package/esm/svg/trackNames.js +6 -6
- package/esm/svg/wrapSvgExport.js +6 -74
- package/esm/ui/CascadingMenu.js +83 -86
- package/esm/ui/ErrorMessageStackTraceDialog.js +0 -5
- package/esm/ui/FileSelector/useInternetAccounts.d.ts +156 -96
- package/esm/ui/HoverMenu.d.ts +1 -2
- package/esm/ui/HoverMenu.js +6 -3
- package/esm/ui/JexlFilterDialog.d.ts +13 -10
- package/esm/ui/JexlFilterDialog.js +122 -49
- package/esm/ui/JexlFilterRowEditors.d.ts +15 -0
- package/esm/ui/JexlFilterRowEditors.js +90 -0
- package/esm/ui/LazyBaseTooltip.d.ts +4 -0
- package/esm/ui/LazyBaseTooltip.js +9 -0
- package/esm/ui/LoadingOverlay.js +3 -1
- package/esm/ui/MonospaceTextField.d.ts +2 -1
- package/esm/ui/MonospaceTextField.js +21 -19
- package/esm/ui/PaletteContext.d.ts +7 -9
- package/esm/ui/PaletteContext.js +24 -10
- package/esm/ui/RefNameAutocomplete/index.d.ts +1 -2
- package/esm/ui/RefNameAutocomplete/index.js +1 -1
- package/esm/ui/ScrollChrome.d.ts +6 -9
- package/esm/ui/ScrollChrome.js +5 -6
- package/esm/ui/ScrollEdgeShadow.d.ts +6 -9
- package/esm/ui/ScrollEdgeShadow.js +9 -24
- package/esm/ui/SettingsChangesTable.js +3 -3
- package/esm/ui/VerticalScrollbar.d.ts +13 -34
- package/esm/ui/VerticalScrollbar.js +29 -83
- package/esm/ui/ViewLoadingScreen.d.ts +2 -2
- package/esm/ui/ViewLoadingScreen.js +3 -3
- package/esm/ui/colorScale.d.ts +26 -1
- package/esm/ui/colorScale.js +28 -5
- package/esm/ui/colors.d.ts +49 -1
- package/esm/ui/colors.js +139 -4
- package/esm/ui/hoverBoxStyle.d.ts +14 -2
- package/esm/ui/hoverBoxStyle.js +17 -2
- package/esm/ui/index.d.ts +5 -3
- package/esm/ui/index.js +9 -7
- package/esm/ui/launchViewMenu.js +3 -3
- package/esm/ui/legendSpec.d.ts +2 -0
- package/esm/ui/legendSpec.js +3 -0
- package/esm/ui/palette.d.ts +0 -1
- package/esm/ui/palette.js +3 -27
- package/esm/ui/replaceViewAction.d.ts +1 -1
- package/esm/ui/replaceViewAction.js +1 -1
- package/esm/ui/theme.d.ts +1 -1
- package/esm/ui/theme.js +6 -40
- package/esm/ui/viewHeaderHeight.d.ts +1 -0
- package/esm/ui/viewHeaderHeight.js +1 -0
- package/esm/util/Base1DUtils.d.ts +1 -1
- package/esm/util/Base1DUtils.js +2 -2
- package/esm/util/SvgCanvas.d.ts +15 -13
- package/esm/util/SvgCanvas.js +72 -53
- package/esm/util/aborting.d.ts +39 -0
- package/esm/util/aborting.js +84 -0
- package/esm/util/adapterMetadata.d.ts +1 -1
- package/esm/util/adapterMetadata.js +6 -6
- package/esm/util/addAndShowTrack.d.ts +1 -4
- package/esm/util/addRelativeUris.d.ts +10 -2
- package/esm/util/addRelativeUris.js +22 -7
- package/esm/util/addTrackFromWidget.d.ts +2 -5
- package/esm/util/animationAllowed.d.ts +9 -0
- package/esm/util/animationAllowed.js +13 -0
- package/esm/util/applyRowResizeWheel.d.ts +10 -5
- package/esm/util/applyRowResizeWheel.js +10 -21
- package/esm/util/bandLayout.d.ts +4 -4
- package/esm/util/bandLayout.js +4 -4
- package/esm/util/bezierConnector.js +5 -4
- package/esm/util/bgzfWorkerPool.d.ts +20 -74
- package/esm/util/bgzfWorkerPool.js +20 -74
- package/esm/util/cachedSetup.d.ts +1 -1
- package/esm/util/cachedSetup.js +2 -2
- package/esm/util/categoricalField.d.ts +37 -0
- package/esm/util/categoricalField.js +52 -0
- package/esm/util/color/cssColorsLevel4.d.ts +1 -0
- package/esm/util/color/cssColorsLevel4.js +1 -0
- package/esm/util/color/index.d.ts +5 -3
- package/esm/util/color/index.js +7 -4
- package/esm/util/colorBits.d.ts +1 -2
- package/esm/util/colorBits.js +17 -39
- package/esm/util/colorRamp.d.ts +27 -1
- package/esm/util/colorRamp.js +56 -2
- package/esm/util/colorSchemes.d.ts +9 -0
- package/esm/util/colorSchemes.js +7 -0
- package/esm/util/{createStopTokenRotation.d.ts → createAbortRotation.d.ts} +11 -14
- package/esm/util/{createStopTokenRotation.js → createAbortRotation.js} +14 -26
- package/esm/util/cssColorParse.d.ts +15 -0
- package/esm/util/cssColorParse.js +53 -0
- package/esm/util/diagonalizeRegions.d.ts +2 -3
- package/esm/util/diagonalizeRegions.js +7 -12
- package/esm/util/expandLooseSearchIndex.d.ts +7 -0
- package/esm/util/expandLooseSearchIndex.js +25 -0
- package/esm/util/featureTransforms.d.ts +30 -3
- package/esm/util/featureTransforms.js +233 -36
- package/esm/util/fetchAndMaybeUnzip.js +5 -6
- package/esm/util/fetchContext.d.ts +5 -6
- package/esm/util/fetchContext.js +1 -1
- package/esm/util/fetchHub.d.ts +3 -1
- package/esm/util/fetchHub.js +2 -2
- package/esm/util/fetchSeq.d.ts +2 -3
- package/esm/util/fetchSeq.js +2 -2
- package/esm/util/fieldReader.d.ts +17 -0
- package/esm/util/fieldReader.js +62 -0
- package/esm/util/groupKeys.d.ts +75 -0
- package/esm/util/groupKeys.js +152 -0
- package/esm/util/highlights.d.ts +6 -4
- package/esm/util/highlights.js +12 -25
- package/esm/util/hooks.d.ts +1 -2
- package/esm/util/hooks.js +1 -2
- package/esm/util/index.d.ts +3 -3
- package/esm/util/index.js +4 -3
- package/esm/util/indexCandidates.js +1 -1
- package/esm/util/installFetch.d.ts +13 -10
- package/esm/util/installFetch.js +11 -10
- package/esm/util/installPrerequisiteFetch.d.ts +5 -3
- package/esm/util/installPrerequisiteFetch.js +3 -4
- package/esm/util/io/index.js +12 -12
- package/esm/util/isDataCurrent.d.ts +7 -5
- package/esm/util/isDataCurrent.js +9 -6
- package/esm/util/jexl.js +24 -21
- package/esm/util/jexlFilterRows.d.ts +89 -0
- package/esm/util/jexlFilterRows.js +252 -0
- package/esm/util/jexlFilters.d.ts +7 -5
- package/esm/util/jexlStrings.d.ts +3 -4
- package/esm/util/jexlStrings.js +2 -3
- package/esm/util/legendCandidates.d.ts +31 -27
- package/esm/util/legendCandidates.js +79 -53
- package/esm/util/localStorage.js +4 -4
- package/esm/util/markEncoding.d.ts +32 -16
- package/esm/util/markEncoding.js +177 -150
- package/esm/util/markEncodingTypes.d.ts +137 -66
- package/esm/util/mstUtils.d.ts +19 -22
- package/esm/util/mstUtils.js +19 -22
- package/esm/util/numericUtils.d.ts +7 -0
- package/esm/util/numericUtils.js +16 -0
- package/esm/util/numericValue.d.ts +14 -0
- package/esm/util/numericValue.js +34 -0
- package/esm/util/openFeatureWidget.js +1 -2
- package/esm/util/openViews.d.ts +1 -0
- package/esm/util/openViews.js +3 -3
- package/esm/util/parseLineByLine.d.ts +3 -4
- package/esm/util/parseLineByLine.js +7 -13
- package/esm/util/progress.d.ts +21 -21
- package/esm/util/progress.js +27 -26
- package/esm/util/renameRegions.d.ts +1 -2
- package/esm/util/renderToStaticMarkup.js +16 -16
- package/esm/util/rxjs.d.ts +7 -8
- package/esm/util/rxjs.js +12 -15
- package/esm/util/simpleFeature.d.ts +0 -1
- package/esm/util/svgColorProps.d.ts +11 -0
- package/esm/util/svgColorProps.js +28 -1
- package/esm/util/tabix.d.ts +3 -4
- package/esm/util/tabix.js +6 -7
- package/esm/util/thresholdScale.d.ts +54 -0
- package/esm/util/thresholdScale.js +112 -0
- package/esm/util/timeGate.d.ts +4 -5
- package/esm/util/timeGate.js +4 -5
- package/esm/util/trackConfigDelta.d.ts +22 -18
- package/esm/util/trackConfigDelta.js +40 -38
- package/esm/util/tracks.d.ts +27 -4
- package/esm/util/tracks.js +116 -43
- package/esm/util/translateTranscript.d.ts +44 -0
- package/esm/util/translateTranscript.js +102 -0
- package/esm/util/types/index.d.ts +19 -7
- package/esm/util/types/services.d.ts +1 -1
- package/esm/util/unknownSnapshotKeys.d.ts +15 -0
- package/esm/util/unknownSnapshotKeys.js +13 -0
- package/esm/util/useFeatureSequence.js +4 -4
- package/esm/util/useFetch.d.ts +3 -4
- package/esm/util/useFetch.js +5 -6
- package/esm/util/usePanelVirtualScroll.d.ts +7 -39
- package/esm/util/usePanelVirtualScroll.js +9 -40
- package/esm/util/useRowVirtualScroll.d.ts +6 -29
- package/esm/util/useRowVirtualScroll.js +8 -49
- package/esm/util/useVirtualScrollWheel.d.ts +20 -4
- package/esm/util/useVirtualScrollWheel.js +40 -84
- package/esm/util/viewHighlights.d.ts +3 -0
- package/esm/util/viewHighlights.js +5 -0
- package/esm/util/viewStatus.d.ts +24 -15
- package/esm/util/viewStatus.js +17 -0
- package/esm/util/withLaunchInput.d.ts +1 -1
- package/esm/util/withLaunchInput.js +0 -4
- package/package.json +26 -12
- package/esm/BaseFeatureWidget/SequenceFeatureDetails/test_data/DLGAP3.d.ts +0 -80
- package/esm/BaseFeatureWidget/SequenceFeatureDetails/test_data/DLGAP3.js +0 -583
- package/esm/BaseFeatureWidget/SequenceFeatureDetails/test_data/NCDN.d.ts +0 -141
- package/esm/BaseFeatureWidget/SequenceFeatureDetails/test_data/NCDN.js +0 -1116
- package/esm/ReExports/BaseFeatureDetails.d.ts +0 -1
- package/esm/ReExports/BaseFeatureDetails.js +0 -10
- package/esm/ReExports/barrelOnlyNames.d.ts +0 -5
- package/esm/ReExports/barrelOnlyNames.js +0 -63
- package/esm/ReExports/index.d.ts +0 -1
- package/esm/ReExports/index.js +0 -1
- package/esm/ReExports/publicTracks.d.ts +0 -1
- package/esm/ReExports/publicTracks.js +0 -14
- package/esm/ReExports/publicUi.d.ts +0 -4
- package/esm/ReExports/publicUi.js +0 -33
- package/esm/ReExports/publicUtil.d.ts +0 -1
- package/esm/ReExports/publicUtil.js +0 -32
- package/esm/ReExports/sharedModules.d.ts +0 -96
- package/esm/ReExports/sharedModules.js +0 -66
- package/esm/ReExports/workerNamespaceNames.d.ts +0 -11
- package/esm/ReExports/workerNamespaceNames.js +0 -275
- package/esm/pluggableElementTypes/models/HighlightsMixin.d.ts +0 -51
- package/esm/pluggableElementTypes/models/HighlightsMixin.js +0 -78
- package/esm/ui/highlightChipReveal.d.ts +0 -32
- package/esm/ui/highlightChipReveal.js +0 -39
- package/esm/util/adapterConfigKey.d.ts +0 -12
- package/esm/util/adapterConfigKey.js +0 -14
- package/esm/util/stopToken.d.ts +0 -212
- package/esm/util/stopToken.js +0 -438
|
@@ -1,7 +1,18 @@
|
|
|
1
1
|
import { types } from '@jbrowse/mobx-state-tree';
|
|
2
|
+
import { isCssColor } from '../util/cssColorParse.js';
|
|
2
3
|
import { isJexl, stringToJexlExpression } from '../util/jexlStrings.js';
|
|
3
4
|
import { FileLocation } from '../util/types/mst.js';
|
|
4
5
|
import { isCallbackValue } from './slotValueUtils.js';
|
|
6
|
+
// What a color slot admits is what the painters parse (`isCssColor`), plus the
|
|
7
|
+
// empty string a slot such as `outlineColor` spells "none" with; a field name
|
|
8
|
+
// written where a color goes used to load and paint the invalid sentinel.
|
|
9
|
+
function notAColor(value) {
|
|
10
|
+
return `${JSON.stringify(value)} is not a color. A color is a CSS color: a name like "red" or "steelblue", "#rgb" / "#rrggbb" / "#rrggbbaa", "rgb()" / "rgba()" / "hsl()" / "hsla()", or "transparent"; a color computed per feature is a "jexl:" callback, in a slot that takes one`;
|
|
11
|
+
}
|
|
12
|
+
const CssColorType = types.refinement('CssColor', types.string, value => value === '' || isCssColor(value), notAColor);
|
|
13
|
+
// An entry of a colour list has no "none" to spell, so '' is refused with the
|
|
14
|
+
// rest of what is not a colour.
|
|
15
|
+
const CssColorEntryType = types.refinement('CssColorEntry', types.string, isCssColor, notAColor);
|
|
5
16
|
// Single source of truth for the builtin slot type names, pairing each with its
|
|
6
17
|
// MST value type and its editor fallback default. Keeping model + fallback in
|
|
7
18
|
// one table means adding a slot type is one edit and can't half-register.
|
|
@@ -13,15 +24,14 @@ import { isCallbackValue } from './slotValueUtils.js';
|
|
|
13
24
|
// of.
|
|
14
25
|
const slotTypes = {
|
|
15
26
|
stringArray: { model: types.array(types.string), fallbackDefault: [] },
|
|
27
|
+
colorArray: { model: types.array(CssColorEntryType), fallbackDefault: [] },
|
|
16
28
|
stringArrayMap: {
|
|
17
29
|
model: types.map(types.array(types.string)),
|
|
18
30
|
fallbackDefault: {},
|
|
19
31
|
},
|
|
20
32
|
numberMap: { model: types.map(types.number), fallbackDefault: {} },
|
|
21
33
|
boolean: { model: types.boolean, fallbackDefault: true },
|
|
22
|
-
|
|
23
|
-
// `type` metadata, and values are accepted unvalidated (CSS names, hex, jexl)
|
|
24
|
-
color: { model: types.string, fallbackDefault: 'black' },
|
|
34
|
+
color: { model: CssColorType, fallbackDefault: 'black' },
|
|
25
35
|
integer: { model: types.integer, fallbackDefault: 1 },
|
|
26
36
|
number: { model: types.number, fallbackDefault: 1 },
|
|
27
37
|
// The `maybe*` types spend `undefined` on "not explicitly set", which is the
|
|
@@ -31,11 +41,17 @@ const slotTypes = {
|
|
|
31
41
|
maybeBoolean: { model: types.maybe(types.boolean) },
|
|
32
42
|
// for a slot whose unset state means "decide from the data" — a feature's own
|
|
33
43
|
// BED itemRgb, say
|
|
34
|
-
maybeColor: { model: types.maybe(
|
|
35
|
-
// object-valued, e.g. alignments `
|
|
44
|
+
maybeColor: { model: types.maybe(CssColorType) },
|
|
45
|
+
// object-valued, e.g. alignments `sortedBy`
|
|
36
46
|
maybeFrozen: { model: types.maybe(types.frozen()) },
|
|
47
|
+
// for text whose unset state is a third thing beside some text and none: an
|
|
48
|
+
// axis title is derived while unset, and drawn bare once it is ''
|
|
49
|
+
maybeString: { model: types.maybe(types.string) },
|
|
37
50
|
string: { model: types.string, fallbackDefault: '' },
|
|
38
51
|
text: { model: types.string, fallbackDefault: '' },
|
|
52
|
+
// a field the display reads per feature: a name, a dotted path, or a
|
|
53
|
+
// `jexl:` expression, which the display evaluates and the reader never does
|
|
54
|
+
featureField: { model: types.string, fallbackDefault: '' },
|
|
39
55
|
fileLocation: {
|
|
40
56
|
model: FileLocation,
|
|
41
57
|
fallbackDefault: {
|
|
@@ -45,10 +61,16 @@ const slotTypes = {
|
|
|
45
61
|
},
|
|
46
62
|
frozen: { model: types.frozen(), fallbackDefault: {} },
|
|
47
63
|
};
|
|
48
|
-
// The
|
|
49
|
-
// `types.enumeration` as `model
|
|
50
|
-
//
|
|
51
|
-
|
|
64
|
+
// The types with no builtin table entry, because the author supplies the
|
|
65
|
+
// `types.enumeration` as `model` and `ConfigSlot` wraps it: in `types.maybe`
|
|
66
|
+
// for `maybeStringEnum`, in `types.array` for `stringEnumArray`. Named once,
|
|
67
|
+
// and spliced into both the type union and the runtime set below so those two
|
|
68
|
+
// cannot drift apart.
|
|
69
|
+
const ENUM_SLOT_TYPES = [
|
|
70
|
+
'stringEnum',
|
|
71
|
+
'maybeStringEnum',
|
|
72
|
+
'stringEnumArray',
|
|
73
|
+
];
|
|
52
74
|
/**
|
|
53
75
|
* The same closed set, at runtime, because the type alone does not close it for
|
|
54
76
|
* the callers that matter most: `ConfigSlot` is plugin-facing, and a JS plugin
|
|
@@ -82,15 +104,37 @@ const MAYBE_TYPES = new Set([
|
|
|
82
104
|
'maybeStringEnum',
|
|
83
105
|
]);
|
|
84
106
|
const JexlStringType = types.refinement('JexlString', types.string, isJexl);
|
|
107
|
+
const CALLBACK_SLOTS = 'a slot that takes a callback declares the names it reads, which its config docs list as callback args';
|
|
108
|
+
function notACallbackSlot(value) {
|
|
109
|
+
return `${JSON.stringify(value)} is a jexl: callback, and this slot takes a value: ${CALLBACK_SLOTS}`;
|
|
110
|
+
}
|
|
111
|
+
/** Why the slot `name`, of type `type`, refuses `value` on a write. */
|
|
112
|
+
export function slotWriteRefusal(name, type, value) {
|
|
113
|
+
return isJexl(value)
|
|
114
|
+
? `${name} takes no jexl: callback, and ${JSON.stringify(value)} is one: ${CALLBACK_SLOTS}`
|
|
115
|
+
: `${name} is a ${type} slot and cannot take ${JSON.stringify(value)}`;
|
|
116
|
+
}
|
|
117
|
+
function refusingCallbacks(model) {
|
|
118
|
+
return types.refinement(model, value => !isJexl(value), notACallbackSlot);
|
|
119
|
+
}
|
|
85
120
|
/**
|
|
86
|
-
* A configuration slot is a plain
|
|
87
|
-
*
|
|
88
|
-
*
|
|
89
|
-
*
|
|
90
|
-
*
|
|
91
|
-
*
|
|
92
|
-
*
|
|
93
|
-
*
|
|
121
|
+
* A configuration slot is a plain MST property holding the slot's value type,
|
|
122
|
+
* or, where the slot declares a `contextVariable`, that or a `jexl:...`
|
|
123
|
+
* callback string. Every other slot refuses a `jexl:` string, so a callback
|
|
124
|
+
* the reader would evaluate is one the schema says it takes. A `featureField`
|
|
125
|
+
* holds a `jexl:` expression as its value, which the display evaluates per
|
|
126
|
+
* feature. The value lives directly on the parent configuration model — there
|
|
127
|
+
* is no per-slot sub-model. `types.stripDefault` omits the property from the
|
|
128
|
+
* parent snapshot when it equals the default, so saved sessions stay minimal.
|
|
129
|
+
* Per-slot metadata (type/description/defaultValue/contextVariable) lives in
|
|
130
|
+
* the schema registry (a WeakMap keyed by the MST type, see
|
|
131
|
+
* schemaRegistry.ts); jexl callbacks are evaluated on read by
|
|
132
|
+
* `readConfObject`.
|
|
133
|
+
*
|
|
134
|
+
* Interning the returned type on `(type, model, defaultValue)` was prototyped
|
|
135
|
+
* and declined: a session builds 1197 slot types for 222 distinct ones, and
|
|
136
|
+
* removing the repeats moves neither the time nor the heap
|
|
137
|
+
* (`config-schema-construction`, published in `reference/EAGER_BUNDLE.md`).
|
|
94
138
|
*/
|
|
95
139
|
export default function ConfigSlot(definition) {
|
|
96
140
|
const { model, type, defaultValue } = definition;
|
|
@@ -122,11 +166,28 @@ export default function ConfigSlot(definition) {
|
|
|
122
166
|
if (defaultValue !== undefined && MAYBE_TYPES.has(type)) {
|
|
123
167
|
throw new Error(`a "${type}" slot cannot have a concrete defaultValue (${JSON.stringify(defaultValue)}): unset is the state a maybe* slot exists for, and no config can spell undefined, so it would be unreachable. If this slot overrides a base slot, the base's defaultValue merged in — state 'defaultValue: undefined' to overwrite it. Otherwise use the non-maybe form of the type.`);
|
|
124
168
|
}
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
169
|
+
const callback = !!definition.contextVariable?.length;
|
|
170
|
+
if (type === 'featureField' && callback) {
|
|
171
|
+
throw new Error('a "featureField" slot names a field the display reads per feature, and its jexl: expression is evaluated there, never called with a contextVariable. If this slot overrides a base callback slot, state \'contextVariable: undefined\'.');
|
|
172
|
+
}
|
|
173
|
+
if (!callback && isJexl(defaultValue)) {
|
|
174
|
+
throw new Error(`the defaultValue ${JSON.stringify(defaultValue)} is a jexl: callback, so the slot declares the contextVariable names it reads`);
|
|
175
|
+
}
|
|
176
|
+
const value = enumShaped(type, valueModel);
|
|
177
|
+
return types.stripDefault(callback
|
|
178
|
+
? types.union(JexlStringType, value)
|
|
179
|
+
: type === 'featureField'
|
|
180
|
+
? value
|
|
181
|
+
: refusingCallbacks(value), defaultValue);
|
|
182
|
+
}
|
|
183
|
+
// The author writes an enum slot's plain vocabulary, and the slot's shape
|
|
184
|
+
// around it is added here.
|
|
185
|
+
function enumShaped(type, model) {
|
|
186
|
+
return type === 'maybeStringEnum'
|
|
187
|
+
? types.maybe(model)
|
|
188
|
+
: type === 'stringEnumArray'
|
|
189
|
+
? types.array(model)
|
|
190
|
+
: model;
|
|
130
191
|
}
|
|
131
192
|
/**
|
|
132
193
|
* New value when converting a fixed-value slot to a jexl callback. Already-
|
|
@@ -28,28 +28,14 @@
|
|
|
28
28
|
* ```
|
|
29
29
|
*/
|
|
30
30
|
export declare function FormatAboutConfigSchemaFactory(): import("./configurationSchema.ts").ConfigurationSchemaType<{
|
|
31
|
-
/**
|
|
32
|
-
* #slot formatAbout.config
|
|
33
|
-
* callback returning an object of fields to merge over the config shown
|
|
34
|
-
*/
|
|
35
31
|
readonly config: {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
readonly contextVariable: ["config"];
|
|
32
|
+
type: "frozen";
|
|
33
|
+
} & {
|
|
34
|
+
defaultValue: unknown;
|
|
40
35
|
};
|
|
41
|
-
/**
|
|
42
|
-
* #slot formatAbout.hideUris
|
|
43
|
-
* leave file locations out of the About dialog, for a deployment that would
|
|
44
|
-
* rather not show users where the data sits. Hides URIs and local paths
|
|
45
|
-
* alike, drops the "Copy config" button, and suppresses the File info panel
|
|
46
|
-
* — a BAM's `@SQ UR:` and `@PG CL:` lines are locations too. "Show ref
|
|
47
|
-
* names" stays, since it exposes none. The two tiers are OR'd, so a
|
|
48
|
-
* session-wide `true` cannot be turned back on by a track. It hides the
|
|
49
|
-
* locations from the dialog only, not from `config.json`
|
|
50
|
-
*/
|
|
51
36
|
readonly hideUris: {
|
|
52
|
-
|
|
53
|
-
|
|
37
|
+
type: "boolean";
|
|
38
|
+
} & {
|
|
39
|
+
defaultValue: boolean;
|
|
54
40
|
};
|
|
55
|
-
}, import("./configurationSchema.ts").ConfigurationSchemaOptions<undefined, undefined
|
|
41
|
+
}, import("./configurationSchema.ts").ConfigurationSchemaOptions<undefined, undefined, undefined, import("./requirements.ts").ConfigurationSchemaRequirement<Partial<Record<string, string[]>>, string>>>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Levels of subfeature the `subfeatures` callback runs on when no tier sets
|
|
3
|
-
* `depth`.
|
|
4
|
-
*
|
|
3
|
+
* `depth`. Applied by the reader rather than as the slot's `defaultValue`, so
|
|
4
|
+
* the slot can still read as unset and the session's value reach a track.
|
|
5
5
|
*/
|
|
6
6
|
export declare const DEFAULT_FORMAT_DETAILS_DEPTH = 2;
|
|
7
7
|
/**
|
|
@@ -35,46 +35,20 @@ export declare const DEFAULT_FORMAT_DETAILS_DEPTH = 2;
|
|
|
35
35
|
* ```
|
|
36
36
|
*/
|
|
37
37
|
export declare function FormatDetailsConfigSchemaFactory(): import("./configurationSchema.ts").ConfigurationSchemaType<{
|
|
38
|
-
/**
|
|
39
|
-
* #slot formatDetails.feature
|
|
40
|
-
* callback returning an object of fields to merge onto the clicked feature.
|
|
41
|
-
* A plain object works too, for fields that are the same on every feature
|
|
42
|
-
*/
|
|
43
38
|
readonly feature: {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
readonly contextVariable: ["feature"];
|
|
39
|
+
type: "frozen";
|
|
40
|
+
} & {
|
|
41
|
+
defaultValue: unknown;
|
|
48
42
|
};
|
|
49
|
-
/**
|
|
50
|
-
* #slot formatDetails.subfeatures
|
|
51
|
-
* the same, applied to each subfeature down to `depth`
|
|
52
|
-
*/
|
|
53
43
|
readonly subfeatures: {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
readonly contextVariable: ["feature"];
|
|
44
|
+
type: "frozen";
|
|
45
|
+
} & {
|
|
46
|
+
defaultValue: unknown;
|
|
58
47
|
};
|
|
59
|
-
/**
|
|
60
|
-
* #slot formatDetails.depth
|
|
61
|
-
* how many levels of subfeature the `subfeatures` callback runs on,
|
|
62
|
-
* defaulting to 2, which stops at a gene's transcripts rather than
|
|
63
|
-
* descending into their exons and CDSs. A track's value wins over the
|
|
64
|
-
* session's
|
|
65
|
-
*/
|
|
66
48
|
readonly depth: {
|
|
67
|
-
|
|
68
|
-
readonly description: "levels of subfeature the formatDetails.subfeatures callback runs on, default 2";
|
|
49
|
+
type: "maybeNumber";
|
|
69
50
|
};
|
|
70
|
-
/**
|
|
71
|
-
* #slot formatDetails.maxDepth
|
|
72
|
-
* how many levels of subfeature card the panel renders at all, which is a
|
|
73
|
-
* separate question from how deep `subfeatures` formats. Unset means no
|
|
74
|
-
* limit. A track's value wins over the session's
|
|
75
|
-
*/
|
|
76
51
|
readonly maxDepth: {
|
|
77
|
-
|
|
78
|
-
readonly description: "hide subfeatures nested deeper than this, default no limit";
|
|
52
|
+
type: "maybeNumber";
|
|
79
53
|
};
|
|
80
|
-
}, import("./configurationSchema.ts").ConfigurationSchemaOptions<undefined, undefined
|
|
54
|
+
}, import("./configurationSchema.ts").ConfigurationSchemaOptions<undefined, undefined, undefined, import("./requirements.ts").ConfigurationSchemaRequirement<Partial<Record<string, string[]>>, string>>>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ConfigurationSchema } from './configurationSchema.js';
|
|
2
2
|
/**
|
|
3
3
|
* Levels of subfeature the `subfeatures` callback runs on when no tier sets
|
|
4
|
-
* `depth`.
|
|
5
|
-
*
|
|
4
|
+
* `depth`. Applied by the reader rather than as the slot's `defaultValue`, so
|
|
5
|
+
* the slot can still read as unset and the session's value reach a track.
|
|
6
6
|
*/
|
|
7
7
|
export const DEFAULT_FORMAT_DETAILS_DEPTH = 2;
|
|
8
8
|
/**
|
|
@@ -40,23 +40,27 @@ export function FormatDetailsConfigSchemaFactory() {
|
|
|
40
40
|
/**
|
|
41
41
|
* #slot formatDetails.feature
|
|
42
42
|
* callback returning an object of fields to merge onto the clicked feature.
|
|
43
|
-
*
|
|
43
|
+
* `track` is the track's config, so one session-wide callback can link out
|
|
44
|
+
* per assembly or name the track. A plain object works too, for fields
|
|
45
|
+
* that are the same on every feature
|
|
44
46
|
*/
|
|
45
47
|
feature: {
|
|
46
48
|
type: 'frozen',
|
|
47
49
|
description: 'adds extra fields to the feature details',
|
|
48
50
|
defaultValue: {},
|
|
49
|
-
contextVariable: ['feature'],
|
|
51
|
+
contextVariable: ['feature', 'track'],
|
|
50
52
|
},
|
|
51
53
|
/**
|
|
52
54
|
* #slot formatDetails.subfeatures
|
|
53
|
-
* the same, applied to each subfeature down to `depth`
|
|
55
|
+
* the same, applied to each subfeature down to `depth`. `parent` is the
|
|
56
|
+
* feature it sits in and `depth` how far down, 1 for a gene's transcript
|
|
57
|
+
* and 2 for the transcript's exon
|
|
54
58
|
*/
|
|
55
59
|
subfeatures: {
|
|
56
60
|
type: 'frozen',
|
|
57
61
|
description: 'adds extra fields to the subfeatures of a feature',
|
|
58
62
|
defaultValue: {},
|
|
59
|
-
contextVariable: ['feature'],
|
|
63
|
+
contextVariable: ['feature', 'parent', 'depth', 'track'],
|
|
60
64
|
},
|
|
61
65
|
/**
|
|
62
66
|
* #slot formatDetails.depth
|
|
@@ -66,11 +70,6 @@ export function FormatDetailsConfigSchemaFactory() {
|
|
|
66
70
|
* session's
|
|
67
71
|
*/
|
|
68
72
|
depth: {
|
|
69
|
-
// `maybeNumber`, so unset is expressible. With a `defaultValue` the two
|
|
70
|
-
// tiers cannot be told apart -- a plain number slot reads back its own
|
|
71
|
-
// default, so "the track set 2" and "the track set nothing" are the same
|
|
72
|
-
// read, and the session-wide value can never apply to a track. The
|
|
73
|
-
// resolved default is DEFAULT_FORMAT_DETAILS_DEPTH, applied by the reader
|
|
74
73
|
type: 'maybeNumber',
|
|
75
74
|
description: 'levels of subfeature the formatDetails.subfeatures callback runs on, default 2',
|
|
76
75
|
},
|
|
@@ -81,8 +80,6 @@ export function FormatDetailsConfigSchemaFactory() {
|
|
|
81
80
|
* limit. A track's value wins over the session's
|
|
82
81
|
*/
|
|
83
82
|
maxDepth: {
|
|
84
|
-
// `maybeNumber` for the same reason as `depth`, and here unset is also
|
|
85
|
-
// the meaningful value: no limit at all
|
|
86
83
|
type: 'maybeNumber',
|
|
87
84
|
description: 'hide subfeatures nested deeper than this, default no limit',
|
|
88
85
|
},
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AnyConfigurationModel, AnyConfigurationSnapshot, ConfigurationSchemaForModel, ConfigurationSlotName, ConfigurationSlotValue } from './types.ts';
|
|
1
|
+
import type { AnyConfigurationModel, AnyConfigurationSnapshot, ConfigurationSchemaForModel, ConfigurationSlotName, ConfigurationSlotPath, ConfigurationSlotPathValue, ConfigurationSlotValue } from './types.ts';
|
|
2
2
|
/**
|
|
3
3
|
* #api core/configuration
|
|
4
4
|
* Reads a configuration value from a state model that has a `.configuration`
|
|
@@ -19,13 +19,21 @@ import type { AnyConfigurationModel, AnyConfigurationSnapshot, ConfigurationSche
|
|
|
19
19
|
export declare function getConf(model: {
|
|
20
20
|
configuration: AnyConfigurationModel;
|
|
21
21
|
}): AnyConfigurationSnapshot;
|
|
22
|
-
export declare function getConf<CONFMODEL extends AnyConfigurationModel, SLOT extends ConfigurationSlotName<ConfigurationSchemaForModel<CONFMODEL>> |
|
|
22
|
+
export declare function getConf<CONFMODEL extends AnyConfigurationModel, const SLOT extends ConfigurationSlotName<ConfigurationSchemaForModel<CONFMODEL>> | ConfigurationSlotPath<ConfigurationSchemaForModel<CONFMODEL>> = ConfigurationSlotName<ConfigurationSchemaForModel<CONFMODEL>>>(model: {
|
|
23
23
|
configuration: CONFMODEL;
|
|
24
|
-
}, slotPath: SLOT, args?: Record<string, unknown>): SLOT extends string ? ConfigurationSlotValue<ConfigurationSchemaForModel<CONFMODEL>, SLOT> :
|
|
24
|
+
}, slotPath: SLOT, args?: Record<string, unknown>): SLOT extends string ? ConfigurationSlotValue<ConfigurationSchemaForModel<CONFMODEL>, SLOT> : ConfigurationSlotPathValue<ConfigurationSchemaForModel<CONFMODEL>, SLOT>;
|
|
25
25
|
/**
|
|
26
26
|
* #api core/configuration
|
|
27
|
-
* Write counterpart to `getConf
|
|
28
|
-
*
|
|
27
|
+
* Write counterpart to `getConf`, and it takes the same path: a slot name, or
|
|
28
|
+
* an array naming a sub-schema's member at any depth —
|
|
29
|
+
* `setConf(self, ['scales', 'y', 'domainMin'], 5)`. Takes the display or track
|
|
30
|
+
* model, or a config node directly.
|
|
31
|
+
*
|
|
32
|
+
* **The path length says what the write replaces.** A path ending on a slot
|
|
33
|
+
* writes that slot and leaves the object around it alone; a path ending on a
|
|
34
|
+
* sub-schema replaces the whole object, which is how a channel whose members
|
|
35
|
+
* move together — a facet's field and the domain that field's values order —
|
|
36
|
+
* gets written without a stale member surviving underneath.
|
|
29
37
|
*
|
|
30
38
|
* **Prefer this over a bare `self.configuration.setSlot('x', v)`.** The
|
|
31
39
|
* constraint here mirrors `getConf`'s, so on a model with a concrete schema an
|
|
@@ -49,10 +57,10 @@ export declare function getConf<CONFMODEL extends AnyConfigurationModel, SLOT ex
|
|
|
49
57
|
* `undefined` is a legitimate write — it resets a slot to its schema default —
|
|
50
58
|
* and the declared slot value type doesn't include it.
|
|
51
59
|
*
|
|
52
|
-
* @param
|
|
53
|
-
* @param
|
|
60
|
+
* @param target - a model with a `configuration` member, or a config node
|
|
61
|
+
* @param slotPath - the slot to write, or the path to one
|
|
54
62
|
* @param value - the new value
|
|
55
63
|
*/
|
|
56
|
-
export declare function setConf<CONFMODEL extends AnyConfigurationModel, SLOT extends ConfigurationSlotName<ConfigurationSchemaForModel<CONFMODEL>> = ConfigurationSlotName<ConfigurationSchemaForModel<CONFMODEL>>>(
|
|
64
|
+
export declare function setConf<CONFMODEL extends AnyConfigurationModel, const SLOT extends ConfigurationSlotName<ConfigurationSchemaForModel<CONFMODEL>> | ConfigurationSlotPath<ConfigurationSchemaForModel<CONFMODEL>> = ConfigurationSlotName<ConfigurationSchemaForModel<CONFMODEL>>>(target: CONFMODEL | {
|
|
57
65
|
configuration: CONFMODEL;
|
|
58
|
-
},
|
|
66
|
+
}, slotPath: SLOT, value: unknown): void;
|
|
@@ -1,11 +1,22 @@
|
|
|
1
|
+
import { getType, isArrayType } from '@jbrowse/mobx-state-tree';
|
|
1
2
|
import { readConfObject } from './readConfObject.js';
|
|
3
|
+
import { getConfigurationSchemaDefinition } from './schemaRegistry.js';
|
|
4
|
+
import { isConfigurationModel, isConfigurationSchemaType, } from './schemaTypes.js';
|
|
2
5
|
export function getConf(model, slotPath, args = {}) {
|
|
3
6
|
return readConfObject(model.configuration, slotPath, args);
|
|
4
7
|
}
|
|
5
8
|
/**
|
|
6
9
|
* #api core/configuration
|
|
7
|
-
* Write counterpart to `getConf
|
|
8
|
-
*
|
|
10
|
+
* Write counterpart to `getConf`, and it takes the same path: a slot name, or
|
|
11
|
+
* an array naming a sub-schema's member at any depth —
|
|
12
|
+
* `setConf(self, ['scales', 'y', 'domainMin'], 5)`. Takes the display or track
|
|
13
|
+
* model, or a config node directly.
|
|
14
|
+
*
|
|
15
|
+
* **The path length says what the write replaces.** A path ending on a slot
|
|
16
|
+
* writes that slot and leaves the object around it alone; a path ending on a
|
|
17
|
+
* sub-schema replaces the whole object, which is how a channel whose members
|
|
18
|
+
* move together — a facet's field and the domain that field's values order —
|
|
19
|
+
* gets written without a stale member surviving underneath.
|
|
9
20
|
*
|
|
10
21
|
* **Prefer this over a bare `self.configuration.setSlot('x', v)`.** The
|
|
11
22
|
* constraint here mirrors `getConf`'s, so on a model with a concrete schema an
|
|
@@ -29,11 +40,45 @@ export function getConf(model, slotPath, args = {}) {
|
|
|
29
40
|
* `undefined` is a legitimate write — it resets a slot to its schema default —
|
|
30
41
|
* and the declared slot value type doesn't include it.
|
|
31
42
|
*
|
|
32
|
-
* @param
|
|
33
|
-
* @param
|
|
43
|
+
* @param target - a model with a `configuration` member, or a config node
|
|
44
|
+
* @param slotPath - the slot to write, or the path to one
|
|
34
45
|
* @param value - the new value
|
|
35
46
|
*/
|
|
36
|
-
export function setConf(
|
|
37
|
-
|
|
38
|
-
|
|
47
|
+
export function setConf(target, slotPath, value) {
|
|
48
|
+
writeConfPath(isConfigurationModel(target) ? target : target.configuration, typeof slotPath === 'string' ? [slotPath] : slotPath, value);
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Walk to the node the last segment names a member of, then write that member
|
|
52
|
+
* through whichever of the node's three write actions the member is: a
|
|
53
|
+
* sub-schema is replaced, an array of sub-schemas is replaced, and a slot goes
|
|
54
|
+
* through `setSlot` so ADR-052's name guard and the value-type guard both run.
|
|
55
|
+
* MST's `applyPatch` takes the same path and runs neither guard.
|
|
56
|
+
*/
|
|
57
|
+
function writeConfPath(conf, path, value) {
|
|
58
|
+
if (!path.length) {
|
|
59
|
+
throw new Error('setConf needs a slot name or a path to one');
|
|
60
|
+
}
|
|
61
|
+
let node = conf;
|
|
62
|
+
for (const segment of path.slice(0, -1)) {
|
|
63
|
+
const child = node[segment];
|
|
64
|
+
if (!isConfigurationModel(child)) {
|
|
65
|
+
throw new Error(`${getType(node).name} has no sub-schema "${segment}", so ${path.join('.')} names nothing to write`);
|
|
66
|
+
}
|
|
67
|
+
node = child;
|
|
68
|
+
}
|
|
69
|
+
const leaf = path.at(-1);
|
|
70
|
+
// Classify off the declaration, never off what the member holds: a
|
|
71
|
+
// `stringArray` slot holds an array node, and an optional sub-schema nobody
|
|
72
|
+
// has written yet holds nothing.
|
|
73
|
+
const declared = getConfigurationSchemaDefinition(node)?.[leaf];
|
|
74
|
+
if (!isConfigurationSchemaType(declared)) {
|
|
75
|
+
// eslint-disable-next-line no-restricted-syntax -- this is setConf
|
|
76
|
+
node.setSlot(leaf, value);
|
|
77
|
+
}
|
|
78
|
+
else if (isArrayType(declared)) {
|
|
79
|
+
node.setSubschemaArray(leaf, value);
|
|
80
|
+
}
|
|
81
|
+
else {
|
|
82
|
+
node.setSubschema(leaf, value);
|
|
83
|
+
}
|
|
39
84
|
}
|
|
@@ -1,18 +1,25 @@
|
|
|
1
1
|
export { ConfigurationReference, ConfigurationSchema, hydrateTrackConfig, } from './configurationSchema.ts';
|
|
2
2
|
export type { ConfigurationSchemaDefinition } from './configurationSchema.ts';
|
|
3
|
-
export
|
|
4
|
-
export {
|
|
3
|
+
export { ConfigurationSchemaUnion, arraySlotUnion, } from './configurationSchemaUnion.ts';
|
|
4
|
+
export type { ConfigurationSchemaUnionType } from './configurationSchemaUnion.ts';
|
|
5
|
+
export type { ConfigSlotDefinition } from './configurationSlot.ts';
|
|
6
|
+
export type { AnyConfiguration, AnyConfigurationModel, AnyConfigurationSchemaType, AnyConfigurationSnapshot, ConfigModelForFields, ConfigNodeActions, ConfigNodeBrand, ConfigNodeProps, ConfigurationSchemaForModel, ConfigurationSlotName, ConfigurationSlotPath, ConfigurationSlotPathValue, ConfigurationSlotValue, ConfigurationSnapshot, HostChecksSlotNames, IdentifierSlotDef, TypeSlotDef, } from './types.ts';
|
|
7
|
+
export { getConfigurationSchemaDefinition, getConfigurationSchemaOptions, getConfigurationSchemaMetadata, getConfigurationSchemaUnion, } from './schemaRegistry.ts';
|
|
8
|
+
export type { ConfigurationSchemaUnionMetadata } from './schemaRegistry.ts';
|
|
5
9
|
export { getTypeNamesFromExplicitlyTypedUnion, isBareConfigurationSchemaType, isConfigurationModel, isConfigurationSchemaType, isConstantEntry, isSlotDefinitionEntry, } from './schemaTypes.ts';
|
|
6
10
|
export { FormatAboutConfigSchemaFactory } from './formatAboutConfigSchema.ts';
|
|
7
11
|
export { DEFAULT_FORMAT_DETAILS_DEPTH, FormatDetailsConfigSchemaFactory, } from './formatDetailsConfigSchema.ts';
|
|
8
12
|
export { mergeFormatCallbacks } from './mergeFormatCallbacks.ts';
|
|
9
|
-
export { readConfObject,
|
|
13
|
+
export { readConfObject, readConfigValue } from './readConfObject.ts';
|
|
10
14
|
export { getConf, setConf } from './getConf.ts';
|
|
11
15
|
export { fillLocations } from './fillLocations.ts';
|
|
16
|
+
export { preProcessConfigSnapshot, preProcessSnapshotWith, shorthandForm, } from './snapshotPreprocess.ts';
|
|
17
|
+
export { requirementProblems } from './requirements.ts';
|
|
18
|
+
export type { ConfigurationSchemaRequirement, RequirementProblem, } from './requirements.ts';
|
|
12
19
|
export { expandTabixShorthand, tabixIndexSnapshot } from './tabixShorthand.ts';
|
|
13
20
|
export { tabixIndexFields } from './tabixIndexFields.ts';
|
|
14
21
|
export { evaluateJexl, isCallbackValue } from './slotValueUtils.ts';
|
|
15
22
|
export { toCallbackValue, toFixedValue } from './configurationSlot.ts';
|
|
16
|
-
export { getSlotDefinition, isConfigurationSlot, makeSlotFacade, preProcessSlotValues, slotChoices, } from './slotFacade.ts';
|
|
23
|
+
export { getSlotDefinition, isConfigurationSlot, isConfigurationSubschema, makeSlotFacade, mergedSubschemaValue, preProcessSlotValues, slotChoices, slotValueRefusal, } from './slotFacade.ts';
|
|
17
24
|
export type { SlotFacade } from './slotFacade.ts';
|
|
18
25
|
export { fullConfSnapshot } from './fullConfSnapshot.ts';
|
|
@@ -1,20 +1,23 @@
|
|
|
1
1
|
export { ConfigurationReference, ConfigurationSchema, hydrateTrackConfig, } from './configurationSchema.js';
|
|
2
|
-
export {
|
|
2
|
+
export { ConfigurationSchemaUnion, arraySlotUnion, } from './configurationSchemaUnion.js';
|
|
3
|
+
export { getConfigurationSchemaDefinition, getConfigurationSchemaOptions,
|
|
3
4
|
// exported for scripts/generateConfigManifest.ts, which needs the
|
|
4
5
|
// preProcessSnapshot off a schema whose pluggable type does not expose one —
|
|
5
6
|
// TextSearchAdapterType, where the shorthand is nonetheless the documented
|
|
6
7
|
// way to write the config
|
|
7
|
-
getConfigurationSchemaMetadata, } from './schemaRegistry.js';
|
|
8
|
+
getConfigurationSchemaMetadata, getConfigurationSchemaUnion, } from './schemaRegistry.js';
|
|
8
9
|
export { getTypeNamesFromExplicitlyTypedUnion, isBareConfigurationSchemaType, isConfigurationModel, isConfigurationSchemaType, isConstantEntry, isSlotDefinitionEntry, } from './schemaTypes.js';
|
|
9
10
|
export { FormatAboutConfigSchemaFactory } from './formatAboutConfigSchema.js';
|
|
10
11
|
export { DEFAULT_FORMAT_DETAILS_DEPTH, FormatDetailsConfigSchemaFactory, } from './formatDetailsConfigSchema.js';
|
|
11
12
|
export { mergeFormatCallbacks } from './mergeFormatCallbacks.js';
|
|
12
|
-
export { readConfObject,
|
|
13
|
+
export { readConfObject, readConfigValue } from './readConfObject.js';
|
|
13
14
|
export { getConf, setConf } from './getConf.js';
|
|
14
15
|
export { fillLocations } from './fillLocations.js';
|
|
16
|
+
export { preProcessConfigSnapshot, preProcessSnapshotWith, shorthandForm, } from './snapshotPreprocess.js';
|
|
17
|
+
export { requirementProblems } from './requirements.js';
|
|
15
18
|
export { expandTabixShorthand, tabixIndexSnapshot } from './tabixShorthand.js';
|
|
16
19
|
export { tabixIndexFields } from './tabixIndexFields.js';
|
|
17
20
|
export { evaluateJexl, isCallbackValue } from './slotValueUtils.js';
|
|
18
21
|
export { toCallbackValue, toFixedValue } from './configurationSlot.js';
|
|
19
|
-
export { getSlotDefinition, isConfigurationSlot, makeSlotFacade, preProcessSlotValues, slotChoices, } from './slotFacade.js';
|
|
22
|
+
export { getSlotDefinition, isConfigurationSlot, isConfigurationSubschema, makeSlotFacade, mergedSubschemaValue, preProcessSlotValues, slotChoices, slotValueRefusal, } from './slotFacade.js';
|
|
20
23
|
export { fullConfSnapshot } from './fullConfSnapshot.js';
|
|
@@ -4,12 +4,11 @@
|
|
|
4
4
|
* first, so a track's object is spread over the session-wide one and can
|
|
5
5
|
* override individual keys the global callback added.
|
|
6
6
|
*
|
|
7
|
-
* A tier that
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* and
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
* hides a field, and the panels filter them out downstream.
|
|
7
|
+
* A tier that returns something other than an object is an authoring mistake,
|
|
8
|
+
* `"jexl:feature.name"` where `"jexl:{name:feature.name}"` was meant, and it
|
|
9
|
+
* throws rather than vanishing: spread, the string became rows keyed 0, 1, 2,
|
|
10
|
+
* and dropped, the author's callback silently did nothing. A tier returning
|
|
11
|
+
* null or undefined has nothing to add. `null` and `undefined` *values* survive:
|
|
12
|
+
* they are how a callback hides a field, and the panels filter them downstream.
|
|
14
13
|
*/
|
|
15
14
|
export declare function mergeFormatCallbacks(...tiers: unknown[]): Record<string, unknown>;
|
|
@@ -1,24 +1,27 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { isPlainObject } from '../util/objectUtils.js';
|
|
2
2
|
/**
|
|
3
3
|
* Combine the tiers of an object-returning format callback (`formatDetails` on
|
|
4
4
|
* the feature-details panel, `formatAbout` on the About dialog), earliest
|
|
5
5
|
* first, so a track's object is spread over the session-wide one and can
|
|
6
6
|
* override individual keys the global callback added.
|
|
7
7
|
*
|
|
8
|
-
* A tier that
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* and
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* hides a field, and the panels filter them out downstream.
|
|
8
|
+
* A tier that returns something other than an object is an authoring mistake,
|
|
9
|
+
* `"jexl:feature.name"` where `"jexl:{name:feature.name}"` was meant, and it
|
|
10
|
+
* throws rather than vanishing: spread, the string became rows keyed 0, 1, 2,
|
|
11
|
+
* and dropped, the author's callback silently did nothing. A tier returning
|
|
12
|
+
* null or undefined has nothing to add. `null` and `undefined` *values* survive:
|
|
13
|
+
* they are how a callback hides a field, and the panels filter them downstream.
|
|
15
14
|
*/
|
|
16
15
|
export function mergeFormatCallbacks(...tiers) {
|
|
17
16
|
const out = {};
|
|
18
17
|
for (const tier of tiers) {
|
|
19
|
-
if (
|
|
20
|
-
|
|
18
|
+
if (tier == null) {
|
|
19
|
+
continue;
|
|
20
|
+
}
|
|
21
|
+
if (!isPlainObject(tier)) {
|
|
22
|
+
throw new Error(`a format callback returned ${Array.isArray(tier) ? 'an array' : `a ${typeof tier}`} where an object of fields was expected, e.g. "jexl:{name:feature.name}" rather than "jexl:feature.name"`);
|
|
21
23
|
}
|
|
24
|
+
Object.assign(out, tier);
|
|
22
25
|
}
|
|
23
26
|
return out;
|
|
24
27
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Feature } from '../util/index.ts';
|
|
2
2
|
import type { JexlInstance } from '../util/jexlStrings.ts';
|
|
3
|
-
import type { AnyConfigurationModel, AnyConfigurationSchemaType, AnyConfigurationSnapshot, ConfigurationSchemaForModel, ConfigurationSlotName, ConfigurationSlotValue } from './types.ts';
|
|
3
|
+
import type { AnyConfigurationModel, AnyConfigurationSchemaType, AnyConfigurationSnapshot, ConfigurationSchemaForModel, ConfigurationSlotName, ConfigurationSlotPath, ConfigurationSlotPathValue, ConfigurationSlotValue } from './types.ts';
|
|
4
4
|
import type { IMSTMap } from '@jbrowse/mobx-state-tree';
|
|
5
5
|
/**
|
|
6
6
|
* #api core/configuration
|
|
@@ -25,7 +25,7 @@ import type { IMSTMap } from '@jbrowse/mobx-state-tree';
|
|
|
25
25
|
* will be sent to each of the slotNames
|
|
26
26
|
*/
|
|
27
27
|
export declare function readConfObject(confObject: AnyConfigurationModel): AnyConfigurationSnapshot;
|
|
28
|
-
export declare function readConfObject<CONFMODEL extends AnyConfigurationModel, SLOT extends ConfigurationSlotName<ConfigurationSchemaForModel<CONFMODEL>> |
|
|
28
|
+
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>;
|
|
29
29
|
export declare function readConfObject(confObject: IMSTMap<AnyConfigurationSchemaType>, slotPath?: string | string[], args?: Record<string, unknown>): any;
|
|
30
30
|
/**
|
|
31
31
|
* Read a value from a plain config snapshot object. Automatically evaluates
|
|
@@ -34,23 +34,3 @@ export declare function readConfObject(confObject: IMSTMap<AnyConfigurationSchem
|
|
|
34
34
|
* so plugin-registered functions (e.g. in a custom `mouseover` slot) resolve.
|
|
35
35
|
*/
|
|
36
36
|
export declare function readConfigValue<T>(config: Record<string, unknown>, key: string | string[], feature: Feature, jexl: JexlInstance): T;
|
|
37
|
-
/**
|
|
38
|
-
* #api core/configuration
|
|
39
|
-
* Read a single config slot from a config that may be **either** a live MST
|
|
40
|
-
* node or a plain snapshot object, evaluating the value if it is a `jexl:`
|
|
41
|
-
* expression. For the dialogs and panels that are handed a track config without
|
|
42
|
-
* knowing which of the two they got. An About panel gets a hydrated track
|
|
43
|
-
* config from the session and a bare object from an embedded caller.
|
|
44
|
-
*
|
|
45
|
-
* Reach for `readConfObject` or `readConfigValue` when the shape is known:
|
|
46
|
-
* this one decides at runtime, and the plain branch inherits the snapshot
|
|
47
|
-
* caveat (a slot at its default is absent from a snapshot, so it reads
|
|
48
|
-
* `undefined`).
|
|
49
|
-
*
|
|
50
|
-
* @param config - live config model or plain config object
|
|
51
|
-
* @param slotPath - slot name, or path of sub-config names ending in a slot
|
|
52
|
-
* @param args - extra arguments for a callback slot, e.g. `{ feature }`
|
|
53
|
-
* @param jexl - realm jexl instance, required only to evaluate a callback slot
|
|
54
|
-
* on a plain object (a live node resolves its own from env)
|
|
55
|
-
*/
|
|
56
|
-
export declare function readConfSlot<T = unknown>(config: AnyConfigurationModel | Record<string, unknown>, slotPath: string | string[], args?: Record<string, unknown>, jexl?: JexlInstance): T;
|