@jbrowse/core 2.0.1 → 2.1.0

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 (179) hide show
  1. package/BaseFeatureWidget/BaseFeatureDetail.d.ts +6 -0
  2. package/BaseFeatureWidget/BaseFeatureDetail.js +313 -592
  3. package/BaseFeatureWidget/SequenceFeatureDetails.js +213 -479
  4. package/BaseFeatureWidget/index.js +88 -126
  5. package/BaseFeatureWidget/types.js +1 -4
  6. package/BaseFeatureWidget/util.js +40 -75
  7. package/CorePlugin.js +55 -94
  8. package/Plugin.js +9 -34
  9. package/PluginLoader.js +153 -422
  10. package/PluginManager.d.ts +17 -14
  11. package/PluginManager.js +377 -666
  12. package/ReExports/Attributes.js +3 -10
  13. package/ReExports/BaseCard.js +3 -10
  14. package/ReExports/DataGrid.js +5 -12
  15. package/ReExports/FeatureDetails.js +3 -10
  16. package/ReExports/index.js +6 -12
  17. package/ReExports/list.d.ts +5 -0
  18. package/ReExports/list.js +271 -7
  19. package/ReExports/material-ui-colors.js +15 -16
  20. package/ReExports/modules.d.ts +0 -1
  21. package/ReExports/modules.js +453 -798
  22. package/TextSearch/BaseResults.js +51 -123
  23. package/TextSearch/TextSearchManager.js +66 -144
  24. package/assemblyManager/assembly.js +280 -555
  25. package/assemblyManager/assemblyConfigSchema.js +47 -64
  26. package/assemblyManager/assemblyManager.js +126 -272
  27. package/assemblyManager/index.js +9 -22
  28. package/configuration/configurationSchema.js +167 -203
  29. package/configuration/configurationSlot.js +248 -326
  30. package/configuration/index.js +19 -35
  31. package/configuration/util.js +131 -173
  32. package/data_adapters/BaseAdapter.d.ts +2 -2
  33. package/data_adapters/BaseAdapter.js +132 -521
  34. package/data_adapters/CytobandAdapter.js +40 -126
  35. package/data_adapters/dataAdapterCache.js +77 -158
  36. package/package.json +4 -5
  37. package/pluggableElementTypes/AdapterType.js +24 -79
  38. package/pluggableElementTypes/AddTrackWorkflowType.d.ts +17 -0
  39. package/pluggableElementTypes/AddTrackWorkflowType.js +20 -0
  40. package/pluggableElementTypes/ConnectionType.js +22 -65
  41. package/pluggableElementTypes/DisplayType.js +35 -82
  42. package/pluggableElementTypes/InternetAccountType.js +23 -64
  43. package/pluggableElementTypes/PluggableElementBase.js +8 -20
  44. package/pluggableElementTypes/RpcMethodType.js +85 -427
  45. package/pluggableElementTypes/TextSearchAdapterType.js +16 -55
  46. package/pluggableElementTypes/TrackType.js +26 -70
  47. package/pluggableElementTypes/ViewType.js +21 -63
  48. package/pluggableElementTypes/WidgetType.js +21 -64
  49. package/pluggableElementTypes/index.d.ts +4 -3
  50. package/pluggableElementTypes/index.js +42 -125
  51. package/pluggableElementTypes/models/BaseConnectionModelFactory.js +28 -43
  52. package/pluggableElementTypes/models/BaseDisplayModel.js +58 -95
  53. package/pluggableElementTypes/models/BaseTrackModel.js +139 -199
  54. package/pluggableElementTypes/models/BaseViewModel.js +24 -40
  55. package/pluggableElementTypes/models/InternetAccountModel.js +116 -263
  56. package/pluggableElementTypes/models/baseConnectionConfig.js +14 -25
  57. package/pluggableElementTypes/models/baseInternetAccountConfig.js +29 -38
  58. package/pluggableElementTypes/models/baseTrackConfig.js +106 -133
  59. package/pluggableElementTypes/models/index.js +21 -70
  60. package/pluggableElementTypes/renderers/BoxRendererType.js +132 -291
  61. package/pluggableElementTypes/renderers/CircularChordRendererType.js +8 -38
  62. package/pluggableElementTypes/renderers/ComparativeServerSideRendererType.js +60 -192
  63. package/pluggableElementTypes/renderers/FeatureRendererType.d.ts +0 -2
  64. package/pluggableElementTypes/renderers/FeatureRendererType.js +89 -264
  65. package/pluggableElementTypes/renderers/RendererType.js +31 -105
  66. package/pluggableElementTypes/renderers/ServerSideRenderedContent.js +61 -72
  67. package/pluggableElementTypes/renderers/ServerSideRendererType.js +112 -265
  68. package/pluggableElementTypes/renderers/index.js +19 -62
  69. package/pluggableElementTypes/renderers/util/serializableFilterChain.js +27 -65
  70. package/rpc/BaseRpcDriver.js +169 -405
  71. package/rpc/MainThreadRpcDriver.js +27 -150
  72. package/rpc/RpcManager.js +58 -159
  73. package/rpc/WebWorkerRpcDriver.js +54 -171
  74. package/rpc/configSchema.js +25 -49
  75. package/rpc/coreRpcMethods.js +221 -959
  76. package/rpc/remoteAbortSignals.js +46 -70
  77. package/tsconfig.build.tsbuildinfo +1 -1
  78. package/ui/AboutDialog.js +106 -162
  79. package/ui/App.js +157 -242
  80. package/ui/AssemblySelector.js +59 -120
  81. package/ui/CascadingMenu.js +101 -196
  82. package/ui/ColorPicker.d.ts +16 -0
  83. package/ui/ColorPicker.js +97 -0
  84. package/ui/Drawer.js +28 -61
  85. package/ui/DrawerWidget.js +108 -202
  86. package/ui/DropDownMenu.js +60 -91
  87. package/ui/EditableTypography.js +87 -149
  88. package/ui/ErrorMessage.js +41 -56
  89. package/ui/FactoryResetDialog.js +24 -57
  90. package/ui/FatalErrorDialog.js +59 -91
  91. package/ui/FileSelector/FileSelector.js +123 -189
  92. package/ui/FileSelector/LocalFileChooser.js +44 -75
  93. package/ui/FileSelector/UrlChooser.js +17 -38
  94. package/ui/FileSelector/index.js +6 -12
  95. package/ui/Icons.js +45 -69
  96. package/ui/Logo.js +57 -110
  97. package/ui/Menu.js +232 -354
  98. package/ui/PrerenderedCanvas.js +63 -87
  99. package/ui/ResizeHandle.js +87 -116
  100. package/ui/ReturnToImportFormDialog.js +32 -63
  101. package/ui/SanitizedHTML.js +64 -47
  102. package/ui/Snackbar.js +74 -101
  103. package/ui/SnackbarModel.js +37 -51
  104. package/ui/Tooltip.js +49 -76
  105. package/ui/ViewContainer.js +113 -196
  106. package/ui/colors.d.ts +10 -0
  107. package/ui/colors.js +78 -0
  108. package/ui/index.js +51 -181
  109. package/ui/react-colorful.d.ts +17 -0
  110. package/ui/react-colorful.js +455 -0
  111. package/ui/theme.js +199 -247
  112. package/util/Base1DUtils.js +163 -202
  113. package/util/Base1DViewModel.js +121 -168
  114. package/util/QuickLRU.js +84 -332
  115. package/util/TimeTraveller.d.ts +19 -0
  116. package/util/TimeTraveller.js +86 -0
  117. package/util/aborting.js +49 -127
  118. package/util/analytics.js +91 -154
  119. package/util/blockTypes.js +106 -240
  120. package/util/calculateDynamicBlocks.js +98 -128
  121. package/util/calculateStaticBlocks.js +105 -125
  122. package/util/color/cssColorsLevel4.js +156 -160
  123. package/util/color/index.js +33 -55
  124. package/util/compositeMap.js +49 -333
  125. package/util/formatFastaStrings.js +9 -14
  126. package/util/idMaker.js +18 -31
  127. package/util/index.d.ts +7 -20
  128. package/util/index.js +742 -1188
  129. package/util/io/RemoteFileWithRangeCache.js +88 -257
  130. package/util/io/index.js +95 -169
  131. package/util/jexl.js +60 -115
  132. package/util/jexlStrings.js +24 -29
  133. package/util/layouts/BaseLayout.js +1 -4
  134. package/util/layouts/GranularRectLayout.js +388 -555
  135. package/util/layouts/MultiLayout.js +41 -109
  136. package/util/layouts/PrecomputedLayout.js +56 -112
  137. package/util/layouts/PrecomputedMultiLayout.js +22 -59
  138. package/util/layouts/SceneGraph.js +127 -197
  139. package/util/layouts/index.js +29 -66
  140. package/util/mst-reflection.js +55 -71
  141. package/util/offscreenCanvasPonyfill.js +66 -134
  142. package/util/offscreenCanvasUtils.d.ts +2 -7
  143. package/util/offscreenCanvasUtils.js +49 -146
  144. package/util/range.js +29 -40
  145. package/util/rxjs.js +20 -27
  146. package/util/simpleFeature.js +88 -152
  147. package/util/stats.js +91 -151
  148. package/util/tracks.js +130 -173
  149. package/util/types/index.js +110 -179
  150. package/util/types/mst.js +91 -146
  151. package/util/types/util.js +1 -4
  152. package/util/when.js +54 -101
  153. package/BaseFeatureWidget/SequenceFeatureDetails.test.js +0 -122
  154. package/BaseFeatureWidget/index.test.js +0 -69
  155. package/TextSearch/BaseResults.test.js +0 -42
  156. package/configuration/configurationSchema.test.js +0 -266
  157. package/configuration/configurationSlot.test.js +0 -69
  158. package/configuration/util.test.js +0 -39
  159. package/data_adapters/BaseAdapter.test.js +0 -200
  160. package/declare.d.js +0 -1
  161. package/pluggableElementTypes/RpcMethodType.test.js +0 -118
  162. package/pluggableElementTypes/renderers/declare.d.js +0 -1
  163. package/pluggableElementTypes/renderers/util/serializableFilterChain.test.js +0 -20
  164. package/rpc/BaseRpcDriver.test.js +0 -540
  165. package/rpc/declaration.d.js +0 -1
  166. package/ui/FatalErrorDialog.test.js +0 -82
  167. package/ui/SanitizedHTML.test.js +0 -36
  168. package/ui/theme.test.js +0 -92
  169. package/util/Base1DViewModel.test.js +0 -130
  170. package/util/calculateDynamicBlocks.test.js +0 -74
  171. package/util/calculateStaticBlocks.test.js +0 -297
  172. package/util/declare.d.js +0 -1
  173. package/util/formatFastaStrings.test.js +0 -40
  174. package/util/index.test.js +0 -213
  175. package/util/jexlStrings.test.js +0 -48
  176. package/util/layouts/GranularRectLayout.test.js +0 -99
  177. package/util/range.test.js +0 -64
  178. package/util/simpleFeature.test.js +0 -34
  179. package/util/stats.test.js +0 -172
package/util/jexl.js CHANGED
@@ -1,116 +1,61 @@
1
1
  "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports.default = _default;
9
-
10
- var _jexl = _interopRequireDefault(require("jexl"));
11
-
12
- function
13
- /* config?: any*/
14
- _default() {
15
- var j = new _jexl.default.Jexl(); // someday will make sure all of configs callbacks are added in, including
16
- // ones passed in
17
- // below are core functions
18
-
19
- j.addFunction('get', function (feature, data) {
20
- return feature.get(data);
21
- });
22
- j.addFunction('parent', function (feature) {
23
- return feature.parent();
24
- });
25
- j.addFunction('id', function (feature) {
26
- return feature.id();
27
- }); // let user cast a jexl type into a javascript type
28
-
29
- j.addFunction('cast', function (arg) {
30
- return arg;
31
- }); // logging
32
-
33
- j.addFunction('log', function (thing) {
34
- console.log(thing); // eslint-disable-line no-console
35
-
36
- return thing;
37
- }); // math
38
- // addfunction added in jexl 2.3 but types/jexl still on 2.2
39
-
40
- j.addFunction('max', Math.max);
41
- j.addFunction('min', Math.min);
42
- j.addFunction('sqrt', Math.sqrt);
43
- j.addFunction('ceil', Math.ceil);
44
- j.addFunction('floor', Math.floor);
45
- j.addFunction('round', Math.round);
46
- j.addFunction('abs', Math.abs);
47
- j.addFunction('log10', Math.log10);
48
- j.addFunction('parseInt', Number.parseInt);
49
- j.addFunction('parseFloat', Number.parseFloat); // string
50
-
51
- j.addFunction('split', function (s, char) {
52
- return s.split(char);
53
- });
54
- j.addFunction('charAt', function (s, index) {
55
- return s.charAt(index);
56
- });
57
- j.addFunction('charCodeAt', function (s, index) {
58
- return s.charCodeAt(index);
59
- });
60
- j.addFunction('codePointAt', function (s, pos) {
61
- return s.codePointAt(pos);
62
- });
63
- j.addFunction('startsWith', function (s, search, len) {
64
- return s.startsWith(search, len);
65
- });
66
- j.addFunction('endsWith', function (s, search, len) {
67
- return s.endsWith(search, len);
68
- });
69
- j.addFunction('padEnd', function (s, len, pad) {
70
- return s.padEnd(len, pad);
71
- });
72
- j.addFunction('padStart', function (s, len, fill) {
73
- return s.padStart(len, fill);
74
- });
75
- j.addFunction('repeat', function (s, count) {
76
- return s.repeat(count);
77
- });
78
- j.addFunction('replace', function (s, match, sub) {
79
- return s.replace(match, sub);
80
- });
81
- j.addFunction('replaceAll', function (s, match, sub) {
82
- return s.replaceAll(match, sub);
83
- });
84
- j.addFunction('slice', function (s, start, end) {
85
- return s.slice(start, end);
86
- });
87
- j.addFunction('startsWith', function (s, search, pos) {
88
- return s.startsWith(search, pos);
89
- });
90
- j.addFunction('substring', function (s, start, end) {
91
- return s.substring(start, end);
92
- });
93
- j.addFunction('toLowerCase', function (s) {
94
- return s.toLowerCase();
95
- });
96
- j.addFunction('toUpperCase', function (s) {
97
- return s.toUpperCase();
98
- });
99
- j.addFunction('trim', function (s) {
100
- return s.trim();
101
- });
102
- j.addFunction('trimEnd', function (s) {
103
- return s.trimEnd();
104
- });
105
- j.addFunction('trimStart', function (s) {
106
- return s.trimStart();
107
- });
108
- j.addFunction('getTag', function (feature, s) {
109
- var tags = feature.get('tags');
110
- return tags ? tags[s] : feature.get(s);
111
- });
112
- j.addBinaryOp('&', 15, function (a, b) {
113
- return a & b;
114
- });
115
- return j;
116
- }
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const jexl_1 = __importDefault(require("jexl"));
7
+ function default_1( /* config?: any*/) {
8
+ const j = new jexl_1.default.Jexl();
9
+ // someday will make sure all of configs callbacks are added in, including
10
+ // ones passed in
11
+ // below are core functions
12
+ j.addFunction('get', (feature, data) => feature.get(data));
13
+ j.addFunction('parent', (feature) => feature.parent());
14
+ j.addFunction('id', (feature) => feature.id());
15
+ // let user cast a jexl type into a javascript type
16
+ j.addFunction('cast', (arg) => arg);
17
+ // logging
18
+ j.addFunction('log', (thing) => {
19
+ console.log(thing); // eslint-disable-line no-console
20
+ return thing;
21
+ });
22
+ // math
23
+ // addfunction added in jexl 2.3 but types/jexl still on 2.2
24
+ j.addFunction('max', Math.max);
25
+ j.addFunction('min', Math.min);
26
+ j.addFunction('sqrt', Math.sqrt);
27
+ j.addFunction('ceil', Math.ceil);
28
+ j.addFunction('floor', Math.floor);
29
+ j.addFunction('round', Math.round);
30
+ j.addFunction('abs', Math.abs);
31
+ j.addFunction('log10', Math.log10);
32
+ j.addFunction('parseInt', Number.parseInt);
33
+ j.addFunction('parseFloat', Number.parseFloat);
34
+ // string
35
+ j.addFunction('split', (s, char) => s.split(char));
36
+ j.addFunction('charAt', (s, index) => s.charAt(index));
37
+ j.addFunction('charCodeAt', (s, index) => s.charCodeAt(index));
38
+ j.addFunction('codePointAt', (s, pos) => s.codePointAt(pos));
39
+ j.addFunction('startsWith', (s, search, len) => s.startsWith(search, len));
40
+ j.addFunction('endsWith', (s, search, len) => s.endsWith(search, len));
41
+ j.addFunction('padEnd', (s, len, pad) => s.padEnd(len, pad));
42
+ j.addFunction('padStart', (s, len, fill) => s.padStart(len, fill));
43
+ j.addFunction('repeat', (s, count) => s.repeat(count));
44
+ j.addFunction('replace', (s, match, sub) => s.replace(match, sub));
45
+ j.addFunction('replaceAll', (s, match, sub) => s.replaceAll(match, sub));
46
+ j.addFunction('slice', (s, start, end) => s.slice(start, end));
47
+ j.addFunction('startsWith', (s, search, pos) => s.startsWith(search, pos));
48
+ j.addFunction('substring', (s, start, end) => s.substring(start, end));
49
+ j.addFunction('toLowerCase', (s) => s.toLowerCase());
50
+ j.addFunction('toUpperCase', (s) => s.toUpperCase());
51
+ j.addFunction('trim', (s) => s.trim());
52
+ j.addFunction('trimEnd', (s) => s.trimEnd());
53
+ j.addFunction('trimStart', (s) => s.trimStart());
54
+ j.addFunction('getTag', (feature, s) => {
55
+ const tags = feature.get('tags');
56
+ return tags ? tags[s] : feature.get(s);
57
+ });
58
+ j.addBinaryOp('&', 15, (a, b) => a & b);
59
+ return j;
60
+ }
61
+ exports.default = default_1;
@@ -1,40 +1,35 @@
1
1
  "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports.stringToJexlExpression = stringToJexlExpression;
9
-
10
- var _jexl = _interopRequireDefault(require("./jexl"));
11
-
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.stringToJexlExpression = void 0;
7
+ const jexl_1 = __importDefault(require("./jexl"));
12
8
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
13
- var compilationCache = {}; // revert function strings back to main, create a different file for jexlStrings.ts
9
+ const compilationCache = {};
10
+ // revert function strings back to main, create a different file for jexlStrings.ts
14
11
  // pass the jexl property of the pluginManager as a param
15
-
16
12
  /**
17
13
  * compile a jexlExpression to a string
18
14
  *
19
15
  * @param str - string of code like `jexl:...`
20
16
  * @param options -
21
17
  */
22
-
23
- function stringToJexlExpression(str, // eslint-disable-next-line @typescript-eslint/no-explicit-any
18
+ function stringToJexlExpression(str,
19
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
24
20
  jexl) {
25
- var cacheKey = "nosig|".concat(str);
26
-
27
- if (!compilationCache[cacheKey]) {
28
- var match = str.startsWith('jexl:');
29
-
30
- if (!match) {
31
- throw new Error('string does not appear to be in jexl format');
21
+ const cacheKey = `nosig|${str}`;
22
+ if (!compilationCache[cacheKey]) {
23
+ const match = str.startsWith('jexl:');
24
+ if (!match) {
25
+ throw new Error('string does not appear to be in jexl format');
26
+ }
27
+ const code = str.split('jexl:')[1];
28
+ const compiled = jexl
29
+ ? jexl.compile(`${code}`)
30
+ : (0, jexl_1.default)().compile(`${code}`);
31
+ compilationCache[cacheKey] = compiled;
32
32
  }
33
-
34
- var code = str.split('jexl:')[1];
35
- var compiled = jexl ? jexl.compile("".concat(code)) : (0, _jexl.default)().compile("".concat(code));
36
- compilationCache[cacheKey] = compiled;
37
- }
38
-
39
- return compilationCache[cacheKey];
40
- }
33
+ return compilationCache[cacheKey];
34
+ }
35
+ exports.stringToJexlExpression = stringToJexlExpression;
@@ -1,5 +1,2 @@
1
1
  "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
2
+ Object.defineProperty(exports, "__esModule", { value: true });