openchemlib 8.16.0 → 8.18.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.
@@ -10,7 +10,6 @@ function initCanvasEditor(
10
10
  Reaction,
11
11
  ) {
12
12
  class CanvasEditor {
13
- #isReadOnly;
14
13
  #editorArea;
15
14
  // Can be useful for debugging.
16
15
  /* eslint-disable no-unused-private-class-members */
@@ -22,7 +21,6 @@ function initCanvasEditor(
22
21
  #destroy;
23
22
 
24
23
  constructor(parentElement, options = {}) {
25
- const { readOnly = false } = options;
26
24
  const { editorArea, toolbar, uiHelper, destroy } = createEditor(
27
25
  parentElement,
28
26
  options,
@@ -33,7 +31,6 @@ function initCanvasEditor(
33
31
  Molecule,
34
32
  Reaction,
35
33
  );
36
- this.#isReadOnly = readOnly;
37
34
  this.#editorArea = editorArea;
38
35
  this.#toolbar = toolbar;
39
36
  this.#uiHelper = uiHelper;
@@ -82,8 +79,6 @@ function initCanvasEditor(
82
79
  setOnChangeListener(onChange) {
83
80
  this.#checkNotDestroyed();
84
81
 
85
- if (this.#isReadOnly) return;
86
-
87
82
  this.#onChange = onChange;
88
83
  }
89
84
 
@@ -120,7 +115,6 @@ function initCanvasEditor(
120
115
  * @param {{ what: number; isUserEvent: boolean; }} event
121
116
  */
122
117
  #handleChange(event) {
123
- if (this.#isReadOnly) return;
124
118
  if (!this.#onChange) return;
125
119
 
126
120
  const { what, isUserEvent } = event;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openchemlib",
3
- "version": "8.16.0",
3
+ "version": "8.18.0",
4
4
  "description": "Manipulate molecules",
5
5
  "keywords": [
6
6
  "chemistry",
@@ -33,7 +33,7 @@
33
33
  "prettier": "prettier --check .",
34
34
  "prettier-write": "prettier --write .",
35
35
  "test": "npm run build && npm run test-only && npm run eslint && npm run prettier",
36
- "test-only": "jest",
36
+ "test-only": "vitest run",
37
37
  "vite": "vite --open",
38
38
  "vite-build": "vite build",
39
39
  "vite-preview": "vite preview"
@@ -77,27 +77,26 @@
77
77
  },
78
78
  "homepage": "https://github.com/cheminfo/openchemlib-js",
79
79
  "devDependencies": {
80
- "@types/jest": "^29.5.13",
81
- "@types/node": "^22.7.4",
80
+ "@types/node": "^22.13.1",
82
81
  "autoprefixer": "^10.4.20",
83
82
  "benchmark": "^2.1.4",
84
- "esbuild": "^0.24.0",
85
- "eslint": "^9.12.0",
86
- "eslint-config-cheminfo-typescript": "^16.0.0",
83
+ "esbuild": "^0.24.2",
84
+ "eslint": "^9.19.0",
85
+ "eslint-config-cheminfo-typescript": "^17.0.0",
87
86
  "fast-png": "^6.2.0",
88
- "globals": "^15.10.0",
87
+ "globals": "^15.14.0",
89
88
  "gwt-api-exporter": "^2.0.0",
90
- "image-js": "0.0.0-next-d280f46ab7",
91
- "jest": "^29.7.0",
92
- "openchemlib-utils": "^6.4.1",
93
- "postcss": "^8.4.47",
94
- "prettier": "^3.3.3",
89
+ "image-js": "0.0.0-next-692b15513a",
90
+ "openchemlib-utils": "^6.5.2",
91
+ "postcss": "^8.5.1",
92
+ "prettier": "^3.4.2",
95
93
  "tailwindcss": "^3.4.13",
96
- "typescript": "^5.6.2",
97
- "vite": "^5.4.8",
94
+ "typescript": "^5.7.3",
95
+ "vite": "^6.0.11",
96
+ "vitest": "^3.0.5",
98
97
  "yargs": "^17.7.2"
99
98
  },
100
99
  "volta": {
101
- "node": "22.9.0"
100
+ "node": "22.13.1"
102
101
  }
103
102
  }
package/types.d.ts CHANGED
@@ -342,12 +342,19 @@ export declare class Molecule {
342
342
  static cBondQFNarrowing: number;
343
343
  static cBondQFBondTypes: number;
344
344
  static cBondQFRareBondTypes: number;
345
+ /* @deprecated Use `cBondTypeSingle` instead */
345
346
  static cBondQFSingle: number;
347
+ /* @deprecated Use `cBondTypeDouble` instead */
346
348
  static cBondQFDouble: number;
349
+ /* @deprecated Use `cBondTypeTriple` instead */
347
350
  static cBondQFTriple: number;
351
+ /* @deprecated Use `cBondTypeDelocalized` instead */
348
352
  static cBondQFDelocalized: number;
353
+ /* @deprecated Use `cBondTypeMetalLigand` instead */
349
354
  static cBondQFMetalLigand: number;
355
+ /* @deprecated Use `cBondTypeQuadruple` instead */
350
356
  static cBondQFQuadruple: number;
357
+ /* @deprecated Use `cBondTypeQuintuple` instead */
351
358
  static cBondQFQuintuple: number;
352
359
  static cBondQFRingState: number;
353
360
  static cBondQFNotRing: number;
@@ -3145,20 +3152,15 @@ export type ReactionEncoderDecodeOptions =
3145
3152
 
3146
3153
  // eslint-disable-next-line @typescript-eslint/no-extraneous-class
3147
3154
  export declare class ReactionEncoder {
3148
- static readonly INCLUDE_MAPPING = 0b00001;
3149
- static readonly INCLUDE_COORDS = 0b00010;
3150
- static readonly INCLUDE_DRAWING_OBJECTS = 0b00100;
3151
- static readonly INCLUDE_CATALYSTS = 0b01000;
3152
- static readonly RETAIN_REACTANT_AND_PRODUCT_ORDER = 0b10000;
3153
-
3154
- static readonly INCLUDE_ALL =
3155
- ReactionEncoder.INCLUDE_MAPPING |
3156
- ReactionEncoder.INCLUDE_COORDS |
3157
- ReactionEncoder.INCLUDE_DRAWING_OBJECTS |
3158
- ReactionEncoder.INCLUDE_CATALYSTS;
3159
- static readonly INCLUDE_RXN_CODE_ONLY = 0b00000;
3160
- static readonly INCLUDE_DEFAULT =
3161
- ReactionEncoder.INCLUDE_MAPPING | ReactionEncoder.INCLUDE_COORDS;
3155
+ static readonly INCLUDE_MAPPING: number;
3156
+ static readonly INCLUDE_COORDS: number;
3157
+ static readonly INCLUDE_DRAWING_OBJECTS: number;
3158
+ static readonly INCLUDE_CATALYSTS: number;
3159
+ static readonly RETAIN_REACTANT_AND_PRODUCT_ORDER: number;
3160
+
3161
+ static readonly INCLUDE_ALL: number;
3162
+ static readonly INCLUDE_RXN_CODE_ONLY: number;
3163
+ static readonly INCLUDE_DEFAULT: number;
3162
3164
 
3163
3165
  static readonly MOLECULE_DELIMITER: string;
3164
3166
  static readonly OBJECT_DELIMITER: string;