ketcher-react 2.21.0-rc.2 → 2.22.0-rc.1-dev.1

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.
@@ -1785,7 +1785,7 @@ var atom = {
1785
1785
  charge: {
1786
1786
  title: 'Charge',
1787
1787
  type: 'string',
1788
- pattern: '^([+-]?)([0-9]{1,3})([+-]?)$',
1788
+ pattern: '^([+-]?)(1[0-5]|0|[0-9])([+-]?)$',
1789
1789
  maxLength: 4,
1790
1790
  "default": '',
1791
1791
  invalidMessage: 'Invalid charge value'
@@ -2081,6 +2081,11 @@ var attachSchema = {
2081
2081
  }
2082
2082
  };
2083
2083
 
2084
+ function matchCharge(charge) {
2085
+ var regex = new RegExp(atom.properties.charge.pattern);
2086
+ return regex.exec(charge);
2087
+ }
2088
+
2084
2089
  var _excluded$z = ["aromaticity", "ringMembership", "ringSize", "connectivity", "chirality", "customQuery"],
2085
2090
  _excluded2$7 = ["type", "radiobuttons"];
2086
2091
  function ownKeys$1j(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
@@ -2181,21 +2186,21 @@ function fromAtom(satom) {
2181
2186
  customQuery: satom.queryProperties.customQuery === null ? '' : satom.queryProperties.customQuery.toString()
2182
2187
  };
2183
2188
  }
2184
- function toAtom(atom$1) {
2189
+ function toAtom(atom) {
2185
2190
  var _restAtom$exactChange, _restAtom$unsaturated;
2186
- var _atom$aromaticity = atom$1.aromaticity,
2191
+ var _atom$aromaticity = atom.aromaticity,
2187
2192
  aromaticity = _atom$aromaticity === void 0 ? null : _atom$aromaticity,
2188
- _atom$ringMembership = atom$1.ringMembership,
2193
+ _atom$ringMembership = atom.ringMembership,
2189
2194
  ringMembership = _atom$ringMembership === void 0 ? null : _atom$ringMembership,
2190
- _atom$ringSize = atom$1.ringSize,
2195
+ _atom$ringSize = atom.ringSize,
2191
2196
  ringSize = _atom$ringSize === void 0 ? null : _atom$ringSize,
2192
- _atom$connectivity = atom$1.connectivity,
2197
+ _atom$connectivity = atom.connectivity,
2193
2198
  connectivity = _atom$connectivity === void 0 ? null : _atom$connectivity,
2194
- _atom$chirality = atom$1.chirality,
2199
+ _atom$chirality = atom.chirality,
2195
2200
  chirality = _atom$chirality === void 0 ? null : _atom$chirality,
2196
- _atom$customQuery = atom$1.customQuery,
2201
+ _atom$customQuery = atom.customQuery,
2197
2202
  customQuery = _atom$customQuery === void 0 ? '' : _atom$customQuery,
2198
- restAtom = _objectWithoutProperties(atom$1, _excluded$z);
2203
+ restAtom = _objectWithoutProperties(atom, _excluded$z);
2199
2204
  if (customQuery && customQuery !== '') {
2200
2205
  return Object.assign({}, restAtom, {
2201
2206
  label: 'A',
@@ -2224,12 +2229,11 @@ function toAtom(atom$1) {
2224
2229
  exactChangeFlag: 0
2225
2230
  });
2226
2231
  }
2227
- var chargeRegexp = new RegExp(atom.properties.charge.pattern);
2228
- var pch = chargeRegexp.exec(restAtom.charge);
2232
+ var pch = matchCharge(restAtom.charge);
2229
2233
  var charge = pch ? parseInt(pch[1] + pch[3] + pch[2]) : restAtom.charge;
2230
2234
  var conv = Object.assign({}, restAtom, {
2231
2235
  isotope: restAtom.isotope ? Number(restAtom.isotope) : null,
2232
- charge: restAtom.charge ? Number(charge) : null,
2236
+ charge: restAtom.charge && charge !== 0 ? Number(charge) : null,
2233
2237
  alias: restAtom.alias || null,
2234
2238
  exactChangeFlag: +((_restAtom$exactChange = restAtom.exactChangeFlag) !== null && _restAtom$exactChange !== void 0 ? _restAtom$exactChange : false),
2235
2239
  unsaturatedAtom: +((_restAtom$unsaturated = restAtom.unsaturatedAtom) !== null && _restAtom$unsaturated !== void 0 ? _restAtom$unsaturated : false),
@@ -3586,7 +3590,7 @@ var zoom = {
3586
3590
 
3587
3591
  var openHelpLink = function openHelpLink() {
3588
3592
  var _window$open;
3589
- return (_window$open = window.open("https://github.com/epam/ketcher/blob/".concat("v2.21.0-rc.2\n", "/documentation/help.md#ketcher-overview"))) === null || _window$open === void 0 ? void 0 : _window$open.focus();
3593
+ return (_window$open = window.open("https://github.com/epam/ketcher/blob/".concat("v2.21.0-rc.1\n", "/documentation/help.md#ketcher-overview"))) === null || _window$open === void 0 ? void 0 : _window$open.focus();
3590
3594
  };
3591
3595
  var help = {
3592
3596
  help: {
@@ -27918,8 +27922,7 @@ function pseudoAtomValid(value, atomType, isCustomQuery) {
27918
27922
  return value && isGenericElement;
27919
27923
  }
27920
27924
  function chargeValid(charge, isMultipleAtoms, isCustomQuery) {
27921
- var regex = new RegExp(atom.properties.charge.pattern);
27922
- var result = regex.exec(charge);
27925
+ var result = matchCharge(charge);
27923
27926
  var isValidCharge = result && (result[1] === '' || result[3] === '');
27924
27927
  if (isCustomQuery || charge === '') {
27925
27928
  return true;
@@ -32759,8 +32762,8 @@ var KetcherBuilder = function () {
32759
32762
  initApp(element, appRoot, staticResourcesUrl, {
32760
32763
  buttons: buttons || {},
32761
32764
  errorHandler: errorHandler || null,
32762
- version: "2.21.0-rc.2" ,
32763
- buildDate: "2024-05-07T11:51:00" ,
32765
+ version: "2.22.0-rc.1-dev.1" ,
32766
+ buildDate: "2024-05-09T11:46:46" ,
32764
32767
  buildNumber: ''
32765
32768
  }, structService, resolve, togglerComponent);
32766
32769
  });