@jbrowse/product-core 2.6.1 → 2.6.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/dist/RootModel/FormatAbout.d.ts +22 -0
  2. package/dist/RootModel/FormatAbout.js +29 -0
  3. package/dist/RootModel/FormatDetails.d.ts +32 -0
  4. package/dist/RootModel/FormatDetails.js +39 -0
  5. package/dist/RootModel/HierarchicalConfig.d.ts +45 -0
  6. package/dist/RootModel/HierarchicalConfig.js +52 -0
  7. package/dist/RootModel/index.d.ts +3 -0
  8. package/dist/RootModel/index.js +3 -0
  9. package/dist/index.d.ts +1 -0
  10. package/dist/index.js +1 -0
  11. package/dist/rpcWorker.d.ts +6 -0
  12. package/dist/rpcWorker.js +74 -0
  13. package/esm/RootModel/FormatAbout.d.ts +22 -0
  14. package/esm/RootModel/FormatAbout.js +25 -0
  15. package/esm/RootModel/FormatDetails.d.ts +32 -0
  16. package/esm/RootModel/FormatDetails.js +35 -0
  17. package/esm/RootModel/HierarchicalConfig.d.ts +45 -0
  18. package/esm/RootModel/HierarchicalConfig.js +48 -0
  19. package/esm/RootModel/index.d.ts +3 -0
  20. package/esm/RootModel/index.js +3 -0
  21. package/esm/index.d.ts +1 -0
  22. package/esm/index.js +1 -0
  23. package/esm/rpcWorker.d.ts +6 -0
  24. package/esm/rpcWorker.js +67 -0
  25. package/package.json +7 -6
  26. package/src/RootModel/BaseRootModel.ts +0 -131
  27. package/src/RootModel/InternetAccounts.ts +0 -126
  28. package/src/RootModel/index.ts +0 -2
  29. package/src/Session/BaseSession.ts +0 -129
  30. package/src/Session/Connections.ts +0 -145
  31. package/src/Session/DialogQueue.ts +0 -63
  32. package/src/Session/DrawerWidgets.ts +0 -222
  33. package/src/Session/MultipleViews.ts +0 -151
  34. package/src/Session/ReferenceManagement.ts +0 -134
  35. package/src/Session/SessionTracks.ts +0 -98
  36. package/src/Session/Themes.ts +0 -85
  37. package/src/Session/Tracks.ts +0 -72
  38. package/src/Session/index.ts +0 -10
  39. package/src/index.ts +0 -3
  40. package/src/ui/AboutDialog.tsx +0 -31
  41. package/src/ui/AboutDialogContents.tsx +0 -88
  42. package/src/ui/FileInfoPanel.tsx +0 -75
  43. package/src/ui/index.ts +0 -1
@@ -1,72 +0,0 @@
1
- import { IAnyStateTreeNode, Instance, types } from 'mobx-state-tree'
2
-
3
- import PluginManager from '@jbrowse/core/PluginManager'
4
- import {
5
- AnyConfiguration,
6
- AnyConfigurationModel,
7
- } from '@jbrowse/core/configuration'
8
- import { BaseSessionModel, isBaseSession } from './BaseSession'
9
- import { ReferenceManagementSessionMixin } from './ReferenceManagement'
10
-
11
- /**
12
- * #stateModel TracksManagerSessionMixin
13
- * composed of
14
- * - BaseSessionModel
15
- * - ReferenceManagementSessionMixin
16
- */
17
- export function TracksManagerSessionMixin(pluginManager: PluginManager) {
18
- return types
19
- .compose(
20
- 'TracksManagerSessionMixin',
21
- BaseSessionModel(pluginManager),
22
- ReferenceManagementSessionMixin(pluginManager),
23
- )
24
- .views(self => ({
25
- /**
26
- * #getter
27
- */
28
- get tracks(): AnyConfigurationModel[] {
29
- return self.jbrowse.tracks
30
- },
31
- }))
32
- .actions(self => ({
33
- /**
34
- * #action
35
- */
36
- addTrackConf(trackConf: AnyConfiguration) {
37
- return self.jbrowse.addTrackConf(trackConf)
38
- },
39
-
40
- /**
41
- * #action
42
- */
43
- deleteTrackConf(trackConf: AnyConfigurationModel) {
44
- const callbacksToDereferenceTrack: Function[] = []
45
- const dereferenceTypeCount: Record<string, number> = {}
46
- const referring = self.getReferring(trackConf)
47
- self.removeReferring(
48
- referring,
49
- trackConf,
50
- callbacksToDereferenceTrack,
51
- dereferenceTypeCount,
52
- )
53
- callbacksToDereferenceTrack.forEach(cb => cb())
54
- if (self.adminMode) {
55
- return self.jbrowse.deleteTrackConf(trackConf)
56
- }
57
- },
58
- }))
59
- }
60
-
61
- /** Session mixin MST type for a session that has tracks */
62
- export type SessionWithTracksType = ReturnType<typeof TracksManagerSessionMixin>
63
-
64
- /** Instance of a session that has tracks */
65
- export type SessionWithTracks = Instance<SessionWithTracksType>
66
-
67
- /** Type guard for SessionWithTracks */
68
- export function isSessionWithTracks(
69
- thing: IAnyStateTreeNode,
70
- ): thing is SessionWithTracks {
71
- return isBaseSession(thing) && 'tracks' in thing
72
- }
@@ -1,10 +0,0 @@
1
- export * from './ReferenceManagement'
2
- export * from './Connections'
3
- export * from './DrawerWidgets'
4
- export * from './DialogQueue'
5
- export * from './Themes'
6
- export * from './Tracks'
7
- export * from './MultipleViews'
8
- export * from './BaseSession'
9
- export * from './SessionTracks'
10
- export * from './BaseSession'
package/src/index.ts DELETED
@@ -1,3 +0,0 @@
1
- export * from './RootModel'
2
- export * from './Session'
3
- export * from './ui'
@@ -1,31 +0,0 @@
1
- import React from 'react'
2
- import { AnyConfigurationModel } from '@jbrowse/core/configuration'
3
- import Dialog from '@jbrowse/core/ui/Dialog'
4
- import { getSession, getEnv } from '@jbrowse/core/util'
5
- import { getTrackName } from '@jbrowse/core/util/tracks'
6
- import AboutContents from './AboutDialogContents'
7
-
8
- export function AboutDialog({
9
- config,
10
- handleClose,
11
- }: {
12
- config: AnyConfigurationModel
13
- handleClose: () => void
14
- }) {
15
- const session = getSession(config)
16
- const trackName = getTrackName(config, session)
17
- const { pluginManager } = getEnv(session)
18
-
19
- const AboutComponent = pluginManager.evaluateExtensionPoint(
20
- 'Core-replaceAbout',
21
- AboutContents,
22
- { session, config },
23
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
24
- ) as React.FC<any>
25
-
26
- return (
27
- <Dialog open onClose={handleClose} title={trackName} maxWidth="xl">
28
- <AboutComponent config={config} />
29
- </Dialog>
30
- )
31
- }
@@ -1,88 +0,0 @@
1
- import React, { useState } from 'react'
2
- import copy from 'copy-to-clipboard'
3
- import { Button } from '@mui/material'
4
- import { makeStyles } from 'tss-react/mui'
5
- import {
6
- getConf,
7
- readConfObject,
8
- AnyConfigurationModel,
9
- } from '@jbrowse/core/configuration'
10
- import { getSession, getEnv } from '@jbrowse/core/util'
11
- import {
12
- BaseCard,
13
- Attributes,
14
- } from '@jbrowse/core/BaseFeatureWidget/BaseFeatureDetail'
15
- import FileInfoPanel from './FileInfoPanel'
16
-
17
- const useStyles = makeStyles()({
18
- content: {
19
- minWidth: 800,
20
- },
21
- })
22
-
23
- export default function AboutContents({
24
- config,
25
- }: {
26
- config: AnyConfigurationModel
27
- }) {
28
- const [copied, setCopied] = useState(false)
29
- const conf = readConfObject(config)
30
- const session = getSession(config)
31
- const { classes } = useStyles()
32
-
33
- const hideUris =
34
- getConf(session, ['formatAbout', 'hideUris']) ||
35
- readConfObject(config, ['formatAbout', 'hideUris'])
36
-
37
- const { pluginManager } = getEnv(session)
38
-
39
- const confPostExt = pluginManager.evaluateExtensionPoint(
40
- 'Core-customizeAbout',
41
- {
42
- config: {
43
- ...conf,
44
- ...getConf(session, ['formatAbout', 'config'], { config: conf }),
45
- ...readConfObject(config, ['formatAbout', 'config'], { config: conf }),
46
- },
47
- },
48
- { session, config },
49
- ) as Record<string, unknown>
50
-
51
- const ExtraPanel = pluginManager.evaluateExtensionPoint(
52
- 'Core-extraAboutPanel',
53
- null,
54
- { session, config },
55
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
56
- ) as { name: string; Component: React.FC<any> }
57
-
58
- return (
59
- <div className={classes.content}>
60
- <BaseCard title="Configuration">
61
- {!hideUris ? (
62
- <Button
63
- variant="contained"
64
- style={{ float: 'right' }}
65
- onClick={() => {
66
- copy(JSON.stringify(conf, null, 2))
67
- setCopied(true)
68
- setTimeout(() => setCopied(false), 1000)
69
- }}
70
- >
71
- {copied ? 'Copied to clipboard!' : 'Copy config'}
72
- </Button>
73
- ) : null}
74
- <Attributes
75
- attributes={confPostExt}
76
- omit={['displays', 'baseUri', 'refNames', 'formatAbout']}
77
- hideUris={hideUris}
78
- />
79
- </BaseCard>
80
- {ExtraPanel ? (
81
- <BaseCard title={ExtraPanel.name}>
82
- <ExtraPanel.Component config={config} />
83
- </BaseCard>
84
- ) : null}
85
- <FileInfoPanel config={config} />
86
- </div>
87
- )
88
- }
@@ -1,75 +0,0 @@
1
- import React, { useState, useEffect } from 'react'
2
- import { Typography } from '@mui/material'
3
- import {
4
- readConfObject,
5
- AnyConfigurationModel,
6
- } from '@jbrowse/core/configuration'
7
- import LoadingEllipses from '@jbrowse/core/ui/LoadingEllipses'
8
- import { getSession } from '@jbrowse/core/util'
9
- import {
10
- BaseCard,
11
- Attributes,
12
- } from '@jbrowse/core/BaseFeatureWidget/BaseFeatureDetail'
13
-
14
- type FileInfo = Record<string, unknown> | string
15
-
16
- export default function FileInfoPanel({
17
- config,
18
- }: {
19
- config: AnyConfigurationModel
20
- }) {
21
- const [error, setError] = useState<unknown>()
22
- const [info, setInfo] = useState<FileInfo>()
23
- const session = getSession(config)
24
- const { rpcManager } = session
25
-
26
- useEffect(() => {
27
- const aborter = new AbortController()
28
- const { signal } = aborter
29
- let cancelled = false
30
- // eslint-disable-next-line @typescript-eslint/no-floating-promises
31
- ;(async () => {
32
- try {
33
- const adapterConfig = readConfObject(config, 'adapter')
34
- const result = await rpcManager.call(config.trackId, 'CoreGetInfo', {
35
- adapterConfig,
36
- signal,
37
- })
38
- if (!cancelled) {
39
- setInfo(result as FileInfo)
40
- }
41
- } catch (e) {
42
- if (!cancelled) {
43
- console.error(e)
44
- setError(e)
45
- }
46
- }
47
- })()
48
-
49
- return () => {
50
- aborter.abort()
51
- cancelled = true
52
- }
53
- }, [config, rpcManager])
54
-
55
- const details =
56
- typeof info === 'string'
57
- ? {
58
- header: `<pre>${info
59
- .replaceAll('<', '&lt;')
60
- .replaceAll('>', '&gt;')}</pre>`,
61
- }
62
- : info || {}
63
-
64
- return info !== null ? (
65
- <BaseCard title="File info">
66
- {error ? (
67
- <Typography color="error">{`${error}`}</Typography>
68
- ) : info === undefined ? (
69
- <LoadingEllipses message="Loading file data" />
70
- ) : (
71
- <Attributes attributes={details} />
72
- )}
73
- </BaseCard>
74
- ) : null
75
- }
package/src/ui/index.ts DELETED
@@ -1 +0,0 @@
1
- export * from './AboutDialog'