react-msaview 5.7.0 → 5.7.2
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 +1 -1
- package/bundle/index.js +86 -86
- package/bundle/index.js.map +3 -3
- package/dist/components/header/GappynessSlider.js +14 -1
- package/dist/components/header/GappynessSlider.js.map +1 -1
- package/dist/fetchUtils.js +15 -1
- package/dist/fetchUtils.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +3 -3
- package/src/components/header/GappynessSlider.tsx +13 -0
- package/src/fetchUtils.test.ts +17 -0
- package/src/fetchUtils.ts +16 -1
- package/src/version.ts +1 -1
|
@@ -11,7 +11,20 @@ const GappynessSlider = observer(function GappynessSlider({ model, }) {
|
|
|
11
11
|
"Hide columns w/ >",
|
|
12
12
|
allowedGappyness,
|
|
13
13
|
"% gaps"),
|
|
14
|
-
React.createElement(Slider
|
|
14
|
+
React.createElement(Slider
|
|
15
|
+
// Named, because the class alone is not enough to find it from outside.
|
|
16
|
+
// An MSA is normally embedded beside other MUI Sliders (in JBrowse, the
|
|
17
|
+
// linear view's own zoom control), so a `.MuiSlider-thumb` selector in a
|
|
18
|
+
// test or a screenshot spec picks whichever comes first in the document
|
|
19
|
+
// and drives that instead — which reads as this slider ignoring its
|
|
20
|
+
// keyboard. Target `[data-testid="gappyness_slider"] input` to reach the
|
|
21
|
+
// hidden range input MUI renders in the thumb, which is the node that
|
|
22
|
+
// takes focus and receives arrow/PageUp/PageDown.
|
|
23
|
+
//
|
|
24
|
+
// Deliberately NOT `slotProps={{ input: ... }}`: passing slotProps here
|
|
25
|
+
// widens the Slider's generic so `onChange`'s `val` infers as
|
|
26
|
+
// `number | number[]` and no longer assigns to setAllowedGappyness.
|
|
27
|
+
, { "data-testid": "gappyness_slider", style: { width: 100 }, min: 1, max: 100, value: allowedGappyness, onChange: (_, val) => {
|
|
15
28
|
model.setAllowedGappyness(val);
|
|
16
29
|
} })));
|
|
17
30
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GappynessSlider.js","sourceRoot":"","sources":["../../../src/components/header/GappynessSlider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAIrC,MAAM,eAAe,GAAG,QAAQ,CAAC,SAAS,eAAe,CAAC,EACxD,KAAK,GAGN;IACC,MAAM,EAAE,QAAQ,EAAE,gBAAgB,EAAE,GAAG,KAAK,CAAA;IAC5C,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,OAAO,IAAI,CAAA;IACb,CAAC;IACD,OAAO,CACL,6BAAK,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,EAAE;QAC3D,oBAAC,UAAU,IAAC,KAAK,EAAE,EAAE,UAAU,EAAE,QAAQ,EAAE;;YACpB,gBAAgB;qBAC1B;QACb,oBAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"GappynessSlider.js","sourceRoot":"","sources":["../../../src/components/header/GappynessSlider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAIrC,MAAM,eAAe,GAAG,QAAQ,CAAC,SAAS,eAAe,CAAC,EACxD,KAAK,GAGN;IACC,MAAM,EAAE,QAAQ,EAAE,gBAAgB,EAAE,GAAG,KAAK,CAAA;IAC5C,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,OAAO,IAAI,CAAA;IACb,CAAC;IACD,OAAO,CACL,6BAAK,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,EAAE;QAC3D,oBAAC,UAAU,IAAC,KAAK,EAAE,EAAE,UAAU,EAAE,QAAQ,EAAE;;YACpB,gBAAgB;qBAC1B;QACb,oBAAC,MAAM;QACL,wEAAwE;QACxE,wEAAwE;QACxE,yEAAyE;QACzE,wEAAwE;QACxE,oEAAoE;QACpE,yEAAyE;QACzE,sEAAsE;QACtE,kDAAkD;QAClD,EAAE;QACF,wEAAwE;QACxE,8DAA8D;QAC9D,oEAAoE;2BACxD,kBAAkB,EAC9B,KAAK,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,EACrB,GAAG,EAAE,CAAC,EACN,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,gBAAgB,EACvB,QAAQ,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,EAAE;gBACnB,KAAK,CAAC,mBAAmB,CAAC,GAAG,CAAC,CAAA;YAChC,CAAC,GACD,CACE,CACP,CAAA;AACH,CAAC,CAAC,CAAA;AAEF,eAAe,eAAe,CAAA"}
|
package/dist/fetchUtils.js
CHANGED
|
@@ -1,4 +1,18 @@
|
|
|
1
|
-
import { fetchAndMaybeUnzipText
|
|
1
|
+
import { fetchAndMaybeUnzipText } from '@jbrowse/core/util';
|
|
2
|
+
/**
|
|
3
|
+
* Extract the human-readable text from a status value, which core reports
|
|
4
|
+
* either as a bare string or as a `{message, current, total}` progress object.
|
|
5
|
+
*
|
|
6
|
+
* Inlined rather than imported from `@jbrowse/core/util` on purpose:
|
|
7
|
+
* `statusMessageText` is a recent core export, and in the UMD plugin build
|
|
8
|
+
* `@jbrowse/core/util` is an external resolved against whatever core the host
|
|
9
|
+
* jbrowse-web ships. Against an older host this import lands as `undefined` and
|
|
10
|
+
* every download tick throws `statusMessageText is not a function`. Keeping the
|
|
11
|
+
* one-liner local makes the viewer work on old and new hosts alike.
|
|
12
|
+
*/
|
|
13
|
+
function statusMessageText(status) {
|
|
14
|
+
return typeof status === 'string' ? status : status?.message;
|
|
15
|
+
}
|
|
2
16
|
/**
|
|
3
17
|
* Fetch text from a filehandle while reporting download/unzip progress through
|
|
4
18
|
* setStatus, and wiring a Cancel handler that aborts the underlying request.
|
package/dist/fetchUtils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetchUtils.js","sourceRoot":"","sources":["../src/fetchUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,iBAAiB,
|
|
1
|
+
{"version":3,"file":"fetchUtils.js","sourceRoot":"","sources":["../src/fetchUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAA;AAI3D;;;;;;;;;;GAUG;AACH,SAAS,iBAAiB,CAAC,MAA6B;IACtD,OAAO,OAAO,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,OAAO,CAAA;AAC9D,CAAC;AAeD;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,qBAAqB,CACzC,GAAe,EACf,SAAyC,EACzC,OAAO,GAAoB,sBAAsB;IAEjD,MAAM,UAAU,GAAG,IAAI,eAAe,EAAE,CAAA;IACxC,IAAI,CAAC;QACH,OAAO,MAAM,OAAO,CAAC,GAAG,EAAE;YACxB,MAAM,EAAE,UAAU,CAAC,MAAM;YACzB,cAAc,EAAE,MAAM,CAAC,EAAE;gBACvB,MAAM,GAAG,GAAG,iBAAiB,CAAC,MAAM,CAAC,CAAA;gBACrC,SAAS,CACP,GAAG;oBACD,CAAC,CAAC;wBACE,GAAG;wBACH,QAAQ,EAAE,GAAG,EAAE;4BACb,UAAU,CAAC,KAAK,EAAE,CAAA;wBACpB,CAAC;qBACF;oBACH,CAAC,CAAC,SAAS,CACd,CAAA;YACH,CAAC;SACF,CAAC,CAAA;IACJ,CAAC;YAAS,CAAC;QACT,SAAS,CAAC,SAAS,CAAC,CAAA;IACtB,CAAC;AACH,CAAC;AAED,MAAM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AA;QACJ,CAAC;IACH,CAAC,CAAC,CAAA;AACJ,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,CAAU;IACrC,OAAO,CAAC,YAAY,YAAY,IAAI,CAAC,CAAC,IAAI,KAAK,YAAY,CAAA;AAC7D,CAAC"}
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "5.7.
|
|
1
|
+
export declare const version = "5.7.2";
|
package/dist/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const version = '5.7.
|
|
1
|
+
export const version = '5.7.2';
|
|
2
2
|
//# sourceMappingURL=version.js.map
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-msaview",
|
|
3
3
|
"author": "Colin",
|
|
4
|
-
"version": "5.7.
|
|
4
|
+
"version": "5.7.2",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"repository": {
|
|
@@ -42,8 +42,8 @@
|
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"colord": "^2.9.3",
|
|
44
44
|
"flatbush": "^4.6.2",
|
|
45
|
-
"@jbrowse/svgcanvas": "5.7.
|
|
46
|
-
"msa-parsers": "5.7.
|
|
45
|
+
"@jbrowse/svgcanvas": "5.7.2",
|
|
46
|
+
"msa-parsers": "5.7.2"
|
|
47
47
|
},
|
|
48
48
|
"scripts": {
|
|
49
49
|
"clean": "rimraf dist bundle",
|
|
@@ -20,6 +20,19 @@ const GappynessSlider = observer(function GappynessSlider({
|
|
|
20
20
|
Hide columns w/ >{allowedGappyness}% gaps
|
|
21
21
|
</Typography>
|
|
22
22
|
<Slider
|
|
23
|
+
// Named, because the class alone is not enough to find it from outside.
|
|
24
|
+
// An MSA is normally embedded beside other MUI Sliders (in JBrowse, the
|
|
25
|
+
// linear view's own zoom control), so a `.MuiSlider-thumb` selector in a
|
|
26
|
+
// test or a screenshot spec picks whichever comes first in the document
|
|
27
|
+
// and drives that instead — which reads as this slider ignoring its
|
|
28
|
+
// keyboard. Target `[data-testid="gappyness_slider"] input` to reach the
|
|
29
|
+
// hidden range input MUI renders in the thumb, which is the node that
|
|
30
|
+
// takes focus and receives arrow/PageUp/PageDown.
|
|
31
|
+
//
|
|
32
|
+
// Deliberately NOT `slotProps={{ input: ... }}`: passing slotProps here
|
|
33
|
+
// widens the Slider's generic so `onChange`'s `val` infers as
|
|
34
|
+
// `number | number[]` and no longer assigns to setAllowedGappyness.
|
|
35
|
+
data-testid="gappyness_slider"
|
|
23
36
|
style={{ width: 100 }}
|
|
24
37
|
min={1}
|
|
25
38
|
max={100}
|
package/src/fetchUtils.test.ts
CHANGED
|
@@ -30,6 +30,23 @@ describe('fetchTextWithProgress', () => {
|
|
|
30
30
|
])
|
|
31
31
|
})
|
|
32
32
|
|
|
33
|
+
test('reports the message from a determinate progress status', async () => {
|
|
34
|
+
const statuses: (FetchStatus | undefined)[] = []
|
|
35
|
+
await fetchTextWithProgress(
|
|
36
|
+
loc,
|
|
37
|
+
s => statuses.push(s),
|
|
38
|
+
async (_loc, opts) => {
|
|
39
|
+
opts.statusCallback({
|
|
40
|
+
message: 'Downloading file',
|
|
41
|
+
current: 5,
|
|
42
|
+
total: 10,
|
|
43
|
+
})
|
|
44
|
+
return 'GREETINGS'
|
|
45
|
+
},
|
|
46
|
+
)
|
|
47
|
+
expect(statuses[0]?.msg).toBe('Downloading file')
|
|
48
|
+
})
|
|
49
|
+
|
|
33
50
|
test('clears status even when the fetch throws', async () => {
|
|
34
51
|
const statuses: (FetchStatus | undefined)[] = []
|
|
35
52
|
await expect(
|
package/src/fetchUtils.ts
CHANGED
|
@@ -1,7 +1,22 @@
|
|
|
1
|
-
import { fetchAndMaybeUnzipText
|
|
1
|
+
import { fetchAndMaybeUnzipText } from '@jbrowse/core/util'
|
|
2
2
|
|
|
3
3
|
import type { RpcStatus } from '@jbrowse/core/util'
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* Extract the human-readable text from a status value, which core reports
|
|
7
|
+
* either as a bare string or as a `{message, current, total}` progress object.
|
|
8
|
+
*
|
|
9
|
+
* Inlined rather than imported from `@jbrowse/core/util` on purpose:
|
|
10
|
+
* `statusMessageText` is a recent core export, and in the UMD plugin build
|
|
11
|
+
* `@jbrowse/core/util` is an external resolved against whatever core the host
|
|
12
|
+
* jbrowse-web ships. Against an older host this import lands as `undefined` and
|
|
13
|
+
* every download tick throws `statusMessageText is not a function`. Keeping the
|
|
14
|
+
* one-liner local makes the viewer work on old and new hosts alike.
|
|
15
|
+
*/
|
|
16
|
+
function statusMessageText(status: RpcStatus | undefined) {
|
|
17
|
+
return typeof status === 'string' ? status : status?.message
|
|
18
|
+
}
|
|
19
|
+
|
|
5
20
|
export interface FetchStatus {
|
|
6
21
|
msg: string
|
|
7
22
|
url?: string
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '5.7.
|
|
1
|
+
export const version = '5.7.2'
|