@jbrowse/plugin-config 4.2.1 → 5.0.0-beta.1

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 (72) hide show
  1. package/esm/ConfigurationEditorWidget/components/AddNewField.d.ts +4 -0
  2. package/esm/ConfigurationEditorWidget/components/AddNewField.js +28 -0
  3. package/esm/ConfigurationEditorWidget/components/BooleanEditor.d.ts +4 -2
  4. package/esm/ConfigurationEditorWidget/components/BooleanEditor.js +19 -4
  5. package/esm/ConfigurationEditorWidget/components/CallbackEditor.d.ts +4 -2
  6. package/esm/ConfigurationEditorWidget/components/CallbackEditor.js +24 -42
  7. package/esm/ConfigurationEditorWidget/components/ColorEditor.d.ts +3 -11
  8. package/esm/ConfigurationEditorWidget/components/ColorEditor.js +28 -20
  9. package/esm/ConfigurationEditorWidget/components/ConfigurationEditor.d.ts +2 -3
  10. package/esm/ConfigurationEditorWidget/components/ConfigurationEditor.js +108 -17
  11. package/esm/ConfigurationEditorWidget/components/ConfigurationTextField.d.ts +1 -1
  12. package/esm/ConfigurationEditorWidget/components/ConfigurationTextField.js +10 -2
  13. package/esm/ConfigurationEditorWidget/components/HeadingComponent.d.ts +1 -1
  14. package/esm/ConfigurationEditorWidget/components/IntegerEditor.d.ts +10 -0
  15. package/esm/ConfigurationEditorWidget/components/IntegerEditor.js +9 -0
  16. package/esm/ConfigurationEditorWidget/components/JsonEditor.d.ts +3 -1
  17. package/esm/ConfigurationEditorWidget/components/JsonEditor.js +27 -40
  18. package/esm/ConfigurationEditorWidget/components/MapEntryCard.d.ts +8 -0
  19. package/esm/ConfigurationEditorWidget/components/MapEntryCard.js +23 -0
  20. package/esm/ConfigurationEditorWidget/components/MapSlotEditor.d.ts +8 -0
  21. package/esm/ConfigurationEditorWidget/components/MapSlotEditor.js +18 -0
  22. package/esm/ConfigurationEditorWidget/components/NumberEditor.d.ts +6 -4
  23. package/esm/ConfigurationEditorWidget/components/NumberEditor.js +24 -15
  24. package/esm/ConfigurationEditorWidget/components/NumberMapEditor.d.ts +4 -4
  25. package/esm/ConfigurationEditorWidget/components/NumberMapEditor.js +7 -31
  26. package/esm/ConfigurationEditorWidget/components/SlotEditor.d.ts +4 -5
  27. package/esm/ConfigurationEditorWidget/components/SlotEditor.js +83 -48
  28. package/esm/ConfigurationEditorWidget/components/StringArrayEditor.d.ts +3 -4
  29. package/esm/ConfigurationEditorWidget/components/StringArrayEditor.js +11 -24
  30. package/esm/ConfigurationEditorWidget/components/StringArrayMapEditor.d.ts +3 -6
  31. package/esm/ConfigurationEditorWidget/components/StringArrayMapEditor.js +14 -39
  32. package/esm/ConfigurationEditorWidget/components/TypeSelector.d.ts +1 -1
  33. package/esm/ConfigurationEditorWidget/components/TypeSelector.js +2 -2
  34. package/esm/ConfigurationEditorWidget/components/singularSlotName.d.ts +13 -0
  35. package/esm/ConfigurationEditorWidget/components/singularSlotName.js +23 -0
  36. package/esm/ConfigurationEditorWidget/components/useSlotEditorStyles.d.ts +2 -2
  37. package/esm/ConfigurationEditorWidget/components/useSlotEditorStyles.js +6 -1
  38. package/esm/ConfigurationEditorWidget/index.js +3 -3
  39. package/esm/ConfigurationEditorWidget/model.d.ts +8 -1
  40. package/esm/ConfigurationEditorWidget/model.js +40 -1
  41. package/esm/FromConfigAdapter/FromConfigAdapter.d.ts +6 -1
  42. package/esm/FromConfigAdapter/FromConfigAdapter.js +31 -1
  43. package/esm/FromConfigAdapter/configSchema.d.ts +36 -3
  44. package/esm/FromConfigAdapter/configSchema.js +34 -2
  45. package/esm/FromConfigAdapter/index.js +2 -2
  46. package/esm/FromConfigRegionsAdapter/FromConfigRegionsAdapter.d.ts +8 -0
  47. package/esm/FromConfigRegionsAdapter/FromConfigRegionsAdapter.js +10 -25
  48. package/esm/FromConfigRegionsAdapter/configSchema.d.ts +42 -3
  49. package/esm/FromConfigRegionsAdapter/configSchema.js +39 -2
  50. package/esm/FromConfigRegionsAdapter/index.js +2 -2
  51. package/esm/FromConfigSequenceAdapter/FromConfigSequenceAdapter.d.ts +15 -2
  52. package/esm/FromConfigSequenceAdapter/FromConfigSequenceAdapter.js +32 -40
  53. package/esm/FromConfigSequenceAdapter/configSchema.d.ts +41 -3
  54. package/esm/FromConfigSequenceAdapter/configSchema.js +38 -2
  55. package/esm/FromConfigSequenceAdapter/index.js +2 -2
  56. package/esm/NcbiSequenceReportAliasAdapter/NcbiSequenceReportAliasAdapter.d.ts +5 -4
  57. package/esm/NcbiSequenceReportAliasAdapter/NcbiSequenceReportAliasAdapter.js +28 -24
  58. package/esm/NcbiSequenceReportAliasAdapter/configSchema.d.ts +77 -9
  59. package/esm/NcbiSequenceReportAliasAdapter/configSchema.js +79 -12
  60. package/esm/NcbiSequenceReportAliasAdapter/index.js +3 -2
  61. package/esm/RefNameAliasAdapter/RefNameAliasAdapter.d.ts +4 -3
  62. package/esm/RefNameAliasAdapter/RefNameAliasAdapter.js +22 -28
  63. package/esm/RefNameAliasAdapter/configSchema.d.ts +87 -12
  64. package/esm/RefNameAliasAdapter/configSchema.js +86 -12
  65. package/esm/RefNameAliasAdapter/index.js +3 -2
  66. package/esm/aliasUtils.d.ts +4 -0
  67. package/esm/aliasUtils.js +26 -0
  68. package/esm/index.d.ts +2 -2
  69. package/esm/index.js +7 -7
  70. package/esm/normalizeUriSnapshot.d.ts +1 -0
  71. package/esm/normalizeUriSnapshot.js +13 -0
  72. package/package.json +11 -15
@@ -1,10 +1,11 @@
1
1
  import { AdapterType } from '@jbrowse/core/pluggableElementTypes';
2
- import configSchema from "./configSchema.js";
2
+ import configSchema, { normalizeSnapshot } from './configSchema.js';
3
3
  export default function RefNameAliasAdapterF(pluginManager) {
4
4
  pluginManager.addAdapterType(() => new AdapterType({
5
5
  name: 'RefNameAliasAdapter',
6
+ normalizeSnapshot,
6
7
  configSchema,
7
- getAdapterClass: () => import("./RefNameAliasAdapter.js").then(r => r.default),
8
+ getAdapterClass: () => import('./RefNameAliasAdapter.js').then(r => r.default),
8
9
  adapterMetadata: {
9
10
  hiddenFromGUI: true,
10
11
  },
@@ -0,0 +1,4 @@
1
+ import type PluginManager from '@jbrowse/core/PluginManager';
2
+ import type { BaseOptions } from '@jbrowse/core/data_adapters/BaseAdapter';
3
+ import type { FileLocation } from '@jbrowse/core/util/types';
4
+ export declare function readAliasRows(loc: FileLocation, pluginManager?: PluginManager, opts?: BaseOptions): Promise<string[][]>;
@@ -0,0 +1,26 @@
1
+ import { fetchAndMaybeUnzipText } from '@jbrowse/core/util';
2
+ import { openLocation } from '@jbrowse/core/util/io';
3
+ import { isUriLocation } from '@jbrowse/core/util/types';
4
+ // The alias adapters' `location` slots default to a "/path/to/my/..."
5
+ // placeholder; that (and a blank uri) means "no file configured", so the
6
+ // adapter yields no aliases rather than trying to fetch the placeholder path.
7
+ function isUnconfiguredLocation(loc) {
8
+ return isUriLocation(loc) && (!loc.uri || loc.uri.startsWith('/path/to/my/'));
9
+ }
10
+ // Reads a tab-separated alias file into rows of columns, dropping blank lines.
11
+ // Returns [] when no file is configured.
12
+ export async function readAliasRows(loc, pluginManager, opts) {
13
+ if (isUnconfiguredLocation(loc)) {
14
+ return [];
15
+ }
16
+ // fetchAndMaybeUnzipText rather than readFile('utf8') so the read reports byte
17
+ // progress (readFile's utf8 path takes res.text(), which can't) and so a
18
+ // gzipped chromAlias works. UCSC's chromAlias files are the slowest of the
19
+ // four parallel assembly loads on a big assembly, so this is the one whose
20
+ // progress the spinner most often ends up showing
21
+ const text = await fetchAndMaybeUnzipText(openLocation(loc, pluginManager), opts, 'Downloading chromosome aliases');
22
+ return text
23
+ .split(/\n|\r\n|\r/)
24
+ .filter(line => !!line.trim())
25
+ .map(line => line.split('\t'));
26
+ }
package/esm/index.d.ts CHANGED
@@ -3,9 +3,9 @@ import type PluginManager from '@jbrowse/core/PluginManager';
3
3
  declare const LazyConfigurationEditorComponent: import("react").LazyExoticComponent<({ model, }: {
4
4
  model: {
5
5
  target?: import("@jbrowse/core/configuration").AnyConfigurationModel;
6
+ expandedDisplayId?: string;
6
7
  };
7
- session?: import("@jbrowse/core/util").AbstractSessionModel;
8
- }) => import("react/jsx-runtime").JSX.Element>;
8
+ }) => import("react").JSX.Element>;
9
9
  export default class ConfigurationPlugin extends Plugin {
10
10
  name: string;
11
11
  install(pluginManager: PluginManager): void;
package/esm/index.js CHANGED
@@ -1,12 +1,12 @@
1
1
  import { lazy } from 'react';
2
2
  import Plugin from '@jbrowse/core/Plugin';
3
- import ConfigurationEditorWidgetF from "./ConfigurationEditorWidget/index.js";
4
- import FromConfigAdapterF from "./FromConfigAdapter/index.js";
5
- import FromConfigRegionsAdapterF from "./FromConfigRegionsAdapter/index.js";
6
- import FromConfigSequenceAdapterF from "./FromConfigSequenceAdapter/index.js";
7
- import NcbiSequenceReportAliasAdapterF from "./NcbiSequenceReportAliasAdapter/index.js";
8
- import RefNameAliasAdapterF from "./RefNameAliasAdapter/index.js";
9
- const LazyConfigurationEditorComponent = lazy(() => import("./ConfigurationEditorWidget/components/ConfigurationEditor.js"));
3
+ import ConfigurationEditorWidgetF from './ConfigurationEditorWidget/index.js';
4
+ import FromConfigAdapterF from './FromConfigAdapter/index.js';
5
+ import FromConfigRegionsAdapterF from './FromConfigRegionsAdapter/index.js';
6
+ import FromConfigSequenceAdapterF from './FromConfigSequenceAdapter/index.js';
7
+ import NcbiSequenceReportAliasAdapterF from './NcbiSequenceReportAliasAdapter/index.js';
8
+ import RefNameAliasAdapterF from './RefNameAliasAdapter/index.js';
9
+ const LazyConfigurationEditorComponent = lazy(() => import('./ConfigurationEditorWidget/components/ConfigurationEditor.js'));
10
10
  export default class ConfigurationPlugin extends Plugin {
11
11
  name = 'ConfigurationPlugin';
12
12
  install(pluginManager) {
@@ -0,0 +1 @@
1
+ export declare function normalizeUriSnapshot(snap: Record<string, unknown>): Record<string, unknown>;
@@ -0,0 +1,13 @@
1
+ // allows a minimal config of `{ uri: "..." }` by lifting `uri`/`baseUri` into
2
+ // a proper `location` fileLocation slot. Shared by the alias adapters.
3
+ export function normalizeUriSnapshot(snap) {
4
+ return snap.uri
5
+ ? {
6
+ ...snap,
7
+ location: {
8
+ uri: snap.uri,
9
+ baseUri: snap.baseUri,
10
+ },
11
+ }
12
+ : snap;
13
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jbrowse/plugin-config",
3
- "version": "4.2.1",
3
+ "version": "5.0.0-beta.1",
4
4
  "type": "module",
5
5
  "description": "JBrowse 2 config utilities",
6
6
  "keywords": [
@@ -21,18 +21,17 @@
21
21
  "esm"
22
22
  ],
23
23
  "dependencies": {
24
- "@jbrowse/mobx-state-tree": "^5.6.0",
25
- "@mui/icons-material": "^7.3.10",
26
- "@mui/material": "^7.3.10",
27
- "mobx": "^6.15.0",
28
- "mobx-react": "^9.2.1",
29
- "pluralize": "^8.0.0",
24
+ "@jbrowse/mobx-state-tree": "^6.5.1",
25
+ "@mui/icons-material": "^9.3.1",
26
+ "@mui/material": "^9.3.1",
27
+ "mobx": "^7.0.3",
28
+ "mobx-react": "^10.0.2",
30
29
  "rxjs": "^7.8.2",
31
- "@jbrowse/core": "^4.2.1"
30
+ "@jbrowse/core": "^5.0.0-beta.1"
32
31
  },
33
32
  "peerDependencies": {
34
- "react": ">=18.0.0",
35
- "react-dom": ">=18.0.0"
33
+ "react": ">=19.0.0",
34
+ "react-dom": ">=19.0.0"
36
35
  },
37
36
  "publishConfig": {
38
37
  "access": "public"
@@ -42,14 +41,11 @@
42
41
  "build": "pnpm run /^build:/",
43
42
  "test": "cd ../..; jest --passWithNoTests plugins/config",
44
43
  "prebuild": "pnpm clean",
45
- "build:esm": "tsc -p tsconfig.build.esm.json",
44
+ "build:esm": "node ../../node_modules/typescript7/bin/tsc --build tsconfig.build.esm.json",
46
45
  "clean": "rimraf esm *.tsbuildinfo"
47
46
  },
48
47
  "types": "esm/index.d.ts",
49
48
  "exports": {
50
- ".": {
51
- "types": "./esm/index.d.ts",
52
- "import": "./esm/index.js"
53
- }
49
+ ".": "./esm/index.js"
54
50
  }
55
51
  }