@jbrowse/core 1.7.11 → 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 (204) hide show
  1. package/BaseFeatureWidget/BaseFeatureDetail.d.ts +20 -4
  2. package/BaseFeatureWidget/BaseFeatureDetail.js +313 -558
  3. package/BaseFeatureWidget/SequenceFeatureDetails.js +213 -473
  4. package/BaseFeatureWidget/index.d.ts +2 -2
  5. package/BaseFeatureWidget/index.js +88 -124
  6. package/BaseFeatureWidget/types.d.ts +1 -0
  7. package/BaseFeatureWidget/types.js +1 -4
  8. package/BaseFeatureWidget/util.js +40 -75
  9. package/CorePlugin.js +55 -94
  10. package/Plugin.js +9 -34
  11. package/PluginLoader.js +153 -422
  12. package/PluginManager.d.ts +84 -117
  13. package/PluginManager.js +377 -666
  14. package/ReExports/Attributes.d.ts +2 -0
  15. package/ReExports/Attributes.js +5 -0
  16. package/ReExports/BaseCard.d.ts +2 -0
  17. package/ReExports/BaseCard.js +5 -0
  18. package/ReExports/DataGrid.d.ts +2 -0
  19. package/ReExports/DataGrid.js +6 -0
  20. package/ReExports/FeatureDetails.d.ts +2 -0
  21. package/ReExports/FeatureDetails.js +5 -0
  22. package/ReExports/index.js +6 -12
  23. package/ReExports/list.d.ts +5 -0
  24. package/ReExports/list.js +271 -7
  25. package/ReExports/material-ui-colors.d.ts +1 -19
  26. package/ReExports/material-ui-colors.js +16 -158
  27. package/ReExports/modules.d.ts +68 -109
  28. package/ReExports/modules.js +455 -244
  29. package/TextSearch/BaseResults.js +51 -123
  30. package/TextSearch/TextSearchManager.d.ts +3 -1
  31. package/TextSearch/TextSearchManager.js +66 -144
  32. package/assemblyManager/assembly.js +280 -554
  33. package/assemblyManager/assemblyConfigSchema.js +47 -64
  34. package/assemblyManager/assemblyManager.d.ts +12 -10
  35. package/assemblyManager/assemblyManager.js +126 -270
  36. package/assemblyManager/index.js +9 -22
  37. package/configuration/configurationSchema.js +167 -203
  38. package/configuration/configurationSlot.js +248 -326
  39. package/configuration/index.js +19 -35
  40. package/configuration/util.d.ts +1 -1
  41. package/configuration/util.js +131 -173
  42. package/data_adapters/BaseAdapter.d.ts +2 -2
  43. package/data_adapters/BaseAdapter.js +132 -521
  44. package/data_adapters/CytobandAdapter.js +40 -126
  45. package/data_adapters/dataAdapterCache.js +77 -158
  46. package/package.json +16 -18
  47. package/pluggableElementTypes/AdapterType.js +24 -79
  48. package/pluggableElementTypes/AddTrackWorkflowType.d.ts +17 -0
  49. package/pluggableElementTypes/AddTrackWorkflowType.js +20 -0
  50. package/pluggableElementTypes/ConnectionType.js +22 -65
  51. package/pluggableElementTypes/DisplayType.js +35 -82
  52. package/pluggableElementTypes/InternetAccountType.js +23 -64
  53. package/pluggableElementTypes/PluggableElementBase.js +8 -20
  54. package/pluggableElementTypes/RpcMethodType.js +85 -427
  55. package/pluggableElementTypes/TextSearchAdapterType.js +16 -55
  56. package/pluggableElementTypes/TrackType.js +26 -70
  57. package/pluggableElementTypes/ViewType.js +21 -63
  58. package/pluggableElementTypes/WidgetType.js +21 -64
  59. package/pluggableElementTypes/index.d.ts +4 -3
  60. package/pluggableElementTypes/index.js +42 -125
  61. package/pluggableElementTypes/models/BaseConnectionModelFactory.js +28 -43
  62. package/pluggableElementTypes/models/BaseDisplayModel.d.ts +10 -10
  63. package/pluggableElementTypes/models/BaseDisplayModel.js +58 -95
  64. package/pluggableElementTypes/models/BaseTrackModel.d.ts +1 -1
  65. package/pluggableElementTypes/models/BaseTrackModel.js +139 -200
  66. package/pluggableElementTypes/models/BaseViewModel.js +24 -40
  67. package/pluggableElementTypes/models/InternetAccountModel.js +116 -263
  68. package/pluggableElementTypes/models/baseConnectionConfig.js +14 -25
  69. package/pluggableElementTypes/models/baseInternetAccountConfig.js +29 -38
  70. package/pluggableElementTypes/models/baseTrackConfig.js +106 -133
  71. package/pluggableElementTypes/models/index.js +21 -70
  72. package/pluggableElementTypes/renderers/BoxRendererType.js +132 -291
  73. package/pluggableElementTypes/renderers/CircularChordRendererType.js +8 -38
  74. package/pluggableElementTypes/renderers/ComparativeServerSideRendererType.js +60 -192
  75. package/pluggableElementTypes/renderers/FeatureRendererType.d.ts +0 -2
  76. package/pluggableElementTypes/renderers/FeatureRendererType.js +89 -255
  77. package/pluggableElementTypes/renderers/RendererType.js +31 -105
  78. package/pluggableElementTypes/renderers/ServerSideRenderedContent.js +61 -72
  79. package/pluggableElementTypes/renderers/ServerSideRendererType.d.ts +2 -2
  80. package/pluggableElementTypes/renderers/ServerSideRendererType.js +112 -265
  81. package/pluggableElementTypes/renderers/index.js +19 -62
  82. package/pluggableElementTypes/renderers/util/serializableFilterChain.js +27 -65
  83. package/rpc/BaseRpcDriver.js +169 -405
  84. package/rpc/MainThreadRpcDriver.js +27 -150
  85. package/rpc/RpcManager.js +58 -159
  86. package/rpc/WebWorkerRpcDriver.js +54 -171
  87. package/rpc/configSchema.js +25 -49
  88. package/rpc/coreRpcMethods.d.ts +1 -3
  89. package/rpc/coreRpcMethods.js +221 -959
  90. package/rpc/remoteAbortSignals.js +46 -70
  91. package/tsconfig.build.tsbuildinfo +1 -1
  92. package/ui/AboutDialog.js +107 -158
  93. package/ui/App.js +157 -261
  94. package/ui/AssemblySelector.d.ts +1 -1
  95. package/ui/AssemblySelector.js +59 -115
  96. package/ui/CascadingMenu.js +100 -199
  97. package/ui/ColorPicker.d.ts +16 -0
  98. package/ui/ColorPicker.js +97 -0
  99. package/ui/Drawer.js +28 -58
  100. package/ui/DrawerWidget.js +109 -209
  101. package/ui/DropDownMenu.d.ts +0 -8
  102. package/ui/DropDownMenu.js +60 -97
  103. package/ui/EditableTypography.d.ts +1 -1
  104. package/ui/EditableTypography.js +87 -155
  105. package/ui/ErrorMessage.js +41 -66
  106. package/ui/FactoryResetDialog.js +24 -57
  107. package/ui/FatalErrorDialog.js +59 -91
  108. package/ui/FileSelector/FileSelector.js +123 -189
  109. package/ui/FileSelector/LocalFileChooser.js +44 -71
  110. package/ui/FileSelector/UrlChooser.js +17 -38
  111. package/ui/FileSelector/index.js +6 -12
  112. package/ui/Icons.d.ts +1 -1
  113. package/ui/Icons.js +45 -69
  114. package/ui/Logo.js +57 -110
  115. package/ui/Menu.d.ts +1 -1
  116. package/ui/Menu.js +232 -355
  117. package/ui/PrerenderedCanvas.js +63 -78
  118. package/ui/ResizeHandle.js +87 -114
  119. package/ui/ReturnToImportFormDialog.js +32 -59
  120. package/ui/SanitizedHTML.js +63 -52
  121. package/ui/Snackbar.js +74 -99
  122. package/ui/SnackbarModel.js +37 -51
  123. package/ui/Tooltip.d.ts +3 -1
  124. package/ui/Tooltip.js +49 -74
  125. package/ui/ViewContainer.js +113 -183
  126. package/ui/colors.d.ts +10 -0
  127. package/ui/colors.js +78 -0
  128. package/ui/index.js +51 -181
  129. package/ui/react-colorful.d.ts +17 -0
  130. package/ui/react-colorful.js +455 -0
  131. package/ui/theme.d.ts +279 -131
  132. package/ui/theme.js +197 -225
  133. package/util/Base1DUtils.d.ts +32 -0
  134. package/util/Base1DUtils.js +174 -0
  135. package/util/Base1DViewModel.d.ts +16 -37
  136. package/util/Base1DViewModel.js +116 -295
  137. package/util/QuickLRU.js +84 -332
  138. package/util/TimeTraveller.d.ts +19 -0
  139. package/util/TimeTraveller.js +86 -0
  140. package/util/aborting.js +49 -127
  141. package/util/analytics.js +91 -154
  142. package/util/blockTypes.js +106 -240
  143. package/util/calculateDynamicBlocks.js +98 -128
  144. package/util/calculateStaticBlocks.js +105 -125
  145. package/util/color/cssColorsLevel4.js +156 -160
  146. package/util/color/index.js +33 -55
  147. package/util/compositeMap.js +49 -333
  148. package/util/formatFastaStrings.js +9 -14
  149. package/util/idMaker.js +18 -31
  150. package/util/index.d.ts +18 -39
  151. package/util/index.js +743 -1236
  152. package/util/io/RemoteFileWithRangeCache.js +88 -257
  153. package/util/io/index.js +95 -169
  154. package/util/jexl.js +60 -115
  155. package/util/jexlStrings.js +24 -29
  156. package/util/layouts/BaseLayout.js +1 -4
  157. package/util/layouts/GranularRectLayout.js +388 -557
  158. package/util/layouts/MultiLayout.js +41 -109
  159. package/util/layouts/PrecomputedLayout.js +56 -114
  160. package/util/layouts/PrecomputedMultiLayout.js +22 -59
  161. package/util/layouts/SceneGraph.js +127 -197
  162. package/util/layouts/index.js +29 -66
  163. package/util/mst-reflection.js +55 -71
  164. package/util/offscreenCanvasPonyfill.js +66 -134
  165. package/util/offscreenCanvasUtils.d.ts +2 -7
  166. package/util/offscreenCanvasUtils.js +49 -146
  167. package/util/range.js +29 -40
  168. package/util/rxjs.js +20 -27
  169. package/util/simpleFeature.js +88 -152
  170. package/util/stats.js +91 -151
  171. package/util/tracks.js +130 -171
  172. package/util/types/index.d.ts +3 -3
  173. package/util/types/index.js +110 -179
  174. package/util/types/mst.d.ts +3 -3
  175. package/util/types/mst.js +91 -142
  176. package/util/types/util.js +1 -4
  177. package/util/when.js +54 -101
  178. package/BaseFeatureWidget/SequenceFeatureDetails.test.js +0 -122
  179. package/BaseFeatureWidget/index.test.js +0 -51
  180. package/TextSearch/BaseResults.test.js +0 -42
  181. package/configuration/configurationSchema.test.js +0 -266
  182. package/configuration/configurationSlot.test.js +0 -69
  183. package/configuration/util.test.js +0 -39
  184. package/data_adapters/BaseAdapter.test.js +0 -200
  185. package/declare.d.js +0 -1
  186. package/pluggableElementTypes/RpcMethodType.test.js +0 -118
  187. package/pluggableElementTypes/renderers/declare.d.js +0 -1
  188. package/pluggableElementTypes/renderers/util/serializableFilterChain.test.js +0 -20
  189. package/rpc/BaseRpcDriver.test.js +0 -540
  190. package/rpc/declaration.d.js +0 -1
  191. package/ui/FatalErrorDialog.test.js +0 -82
  192. package/ui/SanitizedHTML.test.js +0 -36
  193. package/ui/theme.test.js +0 -111
  194. package/util/Base1DViewModel.test.js +0 -130
  195. package/util/calculateDynamicBlocks.test.js +0 -74
  196. package/util/calculateStaticBlocks.test.js +0 -297
  197. package/util/declare.d.js +0 -1
  198. package/util/formatFastaStrings.test.js +0 -40
  199. package/util/index.test.js +0 -213
  200. package/util/jexlStrings.test.js +0 -48
  201. package/util/layouts/GranularRectLayout.test.js +0 -99
  202. package/util/range.test.js +0 -64
  203. package/util/simpleFeature.test.js +0 -34
  204. 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 });