ketcher-react 2.21.0-rc.1 → 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.
- package/dist/index.js +19 -16
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +19 -16
- package/dist/index.modern.js.map +1 -1
- package/dist/script/ui/data/utils.d.ts +11 -0
- package/dist/script/ui/data/utils.test.d.ts +1 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1850,7 +1850,7 @@ var atom = {
|
|
|
1850
1850
|
charge: {
|
|
1851
1851
|
title: 'Charge',
|
|
1852
1852
|
type: 'string',
|
|
1853
|
-
pattern: '^([+-]?)([0-9]
|
|
1853
|
+
pattern: '^([+-]?)(1[0-5]|0|[0-9])([+-]?)$',
|
|
1854
1854
|
maxLength: 4,
|
|
1855
1855
|
"default": '',
|
|
1856
1856
|
invalidMessage: 'Invalid charge value'
|
|
@@ -2146,6 +2146,11 @@ var attachSchema = {
|
|
|
2146
2146
|
}
|
|
2147
2147
|
};
|
|
2148
2148
|
|
|
2149
|
+
function matchCharge(charge) {
|
|
2150
|
+
var regex = new RegExp(atom.properties.charge.pattern);
|
|
2151
|
+
return regex.exec(charge);
|
|
2152
|
+
}
|
|
2153
|
+
|
|
2149
2154
|
var _excluded$z = ["aromaticity", "ringMembership", "ringSize", "connectivity", "chirality", "customQuery"],
|
|
2150
2155
|
_excluded2$7 = ["type", "radiobuttons"];
|
|
2151
2156
|
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; }
|
|
@@ -2246,21 +2251,21 @@ function fromAtom(satom) {
|
|
|
2246
2251
|
customQuery: satom.queryProperties.customQuery === null ? '' : satom.queryProperties.customQuery.toString()
|
|
2247
2252
|
};
|
|
2248
2253
|
}
|
|
2249
|
-
function toAtom(atom
|
|
2254
|
+
function toAtom(atom) {
|
|
2250
2255
|
var _restAtom$exactChange, _restAtom$unsaturated;
|
|
2251
|
-
var _atom$aromaticity = atom
|
|
2256
|
+
var _atom$aromaticity = atom.aromaticity,
|
|
2252
2257
|
aromaticity = _atom$aromaticity === void 0 ? null : _atom$aromaticity,
|
|
2253
|
-
_atom$ringMembership = atom
|
|
2258
|
+
_atom$ringMembership = atom.ringMembership,
|
|
2254
2259
|
ringMembership = _atom$ringMembership === void 0 ? null : _atom$ringMembership,
|
|
2255
|
-
_atom$ringSize = atom
|
|
2260
|
+
_atom$ringSize = atom.ringSize,
|
|
2256
2261
|
ringSize = _atom$ringSize === void 0 ? null : _atom$ringSize,
|
|
2257
|
-
_atom$connectivity = atom
|
|
2262
|
+
_atom$connectivity = atom.connectivity,
|
|
2258
2263
|
connectivity = _atom$connectivity === void 0 ? null : _atom$connectivity,
|
|
2259
|
-
_atom$chirality = atom
|
|
2264
|
+
_atom$chirality = atom.chirality,
|
|
2260
2265
|
chirality = _atom$chirality === void 0 ? null : _atom$chirality,
|
|
2261
|
-
_atom$customQuery = atom
|
|
2266
|
+
_atom$customQuery = atom.customQuery,
|
|
2262
2267
|
customQuery = _atom$customQuery === void 0 ? '' : _atom$customQuery,
|
|
2263
|
-
restAtom = _objectWithoutProperties__default["default"](atom
|
|
2268
|
+
restAtom = _objectWithoutProperties__default["default"](atom, _excluded$z);
|
|
2264
2269
|
if (customQuery && customQuery !== '') {
|
|
2265
2270
|
return Object.assign({}, restAtom, {
|
|
2266
2271
|
label: 'A',
|
|
@@ -2289,12 +2294,11 @@ function toAtom(atom$1) {
|
|
|
2289
2294
|
exactChangeFlag: 0
|
|
2290
2295
|
});
|
|
2291
2296
|
}
|
|
2292
|
-
var
|
|
2293
|
-
var pch = chargeRegexp.exec(restAtom.charge);
|
|
2297
|
+
var pch = matchCharge(restAtom.charge);
|
|
2294
2298
|
var charge = pch ? parseInt(pch[1] + pch[3] + pch[2]) : restAtom.charge;
|
|
2295
2299
|
var conv = Object.assign({}, restAtom, {
|
|
2296
2300
|
isotope: restAtom.isotope ? Number(restAtom.isotope) : null,
|
|
2297
|
-
charge: restAtom.charge ? Number(charge) : null,
|
|
2301
|
+
charge: restAtom.charge && charge !== 0 ? Number(charge) : null,
|
|
2298
2302
|
alias: restAtom.alias || null,
|
|
2299
2303
|
exactChangeFlag: +((_restAtom$exactChange = restAtom.exactChangeFlag) !== null && _restAtom$exactChange !== void 0 ? _restAtom$exactChange : false),
|
|
2300
2304
|
unsaturatedAtom: +((_restAtom$unsaturated = restAtom.unsaturatedAtom) !== null && _restAtom$unsaturated !== void 0 ? _restAtom$unsaturated : false),
|
|
@@ -27983,8 +27987,7 @@ function pseudoAtomValid(value, atomType, isCustomQuery) {
|
|
|
27983
27987
|
return value && isGenericElement;
|
|
27984
27988
|
}
|
|
27985
27989
|
function chargeValid(charge, isMultipleAtoms, isCustomQuery) {
|
|
27986
|
-
var
|
|
27987
|
-
var result = regex.exec(charge);
|
|
27990
|
+
var result = matchCharge(charge);
|
|
27988
27991
|
var isValidCharge = result && (result[1] === '' || result[3] === '');
|
|
27989
27992
|
if (isCustomQuery || charge === '') {
|
|
27990
27993
|
return true;
|
|
@@ -32824,8 +32827,8 @@ var KetcherBuilder = function () {
|
|
|
32824
32827
|
initApp(element, appRoot, staticResourcesUrl, {
|
|
32825
32828
|
buttons: buttons || {},
|
|
32826
32829
|
errorHandler: errorHandler || null,
|
|
32827
|
-
version: "2.
|
|
32828
|
-
buildDate: "2024-
|
|
32830
|
+
version: "2.22.0-rc.1-dev.1" ,
|
|
32831
|
+
buildDate: "2024-05-09T11:46:46" ,
|
|
32829
32832
|
buildNumber: ''
|
|
32830
32833
|
}, structService, resolve, togglerComponent);
|
|
32831
32834
|
});
|