@jbrowse/product-core 4.3.0 → 5.0.0-beta.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/esm/RootModel/BaseRootModel.d.ts +629 -304
- package/esm/RootModel/BaseRootModel.js +139 -14
- package/esm/RootModel/HierarchicalConfig.d.ts +57 -21
- package/esm/RootModel/HierarchicalConfig.js +36 -0
- package/esm/RootModel/InternetAccounts.d.ts +18 -1
- package/esm/RootModel/InternetAccounts.js +120 -22
- package/esm/RootModel/PreferencesConfig.d.ts +68 -0
- package/esm/RootModel/PreferencesConfig.js +76 -0
- package/esm/RootModel/createConfigModel.d.ts +240 -0
- package/esm/RootModel/createConfigModel.js +56 -0
- package/esm/RootModel/index.d.ts +10 -5
- package/esm/RootModel/index.js +10 -5
- package/esm/RootModel/menuItems.d.ts +24 -0
- package/esm/RootModel/menuItems.js +143 -0
- package/esm/Session/BaseSession.d.ts +312 -11
- package/esm/Session/BaseSession.js +458 -14
- package/esm/Session/Connections.d.ts +114 -8
- package/esm/Session/Connections.js +195 -74
- package/esm/Session/DrawerWidgets.d.ts +115 -12
- package/esm/Session/DrawerWidgets.js +161 -42
- package/esm/Session/MultipleViews.d.ts +1281 -1128
- package/esm/Session/MultipleViews.js +396 -64
- package/esm/Session/Preferences.d.ts +1667 -0
- package/esm/Session/Preferences.js +59 -0
- package/esm/Session/ReferenceManagement.d.ts +28 -3
- package/esm/Session/ReferenceManagement.js +56 -41
- package/esm/Session/SessionTracks.d.ts +1277 -1138
- package/esm/Session/SessionTracks.js +540 -35
- package/esm/Session/Themes.d.ts +87 -2
- package/esm/Session/Themes.js +156 -23
- package/esm/Session/TrackMenu.d.ts +112 -0
- package/esm/Session/TrackMenu.js +200 -0
- package/esm/Session/TrackMenuSessionMixin.d.ts +27 -0
- package/esm/Session/TrackMenuSessionMixin.js +41 -0
- package/esm/Session/Tracks.d.ts +1171 -1117
- package/esm/Session/Tracks.js +183 -20
- package/esm/Session/assertSessionModel.d.ts +21 -0
- package/esm/Session/assertSessionModel.js +1 -0
- package/esm/Session/developerMode.d.ts +7 -0
- package/esm/Session/developerMode.js +43 -0
- package/esm/Session/finalizeSession.d.ts +16 -0
- package/esm/Session/finalizeSession.js +29 -0
- package/esm/Session/index.d.ts +22 -10
- package/esm/Session/index.js +13 -10
- package/esm/Session/readdedTrackConf.d.ts +8 -0
- package/esm/Session/readdedTrackConf.js +25 -0
- package/esm/Session/shareableSnapshot.d.ts +77 -0
- package/esm/Session/shareableSnapshot.js +196 -0
- package/esm/Session/temporaryAssemblyTracks.d.ts +24 -0
- package/esm/Session/temporaryAssemblyTracks.js +37 -0
- package/esm/assertExtends.d.ts +55 -0
- package/esm/assertExtends.js +1 -0
- package/esm/controllerTracks.d.ts +56 -0
- package/esm/controllerTracks.js +90 -0
- package/esm/destroyViewState.d.ts +21 -0
- package/esm/destroyViewState.js +29 -0
- package/esm/index.d.ts +31 -4
- package/esm/index.js +31 -4
- package/esm/loadPlugins.d.ts +33 -0
- package/esm/loadPlugins.js +41 -0
- package/esm/localFiles.d.ts +74 -0
- package/esm/localFiles.js +156 -0
- package/esm/observeSession.d.ts +56 -0
- package/esm/observeSession.js +91 -0
- package/esm/pluginInput.d.ts +32 -0
- package/esm/pluginInput.js +19 -0
- package/esm/pruneUnbuildableNodes.d.ts +109 -0
- package/esm/pruneUnbuildableNodes.js +568 -0
- package/esm/resolveAssemblies.d.ts +44 -0
- package/esm/resolveAssemblies.js +55 -0
- package/esm/rpcWorker.d.ts +26 -0
- package/esm/rpcWorker.js +98 -16
- package/esm/scheduleDetachedDestroy.d.ts +18 -0
- package/esm/scheduleDetachedDestroy.js +24 -0
- package/esm/sessionMigrations/index.d.ts +53 -0
- package/esm/sessionMigrations/index.js +432 -0
- package/esm/sessionUrl.d.ts +41 -0
- package/esm/sessionUrl.js +53 -0
- package/esm/sessionUtils.d.ts +69 -0
- package/esm/sessionUtils.js +613 -0
- package/esm/siblingCast.d.ts +14 -0
- package/esm/siblingCast.js +16 -0
- package/esm/snapshotUtils.d.ts +8 -0
- package/esm/snapshotUtils.js +12 -0
- package/esm/ui/AboutDialog.d.ts +3 -6
- package/esm/ui/AboutDialog.js +4 -4
- package/esm/ui/AboutDialogContents.d.ts +2 -6
- package/esm/ui/AboutDialogContents.js +34 -13
- package/esm/ui/AssemblyInfoPanel.d.ts +5 -0
- package/esm/ui/AssemblyInfoPanel.js +69 -0
- package/esm/ui/DisplayDefaultsSection.d.ts +36 -0
- package/esm/ui/DisplayDefaultsSection.js +65 -0
- package/esm/ui/Drawer.d.ts +21 -0
- package/esm/ui/Drawer.js +60 -0
- package/esm/ui/DrawerControls.d.ts +5 -0
- package/esm/ui/DrawerControls.js +28 -0
- package/esm/ui/DrawerHeader.d.ts +6 -0
- package/esm/ui/DrawerHeader.js +36 -0
- package/esm/ui/DrawerWidget.d.ts +5 -0
- package/esm/ui/DrawerWidget.js +12 -0
- package/esm/ui/DrawerWidgetSelector.d.ts +5 -0
- package/esm/ui/DrawerWidgetSelector.js +40 -0
- package/esm/ui/FileInfoPanel.d.ts +3 -6
- package/esm/ui/FileInfoPanel.js +35 -26
- package/esm/ui/HeaderButtons.d.ts +7 -1
- package/esm/ui/HeaderButtons.js +23 -18
- package/esm/ui/ModalWidget.d.ts +12 -0
- package/esm/ui/ModalWidget.js +33 -0
- package/esm/ui/ModalWidgetAppBar.d.ts +8 -0
- package/esm/ui/ModalWidgetAppBar.js +9 -0
- package/esm/ui/PreferencesDialog.d.ts +56 -0
- package/esm/ui/PreferencesDialog.js +145 -0
- package/esm/ui/PreferencesResetDialog.d.ts +8 -0
- package/esm/ui/PreferencesResetDialog.js +19 -0
- package/esm/ui/RefNameAliasesDialog.d.ts +9 -0
- package/esm/ui/RefNameAliasesDialog.js +65 -0
- package/esm/ui/RefNameInfoDialog.d.ts +3 -6
- package/esm/ui/RefNameInfoDialog.js +57 -63
- package/esm/ui/WidgetBody.d.ts +18 -0
- package/esm/ui/WidgetBody.js +22 -0
- package/esm/ui/WidgetHeading.d.ts +7 -0
- package/esm/ui/WidgetHeading.js +7 -0
- package/esm/ui/drawerLayout.d.ts +18 -0
- package/esm/ui/drawerLayout.js +22 -0
- package/esm/ui/index.d.ts +13 -1
- package/esm/ui/index.js +12 -1
- package/esm/ui/util.d.ts +37 -4
- package/esm/ui/util.js +35 -38
- package/esm/useEngineLifecycle.d.ts +19 -0
- package/esm/useEngineLifecycle.js +44 -0
- package/package.json +12 -15
- package/esm/RootModel/FormatAbout.d.ts +0 -12
- package/esm/RootModel/FormatAbout.js +0 -15
- package/esm/RootModel/FormatDetails.d.ts +0 -24
- package/esm/RootModel/FormatDetails.js +0 -27
- package/esm/Session/DialogQueue.d.ts +0 -17
- package/esm/Session/DialogQueue.js +0 -31
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { DrawerPosition } from '@jbrowse/core/util/types';
|
|
2
|
+
/**
|
|
3
|
+
* CSS `grid-template-columns` for a main content area with an optional drawer
|
|
4
|
+
* widget on the left or right. Shared by the app shell (`App.tsx`) and the
|
|
5
|
+
* embedded views so the drawer positioning stays identical across products.
|
|
6
|
+
*
|
|
7
|
+
* The `[main]`/`[drawer]` line names are the whole interface: a host renders
|
|
8
|
+
* the main container and the drawer once each, in any order, and each takes
|
|
9
|
+
* its column by name. Placing them by DOM order instead means the host has to
|
|
10
|
+
* render the drawer twice — once on each side, under opposite conditions — and
|
|
11
|
+
* any other in-flow child auto-placed between them lands in a column meant for
|
|
12
|
+
* one of the two.
|
|
13
|
+
*/
|
|
14
|
+
export declare function drawerGridTemplateColumns({ drawerVisible, drawerPosition, drawerWidth, }: {
|
|
15
|
+
drawerVisible: boolean;
|
|
16
|
+
drawerPosition: DrawerPosition;
|
|
17
|
+
drawerWidth: number;
|
|
18
|
+
}): string;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CSS `grid-template-columns` for a main content area with an optional drawer
|
|
3
|
+
* widget on the left or right. Shared by the app shell (`App.tsx`) and the
|
|
4
|
+
* embedded views so the drawer positioning stays identical across products.
|
|
5
|
+
*
|
|
6
|
+
* The `[main]`/`[drawer]` line names are the whole interface: a host renders
|
|
7
|
+
* the main container and the drawer once each, in any order, and each takes
|
|
8
|
+
* its column by name. Placing them by DOM order instead means the host has to
|
|
9
|
+
* render the drawer twice — once on each side, under opposite conditions — and
|
|
10
|
+
* any other in-flow child auto-placed between them lands in a column meant for
|
|
11
|
+
* one of the two.
|
|
12
|
+
*/
|
|
13
|
+
export function drawerGridTemplateColumns({ drawerVisible, drawerPosition, drawerWidth, }) {
|
|
14
|
+
const main = '[main] minmax(0, 1fr)';
|
|
15
|
+
if (drawerVisible) {
|
|
16
|
+
const drawer = `[drawer] ${drawerWidth}px`;
|
|
17
|
+
return drawerPosition === 'right'
|
|
18
|
+
? `${main} ${drawer}`
|
|
19
|
+
: `${drawer} ${main}`;
|
|
20
|
+
}
|
|
21
|
+
return main;
|
|
22
|
+
}
|
package/esm/ui/index.d.ts
CHANGED
|
@@ -1 +1,13 @@
|
|
|
1
|
-
export
|
|
1
|
+
export { default as AboutDialog } from './AboutDialog.tsx';
|
|
2
|
+
export { default as Drawer } from './Drawer.tsx';
|
|
3
|
+
export { default as DrawerControls } from './DrawerControls.tsx';
|
|
4
|
+
export { default as DrawerHeader } from './DrawerHeader.tsx';
|
|
5
|
+
export { default as DrawerWidget } from './DrawerWidget.tsx';
|
|
6
|
+
export { default as DrawerWidgetSelector } from './DrawerWidgetSelector.tsx';
|
|
7
|
+
export { drawerGridTemplateColumns } from './drawerLayout.ts';
|
|
8
|
+
export { default as ModalWidget } from './ModalWidget.tsx';
|
|
9
|
+
export { default as ModalWidgetAppBar } from './ModalWidgetAppBar.tsx';
|
|
10
|
+
export { default as PreferencesDialog } from './PreferencesDialog.tsx';
|
|
11
|
+
export type { PreferencesDialogSession, PreferencesPanelDescriptor, } from './PreferencesDialog.tsx';
|
|
12
|
+
export { default as WidgetBody } from './WidgetBody.tsx';
|
|
13
|
+
export { default as WidgetHeading } from './WidgetHeading.tsx';
|
package/esm/ui/index.js
CHANGED
|
@@ -1 +1,12 @@
|
|
|
1
|
-
export
|
|
1
|
+
export { default as AboutDialog } from './AboutDialog.js';
|
|
2
|
+
export { default as Drawer } from './Drawer.js';
|
|
3
|
+
export { default as DrawerControls } from './DrawerControls.js';
|
|
4
|
+
export { default as DrawerHeader } from './DrawerHeader.js';
|
|
5
|
+
export { default as DrawerWidget } from './DrawerWidget.js';
|
|
6
|
+
export { default as DrawerWidgetSelector } from './DrawerWidgetSelector.js';
|
|
7
|
+
export { drawerGridTemplateColumns } from './drawerLayout.js';
|
|
8
|
+
export { default as ModalWidget } from './ModalWidget.js';
|
|
9
|
+
export { default as ModalWidgetAppBar } from './ModalWidgetAppBar.js';
|
|
10
|
+
export { default as PreferencesDialog } from './PreferencesDialog.js';
|
|
11
|
+
export { default as WidgetBody } from './WidgetBody.js';
|
|
12
|
+
export { default as WidgetHeading } from './WidgetHeading.js';
|
package/esm/ui/util.d.ts
CHANGED
|
@@ -1,10 +1,42 @@
|
|
|
1
1
|
import type PluginManager from '@jbrowse/core/PluginManager';
|
|
2
2
|
import type { AnyConfigurationModel } from '@jbrowse/core/configuration';
|
|
3
3
|
import type { AbstractSessionModel } from '@jbrowse/core/util';
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
|
|
7
|
-
config:
|
|
4
|
+
export type AboutConfig = AnyConfigurationModel | Record<string, unknown>;
|
|
5
|
+
export interface AboutPanelProps {
|
|
6
|
+
session: AbstractSessionModel;
|
|
7
|
+
config: AboutConfig;
|
|
8
|
+
}
|
|
9
|
+
declare module '@jbrowse/core/PluginManager' {
|
|
10
|
+
interface ExtensionPointRegistry {
|
|
11
|
+
'Core-extraAboutPanel': ComponentList<AboutPanelProps>;
|
|
12
|
+
/** #extensionPoint Core-replaceAbout | sync | Replace or wrap a track's About dialog body */
|
|
13
|
+
'Core-replaceAbout': ComponentSlot<AboutPanelProps>;
|
|
14
|
+
'Core-customizeAbout': {
|
|
15
|
+
args: {
|
|
16
|
+
config: Record<string, unknown>;
|
|
17
|
+
};
|
|
18
|
+
result: {
|
|
19
|
+
config: {
|
|
20
|
+
metadata?: Record<string, unknown>;
|
|
21
|
+
[key: string]: unknown;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
props: AboutPanelProps;
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Build what a track's About dialog shows: the base config merged with session-
|
|
30
|
+
* and track-level `formatAbout` overrides and passed through the
|
|
31
|
+
* `Core-customizeAbout` extension point, plus the resolved `hideUris`.
|
|
32
|
+
*
|
|
33
|
+
* Both `formatAbout` slots are two-tier and resolve here together, so the
|
|
34
|
+
* dialog reads one thing rather than re-deriving half the rule at the call
|
|
35
|
+
* site. They fold differently on purpose: `config` is a merge the track can win
|
|
36
|
+
* key-by-key, `hideUris` is an OR a track cannot turn back off.
|
|
37
|
+
*/
|
|
38
|
+
export declare function getAboutDialogConfig({ config, session, pluginManager, }: {
|
|
39
|
+
config: AboutConfig;
|
|
8
40
|
session: AbstractSessionModel;
|
|
9
41
|
pluginManager: PluginManager;
|
|
10
42
|
}): {
|
|
@@ -12,4 +44,5 @@ export declare function generateDisplayableConfig({ config, session, pluginManag
|
|
|
12
44
|
metadata?: Record<string, unknown>;
|
|
13
45
|
[key: string]: unknown;
|
|
14
46
|
};
|
|
47
|
+
hideUris: boolean;
|
|
15
48
|
};
|
package/esm/ui/util.js
CHANGED
|
@@ -1,42 +1,39 @@
|
|
|
1
|
-
import { getConf, readConfObject } from '@jbrowse/core/configuration';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
export function
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}
|
|
26
|
-
let result = config;
|
|
27
|
-
for (const key of slotPath) {
|
|
28
|
-
result = result?.[key];
|
|
29
|
-
}
|
|
30
|
-
return result;
|
|
31
|
-
}
|
|
32
|
-
export function generateDisplayableConfig({ config, session, pluginManager, }) {
|
|
33
|
-
const conf = isStateTreeNode(config) ? readConfObject(config) : config;
|
|
34
|
-
const formatAboutConfig = readConf(config, ['formatAbout', 'config']) || {};
|
|
35
|
-
return pluginManager.evaluateExtensionPoint('Core-customizeAbout', {
|
|
1
|
+
import { getConf, mergeFormatCallbacks, readConfObject, readConfSlot, } from '@jbrowse/core/configuration';
|
|
2
|
+
import { isStateTreeNode } from '@jbrowse/mobx-state-tree';
|
|
3
|
+
// #endregion
|
|
4
|
+
/**
|
|
5
|
+
* Build what a track's About dialog shows: the base config merged with session-
|
|
6
|
+
* and track-level `formatAbout` overrides and passed through the
|
|
7
|
+
* `Core-customizeAbout` extension point, plus the resolved `hideUris`.
|
|
8
|
+
*
|
|
9
|
+
* Both `formatAbout` slots are two-tier and resolve here together, so the
|
|
10
|
+
* dialog reads one thing rather than re-deriving half the rule at the call
|
|
11
|
+
* site. They fold differently on purpose: `config` is a merge the track can win
|
|
12
|
+
* key-by-key, `hideUris` is an OR a track cannot turn back off.
|
|
13
|
+
*/
|
|
14
|
+
export function getAboutDialogConfig({ config, session, pluginManager, }) {
|
|
15
|
+
const conf = isStateTreeNode(config)
|
|
16
|
+
? readConfObject(config)
|
|
17
|
+
: config;
|
|
18
|
+
const trackFormatAbout = readConfSlot(config, ['formatAbout', 'config'], { config: conf }, pluginManager.jexl);
|
|
19
|
+
const sessionFormatAbout = getConf(session, ['formatAbout', 'config'], {
|
|
20
|
+
config: conf,
|
|
21
|
+
});
|
|
22
|
+
// same two-tier merge the feature-details panel runs on `formatDetails`,
|
|
23
|
+
// session first so a track can override individual keys
|
|
24
|
+
const merged = {
|
|
36
25
|
config: {
|
|
37
26
|
...conf,
|
|
38
|
-
...
|
|
39
|
-
...formatAboutConfig,
|
|
27
|
+
...mergeFormatCallbacks(sessionFormatAbout, trackFormatAbout),
|
|
40
28
|
},
|
|
41
|
-
}
|
|
29
|
+
};
|
|
30
|
+
return {
|
|
31
|
+
...pluginManager.evaluateExtensionPoint(
|
|
32
|
+
/** #extensionPoint Core-customizeAbout | sync | Transform the config shown in a track's About dialog */
|
|
33
|
+
'Core-customizeAbout', merged, { session, config }),
|
|
34
|
+
// OR'd, not merged: a deployment that hides file locations session-wide
|
|
35
|
+
// can't have a track turn them back on. Documented on the slot
|
|
36
|
+
hideUris: Boolean(getConf(session, ['formatAbout', 'hideUris']) ||
|
|
37
|
+
readConfSlot(config, ['formatAbout', 'hideUris'])),
|
|
38
|
+
};
|
|
42
39
|
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { EmbeddedRoot } from './destroyViewState.ts';
|
|
2
|
+
export { useCreateOnce, useCreateOnceAsync } from '@jbrowse/core/util/hooks';
|
|
3
|
+
/**
|
|
4
|
+
* Async `useCreateOnce` + `useDestroyOnUnmount`: undefined until the engine is
|
|
5
|
+
* ready. An engine resolving after the final unmount is destroyed on arrival
|
|
6
|
+
* instead of orphaning its worker pool and autoruns.
|
|
7
|
+
*/
|
|
8
|
+
export declare function useAsyncEngineLifecycle<T extends EmbeddedRoot>(create: () => Promise<T>): T | undefined;
|
|
9
|
+
/**
|
|
10
|
+
* Destroy an engine when its component really unmounts — terminating its RPC
|
|
11
|
+
* worker threads and stopping its autoruns.
|
|
12
|
+
*
|
|
13
|
+
* The lifecycle rule is {@link useFinalUnmount}'s, including why the obvious
|
|
14
|
+
* `useEffect(() => () => destroyViewState(state), [state])` is wrong under
|
|
15
|
+
* StrictMode; this only names what gets torn down. Pair it with
|
|
16
|
+
* `useCreateOnce`, since the engine has to be the same one for the component's
|
|
17
|
+
* whole life.
|
|
18
|
+
*/
|
|
19
|
+
export declare function useDestroyOnUnmount(viewState: EmbeddedRoot): void;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { useRef } from 'react';
|
|
2
|
+
import { useCreateOnceAsync, useFinalUnmount } from '@jbrowse/core/util/hooks';
|
|
3
|
+
import { destroyViewState } from './destroyViewState.js';
|
|
4
|
+
// `useCreateOnce` is core's, and is re-exported rather than wrapped: an engine
|
|
5
|
+
// is only the most expensive thing StrictMode's double-invoked state
|
|
6
|
+
// initializer can build twice, not the only one. The faceted track selector's
|
|
7
|
+
// MST model hit the same trap in a plugin, which cannot reach this package.
|
|
8
|
+
export { useCreateOnce, useCreateOnceAsync } from '@jbrowse/core/util/hooks';
|
|
9
|
+
/**
|
|
10
|
+
* Async `useCreateOnce` + `useDestroyOnUnmount`: undefined until the engine is
|
|
11
|
+
* ready. An engine resolving after the final unmount is destroyed on arrival
|
|
12
|
+
* instead of orphaning its worker pool and autoruns.
|
|
13
|
+
*/
|
|
14
|
+
export function useAsyncEngineLifecycle(create) {
|
|
15
|
+
const unmounted = useRef(false);
|
|
16
|
+
const engine = useCreateOnceAsync(() => create().then(built => {
|
|
17
|
+
if (unmounted.current) {
|
|
18
|
+
destroyViewState(built);
|
|
19
|
+
}
|
|
20
|
+
return built;
|
|
21
|
+
}));
|
|
22
|
+
useFinalUnmount(() => {
|
|
23
|
+
unmounted.current = true;
|
|
24
|
+
if (engine) {
|
|
25
|
+
destroyViewState(engine);
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
return engine;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Destroy an engine when its component really unmounts — terminating its RPC
|
|
32
|
+
* worker threads and stopping its autoruns.
|
|
33
|
+
*
|
|
34
|
+
* The lifecycle rule is {@link useFinalUnmount}'s, including why the obvious
|
|
35
|
+
* `useEffect(() => () => destroyViewState(state), [state])` is wrong under
|
|
36
|
+
* StrictMode; this only names what gets torn down. Pair it with
|
|
37
|
+
* `useCreateOnce`, since the engine has to be the same one for the component's
|
|
38
|
+
* whole life.
|
|
39
|
+
*/
|
|
40
|
+
export function useDestroyOnUnmount(viewState) {
|
|
41
|
+
useFinalUnmount(() => {
|
|
42
|
+
destroyViewState(viewState);
|
|
43
|
+
});
|
|
44
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jbrowse/product-core",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.0-beta.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"description": "JBrowse 2 code shared between products but not used by plugins",
|
|
@@ -25,23 +25,23 @@
|
|
|
25
25
|
"esm"
|
|
26
26
|
],
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@jbrowse/mobx-state-tree": "^5.
|
|
29
|
-
"@mui/material": "^
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"mobx": "^
|
|
33
|
-
"
|
|
34
|
-
"@jbrowse/core": "^
|
|
28
|
+
"@jbrowse/mobx-state-tree": "^6.5.1",
|
|
29
|
+
"@mui/icons-material": "^9.4.0",
|
|
30
|
+
"@mui/material": "^9.4.0",
|
|
31
|
+
"mobx": "^7.0.3",
|
|
32
|
+
"mobx-react": "^10.0.2",
|
|
33
|
+
"@jbrowse/core": "^5.0.0-beta.2",
|
|
34
|
+
"@jbrowse/render-core": "^5.0.0-beta.2"
|
|
35
35
|
},
|
|
36
36
|
"peerDependencies": {
|
|
37
|
-
"react": ">=
|
|
38
|
-
"react-dom": ">=
|
|
37
|
+
"react": ">=19.0.0",
|
|
38
|
+
"react-dom": ">=19.0.0"
|
|
39
39
|
},
|
|
40
40
|
"publishConfig": {
|
|
41
41
|
"access": "public"
|
|
42
42
|
},
|
|
43
43
|
"scripts": {
|
|
44
|
-
"build:esm": "tsc
|
|
44
|
+
"build:esm": "node ../../node_modules/typescript7/bin/tsc --build tsconfig.build.esm.json",
|
|
45
45
|
"build": "pnpm build:esm",
|
|
46
46
|
"test": "cd ../..; jest --passWithNoTests packages/product-core",
|
|
47
47
|
"clean": "rimraf esm *.tsbuildinfo",
|
|
@@ -49,9 +49,6 @@
|
|
|
49
49
|
},
|
|
50
50
|
"types": "esm/index.d.ts",
|
|
51
51
|
"exports": {
|
|
52
|
-
".":
|
|
53
|
-
"types": "./esm/index.d.ts",
|
|
54
|
-
"import": "./esm/index.js"
|
|
55
|
-
}
|
|
52
|
+
".": "./esm/index.js"
|
|
56
53
|
}
|
|
57
54
|
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export declare function FormatAboutConfigSchemaFactory(): import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
2
|
-
config: {
|
|
3
|
-
type: string;
|
|
4
|
-
description: string;
|
|
5
|
-
defaultValue: {};
|
|
6
|
-
contextVariable: string[];
|
|
7
|
-
};
|
|
8
|
-
hideUris: {
|
|
9
|
-
type: string;
|
|
10
|
-
defaultValue: boolean;
|
|
11
|
-
};
|
|
12
|
-
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { ConfigurationSchema } from '@jbrowse/core/configuration';
|
|
2
|
-
export function FormatAboutConfigSchemaFactory() {
|
|
3
|
-
return ConfigurationSchema('FormatAbout', {
|
|
4
|
-
config: {
|
|
5
|
-
type: 'frozen',
|
|
6
|
-
description: 'formats configuration object in about dialog',
|
|
7
|
-
defaultValue: {},
|
|
8
|
-
contextVariable: ['config'],
|
|
9
|
-
},
|
|
10
|
-
hideUris: {
|
|
11
|
-
type: 'boolean',
|
|
12
|
-
defaultValue: false,
|
|
13
|
-
},
|
|
14
|
-
});
|
|
15
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
export declare function FormatDetailsConfigSchemaFactory(): import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
2
|
-
feature: {
|
|
3
|
-
type: string;
|
|
4
|
-
description: string;
|
|
5
|
-
defaultValue: {};
|
|
6
|
-
contextVariable: string[];
|
|
7
|
-
};
|
|
8
|
-
subfeatures: {
|
|
9
|
-
type: string;
|
|
10
|
-
description: string;
|
|
11
|
-
defaultValue: {};
|
|
12
|
-
contextVariable: string[];
|
|
13
|
-
};
|
|
14
|
-
depth: {
|
|
15
|
-
type: string;
|
|
16
|
-
defaultValue: number;
|
|
17
|
-
description: string;
|
|
18
|
-
};
|
|
19
|
-
maxDepth: {
|
|
20
|
-
type: string;
|
|
21
|
-
defaultValue: number;
|
|
22
|
-
description: string;
|
|
23
|
-
};
|
|
24
|
-
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { ConfigurationSchema } from '@jbrowse/core/configuration';
|
|
2
|
-
export function FormatDetailsConfigSchemaFactory() {
|
|
3
|
-
return ConfigurationSchema('FormatDetails', {
|
|
4
|
-
feature: {
|
|
5
|
-
type: 'frozen',
|
|
6
|
-
description: 'adds extra fields to the feature details',
|
|
7
|
-
defaultValue: {},
|
|
8
|
-
contextVariable: ['feature'],
|
|
9
|
-
},
|
|
10
|
-
subfeatures: {
|
|
11
|
-
type: 'frozen',
|
|
12
|
-
description: 'adds extra fields to the subfeatures of a feature',
|
|
13
|
-
defaultValue: {},
|
|
14
|
-
contextVariable: ['feature'],
|
|
15
|
-
},
|
|
16
|
-
depth: {
|
|
17
|
-
type: 'number',
|
|
18
|
-
defaultValue: 2,
|
|
19
|
-
description: 'depth to iterate the formatDetails->subfeatures callback on subfeatures (used for example to only apply the callback to the first layer of subfeatures)',
|
|
20
|
-
},
|
|
21
|
-
maxDepth: {
|
|
22
|
-
type: 'number',
|
|
23
|
-
defaultValue: 10000,
|
|
24
|
-
description: 'hide subfeatures greater than a certain depth',
|
|
25
|
-
},
|
|
26
|
-
});
|
|
27
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type PluginManager from '@jbrowse/core/PluginManager';
|
|
2
|
-
import type { DialogComponentType } from '@jbrowse/core/util';
|
|
3
|
-
import type { IAnyStateTreeNode, Instance } from '@jbrowse/mobx-state-tree';
|
|
4
|
-
type DoneCallback = (doneCallback: () => void) => [DialogComponentType, Record<string, unknown>];
|
|
5
|
-
export declare function DialogQueueSessionMixin(_pluginManager: PluginManager): import("@jbrowse/mobx-state-tree").IModelType<{}, {
|
|
6
|
-
queueOfDialogs: [DialogComponentType, Record<string, unknown>][];
|
|
7
|
-
} & {
|
|
8
|
-
readonly DialogComponent: DialogComponentType | undefined;
|
|
9
|
-
readonly DialogProps: Record<string, unknown> | undefined;
|
|
10
|
-
} & {
|
|
11
|
-
removeActiveDialog(): void;
|
|
12
|
-
queueDialog(doneCallback: DoneCallback): void;
|
|
13
|
-
}, import("@jbrowse/mobx-state-tree")._NotCustomized, import("@jbrowse/mobx-state-tree")._NotCustomized>;
|
|
14
|
-
export type SessionWithDialogsType = ReturnType<typeof DialogQueueSessionMixin>;
|
|
15
|
-
export type SessionWithDialogs = Instance<SessionWithDialogsType>;
|
|
16
|
-
export declare function isSessionWithDialogs(session: IAnyStateTreeNode): session is SessionWithDialogs;
|
|
17
|
-
export {};
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { types } from '@jbrowse/mobx-state-tree';
|
|
2
|
-
import { isBaseSession } from "./BaseSession.js";
|
|
3
|
-
export function DialogQueueSessionMixin(_pluginManager) {
|
|
4
|
-
return types
|
|
5
|
-
.model('DialogQueueSessionMixin', {})
|
|
6
|
-
.volatile(() => ({
|
|
7
|
-
queueOfDialogs: [],
|
|
8
|
-
}))
|
|
9
|
-
.views(self => ({
|
|
10
|
-
get DialogComponent() {
|
|
11
|
-
return self.queueOfDialogs[0]?.[0];
|
|
12
|
-
},
|
|
13
|
-
get DialogProps() {
|
|
14
|
-
return self.queueOfDialogs[0]?.[1];
|
|
15
|
-
},
|
|
16
|
-
}))
|
|
17
|
-
.actions(self => ({
|
|
18
|
-
removeActiveDialog() {
|
|
19
|
-
self.queueOfDialogs = self.queueOfDialogs.slice(1);
|
|
20
|
-
},
|
|
21
|
-
queueDialog(doneCallback) {
|
|
22
|
-
const [component, props] = doneCallback(() => {
|
|
23
|
-
this.removeActiveDialog();
|
|
24
|
-
});
|
|
25
|
-
self.queueOfDialogs = [...self.queueOfDialogs, [component, props]];
|
|
26
|
-
},
|
|
27
|
-
}));
|
|
28
|
-
}
|
|
29
|
-
export function isSessionWithDialogs(session) {
|
|
30
|
-
return isBaseSession(session) && 'queueOfDialogs' in session;
|
|
31
|
-
}
|