@datagrok/helm 2.2.0 → 2.3.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 (48) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/dist/package-test.js +1 -1
  3. package/dist/package-test.js.map +1 -1
  4. package/dist/package.js +1 -1
  5. package/dist/package.js.map +1 -1
  6. package/package.json +15 -16
  7. package/src/cell-renderer.ts +13 -36
  8. package/src/constants.ts +0 -11
  9. package/src/helm-helper.ts +67 -17
  10. package/src/helm-monomer-placer.ts +8 -26
  11. package/src/helm-web-editor.ts +33 -3
  12. package/src/package-test.ts +12 -4
  13. package/src/package-utils.ts +160 -0
  14. package/src/package.ts +123 -197
  15. package/src/tests/findMonomers-tests.ts +2 -0
  16. package/src/tests/get-all-parts-tests.ts +5 -0
  17. package/src/tests/{get-molfiles.ts → get-molfiles-tests.ts} +3 -1
  18. package/src/tests/get-monomer-tests.ts +279 -0
  19. package/src/tests/helm-service-tests.ts +4 -0
  20. package/src/tests/helm-tests.ts +8 -1
  21. package/src/tests/helm-web-editor-tests.ts +55 -0
  22. package/src/tests/parse-helm-tests.ts +98 -0
  23. package/src/tests/properties-widget-tests.ts +33 -4
  24. package/src/tests/renderers-tests.ts +3 -1
  25. package/src/tests/utils.ts +6 -0
  26. package/src/types/index.ts +5 -0
  27. package/src/utils/get-hovered.ts +9 -21
  28. package/src/utils/get-monomer-dummy.ts +149 -0
  29. package/src/utils/get-monomer-of-library.ts +90 -0
  30. package/src/utils/get-monomer.ts +113 -0
  31. package/src/utils/helm-grid-cell-renderer.ts +12 -7
  32. package/src/utils/helm-service.ts +19 -45
  33. package/src/utils/index.ts +11 -17
  34. package/src/widgets/properties-widget.ts +29 -9
  35. package/tsconfig.json +1 -1
  36. package/vendor/helm-web-editor.development.js +39640 -0
  37. package/vendor/helm-web-editor.production.js +2 -0
  38. package/vendor/helm-web-editor.production.js.map +1 -0
  39. package/webpack.config.js +14 -11
  40. package/helm/JSDraw/Pistoia.HELM-uncompressed.js +0 -9694
  41. package/helm/JSDraw/Pistoia.HELM.js +0 -27
  42. package/helm/JSDraw/ReadMe.txt +0 -8
  43. package/helm/JSDraw/Scilligence.JSDraw2.Lite-uncompressed.js +0 -31126
  44. package/helm/JSDraw/Scilligence.JSDraw2.Lite.js +0 -12
  45. package/helm/JSDraw/Scilligence.JSDraw2.Resources.js +0 -762
  46. package/helm/JSDraw/dojo.js +0 -250
  47. package/helm/JSDraw/test.html +0 -24
  48. package/src/utils/dummy-monomer.ts +0 -69
package/webpack.config.js CHANGED
@@ -1,11 +1,13 @@
1
1
  const path = require('path');
2
2
  const packageName = path.parse(require('./package.json').name).name.toLowerCase().replace(/-/g, '');
3
3
 
4
+ const mode = process.env.NODE_ENV ?? 'production';
5
+ if (mode !== 'production')
6
+ console.warn(`Building '${packageName}' in '${mode}' mode.`);
7
+
4
8
  module.exports = {
5
- cache: {
6
- type: 'filesystem',
7
- },
8
- mode: 'development',
9
+ ...(mode !== 'production' ? {} : {cache: {type: 'filesystem'}}),
10
+ mode: mode,
9
11
  entry: {
10
12
  package: './src/package.ts',
11
13
  test: {
@@ -17,15 +19,20 @@ module.exports = {
17
19
  resolve: {
18
20
  fallback: {'url': false},
19
21
  extensions: ['.ts', '.tsx', '.js', '.wasm', '.mjs', '.json'],
22
+ alias: {
23
+ 'vendor/helm-web-editor': mode === 'production' ?
24
+ path.resolve(__dirname, 'vendor', 'helm-web-editor.production.js') :
25
+ path.resolve(__dirname, 'vendor', 'helm-web-editor.development.js'),
26
+ },
20
27
  },
21
28
  devServer: {
22
29
  contentBase: './dist',
23
30
  },
24
31
  module: {
25
32
  rules: [
26
- {test: /\.js$/, enforce: 'pre', use: ['source-map-loader'], exclude: /node_modules/},
27
- {test: /\.ts(x?)$/, use: 'ts-loader', exclude: /node_modules/},
28
- {test: /\.css$/, use: ['style-loader', 'css-loader'], exclude: /node_modules/},
33
+ {test: /\.js$/, enforce: 'pre', use: ['source-map-loader'], exclude: [/node_modules/, /vendor/]},
34
+ {test: /\.ts(x?)$/, use: 'ts-loader', exclude: [/node_modules/, /vendor/]},
35
+ {test: /\.css$/, use: ['style-loader', 'css-loader'], exclude: [/node_modules/, /vendor/]},
29
36
  ],
30
37
  },
31
38
  devtool: 'source-map',
@@ -39,10 +46,6 @@ module.exports = {
39
46
  'cash-dom': '$',
40
47
  'dayjs': 'dayjs',
41
48
  'wu': 'wu',
42
- 'scil': 'scil',
43
- 'org': 'org',
44
- 'dojo': 'dojo',
45
- 'JSDraw2': 'JSDraw2',
46
49
  },
47
50
  output: {
48
51
  filename: '[name].js',