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