@jbrowse/core 5.0.0-beta.3 → 5.0.0-beta.7
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 +278 -250
- package/esm/PluginManager.js +1 -1
- package/esm/ReExports/publicUi.d.ts +1 -1
- package/esm/ReExports/publicUi.js +1 -1
- package/esm/ReExports/publicUtil.d.ts +1 -1
- package/esm/ReExports/publicUtil.js +1 -1
- package/esm/ReExports/workerNamespaceNames.js +3 -9
- package/esm/assemblyManager/assemblyConfigSchema.d.ts +2 -1
- package/esm/assemblyManager/assemblyConfigSchema.js +2 -1
- package/esm/assemblyManager/expandAssemblyConfigShorthand.d.ts +15 -15
- package/esm/assemblyManager/expandAssemblyConfigShorthand.js +34 -18
- package/esm/configuration/configurationSchema.d.ts +1 -2
- package/esm/configuration/configurationSchema.js +3 -8
- package/esm/configuration/configurationSlot.d.ts +0 -47
- package/esm/configuration/configurationSlot.js +4 -54
- package/esm/configuration/fillLocations.d.ts +14 -0
- package/esm/configuration/fillLocations.js +14 -0
- package/esm/configuration/fullConfSnapshot.d.ts +0 -15
- package/esm/configuration/fullConfSnapshot.js +0 -28
- package/esm/configuration/getConf.d.ts +4 -34
- package/esm/configuration/getConf.js +3 -38
- package/esm/configuration/index.d.ts +3 -4
- package/esm/configuration/index.js +3 -2
- package/esm/configuration/schemaRegistry.d.ts +1 -2
- package/esm/configuration/schemaRegistry.js +1 -2
- package/esm/configuration/slotFacade.d.ts +1 -16
- package/esm/configuration/slotFacade.js +1 -2
- package/esm/configuration/tabixShorthand.js +3 -3
- package/esm/configuration/types.d.ts +4 -16
- package/esm/data_adapters/CytobandAdapter/configSchema.js +3 -4
- package/esm/pluggableElementTypes/DisplayType.d.ts +5 -3
- package/esm/pluggableElementTypes/DisplayType.js +3 -1
- package/esm/pluggableElementTypes/models/BaseTrackModel.d.ts +30 -0
- package/esm/pluggableElementTypes/models/BaseTrackModel.js +45 -17
- package/esm/rpc/RpcRegistry.d.ts +7 -1
- package/esm/rpc/coreRpcMethods.d.ts +1 -0
- package/esm/rpc/coreRpcMethods.js +1 -0
- package/esm/rpc/methods/CoreEncodeFeatures.d.ts +15 -0
- package/esm/rpc/methods/CoreEncodeFeatures.js +62 -0
- package/esm/svg/svgId.d.ts +1 -1
- package/esm/svg/svgId.js +1 -1
- package/esm/ui/LegendSwatchGlyph.js +26 -21
- package/esm/ui/MenuTypes.d.ts +5 -52
- package/esm/ui/SizeSliderRow.d.ts +1 -3
- package/esm/ui/SizeSliderRow.js +4 -6
- package/esm/ui/SvgColorLegend.d.ts +9 -3
- package/esm/ui/SvgColorLegend.js +74 -33
- package/esm/ui/colorScale.d.ts +64 -0
- package/esm/ui/colorScale.js +41 -0
- package/esm/ui/colors.d.ts +11 -0
- package/esm/ui/colors.js +7 -0
- package/esm/ui/index.d.ts +5 -7
- package/esm/ui/index.js +3 -13
- package/esm/ui/legendMenuItem.d.ts +5 -16
- package/esm/ui/legendMenuItem.js +3 -14
- package/esm/ui/legendSpec.d.ts +11 -5
- package/esm/ui/legendSpec.js +8 -11
- package/esm/ui/makeSizeMenu.d.ts +0 -6
- package/esm/ui/makeSizeMenu.js +6 -30
- package/esm/ui/measureLegendText.js +1 -1
- package/esm/ui/menuItemAdornment.d.ts +9 -19
- package/esm/ui/menuItemAdornment.js +10 -31
- package/esm/ui/menuItems.d.ts +2 -6
- package/esm/ui/menuItems.js +0 -4
- package/esm/ui/palette.js +2 -1
- package/esm/ui/toggleMenuItems.d.ts +6 -13
- package/esm/ui/toggleMenuItems.js +13 -29
- package/esm/util/colorRamp.d.ts +3 -3
- package/esm/util/colorRamp.js +2 -2
- package/esm/util/featureTransforms.d.ts +15 -0
- package/esm/util/featureTransforms.js +342 -0
- package/esm/util/freezeDeep.d.ts +8 -10
- package/esm/util/freezeDeep.js +8 -10
- package/esm/util/glyphNames.d.ts +8 -0
- package/esm/util/glyphNames.js +12 -0
- package/esm/util/index.d.ts +0 -1
- package/esm/util/index.js +0 -1
- package/esm/util/markEncoding.d.ts +76 -0
- package/esm/util/markEncoding.js +436 -0
- package/esm/util/markEncodingTypes.d.ts +331 -0
- package/esm/util/markEncodingTypes.js +8 -0
- package/esm/util/renderToStaticMarkup.js +1 -1
- package/esm/util/starFusion.d.ts +26 -0
- package/esm/util/starFusion.js +37 -0
- package/esm/util/trackConfigDelta.d.ts +4 -8
- package/esm/util/trackConfigDelta.js +2 -4
- package/esm/util/tracks.d.ts +7 -1
- package/esm/util/tracks.js +72 -7
- package/esm/util/types/index.d.ts +12 -4
- package/esm/util/whenViewSettled.d.ts +40 -6
- package/esm/util/whenViewSettled.js +41 -5
- package/package.json +13 -3
- package/esm/configuration/promotableDefaults.d.ts +0 -234
- package/esm/configuration/promotableDefaults.js +0 -395
- package/esm/configuration/promotablePin.d.ts +0 -65
- package/esm/configuration/promotablePin.js +0 -1
- package/esm/configuration/promotableResolve.d.ts +0 -108
- package/esm/configuration/promotableResolve.js +0 -117
- package/esm/configuration/promotableSlots.d.ts +0 -12
- package/esm/configuration/promotableSlots.js +0 -45
- package/esm/configuration/slotShape.d.ts +0 -12
- package/esm/configuration/slotShape.js +0 -84
- package/esm/ui/PinAdornment.d.ts +0 -5
- package/esm/ui/PinAdornment.js +0 -67
- package/esm/ui/SvgGradientLegend.d.ts +0 -26
- package/esm/ui/SvgGradientLegend.js +0 -26
- package/esm/ui/promotablePinCoverage.d.ts +0 -58
- package/esm/ui/promotablePinCoverage.js +0 -124
- package/esm/util/openDisplays.d.ts +0 -23
- package/esm/util/openDisplays.js +0 -79
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
export interface SettleableView {
|
|
2
|
+
initialized: boolean;
|
|
3
|
+
error: unknown;
|
|
4
|
+
pendingLaunch?: unknown;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* A view that is up AND has finished applying whatever launched it.
|
|
8
|
+
*
|
|
9
|
+
* Both terms, for the reason spelled out on {@link whenViewSettled} below.
|
|
10
|
+
* Exported because AppReadyMarker decides the same thing from the same model
|
|
11
|
+
* for the whole app, the two drifted on exactly this second term, and
|
|
12
|
+
* `readinessTerms.test.tsx` in app-core now holds them together.
|
|
13
|
+
*/
|
|
14
|
+
export declare const viewSettled: (view: SettleableView) => boolean;
|
|
1
15
|
/**
|
|
2
16
|
* Wait until a view has either initialized — launch blob consumed and all — or
|
|
3
17
|
* failed, and report which.
|
|
@@ -28,13 +42,33 @@
|
|
|
28
42
|
*
|
|
29
43
|
* No time bound, deliberately: `(initialized && launch consumed) || error` is a
|
|
30
44
|
* terminal set, so a slow-but-healthy remote assembly is waited out rather than
|
|
31
|
-
* guessed at.
|
|
45
|
+
* guessed at. `escape` is how a caller adds the one term that is not the view's
|
|
46
|
+
* own — a session-level render failure for an export, `superseded` for a view
|
|
47
|
+
* an `installInitAutorun` apply is waiting on — which is what keeps a caller
|
|
48
|
+
* from re-spelling the whole predicate around it.
|
|
49
|
+
*
|
|
50
|
+
* **Not for the view whose `apply` you are inside.** `applyInitOnce` clears the
|
|
51
|
+
* launch blob only after awaiting `apply`, so `pendingLaunch` is held for the
|
|
52
|
+
* whole of it and this can end only on `escape` or `error`, never on success.
|
|
53
|
+
* A wait on `self` stays hand-rolled; `reference/VIEW_INIT.md` has the shape.
|
|
32
54
|
*
|
|
33
55
|
* @returns true if the view initialized (and consumed any launch), false if it
|
|
34
56
|
* settled on an error
|
|
35
57
|
*/
|
|
36
|
-
export declare function whenViewSettled(view:
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
58
|
+
export declare function whenViewSettled(view: SettleableView, escape?: () => boolean): Promise<boolean>;
|
|
59
|
+
/**
|
|
60
|
+
* The same wait over several views at once — a synteny view's genome rows. An
|
|
61
|
+
* SVG export of a split view keeps its own per-panel loop instead: the split
|
|
62
|
+
* view's `initialized` folds in `views.every(v => v.initialized)` but not each
|
|
63
|
+
* panel's own `pendingLaunch`, so that loop is waiting on a different question
|
|
64
|
+
* by the time it runs.
|
|
65
|
+
*
|
|
66
|
+
* One predicate over `every`, never `Promise.all` of the single form: `when`
|
|
67
|
+
* returns a cancellable promise, so racing N of them against an escape leaves
|
|
68
|
+
* N-1 live reactions behind on the path that escapes. This is one reaction with
|
|
69
|
+
* nothing to cancel.
|
|
70
|
+
*
|
|
71
|
+
* @returns true if every view initialized, false if any settled on an error or
|
|
72
|
+
* the escape fired
|
|
73
|
+
*/
|
|
74
|
+
export declare function whenViewsSettled(views: SettleableView[], escape?: () => boolean): Promise<boolean>;
|
|
@@ -1,4 +1,14 @@
|
|
|
1
1
|
import { when } from 'mobx';
|
|
2
|
+
/**
|
|
3
|
+
* A view that is up AND has finished applying whatever launched it.
|
|
4
|
+
*
|
|
5
|
+
* Both terms, for the reason spelled out on {@link whenViewSettled} below.
|
|
6
|
+
* Exported because AppReadyMarker decides the same thing from the same model
|
|
7
|
+
* for the whole app, the two drifted on exactly this second term, and
|
|
8
|
+
* `readinessTerms.test.tsx` in app-core now holds them together.
|
|
9
|
+
*/
|
|
10
|
+
export const viewSettled = (view) => view.initialized && view.pendingLaunch === undefined;
|
|
11
|
+
const done = (view) => viewSettled(view) || !!view.error;
|
|
2
12
|
/**
|
|
3
13
|
* Wait until a view has either initialized — launch blob consumed and all — or
|
|
4
14
|
* failed, and report which.
|
|
@@ -29,13 +39,39 @@ import { when } from 'mobx';
|
|
|
29
39
|
*
|
|
30
40
|
* No time bound, deliberately: `(initialized && launch consumed) || error` is a
|
|
31
41
|
* terminal set, so a slow-but-healthy remote assembly is waited out rather than
|
|
32
|
-
* guessed at.
|
|
42
|
+
* guessed at. `escape` is how a caller adds the one term that is not the view's
|
|
43
|
+
* own — a session-level render failure for an export, `superseded` for a view
|
|
44
|
+
* an `installInitAutorun` apply is waiting on — which is what keeps a caller
|
|
45
|
+
* from re-spelling the whole predicate around it.
|
|
46
|
+
*
|
|
47
|
+
* **Not for the view whose `apply` you are inside.** `applyInitOnce` clears the
|
|
48
|
+
* launch blob only after awaiting `apply`, so `pendingLaunch` is held for the
|
|
49
|
+
* whole of it and this can end only on `escape` or `error`, never on success.
|
|
50
|
+
* A wait on `self` stays hand-rolled; `reference/VIEW_INIT.md` has the shape.
|
|
33
51
|
*
|
|
34
52
|
* @returns true if the view initialized (and consumed any launch), false if it
|
|
35
53
|
* settled on an error
|
|
36
54
|
*/
|
|
37
|
-
export async function whenViewSettled(view) {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
55
|
+
export async function whenViewSettled(view, escape = () => false) {
|
|
56
|
+
await when(() => escape() || done(view));
|
|
57
|
+
return viewSettled(view);
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* The same wait over several views at once — a synteny view's genome rows. An
|
|
61
|
+
* SVG export of a split view keeps its own per-panel loop instead: the split
|
|
62
|
+
* view's `initialized` folds in `views.every(v => v.initialized)` but not each
|
|
63
|
+
* panel's own `pendingLaunch`, so that loop is waiting on a different question
|
|
64
|
+
* by the time it runs.
|
|
65
|
+
*
|
|
66
|
+
* One predicate over `every`, never `Promise.all` of the single form: `when`
|
|
67
|
+
* returns a cancellable promise, so racing N of them against an escape leaves
|
|
68
|
+
* N-1 live reactions behind on the path that escapes. This is one reaction with
|
|
69
|
+
* nothing to cancel.
|
|
70
|
+
*
|
|
71
|
+
* @returns true if every view initialized, false if any settled on an error or
|
|
72
|
+
* the escape fired
|
|
73
|
+
*/
|
|
74
|
+
export async function whenViewsSettled(views, escape = () => false) {
|
|
75
|
+
await when(() => escape() || views.every(done));
|
|
76
|
+
return views.every(viewSettled);
|
|
41
77
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jbrowse/core",
|
|
3
|
-
"version": "5.0.0-beta.
|
|
3
|
+
"version": "5.0.0-beta.7",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "JBrowse 2 core libraries used by plugins",
|
|
6
6
|
"keywords": [
|
|
@@ -121,13 +121,17 @@
|
|
|
121
121
|
"./ui/Snackbar": "./esm/ui/Snackbar.js",
|
|
122
122
|
"./ui/SnackbarModel": "./esm/ui/SnackbarModel.js",
|
|
123
123
|
"./ui/StackTraceButton": "./esm/ui/StackTraceButton.js",
|
|
124
|
+
"./ui/SvgColorLegend": "./esm/ui/SvgColorLegend.js",
|
|
124
125
|
"./ui/VerticalScrollbar": "./esm/ui/VerticalScrollbar.js",
|
|
125
126
|
"./ui/buildExtraTrackMenuItems": "./esm/ui/buildExtraTrackMenuItems.js",
|
|
127
|
+
"./ui/colorScale": "./esm/ui/colorScale.js",
|
|
126
128
|
"./ui/colors": "./esm/ui/colors.js",
|
|
127
129
|
"./ui/filterMenuItems": "./esm/ui/filterMenuItems.js",
|
|
128
130
|
"./ui/gpuFallback": "./esm/ui/gpuFallback.js",
|
|
129
131
|
"./ui/highlightChipReveal": "./esm/ui/highlightChipReveal.js",
|
|
132
|
+
"./ui/hoverBoxStyle": "./esm/ui/hoverBoxStyle.js",
|
|
130
133
|
"./ui/legendSpec": "./esm/ui/legendSpec.js",
|
|
134
|
+
"./ui/measureLegendText": "./esm/ui/measureLegendText.js",
|
|
131
135
|
"./ui/menuItems": "./esm/ui/menuItems.js",
|
|
132
136
|
"./ui/multiTrackMenuItems": "./esm/ui/multiTrackMenuItems.js",
|
|
133
137
|
"./ui/palette": "./esm/ui/palette.js",
|
|
@@ -166,10 +170,12 @@
|
|
|
166
170
|
"./util/convertCodingSequenceToPeptides": "./esm/util/convertCodingSequenceToPeptides.js",
|
|
167
171
|
"./util/copyText": "./esm/util/copyText.js",
|
|
168
172
|
"./util/createStopTokenRotation": "./esm/util/createStopTokenRotation.js",
|
|
173
|
+
"./util/createSvgRasterCanvas": "./esm/util/createSvgRasterCanvas.js",
|
|
169
174
|
"./util/deepEqual": "./esm/util/deepEqual.js",
|
|
170
175
|
"./util/deepMerge": "./esm/util/deepMerge.js",
|
|
171
176
|
"./util/diagonalizeRegions": "./esm/util/diagonalizeRegions.js",
|
|
172
177
|
"./util/eventPoint": "./esm/util/eventPoint.js",
|
|
178
|
+
"./util/featureTransforms": "./esm/util/featureTransforms.js",
|
|
173
179
|
"./util/fetchContext": "./esm/util/fetchContext.js",
|
|
174
180
|
"./util/fetchHub": "./esm/util/fetchHub.js",
|
|
175
181
|
"./util/fetchPhases": "./esm/util/fetchPhases.js",
|
|
@@ -203,6 +209,7 @@
|
|
|
203
209
|
"./util/librpc": "./esm/util/librpc.js",
|
|
204
210
|
"./util/localStorage": "./esm/util/localStorage.js",
|
|
205
211
|
"./util/makeAssembly": "./esm/util/makeAssembly.js",
|
|
212
|
+
"./util/markEncoding": "./esm/util/markEncoding.js",
|
|
206
213
|
"./util/mst-reflection": "./esm/util/mst-reflection.js",
|
|
207
214
|
"./util/mstUtils": "./esm/util/mstUtils.js",
|
|
208
215
|
"./util/nanoid": "./esm/util/nanoid.js",
|
|
@@ -213,14 +220,17 @@
|
|
|
213
220
|
"./util/parseLineByLine": "./esm/util/parseLineByLine.js",
|
|
214
221
|
"./util/progress": "./esm/util/progress.js",
|
|
215
222
|
"./util/range": "./esm/util/range.js",
|
|
223
|
+
"./util/renderToStaticMarkup": "./esm/util/renderToStaticMarkup.js",
|
|
216
224
|
"./util/resolveRowHeight": "./esm/util/resolveRowHeight.js",
|
|
217
225
|
"./util/rowStackGeometry": "./esm/util/rowStackGeometry.js",
|
|
218
226
|
"./util/rxjs": "./esm/util/rxjs.js",
|
|
219
227
|
"./util/sameStrings": "./esm/util/sameStrings.js",
|
|
220
228
|
"./util/setStackTraceLimit": "./esm/util/setStackTraceLimit.js",
|
|
221
229
|
"./util/simpleFeature": "./esm/util/simpleFeature.js",
|
|
230
|
+
"./util/starFusion": "./esm/util/starFusion.js",
|
|
222
231
|
"./util/stats": "./esm/util/stats.js",
|
|
223
232
|
"./util/stopToken": "./esm/util/stopToken.js",
|
|
233
|
+
"./util/svgColorProps": "./esm/util/svgColorProps.js",
|
|
224
234
|
"./util/tabix": "./esm/util/tabix.js",
|
|
225
235
|
"./util/tickLabels": "./esm/util/tickLabels.js",
|
|
226
236
|
"./util/tracks": "./esm/util/tracks.js",
|
|
@@ -275,8 +285,8 @@
|
|
|
275
285
|
"pako-esm2": "^2.0.2",
|
|
276
286
|
"rxjs": "^7.8.2",
|
|
277
287
|
"source-map-js": "^1.2.1",
|
|
278
|
-
"@jbrowse/add-track-core": "^5.0.0-beta.
|
|
279
|
-
"@jbrowse/render-core": "^5.0.0-beta.
|
|
288
|
+
"@jbrowse/add-track-core": "^5.0.0-beta.7",
|
|
289
|
+
"@jbrowse/render-core": "^5.0.0-beta.7"
|
|
280
290
|
},
|
|
281
291
|
"peerDependencies": {
|
|
282
292
|
"react": ">=19.0.0",
|
|
@@ -1,234 +0,0 @@
|
|
|
1
|
-
import type { TrackConfigChange } from '../util/trackConfigDelta.ts';
|
|
2
|
-
import type { TogglePin, ValuePin } from './promotablePin.ts';
|
|
3
|
-
import type { PromotedDefaultStore, ResolvableDisplay } from './promotableResolve.ts';
|
|
4
|
-
import type { AnyConfigurationModel, ConfigurationSchemaForModel, ConfigurationSlotName, ConfigurationSlotValueResolved } from './types.ts';
|
|
5
|
-
export type { Pin, TogglePin, ValuePin } from './promotablePin.ts';
|
|
6
|
-
/**
|
|
7
|
-
* #api core/configuration
|
|
8
|
-
* Whether this track has customized the slot (holds a non-default value of its
|
|
9
|
-
* own) rather than following the display type's default. The correct "reset to
|
|
10
|
-
* default" predicate for a promotable slot: comparing the resolved value to the
|
|
11
|
-
* base instead reads as at-default for a track merely *following* a non-base
|
|
12
|
-
* promoted default, so the reset control lights up on a no-op.
|
|
13
|
-
*
|
|
14
|
-
* `SLOT` is constrained the way `getConf`'s is, and a widened `self` switches
|
|
15
|
-
* the check off (`HostChecksSlotNames`). A slot name the schema does not
|
|
16
|
-
* declare throws at the first read (`getSlotDefinition`), and a declared but
|
|
17
|
-
* non-promotable one throws in `resolveSlotIn`.
|
|
18
|
-
*/
|
|
19
|
-
export declare function isSlotCustomized<CONFMODEL extends AnyConfigurationModel, SLOT extends ConfigurationSlotName<ConfigurationSchemaForModel<CONFMODEL>>>(self: ResolvableDisplay<CONFMODEL>, slot: SLOT): boolean;
|
|
20
|
-
declare const promotablesResolved: unique symbol;
|
|
21
|
-
/**
|
|
22
|
-
* #api core/configuration
|
|
23
|
-
* A display config snapshot whose promotable slots hold RESOLVED values rather
|
|
24
|
-
* than the inherit sentinel — what a worker payload has to be built from.
|
|
25
|
-
*
|
|
26
|
-
* The brand is required and unforgeable, so a plain `Record<string, unknown>`
|
|
27
|
-
* is not assignable to it and neither is `getSnapshot(self.configuration)`.
|
|
28
|
-
* That is the whole point. Everything downstream of the resolve is an ERASED
|
|
29
|
-
* container — a snapshot is `Record<string, unknown>`, and the payload it
|
|
30
|
-
* becomes is an `as`-asserted interface — so a payload builder handed the RAW
|
|
31
|
-
* snapshot instead typechecks, ships `undefined` for every promotable slot, and
|
|
32
|
-
* types it as the resolved value. That was measured, not supposed: the raw
|
|
33
|
-
* spelling in `LinearBasicDisplay`'s `rpcProps()` passed `pnpm typecheck` and
|
|
34
|
-
* every suite in `plugins/canvas`, `packages/core/src/configuration` and
|
|
35
|
-
* `products/jbrowse-web`, while sending the worker `undefined` for chevrons,
|
|
36
|
-
* subfeature labels and feature height.
|
|
37
|
-
*
|
|
38
|
-
* The rest of this subsystem's guarantees are carried by types that stay
|
|
39
|
-
* connected to the schema: a raw read of a promotable `maybe*` slot is
|
|
40
|
-
* `T | undefined` (see `ConfigurationSlotValue`), so `getConf` where
|
|
41
|
-
* `resolveConf` was meant is a compile error at any typed consumer. The brand is
|
|
42
|
-
* that guarantee re-established at the point where the connection is cut.
|
|
43
|
-
*/
|
|
44
|
-
export interface ResolvedConfigSnapshot extends Record<string, unknown> {
|
|
45
|
-
readonly [promotablesResolved]: true;
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* #api core/configuration
|
|
49
|
-
* The display's full config snapshot with every `promotable`
|
|
50
|
-
* slot overwritten by its resolved value in place. For building a worker payload:
|
|
51
|
-
* a promotable slot serializes as its raw inherit sentinel (`undefined`, since
|
|
52
|
-
* they're all `maybe*` types), which the worker can't interpret — it has no
|
|
53
|
-
* session to resolve against. This hands it concrete values instead, with no per-slot
|
|
54
|
-
* bookkeeping, so adding a promotable worker-consumed slot needs no rpcProps
|
|
55
|
-
* change and can't silently ship a sentinel. Main-thread only (the cascade
|
|
56
|
-
* consults the session). Display-only promotable slots the worker never reads
|
|
57
|
-
* (e.g. displayMode) are still excluded by the caller — resolving them here is a
|
|
58
|
-
* harmless no-op since they're dropped anyway.
|
|
59
|
-
*
|
|
60
|
-
* The return type is branded (`ResolvedConfigSnapshot`) so a payload builder can
|
|
61
|
-
* demand a snapshot that has been through here. The assertion below is the one
|
|
62
|
-
* place the brand is applied, and it sits on the line after the resolve.
|
|
63
|
-
*/
|
|
64
|
-
export declare function getConfigSnapshotWithPromotables(self: ResolvableDisplay): ResolvedConfigSnapshot;
|
|
65
|
-
/**
|
|
66
|
-
* #api core/configuration
|
|
67
|
-
* A track config snapshot with every display's `promotable` slots resolved, plus
|
|
68
|
-
* the list of values that came from a session-wide default rather than from the
|
|
69
|
-
* config itself.
|
|
70
|
-
*
|
|
71
|
-
* For handing a track's config to somewhere that leaves the cascade for good —
|
|
72
|
-
* the About dialog's "Copy config", whose output a user pastes into a
|
|
73
|
-
* `config.json`. A raw `getSnapshot` records a slot a track merely *follows* as
|
|
74
|
-
* absent (`stripDefault` collapsed it), so the copied config renders differently
|
|
75
|
-
* from the track it was copied from. This is `getComputedStyle` at that
|
|
76
|
-
* boundary, and `fromDisplayTypeDefaults` is what lets the UI say so rather than
|
|
77
|
-
* silently materializing a session preference into a track config.
|
|
78
|
-
*
|
|
79
|
-
* Resolves from the display *config* alone, whether or not the track is open.
|
|
80
|
-
* Everything the cascade takes is on the config node: it is the same node an
|
|
81
|
-
* open display's `configuration` points at (the hydration cache makes it
|
|
82
|
-
* stable), its `type` is the display type the session-wide tier is keyed on
|
|
83
|
-
* (every display schema is `explicitlyTyped` under the display type's own name),
|
|
84
|
-
* and the session is passed in. So an unopened track — which has no display
|
|
85
|
-
* state at all — still has an answer to "what would this render as", by the same
|
|
86
|
-
* code path.
|
|
87
|
-
*
|
|
88
|
-
* **Writes every promotable slot, including the ones sitting at `promotedBase`,
|
|
89
|
-
* and that is the decision — don't "align" it with the share bake.** A pasted
|
|
90
|
-
* `config.json` is read by a mechanism with no cascade in it at all, so writing
|
|
91
|
-
* only the inherited values would leave every other slot to pick up whatever the
|
|
92
|
-
* reader has promoted in their own browser. Pinned by
|
|
93
|
-
* `products/jbrowse-web/src/tests/CopyConfigPromotedDefaults.test.ts`.
|
|
94
|
-
*/
|
|
95
|
-
export interface TrackConfigWithPromotables {
|
|
96
|
-
config: Record<string, unknown>;
|
|
97
|
-
/** `<displayType>.<slot>`, one per value inherited from a promoted default */
|
|
98
|
-
fromDisplayTypeDefaults: string[];
|
|
99
|
-
}
|
|
100
|
-
/**
|
|
101
|
-
* #api core/configuration
|
|
102
|
-
* See {@link TrackConfigWithPromotables}.
|
|
103
|
-
*/
|
|
104
|
-
export declare function getTrackConfigWithPromotables(session: PromotedDefaultStore, trackConfig: AnyConfigurationModel): TrackConfigWithPromotables;
|
|
105
|
-
/**
|
|
106
|
-
* Open displays of this display's type, **one entry per track** — the set the
|
|
107
|
-
* pin's click writes. Module-internal (exercised by promotableDefaults.test.ts);
|
|
108
|
-
* not part of the public barrel.
|
|
109
|
-
*
|
|
110
|
-
* A track open in two views is two display *models* over one display *config* —
|
|
111
|
-
* `TrackConfigurationReference` resolves both through the hydration cache
|
|
112
|
-
* (ADR-031) — so the raw walk yields it twice. That is the ordinary case in a
|
|
113
|
-
* breakpoint-split view, which shows the same track in both halves and is one of
|
|
114
|
-
* the composite shapes `openPromotableDisplays` recurses into. The count reaches
|
|
115
|
-
* the user in the snackbar and the set gets written, and both
|
|
116
|
-
* go wrong on a duplicate: the toast offered to act on "2 tracks" over a single
|
|
117
|
-
* track, and the second write was a no-op against a node the first had already
|
|
118
|
-
* set.
|
|
119
|
-
*
|
|
120
|
-
* Keying on the config node rather than on `trackId` is what keeps this
|
|
121
|
-
* cast-free: the node is a member of `ResolvableDisplay`, and within one display
|
|
122
|
-
* type it is 1:1 with the track.
|
|
123
|
-
*/
|
|
124
|
-
export declare function openTracksOfType(self: ResolvableDisplay): ResolvableDisplay[];
|
|
125
|
-
/**
|
|
126
|
-
* Whether `value` is the current session default for `slot`. The live state the
|
|
127
|
-
* pin's filled/outline reflects — a session-wide fact, so it reads the raw
|
|
128
|
-
* promoted default rather than what this display resolves to (a customized track
|
|
129
|
-
* can be showing something else entirely). The named form of the comparison
|
|
130
|
-
* {@link makePin} inlines off a resolution it already holds. Module-internal
|
|
131
|
-
* (exercised by promotableDefaults.test.ts); not part of the public barrel.
|
|
132
|
-
*/
|
|
133
|
-
export declare function isPromotableDefault(self: ResolvableDisplay, slot: string, value: unknown): boolean;
|
|
134
|
-
/**
|
|
135
|
-
* Write `value` into each display's own config for `slot`, so the track *holds*
|
|
136
|
-
* it rather than resolving it through the cascade. The pin's click, over every
|
|
137
|
-
* open track of the display type.
|
|
138
|
-
*
|
|
139
|
-
* **A track already showing `value` still has to be written**, which is why this
|
|
140
|
-
* compares the *stored* value and not the resolved one: a follower stores
|
|
141
|
-
* nothing and is showing `value` only by way of some promoted default, so
|
|
142
|
-
* skipping it would leave it to move again the moment that default changed.
|
|
143
|
-
* Comparing the stored value is also what lets a `jexl:` value answer "is this
|
|
144
|
-
* already what we would write?" without being evaluated.
|
|
145
|
-
*
|
|
146
|
-
* Skips dead displays, since the caller supplies the list and MST throws on any
|
|
147
|
-
* read or write to a destroyed node.
|
|
148
|
-
*/
|
|
149
|
-
export declare function applySlotToOpenTracks(displays: ResolvableDisplay[], slot: string, value: unknown): void;
|
|
150
|
-
/**
|
|
151
|
-
* #api core/configuration
|
|
152
|
-
* The pin on a radio or slider row: "apply this value to every open track of
|
|
153
|
-
* this display type", and — via the snackbar it raises — "keep it as the
|
|
154
|
-
* default for the ones opened later".
|
|
155
|
-
*
|
|
156
|
-
* `value` chooses between the subsystem's two meanings, which are otherwise
|
|
157
|
-
* identical:
|
|
158
|
-
*
|
|
159
|
-
* - **Give it** for a per-value pin — "make *compact* the default" —
|
|
160
|
-
* independent of what the track currently shows. Use on an always-visible pin
|
|
161
|
-
* so it can never promote a meaningless value, and so two rows sharing one
|
|
162
|
-
* slot (sashimi `'down'` vs `'auto'`) stay independent.
|
|
163
|
-
* - **Omit it** for "whatever I'm showing", resolved through the cascade. Use for
|
|
164
|
-
* a continuous setting where no fixed on-value makes sense (wiggle point size,
|
|
165
|
-
* arc line width).
|
|
166
|
-
*
|
|
167
|
-
* A checkbox row takes neither: {@link makeTogglePin}.
|
|
168
|
-
*
|
|
169
|
-
* One function with an optional argument, rather than the two exported builders
|
|
170
|
-
* it replaces — a per-value one and a `…CurrentValue…` one, the second of which
|
|
171
|
-
* was exactly the first applied to `resolveSlot(self, slot).value`. The pair was
|
|
172
|
-
* one function plus a doc section explaining which name to reach for; omitting
|
|
173
|
-
* the argument now says what the longer name said.
|
|
174
|
-
*/
|
|
175
|
-
export declare function makePin<CONFMODEL extends AnyConfigurationModel, SLOT extends ConfigurationSlotName<ConfigurationSchemaForModel<CONFMODEL>>>(self: ResolvableDisplay<CONFMODEL>, slot: SLOT, ...value: [] | [
|
|
176
|
-
ConfigurationSlotValueResolved<ConfigurationSchemaForModel<CONFMODEL>, SLOT>
|
|
177
|
-
]): ValuePin;
|
|
178
|
-
/**
|
|
179
|
-
* The two states a checkbox row moves a slot between. Omitted for a
|
|
180
|
-
* `maybeBoolean` slot, where they are `true` and `false`; required for a
|
|
181
|
-
* two-member enum (`linkedReads`: "View as pairs" toggles `'normal'`/`'off'`).
|
|
182
|
-
* A slot with three or more members is a radio group, not a checkbox per
|
|
183
|
-
* member — `readConnections` was two checkboxes over one slot, and the
|
|
184
|
-
* unticked one's pin wrote the whole slot under a label naming only itself.
|
|
185
|
-
*/
|
|
186
|
-
export interface ToggleStates<T> {
|
|
187
|
-
on: T;
|
|
188
|
-
off: T;
|
|
189
|
-
}
|
|
190
|
-
/**
|
|
191
|
-
* #api core/configuration
|
|
192
|
-
* The pin on a checkbox row: the row's own checkbox, acting on every open track
|
|
193
|
-
* of the display type. `active` mirrors the row, so the pin draws filled
|
|
194
|
-
* exactly when the box is ticked; a click flips the row's state on every open
|
|
195
|
-
* track and offers the new state as the display type's default. It never
|
|
196
|
-
* clears a default the way {@link makePin}'s filled pin does — flipping back
|
|
197
|
-
* and taking the offer promotes the other value, and promoting the base value
|
|
198
|
-
* clears the default (`applyAndOfferDefault`).
|
|
199
|
-
*
|
|
200
|
-
* Replaces a symmetric `makePin(self, slot)` on these rows, which carried the
|
|
201
|
-
* row's current state: beside an unchecked box that applied *off* everywhere
|
|
202
|
-
* and visibly did nothing. It also replaces the per-value `makePin` a checkbox
|
|
203
|
-
* row over a shared enum slot used to carry, which gave two checkbox rows in
|
|
204
|
-
* one submenu two different pins: one filled when its value was promoted and
|
|
205
|
-
* clearing on a second click, the other filled when the box was ticked and
|
|
206
|
-
* flipping. With `states`, a checkbox row is always the toggle kind.
|
|
207
|
-
*/
|
|
208
|
-
export declare function makeTogglePin<CONFMODEL extends AnyConfigurationModel, SLOT extends ConfigurationSlotName<ConfigurationSchemaForModel<CONFMODEL>>>(self: ResolvableDisplay<CONFMODEL>, slot: SLOT, ...states: ConfigurationSlotValueResolved<ConfigurationSchemaForModel<CONFMODEL>, SLOT> extends boolean ? [] | [ToggleStates<boolean>] : [
|
|
209
|
-
ToggleStates<ConfigurationSlotValueResolved<ConfigurationSchemaForModel<CONFMODEL>, SLOT>>
|
|
210
|
-
]): TogglePin;
|
|
211
|
-
/**
|
|
212
|
-
* #api core/configuration
|
|
213
|
-
* Effective differences a track following the default inherits from session-wide
|
|
214
|
-
* defaults, one per promotable slot whose inherited value differs from its schema
|
|
215
|
-
* default. Drives the track-selector "affected by a session default" badge.
|
|
216
|
-
*/
|
|
217
|
-
export declare function getDisplayTypeDefaultChanges(self: ResolvableDisplay): TrackConfigChange[];
|
|
218
|
-
/**
|
|
219
|
-
* #api core/configuration
|
|
220
|
-
* Clear the named promoted defaults for this display type, so every track
|
|
221
|
-
* following one reverts to its own config value. Backs the badge's "clear
|
|
222
|
-
* session default" action, which passes the slots it actually listed
|
|
223
|
-
* (`getDisplayTypeDefaultChanges`).
|
|
224
|
-
*
|
|
225
|
-
* **`slots` is required, and an all-slots default is not the convenience it
|
|
226
|
-
* looks like.** It reaches further than any list a dialog can have shown: a
|
|
227
|
-
* promoted default the track *customized* over is `inherited: false` and so
|
|
228
|
-
* appears in no row, yet still governs sibling tracks — so clearing it from a
|
|
229
|
-
* dialog that never showed
|
|
230
|
-
* it moves tracks other than the one whose badge was clicked. Clearing every
|
|
231
|
-
* promoted default at once is a preferences-scope action, and Preferences →
|
|
232
|
-
* "Reset to defaults" is where it lives (`clearPreferenceOverrides`).
|
|
233
|
-
*/
|
|
234
|
-
export declare function clearPromotedDefaults(self: ResolvableDisplay, slots: Iterable<string>): void;
|