@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
@@ -1,69 +0,0 @@
1
- import * as grok from 'datagrok-api/grok';
2
- import * as ui from 'datagrok-api/ui';
3
- import * as DG from 'datagrok-api/dg';
4
- import {_package} from '../package';
5
-
6
- /* eslint-disable camelcase */
7
- export class DummyWebEditorMonomer {
8
- public readonly backgroundcolor: string = '#FF4444';
9
- public readonly linecolor: string = '#800000';
10
- public readonly textcolor: string = '#FFFFFF';
11
-
12
- // no effect
13
- // public readonly na: string = 'NA';
14
- // public readonly nature: string = 'NA';
15
-
16
- /** R-Group index os single digit only is allowed in Pistoia code */
17
- public readonly at: { [rg: string]: string } = {
18
- R1: 'H', R2: 'H', R3: 'H', R4: 'H', R5: 'H', R6: 'H', R7: 'H', R8: 'H', R9: 'H'
19
- };
20
-
21
- constructor(
22
- public readonly biotype: string,
23
- /** symbol, elem */ public readonly id: string,
24
- /** name */ public readonly n: string = 'missing',
25
- /** molfile*/ public readonly m?: string,
26
- ) {
27
- if (!this.id)
28
- throw new Error('Not supported undefined [id].');
29
-
30
- return new Proxy(this, {
31
- get: (target: any, prop: string | symbol, _receiver: any) => {
32
- const logPrefix = `${this.toLog()}.proxy.get( '${String(prop)}' )`;
33
- switch (prop) {
34
- case 'id':
35
- case 'at':
36
- case 'na':
37
- case 'nature':
38
- case 'backgroundcolor':
39
- case 'linecolor':
40
- case 'textcolor': {
41
- // these attributes are known and handled
42
- return target[prop];
43
- }
44
- case 'rs': {
45
- /* R-Group count (?), 2 is default for monomer "?" */
46
- throw new Error('Not supported get "rs" attribute.');
47
- }
48
- default:
49
- // Unexpected attribute requested
50
- _package.logger.warning(`${logPrefix}`);
51
- return target[prop];
52
- }
53
- },
54
- set: (target, prop, value: any, _receiver: any): boolean => {
55
- throw new Error(`Not supported set '${String(prop)}' attribute, any.`);
56
- },
57
- apply: (target: any, thisArg: any, argArray: any[]): any | undefined => {
58
- throw new Error(`Not supported call (apply) '${thisArg.toString()}' method, any.`);
59
- }
60
- });
61
- }
62
-
63
- private static objCounter: number = -1;
64
- private readonly objId: number = ++DummyWebEditorMonomer.objCounter;
65
-
66
- protected toLog(): string {
67
- return `Helm: DummyWebEditorMonomer<${this.objId}>`;
68
- }
69
- }